query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
string packDefineBitsLosslessTag( integer BitmapID, integer BitmapID, integer BitmapFormat, integer BitmapWidth, integer BitmapHeight, integer BitmapColorTableSize, string ZlibBitmapData) return an SWF DefineBitsLossless tag string. TagID: 20
function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData) { array_push($this->FMDebug, "packDefineBitsLosslessTag"); $TagID = 20; $BitmapID = $this->packUI16($BitmapID); $BitmapWidth = $this->packUI16($BitmapWidth); $BitmapHeight = $this->packUI16($BitmapHeight); switch ($BitmapFormat) { case 3: $BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); break; case 4: $BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); break; case 5: $BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); break; default: $this->FMError("packDefineBitsLosslessTag illegal argument (BitmapFormat)"); } $BitmapFormat = $this->packUI8($BitmapFormat); $TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function imageBmp($img, $file, $RLE=0)\r\n\t{\r\n\t\t$ColorCount = imagecolorstotal($img);\r\n\t\t$Transparent = imagecolortransparent($img);\r\n\t\t$IsTransparent = $Transparent != -1;\r\n\t\tif($IsTransparent)\r\n\t\t\t$ColorCount--;\r\n\t\tif($ColorCount == 0)\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 24;\r\n\t\t}\r\n\t\tif(($ColorCount > 0) && ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\t$ColorCount = 2;\r\n\t\t\t$BitCount = 1;\r\n\t\t}\r\n\t\tif(($ColorCount > 2) && ($ColorCount <= 16))\r\n\t\t{\r\n\t\t\t$ColorCount = 16;\r\n\t\t\t$BitCount = 4;\r\n\t\t}\r\n\t\tif(($ColorCount > 16) && ($ColorCount <= 256))\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 8;\r\n\t\t}\r\n\t\t$Width = imageSX($img);\r\n\t\t$Height = imageSY($img);\r\n\t\t$Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4;\r\n\t\tif($BitCount < 24)\r\n\t\t\t$palsize = pow(2, $BitCount) * 4;\r\n\t\t$size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54;\r\n\t\t$size += $palsize;\r\n\t\t$offset = 54 + $palsize;\r\n\t\t// Bitmap File Header\r\n\t\t$ret = 'BM';\r\n\t\t$ret .= $this->int_to_dword($size);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword($offset);\r\n\t\t// Bitmap Info Header\r\n\t\t$ret .= $this->int_to_dword(40);\r\n\t\t$ret .= $this->int_to_dword($Width);\r\n\t\t$ret .= $this->int_to_dword($Height);\r\n\t\t$ret .= $this->int_to_word(1);\r\n\t\t$ret .= $this->int_to_word($BitCount);\r\n\t\t$ret .= $this->int_to_dword($RLE);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t// image data\r\n\t\t$CC = $ColorCount;\r\n\t\t$sl1 = strlen($ret);\r\n\t\tif($CC == 0)\r\n\t\t\t$CC = 256;\r\n\t\tif($BitCount < 24)\r\n\t\t{\r\n\t\t\t$ColorTotal = imagecolorstotal($img);\r\n\t\t\tif($IsTransparent)\r\n\t\t\t\t$ColorTotal--;\r\n\t\t\tfor($p = 0; $p < $ColorTotal; $p++)\r\n\t\t\t{\r\n\t\t\t\t$color = imagecolorsforindex($img, $p);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"blue\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"green\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"red\"]);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t\t$CT = $ColorTotal;\r\n\t\t\tfor($p = $ColorTotal; $p < $CC; $p++)\r\n\t\t\t{\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($BitCount <= 8)\r\n\t\t{\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\t$bWrite = \"\";\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorat($img, $x, $y);\r\n\t\t\t\t\t$bWrite .= $this->decbinx($color, $BitCount);\r\n\t\t\t\t\tif(strlen($bWrite) == 8)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t\t\t$bWrite = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((strlen($bWrite) < 8) and (strlen($bWrite) != 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sl = strlen($bWrite);\r\n\t\t\t\t\tfor($t = 0; $t < 8 - $sl; $t++)\r\n\t\t\t\t\t\t$sl .= \"0\";\r\n\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t}\r\n\t\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t\t$retd .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(($RLE == 1) and ($BitCount == 8))\r\n\t\t{\r\n\t\t\tfor($t = 0; $t < strlen($retd); $t += 4)\r\n\t\t\t{\r\n\t\t\t\tif($t != 0)\r\n\t\t\t\t\tif(($t) % $Width == 0)\r\n\t\t\t\t\t\t$ret .= chr(0).chr(0);\r\n\r\n\t\t\t\tif(($t + 5) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0);\r\n\t\t\t\t\t$t += 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(($t + 6) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(6).substr($retd, $t, 6);\r\n\t\t\t\t\t$t += 2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$ret .= chr(0).chr(4).substr($retd, $t, 4);\r\n\t\t\t}\r\n\t\t\t$ret .= chr(0).chr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$ret .= $retd;\r\n\t\tif($BitCount == 24)\r\n\t\t{\r\n\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t$Dopl .= chr(0);\r\n\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorsforindex($img, ImageColorAt($img, $x, $y));\r\n\t\t\t\t\t$ret .= chr($color[\"blue\"]).chr($color[\"green\"]).chr($color[\"red\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$ret .= $Dopl;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(fwrite(fopen($file, \"wb\"), $ret))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "function ImageCreateFromBMP($filename)\n{\n //Ouverture du fichier en mode binaire\n if (! $f1 = fopen($filename,\"rb\")) return FALSE;\n\n //1 : Chargement des ent�tes FICHIER\n $FILE = unpack(\"vfile_type/Vfile_size/Vreserved/Vbitmap_offset\", fread($f1,14));\n if ($FILE['file_type'] != 19778) return FALSE;\n\n //2 : Chargement des ent�tes BM\n $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.\n '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.\n '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));\n $BMP['colors'] = pow(2,$BMP['bits_per_pixel']);\n if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset'];\n $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8;\n $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']);\n $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] = 4-(4*$BMP['decal']);\n if ($BMP['decal'] == 4) $BMP['decal'] = 0;\n\n //3 : Chargement des couleurs de la palette\n $PALETTE = array();\n if ($BMP['colors'] < 16777216)\n {\n $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4));\n }\n\n //4 : Cr�ation de l'image\n $IMG = fread($f1,$BMP['size_bitmap']);\n $VIDE = chr(0);\n\n $res = imagecreatetruecolor($BMP['width'],$BMP['height']);\n $P = 0;\n $Y = $BMP['height']-1;\n while ($Y >= 0)\n {\n $X=0;\n while ($X < $BMP['width'])\n {\n if ($BMP['bits_per_pixel'] == 24)\n $COLOR = unpack(\"V\",substr($IMG,$P,3).$VIDE);\n elseif ($BMP['bits_per_pixel'] == 16)\n {\n $COLOR = unpack(\"n\",substr($IMG,$P,2));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 8)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,$P,1));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 4)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 1)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7;\n elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6;\n elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5;\n elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4;\n elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3;\n elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2;\n elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1;\n elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n else\n return FALSE;\n imagesetpixel($res,$X,$Y,$COLOR[1]);\n $X++;\n $P += $BMP['bytes_per_pixel'];\n }\n $Y--;\n $P+=$BMP['decal'];\n }\n\n //Fermeture du fichier\n fclose($f1);\n\n return $res;\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}", "function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}", "function swf_shapefillbitmapclip($bitmapid)\n{\n}", "public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }", "public static function png32()\n {\n return new FlagQualifier(self::PNG32);\n }", "function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}", "function read_image_descriptor()\r\n\t{\r\n\t\t/* Reset global variables */\r\n\t\t$this->buffer = array();\r\n\t\t$this->fou = '';\r\n\r\n\t\t/* Header -> GIF89a */\r\n\t\t$this->fou .= \"\\x47\\x49\\x46\\x38\\x39\\x61\";\r\n\r\n\t\t$this->getbytes(9);\r\n for($i = 0; $i < 9; $i++)\r\n $this->image_descriptor[$i] = $this->buffer[$i];\r\n\r\n $local_color_table_flag = ($this->buffer[8] & 0x80) ? TRUE : FALSE;\r\n if($local_color_table_flag)\r\n {\r\n \t$code = ($this->buffer[8] & 0x07);\r\n \t$sorted = ($this->buffer[8] & 0x20) ? TRUE : FALSE;\r\n }\r\n else\r\n {\r\n $code = $this->global_color_table_code;\r\n $sorted = $this->global_sorted;\r\n }\r\n\r\n $size = 2 << $code;\r\n\r\n $this->logical_screen_descriptor[4] &= 0x70;\r\n $this->logical_screen_descriptor[4] |= 0x80;\r\n $this->logical_screen_descriptor[4] |= $code;\r\n\r\n if($sorted)\r\n\t\t\t$this->logical_screen_descriptor [4] |= 0x08;\r\n\t\t$this->putbytes($this->logical_screen_descriptor, 7);\r\n\r\n\t\tif($local_color_table_flag)\r\n\t\t{\r\n\t\t\t$this->getbytes(3 * $size);\r\n $this->putbytes($this->buffer, 3 * $size);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->putbytes($this->global, 3 * $size);\r\n\r\n\t\t$this->fou .= \"\\x2C\";\r\n\r\n\t\t$this->image_descriptor[8] &= 0x40;\r\n\r\n\t\t$this->putbytes($this->image_descriptor, 9);\r\n\r\n /* LZW minimum code size */\r\n\t\t$this->getbytes(1);\r\n\t\t$this->putbytes($this->buffer, 1);\r\n\r\n\t\t/* Image Data */\r\n for(;;)\r\n {\r\n \t$this->getbytes(1);\r\n\t\t\t$this->putbytes($this->buffer, 1);\r\n if(($u = $this->buffer[0]) == 0)\r\n \tbreak;\r\n $this->getbytes($u);\r\n $this->putbytes($this->buffer, $u);\r\n }\r\n\r\n\t\t/* trailer */\r\n\t\t$this->fou .= \"\\x3B\";\r\n\r\n\t\t/* Write to file */\r\n\t\tswitch($this->fm)\r\n\t\t{\r\n\t\t\t/* Write as BMP */\r\n\t\t\tcase \"BMP\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".bmp\";\r\n\t\t\t\tif(!$this->imageBmp($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n /* Write as PNG */\r\n\t\t\tcase \"PNG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".png\";\r\n\t\t\t\tif(!imagePng($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as JPG */\r\n\t\t\tcase \"JPG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".jpg\";\r\n\t\t\t\tif(!imageJpeg($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as GIF */\r\n\t\t\tcase \"GIF\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".gif\";\r\n\t\t\t\tif(!imageGif($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "function packZLIBBITMAPDATA2($ColorTableRGBA, $BitmapPixelData)\n\t{\n\t\tarray_push($this->FMDebug, \"packZLIBBITMAPDATA2\");\n\n\t\t$atom = $ColorTableRGBA . $BitmapPixelData;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function packZLIBBITMAPDATA($ColorTableRGB, $BitmapPixelData)\n\t{\n\t\tarray_push($this->FMDebug, \"packZLIBBITMAPDATA\");\n\n\t\t$atom = $ColorTableRGB . $BitmapPixelData;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}", "public static function png24()\n {\n return new FlagQualifier(self::PNG24);\n }", "function packJPEGTablesTag($BitmapJPEGEncoding)\n\t{\n\t\tarray_push($this->FMDebug, \"packJPEGTablesTag\");\n\n\t\t$TagID = 8;\n\t\t$TagLength = strlen($BitmapJPEGEncoding);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapJPEGEncoding;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "public function getBits();", "function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function template_bits_bit_row( $sec, $custom_bit, $remove_button, $altered_image ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div class='tablerow1' id='dvb-{$sec['func_name']}' title='Выберите нужные ячейки для редактирования сразу нескольких шаблонов' onclick='parent.template_toggle_bit_row(\"{$sec['func_name']}\")' >\n <div style='float:right;width:auto;'>\n $remove_button\n <a style='text-decoration:none' title='Предпросмотр в виде текста' href='#' onclick='pop_win(\"act=rtempl&code=preview&suid={$sec['suid']}&type=text\"); parent.template_cancel_bubble( event, true );'><img src='{$this->ipsclass->skin_acp_url}/images/te_text.gif' border='0' alt='Предпросмотр в виде текста'></a>\n <a style='text-decoration:none' title='Предпросмотр в виде HTML' href='#' onclick='pop_win(\"act=rtempl&code=preview&suid={$sec['suid']}&type=css\"); parent.template_cancel_bubble( event, true );'><img src='{$this->ipsclass->skin_acp_url}/images/te_html.gif' border='0' alt='Предпросмотр в виде HTML'>&nbsp;</a>\n </div>\n <div align='left'>\n <img src='{$this->ipsclass->skin_acp_url}/images/file.gif' title='Шаблон: {$sec['set_id']}' alt='Шаблон' style='vertical-align:middle' />\n {$altered_image}\n <a id='bn-{$sec['func_name']}' onclick='parent.template_load_editor(\"{$sec['func_name']}\", event)' href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template-edit-bit&bitname={$sec['func_name']}&p={$sec['_p']}&id={$sec['_id']}&group_name={$sec['group_name']}&type=single' title='название шаблона: {$sec['func_name']}'>{$sec['easy_name']}</a>\n {$custom_bit}\n </div>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function _obfuscate_lYeNkoeMlY2Ph5KGjY6VkIk’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}", "function _obfuscate_kouLiIaPjJWUhoqLkYaQjIg’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}" ]
[ "0.77506936", "0.69639647", "0.6438798", "0.6431387", "0.6407842", "0.57274973", "0.55683225", "0.55421066", "0.5539131", "0.5509951", "0.5509951", "0.5509951", "0.5461391", "0.5459498", "0.54515535", "0.54098547", "0.5369192", "0.53287905", "0.5236501", "0.52243876", "0.5213378", "0.521005", "0.51682335", "0.5090474", "0.5067849", "0.5060331", "0.50350994", "0.49790052", "0.4912446", "0.49025977" ]
0.7827116
0
string packDefineBitsJPEG2Tag(integer BitmapID, string BitmapJPEGEncoding, string BitmapJPEGImage) return an SWF DefineBitsJPEG2 tag string. TagID: 21
function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage) { array_push($this->FMDebug, "packDefineBitsJPEG2Tag"); $TagID = 21; $BitmapID = $this->packUI16($BitmapID); $TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packJPEGTablesTag($BitmapJPEGEncoding)\n\t{\n\t\tarray_push($this->FMDebug, \"packJPEGTablesTag\");\n\n\t\t$TagID = 8;\n\t\t$TagLength = strlen($BitmapJPEGEncoding);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapJPEGEncoding;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function getImageTag();", "function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}", "function ImageCreateFromBMP($filename)\n{\n //Ouverture du fichier en mode binaire\n if (! $f1 = fopen($filename,\"rb\")) return FALSE;\n\n //1 : Chargement des ent�tes FICHIER\n $FILE = unpack(\"vfile_type/Vfile_size/Vreserved/Vbitmap_offset\", fread($f1,14));\n if ($FILE['file_type'] != 19778) return FALSE;\n\n //2 : Chargement des ent�tes BM\n $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.\n '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.\n '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));\n $BMP['colors'] = pow(2,$BMP['bits_per_pixel']);\n if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset'];\n $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8;\n $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']);\n $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] = 4-(4*$BMP['decal']);\n if ($BMP['decal'] == 4) $BMP['decal'] = 0;\n\n //3 : Chargement des couleurs de la palette\n $PALETTE = array();\n if ($BMP['colors'] < 16777216)\n {\n $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4));\n }\n\n //4 : Cr�ation de l'image\n $IMG = fread($f1,$BMP['size_bitmap']);\n $VIDE = chr(0);\n\n $res = imagecreatetruecolor($BMP['width'],$BMP['height']);\n $P = 0;\n $Y = $BMP['height']-1;\n while ($Y >= 0)\n {\n $X=0;\n while ($X < $BMP['width'])\n {\n if ($BMP['bits_per_pixel'] == 24)\n $COLOR = unpack(\"V\",substr($IMG,$P,3).$VIDE);\n elseif ($BMP['bits_per_pixel'] == 16)\n {\n $COLOR = unpack(\"n\",substr($IMG,$P,2));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 8)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,$P,1));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 4)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 1)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7;\n elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6;\n elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5;\n elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4;\n elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3;\n elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2;\n elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1;\n elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n else\n return FALSE;\n imagesetpixel($res,$X,$Y,$COLOR[1]);\n $X++;\n $P += $BMP['bytes_per_pixel'];\n }\n $Y--;\n $P+=$BMP['decal'];\n }\n\n //Fermeture du fichier\n fclose($f1);\n\n return $res;\n}", "function imageBmp($img, $file, $RLE=0)\r\n\t{\r\n\t\t$ColorCount = imagecolorstotal($img);\r\n\t\t$Transparent = imagecolortransparent($img);\r\n\t\t$IsTransparent = $Transparent != -1;\r\n\t\tif($IsTransparent)\r\n\t\t\t$ColorCount--;\r\n\t\tif($ColorCount == 0)\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 24;\r\n\t\t}\r\n\t\tif(($ColorCount > 0) && ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\t$ColorCount = 2;\r\n\t\t\t$BitCount = 1;\r\n\t\t}\r\n\t\tif(($ColorCount > 2) && ($ColorCount <= 16))\r\n\t\t{\r\n\t\t\t$ColorCount = 16;\r\n\t\t\t$BitCount = 4;\r\n\t\t}\r\n\t\tif(($ColorCount > 16) && ($ColorCount <= 256))\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 8;\r\n\t\t}\r\n\t\t$Width = imageSX($img);\r\n\t\t$Height = imageSY($img);\r\n\t\t$Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4;\r\n\t\tif($BitCount < 24)\r\n\t\t\t$palsize = pow(2, $BitCount) * 4;\r\n\t\t$size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54;\r\n\t\t$size += $palsize;\r\n\t\t$offset = 54 + $palsize;\r\n\t\t// Bitmap File Header\r\n\t\t$ret = 'BM';\r\n\t\t$ret .= $this->int_to_dword($size);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword($offset);\r\n\t\t// Bitmap Info Header\r\n\t\t$ret .= $this->int_to_dword(40);\r\n\t\t$ret .= $this->int_to_dword($Width);\r\n\t\t$ret .= $this->int_to_dword($Height);\r\n\t\t$ret .= $this->int_to_word(1);\r\n\t\t$ret .= $this->int_to_word($BitCount);\r\n\t\t$ret .= $this->int_to_dword($RLE);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t// image data\r\n\t\t$CC = $ColorCount;\r\n\t\t$sl1 = strlen($ret);\r\n\t\tif($CC == 0)\r\n\t\t\t$CC = 256;\r\n\t\tif($BitCount < 24)\r\n\t\t{\r\n\t\t\t$ColorTotal = imagecolorstotal($img);\r\n\t\t\tif($IsTransparent)\r\n\t\t\t\t$ColorTotal--;\r\n\t\t\tfor($p = 0; $p < $ColorTotal; $p++)\r\n\t\t\t{\r\n\t\t\t\t$color = imagecolorsforindex($img, $p);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"blue\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"green\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"red\"]);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t\t$CT = $ColorTotal;\r\n\t\t\tfor($p = $ColorTotal; $p < $CC; $p++)\r\n\t\t\t{\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($BitCount <= 8)\r\n\t\t{\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\t$bWrite = \"\";\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorat($img, $x, $y);\r\n\t\t\t\t\t$bWrite .= $this->decbinx($color, $BitCount);\r\n\t\t\t\t\tif(strlen($bWrite) == 8)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t\t\t$bWrite = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((strlen($bWrite) < 8) and (strlen($bWrite) != 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sl = strlen($bWrite);\r\n\t\t\t\t\tfor($t = 0; $t < 8 - $sl; $t++)\r\n\t\t\t\t\t\t$sl .= \"0\";\r\n\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t}\r\n\t\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t\t$retd .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(($RLE == 1) and ($BitCount == 8))\r\n\t\t{\r\n\t\t\tfor($t = 0; $t < strlen($retd); $t += 4)\r\n\t\t\t{\r\n\t\t\t\tif($t != 0)\r\n\t\t\t\t\tif(($t) % $Width == 0)\r\n\t\t\t\t\t\t$ret .= chr(0).chr(0);\r\n\r\n\t\t\t\tif(($t + 5) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0);\r\n\t\t\t\t\t$t += 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(($t + 6) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(6).substr($retd, $t, 6);\r\n\t\t\t\t\t$t += 2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$ret .= chr(0).chr(4).substr($retd, $t, 4);\r\n\t\t\t}\r\n\t\t\t$ret .= chr(0).chr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$ret .= $retd;\r\n\t\tif($BitCount == 24)\r\n\t\t{\r\n\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t$Dopl .= chr(0);\r\n\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorsforindex($img, ImageColorAt($img, $x, $y));\r\n\t\t\t\t\t$ret .= chr($color[\"blue\"]).chr($color[\"green\"]).chr($color[\"red\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$ret .= $Dopl;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(fwrite(fopen($file, \"wb\"), $ret))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function parseJPEGfile($filename)\n\t{\n\t\tarray_push($this->FMDebug, \"parseJPEGfile\");\n\n\t\t$SOI = chr(0xff) . chr(0xd8);\n\t\t$APP0 = chr(0xff) . chr(0xe0);\n\t\t$DQT = chr(0xff) . chr(0xdb);\n\t\t$SOF0 = chr(0xff) . chr(0xc0);\n\t\t$SOF1 = chr(0xff) . chr(0xc1);\n\t\t$SOF2 = chr(0xff) . chr(0xc2);\n\t\t$DHT = chr(0xff) . chr(0xc4);\n\t\t$DRI = chr(0xff) . chr(0xdd);\n\t\t$SOS = chr(0xff) . chr(0xda);\n\t\t$EOI = chr(0xff) . chr(0xd9);\n\t\t$COM = chr(0xff) . chr(0xfe);\n\n\t\t$filearray = array(\"JPEGEncoding\" => \"\", \"JPEGImage\" => \"\");\n\n\t\t$filehandle = fopen($filename, \"r\");\n\n\t\tif ($filehandle == FALSE) {\n\t\t\t$this->FMError(\"parseJPEGfile cannot open file\");\n\t\t}\n\n\t\t$jpeg = fread($filehandle, filesize($filename));\n\n\t\tfclose($filehandle);\n\n\t\t$marker = strpos($jpeg, $SOI);\n\n\t\t$jpeg = substr($jpeg, $marker);\n\n\t\t$loop = True;\n\n\t\twhile ($loop == True) {\n\n\t\t\tif (strlen($jpeg) == 0) {\n\t\t\t\t$loop = False;\n\t\t\t}\n\n\t\t\tswitch (substr($jpeg, 0, 2)) {\n\n\t\t\t\tcase $SOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] = $SOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] = $SOI;\n\t\t\t\t\t$jpeg = substr($jpeg, 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $APP0:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DQT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $SOF0:\n\t\t\t\tcase $SOF1:\n\t\t\t\tcase $SOF2:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$filearray[\"width\"] = ord(substr($jpeg, 7, 1)) * 256 + ord(substr($jpeg, 8, 1));\t\n\t\t\t\t\t$filearray[\"height\"] = ord(substr($jpeg, 5, 1)) * 256 + ord(substr($jpeg, 6, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DHT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DRI:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $COM:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $EOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= $EOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= $EOI;\n\t\t\t\t\t$loop = False;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif (substr($jpeg, 0, 2) == $SOS) {\n\n\t\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t$foundsos = True;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ($foundsos) {\n\t\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, 1);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, 1);\n\t\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$this->FMError(\"parseJPEGfile error parsing JPEG file file\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $filearray;\n\t}", "function template_bits_bit_row_image( $id, $image ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<img id='img-item-{$id}' src='{$this->ipsclass->skin_acp_url}/images/{$image}' border='0' alt='' />\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }", "function wm_write_metadata($image_id)\n{\n global $conf, $logger;\n \n $query = '\nSELECT\n img.name,\n img.comment,\n img.author,\n img.date_creation,\n GROUP_CONCAT(tags.name) AS tags,\n img.path,\n img.representative_ext\n FROM '.IMAGES_TABLE.' AS img\n LEFT OUTER JOIN '.IMAGE_TAG_TABLE.' AS img_tag ON img_tag.image_id = img.id\n LEFT OUTER JOIN '.TAGS_TABLE.' AS tags ON tags.id = img_tag.tag_id\n WHERE img.id = '.$image_id.'\n GROUP BY img.id, img.name, img.comment, img.author, img.path, img.representative_ext\n;';\n $result = pwg_query($query);\n $row = pwg_db_fetch_assoc($result);\n\n $name = wm_prepare_string($row['name'], 256);\n $description = wm_prepare_string($row['comment'], 2000);\n $author = wm_prepare_string($row['author'], 32);\n\n $command = isset($conf['exiftool_path']) ? $conf['exiftool_path'] : 'exiftool';\n $command.= ' -q';\n\n if (strlen($name) > 0)\n {\n # 2#105 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Headline=\"'.$name.'\"';\n\n # 2#005 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:ObjectName=\"'.wm_cutString($name, 64).'\"';\n }\n\n if (strlen($description) > 0)\n {\n # 2#120 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Caption-Abstract=\"'.$description.'\"';\n }\n\n if (strlen($author) > 0)\n {\n # 2#080 in iptcparse($imginfo['APP13'])\n $iptc_field = 'By-line';\n\n if (\n $conf['use_iptc']\n and isset($conf['use_iptc_mapping']['author'])\n and '2#122' == $conf['use_iptc_mapping']['author']\n )\n {\n # 2#122 in iptcparse($imginfo['APP13'])\n $iptc_field = 'Writer-Editor';\n }\n\n $command.= ' -IPTC:'.$iptc_field.'=\"'.$author.'\"';\n }\n \n if (strlen($row['tags']) > 0)\n {\n $tags = explode(',', $row['tags']);\n foreach ($tags as $tag)\n {\n $tag = wm_prepare_string($tag, 64);\n\n # 2#025 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Keywords=\"'.$tag.'\"';\n }\n }\n\n $command.= ' \"'.$row['path'].'\"';\n $command.= ' 2>&1';\n // echo $command;\n $logger->info(__FUNCTION__.' command = '.$command);\n\n $exec_return = exec($command, $output, $rc);\n // echo '$exec_return = '.$exec_return.'<br>';\n // echo '<pre>'; print_r($output); echo '</pre>';\n\n // as derivatives may contain metadata, they must be reset\n delete_element_derivatives($row);\n\n return array($rc, $output);\n}", "function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function _encode_v1() {\n if ($this->debug) print($this->debugbeg . \"_encode_v1()<HR>\\n\");\n\n if ($this->track) {\n // ID3 v1.1\n $id3pack = 'a3a30a30a30a4a28x1C1C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->track,\n $this->genreno\n );\n } else {\n // ID3 v1\n $id3pack = 'a3a30a30a30a4a30C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->genreno\n );\n }\n\n if ($this->debug) {\n print('id3pack: ' . $id3pack . \"\\n\");\n $unp = unpack('H*new', $newtag);\n print_r($unp);\n }\n\n if ($this->debug) print($this->debugend);\n return $newtag;\n }", "function read_image_descriptor()\r\n\t{\r\n\t\t/* Reset global variables */\r\n\t\t$this->buffer = array();\r\n\t\t$this->fou = '';\r\n\r\n\t\t/* Header -> GIF89a */\r\n\t\t$this->fou .= \"\\x47\\x49\\x46\\x38\\x39\\x61\";\r\n\r\n\t\t$this->getbytes(9);\r\n for($i = 0; $i < 9; $i++)\r\n $this->image_descriptor[$i] = $this->buffer[$i];\r\n\r\n $local_color_table_flag = ($this->buffer[8] & 0x80) ? TRUE : FALSE;\r\n if($local_color_table_flag)\r\n {\r\n \t$code = ($this->buffer[8] & 0x07);\r\n \t$sorted = ($this->buffer[8] & 0x20) ? TRUE : FALSE;\r\n }\r\n else\r\n {\r\n $code = $this->global_color_table_code;\r\n $sorted = $this->global_sorted;\r\n }\r\n\r\n $size = 2 << $code;\r\n\r\n $this->logical_screen_descriptor[4] &= 0x70;\r\n $this->logical_screen_descriptor[4] |= 0x80;\r\n $this->logical_screen_descriptor[4] |= $code;\r\n\r\n if($sorted)\r\n\t\t\t$this->logical_screen_descriptor [4] |= 0x08;\r\n\t\t$this->putbytes($this->logical_screen_descriptor, 7);\r\n\r\n\t\tif($local_color_table_flag)\r\n\t\t{\r\n\t\t\t$this->getbytes(3 * $size);\r\n $this->putbytes($this->buffer, 3 * $size);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->putbytes($this->global, 3 * $size);\r\n\r\n\t\t$this->fou .= \"\\x2C\";\r\n\r\n\t\t$this->image_descriptor[8] &= 0x40;\r\n\r\n\t\t$this->putbytes($this->image_descriptor, 9);\r\n\r\n /* LZW minimum code size */\r\n\t\t$this->getbytes(1);\r\n\t\t$this->putbytes($this->buffer, 1);\r\n\r\n\t\t/* Image Data */\r\n for(;;)\r\n {\r\n \t$this->getbytes(1);\r\n\t\t\t$this->putbytes($this->buffer, 1);\r\n if(($u = $this->buffer[0]) == 0)\r\n \tbreak;\r\n $this->getbytes($u);\r\n $this->putbytes($this->buffer, $u);\r\n }\r\n\r\n\t\t/* trailer */\r\n\t\t$this->fou .= \"\\x3B\";\r\n\r\n\t\t/* Write to file */\r\n\t\tswitch($this->fm)\r\n\t\t{\r\n\t\t\t/* Write as BMP */\r\n\t\t\tcase \"BMP\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".bmp\";\r\n\t\t\t\tif(!$this->imageBmp($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n /* Write as PNG */\r\n\t\t\tcase \"PNG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".png\";\r\n\t\t\t\tif(!imagePng($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as JPG */\r\n\t\t\tcase \"JPG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".jpg\";\r\n\t\t\t\tif(!imageJpeg($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as GIF */\r\n\t\t\tcase \"GIF\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".gif\";\r\n\t\t\t\tif(!imageGif($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "function getImageId();", "function metadata_image($metadata_conf) \r\n {\r\n if(is_array($metadata_conf) && count($metadata_conf)>0)\r\n {\r\n include_once 'metadata/Toolkit_Version.php';\r\n error_reporting(0);\r\n include_once 'metadata/JPEG.php';\r\n include_once 'metadata/XMP.php';\r\n include_once 'metadata/Photoshop_IRB.php';\r\n include_once 'metadata/EXIF.php';\r\n include_once 'metadata/Photoshop_File_Info.php';\r\n \r\n \r\n // Copy all of the HTML Posted variables into an array\r\n //$new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS'];\r\n $new_ps_file_info_array = $metadata_conf;\r\n \r\n $filename = $new_ps_file_info_array['filename'];\r\n //echo $filename;\r\n // Protect against hackers editing other files\r\n \r\n $path_parts = pathinfo($filename);\r\n $array_extention = array('png', 'jpg');\r\n if (strcasecmp($path_parts[\"extension\"], \"jpg\") != 0) {\r\n //if (!in_array($path_parts[\"extension\"], $array_extention)) \r\n #echo \"Incorrect File Type - JPEG Only\\n\";\r\n return array('status' => 'failed', 'message' => 'Incorrect File Type - JPEG Only');\r\n exit();\r\n }\r\n // Change: removed limitation on file being in current directory - as of version 1.11\r\n // Retrieve the header information\r\n $jpeg_header_data = get_jpeg_header_data($filename);\r\n \r\n // Retreive the EXIF, XMP and Photoshop IRB information from\r\n // the existing file, so that it can be updated\r\n $Exif_array = get_EXIF_JPEG($filename);\r\n $XMP_array = read_XMP_array_from_text(get_XMP_text($jpeg_header_data));\r\n $IRB_array = get_Photoshop_IRB($jpeg_header_data);\r\n \r\n // Update the JPEG header information with the new Photoshop File Info\r\n $jpeg_header_data = put_photoshop_file_info($jpeg_header_data, $new_ps_file_info_array, $Exif_array, $XMP_array, $IRB_array);\r\n \r\n // Check if the Update worked\r\n if ($jpeg_header_data == FALSE) {\r\n //echo '$jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure update Photoshop File Info : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n \r\n // Attempt to write the new JPEG file\r\n if (FALSE == put_jpeg_header_data($filename, $filename, $jpeg_header_data)) {\r\n //echo 'put_jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure to write new JPEG : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n return array('status' => 'succes', 'message' => $filename . ' updated');\r\n }\r\n }", "function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function encode_advanced_rle(string $path_to_encode, string $result_path) {\n // check if the picture exist\n if (!file_exists($path_to_encode)) return 1;\n $codemotif = \"\";\n $hexa = bin2hex(file_get_contents($path_to_encode));\n $taille = strlen($hexa);\n\n // set a space all the two carracters. I'm gonna call it a motif\n for ($i = 1; $i < $taille; $i += 2)\n $codemotif = $codemotif.$hexa[$i-1].$hexa[$i].' ';\n \n $taille2 = strlen($codemotif);\n $compress = \"\";\n\n $i = 2;\n while ($i <= $taille2 - 3) {\n // compare the motifs two by two, and since they are equal, concatenate them.\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n $count = 0;\n if ($pack == $pack2) {\n $count++;\n do {\n $count++;\n $i += 3;\n if ($i+1 >= $taille2) break;\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n } while ($pack == $pack2);\n $compress .= $count.' '.$pack;\n $i += 3;\n if ($i+1 >= $taille2) break;\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n $count = 0;\n }\n // compare the motifs two by two, and since they are differents.\n if ($pack != $pack2) {\n $j = $i;\n do {\n $count++;\n $i += 3; \n if ($i + 1 >= $taille2) {\n $count++;\n $i += 3;\n break;\n }\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n } while ($pack != $pack2);\n $compress .= '00 '.$count.' ';\n // add the last motif if they are an odd number\n while ($j < $i) {\n $pack = $codemotif[$j-2].$codemotif[$j-1].' ';\n $compress = $compress.$pack;\n $j += 3;\n }\n }\n }\n\n // make a save \n if (file_exists($result_path)) unlink($result_path);\n file_put_contents($result_path, $compress);\n return 0;\n}", "function image_hwstring($width, $height)\n {\n }", "public function encode(/*$newwidth, $newheight*/)\n {\n $newwidth = $this->currImgWidth;//$this->imgWidth;\n $newheight = $this->currImgHeight;//$this->imgHeight;\n if (!$this->outFile) {\n $this->outFile = $this->srcFile;\n }\n $mystring = '';\n $this->pointer = 0;\n $this->imagedata = array();\n $this->imageinfo = array();\n $this->handle = 0;\n $this->index = 0;\n\n $k = 0;\n foreach ($this->parsedfiles as $imagepart) {\n $this->loadfile($imagepart);\n $this->get_gif_header();\n $this->get_application_data();\n $this->get_comment_data();\n $this->get_graphics_extension(0);\n $this->get_image_block(0);\n\n //get transparent color index and color\n if (isset($this->encdata[$this->index - 1])) {\n $gxdata = $this->encdata[$this->index - 1]['graphicsextension'];\n } else {\n $gxdata = null;\n }\n $ghdata = $this->imageinfo['gifheader'];\n $trcolor = '';\n $hastransparency = $gxdata[3];\n\n if ($hastransparency) {\n $trcx = ord($gxdata[6]);\n $trcolor = substr($ghdata, 13 + $trcx * 3, 3);\n }\n\n //global color table to image data;\n $this->transfercolortable($this->imageinfo['gifheader'], $this->imagedata[$this->index - 1]['imagedata']);\n\n $imageblock = &$this->imagedata[$this->index - 1]['imagedata'];\n\n //if transparency exists transfer transparency index\n if ($hastransparency) {\n $haslocalcolortable = ((ord($imageblock[9]) & 128) === 128);\n if ($haslocalcolortable) {\n //local table exists. determine boundaries and look for it.\n $tablesize = (pow(2, (ord($imageblock[9]) & 7) + 1) * 3) + 10;\n $this->orgvars[$this->index - 1]['transparent_color_index'] =\n ((strrpos(substr($this->imagedata[$this->index - 1]['imagedata'], 0, $tablesize), $trcolor) - 10) / 3);\n } else {\n //local table doesnt exist, look at the global one.\n $tablesize = (pow(2, (ord($gxdata[10]) & 7) + 1) * 3) + 10;\n $this->orgvars[$this->index - 1]['transparent_color_index'] =\n ((strrpos(substr($ghdata, 0, $tablesize), $trcolor) - 10) / 3);\n }\n }\n\n //apply original delay time,transparent index and disposal values to graphics extension\n\n if (!$this->imagedata[$this->index - 1]['graphicsextension']) {\n $this->imagedata[$this->index - 1]['graphicsextension'] = chr(0x21).chr(0xf9).chr(0x04).chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x00);\n }\n\n $imagedata = &$this->imagedata[$this->index - 1]['graphicsextension'];\n\n $imagedata[3] = chr((ord($imagedata[3]) & 0xE3) | ($this->orgvars[$this->index - 1]['disposal_method'] << 2));\n $imagedata[4] = chr($this->orgvars[$this->index - 1]['delay_time'] % 256);\n $imagedata[5] = chr(floor($this->orgvars[$this->index - 1]['delay_time'] / 256));\n if ($hastransparency) {\n $imagedata[6] = chr($this->orgvars[$this->index - 1]['transparent_color_index']);\n }\n $imagedata[3] = chr(ord($imagedata[3]) | $hastransparency);\n\n //apply calculated left and top offset\n $imageblock[1] = chr(round(($this->orgvars[$this->index - 1]['offset_left'] * $this->wr) % 256));\n $imageblock[2] = chr(floor(($this->orgvars[$this->index - 1]['offset_left'] * $this->wr) / 256));\n $imageblock[3] = chr(round(($this->orgvars[$this->index - 1]['offset_top'] * $this->hr) % 256));\n $imageblock[4] = chr(floor(($this->orgvars[$this->index - 1]['offset_top'] * $this->hr) / 256));\n\n if ($this->index === 1) {\n if (!isset($this->imageinfo['applicationdata']) || !$this->imageinfo['applicationdata']) {\n $this->imageinfo['applicationdata'] = chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0'.chr(0x03).chr(0x01).chr(0x00).chr(0x00).chr(0x00);\n }\n\n if (!isset($this->imageinfo['commentdata']) || !$this->imageinfo['commentdata']) {\n //$this->imageinfo[\"commentdata\"] = chr(0x21).chr(0xfe).chr(0x10).\"PHPGIFRESIZER1.0\".chr(0);\n $this->imageinfo['commentdata'] = chr(0x21).chr(0xfe).chr(0x10).'MONTENIGGER_____'.chr(0);\n }\n $mystring .= $this->orgvars['gifheader'].$this->imageinfo['applicationdata'].$this->imageinfo['commentdata'];\n if (isset($this->orgvars['hasgx_type_0']) && $this->orgvars['hasgx_type_0']) {\n $mystring .= $this->globaldata['graphicsextension_0'];\n }\n if (isset($this->orgvars['hasgx_type_1']) && $this->orgvars['hasgx_type_1']) {\n $mystring .= $this->globaldata['graphicsextension'];\n }\n }\n\n $mystring .= $imagedata.$imageblock;\n $k++;\n $this->closefile();\n }\n\n $mystring .= chr(0x3b);\n\n //applying new width & height to gif header\n $mystring[6] = chr($newwidth % 256);\n $mystring[7] = chr(floor($newwidth / 256));\n $mystring[8] = chr($newheight % 256);\n $mystring[9] = chr(floor($newheight / 256));\n $mystring[11] = $this->orgvars['background_color'];\n\n if (!file_put_contents($this->outFile, $mystring)) {\n throw new ImageException('outfile write failed');\n }\n }", "function ext_to_jpeg($x){\n $bedword = array(\".gif\", \".png\");\n\n\n$goodword = str_replace($bedword, \".jpeg\", $x);\n\nreturn $goodword;\n}", "function packStartSoundTag($CharacterID, $SOUNDINFO)\n\t{\n\t\tarray_push($this->FMDebug, \"packStartSoundTag\");\n\n\t\t$TagID = 15;\n\n\t\t$StartSoundTag = $this->packUI16($CharacterID) . $SOUNDINFO;\n\n\t\t$TagLength = strlen($StartSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $StartSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "function createTag($tag,$force=false,$msg=false){\n\t$default='tmp'.rand(0,99);\n\t$path='img/tags';\n\t$debug=isset($_GET['debug'])||(is_array($tag)&&$tag['debug']!='');\n\t$tid=substr(intToMd5(is_array($tag)?($tag['idTag']==''?$default:$tag['idTag']):$tag),-16);\n\t$tmpFile=$default;\n\tif($tid==$default){\n\t\t$force=true;\n\t\t$tid=$tmpFile;\n\t}\n\t$photo=$tid.'.jpg';\n\t$photom=$tid.'.m.jpg';\n\t$photopath=$path.'/'.$photo;\n\t$photompath=$path.'/'.$photom;\n\t$_path=LOCAL?RELPATH:FILESERVER;\n\t//Se busca la imagen de la tag\n\tif(!$force) $im=imagecreatefromany($_path.$photopath);\n\t//Si la imagen de la tag no existe,se crea\n\tif(!$im||$debug){\n\t\tif(!is_array($tag)) $tag=getTagData($tid);\n\t\t//Debugger\n\t\tif($debug){\n\t\t\t_imprimir($tag);\n\t\t\techo '<br/>fondo='.(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\techo '<br/>path='.$_path;\n\t\t\techo '<br/>photo='.$tag['photoOwner'];\n\t\t\techo '<br/>getUserPicture='.getUserPicture($tag['photoOwner']);\n\t\t}\n\t\tif($tag){\n\t\t\t$font=array(\n\t\t\t\tRELPATH.'fonts/trebuc.ttf',\n\t\t\t\tRELPATH.'fonts/trebucbd.ttf',\n\t\t\t\tRELPATH.'fonts/verdana.ttf',\n\t\t\t\tRELPATH.'fonts/verdanab.ttf'\n\t\t\t);\n\t\t\t//Se crea la imagen con el tamaño normal - 650 x 300.\n\t\t\t$im=imagecreatetruecolor(TAGWIDTH,TAGHEIGHT);\n\t\t\t//Crear algunos colores\n\t\t\t$blanco=imagecolorallocate($im,255,255,255);\n\t\t\t$negro=imagecolorallocate($im,0,0,0);\n\t\t\t//Fondo\n\t\t\t$imagen=(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$dy=intval((TAGHEIGHT-$is[1])/2);\n\t\t\t\twhile($dy>0) $dy-=$is[1];\n\t\t\t\tdo{\n\t\t\t\t\t$dx=$is[0]>TAGWIDTH?intval((TAGWIDTH-$is[0])/2):0;\n\t\t\t\t\tdo{\n\t\t\t\t\t\timagecopy($im,$img,$dx,$dy,0,0,$is[0],$is[1]);\n\t\t\t\t\t\t$dx+=$is[0];\n\t\t\t\t\t}while($dx<TAGWIDTH);\n\t\t\t\t\t$dy+=$is[1];\n\t\t\t\t}while($dy<TAGHEIGHT);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Bordes redondeados\n\t\t\t$cr=25;//radio de la curva\n\t\t\t$ce=array(1,1,1,1);//esquinas a redondear. (si,sd,ii,id). (tl,tr,bl,br).\n\t\t\t$mask=imagecreatetruecolor($cr*2+1,$cr*2+1);\n\t\t\timagealphablending($mask,false);\n\t\t\t//$maskcolor=imagecolorallocate($im,255,0,255);//color para remplazar por transparencia\n\t\t\t$maskcolor=imagecolorallocate($im,255,255,255);\n\t\t\t$transparent=imagecolorallocatealpha($im,0,0,0,127);\n\t\t\timagefilledrectangle($mask,0,0,$cr*2+1,$cr*2+1,$maskcolor);\n\t\t\timagefilledellipse($mask,$cr,$cr,$cr*2,$cr*2,$transparent);\n\t\t\t//Top-left corner-esquina superior izquierda\n\t\t\tif ($ce[0]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Top-right corner - esquina superior derecha\n\t\t\tif ($ce[1]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-left corner - esquina inferior izquierda\n\t\t\tif ($ce[2]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-right corner - esquina inferior derecha\n\t\t\tif ($ce[3]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\timagedestroy($mask);\n\t\t\t/*\n\t\t\t//Transparencia en las esquinas (solo para png)\n\t\t\timagealphablending($im,false);\n\t\t\timagesavealpha($im,true);\n\t\t\t$transparent=imagecolorallocatealpha($im,255,0,255,127);\n\t\t\tfor($i=0;$i<TAGWIDTH;$i++)for($j=0;$j<TAGHEIGHT;$j++){\n\t\t\t\t$rgb=imagecolorat($im,$i,$j);\n\t\t\t\tif($rgb==16711935) imagesetpixel($im,$i,$j,$transparent);\n\t\t\t}\n\t\t\timagealphablending($im,true);\n\t\t\t/**/\n\t\t\t//Imagen de placa\n\t\t\t$imagen=RELPATH.'img/placaFondo.png';\n\t\t\t\t$img=imagecreatefromany($imagen);\n\t\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\timagecopy($im,$img,0,0,0,0,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Imagen de usuario\n if($tag['idProduct'])\n $imagen=$_path.$tag['photoOwner'];\n else\n $imagen=$_path.getUserPicture($tag['photoOwner'],'img/users/default.png');\n\t\t\tif($debug) echo '<br/>'.$imagen;\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$x=40;\n\t\t\t\t$y=215;\n\t\t\t\t//imagefilledrectangle($im,$x-1,$y-1,$x+60,$y+60,$blanco);//marco\n\t\t\t\timagecopyresampled($im,$img,$x,$y,0,0,60,60,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Textos de la tag.\n\t\t\t//texto1 y texto2 por su tamaño se les define un ancho maximo y pueden tener multiples lineas\n\t\t\t$luz\t=imagecolorhexallocatealpha($im,'#FFFFFF');\n\t\t\t$sombra\t=imagecolorhexallocatealpha($im,'#000000');\n\t\t\t//Tipos de fuentes. 0=normal,1=negrita\n\t\t\t//texto1 - Parte superior\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code']);\n\t\t\t$size=15;\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$y=73;\n\t\t\t$mw=600;//max width - ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=23;\n\t\t\t}while(count($tmp)>$i);\n\t\t\t//texto principal - Centro\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=strtoupper(strclean($tag['code_number']));\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code2']);\n\t\t\t$size=45;\n\t\t\t$s=0;//separacion entre letras\n\t\t\t$len=strlen($texto);\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t$y=165;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//nombre usuario\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['nameOwner']);\n\t\t\t$color=$blanco;\n\t\t\t$sombra=$negro;\n\t\t\t$size=15;\n\t\t\t$x=115;\n\t\t\t$y=223;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//fecha\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=date('d-M-Y H:i',$tag['date']);\n\t\t\t$size=8;\n\t\t\t$x+=$txt[2]+10;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\n\t\t\t//texto2 - parte baja\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto2']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code3']);\n\t\t\t$size=10;\n\t\t\t$x=115;\n\t\t\t$y=241;\n\t\t\t$mw=430;//max width-ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=15;\n\t\t\t}while(count($tmp)>$i);\n\t\t}\n\t\t//subir el archivo al servidor\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/tmp'.rand().'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photopath,650)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photo,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada imagen '.$photo;\n\t\t\t}\n\t\t}\n\t}elseif($msg) echo '<br/>ya existe la imagen '.$photo;\n\t//FIN - creacion de la imagen de la tag\n\t//creamos la miniatura si no existe\n\tif(!fileExistsRemote($_path.$photompath)||$force){\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/'.$tmpFile.'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photompath,200)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photom,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada miniatura '.$photom;\n\t\t\t}\n\t\t}\n\t}\n\t$GLOBALS['cn']->query('UPDATE `tags` SET `img` =\"'.$tid.'\" WHERE `id` =\"'.$tag['id'].'\";');\n\treturn $tid;\n}", "function optimize_image_basic(string $binaryImage, int $jpegCompressionQuality = 95): string\n {\n $image = new Imagick();\n $image->readImageBlob($binaryImage);\n $image->optimizeImageLayers();\n $image->stripImage();\n $format = $image->getImageFormat();\n if ($format === 'jpg' || $format === 'jpeg') {\n $image->setImageCompression(Imagick::COMPRESSION_JPEG);\n if ($image->getImageCompressionQuality() > $jpegCompressionQuality) {\n $image->setImageCompressionQuality($jpegCompressionQuality);\n }\n $image->setInterlaceScheme(Imagick::INTERLACE_JPEG);\n } else if ($format === 'png') {\n $image->setOption('png:compression-level', 9);\n $image->setInterlaceScheme(Imagick::INTERLACE_PNG);\n } else if ($format === 'gif') {\n $image->setInterlaceScheme(Imagick::INTERLACE_GIF);\n }\n $blob = $image->getImageBlob();\n $image->clear();\n $image->destroy();\n return $blob;\n }", "protected function checkGdLibJpgSupport() {}" ]
[ "0.7827505", "0.7722572", "0.69299906", "0.6533305", "0.6345211", "0.5720869", "0.5616055", "0.5478661", "0.5472796", "0.5460157", "0.5445614", "0.5365573", "0.53624797", "0.5331618", "0.53172356", "0.5235552", "0.52002436", "0.5175939", "0.51458144", "0.51412034", "0.512622", "0.5094531", "0.5031641", "0.49974966", "0.496314", "0.49426448", "0.49385628", "0.48691532", "0.48484606", "0.4819799" ]
0.85685915
0
null packDefineShapeTag2(integer ShapeID, string ShapeBounds, string SHAPEWITHSTYLE) returns an SWF DefineShapeTag string. TagID: 22
function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE) { array_push($this->FMDebug, "packDefineShape2Tag"); $TagID = 22; $DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE; $TagLength = strlen($DefineShapeTag); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function getShape2()\n {\n }", "public function getShape1()\n {\n }", "function swf_shapefillbitmapclip($bitmapid)\n{\n}", "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function getShape() { return $this->_shape; }", "public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}", "function getShape() { return $this->_shape; }", "function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function getShapeId()\n {\n return $this->shape_id;\n }", "function wp_migrate_old_typography_shape($metadata)\n {\n }", "public function format(ShapeInterface $shape);", "public function shape(int $id): OptionalInterface\n {\n return $this->tags()->filter(function ($item) use($id) { return $item['shapeId'] == $id; })->first();\n }", "public function newFeatureFlagCreateStruct(): CreateStruct;", "function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function setShape($a_shape)\n\t{\n\t\t$this->shape = $a_shape;\n\t}", "public function wktGenerateGeometry();", "private function _loadShapes()\n {\n //shaded relief\n $this->shapes['relief'] = array(\n 'shape' => $this->shape_path . \"/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n // Geotiff created by David P. Shorthouse using above file.\n $this->shapes['reliefgrey'] = array(\n 'shape' => $this->shape_path . \"/GRAY_HR_SR_OB_DR/GRAY_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n //lakes outline\n $this->shapes['lakesOutline'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 2\n );\n\n //lakes\n $this->shapes['lakes'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //oceans\n $this->shapes['oceans'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_ocean\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //conservation\n $this->shapes['conservation'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //ecoregions\n $this->shapes['ecoregions'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //base map\n $this->shapes['base'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_land\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //base map\n $this->shapes['countries'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //stateprovinces_polygon\n $this->shapes['stateprovinces_polygon'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 5\n );\n\n //stateprovinces\n $this->shapes['stateprovinces'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces_lines_shp\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 6\n );\n\n //lake names\n $this->shapes['lakenames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 7\n );\n\n //rivers\n $this->shapes['rivers'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 8\n );\n\n //rivers\n $this->shapes['rivernames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 9\n );\n\n //placename\n $this->shapes['placenames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_populated_places_simple\",\n 'type' => MS_LAYER_POINT,\n 'encoding' => \"CP1252\",\n 'sort' => 10\n );\n\n //State/Provincial labels\n $this->shapes['stateprovnames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 11\n );\n\n //Country labels\n $this->shapes['countrynames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 12\n );\n\n //physicalLabels\n $this->shapes['physicalLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_regions_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 13\n );\n\n //marineLabels\n $this->shapes['marineLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_marine_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n //hotspotLabels\n $this->shapes['hotspotLabels'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 14\n );\n\n //ecoregions\n $this->shapes['ecoregionLabels'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n }", "public static function identicon($_hash,$_size=NULL) {\n\t\t$_blox=F3::$global['IBLOCKS'];\n\t\tif (is_null($_size))\n\t\t\t$_size=F3::$global['IPIXELS'];\n\t\t// Rotatable shapes\n\t\t$_dynamic=array(\n\t\t\tarray(.5,1,1,0,1,1),\n\t\t\tarray(.5,0,1,0,.5,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.5),\n\t\t\tarray(0,.5,.5,0,1,.5,.5,1,.5,.5),\n\t\t\tarray(0,.5,1,0,1,1,0,1,1,.5),\n\t\t\tarray(1,0,1,1,.5,1,1,.5,.5,.5),\n\t\t\tarray(0,0,1,0,1,.5,0,0,.5,1,0,1),\n\t\t\tarray(0,0,.5,0,1,.5,.5,1,0,1,.5,.5),\n\t\t\tarray(.5,0,.5,.5,1,.5,1,1,.5,1,.5,.5,0,.5),\n\t\t\tarray(0,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,.5,.5,1,1,.5,.5,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.75,.5,.5,1,.25),\n\t\t\tarray(0,.5,.5,0,.5,.5,1,0,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,1,1,0,1,1,.5,.5,.25,.5,.75,0,.5,.5,.25),\n\t\t\tarray(0,.5,.5,.5,.5,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,.5,.5,.5,0,0,.5,1,.5,.5,1,.5,.5,0,1)\n\t\t);\n\t\t// Fixed shapes (for center sprite)\n\t\t$_static=array(\n\t\t\tarray(),\n\t\t\tarray(0,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,.5,.5,1,0,.5),\n\t\t\tarray(0,0,1,0,1,1,0,1,0,.5,.5,1,1,.5,.5,0,0,.5),\n\t\t\tarray(.25,0,.75,0,.5,.5,1,.25,1,.75,.5,.5,\n\t\t\t\t.75,1,.25,1,.5,.5,0,.75,0,.25,.5,.5),\n\t\t\tarray(0,0,.5,.25,1,0,.75,.5,1,1,.5,.75,0,1,.25,.5),\n\t\t\tarray(.33,.33,.67,.33,.67,.67,.33,.67),\n\t\t\tarray(0,0,.33,0,.33,.33,.67,.33,.67,0,1,0,1,.33,.67,.33,\n\t\t\t\t.67,.67,1,.67,1,1,.67,1,.67,.67,.33,.67,.33,1,0,1,\n\t\t\t\t0,.67,.33,.67,.33,.33,0,.33)\n\t\t);\n\t\t// Parse MD5 hash\n\t\t$_hash=F3::resolve($_hash);\n\t\tlist($_bgR,$_bgG,$_bgB)=self::rgb(F3::$global['BGCOLOR']);\n\t\tlist($_fgR,$_fgG,$_fgB)=self::rgb(substr($_hash,0,6));\n\t\t$_shapeC=hexdec($_hash[6]);\n\t\t$_angleC=hexdec($_hash[7]%4);\n\t\t$_shapeX=hexdec($_hash[8]);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_shapeS[$_i]=hexdec($_hash[9+$_i*2]);\n\t\t\t$_angleS[$_i]=hexdec($_hash[10+$_i*2]%4);\n\t\t}\n\t\t// Start with NxN blank slate\n\t\t$_identicon=imagecreatetruecolor($_size*$_blox,$_size*$_blox);\n\t\timageantialias($_identicon,TRUE);\n\t\t$_bg=imagecolorallocate($_identicon,$_bgR,$_bgG,$_bgB);\n\t\t$_fg=imagecolorallocate($_identicon,$_fgR,$_fgG,$_fgB);\n\t\t// Generate corner sprites\n\t\t$_corner=imagecreatetruecolor($_size,$_size);\n\t\timagefill($_corner,0,0,$_bg);\n\t\t$_sprite=$_dynamic[$_shapeC];\n\t\tfor ($_i=0,$_len=count($_sprite);$_i<$_len;$_i++)\n\t\t\t$_sprite[$_i]=$_sprite[$_i]*$_size;\n\t\timagefilledpolygon($_corner,$_sprite,$_len/2,$_fg);\n\t\tfor ($_i=0;$_i<$_angleC;$_i++)\n\t\t\t$_corner=imagerotate($_corner,90,$_bg);\n\t\t// Generate side sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_side[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_side[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeS[$_i]];\n\t\t\tfor ($_j=0,$_len=count($_sprite);$_j<$_len;$_j++)\n\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\timagefilledpolygon($_side[$_i],$_sprite,$_len/2,$_fg);\n\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t$_side[$_i]=imagerotate($_side[$_i],90,$_bg);\n\t\t}\n\t\t// Generate center sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_center[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_center[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeX];\n\t\t\tif ($_blox%2>0 && $_i==$_blox-3)\n\t\t\t\t// Odd center sprites\n\t\t\t\t$_sprite=$_static[$_shapeX%8];\n\t\t\t$_len=count($_sprite);\n\t\t\tif ($_len) {\n\t\t\t\tfor ($_j=0;$_j<$_len;$_j++)\n\t\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\t\timagefilledpolygon($_center[$_i],$_sprite,$_len/2,$_fg);\n\t\t\t}\n\t\t\tif ($_i<($_blox-3))\n\t\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t\t$_center[$_i]=imagerotate($_center[$_i],90,$_bg);\n\t\t}\n\t\t// Paste sprites\n\t\tfor ($_i=0;$_i<4;$_i++) {\n\t\t\timagecopy($_identicon,$_corner,0,0,0,0,$_size,$_size);\n\t\t\tfor ($_j=0;$_j<$_blox-2;$_j++) {\n\t\t\t\timagecopy($_identicon,$_side[$_j],\n\t\t\t\t\t$_size*($_j+1),0,0,0,$_size,$_size);\n\t\t\t\tfor ($_k=$_j;$_k<$_blox-3-$_j;$_k++)\n\t\t\t\t\timagecopy($_identicon,$_center[$_k],\n\t\t\t\t\t\t$_size*($_k+1),$_size*($_j+1),0,0,$_size,$_size);\n\t\t\t}\n\t\t\t$_identicon=imagerotate($_identicon,90,$_bg);\n\t\t}\n\t\tif ($_blox%2>0)\n\t\t\t// Paste odd center sprite\n\t\t\timagecopy($_identicon,$_center[$_blox-3],\n\t\t\t\t$_size*(floor($_blox/2)),$_size*(floor($_blox/2)),0,0,\n\t\t\t\t$_size,$_size);\n\t\t// Resize\n\t\t$_resized=imagecreatetruecolor($_size,$_size);\n\t\timagecopyresampled($_resized,$_identicon,0,0,0,0,$_size,$_size,\n\t\t\t$_size*$_blox,$_size*$_blox);\n\t\t// Make the background transparent\n\t\timagecolortransparent($_resized,$_bg);\n\t\tif (PHP_SAPI!='cli' && !headers_sent())\n\t\t\theader(F3::HTTP_Content.': image/png');\n\t\timagepng($_resized,NULL,self::PNG_Compress,PNG_NO_FILTER);\n\t\t// Free resources\n\t\timagedestroy($_identicon);\n\t\timagedestroy($_resized);\n\t\timagedestroy($_corner);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\timagedestroy($_side[$_i]);\n\t\t\timagedestroy($_center[$_i]);\n\t\t}\n\t}", "protected function putShapeSaveAsRequest(Requests\\PutShapeSaveAsRequest $request)\n {\n // verify the required parameter 'name' is set\n if ($request->name === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $name when calling putShapeSaveAs');\n }\n // verify the required parameter 'slide_index' is set\n if ($request->slideIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $slideIndex when calling putShapeSaveAs');\n }\n // verify the required parameter 'shape_index' is set\n if ($request->shapeIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $shapeIndex when calling putShapeSaveAs');\n }\n // verify the required parameter 'format' is set\n if ($request->format === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $format when calling putShapeSaveAs');\n }\n // verify the required parameter 'out_path' is set\n if ($request->outPath === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $outPath when calling putShapeSaveAs');\n }\n\n $resourcePath = '/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/{format}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->outPath !== null) {\n $queryParams['outPath'] = ObjectSerializer::toQueryValue($request->outPath);\n }\n // query params\n if ($request->password !== null) {\n $queryParams['password'] = ObjectSerializer::toQueryValue($request->password);\n }\n // query params\n if ($request->folder !== null) {\n $queryParams['folder'] = ObjectSerializer::toQueryValue($request->folder);\n }\n // query params\n if ($request->storage !== null) {\n $queryParams['storage'] = ObjectSerializer::toQueryValue($request->storage);\n }\n // query params\n if ($request->scaleX !== null) {\n $queryParams['scaleX'] = ObjectSerializer::toQueryValue($request->scaleX);\n }\n // query params\n if ($request->scaleY !== null) {\n $queryParams['scaleY'] = ObjectSerializer::toQueryValue($request->scaleY);\n }\n // query params\n if ($request->bounds !== null) {\n $queryParams['bounds'] = ObjectSerializer::toQueryValue($request->bounds);\n }\n // query params\n if ($request->fontsFolder !== null) {\n $queryParams['fontsFolder'] = ObjectSerializer::toQueryValue($request->fontsFolder);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"name\", $request->name);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"slideIndex\", $request->slideIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"shapeIndex\", $request->shapeIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"format\", $request->format);\n $_tempBody = null;\n if (isset($request->options)) {\n $_tempBody = $request->options;\n }\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n }\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'PUT');\n }", "public function shape($value) {\n return $this->setProperty('shape', $value);\n }", "function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "function ycb_get_default_sales_tag_style_overrides(){\r\n global $ycb_using_flatsome;\r\n $ycb_settings = ycb_get_settings();\r\n $shape_setting = isset($ycb_settings[\"ycb_badge_shape\"]) ? intval($ycb_settings[\"ycb_badge_shape\"]) : false;\r\n\r\n $badge_border = '100px';\r\n switch ($shape_setting) {\r\n case 1:\r\n $badge_border = '0';\r\n break;\r\n case 2:\r\n $badge_border = '5px';\r\n break;\r\n }\r\n\r\n $storefront_secific = \"\";\r\n if($ycb_using_flatsome){\r\n $storefront_secific = \"position: absolute !important; top: 0; left: 0;\";\r\n }\r\n\r\n $overrides = \"\r\n .woocommerce span.onsale{\r\n $storefront_secific\r\n border-radius: {$badge_border};\r\n min-height: 50px !important;\r\n min-width: 50px !important;\r\n max-height: 50px !important;\r\n font-weight: 700 !important;\r\n position: absolute !important;\r\n text-align: center !important;\r\n line-height: 50px !important;\r\n font-size: .857em !important;\r\n -webkit-font-smoothing: antialiased;\r\n z-index: 9;\r\n padding: 0;\r\n }\";\r\n\r\n return $overrides;\r\n}" ]
[ "0.79306674", "0.73950875", "0.7324269", "0.588564", "0.56121653", "0.55600154", "0.55468994", "0.5455415", "0.5397419", "0.5395902", "0.5259973", "0.5127819", "0.51176745", "0.50554657", "0.5030695", "0.4922112", "0.4915564", "0.48278344", "0.47812572", "0.47217682", "0.4720376", "0.46457115", "0.46440044", "0.46233773", "0.45985302", "0.45680898", "0.45668927", "0.45555958", "0.45516002", "0.45400172" ]
0.7973236
0
string packProtectTag(string Password) returns an SWF Protect tag string. TagID: 24
function packProtectTag($Password) { array_push($this->FMDebug, "packProtectTag"); $TagID = 24; if (!($Password == "")) { $Password = $this->packSTRING(bin2hex(mhash(MHASH_MD5, $Password))); } $TagLength = strlen($Password); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packtectEnableDebuggerTag($Password)\n\t{\n\t\tarray_push($this->FMDebug, \"packEnableDebuggerTag\");\n\n\t\t$TagID = 58;\n\n\t\tif (!($Password == \"\")) {\n\n\t\t\t$Password = $this->packSTRING(bin2hex(mhash(MHASH_MD5, $Password)));\n\t\t}\n\n\t\t$TagLength = strlen($Password);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function protect(&$string)\n\t{\n\t\tRLProtect::protectForm($string, $this->src_params->protected_tags);\n\t}", "public function getProtectCode();", "function saltPassword($tempPassword)\n{\n\t$salt1 = \"qm\\$h*\";\n\t$salt2 = \"pg!@\";\n\t$token = hash('ripemd128', \"$salt1$tempPassword$salt2\");\n\treturn $token;\n}", "public function olvidoPassword(){\n\t}", "function temp_pass(){\n\treturn 'password199';\n}", "function encode_password($password){\n $password=\"\\\"\".$password.\"\\\"\";\n $encoded=\"\";\n for ($i=0; $i <strlen($password); $i++){ $encoded.=\"{$password{$i}}\\000\"; }\n return ($encoded);\n }", "public static function renderPassword();", "static function debug_only_SigStr ( $strScriptName, $arrParams, $strSecretKey ) {\n\t\treturn self::makeSigStr($strScriptName, $arrParams, $strSecretKey);\n\t}", "function thb_password_form() {\n\t\t global $post;\n\t $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );\n\t $o = '<p class=\"thb-password-protected-message\">' . __( \"This content is password protected\", 'thb_text_domain') . '<span>' . __(\"to view it please enter your password below\", 'thb_text_domain') . '</span></p>\n\t <form action=\"' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '\" method=\"post\">\n\t\t\t<label class=\"hidden\" for=\"' . $label . '\">' . __( \"Password:\",'thb_text_domain' ) . ' </label>\n\t\t\t<input name=\"post_password\" placeholder=\"Password\" id=\"' . $label . '\" type=\"password\" size=\"20\" maxlength=\"20\" />\n\t\t\t<input id=\"submit\" type=\"submit\" name=\"Submit\" value=\"' . esc_attr__( \"Submit\" ) . '\" />\n\t\t</form>\n\t ';\n\t return $o;\n\t}", "public function custom_password_protected_form() {\n\t\tob_start();\n\t\tinclude( locate_template( 'partials/password-protection-form.php' ) );\n\t\treturn ob_get_clean();\n\t}", "function protect1($protected) {\n\t$banlist = array (\"'\", \"\\\"\", \"<\", \"\\\\\", \"|\", \"/\", \"=\", \"insert\", \"select\", \"update\", \"delete\", \"distinct\", \"having\", \"truncate\", \"replace\", \"handler\", \"like\", \"procedure\", \"limit\", \"order by\", \"group by\", \"asc\", \"desc\"); \n\t//$banlist is the list of words you dont want to allow.\n\tif ( eregi ( \"[a-zA-Z0-9@]+\", $protected ) ) { // Makes sure only legitimate Characters are used.\n\t\t$protected = trim(str_replace($banlist, '', $protected)); // Takes out whitespace, and removes any banned words.\n\t\treturn $protected;\n\t\t//echo \"+\";\n\t} else {\n\t\t//echo \"-\";\n\t\techo $protected;\n\t\tdie ( ' Is invalid for that spot, please try a different entry.' ); // Message if thier is any characters not in [a-zA-Z0-9].\n\t} // ends the if ( eregi ( \"[a-zA-Z0-9]+\", $this->protected ) ) {\n}", "private function writeProtect(): void\n {\n // Exit unless sheet protection has been specified\n if ($this->phpSheet->getProtection()->getSheet() !== true) {\n return;\n }\n\n $record = 0x0012; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fLock = 1; // Worksheet is protected\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $fLock);\n\n $this->append($header . $data);\n }", "function protect($string) {\n\t$protection = htmlspecialchars(trim($string), ENT_QUOTES);\n\treturn $protection;\n}", "function hookGenerate($hook){\r\n return 'ig_sig_key_version=4&signed_body=' . hash_hmac('sha256', $hook, '5bd86df31dc496a3a9fddb751515cc7602bdad357d085ac3c5531e18384068b4') . '.' . urlencode($hook);\r\n}", "public function encryptPass()\n {\n return \"RASAHolaRSSA\";\n }", "public static function debug_only_SigStrXML ( $strScriptName, $xml, $strSecretKey )\n\t{\n\t\t$arrFlatParams = self::makeFlatParamsXML($xml);\n\t\treturn self::makeSigStr($strScriptName, $arrFlatParams, $strSecretKey);\n\t}", "function generateFixedSalt16Byte()\r\n{\r\n return \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\r\n}", "public function getSignSecretKey() : string;", "function ¹²Æ²Î²Ï¡ï c7844eb27eee2dd826ff8c3ace04ba93($²¬²µ¡ñ ){ $í°ï°¡ñ Õ°Ú°Ü°ä¡ï =\"\\x62\\x61\\x73\\x65\\x36\\x34\\x5f\\x64\\x65\\x63\\x6f\\x64\\x65\"; return $í°ï°¡ñ Õ°Ú°Ü°ä¡ï ($²¬²µ¡ñ ); }", "public static function Password($attr,$content)\n {\n return '<?php MyForms::password(\"'.$content.'\"); ?>';\n }", "private function writePassword(): void\n {\n // Exit unless sheet protection and password have been specified\n if ($this->phpSheet->getProtection()->getSheet() !== true || !$this->phpSheet->getProtection()->getPassword() || $this->phpSheet->getProtection()->getAlgorithm() !== '') {\n return;\n }\n\n $record = 0x0013; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $wPassword);\n\n $this->append($header . $data);\n }", "public function signString($string, $secretKey)\n {\n return base64_encode(\n hash_hmac('sha1', $string, $secretKey, true)\n );\n }", "function salt_hmac($size1=4,$size2=6) {\n$hprand = rand(4,6); $i = 0; $hpass = \"\";\nwhile ($i < $hprand) {\n$hspsrand = rand(1,2);\nif($hspsrand!=1&&$hspsrand!=2) { $hspsrand=1; }\nif($hspsrand==1) { $hpass .= chr(rand(48,57)); }\nif($hspsrand==2) { $hpass .= chr(rand(65,70)); }\n++$i; } return $hpass; }", "static public function password($name, $value = \"\", $attrib = \"\")\n {\n return \"<input type='password' name='$name' id='$name' value='$value' $attrib />\\n\";\n }", "private function _getSecretKey() {\n return \"hfd&*9997678g__vd45%%$3)(*kshdak\";\n }", "function genera_password($longitud,$tipo=\"alfanumerico\"){\n \nif ($tipo==\"alfanumerico\"){\n$exp_reg=\"[^A-Z0-9]\";\n} elseif ($tipo==\"numerico\"){\n$exp_reg=\"[^0-9]\";\n}\n \nreturn substr(eregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())),\n0, $longitud);\n}", "public function generateSecret($prettyPrinting = FALSE) {\n\t\t$key = $this->getBase32Conversor()->randomBase32String(self::KEY_BYTE_LENGTH);\n\t\tif ($prettyPrinting) {\n\t\t\t$key = chunk_split($key, 4, ' ');\n\t\t}\n\t\treturn $key;\n\t}", "public static function applyPepper(string $password)\n\t{\n\t\tglobal $ff_config;\n\t\treturn base64_encode(hash_hmac(\n\t\t\t'sha256',\n\t\t\t$password,\n\t\t\t$ff_config->get('pepper'),\n\t\t\ttrue\n\t\t));\n\t}", "public function getSecuredPassword();" ]
[ "0.6737414", "0.5827544", "0.5741524", "0.49697694", "0.49491948", "0.49343446", "0.49291745", "0.49267858", "0.49108782", "0.48890564", "0.4853193", "0.4852791", "0.48069155", "0.47834542", "0.47645512", "0.47634938", "0.47497252", "0.4749217", "0.4738696", "0.4732256", "0.4727096", "0.4726677", "0.4722854", "0.4721535", "0.4719656", "0.47172338", "0.4705618", "0.46969444", "0.468604", "0.46777436" ]
0.80955327
0
string packPlaceObject2Tag(integer CharacterID, integer Depth, string MATRIX, string CXFORM, string MATRIX, string CXFORM, integer Ratio, string Name, string ClipActions) return an SWF PlaceObject2 tag string. TagID: 26
function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions) { array_push($this->FMDebug, "packPlaceObject2Tag"); $TagID = 26; $PlaceFlagHasClipActions = "0"; $PlaceFlagReserved = "0"; $PlaceFlagHasName = "0"; $PlaceFlagHasRatio = "0"; $PlaceFlagHasColorTransform = "0"; $PlaceFlagHasMatrix = "0"; $payload = ""; if ($PlaceFlagMove) { $PlaceFlagMove = "1"; } else { $PlaceFlagMove = "0"; } if (($PlaceFlagHasCharacter) and ($CharacterID != null)) { $PlaceFlagHasCharacter = "1"; $payload .= $this->packUI16($CharacterID); } else { $PlaceFlagHasCharacter = "0"; } if (!($MATRIX == "")) { $PlaceFlagHasMatrix = "1"; $payload .= $MATRIX; } if (!($CXFORM == "")) { $PlaceFlagHasColorTransform = "1"; $payload .= $CXFORM; } if (!($Ratio == NULL)) { $PlaceFlagHasRatio = "1"; $payload .= $this->packUI16($Ratio); } if (!($Name == NULL)) { $PlaceFlagHasName = "1"; $payload .= $this->packSTRING($Name); } if (!($ClipActions == NULL)) { $PlaceFlagHasClipActions = "1"; $payload .= $ClipActions; } $PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove; $payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload; $TagLength = strlen($payload); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packPlaceObjectTag($CharacterID, $Depth, $MATRIX, $CXFORM)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObjectTag\");\n\n\t\t$TagID = 4;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16($Depth);\n\t\t$TagLength = strlen($CharacterID . $Depth . $MATRIX . $CXFORM);\n\t\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth . $MATRIX . $CXFORM;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packRemoveObject2Tag($Depth)\n\t{\n\t\tarray_push($this->FMDebug, \"packRemoveObject2Tag\");\n\n\t\t$TagID = 28;\n\n\t\t$Depth = $this->packUI16($Depth);\n\n\t\t$TagLength = strlen($Depth);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Depth;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packRemoveObjectTag($CharacterID, $Depth)\n\t{\n\t\tarray_push($this->FMDebug, \"packRemoveObjectTag\");\n#error_log($CharacterID);\n\t\t$TagID = 5;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16((int)$Depth);\n\n\t\t$TagLength = strlen($CharacterID . $Depth);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function _encode_v1() {\n if ($this->debug) print($this->debugbeg . \"_encode_v1()<HR>\\n\");\n\n if ($this->track) {\n // ID3 v1.1\n $id3pack = 'a3a30a30a30a4a28x1C1C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->track,\n $this->genreno\n );\n } else {\n // ID3 v1\n $id3pack = 'a3a30a30a30a4a30C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->genreno\n );\n }\n\n if ($this->debug) {\n print('id3pack: ' . $id3pack . \"\\n\");\n $unp = unpack('H*new', $newtag);\n print_r($unp);\n }\n\n if ($this->debug) print($this->debugend);\n return $newtag;\n }", "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "abstract protected function getObjectTag();", "function packASSET($Tag, $Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packASSET\");\n\n\t\t$atom = $this->packUI16($Tag);\n\t\t$atom .= $this->packSTRING($Label);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public function tagAs($objid, $tag);", "function create_placeobj($place, $hlink,$done=1) {\n\t\t$ePlaceObj = $this->dom->createElement(\"placeobj\");\n\t\t$ePlaceObj->setAttribute(\"handle\", $hlink);\n\t\t$ePlaceObj->setAttribute(\"id\", $hlink);\n\t\t$ePlaceObj->setAttribute(\"change\", time());\n\n\t\t$ePTitle = $this->dom->createElement(\"ptitle\");\n\t\t$ePTitle = $ePlaceObj->appendChild($ePTitle);\n\t\t$ePlaceObj = $this->ePlaces->appendChild($ePlaceObj);\n\t\t$ePlaceText = $this->dom->createTextNode($place);\n\t\t$ePTitle->appendChild($ePlaceText);\n\t\t$num = 1;\n\t\twhile (($namegSource = get_sub_record(1, \"1 OBJE\", $place, $num)) != null) {\n\t\t\t$this->create_mediaref($this->ePlaces, $namegSource, 1,$done);\n\t\t\t$num++;\n\t\t}\n\t}", "function flashObjectTags($movie, $id, $width, $height, $bgcolor, $flashvars) {\r\n\r\n $id = array_pop(explode(\"/\",$movie));\r\n\r\n // The order in which we supply the parameters (stupidly) can affect the way the movie is displayed\r\n // We want scale = noscale, stage alignment (salign) = left and top (LT)\r\n //\r\n // Mac browsers that aren`t Mozilla, and Netscape 7 prefer scale first, then alignment\r\n // Mozilla on Mac and Non-IE PC browsers (other than Netscape 7) prefer alignment first, then scale\r\n // IE on PC does not seem to care\r\n //\r\n // So we detect the browser string for the `Mac` bit and echo the parameters accordingly\r\n //\r\n // If any problems are reported, saying the games are displayed in the window off-centre, try finding out which\r\n // order it is being viewed in the browser, and try the other way\r\n\r\n\t$userAgent = $_SERVER['HTTP_USER_AGENT'];\r\n\r\n\t// $isMac is true if we are using MSIE or Safari (but NOT Mozilla) for Mac\r\n\r\n\t// the user agent contains `Mac`, and either\r\n // 1. It does not contain the word `Gecko` (which makes it IE), or\r\n // 2. If it does contain `Gecko` then it must also say `Safari` (which makes it Safari)\r\n\r\n $isMac = strpos($userAgent, \"Mac\") !== false &&\r\n (strpos($userAgent,\"Gecko\") === false ||\r\n strpos($userAgent,\"Safari\") !== false);\r\n\r\n // $isNetscape7 is true if we are using NS7 on the PC\r\n\r\n $isNetscape7 = strpos($userAgent, \"Netscape/7\") !== false;\r\n $isFirefox = strpos($userAgent, \"Firefox\") !== false;\r\n\r\n\techo \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" codebase=\\\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\\\" width=\\\"$width\\\" height=\\\"$height\\\" id=\\\"$id\\\">\\n\\n\";\r\n\r\n\techo \"<param name=\\\"movie\\\" value=\\\"$movie.swf\\\" />\\n\";\r\n\techo \"<param name=\\\"menu\\\" value=\\\"false\\\" />\\n\";\r\n\techo \"<param name=\\\"quality\\\" value=\\\"high\\\" />\\n\";\r\n\techo \"<param name=\\\"bgcolor\\\" value=\\\"$bgcolor\\\" />\\n\";\r\n\r\n/*\r\n\techo \"<param name=\\\"scale\\\" value=\\\"noscale\\\" />\\n\";\r\n\techo \"<param name=\\\"salign\\\" value=\\\"LT\\\" />\\n\";\r\n*/\r\n\r\n\techo \"<param name=\\\"flashvars\\\" value=\\\"$flashvars\\\" />\\n\\n\";\r\n\r\n\techo \"<embed src=\\\"$movie.swf\\\" quality=\\\"high\\\" menu=\\\"false\\\" bgcolor=\\\"$bgcolor\\\" width=\\\"$width\\\" height=\\\"$height\\\"\\n\";\r\n\r\n//\techo \"scale=\\\"noscale\\\" salign=\\\"LT\\\" \";\r\n\r\n\techo \"type=\\\"application/x-shockwave-flash\\\" pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\"\\n\";\r\n\techo \"flashvars=\\\"$flashvars\\\">\\n\";\r\n\r\n\techo \"</embed></object>\";\r\n\r\n\techo \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">\\n\";\r\n\r\n\techo \"window.$id.focus(); \\n\";\r\n\r\n\techo \"</script>\";\r\n\r\n}", "function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function convert_tag( &$obj )\n\t{\n\t\t// set default photo\n\t\t$obj->default_photo = $this->get_default_photo( $obj->id, 'tag' );\n\n\t\t// set default icon \n\t\t$obj->default_icon = $this->get_default_photo( $obj->id, 'tag-icon' );\n\n\t}", "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function _buildXMLstringLevel($object, $depth)\n\t{\n\t\t// Initialize variables\n\t\t$retval = '';\n\t\t$tab\t= '';\n\t\tfor($i=1;$i <= $depth; $i++) {\n\t\t\t$tab .= \"\\t\";\n\t\t}\n\n\t\tforeach (get_object_vars( $object ) as $key=>$item)\n\t\t{\n\t\t\tif (is_object($item))\n\t\t\t{\n\t\t\t\t$retval .= $tab.\"<group name=\\\"\".$key.\"\\\">\\n\";\n\t\t\t\t$retval .= $this->_buildXMLstringLevel($item, $depth+1);\n\t\t\t\t$retval .= $tab.\"</group>\\n\";\n\t\t\t} else {\n\t\t\t\t$retval .= $tab.\"<entry name=\\\"\".$key.\"\\\">\".$item.\"</entry>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}", "function OBJECTTYPE ($id,$ticks) {\n global $Ticks; // time since start of mission in 1/50 sec ticks\n global $ID; // object ID\n global $TYPE; // type of object in this context\n global $objecttype; // object type from PID/AID/TID\n global $numgobjects; // number of game objects involved\n global $GOline; // lines defining game objects\n \n // T:36590 AType:12 ID:223250 TYPE:Albatros D.III COUNTRY:501 NAME:Plane PID:-1^M\n $objecttype = \"\";\n $found = \"0\";\n for ($i = 0; $i < $numgobjects; ++$i) {\n $j = $GOline[$i];\n if ((\"$ID[$j]\" == \"$id\") && ($Ticks[$j] <= $ticks)) {\n $objecttype = $TYPE[$j];\n $found = \"1\";\n }\n }\n if ( $id == \"-1\") {\n $objecttype = \"Intrinsic\";\n } elseif (!$found) { // if not an object, must be a player\n $objecttype = \"Player\";\n }\n}", "function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function createTag($tag,$force=false,$msg=false){\n\t$default='tmp'.rand(0,99);\n\t$path='img/tags';\n\t$debug=isset($_GET['debug'])||(is_array($tag)&&$tag['debug']!='');\n\t$tid=substr(intToMd5(is_array($tag)?($tag['idTag']==''?$default:$tag['idTag']):$tag),-16);\n\t$tmpFile=$default;\n\tif($tid==$default){\n\t\t$force=true;\n\t\t$tid=$tmpFile;\n\t}\n\t$photo=$tid.'.jpg';\n\t$photom=$tid.'.m.jpg';\n\t$photopath=$path.'/'.$photo;\n\t$photompath=$path.'/'.$photom;\n\t$_path=LOCAL?RELPATH:FILESERVER;\n\t//Se busca la imagen de la tag\n\tif(!$force) $im=imagecreatefromany($_path.$photopath);\n\t//Si la imagen de la tag no existe,se crea\n\tif(!$im||$debug){\n\t\tif(!is_array($tag)) $tag=getTagData($tid);\n\t\t//Debugger\n\t\tif($debug){\n\t\t\t_imprimir($tag);\n\t\t\techo '<br/>fondo='.(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\techo '<br/>path='.$_path;\n\t\t\techo '<br/>photo='.$tag['photoOwner'];\n\t\t\techo '<br/>getUserPicture='.getUserPicture($tag['photoOwner']);\n\t\t}\n\t\tif($tag){\n\t\t\t$font=array(\n\t\t\t\tRELPATH.'fonts/trebuc.ttf',\n\t\t\t\tRELPATH.'fonts/trebucbd.ttf',\n\t\t\t\tRELPATH.'fonts/verdana.ttf',\n\t\t\t\tRELPATH.'fonts/verdanab.ttf'\n\t\t\t);\n\t\t\t//Se crea la imagen con el tamaño normal - 650 x 300.\n\t\t\t$im=imagecreatetruecolor(TAGWIDTH,TAGHEIGHT);\n\t\t\t//Crear algunos colores\n\t\t\t$blanco=imagecolorallocate($im,255,255,255);\n\t\t\t$negro=imagecolorallocate($im,0,0,0);\n\t\t\t//Fondo\n\t\t\t$imagen=(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$dy=intval((TAGHEIGHT-$is[1])/2);\n\t\t\t\twhile($dy>0) $dy-=$is[1];\n\t\t\t\tdo{\n\t\t\t\t\t$dx=$is[0]>TAGWIDTH?intval((TAGWIDTH-$is[0])/2):0;\n\t\t\t\t\tdo{\n\t\t\t\t\t\timagecopy($im,$img,$dx,$dy,0,0,$is[0],$is[1]);\n\t\t\t\t\t\t$dx+=$is[0];\n\t\t\t\t\t}while($dx<TAGWIDTH);\n\t\t\t\t\t$dy+=$is[1];\n\t\t\t\t}while($dy<TAGHEIGHT);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Bordes redondeados\n\t\t\t$cr=25;//radio de la curva\n\t\t\t$ce=array(1,1,1,1);//esquinas a redondear. (si,sd,ii,id). (tl,tr,bl,br).\n\t\t\t$mask=imagecreatetruecolor($cr*2+1,$cr*2+1);\n\t\t\timagealphablending($mask,false);\n\t\t\t//$maskcolor=imagecolorallocate($im,255,0,255);//color para remplazar por transparencia\n\t\t\t$maskcolor=imagecolorallocate($im,255,255,255);\n\t\t\t$transparent=imagecolorallocatealpha($im,0,0,0,127);\n\t\t\timagefilledrectangle($mask,0,0,$cr*2+1,$cr*2+1,$maskcolor);\n\t\t\timagefilledellipse($mask,$cr,$cr,$cr*2,$cr*2,$transparent);\n\t\t\t//Top-left corner-esquina superior izquierda\n\t\t\tif ($ce[0]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Top-right corner - esquina superior derecha\n\t\t\tif ($ce[1]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-left corner - esquina inferior izquierda\n\t\t\tif ($ce[2]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-right corner - esquina inferior derecha\n\t\t\tif ($ce[3]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\timagedestroy($mask);\n\t\t\t/*\n\t\t\t//Transparencia en las esquinas (solo para png)\n\t\t\timagealphablending($im,false);\n\t\t\timagesavealpha($im,true);\n\t\t\t$transparent=imagecolorallocatealpha($im,255,0,255,127);\n\t\t\tfor($i=0;$i<TAGWIDTH;$i++)for($j=0;$j<TAGHEIGHT;$j++){\n\t\t\t\t$rgb=imagecolorat($im,$i,$j);\n\t\t\t\tif($rgb==16711935) imagesetpixel($im,$i,$j,$transparent);\n\t\t\t}\n\t\t\timagealphablending($im,true);\n\t\t\t/**/\n\t\t\t//Imagen de placa\n\t\t\t$imagen=RELPATH.'img/placaFondo.png';\n\t\t\t\t$img=imagecreatefromany($imagen);\n\t\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\timagecopy($im,$img,0,0,0,0,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Imagen de usuario\n if($tag['idProduct'])\n $imagen=$_path.$tag['photoOwner'];\n else\n $imagen=$_path.getUserPicture($tag['photoOwner'],'img/users/default.png');\n\t\t\tif($debug) echo '<br/>'.$imagen;\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$x=40;\n\t\t\t\t$y=215;\n\t\t\t\t//imagefilledrectangle($im,$x-1,$y-1,$x+60,$y+60,$blanco);//marco\n\t\t\t\timagecopyresampled($im,$img,$x,$y,0,0,60,60,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Textos de la tag.\n\t\t\t//texto1 y texto2 por su tamaño se les define un ancho maximo y pueden tener multiples lineas\n\t\t\t$luz\t=imagecolorhexallocatealpha($im,'#FFFFFF');\n\t\t\t$sombra\t=imagecolorhexallocatealpha($im,'#000000');\n\t\t\t//Tipos de fuentes. 0=normal,1=negrita\n\t\t\t//texto1 - Parte superior\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code']);\n\t\t\t$size=15;\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$y=73;\n\t\t\t$mw=600;//max width - ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=23;\n\t\t\t}while(count($tmp)>$i);\n\t\t\t//texto principal - Centro\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=strtoupper(strclean($tag['code_number']));\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code2']);\n\t\t\t$size=45;\n\t\t\t$s=0;//separacion entre letras\n\t\t\t$len=strlen($texto);\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t$y=165;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//nombre usuario\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['nameOwner']);\n\t\t\t$color=$blanco;\n\t\t\t$sombra=$negro;\n\t\t\t$size=15;\n\t\t\t$x=115;\n\t\t\t$y=223;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//fecha\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=date('d-M-Y H:i',$tag['date']);\n\t\t\t$size=8;\n\t\t\t$x+=$txt[2]+10;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\n\t\t\t//texto2 - parte baja\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto2']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code3']);\n\t\t\t$size=10;\n\t\t\t$x=115;\n\t\t\t$y=241;\n\t\t\t$mw=430;//max width-ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=15;\n\t\t\t}while(count($tmp)>$i);\n\t\t}\n\t\t//subir el archivo al servidor\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/tmp'.rand().'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photopath,650)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photo,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada imagen '.$photo;\n\t\t\t}\n\t\t}\n\t}elseif($msg) echo '<br/>ya existe la imagen '.$photo;\n\t//FIN - creacion de la imagen de la tag\n\t//creamos la miniatura si no existe\n\tif(!fileExistsRemote($_path.$photompath)||$force){\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/'.$tmpFile.'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photompath,200)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photom,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada miniatura '.$photom;\n\t\t\t}\n\t\t}\n\t}\n\t$GLOBALS['cn']->query('UPDATE `tags` SET `img` =\"'.$tid.'\" WHERE `id` =\"'.$tag['id'].'\";');\n\treturn $tid;\n}", "function packEndTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packEndTag\");\n\n\t\t$TagID = 0;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "protected function buildCat2Element()\r\n\t{\r\n\t\treturn null;\r\n\t}", "function addVakoImage($object) {\n /* you can itentify the vako with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoImageIdOnMarketplace_'.rand(1000, 9999); \n}", "function _decode_v1($rawtag) {\n if ($this->debug) print($this->debugbeg . \"_decode_v1(\\$rawtag)<HR>\\n\");\n\n if ($rawtag[125] == Chr(0) and $rawtag[126] != Chr(0)) {\n // ID3 v1.1\n $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a28COMMENT/x1/C1TRACK/C1GENRENO';\n } else {\n // ID3 v1\n $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a30COMMENT/C1GENRENO';\n }\n\n $id3tag = unpack($format, $rawtag);\n if ($this->debug) print_r($id3tag);\n\n if ($id3tag['TAG'] == 'TAG') {\n $id3tag['GENRE'] = $this->getgenre($id3tag['GENRENO']);\n } else {\n $id3tag = PEAR::raiseError( 'TAG not found', PEAR_MP3_ID_TNF);\n }\n if ($this->debug) print($this->debugend);\n return $id3tag;\n }", "function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function _putformxobjects() {\n $filter=($this->compress) ? '/Filter /FlateDecode ' : '';\n\t reset($this->tpls);\n foreach($this->tpls AS $tplidx => $tpl) {\n\n $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];\n \t\t$this->_newobj();\n \t\t$this->tpls[$tplidx]['n'] = $this->n;\n \t\t$this->_out('<<'.$filter.'/Type /XObject');\n $this->_out('/Subtype /Form');\n $this->_out('/FormType 1');\n $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',\n // llx\n $tpl['x'] * $this->k,\n // lly\n -$tpl['y'] * $this->k,\n // urx\n ($tpl['w'] + $tpl['x']) * $this->k,\n // ury\n ($tpl['h'] - $tpl['y']) * $this->k\n ));\n \n if ($tpl['x'] != 0 || $tpl['y'] != 0) {\n $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]',\n -$tpl['x'] * $this->k * 2, $tpl['y'] * $this->k * 2\n ));\n }\n \n $this->_out('/Resources ');\n\n $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');\n \tif (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {\n \t$this->_out('/Font <<');\n foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)\n \t\t$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');\n \t$this->_out('>>');\n }\n \tif(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || \n \t isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))\n \t{\n $this->_out('/XObject <<');\n if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {\n foreach($this->_res['tpl'][$tplidx]['images'] as $image)\n \t\t\t$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');\n }\n if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {\n foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)\n $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');\n }\n $this->_out('>>');\n \t}\n \t$this->_out('>>');\n \t\n \t$this->_out('/Length ' . strlen($p) . ' >>');\n \t\t$this->_putstream($p);\n \t\t$this->_out('endobj');\n }\n }", "function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function __toString() {\n\t\tif (!$this->isBound()) {\n\t\t\treturn 'DImage '.$this->id.' [not bound]';\n\t\t}\n\t\t$r = 'DImage '.$this->id.' ['.$this->info;\n\t\tif ($this->getFrameCount() > 1) {\n\t\t\t$r .= ' frames:'.$this->getFrameCount();\n\t\t}\n\t\t$r .= ' #'.$this->getResourceID();\n\t\t$r .= ']';\n\t\treturn $r;\n\t}", "function packFrameLabelTag($Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packFrameLabelTag\");\n\n\t\t$TagID = 43;\n\t\t$Label = $this->packSTRING($Label);\n\t\t$TagLength = strlen($Label);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function forgeObject()\n {\n // Check if we have an object creation array.\n if ($this->provider && isset($this->provider['render']['object'])) {\n // Start object tag.\n $object = '<object';\n\n foreach ($this->provider['render']['object']['attributes'] as $attribute => $val) {\n $object .= sprintf(' %s=\"%s\"', $attribute, $val);\n }\n $object .= '>';\n\n // Create params.\n if ( isset($this->provider['render']['object']['params']) ) {\n foreach ($this->provider['render']['object']['params'] as $param => $val) {\n $object .= sprintf('<param name=\"%s\" value=\"%s\"></param>', $param, $val);\n }\n }\n\n // Create embed.\n if ( isset($this->provider['render']['object']['embed']) ) {\n $object .= '<embed';\n // embed can have same attributes as object itself (height, width etc)\n foreach ($this->provider['render']['object']['embed'] as $attribute => $val) {\n $val = ( is_bool($val) && $val ? ($val ? 'true' : 'false') : $val );\n $object .= sprintf(' %s=\"%s\"', $attribute, $val);\n }\n $object .= '></embed>';\n }\n\n // Close object tag.\n $object .= '</object>';\n\n $object .= $this->forgeScript();\n\n return $object;\n }\n }" ]
[ "0.72861695", "0.62177104", "0.5522299", "0.5456821", "0.51139694", "0.50554836", "0.50529706", "0.4990251", "0.48706454", "0.48585227", "0.48366517", "0.48363402", "0.48218682", "0.48013645", "0.47820848", "0.4763549", "0.47107768", "0.47088858", "0.4665581", "0.46615782", "0.46449846", "0.46020374", "0.46012884", "0.45868972", "0.4583972", "0.4572021", "0.45537582", "0.4547567", "0.45210147", "0.45009843" ]
0.79071486
0
string packRemoveObject2Tag(integer Depth) returns an SWF RemoveObject2 tag string. TagID: 28
function packRemoveObject2Tag($Depth) { array_push($this->FMDebug, "packRemoveObject2Tag"); $TagID = 28; $Depth = $this->packUI16($Depth); $TagLength = strlen($Depth); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Depth; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packRemoveObjectTag($CharacterID, $Depth)\n\t{\n\t\tarray_push($this->FMDebug, \"packRemoveObjectTag\");\n#error_log($CharacterID);\n\t\t$TagID = 5;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16((int)$Depth);\n\n\t\t$TagLength = strlen($CharacterID . $Depth);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function unTag($objid, $tag);", "abstract protected function getObjectTag();", "function packPlaceObjectTag($CharacterID, $Depth, $MATRIX, $CXFORM)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObjectTag\");\n\n\t\t$TagID = 4;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16($Depth);\n\t\t$TagLength = strlen($CharacterID . $Depth . $MATRIX . $CXFORM);\n\t\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth . $MATRIX . $CXFORM;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function _decode_v1($rawtag) {\n if ($this->debug) print($this->debugbeg . \"_decode_v1(\\$rawtag)<HR>\\n\");\n\n if ($rawtag[125] == Chr(0) and $rawtag[126] != Chr(0)) {\n // ID3 v1.1\n $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a28COMMENT/x1/C1TRACK/C1GENRENO';\n } else {\n // ID3 v1\n $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a30COMMENT/C1GENRENO';\n }\n\n $id3tag = unpack($format, $rawtag);\n if ($this->debug) print_r($id3tag);\n\n if ($id3tag['TAG'] == 'TAG') {\n $id3tag['GENRE'] = $this->getgenre($id3tag['GENRENO']);\n } else {\n $id3tag = PEAR::raiseError( 'TAG not found', PEAR_MP3_ID_TNF);\n }\n if ($this->debug) print($this->debugend);\n return $id3tag;\n }", "function _buildXMLstringLevel($object, $depth)\n\t{\n\t\t// Initialize variables\n\t\t$retval = '';\n\t\t$tab\t= '';\n\t\tfor($i=1;$i <= $depth; $i++) {\n\t\t\t$tab .= \"\\t\";\n\t\t}\n\n\t\tforeach (get_object_vars( $object ) as $key=>$item)\n\t\t{\n\t\t\tif (is_object($item))\n\t\t\t{\n\t\t\t\t$retval .= $tab.\"<group name=\\\"\".$key.\"\\\">\\n\";\n\t\t\t\t$retval .= $this->_buildXMLstringLevel($item, $depth+1);\n\t\t\t\t$retval .= $tab.\"</group>\\n\";\n\t\t\t} else {\n\t\t\t\t$retval .= $tab.\"<entry name=\\\"\".$key.\"\\\">\".$item.\"</entry>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}", "function _encode_v1() {\n if ($this->debug) print($this->debugbeg . \"_encode_v1()<HR>\\n\");\n\n if ($this->track) {\n // ID3 v1.1\n $id3pack = 'a3a30a30a30a4a28x1C1C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->track,\n $this->genreno\n );\n } else {\n // ID3 v1\n $id3pack = 'a3a30a30a30a4a30C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->genreno\n );\n }\n\n if ($this->debug) {\n print('id3pack: ' . $id3pack . \"\\n\");\n $unp = unpack('H*new', $newtag);\n print_r($unp);\n }\n\n if ($this->debug) print($this->debugend);\n return $newtag;\n }", "function __unserialize($sObject) {\n\t$__ret =preg_replace('!s:(\\d+):\"(.*?)\";!e', \"'s:'.strlen('$2').':\\\"$2\\\";'\", $sObject );\n\treturn unserialize($__ret);\n}", "function packEndTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packEndTag\");\n\n\t\t$TagID = 0;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "private function retrieve_tag($tag)\n {\n if (isset($this->tags[$tag . 'count'])) { //if the openener is not in the Object we ignore it\n $temp_parent = $this->tags['parent']; //check to see if it's a closable tag.\n while ($temp_parent) { //till we reach '' (the initial value);\n if ($tag . $this->tags[$tag . 'count'] === $temp_parent) { //if this is it use it\n break;\n }\n $temp_parent = isset($this->tags[$temp_parent . 'parent']) ? $this->tags[$temp_parent . 'parent'] : ''; //otherwise keep on climbing up the DOM Tree\n }\n if ($temp_parent) { //if we caught something\n $this->indent_level = $this->tags[$tag . $this->tags[$tag . 'count']]; //set the indent_level accordingly\n $this->tags['parent'] = $this->tags[$temp_parent . 'parent']; //and set the current parent\n }\n unset($this->tags[$tag . $this->tags[$tag . 'count'] . 'parent']); //delete the closed tags parent reference...\n unset($this->tags[$tag . $this->tags[$tag . 'count']]); //...and the tag itself\n if ($this->tags[$tag . 'count'] === 1) {\n unset($this->tags[$tag . 'count']);\n } else {\n $this->tags[$tag . 'count']--;\n }\n }\n }", "function End_Tag($parser, $tag)\r\n\t{\r\n\t\tif ($tag == 'AMP') return;\r\n\t\telse if ($tag == 'BOX')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'BR') return;\r\n\t\telse if ($tag == 'COPY') return;\r\n\t\telse if ($tag == 'DOCTYPE') return;\r\n\t\telse if ($tag == 'IMG') return;\r\n\t\telse if ($tag == 'INCLUDE') return;\r\n\t\telse if ($tag == 'INPUT') return;\r\n\t\telse if ($tag == 'LINK') return;\r\n\t\telse if ($tag == 'META') return;\r\n\t\telse if ($tag == 'NBSP') return;\r\n\t\telse if ($tag == 'NULL') return;\r\n\t\telse if ($tag == 'PRESENT')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get($this->data);\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'XFORM')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\t$obj->out .= '</'.strtolower($tag).'>';\r\n\t\t}\r\n\t}", "function convert_tag( &$obj )\n\t{\n\t\t// set default photo\n\t\t$obj->default_photo = $this->get_default_photo( $obj->id, 'tag' );\n\n\t\t// set default icon \n\t\t$obj->default_icon = $this->get_default_photo( $obj->id, 'tag-icon' );\n\n\t}", "function TestRun_remove_tag($run_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.remove_tag', array(new xmlrpcval($run_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function remove($id3v1 = true, $id3v2 = true) {\n if ($this->debug) print($this->debugbeg . \"remove()<HR>\\n\");\n\n if ($id3v1) {\n $this->_remove_v1();\n }\n\n if ($id3v2) {\n // TODO: write ID3v2 code\n }\n\n if ($this->debug) print($this->debugend);\n }", "function TestPlan_remove_tag($plan_id, $tag_name) {\n\t// Create call\n//\t$call = new xmlrpcmsg('TestPlan.remove_tag', array(new xmlrpcval(array(\"plan_id\" => new xmlrpcval($plan_id, \"int\"), \"tag_name\" => new xmlrpcval($tag_name, \"string\")), \"struct\")));\n\t$call = new xmlrpcmsg('TestPlan.remove_tag', array(new xmlrpcval($plan_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function OBJM_DeleteObject($respdata)\r\n{\r\n\t//PARSE THE STRING AND FORM A QUERY PARAMS\r\n\tparse_str($respdata) ;\t\r\n\t$objectTypeVal = strtoupper($OBJECTTYPE);\r\n\t$objectIDVal = strtoupper($OBJECTID);\r\n\t\r\n\t$respdata = 'FAIL'; \r\n\t\r\n\tif($objectTypeVal == \"PAGE\")\r\n\t\treturn false; \r\n\t//GET THE TARGET OBJECT ID TO BE DELETED \r\n\t$TMObjectID = \"TM_\".$objectIDVal; \r\n\t$DIVObjectID = \"DIV_\".$objectIDVal; \r\n\t\r\n\t//Before that check if the item is already referred somewhere in which case delete that first\r\n\t//get the list of nodes with tag as div \r\n\t$tag = \"li\"; //later it can be li as well while using JQX\r\n\t$_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']); \r\n\t$nodelist = $_SESSION['sceneCompXMLDOM']->getElementsByTagName($tag); \r\n\t$arrTodelete = array(); \r\n\t$arrIndex=0; \r\n\tif($objectTypeVal == \"LAYER\")\r\n\t{\r\n\t\tfor($i = 0; $i < $nodelist->length; $i++)\r\n\t\t{\r\n\t\t\t//get the node \t\r\n\t\t\t$currNode = $nodelist->item($i); \t\t\r\n\t\t\t//check if the nodes' type is that of Layer type\r\n\t\t\t$type = $currNode->getAttribute(\"type\"); \r\n\t\t\tif($type == \"LAYER\")\r\n\t\t\t{ \t\t\r\n\t\t\t\t/// then check if the node has data-srcid same as that of the target\t\r\n\t\t\t\t$srcid = $currNode->getAttribute(\"data-srcid\");\r\n\t\t\t\tif($srcid == $TMObjectID)\t\r\n\t\t\t\t{\r\n\t\t\t\t//then get the ID of the node and call for deletion\r\n\t\t\t\t\t$nodeID = $currNode->getAttribute(\"id\");\r\n\t\t\t\t\t$arrTodelete[$arrIndex++] = $nodeID; \t\t\t\r\n\t\t\t\t}\r\n\t\t\t} \t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//now delete the copied nodes from the stored IDs in the array\r\n\t\tforeach ($arrTodelete as $index => $arrValue)\r\n\t\t{\r\n\t\t\t$ID = $arrValue;\r\n\t\t\t$retval = CDOC_COMMON_DeleteElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'], $ID, true, \"type\", $objectTypeVal);\r\n\t\t\r\n\t\t\tif($retval != true)\r\n\t\t\t\treturn $retval;\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t\t\r\n\t//DELETE IT FROM SC SML DATA \r\n\t$retval = CDOC_COMMON_DeleteElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'], $TMObjectID, true, \"type\", $objectTypeVal);\r\n\t\r\n\tif($retval != true)\r\n\t\treturn $retval; \r\n\t\r\n\t//CALL APPROPRIATE OBJECT SPECIFIC FUNCTION TO DELETE IT FROM HTML DOM \r\n\tif(!isset($_SESSION['projHTMLDOM']))\r\n\t\treturn false; \r\n\tif(!isset($_SESSION['projHTMLFilename']))\r\n\t\treturn false;\r\n\tif($objectTypeVal == 'HTMLOBJECT')\r\n\t{\r\n\t\t$retval = CDOC_COMMON_DeleteHTMLElement($_SESSION['projHTMLDOM'], $_SESSION['projHTMLFilename'], $DIVObjectID);\r\n\t\t$respdata = 'OK';\r\n\t}\r\n\telse if($objectTypeVal == 'SOURCE')\r\n\t{\r\n\t\t$retval = CDOC_COMMON_DeleteHTMLElement($_SESSION['projHTMLDOM'], $_SESSION['projHTMLFilename'], $objectIDVal);\r\n\t\t$respdata = 'OK';\r\n\t}\r\n\t\t\r\n\t\r\n\treturn $retval; \r\n}", "public function undo_tag() {\n\t\t$version = $this->conf['common']['releasever'];\n\t\t$tag = str_replace( '$1', $version, $this->conf['common']['tagname'] );\n\n\t\tforeach ( $this->conf['extensions'] as $ext => $checkout ) {\n\t\t\tchdir( \"{$this->dir}/extensions/$ext\" );\n\t\t\t$cTag = escapeshellarg( $tag );\n\t\t\texec( \"git checkout master\" );\n\t\t\texec( \"git tag -d $cTag\" );\n\t\t\t$cTag = escapeshellarg( \":refs/tags/$tag\" );\n\t\t\texec( \"git push origin $cTag\" );\n\t\t}\n\t}", "public function tagAs($objid, $tag);", "private static function parseObject(mixed $object, int $level, array &$cache): string {\n $output = '';\n $className = get_class($object);\n\n if (($id = array_search($object, $cache, true)) !== false) $output .= \"{$className}#\" . (++$id) . '(...)';\n else if (static::$depth <= $level) $output .= \"{$className}(...)\";\n else {\n $id = array_push($cache, $object);\n $members = (array)$object;\n $keys = array_keys($members);\n $spaces = str_repeat(' ', $level * 4);\n $output .= \"$className#$id {\";\n\n foreach ($keys as $key) {\n $keyDisplay = strtr(trim(\"$key\"), [\"\\0\" => ':']);\n $output .= PHP_EOL . \"{$spaces} [$keyDisplay] => \" . self::parseVariable($members[$key], $level + 1, $cache);\n }\n $output .= PHP_EOL . \"{$spaces}}\";\n }\n return $output;\n }", "function testRemoveTag_UsingMessyTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('some thing!', 'a-nother.', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}", "function non_DOM_stripme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\t//print(\"matches[0][size][0]: \");var_dump($matches[0][$size][0]);\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t//print(\"strlen(matches[0][size][0]): \");var_dump(strlen($matches[0][$size][0]));\r\n\t\t\t$substr = substr($OString, strlen($matches[0][$size][0]), strlen($OString) - strlen($matches[0][$size][0]) - (strlen($tagname) + 3));\r\n\t\t\t//print(\"OString: \");var_dump($OString);\r\n\t\t\t//print(\"substr: \");var_dump($substr);\r\n\t\t\t//$this->code = str_replace($OString, $substr, $this->code);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . $substr . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "public function remove_layer2_assignment($p_layer2_id, $p_obj_id)\n {\n $l_delete = 'DELETE FROM isys_cats_layer2_net_2_layer3 WHERE isys_obj__id = ' . $this->convert_sql_id($p_obj_id) . ' AND ';\n\n if (is_numeric($p_layer2_id))\n {\n $l_delete .= ' isys_cats_layer2_net_list__id = ' . $this->convert_sql_id($p_layer2_id);\n }\n elseif (is_array($p_layer2_id) && count($p_layer2_id) > 0)\n {\n $l_delete .= ' isys_cats_layer2_net_list__id IN (' . implode(',', $p_layer2_id) . ')';\n }\n else\n {\n $l_delete .= ' isys_cats_layer2_net_list__id = FALSE';\n } // if\n return ($this->update($l_delete) && $this->apply_update());\n }", "private function destory(object $obj) : string\n {\n $temp = (\"Destorying \" . $obj->getName()) . \"<br/>\";\n unset($obj);\n return $temp;\n }", "public function remove ($obj) {}", "function wpb_remove_version() {\nreturn '';\n}", "function TestCase_remove_tag($case_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.remove_tag', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function non_DOM_deleteme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "function pramble_remove_version(){\n\t\t\t\treturn '';\n\t\t\t}" ]
[ "0.7166977", "0.5387041", "0.53776664", "0.5024824", "0.5017953", "0.4905373", "0.4719566", "0.4679917", "0.46370998", "0.46349996", "0.46308884", "0.46004474", "0.45419884", "0.45316544", "0.4498496", "0.44977793", "0.44838247", "0.44604406", "0.43973446", "0.43964258", "0.43936828", "0.43384475", "0.4336385", "0.43314356", "0.43178558", "0.43138802", "0.43114987", "0.42701107", "0.4268923", "0.4253885" ]
0.8458972
0
null packDefineShapeTag3(integer ShapeID, string ShapeBounds, string SHAPEWITHSTYLE) returns an SWF DefineShapeTag string. TagID: 32
function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE) { array_push($this->FMDebug, "packDefineShape3Tag"); $TagID = 32; $DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE; $TagLength = strlen($DefineShapeTag); $this->AutoSetSWFVersion(1); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public function getShape1()\n {\n }", "function swf_shapefillbitmapclip($bitmapid)\n{\n}", "function getShape() { return $this->_shape; }", "public function getShape2()\n {\n }", "function getShape() { return $this->_shape; }", "function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}", "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function getShapeId()\n {\n return $this->shape_id;\n }", "function wp_migrate_old_typography_shape($metadata)\n {\n }", "function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public function shape(int $id): OptionalInterface\n {\n return $this->tags()->filter(function ($item) use($id) { return $item['shapeId'] == $id; })->first();\n }", "public function format(ShapeInterface $shape);", "public static function identicon($_hash,$_size=NULL) {\n\t\t$_blox=F3::$global['IBLOCKS'];\n\t\tif (is_null($_size))\n\t\t\t$_size=F3::$global['IPIXELS'];\n\t\t// Rotatable shapes\n\t\t$_dynamic=array(\n\t\t\tarray(.5,1,1,0,1,1),\n\t\t\tarray(.5,0,1,0,.5,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.5),\n\t\t\tarray(0,.5,.5,0,1,.5,.5,1,.5,.5),\n\t\t\tarray(0,.5,1,0,1,1,0,1,1,.5),\n\t\t\tarray(1,0,1,1,.5,1,1,.5,.5,.5),\n\t\t\tarray(0,0,1,0,1,.5,0,0,.5,1,0,1),\n\t\t\tarray(0,0,.5,0,1,.5,.5,1,0,1,.5,.5),\n\t\t\tarray(.5,0,.5,.5,1,.5,1,1,.5,1,.5,.5,0,.5),\n\t\t\tarray(0,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,.5,.5,1,1,.5,.5,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.75,.5,.5,1,.25),\n\t\t\tarray(0,.5,.5,0,.5,.5,1,0,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,1,1,0,1,1,.5,.5,.25,.5,.75,0,.5,.5,.25),\n\t\t\tarray(0,.5,.5,.5,.5,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,.5,.5,.5,0,0,.5,1,.5,.5,1,.5,.5,0,1)\n\t\t);\n\t\t// Fixed shapes (for center sprite)\n\t\t$_static=array(\n\t\t\tarray(),\n\t\t\tarray(0,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,.5,.5,1,0,.5),\n\t\t\tarray(0,0,1,0,1,1,0,1,0,.5,.5,1,1,.5,.5,0,0,.5),\n\t\t\tarray(.25,0,.75,0,.5,.5,1,.25,1,.75,.5,.5,\n\t\t\t\t.75,1,.25,1,.5,.5,0,.75,0,.25,.5,.5),\n\t\t\tarray(0,0,.5,.25,1,0,.75,.5,1,1,.5,.75,0,1,.25,.5),\n\t\t\tarray(.33,.33,.67,.33,.67,.67,.33,.67),\n\t\t\tarray(0,0,.33,0,.33,.33,.67,.33,.67,0,1,0,1,.33,.67,.33,\n\t\t\t\t.67,.67,1,.67,1,1,.67,1,.67,.67,.33,.67,.33,1,0,1,\n\t\t\t\t0,.67,.33,.67,.33,.33,0,.33)\n\t\t);\n\t\t// Parse MD5 hash\n\t\t$_hash=F3::resolve($_hash);\n\t\tlist($_bgR,$_bgG,$_bgB)=self::rgb(F3::$global['BGCOLOR']);\n\t\tlist($_fgR,$_fgG,$_fgB)=self::rgb(substr($_hash,0,6));\n\t\t$_shapeC=hexdec($_hash[6]);\n\t\t$_angleC=hexdec($_hash[7]%4);\n\t\t$_shapeX=hexdec($_hash[8]);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_shapeS[$_i]=hexdec($_hash[9+$_i*2]);\n\t\t\t$_angleS[$_i]=hexdec($_hash[10+$_i*2]%4);\n\t\t}\n\t\t// Start with NxN blank slate\n\t\t$_identicon=imagecreatetruecolor($_size*$_blox,$_size*$_blox);\n\t\timageantialias($_identicon,TRUE);\n\t\t$_bg=imagecolorallocate($_identicon,$_bgR,$_bgG,$_bgB);\n\t\t$_fg=imagecolorallocate($_identicon,$_fgR,$_fgG,$_fgB);\n\t\t// Generate corner sprites\n\t\t$_corner=imagecreatetruecolor($_size,$_size);\n\t\timagefill($_corner,0,0,$_bg);\n\t\t$_sprite=$_dynamic[$_shapeC];\n\t\tfor ($_i=0,$_len=count($_sprite);$_i<$_len;$_i++)\n\t\t\t$_sprite[$_i]=$_sprite[$_i]*$_size;\n\t\timagefilledpolygon($_corner,$_sprite,$_len/2,$_fg);\n\t\tfor ($_i=0;$_i<$_angleC;$_i++)\n\t\t\t$_corner=imagerotate($_corner,90,$_bg);\n\t\t// Generate side sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_side[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_side[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeS[$_i]];\n\t\t\tfor ($_j=0,$_len=count($_sprite);$_j<$_len;$_j++)\n\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\timagefilledpolygon($_side[$_i],$_sprite,$_len/2,$_fg);\n\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t$_side[$_i]=imagerotate($_side[$_i],90,$_bg);\n\t\t}\n\t\t// Generate center sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_center[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_center[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeX];\n\t\t\tif ($_blox%2>0 && $_i==$_blox-3)\n\t\t\t\t// Odd center sprites\n\t\t\t\t$_sprite=$_static[$_shapeX%8];\n\t\t\t$_len=count($_sprite);\n\t\t\tif ($_len) {\n\t\t\t\tfor ($_j=0;$_j<$_len;$_j++)\n\t\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\t\timagefilledpolygon($_center[$_i],$_sprite,$_len/2,$_fg);\n\t\t\t}\n\t\t\tif ($_i<($_blox-3))\n\t\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t\t$_center[$_i]=imagerotate($_center[$_i],90,$_bg);\n\t\t}\n\t\t// Paste sprites\n\t\tfor ($_i=0;$_i<4;$_i++) {\n\t\t\timagecopy($_identicon,$_corner,0,0,0,0,$_size,$_size);\n\t\t\tfor ($_j=0;$_j<$_blox-2;$_j++) {\n\t\t\t\timagecopy($_identicon,$_side[$_j],\n\t\t\t\t\t$_size*($_j+1),0,0,0,$_size,$_size);\n\t\t\t\tfor ($_k=$_j;$_k<$_blox-3-$_j;$_k++)\n\t\t\t\t\timagecopy($_identicon,$_center[$_k],\n\t\t\t\t\t\t$_size*($_k+1),$_size*($_j+1),0,0,$_size,$_size);\n\t\t\t}\n\t\t\t$_identicon=imagerotate($_identicon,90,$_bg);\n\t\t}\n\t\tif ($_blox%2>0)\n\t\t\t// Paste odd center sprite\n\t\t\timagecopy($_identicon,$_center[$_blox-3],\n\t\t\t\t$_size*(floor($_blox/2)),$_size*(floor($_blox/2)),0,0,\n\t\t\t\t$_size,$_size);\n\t\t// Resize\n\t\t$_resized=imagecreatetruecolor($_size,$_size);\n\t\timagecopyresampled($_resized,$_identicon,0,0,0,0,$_size,$_size,\n\t\t\t$_size*$_blox,$_size*$_blox);\n\t\t// Make the background transparent\n\t\timagecolortransparent($_resized,$_bg);\n\t\tif (PHP_SAPI!='cli' && !headers_sent())\n\t\t\theader(F3::HTTP_Content.': image/png');\n\t\timagepng($_resized,NULL,self::PNG_Compress,PNG_NO_FILTER);\n\t\t// Free resources\n\t\timagedestroy($_identicon);\n\t\timagedestroy($_resized);\n\t\timagedestroy($_corner);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\timagedestroy($_side[$_i]);\n\t\t\timagedestroy($_center[$_i]);\n\t\t}\n\t}", "public function wktGenerateGeometry();", "function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "protected function addSvgContent(IdmlSvgShape $element, $tagName, $depth=0)\n {\n $attribs = $element->attribs;\n\n $attribs['style'] = $this->getStyleAttrib($element);\n\n if ($tagName != 'line')\n {\n $attribs['style'] .= $this->getSvgTransformationCSS($element, $tagName);\n }\n\n // Get the fill and stroke information, which is a different syntax than other HTML elements\n $svgStyleMgr = new IdmlSvgStyleManager();\n $attribs['style'] .= $svgStyleMgr->convertSvgStyles($element);\n\n // Set up and insert the polygon tag\n $strAttr = $this->getHTMLAttributesString($element, $attribs);\n $html = '<' . $tagName . ' ' . $strAttr . ' />';\n $this->addPageElement($html, $depth);\n\n $this->closeSvgElement($element, $depth);\n }", "private function _loadShapes()\n {\n //shaded relief\n $this->shapes['relief'] = array(\n 'shape' => $this->shape_path . \"/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n // Geotiff created by David P. Shorthouse using above file.\n $this->shapes['reliefgrey'] = array(\n 'shape' => $this->shape_path . \"/GRAY_HR_SR_OB_DR/GRAY_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n //lakes outline\n $this->shapes['lakesOutline'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 2\n );\n\n //lakes\n $this->shapes['lakes'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //oceans\n $this->shapes['oceans'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_ocean\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //conservation\n $this->shapes['conservation'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //ecoregions\n $this->shapes['ecoregions'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //base map\n $this->shapes['base'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_land\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //base map\n $this->shapes['countries'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //stateprovinces_polygon\n $this->shapes['stateprovinces_polygon'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 5\n );\n\n //stateprovinces\n $this->shapes['stateprovinces'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces_lines_shp\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 6\n );\n\n //lake names\n $this->shapes['lakenames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 7\n );\n\n //rivers\n $this->shapes['rivers'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 8\n );\n\n //rivers\n $this->shapes['rivernames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 9\n );\n\n //placename\n $this->shapes['placenames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_populated_places_simple\",\n 'type' => MS_LAYER_POINT,\n 'encoding' => \"CP1252\",\n 'sort' => 10\n );\n\n //State/Provincial labels\n $this->shapes['stateprovnames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 11\n );\n\n //Country labels\n $this->shapes['countrynames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 12\n );\n\n //physicalLabels\n $this->shapes['physicalLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_regions_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 13\n );\n\n //marineLabels\n $this->shapes['marineLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_marine_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n //hotspotLabels\n $this->shapes['hotspotLabels'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 14\n );\n\n //ecoregions\n $this->shapes['ecoregionLabels'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n }", "function setShape($a_shape)\n\t{\n\t\t$this->shape = $a_shape;\n\t}", "function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "protected function putShapeSaveAsRequest(Requests\\PutShapeSaveAsRequest $request)\n {\n // verify the required parameter 'name' is set\n if ($request->name === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $name when calling putShapeSaveAs');\n }\n // verify the required parameter 'slide_index' is set\n if ($request->slideIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $slideIndex when calling putShapeSaveAs');\n }\n // verify the required parameter 'shape_index' is set\n if ($request->shapeIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $shapeIndex when calling putShapeSaveAs');\n }\n // verify the required parameter 'format' is set\n if ($request->format === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $format when calling putShapeSaveAs');\n }\n // verify the required parameter 'out_path' is set\n if ($request->outPath === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $outPath when calling putShapeSaveAs');\n }\n\n $resourcePath = '/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/{format}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->outPath !== null) {\n $queryParams['outPath'] = ObjectSerializer::toQueryValue($request->outPath);\n }\n // query params\n if ($request->password !== null) {\n $queryParams['password'] = ObjectSerializer::toQueryValue($request->password);\n }\n // query params\n if ($request->folder !== null) {\n $queryParams['folder'] = ObjectSerializer::toQueryValue($request->folder);\n }\n // query params\n if ($request->storage !== null) {\n $queryParams['storage'] = ObjectSerializer::toQueryValue($request->storage);\n }\n // query params\n if ($request->scaleX !== null) {\n $queryParams['scaleX'] = ObjectSerializer::toQueryValue($request->scaleX);\n }\n // query params\n if ($request->scaleY !== null) {\n $queryParams['scaleY'] = ObjectSerializer::toQueryValue($request->scaleY);\n }\n // query params\n if ($request->bounds !== null) {\n $queryParams['bounds'] = ObjectSerializer::toQueryValue($request->bounds);\n }\n // query params\n if ($request->fontsFolder !== null) {\n $queryParams['fontsFolder'] = ObjectSerializer::toQueryValue($request->fontsFolder);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"name\", $request->name);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"slideIndex\", $request->slideIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"shapeIndex\", $request->shapeIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"format\", $request->format);\n $_tempBody = null;\n if (isset($request->options)) {\n $_tempBody = $request->options;\n }\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n }\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'PUT');\n }", "function shape ($arguments) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tshape');\n return $rc->newInstanceArgs( $arguments ); \n}" ]
[ "0.79937947", "0.7910503", "0.7199178", "0.54232407", "0.53021747", "0.52538997", "0.524662", "0.524563", "0.5201062", "0.51787317", "0.5097516", "0.50781894", "0.49629986", "0.49041805", "0.4883963", "0.4859108", "0.47867602", "0.47453308", "0.47278345", "0.46720484", "0.4640629", "0.4639516", "0.4616799", "0.46115294", "0.4590891", "0.45456442", "0.45159426", "0.4508997", "0.45008335", "0.44896758" ]
0.82253385
0
string packDefineBitsJPEG3Tag(integer BitmapID, string BitmapJPEGEncoding, string BitmapJPEGImage, string BitmapAlphaData) return an SWF DefineBitsJPEG3 tag string. TagID: 35
function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData) { array_push($this->FMDebug, "packDefineBitsJPEG3Tag"); $TagID = 35; $BitmapID = $this->packUI16($BitmapID); $Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage)); $TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packJPEGTablesTag($BitmapJPEGEncoding)\n\t{\n\t\tarray_push($this->FMDebug, \"packJPEGTablesTag\");\n\n\t\t$TagID = 8;\n\t\t$TagLength = strlen($BitmapJPEGEncoding);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapJPEGEncoding;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function _encode_v1() {\n if ($this->debug) print($this->debugbeg . \"_encode_v1()<HR>\\n\");\n\n if ($this->track) {\n // ID3 v1.1\n $id3pack = 'a3a30a30a30a4a28x1C1C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->track,\n $this->genreno\n );\n } else {\n // ID3 v1\n $id3pack = 'a3a30a30a30a4a30C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->genreno\n );\n }\n\n if ($this->debug) {\n print('id3pack: ' . $id3pack . \"\\n\");\n $unp = unpack('H*new', $newtag);\n print_r($unp);\n }\n\n if ($this->debug) print($this->debugend);\n return $newtag;\n }", "function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}", "function imageBmp($img, $file, $RLE=0)\r\n\t{\r\n\t\t$ColorCount = imagecolorstotal($img);\r\n\t\t$Transparent = imagecolortransparent($img);\r\n\t\t$IsTransparent = $Transparent != -1;\r\n\t\tif($IsTransparent)\r\n\t\t\t$ColorCount--;\r\n\t\tif($ColorCount == 0)\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 24;\r\n\t\t}\r\n\t\tif(($ColorCount > 0) && ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\t$ColorCount = 2;\r\n\t\t\t$BitCount = 1;\r\n\t\t}\r\n\t\tif(($ColorCount > 2) && ($ColorCount <= 16))\r\n\t\t{\r\n\t\t\t$ColorCount = 16;\r\n\t\t\t$BitCount = 4;\r\n\t\t}\r\n\t\tif(($ColorCount > 16) && ($ColorCount <= 256))\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 8;\r\n\t\t}\r\n\t\t$Width = imageSX($img);\r\n\t\t$Height = imageSY($img);\r\n\t\t$Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4;\r\n\t\tif($BitCount < 24)\r\n\t\t\t$palsize = pow(2, $BitCount) * 4;\r\n\t\t$size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54;\r\n\t\t$size += $palsize;\r\n\t\t$offset = 54 + $palsize;\r\n\t\t// Bitmap File Header\r\n\t\t$ret = 'BM';\r\n\t\t$ret .= $this->int_to_dword($size);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword($offset);\r\n\t\t// Bitmap Info Header\r\n\t\t$ret .= $this->int_to_dword(40);\r\n\t\t$ret .= $this->int_to_dword($Width);\r\n\t\t$ret .= $this->int_to_dword($Height);\r\n\t\t$ret .= $this->int_to_word(1);\r\n\t\t$ret .= $this->int_to_word($BitCount);\r\n\t\t$ret .= $this->int_to_dword($RLE);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t// image data\r\n\t\t$CC = $ColorCount;\r\n\t\t$sl1 = strlen($ret);\r\n\t\tif($CC == 0)\r\n\t\t\t$CC = 256;\r\n\t\tif($BitCount < 24)\r\n\t\t{\r\n\t\t\t$ColorTotal = imagecolorstotal($img);\r\n\t\t\tif($IsTransparent)\r\n\t\t\t\t$ColorTotal--;\r\n\t\t\tfor($p = 0; $p < $ColorTotal; $p++)\r\n\t\t\t{\r\n\t\t\t\t$color = imagecolorsforindex($img, $p);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"blue\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"green\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"red\"]);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t\t$CT = $ColorTotal;\r\n\t\t\tfor($p = $ColorTotal; $p < $CC; $p++)\r\n\t\t\t{\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($BitCount <= 8)\r\n\t\t{\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\t$bWrite = \"\";\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorat($img, $x, $y);\r\n\t\t\t\t\t$bWrite .= $this->decbinx($color, $BitCount);\r\n\t\t\t\t\tif(strlen($bWrite) == 8)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t\t\t$bWrite = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((strlen($bWrite) < 8) and (strlen($bWrite) != 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sl = strlen($bWrite);\r\n\t\t\t\t\tfor($t = 0; $t < 8 - $sl; $t++)\r\n\t\t\t\t\t\t$sl .= \"0\";\r\n\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t}\r\n\t\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t\t$retd .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(($RLE == 1) and ($BitCount == 8))\r\n\t\t{\r\n\t\t\tfor($t = 0; $t < strlen($retd); $t += 4)\r\n\t\t\t{\r\n\t\t\t\tif($t != 0)\r\n\t\t\t\t\tif(($t) % $Width == 0)\r\n\t\t\t\t\t\t$ret .= chr(0).chr(0);\r\n\r\n\t\t\t\tif(($t + 5) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0);\r\n\t\t\t\t\t$t += 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(($t + 6) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(6).substr($retd, $t, 6);\r\n\t\t\t\t\t$t += 2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$ret .= chr(0).chr(4).substr($retd, $t, 4);\r\n\t\t\t}\r\n\t\t\t$ret .= chr(0).chr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$ret .= $retd;\r\n\t\tif($BitCount == 24)\r\n\t\t{\r\n\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t$Dopl .= chr(0);\r\n\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorsforindex($img, ImageColorAt($img, $x, $y));\r\n\t\t\t\t\t$ret .= chr($color[\"blue\"]).chr($color[\"green\"]).chr($color[\"red\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$ret .= $Dopl;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(fwrite(fopen($file, \"wb\"), $ret))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "function ImageCreateFromBMP($filename)\n{\n //Ouverture du fichier en mode binaire\n if (! $f1 = fopen($filename,\"rb\")) return FALSE;\n\n //1 : Chargement des ent�tes FICHIER\n $FILE = unpack(\"vfile_type/Vfile_size/Vreserved/Vbitmap_offset\", fread($f1,14));\n if ($FILE['file_type'] != 19778) return FALSE;\n\n //2 : Chargement des ent�tes BM\n $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.\n '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.\n '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));\n $BMP['colors'] = pow(2,$BMP['bits_per_pixel']);\n if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset'];\n $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8;\n $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']);\n $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] = 4-(4*$BMP['decal']);\n if ($BMP['decal'] == 4) $BMP['decal'] = 0;\n\n //3 : Chargement des couleurs de la palette\n $PALETTE = array();\n if ($BMP['colors'] < 16777216)\n {\n $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4));\n }\n\n //4 : Cr�ation de l'image\n $IMG = fread($f1,$BMP['size_bitmap']);\n $VIDE = chr(0);\n\n $res = imagecreatetruecolor($BMP['width'],$BMP['height']);\n $P = 0;\n $Y = $BMP['height']-1;\n while ($Y >= 0)\n {\n $X=0;\n while ($X < $BMP['width'])\n {\n if ($BMP['bits_per_pixel'] == 24)\n $COLOR = unpack(\"V\",substr($IMG,$P,3).$VIDE);\n elseif ($BMP['bits_per_pixel'] == 16)\n {\n $COLOR = unpack(\"n\",substr($IMG,$P,2));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 8)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,$P,1));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 4)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 1)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7;\n elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6;\n elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5;\n elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4;\n elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3;\n elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2;\n elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1;\n elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n else\n return FALSE;\n imagesetpixel($res,$X,$Y,$COLOR[1]);\n $X++;\n $P += $BMP['bytes_per_pixel'];\n }\n $Y--;\n $P+=$BMP['decal'];\n }\n\n //Fermeture du fichier\n fclose($f1);\n\n return $res;\n}", "function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }", "function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function getImageTag();", "function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public static function png32()\n {\n return new FlagQualifier(self::PNG32);\n }", "function metadata_image($metadata_conf) \r\n {\r\n if(is_array($metadata_conf) && count($metadata_conf)>0)\r\n {\r\n include_once 'metadata/Toolkit_Version.php';\r\n error_reporting(0);\r\n include_once 'metadata/JPEG.php';\r\n include_once 'metadata/XMP.php';\r\n include_once 'metadata/Photoshop_IRB.php';\r\n include_once 'metadata/EXIF.php';\r\n include_once 'metadata/Photoshop_File_Info.php';\r\n \r\n \r\n // Copy all of the HTML Posted variables into an array\r\n //$new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS'];\r\n $new_ps_file_info_array = $metadata_conf;\r\n \r\n $filename = $new_ps_file_info_array['filename'];\r\n //echo $filename;\r\n // Protect against hackers editing other files\r\n \r\n $path_parts = pathinfo($filename);\r\n $array_extention = array('png', 'jpg');\r\n if (strcasecmp($path_parts[\"extension\"], \"jpg\") != 0) {\r\n //if (!in_array($path_parts[\"extension\"], $array_extention)) \r\n #echo \"Incorrect File Type - JPEG Only\\n\";\r\n return array('status' => 'failed', 'message' => 'Incorrect File Type - JPEG Only');\r\n exit();\r\n }\r\n // Change: removed limitation on file being in current directory - as of version 1.11\r\n // Retrieve the header information\r\n $jpeg_header_data = get_jpeg_header_data($filename);\r\n \r\n // Retreive the EXIF, XMP and Photoshop IRB information from\r\n // the existing file, so that it can be updated\r\n $Exif_array = get_EXIF_JPEG($filename);\r\n $XMP_array = read_XMP_array_from_text(get_XMP_text($jpeg_header_data));\r\n $IRB_array = get_Photoshop_IRB($jpeg_header_data);\r\n \r\n // Update the JPEG header information with the new Photoshop File Info\r\n $jpeg_header_data = put_photoshop_file_info($jpeg_header_data, $new_ps_file_info_array, $Exif_array, $XMP_array, $IRB_array);\r\n \r\n // Check if the Update worked\r\n if ($jpeg_header_data == FALSE) {\r\n //echo '$jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure update Photoshop File Info : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n \r\n // Attempt to write the new JPEG file\r\n if (FALSE == put_jpeg_header_data($filename, $filename, $jpeg_header_data)) {\r\n //echo 'put_jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure to write new JPEG : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n return array('status' => 'succes', 'message' => $filename . ' updated');\r\n }\r\n }", "function encode_advanced_rle(string $path_to_encode, string $result_path) {\n // check if the picture exist\n if (!file_exists($path_to_encode)) return 1;\n $codemotif = \"\";\n $hexa = bin2hex(file_get_contents($path_to_encode));\n $taille = strlen($hexa);\n\n // set a space all the two carracters. I'm gonna call it a motif\n for ($i = 1; $i < $taille; $i += 2)\n $codemotif = $codemotif.$hexa[$i-1].$hexa[$i].' ';\n \n $taille2 = strlen($codemotif);\n $compress = \"\";\n\n $i = 2;\n while ($i <= $taille2 - 3) {\n // compare the motifs two by two, and since they are equal, concatenate them.\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n $count = 0;\n if ($pack == $pack2) {\n $count++;\n do {\n $count++;\n $i += 3;\n if ($i+1 >= $taille2) break;\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n } while ($pack == $pack2);\n $compress .= $count.' '.$pack;\n $i += 3;\n if ($i+1 >= $taille2) break;\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n $count = 0;\n }\n // compare the motifs two by two, and since they are differents.\n if ($pack != $pack2) {\n $j = $i;\n do {\n $count++;\n $i += 3; \n if ($i + 1 >= $taille2) {\n $count++;\n $i += 3;\n break;\n }\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n } while ($pack != $pack2);\n $compress .= '00 '.$count.' ';\n // add the last motif if they are an odd number\n while ($j < $i) {\n $pack = $codemotif[$j-2].$codemotif[$j-1].' ';\n $compress = $compress.$pack;\n $j += 3;\n }\n }\n }\n\n // make a save \n if (file_exists($result_path)) unlink($result_path);\n file_put_contents($result_path, $compress);\n return 0;\n}", "function _add_image_data( $im ) {\n\t\t$width = imagesx( $im );\n\t\t$height = imagesy( $im );\n\t\t\n\t\t\n\t\t$pixel_data = array();\n\t\t\n\t\t$opacity_data = array();\n\t\t$current_opacity_val = 0;\n\t\t\n\t\tfor ( $y = $height - 1; $y >= 0; $y-- ) {\n\t\t\tfor ( $x = 0; $x < $width; $x++ ) {\n\t\t\t\t$color = imagecolorat( $im, $x, $y );\n\t\t\t\t\n\t\t\t\t$alpha = ( $color & 0x7F000000 ) >> 24;\n\t\t\t\t$alpha = ( 1 - ( $alpha / 127 ) ) * 255;\n\t\t\t\t\n\t\t\t\t$color &= 0xFFFFFF;\n\t\t\t\t$color |= 0xFF000000 & ( $alpha << 24 );\n\t\t\t\t\n\t\t\t\t$pixel_data[] = $color;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$opacity = ( $alpha <= 127 ) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t$current_opacity_val = ( $current_opacity_val << 1 ) | $opacity;\n\t\t\t\t\n\t\t\t\tif ( ( ( $x + 1 ) % 32 ) == 0 ) {\n\t\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t\t$current_opacity_val = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ( $x % 32 ) > 0 ) {\n\t\t\t\twhile ( ( $x++ % 32 ) > 0 )\n\t\t\t\t\t$current_opacity_val = $current_opacity_val << 1;\n\t\t\t\t\n\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t$current_opacity_val = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$image_header_size = 40;\n\t\t$color_mask_size = $width * $height * 4;\n\t\t$opacity_mask_size = ( ceil( $width / 32 ) * 4 ) * $height;\n\t\t\n\t\t\n\t\t$data = pack( 'VVVvvVVVVVV', 40, $width, ( $height * 2 ), 1, 32, 0, 0, 0, 0, 0, 0 );\n\t\t\n\t\tforeach ( $pixel_data as $color )\n\t\t\t$data .= pack( 'V', $color );\n\t\t\n\t\tforeach ( $opacity_data as $opacity )\n\t\t\t$data .= pack( 'N', $opacity );\n\t\t\n\t\t\n\t\t$image = array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'color_palette_colors' => 0,\n\t\t\t'bits_per_pixel' => 32,\n\t\t\t'size' => $image_header_size + $color_mask_size + $opacity_mask_size,\n\t\t\t'data' => $data,\n\t\t);\n\t\t\n\t\t$this->_images[] = $image;\n\t}", "function parseJPEGfile($filename)\n\t{\n\t\tarray_push($this->FMDebug, \"parseJPEGfile\");\n\n\t\t$SOI = chr(0xff) . chr(0xd8);\n\t\t$APP0 = chr(0xff) . chr(0xe0);\n\t\t$DQT = chr(0xff) . chr(0xdb);\n\t\t$SOF0 = chr(0xff) . chr(0xc0);\n\t\t$SOF1 = chr(0xff) . chr(0xc1);\n\t\t$SOF2 = chr(0xff) . chr(0xc2);\n\t\t$DHT = chr(0xff) . chr(0xc4);\n\t\t$DRI = chr(0xff) . chr(0xdd);\n\t\t$SOS = chr(0xff) . chr(0xda);\n\t\t$EOI = chr(0xff) . chr(0xd9);\n\t\t$COM = chr(0xff) . chr(0xfe);\n\n\t\t$filearray = array(\"JPEGEncoding\" => \"\", \"JPEGImage\" => \"\");\n\n\t\t$filehandle = fopen($filename, \"r\");\n\n\t\tif ($filehandle == FALSE) {\n\t\t\t$this->FMError(\"parseJPEGfile cannot open file\");\n\t\t}\n\n\t\t$jpeg = fread($filehandle, filesize($filename));\n\n\t\tfclose($filehandle);\n\n\t\t$marker = strpos($jpeg, $SOI);\n\n\t\t$jpeg = substr($jpeg, $marker);\n\n\t\t$loop = True;\n\n\t\twhile ($loop == True) {\n\n\t\t\tif (strlen($jpeg) == 0) {\n\t\t\t\t$loop = False;\n\t\t\t}\n\n\t\t\tswitch (substr($jpeg, 0, 2)) {\n\n\t\t\t\tcase $SOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] = $SOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] = $SOI;\n\t\t\t\t\t$jpeg = substr($jpeg, 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $APP0:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DQT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $SOF0:\n\t\t\t\tcase $SOF1:\n\t\t\t\tcase $SOF2:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$filearray[\"width\"] = ord(substr($jpeg, 7, 1)) * 256 + ord(substr($jpeg, 8, 1));\t\n\t\t\t\t\t$filearray[\"height\"] = ord(substr($jpeg, 5, 1)) * 256 + ord(substr($jpeg, 6, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DHT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DRI:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $COM:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $EOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= $EOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= $EOI;\n\t\t\t\t\t$loop = False;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif (substr($jpeg, 0, 2) == $SOS) {\n\n\t\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t$foundsos = True;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ($foundsos) {\n\t\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, 1);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, 1);\n\t\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$this->FMError(\"parseJPEGfile error parsing JPEG file file\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $filearray;\n\t}", "public function encode(/*$newwidth, $newheight*/)\n {\n $newwidth = $this->currImgWidth;//$this->imgWidth;\n $newheight = $this->currImgHeight;//$this->imgHeight;\n if (!$this->outFile) {\n $this->outFile = $this->srcFile;\n }\n $mystring = '';\n $this->pointer = 0;\n $this->imagedata = array();\n $this->imageinfo = array();\n $this->handle = 0;\n $this->index = 0;\n\n $k = 0;\n foreach ($this->parsedfiles as $imagepart) {\n $this->loadfile($imagepart);\n $this->get_gif_header();\n $this->get_application_data();\n $this->get_comment_data();\n $this->get_graphics_extension(0);\n $this->get_image_block(0);\n\n //get transparent color index and color\n if (isset($this->encdata[$this->index - 1])) {\n $gxdata = $this->encdata[$this->index - 1]['graphicsextension'];\n } else {\n $gxdata = null;\n }\n $ghdata = $this->imageinfo['gifheader'];\n $trcolor = '';\n $hastransparency = $gxdata[3];\n\n if ($hastransparency) {\n $trcx = ord($gxdata[6]);\n $trcolor = substr($ghdata, 13 + $trcx * 3, 3);\n }\n\n //global color table to image data;\n $this->transfercolortable($this->imageinfo['gifheader'], $this->imagedata[$this->index - 1]['imagedata']);\n\n $imageblock = &$this->imagedata[$this->index - 1]['imagedata'];\n\n //if transparency exists transfer transparency index\n if ($hastransparency) {\n $haslocalcolortable = ((ord($imageblock[9]) & 128) === 128);\n if ($haslocalcolortable) {\n //local table exists. determine boundaries and look for it.\n $tablesize = (pow(2, (ord($imageblock[9]) & 7) + 1) * 3) + 10;\n $this->orgvars[$this->index - 1]['transparent_color_index'] =\n ((strrpos(substr($this->imagedata[$this->index - 1]['imagedata'], 0, $tablesize), $trcolor) - 10) / 3);\n } else {\n //local table doesnt exist, look at the global one.\n $tablesize = (pow(2, (ord($gxdata[10]) & 7) + 1) * 3) + 10;\n $this->orgvars[$this->index - 1]['transparent_color_index'] =\n ((strrpos(substr($ghdata, 0, $tablesize), $trcolor) - 10) / 3);\n }\n }\n\n //apply original delay time,transparent index and disposal values to graphics extension\n\n if (!$this->imagedata[$this->index - 1]['graphicsextension']) {\n $this->imagedata[$this->index - 1]['graphicsextension'] = chr(0x21).chr(0xf9).chr(0x04).chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x00);\n }\n\n $imagedata = &$this->imagedata[$this->index - 1]['graphicsextension'];\n\n $imagedata[3] = chr((ord($imagedata[3]) & 0xE3) | ($this->orgvars[$this->index - 1]['disposal_method'] << 2));\n $imagedata[4] = chr($this->orgvars[$this->index - 1]['delay_time'] % 256);\n $imagedata[5] = chr(floor($this->orgvars[$this->index - 1]['delay_time'] / 256));\n if ($hastransparency) {\n $imagedata[6] = chr($this->orgvars[$this->index - 1]['transparent_color_index']);\n }\n $imagedata[3] = chr(ord($imagedata[3]) | $hastransparency);\n\n //apply calculated left and top offset\n $imageblock[1] = chr(round(($this->orgvars[$this->index - 1]['offset_left'] * $this->wr) % 256));\n $imageblock[2] = chr(floor(($this->orgvars[$this->index - 1]['offset_left'] * $this->wr) / 256));\n $imageblock[3] = chr(round(($this->orgvars[$this->index - 1]['offset_top'] * $this->hr) % 256));\n $imageblock[4] = chr(floor(($this->orgvars[$this->index - 1]['offset_top'] * $this->hr) / 256));\n\n if ($this->index === 1) {\n if (!isset($this->imageinfo['applicationdata']) || !$this->imageinfo['applicationdata']) {\n $this->imageinfo['applicationdata'] = chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0'.chr(0x03).chr(0x01).chr(0x00).chr(0x00).chr(0x00);\n }\n\n if (!isset($this->imageinfo['commentdata']) || !$this->imageinfo['commentdata']) {\n //$this->imageinfo[\"commentdata\"] = chr(0x21).chr(0xfe).chr(0x10).\"PHPGIFRESIZER1.0\".chr(0);\n $this->imageinfo['commentdata'] = chr(0x21).chr(0xfe).chr(0x10).'MONTENIGGER_____'.chr(0);\n }\n $mystring .= $this->orgvars['gifheader'].$this->imageinfo['applicationdata'].$this->imageinfo['commentdata'];\n if (isset($this->orgvars['hasgx_type_0']) && $this->orgvars['hasgx_type_0']) {\n $mystring .= $this->globaldata['graphicsextension_0'];\n }\n if (isset($this->orgvars['hasgx_type_1']) && $this->orgvars['hasgx_type_1']) {\n $mystring .= $this->globaldata['graphicsextension'];\n }\n }\n\n $mystring .= $imagedata.$imageblock;\n $k++;\n $this->closefile();\n }\n\n $mystring .= chr(0x3b);\n\n //applying new width & height to gif header\n $mystring[6] = chr($newwidth % 256);\n $mystring[7] = chr(floor($newwidth / 256));\n $mystring[8] = chr($newheight % 256);\n $mystring[9] = chr(floor($newheight / 256));\n $mystring[11] = $this->orgvars['background_color'];\n\n if (!file_put_contents($this->outFile, $mystring)) {\n throw new ImageException('outfile write failed');\n }\n }", "function watermark( $img, $cpr, $font, $font_size, $rgbtext, $rgbtsdw, $hotspot, $txp, $typ, $sxp, $syp )\n\t{\n\t\tstrtolower( substr( $img, strlen( $img ) - 4, 4 ) ) == \"jpeg\" ? $suffx = \"jpeg\" : $suffx = strtolower( substr( $img, strlen( $img ) - 3, 3 ) );\n\t\tswitch( $suffx )\n\t\t{\n\t\t\tcase \"jpg\":\n\t\t\t\t$image = imageCreateFromJpeg( $img );\n\t\t\t\tbreak;\n\t\t\tcase \"jpeg\":\n\t\t\t\t$image = imageCreateFromJpeg( $img );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"gif\":\n\t\t\t\t$image = imageCreateFromGif( $img );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"png\":\n\t\t\t\t$image = imageCreateFromPng( $img );\n\t\t\t\tbreak;\n\t\t}\n \tif( $hotspot != 0 )\n \t{\n \t\t$ix = imagesx( $image );\n \t\t$iy = imagesy( $image );\n \t\t$tsw = strlen( $text ) * $font_size / imagefontwidth( $font ) * 3;\n \t\t$tsh = $font_size / imagefontheight( $font );\n \t\tswitch ( $hotspot )\n \t\t{\n \t\tcase 1:\n \t\t\t$txp = $txp; $typ = $tsh * $tsh + imagefontheight( $font ) * 2 + $typ;\n \t\t\tbreak;\n \t\tcase 2:\n \t\t\t$txp = floor( ( $ix - $tsw ) / 2 ); $typ = $tsh * $tsh + imagefontheight( $font ) * 2 + $typ;\n \t\t\tbreak;\n \t\tcase 3:\n \t\t\t$txp = $ix - $tsw - $txp; $typ = $tsh * $tsh + imagefontheight( $font ) * 2 + $typ;\n \t\t\tbreak;\n \t\tcase 4:\n \t\t\t$txp = $txp; $typ = floor( ( $iy - $tsh ) / 2 );\n \t\t\tbreak;\n \t\tcase 5:\n \t\t\t$txp = floor( ( $ix - $tsw ) / 2 ); $typ = floor( ( $iy - $tsh ) / 2 );\n \t\t\tbreak;\n \t\tcase 6:\n \t\t\t$txp = $ix - $tsw - $txp; $typ = floor( ( $iy - $tsh ) / 2 );\n \t\t\tbreak;\n \t\tcase 7:\n \t\t\t$txp = $txp; $typ = $iy - $tsh - $typ;\n \t\t\tbreak;\n \t\tcase 8:\n \t\t\t$txp = floor( ( $ix - $tsw ) / 2 ); $typ = $iy - $tsh - $typ;\n \t\t\tbreak;\n \t\tcase 9:\n \t\t\t$txp = $ix - $tsw - $txp; $typ = $iy - $tsh - $typ;\n \t\t\tbreak;\n \t\t}\n \t}\n \t\tImageTTFText( $image, $font_size, 0, $txp + $sxp, $typ + $syp, imagecolorallocate( $image, HexDec( $rgbtsdw ) & 0xff, ( HexDec( $rgbtsdw ) >> 8 ) & 0xff, ( HexDec( $rgbtsdw ) >> 16 ) & 0xff ), $font, $cpr );\n \t\tImageTTFText( $image, $font_size, 0, $txp, $typ, imagecolorallocate( $image, HexDec( $rgbtext ) & 0xff, ( HexDec( $rgbtext ) >> 8 ) & 0xff, ( HexDec( $rgbtext ) >> 16 ) & 0xff ), $font, $cpr );\n\t\tswitch( $suffx )\n\t\t{\n\t\t\tcase \"jpg\":\n \t\t\t\theader( \"Content-type: image/jpg\" );\n \t\t\t\timageJpeg( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t\tcase \"jpeg\":\n \t\t\t\theader( \"Content-type: image/jpg\" );\n \t\t\t\timageJpeg( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"gif\":\n \t\t\t\theader( \"Content-type: image/gif\" );\n \t\t\t\timageGif( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"png\":\n \t\t\t\theader( \"Content-type: image/png\" );\n \t\t\t\timagePng( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t}\n\t}", "function wm_write_metadata($image_id)\n{\n global $conf, $logger;\n \n $query = '\nSELECT\n img.name,\n img.comment,\n img.author,\n img.date_creation,\n GROUP_CONCAT(tags.name) AS tags,\n img.path,\n img.representative_ext\n FROM '.IMAGES_TABLE.' AS img\n LEFT OUTER JOIN '.IMAGE_TAG_TABLE.' AS img_tag ON img_tag.image_id = img.id\n LEFT OUTER JOIN '.TAGS_TABLE.' AS tags ON tags.id = img_tag.tag_id\n WHERE img.id = '.$image_id.'\n GROUP BY img.id, img.name, img.comment, img.author, img.path, img.representative_ext\n;';\n $result = pwg_query($query);\n $row = pwg_db_fetch_assoc($result);\n\n $name = wm_prepare_string($row['name'], 256);\n $description = wm_prepare_string($row['comment'], 2000);\n $author = wm_prepare_string($row['author'], 32);\n\n $command = isset($conf['exiftool_path']) ? $conf['exiftool_path'] : 'exiftool';\n $command.= ' -q';\n\n if (strlen($name) > 0)\n {\n # 2#105 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Headline=\"'.$name.'\"';\n\n # 2#005 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:ObjectName=\"'.wm_cutString($name, 64).'\"';\n }\n\n if (strlen($description) > 0)\n {\n # 2#120 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Caption-Abstract=\"'.$description.'\"';\n }\n\n if (strlen($author) > 0)\n {\n # 2#080 in iptcparse($imginfo['APP13'])\n $iptc_field = 'By-line';\n\n if (\n $conf['use_iptc']\n and isset($conf['use_iptc_mapping']['author'])\n and '2#122' == $conf['use_iptc_mapping']['author']\n )\n {\n # 2#122 in iptcparse($imginfo['APP13'])\n $iptc_field = 'Writer-Editor';\n }\n\n $command.= ' -IPTC:'.$iptc_field.'=\"'.$author.'\"';\n }\n \n if (strlen($row['tags']) > 0)\n {\n $tags = explode(',', $row['tags']);\n foreach ($tags as $tag)\n {\n $tag = wm_prepare_string($tag, 64);\n\n # 2#025 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Keywords=\"'.$tag.'\"';\n }\n }\n\n $command.= ' \"'.$row['path'].'\"';\n $command.= ' 2>&1';\n // echo $command;\n $logger->info(__FUNCTION__.' command = '.$command);\n\n $exec_return = exec($command, $output, $rc);\n // echo '$exec_return = '.$exec_return.'<br>';\n // echo '<pre>'; print_r($output); echo '</pre>';\n\n // as derivatives may contain metadata, they must be reset\n delete_element_derivatives($row);\n\n return array($rc, $output);\n}", "function packStartSoundTag($CharacterID, $SOUNDINFO)\n\t{\n\t\tarray_push($this->FMDebug, \"packStartSoundTag\");\n\n\t\t$TagID = 15;\n\n\t\t$StartSoundTag = $this->packUI16($CharacterID) . $SOUNDINFO;\n\n\t\t$TagLength = strlen($StartSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $StartSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "function template_bits_bit_row_image( $id, $image ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<img id='img-item-{$id}' src='{$this->ipsclass->skin_acp_url}/images/{$image}' border='0' alt='' />\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function fgallery_shortcode_handler($atts, $content = null){\n // set default params if not present\n extract(shortcode_atts( array(\n 'id' => 0,\n 'w' => 450,\n 'h' => 385,\n 'bg' => 'ffffff',\n 't' => 0,\t\n 'align' => '',\n 'thumb' => '',\n 'title' => '',\n 'margin' => '0px',\n 'ex' => 1,\n 'conf' => 0,\n ), $atts ));\n // choose insertion type\n if ($t < 0 || $t > 2) {\n $t = 0;\n }\n if (!is_numeric($ex) || $ex > 2 || $ex < 0 )\n $ex = 1;\n // check if the gallery exist\n if ($id > 0) {\n $album = fgallery_get_album($id);\n if (empty($album)) {\n return '[fgallery 404 Not found]';\n }\n } else {\n return '[fgallery 404 Not found]';\n }\n // different output for different insert type\n switch ($t) {\n case '0' : \n $rand = uniqid();\n $path = fgallery_search_flash_path($album);\n // if gallery should be aligned\n if (isset($align)) {\n switch ($align) {\n case 'left' : case 'right' :\n $align_text = 'float:'.$align;\n break;\n case 'center' :\n $margin = $margin.' auto';\n default:\n $align_text = '';\n break;\n }\n }\n if (!$conf){\n $flashcontent = 'flashcontent_'.$id.$rand;\n } else {\n $flashcontent = 'flashcontent';\n }\n $gallery_snippet = '<div style=\"width:'.$w.'px;margin:'.$margin.';'.$align_text.'\" class=\"fgallery_'.$id.'\">\n <script type=\"text/javascript\">\n if (swfobject.getFlashPlayerVersion().release) {\n var flashvars = {settings: \"'.fgallery_get_config_url($id).'\",';\n if ($album['gall_type'] == 13){\n $gallery_snippet .= 'publications: \"'.fgallery_get_publ_url($id).'\",';\n // $gallery_snippet .= 'style: \"http://localhost/wp/wp-content/plugins/1-flash-gallery/swf/style.css\",';\n }\n $gallery_snippet .= 'images : \"'.fgallery_get_images_url($id).'\"};\n var params = {bgcolor: \"#'.$bg.'\", allowFullScreen: \"true\", wmode: \"transparent\"};\n swfobject.embedSWF(\"'.$path.'\", \"'.$flashcontent.'\", \"'.$w.'\", \"'.$h.'\", \"10.0.0\",false, flashvars, params);\n } else {\n jQuery(document).ready(function(){\n jQuery(\"#myGallery_'.$id.$rand.'\").photoGallery({gall_id : \"'.$id.'\"});\n });\n }\n </script>\n <div id=\"'.$flashcontent.'\">\n <div id=\"myGallery_'.$id.$rand.'\" class=\"configurator\" style=\"height:'.$h.'px ;width: '.$w.';\"></div>\n </div>';\n $gallery_snippet .= '<div class=\"flash_text\"><p class=\"image_text\"></p></div>';\n if (get_option('1_flash_gallery_'.fgallery_get_flash_type($album)) == '') {\n $gallery_snippet .= '<div class=\"fgallery_message\">'.fgallery_slideshow($album).'</div>';\n }\n break;\n case '1' : \n if ($title == '') {\n $insert_text = $album['gall_name'];\n } else {\n $insert_text = $title;\n }\n $gallery_snippet = '<a href=\"'.fgallery_view_gallery_url($id, $w, $h, $bg).'\"\n class=\"thickbox\" title=\"'.$album['gall_name'].'\">'.$insert_text.'</a>';\n if ($ex == 1) \n $gallery_snippet .= '<p>'.fgallery_get_album_attributes($album, false).'</p>';\n break;\n case '2' :\n $gallery_snippet = '<a href=\"'.fgallery_view_gallery_url($id, $w, $h, $bg).'\"\n class=\"thickbox\" title=\"'.$album['gall_name'].'\">'.fgallery_get_album_cover($album, $thumb).'</a>';\n switch ($ex) {\n case 0:\n $gallery_snippet .= '';\n break;\n case 1:\n $gallery_snippet .= '<p>'.$album['gall_name'].'</p><p>'.fgallery_get_album_attributes($album, false).'</p>';\n break;\n case 2: \n $gallery_snippet .= '<p>'.$album['gall_name'].'</p>';\n break;\n default:\n $gallery_snippet .= '<p>'.$album['gall_name'].'</p><p>'.fgallery_get_album_attributes($album, false).'</p>';\n break;\n } \n \n break;\n }\n\n return $gallery_snippet;\n}", "function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function define_image_vars ( ) {\r\n\t\t/*\r\n\t\t * Changlog\r\n\t\t * v1.1, November 11, 2009\r\n\t\t * - Cleaned\r\n\t\t */\r\n\t\tglobal $IMAGE_TYPE_EXTS, $IMAGE_TYPE_EXT, $IMAGE_TYPE_READFUNCTION, $IMAGE_TYPE_WRITEFUNCTION, $IMAGE_CODE_TYPE, $IMAGE_SUPPORTED_READ_TYPES, $IMAGE_SUPPORTED_READ_EXTENSIONS, $IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS, $IMAGE_SUPPORTED_WRITE_TYPES, $IMAGE_SUPPORTED_WRITE_EXTENSIONS, $IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS, $IMAGE_SUPPORTED_TYPES, $IMAGE_SUPPORTED_EXTENSIONS, $IMAGE_SUPPORTED_TYPES_EXTENSIONS;\r\n\t\tif ( isset($IMAGE_TYPE_EXTS) )\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t$IMAGE_TYPE_EXTS = array(IMAGETYPE_GIF => array('gif'), IMAGETYPE_JPEG => array('jpeg', 'jpg', 'jpe'), IMAGETYPE_JPEG2000 => array('jpeg', 'jpg', 'jpe'), IMAGETYPE_PNG => array('png'), IMAGETYPE_PSD => array('psd'), IMAGETYPE_BMP => array('bmp'), IMAGETYPE_TIFF_II => array('tiff'), IMAGETYPE_TIFF_MM => array('tiff'), IMAGETYPE_JPC => array('jpc'), IMAGETYPE_JP2 => array('jp2'), IMAGETYPE_JPX => array('jpx'), IMAGETYPE_JB2 => array('jb2'), IMAGETYPE_SWF => array('swf'), IMAGETYPE_SWC => array('swc'), IMAGETYPE_IFF => array('iff'), IMAGETYPE_WBMP => array('wbmp'), IMAGETYPE_XBM => array('xbm'));\r\n\t\t$IMAGE_TYPE_EXT = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_READ_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_READ_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_WRITE_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_WRITE_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_TYPE_READFUNCTION = array();\r\n\t\t$IMAGE_TYPE_WRITEFUNCTION = array();\r\n\t\t\r\n\t\tforeach ( $IMAGE_TYPE_EXTS as $image_type => $image_extensions ) {\r\n\t\t\t// Check type\r\n\t\t\tforeach ( $image_extensions as $image_extension ) {\r\n\t\t\t\t// Check read\r\n\t\t\t\t$image_read_function = 'imagecreatefrom' . $image_extension;\r\n\t\t\t\t$image_supported_read = function_exists($image_read_function);\r\n\t\t\t\tif ( $image_supported_read ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t}\r\n\t\t\t\t// check write\r\n\t\t\t\t$image_write_function = 'image' . $image_extension;\r\n\t\t\t\t$image_supported_write = function_exists($image_write_function);\r\n\t\t\t\tif ( $image_supported_write ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t}\r\n\t\t\t\t// Check overall\r\n\t\t\t\tif ( $image_supported_read && $image_supported_write ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_TYPE_EXT[$image_type] = $image_extension;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t\t$IMAGE_TYPE_WRITEFUNCTION[$image_type] = $image_write_function;\r\n\t\t\t\t\t$IMAGE_TYPE_READFUNCTION[$image_type] = $image_read_function;\r\n\t\t\t\t\t// Done we work\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t// Continue\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Done\r\n\t\treturn true;\r\n\t}" ]
[ "0.79519194", "0.7486134", "0.6576552", "0.64258045", "0.6356239", "0.5662145", "0.55992305", "0.5575132", "0.556353", "0.54442817", "0.54093707", "0.5384042", "0.53707236", "0.5319319", "0.52218693", "0.520826", "0.5143985", "0.5115582", "0.5049001", "0.50296956", "0.5026441", "0.49902293", "0.49817467", "0.49569717", "0.492964", "0.49200737", "0.4915106", "0.49148586", "0.4900676", "0.4889829" ]
0.86809003
0
string packDefineBitsLossless2Tag( integer BitmapID, integer BitmapID, integer BitmapFormat, integer BitmapWidth, integer BitmapHeight, integer BitmapColorTableSize, string ZlibBitmapData) return an SWF DefineBitsLossless2 tag string. TagID: 36
function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2) { array_push($this->FMDebug, "packDefineBitsLossless2Tag"); $TagID = 36; $BitmapID = $this->packUI16($BitmapID); $BitmapWidth = $this->packUI16($BitmapWidth); $BitmapHeight = $this->packUI16($BitmapHeight); switch ($BitmapFormat) { case 3: $BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); break; case 4: $BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); break; case 5: $BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); break; default: $this->FMError("packDefineBitsLosslessTag illegal argument (BitmapFormat)"); } $BitmapFormat = $this->packUI8($BitmapFormat); $TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}", "function ImageCreateFromBMP($filename)\n{\n //Ouverture du fichier en mode binaire\n if (! $f1 = fopen($filename,\"rb\")) return FALSE;\n\n //1 : Chargement des ent�tes FICHIER\n $FILE = unpack(\"vfile_type/Vfile_size/Vreserved/Vbitmap_offset\", fread($f1,14));\n if ($FILE['file_type'] != 19778) return FALSE;\n\n //2 : Chargement des ent�tes BM\n $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.\n '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.\n '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));\n $BMP['colors'] = pow(2,$BMP['bits_per_pixel']);\n if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset'];\n $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8;\n $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']);\n $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] = 4-(4*$BMP['decal']);\n if ($BMP['decal'] == 4) $BMP['decal'] = 0;\n\n //3 : Chargement des couleurs de la palette\n $PALETTE = array();\n if ($BMP['colors'] < 16777216)\n {\n $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4));\n }\n\n //4 : Cr�ation de l'image\n $IMG = fread($f1,$BMP['size_bitmap']);\n $VIDE = chr(0);\n\n $res = imagecreatetruecolor($BMP['width'],$BMP['height']);\n $P = 0;\n $Y = $BMP['height']-1;\n while ($Y >= 0)\n {\n $X=0;\n while ($X < $BMP['width'])\n {\n if ($BMP['bits_per_pixel'] == 24)\n $COLOR = unpack(\"V\",substr($IMG,$P,3).$VIDE);\n elseif ($BMP['bits_per_pixel'] == 16)\n {\n $COLOR = unpack(\"n\",substr($IMG,$P,2));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 8)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,$P,1));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 4)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 1)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7;\n elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6;\n elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5;\n elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4;\n elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3;\n elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2;\n elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1;\n elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n else\n return FALSE;\n imagesetpixel($res,$X,$Y,$COLOR[1]);\n $X++;\n $P += $BMP['bytes_per_pixel'];\n }\n $Y--;\n $P+=$BMP['decal'];\n }\n\n //Fermeture du fichier\n fclose($f1);\n\n return $res;\n}", "function packZLIBBITMAPDATA2($ColorTableRGBA, $BitmapPixelData)\n\t{\n\t\tarray_push($this->FMDebug, \"packZLIBBITMAPDATA2\");\n\n\t\t$atom = $ColorTableRGBA . $BitmapPixelData;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function imageBmp($img, $file, $RLE=0)\r\n\t{\r\n\t\t$ColorCount = imagecolorstotal($img);\r\n\t\t$Transparent = imagecolortransparent($img);\r\n\t\t$IsTransparent = $Transparent != -1;\r\n\t\tif($IsTransparent)\r\n\t\t\t$ColorCount--;\r\n\t\tif($ColorCount == 0)\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 24;\r\n\t\t}\r\n\t\tif(($ColorCount > 0) && ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\t$ColorCount = 2;\r\n\t\t\t$BitCount = 1;\r\n\t\t}\r\n\t\tif(($ColorCount > 2) && ($ColorCount <= 16))\r\n\t\t{\r\n\t\t\t$ColorCount = 16;\r\n\t\t\t$BitCount = 4;\r\n\t\t}\r\n\t\tif(($ColorCount > 16) && ($ColorCount <= 256))\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 8;\r\n\t\t}\r\n\t\t$Width = imageSX($img);\r\n\t\t$Height = imageSY($img);\r\n\t\t$Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4;\r\n\t\tif($BitCount < 24)\r\n\t\t\t$palsize = pow(2, $BitCount) * 4;\r\n\t\t$size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54;\r\n\t\t$size += $palsize;\r\n\t\t$offset = 54 + $palsize;\r\n\t\t// Bitmap File Header\r\n\t\t$ret = 'BM';\r\n\t\t$ret .= $this->int_to_dword($size);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword($offset);\r\n\t\t// Bitmap Info Header\r\n\t\t$ret .= $this->int_to_dword(40);\r\n\t\t$ret .= $this->int_to_dword($Width);\r\n\t\t$ret .= $this->int_to_dword($Height);\r\n\t\t$ret .= $this->int_to_word(1);\r\n\t\t$ret .= $this->int_to_word($BitCount);\r\n\t\t$ret .= $this->int_to_dword($RLE);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t// image data\r\n\t\t$CC = $ColorCount;\r\n\t\t$sl1 = strlen($ret);\r\n\t\tif($CC == 0)\r\n\t\t\t$CC = 256;\r\n\t\tif($BitCount < 24)\r\n\t\t{\r\n\t\t\t$ColorTotal = imagecolorstotal($img);\r\n\t\t\tif($IsTransparent)\r\n\t\t\t\t$ColorTotal--;\r\n\t\t\tfor($p = 0; $p < $ColorTotal; $p++)\r\n\t\t\t{\r\n\t\t\t\t$color = imagecolorsforindex($img, $p);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"blue\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"green\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"red\"]);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t\t$CT = $ColorTotal;\r\n\t\t\tfor($p = $ColorTotal; $p < $CC; $p++)\r\n\t\t\t{\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($BitCount <= 8)\r\n\t\t{\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\t$bWrite = \"\";\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorat($img, $x, $y);\r\n\t\t\t\t\t$bWrite .= $this->decbinx($color, $BitCount);\r\n\t\t\t\t\tif(strlen($bWrite) == 8)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t\t\t$bWrite = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((strlen($bWrite) < 8) and (strlen($bWrite) != 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sl = strlen($bWrite);\r\n\t\t\t\t\tfor($t = 0; $t < 8 - $sl; $t++)\r\n\t\t\t\t\t\t$sl .= \"0\";\r\n\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t}\r\n\t\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t\t$retd .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(($RLE == 1) and ($BitCount == 8))\r\n\t\t{\r\n\t\t\tfor($t = 0; $t < strlen($retd); $t += 4)\r\n\t\t\t{\r\n\t\t\t\tif($t != 0)\r\n\t\t\t\t\tif(($t) % $Width == 0)\r\n\t\t\t\t\t\t$ret .= chr(0).chr(0);\r\n\r\n\t\t\t\tif(($t + 5) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0);\r\n\t\t\t\t\t$t += 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(($t + 6) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(6).substr($retd, $t, 6);\r\n\t\t\t\t\t$t += 2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$ret .= chr(0).chr(4).substr($retd, $t, 4);\r\n\t\t\t}\r\n\t\t\t$ret .= chr(0).chr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$ret .= $retd;\r\n\t\tif($BitCount == 24)\r\n\t\t{\r\n\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t$Dopl .= chr(0);\r\n\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorsforindex($img, ImageColorAt($img, $x, $y));\r\n\t\t\t\t\t$ret .= chr($color[\"blue\"]).chr($color[\"green\"]).chr($color[\"red\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$ret .= $Dopl;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(fwrite(fopen($file, \"wb\"), $ret))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}", "function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}", "function read_image_descriptor()\r\n\t{\r\n\t\t/* Reset global variables */\r\n\t\t$this->buffer = array();\r\n\t\t$this->fou = '';\r\n\r\n\t\t/* Header -> GIF89a */\r\n\t\t$this->fou .= \"\\x47\\x49\\x46\\x38\\x39\\x61\";\r\n\r\n\t\t$this->getbytes(9);\r\n for($i = 0; $i < 9; $i++)\r\n $this->image_descriptor[$i] = $this->buffer[$i];\r\n\r\n $local_color_table_flag = ($this->buffer[8] & 0x80) ? TRUE : FALSE;\r\n if($local_color_table_flag)\r\n {\r\n \t$code = ($this->buffer[8] & 0x07);\r\n \t$sorted = ($this->buffer[8] & 0x20) ? TRUE : FALSE;\r\n }\r\n else\r\n {\r\n $code = $this->global_color_table_code;\r\n $sorted = $this->global_sorted;\r\n }\r\n\r\n $size = 2 << $code;\r\n\r\n $this->logical_screen_descriptor[4] &= 0x70;\r\n $this->logical_screen_descriptor[4] |= 0x80;\r\n $this->logical_screen_descriptor[4] |= $code;\r\n\r\n if($sorted)\r\n\t\t\t$this->logical_screen_descriptor [4] |= 0x08;\r\n\t\t$this->putbytes($this->logical_screen_descriptor, 7);\r\n\r\n\t\tif($local_color_table_flag)\r\n\t\t{\r\n\t\t\t$this->getbytes(3 * $size);\r\n $this->putbytes($this->buffer, 3 * $size);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->putbytes($this->global, 3 * $size);\r\n\r\n\t\t$this->fou .= \"\\x2C\";\r\n\r\n\t\t$this->image_descriptor[8] &= 0x40;\r\n\r\n\t\t$this->putbytes($this->image_descriptor, 9);\r\n\r\n /* LZW minimum code size */\r\n\t\t$this->getbytes(1);\r\n\t\t$this->putbytes($this->buffer, 1);\r\n\r\n\t\t/* Image Data */\r\n for(;;)\r\n {\r\n \t$this->getbytes(1);\r\n\t\t\t$this->putbytes($this->buffer, 1);\r\n if(($u = $this->buffer[0]) == 0)\r\n \tbreak;\r\n $this->getbytes($u);\r\n $this->putbytes($this->buffer, $u);\r\n }\r\n\r\n\t\t/* trailer */\r\n\t\t$this->fou .= \"\\x3B\";\r\n\r\n\t\t/* Write to file */\r\n\t\tswitch($this->fm)\r\n\t\t{\r\n\t\t\t/* Write as BMP */\r\n\t\t\tcase \"BMP\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".bmp\";\r\n\t\t\t\tif(!$this->imageBmp($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n /* Write as PNG */\r\n\t\t\tcase \"PNG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".png\";\r\n\t\t\t\tif(!imagePng($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as JPG */\r\n\t\t\tcase \"JPG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".jpg\";\r\n\t\t\t\tif(!imageJpeg($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as GIF */\r\n\t\t\tcase \"GIF\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".gif\";\r\n\t\t\t\tif(!imageGif($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}", "function swf_shapefillbitmapclip($bitmapid)\n{\n}", "public static function png32()\n {\n return new FlagQualifier(self::PNG32);\n }", "function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}", "public static function png24()\n {\n return new FlagQualifier(self::PNG24);\n }", "function packZLIBBITMAPDATA($ColorTableRGB, $BitmapPixelData)\n\t{\n\t\tarray_push($this->FMDebug, \"packZLIBBITMAPDATA\");\n\n\t\t$atom = $ColorTableRGB . $BitmapPixelData;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public function getBits();", "function _obfuscate_lYeNkoeMlY2Ph5KGjY6VkIk’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}", "function _obfuscate_jYiPioeJi5OSiY_RlIeIjYw’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}", "function _obfuscate_kouLiIaPjJWUhoqLkYaQjIg’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}", "function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function _obfuscate_jI_PlJOMhoiPkZOOh4_OkYs’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}", "function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}" ]
[ "0.74602234", "0.678082", "0.6415961", "0.6240862", "0.6177585", "0.58116144", "0.567725", "0.5493178", "0.547999", "0.54569733", "0.54262865", "0.54262865", "0.54262865", "0.5412999", "0.5384525", "0.53824717", "0.5359357", "0.5300058", "0.52246904", "0.51752853", "0.51443833", "0.5103406", "0.50746214", "0.506948", "0.49972692", "0.498694", "0.49848804", "0.49681604", "0.49495056", "0.49433917" ]
0.81630427
0
string packFrameLabelTag(string Label) returns an SWF FrameLabel tag string. TagID: 43
function packFrameLabelTag($Label) { array_push($this->FMDebug, "packFrameLabelTag"); $TagID = 43; $Label = $this->packSTRING($Label); $TagLength = strlen($Label); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packASSET($Tag, $Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packASSET\");\n\n\t\t$atom = $this->packUI16($Tag);\n\t\t$atom .= $this->packSTRING($Label);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public\n\tfunction getTagLabel(): string {\n\t\treturn $this->tagLabel;\n\t}", "public function createLabel($arrLabel){\r\n\t\treturn '<label class=\"'.$arrLabel['class'].'\">'.$arrLabel['message'].'</label>';\t\r\n\t}", "public function GetLabel();", "function readFrame ($frameTag, $header, $ver) {\n\tif ($ver == 3) {\n\t\t$lengthOffset = 6;\n\t\t$textOffset = 11;\n\t} \n\tif ($ver == 2) {\n\t\t$lengthOffset = 4;\n\t\t$textOffset = 7;\n\t}\n\t\n\t// find the tag we're looking for\n\t$tagStart = strpos ($header, $frameTag) ;\n\t// this code only reads the first 256 bytes on larger frames\n\t$tagLength = ord (substr($header, $tagStart + 1 + $lengthOffset, 1));\n\t$textStart = $tagStart + $textOffset;\n\tif ($frameTag == \"COMM\" || $frameTag == \"COM\") {\n\t\t$textStart = $textStart + 4;\n\t\t$tagLength = $tagLength - 4;\n\t\t}\n\t$tagText = substr($header, $textStart, $tagLength - 1);\n\treturn stripJunk($tagText);\n}", "function buildLabel($label) {\n return check_plain($label);\n }", "public function get_label();", "public function get_label();", "public function labelTag($args) {\n $name = $this->orEq($args,'name');\n $content = $this->orEq($args,'label');\n $classes = $this->orEq($args,'classes','');\n return \"<label for='\" . esc_attr( $name ) . \"' for='\" . esc_attr( $classes ) . \"'>\" . esc_html( $content ) . \"</label>\";\n }", "public function labelTag($args) {\n $name = $this->orEq($args,'name');\n $content = $this->orEq($args,'label');\n $classes = $this->orEq($args,'classes','');\n return \"<label for='\" . esc_attr( $name ) . \"' for='\" . esc_attr( $classes ) . \"'>\" . esc_html( $content ) . \"</label>\";\n }", "protected function shortLabel($lbl){\n if(isset($_COOKIE['screen_width'])){\n if((int)$_COOKIE['screen_width']>1400){\n return $lbl;\n }\n }\n\n if(strlen($lbl)>28){\n\n $lbl = iconv('utf-8', 'windows-1251', $lbl);\n $lbl = substr($lbl, 0, 14).'...';\n $lbl = iconv('windows-1251', 'utf-8', $lbl);\n\n\n }\n return $lbl;\n }", "public function label()\n {\n $result = $this->title;\n if ($this->tags) {\n $tags = '[' . implode('] [', preg_split('/\\s*,\\s*/', $this->tags)) . ']';\n $result .= ' <span style=\"font-weight:bold;padding-left:20px;float:right;\">' . $tags . '</span>';\n }\n return $result;\n }", "function track(string $src, string $kind, string $srcLanguage, string $label): string\n {\n return '<track src=\"' . $src\n . '\" kind=\"' . $kind\n . '\" srclang=\"' . $srcLanguage\n . '\" label=\"' . $label\n . '\"' . _solidus() . '>';\n }", "function getLabel(): string;", "protected function describeFieldsPrepareLabel(string $sLabel): string\n {\n $aPatterns = [\n // Common words\n '/\\bid\\b/i' => 'ID',\n '/\\burl\\b/i' => 'URL',\n '/\\bhtml\\b/i' => 'HTML',\n // Common file extensions\n '/\\bpdf\\b/i' => 'PDF',\n ];\n\n $sLabel = ucwords(preg_replace('/[\\-_]/', ' ', $sLabel));\n $sLabel = preg_replace(array_keys($aPatterns), array_values($aPatterns), $sLabel);\n\n return $sLabel;\n }", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();" ]
[ "0.6838461", "0.5655852", "0.5554248", "0.5459532", "0.53708684", "0.53289264", "0.52978456", "0.5259548", "0.5259548", "0.5247036", "0.5247036", "0.5226739", "0.5198707", "0.51843584", "0.5167408", "0.51656824", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336", "0.513336" ]
0.8302608
0
null packDefineMorphShapeTag(integer ShapeID, string FromShapeBounds, stringToShapeBounds, string MorphFillStyles, string MorphLineStyles, string FromShape, string ToShape) returns an SWF DefineMorphShapeTag string. TagID: 46
function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape) { array_push($this->FMDebug, "packDefineMorphShapeTag"); $TagID = 46; $DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape; $TagLength = strlen($DefineMorphShapeTag); $this->AutoSetSWFVersion(5); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function swf_shapefillbitmapclip($bitmapid)\n{\n}", "function getShape() { return $this->_shape; }", "function getShape() { return $this->_shape; }", "public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}", "public function getShape1()\n {\n }", "function wp_migrate_old_typography_shape($metadata)\n {\n }", "public function getShape2()\n {\n }", "public function getShapeId()\n {\n return $this->shape_id;\n }", "function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function setShape($a_shape)\n\t{\n\t\t$this->shape = $a_shape;\n\t}", "function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public function shapeString() : string\n {\n return (string) $this->m . ' x ' . (string) $this->n;\n }", "public function name(): string\n {\n return 'morphOne';\n }", "public function shape($value) {\n return $this->setProperty('shape', $value);\n }", "private function _loadShapes()\n {\n //shaded relief\n $this->shapes['relief'] = array(\n 'shape' => $this->shape_path . \"/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n // Geotiff created by David P. Shorthouse using above file.\n $this->shapes['reliefgrey'] = array(\n 'shape' => $this->shape_path . \"/GRAY_HR_SR_OB_DR/GRAY_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n //lakes outline\n $this->shapes['lakesOutline'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 2\n );\n\n //lakes\n $this->shapes['lakes'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //oceans\n $this->shapes['oceans'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_ocean\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //conservation\n $this->shapes['conservation'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //ecoregions\n $this->shapes['ecoregions'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //base map\n $this->shapes['base'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_land\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //base map\n $this->shapes['countries'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //stateprovinces_polygon\n $this->shapes['stateprovinces_polygon'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 5\n );\n\n //stateprovinces\n $this->shapes['stateprovinces'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces_lines_shp\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 6\n );\n\n //lake names\n $this->shapes['lakenames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 7\n );\n\n //rivers\n $this->shapes['rivers'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 8\n );\n\n //rivers\n $this->shapes['rivernames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 9\n );\n\n //placename\n $this->shapes['placenames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_populated_places_simple\",\n 'type' => MS_LAYER_POINT,\n 'encoding' => \"CP1252\",\n 'sort' => 10\n );\n\n //State/Provincial labels\n $this->shapes['stateprovnames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 11\n );\n\n //Country labels\n $this->shapes['countrynames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 12\n );\n\n //physicalLabels\n $this->shapes['physicalLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_regions_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 13\n );\n\n //marineLabels\n $this->shapes['marineLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_marine_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n //hotspotLabels\n $this->shapes['hotspotLabels'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 14\n );\n\n //ecoregions\n $this->shapes['ecoregionLabels'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n }", "function sf_build_base_smileys()\n{\n\t$smileys = array(\n\t\"Confused\" => \tarray (\t0 => \"sf-confused.gif\",\t\t1 => \":???:\",),\n\t\"Cool\" =>\t\tarray (\t0 => \"sf-cool.gif\",\t\t\t1 => \":cool:\"),\n\t\"Cry\" =>\t\tarray (\t0 => \"sf-cry.gif\",\t\t\t1 => \":cry:\",),\n\t\"Embarassed\" =>\tarray (\t0 => \"sf-embarassed.gif\",\t1 => \":oops:\",),\n\t\"Frown\" =>\t\tarray (\t0 => \"sf-frown.gif\",\t\t1 => \":frown:\",),\n\t\"Kiss\" =>\t\tarray (\t0 => \"sf-kiss.gif\",\t\t\t1 => \":kiss:\",),\n\t\"Laugh\" =>\t\tarray (\t0 => \"sf-laugh.gif\",\t\t1 => \":lol:\",),\n\t\"Smile\" =>\t\tarray (\t0 => \"sf-smile.gif\",\t\t1 => \":smile:\",),\n\t\"Surprised\" =>\tarray (\t0 => \"sf-surprised.gif\",\t1 => \":eek:\",),\n\t\"Wink\" =>\t\tarray (\t0 => \"sf-wink.gif\",\t\t\t1 => \":wink:\",),\n\t\"Yell\" =>\t\tarray (\t0 => \"sf-yell.gif\",\t\t\t1 => \":yell:\",)\n\t);\n\n\tsf_add_sfmeta('smileys', 'smileys', serialize($smileys));\n\n\treturn;\n}", "public static function identicon($_hash,$_size=NULL) {\n\t\t$_blox=F3::$global['IBLOCKS'];\n\t\tif (is_null($_size))\n\t\t\t$_size=F3::$global['IPIXELS'];\n\t\t// Rotatable shapes\n\t\t$_dynamic=array(\n\t\t\tarray(.5,1,1,0,1,1),\n\t\t\tarray(.5,0,1,0,.5,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.5),\n\t\t\tarray(0,.5,.5,0,1,.5,.5,1,.5,.5),\n\t\t\tarray(0,.5,1,0,1,1,0,1,1,.5),\n\t\t\tarray(1,0,1,1,.5,1,1,.5,.5,.5),\n\t\t\tarray(0,0,1,0,1,.5,0,0,.5,1,0,1),\n\t\t\tarray(0,0,.5,0,1,.5,.5,1,0,1,.5,.5),\n\t\t\tarray(.5,0,.5,.5,1,.5,1,1,.5,1,.5,.5,0,.5),\n\t\t\tarray(0,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,.5,.5,1,1,.5,.5,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.75,.5,.5,1,.25),\n\t\t\tarray(0,.5,.5,0,.5,.5,1,0,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,1,1,0,1,1,.5,.5,.25,.5,.75,0,.5,.5,.25),\n\t\t\tarray(0,.5,.5,.5,.5,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,.5,.5,.5,0,0,.5,1,.5,.5,1,.5,.5,0,1)\n\t\t);\n\t\t// Fixed shapes (for center sprite)\n\t\t$_static=array(\n\t\t\tarray(),\n\t\t\tarray(0,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,.5,.5,1,0,.5),\n\t\t\tarray(0,0,1,0,1,1,0,1,0,.5,.5,1,1,.5,.5,0,0,.5),\n\t\t\tarray(.25,0,.75,0,.5,.5,1,.25,1,.75,.5,.5,\n\t\t\t\t.75,1,.25,1,.5,.5,0,.75,0,.25,.5,.5),\n\t\t\tarray(0,0,.5,.25,1,0,.75,.5,1,1,.5,.75,0,1,.25,.5),\n\t\t\tarray(.33,.33,.67,.33,.67,.67,.33,.67),\n\t\t\tarray(0,0,.33,0,.33,.33,.67,.33,.67,0,1,0,1,.33,.67,.33,\n\t\t\t\t.67,.67,1,.67,1,1,.67,1,.67,.67,.33,.67,.33,1,0,1,\n\t\t\t\t0,.67,.33,.67,.33,.33,0,.33)\n\t\t);\n\t\t// Parse MD5 hash\n\t\t$_hash=F3::resolve($_hash);\n\t\tlist($_bgR,$_bgG,$_bgB)=self::rgb(F3::$global['BGCOLOR']);\n\t\tlist($_fgR,$_fgG,$_fgB)=self::rgb(substr($_hash,0,6));\n\t\t$_shapeC=hexdec($_hash[6]);\n\t\t$_angleC=hexdec($_hash[7]%4);\n\t\t$_shapeX=hexdec($_hash[8]);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_shapeS[$_i]=hexdec($_hash[9+$_i*2]);\n\t\t\t$_angleS[$_i]=hexdec($_hash[10+$_i*2]%4);\n\t\t}\n\t\t// Start with NxN blank slate\n\t\t$_identicon=imagecreatetruecolor($_size*$_blox,$_size*$_blox);\n\t\timageantialias($_identicon,TRUE);\n\t\t$_bg=imagecolorallocate($_identicon,$_bgR,$_bgG,$_bgB);\n\t\t$_fg=imagecolorallocate($_identicon,$_fgR,$_fgG,$_fgB);\n\t\t// Generate corner sprites\n\t\t$_corner=imagecreatetruecolor($_size,$_size);\n\t\timagefill($_corner,0,0,$_bg);\n\t\t$_sprite=$_dynamic[$_shapeC];\n\t\tfor ($_i=0,$_len=count($_sprite);$_i<$_len;$_i++)\n\t\t\t$_sprite[$_i]=$_sprite[$_i]*$_size;\n\t\timagefilledpolygon($_corner,$_sprite,$_len/2,$_fg);\n\t\tfor ($_i=0;$_i<$_angleC;$_i++)\n\t\t\t$_corner=imagerotate($_corner,90,$_bg);\n\t\t// Generate side sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_side[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_side[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeS[$_i]];\n\t\t\tfor ($_j=0,$_len=count($_sprite);$_j<$_len;$_j++)\n\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\timagefilledpolygon($_side[$_i],$_sprite,$_len/2,$_fg);\n\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t$_side[$_i]=imagerotate($_side[$_i],90,$_bg);\n\t\t}\n\t\t// Generate center sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_center[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_center[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeX];\n\t\t\tif ($_blox%2>0 && $_i==$_blox-3)\n\t\t\t\t// Odd center sprites\n\t\t\t\t$_sprite=$_static[$_shapeX%8];\n\t\t\t$_len=count($_sprite);\n\t\t\tif ($_len) {\n\t\t\t\tfor ($_j=0;$_j<$_len;$_j++)\n\t\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\t\timagefilledpolygon($_center[$_i],$_sprite,$_len/2,$_fg);\n\t\t\t}\n\t\t\tif ($_i<($_blox-3))\n\t\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t\t$_center[$_i]=imagerotate($_center[$_i],90,$_bg);\n\t\t}\n\t\t// Paste sprites\n\t\tfor ($_i=0;$_i<4;$_i++) {\n\t\t\timagecopy($_identicon,$_corner,0,0,0,0,$_size,$_size);\n\t\t\tfor ($_j=0;$_j<$_blox-2;$_j++) {\n\t\t\t\timagecopy($_identicon,$_side[$_j],\n\t\t\t\t\t$_size*($_j+1),0,0,0,$_size,$_size);\n\t\t\t\tfor ($_k=$_j;$_k<$_blox-3-$_j;$_k++)\n\t\t\t\t\timagecopy($_identicon,$_center[$_k],\n\t\t\t\t\t\t$_size*($_k+1),$_size*($_j+1),0,0,$_size,$_size);\n\t\t\t}\n\t\t\t$_identicon=imagerotate($_identicon,90,$_bg);\n\t\t}\n\t\tif ($_blox%2>0)\n\t\t\t// Paste odd center sprite\n\t\t\timagecopy($_identicon,$_center[$_blox-3],\n\t\t\t\t$_size*(floor($_blox/2)),$_size*(floor($_blox/2)),0,0,\n\t\t\t\t$_size,$_size);\n\t\t// Resize\n\t\t$_resized=imagecreatetruecolor($_size,$_size);\n\t\timagecopyresampled($_resized,$_identicon,0,0,0,0,$_size,$_size,\n\t\t\t$_size*$_blox,$_size*$_blox);\n\t\t// Make the background transparent\n\t\timagecolortransparent($_resized,$_bg);\n\t\tif (PHP_SAPI!='cli' && !headers_sent())\n\t\t\theader(F3::HTTP_Content.': image/png');\n\t\timagepng($_resized,NULL,self::PNG_Compress,PNG_NO_FILTER);\n\t\t// Free resources\n\t\timagedestroy($_identicon);\n\t\timagedestroy($_resized);\n\t\timagedestroy($_corner);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\timagedestroy($_side[$_i]);\n\t\t\timagedestroy($_center[$_i]);\n\t\t}\n\t}", "public function setShape(\\App\\Entity\\Product\\Details\\Shape $shape = null) \n { \n $this->shape = $shape;\n \n return $this;\n }", "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function format(ShapeInterface $shape);", "public function addShape(Shape $shape){\n return $shape->draw();\n }", "public function shape(int $id): OptionalInterface\n {\n return $this->tags()->filter(function ($item) use($id) { return $item['shapeId'] == $id; })->first();\n }", "public function setShape(ChildShape $v = null)\n {\n if ($v === null) {\n $this->setShapeId(NULL);\n } else {\n $this->setShapeId($v->getShapeId());\n }\n\n $this->aShape = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildShape object, it will not be re-added.\n if ($v !== null) {\n $v->addArticle($this);\n }\n\n\n return $this;\n }", "public function setShapeId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->shape_id !== $v) {\n $this->shape_id = $v;\n $this->modifiedColumns[ArticleTableMap::COL_SHAPE_ID] = true;\n }\n\n if ($this->aShape !== null && $this->aShape->getShapeId() !== $v) {\n $this->aShape = null;\n }\n\n return $this;\n }" ]
[ "0.6923518", "0.6837494", "0.62588364", "0.5587913", "0.55718267", "0.55018866", "0.522077", "0.51541054", "0.51371676", "0.5117136", "0.5032456", "0.5022009", "0.49855122", "0.48957342", "0.4886173", "0.48154697", "0.4716946", "0.46993828", "0.46531337", "0.45864102", "0.45326412", "0.45136395", "0.44792166", "0.4478013", "0.44744894", "0.44561288", "0.44079703", "0.44053218", "0.43958408", "0.4394957" ]
0.8269537
0
string packExportAssetsTag(string AssetList) returns an SWF EnableDebugger tag string. TagID: 56
function packExportAssetsTag($AssetList) { array_push($this->FMDebug, "packExportAssetsTag"); $TagID = 56; $AssetCount = substr_count($AssetList, chr(0)); $TagLength = strlen($AssetCount . $AssetList); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $AssetCount . $AssetList; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packImportAssetsTag($URL, $AssetList)\n\t{\n\t\tarray_push($this->FMDebug, \"packImportAssetsTag\");\n\n\t\t$TagID = 57;\n\n\t\t$URL = $this->packSTRING($URL);\n\n\t\t$AssetCount = substr_count($AssetList, chr(0)) - 1;\n\n\t\t$TagLength = strlen($URL, $AssetCount . $AssetList);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $URL . $AssetCount . $AssetList;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packASSET($Tag, $Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packASSET\");\n\n\t\t$atom = $this->packUI16($Tag);\n\t\t$atom .= $this->packSTRING($Label);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public static function getArchivalTagList() {\n\t\t// $archival_tags = [];\n// \t\tforeach (self::$asset_tags as $tag=>$label){\n// \t\t\tif (strpos($label,'*') !== false){\n// \t\t\t\t$archive_tags[] = \"'$tag'\";\n// \t\t\t}\n// \t\t}\n\t\treturn \"'\" . implode(\"','\",array_keys(self::$asset_tags)) . \"'\" ;\n\t}", "public function getTag()\n {\n return 'assets';\n }", "public function exportedAssets(): array\n {\n $exported = [];\n\n foreach ($this->tagsByType('ExportAssets') as $export) {\n $characterId = $export->tags->item;\n\n foreach ($export->names->item as $name) {\n $exported[(string) $name] = (int) $characterId;\n }\n }\n\n return $exported;\n }", "function tw_asset_list() {\n\n\t$assets = tw_app_get('tw_registered_assets');\n\n\tif (!is_array($assets)) {\n\t\t$assets = [];\n\t}\n\n\treturn $assets;\n\n}", "public function tags()\n\t{\n\t\t$tags = '';\n\n\t\tif ($this->collection->shouldCombine())\n\t\t{\n\t\t\t$tags = $this->tag($this->collection->cacheFileUrl);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($this->collection->items as $asset)\n\t\t\t{\n\t\t\t\t$tags .= $this->tag($asset->url);\n\t\t\t}\n\t\t}\n\n\t\treturn $tags;\n\t}", "public function getPrintableJavascriptTagStrings() {\n $tagStrings = '';\n foreach ($this->getTemplateJavascriptFiles() as $jsFile) {\n $tagStrings .= sprintf('<script type=\"text/javascript\" src=\"%s\"></script>', $jsFile);\n }\n return $tagStrings;\n }", "private function getBasketScriptPlugins() {\n JPluginHelper::importPlugin('easysdi_basket_script');\n $app = JFactory::getApplication();\n //get scripts\n $scripts = $app->triggerEvent('getBasketScript');\n\n //Return merged scripts\n return implode(\"\\n\", $scripts);\n }", "function tw_asset_register($assets) {\n\n\tif (!is_array($assets)) {\n\t\treturn;\n\t}\n\n\t$data = tw_asset_list();\n\n\tforeach ($assets as $name => $asset) {\n\t\tif (!empty($data[$name]) and is_array($data[$name]) and (is_callable($asset) or is_bool($asset))) {\n\t\t\t$data[$name]['display'] = $asset;\n\t\t} else {\n\t\t\t$data[$name] = $asset;\n\t\t}\n\t}\n\n\ttw_app_set('tw_registered_assets', $data);\n\n}", "public function assetTypes(): array\n {\n $assets = [];\n\n foreach ($this->read(['swf', 'tags', 'item']) as $item) {\n // @todo add other tags\n switch ((string) $item['type']) {\n case 'DefineShapeTag':\n case 'DefineShape2Tag':\n case 'DefineShape3Tag':\n $assets[(int) $item['shapeId']] = Export::ITEM_TYPE_SHAPE;\n break;\n\n case 'DefineSpriteTag':\n $assets[(int) $item['spriteId']] = Export::ITEM_TYPE_SPRITE;\n break;\n\n case 'DefineSoundTag':\n $assets[(int) $item['soundId']] = Export::ITEM_TYPE_SOUND;\n break;\n\n case 'DefineBitsJPEG3Tag':\n $assets[(int) $item['characterID']] = Export::ITEM_TYPE_IMAGE;\n break;\n }\n }\n\n return $assets;\n }", "protected function getPackedContent( Array $media_list, $prepend_string = '' )\n\t{\n\t\t$content = $prepend_string;\n\t\tforeach ( $media_list as $media )\n\t\t{\n\t\t\t$filename = ROOT_PATH . '/' . $media['filename'];\n\n\t\t\tif ( is_file( $filename ) )\n\t\t\t{\n\t\t\t\t$content .= \"/* BEGIN {$media['name']} */\\n\\n\" . chr( 13 );\n\t\t\t\t$content .= file_get_contents( $filename ) . chr( 13 );\n\t\t\t\t$content .= \"\\n\\n/* END {$media['name']} */\" . chr( 13 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$content .= \"alert( 'File {$media['name']} not found' );\";\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\n\t}", "public static function getAssetsToRegister()\n {\n $assetsList = array(\n 'js' => array(),\n 'css' => array(),\n );\n if (self::isHomologationMode()) {\n $assetsList['js'][] = PaylineSDK::HOMO_WDGT_JS;\n $assetsList['css'][] = PaylineSDK::HOMO_WDGT_CSS;\n } else {\n $assetsList['js'][] = PaylineSDK::PROD_WDGT_JS;\n $assetsList['css'][] = PaylineSDK::PROD_WDGT_CSS;\n }\n\n return $assetsList;\n }", "function studeon_vc_tgmpa_required_plugins($list=array()) {\n\t\tif (in_array('js_composer', studeon_storage_get('required_plugins'))) {\n\t\t\t$path = studeon_get_file_dir('plugins/js_composer/js_composer.zip');\n\t\t\t$list[] = array(\n\t\t\t\t\t'name' \t\t=> esc_html__('WPBakery PageBuilder', 'studeon'),\n\t\t\t\t\t'slug' \t\t=> 'js_composer',\n 'version'\t=> '6.0.5',\n\t\t\t\t\t'source'\t=> !empty($path) ? $path : 'upload://js_composer.zip',\n\t\t\t\t\t'required' \t=> false\n\t\t\t);\n\t\t}\n\t\treturn $list;\n\t}", "public function tag()\n\t{\n\t\t/* Example usage:\n\t\t{exp:crush:tag \n\t\t\tfilename=\"/_assets/css/style.css\"\n\t\t\tminify=\"y\"\n\t\t\tvars=\"my_var1=#333|my_var2=20px\"\n\t\t\tattributes=\"media=print|title=monkey\"\n\t\t} \n\t\t*/\n\t\treturn csscrush_tag(\n\t\t\t$this->filename, \n\t\t\t$this->get_params(FALSE, array('filename', 'attributes')),\n\t\t\t$this->attributes\n\t\t);\n\n\t}", "function packtectEnableDebuggerTag($Password)\n\t{\n\t\tarray_push($this->FMDebug, \"packEnableDebuggerTag\");\n\n\t\t$TagID = 58;\n\n\t\tif (!($Password == \"\")) {\n\n\t\t\t$Password = $this->packSTRING(bin2hex(mhash(MHASH_MD5, $Password)));\n\t\t}\n\n\t\t$TagLength = strlen($Password);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function src_inc_list_js(string $assets_url, array $files) : string {\n $source = \"\";\n\n //Process the list of files\n foreach($files as $file){\n\n if(is_array($file))\n $file = $file[\"path\"];\n\n $source .= src_inc_js($assets_url.$file).\"\\n\\t\\t\";\n }\n\n return $source;\n}", "public function getAssetsUrl()\n\t{\n\t\tif($this->_assetsUrl===null)\n\t\t{\n\t\t\t$this->_assetsUrl=Yii::app()->getAssetManager()->publish(\n\t\t\t\tYii::getPathOfAlias('application.modules.'.$this->moduleName.'.assets'),\n\t\t\t\tfalse,\n\t\t\t\t-1,\n\t\t\t\tYII_DEBUG\n\t\t\t);\n\t\t}\n\n\t\treturn $this->_assetsUrl;\n\t}", "private function _getAssetsUrl()\n\t{\n\t\tif( $this->_assetsUrl===null )\n\t\t{\n\t\t\t$assetsPath = Yii::getPathOfAlias('ext.widgets.countupload.assets');\n\n\t\t\t// We need to republish the assets if debug mode is enabled.\n\t\t\tif( $this->debug===true )\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\telse\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath);\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}", "protected function combineOutputGroups($assetList, $type)\n {\n if ($type == Asset::SCRIPT) {\n $outputPathTemplate = $this->config->outputPath . '/cache/{filename}.js';\n $inlineTeplate = '<script type=\"text/javascript\">{contents}</script>';\n $declarationTemplate = '<script type=\"text/javascript\" src=\"{assetName}\"></script>';\n } elseif ($type == Asset::STYLE) {\n $outputPathTemplate = $this->config->outputPath . '/cache/{filename}.css';\n $inlineTeplate = '<style>{contents}</style>';\n $declarationTemplate = '<link media=\"screen\" type=\"text/css\" rel=\"stylesheet\" href=\"{assetName}\"/>';\n }\n\n $result = '';\n\n $assetGroups = [];\n $groupIndex = 0;\n foreach ($assetList as $assetName) {\n $asset = $this->assets[$assetName];\n if ($asset->canCombine() && !$asset->isExternal() && !$asset->isInline()) {\n if (!isset($assetGroups[$groupIndex])) {\n $assetGroups[$groupIndex] = [];\n }\n $assetGroups[$groupIndex][] = $assetName;\n } else {\n $groupIndex++;\n $assetGroups[$groupIndex] = $assetName;\n $groupIndex++;\n }\n }\n\n\n foreach ($assetGroups as $group) {\n if (is_array($group)) {\n $groupTime = 0;\n foreach ($group as $assetName) {\n $assetTime = $this->assets[$assetName]->getSourceTime();\n if ($assetTime > $groupTime) {\n $groupTime = $assetTime;\n }\n }\n $groupFileName = self::calculateCombinedName($group, $groupTime);\n $assetPath = str_replace('{filename}', $groupFileName, $outputPathTemplate);\n\n if (!file_exists($assetPath)) {\n $contents = '';\n foreach ($group as $assetName) {\n $this->assets[$assetName]->load();\n if ($this->minify && $this->assets[$assetName]->canMinify()) {\n $this->assets[$assetName]->minify();\n }\n if ($this->assets[$assetName]->getType() == Asset::SCRIPT) {\n $separator = \";\\n\";\n } else {\n $separator = \"\\n\";\n }\n $contents .= $this->assets[$assetName]->getData() . $separator;\n }\n\n self::writeFile($assetPath, $contents); //write the uncompressed file\n if ($this->gzip) {\n self::writeFile($assetPath . '.gz', gzencode($contents)); //write the compressed version\n }\n self::cleanup($assetPath);\n }\n $result .= str_replace('{assetName}', self::unroot($assetPath), $declarationTemplate);\n\n } else if (is_string($group)) {\n //Debug::log($group,'is string');\n $asset = $this->assets[$group];\n $assetName = $asset->getName();\n if ($asset->isExternal()) {\n $result .= str_replace('{assetName}', $assetName, $declarationTemplate);\n //$result.='<script type=\"text/javascript\" src=\"'.$assetName.'\"></script>';\n } else if ($asset->isInline()) {\n $asset->load();\n if ($this->minify && $asset->canMinify()) {\n $asset->minify();\n }\n $result .= str_replace('{contents}', $asset->getData(), $inlineTeplate);\n //$result.='<script type=\"text/javascript\">'.$asset->getData().'</script>';\n } else {\n $assetTime = $asset->getSourceTime();\n $assetPath = str_replace('{filename}', self::calculateCombinedName([$assetName], $assetTime), $outputPathTemplate);\n if (!file_exists($assetPath)) {\n $asset->load();\n if ($this->minify && $asset->canMinify()) {\n $asset->minify();\n }\n self::writeFile($assetPath, $asset->getData());\n if ($this->gzip) {\n self::writeFile($assetPath . '.gz', gzencode($asset->getData())); //write the compressed version\n }\n }\n $result .= str_replace('{assetName}', self::unroot($assetPath), $declarationTemplate);\n }\n }\n }\n return $result;\n }", "function getAssets();", "public function getAssetsVersion(): string\n\t{\n\t\treturn Config::getProjectVersion();\n\t}", "public function getAsset()\r\n\t{\r\n\t\treturn Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);\r\n\t}", "public function render_assets_tags($type = '', $group = '')\n\t{\n\t\t$assets_tags = '';\n\t\t\n\t\tforeach(array('css', 'js') as $try_type)\n\t\t{\n\t\t\tif(!$type || $type == $try_type)\n\t\t\t{\n\t\t\t\t$assets_tags .= $this->_build_assets_tags($try_type, $this->_combine_assets($try_type, $this->_assets[$try_type]), $group);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $assets_tags;\n\t}", "public function getName()\n {\n return 'AssetExtension';\n }", "private function export_tags(array $tags) : array {\n $user = $this->related['user'];\n $context = $this->related['context'];\n $capabilitymanager = $this->related['capabilitymanager'];\n $canmanagetags = $capabilitymanager->can_manage_tags($user);\n\n return array_values(array_map(function($tag) use ($context, $canmanagetags) {\n $viewurl = core_tag_tag::make_url($tag->tagcollid, $tag->rawname, 0, $context->id);\n return [\n 'id' => $tag->taginstanceid,\n 'tagid' => $tag->id,\n 'isstandard' => $tag->isstandard,\n 'displayname' => $tag->get_display_name(),\n 'flag' => $canmanagetags && !empty($tag->flag),\n 'urls' => [\n 'view' => $viewurl->out(false)\n ]\n ];\n }, $tags));\n }", "public function getAssetsUrl()\n\t{\n\t\treturn Yii::app()->getAssetManager()->publish($this->getAssetsPath());\n\t}", "public function get_scripts()\n {\n $prefix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.min' : '';\n $assets = $this->get_manifest('../dist/app');\n\n $scripts = [\n 'wprs-tsm-runtime' => [\n 'src' => $this->get_url($assets[ 'runtime.js' ]),\n 'in_footer' => true,\n ],\n 'wprs-tsm-frontend' => [\n 'src' => $this->get_url($assets[ 'frontend.js' ]),\n 'in_footer' => true,\n ],\n ];\n\n return $scripts;\n }", "public function testListAssets() {\n\n $res = TestAssetsHelper::listAssets($this->directoryAssets);\n $this->assertCount(1, $res);\n\n $this->assertRegexp(\"/syntaxhighlighter\\-.*\\.zip$/\", $res[0]);\n }", "public function getAssetsUrl()\n\t{\n\t\tif ($this->_assetsUrl === null) {\n\t\t\t$assetsPath = $this->getBasePath() . DIRECTORY_SEPARATOR . 'assets';\n\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\tif ($this->debug===true) {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\t} else {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\t}\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}" ]
[ "0.68328136", "0.57597446", "0.57386094", "0.53578675", "0.5232662", "0.49343622", "0.49221542", "0.48735094", "0.48011717", "0.47691655", "0.47501746", "0.4695897", "0.46371588", "0.46065357", "0.45976573", "0.4595049", "0.45941013", "0.45648655", "0.4556486", "0.4521475", "0.4506813", "0.44977254", "0.44664222", "0.4461008", "0.44587657", "0.44407693", "0.44392636", "0.44148546", "0.44029635", "0.4401986" ]
0.79046977
0
string packImportAssetsTag(string URL, string AssetList) returns an SWF EnableDebugger tag string. TagID: 57
function packImportAssetsTag($URL, $AssetList) { array_push($this->FMDebug, "packImportAssetsTag"); $TagID = 57; $URL = $this->packSTRING($URL); $AssetCount = substr_count($AssetList, chr(0)) - 1; $TagLength = strlen($URL, $AssetCount . $AssetList); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $URL . $AssetCount . $AssetList; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packExportAssetsTag($AssetList)\n\t{\n\t\tarray_push($this->FMDebug, \"packExportAssetsTag\");\n\n\t\t$TagID = 56;\n\n\t\t$AssetCount = substr_count($AssetList, chr(0));\n\n\t\t$TagLength = strlen($AssetCount . $AssetList);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $AssetCount . $AssetList;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packASSET($Tag, $Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packASSET\");\n\n\t\t$atom = $this->packUI16($Tag);\n\t\t$atom .= $this->packSTRING($Label);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "public function getTag()\n {\n return 'assets';\n }", "public function tags()\n\t{\n\t\t$tags = '';\n\n\t\tif ($this->collection->shouldCombine())\n\t\t{\n\t\t\t$tags = $this->tag($this->collection->cacheFileUrl);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($this->collection->items as $asset)\n\t\t\t{\n\t\t\t\t$tags .= $this->tag($asset->url);\n\t\t\t}\n\t\t}\n\n\t\treturn $tags;\n\t}", "public static function getArchivalTagList() {\n\t\t// $archival_tags = [];\n// \t\tforeach (self::$asset_tags as $tag=>$label){\n// \t\t\tif (strpos($label,'*') !== false){\n// \t\t\t\t$archive_tags[] = \"'$tag'\";\n// \t\t\t}\n// \t\t}\n\t\treturn \"'\" . implode(\"','\",array_keys(self::$asset_tags)) . \"'\" ;\n\t}", "function src_inc_list_js(string $assets_url, array $files) : string {\n $source = \"\";\n\n //Process the list of files\n foreach($files as $file){\n\n if(is_array($file))\n $file = $file[\"path\"];\n\n $source .= src_inc_js($assets_url.$file).\"\\n\\t\\t\";\n }\n\n return $source;\n}", "function assetTags ($type, $paths, $incTag, $blockTag) {\n\n $paths = uv($paths);\n if (!is_array($paths)) {\n $paths = !$paths ? [] : [$paths];\n }\n // if ($type == 'js') {\n // $jsData = Tht::module('Js')->u_plugin('jsData');\n // if ($jsData) { array_unshift($paths, $jsData); }\n // }\n\n if (!count($paths)) { return ''; }\n\n $nonce = Tht::module('Web')->u_nonce();\n\n $includes = [];\n $blocks = [];\n foreach ($paths as $path) {\n\n if (!OTypeString::isa($path)) {\n $this->error(\"Path must be a `url` or `$type` TypeString: `$path`\");\n }\n\n if (HtmlTypeString::isa($path)) {\n $tag = $path->u_stringify();\n $blocks []= $tag;\n }\n else if (!UrlTypeString::isa($path)){\n\n // Inline it in the HTML document\n $str = $path->u_stringify();\n if ($type == 'js' && !preg_match('#\\s*\\(function\\(\\)\\{#', $str)) {\n $str = \"(function(){\" . $str . \"})();\";\n }\n\n $vals = [\n 'body' => OTypeString::create('html', $str),\n ];\n if ($type == 'js') {\n $vals['nonce'] = $nonce;\n }\n $blockTag->u_fill(OMap::create($vals));\n $blocks []= $blockTag->u_stringify();\n }\n else {\n if ($path->u_is_relative()) {\n // TODO: Link to asset, with cache time set to file modtime\n\n // $basePath = ;\n // if (defined('BASE_URL')) {\n // $basePath = preg_replace('#' . BASE_URL . '#', '', $basePath);\n // }\n\n // $filePath = Tht::getThtFileName(Tht::path('pages', $basePath));\n // $path->u_query([ 'cache' => filemtime($filePath));\n }\n\n $vals = [\n 'url' => $path\n ];\n if ($type == 'js') {\n $vals['nonce'] = $nonce;\n }\n $incTag->u_fill(OMap::create($vals));\n $includes []= $incTag->u_stringify();\n }\n }\n\n $sIncludes = implode(\"\\n\", $includes);\n $sBlocks = implode(\"\\n\\n\", $blocks);\n\n return $sIncludes . \"\\n\" . $sBlocks;\n }", "public function tag()\n\t{\n\t\t/* Example usage:\n\t\t{exp:crush:tag \n\t\t\tfilename=\"/_assets/css/style.css\"\n\t\t\tminify=\"y\"\n\t\t\tvars=\"my_var1=#333|my_var2=20px\"\n\t\t\tattributes=\"media=print|title=monkey\"\n\t\t} \n\t\t*/\n\t\treturn csscrush_tag(\n\t\t\t$this->filename, \n\t\t\t$this->get_params(FALSE, array('filename', 'attributes')),\n\t\t\t$this->attributes\n\t\t);\n\n\t}", "function getAssets();", "public function render_assets_tags($type = '', $group = '')\n\t{\n\t\t$assets_tags = '';\n\t\t\n\t\tforeach(array('css', 'js') as $try_type)\n\t\t{\n\t\t\tif(!$type || $type == $try_type)\n\t\t\t{\n\t\t\t\t$assets_tags .= $this->_build_assets_tags($try_type, $this->_combine_assets($try_type, $this->_assets[$try_type]), $group);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $assets_tags;\n\t}", "function asset($url = '')\n{\n return ASSET . $url;\n}", "public function addAssets() {}", "public function addAssets() {}", "function javascript_include_tag() {\n $sources = func_get_args();\n\n $attributes = NULL;\n if (is_array($sources[count($sources) - 1])) {\n $attributes = array_pop($sources);\n }\n\n $tags = array();\n\n foreach ($sources as $source) {\n // only http[s] or // (leading double slash to inherit the protocol)\n // are treated as absolute url\n if (!is_absolute_url($source)) {\n $source = javascript_url($source);\n if (!preg_match(\"/\\.js$/\", $source)) $source .= \".js\";\n $source = $this->asset_version($source);\n }\n $options = array(\n \"src\" => $source,\n \"type\" => \"text/javascript\"\n );\n if(is_array($attributes)){\n $options = array_merge($options, $attributes);\n }\n $tags[] = content_tag(\"script\", \"\", $options);\n }\n\n return join(\"\\n\", $tags);\n }", "private function registerGtag()\r\n {\r\n // Only load the JS if this integration is enabled.\r\n if (!(bool) $this->config->get('event_tracking::settings.integrations.gtag', true)) {\r\n return;\r\n }\r\n\r\n $al = AssetList::getInstance();\r\n\r\n $al->register(\r\n 'javascript',\r\n 'event_tracking/gtag',\r\n 'js/gtag.js',\r\n [],\r\n 'event_tracking'\r\n );\r\n\r\n $assetGroup = ResponseAssetGroup::get();\r\n $assetGroup->requireAsset('javascript', 'event_tracking/gtag');\r\n }", "function tw_asset_list() {\n\n\t$assets = tw_app_get('tw_registered_assets');\n\n\tif (!is_array($assets)) {\n\t\t$assets = [];\n\t}\n\n\treturn $assets;\n\n}", "public function testListAssets() {\n\n $res = TestAssetsHelper::listAssets($this->directoryAssets);\n $this->assertCount(1, $res);\n\n $this->assertRegexp(\"/syntaxhighlighter\\-.*\\.zip$/\", $res[0]);\n }", "private function _getAssetsUrl()\n\t{\n\t\tif( $this->_assetsUrl===null )\n\t\t{\n\t\t\t$assetsPath = Yii::getPathOfAlias('ext.widgets.countupload.assets');\n\n\t\t\t// We need to republish the assets if debug mode is enabled.\n\t\t\tif( $this->debug===true )\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\telse\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath);\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}", "protected function getPackedContent( Array $media_list, $prepend_string = '' )\n\t{\n\t\t$content = $prepend_string;\n\t\tforeach ( $media_list as $media )\n\t\t{\n\t\t\t$filename = ROOT_PATH . '/' . $media['filename'];\n\n\t\t\tif ( is_file( $filename ) )\n\t\t\t{\n\t\t\t\t$content .= \"/* BEGIN {$media['name']} */\\n\\n\" . chr( 13 );\n\t\t\t\t$content .= file_get_contents( $filename ) . chr( 13 );\n\t\t\t\t$content .= \"\\n\\n/* END {$media['name']} */\" . chr( 13 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$content .= \"alert( 'File {$media['name']} not found' );\";\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\n\t}", "function dentario_instagram_feed_importer_required_plugins($not_installed='', $list='') {\n\t\t//if (in_array('instagram_feed', dentario_storage_get('required_plugins')) && !dentario_exists_instagram_feed() )\n\t\tif (dentario_strpos($list, 'instagram_feed')!==false && !dentario_exists_instagram_feed() )\n\t\t\t$not_installed .= '<br>Instagram Feed';\n\t\treturn $not_installed;\n\t}", "public function findImport($url){\n\t\t$matches = array();\n\t\tif(preg_match('|#WE:(\\d+)#|', $url, $matches)){\n\t\t\t$url = intval($matches[1]);\n\t\t\treturn (f('SELECT Extension FROM ' . FILE_TABLE . ' WHERE ID=' . $url) === '.scss' ? $url : null);\n\t\t}\n\t\treturn parent::findImport($url);\n\t}", "function get_minify_src($string, $group_handle = '')\n\t{\n\t\tif (empty($string))\n\t\t\treturn '';\n\n\t\t$buster = !empty($this->buster) ? '&#038;ver=' . $this->buster : '';\n\t\t$debug_flag = 'yes' == $this->options['enable_debug']\n\t\t\t? '&#038;debug' : '';\n\n\t\t$min_url = $this->min_url;\n\n\t\treturn apply_filters('bwp_minify_get_src',\n\t\t\ttrailingslashit($min_url) . '?f=' . $string . $buster . $debug_flag,\n\t\t\t$string, $group_handle, $this->buster, $min_url\n\t\t);\n\t}", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function sw_get_javascripts()\n{\n $params = sfConfig::get('app_swToolbox_swCombine', array('version' => false));\n $version = $params['version'];\n \n $response = sfContext::getInstance()->getResponse();\n $included_files = $response->getCombinedAssets();\n \n sfConfig::set('symfony.asset.javascripts_included', true);\n\n $html = '';\n foreach ($response->getJavascripts() as $file => $options)\n {\n // avoid loading combined files\n if(in_array($file, $included_files))\n {\n\n continue;\n }\n \n // append version if version is set\n // or if the url does not contains a `?`\n $file = $version && strpos($file, '?') === false ? $file.'?v='.$version : $file;\n \n $html .= javascript_include_tag($file, $options);\n }\n\n return $html;\n}", "public function getName()\n {\n return 'AssetExtension';\n }", "function packtectEnableDebuggerTag($Password)\n\t{\n\t\tarray_push($this->FMDebug, \"packEnableDebuggerTag\");\n\n\t\t$TagID = 58;\n\n\t\tif (!($Password == \"\")) {\n\n\t\t\t$Password = $this->packSTRING(bin2hex(mhash(MHASH_MD5, $Password)));\n\t\t}\n\n\t\t$TagLength = strlen($Password);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function assetTypes(): array\n {\n $assets = [];\n\n foreach ($this->read(['swf', 'tags', 'item']) as $item) {\n // @todo add other tags\n switch ((string) $item['type']) {\n case 'DefineShapeTag':\n case 'DefineShape2Tag':\n case 'DefineShape3Tag':\n $assets[(int) $item['shapeId']] = Export::ITEM_TYPE_SHAPE;\n break;\n\n case 'DefineSpriteTag':\n $assets[(int) $item['spriteId']] = Export::ITEM_TYPE_SPRITE;\n break;\n\n case 'DefineSoundTag':\n $assets[(int) $item['soundId']] = Export::ITEM_TYPE_SOUND;\n break;\n\n case 'DefineBitsJPEG3Tag':\n $assets[(int) $item['characterID']] = Export::ITEM_TYPE_IMAGE;\n break;\n }\n }\n\n return $assets;\n }", "public function getAssetsUrl()\n\t{\n\t\tif($this->_assetsUrl===null)\n\t\t{\n\t\t\t$this->_assetsUrl=Yii::app()->getAssetManager()->publish(\n\t\t\t\tYii::getPathOfAlias('application.modules.'.$this->moduleName.'.assets'),\n\t\t\t\tfalse,\n\t\t\t\t-1,\n\t\t\t\tYII_DEBUG\n\t\t\t);\n\t\t}\n\n\t\treturn $this->_assetsUrl;\n\t}", "private function getBasketScriptPlugins() {\n JPluginHelper::importPlugin('easysdi_basket_script');\n $app = JFactory::getApplication();\n //get scripts\n $scripts = $app->triggerEvent('getBasketScript');\n\n //Return merged scripts\n return implode(\"\\n\", $scripts);\n }", "protected function getAssetsUrl()\n {\n if (isset($this->_assetsUrl))\n return $this->_assetsUrl;\n else\n {\n $assetsPath = Yii::getPathOfAlias('labScript');\n $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG);\n return $this->_assetsUrl = $assetsUrl;\n }\n }" ]
[ "0.68038225", "0.5575776", "0.5495437", "0.5119418", "0.5098945", "0.50776166", "0.49796173", "0.49565247", "0.48216647", "0.4810379", "0.47540522", "0.47521856", "0.47521856", "0.47318733", "0.46845597", "0.4663907", "0.4627472", "0.46249375", "0.46182647", "0.458258", "0.45523182", "0.4547659", "0.45264238", "0.45036483", "0.44992962", "0.4491542", "0.4481836", "0.44815353", "0.4481088", "0.4470921" ]
0.7704485
0
string packEnableDebuggerTag(string Password) returns an SWF EnableDebugger tag string. TagID: 58
function packtectEnableDebuggerTag($Password) { array_push($this->FMDebug, "packEnableDebuggerTag"); $TagID = 58; if (!($Password == "")) { $Password = $this->packSTRING(bin2hex(mhash(MHASH_MD5, $Password))); } $TagLength = strlen($Password); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packProtectTag($Password)\n\t{\n\t\tarray_push($this->FMDebug, \"packProtectTag\");\n\n\t\t$TagID = 24;\n\n\t\tif (!($Password == \"\")) {\n\n\t\t\t$Password = $this->packSTRING(bin2hex(mhash(MHASH_MD5, $Password)));\n\t\t}\n\n\t\t$TagLength = strlen($Password);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "protected function registerTag(): string\n {\n return 'var';\n }", "public function enableDebug();", "public function debug()\n {\n add_settings_field(\n 'debug',\n apply_filters($this->plugin_name . 'label-debug', esc_html__('Debug', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable debug at the bottom of your security.txt file & this page.',\n 'id' => 'debug',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['debug']) ? $this->options['debug'] : false,\n ]\n );\n }", "public function getHookDebugInfo()\n\t{\n\t\t$parts = array();\n\t\tforeach($this->_hook_templates as $position => $hook)\n\t\t\t$parts[] = '<strong>' . $position . ':</strong> ' . implode(', ', $hook);\n\n\t\treturn !empty($parts) ? ('<span style=\"font-size:1.1em;color:red;\"><strong>Hook templates:</strong></span><br>' . implode('<br>', $parts)) : '';\n\t}", "public function enableDebugMode() {}", "public function enableDebug() {}", "static function debug_only_SigStr ( $strScriptName, $arrParams, $strSecretKey ) {\n\t\treturn self::makeSigStr($strScriptName, $arrParams, $strSecretKey);\n\t}", "protected function getTemplate_Twig_Extensions_DebugService()\n {\n return $this->services['template.twig.extensions.debug'] = new \\Twig_Extension_Debug();\n }", "public static function option_neopress_password() {\n printf(\n '<input type=\"password\" id=\"neopress_password\" name=\"neopress_password\" value=\"%s\" />',\n get_option('neopress_password')\n );\n }", "public function getPluginName() : string\n {\n return \"CryptPad\";\n }", "protected function getTSDebugModule() {}", "public function _varEncoder() {\n do $shortId = Packer::encode52($this->count++);\n while (preg_match('/[^\\\\w$.]'.$shortId.'[^\\\\w$:]/', $this->script));\n return $shortId;\n }", "function print_debug($content, $tag) {\n $output = '<span style=\"display:none\" id=\"';\n $output .= $tag;\n $output .= '\">';\n print_r($output);\n print_r($content);\n print_r('</span>');\n}", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "public function olvidoPassword(){\n\t}", "function packFrameLabelTag($Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packFrameLabelTag\");\n\n\t\t$TagID = 43;\n\t\t$Label = $this->packSTRING($Label);\n\t\t$TagLength = strlen($Label);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function action_attach_tags_print_fields() {\n\t\techo '<tr ',helper_alternate_class(),'><td class=\"category\">',lang_get('tag_attach_long'),'</td><td>';\n\t\tprint_tag_input();\n\t\techo '<input type=\"submit\" class=\"button\" value=\"' . lang_get( 'tag_attach' ) . ' \" /></td></tr>';\n\t}", "public static function debug_only_SigStrXML ( $strScriptName, $xml, $strSecretKey )\n\t{\n\t\t$arrFlatParams = self::makeFlatParamsXML($xml);\n\t\treturn self::makeSigStr($strScriptName, $arrFlatParams, $strSecretKey);\n\t}", "protected function getDebugKey()\n {\n return 'fitch.manager.report';\n }", "public function get_debug_flag()\n {\n }", "function getFieldPassword(){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_password');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_password');\n\t\t$tooltip = setToolTipNotification('password');\t\t\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.\"<span class='red'>*</span>\".$tooltip.\"</label><br><input type='password' name='newpassword' value='' class='' id='password'></br><div id='password_err_con'></div>\";\t\t\n\t\t}\n\t\treturn $form_ret;\n\t}", "function capstone_registraion_message( $msg ) {\n return $msg . do_shortcode('[wppb-login]');\n }", "function DecodeUpdatePassFlag($Code){\r\n\tif($Code == 1){\r\n\t\treturn(\"Old Password or New Password is <font color=red>Missing!</font>\");\r\n\t}else if($Code == 2){\r\n\t\treturn(\"Old Password is <font color=red>Incorrect!</font>\");\r\n\t}else if($Code == 3){\r\n\t\treturn(\"Old Password and New Password <font color=red>Can't be same!</font>\");\r\n\t}else if($Code == 4){\r\n\t\treturn(\"Length of the <br>New Passwords must be <font color=red>greater than 8!</font>\");\r\n\t}else if($Code == 5){\r\n\t\treturn(\"Length of the <br>New Passwords must not be <font color=red>greater than 15!</font>\");\r\n\t}else if($Code == 6){\r\n\t\treturn(\"Your New Password has been <font color=darkgreen>Saved!</font>\");\r\n\t}else if($Code == 7){\r\n\t\treturn(\"Your New Passwords <font color=red>Didn't match!</font>\");\r\n\t}\r\n}", "public function getDebug();", "public function tag()\n\t{\n\t\t/* Example usage:\n\t\t{exp:crush:tag \n\t\t\tfilename=\"/_assets/css/style.css\"\n\t\t\tminify=\"y\"\n\t\t\tvars=\"my_var1=#333|my_var2=20px\"\n\t\t\tattributes=\"media=print|title=monkey\"\n\t\t} \n\t\t*/\n\t\treturn csscrush_tag(\n\t\t\t$this->filename, \n\t\t\t$this->get_params(FALSE, array('filename', 'attributes')),\n\t\t\t$this->attributes\n\t\t);\n\n\t}", "protected function getInstallToolPasswordStatus() {}", "function enableDebug($debug = true, $html = false) {\n $this->debug = $debug;\n $this->htmldebug = $html;\n }" ]
[ "0.6540024", "0.5196964", "0.4894729", "0.47460717", "0.46655622", "0.4607652", "0.45466495", "0.4540415", "0.4539945", "0.44793922", "0.4451075", "0.4428611", "0.44030282", "0.43906012", "0.43902397", "0.43717793", "0.43717793", "0.4361645", "0.4352964", "0.43300277", "0.43115878", "0.43013388", "0.42970008", "0.4295991", "0.42876634", "0.42769235", "0.42635947", "0.42413476", "0.42399812", "0.42063648" ]
0.8234864
0
string packDefineBitsPtrTag(integer Pointer) returns an SWF DefineBitsPtr tag string. TagID:1023
function packDefineBitsPtrTag($Pointer) { array_push($this->FMDebug, "packDefineBitsPtrTag"); $TagID = 1023; $TagLength = strlen($this->packUI32($Pointer)); $this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}", "function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}", "function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}", "function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}", "public function getBits();", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function packFrameLabelTag($Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packFrameLabelTag\");\n\n\t\t$TagID = 43;\n\t\t$Label = $this->packSTRING($Label);\n\t\t$TagLength = strlen($Label);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}", "function init()\n {\n\n $this->setTag(0x05, \"CTCap\"); // 0x00\n $this->setTag(0x06, \"CTType\"); // 0x00\n $this->setTag(0x07, \"DataStore\"); // 0x00\n $this->setTag(0x08, \"DataType\"); // 0x00\n $this->setTag(0x09, \"DevID\"); // 0x00\n $this->setTag(0x0a, \"DevInf\"); // 0x00\n $this->setTag(0x0b, \"DevTyp\"); // 0x00\n $this->setTag(0x0c, \"DisplayName\"); // 0x00\n $this->setTag(0x0d, \"DSMem\"); // 0x00\n $this->setTag(0x0e, \"Ext\"); // 0x00\n $this->setTag(0x0f, \"FwV\"); // 0x00\n $this->setTag(0x10, \"HwV\"); // 0x00\n $this->setTag(0x11, \"Man\"); // 0x00\n $this->setTag(0x12, \"MaxGUIDSize\"); // 0x00\n $this->setTag(0x13, \"MaxID\"); // 0x00\n $this->setTag(0x14, \"MaxMem\"); // 0x00\n $this->setTag(0x15, \"Mod\"); // 0x00\n $this->setTag(0x16, \"OEM\"); // 0x00\n $this->setTag(0x17, \"ParamName\"); // 0x00\n $this->setTag(0x18, \"PropName\"); // 0x00\n $this->setTag(0x19, \"Rx\"); // 0x00\n $this->setTag(0x1a, \"Rx-Pref\"); // 0x00\n $this->setTag(0x1b, \"SharedMem\"); // 0x00\n $this->setTag(0x1c, \"Size\"); // 0x00\n $this->setTag(0x1d, \"SourceRef\"); // 0x00\n $this->setTag(0x1e, \"SwV\"); // 0x00\n $this->setTag(0x1f, \"SyncCap\"); // 0x00\n $this->setTag(0x20, \"SyncType\"); // 0x00\n $this->setTag(0x21, \"Tx\"); // 0x00\n $this->setTag(0x22, \"Tx-Pref\"); // 0x00\n $this->setTag(0x23, \"ValEnum\"); // 0x00\n $this->setTag(0x24, \"VerCT\"); // 0x00\n $this->setTag(0x25, \"VerDTD\"); // 0x00\n $this->setTag(0x26, \"XNam\"); // 0x00\n $this->setTag(0x27, \"XVal\"); // 0x00\n $this->setTag(0x28, \"UTC\"); // 0x00\n $this->setTag(0x29, \"SupportNumberOfChanges\"); // 0x00\n $this->setTag(0x2a, \"SupportLargeObjs\"); // 0x00\n $this->setTag(0x2b, \"Property\"); // 0x00\n $this->setTag(0x2c, \"PropParam\"); // 0x00\n $this->setTag(0x2d, \"MaxOccur\"); // 0x00\n $this->setTag(0x2e, \"NoTruncate\"); // 0x00\n $this->setTag(0x30, \"Filter-Rx\"); // 0x00\n $this->setTag(0x31, \"FilterCap\"); // 0x00\n $this->setTag(0x32, \"FilterKeyword\"); // 0x00\n $this->setTag(0x33, \"FieldLevel\"); // 0x00\n $this->setTag(0x34, \"SupportHierarchicalSync\"); // 0x00\n\n if ($this->version == 1) {\n $this->setCodePage(0, DPI_DTD_DEVINF_1_1, 'syncml:devinf1.1');\n $this->setURI('syncml:devinf1.1');\n } elseif ($this->version == 2) {\n $this->setCodePage(0, DPI_DTD_DEVINF_1_2, 'syncml:devinf1.2');\n $this->setURI('syncml:devinf1.2');\n } else {\n $this->setCodePage(0, DPI_DTD_DEVINF_1_0, 'syncml:devinf1.0');\n $this->setURI('syncml:devinf1.0');\n }\n }", "function packRECORDHEADER($TagID, $TagLength)\n\t{\n\t\tarray_push($this->FMDebug, \"packRECORDHEADER\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_short_tag_limit = 62;\n\t\t$upper_long_tag_limit = 2147483647;\n\n \tif (!(is_integer($TagLength))) {\n\n \t$this->FMError(\"packRECORDHEADER argument (TagLength) not an integer\");\n \t}\n\n \tif ($TagLength < $lower_limit) {\n\n \t$this->FMError(\"packRECORDHEADER argument (TagLength) negative\");\n \t}\n\n \tif ($TagLength > $upper_short_tag_limit) {\n\n\t\t\tif ($TagLength > $upper_long_tag_limit) {\n\n \t\t$this->FMError(\"packRECORDHEADER argument (TagLength) out of range\");\n\t\t\t} else {\n\n\t\t\t\t$atom = $TagID << 6;\n\t\t\t\t$atom += 0x3f;\n\t\t\t\t$atom = $this->packUI16($atom);\n\t\t\t\t$atom .= $this->packUI32($TagLength);\n\t\t\t}\n \t} else {\n\n\t\t\t$atom = $TagID << 6;\n\t\t\t$atom += $TagLength;\n\t\t\t$atom = $this->packUI16($atom);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function pack_p($value) {\n $first_half = pack('V', $value & 0xffffffff);\n $second_half = pack('V', ($value >> 32) & 0xffffffff);\n\n return $first_half . $second_half;\n}", "public function getBits(): int;", "function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function newFeatureFlagCreateStruct(): CreateStruct;", "function hd($fp)\n{\n\t$val = unpack(\"I\", fread($fp, 4));\n\t//print_r($val);\texit -1;\n\treturn \"0x\".dechex($val[1]);\n}", "function packPlaceObjectTag($CharacterID, $Depth, $MATRIX, $CXFORM)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObjectTag\");\n\n\t\t$TagID = 4;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16($Depth);\n\t\t$TagLength = strlen($CharacterID . $Depth . $MATRIX . $CXFORM);\n\t\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth . $MATRIX . $CXFORM;\n\n\t\tarray_pop($this->FMDebug);\n\t}", "function xlsWriteLabel($Row, $Col, $Value ) {\r\n$L = strlen($Value);\r\necho pack(\"ssssss\", 0x204, 8 + $L, $Row, $Col, 0x0, $L);\r\necho $Value;\r\nreturn;\r\n}", "public static function png32()\n {\n return new FlagQualifier(self::PNG32);\n }", "function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}" ]
[ "0.67949736", "0.62178737", "0.6178024", "0.6099532", "0.5660042", "0.5378978", "0.5332772", "0.524065", "0.49796125", "0.49796125", "0.49796125", "0.49656093", "0.49511352", "0.49487367", "0.48229802", "0.48217705", "0.47123474", "0.4703975", "0.46755525", "0.46572667", "0.46084654", "0.45916957", "0.45675844", "0.45106652", "0.44752568", "0.44543082", "0.44427842", "0.4430178", "0.44191936", "0.43970653" ]
0.8312091
0
string packMacromediaFlashSWFHeader() returns the Macromedia Flash SWF Header string.
function packMacromediaFlashSWFHeader() { array_push($this->FMDebug, "packMacromediaFlashSWFHeader"); $HeaderLength = 21; $atom = "FWS"; $atom .= $this->packUI8((int)$this->SWFVersion); $atom .= $this->packUI32($HeaderLength + strlen($this->MovieData)); $Xmin = (int)$this->FrameSize["Xmin"]; $Xmax = (int)$this->FrameSize["Xmax"]; $Ymin = (int)$this->FrameSize["Ymin"]; $Ymax = (int)$this->FrameSize["Ymax"]; if (min($Xmax, $Ymax) < 360) { $this->FMError("packMacromediaFlashSWFHeader movie frame too small"); } if (max($Xmax, $Ymax) > 57600) { $this->FMError("packMacromediaFlashSWFHeader movie frame too large"); } $Xmin = $this->packUBchunk($Xmin); $Xmax = $this->packUBchunk($Xmax); $Ymin = $this->packUBchunk($Ymin); $Ymax = $this->packUBchunk($Ymax); $nBits = 16; $Xmin = str_repeat("0", ($nBits - strlen($Xmin))) . $Xmin; $Xmax = str_repeat("0", ($nBits - strlen($Xmax))) . $Xmax; $Ymin = str_repeat("0", ($nBits - strlen($Ymin))) . $Ymin; $Ymax = str_repeat("0", ($nBits - strlen($Ymax))) . $Ymax; $RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax; $atom .= $this->packBitValues($RECT); $atom .= $this->packFIXED8((float)$this->FrameRate); $atom .= $this->packUI16((int)$this->FrameCounter); $this->MovieData = $atom . $this->MovieData; array_pop($this->FMDebug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static final function getJSSHeader () {\r\n $jssHeaderString = new S;\r\n $jssReplaceString = new S ('[%SCRIPT_JS_SRC%]');\r\n $jssPureString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_js.tp');\r\n foreach (self::$objPageJSS as $k => $v) {\r\n $jssHeaderString->appendString (str_replace ($jssReplaceString->toString (),\r\n self::$objPageJSS[$k], $jssPureString->toString ()));\r\n }\r\n // Do return ...\r\n return $jssHeaderString;\r\n }", "public function getHeaderString() {\n return $this->getPayload(FALSE);\n }", "protected function dumpHeader() {\n\t\treturn trim('\n# TYPO3 Extension Manager dump 1.1\n#\n#--------------------------------------------------------\n');\n\t}", "protected function makeMimeVersionHeaderString() {\n\t\treturn $this->_mailMimeVersion . $this->_endString;\n\t}", "public function compileHeader()\r\r\n {\r\r\n $header = [];\r\r\n foreach($this->requestHeaders as $k => $v) {\r\r\n $header[] = $k . ': ' . $v;\r\r\n }\r\r\n\r\r\n return implode(\"\\r\\n\", $header);\r\r\n }", "private function buildHeaderString()\n {\n $out = '';\n foreach($this->headers as $header => $value) {\n $out .= \"$header: $value\\r\\n\";\n }\n return $out;\n }", "public function getHeaderString () {\n\t\t$headers = array();\n\t\tforeach ($this->_headers as $name => $value) {\n\t\t $headers[] = $name . \": \" . $value;\n\t\t}\n\t\treturn implode(\"\\r\\n\", $headers);\n\t}", "protected function makeFileContentTransferEncodingHeaderString() {\n\t\treturn 'Content-transfer-encoding: ' . $this->_mailFileContentTransferEncoding . $this->_endString;\n\t}", "function media_upload_header()\n {\n }", "public function getHeader()\n {\n return <<<EOF\n<info>\nWW WW UU UU RRRRRR FFFFFFF LL \nWW WW UU UU RR RR FF LL \nWW W WW UU UU RRRRRR FFFF LL \n WW WWW WW UU UU RR RR FF LL \n WW WW UUUUU RR RR FF LLLLLLL \n \n</info>\n\nEOF;\n\n}", "public function getHeader() {\n\t\tif (!empty($this->header)) {\n\t\t\t$this->header = preg_replace('%(\\r\\n|\\r|\\n)%', self::$crlf, $this->header);\n\t\t}\n\t\t\n\t\t$this->header .=\n\t\t\t'X-Priority: 3'.self::$crlf\n\t\t\t.'X-Mailer: WoltLab Community Framework Mail Package'.self::$crlf\t\t\t\t\t\t\t\t\t\n\t\t\t.'MIME-Version: 1.0'.self::$crlf\n\t\t\t.'From: '.$this->getFrom().self::$crlf\n\t\t\t.($this->getCCString() != '' ? 'CC:'.$this->getCCString().self::$crlf : '')\n\t\t\t.($this->getBCCString() != '' ? 'BCC:'.$this->getBCCString().self::$crlf : '');\t\t\t\t\t\n\t\t\t\n\t\tif (count($this->getAttachments())) {\n\t\t\t$this->header .= 'Content-Transfer-Encoding: 8bit'.self::$crlf;\n\t\t\t$this->header .= 'Content-Type: multipart/mixed;'.self::$crlf;\n\t\t\t$this->header .= \"\\tboundary=\".'\"'.$this->getBoundary().'\";'.self::$crlf;\n\t\t}\n\t\telse {\n\t\t\t$this->header .= 'Content-Transfer-Encoding: 8bit'.self::$crlf;\n\t\t\t$this->header .= 'Content-Type: '.$this->getContentType().'; charset='.CHARSET.self::$crlf;\n\t\t}\n\t\t\n\t\treturn $this->header;\n\t}", "protected function assembleHeaders(){\n\t\t$finalHeader = array();\n\t\tforeach($this->headers as $header => $value){\n\t\t\t$finalHeader[] = sprintf(\"%s: %s\", ucwords($header), trim($value));\n\t\t}\n\t\treturn implode(\"\\r\\n\", $finalHeader);\n\t}", "public function buildHeader($object = null): string\n {\n $characters = $this->getControlCharacters();\n\n return $characters['header']['start']['string'].\n $characters['prefix']['start']['string'].\n $this->getPrefix().\n $characters['prefix']['stop']['string'].\n $characters['field']['start']['string'].\n 'version'.\n $characters['field']['delimiter']['string'].\n self::getVersionForPrefix().\n $characters['field']['stop']['string'].\n (is_null($object) ? '' :\n $characters['field']['start']['string'].\n 'type'.\n $characters['field']['delimiter']['string'].\n gettype($object).'['.(is_object($object) ? get_class($object) : 'native').']'.\n $characters['field']['stop']['string']\n ).\n $characters['header']['stop']['string'];\n }", "public function getHeaderConcatPayloadString()\n {\n return $this->header->toBase64String() . \".\" . $this->payload->toBase64String();\n }", "public function buildHeader ()\n {\n $header = array();\n foreach ($this->header as $param => $value) {\n if ($value != \"\") {\n array_push($header, $param . ': ' . $value);\n }\n }\n return $header;\n }", "private static final function getMetaTAGHeader () {\r\n $tagMetaHeaderString = new S;\r\n $tagMetaPureString = new FileContent (FORM_TP_DIR . _S . 'frm_web_head_meta.tp');\r\n foreach (self::$objMetaTAG as $k => $v) {\r\n $tagMetaHeaderString->appendString (str_replace (array ('[%META_NAME_REPLACE%]', '[%META_CONTENT_INFO%]'),\r\n array (self::$objMetaTAG[$k]['name'], self::$objMetaTAG[$k]['info']), $tagMetaPureString));\r\n }\r\n // Do return ...\r\n return $tagMetaHeaderString;\r\n }", "protected function makeHeader()\n {\n $header = '';\n foreach(self::$headers as $k => $v) {\n $header .= $k . \": \" . $v . \"\\r\\n\";\n }\n\n return $header;\n }", "private function getXMLHeader() {\n\t\treturn '<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>' . \"\\n\";\n\t}", "public function build()\n {\n # Fixed Header\n # Control Packet Type\n $cmd = $this->getMessageType() << 4;\n\n $cmd |= ($this->reserved_flags & 0x0F);\n\n $header = chr($cmd) . $this->remaining_length_bytes;\n\n $header .= $this->buildVariableHeader();\n\n return $header;\n }", "public function get_header() {\n $this->do_header();\n return $this->c_header;\n }", "public function getHeader(string $header): string;", "function getHeader()\n {\n return (string) $this->_sHeader;\n }", "function getHeader()\n {\n return (string) $this->_sHeader;\n }", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "public function get_header() {\n\t\tif (!isset($this->header)) {\n\t\t\t$this->get_array();\n\t\t}\n\t\treturn $this->header;\n\t}", "private function getParamHeader()\n {\n $header = $this->getMenuParams()->get( 'header', '' );\n return (string)$header;\n }", "function showHeader(){\n\t\t$header = \"\";\n\t\t// print the header row\n\t\t$header .= \"\t<tr>\\n\";\n\t\t// loop the fields\n\t\tforeach ($this->fields as $field) {\n\t\t\t// print each field\n\t\t\t$header .= \"\t\t<th>\".$field.\"</th>\\n\";\n\t\t}\n\t\t// end the header row\n\t\t$header .= \"\t</tr>\\n\";\n\t\treturn $header;\n\t}", "protected function makeTextHtmlContentTransferEncodingHeaderString() {\n\t\treturn 'Content-transfer-encoding: ' . $this->_mailTextHtmlContentTransferEncoding . $this->_endString;\n\t}", "function getHeader() {\n return '';\n }", "private function header2String($header)\n {\n $str = '';\n if (is_array($header)) foreach ($header as $k=>$v) {\n if (is_numeric($k)) continue;\n $str .= $k . ': ' . $v . \"\\r\\n\";\n } else {\n $str = $header;\n }\n return $str;\n }" ]
[ "0.59769243", "0.59733504", "0.57339144", "0.5698503", "0.5693121", "0.5649443", "0.56052876", "0.55942214", "0.55474174", "0.5489846", "0.54846", "0.5448855", "0.54063284", "0.53884536", "0.53661644", "0.53418547", "0.5339748", "0.5186478", "0.5175873", "0.5159014", "0.5147884", "0.5143929", "0.5143929", "0.5132963", "0.5126933", "0.5120182", "0.5117918", "0.5108444", "0.5107527", "0.5104546" ]
0.84248114
0
Creates and throws an exception after adding references to itself and the subject.
protected function assertionFailed($subject) { $exception = new BaseSpecUnsatisfiedException(); throw $exception->setSpec($this)->setSubject($subject); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addMissingJoins()\r\n {\r\n throw new Exception('This method is not yet implemented');\r\n \r\n return $this;\r\n }", "public function testAdd() {\n\t\t$data = $this->record;\n\t\tunset($data['CreditNote']['id']);\n\t\t$result = $this->CreditNote->add($data);\n\t\t$this->assertTrue($result);\n\t\t\n\t\ttry {\n\t\t\t$data = $this->record;\n\t\t\tunset($data['CreditNote']['id']);\n\t\t\t//unset($data['CreditNote']['title']);\n\t\t\t$result = $this->CreditNote->add($data);\n\t\t\t$this->fail('No exception');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->pass('Correct exception thrown');\n\t\t}\n\t\t\n\t}", "public function testConstructor()\n {\n $subject = $this->createInstance([\n '_initBaseException',\n '_construct',\n '_setSubject',\n ]);\n $_subject = $this->reflect($subject);\n $message = uniqid('message-');\n $code = rand(1, 99);\n $value = uniqid('out-of-range-value-');\n $previous = $this->createException(uniqid('previous-message'));\n\n $subject->expects($this->exactly(1))\n ->method('_initBaseException')\n ->with($message, $code, $previous);\n $subject->expects($this->exactly(1))\n ->method('_construct');\n $subject->expects($this->exactly(1))\n ->method('_setSubject')\n ->with($value);\n\n $subject->__construct($message, $code, $previous, $value);\n }", "public function raise() {\n throw $this;\n }", "public function testCreateSameDocException()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $doc = $db->create(array('a' => 1), 'mydoc');\n \n try { \n $doc = $db->create(array('a' => 1), 'mydoc');\n $this->_teardownDb();\n $this->fail(\"Expected Sopha_Db_Exception was not thrown\");\n } catch (Sopha_Db_Exception $e) {\n $this->_teardownDb();\n $this->assertEquals(409, $e->getCode(), \"HTTP error code is expected to be 412\");\n }\n }", "public function testSubscriberUnsetsItselfBeforeThrowningException(): void\n {\n $entityManager = $this->getEntityManager();\n\n // Create two providers\n $provider1 = $this->createProvider('provider1');\n $provider2 = $this->createProvider('provider2');\n\n // Create subscriber\n $instance = $this->createInstance($provider1);\n\n // Get event manager and bind subscriber\n $eventManager = $entityManager->getEventManager();\n $eventManager->addEventSubscriber($instance);\n\n // Create an invalid entity with the wrong provider\n $entity = new EntityHasProviderStub('entity', 'Acme Corp');\n $entity->setProvider($provider2);\n $entityManager->persist($entity);\n\n // Ensure subscriber is bound\n self::assertContains($instance, $eventManager->getListeners('onFlush'));\n\n // Flush changes which should thrown an exception\n try {\n $entityManager->flush();\n } /** @noinspection PhpRedundantCatchClauseInspection */ catch (InvalidEntityOwnershipException $exception) {\n // Ensure subscriber has unset itself\n self::assertNotContains($instance, $eventManager->getListeners('onFlush'));\n self::assertSame('', $exception->getMessage());\n\n // Return so the following failure doesn't happen\n return;\n }\n\n // If exception wasn't thrown, fail test\n self::fail(\\sprintf('Expected %s to be thrown but it did not happen', InvalidEntityOwnershipException::class));\n }", "final public function add(CtkBuildable $node) {\n\t\tthrow new CakeException('Cannot add children to node');\n\t}", "public function throwConflict()\n {\n throw new Exception\\ConflictException('Conflict', 1449131059);\n }", "function it_throws_for_duplicate_email()\n {\n $this->setExpectedException(\n DuplicateEntryException::class,\n \"Duplicate entry value '[email protected]' in field 'email' in '\" . get_class($this->repository) . \"'\"\n );\n\n $this->repository->save(new User(\n new Username('jane'),\n new Email('[email protected]')\n ));\n }", "final public function addChild ()\n {\n throw new ChildException('Trying to add child to self closing HTML element');\n }", "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "function AddSubject(\r\n\t\t\t$curriculum,\r\n\t\t\t$subject,\r\n\t\t\t$semester, //int\r\n\t\t\t$year_level, //int\r\n\t\t\t$prerequisites = null,\r\n\t\t\t$corequisites = null\r\n\t\t){\r\n\r\n\t\t\t$this->error = array();\r\n\r\n\t\t\t//clean input\r\n\t\t\tif($subject <= 0){\r\n\t\t\t\t$this->error[sizeof($this->error)] = \"Subject: Invalid Selection.\";\r\n\t\t\t}\r\n\r\n\t\t\tif($curriculum <= 0){\r\n\t\t\t\t$this->error[sizeof($this->error)] = \"Curriculum: Invalid Selection.\";\r\n\t\t\t}\r\n\r\n\t\t\tif($semester <= 0){\r\n\t\t\t\t$this->error[sizeof($this->error)] = \"Semester: Invalid Selection.\";\r\n\t\t\t}\r\n\r\n\t\t\tif($year_level <= 0){\r\n\t\t\t\t$this->error[sizeof($this->error)] = \"Year Level: Invalid Selection.\";\r\n\t\t\t}\r\n\r\n\t\t\t//remove -1 from the prerequisites\r\n\t\t\tif($prerequisites != null){\r\n\t\t\t\t$ctr = 0;\r\n\t\t\t\tforeach($prerequisites as $item){\r\n\t\t\t\t\tif($prerequisites == -1){\r\n\t\t\t\t\t\tunset($prerequisites[$ctr]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$ctr++;\r\n\t\t\t\t}\r\n\t\t\t\t$prerequisites = array_values($prerequisites);\r\n\t\t\t}\r\n\r\n\t\t\t//remove -1 from the corequisites\r\n\t\t\tif($corequisites != null){\r\n\t\t\t\t$ctr = 0;\r\n\t\t\t\tforeach($corequisites as $item){\r\n\t\t\t\t\tif($corequisites == -1){\r\n\t\t\t\t\t\tunset($corequisites[$ctr]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$ctr++;\r\n\t\t\t\t}\r\n\t\t\t\t$corequisites = array_values($corequisites);\r\n\t\t\t}\r\n\r\n\t\t\t//check if the prerequisite is same as the subject being added\r\n\t\t\tif($prerequisites != null){\r\n\t\t\t\t$test = false;\r\n\t\t\t\tforeach($prerequisites as $item){\r\n\t\t\t\t\tif($item == $subject && $test == false){\r\n\t\t\t\t\t\t$this->error[sizeof($this->error)] = \"Pre-requisite: Cannot be the same as the subject being added.\";\r\n\t\t\t\t\t\t$test = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//check if the corequisite is same as the subject being added\r\n\t\t\tif($corequisites != null){\r\n\t\t\t\t$test = false;\r\n\t\t\t\tforeach($corequisites as $item){\r\n\t\t\t\t\tif($item == $subject && $test == false){\r\n\t\t\t\t\t\t$this->error[sizeof($this->error)] = \"Co-requisite: Cannot be the same as the subject being added.\";\r\n\t\t\t\t\t\t$test = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$result = false;\r\n\r\n\t\t\tif(sizeof($this->error) == 0){\r\n\t\t\t\tif($this->conn == null){\r\n\t\t\t\t\t$this->error[sizeof($this->error)] = \"No defined connection.\";\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$conn = $this->conn;\r\n\r\n\t\t\t\t\t$query = \"INSERT INTO `sch-curriculum_subjects`(Curriculum, Subject, Semester, \";\r\n\t\t\t\t\t$query .= \"YearLevel, Created, Modified) \";\r\n\t\t\t\t\t$query .= \"VALUES({$curriculum}, {$subject}, {$semester}, {$year_level}, NOW(), NOW())\";\r\n\r\n\t\t\t\t\t$conn->query($query);\r\n\r\n\t\t\t\t\tif($conn->insert_id > 0){\r\n\t\t\t\t\t\t$result = true;\r\n\r\n\t\t\t\t\t\t//getting the latest_id found\r\n\t\t\t\t\t\t$latest_id = $conn->insert_id;\r\n\r\n\t\t\t\t\t\t//insert prerequisites to database\r\n\t\t\t\t\t\tforeach($prerequisites as $item){\r\n\t\t\t\t\t\t\techo \"Adding ID[\" . $latest_id . \"] & Item[\" . $item . \"]\";\r\n\t\t\t\t\t\t\t$this->AddPrerequisite($latest_id, $item);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//insert corequisites to database\r\n\t\t\t\t\t\tforeach($corequisites as $item){\r\n\t\t\t\t\t\t\techo \"Adding ID[\" . $latest_id . \"] & Item[\" . $item . \"]\";\r\n\t\t\t\t\t\t\t$this->AddCorequisite($latest_id, $item);\r\n\t\t\t\t\t\t\tvar_dump($this->error);\r\n\t\t\t\t\t\t}\r\n//\t\t\t\t\t\texit();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(strpos($conn->error, \"Duplicate entry\") !== false){\r\n\t\t\t\t\t\t\t$this->error[sizeof($this->error)] = \"Error adding subject to curriculum. Duplicate found!\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->error[sizeof($this->error)] = $conn->error;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn $result;\r\n\r\n\t\t}", "public function testThrowSomeThrows()\n {\n $game = $this->getGameSubject();\n $game->addThrow(5);\n }", "function add_exception($text) {\n $this->errors->add_msj($text);\n }", "public function addEmailReferrer(EmailReferencesInterface $node);", "public function add(Exception $exception, $source = NULL) {\n $this->_errors[] = array(\n 'exception' => $exception,\n 'source' => $source,\n );\n }", "public function setSubject($subject)\n {\n if( null !== $this->_subject ) {\n throw new Khcn_Model_Exception(\"The subject may not be set twice\");\n }\n\n if( !($subject instanceof Khcn_Model_Item_Abstract) ) {\n throw new Khcn_Model_Exception(\"The subject must be an instance of Khcn_Model_Item_Abstract\");\n }\n \n $this->_subject = $subject;\n return $this;\n }", "public function testCreatedException()\n {\n $this->expectException(DomainException::class);\n County::create('County One',0, 200);\n }", "public function testAddObjectException()\n {\n $src = __DIR__ . '/../_files/xsl/passthrough.xsl';\n $oCell = new Cell();\n $oCell->addObject($src);\n }", "public function putObjectThrowsExceptionsOnInvalidArguments() {\n\t\t$someObject = new \\F3\\FLOW3\\Fixture\\DummyClass();\n\t\t$exceptionsThrown = 0;\n\t\ttry {\n\t\t\t$this->objectRegistry->putObject(NULL, $someObject);\n\t\t} catch (\\Exception $exception) {\n\t\t\t$exceptionsThrown ++;\n\t\t}\n\t\ttry {\n\t\t\t$this->objectRegistry->putObject('DummyObject', 'no object');\n\t\t} catch (\\Exception $exception) {\n\t\t\t$exceptionsThrown ++;\n\t\t}\n\n\t\t$this->assertEquals(2, $exceptionsThrown, 'putObject() did not throw enough exceptions.');\n\t}", "protected function throwUnableToCreate()\n {\n throw new FilesystemException(\"Unable to create the file '{$this->path}'. A directory with the same path already exists.\");\n }", "public function testAppendToItself()\n {\n $model1 = Animal::findOne(1);\n \n $this->expectExceptionMessage('You cannot move node relevant or under itself');\n \n $model1->appendTo($model1);\n }", "public function testInvalidVirtualForeignKeys()\n {\n $this->specify(\n 'The Model::save with multiple virtual foreign keys and invalid entity',\n function () {\n $body = new Body();\n\n $body->head_1_id = null;\n $body->head_2_id = 999;\n\n // PDOException should'n be thrown\n expect($body->save())->equals(false);\n\n expect($body->getMessages())->count(1);\n expect($body->getMessages()[0]->getMessage())->equals('Second head does not exists');\n }\n );\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "public function create( $reporter = false, $text = false, $subject = false )\r\n {\r\n if ( $reporter == false || $text == false || $subject == false )\r\n {\r\n throw new Exception(__METHOD__.\" missing argument\");\r\n } \r\n \r\n // we dont have the id yet, its auto-generated, catch it when execing the db query\r\n $this->setId(-1);\r\n $this->reporter = $reporter;\r\n $this->text = $text;\r\n $this->subject = $subject;\r\n \r\n $dbhelper = DBHelper::getInstance();\r\n $dbLink = &$dbhelper->getLink();\r\n \r\n $dbReporter = mysqli_real_escape_string($dbLink, $reporter);\r\n $dbSubject = mysqli_real_escape_string($dbLink, $subject);\r\n unset($subject);\r\n \r\n $qry = \"INSERT INTO `tickets` (reporter, status, subject) VALUES ('\".$dbReporter.\"', \".TICKET_STATUS_NEW.\", '\".$dbSubject.\"')\";\r\n $result = $dbLink->query($qry);\r\n \r\n // add the new ticket to the database\r\n if ($result === false) \r\n {\r\n throw new Exception( __METHOD__.\" ERROR adding Ticket!\");\r\n } \r\n \r\n $this->setId($dbLink->insert_id); \r\n $this->time_created = time(); \r\n $this->loaded = true; \r\n $this->addMessage($reporter, $text); \r\n\r\n return $this->getId();\r\n }", "public function catchException()\n {\n // get the current exception\n $e = $this->getException();\n\n // throw a copy, with the original as the previous exception so that\n // we can see a full trace.\n $class = get_class($e);\n throw new $class($e->getMessage(), $e->getCode(), $e);\n }", "function act() {\n throw $this->exception;\n }", "public function addAttachment() {\n try {\n if (!($this->attachment instanceof Base_Model_ObtorLib_App_Core_Qualification_Entity_Attachment)) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception(\" Attachment Entity not initialized\");\n } else {\n $objAttachment = new Base_Model_ObtorLib_App_Core_Qualification_Dao_Attachment();\n $objAttachment->attachment = $this->attachment;\n return $objAttachment->addAttachment();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception($ex);\n }\n }", "public function testAddRelationshipWithInvalidName()\n {\n $this->document->addToData($parent = $this->schemaFactory->createResourceObject($this->getSchema(\n 'people',\n '123',\n ['firstName' => 'John', 'lastName' => 'Dow'],\n new Link('peopleSelfUrl/'), // self url\n [], // links for resource\n null // meta\n ), new stdClass(), false));\n\n $link = $this->schemaFactory->createRelationshipObject(\n 'self', // <-- 'self' is a reserved word and cannot be used as a name\n new stdClass(),\n [], // links\n ['some' => 'relationship meta'], // relationship meta\n true, // show data\n false // is root\n );\n\n $this->document->addEmptyRelationshipToData($parent, $link);\n }", "public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerWithReferenceThrowsException(): void\n {\n gc_collect_cycles();\n /** @var Promise<never> $promise */\n $promise = new Promise(function () {}, function () use (&$promise) {\n assert($promise instanceof Promise);\n throw new \\Exception('foo');\n });\n $promise->cancel();\n unset($promise);\n\n $this->assertSame(0, gc_collect_cycles());\n }" ]
[ "0.543054", "0.5322008", "0.5235444", "0.5166383", "0.5121852", "0.5105364", "0.5087425", "0.5046244", "0.50382173", "0.5003147", "0.50009036", "0.49504182", "0.49501312", "0.4947565", "0.4946039", "0.4939108", "0.49280357", "0.4925845", "0.4925502", "0.4920455", "0.49110526", "0.48842713", "0.4883704", "0.48814747", "0.48789054", "0.4839895", "0.48263818", "0.47967133", "0.47912657", "0.4787329" ]
0.5464803
0
Get project participents by their role
public function participantsByRole( $name ) { $results = array(); foreach ( $this->participants as $participant ) { foreach ($participant->roles as $role) { if( $participant->hasRole($name) ){ $results[] = $participant; } } } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getProjectRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT name\n FROM project_role\n\t\t\tWHERE name != 'Owner'\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function participants()\n {\n return $this->belongsToMany(User::class)->withPivot('project_role_id');\n }", "public function participants()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_PARTICIPANT)->get();\n }", "public function getMembers($project)\n {\n return $this->dao->select('*')->from(TABLE_TEAM)->where('type')->eq('project')->andWhere('id')->eq($project)->fetchGroup('role');\n }", "public function get_competitors(){\n $sql = \"SELECT DISTINCT * from members WHERE members.id IN \"\n .\"(SELECT competitorID FROM tournamentCompetitors WHERE tournamentID=$this->id)\";\n return Member::find_by_sql($sql);\n }", "public static function getPersonsByRole($role = false){\n $ccuc_status = CcucUserCompany::CCUC_STATUS_SYS;\n $sys_ccmp_id = Yii::app()->sysCompany->getActiveCompany();\n $sql = \" \n SELECT DISTINCT\n \n pprs_id,\n CONCAT(\n pprs_second_name,\n ' ',\n pprs_first_name\n ) full_name,\n pprs_second_name,\n pprs_first_name \n FROM\n AuthAssignment aa \n INNER JOIN `profiles` p \n ON aa.userid = p.user_id \n INNER JOIN pprs_person \n ON p.person_id = pprs_id \n INNER JOIN ccuc_user_company \n ON pprs_id = ccuc_person_id \n AND ccuc_ccmp_id = {$sys_ccmp_id} \n AND ccuc_status = '{$ccuc_status}' \n\n \"\n ;\n \n $where = '';\n if($role && !is_array($role)){\n $where = \" WHERE itemname = '{$role}' \";\n }\n\n if($role && is_array($role)){\n $where = \" WHERE itemname in ('\".implode(\"','\",$role).\"') \";\n }\n \n $sql .= $where . \" ORDER BY pprs_second_name,pprs_first_name \";\n\n return Yii::app()->db->createCommand($sql)->queryAll();\n \n }", "public function userProjects()\n {\n // Finding project for the user\n $projectsInvolved = ProjectMember::where('user_id', auth()->user()->id)->select('project_id')->get(); \n // Array to hold the project IDs\n $projectIDs = [];\n // Looping and storing priject Id's \n foreach ($projectsInvolved as $project) { \n array_push($projectIDs, $project->project_id);\n }\n return $projectIDs;\n }", "function getProjectUsersRoles($db, $user_id, $project_id) {\n global $PROJECT;\n $query = \"SELECT u.user_id, u.username, u.first_name, u.last_name, up.role \".\n \"FROM Users u INNER JOIN Users_Projects up ON u.user_id = up.user_id \".\n \"WHERE up.proj_id = ? AND (\".\n \"EXISTS (SELECT * FROM Users WHERE user_id = $user_id AND admin = 1) \".\n \"OR up.proj_id IN (SELECT proj_id FROM Users_Projects WHERE user_id = $user_id AND role = $PROJECT)\".\n \") ORDER BY u.username\";\n $stmt = prepareQuery($db, $query);\n bindParam($stmt, \"i\", $project_id);\n executeStatement($stmt);\n $results = $stmt->get_result();\n $users = array();\n while ($row = $results->fetch_assoc()) {\n $users[] = $row;\n }\n return $users;\n}", "public function members()\n {\n return $this->belongsToMany('\\App\\Model\\User', 'joined', 'idproject', 'iduser')->withPivot('role')->orderBy('role', 'ASC');\n }", "final public function getParticipants() {\n\n\t\t// all events\n\t\t$search = new MetaSearch($config);\n\t\t$search->setWebNameFilter('Main');\n\t\t$search->setFormNameFilter('EventForm');\n\t\t$search->executeQuery();\n\n\t\t$this->config->pushStrictMode(false);\n\t\tforeach($search->getResults() as $eventTopicName) {\n\t\t\t$topic = $this->topicFactory->loadTopicByName($eventTopicName);\n\t\t\t$event = new CiantEvent($topic);\n\n\t\t\t$collaborators = $event->getCollaborators();\n\t\t}\n\t\t$this->config->popStrictMode();\n\n//\t\t$list = array();\n//\t\tforeach($search->getResults() as $topicName) {\n//\t\t\t$topic = $db->loadTopicByName($topicName);\n//\t\t\t$event = new CiantEvent($topic);\n//\t\t\t$collab = $event->getCollaborators();\n//\t\t\tforeach($collab as $user) {\n//\t\t\t\tif($user instanceof CiantUser) {\n//\t\t\t\t\t$list[spl_object_hash($user)] = $user;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t\tforeach($list as $idx => $user) {\n//\t\t\tassert($user instanceof CiantUser);\n//\t\t\techo $user->getName().\", \";\n//\t\t}\n\t}", "public function getParticipants(): Collection;", "public function getParticipantUsers()\r\n {\r\n return $this->hasMany(User::class, ['id' => 'user_id'])->via('participants');\r\n }", "public function getProjectListForUserRole($role, $empNumber) {\n\t\treturn $this->projectDao->getProjectListForUserRole($role, $empNumber);\n\t}", "public static function ProjectsParticipants($participants_ids):array\n {\n $participants = User::whereIn('id', explode(',',$participants_ids))\n ->leftjoin('users_role','users_role.role_id','users.role_id')->get()->toArray();\n return $participants;\n }", "function getProjectRoles($db, $userId, $projId) {\n $query = \"SELECT role FROM Users_Projects WHERE user_id = ? AND proj_id = ?;\";\n $stmt = prepareQuery($db, $query);\n bindParam($stmt, \"ii\", $userId, $projId);\n executeStatement($stmt);\n $results = $stmt->get_result();\n $roles = array();\n while ($row = $results->fetch_assoc()) {\n $roles[$row['role']] = $row['role'];\n }\n return $roles;\n}", "public function projects()\n\t{\n\t\t$members = $this->hasMany('App\\Project_members', 'member_id', 'id')->get();\n\t\t$projects = new Collection();\n\n\t\tforeach ($members as $member) {\n\t\t\t$project = $member->project()->getResults();\n\n\t\t\tif ($project) {\n\t\t\t\t$projects->add ($project);\n\t\t\t}\n\t\t}\n\n\t\treturn $projects;\n\t}", "function get_users_from_role_on_context($role, $context) {\n\n global $CFG;\n\n return get_records_sql(\"SELECT *\n FROM {$CFG->prefix}role_assignments\n WHERE contextid = $context->id\n AND roleid = $role->id\");\n}", "public function findAllParticipants() {\n\n\t\t$stmt = $this->db->query(\"SELECT * FROM participaciones, usuarios WHERE usuarios.email = participaciones.email\");\n\t\t$participantes_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$participantes = array();\n\n\t\tforeach ($participantes_db as $participante) {\n\n\t\t\tarray_push($participantes, new Participante($participante[\"idEncuesta\"], $participante[\"email\"]));\n\t\t}\n\n\t\treturn $participantes;\n\t}", "public function findAllByEleveAndRole($eleves,$role) {\n \t$query = $this->createQueryBuilder('u');\n \tswitch ($role){\n \t\tcase 1:\n \t\t\t$codes = array();\n \t\t\tforeach($eleves as $eleve){\n \t\t\t\tforeach($eleve->getCours() as $cours)\n \t\t\t\t\t$codes[] = $cours->getParsedName('teacher_code');\n \t\t\t}\n \t\t\t$query\n \t\t\t\t->where('u.username IN (:codes)')\n\t\t\t \t->setParameter('codes', $codes);\n \t\tbreak;\n \t\tcase 4:\n \t\t\t$query\n \t\t\t\t->join('u.eleves_as_main_teacher', 'e', 'WITH', 'e.id IN (:eleves)')\n \t\t\t\t->setParameter('eleves', $eleves);\n \t\tbreak;\n \t}\n \t\n \t\n \treturn $query\n\t\t\t \t->groupBy('u')\n\t\t\t \t->orderBy('u.lastname')\n\t\t\t \t->getQuery()\n\t\t\t \t->getResult();\n }", "public function getProjects();", "public function recipients(){\n $user = User::whereHas('roles', function($q){\n $q->where('role_id', 3);\n })->get();\n\n return $user;\n }", "public function getMembersToInvite($projectId)\n {\n $select = $this->getTable()->select();\n $select->setIntegrityCheck(false)\n ->from(array('u' => 'job_user'), array('u.user_id', 'u.username', 'u.created_on', \n 'u.country', 'u.is_premium',\n 'u.profile_image', \n 'balance' => '(SELECT SUM(cb.balance) \n FROM job_credit_balance cb \n WHERE cb.user_id = u.user_id)'))\n ->joinLeft(array('pc' => 'job_primary_category'), \n 'u.primary_category_id = pc.primary_category_id', \n array('pc.category_title'))\n ->joinLeft(array('p'=>'job_project'), \n 'u.user_id = p.assigned_user_id AND p.project_status = \"closed\"', \n array('closed_projects' => 'COUNT(p.project_status)'))\n ->joinLeft(array('i'=>'job_invited'), \n 'i.user_id = u.user_id AND i.project_id = ' . $projectId, \n array('i.invited_id'))\n ->group('u.user_id')\n ->order('RAND()')\n ->limit(9, 0);\n $rowSets = $this->getTable()->fetchAll($select);\n\n $info = array();\n foreach($rowSets as $k => $row) {\n $user = new Application_Model_User();\n $user->setUserId($row->user_id);\n $user->setUsername($row->username);\n $user->setCreatedOn($row->created_on);\n $user->setCountry($row->country);\n $user->setIsPremium($row->is_premium);\n $user->setProfileImage($row->profile_image);\n $user->setUserWorked($row->closed_projects);\n $user->setBalance($row->balance);\n $user->setRating($this->getUserRating($row->balance));\n $user->setCustom($row->invited_id);\n $primaryCategory = new Application_Model_PrimaryCategory();\n $primaryCategory->setCategoryTitle($row->category_title);\n $user->setPrimaryCategory($primaryCategory);\n $info[] = $user;\n }\n \n return $info;\n }", "public function getProjectsDetails()\n {\n $em = $this->getEntityManager();\n $qb = $em->createQueryBuilder();\n $qb->select('p.pid,n.name,c.clientName,pp.phaseName,p.lifeCycleStatus,'\n . 'p.billingStatus,pu.userName,pu.id,p.createDate,p.startDate,'\n . 'p.endDate,p.projectStatus');\n $qb->from('Vlreleases\\UserBundle\\Entity\\Projects', 'p');\n $qb->leftJoin('p.user', 'pu');\n $qb->leftJoin('p.projectName', 'n');\n $qb->leftJoin('p.client', 'c');\n $qb->leftJoin('p.phase', 'pp');\n $result = $qb->getQuery()->getResult();\n \n return $result;\n }", "public function findProjectRolesForUser($user_id){\n\t\t\n\t\t$user = $this->findOneUser($user_id);\n\t\t\n\t\t$stmt = 'SELECT p FROM App\\Entity\\ProjectRole p WHERE p.user = ?1 GROUP BY p.name';\r\n\r\n\t\t$query = $this->em->createQuery($stmt);\r\n\t\t$query->setParameter(1, $user_id);\n\t\t//$query->setParameter(1, \\App\\Entity\\ProjectRole::PROJECT_ROLE_TYPE_CREATOR);\r\n\t\t\r\n\t\t$roles = $query->getResult();\n\t\t\n\t\t$arr = array();\n\t\tforeach($roles as $r){\n\t\t\t$arr[] = $r->name;\n\t\t}\n\t\t// sort array\n\t\tsort($arr);\n\t\treturn $arr;\n\t}", "function econsole_get_participants($econsoleid) {\r\n return false;\r\n}", "public function getParticipants($contestid);", "public function projects()\n {\n return $this->belongsToMany('App\\Project')->withPivot('role', 'title');\n }", "public function roles()\n {\n return $this->belongsToMany('App\\TeamRole', 'rc_member_role', 'member_id', 'role_id')->withTimestamps();\n }", "function groups_get_potential_members($courseid, $roleid = null, $orderby = 'lastname,firstname') {\n global $CFG;\n\n $context = get_context_instance(CONTEXT_COURSE, $courseid);\n $sitecontext = get_context_instance(CONTEXT_SYSTEM);\n $rolenames = array();\n $avoidroles = array();\n\n if ($roles = get_roles_used_in_context($context, true)) {\n\n $canviewroles = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context);\n $doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext);\n\n foreach ($roles as $role) {\n if (!isset($canviewroles[$role->id])) { // Avoid this role (eg course creator)\n $avoidroles[] = $role->id;\n unset($roles[$role->id]);\n continue;\n }\n if (isset($doanythingroles[$role->id])) { // Avoid this role (ie admin)\n $avoidroles[] = $role->id;\n unset($roles[$role->id]);\n continue;\n }\n $rolenames[$role->id] = strip_tags(role_get_name($role, $context)); // Used in menus etc later on\n }\n }\n\n $select = 'SELECT u.id, u.username, u.firstname, u.lastname, u.idnumber ';\n $from = \"FROM {$CFG->prefix}user u INNER JOIN\n {$CFG->prefix}role_assignments r on u.id=r.userid \";\n\n if ($avoidroles) {\n $adminroles = 'AND r.roleid NOT IN (';\n $adminroles .= implode(',', $avoidroles);\n $adminroles .= ')';\n } else {\n $adminroles = '';\n }\n\n // we are looking for all users with this role assigned in this context or higher\n if ($usercontexts = get_parent_contexts($context)) {\n $listofcontexts = '('.implode(',', $usercontexts).')';\n } else {\n $listofcontexts = '('.$sitecontext->id.')'; // must be site\n }\n\n if ($roleid) {\n $selectrole = \" AND r.roleid = $roleid \";\n } else {\n $selectrole = \" \";\n }\n\n $where = \"WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts)\n AND u.deleted = 0 $selectrole\n AND u.username != 'guest'\n $adminroles \";\n $order = \"ORDER BY $orderby \";\n\n return(get_records_sql($select.$from.$where.$order));\n\n}", "public function getRole();" ]
[ "0.66536534", "0.6471044", "0.63031524", "0.6241326", "0.61213475", "0.6006683", "0.5945565", "0.5920218", "0.5799913", "0.5746833", "0.56941366", "0.56920433", "0.567201", "0.5658763", "0.56494254", "0.55968237", "0.557736", "0.5534629", "0.55006313", "0.5486098", "0.54494256", "0.54157734", "0.5396009", "0.5391319", "0.53911644", "0.53898793", "0.53840446", "0.5380645", "0.53619415", "0.5343629" ]
0.70065963
0
Tests that an exception is thrown with an invalid token type
public function testExceptionThrownWithInvalidTokenType() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token('foo', 'bar', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testParseWithOneInvalidToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid token type \"integer\" at position 0');\n\n $this->parser->parse([0]);\n }", "public function testInvalidInputTypeException()\r\n\t{\r\n\t\tnew Delimiters(array(1));\r\n\t}", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function testAnotherInvalidSyntax(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_X, Grammar::T_X, Grammar::T_C]);\n }", "public function test_token_invalid() {\n\t\t$this->uri->rsegments[3] = 'b';\n\t\tset_valid_authorization();\n\t\t$out = run_action($this->c, 'token');\n\n\t\t$json = json_decode($out, true);\n\n\t\t$this->assertTrue($json['error']);\n\t\t$this->assertFalse(array_key_exists('opportunity', $json));\n\t\t$this->assertFalse(array_key_exists('opportunities', $json));\n\t}", "public function testX(): void\n\t{\n\t\t$this->expectException(\\InvalidArgumentException::class);\n\t\tnew Ex\\InvalidTypeException('foo', Type::STRING, []);\n\t}", "public function testInvalidTokenException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n (new ApiKeyAsBasicAuthUsernameEncoder())->encode(new JwtApiToken([]));\n }", "public function testInvalidToken()\n {\n $this->expectException(UsernameNotFoundException::class);\n $this->jwsService->shouldReceive('isValid')->with('token')->andReturn(false);\n\n $this->tokenProvider->loadUserByUsername('token');\n }", "public function testIsValidTypeInvalid()\n {\n $this->assertFalse($this->annotation->isValidType('INVALID'));\n }", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "private function _ensureExpectedValue($token, $expectedType) {}", "public function testGetByTokenFailsWithEmptyTokenId(): void\n {\n // Creates expectation.\n $this->expectException(\\InvalidArgumentException::class);\n\n // Performs test.\n $this->repository->getByToken('');\n }", "public static function makeTokenInvalid($user_id, $type)\n {\n }", "public function testValidateToken()\n {\n }", "public function testTokenReplacementEventInvalidReplacementException(): void {\n $metaData = $this->createMock(BubbleableMetadata::class);\n $event = new TokensReplacementEvent('test', ['token' => '[test:token]'], [], [], $metaData);\n\n $this->expectException(UnexpectedValueException::class);\n $event->setReplacementValue('test', 'token', NULL);\n }", "public function testInvalidToken()\n {\n $this->sessionInfo['logged_in'] = true;\n $this->sessionInfo['token'] = 'foo';\n\n $this->session($this->sessionInfo);\n\n $response = $this->call('GET', '/api/user');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }", "public function testGetMultipleInvalidTypeString(): void\n {\n $keyValuePairs = \"I like to party sometimes until four\";\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testAssertInvalidDataShouldRaiseException()\n {\n $this->expectException(ValidatorException::class);\n Validator::alphaNumeric('_')->length(1, 15)->noWhitespace()->assert('invalid username');\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testExceptionForInvalidToken()\n {\n $this->expectException(DomainException::class);\n\n $request = new ServerRequest();\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer this.is.invalid');\n\n $this->auth->getUser($request, $this->response);\n }", "protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <type> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n } \n }", "#[@test, @expect('lang.IllegalArgumentException')]\n public function expectedExceptionNotThrown() {\n throw new FormatException('');\n }", "public function testParseWithOneUnknownToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Unknown token \".\" at position 0');\n\n $this->parser->parse(['.']);\n }", "public function testSetInvalidToken(): void\n {\n // setup\n $this->testValidConnect();\n\n $data = [\n 'token' => ''\n ];\n\n $url = self::$serverPath . '/token/unexisting/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertObjectHasAttribute('message', $result);\n }", "public function testValidationCaseForNonPositiveOutputLength()\n {\n $generator = $this->getTokenGeneratorForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\LengthException::class);\n\n $generator->getTokenString(0);\n } else {\n $hasThrown = null;\n\n try {\n $generator->getTokenString(0);\n } catch (\\LengthException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testInvalidTokenToConstruct()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $slackAPIObject = new Webhook(null);\n }", "private function guessType(Token &$token) {\n\t\tif ($token->type == Token::T_TEXT) {\n\t\t\tif (is_numeric($token->value)) {\n\t\t\t\t$token->type = Token::T_NUMBER;\n\t\t\t\t$token->value = parseFloat($token->value);\n\t\t\t} else if (preg_match(\"/^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/\", $token->value)) {\n\t\t\t\t\t$token->type = Token::T_DATE;\n\t\t\t\t\t$date = \\DateTime::createFromFormat(\"d/m/Y\", $token->value, new \\DateTimeZone( 'Europe/Paris' ));\n\t\t\t\t\t$error = \\DateTime::getLastErrors();\n\t\t\t\t\tif ($error['error_count'] > 0) {\n\t\t\t\t\t\tthrow new \\Exception($error['errors'][0]);\n\t\t\t\t\t}\n\t\t\t\t\t$date->setTime(0, 0, 0);\n\t\t\t\t\t$token->value = $date;\n\t\t\t} else if ($token->value === 'true' || $token->value === 'false') {\n\t\t\t\t$token->type = Token::T_BOOLEAN;\n\t\t\t\t$token->value = $token->value === 'true';\n\t\t\t}\n\t\t}\n\t}", "public function testParseErrorException() {\n\t\t$file = $this->path . '/models/pirates_invalid.json';\n\t\t$this->expectException('/Failed to parse json file/');\n\t\t$result = Json::parse($file);\n\t}", "public function testFetchingResourceWithInvalidAthorizationType()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_URI);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // It will throw an Exception(InvalidArgumentException)\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_PASSWORD, $params);\n }", "public function testTokenReplacementEventWrongReplacementException(): void {\n $metaData = $this->createMock(BubbleableMetadata::class);\n $event = new TokensReplacementEvent('', [], [], [], $metaData);\n\n $this->expectException(UnexpectedValueException::class);\n $event->setReplacementValue('', '', '');\n }" ]
[ "0.74093974", "0.73690325", "0.6976732", "0.6929603", "0.6912837", "0.672132", "0.6706144", "0.6611967", "0.65875703", "0.65496457", "0.6487711", "0.64624673", "0.64623773", "0.64221865", "0.64026827", "0.6377794", "0.63699985", "0.6366228", "0.6325025", "0.6315404", "0.6295384", "0.6265815", "0.6234291", "0.6218306", "0.61934847", "0.61843896", "0.61837155", "0.6153718", "0.61518645", "0.61094177" ]
0.8194038
0
Tests that an exception is thrown nested comment
public function testExceptionThrownWithNestedComment() { $this->expectException(RuntimeException::class); $tokens = [ new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1), new Token(TokenTypes::T_EXPRESSION, 'foo', 1), new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1), new Token(TokenTypes::T_EXPRESSION, 'bar', 1), new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1), new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1) ]; $this->parser->parse($tokens); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "public function testExceptionThrownWithUnopenedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)]);\n }", "public function testException() {\r\n\t\t$phpcheckstyle = $GLOBALS['PHPCheckstyle'];\r\n\r\n\t\t$phpcheckstyle->processFiles(array(\r\n\t\t\t'./test/sample/unterminated_comment.php'\r\n\t\t));\r\n\r\n\t\t$errorCounts = $phpcheckstyle->getErrorCounts();\r\n\r\n\t\t$this->assertEquals(1, $errorCounts['error'], 'We expect 1 error');\r\n\t\t$this->assertEquals(0, $errorCounts['ignore'], 'We expect 0 ignored checks');\r\n\t\t$this->assertEquals(0, $errorCounts['info'], 'We expect 0 info');\r\n\t\t$this->assertEquals(0, $errorCounts['warning'], 'We expect 0 warnings');\r\n\t}", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testEditCommentError() {\n\t\tRolesControllerTest::login($this);\n\n\t\t//データ生成\n\t\t$frameId = '181';\n\t\t$blockId = '181';\n\t\t$blockKey = 'block_' . $blockId;\n\t\t$roomId = '1';\n\n\t\t$data = array(\n\t\t\t'Frame' => array('id' => $frameId),\n\t\t\t'Block' => array('id' => $blockId, 'key' => $blockKey, 'room_id' => $roomId),\n\t\t\t'RssReader' => array(\n\t\t\t\t'key' => 'rss_reader_1',\n\t\t\t\t'url' => APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml',\n\t\t\t\t'title' => 'Edit title',\n\t\t\t\t'summary' => 'Edit summary',\n\t\t\t\t'link' => 'http://example.com',\n\t\t\t),\n\t\t\t'Comment' => array('comment' => ''),\n\t\t\tsprintf('save_%s', NetCommonsBlockComponent::STATUS_DISAPPROVED) => '',\n\t\t);\n\n\t\t//テスト実行\n\t\t$ret = $this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/' . $frameId . '.json',\n\t\t\tarray(\n\t\t\t\t'method' => 'post',\n\t\t\t\t'data' => $data,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$result = json_decode($ret, true);\n\n\t\t$this->assertArrayHasKey('code', $result, print_r($result, true));\n\t\t$this->assertEquals(400, $result['code'], print_r($result, true));\n\t\t$this->assertArrayHasKey('name', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('error', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('validationErrors', $result['error'], print_r($result, true));\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}", "public function testBadlyClosedDocblock() {\n\t\t$info = Inspector::info(__METHOD__ . '()');\n\t\t$description = 'This docblock has an extra * in the closing element.';\n\t\t$this->assertEqual($description, $info['description']);\n\t\t$this->assertEqual('', $info['text']);\n\t}", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testGetOutOfBounds()\n {\n (new Dom($this->demoComment()))->get(1);\n }", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function testExceptionWithMessage()\n {\n throw new ThumbNotFoundException('Thumb not found!');\n }", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "public function testCreate()\n\t{\n\t\t$this->dispatchWithExpectedException(\"/comment/create\", 'Bootstrap_Service_Exception_Authorization');\n\t}", "public function test_getContentException() : void\n {\n $this->expectExceptionCode(PreParser::ERROR_CONTENT_ID_NOT_FOUND);\n\n PreParser::getContent(999);\n }", "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testException()\n {\n throw new Exception('This is not expected.');\n }", "public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}", "public function testThrowWithoutOffset() {\n\t\ttry {\n\t\t\tthrow new \\YapepBase\\Exception\\IndexOutOfBoundsException();\n\t\t\t$this->fail('Exception not thrown!');\n\t\t} catch (\\YapepBase\\Exception\\IndexOutOfBoundsException $e) {\n\t\t\t$this->assertNotEquals('', $e->getMessage(), 'Message is empty!');\n\t\t}\n\t}", "protected function report_comment_failure_message(){\r\n\t\treturn 'Sorry, the comment could not be reported.';\r\n\t}", "public function testInvalidContentData()\n {\n \t$response = $this->post('/post-comment', [\n \t\t'content' => null,\n\t\t\t'parent_id' => null,\n\t\t\t'post_id' => 1,\n\t\t\t'level' => 1\n \t]);\n\n \t$response->assertSessionHasErrors(['content'], $format = null, $errorBag = 'default');\n }", "public function testParsingComment()\n {\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n ];\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($commentNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testErrorMessage()\n {\n $this->throwErrorException();\n\n // test if code actually gets here\n $this->assertTrue(true);\n }", "function throwError($exceptionItem){\n\techo \"\n\t\n\t<p style='font-family:arial;color:red;font-size:20px;'> Error parsing : . $exceptionItem->error_message \n\t\n\t</p>\"; // catch this in the parse method and do $e->getMessage() to show it.\n\n\t//break; // try and break the current loop\n\n\n}", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testAddExeptionForIncorrectTag1()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->td();\n }", "public function testDebugMessage()\n {\n $this->throwDebugException();\n\n // test if code actually gets here\n $this->assertTrue(true);\n }" ]
[ "0.7824188", "0.77254105", "0.6786043", "0.65409124", "0.6483358", "0.6378809", "0.63694406", "0.6317472", "0.62431544", "0.61873937", "0.6184021", "0.6147874", "0.5916502", "0.58820504", "0.5810165", "0.5749824", "0.5738403", "0.57347554", "0.5728264", "0.5727684", "0.56960845", "0.5688037", "0.5683002", "0.56674814", "0.5664815", "0.56561154", "0.56254184", "0.5614467", "0.5607869", "0.5599121" ]
0.8011925
0
Tests that an exception is thrown nested directive
public function testExceptionThrownWithNestedDirective() { $this->expectException(RuntimeException::class); $tokens = [ new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1), new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1), new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1), new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1), new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1), new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1) ]; $this->parser->parse($tokens); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithNestedComment()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testAddExeptionForIncorrectTag1()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->td();\n }", "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testChangeTagException()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $tr = $table->tr();\n $th = $tr->setTag('th');\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function treeLevelConditionDoesNotMatchFaultyValue() {}", "public function treeLevelConditionDoesNotMatchFaultyValue() {}", "function throwError($exceptionItem){\n\techo \"\n\t\n\t<p style='font-family:arial;color:red;font-size:20px;'> Error parsing : . $exceptionItem->error_message \n\t\n\t</p>\"; // catch this in the parse method and do $e->getMessage() to show it.\n\n\t//break; // try and break the current loop\n\n\n}", "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testInvalidView() {\n $renderer = $this->container->get('renderer');\n $render_element = [\n '#type' => 'view',\n '#name' => 'invalid_view_name',\n '#embed' => FALSE,\n ];\n $this->expectException(ViewRenderElementException::class);\n $this->expectExceptionMessage(\"Invalid View name ({$render_element['#name']}) given.\");\n $renderer->renderRoot($render_element);\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function testAddExeptionForIncorrectTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->add('td');\n }", "public function testFinderRangeLifeErrors() {\n $this->setExpectedException('BadFunctionCallException');\n $this->Links->find('rangeLife');\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "public function getSubpartWithNameWithSpaceThrowsException() {\n\t\t$this->setExpectedException(\n\t\t\t'InvalidArgumentException',\n\t\t\t'The value of the parameter $key is not valid.'\n\t\t);\n\n\t\t$this->subject->processTemplate(\n\t\t\t'<!-- ###MY SUBPART### -->'\n\t\t\t\t.'Some text.'\n\t\t\t\t.'<!-- ###MY SUBPART### -->'\n\t\t);\n\n\t\t$this->subject->getSubpart('MY SUBPART');\n\t}", "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }", "public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "public function testProhibitsNestingNonNullInsideNonNull()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('Expected Int! to be a GraphQL nullable type.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n newNonNull(newNonNull(intType()));\n\n $this->addToAssertionCount(1);\n }", "public function testExceptionThrownWithUnopenedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)]);\n }", "public function test_invalidNestedContentCommands() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\n {code: \"ApacheVelocity\"}\n Some text here.\n {code}\n{code}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_UNESCAPED_NESTED_COMMAND,\n $parser->getCollection()\n );\n }", "public function testException()\n {\n throw new Exception('This is not expected.');\n }", "public function testThrowsExceptionOnInvalidAddXmlContent()\n {\n $parser = new Parser($this->createTwig());\n $parser->addXmlContent(\"Invalid XML\");\n }" ]
[ "0.7333149", "0.7164128", "0.62617064", "0.6134498", "0.607341", "0.60522354", "0.5877605", "0.5841158", "0.58274806", "0.5796665", "0.5796123", "0.57931745", "0.5736729", "0.5729015", "0.5694219", "0.5669147", "0.56121314", "0.55477333", "0.55284864", "0.55095106", "0.55040044", "0.54998505", "0.54734236", "0.5465182", "0.546315", "0.542409", "0.542381", "0.54203904", "0.54201496", "0.53582543" ]
0.7854701
0
Tests that an exception is thrown with an unclosed comment
public function testExceptionThrownWithUnclosedComment() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnopenedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)]);\n }", "public function testExceptionThrownWithNestedComment()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testBadlyClosedDocblock() {\n\t\t$info = Inspector::info(__METHOD__ . '()');\n\t\t$description = 'This docblock has an extra * in the closing element.';\n\t\t$this->assertEqual($description, $info['description']);\n\t\t$this->assertEqual('', $info['text']);\n\t}", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testException() {\r\n\t\t$phpcheckstyle = $GLOBALS['PHPCheckstyle'];\r\n\r\n\t\t$phpcheckstyle->processFiles(array(\r\n\t\t\t'./test/sample/unterminated_comment.php'\r\n\t\t));\r\n\r\n\t\t$errorCounts = $phpcheckstyle->getErrorCounts();\r\n\r\n\t\t$this->assertEquals(1, $errorCounts['error'], 'We expect 1 error');\r\n\t\t$this->assertEquals(0, $errorCounts['ignore'], 'We expect 0 ignored checks');\r\n\t\t$this->assertEquals(0, $errorCounts['info'], 'We expect 0 info');\r\n\t\t$this->assertEquals(0, $errorCounts['warning'], 'We expect 0 warnings');\r\n\t}", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "private function comment()\n {\n // Comments always begin with a / character.\n $this->nextOrFail('/');\n\n if ($this->currentByte === '/') {\n $this->inlineComment();\n } elseif ($this->currentByte === '*') {\n $this->blockComment();\n } else {\n $this->throwSyntaxError('Unrecognized comment');\n }\n }", "function parseComment()\r\n\t{\r\n\t\t$this->start = $this->reader->mark();\r\n\t\t// skip over the comment\r\n\t\t$stop = $this->reader->skipUntil('--%>');\r\n\t\tif (is_null($stop))\r\n\t\t{\r\n\t\t\tthrow_exception(new PhaseException('Comment not properly ended.'));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->reader->skipSpaces();\r\n\t\treturn '';\r\n\t}", "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "protected function _getComment ($data, $i) {\n $c = substr ($data, $i, 1);\n if ($c == '#') {\n\n # Shell comment\n $len = strcspn ($data, \"\\n\", $i);\n\n } else if ($c == '/') {\n\n # C or C++ comment\n $d = substr ($data, $i + 1, 1);\n if ($d == '/') {\n\n # C++ comment\n $len = strcspn ($data, \"\\n\", $i);\n\n } else if ($d == '*') {\n\n # C-style comment\n $pos = strpos ($data, '*/', $i);\n if ($pos !== false) {\n $len = $pos - $i + 2;\n } else {\n throw new Exception ('Unterminated comment');\n }\n\n } else {\n\n # Not a comment at all\n $len = 0;\n }\n\n } else {\n\n # Not a comment\n $len = 0;\n\n }\n return $len;\n }", "public function testSCAN_PATTERN_COMMENT() {\n\t\t$pattern = \\TYPO3\\TypoScript\\Core\\Parser::SCAN_PATTERN_COMMENT;\n\t\t$this->assertEquals(preg_match($pattern, '/* This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a block comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '# This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '// This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a double slash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, ' # This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start with preceeding whitespace.');\n\t\t$this->assertEquals(preg_match($pattern, '/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a single slash.');\n\t\t$this->assertEquals(preg_match($pattern, '*/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a comment block ending.');\n\t}", "public function testGetOutOfBounds()\n {\n (new Dom($this->demoComment()))->get(1);\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testParsingComment()\n {\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n ];\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($commentNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "private function readComment(): bool\n {\n $this->readWhitespace();\n if (!$this->readChar('#')) {\n return false;\n }\n $type = strpbrk($this->data[$this->position] ?? '', '~|,:.') ?: '';\n $this->position += strlen($type);\n // Only a single space might be optionally added\n $this->readChar(' ');\n switch ($type) {\n case '':\n $data = $this->readCommentString();\n $this->translation->getComments()->add($data);\n break;\n case '~':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception(\"Inconsistent use of #~{$this->getErrorPosition()}\");\n }\n $this->translation->disable();\n $this->isDisabled = true;\n break;\n case '|':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception('Cannot redeclare the previous comment #|, '\n . \"ensure the definitions are in the right order{$this->getErrorPosition()}\");\n }\n $this->inPreviousPart = true;\n $this->translation->setPreviousContext($this->readIdentifier('msgctxt'));\n $this->translation->setPreviousOriginal($this->readIdentifier('msgid', true));\n $this->translation->setPreviousPlural($this->readIdentifier('msgid_plural'));\n $this->inPreviousPart = false;\n break;\n case ',':\n $data = $this->readCommentString();\n foreach (array_map('trim', explode(',', trim($data))) as $value) {\n $this->translation->getFlags()->add($value);\n }\n break;\n case ':':\n $data = $this->readCommentString();\n foreach (preg_split('/\\s+/', trim($data)) as $value) {\n if (preg_match('/^(.+)(:(\\d*))?$/U', $value, $matches)) {\n $line = isset($matches[3]) ? intval($matches[3]) : null;\n $this->translation->getReferences()->add($matches[1], $line);\n }\n }\n break;\n case '.':\n $data = $this->readCommentString();\n $this->translation->getExtractedComments()->add($data);\n break;\n }\n\n return true;\n }", "protected function determineComment()\n {\n if (starts_with($this->source, '//')) {\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '#')) {\n log_warning('Using the # symbol for comments is deprecated');\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '/*')) {\n if (ends_with($this->source, '*/')) {\n return;\n }\n $this->isComment = true;\n } elseif (ends_with($this->source, '*/')) {\n $this->isComment = false;\n }\n }", "function isValidComment($comment) {\n\tunset($comment);\n\treturn true;\n}", "public function isComment() {}", "private function bogusCommentState() {\n $data = $this->characters('^>', $this->char);\n $this->emitToken(array(\n 'data' => $data,\n 'type' => self::COMMENT\n ));\n\n $this->char += strlen($data);\n\n /* Switch to the data state. */\n $this->state = 'data';\n\n /* If the end of the file was reached, reconsume the EOF character. */\n if($this->char === $this->EOF) {\n $this->char = $this->EOF - 1;\n }\n }", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function testEditCommentError() {\n\t\tRolesControllerTest::login($this);\n\n\t\t//データ生成\n\t\t$frameId = '181';\n\t\t$blockId = '181';\n\t\t$blockKey = 'block_' . $blockId;\n\t\t$roomId = '1';\n\n\t\t$data = array(\n\t\t\t'Frame' => array('id' => $frameId),\n\t\t\t'Block' => array('id' => $blockId, 'key' => $blockKey, 'room_id' => $roomId),\n\t\t\t'RssReader' => array(\n\t\t\t\t'key' => 'rss_reader_1',\n\t\t\t\t'url' => APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml',\n\t\t\t\t'title' => 'Edit title',\n\t\t\t\t'summary' => 'Edit summary',\n\t\t\t\t'link' => 'http://example.com',\n\t\t\t),\n\t\t\t'Comment' => array('comment' => ''),\n\t\t\tsprintf('save_%s', NetCommonsBlockComponent::STATUS_DISAPPROVED) => '',\n\t\t);\n\n\t\t//テスト実行\n\t\t$ret = $this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/' . $frameId . '.json',\n\t\t\tarray(\n\t\t\t\t'method' => 'post',\n\t\t\t\t'data' => $data,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$result = json_decode($ret, true);\n\n\t\t$this->assertArrayHasKey('code', $result, print_r($result, true));\n\t\t$this->assertEquals(400, $result['code'], print_r($result, true));\n\t\t$this->assertArrayHasKey('name', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('error', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('validationErrors', $result['error'], print_r($result, true));\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}", "private function bogusCommentState()\n {\n $data = $this->characters('^>', $this->char);\n $this->emitToken(\n array(\n 'data' => $data,\n 'type' => self::COMMENT\n )\n );\n\n $this->char += strlen($data);\n\n /* Switch to the data state. */\n $this->state = 'data';\n\n /* If the end of the file was reached, reconsume the EOF character. */\n if ($this->char === $this->EOF) {\n $this->char = $this->EOF - 1;\n }\n }", "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "protected function assertMissingDelimitation()\n {\n }", "public function test_to_see_if_comments_are_sanitized()\n {\n $this->put('/comment/1', InputSanitizerConstants::UNSANITIZED_COMMENT);\n\n $this->assertDatabaseMissing('comments', InputSanitizerConstants::UNSANITIZED_COMMENT);\n }" ]
[ "0.8512813", "0.79463416", "0.69787794", "0.697745", "0.68317044", "0.67106587", "0.6557647", "0.6534136", "0.63718706", "0.6269882", "0.6238174", "0.61979884", "0.6181462", "0.61533254", "0.610301", "0.6094877", "0.6027039", "0.59899086", "0.597574", "0.59711516", "0.5914579", "0.5911124", "0.5886367", "0.58560693", "0.5847636", "0.5798159", "0.57710385", "0.5747896", "0.5741032", "0.56900215" ]
0.8636078
0
Tests that an exception is thrown with an unclosed directive
public function testExceptionThrownWithUnclosedDirective() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "public function testExceptionThrownWithUnopenedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)]);\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testExceptionThrownWithNestedComment()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function test_validation_missingClosingCommand() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\nSome content here.\n{end}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertFalse($parser->isValid());\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG,\n $parser->getCollection()\n );\n }", "public function testBadlyClosedDocblock() {\n\t\t$info = Inspector::info(__METHOD__ . '()');\n\t\t$description = 'This docblock has an extra * in the closing element.';\n\t\t$this->assertEqual($description, $info['description']);\n\t\t$this->assertEqual('', $info['text']);\n\t}", "protected function assertMissingDelimitation()\n {\n }", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testParseNoClass()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirectives::class, // wrong class\n ];\n $extras = []; // extra needed parameters like paths \n\n $this->expectException(CapriceException::class);\n $this->parser->parse($file, $rule, $extras);\n }", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function testGetOutOfBounds()\n {\n (new Dom($this->demoComment()))->get(1);\n }", "public function testException() {\r\n\t\t$phpcheckstyle = $GLOBALS['PHPCheckstyle'];\r\n\r\n\t\t$phpcheckstyle->processFiles(array(\r\n\t\t\t'./test/sample/unterminated_comment.php'\r\n\t\t));\r\n\r\n\t\t$errorCounts = $phpcheckstyle->getErrorCounts();\r\n\r\n\t\t$this->assertEquals(1, $errorCounts['error'], 'We expect 1 error');\r\n\t\t$this->assertEquals(0, $errorCounts['ignore'], 'We expect 0 ignored checks');\r\n\t\t$this->assertEquals(0, $errorCounts['info'], 'We expect 0 info');\r\n\t\t$this->assertEquals(0, $errorCounts['warning'], 'We expect 0 warnings');\r\n\t}", "public function testIncludeInvalid()\n {\n $client = static::createClient();\n $client->request('GET', '/include.php?part=invalid');\n $this->assertTrue($client->getResponse()->isNotFound());\n }", "public function testAnotherInvalidSyntax(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_X, Grammar::T_X, Grammar::T_C]);\n }", "public function testParseWithOneUnknownToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Unknown token \".\" at position 0');\n\n $this->parser->parse(['.']);\n }", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function test_invalidNestedContentCommands() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\n {code: \"ApacheVelocity\"}\n Some text here.\n {code}\n{code}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_UNESCAPED_NESTED_COMMAND,\n $parser->getCollection()\n );\n }", "public function testParseError(): void\n {\n $this->expectException(MissingRouteException::class);\n\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);\n Router::parseRequest($this->makeRequest('/nope', 'GET'));\n }", "public function testParseThrowsExceptionIfBoundariesAreInvalid()\n {\n $this->setExpectedException('InvalidArgumentException');\n \n (new Interval())->parse('[0, 0)');\n \n return;\n }", "public function testAddExeptionForIncorrectTag1()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->td();\n }" ]
[ "0.8529395", "0.75021935", "0.7117467", "0.7115714", "0.7112552", "0.70459765", "0.673246", "0.66917133", "0.6592686", "0.63591534", "0.61161447", "0.6107428", "0.595044", "0.59070545", "0.58974475", "0.5835334", "0.58350015", "0.5722839", "0.57143736", "0.56235605", "0.5558996", "0.55139536", "0.5513596", "0.5511393", "0.54911083", "0.54871464", "0.54729265", "0.540802", "0.53905106", "0.5378642" ]
0.85588926
0
Tests that an exception is thrown with an unclosed sanitized tag
public function testExceptionThrownWithUnclosedSanitizedTag() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testParsingUnsanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n ];\n $tagNode = new UnsanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testGetInvalidTagByTagContent() {\n\t\t// grab a tag by content that does not exist\n\t\t$tag = Tag::getTagByTagContent($this->getPDO(), \"nobody ever made this TAG\");\n\t\t$this->assertCount(0, $tag);\n\t}", "public function testParsingSanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n ];\n $tagNode = new SanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function test_validation_missingClosingCommand() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\nSome content here.\n{end}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertFalse($parser->isValid());\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG,\n $parser->getCollection()\n );\n }", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function testThrowsExceptionOnInvalidAddXmlContent()\n {\n $parser = new Parser($this->createTwig());\n $parser->addXmlContent(\"Invalid XML\");\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function itReplacesBadCharacters() {\n $bad_chars = array(\n \"\\x01\" => ' ',\n \"\\x02\" => ' ',\n \"\\x03\" => ' ',\n \"\\x04\" => ' ',\n \"\\x05\" => ' ',\n \"\\x06\" => ' ',\n \"\\x07\" => ' ',\n \"\\x08\" => ' ',\n \"\\x0b\" => ' ',\n \"\\x0c\" => ' ',\n \"\\x0e\" => ' ',\n \"\\x0f\" => ' ',\n \"\\x11\" => ' ',\n \"’\" => '&rsquo;',\n );\n\n foreach ($bad_chars as $bad_char => $replace) {\n $string = htmlentities($bad_char, ENT_IGNORE, 'UTF-8');\n $bad_text = html_entity_decode($string, ENT_IGNORE, 'ISO-8859-1');\n $returned = Encoding_SupportedXmlCharEncoding::getXMLCompatibleString($bad_text);\n\n $this->assertEqual($returned, $replace);\n }\n }", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public static function localNestingCorrectlyRemovesInvalidTagsDataProvider() {}", "public function testEncodeInvalidCharsReplacedBySpace()\n {\n $this->assertEquals(\n 'a b c d e f&#x9;g',\n $this->_xmlEntityCodec->encode(\n $this->_immune_xml,\n 'a' . chr(0) . 'b' . chr(4) . 'c' . chr(128) . 'd' .\n chr(150) . 'e' . chr(159) . 'f' . chr(9) . 'g'\n )\n );\n }", "public function testSimpleHTML() : void\n {\n $string = $this->sanitizer->sanitize('<script>alert(\"hello\");</script><div id=\"fake\"><h5 class=\"foo\">Lorem ipsum</h5></div>');\n $this->assertEquals(\"Lorem ipsum\", $string);\n }", "public function testXss() {\n $test = 'Test string <script>alert(\"XSS!\");</script> with attack <div onclick=\"javascript:alert(\\'XSS!\\')\">vectors</div>';\n\n // remove HTML tags and escape\n $this->assertEquals('Test string alert(&quot;XSS!&quot;); with attack vectors', Sanitize::xss($test));\n\n // remove on attributes and escape\n $this->assertEquals('Test string alert(&quot;XSS!&quot;); with attack &lt;div&gt;vectors&lt;/div&gt;', Sanitize::xss($test, array('strip' => false)));\n\n // remove xmlns and escape\n $this->assertEquals('&lt;html&gt;', Sanitize::xss('<html xmlns=\"http://www.w3.org/1999/xhtml\">', array('strip' => false)));\n\n // remove namespaced tags and escape\n $this->assertEquals('Content', Sanitize::xss('<ns:tag>Content</ns:tag>', array('strip' => false)));\n $this->assertEquals('Content', Sanitize::xss('<ns:tag attr=\"foo\">Content</ns:tag>', array('strip' => false)));\n\n // remove unwanted tags\n $this->assertEquals('A string full of unwanted tags.', Sanitize::xss('<audio>A</audio> <script type=\"text/javascript\">string</script> <iframe>full</iframe> <applet>of</applet> <object>unwanted</object> <style>tags</style>.', array('strip' => false)));\n }", "function testHTMLInj($data){\n $original = $data;\n \n /*convert 5 predefined characters into HTML values.\t\t\n They are > (&gt;), < (%lt;), \" (&quot;), ' (&#039;), & (&amp;) */\t\t\t\n $data = htmlspecialchars($data);\n\n //check for possible html injection\n return !($data === $original);\n }", "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }", "public function testAllowedValues()\n {\n $string = $this->basicSanitizer->sanitize('<a href=\"#\" title=\"four\">hey</a>');\n $this->assertEquals('<a href=\"#\">hey</a>', $string);\n }", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function invalid_tag($message = '')\n {\n return '<img data-twig-error=\"' . $message . '\">';\n }", "public function testGetTagByInvalidTagId() {\n\t\t// Grab a tag by invalid key\n\t\t$tag = Tag::getTagByTagId($this->getPDO(), BrewCrewTest::INVALID_KEY);\n\t\t$this->assertNull($tag);\n\t}", "public function testConstructInvalidHTML(string $html)\n {\n (new Dom($html));\n }", "public function testPreventsCRLFAttackViaFromString()\n {\n $this->expectException(InvalidArgumentException::class);\n UserAgent::fromString(\"User-Agent: xxx\\r\\n\\r\\nevilContent\");\n }" ]
[ "0.84074205", "0.8158409", "0.8038387", "0.76061594", "0.7287377", "0.7246887", "0.6789477", "0.65013283", "0.6474256", "0.64467573", "0.6328265", "0.6242057", "0.6168911", "0.6107316", "0.60190517", "0.5915151", "0.59044534", "0.5831684", "0.58190966", "0.5803011", "0.5800208", "0.58001256", "0.5789716", "0.5783949", "0.57763916", "0.5743753", "0.5742954", "0.57272756", "0.57066286", "0.5694561" ]
0.8293675
1
Tests that an exception is thrown with an unclosed unsanitized tag
public function testExceptionThrownWithUnclosedUnsanitizedTag() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testParsingUnsanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n ];\n $tagNode = new UnsanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testGetInvalidTagByTagContent() {\n\t\t// grab a tag by content that does not exist\n\t\t$tag = Tag::getTagByTagContent($this->getPDO(), \"nobody ever made this TAG\");\n\t\t$this->assertCount(0, $tag);\n\t}", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testThrowsExceptionOnInvalidAddXmlContent()\n {\n $parser = new Parser($this->createTwig());\n $parser->addXmlContent(\"Invalid XML\");\n }", "public function testParsingSanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n ];\n $tagNode = new SanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function test_validation_missingClosingCommand() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\nSome content here.\n{end}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertFalse($parser->isValid());\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG,\n $parser->getCollection()\n );\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }", "public function testGetTagByInvalidTagId() {\n\t\t// Grab a tag by invalid key\n\t\t$tag = Tag::getTagByTagId($this->getPDO(), BrewCrewTest::INVALID_KEY);\n\t\t$this->assertNull($tag);\n\t}", "public function testAddExeptionForIncorrectTag1()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->td();\n }", "public function testGetXmlRootTagWithNotValidXML()\n {\n $this->expectException(InvalidXMLFormat::class);\n\n $this->mockTrait->getXmlRootTag('not xml');\n }", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function invalid_tag($message = '')\n {\n return '<img data-twig-error=\"' . $message . '\">';\n }", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "public function testInvalidPage() {\n $this->setExpectedException(\\InvalidArgumentException::class);\n new XmlSitemapWriter($this->sitemap, 'invalid');\n }", "public function testAddExeptionForIncorrectTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->add('td');\n }", "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "public function test_invalid_user() {\n\n $client = new GuzzleHttp\\Client();\n $crawler = new InstagramCrawler($client,$this->access_token,[/*no tags*/],[\"worng.user.never.exi7ste31d\"]);\n\n $this->setExpectedException('Instagram2Vk\\Exceptions\\InstagramException');\n $data = $crawler->crawl();\n\n }", "public function testBuildInvalidDataSimpleXml() {\n\t\t$input = '<derp';\n\t\t$xml = Xml::build($input, array('return' => 'simplexml'));\n\t}", "public function testChangeTagException()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $tr = $table->tr();\n $th = $tr->setTag('th');\n }", "public function testConstructInvalidHTML(string $html)\n {\n (new Dom($html));\n }", "public function testPreventsCRLFAttackViaFromString()\n {\n $this->expectException(InvalidArgumentException::class);\n UserAgent::fromString(\"User-Agent: xxx\\r\\n\\r\\nevilContent\");\n }" ]
[ "0.828272", "0.8173837", "0.80187905", "0.76021165", "0.7249093", "0.7047251", "0.6811197", "0.67080814", "0.6522452", "0.61624944", "0.6158708", "0.6084741", "0.60743254", "0.6061694", "0.6030593", "0.5965938", "0.59454316", "0.5895563", "0.58823574", "0.5811371", "0.57876813", "0.57712835", "0.5764473", "0.5756404", "0.57496816", "0.5725587", "0.5714354", "0.5690858", "0.56694865", "0.5661742" ]
0.8411154
0
Tests that an exception is thrown with an unopened comment
public function testExceptionThrownWithUnopenedComment() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "public function testExceptionThrownWithNestedComment()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testException() {\r\n\t\t$phpcheckstyle = $GLOBALS['PHPCheckstyle'];\r\n\r\n\t\t$phpcheckstyle->processFiles(array(\r\n\t\t\t'./test/sample/unterminated_comment.php'\r\n\t\t));\r\n\r\n\t\t$errorCounts = $phpcheckstyle->getErrorCounts();\r\n\r\n\t\t$this->assertEquals(1, $errorCounts['error'], 'We expect 1 error');\r\n\t\t$this->assertEquals(0, $errorCounts['ignore'], 'We expect 0 ignored checks');\r\n\t\t$this->assertEquals(0, $errorCounts['info'], 'We expect 0 info');\r\n\t\t$this->assertEquals(0, $errorCounts['warning'], 'We expect 0 warnings');\r\n\t}", "public function testBadlyClosedDocblock() {\n\t\t$info = Inspector::info(__METHOD__ . '()');\n\t\t$description = 'This docblock has an extra * in the closing element.';\n\t\t$this->assertEqual($description, $info['description']);\n\t\t$this->assertEqual('', $info['text']);\n\t}", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "private function bogusCommentState() {\n $data = $this->characters('^>', $this->char);\n $this->emitToken(array(\n 'data' => $data,\n 'type' => self::COMMENT\n ));\n\n $this->char += strlen($data);\n\n /* Switch to the data state. */\n $this->state = 'data';\n\n /* If the end of the file was reached, reconsume the EOF character. */\n if($this->char === $this->EOF) {\n $this->char = $this->EOF - 1;\n }\n }", "function isValidComment($comment) {\n\tunset($comment);\n\treturn true;\n}", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "public function testGetOutOfBounds()\n {\n (new Dom($this->demoComment()))->get(1);\n }", "private function comment()\n {\n // Comments always begin with a / character.\n $this->nextOrFail('/');\n\n if ($this->currentByte === '/') {\n $this->inlineComment();\n } elseif ($this->currentByte === '*') {\n $this->blockComment();\n } else {\n $this->throwSyntaxError('Unrecognized comment');\n }\n }", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "private function bogusCommentState()\n {\n $data = $this->characters('^>', $this->char);\n $this->emitToken(\n array(\n 'data' => $data,\n 'type' => self::COMMENT\n )\n );\n\n $this->char += strlen($data);\n\n /* Switch to the data state. */\n $this->state = 'data';\n\n /* If the end of the file was reached, reconsume the EOF character. */\n if ($this->char === $this->EOF) {\n $this->char = $this->EOF - 1;\n }\n }", "protected function determineComment()\n {\n if (starts_with($this->source, '//')) {\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '#')) {\n log_warning('Using the # symbol for comments is deprecated');\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '/*')) {\n if (ends_with($this->source, '*/')) {\n return;\n }\n $this->isComment = true;\n } elseif (ends_with($this->source, '*/')) {\n $this->isComment = false;\n }\n }", "public function testEditCommentError() {\n\t\tRolesControllerTest::login($this);\n\n\t\t//データ生成\n\t\t$frameId = '181';\n\t\t$blockId = '181';\n\t\t$blockKey = 'block_' . $blockId;\n\t\t$roomId = '1';\n\n\t\t$data = array(\n\t\t\t'Frame' => array('id' => $frameId),\n\t\t\t'Block' => array('id' => $blockId, 'key' => $blockKey, 'room_id' => $roomId),\n\t\t\t'RssReader' => array(\n\t\t\t\t'key' => 'rss_reader_1',\n\t\t\t\t'url' => APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml',\n\t\t\t\t'title' => 'Edit title',\n\t\t\t\t'summary' => 'Edit summary',\n\t\t\t\t'link' => 'http://example.com',\n\t\t\t),\n\t\t\t'Comment' => array('comment' => ''),\n\t\t\tsprintf('save_%s', NetCommonsBlockComponent::STATUS_DISAPPROVED) => '',\n\t\t);\n\n\t\t//テスト実行\n\t\t$ret = $this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/' . $frameId . '.json',\n\t\t\tarray(\n\t\t\t\t'method' => 'post',\n\t\t\t\t'data' => $data,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$result = json_decode($ret, true);\n\n\t\t$this->assertArrayHasKey('code', $result, print_r($result, true));\n\t\t$this->assertEquals(400, $result['code'], print_r($result, true));\n\t\t$this->assertArrayHasKey('name', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('error', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('validationErrors', $result['error'], print_r($result, true));\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}", "public function isComment() {}", "public function testSCAN_PATTERN_COMMENT() {\n\t\t$pattern = \\TYPO3\\TypoScript\\Core\\Parser::SCAN_PATTERN_COMMENT;\n\t\t$this->assertEquals(preg_match($pattern, '/* This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a block comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '# This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '// This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a double slash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, ' # This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start with preceeding whitespace.');\n\t\t$this->assertEquals(preg_match($pattern, '/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a single slash.');\n\t\t$this->assertEquals(preg_match($pattern, '*/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a comment block ending.');\n\t}", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "function parseComment()\r\n\t{\r\n\t\t$this->start = $this->reader->mark();\r\n\t\t// skip over the comment\r\n\t\t$stop = $this->reader->skipUntil('--%>');\r\n\t\tif (is_null($stop))\r\n\t\t{\r\n\t\t\tthrow_exception(new PhaseException('Comment not properly ended.'));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->reader->skipSpaces();\r\n\t\treturn '';\r\n\t}", "private function readComment(): bool\n {\n $this->readWhitespace();\n if (!$this->readChar('#')) {\n return false;\n }\n $type = strpbrk($this->data[$this->position] ?? '', '~|,:.') ?: '';\n $this->position += strlen($type);\n // Only a single space might be optionally added\n $this->readChar(' ');\n switch ($type) {\n case '':\n $data = $this->readCommentString();\n $this->translation->getComments()->add($data);\n break;\n case '~':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception(\"Inconsistent use of #~{$this->getErrorPosition()}\");\n }\n $this->translation->disable();\n $this->isDisabled = true;\n break;\n case '|':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception('Cannot redeclare the previous comment #|, '\n . \"ensure the definitions are in the right order{$this->getErrorPosition()}\");\n }\n $this->inPreviousPart = true;\n $this->translation->setPreviousContext($this->readIdentifier('msgctxt'));\n $this->translation->setPreviousOriginal($this->readIdentifier('msgid', true));\n $this->translation->setPreviousPlural($this->readIdentifier('msgid_plural'));\n $this->inPreviousPart = false;\n break;\n case ',':\n $data = $this->readCommentString();\n foreach (array_map('trim', explode(',', trim($data))) as $value) {\n $this->translation->getFlags()->add($value);\n }\n break;\n case ':':\n $data = $this->readCommentString();\n foreach (preg_split('/\\s+/', trim($data)) as $value) {\n if (preg_match('/^(.+)(:(\\d*))?$/U', $value, $matches)) {\n $line = isset($matches[3]) ? intval($matches[3]) : null;\n $this->translation->getReferences()->add($matches[1], $line);\n }\n }\n break;\n case '.':\n $data = $this->readCommentString();\n $this->translation->getExtractedComments()->add($data);\n break;\n }\n\n return true;\n }", "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "protected function _getComment ($data, $i) {\n $c = substr ($data, $i, 1);\n if ($c == '#') {\n\n # Shell comment\n $len = strcspn ($data, \"\\n\", $i);\n\n } else if ($c == '/') {\n\n # C or C++ comment\n $d = substr ($data, $i + 1, 1);\n if ($d == '/') {\n\n # C++ comment\n $len = strcspn ($data, \"\\n\", $i);\n\n } else if ($d == '*') {\n\n # C-style comment\n $pos = strpos ($data, '*/', $i);\n if ($pos !== false) {\n $len = $pos - $i + 2;\n } else {\n throw new Exception ('Unterminated comment');\n }\n\n } else {\n\n # Not a comment at all\n $len = 0;\n }\n\n } else {\n\n # Not a comment\n $len = 0;\n\n }\n return $len;\n }", "protected function report_comment_failure_message(){\r\n\t\treturn 'Sorry, the comment could not be reported.';\r\n\t}", "public function testParsingComment()\n {\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n ];\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($commentNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function test_get_comment_above_line_does_not_belong_to_line() {\n\n\t\t$key = $this->tokenizer->filter_on_value( $this->tokens, array( \"'filter_comment_not_alone_on_line'\" ) );\n\t\t$this->assertEmpty( $this->tokenizer->get_comment_above_line( $this->tokens, key( $key ) ) );\n\t}", "public function test_to_see_if_comments_are_sanitized()\n {\n $this->put('/comment/1', InputSanitizerConstants::UNSANITIZED_COMMENT);\n\n $this->assertDatabaseMissing('comments', InputSanitizerConstants::UNSANITIZED_COMMENT);\n }", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function testDeleteComplaintCommentsWithInvalidId(){\n $response = $this->json('DELETE','/api/v1/comments/200');\n $response\n ->assertStatus(404)\n ->assertExactJson([\n 'message' => 'Comment not found',\n ]);\n }", "function check_comment_flood_db()\n {\n }" ]
[ "0.8148764", "0.74532354", "0.6672016", "0.6584382", "0.6554698", "0.64434195", "0.6173636", "0.6105118", "0.6077048", "0.60733676", "0.6073128", "0.60723865", "0.60701853", "0.6059699", "0.60452676", "0.6015377", "0.6013479", "0.5979495", "0.5899401", "0.58848053", "0.58659685", "0.5861797", "0.5860372", "0.5859794", "0.58393705", "0.5788403", "0.5782905", "0.5757923", "0.57438827", "0.57248354" ]
0.83218473
0
Tests that an exception is thrown with an unopened directive
public function testExceptionThrownWithUnopenedDirective() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testExceptionThrownWithUnopenedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)]);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "public function testParseNoClass()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirectives::class, // wrong class\n ];\n $extras = []; // extra needed parameters like paths \n\n $this->expectException(CapriceException::class);\n $this->parser->parse($file, $rule, $extras);\n }", "public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }", "public function testInvalidView() {\n $renderer = $this->container->get('renderer');\n $render_element = [\n '#type' => 'view',\n '#name' => 'invalid_view_name',\n '#embed' => FALSE,\n ];\n $this->expectException(ViewRenderElementException::class);\n $this->expectExceptionMessage(\"Invalid View name ({$render_element['#name']}) given.\");\n $renderer->renderRoot($render_element);\n }", "public function assertNotError()\n {\n $this->assertNotContains('Error', $this->session->title());\n $src = $this->session->source();\n $this->assertNotContains('Error', $src);\n $this->assertNotContains('Exception', $src);\n }", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function testInExistentScope()\n {\n $this->expectException(\\BadMethodCallException::class);\n\n $foos = $this->app->make(FooRepository::class);\n $foos->isNotActive()->get();\n }", "public function testExtendThrowsExceptionWhenUnregisteredDefinitionIsGiven()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container;\n $c->extend('does_not_exist');\n }", "public function testIncludeInvalid()\n {\n $client = static::createClient();\n $client->request('GET', '/include.php?part=invalid');\n $this->assertTrue($client->getResponse()->isNotFound());\n }", "public function canNotOpen()\n {\n $this->assertFalse(@fopen(vfsStream::url('foo')));\n }", "public function testParseError(): void\n {\n $this->expectException(MissingRouteException::class);\n\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);\n Router::parseRequest($this->makeRequest('/nope', 'GET'));\n }", "public function testDispatchErrorRouteController()\n {\n $this->expectException(IncompleteRouteException::class);\n\n $this->uut->dispatch($this->buildRequest('/missing-controller'));\n }", "#[@test, @expect('lang.ElementNotFoundException')]\n public function lookupNonexistantThrowsException() {\n $this->cut->lookup('localhost');\n }", "public function testExceptionThrownWithNestedComment()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testParseWithOneUnknownToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Unknown token \".\" at position 0');\n\n $this->parser->parse(['.']);\n }", "function broken() { }", "public function testProcessorInvalidFile()\n {\n $xml = '\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc\n accumsan leo quis arcu convallis faucibus. Mauris pharetra dolor\n faucibus, ultrices ex in, porttitor urna. Aliquam erat volutpat.\n Curabitur consectetur purus ex, at porta ex viverra in. Nullam\n rutrum sem quis lacus pellentesque rutrum. Quisque vitae arcu eros.\n Maecenas luctus enim at vehicula varius. In lacinia lorem vehicula\n elementum fermentum. Aenean venenatis ac massa eu maximus. Lorem\n ipsum dolor sit amet, consectetur adipiscing elit. Quisque et\n varius eros.\n ';\n\n $processor = new Processor();\n $user = new User();\n $version = new Version($user);\n\n $this->expectException(\\Exception::class);\n $processor->process($xml, $version);\n }", "public function testAnotherInvalidSyntax(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_X, Grammar::T_X, Grammar::T_C]);\n }", "public function testNoLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->getLoader('filename.unknown');\n }", "public function testParsingDirectiveWithNoExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n ];\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($directiveNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }" ]
[ "0.74679774", "0.65892756", "0.6284434", "0.60818726", "0.60741603", "0.5808682", "0.56832075", "0.5539192", "0.553441", "0.54916227", "0.5484853", "0.5466608", "0.5453318", "0.5452398", "0.5442949", "0.5375022", "0.5335795", "0.5328659", "0.5284386", "0.52633274", "0.5261861", "0.5229349", "0.519993", "0.51948065", "0.51676136", "0.51526916", "0.51522475", "0.513609", "0.5129964", "0.51298064" ]
0.80345947
0
Tests that an exception is thrown with an unopened unsanitized tag
public function testExceptionThrownWithUnopenedUnsanitizedTag() { $this->expectException(RuntimeException::class); $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testParsingUnsanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n ];\n $tagNode = new UnsanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testGetInvalidTagByTagContent() {\n\t\t// grab a tag by content that does not exist\n\t\t$tag = Tag::getTagByTagContent($this->getPDO(), \"nobody ever made this TAG\");\n\t\t$this->assertCount(0, $tag);\n\t}", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testGetTagByInvalidTagId() {\n\t\t// Grab a tag by invalid key\n\t\t$tag = Tag::getTagByTagId($this->getPDO(), BrewCrewTest::INVALID_KEY);\n\t\t$this->assertNull($tag);\n\t}", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }", "public function testGetInvalidTagByTagId() {\n\t\t// grab a profile id that exceeds the maximum allowable profile id\n\t\t$tag = Tag::getTagByTagId($this->getPDO(), DevConnectTest::INVALID_KEY);\n\t\t$this->assertNull($tag);\n\t}", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testThrowsExceptionOnInvalidAddXmlContent()\n {\n $parser = new Parser($this->createTwig());\n $parser->addXmlContent(\"Invalid XML\");\n }", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function testGetWrongStreamTags()\n {\n $helix = new Helix(self::$tokenProvider);\n $tags = $helix->tags->getStreamTags(\"NonExistentUser\". uniqid());\n $this->assertFalse($tags);\n\n \n $tags = $helix->tags->getStreamTags(-1);\n $this->assertFalse($tags);\n }", "public function test_invalid_user() {\n\n $client = new GuzzleHttp\\Client();\n $crawler = new InstagramCrawler($client,$this->access_token,[/*no tags*/],[\"worng.user.never.exi7ste31d\"]);\n\n $this->setExpectedException('Instagram2Vk\\Exceptions\\InstagramException');\n $data = $crawler->crawl();\n\n }", "public function testInvalidAttributeName()\n {\n $config = array(\n\t\tnull\n );\n\n $result = self::processFilter($config, self::$request);\n }", "public function testInsertInvalidTag() {\n\t\t// create a Tag with a non null tag id and watch it fail\n\t\t$tag = new Tag(DevConnectTest::INVALID_KEY, $this->VALID_TAGCONTENT);\n\t\t$tag->insert($this->getPDO());\n\t}", "public function testInsertInvalidTag() {\n\t\t// Create a tag with a non null tag id and watch it fail\n\t\t$tag = new Tag(BrewCrewTest::INVALID_KEY, $this->VALID_TAG_LABEL);\n\t\t$tag->insert($this->getPDO());\n\t}", "public function test_no_user_agent_exception() {\n\t\tunset($_SERVER['HTTP_USER_AGENT']);\n\t\ttry {\n\t\t\tparse_user_agent();\n\t\t} catch(\\InvalidArgumentException $ex) {\n\t\t\t$this->assertTrue(true); // easy way to quiet warning\n\t\t\treturn;\n\t\t}\n\n\t\t$this->fail(\"Expected \\InvalidArgumentException\");\n\t}", "public function testParsingSanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n ];\n $tagNode = new SanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testAddExeptionForIncorrectTag1()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->td();\n }", "public function testChangeTagException()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $tr = $table->tr();\n $th = $tr->setTag('th');\n }", "public function testGetXmlRootTagWithNotValidXML()\n {\n $this->expectException(InvalidXMLFormat::class);\n\n $this->mockTrait->getXmlRootTag('not xml');\n }", "public function testInvalidPage() {\n $this->setExpectedException(\\InvalidArgumentException::class);\n new XmlSitemapWriter($this->sitemap, 'invalid');\n }", "public function testDeleteInvalidTag() {\n\t\t// create a Tag and try to delete it without actually inserting it\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->delete($this->getPDO());\n\t}", "public static function localNestingCorrectlyRemovesInvalidTagsDataProvider() {}", "public function testAddExeptionForIncorrectTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->add('td');\n }", "private function assertValidTags() : void\n {\n if ([] === $this->tags) {\n return;\n }\n\n foreach ($this->tags as $value) {\n InvalidDescriptorArgumentException::assertIsNotEmptyString(\n $value,\n '#[Route.tags] must contain non-empty strings.'\n );\n }\n }" ]
[ "0.7899553", "0.7653398", "0.7635022", "0.71695346", "0.70783186", "0.700527", "0.6662831", "0.64375657", "0.61832994", "0.61507475", "0.6094407", "0.6076113", "0.6007911", "0.59912914", "0.5989667", "0.5987655", "0.59805936", "0.58916813", "0.58734083", "0.584157", "0.57996494", "0.57888466", "0.5744797", "0.5743301", "0.5688323", "0.5679834", "0.5603084", "0.55752915", "0.5570484", "0.5561613" ]
0.7860566
1
Tests parsing a comment
public function testParsingComment() { $tokens = [ new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1), new Token(TokenTypes::T_EXPRESSION, 'foo', 1), new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1), ]; $commentNode = new CommentNode(); $commentNode->addChild(new ExpressionNode('foo')); $this->ast->getCurrentNode() ->addChild($commentNode); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseComment()\r\n\t{\r\n\t\t$this->start = $this->reader->mark();\r\n\t\t// skip over the comment\r\n\t\t$stop = $this->reader->skipUntil('--%>');\r\n\t\tif (is_null($stop))\r\n\t\t{\r\n\t\t\tthrow_exception(new PhaseException('Comment not properly ended.'));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->reader->skipSpaces();\r\n\t\treturn '';\r\n\t}", "protected function parseComment()\n {\n if (!$this->peekChar('/')) {\n return;\n }\n\n if ($this->peekChar('/', 1)) {\n return new ILess_Node_Comment($this->matchReg('/\\G\\/\\/.*/'), true, $this->position, $this->env->currentFileInfo);\n } //elseif($comment = $this->matchReg('/\\G\\/\\*(?:[^*]|\\*+[^\\/*])*\\*+\\/\\n?/'))\n elseif ($comment = $this->matchReg('/\\\\G\\/\\*(?s).*?\\*+\\/\\n?/')) {\n return new ILess_Node_Comment($comment, false, $this->position, $this->env->currentFileInfo);\n }\n }", "public function testSCAN_PATTERN_COMMENT() {\n\t\t$pattern = \\TYPO3\\TypoScript\\Core\\Parser::SCAN_PATTERN_COMMENT;\n\t\t$this->assertEquals(preg_match($pattern, '/* This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a block comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '# This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '// This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a double slash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, ' # This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start with preceeding whitespace.');\n\t\t$this->assertEquals(preg_match($pattern, '/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a single slash.');\n\t\t$this->assertEquals(preg_match($pattern, '*/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a comment block ending.');\n\t}", "protected function scanComment()\n {\n $matches = array();\n\n if (preg_match('/^ *\\/\\/(-)?([^\\n]+)?/', $this->input, $matches)) {\n $this->consumeInput(mb_strlen($matches[0]));\n $token = $this->takeToken('comment', isset($matches[2]) ? $matches[2] : '');\n $token->buffer = !isset($matches[1]) || '-' !== $matches[1];\n\n return $token;\n }\n }", "private function comment()\n {\n // Comments always begin with a / character.\n $this->nextOrFail('/');\n\n if ($this->currentByte === '/') {\n $this->inlineComment();\n } elseif ($this->currentByte === '*') {\n $this->blockComment();\n } else {\n $this->throwSyntaxError('Unrecognized comment');\n }\n }", "public function testCommentProcessor()\n {\n $processor = new Processor\\Comments();\n $input = '{# test #} works';\n\n $output = $processor->replace($input, false);\n $this->assertSame(' works', $output);\n\n $output = $processor->replace($input, true);\n $this->assertSame('<!-- test --> works', $output);\n }", "protected function determineComment()\n {\n if (starts_with($this->source, '//')) {\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '#')) {\n log_warning('Using the # symbol for comments is deprecated');\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '/*')) {\n if (ends_with($this->source, '*/')) {\n return;\n }\n $this->isComment = true;\n } elseif (ends_with($this->source, '*/')) {\n $this->isComment = false;\n }\n }", "protected function scanComment()\n {\n $matches = array();\n\n if (preg_match('/^ *\\/\\/(-)?([^\\n]+)?/', $this->page, $matches) ) {\n $this->reduce($matches[0]);\n $token = $this->takeToken('comment', isset($matches[2]) ? $matches[2] : '');\n $token->buffer = !isset($matches[1]) || '-' !== $matches[1];\n\n return $token;\n }\n }", "public function testExceptionThrownWithUnclosedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1)]);\n }", "private function readComment(): bool\n {\n $this->readWhitespace();\n if (!$this->readChar('#')) {\n return false;\n }\n $type = strpbrk($this->data[$this->position] ?? '', '~|,:.') ?: '';\n $this->position += strlen($type);\n // Only a single space might be optionally added\n $this->readChar(' ');\n switch ($type) {\n case '':\n $data = $this->readCommentString();\n $this->translation->getComments()->add($data);\n break;\n case '~':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception(\"Inconsistent use of #~{$this->getErrorPosition()}\");\n }\n $this->translation->disable();\n $this->isDisabled = true;\n break;\n case '|':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception('Cannot redeclare the previous comment #|, '\n . \"ensure the definitions are in the right order{$this->getErrorPosition()}\");\n }\n $this->inPreviousPart = true;\n $this->translation->setPreviousContext($this->readIdentifier('msgctxt'));\n $this->translation->setPreviousOriginal($this->readIdentifier('msgid', true));\n $this->translation->setPreviousPlural($this->readIdentifier('msgid_plural'));\n $this->inPreviousPart = false;\n break;\n case ',':\n $data = $this->readCommentString();\n foreach (array_map('trim', explode(',', trim($data))) as $value) {\n $this->translation->getFlags()->add($value);\n }\n break;\n case ':':\n $data = $this->readCommentString();\n foreach (preg_split('/\\s+/', trim($data)) as $value) {\n if (preg_match('/^(.+)(:(\\d*))?$/U', $value, $matches)) {\n $line = isset($matches[3]) ? intval($matches[3]) : null;\n $this->translation->getReferences()->add($matches[1], $line);\n }\n }\n break;\n case '.':\n $data = $this->readCommentString();\n $this->translation->getExtractedComments()->add($data);\n break;\n }\n\n return true;\n }", "public function testExceptionThrownWithNestedComment()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnopenedComment()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)]);\n }", "public function isComment() {}", "protected function getDocCommentParser() {}", "protected function getDocCommentParser() {}", "protected function getDocCommentParser() {}", "function mCOMMENT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$COMMENT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:616:3: ( '#' ( . )* EOL ) \n // Tokenizer11.g:617:3: '#' ( . )* EOL \n {\n $this->matchChar(35); \n // Tokenizer11.g:617:7: ( . )* \n //loop35:\n do {\n $alt35=2;\n $LA35_0 = $this->input->LA(1);\n\n if ( ($LA35_0==$this->getToken('10')||$LA35_0==$this->getToken('13')) ) {\n $alt35=2;\n }\n else if ( (($LA35_0>=$this->getToken('0') && $LA35_0<=$this->getToken('9'))||($LA35_0>=$this->getToken('11') && $LA35_0<=$this->getToken('12'))||($LA35_0>=$this->getToken('14') && $LA35_0<=$this->getToken('65535'))) ) {\n $alt35=1;\n }\n\n\n switch ($alt35) {\n \tcase 1 :\n \t // Tokenizer11.g:617:7: . \n \t {\n \t $this->matchAny(); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop35;\n }\n } while (true);\n\n $this->mEOL(); \n $_channel = HIDDEN; \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected function _getComment ($data, $i) {\n $c = substr ($data, $i, 1);\n if ($c == '#') {\n\n # Shell comment\n $len = strcspn ($data, \"\\n\", $i);\n\n } else if ($c == '/') {\n\n # C or C++ comment\n $d = substr ($data, $i + 1, 1);\n if ($d == '/') {\n\n # C++ comment\n $len = strcspn ($data, \"\\n\", $i);\n\n } else if ($d == '*') {\n\n # C-style comment\n $pos = strpos ($data, '*/', $i);\n if ($pos !== false) {\n $len = $pos - $i + 2;\n } else {\n throw new Exception ('Unterminated comment');\n }\n\n } else {\n\n # Not a comment at all\n $len = 0;\n }\n\n } else {\n\n # Not a comment\n $len = 0;\n\n }\n return $len;\n }", "protected function parseComment(string $comment): void\n {\n // Strip the opening and closing tags of the docblock\n $comment = \\substr($comment, 3, -2);\n\n // Split into arrays of lines\n $comment = \\preg_split('/\\r?\\n\\r?/', $comment);\n\n // Trim asterisks and whitespace from the beginning and whitespace from the end of lines\n $comment = \\array_map(function ($line) {\n return \\ltrim(\\rtrim($line), \"* \\t\\n\\r\\0\\x0B\");\n }, $comment);\n\n // Group the lines together by @tags\n $blocks = [];\n $b = -1;\n foreach ($comment as $line) {\n if (self::isTagged($line)) {\n $b++;\n $blocks[] = [];\n } elseif ($b == -1) {\n $b = 0;\n $blocks[] = [];\n }\n $blocks[$b][] = $line;\n }\n\n // Parse the blocks\n foreach ($blocks as $block => $body) {\n $body = \\trim(\\implode(\"\\n\", $body));\n\n if ($block == 0 && !self::isTagged($body)) {\n // This is the description block\n $this->description = $body;\n continue;\n } else {\n // This block is tagged\n $tag = (string)\\substr(self::strTag($body), 1);\n $body = \\ltrim((string)\\substr($body, \\strlen($tag) + 2));\n\n if (isset(self::$vectors[$tag])) {\n // The tagged block is a vector\n $count = \\count(self::$vectors[$tag]);\n if ($body) {\n $parts = \\preg_split('/\\s+/', $body, $count);\n } else {\n $parts = [];\n }\n // Default the trailing values\n $parts = \\array_pad($parts, $count, null);\n $mapped = \\array_combine(\n self::$vectors[$tag],\n $parts\n );\n\n if (isset($mapped['var']) && \\substr($mapped['var'], 0, 3) === '...') {\n $mapped['var'] = substr($mapped['var'], 3);\n }\n // Store as a mapped array\n $this->tags[$tag][] = $mapped;\n } else {\n // The tagged block is only text\n $this->tags[$tag][] = $body;\n }\n }\n }\n }", "function test_rendering_comment_template() {\n\t\t$parsed_blocks = parse_blocks(\n\t\t\t'<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->'\n\t\t);\n\n\t\t$block = new WP_Block(\n\t\t\t$parsed_blocks[0],\n\t\t\tarray(\n\t\t\t\t'postId' => self::$custom_post->ID,\n\t\t\t)\n\t\t);\n\n\t\t$this->assertSame(\n\t\t\tstr_replace( array( \"\\n\", \"\\t\" ), '', '<ol class=\"wp-block-comment-template\"><li id=\"comment-' . self::$comment_ids[0] . '\" class=\"comment even thread-even depth-1\"><div class=\"wp-block-comment-author-name\"><a rel=\"external nofollow ugc\" href=\"http://example.com/author-url/\" target=\"_self\" >Test</a></div><div class=\"wp-block-comment-content\"><p>Hello world</p></div></li></ol>' ),\n\t\t\tstr_replace( array( \"\\n\", \"\\t\" ), '', $block->render() )\n\t\t);\n\t}", "protected function check_comments()\n {\n $comments = preg_grep(\"/#.*$/\", $this->buffer);\n if(!empty($comments))\n {\n $this->stats->add_comm();\n $triggered = 0;\n $len = count($this->buffer);\n\n for($token = key($this->buffer); $token < $len; $token++)\n {\n \n if($triggered == 1)\n {\n unset($this->buffer[$token]);\n continue;\n }\n $isThere = preg_match(\"/#.*$/\", $this->buffer[$token]);\n if($isThere == 1)\n {\n $triggered = 1;\n }\n\n $value = preg_replace(\"/#.*$/\", \"\", $this->buffer[$token]);\n\n if($value == \"\")\n {\n unset($this->buffer[$token]);\n continue;\n }\n $this->buffer[$token] = $value;\n }\n\n if(empty($this->buffer))\n {\n $this->buffer = [NULL];\n } \n }\n }", "function isValidComment($comment) {\n\tunset($comment);\n\treturn true;\n}", "private function bogusCommentState() {\n $data = $this->characters('^>', $this->char);\n $this->emitToken(array(\n 'data' => $data,\n 'type' => self::COMMENT\n ));\n\n $this->char += strlen($data);\n\n /* Switch to the data state. */\n $this->state = 'data';\n\n /* If the end of the file was reached, reconsume the EOF character. */\n if($this->char === $this->EOF) {\n $this->char = $this->EOF - 1;\n }\n }", "public function comment($comment)\n\t{\n\t\treturn $comment ? \"/* {$comment} */\" : null;\n\t}", "protected function _prepare_comment($comment)\n {\n }", "private function validateComment($comment)\n {\n if($comment != NULL && $comment != \"\"){\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "private function bogusCommentState()\n {\n $data = $this->characters('^>', $this->char);\n $this->emitToken(\n array(\n 'data' => $data,\n 'type' => self::COMMENT\n )\n );\n\n $this->char += strlen($data);\n\n /* Switch to the data state. */\n $this->state = 'data';\n\n /* If the end of the file was reached, reconsume the EOF character. */\n if ($this->char === $this->EOF) {\n $this->char = $this->EOF - 1;\n }\n }", "public static function parseComment($comment, $strict = true)\n {\n $result = str_replace(['\\n', '\\r'], '. ', preg_replace('~\\R~u', '', $comment));\n\n if ($strict && $comment != $result) {\n throw new \\Exception('Comment must not contain linefeed characters');\n }\n\n // Hash and brackets\n $result = preg_replace('/[#<>]/', '', $result);\n\n if ($strict && $comment != $result) {\n throw new \\Exception('Comment must not contain hash or bracket characters');\n }\n\n return $result;\n }", "private function readCommentString(): string\n {\n $length = strcspn($this->data, \"\\n\\r\", $this->position);\n\n return substr($this->data, ($this->position += $length) - $length, $length);\n }" ]
[ "0.74719286", "0.74625003", "0.7433535", "0.73920083", "0.72663766", "0.7112882", "0.70976365", "0.70648134", "0.7044851", "0.69946146", "0.68706584", "0.6860167", "0.68212473", "0.6748082", "0.6748082", "0.6748082", "0.6649154", "0.6577982", "0.64356", "0.642419", "0.63995045", "0.63917863", "0.6320103", "0.6312993", "0.62759537", "0.6275354", "0.6213013", "0.61846507", "0.61744857", "0.6174077" ]
0.8292627
0
Tests parsing a directive with an expression
public function testParsingDirectiveWithExpression() { $tokens = [ new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1), new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1), new Token(TokenTypes::T_EXPRESSION, '("bar")', 1), new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1), ]; $directiveNode = new DirectiveNode(); $directiveNode->addChild(new DirectiveNameNode('foo')); $directiveNode->addChild(new ExpressionNode('("bar")')); $this->ast->getCurrentNode() ->addChild($directiveNode); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testParsingDirectiveWithNoExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n ];\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($directiveNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "protected function parseDirective()\n {\n $hasBlock = false;\n $hasIdentifier = false;\n $hasExpression = false;\n\n if (!$this->peekChar('@')) {\n return;\n }\n\n $value = $this->matchFuncs(array('parseImport', 'parseMedia'));\n if ($value) {\n return $value;\n }\n\n $this->save();\n $name = $this->matchReg('/\\\\G@[a-z-]+/');\n\n if (!$name) {\n return;\n }\n\n $nonVendorSpecificName = $name;\n $pos = strpos($name, '-', 2);\n if ($name[1] == '-' && $pos > 0) {\n $nonVendorSpecificName = '@' . substr($name, $pos + 1);\n }\n\n switch ($nonVendorSpecificName) {\n case '@font-face':\n $hasBlock = true;\n break;\n case '@viewport':\n case '@top-left':\n case '@top-left-corner':\n case '@top-center':\n case '@top-right':\n case '@top-right-corner':\n case '@bottom-left':\n case '@bottom-left-corner':\n case '@bottom-center':\n case '@bottom-right':\n case '@bottom-right-corner':\n case '@left-top':\n case '@left-middle':\n case '@left-bottom':\n case '@right-top':\n case '@right-middle':\n case '@right-bottom':\n $hasBlock = true;\n break;\n case '@host':\n case '@page':\n case '@document':\n case '@supports':\n case '@keyframes':\n $hasBlock = true;\n $hasIdentifier = true;\n break;\n case '@namespace':\n $hasExpression = true;\n break;\n }\n\n if ($hasIdentifier) {\n $identifier = $this->matchReg('/\\\\G[^{]+/');\n if ($identifier) {\n $name .= ' ' . trim($identifier);\n }\n }\n\n if ($hasBlock) {\n if ($rules = $this->parseBlock()) {\n return new ILess_Node_Directive($name, $rules, $this->position, $this->env->currentFileInfo);\n }\n } else {\n if (($value = $hasExpression ? $this->parseExpression() : $this->parseEntity()) && $this->matchChar(';')) {\n $directive = new ILess_Node_Directive($name, $value, $this->position, $this->env->currentFileInfo);\n if ($this->env->dumpLineNumbers) {\n $directive->debugInfo = $this->getDebugInfo($this->position, $this->input, $this->env);\n }\n\n return $directive;\n }\n }\n\n $this->restore();\n }", "function parseDirective()\r\n\t{\r\n\t\t$this->start = $this->reader->mark();\r\n\t\t// skip over directive\r\n\t\t$stop = $this->reader->skipUntil('%>');\r\n\t\tif (is_null($stop))\r\n\t\t{\r\n\t\t\tthrow_exception(new PhaseException('Directive not properly ended.'));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->reader->skipSpaces();\r\n\t\treturn '';\r\n\t}", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testParsingExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1)\n ];\n $this->ast->getCurrentNode()\n ->addChild(new ExpressionNode('foo'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testParseCallbackWithMatch()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => function ($match) { return 'replaced !'.$match; },\n ];\n $extras = []; // extra needed parameters like paths \n\n $out = $this->parser->parse($file, $rule, $extras);\n\n $this->assertSame('replaced !#test', $out);\n }", "public function testRegexes()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /(ab)*/ \");\n $this->assertEquals(array(\"ababab\"), $grammar1->parse(\"ababab\"));\n $grammar = $this->grammar->parse(\" number ::= /a\\\\.b/ \");\n $this->assertEquals(array(\"a.b\"), $grammar->parse(\"a.b\"));\n\n $this->expectException(ParseFailureException::_CLASS);\n $grammar1->parse(\"aXb\");\n }", "public function testParseNoClass()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirectives::class, // wrong class\n ];\n $extras = []; // extra needed parameters like paths \n\n $this->expectException(CapriceException::class);\n $this->parser->parse($file, $rule, $extras);\n }", "public function testOperators()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var + some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var + some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') + \\$_o(\\$p, 'some_other_var'))?>\", \n $output\n );\n $output = $parser->parse('${some_var < some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var < some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') < \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var <= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var <= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') <= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var > some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var > some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') > \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var >= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var >= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') >= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var == some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var == some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') == \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var != some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var != some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') != \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${(some_var % some_other_var) == 0}');\n $this->assertEquals(\n \"<?php /* {(some_var % some_other_var) == 0} */ echo htmlentities((\\$_o(\\$p, 'some_var') % \\$_o(\\$p, 'some_other_var')) == 0)?>\", $output\n );\n $output = $parser->parse('${some_var / some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var / some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') / \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var * some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var * some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') * \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var - some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var - some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') - \\$_o(\\$p, 'some_other_var'))?>\", $output, \"my name\"\n );\n $output = $parser->parse('${(a + b + c) * (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) * (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) * (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) && (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) && (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) && (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) || (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) || (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) || (\\$_o(\\$p, 'd') - 3))?>\",\n $output\n );\n $output = $parser->parse('${foo == \\'a\\'}');\n $this->assertEquals(\"<?php /* {foo == 'a'} */ echo htmlentities(\\$_o(\\$p, 'foo') == 'a')?>\", $output);\n $output = $parser->parse('${foo == \"b\"}');\n $this->assertEquals(\"<?php /* {foo == \\\"b\\\"} */ echo htmlentities(\\$_o(\\$p, 'foo') == \\\"b\\\")?>\", $output); \n \n $output = $parser->parse('${(foo == \"b\" ? \"black\" : \"red\")}');\n $this->assertEquals(\n \"<?php /* {(foo == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\")} */ echo htmlentities((\\$_o(\\$p, 'foo') == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\"))?>\", \n $output\n ); \n $output = $parser->parseExpression('director->isLoggedIn() &amp;&amp; director->isSiteAdmin()');\n $this->assertEquals(\n \"\\$_o(\\$p, 'director')->isLoggedIn() && \\$_o(\\$p, 'director')->isSiteAdmin()\", \n $output\n );\n \n\n $parser->registerVariable(null, \"_field\");\n $output = $parser->parse('${_field->class != \\'\\' ? _field->class : \\'\\'}${(_field->error != \\'\\' ? \\' errored\\' : \\'\\')}');\n $this->assertEquals(\n '<?php /* {_field->class != \\'\\' ? _field->class : \\'\\'} */ echo htmlentities($_field->class != \\'\\' ? $_field->class : \\'\\')?><?php /* {(_field->error != \\'\\' ? \\' errored\\' : \\'\\')} */ echo htmlentities(($_field->error != \\'\\' ? \\' errored\\' : \\'\\'))?>',\n $output);\n $parser->unregisterVariable(null, \"_field\");\n \n }", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "public function testCompileEchoOpenDirective()\n {\n $this->caprice->directive('{{', \\Caprice\\Directives\\EchoOpenDirective::class, false);\n $out = $this->caprice->compile('echo-open-directive.cap.php');\n $this->assertCompileOutput('<?=__escape(', $out);\n }", "public function testCompileEndDoWhileDirective()\n {\n $this->caprice->directive('#enddo', \\Caprice\\Directives\\EndDoWhileDirective::class, false);\n $out = $this->caprice->compile('end-do-while-directive.cap.php');\n $this->assertCompileOutput('<?php } while($expression);?>', $out);\n }", "public function testParsingStatementsSurroundedByExpressions()\n {\n $tokens = [\n new Token(TokenTypes::T_EXPRESSION, 'a', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'b', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'c', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'd', 1),\n new Token(TokenTypes::T_EXPRESSION, '(e)', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_EXPRESSION, 'f', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'g', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'h', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'i', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'j', 1),\n ];\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('a'));\n $sanitizedTagNode = new SanitizedTagNode();\n $sanitizedTagNode->addChild(new ExpressionNode('b'));\n $this->ast->getCurrentNode()->addChild($sanitizedTagNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('c'));\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('d'));\n $directiveNode->addChild(new ExpressionNode('(e)'));\n $this->ast->getCurrentNode()->addChild($directiveNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('f'));\n $unsanitizedTagNode = new UnsanitizedTagNode();\n $unsanitizedTagNode->addChild(new ExpressionNode('g'));\n $this->ast->getCurrentNode()->addChild($unsanitizedTagNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('h'));\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('i'));\n $this->ast->getCurrentNode()->addChild($commentNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('j'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "function bar()\n{\n $demo = new Demonstration();\n $demo->executePrimeDirective();\n}", "public function testParse()\n {\n $source = array();\n $source[] = \"foo bar\";\n $source[] = \"\";\n $source[] = \"> line 1\";\n $source[] = \"> line 2\";\n $source[] = \"> \";\n $source[] = \"> line 3\";\n $source[] = \"> line 4\";\n $source[] = \"\";\n $source[] = \"baz dib\";\n $source = implode(\"\\n\", $source);\n \n $expect[] = \"foo bar\\n\";\n $expect[] = $this->_token . \"\\n\";\n $expect[] = \"baz dib\";\n $expect = implode(\"\\n\", $expect);\n \n $actual = $this->_plugin->parse($source);\n $this->assertRegex($actual, \"@$expect@\");\n }", "public function testSubparsers()\n {\n $grammar2 = $this->grammar->parse(\" S ::= ('a') \");\n $this->assertEquals(array(array(\"a\")), $grammar2->parse(\"a\"));\n }", "public function testInvalidOperator()\n {\n $this->parser->parse('{foo: {$asdasd: \"bar\"}}');\n }", "public function testParseClassMethod()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirective::class,\n ];\n $extras = []; // extra needed parameters like paths \n\n $out = $this->parser->parse($file, $rule, $extras);\n\n $this->assertSame('<?php ', $out);\n }", "public function test_detectCommands() : void\n {\n $subject = <<<'EOT'\nA text before the command.\n{code: \"ApacheVelocity\"}\nSome content here.\nIncluding a command: {showvar: $FOO.BAR}.\nOr even some CSS: \n<style>\n.className{\n color: #454545;\n}\n</style>\n{code}\nAnd after the command as well.\nEOT;\n\n $expected = <<<'EOT'\nA text before the command.\n{code: 1 \"ApacheVelocity\"}\nAnd after the command as well.\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertPreParserValid($parser);\n $this->assertSame(1, $parser->countCommands());\n $this->assertSame($expected, $parser->getString());\n }", "protected function doTest(string $expression, $parsed): void\n {\n if (!is_string($parsed)) {\n $this->assertEquals($parsed, $this->parser->parseExpression($expression));\n\n } else {\n $this->expectException(\n SyntaxException::class\n );\n $this->expectExceptionMessage($parsed);\n $this->parser->parseExpression($expression);\n }\n }", "public function testCompileEchoCloseDirective()\n {\n $this->caprice->directive('}}', \\Caprice\\Directives\\EchoCloseDirective::class, false);\n $out = $this->caprice->compile('echo-close-directive.cap.php');\n $this->assertCompileOutput(');?>', $out);\n }", "public function testSimpleTokens()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var}');\n $this->assertEquals(\"<?php /* {some_var} */ echo htmlentities(\\$_o(\\$p, 'some_var'))?>\", $output);\n $parser->registerVariable(null, 'my_var');\n $output = $parser->parse('${my_var}');\n $this->assertEquals(\"<?php /* {my_var} */ echo htmlentities(\\$my_var)?>\", $output);\n }", "public function directive(string $directive, mixed $callback): CapriceRules;", "public function testBasic()\n {\n $grammar2 = $this->grammar->parse(\" S ::= 'a' \");\n $this->assertEquals(array(\"a\"), $grammar2->parse(\"a\"));\n }", "public function test()\n {\n $doc = <<<DOC\n/**\n * Just some description. Should be ignored.\n */\nDOC;\n\n $this->tags['bar']->expects($this->never())->method('process');\n $this->tags['foo']->expects($this->never())->method('process');\n $this->tags['qux']->expects($this->never())->method('process');\n\n $result = $this->parser->parse($doc);\n\n $this->assertSame([], $result);\n }", "public function testMacroable()\n {\n Rule::macro('phone', function () {\n return 'regex:/^([0-9\\s\\-\\+\\(\\)]*)$/';\n });\n $c = Rule::phone();\n $this->assertSame('regex:/^([0-9\\s\\-\\+\\(\\)]*)$/', $c);\n }", "public function testMacroable()\n {\n Rule::macro('phone', function () {\n return 'regex:/^([0-9\\s\\-\\+\\(\\)]*)$/';\n });\n $c = Rule::phone();\n $this->assertSame('regex:/^([0-9\\s\\-\\+\\(\\)]*)$/', $c);\n }", "public function testParse() {\n $this->object->setParser(new Decoda());\n\n $this->assertEquals('<example>Content</example>', $this->object->parse([\n 'tag' => 'example',\n 'text' => '[example]',\n 'attributes' => [],\n 'type' => Decoda::TAG_OPEN,\n 'children' => ['Content']\n ], 'Content'));\n }", "protected function parseExpression()\n {\n $entities = array();\n while ($e = $this->matchFuncs(array('parseAddition', 'parseEntity'))) {\n $entities[] = $e;\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!$this->peekReg('/\\\\G\\/[\\/*]/') && ($delim = $this->matchChar('/'))) {\n $entities[] = new ILess_Node_Anonymous($delim);\n }\n }\n if (count($entities) > 0) {\n return new ILess_Node_Expression($entities);\n }\n }" ]
[ "0.70226127", "0.61396766", "0.59973776", "0.57434547", "0.56889236", "0.5511345", "0.54598963", "0.5403845", "0.5323057", "0.53187656", "0.5253623", "0.5186064", "0.51696086", "0.51622033", "0.5096056", "0.5091365", "0.49928847", "0.4982029", "0.4968166", "0.4967375", "0.49410555", "0.49394482", "0.48840156", "0.48634478", "0.48387802", "0.47710013", "0.4762068", "0.4762068", "0.4749489", "0.4747673" ]
0.7418258
0
Tests parsing a directive with no expression
public function testParsingDirectiveWithNoExpression() { $tokens = [ new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1), new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1), new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1), ]; $directiveNode = new DirectiveNode(); $directiveNode->addChild(new DirectiveNameNode('foo')); $this->ast->getCurrentNode() ->addChild($directiveNode); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testParseNoClass()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirectives::class, // wrong class\n ];\n $extras = []; // extra needed parameters like paths \n\n $this->expectException(CapriceException::class);\n $this->parser->parse($file, $rule, $extras);\n }", "function parseDirective()\r\n\t{\r\n\t\t$this->start = $this->reader->mark();\r\n\t\t// skip over directive\r\n\t\t$stop = $this->reader->skipUntil('%>');\r\n\t\tif (is_null($stop))\r\n\t\t{\r\n\t\t\tthrow_exception(new PhaseException('Directive not properly ended.'));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->reader->skipSpaces();\r\n\t\treturn '';\r\n\t}", "public function test()\n {\n $doc = <<<DOC\n/**\n * Just some description. Should be ignored.\n */\nDOC;\n\n $this->tags['bar']->expects($this->never())->method('process');\n $this->tags['foo']->expects($this->never())->method('process');\n $this->tags['qux']->expects($this->never())->method('process');\n\n $result = $this->parser->parse($doc);\n\n $this->assertSame([], $result);\n }", "public function testParsingDirectiveWithExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_EXPRESSION, '(\"bar\")', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n ];\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('foo'));\n $directiveNode->addChild(new ExpressionNode('(\"bar\")'));\n $this->ast->getCurrentNode()\n ->addChild($directiveNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testExceptionThrownWithUnclosedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1)]);\n }", "public function testParsingEmptyTokens()\n {\n $this->assertEquals($this->ast, $this->parser->parse([]));\n }", "protected function parseDirective()\n {\n $hasBlock = false;\n $hasIdentifier = false;\n $hasExpression = false;\n\n if (!$this->peekChar('@')) {\n return;\n }\n\n $value = $this->matchFuncs(array('parseImport', 'parseMedia'));\n if ($value) {\n return $value;\n }\n\n $this->save();\n $name = $this->matchReg('/\\\\G@[a-z-]+/');\n\n if (!$name) {\n return;\n }\n\n $nonVendorSpecificName = $name;\n $pos = strpos($name, '-', 2);\n if ($name[1] == '-' && $pos > 0) {\n $nonVendorSpecificName = '@' . substr($name, $pos + 1);\n }\n\n switch ($nonVendorSpecificName) {\n case '@font-face':\n $hasBlock = true;\n break;\n case '@viewport':\n case '@top-left':\n case '@top-left-corner':\n case '@top-center':\n case '@top-right':\n case '@top-right-corner':\n case '@bottom-left':\n case '@bottom-left-corner':\n case '@bottom-center':\n case '@bottom-right':\n case '@bottom-right-corner':\n case '@left-top':\n case '@left-middle':\n case '@left-bottom':\n case '@right-top':\n case '@right-middle':\n case '@right-bottom':\n $hasBlock = true;\n break;\n case '@host':\n case '@page':\n case '@document':\n case '@supports':\n case '@keyframes':\n $hasBlock = true;\n $hasIdentifier = true;\n break;\n case '@namespace':\n $hasExpression = true;\n break;\n }\n\n if ($hasIdentifier) {\n $identifier = $this->matchReg('/\\\\G[^{]+/');\n if ($identifier) {\n $name .= ' ' . trim($identifier);\n }\n }\n\n if ($hasBlock) {\n if ($rules = $this->parseBlock()) {\n return new ILess_Node_Directive($name, $rules, $this->position, $this->env->currentFileInfo);\n }\n } else {\n if (($value = $hasExpression ? $this->parseExpression() : $this->parseEntity()) && $this->matchChar(';')) {\n $directive = new ILess_Node_Directive($name, $value, $this->position, $this->env->currentFileInfo);\n if ($this->env->dumpLineNumbers) {\n $directive->debugInfo = $this->getDebugInfo($this->position, $this->input, $this->env);\n }\n\n return $directive;\n }\n }\n\n $this->restore();\n }", "public function testExceptionThrownWithUnopenedDirective()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)]);\n }", "#[@test]\n public function withoutExpression() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ?: 2;\n '));\n }", "public function testInvalidSyntaxWithEmpty(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([]);\n }", "function testIfnotWithoutRegex(){\n\t\t\n\t\t(new Param('email'))->filters()->ifnot('@', 'Email address should contain a @');\n\n\t\t$error = Param::get('email')->process(['email'=>'myemail.domain.com'])->error;\n\n\t\t$this->assertContains('should', $error);\n\n\t}", "public function test_extract_empty_no_match_pattern()\n {\n $method = new ExtractElementTextPattern($this->selectorProvider->get($this->itemCssSelector), [\n 'pattern' => $this->validNoMatchPattern\n ]);\n $value = $method->extract($this->crawler);\n $this->assertEquals('', $value);\n }", "public function testThrowsExceptionOnEmptyReport()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('html');\n }", "public function globalStringConditionMatchesEmptyRegularExpression() {}", "public function globalStringConditionMatchesEmptyRegularExpression() {}", "public function testParseWithZero(): void\n {\n $this->assertSame(0, $this->parser->parse([Grammar::T_N]));\n }", "public function testExceptionThrownWithNestedDirective()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'bar', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function notValidDirectives()\n {\n // check if $this->directives KEY is listed on allowed VALUES\n return $this->directives->filter(function ($item, $key) {\n return !$this->getAllowedDirectives()->flatten()->contains($key);\n });\n }", "public function testAssertResponseNotRegExpNoResponse(): void\n {\n $this->expectException(AssertionFailedError::class);\n $this->expectExceptionMessage('No response set');\n $this->assertResponseNotRegExp('/cont/');\n }", "public function test_extract_empty_pattern_wrong_param()\n {\n $method = new ExtractElementTextPattern($this->selectorProvider->get($this->itemCssSelector), [\n 'pattern' => $this->validPatternWrongParam,\n ]);\n $value = $method->extract($this->crawler);\n $this->assertEquals('', $value);\n }", "public function testParseWithOneUnknownToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Unknown token \".\" at position 0');\n\n $this->parser->parse(['.']);\n }", "public function testInvalidOperator()\n {\n $this->parser->parse('{foo: {$asdasd: \"bar\"}}');\n }", "public function testAssertResponseRegExpNoResponse(): void\n {\n $this->expectException(AssertionFailedError::class);\n $this->expectExceptionMessage('No response set');\n $this->assertResponseRegExp('/cont/');\n }", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "public function test_extract_empty()\n {\n $method = new ExtractElementTextPattern($this->selectorProvider->get($this->noItemsCssSelector), [\n 'pattern' => $this->validCorrectPattern\n ]);\n $value = $method->extract($this->crawler);\n $this->assertEquals('', $value);\n }", "public function testHasKindsSupport0()\n{\n\n $actual = $this->parserFactory->hasKindsSupport();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testIgnoredAnnotationSkippedBeforeReflection() {\n $annotation = 'neverReflectThis';\n $parser = new DocParser();\n $parser->setIgnoredAnnotationNames([$annotation => TRUE]);\n $parser->addNamespace('\\\\Arbitrary\\\\Namespace');\n\n // Register our class loader which will fail if the parser tries to\n // autoload disallowed annotations.\n $autoloader = function ($class_name) use ($annotation) {\n $name_array = explode('\\\\', $class_name);\n $name = array_pop($name_array);\n if ($name == $annotation) {\n $this->fail('Attempted to autoload an ignored annotation: ' . $name);\n }\n };\n spl_autoload_register($autoloader, TRUE, TRUE);\n // Perform the parse.\n $this->assertEmpty($parser->parse('@neverReflectThis'));\n // Clean up after ourselves.\n spl_autoload_unregister($autoloader);\n }" ]
[ "0.6484447", "0.5981677", "0.597857", "0.590272", "0.5882822", "0.57158434", "0.5702819", "0.5680986", "0.5631366", "0.5600782", "0.5503056", "0.5474548", "0.5453887", "0.5431626", "0.5431249", "0.53707194", "0.5314895", "0.5302081", "0.524408", "0.51932484", "0.5191844", "0.5170695", "0.51248544", "0.5018664", "0.50186104", "0.50123703", "0.50123185", "0.5001029", "0.4970485", "0.49701723" ]
0.80932873
0
Tests parsing empty tokens
public function testParsingEmptyTokens() { $this->assertEquals($this->ast, $this->parser->parse([])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInvalidSyntaxWithEmpty(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([]);\n }", "public function testParseWithOneInvalidToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid token type \"integer\" at position 0');\n\n $this->parser->parse([0]);\n }", "public function testParseWithZero(): void\n {\n $this->assertSame(0, $this->parser->parse([Grammar::T_N]));\n }", "public function testParseWithOneUnknownToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Unknown token \".\" at position 0');\n\n $this->parser->parse(['.']);\n }", "public function testParseWithOneLookaheadTokenAndOneSimpleToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_X, Grammar::T_V]);\n }", "public function testParseWithMultipleTokens(): void\n {\n $this->assertSame(6, $this->parser->parse([Grammar::T_V, Grammar::T_I]));\n $this->assertSame(13, $this->parser->parse([Grammar::T_X, Grammar::T_I, Grammar::T_I, Grammar::T_I]));\n $this->assertSame(111, $this->parser->parse([Grammar::T_C, Grammar::T_X, Grammar::T_I]));\n }", "public function testParse()\n {\n $source = array();\n $source[] = \"foo bar\";\n $source[] = \"\";\n $source[] = \"> line 1\";\n $source[] = \"> line 2\";\n $source[] = \"> \";\n $source[] = \"> line 3\";\n $source[] = \"> line 4\";\n $source[] = \"\";\n $source[] = \"baz dib\";\n $source = implode(\"\\n\", $source);\n \n $expect[] = \"foo bar\\n\";\n $expect[] = $this->_token . \"\\n\";\n $expect[] = \"baz dib\";\n $expect = implode(\"\\n\", $expect);\n \n $actual = $this->_plugin->parse($source);\n $this->assertRegex($actual, \"@$expect@\");\n }", "public function testParseWithFourSimpleTokensInSequence(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_I, Grammar::T_I, Grammar::T_I]);\n }", "public function testParsingEmptyHeader() {\n\t\t$headers = new Headers();\n\t\t$parsed = Cookie::parse_from_headers($headers);\n\n\t\t$this->assertIsArray($parsed, 'Return value is not an array');\n\t\t$this->assertCount(0, $parsed, 'Returned array is not empty');\n\t}", "public function testTokenScan() {\n // Define text with valid and not valid, fake and existing token-like\n // strings.\n $text = 'First a [valid:simple], but dummy token, and a dummy [valid:token with: spaces].';\n $text .= 'Then a [not valid:token].';\n $text .= 'Then an [:empty token type].';\n $text .= 'Then an [empty token:].';\n $text .= 'Then a totally empty token: [:].';\n $text .= 'Last an existing token: [node:author:name].';\n $token_wannabes = \\Drupal::token()->scan($text);\n\n $this->assertTrue(isset($token_wannabes['valid']['simple']), 'A simple valid token has been matched.');\n $this->assertTrue(isset($token_wannabes['valid']['token with: spaces']), 'A valid token with space characters in the token name has been matched.');\n $this->assertFalse(isset($token_wannabes['not valid']), 'An invalid token with spaces in the token type has not been matched.');\n $this->assertFalse(isset($token_wannabes['empty token']), 'An empty token has not been matched.');\n $this->assertFalse(isset($token_wannabes['']['empty token type']), 'An empty token type has not been matched.');\n $this->assertFalse(isset($token_wannabes['']['']), 'An empty token and type has not been matched.');\n $this->assertTrue(isset($token_wannabes['node']), 'An existing valid token has been matched.');\n }", "public function testInvalidSyntaxWithZero(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_N, Grammar::T_I]);\n }", "public function testAnotherInvalidSyntaxWithZero(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_N]);\n }", "public function testThrowsExceptionOnEmptyReport()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('html');\n }", "public function test_extract_empty()\n {\n $method = new ExtractElementTextPattern($this->selectorProvider->get($this->noItemsCssSelector), [\n 'pattern' => $this->validCorrectPattern\n ]);\n $value = $method->extract($this->crawler);\n $this->assertEquals('', $value);\n }", "public function testBasic()\n {\n $grammar2 = $this->grammar->parse(\" S ::= 'a' \");\n $this->assertEquals(array(\"a\"), $grammar2->parse(\"a\"));\n }", "public function testParseWithLookaheadRemovalTokens(): void\n {\n $this->assertSame(9, $this->parser->parse([Grammar::T_I, Grammar::T_X]));\n $this->assertSame(99, $this->parser->parse([Grammar::T_X, Grammar::T_C, Grammar::T_I, Grammar::T_X]));\n }", "public function testIsInvalidEmptyPost() {\n\t\t$this->assertFalse($this->match->validate(array()));\n\t}", "public function testLoadLayoutEmpty()\n {\n $context = $this->createPageContext();\n $tokenStorage = $this->createTokenStorage();\n $token = $context->createEditToken([], ['user_id' => 17]);\n $tokenString = $token->getToken();\n\n // Seems stupid, but actually we can load nothing\n $tokenStorage->saveToken($token);\n $ret = $tokenStorage->loadMultiple($tokenString, []);\n $this->assertEmpty($ret);\n\n // But still should failed when token does not exists\n try {\n $tokenStorage->loadMultiple('some_non_existing_arbitrary_token', []);\n $this->fail();\n } catch (InvalidTokenError $e) {\n $this->assertTrue(true);\n }\n }", "public function testParseWithTwoTokensWithLookaheadRemoval(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_X, Grammar::T_I, Grammar::T_X]);\n }", "public function testSimpleTokens()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var}');\n $this->assertEquals(\"<?php /* {some_var} */ echo htmlentities(\\$_o(\\$p, 'some_var'))?>\", $output);\n $parser->registerVariable(null, 'my_var');\n $output = $parser->parse('${my_var}');\n $this->assertEquals(\"<?php /* {my_var} */ echo htmlentities(\\$my_var)?>\", $output);\n }", "public function test_extract_empty_no_match_pattern()\n {\n $method = new ExtractElementTextPattern($this->selectorProvider->get($this->itemCssSelector), [\n 'pattern' => $this->validNoMatchPattern\n ]);\n $value = $method->extract($this->crawler);\n $this->assertEquals('', $value);\n }", "public function testGetByTokenFailsWithEmptyTokenId(): void\n {\n // Creates expectation.\n $this->expectException(\\InvalidArgumentException::class);\n\n // Performs test.\n $this->repository->getByToken('');\n }", "static function unittest_nonEmptyString () {\n // @todo: Fix and enable.\n return;\n PhlintTest::assertNoIssues('\n $foo = \"\";\n if (!empty($foo))\n foreach ($foo as $bar) {}\n ');\n }", "public function testParse(): void\n {\n $decrypt = (new Crypto())->decrypt(Constants::ENV_ENC_TEST, Constants::ENV_KEY_TEST);\n\n $parsed = Parser::parse($decrypt);\n\n $this->assertNotEmpty($parsed);\n $this->assertSame(['FOO' => 'bar'], $parsed);\n }", "public function test()\n {\n $doc = <<<DOC\n/**\n * Just some description. Should be ignored.\n */\nDOC;\n\n $this->tags['bar']->expects($this->never())->method('process');\n $this->tags['foo']->expects($this->never())->method('process');\n $this->tags['qux']->expects($this->never())->method('process');\n\n $result = $this->parser->parse($doc);\n\n $this->assertSame([], $result);\n }", "function mISBLANK(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$ISBLANK;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:266:3: ( 'isblank' ) \n // Tokenizer11.g:267:3: 'isblank' \n {\n $this->matchString(\"isblank\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function testAnotherInvalidSyntax(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_X, Grammar::T_X, Grammar::T_C]);\n }", "#[Group('6261')]\n public function testEmptyCharList(): void\n {\n $this->filter->setCharList('0');\n self::assertSame('a0b', $this->filter->filter('00a0b00'));\n\n $this->filter->setCharList('');\n self::assertSame('str', $this->filter->filter(' str '));\n }", "public function processNoneStateChangingCharacters()\n {\n $this->mockAnnotationParser->expects($this->never())->method('changeState');\n $this->textState->process('a');\n $this->textState->process('1');\n $this->textState->process('(');\n $this->textState->process('[');\n $this->textState->process('_');\n $this->textState->process('.');\n $this->textState->process('*');\n $this->textState->process(' ');\n }", "public function hasToken ()\n {\n return $this->peekAtToken() !== NULL;\n }" ]
[ "0.76349837", "0.68583006", "0.68387187", "0.6755151", "0.65272874", "0.6498995", "0.63905066", "0.6351166", "0.62705547", "0.6188358", "0.61375195", "0.61357933", "0.60886574", "0.6078836", "0.6030208", "0.60111976", "0.6010221", "0.5951533", "0.59381485", "0.5899862", "0.58810115", "0.58669204", "0.58469677", "0.58283013", "0.57883745", "0.5772593", "0.57276314", "0.5708604", "0.5705298", "0.567798" ]
0.87584656
0
Tests parsing an expression
public function testParsingExpression() { $tokens = [ new Token(TokenTypes::T_EXPRESSION, 'foo', 1) ]; $this->ast->getCurrentNode() ->addChild(new ExpressionNode('foo')); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRegexes()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /(ab)*/ \");\n $this->assertEquals(array(\"ababab\"), $grammar1->parse(\"ababab\"));\n $grammar = $this->grammar->parse(\" number ::= /a\\\\.b/ \");\n $this->assertEquals(array(\"a.b\"), $grammar->parse(\"a.b\"));\n\n $this->expectException(ParseFailureException::_CLASS);\n $grammar1->parse(\"aXb\");\n }", "protected function doTest(string $expression, $parsed): void\n {\n if (!is_string($parsed)) {\n $this->assertEquals($parsed, $this->parser->parseExpression($expression));\n\n } else {\n $this->expectException(\n SyntaxException::class\n );\n $this->expectExceptionMessage($parsed);\n $this->parser->parseExpression($expression);\n }\n }", "public function testParsingStatementsSurroundedByExpressions()\n {\n $tokens = [\n new Token(TokenTypes::T_EXPRESSION, 'a', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'b', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'c', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'd', 1),\n new Token(TokenTypes::T_EXPRESSION, '(e)', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_EXPRESSION, 'f', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'g', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'h', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'i', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'j', 1),\n ];\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('a'));\n $sanitizedTagNode = new SanitizedTagNode();\n $sanitizedTagNode->addChild(new ExpressionNode('b'));\n $this->ast->getCurrentNode()->addChild($sanitizedTagNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('c'));\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('d'));\n $directiveNode->addChild(new ExpressionNode('(e)'));\n $this->ast->getCurrentNode()->addChild($directiveNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('f'));\n $unsanitizedTagNode = new UnsanitizedTagNode();\n $unsanitizedTagNode->addChild(new ExpressionNode('g'));\n $this->ast->getCurrentNode()->addChild($unsanitizedTagNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('h'));\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('i'));\n $this->ast->getCurrentNode()->addChild($commentNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('j'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "protected function parseExpression()\n {\n $entities = array();\n while ($e = $this->matchFuncs(array('parseAddition', 'parseEntity'))) {\n $entities[] = $e;\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!$this->peekReg('/\\\\G\\/[\\/*]/') && ($delim = $this->matchChar('/'))) {\n $entities[] = new ILess_Node_Anonymous($delim);\n }\n }\n if (count($entities) > 0) {\n return new ILess_Node_Expression($entities);\n }\n }", "public function testParsingPhpExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_PHP_TAG_OPEN, '<?php', 1),\n new Token(TokenTypes::T_EXPRESSION, 'echo \"foo\";', 1),\n new Token(TokenTypes::T_PHP_TAG_CLOSE, '?>', 1)\n ];\n $this->ast->getCurrentNode()\n ->addChild(new ExpressionNode('<?php'))\n ->addChild(new ExpressionNode('echo \"foo\";'))\n ->addChild(new ExpressionNode('?>'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testInvalidOperator()\n {\n $this->parser->parse('{foo: {$asdasd: \"bar\"}}');\n }", "public function testOperators()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var + some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var + some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') + \\$_o(\\$p, 'some_other_var'))?>\", \n $output\n );\n $output = $parser->parse('${some_var < some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var < some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') < \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var <= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var <= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') <= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var > some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var > some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') > \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var >= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var >= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') >= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var == some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var == some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') == \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var != some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var != some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') != \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${(some_var % some_other_var) == 0}');\n $this->assertEquals(\n \"<?php /* {(some_var % some_other_var) == 0} */ echo htmlentities((\\$_o(\\$p, 'some_var') % \\$_o(\\$p, 'some_other_var')) == 0)?>\", $output\n );\n $output = $parser->parse('${some_var / some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var / some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') / \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var * some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var * some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') * \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var - some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var - some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') - \\$_o(\\$p, 'some_other_var'))?>\", $output, \"my name\"\n );\n $output = $parser->parse('${(a + b + c) * (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) * (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) * (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) && (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) && (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) && (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) || (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) || (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) || (\\$_o(\\$p, 'd') - 3))?>\",\n $output\n );\n $output = $parser->parse('${foo == \\'a\\'}');\n $this->assertEquals(\"<?php /* {foo == 'a'} */ echo htmlentities(\\$_o(\\$p, 'foo') == 'a')?>\", $output);\n $output = $parser->parse('${foo == \"b\"}');\n $this->assertEquals(\"<?php /* {foo == \\\"b\\\"} */ echo htmlentities(\\$_o(\\$p, 'foo') == \\\"b\\\")?>\", $output); \n \n $output = $parser->parse('${(foo == \"b\" ? \"black\" : \"red\")}');\n $this->assertEquals(\n \"<?php /* {(foo == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\")} */ echo htmlentities((\\$_o(\\$p, 'foo') == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\"))?>\", \n $output\n ); \n $output = $parser->parseExpression('director->isLoggedIn() &amp;&amp; director->isSiteAdmin()');\n $this->assertEquals(\n \"\\$_o(\\$p, 'director')->isLoggedIn() && \\$_o(\\$p, 'director')->isSiteAdmin()\", \n $output\n );\n \n\n $parser->registerVariable(null, \"_field\");\n $output = $parser->parse('${_field->class != \\'\\' ? _field->class : \\'\\'}${(_field->error != \\'\\' ? \\' errored\\' : \\'\\')}');\n $this->assertEquals(\n '<?php /* {_field->class != \\'\\' ? _field->class : \\'\\'} */ echo htmlentities($_field->class != \\'\\' ? $_field->class : \\'\\')?><?php /* {(_field->error != \\'\\' ? \\' errored\\' : \\'\\')} */ echo htmlentities(($_field->error != \\'\\' ? \\' errored\\' : \\'\\'))?>',\n $output);\n $parser->unregisterVariable(null, \"_field\");\n \n }", "public function testParsingDirectiveWithExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_EXPRESSION, '(\"bar\")', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n ];\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('foo'));\n $directiveNode->addChild(new ExpressionNode('(\"bar\")'));\n $this->ast->getCurrentNode()\n ->addChild($directiveNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testAnotherInvalidSyntax(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_X, Grammar::T_X, Grammar::T_C]);\n }", "public function testEvaluate()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + *\");\n $this->assertEquals(9, $retval);\n }", "function _parse_is_expr($is_arg, $tokens)\n\t{\n\t\t$expr_end = 0;\n\t\t$negate_expr = false;\n\n\t\tif (($first_token = array_shift($tokens)) == 'not')\n\t\t{\n\t\t\t$negate_expr = true;\n\t\t\t$expr_type = array_shift($tokens);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expr_type = $first_token;\n\t\t}\n\n\t\tswitch ($expr_type)\n\t\t{\n\t\t\tcase 'even':\n\t\t\t\tif (@$tokens[$expr_end] == 'by')\n\t\t\t\t{\n\t\t\t\t\t$expr_end++;\n\t\t\t\t\t$expr_arg = $tokens[$expr_end++];\n\t\t\t\t\t$expr = \"!(($is_arg / $expr_arg) % $expr_arg)\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$expr = \"!($is_arg & 1)\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'odd':\n\t\t\t\tif (@$tokens[$expr_end] == 'by')\n\t\t\t\t{\n\t\t\t\t\t$expr_end++;\n\t\t\t\t\t$expr_arg = $tokens[$expr_end++];\n\t\t\t\t\t$expr = \"(($is_arg / $expr_arg) % $expr_arg)\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$expr = \"($is_arg & 1)\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'div':\n\t\t\t\tif (@$tokens[$expr_end] == 'by')\n\t\t\t\t{\n\t\t\t\t\t$expr_end++;\n\t\t\t\t\t$expr_arg = $tokens[$expr_end++];\n\t\t\t\t\t$expr = \"!($is_arg % $expr_arg)\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($negate_expr)\n\t\t{\n\t\t\t$expr = \"!($expr)\";\n\t\t}\n\n\t\tarray_splice($tokens, 0, $expr_end, $expr);\n\n\t\treturn $tokens;\n\t}", "public function testParse()\n {\n $source = array();\n $source[] = \"foo bar\";\n $source[] = \"\";\n $source[] = \"> line 1\";\n $source[] = \"> line 2\";\n $source[] = \"> \";\n $source[] = \"> line 3\";\n $source[] = \"> line 4\";\n $source[] = \"\";\n $source[] = \"baz dib\";\n $source = implode(\"\\n\", $source);\n \n $expect[] = \"foo bar\\n\";\n $expect[] = $this->_token . \"\\n\";\n $expect[] = \"baz dib\";\n $expect = implode(\"\\n\", $expect);\n \n $actual = $this->_plugin->parse($source);\n $this->assertRegex($actual, \"@$expect@\");\n }", "public function testBasic()\n {\n $grammar2 = $this->grammar->parse(\" S ::= 'a' \");\n $this->assertEquals(array(\"a\"), $grammar2->parse(\"a\"));\n }", "public function testInvalidSyntaxWithEmpty(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([]);\n }", "public function testSubparsers()\n {\n $grammar2 = $this->grammar->parse(\" S ::= ('a') \");\n $this->assertEquals(array(array(\"a\")), $grammar2->parse(\"a\"));\n }", "public function testParseWithOneInvalidToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid token type \"integer\" at position 0');\n\n $this->parser->parse([0]);\n }", "function e($expr) \n {\n //call the core evaluation method\n return $this->evaluate($expr);\n }", "protected function parseExpression($expression) {\n\t\t$expression = str_replace(\n\t\t\tarray('{', '}', '[', ']', '`', ';'),\n\t\t\tarray('&#123', '&#125', '&#91', '&#93', '&#96', '&#59'),\n\t\t\t$expression\n\t\t);\n\t\tif ($this->isExpression($expression)) {\n\t\t\t$this->checkSafety($expression);\n\t\t}\n\t\treturn $expression;\n\t}", "protected function isExpression($string) {\n\t\tif (preg_match(\"/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}( \\d{1,2}\\:\\d{1,2}:\\d{1,2})?$/\", $string)) { // date\n\t\t\treturn false;\n\t\t}\n\t\treturn preg_match('/[\\(\\+\\-\\/\\*\\%]/', $string);\n\t}", "public function parse($expression)\n {\n $pegExpressionParserPath = $this->cachePath . self::RELATIVE_CACHED_PARSER_PATH;\n\n if (!is_file($pegExpressionParserPath) || !is_readable($pegExpressionParserPath)) {\n throw new RuntimeException('Unable to find compiled ExpressionLanguage parser');\n }\n\n require_once $pegExpressionParserPath;\n\n // Included just above rather than autoloaded\n $parser = new PegExpressionParser($expression);\n\n $result = $parser->match_Expression() ;\n\n if ($result === false) {\n throw new ParseFailedException('Could not parse expression string \"' . $expression . '\"');\n }\n\n if ($result['text'] !== $expression) {\n throw new ParseFailedException('Could not parse expression string \"' . $expression . '\"');\n }\n\n return $result['node'];\n }", "public function testParseWithOneLookaheadTokenAndOneSimpleToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_X, Grammar::T_V]);\n }", "public function testParseWithZero(): void\n {\n $this->assertSame(0, $this->parser->parse([Grammar::T_N]));\n }", "public function testRunRuleParser()\n {\n $rules = [\n 'var1' => 'alpha|between:min=10,max=100',\n 'var2' => 'email',\n 'var3' => 'alpha',\n ];\n $rulesBag = $this->ruleParse->run($rules);\n $this->assertInstanceOf(Sparta\\RulesBag::class, $rulesBag);\n $this->assertEquals($rulesBag, $this->ruleParse->getRulesBag());\n }", "public function testAnotherInvalidSyntaxWithZero(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_N]);\n }", "public function testParseThrowsExceptionWhenInvalidFormatting(): void\n {\n $lines = ['double=equals=here'];\n\n $parser = new IniParser('');\n $parser->setFileLines($lines);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Too many equals in line: double=equals=here');\n $parser->parse();\n }", "public function testParse(): void\n {\n $decrypt = (new Crypto())->decrypt(Constants::ENV_ENC_TEST, Constants::ENV_KEY_TEST);\n\n $parsed = Parser::parse($decrypt);\n\n $this->assertNotEmpty($parsed);\n $this->assertSame(['FOO' => 'bar'], $parsed);\n }", "public function regexExpression(){\n try {\n // Sparql11query.g:517:3: ( REGEX OPEN_BRACE expression COMMA expression ( COMMA expression )? CLOSE_BRACE ) \n // Sparql11query.g:518:3: REGEX OPEN_BRACE expression COMMA expression ( COMMA expression )? CLOSE_BRACE \n {\n $this->match($this->input,$this->getToken('REGEX'),self::$FOLLOW_REGEX_in_regexExpression1889); \n $this->match($this->input,$this->getToken('OPEN_BRACE'),self::$FOLLOW_OPEN_BRACE_in_regexExpression1891); \n $this->pushFollow(self::$FOLLOW_expression_in_regexExpression1893);\n $this->expression();\n\n $this->state->_fsp--;\n\n $this->match($this->input,$this->getToken('COMMA'),self::$FOLLOW_COMMA_in_regexExpression1895); \n $this->pushFollow(self::$FOLLOW_expression_in_regexExpression1897);\n $this->expression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:518:48: ( COMMA expression )? \n $alt56=2;\n $LA56_0 = $this->input->LA(1);\n\n if ( ($LA56_0==$this->getToken('COMMA')) ) {\n $alt56=1;\n }\n switch ($alt56) {\n case 1 :\n // Sparql11query.g:518:49: COMMA expression \n {\n $this->match($this->input,$this->getToken('COMMA'),self::$FOLLOW_COMMA_in_regexExpression1900); \n $this->pushFollow(self::$FOLLOW_expression_in_regexExpression1902);\n $this->expression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n\n $this->match($this->input,$this->getToken('CLOSE_BRACE'),self::$FOLLOW_CLOSE_BRACE_in_regexExpression1906); \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 }", "abstract public function testInactiveExpression();", "public static function expr()\n {\n $out = call_user_func_array('self::parse', func_get_args());\n $obj = text($out);\n return $obj;\n }", "public function testParseWithOneUnknownToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Unknown token \".\" at position 0');\n\n $this->parser->parse(['.']);\n }" ]
[ "0.6976829", "0.66666293", "0.6474439", "0.6443412", "0.6436573", "0.63361114", "0.62323993", "0.61345196", "0.61034936", "0.606295", "0.603211", "0.59757894", "0.5902179", "0.5867491", "0.58648187", "0.585393", "0.58271235", "0.58271164", "0.5822173", "0.5784395", "0.577248", "0.5753167", "0.5725553", "0.57167757", "0.5712947", "0.56854546", "0.56703645", "0.5626896", "0.5626271", "0.5622404" ]
0.79947287
0
Tests parsing a PHP expression
public function testParsingPhpExpression() { $tokens = [ new Token(TokenTypes::T_PHP_TAG_OPEN, '<?php', 1), new Token(TokenTypes::T_EXPRESSION, 'echo "foo";', 1), new Token(TokenTypes::T_PHP_TAG_CLOSE, '?>', 1) ]; $this->ast->getCurrentNode() ->addChild(new ExpressionNode('<?php')) ->addChild(new ExpressionNode('echo "foo";')) ->addChild(new ExpressionNode('?>')); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testParsingExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1)\n ];\n $this->ast->getCurrentNode()\n ->addChild(new ExpressionNode('foo'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testOperators()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var + some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var + some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') + \\$_o(\\$p, 'some_other_var'))?>\", \n $output\n );\n $output = $parser->parse('${some_var < some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var < some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') < \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var <= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var <= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') <= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var > some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var > some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') > \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var >= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var >= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') >= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var == some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var == some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') == \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var != some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var != some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') != \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${(some_var % some_other_var) == 0}');\n $this->assertEquals(\n \"<?php /* {(some_var % some_other_var) == 0} */ echo htmlentities((\\$_o(\\$p, 'some_var') % \\$_o(\\$p, 'some_other_var')) == 0)?>\", $output\n );\n $output = $parser->parse('${some_var / some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var / some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') / \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var * some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var * some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') * \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var - some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var - some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') - \\$_o(\\$p, 'some_other_var'))?>\", $output, \"my name\"\n );\n $output = $parser->parse('${(a + b + c) * (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) * (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) * (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) && (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) && (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) && (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) || (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) || (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) || (\\$_o(\\$p, 'd') - 3))?>\",\n $output\n );\n $output = $parser->parse('${foo == \\'a\\'}');\n $this->assertEquals(\"<?php /* {foo == 'a'} */ echo htmlentities(\\$_o(\\$p, 'foo') == 'a')?>\", $output);\n $output = $parser->parse('${foo == \"b\"}');\n $this->assertEquals(\"<?php /* {foo == \\\"b\\\"} */ echo htmlentities(\\$_o(\\$p, 'foo') == \\\"b\\\")?>\", $output); \n \n $output = $parser->parse('${(foo == \"b\" ? \"black\" : \"red\")}');\n $this->assertEquals(\n \"<?php /* {(foo == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\")} */ echo htmlentities((\\$_o(\\$p, 'foo') == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\"))?>\", \n $output\n ); \n $output = $parser->parseExpression('director->isLoggedIn() &amp;&amp; director->isSiteAdmin()');\n $this->assertEquals(\n \"\\$_o(\\$p, 'director')->isLoggedIn() && \\$_o(\\$p, 'director')->isSiteAdmin()\", \n $output\n );\n \n\n $parser->registerVariable(null, \"_field\");\n $output = $parser->parse('${_field->class != \\'\\' ? _field->class : \\'\\'}${(_field->error != \\'\\' ? \\' errored\\' : \\'\\')}');\n $this->assertEquals(\n '<?php /* {_field->class != \\'\\' ? _field->class : \\'\\'} */ echo htmlentities($_field->class != \\'\\' ? $_field->class : \\'\\')?><?php /* {(_field->error != \\'\\' ? \\' errored\\' : \\'\\')} */ echo htmlentities(($_field->error != \\'\\' ? \\' errored\\' : \\'\\'))?>',\n $output);\n $parser->unregisterVariable(null, \"_field\");\n \n }", "public function testRegexes()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /(ab)*/ \");\n $this->assertEquals(array(\"ababab\"), $grammar1->parse(\"ababab\"));\n $grammar = $this->grammar->parse(\" number ::= /a\\\\.b/ \");\n $this->assertEquals(array(\"a.b\"), $grammar->parse(\"a.b\"));\n\n $this->expectException(ParseFailureException::_CLASS);\n $grammar1->parse(\"aXb\");\n }", "public function testInvalidOperator()\n {\n $this->parser->parse('{foo: {$asdasd: \"bar\"}}');\n }", "public function testParsingStatementsSurroundedByExpressions()\n {\n $tokens = [\n new Token(TokenTypes::T_EXPRESSION, 'a', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'b', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'c', 1),\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'd', 1),\n new Token(TokenTypes::T_EXPRESSION, '(e)', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n new Token(TokenTypes::T_EXPRESSION, 'f', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'g', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'h', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'i', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_EXPRESSION, 'j', 1),\n ];\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('a'));\n $sanitizedTagNode = new SanitizedTagNode();\n $sanitizedTagNode->addChild(new ExpressionNode('b'));\n $this->ast->getCurrentNode()->addChild($sanitizedTagNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('c'));\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('d'));\n $directiveNode->addChild(new ExpressionNode('(e)'));\n $this->ast->getCurrentNode()->addChild($directiveNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('f'));\n $unsanitizedTagNode = new UnsanitizedTagNode();\n $unsanitizedTagNode->addChild(new ExpressionNode('g'));\n $this->ast->getCurrentNode()->addChild($unsanitizedTagNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('h'));\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('i'));\n $this->ast->getCurrentNode()->addChild($commentNode);\n $this->ast->getCurrentNode()->addChild(new ExpressionNode('j'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testParse()\n {\n $source = array();\n $source[] = \"foo bar\";\n $source[] = \"\";\n $source[] = \"> line 1\";\n $source[] = \"> line 2\";\n $source[] = \"> \";\n $source[] = \"> line 3\";\n $source[] = \"> line 4\";\n $source[] = \"\";\n $source[] = \"baz dib\";\n $source = implode(\"\\n\", $source);\n \n $expect[] = \"foo bar\\n\";\n $expect[] = $this->_token . \"\\n\";\n $expect[] = \"baz dib\";\n $expect = implode(\"\\n\", $expect);\n \n $actual = $this->_plugin->parse($source);\n $this->assertRegex($actual, \"@$expect@\");\n }", "function testBackendFunctionResult() {\n $php = \"return 'bar'\";\n $this->drush('php-eval', array($php), array('backend' => NULL));\n $parsed = parse_backend_output($this->getOutput());\n // assert that $parsed has 'bar'\n $this->assertEquals(\"'bar'\", var_export($parsed['object'], TRUE));\n }", "public function testEvaluate()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + *\");\n $this->assertEquals(9, $retval);\n }", "protected function doTest(string $expression, $parsed): void\n {\n if (!is_string($parsed)) {\n $this->assertEquals($parsed, $this->parser->parseExpression($expression));\n\n } else {\n $this->expectException(\n SyntaxException::class\n );\n $this->expectExceptionMessage($parsed);\n $this->parser->parseExpression($expression);\n }\n }", "function _parse_is_expr($is_arg, $tokens)\n\t{\n\t\t$expr_end = 0;\n\t\t$negate_expr = false;\n\n\t\tif (($first_token = array_shift($tokens)) == 'not')\n\t\t{\n\t\t\t$negate_expr = true;\n\t\t\t$expr_type = array_shift($tokens);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expr_type = $first_token;\n\t\t}\n\n\t\tswitch ($expr_type)\n\t\t{\n\t\t\tcase 'even':\n\t\t\t\tif (@$tokens[$expr_end] == 'by')\n\t\t\t\t{\n\t\t\t\t\t$expr_end++;\n\t\t\t\t\t$expr_arg = $tokens[$expr_end++];\n\t\t\t\t\t$expr = \"!(($is_arg / $expr_arg) % $expr_arg)\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$expr = \"!($is_arg & 1)\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'odd':\n\t\t\t\tif (@$tokens[$expr_end] == 'by')\n\t\t\t\t{\n\t\t\t\t\t$expr_end++;\n\t\t\t\t\t$expr_arg = $tokens[$expr_end++];\n\t\t\t\t\t$expr = \"(($is_arg / $expr_arg) % $expr_arg)\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$expr = \"($is_arg & 1)\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'div':\n\t\t\t\tif (@$tokens[$expr_end] == 'by')\n\t\t\t\t{\n\t\t\t\t\t$expr_end++;\n\t\t\t\t\t$expr_arg = $tokens[$expr_end++];\n\t\t\t\t\t$expr = \"!($is_arg % $expr_arg)\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($negate_expr)\n\t\t{\n\t\t\t$expr = \"!($expr)\";\n\t\t}\n\n\t\tarray_splice($tokens, 0, $expr_end, $expr);\n\n\t\treturn $tokens;\n\t}", "protected function parseExpression()\n {\n $entities = array();\n while ($e = $this->matchFuncs(array('parseAddition', 'parseEntity'))) {\n $entities[] = $e;\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!$this->peekReg('/\\\\G\\/[\\/*]/') && ($delim = $this->matchChar('/'))) {\n $entities[] = new ILess_Node_Anonymous($delim);\n }\n }\n if (count($entities) > 0) {\n return new ILess_Node_Expression($entities);\n }\n }", "function parse_php($string) {\n ob_start();\n eval('?>'.$string);\n $string = ob_get_contents();\n ob_end_clean();\n return $string;\n}", "public function testFunctions()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${fn:count(myarray)}');\n $this->assertEquals(\"<?php /* {fn:count(myarray)} */ echo htmlentities(count(\\$_o(\\$p, 'myarray')))?>\", $output);\n $output = $parser->parse('${fn:str_replace(\\'foo\\', \"bar\", myarray)}');\n $this->assertEquals(\n \"<?php /* {fn:str_replace('foo', \\\"bar\\\", myarray)} */ echo htmlentities(str_replace('foo', \\\"bar\\\", \\$_o(\\$p, 'myarray')))?>\",\n $output\n );\n\n $parser->registerVariable(null, 'onsubmit');\n $output = $parser->parse('${fn:strlen(onsubmit) > 0 ? onsubmit : \\'return validate(this);\\'}');\n $parser->unregisterVariable(null, 'onsubmit');\n $this->assertEquals(\n '<?php /* {fn:strlen(onsubmit) > 0 ? onsubmit : \\'return validate(this);\\'} */ echo htmlentities(strlen($onsubmit) > 0 ? $onsubmit : \\'return validate(this);\\')?>',\n $output\n );\n \n $parser->registerVariable(null, '_field');\n $output = $parser->parse('${fn:implode(\\',\\',_field->validators)}');\n $parser->unregisterVariable(null, '_field');\n \n $this->assertEquals(\n '<?php /* {fn:implode(\\',\\',_field->validators)} */ echo htmlentities(implode(\\',\\',$_field->validators))?>',\n $output\n );\n \n // can we nest?\n $parser->registerVariable(null, '_field');\n $output = $parser->parse('${fn:count(fn:implode(\\',\\',_field->validators))}');\n $parser->unregisterVariable(null, '_field');\n \n $this->assertEquals(\n '<?php /* {fn:count(fn:implode(\\',\\',_field->validators))} */ echo htmlentities(count(implode(\\',\\',$_field->validators)))?>',\n $output\n );\n \n // can we handle static?\n $parser->registerVariable(null, '_field');\n $output = $parser->parse('${fn:MyClass::parse(_field->validators)}');\n $parser->unregisterVariable(null, '_field');\n \n $this->assertEquals(\n '<?php /* {fn:MyClass::parse(_field->validators)} */ echo htmlentities(MyClass::parse($_field->validators))?>',\n $output\n );\n\n \n $parser->registerVariable(null, 'col');\n //$output = $parser->parse(\"\\${fn:strpos(col, '&lt;img') &gt;= 0 ? 'centeredImg' : ''}\");\n $output = $parser->parse(\"\\${fn:strpos(col, '&lt;img') &gt;= 0 ? 'centeredImg' : ''}\", false);\n $parser->unregisterVariable(null, 'col');\n $this->assertEquals(\n 'strpos($col, \\'<img\\') >= 0 ? \\'centeredImg\\' : \\'\\'',\n $output\n );\n }", "public function testSimpleTokens()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var}');\n $this->assertEquals(\"<?php /* {some_var} */ echo htmlentities(\\$_o(\\$p, 'some_var'))?>\", $output);\n $parser->registerVariable(null, 'my_var');\n $output = $parser->parse('${my_var}');\n $this->assertEquals(\"<?php /* {my_var} */ echo htmlentities(\\$my_var)?>\", $output);\n }", "public static function expr()\n {\n $out = call_user_func_array('self::parse', func_get_args());\n $obj = text($out);\n return $obj;\n }", "public function testEvaluateTooManyOperators()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + * /\");\n $this->assertEquals(9, $retval);\n }", "protected function evaluateBoolExpression()\n {\n $result = $this->evaluateMathBlock();\n while ($mathOp = $this->readChar(true)) {\n switch ($mathOp) {\n case '+':\n $result->join('+', $this->evaluateMathBlock());\n break;\n case '-': \n $result->join('-', $this->evaluateMathBlock());\n break;\n case '=':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('==', $this->evaluateMathBlock());\n } elseif ($nextChar == '>') {\n $this->unreadChar(2);\n return $result;\n break;\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '!':\n $nextChar = $this->readChar();\n if ($nextChar == '=') {\n $result->join('!=', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '>':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('>=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('>', $this->evaluateMathBlock());\n }\n break;\n case '<':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('<=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('<', $this->evaluateMathBlock());\n }\n break;\n case 'i': // find in set\n $nextChar = $this->readChar(true);\n if ($nextChar == 'n') { \n $result->join('in', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case 'l': // check against regex\n $this->evaluateLikeExpression($result);\n break;\n // Lower lever operators\n case '&': // boolean \"and\" &&\n case '|': // boolean \"or\" ||\n // end of argument or statement\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';': \n // array value parsed\n case ']':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $mathOp . '\".');\n break;\n }\n }\n return $result;\n }", "function e($expr) \n {\n //call the core evaluation method\n return $this->evaluate($expr);\n }", "public function testParse(): void\n {\n $decrypt = (new Crypto())->decrypt(Constants::ENV_ENC_TEST, Constants::ENV_KEY_TEST);\n\n $parsed = Parser::parse($decrypt);\n\n $this->assertNotEmpty($parsed);\n $this->assertSame(['FOO' => 'bar'], $parsed);\n }", "#[@test]\n public function assignment() {\n $this->assertEquals(array(new AssignmentNode(array(\n 'variable' => new VariableNode('a'),\n 'expression' => new TernaryNode(array(\n 'condition' => new VariableNode('argc'),\n 'expression' => new VariableNode('args0'),\n 'conditional' => new IntegerNode('1')\n )),\n 'op' => '='\n ))), $this->parse('\n $a= $argc ? $args0 : 1;\n '));\n }", "public function testObjectVariables()\n {\n\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var->foo}');\n $this->assertEquals(\"<?php /* {some_var->foo} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo)?>\", $output);\n $output = $parser->parse('${some_var->FOO}');\n $this->assertEquals(\"<?php /* {some_var->FOO} */ echo htmlentities(\\$_o(\\$p, 'some_var')->FOO)?>\", $output);\n $output = $parser->parse('${some_var->foo(bar,bin, baz)}');\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar,bin, baz)} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'),\\$_o(\\$p, 'bin'), \\$_o(\\$p, 'baz')))?>\", \n $output\n );\n \n $output = $parser->parse(\n '${some_var->foo(bar,\"bin\", baz, \\'boo biscuits\\' )}'\n );\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar,\\\"bin\\\", baz, 'boo biscuits' )} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'),\" .\n \"\\\"bin\\\", \\$_o(\\$p, 'baz'), 'boo biscuits' ))?>\", \n $output\n );\n\n $output = $parser->parse(\n '${some_var->foo(bar,\"bin\", baz, \\'boo biscuit\\\\\\'s brother\\' )}'\n );\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar,\\\"bin\\\", baz, 'boo biscuit\\\\'s brother' )} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'),\\\"bin\\\"\" .\n \", \\$_o(\\$p, 'baz'), 'boo biscuit\\'s brother' ))?>\", \n $output\n );\n \n // nested methods\n $output = $parser->parse(\n '${some_var->foo(bar, \"bin\")->bar()->bob(\"bo\\\"oo\\\"\",bin)}'\n );\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar, \\\"bin\\\")->bar()->bob(\\\"bo\\\\\\\"oo\\\\\\\"\\\",bin)} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'), \\\"bin\\\")\" .\n \"->bar()->bob(\\\"bo\\\\\\\"oo\\\\\\\"\\\",\\$_o(\\$p, 'bin')))?>\", \n $output\n );\n \n // null testing\n $output = $parser->parseExpression(\"error != null &amp;&amp; error->getText() != ''\");\n $this->assertEquals(\n \"\\$_o(\\$p, 'error') != null && \\$_o(\\$p, 'error')->getText() != ''\",\n $output);\n \n $output = $parser->parseExpression(\"error->getText(null, 'foo') != ''\");\n $this->assertEquals(\n \"\\$_o(\\$p, 'error')->getText(null, 'foo') != ''\",\n $output); \n }", "protected function parseExpression($expression) {\n\t\t$expression = str_replace(\n\t\t\tarray('{', '}', '[', ']', '`', ';'),\n\t\t\tarray('&#123', '&#125', '&#91', '&#93', '&#96', '&#59'),\n\t\t\t$expression\n\t\t);\n\t\tif ($this->isExpression($expression)) {\n\t\t\t$this->checkSafety($expression);\n\t\t}\n\t\treturn $expression;\n\t}", "public function testBasic()\n {\n $grammar2 = $this->grammar->parse(\" S ::= 'a' \");\n $this->assertEquals(array(\"a\"), $grammar2->parse(\"a\"));\n }", "public function testPreparseCode()\n\t{\n\t\tforeach ($this->bbPreparse_tests as $testcase)\n\t\t{\n\t\t\t$test = $testcase[0];\n\t\t\t$expected = $testcase[1];\n\n\t\t\tpreparsecode($test);\n\n\t\t\t$this->assertEquals($expected, $test);\n\t\t}\n\t}", "function yy_r5(){if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo htmlspecialchars('<?php\".str_replace(\"'\",\"\\'\",$this->yystack[$this->yyidx + -1]->minor).\"?>', ENT_QUOTES);?>\\n\", $this->compiler, false);\r\n } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('<?php'.$this->yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false);\r\n }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {\r\n $this->_retvalue = $this->cacher->processNocacheCode('<?php'.$this->yystack[$this->yyidx + -1]->minor.'?>', $this->compiler, true);\r\n }elseif ($this->sec_obj->php_handling == SMARTY_PHP_REMOVE) {\r\n $this->_retvalue = '';\r\n }\r\n }", "public function testJson()\n {\n $jsonGrammar = $this->grammar->parse($this->json_parser);\n\n $result = $jsonGrammar->parse(\" { \\\"string\\\" : true, \\\"\\\\\\\"\\\" : false, \\\"\\\\u9874asdh\\\" : [ null, { }, -9488.44E+093 ] } \");\n }", "function yy_r6(){ \r\n if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU || $this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?=\".$this->yystack[$this->yyidx + -1]->minor.\"?>'?>\\n\", $this->compiler, false);\r\n } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('<?='.$this->yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false);\r\n }elseif ($this->sec_obj == SMARTY_PHP_REMOVE) {\r\n $this->_retvalue = '';\r\n }\r\n }", "public function testParseLanguage(): void\n {\n $result = Parser::parseLanguage('en');\n $this->assertEquals('en', $result);\n\n $result = Parser::parseLanguage('fr');\n $this->assertEquals('fr', $result);\n\n $result = Parser::parseLanguage('english');\n $this->assertEquals('en', $result);\n\n $result = Parser::parseLanguage('français');\n $this->assertEquals('fr', $result);\n\n $result = Parser::parseLanguage('eng');\n $this->assertEquals('en', $result);\n\n $result = Parser::parseLanguage('fra');\n $this->assertEquals('fr', $result);\n\n $this->assertNull(Parser::parseLanguage('banana'));\n }", "public function testParse()\n {\n $this->assertEquals('SELECT * FROM test WHERE status=\"ACTIVE\"', $this->conn->parse('SELECT * FROM test WHERE status=?', array('ACTIVE')));\n }", "public function testRunRuleParser()\n {\n $rules = [\n 'var1' => 'alpha|between:min=10,max=100',\n 'var2' => 'email',\n 'var3' => 'alpha',\n ];\n $rulesBag = $this->ruleParse->run($rules);\n $this->assertInstanceOf(Sparta\\RulesBag::class, $rulesBag);\n $this->assertEquals($rulesBag, $this->ruleParse->getRulesBag());\n }" ]
[ "0.7088678", "0.6580986", "0.623618", "0.6164177", "0.61276937", "0.6010764", "0.59711504", "0.58878875", "0.57848006", "0.5779877", "0.5689867", "0.5666583", "0.5658138", "0.5559046", "0.5556366", "0.55036134", "0.5502416", "0.54473734", "0.54329944", "0.54258084", "0.5418938", "0.54141366", "0.54079413", "0.53951746", "0.5390101", "0.53837997", "0.5377994", "0.5376313", "0.5337588", "0.5307688" ]
0.7822853
0
Tests parsing a sanitized tag
public function testParsingSanitizedTag() { $tokens = [ new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1), new Token(TokenTypes::T_EXPRESSION, 'foo', 1), new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1), ]; $tagNode = new SanitizedTagNode(); $tagNode->addChild(new ExpressionNode('foo')); $this->ast->getCurrentNode() ->addChild($tagNode); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testParsingUnsanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n ];\n $tagNode = new UnsanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testAllowedValues()\n {\n $string = $this->basicSanitizer->sanitize('<a href=\"#\" title=\"four\">hey</a>');\n $this->assertEquals('<a href=\"#\">hey</a>', $string);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testCustomAttribute() : void\n {\n $string = $this->basicSanitizer->sanitize('<img src=\"1.png\" data-src=\"1.png\">');\n $this->assertEquals('<img src=\"1.png\" data-src=\"1.png\">', $string);\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "function test_input($data) {\n $data = trim($data);\n $data = strip_tags($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "public function testGetInvalidTagByTagContent() {\n\t\t// grab a tag by content that does not exist\n\t\t$tag = Tag::getTagByTagContent($this->getPDO(), \"nobody ever made this TAG\");\n\t\t$this->assertCount(0, $tag);\n\t}", "public function clean( $tag ) {\n\n\t\t// I was seeing an issue with & being encoded to &amp; which would then make it so MPD couldn't find it\n\t\t$tag = html_entity_decode( $tag );\n\n\t\t// Replace /, <, >, | and : with nothing\n\t\t//$tag = preg_replace(\"/[\\/|\\>|\\<|\\||\\:]/\", \"\", $tag);\n\n\t\t// Replace ampersands with \"and\"\n\t\t//$tag = preg_replace(\"/[&]/\", \"and\", $tag);\n\n\t\treturn $tag;\n\t}", "function sanitize($bad){\r\n\t\t\t$bad = stripslashes($bad);\r\n\t\t\t$bad = strip_tags($bad);\r\n\t\t\t$good = htmlentities($bad);\r\n\t\t\treturn $good;\r\n\t\t}", "function clean_input($var) {\r\n\treturn strip_tags($var);\r\n}", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "public function testSimpleHTML() : void\n {\n $string = $this->sanitizer->sanitize('<script>alert(\"hello\");</script><div id=\"fake\"><h5 class=\"foo\">Lorem ipsum</h5></div>');\n $this->assertEquals(\"Lorem ipsum\", $string);\n }", "protected function scanTag()\n {\n return $this->scanInput('/^((?:[a-z][a-z0-9]*))/', 'tag');\n }", "function sani($bad){\r\n\t\t\t\t$bad = stripslashes($bad);\r\n\t\t\t\t$bad = strip_tags($bad);\r\n\t\t\t\t$good = htmlentities($bad);\r\n\t\t\t\treturn $good;\r\n\t\t\t}", "private static function isValidTagName($tag)\n {\n $pattern = '/^[a-z_]+[a-z0-9\\:\\-\\.\\_]*[^:]*$/i';\n return preg_match($pattern, $tag, $matches) && $matches[0] == $tag;\n }", "private function assertValidTags() : void\n {\n if ([] === $this->tags) {\n return;\n }\n\n foreach ($this->tags as $value) {\n InvalidDescriptorArgumentException::assertIsNotEmptyString(\n $value,\n '#[Route.tags] must contain non-empty strings.'\n );\n }\n }", "function real_strip_tags($str, $allowable_tags = \"\")\n{\n return strip_tags($str, $allowable_tags);\n}", "private function processAttrs(){\n\n\t\t$start = strlen($this->tag)+1;\n\t\t$temp = substr($this->raw,$start);\n\n\t\t//echo $temp . \"\\n\";\n\n\t\t$i=0;\n\t\tfor(; $i < strlen($temp); ){\n\t\t\tif($temp[$i] == '>') break;\n\t\t\t\t\n\t\t\t$pos = $this->skipWs($temp, $i);\n\t\t\t\t\n\t\t\t//echo \"should be r-{$temp[$pos]}\\n\";\n\t\t\t\t\n\t\t\t$pos2 = $this->skipToEqualOrWs($temp, $pos);\n\t\t\t\t\n\t\t\t//echo \"should be =-{$temp[$pos2]}\\n\";\n\t\t\t\t\n\t\t\t$attr = trim(substr($temp, $pos, $pos2 - $pos));\n\t\t\t\t\n\t\t\t//echo \"Got attribute-$attr\\n\";\n\t\t\t\t\n\t\t\tif(!empty($attr) && $pos2 < strlen($temp) && $temp[$pos2] == '='){\n\n\t\t\t\t//skip =\n\t\t\t\t$pos2++;\n\n\t\t\t\t$pos = $this->skipWs($temp, $pos2); //should be ' or \"\n\n\t\t\t\tif($temp[$pos] != '\"' && $temp[$pos] != \"'\"){\n\t\t\t\t\t//echo \"FAILED-{$temp[$pos]}\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$pos++; //skip the ' or \"\n\n\t\t\t\t$pos2 = $this->skipToQuote($temp, $pos, $temp[$pos-1]);\n\n\t\t\t\t$val = trim(substr($temp, $pos, $pos2-$pos),'\\'\"');\n\n\t\t\t\t$pos2++; //get past ' or \"\n\n\t\t\t\t$this->attributes[$attr] = $val;\n\n\t\t\t\t//echo \"$attr:$val\\n\";\n\t\t\t}\n\t\t\t$i = $pos2;\n\t\t}\n\t\t$this->textStart = $i+$start+1;\n\t}", "function testHTMLInj($data){\n $original = $data;\n \n /*convert 5 predefined characters into HTML values.\t\t\n They are > (&gt;), < (%lt;), \" (&quot;), ' (&#039;), & (&amp;) */\t\t\t\n $data = htmlspecialchars($data);\n\n //check for possible html injection\n return !($data === $original);\n }", "protected function _parseDescTag() {}", "public function sanitize()\n {\n parent::sanitize();\n\n foreach ($this->_cleanData as $key => $value) {\n $this->_cleanData[$key] = strip_tags($value);\n }\n }", "function sani($bad){\r\n\t\t\t$good = htmlentities( strip_tags( stripslashes( $bad ) ) );\r\n\t\t\treturn $good;\r\n\t\t}", "function sanitize($data){\r\n\t\t\t$data=stripslashes($data); // Remove all slashses\r\n\t\t\t$data=strip_tags($data); //Remove all tags\r\n\t\t\treturn $data;\r\n\t\t}", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}" ]
[ "0.7690629", "0.6535942", "0.65152794", "0.646724", "0.64094126", "0.63268006", "0.6303501", "0.62761045", "0.62529093", "0.62221557", "0.6183478", "0.59321743", "0.59167707", "0.5880348", "0.58641833", "0.58608794", "0.5860806", "0.58581746", "0.57676786", "0.5705838", "0.57002825", "0.5681565", "0.56709576", "0.5664165", "0.5647823", "0.5643679", "0.5637236", "0.5622289", "0.5614377", "0.5612073" ]
0.7553081
1
Tests parsing statements surrounded by expressions
public function testParsingStatementsSurroundedByExpressions() { $tokens = [ new Token(TokenTypes::T_EXPRESSION, 'a', 1), new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1), new Token(TokenTypes::T_EXPRESSION, 'b', 1), new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1), new Token(TokenTypes::T_EXPRESSION, 'c', 1), new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1), new Token(TokenTypes::T_DIRECTIVE_NAME, 'd', 1), new Token(TokenTypes::T_EXPRESSION, '(e)', 1), new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1), new Token(TokenTypes::T_EXPRESSION, 'f', 1), new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1), new Token(TokenTypes::T_EXPRESSION, 'g', 1), new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1), new Token(TokenTypes::T_EXPRESSION, 'h', 1), new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1), new Token(TokenTypes::T_EXPRESSION, 'i', 1), new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1), new Token(TokenTypes::T_EXPRESSION, 'j', 1), ]; $this->ast->getCurrentNode()->addChild(new ExpressionNode('a')); $sanitizedTagNode = new SanitizedTagNode(); $sanitizedTagNode->addChild(new ExpressionNode('b')); $this->ast->getCurrentNode()->addChild($sanitizedTagNode); $this->ast->getCurrentNode()->addChild(new ExpressionNode('c')); $directiveNode = new DirectiveNode(); $directiveNode->addChild(new DirectiveNameNode('d')); $directiveNode->addChild(new ExpressionNode('(e)')); $this->ast->getCurrentNode()->addChild($directiveNode); $this->ast->getCurrentNode()->addChild(new ExpressionNode('f')); $unsanitizedTagNode = new UnsanitizedTagNode(); $unsanitizedTagNode->addChild(new ExpressionNode('g')); $this->ast->getCurrentNode()->addChild($unsanitizedTagNode); $this->ast->getCurrentNode()->addChild(new ExpressionNode('h')); $commentNode = new CommentNode(); $commentNode->addChild(new ExpressionNode('i')); $this->ast->getCurrentNode()->addChild($commentNode); $this->ast->getCurrentNode()->addChild(new ExpressionNode('j')); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testParsingExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1)\n ];\n $this->ast->getCurrentNode()\n ->addChild(new ExpressionNode('foo'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "protected function evaluateStatements()\n {\n $this->evaluateStatement();\n while (!$this->return && $statementOp = $this->readChar()) {\n switch ($statementOp) {\n case '{':\n case '}':\n $this->unreadChar();\n return;\n break;\n // end of statement\n case ',':\n case ';':\n $this->evaluateStatement();\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $statementOp . '\".');\n break;\n }\n }\n }", "public function parseStatement()\n {\n\n }", "public function testRegexes()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /(ab)*/ \");\n $this->assertEquals(array(\"ababab\"), $grammar1->parse(\"ababab\"));\n $grammar = $this->grammar->parse(\" number ::= /a\\\\.b/ \");\n $this->assertEquals(array(\"a.b\"), $grammar->parse(\"a.b\"));\n\n $this->expectException(ParseFailureException::_CLASS);\n $grammar1->parse(\"aXb\");\n }", "public function testParse()\n {\n $source = array();\n $source[] = \"foo bar\";\n $source[] = \"\";\n $source[] = \"> line 1\";\n $source[] = \"> line 2\";\n $source[] = \"> \";\n $source[] = \"> line 3\";\n $source[] = \"> line 4\";\n $source[] = \"\";\n $source[] = \"baz dib\";\n $source = implode(\"\\n\", $source);\n \n $expect[] = \"foo bar\\n\";\n $expect[] = $this->_token . \"\\n\";\n $expect[] = \"baz dib\";\n $expect = implode(\"\\n\", $expect);\n \n $actual = $this->_plugin->parse($source);\n $this->assertRegex($actual, \"@$expect@\");\n }", "public function testOperators()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var + some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var + some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') + \\$_o(\\$p, 'some_other_var'))?>\", \n $output\n );\n $output = $parser->parse('${some_var < some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var < some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') < \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var <= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var <= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') <= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var > some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var > some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') > \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var >= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var >= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') >= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var == some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var == some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') == \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var != some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var != some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') != \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${(some_var % some_other_var) == 0}');\n $this->assertEquals(\n \"<?php /* {(some_var % some_other_var) == 0} */ echo htmlentities((\\$_o(\\$p, 'some_var') % \\$_o(\\$p, 'some_other_var')) == 0)?>\", $output\n );\n $output = $parser->parse('${some_var / some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var / some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') / \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var * some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var * some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') * \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var - some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var - some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') - \\$_o(\\$p, 'some_other_var'))?>\", $output, \"my name\"\n );\n $output = $parser->parse('${(a + b + c) * (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) * (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) * (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) && (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) && (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) && (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) || (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) || (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) || (\\$_o(\\$p, 'd') - 3))?>\",\n $output\n );\n $output = $parser->parse('${foo == \\'a\\'}');\n $this->assertEquals(\"<?php /* {foo == 'a'} */ echo htmlentities(\\$_o(\\$p, 'foo') == 'a')?>\", $output);\n $output = $parser->parse('${foo == \"b\"}');\n $this->assertEquals(\"<?php /* {foo == \\\"b\\\"} */ echo htmlentities(\\$_o(\\$p, 'foo') == \\\"b\\\")?>\", $output); \n \n $output = $parser->parse('${(foo == \"b\" ? \"black\" : \"red\")}');\n $this->assertEquals(\n \"<?php /* {(foo == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\")} */ echo htmlentities((\\$_o(\\$p, 'foo') == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\"))?>\", \n $output\n ); \n $output = $parser->parseExpression('director->isLoggedIn() &amp;&amp; director->isSiteAdmin()');\n $this->assertEquals(\n \"\\$_o(\\$p, 'director')->isLoggedIn() && \\$_o(\\$p, 'director')->isSiteAdmin()\", \n $output\n );\n \n\n $parser->registerVariable(null, \"_field\");\n $output = $parser->parse('${_field->class != \\'\\' ? _field->class : \\'\\'}${(_field->error != \\'\\' ? \\' errored\\' : \\'\\')}');\n $this->assertEquals(\n '<?php /* {_field->class != \\'\\' ? _field->class : \\'\\'} */ echo htmlentities($_field->class != \\'\\' ? $_field->class : \\'\\')?><?php /* {(_field->error != \\'\\' ? \\' errored\\' : \\'\\')} */ echo htmlentities(($_field->error != \\'\\' ? \\' errored\\' : \\'\\'))?>',\n $output);\n $parser->unregisterVariable(null, \"_field\");\n \n }", "protected function doTest(string $expression, $parsed): void\n {\n if (!is_string($parsed)) {\n $this->assertEquals($parsed, $this->parser->parseExpression($expression));\n\n } else {\n $this->expectException(\n SyntaxException::class\n );\n $this->expectExceptionMessage($parsed);\n $this->parser->parseExpression($expression);\n }\n }", "public function testParsingPhpExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_PHP_TAG_OPEN, '<?php', 1),\n new Token(TokenTypes::T_EXPRESSION, 'echo \"foo\";', 1),\n new Token(TokenTypes::T_PHP_TAG_CLOSE, '?>', 1)\n ];\n $this->ast->getCurrentNode()\n ->addChild(new ExpressionNode('<?php'))\n ->addChild(new ExpressionNode('echo \"foo\";'))\n ->addChild(new ExpressionNode('?>'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testBasic()\n {\n $grammar2 = $this->grammar->parse(\" S ::= 'a' \");\n $this->assertEquals(array(\"a\"), $grammar2->parse(\"a\"));\n }", "public function testAnotherInvalidSyntax(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_X, Grammar::T_X, Grammar::T_C]);\n }", "public function testSubparsers()\n {\n $grammar2 = $this->grammar->parse(\" S ::= ('a') \");\n $this->assertEquals(array(array(\"a\")), $grammar2->parse(\"a\"));\n }", "#[@test]\n public function nested() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new BracedExpressionNode(new TernaryNode(array(\n 'condition' => new VariableNode('f'),\n 'expression' => new IntegerNode('1'),\n 'conditional' => new IntegerNode('2'),\n )))\n ))), $this->parse('\n $i ?: ($f ? 1 : 2);\n '));\n }", "public function testParseWithMultipleTokens(): void\n {\n $this->assertSame(6, $this->parser->parse([Grammar::T_V, Grammar::T_I]));\n $this->assertSame(13, $this->parser->parse([Grammar::T_X, Grammar::T_I, Grammar::T_I, Grammar::T_I]));\n $this->assertSame(111, $this->parser->parse([Grammar::T_C, Grammar::T_X, Grammar::T_I]));\n }", "protected function parseExpression()\n {\n $entities = array();\n while ($e = $this->matchFuncs(array('parseAddition', 'parseEntity'))) {\n $entities[] = $e;\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!$this->peekReg('/\\\\G\\/[\\/*]/') && ($delim = $this->matchChar('/'))) {\n $entities[] = new ILess_Node_Anonymous($delim);\n }\n }\n if (count($entities) > 0) {\n return new ILess_Node_Expression($entities);\n }\n }", "public function testRunRuleParser()\n {\n $rules = [\n 'var1' => 'alpha|between:min=10,max=100',\n 'var2' => 'email',\n 'var3' => 'alpha',\n ];\n $rulesBag = $this->ruleParse->run($rules);\n $this->assertInstanceOf(Sparta\\RulesBag::class, $rulesBag);\n $this->assertEquals($rulesBag, $this->ruleParse->getRulesBag());\n }", "public function testInvalidOperator()\n {\n $this->parser->parse('{foo: {$asdasd: \"bar\"}}');\n }", "public function testParseWithFourSimpleTokensInSequence(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_I, Grammar::T_I, Grammar::T_I]);\n }", "protected function evaluateStatement()\n {\n if (is_null($char = $this->readChar())) {\n // EOF is achieved\n return;\n }\n\n // handle braces\n if ($char == '{' || $char == '}') {\n $this->unreadChar();\n return;\n }\n\n $keyWord = null;\n // handle statements with preceding keywords\n if ($this->parseCharacterSequence($char, $keyWord)) {\n\n // FUNCTION DEFINITION\n if ($keyWord == self::STATEMENT_TYPE_SUB) {\n $this->parseFunction();\n $this->dynamicSrc[] = ';';\n return;\n }\n // FUNCTION DEFINITION\n\n // RETURN STATEMENT\n if ($keyWord == self::STATEMENT_TYPE_RETURN) {\n $this->return = true;\n $this->evaluateStatement();\n return;\n }\n // END OF RETURN STATEMENT\n\n // BREAK LOOP STATEMENT\n if ($keyWord == self::STATEMENT_TYPE_BREAK) {\n $this->break = true;\n return;\n }\n // END OF BREAK LOOP STATEMENT\n\n // IF STATEMENT\n if ($keyWord == self::STATEMENT_TYPE_IF) {\n $this->evaluateIfStructure();\n if (!$this->return) {\n $this->dynamicSrc[] = ';';\n }\n return;\n }\n // END OF IF STATEMENT\n\n // FOR STATEMENT\n if ($keyWord == self::STATEMENT_TYPE_FOR) {\n $this->evaluateForLoop();\n if (!$this->return) {\n $this->dynamicSrc[] = ';';\n }\n return;\n }\n // END OF FOR STATEMENT\n\n // unread keyword\n $this->unreadChar(strlen($keyWord));\n } else {\n $this->unreadChar();\n }\n\n $this->lastResult = $this->evaluateBoolStatement();\n }", "public function testExceptionThrownWithNestedComment()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testParsingDirectiveWithExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_DIRECTIVE_OPEN, '<%', 1),\n new Token(TokenTypes::T_DIRECTIVE_NAME, 'foo', 1),\n new Token(TokenTypes::T_EXPRESSION, '(\"bar\")', 1),\n new Token(TokenTypes::T_DIRECTIVE_CLOSE, '%>', 1),\n ];\n $directiveNode = new DirectiveNode();\n $directiveNode->addChild(new DirectiveNameNode('foo'));\n $directiveNode->addChild(new ExpressionNode('(\"bar\")'));\n $this->ast->getCurrentNode()\n ->addChild($directiveNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testParsingEmptyTokens()\n {\n $this->assertEquals($this->ast, $this->parser->parse([]));\n }", "public function testParseThrowsExceptionWhenInvalidFormatting(): void\n {\n $lines = ['double=equals=here'];\n\n $parser = new IniParser('');\n $parser->setFileLines($lines);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Too many equals in line: double=equals=here');\n $parser->parse();\n }", "public function testChains2()\n {\n $grammar1 = $this->grammar->parse(\" S ::= A \\n A ::= 'a' 'b' \");\n $this->assertEquals(array(array(\"a\", \"b\")), $grammar1->parse(\"ab\"));\n }", "public function testParseWithOneLookaheadTokenAndOneSimpleToken(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_X, Grammar::T_V]);\n }", "public function testParsingComment()\n {\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n ];\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($commentNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testAlternation()\n {\n $grammar2 = $this->grammar->parse(\" S ::= 'a' | 'b' \");\n $this->assertEquals(array(\"a\"), $grammar2->parse(\"a\"));\n $this->assertEquals(array(\"b\"), $grammar2->parse(\"b\"));\n }", "#[@test]\n public function assignment() {\n $this->assertEquals(array(new AssignmentNode(array(\n 'variable' => new VariableNode('a'),\n 'expression' => new TernaryNode(array(\n 'condition' => new VariableNode('argc'),\n 'expression' => new VariableNode('args0'),\n 'conditional' => new IntegerNode('1')\n )),\n 'op' => '='\n ))), $this->parse('\n $a= $argc ? $args0 : 1;\n '));\n }", "public function testPreparseCode()\n\t{\n\t\tforeach ($this->bbPreparse_tests as $testcase)\n\t\t{\n\t\t\t$test = $testcase[0];\n\t\t\t$expected = $testcase[1];\n\n\t\t\tpreparsecode($test);\n\n\t\t\t$this->assertEquals($expected, $test);\n\t\t}\n\t}", "public function testIsThereAnySyntaxError(): void\r\n {\r\n $tx = $this->getTx();\r\n $transaction = new Transaction($tx);\r\n $this->assertInternalType('object', $transaction);\r\n }", "public function testIsThereAnySyntaxError()\n {\n $this->assertTrue(is_object($this->transaction));\n }" ]
[ "0.7127615", "0.6728833", "0.66969824", "0.6530444", "0.6418755", "0.63891256", "0.6215924", "0.61759776", "0.6067344", "0.59745544", "0.59168065", "0.58589065", "0.5842806", "0.5817042", "0.5804037", "0.57834405", "0.5749936", "0.56861025", "0.5672986", "0.56107664", "0.5577875", "0.55729437", "0.5562864", "0.5544812", "0.5528572", "0.55221975", "0.5482003", "0.54669976", "0.5464852", "0.5451641" ]
0.7801586
0
Tests parsing an unsanitized tag
public function testParsingUnsanitizedTag() { $tokens = [ new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1), new Token(TokenTypes::T_EXPRESSION, 'foo', 1), new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1), ]; $tagNode = new UnsanitizedTagNode(); $tagNode->addChild(new ExpressionNode('foo')); $this->ast->getCurrentNode() ->addChild($tagNode); $this->assertEquals($this->ast, $this->parser->parse($tokens)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionThrownWithUnclosedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1)]);\n }", "public function testParsingSanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n ];\n $tagNode = new SanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testExceptionThrownWithUnopenedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)]);\n }", "public function testExceptionThrownWithUnclosedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1)]);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function testExceptionThrownWithUnopenedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $this->parser->parse([new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)]);\n }", "public function testGetInvalidTagByTagContent() {\n\t\t// grab a tag by content that does not exist\n\t\t$tag = Tag::getTagByTagContent($this->getPDO(), \"nobody ever made this TAG\");\n\t\t$this->assertCount(0, $tag);\n\t}", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "function test_input($data) {\n $data = trim($data);\n $data = strip_tags($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "public function testGetTagByInvalidTagId() {\n\t\t// Grab a tag by invalid key\n\t\t$tag = Tag::getTagByTagId($this->getPDO(), BrewCrewTest::INVALID_KEY);\n\t\t$this->assertNull($tag);\n\t}", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "public function testAllowedValues()\n {\n $string = $this->basicSanitizer->sanitize('<a href=\"#\" title=\"four\">hey</a>');\n $this->assertEquals('<a href=\"#\">hey</a>', $string);\n }", "public function testInvalidAttributeName()\n {\n $config = array(\n\t\tnull\n );\n\n $result = self::processFilter($config, self::$request);\n }", "public function testCustomAttribute() : void\n {\n $string = $this->basicSanitizer->sanitize('<img src=\"1.png\" data-src=\"1.png\">');\n $this->assertEquals('<img src=\"1.png\" data-src=\"1.png\">', $string);\n }", "public function testGetInvalidTagByTagId() {\n\t\t// grab a profile id that exceeds the maximum allowable profile id\n\t\t$tag = Tag::getTagByTagId($this->getPDO(), DevConnectTest::INVALID_KEY);\n\t\t$this->assertNull($tag);\n\t}", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "function noTag($temp){\n\t$data\t= strip_tags($temp, \"<img \");\n\t$data\t= strip_tags($temp, \"<table \");\n\t$data\t= strip_tags($temp, \"<font \");\n\t$data\t= strip_tags($temp, \"<span \");\t\n\t$data\t= strip_tags($temp, \"<p \");\t\t\n\treturn $data;\n}", "protected function scanTag()\n {\n return $this->scanInput('/^((?:[a-z][a-z0-9]*))/', 'tag');\n }", "function testHTMLInj($data){\n $original = $data;\n \n /*convert 5 predefined characters into HTML values.\t\t\n They are > (&gt;), < (%lt;), \" (&quot;), ' (&#039;), & (&amp;) */\t\t\t\n $data = htmlspecialchars($data);\n\n //check for possible html injection\n return !($data === $original);\n }", "public function clean( $tag ) {\n\n\t\t// I was seeing an issue with & being encoded to &amp; which would then make it so MPD couldn't find it\n\t\t$tag = html_entity_decode( $tag );\n\n\t\t// Replace /, <, >, | and : with nothing\n\t\t//$tag = preg_replace(\"/[\\/|\\>|\\<|\\||\\:]/\", \"\", $tag);\n\n\t\t// Replace ampersands with \"and\"\n\t\t//$tag = preg_replace(\"/[&]/\", \"and\", $tag);\n\n\t\treturn $tag;\n\t}", "public function test_validation_missingClosingCommand() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\nSome content here.\n{end}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertFalse($parser->isValid());\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG,\n $parser->getCollection()\n );\n }", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "protected function _parseDescTag() {}", "public function testMf2DoesNotParseRelTag() {\n\t\t$input = '<div class=\"h-entry\">\n<a rel=\"tag\" href=\"/tags/tests\">Tests</a>\n</div>\n\n<div class=\"h-review\">\n<a rel=\"tag\" href=\"/tags/reviews\">Reviews</a>\n</div>\n';\n\t\t$parser = new Parser($input);\n\t\t$output = $parser->parse();\n\n\t\t$this->assertArrayNotHasKey('category', $output['items'][0]['properties']);\n\t\t$this->assertArrayNotHasKey('category', $output['items'][1]['properties']);\n\t}", "public function testGetWrongStreamTags()\n {\n $helix = new Helix(self::$tokenProvider);\n $tags = $helix->tags->getStreamTags(\"NonExistentUser\". uniqid());\n $this->assertFalse($tags);\n\n \n $tags = $helix->tags->getStreamTags(-1);\n $this->assertFalse($tags);\n }", "function clean_input($var) {\r\n\treturn strip_tags($var);\r\n}", "function sani($bad){\r\n\t\t\t\t$bad = stripslashes($bad);\r\n\t\t\t\t$bad = strip_tags($bad);\r\n\t\t\t\t$good = htmlentities($bad);\r\n\t\t\t\treturn $good;\r\n\t\t\t}", "private function assertValidTags() : void\n {\n if ([] === $this->tags) {\n return;\n }\n\n foreach ($this->tags as $value) {\n InvalidDescriptorArgumentException::assertIsNotEmptyString(\n $value,\n '#[Route.tags] must contain non-empty strings.'\n );\n }\n }", "function sanitize($bad){\r\n\t\t\t$bad = stripslashes($bad);\r\n\t\t\t$bad = strip_tags($bad);\r\n\t\t\t$good = htmlentities($bad);\r\n\t\t\treturn $good;\r\n\t\t}", "public static function localNestingCorrectlyRemovesInvalidTagsDataProvider() {}" ]
[ "0.7076817", "0.70035046", "0.68770164", "0.6872459", "0.6718784", "0.6704314", "0.6582288", "0.63514304", "0.5932405", "0.58447325", "0.5831277", "0.579108", "0.5784424", "0.5724619", "0.572019", "0.5688166", "0.5660182", "0.5632118", "0.5626975", "0.56245667", "0.56128395", "0.56111497", "0.5598852", "0.559859", "0.55723965", "0.55606395", "0.55569667", "0.5554415", "0.55525327", "0.5544574" ]
0.78540546
0
Find (allowed) map by URL
public static function findByURL($url) { \AppRoot::doCliOutput("Find map by url: ".$url); $findByID = null; $parts = explode("-",$url); if (is_numeric($parts[0])) { // Mogelijk id? \AppRoot::debug("Find by id: ".$parts[0]); $findByID = $parts[0]; $map = new \map\model\Map($parts[0]); if ($map->getUserAllowed() || (\User::getUSER() && \User::getUSER()->getIsSysAdmin())) return $map; if (\User::getUSER()) { foreach (\User::getUSER()->getAvailibleChains() as $map) { $findURL = $url; if (!$findByID) $findURL = $map->id."-".$url; if ($map->getURL() == $findURL) return $map; } } } else \AppRoot::debug("<strong>NO MAP:</strong> Map URL has to be prefixed by the map ID"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findCandidatesForUrlOrPath($url, $path)\n {\n $sql = \"SELECT m.* FROM armb_redirect_map m\n WHERE m.urlFrom = :urlFrom \n OR m.urlFrom = :path \n OR (m.urlFromIsRegexPattern IS NOT NULL \n AND m.urlFromIsRegexPattern <> 0)\";\n\n $groups = $this->getGroups();\n\n $maps = $this->_em->getConnection()->fetchAll($sql, ['urlFrom' => $url, 'path' => $path]);\n\n $priority = [];\n $urlFrom = [];\n foreach ($maps as &$map) {\n $map['priority'] = $groups[$map['group_id']] ?? 0;\n $priority[] = $groups[$map['group_id']] ?? 0;\n $urlFrom[] = $map['urlFrom'];\n }\n\n \\array_multisort($priority, SORT_ASC, SORT_NUMERIC, $urlFrom, SORT_DESC, SORT_NATURAL, $maps);\n\n $result = [];\n foreach ($maps as $mapData) {\n $mapObj = new Map;\n $mapObj->fromArray($mapData);\n $result[] = $mapObj;\n }\n\n return $result;\n }", "public function local_get_by_map($type, $map){\n\t\tforeach((array)$this->local_copies[$type] as $copy){\n\t\t\tforeach($map as $k=>$v){\n\t\t\t\tif($copy[$k] != $v){\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $copy;\n\t\t}\n\t}", "function parseURLMAP($url_maps){\n\t$url_maps = explode(\",\", $url_maps);\n\n\t$links = array();\n\n\tforeach($url_maps as $url_map){\n\t\t$link = array();\n\n\t\tif(preg_match(\"/\\bsig=([^&]+)/s\", $url_map, $match)){\n\t\t\t$link['sig'] = urldecode($match[1]);\n\t\t}\n\n\t\tif(preg_match(\"/\\bs=([^&]+)/s\", $url_map, $match)){\n\t\t\t$link['s'] = urldecode($match[1]);\n\t\t}\n\n\t\tif(preg_match(\"/\\bitag=([^&]+)/s\", $url_map, $match)){\n\t\t\t$link['itag'] = urldecode($match[1]);\n\t\t}\n\n\t\tif(preg_match(\"/\\burl=([^&]+)/s\", $url_map, $match)){\n\t\t\t$link['url'] = urldecode($match[1]);\n\t\t}\n\n\t\tif(preg_match(\"/\\bquality=([^&]+)/s\", $url_map, $match)){\n\t\t\t$link['quality'] = urldecode($match[1]);\n\t\t}\n\n\t\tif(preg_match(\"/\\btype=([^&]+)/s\", $url_map, $match)){\n\t\t\t$link['type'] = urldecode($match[1]);\n\t\t}\n\n\t\tif(isset($link['url'])){\n\t\t\t$links[] = $link;\n\t\t}\n\t}\n\n\treturn $links;\n}", "public function availableMappings()\n {\n $faker = Faker\\Factory::create();\n\n return [\n [$faker->url, Web::class],\n [$faker->url, Web::class],\n ['ssl://www.google.com', Web::class],\n ['https://www.google.com', Web::class],\n ['file://myfile', File::class],\n ];\n }", "public function loadByUrl($url);", "function find($ip, $url, $limit);", "function findPageUrls();", "public function getResourceMap($id)\n {\n return false;\n }", "public function findByUrl(string $url): RoutingEntry;", "function getcollectibleMap($apiname)\n\t{\n\t\tglobal $collectibles;\n\n\t\tif (array_key_exists($apiname, $collectibles))\n\t\t\treturn $collectibles[$apiname];\n\t\telse\n\t\t\treturn NULL;\n\t}", "public static function sitemap () {\n\t\t$res = self::query ('id')\n\t\t\t->order ('id asc')\n\t\t\t->fetch_orig ();\n\t\t\n\t\t$urls = array ();\n\t\tforeach ($res as $item) {\n\t\t\t$urls[] = '/wiki/' . $item->id;\n\t\t}\n\t\treturn $urls;\n\t}", "function init_accessMap(){\n\t$map = array(\n\t\t/* user */\n\t\t'user.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'user.get_others' => array('root', 'admin'),\n\n\t\t/* logs */\n\t\t'logs.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'logs.get_others' => array('root', 'admin'),\n\n\t\t/* site */\n\t\t'site.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get_others' => array('root', 'admin'),\n\t\t'site.update' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.update_others' => array('root', 'admin'),\n\t\t'site.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.remove_others' => array('root', 'admin'),\n\n\t\t/* pattern */\n\t\t'pattern.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.get_others' => array('root', 'admin'),\n\t\t'pattern.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove_others' => array('root', 'admin'),\n\n\t\t/* count data */\n\t\t'count.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'count.get_others' => array('root', 'admin'),\n\n\t\t/* ucenter entry show control */\n\t\t'ucenter.home' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.sites' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs_all' => array('root', 'admin'),\n\t\t'ucenter.sites_all' => array('root', 'admin'),\n\t\t'ucenter.visitors' => array('root', 'admin'),\n\t);\n\tAccessController::setMap($map);\n}", "function getMap()\n\t{\n\t\tif(isset($_POST['gid']))\n\t\t\t$gid = mysql_real_escape_string($_POST['gid']);\n\t\telse\n\t\t\t$gid = mysql_real_escape_string($_GET['gid']);\n\t\t\n\t\t$query = \"SELECT i.uid, c.year, c.season, i.country, c.aid, c.type\n\t\t\t\t\tFROM in_game i, games g, curr_map c\n\t\t\t\t\tWHERE g.gid=i.gid and g.gid=$gid and c.gid=g.gid and i.uid=c.owner and g.year=c.year and g.season=c.season;\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t$map = array();\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($map, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $map;\n\t}", "function maps_actual_url($url, $uriapp = NULL){\n //Elimino el primer caracter si es igual a \"/\"\n if(substr($url, 0, 1) == \"/\"){\n $url= substr($url, 1);\n } \n //Separa la url pasada y la uri en partes para poder analizarlas\n $partes_url= explode(\"/\", $url);\n \n //Saco de la uri actual los parametros\n $uri_explode= explode(\"?\", URIAPP);\n if($uriapp != NULL){\n $uri_explode= explode(\"?\", $uriapp);\n }\n $uri_front= $uri_explode[0];\n //Separo la uri actual\n $partes_uri_actual= explode(\"/\", $uri_front); \n $mapea= TRUE; \n //Analiza que url-uri tiene mas elementos\n if(count($partes_url) >= count($partes_uri_actual)){\n //Si el tamano de la url es igual o mayor que la uri actual uso el for recorriendo las partes de la url\n $count_partes_uri= count($partes_url);\n for($i= 0; $i < $count_partes_uri; $i++) {\n if(count($partes_uri_actual) >= ($i + 1)){\n //Si hay un * no me importa que viene despues, mapea todo, no deberia haber nada despues\n if($partes_url[$i] != \"*\"){\n $pos_ocurrencia= strpos($partes_url[$i], \"*\");\n if($pos_ocurrencia != FALSE){\n $parte_url= explode(\"*\", $partes_url[$i]);\n $parte_url= $parte_url[0];\n if(strlen($partes_uri_actual[$i]) >= strlen($parte_url)){\n $parte_uri_actual= substr($partes_uri_actual[$i], 0, strlen($parte_url));\n if($parte_url == $parte_uri_actual){\n break;\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n //Si alguna esta vacia no compara el mapeo con () y voy directo a la comparacion\n if(empty($partes_url[$i]) || empty($partes_uri_actual[$i])){\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n else{\n //Si la parte de la uri empieza con ( y termina con ) puede ir cualquier string ahi por lo que pasa directamente esta parte de la validacion\n if(! ($partes_url[$i]{0} == \"(\" and $partes_url[$i]{strlen($partes_url[$i]) -1} == \")\")){\n //Si no contiene ( y ) debe mapear\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n }\n }\n else{\n break;\n }\n }\n else{\n //La uri actual no tiene mas partes y no hay coincidencia completa\n $mapea= FALSE;\n break;\n }\n } \n }\n else{\n //Si el tamano de la url pasada es menor que la uri uso el for recorriendo las partes de la uri\n $count_partes_uri_actual= count($partes_uri_actual);\n for($i= 0; $i < $count_partes_uri_actual; $i++){\n if(count($partes_url) >= ($i + 1)){ \n //Si hay un * no me importa que viene despues, mapea todo, no deberia haber nada despues\n if($partes_url[$i] != \"*\"){\n $pos_ocurrencia= strpos($partes_url[$i], \"*\");\n if($pos_ocurrencia != FALSE){\n $parte_url= explode(\"*\", $partes_url[$i]);\n $parte_url= $parte_url[0];\n if(strlen($partes_uri_actual[$i]) >= strlen($parte_url)){\n $parte_uri_actual= substr($partes_uri_actual[$i], 0, strlen($parte_url));\n if($parte_url == $parte_uri_actual){\n break;\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n //Si alguna esta vacia no compara el mapeo con () y voy directo a la comparacion\n if(empty($partes_url[$i]) || empty($partes_uri_actual[$i])){\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n else{\n //Si la parte de la uri empieza con ( y termina con ) puede ir cualquier string ahi por lo que pasa directamente esta parte de la validacion\n if(! ($partes_url[$i]{0} == \"(\" and $partes_url[$i]{strlen($partes_url[$i]) -1} == \")\")){\n //Si no contiene ( y ) debe mapear \n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n }\n }\n else{\n break;\n }\n }\n else{\n //La url pasada no tiene mas partes y no hay coincidencia completa\n $mapea= FALSE;\n break;\n }\n }\n } \n return $mapea;\n }", "public function getMappings();", "public function getMappings();", "public static function scan($url)\n\t{\n\t array_push(self::$siteMapUrls, $url);\n\n\t // Get the initial data\n\t $html = siteMap::getUrl($url);\n\n\t // Break it up\n\t $a1 = explode (\"<a\", $html);\n\n\t foreach ($a1 as $key => $val) {\n\t\t\t$parts = explode (\">\", $val);\n\t\t\t$a = $parts[0];\n\t\t\t$aparts = explode (\"href=\", $a);\n\t\t\tif(!isset($aparts[1])) { continue; }\n\t\t\t$hrefparts = explode (\" \", $aparts[1]);\n\t\t\t$hrefparts2 = explode (\"#\", $hrefparts[0]);\n\t\t\t$href = str_replace (\"\\\"\", \"\", $hrefparts2[0]);\n\t\t\t\n\t\t\t//var_dump($href);\n\t\t\tif($href == \"\") { \t\t\t\tcontinue; }\n\t\t\tif(strstr($href,\"Notice:\")) { \tcontinue; }\n\t\t\tif(strstr($href,\"'\")) { \t\tcontinue; }\n\t\t\t$href = str_replace(\" \", \"\", $href);\n\n\t\t\t// get the href\n\t\t\tif ((substr ($href, 0, 7) != \"http://\") && \n\t\t\t (substr ($href, 0, 8) != \"https://\") &&\n\t\t\t (substr ($href, 0, 6) != \"ftp://\")) {\n\t\t\t if ($href[0] == '/') {\n\t\t\t\t\t$href = self::$siteMapUrls[0].$href;\n\t\t\t } else {\n\t\t\t\t\t$href = siteMap::path($url) . $href;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the href is the domain then do it...\n\t\t\tif (substr($href, 0, strlen (self::$siteMapUrls[0])) == self::$siteMapUrls[0]) {\n\t\t\t if ((!in_array ($href, self::$siteMapUrls))) {\n\t\t\t\t\techo $href.\"\\n\";\n\t\t\t\t\tsiteMap::scan($href);\n\t\t\t }\n\t\t\t}\n\t }\n\t}", "public function getStructure($url = null);", "public function loadUncached(): array\n {\n $res = $this->guzzle->request('GET', 'https://meta.wikimedia.org/w/api.php', [\n 'query' => [\n 'format' => 'json',\n 'formatversion' => 2,\n 'action' => 'sitematrix',\n 'smlangprop' => 'site',\n 'smsiteprop' => 'url|dbname',\n ],\n ]);\n $decoded = json_decode($res->getBody()->getContents(), true)['sitematrix'];\n $lookup = [];\n foreach ($decoded as $k => $v) {\n if ('count' === $k) {\n continue;\n }\n $sites = 'specials' === $k ? $v : $v['site'];\n foreach ($sites as $site) {\n $lookup[$site['dbname']] = parse_url($site['url'], PHP_URL_HOST);\n }\n }\n return $lookup;\n }", "public function getMap($key = '') {\n if (empty($key) || !isset($this->map[$key])) return false;\n else return $this->map[$key];\n }", "abstract protected function getMapping();", "abstract protected function getMapping();", "function match($url) {\n\t\t# add defaults\n\t\t$out = $this->defaults;\n\n\t\t# grab out the query string if there is one\n\t\tif (strpos($url, '?') !== false) {\n\t\t\t$query = explode('?', $url);\n\t\t\t$url = $query[0];\n\t\t\t$query = $query[1];\n\t\t\t\n\t\t\t$qparams = array();\n\t\t\tparse_str($query, $qparams);\n\t\t\tforeach($qparams as $k => $v) {\n\t\t\t\t$out[$k] = $v;\n\t\t\t}\n\t\t}\n\n\t\t# make sure they match\n\t\t$urlparts = array();\n\n\t\tif (!preg_match($this->regex, $url, $urlparts)) return false;\n\t\t\t# if we're at / return defaults\n\t\t\t// if ($url == '/') {\n\t\t\t// \tif (!array_key_exists('controller', $out)) $out['controller'] = 'index';\t\t\n\t\t\t// \treturn $out;\n\t\t\t// }\n\n\t\t# moved this up\n\t\t# add defaults\n\t\t#$out = $this->defaults;\n\n\t\t# map it\n\t\t$parts = explode('/', $this->usermap);\n\t\tarray_shift($parts);\n\t\tarray_shift($urlparts);\n\n\t\tforeach($parts as $k => $v) {\t\t\t\n\t\t\t# if it's a placeholder\n\t\t\tif (empty($v)) continue;\n\t\t\tif ($v{0} == ':' || $v{0} == '*') {\n\t\t\t\t$name = substr($v,1);\n\t\t\t\t\n\t\t\t\t# get the value\n\t\t\t\tif (array_key_exists($k, $urlparts) && ($urlparts[$k] != '')) $out[$name] = $urlparts[$k];\n\n\t\t\t\t# handle controller a little different\n\t\t\t\tif ($name == 'controller') {\n\n\t\t\t\t\t# can't be NULL\n\t\t\t\t\tif (is_null($out[$name])) return false;\n\n\t\t\t\t\t# if the requirement hasn't been overridden, make sure the \n\t\t\t\t\t# class is available\n\t\t\t\t\tif (array_key_exists($name, $this->requirements)) {\n\t\t\t\t\t\tif (function_exists($this->requirements[$name])) {\n\t\t\t\t\t\t\tif (!$this->requirements[$name]($out[$name])) return false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!preg_match($this->requirements[$name], $out[$name])) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\t# if there is a requirement for this, \n\t\t\t\t\t# and it isn't NULL\n\t\t\t\t\tif (array_key_exists($name, $this->requirements) && !is_null($out[$name])) {\n\t\t\t\t\t\t# if the req is a function, call it and pass the value,\n\t\t\t\t\t\t# otherwise assume it's a regex\n\t\t\t\t\t\tif (function_exists($this->requirements[$name])) {\n\t\t\t\t\t\t\tif (!$this->requirements[$name]($out[$name])) return false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!preg_match($this->requirements[$name], $out[$name])) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t# clear nulls\n\t\t\t\tif (is_null($out[$name])) unset($out[$name]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t# if no action is set, set it to the default\n\t\tif (!array_key_exists('action', $out)) $out['action'] = $this->defaults['action'];\n\t\t$out['action'] = action_name($out['action']);\n\t\treturn $out;\n\t}\n}", "static function matchUrl($_non404=True){\n\t\t$cBindA = $_non404? self::$bindA : self::$bind404A;\n\n\t\t//collect detected url's\n\t\t$bondA = [];\n\t\tforeach ($cBindA as $cBind)\n\t\t\tif ($cBind->match())\n\t\t\t\t$bondA[] = $cBind;\n\n\t\tif (!count($bondA))\n\t\t\treturn;\n\t\t\n\t\treturn $bondA;\n\t}", "function findKeyAndUriFromVeloWebsite()\n {\n\t\t$urlBase = $this->CI->config->item('UrlBase', 'velobleuconf');\n\t\t$urlCarte = $this->CI->config->item('UrlCarteVeloBleu', 'velobleuconf');\n\t\t\n $pageHTML = @file_get_contents($urlBase . $urlCarte);\n\t\t\n\t\tif(isset($http_response_header) && isValidHttpRequest($pageHTML, $http_response_header))\n\t\t{\n\t\t\t// Trouve la variable mapdb et prend ce qui est contenu entre quotes pour connaitre son contenu\n\t\t\t$posMapDb = strpos($pageHTML, 'var mapdb');\n\t\t\t$posQote1MapDb = strpos($pageHTML, \"'\", $posMapDb) + 1;\n\t\t\t$posQote2MapDb = strpos($pageHTML, \"'\", $posQote1MapDb);\n\t\t\t$varMapDb = substr($pageHTML, $posQote1MapDb, $posQote2MapDb - $posQote1MapDb);\n\t\t\tlog_message('debug', 'found mapdb : ' . $varMapDb);\n\t\t\t$this->mapDb = $varMapDb;\n\n\t\t\t// Idem pour var networks\n\t\t\t$posNetworks = strpos($pageHTML, 'var networks');\n\t\t\t$posQote1Networks = strpos($pageHTML, '\"', $posNetworks) + 1;\n\t\t\t$posQote2Networks = strpos($pageHTML, '\"', $posQote1Networks);\n\t\t\t$varNetworks = strtolower(substr($pageHTML, $posQote1Networks, $posQote2Networks - $posQote1Networks));\n\t\t\tlog_message('debug', 'found networks : ' . $varNetworks);\n\t\t\t$this->networks = $varNetworks;\n\n\t\t\t// Idem pour var mapdbkey\n\t\t\t$posMapdDbKey = strpos($pageHTML, 'var mapdbkey');\n\t\t\t$posQote1MapDbKey = strpos($pageHTML, \"'\", $posMapdDbKey) + 1;\n\t\t\t$posQote2MapDbKey = strpos($pageHTML, \"'\", $posQote1MapDbKey);\n\t\t\t$varMapDbKey = substr($pageHTML, $posQote1MapDbKey, $posQote2MapDbKey - $posQote1MapDbKey);\n\t\t\tlog_message('debug', 'found mapdbkey : ' . $varMapDbKey);\n\t\t\t$this->mapDbKey = $varMapDbKey;\n\n\t\t\t$this->jsonUrl = $this->getJsonUrl();\n\t\t\tlog_message('debug', 'found jsonUrl : ' . $this->jsonUrl);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$httpError = \"Aucune information\";\n\t\t\tif(isset($http_response_header))\n\t\t\t\t$httpError = getHttpError($http_response_header);\n\t\t\t\t\n\t\t\tlog_message('error', 'Chargement des données contenant la clé impossible : ' . $httpError);\n\t\t}\n\n }", "function local_map($field = null){\r\n static $local_map = null;\r\n if($local_map === null || $local_map['id']!=$_GET['local_id']){\r\n $local_map = M('local_map')->find($_GET['local_id']);\r\n }\r\n if($field === null) return $local_map;\r\n else return $local_map[$field];\r\n}", "function init($url=null) {\r\n $yamlSrce = file_get_contents($url ? $url : 'defaultmap.yaml');\r\n if (!($map = yaml_parse($yamlSrce))) {\r\n header('Content-Type: text/plain; charset=UTF-8');\r\n die();\r\n }\r\n if (!isset($map['uniqid']))\r\n $map['uniqid'] = uniqid('map',true);\r\n return $map;\r\n}", "public function getInfo($url);", "function url_contains($string) {\n\n $url = URL;\n //check for string in url\n $lookup = strpos($url, $string);\n\n\n //If string is found, set the value of found_context\n if($lookup > 1 || $lookup !== false) {\n return true;\n }\n\n //If not found, set UNSET the value of found_context\n else {return false; }\n}", "public function getFromMap($cacheKey);" ]
[ "0.62898326", "0.5651631", "0.5563416", "0.5539674", "0.5373406", "0.53635037", "0.532875", "0.5260861", "0.5182166", "0.5173555", "0.51124775", "0.5103224", "0.50712556", "0.5063119", "0.5056335", "0.5056335", "0.50446796", "0.502431", "0.5007343", "0.50061727", "0.5000059", "0.5000059", "0.4996988", "0.4985978", "0.49835828", "0.49814507", "0.49784657", "0.49774072", "0.49761692", "0.49590454" ]
0.6746526
0
Category has one WebsiteShareOnCategory.
public function websiteShareOnCategory() { // hasOne(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id) return $this->hasOne('App\WebsiteShareOnCategory','cate_id','cate_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategory()\n {\n return $this->hasOne(NewsCategory::className(), ['id' => 'category_id']);\n }", "public function category()\n {\n return $this->hasOne('fooCart\\src\\Category', 'category_id', 'category_id');\n }", "public function category(): HasOne\n {\n return $this->hasOne(Category::class, 'id', 'category_id');\n }", "public function blog_category(){\n return $this->hasOne(Blog_category::class, 'id', 'category_id');\n }", "public function getCategory(){\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }", "public function Category()\n { \n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }", "public function Category()\n {\n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getCategory()\n{\n return $this->hasOne(Category::className(), ['id' => 'category']);\n}", "public function getCategory() {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }", "public function category()\n {\n return $this->hasOne(Category::class, 'id', 'category_id');\n }", "public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }", "public function category() {\n return $this->hasOne('App\\Models\\Category', 'id');\n }", "public function shoe_category()\n {\n return $this->hasOne(ShoeCategory::class);\n }", "public function category()\n {\n return $this->hasOne(Category::class, 'id','category_id');\n }", "public function get_category()\n {\n return C__CATG__SHARE_ACCESS;\n }", "public function getCategory()\n\t\t{\n\t\t\treturn $this->hasOne(Categories::className(), ['id' => 'category_id']);\n\t\t}", "public function category()\n {\n return $this->belongsTo('App\\Models\\Site\\SiteMaintenanceCategory', 'category_id');\n }", "public function hasCategory(): bool;", "public function cat(){\n return $this->hasOne(Category::class, 'id','category_id');\n }", "public function category(){\n return $this->belongsTo('Backpack\\NewsCRUD\\app\\Models\\Category', 'category_id');\n }", "public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "public function category()\n {\n\n return $this->hasOne(Category::class, 'id', 'categories_id');\n }", "public function Link()\n {\n return $this->belongsTo('CommunityLink');\n }" ]
[ "0.61733544", "0.6104846", "0.6069041", "0.6049541", "0.5930706", "0.59054744", "0.58798736", "0.5822822", "0.5822822", "0.57783586", "0.57712525", "0.57712525", "0.57712525", "0.5755309", "0.574219", "0.57417893", "0.5739147", "0.5725877", "0.57156736", "0.571346", "0.5700973", "0.56926465", "0.56695056", "0.5646849", "0.5638947", "0.5605552", "0.5603722", "0.5574184", "0.5568933", "0.5558532" ]
0.796353
0
Category has many CategoryProductRelations.
public function categoryProductRelations() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id) return $this->hasMany('App\CategoryProductRelation','cate_id','cate_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function products() {\n return $this->hasMany('App\\Product', 'category_id', 'id');\n }", "public function products() {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function categoryProduct(){\n return $this->hasMany(CategoryProduct::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function getProductCategory()\n {\n return $this->hasMany(ProductCategory::className(), ['category_id' => 'id']);\n }", "public function products(){\n \treturn $this->hasMany(Product::class,'category_id');\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'category_product');\n }", "public function getProducts(){\n return $this->hasMany('App\\Models\\Products', 'categories_id', 'id');\n }", "public function getCategories()\n {\n return $this->hasMany(Category::class, ['id' => 'category_id'])\n ->viaTable('product_category', ['product_id' => 'id']);\n }", "public function product()\n {\n return $this->hasMany(product::class, 'category_id', 'id');\n }", "public function category()\n {\n return $this->belongsToMany('App\\Category', 'product_category', 'pid', 'cid');\n }", "public function categories(){\n\t\treturn $this->belongsToMany('ProductCategory', 'product_pivot_categories');\n\t}", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['category_id' => 'id']);\n }", "public function products(): MorphToMany;", "public function category() {\n \treturn $this->belongsToMany(Category::class, 'product_details', 'category_id');\n }", "public function category()\n {\n return $this->belongsTo('App\\Models\\ProductCategory');\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'categorables');\n }", "public function categories()\n {\n \treturn $this->hasMany('App\\Category');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('category_id');\n }", "public function ProductCategory()\n {\n return $this->belongsTo('App\\Models\\ProductCategory');\n }", "public function category_product()\n {\n return $this->belongsTo(Category_product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function category() {\n\t\treturn $this->belongsToMany('Category');\n\t}", "public function products()\n {\n return $this->belongsToMany(Product::class,'category_product')->withTimestamps();\n \n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function category()\n {\n return $this->belongsToMany('App\\Models\\V1\\Category', 'product_to_category', 'product_id', 'category_id')->withPivot('selected');\n }", "public function category()\n {\n return $this->belongsTo('App\\ProductCategory', 'product_id');\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }" ]
[ "0.75365293", "0.74028045", "0.73917854", "0.7317702", "0.7295011", "0.7272673", "0.72397083", "0.70931435", "0.7025661", "0.70193547", "0.696187", "0.6862123", "0.6825606", "0.65833825", "0.657553", "0.6567236", "0.6566027", "0.6538682", "0.65233684", "0.65141743", "0.6503247", "0.64924866", "0.6471236", "0.64566296", "0.64272153", "0.64247304", "0.63799673", "0.63758194", "0.6313537", "0.6313537" ]
0.74972713
1
$this>_setJs(array( 'pathVars' => '', 'pathTpl' => '', 'arrFolder' => array(), 'strTableSearch' => '', 'strColumnSearch' => '', 'flagEntitySearch' => 0, 'flagAccountSearch' => 0, 'arrSearch' => array( 'idModule' => '', 'numLotNow' => 0, 'strTable' => '', 'arrOrder' => array(), 'arrWhere' => array(), ), ));
protected function _setJs($arr) { global $classSmarty; $vars = $this->getVars(array( 'path' => $arr['pathVars'], )); $rows = $this->getSearch($arr['arrSearch']); $vars = $this->_updateSearch(array( 'vars' => $vars, 'rows' => $rows, )); $vars['portal']['varsNavi'] = array(); $json = json_encode($vars); $classSmarty->assign('varsLoad', $json); $classSmarty->assign('numNews', $this->getNumNews()); $contents = $classSmarty->fetch($arr['pathTpl']); $this->sendJs(array( 'data' => $contents, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJS(){\n \n // prepare for jqgrid\n $conf = $this->conf[$this->conf['key'].'.'];\n $conf['url'] = 'index.php?id='.$this->cObj->data['pid'].'&type='.$conf['typeNum'].'&tskey='.$this->conf['key'];\n $conf['pager'] = '#jqgrid-'.$this->uid.'-pager';\n $conf['datatype'] = 'xml';\n $conf['mtype'] = 'GET';\n $conf['rowList'] = explode(',',$conf['rowList']);\n \n $pagerOpts = $conf['pager.'];\n $pagerOptsEdit = $pagerOpts['edit.'];\n $pagerOptsAdd = $pagerOpts['add.'];\n $pagerOptsDel = $pagerOpts['del.'];\n $pagerOptsSearch = $pagerOpts['search.'];\n $pagerOptsView = $pagerOpts['view.'];\n \n // columns\n foreach($conf['columns.'] as $pos => $field) $conf['colModel'][] = array_diff_key($field,array('stdWrap.'=>0));\n \n // tx_jqgrid_pi1 onlys\n unset($conf['table']);\n unset($conf['table.']);\n unset($conf['typeNum']);\n unset($conf['pager.']);\n unset($conf['columns.']);\n unset($pagerOpts['edit.']);\n unset($pagerOpts['add.']);\n unset($pagerOpts['del.']);\n unset($pagerOpts['search.']);\n unset($pagerOpts['view.']);\n \n $jqGridID = \"#jqgrid-\".$this->uid.\"-list\";\n $jqGridParameters = self::array_js($conf,' ');\n $navGridParameters = implode(',',array(\n\t\t\t\"'\".$conf['pager'].\"'\",\n self::array_js($pagerOpts ,' '),\n self::array_js($pagerOptsEdit ,' '),\n self::array_js($pagerOptsAdd ,' '),\n self::array_js($pagerOptsDel ,' '),\n self::array_js($pagerOptsSearch ,' '),\n self::array_js($pagerOptsView ,' '),\n ));\n \n // transform to js\n $jscode = \"jQuery(document).ready(function(){\\n\";\n $jscode .= \" jQuery('\".$jqGridID.\"').jqGrid(\".$jqGridParameters.\").navGrid(\".$navGridParameters.\");\\n\";\n $jscode .= \"});\\n\";\n \n return $jscode;\n }", "public function js()\n {\n }", "protected function initJavascriptCode() {}", "protected function generateJavascript()\n\t{\n\t}", "protected function loadJavascript() {}", "public function incluirJs()\n {\n $retorno = \"<script type=\\\"text/javascript\\\">\\n\";\n // We use a document ready jquery function.\n $retorno.=\"jQuery(document).ready(function(){\\n\";\n \n $retorno .= \"var lastSel;\\n\";\n \n $retorno.=\"jQuery(\\\"#\" . $this->_idTable . \"\\\").jqGrid({\\n\";\n // the url parameter tells from where to get the data from server adding ?nd='+new Date().getTime() prevent IE caching\n if ($this->_url != '' & $this->_tipodatos != 'local') {\n $retorno.=\"url:'\" . $this->_url . \"',\\n\";\n }\n if ($this->_editUrl != '' & $this->_tipodatos != 'local') {\n $retorno.=\"editurl:'\" . $this->_editUrl . \"',\\n\";\n }\n if ($this->_caption != '') {\n $retorno.= \"caption:'\" . $this->_caption . \"',\\n\";\n }\n if ($this->_cellEdit == true) {\n $retorno.= \"cellEdit: true,\\n\";\n $retorno.= \"cellsubmit: 'remote',\\n\";\n $retorno.= \"cellurl: '\" . $this->_editUrl . \"',\\n\";\n $retorno.= \"afterSaveCell : alert('se guardo'),\\n\";\n }\n// $retorno .= \"var lastsel;\" . \"\\n\";\n $retorno.=\"height: \" . $this->_height . \",\\n\";\n // datatype parameter defines the format of data returned from the server in this case we use a JSON data\n $retorno.=\"datatype: \\\"\" . $this->_tipodatos . \"\\\",\\n\";\n // colNames parameter is a array in which we describe the names in the columns. This is the text that apper in the head of the grid.\n $retorno.=\"colNames:[\" . $this->_colNames . \"],\\n\";\n // colModel array describes the model of the column.\n // name is the name of the column, index is the name passed to the server to sort data\n // note that we can pass here nubers too. width is the width of the column\n // align is the align of the column (default is left) sortable defines if this column can be sorted (default true)\n $retorno.=\"colModel:[\\n\";\n $retorno.= $this->_colModel;\n $retorno.=\"],\\n\";\n // rowNum parameter describes how many records we want to view in the grid. We use this in example.php to return\n // the needed data.\n $retorno.=\"rowNum:\" . $this->_rows . \",\\n\";\n // rowList parameter construct a select box element in the pager in wich we can change the number of the visible rows\n $retorno.=\"rowList:[10,20,30],\\n\";\n // pager parameter define that we want to use a pager bar in this case this must be a valid html element.\n // note that the pager can have a position where you want\n $retorno.=\"pager: jQuery('#pager2'),\\n\";\n // sortname sets the initial sorting column. Can be a name or number. this parameter is added to the url\n// \t$retorno.=\"sortname:'ID',\\n\";\n //viewrecords defines the view the total records from the query in the pager bar. The related tag is: records in xml or json definitions.\n $retorno.=\"viewrecords: true,\\n\";\n //sets the sorting order. Default is asc. This parameter is added to the url\n $retorno.=\"sortorder: \\\"desc\\\",\\n\";\n \n if ($this->_ondblClickRow){\n $retorno .= 'ondblClickRow: function(id){ location.href = \"' . BASE_URL . $this->_actionOnDblClickRow . \"\\\"+id\" . \";}\\n\";\n //$retorno .= \"ondblClickRow: function(id){ location.href = '\" . LIVESITE . \"/index.php?option=\" . $this->_idTable . \"&sub=detalle&id=' +id;},\\n\";\n } \n \n if ($this->_onSelectRow){\n $retorno .= 'onSelectRow: ' . $this->_actionOnSelectRow;\n } \n \n if ($this->_toolbar == 'YES'){\n $retorno.= \"toolbar: [true,\\\"\" . $this->_tb_ubicacion . \"\\\"],\\n\";\n }\n// if ($this->_userdata != '') {\n// $retorno .= \"userdata: \" . $this->_userdata . \",\\n\";\n// $retorno .= \"loadComplete: function() {\\n\";\n// $retorno .= \"var tig=jQuery(\\\"#\" . $this->_idTable . \"\\\").getGridParam('userdata');\\n\";\n// $retorno .= \"$(\\\"#t_\" . $this->_idTable . \"\\\").css(\\\"text-align\\\",\\\"right\\\").html(\\\"Total Importe Gravado:$\\\" + tig.total_importe_gravado + \\\" - Total Iva:$\\\" + tig.total_iva + \\\"&nbsp;&nbsp;&nbsp;\\\")},\\n\";\n// $retorno .= \"caption: \\\"\" . $this->_caption . \"\\\",\\n\";\n// }\n//\t\tif ($this->_footerrow == 'YES'){\n// \t \t\t$retorno.= \"footerrow: true,\\n\";\n// \t \t\t$retorno.= \"userDataOnFooter: true,\\n\";\n// \t \t\t$retorno.= \"altRows: true \\n\";\n//\t\t}\n//\t\t$retorno.=\"editurl:\\\"someurl.php\\\"\\n\"; \n $retorno.=\"});\\n\";\n\n $retorno .= \"$(\\\"#\" . $this->_idTable . \"\\\").jqGrid('navGrid','#pager2',\\n\";\n $retorno .= \"{\";\n if ($this->_ifBotonEditar){\n $retorno .= \"edit:true,\";\n }else{\n $retorno .= \"edit:false,\";\n }\n if ($this->_ifBotonEliminar){\n $retorno .= \"del:true,\\n\";\n }else{\n $retorno .= \"del:false,\\n\";\n }\n if ($this->_ifBotonBuscar){\n $retorno .= \"search:true,\\n\";\n }else{\n $retorno .= \"search:false,\\n\";\n }\n if ($this->_ifBotonAgregar){\n $retorno .= \"add:true,\\n\";\n }else{\n $retorno .= \"add:false,\\n\";\n }\n $retorno .= \"refresh:true,position:\\\"left\\\"},\\n\"; //options\n $retorno .= \"{width:280,reloadAfterSubmit:false},\"; // edit options\n $retorno .= \"{width:380,reloadAfterSubmit:false},\"; // add options\n $retorno .= \"{reloadAfterSubmit:false},\"; // del options\n $retorno .= \"{})\"; // search options\n// \n//\t\t$retorno .= \"{},\\n\"; // // add options \n//\t\t$retorno .= \"{width:400, url: 'bin/bin_oferta_borrado.php?q=1'},\\n\"; // del options \n//\t\t$retorno .= \"{width:900},\\n\"; //edit options \n//\t\t$retorno .= \"{width:600, multipleSearch : true},\\n\"; // search options \n//\t\t$retorno .= \"{closeOnEscape:true})\\n\";\n//\t\tif ($this->_export != ''){\n//\t\t $retorno .= \".jqGrid('navButtonAdd','#pager2',{caption:\\\"\\\",title:\\\"Export\\\",buttonicon:\\\"ui-icon-disk\\\",onClickButton:function(){\\n\";\n//\t\t $retorno .= \" window.location.href = \\\"\" . $this->_export . \"\\\";\t}});\\n\";\n//\t\t}\n//\t\t\n//\t\tif ($this->_tipodatos == 'clientSide'){\n//\t\t $retorno .= \"var myfirstrow = {hora:\\\"14:00\\\", lunes:\\\"\\\", martes:\\\"\\\", miercoles:\\\"\\\", jueves:\\\"NO\\\", viernes:\\\"\\\"};\\n\";\n// $retorno .= \"$(\\\"#\" . $this->_idTable . \"\\\").addRowData(\\\"1\\\", myfirstrow);\\n\";\n//\t\t}\n//\t\tif ($this->_tipodatos == 'local'){\n//\t\t $retorno .= \"var mydata = $this->_datosLocal\";\n//\t\t $retorno .= \"for(var i=0;i<=mydata.length;i++) jQuery(\\\"#list4\\\").jqGrid('addRowData',i+1,mydata[i]);\"; \n//\t\t}\n\n /* \t\t//Código para borrar desde un link o botón que tenga como id \"borrar\"\t\t\n $retorno .= \"$(\\\"#borrar\\\").click( function(){\\n\";\n $retorno .= \"var idr = jQuery(\\\"#\" . $this->_idTable . \"\\\").jqGrid('getGridParam','selrow');\\n\";\n $retorno .= \"if (idr != null ) jQuery(\\\"#\" . $this->_idTable . \"\\\").jqGrid('delGridRow',idr,{reloadAfterSubmit:false});\\n\";\n $retorno .= \"else alert(\\\"Please Select Row to delete!\\\");\\n\";\n $retorno .= \"});\\n\"; */\n\n /* \t\tEsto es para exportar la grilla\n * \t\tjQuery(\"#grid_id\").jqGridExport(options);\n */\n\n $retorno.=\"});\\n\";\n $retorno.=\"</script>\\n\";\n return $retorno;\n }", "protected function generateJavascript() {}", "protected function generateJavascript() {}", "public function init()\n {\n Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . \"/js/search-triple.js\", CClientScript::POS_END);\n\n }", "public function js();", "function _javascript($view) {\n switch ($view) {\n case 'invoices_add':\n $java = array(\n \"'\" . base_url() . \"../assets/global/plugins/counterup/jquery.waypoints.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/counterup/jquery.counterup.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/bootstrap-toastr/toastr.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js'\",\n \"'\" . base_url() . \"../assets/global/scripts/datatable.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/datatables/datatables.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js'\",\n \"'\" . base_url() . \"../assets/global/scripts/app.min.js'\",\n \"'\" . base_url() . \"../assets/pages/scripts/table-datatables-responsive.js'\",\n \"'\" . base_url() . \"../assets/layouts/layout/scripts/layout.min.js'\",\n );\n\t\t\t\t\n break;\n case 'invoices_view':\n $java = array(\n \"'\" . base_url() . \"../assets/global/plugins/counterup/jquery.waypoints.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/counterup/jquery.counterup.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/bootstrap-toastr/toastr.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js'\",\n \"'\" . base_url() . \"../assets/global/scripts/app.min.js'\",\n \"'\" . base_url() . \"../assets/layouts/layout/scripts/layout.min.js'\",\n );\n\t\t\t\t\n break;\n }\n return $java;\n }", "public function setJavascriptData() {\n // Make Services List\n $services = array(\n 'billingDashboard' => $this->createAbsoluteUrl('billingDashboard/index'),\n // Invoice export / preview urls\n 'exportInvoice' => $this->createAbsoluteUrl('createInvoice', array('report' => 1)),\n );\n // Encode to javascript\n $servicesEncoded = CJavaScript::encode($services);\n \n // Set javascript variable\n Yii::app()->clientScript->registerScript('set_services', \"\n var services = {$servicesEncoded};\n \", CClientScript::POS_BEGIN);\n }", "function _javascript($view) {\n switch ($view) {\n case 'credit_list':\n $java = array(\n \"'\" . base_url() . \"../assets/global/plugins/jquery.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/jquery-migrate.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/jquery-ui/jquery-ui.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/bootstrap/js/bootstrap.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/jquery.blockui.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/jquery.cokie.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/uniform/jquery.uniform.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/bootstrap-select/bootstrap-select.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/select2/select2.min.js'\",\n \"'\" . base_url() . \"../assets/global/plugins/jquery-multi-select/js/jquery.multi-select.js'\",\n \"'\" . base_url() . \"../assets/global/scripts/metronic.js'\",\n \"'\" . base_url() . \"../assets/admin/layout/scripts/layout.js'\",\n \"'\" . base_url() . \"../assets/admin/layout/scripts/quick-sidebar.js'\",\n \"'\" . base_url() . \"../assets/admin/layout/scripts/demo.js'\",\n \"'\" . base_url() . \"../assets/admin/pages/scripts/index.js'\",\n \"'\" . base_url() . \"../assets/admin/pages/scripts/tasks.js'\",\n \"'\" . base_url() . \"../assets/admin/pages/scripts/components-dropdowns.js'\"\n\t\t\t\t\t\n );\n break;\n }\n return $java;\n }", "protected function addCustomJS()\n\t{\n\t\t\n\t}", "function _getJS()\n\t{\n\t\t$js = 'function we_cmd() {\n\t\t\t\t\tvar args = \"\";\n\t\t\t\t\tvar url = \"' . WEBEDITION_DIR . 'we_cmd.php?\"; for(var i = 0; i < arguments.length; i++){ url += \"we_cmd[\"+i+\"]=\"+escape(arguments[i]); if(i < (arguments.length - 1)){ url += \"&\"; }}\n\n\t\t\t\t\tswitch (arguments[0]) {\n \t\t\t\t\tcase \"openDocselector\":\n\t\t\t\t\t\t\tnew jsWindow(url,\"we_docselector\",-1,-1,' . WINDOW_DOCSELECTOR_WIDTH . ',' . WINDOW_DOCSELECTOR_HEIGHT . ',true,true,true,true);\n\t\t\t\t\t\t\tbreak;\n\n \t\t\t\t\tcase \"openDirselector\":\n\t\t\t\t\t\t\tnew jsWindow(url,\"we_dirselector\",-1,-1,' . WINDOW_DIRSELECTOR_WIDTH . ',' . WINDOW_DIRSELECTOR_HEIGHT . ',true,true,true,true);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase \"browse_server\":\n \t\t\t\t\t\t\tnew jsWindow(url,\"browse_server\",-1,-1,800,400,true,false,true);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase \"siteImportCreateWePageSettings\":\n\t\t\t\t\t\t\tnew jsWindow(url,\"siteImportCreateWePageSettings\",-1,-1,520,600,true,false,true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction hideTable() {\n\t\t\t\t\tdocument.getElementById(\"specifyParam\").style.display=\"none\";\n\t\t\t\t}\n\n\t\t\t\tfunction displayTable() {\n\t\t\t\t\tif (document.we_form.templateID.value > 0) {\n\t\t\t\t\t\tdocument.getElementById(\"specifyParam\").style.display=\"block\";\n\t\t\t\t\t\tvar iframeObj = document.getElementById(\"iloadframe\");\n\t\t\t\t\t\tiframeObj.src = \"/webEdition/we_cmd.php?we_cmd[0]=updateSiteImportTable&tid=\"+document.we_form.templateID.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t' . \"\\n\";\n\t\t\n\t\t$js = we_htmlElement::jsElement($js) . \"\\n\";\n\t\t$js .= we_htmlElement::jsElement(\"\", array(\n\t\t\t\"src\" => JS_DIR . \"windows.js\"\n\t\t)) . \"\\n\";\n\t\t$js .= we_htmlElement::jsElement(\n\t\t\t\t\"\\n\" . 'function doUnload() {\n\t\t\t\t\tif (jsWindow_count) {\n\t\t\t\t\t\tfor (i = 0; i < jsWindow_count; i++) {\n\t\t\t\t\t\t\teval(\"jsWindow\" + i + \"Object.close()\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}' . \"\\n\");\n\t\treturn $js;\n\t}", "public function _js_vars()\n {\n }", "public function js_1()\n {\n }", "function export_add_js()\n {\n }", "protected function loadJavaScripts() {}", "protected function _getEndJs()\r\n\t{\r\n\t\t$js = parent::_getEndJs();\r\n\t\t\r\n\t\t$paymentMethods = array_map(create_function('$a', 'return $a->getJson();'), PaymentMethod::getAll());\r\n\t\t$shippingMethods = array_map(create_function('$a', 'return $a->getJson();'), Courier::getAll());\r\n\t\t$customer = (isset($_REQUEST['customerid']) && ($customer = Customer::get(trim($_REQUEST['customerid']))) instanceof Customer) ? $customer->getJson() : null;\r\n\t\t$js .= \"pageJs\";\r\n\t\t\t$js .= \".setHTMLIDs('detailswrapper')\";\r\n\t\t\t$js .= \".setCallbackId('searchCustomer', '\" . $this->searchCustomerBtn->getUniqueID() . \"')\";\r\n\t\t\t$js .= \".setCallbackId('searchProduct', '\" . $this->searchProductBtn->getUniqueID() . \"')\";\r\n\t\t\t$js .= \".setCallbackId('saveOrder', '\" . $this->saveOrderBtn->getUniqueID() . \"')\";\r\n\t\t\t$js .= \".setPaymentMethods(\" . json_encode($paymentMethods) . \")\";\r\n\t\t\t$js .= \".setShippingMethods(\" . json_encode($shippingMethods) . \")\";\r\n\t\t\t$js .= \".setOrderTypes(\" . json_encode(array_filter(Order::getAllTypes(), create_function('$a', 'return $a !== \"INVOICE\";'))) . \")\";\r\n\t\t\t$js .= \".init(\" . json_encode($customer) . \");\";\r\n\t\treturn $js;\r\n\t}", "function options_general_add_js()\n {\n }", "public function getJs();", "function okr_load_js(){\n $CI = &get_instance();\n $viewuri = $_SERVER['REQUEST_URI'];\n if (!(strpos($viewuri,'/admin/okr') === false)) {\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/js/okr.js').'?v=' . VERSION_OKR.'\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/jquery-circle-progress/circle-progress.min.js').'?v=' . VERSION_OKR.'\"></script>';\n }\n if (!(strpos($viewuri,'/admin/okr/setting') === false)) {\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/js/setting/setting.js').'?v=' . VERSION_OKR.'\"></script>';\n }\n if (!(strpos($viewuri,'/admin/okr/okrs') === false) || !(strpos($viewuri,'admin/okr/checkin') === false) || !(strpos($viewuri,'/admin/okr/checkin_detailt') === false) || !(strpos($viewuri,'/admin/okr/show_detail_node' ) === false) ) {\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/dist/jstree.min.js').'\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/dist/js/jquery.treegrid.min.js').'\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/paging.js').'\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/Chart/js/jQuery.jHTree.js').'\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/demo.js').'\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/jquery.rate.min.js').'\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/OrgChart-master/jquery.orgchart.js').'\"></script>';\n }\n if (!(strpos($viewuri,'/admin/okr/checkin_detailt') === false) || !(strpos($viewuri,'/admin/okr/view_details' ) === false) || !(strpos($viewuri,'/admin/okr/show_detail_node' ) === false)) {\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/highcharts.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/variable-pie.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/export-data.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/accessibility.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/exporting.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/highcharts-3d.js') . '\"></script>';\n echo '<script src=\"'.module_dir_url(OKR_MODULE_NAME, 'assets/plugin/jquery.lineProgressbar.js').'\"></script>';\n }\n\n if (!(strpos($viewuri,'/admin/okr/dashboard') === false)) {\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/highcharts.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/variable-pie.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/export-data.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/accessibility.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/modules/exporting.js') . '\"></script>';\n echo '<script src=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/highcharts/highcharts-3d.js') . '\"></script>';\n }\n}", "public function INTincScript_loadJSCode() {}", "public function getJavaScripts()\n {\n return array(\n '/ullCorePlugin/js/jq/jquery-min.js',\n '/ullCorePlugin/js/jq/jquery.add_select_filter.js', \n ); \n }", "protected function getJsSettings()\n\t{\n\t\t$jsSettings = [];\n\t\t$jsSettings['variableName'] = '_'.$this->nj_ext_key.'_'.$this->nj_domain.'_'.explode('Action',self::getCaller())[0];\n\t\t$jsSettings['container'] = '.'.$this->nj_ext_key.'.'.$this->nj_domain.'.'.explode('Action',self::getCaller())[0];\n\t\t\n\t\t\n\t\t$jsSettings['lang']['id'] = $GLOBALS['TSFE']->sys_language_uid;\n\t\t$jsSettings['lang']['iso'] = strtolower($GLOBALS['TSFE']->sys_language_isocode);\n\n\t\t$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);\n\n\t\t$jsSettings['path']['partial'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['partialRootPath']);\n\t\t$jsSettings['path']['template'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);\n\n\t\t$jsSettings['typeNum'] = $this->settings['general']['ajax']['typeNum'];\n\t\t$jsSettings['pageId'] = $GLOBALS['TSFE']->page['uid'];\n\t\t\n\t\treturn $jsSettings;\n\t}", "protected function setJavaScriptCodeArray() {}", "public function getJavaScript() {}", "public function __construct() {\n $this->_pdata['jslist'] = array('custom');\n }", "public function setJavascript() {\n $this->javascript = true;\n }" ]
[ "0.6915657", "0.6707993", "0.6632364", "0.65756345", "0.65636283", "0.64884853", "0.648505", "0.6484912", "0.64676976", "0.64343274", "0.64183104", "0.63998747", "0.6312701", "0.6307617", "0.6289995", "0.6271206", "0.6239197", "0.6237788", "0.6237416", "0.62217176", "0.6220463", "0.61863095", "0.6186069", "0.61583644", "0.6148765", "0.6133076", "0.61149645", "0.61051786", "0.61048514", "0.6102152" ]
0.7207897
0
(array( 'vars' => $vars['varsItem']['varsJsonChargeHistory'], 'value' => $value['jsonChargeHistory'], ))
protected function _getJsonChargeHistoryVarsDetail($arr) { $classTime = new Code_Else_Lib_Time(); global $varsAccount; global $varsAccounts; global $varsPluginAccountingAccountsId; $array = $arr['value']; if (!$arr['value']) { $array = array(); } $varsDetail = array(); $varsData = array(); $num = 1; foreach ($array as $key => $value) { $tmplDetail = $arr['tmplDetail']; $tmplDetail['id'] = $num; $strNo = $num; $tmplData = $arr['tmplData']; $tmplData['value'] = $strNo; $tmplDetail['varsDetail']['id'] = $tmplData; $classTime->setTimeZone(array('data' => $varsAccount['numTimeZone'])); $strTime = $classTime->getDisplay(array( 'stamp' => $value['stampRegister'], 'flagType' => 1, )); $tmplData = $arr['tmplData']; $tmplData['value'] = $strTime; $tmplDetail['varsDetail']['stampRegister'] = $tmplData; $strCodeName = $varsAccounts[$value['idAccount']]['strCodeName']; if (!$varsAccounts[$value['idAccount']]['strCodeName']) { $strCodeName = $varsPluginAccountingAccountsId[$value['idAccount']]['strCodeName']; } $tmplData = $arr['tmplData']; $tmplData['value'] = $strCodeName; $tmplDetail['varsDetail']['idAccount'] = $tmplData; $varsDetail[] = $tmplDetail; $tempVars = array(); $tempVars['idAccount'] = $value['idAccount']; $tempVars['strCodeName'] = $strCodeName; $varsData[] = $tempVars; $num++; } $data = array( 'varsDetail' => $varsDetail, 'varsData' => $varsData, ); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function construct_value_array() {\r\n\t\t$fields = array(\r\n\t\t\t'Amount' => $this->cart_data['total_price'] * 100,\r\n\t\t\t'CurrencyCode' => $this->get_currency_iso_code( $this->cart_data['store_currency'] ),\r\n\t\t\t'OrderID' => $this->purchase_id,\r\n\t\t\t'TransactionType' => 'SALE',\r\n\t\t\t'TransactionDateTime' => date( 'Y-m-d H:i:s P' ),\r\n\t\t\t'CallbackURL' => add_query_arg( 'gateway', 'paymentsense', $this->cart_data['notification_url'] ),\r\n\t\t\t'OrderDescription' => 'Order ID: ' . $this->purchase_id . ' - ' . $this->cart_data['session_id'],\r\n\t\t\t'CustomerName' => $this->cart_data['billing_address']['first_name'] . ' ' . $this->cart_data['billing_address']['last_name'],\r\n\t\t\t'Address1' => trim( implode( '&#10;', explode( \"\\n\\r\", $this->cart_data['billing_address']['address'] ) ), '&#10;' ),\r\n\t\t\t'Address2' => '',\r\n\t\t\t'Address3' => '',\r\n\t\t\t'Address4' => '',\r\n\t\t\t'City' => $this->cart_data['billing_address']['city'],\r\n\t\t\t'State' => $this->cart_data['billing_address']['state'],\r\n\t\t\t'PostCode' => $this->cart_data['billing_address']['post_code'],\r\n\t\t\t'CountryCode' => $this->get_country_iso_code( $this->cart_data['billing_address']['country'] ),\r\n\t\t\t'EmailAddress' => $this->cart_data['email_address'],\r\n\t\t\t'PhoneNumber' => $this->cart_data['billing_address']['phone'],\r\n\t\t\t'EmailAddressEditable' => 'true',\r\n\t\t\t'PhoneNumberEditable' => 'true',\r\n\t\t\t'CV2Mandatory' => 'true',\r\n\t\t\t'Address1Mandatory' => 'true',\r\n\t\t\t'CityMandatory' => 'true',\r\n\t\t\t'PostCodeMandatory' => 'true',\r\n\t\t\t'StateMandatory' => 'true',\r\n\t\t\t'CountryMandatory' => 'true',\r\n\t\t\t'ResultDeliveryMethod' => 'POST',\r\n\t\t\t'ServerResultURL' => '',\r\n\t\t\t'PaymentFormDisplaysResult' => 'false',\r\n\t\t);\r\n\r\n\t\t$data = 'MerchantID=' . get_option( 'paymentsense_id' );\r\n\t\t$data .= '&Password=' . get_option( 'paymentsense_password' );\r\n\r\n\t\tforeach ( $fields as $key => $value ) {\r\n\t\t\t$data .= '&' . $key . '=' . $value;\r\n\t\t};\r\n\r\n\t\t$additional_fields = array(\r\n\t\t\t'HashDigest' => $this->calculate_hash_digest( $data, 'SHA1', get_option( 'paymentsense_preshared_key' ) ),\r\n\t\t\t'MerchantID' => get_option( 'paymentsense_id' ),\r\n\t\t);\r\n\r\n\t\t$this->request_data = array_merge( $additional_fields, $fields );\r\n\t}", "public function parse()\n {\n $strBuffer = parent::parse();\n\n foreach($this->arrData['variables'] as $varName=>$varValue)\n {\n if (empty($varValue))\n {\n continue;\n }\n\n // Convert date values\n /*switch ($objVar['type'])\n {\n case 'date':\n $objVar['value'] = \\Date::parse(\\Config::get('dateFormat'), $objVar['value']);\n break;\n\n case 'time':\n $objVar['value'] = \\Date::parse(\\Config::get('timeFormat'), $objVar['value']);\n break;\n\n case 'datim':\n $objVar['value'] = \\Date::parse(\\Config::get('datimFormat'), $objVar['value']);\n break;\n }*/\n\n //$objVar['value'] = str_replace('$', '\\$', $objVar['value']);\n\n if (is_array($varValue))\n {\n $varValue = json_encode($varValue);\n }\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\s*%}/s', $varValue, $strBuffer);\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\|\\s*nl2br\\s*%}/s', nl2br($varValue), $strBuffer);\n }\n\n $strBuffer = preg_replace('/{%.*?%}/s', '', $strBuffer);\n\n return $strBuffer;\n }", "function format_value( $value, $post_id, $field )\n\t\t{\n\n\t\t\tif(is_array($value)) {\n\t\t\t\t$array = array();\n\n\t\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t\t$array[$k] = json_decode( $v, true );\n\t\t\t\t}\n\n\t\t\t\treturn $array;\n\t\t\t}\n\n\t\t}", "public function getParamHistory($object)\n {\n $params = array();\n if (isset($object['upload_songs']))\n {\n $params['selling_total_upload_songs'] = $object['upload_songs'];\n }\n else\n {\n $params['selling_total_upload_songs'] = 0; \n }\n if (isset($object['download_songs']))\n {\n $params['selling_total_download_songs'] = $object['download_songs'];\n }\n else\n {\n $params['selling_total_download_songs'] = 0; \n }\n if (isset($object['sold_songs']))\n {\n $params['selling_sold_songs'] = $object['sold_songs'];\n }\n else\n {\n $params['selling_sold_songs'] = 0; \n }\n if (isset($object['sold_albums']))\n {\n $params['selling_sold_albums'] = $object['sold_albums'];\n }\n else\n {\n $params['selling_sold_albums'] = 0; \n }\n if (isset($object['new_accounts']))\n {\n $params['selling_final_new_account'] = $object['new_accounts'];\n }\n else\n {\n $params['selling_final_new_account'] = 0; \n }\n if (isset($object['transaction_succ']))\n {\n $params['selling_transaction_succ'] = $object['transaction_succ'];\n }\n else\n {\n $params['selling_transaction_succ'] = 0; \n }\n if (isset($object['transaction_fail']))\n {\n $params['selling_transaction_fail'] = $object['transaction_fail'];\n }\n else\n {\n $params['selling_transaction_fail'] = 0; \n }\n if (isset($object['total_amount']))\n {\n $params['selling_total_amount'] = $object['total_amount'];\n }\n else\n {\n $params['selling_total_amount'] = 0; \n }\n if (isset($object['params']))\n {\n $params['params'] = serialize($object['params']);\n }\n else\n {\n $params['params'] = ''; \n }\n return $params;\n \n \n }", "function fetchExpiryDates($json) {\n $expDates = array();\n foreach($json['optionChain']['result'][0]['expirationDates'] as $item) {\n array_push($expDates, $item);\n }\n return $expDates;\n}", "public function get_values(){ return $this->values; }", "public static function getJson()\n {\n /*\n {\n \"block_hash\": \"0000000000000000c504bdea36e531d8089d324f2d936c86e3274f97f8a44328\",\n \"block_height\": 293000,\n \"hash\": \"f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449\",\n \"addresses\": [\n \"13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy\",\n \"19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L\",\n \"1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy\",\n \"1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq\",\n \"1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV\"\n ],\n \"total\": 70320221545,\n \"fees\": 0,\n \"preference\": \"low\",\n \"relayed_by\": \"\",\n \"confirmed\": \"2014-03-29T01:29:19Z\",\n \"received\": \"2014-03-29T01:29:19Z\",\n \"ver\": 1,\n \"lock_time\": 0,\n \"double_spend\": false,\n \"vin_sz\": 4,\n \"vout_sz\": 1,\n \"confirmations\": 59116,\n \"confidence\": 1,\n \"inputs\": [\n {\n \"prev_hash\": \"583910b7bf90ab802e22e5c25a89b59862b20c8c1aeb24dfb94e7a508a70f121\",\n \"output_index\": 1,\n \"script\": \"4830450220504b1ccfddf508422bdd8b0fcda2b1483e87aee1b486c0130bc29226bbce3b4e022100b5befcfcf0d3bf6ebf0ac2f93badb19e3042c7bed456c398e743b885e782466c012103b1feb40b99e8ff18469484a50e8b52cc478d5f4f773a341fbd920a4ceaedd4bf\",\n \"output_value\": 16450000,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n },\n {\n \"prev_hash\": \"f6966bb3d3ba0eb97fd11b223fb13c793c0b4a1b3deb575e8ae38d666c1d00d9\",\n \"output_index\": 36,\n \"script\": \"48304502210086de855e03008abcc49335c775973eab9ace2e16c3bfe6536218c1d029287fdb0220129ced657870af63f61cdd4b941996f9a243d1f306e774fc9c5f3dea0af8d581012103cbe40d1d790799a6494c07f844eaf05b4c6deab0b9dee2ee45c8decead12c5cd\",\n \"output_value\": 10061545,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n },\n {\n \"prev_hash\": \"9ea2f9695e6694309fb0d8b966afb4678a77a59f160822e33819fada9e0c8288\",\n \"output_index\": 1,\n \"script\": \"48304502201f1eb5b79279258a91c00dee09dff5d6f6ece7c01639e66a6bdd579136ecddee022100d4a9ed93183bf338e51ba80bc1dd10ff03e9e159bd8ea59db3a5c10aa0ccd3400121022667ee37e180c1ad2fef6f16aa52ed27799f629364dfe51e144dd683317dbbd2\",\n \"output_value\": 70000000000,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n },\n {\n \"prev_hash\": \"279ccbbab8605390a85fe6f0e4fb04ec1946ee6033054b16fec72e1304742d5d\",\n \"output_index\": 0,\n \"script\": \"483045022100baac0c25867855f62592872cfac522d59fddd590a6cc290c8ad3bbe6b1151b5802204f2713c565ce6b00e5ea00e955d35e3b0878af5474feda35ebbb73232122d5480121023ed3b44ad598e3834e561efed205c221b7bc2e577e752eeaa66e85e60d0381c9\",\n \"output_value\": 293710000,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n }\n ],\n \"outputs\": [\n {\n \"value\": 70320221545,\n \"script\": \"76a914e6aad9d712c419ea8febf009a3f3bfdd8d222fac88ac\",\n \"spent_by\": \"35832d6c70b98b54e9a53ab2d51176eb19ad11bc4505d6bb1ea6c51a68cb92ee\",\n \"addresses\": [\n \"1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n }\n ],\n \"next_inputs\": \"https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449?instart=2\\u0026outstart=1\\u0026limit=1\",\n \"error\": \"\",\n \"errors\": []\n }\n */\n\n /** @noinspection SpellCheckingInspection */\n return '{\"block_hash\":\"0000000000000000c504bdea36e531d8089d324f2d936c86e3274f97f8a44328\",\"block_height\":293000,\"hash\":\"f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449\",\"addresses\":[\"13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy\",\"19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L\",\"1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy\",\"1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq\",\"1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV\"],\"total\":70320221545,\"fees\":0,\"preference\":\"low\",\"relayed_by\":\"\",\"confirmed\":\"2014-03-29T01:29:19Z\",\"received\":\"2014-03-29T01:29:19Z\",\"ver\":1,\"lock_time\":0,\"double_spend\":false,\"vin_sz\":4,\"vout_sz\":1,\"confirmations\":59116,\"confidence\":1,\"inputs\":[' . TXInputTest::getJson() . '],\"outputs\":[' . TXOutputTest::getJson() . '],\"next_inputs\":\"https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449?instart=2\\u0026outstart=1\\u0026limit=1\",\"error\":\"\",\"errors\":[]}';\n }", "function f_json_values($select){\n # repasso os valores em uma string todo o $post\n\n ## verifico quantas respostas e seleciona apeneas values ##\n # caso values esteja na raiz da array\n if (array_key_exists(\"values\", $select)) {\n $return = $select['values']; #exibe\n }\n\n # caso exista uma lista de resultados\n else{\n # conta quantas ocorrencias\n $temp['count'] = count($select);\n\n # seleciono cada sequancia\n for ($temp['some']=0; $temp['some'] < $temp['count']; $temp['some']++) {\n\n # trabalha o resultado de res\n if($temp['some'] <= 0) {\n\n # preenche quando em zero\n $temp['return'] = $select[$temp['some']]['values'];\n }else{\n\n # adiciona quando maior que zero\n $temp['return'] = $temp['return'] .\", \". $select[$temp['some']]['values'];\n }\n\n # aplico em return\n $return = $temp['return'];\n }\n }\n\n # retoorna a função\n return $return;\n}", "public function testing()\n{\n\necho date('Y-m-d H:i:s', strtotime('-24 hours')); die;\n//$value = json_decode(stripslashes($_POST['beacon_id']),true);\n//echo $string; die;\n//$data2=json_decode($string,true);\n\t//echo date('Y-m-d h:i:s'); die;\n//echo \"<pre>\"; print_r($value); die;\n//echo base64_encode($_FILES['name']); die;\n/*$uniq=$this->gen_uuid();\necho $uniq;die;\necho $_POST['jjs']; die;\n$string = str_replace(' ', '\\', $_POST['jjs']);\necho $string; die;\n$jsd=json_decode($_POST['jjs'],true);\necho json_encode($jsd); die;\necho json_encode(array('firstvar'=>$this->passedArgs['abc'],'secondvar'=>$this->passedArgs['bbd'])); die;*/\n}", "function format_value( $value, $post_id, $field )\n {\n return json_decode($value);\n }", "function getSensorMetadata($from){\n\n $jsonResponse = array(\n 'method' => 'getSensorMetadata',\n 'sensors' => array(\n array(\n 'sensor_id' => 'geiger_counter_sensor',\n 'fullName' => ' Geiger–Mueller counter_sensor',\n 'description' => 'It detects radiation such as alpha particles, beta particles and gamma rays using the ionization produced in a Geiger–Mueller tube',\n 'webSocketType' => \"text\",\n 'produces' => 'application/json',\n 'values' => array(\n array(\n 'name' => 'experiment_status',\n 'unit' => '',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '0',\n 'rangeMaximum' => '10000',\n 'rangeStep' => '1',\n 'updateFrequency' => 'batched'), //check this RemainingRuntime\n array(\n 'name' => 'QueueLength',\n 'unit' => '',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '0',\n 'rangeMaximum' => '10000',\n 'rangeStep' => '1',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'RemainingRuntime',\n 'unit' => 's',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '0',\n 'rangeMaximum' => '10000',\n 'rangeStep' => '1',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'experiment_id',\n 'unit' => '',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '0',\n 'rangeMaximum' => '10000',\n 'rangeStep' => '1',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'setupName',\n 'unit' => '', //ex. \"RadioactivityVsDistance\"\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '',\n 'rangeMaximum' => '',\n 'rangeStep' => '',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'setupId', //setupName\n 'unit' => '', //ex. \"RadioactivityVsDistance\"\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '',\n 'rangeMaximum' => '',\n 'rangeStep' => '',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'sourceName',\n 'unit' => '', //ex. Strontium-90\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '',\n 'rangeMaximum' => '',\n 'rangeStep' => '',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'repeat',\n 'unit' => '', //number of trials\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '',\n 'rangeMaximum' => '',\n 'rangeStep' => '',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'duration',\n 'unit' => '', //ex. \"RadioactivityVsDistance\"\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '',\n 'rangeMaximum' => '',\n 'rangeStep' => '',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'radiation_array',\n 'unit' => 'counts',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '0',\n 'rangeMaximum' => '10000', //depends on exposure time\n 'rangeStep' => '1',\n 'updateFrequency' => 'batched'), //check this\n array(\n 'name' => 'distance',\n 'unit' => 'mm',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '15',\n 'rangeMaximum' => '95', //depends on exposure time\n 'rangeStep' => '5',\n 'updateFrequency' => 'batched'),\n array(\n 'name' => 'absorberName',\n 'unit' => 'absorber',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '15',\n 'rangeMaximum' => '95', //depends on exposure time\n 'rangeStep' => '5',\n 'updateFrequency' => 'batched')\n ),\n 'configuration' => array(\n 'parameter' => \"experiment_id\",\n 'description' => 'If provided will return the results of a specific experiment, if not provided returns the last experiment results'\n )\n ),\n array(\n 'sensor_id' => 'status',\n 'fullName' => 'Experiment execution status',\n 'description' => 'returns the status of an experiment',\n 'webSocketType' => \"text\",\n 'produces' => 'application/json',\n 'values' => array(\n array(\n 'name' => 'experiment_id',\n 'unit' => '',\n 'lastMeasured' => '2014-06-23T18:25:43.511Z', //not static, get this information from latest batch\n 'rangeMinimum' => '0',\n 'rangeMaximum' => '10000',\n 'rangeStep' => '1',\n 'updateFrequency' => 1) //check this\n )\n ),\n array(\n 'sensor_id' => 'camera',\n 'fullName' => 'Webcam_1',\n 'description' => 'Webcam that shows the Geiger-Mueller counter',\n 'webSocketType' => \"binary\",\n 'produces' => 'jpg',)\n\n )\n\n );\n\n $response = json_encode($jsonResponse);\n $from->send($response);\n}", "protected function buildValue($values)\n {\n $valueData = [];\n foreach ($values as $value) {\n $valueData[] = [\n '@value' => $value['amount'],\n '@attributes' => [\n 'currency' => $value['currency'],\n 'value-date' => $value['value_date']\n ]\n ];\n }\n\n return $valueData;\n }", "function _format_get($data)\n \t{\n\t \t$data = parent::_format_get($data);\n \t\n\t\t$data['CMS_BucketsLabels'] = (! empty($data['CMS_BucketsLabels'])) ? json_decode($data['CMS_BucketsLabels'], TRUE) : array();\n\t\t$data['CMS_BucketsLookUps'] = (! empty($data['CMS_BucketsLookUps'])) ? json_decode($data['CMS_BucketsLookUps'], TRUE) : array();\n\t\t$data['CMS_BucketsFields'] = (! empty($data['CMS_BucketsFields'])) ? json_decode($data['CMS_BucketsFields'], TRUE) : array();\n\t\t$data['CMS_BucketsDisplay'] = (! empty($data['CMS_BucketsDisplay'])) ? json_decode($data['CMS_BucketsDisplay'], TRUE) : array();\n\t\t$data['CMS_BucketsListview'] = (! empty($data['CMS_BucketsListview'])) ? json_decode($data['CMS_BucketsListview'], TRUE) : array();\n \t\treturn $data;\n \t}", "abstract protected function getAdditionalJsonData(): array;", "public function js_value()\n {\n }", "public function _format_value($value)\n\t\t{\n\n\t\t\t$data = array();\n\n\t\t\tif ( is_array( $value ) && count( $value ) > 0 ) {\n\t\t\t\tforeach ( $value as $k => $v ) {\n\t\t\t\t\t$data[] = json_decode( $v, true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $data;\n\n\t\t}", "function exportValue()\n\t{\n\t\t$values = parent::getValue();\n\t\t$y = $values['Y'][0];\n\t\t$m = $values['F'][0];\n\t\t$d = $values['d'][0];\n\t\t$m = $m < 10 ? '0'.$m : $m;\n\t\t$d = $d < 10 ? '0'.$d : $d;\n\t\t$datetime = $y.'-'.$m.'-'.$d;\n\t\t$result[$this->getName()]= $datetime;\n\t\treturn $result;\n\t}", "function feed_formatter_web_format_feed_item_field($variables) {\r\n $feed_item = $variables['#feed_item'];\r\n $feed_item_field = $variables['#feed_item_field'];\r\n \r\n $content = array();\r\n $content['#title'] = $feed_item_field->name;\r\n $content['feed_item_field_values'] = $variables['#content'];\r\n \r\n return $content;\r\n}", "protected function _updateVarsItem($arr)\n\t{\n\t\t$varsPrintItem = $this->_getVarsPrintItem();\n\t\t$varsPrintItemBS = $this->_getVarsPrintItemBS();\n\n\t\t$vars = &$arr['vars'];\n\t\t$varsFlagFiscalPeriod = array();\n\t\t$varsFlagUnit = array();\n\t\t$varsFlagFS = array();\n\n\t\t$array = &$vars['portal']['varsNavi']['templateDetail'];\n\t\tforeach ($array as $key => $value) {\n\t\t\tif ($value['id'] == 'FlagFiscalPeriod') {\n\t\t\t\t$arrStrTitle = array();\n\t\t\t\t$arrayOption = $value['arrayOption'];\n\t\t\t\tforeach ($arrayOption as $keyOption => $valueOption) {\n\t\t\t\t\t$arrStrTitle[$valueOption['value']]['strTitle'] = $valueOption['strTitle'];\n\t\t\t\t}\n\t\t\t\t$varsFlagFiscalPeriod['arrStrTitle'] = $arrStrTitle;\n\n\t\t\t} elseif ($value['id'] == 'FlagUnit') {\n\t\t\t\t$arrStrTitle = array();\n\t\t\t\t$arrayOption = $value['arrayOption'];\n\t\t\t\tforeach ($arrayOption as $keyOption => $valueOption) {\n\t\t\t\t\t$arrStrTitle[$valueOption['value']]['strTitle'] = $valueOption['strTitle'];\n\t\t\t\t}\n\t\t\t\t$varsFlagUnit['arrStrTitle'] = $arrStrTitle;\n\n\t\t\t} elseif ($value['id'] == 'FlagFS') {\n\t\t\t\t$arrStrTitle = array();\n\t\t\t\t$arrayOption = $value['arrayOption'];\n\t\t\t\tforeach ($arrayOption as $keyOption => $valueOption) {\n\t\t\t\t\t$arrStrTitle[$valueOption['value']]['strTitle'] = $valueOption['strTitle'];\n\t\t\t\t}\n\t\t\t\t$varsFlagFS['arrStrTitle'] = $arrStrTitle;\n\t\t\t}\n\t\t}\n\n\t\t$arr['varsItem']['varsPrintItem'] = $varsPrintItem;\n\t\t$arr['varsItem']['varsPrintItemBS'] = $varsPrintItemBS;\n\t\t$arr['varsItem']['varsFlagFS'] = $varsFlagFS;\n\t\t$arr['varsItem']['varsFlagFiscalPeriod'] = $varsFlagFiscalPeriod;\n\t\t$arr['varsItem']['varsFlagUnit'] = $varsFlagUnit;\n\n\t\treturn $arr['varsItem'];\n\t}", "function acf_json_encode($json)\n{\n}", "public static function getResponse1013() {\n\n return '{\"indicator\":{\"name\":\"Término de facturación de energía activa del PVPC peaje por defecto\",\"short_name\":\"PVPC T. Defecto\",\"id\":1013,\"composited\":false,\"step_type\":\"linear\",\"disaggregated\":false,\"magnitud\":[{\"name\":\"Precio\",\"id\":23}],\"tiempo\":[{\"name\":\"Hora\",\"id\":4}],\"geos\":[{\"geo_id\":3,\"geo_name\":\"España\"}],\"values_updated_at\":\"2017-03-01T21:01:30.000+01:00\",\"values\":[{\"value\":116.62,\"datetime\":\"2017-03-01T00:00:00.000+01:00\",\"datetime_utc\":\"2017-02-28T23:00:00Z\",\"tz_time\":\"2017-02-28T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.32,\"datetime\":\"2017-03-01T01:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T00:00:00Z\",\"tz_time\":\"2017-03-01T00:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.17,\"datetime\":\"2017-03-01T02:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T01:00:00Z\",\"tz_time\":\"2017-03-01T01:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.71,\"datetime\":\"2017-03-01T03:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T02:00:00Z\",\"tz_time\":\"2017-03-01T02:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.73,\"datetime\":\"2017-03-01T04:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T03:00:00Z\",\"tz_time\":\"2017-03-01T03:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.94,\"datetime\":\"2017-03-01T05:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T04:00:00Z\",\"tz_time\":\"2017-03-01T04:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.5,\"datetime\":\"2017-03-01T06:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T05:00:00Z\",\"tz_time\":\"2017-03-01T05:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.41,\"datetime\":\"2017-03-01T07:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T06:00:00Z\",\"tz_time\":\"2017-03-01T06:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.35,\"datetime\":\"2017-03-01T08:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T07:00:00Z\",\"tz_time\":\"2017-03-01T07:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.0,\"datetime\":\"2017-03-01T09:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T08:00:00Z\",\"tz_time\":\"2017-03-01T08:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":118.97,\"datetime\":\"2017-03-01T10:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T09:00:00Z\",\"tz_time\":\"2017-03-01T09:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":117.2,\"datetime\":\"2017-03-01T11:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T10:00:00Z\",\"tz_time\":\"2017-03-01T10:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.84,\"datetime\":\"2017-03-01T12:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T11:00:00Z\",\"tz_time\":\"2017-03-01T11:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":114.1,\"datetime\":\"2017-03-01T13:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T12:00:00Z\",\"tz_time\":\"2017-03-01T12:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.76,\"datetime\":\"2017-03-01T14:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T13:00:00Z\",\"tz_time\":\"2017-03-01T13:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":111.74,\"datetime\":\"2017-03-01T15:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T14:00:00Z\",\"tz_time\":\"2017-03-01T14:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.47,\"datetime\":\"2017-03-01T16:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T15:00:00Z\",\"tz_time\":\"2017-03-01T15:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.25,\"datetime\":\"2017-03-01T17:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T16:00:00Z\",\"tz_time\":\"2017-03-01T16:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":116.76,\"datetime\":\"2017-03-01T18:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T17:00:00Z\",\"tz_time\":\"2017-03-01T17:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.51,\"datetime\":\"2017-03-01T19:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T18:00:00Z\",\"tz_time\":\"2017-03-01T18:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.13,\"datetime\":\"2017-03-01T20:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T19:00:00Z\",\"tz_time\":\"2017-03-01T19:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.15,\"datetime\":\"2017-03-01T21:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T20:00:00Z\",\"tz_time\":\"2017-03-01T20:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.9,\"datetime\":\"2017-03-01T22:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T21:00:00Z\",\"tz_time\":\"2017-03-01T21:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.44,\"datetime\":\"2017-03-01T23:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T22:00:00Z\",\"tz_time\":\"2017-03-01T22:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.3,\"datetime\":\"2017-03-02T00:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T23:00:00Z\",\"tz_time\":\"2017-03-01T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"}]}}';\n }", "public function jsonSerialize(): array\n {\n return array_merge([\n 'value' => $this->resolveTransformedValue($this->value),\n 'previous' => $this->resolveTransformedValue($this->previous),\n 'percent_changed' => $percentChanged = $this->percentChanged(),\n 'positive_change' => $percentChanged >= 0,\n // 'previousLabel' => $this->previousLabel,\n 'prefix' => $this->prefix,\n 'suffix' => $this->suffix,\n // 'suffixInflection' => $this->suffixInflection,\n // 'format' => $this->format,\n 'zero_result' => $this->zeroResult,\n ], parent::jsonSerialize());\n }", "function to_json_array($stg){\n $result = str_replace(\"[\",\"\",$stg);\n $result = str_replace(\"]\",\"\",$result);\n $details_array = json_decode($result, true);\n return $details_array;\n}", "public function toJson(){\r\n return json_encode($this->vars,JSON_FORCE_OBJECT);\r\n }", "private function mapPropsToValues(): array\r\n {\r\n $values = [];\r\n $values['customer_id'] = $this->customer_id;\r\n $values['document_set_id'] = $this->document_set_id;\r\n $values['our_reference'] = $this->our_reference;\r\n $values['your_reference'] = $this->your_reference;\r\n $values['date'] = $this->date;\r\n $values['expiration_date'] = $this->expiration_date;\r\n $values['financial_discount'] = $this->financial_discount;\r\n $values['special_discount'] = $this->special_discount;\r\n $values['salesman_id'] = $this->salesman_id;\r\n $values['salesman_commission'] = $this->salesman_commission;\r\n\r\n $values['notes'] = $this->notes;\r\n $values['status'] = DocumentStatus::DRAFT;\r\n $values['eac_id'] = $this->caeId;\r\n $values['products'] = $this->products;\r\n\r\n if ($this->shouldAddShippingInformation()) {\r\n $values['delivery_datetime'] = $this->delivery_datetime;\r\n $values['delivery_method_id'] = $this->delivery_method_id;\r\n\r\n $values['delivery_departure_address'] = $this->delivery_departure_address;\r\n $values['delivery_departure_city'] = $this->delivery_departure_city;\r\n $values['delivery_departure_zip_code'] = $this->delivery_departure_zip_code;\r\n $values['delivery_departure_country'] = $this->delivery_departure_country;\r\n\r\n $values['delivery_destination_address'] = $this->delivery_destination_address;\r\n $values['delivery_destination_city'] = $this->delivery_destination_city;\r\n $values['delivery_destination_zip_code'] = $this->delivery_destination_zip_code;\r\n $values['delivery_destination_country'] = $this->delivery_destination_country;\r\n }\r\n\r\n if ($this->shouldAddPayment()) {\r\n $values['payments'] = $this->payments;\r\n }\r\n\r\n if (!empty($this->exchange_currency_id)) {\r\n $values['exchange_currency_id'] = $this->exchange_currency_id;\r\n $values['exchange_rate'] = $this->exchange_rate;\r\n }\r\n\r\n if (!empty($this->associatedDocuments)) {\r\n $this->associateDocuments($values);\r\n }\r\n\r\n return $values;\r\n }", "public function jsonSerialize() : array {\n\t\t$fields = get_object_vars($this);\n\n\t\t$fields[\"reportId\"] = $this->reportId->toString();\n\t\t$fields[\"reportUserId\"] = $this->reportUserId->toString();\n\t\t$fields[\"reportAbuserId\"] = $this->reportAbuserId->toString();\n\n\t\t//format the date so that the front end can consume it\n\t\t$fields[\"reportDate\"] = round(floatval($this->reportDate->format(\"U.u\")) * 1000);\n\t\treturn($fields);\n\t}", "function settingJsonResponse($index, $items) {\r\n\r\n\t\t$data[$index]['id'] = (isset($items->ID))?$items->ID:'';\r\n\t\t$data[$index]['name'] = (isset($items->name))?$items->name:'';\r\n\t\t$data[$index]['description'] = (isset($items->description))?$items->description:'';\r\n\t\t$data[$index]['price']['currency'] = (isset($items->price->currency))?$items->price->currency:'';\r\n\t\t$data[$index]['price']['amount'] = (isset($items->price->amount))?$items->price->amount:'';\r\n\t\t$data[$index]['url'] = (isset($items->URL))?$items->URL:'';\r\n\t\t$data[$index]['image_url'] = (isset($items->images))?$items->images[0]:'';\r\n\r\n\t\t$data[$index]['categories'] = array();\r\n\t\tif (isset($items->categories) ){\r\n\t\t\tforeach ($items->categories as $category) {\r\n\t\t\t\t$data[$index]['categories'][] = $category;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\r\n\t}", "public function &jsonData($_property);", "private function asJson($value)\n {\n return json_encode($value);\n }", "public static function jsonSpin() \n\t{\n\t\t$ret = self::getItem();\n\t\treturn self::jsonItem($ret);\n\t}" ]
[ "0.57870203", "0.5140693", "0.507549", "0.5062561", "0.50331855", "0.50085455", "0.49860156", "0.49801853", "0.49755538", "0.49663216", "0.4964003", "0.49425438", "0.49288684", "0.49155468", "0.4912527", "0.4905275", "0.49020144", "0.48785168", "0.48782519", "0.48705506", "0.48672858", "0.48646075", "0.485389", "0.48246282", "0.48233977", "0.4818475", "0.47987252", "0.47789127", "0.47768402", "0.47705892" ]
0.6449672
0
$this>_setDelete(array( 'arrId' => array(), ));
protected function _setDelete($arr) { global $classDb; $dbh = $classDb->getHandle(); global $classCheck; global $varsAccount; global $varsPluginAccountingAccount; global $varsPluginAccountingEntity; if (!$this->_checkCurrent()) { $this->_setSearchDetail(array( 'flagIframe' => 0, )); } $flag = $this->_checkAccess(array( 'flagAllUse' => 0, 'flagAuthority' => 'delete', 'idTarget' => $this->_extSelf['idPreference'], )); if (!$flag) { $this->_setSearchDetail(array( 'flagIframe' => 0, )); } $array = $arr['arrId']; $flag = $classCheck->checkValueFormat(array( 'flagType' => 'num', 'flagArr' => 1, 'value' => $array, )); if ($flag) { $this->_setSearchDetail(array( 'flagIframe' => 0, )); } $varsAuthority = $this->_getVarsAuthority(array()); $flagCurrentFlagNow = $this->_getCurrentFlagNow(array()); $tm = TIMESTAMP; $stampRemove = $tm; $flagRemove = 1; try { $dbh->beginTransaction(); foreach ($array as $key => $value) { $varsLog = $this->_getLogFile(array( 'idTarget' => $value, 'numFiscalPeriod' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'], )); if (!(($varsLog['idAccount'] == $varsAccount['id'] && $varsAuthority['flagMyDelete']) || $varsAuthority['flagAllDelete'] || $varsAuthority == 'admin' )) { continue; } $arrColumn = array('stampRemove', 'flagRemove'); $arrValue = array($stampRemove, $flagRemove); $classDb->updateRow(array( 'idModule' => 'accounting', 'strTable' => 'accountingLogFile', 'arrColumn' => $arrColumn, 'flagAnd' => 1, 'arrWhere' => array( array( 'flagType' => 'num', 'strColumn' => 'idEntity', 'flagCondition' => 'eq', 'value' => $varsPluginAccountingAccount['idEntityCurrent'], ), array( 'flagType' => 'num', 'strColumn' => 'numFiscalPeriod', 'flagCondition' => 'eq', 'value' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'], ), array( 'flagType' => 'num', 'strColumn' => 'idLogFile', 'flagCondition' => 'eq', 'value' => $value, ), ), 'arrValue' => $arrValue, )); if (preg_match("/^(tempPrev)$/", $flagCurrentFlagNow)) { $idEntity = $varsPluginAccountingAccount['idEntityCurrent']; $numFiscalPeriodTemp = $varsPluginAccountingEntity[$idEntity]['numFiscalPeriod']; $classDb->deleteRow(array( 'idModule' => 'accounting', 'strTable' => 'accountingLogFile', 'flagAnd' => 1, 'arrWhere' => array( array( 'flagType' => 'num', 'strColumn' => 'idEntity', 'flagCondition' => 'eq', 'value' => $varsPluginAccountingAccount['idEntityCurrent'], ), array( 'flagType' => 'num', 'strColumn' => 'numFiscalPeriod', 'flagCondition' => 'eq', 'value' => $numFiscalPeriodTemp, ), array( 'flagType' => 'num', 'strColumn' => 'idLogFile', 'flagCondition' => 'eq', 'value' => $value, ), ), )); } } $this->_updateDbPreferenceStamp(array('strColumn' => 'logFile')); $dbh->commit(); } catch (PDOException $e) { $dbh->rollBack(); if (FLAG_TEST) { var_dump($e->getMessage()); } exit; } $this->_setSearch(array('flag' => 1, 'flagIframe' => 0,)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete(){\r\n $id=$_POST['del_row'];\r\n $id=implode(',',$id);\r\n $this->Events_Model->delete($this->table,$id);\r\n}", "public function delete() \n {\n $model = $this->model;\n $input = Input::all(); \n \n $arrayIdDelete = $input[$model::getPrimaryKey()];\n \n $result = array();\n foreach ($arrayIdDelete as $id) {\n $singleResult = $this->deleteSingleObject($id);\n $result[] = $singleResult;\n }\n \n return $jsend = JSend\\JSendResponse::success($result);\n }", "public function delete( $id ){\n \n\n }", "public function delete( $id ){\n\n }", "function ivtSupprimer($table,$id_array){\n\t\t$primary_key_name = null;\n\t\t$col_data = $this->db->query(\"SHOW COLUMNS FROM \".$table);\n\n\t\tif ($col_data->num_rows()>0) {\n\t\t\tforeach ($col_data->result() as $col) {\n\t\t\t\tif ($col->Key!='') {\n\t\t\t\t\t$primary_key_name = $col->Field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!is_array($id_array)) {\n\t\t\tif ($this->db->delete($table,array($primary_key_name=>$id_array))) {\n\t\t\t\treturn array(\"success\"=>true,\"data\"=>null);\n\t\t\t}else{\n\t\t\t\treturn array(\"success\"=>false,\"data\"=>null);\n\t\t\t}\n\t\t}else{\n\t\t\tforeach ($id_array as $id) {\n\t\t\t\t$this->db->delete($table,array($primary_key_name=>$id));\n\t\t\t}\n\t\t\treturn array(\"success\"=>true,\"data\"=>null);\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t}", "public function deleteData($sql, $params=[]){\n $this->create($sql,$params);\n\n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n print_r($arrKeys);\n die();\n $dataGaVendor = new cGaVendor();\n $dataGaVendor->deleteMultiple($arrKeys);\n $myDataGrid->message = $dataGaVendor->strMessage;\n}", "protected function setDeleteData()\n\t{\n\n\t}", "public function Do_delete_Example1(){\n\n\t}", "public function delete(){\n }", "public function delete($id) {\r\n \r\n }", "public function delete() {\n\n }", "public function delete()\n {\n\n }", "public function delete(array $ids)\n {\n\n }", "function absenrich_delete(){\r\n\t\t$ids = $_POST['ids']; // Get our array back and translate it :\r\n\t\t$pkid = json_decode(stripslashes($ids));\r\n\t\t$result=$this->m_absensi_enrichment->absenrich_delete($pkid);\r\n\t\techo $result;\r\n\t}", "protected function _delete()\n\t{\n\t}", "function delete($id)\n {\n }", "function alat_delete(){\r\n\t\t$ids = $_POST['ids']; // Get our array back and translate it :\r\n\t\t$pkid = json_decode(stripslashes($ids));\r\n\t\t$result=$this->m_alat->alat_delete($pkid);\r\n\t\techo $result;\r\n\t}", "public function delete($id = null){\n\t\t\n\t}", "public function delete()\n\t{\n\t}", "public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }", "public function DELETE() {\n #\n }", "public function delete($idAttrEam);", "public function delete_data($table, $array='') {\n\t\t$this->db->where($array);\n \t$this->db->delete($table);\n\t\t$this->db->query('ALTER TABLE tbl_'.$table.' AUTO_INCREMENT 1');\n \t//echo $this->db->last_query();\t\n\t}", "public function delete()\r\n\t{\r\n\t}", "public function del()\n {\n }", "public function deleteRow($postArray,$editId,$tableName)\n{\n $retString='';\n \n $retString=$this->deletePreProcessing($postArray,$editId);\n \n $sql=\"delete from $tableName where id=$editId\";\n \n $ret=$this->updateTableData($sql,false);\n \n}", "public function delete()\n {\n //\n }", "public function delete()\n {\n }", "public function delete()\n {\n }" ]
[ "0.66735476", "0.66663104", "0.6618676", "0.6542145", "0.6522986", "0.64785427", "0.64676464", "0.6455282", "0.6441356", "0.6418937", "0.6407675", "0.6396329", "0.6395248", "0.63872117", "0.63611805", "0.636091", "0.6356777", "0.6336735", "0.633555", "0.62716854", "0.6260336", "0.62520367", "0.6248772", "0.62377673", "0.6235535", "0.6234383", "0.6234105", "0.6212418", "0.62055725", "0.62055725" ]
0.74769926
0
Get player by account
public function getPlayer(string $account, bool $withBalance = true): Player;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPlayer();", "public function GetPlayer($username)\n {\n $nono = new db($this->returnType);\n return $nono->Get(\"select * from players where username='$username';\");\n }", "public function getMe()\n {\n return $this->players[$this->myId];\n }", "public function getPlayer()\n {\n return $this->get(self::_PLAYER);\n }", "public function getPlayer()\n {\n return $this->get(self::_PLAYER);\n }", "public function getPlayerByUsername($username)\n {\n foreach ($this->players as $player) {\n if ($player->username == $username) {\n return $player;\n }\n }\n return null;\n }", "public function findByPlayer($name);", "function getPlayer($idplay){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players WHERE id_player=\".escapeString($idplay);\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "function getPlayerObject($login)\n\t{\n\t\tif(isset($this->players[$login])) return $this->players[$login];\n\t\telse if(isset($this->spectators[$login])) return $this->spectators[$login];\n\t\telse return null;\n\t}", "public function getAccount();", "public function getPlayer(string $name) {\r\n\r\n return isset($this->players[$name]) ? $this->players[$name] : null;\r\n\r\n }", "public function getPlayer() {\n return $this->db->getPlayerById($this->playerId);\n }", "public function getPlayerOnTurn() {\n\t\tif ($this['turn']) {\n\t\t\t$playerRepository = new PlayerRepository();\n\t\t\treturn $playerRepository->getOneById($this['turn']);\n\t\t}\n\t\treturn NULL;\n\t}", "public function getPlayer()\n {\n return $this->participation->getPlayer();\n }", "public static function findByUsername($account)\n {\n return static::findOne(['account' => $account, 'status' => self::STATUS_ACTIVE]);\n }", "static function Get($id) {\n $db = new DB();\n\n $data = [\"id\" => $id];\n\n if ($player = $db->fetch(\"SELECT * FROM PlayerTeam WHERE id = :id\", $data, 'Player')) {\n return $player;\n } else\n return false;\n }", "public function getPlayers();", "public function getPlayers();", "public function getPlayer()\n {\n return $this->player;\n }", "public function getPlayer()\n {\n return $this->player;\n }", "public function getPlayer()\n {\n return $this->player;\n }", "public function findByAccount($name);", "public function getPlayer()\n\t{\n\t\treturn $this->player;\n\t}", "public function getAccount($key = null);", "public function getPlayer()\n {\n return $this->hasOne(Player::class, ['id' => 'player_id']);\n }", "public function getPlayer()\n {\n return $this->hasOne(Player::class, ['id' => 'player_id']);\n }", "function findPlayerByName($player) {\n global $db;\n $p = $db->players->findOne(array('name' => $player, '2014.type' => 'batter'));\n if ($p == NULL) {\n echo \"player '$player' not found\";\n die();\n }\n return array($p);\n}", "function get_by_player( $player_id )\n {\n $this->db->join('card_types', 'card_types.type_id=cards.type_id');\n $this->db->where('owner_id', $player_id);\n return $this->db->get($this->table)->result();\n }", "function get_account() {\n\t\t// $pos = $this->add_request( __FUNCTION__ );\n\t\t$pos = $this->add_request( 'getaccount' );\n\t\t$this->send_request();\n\t\t$r = $this->response_part( $pos );\n\t\tif ( isset( $r->account ) && !is_null( $r->account->email ) )\n\t\t\treturn $r->account;\n\t\treturn false;\n\t}", "function getPlayers($player = '')\n {\n $queryString = \"SELECT * FROM `players` \";\n if (!empty($player)) {\n $queryString .= \"WHERE Player='$player'\";\n }\n $result = $this->db->query($queryString);\n\n return $result;\n }" ]
[ "0.7078031", "0.66323304", "0.6574051", "0.6521743", "0.6521743", "0.64439905", "0.6435035", "0.640329", "0.6323766", "0.6296247", "0.61858165", "0.6147653", "0.61404496", "0.6111183", "0.6091138", "0.602993", "0.6009964", "0.6009964", "0.59846777", "0.59846777", "0.59846777", "0.5884134", "0.58815444", "0.5862501", "0.5859899", "0.5859899", "0.5846331", "0.5826808", "0.581636", "0.5790818" ]
0.7278095
0
Get players by batch for accounts
public function getPlayers(array $accounts): Collection;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPlayers();", "public function getPlayers();", "function getAllPlayers(){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by rating DESC\";\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "public function batch_get_results() {\n\t\t$query = new WP_User_Query( $this->args );\n\t\t$total_users = $query->get_total();\n\t\t$this->set_total_num_results( $total_users );\n\t\treturn $query->get_results();\n\t}", "private function batchQueryUsers($batch, array $uids) {\n\n // Creates a list of users in the required format.\n $start = ($batch - 1) * $this->ldapQueryOrLimit;\n $end_plus_1 = min(($batch) * $this->ldapQueryOrLimit, count($uids));\n $batch_uids = array_slice($uids, $start, ($end_plus_1 - $start));\n\n $accounts = $this->entityTypeManager->getStorage('user')->loadMultiple($batch_uids);\n\n $users = [];\n foreach ($accounts as $uid => $user) {\n /** @var \\Drupal\\user\\Entity\\User $user */\n $users[] = $this->ldapQueryEligibleUser(\n $uid,\n $user->get('ldap_user_puid_sid')->value,\n $user->get('ldap_user_puid_property')->value,\n $user->get('ldap_user_puid')->value\n );\n }\n\n return $users;\n }", "private function getUserBatch() {\n\t\t// Include also hidden (disabled) users to the export\n\t\t$hidden_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\n\t\t// Ignore access settings to get all users\n\t\telgg_set_ignore_access(true);\n\n\t\t$users = elgg_get_entities(array(\n\t\t\t'type' => 'user',\n\t\t\t'limit' => $this->limit,\n\t\t\t'offset' => $this->offset,\n\t\t));\n\n\t\t// Set access level to normal\n\t\telgg_set_ignore_access(false);\n\n\t\t// Set hidden status to normal\n\t\taccess_show_hidden_entities($hidden_status);\n\n\t\treturn $users;\n\t}", "public function players()\n {\n $game_ids = $this->match->games->lists('id');\n $map = array_search($this->id, $game_ids);\n if ($map === FALSE || !$this->match->rostersComplete()) return $this->match->players();\n $map = $map + 1;\n $rosters = $this->match->rosters;\n $players = new Illuminate\\Database\\Eloquent\\Collection;\n foreach ($rosters as $roster) {\n $entries = $roster->entries()->where('map', '=', $map);\n if ($entries->count() == 0) continue;\n $players->add($roster->entries()->where('map', '=', $map)->first()->player);\n }\n if ($players->count() == 0) return $this->match->players();\n return $players;\n }", "public function getAllPlayers() {\n $stmt = $this->dbh->prepare(\"SELECT * FROM players WHERE site_id = :site_id\");\n $stmt->bindValue(':site_id', $this->id, PDO::PARAM_INT);\n $stmt->setFetchMode(PDO::FETCH_CLASS, 'Player', [null, $this->register]);\n\n $stmt->execute();\n return $stmt->fetchAll();\n }", "function getPlayers($Field = '', $Where = array(), $multiRecords = FALSE, $PageNo = 1, $PageSize = 15)\n {\n $Params = array();\n if (!empty($Field)) {\n $Params = array_map('trim', explode(',', $Field));\n $Field = '';\n $FieldArray = array(\n 'SeriesGUID' => 'S.SeriesGUID',\n 'TeamGUID' => 'T.TeamGUID',\n 'TeamName' => 'T.TeamName',\n 'TeamNameShort' => 'T.TeamNameShort',\n 'TeamFlag' => 'T.TeamFlag',\n 'PlayerID' => 'P.PlayerID',\n 'PlayerIDLive' => 'P.PlayerIDLive',\n 'PlayerRole' => 'TP.PlayerRole',\n 'IsPlaying' => 'TP.IsPlaying',\n 'TotalPoints' => 'TP.TotalPoints',\n 'PointsData' => 'TP.PointsData',\n 'SeriesID' => 'TP.SeriesID',\n 'MatchID' => 'TP.MatchID',\n 'TeamID' => 'TP.TeamID',\n 'IsAdminUpdate' => 'TP.IsAdminUpdate',\n 'PlayerPic' => 'IF(P.PlayerPic IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/PlayerPic/\",\"player.png\"),CONCAT(\"' . BASE_URL . '\",\"uploads/PlayerPic/\",P.PlayerPic)) PlayerPic',\n 'PlayerCountry' => 'P.PlayerCountry',\n 'PlayerBattingStyle' => 'P.PlayerBattingStyle',\n 'PlayerBowlingStyle' => 'P.PlayerBowlingStyle',\n 'PlayerBattingStats' => 'P.PlayerBattingStats',\n 'PlayerBowlingStats' => 'P.PlayerBowlingStats',\n 'PlayerSalary' => 'FORMAT(TP.PlayerSalary,1) as PlayerSalary',\n 'PlayerSalaryCredit' => 'FORMAT(TP.PlayerSalary,1) PlayerSalaryCredit',\n 'LastUpdateDiff' => 'IF(P.LastUpdatedOn IS NULL, 0, TIME_TO_SEC(TIMEDIFF(\"' . date('Y-m-d H:i:s') . '\", P.LastUpdatedOn))) LastUpdateDiff',\n 'MatchTypeID' => 'SSM.MatchTypeID',\n 'MatchType' => 'SSM.MatchTypeName MatchType',\n 'PlayerSelectedPercent' => 'TP.SelectionPercent PlayerSelectedPercent',\n 'TotalPointCredits' => '(SELECT IFNULL(SUM(`TotalPoints`),0) FROM `sports_team_players` WHERE `PlayerID` = TP.PlayerID AND `SeriesID` = TP.SeriesID) TotalPointCredits',\n 'MyTeamPlayer' => '(SELECT IF( EXISTS(SELECT UTP.PlayerID FROM sports_contest_join JC,sports_users_team_players UTP WHERE JC.UserTeamID = UTP.UserTeamID AND JC.MatchID = ' . $Where['MatchID'] . ' AND JC.UserID = ' . (!empty($Where['SessionUserID']) ? $Where['SessionUserID'] : $Where['UserID']) . ' AND UTP.PlayerID = P.PlayerID LIMIT 1), \"Yes\", \"No\")) MyPlayer'\n );\n if ($Params) {\n foreach ($Params as $Param) {\n $Field .= (!empty($FieldArray[$Param]) ? ',' . $FieldArray[$Param] : '');\n }\n }\n }\n $this->db->select('P.PlayerGUID,P.PlayerName');\n if (!empty($Field))\n $this->db->select($Field, FALSE);\n $this->db->from('sports_players P');\n if (array_keys_exist($Params, array('TeamGUID', 'TeamName', 'TeamNameShort', 'TeamFlag', 'PlayerRole', 'IsPlaying', 'TotalPoints', 'PointsData', 'SeriesID', 'MatchID','PlayerSelectedPercent'))) {\n $this->db->from('sports_teams T,sports_matches M, sports_team_players TP,sports_set_match_types SSM');\n $this->db->where(\"P.PlayerID\", \"TP.PlayerID\", FALSE);\n $this->db->where(\"TP.TeamID\", \"T.TeamID\", FALSE);\n $this->db->where(\"TP.MatchID\", \"M.MatchID\", FALSE);\n $this->db->where(\"M.MatchTypeID\", \"SSM.MatchTypeID\", FALSE);\n }\n if (array_keys_exist($Params, array('SeriesGUID'))) {\n $this->db->from('sports_series S');\n $this->db->where(\"S.SeriesID\", \"TP.SeriesID\", FALSE);\n }\n if (!empty($Where['Keyword'])) {\n $Where['Keyword'] = trim($Where['Keyword']);\n $this->db->group_start();\n $this->db->like(\"P.PlayerName\", $Where['Keyword']);\n $this->db->or_like(\"TP.PlayerRole\", $Where['Keyword']);\n $this->db->or_like(\"P.PlayerCountry\", $Where['Keyword']);\n $this->db->or_like(\"P.PlayerBattingStyle\", $Where['Keyword']);\n $this->db->or_like(\"P.PlayerBowlingStyle\", $Where['Keyword']);\n $this->db->group_end();\n }\n if (!empty($Where['MatchID'])) {\n $this->db->where(\"TP.MatchID\", $Where['MatchID']);\n }\n if (!empty($Where['SeriesID'])) {\n $this->db->where(\"TP.SeriesID\", $Where['SeriesID']);\n }\n if (!empty($Where['PlayerGUID'])) {\n $this->db->where(\"P.PlayerGUID\", $Where['PlayerGUID']);\n }\n if (!empty($Where['TeamID'])) {\n $this->db->where(\"TP.TeamID\", $Where['TeamID']);\n }\n if (!empty($Where['IsPlaying'])) {\n $this->db->where(\"TP.IsPlaying\", $Where['IsPlaying']);\n }\n if (!empty($Where['PlayerID'])) {\n $this->db->where(\"P.PlayerID\", $Where['PlayerID']);\n }\n if (!empty($Where['PlayerRole'])) {\n $this->db->where(\"TP.PlayerRole\", $Where['PlayerRole']);\n }\n if (!empty($Where['IsAdminUpdate'])) {\n $this->db->where(\"TP.IsAdminUpdate\", $Where['IsAdminUpdate']); // Salary (Match Wise)\n }\n if (!empty($Where['CronFilter']) && $Where['CronFilter'] == 'OneDayDiff') {\n $this->db->having(\"LastUpdateDiff\", 0);\n $this->db->or_having(\"LastUpdateDiff >=\", 86400); // 1 Day\n }\n if (!empty($Where['PlayerSalary']) && $Where['PlayerSalary'] == 'Yes') {\n // $this->db->where(\"TP.PlayerSalary >\", 0);\n }\n\n /* Order By */\n if (!empty($Where['RandData'])) {\n $this->db->order_by($Where['RandData']);\n } else if (!empty($Where['OrderBy']) && !empty($Where['Sequence'])) {\n $this->db->order_by($Where['OrderBy'], $Where['Sequence']);\n } else {\n $this->db->order_by('P.PlayerName', 'ASC');\n }\n\n /* Total records count only if want to get multiple records */\n if ($multiRecords) {\n $TempOBJ = clone $this->db;\n $TempQ = $TempOBJ->get();\n $Return['Data']['TotalRecords'] = $TempQ->num_rows();\n if ($PageNo != 0) {\n $this->db->limit($PageSize, paginationOffset($PageNo, $PageSize)); /* for pagination */\n }\n } else {\n $this->db->limit(1);\n }\n\n $Query = $this->db->get();\n if ($Query->num_rows() > 0) {\n $MatchStatus = 0;\n if (!empty($Where['MatchID'])) {\n /* Get Match Status */\n $MatchQuery = $this->db->query('SELECT E.StatusID FROM `sports_matches` `M`,`tbl_entity` `E` WHERE M.`MatchID` = \"' . $Where['MatchID'] . '\" AND M.MatchID = E.EntityID LIMIT 1');\n $MatchStatus = ($MatchQuery->num_rows() > 0) ? $MatchQuery->row()->StatusID : 0;\n }\n if (in_array('TopPlayer', $Params)) {\n $BestPlayers = $this->getMatchBestPlayers(array('MatchID' => $Where['MatchID'],'UserID' => (!empty($Where['SessionUserID'])) ? $Where['SessionUserID'] : $Where['UserID']));\n if (!empty($BestPlayers)) {\n $BestXIPlayers = array_column($BestPlayers['Data']['Records'], 'PlayerGUID');\n }\n }\n if ($multiRecords) {\n $Records = array();\n foreach ($Query->result_array() as $key => $Record) {\n $Records[] = $Record;\n if (in_array('TopPlayer', $Params)) {\n $Records[$key]['TopPlayer'] = (in_array($Record['PlayerGUID'], $BestXIPlayers)) ? 'Yes' : 'No';\n }\n if (in_array('PlayerBattingStats', $Params)) {\n $Records[$key]['PlayerBattingStats'] = (!empty($Record['PlayerBattingStats'])) ? json_decode($Record['PlayerBattingStats']) : new stdClass();\n }\n if (in_array('PlayerBowlingStats', $Params)) {\n $Records[$key]['PlayerBowlingStats'] = (!empty($Record['PlayerBowlingStats'])) ? json_decode($Record['PlayerBowlingStats']) : new stdClass();\n }\n if (in_array('PointsData', $Params)) {\n $Records[$key]['PointsData'] = (!empty($Record['PointsData'])) ? json_decode($Record['PointsData'], TRUE) : array();\n }\n if (in_array('PointCredits', $Params)) {\n $Records[$key]['PointCredits'] = (in_array($MatchStatus, array(2, 5, 10))) ? @$Record['TotalPoints'] : @$Record['TotalPointCredits'];\n }\n }\n\n /* Custom Sorting */\n if (!empty($Where['CustomOrderBy']) && !empty($Where['Sequence'])) {\n $SortArr = array();\n foreach ($Records as $Value) {\n $SortArr[] = $Value[$Where['CustomOrderBy']]; // In Object\n }\n if ($Where['Sequence'] == 'ASC') {\n array_multisort($SortArr, SORT_ASC, $Records);\n } else {\n array_multisort($SortArr, SORT_DESC, $Records);\n }\n }\n $Return['Data']['Records'] = $Records;\n return $Return;\n } else {\n $Record = $Query->row_array();\n if (in_array('TopPlayer', $Params)) {\n $Record['TopPlayer'] = (in_array($Record['PlayerGUID'], $BestXIPlayers)) ? 'Yes' : 'No';\n }\n if (in_array('PlayerBattingStats', $Params)) {\n $Record['PlayerBattingStats'] = (!empty($Record['PlayerBattingStats'])) ? json_decode($Record['PlayerBattingStats']) : new stdClass();\n }\n if (in_array('PlayerBowlingStats', $Params)) {\n $Record['PlayerBowlingStats'] = (!empty($Record['PlayerBowlingStats'])) ? json_decode($Record['PlayerBowlingStats']) : new stdClass();\n }\n if (in_array('PointsData', $Params)) {\n $Record['PointsData'] = (!empty($Record['PointsData'])) ? json_decode($Record['PointsData'], TRUE) : array();\n }\n if (in_array('PointCredits', $Params)) {\n $Record['PointCredits'] = (in_array($MatchStatus, array(2, 5, 10))) ? @$Record['TotalPoints'] : @$Record['TotalPointCredits'];\n }\n return $Record;\n }\n }\n return FALSE;\n }", "public function getPlayers(): array;", "protected function getPlayers($cash)\n\t{\n\t\t$w = $this->getPlayersCriterias($cash);\n\n\t\t// retrieve players\n\t\t$result = \\Kofradia\\DB::get()->prepare(\"\n\t\t\tSELECT up_id, up_cash, up_energy, up_points\n\t\t\tFROM users_players\n\t\t\tWHERE {$w[0]}\n\t\t\tORDER BY up_last_online DESC\n\t\t\tLIMIT 100\");\n\t\t$result->execute($w[1]);\n\t\t$players = array();\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\t$players[] = $row;\n\t\t}\n\n\t\treturn $players;\n\t}", "public static function getAllPlayers() {\n CommonDao::connectToDb();\n $query = \"select p.*\n from player p\n order by p.last_name, p.first_name\";\n return PlayerDao::createPlayersFromQuery($query);\n }", "public function GetAllPlayers()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllPlayers();\n }", "public function get_players(){\n\t\t$players = $this->players;\n\t\t$classes_arr = array(\n\t\t\t'Sportorg_Games_Matchplayer' => 'sportorg_games_matchplayer',\n\t\t);\n\t\t$players = ORM::_sql_exclude_deleted($classes_arr, $players);\n\t\t$playerArr = null;\n\t\tforeach($players->find_all() as $player){\n\t\t\t$playerArr[] = $player->getBasics();\n\t\t}\n\n\t\treturn $playerArr;\n\t}", "public function getList($players = NULL){\n\t\tif(!is_null($players)){\n\t\t\tif(is_array($players)){\n\t\t\t\t$players = implode(\",\", $players);\n\t\t\t}\n\t\t\t$url = $this->_api_url.$this->platform;\n\t\t\t$request_string = \"request=getlist&players=\".$players;\n\t\t\t$data = ($this->_webRequest)? webRequest($url,$request_string) : alternativeRequest($url,\"?\".$request_string);\n\t\t\tif(!is_null($data) && $data !== false && count($data->players) > 0){\n\t\t\t\treturn $data;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function get_all_tournament_players()\n {\n $this->db->select('tournament_players_id,team_name,player_name,employee_id,company');\n $this->db->join('tournament_teams as TT', 'TT.tournament_team_id = TP.tournament_team_id');\n $this->db->join('tournaments as T', 'T.tournament_id = TT.tournament_id AND T.is_active = \"T\"');\n $this->db->join('players as P' , 'TP.player_id = P.player_id ');\n $this->db->join('teams as T1' , 'TT.team_id = T1.team_id');\n \n return $this->db->get_where('tournament_players as TP',array('TP.is_deleted'=>0))->result_array();\n }", "public static function get_players($team)\r\n {\r\n $result = db::sql(\"SELECT player_id, first_name, last_name FROM `superrugby_2016_scores_18` WHERE Team = '$team' ORDER BY first_name;\", DB_NAME);\r\n $player_reference = null;\r\n if (mysqli_num_rows($result)){\r\n while(list($player_id, $firstname, $lastname) = mysqli_fetch_array($result)){\r\n $player_reference[] = array('id'=>$player_id, 'firstname'=>$firstname, 'lastname'=>$lastname);\r\n }\r\n }\r\n return $player_reference;\r\n }", "function getAllPlayers()\r\n{\r\n global $db, $selectSQL, $selectSQL2;\r\n\r\n unset($GLOBALS['players']);\r\n $GLOBALS['players'] = array();\r\n $res = $db->query(\"select * from player order by firstname asc\");\r\n\r\n while($row = $db->getRows($res))\r\n {\r\n $GLOBALS['players'][$row['id']]['id'] = $row['id'];\r\n $GLOBALS['players'][$row['id']]['firstname'] = $row['firstname'];\r\n $GLOBALS['players'][$row['id']]['lastname'] = $row['lastname'];\r\n $GLOBALS['players'][$row['id']]['email'] = $row['email'];\r\n $GLOBALS['players'][$row['id']]['phone'] = $row['phone'];\r\n $inches = $row['height'] % 12;\r\n $GLOBALS['players'][$row['id']]['heightIN'] = $inches;\r\n $GLOBALS['players'][$row['id']]['heightFT'] = ($row['height'] - $inches) / 12;\r\n $GLOBALS['players'][$row['id']]['weight'] = $row['weight'];\r\n $GLOBALS['players'][$row['id']]['positions'] = $row['positions'];\r\n $GLOBALS['players'][$row['id']]['bats'] = $row['bats'];\r\n $GLOBALS['players'][$row['id']]['throws'] = $row['throws'];\r\n \r\n if(!empty($row['birthdate']) && $row['birthdate'] != \"0000-00-00\")\r\n {\r\n list($year, $month, $day) = explode('-', $row['birthdate']);\r\n $birthdate = $month . \"/\" . $day . \"/\" . $year;\r\n $GLOBALS['players'][$row['id']]['birthdate'] = $birthdate;\r\n }\r\n \r\n $GLOBALS['players'][$row['id']]['nickname'] = $row['nickname'];\r\n $GLOBALS['players'][$row['id']]['img'] = $row['img'];\r\n }\r\n}", "public function findByPlayer($name);", "public function listAllPlayers(){\n $sql = \"SELECT * FROM jogador\";\n $result = $this->connection->dataBase->Execute($sql);\n while($record = $result->FetchNextObject()){\n $playerData = new Player();\n $playerData->__constructOverload($record->ID_JOGADOR,\n $record->TIME_ID_TIME,$record->NOME,\n $record->DATA_NASCIMENTO,\n $record->CPF,$record->NUMERO);\n $returnPlayerData[] = $playerData;\n }\n return $returnPlayerData;\n\t}", "public static function getAll() \n\t{\n\n\t\t$sql = 'select * from players';\n\n\t\treturn self::getBySql($sql);\t\t\t\t\n\t}", "function flashcard_get_participants($flashcardid) {\n global $DB;\n\n $sql = \"\n SELECT DISTINCT\n userid,\n userid\n FROM\n {flashcard_card}\n WHERE\n flashcardid = ?\n \";\n $userids = $DB->get_records_sql_menu($sql, array('flashcardid' => $flashcardid));\n if ($userids) {\n $users = $DB->get_records_list('user', 'id', array_keys($userids));\n }\n\n if (!empty($users)) {\n return $users;\n }\n\n return false;\n}", "public function getWinners($game)\n {\n $allPlayers = DB::table('players')->where(['game_id' => $game->id])->orderBy('bid', 'DESC')->get()->toArray();\n\n // -1 cause the array starts at 0\n $winner_1 = $allPlayers[0]->user_id;\n $winner_2 = $allPlayers[$game->win_1 - 1]->user_id;\n $winner_3 = $allPlayers[$game->win_2 - 1]->user_id;\n $winner_4 = $allPlayers[$game->win_3 - 1]->user_id;\n\n\n $winners = array(\n 'winner_1' => $winner_1,\n 'winner_2' => $winner_2,\n 'winner_3' => $winner_3,\n 'winner_4' => $winner_4\n );\n\n return $winners;\n }", "public function GetAllPlayers( )\n {\n $players = array();\n\n /**\n * Query: \n * SELECT * FROM \n * primary_info AS prim\n * INNER JOIN \n * additional_info AS addi\n * ON prim.ID = addi.ID\n */\n $this->db->select('*');\n $this->db->from('primary_info AS prim');\n $this->db->join('additional_info AS addi', 'prim.ID = addi.ID', 'INNER'); \n $query = $this->db->get();\n\n /**\n * If no rows exist -> return empty array\n */\n if (count($query->result()) == 0)\n return $players;\n\n /**\n * Format each result and push to list of results\n */\n foreach($query->result() as $row)\n {\n $player = array(\n \"ID\"=> $row->ID,\n \"Name\"=> $row->Name,\n \"Age\"=> $row->Age,\n \"Location\"=> array(\n \"City\"=> $row->City,\n \"Province\"=> $row->Province,\n \"Country\"=> $row->Country\n )\n );\n array_push($players, $player);\n }\n\n return array(\"Players\" => $players);\n }", "function getMatchBestPlayers($Where = array(), $multiRecords = FALSE, $PageNo = 1, $PageSize = 15)\n {\n /* Get Match Players */\n $PlayersData = $this->Sports_model->getPlayers('PlayerRole,PointsData,PlayerPic,PlayerBattingStyle,PlayerBowlingStyle,MatchType,MatchNo,MatchDateTime,SeriesName,TeamGUID,IsPlaying,PlayerSalary,TeamNameShort,PlayerPosition,TotalPoints,TotalPointCredits,MyTeamPlayer,PlayerSelectedPercent', array('MatchID' => $Where['MatchID'], 'UserID' => (!empty($Where['SessionUserID'])) ? $Where['SessionUserID'] : $Where['UserID'], 'OrderBy' => 'TotalPoints', 'Sequence' => 'DESC', 'IsPlaying' => 'Yes'), TRUE, 0);\n if (!$PlayersData) {\n return false;\n }\n $FinalXIPlayers = array();\n foreach ($PlayersData['Data']['Records'] as $Key => $Value) {\n $Row = $Value;\n $Row['TopPlayer'] = 'Yes';\n $Row['PlayerPosition'] = ($Key == 0) ? 'Captain' : (($Key == 1) ? 'ViceCaptain' : 'Player');\n $Row['TotalPoints'] = strval(($Key == 0) ? 2 * $Row['TotalPoints'] : (($Key == 1) ? 1.5 * $Row['TotalPoints'] : $Row['TotalPoints']));\n array_push($FinalXIPlayers, $Row);\n }\n\n $Batsman = $this->findSubArray($FinalXIPlayers, \"PlayerRole\", \"Batsman\");\n $Bowler = $this->findSubArray($FinalXIPlayers, \"PlayerRole\", \"Bowler\");\n $Wicketkipper = $this->findSubArray($FinalXIPlayers, \"PlayerRole\", \"WicketKeeper\");\n $Allrounder = $this->findSubArray($FinalXIPlayers, \"PlayerRole\", \"AllRounder\");\n\n $TopBatsman = array_slice($Batsman, 0, 4);\n $TopBowler = array_slice($Bowler, 0, 3);\n $TopWicketkipper = array_slice($Wicketkipper, 0, 1);\n $TopAllrounder = array_slice($Allrounder, 0, 3);\n\n $BatsmanSort = $BowlerSort = $WicketKipperSort = $AllRounderSort = array();\n foreach ($TopBatsman as $BatsmanValue) {\n $BatsmanSort[] = $BatsmanValue['TotalPoints'];\n }\n array_multisort($BatsmanSort, SORT_DESC, $TopBatsman);\n\n foreach ($TopBowler as $BowlerValue) {\n $BowlerSort[] = $BowlerValue['TotalPoints'];\n }\n array_multisort($BowlerSort, SORT_DESC, $TopBowler);\n\n foreach ($TopWicketkipper as $WicketKipperValue) {\n $WicketKipperSort[] = $WicketKipperValue['TotalPoints'];\n }\n array_multisort($WicketKipperSort, SORT_DESC, $TopWicketkipper);\n\n foreach ($TopAllrounder as $AllrounderValue) {\n $AllRounderSort[] = $AllrounderValue['TotalPoints'];\n }\n array_multisort($AllRounderSort, SORT_DESC, $TopAllrounder);\n\n $AllPlayers = array();\n $AllPlayers = array_merge($TopBatsman, $TopBowler);\n $AllPlayers = array_merge($AllPlayers, $TopAllrounder);\n $AllPlayers = array_merge($AllPlayers, $TopWicketkipper);\n\n $Records['Data']['Records'] = $AllPlayers;\n $Records['Data']['TotalPoints'] = strval(array_sum(array_column($AllPlayers, 'TotalPoints')));\n $Records['Data']['TotalRecords'] = count($AllPlayers);\n if ($AllPlayers) {\n return $Records;\n } else {\n return FALSE;\n }\n }", "function getPlayersGames($page)\n\t{\n\t\t$uid = $_SESSION[\"uid\"];\n\t\t$games = array();\n\t\t\n\t\t\n\t\t$query = ($page == \"ord\") ? \n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid'\n\t\t\tAND i.uid <>\n\t\t\tALL (\n\t\t\t\tSELECT DISTINCT o.uid\n\t\t\t\tFROM games g1, orders o\n\t\t\t\tWHERE g1.gid = g.gid\n\t\t\t\tAND g.gid = o.gid\n\t\t\t\tAND g.year = o.year\n\t\t\t\tAND g.season = o.season\n\t\t\t\t);\" \n\t\t\t:\n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($games, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "function getPlayers($player = '')\n {\n $queryString = \"SELECT * FROM `players` \";\n if (!empty($player)) {\n $queryString .= \"WHERE Player='$player'\";\n }\n $result = $this->db->query($queryString);\n\n return $result;\n }", "function get_all_batch($params = array())\n {\n $this->db->order_by('batch_id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('batch')->result_array();\n }", "function getNextBatch() {\n global $connection, $user;\n // find the next batch to be worked on\n // TODO: db should be improved to record the last batch the user worked on\n $sql = 'select trub.tr_batch_id from TR_USER_BATCH trub, TR_BATCH trb where trub.tr_batch_id = trb.tr_batch_id and trub.username = ? and trb.completed_date is null order by trub.position desc limit 1';\n if ($statement = $connection->prepare($sql)) {\n $statement->bind_param(\"s\",$_SESSION[\"username\"]);\n $statement->execute();\n $statement->bind_result($batch_id);\n $statement->store_result();\n if ($statement->fetch()) {\n // nothing\n } else {\n $batch_id = 1;\n }\n } else {\n throw new Exception(\"Connection to database failed\");\n }\n\n $batch = new TR_BATCH();\n $batch->setID($batch_id);\n\n return $batch;\n}", "public function getBatch(){\n $Voters = Voter::where('mailing_street_address_1', '=', '')\n ->skip($this->offset)\n ->take($this->batch_size)\n ->get();\n\n $this->offset += $this->batch_size;\n\n return ($Voters->count() > 0)? $Voters: false;\n }" ]
[ "0.58531415", "0.58531415", "0.5839105", "0.5813705", "0.5775294", "0.566228", "0.5617351", "0.5547355", "0.55367893", "0.5472665", "0.5470032", "0.54349357", "0.53928083", "0.538118", "0.5354627", "0.53351074", "0.5332232", "0.5305462", "0.53023624", "0.52744585", "0.5244036", "0.51954556", "0.5194662", "0.51837456", "0.51732224", "0.5159775", "0.5155779", "0.5132533", "0.5130947", "0.5108765" ]
0.6402929
0
/ Angular LIBRARY Js End Here / Angular Bootstrap Js start
private function angularBootstrapJs() { $angularBootJs = ''; $angularBootJs .='<!--Angular Bootstrap Js--> <script src="' . $this->baseUrl("../angularJs/core/ui-bootstrap-tpls.min.js") . '"></script> <script src="' . $this->baseUrl("../angularJs/core/ui-bootstrap.min.js") . '"></script> <script src="' . $this->baseUrl("../angularJs/core/jquery.min.js") . '"></script>'; return $angularBootJs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function angularBootstrapJs() {\n $angularBootJs = '';\n $angularBootJs .='<!--Angular Bootstrap Js-->\n <script src=\"' . $this->baseUrl(\"../angularJs/core/ui-bootstrap-tpls.min.js\") . '\"></script>\n <script src=\"' . $this->baseUrl(\"../angularJs/core/ui-bootstrap.min.js\") . '\"></script>\n ';\n return $angularBootJs;\n }", "private function dashboardAngular() {\n $jsangu = '';\n $jsangu .='<script src=\"' . $this->baseUrl(\"../angularJs/app.js\") . '\"></script>';\n $jsangu .='<script src=\"' . $this->baseUrl(\"../angularJs/scripts/dashboardController.js\") . '\"></script>';\n return $jsangu;\n }", "public function initializeBootstrap() {\n $this->addToHead(\"<link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\\\">\",\n Page::BOTTOM);\n $this->addToHead(\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\\\"></script>\",\n Page::BOTTOM);\n $this->addToHead(\"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\",\n Page::BOTTOM);\n }", "function cfwprapi_enqueue_script() {\n\n wp_enqueue_script( 'angular', plugin_dir_url( __FILE__ ) . 'lib/angular/angular.js', array( 'jquery' ));\n wp_enqueue_script( 'angular-route', plugin_dir_url( __FILE__ ) . 'lib/angular-route/angular-route.js', array( 'angular' ) );\n wp_enqueue_script( 'angular-resource', plugin_dir_url( __FILE__ ) . 'lib/angular-resource/angular-resource.js', array( 'angular' ) );\n wp_enqueue_script( 'bootstrap-script', plugin_dir_url( __FILE__ ) . 'lib/bootstrap/bootstrap.min.js', array( 'angular' ) );\n wp_enqueue_script( 'application-script', plugin_dir_url( __FILE__ ) . 'js/app.js', array( 'angular' ) );\n\n $wnm_custom = array( 'site_url' => site_url() );\n wp_localize_script( 'application-script', 'wnm_custom', $wnm_custom );\n\n wp_register_style( 'bootstrap-style', 'http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' );\n wp_enqueue_style( 'bootstrap-style' );\n}", "private function angular_js() {\n $angularlibrJs = '';\n $angularlibrJs .='<!--Angular LIBRARY Js--->\n <script src=\"' . $this->baseUrl(\"../angularJs/core/angular.js\") . '\"></script>';\n return $angularlibrJs;\n }", "protected function initBootstrap()\n {\n \\Steel\\Bootstrap::init();\n }", "public function common_js() {\r\n\t\t//wp_enqueue_script( 'wpdigi-angularjs', WPDIGI_URL . 'assets/js/angular.js', '', WPDIGI_VERSION, false );\r\n\t}", "public function index() {\n\n //page level css\n $this->template->add_css('plugins/select2/select2.css');\n $this->template->add_css('plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css');\n $this->template->add_css('plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css');\n// $this->template->add_css('plugins/bootstrap-modal/css/bootstrap-modal.css');\n //page level plugin\n $this->template->add_js('plugins/select2/select2.min.js');\n $this->template->add_js('plugins/bootstrap-datepicker/js/bootstrap-datepicker.js');\n $this->template->add_js('plugins/datatables/media/js/jquery.dataTables.min.js');\n $this->template->add_js('plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js');\n $this->template->add_js('plugins/bootstrap-modal/js/bootstrap-modalmanager.js');\n $this->template->add_js('plugins/bootstrap-modal/js/bootstrap-modal.js');\n\n //$this->template->add_js('scripts/designation.js');\n //IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip \n $this->template->add_js('plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js');\n $this->template->add_js('plugins/bootstrap/js/bootstrap.min.js');\n $this->template->add_js('plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js');\n $this->template->add_js('plugins/jquery-slimscroll/jquery.slimscroll.min.js');\n $this->template->add_js('plugins/jquery.blockui.min.js');\n $this->template->add_js('plugins/uniform/jquery.uniform.min.js');\n\n\n // page level script\n $this->template->add_js('scripts/app.js');\n //$this->template->add_js('scripts/form-samples.js');\n $this->template->add_js('scripts/form-components.js');\n $this->template->add_js('scripts/designation/designation.js');\n\n $this->data['js'] = $this->template->js;\n $this->data['css'] = $this->template->css;\n\n\n $this->data['title'] = \"descigntion\";\n $this->data['page_title'] = \"Add Designtion\";\n $this->data['active_tab'] = \"add-designtion\";\n $this->data['page_content'] = \"designation/designation_list\";\n\n $this->data['department_record'] = $this->designation_model->getPosts(); // calling insert model method getPosts()\n //$this->load->view('leave/table', $this->data);\n $this->data['designation'] = $this->designation_model->get_designtion_list();\n\n $this->load->view('template', $this->data);\n }", "protected function _initBootstrap()\n {\n }", "public function boot()\n {\n Nova::script('nova-naviga-ad-preview', __DIR__ . '/../dist/js/tool.js');\n Nova::style('nova-naviga-ad-preview', __DIR__ . '/../dist/css/tool.css');\n }", "public function __construct()\n\t{\n\t //Assets\n\t Asset::add('jquery', 'js/jquery-1.7.2.min.js');\n\t Asset::add('bootstrap-js', 'js/bootstrap.min.js');\n\t Asset::add('bootstrap-css', 'css/bootstrap.min.css');\n\t Asset::add('bootstrap-css-responsive', 'css/bootstrap-responsive.min.css', 'bootstrap-css');\n\t Asset::add('style', 'css/style.css');\n\t parent::__construct();\n\t}", "public function bootstrap()\n {\n add_theme_support('avia_template_builder_custom_css');\n parent::bootstrap();\n }", "function fumseck_register_bootstrap_js() {\n\twp_enqueue_script(\n\t\t'bootstrap_js',\n\t\tget_stylesheet_directory_uri() . '/3rdparty/bootstrap-3.0.3/dist/js/bootstrap.min.js',\n\t\tarray( 'jquery' )\n\t);\n}", "function charger_scripts() {\n \n wp_register_script(\n 'angularjs', \n get_template_directory_uri() . '/node_modules/angular/angular.js'\n );\n wp_register_script(\n 'angularjs-route', \n get_template_directory_uri() . '/node_modules/angular-route/angular-route.js'\n );\n wp_register_script(\n 'angular-aria', \n get_template_directory_uri() . '/node_modules/angular-aria/angular-aria.js'\n ); \n wp_register_script(\n 'angular-material', \n get_template_directory_uri() . '/node_modules/angular-material/angular-material.js'\n );\n wp_register_script(\n 'angular-messages', \n get_template_directory_uri() . '/node_modules/angular-messages/angular-messages.js'\n ); \n wp_register_script(\n 'angular-animate', \n get_template_directory_uri() . '/node_modules/angular-animate/angular-animate.js'\n ); \n wp_register_script(\n 'angular-audio', \n get_template_directory_uri() . '/node_modules/angular-audio/app/angular.audio.js'\n ); \n wp_register_script(\n 'angular-sanitize', \n get_template_directory_uri() . '/node_modules/angular-sanitize/angular-sanitize.js'\n );\n \n wp_enqueue_script(\n 'scripts_wpAng_app', \n get_template_directory_uri() . '/js/app.js',\n array('angularjs', 'angularjs-route', 'angular-aria', 'angular-animate', 'angular-messages', 'angular-material', 'angular-audio', 'angular-sanitize')\n );\n \n wp_enqueue_script(\n 'scripts_wpAng_ctrl', \n get_template_directory_uri() . '/js/ctrl.js',\n array('angularjs', 'angularjs-route', 'angular-aria', 'angular-animate', 'angular-messages', 'angular-material', 'angular-audio', 'angular-sanitize')\n );\n \n wp_localize_script(\n\t\t'scripts_wpAng_app',\n\t\t'wpAngUrl', //nom de la variable qui contient les données\n\t\tarray(\n\t\t\t'vues' => trailingslashit( get_template_directory_uri() ) . 'vues/' \n\t\t\t)\n\t);\n}", "public function getBootstrap();", "public function bootstrap()\n {\n }", "function load_styles_and_scripts() {\n\t\t//wp_register_script( 'owl', get_template_directory_uri() . '/js/vendor/owl-carousel-2/owl.carousel.min.js', array('jquery'), '1.0', false );\n\t\twp_register_script( 'angular', get_template_directory_uri() . '/bower_components/angular/angular.min.js', array( 'jquery' ), '1.4.7', false );\n\t\twp_register_script( 'angular-sanitize', get_template_directory_uri() . '/bower_components/angular-sanitize/angular-sanitize.min.js', array( 'angular' ), '1.4.7', false );\n\t\twp_register_script( 'angular-ui-router', get_template_directory_uri() . '/bower_components/angular-ui-router/release/angular-ui-router.min.js', array( 'angular' ), '0.2.15', false );\n\t\twp_register_script( 'main', get_template_directory_uri() . '/js/main.js', array(\n\t\t\t'jquery',\n\t\t\t'angular',\n\t\t\t'angular-sanitize'\n\t\t), time(), false );\n\t\t//wp_register_script( 'rfstockalike', get_template_directory_uri() . '/js/src/rfstockalike.js', array('angular'), '1.0', false );\n\n\t\t//wp_enqueue_script( 'modernizr' );\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'angular' );\n\t\twp_enqueue_script( 'angular-sanitize' );\n\t\twp_enqueue_script( 'angular-ui-router' );\n\t\t//wp_enqueue_script( 'rfstockalike' );\n\t\t//wp_enqueue_script( 'owl' );\n\t\twp_enqueue_script( 'main' );\n\n\t\t// Set up nonce for Angular-based authentication\n\t\twp_localize_script( 'main', 'RFS', array(\n\t\t\t'root' => esc_url_raw( rest_url() ),\n\t\t\t'nonce' => wp_create_nonce( 'wp_rest' ),\n\t\t\t'partials' => trailingslashit( get_template_directory_uri() ) . 'partials/'\n\t\t) );\n\n\t\twp_enqueue_style( 'owlcss', get_template_directory_uri() . '/js/vendor/owl-carousel-2/assets/owl.carousel.css', false );\n\t\t//wp_enqueue_style('gfont', 'http://fonts.googleapis.com/css?family=Raleway:400,600,700,900', false );\n\t\twp_enqueue_style( 'mainstyle', get_template_directory_uri() . '/style.css', false, '1.0', 'screen' );\n\n\t}", "function bootstrap_files()\n{\n wp_enqueue_style(\"bootstrap\", \"//stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css\");\n wp_enqueue_script(\"bootstrapjs\", \"//stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js\", array('jquery'));\n}", "public function boot()\n {\n Blade::include('admin.component.card.form', 'form');\n Blade::include('admin.component.input','input');\n Blade::include('admin.component.tools','tools');\n Blade::include('admin.component.tables.index','table');\n Blade::include('admin.component.modal','modal');\n Blade::include('admin.component.tables.menu','tableMenu');\n Blade::include('admin.component.tables.users','tableUsers');\n Blade::include('admin.component.tables.carousel','tableCarousel');\n Blade::include('admin.component.tables.guru','tableGuru');\n }", "public function boot()\n {\n #前台\n //header组件\n Blade::component('layout.header','header');\n //footer组件\n Blade::component('layout.footer','footer');\n\n #后台\n //top 组件\n blade::component('home.layout.top','top');\n //left 组件\n blade::component('home.layout.left','left');\n\n }", "protected static function updateBootstrapping()\n {\n copy(__DIR__.'/bootstrap-stubs/app.js', resource_path('assets/js/app.js'));\n\n copy(__DIR__.'/bootstrap-stubs/bootstrap.js', resource_path('assets/js/bootstrap.js'));\n }", "public function bootstrap();", "public function bootstrap();", "protected static function updateBootstrapping()\n {\n copy(__DIR__ . '/angular-stubs/main.ts', resource_path('assets/js/main.ts'));\n copy(__DIR__ . '/angular-stubs/app.module.ts', resource_path('assets/js/app.module.ts'));\n copy(__DIR__ . '/angular-stubs/environment.ts', resource_path('assets/js/environment.ts'));\n copy(__DIR__ . '/angular-stubs/tsconfig.json', resource_path('assets/js/tsconfig.json'));\n }", "public function initialize()\n {\n\n $this->view->setTemplateBefore('cobaprivate');\n // Add some local CSS resources\n $this->assets->addCss(\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\");\n $this->assets->addCss(\"css/font-awesome.min.css\");\n $this->assets->addCss(\"css/animate.min.css\");\n $this->assets->addCss(\"css/prettyPhoto.css\");\n $this->assets->addCss(\"css/main.css\");\n $this->assets->addCss(\"css/responsive.css\");\n\n // And some local JavaScript resources\n $this->assets->addJs(\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\");\n $this->assets->addJs(\"js/jquery.js\");\n $this->assets->addJs(\"js/bootstrap.min.js\");\n $this->assets->addJs(\"js/main.js\");\n $this->assets->addJs(\"js/jquery.prettyPhoto.js\");\n $this->assets->addJs(\"js/jquery.isotope.min.js\");\n $this->assets->addJs(\"js/wow.min.js\");\n }", "function WBootStrap_load_js(){\n\t$JS_Files = array(\n\t\t'prettify' => 'google-code-prettify/prettify.js',\n\t\t'transition' => 'bootstrap-transition.js',\n\t\t'alert' => 'bootstrap-alert.js',\n\t\t'modal' => 'bootstrap-modal.js',\n\t\t'dropdown' => 'bootstrap-dropdown.js',\n\t\t'scrollspy' => 'bootstrap-scrollspy.js',\n\t\t'tab' => 'bootstrap-tab.js',\n\t\t'tooltip' => 'bootstrap-tooltip.js',\n\t\t'popover' => 'bootstrap-popover.js',\n\t\t'button' => 'bootstrap-button.js',\n\t\t'collapse' => 'bootstrap-collapse.js',\n\t\t'carousel' => 'bootstrap-carousel.js',\n\t\t'typeahead' => 'bootstrap-typeahead.js',\n\t);\n\t$JS_Files = apply_filters('WBootStrap_js_enqueue_filter',$JS_Files);\n\tforeach ($JS_Files as $key => $value) {\n\t\twp_enqueue_script($key, get_template_directory_uri().'/assets/js/'.$value, array('jquery'),theme_version, true );\n\t}\n\t\n\t/*\n\t\t//to load manually each script use:\n\twp_enqueue_script('prettify', get_template_directory_uri().'/assets/js/google-code-prettify/prettify.js', array('jquery'),theme_version, true );\n wp_enqueue_script('transition', get_template_directory_uri().'/assets/js/bootstrap-transition.js', array('jquery'),theme_version, true );\n wp_enqueue_script('alert', get_template_directory_uri().'/assets/js/bootstrap-alert.js', array('jquery'),theme_version, true );\n wp_enqueue_script('modal', get_template_directory_uri().'/assets/js/bootstrap-modal.js', array('jquery'),theme_version, true );\n wp_enqueue_script('dropdown', get_template_directory_uri().'/assets/js/bootstrap-dropdown.js', array('jquery'),theme_version, true );\n wp_enqueue_script('scrollspy', get_template_directory_uri().'/assets/js/bootstrap-scrollspy.js', array('jquery'),theme_version, true );\n wp_enqueue_script('tab', get_template_directory_uri().'/assets/js/bootstrap-tab.js', array('jquery'),theme_version, true );\n wp_enqueue_script('tooltip', get_template_directory_uri().'/assets/js/bootstrap-tooltip.js', array('jquery'),theme_version, true );\n wp_enqueue_script('popover', get_template_directory_uri().'/assets/js/bootstrap-popover.js', array('tooltip.js'),theme_version, true );\n wp_enqueue_script('button', get_template_directory_uri().'/assets/js/bootstrap-button.js', array('jquery'),theme_version, true );\n wp_enqueue_script('collapse', get_template_directory_uri().'/assets/js/bootstrap-collapse.js', array('jquery'),theme_version, true ); \n wp_enqueue_script('carousel', get_template_directory_uri().'/assets/js/bootstrap-carousel.js', array('jquery'),theme_version, true ); \n wp_enqueue_script('typeahead', get_template_directory_uri().'/assets/js/bootstrap-typeahead.js', array('jquery'),theme_version, true );\n */\n}", "public function boot()\n {\n Nova::script('nova-blog-tool', __DIR__.'/../dist/js/tool.js');\n Nova::style('nova-blog-tool', __DIR__.'/../dist/css/tool.css');\n\t\n\t\tNova::script('post-form', __DIR__.'/../dist/js/post-form.js');\n\t\tNova::style('post-form', __DIR__.'/../dist/css/post-form.css');\n \n }", "function contactcampaign_civicrm_angularModules(&$angularModules) {\n_contactcampaign_civix_civicrm_angularModules($angularModules);\n}", "public function index() {\n \t$localJs = array(\n \t 'cwm/authentication/md5.min', \n \t 'cwm/authentication/utf8_encode.min',\n \t 'bootstrap-sign-in-web-component/bootstrap-sign-in-web-component.min',\n \t 'cwm/authentication/signin.min'\r\n \t);\n \t\n // load views\n require APP . 'view/_templates/header.php';\n require APP . 'view/authentication/index.php';\n require APP . 'view/_templates/footer.php';\n }", "public function DefineJsResources()\n {\n $this->carabiner->js('https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js');\n $this->carabiner->js('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js');\n $this->carabiner->js('https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js');\n // an array of arrays\n $this->carabiner->js(array(\n array('assets/js/Chart.min.js'),\n array('assets/js/Chart.bundle.min.js'),\n array('assets/js/jquery.js')\n ));\n }" ]
[ "0.73437184", "0.6319253", "0.6165575", "0.6158445", "0.5889071", "0.58383226", "0.5703663", "0.57016015", "0.5664902", "0.5654946", "0.54857016", "0.54692155", "0.54610395", "0.5439492", "0.54321647", "0.54265696", "0.542548", "0.53548175", "0.53370076", "0.5319842", "0.5314858", "0.5287603", "0.5287603", "0.5287563", "0.5280844", "0.52712405", "0.5268752", "0.52655405", "0.5244875", "0.52217174" ]
0.7354476
0
Discussions module on_project_object_options event handler
function discussions_handle_on_project_object_options(&$options, $object, $user) { if(instance_of($object, 'Discussion') && $object->canEdit($user)) { if ($object->getIsPinned()) { $options->addAfter('unpin', array( 'url' => $object->getUnpinUrl(), 'text' => lang('Unpin'), 'method' => 'post', ), 'edit'); } else { $options->addAfter('pin', array( 'url' => $object->getPinUrl(), 'text' => lang('Pin'), 'method' => 'post', ), 'edit'); } // if } // if }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function options_discussion_add_js()\n {\n }", "public function describe_client_options() {\n echo '<p>The following options configure what URL to access when a post is published in this blog.</p>';\n }", "function harvest_handle_on_project_options(&$options, &$project, &$logged_user)\n{\n\tif($logged_user->getSystemPermission('can_submit_harvest') && $logged_user->getSystemPermission('project_management'))\n\t{\n\t\t$options->add('harvest', array\n\t\t(\n\t\t\t'text'\t=> lang('Harvest Settings'),\n\t\t\t'url'\t=> assemble_url('project_harvest', array('project_id' => $project->getId())),\n\t\t));\n\t}\n}", "function charts_handle_on_people_projects_options(&$people_projects, &$options) {\n if (CHARTS_MODULE_HAVE_FPDF == true) {\n $people_projects->wireframe->addPageAction(lang('Download PDF Gantt Charts'), assemble_url('charts_profile_projects', array('company_id' => $people_projects->active_company->getId(), 'user_id' => $people_projects->active_user->getId(), 'type' => 'pdf')));\n }\n\n $options = new NamedList();\n $options->add('charts_export_xml', array(\n 'text' => lang('MS Projects XML'),\n 'url' => assemble_url('charts_profile_projects', array('company_id' => $people_projects->active_company->getId(), 'user_id' => $people_projects->active_user->getId(), 'type' => 'xml')),\n ));\n $options->add('charts_export_mpx', array(\n 'text' => lang('MS Projects MPX'),\n 'url' => assemble_url('charts_profile_projects', array('company_id' => $people_projects->active_company->getId(), 'user_id' => $people_projects->active_user->getId(), 'type' => 'mpx')),\n ));\n\n $people_projects->wireframe->addPageAction(lang('Export as...'), '#', $options->data, array('id' => 'people_projects_options'), 1000);\n\n }", "function post_options()\n\t{\n\t\tglobal $auth;\n\n\t\t$this->auth_bbcode = ($auth->acl_get('u_blogbbcode')) ? true : false;\n\t\t$this->auth_smilies = ($auth->acl_get('u_blogsmilies')) ? true : false;\n\t\t$this->auth_img = ($auth->acl_get('u_blogimg')) ? true : false;\n\t\t$this->auth_url = ($auth->acl_get('u_blogurl')) ? true : false;\n\t\t$this->auth_flash = ($auth->acl_get('u_blogflash')) ? true : false;\n\n\t\tblog_plugins::plugin_do('post_options');\n\t}", "function getSubProjectsOptions( &$pParamHash=array() ){\n\t\t$bindVars = array();\n\t\t$joinSql = $whereSql = \"\";\n\t\t/* =-=- CUSTOM BEGIN: subproject_content_id_options -=-= */\n\n\t\t/* =-=- CUSTOM END: subproject_content_id_options -=-= */\n\t\t$query = \"SELECT a.content_id, b.title FROM subproject_data a INNER JOIN liberty_content b ON a.content_id = b.content_id $joinSql $whereSql\";\n\t\treturn $this->mDb->getAssoc( $query, $bindVars );\n\t}", "function add_settings_fields_options_discussion() {\n\tsae_add_settings_section( 'article', __( 'Default article settings' ), 'settings_section_article_before', 'discussion' );\n\n\tsae_add_settings_field( 'default_pingback_flag', '', 'checkbox', 'discussion', 'article', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Attempt to notify any blogs linked to from the article' ),\n\t) );\n\n\tsae_add_settings_field( 'default_ping_status', '', 'checkbox', 'discussion', 'article', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles' ),\n\t) );\n\n\tsae_add_settings_field( 'default_comment_status', '', 'checkbox', 'discussion', 'article', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Allow people to post comments on new articles' ),\n\t) );\n\n\tsae_add_settings_section( 'comment', __( 'Other comment settings' ), null, 'discussion' );\n\n\tsae_add_settings_field( 'require_name_email', '', 'checkbox', 'discussion', 'comment', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Comment author must fill out name and email' ),\n\t) );\n\n\tif ( ! get_option( 'users_can_register' ) && is_multisite() ) {\n\t\tsae_add_settings_field( 'comment_registration', '', 'checkbox', 'discussion', 'comment', array(\n\t\t\t'skip_title' => true,\n\t\t\t'label' => __( 'Users must be registered and logged in to comment' ),\n\t\t\t'description' => __( 'Signup has been disabled. Only members of this site can comment.' ),\n\t\t) );\n\t} else {\n\t\tsae_add_settings_field( 'comment_registration', '', 'checkbox', 'discussion', 'comment', array(\n\t\t\t'skip_title' => true,\n\t\t\t'label' => __( 'Users must be registered and logged in to comment' ),\n\t\t) );\n\t}\n\n\tsae_add_settings_field( 'close_comments_for_old_posts', '', 'checkbox', 'discussion', 'comment', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Automatically close comments on old articles: enter the number of days in the field below' ),\n\t) );\n\n\tsae_add_settings_field( 'close_comments_days_old', __( 'Number of days after which comments will be automatically closed' ), 'number', 'discussion', 'comment', array(\n\t\t'input_class' => 'small-text',\n\t\t'min' => '0',\n\t\t'step' => '1',\n\t) );\n\n\tsae_add_settings_field( 'thread_comments', '', 'checkbox', 'discussion', 'comment', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Enable threaded (nested) comments: set the number of levels in the field below' ),\n\t) );\n\n\t/**\n\t * Filters the maximum depth of threaded/nested comments.\n\t *\n\t * @since 2.7.0.\n\t *\n\t * @param int $max_depth The maximum depth of threaded comments. Default 10.\n\t */\n\t$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );\n\n\tfor ( $depth_index = 2; $depth_index <= $maxdeep; $depth_index++ ) {\n\t\t$thread_comments_depth_choices[ $depth_index ] = $depth_index;\n\t}\n\n\tsae_add_settings_field( 'thread_comments_depth', __( 'Nested comments levels deep' ), 'select', 'discussion', 'comment', array(\n\t\t'choices' => $thread_comments_depth_choices,\n\t) );\n\n\tsae_add_settings_field( 'page_comments', '', 'checkbox', 'discussion', 'comment', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Break comments into pages' ),\n\t) );\n\n\tsae_add_settings_field( 'comments_per_page', __( 'Number of top level comments per page' ), 'number', 'discussion', 'comment', array(\n\t\t'input_class' => 'small-text',\n\t\t'min' => '0',\n\t\t'step' => '1',\n\t) );\n\n\tsae_add_settings_field( 'default_comments_page', __( 'Comments page displayed by default' ), 'select', 'discussion', 'comment', array(\n\t\t'choices' => array(\n\t\t\t'newest' => __( 'last page' ),\n\t\t\t'oldest' => __( 'first page' ),\n\t\t)\n\t) );\n\n\tsae_add_settings_field( 'comment_order', __( 'Comments to display at the top of each page' ), 'select', 'discussion', 'comment', array(\n\t\t'choices' => array(\n\t\t\t'asc' => __( 'older comments' ),\n\t\t\t'desc' => __( 'newer comments' ),\n\t\t)\n\t) );\n\n\tsae_add_settings_section( 'notifications', __( 'Notifications' ), null, 'discussion' );\n\n\tsae_add_settings_field( 'comments_notify', '', 'checkbox', 'discussion', 'notifications', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Email me when anyone posts a comment' ),\n\t) );\n\n\tsae_add_settings_field( 'moderation_notify', '', 'checkbox', 'discussion', 'notifications', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Email me when a comment is held for moderation' ),\n\t) );\n\n\tsae_add_settings_section( 'moderation', __( 'Comment moderation' ), null, 'discussion' );\n\n\tsae_add_settings_field( 'comment_moderation', '', 'checkbox', 'discussion', 'moderation', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Before a comment appears, it must be manually approved' ),\n\t) );\n\n\tsae_add_settings_field( 'comment_whitelist', '', 'checkbox', 'discussion', 'moderation', array(\n\t\t'skip_title' => true,\n\t\t'label' => __( 'Before a comment appears, the comment author must have a previously approved comment' ),\n\t) );\n\n\tsae_add_settings_field( 'comment_max_links', __( 'Number of links in a comment after which it will be held in the moderation queue' ), 'number', 'discussion', 'moderation', array(\n\t\t'input_class' => 'small-text',\n\t\t'min' => '0',\n\t\t'step' => '1',\n\t\t'description' => __( 'A common characteristic of comment spam is a large number of links.' ),\n\t) );\n\n\tsae_add_settings_field( 'moderation_keys', __( 'Moderation words' ), 'textarea', 'discussion', 'moderation', array(\n\t\t'rows' => '10',\n\t\t'cols' => '50',\n\t\t'input_class' => 'large-text code',\n\t\t'description' => sprintf(\n\t\t\t__( 'When a comment contains any of these words in its content, name, URL, email, or IP, it will be held in the %1$smoderation queue%2$s. One word or IP per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' ),\n\t\t\t'<a href=\"edit-comments.php?comment_status=moderated\">',\n\t\t\t'</a>'\n\t\t),\n\t) );\n\n\tsae_add_settings_field( 'blacklist_keys', __( 'Comment blacklist' ), 'textarea', 'discussion', 'moderation', array(\n\t\t'rows' => '10',\n\t\t'cols' => '50',\n\t\t'input_class' => 'large-text code',\n\t\t'description' => __( 'When a comment contains any of these words in its content, name, URL, email, or IP, it will be put in the trash. One word or IP per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' )\n\t) );\n}", "public function PostController_DiscussionFormOptions_Handler($Sender) {\n\t\t$ShowWhen = $this->Config['ShowFormWhen'];\n\t\tif ($ShowWhen($Sender)) {\n\t\t\t$FormArray = [];\n\t\t\tforeach ($this->Config['Values'] as $Id => $Options) {\n\t\t\t\t$FormArray[$Id] = $Options['form_markup'];\n\t\t\t}\n\t\t\t$Sender->EventArguments['Options'] .= '<label>'.$this->Config['Label'].'</label>';\n\t\t\t$Sender->EventArguments['Options'] .= '<div class=\"ExtraDiscussionData-'.$this->Config['ColumnName'].'\">'.$Sender->Form->RadioList($this->Config['ColumnName'], $FormArray).'</div>';\n\t\t}\n\t}", "public function edit(ProjectDiscussion $projectDiscussion)\n {\n //\n }", "function template_options()\n{\n\tglobal $context, $settings, $options, $scripturl, $txt;\n\n\t$context['theme_options'] = array(\n\t\tarray(\n\t\t\t'id' => 'show_board_desc',\n\t\t\t'label' => $txt['board_desc_inside'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_children',\n\t\t\t'label' => $txt['show_children'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'use_sidebar_menu',\n\t\t\t'label' => $txt['use_sidebar_menu'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_avatars',\n\t\t\t'label' => $txt['show_no_avatars'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_signatures',\n\t\t\t'label' => $txt['show_no_signatures'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_censored',\n\t\t\t'label' => $txt['show_no_censored'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'return_to_post',\n\t\t\t'label' => $txt['return_to_post'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'no_new_reply_warning',\n\t\t\t'label' => $txt['no_new_reply_warning'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_first',\n\t\t\t'label' => $txt['recent_posts_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_pm_first',\n\t\t\t'label' => $txt['recent_pms_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'posts_apply_ignore_list',\n\t\t\t'label' => $txt['posts_apply_ignore_list'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'wysiwyg_default',\n\t\t\t'label' => $txt['wysiwyg_default'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'popup_messages',\n\t\t\t'label' => $txt['popup_messages'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'copy_to_outbox',\n\t\t\t'label' => $txt['copy_to_outbox'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'pm_remove_inbox_label',\n\t\t\t'label' => $txt['pm_remove_inbox_label'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'auto_notify',\n\t\t\t'label' => $txt['auto_notify'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'topics_per_page',\n\t\t\t'label' => $txt['topics_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'messages_per_page',\n\t\t\t'label' => $txt['messages_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'calendar_start_day',\n\t\t\t'label' => $txt['calendar_start_day'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['days'][0],\n\t\t\t\t1 => $txt['days'][1],\n\t\t\t\t6 => $txt['days'][6],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_reply',\n\t\t\t'label' => $txt['display_quick_reply'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_reply1'],\n\t\t\t\t1 => $txt['display_quick_reply2'],\n\t\t\t\t2 => $txt['display_quick_reply3']\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_mod',\n\t\t\t'label' => $txt['display_quick_mod'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_mod_none'],\n\t\t\t\t1 => $txt['display_quick_mod_check'],\n\t\t\t\t2 => $txt['display_quick_mod_image'],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t);\n}", "function optionsframeproject_options() {\n\n\t// Test data\n\t$test_array = array(\n\t\t'one' => __('One', 'options_frameproject_theme'),\n\t\t'two' => __('Two', 'options_frameproject_theme'),\n\t\t'three' => __('Three', 'options_frameproject_theme'),\n\t\t'four' => __('Four', 'options_frameproject_theme'),\n\t\t'five' => __('Five', 'options_frameproject_theme')\n\t);\n\n\t// Multicheck Array\n\t$multicheck_array = array(\n\t\t'one' => __('French Toast', 'options_frameproject_theme'),\n\t\t'two' => __('Pancake', 'options_frameproject_theme'),\n\t\t'three' => __('Omelette', 'options_frameproject_theme'),\n\t\t'four' => __('Crepe', 'options_frameproject_theme'),\n\t\t'five' => __('Waffle', 'options_frameproject_theme')\n\t);\n\n\t// Multicheck Defaults\n\t$multicheck_defaults = array(\n\t\t'one' => '1',\n\t\t'five' => '1'\n\t);\n\n\t// Background Defaults\n\t$background_defaults = array(\n\t\t'color' => '',\n\t\t'image' => '',\n\t\t'repeat' => 'repeat',\n\t\t'position' => 'top center',\n\t\t'attachment'=>'scroll' );\n\n\t// Typography Defaults\n\t$typography_defaults = array(\n\t\t'size' => '15px',\n\t\t'face' => 'georgia',\n\t\t'style' => 'bold',\n\t\t'color' => '#bada55' );\n\t\t\n\t// Typography Options\n\t$typography_options = array(\n\t\t'sizes' => array( '6','12','14','16','20' ),\n\t\t'faces' => array( 'Helvetica Neue' => 'Helvetica Neue','Arial' => 'Arial' ),\n\t\t'styles' => array( 'normal' => 'Normal','bold' => 'Bold' ),\n\t\t'color' => false\n\t);\n\n\t// Pull all the categories into an array\n\t$options_categories = array();\n\t$options_categories_obj = get_categories();\n\tforeach ($options_categories_obj as $category) {\n\t\t$options_categories[$category->cat_ID] = $category->cat_name;\n\t}\n\t\n\t// Pull all tags into an array\n\t$options_tags = array();\n\t$options_tags_obj = get_tags();\n\tforeach ( $options_tags_obj as $tag ) {\n\t\t$options_tags[$tag->term_id] = $tag->name;\n\t}\n\n\n\t// Pull all the pages into an array\n\t$options_pages = array();\n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t$options_pages[''] = 'Select a page:';\n\tforeach ($options_pages_obj as $page) {\n\t\t$options_pages[$page->ID] = $page->post_title;\n\t}\n\n\t// If using image radio buttons, define a directory path\n\t$imagepath = get_template_directory_uri() . '/images/';\n\n\t$options = array();\n\n\t$options[] = array(\n\t\t'name' => __('General Settings', 'options_frameproject_theme'),\n\t\t'type' => 'heading');\n\t\n\t$options[] = array(\n\t\t'name' => __('Logo Upload', 'options_frameproject_theme'),\n\t\t'desc' => __('Logo Upload.', 'options_frameproject_theme'),\n\t\t'id' => 'hmk_logo',\n\t\t'type' => 'upload');\n\t\n\t\t\t\n\t$options[] = array(\n\t\t'name' => __('Copyright Text', 'options_frameproject_theme'),\n\t\t'desc' => __('Copyright Text.', 'options_frameproject_theme'),\n\t\t'id' => 'hmk_copyright',\n\t\t'type' => 'textarea');\n\t\n\t$wp_editor_settings = array(\n\t\t'wpautop' => false, // Default\n\t\t'textarea_rows' => 8,\n\t\t'quicktags' => false,\n\t\t'tinymce' => false\n\t);\n\n\t$options[] = array(\n\t\t'name' => __('Google Analytics Code', 'options_frameproject_theme'),\n\t\t'desc' =>'',\n\t\t'id' => 'google_analytics',\n\t\t'type' => 'editor',\n\t\t'settings' => $wp_editor_settings );\n\t\n\t$options[] = array(\n\t\t'name' => __('Homepage', 'options_frameproject_theme'),\n\t\t'type' => 'heading');\n\t\n\t$options[] = array(\n\t\t'name' => __('Homepage Text', 'options_frameproject_theme'),\n\t\t'desc' => __('Homepage Text Below Slider.', 'options_frameproject_theme'),\n\t\t'id' => 'hmk_home_text',\n\t\t'std' => 'Quality is never an accident; it is always the result of high intentions, sincere effort, intelligent direction and skillful execution; It represents the wise choice of many alternatives\" William A. Foster.',\n\t\t'type' => 'textarea');\n\t\n\t$options[] = array(\n\t\t'name' => __('Homepage Feature Boxes', 'options_frameproject_theme'),\n\t\t'desc' => __('', 'options_frameproject_theme'),\n\t\t'type' => 'info');\n\n\t$options[] = array(\n\t\t'name' => __('Featured Box 1 Image', 'options_frameproject_theme'),\n\t\t'desc' => __('Logo Upload.', 'options_frameproject_theme'),\n\t\t'id' => 'home_feature1_img',\n\t\t'type' => 'upload');\n\t\n\t$options[] = array(\n\t\t'name' => __('Featured Box 1 Page', 'options_frameproject_theme'),\n\t\t'desc' => __('Featured Box 1 Links to this page', 'options_frameproject_theme'),\n\t\t'id' => 'home_feature1_link',\n\t\t'type' => 'select',\n\t\t'std' => '#',\n\t\t'class' => 'mini',\n\t\t'options' => $options_pages);\n\t\n\t$options[] = array(\n\t\t'name' => __('Featured Box 2 Image', 'options_frameproject_theme'),\n\t\t'desc' => __('Logo Upload.', 'options_frameproject_theme'),\n\t\t'id' => 'home_feature2_img',\n\t\t'type' => 'upload');\n\t\n\t$options[] = array(\n\t\t'name' => __('Featured Box 2 Page', 'options_frameproject_theme'),\n\t\t'desc' => __('Featured Box 2 Links to this page', 'options_frameproject_theme'),\n\t\t'id' => 'home_feature2_link',\n\t\t'type' => 'select',\n\t\t'std' => '#',\n\t\t'class' => 'mini',\n\t\t'options' => $options_pages);\n\t\n\t$options[] = array(\n\t\t'name' => __('Social', 'options_frameproject_theme'),\n\t\t'type' => 'heading');\n\t\t\n\t$options[] = array(\n\t\t'name' => __('Facebook Url', 'options_frameproject_theme'),\n\t\t'desc' => __('Facebook Url.', 'options_frameproject_theme'),\n\t\t'id' => 'hmk_facebook_url',\n\t\t'std' => '#',\n\t\t'type' => 'text');\n\t\n\t$options[] = array(\n\t\t'name' => __('Twitter Url', 'options_frameproject_theme'),\n\t\t'desc' => __('Twitter Url.', 'options_frameproject_theme'),\n\t\t'id' => 'hmk_twitter_url',\n\t\t'std' => '#',\n\t\t'type' => 'text');\n\t\n\t$options[] = array(\n\t\t'name' => __('Linkedin Url', 'options_frameproject_theme'),\n\t\t'desc' => __('Linkedin Url.', 'options_frameproject_theme'),\n\t\t'id' => 'hmk_linkedin_url',\n\t\t'std' => '#',\n\t\t'type' => 'text');\n\t\n\t\n\treturn $options;\n}", "function init_integrated_options() {\n\t\t$this->permalink_sections();\n\n\t}", "public function hookConfig($args)\n {\n $post = $args['post'];\n set_option('viewer3d_options', $post['options']);\n \n }", "function get_collection(){\n\t\t$parent_id = $this->request->post('parent_id');\n\t\t$team_obj = new Project($parent_id);\n\t\t$object_type = $this->request->post('object_type');\n\t\t\n\t\t$listing = array();\n\t\tswitch($object_type){\n\t\t\tcase 'milestone':\n\t\t\t\t//$listing = Milestones::findByProject($team_obj, $this->logged_user);\n\t\t\t\t$listing = Milestones::findActiveByProject_custom($team_obj);\n\t\t\t\tbreak;\n\t\t\tcase 'ticket':\n\t\t\t\t$listing = Tickets::findOpenByProjectByNameSort($team_obj, STATE_VISIBLE, $this->logged_user->getVisibility());\n\t\t\t\tbreak;\n\t\t\tcase 'page':\n\t\t\t\t$categories = Categories::findByModuleSection($team_obj, 'pages', 'pages');\n\t\t\t\t$listing = Pages::findByCategories($categories, STATE_VISIBLE, $this->logged_user->getVisibility());\n\t\t\t\t/*foreach($categories as $category){\n\t\t\t\t\t$listing = array_merge($listing, Pages::findByCategory($category, STATE_VISIBLE, $this->logged_user->getVisibility()));\n\t\t\t\t}*/\n\t\t\t\tbreak;\n\t\t}\n\t\t$this->smarty->assign('options', $listing);\n\t}", "function bLinkCollaboration_ap() {\n global $bl_collaboration;\n if (!isset($bl_collaboration)) {\n return;\n }\n add_options_page(\"Blink Settings\", \"BLink Settings\", 9, __FILE__, array(&$bl_collaboration,'printAdminPage'));\n}", "public function configureOptions();", "public function updatePublishTargetJobOptions(&$options)\n {\n }", "function update_options() {\n\t\tif ( get_current_blog_id() !== $this->options_blog_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tupdate_option( $this->option_name, $this->options );\n\t}", "public function override_options( $options ) {\n\t\tif ( ! $this->enabled() || is_admin() ) return $options;\n\n\t\tif ( is_post_type_archive( nProjects::TYPE_NAME ) ||\n\t\t\t is_tax( nProjects::TYPE_CATEGORY ) ||\n\t\t\t is_tax( nProjects::TYPE_TAG ) ||\n\t\t\t is_page_template( 'templates/template-projects.php' ) ) {\n\t\t\t$options['sidebar_layout'] = isset( $options['projects_archive_sidebar_layout'] )\n\t\t\t\t? $options['projects_archive_sidebar_layout']\n\t\t\t\t: $options['sidebar_layout'];\n\n\t\t\t$options['sidebar_default'] = isset( $options['projects_archive_sidebar'] )\n\t\t\t\t? $options['projects_archive_sidebar']\n\t\t\t\t: $options['sidebar_default'];\n\n\t\t\t$options['blog_archive_pagination_style'] = isset( $options['projects_archive_pagination_style'] )\n\t\t\t\t? $options['projects_archive_pagination_style']\n\t\t\t\t: $options['blog_archive_pagination_style'];\n\t\t}\n\t\telseif ( is_singular( nProjects::TYPE_NAME ) ) {\n\t\t\t$project_settings = get_post_meta( get_the_ID(), '_project_settings', true );\n\t\t\t$project_settings = is_array( $project_settings ) ? $project_settings : array();\n\n\t\t\tif ( isset( $project_settings['project_settings_enabled'] ) && $project_settings['project_settings_enabled'] == true ) {\n\t\t\t\tforeach ( $project_settings as $name => $value )\n\t\t\t\t\tif ( isset( $options[$name] ) )\n\t\t\t\t\t\t$options[$name] = $value;\n\t\t\t}\n\n\t\t\t$options['sidebar_layout'] = isset( $options['projects_single_sidebar_layout'] )\n\t\t\t\t? $options['projects_single_sidebar_layout']\n\t\t\t\t: $options['sidebar_layout'];\n\n\t\t\t$options['sidebar_default'] = isset( $options['projects_single_sidebar'] )\n\t\t\t\t? $options['projects_single_sidebar']\n\t\t\t\t: $options['sidebar_default'];\n\n\t\t\t$options['blog_post_header_background'] = isset( $options['projects_single_header_background'] )\n\t\t\t\t? $options['projects_single_header_background']\n\t\t\t\t: $options['blog_post_header_background'];\n\t\t}\n\n\t\treturn $options;\n\t}", "public function options()\n {\n $options = apply_filters(\n $this->id . '_option_fields',\n [\n 'id' => $this->id, // upstream_milestones\n 'title' => $this->title,\n 'menu_title' => $this->menu_title,\n 'desc' => $this->description,\n 'show_on' => ['key' => 'options-page', 'value' => [$this->id],],\n 'show_names' => true,\n 'fields' => [\n [\n 'name' => upstream_milestone_label_plural(),\n 'id' => 'milestone_title',\n 'type' => 'title',\n ],\n [\n 'name' => 'Milestone Categories',\n 'id' => 'enable_milestone_categories',\n 'type' => 'radio',\n 'description' => '',\n 'options' => [\n '1' => __('Enabled', 'upstream'),\n '0' => __('Disabled', 'upstream'),\n ],\n 'default' => '0',\n ],\n ],\n ]\n );\n\n return $options;\n }", "public function options() {}", "function get_post_objects( $query_args ) {\n $args = wp_parse_args( $query_args, array(\n 'post_type' => 'project',\n ) );\n $posts = get_posts( $args );\n $post_options = array();\n if ( $posts ) {\n foreach ( $posts as $post ) {\n $post_options [ $post->ID ] = $post->post_title;\n }\n }\n return $post_options;\n}", "protected function initOptions()\n {\n }", "protected function configureOptions(): void\n {\n }", "public function show(ProjectDiscussion $projectDiscussion)\n {\n //\n }", "public function hookConfigForm($args)\n {\n $view = get_view();\n $elementTable = $this->_db->getTable('Element');\n $configArgs -> options = get_option('viewer3d_options');\n if (isset($configArgs -> options)) {\n $configArgs -> options = json_decode($configArgs -> options);\n } else {\n $configArgs -> options = $this -> getDefaultOptions();\n set_option('viewer3d_options', json_encode($configArgs -> options));\n }\n //$configArgs -> options = $this -> getDefaultOptions();\n //set_option('viewer3d_options', json_encode($configArgs -> options));\n $this -> _showConfigForm($configArgs);\n \n }", "public function init()\n {\n global $kong_helpdesk_options;\n $this->options = $kong_helpdesk_options;\n }", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}" ]
[ "0.5404037", "0.5271101", "0.5228284", "0.522513", "0.519314", "0.5160246", "0.5151085", "0.50958025", "0.5053436", "0.50255847", "0.49935886", "0.49288845", "0.49190903", "0.48473862", "0.48279494", "0.4771124", "0.47675234", "0.47559407", "0.47540587", "0.47469974", "0.47405928", "0.47372407", "0.47243905", "0.47027647", "0.47019416", "0.4667751", "0.46628606", "0.4655721", "0.4655721", "0.46551943" ]
0.72194445
0
Define the "web" routes for the application. These routes all receive session state, CSRF protection, etc.
protected function mapWebRoutes() { $this->mapDefaultWebRoutes(); $this->mapUnauthenticatedWebRoutes(); $this->mapAuthenticatedWebRoutes(); $this->mapAdminAuthenticatedWebRoutes(); $this->mapClientAuthenticatedWebRoutes(); $this->mapPaginationRoutes(); $this->mapAdminPaginationRoutes(); $this->mapClientPaginationRoutes(); $this->mapAjaxRoutes(); $this->mapAdminAjaxRoutes(); $this->mapClientAjaxRoutes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::group(lit_base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')->namespace($this->namespace)->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('Modules/Post/routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n $locale = Request::segment(1);\n $this->app->setLocale($locale);\n\n Route::prefix($locale)\n ->middleware('web', 'language')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "protected function mapWebRoutes()\n {\n Route::group([\n 'middleware' => 'web',\n 'namespace' => $this->namespace,\n ], function ($router) {\n require base_path('routes/web.php');\n });\n }", "protected function mapWebRoutes(): void\n {\n Route::middleware('web')\n ->group(__DIR__ . '/../routes/web.php');\n }", "protected function mapWebRoutes()\n {\n Route::group([\n 'namespace' => $this->namespace, 'middleware' => 'web',\n ], function ($router) {\n require base_path('routes/web.php');\n });\n }", "public function map() {\n\t\tRoute::middleware( 'web' )->group( mantle_base_path( 'routes/web.php' ) );\n\t\tRoute::middleware( 'rest-api' )->group( mantle_base_path( 'routes/rest-api.php' ) );\n\t}", "protected function mapWebRoutes()\n {\n /*Route::group([\n 'middleware' => 'web',\n 'namespace' => $this->namespace,\n ], function ($router) {\n require module_path('frontend', 'Routes/web.php');\n });*/\n\n /* 将web中的路由按模块分成多个子文件 */\n // 手机端访问\n $design_page = request()->get('page','');\n// $design_page = empty($design_page) ? str_contains($design_page, 'm_') : false;\n if (is_mobile() || (request()->getHost() == env('MOBILE_DOMAIN')) || $design_page) {\n foreach(glob(module_path('frontend', 'Routes/mobile/*.php'))as $file){\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group($file);\n }\n }\n\n // PC或app访问\n if (!is_mobile() || (request()->getHost() == env('FRONTEND_DOMAIN'))) {\n foreach(glob(module_path('frontend', 'Routes/pc/*.php'))as $file){\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group($file);\n }\n }\n// else { // PC或app访问\n// foreach(glob(module_path('frontend', 'Routes/pc/*.php'))as $file){\n// Route::middleware('web')\n// ->namespace($this->namespace)\n// ->group($file);\n// }\n// }\n\n\n }", "protected function registerWebRoutes()\n {\n if (config('firefly.web.enabled')) {\n Route::group(config('firefly.web'), function () {\n $this->loadRoutesFrom(__DIR__.'/../routes/web.php');\n });\n }\n }", "protected function defineRoutes()\n {\n if ($this->app->routesAreCached() || config('sanctum.routes') === false) {\n return;\n }\n\n Route::group(['prefix' => config('sanctum.prefix', 'sanctum')], function () {\n Route::get(\n '/csrf-cookie',\n CsrfCookieController::class.'@show'\n )->middleware('web');\n });\n }", "function defineRoutes() {\n Router::map('homepage', '', array('controller' => DEFAULT_CONTROLLER, 'action' => DEFAULT_ACTION, 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('admin', 'admin', array('controller' => 'admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('public', 'public', array('controller' => 'public', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('wireframe_updates', 'wireframe-updates', array('controller' => 'backend', 'action' => 'wireframe_updates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('menu_refresh_url', 'refresh-menu', array('controller' => 'backend', 'action' => 'refresh_menu', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('quick_add', 'quick-add', array('controller' => 'backend', 'action' => 'quick_add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // API\n Router::map('info', 'info', array('controller' => 'api', 'action' => 'info', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Disk Space\n Router::map('disk_space_admin', 'admin/disk-space', array('controller' => 'disk_space_admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_usage', 'admin/disk-space/usage', array('controller' => 'disk_space_admin', 'action' => 'usage', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_admin_settings', 'admin/disk-space/settings', array('controller' => 'disk_space_admin', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_application_cache', 'admin/disk-space/tools/remove-application-cache', array('controller' => 'disk_space_admin', 'action' => 'remove_application_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_logs', 'admin/disk-space/tools/remove-logs', array('controller' => 'disk_space_admin', 'action' => 'remove_logs', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_old_application_versions', 'admin/disk-space/tools/remove-old-application-versions', array('controller' => 'disk_space_admin', 'action' => 'remove_old_application_versions', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Appearance\n Router::map('appearance_admin', 'admin/appearance', array('controller' => 'appearance', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_add_scheme', 'admin/appearance/add-scheme', array('controller' => 'appearance', 'action' => 'add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_edit_scheme', 'admin/appearance/:scheme_id/edit', array('controller' => 'appearance', 'action' => 'edit', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_rename_scheme', 'admin/appearance/:scheme_id/rename', array('controller' => 'appearance', 'action' => 'rename', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_delete_scheme', 'admin/appearance/:scheme_id/delete', array('controller' => 'appearance', 'action' => 'delete', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_set_as_default_scheme', 'admin/appearance/:scheme_id/set-as-default', array('controller' => 'appearance', 'action' => 'set_as_default', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Scheduled Tasks Admin\n Router::map('scheduled_tasks_admin', 'admin/scheduled-tasks', array('controller' => 'scheduled_tasks_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Network settings\n Router::map('network_settings', 'admin/network', array('controller' => 'network_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Indices admin\n Router::map('indices_admin', 'admin/indices', array('controller' => 'indices_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild', 'admin/indices/rebuild', array('controller' => 'indices_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild_finish', 'admin/indices/rebuild/finish', array('controller' => 'indices_admin', 'action' => 'rebuild_finish', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n Router::map('object_contexts_admin_rebuild', 'admin/indices/object-contexts/rebuild', array('controller' => 'object_contexts_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('object_contexts_admin_clean', 'admin/indices/object-contexts/clean', array('controller' => 'object_contexts_admin', 'action' => 'clean', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Scheduled tasks\n Router::map('frequently', 'frequently', array('controller' => 'scheduled_tasks', 'action' => 'frequently', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('hourly', 'hourly', array('controller' => 'scheduled_tasks', 'action' => 'hourly', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('daily', 'daily', array('controller' => 'scheduled_tasks', 'action' => 'daily', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // trash related\n Router::map('trash', 'trash', array('controller' => 'trash', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_section', 'trash/:section_name', array('controller' => 'trash', 'action' => 'section', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_empty', 'trash/empty', array('controller' => 'trash', 'action' => 'empty_trash', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('object_untrash', 'trash/untrash-object', array('controller' => 'trash', 'action' => 'untrash_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n Router::map('object_delete', 'trash/delete-object', array('controller' => 'trash', 'action' => 'delete_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n\n // Control Tower\n Router::map('control_tower', 'control-tower', array('controller' => 'control_tower', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_empty_cache', 'control-tower/empty-cache', array('controller' => 'control_tower', 'action' => 'empty_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_delete_compiled_templates', 'control-tower/delete-compiled-templates', array('controller' => 'control_tower', 'action' => 'delete_compiled_templates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_images', 'control-tower/rebuild-images', array('controller' => 'control_tower', 'action' => 'rebuild_images', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_localization', 'control-tower/rebuild-localization', array('controller' => 'control_tower', 'action' => 'rebuild_localization', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('control_tower_settings', 'admin/control-tower', array('controller' => 'control_tower', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n\t // Firewall\n\t Router::map('firewall', 'admin/firewall', array('controller' => 'firewall', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public static function webAdminRoutes(): void\n {\n Route::namespace(\"\\\\Orq\\\\Laravel\\\\Starter\\\\Controllers\\\\Admin\")->group(function () {\n // 后台管理员\n Route::get('/admin/index', 'AdminController@index')->name('AdminIndex');\n Route::get('/admin/new', 'AdminController@new')->name('AdminNew');\n Route::get('/admin/edit', 'AdminController@edit')->name('AdminEdit');\n Route::post('/admin/save', 'AdminController@save')->name('AdminSave');\n Route::post('/admin/deactivate', 'AdminController@deactivate')->name('AdminDeactivate');\n Route::post('/admin/restore', 'AdminController@restore')->name('AdminRestore');\n Route::post('/admin/update', 'AdminController@update')->name('AdminUpdate');\n });\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n Route::middleware(['nova', Authorize::class])\n ->prefix('nova-vendor/media-library')\n ->group(__DIR__.'/../routes/api.php');\n }" ]
[ "0.7653972", "0.7631945", "0.76263565", "0.76263565", "0.76263565", "0.76263565", "0.76263565", "0.76263565", "0.76263565", "0.76263565", "0.76263565", "0.76263565", "0.7625575", "0.7625575", "0.7625575", "0.7624785", "0.7531319", "0.74913883", "0.7476765", "0.7474766", "0.74298817", "0.72575426", "0.7232162", "0.7196867", "0.7175654", "0.69959605", "0.6956561", "0.6956561", "0.6846232", "0.68156695" ]
0.7741437
0
getFormatted Returns a formatted string for UI presentation. Examples include: Toronto, Ontatio London, England Egypt Miami, Florida
public function getFormatted(): string { $pieces = array(); $city = $this->getCity(); $region = $this->getRegion(); $country = $this->getCountry(); $countryCode = $this->getCountryCode(); $countryCode = strtoupper($countryCode); if ($countryCode === 'CA' || $countryCode === 'US') { if ($city !== false && $city !== '') { array_push($pieces, $city); if ($region !== false && $region !== '') { array_push($pieces, $region); return implode(', ', $pieces); } if ($country !== false && $country !== '') { array_push($pieces, $country); return implode(', ', $pieces); } array_push($pieces, $countryCode); return implode(', ', $pieces); } if ($region !== false && $region !== '') { array_push($pieces, $region); if ($country !== false && $country !== '') { array_push($pieces, $country); return implode(', ', $pieces); } array_push($pieces, $countryCode); return implode(', ', $pieces); } if ($country !== false && $country !== '') { return $country; } return $countryCode; } if ($city !== false && $city !== '') { array_push($pieces, $city); if ($country !== false && $country !== '') { array_push($pieces, $country); return implode(', ', $pieces); } if ($countryCode !== false && $countryCode !== '') { array_push($pieces, $countryCode); return implode(', ', $pieces); } return $city; } if ($country !== false && $country !== '') { return $country; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ToFormattedText() {\n $result = 'First Name: '.$this->firstName.'<br />';\n $result .= 'LastName: '.$this->lastName.'<br />';\n $result .= 'email: '.$this->email.'<br />';\n\n if( ! is_null($this->dob ) )\n $result .= 'Date of Birth: '.$this->dob.'<br />';\n\n if( ! is_null($this->address ) )\n $result .= 'Address: '.$this->address.'<br />';\n\n return $result;\n }", "function format()\r\n\t{\r\n\t\treturn $this->text;\r\n\t}", "public function format(): string;", "public static function getFormat(): string;", "public function format()\n {\n return sprintf('%s %s %s', $this->x(), $this->y(), $this->z());\n }", "abstract function format();", "public function getFormattedMessage();", "protected function getFormattedDate()\n\t{\n\t\t$value = $this->getValue();\n\t\t$defaultText = $this->getDefaultText();\n\t\tif(empty($value) && !empty($defaultText))\n\t\t\treturn $this->getDefaultText();\n\n\t\t$app = $this->getApplication()->getGlobalization();\n\n\t\t//initialized the default class wide formatter\n\t\tif(self::$formatter===null)\n\t\t\tself::$formatter = new DateFormat($app->getCulture());\n\n\t\t$culture = $this->getCulture();\n\n\t\t//return the specific cultural formatted date time\n\t\tif(strlen($culture) && $app->getCulture() !== $culture)\n\t\t{\n\t\t\t$formatter = new DateFormat($culture);\n\t\t\treturn $formatter->format($value,\n\t\t\t\t\t\t\t\t\t $this->getPattern(),\n\t\t\t\t\t\t\t\t\t $this->getCharset());\n\t\t}\n\t\t//return the application wide culture formatted date time.\n\t\t$result = self::$formatter->format($value,\n\t\t\t\t\t\t\t\t\t\t$this->getPattern(),\n\t\t\t\t\t\t\t\t\t\t$this->getCharset());\n\t\treturn $result;\n\t}", "public function getFormattedData();", "public function formattedTax(): string;", "function format($value);", "public function getFormat() {}", "public function getFormat() {}", "public function getFormat() {}", "public function getFormattedValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}", "public function get_formatted_address() {\n\n\t\t\t$address_parts = array(\n\t\t\t\t'store' => '<br/>',\n\t\t\t\t'address' => '<br/>',\n\t\t\t\t'address2' => '<br/>',\n\t\t\t\t'city' => ', ',\n\t\t\t\t'state' => ' ',\n\t\t\t\t'zip' => '<br/>',\n\t\t\t\t'country' => '',\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * FILTER: slp_formatted_location_address_elements\n\t\t\t *\n\t\t\t * @params string[] and array of the property names (key) and after-field suffix (value) we want to use to build the string.\n\t\t\t *\n\t\t\t * @return string[] modified list of property names\n\t\t\t */\n\t\t\t$address_parts = apply_filters( 'slp_formatted_location_address_elements', $address_parts );\n\n\t\t\t// Get the valid non-empty properties.\n\t\t\t//\n\t\t\t$valid_parts = array();\n\t\t\tforeach ( $address_parts as $property => $suffix ) {\n\t\t\t\tif ( property_exists( $this, $property ) && ( ! empty ( $this->$property ) ) ) {\n\t\t\t\t\t$valid_parts[] = $this->$property . $suffix;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * FILTER: slp_formatted_location_address\n\t\t\t *\n\t\t\t * @params string the formatted name\n\t\t\t *\n\t\t\t * @return string the modified name\n\t\t\t */\n\t\t\treturn apply_filters( 'slp_formatted_location_address', join( ' ', $valid_parts ) );\n\t\t}", "public function getLocalized($template)\n {\n $dateTimeFormatProvider = StaticContainer::get('Piwik\\Intl\\Data\\Provider\\DateTimeFormatProvider');\n\n $template = $dateTimeFormatProvider->getFormatPattern($template);\n\n $tokens = self::parseFormat($template);\n\n $out = '';\n\n foreach ($tokens AS $token) {\n if (is_array($token)) {\n $out .= $this->formatToken(array_shift($token));\n\n } else {\n $out .= $token;\n }\n }\n\n return $out;\n }", "public function get_formatted_name() {\n\n\t\t\t/**\n\t\t\t * FILTER: slp_formatted_location_name_elements\n\t\t\t *\n\t\t\t * @params string[] and array of the property names we want to use to build the string.\n\t\t\t *\n\t\t\t * @return string[] modified list of property names\n\t\t\t */\n\t\t\t$name_parts = apply_filters( 'slp_formatted_location_name_elements', array(\n\t\t\t\t'store',\n\t\t\t\t'city',\n\t\t\t\t'state',\n\t\t\t\t'country',\n\t\t\t) );\n\n\t\t\t// Get the valid non-empty properties.\n\t\t\t//\n\t\t\t$valid_parts = array();\n\t\t\tforeach ( $name_parts as $property ) {\n\t\t\t\tif ( property_exists( $this, $property ) && ( ! empty ( $this->$property ) ) ) {\n\t\t\t\t\t$valid_parts[] = $this->$property;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * FILTER: slp_formatted_location_name_separator\n\t\t\t *\n\t\t\t * @params string the separator for the name defaults to a space\n\t\t\t *\n\t\t\t * @return string the modified separator used for the join\n\t\t\t */\n\t\t\t$part_separator = apply_filters( 'slp_formatted_location_name_separator', ' ' );\n\n\t\t\t/**\n\t\t\t * FILTER: slp_formatted_location_name\n\t\t\t *\n\t\t\t * @params string the formatted name\n\t\t\t *\n\t\t\t * @return string the modified name\n\t\t\t */\n\t\t\treturn apply_filters( 'slp_formatted_location_name', join( $part_separator, $valid_parts ) );\n\t\t}", "public function FormattedMessage() {\n\t\treturn $this->FormattedText($this->Message);\n\t}", "public function format()\n {\n $formattedString = join('_', $this->toLower());\n if (strpos($formattedString, '_') === 0) {\n $formattedString = substr($formattedString, 1);\n }\n\n return $formattedString;\n }", "public function __toString()\r\n {\r\n return $this->getFormattedString();\r\n }", "public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}", "public function getFormatContent(): string\n {\n $this->label = rtrim($this->label,';');\n return \"\\e[{$this->label}m{$this->content}\\e[0m\";\n }", "public function format(string $value): string;", "public function getFormat();", "public function getFormat();", "public function getFormat();", "public function getFormat();", "public function getFormat();", "public function getFormat();" ]
[ "0.6611772", "0.65760624", "0.65293515", "0.64896923", "0.6301652", "0.62687725", "0.61948127", "0.6137249", "0.60361856", "0.5984798", "0.59708625", "0.59282756", "0.59282756", "0.59282756", "0.59261656", "0.5909132", "0.5872617", "0.58665884", "0.58463013", "0.5800825", "0.5796026", "0.5776543", "0.5774805", "0.57715344", "0.5742251", "0.5742251", "0.5742251", "0.5742251", "0.5742251", "0.5742251" ]
0.7315018
0
Create the DNS string.
public function constructDns(array $config): string { return "mysql:host={$config['host']};port={$config['port']};dbname={$config['database']}"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildDSN()\n\t{\n\t\t$DSN2 = 'firebird:';\n\n\t\t$this->hostname === '' || $DSN2 .= \"dbname={$this->hostname}\";\n\n\t\tif (! empty($this->port) && ctype_digit($this->port))\n\t\t{\n\t\t\t$DSN2 .= \":{$this->port}\";\n\t\t}\n\n\t\t$this->database === '' || $DSN2 .= \":{$this->database}\";\n\n\t\tif (! empty($this->charset))\n\t\t{\n\t\t\t$DSN2 .= \";charset:{$this->charset}\";\n\t\t}\n\n\t\t$this->DSN = rtrim($DSN2);\n\t}", "private function buildDSN()\n {\n return \"mysql:host=$this->host;dbname=$this->dbname;charset=$this->charset\";\n }", "public function getDSN()\n {\n $parameters = [];\n\n if ($this->host) {\n $parameters[] = \"host={$this->host}\";\n }\n\n if ($this->port) {\n $parameters[] = \"port={$this->port}\";\n }\n\n if (!$this->host && $this->unixSocket) {\n $parameters[] = \"unix_socket={$this->unixSocket}\";\n }\n\n if ($this->database) {\n $parameters[] = \"dbname={$this->database}\";\n }\n\n if ($this->charset) {\n $parameters[] = \"charset={$this->charset}\";\n }\n\n $parameters = implode(';', $parameters);\n return \"mysql:{$parameters}\";\n }", "public function __toString()\n {\n $domain = '';\n $domain .= $this->scheme ? $this->scheme . '://' : '';\n $domain .= $this->hostname;\n if ($this->port !== null) {\n switch ($this->scheme) {\n case 'http':\n $domain .= ($this->port !== 80 ? ':' . $this->port : '');\n break;\n case 'https':\n $domain .= ($this->port !== 443 ? ':' . $this->port : '');\n break;\n default:\n $domain .= (isset($this->port) ? ':' . $this->port : '');\n }\n }\n return $domain;\n }", "private function create_connection_string(): string\n\t{\n\t\t/**\n\t\t * Connection protocol\n\t\t * String: 'mongodb://'.\n\t\t */\n\t\t$result = $this->protocol;\n\n\t\t/**\n\t\t * Username and password.\n\t\t * String: 'user:password@'.\n\t\t */\n\t\tif ($this->auth === TRUE && $this->user_name != '')\n\t\t{\n\t\t\t$result .= $this->user_name;\n\n\t\t\tif ($this->user_password != '')\n\t\t\t{\n\t\t\t\t$result .= \":{$this->user_password}\";\n\t\t\t}\n\n\t\t\t$result .= '@';\n\t\t}\n\n\t\t/**\n\t\t * Hosts and ports list.\n\t\t * String: 'localhost:port[,localhostN:portN]'.\n\t\t */\n\t\tif (!empty($this->hosts) && !empty($this->ports))\n\t\t{\n\t\t\t$hosts_length = count($this->hosts);\n\t\t\t$comma = '';\n\n\t\t\tfor ($i = 0; $i < $hosts_length; $i++)\n\t\t\t{\n\t\t\t\tif (isset($this->hosts[$i]) && $this->hosts[$i] != '')\n\t\t\t\t{\n\t\t\t\t\t$result .= \"{$comma}{$this->hosts[$i]}\";\n\n\t\t\t\t\tif (isset($this->ports[$i]) && $this->ports[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$result .= \":{$this->ports[$i]}\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$comma = ',';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Database name.\n\t\t * String: '/database'.\n\t\t */\n\t\tif ($this->auth === TRUE && $this->db_name != '')\n\t\t{\n\t\t\t$result .= \"/{$this->db_name}\";\n\t\t}\n\n\t\treturn $result;\n\t}", "abstract protected function _createDsn(array $params);", "private static function _prepareDsnString() : string\n {\n return sprintf(\n \"%s:host=%s;dbname=%s;charset=%s\",\n static::$_config['driver'],\n static::$_config['host'],\n static::$_config['database'],\n static::$_config['charset']\n );\n }", "function ddns4generate($inf, $phyinf, $ddnsp)\n{\n\t$stsp = XNODE_getpathbytarget(\"/runtime\", \"inf\", \"uid\", $inf, 0);\n\n\t/* Get the network info. */\n\t$addrtype\t= query($stsp.\"/inet/addrtype\");\n\tif ($addrtype == \"ipv4\")\t$ipaddr = query($stsp.\"/inet/ipv4/ipaddr\");\n\telse\t\t\t\t\t\t$ipaddr = query($stsp.\"/inet/ppp4/local\");\n\n\t/* Get the DDNS service index*/\n\tanchor($ddnsp);\n\t$provider\t= query(\"provider\");\n\t$username\t= get(\"s\", \"username\");\n\t$password\t= get(\"s\", \"password\");\n\t$hostname\t= get(\"s\", \"hostname\");\n\t$interval\t= get(\"s\", \"interval\");\n\tif ($provider == \"IOBB\")\n\t{\n\t\t$model\t\t= query(\"/runtime/device/modelname\");\n\t\t$hostname\t= $hostname.\".iobb.net\";\n\t\tif($interval==\"\")\t$interval\t= 14400; /* 10 days */\n\t\t$useragent\t= iobb_user_agent($model);\n\t}\n\telse\n\t{\n\t\t$vendor\t\t= query(\"/runtime/device/vendor\");\n\t\t$model\t\t= query(\"/runtime/device/modelname\");\n\t\tif($interval==\"\")\t$interval\t= 21600; /* 15 days */\n\t\t$useragent\t= '\"'.$vendor.' '.$model.'\"';\n\t}\n\n\tset($stsp.\"/ddns4/valid\",\t\t\"1\");\n\tset($stsp.\"/ddns4/provider\",\t$provider);\n\t$cmd = \"susockc /var/run/ddnsd.susock DUMP \".$provider;\n\tsetattr($stsp.\"/ddns4/uptime\",\t\"get\", $cmd.\" | scut -p uptime:\");\n\tsetattr($stsp.\"/ddns4/ipaddr\",\t\"get\", $cmd.\" | scut -p ipaddr:\");\n\tsetattr($stsp.\"/ddns4/status\",\t\"get\", $cmd.\" | scut -p state:\");\n\tsetattr($stsp.\"/ddns4/result\",\t\"get\", $cmd.\" | scut -p result:\");\n\n\t$set = 'SET '.$provider.' \"'.$ipaddr.'\" \"'.$username.'\" \"'.$password.'\" \"'.$hostname.'\" '.$interval;\n\t/* start the application */\n\tfwrite(\"a\",$_GLOBALS[\"START\"],\n\t\t'event DDNS4.'.$inf.'.UPDATE add \"susockc /var/run/ddnsd.susock UPDATE '.$provider.'\"\\n'.\n\t\t'susockc /var/run/ddnsd.susock USERAGENT '.$useragent.'\\n'.\n\t\t'susockc /var/run/ddnsd.susock '.$set.'\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/valid 1\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/provider '.$provider.'\\n'.\n\t\t'exit 0\\n');\n\n\tfwrite(\"a\", $_GLOBALS[\"STOP\"],\n\t\t'event DDNS4.'.$inf.'.UPDATE add true\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/valid 0\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/provider \"\"\\n'.\n\t\t'susockc /var/run/ddnsd.susock DEL '.$provider.'\\n'.\n\t\t'exit 0\\n');\n}", "public function toString() {\n return $this->getClassName().'('.$this->name.' ttl '.$this->ttl.' '.$this->address->toString().')';\n }", "public function toString(): string\n {\n if ($this->isSingleHost()) {\n return $this->addrStr;\n } else {\n return $this->toCidrString();\n }\n }", "public function getDns01() : string\n {\n return $this->getValue('nb_domain_zone_dns_01');\n }", "public function toString()\n\t{\n\t\t$checksum = Hash::ripemd160($this->addy);\n\t\t$this->addy = Buffertools::concat($this->addy, $checksum->slice(0, 4));\n\t\treturn $this->address_prefix . Base58::encode($this->addy);\n\t}", "private static function assemble_url() {\n\t\t$nerdpress_options = get_option( 'blog_tutor_support_settings' );\n\t\t$cloudflare_zone = $nerdpress_options['cloudflare_zone'];\n\t\tif ( $cloudflare_zone === 'dns1' ) {\n\t\t\tself::$cloudflare_zone = 'cc0e675a7bd4f65889c85ec3134dd6f3';\n\t\t} elseif ( $cloudflare_zone === 'dns2' ) {\n\t\t\tself::$cloudflare_zone = 'c14d1ac2b0e38a6d49d466ae32b1a6d7';\n\t\t} elseif ( $cloudflare_zone === 'dns3' ) {\n\t\t\tself::$cloudflare_zone = '2f9485f19471fe4fa78fb51590513297';\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\treturn self::$cloudflare_api_url . self::$cloudflare_api_version . self::$cloudflare_zones_directory . self::$cloudflare_zone . '/';\n\t}", "protected function getHostDns(array $config)\n {\n // Treat host option as array of hosts\n $hosts = is_array($config['host']) ? $config['host'] : [$config['host']];\n $ssl = isset($config['ssl']) ? $config['ssl'] : true;\n\n foreach ($hosts as &$host) {\n // Check if we need to add a port to the host\n if (strpos($host, ':') === false && !empty($config['port'])) {\n $host = $host . ':' . $config['port'];\n }\n }\n\n $host = implode(',', $hosts);\n\n return $ssl\n ? 'https://' . $host\n : 'http://' . $host;\n }", "function build_dsn($arr) {\n\tglobal $dev;\n\tif($dev) $arr['db_host'] = ip_trans($arr['db_host']);\n\n\tif(count($arr)==5) {\n\t\t$dsn = $arr['db_type'].'://'.$arr['db_user'].':'.$arr['db_pass'].'@'.$arr['db_host'].'/'.$arr['db_name'];\n\t} else {\n\t\t$dsn = FALSE;\n\t}\n\n\treturn $dsn;\n}", "public static function getDSN(): string\n {\n if (IS_WINDOWS) {\n\t\t\treturn \"sqlsrv:server=\" . self::HOST . \"; Database=\" . self::DATABASE;\n\t\t}\n \n return \"dblib:host=\" . self::HOST . \";dbname=\" . self::DATABASE;\n }", "public function dsn(): string;", "protected function getDnsString(array $config)\n {\n return $config['host'];\n }", "public function __toString() {\n return \"Host :\" . $this->host .\n \", Username :\" . $this->username .\n \", Password :\" . $this->password .\n \", Database :\" . $this->database;\n }", "function BuildConnectionString() {\n\t\t\textract($this->_databaseConnectionProperties);\n\t\t\t// Build and return an ADO connection string\n\t\t\treturn ($port == NULL) ? $type . '://' .\n\t\t\t\t$username . ':' . $password . '@' . $hostname . '/' .\n\t\t\t\t$database : $type . '://' . $username . ':' . $password .\n\t\t\t\t'@' . $hostname . ':' . $port . '/' . $database;\n\t\t}", "private function createDsn(string $dbtype, \\stdClass $params): string\n\t{\n\t\t$pairs = [];\n\n\t\tif ( ! empty($params->database))\n\t\t{\n\t\t\t$pairs[] = implode('=', ['dbname', $params->database]);\n\t\t}\n\n\t\t$skip = [\n\t\t\t'name' => 'name',\n\t\t\t'pass' => 'pass',\n\t\t\t'user' => 'user',\n\t\t\t'type' => 'type',\n\t\t\t'prefix' => 'prefix',\n\t\t\t'options' => 'options',\n\t\t\t'database' => 'database',\n\t\t\t'alias' => 'alias'\n\t\t];\n\n\t\tforeach($params as $key => $val)\n\t\t{\n\t\t\tif (( ! array_key_exists($key, $skip)) && ! empty($val))\n\t\t\t{\n\t\t\t\t$pairs[] = implode('=', [$key, $val]);\n\t\t\t}\n\t\t}\n\n\t\treturn strtolower($dbtype) . ':' . implode(';', $pairs);\n\t}", "public function getDsn();", "public function getCanonicalAddress(): string\n {\n if ($this->ipVersion == 4) {\n return $this->addrStr;\n }\n\n $fields = explode(':', $this->getExpandedAddress());\n $fields[] = ''; // auxiliary sentinel\n\n // compute the longest zero sequence\n $lzsStart = -1;\n $lzsLen = 1; // so that only sequences of length at least 2 are considered\n $czsStart = null;\n $czsLen = 0;\n foreach ($fields as $i => $field) {\n if ($field === '0000') {\n if ($czsStart === null) {\n $czsStart = $i;\n $czsLen = 1;\n } else {\n $czsLen++;\n }\n } else {\n if ($czsStart !== null) {\n if ($czsLen > $lzsLen) {\n $lzsStart = $czsStart;\n $lzsLen = $czsLen;\n }\n $czsStart = null;\n }\n }\n }\n\n $result = '';\n if ($lzsStart == 0) {\n $result .= ':';\n }\n for ($i = 0; $i < 8; $i++) {\n if ($i > 0) {\n $result .= ':';\n }\n if ($i == $lzsStart) {\n $i += $lzsLen - 1;\n continue;\n }\n $result .= (ltrim($fields[$i], '0') ? : '0');\n }\n if ($lzsStart + $lzsLen == 8) {\n $result .= ':';\n }\n return $result;\n }", "function stringify() {\n return $this->Name.' '.$this->Addressln1;\n }", "public function getDNIS();", "public function toString() {\n return $this->getClassName().'('.$this->name.' ttl '.$this->ttl.' '.$this->flags.': \"'.$this->service.'\" \"'.$this->regex.'\" \"'.$this->replacement.'\", order= '.$this->order.' pref= '.$this->pref.');';\n }", "private function makeRequestString(string $domain): string\n {\n return $domain . \"\\r\\n\";\n }", "public function toString() : string\n {\n $string = 'ORG:';\n $string .= $this->getName() . ';';\n $string .= $this->getDepartment();\n\n return trim($string);\n }", "protected function getDns(array $config)\n {\n return $this->hasDnsString($config)\n ? $this->getDnsString($config)\n : $this->getHostDns($config);\n }", "protected function generateString()\n\t{\n\t\t// start with the scheme\n\t\t$url = $this->scheme . '://';\n\t\t\n\t\t// user and password\n\t\tif( !empty( $this->user ) )\n\t\t{\n\t\t\t$url .= $this->user;\n\t\t\tif( !empty( $this->pass ) ) $url .= ':'.$this->pass.'@';\n\t\t\telse $url .= '@';\n\t\t}\n\t\t\n\t\t// add the host and path\n\t\t$url .= $this->host . '/';\n\t\t$url .= $this->path;\n\t\t\n\t\t// add the URL-encoded parameters\n\t\tif( !empty( $this->params ) )\n\t\t{\n\t\t\t$url .= '?';\n\t\t\tforeach( $this->params as $f => $v ) $url .= $f . '=' . urlencode( $v ) . '&';\n\t\t\t$url = rtrim( $url, '&' );\n\t\t}\n\t\t\n\t\t// add the anchor if any\n\t\tif( !empty( $this->anchor ) ) $url .= '#' . $this->anchor;\n\t\t\n\t\t$this->url = $url;\n\t\t$this->modified = false;\n\t\treturn $url;\n\t}" ]
[ "0.6956984", "0.6776573", "0.6284228", "0.61135465", "0.5967637", "0.57489365", "0.5730582", "0.5648886", "0.5645777", "0.5614397", "0.5582966", "0.55820614", "0.5532661", "0.55064946", "0.5505786", "0.54997706", "0.5473738", "0.54334605", "0.5427643", "0.542045", "0.5344544", "0.5340686", "0.5295095", "0.5292832", "0.52148247", "0.52079636", "0.5185173", "0.5182225", "0.51789206", "0.5169818" ]
0.6998028
0
Delete the item with the given ID from the given table.
public function deleteItem(string $table, int $id): int { return $this->find($table)->whereEqual('id', $id)->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($table, $id) {\n $sth = $this->prepare(\"DELETE FROM $table WHERE id = $id\");\n $sth->execute();\n }", "public function deleteItem( $id ) {\n\t}", "public function delete( $table, $id ) {\n\t\t$this->last_error = null;\n\n\t\t$this->fetchAll($table);\n\t\t$all = $this->get_last_result();\n\n\t\t$found = false;\n\n\t\tforeach ($all as $key => $row) {\n\t\t\t// Force both to integers. TODO -notes\n\t\t\tif ( isset($row['id']) AND intval($row['id']) === intval($id) ) {\n\t\t\t\tunset($all[$key]);\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( $found ) {\n\t\t\t$this->commit($table, $all);\n\t\t} else {\n\t\t\t$this->last_error = 'ID_NOT_FOUND';\n\t\t}\n\t}", "public static function deleteByID($id) {\n\t\t$sql = \"\n\t\t\tDELETE\n\t\t\tFROM item\n\t\t\tWHERE id = $id \n\t\t\t\";\n\n\t\t// Make a PDO statement\n\t\t$statement = DB::prepare($sql);\n\n\t\t// Execute\n\t\tDB::execute($statement);\n\n\t\theader(\"Location: items.php\");\n\t\texit();\n\t}", "public function remove($table, $id)\n { \n $sql = \"delete from $table WHERE id = '\".$id.\"'\";\n $stmt = $this->pdo->query($sql);\n $deleted = $stmt->execute(); \n }", "private function delete($table, $id) {\r\n\t\t/* connect to mysql database */\r\n\t\t$this->connect();\r\n\t\t\r\n\t\t/* make sure that id is an integer */\r\n\t\tif(!settype($id, \"int\")) {\r\n\t\t\tthrow new Exception(\"Entry id is no integer.\");\r\n\t\t}\r\n\r\n\t\t/* escape special chars in parameters */\r\n\t\t$escapedTable = mysql_real_escape_string($table);\r\n\r\n\t\t/* mysql query to delete entry */\r\n\t\t$query = \"DELETE FROM \".$escapedTable.\" WHERE id = '\".$id.\"'\";\r\n\t\t\r\n\t\t/* send mysql query to database */\r\n\t\t$result = mysql_query($query);\r\n\t\r\n\t\t/* disconnect from mysql database */\r\n\t\t$this->disconnect();\r\n\t}", "function delete_element($ID, $table) {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t# TABLE - DELETE ---------------------------------------\n\t$sql = \"DELETE FROM \" . $table . \" WHERE ID = \" . $ID;\n\t$stmt = $dbh->prepare($sql);\n\t$stmt->execute();\n}", "public function delete($table, $id)\n {\n $del = \"DELETE FROM $table WHERE id=:id\";\n $stmt = $this->connect(\"student\")->prepare($del);\n $stmt->bindValue(\":id\", $id);\n $exec = $stmt->execute();\n if ($exec) {\n header(\"location:record.php\");\n }\n }", "public function DelItem($tabla, $idItem)\r\n {\r\n\t//echo \"Entrando a delete\";\r\n\tmysql_query(\"DELETE FROM $tabla WHERE $this->ID=$idItem\",$this->con) or die('no se pudo eliminar el item solicitado: ' . mysql_error());\r\n\t//print('\t<center><br><h1>Se ha eliminado el Item Numero: '.$idItem.' de la tabla '.$this->tabla.'</h1><br>\r\n\t\r\n\t//</center> \r\n\t//');\r\n\t\t//echo \"Saliendo de delete \";\r\n\t}", "public static function delete_for_id($id, $user_id, $table)\n {\n $where = array(\"user_id\" => $user_id, \"id\" => $id);\n $result = DatabaseService::delete($table, $where);\n return $result;\n }", "public function deleteDataById($table = null, $id = null){\n $stmt = $this->conn->prepare(\"DELETE FROM \".$table.\" WHERE task_id =\".$id); \n $stmt->execute();\n }", "public function deleteCart($itemID = null, $table = 'cart')\n {\n if ($itemID != null){\n $result = $this->db->con->query(\"DELETE FROM {$table} WHERE itemID = {$itemID}\");\n if ($result){\n header(\"Location:\" . $_SERVER['PHP_SELF']);\n }\n return $result;\n }\n }", "function delete_data($table, $id){\n\n $query = $this->db->delete($table, array('id' => $id));\n\n }", "public function deleteItem($tableName, $id)\n {\n $path = $this->buildPath(static::ITEM_ENDPOINT, [$tableName, $id]);\n $request = $this->performRequest('DELETE', $path);\n return $request;\n }", "public function delete($tableId, $optParams = array())\n {\n $params = array('tableId' => $tableId);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params));\n }", "public function delete($ID);", "public function delete($ID);", "public function delete($ID);", "public abstract function getDelete(Table $table, $item);", "function delete_by_id($table,$id)\n{\n global $db;\n if(tableExists($table))\n {\n $sql = \"DELETE FROM \".$db->escape($table);\n $sql .= \" WHERE id=\". $db->escape($id);\n $sql .= \" LIMIT 1\";\n $db->query($sql);\n return ($db->affected_rows() === 1) ? TRUE : FALSE;\n }\n return NULL;\n}", "public function delete($table);", "public function deleteLove($item_id=null,$table='love'){\n if($item_id != null){\n $result= $this->db->con->query(\"DELETE FROM {$table} WHERE item_id={$item_id}\");\n if($result) {\n header(\"Location:\".$_SERVER['PHP_SELF']);\n\n }\n return $result;\n }\n }", "public function delete(int $id): void\r\n{\r\n \r\n\r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n}", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "public function delete($id){\n\t\t$sql = \"DELETE FROM {$this->table} WHERE {$this->primaryKey} = $id\";\n\t\t$this->db->query($sql);\n\t}", "public function delete( $id );", "function delete_by_id($table,$id)\n{\n global $db;\n if(tableExists($table))\n {\n $sql = \"DELETE FROM \".$db->escape($table);\n $sql .= \" WHERE id=\". $db->escape($id);\n $sql .= \" LIMIT 1\";\n $db->query($sql);\n return ($db->affected_rows() === 1) ? true : false;\n }\n}", "public function deleteItem($item);", "public function delete(Model $model, $id, string $table = null)\n {\n $table = $table ?? $model->table;\n\n unset($this->data[$table][$id]);\n }", "public function deleteById($id);" ]
[ "0.7827379", "0.7518908", "0.75163746", "0.7508031", "0.75033647", "0.7318255", "0.7305653", "0.7305295", "0.71640474", "0.71217865", "0.71070343", "0.7094066", "0.7035627", "0.7031754", "0.70248115", "0.69729906", "0.69729906", "0.69729906", "0.6949397", "0.69197917", "0.69085914", "0.69025534", "0.68855613", "0.68778914", "0.6850121", "0.6845905", "0.6844052", "0.6842696", "0.6834758", "0.6805109" ]
0.81337893
0
Display a listing of the TruckTract.
public function index() { $trucks = TruckTract::paginate(); return TruckTractResource::collection($trucks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $trucks = $this->truck->get();\n\n return view('trucks.index', compact('trucks'))->withTitle('Trucks');\n }", "public function index()\n {\n $this->list_trip();\n }", "public function index()\n {\n $trucks=Truck::all();\n return view ('admin.trucks.index',compact('trucks'));\n }", "public function index()\n {\n $this->authorize('use-permission', 'adm/smartcars/flights');\n\n $flights = Pirep::query()->orderByDesc('created_at')->paginate(50);\n\n return $this->viewMake('adm.smartcars.flights')->with('flights', $flights);\n }", "private function showTicketList()\n {\n $settings = Utils::getPersonalizedSettings($this->db);\n\n /*$user_id = $settings->enable_issues_created_by_me ? \n $settings->enable_issues_created_by_me :\n null;*/\n\n $param = array(\n 'user_id' => null,\n 'source_id' => null,\n 'start' => 0,\n 'size' => 1\n );\n\n $TicketListRenderer = new TicketListRenderer($this->db, $this->template);\n $sql = $this->getTicketListSQL($param);\n//echo $sql;\n $total_ticket = $TicketListRenderer->countTicketList($sql);\n\n $data = array();\n $data['pagger_action_url'] = 'Ticket/ajax_list';\n $data['total_ticket'] = $total_ticket;\n \n $html = $TicketListRenderer->getTicketListView($data);\n \n return $html;\n }", "public function ticketlistAction(){\n\n\t $this->view->session_data = $this->ModelObj->Useconfig;\n\n\t $this->view->ticketdetails = $this->ModelObj->ticketinformation();\n\n\t $this->view->countries = $this->ModelObj->getCountryList();\n\n\t $this->view->helpdeskstatus = $this->ModelObj->getstatuslist(); \n\n\t $this->view->allcustomers = $this->ModelObj->getCustomerList();\n\n\t $this->view->forwarders = $this->ModelObj->getForwarderList();\n\n }", "public function index()\n {\n return $this->truckRepository->getAll();\n }", "public function index()\n {\n /*$trucks = Truck::with(['type', 'brand', 'service', 'owner'])->get();*/\n\n /*echo json_encode($trucks);*/\n return view('maintenance.trucks.index');\n }", "public function index()\n {\n try {\n\n $data = [];\n $data['trucks'] = [];\n\n $data['per_page'] = \\Request::get('per_page') ?: 12;\n\n $qry = Trucks::query();\n\n if(\\Request::has('name'))\n {\n $name = \\Request::get('name');\n $qry->where('name', 'LIKE', \"%$name%\");\n \n }\n\n \n \n $qry->orderBy('id', 'DESC');\n \n \n $trucks = $qry->paginate($data['per_page']);\n \n \n if(isset($trucks) )\n {\n foreach($trucks as $truck)\n {\n $products=[];\n $productdetails = TruckDetail::where('truck_id', $truck->id)->get();\n if(isset($productdetails))\n {\n \n foreach($productdetails as $product)\n {\n $products[]=[\n 'name'=>$product->products->name,\n 'quantity'=>number_format($product->quantity, 0),\n ];\n }\n }\n \n \n $data['trucks'][] = [\n 'id' => $truck->id,\n 'name' => $truck->name,\n 'products' => $products,\n \n \n ];\n }\n }\n \n\n $data['pages'] = $trucks->appends(\\Input::except('page'))->render();\n \n\n return view('accounting/trucks/index', $data);\n \n } catch (ModelNotFoundException $e) {\n \n }\n }", "public function travelListing() {\n\t\t$pageTitle = 'Travel Listing';\n\t\t$this->viewBuilder()->setLayout('homelayout');\n\t\t$this->loadModel('Travels');\n\n\t\t$travels = $this->Travels->find()->where(['Travels.published' => 1])->order(['Travels.created' => 'DESC'])->limit(3)->all();\n\n\t\t$this->set(compact('pageTitle', 'travels'));\n\t}", "public function index()\r\n {\r\n $transfers = Transfer::paginate(10);\r\n return view('backend.transfers.transfers_list', compact('transfers'));\r\n }", "public function lists()\n\t{\n\t\t$this->OnlyAdmin();\n\t\t$info = $this->TicketModel->getList('desc');\n\t\t$this->loadView('views/ticket', array('info'=> $info), true);\n\t}", "public function index()\n {\n $trades = Trade::all();\n $active = \"trades\";\n return view(\"admin.trades.index\", compact(\"trades\", \"active\"));\n }", "public function showTrails()\n {\n return $this->load->model('Trail')->fetchTrails();\n }", "public function ListaTravels()\n\t{\t\n\t\t$filter = DataFilter::source(new Travels);\n\t\t/*Header*/\n $filter->link('travels/create', 'Crear Nuevo', 'TR');\n /*Header*/\n\n\t\t$filter->attributes(array('class'=>'form-inline'));\n\t\t$filter->add('name','Buscar por Nombre', 'text');\n\t\t$filter->add('code','Buscar por Código', 'text');\n\t\t$filter->submit('Buscar');\n\t\t$filter->reset('Limpiar');\n\n\t\t$grid = DataGrid::source($filter);\n $grid->attributes(array(\"class\"=>\"table table-striped\"));\n $grid->add('name','Nombre', true);\n $grid->add('code','Código', true);\n $grid->add('viaticum','Viático', true);\n $grid->add('hotel','Hotel', true);\n $grid->add('gasoline','Pasaje/Bencina', true);\n $grid->add('taxi','Pasajes/Taxi', true);\n $grid->add('km','Kilometros', true);\n $grid->edit(url().'/travels/edit', 'Editar/Borrar','modify|delete'); \n $grid->paginate(10);\n\n\t\treturn view('travels/lista', compact('filter', 'grid'));\n\t}", "public function index()\n {\n $baseTCs = BaseTestCenter::paginate(10);\n\n return view('baseTCFolder/baseTC')->with(compact('baseTCs'));//->with($APP_URL);\n }", "public function indexAction() {\n $this->view->tribes = $this->_tribes->getTribesList();\n }", "public function index()\n {\n return view('admin.pages.truck-model.index', [\n \"truckModelCategories\" => TruckModelCategory::with('truckBrandCategory')->paginate(10)\n ]);\n }", "public function actionTCIs()\n\t{\n\t\tif (ctype_digit(@$_GET['page'])) $this->page = $_GET['page'];\n\t\t$this->renderPartial('_list',array('operations'=>$this->getTransportList($_GET)));\n\t}", "public function index()\n {\n $trips = Trip::paginate(30);\n \n // Check if there are any trips available currently\n if (empty($trips)){\n return view('trips.index', [\"No trips available at this time\"]); \n }if (!empty($trips)){\n return view('trips.index', ['trips' => $trips]);\n }\n }", "public function index()\n\t{\n\t\tView::share('title', 'ThinkClosing - Tours');\n\t\tif ( !Auth::user()->isAdmin() ) {\n\t\t\t$tours = Tour::where('user_id', '=', Auth::user()->id)\n\t\t\t\t->paginate(10);\n\t\t} else {\n\t\t\t$tours = Tour::where('id', '>', 0)->paginate(10);\n\t\t}\n\t\treturn View::make('tours.index', array('tours' => $tours));\n\t}", "public function show(Tramites $tramites)\n {\n //\n }", "public function index()\n {\n $tours = $this->tour->orderBy('updated_at')->get();\n return view('admin.tours.index',compact('tours'));\n }", "public function show(Truck $truck)\n { $suppliers = Supplier::all();\n return view ('admin.trucks.show',compact('truck','suppliers'));\n }", "public function fetchAllTutors()\n {\n $districts = ServiceDistrict::all();\n $mediums = ServiceMediumCategory::all();\n\n $tutorusers = TutorInfo::orderBy('is_premium','desc')->with('getuser')->paginate(15);\n\n // dd($tutorusers);\n\n return view('tutorlist', compact('tutorusers', 'districts', 'mediums'));\n }", "public function index()\n {\n $towns = Town::all();\n\n return view('town/list', ['towns' => $towns]);\n }", "public function index()\n {\n $tariffs = Tariff::orderby('id','desc')->get();\n return view('admin.tarif.index',compact('tariffs'));\n }", "public function index()\n {\n $tims = Tim::all();\n return view('list_tim',compact('tims'));\n }", "public function index()\n { \n $tours = ($this->tour->all());\n return view('tours.all_tours',compact('tours'));\n }", "public function index()\n {\n return TicketResource::collection(Ticket::paginate(10));\n }" ]
[ "0.71402544", "0.70936733", "0.6832219", "0.65987897", "0.6581558", "0.65438527", "0.65164286", "0.6435593", "0.6414053", "0.6406541", "0.6336649", "0.630922", "0.63084567", "0.6297165", "0.6291562", "0.6238374", "0.62378734", "0.6204616", "0.6202351", "0.61984456", "0.61959845", "0.618266", "0.61797893", "0.6166967", "0.61298263", "0.6116755", "0.61160225", "0.60814625", "0.60713464", "0.6066318" ]
0.77375305
0
Store a newly created TruckTract in storage.
public function store(TruckTractRequest $request) { $truck = TruckTract::make($request->all()); $truck->carrier_id = $request->carrier_id; // $truck->device_id = $request->device_id; $truck->save(); $truck->assignDevice(Device::findOrFail($request->device_id)); return TruckTractResource::make($truck); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(TruckRequest $request)\n {\n $this->truck->create($request->all());\n return redirect('trucks')->with([\n 'flash_message' => 'A new truck has been created!',\n ]);\n }", "public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n tray::updateOrCreate([\n// 'agency_id' => $this->agency_id,\n// 'state_id' => $this->state_id,\n 'name' => $this->name,\n 'logo' => $this->logo,\n 'email' => $this->email,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'address' => $this->address,\n 'facebook' => $this->facebook,\n 'instagram' => $this->instagram,\n 'youtube' => $this->youtube,\n 'viber' => $this->viber,\n 'whatsapp' => $this->whatsapp,\n 'url' => $this->url,\n ]);\n $this->exampleModal = false;\n session()->flash('message',\n $this->tray_id ? 'Tray Updated Successfully.' : 'Tray Created Successfully.');\n\n $this->resetInputFields();\n }", "public function store()\n\t{\n $sistema_id=Session::get('tenant_id');\n $sistema=Sistema::findOrFail($sistema_id);\n $data=$this->request->all();\n if((Input::get('tablet_id')==\"\")||($data['idUnicoTablet']!=\"\")) {\n $rules = array(\n 'idUnicoTablet' => 'required|unique:tablets,idUnicoTablet',\n 'description' => 'required'\n );\n $this->validate($this->request, $rules);\n $tablet=new Tablet($data);\n $tablet->save();\n $tablet_id=$tablet->id;\n $sistema->tablets()->attach($tablet_id);\n }else{\n $sistema->tablets()->sync(Input::get('tablet_id'));\n }\n\n\n\n\n\n return \\Redirect::route('admin.tablets.index');\n\t}", "public function store()\n {\n $this->storeKeys();\n }", "public function store()\n {\n $this->validate(request(), [\n 'subject' => 'required',\n 'content' => 'required',\n 'priority_id' => 'required',\n ]);\n\n $newTicketRequest = request()->only('subject', 'content', 'priority_id');\n\n $newTicket = array_merge(\n $newTicketRequest,\n ['ticket_number' => app(UniqueIDGeneration::class)->generate()]\n );\n\n $ticket = $this->ticket->create($newTicket);\n\n $ticketData = fractal($ticket, new TicketTransformer)->toArray();\n $ticketData['success'] = \"You have created a new Ticket!\";\n\n return $ticketData;\n }", "public function store(Request $request)\n {\n try {\n $trucks = new Truck();\n $trucks->user_id = Sentinel::getUser()->id;\n $trucks->weight = Input::get('weight');\n $trucks->length = Input::get('length');\n $trucks->height = Input::get('height');\n $trucks->type = Input::get('lorry_type');\n $trucks->plate = Input::get('plate');\n $trucks->location = Input::get('location');\n $trucks->location_lat = Input::get('location_lat');\n $trucks->location_lng = Input::get('location_lng');\n $trucks->destination = Input::get('destination');\n $trucks->destination_lat = Input::get('destination_lat');\n $trucks->destination_lng = Input::get('destination_lng');\n $trucks->description = Input::get('description');\n $trucks->status = 0;\n $trucks->valid_until = Input::get('valid_until');\n $trucks->save();\n\n return redirect()->route('trucks.index')->with('success', 'The Truck has been listed successfully!');\n\n } catch (Exception $ex) {\n return redirect()->back()->with('error', $ex->getMessage());\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\n\t{\n\t\t$travelPlan = new Travelplan;\n\n\t\t$travelPlan->agency_id = Input::get(\"agency_id\");\n\t\t$travelPlan->location_id = Input::get(\"location_id\");\n\t\t$travelPlan->destination_id = Input::get(\"destination_id\");\n\t\t$travelPlan->price = Input::get(\"price\");\n\n\t\t$pickup_date = Input::get(\"pickup_date\");\n\t\t$travel_date = Carbon::parse($pickup_date);\n\t\t$date_formatted = $travel_date->toFormattedDateString();\n\t\t$travel_date = $travel_date->toDateString();\n\t\t$travelPlan->pickup_date = $travel_date;\n\t\t\n\t\t\n\n\t\t$travelPlan->pickup_time = Input::get(\"pickup_time\");\n\t\t$travelPlan->pickup_location = Input::get(\"pickup_location\");\n\t\t$travelPlan->dropoff_location = Input::get(\"dropoff_location\");\n\n\t\tif($travelPlan->save())\n\t\t{\n\t\t\t// Store the activity\n\t\t\t$activity = new Activity;\n\t\t\t$activity->type = \" Add New Travel Plan \";\n\t\t\t$activity->details = \"Travel Plan From \".$travelPlan->location_id.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\" To \".$travelPlan->destination_id.\" By Agency \".$travelPlan->agency_id.\" Added \";\n\t\t\t$activity->activity_by = Auth::user()->fullName;\n\t\t\t$activity->save();\n\n\t\t\treturn Redirect::to(\"/admin/travelplan\");\n\t\t}\n\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 {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "public function store()\n {\n try {\n if (!request()->isJson()) {\n return $this->response->unauthorized();\n }\n\n $validate = $this->validateData(request()->all());\n\n if ($validate->fails()) {\n return $this->response->exception($validate->errors());\n }\n\n $ticket = new Ticket();\n\n $code = $this->findCurrentCorrelative(request()->course_registered_user_id);\n\n $ticket->course_registered_user_id = request()->course_registered_user_id;\n $ticket->type_ticket_id = request()->type_ticket_id;\n $ticket->status_ticket_id = request()->status_ticket_id;\n $ticket->source_ticket_id = request()->source_ticket_id;\n $ticket->priority_ticket_id = request()->priority_ticket_id;\n $ticket->motive_ticket_id = request()->motive_ticket_id;\n $ticket->ticket_code = $this->createTicketCode($code, 1);\n $ticket->user_create_id = auth()->id();\n $ticket->user_assigned_id = request()->user_assigned_id;\n\n\n if (isset(request()->closing_date)) {\n $ticket->closing_date = Carbon::now()->format('Y-m-d H:i:s');\n }\n\n $ticket->save();\n\n return $this->response->success($ticket->fresh()->format());\n } catch (\\Exception $exception) {\n return $this->response->exception($exception->getMessage());\n }\n }", "public function store()\n\t {\n\t //\n\t }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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.6490029", "0.63749796", "0.5999158", "0.59943354", "0.59498346", "0.59220546", "0.5876626", "0.5869118", "0.58626074", "0.58626074", "0.58626074", "0.58602726", "0.5850313", "0.581576", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185", "0.5803185" ]
0.71762973
0
Display the specified TruckTract.
public function show($truckTract) { $truckTract = TruckTract::with([ 'device', 'carrier', 'currentOperator', 'operators', ])->findOrFail($truckTract); $truckTract->position = $truckTract->getLocation(); return TruckTractResource::make($truckTract); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Truck $truck)\n { $suppliers = Supplier::all();\n return view ('admin.trucks.show',compact('truck','suppliers'));\n }", "public function show(Trabalho $trabalho)\n {\n //\n }", "public function show(TrangThais $trangThais)\n {\n //\n }", "public function show(PrefacturaTratamiento $prefacturaTratamiento)\n {\n //\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function show(Tank $tank)\n {\n //\n }", "public function show(Tramites $tramites)\n {\n //\n }", "public function show(ct $ct)\n {\n //\n }", "public function show(Tvrtka $tvrtka)\n {\n //\n }", "public function show(TruckModelCategory $truckModelCategory)\n {\n //\n }", "public function show(Tariff $tariff)\n {\n //\n }", "public function show(Tivy $tivy)\n {\n //\n }", "public function show($ticket)\n {\n\n $ticket = Ticket::find($ticket);\n if ($ticket == null) {\n return redirect()->back()->with('flash_error', 'Entered Ticket ID not found');\n } else if ($ticket->paid == 0) {\n return redirect()->back()->with('flash_error', 'Entered Ticket ID not yet paid');\n }\n $schedule = Schedule::find($ticket->schedule_id);\n\n $route = Route::find($schedule->route_id);\n //print_r($route->title); exit;\n return view('admin.ticket.print', compact('ticket', 'route', 'schedule'));\n }", "public function show(accidentsTravail $accidentsTravail)\n {\n //\n }", "public function show(Trip $trip)\n {\n //\n }", "public function show($id)\n {\n $truck = Truck::findOrFail($id);\n\n return view('maintenance.trucks.show')->with(compact('truck'));\n }", "public function show(Ticket $ticketid)\n {\n }", "public function show(Transcation $transcation)\n {\n //\n }", "public function show($id)\n {\n try {\n $result = Truck::where('id', $id)->first();\n return view('admin.truck.show', compact('result'));\n } catch (Exception $ex) {\n return redirect()->back()->with('error', $ex->getMessage());\n }\n }", "function display($tpl = null)\n\t{\n\t\t$this->Item=$this->get('Item');\n\t\t\n//\t\techo \"<pre>\" . var_dump($this->Item) . \"</pre>\";\n\t\t$tour=new TournamentHelper();\n\t\t\t\n\t\tif (isset($this->Item[\"tournament\"][\"id\"]))\n\t\t{\n\t\t\t$tour->tournament=$this->Item[\"tournament\"];\n\t\t\t$tour->player=$this->Item[\"player\"];\n\t\t\t$tour->result=$this->Item[\"result\"];\n\t\t\t$tour->head=$this->Item[\"tournament\"]['event'];\n\t\t\t$this->table=$tour->displayTable(999);\n\t\t}\n\t\tparent::display($tpl);\n\t}", "public function show(TripCategory $tripCategory)\n {\n //\n }", "public function show(Remittance $remittance)\n {\n //\n }", "public function show(vehicle $vehicle)\n {\n //\n }", "public function show( Track $track )\n {\n //\n }", "public function show(Courier $courier)\n {\n //\n }", "public function show(Btc $btc)\n {\n //\n }", "public function show(Train $train)\n {\n //\n }", "public function show(Ticker $obj)\n {\n //\n $client = ApiClientFactory::createApiClient();\n $historicalData = $client->getHistoricalData($obj->yahoo_symbol, ApiClient::INTERVAL_1_DAY, new \\DateTime(\"-200 days\"), new \\DateTime(\"today\"));\n $quote = $client->getQuote($obj->yahoo_symbol);\n\n return $this->render('show', [ 'obj' => $obj, 'quote' => $quote, 'historicalData' => $historicalData ]);\n }" ]
[ "0.65935713", "0.646115", "0.63360757", "0.62350684", "0.61661786", "0.61661786", "0.61661786", "0.61653084", "0.60601985", "0.6017543", "0.5956707", "0.59503114", "0.5949913", "0.5938541", "0.5911221", "0.5910519", "0.5909354", "0.5829214", "0.5758991", "0.5716774", "0.57105017", "0.5696456", "0.5690102", "0.5688141", "0.5661689", "0.5660646", "0.5645741", "0.5645113", "0.5641415", "0.5640079" ]
0.6662086
0
Update the specified TruckTract in storage.
public function update(TruckTractRequest $request, $truckTract) { $truckTract = TruckTract::findOrFail($truckTract); $truckTract->carrier_id = $request->carrier_id; $truckTract->assignDevice(Device::findOrFail($request->device_id)); $truckTract->update($request->all()); $truckTract->save(); return TruckTractResource::make($truckTract); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, Truck $truck)\n {\n $truck->update($request->all());\n $truck->save();\n\n return back()->with('success','Item update successfully!');\n }", "public function updated(Ticket $ticket)\n {\n //\n }", "public function update(Request $request, $id)\n {\n\n try {\n $trucks = Truck::where('id', $id)->first();\n $trucks->weight = Input::get('weight');\n $trucks->length = Input::get('length');\n $trucks->height = Input::get('height');\n $trucks->type = Input::get('lorry_type');\n $trucks->plate = Input::get('plate');\n $trucks->location = Input::get('location');\n $trucks->location_lat = Input::get('location_lat');\n $trucks->location_lng = Input::get('location_lng');\n $trucks->destination = Input::get('destination');\n $trucks->destination_lat = Input::get('destination_lat');\n $trucks->destination_lng = Input::get('destination_lng');\n $trucks->description = Input::get('description');\n $trucks->valid_until = Input::get('valid_until');\n $trucks->save();\n\n return redirect()->route('trucks.index')->with('success', 'The truck has been modified successfully!');\n } catch (Exception $ex) {\n return redirect()->back()->with('error', $ex->getMessage());\n }\n\n// $table->integer('user_id')->unsigned();\n// $table->integer('status')->unsigned();\n// $table->string('weight', 50);\n// $table->string('length', 50);\n// $table->string('height', 50);\n// $table->string('type', 50);\n// $table->string('plate', 15);\n// $table->string('location', 255);\n// $table->string('description', 255);\n\n }", "public function update(Request $request, $id)\n {\n DB::beginTransaction();\n\n $truck = Truck::findOrFail($id);\n\n $truck->update($request->all());\n $truck->status_mileage = $truck->statusMileage();\n $truck->save();\n\n $truck->updateSubparts();\n\n\n if($truck){\n DB::commit();\n return back()->with('success', 'La información del tractor se ha guardado correctamente.');\n }else{\n DB::rollBack();\n return back()->with('error', 'Ocurrió un problema al guardar la información del tractor.');\n }\n }", "public function update(TruckRequest $request, $id)\n {\n $this->truck->findOrFail($id)->update($request->all());\n return redirect('trucks')->with([\n 'flash_message' => 'You have updated tour truck!'\n ]);\n }", "public function updated(Flight $flight)\n {\n //\n }", "public function update(Request $request, TypeTrucks $typeTrucksб, $id)\n {\n\n $type = TypeTrucks::find((int)$id);\n $type->val = $request->val;\n $type->update();\n return redirect()->route('types.index');\n }", "public function update() {\n\t\tTournamentDBClient::update($this);\n\t}", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function update(Request $request, $locale, Truck $truck)\n {\n $this->validate($request, [\n \"image\" => \"nullable|file\",\n \"truck_category_id\" => \"required|exists:truck_categories,id\",\n \"license\" => \"nullable|file\",\n \"truck_no\" => \"required|string\",\n ]);\n\n $data = [\n \"truck_category_id\" => $request->truck_category_id,\n \"truck_no\" => $request->truck_no,\n \"is_valid\" => 0,\n ];\n\n if ($request->hasFile('image')) {\n if (Storage::disk(\"local\")->exists($truck->image)) {\n Storage::disk(\"local\")->delete($truck->image);\n }\n $data[\"image\"] = Storage::disk(\"local\")->put(\"images\\\\truck\\\\image\", $request->image);\n }\n\n\n if ($request->hasFile('license')) {\n if (Storage::disk(\"local\")->exists($truck->license)) {\n Storage::disk(\"local\")->delete($truck->license);\n }\n $data[\"license\"] = Storage::disk(\"local\")->put(\"images\\\\truck\\\\license\", $request->license);\n }\n $truck->fill($data);\n if ($truck->save()) {\n Toastr::success(\"Truck Updated Successfully\", \"Success\");\n } else {\n Toastr::error(\"Something Went Wrong!\", \"Error\");\n }\n return redirect()->route(\"driver.truck.show\");\n }", "public function update(Request $request, Tvrtka $tvrtka)\n {\n //\n }", "public function store(TruckTractRequest $request)\n {\n $truck = TruckTract::make($request->all());\n $truck->carrier_id = $request->carrier_id;\n// $truck->device_id = $request->device_id;\n\n $truck->save();\n $truck->assignDevice(Device::findOrFail($request->device_id));\n\n return TruckTractResource::make($truck);\n }", "public function update(Request $request, Trip $trip)\n {\n //\n }", "public function updated(FormPettyCash $formPettyCash)\n {\n if (\n $formPettyCash->is_confirmed_pic && $formPettyCash->is_confirmed_manager_ops &&\n ($formPettyCash->status_id == 1)\n ) {\n $formPettyCash->status_id = 2;\n $formPettyCash->save();\n }\n\n if (\n $formPettyCash->isDirty('is_confirmed_cashier')\n ) {\n // Update number\n $day = str_pad(Carbon::now()->day, 2, '0', STR_PAD_LEFT);\n $month = str_pad(Carbon::now()->month, 2, '0', STR_PAD_LEFT);\n $year = Carbon::now()->year;\n $count = FormPettyCash::where(function ($query) {\n $query->where('is_confirmed_cashier', 1);\n $query->whereDate('date', Carbon::now()->toDate());\n })->count() + 1;\n $count = str_pad($count, 2, '0', STR_PAD_LEFT);\n $code = \"KK\";\n $number = $code . \".\" . $count . \".\" . $day . $month . $year;\n $formPettyCash->number = $number;\n\n // Decrease budget code balance\n foreach ($formPettyCash->details as $detail) {\n $budgetCode = $detail->budgetCode;\n $budgetCode->balance = $budgetCode->balance - $detail->nominal;\n $budgetCode->save();\n $budgetCodeService = new BudgetCodeService($budgetCode);\n $budgetCodeService->createLog($number, 'kredit', $detail->nominal, $formPettyCash->pic()->first()->id);\n }\n\n // Update status to \"Terbayarkan\"\n $formPettyCash->status_id = 3;\n\n // Update date to now\n $formPettyCash->date = Carbon::now()->toDateString();\n\n $formPettyCash->saveWithoutEvents();\n }\n }", "public function update($tarConvenio);", "public function update(StoreTimeslot $request, $timeslotID){\n $this->isAuthorize();\n\n // Update the Specific Data\n $userID = $this->request->session()->get('userID');\n $timeslot = Apt_time_slot::where('userID','=',$userID)->where('id','=',$timeslotID)->firstOrFail();\n $timeslot->evtID = $request['evtID'];\n $timeslot->agentID = $request['agentID'];\n $timeslot->time_slot = $request['time_slot'];\n $timeslot->slot_duration = $request['slot_duration'];\n $timeslot->save();\n return redirect('appointments/timeslot')->with('status', 'Successfully Time Slot Updated!');\n }", "public function updated(TradeCancel $tradeCancel)\n {\n //\n }", "public function update(Request $request, PrefacturaTratamiento $prefacturaTratamiento)\n {\n //\n }", "public function update(Request $request, Trabalho $trabalho)\n {\n //\n }", "public function updated(Vehicle $vehicle)\n {\n //\n }", "public function update($ticket)\n {\n try {\n if (!request()->isJson()) {\n return $this->response->unauthorized();\n }\n\n if (!is_numeric($ticket)) {\n return $this->response->badRequest();\n }\n\n $ticketModel = Ticket::find($ticket);\n\n if (!isset($ticketModel)) {\n return $this->response->noContent();\n }\n\n $validate = $this->validateData(request()->all());\n\n if ($validate->fails()) {\n return $this->response->exception($validate->errors());\n }\n\n $ticketModel->course_registered_user_id = request()->course_registered_user_id;\n $ticketModel->type_ticket_id = request()->type_ticket_id;\n $ticketModel->status_ticket_id = request()->status_ticket_id;\n $ticketModel->source_ticket_id = request()->source_ticket_id;\n $ticketModel->priority_ticket_id = request()->priority_ticket_id;\n $ticketModel->motive_ticket_id = request()->motive_ticket_id;\n $ticketModel->user_create_id = request()->user_create_id;\n $ticketModel->user_assigned_id = request()->user_assigned_id;\n $ticketModel->version = $ticketModel->version + 1;\n\n if (isset(request()->closing_date)) {\n $ticketModel->closing_date = Carbon::now()->format('Y-m-d H:m:s');\n }\n\n $ticketModel->save();\n\n $logTicket = LogEditingTicket::where('ticket_id', $ticket)->first();\n if (isset($logTicket)) {\n $logTicket->delete();\n }\n\n $ticketModelEdited = Ticket::find($ticket);\n\n return $this->response->success($ticketModelEdited->format());\n } catch (\\Exception $exception) {\n return $this->response->exception($exception->getMessage());\n }\n }", "public function update(Request $request, StockTransfer $stockTransfer)\n {\n $validator = Validator::make(\n $request->all(),\n [\n 'from_location' => 'required',\n 'to_location' => 'required',\n 'status' => 'required',\n ]\n );\n\n if ($validator->fails()) {\n return response()->json(['success' => false, 'error' => $validator->errors()], 422);\n }\n \n DB::beginTransaction();\n try {\n $stockTransfer->to_location = $request->to_location;\n $stockTransfer->status = $request->status;\n $stockTransfer->shipping_cost = $request->shipping_cost;\n $stockTransfer->note = $request->note;\n $stockTransfer->total = $request->total;\n $stockTransfer->updated_by = Auth::user()->id;\n $stockTransfer->save();\n\n //save stock transfer items and transfer stock\n foreach ($request->transfer_items as $item) {\n $existing_item = StockTransferItem::where('stock_transfer_id', $stockTransfer->id)->where('product_id', $item['product_id'])->where('variation_id', $item['variation_id'])->first();\n if ($existing_item) {\n $old_qty = $existing_item->quantity;\n $existing_item->quantity = $item['quantity'];\n $existing_item->unit_id = $item['unit'];\n $existing_item->unit_price = $item['purchase_price'];\n $existing_item->save();\n\n if ($item['quantity'] > $old_qty) {\n $qty = $item['quantity'] - $old_qty;\n $item['quantity'] = $qty;\n } else {\n $qty = $old_qty - $item['quantity'];\n $item['quantity'] = $qty;\n }\n } else {\n StockTransferItem::saveItems($item, $stockTransfer);\n }\n LocationProductStock::increaseProductStock(\n $item['product_id'],\n $item['variation_id'],\n $item['quantity'],\n $stockTransfer['business_id'],\n $stockTransfer['to_location']\n );\n LocationProductStock::decreaseProductStock(\n $item['product_id'],\n $item['variation_id'],\n $item['quantity'],\n $stockTransfer['business_id'],\n $stockTransfer['from_location']\n );\n }\n } catch (\\Exception $e) {\n DB::rollback();\n return response()->json(['success' => false, 'errmsg' => $e->getMessage(), 'line' => $e->getLine()], 500);\n }\n DB::commit();\n }", "public function update(Request $request, $id)\n {\n // return $request->all();\n $validation = Validator::make($request->all(), [\n 'order_id' => 'required',\n 'sub_order_id' => 'required',\n 'trip_id' => 'required',\n 'remarks' => 'sometimes',\n ]);\n\n if($validation->fails()) {\n return Redirect::back()->withErrors($validation)->withInput();\n }\n\n // Insert Sub-Order & Trip\n $suborder_trip = new SuborderTrip();\n $suborder_trip->sub_order_id = $request->sub_order_id;\n $suborder_trip->trip_id = $request->trip_id;\n $suborder_trip->remarks = $request->remarks;\n $suborder_trip->created_by = auth()->user()->id;\n $suborder_trip->updated_by = auth()->user()->id;\n $suborder_trip->save();\n // orderLog($user_id, $order_id, $sub_order_id, $product_id, $ref_id, $ref_table, $text)\n $this->orderLog(auth()->user()->id, $request->order_id, $request->sub_order_id, '', $suborder_trip->trip_id, 'trips', 'Sub-Order uploaded on a trip');\n\n // Update Sub-Order\n $suborderUp = SubOrder::findOrFail($request->sub_order_id);\n $suborderUp->sub_order_status = '6';\n $suborderUp->save();\n // orderLog($user_id, $order_id, $sub_order_id, $product_id, $ref_id, $ref_table, $text)\n $this->orderLog(auth()->user()->id, $suborderUp->order_id, $suborderUp->id, '', auth()->user()->reference_id, 'hubs', 'Sub-Order In Transit');\n\n // Update Order\n $order_due = SubOrder::where('sub_order_status', '!=', '6')->where('order_id', '=', $request->order_id)->count();\n if($order_due == 0){\n $orderUp = Order::findOrFail($request->order_id);\n $orderUp->order_status = '6';\n $orderUp->save();\n\n // orderLog($user_id, $order_id, $sub_order_id, $product_id, $ref_id, $ref_table, $text)\n $this->orderLog(auth()->user()->id, $orderUp->id, '', '', auth()->user()->reference_id, 'hubs', 'All Sub-Order(s) In Transit');\n }\n\n Session::flash('message', \"Sub-Order processed successfully\");\n return redirect('/transfer-suborder');\n\n }", "public function update(Request $request, Trip $trip)\n {\n $trip->details = $request->details;\n $trip->purpose = $request->purpose;\n $trip->start_date = $request->start_date;\n $trip->end_date = $request->end_date;\n $trip->from_province_id = $request->from_province_id;\n $trip->to_province_id = $request->to_province_id;\n $trip->staff_ids = $request->staff_ids;\n $trip->category = $request->category;\n $trip->save();\n\n // Loop through the object of the file inputs group.\n foreach($request->group_inputs as $group) {\n\n // Check if this file input has files to upload.\n if (isset($group['files']) && count($group['files']) > 0) {\n\n // Loop through the file for this category.\n foreach ($group['files'] as $file) {\n\n // Store the files and return the model to be saved.\n $file_obj = $this->store_this_file($group, $file);\n\n // Save the model using the relationship with conference.\n $trip->file_objects()->save($file_obj);\n }\n }\n }\n\n Session::flash('message', [\"Update Successful!\", \"Trip data updated successfully!\", \"success\"]);\n return redirect()->route('trip.show', $trip);\n }", "public function update(Request $request, TurnoOrdenTrabajo $turnoOrdenTrabajo)\n {\n $turnoOrdenTrabajo->update($request->all());\n\n }", "public function update(TutorRequest $request, Tutor $tutor)\n {\n $data = $request->except(['job', 'job_phone', 'city', 'country']);\n $data['city_id'] = $request->city ? $request->city : 26;\n $data['country_id'] = $request->country ? $request->country : 56;\n if($request->hasFile('avatar'))\n {\n $data['avatar'] = $request->avatar->store('public/avatars');\n }\n\n $tutor->person()->update($data);\n\n $data = $request->only(['job', 'job_phone']);\n $tutor->update($data);\n\n Session::flash('success', __('messages.flash.tutor_updated'));\n return redirect()->route('students');\n }", "public function update(Request $request, Tariff $tariff)\n {\n $request->validate([\n 'name' => 'required|array|min:1',\n 'price' => 'required',\n 'icon' => 'required',\n 'detail' => 'required'\n ]);\n if($request->is_active){\n $tariff->is_active =1;\n }\n else{\n $tariff->is_active =0;\n }\n $tariff->name = $request->name;\n $tariff->detail = $request->detail;\n $tariff->type = $request->type;\n $tariff->ministra_id = $request->ministra_id;\n $tariff->price = $request->price;\n $tariff->icon = $request->icon;\n $tariff->save();\n if ($tariff->type == 1) {\n $tariff->default()->sync($request->default);\n }\n\n return redirect()->route('tariff.index')\n ->with('success', 'Tariff successfully updated');\n\n }", "public function update(Request $request, Tarjeta $tarjetum)\n {\n $request->validate([\n 'tipo' => 'required|string|max:20',\n 'num_tarjeta' => 'required|string|digits:16',\n 'banco' => 'required|string|max:50',\n 'nombre' => 'required|string|max:50',\n 'apellido' => 'required|string|max:50',\n 'fecha_exp' => 'required|string|size:5',\n 'codigo' => 'required|string|digits:3'\n ]);\n\n $tarjetum->tipo = $request->tipo;\n $tarjetum->num_tarjeta = $request->num_tarjeta;\n $tarjetum->banco = $request->banco;\n $tarjetum->nombre = $request->nombre;\n $tarjetum->apellido = $request->apellido;\n $tarjetum->fecha_exp = $request->fecha_exp;\n $tarjetum->codigo = $request->codigo;\n\n $tarjetum->save();\n\n return redirect()->route('tarjeta.show', $tarjetum->cliente_id);\n }", "public function actionUpdateTraderInfo()\n {\n TSInit::$app->trader->updateTraderInfo();\n if ($returnUrl = TSInit::$app->request->get('returnUrl')) {\n $this->redirect($returnUrl);\n }\n }", "public function update(Request $request, TripCategory $tripCategory)\n {\n //\n }" ]
[ "0.60088444", "0.58308846", "0.56577337", "0.5644901", "0.5633929", "0.5627734", "0.5593276", "0.5550262", "0.54688907", "0.54444706", "0.54231286", "0.53499293", "0.5326627", "0.5326219", "0.5290117", "0.5262768", "0.52575684", "0.5249012", "0.52451104", "0.5242741", "0.52384377", "0.52321994", "0.52191466", "0.5208402", "0.52065116", "0.5187026", "0.51671743", "0.5164773", "0.51521283", "0.5136144" ]
0.6422644
0
Remove the specified TruckTract from storage.
public function destroy($truckTract) { $truckTract = TruckTract::findOrFail($truckTract); if ($truckTract->delete()) { return response([ 'message' => 'Deleted Succesfully', ]); } return response('error', 422); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Truck $truck)\n {\n\n $truck->delete();\n return back()->with('danger','Item Deleted');\n }", "public function destroy(PrefacturaTratamiento $prefacturaTratamiento)\n {\n //\n }", "public function DBremoveTrack(int $trackid);", "public function destroy(Trabalho $trabalho)\n {\n //\n }", "public function truck()\n {\n return $this->belongsTo('App\\Models\\Truck')->withTrashed();\n }", "public function removeTrade($dbc, $trade)\r\n {\r\n // check if trade is in trades table:\r\n $t = $dbc->real_escape_string(trim($trade));\r\n $q = \"SELECT trade FROM trades WHERE trade = '$t'\";\r\n $r = $dbc->query($q);\r\n if ($r->num_rows == 1) // found trade in table\r\n {\r\n // delete trade\r\n $q = \"DELETE FROM trades WHERE trade = '$t'\";\r\n if ($dbc->query($q) === TRUE) // success\r\n { \r\n // update trades list\r\n $this->updateTradesList($dbc); \r\n return \"Succesfully deleted {$trade} from database.\"; \r\n }\r\n else\r\n {\r\n return \"Error: Database error. Could not delete {$trade} from database.\"; \r\n } \r\n }\r\n else // trade not found.\r\n {\r\n return \"Error: {$trade} cannot be found in trades table\"; \r\n } \r\n }", "public function deleteTorrent($torrentHash) {\n\n\t\t$requestPayload = array(\n\t\t\t\t\"method\" => \"torrent-remove\",\n\t\t\t\t\"arguments\" => array(\"ids\" => array($torrentHash),\n\t\t\t\t\t\t \"delete-local-data\" => true)\n\t\t);\n\n\t\t$jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES);\n\n\t\t$this->transmissionLogger->debug(\"[TRANSMISSION-DELETE-TORRENT] 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-DELETE-TORRENT] The result after deletion is: \". json_encode($result));\n\n\t}", "public function destroy(Travel $travel, Trip $trip)\n {\n $trip->delete();\n return redirect()->back();\n }", "public function destroy(TypeTrucks $typeTrucks,$id)\n {\n $type = TypeTrucks::find((int)$id);\n $type->delete();\n return redirect()->route('types.index');\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function deleteTrash()\n {\n $currentTime = time();\n foreach (self::$cacheData as $key => $item) {\n if ($currentTime >= ($item['time'] + $item['ttl'])) {\n unset(self::$cacheData[$key]);\n }\n }\n }", "public function deleted(Ticket $ticket)\n {\n //\n }", "public function destroy(torrent $torrent)\n {\n\n //торрент успешно загружен\n\n }", "public function remove() {}", "public function remove() {}", "public function destroy($id)\n {\n// echo(1111);exit(); \n //delete a single track by its id\n $track = Tracks::findOrFail($id);\n \n if($track->delete()){\n return $track;\n }\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function destroy(TrangThais $trangThais)\n {\n //\n }", "public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }", "public function destroy(Tariff $tariff)\n {\n $tariff->default()->detach();\n $tariff->delete();\n return redirect()->route('tariff.index')->with('success','Tariff successfully deleted');\n }", "public function destroy(Tarjeta $tarjetum)\n {\n //\n }", "public function destroy(Truckmake $truckmake)\n {\n $truckmake ->delete();\n\n return redirect() ->route('truckmake.index') ->withStatus(__('Truck Make data successfully deleted.'));\n }", "public function destroy(ticket $ticket)\n {\n //\n }", "function destroy()\n\t{\n\t\tunset($this->_tour_voucher_contents);\n\n\t\t$this->_tour_voucher_contents['totals'] = array();\n\t\t$this->_tour_voucher_contents['total_itineraries'] = 0;\n\t\t$this->_tour_voucher_contents['trip_id'] = gINVALID;\n\n\t\t$this->CI->session->unset_userdata('tour_voucher_contents');\n\t}", "public function destroy(Trip $trip)\n {\n $trip->delete();\n Session::flash('message', [\"Insertion Successful!\", \"Trip deleted successfully!\", \"success\"]);\n return redirect()->route('trip.index');\n }", "public function destroy(Tank $tank)\n {\n $tank = Tank::findOrFail($tank->id);\n\n if (!$tank) {\n //return back()->with('error', 'Data not available for delete');\n throw new ModelNotFoundException('Data not available for delete');\n }\n\n try {\n $tank->delete();\n return redirect('/tanks')->with('success', 'Tank Deleted Successfully!');\n } catch (Exception $e) {\n return back()->with('error', $e->getMessage());\n }\n }", "public function remove_tape_from_backupset($tape_id) {\n try {\n $backupset_id = $this->id;\n $find_query = \"SELECT * from tape_library where id=:tape_id and backupset = :backupset_id\";\n $params = array(\"tape_id\"=>$tape_id, \"backupset_id\"=>$backupset_id);\n\n $find_result = $this->db->get_query_result($find_query, $params);\n\n if(count($find_result) == 0) {\n \n return array(\"RESULT\"=>FALSE,\n \"MESSAGE\"=>\"Tape not found.\");\n }\n\n $query = \"UPDATE tape_library set backupset = NULL where id=:tape_id and backupset = :backupset_id\";\n $result = $this->db->get_query_result($query, $params);\n $tape = new tape_library_object($this->db, $tape_id);\n return array(\"RESULT\"=>TRUE,\n \"MESSAGE\"=>\"Tape \".$tape->get_label(). \" successfully removed from backup set \". $this->name . \".\");\n } catch(Exception $e) {\n\n return array(\"RESULT\"=>FALSE,\n \"MESSAGE\"=>$e->getTraceAsString());\n }\n \n }" ]
[ "0.5849269", "0.56892526", "0.5580079", "0.5526605", "0.53841954", "0.5367443", "0.5180308", "0.5162675", "0.516265", "0.5153272", "0.5102052", "0.50834876", "0.5078057", "0.5076086", "0.5075862", "0.50437367", "0.5039052", "0.5039052", "0.5039052", "0.5039052", "0.5037671", "0.50326145", "0.500575", "0.4984148", "0.49769554", "0.4972101", "0.49607062", "0.49417016", "0.4919538", "0.49153787" ]
0.61166745
0
Sets the cache revalidation flag.
public function setRevalidate(bool $value) { $this->revalidate = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCaching(bool $flag)\n {\n $this->cache = $flag;\n }", "function setValidateAgain ($validateAgain) {\r\n $this->_validateAgain = (bool)$validateAgain;\r\n }", "function setCache($cache) {\n if ($cache !== ($oldCache = $this->cache)) {\n $this->cache = (bool) $cache;\n }\n }", "private function setNeedReinitRulesFlag()\n\t{\n\t\tupdate_option(SHORTNAME.'_need_flush_rewrite_rules', '1');\n\t}", "public function cacheInvalidate() {\n }", "public function setWillCacheResult($flag) {\n $this->willCacheResult = $flag;\n }", "public function setValid(bool $flag): self\n {\n $this->valid = $flag;\n if(!$flag){\n $this->flushCache();\n }\n return $this;\n }", "public function setReloadOnUpdate($flag = true)\n {\n $this->reloadOnUpdate = (boolean)$flag;\n }", "public function setCaching($cache);", "public function setCache($cache)\n {\n $this->cache = $cache ? $cache : false;\n }", "public static function invalidate_restriction_cache($rebuild = true) {\n\t\tdelete_transient(self::$ARTICLES_CACHE_KEY);\n\t\tdelete_transient(self::$TOPICS_CACHE_KEY);\n\t}", "public static function setCleanCacheFlag() {\n\t\tconfig::set('cleanCacheFlag', 1);\n\t}", "public function invalidateCache(): void\n {\n $this->cacheExec = [];\n }", "public function reInit(): bool {}", "public function setCache($value)\n {\n $this->config->cache = (bool)$value;\n }", "public function revalidate()\n {\n $this->detectRequest();\n }", "public function setCache($use_cache = false) {\n $this->use_cache = $use_cache;\n }", "public static function setCacheTimesForAuthRecheck($n) \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setCacheTimesForAuthRecheck($n);\t\t\n\t}", "public static function invalidateCacheOnRejudge(Runs $run) {\n\t\t\t\t\t\t\n\t\ttry {\n\t\t\t$contest = ContestsDAO::getByPK($run->getContestId());\n\t\t\t\n\t\t\t// If the run belongs to a contest, we need to invalidate that scoreboard\n\t\t\tif (!is_null($contest)) {\n\t\t\t\tself::InvalidateScoreboardCache($contest->getContestId());\n\t\t\t}\n\t\t\t\n\t\t\t// Now we need to invalidate problem stats\n\t\t\t$problem = ProblemsDAO::getByPK($run->getProblemId());\n\t\t\t\n\t\t\tif (!is_null($problem)) {\n\t\t\t\t// Invalidar cache stats\n\t\t\t\t$problemStatsCache = new Cache(Cache::PROBLEM_STATS, $problem->getAlias());\n\t\t\t\t$problemStatsCache->delete();\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t// We did our best effort to invalidate the cache...\n\t\t\tLogger::warn(\"Failed to invalidate cache on Rejudge, skipping: \");\n\t\t\tLogger::warn($e);\t\t\t\n\t\t}\n\t}", "public function setCachingFlag($cachingFlag) {\n\t\t$this->cachingOn = $cachingFlag;\n\t}", "public static function setCache($cache) {}", "public static function resetCache();", "public function getCacheInvalidator();", "public function getRevalidate() : bool {\n return $this->revalidate;\n }", "public function set_from_cache() {\n\t\t$this->from_cache = true;\n\t}", "public static function setCache($caching)\n{\nself::$caching=$caching;\n}", "function mgd_cache_invalidate()\n{\n}", "function recache()\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//-----------------------------------------\n\t\t// Components\n\t\t//-----------------------------------------\n\t\t\n\t\t$components = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/components.php', 'ad_components' );\n\t\t$components->components_rebuildcache();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Forum Cache\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->update_forum_cache();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Group Cache\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->cache['group_cache'] = array();\n\t\t\n\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'groups'\n\t\t\t\t\t\t\t\t\t\t) );\n\t\t$this->ipsclass->DB->exec_query();\n\t\t\n\t\twhile ( $i = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->cache['group_cache'][ $i['g_id'] ] = $i;\n\t\t}\n\t\t\n\t\t$this->ipsclass->update_cache( array( 'name' => 'group_cache', 'array' => 1, 'deletefirst' => 1 ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Settings\n\t\t//-----------------------------------------\n\t\t\n\t\t$settings = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/settings.php', 'ad_settings' );\n\t\t$settings->setting_rebuildcache();\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 />IPB caches updated....\" );\n\t}", "public function enableCache($bool) {\n\t\t$this->useCache = (bool)$bool;\t//Cast flexform integer (0/1) to bool\n\t}", "protected static function cache($cache)\n\t{\n\t\t// Active Smarty cache for a specified time or endless\n\t\tif ($cache > 0 OR $cache == -1)\n\t\t{\n\t\t\tstatic::$smarty->setCaching(true);\n\t\t\tstatic::$smarty->setCacheLifetime($cache);\n\t\t}\n\t\telse\n\t\t\tstatic::$smarty->setCaching(false);\n\t}" ]
[ "0.65958506", "0.6509163", "0.6339599", "0.63356894", "0.6125721", "0.6119076", "0.6061337", "0.6048235", "0.59386766", "0.5815232", "0.5813845", "0.5807932", "0.5798036", "0.5758459", "0.57129544", "0.5695977", "0.56896126", "0.5686173", "0.5659684", "0.5647168", "0.56142926", "0.5600246", "0.55960566", "0.5589954", "0.55795604", "0.55660343", "0.55418587", "0.55329096", "0.552315", "0.5512555" ]
0.7301621
0
Returns the current cache revalidation flag value.
public function getRevalidate() : bool { return $this->revalidate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReloadCache()\n {\n $value = $this->_config->get('general/reload_cache');\n\n if ($value === null) {\n $value = true;\n }\n\n return (bool)$value;\n }", "public function getCacheValidityTag(): string;", "public static function getCacheRebuildMark()\n {\n return \\Includes\\Utils\\FileManager::read(\n static::getRebuildMarkFileName()\n );\n }", "public function get_css_cache_invalidated(): bool{\n\t\t\t// false = cache valid\n\n\t\t\tif($this->module_css_cache_invalidated !== NULL){\n\t\t\t\treturn $this->module_css_cache_invalidated; // status already retrieved\n\t\t\t}\n\n\t\t\tif(!isset(static::$list[$this->get_UID()]['cache'][ 'invalidated' ])){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // setting not saved yet\n\t\t\t}\n\n\t\t\tif(is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['gutenberg']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\t\t\tif(!is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['frontend']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\n\t\t\t$this->module_css_cache_invalidated = false;\n\t\t\treturn false; // cache is valid\n\t\t}", "public function Check_Flag(){\r\n return $this->_flag;\r\n }", "function getFlag( )\n\t{\n\t\treturn $this->flag;\n\t}", "public function getFlag()\n {\n return $this->flag;\n }", "public function getFlag()\n {\n return $this->flag;\n }", "public function can_cache() {\n return $this->valid;\n }", "public function setWillCacheResult($flag) {\n $this->willCacheResult = $flag;\n }", "public function getIsCallForCache()\n {\n return $this->_blIsCallForCache;\n }", "public function getNegativeCaching()\n {\n return isset($this->negative_caching) ? $this->negative_caching : false;\n }", "public function cache($flag = null)\n\t{\n\t\t$this->cache = (boolean) $flag;\n\t\t\n\t\tif ($this->cache === true) {\n\t\t\t$this->header(\"Cache-Control: public, max-age=7200\");\n\t\t\t$this->header(\"Pragma: cache\");\n\t\t\t\n\t\t\tif (!$this->isExpired()) {\n\t\t\t\t$this->notModified();\n\t\t\t} else {\n\t\t\t\t$this->checkCache($this->app->request());\n\t\t\t}\n\t\t} else {\n\t\t\t$this->header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n\t\t}\n\t\t\n\t\treturn $this->cache;\n\t}", "function validateAgain () {\r\n return $this->_validateAgain;\r\n }", "public function getIsCachedResult()\n {\n return $this->is_cached_result;\n }", "public function getCacheMode()\n {\n return isset($this->cache_mode) ? $this->cache_mode : '';\n }", "public function cached_timestamp()\n\t{\n\t\t$query = $this->_EE->db->get_where('dd_settings', array('key' => 'last_saved'));\n\t\treturn ($query->num_rows() > 0) ? $query->row()->value : 0 ;\n\t}", "public function getShouldCheckRemittance()\n {\n return $this->should_check_remittance;\n }", "public static function get_cache_age()\n {\n return self::$cache_age;\n }", "public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }", "public function getFlag();", "function _get_cron_lock() {\n\tglobal $wpdb;\n\n\t$value = 0;\n\tif ( wp_using_ext_object_cache() ) {\n\t\t/*\n\t\t * Skip local cache and force re-fetch of doing_cron transient\n\t\t * in case another process updated the cache.\n\t\t */\n\t\t$value = wp_cache_get( 'doing_cron', 'transient', true );\n\t} else {\n\t\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1\", '_transient_doing_cron' ) );\n\t\tif ( is_object( $row ) )\n\t\t\t$value = $row->option_value;\n\t}\n\n\treturn $value;\n}", "function GetAjaxFlagValue()\r\n\t{\r\n\t\treturn \"9\";\r\n\t}", "public function cacheTtl()\n {\n return $this->cacheTtl;\n }", "public function getFlagExecutionTime()\n {\n return $this->flagExecutionTime;\n }", "abstract public function getFlag();", "public function getValidity()\n {\n return $this->validity;\n }", "public function getCacheLifetime() {\n\t\treturn $this->cacheLifetime;\n\t}", "public function getAuthreqflag()\n {\n $value = $this->get(self::AUTHREQFLAG);\n return $value === null ? (integer)$value : $value;\n }", "public function getStatusExpire()\n {\n return $this->status_expire;\n }" ]
[ "0.67613846", "0.6208237", "0.6192934", "0.6060147", "0.60253173", "0.59471565", "0.59065217", "0.59065217", "0.57141656", "0.5699616", "0.56732446", "0.5658995", "0.56517404", "0.561309", "0.56103843", "0.55991757", "0.55746055", "0.5528289", "0.5517704", "0.54976517", "0.5479179", "0.5455044", "0.5453674", "0.54183054", "0.5409597", "0.53779423", "0.5330985", "0.53252065", "0.5322066", "0.5316082" ]
0.6360605
1
Returns the current response ETag value.
public function getETag() : string { return $this->ETag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getETag()\n {\n return $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG];\n }", "public static function getETag() {}", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getETag()\n {\n return $this->item['uuid'];\n }", "public function generate_etag()\n\t{\n\t if ($this->response === NULL)\n\t\t{\n\t\t\tthrow new Kohana_Request_Exception('No response yet associated with request - cannot auto generate resource ETag');\n\t\t}\n\n\t\t// Generate a unique hash for the response\n\t\treturn '\"'.sha1($this->response).'\"';\n\t}", "public function getETag()\n {\n $sETag = md5(implode($this->sqlData));\n\n return $sETag;\n }", "public function getEtag()\r\n {\r\n $etag = sprintf('%s/%s/%d', $this->getDatabase(), $this->getPath(), $this->getModified()->format('Y-m-d\\TH:i:s.uP'));\r\n\r\n return md5($etag);\r\n }", "public function getETag($id)\n {\n return $this->_engine->read($id . '.etag');\n }", "public function getETag($path) {\n\t\treturn $this->calculateEtag($path, $this->stat($path));\n\t}", "function etag()\n {\n if (!empty($this->list)) {\n\n return '\"' . implode(\n ':',\n array($this->arg('action'),\n common_language(),\n $this->user->id,\n strtotime($this->list->created),\n strtotime($this->list->modified))\n )\n . '\"';\n }\n\n return null;\n }", "public function getEtag($regen=false)\n\t{\n\t\tif ( $this->exists && ($this->etag === false || $regen === true) )\n \t{\n \t\t$this->etag = $this->generateEtag();\n \t}\n\n \treturn $this->etag;\n\t}", "public function getEtag($regen=false);", "static public function getETag($path) {\n\t\treturn self::$defaultInstance->getETag($path);\n\t}", "function etag()\n {\n if (!empty($this->notice)) {\n\n return '\"' . implode(\n ':',\n array($this->arg('action'),\n common_user_cache_hash($this->auth_user),\n common_language(),\n $this->notice->id,\n strtotime($this->notice->created))\n )\n . '\"';\n }\n\n return null;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function GetETag($collectionId, $entity)\n\t{\n\t\treturn static::RESOURCE_SYNC_SETTINGS_NAME . ':' . parent::GetETag($collectionId, $entity);\n\t}" ]
[ "0.8144781", "0.7832173", "0.7772418", "0.7772418", "0.7772418", "0.7772418", "0.7772418", "0.7772418", "0.7772418", "0.7772418", "0.755168", "0.740668", "0.6573374", "0.64428544", "0.6238767", "0.62066615", "0.6118121", "0.61051154", "0.60943407", "0.6036677", "0.5999116", "0.5904839", "0.5904839", "0.5904839", "0.5904839", "0.5904839", "0.5904839", "0.5904839", "0.5904839", "0.5748419" ]
0.7921639
1
Stores complete doc result (all fields like: _id, _source) into json file structure: data/index/type/_id.json
public function storeData($path, $index, $type, array $docs);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDocument()\n {\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "function _saveIndex ()\n {\n $this->_enterSection('_saveIndex');\n \n $a = strcspn ($this->_options['dsn'], ':');\n $proto = substr ($this->_options['dsn'], 0, $a);\n $path = substr ($this->_options['dsn'], $a + 3);\n\n switch ($proto) {\n case 'file' : \n if ($this->_options['gz_level']) {\n $data = gzcompress (serialize($this->_index), \n $this->_options['gz_level']);\n } else {\n $data = serialize($this->_index);\n }\n fwrite ($this->_indexFileRes, $data);\n fclose ($this->_indexFileRes);\n break;\n }\n\n $this->_leaveSection('_saveIndex');\n }", "public function store()\n {\n return response()->json(\n $this->docs->save($this->validateRequest())\n );\n }", "public function elasticsearchData()\n {\n // set the index mapping\n // i change all the type to text\n // as string remove in 6.0\n // https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html\n $params =\n [\n 'index' => 'pets',\n 'type' => 'bird',\n 'body' =>\n [\n\n 'bird' =>\n [\n '_source' =>\n [\n 'enabled' => true,\n ],\n 'properties' =>\n [\n \"name\" => array(\"type\" => \"text\"),\n \"age\" => array(\"type\" => \"long\"),\n \"gender\" => array(\"type\" => \"text\"),\n \"color\" => array(\"type\" => \"text\"),\n \"braveBird\" => array(\"type\" => \"boolean\"),\n \"home town\" => array(\"type\" => \"text\"),\n \"about\" => array(\"type\" => \"text\"),\n \"registered\" => array(\"type\" => \"date\"),\n ],\n\n ],\n ],\n ];\n\n// this to create thew type\n// $response = $this -> elasticsearch -> indices() -> putMapping($params);\n// dump($response);\n\n\n // Get A mapping\n $params =\n [\n 'index' => 'pets',\n 'type' => 'bird',\n ];\n\n $response = $this -> elasticsearch -> indices() -> getMapping($params);\n dump($response);\n // https://www.elastic.co/blog/removal-of-mapping-types-elasticsearch\n // since the are no two types for the same index\n // i delete the old one\n // with curl -XDELETE http://elasticsearch.local:9200/pets\n // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html\n // then create new index with :\n // in browser in extension\n // PUT pets\n\n\n // Index a document\n $params = [\n 'index' => 'pets',\n 'type' => 'bird',\n 'id' => '1',\n 'body' => [\n 'name' => 'Charlie Shittles',\n 'age' => '13',\n 'gender' => 'male',\n 'color' => 'brown',\n 'braveBird' => true,\n 'home town' => 'Phoenix, Arizona',\n 'about' => 'Lore ipsum dolor sit amet, consectetur\n adipiscing elit. Maecenas pharetra lobortis tristique. Magna aute enim officia quis ad in duis ad in duis partiatur. Inproident eiusmo/pets/dog/1/d et excepteur quis in voluptate qui culpa sint dolore. Ad eu sint fugiat deserunt proident minim. Deserunt ea commodo dolor anim sunt deserunt.',\n 'registered' => date('Y-m-d'),\n ],\n ];\n $response = $this -> elasticsearch -> index($params);\n dump($response);\n\n // Bulk index documents\n $faker = Faker ::create();\n\n $params = [];\n\n for ($i = 0 ; $i < 100 ; $i ++) {\n $params[ 'body' ][] = [\n 'index' => [\n '_index' => 'pets',\n '_type' => 'bird',\n\n ],\n ];\n $gender = $faker -> randomElement(['male', 'female']);\n $age = $faker -> numberBetween(1, 15);\n $params[ 'body' ][] =\n [\n 'name' => $faker -> name($gender),\n 'age' => $age,\n 'gender' => $gender,\n 'color' => $faker -> safeColorName,\n 'braveBird' => $faker -> boolean,\n 'home town' => \"{$faker->city}, {$faker->state}\",\n 'about' => $faker -> realText(),\n 'registered' => $faker -> dateTimeBetween(\"-{$age} years\", 'now') -> format('Y-m-d'),\n\n ];\n\n\n }\n\n $response = $this -> elasticsearch -> bulk($params);\n dump($response);\n\n\n }", "private function createIndex(){\n $hosts = [$this->es_host];// IP + Port\n $client = \\Elasticsearch\\ClientBuilder::create() // Instantiate a new ClientBuilder\n ->setHosts($hosts) // Set the hosts\n ->build();\n\n //Checking if index exists\n $request = Requests::get('http://'.$this->es_host.'/docsearch', array('Accept' => 'application/json'));\n //If index exists(!=404) then delete it and try to create again\n if($request->status_code!=404){\n //$this->info('################# Index Already Exists - Deleting now #################');\n //Deleting docsearch index\n $deleteParams = ['index' => 'docsearch'];\n $response = $client->indices()->delete($deleteParams);\n }\n //Creating map\n $params = [\n 'index' => 'docsearch',\n 'body' => [\n 'mappings' => [\n 'folders' => [\n 'properties' => [\n 'full_path' => [\n 'type' => 'string',\n 'index' => 'not_analyzed'\n ],\n 'parent' => [\n 'type' => 'string',\n 'index' => 'not_analyzed'\n ]\n ]\n ]\n ]\n ]\n ];\n\n $response = $client->indices()->create($params);\n //$this->info('#################Creating Index with ES#################');\n //$this->info('response is ',$response);\n //Log::info(\"Creating index ->>> \", $response);\n //$this->info('##################################');\n }", "function dumpData(Elasticsearch\\Client $client, $path, $indexName) {\n $file = fopen($path, 'r') or exit(\"Impossible to open file: ($path)\");\n\n while (($line = fgetcsv($file, 0, \"\\t\")) !== FALSE) {\n $document = parseLine($line);\n\n $params = array();\n $params['body'] = $document;\n $params['index'] = $indexName;\n $params['type'] = 'geonames';\n $params['id'] = (int) $document['geonameId'];\n\n $returnValue = $client->index($params);\n echo \"Added \" . $params['id'] . \" \" . $document['name'] . \"\\n\";\n }\n}", "public function saveToJson($result)\n {\n $data = [];\n foreach ($result as $one) {\n $data['invoice'] = $one['invoice_id'];\n $data['Invoice Date'] = $one['date'];\n $data['Customer Name'] = $one['customer_name'];\n $data['Customer Address'] = $one['address'];\n $data['Product Name'] = $one['product_name'];\n $data['Quantity'] = $one['quantity'];\n $data['Price'] = $one['price'];\n $data['Total'] = $one['total'];\n $data['Grand Total'] = $one['grand_total'];\n }\n //write to json file\n $fp = fopen(__DIR__.'/../storage/json/invoices.json', 'w');\n fwrite($fp, json_encode($data));\n fclose($fp);\n }", "public function index()\n {\n $docs = Document::all()->load('file');\n return response()->json($docs);\n }", "public function testTypeWithResult()\n {\n $this->markTestSkipped('Wait until Mongo specific attributes are needed');\n\n $result = $this->getMock('Elastica\\Result', [], [[]]);\n $data = ['a' => 'b'];\n\n $result\n ->method('getData')\n ->will($this->returnValue($data));\n\n $result\n ->method('getId')\n ->will($this->returnValue(1));\n\n $result\n ->method('getType')\n ->will($this->returnValue('things'));\n\n $result\n ->method('getVersion')\n ->will($this->returnValue(3));\n\n $result\n ->method('getHighlights')\n ->will($this->returnValue(['highlights array']));\n\n $result\n ->method('getExplanation')\n ->will($this->returnValue(['explanation array']));\n\n $document = new Document($result);\n $this->assertSame($data + ['id' => 1], $document->toArray());\n $this->assertEquals('things', $document->type());\n $this->assertEquals(3, $document->version());\n $this->assertEquals(['highlights array'], $document->highlights());\n $this->assertEquals(['explanation array'], $document->explanation());\n }", "public function dump()\n {\n return [\n 'id' => $this->id,\n 'index' => $this->index,\n '_source' => $this->all(),\n ];\n }", "public function buildIndexes() {\n\t\t$return = array();\n\t\t$indexes = array(\n\t\t\t\"work\" => __DIR__.'/../content/work',\n\t\t\t\"authors\" => __DIR__.'/../content/authors',\n\t\t\t\"tags\" => __DIR__.'/../content/tags'\n\t\t);\n\t\tforeach ($indexes as $type => $location) {\n\t\t\tforeach(glob($location . '/*.json') as $file) {\n\t\t\t\t$entry = json_decode(file_get_contents($file),true);\n\t\t\t\tif ($entry) {\n\t\t\t\t\t$key = str_replace(array('.json',$location.'/'),'',$file);\n\t\t\t\t\t$return[$type][$key] = $entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// move author details\n\t\t$details = $return['authors'];\n\t\tunset($return['authors']);\n\t\t$return['authors']['details'] = $details;\n\n\t\t// add author details and permalink to work\n\t\tforeach ($return['work'] as $key => &$entry) {\n\t\t\t$entry['permalink'] = $this->root_url . '/view/' . $entry['id'];\n\t\t\tif (is_array($return['authors']['details'][$entry['author_id']])) {\n\t\t\t\t$entry['author_name'] = $return['authors']['details'][$entry['author_id']]['name'];\n\t\t\t\t$entry['author_byline'] = $return['authors']['details'][$entry['author_id']]['byline'];\n\t\t\t}\n\t\t}\n\n\t\t// sort work to newest-first\n\t\tuasort($return['work'], array(\"Harvard\", \"sortIndex\"));\n\n\t\t// do tag stuff\n\t\t$details = $return['tags'];\n\t\tunset($return['tags']);\n\t\t$return['tags']['details'] = $details;\n\t\t$tag_list = array();\n\t\t$tag_index = array();\n\t\t$author_index = array();\n\t\tif (is_array($return['work'])) {\n\t\t\tforeach ($return['work'] as $work) {\n\t\t\t\t$author_index[$work['author_id']][] = $work['id'];\n\t\t\t\tif (is_array($work['tags'])) {\n\t\t\t\t\tif (count($work['tags'])) {\n\t\t\t\t\t\tforeach ($work['tags'] as $tag) {\n\t\t\t\t\t\t\t$tag_index[$tag][] = $work['id'];\n\t\t\t\t\t\t\t$tag_list[] = $tag;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$tag_list = array_unique($tag_list); // trim tags to unique\n\t\tsort($tag_list); // alphabetize\n\n\t\t// format the tag list for mustache iteration\n\t\t$tmp_array = array();\n\t\tforeach ($tag_list as $tag) {\n\t\t\t$tmp_array[]['tag'] = $tag;\n\t\t}\n\t\t$tag_list = $tmp_array;\n\n\t\t$return['tags']['count'] = count($tag_list);\n\t\t$return['tags']['list'] = $tag_list;\n\t\t$return['tags']['index'] = $tag_index;\n\n\t\t$return['authors']['index'] = $author_index;\n\n\t\tforeach ($return as $type => $data) {\n\t\t\tfile_put_contents(__DIR__.'/../content/_generated_'.$type.'.json',json_encode($data));\n\t\t}\n\t\treturn $return;\n\t}", "public function store()\n\t{\n\t\t$documentReception = DocumentReception::create(Input::all());\n\t\treturn Response::json($documentReception);\n\t}", "public function data(): DocumentData;", "protected function _as_doc($result){\n return new CouchDocument($this, $result);\n }", "public function testIndexResultType()\n {\n\n // Add a page to the index.\n $page = $this->_simplePage(true);\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Should index the result type.\n $this->assertEquals('Simple Page', $document->resulttype);\n\n }", "public function save()\r\n {\r\n return array(\r\n 'classname' => get_class($this),\r\n 'data' => array('hits' => $this->hits)\r\n );\r\n }", "private function put_index($data) {\n\t\t$json_text = json_encode($data);\t\n\t\treturn file_put_contents($this->index_path.self::INDEX_FILENAME, $json_text);\n\t}", "public function saveAction()\n {\n foreach ($this->dms()->getHearders() as $key => $value) {\n $this->getResponse()->getHeaders()->addHeaderLine($key, $value);\n }\n\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n\n $ret = [];\n $request = $this->getRequest();\n $files = $request->getFiles()->toArray();\n foreach ($files as $name_file => $file) {\n if (isset($file['name'])) {\n $file = [$file];\n }\n foreach ($file as $f) {\n $document['support'] = Document::SUPPORT_FILE_MULTI_PART_STR;\n $document['coding'] = 'binary';\n $document['data'] = [$name_file => $f];\n $document['name'] = $f['name'];\n $document['type'] = $f['type'];\n $document['weight'] = $f['size'];\n\n $doc = $this->dms()->getService()->add($document);\n if (isset($ret[$name_file])) {\n if (is_array($ret[$name_file])) {\n $ret[$name_file][] = $doc;\n } else {\n $ret[$name_file] = [$ret[$name_file], $doc];\n }\n } else {\n $ret[$name_file] = $doc;\n }\n }\n }\n\n return new JsonModel($ret);\n }", "private function generateSearchResult()\n {\n $this->outFiles['search_results_interface'] = [\n 'file' => $this->classes['search_results_interface']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Api/SearchResultInterface', [\n 'namespace' => $this->classes['search_results_interface']['info']['namespace'],\n 'class' => $this->classes['search_results_interface']['info']['class_name'],\n 'data_interface' => $this->classes['data_interface']['class'],\n ]),\n ];\n\n $this->outFiles['search_results'] = [\n 'file' => $this->classes['search_results']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Model/SearchResult', [\n 'namespace' => $this->classes['search_results']['info']['namespace'],\n 'class' => $this->classes['search_results']['info']['class_name'],\n 'interface' => $this->classes['search_results_interface']['class'],\n ]),\n ];\n }", "function _apachesolr_index_process_entity_get_document($entity, $entity_type) {\n list($entity_id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);\n\n $document = new ApacheSolrDocument();\n\n // Define our url options in advance. This differs depending on the\n // language\n $languages = language_list();\n $url_options = array('absolute' => TRUE);\n if (isset($entity->language) && isset($languages[$entity->language])) {\n $url_options['language'] = $languages[$entity->language];\n }\n\n $document->id = apachesolr_document_id($entity_id, $entity_type);\n $document->site = url(NULL, $url_options);\n $document->hash = apachesolr_site_hash();\n\n $document->entity_id = $entity_id;\n $document->entity_type = $entity_type;\n $document->bundle = $bundle;\n $document->bundle_name = entity_bundle_label($entity_type, $bundle);\n\n if (empty($entity->language)) {\n // 'und' is the language-neutral code in Drupal 7.\n $document->ss_language = LANGUAGE_NONE;\n }\n else {\n $document->ss_language = $entity->language;\n }\n\n $path = entity_uri($entity_type, $entity);\n // A path is not a requirement of an entity\n if (!empty($path)) {\n $document->path = $path['path'];\n $document->url = url($path['path'], $path['options'] + $url_options);\n // Path aliases can have important information about the content.\n // Add them to the index as well.\n if (function_exists('drupal_get_path_alias')) {\n // Add any path alias to the index, looking first for language specific\n // aliases but using language neutral aliases otherwise.\n $output = drupal_get_path_alias($document->path, $document->ss_language);\n if ($output && $output != $document->path) {\n $document->path_alias = $output;\n }\n }\n }\n return $document;\n}", "protected function doIndexDocument() {\n if ($this->showRecordInSearch())\n {\n $this->service->index($this->owner);\n }\n }", "public function index()\n {\n if ($this->isEmpty()) {\n return false;\n }\n\n $params = array();\n\n foreach ($this->all() as $item) {\n $params['body'][] = array(\n 'index' => array(\n '_index' => $item->getIndex(),\n '_type' => $item->getTypeName(),\n '_id' => $item->getKey()\n )\n );\n\n $params['body'][] = $item->documentFields();\n }\n\n return $this->getElasticClient()->bulk($params);\n }", "public function saveImageIndex() {\n $url = \"http://localhost:4212/index/io\";\n $header = [\n 'Accept: application/json',\n ];\n $data = [\n 'type' => 'WRITE',\n 'index_path' => 'cards.dat',\n ];\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n $result = json_decode(curl_exec($ch), true);\n curl_close($ch);\n\n echo \"Saved image index.<br>\";\n }", "public function index() {\n\t\t\t$this->data[\"content\"] = $this->mongo_db->order_by(array(\"_id\"))->get(\"content_types\");\n\t\t\t$this->returndata();\n\t\t}", "public function as_podcastindex_json()\n {\n $data = array_map(function ($entry) {\n return [\n 'speaker' => $entry['voice'],\n 'startTime' => $entry['start_ms'] / 1000,\n 'endTime' => $entry['end_ms'] / 1000,\n 'body' => $entry['text']\n ];\n }, $this->get_data());\n\n return json_encode(['version' => '1.0.0', 'segments' => $data]);\n }", "function apachesolr_convert_entity_to_documents($entity, $entity_type, $env_id) {\n list($entity_id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);\n\n // Create a new document, and do the bare minimum on it.\n $document = _apachesolr_index_process_entity_get_document($entity, $entity_type);\n\n //Get the callback array to add stuff to the document\n $document_callbacks = apachesolr_entity_get_callback($entity_type, 'document callback', $bundle);\n $documents = array();\n foreach ($document_callbacks as $document_callback) {\n // Call a type-specific callback to add stuff to the document.\n $documents = array_merge($documents, $document_callback($document, $entity, $entity_type, $env_id));\n }\n\n //do this for all possible documents that were returned by the callbacks\n foreach ($documents as $document) {\n // Call an all-entity hook to add stuff to the document.\n module_invoke_all('apachesolr_index_document_build', $document, $entity, $entity_type, $env_id);\n\n // Call a type-specific hook to add stuff to the document.\n module_invoke_all('apachesolr_index_document_build_' . $entity_type, $document, $entity, $env_id);\n\n // Final processing to ensure that the document is properly structured.\n // All records must have a label field, which is used for user-friendly labeling.\n if (empty($document->label)) {\n $document->label = '';\n }\n\n // All records must have a \"content\" field, which is used for fulltext indexing.\n // If we don't have one, enter an empty value. This does mean that the entity\n // will not be fulltext searchable.\n if (empty($document->content)) {\n $document->content = '';\n }\n\n // All records must have a \"teaser\" field, which is used for abbreviated\n // displays when no highlighted text is available.\n if (empty($document->teaser)) {\n $document->teaser = truncate_utf8($document->content, 300, TRUE);\n }\n }\n\n // Now allow modules to alter each other's additions for maximum flexibility.\n\n // Hook to allow modifications of the retrieved results\n foreach (module_implements('apachesolr_index_documents_alter') as $module) {\n $function = $module . '_apachesolr_index_documents_alter';\n $function($documents, $entity, $entity_type, $env_id);\n }\n\n return $documents;\n}", "function __processDocument() {\n\t\t$document = new Apache_Solr_Document;\n\t\tif ($this->settings[$this->model->alias]['boost']) {\n\t\t\t$document->setBoost($this->settings[$this->model->alias]['boost']);\n\t\t}\n\t\tforeach ($this->model->data as $alias => $data) {\n\t\t\tif ($alias === $this->model->alias) {\n\t\t\t\t$document = $this->__processDocumentFieldArray($document, $data);\n\t\t\t} elseif (in_array($alias, $this->settings[$this->model->alias]['include'])) {\n\t\t\t\t$field = $alias . $this->__fieldTypeMappingTable['relations'];\n\t\t\t\t$document = $this->__processDocumentRelationalFieldArray($document, $field, $data);\n\t\t\t}\n\t\t}\n\t\t$document->setField($this->__fieldModelAlias, $this->model->alias);\n\t\t$document->setField('id', $this->__createDocId());\n\t\treturn $document;\n\t}", "protected function _as_docs($results){\n \n return array_map(array($this, '_as_doc'), $results);\n }", "function deeds_do_index_charters($docnum) {\r\n\r\n\t$record_type = 'Charter';\r\n\r\n\t$sql = 'SELECT\r\n\t\t\t\tcartulary.short as cart_title_short,\r\n\t\t\t\tcartulary.title as cart_title,\r\n\t\t\t\tcartulary_biblio.biblio as cart_bib_title,\r\n\t\t\t\tcharter.*,\r\n\t\t\t\ttxt.txt,\r\n\t\t\t\tcharter_date.dated,\r\n\t\t\t\tcharter_date.lodate,\r\n\t\t\t\tcharter_date.hidate,\r\n\t\t\t\tcharter_date.date_precision,\r\n\t\t\t\tcharter_location.location,\r\n\t\t\t\tcharter_location.country,\r\n\t\t\t\tcharter_location.county,\r\n\t\t\t\tcharter_location.place,\r\n\t\t\t\tcharter_place.country as origin_country,\r\n\t\t\t\tcharter_place.county as origin_county,\r\n\t\t\t\tcharter_place.place as origin_place\r\n\t\t\tFROM\r\n\t\t\t\tdeeds_db.charter charter\r\n\t\t\tLEFT JOIN deeds_db.charter_doc txt ON charter.docnum = txt.docnum\r\n\t\t\tLEFT JOIN deeds_db.charter_date charter_date ON charter.docnum = charter_date.docnum\r\n\t\t\tLEFT JOIN deeds_db.charter_location ON charter.docnum = charter_location.docnum AND charter_location.location_type = \\'issued\\' \r\n\t\t\tLEFT JOIN deeds_db.charter_place ON charter.docnum = charter_place.docnum \r\n\t\t\tLEFT JOIN deeds_db.cartulary ON cartulary.cartnum = substring(charter.docnum, 1, 4)\r\n\t\t\tLEFT JOIN deeds_db.cartulary_biblio ON cartulary_biblio.cartnum = substring(charter.docnum, 1, 4) \r\n\t\t\tWHERE charter.docnum = \\'' . $docnum . '\\' LIMIT 100\r\n\t'; \r\n\t$ci=& get_instance();\r\n\t$ci->load->database(); \r\n\t$query = $ci->db->query($sql);\r\n\t$result = $query->result_array();\r\n\t$ci->db->flush_cache();\r\n\r\n\t$count = 0;\r\n\r\n\t$ci->load->library(\"Apache/Solr/Apache_Solr_Service\", array('host' => SOLR_HOST, 'port' =>SOLR_PORT, 'path' => SOLR_PATH), 'service');\r\n\t$ci->load->library(\"Apache/Solr/Apache_Solr_Document\", '', 'doc');\r\n\r\n\r\n\tforeach ($result as $row) {\r\n\t\ttry {\r\n\r\n\t\t\t$dnum = $row['docnum'];\r\n\t\t\t$unique_id = $record_type.'_'.$dnum; \r\n\r\n\t\t\t$ci->doc->addField('unique_id', $record_type.'_'.$dnum);\r\n\t\t\t$ci->doc->addField('record_type', $record_type);\r\n\t\t\t$ci->doc->addField('dnum', $dnum);\r\n\t\t\t$ci->doc->addField('content', $row['txt']);\r\n\r\n\t\t\tif ($row['location'] != '' && $row['location'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('location_issued', $row['location']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['country'] != '' && $row['country'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('issued_country', $row['country']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['county'] != '' && $row['county'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('issued_county', $row['county']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['place'] != '' && $row['place'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('issued_place', $row['place']);\r\n\t\t\t}\r\n\r\n\t\t\t// indexing multi-valued property locations\r\n\t\t\t$property_locations = deeds_solr_helper_get_charter_property_locations($row['docnum'], $ci);\r\n\r\n\t\t\tforeach ($property_locations as $property_location) {\r\n\t\t\t\t$ci->doc->addField('property_country', $property_location['country']);\r\n\t\t\t\t$ci->doc->addField('property_county', $property_location['county']);\r\n\t\t\t\t$ci->doc->addField('property_place', $property_location['place']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['origin_country'] != '' && $row['origin_country'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('origin_country', $row['origin_country']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['origin_county'] != '' && $row['origin_county'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('origin_county', $row['origin_county']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['origin_place'] != '' && $row['origin_place'] != 'NULL') {\r\n\t\t\t\t$ci->doc->addField('origin_place', $row['origin_place']);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['charter_type'] != '' && $row['charter_type'] != 'NULL') {\r\n\t\t\t\t$charter_types = explode(', ', $row['charter_type']);\r\n\t\t\t\tforeach ($charter_types as $charter_type) {\r\n\t\t\t\t\t$ci->doc->addField('charter_type', $charter_type);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$ci->doc->addField('origin', $row['origin']);\r\n\t\t\t$ci->doc->addField('language', $row['language']);\r\n\r\n\t\t\t$dated = deeds_core_formatyr($row['dated']);\r\n\t\t\t$lodate = deeds_core_formatyr($row['lodate']);\r\n\t\t\t$hidate = deeds_core_formatyr($row['hidate']);\r\n\r\n\t\t\t$date_precision = $row['date_precision'];\r\n\r\n\t\t\tif ($dated != '0000') {\r\n\t\t\t\t$ci->doc->addField('docYear_display', $dated);\r\n\t\t\t\t$ci->doc->addField('docYear_multi', $dated);\r\n\t\t\t} else if ($lodate != '0000' && $hidate != '0000') {\r\n\t\t\t\t$int_loyr = intval($lodate);\r\n\t\t\t\t$int_hiyr = intval($hidate);\r\n\t\t\t\tfor ($i = $int_loyr; $i <= $int_hiyr; $i++) {\r\n\t\t\t\t\t$ci->doc->addField('docYear_multi', $i);\r\n\t\t\t\t} \r\n\t\t\t\tif($int_loyr === $int_hiyr) { \r\n\t\t\t\t\t$ci->doc->addField('docYear_display', $lodate);\r\n\t\t\t\t} else { \r\n\t\t\t\t\t$ci->doc->addField('docYear_display', \"{$lodate}-{$hidate}\");\r\n\t\t\t\t}\r\n\t\t\t} else if ($lodate != '0000') {\r\n\t\t\t\t$ci->doc->addField('docYear_display', $lodate);\r\n\t\t\t\t$ci->doc->addField('docYear_multi', $lodate);\r\n\t\t\t} else if ($hidate != '0000') {\r\n\t\t\t\t$ci->doc->addField('docYear_display', $hidate);\r\n\t\t\t\t$ci->doc->addField('docYear_multi', $hidate);\r\n\t\t\t}\r\n\t\t\t$ci->doc->addField('date_precision', $date_precision);\r\n\r\n\t\t\t$copySource = $row['charter_source'];\r\n\t\t\t$ci->doc->addField('copySource', $copySource);\r\n\r\n\t\t\t$ci->doc->addField('cart_title_short', $row['cart_title_short']);\r\n \t\t\t$ci->doc->addField('cart_title', $row['cart_title']);\r\n \t\t\t$ci->doc->addField('cart_bib_title', $row['cart_bib_title']);\r\n\r\n\t\t\t$count++;\r\n\r\n\t\t\t$ci->service->addDocument($ci->doc);\r\n\t\t\t$ci->service->commit();\r\n\t\t\t$ci->doc->clear();\r\n\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"Error: \".$e->getMessage().\"\\n\";\r\n\t\t\techo \"File: \".$e->getFile().\"\\n\";\r\n\t\t\techo \"Line: \".$e->getLine().\"\\n\";\r\n\t\t\techo \"Code: \".$e->getCode().\"\\n\";\r\n\t\t\t//echo \"Trace: \".print_r($e->getTrace(), TRUE).\"\\n\";\r\n\t\t}\r\n\t}\r\n}", "public function testCreateDocument()\n {\n echo \"\\nTesting document creation...\";\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }" ]
[ "0.57928854", "0.56793827", "0.55553937", "0.5546931", "0.5513869", "0.5501009", "0.5492917", "0.53454906", "0.5283387", "0.5276253", "0.5213515", "0.5183267", "0.51705265", "0.5155107", "0.5145017", "0.51340693", "0.5114", "0.5113718", "0.5111489", "0.51042193", "0.51032436", "0.51021504", "0.5099353", "0.5096139", "0.507405", "0.5059806", "0.5046204", "0.50312763", "0.49960342", "0.49656358" ]
0.6109244
0
Stores restore server info as json
public function storeRestoreServerInfo($path, \DateTime $createdAt, ServerInfo $serverInfo);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private final function addResponseServerinformation()\n {\n $this->snowmanresponse->serverinformation = new \\stdClass();\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->serverinformation->ajaxApiUrl =\n $this->snowman->getCSnowman()->getAjaxApiUrl();\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->serverinformation->imprintUrl =\n $this->snowman->getCSnowman()->getImprintUrl();\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->serverinformation->liveviewUrl =\n $this->snowman->getCSnowman()->getLiveViewUrl();\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->serverinformation->downloadarchiveurl =\n $this->snowman->getCSnowman()->getDownloadArchiveUrl();\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->serverinformation->version =\n $this->snowman->getCSnowman()->getVersion();\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->serverinformation->versionDate =\n $this->snowman->getCSnowman()->getVersionDate();\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->serverinformation->owner =\n $this->snowman->getCSnowman()->getOwner();\n }", "protected function saveCommunicationDetails() {\n $communicationDetails = json_encode($this->_endpointFailures);\n file_put_contents($this->_directories[\"communicationDetails\"], $communicationDetails);\n $this->log(\"Communication details were saved to \".$this->_directories[\"communicationDetails\"].\".\");\n }", "function jsonSave()\n {\n try {\n file_put_contents($this->fname, json_encode($this->content));\n } catch (Exception $e) {\n echo $e;\n }\n }", "private function get_server_data() {\n\t\tglobal $wp_version;\n\t\t$data = [\n\t\t\t'server' => [\n\t\t\t\t'name' => esc_html__( 'PHP Version', 'Avada' ),\n\t\t\t\t'value' => phpversion(),\n\t\t\t],\n\t\t\t'php' => [\n\t\t\t\t'name' => esc_html__( 'Server Software', 'Avada' ),\n\t\t\t\t'value' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',\n\t\t\t],\n\t\t\t'wp' => [\n\t\t\t\t'name' => esc_html__( 'WordPress Version', 'Avada' ),\n\t\t\t\t'value' => $wp_version,\n\t\t\t],\n\t\t\t'avada_ver' => [\n\t\t\t\t'name' => esc_html__( 'Avada Version', 'Avada' ),\n\t\t\t\t'value' => ( defined( 'AVADA_VERSION' ) ) ? AVADA_VERSION : '',\n\t\t\t],\n\t\t\t'url' => [\n\t\t\t\t'name' => esc_html__( 'Encrypted Site URL', 'Avada' ),\n\t\t\t\t'value' => md5( site_url() ),\n\t\t\t],\n\t\t\t'token' => [\n\t\t\t\t'name' => esc_html__( 'Token', 'Avada' ),\n\t\t\t\t'value' => class_exists( 'Avada' ) ? Avada()->registration->get_token() : '',\n\t\t\t],\n\t\t];\n\t\treturn $data;\n\t}", "public function save()\n {\n file_put_contents(\"address.json\", json_encode($this->content));\n }", "public static function saveEntry() { \n $result = array();\n $saved = lC_Product_variants_Admin::saveEntry($_GET['pveid'], $_GET);\n if ($saved) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "function settings_save_json($path)\n {\n }", "function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}", "public function save()\n\t\t{\n#DS_Database_Archive::_log(__METHOD__.'()');\n\t\t\tif ( $this->_dirty ) {\n#DS_Database_Archive::_log(__METHOD__.'() data is dirty');\n\t\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t\tset_option( $this->option_name, $this->_options );\n\t\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t\t// save to filesystem\n#DS_Database_Archive::_log(__METHOD__.'() saving to file ' . $this->filename);\n\t\t\t\t\t$output = json_encode( $this->_options, JSON_PRETTY_PRINT );\n#DS_Database_Archive::_log(__METHOD__.'() contents: ' . $output);\n\t\t\t\t\tfile_put_contents( $this->filename, $output );\n\t\t\t\t}\n\t\t\t\t$this->_dirty = FALSE;\n\t\t\t}\n\t\t}", "private function saveData() {\n // Create a new object with relevant information\n $data = new stdClass();\n $data->accessToken = $this->accessToken;\n $data->expirationDate = $this->expirationDate;\n $data->refreshToken = $this->refreshToken;\n\n // And save it to disk (will automatically create the file for us)\n file_put_contents(DATA_FILE, json_encode($data));\n }", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "public function server_data()\n\t{\n\t\t$serialized_selected_app = Hop_new_relic_settings_helper::get_setting('nr_selected_app');\n\t\t$api_key = Hop_new_relic_settings_helper::get_setting('nr_api_key');\n\t\tif ($serialized_selected_app != null && $api_key != null)\n\t\t{\n\t\t\t$selected_app = unserialize($serialized_selected_app);\n\n\t\t\t$server_summary = ee()->cache->get('/'.HOP_NEW_RELIC_NAME.'/server_sum_'.$selected_app->id.'_'.$this->cache_ttl);\n\t\t\tif(!$server_summary)\n\t\t\t{\n\t\t\t\t$new_relic_api = new New_Relic_Api($api_key);\n\t\t\t\t$server_summary = $new_relic_api->get_server_summary($selected_app->links->servers[0]);\n\n\t\t\t\tee()->cache->save('/'.HOP_NEW_RELIC_NAME.'/server_sum_'.$selected_app->id.'_'.$this->cache_ttl, $server_summary, $this->cache_ttl);\n\t\t\t}\n\n\t\t\tif ($server_summary != null && !isset($server_summary->error))\n\t\t\t{\n\n\t\t\t\t$text = '<span>'.$server_summary->summary->cpu.' cpu%';\n\t\t\t\tif($server_summary->summary->cpu_stolen > 0)\n\t\t\t\t{\n\t\t\t\t\t$text .= ' ('.$server->summary->cpu_stolen.' cpu stolen%)';\n\t\t\t\t}\n\t\t\t\t$text .= '</span> <span>'.$server_summary->summary->memory.' mem%';\n\n\t\t\t\tif (isset($server_summary->summary->memory_used) && isset($server_summary->summary->memory_total))\n\t\t\t\t{\n\t\t\t\t\t$text .= ' ('.Hop_new_relic_settings_helper::format_bytes($server_summary->summary->memory_used, 0).'/'.Hop_new_relic_settings_helper::format_bytes($server_summary->summary->memory_total, 0).')';\n\t\t\t\t}\n\n\t\t\t\t$text .= '</span> <span>'.$server_summary->summary->fullest_disk.' disk%</span>';\n\t\t\t\treturn $text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "public function getServerData() {\n \t\n \t// Return our server object\n \treturn $this->oServerData;\n }", "private function save_configuration_bundle() {\n\t\t$this->configuration_bundle = array();\n\t\t// Some items must always be saved + restored; others only on a migration\n\t\t// Remember, if modifying this, that a restoration can include restoring a destroyed site from a backup onto a fresh WP install on the same URL. So, it is not necessarily desirable to retain the current settings and drop the ones in the backup.\n\t\t$keys_to_save = array('updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_restore_in_progress');\n\n\t\tif ($this->old_siteurl != $this->our_siteurl || (defined('UPDRAFTPLUS_RESTORE_ALL_SETTINGS') && UPDRAFTPLUS_RESTORE_ALL_SETTINGS)) {\n\t\t\tglobal $updraftplus;\n\t\t\t$keys_to_save = array_merge($keys_to_save, $updraftplus->get_settings_keys());\n\t\t\t$keys_to_save[] = 'updraft_backup_history';\n\t\t}\n\n\t\tforeach ($keys_to_save as $key) {\n\t\t\t$this->configuration_bundle[$key] = UpdraftPlus_Options::get_updraft_option($key);\n\t\t}\n\t}", "public static function saveEntry() {\r\n $result = array();\r\n $saved = lC_Configuration_Admin::save($_GET['configuration']);\r\n if ($saved) {\r\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\r\n }\r\n\r\n echo json_encode($result);\r\n }", "public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }", "function save_server($server) {\n\ttry {\n\t\t# Get connected\n\t\t$dbh = get_dbh();\n\n\t\t# Create the server if necessary\n\t\t$stmt = $dbh->prepare('SELECT name FROM servers WHERE username = ? AND name = ?');\n\t\t$stmt->execute(array($server['username'], $server['name']));\n\t\tif (! is_array($stmt->fetch())) {\n\t\t\t$stmt = $dbh->prepare('INSERT INTO servers (username, name, id) VALUES (?, ?, ?)');\n\t\t\t$stmt->execute(array($server['username'], $server['name']));\n\t\t}\n\n\t\t# Update the DB from our local array\n\t\t$stmt = $dbh->prepare('UPDATE servers SET address = ?, port = ?, id = ? WHERE username = ? AND name = ?');\n\t\t$stmt->execute(array($server['address'], $server['port'], $server['id'], $server['username'], $server['name']));\n\t} catch (PDOException $e) {\n\t\terror(0, 'DB error in save_server: ' . $e->getMessage());\n\t}\n\n\treturn TRUE;\n}", "public function saveToServer(CI $server = null) {\n $this->checkVars();\n if (!$server) {\n $this->checkClient();\n $client = &$this->client;\n } else {\n $client = &$server;\n }\n\n return $client->setKey($this->key, $this->value, $this->lifetime);\n }", "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "protected function _getServersData()\n {\n return $this->_aServersData;\n }", "public function saveJson()\n {\n $ExtensionData = new ExtensionData();\n $ExtensionData->SubmittedByID = Member::currentUserID();\n $result = $this->dataFields($ExtensionData);\n return $result ;\n }", "public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }", "public function jsonSerialize() {\n\t\treturn $this->store;\n\t}", "public function run()\n {\n DB::table('server_settings')->insert([\n [\n 'settings' => json_encode([\n 'locale' => [\n 'value' => 'en-US'\n ],\n ])\n ]\n ]);\n }", "function do_server_info()\n{\n global $datasets; // from require_once \"../analysis/common/functions.php\"\n\n if (!isset($datasets)) {\n $datasets = []; // database tables not yet initialized\n }\n\n $server_roles = unserialize(CAPTUREROLES);\n\n $response_mediatype = choose_mediatype(['application/json', 'text/html',\n 'text/plain']);\n\n switch ($response_mediatype) {\n case 'application/json':\n $obj = array( 'roles' => $server_roles );\n respond_with_json($obj);\n // respond_with_json(array_keys($datasets));\n break;\n case 'text/html':\n html_begin(\"Server information\", [[\"Server information\"]]);\n\n if (count($server_roles) == 0) {\n echo \" <p>This TCAT instance is currently not tracking anything.</p>\\n\";\n } else {\n echo \" <p>Tracking roles:</p>\\n\";\n echo \" <ul>\\n\";\n\n foreach ($server_roles as $role) {\n echo \"<li>$role</li>\\n\";\n }\n\n echo \" </ul>\\n\";\n }\n\n html_end();\n break;\n\n case 'text/plain':\n default:\n print \"SERVER ROLES: \";\n if (count($server_roles) == 0) {\n print \"none\";\n } else {\n foreach ($server_roles as $role) {\n print($role . \" \");\n }\n }\n print \"\\n\";\n break;\n }\n}", "private function _store()\n {\n return $this->redis->redis->set($this->clientPrefix, json_encode($this->cache));\n }", "protected function getServerInfo()\n {\n $stackTrace = debug_backtrace();\n\n $file = $this->getCalledFile($stackTrace);\n $line = $this->getCalledLine($stackTrace);\n\n return [\n 'file' => $file,\n 'line' => $line,\n 'server' => ! empty($_SERVER) ? json_encode($_SERVER) : null,\n 'post' => ! empty($_POST) ? json_encode($_POST) : null,\n 'get' => ! empty($_GET) ? json_encode($_GET) : null,\n 'files' => ! empty($_FILES) ? json_encode($_FILES) : null,\n 'cookies' => ! empty($_COOKIE) ? json_encode($_COOKIE) : null,\n 'session' => ! empty($_SESSION) ? json_encode($_SESSION) : null,\n 'environment' => ! empty($_ENV) ? json_encode($_ENV) : null\n ];\n }", "public function storeRestoreConfig(RestoreJob $job, array $data);", "public function getSimiStoreConfigData($args){\n $storeApi = $this->simiObjectManager->get('Simi\\Simiconnector\\Model\\Api\\Storeviews');\n $storeManager = $this->simiObjectManager->get('\\Magento\\Store\\Model\\StoreManagerInterface');\n $params = array();\n if ($args) {\n $params = $args;\n }\n $data = array(\n 'resource' => 'storeviews',\n 'resourceid' => ($args && isset($args['storeId']))?$args['storeId']:'default',\n 'is_method' => 1,\n 'params' => $params,\n );\n $storeApi->setData($data);\n $storeApi->setSingularKey('storeviews');\n $storeApi->setBuilderQuery();\n return array(\n 'store_id' => (int)$storeManager->getStore()->getId(),\n 'currency' => $storeManager->getStore()->getCurrentCurrencyCode(),\n 'root_category_id' => (int)$storeManager->getStore()->getRootCategoryId(),\n 'pwa_studio_client_ver_number' => $this->simiObjectManager\n ->get('\\Magento\\Framework\\App\\Config\\ScopeConfigInterface')\n ->getValue('simiconnector/general/pwa_studio_client_ver_number'),\n 'config_json' => json_encode($storeApi->show()),\n );\n }", "private function saveFileJson()\n {\n return file_put_contents($this->arquivoJson, json_encode($this->registros));\n }" ]
[ "0.5442383", "0.5321089", "0.53007394", "0.5283939", "0.52755535", "0.5271828", "0.52715486", "0.5259849", "0.52583313", "0.5224741", "0.5214581", "0.5214183", "0.5209192", "0.5208492", "0.5196383", "0.5163366", "0.51496893", "0.51438284", "0.51024663", "0.5076412", "0.50661933", "0.50311625", "0.5025417", "0.50196034", "0.5015205", "0.49979705", "0.49646825", "0.49609512", "0.4940462", "0.49168193" ]
0.5836313
0
Stores the restore config as yml and by given name defined in job
public function storeRestoreConfig(RestoreJob $job, array $data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function restore($name) \n {\n // Copy the backup config file nd write the config values to the current config\n return copy($this->files[$name]['file_path'].'bak', $this->files[$name]['file_path']);\n }", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "private function save_configuration_bundle() {\n\t\t$this->configuration_bundle = array();\n\t\t// Some items must always be saved + restored; others only on a migration\n\t\t// Remember, if modifying this, that a restoration can include restoring a destroyed site from a backup onto a fresh WP install on the same URL. So, it is not necessarily desirable to retain the current settings and drop the ones in the backup.\n\t\t$keys_to_save = array('updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_restore_in_progress');\n\n\t\tif ($this->old_siteurl != $this->our_siteurl || (defined('UPDRAFTPLUS_RESTORE_ALL_SETTINGS') && UPDRAFTPLUS_RESTORE_ALL_SETTINGS)) {\n\t\t\tglobal $updraftplus;\n\t\t\t$keys_to_save = array_merge($keys_to_save, $updraftplus->get_settings_keys());\n\t\t\t$keys_to_save[] = 'updraft_backup_history';\n\t\t}\n\n\t\tforeach ($keys_to_save as $key) {\n\t\t\t$this->configuration_bundle[$key] = UpdraftPlus_Options::get_updraft_option($key);\n\t\t}\n\t}", "private function storeBackupConfig(BackupJob $job, OutputInterface $output)\n {\n $indices = array();\n\n /** @var Index $index */\n foreach($job->getMappings()->getIndices() as $index) {\n /** @var Type $type */\n foreach($index->getTypes() as $type) {\n $indices[] = array(\n 'index' => $index->getName(),\n 'type' => $type->getName()\n );\n }\n }\n\n $config = array(\n 'name' => $job->getName(),\n 'target' => $job->getTarget(),\n 'host' => $job->getHost(),\n 'port' => $job->getPort(),\n 'indices' => $indices,\n 'created_at' => $job->getCreatedAt()->format('Y-m-d H:i:s')\n\n );\n\n $this->filesystem->storeBackupConfig($job->getPath(), $config);\n\n $output->writeln('<info>*** Stored backup-config to file im yaml format ***</info>' . PHP_EOL);\n }", "public function save($name) \n {\n // Lowercase the $name\n $name = strtolower($name);\n \n // Check to see if we need to put this in an array\n $ckey = $this->files[$name]['config_key'];\n if($ckey != FALSE)\n {\n $Old_Data = $this->data[$name];\n $this->data[$name] = array(\"$ckey\" => $this->data[$name]);\n }\n\n // Create our new file content\n $cfg = \"<?php\\n\";\n\n // Loop through each var and write it\n foreach( $this->data[$name] as $key => $val )\n {\n switch( gettype($val) )\n {\n case \"boolean\":\n $val = ($val == true) ? 'true' : 'false';\n // donot break\n case \"integer\":\n case \"double\":\n case \"float\":\n $cfg .= \"\\$$key = \" . $val . \";\\n\";\n break;\n case \"array\":\n $val = var_export($val, TRUE);\n $cfg .= \"\\$$key = \" . $val . \";\\n\";\n break;\n case \"NULL\":\n $cfg .= \"\\$$key = null;\\n\";\n break;\n case \"string\":\n $cfg .= (is_numeric($val)) ? \"\\$$key = \" . $val . \";\\n\" : \"\\$$key = '\" . addslashes( $val ) . \"';\\n\";\n break;\n default: break;\n }\n }\n\n // Close the php tag\n $cfg .= \"?>\";\n \n // Add the back to non array if we did put it in one\n if($ckey != FALSE)\n {\n $this->data[$name] = $Old_Data;\n }\n \n // Copy the current config file for backup, \n // and write the new config values to the new config\n copy($this->files[$name]['file_path'], $this->files[$name]['file_path'].'.bak');\n if(file_put_contents( $this->files[$name]['file_path'], $cfg )) \n {\n return TRUE;\n } \n else \n {\n return FALSE;\n }\n }", "function restore_config_section($section_name, $new_contents) {\n\tglobal $g;\n\t$fout = fopen(\"{$g['tmp_path']}/tmpxml\", \"w\");\n\tfwrite($fout, $new_contents);\n\tfclose($fout);\n\n\t$xml = parse_xml_config(g_get('tmp_path') . \"/tmpxml\", null);\n\tif ($xml['pfsense']) {\n\t\t$xml = $xml['pfsense'];\n\t}\n\tif ($xml[$section_name]) {\n\t\t$section_xml = $xml[$section_name];\n\t} else {\n\t\t$section_xml = -1;\n\t}\n\n\t@unlink(g_get('tmp_path') . \"/tmpxml\");\n\tif ($section_xml === -1) {\n\t\treturn false;\n\t}\n\n\t/* Save current pkg repo to re-add on new config */\n\tunset($pkg_repo_conf_path);\n\tif ($section_name == \"system\" &&\n\t config_get_path('system/pkg_repo_conf_path')) {\n\t\t$pkg_repo_conf_path = config_get_path('system/pkg_repo_conf_path');\n\t}\n\n\tconfig_set_path($section_name, $section_xml);\n\tif (file_exists(\"{$g['tmp_path']}/config.cache\")) {\n\t\tunlink(\"{$g['tmp_path']}/config.cache\");\n\t}\n\n\t/* Restore previously pkg repo configured */\n\tif ($section_name == \"system\") {\n\t\tif (isset($pkg_repo_conf_path)) {\n\t\t\tconfig_set_path('system/pkg_repo_conf_path', $pkg_repo_conf_path);\n\t\t} elseif (config_get_path('system/pkg_repo_conf_path')) {\n\t\t\tconfig_del_path(('system/pkg_repo_conf_path'));\n\t\t}\n\t}\n\n\twrite_config(sprintf(gettext(\"Restored %s of config file (maybe from CARP partner)\"), $section_name));\n\tdisable_security_checks();\n\treturn true;\n}", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "public function fileclerk__config_dump()\n\t{\n\t\t$destination = Request::get('destination');\n\t\tdd($this->tasks->merge_configs($destination));\n\t}", "function configRestore($presets){\n\t\t\t\tglobal $scope_id;\n\t\t\t\t$resource = Mage::getSingleton('core/resource');\n\t\t\t\t$writeConnection = $resource->getConnection('core_write');\n\t\t\t\t$dbname = (string)Mage::getConfig()->getNode('global/resources/default_setup/connection/dbname');\n\t\t\t\tforeach($presets as $preset){\n\t\t\t\t\tforeach($preset as $section => $value){\n\t\t\t\t\t\t$query = \"DELETE FROM `\".$dbname.\"`.`core_config_data` WHERE scope_id = \".$scope_id.\" AND path = '\".$section.\"'\";\n\t\t\t\t\t\t$writeConnection->query($query);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$query = \"DELETE FROM `\".$dbname.\"`.`core_config_data` WHERE scope_id = \".$scope_id.\" AND path = 'meigee_harbour_appearance/presets/preset'\";\n\t\t\t\t$writeConnection->query($query);\n\t\t\t}", "public function storeBackupConfig($filepath, array $data);", "public function after_restore() {\n global $DB;\n\n // Get the blockid.\n $blockid = $this->get_blockid();\n\n // Extract block configdata and update it to point to the new activities\n if ($configdata = $DB->get_field('block_instances', 'configdata', array('id' => $blockid))) {\n\n $config = unserialize(base64_decode($configdata));\n $update = false;\n $types = array('collectpresentations', 'collectworkshops', 'collectsponsoreds',\n 'conference', 'workshops', 'reception', 'publish',\n 'registerdelegates', 'registerpresenters');\n foreach ($types as $type) {\n if ($this->after_restore_fix_cmid($config, $type)) {\n $update = true;\n }\n }\n\n // cache number of sections in this course\n $numsections = self::get_numesctions($this->get_courseid());\n\n $types = array('review', 'revise');\n foreach ($types as $type) {\n if ($this->after_restore_fix_sectionnum($config, $type, $numsections)) {\n $update = true;\n }\n }\n\n if ($update) {\n $configdata = base64_encode(serialize($config));\n $DB->set_field('block_instances', 'configdata', $configdata, array('id' => $blockid));\n }\n }\n }", "abstract protected function saveConfiguration($name, $value);", "public function config_save() {\n }", "public function saveConfig() {\r\n\t$configObj = new \\config(PROFILE_PATH . '/' . $this->name . '/config.php', TRUE);\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t$config = array_intersect_key(\\app::$config, $config);\r\n\treturn $configObj->saveConfig($config);\r\n }", "private function mergeConfig() {\n\t\t$this->mergeConfigFrom(\n\t\t\t__DIR__ . '/../config/config.php', 'sl-upload'\n\t\t);\n\t}", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "private function writeConfigFile()\n {\n if (!$this->configFile) {\n $confDir = $this->scratchSpace . DIRECTORY_SEPARATOR . 'config';\n mkdir($confDir);\n $this->configFile = $confDir . DIRECTORY_SEPARATOR . 'config.yml';\n }\n file_put_contents($this->configFile, $this->configYaml);\n $this->container->setParameter('config.filename', $this->configFile);\n }", "function workbench_post_set_config($name, $data) {\n $data = serialize($data);\n\n db_merge('workbench_post')\n ->key(array('data_name' => $name))\n ->fields(array(\n 'data' => $data,\n ))\n ->execute();\n}", "public function saveConfigOptions() {}", "protected function mergeConfig()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/Config/teamrole.php', 'teamrole'\n );\n }", "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "protected function getConfig($name)\n\t{\n\t\treturn $this->app['config'][\"nova-dynamic-lang.sections.stores.{$name}\"];\n\t}", "public function yandexYml()\r\n {\r\n if ($this->app->jbrequest->isPost()) {\r\n $this->_config->setGroup('config.yml', $this->app->jbrequest->getAdminForm());\r\n $this->setRedirect($this->app->jbrouter->admin(), JText::_('JBZOO_CONFIG_SAVED'));\r\n }\r\n\r\n $this->configData = $this->_config->getGroup('config.yml', $this->app->jbconfig->getList());\r\n\r\n $this->renderView();\r\n }", "public function restoreAfterRequest()\n {\n Facade::clearResolvedInstances();\n\n foreach ($this->backupedValuesBeforeRequest as $attri => $v) {\n// echo \"\\n $attri\\n\";\n// if (is_array($this->$attri))\n// echo 'dif:', count($this->$attri) - count($this->__oldValues[$attri]);\n $this->$attri = $v;\n }\n\n\n foreach ($this->restoreTool as $tool) {\n $tool();\n }\n\n\n if ($this->configNeedBackup ) {\n\n $config = $this->make('config');\n\n foreach ($config->changedConfig as $key => $value) {\n $config->set($key, $value);\n }\n $config->changedConfig = [];\n }\n\n $this->booted = false;\n }", "public function restored(Job $job)\n {\n //\n }", "protected function saveConfig() {\n return $this->updateConfigValues(array(\n 'PAYNETEASY_END_POINT',\n 'PAYNETEASY_LOGIN',\n 'PAYNETEASY_SIGNING_KEY',\n 'PAYNETEASY_SANDBOX_GATEWAY',\n 'PAYNETEASY_PRODUCTION_GATEWAY',\n 'PAYNETEASY_GATEWAY_MODE'\n ));\n }", "public function activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "protected function mergeConfig()\n {\n $this->mergeConfigFrom(__DIR__.\"/../config/{$this->name}.php\", $this->name);\n }", "public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }" ]
[ "0.6172373", "0.56435037", "0.545457", "0.53883547", "0.5220646", "0.51434946", "0.513365", "0.5122924", "0.51074976", "0.5084515", "0.50698566", "0.5062503", "0.5029822", "0.49935362", "0.4992858", "0.49293962", "0.4860095", "0.48567545", "0.48336267", "0.48173013", "0.47847652", "0.47718194", "0.47540367", "0.47394833", "0.4727462", "0.47236258", "0.47125027", "0.47015274", "0.46908414", "0.46871632" ]
0.7181794
0
Symlink given path to latest in file system
public function symlinkLatestBackup($path);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createSymlink()\n {\n if (!File::exists(public_path('theme'))) {\n $folder = $this->active()->get('namespace');\n\n if (File::exists(theme_path(\"{$folder}/public\"))) {\n // Delete existing symlink if present\n File::delete(public_path('theme'));\n\n // Create new theme symlink\n File::link(\n theme_path(\"{$folder}/public\"),\n public_path('theme')\n );\n }\n }\n }", "private function generateSymlinks()\n {\n $fs = new Filesystem();\n $uploadPath = $this->getContainer()->getParameter('contao.upload_path');\n\n // Remove the base folders in the document root\n $fs->remove($this->rootDir . '/web/' . $uploadPath);\n $fs->remove($this->rootDir . '/web/system/modules');\n $fs->remove($this->rootDir . '/web/vendor');\n\n $this->symlinkFiles($uploadPath);\n $this->symlinkModules();\n $this->symlinkThemes();\n\n // Symlink the assets and themes directory\n $this->symlink('assets', 'web/assets');\n $this->symlink('system/themes', 'web/system/themes');\n $this->symlink('app/logs', 'system/logs');\n }", "function phpbb_realpath($path)\n\t{\n\t\treturn phpbb_own_realpath($path);\n\t}", "function phpbb_realpath($path)\n\t{\n\t\treturn phpbb_own_realpath($path);\n\t}", "public function symlink(string $target, string $link): Promise;", "function realPath($path, $relative_to = NULL, $resolve_symlink = TRUE);", "public function checkIsSymlink($path);", "function readlink($path)\n{\n}", "public function link(){\n\t\tif( $this->link ) {\n\t\t\treturn $this->link;\n\t\t}//end if\n\n\t\t$this->link = @file_get_contents( $this->base_dir.'/'.$this->dir . $this->filename . '.link');\n\t\treturn $this->link;\n\t}", "public function createSoftLink()\n {\n if (stripos(__DIR__, 'vendor/adamasantares/migra-php') !== false) {\n shell_exec('ln -s ' . __FILE__ . ' ' . __DIR__ . '/../../../migra');\n shell_exec('chmod +x ' . __DIR__ . '/../../../migra');\n if (is_file(__DIR__ . '/../../../migra')) {\n ech(\" Soft link ./migra created\\n\", 'cyan');\n ech(\" Now you can use './migra' command from project's root folder\\n\", 'cyan');\n } else {\n ech(\" Some problem on soft link creation.\\n\", 'red');\n }\n } else {\n ech(\" No need to create soft link, you don't use Composer installation.\\n\", 'cyan');\n }\n }", "public function mirrorFileSymLinksTheGivenFileIfTheSettingSaysSo()\n {\n $sourcePathAndFilename = tempnam('FlowFileSystemPublishingTargetTestSource', '');\n $targetPathAndFilename = tempnam('FlowFileSystemPublishingTargetTestTarget', '');\n\n file_put_contents($sourcePathAndFilename, 'some data');\n touch($sourcePathAndFilename, time() - 5);\n\n $settings = array('resource' => array('publishing' => array('fileSystem' => array('mirrorMode' => 'link'))));\n\n $publishingTarget = $this->getAccessibleMock('TYPO3\\Flow\\Resource\\Publishing\\FileSystemPublishingTarget', array('dummy'));\n $publishingTarget->_set('settings', $settings);\n\n $publishingTarget->_call('mirrorFile', $sourcePathAndFilename, $targetPathAndFilename, true);\n $this->assertFileEquals($sourcePathAndFilename, $targetPathAndFilename);\n $this->assertTrue(Files::is_link($targetPathAndFilename));\n\n unlink($sourcePathAndFilename);\n unlink($targetPathAndFilename);\n }", "abstract public function getRemoteFile($path, $ref = 'master');", "private function symlinkFiles($uploadPath)\n {\n $this->createSymlinksFromFinder(\n $this->findIn($this->rootDir . '/' . $uploadPath)->files()->name('.public'),\n $uploadPath\n );\n }", "function rpath($path = '') {\n\t\t$versionPath = $this->deployPath;\n\t\t$remoteCmd = 'cd '.$versionPath.' && ls -l '.$path;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function CreatePublicSymLink()\n {\n $filemanager = $this->getFileManager();\n\n $fullPath = PATH_OUTBOX.'/public/'.$this->sqlData['cms_document_tree_id'].'/';\n if (!is_dir($fullPath)) {\n $filemanager->mkdir($fullPath, 0777, true);\n }\n $targetFile = $this->GetRealPath();\n\n $sSEOTargetFileName = $this->GetTargetFileName();\n if (!$this->localFileExists()) {\n // trigger error only in live mode because sometimes files are missing in the development environment\n trigger_error('Error: Download source ['.$targetFile.'] does not exist, or is not readable!', E_USER_NOTICE);\n } else {\n $filemanager->unlink($fullPath.'/'.$sSEOTargetFileName);\n if (!file_exists($fullPath.'/'.$sSEOTargetFileName)) {\n if ($filemanager->symlink($targetFile, $fullPath.'/'.$sSEOTargetFileName)) {\n $this->fileURL = URL_OUTBOX.'/public/'.$this->sqlData['cms_document_tree_id'].'/'.$sSEOTargetFileName;\n } else {\n trigger_error('Error: Unable to create SymLink ['.$targetFile.'] -> ['.$fullPath.'/'.$sSEOTargetFileName.']', E_USER_WARNING);\n }\n }\n }\n }", "abstract function mirror($locpath, $rempath);", "function auto_version($file) {\n // Source: https://stackoverflow.com/a/118886/752784\n if(strpos($file, '/') !== 0 || !file_exists($_SERVER['DOCUMENT_ROOT'] . $file))\n return $file;\n \n $mtime = filemtime($_SERVER['DOCUMENT_ROOT'] . $file);\n return preg_replace('{\\\\.([^./]+)$}', \".$mtime.\\$1\", $file);\n}", "public static function readlink($path, &$retval) {\n\n Log::in(\"passthru - readlink\");\n\n $retval = readlink($path);\n if ( $retval === false ) {\n Log::out(\"passthru - readlink - failed\");\n return -FUSE_ENOENT;\n }\n\n Log::out(\"passthru - readlink\");\n return 0;\n\n }", "public static function getLinkWithModificationTime($rootPath)\n {\n return $rootPath.'?'.filemtime(__dir__.'/../../'.$rootPath);\n }", "function getLatestReport($path){\n\t#$path = \"./reports\";\n\n\t$latest_ctime = 0;\n\t$latest_filename = '';\n\n\t$d = dir($path);\n\twhile (false !== ($entry = $d->read())) {\n\t\t$filepath = \"{$path}/{$entry}\";\n\t\t// could do also other checks than just checking whether the entry is a file\n\t\tif (is_file($filepath) && filectime($filepath) > $latest_ctime) {\n\t\t\t$latest_ctime = filectime($filepath);\n\t\t\t$latest_filename = $entry;\n\t \t}\n\t}\t\n\n\treturn $path . \"/\" . $latest_filename;\n\t// now $latest_filename contains the filename of the file that changed last\n}", "protected function discoverCurrentCoreSymlink() {}", "private function relativePathFix($path){\n\t\t// check if page is a generated javadoc\n\t\t$page_str = $this->doc->saveHTML();\n\t\tif(preg_match('%.*Generated by javadoc.*%', $page_str)){\n\t\t\t// if it is, fix the frame-based links so that the path isn't appended to itself infinitely\n\t\t\t$path = preg_replace('%(.*\\/).*\\.html\\?(.*\\/.*)%', \"$1$2\", $path);\n\t\t}\n\t\t$dirs = explode('/', $path);\n\t\t// check if link goes up a directory\n\t\tif($dirs[0] == '..'){\n\t\t\t$new_path = explode('/', $this->current_path);\n\t\t\tif(count($dirs) == 2){\n\t\t\t\tarray_pop($new_path);\n\t\t\t\tarray_pop($new_path);\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t} else {\n\t\t\t\t// remove slash from end of current path to ensure single slashes\n\t\t\t\tif(empty($new_path[count($new_path)-1]) || is_null($new_path[count($new_path)-1])){\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// go up directories\n\t\t\t\twhile($dirs[0] == '..'){\n\t\t\t\t\tarray_shift($dirs);\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// stick the two paths together to get new path\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t\t$new_path .= implode('/', $dirs);\n\t\t\t}\n\t\t// if link it to same dir, remove the ./\n\t\t} elseif($dirs[0] == '.'){\n\t\t\t$new_path = $this->current_path.substr($path, 2);\n\t\t// if the link starts at root, use it without modification\n\t\t} elseif(empty($dirs[0]) || is_null($dirs[0])){\n\t\t\t$new_path = $path;\n\t\t} elseif(strlen($dirs[0]) == 2){\n\t\t\t$new_path = '/'.$path;\n\t\t// default to adding the link's value to the end of the current directory\n\t\t} else {\n\t\t\t$new_path = $this->current_path.$path;\n\t\t}\n\t\t\n\t\t// if the link doesn't point to a file or query string, but has no end slash, add one\n\t\tif(count(explode('.', $new_path)) < 2 && count(explode('?', $new_path)) < 2 && substr($new_path, -1) != '/'){\n\t\t\t$new_path .= '/';\n\t\t}\n\t\treturn $new_path;\n\t}", "function rsd_link()\n {\n }", "public function updateSymlink($release = null)\n\t{\n\t\t// If the release is specified, update to make it the current one\n\t\tif ($release) {\n\t\t\t$this->releasesManager->updateCurrentRelease($release);\n\t\t}\n\n\t\t// Get path to current/ folder and latest release\n\t\t$currentReleasePath = $this->releasesManager->getCurrentReleasePath();\n\t\t$currentFolder = $this->rocketeer->getFolder('current');\n\n\t\treturn $this->symlink($currentReleasePath, $currentFolder);\n\t}", "function new_file_receiver_link($idfile, $idreceiver) {\n file_receiver_link($idfile, $idreceiver);\n}", "function readlink(string $path): string|false {}", "function phpbb_realpath($path)\n{\n\tglobal $phpbb_root_path, $phpEx;\n\n\treturn (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);\n}", "function phpbb_realpath($path)\n{\n\tglobal $phpbb_root_path, $phpEx;\n\n\treturn (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);\n}", "private function symlinkThemes()\n {\n /** @var SplFileInfo[] $themes */\n $themes = $this->getContainer()->get('contao.resource_finder')->findIn('themes')->depth(0)->directories();\n\n foreach ($themes as $theme) {\n $path = str_replace($this->rootDir . DIRECTORY_SEPARATOR, '', $theme->getPathname());\n\n if (0 === strpos(strtr($path, '\\\\', '/'), 'system/modules/')) {\n continue;\n }\n\n $this->symlink($path, 'system/themes/' . basename($path));\n }\n }", "function last_version($file_name) {\n echo $file_name .\"?v=\". filemtime($file_name);\n}" ]
[ "0.578366", "0.5777974", "0.57756996", "0.57756996", "0.5737439", "0.57171214", "0.5693361", "0.56610405", "0.55402416", "0.5534924", "0.54666185", "0.5437523", "0.53929496", "0.5317567", "0.52793354", "0.52425486", "0.52300245", "0.5204866", "0.51956517", "0.51622427", "0.51614535", "0.5118902", "0.5056517", "0.5050752", "0.5033686", "0.5020169", "0.4995598", "0.4995598", "0.49898595", "0.49469268" ]
0.8288752
0
Loads a file and parses the yaml content into an array
public function loadYamlConfig($filepath);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parseYamlToArray(): array\n {\n // Get the file contents\n $yaml = (file_get_contents($this->filePath));\n\n // Create an array of the lines in the yaml file\n $lines = explode(PHP_EOL, $yaml);\n\n // Initialize the array\n $array = [];\n\n // Loop through the lines\n foreach ($lines as $line) {\n // Check if the line matches the list format (space, space, dash, space)\n if (str_starts_with($line, \" - \")) {\n // Remove the list key from the line to just get the slug\n // and add it to the array. The index will be automatically\n // assigned by using $array[]\n $array[] = substr($line, 4);\n }\n }\n\n // Return the array\n return $array;\n }", "public static function load(string $file) : array\n {\n try\n {\n $data = SymfonyYaml::parse(file_get_contents($file));\n }\n catch (ParseException $e)\n {\n throw new OptionLoaderException(\n \"File $file does not appear to be valid YAML: \"\n .$e->getMessage()\n );\n }\n\n return $data;\n }", "protected function loadYml($path)\n {\n if (empty($path)) {\n return [];\n }\n // TODO: Perhaps cache these alias files, as they may be read multiple times.\n return (array) Yaml::parse(file_get_contents($path));\n }", "private function load()\n {\n if ($this->sites) {\n return;\n }\n $data = Yaml::parse(file_get_contents($this->file));\n $this->sites = $data['sites'];\n }", "public function loadFromFile()\n {\n $this->getLogger()->debug('Reading metadata from ' . $this->defFile);\n $fields = Yaml::parse($this->defFile);\n if (!is_array($fields)) {\n $fields = array();\n $this->getLogger()->warning('No definition found in metadata file.');\n }\n $res = array();\n foreach ($fields as $field_data) {\n $res[$field_data['id']] = $field_data;\n }\n ksort($res);\n return $res;\n }", "protected function loadData($file)\n {\n $path = realpath(dirname(__FILE__) . '/../fixtures/');\n\n return Yaml::parse(file_get_contents($path . '/' . $file . '.yml'));\n }", "public function parseYaml()\n {\n if ($this->getMimeType() == 'application/x-yaml' || $this->getMimeType() == 'text/yaml') {\n return yaml_parse($this->getContents());\n }\n }", "private function load($file) {\n $yml = new \\Yaml($file);\n $data = $yml->parse();\n\n $this->name = \\a::get($data, 'name', NULL);\n $this->theme = \\a::get($data, 'theme', \\c::get('theme', 'grass'));\n $this->eventdate = \\a::get($data, 'eventdate', NULL);\n $this->intro = \\a::get($data, 'intro', NULL);\n $this->storeFields(\\a::get($data, 'fields', FALSE));\n $this->action = \\a::get($data, 'action', NULL);\n }", "function yml_parse_file($ymlFile)\n {\n return yml::parseFile($ymlFile);\n }", "private function parseYaml($contents)\n {\n $result = Yaml::parse($contents);\n return $result;\n }", "protected function loadMappingFile($file)\n {\n return Yaml::parse(file_get_contents($file));\n }", "private function loadConfigYamlFile($filepath)\n {\n if (!file_exists($filepath)) {\n throw new \\Exception('Project config file could not be loaded! \"'.$filepath.'\"');\n }\n return YamlHelper::parse(file_get_contents($filepath));\n }", "public static function loadFromFile($path)\n {\n // Allow empty config\n if (!file_exists($path)) {\n return [];\n }\n $content = file_get_contents($path);\n return self::parseContent($content);\n }", "protected static function parseYaml($filename) {\n if (!file_exists($filename)) {\n throw new \\Exception('A config.yml file must exist in the project root.');\n }\n return Yaml::parse(file_get_contents($filename));\n }", "public static function getYamlContents(string $filename)\n {\n $result = null;\n if (file_exists($filename)) {\n $result = Yaml::parse(file_get_contents($filename));\n }\n return $result;\n }", "public function getConfig($file) {\n $config = array();\n if (file_exists($file)) {\n $yaml = new Parser();\n $config = $yaml->parse(file_get_contents($file));\n }\n return $config;\n }", "function YAMLLoad($input) {\n\t\t$spyc = new Spyc;\n\t\treturn $spyc->load($input);\n\t}", "protected function loadFile($file)\n {\n if (!stream_is_local($file)) {\n throw new InvalidArgumentException(sprintf('This is not a local file \"%s\".', $file));\n }\n\n if (!file_exists($file)) {\n throw new InvalidArgumentException(sprintf('The service file \"%s\" is not valid.', $file));\n }\n\n return Yaml::parse(file_get_contents($file));\n }", "public function load(string $path): array;", "public function fromFile(string $filename): array;", "private function loadArray(){\n if(file_exists($this->fullPath.$this->arrayFile)){\n include_once($this->fullPath.$this->arrayFile);\n if(!empty($arCfg)){\n $this->loadConfigs($arCfg);\n }\n }\n }", "public static function load(): array\n {\n $data = [];\n if($storage_data = @file_get_contents(self::$path.self::$filename)) {\n $data = unserialize($storage_data);\n } \n\n return $data;\n }", "function LoadData($file)\n {\n // Read file lines\n $lines = file($file);\n $data = array();\n foreach($lines as $line)\n $data[] = explode('|',trim($line));\n return $data;\n }", "public function load() : array;", "public static function fileToAr($file) {\n if (substr($file = trim($file), strlen($file) - 5) != '.haml') {\n $file .= '.haml';\n }\n return file_exists($file)? explode(PHP_EOL, file_get_contents($file)) : FALSE;\n }", "public static function load()\n {\n $configFile = self::getConfigFilePath();\n\n if (!is_file($configFile)) {\n self::save([]);\n }\n\n $config = require($configFile);\n\n if (!is_array($config))\n return array();\n\n return $config;\n }", "public function parseFile(string $file)\n {\n if (false === \\function_exists('yaml_parse_file')) {\n throw new Exception('Pecl YAML extension is not installed');\n }\n\n return \\yaml_parse_file($file);\n }", "public function load($file);", "public function load($file);", "public function load($file);" ]
[ "0.75977933", "0.7121287", "0.697036", "0.6869515", "0.683605", "0.6696271", "0.6633742", "0.6614876", "0.6448445", "0.638967", "0.63781065", "0.6295298", "0.62704974", "0.62660986", "0.62185574", "0.61772156", "0.60896844", "0.6071653", "0.6040868", "0.6039038", "0.60329026", "0.60326874", "0.60021764", "0.5995416", "0.5981102", "0.5972795", "0.59118223", "0.5906116", "0.5906116", "0.5906116" ]
0.7275121
1
Loads the mappings that are located in the filesystem of stored backup
public function loadMappings($filepath);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function _loadMappingFile($file);", "abstract protected function _loadMappingFile($file);", "public function load()\n {\n foreach ($this->aMappingConfiguration as $sLinkedEntity => $aMappingSetup) {\n $this->loadMapped(new $sLinkedEntity());\n }\n }", "public function load_maps_file()\r\n {\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file from manaserv');\r\n\r\n // load the configured path and filename from config file\r\n $this->maps_file = $this->CI->config->item('manaserv-data_path') . XML_MAPS_FILE;\r\n\r\n // check if the file really exists and is readable\r\n if (!file_exists($this->maps_file))\r\n {\r\n show_error('The '. XML_MAPS_FILE .' file ' . $this->maps_file . ' configured'.\r\n ' in mana_config.php cannot be found');\r\n return;\r\n }\r\n else\r\n {\r\n // reset current maps\r\n $this->maps = array();\r\n\r\n // load and parse the xml file\r\n $maps = simplexml_load_file($this->maps_file);\r\n foreach ($maps as $map)\r\n {\r\n // loop through defined maps and build internal array\r\n $m = new Map(\r\n intval($map->attributes()->id), // id\r\n strval($map->attributes()->name) // name\r\n );\r\n\r\n // set description if available\r\n if (strlen(strval($map->attributes()->description)) > 0)\r\n {\r\n $m->setDescription(strval($map->attributes()->description));\r\n }\r\n\r\n $this->maps[$m->getId()] = $m;\r\n }\r\n\r\n $this->flush_maps();\r\n }\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file ... done');\r\n }", "function loadFileMap()\r\n{\r\n return false;\r\n $file_map_path = Gravitycar\\lib\\builders\\FileMapBuilder::getFileMapPath();\r\n if (file_exists($file_map_path)) {\r\n require_once($file_map_path);\r\n } else {\r\n buildFileMap();\r\n require_once($file_map_path);\r\n }\r\n return $map;\r\n}", "protected function load()\n {\n if ($this->cache->contains($this->getCacheKey())) {\n $this->map = $this->cache->fetch($this->getCacheKey());\n } else {\n $this->generateMap();\n }\n }", "public function getMappings();", "public function getMappings();", "private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }", "function loadIniFiles()\n {\n \n $ff = HTML_FlexyFramework::get();\n $ff->generateDataobjectsCache(true);\n $this->dburl = parse_url($ff->database);\n \n \n $dbini = 'ini_'. basename($this->dburl['path']);\n \n \n $iniCache = isset( $ff->PDO_DataObject) ? $ff->PDO_DataObject['schema_location'] : $ff->DB_DataObject[$dbini];\n if (!file_exists($iniCache)) {\n return;\n }\n \n $this->schema = parse_ini_file($iniCache, true);\n $this->links = parse_ini_file(preg_replace('/\\.ini$/', '.links.ini', $iniCache), true);\n \n\n \n }", "private function loadFiles()\n {\n return $this->loadResourcesFiles()->mapWithKeys(function ($value, $key) {\n return [$this->removeExtension($key) => $value];\n });\n }", "abstract public function loadAll();", "protected function getMappings()\n {\n return json_decode($this->mappings, true);\n }", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "protected function load()\n {\n // Can we read the intended path?\n if (is_readable($this->mapPath)) {\n // Get the map\n $this->map = unserialize(file_get_contents($this->mapPath));\n\n // Get the version and remove it from the map\n $this->version = $this->map['version'];\n unset($this->map['version']);\n\n return true;\n }\n\n return false;\n }", "public static function loadStrapper() {\n\t\t\n\t}", "private function ensureNameMapsLoaded(): void\n {\n if (null === $this->tableToClassesMap) {\n $this->loadNameMaps();\n }\n }", "protected function load()\n\t{\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "public function getAssetMappings();", "protected function getCachedMapping()\n {\n $cache = Injector::inst()->get(CacheInterface::class .'.gridfieldimporter');\n if ($result = $cache->get($this->cacheKey())) {\n return unserialize($result);\n }\n }", "public function getExportMappings()\n {\n }", "private function loadNameMaps(): void\n {\n $this->tableToClassesMap = [];\n $this->classToTableMap = [];\n $this->classToColumnsMap = [];\n $names = $this->doctrine->getManagerNames();\n foreach ($names as $name => $id) {\n $manager = $this->doctrine->getManager($name);\n if ($manager instanceof EntityManagerInterface) {\n $allMetadata = $this->getAllMetadata($manager);\n foreach ($allMetadata as $metadata) {\n $tableName = $metadata->getTableName();\n if (!empty($tableName)) {\n $className = $metadata->getName();\n $this->tableToClassesMap[$tableName][] = $className;\n $this->classToTableMap[$className] = $tableName;\n\n // Column mapping\n $this->classToColumnsMap[$className] = $metadata->getColumnNames();\n\n if (!empty($metadata->discriminatorColumn)) {\n $this->classToColumnsMap[$className][] = $metadata->discriminatorColumn['name'];\n }\n\n foreach ($metadata->getAssociationMappings() as $relation) {\n if (\\array_key_exists('joinColumns', $relation) && \\is_array($relation['joinColumns'])) {\n foreach ($relation['joinColumns'] as $joinColumn) {\n $this->classToColumnsMap[$className][] = $joinColumn['name'];\n }\n }\n }\n }\n }\n }\n }\n }", "public static function load($mapName)\n {\n\n foreach (Conf::$confPath as $path) {\n\n if (!$this->source)\n $menuPath = $path.'/menu/'.$this->name.'/';\n else\n $menuPath = $path.'/menu/'.$this->source.'/';\n\n if (!file_exists($menuPath))\n continue;\n\n $folder = new LibFilesystemFolder($menuPath);\n\n foreach ($folder->getFiles() as $file)\n include $file->getName(true);\n\n // break after found data\n break;\n }\n\n }", "public function getMapping() {}", "protected function LoadKeysCache()\n\t{\n\t\t$sFileContent = @file_get_contents($this->m_sCacheFileName);\n\t\tif (!empty($sFileContent))\n\t\t{\n\t\t\t$aCache = unserialize($sFileContent);\n\t\t\t$this->m_aKeys = $aCache['keys'];\n\t\t\t$this->m_aObjectsCache = $aCache['objects']; \n\t\t\t$this->m_oChange = $aCache['change'];\n\t\t\t$this->m_aErrors = $aCache['errors'];\n\t\t\t$this->m_aWarnings = $aCache['warnings'];\n\t\t}\n\t}", "public function load()\n {\n\n /*\n $folder = new LibFilesystemFolder(PATH_GW.'data/bdl/');\n $files = $folder->getPlainFiles();\n\n $this->data = array();\n\n // Load als xmi Files\n foreach ($files as $file)\n if (substr($file, -3 , strlen($file)) == \"xml\")\n $this->data[] = $file;\n */\n\n $data = array();\n\n include PATH_GW.'conf/map/bdl/projects/projects.php';\n\n $this->data = $data;\n\n ksort($this->data);\n\n }", "public function availableMappings()\n {\n $faker = Faker\\Factory::create();\n\n return [\n [$faker->url, Web::class],\n [$faker->url, Web::class],\n ['ssl://www.google.com', Web::class],\n ['https://www.google.com', Web::class],\n ['file://myfile', File::class],\n ];\n }", "private function restorePagesets() {\n foreach ($this->oldPagesetMappingDatabase as $pageSet) {\n if ($pageSet['page_set_id'] < CP_FIRST_CUSTOM_PAGESET_ID && !($pageSet['attr'] & UA_ATTR_ENABLED)) {\n // since the page set was previously NOT enabled, update the database without the enabled flag\n \\RightNow\\Api::cp_ua_mapping_update(array(\n 'page_set_id' => $pageSet['page_set_id'],\n 'attr' => $pageSet['attr'] | !UA_ATTR_ENABLED\n ));\n }\n }\n if(!$this->skipDeploy) {\n if ($this->oldPagesetMapping !== false) {\n try {\n FileSystem::filePutContentsOrThrowExceptionOnFailure($pageSetMappingPath, $pageSetMapping);\n }\n catch (\\Exception $e) {\n //Don't throw error during unit tests\n }\n }\n else {\n @unlink($pageSetMappingPath);\n }\n }\n }", "abstract protected function getMapping();", "abstract protected function getMapping();" ]
[ "0.6554071", "0.6554071", "0.62022865", "0.5865084", "0.5814947", "0.5800645", "0.56852984", "0.56852984", "0.5676323", "0.5507039", "0.55041534", "0.54700106", "0.54523396", "0.5421894", "0.5416631", "0.54122347", "0.5384894", "0.53806424", "0.5374201", "0.53559923", "0.535461", "0.53419715", "0.5333762", "0.53230596", "0.53171784", "0.5310101", "0.53076893", "0.5303904", "0.52804744", "0.52804744" ]
0.7238527
0
Loads all files for a index/type
public function loadDataFiles($path, $index, $type);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndexFiles()\n {\n $manager = new Manager(['module' => $this->module]);\n $manager->indexAll();\n }", "function _loadIndex () \n {\n $this->_enterSection('_loadIndex');\n \n $index = array();\n \n $a = strcspn ($this->_options['dsn'], ':');\n $proto = substr ($this->_options['dsn'], 0, $a);\n $path = substr ($this->_options['dsn'], $a + 3);\n\n switch ($proto) {\n case 'file' : \n $f = sprintf($path, $this->_indexName);\n $data = '';\n if ($fp = @fopen ($f,'r')) {\n $this->_enterSection('_loadIndex (acquiring read lock)');\n flock($fp, LOCK_SH);\n $this->_leaveSection('_loadIndex (acquiring read lock)');\n $this->_enterSection('_loadIndex (reading data)');\n while (!feof($fp)) {\n $data .= fread ($fp, 0xFFFF);\n }\n fclose ($fp);\n $this->_leaveSection('_loadIndex (reading data)');\n }\n \n $this->_enterSection('_loadIndex (unserializing/uncompressing)');\n if ($data) {\n if ($this->_options['gz_level']) {\n $index = unserialize(gzuncompress($data));\n } else {\n $index = unserialize($data);\n }\n }\n $this->_leaveSection('_loadIndex (unserializing/uncompressing)');\n break;\n }\n $this->_index = $index;\n \n $this->_leaveSection('_loadIndex');\n }", "public function loadAll()\n {\n $this->setAll(array());\n $d = dir($this->getPath());\n $this->load($d);\n $d->close();\n }", "public function uses_file_indexing() {\n return true;\n }", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "public function files($index){\n $this->httpRequest->files($index);\n }", "private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }", "public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}", "private function readTypes() {\n $files = $this->path->read();\n\n foreach ($files as $file) {\n if ($file->isDirectory()) {\n continue;\n }\n\n $this->readType($file->getName());\n }\n }", "public function load(): void\n {\n if ($this->paths->isEmpty()) {\n return;\n }\n\n foreach ((new Finder)->in($this->paths->toArray())->files() as $file) {\n $this->loadAction(\n $this->getClassnameFromPathname($file->getPathname())\n );\n }\n }", "public static function loadAll();", "abstract public function loadAll();", "protected function loadFiles() {\n if ($this->loaded === true) {\n return;\n }\n $iter = new RecursiveDirectoryIterator($this->directory);\n $this->iterateFiles($iter);\n $this->loaded = true;\n }", "public static function getIndexFiles()\n\t{\n\t\tif (empty(MHTTPD::$config['Server']['index_files'])) {\n\t\t\treturn array();\n\t\t}\n\t\treturn MHTTPD::$config['Server']['index_files'];\n\t}", "public function all() {\r\n\t\tthrow new Exception('Cannot load all for this type of file, use the next() method.');\r\n\t}", "private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "protected static function initIndexes()\n {\n static::$indexes = [];\n foreach (static::$indexesConf as $name => &$index) {\n if (!isset($index['type'])) {\n $index['type'] = 'Generic';\n }\n $index['name'] = $name;\n $index['modelClass'] = static::class;\n\n $class = ClassFinder::getNamespace(\\Zer0\\Model\\Indexes\\AbstractIndex::class) . '\\\\' . $index['type'];\n\n static::$indexes[$name] = new $class($index);\n }\n }", "private function loadFiles()\n {\n return $this->loadResourcesFiles()->mapWithKeys(function ($value, $key) {\n return [$this->removeExtension($key) => $value];\n });\n }", "public function indexCrawledDocuments() {\n\t\tforeach ( $this->aFiles as $sFile ) {\n\t\t\t$oRepoFile = new SplFileInfo( $sFile );\n\t\t\tif ( !$oRepoFile->isFile() ) continue;\n\n\t\t\t$sFileName = $oRepoFile->getFilename();\n\t\t\t$sDocType = $this->mimeDecoding( $oRepoFile->getExtension() );\n\t\t\tif ( !$this->checkDocType( $sDocType, $sFileName ) ) continue;\n\n\t\t\tif ( !$this->oMainControl->bCommandLineMode ) set_time_limit( $this->iTimeLimit );\n\n\t\t\tif ( $this->sizeExceedsMaxDocSize( $oRepoFile->getSize(), $sFileName ) ) continue;\n\n\t\t\t//Insert URL to Filename\n\t\t\t$rURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepo' );\n\t\t\t$sURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepoUrl' );\n\t\t\t//Replace realpath with webserver url only if $sUrl is set, otherwise work as before\n\t\t\tif($sURL == \"\"){\n\t\t\t $sRepoFileRealPath = \"file:///\" . $oRepoFile->getRealPath();\n\t\t\t}else{\n\t\t\t $sRepoFileRealPath = $this->getFilePath( $rURL, $sURL, $oRepoFile );\n\t\t\t}\n\n\t\t\t$timestampImage = wfTimestamp( TS_ISO_8601, $oRepoFile->getMTime() );\n\n\t\t\tif ( $this->checkExistence( $oRepoFile->getRealPath(), 'external', $timestampImage, $sFileName ) ) continue;\n\n\t\t\t$text = $this->getFileText( $oRepoFile->getRealPath(), $sFileName );\n\n\t\t\t$doc = $this->makeRepoDocument( $sDocType, utf8_encode( $sFileName ), $text, utf8_encode( $sRepoFileRealPath ), $timestampImage );\n\t\t\t$this->writeLog( $sFileName );\n\n\t\t\twfRunHooks( 'BSExtendedSearchBeforeAddExternalFile', array( $this, $oRepoFile, &$doc ) );\n\n\t\t\tif ( $doc ) {\n\t\t\t\t// mode and ERROR_MSG_KEY are only passed for the case when addsFile fails\n\t\t\t\t$this->oMainControl->addDocument( $doc, $this->mode, self::S_ERROR_MSG_KEY );\n\t\t\t}\n\t\t}\n\t}", "public function load(): array\n {\n $scripts = [];\n\n foreach ($this->path as $path) {\n // Get files\n foreach ($this->filetypes as $filetype) {\n $scripts[] = glob($path . \"/*.{$filetype}\");\n }\n }\n\n return array_reduce($scripts, 'array_merge', []);\n }", "public function buildIndexes() {\n\t\t$return = array();\n\t\t$indexes = array(\n\t\t\t\"work\" => __DIR__.'/../content/work',\n\t\t\t\"authors\" => __DIR__.'/../content/authors',\n\t\t\t\"tags\" => __DIR__.'/../content/tags'\n\t\t);\n\t\tforeach ($indexes as $type => $location) {\n\t\t\tforeach(glob($location . '/*.json') as $file) {\n\t\t\t\t$entry = json_decode(file_get_contents($file),true);\n\t\t\t\tif ($entry) {\n\t\t\t\t\t$key = str_replace(array('.json',$location.'/'),'',$file);\n\t\t\t\t\t$return[$type][$key] = $entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// move author details\n\t\t$details = $return['authors'];\n\t\tunset($return['authors']);\n\t\t$return['authors']['details'] = $details;\n\n\t\t// add author details and permalink to work\n\t\tforeach ($return['work'] as $key => &$entry) {\n\t\t\t$entry['permalink'] = $this->root_url . '/view/' . $entry['id'];\n\t\t\tif (is_array($return['authors']['details'][$entry['author_id']])) {\n\t\t\t\t$entry['author_name'] = $return['authors']['details'][$entry['author_id']]['name'];\n\t\t\t\t$entry['author_byline'] = $return['authors']['details'][$entry['author_id']]['byline'];\n\t\t\t}\n\t\t}\n\n\t\t// sort work to newest-first\n\t\tuasort($return['work'], array(\"Harvard\", \"sortIndex\"));\n\n\t\t// do tag stuff\n\t\t$details = $return['tags'];\n\t\tunset($return['tags']);\n\t\t$return['tags']['details'] = $details;\n\t\t$tag_list = array();\n\t\t$tag_index = array();\n\t\t$author_index = array();\n\t\tif (is_array($return['work'])) {\n\t\t\tforeach ($return['work'] as $work) {\n\t\t\t\t$author_index[$work['author_id']][] = $work['id'];\n\t\t\t\tif (is_array($work['tags'])) {\n\t\t\t\t\tif (count($work['tags'])) {\n\t\t\t\t\t\tforeach ($work['tags'] as $tag) {\n\t\t\t\t\t\t\t$tag_index[$tag][] = $work['id'];\n\t\t\t\t\t\t\t$tag_list[] = $tag;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$tag_list = array_unique($tag_list); // trim tags to unique\n\t\tsort($tag_list); // alphabetize\n\n\t\t// format the tag list for mustache iteration\n\t\t$tmp_array = array();\n\t\tforeach ($tag_list as $tag) {\n\t\t\t$tmp_array[]['tag'] = $tag;\n\t\t}\n\t\t$tag_list = $tmp_array;\n\n\t\t$return['tags']['count'] = count($tag_list);\n\t\t$return['tags']['list'] = $tag_list;\n\t\t$return['tags']['index'] = $tag_index;\n\n\t\t$return['authors']['index'] = $author_index;\n\n\t\tforeach ($return as $type => $data) {\n\t\t\tfile_put_contents(__DIR__.'/../content/_generated_'.$type.'.json',json_encode($data));\n\t\t}\n\t\treturn $return;\n\t}", "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 provideTestLoadsOfFiles()\n {\n AutoloaderTestHelper::deleteDirectory(\"testLoadsOfFiles\");\n $alTestHelper = new AutoloaderTestHelper($this);\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\"anyClass\", \"testLoadsOfFiles/flat\");\n\n }\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\n \"anyClass\", \"testLoadsOfFiles\" . str_repeat('/sub', $i)\n );\n\n }\n\n return array(\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/sub\"\n )\n );\n }", "public function load_files() {\n\n\t\t// Load our admin-related functions.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( GUPR_DIR . 'lib/admin.php' );\n\t\t}\n\t}" ]
[ "0.7026701", "0.6680536", "0.647908", "0.6445907", "0.6317242", "0.6317242", "0.6317242", "0.6315559", "0.6315559", "0.6302977", "0.6271985", "0.6227512", "0.61374295", "0.6104281", "0.60813004", "0.6061601", "0.60111076", "0.59672964", "0.5876414", "0.5861103", "0.5832739", "0.5810114", "0.5779073", "0.5767712", "0.57504827", "0.5744027", "0.5712171", "0.56970114", "0.5670022", "0.56604046" ]
0.7991931
0
Returns the Video publications of a single user.
public function getVideoPublications($user) { return $this->getByCategoryType('Video', $user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_user_video($user_id){\n\n $user_id = intval($user_id);\n $uid = $this->get_uid($user_id);\n\n $query = \"SELECT `id`, `source`, `uid`, `filename_or_link` FROM `user_video` WHERE `uid`='$uid';\";\n\n $user_videos = [];\n\n if ($res = sql::$con->query($query, MYSQLI_STORE_RESULT)) {\n\n while ($data = $res->fetch_array(MYSQLI_ASSOC)) {\n if($data['source'] == 'local'){\n $file_path = '/file/video/'.$uid.'/'.$data['filename_or_link'];\n $data['filename_or_link'] = $file_path;\n }\n $user_videos[] = $data;\n }\n\n if(is_object($res)){\n $res->close();\n sql::$con->store_result();\n }\n\n }\n /*\n * FOR EXAMPLE FRAMES\n * <iframe style=\"width: 485px; min-height: 411px;\" src=\"<YOUTUBE-LINK>\" frameborder=\"0\" allowfullscreen allow=\"accelerometer; encrypted-media; gyroscope; picture-in-picture\"></iframe>\n * <iframe style=\"width: 485px; min-height: 411px;\" src=\"<VIMEO-LINK>\" frameborder=\"0\" allowfullscreen webkitallowfullscreen mozallowfullscreen ></iframe>\n *\n * */\n\n return $user_videos;\n }", "public function fetchUserVideos(){\n\t\t\tif(!empty($_SESSION['vid_user_id'])){\n\t\t\t\t$user_id = $_SESSION['vid_user_id'];\n\n\t\t\t\t// get videos\n\t\t\t\t$getVideos = \"SELECT videos.video_tag, videos.video, videos.id, videos.user_id, videos.video_title, videos.about, videos.views, channels.profile_picture, channels.channel_name, channels.created_at, channels.channel_tag\t, categories.category_name FROM videos LEFT JOIN channels ON channels.id = videos.channel_id LEFT JOIN categories ON categories.id = channels.category_id WHERE videos.user_id = '\".$user_id.\"' ORDER BY videos.created_at DESC\";\n\t\t\t\t$getVideos = mysqli_query($this->plug, $getVideos);\n\t\t\t\t$dataArr = [];\n\t\t\t\twhile ($row = mysqli_fetch_assoc($getVideos)) {\n\t\t\t\t\t# code...\n\t\t\t\t\tarray_push($dataArr, $row);\n\t\t\t\t}\n\n\t\t\t\treturn $dataArr;\n\t\t\t}\n\t\t}", "public function getLastVideoPublication($user){\n return $this->getByCategoryTypeLimited('Video', $user);\n }", "function videos() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n if ($id > 0) {\n $query = \"select * from videos where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n\n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function videosFromSubscriptions(User $user,$limit = 5)\n\t{\n\t\treturn $user->subscribedChannels()->with(['videos' => function ($query) use ($limit) \n\t\t\t{\n\t\t\t\t$query->visible()->take($limit); \n\t\t\t}])->get()->pluck('videos')->flatten()->sortByDesc('created_at');\n\n\n\n\t}", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "public function getVideos()\n\t{\n\t\t$params = &JComponentHelper::getParams('com_jvimeo');\n\t\t$vimeo = new VimeoHelper(\n\t\t\t\t$params->get('consumer_key'),\n\t\t\t\t$params->get('consumer_secret'),\n\t\t\t\t$params->get('access_token'),\n\t\t\t\t$params->get('access_token_secret')\n\t\t);\n\t\t$videos = $vimeo->call('vimeo.videos.getUploaded', array('user_id' => $params->get('user_id')));\n\t\treturn $videos;\n\t}", "public function getAllVideosByUserId(Request $request)\n {\n $user = $request->user();\n\n $videos = $this->contactRepo->getFullVideosListByUserId($user);\n\n return response()->json($videos);\n }", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public function ViewVideo($user_id){\r\n\t\t\t$select = $this->db->query(\"SELECT * FROM $this->_dataMasjid WHERE $this->_UserID='$user_id' \");\r\n\t\t\t$view = $select->fetch_object();\r\n\t\t\treturn $view;\r\n\t\t}", "public function get_videos()\r\n\t\t{\r\n\t\t\t$videos = $this->obj->result;\r\n\t\t\treturn $videos;\r\n\t\t}", "public function obtainVideos()\n {\n return $this->performRequest('GET','/videos');\n }", "public function getVideos()\n {\n return $this->videos;\n }", "function later_video_list_of($user_id) {\n\n global $data_base;\n\n $request = $data_base->prepare(\"\n SELECT *\n FROM imago_info_video i\n INNER JOIN imago_my_later l\n ON i.content_id = l.content_id\n AND i.section_id = l.section_id\n AND i.episod_id = l.episod_id\n AND i.type = 'tvshow'\n AND l.user_id = ?\n ORDER BY l.add_date DESC\n \");\n\n $request->execute(array($user_id));\n\n return $request->fetchAll(PDO::FETCH_ASSOC);\n }", "public function index()\n {\n $user = Auth::guard('api')->user();\n\n if (!$user){\n return response()->json(['status'=>'Must be logged in to view videos'], 401);\n }\n\n //$user_id = Auth::id();\n $user_id = $user->id;\n\n $videos = Video::where('user', $user_id)->get();\n// return view('videos/index', array('videos' => $videos));\n return response()->json($videos);\n }", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "public function videoPosts()\n {\n return $this->hasMany('App\\VideoPost', 'user-id');\n }", "public function videos()\n {\n $this->videos->videosAttrs = ['title', 'url', ['thumb', 'medium']];\n $this->videos->limit = 2;\n $records = $this->videos->all();\n\n return ['videos' => $records];\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public static function getAllVideo()\n {\n \treturn VedioGallary::all();\n }", "public function videos()\n {\n return $this->morphMany(Video::class, 'videoable');\n }", "public function show()\n {\n $user = Auth::user();\n $videos = VideoView::where('name',$user->name)->get();\n return view('user.profile',compact('user','videos'));\n }", "public function videos()\n {\n return $this->morphedByMany('App\\Video', 'taggable');\n }", "public function publishedBy($user_id)\n {\n return $this->model->where(compact('user_id'))->get();\n }", "static function videographers(string $pid): array {\r\n return self::contributors(MJKMeta_ACF_Auth::get(\r\n MJKMeta_ACF_Auth::videographers, $pid));\r\n }", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function allVideos()\n {\n return view('orientation-route::all-videos')\n ->withVideos($this->video->orderBy('order_number', 'asc')->get());\n }", "public function myVideos()\n {\n if (Auth::check()) {\n $videos = DB::select('select * from video where fk_owner = ? order by created_at DESC', [Auth::id()]);\n $likes = Like::all();\n return view('videos.myvideo', compact(['videos', 'likes']));\n }\n\n return redirect()->route('videos.index')->with('warning', 'You must be connected.');\n }", "public function index()\n {\n //\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n\n $videos = Video::all();\n\n\n \n\n return view('admin.videos.index', compact('videos', 'usuario'));\n }", "function all_videos_uploaded($logged_user_id)\n\t{\n\t\t//$select = array('user_file', 'created', 'sex', 'first_name', 'last_name');\n\t\t$this->db->select('*')->from('uservideo')->where('user_id', $logged_user_id);\n\t $query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.7228334", "0.7021301", "0.69762707", "0.6801985", "0.67376596", "0.6713883", "0.6687975", "0.6558999", "0.6522971", "0.64891046", "0.6422546", "0.6421629", "0.6348982", "0.63413185", "0.63228333", "0.62221646", "0.60560805", "0.60472655", "0.59856695", "0.5918594", "0.59168804", "0.5861505", "0.58568007", "0.58441925", "0.5811147", "0.57907057", "0.57537544", "0.569362", "0.5669822", "0.56611234" ]
0.85098314
0
Returns the Music publications of a single user.
public function getMusicPublications($user) { return $this->getByCategoryType('Music', $user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public function songsLikedByUser()\n {\n $likes = \\App\\SongLike::where('user_id', \\Auth::user()->id)->with('song')->get()->pluck('song');\n return $likes;\n }", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function publishedBy($user_id)\n {\n return $this->model->where(compact('user_id'))->get();\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function userIndex()\n {\n return SongResource::collection(Song::where('user_id', auth()->id())->where('uploaded_by', 'user')->orderBy('created_at', 'desc')->get());\n }", "public function get_data_playlist_amp($user_id)\n {\n $this->db->where('user_id', $user_id);\n $data_album = $this->db->get('playlist_amp')->result_array();\n\n return $data_album;\n }", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function list_songs_alp($user_id, $limit)\n {\n return $this->db->where('user_id', $user_id)\n ->group_start()\n ->like('availability', 2)\n ->or_like('availability', 4)\n ->or_like('availability', 5)\n ->group_end()\n ->limit($limit)->order_by('id', 'DESC')\n ->get('audio_song')->result_array();\n }", "public static function get_users($user_id) { \n\n\t\t$user_id = Dba::escape($user_id); \n\t\t$results = array(); \n\n\t\t$sql = \"SELECT `id` FROM `playlist` WHERE `user`='$user_id' ORDER BY `name`\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) { \n\t\t\t$results[] = $row['id']; \n\t\t} \n\n\t\treturn $results; \n\n\t}", "public function getFavoriteSongs($userId){\n return $this->DB->queryFetchAllAssoc(\"SELECT s.* FROM user u, song s, favorite_songs fs WHERE fs.user_id = u.id AND fs.song_id = s.id AND u.id = $userId\");\n }", "public function getUsermidas()\n {\n return $this->get(self::_USERMIDAS);\n }", "public function list_songs_epk($user_id, $limit)\n {\n return $this->db->where('user_id', $user_id)\n ->where('availability !=', '6')\n ->limit($limit)->order_by('id', 'DESC')\n ->get('audio_song')->result_array();\n }", "public function index()\n {\n $user = Auth::user();\n\n return $user->slides()->get();\n }", "private function getByUser($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function findAllMedicByUserId($userId)\n\t{\n\t\tglobal $bdd;\n\n\t\t$q = $bdd->prepare(\"SELECT *\n\t\t\t\t\t\t\tFROM relation \n\t\t\t\t\t\t\tWHERE user_id = :user_id\n\t\t\t\t\t\t\t\");\n\t\t$q->execute(array(\n\t\t\t'user_id' => $userId\n\t\t\t));\n\n\t\t$data = $q->fetchAll(PDO::FETCH_OBJ);\n\n\t\treturn $data;\n\t}", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public static function getAudios($user_id, $page = 1)\n {\n $count = self::getAudiosCount($user_id);\n // default result\n $result = array(\n 'audios' => array(),\n 'load_more' => false,\n 'page' => $page,\n 'total' => $count\n );\n\n if (0 === $count) {\n return $result;\n }\n\n $total_pages = ceil($count / self::$per_page);\n\n if ($page > $total_pages) {\n return $result;\n }\n\n $columns = self::$columns;\n $columns = implode(',', $columns);\n $query = db()->prepare(\n \"SELECT\n {$columns}\n FROM audios\n WHERE reply_to IS NULL\n AND status = '1'\n AND user_id = :user_id\n ORDER BY date_added DESC\n LIMIT :skip, :max\"\n );\n $query->bindValue('user_id', $user_id);\n $query->bindValue(\n 'skip',\n ($page - 1) * self::$per_page,\n PDO::PARAM_INT\n );\n $query->bindValue('max', self::$per_page, PDO::PARAM_INT);\n $query->execute();\n\n while ($audio = $query->fetch(PDO::FETCH_ASSOC)) {\n $result['audios'][] = self::complete($audio);\n }\n\n $result['load_more'] = $page < $total_pages;\n $result['page'] = $page + 1;\n $result['total'] = $count;\n return $result;\n }", "public function userIndex()\n {\n return Serie::with([\n 'genre1',\n 'genre2'\n ])->ownedBy(auth()->user()->id)\n ->get();\n }", "private function get_user_favorite_publics(){\r\n global $USER;\r\n\r\n if(isset($USER) && $USER->id > 0) {\r\n $publics = new PublicsByFunctionUser($USER->id, $this->tab);\r\n if($this->tab == 'formation'){\r\n return $publics->get_favorite_formation_publics();\r\n } else {\r\n return $publics->get_favorite_course_publics();\r\n }\r\n }\r\n return false;\r\n }", "public function list_songs_flp($user_id, $limit)\n {\n return $this->db->where('user_id', $user_id)\n ->limit($limit)->order_by('id', 'DESC')\n ->get('audio_song')->result_array();\n }", "public function PublisherMembers() {\n\t\tif($this->owner->CanPublishType == 'OnlyTheseUsers'){\n\t\t\t$groups = $this->owner->PublisherGroups();\n\t\t\t$members = new DataObjectSet();\n\t\t\tif($groups) foreach($groups as $group) {\n\t\t\t\t$members->merge($group->Members());\n\t\t\t}\n\t\t\t\n\t\t\t// Default to ADMINs, if something goes wrong\n\t\t\tif(!$members->Count()) {\n\t\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\t\t$members = $group->Members();\n\t\t\t}\n\t\t\t\n\t\t\treturn $members;\n\t\t} elseif($this->owner->CanPublishType == 'LoggedInUsers') {\n\t\t\treturn Permission::get_members_by_permission('CMS_ACCESS_CMSMain');\n\t\t} else {\n\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\treturn $group->Members();\n\t\t}\n\t}", "public function getUserItems()\n {\n $items = ItemModel::model()->findAll('play_id = :playId ORDER BY id DESC', array(\n ':playId' => $this->playid\n ));\n\n return $items;\n }", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "public function favorites() {\n\t\t$favoriteSounds = Sound::whereHas('favorite', function($query) {\n\t\t\t$user = Auth::user();\n\n\t\t\t$query->where('userId', '=', $user->id);\n\t\t});\n\n\t\treturn Responder::success([\n\t\t\t'favoriteSounds' => $favoriteSounds->get()\n\t\t]);\n\t}", "static function list()\n {\n $user_meta = get_user_meta(get_current_user_id(), self::USER_META_KEY, true);\n $collections = [];\n\n foreach ($user_meta as $id => $attrs) {\n $collections[] = new self($id);\n }\n\n return $collections;\n }", "public function getUserwishes()\n {\n return $this->userwishes;\n }", "function music_list($path=null) {\n\treturn FreePBX::Music()->getAllMusic($path);\n}" ]
[ "0.68307984", "0.6595469", "0.63264877", "0.6235633", "0.601821", "0.59909916", "0.5940896", "0.5909756", "0.5896671", "0.5875045", "0.5785531", "0.5772517", "0.5732526", "0.57078344", "0.56695956", "0.56210095", "0.5611185", "0.5589056", "0.5569945", "0.5565817", "0.5557683", "0.55536586", "0.5543667", "0.5516419", "0.548351", "0.54507494", "0.5433777", "0.5413858", "0.5390446", "0.52994406" ]
0.8476468
0
Returns the Photo publications of a single user.
public function getPhotoPublications($user) { return $this->getByCategoryType('Photo', $user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "public static function get_photos_by_user($user_id) {\n\t\t$photos_array = array();\n\n\t\t$sql = \"SELECT * \n\t\t FROM photo_directory \n\t\t WHERE user_id = {$user_id}\n\t\t ORDER BY time_uploaded DESC;\";\n\t\t$photos_dbo = mysql_query($sql);\n\t\twhile ($row = mysql_fetch_assoc($photos_dbo)) {\n\t\t\tarray_push($photos_array, $row);\n\t\t} \n\n\t\tglobal $firephp;\n\t\t$firephp->log('get_photos_by_user:');\n\t\t$firephp->log($photos_array);\n\t\treturn $photos_array;\n\t}", "function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getUserPhoto($iduser){\n //convert the $id to integer\n $iduser = intval($iduser);\n\n $userinfo = DB::connection('mongodb')->collection('userinformations')\n ->project(['_id' => 0])\n ->select('profilephoto')\n ->where('iduser', '=', $iduser)\n ->get();\n if($userinfo) {\n foreach($userinfo as $new){\n return $new;\n }\n \n } else {\n return 'no photo';\n }\n \n }", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public static function print_photos_by_user($user_id) {\n\t\t$photos_array = self::get_photos_by_user($user_id);\n\t\tforeach ($photos_array as $photo) {\n\t\t\techo '\n\t\t\t\t<div class=\"photo\">\n\t\t\t\t\t<a href=\"photobooth.php?photo_id=' . $photo['photo_id'] . '\" class=\"fancybox.ajax fancybox\" rel=\"profile-gallery\">\n\t\t\t\t\t\t<div class=\"imgContainer\">\n\t\t\t\t\t\t\t<img class=\"imgImg\" src=\"../../photos-thumbnails/' . Photo::get_photo_path($photo['photo_id']) . '\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t</div>';\n\t\t}\n\t}", "public function getPhotos();", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "public static function get_image($user_id);", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getUserimages()\n {\n return $this->hasMany(Userimage::className(), ['user_id' => 'id']);\n }", "function get_user_images($user_id) {\n $images = DAO_user::DAO_fetch_user_images($user_id);\n if (is_array($images)) {\n $i = 0;\n $result = array();\n foreach ($images as $image) {\n $result[$i++] = $image;\n }\n return $result;\n }\n else return -1;\n }", "public function getPhoto($userId, $size);", "public static function create_by_user_public($a_user_id){\n\n\t\t$request = self::_get_connection()->select(\"SELECT ID from `apine_images` where user_id=$a_user_id OR privacy=2\");\n\t\t$liste = new Liste();\n\t\tif($request != null && count($request) > 0){\n\t\t\tforeach($request as $item){\n\t\t\t\t$liste->add_item(new ApineImage($item['ID']));\n\t\t\t}\n\t\t}\n\t\treturn $liste;\n\t\n\t}", "public function getPhotos($userid)\n {\n $stmt = $this->con->prepare(\"SELECT id_foto, caminho, disciplina, dataCreate FROM tbl_foto WHERE fk_usuario = ?\");\n $stmt->bind_param(\"i\", $userid);\n $stmt->execute();\n $stmt->bind_result($id, $caminho, $disciplina, $data);\n $photos = array();\n\n while ($stmt->fetch()) {\n $photo = array();\n $photo['id'] = $id;\n $photo['caminho'] = $caminho;\n $photo['disciplina'] = $disciplina;\n $photo['userid'] = $userid;\n $photo['data'] = $data;\n array_push($photos, $photo);\n }\n\n $stmt->close();\n return $photos;\n }", "public function getPhotos()\n {\n return $this->photos;\n }", "function getPhotosOfUser($idUser){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$tab = new Data();\r\n\t\t$r = mysql_query(\"select login from Utilisateur where id_user = \" . $idUser);\r\n\r\n\t\tif(mysql_num_rows($r) == 0){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\t\t$name = mysql_result($r,0,0);\r\n\t\t$connectService->close();\r\n\t\tif(!is_dir(\"../v2.0/espace/\" . $name . \"/photos/sd\")){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\r\n\t\t$tab->addInfo(\"root\",\"../v2.0/espace/\" . $name . \"/photos\");\r\n\t\t$tab->addInfo(\"photos\",$this->getPhotosOfDir($tab->getInfo(\"root\")));\r\n\t\t$tab->addInfo(\"type\",\"scan\");\r\n\r\n\t\treturn $tab;\r\n\t}", "public function getUserProfilePhotos($datas = [])\r\n {\r\n return $this->telegram(\"getUserProfilePhotos\", $datas);\r\n }", "public function getProfileGallery($uid){\n\t\t/* Needs to return the profile album media for the given user */\n\t}" ]
[ "0.7491937", "0.7057461", "0.69348145", "0.6791363", "0.6740359", "0.67056006", "0.66756916", "0.65588015", "0.64682627", "0.64099514", "0.6397173", "0.63524455", "0.6281825", "0.62780744", "0.62562966", "0.6237273", "0.6230155", "0.622764", "0.62268496", "0.6218996", "0.61921984", "0.6181258", "0.6177544", "0.61649084", "0.616282", "0.61617273", "0.615136", "0.6091241", "0.60637033", "0.60573286" ]
0.8635473
0
Returns the Location publications of a single user.
public function getLocationPublications($user) { return $this->getByCategoryType('Location', $user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "public function getUserLocation();", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public function location()\n {\n return $this->hasOne('App\\UserLocation', 'user_id');\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function getPins($user, $storeLocally = false) {\n\n $pagenum = 1;\n $content = \"\";\n $pinterestDir = \"\";\n\n if ($storeLocally) {\n // remove all existing pins\n $pinterestDir = __DIR__ . '/pins/';\n $this->rrmdir($pinterestDir); \n }\n \n // the last page of content contains the string noResults \n while (strpos($content, \"noResults\") == FALSE) {\n $content .= file_get_contents(\"http://pinterest.com/$user/pins/?lazy=1&page=$pagenum\");\n $pagenum++;\n }\n preg_match_all('#\\bhttps?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', $content, $matches);\n $matches = $matches[0];\n\n $pins = array();\n foreach ($matches as $pin) {\n\n $tmp = strpos($pin, \"550x\");\n if ($tmp !== FALSE) {\n\n if ($storeLocally) {\n // download and store pin\n // $pinterestDir = __DIR__;\n $imageName = basename($pin);\n $imageFullPath = $pinterestDir . $imageName;\n if (!file_exists($imageFullPath)) {\n file_put_contents($imageFullPath, file_get_contents($pin));\n }\n \n $pin = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];\n $pin = substr($pin,0, strrpos($pin, '/')+1);\n $pin .= 'pins/';\n $pin .= $imageName;\n }\n\n $pins[] = $pin;\n }\n }\n\n sort($pins);\n $pins = array_unique($pins); \n \n return $pins;\n }", "public function getUserLocation() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_note = 'HTTP_CLIENT_IP='.$_SERVER['HTTP_CLIENT_IP'];\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_note = 'HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR'];\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip_note = 'REMOTE_ADDR='.$_SERVER['REMOTE_ADDR'];\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $ip = '117.20.119.245';\n $loc = file_get_contents(\"http://ipinfo.io/\".$ip.\"/loc\");\n\n if($loc) {\n $array_loc = explode(',', $loc);\n return ['lat'=> ((isset($array_loc[0]))? $array_loc[0]:'') ,'lon'=> ((isset($array_loc[1]))? $array_loc[1]:'')];\n }\n\n return ['lat'=>'','lon'=>''];\n\n }", "private function getByUser($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function index()\n {\n $user_id = auth()->user()->id;\n $user = User::find($user_id);\n return view('locations.index')->with('locations', $user->locations->sortBy('title')->values()->all())->with('user', $user);\n }", "public function getLocations()\n {\n return $this->locations;\n }", "public function getUserSpreadsheets() {\n\t\treturn $this->findSpreadsheetsByUserId($this->user_id);\n\t}", "public function show(LocationUser $locationUser)\n {\n //\n }", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "public function publishedBy($user_id)\n {\n return $this->model->where(compact('user_id'))->get();\n }", "public function index()\n {\n if (Auth::check()){//The user is logged in\n //Show all current managers associated to owner\n\n $managers = User::where('account_owner', Auth::user() -> id)\n ->where('user_role', 2)\n ->orderBy('name', 'desc')\n ->get();\n\n $locations = Location::all(); //<---- Need to change this through application to only get locations vendors items and others based on user id\n\n $user = Auth::user();\n \n return view('userProfile', ['user' => $user, 'managers' => $managers, 'locations' => $locations]);\n }else{\n return redirect('/auth/login');\n }\n \n }", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function index()\n {\n\n $user = Session::get('user');\n $allowed_departments = Session::get('allowed_departments');\n $match_departments = Session::get('match_departments');\n\n $playlists = Playlist::whereIn('department_id', $match_departments)->get();\n\n // Return all locations or only the ones th user is assigned to\n if ($user->is_super_user) {\n $locations = Location::all();\n } else {\n $locations = Location::whereIn('department_id', $match_departments)->get();\n }\n\n $data = array(\n 'locations' => $locations,\n 'allowed_departments' => $allowed_departments,\n 'user' => $user,\n 'playlists' => $playlists\n );\n\n return view('pages/locations', $data);\n }", "public function getLocations()\n {\n return isset($this->Locations) ? $this->Locations : null;\n }", "public function locations()\n {\n $data = $this->request('POST', 'api/v1/date/locations');\n return $data;\n }", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "public function listOrganizations($user) {\n return $user->organizations;\n }", "public function getAllLocations() {\n\t\t$query = $this->db->select(\"\n\t\t\tRoom.RoomID,\n\t\t\tRoomAbbr,\n\t\t\tRoomName,\n\t\t\tBuildingAbbr,\n\t\t\tRoom.IsApproved,\n\t\t\tBuilding.MapURL,\n\t\t\tOperators\")->\n\t\tfrom('Room')->\n\t\tjoin('Building', 'Building.BuildingID = Room.BuildingID')->\n\t\tjoin(\"\n\t\t\t(SELECT r.RoomID, GROUP_CONCAT(CONCAT(UserFname, ' ', UserLname)) AS Operators\n\t\t\tFROM User u\n\t\t\t\tJOIN UserRole ur ON u.UserID = ur.UserID\n\t\t\t\tJOIN UserRoom urm ON ur.UserRoleID = urm.UserRoleID\n\t\t\t\tJOIN Room r ON r.RoomID = urm.RoomID\n\t\t\tGROUP BY r.RoomID) AS other\", 'other.RoomID = Room.RoomID', 'left')->\n\t\tget();\n\n\t\treturn $query->result_array();\n\t}", "public function UserSubordinates($user){\n return $user->subordinates()->select('name','email','id')->get();\n }", "function fetchGoogleLatitudeLocation ($user_id) {\n $r = array();\n $google_latitude_data = json_decode(file_get_contents(\"https://www.google.com/latitude/apps/badge/api?user=$user_id&type=json\"));\n $r['longitude'] = $google_latitude_data->features[0]->geometry->coordinates[0];\n $r['latitude'] = $google_latitude_data->features[0]->geometry->coordinates[1];\n $r['current_city'] = $google_latitude_data->features[0]->properties->reverseGeocode;\n $r['last_updated'] = $google_latitude_data->features[0]->properties->timeStamp;\n $r['raw'] = $google_latitude_data; // So that we have it all, if we need it.\n return $r;\n }", "function getPlacesOfPublication(){\n $placesOfPublication = $this->all('library:placeOfPublication');\n return $placesOfPublication;\n }", "public function location(): array\n {\n return $this->location;\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getLocations()\n {\n return $this->tpLocations;\n }", "public static function get_all_media_location_counts($user_id){\n $column_name = \"location\";\n $header = \"media_locations\";\n\n $database = Database::instance();\n $sql = \"SELECT COUNT(*) as num, \" . $column_name . \" as type, 'book' as media FROM \" . CONFIG::DBTables()->book . \" WHERE active = 1 AND \" . $column_name . \" IS NOT NULL AND user_id = \" . $user_id . \" GROUP BY \" . $column_name;\n $sql .= \" UNION SELECT COUNT(*) as num, \" . $column_name . \" as type, 'movie' as media FROM \" . CONFIG::DBTables()->movie . \" WHERE active = 1 AND \" . $column_name . \" IS NOT NULL AND user_id = \" . $user_id . \" GROUP BY \" . $column_name;\n $sql .= \" UNION SELECT COUNT(*) as num, \" . $column_name . \" as type, 'game' as media FROM \" . CONFIG::DBTables()->game . \" WHERE active = 1 AND \" . $column_name . \" IS NOT NULL AND user_id = \" . $user_id . \" GROUP BY \" . $column_name;\n $query = $database->prepare($sql);\n $query->execute();\n $result = $query->fetchAll(\\PDO::FETCH_ASSOC);\n $query->closeCursor();\n if ($result === false || $result === null){\n APIService::response_fail(HttpFailCodes::http_response_fail()->get_media_counts);\n }else{\n return array($header => $result);\n }\n }", "private function get()\n {\n\n $this->getMarks()->getAssessments();\n return ['users' => $this->me->get()];\n }" ]
[ "0.6679474", "0.64557445", "0.62106085", "0.60180765", "0.57874966", "0.5772487", "0.5748536", "0.5692362", "0.5658708", "0.56136525", "0.5592556", "0.5553232", "0.5533843", "0.5524934", "0.55219233", "0.5494967", "0.5472085", "0.54688835", "0.5438746", "0.5397855", "0.5370948", "0.53613317", "0.5358873", "0.5304449", "0.52705467", "0.526707", "0.52645636", "0.5263057", "0.5260488", "0.5245917" ]
0.8487102
0
Returns the Other publications of a single user.
public function getOtherPublications($user) { return $this->getByCategoryType('Other', $user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findOther($user): array\n {\n return $this->createQueryBuilder('c')\n ->where('c.creator != :user')\n ->andWhere('c.private = false')\n ->setParameter('user', $user )\n ->setMaxResults(4)\n ->getQuery()\n ->getResult();\n }", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "function get_others_unpublished_posts($user_id, $type = 'any')\n {\n }", "public function getMyNoticesUsers()\n {\n\t\t// Get my related departments\n\t\t$related_departments = [];\n\n $c_related = $this->getRelatedDepartments();\n\n if (!$c_related) return [];\n\n foreach ($c_related as $rel){\n\t\t\t$related_departments [] = $rel->id;\n\t\t}\n\n\n\t\t/*\n\t\t *\tGet related Departamental users from my related departments\n\t\t *\n\t\t * Conditions:\n\t\t * - agent ticketit_department in related_departments\n\t\t * - agent person in related_departments\n\t\t*/\n\t\t$related_users = \\PanicHDMember::where('id','!=',$this->id)\n\t\t\t->whereIn('ticketit_department', $related_departments);\n\n\t\t// Get users that are visible by all departments\n\t\t$all_dept_users = \\PanicHDMember::where('ticketit_department','0');\n\n\t\tif (version_compare(app()->version(), '5.3.0', '>=')) {\n\t\t\t$related_users = $related_users->pluck('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->pluck('id')->toArray()));\n\t\t}else{\n\t\t\t$related_users = $related_users->lists('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->lists('id')->toArray()));\n\t\t}\n\n\t\treturn $related_users;\n\t}", "public function get_other_library($user){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN users ON user_books.user_email=users.email WHERE `availability`=1 AND users.username=\"'.$user['sent_by'].'\" ');\n return $query->result();\n }", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function otherUser()\n {\n $user = $this->users()->where('user_id', '!=', auth()->user()->id)->first();\n\n return $user;\n }", "function get_others_drafts($user_id)\n {\n }", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "public function publishedBy($user_id)\n {\n return $this->model->where(compact('user_id'))->get();\n }", "private function get_user_favorite_publics(){\r\n global $USER;\r\n\r\n if(isset($USER) && $USER->id > 0) {\r\n $publics = new PublicsByFunctionUser($USER->id, $this->tab);\r\n if($this->tab == 'formation'){\r\n return $publics->get_favorite_formation_publics();\r\n } else {\r\n return $publics->get_favorite_course_publics();\r\n }\r\n }\r\n return false;\r\n }", "public function others()\n {\n return $this->hasManyThrough(Contact::class, Profile::class)\n ->select(['prefix AS type', 'value', 'is_primary'])\n ->where('type', 'other');\n }", "private function getByUser($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function getUserNotices(User $user) {\n \n return $this->createQueryBuilder('n')\n ->select('n, g, i, l, v, t')\n ->where('n.user = :user')\n ->andWhere('n.draft = :draft')\n ->join('n.gallery', 'g')\n ->join('n.location', 'l')\n ->join('n.type', 't')\n ->leftJoin('n.values', 'v')\n ->leftJoin('g.images', 'i')\n ->setParameter('user', $user)\n ->setParameter('draft', 'FALSE')\n ->orderBy('n.created_at', 'DESC')\n ->getQuery()\n ->getResult();\n }", "function getOtherPublicPosting(){\n return getAll(\"SELECT DISTINCT a.* , c.name \n FROM posting a,\n member_posting b, \n `member` c \n WHERE a.`status` = 'public' \n AND a.id = b.posting_id \n AND b.member_id <>? \n AND b.member_id =c.id\"\n , [getLogin()['mid']]);\n}", "public function filterOwnedBy($user)\n {\n return $this->getData()->filter($this->owner_field, $user);\n }", "function getvotados($user) {\n\tglobal $wpdb;\n\tif(user_can($user, 'integrante')) {\n\t\t$votos = $wpdb->get_var( \"SELECT count(1) FROM \".$wpdb->prefix . \"poptest_votos where votante = \".$user.\" group by votante\");\n\t\treturn $votos;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "function get_user_relationships() {\n\t$policy = new Config;\n\treturn $policy->getUserRelationships();\n}", "function get_nonauthor_user_ids()\n {\n }", "public function honeys()\n {\n $honeys = [];\n $userlinks = DB::table('userlink')\n ->where('user1', $this->id)\n ->orwhere('user2', $this->id)\n ->get();\n foreach ($userlinks as $link) {\n $honeyID = ($link->user1 == $this->id)\n ? $link->user2\n : $link->user1;\n $honeys[] = self::find($honeyID);\n }\n return $honeys;\n }", "public function getUsuariosVotos()\n {\n return $this->hasMany(User::className(), ['id' => 'usuario_id'])->via('votos');\n }", "public function get_other_user($data){\n $query = $this->db->query('SELECT * FROM users INNER JOIN swap_reqs ON swap_reqs.sent_by_username=users.username WHERE `swap_reqs`.`swap_UID`=\"'.$data['swap_UID'].'\" ');\n return $query->result();\n }", "public function get_all_user_not_regis()\n\t{\n\t\t$sql = \"SELECT * FROM $this->hr_db.`hr_person` WHERE ps_id not in (SELECT su_ps_id FROM $this->swm_db.`swm_user`)\";\n\t\t$query = $this->swm->query($sql);\n\n\t\treturn $query;\n\t}", "public function owners(){\n $users = User::with('potagers')\n ->owners()\n ->orderBy('updated_at', 'desc')\n ->paginate(100);\n\n return view('admin.users.owners', compact('users'));\n }", "public function userIndex()\n {\n return Serie::with([\n 'genre1',\n 'genre2'\n ])->ownedBy(auth()->user()->id)\n ->get();\n }", "public function getLocationPublications($user)\n {\n return $this->getByCategoryType('Location', $user);\n }", "public function getAllAssociated(User $user)\n {\n $role = $user->getRole();\n $id = $user->getId();\n\n if($role == User::ADMIN || $role == User::MENTOR) {\n $sql = <<<SQL\nselect * from $this->tableName \nwhere enabled = 1\nSQL;\n $stmt = $this->pdo()->prepare($sql);\n $stmt->execute();\n } else {\n $sql = <<<SQL\nselect * from $this->tableName \nwhere enabled = 1 and victimid = ? or reporterid = ?\nSQL;\n $stmt = $this->pdo()->prepare($sql);\n $stmt->execute([\n $id,\n $id\n ]);\n }\n\n if($stmt->rowCount() < 1) {\n return null;\n }\n\n $reports = [];\n $rows = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach($rows as $row) {\n $reports[] = new Injury($row);\n }\n\n return $reports;\n }" ]
[ "0.64782584", "0.6306442", "0.6151108", "0.59747183", "0.5947535", "0.5822453", "0.5790481", "0.5701683", "0.56842685", "0.5630005", "0.56142914", "0.561423", "0.55688524", "0.55590194", "0.55492723", "0.5546671", "0.5541457", "0.553686", "0.545307", "0.543266", "0.5420201", "0.53677106", "0.5366065", "0.53528863", "0.5340325", "0.52867895", "0.5270331", "0.52580255", "0.5248996", "0.5239492" ]
0.82336086
0
Returns all publications of a single user.
public function getAllPublications($user) { return $this->getByUser($user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public function publishedBy($user_id)\n {\n return $this->model->where(compact('user_id'))->get();\n }", "public function getAllPublications() :array {\n $query='SELECT * FROM Publication ORDER BY ID;';\n $this->connection->executeQuery($query);\n \n return $this->connection->getResults();\n }", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "private function getByUser($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function getLocationPublications($user)\n {\n return $this->getByCategoryType('Location', $user);\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function allForUser($userId);", "public function allForUser($userId);", "public function index(User $user)\n {\n $invitations = Invitation::where('contact_id', $user->id)->where('viewed', false)->get();\n return $invitations;\n }", "public function getPublicaciones()\n {\n $publicaciones = $this->publicacionDAO->getPublicaciones();\n\n\n echo $this->renderer->render(\"view/listar-publicaciones.mustache\", array(\n \"title\" => \"Publicación\",\n \"publicaciones\" => Publicacion::toListArrayMap($publicaciones),\n \"estados\" => Estado::toListArrayMap($this->estadoDAO->getEstados())\n ));\n \n }", "public static function getAllPublication() :array {\n \tglobal $base, $login, $password;\n\n $publicationGW = new PublicationGateway(new Connection($base, $login, $password));\n $results = $publicationGW->getAllPublications(); \n $data = array();\n foreach ($results as $row){\n $data[]=new Publication ($row['ID'], $row['reference'], $row['authors'], $row['title'], $row['date'], $row['journal'], $row['volume'], $row['number'], $row['pages'], $row['note'], $row['abstract'], $row['keywords'], $row['series'], $row['localite'], $row['publisher'], $row['editor'], $row['pdf'], $row['date_display'], $row['categorie_id']);\n }\n \n return $data;\n }", "public function index()\n {\n return $this->user->all();\n }", "public function getAllPublicationsByDate() :array {\n $query='SELECT * FROM Publication ORDER BY date DESC;';\n $this->connection->executeQuery($query);\n \n return $this->connection->getResults();\n }", "public function getUserSpreadsheets() {\n\t\treturn $this->findSpreadsheetsByUserId($this->user_id);\n\t}", "public function findAllPublic(){\n $qb = $this->getMainPublicQb();\n return $qb->getQuery()->getResult();\n }", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function index()\n {\n $user = Auth::user();\n\n return $user->slides()->get();\n }", "public function get_all_public_items () {\n\t\treturn array();\n\t}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function getAll()\n {\n $query = User::query();\n return $query->orderBy('id')->paginate(7);\n }", "public function index()\n {\n $data['publications'] = Publication::where('user_id', Auth::id())->paginate(30);\n $data['title'] = \"My Publications\";\n\n return view('publisher.publications.index', $data)->render();\n }", "public static function get_publication()\r\n {\r\n $p = new Publications();\r\n return $p->get_by_type(self::PUBLICATION_TYPE);\r\n }", "public function PublisherMembers() {\n\t\tif($this->owner->CanPublishType == 'OnlyTheseUsers'){\n\t\t\t$groups = $this->owner->PublisherGroups();\n\t\t\t$members = new DataObjectSet();\n\t\t\tif($groups) foreach($groups as $group) {\n\t\t\t\t$members->merge($group->Members());\n\t\t\t}\n\t\t\t\n\t\t\t// Default to ADMINs, if something goes wrong\n\t\t\tif(!$members->Count()) {\n\t\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\t\t$members = $group->Members();\n\t\t\t}\n\t\t\t\n\t\t\treturn $members;\n\t\t} elseif($this->owner->CanPublishType == 'LoggedInUsers') {\n\t\t\treturn Permission::get_members_by_permission('CMS_ACCESS_CMSMain');\n\t\t} else {\n\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\treturn $group->Members();\n\t\t}\n\t}" ]
[ "0.70083964", "0.6829691", "0.68073297", "0.6737207", "0.66569704", "0.65738195", "0.65098786", "0.63204175", "0.62836444", "0.6186759", "0.61120677", "0.6096917", "0.6096917", "0.6031839", "0.60034776", "0.5958241", "0.59226537", "0.5920754", "0.59165955", "0.590649", "0.5874563", "0.5858396", "0.5858382", "0.58470595", "0.58470595", "0.58470595", "0.58345896", "0.58191967", "0.58050793", "0.5788008" ]
0.8398507
0
Returns a Publication instance related to a single user.
public function getOwnerPublication($id, $user) { $q = $this ->getUserPublicationQueryBuilder($user) ->andWhere('p.id = :id') ->setParameter('id', $id) ->getQuery() ; try { return $q->getSingleResult(); } catch (\Exception $e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPublicationForUser(User $user, $publicationId)\n {\n $contentObjectPublication = $this->publicationRepository->findPublicationById($publicationId);\n if (! $contentObjectPublication)\n {\n throw new ObjectNotExistException('ContentObjectPublication', $publicationId);\n }\n \n $course = $this->courseService->getCourseById($contentObjectPublication->get_course_id());\n if (! $course)\n {\n throw new ObjectNotExistException('Course', $contentObjectPublication->get_course_id());\n }\n \n if (! $this->rightsService->canUserViewPublication($user, $contentObjectPublication, $course))\n {\n throw new NotAllowedException();\n }\n \n return $contentObjectPublication;\n }", "public function user()\n {\n return $this->belongsTo(Config::get('odotmedia.advertisements.user.model'));\n }", "public static function getOnePublication(int $id) : Publication {\n \tglobal $base, $login, $password;\n\n $publicationGW = new PublicationGateway(new Connection($base, $login, $password));\n $row = $publicationGW->getOnePublication($id);\n $data = new Publication ($row['ID'], $row['reference'], $row['authors'], $row['title'], $row['date'], $row['journal'], $row['volume'], $row['number'], $row['pages'], $row['note'], $row['abstract'], $row['keywords'], $row['series'], $row['localite'], $row['publisher'], $row['editor'], $row['pdf'], $row['date_display'], $row['categorie_id']);\n \n return $data;\n }", "public function user()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Util\\ClassMapper $classMapper */\n $classMapper = static::$ci->classMapper;\n\n return $this->belongsTo($classMapper->getClassMapping('user'), 'user_id');\n }", "public function getUserInstance()\n {\n $entity = null;\n\n if ($this instanceof \\User) {\n $entity = $this;\n } elseif ($this instanceof \\PortalUser) {\n $this->setPortalId();\n $entity = $this->getRelated('User');\n } else {\n $entity = $this->getPortalUser()->getRelated('User');\n }\n\n $this->checkJoin($this, $entity);\n\n return $entity;\n }", "public static function get_publication()\r\n {\r\n $p = new Publications();\r\n return $p->get_by_type(self::PUBLICATION_TYPE);\r\n }", "public function user()\n\t{\n\t\treturn $this->hasOne('User');\n\t}", "private function getByUser($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function publishedBy($user_id)\n {\n return $this->model->where(compact('user_id'))->get();\n }", "public function user()\n\t{\n\t\treturn $this->hasOne(User::class);\n\t}", "public function getUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'user_id']);\n }", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "public function show(User $user)\n {\n return $user;\n }", "public function show(User $user)\n {\n return $user;\n }", "public function show(User $user)\n {\n return $user;\n }", "public function show(User $user)\n {\n return $user;\n }", "public function show(User $user)\n {\n return $user;\n }", "public function show(User $user)\n {\n return $user;\n }", "public function user()\n {\n return $this->hasOne(User::class, 'id', 'user_id');\n }", "public function user()\n {\n return $this->hasOne(User::class, 'id', 'user_id');\n }", "public function user()\n {\n return $this->hasOne(User::class, 'id', 'user_id');\n }", "public function user()\n {\n return $this->hasOne(User::class, 'id', 'user_id');\n }", "public function show($user = null)\n {\n return is_null($user) ? user() : User::with('patient')->find($user);\n }", "public function getPublicacion()\n {\n return $this->hasOne(Publicacion::className(), ['id' => 'id_publicacion']);\n }", "public function user()\n {\n return $this->belongsTo(\n $this->getUserModelClassName(),\n 'user_id',\n $this->getUserModelPrimaryKey()\n );\n }", "public function me()\n {\n $user_id = auth_user()->getUserId();\n return $this->repository->find($user_id);\n }", "public function user()\n {\n return $this->hasOne(User::class, 'id', 'user_id');\n }", "public function user()\n {\n return $this->hasOne(User::class);\n }", "public function user()\n {\n return $this->hasOne(User::class);\n }", "public function get(int $user_id)\n {\n return $this->model->where('id', $user_id)->first();\n }" ]
[ "0.63286334", "0.6173258", "0.61138713", "0.61046386", "0.6088172", "0.60411096", "0.60149586", "0.59960675", "0.5984806", "0.59545183", "0.5947436", "0.59406984", "0.5921158", "0.5921158", "0.5921158", "0.5921158", "0.5921158", "0.5921158", "0.59202653", "0.59202653", "0.59202653", "0.59202653", "0.5917168", "0.59166133", "0.59125113", "0.5885907", "0.58836347", "0.5867759", "0.5867759", "0.58606315" ]
0.6950263
0
Returns the QueryBuilder instance that contains the criteria to fetch publications related to a single user.
private function getUserPublicationQueryBuilder($user, QueryBuilder $qb = null) { if (null === $qb) { $qb = $this->createQueryBuilder('p'); } $qb = $this ->createQueryBuilder('p') ->select('p, l, c') ->leftJoin('p.knownLink', 'l') ->leftJoin('l.category', 'c') ->leftJoin('p.user', 'u') ->where('u.id = :user_id') ->setParameter('user_id', $user) ; return $qb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getByUser($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "public function publishedBy($user_id)\n {\n return $this->model->where(compact('user_id'))->get();\n }", "public function memberUserQuery()\n {\n return $this->pushCriteria(MemberUserCriteria::class);\n }", "public function businessUserQuery()\n {\n return $this->pushCriteria(BusinessUserCriteria::class);\n }", "protected function _getQueryForUser() {\n\t\t$query = [\n\t\t\t'conditions' => [\n\t\t\t\t'User.id' => $this->request->params['user_id'],\n\t\t\t\t//@see https://github.com/NetCommons3/Users/blob/3.1.2/Controller/UsersController.php#L105-L111\n\t\t\t\t//@see https://github.com/NetCommons3/Users/blob/3.1.2/Model/Behavior/UserPermissionBehavior.php#L31-L33\n\t\t\t\t'User.is_deleted' => '0',\n\t\t\t],\n\t\t\t'recursive' => 0,\n\t\t\t'callbacks' => false,\n\t\t];\n\n\t\treturn $query;\n\t}", "public function getUser(): ActiveQuery\n {\n return $this->hasOne(Users::class, ['id' => 'writer_id']);\n }", "public function repository(): Builder\n {\n return User::query();\n }", "public function getOwnerPublication($id, $user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->andWhere('p.id = :id')\n ->setParameter('id', $id)\n ->getQuery()\n ;\n\n try {\n return $q->getSingleResult();\n } catch (\\Exception $e) {\n return false;\n }\n }", "protected function reservationsByUser(User $user): Builder\n {\n /** @var Builder $builder */\n $builder = Reservation::whereHas('user', function (Builder $query) use ($user) {\n $query->where('email', $user->email);\n });\n\n return $builder;\n }", "private function getUserQuery(User $user)\n {\n return UserAndTeam::where('type', UserAndTeam::TYPE_USER)\n ->where('entity_id', $user->id);\n }", "public function forUser($user_id)\n {\n return Proposal::where('user_id', $user_id)\n ->orderBy('created_at', 'asc')\n ->get();\n }", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "protected function query(): Builder\n {\n $query = $this->make()->newQuery();\n\n // Loads the active model if set, for use in getOne(), update(), delete(), etc.\n if ($this->activeModelInstance) {\n $query->where(\n $this->activeModelInstance->getKeyName(),\n $this->activeModelInstance->getKey()\n );\n }\n\n return $query;\n }", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "public function forUser(User $user)\n {\n return Ad::where('user_id', $user->id)\n ->orderBy('created_at', 'des')\n ->get();\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function repository(): Builder\n {\n $users = User::all();\n\n return User::query();\n }", "public function query()\n {\n return new QueryBuilder(\n $this, $this->getQueryGrammar(), $this->getPostProcessor()\n );\n }", "public function query()\n {\n return new QueryBuilder(\n $this, $this->getQueryGrammar(), $this->getPostProcessor()\n );\n }", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "public function user(): UserRequestBuilder {\n return new UserRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function getDocumentBuilder()\n {\n return Document::query()\n ->where(function($query) {\n return $query->whereRaw($this->getExpandedQuery());\n });\n }", "private function getMainPublicQb(){\n $qb = $this->createQueryBuilder('a')\n ->where('a.published = true')\n ->andWhere('a.date <= :now')\n ->orderBy('a.date', 'desc')\n ->setParameter('now', new \\Datetime());\n \n return $qb;\n }", "public function graphUser(): GraphUserRequestBuilder {\n return new GraphUserRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function getFindPublicQueryBuilder(): QueryBuilder;", "public function buildQuery()\n {\n if (!$this->query) {\n $this->query = $this->getMapper()->buildAssociationQuery($this);\n }\n\n return clone $this->query;\n }", "public function query()\n {\n $query = User::select('*');\n\n return $this->applyScopes($query);\n }", "public function withUser()\n {\n $criteria = new CDbCriteria();\n $criteria->with = 'user';\n $criteria->together = true; \n $this->getDbCriteria()->mergeWith($criteria);\n \n return $this; \n }", "public function getUserQuery($user_id)\n {\n return $this->db->table(static::TABLE)->eq('user_id', $user_id);\n }" ]
[ "0.62432265", "0.61064816", "0.5964185", "0.56347996", "0.54097474", "0.5402511", "0.53924215", "0.5359198", "0.5357572", "0.5324903", "0.5291402", "0.523609", "0.5220305", "0.5154451", "0.5125421", "0.5122799", "0.51026726", "0.5042342", "0.5038542", "0.5038542", "0.5031877", "0.4994904", "0.49902353", "0.4976564", "0.49678338", "0.4962182", "0.4955433", "0.49407205", "0.49374402", "0.49364898" ]
0.6276815
0
fetch the specified swimmers details from the ASA number
function fetchSwimmer($swimmerID) { global $db_gala_name; $mysqli = openDatabase($db_gala_name); $sql = "SELECT AthleteName, Sex, BirthDate, Squad FROM `athletes` WHERE (AsaNo='$swimmerID')"; $res = getResults ($mysqli, $sql); $results = array(); // check the number of matches, should only be one if ($res->num_rows == 0) { $results['error'] = "Somthing went wrong, couldn't find swimmer: ". $swimmerID; return $results; } if ($res->num_rows > 1) { $results['error'] = "Somthing went wrong, more than one swimmer with that ID: ". $swimmerID; return $results; } // load the one record into the result array to return $row = $res->fetch_assoc(); extract($row); // return the swimmer details $results['swimmer_name']= $AthleteName; $results['athlete_squad']=$Squad; $results['gender']=$Sex; $results['BirthDate']=$BirthDate; $results['AsaNo']=$swimmerID; return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_assesment(){\n \n $assesm_db=$this->assesm_db;\n // query to read single record\n //It loads the data file and converts it to an array\n $assesm_data = file_get_contents($assesm_db);\n $assesm_json = json_decode($assesm_data, true);\n if (count($assesm_json)>0){\n $assesm_found=$assesm_json[$this->session_id];\n }else{\n $assesm_found=null;\n }\n \n // set values to object properties\n $this->session_id = $assesm_found['session_id'];\n $this->test = $assesm_found['test'];\n $this->taker = $assesm_found['taker'];\n }", "function v1_get_code($gen_stations) {\n\n\t// Connect to DB\n\tinclude \"php/include/db_connect.php\";\n\t\n\t$sql=\"select ss.ss_stime,ss.ss_etime from ss where ss.ss_name='{$gen_stations[0]}'\";\n\n\t$result = mysql_query($sql, $link);\n\t$row= mysql_fetch_array($result);\n\treturn $row;\n}", "function listar_saa_sin($saa) {\n\t \t $msaa=str_replace('}{',',',$saa);\n\t\t $msaa=str_replace('{','',$msaa);\n\t\t $msaa=str_replace('}','',$msaa);\n\t\t $msaa=explode(',',$msaa);\n\t\t \n\t\t for ($i=0;$i<count($msaa);$i++) { \n\t\t\tif ($msaa[$i]!='') {\n\t\t\t $sql.='AND id_saa_material != '.$msaa[$i].'\n\t\t\t '; \n\t\t\t}\n\t\t }\n\t\t \n\t\t$query = \"SELECT material_saa.*\n\t\tFROM material_saa\n\t\tWHERE saa_material IS NOT NULL\n\t\t$sql\n\t\tORDER BY saa_material asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function get_assesment_by_taker(){\n \n $assesm_db=$this->assesm_db;\n // query to read single record\n //It loads the data file and converts it to an array\n $assesm_data = file_get_contents($assesm_db);\n $assesm_json = json_decode($assesm_data, true);\n $assesm_found=null;\n if (count($assesm_json)>0){\n $taker=$this->taker;\n foreach ($assesm_json as $as_key => $as_value) {\n $assesment_id=$as_key;\n foreach ($as_value as $as_var => $as_dat) {\n if ($as_var==\"taker\" && $as_dat==$taker) {\n $assesm_found=$assesm_json[$assesment_id];\n } \n }\n }\n }\n \n // set values to object properties\n $this->session_id = $assesm_found['session_id'];\n $this->test = $assesm_found['test'];\n $this->taker = $assesm_found['taker'];\n }", "public function index()\n {\n $swimmers= Swimmer::all();\n return SwimmerResource::collection($swimmers);\n \n\n }", "public function inScadenza($num) {\n $FAsta= USingleton::getInstance('FAsta');\n $tmp= $FAsta->inScadenza($num);\n \n if($tmp != false){\n for($i=0;$i<count($tmp);$i++) {\n $ris[]=$FAsta->load($tmp[$i]->getIdAsta());\n }\n\t\t\t return $ris;\n }\n\t\t\t\n else{\n return $ris=null;\n }\n }", "function listar_saa() {\n\t\t$query = \"SELECT material_saa.*\n\t\tFROM material_saa\n\t\tORDER BY saa_material asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function getASnow($snow_code){\n $strgSeparator = '\\'';\n\n // Query to get the selected snow. The active code must be set to 1 to display only snows to display. It avoids possibilty to user selecting a wrong code (get paramater in url)\n $snowQuery = 'SELECT code, brand, model, snowLength, dailyPrice, qtyAvailable, description, photo FROM snows WHERE code='.$strgSeparator.$snow_code.$strgSeparator.'AND active=1';\n\n require_once 'model/dbConnector.php';\n $snowResults = executeQuerySelect($snowQuery);\n\n return $snowResults;\n}", "function get_psb_by_tha($params) {\n $sql = \"SELECT * FROM psb p INNER JOIN psb_jalur jp ON p.jalurpsb_id = jp.jalurpsb_id WHERE psb_tha = ?\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return 0;\n }\n }", "public function show(asesor $asesor)\n {\n //\n }", "public function sanphamdetail()\n\t\t{\n\t\t\t$id = $_GET['chitiet_sanpham'];\n\t\t\t//goi ham model de xu li\n\t\t\t$ketqua = $this->sanpham_model->OneRecordData1($id);\n\t\t\treturn $ketqua;\n\t\t}", "function get($key, $param = NULL){\t\t$list = $this->getServiceList();\n\t\t$url = $list[$key];\n\t\t\n\t\tif( $key == \"GetGameDetails\" ){\n\t\t\t$url = str_replace('{gameid}', $param, $url);\n\t\t}\n\n\t\t$data = array();\n\t\t\t\t$ch = curl_init($url);\t\t\t\t\n\t\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\t\t\n\t\t\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11');\n\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t\t\t'X-343-Authorization-Spartan:' . $this->settings['spartan']\n\t\t\t\t));\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');\n\t\t\t\tcurl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\t\t\t$call = curl_exec($ch);\n\t\t\t\tcurl_close($ch);\n\n\t\t$results = simplexml_load_string($call);\n\t\n\t\t$array = (array)$results;\n\t\t// Add player's Spartan Body image\n\t\t$gamertag = $this->settings['gamertag'];\n\t\t$array['spartanBody'] = \"https://spartans.svc.halowaypoint.com/players/$gamertag/h4/spartans/fullbody?target=large\";\n\t\t\n\t\t\n\t\treturn $array;\n\t}", "public function getstudentById ($student_number){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM students \";\n $sqlQuery .= \" WHERE student_number=’ $student_number ’ \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "public function get_ads($screen_code)\n {\n $screen = Screen::where('code', $screen_code)->first();\n if($screen) {\n return response()->json(new AdvertisementResource($screen), 200);\n }\n return response()->json(['error' => 'Invalid boardId'], 400);\n }", "function getDetailContent($_MaSK){\n\t\t$sql=\"SELECT tl.TenTL, gd.TenGD, ctgd.TenCTGD, sk.MaSK, sk.TieuDe, sk.HinhSK, sk.NoiDung, sk.SoLuotXem, sk.Video, sk.created_at FROM theloai tl, giaidoan gd, chitietgiaidoan ctgd, sukien sk WHERE tl.MaTL = gd.MaTL AND gd.MaGD = ctgd.MaGD AND ctgd.MaCTGD = sk.MaCTGD AND sk.MaSK=$_MaSK\";\n\t\t$this->setQuery($sql);\n\t\treturn $this->loadAllRows();\n\t}", "public function show(WashingAndSpa $washingAndSpa)\n {\n //\n }", "function getSocietyDetails($soc_code){\n\t\t}", "public function getstudentInfoByApplicationId($id) {\n $this->db->select('stu.*,stu_info.*,p.*');\n $this->db->from('studentinfo stu_info');\n $this->db->join('student stu', 'stu.applicationId=stu_info.applicationId');\n $this->db->join('programoffer p', 'p.programOfferId=stu.programOfferId');\n $this->db->where('stu_info.applicationId', $id);\n\n $query = $this->db->get();\n $result = $query->row_array();\n if (!empty($result)) {\n return $result;\n }\n }", "public function show(absensiswa $absensiswa)\n {\n //\n }", "function jget_roshine_record($sid)\n{\n global $DB;\n return $DB->get_record('roshine', array('id' => $sid));\n}", "public function getCards();", "function datos_material_saa($id_saa) {\n\t\t$query = \"SELECT material_saa.*\n\t\tFROM material_saa\n\t\tWHERE id_saa_material = '$id_saa'\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $row;\n\t\t}\n\t}", "public function show(Whitecard $whitecard)\n {\n \n }", "function getshop($shopname) {\n\t\n\t$url = 'https://openapi.etsy.com/v2/shops/?shop_name='.$shopname .'&api_key=' . $apikey;\n\t\n\treturn execCurl ($url);\n\t//num_favorers\n\t\n}", "function card_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}", "public function details_get()\n \t{\n \t\tlog_message('debug', 'Score/details_get');\n\n\t\t$result = $this->_score->get_details(\n\t\t\t$this->get('type'),\n\t\t\t$this->get('codes'),\n\t\t\textract_id($this->get('userId')),\n\t\t\t(!empty($this->get('storeId'))? extract_id($this->get('storeId')): '')\n\t\t);\n\n\t\tlog_message('debug', 'Score/details_get:: [1] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "public function index()\n {\n //\n $absen = absensiswa::join('users','id','abs_sw_id')->get();\n return view('absen.index', compact('absen'));\n }", "function searchForSwimmer ($searchString) \n{\n global $db_gala_name;\n $mysqli = openDatabase($db_gala_name);\n if ($stmt = $mysqli->prepare('SELECT AthleteName, AsaNo FROM athletes WHERE AthleteName LIKE ? ORDER BY AthleteName')) {\n $stmt->bind_param('s', $searchString);\n $stmt->execute();\n $stmt->store_result();\n }\n $results = array();\n\n // Load the results into an array\n $stmt->bind_result($athleteName, $asaNo);\n\n while ($stmt->fetch()) {\n $results[$asaNo] = $athleteName;\n }\n $mysqli->close();\n \n return $results;\n}", "public function obtenerViajesplus();", "public function show_link_episode($id_cs, $ep_number)\n\t{\n\t\t$this->db->where('id_cs', $id_cs)->where('ep_number', $ep_number);\n\t\t$query = $this->db->get('episodes_course');\n\t\treturn $query->result_array();\n\t}" ]
[ "0.536155", "0.53091073", "0.5270495", "0.52577883", "0.5221759", "0.5133535", "0.50837326", "0.5058904", "0.499194", "0.4990519", "0.49398878", "0.4891192", "0.48618686", "0.48522303", "0.48513064", "0.48144618", "0.4813427", "0.48048317", "0.48046914", "0.478235", "0.47773013", "0.47748008", "0.47711977", "0.476588", "0.47652933", "0.47634485", "0.4756831", "0.47555622", "0.4742582", "0.4741395" ]
0.58249056
0
Filter the query on the lp_type column
public function filterByLpType($lpType = null, $comparison = null) { if (is_array($lpType)) { $useMinMax = false; if (isset($lpType['min'])) { $this->addUsingAlias(LpPeer::LP_TYPE, $lpType['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($lpType['max'])) { $this->addUsingAlias(LpPeer::LP_TYPE, $lpType['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(LpPeer::LP_TYPE, $lpType, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterTypeTicketList( $filter )\r\n {\r\n if( !empty( $filter['type'] ) ){\r\n \r\n $i = 0; \r\n foreach ($filter['type'] as $type){\r\n if( $i == 0){\r\n $sqlType= \" AND (type = '$type' \";\r\n }\r\n else{\r\n $sqlType.= \" OR type = '$type' \";\r\n }\r\n\r\n $i++;\r\n }\r\n $sqlType.= \" ) \";\r\n\r\n return $sqlType;\r\n }\r\n else{\r\n return NULL;\r\n }\r\n }", "function aurum_search_page_filter_by_post_type( $query ) {\n\t\n\tif ( $query->is_main_query() && $query->is_search() ) { \n\t\t\n\t\t$query->set( 'posts_per_page', apply_filters( 'laborator_search_results_count', 10 ) );\n\t\t\n\t\tif ( isset( $_GET['type'] ) ) {\n\t\t\t$post_type = sanitize_title_for_query( $_GET['type'] );\n\t\t\t$query->set( 'post_type', $post_type );\n\t\t}\n\t}\n}", "function filterType($tbl, $tbl2, $tbl3, $col, $col2, $col3, $filter) {\n\t\tinclude('connect.php');\n\t\t$queryFilter = \"SELECT * FROM {$tbl} m, {$tbl2} g, {$tbl3} mg WHERE m.{$col} = mg.{$col} AND g.{$col2} = mg.{$col2} AND g.{$col3} = '{$filter}'\";\n\t\t$runFilter = mysqli_query($link, $queryFilter);\n\t\tif($runFilter){\n\t\t\treturn $runFilter;\n\t\t}else{\n\t\t\t$error = \"There was an error accessing this Information. Please contact your admin.\";\n\t\t\treturn $error;\n\t\t}\n\t\tmysqli_close($link);\n\t}", "public function filterType(string $type = 'text'): Column\n {\n if (in_array($type, ['text', 'daterangepicker', 'select', 'select-multiple'])) {\n $this->filterType = $type;\n }\n\n return $this;\n }", "function get_private_posts_cap_sql($post_type)\n {\n }", "function wpse45436_posts_filter( $query ){\n global $pagenow;\n $type = 'policy';\n if (isset($_GET['post_type'])) {\n $type = $_GET['post_type'];\n }\n if ( 'policy' == $type && is_admin() && $pagenow=='edit.php' && isset($_GET['ADMIN_FILTER_FIELD_VALUE']) && $_GET['ADMIN_FILTER_FIELD_VALUE'] != '') {\n $query->query_vars['meta_key'] = 'responsible_office';\n $query->query_vars['meta_value'] = $_GET['ADMIN_FILTER_FIELD_VALUE'];\n }\n}", "function _acf_query_remove_post_type($sql)\n{\n}", "protected function getQueryType()\n {\n }", "private static function getNonSpecialPageTypes() {\n \t\treturn tx_newspaper::selectRows(\n \t\t\t'DISTINCT get_var', tx_newspaper::getTable('tx_newspaper_PageType'),\n \t\t\t'get_var != \\'' . tx_newspaper::GET_pagetype() .'\\' AND ' .\n \t\t\t'get_var != \\'' . tx_newspaper::GET_article() .'\\' AND ' .\n \t\t\t'get_var != \\'\\''\n \t\t);\n\t\t\n\t}", "public function getQueryType();", "function LocalidadFilter( $Filter )\n {\n if( !empty($Filter->Loc) ) \n {\n $Loc = $Filter->Loc;\n return 'AND pLoc=\"'.$Loc.'\" ';\n }\n \n if( isset( $Filter->Prov ) ) \n return 'AND pProv='.$Filter->Prov.' ';\n\n return ''; \n }", "public function addFilterByType($type)\n {\n $this->addFilter('main_table.type', $type);\n return $this;\n }", "public function typefilterAction()\n {\n $page = $this->params()->fromQuery('page', 1);\n $filter = $this->params()->fromRoute('type', null);\n\n // Filter posts by type\n $query = $this->entityManager->getRepository(Post::class)->findPostsByCuisineType($filter);\n\n $adapter = new DoctrineAdapter(new ORMPaginator($query, false));\n $paginator = new Paginator($adapter);\n $paginator->setDefaultItemCountPerPage(15);\n $paginator->setCurrentPageNumber($page);\n\n /* Change layout */\n $this->layout()->setTemplate('layout/layout-front');\n\n /* Latest 3 posts */\n $latestPosts = $this->entityManager->getRepository(Post::class)->findLatestPosts(2);\n\n /* Countries List */\n $countries = $this->entityManager->getRepository(Post::class)->getCountries();\n\n /* Cuisine Types list */\n $types = $this->entityManager->getRepository(Post::class)->getCuisineTypes();\n\n // Render the view template.\n return new ViewModel([\n 'posts' => $paginator,\n 'postManager' => $this->postManager,\n 'countries' => $countries,\n 'types' => $types,\n 'latestPosts' => $latestPosts\n ]);\n }", "public function queryFilter($query)\n {\n global $pagenow;\n\n if (!is_admin() || !$pagenow || $pagenow !== 'edit-comments.php' || !isset($_GET['post_type']) || !$_GET['post_type']) {\n return;\n }\n\n $query->set('post_type', $_GET['post_type']);\n }", "public function get_personnel_types()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('personnel_type_name', 'ASC');\n\t\t$query = $this->db->get('personnel_type');\n\t\t\n\t\treturn $query;\n\t}", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Pallet::query()\n ->select('Pallet.objectID', 'Pallet.Pallet_ID', 'Pallet.x', 'Pallet.y', 'Pallet.z', 'Pallet.Status')\n ->orderBy('Pallet_ID', 'asc');\n if(isset($filter['Pallet_ID']) && strlen($filter['Pallet_ID']) > 2) {\n $query->where('Pallet_ID', 'like', ltrim($filter['Pallet_ID'],'0') . '%');\n\t\t}\n\t\tif(isset($filter['Pallet_ID.prefix']) && is_array($filter['Pallet_ID.prefix'])) {\n $query->whereRaw(\"substring(Pallet_ID,1,3) in ('\".implode(\"','\", $filter['Pallet_ID.prefix']).\"')\");\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status'])) {\n $query->whereRaw(\"Status in ('\".implode(\"','\", $filter['Status']).\"')\");\n }\n elseif(isset($filter['Status']) && strlen($filter['Status']) > 3) {\n $query->where('Status', '=', $filter['Status']);\n }\n /*\n * container.parent should generate this sql request\n * select Pallet.* from Pallet join container plt on plt.objectID = Pallet.objectID where plt.parentID = 6213292055;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as plt', 'plt.objectID', '=', 'Pallet.objectID')\n ->where('plt.parentID',$filter['container.parent']);\n }\n /*\n * container.child should generate this sql request\n * select Pallet.* from Pallet join container gc on gc.parentID = Pallet.objectID where gc.objectID = 6226111054;\n */\n if(isset($filter['container.child']) && strlen($filter['container.child']) > 3) {\n $query\n ->join('container as gc', 'gc.parentID', '=', 'Pallet.objectID')\n ->where('gc.objectID',$filter['container.child']);\n }\n return $query;\n }", "public static function getAllByType(Mysql $mysql, $type = null, $filter = null, $page = null)\n {\n $q = \"SELECT tc.* FROM tcpartner tc \".\n \" WHERE 1 = 1 \";\n\n if($type!=null)\n $q .= \" AND dstype='$type'\";\n if($filter!=null)\n $q .= \" AND (dsname LIKE '%$filter%' OR dscode LIKE '%$filter%')\";\n //else\n // $q .= \" AND dstype='C'\";\n\n $q .= \" ORDER BY tc.pnid DESC \"; //.Mysql::getQueryLimit($page);\n //echo \"<br />\".$q;\n return $mysql->execute($q);\n }", "protected function type($type)\n {\n return $this->builder->where('type', $type);\n }", "function search_filter($query) {\n\t if ($query->is_search && !is_admin() ) {\n\t $query->set('post_type',array('post','page'));\n\t }\n\t return $query;\n\t}", "public function scopeTypeInsurance($query,$type)\n {\n return $query->where('insurance_type_id', $type);\n }", "private function getTypesFilterSubquery($sql = FALSE) {\n \n $this->loadTypes();\n $noticesQuery = $this->doctrine\n ->getEntityManager()\n ->getRepository('FenchyNoticeBundle:Notice')\n ->createQueryBuilder('n2')\n ->select($sql ? 'n2.id' : 'n2')\n ->leftJoin('n2.type', 't2')\n ->leftJoin('n2.values', 'v2')\n ->leftJoin('t2.properties', 'p2');\n\n $typeAlternatives = array();\n $parameters = array();\n foreach($this->types as $type) {\n\n if($this->isValidFilterTypeChecked($type->getId(), NULL, NULL)) {\n\n $typeAnd = array('n2.type = :condType'.$type->getId());\n $parameters['condType'.$type->getId()] = $type;\n\n // if type has subcategories/properties\n $typeKey = $this->getKeyValidFilter($type->getId(), NULL, NULL); \n if(\n array_key_exists('subcategories', $this->validFilter['types'][$typeKey]) && \n is_array($this->validFilter['types'][$typeKey]['subcategories']) &&\n !empty($this->validFilter['types'][$typeKey]['subcategories'])\n ) {\n\n foreach($this->validFilter['types'][$typeKey]['subcategories'] as $pId => $prop) {\n // if type has this property\n if( $property = $type->hasPropertyOfId($prop['id']) ) {\n $values = array();\n if(!$this->allUnchecked($prop['subcategories'])) {\n \n foreach($prop['subcategories'] as $val => $valData) {\n // if value is selected\n if(is_array($valData) && array_key_exists('checked', $valData) && $valData['checked']) {\n $values[] = $valData['id'];\n }\n }\n }\n if(!empty($values)) {\n // If there is more than one property for type, then we have to \n // join conditions for all of them by 'AND'\n // To do that we need to additionaly join each value separately.\n if(count($this->validFilter['types'][$typeKey]['subcategories']) > 1) {\n $noticesQuery->leftJoin('n2.values', 'v2'.$prop['id'], Expr\\Join::WITH, 'v2'.$prop['id'].'.property = '.$prop['id']);\n $typeAnd[] = 'v2'.$prop['id'].'.value in (:values'.$prop['id'].')';\n $parameters['values'.$prop['id']] = $values;\n }\n else {\n $typeAnd[] = 'v2.value in (:values'.$prop['id'].')';\n $parameters['values'.$prop['id']] = $values;\n }\n }\n } // if type has property\n } // foreach properties\n } // if type has properties\n if(!empty($typeAnd)) {\n $typeAlternatives[] = new Expr\\Andx($typeAnd);\n }\n } // if type in filter\n } // foreach type\n\n if(!empty($typeAlternatives))\n $noticesQuery->andWhere(new Expr\\Orx($typeAlternatives));\n if($sql)\n return $noticesQuery->getQuery()->getSQL();\n else return array($noticesQuery, $parameters);\n }", "function filter( $value, $type )\n {\n return Pgg_Filter::get( $value, $type );\n }", "public function list_of($type)\n {\n }", "function searchfilter($query) {\n \n if ($query->is_search && !is_admin() ) {\n $query->set('post_type',array('post', 'product'));\n }\n \n return $query;\n }", "private static function _initializeTypes()\n {\n\n $db = DataAccess::getInstance();\n $category = self::getActiveCategory();\n\n $fields = geoFields::getInstance(0, $category);\n\n $sql = \"SELECT * FROM \" . geoTables::browsing_filters_settings . \" WHERE `category` = ? AND `enabled` = 1\";\n $settings = $db->Execute($sql, array($category));\n\n while ($settings && $target = $settings->FetchRow()) {\n $name = $target['field'];\n $type = 0; //be sure to reset $type to 0 each time, to prevent bleeding\n if (strpos($name, 'optional_field_') === 0) {\n //this is an optional field\n\n if (!$fields->$name->is_enabled) {\n //field not enabled. do not set!\n continue;\n }\n $optional_type = $fields->$name->field_type;\n if ($optional_type === 'number' || $optional_type === 'cost') {\n $type = self::RANGE;\n } elseif ($optional_type === 'textarea' || $optional_type === 'text') {\n $type = self::SCALAR;\n } elseif ($optional_type === 'date') {\n $type = self::DATE_RANGE;\n } elseif ($optional_type === 'dropdown') {\n $type = self::PICKABLE;\n }\n } elseif (strpos($name, 'cs_') === 0) {\n //this is a cat-spec question\n $question_id = substr($name, 3);\n $cs_type = $db->GetOne(\"SELECT `choices` FROM \" . geoTables::questions_table . \" WHERE `question_id` = ?\", array($question_id));\n if (is_numeric($cs_type) || $cs_type === 'none') {\n $type = self::PICKABLE;\n } elseif ($cs_type === 'check') {\n $type = self::BOOL;\n } elseif ($cs_type === 'number') {\n $type = self::RANGE;\n } elseif ($cs_type === 'date') {\n $type = self::DATE_RANGE;\n } else {\n //not a valid question, or no longer active? do not set.\n continue;\n }\n } elseif (strpos($name, 'leveled_') === 0) {\n //leveled field\n $type = self::PICKABLE;\n }\n if ($type) {\n self::$_types[$name] = $type;\n } else {\n //These aren't the droids you're looking for. You can go about your business. Move along.\n //(Didn't find a dynamic type, which means this field is either statically-typed in the declaration of self::$_types or doesn't exist)\n }\n }\n\n self::$_typesInitialized = true;\n }", "static function getProduitByType($type) {\n $sql = \"SELECT * \n FROM PRODUIT\n WHERE typeAvion=:nom_var\";\n $req_prep = Model::$pdo->prepare($sql);\n $req_prep->bindParam(\":nom_var\", $type);\n $req_prep->execute();\n $req_prep->setFetchMode(PDO::FETCH_CLASS, 'ModelProduit');\n return $req_prep->fetchAll();\n }", "function _culturefeed_search_ui_format_types_filter($types) {\n switch($types) {\n case 'event':\n return 'type:event';\n break;\n case 'actor':\n return 'type:actor';\n break;\n case 'event_actor':\n return 'type:event OR type:actor';\n break;\n case 'event_production_actor':\n return 'type:event OR type:production OT type:actor';\n break;\n default:\n // Return filter that was previously hardcoded.\n return 'type:event OR type:production';\n break;\n }\n}", "public function filterByItemtype($type, $comparision = null) {\n\t\treturn $this->filterByInittype($type, $comparision);\n\t}", "function erp_get_people_types() {\n return apply_filters( 'erp_people_types', [] );\n}", "public function sparooms($type=\"sparoom\")\n {\n\n $query=$this->sparoomquery();\n return DB::select(DB::raw($query));\n /*return $sparoom = DB::table(\"opos_ftype\")\n ->leftJoin(\"opos_lockerkeytxnsparoom\",\"opos_lockerkeytxnsparoom.sparoom_ftype_id\",\"=\",\"opos_ftype.id\")\n ->whereNull(\"opos_ftype.deleted_at\")\n \n /* ->whereNull(\"opos_lockerkeytxnsparoom.sparoom_checkout\")*/\n /* ->whereNotNull(\"opos_lockerkeytxnsparoom.sparoom_checkin\")*/\n /*->where(\"opos_ftype.ftype\",$type)\n\n ->orderBy('opos_ftype.fnumber','ASC')\n ->select(\"opos_ftype.*\",\"opos_lockerkeytxnsparoom.sparoom_checkin\",\"opos_lockerkeytxnsparoom.sparoom_checkout\")\n ->get();*/\n }" ]
[ "0.6092717", "0.60136926", "0.5869205", "0.5784061", "0.5738741", "0.56964177", "0.5618524", "0.5593727", "0.552159", "0.55139226", "0.5488107", "0.54689705", "0.54666024", "0.5450068", "0.5427162", "0.54266554", "0.5362759", "0.53302336", "0.53294307", "0.53041214", "0.5279935", "0.52783895", "0.52765375", "0.5275871", "0.5275363", "0.5251369", "0.52450335", "0.5219257", "0.5204795", "0.51998216" ]
0.6029433
1
Filter the query on the path column
public function filterByPath($path = null, $comparison = null) { if (null === $comparison) { if (is_array($path)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $path)) { $path = str_replace('*', '%', $path); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(LpPeer::PATH, $path, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newQueryOneDiskPath($path)\n {\n return $this->getQuery()->where('path', 'like', '%'.$path.'%');\n }", "public function get_path()\n\t{\n\n\t\t$lft_col = $this->left_column;\n\t\t$rgt_col = $this->right_column;\n\t\t\n\t\t//$this->model->where($this->scope_column,$this->get_scope());\n\t\t$this->model->where($lft_col . ' <= '.$this->model->$lft_col . ' AND ' . $rgt_col . ' >=' .$this->model->$rgt_col . ' ORDER BY '.$lft_col);\n\n\t\treturn $this->model->find_all(); \n\n\t}", "public function filterByPath($path = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($path)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $path)) {\n $path = str_replace('*', '%', $path);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(PhotosPeer::PATH, $path, $comparison);\n }", "protected function filterPath(string $path): string\n {\n return $this->formatPath($path);\n }", "private static function filter_params($path){\n\t\tforeach($path as $key => $value){\n\t\t\tif(strpos($path[$key],\"?\") !== false) $path[$key] = substr($path[$key],0,strpos($path[$key],\"?\"));\n\t\t\tif(empty($path[$key])){ \n\t\t\t\tunset($path[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $path;\n\t}", "public function filterByPath($path = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($path)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $path)) {\n $path = str_replace('*', '%', $path);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::PATH, $path, $comparison);\n }", "public function getItemsAndPathsWithoutHiddenFilesAndFolders_dataProvider() {}", "protected function user_where_clause() {}", "protected function getWhereClause() {}", "public function getItemsAndPathsWithHiddenFilesAndFolders_dataProvider() {}", "public function filterRoute($path){\n $exploded_path = explode('/', $path);\n foreach($exploded_path as $key => $path_element){\n if(is_numeric($path_element)){\n $exploded_path[$key] = '%';\n $this->actionParameter = (int)$path_element;\n }\n }\n return implode('/', $exploded_path);\n }", "private static function _getFilter() {}", "public static function filterPath($path)\n {\n return $path !== null ? UriPartsFilter::filterPath($path) : '';\n }", "function folderFilter($value) { return ('.' !== $value{0}); }", "public function scopePath($query, $path)\n {\n $slugs = collect(explode('/', $path));\n\n $pages = self::whereIn($this->getTable().'.slug', $slugs)->get();\n\n $target_slug = $slugs->pop();\n\n $page = $pages->where('slug', $target_slug)->filter(function ($page) use ($slugs, $pages) {\n $parent_id = $page->parent_id;\n $parent_slugs = collect();\n\n while (!is_null($parent_id)) {\n if ($pages->whereIn('id', $parent_id)->isEmpty()) {\n return false;\n }\n $parent = $pages->where($this->getKeyName(), $parent_id)->first();\n $parent_slugs->prepend($parent->slug);\n $parent_id = $parent->parent_id;\n }\n\n return $parent_slugs->toJson() == $slugs->toJson();\n })->sortBy('order')->first();\n\n if (!$page) {\n throw (new ModelNotFoundException)->setModel(get_class($this->model));\n }\n\n return $query->where($this->getKeyName(), $page->getKey());\n }", "public function filterByPath($path = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($path)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_PATH, $path, $comparison);\n }", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Pallet::query()\n ->select('Pallet.objectID', 'Pallet.Pallet_ID', 'Pallet.x', 'Pallet.y', 'Pallet.z', 'Pallet.Status')\n ->orderBy('Pallet_ID', 'asc');\n if(isset($filter['Pallet_ID']) && strlen($filter['Pallet_ID']) > 2) {\n $query->where('Pallet_ID', 'like', ltrim($filter['Pallet_ID'],'0') . '%');\n\t\t}\n\t\tif(isset($filter['Pallet_ID.prefix']) && is_array($filter['Pallet_ID.prefix'])) {\n $query->whereRaw(\"substring(Pallet_ID,1,3) in ('\".implode(\"','\", $filter['Pallet_ID.prefix']).\"')\");\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status'])) {\n $query->whereRaw(\"Status in ('\".implode(\"','\", $filter['Status']).\"')\");\n }\n elseif(isset($filter['Status']) && strlen($filter['Status']) > 3) {\n $query->where('Status', '=', $filter['Status']);\n }\n /*\n * container.parent should generate this sql request\n * select Pallet.* from Pallet join container plt on plt.objectID = Pallet.objectID where plt.parentID = 6213292055;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as plt', 'plt.objectID', '=', 'Pallet.objectID')\n ->where('plt.parentID',$filter['container.parent']);\n }\n /*\n * container.child should generate this sql request\n * select Pallet.* from Pallet join container gc on gc.parentID = Pallet.objectID where gc.objectID = 6226111054;\n */\n if(isset($filter['container.child']) && strlen($filter['container.child']) > 3) {\n $query\n ->join('container as gc', 'gc.parentID', '=', 'Pallet.objectID')\n ->where('gc.objectID',$filter['container.child']);\n }\n return $query;\n }", "private function filterByPermission(){\n\n }", "public function getFileAndFolderNameFilters() {}", "public function getPathner($filter = null)\n {\n $this->db->select('id, nama as text');\n $this->db->from('partner');\n $this->db->where('status', 1);\n if ($filter != null) {\n // by partner\n if ($filter['partner'] != '') {\n $this->db->where('id', $filter['partner']);\n }\n }\n $return = $this->db->get()->result_array();\n return $return;\n }", "public function filterPath($path)\n {\n $splittedPathArray = preg_split('/\\//', $path);\n\n $filteredPathArray = [];\n // go through the partials and filter\n foreach ($splittedPathArray as $partial) {\n\n if ($partial == '' || $partial == '.') continue;\n\n if ($partial == '..') {\n // get rid of the currently last item\n // in the $filteredPathArray\n array_pop($filteredPathArray);\n } else {\n // put item in $filteredPathArray\n array_push($filteredPathArray, $partial);\n }\n }\n\n // join partials again\n $filteredPath = implode('/', $filteredPathArray);\n if ($path[0] == '/') {\n\n $filteredPath = '/' . $filteredPath;\n }\n\n return $filteredPath;\n }", "public function addQueryToPath() {\r\n\t\t$this->path = '/' . preg_replace('/^\\/+|\\/+$/', '', $this->path);\r\n\t\tif ($this->query) {\r\n\t\t\t$this->path .= '?' . http_build_query($this->query);\r\n\t\t}\r\n\t}", "public function getByFullPath($path) {\r\n\t\t$select = $this->select()\r\n\t\t\t\t\t ->where('area_path = ?', $path);\r\r\n\t $result = $this->_db->fetchAll($select);\t\r\n return ($result == false) ? false : $result = $result;\t\t\r\n\t}", "protected function filterQuery(&$query) {\n foreach($this->filter_params as $filter) {\n if(Input::has($filter)) {\n $val = Input::get($filter);\n $query->where($filter, '=', $val);\n }\n }\n }", "public function selectWhere( string $condition = '' ) {\n $query = 'SELECT `id` AS id, `path` AS path FROM `illustration`' . $condition . ';'; \n return $this->executeQuery( $query );\n }", "function getQueryInstance() {\n // Call the parent getQueryInstance method.\n parent::getQueryInstance();\n // We only what permanent files.\n $this->query->propertyCondition('status', FILE_STATUS_PERMANENT);\n }", "public function filterByPathattributename($pathattributename = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($pathattributename)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $pathattributename)) {\n\t\t\t\t$pathattributename = str_replace('*', '%', $pathattributename);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Routes2011Peer::PATHATTRIBUTENAME, $pathattributename, $comparison);\n\t}", "private function prepareMenuContentSelectBox() {\r\n\t\t$query = $this->closureModel->getStructureAsBreadcrumbsPath()->fetchPairs(\"id\", \"path\");\r\n\t\treturn $query;\r\n\t}", "public function getTableWhere() {}", "public function getPathQuery($node)\n {\n return $this->getPathQueryBuilder($node)->getQuery();\n }" ]
[ "0.6261674", "0.5855246", "0.5591871", "0.55816436", "0.55801153", "0.550562", "0.54761624", "0.5442393", "0.542541", "0.539737", "0.5395566", "0.53631496", "0.5360561", "0.53185135", "0.52870655", "0.5285953", "0.52639055", "0.5246847", "0.5244236", "0.52384555", "0.52314454", "0.5225064", "0.52180326", "0.5206926", "0.5189539", "0.5123611", "0.51151705", "0.51085246", "0.51014036", "0.50932306" ]
0.5928557
1
Filter the query on the default_view_mod column
public function filterByDefaultViewMod($defaultViewMod = null, $comparison = null) { if (null === $comparison) { if (is_array($defaultViewMod)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $defaultViewMod)) { $defaultViewMod = str_replace('*', '%', $defaultViewMod); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(LpPeer::DEFAULT_VIEW_MOD, $defaultViewMod, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultFilterColumns();", "private static function requireViewPermission() {\n\t\t$filter = [];\n\t\tif(Session::isAuthor())\n\t\t\t$filter[] = '`accesslevel` IN ('.ACCESS_PUBLIC.','.ACCESS_REGISTERED.','.ACCESS_ADMIN.')';\n\t\telseif(Session::isRegistered())\n\t\t\t$filter[] = '`accesslevel` IN ('.ACCESS_PUBLIC.','.ACCESS_REGISTERED.')';\n\t\telse\n\t\t\t$filter[] = '`accesslevel` IN ('.ACCESS_PUBLIC.','.ACCESS_GUEST.')';\n\t\t$filter[] = \"`status`=\".STATUS_PUBLISHED;\n\t\treturn implode(' AND ',$filter) ?? '1';\n\t}", "function cbf_views_query_alter(&$view, &$query) {\n $filter_vocabulary = null;\n switch ($view->name) {\n case 'cbf2019_local_office':\n $filter_vocabulary = 'office';\n $filter_table = 'field_data_field_office';\n $filter_tid = 'field_office_tid';\n break;\n\n case 'cbf2019_local_events':\n case 'cbf2019_local_activities':\n $filter_vocabulary = 'vocabulary_1';\n $filter_table = 'field_data_taxonomy_vocabulary_1';\n $filter_tid = 'taxonomy_vocabulary_1_tid';\n break;\n\n case 'cbf2019_mappable':\n if ($view->current_display == 'block_4') {\n $filter_vocabulary = 'vocabulary_1';\n $filter_table = 'field_data_taxonomy_vocabulary_1';\n $filter_tid = 'taxonomy_vocabulary_1_tid';\n }\n break;\n }\n\n /*\n * The view is localised if the following conditions hold ...\n *\n * The view can be localised, and this invocation is the loading of the page\n * (refreshes use AJAX), and the $filter_table is not already in the query,\n * and the visitor's $localCity is known.\n */\n if (\n isset($filter_vocabulary)\n && strpos($_SERVER['REQUEST_URI'], '/views/ajax') === false\n && empty($query->get_table_info($filter_table))\n && !empty($localCity = cbf_visitor_city_string())\n ) {\n $city = taxonomy_get_term_by_name($localCity, $filter_vocabulary);\n $join = new views_join;\n $join->construct(\n $filter_table,\n $query->base_table,\n $query->base_field,\n 'entity_id',\n \"({$filter_table}.entity_type = '{$query->base_table}'\"\n . \" AND {$filter_table}.deleted = '0')\",\n 'INNER'\n );\n $query->add_relationship($filter_table, $join, $query->base_table);\n $query->add_where(1, \"{$filter_table}.{$filter_tid}\", reset($city)->tid, '=');\n }\n\n /*\n * The cbf2019_rated_content view supplies a 'More by' block ('block_1') and\n * a 'More on' block ('block_2'). We need to exclude the article on whose\n * page this block is being displayed.\n */\n if ($view->name == 'cbf2019_rated_content'\n && ($view->current_display == 'block_1'\n || $view->current_display == 'block_2')\n && is_numeric($view->args[0])\n && $view->args[0] > 0\n ) {\n $view->query->where[] = [\n 'conditions' => [\n [\n 'field' => 'node.nid',\n 'value' => $view->args[0],\n 'operator' => '!=',\n ],\n ],\n 'args' => [],\n 'type' => 'AND',\n ];\n }\n\n /*\n * The cbf2019_article_topics view definition shows only 'general' topics\n * and this code extends the query to include 'christian' topics when on\n * the 'christian' site. Ditto for cbf2019_speaker_listings.\n *\n * The tag 'add-christian-content' signals this is needed.\n */\n if (stripos($view->tag, 'add-christian-content') !== false) {\n $currentDomainId = domain_get_domain()['domain_id'];\n $christianDomainId = domain_load_domain_id('christian');\n if ($currentDomainId == $christianDomainId) {\n // We are on the 'christian' site so we want to see 'christian' topics\n foreach ($view->query->where as $i => $clause) {\n foreach ($clause['conditions'] as $j => $condition) {\n if (\n stripos($condition['field'], 'taxonomy_vocabulary_3_tid') !== false\n && $condition['operator'] == '='\n && $condition['value'] == '48'\n ) {\n $view->query->where[$i]['conditions'][$j]['operator'] = 'in';\n $view->query->where[$i]['conditions'][$j]['value'] = [ '47', '48' ];\n }\n }\n }\n }\n }\n}", "function user_views_query_substitutions(ViewExecutable $view) {\n return ['***CURRENT_USER***' => \\Drupal::currentUser()->id()];\n}", "abstract protected function getDefaultViewList();", "function sebd7tweaks_API_views_default_views($module) {\n return _sebd7tweaks_API_read_views_from_folder(drupal_get_path('module', $module) .'/views');\n}", "function scorm_get_skip_view_array(){\n return array(0 => get_string('never'),\n 1 => get_string('firstaccess','scorm'),\n 2 => get_string('always'));\n}", "function BeforeQueryView(&$strSQL, &$strWhereClause, &$pageObject)\n{\n\n\t\t$strSQL = calendar_getDbValuesById($_REQUEST[\"editid1\"], $pageObject->connection);\n;\t\t\n}", "function allow_view_results() {\n\t\treturn $this->attribute_bool('allow view results');\n\t}", "protected function matchHideForNonAdminsCondition() {}", "public static function mla_manage_columns_filter( ) {\r\n\t\treturn apply_filters( 'mla_list_table_get_columns', self::$default_columns );\r\n\t}", "function content_moderation_post_update_set_views_filter_latest_translation_affected_revision(&$sandbox) {\n $original_plugin_name = 'latest_revision';\n $new_plugin_name = 'latest_translation_affected_revision';\n\n // Check that views is installed and the moderated content view exists.\n if (\\Drupal::moduleHandler()->moduleExists('views') && $view = View::load('moderated_content')) {\n $display = &$view->getDisplay('default');\n if (!isset($display['display_options']['filters'][$original_plugin_name])) {\n return;\n }\n\n $translation_affected_filter = [\n 'id' => $new_plugin_name,\n 'field' => $new_plugin_name,\n 'plugin_id' => $new_plugin_name,\n ] + $display['display_options']['filters'][$original_plugin_name];\n\n $display['display_options']['filters'] = [$new_plugin_name => $translation_affected_filter] + $display['display_options']['filters'];\n unset($display['display_options']['filters'][$original_plugin_name]);\n\n $view->save();\n }\n}", "public function getNoViewFlag() {}", "public function getDefaultSearchColumns();", "function ApplyDefaultExtFilter(&$fld) {\n\t\t$fld->SearchValue = $fld->DefaultSearchValue;\n\t\t$fld->SearchValue2 = $fld->DefaultSearchValue2;\n\t\t$fld->SearchOperator = $fld->DefaultSearchOperator;\n\t\t$fld->SearchOperator2 = $fld->DefaultSearchOperator2;\n\t\t$fld->SearchCondition = $fld->DefaultSearchCondition;\n\t}", "function ApplyDefaultExtFilter(&$fld) {\n\t\t$fld->SearchValue = $fld->DefaultSearchValue;\n\t\t$fld->SearchValue2 = $fld->DefaultSearchValue2;\n\t\t$fld->SearchOperator = $fld->DefaultSearchOperator;\n\t\t$fld->SearchOperator2 = $fld->DefaultSearchOperator2;\n\t\t$fld->SearchCondition = $fld->DefaultSearchCondition;\n\t}", "abstract protected function getDefaultView();", "function field_view($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $fieldRight = right::get_field($name);\r\n $view = $fieldRight[view];\r\n\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($view != 0) return($userRight & $view);\r\n else return(false); // default no display\r\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "protected function getWhereClauseForEnabledFields() {}", "function PMA_showColumnTypesInDataEditView($url_params, $showColumnType )\n{\n if(!$showColumnType) {\n $params = array('ShowFieldTypesInDataEditView' => 1);\n } else {\n $params = array('ShowFieldTypesInDataEditView' => 0);\n }\n $params = array(\n 'ShowFunctionFields' => $GLOBALS['cfg']['ShowFunctionFields'],\n 'goto' => 'sql.php');\n $this_other_url_params = array_merge($url_params, $params);\n if(!$showColumnType) {\n return ' : <a href=\"tbl_change.php' . PMA_generate_common_url($this_other_url_params) . '\">' . __('Type') . '</a>' . \"\\n\";\n }\n return ' <th><a href=\"tbl_change.php' . PMA_generate_common_url($this_other_url_params) . '\" title=\"' . __('Hide') . '\">' . __('Type') . '</a></th>' . \"\\n\";\n\n}", "function ead_import_views_query_alter(&$view, &$query){\n if ($view->name === \"collection_search\"){\n\n\t// create inner join on the child-ancestor table\n\t// to get all ancestors for a node\n\t$join = new views_join();\n\t$join->table = 'ead_import_child_ancestor';\n\t$join->field = 'child_nid';\n\t$join->left_table = 'node';\n\t$join->left_field = 'nid';\n\t$join->type = 'INNER';\n\n\t// add the join to the query\n\t$alias = $query->ensure_table(\"ead_import_child_ancestor\", NULL, $join);\n\n }\n}", "public function testViewFilter()\n {\n $testFilter = $this->la->getAdminFilterAttr(\n 'username',\n '(manager=?)',\n 'Domain|path',\n '|',\n true,\n array('ldapView')\n );\n $this->assertEquals($testFilter['filter'], '(manager=username)');\n $this->assertEquals($testFilter['attrs'], array('domain', 'path'));\n }", "function beforeFilter() {\n $this->Auth->allow('view', 'index');\n parent::beforeFilter(); \n $this->layout = 'default'; \n }", "function enquery_view()\n {\n $ob = new model();\n $show_enquery=$ob->enquery_view_sql();\n return $show_enquery;\n }", "protected function defaultDisplayOptions() {\n $display_options = [];\n $display_options['access']['type'] = 'none';\n $display_options['cache']['type'] = 'tag';\n $display_options['query']['type'] = 'views_query';\n $display_options['exposed_form']['type'] = 'basic';\n $display_options['pager']['type'] = 'mini';\n $display_options['style']['type'] = 'default';\n $display_options['row']['type'] = 'fields';\n\n // Add default options array to each plugin type.\n foreach ($display_options as &$options) {\n $options['options'] = [];\n }\n\n // Add a least one field so the view validates and the user has a preview.\n // The base field can provide a default in its base settings; otherwise,\n // choose the first field with a field handler.\n $default_table = $this->base_table;\n $data = Views::viewsData()->get($default_table);\n if (isset($data['table']['base']['defaults']['field'])) {\n $default_field = $data['table']['base']['defaults']['field'];\n // If the table for the default field is different to the base table,\n // load the view table data for this table.\n if (isset($data['table']['base']['defaults']['table']) && $data['table']['base']['defaults']['table'] != $default_table) {\n $default_table = $data['table']['base']['defaults']['table'];\n $data = Views::viewsData()->get($default_table);\n }\n }\n else {\n foreach ($data as $default_field => $field_data) {\n if (isset($field_data['field']['id'])) {\n break;\n }\n }\n }\n // @todo Refactor the code to use ViewExecutable::addHandler. See\n // https://www.drupal.org/node/2383157.\n $display_options['fields'][$default_field] = [\n 'table' => $default_table,\n 'field' => $default_field,\n 'id' => $default_field,\n 'entity_type' => $data[$default_field]['entity type'] ?? NULL,\n 'entity_field' => $data[$default_field]['entity field'] ?? NULL,\n 'plugin_id' => $data[$default_field]['field']['id'],\n ];\n\n return $display_options;\n }", "function toggle_master_view_query_result(): Array {\n $model = $this->current_model;\n\n $master_view = $this->master_view_query_result();\n \n // Get result from grants model if feature model list returns empty\n \n if(method_exists($this->CI->$model,'master_view') &&\n is_array($this->CI->$model->master_view()) && \n count($this->CI->$model->master_view()) > 0 \n ){\n \n $master_view = $this->CI->$model->master_view();\n \n }\n \n return $master_view;\n }", "private function get_default_filter_search() {\n \n //get instance config\n $instance_config = $this->get_settings_config_data();\n \n //if there is saved filters\n if(isset($instance_config) && isset($instance_config->data))\n $search = $this->get_default_search($instance_config->data);//get default\n \n //if a default for instance is found return it\n if($search != null) return $search;\n \n //get global config data for dd_content blocks\n $global_config_data = dd_content_get_admin_config();\n \n //tty to get a default from global\n $search = $this->get_default_search($global_config_data);\n \n //if a default is found return it\n if($search != null) return $search;\n\n //no default is found - return null\n return null;\n \n }", "function defaultViewExists () {\n\t\treturn isset ($this->_defaultView);\n\t}", "public function setGeneralDefaultQuery()\n {\n return $this;\n }" ]
[ "0.5788332", "0.5737014", "0.5687842", "0.550335", "0.54087603", "0.54007953", "0.53469086", "0.53042746", "0.526929", "0.51868963", "0.5162396", "0.5110507", "0.51041776", "0.5086299", "0.5062325", "0.5062325", "0.5057927", "0.5027669", "0.5024374", "0.4990586", "0.49852213", "0.4944", "0.49059808", "0.4904879", "0.48975778", "0.4890829", "0.48641735", "0.48577818", "0.48551485", "0.48130998" ]
0.6323465
0
Filter the query on the content_maker column
public function filterByContentMaker($contentMaker = null, $comparison = null) { if (null === $comparison) { if (is_array($contentMaker)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $contentMaker)) { $contentMaker = str_replace('*', '%', $contentMaker); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(LpPeer::CONTENT_MAKER, $contentMaker, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _oembed_filter_feed_content($content)\n {\n }", "public function content_filter($in_the_content) ///< The content in need of filtering.\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n if ($this->plugin_is_main) {\n // Simple searches can be mixed in with other content.\n $in_the_content = parent::content_filter($in_the_content);\n $count = 0;\n\n $in_the_content = $this->display_popup_search($in_the_content, $this->cms_get_post_meta(get_the_ID(), 'bmlt_simple_searches'), $count);\n } else // If we are not in a page in the main display, we remove the shortcodes.\n {\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_map', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'simple_search_list', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_mobile', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_simple', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_changes', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_quicksearch', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_table', '');\n }\n \n return $in_the_content;\n }", "abstract protected function filterField(): string;", "public function filter()\n {\n $domDoc = new DOMDocument();\n @$domDoc->loadHTML($this->_input);\n $editableElements = $this->findEditableElements($domDoc);\n \n foreach ($editableElements as $value) {\n $element = $value['element'];\n $data = $value['data'];\n\n // filter boolean for mysql\n $data['isGlobal'] = ($data['isGlobal']) ? 1 : 0;\n\n // query database for content\n $contentTable = new Hobo_Db_Table_Content();\n $data['routeName'] = Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName();\n $row = $contentTable->selectLatest($data);\n \n if (! empty($row->content)) {\n // remove any children\n while ($element->hasChildNodes()){\n $element->removeChild($element->childNodes->item(0));\n } \n // inject content\n $fragment = $domDoc->createDocumentFragment(); // create fragment\n $fragment->appendXML($row->content);\n $element->appendChild($fragment); \n }\n }\n\n return $domDoc->saveHTML();\n }", "function filter_data($data, $filter) {\n return CMContent::Filter($data, $filter);\n}", "abstract protected function filterFieldvalue();", "public function scopeContent($query, $content)\n {\n return $query->where('content', 'LIKE', $content);\n }", "private static function _getFilter() {}", "public function findByFilter($filter) {\n $query = $this->createQuery();\n //$query->getQuerySettings()->setRespectEnableFields(false);\n $query->getQuerySettings()->setEnableFieldsToBeIgnored(array());\n $query->getQuerySettings()->setIncludeDeleted(false);\n $query->getQuerySettings()->setRespectStoragePage(false);\n \n\n $constraints = array();\n if($filter->keyword) {\n $keywordConstraints = array();\n $keywordConstraints[] = $query->like('title', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('abstract', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('bodytext', '%'.$filter->keyword.'%');\n $constraints[] = $query->logicalOr($keywordConstraints);\n }\n if($filter->area) {\n $constraints[] = $query->contains('areas', $filter->area);\n }\n if($filter->industry) {\n $constraints[] = $query->contains('industries', $filter->industry);\n }\n if($filter->technology) {\n $constraints[] = $query->contains('technologies', $filter->technology);\n }\n if($filter->theme) {\n $constraints[] = $query->contains('themes', $filter->theme);\n }\n if($filter->year) {\n $minDate = mktime(0, 0, 0, 1, 1, $filter->year);\n $maxDate = mktime(23, 59, 59, 12, 31, $filter->year);\n $constraints[] = $query->greaterThanOrEqual('article_date', $minDate);\n $constraints[] = $query->lessThanOrEqual('article_date', $maxDate);\n }\n\n if(count($constraints)) {\n \n $query->matching(\n $query->logicalAnd($constraints)\n );\n \n \n \n//$queryParser = $this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbQueryParser::class);\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());\n//\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters());\n\n\n\n return $query->matching(\n $query->logicalAnd($constraints)\n )\n ->execute();\n \n }\n else {\n return $this->findAll();\n }\n }", "protected function _buildContentWhere($q = true)\n\t{\n\t\t$table = $this->getTable($this->records_jtable, '');\n\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser();\n\t\t$jinput = $app->input;\n\t\t$option = $jinput->get('option', '', 'cmd');\n\n\t\t$where = array();\n\n\t\t$field = $this->getField();\n\t\t$params = $field ? $field->parameters : new JRegistry();\n\n\t\t// Limit listed files to specific uploader, 1: current user, 0: any user, and respect 'filter_uploader' URL variable\n\t\t$limit_by_uploader = 0;\n\n\t\t// Calculate a default value for limiting to 'media' or 'secure' folder, 0: media folder, 1: secure folder, 2: no folder limitation AND respect 'filter_secure' URL variable\n\t\t$default_dir = 2;\n\t\tif ($field)\n\t\t{\n\t\t\tif (in_array($field->field_type, array('file', 'image')))\n\t\t\t\t$default_dir = 1; // 'secure' folder\n\t\t\telseif (in_array($field->field_type, array('minigallery', 'mediafile')))\n\t\t\t\t$default_dir = 0; // 'media' folder\n\t\t}\n\t\t$target_dir = $params->get('target_dir', $default_dir);\n\n\t\t// Handles special cases of fields, that have special rules for listing specific files only\n\t\tif ($field && $field->field_type =='image' && $params->get('image_source') == 0)\n\t\t{\n\t\t\t$limit_by_uploader = (int) $params->get('limit_by_uploader', 0);\n\t\t\tif ($params->get('list_all_media_files', 0))\n\t\t\t{\n\t\t\t\t$where[] = ' a.ext IN (\"jpg\",\"gif\",\"png\",\"jpeg\") ';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$filesUsedByImageField = $this->getFilesUsedByImageField($field, $params);\n\t\t\t\tif ($filesUsedByImageField)\n\t\t\t\t{\n\t\t\t\t\t$where[] = $filesUsedByImageField;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Text search and search scope\n\t\t$scope = $this->getState('scope');\n\t\t$search = $this->getState('search');\n\t\t$search = StringHelper::trim(StringHelper::strtolower($search));\n\n\t\t$filter_state = $this->getState('filter_state');\n\t\t$filter_access = $this->getState('filter_access');\n\t\t$filter_lang\t\t\t= $this->getState('filter_lang');\n\t\t$filter_uploader = $this->getState('filter_uploader');\n\t\t$filter_secure = $this->getState('filter_secure');\n\t\t$filter_stamp = $this->getState('filter_stamp');\n\t\t$filter_url = $this->getState('filter_url');\n\t\t$filter_ext = $this->getState('filter_ext');\n\n\n\t\t$permission = FlexicontentHelperPerm::getPerm();\n\t\t$CanViewAllFiles = $permission->CanViewAllFiles;\n\n\t\t// Filter by state\n\t\tif (property_exists($table, $this->state_col ?? ''))\n\t\t{\n\t\t\tswitch ($filter_state)\n\t\t\t{\n\t\t\t\tcase 'P':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = 1';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'U':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = 0';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'A':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = 2';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'T':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = -2';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// ALL: published & unpublished, but exclude archived, trashed\n\t\t\t\t\tif (!strlen($filter_state))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' <> -2';\n\t\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' <> 2';\n\t\t\t\t\t}\n\t\t\t\t\telseif (is_numeric($filter_state))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = ' . (int) $filter_state;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Filter by language\n\t\tif (strlen($filter_lang))\n\t\t{\n\t\t\t$where[] = 'a.language = ' . $this->_db->Quote($filter_lang);\n\t\t}\n\n\t\t/**\n\t\t * Limit via parameter,\n\t\t * 1: limit to current user as uploader,\n\t\t * 0: list files from any uploader, and respect 'filter_uploader' URL variable\n\t\t */\n\n\t\t// Limit to current user\n\t\tif ($limit_by_uploader || !$CanViewAllFiles)\n\t\t{\n\t\t\t$where[] = 'a.' . $this->created_by_col . ' = ' . (int) $user->id;\n\t\t}\n\n\t\t// Filter by uploader\n\t\telseif (strlen($filter_uploader))\n\t\t{\n\t\t\t$where[] = 'a.' . $this->created_by_col . ' = ' . (int) $filter_uploader;\n\t\t}\n\n\t\t// Filter by access level\n\t\tif (property_exists($table, 'access'))\n\t\t{\n\t\t\tif (strlen($filter_access))\n\t\t\t{\n\t\t\t\t$where[] = 'a.access = ' . (int) $filter_access;\n\t\t\t}\n\n\t\t\t// Filter via View Level Access, if user is not super-admin\n\t\t\tif (!JFactory::getUser()->authorise('core.admin') && (JFactory::getApplication()->isClient('site') || $this->listViaAccess))\n\t\t\t{\n\t\t\t\t$groups = implode(',', JAccess::getAuthorisedViewLevels($user->id));\n\t\t\t\t$where[] = 'a.access IN (' . $groups . ')';\n\t\t\t}\n\t\t}\n\n\t\t// Limit via parameter, 2: List any file and respect 'filter_secure' URL variable, 1: limit to secure, 0: limit to media\n\t\tif (strlen($target_dir) && $target_dir != 2)\n\t\t{\n\t\t\t$filter_secure = $target_dir ? 'S' : 'M'; // force secure / media\n\t\t}\n\n\t\tif ($filter_url === 'F')\n\t\t{\n\t\t\t$where[] = ' url = 0';\n\t\t}\n\t\telseif ($filter_url === 'U')\n\t\t{\n\t\t\t$where[] = ' url = 1';\n\t\t}\n\n\t\tif ($filter_stamp === 'Y')\n\t\t{\n\t\t\t$where[] = ' stamp = 1';\n\t\t}\n\t\telseif ($filter_stamp === 'N')\n\t\t{\n\t\t\t$where[] = ' stamp = 0';\n\t\t}\n\n\t\tif ($filter_secure === 'M')\n\t\t{\n\t\t\t$where[] = ' secure = 0';\n\t\t}\n\t\telseif ($filter_secure === 'S')\n\t\t{\n\t\t\t$where[] = ' secure = 1';\n\t\t}\n\n\t\tif (strlen($filter_ext))\n\t\t{\n\t\t\t$where[] = ' ext = ' . $this->_db->Quote($filter_ext);\n\t\t}\n\n\t\tif (!empty($this->search_cols) && strlen($search))\n\t\t{\n\t\t\tif (stripos($search, 'id:') === 0)\n\t\t\t{\n\t\t\t\t$where[] = 'a.id = ' . (int) substr($search, 3);\n\t\t\t}\n\t\t\telseif (stripos($search, 'author:') === 0)\n\t\t\t{\n\t\t\t\t$search_quoted = $this->_db->Quote('%' . $this->_db->escape(substr($search, 7), true) . '%');\n\t\t\t\t$where[] = '(ua.name LIKE ' . $search_quoted . ' OR ua.username LIKE ' . $search_quoted . ')';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$escaped_search = str_replace(' ', '%', $this->_db->escape(trim($search), true));\n\t\t\t\t$search_quoted = $this->_db->Quote('%' . $escaped_search . '%', false);\n\n\t\t\t\t$table = $this->getTable($this->records_jtable, '');\n\t\t\t\t$textwhere = array();\n\t\t\t\t$col_name = str_replace('a.', '', $scope);\n\n\t\t\t\tif ($scope === '-1')\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->search_cols as $search_col)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (property_exists($table, $search_col))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$textwhere[] = 'LOWER(a.' . $search_col . ') LIKE ' . $search_quoted;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($scope === 'a.filename')\n\t\t\t\t{\n\t\t\t\t\t$textwhere[] = ' LOWER(a.filename) LIKE ' . $search_quoted;\n\t\t\t\t\t$textwhere[] = ' LOWER(a.filename_original) LIKE ' . $search_quoted;\n\t\t\t\t}\n\t\t\t\telseif (in_array($col_name, $this->search_cols) && property_exists($table, $col_name))\n\t\t\t\t{\n\t\t\t\t\t// Scope is user input, was filtered as CMD but also use quoteName() on the column\n\t\t\t\t\t$textwhere[] = 'LOWER(' . $this->_db->quoteName($scope) . ') LIKE ' . $search_quoted;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tJFactory::getApplication()->enqueueMessage('Text search scope ' . $scope . ' is unknown, search failed', 'warning');\n\t\t\t\t}\n\n\t\t\t\tif ($textwhere)\n\t\t\t\t{\n\t\t\t\t\t$where[] = '(' . implode(' OR ', $textwhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($q instanceof \\JDatabaseQuery)\n\t\t{\n\t\t\treturn $where ? $q->where($where) : $q;\n\t\t}\n\n\t\treturn $q\n\t\t\t? ' WHERE ' . (count($where) ? implode(' AND ', $where) : ' 1 ')\n\t\t\t: $where;\n\t}", "function setQueryFilter($sType, $sContent) {\n // when receive search type and data\n if(!(is_null($sType) || is_null($sContent))) {\n // when search type is all\n if($sType == 'all') {\n $this->queryFilter = \"WHERE title LIKE '%{$sContent}%'\n OR content LIKE '%{$sContent}%'\n OR user_name LIKE '%{$sContent}%'\";\n } else if($sType == 'writer') {\n $this->queryFilter = \"WHERE writer LIKE '%{$sContent}%'\n OR user_name LIKE '%{$sContent}%'\";\n } else {\n $this->queryFilter = \"WHERE {$sType} LIKE '%{$sContent}%'\";\n }\n } else {\n $this->queryFilter = '';\n }\n }", "function filter_example_content($content) {\n $content = strtoupper($content);\n\n // return modified content\n return $content;\n\n }", "public function filter_coler($params){\n $this->db->select(\"$this->table_product.text_coler\")\n ->from($this->table_product);\n $this->db->distinct();\n if (!empty($params['keyword'])) $this->db->like(\"$this->table_product.text_coler\", $params['keyword']);\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }", "function mt_filter_the_content($content) {\n\t// $content = \"<div style='color: fuchsia;'>{$content}</div>\";\n\treturn $content;\n }", "public function onExtbaseQueryFilter(ModifyQueryBeforeFetchingObjectDataEvent $e): void\n {\n $query = $e->getQuery();\n $source = $query->getSource();\n if (! $source instanceof Selector) {\n return;\n }\n \n if (! $this->visibilityAspect->includeHiddenOfTable($source->getSelectorName())) {\n return;\n }\n \n $settings = $query->getQuerySettings();\n $settings->setIgnoreEnableFields(true);\n $settings->setEnableFieldsToBeIgnored(['disabled']);\n }", "public function setContentQuery($val)\n {\n $this->_propDict[\"contentQuery\"] = $val;\n return $this;\n }", "public function getFilterArtworks($request){\n return DB::select('select * from users, personal_account_models where users.id = personal_account_models.user_id AND personal_account_models.published = 1 AND users.name Like \"%'.$request['artist'].'%\"');\n }", "protected function modifyQueryForFilter()\n {\n //the following select includes the mobile number, but overrides\n //the columns with an empty string if the matching boolean is false\n $this->q->getDoctrineQuery()->addSelect(\n 'if(x.is_show_mobile_number_in_phonebook is not FALSE, x.mobile_number, \\'\\') as mobile_number'\n );\n \n if ($this->isLocationView)\n {\n //order results by location name first\n $this->q->addOrderByPrefix('UllLocation->name');\n }\n\n if (!empty($this->phoneSearchFilter))\n {\n $this->q->getDoctrineQuery()->openParenthesisBeforeLastPart();\n \n //we need special handling here because we don't want hidden\n //numbers to be searchable\n $phoneSearchFilterPattern = '%' . $this->phoneSearchFilter . '%';\n \n $this->q->getDoctrineQuery()->orWhere(\n '(is_show_extension_in_phonebook is not FALSE AND phone_extension LIKE ?) ' .\n 'OR (is_show_extension_in_phonebook is FALSE AND alternative_phone_extension LIKE ?)',\n array($phoneSearchFilterPattern, $phoneSearchFilterPattern));\n\n $this->q->orWhere('is_show_mobile_number_in_phonebook is not FALSE ' .\n 'AND mobile_number LIKE ?', $phoneSearchFilterPattern);\n \n $this->q->getDoctrineQuery()->closeParenthesis();\n }\n \n\n if (!empty($this->filter_location_id))\n {\n $this->q->addWhere('ull_location_id = ?', $this->filter_location_id);\n }\n \n //we only want users which are active and have their\n //show-in-phonebook not set to false\n $this->q->addWhere('UllUserStatus->is_active is TRUE and is_show_in_phonebook is not FALSE');\n }", "function simplenews_build_issue_filter_query(EntityFieldQuery $query) {\n if (isset($_SESSION['simplenews_issue_filter'])) {\n foreach ($_SESSION['simplenews_issue_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n case 'newsletter':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->fieldCondition(variable_get('simplenews_newsletter_field', 'simplenews_newsletter'), 'target_id', $value);\n }\n break;\n }\n }\n }\n}", "public function filtering();", "public function getWhereClauseForEnabledFieldsCallsSysPageForDeletedFlagInFrontend() {}", "abstract public function filterFields();", "function _buildQuery()\n\t{\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\n\t\t$query = 'SELECT c.*, g.name AS groupname, cc.title as name, u.name AS editor, f.ordering AS fpordering, v.name AS author'\n\t\t\t. ' FROM #__content AS c'\n\t\t\t. ' LEFT JOIN #__categories AS cc ON cc.id = c.catid'\n\t\t\t. ' INNER JOIN #__content_frontpage AS f ON f.content_id = c.id'\n\t\t\t. ' LEFT JOIN #__users AS u ON u.id = c.checked_out'\n\t\t\t. ' LEFT JOIN #__users AS v ON v.id = c.created_by'\n\t\t\t. $where\n\t\t\t. $orderby\n\t\t;\n\n\t\treturn $query;\n\t}", "abstract function get_sql_filter($data);", "private function sql_resAllItemsFilterWiRelation()\n {\n // Don't count hits\n $bool_count = false;\n\n // Query for all filter items\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereAllItems();\n $groupBy = $this->curr_tableField;\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//$this->pObj->dev_var_dump( $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "function _buildContentWhere()\n\t{\n\t\t$user = & JFactory::getUser() ;\t\t\n\t\t$hidePastEvents = EventBookingHelper::getConfigValue('hide_past_events');\n\t\t$where = array() ;\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$where[] = 'a.published = 1';\n\t\tif (version_compare(JVERSION, '1.6.0', 'ge')) {\n\t\t $where[] = ' a.access IN ('.implode(',', $user->getAuthorisedViewLevels()).')' ;\n\t\t} else {\n\t\t $gid\t\t= $user->get('aid', 0);\n\t\t $where[] = ' a.access <= '.(int)$gid ; \n\t\t}\t\t\n\t\tif ($categoryId) {\n\t\t\t//$where[] = ' a.category_id = '.$categoryId ;\t\t\t\t\t\t\n\t\t\t$where[] = ' a.id IN (SELECT event_id FROM #__eb_event_categories WHERE category_id='.$categoryId.')' ;\n\t\t}\n\t\tif ($hidePastEvents) {\n\t\t\t$where[] = ' DATE(a.event_date) >= CURDATE() ';\n\t\t}\n\t\t$where \t\t= ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' );\t\t\n\t\treturn $where;\n\t}", "public function beforeSave() {\n if ( ! empty($this->filter_id)) {\n $this->content_html = Filter::get($this->filter_id)->apply($this->content);\n }\n else {\n $this->content_html = $this->content;\n }\n return true;\n }", "private function filterByPermission(){\n\n }", "function filter_search_columns($columns, $search, $WP_User_Query)\n {\n }", "function testFilteredQuery()\n {\n $q1 = MysqlQueryFactory::getInstance(array(\n \"parameters\" => array(\n \"simple\" => array(\"TYPE\" => \"String\"),\n \"number\" => array(\"TYPE\" => \"Integer\"),\n \"number2\" => array(\"TYPE\" => \"Integer\")\n ),\n \"base\" => \"SELECT * FROM MiTest WHERE [[%filter%]] \"\n ));\n $q1->setConnection($this->connection);\n $g=new StorageEngineGetParams(array(\"query\"=>\"test\",\"filter\"=>array(\"FIELD\"=>\"simple\",\"OPERATOR\"=>\"EQUALS\",\"VALUE\"=>\"Ho'la\")));\n $composed=$q1->parse($g);\n $this->assertEquals(\"SELECT * FROM MiTest WHERE simple = 'Ho\\\\'la'\",trim($composed));\n }" ]
[ "0.594375", "0.56333435", "0.5587182", "0.55657786", "0.5545406", "0.5534878", "0.55006605", "0.5500343", "0.5461913", "0.54550713", "0.53959775", "0.53721654", "0.5343203", "0.5317929", "0.5303145", "0.52859867", "0.5281264", "0.5265183", "0.5226745", "0.5205881", "0.5188426", "0.51692086", "0.5151672", "0.51498365", "0.5146918", "0.51229906", "0.51180637", "0.51085234", "0.5095267", "0.50794846" ]
0.58517593
1
Filter the query on the content_local column
public function filterByContentLocal($contentLocal = null, $comparison = null) { if (null === $comparison) { if (is_array($contentLocal)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $contentLocal)) { $contentLocal = str_replace('*', '%', $contentLocal); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(LpPeer::CONTENT_LOCAL, $contentLocal, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _oembed_filter_feed_content($content)\n {\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function content_filter($in_the_content) ///< The content in need of filtering.\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n if ($this->plugin_is_main) {\n // Simple searches can be mixed in with other content.\n $in_the_content = parent::content_filter($in_the_content);\n $count = 0;\n\n $in_the_content = $this->display_popup_search($in_the_content, $this->cms_get_post_meta(get_the_ID(), 'bmlt_simple_searches'), $count);\n } else // If we are not in a page in the main display, we remove the shortcodes.\n {\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_map', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'simple_search_list', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_mobile', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_simple', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_changes', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_quicksearch', '');\n $in_the_content = self::replace_shortcode($in_the_content, 'bmlt_table', '');\n }\n \n return $in_the_content;\n }", "private static function _getFilter() {}", "private function filterByPermission(){\n\n }", "function filter_data($data, $filter) {\n return CMContent::Filter($data, $filter);\n}", "public function filter()\n {\n $domDoc = new DOMDocument();\n @$domDoc->loadHTML($this->_input);\n $editableElements = $this->findEditableElements($domDoc);\n \n foreach ($editableElements as $value) {\n $element = $value['element'];\n $data = $value['data'];\n\n // filter boolean for mysql\n $data['isGlobal'] = ($data['isGlobal']) ? 1 : 0;\n\n // query database for content\n $contentTable = new Hobo_Db_Table_Content();\n $data['routeName'] = Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName();\n $row = $contentTable->selectLatest($data);\n \n if (! empty($row->content)) {\n // remove any children\n while ($element->hasChildNodes()){\n $element->removeChild($element->childNodes->item(0));\n } \n // inject content\n $fragment = $domDoc->createDocumentFragment(); // create fragment\n $fragment->appendXML($row->content);\n $element->appendChild($fragment); \n }\n }\n\n return $domDoc->saveHTML();\n }", "abstract protected function filterFieldvalue();", "function acf_is_local_field($key = '')\n{\n}", "public function scopeContent($query, $content)\n {\n return $query->where('content', 'LIKE', $content);\n }", "function acf_enable_local()\n{\n}", "abstract protected function filterField(): string;", "private function filter() {\r\n $globalSearch = array();\r\n $columnSearch = array();\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n\r\n if (isset($this->resource->requestData['search']) && $this->resource->requestData['search']['value'] != '') {\r\n\r\n $str = $this->resource->requestData['search']['value'];\r\n\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['searchable'] == 'true') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Individual column filtering\r\n if (isset($this->resource->requestData['columns'])) {\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n $str = $requestColumn['search']['value'];\r\n if ($requestColumn['searchable'] == 'true' &&\r\n $str != '') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Combine the filters into a single string\r\n $where = '';\r\n if (count($globalSearch)) {\r\n $where = '(' . implode(' OR ', $globalSearch) . ')';\r\n }\r\n if (count($columnSearch)) {\r\n $where = $where === '' ?\r\n implode(' AND ', $columnSearch) :\r\n $where . ' AND ' . implode(' AND ', $columnSearch);\r\n }\r\n\r\n return $where;\r\n }", "public function ULFilterContent( $unfilteredContent, $contentURL, $contentTitle, $hyperlinks ){ return $this->APICall( array('ULFilterContent' => $unfilteredContent, 'contentURL' => $contentURL, 'contentTitle' => $contentTitle, 'hyperlinks' => $hyperlinks), \"Could not filter the content at \" . $contentURL ); }", "protected function _buildContentWhere($q = true)\n\t{\n\t\t$table = $this->getTable($this->records_jtable, '');\n\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser();\n\t\t$jinput = $app->input;\n\t\t$option = $jinput->get('option', '', 'cmd');\n\n\t\t$where = array();\n\n\t\t$field = $this->getField();\n\t\t$params = $field ? $field->parameters : new JRegistry();\n\n\t\t// Limit listed files to specific uploader, 1: current user, 0: any user, and respect 'filter_uploader' URL variable\n\t\t$limit_by_uploader = 0;\n\n\t\t// Calculate a default value for limiting to 'media' or 'secure' folder, 0: media folder, 1: secure folder, 2: no folder limitation AND respect 'filter_secure' URL variable\n\t\t$default_dir = 2;\n\t\tif ($field)\n\t\t{\n\t\t\tif (in_array($field->field_type, array('file', 'image')))\n\t\t\t\t$default_dir = 1; // 'secure' folder\n\t\t\telseif (in_array($field->field_type, array('minigallery', 'mediafile')))\n\t\t\t\t$default_dir = 0; // 'media' folder\n\t\t}\n\t\t$target_dir = $params->get('target_dir', $default_dir);\n\n\t\t// Handles special cases of fields, that have special rules for listing specific files only\n\t\tif ($field && $field->field_type =='image' && $params->get('image_source') == 0)\n\t\t{\n\t\t\t$limit_by_uploader = (int) $params->get('limit_by_uploader', 0);\n\t\t\tif ($params->get('list_all_media_files', 0))\n\t\t\t{\n\t\t\t\t$where[] = ' a.ext IN (\"jpg\",\"gif\",\"png\",\"jpeg\") ';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$filesUsedByImageField = $this->getFilesUsedByImageField($field, $params);\n\t\t\t\tif ($filesUsedByImageField)\n\t\t\t\t{\n\t\t\t\t\t$where[] = $filesUsedByImageField;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Text search and search scope\n\t\t$scope = $this->getState('scope');\n\t\t$search = $this->getState('search');\n\t\t$search = StringHelper::trim(StringHelper::strtolower($search));\n\n\t\t$filter_state = $this->getState('filter_state');\n\t\t$filter_access = $this->getState('filter_access');\n\t\t$filter_lang\t\t\t= $this->getState('filter_lang');\n\t\t$filter_uploader = $this->getState('filter_uploader');\n\t\t$filter_secure = $this->getState('filter_secure');\n\t\t$filter_stamp = $this->getState('filter_stamp');\n\t\t$filter_url = $this->getState('filter_url');\n\t\t$filter_ext = $this->getState('filter_ext');\n\n\n\t\t$permission = FlexicontentHelperPerm::getPerm();\n\t\t$CanViewAllFiles = $permission->CanViewAllFiles;\n\n\t\t// Filter by state\n\t\tif (property_exists($table, $this->state_col ?? ''))\n\t\t{\n\t\t\tswitch ($filter_state)\n\t\t\t{\n\t\t\t\tcase 'P':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = 1';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'U':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = 0';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'A':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = 2';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'T':\n\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = -2';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// ALL: published & unpublished, but exclude archived, trashed\n\t\t\t\t\tif (!strlen($filter_state))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' <> -2';\n\t\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' <> 2';\n\t\t\t\t\t}\n\t\t\t\t\telseif (is_numeric($filter_state))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where[] = 'a.' . $this->state_col . ' = ' . (int) $filter_state;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Filter by language\n\t\tif (strlen($filter_lang))\n\t\t{\n\t\t\t$where[] = 'a.language = ' . $this->_db->Quote($filter_lang);\n\t\t}\n\n\t\t/**\n\t\t * Limit via parameter,\n\t\t * 1: limit to current user as uploader,\n\t\t * 0: list files from any uploader, and respect 'filter_uploader' URL variable\n\t\t */\n\n\t\t// Limit to current user\n\t\tif ($limit_by_uploader || !$CanViewAllFiles)\n\t\t{\n\t\t\t$where[] = 'a.' . $this->created_by_col . ' = ' . (int) $user->id;\n\t\t}\n\n\t\t// Filter by uploader\n\t\telseif (strlen($filter_uploader))\n\t\t{\n\t\t\t$where[] = 'a.' . $this->created_by_col . ' = ' . (int) $filter_uploader;\n\t\t}\n\n\t\t// Filter by access level\n\t\tif (property_exists($table, 'access'))\n\t\t{\n\t\t\tif (strlen($filter_access))\n\t\t\t{\n\t\t\t\t$where[] = 'a.access = ' . (int) $filter_access;\n\t\t\t}\n\n\t\t\t// Filter via View Level Access, if user is not super-admin\n\t\t\tif (!JFactory::getUser()->authorise('core.admin') && (JFactory::getApplication()->isClient('site') || $this->listViaAccess))\n\t\t\t{\n\t\t\t\t$groups = implode(',', JAccess::getAuthorisedViewLevels($user->id));\n\t\t\t\t$where[] = 'a.access IN (' . $groups . ')';\n\t\t\t}\n\t\t}\n\n\t\t// Limit via parameter, 2: List any file and respect 'filter_secure' URL variable, 1: limit to secure, 0: limit to media\n\t\tif (strlen($target_dir) && $target_dir != 2)\n\t\t{\n\t\t\t$filter_secure = $target_dir ? 'S' : 'M'; // force secure / media\n\t\t}\n\n\t\tif ($filter_url === 'F')\n\t\t{\n\t\t\t$where[] = ' url = 0';\n\t\t}\n\t\telseif ($filter_url === 'U')\n\t\t{\n\t\t\t$where[] = ' url = 1';\n\t\t}\n\n\t\tif ($filter_stamp === 'Y')\n\t\t{\n\t\t\t$where[] = ' stamp = 1';\n\t\t}\n\t\telseif ($filter_stamp === 'N')\n\t\t{\n\t\t\t$where[] = ' stamp = 0';\n\t\t}\n\n\t\tif ($filter_secure === 'M')\n\t\t{\n\t\t\t$where[] = ' secure = 0';\n\t\t}\n\t\telseif ($filter_secure === 'S')\n\t\t{\n\t\t\t$where[] = ' secure = 1';\n\t\t}\n\n\t\tif (strlen($filter_ext))\n\t\t{\n\t\t\t$where[] = ' ext = ' . $this->_db->Quote($filter_ext);\n\t\t}\n\n\t\tif (!empty($this->search_cols) && strlen($search))\n\t\t{\n\t\t\tif (stripos($search, 'id:') === 0)\n\t\t\t{\n\t\t\t\t$where[] = 'a.id = ' . (int) substr($search, 3);\n\t\t\t}\n\t\t\telseif (stripos($search, 'author:') === 0)\n\t\t\t{\n\t\t\t\t$search_quoted = $this->_db->Quote('%' . $this->_db->escape(substr($search, 7), true) . '%');\n\t\t\t\t$where[] = '(ua.name LIKE ' . $search_quoted . ' OR ua.username LIKE ' . $search_quoted . ')';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$escaped_search = str_replace(' ', '%', $this->_db->escape(trim($search), true));\n\t\t\t\t$search_quoted = $this->_db->Quote('%' . $escaped_search . '%', false);\n\n\t\t\t\t$table = $this->getTable($this->records_jtable, '');\n\t\t\t\t$textwhere = array();\n\t\t\t\t$col_name = str_replace('a.', '', $scope);\n\n\t\t\t\tif ($scope === '-1')\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->search_cols as $search_col)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (property_exists($table, $search_col))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$textwhere[] = 'LOWER(a.' . $search_col . ') LIKE ' . $search_quoted;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($scope === 'a.filename')\n\t\t\t\t{\n\t\t\t\t\t$textwhere[] = ' LOWER(a.filename) LIKE ' . $search_quoted;\n\t\t\t\t\t$textwhere[] = ' LOWER(a.filename_original) LIKE ' . $search_quoted;\n\t\t\t\t}\n\t\t\t\telseif (in_array($col_name, $this->search_cols) && property_exists($table, $col_name))\n\t\t\t\t{\n\t\t\t\t\t// Scope is user input, was filtered as CMD but also use quoteName() on the column\n\t\t\t\t\t$textwhere[] = 'LOWER(' . $this->_db->quoteName($scope) . ') LIKE ' . $search_quoted;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tJFactory::getApplication()->enqueueMessage('Text search scope ' . $scope . ' is unknown, search failed', 'warning');\n\t\t\t\t}\n\n\t\t\t\tif ($textwhere)\n\t\t\t\t{\n\t\t\t\t\t$where[] = '(' . implode(' OR ', $textwhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($q instanceof \\JDatabaseQuery)\n\t\t{\n\t\t\treturn $where ? $q->where($where) : $q;\n\t\t}\n\n\t\treturn $q\n\t\t\t? ' WHERE ' . (count($where) ? implode(' AND ', $where) : ' 1 ')\n\t\t\t: $where;\n\t}", "public function filtering();", "function acf_is_local_enabled()\n{\n}", "function cbf_views_query_alter(&$view, &$query) {\n $filter_vocabulary = null;\n switch ($view->name) {\n case 'cbf2019_local_office':\n $filter_vocabulary = 'office';\n $filter_table = 'field_data_field_office';\n $filter_tid = 'field_office_tid';\n break;\n\n case 'cbf2019_local_events':\n case 'cbf2019_local_activities':\n $filter_vocabulary = 'vocabulary_1';\n $filter_table = 'field_data_taxonomy_vocabulary_1';\n $filter_tid = 'taxonomy_vocabulary_1_tid';\n break;\n\n case 'cbf2019_mappable':\n if ($view->current_display == 'block_4') {\n $filter_vocabulary = 'vocabulary_1';\n $filter_table = 'field_data_taxonomy_vocabulary_1';\n $filter_tid = 'taxonomy_vocabulary_1_tid';\n }\n break;\n }\n\n /*\n * The view is localised if the following conditions hold ...\n *\n * The view can be localised, and this invocation is the loading of the page\n * (refreshes use AJAX), and the $filter_table is not already in the query,\n * and the visitor's $localCity is known.\n */\n if (\n isset($filter_vocabulary)\n && strpos($_SERVER['REQUEST_URI'], '/views/ajax') === false\n && empty($query->get_table_info($filter_table))\n && !empty($localCity = cbf_visitor_city_string())\n ) {\n $city = taxonomy_get_term_by_name($localCity, $filter_vocabulary);\n $join = new views_join;\n $join->construct(\n $filter_table,\n $query->base_table,\n $query->base_field,\n 'entity_id',\n \"({$filter_table}.entity_type = '{$query->base_table}'\"\n . \" AND {$filter_table}.deleted = '0')\",\n 'INNER'\n );\n $query->add_relationship($filter_table, $join, $query->base_table);\n $query->add_where(1, \"{$filter_table}.{$filter_tid}\", reset($city)->tid, '=');\n }\n\n /*\n * The cbf2019_rated_content view supplies a 'More by' block ('block_1') and\n * a 'More on' block ('block_2'). We need to exclude the article on whose\n * page this block is being displayed.\n */\n if ($view->name == 'cbf2019_rated_content'\n && ($view->current_display == 'block_1'\n || $view->current_display == 'block_2')\n && is_numeric($view->args[0])\n && $view->args[0] > 0\n ) {\n $view->query->where[] = [\n 'conditions' => [\n [\n 'field' => 'node.nid',\n 'value' => $view->args[0],\n 'operator' => '!=',\n ],\n ],\n 'args' => [],\n 'type' => 'AND',\n ];\n }\n\n /*\n * The cbf2019_article_topics view definition shows only 'general' topics\n * and this code extends the query to include 'christian' topics when on\n * the 'christian' site. Ditto for cbf2019_speaker_listings.\n *\n * The tag 'add-christian-content' signals this is needed.\n */\n if (stripos($view->tag, 'add-christian-content') !== false) {\n $currentDomainId = domain_get_domain()['domain_id'];\n $christianDomainId = domain_load_domain_id('christian');\n if ($currentDomainId == $christianDomainId) {\n // We are on the 'christian' site so we want to see 'christian' topics\n foreach ($view->query->where as $i => $clause) {\n foreach ($clause['conditions'] as $j => $condition) {\n if (\n stripos($condition['field'], 'taxonomy_vocabulary_3_tid') !== false\n && $condition['operator'] == '='\n && $condition['value'] == '48'\n ) {\n $view->query->where[$i]['conditions'][$j]['operator'] = 'in';\n $view->query->where[$i]['conditions'][$j]['value'] = [ '47', '48' ];\n }\n }\n }\n }\n }\n}", "function acf_disable_local()\n{\n}", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "function _buildContentWherePending()\n\t{\n\t\t$field = $this->getField();\n\n\t\tif (!$field || !$field->item_id)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$upload_context = 'fc_upload_history.item_' . $field->item_id . '_field_' . $field->id;\n\t\t$session_files = JFactory::getSession()->get($upload_context, array());\n\n\t\t$file_ids = isset($session_files['ids_pending'])\n\t\t\t? $session_files['ids_pending']\n\t\t\t: array();\n\n\t\treturn $file_ids\n\t\t\t? ' WHERE a.id IN (' . implode(',', ArrayHelper::toInteger($file_ids)) . ')'\n\t\t\t: false;\n\t}", "public function beforeSave() {\n if ( ! empty($this->filter_id)) {\n $this->content_html = Filter::get($this->filter_id)->apply($this->content);\n }\n else {\n $this->content_html = $this->content;\n }\n return true;\n }", "function acf_allow_unfiltered_html()\n{\n}", "function filter_media( $query ) {\r\n\t\t// admins get to see everything\r\n\t\tif ( ! current_user_can( 'manage_options' ) )\r\n\t\t\t$query['author'] = get_current_user_id();\r\n\t\treturn $query;\r\n\t}", "abstract public function filterFields();", "function ks_acf_template_filter_query($args, $field, $post_id) {\n if ($field['filter_template']) {\n $args['meta_query'] = array(\n array(\n 'key' => '_wp_page_template',\n 'value' => $field['filter_template'],\n 'compare' => 'IN'\n )\n );\n }\n\t\n return $args;\n}", "function get_content_local_field( $id = '1234QWERasdf' ) {\n\treturn array(\n\t\tarray (\n\t\t\t'key' => $id . '_5121z71cd49f1',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'CC',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_N121z71cd48f1',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'content',\n\t\t\t'type' => 'flexible_content',\n\t\t\t'required' => 0,\n\t\t\t'button_label' => 'Add Content',\n\t\t\t'layouts' => array (\n\n\t\t\t\t// Headline\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N121zN1cd48f3',\n\t\t\t\t\t'name' => 'headline',\n\t\t\t\t\t'label' => 'Headline',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_headline_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Editor\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N121z7Ocd48f2',\n\t\t\t\t\t'name' => 'editor',\n\t\t\t\t\t'label' => 'Editor',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_editor_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Button\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N121z7ocd48f1',\n\t\t\t\t\t'name' => 'button-group',\n\t\t\t\t\t'label' => 'Button',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_button_group_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Map\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N121z71md48f1',\n\t\t\t\t\t'name' => 'map',\n\t\t\t\t\t'label' => 'Map',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_map_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Image\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_NImGz71cd48f1',\n\t\t\t\t\t'name' => 'image',\n\t\t\t\t\t'label' => 'Image',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_image_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Video\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N1Viz71cd48f0',\n\t\t\t\t\t'name' => 'oembed',\n\t\t\t\t\t'label' => 'oEmbed Video',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_oembed_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Horizontal line\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N1Viz71cHe8f0',\n\t\t\t\t\t'name' => 'line',\n\t\t\t\t\t'label' => 'Horizontal Line',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_hr_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Accordion\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N121z66cd48f1',\n\t\t\t\t\t'name' => 'accordion',\n\t\t\t\t\t'label' => 'Accordion',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_accordion_local_field( $id )\n\t\t\t\t),\n\n\t\t\t\t// Testimonial\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_Nj2j271cd48f0',\n\t\t\t\t\t'name' => 'testimonials',\n\t\t\t\t\t'label' => 'Testimonials',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_content_testimonial_local_field( $id ),\n\t\t\t\t),\n\n\t\t\t\t// Gravity Form\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_N1F1z71Fd48f1',\n\t\t\t\t\t'name' => 'form',\n\t\t\t\t\t'label' => 'Form',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_gform_local_field( $id ),\n\t\t\t\t),\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5121e71cd49f1',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'CS_Type_tab_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_8121e7Ecd4Ef8',\n\t\t\t'label' => 'Style',\n\t\t\t'name' => 'style',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'choices' => get_available_styles_list( 'placeholder' ),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_8I2ie7Ecd3Rc9',\n\t\t\t'label' => 'Wrapper',\n\t\t\t'name' => 'wrapper',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'card' => 'Card'\n\t\t\t),\n\t\t\t'allow_null' => 0,\n\t\t\t'default_value' => 'auto',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_8I2ie7Ecd4Ef8',\n\t\t\t'label' => 'Borders',\n\t\t\t'name' => 'borders',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'none' => 'None',\n\t\t\t\t'both' => 'Both',\n\t\t\t\t'left' => 'Left',\n\t\t\t\t'right' => 'Light'\n\t\t\t),\n\t\t\t'allow_null' => 0,\n\t\t\t'default_value' => 'none',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5111ee172a422',\n\t\t\t'label' => 'Borders',\n\t\t\t'name' => 'Bows_tab_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_8I2ie7Ecd4Ef8',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'none',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_bIziQ7ecd4Ef8',\n\t\t\t'label' => 'Width',\n\t\t\t'name' => 'border-width',\n\t\t\t'type' => 'number',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_8I2ie7Ecd4Ef8',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'none',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t\t'default_value' => '1',\n\t\t\t'placeholder' => '1',\n\t\t\t'append' => 'px',\n\t\t\t'min' => '1',\n\t\t\t'max' => '10'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_bIziQ7Ecd4EV8',\n\t\t\t'label' => 'Style',\n\t\t\t'name' => 'border-style',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_8I2ie7Ecd4Ef8',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'none'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'solid' => 'Solid',\n\t\t\t\t'dashed' => 'Dashed',\n\t\t\t\t'dotted' => 'Dotted'\n\t\t\t),\n\t\t\t'allow_null' => 0,\n\t\t\t'default_value' => 'solid',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_8I2ie7ECd4Ef8',\n\t\t\t'label' => 'Color',\n\t\t\t'name' => 'border-color',\n\t\t\t'type' => 'rgba_color',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_8I2ie7Ecd4Ef8',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'none'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_8u2ie7ECd4Ef8',\n\t\t\t'label' => 'Size',\n\t\t\t'name' => 'border-size',\n\t\t\t'type' => 'text',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_8I2ie7Ecd4Ef8',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'none'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t\t'placeholder' => '50px or 10%',\n\t\t\t'maxlength' => '5',\n\t\t),\n\t);\n}", "protected function modifyQueryForFilter()\n {\n //the following select includes the mobile number, but overrides\n //the columns with an empty string if the matching boolean is false\n $this->q->getDoctrineQuery()->addSelect(\n 'if(x.is_show_mobile_number_in_phonebook is not FALSE, x.mobile_number, \\'\\') as mobile_number'\n );\n \n if ($this->isLocationView)\n {\n //order results by location name first\n $this->q->addOrderByPrefix('UllLocation->name');\n }\n\n if (!empty($this->phoneSearchFilter))\n {\n $this->q->getDoctrineQuery()->openParenthesisBeforeLastPart();\n \n //we need special handling here because we don't want hidden\n //numbers to be searchable\n $phoneSearchFilterPattern = '%' . $this->phoneSearchFilter . '%';\n \n $this->q->getDoctrineQuery()->orWhere(\n '(is_show_extension_in_phonebook is not FALSE AND phone_extension LIKE ?) ' .\n 'OR (is_show_extension_in_phonebook is FALSE AND alternative_phone_extension LIKE ?)',\n array($phoneSearchFilterPattern, $phoneSearchFilterPattern));\n\n $this->q->orWhere('is_show_mobile_number_in_phonebook is not FALSE ' .\n 'AND mobile_number LIKE ?', $phoneSearchFilterPattern);\n \n $this->q->getDoctrineQuery()->closeParenthesis();\n }\n \n\n if (!empty($this->filter_location_id))\n {\n $this->q->addWhere('ull_location_id = ?', $this->filter_location_id);\n }\n \n //we only want users which are active and have their\n //show-in-phonebook not set to false\n $this->q->addWhere('UllUserStatus->is_active is TRUE and is_show_in_phonebook is not FALSE');\n }", "function aecom_should_filter_query( $query ) {\n if ( ! $query->is_main_query() ) return false;\n if ( $query->is_admin() ) return false;\n return true;\n}", "function maplesyrupweb_content_filter()\n{\n\treturn \"text/html\";\n}" ]
[ "0.5413907", "0.53285265", "0.53066796", "0.529622", "0.5246519", "0.52461183", "0.52271366", "0.5167326", "0.51453376", "0.5138983", "0.5131312", "0.5127111", "0.509333", "0.50844485", "0.50790983", "0.5060999", "0.50547576", "0.504938", "0.50327754", "0.50294", "0.5023459", "0.49782833", "0.4977074", "0.49674353", "0.4952763", "0.49441117", "0.49398348", "0.48664603", "0.4866072", "0.48560515" ]
0.6572747
0
Filter the query on the content_license column
public function filterByContentLicense($contentLicense = null, $comparison = null) { if (null === $comparison) { if (is_array($contentLicense)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $contentLicense)) { $contentLicense = str_replace('*', '%', $contentLicense); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(LpPeer::CONTENT_LICENSE, $contentLicense, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getLicenseQuery()\n {\n return $this->licenseQuery;\n }", "public function fetchExistingLicenses()\n {\n $clientLicense = $this->db->fetchQuery(\n \"SELECT\n TO_CHAR(l.creation_date, 'Dy DD Mon YYYY, HH24:MI') AS creation_date,\n TO_CHAR(l.activation_date, 'Dy DD Mon YYYY, HH24:MI') AS activation_date,\n TO_CHAR(l.expiry_date, 'Dy DD Mon YYYY, HH24:MI') AS expiry_date,\n array_to_json(array_agg(mi.id\n ORDER BY mi.id ASC)) AS modules_installed,\n array_to_json(l.ip_addr) AS ip_addr,\n array_to_json(l.domains) AS domains,\n array_to_json(array_agg(mi.description\n ORDER BY mi.id ASC)) AS modules_names,\n now() BETWEEN activation_date AND expiry_date AS active\n FROM license l\n LEFT JOIN modules_available mi ON mi.id = ANY (l.modules_installed) AND mi.enabled_by_default=0\n WHERE client_id = :clientId\n GROUP BY l.id\n ORDER BY creation_date DESC\n LIMIT 1;\",\n [':clientId' => $_POST['clientId']]\n );\n if ($clientLicense) {\n $clientLicense['modules_installed'] = json_decode($clientLicense['modules_installed'], TRUE);\n $clientLicense['modules_names'] = json_decode($clientLicense['modules_names'], TRUE);\n $clientLicense['ip_addr'] = json_decode($clientLicense['ip_addr'], TRUE);\n $clientLicense['domains'] = json_decode($clientLicense['domains'], TRUE);\n }\n $this->response = [\"license\" => $clientLicense];\n }", "function pp_filter_license_keys( $license_keys, $user_id ) {\n\n\tforeach ( $license_keys as $index => $license_key ) {\n\t\tif ( 'private' === $license_key->post_status ) {\n\t\t\tunset( $license_keys[ $index ] );\n\t\t}\n\t}\n\n\treturn $license_keys;\n\n}", "function DBgetLicense(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT fs.fk_license, cc.LINK_DEED as id, cc.NAME as name\n\t\t FROM \".$this->penelopeTabID.\" AS extab\n\t\t JOIN space ON extab.uuid = space.uuid\n\t\t JOIN file_summary AS fs ON space.source_id = fs.source_id\n\t\t JOIN w_lu_creative_commons AS cc ON fs.fk_license = cc.PK_LICENSE\n\t\t GROUP BY fs.source_id\n\t\t ORDER BY fs.fk_license DESC\n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql); \n\t\t if($result){\n\t\t\t\t$output = $result[0];\n\t\t\t\tif(stristr($output[\"id\"], \"creativecommons\")){\n\t\t\t\t\t $output[\"name\"] = \"Creative Commons \".$output[\"name\"];\n\t\t\t\t}\n\t\t\t\tunset($output[\"fk_license\"]);\n\t\t\t\treturn $output;\n\t\t }\n\t\t else{\n\t\t\t\treturn array(\"id\" => \"http://creativecommons.org/licenses/by/3.0\",\n\t\t\t\t\t\t\t\t \"name\" => \"Creative Commons Attribution\"\n\t\t\t\t\t\t\t\t );\n\t\t }\n\t\t \n\t\t \n\t }", "private function preventLicenseForContent($content) {\n\n //svg last\n $svgLastPos = strrpos(strtolower($content), '</svg>');\n if ($svgLastPos === false) {\n return $content . self::LICENSE_MENTION;\n }\n\n $content = substr($content, 0, $svgLastPos - 1);\n $content .= self::PREVENT_LICENSE;\n $content .= self::LICENSE_MENTION;\n $content .= '</svg>';\n //add the note to buy the pro license\n return $content;\n }", "function thrive_dashboard_get_no_license_products()\n{\n\n $products = array();\n\n $products = apply_filters('thrive_dashboard_no_license_products', $products);\n\n return $products;\n}", "function erp_addon_licenses() {\n $licenses = [];\n\n return apply_filters( 'erp_settings_licenses', $licenses );\n}", "function stockremove_check_license_use()\n {\n $q = $this->db->where('action_type', 'install')\n ->where('license', $this->input->post('license_num'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n\n }", "function check_software_license()\n {\n $q = $this->db->where('license', $this->input->post('license_num'))->where('action_type', 'install')->where('company_id', $this->session->userdata('company_id'))->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "public function addFilterConstraint(ClassMetadata $metadata, $table)\n {\n if ($metadata->getReflectionClass()->name === Article::class) {\n $licenses = $this->getValuesOfArrayParameter('licenses');\n\n return \"{$table}.license_id IN ($licenses)\";\n }\n\n return \"\";\n }", "private function filterByPermission(){\n\n }", "public function showAllProductLicenses()\n {\n $epi_products = $this->getAllEpiProductsData();\n\n if (empty($epi_products)) {\n return;\n }\n\n ob_start();\n\n $plugin_dir_name = '';\n $inactive_epi_plugins = 0;\n // Get all license views\n foreach ($epi_products as $product_data) {\n $plugin_dir_name = end(explode('/', $product_data['baseFolderDir']));\n if ($product_data['isTheme']) {\n if (wp_get_theme()->name != $product_data['pluginName']) {\n $inactive_epi_plugins++;\n continue;\n }\n } else {\n if (! is_plugin_active($plugin_dir_name.'/'.$product_data['mainFileName'])) {\n $inactive_epi_plugins++;\n continue;\n }\n }\n $this->displayProductLicense($product_data);\n }\n\n if ($inactive_epi_plugins === count($epi_products)) {\n ?>\n <tr>\n <td colspan=\"4\">\n <?php _e('No active plugins found', $this->pluginSlug); ?>\n </td>\n </tr>\n <?php\n }\n $content = ob_get_clean();\n\n echo $content;\n }", "public function license()\n {\n return $this->belongsTo('CityBoard\\Entities\\License');\n }", "private function getInstalledLicense()\n {\n $sql = 'SELECT license FROM s_core_licenses WHERE active=1 AND module = \"SwagCommercial\"';\n\n return $this->container->get('dbal_connection')->query($sql)->fetchColumn();\n }", "function get_licensed_requests()\n\t{\n\t\treturn $this->db->get('lic_requests')->result_array();\t\n\t}", "function the_content( $content ) {\r\n\t\tglobal $post;\r\n\r\n\t\t$content_seller = get_post_meta( $post->ID, 'content_seller', true );\r\n\r\n\r\n\t\tif ( ! isset( $content_seller['enabled'] ) || $content_seller['enabled'] != 'yes' ) {\r\n\t\t\treturn $content;\r\n\t\t}\r\n\r\n\t\t$content_seller_products = $content_seller['products'];\r\n\t\t$RestrictionMessage = $content_seller['restriction_message'];\r\n\t\t$restriction_message = $this->restriction_message( $RestrictionMessage );\r\n\t\t$can_access = false;\r\n\t\t$product_sub_ids = array();\r\n\r\n\r\n\t\tif ( is_user_logged_in() ) {\r\n\t\t\tforeach ( $content_seller_products as $id => $content_seller_product ) {\r\n\t\t\t\tif ( $can_access ) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$product_id = $content_seller_product['product'];\r\n\t\t\t\tif ( isset( $content_seller_product['sub_ids'] ) && is_array( $content_seller_product['sub_ids'] ) ) {\r\n\t\t\t\t\tif ( in_array( 'all', $content_seller_product['sub_ids'] ) ) {\r\n\t\t\t\t\t\t$product_sub_ids = tajer_get_product_sub_ids( (int) $content_seller_product['product'] );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$product_sub_ids = $content_seller_product['sub_ids'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach ( $product_sub_ids as $product_sub_id ) {\r\n\r\n\t\t\t\t\tif ( $can_access ) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( tajer_is_free( $product_id, $product_sub_id ) ) {\r\n\t\t\t\t\t\tif ( Tajer_CanAccess( $product_id, $product_sub_id ) ) {\r\n\t\t\t\t\t\t\t$can_access = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$user_id = get_current_user_id();\r\n\t\t\t\t\t\t$item = Tajer_DB::get_row_by_product_id_product_sub_id_user_id( 'tajer_user_products', $product_id, $product_sub_id, $user_id );\r\n\t\t\t\t\t\tif ( is_null( $item ) ) {\r\n\t\t\t\t\t\t\t$can_access = false;\r\n\t\t\t\t\t\t} elseif ( $item->status == 'inactive' ) {\r\n\t\t\t\t\t\t\t$can_access = false;\r\n\t\t\t\t\t\t\t$message = apply_filters( 'tajer_content_seller_meta_box_inactive_message', $this->restriction_message( __( 'Your subscription to access this content is inactive, for more information please contact the website administrator.', 'tajer' ) ), $content, $item );\r\n\t\t\t\t\t\t} elseif ( ( date( 'Y-m-d H:i:s' ) > $item->expiration_date ) ) {\r\n\t\t\t\t\t\t\t//the product has expired, delete the product\r\n\t\t\t\t\t\t\t$is_deleted = Tajer_DB::delete_by_id( 'tajer_user_products', $item->id );\r\n\t\t\t\t\t\t\tif ( $is_deleted === false ) {\r\n\t\t\t\t\t\t\t\t$message = apply_filters( 'tajer_content_seller_meta_box_error_deleting_product', $this->restriction_message( __( 'Error contact website admin!', 'tajer' ) ), $is_deleted, $content, $item );\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$message = apply_filters( 'tajer_content_seller_meta_box_expiration_message', $this->restriction_message( __( 'Your subscription has been expired!', 'tajer' ) ), $is_deleted, $content, $item );\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$can_access = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $restriction_message;\r\n\t\t}\r\n\t\tif ( $can_access ) {\r\n\t\t\treturn $content;\r\n\t\t} else {\r\n\t\t\treturn $restriction_message;\r\n\t\t}\r\n\t}", "static function showLicenses(User $user) {\n global $DB;\n\n\t\t$ID = $user->getField('id');\n\n\t\techo \"<div class='spaced'><table class='tab_cadre_fixehov'>\";\n\t\t$header = \"<tr><th>\".__('Software').\"</th>\";\n\t\t$header .= \"<th>\".__('Licenses').\"</th>\";\n\t\t$header .= \"<th>\".__('Added').\"</th></tr>\";\n\t\techo $header;\n\n $query = \"SELECT\n ul.added,\n sl.name AS licenses_name,\n s.name AS software_name,\n\t\t\t\tsl.id AS licenses_id,\n\t\t\t\ts.id AS software_id\n FROM\n glpi_users_softwarelicenses ul\n JOIN glpi_softwarelicenses sl ON (sl.id = ul.softwarelicenses_id)\n JOIN glpi_softwares s ON (s.id = sl.softwares_id)\n WHERE\n ul.users_id = '$ID'\n ORDER BY\n ul.added DESC\";\n\n $result = $DB->query($query);\n\n if ($DB->numrows($result) > 0) {\n while ($data = $DB->fetch_assoc($result)) {\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td class='center'><a href='software.form.php?id=\".$data['software_id'].\"'>\".$data[\"software_name\"].\"</a></td>\";\n echo \"<td class='center'><a href='softwarelicense.form.php?id=\".$data['licenses_id'].\"'>\".$data[\"licenses_name\"].\"</a></td>\";\n echo \"<td class='center' style='width:20%'>\".$data[\"added\"].\"</td>\";\n echo \"</tr>\";\n }\n } else {\n echo \"<tr class='tab_bg_1'><td class='center' colspan='3'>No results.</td></tr>\";\n }\n\n\t\techo \"</table></div>\";\n\n\t\treturn true;\n }", "public function run()\n\t{\n\t\tDB::table('licenses')->delete();\n\t\t$licenses = array(\n\t\t\t[ 'id' => 1\n\t\t\t, 'acro' => ''\n\t\t\t, 'name' => 'All Rights Reserved'\n\t\t\t, 'url' => ''\n\t\t\t],\n\t\t\t[ 'id' => 2\n\t\t\t, 'acro' => 'CC BY'\n\t\t\t, 'name' => 'Creative Commons Attribution'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 3\n\t\t\t, 'acro' => 'CC BY-SA'\n\t\t\t, 'name' => 'Creative Commons Attribution-ShareAlike'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-sa/4.0'\n\t\t\t],\n\t\t\t[ 'id' => 4\n\t\t\t, 'acro' => 'CC BY-ND'\n\t\t\t, 'name' => 'Creative Commons Attribution-NoDerivs '\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nd/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 5\n\t\t\t, 'acro' => 'CC BY-NC'\n\t\t\t, 'name' => 'Creative Commons Attribution-NonCommercial'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nc/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 6\n\t\t\t, 'acro' => 'CC BY-NC-SA'\n\t\t\t, 'name' => 'Creative Commons Attribution-NonCommercial-ShareAlike'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nc-sa/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 7\n\t\t\t, 'acro' => 'CC BY-NC-ND'\n\t\t\t, 'name' => 'Creative Commons Attribution-NonCommercial-NoDerivs'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nc-nd/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 8\n\t\t\t, 'acro' => 'CC0'\n\t\t\t, 'name' => 'Public Domain'\n\t\t\t, 'url' => 'https://creativecommons.org/publicdomain/zero/1.0/'\n\t\t\t],\n\t\t);\n\t\tDB::table('licenses')->insert($licenses);\n\t}", "function accesrestreint_documents_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('IN','$primary','('.sql_get_select('zzz.id_document','spip_documents_liens as zzz',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','zzz.objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('zzz.id_objet','NOT',$_publique).\"),\r\n\t\t\tarray('AND','zzz.objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t\t),\r\n\t\t\tarray('AND','zzz.objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t))\"\r\n\t.\",'','','','',\\$connect).')')\";\r\n\t/*return \"array('IN','$primary',array('SUBSELECT','id_document','spip_documents_liens',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('id_objet').\"),\r\n\t\t\tarray('AND','objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('id_objet').\")\r\n\t\t),\r\n\t\t\tarray('AND','objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('id_objet').\")\r\n\t))\r\n\t))\";*/\r\n}", "public function testComAdobeGraniteLicenseImplLicenseCheckFilter()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.license.impl.LicenseCheckFilter';\n\n $crawler = $client->request('POST', $path);\n }", "public function remove_license_data() {\r\n\t$license_data = $this->get_license_options();\r\n\tforeach($license_data as $key => $value) {\r\n\t\t//delete_site_option($this->plugin_config['plugin_prefix'].'_'.$key);\r\n\t\t$this->remove_license_option($key);\r\n\t}\r\n}", "function thrive_dashboard_get_licensed_products()\n{\n $products = array();\n\n $products = apply_filters('thrive_dashboard_licensed_products', $products);\n\n return $products;\n}", "function monsterinsights_get_license() {\n\t$license = false;\n\tif ( defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {\n\t\t$license = array( 'key' => MONSTERINSIGHTS_LICENSE_KEY );\n\t} else if ( is_multisite() && monsterinsights_is_network_active() ){\n\t\t$network_license = get_site_option( 'monsterinsights_license' );\n\t\tif ( ! empty( $network_license['key'] ) && is_string( $network_license['key'] ) && strlen( $network_license['key'] ) > 10 ) {\n\t\t\t$license = $network_license;\n\t\t} else {\n\t\t\t$site_license = get_option( 'monsterinsights_license' );\n\t\t\tif ( ! empty( $site_license['key'] ) && is_string( $site_license['key'] ) && strlen( $site_license['key'] ) > 10 ) {\n\t\t\t\t$license = $site_license;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$site_license = get_option( 'monsterinsights_license' );\n\t\tif ( ! empty( $site_license['key'] ) && is_string( $site_license['key'] ) && strlen( $site_license['key'] ) > 10 ) {\n\t\t\t$license = $site_license;\n\t\t}\n\t}\n\n\treturn apply_filters( 'monsterinsights_license', $license );\n}", "private static function _get_post_licenses() {\n return array(\n \"all-rights-reserved\" => __(\"All rights reserved\", MEDIUM_TEXTDOMAIN),\n \"cc-40-by\" => __(\"CC 4.0 BY\", MEDIUM_TEXTDOMAIN),\n \"cc-40-by-nd\" => __(\"CC 4.0 BY-ND\", MEDIUM_TEXTDOMAIN),\n \"cc-40-by-sa\" => __(\"CC 4.0 BY-SA\", MEDIUM_TEXTDOMAIN),\n \"cc-40-by-nc\" => __(\"CC 4.0 BY-NC\", MEDIUM_TEXTDOMAIN),\n \"cc-40-by-nc-nd\" => __(\"CC 4.0 BY-NC-ND\", MEDIUM_TEXTDOMAIN),\n \"cc-40-by-nc-sa\" => __(\"CC 4.0 BY-NC-SA\", MEDIUM_TEXTDOMAIN),\n \"cc-40-zero\" => __(\"CC Copyright waiver\", MEDIUM_TEXTDOMAIN),\n \"public-domain\" => __(\"Public domain\", MEDIUM_TEXTDOMAIN)\n );\n }", "function accesrestreint_breves_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',\".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function edd_mpce_check_license($license) {\n global $motopressCESettings;\n $result = array(\n 'errors' => array(),\n 'data' => array()\n );\n $apiParams = array(\n 'edd_action' => 'check_license',\n 'license' => $license,\n 'item_name' => urlencode($motopressCESettings['edd_mpce_item_name'])\n );\n\n // Call the custom API.\n $response = wp_remote_get(add_query_arg($apiParams, $motopressCESettings['edd_mpce_store_url']), array('timeout' => 15, 'sslverify' => false));\n \n if (is_wp_error($response)) {\n $errors = $response->get_error_codes();\n foreach ($errors as $key => $code) {\n $result['errors'][$code] = $response->get_error_message($code);\n }\n return $result;\n }\n\n $licenseData = json_decode(wp_remote_retrieve_body($response));\n\n if (!is_null($licenseData)) {\n $result['data'] = $licenseData;\n } else {\n $result['errors']['json_decode'] = 'Unable to decode JSON string.';\n }\n\n return $result;\n}", "function get_licensed_surveys()\n\t{\n\t\t$this->db->select('*');\t\t\n\t\t$this->db->from('lic_requests');\t\t\n\n\t\t$result = $this->db->get()->result_array();\n\t\treturn $result;\n\t}", "function stockremove_check_license_already_removed()\n {\n $q = $this->db->where('action_type', 'stock remove')\n ->where('license', $this->input->post('license_num'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n\n }", "public function getWhereClauseForEnabledFieldsCallsSysPageForDeletedFlagInFrontend() {}", "public function ascLicensesData(ASCLicensesRequest $request)\n {\n if ($request->ajax()) {\n $ascLicenses = ASCLicense::orderBy('id','DESC');\n if($request->filter['search']){\n $ascLicenses = $ascLicenses->search($request->filter['search']);\n }\n if($request->filter['filter']){\n $ascLicenses = $ascLicenses->filter($request->filter['filter']);\n }\n $ascLicenses = $ascLicenses->paginate($request->filter['length']);\n $licenseType = array(\n 1 => 'Licensed',\n 2 => 'Certified General',\n 3 => 'Certified Residential',\n 4 => 'Transitional License',\n );\n\n return view('admin::management.asc-licenses.partials._data',compact('ascLicenses','licenseType'));\n }\n }" ]
[ "0.60297257", "0.578028", "0.5646229", "0.56329876", "0.5330672", "0.5291036", "0.5240358", "0.51781154", "0.5156316", "0.51463723", "0.5060228", "0.5038508", "0.5036035", "0.5023156", "0.5005116", "0.49709767", "0.49413687", "0.49368182", "0.48996302", "0.48987734", "0.48954788", "0.4873523", "0.48404118", "0.48301178", "0.48083165", "0.4793459", "0.47878638", "0.47801498", "0.4775722", "0.4767715" ]
0.58425075
1
Filter the query on the js_lib column
public function filterByJsLib($jsLib = null, $comparison = null) { if (null === $comparison) { if (is_array($jsLib)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $jsLib)) { $jsLib = str_replace('*', '%', $jsLib); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(LpPeer::JS_LIB, $jsLib, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _report_js_keyToFilter()\n\t{\n\t\t$filter_js = View::factory('actionable_filter_key_to_filter_js');\n\t\t$filter_js->render(TRUE);\n\t}", "private static function _getFilter() {}", "public function _report_js_filterReportsAction()\n\t{\n\t\t$filter_js = View::factory('actionable_filter_js');\n\t\t$filter_js->render(TRUE);\n\t}", "abstract function get_sql_filter($data);", "function crypton_blog_cryptocurrency_prepare_js($js='', $remove_spaces=true) {\n\t\treturn apply_filters( 'cryptocurrency_filter_prepare_js', $js, $remove_spaces );\n\t}", "function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once($conf['gate_dir'].'model/m_unit.php');\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"u.infoleft >= \".(int)$row['infoleft'].\" and u.inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'jenis':\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\treturn \"jnsrate='$key'\";\n\t\t\t}\n\t\t}", "protected function addFilteringJsAndCss()\n {\n $this->setStylesheets('');\n $this->setJavascripts('');\n }", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND text LIKE '%\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"engine\"]))\t\t$sql .= \" AND engine=\".intval($SF[\"engine\"]).\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}", "function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'thnkurikulum': return \"p.thnkurikulum = '$key'\";\n\t\t\t\tcase 'unit': return \"p.kodeunit = '$key'\";\n\t\t\t\tcase 'matkul': return \"p.kodemk1 = '$key'\";\n\t\t\t\tcase 'matkul': return \"p.kodemk2 = '$key'\";\n\t\t\t\t\n\t\t\t}\n\t\t}", "function getFilter()\r\n\t{\r\n\t\tglobal $mainframe;\r\n\t\t$tableModel \t=& $this->_table;\r\n\t\t$formModel\t\t=& $tableModel->getForm();\r\n\t\t$elName2 \t\t= $this->getFullName( false, false, false );\r\n\t\tif (!$formModel->hasElement( $elName2 )) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\t$db =& JFactory::getDBO();\r\n\t\t$groupModel\t\t=& $this->_group;\r\n\t\t$table\t\t\t\t=& $tableModel->getTable();\r\n\t\t$element\t\t\t=& $this->getElement();\r\n\t\t$origTable \t\t= $table->db_table_name;\r\n\t\t$fabrikDb \t\t=& $tableModel->getDb();\r\n\t\t$params\t\t\t=& $this->getParams( );\r\n\r\n\t\t$js \t\t\t\t\t= \"\";\r\n\t\t$elName \t\t= $this->getFullName( false, true, false );\r\n\t\t$dbElName\t\t= $this->getFullName( false, false, false );\r\n\r\n\t\t$ids \t\t\t\t= $tableModel->getColumnData( $elName2 );\r\n\t\t//for ids that are text with apostrophes in\r\n\t\tfor ($x=0;$x<count( $ids );$x++) {\r\n\t\t\t$ids[$x] = addSlashes( $ids[$x] );\r\n\t\t}\r\n\t\t$elLabel\t\t\t\t= $element->label;\r\n\t\t$elExactMatch \t= $element->filter_exact_match;\r\n\t\t$v \t\t\t\t= $elName . \"[value]\";\r\n\t\t$t \t\t\t\t= $elName . \"[type]\";\r\n\t\t$e \t\t\t\t= $elName . \"[match]\";\r\n\t\t$jt \t\t\t= $elName . \"[join_db_name]\";\r\n\t\t$jk \t\t\t= $elName . \"[join_key_column]\";\r\n\t\t$jv \t\t\t= $elName . \"[join_val_column]\";\r\n\t\t$origDate \t\t= $elName . \"[filterVal]\";\r\n\t\t$fullword \t\t= $elName . \"[full_words_only]\";\r\n\t\t//corect default got\r\n\t\t$default = $this->getDefaultFilterVal();\r\n\r\n\t\t$aThisFilter = array();\r\n\r\n\t\t//filter the drop downs lists if the table_view_own_details option is on\r\n\t\t//other wise the lists contain data the user should not be able to see\r\n\t\t// note, this should now use the prefilter data to filter the list\r\n\r\n\t\t/* check if the elements group id is on of the table join groups if it is then we swap over the table name*/\r\n\t\t$fromTable = $origTable;\r\n\t\t$joinStr = $tableModel->_buildQueryJoin();\r\n\r\n\t\tforeach ($tableModel->_aJoins as $aJoin) {\r\n\t\t\t/** not sure why the group id key wasnt found - but put here to remove error **/\r\n\t\t\tif (array_key_exists( 'group_id', $aJoin )) {\r\n\t\t\t\t\t\r\n\t\t\t\tif ($aJoin->group_id == $element->group_id && $aJoin->element_id == 0) {\r\n\t\t\t\t\t$fromTable = $aJoin->table_join;\r\n\t\t\t\t\t$elName = str_replace( $origTable . '.', $fromTable . '.', $elName);\r\n\t\t\t\t\t$v = $fromTable . '___' . $element->name . \"[value]\";\r\n\t\t\t\t\t$t = $fromTable . '___' . $element->name . \"[type]\";\r\n\t\t\t\t\t$e = $fromTable . '___' . $element->name . \"[match]\";\r\n\t\t\t\t\t$fullword = $elName . \"[full_words_only]\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* elname should be in format table.key add quotes:*/\r\n\t\t$dbElName = explode( \".\", $dbElName );\r\n\t\t$dbElName = \"`\" . $dbElName[0] . \"`.`\" . $dbElName[1] . \"`\";\r\n\r\n\t\t$tabletype = $params->get( 'my_table_data', 'username' );\r\n\r\n\t\t$sql = \"SELECT DISTINCT( $tabletype ) AS elText, id AS elVal FROM #__users \\n\";\r\n\t\t$sql .= \"WHERE id IN ('\" . implode( \"','\", $ids ) . \"')\"\r\n\t\t. \"\\n GROUP BY elText ASC\";\r\n\r\n\r\n\t\t$context = \"com_fabrik.table\" . $tableModel->_id . \".filter.\" . trim($elName);\r\n\t\t$default = $mainframe->getUserStateFromRequest( $context, trim($elName), $default );\r\n\r\n\r\n\t\tswitch ( $element->filter_type )\r\n\t\t{\r\n\t\t\tcase \"range\":\r\n\t\t\t\t$db->setQuery( $sql );\r\n\t\t\t\t$oDistinctData = $db->loadObjectList( );\r\n\t\t\t\t$aThisFilter[] = JHTML::_('select.option', '', JText::_( 'PLEASE SELECT' ) );\r\n\t\t\t\tif (is_array( $oDistinctData )) {\r\n\t\t\t\t\t$aThisFilter = array_merge( $aThisFilter, $oDistinctData );\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$attribs = 'class=\"inputbox fabrik_filter\" size=\"1\" ';\r\n\t\t\t\t$default1 = (is_array($default)) ? $default['value'][0] : '';\r\n\t\t\t\t$return \t = JHTML::_('select.genericlist', $aThisFilter , $v.'[]', $attribs, \"elVal\", 'elText', $default1, $element->name . \"_filter_range_0\" );\r\n\t\t\t\t$default1 = (is_array($default)) ? $default['value'][1] : '';\r\n\t\t\t\t$return \t .= JHTML::_('select.genericlist', $aThisFilter , $v.'[]', $attribs, \"elVal\", 'elText', $default1 , $element->name . \"_filter_range_1\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"dropdown\":\r\n\t\t\t\t$db->setQuery( $sql );\r\n\t\t\t\t$oDistinctData = $db->loadObjectList();\r\n\t\t\t\t$aThisFilter[] = JHTML::_('select.option', '', JText::_( 'PLEASE SELECT' ) );\r\n\t\t\t\tif (is_array( $oDistinctData )) {\r\n\t\t\t\t\t$aThisFilter = array_merge( $aThisFilter, $oDistinctData );\r\n\t\t\t\t}\r\n\t\t\t\t$return \t = JHTML::_('select.genericlist', $aThisFilter , $v, 'class=\"inputbox fabrik_filter\" size=\"1\" ' , \"elVal\", 'elText', $default );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"field\":\r\n\r\n\t\t\t\t$default = ( is_array( $default ) && array_key_exists( 'value', $default) ) ? $default['value'] : '';\r\n\t\t\t\tif (get_magic_quotes_gpc()) {\r\n\t\t\t\t\t$default\t\t\t= stripslashes( $default );\r\n\t\t\t\t}\r\n\t\t\t\t$default = htmlspecialchars( $default );\r\n\t\t\t\t$return = \"<input type='text' name='$v' class=\\\"inputbox fabrik_filter\\\" value=\\\"$default\\\" $jsfilter />\";\r\n\t\t\t\tbreak;\r\n\t\t\t\t//moved to table options\r\n\t\t\t\t/*case \"search\":\r\n\t\t\t\t */\r\n\t\t}\r\n\t\t$return .= \"\\n<input type='hidden' name='$t' value='$element->filter_type' />\\n\";\r\n\t\t$return .= \"\\n<input type='hidden' name='$e' value='$elExactMatch' />\\n\";\r\n\t\t$return .= \"\\n<input type='hidden' name='$fullword' value='\" . $params->get('full_words_only', '0') . \"' />\\n\";\r\n\t\treturn $return;\r\n\t}", "public function filtering();", "abstract protected function filterFieldvalue();", "function getFilterFormJs() {\r\n $sFilterFormJs = null;\r\n if ($this->aFields['is_filtered'] === true) {\r\n $sFormsPath = $this->aProperties['ws_data_dir'] . '/vmap/layer/' . $this->aFields['layer_id'] . '/forms/ressources';\r\n if (file_exists($sFormsPath . '/published.js')) {\r\n $sFilterFormJs = file_get_contents($sFormsPath . '/published.js');\r\n }\r\n }\r\n return $sFilterFormJs;\r\n }", "public function js();", "public function filtering(): string;", "public function _report_js_filterReportsActionRemove()\n\t{\n\t\t$filter_js = View::factory('actionable_filter_remove_js');\n\t\t$filter_js->render(TRUE);\n\t}", "function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': return \"periode = '$key'\";\n\t\t\t\tcase 'sistemkuliah': return \"sistemkuliah = '$key'\";\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('unit'));\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"u.infoleft >= \".(int)$row['infoleft'].\" and u.inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'basiskampus':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('sistemkuliah'));\n\t\t\t\t\t$sistem = mSistemkuliah::getIdByBasisKampus($conn,modul::getBasis(),modul::getKampus());\n\t\t\t\t\treturn \" sistemkuliah in ('\".implode(\"','\",$sistem).\"') \";\n\t\t\t\t\t\n\t\t\t}\n\t\t}", "function filterQuery($query){\n $query=htmlspecialchars(stripslashes($query));\n $query=str_ireplace(\"script\", \"blocked\", $query);\n $query=mysql_escape_string($query);\n\n return $query;\n}", "protected function user_where_clause() {}", "abstract protected function filterField(): string;", "public function filter();", "public function returnFieldJS() {}", "function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'p.kodeunit': return \"p.kodeunit = '$key'\";\n\t\t\t\tcase 'periode': return \"periode = '$key'\";\n\t\t\t\tcase 'jalurpenerimaan': return \"jalurpenerimaan = '$key'\";\n\t\t\t\tcase 'jenistagihan': return \"jenistagihan = '$key'\";\n\t\t\t\tcase 'isedit': return \"isedit = '$key'\";\n\t\t\t\tcase 'sistemkuliah': return \"p.sistemkuliah = '$key'\";\n\t\t\t\tcase 'flaglunas': \n\t\t\t\t$key = implode(\"','\", $key);\n\t\t\t\treturn \"flaglunas in ('$key')\";\n\t\t\t\tcase 'unitdesc':\n\t\t\t\t\tglobal $conn;\n\t\t\t\t\t$sql = \"select infoleft,inforight from gate.ms_unit where kodeunit = '$key'\";\n\t\t\t\t\t$row = $conn->GetRow($sql);\n\t\t\t\t\treturn \"infoleft >= \".(int)$row['infoleft'].\" and inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'basiskampus':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('sistemkuliah'));\n\t\t\t\t\t$sistem = mSistemkuliah::getIdByBasisKampus($conn,modul::getBasis(),modul::getKampus());\n\t\t\t\t\treturn \" p.sistemkuliah in ('\".implode(\"','\",$sistem).\"') \";\n\t\t\t\t\t\n\t\t\t}\n\t\t}", "public function filter($value)\n {\n return JSMin::minify($value);\n }", "public function quoteJsValueDataProvider() {}", "protected function filter_row(&$row) {}", "function getArrayListFilterCol() {\n\t\t\t$data['kodeunit'] = 'u.kodeunit';\n\t\t\t\n\t\t\treturn $data;\n\t\t}", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif ($SF[\"id_min\"]) \t\t\t\t$sql .= \" AND id >= \".intval($SF[\"id_min\"]).\" \\r\\n\";\n\t\tif ($SF[\"id_max\"])\t\t\t \t$sql .= \" AND id <= \".intval($SF[\"id_max\"]).\" \\r\\n\";\n\t\tif ($SF[\"date_min\"]) \t\t\t$sql .= \" AND add_date >= \".strtotime($SF[\"date_min\"]).\" \\r\\n\";\n\t\tif ($SF[\"date_max\"])\t\t\t$sql .= \" AND add_date <= \".strtotime($SF[\"date_max\"]).\" \\r\\n\";\n\t\tif ($SF[\"user_id\"])\t\t\t \t$sql .= \" AND user_id = \".intval($SF[\"user_id\"]).\" \\r\\n\";\n\t\tif ($SF[\"cat_id\"])\t\t\t \t$sql .= \" AND cat_id = \".intval($SF[\"cat_id\"]).\" \\r\\n\";\n\t\tif (strlen($SF[\"title\"]))\t\t$sql .= \" AND title LIKE '\"._es($SF[\"title\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"summary\"]))\t\t$sql .= \" AND summary LIKE '\"._es($SF[\"summary\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND full_text LIKE '\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (!empty($SF[\"status\"]) && isset($this->_articles_statuses[$SF[\"status\"]])) {\n\t\t \t$sql .= \" AND status = '\"._es($SF[\"status\"]).\"' \\r\\n\";\n\t\t}\n\t\tif (strlen($SF[\"nick\"]) || strlen($SF[\"account_type\"])) {\n\t\t\tif (strlen($SF[\"nick\"])) \t$users_sql .= \" AND nick LIKE '\"._es($SF[\"nick\"]).\"%' \\r\\n\";\n\t\t\tif ($SF[\"account_type\"])\t$users_sql .= \" AND `group` = \".intval($SF[\"account_type\"]).\" \\r\\n\";\n\t\t}\n\t\t// Add subquery to users table\n\t\tif (!empty($users_sql)) {\n\t\t\t$sql .= \" AND user_id IN( SELECT id FROM \".db('user').\" WHERE 1=1 \".$users_sql.\") \\r\\n\";\n\t\t}\n\t\t// Sorting here\n\t\tif ($SF[\"sort_by\"])\t\t\t \t$sql .= \" ORDER BY \".$this->_sort_by[$SF[\"sort_by\"]].\" \\r\\n\";\n\t\tif ($SF[\"sort_by\"] && strlen($SF[\"sort_order\"])) \t$sql .= \" \".$SF[\"sort_order\"].\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}", "public function getCompressJavascript() {}", "function SqlKeyFilter() {\n\t\treturn \"`gjd_id` = @gjd_id@\";\n\t}" ]
[ "0.5750305", "0.5576338", "0.5508217", "0.5405303", "0.5403208", "0.529165", "0.5188909", "0.5185265", "0.5175323", "0.5165152", "0.51582867", "0.51572585", "0.5147204", "0.5141559", "0.51065624", "0.5073455", "0.505577", "0.5049908", "0.5005489", "0.49950433", "0.49917212", "0.49871895", "0.49818093", "0.4973511", "0.49395514", "0.49371365", "0.4923568", "0.49235365", "0.490299", "0.48997927" ]
0.5984717
0
Filter the query on the preview_image column
public function filterByPreviewImage($previewImage = null, $comparison = null) { if (null === $comparison) { if (is_array($previewImage)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $previewImage)) { $previewImage = str_replace('*', '%', $previewImage); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(LpPeer::PREVIEW_IMAGE, $previewImage, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _wp_preview_post_thumbnail_filter($value, $post_id, $meta_key)\n {\n }", "public function preview(ColumnBuilder $preview): void\n {\n $preview->col('<img src=\"{image.conversion_urls.thumb}\">');\n }", "public function getPreviewAttribute ()\n {\n if($this->is_preview) {\n return $this->image;\n }\n }", "public function _preview_filter($original)\n {\n }", "public function preview(){\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n // @todo Preview should only be visible to the user who uploaded (if user exists) and should only be saved by user who uploaded\n // @todo We can achieve this with form verification id's (which we should have anyway)\n if($pobj !== false && $pobj->temporary) $pobj->show('preview');\n else $this->zajlib->reroute('__error', ['system_api_photo_preview', []]);\n\t\t}", "function stream_preview_image($post_id)\n {\n }", "public function queryImage($query){\n\t\t\treturn $this->query('Image',$query);\n\t\t}", "public function testItReturnsUsersFilteredWithImage()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n \"image\" => \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQi1SYU1kgu3FtGlMpm5W7K2zuZHLgBQZzf34TQ3_Qe8LUd8s5C\",\n ]);\n $tenant2 = factory(Tenant::class)->create();\n factory(User::class)->create([\n \"tenant_id\" => $tenant2,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users?filter[has_image]=true\")\n ->assertOk()\n ->assertJson([\n \"data\" => [\n [\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n \"image\" => $user1->image,\n ],\n ],\n ]);\n }", "public function is_preview()\n {\n }", "public function is_preview()\n {\n }", "public function is_preview()\n {\n }", "function bethel_remove_filter_from_gallery_images ($edit) {\n remove_filter ('wp_get_attachment_image_attributes', 'bethel_filter_image_attributes_for_gallery', 10, 2);\n remove_filter ('wp_get_attachment_link', 'bethel_filter_attachment_link_for_gallery', 10, 6);\n return $edit;\n}", "public function guestFilter(Request $request)\n {\n if($request->query('q')){\n $images = Image::where('caption','LIKE','%'.$request->query('q').'%')->paginate(6);\n }\n\n elseif ($request->query('category') && $request->query('category') != \"All\"){\n $images = Image::where('category','LIKE','%'.$request->query('category').'%')->paginate(6);\n }\n\n elseif (!$request->query('q') || ($request->query('category') && $request->query('category') == \"All\")){\n $images = Image::latest()->paginate(6);\n }\n\n return $images;\n }", "public function getPreview();", "public function set_preview()\n\t{\n\t\tif (!$this->is_type(ext::TITANIA_SCREENSHOT))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$this->is_preview())\n\t\t{\n\t\t\t$sql = 'UPDATE ' . $this->attachments_table . '\n\t\t\t\tSET is_preview = 0\n\t\t\t\tWHERE object_type = ' . (int) $this->get('object_type') . '\n\t\t\t\t\tAND object_id = ' . (int) $this->get('object_id');\n\t\t\t$this->db->sql_query($sql);\n\n\t\t\t$sql = 'UPDATE ' . $this->attachments_table . '\n\t\t\t\tSET is_preview = 1\n\t\t\t\tWHERE attachment_id = ' . (int) $this->get_id();\n\t\t\t$this->db->sql_query($sql);\n\t\t\t$this->set('is_preview', 1);\n\t\t}\n\t\treturn true;\n\t}", "public function indexAction()\n {\n $paginator = $this->get('knp_paginator');\n $request = $this->getRequest();\n $session = $request->getSession();\n $qb = $this->getDoctrine()->getManager()\n ->getRepository('BlogBundle:Image')->getQueryBuilderForFilter();\n $query = $qb->getQuery();\n $filterForm = $this->createForm(new ImageFilterType(), new ImageFilterModel($request));\n $formHandler = new ImageFilterHandler($filterForm, $request, $qb);\n\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'reset') {\n $session->remove('ImageControllerFilter');\n }\n\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'filter') {\n if ($formHandler->process()) {\n $query = $formHandler->getQuery();\n $session->set('ImageControllerFilter', $request);\n }\n }\n\n if ($request->getMethod() == 'GET') {\n if ($session->has('ImageControllerFilter')) {\n $filterForm = $this->createForm(\n new ImageFilterType(),\n new ImageFilterModel($session->get('ImageControllerFilter'))\n );\n $formHandler = new ImageFilterHandler($filterForm, $session->get('ImageControllerFilter'), $qb);\n if ($formHandler->process()) {\n $query = $formHandler->getQuery();\n }\n }\n }\n $filterForm = $formHandler->getFilter();\n\n $pagination = $paginator->paginate(\n $query,\n $request->get('page', 1),\n 12\n );\n\n return array(\n 'upload_url' => $this->container->getParameter('blog.upload_url'),\n 'pagination' => $pagination,\n 'filterForm' => $filterForm->createView(),\n );\n }", "public function getPreviewImageUrl()\n {\n return $this->previewImageUrl;\n }", "public function imgPrincipal($table, $filters) {\n\n global $mdb2;\n $sql = \"UPDATE $table SET featured = '0' WHERE items_id = \".$filters['idProduto'];\n\n $res = $mdb2->query($sql);\n if (@$res->result != 1) {\n $arq = fopen(\"../logs/query-remove-errors.txt\", 'a+');\n fwrite($arq, $sql . \" - \" . @date('d/m/Y h:i:s') . '\n ');\n die('Error not removed data - See log file');\n } else {\n\n $sql = \"UPDATE $table SET featured = '1' WHERE id = \".$filters['id'];\n $res = $mdb2->query($sql);\n\n if (@$res->result != 1) {\n $arq = fopen(\"../logs/query-remove-errors.txt\", 'a+');\n fwrite($arq, $sql . \" - \" . @date('d/m/Y h:i:s') . '\n ');\n die('Error not removed data - See log file');\n } else {\n return true;\n }\n }\n }", "function filter_media( $query ) {\r\n\t\t// admins get to see everything\r\n\t\tif ( ! current_user_can( 'manage_options' ) )\r\n\t\t\t$query['author'] = get_current_user_id();\r\n\t\treturn $query;\r\n\t}", "function thumb_columns_content($column_name, $post_ID) {\n global $wpdb;\n if ($column_name == 'featured_image') \n {\n $post_featured_image = thumb_get_featured_image($post_ID);\n if ($post_featured_image) \n {\n echo '<img style=\"max-width:70px; float:left; margin-right:5px;\" src=\"' . $post_featured_image . '\" />'; \n }\n }\n}", "function _needPreview ($imageToolkit) {\n if ($this->getSize() < MIN_SIZE_FOR_PREVIEW * 1024) {\n return false;\n }\n\n // Si image de départ plus petite, on ne redimentione pas la photo\n if ($imageToolkit->destBiggerThanFrom()) {\n return false;\n }\n\n return true;\n }", "public function emptyQuery()\n {\n return Image::query();\n }", "function image_viewing()\n {\n $query = \"UPDATE\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tSET\n\t\t\t\t\tImage_Path = :path,\n\t\t\t\t\tCaption = :cap,\n\t\t\t\t\tDescription = :des,\n\t\t\t\t\tStatus = :status\n\t\t\t\tWHERE\n\t\t\t\t\tid = :id AND Viewer_ID = :vid\";\n\n $stmt = $this->conn->prepare($query);\n\t\t\n $stmt->bindParam(':path', $this->Image_Path);\n\t\t$stmt->bindParam(':cap', $this->Caption);\n $stmt->bindParam(':des', $this->Description);\n\t\t$stmt->bindParam(':status', $this->status);\n $stmt->bindParam(':id', $this->id);\n\t\t$stmt->bindParam(':vid', $this->Viewer_ID);\n\n // execute the query\n if ($stmt->execute()) {\n return true;\n } else {\n return false;\n }\n }", "public function getFilterImage($identifier)\n {\n $filterId = Yii::$app->storage->getFilterId($identifier);\n return $this->hasOne(self::class, ['file_id' => 'file_id'])->andWhere(['filter_id' => $filterId]);\n }", "public function scopeImagenes($query){\n return Imagen::where('tabla_referencia',$this->table)\n ->where('id_referencia',$this->id);\n }", "function goods_viewImgProduct(){\n $sql = \"select * from gd_image where get_imgid=:get_imgid order by gd_imgid ASC\";\n $args = [':get_imgid'=>$this->id];\n return $this->run($sql, $args);\n }", "public function authFilter(Request $request)\n {\n $user_id = Auth::user()->id;\n\n if($request->query('q')){\n $images = Image::where('user_id',$user_id )\n ->where('caption','LIKE','%'.$request->query('q').'%')\n ->paginate(6);\n }\n\n elseif ($request->query('category') && $request->query('category') != \"All\"){\n $images = Image::where('user_id',$user_id )\n ->where('category','LIKE','%'.$request->query('category').'%')\n ->paginate(6);\n }\n elseif(!$request->query('q') || ($request->query('category') && $request->query('category') == \"All\") ) {\n $images = Image::where('user_id', Auth::user()->id)->paginate(6);\n }\n\n return $images;\n }", "public function getPreviewImageUrl()\n {\n return isset($this->preview_image_url) ? $this->preview_image_url : null;\n }", "public function preview() {\n\t\t$image = $this->getImage();\n\n\t\tif(!$image->send()) {\n\t\t\t$this->handleError($image);\n\t\t}\n\n\t\tdie();\n\t}", "function DNUI_checkImageDB($ImageName, $postId,$without=false) {\r\n global $wpdb;\r\n //FIND in the post parent the reference, this will useful if the image is used at the same time\r\n $sql = \"SELECT id FROM \" . $wpdb->prefix . \"posts WHERE post_parent in (SELECT post_parent FROM \" . $wpdb->prefix . \"posts WHERE id=\" . $postId . \" ) and post_content LIKE '%/$ImageName%'\";\r\n $wpdb->get_results($sql, \"ARRAY_A\");\r\n $result = $wpdb->get_results($sql, \"ARRAY_A\");\r\n if (!empty($result)) {\r\n return $result;\r\n }else if($without){\r\n $sql = \"SELECT id FROM \" . $wpdb->prefix . \"posts WHERE post_content is not null and post_content!='' and post_type not in ('attachment','nav_menu_item','revision') and post_status !='draft' and post_content LIKE '%/$ImageName%' limit 0,1\";\r\n }else{\r\n $sql = \"SELECT id FROM \" . $wpdb->prefix . \"posts WHERE post_content is not null and post_content!='' and post_type not in ('attachment','nav_menu_item') and post_content LIKE '%/$ImageName%' limit 0,1\";\r\n }\r\n \r\n return $wpdb->get_results($sql, \"ARRAY_A\");\r\n \r\n}" ]
[ "0.65244627", "0.612488", "0.59435546", "0.58212525", "0.5692374", "0.5688903", "0.5663102", "0.5442829", "0.54250485", "0.54250485", "0.5424803", "0.5405944", "0.5400262", "0.53866637", "0.5383583", "0.536226", "0.5361153", "0.53517383", "0.5337146", "0.5322899", "0.5296778", "0.5292641", "0.5284165", "0.52729154", "0.5270375", "0.5257769", "0.52566177", "0.5256316", "0.5252155", "0.518935" ]
0.6452623
1
Specifies the access control rules. This method is used by the 'accessControl' filter.
public function accessRules() { return array( array('allow', 'actions'=>array('login','error','logout'), 'users'=>array('*'), ), array('allow', // allow authenticated user to perform 'create' and 'update' actions 'actions'=>array('index','delivery','settings'), 'users'=>array('@'), 'expression'=>'AdmAccess::model()->accessAdmin()' ), array('deny', // deny all users 'users'=>array('*'), ), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admins only\n\t\t\t\t'users'=>Yii::app()->getModule('user')->getAdmins(),\n\t\t\t),\n\t\t\tarray('allow',\n\t\t\t\t\t\t/*'users' => array(\"?\"),*/\n 'expression' => array($this,'isLogedInOrHasKey'),\n ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n\t\t\t\t'actions'=>array('create','update','index','delete', 'setIsShow', 'setIsAvailable', 'setIsNew'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('allotMore','allotOne'),\n\t\t\t\t'expression'=>array('PlaneAllotController','allowReadWrite'),\n\t\t\t),\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('index'),\n\t\t\t\t'expression'=>array('PlaneAllotController','allowReadOnly'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('list','show','captcha','PostedInMonth','PostedOnDate', 'search'),\n 'users'=>array('*'),\n ),\n array('allow',\n 'actions'=>array('ajaxBookmark','create'),\n 'users'=>array('@'),\n ),\n array('allow',\n 'expression'=>'Yii::app()->user->status=='.User::STATUS_ADMIN.\n '||Yii::app()->user->status=='.User::STATUS_WRITER,\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('index','delete','create', 'update','view'),\n 'expression'=>'($user->rule===\"admin\")'\n ),\n\t\t\tarray('deny',\n 'users'=>array('*'),\n ),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('index','delete','create', 'update','view'),\n 'expression'=>'($user->rule===\"admin\")'\n ),\n\t\t\tarray('deny',\n 'users'=>array('*'),\n ),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array(\n 'allow',\n 'actions' => array('index', 'archive', 'view', 'read', 'userListResults'),\n 'users' => array('@')\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('create','admin', 'update'),\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array(\n 'deny', // deny all users\n 'users' => array('*')\n )\n );\n }", "public function accessRules() {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'update' and 'dynamicUpdate' actions\n\t\t\t\t'actions'=>array('update', 'dynamicUpdate'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'delete' actions\n\t\t\t\t'actions'=>array('create','delete'),\n\t\t\t\t'expression'=>'Yii::app()->user->isManager()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n Yii::app()->user->loginUrl = array(\"/cruge/ui/login\");\n\t\treturn array(\n\t\t\t\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('ajaxCopia','editaTemp','index','view','admin','revisaPendientes', 'create','update','admin','motMuestraPlan','checkPlanMot'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\t\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('deny', // deny not login users\n\t\t\t\t'users'=>array('?'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n 'actions'=>array('admin','view'),\n 'roles'=>array('reader', 'writer')\n ),\n array('allow',\n\t\t\t\t'actions'=>array('create', 'update', 'delete'),\n 'roles'=>array('writer')\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin \n\t\t\t\t'actions' => array('customize'),\n\t\t\t\t'users' => array('@'),\n\t\t\t\t'expression' => '$user->isAdmin',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users' => array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array(\n 'deny',\n 'actions' => array('oauthadmin'),\n ),\n );\n }", "public function accessRules() {\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t\t'actions'=>array('index','view'),\n\t\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t\t'actions'=>array('admin','update','create'), //adapted from code.google.com/p/yii-user/wiki/API\n\t\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow', \n 'actions'=>array('del','parse','authorize','operate'),\n 'users'=>array('@'),\n ),\n array('deny', \n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user\n\t\t\t\t'roles'=>array('arckanto-admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\t return array(\n array('allow',\n 'actions'=>array(),\n 'roles'=>array('admin'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow authenticated users to access all actions\n 'users' => array(Yii::app()->user->name),\n ),\n array('deny'),\n );\n }", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', \r\n\t\t\t\t'actions'=>array(\r\n 'admin',\r\n\r\n //Users\r\n\r\n 'users',\r\n 'checkstatus',\r\n 'activate',\r\n\r\n //Drivers\r\n 'drivers',\r\n 'loaddriverform',\r\n 'validatedriver',\r\n 'driverstatus',\r\n 'savedriverstatus',\r\n\r\n //Cars\r\n 'cars',\r\n 'loadcarform',\r\n 'validatecar',\r\n 'carstatus',\r\n 'savecarstatus',\r\n 'repairlogform',\r\n 'saverepairlog',\r\n ),\r\n\t\t\t\t'roles'=>array('rxAdmin'),\r\n\t\t\t),\r\n\r\n\t\t\tarray('deny', \r\n\t\t\t\t'actions'=>array(\r\n 'admin',\r\n 'users',\r\n 'checkstatus',\r\n 'activate',\r\n 'drivers',\r\n 'loaddriverform',\r\n 'validatedriver',\r\n 'driverstatus',\r\n 'savedriverstatus',\r\n 'cars',\r\n 'loadcarform',\r\n 'validatecar',\r\n 'carstatus',\r\n 'savecarstatus',\r\n 'repairlogform',\r\n 'saverepairlog',\r\n ),\r\n\t\t\t\t'roles'=>array('rxClient'),\r\n\t\t\t),\r\n \r\n array('allow', \r\n\t\t\t\t'actions'=>array(\r\n ),\r\n\t\t\t\t'roles'=>array('rxClient'),\r\n\t\t\t),\r\n\t\t\t\r\n\t\t\tarray('deny', // deny all other users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\t\r\n\t\t);\r\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t 'actions'=>array('global', 'backup'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t\t'expression'=>'Yii::app()->user->isAdmin'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array(''),\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('index', 'selanno'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array('admin'),\r\n\t\t\t\t'users'=>array('admin'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','changeToStudent','update','create'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t\t'expression' => 'Yii::app()->user->isAdmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow',\n 'actions' => array(\n 'popup',\n 'gridView',\n 'excel',\n ),\n 'roles' => array('admin', 'super_admin', 'operations_admin', 'limited_admin')\n ),\n array('allow',\n 'actions' => array(\n 'updateStatus',\n 'list',\n 'update',\n 'delete',\n 'count',\n 'excelSummary',\n ),\n 'users' => array('@')\n ),\n array('deny',\n 'users' => array('*')\n )\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'expression'=>'helpers::isadmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','admin'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update'),\n//\t\t\t\t'users'=>array('@'),\n 'expression'=>'yii::app()->admin->isWAdmin()'\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('delete'),\n//\t\t\t\t'users'=>array('admin'),\n 'expression'=>'yii::app()->admin->isWDAdmin()'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array('view', 'updateAttribute', 'createContact', 'deleteContact'),\n 'users' => array('@'),\n ),\n/* array('allow',\n 'actions' => array('create', 'update', 'index', 'admin', 'delete'),\n 'roles' => array('ApplicationAdministrator'),\n ),*/\n array('deny',\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array( \n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n );\n\t}" ]
[ "0.7228763", "0.70905805", "0.7083254", "0.7078831", "0.7078758", "0.7078758", "0.7071383", "0.7071383", "0.70645475", "0.70633864", "0.70073724", "0.7003613", "0.70006496", "0.6997435", "0.698881", "0.69828933", "0.6975965", "0.6973628", "0.6971721", "0.6969118", "0.69682443", "0.69656295", "0.6958319", "0.69555074", "0.6953717", "0.69481105", "0.6941781", "0.6935866", "0.6933203", "0.69313914" ]
0.7199851
1
/ Function for creating LeadSource
public function create($lead_source_type_id=null) { if(isset($lead_source_type_id) && !empty($lead_source_type_id)) { $selected_lead_src_type = $lead_source_type_id; $flag = 1; } else { $selected_lead_src_type = 0; $flag = 0; } $lead_source_types = ['' => 'Source Type'] + LeadSourceType::orderBy('source_type') -> pluck('source_type', 'id')->all(); return view('masters.leadSource.create', compact('lead_source_types','selected_lead_src_type','flag')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSource();", "function create_source($sourceID, $sourceRec, $level = 1, $done=1) {\n\t\t$egSource = $this->dom->createElement(\"source\");\n\t\t$egSource->setAttribute(\"id\", $sourceID);\n\t\t$egSource->setAttribute(\"handle\", $this->generateHandle());\n\t\t$egSource->setAttribute(\"change\", time());\n\t\tif (($title = get_gedcom_value(\"TITL\", $level, $sourceRec)) != null) {\n\t\t\t$eSTitle = $this->dom->createElement(\"stitle\");\n\t\t\t$etSTitle = $this->dom->createTextNode($title);\n\t\t\t$etSTitle = $eSTitle->appendChild($etSTitle);\n\t\t\t$eSTitle = $egSource->appendChild($eSTitle);\n\t\t}\n\t\tif (($author = get_gedcom_value(\"AUTH\", $level, $sourceRec)) != null) {\n\t\t\t$eSAuthor = $this->dom->createElement(\"sauthor\");\n\t\t\t$etSAuthor = $this->dom->createTextNode($author);\n\t\t\t$etSAuthor = $eSAuthor->appendChild($etSAuthor);\n\t\t\t$eSAuthor = $egSource->appendChild($eSAuthor);\n\t\t}\n\t\tif (($pubInfo = get_gedcom_value(\"PUBL\", $level, $sourceRec)) != null) {\n\t\t\t$eSPubInfo = $this->dom->createElement(\"spubinfo\");\n\t\t\t$etSPubInfo = $this->dom->createTextNode($pubInfo);\n\t\t\t$etSPubInfo = $eSPubInfo->appendChild($etSPubInfo);\n\t\t\t$eSPubInfo = $egSource->appendChild($eSPubInfo);\n\t\t}\n\t\tif (($abbrev = get_gedcom_value(\"ABBR\", $level, $sourceRec)) != null) {\n\t\t\t$eSAbbrev = $this->dom->createElement(\"sabbrev\");\n\t\t\t$etSAbbrev = $this->dom->createTextNode($abbrev);\n\t\t\t$etSAbbrev = $eSAbbrev->appendChild($etSAbbrev);\n\t\t\t$eSAbbrev = $egSource->appendChild($eSAbbrev);\n\t\t}\n\t\tif (($note = get_sub_record($level, $level . \" NOTE\", $sourceRec)) != null) {\n\t\t\t$this->create_note($egSource, $note, $level);\n\t\t}\n\t\t$num = 1;\n\t\twhile (($namegSource = get_sub_record(1, \"1 OBJE\", $sourceRec, $num)) != null) {\n\t\t\t$this->create_mediaref($this->egSources, $namegSource, 1,$done);\n\t\t\t$num++;\n\t\t}\n\t\t$egSource = $this->egSources->appendChild($egSource);\n\t}", "public function create()\n {\n /** Get Lead Source Data */\n $lead_source = LeadSource::all();\n /** Get Lead Status Data */\n $lead_status = LeadStatus::all();\n return view('crm.leads.create',compact('lead_source','lead_status'));\n }", "public function __construct(Lead $lead)\n {\n $this->lead = $lead;\n }", "public function __construct($source = '');", "private function create_WD_reference_item($citation_obj, $citation, $t_source)\n {\n $obj = $citation_obj[0];\n\n // /* manual fixes\n if($val = @$obj->title[0]) $obj->title[0] = self::manual_fix_title($val);\n // */\n\n // print_r($obj); exit(\"\\nstop muna\\n\");\n $rows = array();\n $rows[] = 'CREATE';\n\n // /* scholarly ?\n // The \"instance of\" classifications: To keep things simple, we could use \"scholarly article\" if the reference parsers tell us it's a journal article, \n // and \"scholarly work\" for everything else.\n $publication_types = array(\"article-journal\", \"chapter\", \"book\");\n if(in_array(@$obj->type, $publication_types)) {}\n else echo(\"\\nUndefined publication type. [\".@$obj->type.\"]\\nWill terminate.\\n\");\n if(stripos(@$obj->type, 'journal') !== false) $scholarly = \"scholarly article\";\n else $scholarly = \"scholarly work\";\n // */\n\n // /* first two entries: label and description\n # LAST TAB Lfr TAB \"Le croissant magnifique!\"\n if($title = @$obj->title[0]) {\n $rows[] = 'LAST|Len|' .'\"'.$title.'\"';\n $rows[] = 'LAST|Den|' .'\"'.self::build_description($obj, $scholarly).'\"';\n }\n // */\n\n // /* scholarly xxx\n // if($dois = @$obj->doi) $rows[] = \"LAST|P31|Q13442814\"; // instance of -> scholarly article //old\n if($scholarly == \"scholarly article\") $rows[] = \"LAST|P31|Q13442814 /* scholarly article */\"; // instance of -> scholarly article\n else $rows[] = \"LAST|P31|Q55915575 /* scholarly work */\"; // instance of -> scholarly work\n // */\n\n if($authors = @$obj->author) $rows = self::prep_for_adding($authors, 'P2093', $rows); #ok use P50 if author is an entity\n if($publishers = @$obj->publisher) $rows = self::prep_for_adding($publishers, 'P123', $rows, \"publisher\");\n if($place_of_publications = @$obj->location) $rows = self::prep_for_adding($place_of_publications, 'P291', $rows, \"place of publication\");\n if($pages = @$obj->pages) $rows = self::prep_for_adding($pages, 'P304', $rows, \"page(s)\"); #ok\n // if($issues = @$obj->issue) $rows = self::prep_for_adding($issues, 'P433', $rows); #ok\n if($volumes = @$obj->volume) $rows = self::prep_for_adding($volumes, 'P478', $rows, \"volume\"); #ok\n if($publication_dates = @$obj->date) $rows = self::prep_for_adding($publication_dates, 'P577', $rows, \"publication date\"); #ok\n if($chapters = @$obj->chapter) $rows = self::prep_for_adding($chapters, 'P792', $rows, \"chapter\"); //No 'chapter' parsed by AnyStyle. Eli should do his own parsing.\n if($titles = @$obj->title) $rows = self::prep_for_adding($titles, 'P1476', $rows, \"title\"); #ok\n\n // /* Eli's initiative, but was given a go signal -> property 'type of reference' (P3865)\n if($type = @$obj->type) $rows = self::prep_for_adding(array($type), 'P3865', $rows); #ok\n // */\n\n // /* Eli's initiative but close to Jen's \"published in\" (P1433) proposal\n if($containers = @$obj->{\"container-title\"}) $rows = self::prep_for_adding($containers, 'P1433', $rows, \"published in\"); #ok\n // */\n\n // Others:\n if($dois = @$obj->doi) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\"); #ok\n else { //check if t.source is DOI, if yes use it | New: Mar 13, 2023\n if($dois = $this->get_doi_from_tsource($t_source)) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\");\n }\n /* seems no instructions to use this yet:\n if($reference_URLs = @$obj->url) $rows = self::prep_for_adding($reference_URLs, 'P854', $rows);\n */\n\n /* Eli's choice: will take Jen's approval first -> https://www.wikidata.org/wiki/Property:P1683 -> WikiData says won't use it here.\n $rows = self::prep_for_adding(array($citation), 'P1683', $rows);\n */\n\n print_r($rows);\n $WRITE = Functions::file_open($this->citation_export_file, \"w\");\n foreach($rows as $row) fwrite($WRITE, $row.\"\\n\");\n fclose($WRITE);\n\n // /* new: so it continues...\n $this->debug['citation not matched in WD'][$t_source][$citation] = '';\n return \"-to be assigned-\";\n // */\n\n /* NEXT TODO: is the exec_shell command to trigger QuickStatements */\n exit(\"\\n[$t_source]\\n[$citation]\\nUnder construction...\\n\");\n \n /* Reminders:\n CREATE\n LAST\tP31\tQ13442814\n instance of -> scholarly article\n\n scholarly article https://www.wikidata.org/wiki/Q13442814 for anything with a DOI and \n scholarly work https://www.wikidata.org/wiki/Q55915575 for all other items we create for sources.\n */\n \n // CREATE\n // LAST|Len|\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|Den|\"scholarly article by G\"\n // LAST|P31|Q13442814 /* scholarly article */\n // LAST|P2093|\"G, Brazil Flora\"\n // LAST|P478|\"393\" /* volume */\n // LAST|P577|+2019-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|P356|\"10.15468/1mtkaw\" /* DOI */\n\n\n // created...\n // [t.source] => https://doi.org/10.1007/978-3-662-02604-5_58\n // [t.citation] => C. N. PAGE. 1990. Pinaceae. In: The families and genera of vascular plants. Volume I; Pteridophytes and Gymnosperms. K. Kubitzki, K. U. Kramer and P. S. Green, eds.\n // https://www.wikidata.org/wiki/Q117088084\n // CREATE\n // LAST|Len|\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by PAGE\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"PAGE, C.N.\"\n // LAST|P478|\"I\" /* volume */\n // LAST|P577|+1990-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|P356|\"10.1007/978-3-662-02604-5_58\" /* DOI */\n\n // to be created...\n // [t.source] => https://doi.org/10.1007/978-3-540-31051-8\n // [t.citation] => J.W. Kadereit, C. Jeffrey, K. Kubitzki (eds). 2007. The families and genera of vascular plants. Volume VIII; Flowering Plants; Eudicots; Asterales. Springer Nature.\n // CREATE\n // LAST|Len|\"The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by Kadereit et al.\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"Kadereit, J.W.\"\n // LAST|P2093|\"Jeffrey, C.\"\n // LAST|P2093|\"Kubitzki, K.\"\n // LAST|P123|\"Flowering Plants; Eudicots; Asterales. Springer Nature\" /* publisher */\n // LAST|P478|\"VIII\" /* volume */\n // LAST|P577|+2007-00-00T00:00:00Z/9\n // LAST|P1476|en:\"The families and genera of vascular plants\"\n // LAST|P3865|Q55915575 /* book */\n // LAST|P356|\"10.1007/978-3-540-31051-8\" /* DOI */\n \n \n }", "public function fromSource($source)\n {\n constraint_mustBeGreaterThan($source, DataModel_Definition::SOURCE_START);\n constraint_mustBeLessThan($source, DataModel_Definition::SOURCE_END);\n\n $this->source = $source;\n\n // update the cache that Datastore_MetaRecord holds\n $oDef = DataModel_Definitions::getIfExists($this->modelName);\n $oDef->setFieldSource($this, $source);\n }", "public function createLead($leadData) {\n return $this->createRecord('lead', $leadData);\n }", "public function createLinker()\n {\n $entityClass = 'RK\\\\WebsiteHelperModule\\\\Entity\\\\linkerEntity';\n\n return new $entityClass();\n }", "public function __construct($source) {\n\t\t// dummy\n\t}", "protected function SourceDepartments() {\n\treturn $this->DepartmentTable()->SQO_Source('d');\n\t//return new fcSQL_TableSource($this->DepartmentTable()->Name(),'d');\n }", "public function makeLease($leases_arr = [])\n {\n $theme = $this->fakeLeaseData($leases_arr);\n return $this->LeaseRepositoryObj->create($theme);\n }", "public function addNewSource($data)\n {\n $company = app('app_user')->member->company;\n\n $stripe_customer = \\Stripe\\Customer::retrieve($company->stripe_customer_id);\n $source = $stripe_customer->sources->create([\n 'source' => $data['token']\n ]);\n\n // save our payment method record\n $payment_method_data = [\n 'company_id' => $company->id,\n 'stripe_source_id' => $source->id,\n 'cc_type' => $source->brand,\n 'cc_last4' => $source->last4,\n 'cc_expiration_month' => $source->exp_month,\n 'cc_expiration_year' => $source->exp_year,\n 'is_default' => false\n ];\n $company_payment_method = $this->create($payment_method_data);\n\n // set default method if requested\n if ( isset($data['is_default']) ) {\n $this->setDefault($company_payment_method->id);\n }\n\n return $company_payment_method;\n\n }", "function m_dspLeads()\n\t{\n\t\t$libFunc=new c_libFunctions();\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_LEAD_FILE\",$this->leadTemplate);\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_MESSAGE_BLK\", \"message_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_MSG_BLK\", \"msg_blk\");\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_LEAD_BLK\", \"lead_blk\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SALESURL\",SITE_URL.\"sales/\");\n\n\t\t#INTAILIZING \n\t\t$this->ObTpl->set_var(\"lead_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"message_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk\",\"\");\t\n\n\t\t$this->request['msg']=$this->libFunc->ifSet($this->request,\"msg\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\n\t\t#DATABASE QUERY\n\t\t$this->obDb->query = \"SELECT * FROM \".LEADS.\" WHERE vdescription!=' '\";\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$recordCount=$this->obDb->record_count;\n\n\t\tif($this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_LEAD_INSERTED);\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\t\telseif($this->request['msg']==2)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_LEAD_DELETED);\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\t\telseif($this->request['msg']==5)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\n\t\tif($recordCount>0)\n\t\t{\n\t\t\t#PARSING LEAD BLOCK\n\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t{\t\t\n\t\t\t\t$this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $queryResult[$j]->iLeadid_PK.\"'\";\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_COUNT\",$qryRs[0]->cnt);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iLeadid_PK);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_DESCRIPTION\",$this->libFunc->m_displayContent($queryResult[$j]->vdescription));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BUILDDATE\",$this->libFunc->dateFormat2($queryResult[$j]->tmBuildDate));\t\n\t\t\t\t\n\t\t\t\t$this->ObTpl->parse(\"lead_blk\",\"TPL_LEAD_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$recordCount.\" records found\");\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",MSG_NOLEADS);\n\t\t\t$this->ObTpl->parse(\"message_blk\",\"TPL_MESSAGE_BLK\");\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_LEAD_FILE\"));\n\t}", "public function __construct(Source $source)\n {\n $this->source = $source;\n }", "public function setSource($source) {\n $this->source = $source;\n return $this;\n }", "public function testSourceObject()\r\n {\r\n $source = \\tabs\\api\\core\\Source::factory(\r\n 'GAD',\r\n 'Google',\r\n 'Internet'\r\n );\r\n $this->assertEquals('GAD', $source->getCode());\r\n $this->assertEquals('Google', $source->getDescription());\r\n $this->assertEquals('Internet', $source->getCategory());\r\n }", "protected function newEntity(FeedsSource $source) {\n $values = array(\n 'type' => $this->bundle(),\n 'author_uid' => $this->config['author'],\n );\n return waywire_video_create($values);\n }", "function m_leadBuilder()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_LEAD_FILE\",$this->leadTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_DEPARTMENT_BLK\", \"dept_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_ITEMS_BLK\", \"items_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_MAINATTACHED_BLK\", \"mainattached_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_MAINATTACHED_BLK\",\"TPL_ATTACHED_BLK\", \"attached_blk\");\n\t\t#INTIALIZING VARIABLES\n\t\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\t\t$this->ObTpl->set_var(\"dept_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"attached_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"mainattached_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_TODATE\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_FROMDATE\",\"\");\n\t\tif(!isset($this->request['postOwner']))\n\t\t{\n\t\t\t$this->request['postOwner']=\"0\";\n\t\t}\n\t\tif(!isset($this->request['leadid']))\n\t\t{\n\t\t\t$this->request['leadid']=\"\";\n\t\t}\n\t\t$this->ObTpl->set_var(\"TPL_VAR_LEADID\",$this->request['leadid']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",$this->request['postOwner']);\n\t\t#START DISPLAY DEPARETMENT BLOCK\n\t\t$this->obDb->query = \"SELECT vTitle,iDeptId_PK FROM \".DEPARTMENTS.\", \".FUSIONS.\" WHERE iDeptId_PK=iSubId_FK AND vType='department'\";\n\t\t$deptResult = $this->obDb->fetchQuery();\n\t\t $recordCount=$this->obDb->record_count;\n\t\t#PARSING DEPARTMENT BLOCK\n\t\t$this->ObTpl->set_var(\"SELECTED1\",\"selected\");\n\t\tif($recordCount>0)\n\t\t{\n\t\t\tfor($i=0;$i<$recordCount;$i++)\n\t\t\t{\n\t\t\t\t$_SESSION['dspTitle']=\"\";\t\t\n\t\t\t\t $this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->m_getTitle($deptResult[$i]->iDeptId_PK,'department'));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$deptResult[$i]->iDeptId_PK);\n\t\t\t\tif(isset($this->request['postOwner']) && $this->request['postOwner'] == $deptResult[$i]->iDeptId_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED1\",\"\");\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ObTpl->parse(\"dept_blk\",\"TPL_DEPARTMENT_BLK\",true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#END DISPLAY DEPARETMENT BLOCK\n\t\tif($this->request['postOwner']==\"orphan\")\n\t\t{\n\t\t\t $this->obDb->query= \"SELECT vTitle,fusionid,iProdId_PK FROM \".PRODUCTS.\" LEFT JOIN \".FUSIONS.\" ON iProdId_PK = iSubId_FK \" ;\n\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t$recordCount=$this->obDb->record_count;\n\n\t\t\tif(!isset($this->request['owner'])){\n\t\t\t\t$this->request['owner'] = \"\";\n\t\t\t}\n\t\t\t\t\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(empty($queryResult[$j]->fusionid) && $this->request['owner']!=$queryResult[$j]->iProdId_PK)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{#IF OTHER THAN ORPHAN\n\t\t\t\t$query = \"SELECT vTitle,iProdId_PK FROM \".PRODUCTS.\", \".FUSIONS.\" WHERE iProdId_PK=iSubId_FK AND iOwner_FK='\".$this->request['postOwner'].\"' AND vOwnerType='department' AND vType='product'\";\n\t\t\t\t$this->obDb->query=$query;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t/*if($this->request['owner']!=$queryResult[$j]->iProdId_PK)\n\t\t\t\t\t\t{*/\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t//}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\n\t\t#TO DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t\t$query1 = \"SELECT vTitle,iLeadProductId_PK,iProductid_FK FROM \".LEADPRODUCT.\" ,\".PRODUCTS.\" WHERE iProductid_FK=iProdid_PK AND iLeadId_FK='\".$this->request['leadid'].\"'\";\n\t\t\t$this->obDb->query=$query1;\n\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\tif($recordCount>0)\n\t\t\t{\n\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iLeadProductId_PK);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PID\",$queryResult[$j]->iProductid_FK);\n\t\t\t\t\t$this->ObTpl->parse(\"attached_blk\",\"TPL_ATTACHED_BLK\",true);\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"mainattached_blk\",\"TPL_MAINATTACHED_BLK\",true);\n\t\t\t}\n\t\t\t\n\t\t#END DISPLAY CURRENTLY ATTACHED ITEMS\n\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_LEAD_FILE\"));\n\t}", "function __construct()\n\t{\n\t\n\tparent::__construct();\n\t$this->load->model('lead_model');\n\t\n\t}", "public function lead_source_by_id($l_t_id)\n {\n \n $result = $this->db->query(\"call lead_source_by_id('\".$l_t_id.\"')\")->row();\n save_query_in_log();\n \n return $result;\n }", "private function createDataSource()\n {\n $this->debug(\"Creating data source\");\n $this->dataSource = DataSourceRepository::createDataSource(\n $this->config['datasource']['key'],\n $this->config['datasource']['title'],\n 'SYSTEM'\n );\n $this->dataSource->setDataSourceAttribute(\"manual_publish\", 0);\n $this->dataSource->setDataSourceAttribute(\"qa_flag\", 0);\n\n $this->log(\"Data source {$this->dataSource->title}({$this->dataSource->data_source_id}) created\");\n }", "public function createLoanOffer($currency, $amount, $duration, $lendingRate, $autoRenew=false) {\n return $this->trading([\n 'command' => 'createLoanOffer',\n 'currency' => $currency,\n 'amount' => $amount,\n 'duration' => $duration,\n 'lendingRate' => $lendingRate,\n 'autoRenew' => (int) ((bool) $autoRenew),\n ]);\n }", "public function setSource($source);", "public static function getSource($params)\n {\n $className = 'ZtNewsSource' . ucfirst($params->get('source'));\n return new $className($params);\n }", "protected function _sourceFactory(&$driver_obj, $user, $type, $dsn, $options = array())\n\t{\n\t\t$file = 'QuickBooks/API/Source/' . ucfirst(strtolower($type)) . '.php';\n\t\t$class = 'QuickBooks_API_Source_' . ucfirst(strtolower($type));\n\t\t\n\t\trequire_once $file;\n\t\t\n\t\tif (class_exists($class))\n\t\t{\n\t\t\treturn new $class($driver_obj, $user, $dsn, $options);\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function setSource($source) {\n $this->source = $source;\n return $this;\n }", "private function createLeadPointsFromArray($leadId, $array)\n {\n foreach ($array as $item => $value) {\n LeadPoint::create([\n \"campaign_id\" => $this->campaignId,\n \"lead_id\" => $leadId,\n \"key\" => $item,\n \"value\" => $value\n ]);\n }\n }", "public function addSource($source) {\n // We keep this is a variable as well so we can use it when preparing the\n // request.\n $this->source = $source;\n $this->setFieldValue('source', $source);\n }", "function insertJointSource($jointSource, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n retainDatabaseTransaction();\n\n // Request content versioning unit id\n $titleId = \\ICA\\Contents\\requestContentId();\n $introId = \\ICA\\Contents\\requestContentId();\n\n // Create a new joint source\n $result = query(\"INSERT INTO jointsources\n (`author_id`, `title_id`, `intro_id`)\n VALUES ({$accountId}, {$titleId}, {$introId});\");\n $jointSourceId = $DATABASE->insert_id;\n\n $stateId = insertJointSourceState($jointSourceId, $state);\n\n if (!empty($jointSource->meta[\"title\"])) partialPutJointSourceMetaTitle($titleId, $jointSource->meta[\"title\"]);\n if (!empty($jointSource->meta[\"intro\"])) partialPutJointSourceMetaIntro($introId, $jointSource->meta[\"intro\"]);\n if (!empty($jointSource->meta[\"themes\"])) partialPutJointSourceMetaThemes($jointSourceId, $jointSource->meta[\"themes\"]);\n if (!empty($jointSource->meta[\"participants\"])) partialPutJointSourceMetaParticipants($jointSourceId, $jointSource->meta[\"participants\"]);\n if (!empty($jointSource->meta[\"region\"])) partialPutJointSourceMetaRegion($jointSourceId, $jointSource->meta[\"region\"]);\n\n releaseDatabaseTransaction();\n\n return $jointSourceId;\n\n }" ]
[ "0.6708465", "0.5783074", "0.5460033", "0.53325206", "0.5309473", "0.52481717", "0.51293695", "0.51271", "0.5118407", "0.50411934", "0.5007477", "0.49815503", "0.49196926", "0.4900801", "0.49002695", "0.4888256", "0.4816509", "0.4807005", "0.48043624", "0.47978535", "0.4791933", "0.47794533", "0.47785205", "0.47682706", "0.4758643", "0.47567943", "0.47255945", "0.47087038", "0.46891105", "0.46812847" ]
0.5814021
1
/ Update function for LeadSourceType
public function edit($id,$lead_source_type_id=0) { $lead_source_types = ['' => 'Source Type'] + LeadSourceType::orderBy('source_type') -> pluck('source_type', 'id')->all(); $LeadSources = LeadSources::findOrFail($id); if(isset($lead_source_type_id) && !empty($lead_source_type_id)) { $selected_lead_src_type = $lead_source_type_id; $flag = 1; } else { $selected_lead_src_type = 0; $flag = 0; } return view('masters.leadSource.create', compact('LeadSources','lead_source_types','selected_lead_src_type','flag')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateSource() {\n if (!empty($this->imported)) {\n $data = $this->source->data;\n if (empty($data)) {\n $data = array();\n }\n foreach ($this->imported as $key) {\n $data[] = $key;\n }\n $this->source->data = $data;\n $this->source->last_updated = date('Y-m-d H:i:s', strtotime('now'));\n $this->source->save();\n $this->imported = array();\n }\n }", "public function testUpdateExternalShipmentCustomFields()\n {\n }", "public function lead_source_update($data, $l_s_id)\n {\n $query = $this->db->query(\"call lead_source_update(\n '\".$data['lead_source'].\"',\n '\".$data['m_on'].\"',\n '\".$data['m_by'].\"',\n '\".$l_s_id.\"',\n '\".$data['source_color'].\"'\n )\");\n save_query_in_log(); \n return 1;\n }", "public function testUpdateUnitRelationshipSource()\n {\n }", "public function edit(Lead $lead)\n {\n //\n }", "protected function _updatefields() {}", "public function updateLeadStage() {\n\n /////////////////////////////////////////////////////////////////////\n // CHECK REQUIRED DATA //////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n if (is_null($this->__apiPrivateToken)) {\n throw new \\Exception(\"API Private Token must be setted!\");\n }\n\n if (is_null($this->__leadEmail)) {\n throw new \\Exception(\"Lead email must be setted!\");\n }\n\n if (!isset($this->__leadData['lifecycle_stage'])) {\n throw new \\Exception(\"Lead data 'lifecycle_stage' must be setted!\");\n }\n\n /////////////////////////////////////////////////////////////////////\n // PREPARE DATA COLLECTION //////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n $this->__translateLeadData();\n\n $lead = array();\n\n if (isset($this->__leadData['lifecycle_stage'])) {\n $lead['lifecycle_stage'] = $this->__leadData['lifecycle_stage'];\n }\n\n if (isset($this->__leadData['opportunity'])) {\n $lead['opportunity'] = $this->__leadData['opportunity'];\n }\n\n $leadData = array();\n $leadData['auth_token'] = $this->__apiPrivateToken;\n $leadData['lead'] = $lead;\n\n $this->__leadData = $leadData;\n\n /////////////////////////////////////////////////////////////////////\n // PERFORM REQUEST TO API ///////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n return $this->__request('PUT','leads');\n }", "public function testUpdateExternalShipment()\n {\n }", "public function lead_type_update($data, $l_t_id)\n {\n if($query = $this->db->query(\"call lead_type_update(\n\n '\".$data['lead_type'].\"',\n '\".$data['m_on'].\"',\n '\".$data['m_by'].\"',\n '\".$l_t_id.\"'\n \n )\"))\n { \n save_query_in_log();\n return true;\n }else{ return false; }\n }", "public function lead_source_add($data)\n {\n if($query = $this->db->query(\"call lead_source_add(\n\n '\".$data['lead_source'].\"',\n '\".$data['c_on'].\"',\n '\".$data['c_by'].\"',\n '\".$data['lead_source_color'].\"'\n )\"))\n { save_query_in_log(); return true; }else{ save_query_in_log(); return false; }\n }", "public function lead_source_by_id($l_t_id)\n {\n \n $result = $this->db->query(\"call lead_source_by_id('\".$l_t_id.\"')\")->row();\n save_query_in_log();\n \n return $result;\n }", "public function update(Request $request, Lead $lead)\n {\n //\n }", "public function testUpdatePackingPlanCustomFields()\n {\n }", "function changeRecord($hookName, $params) {\n\t\t$record =& $params[0];\n\t\t$row = $params[1];\n\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\t\t$journal = $journalDao->getJournal($row['journal_id']);\n\t\t$openAIREDao =& DAORegistry::getDAO('OpenAIREDAO');\n\t\tif ($openAIREDao->isOpenAIREArticle($row['article_id'])) {\n\t\t\t$record->sets[] = $journal->getPath() . ':ec_fundedresources';\n\t\t}\n\t\treturn false;\t\n\t}", "static function update_tracing_data($lead_id, $status){\n\t\t$table = self::get_offline_table();\n\t\tglobal $wpdb;\n\t\t$wpdb->update($table, array('crm_status'=>(int)$status), array('lead_id'=>(int)$lead_id), array('%d'), array('%d'));\n\t\t\n\t}", "public function company_updateRoleSource() {\n $this->loadModel('RoleSource');\n $this->autoRender = FALSE;\n $this->RoleSource->id = $_POST['id'];\n $this->RoleSource->save($_POST, array('validate' => FALSE));\n echo json_encode(array('status' => 'true'));\n die;\n }", "public function postImport() {\n parent::postImport();\n\n // i18n Translation Set.\n $result = db_query('SELECT n.sourceid1, n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n');\n foreach ($result as $record) {\n $sourceid_tmp = preg_replace('#_fra_#', '_eng_', $record->sourceid1);\n $source_mlid = 0;\n $translated_mlid = 0;\n if (preg_match('/_fra_/i', $record->sourceid1)) {\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $record->sourceid1));\n foreach ($result as $result_row) {\n $translated_mlid = $result_row->destid1;\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $sourceid_tmp));\n foreach ($result as $result_row) {\n $source_mlid = $result_row->destid1;\n break;\n }\n break;\n }\n if (($source_mlid != 0) && ($translated_mlid != 0)) {\n $translation_set = i18n_translation_set_create('menu_link');\n $translation_set->reset_translations();\n $item = menu_link_load($source_mlid);\n $translation_set->add_item($item, 'en');\n $item = menu_link_load($translated_mlid);\n $translation_set->add_item($item, 'fr');\n $translation_set->save(TRUE);\n }\n }\n }\n }", "public function update(Request $request,Lead $lead)\n {\n $input = $request->all();\n\n $validator = Validator::make($input, [\n 'name' => 'required',\n 'email' => 'required',\n 'mobile_no' => 'required',\n 'phone' => 'required',\n // 'subscription_tier_id' => 'required',\n // 'subscription_fees' => 'required',\n 'leads_status' => 'required',\n // 'lead_owner_id' => 'required',\n 'comments' => 'required',\n // 'organization_id' => 'required',\n ]);\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors());\n }\n\n $lead->name = $input['name'];\n $lead->email = $input['email'];\n $lead->mobile_no = $input['mobile_no'];\n $lead->phone = $input['phone'];\n $lead->leads_status = $input['leads_status'];\n $lead->organization_id = isset($input['organization_id'])?$input['organization_id']:0;\n if($input['leads_status'] == 3){\n $lead->source = $input['source']; \n }\n // $lead->lead_owner_id = $input['lead_owner_id'];\n $lead->comments = $input['comments'];\n\n $addressData = array(\n 'address_line1'=>$input['address_line1'],\n 'address_line2'=>$input['address_line2'],\n 'city'=>$input['city'],\n 'state'=>$input['state'],\n 'country_id'=>$input['country_id'],\n 'postal_code'=>$input['postal_code'],\n );\n\n $address = Address::create($addressData);\n $lead->address_id = $address->id;\n\n // $subscriptionData = array(\n // 'subscription_id'=>$input['subscription_tier_id'],\n // 'subscription_fees'=>$input['subscription_fees'],\n // 'is_active'=>1,\n // );\n // $userSubscription = UserSubscription::create($subscriptionData);\n // $lead->user_subscription_id = $userSubscription->id;\n\n $lead->save();\n\n return $this->sendResponse(new LeadResource($lead), 'Lead updated successfully.');\n }", "public function addSource($source) {\n // We keep this is a variable as well so we can use it when preparing the\n // request.\n $this->source = $source;\n $this->setFieldValue('source', $source);\n }", "#[CustomOpenApi\\Operation(id: 'leadUpdate', tags: [Tags::Lead, Tags::V1])]\n #[OpenApi\\Parameters(factory: DefaultHeaderParameters::class)]\n #[CustomOpenApi\\RequestBody(request: UpdateLeadRequest::class)]\n #[CustomOpenApi\\Response(resource: LeadWithLatestActivityResource::class)]\n #[CustomOpenApi\\ErrorResponse(exception: UnauthorisedTenantAccessException::class)]\n public function update(Lead $lead, UpdateLeadRequest $request): LeadWithLatestActivityResource\n {\n $lead->checkTenantAccess()->update($request->validated());\n return $this->show($lead->refresh()->loadMissing(self::load_relation));\n }", "protected function _upgradeContactLists()\n {\n $criteria = array('__type' => 'Group');\n $sources = array_keys($GLOBALS['cfgSources']);\n\n foreach ($sources as $sourcekey) {\n try {\n $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($sourcekey);\n $lists = $driver->search($criteria);\n } catch (Turba_Exception $e) {\n return;\n }\n\n for ($j = 0, $cnt = count($lists); $j < $cnt; ++$j) {\n $list = $lists->next();\n $attributes = $list->getAttributes();\n $members = @unserialize($attributes['__members']);\n if (is_array($members) && !empty($members[0])) {\n $c = count($members);\n for ($i = 0; $i < $c; ++$i) {\n if (substr_count($members[$i], ':') == 2) {\n preg_match('/^([a-zA-Z0-9]+:[a-zA-Z0-9]+)(:[a-zA-Z0-9]+)$/', $members[$i], $matches);\n $source = $matches[1];\n $contact_key = substr($matches[2], 1);\n } elseif (substr_count($members[$i], ':') == 1) {\n list($source, $contact_key) = explode(':', $members[$i]);\n } else {\n break;\n }\n $source = $this->_updateShareName($source);\n $members[$i] = $source . ':' . $contact_key;\n }\n $list->setValue('__members', serialize($members));\n $list->store();\n }\n }\n }\n }", "public function updateLead() {\n\n /////////////////////////////////////////////////////////////////////\n // CHECK REQUIRED DATA //////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n if (is_null($this->__apiPrivateToken)) {\n throw new \\Exception(\"API Private Token must be setted!\");\n }\n\n if (is_null($this->__leadEmail)) {\n throw new \\Exception(\"Lead email must be setted!\");\n }\n\n /////////////////////////////////////////////////////////////////////\n // PREPARE DATA COLLECTION //////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n $this->__translateLeadData();\n\n $leadData = array();\n $leadData['auth_token'] = $this->__apiPrivateToken;\n $leadData['lead'] = $this->__leadData;\n\n $this->__leadData = $leadData;\n\n /////////////////////////////////////////////////////////////////////\n // PERFORM REQUEST TO API ///////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n return $this->__request('PUT', 'leads');\n }", "public function update(Request $request, leads $leads)\n {\n //\n }", "public function updateExtList() {}", "function _silver_feeds_importer_default_helper($field_info, &$feeds_importer, $additional = ''){\n foreach($field_info as $key => $field){\n $field_info = field_info_field($field['field_name']);\n switch($field_info['type']){\n case 'file':\n // Do nothing. We can't import files in an Excel template.\n break;\n case 'country':\n // We use iso3 country codes\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('ISO alpha-2') . ')',\n 'target' => $additional . $key . ':iso2',\n 'unique' => 0\n );\n break;\n case 'date':\n // Add the from date, and also the to date if required.\n // We add two columns for the user reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Start') . ')',\n 'target' => $key . ':start',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('End') . ')',\n 'target' => $key . ':end',\n 'unique' => 0\n );\n break;\n case 'link_field':\n // Add the from date, and also the to date if required.\n // We add two columns for the user reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('URL') . ')',\n 'target' => $key . ':url',\n 'unique' => 0\n );\n break;\n case 'user_reference':\n // We add two columns for the user reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (UID)',\n 'target' => $key . ':uid:duplicates',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Name on site') . ')',\n 'target' => $key . ':name:duplicates',\n 'unique' => 0\n );\n break;\n case 'node_reference':\n // We add two columns for the node reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (NID)',\n 'target' => $key . ':nid:duplicates',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Title') . ')',\n 'target' => $key . ':title:duplicates',\n 'unique' => 0\n );\n break;\n case 'taxonomy_term_reference':\n // We add three columns for the term reference field.\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (' . t('Name') . ')',\n 'target' => $key,\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (TID)',\n 'target' => $key . ':tid',\n 'unique' => 0\n );\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => $field['label'] . ' (GUID)',\n 'target' => $key . ':guid',\n 'unique' => 0\n );\n break;\n default:\n $feeds_importer->config['processor']['config']['mappings'][] = array(\n 'source' => trim($field['label']),\n 'target' => $key,\n 'unique' => 0\n );\n }\n }\n}", "public function decorate(): void\n {\n $leadArray = (array)$this->lead;\n\n foreach ($this->attributionTrackerFieldNames as $fieldName => $CRMFieldName) {\n $fieldValue = Data::_stringFromPost($fieldName);\n\n if (empty($fieldValue)) {\n continue;\n }\n\n $leadArray[$CRMFieldName] = $fieldValue;\n }\n\n $this->lead = (object) $leadArray;\n }", "public function lead_source_in_lead($l_s_id)\n {\n \n $result = $this->db->query(\"call lead_source_in_lead('$l_s_id')\")->result();\n save_query_in_log();\n \n return $result;\n }", "public function fromSource($source)\n {\n constraint_mustBeGreaterThan($source, DataModel_Definition::SOURCE_START);\n constraint_mustBeLessThan($source, DataModel_Definition::SOURCE_END);\n\n $this->source = $source;\n\n // update the cache that Datastore_MetaRecord holds\n $oDef = DataModel_Definitions::getIfExists($this->modelName);\n $oDef->setFieldSource($this, $source);\n }", "public function opportunity_lead_today_followup_list($lead_type , $lead_source, $lead_daterange, $lead_status, $product_id, $tab, $list_lsource)\n {\n\n if($tab == 1)\n {\n $tab_val = \" AND l.status = 3\";\n }\n else{\n\n $tab_val = '';\n }\n\n if($product_id != '')\n {\n $pv = \" AND l.product_id IN ($product_id)\";\n }\n else{\n $pv = \"\";\n }\n \n\n if($lead_type != '')\n {\n $lt = \" AND l.lead_type_id = '$lead_type'\";\n }\n else{\n $lt = \"\";\n }\n\n if($lead_source != '')\n {\n $ls = \" AND l.lead_source_id = '$lead_source'\";\n }\n else{\n $ls = \"\";\n }\n\n if($list_lsource != '')\n {\n $lls = \" AND ls.lead_source_id = '$list_lsource'\";\n }\n else{\n $lls = \"\";\n }\n\n if($lead_status != '')\n {\n $lst = \" AND l.lead_status_id = '$lead_status'\";\n }\n else{\n $lst = \"\";\n }\n \n if($lead_daterange != '')\n {\n $explode_date = explode('/', $lead_daterange);\n $startdate = $explode_date[0];\n\n //$startdate = explode('/', $explode_date[0]);\n //$startdate = $startdate[2].'-'.$startdate[0].'-'.$startdate[1];\n \n $enddate = $explode_date[1];\n //$enddate = $enddate[2].'-'.$enddate[0].'-'.$enddate[1];\n\n $dateq = \" AND STR_TO_DATE(l.created_on, '%Y-%m-%d') >= STR_TO_DATE('\".$startdate.\"', '%Y-%m-%d') and STR_TO_DATE(l.created_on, '%Y-%m-%d') <= STR_TO_DATE('\".$enddate.\"', '%Y-%m-%d')\";\n\n }else{\n $lead_daterange = '';\n $startdate = '';\n $enddate = '';\n $dateq = \"\";\n }\n\n $user_details = $this->User_model->user_by_id($_SESSION['admindata']['user_id']);\n\n if($user_details->show_leads == 1)\n {\n $lead_assign_val == '';\n }\n else if($user_details->show_leads == 2)\n {\n $lead_assign_val = \" AND l.lead_assigned_to =\".$_SESSION['admindata']['user_id'];\n }\n else if($user_details->show_leads == 3 && $user_details->product_users != '')\n {\n $lead_assign_val = \" AND FIND_IN_SET(l.lead_assigned_to, '\".$user_details->product_users.\"')\";\n }else{\n $lead_assign_val = '';\n }\n\n $sql = $this->db->query(\"SELECT count(l.lead_id) as today_followups FROM leads l\n \n LEFT JOIN lead_followups fups on fups.lead_id = l.lead_id \n LEFT JOIN sub_lead_source sls on sls.sub_lead_source_id = l.lead_source_id\n LEFT JOIN lead_source ls on ls.lead_source_id = sls.lead_source_id\n WHERE DATE(followup_date) = DATE(NOW()) $tab_val $lead_assign_val $lt $ls $lst $pv $dateq $lls ORDER BY l.lead_id DESC\n \")->row(); \n save_query_in_log();\n return $sql; \n }", "public function testUpdateSupplierGroup()\n {\n }" ]
[ "0.5992876", "0.5519153", "0.5519122", "0.5467835", "0.54648095", "0.5411691", "0.53151476", "0.52804315", "0.51851374", "0.51603675", "0.514521", "0.51320595", "0.51165044", "0.51117647", "0.50387245", "0.5036058", "0.5029788", "0.4998528", "0.4996192", "0.49852484", "0.4971485", "0.49714166", "0.49648422", "0.4947371", "0.49202496", "0.49161226", "0.49118146", "0.4909651", "0.490741", "0.4899276" ]
0.5765194
1
/ Fungsi ini me return satu record dari tabel pokemon dalam bentuk object. Record yang di return adalah record dengan id $id
public function get_one($id){ // TODO: Modif bagian ini //$query = $this->db->get_where('pokemon', array('id' => $id)); //return $query->result(); return $this->db->get_where('pokemon',array('id' => $id))->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function modelGetRecord(){\n $id = isset($_GET[\"id\"])&&$_GET[\"id\"] > 0 ? $_GET[\"id\"] : 0;\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select * from inventory where id=$id\");\n // tra ve mot ban ghi\n return $query->fetch();\n }", "public function getById($id){\n\t\t$row = $this->_model\n\t\t->getTable()\n\t\t->createQuery()\n\t\t->andWhere('poliza_id = ?',$id)\n\t\t->execute()\n\t\t->toArray();\n\t\treturn $row;\n\t}", "public function getRecord($id = null);", "public function load($id){\n\t\t$sql = 'SELECT * FROM cbt_nomor_peserta WHERE id_nomor = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "function get_by_id($id)\n {\n $this->db->select('*');\n $this->db->join('pohon', 'pohon.id_pohon = penanaman.id_pohon');\n $this->db->join('users', 'users.id_user = penanaman.id_user');\n $this->db->join('petak', 'petak.id_petak = penanaman.id_petak');\n $this->db->join('pendaftaran', 'pendaftaran.id_pendaftaran = penanaman.nama_penanam');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function returnDetailFindByPK($id);", "public function selectById($id) {\n $conn = $this->conex->connectDatabase();\n $sql = \"select * from tbl_patrocinio where id_patrocinio= ?;\";\n $stm = $conn->prepare($sql);\n $stm->bindValue(1, $id);\n $success = $stm->execute();\n if ($success) {\n \n foreach ($stm->fetchAll(PDO::FETCH_ASSOC) as $result) {\n $Patrocinio = new Patrocinio();\n $Patrocinio->setId($result['id_patrocinio']);\n $Patrocinio->setNome($result['nome']);\n $Patrocinio->setDescricao($result['descricao']);\n $Patrocinio->setApagado($result['apagado']);\n $Patrocinio->setStatus($result['ativo']);\n return $Patrocinio;\n };\n $this->conex -> closeDataBase();\n }\n }", "function get_by_id($id)\n {\n /*$this->db->where($this->id, $id);*/\n $this->db->where('persediaan.id_persediaan', $id);\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n $this->db->select('persediaan.id_persediaan');\n $this->db->select('nama_puskesmas');\n $this->db->select('kode');\n $this->db->select('nama_obat');\n $this->db->select('stok_awal');\n return $this->db->get($this->table)->row();\n }", "function get($id) {\r\n //devuelve el objeto entero\r\n $parametros = array();\r\n $parametros[\"id\"] = $id;\r\n $this->bd->select($this->tabla, \"*\", \"id =:id\", $parametros);\r\n $fila = $this->bd->getRow();\r\n $mecanico = new Mecanico();\r\n $mecanico->set($fila);\r\n return $mecanico;\r\n }", "public static function getRecordInDB($id_luogo){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $id_luogo = DB_Functions::esc($id_luogo);\r\n $query = \"SELECT *\r\n FROM \t LUOGO\r\n\t WHERE\t ID_LUOGO = $id_luogo;\";\r\n $resQuery = $db->executeQuery($query);\r\n //Se ho un recordset\r\n if (count($resQuery[\"response\"][]) == 1) {\r\n $luogo = new Luogo($resQuery[\"response\"][0][0],$resQuery[\"response\"][0][1],$resQuery[\"response\"][0][2]);\r\n return $luogo;\r\n }\r\n else\r\n return null;\r\n }", "function get_by_id($id)\n {\n\t\t$this->db->join('ppi_tb_infeksi', 'ppi_tb_infeksi.id_infeksi = ppi_tb_nilai.id_infeksi');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function get_by_id($id)\n {\n $query = $this->db->select('permohonan.id, permohonan.notrans, permohonan.id_karyawan, permohonan.tanggal, permohonan.pengikut,\n permohonan.tujuan, permohonan.keterangan, permohonan.bbm, permohonan.is_driver, permohonan.datetime,\n permohonan.status, mst_karyawan.nama, mst_karyawan.jabatan')\n ->from('permohonan')\n ->join('mst_karyawan', 'permohonan.id_karyawan = mst_karyawan.id')\n ->where('permohonan.id', $id)\n ->get()->row();\n return $query;\n }", "function readOne() {\n $query = \"SELECT\n id, name, description, created \n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n $stmt = $this->conn->prepare($query);\n \n $stmt->bindParam(1, $this->id); //ambil id dr bukunya\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC); //mengembalikan barisnya\n\n //set values objek bukunya berdasarkan id tadi\n $this->name = $row['name'];\n $this->description = $row['description'];\n $this->created = $row['created'];\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM cbt_jadwal_ujian WHERE id_jadwal = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "protected function getRecordById(int $id): object\n {\n return $this->db->query(\"SELECT * FROM \" . $this->db_table . \" WHERE id = '\" . $id . \"'\");\n\n }", "public function dohvSmestaj($id){\n return ($this->where('id',$id)->find());\n }", "public function data($id = null)\n\t{\n if($id != null)\n {\n return $this->db->get($this->table, \"*\", [$this->primaryKey => $id]);\n }\n else\n {\n // return $this->db->query(\"SELECT bidang.*, pegawai.nama FROM bidang JOIN pegawai ON bidang.nip = pegawai.nip\")->fetchAll(PDO::FETCH_ASSOC);\n return $this->db->query(\"SELECT * from bidang\")->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function findById($id)\n\t{\n\t\treturn Rujukan::findOrFail($id);\n\t}", "public function getById4($id)\n {\n //$this->db->select('tabel_lapak.*, tabel_peminjaman.kd_pengguna as kd');\n $this->db->from('tabel_lapak');\n //$this->db->join('tabel_lapak', 'tabel_lapak.kd_lapak = tabel_peminjaman.kd_lapak');\n $this->db->join('tabel_pengguna', 'tabel_pengguna.kd_pengguna = tabel_lapak.kd_pengguna');\n $this->db->where('tabel_lapak.kd_lapak', $id);\n $query = $this->db->get();\n return $query->result();\n }", "public function tampilData($id=null){\n if($id!=null)\n \t{return self::find($id);}\n else\n {return self::all();}}", "public function GetPlayerById( $id=NULL )\n {\n $player = new stdClass;\n\n if (!$id)\n return $player;\n\n $this->db->select(\"*\");\n $this->db->from('primary_info AS prim');\n $this->db->join('additional_info AS addi', 'prim.ID = addi.ID', 'INNER'); \n $this->db->where('prim.ID=' . $id);\n $query = $this->db->get();\n\n if ($query->num_rows() == 0)\n return $player;\n\n $row = $query->row();\n $player = array(\n \"ID\"=> $row->ID,\n \"Name\"=> $row->Name,\n \"Age\"=> $row->Age,\n \"Location\"=> array(\n \"City\"=> $row->City,\n \"Province\"=> $row->Province,\n \"Country\"=> $row->Country\n )\n );\n\n return array(\"Player\"=> $player);\n }", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function readById($id = 0){\r\n\t\t\t$pessoa = new Pessoa();\r\n\t\t\t$pessoa->setId($id);\t\t\t\r\n\t\t\t$this->pessoaModel->read($pessoa);\r\n\t\t}", "public static function findById($id) {\r\n /* Connexion à la base de données */\r\n $c = Base::getConnection();\r\n\r\n /* Préparation de la requête */\r\n $query = $c->prepare(\"select * Tracks where track_id=?\");\r\n $query->bindParam(1, $id, PDO::PARAM_INT);\r\n\r\n /* Exécution de la requête */\r\n $query->execute();\r\n\r\n /* Récupération du résultat */\r\n $d = $query->fetch(PDO::FETCH_BOTH);\r\n\r\n /* Création d'un Objet */\r\n $track = new Tracks();\r\n $track->artist_id = $d['artist_id'];\r\n $track->track_id = $d['track_id'];\r\n $track->title = $d['title'];\r\n $track->mp3_url = $d['mp3_url'];\r\n\r\n\r\n return $track;\r\n }", "public function find($id) {\r\n\t\t$this->query = \"SELECT * FROM \" . strtolower($this->table) . \" WHERE id=\" . $id;\r\n\r\n\t\t# Make the query\r\n\t\t$result = $this->connection->query($this->query) or die(\"Query could not be made. find()\");\r\n\r\n\t\t# Fetch the data\r\n\t\t$result = $result->FetchAll();\r\n\r\n\t\t/*# Convert array to object, so we can use -> instead of ['']\r\n\t\t$result = json_decode(json_encode($result), FALSE);*/\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $result;\r\n\t}", "private function findModel($id)\n {\n return Pekerjaan::findOne($id);\n }", "function getData($id){\n // ineed to be more clear about where to get this data because i need to nkow where i should pick up this data from?\n return $this->db->get_where(\"mahasiswa\",array('nim' => $id))->row();\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM recibo WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "function get_by_id($id) {\r\n $params=array('pm_id'=>$id);\r\n $data = $this->create_mapper($this->table)->where($params)->find_by();\r\n $ret_status = $data ? 1 : 'op_no_data';\r\n //处理关联代码表\r\n //filter_fk_name($data, array('cp_createuser|osp_user_id','cp_updateuser|osp_user_id'));\r\n\r\n return $this->format_ret($ret_status, $data);\r\n }", "function get_tahun_pelajaran($id)\n {\n return $this->db->get_where('tahun_pelajaran',array('id'=>$id))->row_array();\n }" ]
[ "0.6934036", "0.69276386", "0.6831777", "0.68143845", "0.6805445", "0.6754368", "0.6731786", "0.6726121", "0.6718789", "0.670724", "0.666681", "0.6655262", "0.6635503", "0.661996", "0.66077346", "0.65986395", "0.6597401", "0.65945464", "0.6589255", "0.65632594", "0.6561073", "0.6552514", "0.6549175", "0.6532681", "0.65280694", "0.6516069", "0.6512492", "0.65049857", "0.64994156", "0.64952236" ]
0.6951679
0
/ Fungsi ini menginsertkan data ke dalam tabel pokemon. Parameter $data berisi data yang akan diinsertkan dalam bentuk associative array yang terdiri dari pasangan key=>value. Key adalan nama field, sedangkan value adalah nilai field
public function insert($data){ // TODO: Modif bagian ini $this->db->insert('pokemon', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertPelatihData($data){\n\t\t\t$id_propinsi = $data['id_propinsi'];\n\t\t\t$id_cabor = $data['id_cabor'];\n\t\t\t$pelatih = $data['pelatih'];\n $id_jk = $data['id_jk']; \n\t\t\t$alamat = $data['alamat']; \n\t\t\t\n $query = \"Insert into tbl_pelatih\n set id_propinsi='$id_propinsi',\n id_cabor='$id_cabor',\n pelatih='$pelatih',\n alamat='$alamat',\n id_jk='$id_jk'\";\n \n $result = $this->query($query);\n\n return $result;\n }", "public function insertBarang($data)\n {\n //menyimpan data ke tabel\n $this->insert($data);\n }", "function insert_pesan($data)\n\t{\n\t\t$this->db->insert('kotak_masuk', $data);\n\t}", "public function setDataLaporan($data) {\n $this->db->insert($this->table,$data); \n }", "function tambah_data($tabel,$data)\n {\n // http://thisinterestsme.com/pdo-prepared-multi-inserts/\n $rowsSQL = array();\n // buat bind param Prepared Statement\n $toBind = array();\n // list nama kolom\n $columnNames = array_keys($data[0]);\n // looping untuk mengambil isi dari kolom / values\n foreach($data as $arrayIndex => $row){\n $params = array();\n foreach($row as $columnName => $columnValue){\n $param = \":\" . $columnName . $arrayIndex;\n $params[] = $param;\n $toBind[$param] = $columnValue;\n }\n $rowsSQL[] = \"(\" . implode(\", \", $params) . \")\";\n }\n $sql = \"INSERT INTO $tabel (\" . implode(\", \", $columnNames) . \") VALUES \" . implode(\", \", $rowsSQL);\n $row = $this->db->prepare($sql);\n //Bind our values.\n foreach($toBind as $param => $val){\n $row ->bindValue($param, $val);\n }\n //Execute our statement (i.e. insert the data).\n return $row ->execute();\n }", "public function insert($data) \n\t{\n\t\t$sql = \"INSERT INTO `\" . $this->table . \"`\" . $this->_splitFieldStr() . ' VALUES';\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$sql .= '(' . $this->_splitAddData($value) . '),';\n\t\t}\n\t\t//remove last ','\n\t\t$sql = substr($sql, 0, -1) . ';';\n\t\t\n\t\t$this->query($sql);\n\t}", "function insertData($table, $data){\n\t\t\n\t\tvalidate();\n\n\t\t$values = $cols = \"\";\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$cols .= \" \" . $key . \",\";\n\t\t\t$values .= \" \" . $value . \",\";\n\t\t}\n\n\t\t$cols = substr($cols, 0, strlen($cols) - 1);\n\t\t$values = substr($values, 0, strlen($values) - 1);\n\n\t\t$query = \"INSERT INTO $table ($cols) VALUES ($values)\";\n\n\t\t\n\t\ttry {\n\n\t\t\t$pdo = db_init();\n\n\t\t\t$pdo->exec($query);\n\n\t\t\treturn 1;\n\t\t} catch (PDOException $e) {\n\t\t\tlogging($_SERVER['PHP_SELF'] . \", 112, Error Insert Data:\". $e->getMessage() .\" ,\" . date(\"Y-m-d\") . \" \" . date(\"h:i:sa\"));\n\t\t\treturn;\n\t\t}\n\n\t}", "function insert_laporan($data){\n\t\t$this->db->insert( 'tb_laporan_ortu', $data );\n\t}", "public function insertData($table, $data){// method inserData body start\n\t\t$fields \t\t\t= array_keys( $data );\n\t\t//$values \t\t\t= array_map( \"mysql_real_escape_string\", array_values( $data ) );\n\t\t$values \t\t\t= array_values( $data );\n\t\t$query \t\t\t\t= \"INSERT INTO $table(\".implode(\",\",$fields).\") VALUES ('\".implode(\"','\", $values ).\"');\";\n\t\t$execute \t\t\t= $this->query($query);\n\t\t\n\t}", "public function insertAjuanPindahD(array $data) {\n\t $registry = Zend_Registry::getInstance();\n\t $db = $registry->get('db');\n\t \n\t try {\n\t $db->beginTransaction();\n\t $atk_mast_prm = array(\"i_barang_ajuanpindah\" \t=>$data['noPindah'],\n\t \"d_anggaran\" \t\t\t\t=>$data['thnang'],\n\t\t\t\t\t\t \"c_barang\" \t\t\t\t\t=>$data['kdbrg'],\n\t\t\t\t\t\t \"i_aset_awal\" \t\t\t\t=>$data['noaset'],\n\t\t\t\t\t\t \"d_perolehan\" \t\t\t\t=>$data['tglPerl'],\n\t\t\t\t\t\t\t \"q_barang\" \t\t\t\t=>$data['jml'],\n\t\t\t\t\t\t\t \"i_ruang_baru\" \t\t\t=>$data['ruang'],\n\t\t\t\t\t\t\t \"i_ruang\" \t\t\t\t\t=>$data['Nourut'],\n\t\t\t\t\t\t\t \"e_keterangan\" \t\t\t=>$data['ktr'],\n\t\t\t\t\t\t\t \"i_entry\" \t\t\t\t=>$data['nuser'],\n\t\t\t\t\t\t \"d_entry\" \t\t\t\t=>date(\"Y-m-d\"));\n\t\t\n\t\t\n \t\t $db->insert('aset.tm_ajuanpindahinv_item',$atk_mast_prm);\n\t\t $db->commit();\n\t return 'sukses';\n\t } catch (Exception $e) {\n $db->rollBack();\n echo $e->getMessage().'<br>';\n\t return 'gagal';\n\t }\n\t}", "public function tambah($data){\n\t\t$this->db->insert('pinjam_uang', $data);\n\t}", "function Insert($data)\n\t{\n\t\t$this->Crash();\n\n\t\tif(!is_array($data))\n\t\t\treturn false;\n\t\t\t\n\t\t$values = array_values($data);\n\t\t$keys \t= array_keys($data);\n\t\t\n\t\t$table = $this->table;\n\t\t$query = \"INSERT INTO {DA}$table (\" . implode(',', $keys) . \") VALUES ('\" . implode('\\',\\'', $values) . \"')\";\n\t\t\n\t\t$this->query = $query;\n\t\t$this->type = \"INSERT\";\n\t}", "public function addData2($data)\n {\n DB::table('tbl_laporanmasuk')->insert($data);\n }", "public function insert(array $data)\n {\n $query = \"INSERT INTO $this->table (\";\n foreach($data as $key=>$value){\n $queryKey[] = $key;\n }\n $query .= implode(', ', $queryKey);\n $query .= ') VALUES (:';\n $query .= implode(', :', $queryKey);\n $query .= ')';\n $statement = $this->pdoConnection->prepare($query);\n foreach($data as $key=>$value){\n $statement->bindValue($key, $value);\n }\n $statement->execute();\n }", "public function InsertData($table,$data){\n\t\tif(!empty($data) && is_array($data)){\n\t\t\t$columns = '';\n\t\t\t$values = '';\n\t\t\t$i = 0;\n\t\t\t$columnString = implode(',', array_keys($data));\n\t\t\t$valueString = \":\".implode(',:', array_keys($data));\n\t\t\t$sql = \"INSERT INTO \".$table.\" (\".$columnString.\") VALUES (\".$valueString.\")\";\n\t\t\t//echo $sql;exit;\n\t\t\t$query = $this->db->prepare($sql);\n\t\t\tforeach($data as $key=>$val){\n\t\t\t // print_r($val);\n\n\t\t\t\t $query->bindValue(':'.$key, $val);\n\t\t\t}//exit;\n\t\t\t$insert = $query->execute();\n\t\t\treturn $insert?$this->db->lastInsertId():false;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function insert($data);", "public function insert($data)\r\n {\r\n \r\n }", "public function addData($data)\n {\n DB::table('tbl_laporankeluar')->insert($data);\n }", "function tambah_data ($data){\n\t\treturn $this->db->insert($this->nama_table,$data);\n\t}", "function input_data($data,$table){\n\t\t$this->db->insert($table,$data);//menginputkan data ke database dengan function input_data\n }", "public function doInsert( $data ) {\t\t\r\n\r\n\t\t\r\n\t\t\t\t$newRow = $this->createRow();\r\n\t\t\t\r\n\t\t\t\tforeach ( $newRow->toArray() as $key => $v ) {\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t$newRow[ $key ] = Class_array::getValue( $data, $key );\r\n\t\t\t\t\r\n }\r\n\t\t\t\t$newRow->save();\t\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\treturn $newRow;\r\n\t\t\t\r\n\t\t//}\r\n\t}", "public function add($data){\n $this->db->insert('tbl_petugas', $data);\n\n }", "public function insert($table, $data)\n {\n\n ksort($data);\n\n $fieldNames = implode(',', array_keys($data));\n $fieldValues = ':'.implode(', :', array_keys($data));\n $query = \"INSERT INTO $table ($fieldNames) VALUES($fieldValues)\";\n\n $this->prepareQuery($query);\n\n foreach ($data as $key => $value) {\n $this->bind(\":$key\", $value);\n }\n $this->executeQuery($this->statement);\n }", "public function insertar($data){\n\t\t\t$this->db->insert('tareas',array(\n\t\t\t\t'titulo'=>$data['titulo'],\n\t\t\t\t'descripcion'=>$data['descripcion'],\n\t\t\t\t'id_estado'=>1,\n\t\t\t\t'fecha_alta'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_modificacion'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_baja'=>null\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function insert(array $data);", "public function insert(array $data);", "function inputdata($data)\n\t{\n\t\t$this->db->insert($this->table, $data);\n\t}", "public function insert_data( $data,$table)\n {\n \n $this->db->insert('sewa',$data);\n \n }", "function insertData($data){\r\n\t\t$res = $this->db->insert('ruangan_ujian', $data);\r\n\t\tif($res){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function insertData($data) {\n $query = \"INSERT INTO \".$this->table.\" VALUES (null, :nama, :npm, :email)\";\n\n // menjalankan tambah data\n $this->db->query($query);\n\n // melakukan binding\n $this->db->bind('nama', $data['nama']);\n $this->db->bind('npm', $data['npm']);\n $this->db->bind('email', $data['email']);\n\n // mengeksekusi tambah data\n $this->db->execute();\n\n // mengembalikan nilai, yaitu rowCount() yg ada di file Database.php di folder core\n return $this->db->rowCount();\n }" ]
[ "0.7719132", "0.7715798", "0.7594088", "0.74658656", "0.7414373", "0.73584265", "0.7336784", "0.7336276", "0.73210496", "0.7268005", "0.72430235", "0.7226111", "0.722541", "0.71888554", "0.7180806", "0.7152618", "0.71395487", "0.71135896", "0.7106051", "0.7098018", "0.7088778", "0.70822936", "0.70619667", "0.70556206", "0.6966892", "0.6966892", "0.69594985", "0.69511193", "0.6917495", "0.6914111" ]
0.81122524
0
/ Fungsi ini mengupdate data ke dalam tabel pokemon yang memiliki id=$id. Parameter $data berisi data yang akan diinsertkan dalam bentuk associative array yang terdiri dari pasangan key=>value. Key adalan nama field, sedangkan value adalah nilai field
public function update($data, $id){ // TODO: Modif bagian ini $this->db->where('id', $id); $this->db->update('pokemon', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(array $data,$id);", "public function update($table, $data, $id) {\n ksort($data);\n\n $fieldDetails = null;\n foreach($data as $key => $value) {\n $fieldDetails .= \"`$key` = :$key,\";\n }\n\n $fieldDetails = rtrim($fieldDetails, ',');\n\n $sth = $this->prepare(\"UPDATE $table SET $fieldDetails WHERE id = $id\");\n\n foreach($data as $key => $value) {\n $sth->bindValue(\":$key\", $value);\n }\n\n $sth->execute();\n }", "public static function update($data , $id)\n {\n self::_update(self::tableName(), $data, 'id = '. $id);\n }", "public function update(array $data, $id);", "public function update(array $data, $id);", "public function update($data, $id)\n\t{\n\t\t$this->db->where('id_paket_wisata', $id);\n\t\treturn $this->db->update('tbl_paket_wisata', $data);\n\t}", "public function update(array $data, int $id)\n {\n }", "function update_data($id, $data){\n $sql = \"UPDATE items SET name=:v1, photo=:v2, price:=:v3, discount=:v4, discription=:v5, brand_id=:v6, sub_category=:v7 WHERE id = :v8\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->bindValue(':v1', $data['name']);\n $stmt->bindValue(':v2', $data['photo']);\n $stmt->bindValue(':v3', $data['uprice']);\n $stmt->bindValue(':v4', $data['dprice']);\n $stmt->bindValue(':v5', $data['disre']);\n $stmt->bindValue(':v6', $data['brandid']);\n $stmt->bindValue(':v7', $data['subcategoryid']);\n $stmt->bindValue(':v8', $id);\n $stmt->execute();\n $rows = $stmt->rowCount();\n return $rows;\n }", "public function update(array $data, $id)\n {\n }", "public function update(array $data, $id)\n {\n }", "static public function update(array $data, $id){\n $db = Database::connect();\n\n if(count($data) > 0) {\n $valueData = \"\";\n\n foreach ($data as $key => $value) {\n\n $valueData .= $key. \"= '\".$value.\"',\";\n }\n\n $value = explode(',', $valueData);\n array_pop($value);\n $valueData = implode(',', $value);\n\n\n// $title = $data['title'];\n// $description = $data['description'];\n $sql = $db->query(\"UPDATE \". self::DB_USER. \" SET \". $valueData . \" WHERE id = '$id'\");\n if($sql) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function update($id, Array $data)\r\n {\r\n }", "public function update(array $data, $id)\n {\n DB::connection('cadeco')->beginTransaction();\n try {\n\n\n DB::connection('cadeco')->commit();\n } catch (\\Exception $e) {\n DB::connection('cadeco')->rollback();\n throw $e;\n }\n }", "function updateData($data,$id)\n\t{\n\t\tdbIdReport('update','update Benefit',json_encode($data), 100);\n\t\t$this->db->where('ben_id', $id);\n\t\t$this->db->update($this->table, $data);\n\t\t$str = $this->db->last_query();\t\n\t\tlogConfig(\"update Benefit:$str\",'logDB');\n\t\t\n\t}", "function updateData($table,$data,$id){\n\t\treturn $this->db->update($table,$data,$id);\n\t}", "public function updateDataPelamar($id_pelamar, $data) {\n\t\t$this->db->where('id_pelamar', $id_pelamar);\n\t\t$this->db->update('pelamar', $data);\n\t}", "public function updateMahasiswa($id, $data){\n $this->db->query(\"UPDATE $this->tabel SET nim=:nim, nama=:nama, email=:email, jurusan=:jurusan WHERE id=:id\");\n \n $this->db->bind('id', $id);\n $this->db->bind('nim', $data['nim']);\n $this->db->bind('nama', $data['nama']);\n $this->db->bind('email', $data['email']);\n $this->db->bind('jurusan', $data['jurusan']);\n\n $this->db->execute();\n\n return $this->db->rowCount();\n }", "public function update($id = 0, $data = null){\r\n\t\t\t$pessoa = $this->convertType($data);\t\t\t\r\n\t\t\t$pessoa->setId($id);\r\n\t\t\t\r\n\t\t\t$result = $this->validacao($pessoa, true);\r\n\r\n\t\t\tif($result != \"\"){\r\n\t\t\t\techo json_encode([\"result\" => $result]);\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\r\n\t\t\t$this->pessoaModel->update($pessoa);\r\n\t\t\t//return json_enconde($this->pessoaModel->update($pessoa));\r\n\t\t}", "function update($id, $data)\n {\n $this->db->where($this->id,$id);\n $this->db->update($this->table, $data);\n }", "public function edit($data){\n\t\t$this->db->where('id_pinjam',$data['id_pinjam']);\n\t\t$this->db->update('pinjam_uang', $data);\n\n\t}", "public function update($data,$id){\n\t\t\n\t\t $this->db->where($this->pro->booking.\"_id\",$id);\n\t\t return $edit = $this->db->update($this->pro->prifix . $this->pro->booking,$data);\n\t}", "public function editDataProduk($id_produk, $data)\n {\n DB::table('tbl_produk')\n ->where('id_produk', $id_produk)\n ->update($data);\n }", "function summons_details_update($data,$id)\n\t{\n\t$this->db->where('id', $id);\n\t$this->db->update('summons_details', $data);\n\t}", "public function update_data($id, $data)\n {\n $this->builder->where('id', $id);\n $this->builder->update($data);\n }", "public function update(array $data, $id)\n {\n $hatarakiKata = $this->hatarakiKata->find($id);\n return $hatarakiKata->update($data);\n }", "public static function updateBesttj($data, $id) {\n\t\tif (!is_array($data)) return false;\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->update($data, intval($id));\n\t}", "public function simpan_edit_blok($data, $id)\n\t{\n\t\t$this->db->where('id_blok', $id);\n\t\t$this->db->update('blok', $data);\n\n\t\treturn $a = $this->db->affected_rows();\n\t}", "public function update($id, $data)\n\t{\n $this->db->where('id', $id);\n $this->db->update('alumns', $data);\n\t}", "public function update($id, array $data);", "public function update($id, array $data);" ]
[ "0.7779599", "0.7722161", "0.76445174", "0.7618924", "0.7618924", "0.76027757", "0.75605583", "0.75583416", "0.7508149", "0.7508149", "0.74330646", "0.74326295", "0.7426929", "0.74160767", "0.7403957", "0.7372681", "0.7363193", "0.7359774", "0.7357888", "0.73563534", "0.7336027", "0.73141754", "0.7314067", "0.73111033", "0.73034525", "0.7299039", "0.72862226", "0.72834295", "0.72660536", "0.72660536" ]
0.83605504
0
grabs all guests from the database and puts them in ana array of objects
public function showGuests(){ $sql = "SELECT * FROM " . $this->tblGuest; //execute the query $query = $this->dbConnection->query($sql); //if the query failed if(!$query) { header("Location: index.php?action=error&message=No guest was found."); exit; } //if the query succeeded, but no movie was found if($query->num_rows === 0) { return 0; } $guests = array(); //puts the query into an object while($obj = $query->fetch_object()){ $guest = new Guest($obj->guest_id, $obj->first_name, $obj->last_name, $obj->birth_date, $obj->email); //add the movie to the array $guests[] = $guest; } return $guests; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all()\n {\n return Guests::all();\n }", "public function getAllGuests ($data)\n {\n //$columns = $data['columns'];\n $order = $data['order'][0];\n $columns = [ \"name\", \"city\", \"state\", \"email\", \"mobile_no\" ];\n $column_name = $columns[$order['column']];\n\n $sort = $order['dir'];\n $search = $data['search']['value'];\n $query = Guests::select('guests.id as guest_id', 'guests.name', 'guests.email', 'guests.mobile_no', 'guests.city', 'guests.state', 'guests.country', 'guests.address', 'guests.id')\n ->where([ 'is_active' => 1 ]);\n if (trim($search)) {\n $query->where(function ($query) use($search, $columns) {\n foreach ($columns as $key => $value) {\n $query->orwhere(\\DB::raw('lower('.$value.')'), 'like', '%'.$search.'%');\n }\n });\n }\n $count = $query->count();\n $query->skip($data['start'])->take($data['length']);\n\n $query->orderby($column_name, $sort);\n\n $result = $query->get()->toArray();\n return [ \"count\" => $count, \"data\" => $result ];\n }", "function listAll() \r\n {\r\n \r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [];\r\n\r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches;\", $bindParams);\r\n\r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n\r\n }", "function retrieve_all_guest_lists(){\n\t\t\n\t\t$this->CI->load->model('model_guest_lists', 'guest_lists', true);\n\t\treturn $this->CI->guest_lists->retrieve_day_guest_lists($this->promoter->up_id, false, $this->promoter->t_fan_page_id);\n\t\t\n\t}", "public function gestores(){\n\t\t$gestores = $this->query(\"SELECT id, Nombre, Clave, supervisor FROM gestors AS Gestor WHERE Activo=1\");\n\t\treturn $gestores;\n\t}", "public static function getHotelAsArray() {\n \t$table = new Hotel();\n \t$where = $table->select()->order(\"name ASC\");\n \t$rows = $table->fetchAll($where);\n \t$ret = array();\n \tforeach ($rows as $row) {\n \t\t$ret[$row->id] = $row->name;\n \t}\n \treturn $ret;\n }", "function allMembers()\r\n {\r\n\n $select = 'SELECT member_id, username, firstname, lastname email, password, image FROM atlas_members ORDER BY member_id';\r\n\n $results = $this->_pdo->query($select);\r\n \r\n $resultsArray = array();\r\n \r\n //map each pet id to a row of data for that pet\r\n while ($row = $results->fetch(PDO::FETCH_ASSOC)) {\r\n $resultsArray[$row['member_id']] = $row;\r\n }\r\n \r\n return $resultsArray;\r\n }", "public static function all() {\n $result = mysqli_query( Connection::getConnection(), \"Select * from users\" );\n $nRows= mysqli_num_rows($result);\n $users=[];\n for($i=0; $i < $nRows; $i++) {\n $user = mysqli_fetch_assoc($result);\n $users[$i] = new User(\n $user['id'],\n $user['name'],\n $user['email'],\n $user['type'],\n $user['patchImage']);\n }\n return $users;\n }", "public function getAll() {\n $result = array();\n $stm = $this->conn->query('SELECT * FROM VAGAS ');\n if($stm) {\n while($row = $stm->fetch(PDO::FETCH_OBJ)) {\n $VAGAS = new vaga(); \n\t\t\t\t\t$VAGAS->setId($row->id);\n\t\t\t\t\t$VAGAS->setN_vagas($row->nvagas);\n\t\t\t\t\t$VAGAS->setRemun($row->remun);\n\t\t\t\t\t$VAGAS->setAtividades($row->atividades);\n\t\t\t\t\t$VAGAS->setHorario($row->horario);\n $result[] = $VAGAS;\n }\n }\n return $result;\n\t\t\n }", "public function getList(){\r\n \r\n $sql = \"SELECT * FROM ESTADO_USUARIO\";\r\n $ests = array();\r\n if(!$resultado = pg_Exec($this->conexion, $sql));\r\n\r\n while($row = pg_fetch_array($resultado))\r\n { \r\n $est = New Status_User();\r\n $est->setCod_estado($row[0]);\r\n $est->setNom_estado($row[1]);\r\n $ests[] = $est;\r\n }\r\n return $ests;\r\n }", "public function index()\n {\n return Guest::all();\n }", "private function get_all() {\n $result = $this->dbh->query($this->query_array['get_all'], array())->fetchAll();\n $users = [];\n foreach ($result as $row) {\n $user = new User($row['id'], $row['username']);\n $users[] = $user->to_array();\n }\n return $users;\n }", "function fetchEntorno() {\n\n $entornos = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM entorno\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id = $row['id'];\n $nombre = $row['nombre'];\n $entorno = new Entorno($id, $nombre);\n array_push($entornos, $entorno);\n }\n\n return $entornos;\n }", "public function get_all_eleves()\n {\n\n $requete = \"SELECT id, nom, prenom, date_naissance, moyenne, appreciation FROM eleve\";\n $eleves = $this->Db_connect->prepare($requete);\n $eleves->setFetchMode(PDO::FETCH_CLASS, Eleve::class);\n $eleves->execute();\n $eleves = $eleves->fetchAll();\n\n\n return $eleves;\n }", "function getVentas()\n{\n\t$con = getDBConnection();\n\t$sql = \"SELECT * FROM ventas\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->execute();\n\t$ventas = null;\n\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$venta = new Venta();\n\t\t$venta->setFolio($row['folio']);\n\t\t$venta->set($row['fecha'],$row['monto'],$row['descripcion']);\n\t\t$ventas[] = $venta;\n\t}\n\treturn $ventas;\n}", "public function findAll() {\r\r\n\r\r\n $result = array();\r\r\n $query = \"SELECT * FROM participant WHERE date_deletion_participant IS NULL\";\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute();\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }", "protected function votstdyDb() {\r\n $votstdy =[];\r\n $resql = $this->conn->sqlExec(\"SELECT `item` FROM `$this->votusers` WHERE `nextv`>$this->time AND `voter`='$this->voter'\");\r\n $num_rows = $this->conn->num_rows;\r\n if($num_rows >0) {\r\n for($i=0; $i<$num_rows; $i++) {\r\n $votstdy[] = $resql[$i]['item'];\r\n }\r\n }\r\n\r\n return $votstdy;\r\n }", "public function getArrayAllEngineers(){\n $query = $this->db->query(\"\n SELECT \n CONCAT(n_name_user, ' ', n_last_name_user) AS name, \n k_id_user AS id\n FROM user WHERE n_role_user = 'ingeniero'\n \");\n $ingenieros = [];\n for ($i=0; $i < count($query->result_array()); $i++) { \n $ingenieros[$i]['name'] = $query->result_array()[$i]['name'];\n $ingenieros[$i]['id'] = $query->result_array()[$i]['id'];\n }\n return $ingenieros;\n }", "public static function findAll():array \r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"SELECT * FROM puesto;\");\r\n\r\n $datos=[];\r\n while ($puesto = $db->getObjeto(\"Puesto\")) {\r\n array_push($datos, $puesto); \r\n }\r\n\r\n return $datos;\r\n }", "function getParticipantsForMeetings($array)\n {\n $result = array();\n for ($i=0; $i < count($array); $i++) {\n $bookingID = $array[$i][\"id\"];\n\n $obj = $array[$i];\n\n $query = $this->db->query(\"SELECT bookingID, users.* from booking_invitations join users on users.id = booking_invitations.userID where bookingID = $bookingID\");\n if($query->num_rows()>0)\n {\n $obj[\"users\"] = $query->result_array();\n\n }\n else\n {\n $obj[\"users\"] = array();\n\n }\n\n array_push($result, $obj);\n }\n\n return $result;\n }", "public function getElections() {\n $sql = \"SELECT id, jsonData, electionTitle,\n beginDate, endDate, coefficients, appVersion\n FROM tbl_elections\";\n $stmt = $this->db->query($sql);\n $results = [];\n while($row = $stmt->fetch()) {\n $results[] = new ElectionEntity($row);\n }\n return $results;\n }", "public function findAll()\n {\n $sql = \"SELECT rowid, * FROM USER\";\n $result = $this->getDb()->fetchAll($sql);\n $entities = array();\n foreach ($result as $row) {\n $id = $row['rowid'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n return $entities;\n }", "function getBookings(){\r\n\t\t$inx = 0;\r\n\t\t$arrbook = array();\r\n\t\t$conn = getConnection();\r\n //These are the specific fields\r\n $stmt = $conn->prepare(\"SELECT B.idreservations, B.rs_checkin, B.rs_checkout, G.gs_name FROM booking B, guests G where G.reservations_idreservations = B.idreservations\");\r\n \r\n $stmt->execute();\r\n\r\n $result = $stmt->get_result();\r\n\r\n if($result->num_rows > 0){\r\n \twhile($row = $result->fetch_assoc()){\r\n \t\t$arrbook[$inx][0] = $row['rs_checkin'];\r\n \t\t$arrbook[$inx][1] = $row['gs_name'];\r\n \t\t$arrbook[$inx][2] = $row['rs_checkout'];\r\n $arrbook[$inx][3] = $row['idreservations'];\r\n $inx++;\r\n \t}\r\n }\r\n $conn->close(); \r\n\r\n return $arrbook;\r\n\t}", "public static function arrayFromDb ($condition = NULL) {\n\n # Build the query to get all the users\n $q = 'SELECT * \n FROM venues\n ORDER BY name';\n\n if (isset($condition))\n $q = $q.\" \".$condition;\n \n # Execute the query to get all the venues.\n $venue_rows = DB::instance(DB_NAME)->select_rows($q);\n\n $venues = array();\n\n foreach ($venue_rows as $venue_row) {\n $venue = new Venue();\n $venue->populateFromDb($venue_row);\n $venues[] = $venue;\n }\n \n return $venues; \n }", "public function findAll() {\n\n\t\t$stmt = $this->db->query(\"SELECT * FROM encuestas, usuarios WHERE usuarios.email = encuestas.email\");\n\t\t$encuestas_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$encuestas = array();\n\n\t\tforeach ($encuestas_db as $encuesta) {\n\n\t\t\t$email = new Usuario($encuesta[\"email\"]);\n\t\t\tarray_push($encuestas, new Encuesta($encuesta[\"idEncuesta\"], $encuesta[\"titulo\"], $encuesta[\"link\"], $email));\n\t\t}\n\n\t\treturn $encuestas;\n\t}", "function findBooking() : array\n{ \n $db = new Database;\n $db = $db->dbConnect();\n\n $sql = \"SELECT booking.id, booking_date_debut, booking_time_debut, booking_date_fin, booking_time_fin, number_of_seats, user_i, last_name, first_name, mail \n FROM booking \n INNER JOIN user ON user.id = booking.user_i \";\n $adminGetBooking = $db->query($sql);\n $adminGetBooking = $adminGetBooking->fetchAll();\n return $adminGetBooking;\n}", "public static function fetchAll() {\n $db = new PDO(DB_SERVER, DB_USER, DB_PW);\n // 2. Prepare the query\n $sql = 'SELECT * FROM Turbine';\n $statement = $db->prepare($sql);\n // 3. Run the query\n $success = $statement->execute();\n // 4. Handle the results\n $arr = [];\n while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n $theTurbine = new Turbine($row);\n array_push($arr, $theTurbine);\n }\n return $arr;\n }", "public function allActive()\n {\n return Guests::where(array('is_active' => 1))->get();\n }", "public function getMembers() {\r\n\r\n //statement of resources\r\n $user = array();\r\n\r\n //sql connection\r\n $connect = connection::getInstance();\r\n\r\n //user sql request\r\n $sql = \"SELECT* FROM users\";\r\n //sending request\r\n\r\n\r\n\r\n $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());\r\n\r\n while ($data = mysql_fetch_assoc($req)) {\r\n //scenario creation\r\n $data['nameU'] = Users::secure($data['nameU']);\r\n $data['IDU'] = Users::secure($data['IDU']);\r\n $data['typeU'] = Users::secure($data['typeU']);\r\n $data['admin'] = Users::secure($data['admin']);\r\n $data['password'] = Users::secure($data['password']);\r\n\r\n $users[] = new User($data['nameU'], $data['IDU'], $data['typeU'], $data['admin'], $data['password']);\r\n }\r\n\r\n return $users;\r\n }", "public function getReservaciones() {\n $pdo = Database::connect();\n $sql = \"select * from reservacion order by id_reservacion\";\n $resultado = $pdo->query($sql);\n //transformamos los registros en objetos:\n $listadoReserva = array();\n foreach ($resultado as $res) {\n $reservacion = new reservacion($res['nombre_paciente'], $res['id_medico'], $res['id_reservacion'], $res['descripcion'], $res['nota'], $res['fecha_cita'], $res['hora_cita'], $res['fecha_creacion']);\n array_push($listadoReserva, $reservacion);\n }\n Database::disconnect();\n //retornamos el listado resultante:\n return $listadoReserva;\n }" ]
[ "0.69462174", "0.6508767", "0.63852787", "0.6362764", "0.6192368", "0.6188804", "0.618514", "0.61578417", "0.61557776", "0.6137923", "0.6130227", "0.6111321", "0.6092686", "0.6079987", "0.60543424", "0.6051006", "0.6026215", "0.60250866", "0.60235345", "0.60131276", "0.60085356", "0.5994197", "0.5986189", "0.59743035", "0.59689295", "0.59509474", "0.5948694", "0.593053", "0.5924725", "0.59195423" ]
0.78228486
0
Get the editor href for a given file and line, if available.
protected function getEditorHref($filePath, $line) { if (empty(config('debugbar.editor'))) { return null; } if (empty($this->editors[config('debugbar.editor')])) { throw new InvalidArgumentException( 'Unknown editor identifier: ' . config('debugbar.editor') . '. Known editors:' . implode(', ', array_keys($this->editors)) ); } $filePath = $this->replaceSitesPath($filePath); $url = str_replace(['%file', '%line'], [$filePath, $line], $this->editors[config('debugbar.editor')]); return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function editorUri($file, $line = null)\n {\n if (Cheatsheet::$editor && $file && is_file($file)) {\n return strtr(Cheatsheet::$editor, ['%file' => rawurlencode($file), '%line' => $line ? (int) $line : '']);\n }\n }", "public static function editorLink($file, $line = null)\n {\n if ($editor = self::editorUri($file, $line)) {\n $file = strtr($file, '\\\\', '/');\n if (preg_match('#(^[a-z]:)?/.{1,50}$#i', $file, $m) && strlen($file) > strlen($m[0])) {\n $file = '...'.$m[0];\n }\n $file = strtr($file, '/', DIRECTORY_SEPARATOR);\n\n return self::formatHtml('<a href=\"%\" title=\"%\">%<b>%</b>%</a>',\n $editor,\n $file.($line ? \":$line\" : ''),\n rtrim(dirname($file), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR,\n basename($file),\n $line ? \":$line\" : ''\n );\n } else {\n return self::formatHtml('<span>%</span>', $file.($line ? \":$line\" : ''));\n }\n }", "public function getFileLink(string $file, int $line) {\n if ($fmt = $this->fileLinkFormat) {\n return \\is_string($fmt) ? strtr($fmt,\n ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);\n }\n\n return FALSE;\n }", "private function get_file_link(): string {\n $fs = get_file_storage();\n\n // Get all the files.\n $files = $fs->get_area_files(\n $this->context->id,\n 'mod_onlyoffice',\n onlyoffice::FILEAREA_INITIAL,\n false,\n '',\n false,\n 0,\n 0,\n 1\n );\n\n // Try get the first file.\n if (!$file = reset($files)) {\n return get_string('missingfile', 'mod_onlyoffice'); // File doesn't exist.\n }\n\n // Build the URL.\n $url = moodle_url::make_pluginfile_url(\n $file->get_contextid(),\n $file->get_component(),\n $file->get_filearea(),\n $file->get_itemid(),\n $file->get_filepath(),\n $file->get_filename(),\n true\n );\n\n return html_writer::link($url, $file->get_filename());\n }", "public function get_edit_url() {\n\t\treturn $this->edit_link();\n\t}", "public function getEditUrl()\r\n {\r\n if (empty(parent::getEditUrl())) {\r\n return \"\";\r\n }\r\n\r\n if ($this->contentObject instanceof File) {\r\n return $this->contentObject->content->container->createUrl($this->editRoute, ['id' => $this->contentObject->getItemId(), 'fromWall' => true]);\r\n }\r\n\r\n return \"\";\r\n }", "function get_link_to_edit($link)\n {\n }", "function get_shared_edit_link($fileid) {\n\n\t\t$response = curl_get(skydrive_base_url.$fileid.\"/shared_edit_link?access_token=\".$this->access_token);\n\n\t\tif (@array_key_exists('error', $response)) {\n\n\t\t\tthrow new Exception($response['error'].\" - \".$response['description']);\n\n\t\t\texit;\n\n\t\t} else {\t\n\n\t\t\treturn $response['link'];\n\n\t\t}\n\n\t}", "static function getLine($file,$line){\n\t\tif($file){\n\t\t\t$f = file($file);\n\t\t\t$code = substr($f[$line-1],0,-1);\n\t\t\treturn preg_replace('@^\\s*@','',$code);\n\t\t}\n\t}", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "private function getDocLink(DOMElement $column) {\n\t\t\n\t\t$anchors = $column->getElementsByTagName('a');\t\n\t\t$anchor = $anchors->item(0);\t\t\n\t\t\t\t\t\t\n\t\t$url = \"https://www.landtag.nrw.de\".$anchor->getAttribute('href');\t\t\t\n\t\t\t\t\n\t\t$this->official_record_nr = $anchor->nodeValue; \n\t\t\n\t\treturn $url;\n\t}", "public function getLine(int $line){\n return $this->file[$line] ?? \"\";\n }", "protected static function _formatFile($file, $line, $format = 'html', $text = null) {\n if (null === $text) {\n $text = $file;\n }\n\n if ('html' == $format && $file && $line && $linkFormat = ini_get('xdebug.file_link_format')) {\n $link = strtr($linkFormat, array('%f' => $file, '%l' => $line ) );\n $text = sprintf('<a href=\"%s\" title=\"Click to open this file\" class=\"file_link\">%s</a>', $link, $text);\n }\n\n return $text;\n }", "static protected function formatFile($file, $line, $format = 'html', $text = null){\r\n\t\tif (null === $text){\r\n\t\t\t$text = $file;\r\n\t\t}\r\n\t\t$linkFormat = 'rcp:%f';//?%l?0-0//C:\\workspace\\\r\n\t\tif ('html' === $format && $file && $line && $linkFormat){\r\n\t\t\t$localFilename = str_replace(kanon::getBasePath(), '', $file); \r\n\t\t\t$text = $localFilename;\r\n\t\t\t$link = strtr($linkFormat, array('%f' => $localFilename, '%l' => $line));\r\n\t\t\t//$link = 'data:link/php;base64,'.base64_encode($localFilename);\r\n\t\t\t$text = sprintf('<a href=\"%s\" title=\"Click to open this file\" class=\"file_link\">%s</a>', $link, $text);\r\n\t\t}\r\n\r\n\t\treturn $text;\r\n\t}", "protected function getSourcePathHtml($file, $line)\n {\n $html = '';\n\n if (null !== $file) {\n $file = ConsoleFormatter::trimFilename($file);\n\n $html .= '<span class=\"path\">';\n $html .= $file . (null !== $line ? ':' . $line : '');\n $html .= '</span>';\n }\n\n return $html;\n }", "function getLink(): string;", "public function link(){\n\t\tif( $this->link ) {\n\t\t\treturn $this->link;\n\t\t}//end if\n\n\t\t$this->link = @file_get_contents( $this->base_dir.'/'.$this->dir . $this->filename . '.link');\n\t\treturn $this->link;\n\t}", "function getEditUri() {\n\t\treturn $this->getData('editUri');\n\t}", "function get_real_file_to_edit($file)\n {\n }", "function get_file_url($file, $nocache = false) {\n if($file = find_file($file)) {\n $url = str_replace(FILES_PATH,FILES_URL,$file);\n } else {\n return false;\n }\n if($nocache) {\n $url .= '?revision='.md5_file($file);\n }\n return $url;\n}", "function getLine()\r\n {\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$sLine = trim($this->referString[$this->currentLine]);\r\n\t\t\t\t$this->currentLine++;\r\n\t\t\t} while ($this->currentLine < count($this->referString) && !$sLine);\r\n\t\t\treturn $sLine;\r\n }", "public function get_edit_link() {\n return get_edit_post_link( $this->get_id() );\n }", "public function CMSEditLink() {\n\t\t$class = Session::get(\"ListedPageAdmin.currentAdminClass\");\n\t\tif ($class) {\n\t\t\treturn singleton($class)->LinkPageEdit($this->ID);\n\t\t}\n\t\treturn null;\n\t}", "function get_edit_bookmark_link($link = 0)\n {\n }", "public function edit_link() {\n\t\tif ( $this->can_edit() ) {\n\t\t\treturn get_edit_post_link($this->ID);\n\t\t}\n\t}", "public function getEditMediaLink()\n {\n return $this->get('EditMediaLink');\n }", "public function linkEditContent($str, $row)\n {\n if ($this->doEdit && $this->getBackendUser()->recordEditAccessInternals('tt_content', $row)) {\n $urlParameters = [\n 'edit' => [\n 'tt_content' => [\n $row['uid'] => 'edit'\n ]\n ],\n 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid']\n ];\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);\n // Return link\n return '<a href=\"' . htmlspecialchars($url) . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('edit')) . '\">' . $str . '</a>';\n }\n return $str;\n }", "public function getLineRef()\n {\n return $this->lineRef;\n }" ]
[ "0.78174037", "0.75892186", "0.63798004", "0.5777892", "0.54868716", "0.5480049", "0.54014534", "0.5349771", "0.5329979", "0.5320148", "0.53180486", "0.53180486", "0.53177047", "0.5215016", "0.5206717", "0.5180178", "0.51710784", "0.5140824", "0.5110529", "0.51065254", "0.5086578", "0.50734717", "0.50716496", "0.5070136", "0.50604916", "0.5053612", "0.50020355", "0.49834546", "0.49740386", "0.49737242" ]
0.7881529
0
Hidden admin page to set draft status to specific post type/language.
public function set_draft_single_action() { ?> <div class="wrap"> <h1>WPGlobus :: <?php esc_html_e( 'Set Draft', 'wpglobus-plus' ); ?></h1> <hr /> <?php $ok_to_process = true; // Check for required parameters. if ( empty( $_GET['lang'] ) || empty( $_GET['post_type'] ) ) { esc_html_e( 'URL format', 'wpglobus-plus' ); echo ": &lang=...&post_type=..."; $ok_to_process = false; } // Check if language is one of the enabled $language = $_GET['lang']; if ( ! WPGlobus_Utils::is_enabled( $language ) ) { echo '<p>'; esc_html_e( 'Unknown language', 'wpglobus-plus' ); echo ': ' . esc_html( $language ); echo '</p>'; $ok_to_process = false; } $post_type = $_GET['post_type']; /** * Filter the array of disabled entities on page of module Publish. * * @since 1.1.22 * @scope admin * * @param array WPGlobus::Config()->disabled_entities Array of disabled entities. */ $disabled_entities = apply_filters( 'wpglobus_plus_publish_bulk_disabled_entities', WPGlobus::Config()->disabled_entities ); if ( in_array( $post_type, $disabled_entities, true ) ) { echo '<p>'; esc_html_e( 'Disabled post type', 'wpglobus-plus' ); echo ': <strong>' . esc_html( $post_type ) . '</strong>'; echo '</p>'; $ok_to_process = false; } if ( $ok_to_process ) { echo '<h2>'; echo esc_html( sprintf( __( 'Setting as "draft" all records with post type "%1$s" for language "%2$s"', 'wpglobus-plus' ), $post_type, $language ) ); echo '</h2>'; echo '<hr/>'; // Get all posts with the specified type $posts = get_posts( array( 'numberposts' => - 1, 'post_type' => $post_type, 'orderby' => 'ID', 'order' => 'ASC' ) ); // Loop through the posts foreach ( $posts as $post ) { $order = array( 'action' => 'set_status', 'post_id' => $post->ID, 'language' => $language, 'status' => 'draft' ); $result = $this->set_status( $order ); // Print the post title and link to edit printf( '<a href="%s">%s</a> : %s : ', admin_url( '/post.php?post=' . $post->ID . '&action=edit' ), $post->ID, esc_html( apply_filters( 'the_title', $post->post_title ) ) ); echo $result[ 'message' ]; echo '<br/>'; } if ( count( $posts ) === 0 ) { esc_html_e( 'No records found.', 'wpglobus-plus' ); } else { echo '<br/>'; esc_html_e( 'Done.', 'wpglobus-plus' ); } } $this->back_button('single-action'); ?> </div><!-- .wrap --> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAsDraft();", "protected function set_draft_bulk_actions() {\n\t\t\t\n\t\t\t$post_id = '';\n\t\t\tif ( ! empty( $_GET['post_id'] ) ) {\n\t\t\t\t$post_id = (int) sanitize_text_field($_GET['post_id']);\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<h1>WPGlobus :: <?php esc_html_e( 'Set Draft', 'wpglobus-plus' ); ?></h1>\n\t\t\t\t<hr />\n\t\t\t\t<?php\n\t\t\t\t$params = array();\n\t\t\t\tif ( ! empty($post_id) && $post_id > 0 ) {\n\t\t\t\t\t$this->process_by_post_id($post_id, $_GET['lang']);\n\t\t\t\t\t$params['post_id'] = $post_id;\n\t\t\t\t}\n\t\t\t\t$this->back_button('bulk-actions', $params);\n\t\t\t\t?>\n\t\t\t</div><!-- .wrap -->\t<?php\n\t\t}", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "public function isDraft();", "public function isDraft();", "public function isDraft();", "public function adminHeadAction() {\n add_filter('display_post_states', array($this, 'setPostState'), 10, 2);\n }", "function bc_location_general_admin_notice(){\n global $pagenow;\n global $post;\n if ( $pagenow == 'post-new.php' && $post->post_type == \"bc_locations\" ) {\n echo '<div class=\"notice notice-warning is-dismissible\">\n <p>Save draft to modify permalink</p>\n </div>';\n }\n}", "public function make_auto_draft_status_previewable()\n {\n }", "function block_core_calendar_update_has_published_post_on_transition_post_status($new_status, $old_status, $post)\n {\n }", "public function draftPost()\n {\n \t$posts = Post::where([['status', 0], ['user_id', auth()->id()]])->get();\n \t$countPublicPosts = Post::where([['status', 1], ['user_id', auth()->id()]])->count();\n\n \treturn view('users.posts.draft', compact('posts', 'countPublicPosts'));\n }", "function eman_post_editable( $post )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\n\t// Settings area always editable\n\tif ( emanager_post::is_settings($post) ) return true;\n\n\t$status = emanager_post::status($post, 'slug');\n\n\t// If no status yet or is in draft or revise, it is editable\n\tif ( 'draft' == $status || 'revise' == $status ) return true;\n\n\treturn false;\n}", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 1 ){\n\t\t\t\t\tupdate_option('blog_public', 0);\n\t\t\t\t}\n\t\t\t}", "function fix_no_editor_on_posts_page($post)\n{\n\n if ($post->ID != get_option('page_for_posts')) {\n return;\n }\n\n remove_action('edit_form_after_title', '_wp_posts_page_notice');\n add_post_type_support('page', 'editor');\n\n}", "public function isDraft()\n {\n return $this->publish_status == Status::DRAFT;\n }", "public function draft_publish()\n\t{\n\t\t$where = array(\n\t\t\t'parent_entry_id' => $this->settings['entry_id'],\n\t\t\t'parent_is_draft' => 0\n\t\t);\n\t\t$this->EE->db->where($where)->delete('playa_relationships');\n\n\t\t$where['parent_is_draft'] = 1;\n\t\t$update = array('parent_is_draft' => 0);\n\t\t$this->EE->db->where($where)->update('playa_relationships', $update);\n\n\t\treturn;\n\t}", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 0 ){\n\t\t\t\t\tupdate_option('blog_public', 1);\n\t\t\t\t}\n\t\t\t}", "function sr_admin_actions() { \n\tadd_options_page(\"Standards Reader\", \"Standards Reader\", \"edit_published_posts\", \"sr_options\", \"sr_admin\");\n}", "protected function process_by_post_id( $post_id = 0, $languages = '' ) {\n\t\t\t\n\t\t\techo '<h2>';\n\t\t\techo esc_html( sprintf(\n\t\t\t\t__( 'Setting as \"draft\" for post ID \"%1$s\" for language(s) \"%2$s\"',\n\t\t\t\t\t'wpglobus-plus' ),\n\t\t\t\t$post_id, $languages\n\t\t\t) );\n\t\t\techo '</h2>';\n\t\t\techo '<hr/>';\n\n\t\t\t$success = true;\n\n\t\t\t// Get post.\n\t\t\t$post = get_post( $post_id );\n\n\t\t\tif ( $post instanceof WP_Post ) {\n\t\t\n\t\t\t\t$language_array = explode( ',', $languages );\n\n\t\t\t\tif ( ! empty($language_array) ) {\n\t\t\t\t\n\t\t\t\t\t// Print the post title and link to edit\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t'<a href=\"%s\">%s</a> : %s : ',\n\t\t\t\t\t\tadmin_url( '/post.php?post=' . $post->ID . '&action=edit' ),\n\t\t\t\t\t\t$post->ID,\n\t\t\t\t\t\tesc_html( apply_filters( 'the_title', $post->post_title ) )\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$post_status = get_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, true );\n\n\t\t\t\t\tforeach( $language_array as $language ) {\n\t\t\t\t\t\tif ( ! in_array($language, WPGlobus::Config()->enabled_languages, true) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$post_status[$language] = 'draft';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Post meta table.\n\t\t\t\t\t */\n\t\t\t\t\t$_result = update_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, $post_status );\n\t\t\t\t\t\n\t\t\t\t\tif ( $_result ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tesc_html_e( 'Updated.', 'wpglobus-plus' );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$opts = get_option(self::LANGUAGE_STATUS);\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ( $post_status as $language=>$status ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( empty($opts[ $language ]) ) {\n\t\t\t\t\t\t\t\t$opts[ $language ] = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$opts[ $language ][ $post->ID ] = $post->ID;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tupdate_option( self::LANGUAGE_STATUS, $opts );\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tesc_html_e( 'Empty array of languages.', 'wpglobus-plus' );\n\t\t\t\t\t$success = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tesc_html_e( 'No record found.', 'wpglobus-plus' );\n\t\t\t\t$success = false;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $success ) {\n\t\t\t\techo '<br/>';\n\t\t\t\techo '<br/>';\n\t\t\t\tesc_html_e( 'Done.', 'wpglobus-plus' );\n\t\t\t}\n\t\t}", "function wpbm_posttype_admin_css(){\n global $post_type;\n $post_types = array(\n /* set post types */\n 'wpblogmanager'\n );\n if ( in_array( $post_type, $post_types ) )\n echo '<style type=\"text/css\">#view-post-btn, .updated a,#screen-meta-links .screen-meta-toggle\n {display: none;}</style>';\n }", "function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {\n\t\tif ( $new_status === $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'post' !== get_post_type( $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "public function isDraft() {\r\n return $this->isDraft;\r\n }", "function _wp_keep_alive_customize_changeset_dependent_auto_drafts($new_status, $old_status, $post)\n {\n }", "public function wpcd_team_force_type_private( $post ) {\n\n\t\tif ( 'wpcd_team' === $post['post_type'] ) {\n\t\t\tif ( $post['post_status'] != 'trash' && $post['post_status'] != 'auto-draft' && $post['post_status'] != 'draft' ) {\n\t\t\t\t$post['post_status'] = 'private';\n\t\t\t}\n\t\t}\n\t\treturn $post;\n\n\t}", "public function actionChangeStatus() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$content = Content::model()->findByPk(\\Yii::app()->getRequest()->getParam('contentId', 0));\n\t\t\t$mode = \\Yii::app()->getRequest()->getParam('mode', 'draft');\n\t\t\tif($content !== null) {\n\t\t\t\t$content->contentStatus = $mode;\n\t\t\t\t$content->save();\n\t\t\t}\n\t\t\t$this->renderPartial('_contentHeader', array('content' => $content));\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}", "function fr_front_page_editing(){\r\n\tregister_post_type('fr_front page', array(\r\n\t\t'supports' => array('title', 'editor', 'excerpt'),\r\n\t\t'rewrite' => array('slug' => 'fr_front page'),\r\n\t\t'has archive' => true,\r\n\t\t'public' => true,\r\n\t\t'labels' => array(\r\n\t\t\t'name' => 'FR_Front Page Statement',\r\n\t\t\t'edit_item' => 'FR_Edit Front Page',\r\n\t\t\t'singular' => 'FR_Front Page Statement'\r\n\t\t),\r\n\t\t'menu_icon' => 'dashicons-admin-home'\r\n\t));\r\n}", "function set_default_status( $post_id )\n {\n $post = get_post( $post_id );\n if ( $post->post_type === self::CPT_TYPE )\n {\n \t$terms = wp_get_post_terms( $post_id, self::TERMS_STATUS );\n if ( empty( $terms ) )\n {\n wp_set_object_terms( $post_id, 'depose', self::TERMS_STATUS );\n }\n }\n }", "public function setStatus ($value) {\n\t\t$vals = array(\"Published\", \"Draft\");\n\t\tif (in_array($value, $vals)) {\n\t\t\t$this->setData(\"pageStatus\", $value);\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->setMessage(LANG_INVALID.\" \".LANG_STATUS);\n\t\t\treturn false;\n\t\t}\n\t}", "function add_custom_post_states($states) {\n \n global $post;\n\n // get saved project page ID\n $project_page_id = get_option('ccmsversion_page');\n\n // add our custom state after the post title only,\n // if post-type is \"page\",\n // \"$post->ID\" matches the \"$project_page_id\",\n // and \"$project_page_id\" is not \"0\"\n if( 'page' == get_post_type(get_the_ID()) && get_the_ID() == $project_page_id && $project_page_id != '0') {\n $states[] = __('CCMS Versions Landing Page', 'textdomain');\n }\n\n return $states;\n }", "function wp_dashboard_recent_drafts($drafts = \\false)\n {\n }" ]
[ "0.6924878", "0.6659406", "0.6413369", "0.628576", "0.628576", "0.628576", "0.62780744", "0.61363184", "0.61242265", "0.6101883", "0.60754114", "0.6048167", "0.60429823", "0.60427845", "0.6027057", "0.5995915", "0.59822345", "0.59810597", "0.597033", "0.5947639", "0.5932615", "0.59252506", "0.5895406", "0.5885005", "0.5869573", "0.58516395", "0.5843693", "0.582196", "0.5805652", "0.5797229" ]
0.7610402
0
Hidden admin page to output results of bulk setting draft status.
protected function set_draft_bulk_actions() { $post_id = ''; if ( ! empty( $_GET['post_id'] ) ) { $post_id = (int) sanitize_text_field($_GET['post_id']); } ?> <div class="wrap"> <h1>WPGlobus :: <?php esc_html_e( 'Set Draft', 'wpglobus-plus' ); ?></h1> <hr /> <?php $params = array(); if ( ! empty($post_id) && $post_id > 0 ) { $this->process_by_post_id($post_id, $_GET['lang']); $params['post_id'] = $post_id; } $this->back_button('bulk-actions', $params); ?> </div><!-- .wrap --> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_draft_single_action() {\n\t\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<h1>WPGlobus :: <?php esc_html_e( 'Set Draft', 'wpglobus-plus' ); ?></h1>\n\t\t\t\t<hr />\n\t\t\t\t<?php\n\n\t\t\t\t$ok_to_process = true;\n\n\t\t\t\t// Check for required parameters.\n\t\t\t\tif ( empty( $_GET['lang'] ) || empty( $_GET['post_type'] ) ) {\n\t\t\t\t\tesc_html_e( 'URL format', 'wpglobus-plus' );\n\t\t\t\t\techo \": &lang=...&post_type=...\";\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\t// Check if language is one of the enabled\n\t\t\t\t$language = $_GET['lang'];\n\t\t\t\tif ( ! WPGlobus_Utils::is_enabled( $language ) ) {\n\t\t\t\t\techo '<p>';\n\t\t\t\t\tesc_html_e( 'Unknown language', 'wpglobus-plus' );\n\t\t\t\t\techo ': ' . esc_html( $language );\n\t\t\t\t\techo '</p>';\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\t$post_type = $_GET['post_type'];\n\n\t\t\t\t/**\n\t\t\t\t * Filter the array of disabled entities on page of module Publish.\n\t\t\t\t *\n\t\t\t\t * @since 1.1.22\n\t\t\t\t * @scope admin\n\t\t\t\t *\n\t\t\t\t * @param array WPGlobus::Config()->disabled_entities Array of disabled entities.\n\t\t\t\t */\n\t\t\t\t$disabled_entities = apply_filters( 'wpglobus_plus_publish_bulk_disabled_entities', WPGlobus::Config()->disabled_entities );\n\n\t\t\t\tif ( in_array( $post_type, $disabled_entities, true ) ) {\n\t\t\t\t\techo '<p>';\n\t\t\t\t\tesc_html_e( 'Disabled post type', 'wpglobus-plus' );\n\t\t\t\t\techo ': <strong>' . esc_html( $post_type ) . '</strong>';\n\t\t\t\t\techo '</p>';\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\tif ( $ok_to_process ) {\n\n\t\t\t\t\techo '<h2>';\n\t\t\t\t\techo esc_html( sprintf(\n\t\t\t\t\t\t__( 'Setting as \"draft\" all records with post type \"%1$s\" for language \"%2$s\"',\n\t\t\t\t\t\t\t'wpglobus-plus' ),\n\t\t\t\t\t\t$post_type, $language\n\t\t\t\t\t) );\n\t\t\t\t\techo '</h2>';\n\t\t\t\t\techo '<hr/>';\n\n\t\t\t\t\t// Get all posts with the specified type\n\t\t\t\t\t$posts = get_posts( array(\n\t\t\t\t\t\t'numberposts' => - 1,\n\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t'orderby' => 'ID',\n\t\t\t\t\t\t'order' => 'ASC'\n\t\t\t\t\t) );\n\n\t\t\t\t\t// Loop through the posts\n\t\t\t\t\tforeach ( $posts as $post ) {\n\n\t\t\t\t\t\t$order = array(\n\t\t\t\t\t\t\t'action' \t=> 'set_status',\n\t\t\t\t\t\t\t'post_id' \t=> $post->ID,\n\t\t\t\t\t\t\t'language'\t=> $language,\n\t\t\t\t\t\t\t'status'\t=> 'draft'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$result = $this->set_status( $order );\n\n\t\t\t\t\t\t// Print the post title and link to edit\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\">%s</a> : %s : ',\n\t\t\t\t\t\t\tadmin_url( '/post.php?post=' . $post->ID . '&action=edit' ),\n\t\t\t\t\t\t\t$post->ID,\n\t\t\t\t\t\t\tesc_html( apply_filters( 'the_title', $post->post_title ) )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\techo $result[ 'message' ];\n\n\t\t\t\t\t\techo '<br/>';\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( count( $posts ) === 0 ) {\n\t\t\t\t\t\tesc_html_e( 'No records found.', 'wpglobus-plus' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<br/>';\n\t\t\t\t\t\tesc_html_e( 'Done.', 'wpglobus-plus' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->back_button('single-action');\n\t\t\t\t?>\n\t\t\t</div><!-- .wrap -->\t\n\t\t\t<?php\n\t\t}", "function admin_index()\n\t{\n\t $this->set('pagetitle',\"Manage Pages\");\n\t $this->paginate=array('order'=>'Page.name ASC');\n\t $lists = $this->paginate('Page');\n\t $this->set('list', $lists);\n\t \n\t if((isset($this->data[\"Page\"][\"setStatus\"])))\n\t {\n\t\t$status = ife($_POST['active'],1,0);\n\t\t$record = $this->data[\"Page\"][\"Record\"];\n\t\t$CheckedList=$_POST['box1'];\n\t\t$controller= $this->params['controller'];\n\t\t$action='index'; \n\t\t$prefix='admin';\n\t\t$model='Page';\n\t\t$relation=null;\n\t\t\n\t\tswitch($status)\n\t\t{ \n\t\t case '1': \n\t\t\t$this->setStatus('1',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break;\n\t\t case '0':\n\t\t\t$this->setStatus('0',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break; \n\t\t}\n\t }\n\t}", "public function displayInAdmin()\n {\n return self::_enabled();\n }", "public function setAsDraft();", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 1 ){\n\t\t\t\t\tupdate_option('blog_public', 0);\n\t\t\t\t}\n\t\t\t}", "public function statusAction() {\n $status = $this->_getParam('status');\n $infoId = $this->_getParam('id');\n if (empty($status)) {\n $this->view->title = $this->view->translate(\"Disable Page?\");\n $this->view->discription = $this->view->translate(\"Are you sure that you want to disable this page? After being disabled this will not be shown to users.\");\n $this->view->bouttonLink = $this->view->translate(\"Disable\");\n } else {\n $this->view->title = $this->view->translate(\"Enable Page?\");\n $this->view->discription = $this->view->translate(\"Are you sure that you want to enable this page? After being enabled this will be shown to users.\");\n $this->view->bouttonLink = $this->view->translate(\"Enable\");\n }\n // Check post\n if ($this->getRequest()->isPost()) {\n $pagesettingsTable = Engine_Api::_()->getDbTable('startuppages', 'sitestoreproduct');\n $pagesettingsTable->update(array('status' => $status), array('startuppages_id =?' => $infoId));\n\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('Successfully done.')\n ));\n }\n }", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 0 ){\n\t\t\t\t\tupdate_option('blog_public', 1);\n\t\t\t\t}\n\t\t\t}", "function admin_list( $status = 'all')\n\t{\n\t\t\n\t\t$conditions = array();\n\t\t\n\t\tif($status != 'all')\n\t\t{\n\t\t\t$conditions['Order.status'] = $status;\n\t\t}\n\t\t\n\t\t$this->Order->virtualFields = array(\n\t\t\t'completed_articles_count' => '(SELECT COUNT(*) FROM writer_assignments wa1 LEFT JOIN writer_orders wo1 ON ( wa1.writer_order_id = wo1.id ) WHERE ( wo1.order_id = Order.id ) AND ( wa1.status = \"completed\" ) )'\n\t\t);\n\t\t\n\t\t$this->paginate\t= array(\n\t\t\t'conditions' \t=>\t$conditions,\n\t\t\t'limit'\t\t\t=>\t20,\n\t\t\t'recursive' \t=> 3\n\t\t);\n\t\t\n \t$orders =\t$this->paginate('Order');\t\t\n\t\t\n\t\t$this->set('orders', $orders);\t\t\n\t\t$this->set('status', $status);\n\t\t\t\t\n\t}", "public function make_auto_draft_status_previewable()\n {\n }", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "public function admin_index() {\n\t\t$this->Team->recursive = 0;\n\t\t$teams = $this->Team->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Team.id >=' => 1,\n\t\t\t\t//'Team.status' => array(StatusOfTeam::Active)\n\t\t\t)\n\t\t));\n\t\t$this->set('teams', $teams);\n\t}", "public function display_status() {\n\t\t$banner_status = get_option( 'cookieproCCPASettingsPreview' );\n\t\t$banner_behavior_status = get_option( 'cookieproCCPABehaviorSettingsPreview' );\n\t\t$this->settings_status = 'Draft';\n\t\t$this->settings_publish_time = '';\n\t\tif( ! empty( $banner_status ) && ! empty( $banner_behavior_status ) ){\n\t\t\tif ( 'Published' === $banner_status['publishStatus'] && 'Published' === $banner_behavior_status['publishStatus'] ) {\n\t\t\t\t$this->settings_status = 'Published';\n\t\t\t}\n\t\t\t$this->settings_publish_time = $banner_status['lastPublished'];\n\t\t}\n\t\treturn array(\n\t\t\t'status' => $this->settings_status,\n\t\t\t'lastpublished' => $this->settings_publish_time,\n\t\t);\n\t}", "public function admin_getList()\n {\n $sql = 'select * from '.$this->table.' where status >= 0';\n return $this->query($sql);\n }", "protected function admin_page_action() {\n\n\t\tif ( $this->is_admin_request_for_users_forget() ) {\n\t\t\t$this->users_forget();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_send_email() ) {\n\t\t\t$this->users_send_email();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_remove() ) {\n\t\t\t$this->users_remove_from_list();\n\t\t}\n\n\t\t/* Default settings page */\n\t\t$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );\n\n\t}", "public function actionVisible ()\n\t\t{\n\t\t\tif (Yii::$app->request->isAjax)\n\t\t\t{\n\t\t\t\t$id = Yii::$app->request->post('id');\n\t\t\t\t$menu = Menu::findOne($id);\n\t\t\t\tif ($menu !== null)\n\t\t\t\t{\n\t\t\t\t\t$menu->setAttribute('visible', $menu->visible == 1 ? 0 : 1);\n\t\t\t\t\tif (!$menu->save())\n\t\t\t\t\t\techo Json::encode(current($menu->firstErrors));\n\t\t\t\t\telse\n\t\t\t\t\t\techo $menu->visible;\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}", "function sr_admin_actions() { \n\tadd_options_page(\"Standards Reader\", \"Standards Reader\", \"edit_published_posts\", \"sr_options\", \"sr_admin\");\n}", "public function actionChangeStatus() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$content = Content::model()->findByPk(\\Yii::app()->getRequest()->getParam('contentId', 0));\n\t\t\t$mode = \\Yii::app()->getRequest()->getParam('mode', 'draft');\n\t\t\tif($content !== null) {\n\t\t\t\t$content->contentStatus = $mode;\n\t\t\t\t$content->save();\n\t\t\t}\n\t\t\t$this->renderPartial('_contentHeader', array('content' => $content));\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function massStatusAction()\n {\n $traineedocIds = $this->getRequest()->getParam('traineedoc');\n if (!is_array($traineedocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('Please select trainee document.')\n );\n } else {\n try {\n foreach ($traineedocIds as $traineedocId) {\n $traineedoc = Mage::getSingleton('bs_traineedoc/traineedoc')->load($traineedocId)\n ->setStatus($this->getRequest()->getParam('status'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d trainee document were successfully updated.', count($traineedocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('There was an error updating trainee document.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function statusAction()\n {\n $actionRow = new Admin_Model_DbRow_Action($this->dbAction->find($this->checkActionIdParam()));\n IF($actionRow->get('id')) {\n $actionRow->fromArray(array(\n 'enabled' => $actionRow->get('enabled') == 0 ? 1 : 0\n ));\n $this->dbAction->updateById($actionRow->toDbArray(array('enabled')), $actionRow->get('id'));\n } ELSE {\n // FIXME: Error Handling\n }\n\n $this->_redirect('admin/action/index/control/' . $actionRow->get('mcId'));\n }", "function printToolAdmin() {\r\n $criteria = array('status' => Appeal::$STATUS_AWAITING_ADMIN);\r\n return printAppealList($criteria);\r\n}", "public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "function admin_settings($id = null) {\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Invalid project', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t//TODO: to check if the accessing admin is actually the owner of the project and deny access if he's not.\n\t\t\n\t\t$status = false;\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\tif ($this->Project->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('The project has been saved', true));\n\t\t\t\t$this->redirect(array('action' => 'dashboard', $id));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The project could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->Project->read(null, $id);\n\t\t\t\n\t\t\t//for extending deadlines.\n\t\t\t\n\t\t\t//currently only handles going back to PROJECT_COLLECT\n\t\t\tif(!empty($this->params['named']['status_to'])){\n\t\t\t\t$status = $this->params['named']['status_to'];\n\t\t\t\tswitch ($status) {\n\t\t\t\t\tcase PROJECT_COLLECT:\n\t\t\t\t\t\t$this->data['Project']['status'] = PROJECT_COLLECT;\n\t\t\t\t\t\t$this->data['Project']['collection_end'] = date(\"Y-m-d 00:00:00\", strtotime(\"+2 week\"));\n\t\t\t\t\t\t$this->data['Project']['feedback_end'] = date(\"Y-m-d 00:00:00\", strtotime(\"+4 week\"));\n\t\t\t\t\t\tFireCake::log($this->data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$admins = $this->Project->Admin->find('list');\n\t\t$this->set(compact('admins', 'status'));\n\t}", "public function actionIndex() {\r\n\t\tif(isset($_POST['hide']))\r\n\t\t{\r\n\t\t\t//permanant hide\r\n\t\t\tif(isset($_POST['dontshow']))\r\n\t\t {\r\n\t\t\t\t\r\n\t\t\t\t$config=Configurations::model()->findByAttributes(array('id'=>21));\r\n\t\t\t\tif($config!=NULL)\r\n\t\t\t\t{\r\n\t\t\t\t $config->config_value = 1;\r\n\t\t\t\t $config->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->redirect(array('/dashboard'));\r\n\t\t}\r\n\t\t\r\n\t\t//check\r\n $config=Configurations::model()->findByAttributes(array('id'=>21));\r\n\t\t{\r\n\t\t\tif($config!=NULL)\r\n\t\t\t{\r\n\t\t\t\tif($config->config_value)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->redirect(array('/dashboard'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->render(Yii::app()->getModule('message')->viewPath . '/index');\r\n\t}", "function on_splashgate_pages_admin(){\n\t\t\tglobal $post; ?>\n\t <input type=\"hidden\" name=\"splashgate_splashable_noncename\" id=\"splashgate_splashable_noncename\" value=\"<?php echo wp_create_nonce( plugin_basename(__FILE__) ); ?>\" /><?php\n\t \n\t\t\t$checked = \"\";\n\t $splashgate_splashable = get_post_meta($post->ID, '_splashgate_splashable', true);\n\t \t\tif($splashgate_splashable){\n\t \t\t\t$checked = \"checked=\\\"checked\\\"\";\n\t \t\t} ?>\n\t \t\t\n\t \t\t<p><input type=\"checkbox\" name=\"splashgate_splashable\" <?php echo $checked; ?>/>\n\t\t <label for=\"splashgate_splashable\"><?php echo __( 'Splashable', 'splashgate_textdomain' ); ?></label></p>\n \n\t\t\t<p>This <strong>does not</strong> set the Splash Page. This only <em>allows</em> this page to be set as the Splash Page. </p>\n\t\t\t<p><a href=\"<?php echo admin_url('/options-general.php?page=splashgate_options',__FILE__); ?>\" title=\"Manage splash page\">Manage splash page</a></p><?php\n\t\t\n\t\t}", "public function adminHeadAction() {\n add_filter('display_post_states', array($this, 'setPostState'), 10, 2);\n }", "public function settings_previewed()\n {\n }", "public function statusAction()\n {\n $ctrlRow = new Admin_Model_DbRow_Controller($this->dbCtrl->find($this->checkControllerIdParam()));\n $ctrlRow->set('enabled', $ctrlRow->get('enabled') == 1 ? 0 : 1);\n $this->dbCtrl->update($ctrlRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n\n // disabled all actions too, they are relevant in the ACL\n IF($ctrlRow->get('enabled') === 0) {\n $actionRow = new Admin_Model_DbRow_Action(array(\n 'enabled' => 0\n ));\n $actionDbModel = new Admin_Model_DbTable_Acl_Action;\n $actionDbModel->updateWithControllerId($actionRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n }\n\n $this->_redirect('admin/controller/index');\n \n }", "public function admin()\n {\n return $this->state([ ]);\n }", "public function display_admin_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<?php screen_icon(); ?>\n\n\t\t\t<h2><?php _e( 'Slack post-types', 'slack-post-types' ); ?></h2>\n\t\t\t<p><?php _e( 'Set which post-types are operational in Slack below.', 'slack-post-types' ); ?></p>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t\t<?php settings_fields( 'slack-post-types' ); ?>\n\n\t\t\t\t<table class=\"form-table\"><?php\n\t\t\t\tforeach ( $this->get_post_types() as $post_type ) {\n\n\t\t\t\t\t// Grab existing setting\n\t\t\t\t\t$options = get_option( 'slack-post-types' );\n\t\t\t\t\tif ( isset( $options[$post_type] ) ) {\n\t\t\t\t\t\t$option = $options[$post_type];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$option = '';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><?php printf( __( 'Include the \"%s\" post-type?', 'slack-post-types' ), $post_type ); ?></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"1\" <?php checked( $option, 1 ); ?> id=\"<?php echo esc_attr( 'slack-post-types-' . $post_type ); ?>\" name=\"<?php echo esc_attr( 'slack-post-types[' . $post_type . ']' ); ?>\">\n\t\t\t\t\t\t\t<label class=\"hidden description\" for=\"<?php echo esc_attr( 'slack-post-types-' . $post_type ); ?>\"><?php _e( 'Include post-type', 'slack-post-types' ); ?></label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr><?php\n\n\t\t\t\t}\n\t\t\t\t?>\n\n\t\t\t\t</table>\n\n\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e( 'Save Settings', 'slack-post-types' ); ?>\" />\n\t\t\t\t</p>\n\t\t\t</form>\n\t\t</div><?php\n\t}" ]
[ "0.67520326", "0.6323195", "0.6098542", "0.60653293", "0.60354483", "0.6009865", "0.59990287", "0.5968379", "0.5950524", "0.5931915", "0.58954626", "0.585014", "0.5783244", "0.576814", "0.57642376", "0.5727778", "0.57269996", "0.572662", "0.5723115", "0.57028604", "0.56909996", "0.5649175", "0.5646551", "0.5643662", "0.5627288", "0.5611114", "0.56079787", "0.5598296", "0.5597916", "0.55958825" ]
0.7142925
0
Clean up output of stylesheet tags
function sw_clean_style_tag($input) { preg_match_all("!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches); $media = $matches[3][0] === 'print' ? ' media="print"' : ''; return '<link rel="stylesheet" href="' . esc_url( $matches[2][0] ) . '"' . $media . '>' . "\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fs_clean_style_tag( $input ) {\r\n\tpreg_match_all( \"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches );\r\n\t// Only display media if it's print\r\n\t$media = $matches[3][0] === 'print' ? ' media=\"print\"' : '';\r\n\treturn '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\r\n}", "function fabric_clean_style_tag($input) {\n preg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n // Only display media if it is meaningful\n $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n return '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "function clean_style_tag( $input ) {\n\t$link = \"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\";\n\tpreg_match_all( $link, $input, $matches );\n\tif ( empty( $matches[2] ) ) {\n\t\treturn $input;\n\t}\n\n\t// Only display media if it is meaningful\n\t$media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n\n\treturn '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "function clean_style_tag($input) {\n preg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n if (empty($matches[2])) {\n return $input;\n }\n // Only display media if it is meaningful\n $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n return '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "function clean_style_tag($input) {\n preg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n if (empty($matches[2])) {\n return $input;\n }\n // Only display media if it is meaningful\n $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n return '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "public function clean_style_tag($input) {\n\t\tpreg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n\t\tif (empty($matches[2])) {\n\t\t\treturn $input;\n\t\t}\n\t\t// Only display media if it is meaningful\n\t\t$media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n\t\treturn '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n\t}", "function remove_word_styles() {\r\n\t\t$this->code = preg_replace('/<style[^<>]*?>(.*?)<\\/style>/is', '<style type=\"text/css\"></style>', $this->code);\r\n\t}", "function delete_stylesheet() {\n\t\t\t$css_file = $this->get_stylesheet();\n\t\t\tThemify_Filesystem::delete($css_file,'f');\n\t\t}", "function wpgrade_gallery_style($css) {\r\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\r\n}", "protected function generateCSS() {}", "function roots_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "protected function renderStylesheet(){\n \n return sprintf(\n '<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\" media=\"%s\">',\n $this->getField('url'),\n $this->getField('media','screen, projection')\n );\n \n }", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "function start_remove_gallery_style( $css ) {\n\treturn preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function charity_create_stylesheet() {\n $content = \"\\t\";\n $content .= \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\";\n $content .= get_bloginfo('stylesheet_url');\n $content .= \"\\\" />\";\n $content .= \"\\n\\n\";\n echo apply_filters('charity_create_stylesheet', $content);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function theme_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function ks_style_remove( $tag ) {\n\treturn preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "function html5_style_remove( $tag ) {\n return preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "function mdwpfp_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function del_stylesheets( $haystack )\n\t{\n\t\tpreg_match_all( '|<link(.*)=(.*)\"stylesheet\"(.*)/>|Us', $haystack, $tmp_array );\n\t\t$to_delete = $tmp_array[ 0 ];\n\t\tpreg_match_all( '|<style(.*)=(.*)\"text/css\">(.*)</style>|Us', $haystack, $tmp_array );\n\n\t\t// FIXME: Was ist das? ($this->cssfilter verwenden für eine verbesserung)\n\t\tforeach($tmp_array[0] as $file) {\n\t\t\tif(!strpos($file, \"IEFixes\") &&\n\t\t\t\t!strpos($file, \"ie6bar\") &&\n\t\t\t\t!strpos($file, \"awesome\") &&\n\t\t\t\t!strpos($file, \"dropdown\") &&\n\t\t\t\t!strpos($file, \"mobile\") &&\n\t\t\t\t!strpos($file, \"jquery\") &&\n\t\t\t\t!strpos($file, \"hreflang\")\n\t\t\t) {\n\t\t\t\t$to_delete = array_merge($to_delete, (array)$file);\n\t\t\t}\n\t\t}\n\t\tforeach($to_delete as $key => $file) {\n\t\t\tif(!strpos($file, \"IEFixes\") &&\n\t\t\t\t!strpos($file, \"ie6bar\") &&\n\t\t\t\t!strpos($file, \"awesome\") &&\n\t\t\t\t!strpos($file, \"mobile\") &&\n\t\t\t\t!strpos($file, \"dropdown\") &&\n\t\t\t\t!strpos($file, \"jquery\") &&\n\t\t\t\t!strpos($file, \"hreflang\")\n\t\t\t) {\n\t\t\t\t$to_delete2[$key] = $file;\n\t\t\t}\n\t\t}\n\t\tIfNotSetNull($to_delete2);\n\t\t$to_delete = $to_delete2;\n\n\t\tif(isset($this->not_delete) && is_array($this->not_delete)) {\n\t\t\tforeach($this->not_delete as $key => $value) {\n\t\t\t\tif(is_array($to_delete)) {\n\t\t\t\t\tforeach($to_delete as $key2 => $value2) {\n\t\t\t\t\t\tif(stristr($value2, basename($value))) {\n\t\t\t\t\t\t\t$this->special_css[] = $value2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $to_delete;\n\t}", "function spartan_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function _preview_theme_stylesheet_filter()\n {\n }", "protected function doCompressCss() {}", "function tlh_gallery_style( $css ) {\n\treturn preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function po_gallery_style($css) {\n return preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "public function _sanitize_stylesheet_callback($stylesheet)\n {\n }" ]
[ "0.7233164", "0.70487666", "0.69583315", "0.6920292", "0.68972045", "0.67938346", "0.67189586", "0.6492633", "0.62799495", "0.62426597", "0.62313753", "0.6227686", "0.6202775", "0.6201512", "0.6188893", "0.61750656", "0.6172255", "0.61656153", "0.61656153", "0.61656153", "0.615643", "0.6152368", "0.6146376", "0.6145009", "0.6138534", "0.6115657", "0.61139536", "0.6111126", "0.61091584", "0.61030924" ]
0.7361643
0
The ActivityType table has some special sprintf search/replace values in the FullHeadline and ProfileHeadline fields. The ProfileHeadline field is to be used on this page (the user profile page). The FullHeadline field is to be used on the main activity page. The replacement definitions are as follows: %1$s = ActivityName %2$s = ActivityName Possessive %3$s = RegardingName %4$s = RegardingName Possessive %5$s = Link to RegardingName's Wall %6$s = his/her %7$s = he/she %8$s = route & routecode %9$s = gender suffix (some languages require this).
public static function ActivityHeadline($Activity, $ProfileUserID = '', $ViewingUserID = '') { if ($ViewingUserID == '') { $Session = Gdn::Session(); $ViewingUserID = $Session->IsValid() ? $Session->UserID : -1; } $GenderSuffixCode = 'First'; $GenderSuffixGender = $Activity->ActivityGender; if ($ViewingUserID == $Activity->ActivityUserID) { $ActivityName = $ActivityNameP = T('You'); } else { $ActivityName = $Activity->ActivityName; $ActivityNameP = FormatPossessive($ActivityName); $GenderSuffixCode = 'Third'; } if ($ProfileUserID != $Activity->ActivityUserID) { // If we're not looking at the activity user's profile, link the name $ActivityNameD = urlencode($Activity->ActivityName); $ActivityName = Anchor($ActivityName, '/profile/' . $Activity->ActivityUserID . '/' . $ActivityNameD); $ActivityNameP = Anchor($ActivityNameP, '/profile/' . $Activity->ActivityUserID . '/' . $ActivityNameD); $GenderSuffixCode = 'Third'; } $Gender = T($Activity->ActivityGender == 'm' ? 'his' : 'her'); $Gender2 = T($Activity->ActivityGender == 'm' ? 'he' : 'she'); if ($ViewingUserID == $Activity->RegardingUserID || ($Activity->RegardingUserID == '' && $Activity->ActivityUserID == $ViewingUserID)) { $Gender = $Gender2 = T('your'); } $IsYou = FALSE; if ($ViewingUserID == $Activity->RegardingUserID) { $IsYou = TRUE; $RegardingName = T('you'); $RegardingNameP = T('your'); $GenderSuffixGender = $Activity->RegardingGender; } else { $RegardingName = $Activity->RegardingName == '' ? T('somebody') : $Activity->RegardingName; $RegardingNameP = FormatPossessive($RegardingName); if ($Activity->ActivityUserID != $ViewingUserID) $GenderSuffixCode = 'Third'; } $RegardingWall = ''; $RegardingWallLink = ''; if ($Activity->ActivityUserID == $Activity->RegardingUserID) { // If the activityuser and regardinguser are the same, use the $Gender Ref as the RegardingName $RegardingName = $RegardingProfile = $Gender; $RegardingNameP = $RegardingProfileP = $Gender; } else if ($Activity->RegardingUserID > 0 && $ProfileUserID != $Activity->RegardingUserID) { // If there is a regarding user and we're not looking at his/her profile, link the name. $RegardingNameD = urlencode($Activity->RegardingName); if (!$IsYou) { $RegardingName = Anchor($RegardingName, '/profile/' . $Activity->RegardingUserID . '/' . $RegardingNameD); $RegardingNameP = Anchor($RegardingNameP, '/profile/' . $Activity->RegardingUserID . '/' . $RegardingNameD); $GenderSuffixCode = 'Third'; $GenderSuffixGender = $Activity->RegardingGender; } $RegardingWallActivityPath = '/profile/activity/' . $Activity->RegardingUserID . '/' . $RegardingNameD . '#Activity_' . $Activity->ActivityID; $RegardingWallLink = Url($RegardingWallActivityPath); $RegardingWall = Anchor(T('wall'), $RegardingWallActivityPath); } if ($RegardingWall == '') $RegardingWall = T('wall'); if ($Activity->Route == '') { $ActivityRouteLink = ''; if ($Activity->RouteCode) $Route = T($Activity->RouteCode); else $Route = ''; } else { $ActivityRouteLink = Url($Activity->Route); $Route = Anchor(T($Activity->RouteCode), $Activity->Route); } // Translate the gender suffix. $GenderSuffixCode = "GenderSuffix.$GenderSuffixCode.$GenderSuffixGender"; $GenderSuffix = T($GenderSuffixCode, ''); if ($GenderSuffix == $GenderSuffixCode) $GenderSuffix = ''; // in case translate doesn't support empty strings. /* Debug: return $ActivityName .'/'.$ActivityNameP .'/'.$RegardingName .'/'.$RegardingNameP .'/'.$RegardingWall .'/'.$Gender .'/'.$Gender2 .'/'.$Route .'/'.$GenderSuffix.($GenderSuffixCode) */ $FullHeadline = T("Activity.{$Activity->ActivityType}.FullHeadline", T($Activity->FullHeadline)); $ProfileHeadline = T("Activity.{$Activity->ActivityType}.ProfileHeadline", T($Activity->ProfileHeadline)); $MessageFormat = ($ProfileUserID == $Activity->ActivityUserID || $ProfileUserID == '' ? $FullHeadline : $ProfileHeadline); return sprintf($MessageFormat, $ActivityName, $ActivityNameP, $RegardingName, $RegardingNameP, $RegardingWall, $Gender, $Gender2, $Route, $GenderSuffix, $RegardingWallLink, $ActivityRouteLink); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hook_culturefeed_social_activity_link_alter(array &$build, $activity_type, CultuurNet\\Search\\ActivityStatsExtendedEntity $extended_entity) {\n}", "function findAndReplaceVariables($activity)\n{\n global $_server_domain_url;\n if (file_exists(SITE_URL_FOR_SHELL)) {\n include_once SITE_URL_FOR_SHELL;\n }\n $data = array(\n '##ORGANIZATION_LINK##' => $activity['organization_name'],\n '##CARD_LINK##' => '<a href=\"' . $_server_domain_url . '/#/board/' . $activity['board_id'] . '/card/' . $activity['card_id'] . '\">' . $activity['card_name'] . '</a>',\n '##LABEL_NAME##' => $activity['label_name'],\n '##CARD_NAME##' => '<a href=\"' . $_server_domain_url . '/#/board/' . $activity['board_id'] . '/card/' . $activity['card_id'] . '\">' . $activity['card_name'] . '</a>',\n '##DESCRIPTION##' => $activity['card_description'],\n '##LIST_NAME##' => $activity['list_name'],\n '##BOARD_NAME##' => '<a href=\"' . $_server_domain_url . '/#/board/' . $activity['board_id'] . '\">' . $activity['board_name'] . '</a>',\n '##USER_NAME##' => '<strong>' . $activity['full_name'] . '</strong>',\n '##CHECKLIST_ITEM_NAME##' => $activity['checklist_item_name'],\n '##CHECKLIST_ITEM_PARENT_NAME##' => $activity['checklist_item_parent_name'],\n '##CHECKLIST_NAME##' => $activity['checklist_name']\n );\n $comment = strtr($activity['comment'], $data);\n return $comment;\n}", "private function getActivityName(AbstractActivity $activity): string\n {\n if($activity instanceof MovementActivity) {\n return sprintf('%s [%s (%d - %d km/h)]',\n $activity->getName(), \n $activity->getIntensity(), \n $activity->getSpeedAverageMin(),\n $activity->getSpeedAverageMax()\n );\n } \n if($activity instanceof BodyweightActivity) {\n return sprintf('%s [%s (%d - %d repeats)]',\n $activity->getName(), \n $activity->getIntensity(), \n $activity->getRepetitionsAvgMin(),\n $activity->getRepetitionsAvgMax()\n );\n } \n if($activity instanceof WeightActivity) {\n return sprintf('%s [%d-%d kg (%d - %d repeats)]',\n $activity->getName(), \n $activity->getWeightAvgMin(),\n $activity->getWeightAvgMax(),\n $activity->getRepetitionsAvgMin(),\n $activity->getRepetitionsAvgMax()\n );\n }\n \n return sprintf('(%d) %s', $activity->getId(), $activity->getName());\n }", "function get_activity_meta( $activity_id, $activity_type ) {\r\n\r\n\t\t// Init Data.\r\n\t\t$data = array();\r\n\r\n\t\tswitch ( $activity_type ) {\r\n\r\n\t\t\tcase 'activity_quote':\r\n\t\t\t\t// Get Quote Data.\r\n\t\t\t\t$data['quote_text'] = bp_activity_get_meta( $activity_id, 'yz-quote-text' );\r\n\t\t\t\t$data['quote_owner'] = bp_activity_get_meta( $activity_id, 'yz-quote-owner' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t// Get Link Data.\r\n\t\t\tcase 'activity_link':\r\n\t\t\t\t$data['link_url'] = bp_activity_get_meta( $activity_id, 'yz-link-url' );\r\n\t\t\t\t$data['link_title'] = bp_activity_get_meta( $activity_id, 'yz-link-title' );\r\n\t\t\t\t$data['link_desc'] = bp_activity_get_meta( $activity_id, 'yz-link-desc' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t// Get Giphy Data.\r\n\t\t\tcase 'activity_giphy':\r\n\t\t\t\t$data['giphy_image'] = bp_activity_get_meta( $activity_id, 'giphy_image' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn apply_filters( 'yz_get_edit_activity_content_by_type', $data, $activity_type, $activity_id );\r\n\t}", "public function getTitle()\n {\n if ($this->isPermit()) {\n $addresses = $this->getField('objectaddresses');\n if ($addresses != false) {\n $location = $addresses[0]['zipcode'];\n $location .= ' ' . $addresses[0]['addressnumber'];\n $location .= $addresses[0]['addressnumberadditional'];\n $location .= ' ' . $addresses[0]['city'];\n $result = sprintf(\n '%s %s %s',\n $this->getField('producttype'),\n $this->getField('productactivities'),\n $location\n );\n } else {\n $result = sprintf(\n '%s %s',\n $this->getField('producttype'),\n $this->getField('productactivities')\n );\n }\n } else {\n $result = $this->getField('title');\n }\n return $result;\n }", "function attendance_template_variables($record) {\n $templatevars = array(\n '/%coursename%/' => $record->coursename,\n '/%courseid%/' => $record->courseid,\n '/%userfirstname%/' => $record->firstname,\n '/%userlastname%/' => $record->lastname,\n '/%userid%/' => $record->userid,\n '/%warningpercent%/' => $record->warningpercent,\n '/%attendancename%/' => $record->aname,\n '/%cmid%/' => $record->cmid,\n '/%numtakensessions%/' => $record->numtakensessions,\n '/%points%/' => $record->points,\n '/%maxpoints%/' => $record->maxpoints,\n '/%percent%/' => round($record->percent * 100),\n );\n $extrauserfields = \\core_user\\fields::get_name_fields();\n foreach ($extrauserfields as $extra) {\n $templatevars['/%'.$extra.'%/'] = $record->$extra;\n }\n $patterns = array_keys($templatevars); // The placeholders which are to be replaced.\n $replacements = array_values($templatevars); // The values which are to be templated in for the placeholders.\n // Array to describe which fields in reengagement object should have a template replacement.\n $replacementfields = array('emailsubject', 'emailcontent');\n\n // Replace %variable% with relevant value everywhere it occurs in reengagement->field.\n foreach ($replacementfields as $field) {\n $record->$field = preg_replace($patterns, $replacements, $record->$field);\n }\n return $record;\n}", "protected function helper_fullname_format() {\n\n $fake = new stdClass();\n $fake->lastname = 'LLLL';\n $fake->firstname = 'FFFF';\n $fullname = get_string('fullnamedisplay', '', $fake);\n if (strpos($fullname, 'LLLL') < strpos($fullname, 'FFFF')) {\n return 'lf';\n } else {\n return 'fl';\n }\n }", "function formatRealNameField(SugarBean $focus, $fields_array, $key, $value)\n{\n global $locale;\n\n if (!empty($focus->field_defs[$fields_array[$key]]['type']) &&\n $focus->field_defs[$fields_array[$key]]['type'] == 'relate' &&\n !empty($focus->field_defs[$fields_array[$key]]['module']) &&\n $focus->field_defs[$fields_array[$key]]['module'] == 'Users' &&\n !empty($focus->field_defs[$fields_array[$key]]['rname']) &&\n $focus->field_defs[$fields_array[$key]]['rname'] == 'full_name'\n ) {\n $userFocus = BeanFactory::newBean('Users');\n $userFocus->retrieve_by_string_fields(array('user_name' => $value ));\n if (!empty($userFocus->id)) {\n $value = $locale->formatName($userFocus);\n }\n }\n\n return $value;\n}", "public function defineType($name, $activity = []) {\n $this->SQL->replace('ActivityType', $activity, ['Name' => $name], true);\n }", "function entity_rewrite($entity_type, &$entity)\n{\n $translate = entity_type_translate_array($entity_type);\n\n // By default, fill $entity['entity_name'] with name_field contents.\n if (isset($translate['name_field'])) { $entity['entity_name'] = $entity[$translate['name_field']]; }\n\n // By default, fill $entity['entity_shortname'] with shortname_field contents. Fallback to entity_name when field name is not set.\n if (isset($translate['shortname_field'])) { $entity['entity_shortname'] = $entity[$translate['name_field']]; } else { $entity['entity_shortname'] = $entity['entity_name']; }\n\n // By default, fill $entity['entity_descr'] with descr_field contents.\n if (isset($translate['descr_field'])) { $entity['entity_descr'] = $entity[$translate['descr_field']]; }\n\n // By default, fill $entity['entity_id'] with id_field contents.\n if (isset($translate['id_field'])) { $entity['entity_id'] = $entity[$translate['id_field']]; }\n\n switch($entity_type)\n {\n case \"bgp_peer\":\n // Special handling of name/shortname/descr for bgp_peer, since it combines multiple elements.\n\n if (Net_IPv6::checkIPv6($entity['bgpPeerRemoteAddr']))\n {\n $addr = Net_IPv6::compress($entity['bgpPeerRemoteAddr']);\n } else {\n $addr = $entity['bgpPeerRemoteAddr'];\n }\n\n $entity['entity_name'] = \"AS\".$entity['bgpPeerRemoteAs'] .\" \". $addr;\n $entity['entity_shortname'] = $addr;\n $entity['entity_descr'] = $entity['astext'];\n break;\n\n case \"sla\":\n $entity['entity_name'] = 'SLA #' . $entity['sla_index'];\n if (!empty($entity['sla_target']) && ($entity['sla_target'] != $entity['sla_tag']))\n {\n if (get_ip_version($entity['sla_target']) === 6)\n {\n $sla_target = Net_IPv6::compress($entity['sla_target'], TRUE);\n } else {\n $sla_target = $entity['sla_target'];\n }\n $entity['entity_name'] .= ' (' . $entity['sla_tag'] . ': ' . $sla_target . ')';\n } else {\n $entity['entity_name'] .= ' (' . $entity['sla_tag'] . ')';\n }\n $entity['entity_shortname'] = \"#\". $entity['sla_index'] . \" (\". $entity['sla_tag'] . \")\";\n break;\n\n case \"pseudowire\":\n $entity['entity_name'] = $entity['pwID'] . ($entity['pwDescr'] ? \" (\". $entity['pwDescr'] . \")\" : '');\n $entity['entity_shortname'] = $entity['pwID'];\n break;\n }\n}", "function getHeaderDisplayName($currentTable = '', $currentSQL = '', $mode = 0){\n\t\n\tglobal $APP_CONFIG, $BXAF_CONFIG;\n\t\n\t\n\tif ($mode == 1){\n\t\tif ($APP_CONFIG['DICTIONARY'][$currentTable][$currentSQL]['Title_Browse'] != ''){\t\n\t\t\treturn $APP_CONFIG['DICTIONARY'][$currentTable][$currentSQL]['Title_Browse'];\t\n\t\t} elseif ($BXAF_CONFIG['MESSAGE'][$currentTable]['Column'][$currentSQL]['Title_Browse'] != ''){\n\t\t\treturn $BXAF_CONFIG['MESSAGE'][$currentTable]['Column'][$currentSQL]['Title_Browse'];\n\t\t}\n\t} elseif ($mode == 2){\n\t\tif ($APP_CONFIG['DICTIONARY'][$currentTable][$currentSQL]['Title_Search'] != ''){\t\n\t\t\treturn $APP_CONFIG['DICTIONARY'][$currentTable][$currentSQL]['Title_Search'];\t\n\t\t} elseif ($BXAF_CONFIG['MESSAGE'][$currentTable]['Column'][$currentSQL]['Title_Search'] != ''){\n\t\t\treturn $BXAF_CONFIG['MESSAGE'][$currentTable]['Column'][$currentSQL]['Title_Search'];\n\t\t}\n\t}\n\t\n\tif ($APP_CONFIG['DICTIONARY'][$currentTable][$currentSQL]['Title'] != ''){\n\t\t\n\t\treturn $APP_CONFIG['DICTIONARY'][$currentTable][$currentSQL]['Title'];\t\n\t\t\n\t} elseif ($APP_CONFIG['MESSAGE'][$currentSQL] != ''){\n\t\t\n\t\treturn $APP_CONFIG['MESSAGE'][$currentSQL];\n\t\t\n\t} elseif ($BXAF_CONFIG['MESSAGE'][$currentTable]['Column'][$currentSQL]['Title'] != ''){\n\t\t\n\t\treturn $BXAF_CONFIG['MESSAGE'][$currentTable]['Column'][$currentSQL]['Title'];\n\t\t\n\t} else {\n\t\treturn ucwords(str_replace('_', ' ', strtolower($currentSQL)));\n\t}\n}", "function thb_title_format($content) {\n\t\treturn '%s';\n\t}", "function entity_short_name($type, $entity)\n{\n global $config, $entity_cache;\n\n if (is_numeric($entity))\n {\n $entity = get_entity_by_id_cache($type, $entity);\n }\n\n $translate = entity_type_translate_array($type);\n\n $text = $entity[$translate['name_field']];\n\n return($text);\n}", "function nt_generate_course_title($course_type,$active_id){\n\tif( $course_type == 'sfwd-courses' ) {\n\n\t\t$title = get_the_title($active_id);\n\n\t}\n\n\tif( $course_type == 'sfwd-lessons' ) {\n\n\t\t$course_id \t\t= \tget_post_meta( $active_id , 'course_id' , true );\n\t\t$course_title \t= \tget_the_title( $course_id );\n\t\t$lesson_title = get_the_title( $active_id );\n\n\t\t$title = $course_title.': '.$lesson_title;\n\n\t}\n\n\tif( $course_type == 'sfwd-topic' ) {\n\n\t\t$course_id \t\t= \tget_post_meta( $active_id , 'course_id' , true );\n\t\t$course_title \t= \tget_the_title( $course_id );\n\n\t\t$lesson_id\t\t=\tget_post_meta( $active_id , 'lesson_id' , true );\n\t\t$lesson_title\t=\tget_the_title( $lesson_id );\n\n\t\t$topic_title = get_the_title( $active_id);\n\n\t\t$title = $course_title.': '.$lesson_title.': '.$topic_title;\n\t}\n\n\treturn $title;\n}", "function theme_pi_authoring_inquiry_activities($new_activity_link)\n{\n\t$output='';\n\t$link = l('here', $new_activity_link); \t\n\t// Display some boilerplate text about defining activities...\n\t$output .=\"<div class='help'>\\n\";\n\t$output .= \"<p>\";\n\t$output .= t(\"Each activity in an inquiry is allocated to a phase. A phase is a conceptual part of the inquiry model, for example, \" .\n\t \" <em>Find My Topic</em>, <em>Data Collection</em> and <em>Reflect</em> can all be phases in an inquiry. Click !link to add a new activity.</p>\", \n\t array('!link' => $link));\n\t$output .= \"</div>\\n\";\n\treturn $output;\n}", "private function createActivityTable()\n {\n $createTable = \"CREATE TABLE IF NOT EXISTS `mapping`.`userActivity` (\n\n `oldAttemptID` int(11) NOT NULL, \n `userId` varchar(50) NOT NULL DEFAULT '00',\n `sessionId` varchar(50) NOT NULL DEFAULT '00',\n\n `oldActivityId` varchar(45) DEFAULT NULL, \n `contentId` varchar(50) NOT NULL DEFAULT '00',\n `revisionNumber` int(11) NOT NULL DEFAULT 1,\n `contentLanguageCode` varchar(50) NOT NULL DEFAULT 'en',\n `extraParams` varchar(100) DEFAULT NULL,\n\n `timeTaken` int(11) NOT NULL DEFAULT 0,\n `score` int(11) NOT NULL DEFAULT 0,\n `result` varchar(50) DEFAULT NULL,\n `activityType` varchar(20) DEFAULT NULL,\n `status` varchar(20) DEFAULT NULL,\n `activityTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n `contentAttemptNumber` int(11) NOT NULL DEFAULT 1,\n `srNo` int(11) NOT NULL AUTO_INCREMENT,\n `mode` varchar(20) NOT NULL DEFAULT 'Activity',\n `subject` varchar(20) NOT NULL DEFAULT 'math',\n `isSchoolLogin` int(10) NOT NULL DEFAULT 1,\n `contentType` varchar(20) DEFAULT 'activity',\n `attemptCount` int(10) NOT NULL DEFAULT 1\n \n PRIMARY KEY (`srNo`),\n CONSTRAINT UC_User_Attempt UNIQUE (userId,oldActivityId,oldAttemptID)\n )\";\n $result = $this->mySQL->rawQuery($createTable);\n }", "function _cwt_core_legacy_title($field) {\n // Simulate page variables.\n if (isset($field['entity']) && isset($field['entity']->type)) {\n $variables = array();\n $variables['node'] = $field['entity'];\n return _cwt_core_custom_page_title($variables);\n }\n}", "function formatActivityModelName($description, $subject)\n{\n return str_replace(' ', '', $description) . '_' . strtolower(str_replace('App\\\\', '', $subject));\n}", "function add_types_for_translation() {\n\t\t$dummy = __(\"added\", \"simple-history\");\n\t\t$dummy = __(\"approved\", \"simple-history\");\n\t\t$dummy = __(\"unapproved\", \"simple-history\");\n\t\t$dummy = __(\"marked as spam\", \"simple-history\");\n\t\t$dummy = __(\"trashed\", \"simple-history\");\n\t\t$dummy = __(\"untrashed\", \"simple-history\");\n\t\t$dummy = __(\"created\", \"simple-history\");\n\t\t$dummy = __(\"deleted\", \"simple-history\");\n\t\t$dummy = __(\"updated\", \"simple-history\");\n\t\t$dummy = __(\"nav_menu_item\", \"simple-history\");\n\t\t$dummy = __(\"attachment\", \"simple-history\");\n\t\t$dummy = __(\"user\", \"simple-history\");\n\t\t$dummy = __(\"settings page\", \"simple-history\");\n\t\t$dummy = __(\"edited\", \"simple-history\");\n\t\t$dummy = __(\"comment\", \"simple-history\");\n\t\t$dummy = __(\"logged in\", \"simple-history\");\n\t\t$dummy = __(\"logged out\", \"simple-history\");\n\t\t$dummy = __(\"added\", \"simple-history\");\n\t\t$dummy = __(\"modified\", \"simple-history\");\n\t\t$dummy = __(\"upgraded it\\'s database\", \"simple-history\");\n\t\t$dummy = __(\"plugin\", \"simple-history\");\n\t}", "function getActivityNameFromItem($item){\n $activity_name = '';\n switch ($item->type){\n case \"2\": //单品活动名称\n case \"3\": //餐装活动名称\n $activity = $this->activity_model->getItemById($item->activity);\n $activity_name = $activity->activity_name;\n break;\n case \"4\": //区域总代理名称\n $providerinfo = $this->user_model->getUserInfoByid($item->activity);\n $activity_name = $providerinfo->username;\n break;\n }\n\n return $activity_name;\n }", "function column_job($item){\n return sprintf('%1$s',\n /*$1%s*/ $item['job']\n );\n }", "function program_format_string($post,$type='full'){\n\t// full returns Bachelor of Arts<br />Bachelor of Science\n\n\t$format = get_field('program_format', $post->ID);\n\t$formats = array();\n\n\tif(!empty($format)){\n\t\n\t\tforeach($format as $item){\n\n\t\t\tif($item == 'ba'){\n\t\t\t\tif($type == 'short'){\n\t\t\t\t\t$formats[] = 'BA';\n\t\t\t\t} else {\n\t\t\t\t\t$formats[] = 'Bachelor of Arts';\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tif($item == 'bs'){\n\t\t\t\tif($type == 'short'){\n\t\t\t\t\t$formats[] = 'BS';\n\t\t\t\t} else {\n\t\t\t\t\t$formats[] = 'Bachelor of Science';\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$separator = ($type == 'short') ? ', ' : '<br />';\n\n\t\treturn implode($separator,$formats);\n\n\t} else {\n\n\t\treturn false;\n\n\t}\n\n\t\t\n}", "function modify_contact_methods($profile_fields) {\n\n // Add new fields\n $profile_fields['publication'] = 'Publication';\n $profile_fields['display_title'] = 'Title (i.e.: \\'Editor\\'; leave blank to not display)';\n $profile_fields['instagram'] = 'Instagram username';\n $profile_fields['email_public'] = 'Public E-mail address (displayed on site)';\n\n return $profile_fields;\n}", "function format_field_value($field_name,$field_value,$field_type)\n\t{\n\t\tif($field_type == \"datetime\")\n\t\t{\n\t\t\tif($field_name == 'dob')\n\t\t\t{\n\t\t\t\t$field_value = date('l\\, F jS\\, Y',strtotime($field_value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$field_value = date('g:ia \\o\\n l\\, F jS\\, Y', strtotime($field_value));\n\t\t\t}\n\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($field_name == 'event_name')\n\t\t\t{\n\t\t\t\tif($field_value == 'resume')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"resumed working\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'qbreak')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"took a break\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'pause')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"paused work\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'work')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"continued working\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$field_value = $field_value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $field_value;\n\t}", "public static function typeTitle()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->language()->addToStack('your_activity_streams_acp');\n\t}", "function testModeName($type) {\n switch ($type) {\n case 'firstName':\n $tagType = 'First Name';\n break;\n case 'lastName':\n $tagType = 'Last Name';\n break;\n case 'customerFeedback':\n $tagType = 'Feedback';\n break;\n default:\n $tagType = 'First and Last Name';\n }\n\n return '[Test Mode: Customer ' . $tagType . ' will appear here]';\n }", "function TextualRefStr($entry, $usage) {\r\n\t\treturn $this->LastNamesStr($entry, 2) . ' ' . $this->ListStartStr() . $entry['year'] . $this->ListEndStr();\r\n\t}", "function GetDisplayNameField($table = \"\")\n{\n\tglobal $cDisplayNameField;\n\treturn $cDisplayNameField;\n}", "function checkUserName($type) {\n\t\t//0=full-link,1=full-no link,2=Username-no link\n\t\tif($type == 2){$query = \"SELECT Username FROM users WHERE ID='\".$this->id.\"'\";}\n\t\telse {$query = \"SELECT Username, Level_access, advanceImage, Active FROM users WHERE ID='\".$this->id.\"'\";}\n\t\t$result = mysqli_query($conn, $query);\n\t\t$row = mysqli_fetch_array($result);\n\t\tif($type == 0){$frontUser = '<a href=\"'.$this->ssl.'://dev.animeftw.tv/profile/' . $row['Username'] . '\">';$endUser = '</a>';}\n\t\telse {$frontUser = '';$endUser = '';}\n\t\tif($type == 2){\n\t\t\t$fixedUsername = $row['Username'];\n\t\t}\n\t\telse {\n\t\t\tif($row['Active'] == 1){\n\t\t\t\tif($row['Level_access'] == 1){$fixedUsername = '<img src=\"'.$this->ssl.'://static.ftw-cdn.com/site-images/adminbadge.gif\" alt=\"Admin of Animeftw\" style=\"vertical-align:middle;\" border=\"0\" />' . $frontUser . $row['Username'] . $endUser;}\n\t\t\t\telse if($row['Level_access'] == 2){$fixedUsername = '<img src=\"'.$this->ssl.'://static.ftw-cdn.com/site-images/manager.gif\" alt=\"Group manager of Animeftw\" style=\"vertical-align:middle;\" border=\"0\" />'.$frontUser.$row['Username'].$endUser;}\n\t\t\t\telse if($row['Level_access'] == 7){$fixedUsername = '<img src=\"'.$this->ssl.'://static.ftw-cdn.com/site-images/advancedimages/'.$row['advanceImage'].'.gif\" alt=\"Advanced User Title\" style=\"vertical-align:middle;\" border=\"0\" />'.$frontUser.$row['Username'].$endUser;}\n\t\t\t\telse{$fixedUsername = $frontUser.$row['Username'].'</a>';}\n\t\t\t}\n\t\t\telse {$fixedUsername = $frontUser.'<s>'.$row['Username'].'</s>'.$endUser;}\n\t\t}\n\t\treturn $fixedUsername;\n\t}", "public function render($headlineType = 'h2') {\n\t\t$out = '';\n\t\t$headlineType = $this->wire('sanitizer')->entities($headlineType); \n\t\tforeach($this as $key => $value) {\n\t\t\tif(!strlen($value)) continue; \n\t\t\tif($headlineType) $out .= \"<$headlineType>\" . $this->label($key) . \"</$headlineType>\";\n\t\t\tif(strpos($value, '<') === false || !preg_match('{</[a-z]+[0-9]*>}i', $value)) {\n\t\t\t\t$out .= \"<p>$value</p>\"; // doesn't already have markup, so add some\n\t\t\t} else {\n\t\t\t\t$out .= \"$value\"; // already has markup\n\t\t\t}\n\t\t}\n\t\treturn $out; \n\t}" ]
[ "0.5326969", "0.47461152", "0.47251424", "0.4718605", "0.46802086", "0.46786553", "0.46759078", "0.46686903", "0.4659167", "0.4643696", "0.4599947", "0.45995623", "0.45705825", "0.45454887", "0.45436478", "0.45155153", "0.44917852", "0.44447616", "0.44393432", "0.4406534", "0.4401368", "0.43905118", "0.43785885", "0.43778715", "0.43683013", "0.4365966", "0.43653893", "0.43613464", "0.43507168", "0.43405828" ]
0.59203094
0
Takes a string and formats it so that it can be saved to a PHP file in doublequotes of an array value assignment. For example, from garden/library/core/class.locale.php: $FileContents[] = "\$LocaleSources['".$SafeLocaleName."'][] = '".$Format>ArrayValueForPhp($LocaleSources[$i])."';";
public static function ArrayValueForPhp($String) { return str_replace('\\', '\\', html_entity_decode($String, ENT_QUOTES)); // $String = str_replace('\\', '\\', html_entity_decode($String, ENT_QUOTES)); // return str_replace(array("'", "\n", "\r"), array('\\\'', '\\\n', '\\\r'), $String); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePhp($dataArry, $fileName) {\n $langFile = fopen($fileName, \"w\") or die(\"Unable to open file!\");\n $txt = \"<?php\\r\\n\";\n fwrite($langFile, $txt);\n foreach ($dataArry as $key => $value) {\n if(strpos($key, 'comment') !== false) {\n $txt = \"\\r\\n\".$value.\"\\r\\n\";\n } else {\n $txt = \"$$key = $value;\\r\\n\";\n }\n fwrite($langFile, $txt);\n }\n $txt = \"?>\";\n fwrite($langFile, $txt);\n fclose($langFile);\n }", "function add_magic_quotes($input_array)\n {\n }", "function wrapFileContents($sFileContents) {\n\t\t$sString = \"<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\";\n\t\t$sString .= \"\\n\\n\";\n\t\t$sString .= \"\n\t\t/**\n\t\t *\n\t\t *\n\t\t * =============== IMPORTANT ===============\n\t\t *\n\t\t * This FILE IS GENERATED VIA CODE...\n\t\t * Do not edit directly!! Refer to Data_model.\n\t\t *\n\t\t * =============== IMPORTANT ===============\n\t\t *\n\t\t */\n\t\t\";\n\t\t$sString .= \"\\n\\n\";\n\t\t$sString .= $sFileContents;\n\n\t\t/*$sString .= '?>';*/ \t// IMPORTANT : we are not added the closing php tag /\n\t\t\t\t\t\t\t\t// This way, we can append to the config file later on\n\n\t\treturn $sString;\n\t}", "function arrayToFile($oldList, $key, $value, $fileName, $name) {\n $oldList[\"$key\"] = $value;\n $newList = http_build_query($oldList, '', ', ');\n $newList = noAscii($newList);\n $newList = str_replace(\"=\", \"=>\", \"$newList\");\n $newList = '\"'.$newList;\n $newList = str_replace(\"=>\", '\"=>\"', $newList);\n $newList = str_replace(\", \", '\", \"', $newList);\n $arrayFile = fopen(\"$fileName\", \"w\");\n fwrite($arrayFile, \"<?php \".'$'.$name.' = array('.$newList.'\"); ?>');\n fclose($arrayFile);\n}", "function getStringtoAppend($aDataInFormat, $sConfigItemName, $sFormat) {\n\n\t\t$bString = \"\\n\\n\";\n\t\t$bString .= '$config' . \"['\". $sConfigItemName.\"_\".$sFormat. \"'] = \";\n\t\t$bString .= var_export($aDataInFormat, true);\n\t\t$bString .= ';';\n\n\t\treturn $bString;\n\t}", "private function encodePhpCode($fileContents) {\n\t\t $matches = Array();\n\t\t \n\t\t if (preg_match(\"/.*echo[\\s]+\\\"(.*)\\\"/\", $fileContents, $matches) || preg_match(\"/.*echo[\\s]+\\'(.*)\\'/\", $fileContents, $matches) || preg_match(\"/.*print+\\(\\\"(.*)\\\"\\)/\",$fileContents,$matches) || preg_match(\"/.*print+\\(\\'(.*)\\'\\)/\",$fileContents,$matches) || preg_match(\"/.*die+\\(\\\"(.*)\\\"\\)/\",$fileContents,$matches) || preg_match(\"/.*die+\\(\\'(.*)\\'\\)/\",$fileContents,$matches)) {\n\t\t\t $newFileContents = $this->convertToHex($matches[1]);\t\t\t\t\n\t\t\t return str_replace($matches[1], $newFileContents, $fileContents);\n\t\t }\n\t\t else {\n\t\t\t return $fileContents;\t\t \n\t\t }\n\t }", "public function formatStringsAndParsedFormats(): array\n {\n return [\n ['de', ['dd', ['.'], 'MM', ['.'], 'y']],\n ['en', ['MMM', [' '], 'd', [','], [' '], 'y']],\n ];\n }", "private function json_encode_wi_single_quotes( $phpArray )\n {\n // Moves php array to a JSON array\n $jsonData = json_encode( $phpArray );\n // Replace all double quotes with single quotes\n $jsonData = str_replace( '\"', \"'\", $jsonData );\n // Decode HTML special chars\n $jsonData = htmlspecialchars_decode( $jsonData );\n//$this->pObj->dev_var_dump( $phpArray, $jsonData );\n\n return $jsonData;\n }", "function listToFile($oldList, $value, $fileName, $name) {\n $oldList[] = $value;\n $newList = implode('\", \"', $oldList);\n $arrayFile = fopen(\"$fileName\", \"w\");\n fwrite($arrayFile, \"<?php \".'$'.$name.' = array(\"'.$newList.'\"); ?>');\n fclose($arrayFile);\n}", "function l10n_drupal_save_string($value = NULL, $context = NULL, $file = NULL, $line = 0, $string_type = 2 /*POTX_STRING_RUNTIME*/) {\n static $files = array();\n\n // Strip all slashes from string.\n $value = stripcslashes($value);\n\n// if (!isset($files[$file])) {\n // Get file ID for saving, locally cache.\n $files[$file] = l10n_drupal_save_file(NULL, $file);\n// }\n\n // Value set but empty. Mark error on empty translatable string. Only trim\n // for empty string checking, since we should store leading/trailing\n // whitespace as it appears in the string otherwise.\n $check_empty = trim($value);\n if (empty($check_empty)) {\n potx_status('error', t('Empty string attempted to be localized. Please do not leave test code for localization in your source.'), $file, $line);\n return;\n }\n\n // If we have the file entry now, we can process adding the string.\n if (isset($files[$file])) {\n // Explode files array to pid, rid and fid.\n list($pid, $rid, $fid) = $files[$file];\n\n // A \\0 separator in the string means we deal with a string with plural variants.\n // Unlike Drupal core, we store all in the same string, as it is easier\n // to handle later, and we don't need the individual string parts.\n if (!$sid = db_result(db_query(\"SELECT sid FROM {l10n_server_string} WHERE hashkey = MD5('%s')\", $value . $context))) {\n // String does not exist.\n db_query(\"INSERT INTO {l10n_server_string} (value, context, hashkey) VALUES ('%s', '%s', MD5('%s'))\", $value, $context, $value . $context);\n $sid = db_last_insert_id('l10n_server_string', 'sid');\n }\n if (!db_result(db_query(\"SELECT fid FROM {l10n_server_line} WHERE fid = %d AND sid = %d AND lineno = %d AND type = %d\", $fid, $sid, $line, $string_type))) {\n // Location does not exist with this string.\n db_query(\"INSERT INTO {l10n_server_line} (pid, rid, fid, sid, lineno, type) VALUES (%d, %d, %d, %d, %d, %d)\", $pid, $rid, $fid, $sid, $line, $string_type);\n }\n l10n_drupal_added_string_counter($sid);\n }\n}", "private function sprintFromFile(){\n\t\t$count = 0;\n\t\tif (($count = func_num_args()) < 0) \n\t\t\ttrigger_error(\"Error calling function ServiceWebpage::sprintFromFile.\" . \n\t\t\t\t\t\t\t\t\" you must pass at least one parameter\", E_USER_ERROR);\n\t\t\n\t\t$fargs = func_get_args();\n\t\t$format = file_get_contents($fargs[0]);\n\t\t$args = array();\n\t\tfor($i = 1; $i < $count; $i++){\n\t\t\t$args[] = $fargs[$i];\n\t\t}\n\t\treturn vsprintf($format, $args);\n\t}", "function ourExternalTpl($array, $content)\n {\n $content = str_replace(array(\"{TITLE}\", \"{PROJECT}\", \"{VERSION}\"), array($array['title'], $array['system']['title_project'], $array['system']['version_cms']), $content);\n foreach ($array['lang'] as $key => $value) {\n $content = str_replace(\n '{' . strtoupper($key) . '}',\n $value,\n $content\n );\n }\n echo $content;\n }", "function formatStr($str)\t{\n\t\tif (is_array($this->conf[\"general_stdWrap.\"]))\t{\n\t\t\t$str = $this->local_cObj->stdWrap($str,$this->conf[\"general_stdWrap.\"]);\n\n\t\t}\n\t\treturn $str;\n\t}", "protected function processPhp(array $data)\n {\n\t\t$content = \"<?php \\n /* generated config file */ \\n return \";\n\t\t$content .= $this->printArray($data);\n\t\t$content .= \"\\n?>\";\n\n return $content;\n\t}", "function prepareVariableString($value) {\n\t\t if (!is_array($value)) {\n\t\t return '\"'.addslashes($value).'\"';\n\t\t } else {\n\t\t $str = 'array('.chr(10);\n\t\t foreach ($value as $key => $item) {\n\t\t $str .= '\"'. addslashes($key).'\" => '.'\"'.addslashes($item).'\",'.chr(10);\n\t\t } \n\t\t $str .= \")\";\n\t\t } \n\t\t return $str;\n\t\t}", "public function format(array $message);", "function writeToAFile(string $file,array $array)\n\t{\n\t\treturn file_put_contents($file, implode(\"\\n\",$array));\n\t}", "private static function replacePhp($string)\n {\n $fieldParts = preg_split('/[\\.]/', $string);\n $pointer = \"$\" . array_shift($fieldParts);\n foreach ($fieldParts as $fieldPart) {\n if ($fieldPart === '') {\n continue;\n }\n $pointer .= \"->{$fieldPart}\";\n }\n return $pointer;\n }", "public static function setDateFormats(array $array) {\n $settings = self::getSettings();\n \n $translations = self::getTranslations();\n if(isset($array[$settings->language])) {\n $settings->dateformat = json_encode($array[$settings->language]);\n unset($array[$settings->language]);\n }\n foreach($array as $language => $dateformats) {\n $translations[$language] = $dateformats;\n }\n self::setTranslations($translations);\n }", "protected abstract function formatArrayValue(array $value);", "function writeTemplate($pluginname, $strings) {\n echo '<?php\n\n /**\n * YourLanguage file for plugin '.$pluginname.'\n *\n * @package frog\n * @subpackage plugin.'.$pluginname.'.translations\n *\n * @author Your Name <[email protected]>\n * @version Frog x.y.z\n */\n\n return array(\n ';\n\n $strings = removeDoubles($strings);\n sort($strings);\n\n foreach ($strings as $string) {\n echo \"\\t'\".$string.\"' => '',\\n\";\n } \n\n echo \" );\\n\\n\\n\\n\\n\\n\";\n}", "protected function createJavaScriptLanguageLabelsFromFiles() {}", "public static function php2str($value, $formatOutput = true, $indent = 0, $tab = 2)\n {\n static $rep = ['\\\\' => '\\\\\\\\', \"\\n\" => '\\n', \"\\r\" => '\\r', \"\\t\" => '\\t', \"\\v\" => '\\v', \"\\e\" => '\\e', \"\\f\" => '\\f'];\n if (is_array($value))\n {\n if (count($value) == 0) return '[]';\n $tmp = [];\n $isInteger = array_keys($value) === range(0, count($value) - 1);\n if ($formatOutput)\n {\n $indent += $tab;\n if ($isInteger)\n {\n foreach ($value as $v)\n {\n $tmp[] = static::php2str($v, true, $indent, $tab);\n }\n }\n else\n {\n foreach ($value as $k => $v)\n {\n $tmp[] = static::php2str($k) . ' => ' . static::php2str($v, true, $indent, $tab);\n }\n }\n $space = PHP_EOL . str_repeat(' ', $indent);\n return '[' . $space . implode(', ' . $space, $tmp) . PHP_EOL . str_repeat(' ', $indent - $tab) . ']';\n }\n if ($isInteger)\n {\n foreach ($value as $v)\n {\n $tmp[] = static::php2str($v);\n }\n }\n else\n {\n foreach ($value as $k => $v)\n {\n $tmp[] = static::php2str($k) . ' => ' . static::php2str($v);\n }\n }\n return '[' . implode(', ', $tmp) . ']';\n }\n if (is_null($value)) return 'null';\n if (is_bool($value)) return $value ? 'true' : 'false';\n if (is_int($value)) return $value;\n if (is_float($value)) return str_replace(',', '.', $value);\n $flag = false;\n $value = preg_replace_callback('/([^\\x20-\\x7e]|\\\\\\\\)/', function($m) use($rep, &$flag)\n {\n $m = $m[0];\n if ($m == '\\\\') return '\\\\\\\\';\n $flag = true;\n return isset($rep[$m]) ? $rep[$m] : '\\x' . str_pad(dechex(ord($m)), 2, '0', STR_PAD_LEFT);\n }, $value);\n if ($flag) return '\"' . str_replace('\"', '\\\"', $value) . '\"';\n return \"'\" . str_replace(\"'\", \"\\\\'\", $value) . \"'\";\n }", "public function load_php_strings() {\n global $DB, $CFG, $COURSE;\n \n $include_icons_config = $DB->get_record('course_format_options', array('courseid' => $COURSE->id, 'name' => 'cmf_allowicons'));\n \n if(!$include_icons_config)\n $include_icons = 0;\n else\n $include_icons = $include_icons_config->value;\n \n echo \"<script>\";\n echo \"var course_menu_strings = new Array();\";\n echo \"course_menu_strings['wwwroot'] ='$CFG->wwwroot';\";\n echo \"course_menu_strings['confirm_delete_message'] ='\" . get_string('confirm_delete_message', 'format_course_menu') . \"';\";\n echo \"course_menu_strings['yes'] ='\" . get_string('yes') . \"';\";\n echo \"course_menu_strings['no'] ='\" . get_string('no') . \"';\";\n echo \"course_menu_strings['courseid'] = \" . $COURSE->id . \";\";\n echo \"course_menu_strings['ajax'] = '\" . $CFG->wwwroot . \"/course/format/course_menu/ajax_controller.php';\";\n echo \"course_menu_strings['include_icons'] = \".$include_icons.\";\";\n echo \"course_menu_strings['new_header'] = '\".get_string('new_header', 'format_course_menu').\"';\";\n \n echo \"</script>\";\n }", "protected function buildLangFileContent(array $content, $fillValues = false, $tag = false)\n {\n if ($tag) {\n $str = \"<?php\\nreturn [\\n\\t\";\n } else {\n $str = \"[\\n\\t\";\n }\n\n foreach ($content as $key => $value) {\n if (is_array($value)) {\n $value = $this->buildLangFileContent($value, $fillValues);\n $str .= \"\\t'{$key}' => {$value},\\n\";\n } else {\n if ($fillValues) {\n $value = stripslashes($value);\n $value = addcslashes($value, \"'\");\n } else {\n $value = '';\n }\n\n $str .= \"\\t'{$key}' => '{$value}',\\n\";\n }\n }\n if ($tag) {\n $str .= '];';\n } else {\n $str .= ']';\n }\n\n return $str;\n }", "function format_array( $name, &$array2format ){\n $cnt = 0;\n $ret = '';\n\n if( count($array2format) === 0 ){\n //no values, create empty array to have a default in settings.conf\n return $name.'[0]=\"\"';\n }\n\n reset($array2format);\n foreach( $array2format as $val ){\n if( $val != '' ){\n $ret .= $name.\"[$cnt]='$val'\\n\";\n ++$cnt;\n }\n }\n\n $ret = trim($ret, \"\\n\");\n return $ret;\n }", "function sFix($sString)\r\n {\r\n return \"'\".str_replace(\"\\\\\", \"\\\\\\\\\",str_replace(\"'\", \"''\",$sString)).\"'\";\r\n }", "private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }", "function save_file($file, $array) {\n\t$handle = fopen($file, 'w');\n\t$saveList = implode(\"\\n\", $array);\n\tfwrite($handle, $saveList);\n\tfclose($handle);\n}", "public function translated_string($str_arr, $lang, $filename, $lang_id)\n {\n $data = array();\n $ids = array();\n foreach ($str_arr as $key => $value) {\n $ids[] = $key;\n $data[] = array(\n 'id' => $key,\n 'msgstr' => $value,\n 'idlang' => $lang_id\n );\n }\n $this->db->update_batch('language_strings', $data, 'id');\n if ($this->db->affected_rows() > 0) {\n $u_d = $this->select_language_data_byid($lang_id);\n $write_arr = array();\n foreach ($u_d as $value) {\n $write_arr[$value['msgid']] = $value['msgstr'];\n }\n $new_file = $filename;\n unlink($filename);\n $fp = fopen($new_file, \"w\");\n fclose($fp);\n $file = fopen($new_file, \"r+\") or exit(\"Unable to open file!\");\n $data = \"msgid \\\"\\\"\\nmsgstr \\\"\\\"\\n\"\n . \"\\\"Project-Id-Version: bbweb\\\\n\\\"\\n\"\n . \"\\\"POT-Creation-Date: \".date(\"y-m-d H:i:s\").\"\\\\n\\\"\\n\"\n . \"\\\"PO-Revision-Date: \".date(\"y-m-d H:i:s\").\"\\\\n\\\"\\n\"\n . \"\\\"Last-Translator: \\\\n\\\"\\n\"\n . \"\\\"Language-Team: \\\\n\\\"\\n\"\n . \"\\\"Language: \".$lang.\"\\\\n\\\"\\n\"\n . \"\\\"Content-Type: text/plain; charset=UTF-8\\\\n\\\"\\n\"\n . \"\\\"MIME-Version: 1.0\\\\n\\\"\\n\"\n . \"\\\"Content-Transfer-Encoding: 8bit\\\\n\\\"\\n\";\n fwrite($file, $data.\"\\n\");\n foreach ($write_arr as $key => $value) {\n fwrite($file, 'msgid \"' . $key . '\"' . \"\\n\" . 'msgstr \"'.$value.'\"' . \"\\n\\n\");\n }\n fclose($file);\n return true;\n } else {\n return false;\n }\n }" ]
[ "0.56080866", "0.52931154", "0.51993495", "0.51685536", "0.4968104", "0.49564168", "0.49076852", "0.48984757", "0.48818907", "0.48762092", "0.48754045", "0.48197764", "0.47999957", "0.47823283", "0.47758347", "0.4767979", "0.47071046", "0.46898544", "0.46783492", "0.4678051", "0.46720824", "0.46501312", "0.46442226", "0.4614497", "0.46011797", "0.45990714", "0.45958343", "0.45884454", "0.45847324", "0.4576106" ]
0.6134357
0
Format a string from of "Deleted" content (comment, message, etc).
public static function Deleted($Mixed) { if (!is_string($Mixed)) { return self::To($Mixed, 'Deleted'); } else { $Formatter = Gdn::Factory('HtmlFormatter'); if (is_null($Formatter)) { return Gdn_Format::Display($Mixed); } else { return $Formatter->Format(Wrap($Mixed, 'div', ' class="Deleted"')); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isDeletedHumanReadable($attribute)\n {\n if ( $this->bean->deleted) return __('invoice_label_deleted');//e.g. Storno in german\n return '';\n }", "function delete_format($text, $etiquetas_permitidas = NULL)\n{\n return strip_tags($text, $etiquetas_permitidas);\n}", "public function bootstrapDeletedFunction(array $args = []): string {\n return $this->bootstrapDeleted(ArrayHelper::get($args, \"content\"));\n }", "protected function isDeleted(){\n return parent::isStatusOf(STATUS_TYPE_SSS_COMMENT_DELETED);\n }", "public function fromDeleteQuery(\\Yana\\Db\\Queries\\IsDeleteQuery $query): string;", "public function getDeleteTitle()\n {\n return sprintf($this->_('Delete %s'), $this->getTopic(1));\n }", "public function getStatusMessage()\n\t{\n\t\t$actionPhrase = 'Deleting';\n\t\t$typePhrase = 'Add-on data';\n\n\t\t$currentType = ucfirst(str_replace('_', ' ', $this->currentType));\n\n\t\t if ($currentType)\n\t\t{\n\t\t\treturn sprintf('%s... %s (%s)', $actionPhrase, $typePhrase, $currentType);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn sprintf('%s... %s', $actionPhrase, $typePhrase);\n\t\t}\n\t}", "public function get_delete()\n {\n $del = $this->alias;\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n return \"delete $del $from $join $where $group $order $limit\";\n }", "protected function delete_comment_success_message(){\r\n\t\treturn 'Comment deleted.';\r\n\t}", "private function act_mdel($raw) {\n\t\treturn \"<a class=\\\"msg-delete\\\" data-done=\\\"0\\\" data-recid=\\\"{$raw['id']}\\\" href=\\\"#\\\">Delete Message</a>\";\n\t}", "public static function deletedSuccess(string $message = null): string\n {\n if ($message) {\n return __($message);\n }\n return __('Record deleted successfully!');\n }", "private function formatDeleteCommand( $where = null )\n {\n $sql = 'DELETE FROM ' . $this->table_name;\n\n if ( $where != null )\n $sql .= ' WHERE ' . $where;\n\n return $sql;\n }", "static function cleanupDescription($string){\n \n }", "protected function delete_comment_failure_message(){\r\n\t\treturn 'Comment could not be deleted.';\r\n\t}", "public function action_delete_entry_message( int $nbr_deleted ) {\n\t\tif ( $nbr_deleted <= 0 ) {\n\t\t\tadd_settings_error( self::POST_ACTION_ID, 'deletion_failed', __( 'Entry deletion failed.', 'autowpdb-example-plugin' ) );\n\t\t\treturn;\n\t\t}\n\n\t\tadd_settings_error(\n\t\t\tself::POST_ACTION_ID,\n\t\t\t'deletion_success',\n\t\t\t__( 'Oldest entry successfully deleted.', 'autowpdb-example-plugin' ),\n\t\t\t'success'\n\t\t);\n\t}", "protected function deleteTags($string)\n {\n return '<del>' . htmlentities($string) . '</del>';\n }", "function hook_convention_member_deleted($member)\n{\n \\Drupal::messenger()->addMessage(t(\"Member %first %last has been deleted.\", ['first' => $member['first_name'], 'last' => $member['last_name']]));\n}", "public function formatComment(string $comment): string;", "function renderFileDeletionSuccess() {\n\t\t$this->pi_loadLL();\n\t\t$subpart = tslib_CObj::getSubpart($this->fileContent, '###MESSAGE###');\n\t\t$markerArray['###FORM_URL###'] = $this->cObj->typolink('', $this->conf['filelist.']['fileDeleteSuccessMessage.']['form_url.']);\n\t\t$markerArray['###LABEL_MESSAGE###'] = $this->pi_getLL('LABEL_MESSAGE');\n\t\t$markerArray['###MESSAGE_TEXT###'] = $this->pi_getLL('MESSAGE_TEXT_DELETION_SUCESS');\n\t\t$markerArray['###BUTTON_NEXT###'] = '<input name=\"ok\" type=\"submit\" value=\"' . $this->pi_getLL('BUTTON_NEXT') . '\">';\n\t\t#$this->pi_linkTP_keepPiVars('<img src=\"'.$this->iconPath.'icon_ok2.gif'.'\" style=\"border-width: 0px\"/> &nbsp;'.$this->pi_getLL('BUTTON_NEXT'),array('showUid'=>'','deleteUID'=>'', 'confirmDeleteUID'=>''));\n\t\t$content = tslib_cObj::substituteMarkerArray($subpart, $markerArray);\n\t\treturn $content;\n\t}", "function renderFileDeletion($record) {\n\n\t\t$single_Code = tslib_CObj::getSubpart($this->fileContent, '###FILE_DELETION###');\n\t\t// Formating Timefields and filesize\n\t\t$record['tstamp'] = date('d.m.Y', $record['tstamp']);\n\t\t$record['crdate'] = date('d.m.Y', $record['crdate']);\n\t\t#$record['file_size'] = t3lib_div::formatSize($record['file_size'],' bytes | kb| mb| gb');\n\n\t\t// converting all fields in the record to marker (recordfields and markername must match)\n\t\t$markerArray = $this->recordToMarkerArray($record);\n\t\t$markerArray = $markerArray + $this->substituteLangMarkers($single_Code);\n\t\t$markerArray['###FORM_URL###'] = $this->cObj->typolink('', $this->conf['filelist.']['fileDeleteMessage.']['form_url.']);\n\t\t$hiddenFields = '<input type=\"hidden\" name=\"deleteUID\" value=\"' . $record['uid'] . '\" />';\n\t\t$markerArray['###HIDDENFIELDS###'] = $hiddenFields;\n\t\t$this->pi_loadLL();\n\t\t$content = tslib_cObj::substituteMarkerArray($single_Code, $markerArray);\n\t\t$content = tslib_cObj::substituteMarker($content, '###CATEGORY###', $this->cObj->cObjGetSingle($this->conf['singleView.']['category.']['cObject'], $this->conf['singleView.']['category.']['cObject.']));\n\t\t$content = tslib_cObj::substituteMarker($content, '###TITLE_SINGLEVIEW###', $record['title']);\n\t\t$content = tslib_cObj::substituteMarker($content, '###CR_DATE_HEADER###', $this->pi_getLL('CR_DATE_HEADER'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###FILE_SIZE_HEADER###', $this->pi_getLL('FILE_SIZE_HEADER'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###CR_DESCRIPTION_HEADER###', $this->pi_getLL('CR_DESCRIPTION_HEADER'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###COPYRIGHT_HEADER###', $this->pi_getLL('COPYRIGHT_HEADER'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###FILETYPE_HEADER###', $this->pi_getLL('FILETYPE_HEADER'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###LINK_HEADER###', $this->pi_getLL('LINK_HEADER'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###TITLE_SINGLEVIEW_HEADER###', $this->pi_getLL('TITLE_SINGLEVIEW_HEADER'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###LABEL_WARNING###', $this->pi_getLL('LABEL_WARNING'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###MESSAGE_DELETION_WARNING###', $this->pi_getLL('MESSAGE_DELETION_WARNING'));\n\t\t$content = tslib_cObj::substituteMarker($content, '###CONFIRM_DELETION_UID###', $this->cObj->stdWrap('<input name=\"CONFIRM_DELETION\" type=\"submit\" value=\"' . $this->pi_getLL('BUTTON_CONFIRM') . '\">', $this->conf['filelist.']['fileDeleteMessage.']['buttonConfirm.']));\n\t\t$content = tslib_cObj::substituteMarker($content, '###CANCEL_DELETION_UID###', $this->cObj->stdWrap('<input name=\"CANCEL_DELETION\" type=\"submit\" value=\"' . $this->pi_getLL('BUTTON_BACK') . '\">', $this->conf['filelist.']['fileDeleteMessage.']['buttonCancel.']));\n\t\treturn $content;\n\t}", "public function kiwip_action_delete_revisions_adm_msg(){\n\t\tif(current_user_can('manage_options')){\n\t \techo '<div id=\"message\" class=\"updated fade\"><p><strong>All posts revisions have been deleted correctly.</strong></p></div>';\n\t }\n\t}", "protected function get_formatted_comment(): string\n\t{\n\t\treturn $this->comment ? \"`$this->comment`\" : '';\n\t}", "function warquest_home_comment_delete_do() {\r\n\t\r\n\t/* input */\r\n\tglobal $uid;\r\n\t\r\n\t/* output */\r\n\tglobal $comment;\r\n\tglobal $output;\r\n\t\r\n\tif (warquest_db_comment_delete($uid) == 1) {\r\n\t\t\r\n\t\t$message = t('HOME_MESSAGE_DELETED');\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\t\t\r\n\t\t\r\n\t\t$comment=\"\";\r\n\t\t$uid=0;\r\n\t}\r\n}", "protected function doDelete($aId) {\n return '';\n }", "public function getDeleteQuestion()\n {\n return sprintf($this->_('Do you want to delete this %s?'), $this->getTopic(1));\n }", "public function cleanMarkings()\n\t{\n\t\t$cleanMarkings=\"\";\n\t\tfor ($i=0;$i<count($this->tokens);++$i)\n\t\t{\n\t\t\t$c=$this->tokens[$i]['type'][0];\n\t\t\tif ($this->tokens[$i]['type']=='symbol')\n\t\t\t\t$c=\"@\";\n\t\t\t$cleanMarkings.=str_repeat($c, strlen($this->tokens[$i]['clean'])).\" \";\n\t\t\tif ($c=='c') //single line comment\n\t\t\t\t$cleanMarkings=substr($cleanMarkings,0,-1).\"\\n \";\n\t\t}\n\t\treturn $cleanMarkings;\n\t}", "protected function messageModelDeleted() {\n return Y::t('flash_success_company_deleted');\n }", "static function remove(string $content): string\n {\n return self::parse($content, function () { return ''; });\n }", "function countDeletedLines()\n {\n }", "public function toString()\n {\n return 'Success delete message on users page is correct.';\n }" ]
[ "0.5667167", "0.5575033", "0.553186", "0.5475639", "0.540219", "0.53625554", "0.53256536", "0.53007126", "0.5270107", "0.5265445", "0.51989186", "0.51892465", "0.5153973", "0.51154494", "0.50964725", "0.5078481", "0.5073707", "0.50417674", "0.5029279", "0.5017241", "0.49846396", "0.49788183", "0.49756804", "0.49718234", "0.4942085", "0.49344125", "0.4909543", "0.48953158", "0.4891703", "0.48635858" ]
0.6129164
0
Takes a mixed variable, formats it for display in a form, and returns it.
public static function Form($Mixed) { if (!is_string($Mixed)) return self::To($Mixed, 'Form'); else return nl2br(htmlspecialchars($Mixed, ENT_QUOTES, C('Garden.Charset', ''))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _formatVariable($variable, $data)\n {\n switch($variable)\n {\n // s.products variable is probably the trickiest\n case 'products':\n // Do we have a string already, or an array?\n if(is_array($data))\n {\n $allowed = array('category', 'sku', 'quantity', 'price', 'events', 'evars');\n $products = array();\n \n // Loop through the incoming data\n foreach($data as $key => $product)\n {\n // Which data source to use?\n $dn = 'product';\n if(!is_array($data[$key]))\n $dn = 'data';\n \n $d =& $$dn;\n \n // Build the string\n $p = array();\n foreach($allowed as $v)\n $p[] = (isset($d[$v]) ? $d[$v] : '');\n $products[] = implode(';', $p);\n }\n return implode(',', $products);\n }\n \n // A regular string was passed in\n return $data;\n break;\n \n // Events could be an array\n case 'events':\n if(is_array($data))\n $data = implode(',', $data);\n return $data;\n break;\n \n // RSID list could be an array\n case 's_account':\n if(is_array($data))\n $data = implode(',', $data);\n return $data;\n break;\n \n // No formatting required\n default:\n return $data;\n break;\n }\n }", "function format($value);", "function display_format($var) {\n\tswitch($var) {\n\n\tcase \"sticker\":\t\treturn \"Sticker #\";\n\tcase \"type\":\t\treturn \"Type\";\n\tcase \"description\":\treturn \"Description\";\n\tcase \"serial\":\t\treturn \"Serial\";\n\tcase \"purchasedate\":\treturn \"Purchase Date\";\n\tcase \"temp_assignment\":\treturn \"Assignment\";\n\tcase \"computernumber\":\treturn \"Number\";\n\tcase \"videocard\":\treturn \"Video Card\";\n\tcase \"videobus\":\treturn \"Bus Type\";\n\tcase \"cpu\":\t\treturn \"CPU Type\";\n\tcase \"harddrive\":\treturn \"Hard Drive\";\n\tcase \"memory\":\t\treturn \"Memory\";\n\tcase \"servicetag\":\treturn \"Dell Tag\";\n\tcase \"batch\":\t\treturn \"Batch\";\n\tcase \"expresscode\":\treturn \"Express Code\";\n\tcase \"warranty\":\treturn \"Warranty\";\n\tcase \"mayadongle\":\treturn \"Maya Dongle\";\n\tcase \"firstname\":\treturn \"First Name\";\n\tcase \"lastname\":\treturn \"Last Name\";\n\tcase \"department\":\treturn \"Department\";\n\tcase \"extension\":\treturn \"Extension\";\n\tcase \"status\":\t\treturn \"Status\";\n\tcase \"user_status\":\treturn \"Status\";\n\tcase \"active\":\t\treturn \"Active\";\n\t\t\n\tdefault: return \"NOT FORMATTED: $var\";\n\t}\n}", "function process_variable( $variable_string ) {\n\t\treturn $this->variable_processor()->process_field( '{{' . $variable_string . '}}', true );\n\t}", "function format_input($data) { \n $data = trim($data); // Strips unnecessary characters (extra space, tab, newline) from the user input data\n $data = stripslashes($data); // Removes backslashes from the user input data\n $data = htmlspecialchars($data); // When a user tries to submit in a text \n // field. The code is now safe to be displayed on a page or inside an e-mail.\n return $data;\n}", "function _mixed($mixed)\n {\n return $mixed;\n }", "private function buildField($field, $type, $variable, $value = true)\n {\n $column = strtolower($field['name']);\n $title = ucfirst($field['name']);\n\n if ($value === true) {\n $value = '$' . $variable . '->' . $column;\n } else {\n $value = 'old(\"'.$column.'\")';\n }\n\n $syntax = [];\n\n switch($type) {\n case 'string':\n default:\n $input = 'text';\n break;\n case 'text':\n $input = 'textarea';\n break;\n }\n\n $syntax[] = '<div class=\"form-group @if($errors->has('.\"'\". $column . \"'\".')) has-error @endif\">';\n $syntax[] = ' <label for=\"' . $column . '-field\">' . $title . '</label>';\n\n if($this->illuminate) {\n $syntax[] = ' {!! Form::' . $input . '(\"' . $column . '\", ' . $value . ', array(\"class\" => \"form-control\", \"id\" => \"' . $column . '-field\")) !!}';\n } else {\n $syntax[] = $this->htmlField($column, $variable, $field, $type);\n }\n\n $syntax[] = ' @if($errors->has(\"' . $column . '\"))';\n $syntax[] = ' <span class=\"help-block\">{{ $errors->first(\"' . $column . '\") }}</span>';\n $syntax[] = ' @endif';\n $syntax[] = '</div>';\n\n return join(\"\\n\".str_repeat(' ', 20), $syntax);\n }", "abstract function format();", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "public function doFormat($value)\n {\n return $value;\n }", "function danger_var($variable)\n{\n\tif (get_magic_quotes_gpc())\n\t{\n\t\treturn $variable;\n\t}\n\n // array\n\tif (is_array($variable))\n\t{\n\t\tforeach($variable as $var)\n\t\t{\n\t\t\t$var = addslashes($var);\n\t\t}\n\t}\n\n\t// variable\n\telse\n\t{\n\t\t$variable = addslashes($variable);\n\t}\n\n\treturn $variable;\n}" ]
[ "0.63394445", "0.60693514", "0.60602486", "0.5944916", "0.57294756", "0.5712904", "0.56080425", "0.559707", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55688834", "0.55515176", "0.55316675" ]
0.61834204
1
This closes the form
function closeForm() { # Open form and configure echo "</form>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close()\n\t{\n\t\treturn '</form>';\n\t}", "static function closeForm()\n {\n echo '</form>'.PHP_EOL;\n }", "public function close()\n {\n return '</form>';\n }", "public function close()\n {\n return '</form>';\n }", "public function close() {\n\t\treturn Kohana_Form::close();\n\t}", "public static function close(){\n\t\t\treturn '</form>';\n\t\t}", "public static function close()\n\t{\n\t\treturn '</form>';\n\t}", "public function closeForm()\n {\n return \"</form>\";\n }", "public function close()\n {\n return $this->form->close();\n }", "public function close()\n {\n $this->form = null;\n $this->fields = null;\n\n return '</form>';\n }", "function close()\n\t{\n\t echo <<< FORMCLOSE\n\t \n\t </form>\nFORMCLOSE;\n\t}", "public static function form_close() {\n\t\t\treturn '</form>';\n\t\t}", "function close_form($no_link_back=false, $equery=false) {\r\n\t\tparent::close_form($no_link_back,$equery);\r\n\t\tglobal $percorso;\r\n\t\t$percorso.=$this->percorso_agg;\r\n\t}", "public function renderFormClose()\n {\n if ( !empty( $this->viewState ) )\n $this->renderInput( 'hidden', '__viewState', $this->saveViewState() );\n echo \"</div></form>\\n\";\n }", "public static function close()\n {\n\n echo \"<input type=\\\"hidden\\\" name=\\\"csrf\\\" value=\\\"\" . \\Jet\\App\\Engine\\Tools\\Utils::generateToken() . \"\\\">\";\n\n if (self::$name) {\n\n echo \"<input type=\\\"hidden\\\" name=\\\"\" . self::$name . \"\\\" value=\\\"\" . self::$check . \"\\\">\";\n }\n\n echo \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"\" . self::$check . \"\\\">\";\n\n echo \"</form>\";\n\n self::$check = null;\n self::$name = null;\n }", "public function formClose()\n {\n return $this->renderHtmlForm('CloseStub');\n }", "function close() {\r\n\t\t// \"implementado en la clase <i>\" . get_class($this) . \"</i></h1>\";\r\n\t\treturn FALSE;\r\n\t}", "public function action_close()\n\t{\n\t\treturn \"</div>\\n\";\n\t}", "public function endForm()\r\n {\r\n echo '<div class=\"panel-footer\">\r\n <input type=\"submit\" class=\"btn btn-primary btn-sm\" value=\"Vote\" />\r\n </div>\r\n </form>';\r\n }", "public static function endForm(){\n\t\treturn '</form>';\n\t}", "public function close() {\n // DO NOTHING!!!!\n }", "function close_form($tabs = 0)\n{\n close_tag('form', Tab($tabs), true) ;\n}", "public function closeWindow() {}", "public function Close()\n {\n $this->CallJqUiMethod(\"close\");\n }", "function m_button4OnButtonClick( $event )\n {\n // Exit the Program.\n $this->Close();\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function closeModal()\n {\n $this->isOpen = false;\n }", "public function closeModal()\n {\n $this->isOpen = false;\n }", "public function closeModal()\n {\n $this->isOpen = false;\n }" ]
[ "0.825081", "0.8160708", "0.81497127", "0.81497127", "0.81237364", "0.80452025", "0.7982476", "0.7869709", "0.78319377", "0.7794086", "0.7574034", "0.7501565", "0.74894893", "0.74258375", "0.73170304", "0.716834", "0.6862789", "0.68613833", "0.6823914", "0.6785757", "0.6775357", "0.6770722", "0.676999", "0.6744311", "0.67285496", "0.67156917", "0.6714939", "0.67022777", "0.67022777", "0.67022777" ]
0.8445237
0
end method vName($name) Validate Name Method This method function validates alpha characters
function vAlpha( $name ) { return ctype_alpha( $name ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function validateName($name) {\n if (preg_match(\"/^[a-zA-Z]*$/\",$name))\n return true;\n else\n return false;\n }", "function validName($name)\r\n {\r\n $name = str_replace(' ', '', $name);\r\n return !empty($name) && ctype_alpha($name);\r\n }", "function validName($name)\n {\n //name should not be empty and should contain only letters\n return !empty($name) && ctype_alpha($name);\n }", "static function validName($name)\r\n {\r\n if (ctype_alpha($name)) {\r\n return $name;\r\n } else if ($name == \"\") {\r\n return !empty($name);\r\n }\r\n }", "function vName( $name ) \r\n\t\t{\t \r\n\t\t\t\t\r\n\t\t\t\treturn preg_match (\"/^[a-zA-ZàáâäãåąćęèéêëìíîïłńòóôöõøùúûüÿýżźñçčšžÀÁÂÄÃÅĄĆĘÈÉÊËÌÍÎÏŁŃÒÓÔÖÕØÙÚÛÜŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'-]+$/u\", $name);\r\n\t\t\t\t\t\t \r\n\t\t}", "public function name_validation($name){\n\t\tif(!preg_match('/^[a-zA-Z0-9. ]*$/',$name)){ \n\t\t\treturn true;\n \t}\n }", "private function ValidateName($name){\n if (empty($name)){ //checks if empty\n $this->valid = False;\n }else if (strlen($name)>= 30){ //checks max length\n $this->valid = False;\n }else if(!preg_match(\"/^[a-zA-Z ]*$/\",$name)){ //checks format\n $this->valid = False;\n }\n }", "function isValidName($name)\n{\n if (! preg_match(\"/^[a-zA-Z ]*$/\", $name)) {\n return false;\n }\n return true;\n}", "function validName($name) {\r\n //checks to see that a string is all alphabetic\r\n return\r\n (\r\n (!empty($name)) && ctype_alpha($name));\r\n}", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "function validate_name($name){\n\n\tif(empty($name)){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t else if(count(explode(' ',$name)) <2){\n\t\t\n\t\t\n\t\t\treturn false;\n\t\t\n\t}\n\t\n\telse if(!preg_match(\"/^[a-zA-Z \\.\\-]*$/\",$name)){\n\t\t\n\t\t\n\t\treturn false;\n\t}\n\telse if(!preg_match(\"/^[a-zA-Z]*$/\",$name[0])){\n\t\t\n\t\t\n\t\treturn false;\n\t}\n\telse{\n\t\t\n\t\treturn true;\n\t}\n\t\n\t\n}", "function name_validation($str)\n{\n return preg_match(\"/^[a-zA-Z ]+$/\", $str);\n}", "public static function isValidName($name) {}", "function ValidateName($name)\n{\n $chars = str_split($name);\n\n // Assess each character\n foreach ($chars as $char) {\n if (!ValidateChar($char)) {\n return false;\n }\n }\n\n // // Check for empty\n // if (empty($name)) {\n // return false;\n // }\n\n return true;\n}", "function validateName($name) {\n\tif (!preg_match('/[^A-Za-z]+/', $name) && strlen($name) >= 2 && strlen($name) <= 20)\n\t\treturn 1;\t//name is valid\n\telse\n\t\treturn 0;\n}", "function validateName()\n {\n global $inName, $validForm, $nameErrMsg;\t\t//Use the GLOBAL Version of these variables instead of making them local\n $nameErrMsg = \"\";\t\t\t\t\t\t\t\t//Clear the error message.\n if($inName==\"\")\n {\n $validForm = false;\t\t\t\t\t//Invalid name so the form is invalid\n $nameErrMsg = \"Name is required\";\t//Error message for this validation\n }\n\n else if(!preg_match(\"/^[a-zA-Z\\s]+$/\",$inName)){\n $validForm=false;\n $nameErrMsg=\"Please use only letters\";\n }\n\n else\n {\n $inLname = trim($inName);\t\t\t\t//Removes leading/trailing characters\n $inLname = htmlspecialchars($$inName);\t//converts special characters\n }\n }", "public function validate_name($str){\n $allowed = array(\".\", \"-\", \"_\", \" \"); // you can add here more value, you want to allow.\n if(ctype_alnum(str_replace($allowed, '', $str ))) {\n return true;\n }\n else{\n return false;\n }\n }", "function validateUserName($name)\n {\n /**condition for validating the type and size of user input string\n *takes user input name as a parameter for validating with the set conditons\n */\n if (preg_match('/[a-zA-Z]{3}/', $name)) {\n return true;\n }\n }", "public function name(string $name) : bool\n\t{\n\t\tif (!preg_match(\"/^[a-zA-Z ]*$/\",$name)) {\n\t\t\t$this->errors[] = 'Only letters and white space allowed';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function _validateUsername($name)\n {\n return trim(substr(preg_replace('/[^A-Za-z0-9_ \\-]/', '',$name),0,24)); \n }", "function validate_name($name)\r\n\t{\r\n\t\t$trim = trim($name);\r\n\t\tif(strlen($trim) > 1)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "static function checkNames($input)\r\n {\r\n if (preg_match('/^[\\w\\W][\\w\\W]{1,20}$/', $input)) {\r\n return true; //Illegal Character found!\r\n } else {\r\n echo PageBuilder::printError(\"Please enter alphabets only in name fields.\");\r\n return false;\r\n }\r\n }", "function _name_check($str){\n }", "public static function validateName($name) {\n\t\tif (!empty($name)) {\n\t\t\tif (preg_match('/^[a-z0-9 ]{3,}$/i', $name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function isValidName ($name)\r\n{\r\n global $cf_reservedpattern;\r\n\r\n $reservedpattern = $cf_reservedpattern ? $cf_reservedpattern : '[_a-z]{0,1}([\\d]+)';\r\n\r\n if (preg_match(\"%^\".$reservedpattern.\"$%i\", $name, $matches))\r\n return FALSE; // reserved - not permitted\r\n\r\n $pattern = '[a-z\\d][_a-z\\d]{2,23}';\r\n if (preg_match('%^'.$pattern.'$%i', $name))\r\n if (!preg_match(\"%^(api|com|biz|def|gov|net|org|wap|web|www|gamma|mobile|mygamma|buzzcity|netbeacon)[\\d]*$%i\", $name))\r\n return TRUE;\r\n\r\n return FALSE; // not permitted\r\n}", "function validateName($name)\n {\n return (mb_strlen($name) <= CUSTOMER_NAME_MAX_LENGTH && mb_strlen($name) !== 0);\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 validateName()\n {\n if (strlen(trim($_POST[$this->key])) < $this->minLength) {\n self::$errors[] = $this->convertUnderscores() . \" field requires at least $this->minLength characters\";\n }\n\n //check for profanity.\n if ($this->noProfanity) {\n $this->checkProfanity();\n }\n\n //lastly, check for valid first name patterns.\n\n if (!preg_match(\"/^[a-zA-Z]+[ -\\/\\\\'\\\"]*[a-zA-Z]+[ \\\"]{0,2}[a-zA-Z]*$/\", trim($_POST[$this->key]))) {\n self::$errors[] = \"Not a valid \" . $this->convertUnderscores();\n }\n\n return self::$errors ? false : true;\n }", "function isValidShortName($name) {\n return preg_match('#^[a-z0-9]+$#i', $name);\n}", "function is_name_valid($input)\n {\n return (preg_match(\"/^([-a-z_ ])+$/i\", $input)) ? TRUE : FALSE;\n }" ]
[ "0.80756146", "0.7972373", "0.7971554", "0.790553", "0.7826933", "0.7824815", "0.7800675", "0.7800347", "0.7778845", "0.77771544", "0.7695056", "0.76348805", "0.7585482", "0.7506745", "0.7496989", "0.7480855", "0.73191863", "0.7316122", "0.7265886", "0.7163066", "0.7149014", "0.7138326", "0.7034504", "0.7027338", "0.7018455", "0.70162535", "0.70103574", "0.7003881", "0.69758314", "0.6964652" ]
0.80704457
1