query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Test case for landedCostShipmentPurchaseOrderGETRequestShipmentIDPurchaseOrdersOrderIDGet Retrieves a shipment purchase order.. | public function testLandedCostShipmentPurchaseOrderGETRequestShipmentIDPurchaseOrdersOrderIDGet()
{
} | [
"public function testLandedCostShipmentGETRequestShipmentIDGet()\n {\n }",
"public function testGoodsReceivedNotePurchaseOrdersGETManyRequestGRNIDPurchaseOrdersGet()\n {\n }",
"public function testGETShipmentsShipmentIdPrints()\n {\n }",
"public function testProcurementPurchaseordersIdGet()\n {\n\n }",
"function ordersdetail_get() {\n\n\t\tif($this->get('custid')){\n\n\t\t\t$custid = $this->get('custid');\n\t\t\t$orders_object = Orders::ordersService();\n\n\t\t\ttry{\n\t\t\t\t$ordersdetail = $orders_object->GetOrders(LICENCE, $custid);\n\t\t\t}\n\t\t\tcatch(SoapFault $soapFault){\n\t\t\t\tvar_dump($soapFault);\n \t\techo \"Request :<br>\", htmlentities($orders_object->__getLastRequest()), \"<br>\";\n \t\techo \"Response :<br>\", htmlentities($orders_object->__getLastResponse()), \"<br>\";\n\t\t\t}\n\n\t\t\tif(isset($ordersdetail)){\n \t\t$this->response($ordersdetail, 200);\n \t\t}\n \t\telse{\n \t\t\t$this->response(array('success' => false, 'error' => 'No data found!'), 404);\n \t\t}\n\t\t}\n\t\telse{\n $this->response(array('success'=>false, 'error'=>'Oders custid is missing/invalid'), 400);\n }\n\t}",
"public function testOrdersIdGet()\n {\n $result = $this->orderApi->ordersIdGet(221);\n $this->assertInstanceOf(Order::class, $result);\n $this->assertStringContainsStringIgnoringCase(\"221\", $result->getName());\n foreach ($result->getInvoiceIds() as $invoice) {\n $this->assertInstanceOf(OrderInvoiceIds::class, $invoice);\n $this->assertStringContainsStringIgnoringCase(\"FC0032\", $invoice->getNumber());\n $this->assertEquals(\"paid\", $invoice->getState());\n }\n \n }",
"function testOrderIDRetrieval() {\n\t\t$init = $this->getDonorTestData();\n\t\tunset( $init['order_id'] );\n\t\t$init['payment_method'] = 'cc';\n\t\t$init['payment_submethod'] = 'visa';\n\n\t\t// no order_id from anywhere, explicit generate\n\t\t$gateway = $this->getFreshGatewayObject( $init, [ 'order_id_meta' => [ 'generate' => false ] ] );\n\t\t$this->assertNull( $gateway->getData_Unstaged_Escaped( 'order_id' ), 'Ungenerated order_id is not null. The rest of this test is broken.' );\n\n\t\t$gateway->do_transaction( 'INSERT_ORDERWITHPAYMENT' );\n\n\t\t$this->assertNotNull( $gateway->getData_Unstaged_Escaped( 'order_id' ), 'No order_id was retrieved from INSERT_ORDERWITHPAYMENT' );\n\t}",
"public function testProcurementPurchaseordersGet()\n {\n\n }",
"function get_order_details($orderno,$getnodes=false)\n{\n\t$params = array(\"arg0\"=>APPTIVO_ECOMMERCE_API_KEY,\"arg1\" => APPTIVO_ECOMMERCE_ACCESSKEY, \"arg2\" => $orderno,\"arg3\" => $getnodes);\n\t$response = ecommerce_soap_call(CART_WSDL,'getOrderDetailsByOrderNumber',$params);\n\treturn $response;\n}",
"public function testGETShipmentsShipmentIdPrintsPrintId()\n {\n }",
"protected function _getPayPalOrder()\n {\n }",
"public function testPurchaseOrderReceiptsNumberGet()\n {\n }",
"function shipment_get($order_id){\n\t$query = \"SELECT SHIPMENT_ID, SHIPMENT_TYPE_ID, PRIMARY_ORDER_ID, CURRENCY_UOM_ID, ORIGIN_CONTACT_MECH_ID, ORIGIN_TELECOM_NUMBER_ID, DESTINATION_CONTACT_MECH_ID, DESTINATION_TELECOM_NUMBER_ID, PARTY_ID_TO,\n\t\t\t\t PARTY_ID_FROM, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, HANDLING_INSTRUCTIONS\n\t\t\t FROM shipment\n\t\t\t WHERE PRIMARY_ORDER_ID = '\".esc($order_id).\"'\n\t\t\t LIMIT 1\";\n\treturn db_query_to_row($query);\n}",
"private function retrivePendingPurchaseOrder() {\n $loginUserId = $_COOKIE[\"userid\"];\n \n // print(\"retrive pending order\");\n /* $query3V = \"SELECT * FROM shot_details sh, entity_department_assoc ety, vendor vh , (SELECT status,identify_id,\n worker_team_type, worker_id, shot_dept_det_id, MAX(version) AS maxversion FROM shot_work_details WHERE worker_team_type IN (2,3)\n GROUP BY worker_id,worker_team_type,shot_dept_det_id,identify_id ) output WHERE output.shot_dept_det_id=sh.id AND\n output.worker_team_type=ety.entity_type_id and output.worker_id = ety.entity_id AND ety.entity_id =vh.id group by sh.shotcode\"; */\n \n /* $query3V = \"SELECT * FROM shot_details sh, entity_department_assoc ety, vendor vh ,shot_dept_details sdd,po_shot_assoc psa, shot_work_details swd, (SELECT status as shotstatus,identify_id ,\n worker_team_type, worker_id, shot_dept_det_id,shot_dept_details_identify_id, MAX(version) AS maxversion FROM shot_work_details WHERE worker_team_type IN (4)\n GROUP BY worker_id,worker_team_type,shot_dept_det_id,identify_id ) output WHERE output.identify_id!=psa.shot_work_details_identify_id and output.maxversion=swd.version and swd.shot_dept_details_identify_id=sdd.identify_id and sdd.shot_det_id=sh.id AND\n swd.worker_team_type=ety.entity_type_id and swd.worker_id = ety.entity_id AND ety.entity_id =vh.id group by sh.shotcode,ouput.identify_id\"; */\n \n $existQueryResult = $this->getTotalCount($loginUserId);\n $count = (int)$existQueryResult;\n // print(\"count\".$count);\n if ($count == 0) {\n $query3V = \"\n SELECT sh.id, sh.shotallocationprojectdetailsid, sh.shotcode, s.status as shot_status,sh.receiveddate, ety.entity_type_id, ety.entity_id, ety.price,\n sdd.internalmandays, vh.id as vendorid, output.shotstatus, vh.name, sdd.shot_det_id, sdd.identify_id as shotDept,\n output.shotWork_Identify FROM shot_details sh, entity_department_assoc ety, vendor vh,\n shot_dept_details sdd, shot_work_details swd, status s,(SELECT status as shotstatus,\n identify_id as shotWork_Identify, worker_team_type, worker_id, shot_dept_det_id, shot_dept_details_identify_id,\n MAX(version) AS maxversion FROM shot_work_details WHERE worker_team_type IN(4) GROUP BY worker_id, worker_team_type,\n shot_dept_det_id, identify_id)\n output WHERE\n output.shot_dept_details_identify_id = sdd.identify_id and sdd.shot_det_id = sh.id AND s.id=output.shotstatus AND \n output.worker_team_type = ety.entity_type_id and output.worker_id = ety.entity_id AND ety.entity_id = vh.id group by\n sh.shotcode, output.shotWork_Identify \";\n \n // print($query3V);\n $r3V = $this->mysqli->query($query3V) or die($this->mysqli->error . __LINE__);\n if ($r3V->num_rows > 0) {\n $result3V = array();\n while ($row3V = $r3V->fetch_assoc()) {\n $result3V[] = $row3V;\n }\n // print($result3V);\n $this->response($this->json($result3V), 200); // send PO details\n }\n $this->response('', 204);\n \n }\n \n \n else {\n $query3V = \"\n SELECT sh.id, sh.shotallocationprojectdetailsid, sh.shotcode, sh.receiveddate, ety.entity_type_id, ety.entity_id, ety.price,\n sdd.internalmandays, vh.id as vendorid, output.shotstatus, vh.name, sdd.shot_det_id, s.status as shot_status, sdd.identify_id as shotDept,\n output.shotWork_Identify FROM shot_details sh, entity_department_assoc ety, vendor vh,\n shot_dept_details sdd, shot_work_details swd, status s,(SELECT status as shotstatus,\n identify_id as shotWork_Identify, worker_team_type, worker_id, shot_dept_det_id, shot_dept_details_identify_id,\n MAX(version) AS maxversion FROM shot_work_details WHERE worker_team_type IN(4) GROUP BY worker_id, worker_team_type,\n shot_dept_det_id, identify_id)\n output WHERE output.shotWork_Identify not in (select psa.shot_work_details_identify_id from po_shot_assoc psa) and\n output.shot_dept_details_identify_id = sdd.identify_id and sdd.shot_det_id = sh.id AND output.shotstatus=s.id AND \n output.worker_team_type = ety.entity_type_id and output.worker_id = ety.entity_id AND ety.entity_id = vh.id group by\n sh.shotcode, output.shotWork_Identify\";\n \n // print($query3V);\n $r3V = $this->mysqli->query($query3V) or die($this->mysqli->error . __LINE__);\n if ($r3V->num_rows > 0) {\n $result3V = array();\n while ($row3V = $r3V->fetch_assoc()) {\n $result3V[] = $row3V;\n }\n // print($result3V);\n $this->response($this->json($result3V), 200); // send PO details\n }\n $this->response('', 204);\n }\n \n}",
"public function testPurchaseInvoiceGETRequestPurchaseInvoiceIDGet()\n {\n }",
"public function callOrderRequest();",
"public function trial_order_retrieve()\n {\n \n }",
"function DRIVE_getOrderById($orderId){\n\tglobal $ch;\n\t// #1 - get Order By Id\n\t$url = backendUrl . '/SearchWS/QueryAsEntities';\n\n\t$params = array('itemQuery' => '{\n\t\t\t\t\t\t\t\t \"entityName\": \"Ft\",\n\t\t\t\t\t\t\t\t \"distinct\": false,\n\t\t\t\t\t\t\t\t \"lazyLoaded\": false,\n\t\t\t\t\t\t\t\t \"SelectItems\": [],\n\t\t\t\t\t\t\t\t \"filterItems\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t \"filterItem\": \"obs\",\n\t\t\t\t\t\t\t\t\t \"valueItem\": \"'.$orderId.'\",\n\t\t\t\t\t\t\t\t\t \"comparison\": 0,\n\t\t\t\t\t\t\t\t\t \"groupItem\": 1\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t \"filterItem\": \"anulada\",\n\t\t\t\t\t\t\t\t\t \"valueItem\": false,\n\t\t\t\t\t\t\t\t\t \"comparison\": 0,\n\t\t\t\t\t\t\t\t\t \"groupItem\": 0\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t ],\n\t\t\t\t\t\t\t\t \"orderByItems\": [],\n\t\t\t\t\t\t\t\t \"JoinEntities\": [],\n\t\t\t\t\t\t\t\t \"groupByItems\": []\n\t\t\t\t\t\t\t\t}');\n\n\n\n\n\t$response=DRIVE_Request($ch, $url, $params);\n\n\tif(empty($response)){\n\t\treturn false;\n\t} else if(count($response['result']) == 0 ){\n\t\treturn null;\n\t}\n\n return $response['result'][0];\n\n}",
"public function orderAction()\n {\n try {\n Mage::helper('groove_hubshoply/debug')->log(\n sprintf('Request for single order from %s', Mage::helper('core/http')->getRemoteAddr()),\n Zend_Log::INFO\n );\n\n $this->_checkAuthorization();\n\n $fields = $this->_initFields();\n $incrementId = $this->getRequest()->getParam('order_id');\n\n if (empty($incrementId)) {\n return $this->_sendError(400, 'Bad Request', 'No order increment ID provided.');\n }\n\n $resource = Mage::getResourceSingleton('sales/order');\n $adapter = $resource->getReadConnection();\n $select = $adapter->select()\n ->from($resource->getMainTable(), $fields)\n ->where('increment_id = ?', $incrementId);\n\n $result = $adapter->fetchRow($select);\n\n if (empty($result)) {\n return $this->_sendError(404, 'Not Found', 'No order for this ID could be found.');\n }\n\n if ($this->_joinAddressFieldsFlag) {\n $result['addresses'] = $this->_getAddresses($result['entity_id']);\n }\n\n $this->getResponse()\n ->setHeader('Content-Type', 'application/json')\n ->setBody(Mage::helper('core')->jsonEncode($result))\n ->sendResponse();\n\n exit;\n } catch (Exception $error) {\n Mage::helper('groove_hubshoply/debug')->logException($error);\n\n $this->_sendError(500, 'Failed to process order request.', $error->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the duplicate_student_name property of this object | public function set_duplicate_student_name($duplicate_student_name)
{
$this->set_default_property(self::PROPERTY_DUPLICATE_STUDENT_NAME, $duplicate_student_name);
} | [
"public function get_duplicate_student_name()\n {\n return $this->get_default_property(self::PROPERTY_DUPLICATE_STUDENT_NAME);\n }",
"public function getDuplicatedName()\n {\n return $this->duplicatedName;\n }",
"protected function onCloneName(): void\n\t{\n\t\t// ensure unique name\n\t\t$this->name = ltrim(uniqid(\"{$this->name}-\"), '-');\n\t}",
"public function setDuplicate() {\n\t\t$this->message = \"User exists, pick another username.\";\n\t}",
"public function setDuplicate($duplicate) {\n\t\t$this->duplicate = $duplicate;\n\t}",
"public function setDuplicate() {\n\t\t@$_SESSION[self::$msgMessage] .= \"User exists, pick another username.\";\n\t}",
"public function modifyNameAsCopy()\n {\n $query = new Query();\n $query->select('name')->from(Script::tableName())->where(\"deleted_at IS NULL AND user_id = :user_id AND status_id != :creating\", [\":user_id\" => $this->user_id, \":creating\" => Publishable::STATUS_CREATING]);\n $data = $query->createCommand()->queryColumn();\n\n $pattern = \"/\" . Yii::t('script', ' \\(copy (\\d+)\\)') . \"/i\";\n\n $original_name = preg_replace($pattern, \"\", $this->name);\n\n $num = 0;\n\n while (in_array($this->name, $data)) {\n $num++;\n $this->name = $original_name . Yii::t('script', ' (copy {n})', ['n' => $num]);\n }\n }",
"public function assignUniqueName($duplicateCounter = null)\n {\n $name = $this->name;\n if (strlen($name) == 0) {\n return;\n }\n $name = strtolower($name);\n\n list ($year,$month,$day) = explode(\"-\", !empty($this->firstaired) ? $this->firstaired : '--');\n\n $chars = array(\n \"é\" => \"e\",\n \"è\" => \"e\",\n \"ê\" => \"e\",\n \"ë\" => \"e\",\n \"à\" => \"a\",\n \"á\" => \"a\",\n \"â\" => \"a\",\n \"ä\" => \"a\",\n \"ì\" => \"i\",\n \"í\" => \"i\",\n \"î\" => \"i\",\n \"ï\" => \"i\",\n \"ò\" => \"o\",\n \"ó\" => \"o\",\n \"ô\" => \"o\");\n $name = str_replace(array_keys($chars), $chars, $name);\n\n $name = preg_replace(\"/[^a-zA-Z0-9\\(\\)]{1}/\", \"_\", $name);\n $name = preg_replace(\"/[\\_]+$/\", \"\", $name);\n $name = preg_replace(\"/^[\\_]+/\", \"\", $name);\n $name = preg_replace(\"/[\\_]+/\", \"_\", $name);\n\n // Cycle through postfixes to avoid duplicate names.\n if ($duplicateCounter !== null) {\n $name .= \"_($year)\";\n\n if ($duplicateCounter > 0) {\n $name .= '_' . $duplicateCounter;\n }\n }\n\n $black_list = array(\"browse\");\n if (in_array($name, $black_list)) {\n $name .= \"_($year)\";\n }\n $duplicate = Series::whereUniqueName($name)->first();\n\n if ($duplicate && $duplicate->id != $this->id) {\n return $this->assignUniqueName($duplicateCounter + 1);\n } else {\n $this->unique_name = $name;\n return $this;\n }\n }",
"public function setDupOprName($value)\n {\n return $this->set(self::DUP_OPR_NAME, $value);\n }",
"public function set_student_last_name( $student_last_name ) {\n\t\t\t$this->student_last_name = $student_last_name;\n\t\t}",
"public function setName($du_name) {\n\t\tglobal $log;\n\t\t// Remember old name, if there was one originally\n\t\t$oldname = ($this->du_name) ? $this->du_name : NULL;\n\t\t$this->du_name = $du_name;\n\t\t$updateQuery = \"\n\t\t\tUPDATE dus \n\t\t\tSET du_name = '\" . $du_name . \"' \n\t\t\tWHERE du_id = '\" . $this->du_id . \"'\"\n\t\t\t;\n\t\tif (query($updateQuery, \"setName()\") === TRUE) {\n\t\t\t// Record successful record update\n\t\t\t$output = date(\"Y-m-d H:i:s T\", time());\n\t\t\t$output .= \" Updated record for du_id \";\n\t\t\t$output .= $this->du_id . \" successfully: \";\n\t\t\t$output .= ($oldname) ? \"changed du_name from '\" . $oldname . \"' to '\" . $du_name . \"'.\\n\" :\n\t\t\t \"set name to '\" . $du_name . \"'.\\n\";\n\t\t\tfwrite($log, $output, 256);\n\t\t}\n\t}",
"public function getStudentName()\n {\n return $this->studentName;\n }",
"public function testsetName(){\n\t\t\n\t\t$this -> assertTrue($this->studentObj -> setName(\"Sai Krishna\"));\n\t\t$this -> assertEquals(\"Sai Krishna\", $this->studentObj -> getName());\n\t\t\n\t}",
"public function getDuplicateTitle()\n {\n \treturn $this->duplicateTitle;\n }",
"function duplicateName(){\n $dup = $this->app['db']->fetchColumn('SELECT id from worlds where name=?', array($this->name));\n if($dup == $this->id || !$dup){\n return false;\n }\n $this->validation_errors[] = 'Name is a duplicate';\n return true;\n }",
"public function setStudentFirstname($student_firstname){\n\t $this->student_firstname = $student_firstname;\n\t }",
"public function getStudentName() {\n\t\treturn($this->studentName);\n\t}",
"public function set_duplicate_original_guid($duplicate_original_guid)\n {\n $this->set_default_property(self::PROPERTY_DUPLICATE_ORIGINAL_GUID, $duplicate_original_guid);\n }",
"public function check_name_duplicate()\n\t{\n $productPerformanceStatus = new ProductPerformanceStatus($this->input);\n $jsonAlert = new JSONAlert();\n\n try {\n $jsonAlert->append_batch(array(\n 'model'=>$productPerformanceStatus,\n 'check_empty'=>array(\n 'name'=>'Name Needed!'\n )\n ));\n } catch(Exception $e) {\n echo 'Message: ' .$e->getMessage();\n }\n\n if( ! $jsonAlert->hasErrors )\n {\n $productPerformanceStatusModelQuery = $this->db->get_where('t_warehouse_product_performance_status', array(\n 'name' => $productPerformanceStatus->name\n ));\n\n \t\tif($productPerformanceStatusModelQuery->num_rows() > 0)\n {\n $jsonAlert->append(array(\n 'errorMsg'=>'Name Duplicated!'\n ), TRUE);\n }\n }\n echo $jsonAlert->result();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update row with corresponding has in table with data data is an array such that [key1 => value1, key2 =>value2, etc] | public function update($table, $hash, $data){
$sql = "UPDATE `".$table."` SET ";
$i=0;
foreach($data as $key => $value){
if($i++!=0) $sql .= " , ";
$sql .= $key ." = :".$key;
}
$sql .= " WHERE `hash` = :hash";
$data["hash"] = $hash;
$stmt = $this->conn->prepare($sql);
$stmt->execute($data);
// echo $sql;
} | [
"public function update(array $row);",
"function update($table, $data, $where=''){\n\t\t$data = $this->checkFields($table, $data);\n\t\tforeach($data as $column=>$value){\n\t\t\t$v_arr[] = \"$column='$value'\";\n\t\t}\n\t\t$sql = \"UPDATE $table SET \".implode(\",\", $v_arr).\" \".$where;\n\t\t$this->exec($sql);\n\t}",
"public function updateRow($row);",
"function update($table, $data);",
"public function update($key, $row);",
"public function prepareRowForUpdate(array $rowData);",
"function update() {\n\t\treset($this->data);\n\t\twhile(list($key,$val)=each($this->data)){\n\t\t\tif($key != $this->idKey) {\n\t\t\t\tif($val === NULL || $val == '') {\n\t\t\t\t\t$my_sql[] = $key . \" = NULL\";\n\t\t\t\t} else {\n //dump($val, 'val');\n if(in_array($key, $this->binaryFields)) {\n //if(strpos($val, \"'\"))\n // raiseError(\"invalid character in binary field data\");\n $my_sql[] = $key . \" = '\". addslashes($val) . \"'\";\n } else {\n $my_sql[] = $key . \" = '\" . sotf_Utils::magicQuotes($val) . \"'\";\n }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$my_sql = implode(\", \", $my_sql);\n\n //execute the query\n $res = $this->db->query(\"UPDATE \" . $this->tablename . \" SET \" . $my_sql . \" WHERE \" . $this->idKey . \"='\" . $this->id . \"' \");\n \n //if the query is dead, stop executio, output error\n if(DB::isError($res)){\n raiseError($res);\n }\n\t}",
"public function update(array $ric, array $newRow);",
"public function update($data){\n\t\tif (isset($data[$this->_primary_key]) && $data[$this->_primary_key] != \"\") {\n $this->db->where($this->_primary_key, $data[$this->_primary_key]);\n return $this->db->update($this->_table, $data);\n }else{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"function update($table,$arr,$where){\r\n\t\tforeach($arr as $key=>$value){\r\n if(is_string($value))\r\n $str[] = \"$key = '$value'\";\r\n else\r\n $str[] = \"$key = $value\";\r\n\t\t}\r\n\t\t$str2 = implode(\",\",$str);\r\n\t\t$this->query(\"update $table set $str2 where $where\");\r\n\t}",
"function updateArr($tableName, $insData, $conditions = array()) {\n $db = new database();\n \n $valueStrings = array();\n foreach ($insData as $name => $value) {\n $valueStrings[] = $name . \" = '\" . $value . \"'\";\n }\n $conditionStrings = array();\n foreach ($conditions as $column => $value) {\n $conditionString = $column;\n $conditionString .= is_array($value)\n ? (\"IN ('\" . implode(\"','\", $value) . \"')\")\n : (\" = '\" . $value . \"'\")\n ;\n $conditionStrings[] = $conditionString;\n }\n $query = 'UPDATE ' . $tableName\n . ' SET ' . implode(', ', $valueStrings)\n . ' WHERE ' . implode(' AND ', $conditionStrings);\n \n // For debug uncomment echo statement\n // echo $query . \"<br>\";\n \n mysql_query($query) or die(mysql_error());\n mysql_close($db->get_link());\n}",
"function update($table,$data,$id){\n $query = \"UPDATE $table SET \";\n foreach ($data as $key => $value) {\n $query .= $key .\" = '\".$value.\"',\";\n }\n $query = substr_replace($query,\"\", -1);\n $query .= \" WHERE id = \".$id;\n return $query;\n}",
"public function update_Ex(array $data, $field, $value);",
"function updateTableField($data=array())\r\n {\r\n $table_name = Str::plural($data['name']); \r\n $o['name'] = $table_name;\r\n $o['oldName'] = $table_name;\r\n\r\n foreach ($data['row'] as $key => $value) {\r\n $o['columns'][$key] = array(\r\n 'name' => $value['field'],\r\n 'oldName' => isset($value['field_old_name'])?$value['field']:'',\r\n 'type' => array(\r\n 'name' => ($value['input_type']=='string')?'varchar':$value['input_type']\r\n ),\r\n 'null' => 'YES',\r\n );\r\n }\r\n $o['columns'][] = array(\r\n 'name' => 'deleted',\r\n 'oldName' => 'deleted',\r\n 'type' => array('name' => 'tinyint'),\r\n 'default' => '0'\r\n );\r\n\r\n $o['columns'][] = self::idColoumn();\r\n $o['columns'][] = self::created();\r\n $o['columns'][] = self::updated();\r\n $o['indexes'] = self::indexesAry($table_name);\r\n $o['primaryKeyName'] = 'primary';\r\n $o['foreignKeys'] = array();\r\n $o['options'] = array();\r\n \r\n return $o;\r\n }",
"function updateTable($argTable, $argArray, $pKey)\n {\n $id=array_pop($argArray);\n $link = agencyConnect();\n $sql = \"UPDATE $argTable SET \";\n $keyvals = array();\n foreach($argArray as $k =>$v)\n {\n $keyvals[] = \"$k = '$v'\";\n }\n //array_pop($keyvals);\n $setString = implode($keyvals ,\", \");\n $sql .=$setString;\n $sql .= \" WHERE $pKey = $id\";\n print($sql);\n print(\"<BR />\");\n $success = $link->query($sql);\n print($link->error);\n $link->close();\n return $success;\n }",
"function updateOne($table, $data) {\n $this->db->update($table, $data);\n }",
"public function updateByPK($row);",
"public function updateRow() {\n try \n {\n $properties = $this->properties();\n // remove last element from array, foreign key\n array_pop($properties);\n if(static::$dbTable == 'artikal') {\n array_pop($properties);\n }\n $database = Database::instance();\n $connection = $database->connect();\n $placeholders = str_repeat('?, ', count($properties) - 1) . '?';\n \n $properties_pairs = array();\n foreach ($properties as $key => $value) {\n $properties_pairs[] = \"{$key}=:{$key}\";\n }\n\n $sql = \"UPDATE \" . static:: $dbTable . \" SET \" . implode(',', $properties_pairs) . \" WHERE id=:id\";\n $stmt = $connection->prepare($sql);\n $properties['id'] = $this->id;\n $stmt->execute($properties);\n return;\n }\n catch (PDOException $e)\n {\n Message::addError('error', $e->getMessage());\n }\n }",
"function query_update($table, $data_array, $attribute, $condition_value){\n if(gettype($table) == \"string\" && gettype($data_array) == \"array\"){\n\n $req_str = \"update \".$table.\" set \";\n foreach ($data_array as $key => $value){\n if($value == \"string\"){\n $req_str = $req_str.$key.\" = '\".$value.\"'\";\n } else{\n $req_str = $req_str.$key.\" = \".$value;\n }\n }\n $req_str.\" where \".$attribute.\" = \".$condition_value;\n\n return $req_str;\n }\n else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ loadout bins compartments on create default selection load | public function loadoutBinsCompartmentsDefault(){
var_dump(Input::all());
} | [
"public function getBinOptions()\n {\n return array(\n 'nbins' => $this->_nbins,\n 'rangeLow' => $this->_rangeLow,\n 'rangeHigh' => $this->_rangeHigh,\n );\n }",
"public function getBins() {\n \tif (!isset(self::$getBins_stmt)) {\n \t\tself::$getBins_stmt = $this->manager->getDB()->prepare(\n\"SELECT\n\tcatalog_id,\n\tcatalog_title\nFROM\n\t course_catalog\n\");\n \t}\n \t\n \tself::$getBins_stmt->execute();\n \t\n \t$bins = array();\n// \t$bins[] = new banner_resource_Bin_Combined($this->manager->getCombinedBinId());\n \twhile ($result = self::$getBins_stmt->fetch(PDO::FETCH_ASSOC)) {\n \t\n \t\t$bins[] = new banner_resource_Bin_PerCatalog(\n\t\t\t\t\t\t\t\t$this->getOsidIdFromString($result['catalog_id']), \n\t\t\t\t\t\t\t\t$result['catalog_title']);\n\t\t}\n\t\t\n\t\tself::$getBins_stmt->closeCursor();\n\t\t\n\t\treturn new phpkit_resource_ArrayBinList($bins);\n }",
"private function binsStep()\n {\n return [\n 'label' => 'bins',\n 'form_type' => ReturnedBinsType::class,\n ];\n }",
"protected function _prepareSubset() {}",
"private function loadoutGrouping($loadout_bins)\n\t{\n\n\t\t$tmp = array();\n\n\t\tforeach($loadout_bins as $arg)\n\t\t{\n\t\t\t$tmp[$arg['sched-id']][] = $arg['loadoutbin'];\n\t\t}\n\n\t\t$output = array();\n\n\t\tforeach($tmp as $type => $labels)\n\t\t{\n\t\t\t$output[] = array(\n\t\t\t\t'sched-id' => $type,\n\t\t\t\t'loadoutbin' => $labels\n\t\t\t);\n\t\t}\n\n\t\treturn $output;\n\t}",
"private function _add_selected_bundle(){\n $selected_bundle_id = $this->input->post('bundle_id');\n $round_id = $this->data['round']['id'];\n $subject_id = $this->subj->get_id();\n\n // set disabled button for special round where parent has 3 children\n if($this->subj->current_round === '47'){\n $special_rounds = array(57=>array(),58=>array(),59=>array());\n\n $child_rounds = array(\n \t57=>array(167, 168, 169, 170),\n \t58=>array(171, 172, 173, 174),\n \t59=>array(175, 176, 177, 178));\n \n // remove the bundle that was selected\n $parent_bundles = array(135=>0, 136=>1, 137=>2, 138=>3);\n \n $parent_selected_bundle_index = $parent_bundles[$selected_bundle_id];\n \n // remove parent selected bundle from all children\n foreach($child_rounds as $round_key=>$bundle_values){\n \tforeach($bundle_values as $bundle_key=>$bundle_value){\t\n \t\tif( $bundle_key == $parent_selected_bundle_index){\n \t\t\t$selected_bundles[] = array('round_id'=>$round_key, 'bundle_id'=>$bundle_value);\n \t\t}\n \t}\n }\n \n foreach($child_rounds as &$bundle_value){\n \tunset($bundle_value[$parent_selected_bundle_index]);\n }\n \n $bundle_index = 1; \n foreach($child_rounds as $child_round_id=>$child_bundles){\n \t$select_index = 1;\n \tforeach($child_bundles as $bundle_id){\n \t\tif($bundle_index == $select_index){\n \t\t\t$selected_bundles[] = array('round_id'=>$child_round_id, 'bundle_id'=>$bundle_id);\n \t\t\t++$bundle_index;\n \t\t\t++$select_index;\n \t\t\tbreak 1;\n \t\t}else{\n \t\t\t++$select_index;\n \t\t}\n \t\t\n \t}\n }\n\n\n foreach($selected_bundles as $disabled_bundles){\n $disabled_bundles_by_round[] = array('subject_id'=>$subject_id, 'round_id'=>$disabled_bundles['round_id'], 'bundle_id'=>$disabled_bundles['bundle_id']);\n }\n\n $this->exp->insert_phase_one_conditional_round($disabled_bundles_by_round);\n }\n\n return $this->exp->insert_phase_one_selected_bundle($round_id, $subject_id, $selected_bundle_id);\n }",
"public function loadoutBinsLoaded(){\n\n\t\t$unique_id = Input::get('unique_id');\n\t\t$data = CreateLoadLoadoutBins::where('unique_id','=',$unique_id)->get()->toArray();\n\t\tif($data){\n\t\t\treturn $data;\n\t\t}\n\n\t}",
"protected function _prepareBundelOptions($collection)\n {\n if (!$collection->count()) {\n return array();\n }\n $rowBundel = array();\n \n foreach ($collection as $_product) {\n if ($_product->getTypeID() == 'bundle') {\n $bundledProduct = $_product;\n $selectionCollection = $bundledProduct->getTypeInstance()->getSelectionsCollection(\n $bundledProduct->getTypeInstance()->getOptionsIds($bundledProduct),\n $bundledProduct\n );\n $bundled_items = array();\n $optionCollection = $bundledProduct->getTypeInstance()->getOptionsCollection($bundledProduct);\n \n $_options = $optionCollection->appendSelections($selectionCollection, true);\n \n $bundle_sku = array();\n $bundle_options = array();\n $i=0;\n foreach ($_options as $option) {\n $bundle_options[] = join(':', array(\n $option->getDefaultTitle().\"_$i\",\n $option->getDefaultTitle(),\n $option->getType(),\n $option->getRequired(),\n $option->getPosition(),\n ));\n if ($option->getSelections()) {\n foreach ($option->getSelections() as $selection) {\n $bundle_sku[] = join(':', array(\n $option->getDefaultTitle().\"_$i\",\n $selection->getSku(),\n $selection->getData('selection_qty'),\n $selection->getData('selection_can_change_qty'),\n $selection->getData('position'),\n $selection->getData('is_default'),\n $selection->getData('selection_price_value'),\n $selection->getData('selection_price_type')\n ));\n }\n }\n $i++;\n }\n $rowBundel[$_product->getId()][] = array(\n 'bundle_skus' => join(';', $bundle_sku),\n 'bundle_options'=> join(';', $bundle_options)\n );\n unset($optionCollection);\n $bundle_sku = array();\n } else {\n $rowBundel[$_product->getId()][] = array(\n 'bundle_skus' => '' ,\n 'bundle_options' => ''\n );\n }\n }\n return $rowBundel;\n }",
"function getBricks() : array ;",
"public function coreBinMapping() {\n $core_bins = [\n 'bootstrap',\n 'config',\n 'data',\n 'default',\n 'discovery',\n 'dynamic_page_cache',\n 'entity',\n 'menu',\n 'render',\n 'migrate',\n 'rest',\n 'toolbar',\n ];\n return $core_bins;\n }",
"public function getBricks();",
"function getBins() {\n\t\treturn $this->BINS;\n\t}",
"function get_dropins()\n {\n }",
"function getBins() {\n return array_keys($this->bins);\n }",
"public function getObjectBricks() {}",
"protected function loadServiceBricks() {}",
"function _get_dropins()\n {\n }",
"public function getBands();",
"function _get_dropins()\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mode Of Vaccine Supply By Facility Type | public function modeOfVaccineSupplyByFacilityTypeAction() {
//ccem proposed list 1.1 (1)
$search_form = new Form_ReportsSearch();
$data_arr = array(
'WorkingWell' => '90',
'WorkingNeedsService' => '7',
'NotWorking' => '3'
);
$main_heading = "Mode Of Vaccine Supply By Facility Type";
$str_sub_heading = "";
$number_prefix = "";
$number_suffix = "%";
$s_number_prefix = "";
$xmlstore = "<?xml version=\"1.0\"?>";
$xmlstore .= '<chart caption="' . $main_heading . '" subCaption="' . $str_sub_heading . '" numberPrefix="' . $number_prefix . '" numberSuffix="' . $number_suffix . '" sformatNumberScale="1" sNumberPrefix="' . $s_number_prefix . '" syncAxisLimits="1" rotateValues="1" showSum="0" theme="fint">';
$xmlstore .='<set label="Working Well" value="' . $data_arr['WorkingWell'] . '"/>';
$xmlstore .='<set label="Working Needs Service" value="' . $data_arr['WorkingNeedsService'] . '"/>';
$xmlstore .='<set label="Not Working" value="' . $data_arr['NotWorking'] . '"/>';
$xmlstore .="</chart>";
$this->view->xmlstore = $xmlstore;
$this->view->main_heading = $main_heading;
$this->view->str_sub_heading = $str_sub_heading;
$this->view->chart_type = 'Pie3D';
$this->view->width = '80%';
$this->view->height = '400';
$this->view->search_form = $search_form;
$this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo.js');
} | [
"abstract public function getMode();",
"public function getFitMode() {}",
"function mode_str(){\n\t\t$str = locstr(SalusZone::MODES_TEXT[$this->mode]);\n\t\tif($this->mode!=SalusZone::MODE_OFF and $this->mode!=SalusZone::MODE_ES) $str .= ' '.temp_to_str($this->current_mode_temp);\n\t\treturn $str;\n\t}",
"public function mode()\n\t{\n\t\t$mode = null;\n\t\t\n\t\t// if more than one observation exists\n\t\tif (1 < ($n = $this->n())) {\n\t\t\t// count the observations by value\n\t\t\t$frequencies = array_count_values($this->observations);\n\t\t\t// sort the frequencies in descending order\n\t\t\tarsort($frequencies);\n\t\t\t// reset the internal pointer, just to be sure\n\t\t\treset($frequencies);\n\t\t\t// get the key of the first element\n\t\t\t$mode = key($frequencies);\n\t\t}\n\t\t\n\t\treturn $mode;\n\t}",
"static public function get_mode_string($mode)\n\t{\n\t\tswitch ($mode) {\n\t\t\tcase self::MODE_COUNT:\n\t\t\t\treturn \"count\";\n\t\t\tcase self::MODE_SUMCOUNT:\n\t\t\t\treturn \"count\";\n\t\t\tcase self::MODE_GROUPCONCAT:\n\t\t\t\treturn \"groupconcat\";\n\t\t}\n\t}",
"public static function get_gamification_mode() {\n\n //Parameter validation\n //REQUIRED\n $params = self::validate_parameters(self::get_gamification_mode_parameters(),\n array()); \n global $CFG; \n return $CFG->gamificationmode?$CFG->gamificationmode:0;\n \n\n // LFS NameN: print_r(block_exacomp_get_niveaus_for_subject($v->id));\n }",
"function test_mode($value)\n {\n $this->isTest = $value;\n }",
"public function getMode()\n {\n switch ($this->source['mode']) {\n case 'in': return self::MODE_IN;\n case 'out': return self::MODE_OUT;\n case 'both': return self::MODE_BOTH;\n }\n }",
"public function mode(): float\n {\n return $this->a;\n }",
"function getMode(array $valores){\r\n\t$longitud = count($valores);\r\n\t$repeticiones = array();\r\n\tif($longitud==0)\r\n\t\treturn FALSE;\r\n\tforeach($valores as $valor){\r\n\t\t$repeticiones[$valor]=0;\r\n\t\tfor($i=0;$i<$longitud;$i++){\r\n\t\t\tif($valores[$i]==$valor)\r\n\t\t\t\t$repeticiones[$valor]++;\r\n\t\t}\r\n\t}\r\n\tunset($valores,$longitud,$i,$valor);\r\n\tasort($repeticiones);\r\n\t$llaves = array_keys($repeticiones);\r\n\treturn array_pop($llaves);\r\n}",
"final public function getModeString(){}",
"public function getDemoMode();",
"public function facilityFunctionByFacilityTypeAction() {\n //ccem proposed list 1.1 (1)\n $search_form = new Form_ReportsSearch();\n\n $data_arr = array(\n 'WorkingWell' => '90',\n 'WorkingNeedsService' => '7',\n 'NotWorking' => '3'\n );\n\n $main_heading = \"Facility Function By Facility Type\";\n $str_sub_heading = \"\";\n $number_prefix = \"\";\n $number_suffix = \"%\";\n $s_number_prefix = \"\";\n\n $xmlstore = \"<?xml version=\\\"1.0\\\"?>\";\n $xmlstore .= '<chart caption=\"' . $main_heading . '\" subCaption=\"' . $str_sub_heading . '\" numberPrefix=\"' . $number_prefix . '\" numberSuffix=\"' . $number_suffix . '\" sformatNumberScale=\"1\" sNumberPrefix=\"' . $s_number_prefix . '\" syncAxisLimits=\"1\" rotateValues=\"1\" showSum=\"0\" theme=\"fint\">';\n $xmlstore .='<set label=\"Working Well\" value=\"' . $data_arr['WorkingWell'] . '\"/>';\n $xmlstore .='<set label=\"Working Needs Service\" value=\"' . $data_arr['WorkingNeedsService'] . '\"/>';\n $xmlstore .='<set label=\"Not Working\" value=\"' . $data_arr['NotWorking'] . '\"/>';\n $xmlstore .=\"</chart>\";\n\n $this->view->xmlstore = $xmlstore;\n\n $this->view->main_heading = $main_heading;\n $this->view->str_sub_heading = $str_sub_heading;\n $this->view->chart_type = 'Pie3D';\n $this->view->width = '80%';\n $this->view->height = '400';\n $this->view->search_form = $search_form;\n $this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo.js');\n }",
"function array_mode($counts) \n{\n // Returns the mode value(s) for an array of values=>occurences:\n \n $modes = array_keys($counts, current($counts), true);\n \n // Only one modal value:\n if (count($modes) === 1) return $modes[0];\n \n // Multiple modal values:\n return $modes;\n \n}",
"public function check_mode($mode){\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\treturn $mode;\r\n\t\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t}",
"public function transportMode()\n {\n switch($this->transport_mode)\n {\n case 'rail freight':\n $type='fa fa-train';\n break;\n case 'road freight':\n $type='fa fa-truck';\n break; \n case 'sea freight':\n $type='fa fa-ship';\n break; \n case 'air freight':\n $type='fa fa-plane';\n break; \n default:\n $type='fa fa-plane'; \n } \n\n return $type; \n }",
"public function getMode()\n\t{\n\t\treturn $this->mode;\n\t}",
"function getViewMode()\n\t{\n\t\tglobal $tree;\n\t\t\n\t\t// default: by type\n\t\t$view = ilContainer::VIEW_BY_TYPE;\n\t\t\n\t\t// get view mode from course\n\t\tif ($course_ref_id = $tree->checkForParentType($this->ref_id,'crs'))\n\t\t{\n\t\t\tinclude_once(\"./Modules/Course/classes/class.ilObjCourseAccess.php\");\n\t\t\t$view_mode = ilObjCourseAccess::_lookupViewMode(ilObject::_lookupObjId($course_ref_id));\n\t\t\tif ($view_mode == ilContainer::VIEW_SESSIONS ||\n\t\t\t\t$view_mode == ilContainer::VIEW_BY_TYPE ||\n\t\t\t\t$view_mode == ilContainer::VIEW_SIMPLE)\n\t\t\t{\n\t\t\t\t$view = $view_mode;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $view;\n\t}",
"public function getMode(): string\n {\n return 'into';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether a var exists given its name | public function hasVar($name)
{
return array_key_exists($name, $this->vars);
} | [
"public function hasVariable($name);",
"public function varExists($baseName)\n {\n return isset($this->initVars[$baseName]);\n }",
"public function data_var_exists($var_name, $path = NULL)\n\t{\n\t\tif ($path === NULL)\n\t\t{\n\t\t\treturn array_key_exists($var_name, $this->form_data());\n\t\t} else // fix for namespaced drivers\n\t\t{\n\t\t\treturn (Arr::path($this->form_data(), $path, NULL, '.') !== NULL);\n\t\t}\n\n\t}",
"public function __isset($name)\r\n {\r\n return $this->varHolder->has($name);\r\n }",
"final static function varExists($var, &$items = null){\n\t\tif (is_null($items))\n\t\t\treturn false;\n\t\t\n\t\t$subvars = explode(\".\", $var);\n\t\t\n\t\tif (count($subvars) === 1) {\n\t\t\tif (is_array($items))\n\t\t\t\treturn isset($items[$var]);\n\t\t\tif (is_object($items))\n\t\t\t\treturn isset($items->$var);\n\t\t} else {\n\t\t\t$l = strlen($subvars[0]);\n\t\t\tif ($l + 1 < strlen($var)) {\n\t\t\t\tif (is_array($items))\n\t\t\t\t\treturn self::varExists(substr($var, $l + 1), $items[$subvars[0]]);\n\t\t\t\tif (is_object($items))\n\t\t\t\t\treturn self::varExists(substr($var, $l + 1), $items->$subvars[0]);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function checkVar(string $name) : bool {\n if(!$this->validate_variables){\n return true;\n }\n $original_name = $name;\n if($name instanceof SandboxedString){\n $name = strval($name);\n }\n if(!$name){\n $this->validationError('Sandboxed code attempted to call unnamed variable!', Error::VALID_VAR_ERROR, null, '');\n }\n if(is_callable($this->validation['variable'])){\n return call_user_func_array($this->validation['variable'], [$name, $this]);\n }\n if(!isset($this->definitions['variables'][$name])){\n if(count($this->whitelist['variables'])){\n if(!isset($this->whitelist['variables'][$name])){\n $this->validationError(\"Sandboxed code attempted to call non-whitelisted variable: $original_name\", Error::WHITELIST_VAR_ERROR, null, $original_name);\n }\n } else if(count($this->blacklist['variables'])){\n if(isset($this->blacklist['variables'][$name])){\n $this->validationError(\"Sandboxed code attempted to call blacklisted variable: $original_name\", Error::BLACKLIST_VAR_ERROR, null, $original_name);\n }\n } else if(!$this->allow_variables){\n $this->validationError(\"Sandboxed code attempted to call invalid variable: $original_name\", Error::VALID_VAR_ERROR, null, $original_name);\n }\n }\n return true;\n }",
"public function testExists()\n {\n $vars = SG_Variables::getInstance();\n $this->assertFalse($vars->exists(self::VARIABLE_NAME));\n $this->assertFalse(isset($vars->{self::VARIABLE_NAME}));\n \n $vars->set(self::VARIABLE_NAME, self::VARIABLE_VALUE);\n \n $this->assertTrue($vars->exists(self::VARIABLE_NAME));\n $this->assertTrue(isset($vars->{self::VARIABLE_NAME}));\n }",
"public function isAccessingVariable($name)\n {\n return in_array($name, $this->variables);\n }",
"public static function hasVar($pubtype, $name)\n {\n $dom = ZLanguage::getModuleDomain('Clip');\n // validate the passed pubtype\n if (!$pubtype instanceof PubtypeModel) {\n if (!Util::validateTid($pubtype)) {\n return LogUtil::registerError(__f('%1$s: Invalid publication type ID passed [%2$s].', array('Workflow_Util::getVar', DataUtil::formatForDisplay($pubtype)), $dom));\n }\n $pubtype = Util::getPubType($pubtype);\n }\n $name = isset($name) ? (string) $name : '';\n // validate the varname\n if (!System::varValidate($name, 'modvar')) {\n return false;\n }\n if (!isset(self::$variables[$pubtype->tid])) {\n self::getVar($pubtype);\n }\n return array_key_exists($name, self::$variables[$pubtype->tid]);\n }",
"public function varExists($varName)\n {\n return isset($_SESSION[$varName]);\n }",
"final static function varExists($var, &$items = null) {\n\t\tif (is_null ( $items ))\n\t\t\treturn false;\n\n\t\t$subvars = explode ( DIV_TAG_VAR_MEMBER_DELIMITER, $var );\n\n\t\tif (count ( $subvars ) === 1) {\n\t\t\tif (is_array ( $items ))\n\t\t\t\treturn isset ( $items [$var] );\n\t\t\tif (is_object ( $items ))\n\t\t\t\treturn isset ( $items->$var );\n\t\t} else {\n\t\t\t$l = strlen ( $subvars [0] );\n\t\t\tif ($l + 1 < strlen ( $var )) {\n\t\t\t\tif (is_array ( $items ))\n\t\t\t\t\treturn self::varExists ( substr ( $var, $l + 1 ), $items [$subvars [0]] );\n\t\t\t\tif (is_object ( $items ))\n\t\t\t\t\treturn self::varExists ( substr ( $var, $l + 1 ), $items->$subvars [0] );\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function checkVarName($var_name)\n {\n if (empty($var_name)) {\n return;\n }\n if (array_key_exists($var_name, $this->var_blocks)) {\n $this->logger->warning(\"Found duplicate definition for $var_name.\");\n }\n }",
"public function hasVars(){\n\t\tif(count($this->data['varsName']) > 0)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"function exists($var)\n\t{\n\t\treturn isset($var) && !empty($var);\n\t}",
"public static function check($var) {\n\t\treturn isset(self::$global[$var]);\n\t}",
"public function testHasVar()\n\t{\n\t\t$this->assertThat(\n\t\t\t$this->object->hasVar('somevariable'),\n\t\t\t$this->equalTo(false)\n\t\t);\n\n\t\t$this->assertThat(\n\t\t\t$this->object->hasVar('var'),\n\t\t\t$this->equalTo(true)\n\t\t);\n\t}",
"function lookupVariableName ($varName, &$varNo) {\n $x =& $this->varNameToNoMap[strtoupper($varName)];\n if (!isset($x)) return false;\n $varNo = $x;\n return true; }",
"public function hasVariable($name, Token $token = null) {\n\t\tif (is_null($token)){\n\t\t\t$token = $this->getRootToken();\n\t\t}\n\t\t$hasVariable = false;\n\t\t$tokenVariableMap = $this->getTokenVariableMap($token);\n\t\tif (!is_null($tokenVariableMap)){\n\t\t\t$hasVariable = $tokenVariableMap->hasVariable($name);\n\t\t}\n\t\treturn $hasVariable;\n\t}",
"function param_exists($name) {\n return array_key_exists(\"_$name\", $this->data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wraps results in appropriate results class for this GetAccount execution. | protected function wrapResults($outputs)
{
return new Twilio_Accounts_GetAccount_Results($outputs);
} | [
"protected function wrapResults($outputs)\n {\n return new RapidShare_GetAccountDetails_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Stripe_Account_RetrieveAccountDetails_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Twitter_Users_GetAccountSettings_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Twilio_Accounts_ListAccounts_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new eBay_Shopping_GetUserProfile_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new RunKeeper_Profile_RetrieveProfile_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Box_Users_GetCurrentUser_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Withings_User_GetUser_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Dwolla_Contacts_UserContacts_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Tumblr_User_GetUserInformation_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Google_Contacts_GetContactsWithQuery_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Basecamp_GetAllEntries_Results($outputs);\n }",
"public function getAccounts() {\n \n // STEP 1 - COnnect to DB\n $connMgr = new ConnectionManager();\n $pdo = $connMgr->connect(); // PDO object\n \n // STEP 2- Write and register SQL query\n // \n $sql = \"SELECT\n username, name, password, email, phone_number, postal_code, adoption_basket\n FROM\n account\"; //string \n $stmt = $pdo->prepare($sql); // PDOStatement object\n //$stmt is an executable query in PDO\n\n // STEP 3 - Run/execute query \n $stmt->execute(); // RUN SQL\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n // Retrieve each row as an Associative Array\n /* Each row loooks like this\n [\n 'name' => 'Flower',\n 'age' => 7,\n 'gender' => 'F',\n 'status' => 'P'\n ]\n */\n\n // STEP 4 - Fetch query results \n $accounts = [];\n while ( $row = $stmt->fetch() ) {\n $accounts = new account( \n $row['username'], \n $row['name'], \n $row['password'], \n $row['email'], \n $row['phone_number'], \n $row['postal_code'], \n $row['adoption_basket'] \n ); // new account object\n // $accounts[] = $account; // add account object to ret array\n }\n \n // STEP 5\n $stmt = null; // clear memory\n $pdo = null; // clear memory\n \n // STEP 6\n return $accounts;\n }",
"protected function wrapResults($outputs)\n {\n return new Twitter_Users_UpdateAccountSettings_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Tumblr_User_RetrieveUserDashboard_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new _37Signals_Basecamp_GetItem_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new _23andMe_User_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Zendesk_Users_SearchUsers_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Stripe_Customers_ListAllCustomers_Results($outputs);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an expression that refers to an identifier. Identifiers are used to refer to field names and allow the SQL compiler to apply quotes or escape the identifier. The value is used as is, and you might be required to use aliases or include the table reference in the identifier. Do not use this method to inject SQL methods or logical statements. Example ``` $query>newExpr()>lte('count', $query>identifier('total')); ``` | public function identifier(string $identifier): ExpressionInterface
{
return new IdentifierExpression($identifier);
} | [
"public abstract function prepare_identifier($expr);",
"public function createExpression();",
"public static function identifier($string, $db = 'default')\r\n {\r\n return new Expression(static::quoteIdentifier($string));\r\n }",
"public function prepare_identifier($expr) {\n\t\tif ($expr instanceof DB_DB2_Select_Builder) {\n\t\t\treturn DB_SQL_Builder::_OPENING_PARENTHESIS_ . $expr->statement(FALSE) . DB_SQL_Builder::_CLOSING_PARENTHESIS_;\n\t\t}\n\t\telse if ($expr instanceof DB_SQL_Expression) {\n\t\t\treturn $expr->value($this);\n\t\t}\n\t\telse if (class_exists('Database_Expression') AND ($expr instanceof Database_Expression)) {\n\t\t\treturn $expr->value();\n\t\t}\n\t\telse if ( ! is_string($expr)) {\n\t\t\tthrow new Throwable_InvalidArgument_Exception('Message: Invalid identifier expression specified. Reason: Token must be a string.', array(':expr' => $expr));\n\t\t}\n\t\telse if (preg_match('/^SELECT.*$/i', $expr)) {\n\t\t\t$expr = rtrim($expr, \"; \\t\\n\\r\\0\\x0B\");\n\t\t\treturn DB_SQL_Builder::_OPENING_PARENTHESIS_ . $expr . DB_SQL_Builder::_CLOSING_PARENTHESIS_;\n\t\t}\n\t\t$parts = explode('.', $expr);\n\t\tforeach ($parts as &$part) {\n\t\t\t$part = static::_OPENING_QUOTE_CHARACTER_ . trim(preg_replace('/[^a-z0-9$_ ]/i', '', $part)) . static::_CLOSING_QUOTE_CHARACTER_;\n\t\t}\n\t\t$expr = implode('.', $parts);\n\t\treturn $expr;\n\t}",
"abstract protected function createExpression();",
"public function matchExpr()\n {\n return new QueryExpr();\n }",
"public function expr()\n {\n return new Expr($this->cmd);\n }",
"function E($expr)\n{\n\treturn new Syx_Db_Expr($expr);\n}",
"public function expression()\n {\n $className = $this->definition->getExpressionClass();\n return new $className;\n }",
"public function toObjectId($expression): static;",
"function get_identifier_expression() {\n\t\t$this->debug->show('<br>Class MyObject Method get_identifier_expression', MyObject::$write_debug);\n\t\t$where = array();\n\t\tif ($this->identifier_type == 'array' AND getType($this->identifier) == 'array') {\n\t\t\t$this->debug->show('<br>identifier: ' . print_r($this->identifier, true), MyObject::$write_debug);\n\t\t\t$where = array_map(\n\t\t\t\tfunction($id) {\n\t\t\t\t\t$quote = ($id['type'] == 'text' ? \"'\" : \"\");\n\t\t\t\t\treturn $id['key'] . \" = \" . $quote . $this->get($id['key']) . $quote;\n\t\t\t\t},\n\t\t\t\tarray_filter(\n\t\t\t\t\t$this->identifier,\n\t\t\t\t\tfunction($id) {\n\t\t\t\t\t\treturn in_array($id['key'], $this->getKeys()) AND $this->get($id['key']) != null AND $this->get($id['key']) != '';\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\tif (\n\t\t\t\tin_array($this->identifier, $this->getKeys()) AND\n\t\t\t\t$this->get($this->identifier) != null AND\n\t\t\t\t$this->get($this->identifier) != ''\n\t\t\t) {\n\t\t\t\t$quote = ($this->identifier_type == 'text' ? \"'\" : \"\");\n\t\t\t\t$where = array($this->identifier . \" = \" . $quote . $this->get($this->identifier) . $quote);\n\t\t\t}\n\t\t}\n\t\treturn implode(' AND ', $where);\n\t}",
"public function expr(/* args */)\n {\n $args = func_get_args();\n $expr = new AMysql_Expr($this);\n call_user_func_array(array ($expr, 'set'), $args);\n return $expr;\n }",
"public function setExpr($var)\n {\n GPBUtil::checkMessage($var, Expr::class);\n $this->expr = $var;\n\n return $this;\n }",
"public function buildAstPreIncrementExpression();",
"public function newExpr(ExpressionInterface|array|string|null $rawExpression = null): QueryExpression\n {\n return $this->expr($rawExpression);\n }",
"public function identifier($identifier)\n {\n return $this->setProperty('identifier', $identifier);\n }",
"public function __construct($expr)\n\t{\n\t\t$this->_expr = (string)$expr;\n\t}",
"public function expr()\n {\n return new Expression($this);\n }",
"public function expression()\n {\n return new self;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Elimina un registro de tblproveedoreliminado | public static function setDeleteTblproveedorEliminado($idtbloproveedoreliminado){
$delete = "DELETE FROM tbloproveedoreliminado WHERE idtbloproveedoreliminado = ?";
try{
$resultado = ConexionDB::getInstance()->getDb()->prepare($delete);
$resultado->bindParam(1,$idtbloproveedoreliminado,PDO::PARAM_INT);
$resultado->execute();
return $resultado->rowCount(); //retorna el numero de registros afectados
} catch(PDOException $e){
return false;
}
} | [
"public static function setDeleteAllTblproveedorEliminado(){\n\t \n\t\t$delete = \"DELETE FROM tbloproveedoreliminado WHERE idtbloproveedoreliminado = ?\";\n\t\t\n\t\ttry{\n\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($delete);\n\t\t\t$resultado->execute();\n\t \treturn $resultado->rowCount(); //retorna el numero de registros afectados\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"public function delete($proveedor);",
"public function delete($proveedores){\n $idPROVEEDORES=$proveedores->getIdPROVEEDORES();\n\n try {\n $sql =\"DELETE FROM `proveedores` WHERE `idPROVEEDORES`='$idPROVEEDORES'\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }",
"public function delete($product_proveedor);",
"public function eliminarProductoModel($produ){\n\t\t//Se prepara la consulta\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE productos SET eliminado=1 WHERE id_producto='$produ'\");\n\t\t//se ejecuta la consulta\n\t\treturn $stmt->execute();\n\t\t$stmt->close();\n\t}",
"public static function setDeleteTblproveedor($idtblproveedor){\n\t \n\t\t$delete = \"DELETE FROM tblproveedor WHERE idtblproveedor = ?\";\n\t\t\n\t\ttry{\n\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($delete);\n\t\t\t$resultado->bindParam(1,$idtblproveedor,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\n\t \treturn $resultado->rowCount(); //retorna el numero de registros afectados\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"function deleteMco_proveedores($PVE_ID)\n {\n \tif($this->gateway->existMco_proveedores($PVE_ID) == 1){\n $result = $this->gateway->deleteMco_proveedores($PVE_ID);\n if($result){\n $this->UnsetRequest();\n return EXITO_OPERACION_REALIZADA;\n }\n else\n {\n return ERROR_OPERACION_NO_REALIZADA;\n }\n }\n else\n {\n return ERROR_DATO_NO_EXISTE;\n }\n }",
"public static function setDeleteAllTblpreproveedor(){\n\t \n\t\t$delete = \"DELETE FROM tblpreproveedor\";\n\t\t\n\t\ttry{\n\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($delete);\n\t\t\t$resultado->execute();\n\t \treturn $resultado->rowCount(); //retorna el numero de registros afectados\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"public function eliminar(){\r\n $sql = \"DELETE FROM mvp where id_mvp = '{$this->id}'\";\r\n $this->con->consulta($sql);\r\n }",
"function eliminar_cliente($objeto) {\n\t\t$sql = \"DELETE FROM\n\t\t\t\t\tcomun_cliente\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'];\n\t\t$result = $this -> query($sql);\n\n\t// Guarda la actividad\n\t\t$fecha = date('Y-m-d H:i:s');\n\t// Valida que exista el empleado si no agrega un cero como id\n\t\t$usuario = (!empty($_SESSION['mesero']['id'])) ? $_SESSION['mesero']['id'] : 0;\n\t\t$sql = \"INSERT INTO\n\t\t\t\t\tcom_actividades\n\t\t\t\t\t\t(id, empleado, accion, descripcion, fecha)\n\t\t\t\tVALUES\n\t\t\t\t\t('',\" . $usuario . \",'Elimina cliente','Elimina el cliente \".$datos['id'].\"', '\" . $fecha . \"')\";\n\t\t$actividad = $this -> query($sql);\n\n\t\treturn $result;\n\t}",
"function deletePreDetalle(){\n $sql='DELETE FROM prepedidos WHERE IdCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n\t}",
"function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n }",
"function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }",
"function eliminaRecord()\n\t\t{\n\t\tif (!$this->modulo->elimina(true))\n\t\t\t$this->mostraErroreDB($this->modulo->righeDB->connessioneDB);\n\t\t\n\t\t$this->ritorna();\n\t\t}",
"final protected function eliminar(){\n\t\tif($this -> empresa != null){\n\t\t\tthrow new Exception('Empresa sin datos');\n\t\t}\n\t\tDataAccess::delete($this -> empresa);\t\n\t}",
"function eliminar() {\n\t\tglobal $mdb2;\n\t\t$sql = \"SELECT * FROM public.cliente_usuario_grupo_elimina(\".\n\t\t\t\tpg_escape_string($this->__usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->grupo_id).\")\";\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\tdie($sql);\n\t\t}\n\t}",
"function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}",
"public static function setDeleteTblhrsprovtienda($idtblproveedor){\n\t \n\t\t$delete = \"DELETE FROM tblhrsprovtienda WHERE tblproveedor_idtblproveedor = ?\";\n\t\t\n\t\ttry{\n\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($delete);\n\t\t\t$resultado->bindParam(1,$idtblproveedor,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\n\t \treturn $resultado->rowCount(); //retorna el numero de registros afectados\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests Greenery Day before 1989. Greenery Day was established from 1989 on April 29th. After 2007 it was changed to be May 4th. | public function testGreeneryDayBefore1989()
{
$this->assertNotHoliday(self::COUNTRY, self::HOLIDAY, $this->generateRandomYear(1000, 1988));
} | [
"public function testGreeneryDayOnAfter2007()\n {\n $year = 2112;\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-5-4\", new DateTimeZone(self::TIMEZONE)));\n }",
"public function testEsterDate()\n {\n if (!function_exists('easter_date'))\n return;\n\n for($year = 1970; $year <= 2037; $year++)\n {\n static::assertSame(DateTime::createFromFormat('U', easter_date($year))->modify('+12 hours')->format('Y-m-d'),\n \\AbcAeffchen\\SepaUtilities\\easterDate($year)->format('Y-m-d'));\n }\n\n // test out of bound easter sundays\n static::assertSame('1870-04-17',\\AbcAeffchen\\SepaUtilities\\easterDate(1870)->format('Y-m-d'));\n static::assertSame('2070-03-30',\\AbcAeffchen\\SepaUtilities\\easterDate(2070)->format('Y-m-d'));\n }",
"public function testGreeneryDayOnAfter2007SubstitutedNextWorkingDay()\n {\n $year = 2014;\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-5-6\", new DateTimeZone(self::TIMEZONE)));\n }",
"public function testNationalDayBefore1891(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::FIRST_OBSERVANCE_YEAR - 1)\n );\n }",
"public function testCanadaDayBefore1879(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }",
"public function testVeteransDayOnAfter1919()\n {\n $year = $this->generateRandomYear(1919);\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-11-11\", new DateTimeZone(self::TIMEZONE)));\n }",
"public function testThanksgivingDayOnAfter1879(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"second monday of october {$year}\", new \\DateTimeZone(self::TIMEZONE))\n );\n }",
"public function testWashingtonsBirthdayBefore1879(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }",
"public function testThanksgivingDayBefore1863()\n {\n $this->assertNotHoliday(self::COUNTRY, self::HOLIDAY, $this->generateRandomYear(1000, 1862));\n }",
"public function testNationalDayOnAfter1899(): void\n {\n $year = $this->generateRandomYear(self::FIRST_ESTABLISHMENT_YEAR, self::NATIONAL_ESTABLISHMENT_YEAR - 1);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-8-01\", new \\DateTimeZone(self::TIMEZONE))\n );\n $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OBSERVANCE);\n }",
"public function testRespectForTheAgedDayBefore1996(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }",
"public function testRepublicDayOnAfter1946(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-6-2\", new \\DateTimeZone(self::TIMEZONE))\n );\n }",
"public function testBadDay()\n {\n new ApproxDate('3/34/89');\n }",
"public function testNationalDayBetween1891And1899(): void\n {\n $year = $this->generateRandomYear(self::FIRST_OBSERVANCE_YEAR + 1, self::FIRST_ESTABLISHMENT_YEAR - 1);\n $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year);\n }",
"function _buildGreeneryDay()\n {\n $internalName = null;\n $title = null;\n if ($this->_year >= 2007) {\n $internalName = 'greeneryDay';\n $title = 'Greenery Day';\n } else if ($this->_year >= 1986) {\n $date =& new Date($this->_year . '-05-04');\n if ($date->getDayOfWeek() != 0) {\n $internalName = 'nationalHoliday';\n $title = 'National Holiday';\n }\n }\n if (!is_null($internalName)) {\n $this->_addHoliday($internalName,\n $this->_year . '-05-04',\n $title);\n }\n }",
"public function testNationalDayOn1891(): void\n {\n $year = self::FIRST_OBSERVANCE_YEAR;\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-8-01\", new \\DateTimeZone(self::TIMEZONE))\n );\n $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OBSERVANCE);\n }",
"public function testDate() {\n\t\t$time = mktime(16, 35, 0, 2, 26, 1988);\n\n\t\t// uses en locale\n\t\t$this->assertEquals('02/26/1988', Format::date($time));\n\t\t$this->assertEquals('02/26/1988', Format::date('1988-02-26'));\n\n\t\t// now try with no locale, will use fallback\n\t\tTiton::g11n()->set('no');\n\t\t$this->assertEquals('Feb 26 1988', Format::date($time, '%b %d %Y'));\n\t}",
"public function testMarineDayBefore1996(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }",
"public function testRemembranceDayBefore2006(): void\n {\n $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1);\n $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a WikiFile object populated with the file data. | public function getFile($filename)
{
return new WikiFile($filename, $this);
} | [
"public static function make($fileData) {\n \n return new File($fileData);\n }",
"public function getFileObject() {\n\n return File::getByID($this->fID);\n }",
"public function getFile()\n {\n if (!is_object($this->_file)) {\n $this->_file = Yii::createObject(array_merge([\n 'class' => File::class,\n 'template' => $this->getTemplate(),\n 'goal' => $this,\n 'path' => $this->_path ?: $this->id,\n ], is_string($this->_file)\n ? ['path' => $this->_file]\n : (array) $this->_file\n ));\n }\n\n return $this->_file;\n }",
"protected function fileObj()\n\t{\n\t\t$fileObj = new Varien_Io_File();\n\t\treturn $fileObj;\n\t}",
"public function getFile()\n {\n if (!is_object($this->_file)) {\n $this->_file = Yii::createObject(array_merge([\n 'class' => \\codexten\\yii\\dev\\base\\File::class,\n 'template' => $this->getTemplate(),\n 'data' => $this->getData(),\n 'goal' => $this,\n 'path' => $this->_path ?: $this->id,\n ], is_string($this->_file)\n ? ['path' => $this->_file]\n : (array)$this->_file\n ));\n }\n\n return $this->_file;\n }",
"public static function newFileModel()\n {\n $model = static::fileModel();\n\n return new $model;\n }",
"public function getFile()\n {\n if (!$this->hasFile()) {\n $this->setFile($this->getDefaultFile());\n }\n return $this->file;\n }",
"public function getFile()\n {\n return $this->file($this->getParameter());\n }",
"public static function Factory($file) \n\t{\n\t\tif(!$file instanceof SplFileInfo)\n\t\t\treturn null;\n\t\t\n\t\t$extension = end(FileContent::getExtensions($file->getFilename()));\n\n\t\t$extension_class_map = array(\n\t\t\t'txt'\t\t=> 'TextFileContent',\n\t\t\t'text'\t\t=> 'MarkdownTextFileContent', // default generic markup extention\n\n\t\t\t// Markups\n\t\t\t'html'\t\t=> 'HTMLFileContent',\n\t\t\t'htm'\t\t=> 'HTMLFileContent',\n//\t\t\t'rtf'\t\t=> 'RTFFileContent',\n\t\t\t'markdown'\t=> 'MarkdownTextFileContent',\n\t\t\t'textile' \t=> 'TextileFileContent',\n\n\t\t\t// Images\n\t\t\t'jpg'\t\t=> 'ImageFileContent',\n\t\t\t'jpeg'\t\t=> 'ImageFileContent',\n\t\t\t'png'\t\t=> 'ImageFileContent',\n\t\t\t'gif'\t\t=> 'ImageFileContent',\n\t\t\t\n\t\t\t// Video\n\t\t\t'mov'\t\t=> 'VideoFileContent',\n\t\t\t'mp4'\t\t=> 'VideoFileContent',\n\t\t\t'3gp'\t\t=> 'VideoFileContent',\n\t\t\t'ogv'\t\t=> 'VideoFileContent',\n\t\t\t'mkv'\t\t=> 'VideoFileContent',\n\t\t\t\n\t\t\t// Audio\n\t\t\t'ogg'\t\t=> 'AudioFileContent',\n\t\t\t'oga'\t\t=> 'AudioFileContent',\n\t\t\t'mp3'\t\t=> 'AudioFileContent',\n\t\t\t'wav'\t\t=> 'AudioFileContent',\n\t\t\t'spx'\t\t=> 'AudioFileContent',\n\t\t\t\n\t\t\t'php'\t\t=> 'PHPFileContent',\n\t\t\t\n\t\t);\n\t\t\n\t\t// If its an extention we know about\n\t\tif (array_key_exists($extension, $extension_class_map))\n\t\t{\n\t\t\t$ContentClass = $extension_class_map[$extension];\n\n\t\t\treturn new $ContentClass($file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($file->isDir())\n\t\t\t{\n\t\t\t\t// its a Directory then make a link to it\n\t\t\t\treturn new DirContent($file);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// else use the generic handler which is just a link to the file.\n\t\t\t\treturn new GenericFileContent($file);\n\t\t\t}\n\t\t}\n\t}",
"public function getFileObject()\n\t{\n\t\treturn $this->file_object;\n\t}",
"function loadWiki($wikiId) {\n $wiki = new Wiki();\n\n if ($wiki->hasError()) {\n \t$this->setError($wiki->error);\n }\n\n $wiki->load($wikiId);\n\n return $wiki;\n }",
"public function getFile()\n {\n if (!$this->getFieldValue()) {\n return null;\n }\n\n if ($this->getIsMultipleUpload()) {\n return $this->getFieldModel()->map(function ($filepond) {\n return $this->createFileObject($filepond);\n })->toArray();\n }\n\n return $this->createFileObject($this->getFieldModel());\n }",
"public static function fromFileObject(File $file)\n {\n $instance = self::getCurrentInstance();\n\n $instance->file = $file;\n\n self::$filePreviewInstance = $instance;\n return self::$filePreviewInstance;\n }",
"public static function instantiateByIndex(Index\\FileIndex $fileIndex)\n\t{\n\t\tif (!$fileIndex instanceof Index\\FileIndex)\n\t\t{\n\t\t\tthrow new Main\\ArgumentException();\n\t\t}\n\n\t\t$file = (new static($fileIndex->getFullPath()))\n\t\t\t->setLangId($fileIndex->getLangId());\n\n\t\treturn $file;\n\t}",
"public function make($data)\r\n\t{\r\n\t\treturn new File($data[0],$data[1],$data[2]);\r\n\t}",
"protected function getFile()\n {\n $file = new SplFileObject($this->reflection->getFileName());\n\n $file->seek($this->reflection->getStartLine() - 1);\n\n return $file;\n }",
"public function createDocumentFromFile(UploadedFile $file): Document;",
"public function createOpenapiFile(): OpenapiFile\n {\n $file = new OpenapiFile($this->getDirPath(), 'openapi.json');\n return $file;\n }",
"public function getFileObject()\n {\n $context = stream_context_create(array('horde-combine' => array('data' => $this)));\n return new SplFileObject('horde-combine://' . spl_object_hash($this), 'rb', false, $context);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the montant annuel5. | public function setMontantAnnuel5($montantAnnuel5) {
$this->montantAnnuel5 = $montantAnnuel5;
return $this;
} | [
"public function testSetMontant5() {\n\n $obj = new Employes();\n\n $obj->setMontant5(10.092018);\n $this->assertEquals(10.092018, $obj->getMontant5());\n }",
"public function setMontantBrut5($montantBrut5) {\n $this->montantBrut5 = $montantBrut5;\n return $this;\n }",
"public function setMontantBrut5(?float $montantBrut5): EmpDadsuRectif {\n $this->montantBrut5 = $montantBrut5;\n return $this;\n }",
"public function testSetMontantSommeIsolBrut5() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setMontantSommeIsolBrut5(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantSommeIsolBrut5());\n }",
"public function setMontantBPlaf5(?float $montantBPlaf5): EmpDadsuRectif {\n $this->montantBPlaf5 = $montantBPlaf5;\n return $this;\n }",
"public function setMontant($_montant) { $this->montant = $_montant; }",
"public function setMontantSommeIsolPlaf5($montantSommeIsolPlaf5) {\n $this->montantSommeIsolPlaf5 = $montantSommeIsolPlaf5;\n return $this;\n }",
"public function getMontantAnnuel5(): ?float {\n return $this->montantAnnuel5;\n }",
"public function testSetAzLigne5Mtt() {\n\n $obj = new DecTva();\n\n $obj->setAzLigne5Mtt(10.092018);\n $this->assertEquals(10.092018, $obj->getAzLigne5Mtt());\n }",
"public function testSetMontantAutre33() {\n\n $obj = new LignesMsaEmploye();\n\n $obj->setMontantAutre33(10);\n $this->assertEquals(10, $obj->getMontantAutre33());\n }",
"public function testSetMontantAutre23() {\n\n $obj = new LignesMsaEmploye();\n\n $obj->setMontantAutre23(10);\n $this->assertEquals(10, $obj->getMontantAutre23());\n }",
"public function testSetAtTaux5() {\n\n $obj = new Etablissements();\n\n $obj->setAtTaux5(10.092018);\n $this->assertEquals(10.092018, $obj->getAtTaux5());\n }",
"public function setMontantCharges5($montantCharges5) {\n $this->montantCharges5 = $montantCharges5;\n return $this;\n }",
"public function testSetMontant() {\n\n $obj = new LignesAta();\n\n $obj->setMontant(10.092018);\n $this->assertEquals(10.092018, $obj->getMontant());\n }",
"public function testSetFamille5() {\n\n $obj = new AttestationFiscale();\n\n $obj->setFamille5(\"famille5\");\n $this->assertEquals(\"famille5\", $obj->getFamille5());\n }",
"public function getMontantSommeIsolPlaf5() {\n return $this->montantSommeIsolPlaf5;\n }",
"public function getMontantBPlaf5() {\n return $this->montantBPlaf5;\n }",
"public function setMagia5Attribute($value) {\n $this->attributes['magia5'] = $this->verificaAtributo($value, true);\n }",
"public function testSet1MttAugmentation() {\n\n $obj = new DecTva3514();\n\n $obj->set1MttAugmentation(10.092018);\n $this->assertEquals(10.092018, $obj->get1MttAugmentation());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the mobilePhone Mobile phone number of the contact. | public function setMobilePhone($val)
{
$this->_propDict["mobilePhone"] = $val;
return $this;
} | [
"public function set_mobile_phone($mobile_phone) {\r\n $this->mobile_phone = $mobile_phone;\r\n }",
"public function setMobilePhone(?string $value): void {\n $this->getBackingStore()->set('mobilePhone', $value);\n }",
"public function set_mobile_phone($p_mobile_phone){\n\t\t$this->v_mobile_phone = $p_mobile_phone;\n\t}",
"public function setContactPhone($phone);",
"public function setPhone($value)\n {\n Yii::trace('setPhone()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__phone', $value);\n }",
"function setMobile($mobile) {\n $this->mobile = $mobile;\n }",
"public function setPhone(){\r\n\t\t$CPhone = ClientPhone::model() -> findByAttributes(array('mangoTalker' => $this -> mangoTalker), array('with' => 'phone'));\r\n\t\tif ($CPhone) {\r\n\t\t\t$this -> phone = $CPhone -> phone;\r\n\t\t\t$this -> i = $this -> phone -> i;\r\n\t\t}\r\n\t}",
"function setPhoneNumber($newPhoneNumber)\n {\n $this->phoneNumber = $newPhoneNumber;\n }",
"protected function setMobile($value=true) { $this->_is_mobile = $value; }",
"public function setPhoneNumber(?string $phoneNumber): void\n {\n $this->phoneNumber = $phoneNumber;\n }",
"function setPhone($phone)\n {\n if (validPhone($phone)) {\n $this->phone = $phone;\n } else {\n $this->phone = \"123-456-7890\";\n\n }\n }",
"public function setPhoneNumber(?string $phoneNumber): void\n {\n $this->phoneNumber['value'] = $phoneNumber;\n }",
"function setPhone($phone)\r\n {\r\n //phone must be numeric\r\n if(is_numeric($phone))\r\n {\r\n $this->phone = $phone;\r\n }\r\n //if not, default number is set\r\n $this->phone = \"1234567890\";\r\n }",
"public function setLinkMobilephone($value) {\n return $this->set(self::LINK_MOBILEPHONE, $value);\n }",
"function setPhone($p){\r\n $this->phone = $p; \r\n }",
"protected function setMobile($value = true)\n {\n $this->_is_mobile = $value;\n }",
"function setPhone($newPhone){\n //check if the phone number is numeric\n if(is_numeric($newPhone)) {\n $this->phone = $newPhone;\n }\n //if not set to default, 0000000000\n $this->phone = \"0000000000\";\n }",
"public function setTelephone($value)\n {\n $this->telephone = $value;\n }",
"public function setCustomerPhone()\n\t{\n\t\t// Ensure we have an argument to work with\n\t\tif (func_num_args()<1)\n\t\t{\n\t\t\t$this->error[]=\"Invalid number of arguments in function '\".__FUNCTION__.\"()'\";\n\t\t\treturn;\n\t\t}\n\t\t$value=func_get_arg(0);\n\t\t$this->phoneNumber = $this->dom->createElement('phoneNumber',substr($value,0,25));\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiates a new UserExperienceAnalyticsAnomalyDeviceItemRequestBuilderGetRequestConfiguration and sets the default values. | public function __construct(?array $headers = null, ?array $options = null, ?UserExperienceAnalyticsAnomalyDeviceItemRequestBuilderGetQueryParameters $queryParameters = null) {
parent::__construct($headers ?? [], $options ?? []);
$this->queryParameters = $queryParameters;
} | [
"public function userExperienceAnalyticsDeviceScopes(): UserExperienceAnalyticsDeviceScopesRequestBuilder {\n return new UserExperienceAnalyticsDeviceScopesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceTimelineEvent(): UserExperienceAnalyticsDeviceTimelineEventRequestBuilder {\n return new UserExperienceAnalyticsDeviceTimelineEventRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceStartupProcesses(): UserExperienceAnalyticsDeviceStartupProcessesRequestBuilder {\n return new UserExperienceAnalyticsDeviceStartupProcessesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsNotAutopilotReadyDevice(): UserExperienceAnalyticsNotAutopilotReadyDeviceRequestBuilder {\n return new UserExperienceAnalyticsNotAutopilotReadyDeviceRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceScope(): UserExperienceAnalyticsDeviceScopeRequestBuilder {\n return new UserExperienceAnalyticsDeviceScopeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceStartupHistory(): UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder {\n return new UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsBatteryHealthAppImpact(): UserExperienceAnalyticsBatteryHealthAppImpactRequestBuilder {\n return new UserExperienceAnalyticsBatteryHealthAppImpactRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceScores(): UserExperienceAnalyticsDeviceScoresRequestBuilder {\n return new UserExperienceAnalyticsDeviceScoresRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"protected function initializeRequestBuilder() {\n\t\t$this->requestBuilder = $this->objectManager->get('Sto\\\\Mediaoembed\\\\Request\\\\RequestBuilder');\n\t\t$this->requestBuilder->setConfiguration($this->configuration);\n\t}",
"public function getMobileApplicationManagementAppConfigurationReport(): GetMobileApplicationManagementAppConfigurationReportRequestBuilder {\n return new GetMobileApplicationManagementAppConfigurationReportRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsAppHealthOverview(): UserExperienceAnalyticsAppHealthOverviewRequestBuilder {\n return new UserExperienceAnalyticsAppHealthOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function assignUserToDevice(): AssignUserToDeviceRequestBuilder {\n return new AssignUserToDeviceRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsAnomalyCorrelationGroupOverview(): UserExperienceAnalyticsAnomalyCorrelationGroupOverviewRequestBuilder {\n return new UserExperienceAnalyticsAnomalyCorrelationGroupOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsAppHealthDevicePerformance(): UserExperienceAnalyticsAppHealthDevicePerformanceRequestBuilder {\n return new UserExperienceAnalyticsAppHealthDevicePerformanceRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function chromeOSOnboardingSettings(): ChromeOSOnboardingSettingsRequestBuilder {\n return new ChromeOSOnboardingSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsImpactingProcess(): UserExperienceAnalyticsImpactingProcessRequestBuilder {\n return new UserExperienceAnalyticsImpactingProcessRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function deviceConfigurationDeviceStateSummaries(): DeviceConfigurationDeviceStateSummariesRequestBuilder {\n return new DeviceConfigurationDeviceStateSummariesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function getOffice365ActivationsUserDetail(): GetOffice365ActivationsUserDetailRequestBuilder {\n return new GetOffice365ActivationsUserDetailRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function appDefinitions(): AppDefinitionsRequestBuilder {\n return new AppDefinitionsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
defend by monitor requests | public function defend()
{
$lastRequest = $this->getRequest();
if (empty($lastRequest)) {
$this->logRequest();
} else
if ($lastRequest['blocked'] && $lastRequest['blocked'] > time() - $this->blockingPeriod) {
$this->blockRequest();
} else
if ($lastRequest['ip_address'] == $this->getIpAddress() && $lastRequest['request_uri'] == $this->getRequestUri() && $lastRequest['timestamp'] > time() - $this->pageInternal) {
if ($lastRequest['request_count'] >= $this->pageCount) {
$this->storage->update([
'blocked' => time()
]);
$this->blockRequest();
} else {
$this->updateLastRequestCounter($lastRequest['request_count'] + 1);
}
} else {
$this->logRequest();
}
} | [
"public function endRequest();",
"public function onEndRequest()\n\t{\n\t\t$this->flushOutput(false); // flush all remaining content in the buffer\n\t\t$this->saveGlobals(); // save global state\n\t\t$this->raiseEvent('OnEndRequest',$this,null);\n\t}",
"private static function requestEnd()\n {\n $_GET = array();\n $_POST = array();\n }",
"public function processRequests();",
"public function getFinishedRequests () {}",
"public function endRequest()\n {\n foreach ($this->files as $logFile) {\n $logFilePath = $this->getLogFilePath($logFile);\n $this->ranges[$logFile]['end'] = $this->getLastFilePosition($logFilePath);\n }\n }",
"public function httpReceived()\n {\n $this->httpResCount++;\n }",
"public function monitor() {\n\n $hold = $this->cfg['hold'];\n\n $http = $this->extcode();\n\n $rqst = $this->req->gettime();\n\n $time = ($rqst > $hold);\n\n $code = ($http != NULL);\n\n if($http == $this->req->conf['code']) {\n\n $this->logdata($this->cfg['log2']);\n\n return;\n\n }\n\n else if($time && !$code) {\n\n return $this->alert()->load($rqst);\n\n }\n\n else if(!$time && $code) {\n\n return $this->alert()->resp($http);\n\n }\n\n else if($time && $code) {\n\n return $this->alert()->tcrq($rqst, $http);\n\n }\n\n else {\n\n return;\n\n }\n\n }",
"private function endRequestProcess(): void\n {\n if ($this->hasFastCGI) {\n session_write_close(); //close the session\n fastcgi_finish_request();\n } else {\n $size = ob_get_length();\n header(\"Content-Length: \" . $size . \"\\r\\n\");\n // send info immediately and close connection\n ob_end_flush();\n flush();\n }\n }",
"public function track()\n {\n try {\n self::sendRequest();\n } catch (Exception $e) {\n //Log errors\n }\n }",
"public function afterRequest()\n\t{\n\t\t$this->trigger('afterRequest');\n\t}",
"public function finishAllRequests()\n {\n $this->waitForOutstandingRequestsToDropBelow(1);\n }",
"public function finishAllRequests() {\n $this->waitForOutstandingRequestsToDropBelow(1);\n }",
"protected function monitor() {\n\t\t$jobId = $this->currentJobId;\n\t\t$job = $this->getStatus($jobId);\n\n\t\t// If the start time is in the future, wait for that time (and re-check again)\n\t\twhile (($job = $this->getStatus($jobId)) && strtotime($job['start_time']) > time()) {\n\t\t\tset_time_limit($this->errorTimeout + (strtotime($job['start_time']) - time()) + 5);\n\t\t\tsleep((strtotime($job['start_time']) - time()));\n\t\t}\n\n\t\tif ($job['request']) {\n\t\t\t$result = $this->runAction(json_decode($job['request'], true), $jobId);\n\n\t\t\tif ($result !== true) {\n\t\t\t\t$job = $this->getStatus($jobId);\n\t\t\t\t$this->fail(array(\n\t\t\t\t\t'status_text' => $job['status_text'] . '<br>' . $result\n\t\t\t\t));\n\t\t\t}\n\t\t\t$this->finish(); // make sure it's finished if it's not finished or failed already\n\t\t} else {\n\t\t\t$this->fail(array('status_text' => 'Error: Request not found' . $jobId . var_export($job, true)));\n\t\t}\n\n\t\tYii::app()->end();\n\t}",
"function processEndCallFusion($request) {\n $connector = $this->getConnector();\n $connector->handleEndCallFusion($request);\n }",
"public function __destruct() {\n $this->finishAllRequests();\n }",
"public static function flush()\n {\n self::send('DELETE', '/guzzle-server/requests');\n }",
"public function execRequest() {\n // clear any current response data\n $this->clearResponse();\n // send the request\n $this->sendRequest();\n // parse the response\n $this->parseResponse();\n }",
"public function RoutineCheckAsyncRequests()\n {\n $this->horaro->asyncListen();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try to DESCRIBE the groups table to see whether the column exists / was added | function bp_group_hierarchy_verify_install( $debug_column = false ) {
global $wpdb, $bp;
/** Manually confirm that parent_id column exists */
$parent_id_exists = true;
$columns = $wpdb->get_results( 'DESCRIBE ' . $bp->groups->table_name );
if( $columns ) {
$parent_id_exists = false;
foreach( $columns as $column ) {
if( $column->Field == 'parent_id') {
$parent_id_exists = true;
break;
}
}
if( ! $parent_id_exists && $debug_column ) {
bp_group_hierarchy_debug( 'Required column was not found - last MySQL error was: ' . $wpdb->last_error );
return $parent_id_exists;
}
} else {
bp_group_hierarchy_debug( 'Could not DESCRIBE table - last MySQL error was: ' . $wpdb->last_error );
return false;
}
return $parent_id_exists;
} | [
"function _sql_groups()\n\t{\n\t\t$sql\t= array();\n\n\t\t//\t----------------------------------------\n\t\t//\tTable exists?\n\t\t//\t----------------------------------------\n\n\t\tif ( ee()->db->table_exists( 'exp_friends_groups' ) )\n\t\t{\n\t\t\tif ( $this->column_exists( 'total_members', 'exp_friends_groups' ) === FALSE )\n\t\t\t{\n\t\t\t\t$sql[]\t= \"ALTER TABLE \texp_friends_groups\n\t\t\t\t\t\t ADD \t\t\ttotal_members int(10) unsigned NOT NULL DEFAULT '0'\";\n\t\t\t}\n\n\t\t\tif ( $this->column_exists( 'description', 'exp_friends_groups' ) === FALSE )\n\t\t\t{\n\t\t\t\t$sql[]\t= \"ALTER TABLE \texp_friends_groups\n\t\t\t\t\t\t ADD \t\t\tdescription text NOT NULL DEFAULT ''\n\t\t\t\t\t\t AFTER \t\ttitle\";\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}",
"public function has_column($name);",
"function sd_tablecolumnexists($tablename,$columnname)\n{\n global $DB;\n\n if(!isset($tablename{0}) || !isset($columnname{0}))\n {\n return false;\n }\n\n $result = $DB->query_first(\"SHOW COLUMNS FROM `$tablename` WHERE `field` = '$columnname'\");\n return isset($result) && ($result !== False) && is_array($result) && (count($result)>0);\n\n}",
"function columnExists($tableName, $column) {\n $sql = \"describe \".$tableName;\n $rows = $this->exec($sql);\n if (is_array($rows)) {\n $columns = array();\n foreach ($rows as $row) {\n if (is_array($row)) {\n if (!empty($row[\"Field\"])) {\n # mysql 5\n $columns[] = $row[\"Field\"];\n } else {\n # older versions\n $columns[] = $row[0];\n }\n }\n }\n return in_array($column, $columns);\n } else {\n return false;\n }\n }",
"function dbGroupCheck(& $dbo, $groupId) {\n\n\t// determine if we're to check for name or id -- note group names CANNOT be numeric or \"all\"\n\tif ($groupId == 'all')\n\t\treturn true;\n\telseif (is_numeric($groupId)) $sql = 'SELECT count(group_id) FROM '.$dbo->table['groups'].' WHERE group_id=\\''.$groupId.'\\'';\n\telse\n\t\t$sql = 'SELECT count(group_id) FROM '.$dbo->table['groups'].' WHERE group_name=\\''.$groupId.'\\'';\n\n\treturn ($dbo->query($sql, 0)) ? true : false;\n}",
"public function check_attrgroup_exist($groupname){\n\t\t\t\n\t\t$result = $this->db->count_records(\"attribute_group\", array(\"groupname\" => $groupname));\n\t\t \n\t\treturn $result;\n\t}",
"public function requiresSQLGrouping() {\n\t\t\treturn true;\n\t\t}",
"public function hasColumns();",
"public function hasColumn(): bool;",
"function is_defined_column($table_name,$col_name){\n\tglobal $g_db_sql;\n\t$sql=\"\n\t\tselect 1 from all_tab_columns \n\t\twhere table_name='\".$table_name.\"' \n\t\tand column_name='\".$col_name.\"'\n\t\t\";\n\treturn $g_db_sql->GetOne($sql);\n}",
"function mysql_field_exists($db,$table,$field)\n{\n\t$fields = db_query(\"SHOW COLUMNS from $table LIKE '$field'\",$db);\n\tif (mysql_num_rows($fields) > 0)\n\treturn TRUE;\n\n}",
"private function getColumns()\n {\n $this->existingCols = $this->db->getColumns($this->tableName);\n if(count($this->existingCols) > 0)\n {\n $this->tableExists = true;\n }\n }",
"public function testCamposExisten()\n {\n for ($i=0; count($this->columns) > $i; $i++)\n {\n $this->assertTrue(Schema::hasColumn($this->tabla, $this->columns[$i]));\n }\n }",
"public function testCheckColumnDoesExistsInTable()\n {\n $this->assertTrue($this->migration->checkColumn('test', 'email'));\n }",
"public function hasAttributeColumns()\n {\n return isset($this->attribute_columns);\n }",
"public function hasGroup()\n {\n return $this->group_id > 0;\n }",
"protected function groupsExist() {\n return !empty($this->group_storage->loadMultiple());\n }",
"public function hasColumn(string $name): bool;",
"function group_exists_id($id)\n{\n\tglobal $dbh;\n\t$statement = $dbh->prepare(\"SELECT * FROM \" . TABLE_GROUPS . \" WHERE id=:id\");\n\t$statement->bindParam(':id', $id, PDO::PARAM_INT);\n\t$statement->execute();\n\tif ( $statement->rowCount() > 0 ) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method runs before a table is reordered | protected function onBeforeReorder(&$table)
{
// Call the behaviors
$result = $this->modelDispatcher->trigger('onBeforeReorder', array(&$this));
if (in_array(false, $result, true))
{
// Behavior failed, return false
return false;
}
return true;
} | [
"public function onAfterReorder(&$table)\n\t{\n\t\treturn true;\n\t}",
"protected static function preClearTables()\n {\n }",
"protected function printElementBeforeTable()\n {\n \n }",
"function postLoadTables() {}",
"function table_reflow_start()\n {\n $this->_in_table++;\n }",
"protected function printBeforeTableControlsTop()\n {\n \n }",
"public function preUpdateEvent()\n {\n $this->sortableSetPosition();\n $this->translatableFunction();\n }",
"function newColBefore()\n\t{\n\t\t$this->content_obj->newColBefore();\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\n\t}",
"function sortTable()\n\t{\n\t\t$flag = 'sort';\n\t\t$this->getDataTable($flag);\n\t}",
"function ResetColumnsOrder(){}",
"public function cms_reorder() {\n\t\t$this->autoRender = false;\n\t\tforeach($this->request->query['sortable'] as $k=>$v) {\n\t\t\t$this->Page->id = end(explode('row_',$v));\n\t\t\t$this->Page->set('position',$k);\n\t\t\t$this->Page->save();\n\t\t}\t\t\n\t}",
"protected function _prepareRowsAction() {\n \n }",
"private function step_sync_table()\n {\n }",
"protected function afterTableCreation()\n {\n \n }",
"protected function _addOrderTable()\n {\n\n $iTableStart = $this->_iPosition;\n\n $this->_addOrderTableHeader();\n\n $this->line(self::LINEBEGIN, $this->_iPosition, self::LINEEND, $this->_iPosition);\n\n $this->_addArticleList();\n\n $this->line(self::LINEBEGIN, $this->_iPosition, self::LINEEND, $this->_iPosition);\n\n $this->_addShippingInfo();\n\n $this->line(self::LINEBEGIN, $this->_iPosition, self::LINEEND, $this->_iPosition);\n\n $this->_addOrderSummary();\n\n $this->line(self::COLTWO, $iTableStart, self::COLTWO, $this->_iPosition);\n $this->line(self::COLTHREE, $iTableStart, self::COLTHREE, $this->_iPosition);\n $this->line(self::COLFOUR, $iTableStart, self::COLFOUR, $this->_iPosition);\n }",
"public function ajaxReorder()\n\t{\n\t\t//get table model\n\t\t$model =& JModel::getInstance('table', 'FabrikModel');\n\t\t$model->setId(JRequest::getInt('tableid'));\n\t\t$db =& $model->getDb();\n\t\t$direction = JRequest::getVar('direction');\n\n\t\t$orderEl = $model->getForm()->getElement(JRequest::getInt('orderelid'), true);\n\t\t$table = $model->getTable();\n\t\t$origOrder = JRequest::getVar('origorder');\n\t\t$orderBy =$db->nameQuote($orderEl->getElement()->name);\n\t\t$order = JRequest::getVar('order');\n\t\t$dragged = JRequest::getVar('dragged');\n\n\t\t//are we dragging up or down?\n\t\t$origPos = array_search($dragged, $origOrder);\n\t\t$newPos = array_search($dragged, $order);\n\t\t$dragDirection = $newPos > $origPos ? 'down' : 'up';\n\n\t\t//get the rows whose order has been altered\n\t\t$result = array_diff_assoc($order, $origOrder);\n\t\t$result = array_flip($result);\n\t\t//remove the dragged row from the list of altered rows\n\t\tunset($result[$dragged]);\n\n\t\t$result = array_flip($result);\n\n\t\tif (empty($result)) {\n\t\t\t//no order change\n\t\t\treturn;\n\t\t}\n\t\t//get the order for the last record in $result\n\t\t$splitId = $dragDirection == 'up' ? array_shift($result) : array_pop($result);\n\t\t$db->setQuery(\"SELECT \".$orderBy.\" FROM \".$table->db_table_name.\" WHERE \".$table->db_primary_key.\" = \".$splitId);\n\t\t$o = (int)$db->loadResult();\n\n\n\t\tif ($direction == 'desc') {\n\t\t\t$compare = $dragDirection == 'down' ? '<' : '<=';\n\t\t}else{\n\t\t\t$compare = $dragDirection == 'down' ? '<=' : '<';\n\t\t}\n\t\t//shift down the ordered records which have an order less than or equal the newly moved record\n\t\t$query = \"UPDATE \".$table->db_table_name.\" SET \".$orderBy.' = COALESCE('.$orderBy.', 1) - 1 ';\n\t\t$query .= \" WHERE \".$orderBy.' '.$compare.' '.$o.' AND '.$table->db_primary_key. ' <> '.$dragged;\n\t\t$db->setQuery($query);\n\t\tif(!$db->query()) {\n\t\t\techo $db->getErrorMsg();\n\t\t} else {\n\n\t\t\t//shift up the ordered records which have an order greater than the newly moved record\n\n\t\t\tif ($direction == 'desc') {\n\t\t\t\t$compare = $dragDirection == 'down' ? '>=' : '>';\n\t\t\t}else{\n\t\t\t\t$compare = $dragDirection == 'down' ? '>' : '>=';\n\t\t\t}\n\n\t\t\t$query = \"UPDATE \".$table->db_table_name.\" SET \".$orderBy.' = COALESCE('.$orderBy.', 0) + 1';\n\t\t\t$query .= \" WHERE \".$orderBy.' '.$compare.' '.$o;\n\n\t\t\t$db->setQuery($query);\n\n\t\t\tif(!$db->query()) {\n\t\t\t\techo $db->getErrorMsg();\n\t\t\t} else {\n\t\t\t\t//change the order of the moved record\n\t\t\t\t$query = \"UPDATE \".$table->db_table_name.\" SET \".$orderBy.' = '.$o;\n\t\t\t\t$query .= \" WHERE \".$table->db_primary_key.' = '.$dragged;\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$db->query();\n\t\t\t}\n\t\t}\n\t\t$model->reorder(JRequest::getInt('orderelid'));\n\t}",
"protected function runExtTablesPostProcessingHooks() {}",
"private function get_row_action_sort_order()\n {\n }",
"public function tableModify()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the first photo associated with the model. | public function getFirstPhotoAttribute()
{
if ($this->hasPhotos()) {
foreach ($this->photos as $photo) {
return $photo;
}
}
return false;
} | [
"public function getFirstPhoto() {\n return $this->get(1);\n }",
"public function getSinglePhoto() {\n $id = $this->getPhotoId();\n $this->getPhoto($id);\n }",
"public function FirstImage()\n {\n return $this->owner->Images()\n ->Sort($this->owner->Sorter)\n ->limit(1)\n ->First();\n }",
"public function getPrimaryPhoto(): ?Photo\n {\n // gets the first photo related to this blog\n return $this->photos()->where('photos.is_primary', '=', '1')->first();\n }",
"public function getPrimaryPhoto()\n {\n $arrPhotos = $this->_getArrayValue(\n $this->_arrResponse,\n [\n self::KEY_PHOTO\n ],\n []\n );\n\n foreach ($arrPhotos as $arrPhoto) {\n if (isset($arrPhoto['IsPrimary']) && $arrPhoto['IsPrimary']) {\n $itemPhoto = new Item\\Photo($arrPhoto);\n break;\n }\n }\n if (!isset($itemPhoto)) {\n if (empty($arrPhotos)) {\n // Got no photos, explicitly return null\n return null;\n }\n // Choose the first photo if we don't have a primary\n $itemPhoto = new Item\\Photo($arrPhotos[0]);\n }\n return $itemPhoto;\n }",
"public function getFirstImage() {\n $image = $this->getImage()->toArray();\n return $image[0];\n }",
"public function getFirstImage() {\n\t\t$images = $this->getImage()->toArray();\n\t\treturn $images[0];\n\t}",
"public function getFirstImage() {\n\t\tforeach($this->images as $image){\n\t\t\treturn $image;\n\t\t}\t\t\n\t}",
"public function getPhoto()\n {\n return $this->photo[0];\n }",
"public function getPrimaryPhoto(): ?Photo\n {\n // gets the first photo related to this event\n return $this->photos()->where('photos.is_primary', '=', '1')->first();\n }",
"public function primaryPhoto()\n {\n return $this->hasOne(Photo::class)->primary();\n }",
"public function getPrimaryPhoto(): ?Photo\n {\n // get a list of events that start on the passed date\n return $this->photos()->where('photos.is_primary', '=', '1')->first();\n }",
"public function one_pic()\n {\n return $this->pics()->take(1);\n }",
"public function getFirstImage()\n {\n $images = $this->getImages();\n foreach ($images as $image) {\n return $image;\n }\n\n return null;\n }",
"public function getPrimaryPhoto()\n {\n // gets the first photo related to this event\n $primary = $this->photos()->where('photos.is_primary', '=', '1')->first();\n\n return $primary;\n }",
"public function getFirstImage()\n {\n if(count($this->images) > 0) {\n return $this->images[0];\n }\n\n return null;\n }",
"public function getFirstImage()\n {\n $image = DB::selectOne(\"\n SELECT TOP 1 file_name\n FROM auction_images\n WHERE auction_id=:id\",\n [\n \"id\" => $this->id\n ]);\n if ($image === false) {\n return \"../images/no-image.jpg\";\n }\n return $image[\"file_name\"];\n }",
"public function getPrimaryPhoto()\n {\n // get a list of events that start on the passed date\n $primary = $this->photos()->where('photos.is_primary', '=', '1')->first();\n\n return $primary;\n }",
"public function mainPhoto() {\r\n return $this->hasOne(\r\n 'App\\\\FileUpload',\r\n 'business_id',\r\n 'id'\r\n )\r\n ->where('upload_type', '=', 'business.photo')\r\n ->orderBy('created_at', 'ASC');\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to update a ride after it has been reserved | public function update_ride($id)
{
$res=mysql_query("UPDATE rides SET `available`=0 WHERE `id`= '$id' ");
return $res;
} | [
"public function reserve()\n {\n $this->update(['reserved_at' => Carbon::now()]);\n }",
"public function update_car_ride() {\n $data = array(\n 'origin' => $this->input->post('origin'),\n 'destination' => $this->input->post('destination'),\n 'price' => $this->input->post('price'),\n 'vacancy' => $this->input->post('vacancy'),\n 'plate_number' => $this->input->post('plate_number'),\n 'start_time' => $this->input->post('start_time')\n );\n\n $sql = \"UPDATE car_rides\n SET origin = ?, destination = ?, price = ?, vacancy = ?\n WHERE plate_number = ?\n AND start_time = ?\";\n\n // return true if updated successfully\n return $this->db->query($sql, $data);\n }",
"public function setReserved() {\n $this->activityId = Vacancy::RESERVE;\n $this->Save();\n }",
"public function updateItinerary()\n\t{\n\t\t$user = $this->user_model->getUser();\n\n\t\tif($user)\n\t\t{\n\t\t\t$updatedItineraryRidesText = $this->input->post('itineraryRides');\n\t\t\t\n\t\t\tif(!$updatedItineraryRidesText)\n\t\t\t{\n\t\t\t\t$updatedItineraryRidesText = $this->input->get('itineraryRides');\n\t\t\t}\n\t\t\t\n\t\t\t$updatedItineraryRides = $this->readItineraryRidesText(\n\t\t\t\t$updatedItineraryRidesText);\n\n\t\t\t$currentItineraryRides =\n\t\t\t\t$this->itinerary_model->getItineraryRides($user);\n\n\t\t\tforeach($currentItineraryRides as $itineraryRide)\n\t\t\t{\n\t\t\t\t$matchingItineraryRide = $this->getMatchingItineraryRide(\n\t\t\t\t\t$updatedItineraryRides, $itineraryRide);\n\n\t\t\t\tif($matchingItineraryRide !== null)\n\t\t\t\t{\n\t\t\t\t\tif($itineraryRide->getPriority() !=\n\t\t\t\t\t$matchingItineraryRide->getPriority())\n\t\t\t\t\t{\n\t\t\t\t\t\t$itineraryRide->setPriority(\n\t\t\t\t\t\t$matchingItineraryRide->getPriority());\n\n\t\t\t\t\t\t$itineraryRide->save();\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$itineraryRide->delete();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($updatedItineraryRides as $itineraryRide)\n\t\t\t{\n\t\t\t\tif(!$this->getMatchingItineraryRide(\n\t\t\t\t\t$currentItineraryRides, $itineraryRide))\n\t\t\t\t{\n\t\t\t\t\t$rideIdToAdd = $itineraryRide->getRideId();\n\t\t\t\t\t$priority = $itineraryRide->getPriority();\n\n\t\t\t\t\t$ride = RidePeer::retrieveByPK($rideIdToAdd);\n\t\t\t\t\t$this->itinerary_model->addItineraryRide(\n\t\t\t\t\t$user, $ride, $priority);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo \"success\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->load->view('forbidden');\n\t\t}\n\t}",
"public function updateVisibleTime (Request $request) {\n \n $validators = Validator::make($request->all(),[\n 'ride_id' => 'required',\n 'ride_visiable_time' => 'required'\n ]);\n \n if($validators->fails()){\n return Response::json(['errors'=>$validators->getMessageBag()->toArray()]);\n }\n \n try {\n \n $ride = RideList::find($request->ride_id);\n $ride->ride_visiable_time = $request->ride_visiable_time;\n $ride->update();\n \n } catch (Exception $ex) {\n $ex->getMessage();\n }\n \n return response()->json();\n \n }",
"function placeAvailable()\n {\n $this->available = TRUE;\n $this->save();\n $this->givePlace();\n }",
"public function refreshSlot()\n {\n }",
"public function update(Request $request, Ride $ride)\n {\n // Retrieve the validated input data...\n $validated = $request->validated();\n }",
"public function set_car_ride() {\n $data = array(\n 'plate_number' => $this->input->post('plate_number'),\n 'start_time' => $this->input->post('start_time'),\n 'origin' => $this->input->post('origin'),\n 'destination' => $this->input->post('destination'),\n 'price' => $this->input->post('price'),\n 'vacancy' => $this->input->post('vacancy')\n );\n\n $sql = \"INSERT INTO car_rides\n VALUES (?, ?, ?, ?, ?, ?)\";\n\n // return true if insert sucessfully\n return $this->db->query($sql, $data);\n }",
"public function updateReservation($params);",
"function addNewRide($ride)\n{\n\t$rideId = addNewRidetoDB($ride);\n\t$ride->rideId = $rideId;\n\tif($ride->tripFrequency == \"onetime\") {\n\t\t//If this is a one time trip just add a single ride instance\n\t\taddRideInstance($rideId, $ride->tripStartDate);\n\t\t\n\t} else { \n\t\t//if this is a recurring trip add instances for each date the ride occurs\n\t\n\t}\n\t//If this is a two way trip repeat the above two steps for the return trip.\n\tif($ride->tripType == \"roundtrip\") {\n\t\tif($ride->tripFrequency == \"onetime\") {\n\t\t\t//If this is a one time trip just add a single return ride instance\n\t\t\n\t\t} else {\n\t\t\t//if this is a recurring trip add return instances for each date the ride occurs\n\t\t\n\t\t}\n\t}\n}",
"public function update(UpdateRequest $request, Ride $ride)\n {\n $validated = $request->validated();\n\n $ride->update(\n $validated\n );\n\n if ($request->status_id == 2){\n $ride->start_at = Carbon::now()->toDateTimeString();\n }\n\n if ($request->status_id == 5){\n $ride->finish_at = Carbon::now()->toDateTimeString();\n $ride->ride_duration = (new Carbon($ride->finish_at))\n ->diff(new Carbon($ride->start_at))->format('%H:%M:%S');\n }\n\n $ride->save();\n\n event(new RideChange($ride));\n\n return response()->json([\n 'message' => __('ride.change'),\n 'ride' => new RideResource(\n $ride\n )\n ], 201);\n }",
"public function incStarvation(){ \n $this->die_cause['starvation']++;\n }",
"public function bookTimeslot(){\n\n\t\t\t$this->db->where('tsl_id', $this->input->post('timeslotId'));\n\t\t\t$this->db->update('timeslot', array('tsl_booked' => 1));\n\t\t}",
"public function startRide(Request $request){\n\n $res['success'] = false;\n $res['msg'] = trans('Api::language.LANG_FAILED_TO_START_RIDE');\n $res['code'] = 400; \n\n $vArray = [ \n\n 'ride_id' => 'required', \n ];\n\n //Validate request\n check_validation($request, $vArray);\n\n $user = $request->get('user'); \n $rideId = $request->get('ride_id'); \n \n $where = array('rides.id' => $rideId, 'ride_status' => 'Accepted');\n \n $update = array('ride_status' => 'Running','start_ride_date' => date('Y-m-d H:i:s'));\n\n $checkRide = Ride::where($where)->update($update);\n\n if ($checkRide) {\n\n $driverName = ucfirst($user->first_name.' '.$user->last_name);\n\n $getRideInfo = Ride::where(array('rides.id' => $rideId))->first(['passenger_id']);\n\n //Notification\n $message = \"Great! $driverName has started your ride, enjoy your ride!\";\n\n $body = array(\"type\" => \"START_RIDE\", \n \"message\" => $message,\n \"ride_id\" => $rideId,\n );\n \n $title = \"Ride Started\";\n \n $userArray[] = $getRideInfo->passenger_id; \n \n send_notification($userArray, $body, $title);\n\n $res['success'] = true; \n $res['msg'] = trans('Api::language.LANG_RIDE_HAS_BEEN_START'); \n $res['code'] = 200;\n \n }else{\n\n $checkCancelled = Ride::where(['id' => $rideId, 'ride_status' => 'Cancelled'])->first(['id']);\n \n if (!empty($checkCancelled)) {\n \n $res['success'] = false; \n $res['msg'] = trans('Api::language.LANG_RIDE_HAS_BEEN_CANCELLED'); \n $res['code'] = 400; \n $res['result'] = \"Cancelled\"; \n\n }\n }\n\n return Response::json($res);\n }",
"public function end_ride(Request $request)\r\n {\r\n if ($error = $this->key($request->input('token'))) {\r\n return response()->json(['not valid key'], 200);\r\n }\r\n $driver_id = $request->input('driver_id');\r\n if ($data = $this->check_empty($driver_id, 'Please provide driver_id'))\r\n return response()->json($data, 200);\r\n\r\n $ride_id = $request->input('ride_id');\r\n if ($data = $this->check_empty($ride_id, 'Please provide ride_id'))\r\n return response()->json($data, 200);\r\n\r\n $destination_latitude = $request->input('destination_latitude');\r\n if ($data = $this->check_empty($destination_latitude, 'Please provide destination'))\r\n return response()->json($data, 200);\r\n $destination_longitude = $request->input('destination_longitude');\r\n if ($data = $this->check_empty($destination_longitude, 'Please provide destination'))\r\n return response()->json($data, 200);\r\n $dist_picktodest = $request->input('dist_picktodest');\r\n if ($data = $this->check_integer_empty($dist_picktodest, 'Please provide dist_picktodest'))\r\n return response()->json($data, 200);\r\n\r\n $dist_drivertopick = $request->input('dist_drivertopick');\r\n if ($data = $this->check_integer_empty($dist_drivertopick, 'Please provide dist_drivertopick'))\r\n return response()->json($data, 200);\r\n\r\n $ride_data = DB::table('dn_rides')->select('id','status','ride_start_time','passenger_id', 'pickup_time','payment_id','pickup_longitude','pickup_latitude','driver_id','transport_mode','driver_latitude','driver_longitude','driver_level')->where(['id' => $ride_id])->first();\r\n $tier_level = $ride_data->driver_level;\r\n $tier_level_bonus = DB::table('dn_driver_bonus')->select('*')->orderBy('id', 'desc')->first();\r\n if($tier_level == 0){\r\n\r\n $dezi_commission = $tier_level_bonus->commission_silver/100;\r\n }else if($tier_level == 1){\r\n\r\n $dezi_commission = $tier_level_bonus->commission_silver/100;\r\n }else if($tier_level == 2){\r\n\r\n $dezi_commission = $tier_level_bonus->commission_gold/100;\r\n }else if($tier_level == 3){\r\n\r\n $dezi_commission = $tier_level_bonus->commission_platinum/100;\r\n }else if($tier_level == 4){\r\n\r\n $dezi_commission = $tier_level_bonus->commission_diamond/100;\r\n }\r\n\r\n if($ride_data){\r\n $start_longitude =$ride_data->pickup_longitude;\r\n $start_latitude = $ride_data->pickup_latitude;\r\n $driver_lat = $ride_data->driver_latitude;\r\n $driver_long = $ride_data->driver_longitude;\r\n $passenger_info = (array)DB::table('dn_users')->select('first_name', 'last_name', 'profile_pic',DB::raw('concat( country_phone_code, \"\", contact_number) as contact_number'))->where('id', $ride_data->passenger_id)->first();\r\n $ride_end_time = date('Y-m-d H:i:s');\r\n\r\n //fare calculation -----------------------------------------\r\n $to_time = strtotime($ride_end_time);\r\n $from_time = strtotime($ride_data->ride_start_time);\r\n $ride_duration = round(abs($to_time - $from_time) / 60,2);\r\n $adminCharges = $this->get_cityname($start_latitude,$start_longitude,$ride_data->pickup_time,$ride_id);\r\n $service_chg = $adminCharges->service_charge;\r\n\r\n //distance calculation in miles\r\n $travel_distance = $dist_picktodest;\r\n\r\n $passenger_to_driver = $dist_drivertopick;\r\n\r\n if ($passenger_to_driver <= 2) {\r\n $passenger_to_driver_charges = $adminCharges->less_mile_travel_cost;\r\n } else {\r\n if($ride_data->transport_mode == 'public'){\r\n $passenger_to_driver_charges = $adminCharges->greater_mile_travel_cost;\r\n }else {\r\n $passenger_to_driver_charges = file_get_contents(\"https://api.uber.com/v1/estimates/price?server_token=ZPJytLhhzA7xykRCqLiNRNOC79YSYMGn3F6Q0bKo&start_longitude=$driver_long&end_longitude=$start_longitude&start_latitude=$driver_lat&end_latitude=$start_latitude\");\r\n $passenger_to_driver_charges = json_decode($passenger_to_driver_charges);\r\n $passenger_to_driver_charges = $passenger_to_driver_charges->prices[0]->high_estimate;//meters\r\n }\r\n }\r\n $cost_per_mile = $adminCharges->cost_per_mile;\r\n $waiting_charge_min = $adminCharges->per_min_charge;\r\n\r\n $standard_wait_duration = $ride_duration;\r\n\r\n //fair calculation\r\n $travel_distance_chagres = $travel_distance * $cost_per_mile;\r\n $standard_wait_duration_chagres = $waiting_charge_min * $standard_wait_duration;\r\n $fair = $travel_distance_chagres + $standard_wait_duration_chagres + $passenger_to_driver_charges + $service_chg;\r\n $fair = round($fair,2);\r\n $min_charge = $adminCharges->min_charge;\r\n if($fair > $min_charge){\r\n\r\n $min_charge_charge = 0.00;\r\n $amount_for_trip = $travel_distance_chagres + $standard_wait_duration_chagres;\r\n $dezinow_fee = $amount_for_trip * $dezi_commission;\r\n $sub_total = $amount_for_trip - $dezinow_fee;\r\n $driver_earning = $sub_total + $passenger_to_driver_charges;\r\n }else if($fair < $min_charge){\r\n\r\n $min_charge_charge = $min_charge - $fair;\r\n if(empty($min_charge_charge)){\r\n $min_charge_charge = 0.00;\r\n }\r\n $amount_for_trip = $min_charge - $service_chg - $passenger_to_driver_charges;\r\n $dezinow_fee = $amount_for_trip * $dezi_commission;\r\n $sub_total = $amount_for_trip - $dezinow_fee;\r\n $driver_earning = $sub_total + $passenger_to_driver_charges;\r\n $fair = round($min_charge,2);\r\n }\r\n\r\n $billing_data = [\r\n 'ride_id' => $ride_id,\r\n 'miles' => $travel_distance,\r\n 'miles_charges' => $travel_distance_chagres ? $travel_distance_chagres : 0.00,\r\n 'duration' => $standard_wait_duration ? $standard_wait_duration : 0.00,\r\n 'duration_charges' => $standard_wait_duration_chagres ? $standard_wait_duration_chagres : 0.00,\r\n 'subtotal' => $sub_total ? $sub_total : 0.00,\r\n 'subtotal_passenger' => $standard_wait_duration_chagres + $travel_distance_chagres,\r\n 'service_fee' => $service_chg ? $service_chg : 0.00,\r\n 'pickup_fee' => $passenger_to_driver_charges ? $passenger_to_driver_charges : 0.00,\r\n 'minimum_charge' => $min_charge ? $min_charge : 0.00,\r\n 'driver_earnings' => $driver_earning ? $driver_earning : 0.00,\r\n 'dezinow_earning' => $dezinow_fee ? $dezinow_fee : 0.00,\r\n 'min_charge' => $min_charge_charge ? $min_charge_charge : 0.00,\r\n 'total_charges' => $fair ? $fair : 0.00,\r\n ];\r\n\r\n $map_image = \"https://maps.googleapis.com/maps/api/staticmap?center=$start_latitude,$start_longitude&size=500x250&maptype=roadmap&markers=icon:http://www.dezinow.com/uploads/icons/pickup.png%7C$start_latitude,$start_longitude&markers=icon:http://www.dezinow.com/uploads/icons/dropoff.png%7C$destination_latitude,$destination_longitude\";\r\n DB::table('dn_rides')\r\n ->where(['driver_id' => $driver_id, 'id' => $ride_id])\r\n ->update([\r\n 'destination_latitude' => $destination_latitude,\r\n 'destination_longitude' => $destination_longitude,\r\n 'ride_end_time' => $ride_end_time,\r\n 'status' => '2',\r\n 'bill_generated' => '1',\r\n 'map_image' => $map_image,\r\n ]);\r\n\r\n DB::table('ride_billing_info')->insertGetId($billing_data);\r\n $data = ['status' => 1];\r\n $check_notification = $this->sendGoogleCloudMessage('Ride has been completed', '6', $passenger_info, $ride_data->passenger_id, $ride_data->driver_id, $ride_id);\r\n }\r\n else{\r\n $data = ['status' => 0, 'message' => 'The Ride you are requesting is not active!'];\r\n }\r\n\r\n return response()->json($data);\r\n\r\n }",
"private function refreshAvailability ()\n {\n $time = $this->currentTime;\n $addressId = $this->lastBookingAddressId();\n\n foreach ( $this->bookings as $booking ) {\n if ( $time >= $booking['actual_start_time'] ) {\n if ( $time <= $booking['actual_end_time'] ) {\n $time = $booking['actual_end_time'];\n $addressId = $booking['drop_address_id'];\n }\n\n continue;\n }\n\n $this->createAvailability($time, $booking['actual_start_time'], $addressId);\n $time = $booking['actual_end_time'];\n $addressId = $booking['drop_address_id'];\n }\n\n if ( $time < $this->maxAvailabilityDateTime )\n $this->createAvailability($time, $this->maxAvailabilityDateTime, $addressId);\n }",
"private function appendNextAvailability ()\n {\n ( new AssetAvailabilityManagement([\n 'start_time' => $this->startTime,\n 'address_id' => $this->dropAddress->id,\n ], $this->nextAvailability) )->update();\n }",
"public function changeRideRequestStatus(Request $request)\n {\n /**\n * if request_id in invalid or request not belongs to driver\n * or request status is not allowed to canceled\n */\n $rideRequest = $this->rideRequest->where('id', $request->ride_request_id)\n ->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::DRIVER_ACCEPTED, Ride::DRIVER_STARTED])\n ->first();\n\n if(!$rideRequest) {\n return $this->api->json(false, 'INVALID_RIDE_REQUEST', 'Invalid ride request'); \n }\n\n\n /**\n * validation status paramter input\n */\n if(!in_array($request->status, [Ride::DRIVER_STARTED, Ride::DRIVER_REACHED])) {\n return $this->api->json(false, 'INVALID_RIDE_STATUS', 'Invalid ride status'); \n }\n\n\n $authDriver = $request->auth_driver;\n\n //changing ride request status\n $rideRequest->ride_status = Ride::DRIVER_REACHED; //$request->status; make always reach in this. because driver started button not available.\n\n /** add driver_started_time */\n if($request->status == Ride::DRIVER_STARTED) {\n $rideRequest->driver_started_time = date('Y-m-d H:i:s');\n }\n\n /** add driver reached to pickup location time */\n if($request->status == Ride::DRIVER_REACHED) {\n $rideRequest->driver_reached_time = date('Y-m-d H:i:s');\n }\n\n $rideRequest->save();\n\n \n // same notification data to be sent to user\n $notificationData = [\n 'ride_request_id' => $rideRequest->id,\n 'ride_status' => $rideRequest->ride_status,\n ];\n\n\n /** send push notification to user */\n if($request->status == Ride::DRIVER_STARTED) {\n $pushNotificationTitle = Utill::transMessage('app_messages.driver_started_title');\n $pushNotificationText = Utill::transMessage('app_messages.driver_started_message', ['drivername' => $authDriver->fname, 'vehicleno' => $authDriver->vehicle_number]);\n } else if($request->status == Ride::DRIVER_REACHED) {\n $pushNotificationTitle = Utill::transMessage('app_messages.driver_reached_title');\n $pushNotificationText = Utill::transMessage('app_messages.driver_raached_message');\n }\n\n $user = $this->user->find($rideRequest->user_id);\n $user->sendPushNotification($pushNotificationTitle, $pushNotificationText, [], \"com.capefox.cabrider.ui.activities.NavigationActivity\");\n\n\n /**\n * send socket push to user\n */\n $this->socketIOClient->sendEvent([\n 'to_ids' => $rideRequest->user_id,\n 'entity_type' => 'user', //socket will make it uppercase\n 'event_type' => 'ride_request_status_changed',\n 'data' => $notificationData\n ]);\n\n return $this->api->json(true, 'RIDE_REQUEST_STATUS_CHANGED', 'Ride Request status changed'); \n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation restPaymentsMethodsListGet Returns all payment methods with id and name | public function restPaymentsMethodsListGet()
{
list($response) = $this->restPaymentsMethodsListGetWithHttpInfo();
return $response;
} | [
"public function getPaymentMethods()\n {\n /** @var oxPayment $oxPayment */\n $oxPayment = oxNew('oxPayment');\n $sql = \"SELECT `OXID` FROM {$oxPayment->getViewName()} WHERE {$oxPayment->getSqlActiveSnippet()}\";\n $methods = marm_shopgate::dbGetAll($sql);\n\n $result = array();\n foreach ($methods as $oxidMethod) {\n $result[] = array(\n 'id' => $oxidMethod['OXID'],\n );\n }\n\n return $result;\n }",
"public function readPaymentMethods()\n {\n return PaymentMethod::all(['id', 'name']);\n }",
"public function getAllPaymentMethods()\n {\n try {\n $query = '\n SELECT \n id, name \n FROM \n paymentMethods\n\t\t\t';\n return $this->db->fetchAll($query);\n } catch (Exception $exception) {\n echo 'Caught exception: ' . $exception->getMessage() . \"\\n\";\n }\n }",
"public static function getPaymentMethods(): array;",
"private function getPaymentMethods()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t ->select('virtuemart_paymentmethod_id, payment_element, payment_params')\n\t\t ->from('#__virtuemart_paymentmethods')\n\t\t ->where('published = 1');\n\t\t$db->setQuery($query);\n\t\t$methods = $db->loadObjectList();\n\t\t\n\t\tif(empty($methods))\n\t\t{\n\t\t\t$methods = array();\n\t\t}\n\t\t\n\t\treturn $methods;\n\t}",
"public function retrieveAvailablePaymentMethods()\n {\n $url = $this->getUrl('GetPaymentMethods.pmt');\n\n $post_data['sellerid'] = $this->sellerid;\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n $response = curl_exec($ch);\n\n $xml = simplexml_load_string($response);\n $json = json_encode($xml);\n\n return json_decode($json, true);\n }",
"private function getPaymentMethodList()\n {\n if ($this->paymentMethodList === null) {\n $this->paymentMethodList = ObjectManager::getInstance()->get(\n PaymentMethodListInterface::class\n );\n }\n return $this->paymentMethodList;\n }",
"public function method_listMethods()\n {\n $class = new ReflectionClass( $this->getClassName() );\n $methods = array();\n foreach( $class->getMethods() as $method )\n {\n $name = $method->getName();\n if ( $this->isServiceMethodName( $name ) )\n {\n $methods[] = substr( $name, strlen(JsonRpcMethodPrefix) );\n }\n }\n return $methods;\n }",
"public function getAvailablePaymentMethods() {\r\n\t\t\r\n\t//TODO - Insert your code here\r\n\t}",
"public function getPaymentMethods()\n {\n return $this->app['db.utils']->getSetValues(self::$table_name, 'payment_methods');\n }",
"public function testGETPaymentGatewayIdPaymentMethods()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function getAllPayments()\n {\n return $this->payment->getPaymentMethods();\n }",
"public function testGETPaypalGatewayIdPaymentMethods()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function getSupportedPaymentMethods()\n {\n $url = \"supported-payment-methods\";\n $headers = array_merge($this->headers, [\n 'app-id' => $this->app_id,\n 'idempotency-key' => $this->_idemPotencyKey(),\n 'private-key' => $this->private_key,\n ]);\n $timeout = $this->timeout;\n try {\n $response = $this->http->get($url, compact('headers', 'timeout'));\n return $this->_format($response);\n } catch (RequestException $e) {\n $response = $e->getResponse();\n return $this->_format($response, $e);\n }\n }",
"public function grabPaymentMethods()\r\n {\r\n if( ! isset($this->_module['apitoken']) ) $this->_module['apitoken'] = '';\r\n if( ! isset($this->_module['service_id']) ) $this->_module['service_id'] = '';\r\n \r\n if(isset($apitoken)) $this->_module['apitoken'];\r\n \r\n \r\n $objServiceApi = new Pay_Api_Getservice();\r\n $objServiceApi->setApiToken( $this->_module['apitoken'] );\r\n $objServiceApi->setServiceId( $this->_module['service_id']);\r\n\r\n $arrServiceResult = $objServiceApi->doRequest();\r\n \r\n //cleanup result for export to smarty\r\n $strBasePath = $arrServiceResult['service']['basePath'];\r\n $arrPaymentOptions = array();\r\n foreach($arrServiceResult['paymentOptions'] as $paymentOption)\r\n {\r\n $tmpPaymentOption = array();\r\n $tmpPaymentOption['id'] = $paymentOption['id'];\r\n $tmpPaymentOption['name'] = $paymentOption['visibleName'];\r\n $tmpPaymentOption['image'] = $strBasePath . $paymentOption['path'] . $paymentOption['img'];\r\n\r\n if(isset($_POST['optionId']) && $paymentOption['id'] === $_POST['optionId'])\r\n {\r\n $tmpPaymentOption['checked'] = ' checked=\"checked\"';\r\n $GLOBALS['smarty']->assign('optionId', (int) $paymentOption['id']); \r\n }\r\n\r\n $arrPaymentOptions[$tmpPaymentOption['id']] = $tmpPaymentOption;\r\n }\r\n\r\n return Pay_Helper::sortPaymentOptions($arrPaymentOptions);\r\n }",
"public function paymentMethods()\n {\n $this->integrityCheck();\n\n $paymentMethods = $this->mpay24Sdk->listPaymentMethods();\n\n $this->recordedLastMessageExchange(\"PaymentMethods\");\n\n return $paymentMethods;\n }",
"public function getmethods($id)\n {\n return PaymentNetwork::where('service_id',$id)->get();\n }",
"public function listPayments(){\n return new ObtieneListadoDePagosRealizadosApi($this->client, $this->config, $this->headerSelector);\n }",
"function paymentMethodList()\n {\n global $CFG, $objSmarty;\n\n $resid = $this->filterInput($_SESSION['restaurantownerid']);\n\n $sql_sel = \"SELECT paymentinfo_id, paymentinfo_name, paymentinfo_photo, paymentinfo_status, addeddate FROM \" .\n $CFG['table']['paymentinfo'] .\n \" WHERE paymentinfo_status = '1' AND paymentinfo_id IS NOT NULL ORDER BY paymentinfo_name ASC\";\n $res = $this->ExecuteQuery($sql_sel, 'select');\n \n \n foreach ($res as $key => $value)\n {\n $res[$key]['paymentmethod'] = $this->getValue(\"paymentmethod\", $CFG['table']['restaurant_choose_paymentoption'],\n \"paymentoption = '\" . $this->filterInput($res[$key]['paymentinfo_id']) . \"' AND restaurant_id = '\" .\n $resid . \"'\");\n \n }\n $objSmarty->assign(\"searchrestaurantDetailsPaymethod\", $res);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queues transactional email so it's not sent in current request if enabled, otherwise falls back to send now. | public static function queue_transactional_email() {
if ( is_a( self::$background_emailer, 'WeDevs\PM\Core\Notifications\Background_Emailer' ) ) {
self::$background_emailer->push_to_queue( array(
'filter' => current_filter(),
'args' => func_get_args(),
) );
} else {
call_user_func_array( array( __CLASS__, 'send_transactional_email' ), func_get_args() );
}
} | [
"private function prevent_transactional_emails() {\n $statuses = array( 'processing', 'pending', 'on-hold' );\n\n foreach( $statuses as $status )\n add_action( 'woocommerce_order_status_' . $status, array( $this, 'unhook_transactional_emails_confirmed' ), 5, 1 );\n\n // Prevent transactional emails for unconfirmed orders\n $statuses = array( 'confirmed' );\n\n foreach( $statuses as $status )\n add_action( 'woocommerce_order_status_' . $status, array( $this, 'unhook_transactional_emails_unconfirmed' ), 10, 1 );\n }",
"function testNonQueuedEmail() {\n // Send an email and ensure it was sent immediately.\n \\Drupal::configFactory()->getEditable('queue_mail.settings')\n ->set('queue_mail_keys', '')\n ->save();\n $this->sendEmailAndTest('basic', FALSE);\n }",
"public function it_will_queue_to_recipient_but_not_queue_confirmation()\n {\n $this->updateConfigForQueueAndConfirmation(true, false);\n $parameters = $this->fields();\n $this->call('POST', 'form-mail/send', $parameters);\n\n $sender = \\DB::table('jobs')->where('payload', 'like', '%FormMailSendMessage%');\n $this->assertSame($sender->count(), 1);\n\n $confirmer = \\DB::table('jobs')->where('payload', 'like', '%FormMailSendConfirmationMessage%');\n $this->assertSame($confirmer->count(), 0);\n }",
"public static function init_transactional_emails() {\n $email_actions = apply_filters( 'pm_notification_action', array(\n 'pm_after_new_project',\n 'pm_after_update_project',\n 'pm_after_new_message',\n 'pm_after_update_message',\n 'pm_after_create_task',\n 'pm_after_update_task',\n 'pm_changed_task_status',\n 'pm_after_new_comment',\n 'pm_after_update_comment'\n ) );\n\n if ( apply_filters( 'pm_transactional_emails', true ) ) {\n self::$background_emailer = new Background_Emailer();\n\n foreach ( $email_actions as $action ) {\n add_action( $action, array( __CLASS__, 'queue_transactional_email' ), 10, 10 );\n }\n } else {\n foreach ( $email_actions as $action ) {\n add_action( $action, array( __CLASS__, 'send_transactional_email' ), 10, 10 );\n }\n }\n }",
"public function it_will_send_right_away_but_not_send_confirmation()\n {\n $this->updateConfigForQueueAndConfirmation(false, false);\n\n $parameters = $this->fields();\n $this->call('POST', 'form-mail/send', $parameters);\n\n\n $sender = \\DB::table('jobs')->where('payload', 'like', '%FormMailSendMessage%');\n $this->assertSame($sender->count(), 0);\n\n $confirmer = \\DB::table('jobs')->where('payload', 'like', '%FormMailSendConfirmationMessage%');\n $this->assertSame($confirmer->count(), 0);\n\n $sent = \\DB::table('form_mail')->where(\n [\n ['sender', '=', $parameters['email']],\n ['message_sent_to_recipient', '=', 1],\n ['confirmation_sent_to_sender', '=', '']\n ]\n );\n $this->assertSame($sent->count(), 1);\n }",
"abstract public function sendSuspendEmail();",
"public function spoolEmail()\n {\n if ( ! isset($this->message['mailer'])) {\n $this->message['mailer'] = $this->mailer;\n }\n $this->message['mailtype'] = $this->getMailType();\n $this->message['subject'] = $this->subject;\n $this->message['from_email'] = $this->fromEmail;\n $this->message['from_name'] = $this->fromName;\n\n foreach ($this->recipients as $value) {\n $this->message['to'][] = $value;\n }\n if (count($this->headers) > 0) {\n foreach ($this->headers as $key => $value) {\n $this->message['headers'][$key] = $value;\n }\n }\n $this->message['send_at'] = $this->setDate();\n\n $this->buildAttachments();\n\n /**\n * PUSH DATA TO QUEUE\n */\n $push = $this->responseBody['array']['push'] = $this->push($this->message);\n $this->responseBody['info']['body'] = $this->message;\n\n if ( ! $push) {\n $this->logger->error(\n 'Queue mailer push failed', \n array(\n 'url' => $this->config['queue']['route'],\n 'body' => $this->message,\n 'info' => 'Queue push failed'\n )\n );\n return false;\n }\n if (empty($this->debugMsg)) {\n return true;\n }\n return false;\n }",
"public function send_queue()\n {\n $this->set_status('pending');\n $emails = $this->get();\n $this->CI->db->where('status', 'pending');\n $this->CI->db->set('status', 'sending');\n $this->CI->db->set('date', date(\"Y-m-d H:i:s\"));\n $this->CI->db->update($this->table_email_queue);\n foreach ($emails as $email)\n {\n $recipients = explode(\", \", $email->to);\n $cc = !empty($email->cc) ? explode(\", \", $email->cc) : array();\n $bcc = !empty($email->bcc) ? explode(\", \", $email->bcc) : array();\n $this->_headers = unserialize($email->headers);\n $this->to($recipients);\n $this->cc($cc);\n $this->bcc($bcc);\n $this->message($email->message);\n if ($this->send(TRUE)) {\n $status = 'sent';\n } else {\n $status = 'pending';\n }\n $this->CI->db->where('id', $email->id);\n $this->CI->db->set('status', $status);\n $this->CI->db->set('date', date(\"Y-m-d H:i:s\"));\n $this->CI->db->update($this->table_email_queue);\n }\n }",
"public function send_queue()\n {\n $this->clean_up_old_queue();\n\n $this->set_status('pending');\n $emails = $this->get_queue_emails();\n\n $this->CI->db->where('status', 'pending');\n $this->CI->db->set('status', 'sending');\n $this->CI->db->set('date', date(\"Y-m-d H:i:s\"));\n\n $this->CI->db->update($this->email_queue_table);\n\n foreach ($emails as $email) {\n $attachments = array();\n\n if ($email->attachments) {\n $attachments = unserialize(base64_decode($email->attachments));\n foreach ($attachments as $attachment) {\n $this->_attachments[] = $attachment;\n }\n }\n\n $recipients = explode(\", \", $email->email);\n $cc = !empty($email->cc) ? explode(\", \", $email->cc) : array();\n $bcc = !empty($email->bcc) ? explode(\", \", $email->bcc) : array();\n\n $this->_headers = unserialize($email->headers);\n\n if (array_key_exists('Reply-To', $this->_headers) && !empty($this->_headers['Reply-To'])) {\n $this->_replyto_flag = true;\n }\n\n $this->set_newline(\"\\r\\n\");\n $this->set_crlf(\"\\r\\n\");\n\n $this->to($recipients);\n $this->cc($cc);\n $this->bcc($bcc);\n\n $this->message($email->message);\n $this->set_alt_message($email->alt_message);\n\n $status = ($this->send(true) ? 'sent' : 'failed');\n\n $this->CI->db->where('id', $email->id);\n $this->CI->db->set('status', $status);\n $this->CI->db->set('date', date(\"Y-m-d H:i:s\"));\n $this->CI->db->update($this->email_queue_table);\n }\n }",
"private function setTransportToSendmail()\n {\n $this->isSendmail();\n }",
"public function sendNewOrderEmail()\n {\n Mage::register('sending_order_email', 1);\n return parent::sendNewOrderEmail();\n Mage::unregister('sending_order_email');\n }",
"public function testSendEmailWithQueue()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function regularSentEmails()\r\n {\r\n $command = 'swiftmailer:spool:send';\r\n $this->addRegularJob($command);\r\n\r\n }",
"function tiniymassmailer_start_sending(){\n\t$msg = '';\n\t// sending mail\t\n\tglobal $wpdb;\n\t$tiniymassm_sends =$wpdb->prefix.'tiniymassm_sends';\n\n\t$last_user_id = 0;\n\tif(isset($_POST['tinymassmailer_start_from'])){\n\t\t$last_user_id = (int)$_POST['tinymassmailer_start_from'];\n\t}\n\n\t$r = $wpdb->insert(\n\t\t$tiniymassm_sends,\n\t\tarray(\n\t\t\t'last_user_id' \t=> $last_user_id,\n\t\t\t'start_date'\t=>\tcurrent_time( 'mysql', '1' ),\n\t\t\t'text' \t\t\t=> \t$_POST['text'] \t\t, \n\t\t\t'subject' \t\t=> \t$_POST['subject'] \t\t, \n\t\t\t'state' \t\t=> 'new' \t\t, \n\n\t\t\t),\n\t\tarray(\n\t\t\t'%d',\n\t\t\t'%s',\n\t\t\t'%s',\n\t\t\t'%s',\n\t\t\t'%s',\n\t\t\t)\n\t\t);\n\n\t //add trackings to text\n\t $tracked_text = tinymassmailer_make_tracking($_POST['text'] , $wpdb->insert_id);\n\t$wpdb->update($tiniymassm_sends,\n\t\tarray('text' => $tracked_text),\n\t\tarray('id' => $wpdb->insert_id),\n\t\tarray('%s'),\n\t\tarray('%d')\n\t\t);\n\n\tif($r){\n\t\t$msg = __('Send goes to queue' , 'tinymassmailer');\n\t}else{\n\t\t$msg = __('Problem to Sending to queue' , 'tinymassmailer');\n\t}\n\techo json_encode(array('msg' => $msg));\n\tdie();\n}",
"private function sendInvoiceEmail()\n {\n // We can't send an invoice if we don't know the current transaction\n if (!isset($this->_postArray['brq_transactions'])) {\n return;\n }\n\n /** @var Mage_Sales_Model_Resource_Order_Invoice_Collection $invoiceCollection */\n $invoiceCollection = $this->_order->getInvoiceCollection()\n ->addFieldToFilter('transaction_id', array('eq' => $this->_postArray['brq_transactions']))\n ->setOrder('entity_id', Mage_Sales_Model_Resource_Order_Invoice_Collection::SORT_ORDER_DESC);\n\n /** @var Mage_Sales_Model_Order_Invoice $invoice */\n $invoice = $invoiceCollection->getFirstItem();\n\n if ($invoice->getId() && !$invoice->getEmailSent()) {\n $comment = $this->getNewestInvoiceComment($invoice);\n\n $invoice->sendEmail(true, $comment)\n ->setEmailSent(true)\n ->save();\n }\n }",
"public function flushMail() {\r\n\t\t$transport = $this->container->get('mailer')->getTransport();\r\n\t\tif (!$transport instanceof \\Swift_Transport_SpoolTransport) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$spool = $transport->getSpool();\r\n\t\tif (!$spool instanceof \\Swift_MemorySpool) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$spool->flushQueue($this->container->get('swiftmailer.transport.real'));\r\n\t}",
"public function queue_emails($queue)\n {\n if ($queue !== true && $queue !== false) {\n return;\n }\n\n $this->queue_emails = $queue;\n }",
"public function maybe_trigger() {\n\t\tif ( $this->is_enabled() && $this->get_recipient() ) {\n\t\t\t$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ) ;\n\t\t}\n\t}",
"public function testSendOrderEmailFromNonDefaultStore()\n {\n $order = Bootstrap::getObjectManager()->create(Order::class);\n $order->loadByIncrementId('100000004');\n $order->setCustomerEmail('customer@example.com');\n $result = $this->orderSender->send($order);\n $this->assertFalse($result);\n $this->assertTrue($order->getSendEmail());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If new redirect targets have been added for given statusmessage, create referring queue entries | protected function _createMissingQueueEntries($sStatusmessageId) {
try {
$aParams = $this->_fetchPostParams($sStatusmessageId);
$aRequest = $aParams['array'];
$sPayoneStatus = $aRequest['txaction'];
$this->_addQueueEntries($sStatusmessageId, $sPayoneStatus);
} catch (Exception $e) {
throw $e;
}
} | [
"private function _addToQueue($url, $referrer)\n {\n $url = (string) $url;\n \n if (! in_array($url, $this->_targets)) {\n $request = new Spizer_Request($url);\n $request->setReferrer($referrer);\n $this->_engine->getQueue()->append($request);\n \n $this->_targets[] = $url;\n }\n }",
"protected function _handleForwarding($sStatusmessageId) {\n $this->_logForwardMessage('Handle forwarding for statusmessage id: '.$sStatusmessageId);\n try {\n $this->_addQueueEntries($sStatusmessageId);\n } catch (Exception $e) {\n throw $e;\n }\n\n $oConfig = $this->getConfig();\n $sTransactionForwardMethod =\n $oConfig->getConfigParam('sTransactionRedirectMethod');\n\n if ($sTransactionForwardMethod != 'cronjob') {\n $this->_directRedirect($sStatusmessageId);\n }\n }",
"public function addPathToQueue($path, $status = 1, $error = NULL)\n\t{\n\t\tglobal $wpdb;\n\t\t$table = $wpdb->prefix . 'awspurge_links';\n\t\t$data = array(\n\t\t\t'url' => $path,\n\t\t\t'status' => $status,\n\t\t\t'timestamp' => current_time('mysql', 1),\n\t\t);\n\t\tif ($error) {\n\t\t\t$data['errordata'] = serialize($error);\n\t\t}\n\t\t$wpdb->replace($table, $data);\n\t}",
"function sduconnect_queue_referenced_items($references) {\n $queue = DrupalQueue::get('sduconnect');\n foreach ($references as $item) {\n $job = new stdClass();\n $job->cid = $item->cid;\n $job->id = $item->external_id;\n $job->type = 'changed';\n $job->queue_references = FALSE;\n $queue->createItem($job);\n }\n}",
"private function saveJobHistory($status)\n {\n switch ($status) {\n case 'pending':\n $this->history->url = $this->url;\n $this->history->filename = substr($this->url, strrpos($this->url, '/') + 1);\n break;\n case 'complete':\n $this->history->link = Storage::url($this->filename);\n break;\n }\n $this->history->status = $status;\n $this->history->save();\n }",
"public function batchChangeIfLinkStories($status)\n {\n $storyIDList = $this->post->storyIDList ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent'));\n $storyIDList = array_unique($storyIDList);\n $allChanges = $this->story->batchChangeIfLinkStories($storyIDList, $status);\n if(dao::isError()) die(js::error(dao::getError()));\n\n $action = 'Edited';\n foreach($allChanges as $storyID => $changes)\n {\n $actionID = $this->action->create('story', $storyID, $action);\n $this->action->logHistory($actionID, $changes);\n //$this->story->sendmail($storyID, $actionID);\n }\n if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther');\n die(js::locate($this->session->storyList, 'parent'));\n }",
"function addTargetsToQueue($marketing, $message_id, $prospect_list_id, $dynamic) {\r\n global $db, $current_user, $timedate;\r\n $current_date = \"'\".gmdate(\"Y-m-d H:i:s\").\"'\";\r\n\r\n if ($this->test) {\r\n $send_date_time = \"'\".gmdate(\"Y-m-d H:i:s\", mktime(0, 0, 0, 8, 15, 1996)).\"'\";\r\n\t\t} else {\r\n\t\t\tif (empty($marketing['date_start']))\r\n\t\t\t\t$send_date_time = $current_date;\r\n\t\t\telse\r\n\t $send_date_time = \"'\" . $marketing['date_start'] . \"'\";\r\n }\r\n\r\n\t\t$queries = array();\r\n\r\n if ($dynamic) {\r\n $where_clauses = DynamicProspects::getWhereClauses($prospect_list_id);\r\n\r\n if (sizeof($where_clauses) > 0) {\r\n $counter = 0;\r\n foreach ($where_clauses as $module => $params) {\r\n\t\t\t\t\t$select_query = '';\r\n $table_name = $params['table_name'];\r\n $select_query .= \" SELECT $current_date, $current_date, '{$current_user->id}', '{$current_user->id}', '{$this->campaign_id}', '{$message_id}', '{$prospect_list_id}', {$table_name}.id, '{$module}', {$send_date_time} \";\r\n $select_query .= \"FROM {$table_name} \";\r\n if(! empty($params['joins']))\r\n \t$select_query .= $params['joins'] . ' ';\r\n\t\t\t\t\t$select_query .= \"WHERE \" . $params['clauses'];\r\n\t\t\t\t\t$queries[] = $select_query;\r\n\t\t\t\t\t$counter++;\r\n }\r\n }\r\n\r\n\t\t}\r\n\r\n\t\t$select_query = \" SELECT $current_date, $current_date, '{$current_user->id}', '{$current_user->id}', plc.campaign_id, '{$message_id}', plp.prospect_list_id, plp.related_id, plp.related_type, {$send_date_time} \";\r\n\t\t$select_query .= \"FROM prospect_lists_prospects plp \";\r\n\t\t$select_query .= \"INNER JOIN prospect_list_campaigns plc ON plc.prospect_list_id = plp.prospect_list_id \";\r\n\t\t$select_query .= \"WHERE plp.prospect_list_id = '{$prospect_list_id}' \";\r\n\t\t$select_query .= \"AND plp.deleted = 0 \";\r\n\t\t$select_query .= \"AND plc.deleted = 0 \";\r\n\t\t$select_query .= \"AND plc.campaign_id = '{$this->campaign_id}'\";\r\n\r\n\t\t$queries[] = $select_query;\r\n\r\n\t\t$select_query = '(' . join(') UNION ( ', $queries) . ')'; \r\n\r\n\t\t$insert_query = \"INSERT INTO emailman (date_entered, date_modified, user_id, modified_user_id, campaign_id, marketing_id, list_id, related_id, related_type, send_date_time\";\r\n\t\t$insert_query .= ')';\r\n\t\t$insert_query .= $select_query;\r\n\t\t$db->query($insert_query);\r\n }",
"public function queue($message, &$errors = []);",
"function set_process_status1($processes = array(), $status = 0){\n $JobHistory = new JobHistory();\n if(!empty($processes)){\n $temp = array();\n foreach($processes as $vals){\n $temp[] = $vals['job_history_id'];\n }\n if(!empty($temp)){\n $procs_in_queue = implode(',', $temp);\n // To Do :: Do query to set all in queue\n $qry = 'update job_history set `status` = '. $status. ' where id IN ('. $procs_in_queue . ')';\n $JobHistory->execute($qry);\n }\n }\n }",
"public static function sitemap_create_status( $status ) {\n\t\tif ( (bool) get_option( 'msm_stop_processing' ) === true && (bool) get_option( 'msm_sitemap_create_in_progress' ) === true ) {\n\t\t\treturn __( 'Halting', 'metro-sitemaps' );\n\t\t}\n\t\t\t\n\t\treturn $status;\n\t}",
"abstract public function enqueueStatus($status);",
"function threadredirect_newthread_do_newthread_end()\n{\n\tglobal $db, $mybb, $tid, $new_thread;\n\n\tif (has_permission($mybb, $mybb->user)) {\n\t\t$redirect_url = array(\n\t\t\t\"redirect_url\" => $db->escape_string($mybb->get_input('threadredirect'))\n\t\t);\n\t\t$db->update_query(\"threads\", $redirect_url, \"tid='{$tid}'\");\n\t}\n}",
"public function addToHeadQueue($url)\n {\n if (!array_key_exists($url, $this->resources)\n && !in_array($url, $this->fetchQueue['head'][$this->currentLevel + 1], true)\n ) {\n $this->fetchQueue['head'][$this->currentLevel + 1][] = $url;\n }\n }",
"public function fcpoTriggerForwardRedirects()\n {\n $sStatusmessageId = $this->_oFcpoHelper->fcpoGetRequestParameter(\"oxid\");\n if (!$sStatusmessageId || $sStatusmessageId == -1) {\n return;\n }\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $sPortalKey = $oConfig->getConfigParam('sFCPOPortalKey');\n $sKey = md5($sPortalKey);\n\n $oConfig = $this->getConfig();\n $sShopUrl = $oConfig->getShopUrl();\n $sSslShopUrl = $oConfig->getSslShopUrl();\n\n $sParams = '';\n $sParams .= $this->_addParam('key', $sKey);\n $sParams .= $this->_addParam('statusmessageid', $sStatusmessageId);\n $sParams = substr($sParams,1);\n $sBaseUrl = (empty($sSslShopUrl)) ? $sShopUrl : $sSslShopUrl;\n\n $sForwarderUrl = $sBaseUrl . 'modules/fc/fcpayone/statusforward.php';\n\n $oCurl = curl_init($sForwarderUrl);\n curl_setopt($oCurl, CURLOPT_POST, 1);\n curl_setopt($oCurl, CURLOPT_POSTFIELDS, $sParams);\n\n curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false);\n\n curl_exec($oCurl);\n curl_close($oCurl);\n $this->render();\n }",
"private function processTicketLinks($srcid, $new_links) {\n $data = new Data();\n\n if(!$new_links) {\n $new_links = array();\n } else {\n $new_links = explode(\",\",$new_links);\n }\n\n //handle removal\n $old_links = $data->getMetadata($srcid, \"ticket_links\");\n if(!$old_links) {\n $old_links = array();\n } else {\n $old_links = explode(\",\",$old_links);\n }\n /*\n error_log(\"old_links\");\n error_log(print_r($old_links, true));\n error_log(\"new_links\");\n error_log(print_r($new_links, true));\n */\n\n foreach($old_links as $destid) {\n if(!$destid) continue; //kiss..\n if(!in_array($destid, $new_links)) {\n //error_log(\"need to remove linking on $destid\");\n $dest_links = $data->getMetadata($destid, \"ticket_links\");\n $dest_links = explode(\",\",$dest_links);\n $pos = array_search($srcid, $dest_links);\n //error_log(\"before updated dest links\");\n //error_log(print_r($dest_links, true));\n unset($dest_links[$pos]);\n //error_log(\"updated dest links\");\n //error_log(print_r($dest_links, true));\n $data->setMetadata($destid, \"ticket_links\", implode(\",\",$dest_links));\n \n }\n }\n\n //handle insert\n foreach($new_links as $destid) {\n $dest_links = $data->getMetadata($destid, \"ticket_links\");\n if(!$dest_links) {\n $dest_links = array();\n } else {\n $dest_links = explode(\",\",$dest_links);\n }\n //error_log(\"destination \".$destid. \":\".$dest_links);\n if(!in_array($srcid, $dest_links)) {\n $dest_links[] = $srcid;\n }\n $data->setMetadata($destid, \"ticket_links\", implode(\",\",$dest_links));\n }\n }",
"function freterapido_add_status( $wc_statuses_arr ) {\n\t\t$new_statuses_arr = array();\n\n\t\t// add new order status after processing\n\t\tforeach ( $wc_statuses_arr as $id => $label ) {\n\t\t\t$new_statuses_arr[ $id ] = $label;\n\n\t\t\tif ( 'wc-on-hold' === $id ) { // after \"Completed\" status\n\t\t\t\t$new_statuses_arr['wc-awaiting-shipment'] = __( 'Awaiting shipment', 'freterapido' );\n\t\t\t}\n\t\t}\n\n\t\treturn $new_statuses_arr;\n\n\t}",
"private function concat_existing_queue_items($queue_status, $file_data, $stage, $migration_state_id) {\n //attempt to load queue status\n $stored_queue = $this->transfer_util->get_queue_status($stage, $migration_state_id);\n if (false !== $stored_queue) {\n $queue_status = $stored_queue;\n $queue_status['total'] += $file_data['meta']['count'];\n $queue_status['size'] += $file_data['meta']['size'];\n $queue_status['manifest'] = array_merge($file_data['meta']['manifest'], $queue_status['manifest']);\n }\n\n return $queue_status;\n }",
"function add_awaiting_shipment_to_order_statuses( $order_statuses ) {\n \n $new_order_statuses = array();\n \n // add new order status after processing\n foreach ( $order_statuses as $key => $status ) {\n \n $new_order_statuses[ $key ] = $status;\n \n if ( 'wc-processing' === $key ) {\n $new_order_statuses['wc-awaiting-shipment'] = 'Awaiting shipment';\n }\n }\n \n return $new_order_statuses;\n}",
"public function addListingStatus(){\n\t\tglobal $WilokeListGoFunctionalityApp;\n\t\tforeach ($WilokeListGoFunctionalityApp['post_statuses'] as $postStatus => $aConfig){\n\t\t\tregister_post_status($postStatus, $aConfig);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write data to daily csv file | function logData ($Datalog) {
global $today, $now, $config;
$csvFile = $config['outputPath'].'/'.$today.'.csv';
if ( !is_file($csvFile) ) {
$header = '# Date Time, TodaykWh, inVolt, inAmp, inWatt, outVolt, outAmp, outWatt, Temp';
try {
file_put_contents($csvFile, $header.PHP_EOL);
} catch (Exception $e) {
http_response_code(500);
die('Cannot create file '.$csvFile);
}
}
$csvFormat = '%s %s, %01.1f, %01.1f, %01.1f, %01.1f, %01.1f, %01.1f, %s, %01.1f';
$csvString = sprintf($csvFormat, $today, $now, $Datalog['todaykWh'],
$Datalog['Vpv'], $Datalog['Ipv'], $Datalog['Ppv'], $Datalog['Vac'],
$Datalog['Iac'], $Datalog['Pac'], $Datalog['Temp']).PHP_EOL;
file_put_contents($csvFile, $csvString, FILE_APPEND);
logger('Debug','Values: '.$csvString);
} | [
"public function dailyEmailAttachedCSV()\n {\n\n\n }",
"function SaveToCSV($data){\n $targetFile = '../history/'.$data[\"site_name\"].'.csv';\n\n // open / create & open file\n if (file_exists($targetFile)) {\n // open file if already exisits\n $fh = fopen($targetFile, 'a');\n } else {\n // create file and open if not already in place\n $fh = fopen($targetFile, 'w');\n // create table header in CSV\n fputcsv($fh,array('System','Sys Ver','PHP Ver','Sat Ver', 'Date', 'Time'));\n\n }\n\n // prepare data for csv\n // - fallbacks\n $sys_ver = \"n/a\";\n $php_ver = \"n/a\";\n $sat_ver = \"n/a\";\n $sys = \"n/a\";\n\n // - overwrite fallbacks if there is data\n if(isset($data['sys_ver']) AND $data['sys_ver']!=''){\n $sys_ver = $data['sys_ver'];\n };\n if(isset($data['php_ver']) AND $data['php_ver']!=''){\n $php_ver = $data['php_ver'];\n };\n if(isset($data['sat_ver']) AND $data['sat_ver']!=''){\n $sat_ver = $data['sat_ver'];\n };\n if(isset($data['sys']) AND $data['sys']!=''){\n $sys = $data['sys'];\n };\n\n // write data to CSV;\n fputcsv($fh,array($sys ,$sys_ver, $php_ver, $sat_ver, date('d.m.Y'), date('H:i:s')));\n\n // close file handle\n fclose($fh);\n\n}",
"public function writeToCsv(): void {\n\t\t// create string for the csv.\n\t\t$csv_line = $this->id;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->name;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->model;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->type;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->price;\n\n\t\t// open file csv for write line\n\t\t$csv_file = fopen(INSTRUMENTS_CSV_FILE, \"w\");\n\n\t\t// write on csv\n\t\tfputcsv($csv_file, array($csv_line));\n\n\t\t// close file csv\n\t\tfclose($csv_file);\n\t}",
"public function exportCSV()\n {\n $date1 = date('d-m-Y', strtotime($this->input->get('date1')));\n $date2 = date('d-m-Y', strtotime($this->input->get('date2')));\n\n $data = $this->ModelAdmin->fetchLaporanByDate($date1, $date2);\n\n header('Content-Type: text/csv; charset=utf-8');\n header(\"Content-Disposition: attachment; filename=Laporan Kehadiran periode $date1 - $date2.csv\");\n\n $output = fopen('php://output', 'w');\n fputcsv($output, array('NRP', 'Nama', 'Tanggal', 'Jam Masuk', 'Jam Keluar'));\n\n foreach ($data as $i) {\n fputcsv($output, array($i->nrp, $i->nama, $i->tanggal, $i->jam_masuk, $i->jam_keluar));\n }\n fclose($output);\n }",
"public function writeStatsInCsv(): void\n {\n if ($this->isNotActivated()) {\n return;\n }\n\n $statFile = fopen($this->getFileName(), 'w');\n\n if (!$statFile) {\n return;\n }\n\n fputcsv($statFile, [\n 'Time (seconds)',\n 'Test Class',\n 'Test Method',\n '# Dirty Tables',\n 'Dirty Tables',\n ]);\n\n foreach ($this->statistics as $stat) {\n fputcsv($statFile, $stat);\n }\n\n fclose($statFile);\n }",
"public function writeDailyData($invtnum, Day $day) {\n\t\t$filename = Util::getDailyTXT($invtnum);\n\t\t$this->writeCsvData($filename, $this->getDailyDataCsvString($live));\n\t}",
"public function export_csv(){ \n\n\n\n\t // file name \n\n\t\t$filename = 'pontos_'.date('Y-m-d').'.csv'; \n\n\t\theader(\"Content-Description: File Transfer\"); \n\n\t\theader(\"Content-Disposition: attachment; filename=$filename\"); \n\n\t\theader(\"Content-Type: application/csv; \");\n\n\n\n\t // get data \n\n\t\t$ponto_data = $this->ponto_model->get_pontos_for_export();\n\n\n\n\t // file creation \n\n\t\t$file = fopen('php://output', 'w');\n\n\n\t\t$header = array(\"ID\", \"Ponto\", \"Nomefan\", \"Email\", \"Responsavel\", \"Telefone\", \"cidade\", \"Created Date\"); \n\t\t\n\n\n\n\t\tfputcsv($file, $header);\n\n\t\tforeach ($ponto_data as $key=>$line){ \n\n\t\t\tfputcsv($file,$line); \n\n\t\t}\n\n\t\tfclose($file); \n\n\t\texit; \n\n\t}",
"public function writeToCSV(&$csv,$delimiter = ';')\r\n {\r\n $keyword = array($this->getInfo());\r\n $sKeys = array( \"keyword\",\"notes\" );\r\n $csv .= exportDataToCSV($keyword,$sKeys,$sKeys);\r\n }",
"public function writeToFile($paydays)\n {\n $csvFileWriter = new CSVFileWriter();\n $csvFileWriter->writeToFile($paydays, 'paydays-' . time() . '.csv');\n }",
"function Data2CSV_day($symbol,$name){\n $is_array = $symbol;\n $day_split = explode('volume', $is_array);\n //print_r($day_split);\n print_r('<br>');print_r('<br>');print_r('<br>');print_r('<br>');\n $day_split2 = $day_split[2];\n $Data = preg_split('/\\s+/', $day_split2);\n $num = count($Data); \n //print_r($num); print_r(\"\\t\");\n //print_r($Data[$num-3]);print_r(\"\\t\");\n //creat empty csv to store real-time data\n $filename = $name.\".csv\";\n $stock_name = preg_split('/[+\\s_-]/', $name);;\n $file = fopen($filename,'w');\n\n $file2 = fopen($stock_name[0].\".csv\",'w');\n $Data_sub2 = preg_split('/[\\s,]+/',$Data[$num-3]);\n $Data_sub2[0] = UNIX_Cov($Data_sub2[0]);\n $Data_sub3[0] = $stock_name[0];\n $Data_sub3[1] = ' ';\n $Data_sub3[2]= $Data_sub2[0];\n $Data_sub3[3]= $Data_sub2[1];\n $Data_sub3[4]= $Data_sub2[2];\n $Data_sub3[5]= $Data_sub2[3];\n $Data_sub3[6]= $Data_sub2[4];\n $Data_sub3[7]= $Data_sub2[5];\n\n\n fputcsv($file2,$Data_sub3);\n fclose($file2);\n\n for($q = 1 ; $q < $num - 1 ; $q++){\n { \n $Data_sub = preg_split('/[\\s,]+/',$Data[$q]);\n $Data_sub[0] = UNIX_Cov($Data_sub[0]);\n //iris add Stock Symbol\n $Data_sub2[0] = $stock_name[0];\n $Data_sub2[1] = ' ';\n $Data_sub2[2]= $Data_sub[0];\n $Data_sub2[3]= $Data_sub[1];\n $Data_sub2[4]= $Data_sub[2];\n $Data_sub2[5]= $Data_sub[3];\n $Data_sub2[6]= $Data_sub[4];\n $Data_sub2[7]= $Data_sub[5];\n //print_r($Data_sub[$p]);print_r('<br>');\n }fputcsv($file,$Data_sub2);\n }\n fclose($file);\n }",
"function save_logs(){\n\n header('Content-Type: text/csv; charset=utf-8');\n header('Content-Disposition: attachment; filename=statistics.txt');\n\n /** create a file pointer connected to the output stream **/\n $output = fopen('php://output', 'w');\n\n /** get header names for a csv file from 'excel' table **/\n // $headers = $this->site_model->get_columns();\n // $headers = array('');\n /** output the column headings */\n //fwrite($output, $headers);\n\n /** get rows for a csv file from 'excel' table **/\n $content = $this->download_model->get_store_records();\n $num = 1;\n foreach($content as $key =>$value)\n {\n // $csv_line = (array)$value;\n $new_domains = $value->last_id - $value->first_id;\n $saved_lines = \"\\r\\n\".$num++.\". \".$new_domains.\" news domains added - \".$value->insert_time.\"\\r\\n\";\n fwrite($output, $saved_lines);\n }\n\n }",
"private function generateCSV()\n {\n $type = $this->type;\n $items = \\DB::table($this->project['id'] . '_usage')\n ->select('timestamp', $type)\n ->latest('timestamp')\n ->limit(2000)\n ->get()\n ->toArray();\n $this->last_point = $items[0]->timestamp;\n $items = array_reverse($items);\n $file = fopen('r/' . $this->csv_file, 'a+');\n fputcsv($file, array($type));\n $count = 0;\n $total = 0;\n foreach ($items as $item) {\n $count++;\n $total += $item->$type;\n if ($count == 10) {\n fputcsv($file, array(number_format($total / 10, 2) ));\n $total = 0;\n $count = 0;\n }\n }\n fclose($file);\n }",
"public function getCSVFile() {\n\t\t// get event logs from event_log table\n \t\t$EventLogs = DB::table('event_log')->join('client','client.client_id','=','event_log.client_id')->join('mandant','client.mandant_id','=','mandant.mandant_id')->select('log_nr', 'message_id','mandant.mandant_firmname','useragent','client.client_id','client_ip','action','insert_date')->where('mandant.user_id','1')->orderby('log_nr','ASC')->get();\n\n\t\t// use system temp folder\n \t\t$fp = fopen(sys_get_temp_dir().'/eventlog.csv','w');\n\t\t// create table header for csv file \n \t\tfputcsv($fp, array('Log Number', 'Message ID', 'Mandant Firma Name','User Agent','Client ID','Client IP','Action', 'Date'));\n \t\tforeach ($EventLogs as $EventLog) {\n\t\t\t// create csv file\n \t\t\tfputcsv($fp, get_object_vars($EventLog));\n \t\t}\n \t\tfclose($fp);\n\t\t// response a download resource for user to get this csv file\n \t\treturn Response::download(sys_get_temp_dir().'/eventlog.csv');\n \t}",
"private function writeCSV($array)\n {\n $handle = fopen($this->filename, 'w');\n\n foreach($array as $row) {\n fputcsv($handle, $row);\n }\n\n fclose($handle);\n\n }",
"protected function writeCsv($rows)\n {\n\n // File path for temporary file\n $path = Mage::getBaseDir() . '/var/export/';\n $file = date('Ymd_His') . '_product-export.csv';\n \n // Create var/import directory if not exist yet\n if (!is_dir($path)) mkdir($path);\n\n // Open the socket\n $handle = fopen($path.$file, 'w+');\n\n // Validate handle\n if ($handle === false) {\n Mage::log('Failed to create CSV file: '. $path.$file, Zend_Log::ALERT, 'sapexport.log');\n // Notify admin contact\n // Mage::helper('inecom_sap/data')->notify('Failed to create CSV file: '. $path.$file , 'SAP update unable to create CSV to export products');\n return false;\n }\n\n //$csvHeader = array('sku','name','price','specialprice','status''custom_stock_status',\n //'preorder_calender','weight','qty','is_in_stock','short_description',\n //'overview_specifications','_store');\n $csvHeader = array('sku','name','price','special_price','status','custom_stock_status',\n 'preorder_calender','weight','qty','is_in_stock','short_description',\n 'overview_specifications');\n fputcsv( $handle, $csvHeader,\"|\");\n\n // Write line by line\n foreach ($rows as $line=>$row) {\n\n if ($line > 0) {\n foreach ($row as $key => $value) {\n $row[$key] = $value.\"#@ @#\";\n }\n }\n fputcsv($handle, $row,\"|\");\n }\n\n // Close handle\n fclose($handle);\n $contents = file_get_contents($path.$file);\n $contents = str_replace(\"#@ @#\", \"\", $contents);\n $contents = str_replace('\"', '', $contents);\n file_put_contents($path.$file, $contents);\n Mage::log('CSV file created: '. $path.$file, Zend_Log::INFO, 'sapexport.log');\n return $path.$file;\n }",
"private function toCommaDelimiter() : void\n {\n //Open file pointer.\n $fp = fopen($this->path_destination, 'w');\n\n foreach ($this->rawData as $key => $item) {\n fputcsv($fp, $item);\n }\n\n //Finally, close the file pointer.\n fclose($fp);\n\n echo \"--> Saving $this->path_destination <br />\";\n }",
"public function createCsv($data){\n\n $out = fopen('../Download/lista.csv', 'w');\n\n foreach ($data as $key => $value) {\n if ( is_string($value)) {\n fputcsv($out, [$value]);\n }\n else {\n fputcsv($out, $value);\n }\n }\n\n\n $this->download($out);\n\n fclose($out);\n unlink('../Download/lista.csv');\n }",
"public function exportData()\n {\n $file = fopen('data.csv', 'w');\n\n fputcsv($file, array(\n 'id',\n 'name',\n 'surname',\n 'email',\n 'phone1',\n 'phone2',\n 'comment'));\n $data = $this->getClientList();\n\n foreach ($data as $row) {\n fputcsv($file, $row);\n }\n fclose($file);\n }",
"function report_export() {\n \tif($this->active_report->isNew()) {\n $this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n \n if(!$this->active_report->canView($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n download_contents(array_to_csv(TimeReports::executeReportForExport($this->logged_user, $this->active_report)), 'text/csv', \"time-report.csv\", true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of Telefon | public function getTelefon()
{
return $this->telefon;
} | [
"public function getTelefno()\n {\n return $this->telefno;\n }",
"public function getInstTelefono()\n {\n return $this->inst_telefono;\n }",
"public function getTelephone();",
"public function getTelevision()\n {\n return $this->television;\n }",
"public function getTelefone2()\n {\n return $this->getModel()->getValor(\"telefone2\");\n }",
"public function getTelefon2()\n {\n return $this->telefon2;\n }",
"public function getTelephone() {}",
"public function getTelefone() {\n return $this->sTelefone;\n }",
"public function getTelefono(){\n \treturn $this->telefono;\n\t}",
"public function getTel()\r\n {\r\n return $this->tel;\r\n }",
"public function getTelefone()\r\n {\r\n return $this->telefone;\r\n }",
"public function getTelefono()\r\n {\r\n return $this->telefono;\r\n }",
"public function getTel()\n {\n return $this->tel;\n }",
"public function telephone()\n {\n return $this->_telephone;\n }",
"public function getTelefone()\n\t{\n\t\treturn $this->telefone;\n\t}",
"public function getTelefono()\r\n {\r\n return $this->telefono;\r\n }",
"public function getTelefono()\n {\n return $this->telefono;\n }",
"public function getTelph()\n {\n return $this->telph;\n }",
"public function getTelefone()\n {\n return $this->telefone;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The api should create a valid stack of cards | public function testCreatesValidStack()
{
$vehicleFactory = new NamesHashFactory();
$vehicleFactory->registerVehicleType('flight', 'Boarding\\Vehicle\\Flight');
$vehicleFactory->registerVehicleType('train', 'Boarding\\Vehicle\\Train');
$vehicleFactory->registerVehicleType('airport bus', 'Boarding\\Vehicle\\AirportBus');
$cardToLegMapper = new BaseCardMapper();
$descriptor = new BaseDescriptor();
$api = new Api(new FromArray($vehicleFactory), new QuickSortTopological($cardToLegMapper), $descriptor);
$stack = $api->createStack($this->cardsArray);
$this->assertInstanceOf('Boarding\Card\Stack', $stack, 'Api did not create a stack.');
$this->assertEquals(4, $stack->getLength());
} | [
"private function generateCards(){\n $name = ['Prof. Day', 'Prof. Enbody', 'Prof. McCullen', 'Prof. Onsay', 'Prof. Owen', 'Prof. Plum',\n 'Beaumont Tower', 'Breslin Center', 'Engineering Building', 'International Center',\n 'Library', 'Art Museum', 'Spartan Stadium', 'University Union', 'Wharton Center',\n 'Final Exam', 'Midterm Exam', 'Programming Assignment', 'Project', 'Quiz', 'Writing Assignment'];\n\n\n $image = ['day', 'enbody', 'mccullen', 'onsay', 'owen', 'plum',\n 'beaumont', 'breslin', 'engineering', 'international',\n 'library', 'museum', 'stadium', 'union', 'wharton',\n 'final', 'midterm', 'programming', 'project', 'quiz', 'written'];\n\n for ($i = 0; $i < 21; $i++) {\n if ($i < 6) {\n $type = 'Person';\n } else if ($i < 15) {\n $type = 'Place';\n } else {\n $type = 'Weapon';\n }\n $newCard = new Card($type, $name[$i],\"images/\".$image[$i].\".jpg\");\n $this->addCard($newCard);\n }\n }",
"public function createCard(CreateCardRequest $createCardRequest);",
"function createPack()\n{\n $cards = [];\n $faces = array('Ace', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King');\n $suits = ['heart', 'spade', 'diamond', 'club'];\n foreach ($suits as $suit) {\n foreach ($faces as $face) {\n $cards[] = array('suit' => $suit, 'face' => $face);\n }\n }\n return $cards;\n}",
"protected function create_cards()\n {\n $suites = array('C', 'S', 'D', 'H');\n $ranks = ['A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K'];\n\n foreach ($suites as $suit) {\n foreach ($ranks as $rank) {\n\n $this->cards[] = new Card($rank, $suit);\n }\n }\n }",
"public function create($card_token);",
"public function testCreateAchCardReserveUsingPost()\n {\n }",
"public function testStoreCard(): void\n {\n $response = $this->pinClient->storeCard($this->validVisaCard);\n $this->assertSame(201, $response->getStatusCode());\n $this->assertStringContainsString('token', $response->getContent());\n }",
"public function addCard()\n {\n }",
"public function createDeck(array $cards)\n {\n foreach ($cards as $card)\n {\n if ($card instanceof Card)\n {\n array_push($this->deck, $card);\n }\n }\n }",
"public function testCardsMissingRequiredParams(): void\n {\n $response = $this->client->request('POST', static::ITINERARY_CREATE, [\n 'json' => [\n 'cards' => [\n ['from' => 'Barcelona',\n 'subType' => 'Airport',\n ],\n ],\n ],\n ]);\n\n $output = $response->getBody()->getContents();\n\n $this->assertEquals('{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"type, from & to attributes of boarding card are needed!\",\"type\":\"Client Error\"}',\n $output);\n }",
"public function createCard($cus_attr = null, $card = array()) {\r\n\t\ttry {\r\n\t\t\tif (is_array($card)) {\r\n\r\n\t\t\t\t$fields = array(\r\n\t\t\t\t\t'number',\r\n\t\t\t\t\t'exp_month',\r\n\t\t\t\t\t'exp_year',\r\n\t\t\t\t\t'cvc',\r\n\t\t\t\t\t'name',\r\n\t\t\t\t\t'address_line1',\r\n\t\t\t\t\t'address_lin2',\r\n\t\t\t\t\t'address_city',\r\n\t\t\t\t\t'address_zip',\r\n\t\t\t\t\t'address_state',\r\n\t\t\t\t\t'address_country',\r\n\t\t\t\t);\r\n\t\t\t\tforeach ($card as $key => $value) {\r\n\t\t\t\t\tif (!in_array($key, $fields)) {\r\n\t\t\t\t\t\t$card[$key] = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$card = array_filter($card);\r\n\t\t\t} else {\r\n\t\t\t\t$card = array(\r\n\t\t\t\t\t'card' => $card\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t$customer = new StripeCustomer($cus_attr);\r\n\t\t\treturn $customer->getCustomerAccount()->cards->create($card);\r\n\t\t} catch (Exception $ex) {\r\n\t\t\t$this->log($ex);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function addCard(){ \n $listId = Input::get('l');\n $title = Input::get('t');\n\n $list = CardList::find($listId);\n $card = new Card();\n $card->title = $title;\n $card->description = '';\n $maxPos = $list->cards()->max('position');\n $card->position = $maxPos + 1;\n\n $response['success'] = $list->cards()->save($card);\n $response['id'] = $card->id; \n return Response::json($response);\n }",
"public static function createCardQuestion() {\n\n $cardQuestion = new CardQuestion();\n $cardQuestion->creator_id = 2;\n $cardQuestion->response_type_id = Request::get(\"responseType\");\n $cardQuestion->type_id = Request::get(\"category\");\n //$cardQuestion->privacy_id = Level::$level_categories[\"privacy\"][\"public\"];\n $cardQuestion->parent_card_id = Request::get(\"parentCardId\");\n $conditionalIds = Request::get(\"conditionalIds\");\n\n DB::beginTransaction();\n try {\n $card = Card::createCard();\n $cardQuestion->card_id = $card->id;\n if ($conditionalIds) {\n self::createCardChildren($cardQuestion, $conditionalIds);\n } else {\n $cardQuestion->save();\n }\n } catch (\\Exception $e) {\n DB::rollback();\n throw $e;\n }\n DB::commit();\n return $cardQuestion;\n }",
"public function createDeck() {\n foreach ($this->faces as $face) {\n foreach ($this->suits as $suit) {\n $this->deck[] = new Card($face, $suit);\n } \n }\n }",
"public function testPostApiUserAddCard()\n {\n $client = static::createClient();\n $client->request('POST', '/api/user/cards/add', [], [],\n [\n 'HTTP_ACCEPT' => 'application/json',\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-AUTH-TOKEN' => '93324'\n ],\n '{\n \"name\": \"UserCard\",\n \"creditCardType\": \"MasterCard\",\n \"creditCardNumber\": 21474566,\n \"currencyCode\": \"EUR\",\n \"value\": 60000\n }'\n );\n\n $response = $client->getResponse();\n $content = $response->getContent();\n\n $card = \\json_decode($content, true);\n\n $this->assertArrayHasKey('id', $card);\n $this->assertArrayHasKey('name', $card);\n $this->assertArrayHasKey('creditCardType', $card);\n $this->assertArrayHasKey('creditCardNumber', $card);\n $this->assertArrayHasKey('currencyCode', $card);\n $this->assertArrayHasKey('value', $card);\n $this->assertEquals(201, $response->getStatusCode());\n $this->assertJson($content);\n }",
"public function testCreateCustomerCard(): void\n {\n $customerToken = $this->createCardCustomerToken('test_list_customer_charge@example.com', 'visa');\n $this->pinClient->createCustomerCard($customerToken, $this->validMasterCard);\n\n $response = $this->pinClient->listCustomerCards($customerToken)->toArray();\n $this->assertCount(2, $response['response']);\n\n $this->pinClient->deleteCustomer($customerToken);\n }",
"public function omise_create_card() {\n\t\t\t$token = isset ( $_POST ['omise_token'] ) ? wc_clean ( $_POST ['omise_token'] ) : '';\n\t\t\tif (empty ( $token )) {\n\t\t\t\tOmise_Util::render_json_error(\"omise_token is required\");\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t\n\t\t\tif (! wp_verify_nonce($_POST['omise_nonce'], 'omise_add_card')) {\n\t\t\t\tOmise_Util::render_json_error(\"Nonce verification failure\");\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t\n\t\t\t$card = Omise::create_card ( $this->private_key, $this->omise_customer_id, $token );\n\t\t\techo json_encode($card);\n\t\t\tdie();\n\t\t}",
"public function omise_create_card()\n\t\t{\n\t\t\t$token = isset ( $_POST['omise_token'] ) ? wc_clean ( $_POST['omise_token'] ) : '';\n\n\t\t\tif ( empty( $token ) ) {\n\t\t\t\tOmise_Util::render_json_error( 'omise_token is required' );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\tif ( ! wp_verify_nonce($_POST['omise_nonce'], 'omise_add_card' ) ) {\n\t\t\t\tOmise_Util::render_json_error( 'Nonce verification failure' );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$card = $this->customerCard->create($this->omise_customer_id, $token);\n\t\t\t\techo json_encode( $card );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\techo json_encode( array(\n\t\t\t\t\t'object' => 'error',\n\t\t\t\t\t'message' => $e->getMessage()\n\t\t\t\t) );\n\t\t\t}\n\n\t\t\tdie();\n\t\t}",
"private function createCardObject($_data) {\n $card = new Card();\n $card->setId($_data['id']);\n $card->setName($_data['name']);\n if(!empty($_data['typ'])) {\n $card->setType($_data['typ']);\n }\n if(!empty($_data['kosten'])) {\n $card->setCost($_data['kosten']);\n }\n if(!empty($_data['hp'])) {\n $card->setHp($_data['hp']);\n }\n if(!empty($_data['kartentypen'])) {\n $card->setCardtag($_data['kartentypen']);\n }\n if(!empty($_data['effekte'])) {\n $card->setEffect($_data['effekte']);\n }\n if(!empty($_data['infotext'])) {\n $card->setInfotext($_data['infotext']);\n }\n if(!empty($_data['trivia'])) {\n $card->setTrivia($_data['trivia']);\n }\n if(!empty($_data['alternative_bilder'])) {\n $card->setAlternativeArtworks($_data['alternative_bilder']);\n }\n return $card;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes all entry export files from the server that haven't been claimed within 24 hours. | public static function delete_old_export_files() {
GFCommon::log_debug( __METHOD__ . '(): Starting.' );
$uploads_folder = RGFormsModel::get_upload_root();
if ( ! is_dir( $uploads_folder ) || is_link( $uploads_folder ) ) {
GFCommon::log_debug( __METHOD__ . '(): No upload root - bailing.' );
return;
}
$export_folder = $uploads_folder . 'export';
if ( ! is_dir( $export_folder ) || is_link( $export_folder ) ) {
GFCommon::log_debug( __METHOD__ . '(): No export root - bailing.' );
return;
}
GFCommon::log_debug( __METHOD__ . '(): Start deleting old export files' );
foreach ( GFCommon::glob( '*.csv', $export_folder . DIRECTORY_SEPARATOR ) as $filename ) {
$timestamp = filemtime( $filename );
if ( $timestamp < time() - DAY_IN_SECONDS ) {
// Delete files over a day old
GFCommon::log_debug( __METHOD__ . '(): Proceeding to delete ' . $filename );
$success = unlink( $filename );
GFCommon::log_debug( __METHOD__ . '(): Delete successful: ' . ( $success ? 'yes' : 'no' ) );
}
}
} | [
"public function deleteExpiredFiles()\n {\n $this->_garbageCollector->clean();\n }",
"public function deleteAllExpired() {\n\t}",
"public function cleanup_exports() {\n\n\t\twc_customer_order_csv_export()->get_export_handler_instance()->remove_expired_exports();\n\t}",
"function wp_schedule_delete_old_privacy_export_files()\n {\n }",
"public function delete_expired()\n {\n if ($files = $this->exists(true)) {\n // Disable all error reporting while deleting\n $ER = error_reporting(0);\n\n foreach ($files as $file) {\n if ($this->expired($file)) {\n // The cache file has already expired, delete it\n if (! unlink($file)) {\n Kohana::log('error', 'Cache: Unable to delete cache file: '.$file);\n }\n }\n }\n\n // Turn on error reporting again\n error_reporting($ER);\n }\n }",
"public function deleteAllExpired(): void;",
"public function cleanExportDirectory()\n {\n $dir = getcwd() . Mage::app()->getStore(0)->getConfig('celexport/export_settings/path');\n if (is_dir($dir)) {\n $files = scandir($dir);\n foreach ($files as $file) {\n if (filectime($dir . DS . $file) < strtotime('-' . Mage::app()->getStore(0)->getConfig('celexport/export_settings/export_lifetime', 1) . ' day')\n && !in_array($file, array('.', '..'))) {\n shell_exec('rm -rf ' . $dir . DS . $file);\n }\n }\n }\n }",
"protected function delete_expired_shared_links(): void\n {\n // Get all shares with expiration time\n $shares = Share::whereNotNull('expire_in')->get();\n\n $shares->each(function ($share) {\n\n // Get dates\n $created_at = Carbon::parse($share->created_at);\n\n // If time was over, then delete share record\n if ($created_at->diffInHours(Carbon::now()) >= $share->expire_in) {\n $share->delete();\n }\n });\n }",
"public function cleanupAction() {\n $dir = EXPORT_FOLDER;\n $files = scandir($dir);\n\n foreach($files as $file){\n\n if(strpos($file, \".csv\"))\n unlink($dir.$file);\n\n if(strpos($file, \".zip\"))\n unlink($dir.$file);\n }\n }",
"public function deleteExportDownload() {\n if ($this->exportFile) {\n $this->exportFile->delete();\n }\n }",
"public function cleanup ()\n\t{\n\t\ttry {\n\t\t\t$ts = time() - 60 * 60 * 24 * 14;\n\t\t\t$iterator = new DirectoryIterator(Mage::getBaseDir('var') . DS . 'productfeed');\n\t\t\tforeach ($iterator as $file) {\n\t\t\t\tif ($file->isFile() && $file->getMTime() < $ts) {\n\t\t\t\t\tunlink($file->getPathname());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tMage::helper('productfeed')->log($e);\n\t\t}\n\t}",
"private function deleteExpiredAPIs()\n {\n $apiGroups = DB::table( 'fb_api_group_partial_mode' )\n ->where( 'missingDaysToWhiteList', '=', 0 );\n $DB_apiGroups = DB::table( 'fb_api_group_partial_mode' )\n ->where( 'missingDaysToWhiteList', '=', 0 )->get();\n\n foreach( $DB_apiGroups as $group )\n DB::table( 'fb_api_partial_mode' )->where( 'groupApi', $group->id_api_group )->delete();\n\n $apiGroups->delete();\n }",
"function wp_privacy_delete_old_export_files() {}",
"public function deleteCaches(){\n $files = glob($this->cachPath.\"*.html\");\n $now = time();\n\n foreach ($files as $file) {\n if (is_file($file)) {\n if ($now - filemtime($file) >= $this->cachetime) { // 2 days\n unlink($file);\n }\n }\n }\n }",
"public function deleteExpired()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\\IPS\\Db::i()->delete( 'core_output_cache', array( 'cache_expire<?', time() ) );\n\t\t}\n\t\tcatch ( \\IPS\\Db\\Exception $e ) { }\n\t}",
"public function deleteFilesScheduledForDeletion() {\n foreach (self::$scheduledForDeletion as $file) {\n try {\n $this->deleteFile($file);\n unset(self::$scheduledForDeletion[$file]);\n }\n catch (\\Exception $e) {\n $this->logger->error('Failed to delete file scheduled for deletion.', [\n $file\n ]);\n }\n }\n }",
"function _delete_expired_files()\n {\n $directory = dir($this->_basedir.'data/common/captcha');\n \n while (false != ($filename = $directory->read()))\n {\n if ( ( $filename == \".\" ) || ( $filename == \"..\" ) || ( FALSE == strstr( $filename, '.jpg') ) )\n {\n continue;\n } \n $file = $this->_basedir.'data/common/captcha/'.$filename;\n\n if(TRUE == is_file($file))\n {\n if((time()-$this->captcha_picture_expire) > filemtime($file))\n {\n @unlink($file);\n } \n } \n }\n\n $directory->close(); \n }",
"protected function removeExpiredPathCacheEntries()\n {\n $lastCleanUpFileName = PATH_site . 'typo3temp/realurl_last_clean_up';\n $lastCleanUpTime = @filemtime($lastCleanUpFileName);\n if ($lastCleanUpTime === false || (time() - $lastCleanUpTime >= 6*60*60)) {\n touch($lastCleanUpFileName);\n GeneralUtility::fixPermissions($lastCleanUpFileName);\n /** @noinspection PhpUndefinedMethodInspection */\n $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_realurl_pathcache',\n 'expire>0 AND expire<' . $this->makeExpirationTime());\n }\n }",
"public static function clear_expired_groups() {\r\n\t\t$maybe_clear_page_cache = false;\r\n\r\n\t\t$groups = Minify_Group::get_minify_groups();\r\n\t\tforeach ( $groups as $group ) {\r\n\t\t\t$instance = Minify_Group::get_instance_by_post_id( $group->ID );\r\n\t\t\tif ( ( $instance instanceof Minify_Group ) && $instance->is_expired() && $instance->file_id ) {\r\n\t\t\t\t$instance->delete_file();\r\n\t\t\t\twp_delete_post( $instance->file_id, true );\r\n\t\t\t\t$maybe_clear_page_cache = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( $maybe_clear_page_cache ) {\r\n\t\t\tself::maybe_clear_page_cache();\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new oauth server record | public function Create($oauth_server, $consumer_key, $consumer_secret, $expire_threshold)
{
global $addslashes, $msg;
$oauth_server = $addslashes($oauth_server);
$consumer_key = $addslashes($consumer_key);
$consumer_secret = $addslashes($consumer_secret);
$expire_threshold = intval($expire_threshold);
$missing_fields = array();
/* email check */
$oauth_server = $addslashes(trim($oauth_server));
$expire_threshold = intval($expire_threshold);
/* login name check */
if ($oauth_server == '')
{
$missing_fields[] = _AT('oauth_server');
}
if ($missing_fields)
{
$missing_fields = implode(', ', $missing_fields);
$msg->addError(array('EMPTY_FIELDS', $missing_fields));
}
if (!$msg->containsErrors())
{
/* insert into the db */
$sql = "INSERT INTO ".TABLE_PREFIX."oauth_client_servers
(oauth_server,
consumer_key,
consumer_secret,
expire_threshold,
create_date
)
VALUES ('".$oauth_server."',
'".$consumer_key."',
'".$consumer_secret."',
".$expire_threshold.",
now()
)";
if (!$this->execute($sql))
{
$msg->addError('DB_NOT_UPDATED');
return false;
}
else
{
return mysql_insert_id();
}
}
else
{
return false;
}
} | [
"public function createApiServer()\n {\n if (null == ($clientCredentials = $this->loadClientCredentials())) {\n // prepare oob server\n $discovergyCredentials = $this->loadDiscovergyCredentials();\n $oob = new DiscovergyOutOfBand($discovergyCredentials);\n\n // get consumer credentials (requires client id)\n $clientId = $discovergyCredentials['clientid'];\n $clientCredentials = $oob->getClientCredentialsForClientId($clientId);\n $this->saveClientCredentials($clientCredentials);\n // print_r($clientCredentials);\n }\n\n $this->server = new Discovergy($clientCredentials);\n\n // recreate token when client credentials are recreated\n if (isset($oob) || null == ($this->token = $this->loadTokenCredentials())) {\n $this->createTokenCredentials();\n }\n }",
"public function create_new_api_app() {\n \n (new MidrubBaseAdminCollectionSettingsHelpers\\Oauth)->create_new_api_app();\n \n }",
"public function initOauth2Server()\n {\n if ($this->serverInitialized) {\n return;\n }\n\n $this->serverInitialized = true;\n $this->modelMap = array_merge($this->defaultModelMap, $this->modelMap);\n $this->storageMap = array_merge($this->defaultStorageMap, $this->storageMap);\n foreach ($this->modelMap as $name => $definition) {\n Yii::$container->set(models::class . '\\\\' . $name, $definition);\n }\n\n foreach ($this->storageMap as $name => $definition) {\n Yii::$container->set($name, $definition);\n }\n\n $storages = [];\n foreach(array_keys($this->storageMap) as $name) {\n $storages[$name] = Yii::$container->get($name);\n }\n\n $grantTypes = [];\n foreach($this->grantTypes as $name => $options) {\n if(!isset($storages[$name]) || empty($options['class'])) {\n throw new InvalidConfigException(\n 'Invalid grant types configuration.'\n );\n }\n\n $class = $options['class'];\n unset($options['class']);\n\n $reflection = new ReflectionClass($class);\n $config = array_merge([0 => $storages[$name]], [$options]);\n\n $instance = $reflection->newInstanceArgs($config);\n $grantTypes[$name] = $instance;\n }\n\n $this->set('server', Yii::$container->get(Server::class, [\n $this,\n $storages,\n [\n 'token_param_name' => $this->tokenParamName,\n 'access_lifetime' => $this->tokenAccessLifetime,\n ],\n $grantTypes\n ]));\n $this->set('request', Request::createFromGlobals());\n $this->set('response', new Response());\n }",
"public function create()\n {\n $this->sesClient->verifyDomainIdentity(\n [\n 'Domain' => $this->identity->getIdentity(),\n ]\n );\n }",
"public function createOAuthForPortalUser()\n {\n $clientSeed = BeanFactory::newBean('OAuthKeys');\n $clientBean = $clientSeed->fetchKey('support_portal', 'oauth2');\n if (!$clientBean) {\n $newKey = BeanFactory::newBean('OAuthKeys');\n $newKey->oauth_type = 'oauth2';\n $newKey->c_secret = '';\n $newKey->client_type = 'support_portal';\n $newKey->c_key = 'support_portal';\n $newKey->name = 'OAuth Support Portal Key';\n $newKey->description = 'This OAuth key is automatically created by the OAuth2.0 system to enable logins to the serf-service portal system in Sugar.';\n $newKey->save();\n }\n }",
"public function createApprover();",
"function syndication_server_save_api_keys($domain, $client_public, $client_secret, $server_public, $server_secret) {\n \n $fields = array(\n 'client_domain' => $domain,\n 'client_secret' => $client_secret,\n 'client_public' => $client_public,\n 'server_public' => $server_public,\n 'server_secret' => $server_secret,\n 'status' => 1,\n );\n \n return drupal_write_record('ss_client_keys', $fields);\n \n}",
"public function create() {\n // Load the URL helper.\n $this->load->helper('url');\n\n // Generate the log out link URL.\n $data['logout_link'] = site_url('authenticate/logout');\n\n // Generate the create form action URL.\n $data['form_action'] = site_url('servers/create/process');\n\n // Display the server create form.\n $this->load->view('server_create_form', $data);\n }",
"public function create()\n {\n if (!$this->client) {\n\n $config = [\n \"installed\" => [\n \"client_id\" => $this->clientId,\n \"project_id\" => $this->projectId,\n \"auth_uri\" => \"https=>//accounts.google.com/o/oauth2/auth\",\n \"token_uri\" => \"https=>//oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\" => \"https=>//www.googleapis.com/oauth2/v1/certs\",\n \"client_secret\" => $this->clientSecret,\n \"redirect_uris\" => [\n \"urn:ietf:wg:oauth:2.0:oob\",\n \"http://localhost\"\n ]\n ]\n ];\n\n\n $client = new Google_Client();\n $client->setApplicationName('Google Calendar API PHP Quickstart');\n $client->setScopes(Google_Service_Calendar::CALENDAR_READONLY);\n $client->setAuthConfig($config);\n $client->setAccessType('offline');\n $client->setPrompt('select_account consent');\n\n $this->client = $client;\n }\n\n\n return $this->client;\n }",
"private function registerOAuthServer()\n {\n $this->app->bind('League\\OAuth2\\Server\\Storage\\ClientInterface', 'Xtwoend\\Api\\OAuth2\\Repositories\\FluentClient');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\ScopeInterface', 'Xtwoend\\Api\\OAuth2\\Repositories\\FluentScope');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\SessionInterface', 'Xtwoend\\Api\\OAuth2\\Repositories\\FluentSession');\n $this->app->bind('Xtwoend\\Api\\OAuth2\\Repositories\\SessionManagementInterface', 'Xtwoend\\Api\\OAuth2\\Repositories\\FluentSession');\n\n $this->app['api.authorization'] = $this->app->share(function ($app) {\n\n $server = $app->make('League\\OAuth2\\Server\\Authorization');\n\n $config = $app['config']->get('xtwoend/api::oauth2');\n\n // add the supported grant types to the authorization server\n foreach ($config['grant_types'] as $grantKey => $grantValue) {\n\n $server->addGrantType(new $grantValue['class']($server));\n $server->getGrantType($grantKey)->setAccessTokenTTL($grantValue['access_token_ttl']);\n\n if (array_key_exists('callback', $grantValue)) {\n $server->getGrantType($grantKey)->setVerifyCredentialsCallback($grantValue['callback']);\n }\n\n if (array_key_exists('auth_token_ttl', $grantValue)) {\n $server->getGrantType($grantKey)->setAuthTokenTTL($grantValue['auth_token_ttl']);\n }\n\n if (array_key_exists('refresh_token_ttl', $grantValue)) {\n $server->getGrantType($grantKey)->setRefreshTokenTTL($grantValue['refresh_token_ttl']);\n }\n\n if (array_key_exists('rotate_refresh_tokens', $grantValue)) {\n $server->getGrantType($grantKey)->rotateRefreshTokens($grantValue['rotate_refresh_tokens']);\n }\n }\n\n $server->requireStateParam($config['state_param']);\n\n $server->requireScopeParam($config['scope_param']);\n\n $server->setScopeDelimeter($config['scope_delimiter']);\n\n $server->setDefaultScope($config['default_scope']);\n\n $server->setAccessTokenTTL($config['access_token_ttl']);\n\n return new OAuthServer($server);\n\n });\n\n $this->app['api.resource'] = $this->app->share(function ($app) {\n\n return $app->make('Xtwoend\\Api\\OAuth2\\Resource');\n\n });\n }",
"function create() {\n Debug::echo(\"POST /api/student/create\");\n\n $create = new Create($this->postAsObj());\n $create->main(); \n }",
"function test_an_authenticated_user_can_create_server()\n {\n $user = $this->signInAPI();\n\n $response = $this->postJson(api_route('server.store'), [\n 'name' => 'Server name',\n 'ip' => '127.0.0.1',\n 'ssh_port' => 22,\n 'sudo_password' => $password = Str::random(),\n 'meta' => [],\n 'php_version' => '72',\n 'database_type' => 'mysql',\n ]);\n\n $response->assertStatus(201);\n\n $server = $user->servers()->first();\n\n $this->assertEquals('Server name', $server->name);\n $this->assertEquals('127.0.0.1', $server->ip);\n $this->assertEquals('22', $server->ssh_port);\n $this->assertEquals($password, $server->sudo_password);\n $this->assertEquals('72', $server->php_version);\n $this->assertEquals('mysql', $server->database_type);\n }",
"public function store(StoreServerRequest $request)\n {\n return Server::create($request->only(\n 'name',\n 'user',\n 'ip_address',\n 'path',\n 'project_id'\n ));\n }",
"function auth_server_add($data)\n{\n $servers = auth_server_list();\n $servers[] = $data;\n set_option(\"ldap_ad_integration_component_servers\", base64_encode(serialize($servers)));\n return $data['id'];\n}",
"public function create_sid()\n {\n }",
"public function createServer($postParams){\n $request_body = array (\n 'server' =>\n array (\n 'name' => md5(uniqid(rand())),\n 'imageRef' => $this->image[$postParams['server_type']],\n 'flavorRef' => $this->flavors[$postParams['server_size']],\n 'metadata' => $postParams['metadata'],\n 'networks' => array (\n 0 =>\n array (\n 'uuid' => 'ae3fd5fe-c8c2-4e02-87b7-7cf6d7f0cf6d',\n ),\n )\n )\n );\n\n $request = json_encode($request_body);\n $res = $this->action($this->authUrl.\"servers\",\"POST\", $request);\n if($res){\n $return_arr = json_decode($res,true);\n return $return_arr['server']['id'];\n }\n else\n return false;\n }",
"public function create(){\n $this->authenticate() ;\n $this->verifyRequiredParams(\"picture,fullname,birthday,state,profile,education,party,type,achievments\") ;\n $aspirant = new aspirantModel();\n $result = $aspirant->createNew($_POST);\n parent::sendResponse($result);\n }",
"public function creating(Server $server)\n {\n event(new Events\\Server\\Creating($server));\n }",
"public function createClient()\n\t{\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function used to add new country// | public function addCountry()
{
$this->Checklogin();
if (isset($_POST ['submit']))
{
$data ['admin_section']='location';
$id=$this->location_model->addCountry();
if ($id)
{
$this->session->set_flashdata('success','Country has been added successfully.');
redirect('head/location');
} else
{
$this->session->set_flashdata('error','Unable to save Country.');
$data ['include']='head/location/location';
$data ['admin_section']='manage_location';
$this->load->view('backend/container_sa',$data);
}
} else
{
redirect('head/location');
}
} | [
"public function add_country($data) {\n $this->db->insert('tours_country', $data);\n }",
"public function addnewcountry($country, $region){\n\t\t$connection = Database::getConnection();\n\t\t$query=\"INSERT INTO country VALUES (DEFAULT, '\".$country.\"', '\".$region.\"')\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}else{\n\t\t\techo \"Country added successfully.<br>\\n\";\n\t\t}\n\t}",
"function saveCountry() {\n $new = FALSE;\n if (isset($this->params['create']) && $this->params['create'] == 1) {\n $new = TRUE;\n }\n $this->initializeCountryForm($new);\n if (!$this->countryDialog->checkDialogInput()) {\n $this->layout->add($this->getEditCountryForm($new));\n return;\n }\n // Check whether a continent has been chosen, or exit with an error if not\n if (isset($this->params['continent']) && $this->params['continent'] > 0) {\n $continent = $this->params['continent'];\n } else {\n $this->addMsg(MSG_WARNING, 'Please choose a continent.');\n $this->layout->add($this->getEditCountryForm($new));\n return;\n }\n $countryId = $this->params['country_id'];\n $comment = '';\n if (isset($this->params['comment'])) {\n $comment = $this->params['comment'];\n }\n // Prepare basic data\n $data = array(\n 'country_id' => $countryId,\n 'country_continent' => $continent,\n 'country_priority' => $this->params['priority'],\n 'country_fallbackname' => $this->params['english_name'],\n 'country_comment' => $comment\n );\n // Check whether this is a new or a changed country\n if (isset($this->params['create']) && $this->params['create'] == 1) {\n // New country\n // Check whether the chosen id already exists in database and reject it in this case\n $sql = \"SELECT COUNT(*)\n FROM %s\n WHERE country_id = '%s'\";\n $sqlParams = array($this->tableCountries, $countryId);\n $numRecords = 0;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($num = $res->fetchField()) {\n $numRecords = $num;\n }\n }\n if ($numRecords > 0) {\n $this->addMsg(MSG_WARNING, $this->_gtf('The country Id \"%s\" already exists', $countryId));\n $this->layout->add($this->getEditCountryForm($new));\n return;\n }\n // Insert the new country; store its id for localized name relations\n $countryId = $this->databaseInsertRecord(\n $this->tableCountries, NULL, $data\n );\n $msg = 'Country added.';\n } else {\n // Change existing country\n $this->databaseUpdateRecord(\n $this->tableCountries, $data, 'country_id', $countryId\n );\n $msg = $this->_gt('Country updated.');\n }\n // Save the localized country titles, if provided\n foreach ($this->params as $param => $value) {\n // Find any param that starts with 'lang_'\n if (preg_match('/^lang_(.*)/', $param, $matches)) {\n // Get current language\n $lang = $matches[1];\n // Prepare data\n $data = array(\n 'countryname_lang' => $lang,\n 'countryname_text' => $value,\n 'countryname_countryid' => $countryId\n );\n // Check whether this is a new or an existing name\n if (isset ($this->params['create']) && $this->params['create'] == 1) {\n // New: Simply insert the name\n if (trim($value) != '') {\n $this->databaseInsertRecord(\n $this->tableCountryNames, 'countryname_id', $data\n );\n }\n } else {\n // Existing\n // Get the name's id by category id and language\n $sql = \"SELECT countryname_id\n FROM %s\n WHERE countryname_countryid = '%s'\n AND countryname_lang = %d\";\n $params = array($this->tableCountryNames, $countryId, $lang);\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n // Check whether a country name in current language exists\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n // Existing name\n // Check whether the new value is an empty string\n if (trim($value) != '') {\n // Not empty: update existing record\n $this->databaseUpdateRecord(\n $this->tableCountryNames,\n $data,\n 'countryname_id',\n $row['countryname_id']\n );\n } else {\n // Empty: delete existing record\n $this->databaseDeleteRecord(\n $this->tableCountryNames,\n 'countryname_id',\n $row['countryname_id']\n );\n }\n } else {\n // New title: insert record\n if (trim($value) != '') {\n $this->databaseInsertRecord(\n $this->tableCountryNames,\n 'countryname_id',\n $data\n );\n }\n }\n }\n }\n }\n }\n $this->addMsg(MSG_INFO, $msg);\n }",
"public function actionAddCountry() {\n $response = \\Yii::$app->response;\n $response->format = \\yii\\web\\Response::FORMAT_JSON;\n $country = new Country();\n $country->scenario = 'create';\n $country->attributes = \\Yii::$app->request->post();\n if ($country->validate()) {\n $country->created = time();\n $country->updated = time();\n $country->save(false);\n return array('status' => true, 'data' => 'Country added successfully');\n } else {\n return array('status' => false, 'error' => $country->getErrors());\n }\n }",
"public static function addCountries()\n {\n $query = new Query();\n $countries = City::find()->limit(53)->orderBy(['id' => SORT_DESC])->all();\n /** @var City $country */\n foreach ($countries as $country) {\n $data = [\n 'id' => $country->id,\n 'name' => $country->name,\n 'ansi_name' => $country->ansi_name,\n 'alt_name' => $country->alt_name,\n 'location' => [\n 'lat' => $country->latitude,\n 'lon' => $country->longitude,\n ],\n 'country_code' => $country->country_code,\n 'population' => $country->population,\n 'popularity' => 0,\n 'directions' => [],\n ];\n $query->createCommand()->insert(self::INDEX, self::TYPE, $data, $country->id);\n }\n }",
"public function setCountry(string $newCountry): void;",
"public function getAddCountry()\n {\n $list = has_admin_permission(ModuleEnum::COUNTRY, CountryPermission::ADD_COUNTRY);\n $payment_options = Config::get('app.payment_options');\n if ($list == false) {\n return parent::getAdminError($this->theme_path);\n }\n $crumbs = [\n trans('admin/dashboard.dashboard') => 'cp',\n trans('admin/country.manage_country_list') => 'country',\n trans('admin/country.add_country_pagetitle') => '',\n ];\n $this->layout->breadcrumbs = Common::getBreadCrumbs($crumbs);\n $this->layout->pageicon = trans('admin/country.add_country_pageicon');\n $this->layout->header = view('admin.theme.common.header');\n $this->layout->sidebar = view('admin.theme.common.sidebar')\n ->with('mainmenu', 'country');\n\n $this->layout->pagetitle = trans('admin/country.add_country_pagetitle');\n $this->layout->pagedescription = trans('admin/country.add_country_pagedescription');\n $this->layout->content = view('admin.theme.country.add_country')\n ->with('payment_options', $payment_options);\n $this->layout->footer = view('admin.theme.common.footer');\n }",
"public static function addCountryCode()\n {\n $query = new Query();\n $loads = $query->from(self::INDEX, self::TYPE)\n ->query(['match_all' => []])\n ->all();\n\n foreach ($loads as $load) {\n $source = $load['_source'];\n if (self::hasCountryCode($source)) {\n continue;\n }\n\n self::removeById($source['id']);\n\n $data = [\n 'id' => $source['id'],\n 'user_id' => $source['user_id'],\n 'type' => $source['type'],\n 'date' => $source['date'],\n 'status' => $source['status'],\n 'active' => $source['active'],\n 'token' => $source['token'],\n 'quantity' => $source['quantity'],\n 'load' => self::formatLoadCities($source['load']),\n 'unload' => self::formatLoadCities($source['unload']),\n ];\n self::add($data);\n }\n }",
"public function add_hos_country() {\n $this->back_temp->loadData(\"title\", array(\"title\" => \"Add Country\"));\n $this->back_temp->loadData(\"activeLink\", array(\"home\" => array(\"add_hos_country\" => 1)));\n if($_POST){\n // recv post data ---------------------------------------------------\n $form = array();\n $form['country'] = $this->common->nohtml($this->input->post(\"country\", true));\n $this->hospital_model->add_country($form);\n $this->session->set_flashdata(\"globalmsg\", lang(\"sucess_1\"));\n redirect(site_url('admin_panel/add_hos_country'));\n }else{\n $lists = $this->hospital_model->get_country();\n $this->back_temp->loadCont(\"back/home/add_hos_country.php\", array(\"lists\" => $lists));\n }\n }",
"public function insert_country($country){\n\t\t$query = \"INSERT INTO `country`(`country_name`) value('$country')\";\n\t\t$result = mysql_query($query);\n\t\tif($result){\n\t\t\theader('location:view_country.php');\n\t\t}else{\n\t\t\tdie('can not insert'. mysql_error());\n\t\t}\n\t }",
"function cnAddCountry($country_name, $country_iso_2, $country_iso_3 )\n{\n db_query(\"insert into \".COUNTRIES_TABLE.\"( country_name, country_iso_2, country_iso_3 )\".\n \"values( '\".xToText(trim($country_name)).\"', '\".xToText(trim($country_iso_2)).\"', '\".\n xToText(trim($country_iso_3)).\"' )\" );\n return db_insert_id();\n}",
"function addcountry($idproject, $countriestoadd){\n\t\t$i=0;\n\t\tforeach ($countriestoadd as $key=>$value){\n\t\t\t$toadd[$i]=array($key,$value);\n\t\t\t$i++;\n\t\t}\n\t\t$results=$this->addCountryToProject($idproject,$toadd);\n\t\t$project=new Project();\n\t\t$project->displayProject($idproject);\n\t}",
"public function country();",
"public function addProvince() {\n\t\t\tif (!$this->validCSRFToken()) $this->error(\"Invalid Request\");\n\n\t\t\t$country = new \\Geography\\Country($_REQUEST['country_id']);\n\t\t\tif (! $country->id) $this->error(\"Country not found\");\n\t\n\t\t\t$province = new \\Geography\\Province();\n\t\n\t\t\t$parameters = array();\n\t\t\tif (isset($_REQUEST['name'])) $parameters['name'] = $_REQUEST['name'];\n\t\t\tif (isset($_REQUEST['abbreviation'])) $parameters['abbreviation'] = $_REQUEST['abbreviation'];\n\t\t\t$parameters['country_id'] = $country->id;\n\t\t\tif (! $province->add($parameters)) $this->error(\"Error adding province: \".$province->error());\n\t\n\t\t\t$response = new \\HTTP\\Response();\n\t\t\t$response->success = 1;\n\t\t\t$response->province = $province;\n\t\n\t\t\tprint $this->formatOutput($response);\n\t\t}",
"public function actionAdd()\n {\n if ($country = Yii::$app->request->post(\"country_name\") ) //country_name e.g. Croatia, Serbia...\n {\n\n foreach ($country as $countryName)\n {\n //find continent for that country\n $continent_id=Country::findContinentForCountry($countryName);\n //var_dump($continent_id);\n $Country=new Country;\n $Country->order_index=2; //orderin countries because Interlational is always #1, other are by name\n $Country->continent_id=$continent_id;\n $Country->language_id=7; //stupid because I can add only one language but one country can be multilingual\n $Country->name=$countryName;\n if($Country->save())\n {\n //find languages spoken in this country\n $countryExt=CountryExt::find()->where(['name'=>$countryName])->one();\n $langs=explode(\",\", $countryExt->languages); //hr,en,es\n foreach($langs as $lang)\n {\n //find that language in \"languages\" table so you can take id and add only language (assign to new country) that exist in CMS\n $lang_table=Language::find()->where(['code'=>$lang])->one();\n if(!empty($lang_table)) //if there is any lang in database that match language from that country\n {\n $CountryLanguage = new CountryLanguage;\n $CountryLanguage->language_id=$lang_table->id;\n $CountryLanguage->country_id=$Country->id;\n $CountryLanguage->save();\n }\n }\n $success=true;\n }\n else\n $success=false;\n\n }\n if($success==true)\n Yii::$app->session->setFlash('success', Yii::t('app','Everything went fine'));\n else\n Yii::$app->session->setFlash('danger', Yii::t('app','Something was wrong'));\n\n return $this->redirect(['index']);\n\n }\n\n }",
"public static function store_country ($request)\n {\n $country = new Countries;\n $country->name = $request->get('name');\n $country->abbreviation = $request->get('abbreviation');\n $country->area_code = $request->get('area_code');\n $country->idx = $request->get('idx');\n $country->created_by = '1';\n $country->dt_created = date('Y-m-d, H:i:s');\n $country->status = 'Active';\n\n if ($country->save()){\n return true;\n } else {\n return false;\n }\n }",
"protected function country()\n {\n $this->parts['{country}'] = $this->form->field($this->model, $this->model->getCountryPropertyName(), ['options' => ['class' => 'form-group']])->dropDownList(\n ArrayHelper::map(Country::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), [\n 'id' => $this->fieldIds['country']\n , 'prompt' => Yii::t('jlorente/location', 'Select country')\n , 'name' => $this->getSubmitModelName($this->model->getCountryPropertyName())\n ]);\n }",
"public function addCountryRecord(Country $value): void\n {\n $this->countryRecords[] = $value;\n }",
"public function &add_country(moysklad_country $item) {\n\t\t$this->commonAddElement('country', $item);\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add media metabox tab | function houzez_media_metabox_tab( $metabox_tabs ) {
if ( is_array( $metabox_tabs ) ) {
$metabox_tabs['gallery'] = array(
'label' => houzez_option('cls_media', 'Property Media'),
'icon' => 'dashicons-format-gallery',
);
}
return $metabox_tabs;
} | [
"function the_media_upload_tabs()\n{\n}",
"function media_upload_tabs() {}",
"function yz_groups_screen_media() {\r\n\r\n global $Youzer;\r\n\r\n // Call Media Tab Content.\r\n\tadd_action( 'bp_template_content', array( &$Youzer->tabs->media, 'group_tab' ) );\r\n\r\n // Load Tab Template\r\n bp_core_load_template( 'buddypress/groups/single/plugins' );\r\n\r\n}",
"public function media_button()\n\t{\n\t\t$type = 'picasa';\n\t\t$id = 'picasa';\n\t\t$title = \"Add Picasa Media\";\n\t\t$icon = plugins_url('/images/picasa-logo.png', __FILE__);\n\n\t\techo \"<a href='\" . esc_url( get_upload_iframe_src($type) ) . \"' id='{$id}-add_{$type}' class='thickbox add_$type' title='\" . esc_attr( $title ) . \"'><img src='\" . $icon . \"' alt='$title' onclick='return false;' /></a>\";\n\t}",
"function media( WP_Customize_Manager $manager ) {\n\t$manager->add_section(\n\t\t'media_section',\n\t\t[\n\t\t\t'title' => esc_html__( 'Media', 'atu' ),\n\t\t\t'priority' => 40,\n\t\t]\n\t);\n\n\t$manager->add_setting(\n\t\t'media_settings[subheading]',\n\t\t[\n\t\t\t'type' => 'theme_mod',\n\t\t\t'transport' => 'postMessage',\n\t\t]\n\t);\n\n\t$manager->add_control(\n\t\t'media_settings[subheading]',\n\t\t[\n\t\t\t'label' => esc_html__( 'Sub Heading', 'atu' ),\n\t\t\t'section' => 'media_section',\n\t\t\t'type' => 'text',\n\t\t]\n\t);\n\n\t$manager->add_setting(\n\t\t'media_settings[heading]',\n\t\t[\n\t\t\t'type' => 'theme_mod',\n\t\t\t'transport' => 'postMessage',\n\t\t]\n\t);\n\n\t$manager->add_control(\n\t\t'media_settings[heading]',\n\t\t[\n\t\t\t'label' => esc_html__( 'Heading', 'atu' ),\n\t\t\t'section' => 'media_section',\n\t\t\t'type' => 'text',\n\t\t]\n\t);\n}",
"function add_media_button() {\n\t\t\tglobal $post_ID, $temp_ID;\n\t\t\t$uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);\n\t\t\t$media_upload_iframe_src = \"media-upload.php?post_id=$uploading_iframe_ID\";\n\t\t\t$photonav_upload_iframe_src = apply_filters(\"photonav_upload_iframe_src\", \"$media_upload_iframe_src&type=photonav&tab=type_url\");\n\t\t\t$image_title = \"photonav.add_photonav\";\n\t\t\t$out = \"<a href='{$photonav_upload_iframe_src}&TB_iframe=true' id='add_photonav' class='thickbox' title='$image_title' onclick='return false;'><img src='\".WP_PLUGIN_URL.\"/wp-photonav/media-button.gif' alt='$image_title' /></a>\";\n\t\t\tprint($out);\n\t\t}",
"function wdm_add_meta_box() {\n\n add_meta_box(\n 'wdm_sectionid', 'Rank for slider video', 'wdm_meta_box_callback', 'post'\n ); //you can change the 4th paramter i.e. post to custom post type name, if you want it for something else\n\n}",
"public function onMediaButtons()\r\n\t{\r\n\t\t$cur_roles0 = get_option('mediafilemanager_accepted_roles_selector', 'administrator,editor,author,contributor,subscriber');\r\n\t\t$cur_roles = explode(',', $cur_roles0);\r\n\t\tif (!check_user_role($cur_roles)) return;\r\n\r\n\t\tglobal $post_ID, $temp_ID;\r\n\r\n\t\t$id = (int)( 0 == $post_ID ? $temp_ID : $post_ID );\r\n\t\t$iframe = apply_filters( \"media_upload_mrlMS_iframe_src\", \"media-upload.php?post_id={$id}&type=mrlMS&tab=mrlMS\" );\r\n\t\t$option = \"&TB_iframe=true&keepThis=true&height=500&width=640\";\r\n\t\t$title = \"Media-selector\";\r\n\t\t$button = \"{$this->pluginDirUrl}images/media_folder.png\";\r\n\r\n//\t\techo '<a href=\"' . $iframe . $option . '\" class=\"thickbox\" title=\"' . $title . '\"><img src=\"' . $button . '\" alt=\"' . $title . '\" /></a>';\r\n\t\techo ' <a href=\"' . $iframe . $option . '\" class=\"wp-media-buttons button add_media thickbox\" title=\"' . $title . '\">';\r\n\t\techo '<span class=\"wp-media-buttons-icon\" ></span><span style=\"background-color:#ff0;\"> '.$title.' </a> </span></span>';\r\n\t}",
"public function add_file_meta_box() {\n\t\n\t\tadd_meta_box(\n\t\t\t'post_media',\n\t\t\t__( 'Media', 'umb' ),\n\t\t\tarray( $this, 'post_media_display' ),\n\t\t\t'post',\n\t\t\t'side'\n\t\t);\n\t\n\t}",
"public function mediaMetaBox() {\n\t\tglobal $post;\n\t\t$this->theme->set('data', $this->theme->metaToData($post->ID));\n\t\techo $this->theme->render('admin'.DS.'media_meta_box');\n\t}",
"function metaboxes()\n\t{\n\t\tif('wpnukes_galleries' != $GLOBALS['post_type']) return;\n\t\t\n\t\tadd_meta_box('the_shortcode', __('Shortcode', THEME_NAME), array($this, 'shortcode'), 'wpnukes_galleries', 'side', 'high');\n\t\t\n\t\tadd_meta_box('the_image_uploader', __('Upload Images', THEME_NAME), array($this, 'upload_images'), 'wpnukes_galleries', 'normal', 'high');\n\t\tadd_meta_box('the_video_uploader', __('Upload Videos', THEME_NAME), array($this, 'upload_Videos'), 'wpnukes_galleries', 'normal', 'high');\n\t}",
"public function media_tab_js () {\n\t\tglobal $wooslider, $pagenow;\n\t\tif ( 'media-upload.php' != $pagenow ) return; // Execute only in the Media Upload popup.\n\n\t\t$wooslider->settings->enqueue_field_styles();\n\n\t\t$wooslider->settings->enqueue_scripts();\n\n\t\twp_enqueue_script( 'wooslider-settings-ranges' );\n\t\twp_enqueue_script( 'wooslider-settings-imageselectors' );\n\n\t\twp_enqueue_style( 'wooslider-settings-ranges' );\n\t\twp_enqueue_style( 'wooslider-settings-imageselectors' );\n\n\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\t\twp_register_script( $wooslider->token . '-media-tab', esc_url( $wooslider->plugin_url . 'assets/js/shortcode-creator' . $suffix . '.js' ), array( 'jquery' ), '1.0.7', false );\n\t\twp_enqueue_script( $wooslider->token . '-media-tab' );\n\n\t\t$settings = $wooslider->settings->get_settings();\n\n\t\t// Allow themes/plugins to filter here.\n\t\t$settings['category'] = '';\n\t\t$settings['tag'] = '';\n\t\t$settings['slide_page'] = '';\n\t\t$settings['slider_type'] = '';\n\t\t$settings['theme'] = 'default';\n\t\t$settings['layout'] = '';\n\t\t$settings['overlay'] = '';\n\t\t$settings['limit'] = '5';\n\t\t$settings['thumbnails'] = '';\n\t\t$settings['link_title'] = '';\n\t\t$settings['display_excerpt'] = '1';\n\t\t$settings['id'] = '';\n\t\t$settings['sync'] = '';\n\t\t// $settings['as_nav_for'] = '';\n\t\t$settings = (array)apply_filters( 'wooslider_popup_settings', $settings );\n\n\t\twp_localize_script( $wooslider->token . '-media-tab', $wooslider->token . '_settings', $settings );\n\t}",
"public function register_media_buttons() {\n\t\t\t$current_screen = get_current_screen();\n\t\t\tif ( $current_screen->base === 'post' ) {\n\t\t\t\tadd_action( 'media_buttons', [ $this, 'add_media_buttons' ], 20 );\n\t\t\t\tadd_action( 'admin_footer', [ $this, 'add_mce_popup' ] );\n\t\t\t}\n\t\t}",
"function add_video_metaboxes() {\n add_meta_box(\n\t\t'video_url',\n\t\t'Video URL',\n\t\t'video_url_function',\n\t\t'easyvideo',\n\t\t'normal',\n\t\t'default'\n\t);\n}",
"public function add_video_meta_boxes()\n {\n // Add this metabox to every selected post\n add_meta_box( \n sprintf('WP_Brafton_Article_Importer_%s_section', $this->post_type_id),\n sprintf('%s %s Information', ucwords( str_replace( \"_\", \" \", $this->brafton_options->brafton_get_product() ) ), $this->product_names['singular'] ),\n array(&$this, 'add_video_inner_meta_boxes'),\n $this->post_type_id, \n 'normal',\n 'high'\n );\n }",
"function register_media_Widget() {\n register_widget( 'Media_Widget' );\n}",
"function add_photocrati_media_buttons()\r\n{\r\n\techo _media_button('Add an Image', 'images/media-button-image.gif', 'image', 'add_image');\r\n\techo _media_button('Add Video', 'images/media-button-video.gif', 'video', 'add_video');\r\n\techo _media_button('Add Audio', 'images/media-button-music.gif', 'audio', 'add_audio');\r\n}",
"function OrgMap_organization_media_handle() {\n add_meta_box(\n 'organization_media_handle_box',\n __( 'Organization Media Handle', 'orgmap' ),\n array($this, 'OrgMap_organization_media_handle_box_content'),\n 'organization',\n 'normal',\n 'high'\n );\n }",
"function add_embed_tab($tabs) {\n\t\t$tabs['vp_embed_video']='Embed Video';\n\t\treturn $tabs;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if mode triggers desktop style | protected static function is_desktop_mode($mode)
{
return ($mode == 'desktop' || $mode == '404');
} | [
"function is_desktop()\n {\n return dev::isDesktop();\n }",
"public function is_desktop () {\n\t\treturn $this->is_desktop;\n\t}",
"public function isDesktop();",
"public function theSizeIsDesktop()\n {\n $this->getSession()->resizeWindow(1400, 900, 'current');\n }",
"static function getScreenMode()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\tif ($ilCtrl->getCmdClass() == \"ilnewsitemgui\")\n\t\t{\n\t\t\treturn IL_SCREEN_FULL;\n\t\t}\n\t\t\n\t\tswitch($ilCtrl->getCmd())\n\t\t{\n\t\t\tcase \"showNews\":\n\t\t\tcase \"showFeedUrl\":\n\t\t\t\treturn IL_SCREEN_CENTER;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"editSettings\":\n\t\t\tcase \"saveSettings\":\n\t\t\t\treturn IL_SCREEN_FULL;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\treturn IL_SCREEN_SIDE;\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static function isDesktop() {\n if (static::getDetectedDeviceFormat() === \"desktop\") {\n return TRUE;\n }\n return FALSE;\n }",
"function suitbuilder_widget_margin_desktop_active( ){\n global $suitbuilder_customizer_all_values;\n $widget_margin_desktop_device = $suitbuilder_customizer_all_values['suitbuilder-widget-margin-icon'];\n \n if( 'w-margin-desktop' == $widget_margin_desktop_device ){\n return true;\n }else{\n return false;\n } \n }",
"static function getScreenMode()\n\t{\n\t\tswitch($_GET[\"cmd\"])\n\t\t{\n\t\t\tcase \"showMail\":\n\t\t\t\treturn IL_SCREEN_CENTER;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\treturn IL_SCREEN_SIDE;\n\t\t\t\tbreak;\n\t\t}\n\t}",
"static function getScreenMode()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\tswitch($ilCtrl->getCmd())\n\t\t{\n\t\t\tcase \"create\":\n\t\t\tcase \"edit\":\n\t\t\tcase \"saveFeedBlock\":\n\t\t\tcase \"updateFeedBlock\":\n\t\t\tcase \"editFeedBlock\":\n\t\t\tcase \"showFeedItem\":\n\t\t\tcase \"confirmDeleteFeedBlock\":\n\t\t\t\treturn IL_SCREEN_CENTER;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\treturn IL_SCREEN_SIDE;\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function isRealInterfaceDesktop()\n {\n return ($this->defaultUserInterfaceType != self::MOBILE && $this->defaultUserInterfaceType != self::TABLET);\n }",
"protected function isAcquiaDesktop() {\n\n return !empty($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR']);\n }",
"static function getScreenMode()\n\t{\n\t\tswitch($_GET[\"cmd\"])\n\t\t{\n\t\t\tdefault:\n\t\t\t\treturn IL_SCREEN_SIDE;\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function isdesktop($agent=NULL) {\n\t\tif (!isset($agent))\n\t\t\t$agent=Base::instance()->AGENT;\n\t\treturn (bool)preg_match('/('.self::UA_Desktop.')/i',$agent) &&\n\t\t\t!$this->ismobile($agent);\n\t}",
"protected function isInFullScreenMode() {}",
"public function isTablet();",
"function GetWindowStyleFlag(){}",
"function IsFullScreen(){}",
"function wpmd_is_device() {\n\tglobal $detect;\n\tif( $detect->isMobile() || $detect->isTablet() ) return true;\n}",
"public function isDesktopViewPort()\n {\n $bDesktopViewPort = $this->inputFilterUtil->getFilteredInput('showDesktopMode', null, false, TCMSUserInput::FILTER_URL_INTERNAL);\n $request = $this->requestStack->getCurrentRequest();\n if (false === $request->hasSession()) {\n return false;\n }\n $oSession = $request->getSession();\n if (null !== $bDesktopViewPort) {\n $bDesktopViewPort = '1' === $bDesktopViewPort;\n $oSession->set('bDesktopViewPort', $bDesktopViewPort);\n } elseif (true === $oSession->has('bDesktopViewPort')) {\n $bDesktopViewPort = $oSession->get('bDesktopViewPort');\n } else {\n $oSession->set('bDesktopViewPort', false);\n $bDesktopViewPort = false;\n }\n\n return $bDesktopViewPort;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fills in peoples' submission data from the submission results log file | function process_submission_results() {
global $ROOT_DIR; // input
global $people; // input & output
// Syntax of log file:
// <hhmmss>,<user id>,<first name last name>,Problem<problem number>,<status code>,[text]
// status codes:
// "0" success
// "1" compile failure
// "2" test failure
// "3" timeout while running
// "4" crash
// "15" unknown error while executing program
// if status code is 1, there is another token before text which has the
// filename of a log of the compile
// log file is assumed to be in chronological order
global $contest_id, $curr_contest, $db;
$result_set = $db->get_submitted($contest_id);
foreach($result_set as $row) {
$user_id = $row['user_id'];
$problem_number = $row['problem'];
$status_code = intval($row['message']);
$time = $row['time'];//date("H:i:s", $row['time']);
if($row['tested'] == 1)
$people[$user_id]->submitted_problem($problem_number+1, $time, $status_code);
}
/* $log = file($ROOT_DIR.'/log', 1);
if ($log === false) {
app_log("ERROR: Opening submission results log file failed.");
echo "ERROR: Opening submission results log file failed.";
exit;
}
foreach ($log as $line) {
//echo "tokenized log entry as:<br />"; echo "<pre>"; print_r($entry); echo "</pre>";
$time = strtok($line, ",");
$user_id = strtok(",");
$name = strtok(",");
$problem_number = substr(strtok(","), 7);
$status_code = strtok(",");
//echo "tokenized line: time=$time, name=$name, problem number=$problem_number, code=$status_code<br />";
if (!array_key_exists($user_id, $people)) {
app_log(sprintf("ERROR: Submission results log refers to user id %d which is not in the users file.", $user_id));
continue;
}
$people[$user_id]->submitted_problem($problem_number, $time, $status_code);
if ($status_code == 1) {
$people[$user_id]->last_compile_log_filename = strtok(",");
}
}*/
} | [
"public function logSubmission() {\n\t\ttry {\n\t\t\t$this->clear ();\n\t\t\t\n\t\t\t$this->_populate ();\n\t\t\t\n\t\t\t$this->_validateInput ();\n\t\t\t\n\t\t\t$this->store ();\n\t\t\n\t\t} catch ( Exception $e ) {\n\t\t\techo $e->getMessage ();\n\t\t\tdie ();\n\t\t}\n\t\n\t}",
"function createSubmissionsArray($dataFile){\n\t$submissionArray = array();\n\n$row = 1;\nif (($handle = fopen($dataFile, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $num = count($data);\n //echo \"<p> $num fields in line $row: <br /></p>\\n\";\n for ($c=0; $c < $num; $c++) {\n $submissionArray[$row] = $data;\n }\n $row++;\n //writeFile($submissionArray); \n }\n\n fclose($handle);\n}\n\tforeach($submissionArray as &$person){\n \t//echo\"Placed $person[0]\";\n \tplaceInRoom($person);\n \t}//place each row into a room\n}",
"function submissionEmailLog($args) {\n\t\t$monographId = isset($args[0]) ? (int) $args[0] : 0;\n\t\t$logId = isset($args[1]) ? (int) $args[1] : 0;\n\t\t$this->validate($monographId);\n\t\t$submission =& $this->submission;\n\t\t$this->setupTemplate(true, $monographId, 'history');\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t$templateMgr->assign('isEditor', Validation::isEditor());\n\t\t$templateMgr->assign_by_ref('submission', $submission);\n\n\t\t$monographFileDao =& DAORegistry::getDAO('MonographFileDAO');\n\t\timport('classes.file.MonographFileManager');\n\t\t$templateMgr->assign('attachments', $monographFileDao->getMonographFilesByAssocId($logId, MONOGRAPH_FILE_ATTACHMENT));\n\n\t\tif ($logId) {\n\t\t\t$logDao =& DAORegistry::getDAO('MonographEmailLogDAO');\n\t\t\t$logEntry =& $logDao->getLogEntry($logId, $monographId);\n\t\t}\n\n\t\tif (isset($logEntry)) {\n\t\t\t$templateMgr->assign_by_ref('logEntry', $logEntry);\n\t\t\t$templateMgr->display('seriesEditor/submissionEmailLogEntry.tpl');\n\n\t\t} else {\n\t\t\t$rangeInfo =& Handler::getRangeInfo('emailLogEntries');\n\n\t\t\timport('classes.monograph.log.MonographLog');\n\t\t\t$emailLogEntries =& MonographLog::getEmailLogEntries($monographId, $rangeInfo);\n\t\t\t$templateMgr->assign_by_ref('emailLogEntries', $emailLogEntries);\n\t\t\t$templateMgr->display('seriesEditor/submissionEmailLog.tpl');\n\t\t}\n\t}",
"function submissionEmailLog($args) {\n\t\t$paperId = isset($args[0]) ? (int) $args[0] : 0;\n\t\t$logId = isset($args[1]) ? (int) $args[1] : 0;\n\t\t$this->validate($paperId);\n\t\t$submission =& $this->submission;\n\t\t\n\t\t$this->setupTemplate(true, $paperId, 'history');\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t$templateMgr->assign('isDirector', Validation::isDirector());\n\t\t$templateMgr->assign_by_ref('submission', $submission);\n\n\t\tif ($logId) {\n\t\t\t$logDao =& DAORegistry::getDAO('PaperEmailLogDAO');\n\t\t\t$logEntry =& $logDao->getLogEntry($logId, $paperId);\n\t\t}\n\n\t\tif (isset($logEntry)) {\n\t\t\t$templateMgr->assign_by_ref('logEntry', $logEntry);\n\t\t\t$templateMgr->display('trackDirector/submissionEmailLogEntry.tpl');\n\n\t\t} else {\n\t\t\t$rangeInfo =& Handler::getRangeInfo('emailLogEntries', array($paperId));\n\n\t\t\timport('paper.log.PaperLog');\n\t\t\twhile (true) {\n\t\t\t\t$emailLogEntries =& PaperLog::getEmailLogEntries($paperId, $rangeInfo);\n\t\t\t\tif ($emailLogEntries->isInBounds()) break;\n\t\t\t\tunset($rangeInfo);\n\t\t\t\t$rangeInfo =& $emailLogEntries->getLastPageRangeInfo();\n\t\t\t\tunset($emailLogEntries);\n\t\t\t}\n\t\t\t$templateMgr->assign_by_ref('emailLogEntries', $emailLogEntries);\n\t\t\t$templateMgr->display('trackDirector/submissionEmailLog.tpl');\n\t\t}\n\t}",
"public function parse(){\n $user_id = DataMapper::checkUser($this->username);\n \n $log = new GpsLog();\n $log->loadPointsFromCSV(UPLOAD_DIR.$this->filename); \n //store gps points\n foreach($log->GetPoints() as $p)\n {DataMapper::SaveGpsPoint($p,$user_id);}\n //store stay points\n foreach($log->GetStayPoints() as $s)\n {DataMapper::SaveStayPoint($s, $user_id);}\n \n $this->eraseFiles($filename);\n }",
"function parseEmails($logFile) {\r\n if (file_exists($logFile)) {\r\n if (($handle = fopen($logFile, \"r\")) !== FALSE) {\r\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\r\n $email = $data[9];\r\n if (isset($email) && $email != 's2' && $email != '') {\r\n switch ($logFile) {\r\n case 'REQUEST.csv':\r\n array_push($GLOBALS['allEmails'], $email);\r\n break;\r\n case 'CAPTCHA.csv':\r\n array_push($GLOBALS['captchaEmails'], $email);\r\n break; \r\n case 'SCORE.csv':\r\n array_push($GLOBALS['scoreEmails'], $email);\r\n break; \r\n }\r\n }\r\n }\r\n fclose($handle);\r\n } \r\n }\r\n}",
"public function submissions();",
"protected function resultsPopulate() {\n // don't do if it's empty..\n if (empty($_POST)) {\n //return;\n }\n\n // loop through all of the POST data\n foreach($_POST AS $key => $val) {\n // a valid answer will have \"answer_\" at the start\n if (strstr($key, \"answer_\")) {\n $answer = str_replace(\"answer_\", \"\", $key);\n // ok we have a idx for the results array, loop through and if it exists, add the answer\n foreach ($this->results AS $rkey => $rval) {\n if ($rval['idx'] == $answer) {\n $this->results[$rkey]['answer'] = intval($val);\n }\n } // end results loop\n }\n } // end loop\n\n // now save the updated answers in the session\n $_SESSION['skill_coresurvey']['answers'] = $this->compress($this->results);\n\n }",
"protected function getSubmissionLog() {\n $query = \\Drupal::database()->select('webform_submission_log', 'l');\n $query->leftJoin('webform_submission', 'ws', 'l.sid = ws.sid');\n $query->fields('l', [\n 'lid',\n 'uid',\n 'sid',\n 'handler_id',\n 'operation',\n 'message',\n 'variables',\n 'timestamp',\n ]);\n $query->fields('ws', [\n 'webform_id',\n 'entity_type',\n 'entity_id',\n ]);\n $query->orderBy('l.lid', 'DESC');\n $submission_logs = $query->execute()->fetchAll();\n foreach ($submission_logs as &$submission_log) {\n $submission_log->variables = unserialize($submission_log->variables);\n }\n return $submission_logs;\n }",
"function Submitters() {\r\n if (!file_exists('submitters')) { kill('submitters not found'); }\r\n $submitter = array();\r\n $loaddata = fopen (\"submitters\", \"r\");\r\n while (!feof($loaddata)) {\r\n $stuff = fgets($loaddata, filesize(\"submitters\")+1);\r\n $stuff = explode(\"%\",$stuff);\r\n $submitter[trim($stuff[0])] = array(\"name\"=>trim($stuff[1]),\"number\"=>trim($stuff[2]));\r\n }\r\n fclose($loaddata);\r\n return ($submitter);\r\n}",
"private function parseTextReport()\n {\n $lines = file($this->pathToReport, FILE_IGNORE_NEW_LINES);\n $loadReport = NULL;\n\t\tif (is_array($lines))\n\t\t{\n\t\t\t$section = \"batch_summary\";\n\t\t\tforeach ($lines as $line)\n\t\t\t{\n\t\t\t\tif ($section == \"batch_summary\") \n\t\t\t\t{\n \tif (strpos($line, self::BATCH_ID_LINE_PREFIX) === 0)\n \t{\n \t// BATCH ID\n \t$batchID = trim(substr($line, strlen(self::BATCH_ID_LINE_PREFIX)));\n \t$this->setBatchID($batchID);\n \t} \n \telseif (strpos($line, self::BATCH_DIRECTORY_LINE_PREFIX) === 0)\n \t{\n \t// BATCH DIRECTORY NAME\n \t$batchDir = trim(substr($line, strlen(self::BATCH_DIRECTORY_LINE_PREFIX)));\n \t$this->setBatchDirectoryName($batchDir);\n \t} \n \telseif (strpos($line, self::BATCH_NAME_LINE_PREFIX) === 0)\n \t{\n \t// BATCH NAME\n \t$batchName = trim(substr($line, strlen(self::BATCH_NAME_LINE_PREFIX)));\n \t$this->setBatchName($batchName);\n \t} \n \telseif (strpos($line, self::OWNER_LINE_PREFIX) === 0)\n \t{\n \t// OWNERS\n \t$owner = trim(substr($line, strlen(self::OWNER_LINE_PREFIX)));\n \t$this->setOwner($owner);\n \t} \n \telseif (strpos($line, $this->getFileListSectionPrefix()) === 0)\n \t{\n \t// done with batch summary section -\n \t// entering the file list section\n \t$section = \"file_list\";\n \t} \n \t} \n \telseif ($section == \"file_list\")\n \t{ \n \tif (strpos($line, self::RELATION_LIST_SECTION_LINE_PREFIX) === 0){\n \t// done with file list section -\n \t// entering the relationship list section\n \t$section = \"rel_list\";\n \t} \n \telse \n \t{\n \t\t\n \t\t// treat it as a file line\n \t$fields= explode(\"\\t\", $line);\n \t\n \tif (count($fields) > 11)\n \t{\n \t\tif (!$this->isDescriptor($fields))\n \t\t{\n \t\t\tif ($this->drsVersion == DRSDropperConfig::DRS)\n \t\t\t{\n\t \t\t\t$reportFile = $this->getDRSLoadReportFile($fields);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$reportFile = $this->getDRS2LoadReportFile($fields);\n \t\t\t}\n\t\t\t\t\t\t\t\t$this->addFile($reportFile);\n \t\t}\n \t} \n } \n }\n elseif ($section == \"rel_list\")\n {\n \t//Don't need this area\n \tbreak;\n }\n\t\t\t}\n\t\t}\n return $loadReport;\n }",
"private function logEntriesInDateRange() {\n\t\t// loop the discovered files\t\t\n\t\tforeach ($this->report['files'] as $file) {\n\t\t\t$handle = @fopen($file, \"r\");\n\t\t\tif ($handle) {\n\t\t\t\twhile (($buffer = fgets($handle, 4096)) !== false) {\n\t\t\t\t\t$this->Log->parseLogLine($buffer);\n\t\t\t\t\t// is it an log entry for the customer of interest?\n\t\t\t\t\tif ($this->Log->logLine['customer'] == $this->report['customer']) {\n\t\t\t\t\t\t// if the log entry is in the specific date range, save it\n\t\t\t\t\t\tif ($this->Log->meta['datetime'] >= $this->report['firstTime'] && $this->Log->meta['datetime'] <= $this->report['finalTime']) {\n\t\t\t\t\t\t\t$this->report['items'][$this->Log->logLine['id']]['Activity'][] = array_merge($this->Log->meta, $this->Log->logLine);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\tif (!feof($handle)) {\n\t\t\t\t\techo \"Error: unexpected fgets() fail\\n<br />\";\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}",
"function LoadBroDNSLogs($fileName) {\n\n\t$insertStatement = \"\"; //Holds the overall SQL insert statement\n\t$currentRecordVals = \"\"; //Holds the values for this particular record before adding to $insertStatement\n\t//$fileName = \"../test2/dns.log\"; //use only for testing\n\tprint(\"Importing dns log file $fileName \\n\");\n\t$file = fopen($fileName, \"r\");\n\t$i = 1;\n\t$insertStatement = DNS_LOG_INSERT;\n\t$completeStatement = True;\n\twhile(! feof($file)){\n\t\t$tmpRecord = fgetcsv($file, 0, \"\\t\");\n\t\t/**Check to ensure that the first charachter \n\t\tisn't '#' and if it is, skip the line */\n\t\tif ($tmpRecord[0][0] == '#') continue; //Line is a header\n \tif ($tmpRecord[0][0] == false) continue; //Line is blank\n\t\t\n\t\t$ts = $tmpRecord[DNS_TS];\n\t\t$uid = $tmpRecord[DNS_UID];\n\t\t$transID = ReturnString($tmpRecord[DNS_TRANSID]);\n\t\t$query = ReturnString($tmpRecord[DNS_QUERY]);\n\t\t$className = ReturnString($tmpRecord[DNS_CLASSNAME]);\n\t\t$typeName = ReturnString($tmpRecord[DNS_TYPENAME]);\n\t\t$responseName = ReturnString($tmpRecord[DNS_RESPONSECODENAME]);\n\t\t$answers = ReturnString($tmpRecord[DNS_ANSWERS]);\n\t\t$ttl = ReturnNum($tmpRecord[DNS_TTL]);\n\n\t\t//Break domain down into subelements\n\t\t$domain = str_getcsv($query, \".\");\n\t\t//Get the last two elements of the array and assign it to Top Level Domain\n\t\tif (count($domain) >= 2) {\n\t\t\t$tld = $domain[count($domain)-2] . \".\" . $domain[count($domain)-1];\n\t\t} else {\n\t\t\t$tld = $query;\n\t\t}\n\n\t\t//If there are subdomain elements, assign them to subdomain\n\t\tif (count($domain) > 2) {\n\t\t\t$subdomain = $domain[0];\n\t\t\tfor ($a = 1; $a <= count($domain) - 3; $a++) {\n\t\t\t\t$subdomain = $subdomain . \".\" . $domain[$a];\n\t\t\t}\n\t\t} else {\n\t\t\t$subdomain = \"\";\n\t\t}\n\t\t\n\t\t//Build $currentRecordVals\n\t\t$currentRecordVals = \"('$uid', '$transID', '$subdomain', '$tld', '$className', '$typeName', '$responseName', '$answers', $ttl)\";\n\n\t\tif ($i == 1) { //First record, no need to add the comma\n\t\t\t$insertStatement = $insertStatement . $currentRecordVals;\n\t\t\t$i++;\n\t\t\t$completeStatement = False;\n\t\t} elseif ($i == 10) { //Final record in the current set, close out the sql statement and insert\n\t\t\t$insertStatement = $insertStatement . \", \" . $currentRecordVals . \";\";\n\n\t\t\t//INSERT THE RECORD INTO THE DATABASE\n\t\t\tif (! db_query($insertStatement)){\n\t\t\t\techo \"ERROR...... $insertStatement \\n\";\n\t\t\t}\n\n\t\t\t$i = 1; //Reset the counter\n\t\t\t$completeStatement = True;\n\t\t\t$insertStatement = DNS_LOG_INSERT;\n\t\t} else { //add a comma and the the next set of values\n\t\t\t$insertStatement = $insertStatement . \", \" . $currentRecordVals;\n\t\t\t$i++;\n\t\t\t$completeStatement = False;\n\t\t}\n\t\n\t\t//PASSIVE DNS STUFF\n\t\t//Check to see if this is an A or AAAA record\n\t\tif ((($typeName == \"A\") || ($typeName == \"AAAA\")) && $responseName == \"NOERROR\") {\n\t\t\t$domainAnswers = str_getcsv($answers);\n\t\t\tforeach ($domainAnswers as $value){\n\t\t\t\t//Ensure that the current $value is actually an IP address\n\t\t\t\tif (is_ip($value)) {\n\t\t\t\t\t//$sql = \"SELECT * from passive_dns;\";\n\t\t\t\t\t$sql = \"SELECT * from passive_dns WHERE PASSIVE_QUERY = '$query' and PASSIVE_ANSWER = INET6_ATON('$value');\";\n\t\t\t\t\t//Make sure that the query/answer combo doesn't already exist\n\t\t\t\t\t$numRows = num_rows($sql);\n\t\t\t\t\tif ($numRows > 0) {\n\t\t\t\t\t\t$sql = \"UPDATE passive_dns SET passive_lastfound = FROM_UNIXTIME($ts), \n\t\t\t\t\t\t\tpassive_count = passive_count + 1 WHERE PASSIVE_QUERY = \n\t\t\t\t\t\t\t'$query' and PASSIVE_ANSWER = INET6_ATON('$value');\";\n\t\t\t\t\t\t//Update the current count and last found values\n\t\t\t\t\t\tdb_query($sql);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql = \"INSERT INTO passive_dns (PASSIVE_QUERY, PASSIVE_ANSWER, PASSIVE_FIRSTFOUND, \n\t\t\t\t\t\t\tPASSIVE_LASTFOUND, PASSIVE_COUNT) VALUES ('$query', INET6_ATON('$value'), FROM_UNIXTIME($ts), \n\t\t\t\t\t\t\tFROM_UNIXTIME($ts), 1)\";\n\t\t\t\t\t\t//Insert the values into the table\n\t\t\t\t\t\tdb_query($sql);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//If we reach end of file without properly finishing and inserting the sql statement, do it now\n\tif (! $completeStatement){\n\t\t$insertStatement = $insertStatement . \";\";\n\t\t//ADD CODE TO INSERT RECORDS INTO DATABASE\n\t\tif (! db_query($insertStatement)){\n\t\t\techo \"ERROR...... $insertStatement \\n\";\n\t\t}\n\t\t$completeStatement = True;\n\t}\n}",
"function addFakeSubmissionRecords($projectid)\n {\n // One old one (older than the \"stuck threshold\") with status=1\n // and one new one (right now) with status=0\n //\n // After processing, verify that all records for projectid 1 have\n // status>1... (that exactly zero have status 0 or 1...)\n //\n global $CDASH_SUBMISSION_PROCESSING_TIME_LIMIT;\n\n $old_time = gmdate(FMT_DATETIMESTD, time()-(2*$CDASH_SUBMISSION_PROCESSING_TIME_LIMIT));\n $now_utc = gmdate(FMT_DATETIMESTD);\n $n = 3;\n\n $i = 0;\n while ($i < $n)\n {\n pdo_query(\n \"INSERT INTO submission \".\n \" (filename,projectid,status,attempts,filesize,filemd5sum,created,started) \".\n \"VALUES \".\n \" ('bogus_submission_file_1.noxml','$projectid','1','1','999','bogus_md5sum_1','$old_time','$old_time')\"\n );\n\n ++$i;\n }\n\n $i = 0;\n while ($i < $n)\n {\n pdo_query(\n \"INSERT INTO submission \".\n \" (filename,projectid,status,attempts,filesize,filemd5sum,created) \".\n \"VALUES \".\n \" ('bogus_submission_file_2.noxml','$projectid','0','0','999','bogus_md5sum_2','$now_utc')\"\n );\n\n ++$i;\n }\n\n return 0;\n }",
"function getSubmittedJobData($theUserName, $theJobName, &$theJobInfo) {\n\n\t$theJobInfo = array();\n\n\t// Retrieve details on the simulation job of given user.\n\t$sqlUserJob = \"SELECT status, server_name, email, group_id, \" .\n\t\t\"job_timestamp, duration, cfg_pathname_1, last_updated \" .\n\t\t\"FROM simulation_jobs_details \" .\n\t\t\"WHERE user_name=$1 \" .\n\t\t\"AND job_name=$2 \";\n\t$resUserJob = db_query_params($sqlUserJob, \n\t\tarray(\n\t\t\t$theUserName,\n\t\t\t$theJobName\n\t\t)\n\t);\n\n\t// Retrieve job details.\n\t$rowsUserJob = db_numrows($resUserJob);\n\n\tfor ($i = 0; $i < $rowsUserJob; $i++) {\n\n\t\t$jobStatus = db_result($resUserJob, $i, 'status');\n\t\tif ($jobStatus == 1) {\n\t\t\t$strJobStatus = \"Submitted\";\n\t\t}\n\t\telse if ($jobStatus == 2) {\n\t\t\t$strJobStatus = \"Started\";\n\t\t}\n\t\telse if ($jobStatus == 3) {\n\t\t\t$strJobStatus = \"Completed\";\n\t\t}\n\t\t$theJobInfo['status'] = $strJobStatus;\n\t\t$theJobInfo['server_name'] = db_result($resUserJob, $i, 'server_name');\n\t\t$theJobInfo['email'] = db_result($resUserJob, $i, 'email');\n\t\t$theJobInfo['job_timestamp'] = db_result($resUserJob, $i, 'job_timestamp');\n\t\t$theJobInfo['duration'] = db_result($resUserJob, $i, 'duration');\n\t\t$theJobInfo['last_updated'] = db_result($resUserJob, $i, 'last_updated');\n\t\t$theJobInfo['group_id'] = db_result($resUserJob, $i, 'group_id');\n\n\t\t$cfgPathname = db_result($resUserJob, $i, 'cfg_pathname_1');\n\t\tif ($cfgPathname != \"\" && file_exists($cfgPathname)) {\n\t\t\t$theJobInfo['cfg_pathname'] = $cfgPathname;\n\t\t}\n\t}\n\tdb_free_result($resUserJob);\n}",
"public function save_user_data() {\n global $DB;\n\n // at each submission I need to save one 'survey_submission' and some 'survey_userdata'\n\n // -----------------------------\n // let's start by saving one record in survey_submission\n // in this method I also assign $this->submissionid and $this->status\n $this->save_survey_submission();\n // end of: let's start by saving one record in survey_submission\n // -----------------------------\n\n // save now all the answers provided by the user\n $regexp = '~('.SURVEY_ITEMPREFIX.'|'.SURVEY_PLACEHOLDERPREFIX.')_('.SURVEY_TYPEFIELD.'|'.SURVEY_TYPEFORMAT.')_([a-z]+)_([0-9]+)_?([a-z0-9]+)?~';\n\n $infoperitem = array();\n foreach ($this->formdata as $itemname => $content) {\n if (!preg_match($regexp, $itemname, $matches)) {\n // button or something not relevant\n switch ($itemname) {\n case 's': // <-- s is the survey id\n $surveyid = $content;\n break;\n default:\n // this is the black hole where is thrown each useless info like:\n // - formpage\n // - nextbutton\n // and some more\n }\n continue; // to next foreach\n }\n\n // var_dump($matches);\n // $matches = array{\n // 0 => string 'survey_field_radiobutton_1452' (length=27)\n // 1 => string 'survey' (length=6)\n // 2 => string 'field' (length=5)\n // 3 => string 'radiobutton' (length=11)\n // 4 => string '1452' (length=4)\n // }\n // $matches = array{\n // 0 => string 'survey_field_radiobutton_1452_check' (length=33)\n // 1 => string 'survey' (length=6)\n // 2 => string 'field' (length=5)\n // 3 => string 'radiobutton' (length=11)\n // 4 => string '1452' (length=4)\n // 5 => string 'check' (length=5)\n // }\n // $matches = array{}\n // 0 => string 'survey_field_checkbox_1452_73' (length=30)\n // 1 => string 'survey' (length=6)\n // 2 => string 'field' (length=5)\n // 3 => string 'checkbox' (length=8)\n // 4 => string '1452' (length=4)\n // 5 => string '73' (length=2)\n // $matches = array{}\n // 0 => string 'placeholder_field_multiselect_199_placeholder' (length=45)\n // 1 => string 'placeholder' (length=11)\n // 2 => string 'field' (length=5)\n // 3 => string 'multiselect' (length=11)\n // 4 => string '199' (length=3)\n // 5 => string 'placeholder' (length=11)\n\n $itemid = $matches[4]; // itemid of the mform element (or of the group of mform elements referring to the same item)\n if (!isset($infoperitem[$itemid])) {\n $infoperitem[$itemid] = new stdClass();\n $infoperitem[$itemid]->surveyid = $surveyid;\n $infoperitem[$itemid]->submissionid = $this->submissionid;\n $infoperitem[$itemid]->type = $matches[2];\n $infoperitem[$itemid]->plugin = $matches[3];\n $infoperitem[$itemid]->itemid = $itemid;\n }\n if (!isset($matches[5])) {\n $infoperitem[$itemid]->contentperelement['mainelement'] = $content;\n } else {\n $infoperitem[$itemid]->contentperelement[$matches[5]] = $content;\n }\n }\n\n // if (isset($infoperitem)) {\n // echo '$infoperitem = <br />';\n // print_object($infoperitem);\n // } else {\n // echo 'Nothing has been found<br />';\n // }\n // die;\n\n // once $infoperitem is onboard...\n // I update/create the corresponding record\n // asking to each item class to manage its informations\n\n foreach ($infoperitem as $iteminfo) {\n if (!$userdatarec = $DB->get_record('survey_userdata', array('submissionid' => $iteminfo->submissionid, 'itemid' => $iteminfo->itemid))) {\n // Quickly make one new!\n $userdatarec = new stdClass();\n $userdatarec->surveyid = $iteminfo->surveyid;\n $userdatarec->submissionid = $iteminfo->submissionid;\n $userdatarec->itemid = $iteminfo->itemid;\n $userdatarec->content = '__my_dummy_content@@';\n $userdatarec->contentformat = null;\n\n $id = $DB->insert_record('survey_userdata', $userdatarec);\n $userdatarec = $DB->get_record('survey_userdata', array('id' => $id));\n }\n $userdatarec->timecreated = time();\n\n $item = survey_get_item($iteminfo->itemid, $iteminfo->type, $iteminfo->plugin);\n\n // in this method I update $userdatarec->content\n // I do not really save to database\n $item->userform_save_preprocessing($iteminfo->contentperelement, $userdatarec, false);\n\n if ($userdatarec->content != '__my_dummy_content@@') {\n $DB->update_record('survey_userdata', $userdatarec);\n } else {\n print_error('Wrong $userdatarec! \\'__my_dummy_content@@\\' has not been replaced.');\n }\n }\n }",
"public function writeFields(){\n\n\tif($this->errorMessage !== \"\")\n {\n echo $this->errorMessage;\n }\n elseif( !empty($this->env) ) \n {\n \t// generate an issue number using the number of lines in the data file\n \t$lineCount = 0;\n \t$handle = fopen(__DIR__ . \"/\" . $this->dataFiles[$this->env], \"r\");\n\n\t\tif(!$fp){\n\t\t\techo \"writeFields(): [ERROR] Unable to open \" . $this->dataFiles[$this->env] . \"<br>\";\n\t\t\treturn;\n\t\t}else {\n\t echo (\"Success!\");\n\t\t}\n\n \twhile(fgets($fp)){\n \t$lineCount++;\n \t}\n\n $this->fields[0] = $lineCount;\n fclose($fp);\n\n // write issue fields to environment data file in csv format\n $fp = fopen(__DIR__ . \"/\" . $this->dataFiles[$this->env],\"a\");\n\t\tif(!$fp){\n\t\t\techo \"writeFields(): [ERROR] Unable to open \" . $this->dataFiles[$this->env] . \"<br>\";\n\t\t\treturn;\n\t\t}\n\n fputcsv($fp,$this->fields);\n fclose($fp);\n\n //add redirect to avoid refresh issues\n }\n\n}",
"private function set_coursestudent_submission_details() {\n global $DB;\n\n list($insql, $inparams) = $DB->get_in_or_equal($this->coursestudentids);\n $params = array_merge(array($this->assignmentid), $inparams);\n\n $studentsql = \"\n SELECT u.id, u.firstname, u.lastname, u.email,\n a.status,\n b.barcode\n FROM {user} u\n JOIN {assignsubmission_physical} b ON u.id = b.userid AND b.assignmentid = ?\n JOIN {assign_submission} a ON a.id = b.submissionid AND a.userid = b.userid\n WHERE u.id $insql\";\n\n $submissionrecords = $DB->get_records_sql($studentsql, $params);\n\n foreach ($submissionrecords as $record) {\n $this->coursestudents[$record->id]->status = $record->status;\n $this->coursestudents[$record->id]->barcode = $record->barcode;\n }\n }",
"public function test_create_submission_event_data_returns_correct_data_for_file_submission() {\n global $DB;\n\n $this->resetAfterTest();\n\n $this->setAdminUser();\n\n $course = $this->getDataGenerator()->create_course();\n\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($this->student1->id,\n $course->id,\n $studentrole->id);\n\n $quiz = $this->getDataGenerator()->create_module('quiz', array('course' => $course));\n $cm = get_coursemodule_from_instance('quiz', $quiz->id, $course->id, false, MUST_EXIST);\n\n // Log new user in.\n $this->setUser($this->student1);\n\n $file = create_test_file(1, 1, 'mod_quiz', 'submissions');\n\n // Create dummy link array data.\n $linkarray = array(\n \"cmid\" => $cm->id,\n \"userid\" => $this->student1->id,\n \"file\" => $file,\n \"content\" => '',\n \"area\" => 1\n );\n\n $tsquiz = new plagiarism_turnitinsim_quiz();\n $response = $tsquiz->create_submission_event_data($linkarray);\n\n $this->assertEquals('quiz_submitted', $response['eventtype']);\n $this->assertEquals($cm->id, $response['contextinstanceid']);\n $this->assertEquals($this->student1->id, $response['userid']);\n $this->assertEquals(array($file->get_pathnamehash()), $response['other']['pathnamehashes']);\n $this->assertEquals($linkarray['area'], $response['objectid']);\n $this->assertEquals($this->student1->id, $response['relateduserid']);\n $this->assertEquals('quiz', $response['other']['modulename']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the site URL of the reference site to use for stats. | public function get_reference_site_url() {
return $this->filter_reference_url();
} | [
"public function getUrl() {\n\t\treturn $this->siteURL;\n\t}",
"public function getSiteURL()\n {\n return $this->config->get('site.url').$this->config->get('site.dir');\n }",
"public function getSiteLink()\n {\n return $this->siteLink;\n }",
"private function get_site_url() {\n static $site_url = null;\n\n if ( is_null( $site_url ) ) {\n $site_url = Warpdrive::get_option( 'siteurl' );\n $site_url = rtrim( $site_url, '/' );\n }\n\n return $site_url;\n }",
"function trueSiteUrl() {\n\t\treturn $GLOBALS[\"trueSiteUrl\"];\n\t}",
"public function getCurrentSiteUrl()\n {\n return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\n }",
"public function getSiteBaseUrl();",
"public function getUrlMain() {\n return $this->siteUrl;\n }",
"function get_site_url() {\n\t$protocol = (isSet($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';\n\treturn $protocol . '://' . $_SERVER['HTTP_HOST'];\n}",
"public function getURL() {\n\t\t\tif ($this->getToolType() == 'link') {\n\t\t\t\t$url = $this->getPath();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$url = siteURL . $this->getPath();\n\t\t\t}\n\n\t\t\treturn $url;\n\t\t}",
"protected function getRefererUrl()\n {\n return \"http\" . (($_SERVER['SERVER_PORT']==443) ? \"s://\" : \"://\") . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n }",
"private function siteUrl(): string\n {\n return get_home_url();\n }",
"function site_url(){\n\treturn config( 'site.url' );\n}",
"protected static function get_wp_site_url() {\n\t\tif ( ! function_exists( 'get_site_url' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$site_url = get_site_url();\n\n\t\treturn $site_url ?: null;\n\t}",
"function getJavascriptSiteURL()\n{\n global $sugar_config;\n if (!empty($_SERVER['HTTP_REFERER'])) {\n $url = parse_url($_SERVER['HTTP_REFERER']);\n $replacement_url = $url['scheme'] . '://' . $url['host'];\n if (!empty($url['port'])) {\n $replacement_url .= ':' . $url['port'];\n }\n $site_url = preg_replace('/^http[s]?\\:\\/\\/[^\\/]+/', $replacement_url, $sugar_config['site_url']);\n } else {\n $site_url = preg_replace('/^http(s)?\\:\\/\\/[^\\/]+/', 'http$1://' . $_SERVER['HTTP_HOST'], $sugar_config['site_url']);\n if (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') {\n $site_url = preg_replace('/^http\\:/', 'https:', $site_url);\n }\n }\n $GLOBALS['log']->debug('getJavascriptSiteURL(), site_url=' . $site_url);\n\n return $site_url;\n}",
"public static function get_site_url() {\n\n\t\treturn wp_mail_smtp()->get_admin()->get_admin_page_url() . '-setup-wizard';\n\t}",
"public function getServerUrl()\n { \n return $this->_shoptimallyDomain;\n }",
"public function getStatsUri()\n {\n return $this->stats_uri;\n }",
"public function getURL() {\n if (!empty($this->localInfo['url'])) return $this->localInfo['url'];\n return 'https://www.dokuwiki.org/'.($this->isTemplate() ? 'template' : 'plugin').':'.$this->getBase();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test binding a class, using the abstract as the concrete. | public function testBindNoConcretePassed()
{
$this->container->bind('League\\Di\\Stub\\Baz');
$bindings = $this->readAttribute($this->container, 'bindings');
$this->assertArrayHasKey(
'League\\Di\\Stub\\Baz',
$bindings,
'The key for the binding should equal the first argument passed.'
);
$definition = $bindings['League\\Di\\Stub\\Baz'];
$this->assertInstanceOf(
'League\\Di\\Definition',
$definition,
'Passing an empty $concrete should result in an instance of Definition.'
);
$this->assertAttributeEquals(
'League\\Di\\Stub\\Baz',
'class',
$definition,
'The class attribute on the created Definition should match the $abstract param if no $concrete is passed.'
);
} | [
"public function testBindingToAbstractClass()\n {\n $this->container->bind($this->baseClass, $this->concreteFoo);\n $sharedInstance = $this->container->makeShared($this->baseClass);\n $this->assertInstanceOf($this->concreteFoo, $sharedInstance);\n $newInstance = $this->container->makeNew($this->baseClass);\n $this->assertInstanceOf($this->concreteFoo, $newInstance);\n }",
"public function testBindingToAbstractClass()\n {\n $prototypeContainer = new Container();\n $prototypeContainer->bindPrototype($this->baseClass, $this->concreteFoo);\n $prototypeInstance = $prototypeContainer->resolve($this->baseClass);\n $this->assertInstanceOf($this->concreteFoo, $prototypeInstance);\n $this->assertNotSame($prototypeInstance, $prototypeContainer->resolve($this->baseClass));\n $singletonContainer = new Container();\n $singletonContainer->bindSingleton($this->baseClass, $this->concreteFoo);\n $singletonInstance = $singletonContainer->resolve($this->baseClass);\n $this->assertInstanceOf($this->concreteFoo, $singletonInstance);\n $this->assertSame($singletonInstance, $singletonContainer->resolve($this->baseClass));\n }",
"public function testGettingTargetedBinding()\n {\n $this->container->bind($this->fooInterface, $this->concreteFoo, $this->constructorWithIFoo);\n $this->assertEquals($this->concreteFoo,\n $this->container->getBinding($this->fooInterface, $this->constructorWithIFoo));\n $this->assertNull($this->container->getBinding($this->fooInterface));\n }",
"public function bound(string $abstract): bool;",
"public function bind($interfaces, $concrete, $targetClass = null);",
"public function testFakeClassBinding_resolvesToCorrectBinding()\n {\n\n config()->set('id3.driver.name', 'ID3Adapter2');\n\n $ID3Manager = new ID3Manager(app());\n\n $ID3Manager->extend('ID3Adapter2', function () {\n return new ID3Adapter2();\n });\n\n $this->assertInstanceOf(\\App\\ID3\\Contracts\\ID3Contract::class, $ID3Manager->driver());\n $this->assertInstanceOf(ID3Adapter2::class, $ID3Manager->driver());\n }",
"public function bind($interface, $concrete);",
"public function testCheckingTargetHasBindingWhenItOnlyHasUniversalBinding()\n {\n $this->container->bindPrototype($this->fooInterface, $this->concreteFoo);\n $this->container->for($this->constructorWithIFoo, function (IContainer $container) {\n $this->assertTrue($container->hasBinding($this->fooInterface));\n });\n }",
"public function override()\n {\n $binder = new stubBinder();\n $binder->bind('stubInjectorImplementedByTestCase_Person')->to('stubInjectorImplementedByTestCase_Mikey');\n $injector = $binder->getInjector();\n $person = $injector->getInstance('stubInjectorImplementedByTestCase_Person');\n $this->assertInstanceOf('stubInjectorImplementedByTestCase_Mikey', $person);\n }",
"public function bound($abstract)\r\n {\r\n return isset($this->bindings[$abstract]) || isset($this->instances[$abstract]);\r\n }",
"public function testUniversallyBindingInstanceToInterface()\n {\n $instance = new $this->concreteFoo();\n $this->container->bind($this->fooInterface, $instance);\n $this->assertSame($instance, $this->container->makeShared($this->fooInterface));\n $this->assertSame($instance, $this->container->makeShared($this->concreteFoo));\n }",
"function bound($abstract, $context = self::GLOBAL_CONTEXT)\n {\n return (isset($this->bindings[$context][$abstract]) || isset($this->singletons[$context][$abstract]));\n }",
"public function bindValue(string $abstract, $concrete);",
"public function testCreatingPrototypeInstanceWithConcreteDependency()\n {\n $newInstance = $this->container->resolve($this->constructorWithConcreteClass);\n $this->assertInstanceOf($this->constructorWithConcreteClass, $newInstance);\n }",
"public function testMakingNewForTarget()\n {\n $this->container->bind($this->fooInterface, $this->concreteFoo, $this->constructorWithIFoo);\n $instance1 = $this->container->makeNew($this->fooInterface, $this->constructorWithIFoo);\n $instance2 = $this->container->makeNew($this->fooInterface, $this->constructorWithIFoo);\n $this->assertInstanceOf($this->concreteFoo, $instance1);\n $this->assertInstanceOf($this->concreteFoo, $instance2);\n $this->assertNotSame($instance1, $instance2);\n }",
"public function bound($abstract)\n {\n return isset($this->bindings[$abstract]) || isset($this->instances[$abstract]) || isset($this->aliases[$abstract]);\n }",
"abstract protected function getMockedClass();",
"public function bound($abstract)\n {\n return isset($this->bindings[$abstract]) ||\n isset($this->instances[$abstract]) ||\n isset($this->aliases[$abstract]);\n }",
"public function testBaseClassAndImplementedInterfaces()\n {\n $target = new EmployeeFieldset();\n\n $this->assertInstanceOf('\\Zend\\Form\\Fieldset', $target);\n $this->assertInstanceOf('\\Core\\Form\\ViewPartialProviderInterface', $target);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Connect to the remote server. This is not asynchronous at the current time though it appears to be suported (via flag options). | public function connect()
{
$errno = 0;
$errstr = '';
$this->s = stream_socket_client($this->transport."://".$this->host.":".$this->port
,$errno
,$errstr
,$this->timeout
,STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT);
$this->status = 'connected';
if ( $errno )
{
$this->error = $errno;
$this->status = 'connect failed: $errrstr ($errno)';
}
return $this->error;
} | [
"public function connect()\n\t{\n\t\t/**\n\t\t * There is no point attempting to connect if we are already connected.\n\t\t */\n\t\tif( $this->connection !== null )\n\t\t\treturn;\n\n\t\t/**\n\t\t * Attempt to connect to the server.\n\t\t */\n\t\tif( ($this->connection = fsockopen($this->host, $this->port, $errno, $errstr, self::SOCKET_TIMEOUT)) === false ) {\n\t\t\t$this->connection = null;\n\t\t\tthrow new \\RuntimeException(sprintf('Failed to connect to VarnishAdm: %s (%d)', $errstr, $errno));\n\t\t}\n\n\t\t/**\n\t\t * Set the socket to be blocking, and set a read/write timeout.\n\t\t */\n\t\tstream_set_blocking($this->connection, 1);\n\t\tstream_set_timeout($this->connection, self::SOCKET_TIMEOUT);\n\n\t\t$response = $this->read($statusCode);\n\t\tif( $statusCode === self::CLIS_AUTH )\n\t\t\t$response = $this->authenticate(substr($response, 0, 32), $statusCode);\n\t\tif( $statusCode !== self::CLIS_OK ) {\n\t\t\t$this->disconnect();\n\t\t\tthrow new \\RuntimeException(sprintf('VarnishAdm returned an invalid status code upon connecting: %d.', $statusCode));\n\t\t}\n\t}",
"public function connect() {\n\t\tif (!is_resource($this->conn)) {\n\t\t\t$this->conn = stream_socket_client('tcp://' . $this->host . ':' . $this->port, $errno, $errstr);\n\t\t\tif (!$this->conn) {\n\t\t\t\tthrow new RuntimeException($errstr, $errno);\n\t\t\t}\n\t\t\tstream_set_timeout($this->conn, $this->socketTimeout);\n\t\t\tstream_set_read_buffer($this->conn, $this->socketBufferSize);\n\t\t\tstream_set_write_buffer($this->conn, $this->socketBufferSize);\n\t\t\t//echo \"\\nConnected to \".$this->host.\":\".$this->port.\"\\n\";\n\t\t}\n\t}",
"public function connect()\n {\n $connected = false;\n $retry = 0;\n while (!$connected) {\n try {\n $connected = $this->protocol === self::PROTOCOL_HTTP ?\n $this->httpInit() : $this->binaryConnect($this->serviceURLs[$this->environment]);\n } catch (Exception $e) {\n $this->logger()->error($e->getMessage());\n if ($retry >= $this->connectRetryTimes) {\n throw $e;\n } else {\n $this->logger()->info(\n \"Retry to connect (\" . ($retry + 1) .\n \"/{$this->connectRetryTimes})...\"\n );\n usleep($this->connectRetryInterval);\n }\n }\n $retry++;\n }\n }",
"public function connect() {\n if ($this->client) {\n $this->client->connect();\n }\n }",
"protected function connect()\n {\n $url = $this->createUrl(\"\");\n // create curl resource\n $this->connection = curl_init();\n\n // set url\n curl_setopt($this->connection, CURLOPT_URL, $url);\n\n //return the transfer as a string\n curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, 1);\n\n }",
"public function connect()\n {\n if (isset($this->connection)) {\n $this->connection->connect();\n } else {\n if (!isset($this->socket)) {\n if (!$socket = fsockopen(\n $this->getHostString(), $this->port, $errno, $errstr, $this->timeout)) {\n throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to connect to POP3 host [%s]: %s', $this->host, $errstr));\n }\n $this->socket = $socket;\n\n if (false === $greeting = fgets($this->socket)) {\n throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to connect to POP3 host [%s]', trim($greeting ?? '')));\n }\n\n $this->assertOk($greeting);\n\n if ($this->username) {\n $this->command(sprintf(\"USER %s\\r\\n\", $this->username));\n $this->command(sprintf(\"PASS %s\\r\\n\", $this->password));\n }\n }\n }\n }",
"protected function connect()\n\t{\n\t\t$hostname = $this->getHostname();\n\t\t$port = $this->getPort();\n\t\t$timeout = $this->getTimeout();\n\n\t\t// Connect to server\n\t\t$errno = null;\n\t\t$errstr = null;\n\t\t$socket = @fsockopen('tcp://' . $hostname, $port, $errno, $errstr, $timeout);\n\t\t$this->lastError = $errstr;\n\t\treturn $socket;\n\t}",
"public function connect(): void\n {\n $this->getSocket();\n }",
"private function connect()\n\t{\n\t\t$this->serv->on('connect', function ($serv, $fd){ \n\t\t\techo \"Client:Connect.\\n\";\n\t\t});\t\t\n\t}",
"private function connect(){\n try {\n $server = new FtpServer( $this->get_option( 'server_ip' ), $this->get_option( 'server_port' ) );\n $server->login( $this->get_option('user_name'), $this->get_option('user_pass') );\n $server->turnPassive();\n $this->session = $server;\n } catch (Exception $e) {\n error_log( $e->getMessage() );\n }\n }",
"public function connect()\n\t{\n\t\tif ($this->ssl)\n\t\t{\n\t\t\t$this->connection = ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->connection = ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout());\n\t\t}\n\n\t\tif (!$this->connection)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('Could not connect to host: %s, port: %s', $this->getHost(), $this->getPort()));\n\t\t}\n\n\t\t$this->login();\n\t\t$this->setConnectionPassiveMode();\n\t\t$this->setConnectionRoot();\n\t}",
"function connect() {\n if (!$this->handle) {\n // connect to the mail relay server\n $this->handle = fsockopen($this->server, $this->port);\n fgets($this->handle, 4096);\n // begin the SMTP handshake\n $this->say(\"HELO \".$_SERVER['SERVER_ADDR'];\n $this->authenticate();\n }\n }",
"protected function connect() {\n\t\t$server = stream_socket_client(\"tcp://localhost:{$this->port}\", $errno, $errstr, 5);\n\t\tif (is_resource($server)) {\n\t\t\t$this->server = $server;\n\t\t} else {\n\t\t\tthrow new \\RuntimeException(\"could not connect to webkit_server\");\n\t\t}\n\t}",
"public function connect() {\r\n // Initialize the connection by fetching data we need.\r\n $this->init();\r\n\r\n // Create the connection.\r\n $this->createConnection();\r\n $this->startWebsocketServer();\r\n\r\n // Test the connection.\r\n $this->test();\r\n }",
"public function connect() {\n $this->connection = AMQPStreamConnection($this->server_ip, $this->server_port, $this->username, $this->password);\n }",
"public function connect() {\r\n // create a socket\r\n if (($this->m_oSocket = socket_create(AF_INET,SOCK_STREAM, SOL_TCP)) === false) {\r\n return false;\r\n }\r\n // connect it\r\n \r\n if (@socket_connect($this->m_oSocket, $this->m_sAddress, $this->m_iPort) === false) {\r\n $this->m_oSocket = false;\r\n return false;\r\n }\r\n // send authentication request\r\n $this->rawPacketSend($this->m_sPassword, null, self::SERVERDATA_AUTH);\r\n // read the response\r\n $aResult = $this->rawPacketRead();\r\n // check if we authenticated succesfully\r\n if(isset($aResult[0])){\r\n if ($aResult[0]['CommandResponse'] != self::SERVERDATA_AUTH_RESPONSE) {\r\n $this->__destruct();\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }else{\r\n $this->connect();\r\n }\r\n \r\n }",
"protected function _connect()\n {\n $socket = @fsockopen($this->_timeserver, $this->_port, $errno, $errstr,\n TimeSync::$options['timeout']);\n if ($socket === false) {\n throw new Exception('could not connect to ' .\n \"'$this->_timeserver' on port '$this->_port', reason: '$errstr'\");\n }\n\n $this->_socket = $socket;\n }",
"function connect() {\n $this->state = 'connecting';\n\n if ($this->ipv == 4) {\n $this->sock = $this->pSockets->createTCP($this, 'handleRead', 'handleError', 1, 'handleConnected', 1, $this->bind);\n } else {\n $this->sock = $this->pSockets->createTCPv6($this, 'handleRead', 'handleError', 1, 'handleConnected', 1, $this->bind);\n }\n\n if (!$this->sock) {\n die(\"IRC Couldn't create socket\");\n }\n\n //TODO Make this config variable\n $this->pSockets->setReconTime($this->sock, 65);\n\n $a = $this->pSockets->getOurAddr($this->sock);\n $p = $this->pSockets->getOurPort($this->sock);\n\n echo \"IRC Local IP/PORT: $a/$p\\n\";\n echo \"IRC Connecting to Host: $this->server Port: $this->port IPv$this->ipv\\n\";\n\n if (!$this->pSockets->connect($this->sock, $this->server, $this->port, $this->timeout)) {\n list($errno, $errstr) = $this->pSockets->getLastErr($this->sock);\n echo \"IRC Error connecting [$errno] $errstr (ignoring)\\n\";\n }\n\n $this->pSockets->setRTO($this->RTO, $this->sock);\n }",
"function connect () {\n $context = stream_context_create($this->context);\n $flags = $this->getFlags();\n\n $this->sock = stream_socket_client($this->url, $errno, $errstr, \n ini_get(\"default_socket_timeout\"), \n $flags, $context);\n\n if (! $this->sock) {\n throw new \\Exception(\"Failed to connect stream socket {$this->url}, ($errno, $errstr): flags $flags\", 7568);\n } else if (($flags & STREAM_CLIENT_PERSISTENT) && $this->stfp > 0) {\n $this->stfp = ftell($this->sock);\n foreach (self::$All as $sock) {\n if ($sock !== $this && $sock->getCK() == $this->getCK()) {\n /* TODO: Investigate whether mixing persistent and\n * non-persistent connections to the same URL can\n * provoke errors. */\n $this->sock = null;\n throw new \\Exception(sprintf(\"Stream socket connection created a new wrapper object for \" .\n \"an existing persistent connection on URL %s\", $this->url), 8164);\n }\n }\n }\n if (! stream_set_blocking($this->sock, 0)) {\n throw new \\Exception(\"Failed to place stream connection in non-blocking mode\", 2795);\n }\n $this->connected = true;\n self::$All[] = $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function used to save ipn transaction | function saveIpnTransaction($data){
$user_id = $data['user_id'];
//$email = $data['email'];
$txn_id = $data['txn_id'];
$this->db->select('*');
$this->db->where('user_id',$user_id);
//$this->db->where('email',$email);
$this->db->where('txn_id',$txn_id);
$check = $this->db->get(DB_PREFIX.'transaction')->row_array();
if(!empty($check)){
$this->db->where('user_id',$user_id);
//$this->db->where('email',$email);
$this->db->where('txn_id',$txn_id);
$return = $this->db->update(DB_PREFIX.'transaction',$data);
return $check['id'];
}else{
$return = $this->db->insert(DB_PREFIX.'transaction',$data);
return $this->db->insert_id();
}
} | [
"public function save() {\n $transaction = $this->transaction;\n $transaction->changed = REQUEST_TIME;\n\n $transaction_array = array(\n 'transaction_id' => $transaction->transactionId,\n 'uid' => $transaction->uid,\n 'cashier' => $transaction->cashier,\n 'order_id' => $transaction->orderId,\n 'type' => $transaction->type,\n 'data' => $transaction->data,\n 'register_id' => $transaction->registerId,\n 'changed' => $transaction->changed,\n 'created' => $transaction->created,\n 'completed' => $transaction->completed,\n );\n\n if ($transaction->transactionId) {\n $primary_keys = 'transaction_id';\n }\n else {\n $primary_keys = array();\n }\n\n drupal_write_record($transaction::TABLE_NAME, $transaction_array, $primary_keys);\n $transaction->transactionId = $transaction_array['transaction_id'];\n unset($transaction_array);\n }",
"public function saveTransaction()\n {\n }",
"public function saveTransaction()\n {\n $transaction = new Transaction();\n $transaction->request_type = 'transaction';\n $transaction->unique_id = $this->id;\n $transaction->orderid = $this->uatPrefix . $this->reference;\n $transaction->response_format = $this->responseFormat;\n $transaction->request_payload = $this->list()->toJson();\n $transaction->save();\n }",
"function save() {\t\r\n\t\t//get names and values of all attributes\r\n\t\t$pairs = $this->_getPairs();\t\t\r\n\t\t//the sql statment to save the transaction\r\n\t\t$sql = '';\r\n\t\t//this is a new transaction\r\n\t\tif($this->transactionID == 0) {\r\n\t\t\t$fields = implode(',', array_keys($pairs));\r\n\t\t\t$values = implode(\"','\", array_values($pairs));\r\n\t\t\t$sql = 'INSERT INTO ' . TRANSACTION_TABLE . '(' . $fields . ') VALUES(\\'' .$values . '\\')';\r\n\t\t}\r\n\t\telse {\r\n\t\t\r\n\t\t\t$sql .= 'UPDATE ' . TRANSACTION_TABLE . ' SET ';\r\n\t\t\tforeach($pairs as $key=>$val) {\r\n\t\t\t\t$sql .= \"$key='$val', \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$sql = rtrim($sql, ', ') . ' WHERE transactionID = ' . $this->transactionID;\r\n\t\t}\r\n\t\tmysql_query($sql);\r\n\t\tprint mysql_error();\r\n\t\tprint \"<br>$sql<br>\";\r\n\t}",
"public function Save()\n\t{\n\t\t$_SESSION[self::TRANSACTION_IDENTIFIER] = serialize($this);\n\t}",
"public function saveTransaction()\n {\n $transaction = Transaction::where('request_type', 'mandate_token')->where(['unique_id' => $this->id])->firstOrNew();\n\n $transaction->request_type = 'mandate_token';\n $transaction->unique_id = $this->id;\n $transaction->orderid = $this->subscription_reference;\n $transaction->response_format = $this->responseFormat ?? 'HTML';\n $transaction->request_payload = $this->list()->toJson();\n\n if (isset($this->response)) {\n $transaction->request_payload = collect($this->response)->toJson();\n }\n\n $transaction->save();\n }",
"public function post_transaction( $transaction );",
"public function store()\n\t{\n\t\t$this->transaction->save(Input::all());\n\t}",
"function SaveTransaction($resArray){\r\n\t\r\n\t\t/*\r\n\t\t * TODO: Proceed with desired action after the payment \r\n\t\t * (ex: start download, start streaming, Add coins to the game.. etc)\r\n\t\t '********************************************************************************************************************\r\n\t\t '\r\n\t\t ' THE PARTNER SHOULD SAVE THE KEY TRANSACTION RELATED INFORMATION LIKE\r\n\t\t ' transactionId & orderTime\r\n\t\t ' IN THEIR OWN DATABASE\r\n\t\t ' AND THE REST OF THE INFORMATION CAN BE USED TO UNDERSTAND THE STATUS OF THE PAYMENT\r\n\t\t '\r\n\t\t '********************************************************************************************************************\r\n\t\t */\r\n\r\n\t\t$transactionId\t\t= $resArray[\"PAYMENTINFO_0_TRANSACTIONID\"]; // Unique transaction ID of the payment.\r\n\t\t$transactionType \t= $resArray[\"PAYMENTINFO_0_TRANSACTIONTYPE\"]; // The type of transaction Possible values: l cart l express-checkout\r\n\t\t$paymentType\t\t= $resArray[\"PAYMENTINFO_0_PAYMENTTYPE\"]; // Indicates whether the payment is instant or delayed. Possible values: l none l echeck l instant\r\n\t\t$orderTime \t\t\t= $resArray[\"PAYMENTINFO_0_ORDERTIME\"]; // Time/date stamp of payment\r\n\t\t$amt\t\t\t\t= $resArray[\"PAYMENTINFO_0_AMT\"]; // The final amount charged, including any taxes from your Merchant Profile.\r\n\t\t$currencyCode\t\t= $resArray[\"PAYMENTINFO_0_CURRENCYCODE\"]; // A three-character currency code for one of the currencies listed in PayPay-Supported Transactional Currencies. Default: USD.\r\n\t\t$feeAmt\t\t\t\t= $resArray[\"PAYMENTINFO_0_FEEAMT\"]; // PayPal fee amount charged for the transaction\r\n\t//\t$settleAmt\t\t\t= $resArray[\"PAYMENTINFO_0_SETTLEAMT\"]; // Amount deposited in your PayPal account after a currency conversion.\r\n\t\t$taxAmt\t\t\t\t= $resArray[\"PAYMENTINFO_0_TAXAMT\"]; // Tax charged on the transaction.\r\n\t//\t$exchangeRate\t\t= $resArray[\"PAYMENTINFO_0_EXCHANGERATE\"]; // Exchange rate if a currency conversion occurred. Relevant only if your are billing in their non-primary currency. If the customer chooses to pay with a currency other than the non-primary currency, the conversion occurs in the customer's account.\r\n\r\n\t\t/*\r\n\t\t ' Status of the payment:\r\n\t\t 'Completed: The payment has been completed, and the funds have been added successfully to your account balance.\r\n\t\t 'Pending: The payment is pending. See the PendingReason element for more information.\r\n\t\t */\r\n\r\n\t\t$paymentStatus = $resArray[\"PAYMENTINFO_0_PAYMENTSTATUS\"];\r\n\r\n\t\t/*\r\n\t\t 'The reason the payment is pending:\r\n\t\t ' none: No pending reason\r\n\t\t ' address: The payment is pending because your customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile.\r\n\t\t ' echeck: The payment is pending because it was made by an eCheck that has not yet cleared.\r\n\t\t ' intl: The payment is pending because you hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview.\r\n\t\t ' multi-currency: You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.\r\n\t\t ' verify: The payment is pending because you are not yet verified. You must verify your account before you can accept this payment.\r\n\t\t ' other: The payment is pending for a reason other than those listed above. For more information, contact PayPal customer service.\r\n\t\t */\r\n\r\n\t\t$pendingReason = $resArray[\"PAYMENTINFO_0_PENDINGREASON\"];\r\n\r\n\t\t/*\r\n\t\t 'The reason for a reversal if TransactionType is reversal:\r\n\t\t ' none: No reason code\r\n\t\t ' chargeback: A reversal has occurred on this transaction due to a chargeback by your customer.\r\n\t\t ' guarantee: A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.\r\n\t\t ' buyer-complaint: A reversal has occurred on this transaction due to a complaint about the transaction from your customer.\r\n\t\t ' refund: A reversal has occurred on this transaction because you have given the customer a refund.\r\n\t\t ' other: A reversal has occurred on this transaction due to a reason not listed above.\r\n\t\t */\r\n\r\n\t\t$reasonCode\t= $resArray[\"PAYMENTINFO_0_REASONCODE\"];\r\n\r\n\t\t\r\n\t\t// setup your DB connection to save it\r\n\t\t\r\n\t\t\t\r\n\t}",
"public function postIpn();",
"function writeTransactionDataToDB($user_email, $wrt_txn_id)\n{\n\t\n $registration = new Registration();\n\n $serialized_session = serialize($_SESSION);\n\n try \n {\n $db_connection = new PDO('mysql:host='. DB_HOST .';dbname='. DB_NAME . ';charset=utf8', DB_USER, DB_PASS, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING, PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n } \n catch (PDOException $e) \n {\n echo 'Connection failed: ' . $e->getMessage();\n exit;\n }\n\n #TODO - change it to Europe/Vienna for server\n // $query_time_zone = $db_connection->prepare(\"SET time_zone = 'Europe/Vienna'\");\n $query_time_zone = $db_connection->prepare(\"SET time_zone = '+2:00'\");\n $query_time_zone->execute();\n\n\n $paypal_to_db_query = $db_connection->prepare(\n \"INSERT INTO transactions\n (\n user_email,\n wrt_txn_id,\n session_data, \n attempt_datetime\n )\n VALUES\n ( \n :user_email,\n :wrt_txn_id,\n :session_data, \n now()\n )\n \");\n\n $paypal_to_db_query->bindValue(':user_email', $user_email, PDO::PARAM_STR);\n $paypal_to_db_query->bindValue(':wrt_txn_id', $wrt_txn_id, PDO::PARAM_STR);\n $paypal_to_db_query->bindValue(':session_data', $serialized_session, PDO::PARAM_STR);\n $paypal_to_db_query->execute();\n\n if($paypal_to_db_query->errorCode() != 0) echo \"wat \".$paypal_to_db_query->errorInfo();\n return true;\n\n\n}",
"abstract protected function onResourceTransactionIpn(Payment_Model_Order $order, Engine_Payment_Ipn $ipn);",
"function CommitTrans() {\n global $mdbd;\n global $database;\n global $lang;\n global $DOCUMENT_ROOT;\n\n // wyciagnij w bazy danych wszystkie transakcje do przelania do interia\n $data=$mdbd->select(\"order_id\",\"order_register\",\"confirm=1 AND confirm_partner=1 AND partner_name='interia'\",\"\",\"\",\"array\");\n // jesli sa jakies dane do wyslania\n if(!empty($data)) {\n // naglowek komunikatu soap\n $str=$this->_interia_get_head();\n // komunikat glowny\n $str.=$this->_interia_commit_roll_trans(\"CommitTransactions\", $data);\n // stopka komunikatu soap\n $str.=$this->_interia_get_foot();\n // zapisz xml w pliku\n if($str) {\n $file=$DOCUMENT_ROOT.\"/tmp/commit.xml\";\n if ($fd=@fopen($file,\"w+\")) {\n fwrite($fd,$str,strlen($str));\n fclose($fd);\n }\n }\n //wyslij oferte na serwer\n $content=$this->soap->send_soap_category($str);\n\n // zapisz zwrotna informacje do bazy danych\n $this->_insert_info_db(\"CommitTransaction\",'TRANS_ID');\n\n // sparsuj odpowiedz serwera interia\n $this->_interia_send_request($content,'trans');\n\n // zapisz zwrotna informacje do bazy danych\n $this->_insert_info_db(\"CommitTransaction\",'TRANS_ID');\n // analizuj komunikat zwrotny i dodaj odpowiednie interiaisy do bazy danych\n foreach($this->_tags['TRANS_ID'] as $key=>$value) {\n $order_id=$this->_values[$this->_tags['TRANS_ID'][$key]]['value'];\n // zapisz informacje o tym ze transakcja zostala wyslana i potwiedzona w tablicy order_register\n if($this->_values[$this->_tags['RES'][$key]]['value'] == 0 ) {\n // transakcja zostala poprawnie zalogowana\n $mdbd->update(\"order_register\",\"confirm_partner=?\",\"order_id=?\",array(\"3\"=>\"int\",$order_id=>\"int\"));\n print \"<br>Transkacja <b>$order_id</b> zalogowana poprawnie\";\n } else {\n // transakcja nie zostala zalogowana poprawnie\n $mdbd->update(\"order_register\",\"confirm_partner=?\",\"order_id=?\",array(\"-1\"=>\"int\",$order_id=>\"int\"));\n print \"<br>Transkacja <b>$order_id</b> zalogowana niepoprawnie.<font color=red><b> Błąd !!! </b></font>\";\n }\n }\n }\n return true;\n }",
"function save_transfer($post){\n\t\t$qty = $post['base_qty']-$post['qty_transfered'];\n\t\t$updatedDt = date('Y-m-d H:i:s');\n\t\t$updatedBy = $this->user['id'];\n\t\t$this->db->query(\"update inventory_workshop set qty=\".$qty.\", qty_out = greatest(qty_out + (cast(\".floatval($post['qty_transfered']).\" as float))),\n\t\t\tupdated_by=\".$updatedBy.\", updated_dt='\".$updatedDt.\"', total_out = total_out+(\".$post['qty_transfered'].\" * \".$post['cost_lalu'].\") \n\t\t\twhere id_workshop=\".$post['pool_approved'].\" and id_sparepart=\".$post['id_sparepart'].\" ;\");\n\t\t\n\t\t$kode = $this->get_kode_workshop();\n\t\t$sequence = 'rr_number_'.strtolower($kode).'_id_seq';\n\t\t$res_exist = $this->db->query(\"SELECT relname FROM pg_class where relname = '\".$sequence.\"'\")->row_array();\n\n\t\tif(Count($res_exist) < 1){\n\t\t\t//CREATE NEW SEQUENCE\n\t\t\t$this->db->query(\"create sequence \".$sequence.\" start 1;\");\n\t\t}\n\n\t\t//SAVE TRANSFER BETWEEN WORKSHOP\n\t\t$save['no_rr'] = $this->db->query(\"select ('\".$kode.\"RR' || \n\t\t\tlpad((nextval('\".$sequence.\"'))::text, 10, '0')) as no_rr\")->row_array()['no_rr'];\n\t\t$save['qty_transfered'] = $post['qty_transfered'];\n\t\t$save['status'] = 'APPROVE';\n\t\t$save['tranfered_by'] = $post['created_by'];\n\t\t$save['note_transfered'] = $post['note_transfered'];\n\t\t$save['transfered_dt'] = date('Y-m-d H:i:s');\n\t\t$save['cost'] = $post['cost_lalu'];\n\t\t$res = $this->db->where('id', $post['id'])->update('transfer_between_warehouse', $save);\n\n\t\t//SAVE LOG\n\t\t$saveLog['id_inventory'] = $post['id_inventory'];\n\t\t$saveLog['base_qty'] = $post['base_qty'];\n\t\t$saveLog['var_qty'] = -$post['qty_transfered'];\n\t\t//$saveLog['var_qty'] = 0;\n\t\t$saveLog['out_antar_gudang'] = $post['qty_transfered'];\n\t\t$saveLog['final_qty'] = $post['base_qty']-$post['qty_transfered'];\n\t\t$saveLog['nomor_referensi'] = $save['no_rr'];\n\t\t$saveLog['input_by'] = $this->user['id'];\n\t\t$saveLog['created_dt'] = date('Y-m-d H:i:s');\n\t\t$saveLog['harga_satuan_jual_beli'] = $post['cost_lalu'];\n\t\t$saveLog['harga_beli'] = $post['cost_lalu']*$post['qty_transfered'];\n\t\t$resLog = $this->db->insert('log_inventory_stock', $saveLog);\n\n\t\treturn $post['id'];\n\t}",
"public function save()\n {\n\n $this->accounts_repository->create([\n 'type' => $this->type,\n 'account_number' => $this->account_number,\n 'customer_id' => $this->customer_id,\n 'branch_id' => $this->branch_id,\n 'balance' => $this->balance\n ]);\n }",
"public function save()\n {\n $this->accounts_repository->create([\n 'account_number' => $this->accountNumber,\n 'type' => $this->type,\n 'branch_id' => $this->branch_id,\n 'customer_id' => $this->customer_id,\n 'balance' => $this->balance,\n ]);\n }",
"function saveTransaction($transactionString){\n file_put_contents(\"transactions.txt\", $transactionString.\"\\n\", FILE_APPEND);\n}",
"public function ipnAction()\n {\n if (!$this->getRequest()->isPost()) {\n return;\n }\n \n try {\n $data = $this->getRequest()->getPost();\n $ipnModel = Mage::getModel('innobyte_payu_lite/ipn', $data)->processIpnRequest();\n /* compose return message */\n $ipnPid = $ipnModel->getRequestData('IPN_PID');\n $ipnPname = $ipnModel->getRequestData('IPN_PNAME');\n $ipnDate = $ipnModel->getRequestData('IPN_DATE');\n $date = Mage::getModel('core/date')->date('YmdHis');\n $hash = $ipnModel->getDataHelper()->hmacMd5(\n $ipnModel->getConfig()->getTransactionKey(),\n array(\n $ipnPid[0],\n $ipnPname[0],\n $ipnDate,\n $date,\n )\n );\n $this->getResponse()->setBody('<EPAYMENT>' . $date . '|' . $hash . '</EPAYMENT>');\n } catch (Mage_Core_Exception $e) {\n $this->getResponse()->setHttpResponseCode(500);\n $this->getResponse()->setBody($e->getMessage());\n } catch (Exception $e) {\n $this->getResponse()->setHttpResponseCode(500);\n $this->getResponse()->setBody(Mage::helper('innobyte_payu_lite')->__('An error occurred.'));\n Mage::logException($e);\n }\n }",
"function pmpro_insSaveOrder( $txn_id, $last_order ) {\n\t\tglobal $wpdb;\n\n\t\t//check that txn_id has not been previously processed\n\t\t$old_txn = $wpdb->get_var(\"SELECT payment_transaction_id FROM $wpdb->pmpro_membership_orders WHERE payment_transaction_id = '\" . $txn_id . \"' LIMIT 1\");\n\n\t\tif( empty( $old_txn ) ) {\n\n\t\t\t//save order\n\t\t\t$morder = new MemberOrder();\n\t\t\t$morder->user_id = $last_order->user_id;\n\t\t\t$morder->membership_id = $last_order->membership_id;\n\t\t\t$morder->payment_transaction_id = $txn_id;\n\t\t\t$morder->subscription_transaction_id = $last_order->subscription_transaction_id;\n\t\t\t$morder->InitialPayment = $_POST['item_list_amount_1'];\t//not the initial payment, but the class is expecting that\n\t\t\t$morder->PaymentAmount = $_POST['item_list_amount_1'];\n\n\t\t\t$morder->FirstName = $_POST['customer_first_name'];\n\t\t\t$morder->LastName = $_POST['customer_last_name'];\n\t\t\t$morder->Email = $_POST['customer_email'];\n\n\t\t\t$morder->gateway = $last_order->gateway;\n\t\t\t$morder->gateway_environment = $last_order->gateway_environment;\n\n\t\t\t//save\n\t\t\t$morder->saveOrder();\n\t\t\t$morder->getMemberOrderByID( $morder->id );\n\n\t\t\t//email the user their invoice\n\t\t\t$pmproemail = new PMProEmail();\n\t\t\t$pmproemail->sendInvoiceEmail( get_userdata( $last_order->user_id ), $morder );\n\n\t\t\tinslog( \"New order (\" . $morder->code . \") created.\" );\n\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tinslog( \"Duplicate Transaction ID: \" . $txn_id );\n\t\t\treturn false;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a newly created inscription in storage. | public function store(CreateinscriptionRequest $request)
{
$input = $request->all();
$inscription = $this->inscriptionRepository->store($input);
$inscriptions = DB::table('inscriptions')->get();
$nbr = DB::table('inscriptions')->count();
if($nbr%10==0){
// send email
$email="belaidzouhair@gmail.com";
$email2="Samri.manar@gmail.com";
Mail::send('emails.contact', ['email' => $email,'email2' => $email2,'nbr' =>$nbr,'inscriptions'=> $inscriptions], function($message) use ($email,$email2,$nbr,$inscriptions)
{
$message->to($email2)->subject('workshop nbr: '.$nbr);
$message->to($email)->subject('workshop nbr: '.$nbr);
});
}
Flash::message('inscription saved successfully.');
return view('inscriptions.merci')->with('inscription', $inscription);
} | [
"public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}",
"public function store()\n\t{\n\t\t$this->transaction->save(Input::all());\n\t}",
"public function store()\n {\n\n $data = Input::all();\n\n $result = Prescription::savePrescription($data);\n return $result;\n\n\n }",
"public function store()\n\t{\n\t\t$credentianls=Input::all();\n\t\t$validator = Validator::make($credentianls, Subscription::$rules);\n\t\tif($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t}\n\t\t$subscription=Subscription::create($credentianls);\n\t}",
"public function createAction()\n {\n $entity = new Inscription();\n $request = $this->getRequest();\n\t\t\t\t$user = $this->get('security.context')->getToken()->getUser();\n $form = $this->createForm(new InscriptionType(), $entity, array('user' => $user));\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n\t\t\t\t\t\t$em->flush();\n\t\t\t\t\t\n \t\t\t\t\t\t$this->get('session')->set('inscription_id', $entity->getId());\n\t\t\t\t\t\t$this->get('session')->setFlash('notice', 'Inscription a été ajoutée avec succès');\n return $this->redirect($this->generateUrl('paiement_new', array('inscription_id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function store()\n\t{\n\t\t$credentials=Input::all();\n\t\t$credentials['institute_user_id']=Auth::id();\n\t\t$credentials['institute_url'] = str_replace(' ', '-', $credentials['institute']);\n\t\t$validator = Validator::make($credentials, Institute::$rules);\n\t\tif($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t}\n\t\t$created=Institute::create($credentials);\n\t\t// dd($created->id);\n\t\tif ($created)\n\t\t\treturn Redirect::intended('/institutes/show/'.$created->id)->with('success',Lang::get('institute.institute_created'));\n\t\telse\n\t\t\treturn Redirect::back()->withInput()->with('failure',Lang::get('institute.institute_create_failed'));\n\t}",
"protected function insert()\n\t{\n\t\ttry {\n\t\t\t$this->subscription = Subscription::create([\n\t\t\t\t'user_id' => $this->user->id,\n\t\t\t\t'category_id' => $this->data('category_id'),\n\t\t\t\t'region_id' => $this->data('region_id'),\n\t\t\t\t'city_id' => $this->data('city_id'),\n\t\t\t]);\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->setError('Could not insert the subscription into storage.', 500);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function store()\n {\n $input = request()->all();\n\n $tpDocumentIdent = TpDocumentIdent::create($input);\n\n Flash::success('Documento Identidad guardado exitosamente.');\n\n return redirect(route('tp-documentos-identidad.index'));\n }",
"public function persist() {\n Album::create([\n 'slug' => str_slug(request()->title, \"-\"),\n 'title' => htmlspecialchars(request()->title),\n 'artist' => htmlspecialchars(request()->artist),\n ]);\n }",
"public function store()\n\t{\n\t\t$note = new Note(array(\n 'note' => Input::get('note'),\n 'video_id' => Input::get('video_id'),\n 'user' => Input::get('user')\n\t\t));\t\n\n\t\t$id = Input::get('cuepoint_id');\n\t\t$cuepoint = Cuepoint::find($id);\n\t\t$cuepoint_note = $cuepoint->note();\n\n\t\treturn \t$cuepoint_note->save($note);\n/*\n\t\treturn Note::create(array(\n\t\t\t'note' => Input::get('note'),\n\t\t\t'cuepoint_id' => Input::get('cuepoint_id')\n ));\t\n*/\n\t}",
"public function store(CreateAlianzaRequest $request)\n {\n \n return $this->storeUpdate($request, 'store', '');\n }",
"function store(){\r\n\t\t//store to file\r\n\t}",
"public function store(CreateItenRequest $request)\n {\n $input = $request->all();\n\n $iten = $this->itenRepository->create($input);\n\n Flash::success('Iten saved successfully.');\n\n return redirect(route('itens.index'));\n }",
"private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }",
"public function store(CreateIndiceRequest $request)\n {\n $input = $request->all();\n\n $indice = $this->indiceRepository->create($input);\n\n Flash::success('Indice salvo.');\n\n return redirect(route('indices.index'));\n }",
"public function persist()\n {\n $filename = $this->getCacheFilename();\n $data = json_encode($this->attendees);\n\n file_put_contents($filename, $data);\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Tic::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tTic::create($data);\n\n\t\treturn Redirect::route('tics.index');\n\t}",
"public function store(CreateInscripcionRequest $request)\n {\n try {\n DB::beginTransaction();\n $input = $request->all();\n /** @var Inscripcion $inscripcion */\n $inscripcion = Inscripcion::create($input);\n if($request->file('tarjeta_propiedad')){\n \n $path = Storage::disk('public')->put('tarjetas_propiedad',$request->file('tarjeta_propiedad'));\n $inscripcion->fill(['tarjeta_propiedad'=>asset($path)])->save();\n }\n if($request->file('soat_afocat')){\n \n $path = Storage::disk('public')->put('soats_afocats',$request->file('soat_afocat'));\n $inscripcion->fill(['soat_afocat'=>asset($path)])->save();\n }\n if($request->file('certificado_gps')){\n \n $path = Storage::disk('public')->put('certificados_gps',$request->file('certificado_gps'));\n $inscripcion->fill(['certificado_gps'=>asset($path)])->save();\n }\n if($request->file('certificado_gas')){\n \n $path = Storage::disk('public')->put('certificados_gas',$request->file('certificado_gas'));\n $inscripcion->fill(['certificado_gas'=>asset($path)])->save();\n }\n if($request->file('revision_tecnica')){\n \n $path = Storage::disk('public')->put('revisiones_tecnicas',$request->file('revision_tecnica'));\n $inscripcion->fill(['revision_tecnica'=>asset($path)])->save();\n }\n \n if($request->estado==\"1\"){}\n $vehiculo = Vehiculo::create([\n 'placa' => $request->placa,\n 'color' => $request->color,\n 'marca' => $request->marca,\n 'modelo' => $request->modelo,\n 'inscripcion_id' => $inscripcion->id\n ]);\n return $vehiculo;\n DB::commit();\n Flash::success(__('messages.saved', ['model' => __('models/inscripcions.singular')]));\n return redirect(route('inscripcions.index'));\n } catch (\\Throwable $th) {\n Flash::error(__('messages.error'));\n dd($th);\n return redirect(route('inscripcions.index'));\n }\n \n }",
"public function store()\n {\n // armazena a venda\n parent::store();\n // percorre os itens da venda\n foreach ($this->itens as $item)\n {\n $item->id_venda = $this->id;\n // armazena o item\n $item->store();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the path to a localized Markdown resource. | public static function localizedMarkdownPath(string $name): ?string
{
$localName = preg_replace('#(\.md)$#i', '.'.app()->getLocale().'$1', $name);
return Arr::first([
resource_path('markdown/'.$localName),
resource_path('markdown/'.$name),
], static function ($path) {
return file_exists($path);
});
} | [
"public function getPath()\n {\n return $this->path ?: __DIR__ . '/locales';\n }",
"public function setPath()\n\t{\n\t\t$title = preg_replace(\"/[^a-zA-Z0-9]+/\", \" \", $this->properties['title']);\n\t\t$title = preg_replace('!\\s+!', ' ', trim($title));\n\n\t\treturn $this->config['dir']['page'] . '/' . str_replace(\" \", \"-\", strtolower($title) ) . '.markdown';\n\t}",
"public function langPath()\n {\n return $this->resourcePath().DIRECTORY_SEPARATOR.'lang';\n }",
"protected function getPathToCommonmark(): string\n {\n return \\realpath(__DIR__ . '/../bin/html-to-markdown');\n }",
"public static function get_path()\n\t{\n\t\t$filename = Arr::get(self::options(), '_file', 'validate');\n\t\t$lang = str_replace('-', DIRECTORY_SEPARATOR, I18n::$lang);\n\t\t$file = $lang.DIRECTORY_SEPARATOR.$filename;\n\n\t\t$path = Kohana::find_file('messages', $file);\n\t\tif (empty($path))\n\t\t{\n\t\t\tlist($lang) = explode(DIRECTORY_SEPARATOR, $lang);\n\t\t\t$file = $lang.DIRECTORY_SEPARATOR.$filename;\n\t\t\t$path = Kohana::find_file('messages', $file);\n\t\t}\n\t\tif (empty($path))\n\t\t{\n\t\t\t$file = $filename;\n\t\t\t$path = Kohana::find_file('messages', $file);\n\t\t}\n\t\tif (empty($path))\n\t\t{\n\t\t\t$file = NULL;\n\t\t}\n\t\treturn $file;\n\t}",
"public function langPath()\n {\n return $this->resourcePath() . DIRECTORY_SEPARATOR . 'lang';\n }",
"private function getTranslationsPath()\n {\n $root = $this->getContainer()->get('kernel')->getRootdir();\n\n return $root.'/../vendor/matatirosoln/filemaker-data-api-bundle/Resources/translations';\n }",
"function getResourceName($resourceId, $localePreference) {\n $system = new System();\n $styleDir = $system->getConfig(\"styleDir\");\n\n // get locale preferences\n $localePreferences = explode(\",\", $localePreference);\n\n // get all usable locales from locale hierarchies\n $locales = array();\n for($i = 0; $i < count($localePreferences); $i++) {\n $localeHierarchy = _Stylist_getLocaleHierarchy($localePreferences[$i]);\n $locales = array_merge($locales, array_reverse($localeHierarchy));\n }\n\n // search locale-insensitive file at the end\n $locales[] = \"\";\n\n // extensions we honor\n $extensions = array(\"xml\", \"XML\");\n\n // search through extensions\n for($i = 0; $i < count($extensions); $i++)\n // search through the hierarchies of locales\n for($j = 0; $j < count($locales); $j++) {\n\t$fileName = \"$styleDir/$resourceId.$extensions[$i]\";\n\t// add locale to the end of the file name if necessary\n\tif($locales[$j] != \"\")\n\t $fileName .= \".$locales[$j]\";\n\n\t// return the name stored in the file if it exists\n\tif(is_file($fileName)) {\n\t return(_Stylist_getResourceId($fileName, $localePreference));\n\t}\n } \n\n \n // not found\n return \"\";\n }",
"public function langPath()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'lang';\n }",
"public function getDocumentationPath();",
"protected function getTranslationsPath()\n {\n return $this->getResourcesPath().DS.'lang';\n }",
"static function get_path($package)\n {\n if (!pkg::exists($package))\n throw new exception\\i18n(\"No such package: `{$package}`.\", 10);\n\n $meta = pkg::get_meta($package);\n $path = arrp::get($meta, 'i18n.path', 'assets/i18n');\n\n return fs::pkgreal($package, $path);\n }",
"public function getTemplate()\n {\n return basename($this->path, '.md');\n }",
"function micro_get_theme_path_for( string $resource )\n{\n global $app;\n return $app->getThemePathFor($resource);\n}",
"function dashboard_locale_path($locale)\n{\n return srcpath(\"locales/{$locale}/{$locale}.php\");\n}",
"function translatePath($path) {\n global $synAdminPath;\n if (strpos($path,\"§syntaxRelativePath§\")!==false) $path=str_replace(\"§syntaxRelativePath§\",$synAdminPath,$path);\n return $path;\n }",
"public function getRelativePageUrlPath() {\n\t\t\treturn implode('/', array_filter([$this->getLanguage(), $this->getPageName()]));\n\t\t}",
"public function get_resources_path()\n\t\t{\n\t\t\treturn self::get_themes_path(false).$this->code.'/resources';\n\t\t}",
"public function translationsPath()\n {\n return $this->resourcesPath().'/lang';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getAccountTransactions Get account transactions. | public function testGetAccountTransactions()
{
$response = $this->api->getAccountTransactions("0x0123456789012345678901234567890123456789", 0, 100);
$this->assertTrue($response->getSuccess());
$this->assertInternalType("array", $response->getResult());
} | [
"public function testAccountTransactionsGet()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function transactions()\n\t{\n\t\t$response = $this->client->get( 'account/transactions' );\n\t\treturn $response->getBody();\n\t}",
"public function getTransactionsForAccount(int $account): array;",
"public function getTransactions();",
"public function getAccountTransactions($account, array $params = [])\n {\n return $this->getAndMapCollection($account->getResourcePath().'/transactions', $params, 'toTransactions');\n }",
"public function test_should_list_all_transactions_from_a_user_account()\n {\n $id = UUID::v4();\n $account = AccountSupportFactory::getInstance()::build();\n $user = UserSupportFactory::getInstance()::withId($id)::withAccount($account)::build();\n\n $amount1 = MoneySupportFactory::getInstance()::withAmount(500.00)::build();\n $account->deposit($amount1);\n\n $amount2 = MoneySupportFactory::getInstance()::withAmount(1000.00)::build();\n $account->deposit($amount2);\n\n $amount3 = MoneySupportFactory::getInstance()::withAmount(2000.00)::build();\n $account->deposit($amount3);\n\n UserSupportRepository::persistUser($user);\n\n $transactions = $this->subject->execute(new ListTransactionsCommand($id));\n\n $this->assertCount(3, $transactions);\n $this->assertEquals($amount1->getValue(), $transactions[0][\"amount\"][\"value\"]);\n $this->assertEquals($amount2->getValue(), $transactions[1][\"amount\"][\"value\"]);\n $this->assertEquals($amount3->getValue(), $transactions[2][\"amount\"][\"value\"]);\n }",
"public static function get_transactions($params = array())\n\t{\n\t\treturn WHMCS_Invoice::get_transactions($params);\n\t}",
"public function viewaccounttransactionsAction() {\n\t\t$id = $this->_getParam('accountId');\n\t\t$this->view->accountId = $id;\n\t \n\t\tif($id) {\n\t\t\t$model = new Financial_Model_Account();\n\t\t\t$actData = $model->findById($id);\n\n\t\t\t$this->view->account = $actData;\n\t\t\t \n\t\t\t// Fetch the account transactions\n\t\t\t$at = new Financial_Model_AccountTransaction();\n\t\t\t$at->setAccountId( $id );\n\n\t\t\t$transactions = $at->getAccountTransactions();\n\t\t\t$balance = $at->getBalance();\n\t\t\t$this->view->balance = $balance;\n\t\t\t \n\t\t\tif( $transactions ){\n\t\t\t $this->view->paginator = $this->paginate($transactions);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->view->msg = array('msg'=>'noRecordFound','type'=>'error');\n\t\t}\n\t}",
"public static function getTransactionsByAccount($account)\r\n {\r\n $toReturn = array();\r\n Logger::log(\"Returning transactions by account \".$account);\r\n \r\n foreach (self::RPC()->listtransactions($account, 99999999999) as $trans) {\r\n if (self::isValidAddress($trans[\"address\"])) {\r\n array_push($toReturn, $trans);\r\n }\r\n }\r\n \r\n return $toReturn;\r\n }",
"function getUserWalletTransactions()\n {\n $token = refreshAuthToken();\n \n global $I_A_N;\n global $u_id;\n global $endpoint;\n global $wallet_currency;\n \n $user_wallet_currency = $wallet_currency;\n \n $curl = curl_init();\n\n $request_fields = [\n \"GetUserWalletTransactions\"=>[\n \"Request\"=>[\n \"IssuerAccountNumber\"=>$I_A_N,\n \"UserID\"=>$u_id,\n \"WalletCurrency\"=>$user_wallet_currency,\n \"Pagination\"=>[\n \"RecordsToSkip\"=>\"1\",\n \"RecordsToTake\"=>\"10\"\n ]\n ]\n ]\n ];\n\n $json_typed = json_encode($request_fields);\n \n curl_setopt_array($curl, array(\n CURLOPT_URL => $endpoint.'/API/V4/Wallet/GetUserWalletTransactions',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_POSTFIELDS => $json_typed,\n CURLOPT_HTTPHEADER => array(\n \"Content-Type: application/json\",\n \"Authorization: Bearer \".$token\n )\n ));\n \n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $resp = json_decode($response, true);\n\n //global $go_home;\n\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo \"<h1>User Wallet Transactions</h1>\";\n //echo \"<p><a href='\".$go_home.\"'>Return to API calls test page</a></p>\";\n foreach($resp as $resps){\n foreach($resps as $results){\n foreach($results as $transaction=>$part){\n echo $transaction.\" = \".$part.\"<br>\";\n }\n }\n }\n }\n }",
"public function walletTransactions($currency = 'NGN')\n {\n return $this->setHttpResponse(\"/v2/wallet_transactions/{$currency}\", 'GET', [])->getResponse();\n }",
"function getCompanyWalletTransactions()\n {\n $token = refreshAuthToken();\n \n global $I_A_N;\n global $wallet_id;\n global $endpoint;\n\n $company_wallet_id = $wallet_id;\n \n $curl = curl_init();\n\n $request_fields = [\n \"GetCompanyWalletTransactions\"=>[\n \"Request\"=>[\n \"IssuerAccountNumber\"=>$I_A_N,\n \"WalletID\"=>$company_wallet_id,\n \"Pagination\"=>[\n \"RecordsToSkip\"=>\"1\",\n \"RecordsToTake\"=>\"10\"\n ]\n ]\n ]\n ];\n\n $json_typed = json_encode($request_fields);\n \n curl_setopt_array($curl, array(\n CURLOPT_URL => $endpoint.'/API/V4/Wallet/GetCompanyWalletTransactions',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_POSTFIELDS => $json_typed,\n CURLOPT_HTTPHEADER => array(\n \"Content-Type: application/json\",\n \"Authorization: Bearer \".$token\n )\n ));\n \n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $resp = json_decode($response, true);\n\n //global $go_home;\n\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo \"<h1>Company Wallet Transactions</h1>\";\n //echo \"<p><a href='\".$go_home.\"'>Return to API calls test page</a></p>\";\n foreach($resp as $resps){\n foreach($resps as $results){\n foreach($results as $transaction=>$part){\n echo $transaction.\" = \".$part.\"<br>\";\n }\n }\n }\n }\n }",
"public function Transactions ($Account) \r\n\t{\r\n\t\tif (!$AccountID = Database::GetID($Account, \"Account\", self::$db)) \r\n\t\t{\r\n\t\t\tAccount::Error (\"Can't fetch Transactions for Account ${Account}\", \"No such Account\");\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\t$query = \"DROP TABLE IF EXISTS A${AccountID}\";\r\n\t\tAccount::Event($query, \"\");\r\n\t\tif (!mysql_query($query, self::$db)) \r\n\t\t{\r\n\t\t\tAccount::Error (\"Can't remove temporary table\", mysql_error(self::$db));\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\t$query = \"CREATE TEMPORARY TABLE A${AccountID} SELECT Transaction.ID AS ID, Date, Account.Code AS Code, Transaction.Note, Transaction.Count, Transaction.Units, Transaction.Price, Transaction.Value, Transaction.TaxRate, Transaction.Total, Transaction.Tax, Transaction.Total AS Payment, (0.00) AS Receipt, Transaction.Balance AS Balance FROM Account JOIN Transaction ON Account.ID=ReceiptID WHERE PaymentID=(${AccountID})\";\r\n\t\tAccount::Event($query, \"\");\r\n\t\tif (!mysql_query($query, self::$db)) \r\n\t\t{\r\n\t\t\tAccount::Error (\"Can't collect Payments for Account '${Account}'\", mysql_error(self::$db));\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\t$query = \"INSERT INTO A${AccountID} SELECT Transaction.ID AS ID, Date, Account.Code AS Code, Transaction.Note, Transaction.Count, Transaction.Units, Transaction.Price, Transaction.Value, Transaction.TaxRate, Transaction.Tax, Transaction.Total, (0.00) AS Payment, Transaction.Total AS Receipt, Transaction.Balance AS Balance FROM Account JOIN Transaction ON Account.ID=PaymentID WHERE ReceiptID=(${AccountID})\";\r\n\t\tAccount::Event($query, \"\");\r\n\t\tif (!mysql_query($query, self::$db)) \r\n\t\t{\r\n\t\t\tAccount::Error (\"Can't collect Receipts for Account '${Account}'\", mysql_error(self::$db));\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\t$query = \"SELECT * FROM A${AccountID} ORDER BY Date\";\r\n\t\tAccount::Event($query, \"\");\r\n\t\tif (!$table = mysql_query($query, self::$db)) \r\n\t\t{\r\n\t\t\tAccount::Error(\"Can't fetch Transactions for Account '${Account}'\", mysql_error(self::$db));\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\treturn ($table);\r\n\t}",
"public function getAllTransactions(): array\n {\n return $this->httpClient()->get(url: 'transaction');\n }",
"public function getTransaction()\n {\n\n\n $transactionId = static::TRID;\n\n\n try {\n $transaction = $this->api->get($transactionId);\n print_r($transaction);\n } catch (\\tpay\\TException $e) {\n var_dump($e);\n }\n\n }",
"public function get_accounts() {\n $post_arr = array();\n return $this->doWebRequest('accounts', $post_arr);\n }",
"public function getAccounts();",
"public function getTransactions()\n {\n return $this->transactions;\n }",
"public function testListTransactions()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function SubjectCell , Parameter list: $edit Creates subject cell as table. | function SubjectCell($edit)
{
$subject=$this->GetMailField("Subject");
$cell="";
if ($edit==1)
{
$cell=$this->MakeInput("Subject",$subject,80);
}
else
{
$cell=$subject;
}
return $this->Span($cell,array("WIDTH" => '75%'));
} | [
"function Emails2TableCell($edit,$email,$selected=FALSE,$disabled=FALSE)\n {\n return\n $this->Emails2TableCheckBox($edit,$email,$selected,$disabled).\" \".\n $this->Span($email[ \"Email\" ].\";\",array(\"TITLE\" => $email[ \"Name\" ].\" (\".$email[ \"ID\" ].\")\")).\n \"\";\n }",
"public function addTimetableCell()\n {\n\n global $conn;\n\n $tcsId = TimetableCell::getTimeId();\n $tcsTutor = TimetableCell::getTutorId();\n $tcsSubject = TimetableCell::getSubjectId();\n $tcsDay = TimetableCell::getDay();\n $tcsStartTime = TimetableCell::getStartTime();\n $tcsEndTime = TimetableCell::getEndTime();\n $sql = \"INSERT INTO timetable_staff_subject(tid,staff_name,subject_name,day,start_time,end_time) VALUES('$tcsId','$tcsTutor','$tcsSubject','$tcsDay','$tcsStartTime','$tcsEndTime');\";\n\n $conn->query($sql);\n }",
"function add_table_cell(int $table, int $column, int $row, string $text, string $optlist){}",
"public function createCell();",
"function table_cell($row, $col, $key, $val, $class=\"\", $align=\"\", $comment=\"\", $index) \n {\n global $debug;\n\tif ($debug) echo \"table_cell($val)\";\n global $PHP_SELF, $DOCUMENT_ROOT;\n $title=\"\";\n $shown = false;\n if (array_key_exists($key,$this->orig_fields)) $key = $this->orig_fields[$key];\n if (isset($this->total[$key])) $title=number_format($this->total[$key]);\n if ($comment) $title = $comment;\n $this->table_cell_open($class, $align, $title, $key, $index);\n if (!empty($this->edit)) {\n/*\n\tif ($this->form->form_data->elements[$key][\"ob\"]->multiple) $val = explode(\",\",$val);\n*/\n\t$this->form->form_data->elements[$key][\"ob\"]->value=$val;\n\t$this->form->form_data->elements[$key][\"ob\"]->action=\"ipe\";\n\t\n\t$this->form->form_data->elements[$key][\"ob\"]->extrahtml = \" \".str_replace('$index',\"$index\",$this->form->form_data->elements[$key][\"ob\"]->extrahtml);\n\n \tif (isset($this->extra_html[$key])) $this->form->form_data->elements[$key][\"ob\"]->extrahtml = \" \".$this->extra_html[$key];\n\n\tif (isset($this->form->form_data->elements[$key][\"ob\"]->rows)) {\n\t\t$this->form->form_data->elements[$key][\"ob\"]->rows = substr_count($val,\"\\n\")+1;\n\t}\n\tif ($this->form->form_data->elements[$key][\"ob\"]->multiple) {\n\t\tforeach ($this->form->form_data->elements[$key][\"ob\"]->options as $option) {\n\t\t\t$this->form->form_data->show_element($key,$option);\n\t\t\techo \" $option<br>\\n\";\n\t\t}\n\t} else $this->form->form_data->show_element($key,$val);\n } else {\n if (strlen($val)>$this->limit+5) {$val = substr($val,0,$this->limit).\" ...\";}\n\tif ((isset($this->map_links)) and ($this->verify_array($this->map_links)) and array_key_exists($key,$this->map_links) and ($target = $this->map_links[$key])) {\n printf(\"<a href=\\\"%s%s\\\">%s</a>\",$target,$val,htmlspecialchars($val,ENT_COMPAT,\"UTF-8\"));\n } else {\n\t\tif ($this->trust_the_data) \n\t\t\techo $val;\n\t\telse\n\t\t\techo htmlspecialchars($val,ENT_COMPAT,\"UTF-8\");\n\t}\n }\n $this->table_cell_close($class);\n }",
"function table_cell($key, $datum) {\n echo \"<td>$datum</td>\";\n }",
"function table_cell ()\n{\n\tstatic $_defaults = array(\n\t\t'align' => 'left'\n\t\t, 'valign' => 'top'\n\t\t, 'value' => ''\n\t\t, 'allowed' => array('Common','abbr','align','axis','char','charoff'\t\n\t\t\t,'colspan','headers','rowspan','scope','valign','width','height'\t\n\t\t\t,'nowrap','bgcolor'\n\t\t)\n\t);\n\tstatic $_simple = array('value');\n\n\t$p = func_get_args();\n\t$p = parse_arguments($p, $_simple, $_defaults);\n\t$attlist = get_attlist($p);\n\n\tif (is_array($p['value']) or is_object($p['value']))\n\t{\n\t\t$p['value'] = implode('',(array)$p['value']);\n\t}\n\n\t$output = \"\\n <td $attlist>{$p['value']}</td>\\n\";\n\treturn $output;\n}",
"public function subjectcontentsGridAction()\n {\n $this->_initSubject();\n $this->loadLayout();\n $this->getLayout()->getBlock('subject.edit.tab.subjectcontent');\n //->setProductSchedules($this->getRequest()->getPost('product_schedules', null));\n $this->renderLayout();\n }",
"function DBDataFormDetailsCell($edit,$item)\n {\n return $this->ItemsForm_ItemDetailsCell($edit,$item);\n \n }",
"function Htmls_Table_Cell($cell,$options=array(),$tdtag=\"TD\")\n {\n if (is_array($cell) && isset($cell[ \"Text\" ]))\n {\n if (!empty($cell[ \"Options\" ]))\n {\n foreach ($cell[ \"Options\" ] as $key => $value)\n {\n $options[ $key ]=$value;\n }\n }\n\n if (!empty($cell[ \"Class\" ]))\n {\n $this->Html_CSS_Add($cell[ \"Class\" ],$options);\n }\n\n $cell=$cell[ \"Text\" ];\n }\n\n return $this->Htmls_Tag($tdtag,$cell,$options);\n }",
"function Event_Submissions_Table($edit,$item,$group)\n {\n return\n array\n (\n $this->H\n (\n 3,\n $this->GetRealNameKey($this->ItemDataSGroups[ $group ])\n ),\n $this->MyMod_Item_Table_Html\n (\n $edit,\n $item,\n $this->Event_Submissions_GroupDatas($item,$group)\n )\n );\n }",
"function blog_entry_subject($type,$id,$sub)\n{\n\tglobal $db;\n\n\t//\n\t// Make changes\n\t//\n\tif($type=='rem')\n\t\t$db->execute('DELETE FROM jkk_blog_entry_subject WHERE entryid='.$id.' AND subjectid='.$sub);\n\telse\n\t\t$db->execute('INSERT INTO jkk_blog_entry_subject VALUES('.$id.','.$sub.')');\n\n\t//\n\t// Goto blog edit page\n\t//\n\tblog_entry_edit('upd',$id);\n}",
"function NoOfParticipantCitiesCell($edit=0,$event=array(),$data=\"\")\n {\n if (empty($event)) { return $this->Language_Message(\"Events_Participant_Cities_Cell_Noof_Title\"); }\n \n $sqltable=$this->SqlEventTableName(\"Participants\",$event);\n \n $cell=\"-\";\n if ($this->ParticipantsObj()->Sql_Table_Exists($sqltable))\n {\n $cell=$this->ParticipantsObj()->Sql_Select_Unique_Col_NValues\n (\n \"City\",\n $this->UnitEventWhere(),\n $sqltable\n );\n }\n\n return $cell;\n }",
"function Room_Envelope_Particant_Mark_Cell($edit,$n,$room,$participant,$question,$assessment,$tabindex)\n {\n return\n $this->AssessmentsObj()->MyMod_Data_Field\n (\n $edit,\n $assessment,\n \"Mark\",\n TRUE,\n $tabindex,\n $this->Room_Envelope_Particant_Mark_CGI_Key($participant,$question)\n );\n \n }",
"function tdcell($colclass, $slots)\n{\n global $times_along_top;\n \n $html = '';\n if (func_num_args() > 2)\n {\n $data = func_get_arg(2);\n }\n \n $html .= \"<td class=\\\"$colclass\\\"\";\n if ($slots > 1)\n // No need to output more HTML than necessary\n {\n $html .= \" \" . (($times_along_top) ? \"colspan\" : \"rowspan\") . \"=\\\"$slots\\\"\";\n }\n if (isset($data))\n {\n $html .= \" data-\" . $data['name'] . \"=\\\"\" . $data['value'] . \"\\\"\";\n }\n $html .= \">\\n\";\n \n return $html;\n}",
"public function add_timetable_subjects()\n {\n $subject = html_escape($this->input->POST());\n //this will be used when the user wants to add subjects using mobile\n if ($subject['timeSelector'] != 0 && $subject['daySelector'] != 0) {\n $subject['what_timeid'] = $subject['timeSelector'];\n $subject['what_wdid'] = $subject['daySelector'];\n }\n if (!empty($subject)) {\n $statusInsert = $this->timetable->addClassSchedule($subject); \n if ($statusInsert) {\n echo 'DONE';\n }\n }\n \n \n }",
"function write_cell ($type, $text, $attribute='')\n{\n printf (\" <%s %s>%s</%s>\\n\",\n\t $type, $attribute,\n\t $text,\n\t $type);\n}",
"function editTable( $header, $title, $type, $price, $description ) {\n\t\treturn \"<tr>\n\t\t\t\t\t<th scope=\\\"row\\\">$header</th>\n\t\t\t\t\t<td>$title</td>\n\t\t\t\t\t<td>$type</td>\n\t\t\t\t\t<td>$$price</td>\n\t\t\t\t\t<td>$description</td>\n\t\t\t\t\t<td><a href=\\\"edit-food.php?name=$title\\\" class=\\\"btn btn-primary\\\">Edit</a></td>\n\t\t\t\t</tr>\";\n\t}",
"function AddToContentTable()\n {\n if (func_get_arg(0))\n {\n echo \"<tr class=\\\"trowe\\\">\";\n }\n else\n {\n echo \"<tr class=\\\"trowo\\\">\";\n }\n $number = func_get_arg(1);\n $cb = func_get_arg(2);\n $name = func_get_arg(3);\n $sex = substr(func_get_arg(4), 0, 1);\n $kat = func_get_arg(5);\n $stavka = func_get_arg(6);\n $dol = func_get_arg(7);\n $stepen = func_get_arg(8);\n $zvan = func_get_arg(9);\n $manid = func_get_arg(10);\n $id_manid = func_get_arg(11);\n\n echo \"<td align=\\\"left\\\" nowrap>$number</td>\";\n// echo \"<td align=\\\"left\\\" nowrap> <a href=master.php?action=show_man&manid=$manid&id_manid=$id_manid>$name</a></td>\";\n echo \"<td align=\\\"left\\\" nowrap> $name</td>\";\n echo \"<td align=\\\"center\\\" nowrap>$sex</td>\";\n echo \"<td align=\\\"center\\\" nowrap>$kat</td>\";\n echo \"<td align=\\\"center\\\" nowrap>$stavka</td>\";\n echo \"<td align=\\\"center\\\" nowrap>$dol</td>\";\n echo \"<td align=\\\"center\\\" nowrap>$stepen</td>\";\n echo \"<td align=\\\"center\\\" nowrap>$zvan</td>\";\n echo \"</tr>\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a member's interests | function getInterests($memberId)
{
$sql = "SELECT interest.interest
FROM member
INNER JOIN `member-interest` ON member.member_id = `member-interest`.member_id
INNER JOIN interest ON `member-interest`.interest_id = interest.interest_id
WHERE member.member_id = :memberId";
$statement = $this->_dbh->prepare($sql);
$statement->bindParam(':memberId', $memberId);
$statement->execute();
return $statement->fetchAll(PDO::FETCH_ASSOC);
} | [
"function getInterests($member_id)\n {\n $sql = \"SELECT interests FROM member WHERE member_id = :member_id\";\n\n // prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n // bind the parameters\n $statement->bindParam(':member_id', $member_id);\n\n // execute statement\n $statement->execute();\n\n return $statement->fetch();\n }",
"public function getUserInterests()\n {\n $request = new Request('GET', 'me/following/interests/');\n\n return $this->fetchMultipleBoards($request, array('id', 'name'));\n }",
"public function interests() {\n\t\tglobal $wpdb;\n\t\t$local_id = $this->_record['id'];\n\t\treturn $wpdb->get_results(\"SELECT * FROM $wpdb->edd_mailchimp_interests WHERE list_id = $local_id\");\n\t}",
"public function getInterests()\n {\n return $this->getRelated('interests');\n }",
"public function interests()\n {\n $interests = $this->user->interests()->get();\n\n return response()->json([\n 'userinterests' => $interests->makeHidden(['name', 'pivot'])\n ]);\n }",
"public function getUserInterest()\n {\n return $this->user_interest;\n }",
"public function getUserInterests()\n {\n return $this->getRelated('UserInterest');\n }",
"public function getInterests()\n {\n return $this->interests;\n }",
"public function getInterests($memberID)\r\n {\r\n $sql = \"SELECT interestID \r\n FROM memberInterest \r\n WHERE memberID = :memberID\";\r\n\r\n $statement = $this->_cnxn->prepare($sql);\r\n $statement->bindParam(\":memberID\", $memberID,\r\n PDO::PARAM_INT);\r\n $statement->execute();\r\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n $interest = \"\";\r\n\r\n foreach ($results AS $row) {\r\n $intID = $row[\"interestID\"];\r\n $sql2 = \"SELECT interest \r\n FROM interest \r\n WHERE interestID = :intID\";\r\n\r\n $statement = $this->_cnxn->prepare($sql2);\r\n $statement->bindParam(\":intID\", $intID,\r\n PDO::PARAM_INT);\r\n $statement->execute();\r\n $interest .= $statement->fetch()[\"interest\"].\", \";\r\n }\r\n return substr($interest, 0, strlen($interest)-2);\r\n }",
"public function notification_list_interests( );",
"public function getInterest()\n\t\t{\n\t\t return $this->interest;\n\t\t}",
"public function populateInterestsForMember($member)\n {\n $interests = [];\n try {\n $interests = $this->interestDAO->getInterestsForMember($member->getMemberId());\n } catch (\\PDOException $ex) {\n $this->log->error(\"PDO Exception \" . $ex->getMessage());\n return false;\n }\n $member->setInterests($interests);\n return $member;\n }",
"function getIndoorInterests()\r\n {\r\n return $this->_indoorInterests;\r\n }",
"public function interests($id) {\n\n $me = User::find('1');\n $myObjects = $me->objects;\n $myInterests = $me->interests;\n\n $other = User::find($id);\n $theirObject = $other->objects;\n $theirInterests = $other->interests;\n\n return response()->json([\n $myObjects->toArray(),\n $myInterests->toArray(),\n $theirObject->toArray(),\n $theirInterests->toArray()\n ]);\n }",
"public function getUserInterestIns()\n {\n return $this->hasMany(UserInterestIn::className(), ['user_id' => 'id']);\n }",
"public function interests()\n {\n return new Interests;\n }",
"public function interests ()\n {\n try {\n\n // Call the interests method of InterestRepository\n $interests = $this->interest->interests();\n\n // Create a custom array as response\n $response = [\n \"status\" => \"success\",\n \"code\" => 200,\n \"message\" => \"Ok\",\n \"data\" => $interests\n ];\n\n // return the custom in JSON format\n return response()->json($response);\n\n } catch (\\Exception $e) {\n\n // Create a custom array as response\n $response = [\n \"status\" => \"failed\",\n \"code\" => 404,\n \"message\" => \"Error! Sorry server could not process this request\",\n \"data\" => NULL\n ];\n\n // return the custom in JSON format\n return response()->json($response);\n\n }\n\n }",
"public function interests()\n {\n return $this->belongsToMany('Swapstr\\Interest', 'interest_user');\n }",
"public function getIndoorInterests()\r\n {\r\n return $this->_indoorInterests;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes in a request for skill id Calls the business service to read If successful, return skill profile page If not, return the home form | public function readSkillEdit($id)
{
$this->logger->info("Entering ProfileController.readSkillEdit()");
try
{
// create new instance of profileBusinessService
$profileBS = new SkillBusinessService();
// attempt to read Skill
$skills = $profileBS->retrieveSkill($id);
// store skill information into variable
$data = [
'skill' => $skills
];
return view("skills.skillUpdate")->with($data);
}
catch (Exception $e2) {
// display our Global Exception Handler page
return view("error");
}
} | [
"function single_get()\n { \n $id=(int) $this->get('id');\n $skill = $this->skill_model->read_specific_skills( $id );\n \n if($skill)\n {\n $this->response($skill, REST_Controller::HTTP_OK); // 200 being the HTTP response code\n }\n \n else\n {\n $this->response(NULL, REST_Controller::HTTP_NOT_FOUND);//Errors to be handled application side\n }\n }",
"function GetSkillDetails($inputdata){\n\t\tglobal $con;\n\t\t$response = array(\n\t\t\t\"status\" => 0,\n\t\t\t\"errors\" => '',\n\t\t\t\"msg\" => '',\n\t\t\t\"data\" => array()\n\t\t);\n\t\t$sql='select * from sl_staff_skills_info where skill_id='.safe_str($inputdata['skill_id']).' and delete_flag=0';\n\t\t$result=$con->query($sql);\n\t\tif($result->num_rows){\n\t\t\t$response['data'] = $result->fetch_assoc();\n\t\t\t$response['status']=1;\n\t\t}else{\n\t\t\t$response['errors'] = $con->error;\n\t\t}\n\t\treturn $response;\n\t}",
"public function skillsAction()\n {\n $skills = \\Extended\\user_skills::getSkillsByUserId( Auth_UserAdapter::getIdentity()->getId() );\n \n $my_blocked_users = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(Auth_UserAdapter::getIdentity()->getId());\n $skill_data_arr = array();\n\n foreach ( $skills as $key=>$skill )\n {\n \t$skill_data_arr[$key]['skill_id'] = $skill->getId();\n \t$skill_data_arr[$key]['skill_ref_name'] = $skill->getUser_skillsSkill()->getSkill();\n \t$skill_data_arr[$key]['skill_ref_id'] = $skill->getUser_skillsSkill()->getId();\n \t\n \t//Fetching skill supports\n \t$supporters = array();\n\t\t\t$is_supported = false;\n \tif( $skill->getSupported_ids() )\n \t{\n\t\t\t\t$is_supported = true;\n \t\t$supporters = explode(\",\", $skill->getSupported_ids());\n \t\t\n \t\tforeach ( $supporters as $keyy=>$supporter )\n \t\t{\n \t\t\t$supporter_obj = \\Extended\\ilook_user::getRowObject($supporter);\n \t\t\tif($supporter_obj)\n \t\t\t{\n\n\n\t\t\t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['id'] = $supporter_obj->getId();\n\t\t\t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['supporter_id'] = $supporter_obj->getId();\n\t\t\t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['supporter_name'] = $supporter_obj->getFirstname().\" \".$supporter_obj->getLastname();\n\t\t\t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['supporter_links'] = count(explode(',',$supporter_obj->getLink_list()));\n\t\t\t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['supporter_job_title'] = isset($jobDetailsArr[0])?$jobDetailsArr[0]:NULL;\n\t\t\t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['supporter_company'] = isset($jobDetailsArr[1])?$jobDetailsArr[1]:NULL;\n\n\n\t\t\t\t\t\tif($my_blocked_users)\n\t \t\t\t{\n\t \t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['supporter_small_image'] = Helper_common::getUserProfessionalPhoto( $supporter_obj->getId(), 3, false, $my_blocked_users );\n\t \t\t\t}\n\t \t\t\telse \n\t \t\t\t{\n\t \t\t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['supporter_small_image'] = Helper_common::getUserProfessionalPhoto( $supporter_obj->getId(), 3 );\n\t \t\t\t}\n\t \t\t\t$skill_data_arr[$key]['skill_support'][$keyy]['skill_holder_id'] = $supporter_obj->getId();\n \t\t\t}\n \t\t}\n\n \t}\n\t\t\t$skill_data_arr[$key]['is_supported'] = $is_supported;\n }\n $this->view->skills_info = $skill_data_arr;\n \n }",
"function getProfileSocioeconomicDetails($aged_id = null){\n\n global $pdo;\n\n // Check if the method is GET\n if (REQUEST_METHOD == 'GET'){\n // Check if the parameter of the URI is set. If the parameter is not set, it generates a 400 error.\n if(isset($aged_id)) {\n\n $query = \"SELECT * FROM c4a_i_schema.profile_socioeconomic_details WHERE aged_id = $aged_id \";\n $query_results = $pdo->query($query);\n\n // Check if the query has been correctly performed.\n // If the variable is true it returns the data in JSON format\n if (!$query_results) {\n generate500(\"Error performing the query\");\n } else {\n\n //if the query has retrieved at least a result\n if($query_results->rowCount() > 0) {\n //it fetches each single row and encode in JSON format the results\n while ($row = $query_results->fetch(PDO::FETCH_ASSOC)) {\n $sjes = new Jecho($row);\n $sjes->message = \"Profile retrieved\";\n echo $sjes->encode(\"Profile\");\n } // end if to set results into JSON\n } else {\n generate404(\"There is no profile with the specified id. aged_id = \".$aged_id);\n }\n } // end if/else for the check of results\n } else {\n generate400(\"The aged_id is not specified\");\n } //end if/else for verify if aged_id is set\n } else {\n generate400(\"The method is not a GET\");\n } //end if/else to verify that the method is a GET\n}",
"function Get_Skills($user_auth_id)\n\t{\n\t\tglobal $db;\n\t\t$sql =\t\"SELECT * FROM \".SELLER_SKILL_MASTER\n\t\t\t.\"\tWHERE user_auth_id = '\".$user_auth_id.\"' \";\n\t\t$db->query($sql);\n\t}",
"public function showskill() {\n // call to model function to get all skills from db\n $result = $this->dash_model->showskill();\n\n echo json_encode($result);\n }",
"public function askForParticularSkills() {\n $skills = Lang::get('infos.skills');\n $top = implode(', ', array_keys($skills['top']));\n $middle = implode(', ', array_keys($skills['middle']));\n $bottom = implode(', ', array_keys($skills['bottom']));\n\n $this->ask(Lang::get('messages.skills', ['top' => $top, 'middle' => $middle, 'bottom' => $bottom]), $this->getSkillsDetails());\n }",
"function requestProfile() {\n $username = $_GET['username'];\n\n $response = retrieveProfile($username);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }",
"public function openUpdateSkill(Request $request){\n try{\n //Get posted Form data\n $id = $request->input('id');\n \n //Save posted Form Data to Skill Object Model\n \n $sbs = new SkillBusinessService();\n \n // calls findById method in JobHistoryBusinessService and passes Job History Object\n if($skill = $sbs->findById($id)){\n \n return view('userPortfolioEditSkill')->with(compact('skill'));\n }else{\n $error = \"Skill not found. Please try again\";\n return view(('errorPage'),compact(['error']));\n }\n \n }catch(Exception $e2){\n $this->logger->error(\"Exception \". array(\"message\" => $e2->getMessage()));\n //Display Global Namespace Handler Page\n return view('SystemException');\n }\n \n }",
"public function searchJobSkills(Request $request)\n {\n $_ajax = array(\n 'status' => \"success\", \n 'skills' => array(), \n 'error' => \"\",\n );\n\n $user = Auth::user();\n\n try {\n $_ajax['skills'] = 'drupal';\n }\n catch (Exception $e) {\n $_ajax['error'] = $e->getMessage();\n $_ajax['status'] = 'error';\n }\n\n if ($_ajax['status'] == 'success') {\n \n }\n\n return response()->json($_ajax);\n }",
"public function select_it_skills($id){\n \t$query =\"SELECT * FROM `it_skills` WHERE `uid`='$id'\";\n\t\t$result =mysql_query($query); \t\t\n\t\tif($result){\n\t\t\treturn $result;\n\t\t}else{\n\t\t\tdie('can not select'.mysql_errno());\n\t\t} \t\n }",
"private function getProfile()\n {\n if ($this->http->headers->has('JWT_TOKEN')) {\n $this->options['headers'] = [\n 'Content-type' => 'application/json',\n 'Authorization' => $this->http->headers->get('JWT_TOKEN')\n ];\n\n $get_profile = $this->client->request('GET', '/employee/my-profile', $this->options);\n if ($get_profile->getStatusCode() === 200) {\n $get_profile = \\GuzzleHttp\\json_decode($get_profile->getBody());\n $this->output($get_profile);\n }\n }\n $this->output([\n 'status' => false\n ]);\n }",
"public function use_skill()\n {\n $request = RequestWrapper::$request;\n $target = $request->get('target');\n $act = $request->get('act');\n $url = 'skill/use/'.rawurlencode($act).'/'.rawurlencode($target);\n // TODO: Need to double check that this doesn't allow for redirect injection\n return new RedirectResponse(WEB_ROOT.$url);\n }",
"public function physicianProfile_get(){\n\t\t$getProfile = $this->PM->getPK('physicianprofile',$this->get('id'));\n\t\t\n\t\t$this->response(array(\n\t\t\t'status' => 'TRUE',\n\t\t\t'profile' => json_encode($getProfile),\n\t\t));\n\t}",
"public function deleteSkill($id)\n {\n $this->logger->info(\"Entering ProfileController.deleteSkill()\");\n try\n {\n $profileBS = new SkillBusinessService();\n //call terminateUser method passing in user id and storing result into new variable\n $skills = $profileBS->terminateSkill($id);\n //if statement checking if delete skill returns true\n if($skills)\n {\n $this->logger->info(\"Exiting ProfileController.deleteSkill() with skill passed\");\n //call get all skill method from sevice and store in new skills variable\n $skills = $profileBS->retrieveAllSkills(session()->get('users_id'));\n //if statement checking if $users returns true\n \n //store value of skills into new variable\n $data = ['skills' => $skills];\n //if role == 1\n //return skilltable view with data holding skills\n return view(\"skills.skillTable\")->with($data);\n }\n }\n catch (Exception $e2) {\n // display our Global Exception Handler page\n $this->logger->info(\"Exiting ProfileController.deleteSkill() with skill failed \");\n return view(\"error\");\n }\n }",
"public function find($skill)\n {\n if(isset($skill[\"meetup_skill_id\"])){\n $this->db->where(\"meetup_skill_id\",$skill[\"meetup_skill_id\"]);\n $s = $this->db->getOne(\"skills\");\n if($s){\n return $s;\n }\n }\n\n if(isset($skill[\"name\"])){\n $this->db->where(\"name\", $skill[\"name\"]);\n $s = $this->db->getOne(\"skills\");\n if($s){\n return $s;\n }\n }\n\n return false;\n }",
"public function get_skill_details() {\n $query4 = \"SELECT * FROM skill WHERE pid = :part_id AND soft_delete = :soft_delete\";\n $soft_delete=0; \n $values = array(':part_id' => $_SESSION['id'],\n ':soft_delete'=> $soft_delete);\n $skill_details = $this->query_execute($query4,$values); \n return $skill_details;\n }",
"public function searchSkill($name){\n return $this->securityDAO->searchSkillsDAO($name);\n }",
"public static function take_skill($db)\r\n {\r\n if (!empty($_POST['skill-input'])) {\r\n $sql_id = \"SELECT max(sid) FROM skills;\";\r\n $ret = pg_query($db->database, $sql_id);\r\n if (!$ret) {\r\n exit;\r\n }\r\n return $ret;\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the server status and tries to start it if it is shut down | private static function serverStatus()
{
if (!empty(self::$request) && self::$method === 'POST' && strpos(self::$request, 'server') === 0 && isset(self::$input['session'])) {
if (Session::validate(self::$input['session'])) {
if (Daemon::isRunning()) {
// Daemon is already running
return json_encode(true);
} else if (Daemon::runBackground()) {
// Start Daemon
return json_encode(true);
} else {
// Could not start Daemon
return json_encode(false);
}
}
}
return false;
} | [
"static private function ServerState() {\n $status = exec('illarionctl status');\n if (strpos($status, 'ONLINE') === FALSE) {\n\t\t\tself::$serverstatus = 1;\n\t\t} else {\n\t\t\tself::$serverstatus = 0;\n\t\t}\n\n $status = exec('testctl status');\n\t\tif (strpos($status, 'ONLINE') === FALSE) {\n\t\t\tself::$testserverstatus = 1;\n\t\t} else {\n\t\t\tself::$testserverstatus = 0;\n\t\t}\n\n\t\tself::$debugger = 0;\n\t}",
"public static function serverIsRunning()\n {\n return @file_get_contents(self::statusPath()) == 1;\n }",
"function check_server_status(){\n\t# command to see if the server is running or dead\n\t#brender_log(\"I CHECK SERVER STATUS\");\n if (check_server_is_dead()){\n\t\t#$GLOBALS['computer_name']=\"web_interface\";\n\t\tset_server_settings(\"status\",\"died\");\n\t\tset_server_settings(\"pid\",\"0\");\n\t\tset_server_settings(\"started\",\"now()\");\n\t\tbrender_log(\"server not responding (PING)\");\n\t\tbrender_log(\"SERVER DIED\");\n\t\t//$color=\"red\";\n\t\t$status=\"SERVER DIED !!!!!!!!\";\n \t}\n\telse {\n\t\tset_server_settings(\"status\",\"running\");\n\t\t//$color=\"green\";\n\t\t$status=\"server is running\";\n\t}\n\treturn $status;\n}",
"public function get_status()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // KLUDGE: this is a bit dirty and distro-specific\n $shell = new Shell();\n $shell->execute('/bin/ps', 'ax', FALSE);\n\n $ps_output = $shell->get_output();\n\n foreach ($ps_output as $line) {\n if (preg_match(\"/service\\s+$this->initscript\\s+stop/\", $line) || preg_match(\"/systemctl\\s+stop\\s+$this->initscript/\", $line))\n return self::STATUS_STOPPING;\n else if (preg_match(\"/service\\s+$this->initscript\\s+start/\", $line) || preg_match(\"/systemctl\\s+start\\s+$this->initscript/\", $line))\n return self::STATUS_STARTING;\n else if (preg_match(\"/service\\s+$this->initscript\\s+restart/\", $line) || preg_match(\"/systemctl\\s+restart\\s+$this->initscript/\", $line))\n return self::STATUS_RESTARTING;\n else if (preg_match(\"/service\\s+$this->initscript\\s*/\", $line) || preg_match(\"/systemctl\\s+.*$this->initscript\\s*/\", $line))\n return self::STATUS_BUSY;\n }\n\n $retval = ($this->get_running_state()) ? self::STATUS_RUNNING : self::STATUS_STOPPED;\n\n if ($retval == self::STATUS_RUNNING) {\n $pid = $this->get_process_id(TRUE);\n if ($pid == 0)\n $retval = self::STATUS_DEAD;\n }\n\n return $retval;\n }",
"static public function getServerStatus() {\n\t\treturn (int)self::$serverstatus;\n\t}",
"function waitServerReady() {\n\n\t\t$this->client->query('GetStatus');\n\t\t$status = $this->client->getResponse();\n\t\tif ($status['Code'] != 4) {\n\t\t\t$this->console(\"Waiting for dedicated server to reach status 'Running - Play'...\");\n\t\t\t$this->console('Status: ' . $status['Name']);\n\t\t\t$timeout = 0;\n\t\t\t$laststatus = $status['Name'];\n\t\t\twhile ($status['Code'] != 4) {\n\t\t\t\tsleep(1);\n\t\t\t\t$this->client->query('GetStatus');\n\t\t\t\t$status = $this->client->getResponse();\n\t\t\t\tif ($laststatus != $status['Name']) {\n\t\t\t\t\t$this->console('Status: ' . $status['Name']);\n\t\t\t\t\t$laststatus = $status['Name'];\n\t\t\t\t}\n\t\t\t\tif (isset($this->server->timeout) && $timeout++ > $this->server->timeout)\n\t\t\t\t\ttrigger_error('Timed out while waiting for dedicated server!', E_USER_ERROR);\n\t\t\t}\n\t\t}\n\t}",
"public function get_server_status() {\r\n\t\t\r\n\t\treturn json_decode($this->send_request('get', 'server_status', 1));\r\n\t\t\r\n\t}",
"public function status(): int {\n $status = $this->serverManager->isServerActive();\n\n if ($status) {\n $this->logger()->notice(dt('The CAS mock server is active'));\n return 0;\n }\n else {\n $this->logger()->notice(dt('The CAS mock server is inactive'));\n return 1;\n }\n }",
"function sadmin_serverStart($sID) {\n\t\treturn ($this->_fastcall(\"SERVERSTART $sID\") == CYTS_OK);\t\n\t}",
"function _drush_rest_api_server_start() {\n // `start` command. Check if an instance is already running.\n // If so, return an error.\n $cache = drush_cache_get('rest-server-pid', 'drush-rest-api');\n if ($cache->data) {\n // N.B. This will only work for Linux.\n if (_rest_api_process_is_active($cache->data)) {\n return drush_set_error(dt('It appears that a Drush REST server instance is already running with process ID !pid. Run `drush rest-api-server stop` to terminate the process.', array('!pid' => $cache->data)));\n }\n drush_cache_clear_all(NULL, 'drush-rest-api');\n }\n return TRUE;\n}",
"public function isServerRunning()\n {\n $pid = $this->getServerPid();\n\n return !empty($pid);\n }",
"public function start() {\n $cmd = sprintf(\"./control.sh start %s -game %s -ip %s -port %d -maxplayers %d -map %s -rcon %s\", $this->sid, $this->gameId, $this->ip, $this->port, $this->maxplayers, $this->map, $this->rcon);\n ssh($cmd, $this->host);\n DB::get()->query(\"UPDATE `servers` SET `status` = 1 WHERE `serverID` = '\" . $this->serverId . \"'\");\n }",
"protected function cmdStartBotServer() {\n\n Log::debug(self::$TAG, \"starting the bot service...\");\n\n $servicequery = new ClientQuery;\n $servicequery->connect();\n if ($servicequery->connect() !== false) {\n Log::printEcho(json_encode([\"result\" => \"nok\"]));\n return;\n }\n $state = $servicequery->getStatus();\n // check if the server is already running\n if (!is_null($state)) {\n Log::debug(self::$TAG, \"bot service is already running!\");\n Log::printEcho(json_encode([\"result\" => \"nok\"]));\n return;\n }\n $startcmd = Config::getBotService(\"cmdStart\");\n Log::debug(self::$TAG, \"starting: \" . $startcmd);\n // on ms windows\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n $out = \"\";\n $ret = 0;\n exec(\"'\" . $startcmd . \"'\", $out, $ret);\n }\n else {\n // on linux or mac\n shell_exec($startcmd);\n }\n Log::printEcho(json_encode([\"result\" => \"ok\"]));\n }",
"public function getServerStatus()\n\t{\n\t\tif (is_object($this->server))\n\t\t\treturn $this->server->status;\n\t\telse\n\t\t\treturn null;\n\t}",
"protected function startHasForked() {\n $log_type = $this->queueStatusChange(StatusHandler::STOPPED, StatusHandler::STOPPED, array(StatusHandler::PROCESSING, StatusHandler::HIBERNATING));\n $this->statusHandler->logStatus($log_type);\n }",
"public function status() {\n return $this->http(self::STATUS_SERVER, 'check');\n }",
"public function sync()\n {\n $server = $this->server;\n\n switch ($server->provider) {\n case DIGITAL_OCEAN:\n if ($server->status === STATUS_ACTIVE) {\n return;\n }\n\n if ($server->status === STATUS_INITIALIZING) {\n return $this->handleInitializedServer($server);\n }\n\n $droplet = $this->getDigitalOceanDroplet(\n $server->identifier,\n $server->user,\n $server->credential_id\n );\n\n if ($droplet->status === 'active') {\n $server->update([\n 'ip_address' => $droplet->networks->v4[0]->ip_address,\n 'private_ip_address' =>\n $droplet->networks->v4[1]->ip_address,\n 'status' => STATUS_INITIALIZING\n ]);\n\n return $this->handleInitializedServer($server);\n } else {\n throw new ServerNotReadyException(\n 'Droplet not yet active.'\n );\n }\n break;\n case VULTR:\n if ($server->status === STATUS_ACTIVE) {\n return;\n }\n\n if ($server->status === STATUS_INITIALIZING) {\n return $this->handleInitializedServer($server);\n }\n\n $vultrServer = $this->getVultrServer(\n $server->identifier,\n $server->user,\n $server->credential_id\n );\n\n if ($vultrServer->status === STATUS_ACTIVE) {\n $server->update([\n 'ip_address' => $vultrServer->main_ip,\n 'status' => STATUS_INITIALIZING\n ]);\n\n return $this->handleInitializedServer($server);\n } else {\n throw new ServerNotReadyException(\n 'Vultr server not ready.'\n );\n }\n break;\n case CUSTOM_PROVIDER:\n if ($server->status === STATUS_ACTIVE) {\n return;\n }\n\n return $this->handleInitializedServer($server);\n break;\n case LINODE:\n if ($server->status === STATUS_ACTIVE) {\n return;\n }\n\n if ($server->status === STATUS_INITIALIZING) {\n return $this->handleInitializedServer($server);\n }\n\n $linode = $this->getLinode(\n $server->identifier,\n $server->user,\n $server->credential_id\n );\n\n if ($linode->status === 'running') {\n $server->update([\n 'status' => STATUS_INITIALIZING\n ]);\n\n return $this->handleInitializedServer($server);\n }\n\n return $this->handleInitializedServer($server);\n break;\n }\n }",
"public static function start()\n {\n // Make sure the server isn't already running.\n if (self::isRunning()) {\n throw new ServerException('Server already running.');\n }\n\n // Make sure the server jar exists.\n if (!file_exists(config('minecraft.directory') . '/' . config('minecraft.exec'))) {\n throw new ServerException('Could not find server jar file at '. config('minecraft.directory') . '/' . config('minecraft.exec') . '.');\n }\n\n // Launch server process in a detached GNU Screen.\n if (config('minecraft.edition') == 'java') {\n shell_exec(\n 'cd ' . escapeshellarg(config('minecraft.directory')) . '; ' . // Change to server directory.\n sprintf(\n self::CMD['java']['start'],\n escapeshellarg(config('minecraft.process_name')),\n config('minecraft.ram.startup'),\n config('minecraft.ram.max'),\n escapeshellarg(config('minecraft.exec'))\n )\n );\n }\n else if (config('minecraft.edition') == 'bedrock') {\n shell_exec(\n 'cd ' . escapeshellarg(config('minecraft.directory')) . '; ' . // Change to server directory.\n sprintf(\n self::CMD['bedrock']['start'],\n escapeshellarg(config('minecraft.process_name')),\n )\n );\n }\n }",
"public function startServer()\n {\n if ($this->process) {\n $this->process->stop();\n }\n\n $command = sprintf(\n 'php Tests/Service/Socket/SocketServer.php %s %s',\n $this->host,\n $this->port\n );\n\n $this->process = new Process($command);\n $this->process->start();\n\n if (!$this->process->isRunning()) {\n $this->fail('Could not start webserver');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the recurrence type of the event. This is usually a string that matches up to the label of a recurrence type. | public function getRecurrenceType(); | [
"public function getRecurrenceType()\n {\n return $this->recurrenceType;\n }",
"public function getRecurringType()\n {\n return $this->recurringType;\n }",
"public function getRecurrence(): string\n {\n return $this->recurrence;\n }",
"public function setRecurrenceType($type = null);",
"public function getRecurrenceTypes();",
"public function getRescheduleType()\n {\n return $this->reschedule_type;\n }",
"public function createRecurrenceType($type);",
"public function get_recurring_period_type(){\n\t\treturn $this->payment['recurring_period_type'];\n\t}",
"public function getJournalRecurringTypeId() {\n return $this->journalRecurringTypeId;\n }",
"public function getRevenueScheduleType(): ?string\n {\n return $this->_revenue_schedule_type;\n }",
"public function getEventType() {\n $ret = '';\n switch($this->type) {\n case Event::TYPE_EVENT:\n $ret = 'Event';\n break;\n case Event::TYPE_FLAGSHIP:\n $ret = 'Flagship';\n break;\n case Event::TYPE_WORKSHOP:\n $ret = 'Workshop';\n break;\n case Event::TYPE_CELEBRITY_APPEARANCE:\n $ret = 'Celebrity Appearance';\n break;\n case Event::TYPE_GUEST_LECTURE:\n $ret = 'Guest Lecture';\n break;\n }\n\n return $ret;\n }",
"public function getRecurrenceTypes()\n {\n return [\n 'oro.calendar.recurrence.types.daily' => self::TYPE_DAILY,\n 'oro.calendar.recurrence.types.weekly' => self::TYPE_WEEKLY,\n 'oro.calendar.recurrence.types.monthly' => self::TYPE_MONTHLY,\n 'oro.calendar.recurrence.types.monthnth' => self::TYPE_MONTH_N_TH,\n 'oro.calendar.recurrence.types.yearly' => self::TYPE_YEARLY,\n 'oro.calendar.recurrence.types.yearnth' => self::TYPE_YEAR_N_TH,\n ];\n }",
"public function getRentalEventType()\n {\n return $this->_fields['RentalEventType']['FieldValue'];\n }",
"public function get_calendar_event_type() {\n if ($this->event->get_course_module()) {\n return 'course';\n }\n\n return $this->event->get_type();\n }",
"public function getRunType()\n {\n switch ($this->type) {\n case \"field\":\n return \"Run\";\n case \"clinical\":\n return \"Assessment\";\n case \"lab\":\n return \"Scenario\";\n }\n }",
"public function get_event_type()\n\t{\n\t\t$type = DB::get_value( 'SELECT type FROM {log_types} WHERE id=' . $this->type_id );\n\t\treturn $type ? $type : _t( 'Unknown' );\n\t}",
"public function getType()\n {\n return $this->event_type;\n }",
"public function getType()\n {\n return PeriodicType::get()[$this->type_id];\n }",
"public function type() {\n return eventsign_type_load($this->type);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace class on cancel reply link | function magaz_replace_cancel_reply_link_class( $cancel_comment_reply_link, $post = null ) {
$new = str_replace( '<a', '<a class="button outline tiny"', $cancel_comment_reply_link );
return $new;
} | [
"function shoestrap_replace_reply_link_class( $class ) {\n $class = str_replace( \"class='comment-reply-link\", \"class='comment-reply-link btn btn-primary btn-small\", $class );\n return $class;\n}",
"function replace_reply_link_class( $class ){\n\t$class = str_replace( \"class='comment-reply-link\", \"class='comment-reply-link btn btn-default btn-sm\", $class );\n\treturn $class;\n}",
"function cancel_comment_reply_button($html, $link, $text) {\n $style = isset($_GET['replytocom']) ? '' : ' style=\"display:none;\"';\n $button = '<button id=\"cancel-comment-reply-link\" class=\"btn-tertiary caps\" ' . $style . '>';\n return $button . $text . '</button>';\n}",
"static function bootstrap_reply_link_class( $class ) {\n\t\t$class = str_replace( \"class='comment-reply-link\", \"class='comment-reply-link btn btn-primary btn-sm\", $class );\n\t\treturn $class;\n\t}",
"function blogfused_get_cancel_comment_reply_link($text = '') {\n\tif ( empty($text) )\n\t\t$text = __('Click here to cancel reply.');\n\n\t$style = isset($_GET['replytocom']) ? '' : ' style=\"display:none;\"';\n\t$link = esc_html( remove_query_arg('replytocom') ) . '#respond';\n\treturn apply_filters('cancel_comment_reply_link', '<a rel=\"nofollow\" class=\"btn btn-mini btn-inverse\" id=\"cancel-comment-reply-link\" href=\"' . $link . '\"' . $style . '>' . $text . '</a>', $link, $text);\n}",
"function bbp_get_cancel_reply_to_link($text = '')\n{\n}",
"function get_cancel_comment_reply_link_telerikacademy( $prev_link = '', $link = '', $text = '' ) {\n\t$style = isset($_GET['replytocom']) ? '' : ' style=\"display:none;\"';\t\n\treturn '<a rel=\"nofollow\" id=\"cancel-comment-reply-link\" \n\t\tclass=\"command-button\" href=\"' . $link . '\"' . $style . '>' . $text . '</a>';\n}",
"protected function cancelLink()\n\t{\n\t\treturn '<p class=\"form-link-cancel\"><a href=\"/journal\">Back to Journal</a></p>';\n\t}",
"function get_cancel_comment_reply_link( $text = '' ) {\n\tif ( empty($text) )\n\t\t$text = __('Click here to cancel reply.');\n\n\t$style = isset($_GET['replytocom']) ? '' : ' style=\"display:none;\"';\n\t$link = esc_html( remove_query_arg('replytocom') ) . '#respond';\n\n\t$formatted_link = '<a rel=\"nofollow\" id=\"cancel-comment-reply-link\" href=\"' . $link . '\"' . $style . '>' . $text . '</a>';\n\n\t/**\n\t * Filters the cancel comment reply link HTML.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $formatted_link The HTML-formatted cancel comment reply link.\n\t * @param string $link Cancel comment reply link URL.\n\t * @param string $text Cancel comment reply link text.\n\t */\n\treturn apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text );\n}",
"protected function cancelLink()\n\t{\n\t\treturn '<p class=\"form-link-cancel\"><a href=\"/settings\">Cancel</a></p>';\n\t}",
"protected function cancelLink()\n\t{\n\t\treturn '<p class=\"form-link-cancel\"><a href=\"/journal/edit/' . $this->data['id'] . '\">Cancel</a></p>';\n\t}",
"function instapress_comment_form_submit_button( $submit_button, $args ) {\n $link = remove_query_arg( array( 'replytocom', 'unapproved', 'moderation-hash' ) );\n\n $display = (string) null;\n if ( empty( $_GET['replytocom'] ) ) {\n $display = ' style=\"display: none;\"';\n }\n\n $cancel_link = sprintf(\n '<a id=\"cancel-comment-reply-link\" class=\"comment-reply-cancel\" href=\"%1s\"rel=\"nofollow\"%3$s>%2$s</a>',\n esc_html( $link ) . '#respond',\n __( 'Cancel reply', 'instapress' ), $display\n );\n\n return $submit_button . $cancel_link;\n}",
"function bbp_reply_class($reply_id = 0, $classes = array())\n{\n}",
"function cancelViewPhrase() \n\t{\n\t\tilUtil::sendInfo($this->lng->txt('msg_cancel'), true);\n\t\t$this->ctrl->redirect($this, 'editQuestion');\n\t}",
"public static function comment_reply_link () : void\n {\n add_filter(\"comment_reply_link\", function ($class){\n $class = str_replace(\"class='comment-reply-link\", 'class=\"comment-reply-link reply\"', $class);\n\n return $class;\n });\n\n add_filter(\"comment_reply_link_args\", function ($args){\n $args[\"reply_text\"] = '<i class=\"material-icons\">reply</i>' . __(\"Reply\", \"ahana\");\n\n return $args;\n });\n }",
"function cancel() \n\t{\n\t\t$uid = JRequest::getVar( 'uid' );\n\t\t$redirect = \"index.php?option=com_phplist&view=newsletters&uid=\".$uid ;\n\t\t$redirect = JRoute::_( PhplistUrl::siteLink($redirect), false );\n $this->setRedirect( $redirect, $this->message, $this->messagetype );\n\t}",
"protected function _cancelLink(){\n\n if( $this->_cancelLink !== FALSE ){\n if( $this->_cancelLink === NULL ){\n $urlParams = array(\n 'controller' => Zend_Registry::get('controllerName')\n );\n $this->_cancelLink = $this->_assembleUrl($urlParams);\n }\n $cancelLink = $this->_cancelLink;\n $cancelLinkDecorator = new App_Form_Decorator_Backlink();\n $cancelLinkDecorator->setOption('url', $cancelLink);\n $element = $this->getElement('submit');\n $decorators = $element->getDecorators();\n $element->clearDecorators();\n foreach( $decorators as $decorator ){\n $element->addDecorator($decorator);\n if( $decorator instanceof Zend_Form_Decorator_ViewHelper ){\n $element->addDecorator($cancelLinkDecorator);\n }\n }\n }\n }",
"protected function _cancelLink(){\n if ($this->_cancelLink !== FALSE) {\n if ($this->_cancelLink === NULL) {\n $this->_cancelLink = '/' . Zend_Registry::get('controllerName');\n }\n \n $cancelLink = Zend_Controller_Front::getInstance()->getBaseUrl() . $this->_cancelLink;\n \n $cancelLinkDecorator = new App_Form_Decorator_Backlink();\n $cancelLinkDecorator->setOption('url', $cancelLink);\n \n $element = $this->getElement('submit');\n $decorators = $element->getDecorators();\n $element->clearDecorators();\n \n foreach($decorators as $decorator) {\n $element->addDecorator($decorator);\n if ($decorator instanceof Zend_Form_Decorator_ViewHelper) {\n $element->addDecorator($cancelLinkDecorator);\n }\n }\n }\n }",
"function send_to_cancel_url() {\n\t\tif ( $url = $this->get_cancel_url() ) {\n\t\t\twp_redirect( $url );\n\t\t\tappthemes_exit( 'send_to_cancel_url' );\n\t\t}\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get template tabs Get tabs for the library. | public function get_template_tabs() {
$tabs = Templates\premium_templates()->types->get_types_for_popup();
return $tabs;
} | [
"public static function get_tabs()\n {\n return apply_filters( 'es_settings_get_tabs', array(\n 'general' => array(\n 'label' => __( 'General', 'es-plugin' ),\n 'template' => ES_ADMIN_TEMPLATES . 'settings/general-tab.php'\n ),\n 'layouts' => array(\n 'label' => __( 'Layouts', 'es-plugin' ),\n 'template' => ES_ADMIN_TEMPLATES . 'settings/layouts-tab.php'\n ),\n 'currency' => array(\n 'label' => __( 'Currency', 'es-plugin' ),\n 'template' => ES_ADMIN_TEMPLATES . 'settings/currency-tab.php'\n ),\n 'sharing' => array(\n 'label' => __( 'Sharing', 'es-plugin' ),\n 'template' => ES_ADMIN_TEMPLATES . 'settings/sharing-tab.php'\n ),\n ) );\n }",
"protected function get_tabs() {\n\t\treturn $this->tabs;\n\t}",
"protected function get_tabs() {\n\t\t$untabbed_fields = $this->get_untabbed_fields();\n\n\t\tif ( ! empty( $untabbed_fields ) ) {\n\t\t\t$this->create_tab(\n\t\t\t\tapply_filters( 'carbon_fields_untabbed_fields_tab_title', __( 'General', 'pdfjs-viewer-shortcode' ), $this ),\n\t\t\t\t$untabbed_fields,\n\t\t\t\tstatic::TABS_HEAD\n\t\t\t);\n\t\t}\n\n\t\treturn $this->tabs;\n\t}",
"public function getTabs(){\n\t\t$actualTab = '';\n\t\t$tabs_headers = '<ol id=\"toc\">'.\"\\n\";\n\t\t$js_tabs_loading = '';\n\t\t$tabs_content = '';\n\t\t// create tabs and add each item configuration into the right tab\n\t\tforeach ($this->podServerConfiguration->itemsConfiguration as $item){\n\t\t\tif ($item->group != $actualTab)\t{\n\t\t\t\tif ($actualTab != '') $tabs_content.= '</div>'.\"\\n\";\n\t\t\t\t// tabs header\n\t\t\t\t$label_tab_variable = 'label_tab_'.$item->group;\n\t\t\t\tglobal $$label_tab_variable;\n\t\t\t\tif ($$label_tab_variable == '') $$label_tab_variable = '$'.$label_tab_variable;\n\t\t\t\t$tabs_headers.= '<li><a href=\"#'.$item->group.'\" id=\"tab_'.$item->group.'\" name=\"tab_'.$item->group.'\"><span>'.$$label_tab_variable.'</span></a></li>'.\"\\n\";\n\t\t\t\t// tabs js loading code\n\t\t\t\tif ($js_tabs_loading != '') $js_tabs_loading.=', ';\t\t\t\n\t\t\t\t$js_tabs_loading.='\\''.$item->group.'\\'';\n\t\t\t\t// tabs content\n\t\t\t\t$tabs_content.= '<div class=\"content\" id=\"'.$item->group.'\">'.\"\\n\";\n\t\t\t}\n\t\t\t// render the item and add it to the current tab\n\t\t\t$tabs_content.= $item->getHTML();\n\t\t\t$actualTab = $item->group;\n\t\t}\n\t\t$tabs_content.= '</div>'.\"\\n\";\n\t\t$tabs_headers.= '</ol>'.\"\\n\";\n\t\t\n\t\t// include the js script to manage tabs\n\t\t$js_tabs_loading = '<script src=\"js/activatables.js\" type=\"text/javascript\"></script>'.\"\\n\".\n\t\t\t\t '<script type=\"text/javascript\">'.\"\\n\".'activatables(\\'tab\\', [' . $js_tabs_loading . ']);'.\"\\n\".'</script>'.\"\\n\";\n\n\t\t// include the script that manage dependances\n\t\t$js_item_dependance = '<script src=\"js/dependances.php';\n\t\tif(isset($_GET['lang']) && $_GET['lang'] != '') $js_item_dependance.='?lang='.$_GET['lang'];\n\t\t$js_item_dependance.='\" type=\"text/javascript\"></script>'.\"\\n\";\t\t\n\n\t\t// finalyse the config tabs area\n\t\t$tabs = '<div class=\"tabs\">'.\"\\n\".$tabs_headers.\"\\n\".$tabs_content.\"\\n\".'</div>'.\"\\n\".$js_tabs_loading.\"\\n\".$js_item_dependance.\"\\n\";\t\t\n\t\treturn $tabs;\n\t\t\n\t}",
"public function NavTabBar() {\n\t\t$tabs = new ArrayList([\n\t\t\t[\n\t\t\t\t'ID' => 'feedTab',\n\t\t\t\t'Title' => _t('NewsFeed.NewsFeedTabLabel', 'News Feed'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ID' => 'organisationTab',\n\t\t\t\t'Title' => _t('NewsFeed.MyOrganisationTabLabel', 'My SocialOrganisation Profile'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ID' => 'myPersonalProfileTab',\n\t\t\t\t'Title' => _t('NewsFeed.MyPersonalProfileTabLabel', 'My Personal Profile'),\n\t\t\t],\n\t\t]);\n\n\t\treturn $tabs;\n\t}",
"public function getTabs() {\n\t\tif ($this->checkAccess(\"read\")) {\n\t\t\t$this->tabs_gui->addTab( self::TAB_VIEW_CONTENT\n\t\t\t\t\t\t\t\t , $this->lng->txt(\"content\")\n\t\t\t\t\t\t\t\t , $this->getLinkTarget(\"view\"));\n\t\t}\n\n\t\tif ($this->checkAccess(\"visible\")) {\n\t\t\t$this->tabs_gui->addTab( self::TAB_INFO\n\t\t\t\t\t\t\t\t , $this->lng->txt(\"info_short\")\n\t\t\t\t\t\t\t\t , $this->getLinkTarget(\"info_short\")\n\t\t\t\t\t\t\t\t );\n\t\t}\n\t\t\n\t\tif ($this->checkAccess(\"write\")) {\n\t\t\t$this->tabs_gui->addTab( self::TAB_SETTINGS\n\t\t\t\t\t\t\t\t , $this->lng->txt(\"settings\")\n\t\t\t\t\t\t\t\t , $this->getLinkTarget(\"settings\")\n\t\t\t\t\t\t\t\t );\n\t\t\t//Maybe some time this will be: if ($this->checkAccess(\"manage_members\")) {\n\t\t\t$this->tabs_gui->addTab( self::TAB_MEMBERS\n\t\t\t\t\t\t\t\t , $this->lng->txt(\"members\")\n\t\t\t\t\t\t\t\t , $this->getLinkTarget(\"members\")\n\t\t\t\t\t\t\t\t );\n\t\t}\n\n\t\tparent::getTabs($this->tabs_gui);\n\t}",
"protected function createTabs() {}",
"function thsp_get_theme_options_tabs() {\n\n\t$tabs = array(\n\t\t'first_tab' => array(\n\t\t\t// Tab ID\n\t\t\t'name' => 'first_tab',\n\t\t\t// Tab display Title\n\t\t\t'title' => __( 'First Tab Options', 'ts_theme_settings' ),\n\t\t\t// Tab sections array\n\t\t\t'sections' => array(\n\t\t\t\t'first_tab_first' => array(\n\t\t\t\t\t// Section ID\n\t\t\t\t\t'name' => 'first_tab_first',\n\t\t\t\t\t// Section display title\n\t\t\t\t\t'title' => __( 'First Tab First', 'ts_theme_settings' ),\n\t\t\t\t\t// Section description, optional\n\t\t\t\t\t'description' => __( 'This is the first section in the first tab', 'ts_theme_settings' )\n\t\t\t\t),\n\t\t\t\t'first_tab_second' => array(\n\t\t\t\t\t'name' => 'first_tab_second',\n\t\t\t\t\t'title' => __( 'First Tab Second', 'ts_theme_settings' ),\n\t\t\t\t\t'description' => __( 'This is the second section in the first tab', 'ts_theme_settings' )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\t'second_tab' => array(\n\t\t\t'name' => 'second_tab',\n\t\t\t'title' => __( 'Second Tab Options', 'ts_theme_settings' ),\n\t\t\t'sections' => array(\n\t\t\t\t'second_tab_first' => array(\n\t\t\t\t\t'name' => 'second_tab_first',\n\t\t\t\t\t'title' => __( 'Second Tab First', 'ts_theme_settings' ),\n\t\t\t\t\t'description' => __( 'This is the first section in the second tab', 'ts_theme_settings' )\n\t\t\t\t),\n\t\t\t\t'second_tab_second' => array(\n\t\t\t\t\t'name' => 'second_tab_second',\n\t\t\t\t\t'title' => __( 'Second Tab Second', 'ts_theme_settings' ),\n\t\t\t\t\t'description' => __( 'This is the second section in the second tab', 'ts_theme_settings' )\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n\n\treturn $tabs;\n\t\n}",
"function get_settings_tabs() {\n\t\t$tabs = array(\n\t\t\t'media' => _x( 'Media Library', 'Show the media library tab', 'amazon-s3-and-cloudfront' ),\n\t\t\t'support' => _x( 'Support', 'Show the support tab', 'amazon-s3-and-cloudfront' )\n\t\t);\n\n\t\treturn apply_filters( 'as3cf_settings_tabs', $tabs );\n\t}",
"public function getTabs() {\n return $this->tabs;\n }",
"public function getTabs()\r\n {\r\n return $this->_tabs;\r\n }",
"public function get_all_tabs() {\n\t\treturn $this->tabs;\n\t}",
"private function initTabs()\n {\n //Transaction Overview tab on the side menu\n $tabsConfig = [];\n $tabsConfig[] = new AdminControllerTabConfig(\n $this->name,\n 'heading_title_transaction_details',\n 'WirecardTransactions',\n 'payment',\n 1,\n 'SELL'\n );\n\n //Contact support tab in the module settings\n $tabsConfig[] = new AdminControllerTabConfig(\n $this->name,\n 'heading_title_support',\n 'WirecardSupport'\n );\n\n $tabsConfig[] = new AdminControllerTabConfig(\n $this->name,\n 'heading_title_ajax',\n 'WirecardAjax'\n );\n\n //General tab setting in the module settings\n $tabsConfig[] = new AdminControllerTabConfig(\n $this->name,\n 'heading_title_general_settings',\n 'WirecardGeneralSettings'\n );\n\n return $tabsConfig;\n }",
"public function getTabs()\n {\n if (array_key_exists(\"tabs\", $this->_propDict)) {\n return $this->_propDict[\"tabs\"];\n } else {\n return null;\n }\n }",
"protected function get_tabs_for_filter_dialog() {\n\t\t$tabs = array(\n\t\t\t'taxonomies-for-termmeta' => array(\n\t\t\t\t'title' => __( 'Taxonomies', 'wpcf' ),\n\t\t\t)\n\t\t);\n\n\t\treturn $tabs;\n\n\t}",
"public static function tabs()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t\"title\" => __(\"E-Mail activation\"),\n\t\t\t\t\"id\" => \"activation-email-settings\"\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"title\" => __(\"Reset password request\"),\n\t\t\t\t\"id\" => \"reset-password-email-settings\"\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"title\" => __(\"E-Mail change request\"),\n\t\t\t\t\"id\" => \"change-email-settings\"\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"title\" => __(\"Passsord changed notify\"),\n\t\t\t\t\"id\" => \"password-change-notify-settings\"\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"title\" => __(\"E-Mail changed notify\"),\n\t\t\t\t\"id\" => \"email-change-notify-settings\"\n\t\t\t),\n\t\t);\n\t}",
"public static function tabs() {\n\t\t// Available tabs.\n\t\t$tabs = [\n\t\t\t'general' => __( 'Settings', 'ga_trans' ),\n\t\t\t'tracking' => __( 'Tracking ID', 'ga_trans' ),\n\t\t\t'permissions' => __( 'Permissions', 'ga_trans' ),\n\t\t];\n\n\t\t// Remove permission settings if sub site admins can't change permissions.\n\t\tif ( ! Permission::can_overwrite() && ! is_network_admin() && General::is_networkwide() ) {\n\t\t\tunset( $tabs['permissions'] );\n\t\t}\n\n\t\t// Network admin doesn't have any restriction.\n\t\tif ( ! is_network_admin() ) {\n\t\t\t$tabs['reports'] = __( 'Reports', 'ga_trans' );\n\t\t}\n\n\t\t/**\n\t\t * Filter hook to modify settings tabs.\n\t\t *\n\t\t * @param array $args Tabs.\n\t\t *\n\t\t * @since 3.2.0\n\t\t */\n\t\treturn apply_filters( 'beehive_view_settings_tabs', $tabs );\n\t}",
"private function get_settings_tabs() {\n\t\treturn apply_filters( $this->func . '_settings_tabs', array() );\n\t}",
"function getViewTabs() {\n\t\treturn $this->getTableData ( \".arrViewTabs\" );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the current status of bypass_assets flag | public function bypass_assets():bool
{
return $this->_bypass_assets;
} | [
"public function getAssetStatus()\n {\n return $this->asset_status;\n }",
"public function getCacheStatus(): mixed\n {\n return $this->getCacheOptions()['enable'];\n }",
"public function hasAccessTo() {\n return $this->getAffiliate()->getAssets();\n }",
"public function get_progress_flag() {\n\t\treturn get_option( $this->get_filter( 'seo-progress' ), false );\n\t}",
"public function getUsageCanDownload();",
"public function hasAssets();",
"public function bypass():bool\n {\n return $this->_bypass;\n }",
"public function get_3dSecureStatus()\n {\n return $this->_3dSecureStatus;\n }",
"public function getAssetIsFor()\n {\n return $this->asset_is_for;\n }",
"public function get_antivirus_state()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! $this->is_loaded)\n $this->_load_config();\n\n if (isset($this->params['bypass_virus_checks_maps'])) {\n if ($this->params['bypass_virus_checks_maps'] == \"(1)\")\n return FALSE;\n else\n throw new Engine_Exception('Custom configuration detected');\n } else {\n return TRUE;\n }\n }",
"public function downloadable()\n {\n return (bool) $this->asset->downloadable;\n }",
"static function assetsProtected() {\n return defined('PROTECT_ASSETS_FOLDER') && PROTECT_ASSETS_FOLDER;\n }",
"protected function initialStatusDownload() {\n return FALSE;\n }",
"protected function verifyStatus()\n {\n $config = $this->config->get('antares/extension::mode', 'normal');\n $input = $this->request->input('_mode', $config);\n\n if ($input == 'safe') {\n $this->enableSafeMode();\n } else {\n $this->disableSafeMode();\n }\n }",
"public static function status()\n {\n if (Cache::has(config('mesomb.application_cache_key'))) {\n return Cache::get(config('mesomb.application_cache_key'));\n } else {\n return self::checkStatus();\n }\n }",
"public function spUploadActived()\n\t{\n\t\t\n\t\treturn $this->configuration->get(\"sharePointUpload\");\n\t}",
"protected function initialStatusDownload() {\n return TRUE;\n }",
"function _obtainStatus()\n\t{\n\t\t// Get output writable status\n\t\tjpimport('models.registry', true);\n\t\t$registry =& JoomlapackModelRegistry::getInstance();\n\t\t$outdir = $registry->get('OutputDirectory');\n\n\t\tjimport('joomla.filesystem.path');\n\t\t$outdir = JPath::clean($outdir,'/');\n\t\t$this->outputWritable = is_writable($outdir);\n\n\t\t// Get temp writable status\n\t\t$jregistry = JFactory::getConfig();\n\t\t$tempdir = $jregistry->getValue('config.tmp_path');\n\t\t$tempdir = JPath::clean($tempdir);\n\n\t\t$this->tempWritable = is_writable($tempdir);\n\n\t\t$this->status = $this->outputWritable && $this->tempWritable;\n\t}",
"public function getLicenseKeyStatus()\n\t{\n\t\t$status = blx()->fileCache->get('licenseKeyStatus');\n\t\treturn $status;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end arrayPrefixKeys() Filter an array by keys from another array. Returns an array that has the key/value pairs from $data only if the key is present in $keys. Solution copied from | function arrayFilterByKeys(array $data, array $keys)
{
return array_intersect_key($data, array_flip($keys));
} | [
"function array_filter_keys($input, $keys)\n{\n return array_intersect_key($input, array_flip($keys));\n}",
"function array_filter_keys($array, $keys) {\r\n return array_intersect_key($array, array_flip($keys));\r\n}",
"function extractKeysOfArray(array $keys, array $data, $includeNonExistentKeys = false)\n {\n $outputArray = [];\n foreach ($keys as $key) {\n if (array_key_exists($key, $data)) {\n $outputArray[$key] = $data[$key];\n } else {\n if ($includeNonExistentKeys) {\n $outputArray[$key] = null;\n }\n }\n }\n return $outputArray;\n }",
"function array_only_keys(array $array, $keys)\r\n{\r\n return array_intersect_key($array, array_flip((array) $keys));\r\n}",
"public static function subArraysFilterKeys ($arr = array(), $keys=array())\n {\n if(!empty($arr)){\n $res = array();\n foreach($arr as $sub_arr){\n $res[] = self::arrayFilterKeys($sub_arr, $keys);\n }\n return $res;\n }\n return $arr;\n }",
"function filterKeys($array, $keep){}",
"protected function filterArray(array $keys, array $array)\n {\n return array_intersect_key($array, array_flip($keys));\n }",
"function array_only(array $array, array $keys)\n{\n $intersect = array_fill_keys($keys, null);\n return array_intersect_key($array, $intersect);\n}",
"function arrayFilterByKeys($array, $allowedKeys)\n{\n if (version_compare(PHP_VERSION, '5.6.0', '<')) {\n return array_intersect_key($array, array_flip($allowedKeys));\n } else {\n return array_filter(\n $array,\n function($k) use ($allowedKeys) {\n return in_array($k, $allowedKeys);\n },\n ARRAY_FILTER_USE_KEY\n );\n }\n}",
"function array_values_from_keys($array, $keys) {\r\n return array_values(array_filter_keys($array, $keys));\r\n}",
"function arrayPrefixKeys($prefix, array $arr)\n{\n $keys = arrayPrefix($prefix, array_keys($arr));\n return array_combine($keys, array_values($arr));\n\n}",
"function filterModelKeys(array $data, array $keys)\n{\n $only = array_flip($keys);\n\n foreach ($data as $key => $value) {\n if (is_array($value)) {\n $data[$key] = filterModelKeys($value, $keys);\n continue;\n }\n\n if (! isset($only[$key])) {\n unset($data[$key]);\n }\n }\n\n return $data;\n}",
"function array_only($array, $keys)\n{\n return array_intersect_key($array, array_flip((array)$keys));\n}",
"public static function arrayRemoveKeys(array $from, array $keys, bool $strict = false)\n {\n return F\\filter($from, fn ($_, $key) => !\\in_array($key, $keys, $strict));\n }",
"function array_intersect_keys() {\n\t$args = func_get_args();\n\t$array = array_shift($args);\n\tif (is_array($args[0]))\n\t\t$args = $args[0];\n\t$result = array();\n\tforeach ($array as $key => $value) {\n\t\tif (in_array($key, $args))\n\t\t\t$result[$key] = $value;\n\t}\n\treturn $result;\n}",
"public function only($keys)\n {\n $results = [];\n\n $input = $this->all();\n\n $placeholder = new stdClass;\n\n foreach (is_array($keys) ? $keys : func_get_args() as $key) {\n $value = data_get($input, $key, $placeholder);\n\n if ($value !== $placeholder) {\n Arr::set($results, $key, $value);\n }\n }\n\n return $results;\n }",
"protected function prefixKeys($array, $prefix) {\n $return = [];\n foreach ($array as $k => $v) {\n $return[$prefix . '-' . $k] = $v;\n }\n\n return $return;\n }",
"function removekeys($src, $keys){\n return array_diff_key($src, array_flip($keys));\n }",
"function removekeys($src, $keys){\n\t\treturn array_diff_key($src, array_flip($keys));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if $entity is a valid category | public function instanceOfCategory(ElggEntity $entity = null) {
if (!$entity instanceof ElggEntity) {
return false;
}
if (!in_array($entity->getSubtype(), $this->config->getCategorySubtypes())) {
return false;
}
return true;
} | [
"public function validateCategory()\n {\n\n }",
"public function is_category($category = '')\n {\n }",
"private function isValidCategory(string $category)\n {\n return in_array($category, $this->jokeClient->fetchCategories());\n }",
"public function isValidCat($cat){\r\n \treturn isset($this->categories[$cat]); \r\n\t}",
"private function checkCategory(Product $product, Category $category)\n {\n if (!$product->categories()->find($category->id)) {\n throw new HttpException(\n JsonResponse::HTTP_UNPROCESSABLE_ENTITY,\n 'The category specified is not an actual category assigned to the product.'\n );\n }\n }",
"private function validateCategory(string $category) \n {\n return in_array($category, [\n 'backgrounds', 'fashion', 'nature', 'science', 'education', 'feelings',\n 'health', 'people', 'religion', 'places', 'animals', 'industry', 'computer',\n 'food', 'sports', 'transportation', 'travel', 'buildings', 'business', 'music'\n ]);\n }",
"public function testGetInvalidCategoryByCategoryName() {\n\t\t//grab a category id that exceeds the maximum allowable category id\n\t\t$category = Category::getCategoryByCategoryName($this->getPDO(), \"fake category\");\n\t\t$this->assertNull($category);\n\t}",
"public function testInsertCategory_ValidData()\n\t{\n\t\t$shopModel = getModel('shop');\n\t\t$repository = $shopModel->getCategoryRepository();\n\n // Create new Product category object\n $category = new Category();\n $category->module_srl = 2;\n $category->title = \"Product category 1\";\n\n\t\ttry\n\t\t{\n\t\t\t// Try to insert the new Category\n\t\t\t$category_srl = $repository->insertCategory($category);\n\n\t\t\t// Check that a srl was returned\n\t\t\t$this->assertNotNull($category_srl);\n\n\t\t\t// Read the newly created object from the database, to compare it with the source object\n\t\t\t$output = Database::executeQuery(\"SELECT * FROM xe_shop_categories WHERE category_srl = $category_srl\");\n\t\t\t$this->assertEquals(1, count($output));\n\n\t\t\t$new_category = $output[0];\n\t\t\t$this->assertEquals($category->module_srl, $new_category->module_srl);\n\t\t\t$this->assertEquals($category->title, $new_category->title);\n\t\t\t$this->assertNotNull($new_category->regdate);\n\t\t\t$this->assertNotNull($new_category->last_update);\n\n\t\t\t// Delete product we just added after test is finished\n\t\t\tDatabase::executeNonQuery(\"DELETE FROM xe_shop_categories WHERE category_srl = $category_srl\");\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\t$this->fail($e->getMessage());\n\t\t}\n\t}",
"public function testGetValidCategoryByCategoryName() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"category\");\n\t\t// create a new Category and insert it into mySQL\n\t\t$category = new Category(null, $this->VALID_CATEGORYNAME);\n\t\t$category->insert($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Category::getCategoryByCategoryName($this->getPDO(), $category->getCategoryName());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"category\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\CartridgeCoders\\\\Category\", $results);\n\t\t// grab the result from the array and validate it\n\t\t$pdoCategory = $results[0];\n\t\t$this->assertEquals($pdoCategory->getCategoryName(), $this->VALID_CATEGORYNAME);\n\t}",
"private function validateCategory($request) {\n $this->validate($request, [\n 'name' => 'required|unique:categories'\n ]);\n }",
"private function isCategory($itemMenu)\n {\n return is_array($itemMenu) && !isset($itemMenu[\"_entity_name\"]);\n }",
"function _ifItemCategory($name = '', $value='') {\n global $catid, $manager;\n \n $b =& $manager->getBlog(getBlogIDFromItemID($this->currentItem->itemid));\n\n // when no parameter is defined, just check if a category is selected\n if (($name != 'catname' && $name != 'catid') || ($value == ''))\n return $b->isValidCategory($catid);\n \n $icatid = $this->currentItem->catid;\n //$icategory = $this->currentItem->category;\n\n // check category name\n if ($name == 'catname') {\n $value = $b->getCategoryIdFromName($value);\n if ($value == $icatid)\n return $b->isValidCategory($icatid);\n }\n\n // check category id\n if (($name == 'catid') && ($value == $icatid))\n return $b->isValidCategory($icatid);\n\n return false;\n }",
"public function testGetInvalidCategoryByCategoryName() : void {\n\t\t//grab a category by name that does not exist\n\t\t$category = Category::getCategoryByCategoryName($this->getPDO(), \"purple peanuts\");\n\t\t$this->assertCount(0, $category);\n\t}",
"public function is_event_category( $category );",
"public function testGetValidCategoryByCategoryName() : void {\n\t\t//count the number of rows and save for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"category\");\n\n\t\t// create a new Category and insert to into mySQL\n\t\t$categoryId = generateUuidV4();\n\t\t$category = new Category($categoryId, $this->profile->getProfileId(), $this->VALID_CATEGORYNAME);\n\t\t$category->insert($this->getPDO());\n\n\t\t//grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Category::getCategoryByCategoryName($this->getPDO(), $category->getCategoryName());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"category\"));\n\t\t$this->assertCount(1, $results);\n\n\t\t//enforce no other objects are bleeding into the test\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\Kmaru\\\\Category\", $results);\n\n\t\t//grab the result from the array and validate it\n\t\t$pdoCategory = $results[0];\n\t\t$this->assertEquals($pdoCategory->getCategoryId(), $categoryId);\n\t\t$this->assertEquals($pdoCategory->getCategoryProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoCategory->getCategoryName(), $this->VALID_CATEGORYNAME);\n\t}",
"private function validateCategory($request)\n {\n return $request->validate([\n 'category_name_en' => ['required','max:30','min:3','string'],\n 'category_name_bn' => ['required','max:30','min:3','string'],\n 'category_description' => ['required','max:150','min:5'],\n 'status' => ['required'],\n ]);\n }",
"public function isValidEntity($entity);",
"public function checkCategoryValidity($category,$msg){\n if(is_numeric($category)){\n return true;\n }\n else{\n $msg = new generate_message();\n $msg->show(\"category_value_must_be_number\");\n return false;\n }\n\n }",
"private function validateCategory()\n\t{\n\t\t/*\n\t\t* A valid name consists of print characters and spaces, not including slashes (\\ nor /).\n\t\t* A valid name is also one that is at least of length 1 when not counting white space.\n\t\t*/\n\t\tValidator::extend('validName', function($attribute, $value, $parameters)\n\t\t{\n\t\t\treturn Utils::validateName($value);\n\t\t});\n\n\t\t// validate\n\t\t$validator = Validator::make(Input::all(), array(\n\t\t\t'categoryName' => 'required|validName',\n\t\t\t'taskDeadline' => 'date'\n\t\t\t)\n\t\t);\n\n\t\treturn $validator;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get list of stock items | public function stockItems($params = array(), $list_info = true)
{
return $this->get('/stock_items/index.json'.$this->_getRequestParams($params, $list_info));
} | [
"public function getAllStock()\n\t{\n \n\t\t$stock = array(); \n \t$results = $this->db -> select(\"SELECT * from stock\");\n \n\t\tforeach($results as $result)\n\t\t{\n\t\t\t$item = new StockItem();\n\t $item->hydrate($result);\n \t$stock[] = $item;\n }\n \n return $stock; \n \n\t}",
"private function getStockListContents(): array\n {\n $list = $this->stocklistID;\n $this->db->select('i.eve_iditem as id, i.name as name, i.volume as vol');\n $this->db->from('itemlist il');\n $this->db->join('itemcontents ic', 'ic.itemlist_iditemlist = il.iditemlist');\n $this->db->join('item i', 'i.eve_iditem = ic.item_eve_iditem');\n $this->db->where('il.iditemlist', $list);\n $query = $this->db->get();\n $result = $query->result();\n\n return $result;\n }",
"public function showStock()\n {\n $sql = \"SELECT product_name as name, stock FROM products ORDER BY stock ASC\";\n $query = $this->dbh->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }",
"public function get_all_stock()\n {\n $query = $this->db->query(\"SELECT * FROM Stock_Master\");\n return $query->result_array();\n }",
"public function getManageStock();",
"public function all() {\n $stmt = $this->pdo->query('SELECT id, symbol, company '\n . 'FROM stocks '\n . 'ORDER BY symbol');\n $stocks = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $stocks[] = [\n 'id' => $row['id'],\n 'symbol' => $row['symbol'],\n 'company' => $row['company']\n ];\n }\n return $stocks;\n }",
"function get_items_with_stock_details()\n {\n $db = JFactory::getDBO();\n \n $category_id = intval(JRequest::getVar(\"category_id\"));\n $location_id = intval(JRequest::getVar(\"location_id\"));\n \n $query = \"select i.id, i.item_name, i.gst_percent, i.last_purchase_rate, i.piece_per_pack, i.sale_price1, i.sale_price2, ii.stock from `#__items` i left join `#__inventory_items` ii on (i.id=ii.item_id and ii.location_id=\" . $location_id . \") where i.category_id=\" . $category_id . \" order by i.item_name\";\n $db->setQuery($query);\n $items = $db->loadObjectList();\n \n $html = \"\";\n \n $html .= \"<select class='item_id' name='item_id[]' style='width:140px;'>\";\n $html .= \"<option value='0' style='text-align:left;'></option>\";\n \n if(count($items) > 0)\n {\n foreach($items as $item)\n { \n $html .= \"<option value='\" . $item->id . \"' last_purchase_rate='\" . $item->last_purchase_rate . \"' piece_per_pack='\" . $item->piece_per_pack . \"' sale_price1='\" . $item->sale_price1 . \"' sale_price2='\" . $item->sale_price2 . \"' stock='\" . floatval($item->stock) . \"' gst_percent='\" . floatval($item->gst_percent) . \"' style='text-align:left;'>\" . $item->item_name . \"</option>\";\n }\n }\n \n $html .= \"</select>\";\n \n echo $html;\n }",
"public function getStockItem()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Stock Items (Linnworks API)');\n\t\t}",
"public function testGETSkuIdStockItems()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function getStocks()\n {\n if (array_key_exists('stocks', $this->cache)) {\n return $this->cache['stocks'];\n }\n\n $res = [];\n $data = XmlDataSource::create($this->inputFiles->getFile('Stock.xml'))->getAsArray();\n if (array_key_exists('Stock', $data)) {\n $res = array_key_exists('Product', $data['Stock']) ? [$data['Stock']] : $data['Stock'];\n }\n\n $this->cache['stocks'] = $res;\n\n return $res;\n }",
"public function findOpenItems ( )\n {\n return $this->executeRequest('openitems','GET');\n }",
"public function list () {\n return Item::orderBy('name', 'asc')->get();\n }",
"public function actionProduct_all_stockage(){\r\n \t$result = array();\r\n \tif (!isset($_GET['sku']) || trim($_GET['sku'])=='') {\r\n \t\texit( json_encode($result) );\r\n \t}\r\n\r\n \t$stockage = InventoryHelper::getProductAllInventory(trim($_GET['sku']));\r\n \tif ($stockage <> null){\r\n \t\t\t$result = $stockage;\r\n \t}\r\n \texit( json_encode($result) );\r\n }",
"public function findOpenItems()\n {\n return $this->executeRequest('openitems', 'GET');\n }",
"public function getOrdersItems();",
"function get_all_product_stock()\n {\n return $this->db->get('product_stock')->result_array();\n }",
"public function StockListing() {\n\t$rs = $this->StockItemTable()->Records_forTitle($this->GetKeyValue());\n\t$oHdr = new fcSectionHeader('Stock');\n\t$out =\n\t //$this->Engine()->App()->Page()->ActionHeader('Stock')\n\t $oHdr->Render()\n\t .$rs->AdminList(array('none'=>'There is no stock for this title.'))\n\t ;\n\treturn $out;\n }",
"function getSupplierItems();",
"public function listItems();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure that logging queries works. | public function testQueryLogging()
{
$logger = $this->getMockBuilder('Cake\Log\Engine\BaseLog')->setMethods(['log'])->getMock();
$logger->expects($this->once())->method('log');
Log::config('elasticsearch', $logger);
$connection = ConnectionManager::get('test');
$connection->logQueries(true);
$result = $connection->request('_stats');
$connection->logQueries(false);
$this->assertNotEmpty($result);
} | [
"static public function enableQueryLogging() {\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = TRUE;\n\t}",
"public function enableQueryLog() {\n\t\t$this->loggingQueries = true;\n\t}",
"public function enableQueryLog()\n {\n $this->loggingQueries = true;\n }",
"abstract protected function _logQuery($query);",
"public static function enableQueryLog()\n {\n static::$instance = static::$instance ?: new static();\n\n static::$connection->enableQueryLog();\n }",
"public function enableQueryLog();",
"private function logQuery() {\n if (!$this->are_queries_logged) return;\n\n if (sizeof($this->logged_queries) > $this->max_logged_queries) {\n $this->are_queries_logged = false;\n $this->logged_queries[] = 'Number of maximum logged queries exceeded; turning off logging.';\n $this->logged_queries[] = 'Call tx_newspaper::setMaxLoggedQueries() to increase the number of logged queries.';\n } else {\n $this->logged_queries[] = $this->query;\n }\n }",
"public function EnableQueryLog(): void\n {\n $this->loggingQueries = true;\n }",
"public function logQueries()\n {\n // DbLoJack Helper\n $helper = app('db_lojack');\n\n // Log database queries for the request\n foreach ($helper->connections() as $connection) {\n $queries = DB::connection($connection)->getQueryLog();\n $helper->logQueries($queries, $connection );\n }\n }",
"public static function enableQueryLog()\n { //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\MySqlConnection $instance */\n $instance->enableQueryLog();\n }",
"public function enableQueryLog()\n {\n // enable debug log\n if ($this->debug) {\n DB::connection()->enableQueryLog();\n }\n }",
"public function disableQueryLogging(): void\n {\n $this->conn->disableQueryLogging();\n }",
"public function disableQueryLogging(): void\n {\n $this->queryLogging = false;\n }",
"protected function configureLogging () {\n\t\tparent::configureLogging();\n\n\t\t$logger = new DebugStack();\n\t\t$this -> getDBConfig() -> setSQLLogger($logger);\n\n\t\t$this -> after(function () use ($logger) {\n\t\t\tforeach ($logger -> queries as $query) {\n\t\t\t\tself::getMonolog() -> debug($query[\"sql\"], array(\n\t\t\t\t\t\"params\" => $query[\"params\"],\n\t\t\t\t\t\"types\" => $query[\"types\"]\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t}",
"public function flushQueryLog();",
"public static function disableQueryLog()\n {\n }",
"public function disableQueryLog()\n {\n $this->loggingQueries = false;\n }",
"protected function enableDatabaseLogging()\n {\n // TODO: Implement enableDatabaseLogging() method.\n }",
"public function logSql() {\n\t\t\tif (Configure::read('debug') < 2) {\n\t\t\t\ttrigger_error('You must set debug level to at least 2 to enable SQL-logging',\n\t\t\t\t\tE_USER_NOTICE);\n\t\t\t}\n\t\t\t$dbo = $this->getDatasource();\n\t\t\t$logs = $dbo->getLog();\n\t\t\t$this->log($logs['log']);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function called to create a table which stores the contents of $_inputs array for a particular state in the requestDB database in the table which is names after the state. This table would be later used for the pupose of deciding response for a particular input from page and then further deciding the transition. | public function buildFormInputFieldTable($databaseName = "requestDB") {
// take credentials from config.php and connect to database.
$config = include('config.php');
$databaseHostname = $config['databaseHostname'];
$databaseUsername = $config['databaseUsername'];
$databasePassword = $config['databasePassword'];
$conn = new \mysqli($databaseHostname, $databaseUsername, $databasePassword);
if ($conn->connect_error) {
die("Connection Error:".$conn->connect_error);
}
// Connects to DB, create if does not exist.
$sql = "CREATE DATABASE IF NOT EXISTS ".$databaseName;
if ($conn->query($sql) === TRUE) {
$conn->close();
}
// Creates a table with name as stateName for state's form input fields and saves the content.
$conn = new \mysqli($databaseHostname, $databaseUsername, $databasePassword, $databaseName);
if ($conn->connect_error) {
die("Connection Error: ".$conn->connect_error);
}
$sql = "CREATE TABLE IF NOT EXISTS ".$this->stateName."_".$this->stateType."(
inputType VARCHAR(50) NOT NULL,
name VARCHAR(50) NOT NULL,
label VARCHAR(50),
defaultValue VARCHAR(50)
)";
if ($conn->query($sql) === TRUE) {
// Empty the table, to override the contents.
$sql = "TRUNCATE TABLE ".$this->stateName."_".$this->stateType;
$conn->query($sql);
foreach($this->_inputs as $key => $input) {
// Skip the submit buttons
if ($input['inputType'] == "submit") {
continue;
}
$sql = "INSERT INTO ".$this->stateName."_".$this->stateType." (inputType, name, label, defaultValue)
VALUES (\"".$input['inputType']."\", \"".$input['name']."\", \"".$input['label']."\", \"".$input['defaultValue']."\")";
if ($conn->query($sql) === FALSE) {
die("Unable to add entries to FormEntries table ".$conn->error);
}
}
}
else {
die("Unable to create Table for state \"".$this->stateName."_".$this->stateType."\": ".$conn->error);
}
$conn->close();
} | [
"function create_form_table($args) {\n\t\t$table_name = $args[\"singular_code_name\"];\n\t\t$result = $GLOBALS['db']->query(\"DROP TABLE \".$table_name);\n\t\t$result = $GLOBALS['db']->query(\"CREATE TABLE IF NOT EXISTS \".$table_name.\" (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY)\");\n\n\t\t$items = $args[\"items\"];\n\n\t\tforeach($items as $item) {\n\t\t\tif($item[\"type\"] == 'input') {\n\t\t\t\tswitch($item[\"var_type\"][0]) {\n\t\t\t\t\tcase 'varchar':\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'string':\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" VARCHAR(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" \".$item[\"var_type\"][0].\"(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD reg_date TIMESTAMP\");\n\t}",
"public function build_tables ( ) {\n\n // Pull the event names\n $sql = \"SELECT name FROM tracked_events WHERE active = 1\";\n\n $tracked_events = $this->query( $sql );\n\n // Iterate over the tracked events\n foreach ($tracked_events as $event) {\n\n // Create a new table for each event\n $sql = \"CREATE TABLE IF NOT EXISTS `\" . $event['name'] . \"` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `date` datetime NOT NULL,\n `value` int(11) NOT NULL,\n `active` int(11) NOT NULL,\n UNIQUE KEY `id` (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8\";\n\n $this->query( $sql );\n\n }\n\n }",
"private function initialize_table()\n\t{\n\t\tself::$xform_table_name = $this->config->item(\"table_xform\");\n\t\tlog_message(\"debug\", \"Xform table => \" . $this->config->item(\"table_xform\"));\n\t\tself::$archive_xform_table_name = $this->config->item(\"table_archive_xform\");\n\t}",
"function createSQLForm()\n {\n $table = $_SESSION[\"focus\"];\n $columns = NULL;\n $values = NULL;\n \n $con = $this->initDB();\n \n //formating here looks retarded, but it has to be that way.\n foreach ($_POST as $col=>$val)\n {\n $columns .= \", \".$col;\n $values .= \", '\".$val.\"'\";\n }\n //Mash the final part of the strings together\n $columns = \"id\".$columns;\n $values = \"NULL\".$values;\n \n //Create an epic query\n $sql = \"INSERT INTO $table ($columns) VALUES ($values)\";\n if ($query = mysql_query($sql, $con))\n $_SESSION['msg'] = \"Table created!\";\n else\n $_SESSION['msg'] = mysql_error();\n \n //move along \n header('Location: index.php?pageid='.$_SESSION['focus']);\n }",
"abstract protected function buildTable();",
"public function saveToDatabase($databaseName = \"requestDB\", $stateTableName = \"AutomataStates\", $transitionTableName = \"AutomataTransitions\") {\n\t\t// Takes credentials from config.php and connects to DB.\n\t\t$config = include('config.php');\n\t\t$databaseHostname = $config['databaseHostname'];\n\t\t$databaseUsername = $config['databaseUsername'];\n\t\t$databasePassword = $config['databasePassword'];\n\t\t$conn = new \\mysqli($databaseHostname, $databaseUsername, $databasePassword);\n\t\tif ($conn->connect_error) {\n\t\t\tdie(\"Connection Error:\".$conn->connect_error);\n\t\t}\n\t\t// Connects to DB, create if does not exist.\n\t\t$sql = \"CREATE DATABASE IF NOT EXISTS \".$databaseName;\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t$conn->close();\n\t\t}\n\n\t\t// Creates a table for states and saves the content.\n\t\t$conn = new \\mysqli($databaseHostname, $databaseUsername, $databasePassword, $databaseName);\n\t\tif ($conn->connect_error) {\n\t\t\tdie(\"Connection Error: \".$conn->connect_error);\n\t\t}\n\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$stateTableName.\" (\n\t\tstateIndex INT(5) PRIMARY KEY,\n\t\tstateName VARCHAR(50) NOT NULL,\n\t\tstateID INT(5),\n\t\tstateType VARCHAR(50) NOT NULL \n\t\t)\";\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t// Empty the table, to override the contents.\n\t\t\t$sql = \"TRUNCATE TABLE \".$stateTableName;\n\t\t\t$conn->query($sql);\n\t\t\tforeach ($this->_states as $key => $state) {\n\t\t\t\t$sql = \"INSERT INTO \".$stateTableName.\"(stateIndex, stateName, stateID, stateType) VALUES (\\\"\".$key.\"\\\", \\\"\".$state['stateName'].\"\\\", \\\"\".$state['stateID'].\"\\\", \\\"\".$state['stateType'].\"\\\")\";\n\t\t\t\tif ($conn->query($sql) === FALSE) {\n\t\t\t\t\tdie(\"Unable to add entries to table \".$stateTableName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tdie(\"Table \".$stateTableName.\" Creation Error:\".$conn->error);\n\t\t}\n\n\t\t// Create a table for transitions and add contents.\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$transitionTableName.\" (\n\t\ttransitionID INT(5) PRIMARY KEY,\n\t\ttransitionName VARCHAR(50) NOT NULL,\n\t\tpresentState VARCHAR(50) NOT NULL,\n\t\tnextState VARCHAR(50) NOT NULL,\n\t\tresponse VARCHAR(50) NOT NULL \n\t\t)\";\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t// Empty the table, to override the contents.\n\t\t\t$sql = \"TRUNCATE TABLE \".$transitionTableName;\n\t\t\t$conn->query($sql);\n\t\t\tforeach ($this->_transitions as $key => $transition) {\n\t\t\t\t$sql = \"INSERT INTO \".$transitionTableName.\"(transitionID, transitionName, presentState, nextState, response) VALUES (\\\"\".$key.\"\\\", \\\"\".$transition['transitionName'].\"\\\", \\\"\".$transition['presentState'].\"\\\", \\\"\".$transition['nextState'].\"\\\", \\\"\".$transition['response'].\"\\\")\";\n\t\t\t\tif ($conn->query($sql) === FALSE) {\n\t\t\t\t\tdie(\"Unable to add entries to table \".$transitionTableName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tdie(\"Table \".$transitionTableName.\" Creation Error:\".$conn->error);\n\t\t}\n\n\t\t$conn->close();\n\t}",
"function makeFields() {\n\t\t$table_fields = '';\n\t\t$entry = '';\n\t\t$pwFieldName = '';\n\t\t$dateFieldName = '';\n\t\t$theUpfieldName = '';\n\t\t$upFieldName = array();\n\t\t$formFieldValue = array();\n\t\t$selectedValues = array();\n\t\t$postvar = array();\n\t\t$form_array = $this->inputArray;\n\t\twhile ($formArray = each($form_array)) {\n\t\t\t$fieldset = $formArray['key'];\n\t\t\twhile ($formConf = each($form_array[$fieldset])) {\n\t\t\t\t$label = $formConf['key'];\n\t\t\t\twhile ($config = each($form_array[$fieldset][$label])) {\n\t\t\t\t\t$thetype = $config['key'];\n\t\t\t\t\t$thevalue = $config['value'];\n\t\t\t\t\t$i = 0;\n\t\t\t\t\twhile ($type = each($form_array[$fieldset][$label][$thetype])) { // 4th while\n\t\t\t\t\t\t$nameFields = $type['key'];\n\t\t\t\t\t\t$formFields = $type['value'];\n\t\t\t\t\t\t$inputKey = $this->array_key_check($form_array[$fieldset][$label], 'input');\n\t\t\t\t\t\t$selectKey = $this->array_key_check($form_array[$fieldset][$label], 'select');\n\t\t\t\t\t\t$textareKey = $this->array_key_check($form_array[$fieldset][$label], 'textarea');\n\t\t\t\t\t\t$typeKey = $this->array_key_check($form_array[$fieldset][$label][$thetype], 'type');\n\t\t\t\t\t\t$nameKey = $this->array_key_check($form_array[$fieldset][$label][$thetype], 'name');\n\t\t\t\t\t\t// avoid 'undefined indexes' errors\n\t\t\t\t\t\tif (!$_POST) $checkPostVar = FALSE;\n\t\t\t\t\t\telse $checkPostVar = TRUE;\t\n\t\t\t\t\t\tif (!$_FILES) $checkFilesVar = FALSE;\n\t\t\t\t\t\telse $checkFilesVar = TRUE;\t\t\t\t\t\n\t\t\t\t\t\tif ($inputKey) { // <input ...\tkey 'submit' replace by variable\n\t\t\t\t\t\t\tif ($typeKey) { // <input type ...\n\t\t\t\t\t\t\t\tif ($formFields === 'submit') { // <input type=\"submit\" ...\n\t\t\t\t\t\t\t\t\t// create no db table field for submit buttons within fieldsets\n\t\t\t\t\t\t\t\t\t$table_fields .= '';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} elseif ($formFields === 'password') { // <input type=\"password\" ...\n\t\t\t\t\t\t\t\t\t// get name of password field\n\t\t\t\t\t\t\t\t\t$pwFieldName = $form_array[$fieldset][$label][$thetype]['name'];\n\t\t\t\t\t\t\t\t} elseif ($formFields === 'date' OR $formFields === 'time' OR $formFields === 'datetime' OR $formFields === 'datetime-local') { // <input type=\"date/datetaime/...\" ...\n\t\t\t\t\t\t\t\t\t// get name of date field\n\t\t\t\t\t\t\t\t\t$dateFieldName = $form_array[$fieldset][$label][$thetype]['name'];\n\t\t\t\t\t\t\t\t} elseif ($formFields === 'file') { // <input type=\"file\" ...\n\t\t\t\t\t\t\t\t\t// get names of upload fields\n\t\t\t\t\t\t\t\t\t$theUpfieldName = $form_array[$fieldset][$label][$thetype]['name'];\n\t\t\t\t\t\t\t\t\t$upFieldName[$theUpfieldName] = $theUpfieldName;\n\t\t\t\t\t\t\t\t\t//echo \"<pre>\". print_r($upFieldName) .\"</pre>\";\n\t\t\t\t\t\t\t\t} elseif ($nameFields === 'name') { // <input type=\"text/radio/checkbox/number/range/date/time\" ... else?\n\t\t\t\t\t\t\t\t\t// get values from name fields only\n\t\t\t\t\t\t\t\t\tif ($form_array[$fieldset][$label][$thetype]['name'] === $pwFieldName){\n\t\t\t\t\t\t\t\t\t\t//echo \"<br>\".$formFields.\"<br>\";\n\t\t\t\t\t\t\t\t\t\t$table_fields .= \" `$formFields` \";\n\t\t\t\t\t\t\t\t\t\t$entry .= \" `$formFields`, \"; // create db table entry\n\t\t\t\t\t\t\t\t\t\t$formFieldValue[$pwFieldName] = addslashes(htmlspecialchars($_POST[$formFields]));\n\t\t\t\t\t\t\t\t\t\t$passwd = addslashes(htmlspecialchars($_POST[$formFields])); //$_POST[$pwFieldName];\n\t\t\t\t\t\t\t\t\t\t$postvar[$formFields] = crypt($passwd,$this->salt);\n\t\t\t\t\t\t\t\t\t} elseif ($form_array[$fieldset][$label][$thetype]['name'] === $dateFieldName) {\n\t\t\t\t\t\t\t\t\t\t$table_fields .= \" `$formFields` \";\n\t\t\t\t\t\t\t\t\t\t$entry .= \" `$formFields`, \"; // create db table entry\n\t\t\t\t\t\t\t\t\t\tif ($checkPostVar) {\n\t\t\t\t\t\t\t\t\t\t\t$formFieldValue[$dateFieldName] = addslashes(htmlspecialchars($_POST[$formFields]));\n\t\t\t\t\t\t\t\t\t\t\t$dateTime = addslashes(htmlspecialchars($_POST[$formFields])); //$_POST[$datetFieldName];\n\t\t\t\t\t\t\t\t\t\t\t$postvar[$formFields] = strtotime($dateTime);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} elseif ($form_array[$fieldset][$label][$thetype]['name'] === $theUpfieldName) {\n\t\t\t\t\t\t\t\t\t\t//echo \"<br>\".$formFields.\"<br>\";\n\t\t\t\t\t\t\t\t\t\t$table_fields .= \" `$formFields` \";\n\t\t\t\t\t\t\t\t\t\t$entry .= \" `$formFields`, \"; // create db table entry\n\t\t\t\t\t\t\t\t\t\tif ($checkFilesVar) {\n\t\t\t\t\t\t\t\t\t\t\t$formFieldValue[$theUpfieldName] = $_FILES[$theUpfieldName]['name'];\n\t\t\t\t\t\t\t\t\t\t\t//if ($this->array_key_check($_POST, $formFields)) {\n\t\t\t\t\t\t\t\t\t\t\t$file = $_FILES[$theUpfieldName]['name'];\n\t\t\t\t\t\t\t\t\t\t\t$postvar[$formFields] = addslashes(htmlspecialchars($file));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$table_fields .= \" `$formFields` \"; // create db table field\n\t\t\t\t\t\t\t\t\t\t$entry .= \" `$formFields`, \"; // create db table entry\n\t\t\t\t\t\t\t\t\t\tif ($checkPostVar) {\n\t\t\t\t\t\t\t\t\t\t$formFieldValue[$formFields] = addslashes(htmlspecialchars($_POST[$formFields]));\n\t\t\t\t\t\t\t\t\t\t$postvar[$formFields] = addslashes(htmlspecialchars($_POST[$formFields]));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} elseif ($nameFields === '@#db') {\n\t\t\t\t\t\t\t\t\t$table_fields .= \" $formFields,\"; // needed to create db table only\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t$table_fields .= ''; // all other fields \\neq 'name' of <input type=\"text/radio/chechbox\" ... else?\n\t\t\t\t\t\t\t\t\t$entry .= '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif ($typeKey === 'file') { // needed or not? !$typeKey === 'file'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else { // <input .... without any type declaration\n\t\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\t\t$table_fields .= '';\n\t\t\t\t\t\t\t\t$entry .= '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($textareKey) { // <select ... OR <textarea ...\n\t\t\t\t\t\t\tif ($nameFields === 'name') {\n\t\t\t\t\t\t\t\t// get values from name fields only\n\t\t\t\t\t\t\t\t$table_fields .= \" `$formFields` \"; // create db table field\n\t\t\t\t\t\t\t\t$entry .= \" `$formFields`, \"; // create db table entry\n\t\t\t\t\t\t\t\tif ($checkPostVar) {\n\t\t\t\t\t\t\t\t\t$formFieldValue[$formFields] = addslashes(htmlspecialchars($_POST[$formFields]));\n\t\t\t\t\t\t\t\t\t$postvar[$formFields] = addslashes(htmlspecialchars($_POST[$formFields]));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif ($nameFields === '@#db') {\n\t\t\t\t\t\t\t\t$table_fields .= \" $formFields,\"; // needed to create db table only\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t$table_fields .= ''; // all other fields \\neq 'name' of <input type=\"text/radio/chechbox\" ... else?\n\t\t\t\t\t\t\t\t$entry .= '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($selectKey) {\n\t\t\t\t\t\t\t$selectedVal = '';\n\t\t\t\t\t\t\tif ($nameFields === 'name') {\n\t\t\t\t\t\t\t\t$table_fields .= \" `$formFields` \";\n\t\t\t\t\t\t\t\t$entry .= \" `$formFields`, \";\n\t\t\t\t\t\t\t\t// need to get the selected values from form fields like 'select' with optgroup\n\t\t\t\t\t\t\t\tif ($checkPostVar) {\n\t\t\t\t\t\t\t\t\tif (is_array($_POST[$formFields])) { // i.e 'name' is an array\n\t\t\t\t\t\t\t\t\t\tforeach ($_POST[$formFields] as $key => $value) {\n\t\t\t\t\t\t\t\t\t\t\t$selectedVal .= addslashes(htmlspecialchars($value)).\"| \";\n\t\t\t\t\t\t\t\t\t\t\t$_POST[$formFields][$key] = addslashes(htmlspecialchars($value));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$selectedVal = $this->truncateReturn($selectedVal, 2);\n\t\t\t\t\t\t\t\t\t\t$selectedValues[$formFields][] = $selectedVal;\n\t\t\t\t\t\t\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$selectedVal = addslashes(htmlspecialchars($formFields));\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$formFieldValue[$formFields] = $_POST[$formFields];\n\t\t\t\t\t\t\t\t\t$postvar[$formFields] = $selectedVal;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif ($nameFields === '@#db') {\n\t\t\t\t\t\t\t\t$table_fields .= \" $formFields,\"; // needed to create db table only\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t$table_fields .= ''; // all other fields \\neq 'name' of <input type=\"text/radio/chechbox\" ... else?\n\t\t\t\t\t\t\t\t$entry .= '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} // end 4th while\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$tableInfo = array();\n\t\t$tableInfo[0] = $table_fields; // create table fields with type property\n\t\t$tableInfo[1] = $entry; // for queries of table like INSERT ... Values ($entry\n\t\t$tableInfo[2] = $formFieldValue; // to be put into value field of the form itself\n\t\t$tableInfo[3] = $selectedValues; // holds all selected values from 'checkbox' or 'select' fields, key is the name\n\t\t$tableInfo[4] = $postvar; // entire $_POST array where keys are the form field's names\n\t\t$tableInfo[5] = $upFieldName; // upload fields\n\t\treturn $tableInfo;\n\t}",
"private function makeTableData(array $inputData)\n {\n // Empty template table elements.\n $td = new HtmlNode(kind: 'td');\n $th = new HtmlNode(kind: 'th');\n $span = new HtmlLeaf(kind: 'span');\n // Add dummy entries to fill last row\n $this->addDummyEntries($inputData);\n // Wrap top level nodes with table data or table header elements.\n $colCount = 1;\n $nodeCount = 1;\n $tableData = [];\n foreach ($inputData as $chunk) {\n $td_tmp = ($nodeCount <= $this->nCols & $this->enableHeaders)\n ? clone $th : clone $td;\n ++$nodeCount;\n // Check if input is of type htmlLeaf\n if ($chunk instanceof HtmlLeaf) {\n $td_tmp->appendChild($chunk);\n } else {\n $td_tmp->appendChild($span)->setContent(\"$chunk\");\n }\n\n // Reset $colCount at end of table row.\n $colCount = ($colCount == $this->nCols + 1) ? 1 : $colCount;\n // Style td and th\n $td_tmp->setAttributes(['class' => 'col' . $colCount]);\n $tableData[] = $td_tmp;\n ++$colCount;\n }\n return $tableData;\n }",
"private static function createRequestLogTable(){\n\t\t$db = self::connect();\n\t\t$table = self::$table->log;\n\t\t$stmt = $db->prepare(\"\n\t\t\tCREATE TABLE $table (\n\t\t\t\tid int PRIMARY KEY,\n\t\t\t\trequest_data varchar(255),\n\t\t\t\tlast_update timestamp\n\t\t\t)\n\t\t\");\n\t\tif( $stmt ){\n\t\t\t$stmt->execute();\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}",
"function GenerateAddEntryFields($table) {\r\n if ($table == \"Team\") {\r\n\r\n // Dynamically generate form fields for adding an entry to the Team DB table.\r\n echo \"<span class='input_text'>Team Name:</span> <input type='text' name='teamName' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Manager:</span> <input type='text' name='manager' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Team Pool:</span> <input type='text' name='teamPool' required class='edit_input'>\";\r\n\r\n } else if ($table == \"Player\") {\r\n\r\n // Dynamically generate form fields for adding an entry to the Player DB table.\r\n echo \"<span class='input_text'>Given Name:</span> <input type='text' name='givenName' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Family Name:</span> <input type='text' name='familyName' required class='edit_input'>\";\r\n echo \"<span class='input_text'>DOB:</span> <input type='date' name='dob' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Handed:</span> <input type='text' name='handed' class='edit_input'>\";\r\n echo \"<span class='input_text'>Player Team:</span> <input type='text' name='playerTeam' required class='edit_input'>\";\r\n\r\n } else if ($table == \"Pool\") {\r\n\r\n // Dynamically generate form fields for adding an entry to the Pool DB table.\r\n echo \"<span class='input_text'>Pool Name:</span> <input type='text' name='poolName' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Length:</span> <input type='number' name='length' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Address:</span> <input type='text' name='address' required class='edit_input'>\";\r\n\r\n } else if ($table == \"Game\") {\r\n\r\n // Dynamically generate form fields for adding an entry to the Game DB table.\r\n echo \"<span class='input_text'>Game Pool:</span> <input type='text' name='gamePool' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Date:</span> <input type='date' name='date' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Team A:</span> <input type='text' name='teamA' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Team B:</span> <input type='text' name='teamB' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Score A:</span> <input type='number' name='scoreA' required class='edit_input'>\";\r\n echo \"<span class='input_text'>Score A:</span> <input type='number' name='scoreB' required class='edit_input'>\";\r\n }\r\n }",
"public function createTables();",
"function initsTable() {\n $this->sTable = array();\n\n for ($i = 0; $i < 256; $i++)\n $this->sTable[$i] = chr($i);\n\n $this->tIdx = 258;\n $this->bitsToGet = 9;\n }",
"public function database_create($table, $requestArray)\n\t{\n\t\tglobal $db;\n\t\t$returnArray\t\t\t\t\t\t\t\t= array();\n\t\t$returnArray['result']\t\t\t\t\t= false;\n\n\t\t$tableQuery \t\t\t\t\t\t\t\t= \"SELECT * FROM \".$table;\n\t\t$selectQuery\t= $db->Execute($tableQuery);\n\t\t$insertQuery\t= $db->GetInsertSQL($selectQuery,$requestArray);\n\t\tif ($db->Execute($insertQuery))\n\t\t{\n\t\t\t$returnArray['result']\t\t\t\t\t= true;\n\t\t\t$returnArray['ID']\t\t\t\t\t\t= $db->Insert_ID();\n\t\t}\n\t\t\n\t\treturn $returnArray;\n\t}",
"private function initsTable() {\n\t\t$this->sTable = [];\n\t\tfor ($i = 0; $i < 256; $i++)\n\t\t\t$this->sTable[$i] = chr($i);\n\t\t$this->tIdx = 258;\n\t\t$this->bitsToGet = 9;\n\t}",
"function query_insert_post_str($table, $requested_inputs, $post_arr, $type_inputs = null)\n\t{\n\t\t\n\t\t// Define in the query string the action and table\n\t\t$query = \"INSERT INTO `\" . $table . \"`\";\n\t\t\n\t\t// Create string elements and values to be inserted\n\t\t$query_params = \" (\";\n\t\t$query_values = \" (\";\n\t\t$separator = \"\";\n\t\t\n\t\tforeach ($requested_inputs as $element)\n\t\t{\n\t\t\tif (!strcmp($element['name'], \"password\"))\n\t\t\t{\n\t\t\t\t$query_params = $query_params . $separator . \"`password_hash`\";\n\t\t\t\t$query_values = $query_values . $separator . \"'\" . sha1($post_arr[$element['name']]) . \"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!strcmp($element['type'], \"string\")) // We add the quotes around the value\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t\telse if (!strcmp($element['type'], \"date\")) // We add the quotes around the value. It may be something different\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t\telse if (!strcmp($element['type'], \"datetime\")) // We add the quotes around the value. It may be something different\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t\telse if (!strcmp($element['type'], \"number\")) // We don't add the quotes around the value\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . $post_arr[$element['name']];\n\t\t\t\t}\n\t\t\t\telse // Treat it as a string\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$separator = \", \";\n\t\t}\n\t\t$query_params = $query_params . \")\";\n\t\t$query_values = $query_values . \")\";\n\t\t\n\t\t// Put all the pieces together\n\t\t$query = $query . $query_params . \" VALUES\" . $query_values;\n\t\t\n\t\treturn $query;\n\t}",
"private function createAndPopulateTable()\n {\n $fieldParams = array(\n 'id' => array (\n 'name' => 'id',\n 'type' => 'id',\n ),\n 'acl_team_set_id' => array (\n 'name' => 'acl_team_set_id',\n 'type' => 'varchar',\n 'len' => 36,\n ),\n );\n\n // Create test table with params\n $this->db->createTableParams($this->tableName, $fieldParams, array());\n\n // Insert some data to test table\n $this->db->insertParams($this->tableName, $fieldParams, array(\n 'id' => Uuid::uuid1(),\n 'acl_team_set_id' => Uuid::uuid1(),\n ));\n }",
"public function tableWizard() {}",
"public function InputPage ($table) \n\t{\n\t\t$query = \"SHOW FIELDS FROM ${table}\";\n\t\tif (!$fields = mysql_query ($query, self::$db)) \n\t\t{\n\t\t\tself::Error (\"Can't find any fields in ${table} table\", mysql_error(self::$db));\n\t\t\treturn (false);\n\t\t}\n\t\tif (!$ofp = fopen (\"$this->website/${table}-Input.php\", \"w\")) \n\t\t{\n\t\t\tself::Event (\"Can't open ${table}.php\");\n\t\t\treturn (false);\n\t\t}\n\t\tfputs ($ofp, \"<?php\\n\");\n\t\tfputs ($ofp, \"include \\\"php/modules/CMAssoc.php\\\";\\n\");\n\t\tfputs ($ofp, \"\\$db = CMAssoc::Connect();\\n\");\n\t\tfputs ($ofp, \" ?>\\n\");\n\t\tfputs ($ofp, \"<html>\\n\");\n\t\tfputs ($ofp, \"\\t<head>\\n\");\n\t\tfputs ($ofp, \"\\t\\t<title>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t${table}\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t</title>\\n\");\n\t\tfputs ($ofp, \"\\t\\t<link href='$this->stylesheet' rel='stylesheet' type='text/css'/>\\n\");\n\t\tfputs ($ofp, \"\\t\\t</head>\\n\");\n\t\tfputs ($ofp, \"\\t<body>\\n\");\n\t\tfputs ($ofp, \"\\t\\t<h1>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t${table} Input\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t</h1>\\n\");\n\t\tfputs ($ofp, \"\\t\\t<form method='post' action='$this->wwwroot/${table}-Store.php'>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t<table class='form'>\\n\");\n\t\twhile ($field = mysql_fetch_object($fields)) \n\t\t{\n\t\t\tif (!strcmp($field->Field, \"ID\")) \n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"ControlID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Account\", \"account\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"PaymentID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Account\", \"account\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"ReceiptID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Account\", \"account\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"AccountID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Account\", \"account\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"ContactID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Contact\", \"contact\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"ProjectID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Project\", \"project\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"GameID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Game\", \"game\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"PoolID\")) \n\t\t\t{\n\t\t\t\tself::Select ($ofp, \"Pool\", \"pool\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"Type\")) \n\t\t\t{\n\t\tfputs ($ofp, \"\\t\\t\\t\\t<tr>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t<td>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\tEnter ${table} $field->Field:\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t</td>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t<td>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t<select name='$field->Field'/>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t\\t<option value='0'>NONE</option>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t\\t<option value='1'>ONE</option>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t\\t<option value='2'>TWO</option>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t\\t</select>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t</td>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t</tr>\\n\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"Created\")) \n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strcmp($field->Field, \"Updated\")) \n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t<tr>\\n\");\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t<td>\\n\");\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\tEnter ${table} $field->Field:\\n\");\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t</td>\\n\");\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t<td>\\n\");\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t<input type='text' name='$field->Field'/>\\n\");\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t\\t</td>\\n\");\n\t\t\tfputs ($ofp, \"\\t\\t\\t\\t\\t</tr>\\n\");\n\t\t}\n\t\tfputs ($ofp, \"\\t\\t\\t\\t</table>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t<div>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t<input type='submit' value='send'/>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t<input type='reset'/>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t\\t</div>\\n\");\n\t\tfputs ($ofp, \"\\t\\t\\t</form>\\n\");\n\t\tfputs ($ofp, \"\\t\\t</body>\\n\");\n\t\tfputs ($ofp, \"\\t</html>\\n\");\n\t\tmysql_free_result ($fields);\n\t\treturn ($this);\n\t}",
"function buildTables() {\r\n\r\n\t\tLogMessage::debug( 'Building list of tables from DB', $this->debug );\r\n\t\t$query = 'SHOW TABLES FROM ' . $this->escape($this->dbName,$this->link) . $this->getFilterString('buildTables');\r\n\t\t$result = $this->query( $query );\r\n\t\tif( $result ) {\r\n\t\t\t$results = $this->getRecords( $result );\r\n\t\t\tLogMessage::debug(array('Action: retrieved tables from DB',$results),$this->debug);\r\n\r\n\t\t\tif( count( $results ) > 0 ) {\r\n\t\t\t\tforeach( $results as $table ) {\r\n\r\n\t\t\t\t\t/* Don't instantiate Table objects yet */ /*\r\n\t\t\t\t\t$customTable = current($table) . 'Table';\r\n\t\t\t\t\tif(class_exists($customTable)) {\r\n\t\t\t\t\t\t$this->{current($table)} = new $customTable(current($table),$this,$this->debug);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->{current($table)} = new Table(current($table),$this,$this->debug);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->tables[] = current($table);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translate Turns a single integer into the appropriate string according to the fizzbuzz specification. | public static function translate(int $val): string {
if ($val === 0) {
$out = "0";
} else if ($val % 15 == 0) {
$out = "fizzbuzz";
} else if ($val % 5 == 0) {
$out = "buzz";
} else if ($val % 3 == 0) {
$out = "fizz";
} else {
$out = "$val";
}
return $out;
} | [
"function fizzBuzzAValue(int $theValue)\n{\n /** @var string $outputVal */\n $outputVal = '';\n\n if ($theValue % 3 === 0) {\n $outputVal = FIZZ;\n }\n if ($theValue % 5 === 0) {\n $outputVal .= BUZZ;\n }\n if (empty($outputVal)) {\n return $theValue;\n } else {\n return $outputVal;\n }\n}",
"function fizzBuzz($num) {\n if ($num < 101) {\n $nextnum = $num+1;\n if ($num % 3 == 0 && $num % 5 == 0) { // divisible by both 3 and 5\n return \"FizzBuzz\\n\" . fizzBuzz($nextnum);\n }\n if ($num % 3 == 0) { // divisible by 3\n return \"Fizz\\n\" . fizzBuzz($nextnum);\n }\n if ($num % 5 == 0) { // divisible by 5\n return \"Buzz\\n\" . fizzBuzz($nextnum);\n }\n return $num . \"\\n\" . fizzBuzz($nextnum); // not divisible by 3 or 5, so just print the number\n }\n return false;\n}",
"public static function ordinalize(int $value): string {\n if ($value <= 0) {\n throw new InvalidArgumentException('Negative integer value cannot be parsed to ordinal');\n }\n $suff = 'th';\n $int = abs((int) $value);\n if (!in_array(($int % 100), [11, 12, 13])) {\n switch ($int % 10) {\n case 1:\n $suff = 'st';\n break;\n case 2:\n $suff = 'nd';\n break;\n case 3:\n $suff = 'rd';\n break;\n }\n }\n return \"{$int}{$suff}\";\n }",
"function flu_english_num($number)\n{\n\treturn dindex(array(\n 1 => 'one', 'two', 'three', 'four', 'five',\n 'six', 'seven', 'eight', 'nine', 'ten'\n ), (int)$number, (string)$number);\n}",
"function it_translate_3_for_fizzBuzz()\n {\n $this->execute(3)->shouldReturn('fizz');\n }",
"function ordinal_suffix($num){\n $num = $num % 100; // protect against large numbers\n if($num < 11 || $num > 13){\n switch($num % 10){\n case 1: return 'st';\n case 2: return 'nd';\n case 3: return 'rd';\n }\n }\n return 'th';\n}",
"public static function fizzbuzz($n);",
"function show_ordinal($num) \n\t{\n\t\t$the_num = (string) $num;\n\t\t$last_digit = substr($the_num, -1, 1);\n\t\tswitch($last_digit) \n\t\t{\n\t\t\tcase \"1\":\n\t\t\t\t$the_num.=\"st\";\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\t$the_num.=\"nd\";\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\t$the_num.=\"rd\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$the_num.=\"th\";\n\t\t}\n\t\treturn $the_num;\n\t}",
"function ordinal($number) {\r\n // number, even negatives\r\n\r\n if ($number % 100 > 10 && $number %100 < 14):\r\n $suffix = \"th\";\r\n else:\r\n switch($number % 10) {\r\n\r\n case 0:\r\n $suffix = \"th\";\r\n break;\r\n\r\n case 1:\r\n $suffix = \"st\";\r\n break;\r\n\r\n case 2:\r\n $suffix = \"nd\";\r\n break;\r\n\r\n case 3:\r\n $suffix = \"rd\";\r\n break;\r\n\r\n default:\r\n $suffix = \"th\";\r\n break;\r\n }\r\n\r\n endif;\r\n\r\n return \"${number}$suffix\";\r\n\r\n\t}",
"function number_to_word($val) {\n\n if ($val > 999) {\n echo 'Warning: values till 1000 only supported in initial version.';\n $val %= 100; // for now only process starting from hundreds\n }\n\n $ones = [\n 'ноль',\n 'один',\n 'два',\n 'три',\n 'четыре',\n 'пять',\n 'шесть',\n 'семь',\n 'восемь',\n 'девять',\n ];\n\n $tens = [\n 'десять',\n 'одинадцать',\n 'двенадцать',\n 'тринадцать',\n 'четырнадцать',\n 'пятнадцать',\n 'шестнадцать',\n 'семнадцать',\n 'восемнадцать',\n 'девятнадцать',\n ];\n\n $tens2 = [\n 'десять',\n 'двадцать',\n 'тридцать',\n 'сорок',\n 'пятьдесят',\n 'шестьдесят',\n 'восемдесят',\n 'девяносто',\n ];\n\n $hundreds = [\n 'сто',\n 'двести',\n 'триста',\n 'четыреста',\n 'пятьсот',\n 'шестьсот',\n 'семьсот',\n 'восемьсот',\n 'девятсот',\n ];\n\n $res = '';\n\n if ($val < 0)\n $res .= 'минус ';\n\n if (floor($val / 100) != 0)\n $res .= $hundreds[ floor($val / 100) - 1 ];\n\n $val %= 100;\n if (floor($val / 10) != 0) {\n if (strlen($res) != 0)\n $res .= ' ';\n if (floor($val / 10) == 1) {\n $res .= $tens[ $val % 10 - 1 ];\n return $res;\n }\n else\n $res .= $tens2[ floor($val / 10) - 1 ];\n }\n\n $val %= 10;\n if ($val != 0) {\n if (strlen($res) != 0)\n $res .= ' ';\n $res .= $ones[ $val ];\n }\n\n return $res;\n}",
"function intAsText ($number) {\n\t$integers_as_text = array(\n\t\t'0'=>'zero',\n\t\t'1'=>'one',\n\t\t'2'=>'two',\n\t\t'3'=>'three',\n\t\t'4'=>'four',\n\t\t'5'=>'five',\n\t\t'6'=>'six',\n\t\t'7'=>'seven',\n\t\t'8'=>'eight',\n\t\t'9'=>'nine'\n\t);\n\treturn strtr($number, $integers_as_text);\n}",
"public function integerToThai($number) {\n//trail off all the zero at the beginning\n $number = ltrim($number, ' 0');\n if ($number == '') {\n return 'ศูนย์';\n }\n if ($number == '1') {\n return 'หนึ่ง';\n }\n//it is easier to work in an inverted one\n $number = strrev($number);\n return $this->millionToThaiHelper($number, '', true);\n }",
"function get_ordinal($num) {\n\t\tif (!in_array(($num % 100),array(11,12,13))){\n\t\t switch ($num % 10) {\n\t\t\t// Handle 1st, 2nd, 3rd\n\t\t\tcase 1: return 'st';\n\t\t\tcase 2: return 'nd';\n\t\t\tcase 3: return 'rd';\n\t\t }\n\t\t}\n\t\treturn 'th';\n\t}",
"function int2string($aConvertir){\n $formatterES = new NumberFormatter(\"es\", NumberFormatter::SPELLOUT);\n return $formatterES->format($aConvertir);\n}",
"static function numberBookToName($number = 1)\n {\n if ($number > 0 && $number < 74)\n {\n if ($number == 1)\n {\n return LanguageSupport::getLang('Genesis');\n }\n else if ($number == 2)\n {\n return LanguageSupport::getLang('Exodus');\n }\n else if ($number == 3)\n {\n return LanguageSupport::getLang('Leviticus');\n }\n else if ($number == 4)\n {\n return LanguageSupport::getLang('Numbers');\n }\n else if ($number == 5)\n {\n return LanguageSupport::getLang('Deuteronomy');\n }\n else if ($number == 6)\n {\n return LanguageSupport::getLang('Joshua');\n }\n else if ($number == 7)\n {\n return LanguageSupport::getLang('Judges');\n }\n else if ($number == 8)\n {\n return LanguageSupport::getLang('Ruth');\n }\n else if ($number == 9)\n {\n return LanguageSupport::getLang('1 Samuel');\n }\n else if ($number == 10)\n {\n return LanguageSupport::getLang('2 Samuel');\n }\n else if ($number == 11)\n {\n return LanguageSupport::getLang('1 Kings');\n }\n else if ($number == 12)\n {\n return LanguageSupport::getLang('2 Kings');\n }\n else if ($number == 13)\n {\n return LanguageSupport::getLang('1 Chronicles');\n }\n else if ($number == 14)\n {\n return LanguageSupport::getLang('2 Chronicles');\n }\n else if ($number == 15)\n {\n return LanguageSupport::getLang('Ezra');\n }\n else if ($number == 16)\n {\n return LanguageSupport::getLang('Nehemiah');\n }\n else if ($number == 17)\n {\n return LanguageSupport::getLang('Esther');\n }\n else if ($number == 18)\n {\n return LanguageSupport::getLang('Job');\n }\n else if ($number == 19)\n {\n return LanguageSupport::getLang('Psalms');\n }\n else if ($number == 20)\n {\n return LanguageSupport::getLang('Proverbs');\n }\n else if ($number == 21)\n {\n return LanguageSupport::getLang('Ecclesiastes');\n }\n else if ($number == 22)\n {\n return LanguageSupport::getLang('Song of Salomon');\n }\n else if ($number == 23)\n {\n return LanguageSupport::getLang('Isaiah');\n }\n else if ($number == 24)\n {\n return LanguageSupport::getLang('Jeremiah');\n }\n else if ($number == 25)\n {\n return LanguageSupport::getLang('Lamentations');\n }\n else if ($number == 26)\n {\n return LanguageSupport::getLang('Ezekiel');\n }\n else if ($number == 27)\n {\n return LanguageSupport::getLang('Daniel');\n }\n else if ($number == 28)\n {\n return LanguageSupport::getLang('Hosea');\n }\n else if ($number == 29)\n {\n return LanguageSupport::getLang('Joel');\n }\n else if ($number == 30)\n {\n return LanguageSupport::getLang('Amos');\n }\n else if ($number == 31)\n {\n return LanguageSupport::getLang('Obadiah');\n }\n else if ($number == 32)\n {\n return LanguageSupport::getLang('Jonah');\n }\n else if ($number == 33)\n {\n return LanguageSupport::getLang('Micah');\n }\n else if ($number == 34)\n {\n return LanguageSupport::getLang('Nahum');\n }\n else if ($number == 35)\n {\n return LanguageSupport::getLang('Habakkuk');\n }\n else if ($number == 36)\n {\n return LanguageSupport::getLang('Zephaniah');\n }\n else if ($number == 37)\n {\n return LanguageSupport::getLang('Haggai');\n }\n else if ($number == 38)\n {\n return LanguageSupport::getLang('Zechariah');\n }\n else if ($number == 39)\n {\n return LanguageSupport::getLang('Malachi');\n }\n else if ($number == 40)\n {\n return LanguageSupport::getLang('Matthew');\n }\n else if ($number == 41)\n {\n return LanguageSupport::getLang('Mark');\n }\n else if ($number == 42)\n {\n return LanguageSupport::getLang('Luke');\n }\n else if ($number == 43)\n {\n return LanguageSupport::getLang('John');\n }\n else if ($number == 44)\n {\n return LanguageSupport::getLang('Acts');\n }\n else if ($number == 45)\n {\n return LanguageSupport::getLang('Romans');\n }\n else if ($number == 46)\n {\n return LanguageSupport::getLang('1 Corinthians');\n }\n else if ($number == 47)\n {\n return LanguageSupport::getLang('2 Corinthians');\n }\n else if ($number == 48)\n {\n return LanguageSupport::getLang('Galatians');\n }\n else if ($number == 49)\n {\n return LanguageSupport::getLang('Ephesians');\n }\n else if ($number == 50)\n {\n return LanguageSupport::getLang('Philippians');\n }\n else if ($number == 51)\n {\n return LanguageSupport::getLang('Colossians');\n }\n else if ($number == 52)\n {\n return LanguageSupport::getLang('1 Thessalonians');\n }\n else if ($number == 53)\n {\n return LanguageSupport::getLang('2 Thessalonians');\n }\n else if ($number == 54)\n {\n return LanguageSupport::getLang('1 Timothy');\n }\n else if ($number == 55)\n {\n return LanguageSupport::getLang('2 Timothy');\n }\n else if ($number == 56)\n {\n return LanguageSupport::getLang('Titus');\n }\n else if ($number == 57)\n {\n return LanguageSupport::getLang('Philemon');\n }\n else if ($number == 58)\n {\n return LanguageSupport::getLang('Hebrews');\n }\n else if ($number == 59)\n {\n return LanguageSupport::getLang('James');\n }\n else if ($number == 60)\n {\n return LanguageSupport::getLang('1 Peter');\n }\n else if ($number == 61)\n {\n return LanguageSupport::getLang('2 Peter');\n }\n else if ($number == 62)\n {\n return LanguageSupport::getLang('1 John');\n }\n else if ($number == 63)\n {\n return LanguageSupport::getLang('2 John');\n }\n else if ($number == 64)\n {\n return LanguageSupport::getLang('3 John');\n }\n else if ($number == 65)\n {\n return LanguageSupport::getLang('Jude');\n }\n else if ($number == 66)\n {\n return LanguageSupport::getLang('Revelation');\n }\n else if ($number == 67)\n {\n return LanguageSupport::getLang('Tobit');\n }\n else if ($number == 68)\n {\n return LanguageSupport::getLang('1 Maccabees');\n }\n else if ($number == 69)\n {\n return LanguageSupport::getLang('2 Maccabees');\n }\n else if ($number == 70)\n {\n return LanguageSupport::getLang('Wisdom');\n }\n else if ($number == 71)\n {\n return LanguageSupport::getLang('Judith');\n }\n else if ($number == 72)\n {\n return LanguageSupport::getLang('Baruch');\n }\n else if ($number == 73)\n {\n return LanguageSupport::getLang('Ecclesiasticus');\n }\n }\n else\n {\n return LanguageSupport::getLang('Nothing');;\n } \n }",
"protected function _convertHundred($value)\n\t{\n\t\tif ($value == 0) {\n\t\t\treturn '';\n\t\t}\n\t\t\t\n\t\treturn $this->__hundredConversion($value);\n\t}",
"function fizzBuzz() {\n foreach (range(1, 100) as $number) {\n\n if($number % 3 == 0 && $number % 5 == 0) {\n echo 'FizzBuzz!</br>';\n } else if($number % 3 == 0) {\n echo 'Fizz</br>';\n } else if($number % 5 == 0) {\n echo 'Buzz</br>';\n } else {\n echo $number.'</br>';\n }\n }\n}",
"static function ordinalize($number)\n\t{\n\t\tif (in_array(($number % 100),range(11,13))) {\n\t\t\treturn $number.'th';\n\t\t} else {\n\t\t\tswitch (($number % 10)) {\n\t\t\t\tcase 1:\n\t\t\t\treturn $number.'st';\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\treturn $number.'nd';\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\treturn $number.'rd';\n\t\t\t\tdefault:\n\t\t\t\treturn $number.'th';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"function utf8_int_to_unicode_style( $int )\n {\n if( ctype_digit( ( string ) $int ) )\n {\n $hex = dechex( ( int ) $int );\n \n $hex = ( strlen( $hex ) < 4 ? substr( '0000' . $hex , -4 ) : $hex );\n \n return 'U+'. $hex;\n }\n \n return '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send Test Notification To Destination Send a test Notification to the specified destination. | public function sendTestNotificationToDestination($request); | [
"public function sendTestNotificationToDestination($request)\n {\n if (!($request instanceof SendTestNotificationToDestinationInput)) {\n $request = new SendTestNotificationToDestinationInput($request);\n }\n $parameters = $request->toQueryParameterArray();\n $parameters['Action'] = 'SendTestNotificationToDestination';\n $httpResponse = $this->_invoke($parameters);\n\n $response = SendTestNotificationToDestinationResponse::fromXML($httpResponse['ResponseBody']);\n $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);\n return $response;\n }",
"public function testSendNotification()\n {\n }",
"public function given_message_when_send_Then_SendsMessageToRequestedDestination() {\n\n $client = new NexmoMockClient;\n $repository = new NexmoRepository($client);\n\n // Act\n $repository->send(\"foo message\", \"+34-123456789\");\n\n // Assert\n self::assertNotNull($client->message->sendCalled);\n self::assertEquals($client->message->payload['text'], \"foo message\");\n self::assertEquals($client->message->payload['to'], \"34123456789\");\n self::assertEquals($client->message->payload['from'], env('SMS_EMISOR_NAME', 'Opencash'));\n }",
"public function testAction() {\n $_helper = Mage::helper('aschroder_email');\n if ($_helper->isLogBounceEnabled()) {\n $_helper->sendBounceTest();\n $_helper->sendComplaintTest();\n $_helper->sendOOTOTest();\n }\n $_helper->log(\"Sent Notification test emails\");\n $this->_redirectReferer();\n }",
"function send_destination($destination, $message) {\n return $this->send_address($destination->get_address(), $message);\n }",
"public function sendTestMessage(): void\n {\n $siteName = $this->commerce->getOption('site_name');\n\n // Grab the last order to send as a test\n $c = $this->adapter->newQuery('comOrder');\n $c->where([\n 'test' => $this->commerce->isTestMode(),\n ]);\n $c->sortby('received_on', 'DESC');\n $order = $this->adapter->getObject('comOrder', $c);\n if ($order instanceof comOrder && $status = $order->getOne('Status')) {\n $response = $this->sendOrderToSlack($order, $status);\n if ($response->getStatusCode() !== 200) {\n $body = (string)$response->getBody();\n $this->setProperty('last_response', $body);\n $this->save();\n return;\n }\n }\n\n // Send another message confirming it worked\n $payload = new Message($this->adapter->lexicon('commerce_slack.success', ['site_name' => $siteName]));\n $payload->addBlock([\n 'type' => 'section',\n 'text' => [\n 'type' => 'mrkdwn',\n 'text' => $this->adapter->lexicon('commerce_slack.success', ['site_name' => $siteName]) . ' :tada:'\n ]\n ]);\n $sender = new Sender($this->getProperty('webhook_url'));\n $response = $sender->send($payload);\n if ($response->getStatusCode() !== 200) {\n $body = $response->getBody()->getContents();\n $this->setProperty('last_response', $body);\n }\n }",
"public function testSnaSubscriberNotificationServiceSend()\n {\n\n }",
"public function sendTestMail() {\n \\Mail::to(config('mail.from.address'))\n ->send(new App\\Mail\\TestEmail());\n }",
"public static function sendNotification()\r\n {\r\n\r\n }",
"public function testSnaSubscriberNotificationServiceSendSubscription()\n {\n\n }",
"public function testNotification()\n {\n Notification::fake();\n $user = User::first();\n $user->notify(new SmsRuNotification('test'));\n Notification::assertSentTo(\n $user,\n SmsRuNotification::class\n );\n }",
"function test_sendmail()\r\r\n {\r\r\n $this->emailm->sendEmailAutomatic('hieu.huynhtrong90@gmail.com', 'Test Send Mail', 'Content Test Send Mail');\r\r\n }",
"private function _convertSendTestNotificationToDestination($request)\n {\n $parameters = array();\n $parameters['Action'] = 'SendTestNotificationToDestination';\n if ($request->isSetSellerId()) {\n $parameters['SellerId'] = $request->getSellerId();\n }\n if ($request->isSetMWSAuthToken()) {\n $parameters['MWSAuthToken'] = $request->getMWSAuthToken();\n }\n if ($request->isSetMarketplaceId()) {\n $parameters['MarketplaceId'] = $request->getMarketplaceId();\n }\n if ($request->isSetDestination()) {\n $DestinationSendTestNotificationToDestinationInput = $request->getDestination();\n foreach ($DestinationSendTestNotificationToDestinationInput->getDeliveryChannel() as $DeliveryChannelDestinationIndex => $DeliveryChannelDestination) {\n $parameters['Destination' . '.' . 'DeliveryChannel' . '.' . ($DeliveryChannelDestinationIndex + 1)] = $DeliveryChannelDestination;\n }\n }\n\n return $parameters;\n }",
"public function sendTestMailWithTestprofile( $sTestAddress, $iTestprofileId );",
"public function sendConfirm(DestinationInterface $destination, UserInterface $user, string $confirm) {\n $this->client->sendChat($destination, $this->persona->getAddressedConfirm(\n $user,\n $destination,\n $confirm\n ));\n }",
"public function campaignSendtest($id, $to) {\r\n $emails = array();\r\n $emailList = explode(',', $to);\r\n foreach ($emailList as $email) {\r\n $emails[] = trim($email);\r\n }\r\n $this->mc->campaignSendTest($id, $emails);\r\n }",
"protected function sendNotification() {\n\t\tif (count($this->notificationRecipients) > 0) {\n\t\t\t$this->newPm->sendNotifications($this->notificationRecipients);\n\t\t}\n\t}",
"public function testPushSend()\n {\n }",
"public function testSetDestination() : void\n {\n $instance = $this->createEmptyInstance();\n\n $destination = 'myDestinationLocation';\n\n $this->assertSame($instance, $instance->setDestination($destination));\n $this->assertEquals($destination, $this->getValue($instance, 'destination'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Binds the values needed to insert a sport | function addSportBinding(&$query, $values) {
$query->bindParam(':sport_name', $values['sport_name']);
} | [
"function addSports(){\n\n $name = $this->getName();\n\n $sql = \"INSERT INTO server_sport (name)\n VALUES (?)\";\n\n $this->db->Add_insert_delete_Query($sql,\n array($name),\n array(PDO::PARAM_STR));\n\n\n }",
"public function processBind()\n {\n $bind = [];\n\n foreach ($this->fields as $field)\n {\n\n if($field == $this->tablePK)\n {\n $bind[\":id\"] = $this->data[$field];\n }\n else\n {\n $bind[\":$field\"] = $this->data[$field];\n }\n }\n $this->bind = $bind;\n }",
"public function addSport() \n\t{\t\n\t\t$this->User->addSport($this->UserRequest->id, $this->dataPost->sport_id);\n\n\t\t$this->setData('Sports add');\n\t}",
"function Insert($fields, $placeholders, $binders, $values, $table, $db)\n{\n\n $field_val = implode(\", \", $fields);\n\n $ph = implode(\", \", $placeholders);\n \n $query =\n \"INSERT INTO \" . $table . \" (\" . $field_val . \") VALUES(\" . $ph . \")\";\n\n $stmt = $db->prepare($query);\n\n $stmt->bind_param(\"\" . $binders . \"\", ...$values);\n \n $stmt->execute();\n}",
"public function tournamentPopulate($sport)\n {\n $parserAll = new SimpleHTMLDOM;\n $htmlAll = $parserAll->file_get_html($sport->link);\n $htmlTable = $htmlAll->find('div#divOfferTarget');\n\n foreach ($htmlTable[0]->find('td a') as $tournament_a) {\n $tournament_name = trim($tournament_a->innertext);\n $tournament_link = $tournament_a->href;\n\n $criteria2 = new CDbCriteria();\n $criteria2->addCondition('name = :tournament_name');\n $criteria2->params[\":tournament_name\"] = $tournament_name;\n $tournament = Tournament::model()->find($criteria2);\n if (!$tournament) {\n $tournament = new Tournament();\n $tournament->name = $tournament_name;\n $tournament->link = \"https://www.interwetten.com\".$tournament_link;\n $tournament->active = 0;\n $tournament->sport_id = $sport->id;\n $tournament->special = 0;\n $tournament->save();\n }\n }\n }",
"function addPlaceBinding(&$query, $values) {\n\t$query->bindParam(':place_name', $values['place_name']);\n\t$query->bindParam(':street_address', $values['street_address']);\n\t$query->bindParam(':city', $values['city']);\n\t$query->bindParam(':state', $values['state']);\n\t$query->bindParam(':zip', $values['zip']);\n\t$query->bindParam(':fee', $values['fee']);\n}",
"public static function bindValues($_stmt_) {\n\n self::$keys = array_keys($_POST);\n\n foreach(self::$keys as $key) {\n $_stmt_->bindParam(':'.$key,$_POST[$key]);\n }\n }",
"function register_player($firstName, $lastName, $age, $teamId, $gender, $birthdate, $userId, $seasonId, $shirtSize) {\n\t\tglobal $db;\n\t\ttry{\n\t\t\t$pdo = $db;\n\t\t\t$sql = \"INSERT INTO Player (FirstName, LastName, Age, TeamId, Gender, BirthDate, UserId, SeasonId, ShirtSize) VALUES (:firstName, :lastName, :age, :teamId, :gender, :birthdate, :userId, :seasonId, :shirtSize)\";\n\t\t\t$statement = $pdo->prepare($sql);\n\t\t\t$statement->bindParam(\"firstName\", $firstName);\n\t\t\t$statement->bindParam(\"lastName\", $lastName);\n\t\t\t$statement->bindParam(\"age\", $age);\n\t\t\t$statement->bindParam(\"teamId\", $teamId);\n\t\t\t$statement->bindParam(\"gender\", $gender);\n\t\t\t$statement->bindParam(\"birthdate\", $birthdate);\n\t\t\t$statement->bindParam(\"userId\", $userId);\n\t\t\t$statement->bindParam(\"seasonId\", $seasonId);\n\t\t\t$statement->bindParam(\"shirtSize\", $shirtSize);\n\t\t\t$statement->execute();\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\techo \"Failed: \" . $e->getMessage(); \n\t\t}\n\t}",
"public function insertSeason($season) {\n try {\n\t$stmt = $this->db->prepare('INSERT INTO Season(fallYear) VALUES(:fallYear)');\n\t$stmt->bindValue(':fallYear', $season->fallYear);\n\t$stmt->execute();\n } catch(PDOException $e) {\n\t throw $e;\n }\n}",
"function addSLS(){\n\n $sports = $this->getSports();\n $season = $this->getSeason();\n $league = $this->getLeague();\n\n $league_id = $this->db->getInstance(\"server_league\",$league);\n $sport_id = $this->db->getInstance(\"server_sport\",$sports);\n $season_id = $this->db->getInstance(\"server_season\",$season,\"description\");\n\n $sql = \"INSERT INTO server_slseason (league, season, sport)\n VALUES (?,?,?)\";\n\n $this->db->Add_insert_delete_Query($sql,\n array($league_id, $season_id ,$sport_id),\n array(PDO::PARAM_INT, PDO::PARAM_INT,PDO::PARAM_INT));\n\n }",
"private function bindValues() {\n\t\tforeach ($this->builder->bindings as $key => $value) {\n\t\t\t$this->statement->bindValue(\n\t\t\t\t(is_string($key) ? $key : $key + 1),\n\t\t\t\t$value,\n\t\t\t\t(is_int($value) || is_float($value) ? PDO::PARAM_INT : PDO::PARAM_STR)\n\t\t\t);\n\t\t}\n\n\t\t// Reset Builder - ready for next statement\n\t\t$this->builder->bindings = [];\n\t\t$this->builder->wheres = [];\n\t}",
"protected function populateTable() {\n\t\t$query = \"\n\t\tINSERT INTO `items` VALUES (1, 'Candy', 'Crush', '1924 Sucka Drive', 'Stripper');\n\t\tINSERT INTO `items` VALUES (2, 'John', 'Smith', '9999 The Way', 'Unemployeed');\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}",
"function insert() {\n\t \t$sql = \"INSERT INTO evs_person_base (per_name_en_title, per_name_en,per_name_en_sur, per_pos_id, per_Company_ID, per_Sectioncode_ID)\n\t \t\t\tVALUES(?, ?, ?, ?, ?, ?, ?)\";\n\t \t$this->db->query($sql, array($this->per_name_en_title, $this->per_name_en, $this->per_name_en_sur, $this->per_pos_id, $this->per_Company_ID, $this->per_Sectioncode_ID));\n\t\n\t }",
"private function _bindValues( $stmt )\n\t{\n\t\tfor ( $i=0 ; $i<count($this->_fields) ; $i++ ) {\n\t\t\t$field = $this->_fields[$i];\n\t\t\tif ( $field->apply('set', $this->_formData) ) {\n\t\t\t\t$stmt->bindValue( ':'.$field->dbField, $field->val('set', $this->_formData) );\n\t\t\t}\n\t\t}\n\t}",
"private function setColumnsAnsValues()\n {\n $this->columns['staff'] = \"(\";\n $this->values['staff'] = \"(\";\n\n $this->columns['admin'] = \"(\";\n $this->values['admin'] = \"(\";\n\n $this->columns['localstaff'] = \"(\";\n $this->values['localstaff'] = \"(\";\n\n /* staff */\n if (isset($this->name)) {\n $this->columns['staff'] .= \"name\";\n $this->values['staff'] .= \"'$this->name'\";\n }\n\n if (isset($this->address)) {\n $this->columns['staff'] .= \", address\";\n $this->values['staff'] .= \", '$this->address'\"; \n }\n \n if (isset($this->phone)) {\n $this->columns['staff'] .= \", phone\";\n $this->values['staff'] .= \", '$this->phone'\"; \n }\n\n if (isset($this->ssn)) {\n $this->columns['staff'] .= \", ssn\";\n $this->values['staff'] .= \", '$this->ssn'\"; \n }\n\n if (isset($this->title)) {\n $this->columns['staff'] .= \", title\";\n $this->values['staff'] .= \", '$this->title'\"; \n }\n\n /* admin */\n if (isset($this->location)) {\n $this->columns['admin'] .= \"location\";\n $this->values['admin'] .= \"'$this->location'\"; \n }\n\n if (isset($this->training)) {\n $this->columns['admin'] .= \", training\";\n $this->values['admin'] .= \", '$this->training'\"; \n }\n\n if (isset($this->yrs_exp)) {\n $this->columns['admin'] .= \", yrs_exp\";\n $this->values['admin'] .= \", '$this->yrs_exp'\"; \n }\n\n /* localstaff \n * if the insert has a localstaff 'title' then location is the `f_id`\n */\n if (isset($this->location)) {\n $this->columns['localstaff'] .= \"f_id\";\n $this->values['localstaff'] .= \"$this->location\"; \n }\n\n /* close */\n\n /* need to set the staff ID ! */\n $this->columns['admin'] .= \", staff_id)\";\n $this->values['admin'] .= \", (SELECT MAX(staff_id) FROM \".$this->tables['staff'].\") )\";\n\n $this->columns['localstaff'] .= \", staff_id)\";\n $this->values['localstaff'] .= \", (SELECT MAX(staff_id) FROM \".$this->tables['staff'].\") )\";\n\n $this->columns['staff'] .= \")\";\n $this->values['staff'] .= \")\";\n }",
"private function bindParams(&$sth, $diffusion) {\n $sth->bindParam(':date_diffusion', $diffusion->getDate(), PDO::PARAM_STR);\n $sth->bindParam(':id_film', $diffusion->getIdFilm(), PDO::PARAM_INT);\n $sth->bindParam(':cycle', $diffusion->getCycle(), PDO::PARAM_STR);\n $sth->bindParam(':commentaire', $diffusion->getCommentaire(), PDO::PARAM_STR);\n $sth->bindParam(':affiche', $diffusion->getAffiche(), PDO::PARAM_STR);\n $sth->bindParam(':nb_presents', $diffusion->getNbPresents(), PDO::PARAM_INT);\n }",
"private function bindParameters() {\n if ($this->arrParams != null) { \n $imax = sizeof($this->arrParams);\n for($i = 0; $i < $imax; $i++) {\n $this->statement->bindParam(':'.$this->arrParams[$i][0], $this->arrParams[$i][1]);\n }\n }\n }",
"function bindInfo($query, $patient_id, $day, $ampm)\n{\n $query->bindValue(':patient_id', $patient_id, PDO::PARAM_INT);\n $query->bindValue(':DayNum', $day, PDO::PARAM_INT);\n $query->bindValue(':ampm', ($ampm == \"am\" ? 1 : 2), PDO::PARAM_STR);\n}",
"public function insert() {\n $sql = \"INSERT INTO \" . static::$tableName . \" (\"\n . implode(\",\", static::$columns) . \") VALUES (\"; // Separa o array em strings usando a vírgula \",\" como parâmetro\n foreach (static::$columns as $col) {\n $sql .= static::getFormatedValue($this->$col) . \",\";\n }\n $sql[strlen($sql) - 1] = ')'; // Substitui $sql[?] por \")\"\n $id = Database::executeSQL($sql);\n $this->id = $id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read private static member from same class | #[@test, @ignore('$this->getClass()->getField($field) does not yield private field declared in parent class')]
public function readingPrivateStaticMemberFromChildClass() {
PrivateAccessibilityFixtureChild::readStatic(self::$fixtureChild);
} | [
"public function testGetPrivateProperty_Static()\n {\n $this->assertSame(910, get_private_property(TestClass::class, 'statPriv'));\n $this->assertSame(920, get_private_property(TestClass::class, 'statProt'));\n $this->assertSame(940, get_private_property(TestClass::class, 'statPub'));\n }",
"public static function readStatic(\\lang\\XPClass $class) {\n return $class->getField('staticTarget')->get(null);\n }",
"#[@test]\n public function readingPrivateMemberFromSameClass() {\n $this->assertEquals('Target', PrivateAccessibilityFixture::read(self::$fixture));\n }",
"public static function getStatic()\n {\n return self::$static;\n }",
"#[@test, @expect('lang.IllegalAccessException')]\n public function writingPrivateStaticMember() {\n self::$fixture->getField('staticTarget')->set(null, 'Modified');\n }",
"public function testAddingStaticFunctionThatUsesExistingMixableClassStaticPrivatePropertyCallableFromMixableSubclassWhenUsingSelfToAccessProperty()\n {\n $mixable_class = new MixableTestClass();\n MixableTestClass::staticMix('getStaticPrivateProperty', function () {\n return self::$static_private_property;\n });\n $this->assertEquals($this->getNonPublicProperty($mixable_class, 'static_private_property'), MixableTestSubClass::getStaticPrivateProperty());\n }",
"#[@test]\n public function writingPrivateStaticMemberMadeAccessible() {\n with ($f= self::$fixture->getField('staticTarget')); {\n $f->setAccessible(true);\n $f->set(null, 'Modified');\n $this->assertEquals('Modified', $f->get(null));\n }\n }",
"public static function getPrivate()\n {\n return self::$visibility['private'];\n }",
"function __get($key)\n\t{\n\t\t$MG =& get_instance();\n\t\treturn $MG->$key;\n\t}",
"function Java_sun_misc_Unsafe_staticFieldOffset($field) {\n\t$className = $field->getDeclaringClass()->getRefClass()->getName();\n\t$fieldName = $field->getName()->toString().'';\n\t\n\t//var_dump($className);\n\t$vars = get_class_vars($className);\n\t//var_dump($vars);\n\t$keys = array_keys($vars);\n\t//var_dump($keys);\n\treturn array_search($fieldName, $keys);\n}",
"private function getStaticSystemValue(string $key){\n $value = null;\n if($staticData = $this->getStaticSystemData()){\n if(isset($staticData->$key)){\n $value = $staticData->$key;\n }\n }\n return $value;\n }",
"#[@test]\n public function writingProtectedStaticMemberFromSameClass() {\n $this->assertEquals('Modified', ProtectedAccessibilityFixture::writeStatic(self::$fixture));\n }",
"public function getPrivate()\n {\n return $this->Private;\n }",
"protected function visitStaticMemberAccess(StaticMemberAccessNode $node) {\n return $node;\n }",
"public function getPrivate()\n {\n return $this->private;\n }",
"public function testAddingStaticFunctionThatUsesExistingMixableClassStaticPublicPropertyCallableFromMixableSubclassWhenUsingStaticToAccessProperty()\n {\n MixableTestClass::staticMix('getStaticPublicProperty', function () {\n return static::$static_public_property;\n });\n $this->assertEquals(MixableTestSubClass::$static_public_property, MixableTestSubClass::getStaticPublicProperty());\n }",
"function staticTest() {\n static $my_car = \"Range Rover\";\n echo $my_car;\n}",
"function __get($key) {\r\n $CI = & get_instance();\r\n return $CI->$key;\r\n }",
"public function getStaticValue()\n {\n return $this->staticValue;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetch all levels and associated lessons for each level | public function getAllLevels()
{
return $level = Level::with(array( 'lessons' => function ( $query ) {
$query->addSelect(array('id', 'level_id', 'title', 'description'));
}))->orderBy('level_index', 'ASC')->get(['id', 'user_id', 'level_index', 'title', 'description']);
} | [
"public function getLessons($level = null) {\n\t\tif ($level === null)\n\t\t\t$level = $this->getLevel();\n\n\t\t$lessons = Application::getLessons($level);\n\n\t\tif ($lessons === false)\n\t\t\treturn false;\n\n\t\t$sql = <<<\"SQL\"\n\t\t\tSELECT lesson_id, score, passing_score, timestamp\n\t\t\tFROM test_result\n\t\t\tNATURAL JOIN (\n\t\t\t\tSELECT lesson_id, MAX(score) AS score\n\t\t\t\tFROM test_result\n\t\t\t\tWHERE user_id = :user_id AND level_id = :level\n\t\t\t\tGROUP BY lesson_id\n\t\t\t) AS t\n\t\t\tWHERE user_id = :user_id\n\t\t\tORDER BY lesson_id ASC\nSQL;\n\n\t\t$stmt = PdoFactory::getInstance()->prepare($sql);\n\t\t$stmt->bindValue(':user_id', $this->id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':level', $level);\n\t\t$stmt->execute();\n\n\t\t#$test_results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t#\n\t\t#for ($i = 0; $i < count($test_results); $i++) {\n\t\t#\t$lessons[$i] = array_merge($lessons[$i], $test_results[$i]);\n\t\t#}\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$i = $row['lesson_id'];\n\t\t\t$lessons[$i]['score'] = $row['score'];\n\t\t\t$lessons[$i]['passing_score'] = $row['passing_score'];\n\t\t\t$lessons[$i]['timestamp'] = $row['timestamp'];\n\t\t}\n\n\t\tforeach ($lessons as &$lesson) {\n\t\t\tif (array_key_exists('score', $lesson)) {\n\t\t\t\t$lesson['test_status'] = ($lesson['score'] >= $lesson['passing_score']) ? \"passed\" : \"failed\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$lesson['test_status'] = \"skipped\";\n\t\t\t}\n\t\t}\n\n\t\treturn $lessons;\n\t}",
"private function get_levels(){\n $models = new Models('levels');\n $select = array('name', 'id');\n $where = array(\n 'enabled' => true\n );\n $levels = $models->get_specific_rows($select, $where);\n return $levels;\n }",
"public function getLessons($level = null) {\n if ($level === null)\n $level = $this->getLevel();\n\n $lessons = App::getLessons($level);\n\n // FIXME: is this still valid? memcache returns false for missing key\n if ($lessons === false)\n return false;\n\n $cache = App::getMemcachedInstance();\n $memcache_key = 'user-' . $this->getUserId() . \"-test-results-$level\";\n $test_results = $cache->get($memcache_key);\n\n if ($test_results === false) {\n $sql = <<<\"SQL\"\n\t\t\t\tSELECT lesson_id, score, passing_score, timestamp\n\t\t\t\tFROM test_result\n\t\t\t\tNATURAL JOIN (\n\t\t\t\t\tSELECT lesson_id, MAX(score) AS score\n\t\t\t\t\tFROM test_result\n\t\t\t\t\tWHERE user_id = :user_id AND level_id = :level\n\t\t\t\t\tGROUP BY lesson_id\n\t\t\t\t) AS t\n\t\t\t\tWHERE user_id = :user_id\n\t\t\t\tORDER BY lesson_id ASC\nSQL;\n $stmt = PdoFactory::getInstance()->prepare($sql);\n $stmt->bindValue(':user_id', $this->id, PDO::PARAM_INT);\n $stmt->bindValue(':level', $level);\n $stmt->execute();\n $test_results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $cache->set($memcache_key, $test_results);\n }\n\n foreach ($test_results as $row) {\n $i = $row['lesson_id'];\n $lessons[$i]['score'] = $row['score'];\n $lessons[$i]['passing_score'] = $row['passing_score'];\n $lessons[$i]['timestamp'] = $row['timestamp'];\n }\n\n foreach ($lessons as &$lesson) {\n if (array_key_exists('score', $lesson)) {\n $lesson['test_status'] = ($lesson['score'] >= $lesson['passing_score']) ? \"passed\" : \"failed\";\n } else {\n if ($lesson['lesson'] < $this->getMaxLesson($level)) {\n $lesson['test_status'] = ($lesson['level'] == $this->getStartPosition()['level'] && $lesson['lesson'] < $this->getStartPosition()['lesson']) ? \"skipped\" : \"missed\";\n }\n }\n\n $lesson['locked'] = !$this->isLessonAvailable($lesson['level'], $lesson['lesson']);\n }\n\n $sql = 'SELECT lesson FROM star WHERE user_id = :user_id AND level = :level';\n $stmt = PdoFactory::getInstance()->prepare($sql);\n $stmt->bindValue(':user_id', $this->id, PDO::PARAM_INT);\n $stmt->bindValue(':level', $level);\n $stmt->execute();\n\n while ($i = $stmt->fetch(PDO::FETCH_COLUMN, 0)) {\n $lessons[$i]['starred'] = true;\n }\n\n return $lessons;\n }",
"function getLessons()\n {\n $returned_lessons = $GLOBALS['DB']->query(\"SELECT * FROM lessons WHERE unit_id = {$this->getId()};\");\n $unit_lessons = array();\n foreach ($returned_lessons as $lesson) {\n $lesson_id = $lesson['id'];\n $found_lesson = Lesson::find($lesson_id);\n\n array_push($unit_lessons, $found_lesson);\n }\n return $unit_lessons;\n }",
"public function findAll() {\n $sql = \"SELECT * FROM lesson ORDER BY less_id\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $lesson = array();\n foreach ($result as $row) {\n $lessonId = $row['less_id'];\n $lesson[$lessonId] = $this->buildDomainObject($row);\n }\n return $lesson;\n }",
"public function getLessons()\n {\n return $this->hasMany(Lesson::className(), ['courseID' => 'id']);\n }",
"function get_all_lessons()\n{\n\t$db = get_db_connection();\n\t$sql = \"SELECT * FROM tbl_lesson;\";\n\t$result = $db->query($sql);\n\treturn $result->fetchAll();\n}",
"public function getLessons()\n {\n return $this->hasMany(Lesson::className(), ['teacher_id' => 'id']);\n }",
"public function lessons()\n {\n // Get the lessons that are in the module\n $lessons = $this->unorderedLessons();\n\n // Create the array that will store the lessons in the correct order\n $ordered_lessons = array();\n\n if($this->eagerLoading){\n // this approach should use the eager loaded and not do additional DB calls.\n // saved ~200 ms in the test cases.\n foreach($lessons as $lesson){\n $prevId = $lesson->previous_lesson_id;\n $index = ObjectTools::getIndex($ordered_lessons, $prevId);\n if($index > -1){\n // add after previous\n array_splice($ordered_lessons,$index+1,0,[$lesson]);\n }else{\n // add at end\n $ordered_lessons[] = $lesson;\n }\n\n }\n }else{\n // uses lazy loading\n if(count($lessons) > 0){\n //Get the first lesson (its previous_lesson_id is null) and put it into the array\n $lesson = $this->unorderedLessons()->whereNull('previous_lesson_id')->get()[0];\n array_push($ordered_lessons, $lesson);\n\n $done = false;\n while(!$done){\n $next_lesson = self::nextLesson($lesson->id);\n\n if(!is_null($next_lesson)){\n $lesson = $next_lesson;\n\n array_push($ordered_lessons, $lesson);\n } else {\n $done = true;\n }\n }\n }\n }\n\n return $ordered_lessons;\n }",
"public function getLessons()\n {\n return $this->hasMany(Lesson::className(), ['lesson_id' => 'lesson_id'])\n ->via('attachmentLesson');\n }",
"public function loadlevels()\n {\n Excel::selectSheets('levels')->load('public/capstone_questions.xlsx', function ($reader) {\n $levels = $reader->all();\n foreach ($levels as $level) {\n \\App\\Level::create($level->toArray());\n }\n });\n }",
"public function getLessons0()\n {\n return $this->hasMany(Lesson::className(), ['course_id' => 'id']);\n }",
"public function lessons(){\n return $this->hasMany('App\\Lesson', 'section_id')->orderBy('created_at', 'desc');\n }",
"public function lessons()\n {\n return $this->hasMany(Lesson::class);\n }",
"function allHikerLevels()\n\t{\n\t\tglobal $db;\n\t\t\t$query = $sql = \"SELECT * FROM level_lvl\";\n\t\t\t$hikerLevels = $db->query($query);\n\t\t\t\n\t\t\treturn $hikerLevels;\n\t}",
"public function lessons(): HasMany\n {\n return $this->hasMany(Lesson::class, 'grade_id', 'id');\n }",
"public function getLessons()\n {\n $entries = $this->getEntries();\n\n $entries = $this->filterLessons($entries);\n\n return $this->wrapLessons($entries);\n }",
"public function getLevels();",
"function ciniki_sponsors_levelList($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n // \n // Check access to tnid as owner, or sys admin. \n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'sponsors', 'private', 'checkAccess');\n $ac = ciniki_sponsors_checkAccess($ciniki, $args['tnid'], 'ciniki.sponsors.levelList');\n if( $ac['stat'] != 'ok' ) { \n return $ac;\n } \n\n //\n // Load the levels\n //\n $strsql = \"SELECT ciniki_sponsor_levels.id, \"\n . \"ciniki_sponsor_levels.name, \"\n . \"ciniki_sponsor_levels.sequence, \"\n . \"COUNT(ciniki_sponsors.id) AS num_sponsors \"\n . \"FROM ciniki_sponsor_levels \"\n . \"LEFT JOIN ciniki_sponsors ON (ciniki_sponsor_levels.id = ciniki_sponsors.level_id \"\n . \"AND ciniki_sponsors.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \")\" \n . \"WHERE ciniki_sponsor_levels.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"GROUP BY ciniki_sponsor_levels.id \"\n . \"ORDER BY ciniki_sponsor_levels.sequence \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.sponsors', array(\n array('container'=>'levels', 'fname'=>'id', 'name'=>'level',\n 'fields'=>array('id', 'name', 'sequence', 'num_sponsors')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['levels']) ) {\n $levels = array();\n } else {\n $levels = $rc['levels'];\n }\n\n //\n // Check for sponsors with no sponsorship level\n //\n $strsql = \"SELECT 'sponsors', COUNT(*) \" \n . \"FROM ciniki_sponsors \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND level_id = 0 \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbCount');\n $rc = ciniki_core_dbCount($ciniki, $strsql, 'ciniki.sponsors', 'num');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['num']['sponsors']) && $rc['num']['sponsors'] > 0 ) {\n $levels[] = array('level'=>array('id'=>'0', \n 'name'=>'No sponsorship level', \n 'sequence'=>'0', \n 'num_sponsors'=>$rc['num']['sponsors']\n ));\n }\n\n return array('stat'=>'ok', 'levels'=>$levels);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes l10n.js from head | function rm_l10n(){
if(!is_admin()){
wp_deregister_script('l10n');
}
} | [
"function remove_l10n_js(){\n if (!is_admin()){\n wp_deregister_script('l10n');\n }\n}",
"function _gandalf_remove_l1on() {\n\tif ( !is_admin() ) {\n\t\twp_deregister_script('l10n');\n\t}\n}",
"function newenglish_head_cleanup() {\n // Originally from http://wpengineer.com/1438/wordpress-header/\n remove_action('wp_head', 'feed_links_extra', 3);\n add_action('wp_head', 'ob_start', 1, 0);\n add_action('wp_head', function () {\n $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';\n echo preg_replace($pattern, '', ob_get_clean());\n }, 3, 0);\n remove_action('wp_head', 'rsd_link');\n remove_action('wp_head', 'wlwmanifest_link');\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);\n remove_action('wp_head', 'wp_generator');\n remove_action('wp_head', 'wp_shortlink_wp_head', 10);\n remove_action('wp_head', 'print_emoji_detection_script', 7);\n remove_action('admin_print_scripts', 'print_emoji_detection_script');\n remove_action('wp_print_styles', 'print_emoji_styles');\n remove_action('admin_print_styles', 'print_emoji_styles');\n remove_action('wp_head', 'wp_oembed_add_discovery_links');\n remove_action('wp_head', 'wp_oembed_add_host_js');\n remove_action('wp_head', 'rest_output_link_wp_head', 10);\n remove_filter('the_content_feed', 'wp_staticize_emoji');\n remove_filter('comment_text_rss', 'wp_staticize_emoji');\n remove_filter('wp_mail', 'wp_staticize_emoji_for_email');\n add_filter('use_default_gallery_style', '__return_false');\n add_filter('emoji_svg_url', '__return_false');\n add_filter('show_recent_comments_widget_style', '__return_false');\n}",
"function cardealer_head_cleanup() {\r\n\tadd_filter( 'style_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from css\r\n\tadd_filter( 'script_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from scripts\r\n}",
"function r0bsc0tt_cleanup_head(){\n // remove rsd link\n remove_action( 'wp_head', 'rsd_link' );\n // remove windows live writer\n remove_action( 'wp_head', 'wlwmanifest_link' );\n // remove relational link\n remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); \n // remove WP generator meta tag showing WP version\n remove_action( 'wp_head', 'wp_generator' );\n // remove WP version from css\n add_filter( 'style_loader_src', 'r0bsc0tt_remove_wp_ver_css_js', 9999 );\n // remove WP version from scripts\n add_filter( 'script_loader_src', 'r0bsc0tt_remove_wp_ver_css_js', 9999 );\n}",
"function echotheme_remove_headlinks()\n{\n\tremove_action('wp_head', 'index_rel_link');\n\tremove_action('wp_head', 'rsd_link');\n\tremove_action('wp_head', 'wlwmanifest_link');\n\tremove_action('wp_head', 'wp_generator');\n}",
"public function cleanup_head()\n {\n // EditURI link\n remove_action('wp_head', 'rsd_link');\n // windows live writer\n remove_action('wp_head', 'wlwmanifest_link');\n // index link\n remove_action('wp_head', 'index_rel_link');\n // previous link\n remove_action('wp_head', 'parent_post_rel_link', 10, 0);\n // start link\n remove_action('wp_head', 'start_post_rel_link', 10, 0);\n // links for adjacent posts\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n // WP version\n remove_action('wp_head', 'wp_generator');\n }",
"function webtecker_head_cleanup() {\n\t// EditURI link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// windows live writer\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// index link\n\tremove_action( 'wp_head', 'index_rel_link' );\n\t// previous link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t// start link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t// links for adjacent posts\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t// WP version\n\tremove_action( 'wp_head', 'wp_generator' );\n // remove WP version from css\n add_filter( 'style_loader_src', 'webtecker_remove_wp_ver_css_js', 9999 );\n // remove Wp version from scripts\n add_filter( 'script_loader_src', 'webtecker_remove_wp_ver_css_js', 9999 );\n\n}",
"public static function cleanFrontendHtmlHead() {\n\t\tremove_action('wp_head', 'feed_links_extra', 3); // Display the links to the extra feeds such as category feeds\n\t\tremove_action('wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed\n\t\tremove_action('wp_head', 'rsd_link'); // Display the link to the Really Simple Discovery service endpoint, EditURI link\n\t\tremove_action('wp_head', 'wlwmanifest_link'); // Display the link to the Windows Live Writer manifest file.\n\t\tremove_action('wp_head', 'index_rel_link'); // Index link\n\t\tremove_action('wp_head', 'parent_post_rel_link', 10, 0); // Prev link\n\t\tremove_action('wp_head', 'start_post_rel_link', 10, 0); // Start link\n\t\tremove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // Display relational links for the posts adjacent to the current\n\t\tremove_action('wp_head', 'wp_generator'); // Display the XHTML generator that is generated on the wp_head hook, WP version\n\t\tremove_action('wp_head', 'start_post_rel_link', 10, 0);\n\t\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\t\tremove_action('wp_head', 'rel_canonical');\n\t\tremove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);\n\t}",
"public function remove_tags_from_head() {\n if ($this->check_option('remove_meta_generator')) {\n remove_action( 'wp_head', 'wp_generator' );\n add_filter( 'the_generator', '__return_empty_string' );\n }\n if ( $this->check_option('remove_dns_prefetch') ) {\n remove_action( 'wp_head', 'wp_resource_hints', 2 );\n }\n if ($this->check_option('remove_rsd_link')) remove_action( 'wp_head', 'rsd_link' );\n if ($this->check_option('remove_wlw_link')) remove_action( 'wp_head', 'wlwmanifest_link' );\n if ($this->check_option('remove_adjacent_posts_link')) remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );\n if ($this->check_option('remove_adjacent_posts_link')) remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n if ($this->check_option('remove_shortlink_link')) {\n remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\n remove_action( 'template_redirect', 'wp_shortlink_header', 11, 0 );\n }\n //remove_action( 'wp_head', 'index_rel_link' );\n //remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n //remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n }",
"function remove_tags_from_head() {\n\tremove_action( 'wp_head', 'wp_generator' );\n\tadd_filter( 'the_generator', '__return_empty_string' );\n\tremove_action( 'wp_head', 'wp_resource_hints', 2 );\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\n\tremove_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); \n\t//remove_action( 'wp_head', 'index_rel_link' );\n\t//remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t//remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n}",
"function remove_locale_stylesheet() {\n remove_action( 'wp_head', 'locale_stylesheet' );\n}",
"function THEME_html_head_alter(&$head_elements) {\n unset($head_elements['system_meta_generator']);\n}",
"function mb_starter_html_head_alter(&$head_elements) {\n unset($head_elements['system_meta_generator']);\n}",
"function _h_remove_jetpack_head_assets() {\n wp_dequeue_script('devicepx');\n wp_dequeue_style('sharedaddy');\n wp_dequeue_style('social-logos');\n}",
"public function cleanHead() {\n\t\tremove_action( 'wp_head', 'rsd_link' );\n\t\tremove_action( 'wp_head', 'wp_generator' );\n\t\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t\tremove_action( 'wp_head', 'index_rel_link' );\n\t\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\n\t\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\tremove_action( 'wp_head', 'edd_version_in_header' );\n\t\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\t\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\t\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\t\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\t\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\t\tremove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\t\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\t}",
"function ewd_remove_headlinks()\n{\n\tremove_action('wp_head', 'index_rel_link');\n\tremove_action('wp_head', 'rsd_link');\n\tremove_action('wp_head', 'wlwmanifest_link');\n\tremove_action('wp_head', 'wp_generator');\n}",
"function medula_wpml_disable_css_js() {\n\tdefine('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);\n\tdefine('ICL_DONT_LOAD_NAVIGATION_CSS', true);\n\tdefine('ICL_DONT_LOAD_LANGUAGES_JS', true);\n}",
"function bones_head_cleanup() {\n\t// category feeds\n\t// remove_action( 'wp_head', 'feed_links_extra', 3 );\n\t// post and comment feeds\n\t// remove_action( 'wp_head', 'feed_links', 2 );\n\t// EditURI link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// windows live writer\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// previous link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t// start link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t// links for adjacent posts\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t// WP version\n\tremove_action( 'wp_head', 'wp_generator' );\n\t// remove WP version from css\n\tadd_filter( 'style_loader_src', 'bones_remove_wp_ver_css_js', 9999 );\n\t// remove Wp version from scripts\n\tadd_filter( 'script_loader_src', 'bones_remove_wp_ver_css_js', 9999 );\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate site path (relative to root path) site_path('role/create', 'admin') === 'admin/role/create' | function site_path($path, $site = 'desktop')
{
if (!in_array($site, config('site.route.group'))) {
$site = 'desktop';
}
$sub_dir = config('site.route.prefix.'.$site, '');
return $sub_dir.'/'.trim($path, '/');
} | [
"public function getSitePath();",
"protected function getPathSite() {}",
"function admin_path() {\n return root_path() . '/admin';\n }",
"function getSitePath() {\n return Site::getSitePath();\n}",
"public static function getSitePath(): string\n {\n return Environment::getPublicPath() . '/';\n }",
"public function getWebappPath();",
"public function loginPath()\n {\n return property_exists($this, 'loginPath') ? $this->loginPath : route('adminLogin');\n }",
"function getTemplatesFolderPath()\n {\n // check the servers current OS\n if (PHP_OS == \"Linux\") {\n $sub = \"/\";\n } else {\n $sub = \"\\\\\";\n }\n\n // start building the path\n $path = $this->sitePath() . $sub . $this->templatesFolder() . $sub . $sub;\n\n // return the path\n return $path;\n }",
"public function getWelcomePageTemplatePath();",
"private function getModuleTemplatePath(): string\n {\n return sprintf('@Modules/%s/views/templates/admin/', $this->name);\n }",
"public function generatePath()\n\t{\n\t\tif (!$this->parent_id && $this->slug) {\n\t\t\tthrow new Exception('A root Page cannot have a slug.');\n\t\t}\n\n\t\t$path = '/';\n\n\t\t$chain = $this->parent_id ? $this->parent->ancestorsAndSelf(['slug'])->get() : [];\n\n\t\tforeach ($chain as $ancestor) {\n\t\t\tif (empty($ancestor->slug)) continue; // If there are any ancestors without a path, skip.\n\t\t\t$path .= $ancestor->slug . '/';\n\t\t}\n\n\t\treturn $path . $this->slug;\n\t}",
"function homeRoute()\n {\n\n if (auth()->check()) {\n if (auth()->user()->isAdmin()) {\n return 'admin.dashboard';\n }\n\n if (auth()->user()->isUser()) {\n return 'frontend.user.dashboard';\n }\n }\n\n return 'frontend.index';\n }",
"function home_route()\n {\n if (auth()->check()) {\n if (auth()->user()->can('view backend')) {\n return 'admin.dashboard';\n } else {\n return 'frontend.user.dashboard';\n }\n }\n\n return 'frontend.index';\n }",
"function home_route()\n {\n if (auth()->check()) {\n if (auth()->user()->can('view backend')) {\n return 'admin.dashboard';\n }\n\n return 'frontend.user.dashboard';\n }\n\n return 'frontend.index';\n }",
"function site($path_only = false) {\n if (!($url = config('site.url'))) return null;\n if ($path_only) return rtrim(parse_url($url, PHP_URL_PATH), '/');\n return rtrim($url, '/').'/';\n}",
"function signUpUrlPath()\n{\t\n return '/signup';\n}",
"function getRolePath() {\n\t\treturn RoleDAO::getRolePath($this->getData('roleId'));\n\t}",
"static public function Path_Web() { return Base::Path_Raiz().\"Web/\"; }",
"public static function adminPath() {\n\t\treturn Config::get('folio.admin-path-prefix').'/';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
converts the message timestamp to readable dates | protected function _timestampToReadable($message)
{
if (key_exists(self::KEY_CREATED, $message)){
$creation = new Zend_Date($message[self::KEY_CREATED]);
$message[self::KEY_CREATED. "Readable"] = $creation->get(Zend_Date::DATE_LONG);
}
if (key_exists(self::KEY_MODIFED, $message)){
$modified = new Zend_Date($message[self::KEY_MODIFED]);
$message[self::KEY_MODIFED. "Readable"] = $modified->get("M. MMMM yyyy HH:mm:ss");
}
if (key_exists(self::KEY_ONSINCE, $message)){
$onSince = new Zend_Date($message[self::KEY_ONSINCE]);
$message[self::KEY_ONSINCE. "Readable"] = $onSince->get(Zend_Date::DATE_LONG);
}
return $message;
} | [
"private function renderDate(){\n\t\t#On divise le chiffre par 1 000 car GoSMS enregistre les dates en timestamp UNIX (en millisecondes : 1 sec = 1000 ms)\n\t\t$iDate = (string) $this->oSMS->date;\n\t\t$iDate /= 1000;\n\n\t\t$sDate = date('l d/m/Y - H:i:s', $iDate);\n\n\t\treturn $sDate;\n\t}",
"function dateRFC822($timestamp) {\n\t$timestamp = $timestamp - 7200;\n\n\t$date = strftime(\"%a, %d %b %Y %H:%M:%S GMT\", $timestamp);\n\n\treturn $date;\n}",
"function _RFC822DateFormat($timestamp='')\r\n {\r\n \t// format the date\r\n \tif(!empty($timestamp))\r\n \t{\r\n \t\t$time = date( 'r', $timestamp);\r\n \t} else {\r\n \t\t$time = date( 'r' );\r\n \t}\r\n \t// return the time\r\n \treturn $time;\r\n }",
"function convert_timestamp($timestamp) {\n\tdate_default_timezone_set(\"GMT\");\n\tif ($timestamp == null) {\n\t\treturn 0;\n\t}\n\t//echo \"<br>convert_timestamp<br>\";\n\t$date_time_array = explode(' ', $timestamp);\n\t$date = $date_time_array[0];\n\t$time = $date_time_array[1];\n\n\t$date_explode = explode('-', $date);\n\t$time_explode = explode(':', $time);\n\t\n\t$year = (int) $date_explode[0];\n\t$month = (int) $date_explode[1];\n\t$day = (int) $date_explode[2];\n\t$hour = (int) $time_explode[0];\n\t$minute = (int) $time_explode[1];\n\t$second = (int) $time_explode[2];\n\t\n\t$unix_timestamp = mktime($hour, $minute, $second, $month, $day, $year);\n\t//echo \"<br>$unix_timestamp<br>\";\n\t$check_date = date('Y-m-d H:i:s',$unix_timestamp);\n\tif ($check_date != $timestamp and $timestamp != '0000-00-00 00:00:00') {\n\t\techo \"<br>checkdate: \".gettype($check_date).\" \".$check_date;\n\t\techo \"<br>timestamp: \".gettype($timstamp).\" \".$timestamp;\n\t\techo \"<br>Conversion Discrepency<br>\";\n\t}\n\treturn $unix_timestamp;\n}",
"function convert_timestamp( $ugly ){\n $date = new DateTime( $ugly );\n echo $date->format('l, jS, F, o');\n}",
"private function dateToUnix()\r\r\n\t{\r\r\n\t\tif (preg_match('/[BbCcDEeFfIJKkLlMNOoPpQqRrSTtUuVvWwXxZz]+/', $this->strFormat))\r\r\n\t\t{\r\r\n\t\t\tthrow new Exception(sprintf('Invalid date format \"%s\"', $this->strFormat));\r\r\n\t\t}\r\r\n\r\r\n\t\t$intCount = 0;\r\r\n\t\t$intDay = '';\r\r\n\t\t$intMonth = '';\r\r\n\t\t$intYear = '';\r\r\n\t\t$intHour = '';\r\r\n\t\t$intMinute = '';\r\r\n\t\t$intSecond = '';\r\r\n\r\r\n\t\t$blnMeridiem = false;\r\r\n\t\t$blnCorrectHour = false;\r\r\n\r\r\n\t\t$arrCharacterMapper = array\r\r\n\t\t(\r\r\n\t\t\t'd' => 'intDay',\r\r\n\t\t\t'j' => 'intDay',\r\r\n\t\t\t'm' => 'intMonth',\r\r\n\t\t\t'n' => 'intMonth',\r\r\n\t\t\t'y' => 'intYear',\r\r\n\t\t\t'Y' => 'intYear',\r\r\n\t\t\t'h' => 'intHour',\r\r\n\t\t\t'H' => 'intHour',\r\r\n\t\t\t'g' => 'intHour',\r\r\n\t\t\t'G' => 'intHour',\r\r\n\t\t\t'i' => 'intMinute',\r\r\n\t\t\t's' => 'intSecond'\r\r\n\t\t);\r\r\n\r\r\n\t\t$arrCharacters = str_split($this->strFormat);\r\r\n\r\r\n\t\tforeach ($arrCharacters as $strCharacter)\r\r\n\t\t{\r\r\n\t\t\t$var = array_key_exists($strCharacter, $arrCharacterMapper) ? $arrCharacterMapper[$strCharacter] : 'dummy';\r\r\n\r\r\n\t\t\tswitch ($strCharacter)\r\r\n\t\t\t{\r\r\n\t\t\t\tcase 'a':\r\r\n\t\t\t\tcase 'A':\r\r\n\t\t\t\t\t$blnCorrectHour = true;\r\r\n\t\t\t\t\t$blnMeridiem = (strtolower(substr($this->intTstamp, $intCount, 2)) == 'pm') ? true : false;\r\r\n\t\t\t\t\t$intCount += 2;\r\r\n\t\t\t\t\tbreak;\r\r\n\r\r\n\t\t\t\tcase 'd':\r\r\n\t\t\t\tcase 'm':\r\r\n\t\t\t\tcase 'y':\r\r\n\t\t\t\tcase 'h':\r\r\n\t\t\t\tcase 'H':\r\r\n\t\t\t\tcase 'i':\r\r\n\t\t\t\tcase 's':\r\r\n\t\t\t\t\t$$var .= substr($this->intTstamp, $intCount, 2);\r\r\n\t\t\t\t\t$intCount += 2;\r\r\n\t\t\t\t\tbreak;\r\r\n\r\r\n\t\t\t\tcase 'j':\r\r\n\t\t\t\tcase 'n':\r\r\n\t\t\t\tcase 'g':\r\r\n\t\t\t\tcase 'G':\r\r\n\t\t\t\t\t$$var .= substr($this->intTstamp, $intCount++, 1);\r\r\n\r\r\n\t\t\t\t\tif (preg_match('/[0-9]+/i', substr($this->intTstamp, $intCount, 1)))\r\r\n\t\t\t\t\t{\r\r\n\t\t\t\t\t\t$$var .= substr($this->intTstamp, $intCount++, 1);\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\tbreak;\r\r\n\r\r\n\t\t\t\tcase 'Y':\r\r\n\t\t\t\t\t$$var .= substr($this->intTstamp, $intCount, 4);\r\r\n\t\t\t\t\t$intCount += 4;\r\r\n\t\t\t\t\tbreak;\r\r\n\r\r\n\t\t\t\tdefault:\r\r\n\t\t\t\t\t++$intCount;\r\r\n\t\t\t\t\tbreak;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\r\r\n\t\t$intHour = (int) $intHour;\r\r\n\r\r\n\t\tif ($blnMeridiem)\r\r\n\t\t{\r\r\n\t\t\t$intHour += 12;\r\r\n\t\t}\r\r\n\r\r\n\t\tif ($blnCorrectHour && ($intHour == 12 || $intHour == 24))\r\r\n\t\t{\r\r\n\t\t\t$intHour -= 12;\r\r\n\t\t}\r\r\n\r\r\n\t\tif (!strlen($intMonth))\r\r\n\t\t{\r\r\n\t\t\t$intMonth = 1;\r\r\n\t\t}\r\r\n\r\r\n\t\tif (!strlen($intDay))\r\r\n\t\t{\r\r\n\t\t\t$intDay = 1;\r\r\n\t\t}\r\r\n\r\r\n\t\t$this->intTstamp = mktime((int) $intHour, (int) $intMinute, (int) $intSecond, (int) $intMonth, (int) $intDay, (int) $intYear);\r\r\n\t}",
"function convertTimeStampToDateStamp($timestamp){\n return date('Y-m-d', $timestamp);\n }",
"function fn_timestamp_to_date($timestamp)\n{\n return !empty($timestamp) ? date('d M Y H:i:s', intval($timestamp)) : '';\n}",
"public function to_date_timestamp() {\n\t\treturn $this->to_date ? strtotime( $this->to_date ) : null;\n\t}",
"function convertTimestamp($ugly){\n $date = new DateTime($ugly);\n return $date->format('l, F jS, Y');\n}",
"public static function toEnglishDate($timestamp)\n\t{\n\t\t$timestamp = new DateTime($timestamp);\n\t\t$day = $timestamp->format('d');\n\t\t$month = $timestamp->format('m');\n\t\t$month = ltrim($month, 0);\n\t\t$month = self::intToMonth($month);\n\t\t$year = $timestamp->format('Y');\n\t\t$date = $month . ' ' . $day . ', ' . $year;\n\t\treturn $date;\n\t}",
"function variant_date_from_timestamp ($timestamp) {}",
"function f_timestamp($datum) {\n\t$timestamp=strtotime($datum);\n return $timestamp;\n\t}",
"public function convertTimestamp($timestamp) {\n\t $year = substr($timestamp,0,4);\n\t $month = substr($timestamp,4,2);\n\t $day = substr($timestamp,6,2);\n\t $hour = substr($timestamp,8,2);\n\t $minute = substr($timestamp,10,2);\n\t $second = substr($timestamp,12,2);\n\n\t $date = mktime($hour, $minute, $second, $month, $day, $year);\n\t $date = date(\"Y-m-d h:i:s A\", \"$date\");\n\n\t return $date;\n\t}",
"function convert_timestamp($unixtimestamp) {\n\n $objTimestamp = date(\"Y-m-d H:i:s\", $unixtimestamp);\n\n return $objTimestamp;\n }",
"function convertEmailToTimestamp($in_date) {\n\n $out_Date = date(\"Y-m-d-H.i.s\", strtotime($in_date)) . \".000000\";\n return $out_Date;\n}",
"function to_timestamp($date){\n return strtotime($date.' 00:00:00');\n }",
"private function fixCorrectTimestamps() {\n \n $count = count($this->jsondata);\n \n for($i = 0; $i < $count; $i++) {\n preg_match('/([0-9]{13})([\\-\\+0-9]{5})/', $this->jsondata[$i]->createddate, $parts);\n \n $seconds = round(intval($parts[1])/1000);\n \n $this->jsondata[$i]->createddate = $seconds;\n }\n }",
"function getRfc2822Date($timestamp) {\r\n\t\treturn date('r', $timestamp);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Acquire an identity to store | public function acquireIdentity() {
$group = new IdentityDataGroup($this->data, $this->source);
/** @var \Drupal\identity\IdentityDataIdentityAcquirerInterface $acquirer */
$acquirer = \Drupal::service('identity.acquirer');
$result = $acquirer->acquireIdentity($group);
$this->set('entity', $result->getIdentity());
return $result;
} | [
"public function nextIdentity();",
"abstract function attainSignedIdentity();",
"public function getIdentity()\n {\n if (!isset($this->identity) && isset($this->instance)) {\n $this->identity = $this->createIdentity($this->instance);\n }\n\n return $this->identity;\n }",
"public function acquireId() {\n\t\treturn $this->getClient()->incr(self::KEY_OBJECT_COUNTER);\n\t}",
"static function identity()\r\n {\r\n return self::$m_identity;\r\n }",
"public function getIdentity()\n {\n $storage = $this->getStorage();\n\n if ($storage->isEmpty()) {\n return;\n }\n\n return $storage->read();\n }",
"public function setIdentity($identity);",
"public function getIdentity()\n {\n $storage = $this->getStorage();\n\n if ($storage->isEmpty()) {\n return null;\n }\n\n return $storage->read();\n }",
"public abstract function getDefaultIdentity();",
"public function getIdentity(){\n\t\tif($this->identity === null){\n\t\t\tif(isset($_SESSION[self::PREFIX.'id'])){\n\t\t\t\t$id = $_SESSION[self::PREFIX.'id'];\n\t\t\t\t\n\t\t\t\t// Getting the repository\n\t\t\t\t$repo = \\common\\Data\\Repository::getRepository($this->getEntityType());\n\t\t\t\t\n\t\t\t\t$res = $repo->find(null,array('id'=>(int)$id));\n\t\t\t\tif($res === null || count($res) == 0){\n\t\t\t\t\tunset($_SESSION[self::PREFIX.'id']);\n\t\t\t\t\t$this->identity = $this->getDefaultIdentity();\n\t\t\t\t}else{\n\t\t\t\t\t$this->identity = $res[0];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->identity = $this->getDefaultIdentity();\n\t\t\t}\n\t\t}\n\t\treturn $this->identity;\n\t}",
"protected function createAuthorIdent()\n {\n if ($this->currentAuthorIdent === null) {\n $this->currentAuthorIdent = uniqid() . uniqid();\n $this->cookieUtility->set('ahash', $this->currentAuthorIdent);\n }\n }",
"public function getIdentity()\n {\n return $this->identity;\n }",
"public /*static*/ function save_identity($identity=null)\n\t{\n\t\tif (!$identity && isset($this)) $identity = $this;\n\t\tif (!is_array($identity) && !is_a($identity, 'emailadmin_account'))\n\t\t{\n\t\t\tthrow new egw_exception_wrong_parameter(__METHOD__.\"() requires an identity or account as first parameter!\");\n\t\t}\n\t\tif (!($identity['acc_id'] > 0))\n\t\t{\n\t\t\tthrow new egw_exception_wrong_parameter(__METHOD__.\"() no account / acc_id specified in identity!\");\n\t\t}\n\t\t$data = array(\n\t\t\t'acc_id' => $identity['acc_id'],\n\t\t\t'ident_name' => $identity['ident_name'] ? $identity['ident_name'] : null,\n\t\t\t'ident_realname' => $identity['ident_realname'],\n\t\t\t'ident_org' => $identity['ident_org'],\n\t\t\t'ident_email' => $identity['ident_email'],\n\t\t\t'ident_signature' => $identity['ident_signature'],\n\t\t\t'account_id' => self::is_multiple($identity) ? 0 :\n\t\t\t\t(is_array($identity['account_id']) ? $identity['account_id'][0] : $identity['account_id']),\n\t\t);\n\t\tif ($identity['ident_id'] > 0)\n\t\t{\n\t\t\tself::$db->update(self::IDENTITIES_TABLE, $data, array(\n\t\t\t\t'ident_id' => $identity['ident_id'],\n\t\t\t), __LINE__, __FILE__, self::APP);\n\n\t\t\treturn $identity['ident_id'];\n\t\t}\n\t\tself::$db->insert(self::IDENTITIES_TABLE, $data, false, __LINE__, __FILE__, self::APP);\n\n\t\treturn self::$db->get_last_insert_id(self::IDENTITIES_TABLE, 'ident_id');\n\t}",
"private function setIdentity(){\n\t\t$config = $this->config->item('ion_auth');\n\t\t$this->_identity = $config['identity'];\n\n\t\t$this->_user = $this->ion_auth->user()->row();\n\t}",
"function Identity($user = null)\n {\n $this->_user = $user;\n if (is_null($user)) {\n $this->_user = Auth::getAuth();\n }\n\n if ((is_null($user) || $user == Auth::getAuth()) &&\n isset($GLOBALS['prefs'])) {\n $this->_prefs = &$GLOBALS['prefs'];\n } else {\n $this->_prefs = &Prefs::singleton($GLOBALS['conf']['prefs']['driver'],\n $GLOBALS['registry']->getApp(),\n $user, '', null, false);\n $this->_prefs->retrieve();\n }\n\n if (!($this->_identities = @unserialize($this->_prefs->getValue('identities', false)))) {\n /* Convert identities from the old format. */\n $this->_identities = @unserialize($this->_prefs->getValue('identities'));\n } elseif (is_array($this->_identities)) {\n $this->_identities = $this->_prefs->convertFromDriver($this->_identities, NLS::getCharset());\n }\n\n $this->setDefault($this->_prefs->getValue('default_identity'));\n }",
"public function getIdentityId();",
"public function getIdentity(array $params) {\n $id = session_id();\n if ($id == \"\") {\n /**\n * @see Scenario_Exception\n */\n require_once 'Scenario/Exception.php';\n\n throw new Scenario_Exception('Unable to use session_id() as an identity string, are you missing a session_start()?');\n }\n\n /**\n * @see Scenario_Identity\n */\n require_once 'Scenario/Identity.php';\n\n return new Scenario_Identity(session_id());\n }",
"public function getIdentity()\n {\n if ($this->_identity === null) {\n $this->_identity = $this->_getCookies()->get($this->_identityKey);\n }\n return $this->_identity;\n }",
"public function getIdentityKey()\n {\n return $this->identity_key;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AJAX Callback function for removing notes | function wpbs_action_ajax_calendar_remove_note()
{
if (!isset($_POST['calendar_id'])) {
return false;
}
$calendar_id = absint($_POST['calendar_id']);
$note_id = absint($_POST['note_id']);
$notes = wpbs_get_calendar_meta($calendar_id, 'notes', true);
unset($notes[$note_id]);
wpbs_update_calendar_meta($calendar_id, 'notes', $notes);
wp_die();
} | [
"function ajax_note_delete() {\n $note = ModelJB::newInstance()->getNoteByID(Params::getParam('noteID'));\n $result = ModelJB::newInstance()->deleteNote(Params::getParam('noteID'));\n if( ($result !== false) && ($result > 0 ) ) {\n $st = new Stream();\n $st->log_remove_note(Params::getParam('applicantID'), Params::getParam('noteID'));\n }\n }",
"public static function action_wp_ajax_stashbox_delete_note()\n {\n check_ajax_referer('stashbox-note', 'stashbox_nonce');\n $comment_id = filter_input(INPUT_POST, 'comment_id', FILTER_SANITIZE_NUMBER_INT);\n $deleted = Note::delete($comment_id);\n if( $deleted ) {\n Template::makeJson(\n array(\n 'status' => 'success',\n 'comment_id' => $comment_id\n )\n );\n } else {\n Template::makeJson( array('status' => 'failure'));\n }\n }",
"public function removeNote()\n {\n }",
"public static function delete_note() {\n $request_id = absint( $_REQUEST['request'] );\n $note = absint( $_REQUEST['note_id'] );\n\n wp_delete_comment( $note, true );\n\n ob_start();\n include WooCommerce_Warranty::$base_path .'templates/list-item-notes.php';\n $list = ob_get_clean();\n\n die( $list );\n }",
"public function deletenotes() {\n\n if ( isset( $_POST['jobNoteId'] ) ) {\n // Delete data row on job checklist\n $this->jobnote_model->delete( $_POST['jobNoteId'] );\n } else {\n echo \"error\";\n }\n }",
"public function deletenotes(){\n \tSiteController::loggedInCheck();\n\n\t\t$notesId = $_POST['notesId'];\n\t\t$notes = Notes::loadById($notesId);\n\t\t$notesAuthorId = $notes->get('userId');\n\t\t$notesAuthor = User::loadById($notesAuthorId);\n\n\t\t//user is the author of the notes, allow delete\n\t\tif($notesAuthor->get('username') == $_SESSION['username']){\n\t\t\t$notes->delete();\n\t\t} else {\n\t\t\t$_SESSION['info'] = \"You can only delete notes you have created.\";\n\t\t}\n\n\t\t//refresh page\n\t\theader('Location: '.BASE_URL);\t\t\t\t\t\t\t\t\t\t\t//TODO update\n\t}",
"function wp_ajax_delete_comment() {}",
"public function remove_note_from_case()\n {\n $this->load->model('cases_model', 'cases');\n $note_id = $this->input->post('note_id');\n $this->cases->remove_note_from_case($note_id);\n }",
"function deleteNote($_id){\n\t\t$sql = \"DELETE FROM notes WHERE id = '$_id'\";\n\t\tif ($this-> conn->query($sql)) {\n\n\t\t\t$data = array('Status' => 'Success', 'message'=> 'deleted Successfully', 'debug'=> $sql);\n\t\t\techo json_encode($data);\n\t\t}else{\n\t\t\t$data = array('Status' => 'Failure', 'message'=> 'delete failure', 'debug'=> $sql);\n\t\t\techo json_encode($data);\n\t\t}\n\n\t\t\n\t}",
"function wp_ajax_delete_comment()\n{\n}",
"function ajax_removetodo($tempsess){\n $iduser = $tempsess['id_user'];\n \n $idtodo = trim($_POST['id']);\n $idtodo = clear($idtodo);\n \n $query = \"DELETE FROM `todos` WHERE `id` = '$idtodo' and `id_user` = '$iduser' LIMIT 1\";\n $res = mysql_query($query) or die(mysql_error());\n if(!(mysql_affected_rows() > 0)){\n $res = array(\"answer\" => \"removetodo: May be no connection to the database, please come back later.\");\n exit(json_encode($res));\n }\n \n $res = array(\"answer\" => \"OK\");\n exit(json_encode($res));\n}",
"function removeSubmissionNote($args, $request) {\n\t\t$articleId = (int) $request->getUserVar('articleId');\n\t\t$noteId = (int) $request->getUserVar('noteId');\n\t\t$fileId = (int) $request->getUserVar('fileId');\n\t\t$this->validate($articleId);\n\t\tSectionEditorAction::removeSubmissionNote($articleId, $noteId, $fileId);\n\t\t$request->redirect(null, null, 'submissionNotes', $articleId);\n\t}",
"public function onNoteDelete()\n {\n $note = $this->getActiveNote();\n $note->delete();\n }",
"function hmgt_add_remove_nurse_notes($patient_id)\r\n{\r\n\t$obj_hospital = new Hospital_Management(get_current_user_id());\r\n\t?>\r\n\r\n\t<div class=\"panel panel-white\">\r\n\t\t\t\t<div class=\"panel-body patient_viewbox\">\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t$user_object=new Hospital_Management();\r\n\t\t\t\t\t\t\t $patient_note_id=$user_object-> get_nurse_notes($patient_id);\r\n\t\t\t\t\t\t\t//print_r($patient_note_id);?>\r\n\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t<div class=\"col-xs-10 nurse_notes\">\r\n\t\t\t\t\t\t\t<?php foreach($patient_note_id as $notepost_id){\r\n\t\t\t\t\t\t\t\t$note_data= get_post($notepost_id->post_id);\r\n\t\t\t\t\t\t\t\tif($note_data->post_type=='nurse_notes' || $note_data->post_type=='administrator_notes'){\r\n\t\t\t\t\t\t\t\techo '<div class=\"col-md-10 \">';\r\n\t\t\t\t\t\t\t\techo '<blockquote id=\"note-'.$notepost_id->post_id.'\">';\r\n\t\t\t\t\t\t\t\techo '<b><h4>';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$nurse=get_userdata($note_data->post_author);\r\n\t\t\t\t\t\t\t\t echo __('Notes by','hospital_mgt').\" \".$nurse->display_name.\" on \".$note_data->post_date.'</h4></b>';\r\n\t\t\t\t\t\t\t\techo '<p>'.$note_data->post_content.'</p>';\r\n\t\t\t\t\t\t\t\techo '</blockquote>';\r\n\t\t\t\t\t\t\t\techo '</div>';\r\n\t\t\t\t\t\t\t\tif( $obj_hospital->role == 'administrator' || ( $obj_hospital->role == 'nurse' && $note_data->post_author == get_current_user_id()))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo '<div class=\"col-md-1 \">';\r\n\t\t\t\t\t\t\t\techo '<a class=\"btn-delete-note badge badge-delete\" href=\"#\" id=\"notex-'.$notepost_id->post_id.'\" noteid='.$notepost_id->post_id.'>X</a>';\r\n\t\t\t\t\t\t\t\techo '</div>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t }?>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<?php if($obj_hospital->role == 'nurse' || $obj_hospital->role == 'administrator'){?>\r\n\t\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t\t <form name=\"medicinecat_form\" action=\"\" method=\"post\" class=\"form-horizontal\" id=\"medicinecat_form\">\r\n\t\t\t<div class=\"form-group\">\r\n\t\t\t<label class=\"col-sm-4 control-label\" for=\"medicine_name\"><?php _e('Add Note','hospital_mgt');?><span class=\"require-field\">*</span></label>\r\n\t\t\t<div class=\"col-sm-4\">\r\n\t\t\t\t<input id=\"nurse_note_text\" class=\"form-control text-input\" type=\"text\" name=\"nurse_note\">\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo $patient_id;?>\" name=\"patient_id\" id=\"patient_id\">\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo get_current_user_id();?>\" name=\"nurse_id\" id=\"nurse_id\">\r\n\t\t\t\t\r\n\t\t\t</div>\r\n\t\t\t<div class=\"col-sm-4\">\r\n\t\t\t\t<input type=\"button\" value=\"Save Note\" name=\"save_note\" class=\"btn btn-success\" id=\"btn-add-note\" note_by=\"<?php echo $obj_hospital->role;?>\"/>\r\n\t\t\t</div>\r\n\t\t</div>\r\n \t</form>\r\n\t</div>\t\r\n\t\t\t\t\t\t<?php }?>\r\n\t\t\t</div>\r\n<?php }",
"public static function ajax_delete_custom_nutrition() {\n\t\tif ( check_ajax_referer( 'wprm', 'security', false ) ) {\n\t\t\t$recipe_id = isset( $_POST['recipe_id'] ) ? intval( $_POST['recipe_id'] ) : 0; // Input var okay.\n\n\t\t\tif ( $recipe_id ) {\n\t\t\t\t$recipe = WPRM_Recipe_Manager::get_recipe( $recipe_id );\n\n\t\t\t\tif ( $recipe ) {\n\t\t\t\t\twp_trash_post( $recipe_id );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twp_die();\n\t}",
"public function delete_staff_note(){\n $this->_response_type('json');\n \n $ids = $this->input->post(\"ids\");\n \n $this->data->status = FALSE;\n if ( $this->permission_id != 0 && $this->permission_id != 2 ) {\n $this->data->html = 'You have not permission to write';\n } else { // owner, admin\n $this->load->model(\"merchant_staff_notes_m\", \"Merchant_Staff_Notes\");\n $this->data->status = $this->Merchant_Staff_Notes->deleteStaffNotes($ids);\n\n $this->data->html = $this->data->status ? 'Staff notes deleted successfully.' : 'Staff notes not be delete.';\n }\n\t}",
"public function ajax_remove_node()\r\n {\r\n // Retrieve data from stream\r\n $request = json_decode(file_get_contents('php://input'));\r\n \r\n $node_id = intval($request->node_id);\r\n \r\n if (Node::find($node_id)->delete()) {\r\n wp_send_json_success([\r\n 'success' => 1,\r\n ]);\r\n }\r\n \r\n wp_send_json_error([\r\n 'error' => 1,\r\n ]);\r\n }",
"public function actionDelete(){\n include_once('model/MNote.php');\n $note_model = new MNotes();\n\n $id = isset($_REQUEST['id']) ? trim($_REQUEST['id']) : '';\n\n if(empty($id)){\n die(json_encode([\n MSG_RESULT => false,\n MSG_TYPE => MSG_ERROR,\n MSG_MSG => 'Your request is wrong!'\n ]));\n }\n\n $sticky_note = $note_model->getNoteById($id);\n if(empty($sticky_note)){\n die(json_encode([\n MSG_RESULT => false,\n MSG_TYPE => MSG_ERROR,\n MSG_MSG => 'This sticky note is not exists!'\n ]));\n }\n\n if($note_model->deleteNote($id)){\n die(json_encode([\n MSG_RESULT => true,\n MSG_TYPE => MSG_SUCCESS,\n MSG_MSG => 'This item has been deleted successfully!'\n ]));\n }else{\n die(json_encode([\n MSG_RESULT => false,\n MSG_TYPE => MSG_ERROR,\n MSG_MSG => 'This item has not been deleted successfully!'\n ]));\n }\n }",
"function ajax_delete_important_notice()\n {\n $this->dashboard_model->delete_linkinfo_table($this->uri(3));\n $this->jsonMsgReturn(true,'Delete Success');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
export function isEnumType(type: any): type is GraphQLEnumType ; | #[Pure]
public static function isEnumType($type): bool
{
return $type instanceof EnumTypeInterface;
} | [
"public function isEnumType()\n {\n return $this->getType() == PropelTypes::ENUM;\n }",
"public function isEnum(): bool;",
"public function hasEnumType()\n {\n return count($this->get(self::ENUM_TYPE)) !== 0;\n }",
"private function isEnum(\\EasyRdf_Resource $type)\n {\n $subClassOf = $type->get('rdfs:subClassOf');\n\n return $subClassOf && $subClassOf->getUri() === self::SCHEMA_ORG_ENUMERATION;\n }",
"private function isEnum(RdfResource $type): bool\n {\n $subClassOf = $type->get('rdfs:subClassOf');\n\n return $subClassOf && self::SCHEMA_ORG_ENUMERATION === $subClassOf->getUri();\n }",
"public function isEnum():bool\n {\n return false;\n }",
"final public function isEnum():bool\n {\n return $this->mode === 'enum';\n }",
"public function registerEnumType()\n {\n $config = $this->getConfig();\n register_graphql_enum_type($this->type, $config);\n }",
"public static function isBuiltInType(\\GraphQL\\Type\\Definition\\Type $type) : bool\n {\n }",
"function wasm_valtype_is_num($valtype): bool\n{\n}",
"public function testWhenFieldIsEnumThenCatchEnumType()\n {\n $fieldExtractor = \\Mockery::mock('\\\\MySQLExtractor\\\\Extractor\\\\Fields')->makePartial();\n\n $fieldStringLine = \"`ShiftType` enum('full-time','part-time') NOT NULL DEFAULT 'part-time' COMMENT 'Specifies the working hours type (full-time, part-time).',\";\n\n $field = $fieldExtractor::getFieldFromString($fieldStringLine);\n $this->assertEquals('ShiftType', $field->Id);\n $this->assertEquals('ENUM', $field->Type);\n }",
"public function isDynamicEnum()\r\n\t{\r\n\t\treturn is_subclass_of($this->_type, 'KalturaDynamicEnum');\r\n\t}",
"public function isStringEnum()\r\n\t{\r\n\t\treturn is_subclass_of($this->_type, 'KalturaStringEnum');\r\n\t}",
"function isTypeLeague() {\r\n\t\treturn $this->record['type'] == 1;\r\n\t}",
"private function isBuiltInType($type)\n {\n /*\n * @todo Update for PHP7\n */\n return is_null($type);\n }",
"private static function meta_type_enum() {\n\t\tif ( null === self::$meta_type ) {\n\t\t\tself::$meta_type = new WPEnumType( [\n\t\t\t\t'name' => 'metaType',\n\t\t\t\t'values' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'NUMERIC',\n\t\t\t\t\t\t'value' => 'NUMERIC',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'BINARY',\n\t\t\t\t\t\t'value' => 'BINARY',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'CHAR',\n\t\t\t\t\t\t'value' => 'CHAR',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'DATE',\n\t\t\t\t\t\t'value' => 'DATE',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'DATETIME',\n\t\t\t\t\t\t'value' => 'DATETIME',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'DECIMAL',\n\t\t\t\t\t\t'value' => 'DECIMAL',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'SIGNED',\n\t\t\t\t\t\t'value' => 'SIGNED',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'TIME',\n\t\t\t\t\t\t'value' => 'TIME',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'UNSIGNED',\n\t\t\t\t\t\t'value' => 'UNSIGNED',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t] );\n\t\t} // End if().\n\t\treturn ! empty( self::$meta_type ) ? self::$meta_type : null;\n\t}",
"public static function register_type() {\n\t\tregister_graphql_enum_type(\n\t\t\t'RelationEnum',\n\t\t\t[\n\t\t\t\t'description' => __( 'The logical relation between each item in the array when there are more than one.', 'wp-graphql' ),\n\t\t\t\t'values' => [\n\t\t\t\t\t'AND' => [\n\t\t\t\t\t\t'name' => 'AND',\n\t\t\t\t\t\t'value' => 'AND',\n\t\t\t\t\t],\n\t\t\t\t\t'OR' => [\n\t\t\t\t\t\t'name' => 'OR',\n\t\t\t\t\t\t'value' => 'OR',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t}",
"public function isType($type){\n \n // canary...\n if(!$this->hasType()){ return false; }//if\n \n return ($this->field_map['type'] === $type);\n \n }",
"private function isIntegerType(string $type): bool\n {\n return $type === 'INTEGER' || $type === 'INT' || $type === 'SMALLINT' || $type === 'TINYINT' || $type === 'MEDIUMINT' || $type === 'BIGINT';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return job data for given jobid | function getJobData($jobid) {
// Check if job with given ID is set
if(!isset($this->operations[$jobid])) {
return FALSE;
}
// Get job type
return $this->operations[$jobid]['jobdata'];
} | [
"public function getJob($id);",
"abstract public function getJob( $id );",
"public function getJobById($id);",
"private function get_job($id)\n {\n $query = 'SELECT `jb_id` AS id, `jb_position` AS position, `jb_description` AS description, `jb_status` as status , `jb_created_on` AS crated_on\n FROM `jobs`\n WHERE jb_id = :id';\n $params = array(array(':id', $id, PDO::PARAM_INT));\n $job = $this->db->get_row($query, $params);\n if ($job === false) {\n $job = array('message' => 'Requested job not found');\n }\n\n return $job;\n\n }",
"public function get_completed_job($job_id)\n {\n $this->redis = $this->connect_redis_if_closed();\n\n if ($this->redis->exists($job_id)) {\n //data exists in caching layer, return it.\n $completed_job = $this->redis->hgetall($job_id);\n $completed_job['from'] = 'cache';\n } else {\n //data does not exist in caching layer.\n //get data from the mysql database and return it.\n $this->mysqli = $this->connect_mysql_if_closed();\n if (!$result = $this->mysqli->query(\"SELECT command,args,output,time_completed,job_id FROM completed_jobs WHERE job_id = $job_id LIMIT 1\")) {\n die(\"unable to fetch completed job from mysql database\");\n }\n $completed_job = $result->fetch_assoc();\n $completed_job['from'] = 'database';\n }\n return $completed_job;\n }",
"public function getJobData();",
"public function getSingleJob($id) //This needs to reflect naturalresourcesjobs.greenrivertech.net (can be called getSingleJob)\r\n {\r\n\r\n $select = \"SELECT * FROM job_table\r\n WHERE job_number=:id\";\r\n\r\n $statement = $this->_pdo->prepare($select);\r\n\r\n $statement->bindValue(':id', $id, PDO::PARAM_INT);\r\n $statement->execute();\r\n\r\n $row = $statement->fetch(PDO::FETCH_ASSOC);\r\n return $row;\r\n }",
"public function getJob($id) {\n $this->setRequestUrl('/job/'.$id);\n $this->setRequestObject(null);\n $this->setRequestMethod('GET');\n\n $job = new Job();\n try {\n return $job->cast($this->execute());\n } catch (Exception $e) {\n throw $e;\n }\n }",
"function LoadJobDetails($jobid=0)\n\t{\n\t\t$query = \"SELECT jobdetails FROM \" . SENDSTUDIO_TABLEPREFIX . \"jobs WHERE jobid='\" . (int)$jobid . \"'\";\n\t\t$result = $this->Db->Query($query);\n\t\t$row = $this->Db->Fetch($result);\n\t\tif (empty($row)) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn unserialize($row['jobdetails']);\n\t}",
"function readByJobID($id){\n Log::info(\"Entering JobPostingsBusinessService.readByJobID()\");\n \n //Get credentials for accessing the database\n $servername = config(\"database.connections.mysql.host\");\n $username = config(\"database.connections.mysql.username\");\n $password = config(\"database.connections.mysql.password\");\n $dbname = config(\"database.connections.mysql.database\");\n \n //create connection\n $conn = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n //Create a JobPostingsDataService with this connection\n $service = new JobPostingsDataService($conn);\n $flag = $service->readByJobID($id);\n \n //Return the finder results\n Log::info(\"Exit JobPostingsBusinessService.readByJobID() with \" . json_encode($flag));\n return $flag;\n }",
"public function jobDetail($job_id, $data = []) {\n\t\t$this->requestApi('jobs/' . $job_id, 'get', json_encode($data));\n\n\t\tif(!$this->isError()) {\n\t\t\treturn $this->getResponseParam();\n\t\t}\n\n\t\treturn false;\n }",
"public function getJobById($jobId)\n {\n }",
"function byId($job) {\n return new Job($this->connector, $this->connector->apiCall(\n \"job.api/get/$job\",\n function($result) { return $result['Job']; }\n ));\n }",
"public function getBuild(Job $job, $id);",
"public function findJobByID($id) {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobHistoryDAO($dbObj);\n return $this->DAO->findJobByID($id);\n }",
"public function findJob($id)\n {\n // Todo: implement this method...\n }",
"public function getJobByID($id, $getAll = false){\r\n\t\t$sql = \"SELECT \";\r\n\r\n\t\tif($getAll === true){\r\n\t\t\t$sql .= \"* \";\r\n\t\t} else {\r\n\t\t\t$sql .= \"`customer_table`.`customer_name`,`customer_table`.`customer_email`,`customer_table`.`customer_address`,`customer_table`.`customer_phone`,`job_table`.`product_name`,`job_table`.`job_notes`,`job_table`.`job_description`,`job_table`.`urgency`,`job_table`.`date_submitted`,`job_table`.`time_submitted`\";\r\n\t\t}\r\n\r\n\t\t$sql .= \"FROM `job_table` LEFT JOIN `customer_table`\r\n\t\tON `job_table`.`customer_id` = `customer_table`.`customer_id`\r\n\t\tWHERE `job_table`.`job_number` = '\". $id .\"' LIMIT 1\";\r\n\r\n\t\treturn $this->getSingleRow($sql);\r\n\t}",
"function get_job_details_by_user_id($id){\n\t $ci=& get_instance();\n\t $ci->load->model('jobs_model');\n\t return $ci->jobs_model->get_job_details_by_user_id($id);\n\t}",
"public function getInvoiceByJobId($jobid) { \n \n $this->db->select(\"i.*, c.companyname, c.mobile\");\n $this->db->from('invoice i'); \n $this->db->join('customer c', 'i.customerid =c.customerid', 'inner');\n $this->db->join('jobs j', 'i.jobid =j.jobid', 'left'); \n \n $this->db->where('i.jobid', $jobid);\n \n \n $data = $this->db->get()->row_array();\n \n $this->LogClass->log('Get Invoice Detail Query : '. $this->db->last_query());\n return $data;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ dbtable processed or grouped | function dbTable() {
global $plexWatch;
if ($plexWatch['globalHistoryGrouping'] == "yes") {
return "grouped";
}
return "processed";
} | [
"function groupBy() {}",
"function join_group_by($tablename=\"\",$fieldname=\"\",$whereCon=\"\", $groupby=\"\",$findline='')\r\n {\r\n $arguments = array($tablename,$fieldname,$whereCon, $groupby);\r\n $this->debug_obj->WriteDebug($class=\"templates.class\", $function=\"join_group_by\", $file=$findline['file'], $this->debug_obj->FindFunctionCalledline('join_group_by', $findline['file'], $findline['line']), $arguments);\r\n\r\n $get_all_styles = $this->db_connect->querySelect(\"CALL uspGet_join_group_by(\\\"$tablename\\\", \\\"$fieldname\\\", \\\"$whereCon\\\", \\\"$groupby\\\")\");\r\n $this->db_connect->closedb();\r\n return $get_all_styles;\r\n }",
"public function processGroupby(){\n\t \tif($this->groupbyQuery!=false){\n\t \t\t$groupby_ini = \"GROUP BY \";\n\t \t\t$count_cont = 0;\n\t \t\tforeach ($this->groupbyQuery as $value) {\n\t \t\t\tif($count_cont>0){\n\t \t\t\t\t$groupby_ini .= ', ';\n\t \t\t\t}\n\t \t\t\t$groupby_ini .= $value[0].' ';\n\t \t\t\t$count_cont++;\n\t \t\t}\n\t \t\t$this->groupbyProcess = $groupby_ini;\n\t \t}else{\n\t \t\t$this->groupbyProcess = false;\n\t \t}\n\t }",
"private function applyGroupBy() {\n if (!count($this->groupByStatements)) {\n return;\n }\n\n $this->query .= ' group by '.implode(',', $this->groupByStatements);\n }",
"private function applyGroup(): void\n {\n if ($this->hasAggregation) {\n $statement = sprintf('%s.%s', $this->configuration->getAlias(), $this->configuration->getIdentifier());\n $this->queryBuilder->groupBy($statement);\n } else {\n $this->queryBuilder->distinct();\n }\n }",
"function AggregateListRow() {\r\n\t}",
"function aggregation_row($type, $item, $username, $id);",
"private function setGroupingDataStats ()\n {\n $sql = 'SELECT ' . $this->grouping_column . ' , count(1) count FROM ' . $this->sql['tables'] . ' WHERE ' . $this->sql['joins'];\n if ( $this->query )\n $sql .= ' and (' . $this->query . ')';\n\n $sql .= $this->deletedQuery();\n $sql .= ' group by ' . $this->grouping_column;\n\n $sql = 'SELECT COUNT(1) count FROM (' . $sql . ') a';\n $this->stats = [\n 'total' => DB::select(DB::raw($sql))[0]->count,\n 'page' => $this->page,\n 'record' => $this->limit,\n ];\n }",
"abstract public function resultToGroups($raw);",
"function AggregateListRow() {\n\t}",
"function group_table($op=array()){\n\t\t\n\t\t$data=$op['data'];\n\t\t$headers=$op['headers'];\n\t\t$options=$op['options'];\n\t\t$child_headers=$op['child_headers'];\n\t\t$child_options=$op['child_options'];\n\t\t$txt=array();\n\t\tforeach($data as $k=>$group){\n\t\t\t$txt[]=array(\"<h3>\".$k.\"</h3>\");\n\t\t\t$txt[]=array($this->table($group,$child_headers,$child_options));\n\t\t}\n\t\tp2($txt);\n\t\treturn($this->table($txt,$headers,$options));\n\t}",
"function select_query_groupby( $data, $table_name, $where_condition =false,$order_by_field=false, $order_by_type=false, $group_by_field=false){\r\n\t\t\t\r\n\t\t\t$this->db->select( $data );\r\n\t\t\t$this->db->from($table_name);\r\n\t\t\tif( !empty($where_condition )){\r\n\t\t\t\t$this->db->where($where_condition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !empty($order_by_field )){\r\n\t\t\t\t$this->db->order_by( $order_by_field, $order_by_type );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !empty( $group_by_field )){\r\n\t\t\t\t$this->db->group_by( $group_by_field );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$query = $this->db->get();\t\r\n\t\t\tif($query->num_rows()>0)\r\n\t\t\t{\r\n\t\t\t\treturn $response = $query->result();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"public function getGroupByFields();",
"public function aggregate(): void;",
"function _getTableDataFlat($table, $fields=\"*\", $where=\"\", $order=\"\", $group=\"\")\n\t{\n\t $thisQuery = microtime(true);\n\t $sql = \"SELECT \".$fields.\" FROM \".$table;\n\t if ($where != \"\") {\n\t $sql .= \" WHERE \".$where;\n\t }\n\t if ($order != \"\") {\n\t $sql .= \" ORDER BY \".$order;\n\t }\n\t if ($group != \"\") {\n\t $sql .= \" GROUP BY \".$group;\n\t }\n\t $result = $this->_getTableData($table, $fields, $where, $order, $group);\n\t $temp = array();\n\t for ($i = 0; $i < sizeof($result); $i++) {\n\t foreach ($result[$i] as $key => $value) {\n\t $temp[$key][] = $value;\n\t }\n\t }\n\t $this->logProcess($thisQuery, $sql);\n\t return $temp;\n\t}",
"private function formatObjects($results) {\n \t\n $formatted = array();\n\n /* \n * convert all the rows to a grouping so \n * we can associate the related objects with \n * each other.\n * \n */\n \n $objects = array();\n $roots = array();\n \n foreach($results as $idx => $row) {\n \t\t\n /* \n * for each row must break the given columsn into\n * groups that we can read into objects.\n * \n */\n\t\n $colMap = array();\n \n foreach($row as $colName => $value) {\n \t\n $matches = array();\n if(!preg_match('/^([^:]+):(.*)$/', $colName, $matches)) {\n continue;\n }\n\n $table = $matches[1];\n $col = $matches[2];\n \n if(!isset($colMap[$table])) {\n $colMap[$table] = array();\n }\n \n $colMap[$table][$col] = $value;\n }\n \n /* make the objects */\n \n $linkables = array();\n \n foreach($colMap as $table => $data) {\n \n /* next object */\n \t\n $object = littlemdesign_db_ORMTable::create($table);\n $key = $object->getPKName();\n \n if(!isset($data[$key])) {\n \t $this->warning(\"formatObjects() can't find primary key for data: \".print_r($data,true));\n continue;\n }\n \n /* either use the existing object, or fill a new one */\n \n $id = $data[$key];\n $pkey = \"$table:$id\";\n \n /* fill in the object the first time */\n \t\n if(!isset($objects[$pkey])) {\n \n if(!$object->bulkSet($data)) {\n \t $this->error(\"formatObjects() can't format main object data: \".print_r($data,true));\n continue;\n }\n \n $objects[$pkey] = (object)array(\n \"object\" => $object,\n \"links\" => array()\n );\n \n } else {\n \t\n /* \n * we already have this object, so use the one \n * we already ahve.\n * \n */\n \t\n unset($object);\n $object = $objects[$pkey]->object;\n }\n \n /* \n * track which objects we are going to link together\n * from this row of data.\n * \n */\n \n $linkables[$pkey] = $object;\n \n /* \n * track the table that is the primary one we are \n * interested in.\n * \n */\n \n if($table == $this->tableName) {\n if(!isset($roots[$pkey])) {\n $roots[$pkey] = $objects[$pkey];\n }\n }\n }\n \n /*\n * now that we got all the ojects for this row, link them \n * together.\n * \n */\n \n foreach($linkables as $pkey1 => $object2) {\n \t\n foreach($linkables as $pkey2 => $object2) {\n \n if($pkey1 == $pkey2) {\n\n \t/* don't link to self */\n \t\n \tcontinue;\n }\n\n $outgoing =& $objects[$pkey1]->links;\n $incoming =& $objects[$pkey2]->links;\n \n if(!isset($outgoing[$pkey2])) {\n \t$outgoing[$pkey2] = $pkey2;\n }\n if(!isset($incoming[$pkey1])) {\n \t$incoming[$pkey1] = $pkey1;\n }\n }\n \n } /* end of linking */\n \n } /* end of row walk */\n\n /* \n * at this point the $roots list is our formatted result,\n * each object has a pointer to one of the primary objects,\n * and the various related objects implied by the context\n * of this query, if they were included.\n * \n */\n\n $it = new littlemdesign_db_QueryResult(\n self::OBJECT, \n (object)array(\n \"objects\" => $objects,\n \"roots\" => $roots\n )\n );\n \n return $it;\n }",
"function AggregateListRowValues() {\r\n\t}",
"abstract public function getGroupingField(): string;",
"function generateSQL($row) { /* abstract */ }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the date model. | public function getDateModel() : DateModel
{
return $this->dateModel;
} | [
"protected function _getDateModel()\n {\n return Mage::getSingleton('core/date');\n }",
"public function getPayDateModel()\n\t\t{\n\t\t\tif ($this->paydate_model === NULL)\n\t\t\t{\n\t\t\t\t$model = $this->getModel();\n\t\t\t\t$this->paydate_model = Date_PayDateModel_1::getModel(\n\t\t\t\t\t\t\t\t$model->paydate_model,\n\t\t\t\t\t\t\t\t$model->day_of_week,\n\t\t\t\t\t\t\t\t$model->last_paydate,\n\t\t\t\t\t\t\t\t$model->day_of_month_1,\n\t\t\t\t\t\t\t\t$model->day_of_month_2,\n\t\t\t\t\t\t\t\t$model->week_1,\n\t\t\t\t\t\t\t\t$model->week_2);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->paydate_model;\n\t\t}",
"public function user_date() {\n return $this->_model('user_date', $this->vars['id'], 'Neoform\\User\\Date\\Model');\n }",
"public function getVehicleModelDate() {\n\t\treturn $this->vehicleModelDate;\n\t}",
"public function user_date() {\n return $this->_model('user_date', $this->vars['id'], 'user\\date\\model');\n }",
"public function getDt();",
"public function getMetaDate()\n {\n return $this->dbObject('Date');\n }",
"public static function get_date_field()\n {\n return self::instance()->getDateField();\n }",
"public function getDate() {\n return $this->getEvalAttribute('date');\n }",
"public function getDate_record()\n\t{\n\t\treturn $this->date_record;\n\t}",
"function get_to_date()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_TO_DATE);\r\n }",
"public function Date()\n\t{\n\t\treturn $this->date;\n\t}",
"public function getOrderDate();",
"public function getEntryDate();",
"function getDate() {\n\t\treturn $this->_Date;\n\t}",
"public function getRateDate();",
"public function getdateInput()\n {\n return $this->dateinput;\n }",
"public function getDateContrat() {\n return $this->dateContrat;\n }",
"public function getDATE()\n {\n return $this->DATE;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display our custom control in the Customizer. | public function render_content() {
// We do this to allow the upload control to specify certain labels
$l10n = json_encode( $this->l10n );
// Control title
printf(
'<span class="customize-control-title" data-l10n="%s" data-mime="%s">%s</span>',
esc_attr( $l10n ),
esc_attr( $this->mime_type ),
esc_html( $this->label )
);
// Control description
if ( ! empty( $this->description ) ) : ?>
<span class="description customize-control-description"><?php echo $this->description; ?></span>
<?php endif; ?>
<div class="current"></div>
<div class="actions"></div>
<?php
} | [
"public function render_content() {\n\t\tif ( empty( $this->choices ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<label>\n\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t<span class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t<?php endif; ?>\n\n\t\t\t<select <?php $this->link(); ?>>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $this->choices as $value => $label ) :\n\t\t\t\t\techo '<option value=\"' . esc_attr( $value ) . '\"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</label>\n\t\t<?php\n\t}",
"public function render_content() {\n?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"function casino2_customize_register( $wp_customize ) {\n\n /* Pinegrow generated Customizer Controls Begin */\n\n /* Pinegrow generated Customizer Controls End */\n\n}",
"public function render_content() {\r\n\t\t\t?>\r\n\t\t\t<label>\r\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label); ?></span>\r\n\t\t\t\t<span class=\"description customize-control-description\"><?php echo esc_html( $this->description); ?></span>\r\n\t\t\t\t<input class=\"custorange\" type=\"range\" id=\"input-<?php echo esc_html( $this->id ); ?>\" <?php $this->link(); ?> value=\"<?php echo esc_html( $this->value() ); ?>\" <?php $this->input_attrs(); ?> onmousemove=\"if(this.focus){this.nextElementSibling.innerHTML=this.value;}\" ontouchmove=\"if(this.focus){this.nextElementSibling.innerHTML=this.value;}\">\r\n\t\t\t\t<span class=\"range-value\"><?php echo esc_html( $this->value() ); ?></span>\r\n\t\t\t</label>\r\n\t\t\t<?php\t\r\n\t\t}",
"public function render_content() {\n\n\t\tswitch ( $this->type ) {\n\n\t\t\tcase 'content' :\n\n\t\t\t\tif ( isset( $this->label ) ) {\n\t\t\t\t\techo '<span class=\"customize-control-title\">'. esc_html( $this->label ) .'</span>';\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $this->content ) ) {\n\t\t\t\t\techo $this->content;\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $this->description ) ) {\n\t\t\t\t\techo '<span class=\"description customize-control-description\">' . esc_html( $this->description ) . '</span>';\n\t\t\t\t}\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}",
"protected function colorselectorField() {\n echo $this->getLabel();\n echo '<div class=\"controls\">';\n echo $this->getPrepend();\n $this->widget('core.widgets.TColorSelector', array(\n 'model' => $this->model,\n 'attribute' => $this->attribute,\n ));\n echo $this->getAppend();\n echo $this->getError() . $this->getHint();\n echo '</div>';\n }",
"public function render_content()\n\t\t{ ?>\n\t\t\t<label><p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?>\n </span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() );?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span></p></label> <?php // WPCS: XSS ok. ?>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"public function render_content() {\n\t\techo '<label>';\n\n\t\t\tif ( isset( $this->label ) && '' !== $this->label ) {\n\t\t\t\techo '<span class=\"zeen-control-subtitle\">' . sanitize_text_field( $this->label ) . '</span>';\n\t\t\t}\n\t\t\tif ( isset( $this->description ) && '' !== $this->description ) {\n\t\t\t\techo '<span class=\"description zeen-control-description\">' . sanitize_text_field( $this->description ) . '</span>';\n\t\t\t}\n\n\t\techo '</label>';\n\t}",
"protected function _register_controls() {\n \n }",
"function custom_theme_customizer( $wp_customize ) {\n\t// Section area \n\t$wp_customize->add_section( 'custom_ga_section' , array(\n\t 'title' => __( 'Google Analytics Code', 'custom' ),\n\t 'priority' => 30,\n\t 'description' => 'Add the GA UA here.',\n\t\t) );\n\t\t\n\t\t// New setting\n\t\t$wp_customize->add_setting( 'custom_ga_text');\n\t\t\n\t\t// New control\n\t\t$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'custom_ga_text', array(\n\t 'label' => __( 'Google Analytics Code', 'custom' ),\n\t 'section' => 'custom_ga_section',\n\t 'settings' => 'custom_ga_text',\n\t) ) );\n\n}",
"protected function _register_controls() {\r\n\t\t$this->start_controls_section(\r\n\t\t\t'section_rating',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'First section', 'elementor' ),\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_control(\r\n\t\t\t'select_box',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Select Box', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::SELECT,\r\n\t\t\t\t'options' => [\r\n\t\t\t\t\t'5' => '0-5',\r\n\t\t\t\t\t'10' => '0-10',\r\n\t\t\t\t],\r\n\t\t\t\t'default' => '5',\r\n\t\t\t]\r\n\t\t);\r\n\r\n\r\n\t\t$this->add_control(\r\n\t\t\t'title',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Title', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t\t'separator' => 'before',\r\n\t\t\t\t'dynamic' => [\r\n\t\t\t\t\t'active' => true,\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n \r\n\t\t\r\n \r\n \t\r\n $this->add_control(\r\n \t'price',\r\n [\r\n 'label' => __( 'Price', 'jt-elementor-review' ),\r\n 'type' => Controls_Manager::NUMBER,\r\n 'separator' => 'before',\r\n 'dynamic' => [\r\n 'active' => true,\r\n ],\r\n ]\r\n );\r\n \r\n \r\n\t\t$this->add_responsive_control(\r\n\t\t\t'align',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Alignment', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\r\n\t\t\t\t'options' => [\r\n\t\t\t\t\t'left' => [\r\n\t\t\t\t\t\t'title' => __( 'Left', 'elementor' ),\r\n\t\t\t\t\t\t'icon' => 'eicon-text-align-left',\r\n\t\t\t\t\t],\r\n\t\t\t\t\t'center' => [\r\n\t\t\t\t\t\t'title' => __( 'Center', 'elementor' ),\r\n\t\t\t\t\t\t'icon' => 'eicon-text-align-center',\r\n\t\t\t\t\t],\r\n\t\t\t\t\t'right' => [\r\n\t\t\t\t\t\t'title' => __( 'Right', 'elementor' ),\r\n\t\t\t\t\t\t'icon' => 'eicon-text-align-right',\r\n\t\t\t\t\t],\r\n\t\t\t\t\t'justify' => [\r\n\t\t\t\t\t\t'title' => __( 'Justified', 'elementor' ),\r\n\t\t\t\t\t\t'icon' => 'eicon-text-align-justify',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t\t'prefix_class' => 'elementor-widget%s--align-',\r\n\t\t\t\t'selectors' => [\r\n\t\t\t\t\t'{{WRAPPER}}' => 'text-align: {{VALUE}}',\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->end_controls_section();\r\n/*\r\n\t\t$this->start_controls_section(\r\n \r\n\t\t\t'section_title_style',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Title', 'elementor' ),\r\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\r\n\t\t\t\t'condition' => [\r\n\t\t\t\t\t'title!' => '',\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_control(\r\n\t\t\t'title_color',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Text Color', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t\t'scheme' => [\r\n\t\t\t\t\t'type' => Schemes\\Color::get_type(),\r\n\t\t\t\t\t'value' => Schemes\\Color::COLOR_3,\r\n\t\t\t\t],\r\n\t\t\t\t'selectors' => [\r\n\t\t\t\t\t'{{WRAPPER}} .elementor-star-rating__title' => 'color: {{VALUE}}',\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_group_control(\r\n\t\t\tGroup_Control_Typography::get_type(),\r\n\t\t\t[\r\n\t\t\t\t'name' => 'title_typography',\r\n\t\t\t\t'selector' => '{{WRAPPER}} .elementor-star-rating__title',\r\n\t\t\t\t'scheme' => Schemes\\Typography::TYPOGRAPHY_3,\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_responsive_control(\r\n\t\t\t'title_gap',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Gap', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::SLIDER,\r\n\t\t\t\t'range' => [\r\n\t\t\t\t\t'px' => [\r\n\t\t\t\t\t\t'min' => 0,\r\n\t\t\t\t\t\t'max' => 50,\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t\t'selectors' => [\r\n\t\t\t\t\t'body:not(.rtl) {{WRAPPER}}:not(.elementor-star-rating--align-justify) .elementor-star-rating__title' => 'margin-right: {{SIZE}}{{UNIT}}',\r\n\t\t\t\t\t'body.rtl {{WRAPPER}}:not(.elementor-star-rating--align-justify) .elementor-star-rating__title' => 'margin-left: {{SIZE}}{{UNIT}}',\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->end_controls_section();\r\n\r\n\t\t$this->start_controls_section(\r\n\t\t\t'section_stars_style',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Stars', 'elementor' ),\r\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_responsive_control(\r\n\t\t\t'icon_size',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Size', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::SLIDER,\r\n\t\t\t\t'range' => [\r\n\t\t\t\t\t'px' => [\r\n\t\t\t\t\t\t'min' => 0,\r\n\t\t\t\t\t\t'max' => 100,\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t\t'selectors' => [\r\n\t\t\t\t\t'{{WRAPPER}} .elementor-star-rating' => 'font-size: {{SIZE}}{{UNIT}}',\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_responsive_control(\r\n\t\t\t'icon_space',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Spacing', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::SLIDER,\r\n\t\t\t\t'range' => [\r\n\t\t\t\t\t'px' => [\r\n\t\t\t\t\t\t'min' => 0,\r\n\t\t\t\t\t\t'max' => 50,\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t\t'selectors' => [\r\n\t\t\t\t\t'body:not(.rtl) {{WRAPPER}} .elementor-star-rating i:not(:last-of-type)' => 'margin-right: {{SIZE}}{{UNIT}}',\r\n\t\t\t\t\t'body.rtl {{WRAPPER}} .elementor-star-rating i:not(:last-of-type)' => 'margin-left: {{SIZE}}{{UNIT}}',\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_control(\r\n\t\t\t'stars_color',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Color', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t\t'selectors' => [\r\n\t\t\t\t\t'{{WRAPPER}} .elementor-star-rating i:before' => 'color: {{VALUE}}',\r\n\t\t\t\t],\r\n\t\t\t\t'separator' => 'before',\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->add_control(\r\n\t\t\t'stars_unmarked_color',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Unmarked Color', 'elementor' ),\r\n\t\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t\t'selectors' => [\r\n\t\t\t\t\t'{{WRAPPER}} .elementor-star-rating i' => 'color: {{VALUE}}',\r\n\t\t\t\t],\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->end_controls_section();\r\n */\r\n\t}",
"protected function render() {\n $settings = $this->get_settings_for_display();\n echo get_masterslider( $settings['alias'] );\n }",
"public function register_controls()\n {\n }",
"public function renderPluginSettingsCustomFieldHelpResourcesControls() {\n\n require_once ( 'views/plugin-settings-custom-fields/view-wwpp-help-resources-controls-custom-field.php' );\n\n }",
"function ju_customize_register( $wp_customize ){\n /*echo '<pre>';\n var_dump( $wp_customize);\n echo '</pre>';*/\n\n\n $wp_customize->get_section('title_tagline')->title = 'General';\n\n //Caling the add_panel() method this method will alow me to create panel for sectinons inside the custimizer. this method have two parametars whic is the ID and array of settings\n $wp_customize->add_panel('foreach',[\n 'title' => __('Foreach'),\n 'description' => '<p>Foreach Theme Stting</p>',\n 'priority' => 160\n ]);\n //Caling function for social custom\n ju_social_customizer_section( $wp_customize);\n //Caling the function for misc elements from misc.php\n ju_misc_customizer_section( $wp_customize );\n\n}",
"function evp_customize_register( $wp_customize )\n {\n $wp_customize->add_setting( 'show_hide_logo', array(\n 'default' => 1,\n 'capability' => 'edit_theme_options',\n 'sanitize_callback' => 'esc_attr',\n ));\n\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'show_hide_logo', array(\n 'label' => esc_attr__( 'Show Branding', 'applique' ),\n 'section' => 'df_customize_logo_section',\n 'settings' => 'show_hide_logo',\n 'type' => 'checkbox'\n )));\n}",
"private function render_ui() {\n\n\t\t$wp_primary_category_admin = new WP_Primary_Category_Admin();\n\n\t\t// Build the WP Primary Category custom meta box.\n\t\t$this->loader->add_action( 'add_meta_boxes', $wp_primary_category_admin, 'add_wp_primary_category_box' );\n\n\t\t// Save the primary category in a post meta field.\n\t\t$this->loader->add_action( 'save_post', $wp_primary_category_admin, 'save_wp_primary_category' );\n\t}",
"public function customizer_link() {\n\t\techo '<a class=\"button-secondary\" href=\"'. admin_url( 'customize.php' ) .'\">'. __( 'Theme Customizer', 'apptheme' ) .'</a>';\n\t}",
"public function RenderControl () {\n\t\t$attrsStr = $this->renderControlAttrsWithFieldVars([\n\t\t\t'min', 'max', 'step',\n\t\t\t'list',\n\t\t\t'autoComplete',\n\t\t\t'placeHolder',\n\t\t\t'inputMode',\n\t\t]);\n\t\tif (!$this->form->GetFormTagRenderingStatus()) \n\t\t\t$attrsStr .= (strlen($attrsStr) > 0 ? ' ' : '')\n\t\t\t\t. 'form=\"' . $this->form->GetId() . '\"';\n\t\t$formViewClass = $this->form->GetViewClass();\n\t\t/** @var $templates \\stdClass */\n\t\t$templates = static::$templates;\n\t\t$result = $formViewClass::Format($templates->control, [\n\t\t\t'id'\t\t=> $this->id,\n\t\t\t'name'\t\t=> $this->name,\n\t\t\t'type'\t\t=> $this->type,\n\t\t\t'value'\t\t=> htmlspecialchars_decode(htmlspecialchars($this->value, ENT_QUOTES), ENT_QUOTES),\n\t\t\t'attrs'\t\t=> strlen($attrsStr) > 0 ? ' ' . $attrsStr : '',\n\t\t]);\n\t\treturn $this->renderControlWrapper($result);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get views of the published article. | function getViews() {
$application =& PKPApplication::getApplication();
return $application->getPrimaryMetricByAssoc(ASSOC_TYPE_ARTICLE, $this->getId());
} | [
"public function getViews();",
"public function getViews()\n {\n return $this->views;\n }",
"public function getPostViews($id);",
"public function get_views()\n\t{\n\t\treturn $this->driver_query($this->sql->view_list());\n\t}",
"public function views()\n {\n return $this->morphMany(\n config('page-view-counter.page_view_model'),\n 'visitable'\n );\n }",
"public function views() {\n return $this->hasMany(PostView::class, 'post_id');\n }",
"public function getPageViews()\n {\n return $this->pageViewNodes;\n }",
"public function getViews()\n {\n }",
"function views()\n\t{\n\t\t$views = $this->_analytics->getPageviews();\n\t\t$points = $this->_create_plot_array($views);\n\t\treturn $points;\n\t}",
"public function index()\n {\n $articles = Article::latest('published_at')->published()->get();\n\n return view('articles.index', compact('articles'));\n\t}",
"public function popular()\n {\n return Article::orderBy('views', 'desc')->get();\n }",
"public function viewedAction()\n {\n $productId = (int) $this->Request()->getParam('articleId');\n $maxPages = (int) $this->config->get('similarViewedMaxPages', 10);\n $perPage = (int) $this->config->get('similarViewedPerPage', 4);\n\n $this->marketingModule->sBlacklist[] = $productId;\n $products = $this->marketingModule->sGetSimilaryShownArticles($productId, $maxPages * $perPage);\n\n $numbers = array_column($products, 'number');\n $result = $this->getPromotions($numbers);\n\n $this->View()->assign('maxPages', $maxPages);\n $this->View()->assign('perPage', $perPage);\n $this->View()->assign('viewedArticles', $result);\n }",
"public function views(): ViewsStore\n {\n return $this->views;\n }",
"public function viewedPosts()\n {\n return $this->morphedByMany(Post::class, 'viewable', 'user_page_views')\n ->withTimestamps()\n ->withPivot(['updated_at', 'count', 'id']);\n }",
"public function views();",
"public function views() {\n return $this->hasMany(View::class);\n }",
"public function getViews() {\n return $this->findDependentRowset('My_Model_Table_ViewCounter');\n }",
"public function interviews()\n {\n if (empty($this->pub_interviews)) {\n $this->pub_interviews = $this->parsearticles(\"Interviews\");\n }\n return $this->pub_interviews;\n }",
"public function actionPostsByViews() {\n // prepare the view\n $this->setView('blog/postlist');\n $this->pagetitle = 'Most viewed posts';\n $this->content->user = $this->_user;\n $this->content->heading = 'Most viewed posts';\n $this->content->blogposts = BaseDAO::factory('Blogpost')->findByViews();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ views pagers theme_views_mini_pager original: /views/theme/theme.inc | function starter_views_mini_pager($vars) {
global $pager_page_array, $pager_total;
$tags = $vars['tags'];
$element = $vars['element'];
$parameters = $vars['parameters'];
// Calculate various markers within this pager piece:
// current is the page we are currently paged to
$pager_current = $pager_page_array[$element] + 1;
// max is the maximum page number
$pager_max = $pager_total[$element];
// End of marker calculations.
$li_previous = theme('pager_previous',
array(
'text' => (isset($tags[1]) ? $tags[1] : t('‹‹')),
'element' => $element,
'interval' => 1,
'parameters' => $parameters,
)
);
if (empty($li_previous)) {
$li_previous = " ";
}
$li_next = theme('pager_next',
array(
'text' => (isset($tags[3]) ? $tags[3] : t('››')),
'element' => $element,
'interval' => 1,
'parameters' => $parameters,
)
);
if (empty($li_next)) {
$li_next = " ";
}
if ($pager_total[$element] > 1) {
$items[] = array(
'class' => array('previous'),
'data' => $li_previous,
);
$items[] = array(
'class' => array('current'),
'data' => t('@current of @max', array('@current' => $pager_current, '@max' => $pager_max)),
);
$items[] = array(
'class' => array('next'),
'data' => $li_next,
);
return theme('item_list',
array(
'items' => $items,
'title' => NULL,
'type' => 'ul',
'attributes' => array('class' => array('pager')),
'daddy' => 'pager'
)
);
}
} | [
"function ideal_protest_views_mini_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) {\n global $pager_page_array, $pager_total;\n $view = views_get_current_view();\n $view_name = $view->name; \n // Calculate various markers within this pager piece:\n // Middle is used to \"center\" pages around the current page.\n $pager_middle = ceil($quantity / 2);\n // current is the page we are currently paged to\n $pager_current = $pager_page_array[$element] + 1;\n // max is the maximum page number\n $pager_max = $pager_total[$element];\n // End of marker calculations.\n\n\n $li_previous = theme('pager_previous', (isset($tags[1]) ? $tags[1] : t('‹‹')), $limit, $element, 1, $parameters);\n if (empty($li_previous)) {\n $li_previous = \" \";\n }\n\n $li_next = theme('pager_next', (isset($tags[3]) ? $tags[3] : t('››')), $limit, $element, 1, $parameters);\n if (empty($li_next) && $view_name == 'idea_in_focus') {\n $li_next = theme('pager_first', (isset($tags[0]) ? $tags[0] : '1'), $limit, $element, $parameters);\n }\n elseif (empty($li_next)) {\n $li_next = \" \";\n }\n \n if ($pager_total[$element] > 1) {\n $items[] = array(\n 'class' => 'pager-previous',\n 'data' => $li_previous,\n );\n\n $items[] = array(\n 'class' => 'pager-current',\n 'data' => t('@current of @max', array('@current' => $pager_current, '@max' => $pager_max)),\n );\n\n $items[] = array(\n 'class' => 'pager-next',\n 'data' => $li_next,\n );\n return theme('item_list', $items, NULL, 'ul', array('class' => 'pager'));\n }\n}",
"protected function preProcessMini() {\n\n $this\n ->addClass('pager-mini')\n ->addContext('max', 1)\n ->addContext('show_all', true)\n ->addContext('end_size', 0)\n ->addcontext('prev_next', true);\n\n return $this;\n }",
"function mox_pager($vars) {\n $tags = $vars['tags'];\n $element = $vars['element'];\n $parameters = $vars['parameters'];\n $quantity = $vars['quantity'];\n $pager_list = theme('pager_list', $vars);\n\n $links = array();\n $links['pager-first'] = theme('pager_first', array(\n 'text' => (isset($tags[0]) ? $tags[0] : t('First')),\n 'element' => $element,\n 'parameters' => $parameters\n ));\n $links['pager-previous'] = theme('pager_previous', array(\n 'text' => (isset($tags[1]) ? $tags[1] : t('Prev')),\n 'element' => $element,\n 'interval' => 1,\n 'parameters' => $parameters\n ));\n $links['pager-next'] = theme('pager_next', array(\n 'text' => (isset($tags[3]) ? $tags[3] : t('Next')),\n 'element' => $element,\n 'interval' => 1,\n 'parameters' => $parameters\n ));\n $links['pager-last'] = theme('pager_last', array(\n 'text' => (isset($tags[4]) ? $tags[4] : t('Last')),\n 'element' => $element,\n 'parameters' => $parameters\n ));\n $links = array_filter($links);\n $pager_links = theme('links', array(\n 'links' => $links,\n 'attributes' => array('class' => 'links pager pager-links')\n ));\n if ($pager_list) {\n return \"<div class='pager clearfix'>$pager_list $pager_links</div>\";\n }\n}",
"function qw_theme_pager_default($pager, &$wp_query)\n{\n // help figure out the current page\n $path_array = explode('/page/', $_SERVER['REQUEST_URI']);\n\n $pager_themed = '';\n $pager['next'] = ($pager['next']) ? $pager['next'] : 'Next Page »';\n $pager['previous'] = ($pager['previous']) ? $pager['previous'] : '« Previous Page';\n\n if($page = qw_get_page_number($wp_query))\n {\n $wpurl = get_bloginfo('wpurl');\n\n // previous link with page number\n if($page >= 3){\n $pager_themed.= '<div class=\"query-prevpage\">\n <a href=\"'.$wpurl.$path_array[0].'/page/'.($page-1).'\">'.$pager['previous'].'</a>\n </div>';\n }\n // previous link with no page number\n else if ($page == 2)\n {\n $pager_themed.= '<div class=\"query-prevpage\">\n <a href=\"'.$wpurl.$path_array[0].'\">'.$pager['previous'].'</a>\n </div>';\n }\n\n // next link\n if(($page+1) <= $wp_query->max_num_pages){\n $pager_themed.= '<div class=\"query-nextpage\">\n <a href=\"'.$wpurl.$path_array[0].'/page/'.($page+1).'\">'.$pager['next'].'</a>\n </div>';\n }\n\n return $pager_themed;\n }\n}",
"function theme_flowdeveloper_pager($variables)\r\n{\r\n\t$baseURL = $variables['baseURL'];\r\n\t$currentPage = $variables['currentPage'];\r\n\t$pageCount = $variables['pageCount'];\r\n\t$output = '';\r\n\t$items = '';\r\n\t$next = '';\r\n\t$previous = '';\r\n\t\r\n\tif ( (count($pageCount) > 0) && isset($currentPage) && isset($baseURL)) \r\n\t{\r\n\t\tfor ($i = 1; $i <= $pageCount; $i++) \r\n\t\t{\r\n\t\t\t$ateClass = 'c-ate-page-'.$i ;\r\n\t\t\tif ($i == $currentPage) \r\n\t\t\t{\r\n\t\t\t\t$items .= '<li class=\"active c-ate-page-active '. $ateClass .'\"><a href=\"'. $baseURL .'/'.$i.'\">'. $i.'</a></li>'; \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$items .= '<li class=\"'. $ateClass .'\"><a href=\"'. $baseURL .'/'.$i.'\">'. $i.'</a></li>'; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (($currentPage - 1) > 0) \r\n\t\t{\r\n\t\t\t$pp = ($currentPage - 1);\r\n\t\t\t$previous = '<li class=\"previous c-ate-page-previous\"><a href=\"'. $baseURL .'/'. $pp .'\">Previous</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\tif (($currentPage + 1) <= $pageCount) \r\n\t\t{\r\n\t\t\t$np = ($currentPage + 1);\r\n\t\t\t$next = '<li class=\"next c-ate-page-next\"><a href=\"'. $baseURL .'/'. $np .'\">Next</a></li>';\r\n\t\t}\t\t\r\n\t\t\r\n\t\t$output = '<nav><ul class=\"pagination c-ate-pager\">'\r\n\t\t\t\t. $previous\r\n\t\t\t\t. $items\r\n\t\t\t\t. $next\r\n\t\t\t\t. '</ul></nav>'\t\r\n\t\t\t\t;\r\n\t}\r\n\t\r\n\treturn $output;\r\n}",
"function smarty_function_simplepager($params, &$smarty) \n{\n extract($params);\n unset($params);\n // Quick check to ensure that we have work to do\n if (empty($perpage)) {\n $perpage = 10;\n }\n\n if ($total <= $perpage) {\n return;\n }\n $compoutput = \"\";\n\n if (empty($startnum)) {\n $startnum = 1;\n }\n\n // Make << and >> do paging properly\n // Display subset of pages if large number\n\n // Show startnum link\n if ($startnum != 1) {\n $url = preg_replace('/%%/', 1, $urltemplate);\n $compoutput .= \"<a href=\\\"$url\\\" title=\\\"1\\\"><<</a>\"; // ->URL($url, '<<');\n } else {\n $compoutput .= \"<<\";\n }\n $compoutput .= \" \";\n\n // Show following items \n $pagenum = 1; \n\n for ($curnum = 1; $curnum <= $total; $curnum += $perpage) \n { \n if (($startnum < $curnum) || ($startnum > ($curnum + $perpage - 1))) \n { \n //mod by marsu - use sliding window for pagelinks \n if ((($pagenum%10)==0) // link if page is multiple of 10 \n || ($pagenum==1) // link first page \n || (($curnum >($startnum-6*$perpage)) //link -5 and +5 pages \n &&($curnum <($startnum+6*$perpage))) \n ) { \n // Not on this page - show link \n $url = preg_replace('/%%/', $curnum, $urltemplate); \n $compoutput .= \"<a href=\\\"$url\\\" title=\\\"\".pnVarPrepForDisplay(_PNFORUM_PAGE).\" $pagenum\\\">$pagenum</a>\";\n $compoutput .= \" \"; \n } \n //end mod by marsu \n } else { \n // On this page - show text \n $compoutput .= $pagenum . \" \"; \n } \n $pagenum++; \n } \n if (($curnum >= $perpage + 1) && ($startnum < $curnum - $perpage)) {\n $temp = $curnum - $perpage;\n $url = preg_replace('/%%/', $curnum - $perpage, $urltemplate);\n $compoutput .= \"<a href=\\\"$url\\\" title=\\\"\".pnVarPrepForDisplay(_PNFORUM_PAGE).\" $temp\\\">>></a>\";\n } else {\n $compoutput .= \">>\";\n }\n return $compoutput;\n}",
"function smarty_function_pagesetter_pubPager($args, &$smarty)\r\n{\r\n $core = &$smarty->get_template_vars('core');\r\n\r\n // Get stuff that exists in core\r\n $page = isset($args['page']) ? intval($args['page']) : intval($core['page']);\r\n $baseURL = isset($args['baseURL']) ? $args['baseURL'] : $core['baseURL'];\r\n\r\n //start filter patch 2005-01-19 Claus Parkhoi\r\n //Build filter string\r\n //this will get filter, filter1,...,filtern from the url\r\n //note: the filter string will use filters starting from filter1\r\n $filterStrSet = pagesetterGetFilters(array(), $dummyArgs);\r\n if(count($filterStrSet) != 0)\r\n {\r\n $temp = array();\r\n foreach( $filterStrSet as $key => $item )\r\n {\r\n $i = $key + 1;\r\n $temp[] = \"filter$i=\" . $item;\r\n }\r\n $filterStr = \"&\" . implode(\"&\", $temp);\r\n } else $filterStr = \"\";\r\n $baseURL .= $filterStr;\r\n //end filter patch 2005-01-19\r\n \r\n // Get stuff for presentation\r\n $prev = isset($args['prev']) ? $args['prev'] : _PGPREV;\r\n $next = isset($args['next']) ? $args['next'] : _PGNEXT;\r\n $separator = isset($args['separator']) ? $args['separator'] : ' ';\r\n\r\n $html = '';\r\n\r\n if ($page > 0)\r\n $html .= \"<a href=\\\"$baseURL&page=\" . $page . \"\\\">$prev</a> \";\r\n\r\n if ($core['morePages'])\r\n $html .= \"$separator<a href=\\\"$baseURL&page=\" . ($page+2) . \"\\\">$next</a>\";\r\n\r\n return $html;\r\n}",
"abstract protected function getPaginationView();",
"function smarty_function_new_pager($params, &$smarty)\n{\n /*\n @param int $linknum - max. number of links to show on one page (default: false)\n @param int $delta_l - number of links left to current (default: false);\n @param int $delta_r - number of links right to current (default: false);\n\n @param mixed $pages - number of pages to browse\n @param boolean always_show - show paging if there is less or equal than 1 page (default: false}\n\n @param int $curpage - current page number\n @param string baseurl - baseurl to which the pagenumber will appended\n @param string url_append - text to append to url after pagenumber, e.g. \"html\" (default: \"\")\n @param string page_append - text to append to url before pagenumber and after baseurl, e.g. \"html\" (default: \"\")\n @param string txt_first - text for link to first page (default: \"&&\")\n @param string txt_prev - text for link to previous page (default: \"&\")\n @param string separator - text to print between page numbers (default: \"&|&\")\n @param string txt_next - text for link to next page (default: \"&\")\n @param string txt_last - text for link to last page (default: \"&&\")\n @param string txt_skip - text shown when page s are skipped (not shown) (default: \"&...&\")\n @param string css_class - css class for the pager (default: \"\")\n @param boolean link_current - whether to link the current page (default: false)\n @param boolean first_w_page - links to the first page are with pagenubmer and page_append (default: true}\n */\n\n /* Define all vars with default value */\n $linknum = false;\n $delta_l = false;\n $delta_r = false;\n $always_show = false;\n\n $container = 'ul';\n $container_class = '';\n $links_container = 'li';\n $link_current = false;\n\n $prev_txt = 'prev';\n $prev_class = '';\n $show_prev_in_first = false;\n\n $next_txt = 'next';\n $next_class = '';\n $show_next_in_last = false;\n\n $first_txt = 'first';\n $first_w_page = true;\n\n $last_txt = false;\n\n\n $page_append= '';\n $url_append= '';\n\n $separator = '';\n\n $txt_skip = '...';\n\n/* $css_class = '';\n $css_current='curr';*/\n\n\t$npps = null;\n\t$retval = '';\n /* Import parameters */\n extract($params);\n\n /* Convert page count if array *//*\n if (is_array($pagecount)) $pagecount = sizeof($pagecount);\n if (!empty($npps)) {\n\t $retval .= '<div class=\"npps\">';\n\t\tforeach ($npps as $n) {\n\t\t\t$retval .= \"<a href=\\\"?npp=$n\\\" class='npp'>$n</a> \";\n\t\t}\n\t $retval .= '</div>';\n\t}*/\n\n /* Check parameters */\n if (empty($curpage) || empty($pages) || empty($baseurl)) {\n return $retval;\n }\n\n /* Paging needed? */\n if ($pages <= 1 && !$always_show) {\n // No paging needed for one page\n return $retval;\n }\n\n /* There is no 0th page */\n if ($curpage) $curpage = ($curpage == 0) ? 1 : $curpage;\n\n /* Define additional required vars */\n if ($delta_l && $delta_r && $linknum) {\n $smarty->trigger_error(\"pager: You have set all 3 parameters (delta_r, delta_l, linknum)\");\n return $retval;\n }\n elseif ($delta_l && $delta_r) {\n $linknum = $delta_l + $delta_r + 1;\n }\n elseif ($delta_l && $linknum) {\n $delta_r = ($linknum-1 > $delta_l) ? $linknum-1-$delta_l : 0;\n }\n elseif ($delta_r && $linknum) {\n $delta_l = ($linknum-1 > $delta_r) ? $linknum-1-$delta_r : 0;\n }\n elseif ($linknum) {\n if ($linknum % 2 == 0) {\n $delta_l = ($linknum / 2 ) - 1;\n $delta_r = $linknum / 2;\n } else {\n $delta_l = $delta_r = ($linknum - 1) / 2;\n }\n }\n else {\n $smarty->trigger_error(\"pager: cant count links. You have to set linknum or 2 any parameters (delta_r, delta_l, linknum)\");\n return $retval;\n }\n if ($curpage > $pages) {\n $curpage = $pages;\n }\n if ($pages < $linknum) {\n $linknum = $pages;\n }\n if ($curpage - $delta_l < 1) {\n $delta_r = $linknum - $curpage;\n $delta_l = $curpage - 1;\n }\n if ($curpage + $delta_r > $pages) {\n $delta_r = $pages - $curpage;\n $delta_l = $linknum - 1 - $delta_r;\n }\n\n $links = array();\n for ($i = 0; $i < $delta_l; $i++) {\n $links[] = $curpage - $delta_l + $i;\n }\n $links[] = $curpage;\n for ($i = 0; $i < $delta_r; $i++) {\n $links[] = $curpage + $i + 1;\n }\n\n /* Build link bar */\n $retval .= '<'.$container.(($container_class) ? (' class=\"'.$container_class.'\"') : '').'>';\n\n // First page link\n if ($first_txt !== false) {\n // Forgon to do\n }\n\n // Previous page link\n if ($prev_txt !== false && ($links[0] !== 1 || $show_prev_in_first)) {\n $retval .= '<'.$links_container.(($prev_class) ? (' class=\"'.$prev_class.'\"') : '').'>';\n if ($curpage >= 2) {\n if ($curpage >= 2) {\n $i = $curpage-1;\n } else {\n $i = 1;\n }\n if ($i == 1) {\n $link = $baseurl.(($first_w_page) ? ($page_append.'1') : '').$url_append;\n } else {\n $link = $baseurl.$page_append.$i.$url_append;\n }\n $retval .= '<a href=\"'.$link.'\">';\n }\n $retval .= $prev_txt;\n if ($links[0] !== 1) {\n $retval .= '</a>';\n }\n $retval .= '</'.$links_container.'>';\n }\n\n // Skipper if needed\n if ($links[0] != 1) {\n $retval .= '<'.$links_container.'>'.$txt_skip.'</'.$links_container.'>';\n }\n\n // Links to the left\n for ($i = 0; $i < $delta_l; $i++) {\n $link = $baseurl.(($links[$i] == 1 && !$first_w_page) ? '' : $page_append.$links[$i]).$url_append;\n $retval .=\n '<'.$links_container.'>'.\n '<a href=\"'.$link.'\">'.$links[$i].'</a>'.\n '</'.$links_container.'>';\n }\n\n // Curr page\n $retval .=\n '<'.$links_container.'>'.\n (($link_current)\n ? '<a href=\"'.$baseurl.$page_append.$curpage.$url_append.'\">'.$curpage.'</a>'\n : $curpage\n ).\n '</'.$links_container.'>';\n\n // Links to the right\n for ($i = 0; $i < $delta_r; $i++) {\n $link = $baseurl.$page_append.$links[$delta_l+1+$i].$url_append;\n $retval .=\n '<'.$links_container.'>'.\n '<a href=\"'.$link.'\">'.$links[$delta_l+1+$i].'</a>'.\n '</'.$links_container.'>';\n }\n \n // Skipper if needed\n if (end($links) != $pages) {\n $retval .= '<'.$links_container.'>'.$txt_skip.'</'.$links_container.'>';\n }\n\n // Next page link\n if ($next_txt !== false && (end($links) !== $pages || $show_next_in_last)){\n $link = $baseurl.$page_append.($curpage + 1).$url_append;\n $retval .=\n '<'.$links_container.(($next_class) ? (' class=\"'.$next_class.'\"') : '').'>'.\n '<a href=\"'.$link.'\">'.$next_txt.'</a>'.\n '</'.$links_container.'>';\n }\n $retval .= '</'.$container.'>';\n\n // Last page link\n if ($last_txt !== false) {\n // Forgon to do\n }\n\n return $retval;\n}",
"function pager($zeilen, $seite, $pro_seite, $url, $show_pageinfo = 1, $linkanzahl = 2, $show_pageselect = 0)\n{\n $max_ausgabe = $pro_seite;\n $gesamtseiten = floor(($zeilen - 1) / $pro_seite + 1);\n\n $aktuelle_seite = $seite ? $seite : 1;\n $linkanzahlausgabe = $linkanzahl;\n\n $letzte = $linkanzahlausgabe + $aktuelle_seite;\n if ($letzte > $gesamtseiten) {\n $letzte = $gesamtseiten;\n }\n\n $startback = $aktuelle_seite - $linkanzahlausgabe;\n if ($startback < 1) {\n $startback = 1;\n }\n\n $navigationslinks = ' ';\n if ($gesamtseiten != 1 && $zeilen) {\n $seitenlink = '';\n\n if ($gesamtseiten > 1) {\n $prevbl = $aktuelle_seite > 1 ? $aktuelle_seite - 1 : 1;\n $nohrefpr = $aktuelle_seite == 1 ? 'no' : '';\n $seitenlink .= \"\\t<td class=\\\"pl\\\"><a \".$nohrefpr.'href=\"'.$url.\"=1\\\" title=\\\"Erste Seite aufrufen\\\">« «</a></td>\\n\\t<td class=\\\"pl\\\"><a \".$nohrefpr.'href=\"'.$url.'='.$prevbl.\"\\\" title=\\\"Eine Seite zur�ck\\\">«</a></td>\\n\";\n }\n\n for ($i = $startback; $i <= $letzte; $i++) {\n if ($aktuelle_seite == \"$i\") {\n $seitenlink .= \"\\t<td class=\\\"aktuelleseite\\\">\".$i.\"</td>\\n\";\n } else {\n $seitenlink .= \"\\t<td class=\\\"pl\\\"><a href=\\\"\".$url.'='.$i.\"\\\">$i</a></td>\\n\";\n }\n }\n\n //if ($letzte < $gesamtseiten) {\n $nextbl = $aktuelle_seite < $letzte ? $aktuelle_seite + 1 : $letzte;\n $nohref = $aktuelle_seite == $letzte ? 'no' : '';\n $seitenlink .= \"\\t<td class=\\\"pl\\\"><a \".$nohref.'href=\"'.$url.'='.$nextbl.\"\\\" title=\\\"Eine Seite weiter\\\">»</a></td>\\n\\t<td class=\\\"pl\\\"><a \".$nohref.'href=\"'.$url.'='.$gesamtseiten.'\" title=\"Letzte Seite aufrufen\">» »</a></td>';\n //}\n\n if ($show_pageinfo == 1) {\n $pageinfo = \"\\t<td class=\\\"seiteninfo\\\">Seite: \".$aktuelle_seite.' von '.$gesamtseiten.\"</td>\\n\";\n } else {\n $pageinfo = '';\n }\n\n $navigationslinks = \"\\n<table cellspacing=\\\"1\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" class=\\\"sitenav\\\">\\n<tr>\".$pageinfo.$seitenlink.\"</tr>\\n</table>\\n\";\n }\n\n return $navigationslinks;\n}",
"function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}",
"function newhaven_preprocess_date_views_pager(&$vars) {\r\n ctools_add_css('date_views', 'date_views');\r\n $plugin = $vars['plugin'];\r\n $input = $vars['input'];\r\n $view = $plugin->view;\r\n\r\n $vars['nav_title'] = '';\r\n $vars['next_url'] = '';\r\n $vars['prev_url'] = '';\r\n\r\n if (empty($view->date_info) || empty($view->date_info->min_date)) {\r\n return;\r\n }\r\n $date_info = $view->date_info;\r\n // Make sure we have some sort of granularity.\r\n $granularity = !empty($date_info->granularity) ? $date_info->granularity : 'month';\r\n $pos = $date_info->date_arg_pos;\r\n if (!empty($input)) {\r\n $id = $plugin->options['date_id'];\r\n if (array_key_exists($id, $input) && !empty($input[$id])) {\r\n $view->args[$pos] = $input[$id];\r\n }\r\n }\r\n\r\n $next_args = $view->args;\r\n $prev_args = $view->args;\r\n $min_date = $date_info->min_date;\r\n $max_date = $date_info->max_date;\r\n\r\n // Set up the pager link format. Setting the block identifier\r\n // will force pager style links.\r\n if ((isset($date_info->date_pager_format) && $date_info->date_pager_format != 'clean') || !empty($date_info->mini)) {\r\n if (empty($date_info->block_identifier)) {\r\n $date_info->block_identifier = $date_info->pager_id;\r\n }\r\n }\r\n\r\n if (empty($date_info->hide_nav)) {\r\n $prev_date = clone($min_date);\r\n date_modify($prev_date, '-1 ' . $granularity);\r\n $next_date = clone($min_date);\r\n date_modify($next_date, '+1 ' . $granularity);\r\n $format = array('year' => 'Y', 'month' => 'Y-m', 'day' => 'Y-m-d');\r\n switch ($granularity) {\r\n case 'week':\r\n $next_week = date_week(date_format($next_date, 'Y-m-d'));\r\n $prev_week = date_week(date_format($prev_date, 'Y-m-d'));\r\n $next_arg = date_format($next_date, 'Y-\\W') . date_pad($next_week);\r\n $prev_arg = date_format($prev_date, 'Y-\\W') . date_pad($prev_week);\r\n break;\r\n default:\r\n $next_arg = date_format($next_date, $format[$granularity]);\r\n $prev_arg = date_format($prev_date, $format[$granularity]);\r\n }\r\n $next_path = str_replace($date_info->date_arg, $next_arg, $date_info->url);\r\n $prev_path = str_replace($date_info->date_arg, $prev_arg, $date_info->url);\r\n $next_args[$pos] = $next_arg;\r\n $prev_args[$pos] = $prev_arg;\r\n $vars['next_url'] = date_pager_url($view, NULL, $next_arg);\r\n $vars['prev_url'] = date_pager_url($view, NULL, $prev_arg);\r\n $vars['next_options'] = $vars['prev_options'] = array();\r\n } else {\r\n $next_path = '';\r\n $prev_path = '';\r\n $vars['next_url'] = '';\r\n $vars['prev_url'] = '';\r\n $vars['next_options'] = $vars['prev_options'] = array();\r\n }\r\n\r\n // Check whether navigation links would point to\r\n // a date outside the allowed range.\r\n if (!empty($next_date) && !empty($vars['next_url']) && date_format($next_date, 'Y') > $date_info->limit[1]) {\r\n $vars['next_url'] = '';\r\n }\r\n if (!empty($prev_date) && !empty($vars['prev_url']) && date_format($prev_date, 'Y') < $date_info->limit[0]) {\r\n $vars['prev_url'] = '';\r\n }\r\n $vars['prev_options'] += array('attributes' => array());\r\n $vars['next_options'] += array('attributes' => array());\r\n $prev_title = '';\r\n $next_title = '';\r\n\r\n // Build next/prev link titles.\r\n switch ($granularity) {\r\n case 'year':\r\n $prev_title = t('Navigate to previous year');\r\n $next_title = t('Navigate to next year');\r\n break;\r\n case 'month':\r\n $prev_title = t('Navigate to previous month');\r\n $next_title = t('Navigate to next month');\r\n break;\r\n case 'week':\r\n $prev_title = t('Navigate to previous week');\r\n $next_title = t('Navigate to next week');\r\n break;\r\n case 'day':\r\n $prev_title = t('Navigate to previous day');\r\n $next_title = t('Navigate to next day');\r\n break;\r\n }\r\n $vars['prev_options']['attributes'] += array('title' => $prev_title);\r\n $vars['next_options']['attributes'] += array('title' => $next_title);\r\n\r\n // Add nofollow for next/prev links.\r\n $vars['prev_options']['attributes'] += array('rel' => 'nofollow');\r\n $vars['next_options']['attributes'] += array('rel' => 'nofollow');\r\n\r\n // Need this so we can use '«' or images in the links.\r\n $vars['prev_options'] += array('html' => TRUE);\r\n $vars['next_options'] += array('html' => TRUE);\r\n\r\n $link = FALSE;\r\n // Month navigation titles are used as links in the block view.\r\n if (!empty($date_info->mini) && $granularity == 'month') {\r\n $link = TRUE;\r\n }\r\n $params = array(\r\n 'granularity' => $granularity,\r\n 'view' => $view,\r\n 'link' => $link,\r\n );\r\n $nav_title = theme('date_nav_title', $params);\r\n $vars['nav_title'] = $nav_title;\r\n $vars['mini'] = false; //!empty($date_info->mini);\r\n // Get the date information from the view.\r\n $date_info = $view->date_info;\r\n\r\n // Choose the dislpay format of the month name.\r\n $format = 'F';\r\n\r\n // Curent month\r\n $dateString = $date_info->min_date;\r\n $cur_month = new DateTime($dateString);\r\n $cur_month_pager_title = format_date($cur_month->getTimestamp(), 'custom', $format . ' Y');\r\n $vars['cur_month'] = $cur_month_pager_title;\r\n\r\n // Get the previous month.\r\n $dateString = $date_info->min_date;\r\n $prev_month = new DateTime($dateString);\r\n $prev_month->modify('-1 month');\r\n $prev_pager_title = format_date($prev_month->getTimestamp(), 'custom', $format);\r\n $vars['prev_title'] = $prev_pager_title;\r\n\r\n // Get the next month.\r\n $next_month = new DateTime($dateString);\r\n $next_month->modify('+1 month');\r\n $next_pager_title = format_date($next_month->getTimestamp(), 'custom', $format);\r\n $vars['next_title'] = $next_pager_title;\r\n}",
"function render($input) {\n $pager_theme = views_theme_functions('views_mini_pager', $this->view, $this->display);\n // The 1, 3 index are correct.\n // @see theme_pager().\n $tags = array(\n 1 => $this->options['tags']['previous'],\n 3 => $this->options['tags']['next'],\n );\n return theme($pager_theme, array(\n 'tags' => $tags,\n 'element' => $this->get_pager_id(),\n 'parameters' => $input,\n ));\n }",
"function pagination_title($start_1, $per_page, $total)\n{\n if ($total == 0)\n {\n return \"\";\n }\n $data = array();\n $data['first'] = $start_1 + 1;\n $data['last'] = min ($total, $start_1+$per_page);\n $data['total'] = $total;\n $CI = &get_instance();\n $rv = $CI->load->view(\"admin/common/pagination_title\", $data, true);\n return $rv;\n}",
"function viewPaging ($page, $tot, $rowsPerPage, $footer = '') {\n\n\t$pageTot = intval(intval($tot) / $rowsPerPage);\n\tif ($tot % $rowsPerPage > 0) $pageTot++;\n\n\tif ($pageTot > 1) :\n\n\t\t?>\n<div class=\"<?php if ($footer!='') echo 'paging-footer'; else echo 'paging'; ?>\">\n\t\t<?php\n\n\t\tif (isset($_REQUEST['page']) && is_numeric($_REQUEST['page']) && $_REQUEST['page'] > 0)\n\t\t\t$pageNum = cleanString(intval($_REQUEST['page']));\n\t\telse\n\t\t\t$pageNum = 1;\n\n\t\t$urlVars = '';\n\t\tif (isset($_REQUEST['order']) || isset($_REQUEST['dir'])) :\n\t\t\tif (isset($_REQUEST['order']))\n\t\t\t\t$urlVars .= 'order=' . cleanString($_REQUEST['order']) . '&';\n\t\t\tif (isset($_REQUEST['dir']))\n\t\t\t\t$urlVars .= 'dir=' . cleanString($_REQUEST['dir']) . '&';\n\t\tendif;\n\n\t\tfor ($i = 1; $i <= $pageTot; $i++) :\n\t\t\techo '<a href=\"' . $page . '.php?page=' . $i . '&' . $urlVars . '\" title=\"Pagina ' . $i . '\">';\n\t\t\tif ($i == $pageNum)\n\t\t\t\techo '<strong>' . $i . '</strong>';\n\t\t\telse\n\t\t\t\techo $i;\n\t\t\techo '</a>';\n\t\t\tif ($i < $pageTot)\n\t\t\t\techo ' | ';\n\t\tendfor;\n\n\t\t?>\n</div>\n\t\t<?php\n\n\tendif;\n\n}",
"function livingstone_theme_nodequeue_pager($vars) {\n $pager = getPager($vars['sqid'], $vars['wrap']);\n\n $prev = FALSE;\n $next = FALSE;\n\n switch ($vars['links']) {\n case 0:\n $prev = _getPagerPrevious($pager, $vars['nid']);\n break;\n\n case 1:\n $next = _getPagerNext($pager, $vars['nid']);\n break;\n\n default:\n $prev = _getPagerPrevious($pager, $vars['nid']);\n $next = _getPagerNext($pager, $vars['nid']);\n break;\n }\n\n $render = array();\n\n if ($prev) {\n $render[] = array(\n '#type' => 'link',\n '#title' => ' ',\n '#href' => 'node/'. $prev,\n '#options' => array(\n 'attributes' => array(\n 'title' => t('Previous page in section'),\n ),\n 'html' => TRUE,\n )\n );\n }\n if ($next) {\n $render[] = array(\n '#type' => 'link',\n '#title' => ' ',\n '#href' => 'node/'. $next,\n '#options' => array(\n 'attributes' => array(\n 'title' => t('Next page in section'),\n ),\n 'html' => TRUE,\n )\n );\n }\n return $render;\n}",
"public function testPager() {\n $view = Views::getView('test_view');\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'counter' => [\n 'id' => 'counter',\n 'table' => 'views',\n 'field' => 'counter',\n 'relationship' => 'none',\n ],\n 'name' => [\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'field' => 'name',\n 'relationship' => 'none',\n ],\n ]);\n $view->displayHandlers->get('default')->setOption('pager', [\n 'type' => 'mini',\n 'options' => ['items_per_page' => 1],\n ]);\n\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals('1', $counter);\n $view->destroy();\n\n // Go to the second page.\n $view->setCurrentPage(1);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals('2', $counter);\n $view->destroy();\n\n // Go to the third page.\n $view->setCurrentPage(2);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals('3', $counter);\n\n $view->destroy();\n\n // Test using the counter start option.\n $counter_start = 1000000;\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'counter' => [\n 'id' => 'counter',\n 'table' => 'views',\n 'field' => 'counter',\n 'relationship' => 'none',\n 'counter_start' => $counter_start,\n ],\n 'name' => [\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'field' => 'name',\n 'relationship' => 'none',\n ],\n ]);\n\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals($counter_start, $counter);\n $view->destroy();\n\n // Go to the second page.\n $view->setCurrentPage(1);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals($counter_start + 1, $counter);\n $view->destroy();\n\n // Go to the third page.\n $view->setCurrentPage(2);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals($counter_start + 2, $counter);\n }",
"function smarty_function_topicpager($params, &$smarty)\n{\n extract($params);\n\tunset($params);\n\n if(!isset($total) | empty($total) || !isset($topic_id) || empty($topic_id)) {\n\t\t$smarty->trigger_error(pnVarPrepForDisplay(_MODARGSERROR));\n\t}\n\n if(!isset($separator) || empty($separator)) {\n\t\t$separator = \"|\";\n\t}\n\n\tif(isset($linkclass) && !empty($linkclass)) {\n\t $linkclass = 'class=\"' . $linkclass . '\"';\n\t}\n\n $posts_per_page = pnModGetVar('pnForum', 'posts_per_page');\n $pager = \"\";\n if($total > $posts_per_page) {\n //$start = (!empty($start)) ? (int)$start : 0;\n $start = (int)$start;\n $times = 1;\n if(isset($class)&& !empty($class)) {\n $pager = '<div class=\"' . $class . '\">';\n } else {\n $pager = '<div>';\n }\n $pager .= pnVarPrepForDisplay(_PNFORUM_GOTOPAGE).\" : \";\n $last_page = $start - $posts_per_page;\n if(($start > 0) && empty($nonextprev) ) {\n $pager .= \"<a $linkclass href=\\\"\" . pnVarPrepForDisplay(pnModURL('pnForum', 'user', 'viewtopic', array('topic' => $topic_id, 'start' => $last_page))) . \"\\\" title=\\\"\" . pnVarPrepForDisplay(_PNFORUM_PREVPAGE) . \"\\\">\".pnVarPrepForDisplay(_PNFORUM_PREVPAGE).'</a> ';\n }\n for($x = 0; $x < $total; $x += $posts_per_page) {\n if($times != 1) {\n $pager .= \" $separator \";\n }\n if($start == -1) {\n // show all pages - no starting page\n $pager .= \"<a $linkclass href=\\\"\" . pnVarPrepForDisplay(pnModURL('pnForum', 'user', 'viewtopic', array('topic' => $topic_id, 'start' => $x))) . \"\\\" title=\\\"\" . pnVarPrepForDisplay(_PNFORUM_GOTOPAGE) . \" $times\\\">$times</a>\";\n } else {\n if($start && ($start == $x)) {\n $pager .= $times;\n } else if($start == 0 && $x == 0) {\n $pager .= \"1\";\n } else {\n $pager .= \"<a $linkclass href=\\\"\" . pnVarPrepForDisplay(pnModURL('pnForum', 'user', 'viewtopic', array('topic' => $topic_id, 'start' => $x))) . \"\\\" title=\\\"\" . pnVarPrepForDisplay(_PNFORUM_GOTOPAGE) . \" $times\\\">$times</a>\";\n }\n }\n $times++;\n }\n\n if( (($start + $posts_per_page) < $total) && empty($nonextprev) ) {\n $next_page = $start + $posts_per_page;\n $pager .= \" <a $linkclass href=\\\"\" . pnVarPrepForDisplay(pnModURL('pnForum', 'user', 'viewtopic', array('topic' => $topic_id, 'start' => $next_page))) . \"\\\" title=\\\"\" . pnVarPrepForDisplay(_PNFORUM_NEXTPAGE) . \"\\\">\".pnVarPrepForDisplay(_PNFORUM_NEXTPAGE).'</a>';\n }\n $pager .= \" </div>\\n\";\n }\n return $pager;\n}",
"function theme_quiz_pager($variables) {\n $total = $variables['total'];\n $current = $variables['current'];\n $siblings = $variables['siblings'];\n $items = array();\n $nid = arg(1);\n $items[] = array(\n 'class' => array('pager-first'),\n 'data' => l(t('first'), \"node/$nid/take/1\"),\n );\n foreach (_quiz_pagination_helper($total, 1, $current, $siblings) as $i) {\n if ($i == $current) {\n $items[] = array(\n 'class' => array('pager-current'),\n 'data' => $i,\n );\n }\n else {\n $items[] = array(\n 'class' => array('pager-item'),\n 'data' => l($i, \"node/$nid/take/$i\"),\n );\n }\n }\n $items[] = array(\n 'class' => array('pager-last'),\n 'data' => l(t('last'), \"node/$nid/take/$total\"),\n );\n return theme('item_list', array('items' => $items, 'attributes' => array('class' => array('pager'))));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of desconto_unitario. | public function getDescontoUnitario()
{
return $this->desconto_unitario;
} | [
"public function getValorUnitario()\n {\n return $this->valor_unitario;\n }",
"public function getCostoUnitario()\n {\n return $this->costoUnitario;\n }",
"public function getValorunitario()\n {\n return $this->valorunitario;\n }",
"public function getDescuentoMonto()\n {\n return $this->descuentoMonto;\n }",
"public function getValordesconto()\n {\n return $this->valordesconto;\n }",
"public function getUltimo_costo()\n {\n return $this->ultimo_costo;\n }",
"public function getVlUnitario()\n {\n return $this->vl_unitario;\n }",
"public function getApellido_benef_otro()\r\n\t{\r\n\t\treturn($this->apellido_benef_otro);\r\n\t}",
"public function getUomdesc()\n {\n return $this->uomdesc;\n }",
"public function getUmisteni()\n {\n return $this->umisteni;\n }",
"public function getUnidad()\r\n {\r\n return $this->Unidad;\r\n }",
"public function getTipoDesconto()\n {\n return $this->tipo_desconto;\n }",
"public function getUnidade()\n {\n return $this->unidade;\n }",
"public function getDescMunicipio()\n {\n return $this->descMunicipio;\n }",
"public function getDataUltimoacesso()\n {\n return $this->data_ultimoacesso;\n }",
"public function getDescricao () {\n\t\treturn $this->gu_descricao;\n\t}",
"public function getUsoBanco()\r\n {\r\n return $this->usoBanco;\r\n }",
"public function getPrecioUnitarioProducto(){\n return $this->precioUnitarioProducto;\n }",
"public function getMonto()\n {\n return $this->monto;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return testimonial by position | public function getTestimonialByPosition($position = null)
{
return $this->testimonialRepository->findOneBy(
array(
'position' => $position,
)
);
} | [
"public function getAllTestimonials()\n {\n return $this->testimonialRepository->findBy(\n array(),\n array(\n 'position' => 'ASC',\n )\n );\n }",
"public function getTestimonial()\n {\n return $this->testimonial;\n }",
"public function getTestimonials(){\n\t\t\n\t $sql=\"SELECT tst.*,res.restaurant_name\n\t\t\t FROM \".TESTIMONIALS.\" as tst\t\n\t\t\t join \t\".RESTAURANT.\" as res on res.id=tst.Restaurant_List \n\t\t\t order by tst.id desc\";\t \n\t\t$query = $this->db->query($sql);\n\t\treturn $query->result_array();\n\t}",
"public function testimonial(){\n\n $page = 'testimonial';\n $this->index($page);\n }",
"function testimonial() {\n\n $data['page_title'] = \"Testimonial\";\n\n $data['pages'] = $this->pages_model->get_Allpage('testimonials', 'status', 'Publish');\n \n// if ($link == 'content') {\n// $data['current'] = 7;\n// } else {\n// $data['current'] = 8;\n// }\n $data['current'] = 13;\n //$data['sub_current'] = 2;\n\n $this->template->load('template', 'testimonial_list', $data);\n }",
"public function getTestimonial($param);",
"function get_random_testimonials() { \n $testimonials = array();\n\n $query = db_select(\"field_data_field_lp_testimonial_items\",\"d\");\n $query->addField('d', 'field_lp_testimonial_items_value', 'value');\n $query->range(0, 3);\n $query->orderRandom();\n $result = $query->execute();\n \n while ($record = $result->fetchAssoc()) {\n $fc = entity_load('field_collection_item', array($record['value']));\n $fc = $fc[$record['value']];\n $imageInfo = get_obj_field_img_info($fc, 'field_testimonial_credit_image');\n \n $testimonials[] = array(\n 'content' => get_obj_field_value($fc, 'field_testimonial_content'),\n 'creditText' => get_obj_field_value($fc, 'field_testimonial_credit_text'),\n 'creditImageUrl' => $imageInfo['url'],\n 'creditImageAlt' => $imageInfo['alt'],\n 'creditImageTitle' => $imageInfo['title'],\n );\n }\n \n return $testimonials;\n}",
"public function get_show_testimonial(){\n\t\t$data_testimonial = \"SELECT * FROM tbl_testimonial ORDER BY id_testimonial ASC\";\n\t\t$hasil_testimonial = $this->mysqli->query($data_testimonial);\n\t\twhile($row_testimonial=mysqli_fetch_array($hasil_testimonial)){\n\t\t\t$result_testimonial[] = $row_testimonial;\n\t\t}\n\t\treturn $result_testimonial;\n\t\t}",
"function select_testimonials ($num,$offset = 0,$srchTestimonial = '') {\r\n\t\t$this->db->select (\"*\");\r\n\t\t$this->db->from('adhi_testimonials');\r\n\t\t$this->db->limit($num,$offset);\r\n\t if('' != $srchTestimonial)\r\n\t $this->db->like('testimonial_name',$srchTestimonial,'both');\r\n\t $this->db->orderby('id','DESC');\r\n\t\t$query\t=\t$this->db->get();\r\n\t\treturn($query->result());\r\n\t}",
"public function getTestimonial($testimonial_id)\r\n\t{\r\n\t\t$query = $this->db->query(\"SELECT DISTINCT * FROM \" . DB_PREFIX . \"testimonial c LEFT JOIN \" . DB_PREFIX . \"testimonial_description cd2 ON (c.testimonial_id = cd2.testimonial_id) WHERE c.testimonial_id = '\" . (int) $testimonial_id . \"' AND cd2.language_id = '\" . (int) $this->config->get('config_language_id') . \"'\");\r\n\t\treturn $query->row;\r\n\t}",
"function view_testimonial (){\r\n\t\t\t$this->gen_contents['page_title']\t=\t'Testimonial';\r\n\t\t\t$this->_testimonial($this->uri->segment(3));\r\n\t\t\t\r\n\t\t\t$this->_template('view_testimonial',$this->gen_contents);\r\n\t\t}",
"function do_random_testimonial( $view = '' ) {\n\t$div_class = apply_filters( 'random_testimonial_div_class', 'random-testimonial' );\n\n\t// Check for customizer, if not do fall back.\n\t$title = get_theme_mod( 'nd_random_testimonial_title' );\n\n\tif ( empty ( $title ) ) {\n\t\t$title_text = apply_filters( 'random_testimonial_title', 'What customers say about us' );\n\t\t$heading_class = apply_filters( 'random_testimonial_heading_class', 'random--testimonial__title' );\n\t\t$heading_tag = apply_filters( 'random_testimonial_heading_tag', 'h2' );\n\n\t\t$title = \"<{$heading_tag} class=\\\"{$heading_class}\\\">{$title_text}</{$heading_tag}>\";\n\t}\n\n\t$args = array(\n\t\t'post_type' => 'testimonial',\n\t\t'posts_per_page' => 50,\n\t\t'tax_query' => array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'testimonial-type',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => 'staff',\n\t\t\t\t'operator' => 'NOT IN'\n\t\t\t),\n\t\t),\n\t);\n\n\t$query = new WP_Query( $args );\n\n\tif ( ! $query ) {\n\t\treturn;\n\t}\n\n\t$testimonials = array();\n\n\tif ( $query->have_posts() ) :\n\t\twhile ( $query->have_posts() ) : $query->the_post();\n\t\t\t$testimonials[] = array(\n\t\t\t\t'name' => get_the_title(),\n\t\t\t\t'byline' => get_post_meta( get_the_ID(), '_rt_byline', true ),\n\t\t\t\t'content' => wpautop( addslashes( htmlspecialchars( get_the_content(), ENT_QUOTES | ENT_SUBSTITUTE ) ) ),\n\t\t\t\t'image_url' => wp_get_attachment_image_url( get_post_thumbnail_id( get_the_ID() ), 'full' ),\n\t\t\t);\n\t\tendwhile;\n\tendif;\n\n\twp_reset_postdata();\n\n $testimonials = wp_json_encode( $testimonials, JSON_HEX_APOS | JSON_HEX_QUOT | ENT_QUOTES );\n\n\tif ( empty( $view ) ) {\n\t\tinclude RANDOM_TESTIMONIAL_DIR . 'views/random-testimonial.php';\n\t} else {\n\t\tinclude $view;\n\t}\n}",
"public function testimonials()\r\n {\r\n return $this->hasMany('Acme\\models\\Testimonial');\r\n }",
"function aa_testimonial_random( $case_studies_page_id = null, )\n{\n\t$query = new WP_Query( array(\t\n\t\t\t\t\t\t'post_type' \t\t=> 'testimonial',\n\t\t\t\t\t\t'posts_per_page' \t=> 1,\n\t\t\t\t\t\t'post_status'\t\t=> 'publish',\n\t\t\t\t\t\t'orderby'\t\t\t=> 'rand',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t array(\n\t\t\t\t\t\t 'key' => 'aa_testimonial_quote',\n\t\t\t\t\t\t 'value' => array(''),\n\t\t\t\t\t\t 'compare' => 'NOT IN'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\tif( !$case_studies_page_id ){\n\t\t$case_studies_page_id = 1; // \n\t}\n\twhile( $query->have_posts()): $query->the_post(); \n\t\t$testimonial = new AATestimonial( get_the_ID() );\n\t?>\n\n\t\t<div class=\"secondary-callout aa-testimonial-random\">\n\t\t\t<div class=\"aa-testimonial-random-quote\">\n\t\t\t\t<blockquote>\n\t\t\t\t\t<?php echo $testimonial->getTestimonialQuote(); ?>\n\t\t\t\t</blockquote>\n\t\t\t\t<small>\n\t\t\t\t\t<?php if( $testimonial->getTestimonialName()): ?>\n\t\t\t\t\t\t<span class=\"testimonial-author\">\n\t\t\t\t\t\t\t<?php if( $testimonial->getTestimonialLinkedIn()): ?>\n\t\t\t\t\t\t\t\t\t<a href=\"<?php echo $testimonial->getTestimonialLinkedIn(); ?>\" title=\"LinkedIn Profile\" rel=\"nofollow\"><?php echo $testimonial->getTestimonialName(); ?></a>\n\t\t\t\t\t\t\t<?php else: ?>\n\t\t\t\t\t\t\t\t\t<?php echo $testimonial->getTestimonialName(); ?>\n\t\t\t\t\t\t\t<?php endif; ?></span>, \n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php if( $testimonial->getTestimonialJob()): ?>\n\t\t\t\t\t\t<span class=\"testimonial-job-title\"><?php echo $testimonial->getTestimonialJob(); ?></span>, \n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<strong>\n\t\t\t\t\t\t<?php the_title(); ?>\n\t\t\t\t\t</strong>\n\t\t\t\t</small>\n\t\t\t</div>\n\t\t\t<?php if( $case_studies_page_id ): ?>\n\t\t\t\t<div class=\"callout-button\">\n\t <a class=\"btn btn-primary btn-large\" href=\"<?php echo get_permalink( $case_studies_page_id ); // Case Studies ?>\">\n\t View Testimonials »\n\t </a>\n\t </div>\n\t <?php endif; ?>\n\t\t</div>\n\n\t<?php\n\tendwhile;\n}",
"function testimonial_lists(){\n\t\t$lang\t\t\t=\tApp::getLocale();\n\t\t$testimonials\t=\tDB::select( DB::raw(\"SELECT *,(SELECT image FROM testimonials WHERE id = testimonial_descriptions.parent_id) as image FROM testimonial_descriptions WHERE parent_id IN (select id from testimonials where is_active = 1) AND language_id = (select id from languages WHERE languages.lang_code = '$lang')\"));\n\t\t\n\t\treturn $testimonials;\n\t}",
"public function getLatestTestimonial() {\r\n\t\t$db = new Database;\r\n\t\t$testimonial = $db->query('SELECT * FROM testimonials ORDER BY id DESC LIMIT 1');\r\n\t\treturn $testimonial[0]; \r\n\t}",
"function aa_testimonial_featured( $showFeaturedCount = 3 )\n{\n\t$query = new WP_Query(array(\n\t\t\t\t\t'post_type' \t\t=> 'testimonial', \n\t\t\t\t\t'nopaging' \t\t\t=> true, \n\t\t\t\t\t'post_status' \t\t=> 'publish',\n\t\t\t\t\t'posts_per_page' \t=> $showFeaturedCount,\n\t\t\t\t\t'meta_key'\t\t\t=> 'aa_testimonial_is_featured',\n\t\t\t\t\t'meta_value'\t\t=> '1'\n\t\t\t\t));\n\n\t?>\n\t<div class=\"aa-testimonial-featured\">\n\t\t<?php if( $query->have_posts()): ?>\n\t\t\t<ul>\n\t\t\t\t<?php while( $query->have_posts()): $query->the_post(); ?>\n\t\t\t\t\t<?php \n\t\t\t\t\t$testimonial = new AATestimonial( get_the_ID() );\n\t\t\t\t\techo '<li class=\"aa-testimonial-feature\">'; ?>\n\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t\t\t\t<h3 class=\"aa-testimonial-logo-holder\">\n\t\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t\tif( has_post_thumbnail()){\n\t\t\t\t\t\t\t\t\tthe_post_thumbnail( 'aa-testimonial-logo', $default_attr = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'alt'\t=> trim(strip_tags( get_the_title() )),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'title'\t=> trim(strip_tags( get_the_title() )),\n\t\t\t\t\t\t\t\t\t));\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<?php if( $testimonial->getTestimonialQuote()): ?>\n\t\t\t\t\t\t\t<blockquote class=\"aa-testimonial-quote\" cite=\"<?php the_permalink(); ?>\">\n\t\t\t\t\t\t\t\t<?php echo $testimonial->getTestimonialQuote(); ?>\n\t\t\t\t\t\t\t</blockquote>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<div class=\"aa-testimonial-attribution\">\n\t\t\t\t\t\t\t<div class=\"aa-testimonial-profile-img\">\n\t\t\t\t\t\t\t\t<?php if( $testimonial->getTestimonialProfileImage() ): ?>\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo $testimonial->getTestimonialProfileImage(); ?>\" alt=\"n\" class=\"img-circle\" />\n\t\t\t\t\t\t\t\t<?php else: ?>\n\t\t\t\t\t\t\t\t\t<img src=\"http://placehold.it/60x60\" class=\"img-circle\" />\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<small>\n\t\t\t\t\t\t\t\t<?php if( $testimonial->getTestimonialName()): ?>\n\t\t\t\t\t\t\t\t\t<span class=\"testimonial-author\">\n\t\t\t\t\t\t\t\t\t\t<?php if( $testimonial->getTestimonialLinkedIn()): ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo $testimonial->getTestimonialLinkedIn(); ?>\" title=\"LinkedIn Profile\" rel=\"nofollow\"><?php echo $testimonial->getTestimonialName(); ?></a>\n\t\t\t\t\t\t\t\t\t\t<?php else: ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo $testimonial->getTestimonialName(); ?>\n\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t</span>, \n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<?php if( $testimonial->getTestimonialJob()): ?>\n\t\t\t\t\t\t\t\t\t<span class=\"testimonial-job-title\"><?php echo $testimonial->getTestimonialJob(); ?></span>, \n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t<?php the_title(); ?>\n\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t</small>\n\t\t\t\t\t\t</div>\t\n\n\t\t\t\t\t<?php\n\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t?>\n\n\t\t\t\t<?php endwhile; ?>\n\t\t\t</ul>\n\t\t<?php endif; ?>\n\t</div>\n\t<?php\n}",
"public function getTestimonials0()\n {\n return $this->hasMany(Testimonial::className(), ['created_by_user_id' => 'id']);\n }",
"public function getTestimonial($fields_to_pass='',$condition_to_pass='',$order_by_to_pass='',$limit_to_pass='',$debug_to_pass = 0)\n\t{\n\t\t$this->getRecords(\n\t\t\"mst_testimonial\",\n\t\t$fields_to_pass,\n\t\t$condition_to_pass,\n\t\t$order_by_to_pass,\n\t\t$limit_to_pass,\n\t\t$debug_to_pass\n\t\t);\n\t\t$arr_to_return=array();\n\t\twhile($arrRow=$this->getRow())\n\t\t{\n\t\t\t$arr_to_return[]=$arrRow;\n\t\t}\n\t\treturn $arr_to_return;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply a boolean attribute | private function apply_boolean_attribute( $atts, $key ) {
if ( isset( $atts[ $key ] ) ) {
$this->{$key} = ( $atts[ $key ] ) ? true : false;
}
} | [
"public function getBoolean( $attr );",
"public function getBoolean( Inx_Api_Recipient_Attribute $oAttr );",
"public function shortcode_atts_boolean( $att ) {\n\n if ( $att === 'true' || absint( $att ) ) {\n $att_val = 1;\n } else {\n $att_val = 0;\n }\n\n return $att_val;\n }",
"public function boolAttr($attr)\n {\n $v = (string)$this[$attr];\n return in_array(strtolower($v), ['1', 'true']);\n }",
"abstract protected function mustApplyRuleOnAttribute(): bool;",
"function isAttrBoolean($attr_name) {\n\t\tif (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t$type = ($sattr = $this->getSchemaAttribute($attr_name)) ? $sattr->getType() : null;\n\n\t\tif (! strcasecmp('boolean',$type) ||\n\t\t\t! strcasecmp('isCriticalSystemObject',$attr_name) ||\n\t\t\t! strcasecmp('showInAdvancedViewOnly',$attr_name))\n\t\t\treturn true;\n\n\t\telse\n\t\t\treturn false;\n\t}",
"protected function _setBoolean($name, $value) {}",
"public function bool()\n {\n return $this->addRule(new FilterRule\\CastBool);\n }",
"protected function setBool(){\n $this->bool = array(\n\t 'true'=>1,\n\t 'false'=>0,\n\t 'yes'=>1,\n\t 'no'=>0,\n\t\t'on'=>1,\n\t\t'off'=>0,\n\t);\n }",
"function configUseAttributes($bool) {\r\n\t\t$this->use_attributes = $bool;\r\n\t}",
"public function testGetOpenTagWhenElementHasOneBooleanAttribute() : void\r\n {\r\n $fake = $this->getFake();\r\n \r\n $fake->setAttributes([\r\n 'disabled' => null\r\n ]);\r\n \r\n $this->assertEquals(\r\n '<' . $fake->getTagName() . ' disabled>',\r\n $fake->getOpenTag()\r\n );\r\n }",
"protected function transformBool(): void\n {\n $this->transformToBool('bool');\n }",
"public function attributeProperty(string $attribute): bool;",
"protected static function rule_boolean($object, $field, $param = array())\n\t{\n\t\t$object->{$field} = (bool) $object->{$field};\n\t}",
"private function _Convert_To_Boolean(){\n\t\tif(property_exists($this, \"_INTERNAL_CONVERT_TO_BOOLEAN\") && isset($this->_INTERNAL_CONVERT_TO_BOOLEAN) && is_array($this->_INTERNAL_CONVERT_TO_BOOLEAN)){\n\t\t\tforeach ($this->_INTERNAL_CONVERT_TO_BOOLEAN as $Key => $Property) {\n\t\t\t\tif(property_exists($this, $Property)){\n\t\t\t\t\tif(is_array($this->{$Property})){\t\n\t\t\t\t\t\tforeach ($this->{$Property} as $Key => $Value) {\n\t\t\t\t\t\t\tif(is_integer($Value) || is_string($this->{$Property})){\n\t\t\t\t\t\t\t\tif($Value === 1 || $this->{$Property} === \"1\"){\n\t\t\t\t\t\t\t\t\t$this->{$Property}[$Key] = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->{$Property}[$Key] = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if(is_null($this->{$Property})){\n\t\t\t\t\t\t\t\t$this->{$Property} = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(is_integer($this->{$Property}) || is_string($this->{$Property})){\n\t\t\t\t\t\tif($this->{$Property} === 1 || $this->{$Property} === \"1\"){\n\t\t\t\t\t\t\t$this->{$Property} = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->{$Property} = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(is_null($this->{$Property})){\n\t\t\t\t\t\t$this->{$Property} = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function getIsActiveAttribute()\n {\n return $this->confirmed && $this->approved;\n }",
"abstract public function has_attributes(): bool;",
"protected function prepareBooleanAttributeValue($attribute, $value) {\n\t\tif (! is_bool ( $value ) && in_array ( $value, $this->booleanAttributes [$attribute] )) {\n\t\t\treturn $value;\n\t\t}\n\t\t\n\t\t$value = ( bool ) $value;\n\t\treturn ($value ? $this->booleanAttributes [$attribute] ['on'] : $this->booleanAttributes [$attribute] ['off']);\n\t}",
"public function toBoolean(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Apply Brightness filter to the image | function effectBrightness($val){
if($this->useGdFilters){
if($this->_isReady())
return imagefilter($this->_imgHandler, IMG_FILTER_BRIGHTNESS,$val);
else
return false;
}
else return $this->_setError('Image filters is not available on PHP4');
} | [
"private function applyFilters() {\n if ($this->sharpen) {\n $this->image = $this->sharpenImage($this->image);\n }\n if ($this->grayscale) {\n $this->image = $this->applyGrayscale($this->image);\n }\n if ($this->sepia) {\n $this->image = $this->applySepia($this->image);\n }\n }",
"public function modulateImage ($brightness, $saturation, $hue) {}",
"public function apply($resource){\n\t\tif(!function_exists('imagefilter')){\n\t\t\tthrow new Exception(\"It seems your PHP version is not compiled with the bundled version of the GD library\");\n\t\t}\n\t\t// Format\n\t\t@list(,$level)=func_get_args();\n\t\t$level=(int)$level;\n\t\tif($level<-255) $level=-255;\n\t\tif($level>255) $level=255;\n\t\t// Apply effect\n\t\tif(!imagefilter($resource,IMG_FILTER_BRIGHTNESS,$level)){\n\t\t\tthrow new Exception(\"BRIGHTNESS filter failed\");\n\t\t}\n\t\treturn $resource;\n\t}",
"function gd_filter_blur($im)\n{\n imagefilter($im, IMG_FILTER_SELECTIVE_BLUR);\n imagefilter($im, IMG_FILTER_GAUSSIAN_BLUR);\n imagefilter($im, IMG_FILTER_CONTRAST, -15);\n imagefilter($im, IMG_FILTER_SMOOTH, -2);\n return $im;\n}",
"public function addFilterBw()\n {\n $this->getGd()->addFilter(new GrayScale());\n }",
"public function applyFilter(Image $image)\n {\n $image->greyscale();\n $image->brightness(-10);\n $image->contrast(10);\n $image->colorize(38, 27, 12);\n $image->brightness(-10);\n $image->contrast(10);\n\n return $image;\n }",
"public function blur(){\n imagefilter($this->image, IMG_FILTER_SELECTIVE_BLUR);\n }",
"public function blureImage($src, $img_filter_gaussian_blur = [45, 999], $img_filter_smooth = [1, 99], $img_filter_brightness = [1, 10]){\n $image = imagecreatefromjpeg($src);\n for ($x=1; $x <= $img_filter_gaussian_blur[0]; $x++){\n imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR, $img_filter_gaussian_blur[1]);\n } \n for ($x=1; $x <= $img_filter_smooth[0]; $x++){\n imagefilter($image, IMG_FILTER_SMOOTH, $img_filter_smooth[1]);\n } \n for ($x=1; $x <= $img_filter_brightness[0]; $x++){\n imagefilter($image, IMG_FILTER_BRIGHTNESS, $img_filter_brightness[1]);\n }\n\n imagejpeg($image);\n // imagedestroy($image);\n }",
"public function brightnessContrastImage($brightness, $contrast, $channel){}",
"function effectGrayscale(){\n if($this->useGdFilters){\n if($this->_isReady())\n return imagefilter($this->_imgHandler, IMG_FILTER_GRAYSCALE);\n else\n return false;\n }else return $this->_setError('Image filters is not available on PHP4');\n}",
"function monochrome()\n {\n imagefilter($this->img, IMG_FILTER_GRAYSCALE);\n imagefilter($this->img, IMG_FILTER_CONTRAST, -255);\n }",
"public function gd_filter_blur($im){\r\n\t\timagefilter($im, IMG_FILTER_SELECTIVE_BLUR);\r\n\t\timagefilter($im, IMG_FILTER_GAUSSIAN_BLUR);\r\n\t\timagefilter($im, IMG_FILTER_CONTRAST, -15);\r\n\t\timagefilter($im, IMG_FILTER_SMOOTH, -2);\r\n\t\treturn $im;\r\n\t}",
"function adaptiveBlurImage($radius, $sigma, $channel){}",
"public function brightnessContrastImage ($brightness, $contrast, $CHANNEL = Imagick::CHANNEL_DEFAULT) { }",
"abstract public function applyFilter( $image, ezcImageFilter $filter );",
"public function blur() {\r\n\t\t$matrix = array(\r\n\t\t\tarray(1, 1, 1),\r\n\t\t\tarray(1, 16, 1),\r\n\t\t\tarray(1, 1, 1)\r\n\t\t);\r\n\t\t$this->convolution($matrix, array_sum(array_map('array_sum', $matrix)));\r\n\t}",
"public function selectiveBlurImage($radius, $sigma, $threshold, $channel){}",
"public function brighter() { }",
"public function sepia(){\n imagefilter($this->image, IMG_FILTER_GRAYSCALE);\n $this->colorize(100, 50);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
paginaBeheer retrieves all pages from the database so they can be shown in a table | public function paginaBeheer()
{
$pageQuery = "SELECT * FROM pages";
$data["pages"] = $this->model->getContent($pageQuery);
Load::view("paginaBeheer", $data);
} | [
"public function getPaginate() {\n /*\n * Iniciando valores.\n */\n $showPages = $this->_showPages;\n $pages = [];\n $pageItems = false;\n $transformer = $this->getTransformer();\n /*\n * Recuperando valores\n */\n $limit = $this->getLimit();\n $pageNumber = (int) $this->getCurrentPage();\n /*\n * Recuperando y clonando builders\n */\n $originalBuilder = $this->getBuilder();\n /**\n * We make a copy of the original builder to leave it as it is\n */\n $builder = clone($originalBuilder);\n /**\n * We make a copy of the original builder to count the total of records\n */\n $totalBuilder = clone($builder);\n $columns = $this->_columns;\n /*\n * Comprobando si el numero de pagina es menor que cero, se iguala a 1\n */\n if ($pageNumber <= 0) {\n $pageNumber = 1;\n }\n /*\n * Calculando numero de registro\n */\n $number = $limit * ($pageNumber - 1);\n /*\n * Estableciendo el limite evitando negativos\n */\n if ($number < $limit) {\n /*\n * establece el limite \n */\n $builder->limit($limit);\n } else {\n /*\n * Establece limite incio-final\n */\n $builder->limit($limit, $number);\n }\n /*\n * Obteniendo consulta\n */\n $query = $builder->getQuery();\n /*\n * Calculando numero de pagina anterior\n */\n if ($pageNumber == 1) {\n $before = 1;\n } else {\n $before = $pageNumber - 1;\n }\n /*\n * ejecutando la consulta\n */\n $pageItems = $query->execute();\n /*\n * Generando flags para having y groups\n */\n $hasHaving = !empty($totalBuilder->getHaving());\n $groups = $totalBuilder->getGroupBy();\n $hasGroup = !empty($groups);\n /**\n * Change the queried columns by a COUNT(*)\n */\n if ($hasHaving && !$hasGroup) {\n if (empty($columns)) {\n throw new Exception(\"When having is set there should be columns option provided for which calculate row count\");\n }\n $totalBuilder->columns($columns);\n } else {\n $totalBuilder->columns(\"COUNT(*) [rowcount]\");\n }\n /**\n * Change 'COUNT()' parameters, when the query contains 'GROUP BY'\n */\n if ($hasGroup) {\n /*\n * Si groups es un array se crea valor separado por comas\n */\n if (gettype($groups) == \"array\") {\n $groupColumn = implode(\", \", $groups);\n } else {\n $groupColumn = $groups;\n }\n /*\n * Sino existe clausula having\n */\n if (!$hasHaving) {\n $totalBuilder->groupBy(null)->columns([\"COUNT(DISTINCT \" . $groupColumn . \") AS [rowcount]\"]);\n } else {\n $totalBuilder->columns([\"DISTINCT \" . $groupColumn]);\n }\n }\n /**\n * Remove the 'ORDER BY' clause, PostgreSQL requires this\n */\n $totalBuilder->orderBy(null);\n\n /**\n * Obtain the PHQL for the total query\n */\n $totalQuery = $totalBuilder->getQuery();\n\n /**\n * Obtain the result of the total query\n * If we have having perform native count on temp table\n */\n if ($hasHaving) {\n $sql = $totalQuery->getSql();\n $modelClass = $builder->_models;\n\n if (gettype($modelClass) == \"array\") {\n $modelClass = array_values($modelClass)[0];\n }\n\n $model = new $modelClass();\n $dbService = $model->getReadConnectionService();\n $db = $totalBuilder->getDI()->get($dbService);\n $row = $db->fetchOne(\"SELECT COUNT(*) as \\\"rowcount\\\" FROM (\" . $sql[\"sql\"] . \") as T1\", Db::FETCH_ASSOC, $sql[\"bind\"]);\n $rowcount = $row ? intval($row[\"rowcount\"]) : 0;\n $totalPages = \\intval(\\ceil($rowcount / $limit));\n } else {\n $result = $totalQuery->execute();\n $row = $result->getFirst();\n $rowcount = $row ? \\intval($row->rowcount) : 0;\n $totalPages = \\intval(\\ceil($rowcount / $limit));\n }\n\n if ($pageNumber < $totalPages) {\n $next = $pageNumber + 1;\n } else {\n $next = $totalPages;\n }\n //Rango de Paginacion\n $range = (int) $showPages / 2;\n /*\n * Obteniendo rango derecho\n */\n $rightRange = $totalPages - $pageNumber;\n $rest = 0;\n /*\n * Si el rango derecho es menos que rango\n */\n if ($rightRange < $range) {\n /*\n * Residuo es la restade range y rangoderecho\n */\n $rest = $range - $rightRange;\n }\n /*\n * Obteniendo rango izquierdo\n */\n $leftRange = $pageNumber - ($range + $rest);\n /*\n * Generado paginas.\n * Iniciando en numero de paginas hasta rangoizquierdo\n */\n for ($i = $pageNumber; $i > $leftRange; $i--) {\n /*\n * Si la pagina es cero se detiene\n */\n if ($i == 0)\n break;\n /*\n * Almacena numero de paginas a la izquierda.\n */\n $pages[] = $i;\n }\n /*\n * Comprobando el numero de pagina es menor al rango para obtener\n * el rango de paginas a la derecha\n */\n if ($pageNumber < $range) {\n $rightRange = $showPages;\n } else {\n $rightRange = $pageNumber + $range;\n }\n /*\n * Generando paginas a la derecha.\n * Iniciando en la pagina actual hasta el rango derecho \n */\n for ($i = $pageNumber + 1; $i <= $rightRange; $i++) {\n /*\n * Si el contador rebasa el total de paginas se detiene\n */\n if ($i > $totalPages)\n break;\n /*\n * Almacenando numero de paginas a la derechas\n */\n $pages[] = $i;\n }\n /*\n * Ordenando paginas\n */\n \\sort($pages);\n /*\n * Creando clases estandar\n */\n $page = new \\stdClass();\n $page->items = $pageItems;\n $page->first = 1;\n $page->before = $before;\n $page->current = $this->getCurrentPage();\n $page->last = $totalPages;\n $page->next = $next;\n $page->totalPages = $totalPages;\n $page->totalItems = $rowcount;\n $page->limit = $this->getLimit();\n \n return $page;\n }",
"public function getPages();",
"public function paginate();",
"public function getAllPages()\n {\n $sql = \"SELECT * FROM pagedata\";\n $query = $this->db->prepare($sql);\n $query->executce();\n\n return $query->fetch();\n }",
"function pagination(){}",
"public function getAllPagination($page);",
"public function fetchAllPages()\n {\n return $this->page->all();\n }",
"public function do_paging()\n {\n }",
"public function admin_allPages() {\n $this->layout = 'admin';\n $this->set('PAGE_TITLE', 'Admin: CMS Pages');\n /*$pages = $this->CmsPage->find('all', array('fields' => array('CmsPage.id', 'CmsPage.title', 'CmsPage.status', 'CmsPage.created'))); //pr($pages);die;\n $this->set('pages_data', $pages);*/\n \n $this->Paginator->settings = array('limit' => 10,'fields' => array('CmsPage.id', 'CmsPage.title', 'CmsPage.status', 'CmsPage.created'),'conditions' => array('CmsPage.language' => 'EN'));\n\t\t$pages = $this->Paginator->paginate('CmsPage');\n\t\t$this->set('pages_data', $pages);\n \n }",
"function mostraPagina()\n\t\t{\n\t\t// costruiamo la tabella\n\t\t$tabella = $this->creaTabella();\n\t\t\t\n\t\t// prepara la pagina, ossia il contenitore della tabella\n\t\t$this->aggiungiElemento($this->dammiMenu());\n\t\t$this->aggiungiElemento(\"Tabella allievi\", \"titolo\");\n\t\t$this->aggiungiElemento($tabella);\n\t\t\n\t\t// manda in output l'intera pagina\n\t\t$this->mostra();\n\t\t}",
"public function getAllPages(): array;",
"public function getPagination();",
"function mostraPagina()\n\t\t{\n\t\t// costruiamo la tabella\n\t\t$tabella = $this->creaTabella();\n\t\t\t\n\t\t// prepara la pagina, ossia il contenitore della tabella\n\t\t$this->aggiungiElemento($this->dammiMenu());\n\t\t$this->aggiungiElemento(\"Tabella corsi\", \"titolo\");\n\t\t$this->aggiungiElemento($tabella);\n\t\t\n\t\t// manda in output l'intera pagina\n\t\t$this->mostra();\n\t\t}",
"public function query_pages(){\n $this->table = \"Website\";\n $this->select = \"SELECT * FROM $this->table ORDER BY page_name\";\n $this->result = mysql_query($this->select);\n if($this->result === FALSE){die(\"Error querying database.\");}\n while(($this->record = mysql_fetch_row($this->result)) !== FALSE){\n echo \"<tr><td>\".$this->record[1].\"</td><td>\".$this->record[2].\"</td><td>\".$this->record[3].\"</td></tr>\";\n }\n }",
"public function paginacionDatosPersonales(){\n $cant_reg = 10;//definimos la cantidad de datos que deseamos tenes por pagina.\n\n if(isset($_GET[\"pagina\"])){\n $num_pag = $_GET[\"pagina\"];//numero de la pagina\n }else{\n $num_pag = 1;\n }\n\n if(!$num_pag){//preguntamos si hay algun valor en $num_pag.\n $inicio = 0;\n $num_pag = 1;\n\n }else{//se activara si la variable $num_pag ha resivido un valor oasea se encuentra en la pagina 2 o ha si susecivamente \n $inicio = ($num_pag-1)*$cant_reg;//si la pagina seleccionada es la numero 2 entonces 2-1 es = 1 por 10 = 10 empiesa a contar desde la 10 para la pagina 2 ok.\n }\n\n $result = mysql_query(\"SELECT * FROM estudiantes\");///hacemos una consulta de todos los datos de cinternet\n \n $total_registros=mysql_num_rows($result);//obtenesmos el numero de datos que nos devuelve la consulta\n\n $total_paginas = ceil($total_registros/$cant_reg);\n\n echo '<div class=\"pagination\" style=\"display: none;\">\n ';\n if(($num_pag+1)<=$total_paginas){//preguntamos si el numero de la pagina es menor o = al total de paginas para que aparesca el siguiente\n \n echo \"<ul><li class='next'> <a href='actualizarDatos.php?pagina=\".($num_pag+1).\"'> Next </a></li></ul>\";\n } ;echo '\n </div>';\n }",
"public function getAllPages()\n {\n $this->app->db->connect();\n $sql = <<<EOD\nSELECT\n*,\nCASE\nWHEN (deleted <= NOW()) THEN \"isDeleted\"\nWHEN (published <= NOW()) THEN \"isPublished\"\nELSE \"notPublished\"\nEND AS status\nFROM content\nWHERE type=?\n;\nEOD;\n $res = $this->app->db->executeFetchAll($sql, [\"page\"]);\n return $res;\n }",
"public function fetchAllPages()\n {\n $results = $this->fetchAllAsArray(\n array(\n 'where' => array(\n 'content_type = ?' => array(2)\n ),\n 'order' => array (\n 'id DESC'\n ),\n 'eager' => array(\n 'comments' => array(\n 'eager' => array(\n 'commentinfo'\n )\n ),\n 'tags',\n 'postinfo',\n 'users',\n ),\n )\n );\n Foresmo::dateFilter($results);\n Foresmo::sanitize($results);\n return $results;\n }",
"private function getPages()\n\t{\n\t\tself::$pages = $this->getAllTree(array('id', 'url', 'path', 'publish'));\n\t}",
"public function pagesArticles(){\n\n $sql1 =\"SELECT COUNT(id) as nbArt FROM articles\";\n\n $query = $this->pdo-> prepare($sql1);\n $query->execute();\n\n $data = $query->fetch(PDO::FETCH_ASSOC);\n\n $nbArt = $data['nbArt'];\n $perPage = 5;\n $cPage =1;\n $nbPage = ceil($nbArt/$perPage);\n\n if(isset($_GET['p']) && $_GET['p']>0 && $_GET['p']<= $nbPage){\n\n $cPage = $_GET['p'];\n }\n else{\n $cPage =1;\n }\n\n $sql2 = \"SELECT * FROM `articles` WHERE `date` ORDER BY date DESC LIMIT \".(($cPage-1)*$perPage).\",$perPage\";\n\n $query = $this->pdo-> prepare($sql2);\n $query->execute();\n\n $article = $query->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($article as $articles) {\n\n $_GET['id'] = @$articles['id'];\n\n echo '<h2>' . ucfirst($articles['titre']) . '</h2>\n <p>' . substr($articles['article'], 0, 150) . '...</p>\n <a href=\"article.php?id=' . $_GET['id'] . '\"><i class=\"fas fa-arrow-right\"></i> Lire l\\'article en entier !</a>\n <p><u> Posté le : ' . $articles['date'] . '</u></p><hr><br>';\n }\n\n for($i=1; $i<=$nbPage; $i++){\n\n if($i==$cPage){\n echo \"<a class='nPagesA'>$i</a>\";\n }\n else{\n echo \" <a class='nPages' href=\\\"articles.php?p=$i\\\">$i</a> \";\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get single exam by exam ID | public function get_exam($exam_id)
{
$exam_id = (int)$exam_id;
// making sure that number of questions does not exceed
// the number of questions actually exists in the category
//$this->update_exam_category_no_of_question($exam_id);
if ($exam_id > 0) {
$this->db->where('id', $exam_id);
$query = $this->db->get($this->table_name);
//echo $this->db->last_query(); die();
if ($query->num_rows() > 0) {
return $query->row();
} else {
$this->error_message = 'Exam not found. Invalid id.';
return false;
}
} else {
$this->error_message = 'Invalid id.';
return false;
}
} | [
"public function getById($examId);",
"public static function LoadById($exam_id)\n {\n \t$result = &get_instance()->db->get_where(\"Exams\", array(\"exam_id\" => $exam_id));\n \t$result = $result->result();\n \treturn count($result) != 0 ? Exams_model::LoadWithData($result[0]) : null;\n }",
"public function getQuestionById($id){\n\t\tforeach ($this->exam as $question) {\n\t\t\tif ($question[\"id\"] == $id)\n\t\t\t\treturn $question;\n\t\t}\n\t}",
"public function fetch_single_exam()\n {\n if ($this->request->getVar('id')) {\n $exam_data = $this->examsModel->find($this->request->getVar('id'));\n\n echo json_encode($exam_data);\n }\n }",
"public function getRecord($examId, $examineeId, $id)\n\t\t{\n\t\t\t$this->db->query('SELECT score, items, result, started, finished, \n\t\t\t\texams.name as examName, \n\t\t\t\texaminees.firstName as examineeName\n\t\t\t\tFROM examRecords \n\t\t\t\tINNER JOIN exams ON exams.ID = :examID\n\t\t\t\tINNER JOIN examinees ON examinees.ID = :examineeID\n\t\t\t\tWHERE examRecords.ID = :ID');\n\t\t\t$this->db->bind(':examID', $examId);\n\t\t\t$this->db->bind(':examineeID', $examineeId);\n\t\t\t$this->db->bind(':ID', $id);\n\t\t\t$record = $this->db->single();\n\n\t\t\treturn $record;\n\t\t}",
"function getOneExamsById($id) {\n\t\t$SQL=\"SELECT * FROM exams WHERE id = '$id'\";\n\t\t$this->db->executeQuery($SQL);\n\n\t\t$result = array();\n\t\t$count = 0;\n\n\t\twhile($rs = $this->db->nextRecord())\n\t\t{\n\t\t\t$exams = new Exams();\n\t\t\t$exams->setId($rs['id']);\n\t\t\t$exams->setExam_group_id($rs['exam_group_id']);\n\t\t\t$exams->setSubject_id($rs['subject_id']);\n\t\t\t$exams->setStart_time($rs['start_time']);\n\t\t\t$exams->setEnd_time($rs['end_time']);\n\t\t\t$exams->setMaximum_marks($rs['maximum_marks']);\n\t\t\t$exams->setMinimum_marks($rs['minimum_marks']);\n\t\t\t$exams->setGrading_level_id($rs['grading_level_id']);\n\t\t\t$exams->setWeightage($rs['weightage']);\n\t\t\t$exams->setEvent_id($rs['event_id']);\n\t\t\t$exams->setCreated_at($rs['created_at']);\n\t\t\t$exams->setUpdated_at($rs['updated_at']);\n\t\t\t$result[$count++] = $exams;\n\t\t}\n\n\t\t$this->db->closeRs();\n\t\tif(count($result) > 0 ){\n\t\t\treturn $result[0];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"static function get_experiment_by_id($id)\n {\n global $db;\n\n // grab the article\n $str = \"SELECT * FROM `experiments` WHERE `expid`='%d'\";\n $sql = sprintf($str, api::cleanse($id));\n return mysqli_fetch_assoc(mysqli_query($db, $sql));\n }",
"public function exam()\n {\n return $this->hasOne(Exam::class);\n }",
"public function GetSingleFAQ($ID=0)\n {\n \n if ($ID) {\n $record = $this->SQL->GetRecord(array(\n 'table' => $this->Table,\n 'keys' => 'question, answer',\n 'where' => \"`helpcenter_faqs_id`={$ID} AND `active`=1\",\n ));\n \n if ($record) {\n return $record;\n }\n }\n }",
"public function show($id)\n {\n return $this->work_experience->findOrFail($id);\n }",
"public function fetchQuestionById($id);",
"public function getQuestionByExam($id){\n\t\t\t$query = \"SELECT * FROM tbl_ques WHERE examid='$id'\";\n\t\t\t$getData = $this->db->select($query);\n\t\t\tif ($getData) {\n\t\t\t\treturn $getData->num_rows;\n\t\t\t}else{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t}",
"function readByExamID(){\n \n // select all query\n $query = \"SELECT studentsid, taken, score \n FROM students2exams\n WHERE examsid = :examsid\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // sanitize\n $this->examsid=htmlspecialchars(strip_tags($this->examsid));\n\n // bind values\n $stmt->bindParam(\":examsid\", $this->examsid);\n\n // execute query\n $stmt->execute();\n return $stmt;\n }",
"function get_lesson_by_id($id)\n{\n\t$db = get_db_connection();\n\t$sql = \"SELECT * FROM tbl_lesson WHERE id = $id;\";\n\t$result = $db->query($sql);\n\t$row = $result->fetch();\n\treturn $row;\n}",
"public function getById($experienceId);",
"public function getDetail($id);",
"public function get_experiment_by_id($experiment_id)\n\t{\n\t\treturn $this->db->get_where('experiment', array('id' => $experiment_id))->row();\n\t}",
"public function getWrittenExamDetails($written_exam_id);",
"public function getStudentByID($id) {\n return Student::where('id', '=', $id)->first();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove and return the last inserted font | public function popLastFont()
{
if ($this->index < 0) {
throw new FontException('The font stack is empty');
}
$font = array_pop($this->stack);
--$this->index;
return $this->getFontMetric($font);
} | [
"public function getNewFont()\n {\n return $this->newFont;\n }",
"private function font()\n {\n return $this->fonts[array_rand($this->fonts)];\n }",
"public function getCurrentFont()\n {\n return $this->currentFont;\n }",
"public static function _remove_system_font($font)\n {\n return in_array($font, ControlsHelpers::get_system_font_stack()) ? '' : $font;\n }",
"public function getCurrentFont()\n {\n }",
"function gd_ps_free_font ($font_index)\n{\n return imagepsfreefont($font_index);\n}",
"function CreateCurrentFont(){}",
"public function forceDeleted(Font $font)\n {\n //\n }",
"function UnloadFont(\\raylib\\Font $font): void { }",
"function imagepsfreefont ($fontindex) {}",
"function GetChosenFont(){}",
"public function getFont () {}",
"public function removeFont(string $search=null){\r\n\t\t\tif(!isset($search)){\r\n\t\t\t\t$this->cssData['import']['fontFace'] = array();\r\n\t\t\t\treturn $this;\r\n\t\t\t}\r\n\t\t\t$data = $this->_SearchSelector($search,'fontface');\r\n\t\t\t$t = count($data);\r\n\t\t\tfor($i=0;$t > $i;$i++){\r\n\t\t\t\t$k = $data[$i]['i'];\r\n\t\t\t\tif(array_key_exists($k,$this->cssData['import']['fontFace'])){\r\n\t\t\t\t\tunset($this->cssData['import']['fontFace'][$k]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this;\r\n\t\t}",
"public function font() {\n return $font;\n }",
"public function getFont()\n {\n return $this->font;\n }",
"public function getActualFontId(): int\n\t{\n\t\treturn ++$this->actualFontId;\n\t}",
"public function getFontId()\n {\n return $this->font_id;\n }",
"public function fontName()\n {\n $font = (string) $this->data->textElement->font['fontName'];\n return $font != \"\" ? $font : 'times';\n }",
"function FontEnd()\n {\n echo \"</FONT>\\n\" ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the active worksheet's context (school or district) | public function getContext()
{
// Context has already been determined
if (isset($this->worksheets[$this->activeWorksheet]['context'])) {
return $this->worksheets[$this->activeWorksheet]['context'];
}
// Context can be determined from the worksheet name
switch ($this->activeWorksheet) {
case 'Schools':
return Context::SCHOOL_CONTEXT;
case 'Corporations':
return Context::DISTRICT_CONTEXT;
}
// Context can be determined from the column headers
for ($row = 1; $row <= 2; $row++) {
$isSchoolContext = (
$this->isSchoolCodeHeader(1, $row)
&& $this->isSchoolNameHeader(2, $row)
) || (
$this->isDistrictCodeHeader(1, $row)
&& $this->isDistrictNameHeader(2, $row)
&& $this->isSchoolCodeHeader(3, $row)
&& $this->isSchoolNameHeader(4, $row)
);
if ($isSchoolContext) {
return Context::SCHOOL_CONTEXT;
}
$isDistrictContext = $this->isDistrictCodeHeader(1, $row)
&& $this->isDistrictNameHeader(2, $row)
&& !$this->isSchoolCodeHeader(3, $row)
&& !$this->isSchoolNameHeader(4, $row);
if ($isDistrictContext) {
return Context::DISTRICT_CONTEXT;
}
}
throw new Exception('Cannot determine school/district context of worksheet ' . $this->activeWorksheet);
} | [
"public function getSchool()\n {\n return $this->school;\n }",
"public function getCurrentWorksheet();",
"public function getSchoolOfficeId()\r\n {\r\n return $this->school_office_id;\r\n }",
"public function context()\n {\n if ($this->hasRole(Role::ctype('Employee', 'Name'))) {\n $employee = Employee::find($this->context_id);\n $employee->context_type = 'Employee';\n\n return $employee;\n } elseif ($this->hasRole(Role::ctype('Customer', 'Name'))) {\n $customer = Customer::find($this->context_id);\n $customer->context_type = 'Customer';\n\n return $customer;\n }\n\n return null;\n }",
"public function _getschool_id() {\n\t\treturn $this->_schoolId;\n\t}",
"public function getSchool()\n {\n return $this->getRequest()->getParam('ecole');\n }",
"public function getSchool();",
"function oa_core_get_section_context() {\n if (defined('OA_SESSION_SECTION') && isset($_SESSION[OA_SESSION_SECTION])) {\n return $_SESSION[OA_SESSION_SECTION];\n }\n else {\n return oa_section_get_section_context();\n }\n}",
"public function get_active_school_id() {\n if (addon_status('multi-school')) {\n if ($this->session->userdata('active_school_id') > 0) {\n return $this->session->userdata('active_school_id');\n }else{\n $active_school_id = get_settings('school_id');\n $this->session->set_userdata('active_school_id', $active_school_id);\n return $this->session->userdata('active_school_id');\n }\n }else{\n $active_school_id = get_settings('school_id');\n $this->session->set_userdata('active_school_id', $active_school_id);\n return $this->session->userdata('active_school_id');\n }\n }",
"public function get_context() {\n\t\treturn $this->current_context;\n\t}",
"public function getCurrentSheet()\n {\n $this->throwIfBookIsNotAvailable();\n return $this->book->getCurrentWorksheet()->getExternalSheet();\n }",
"function getCalendarContext()\n {\n return \\Chamilo\\Application\\Weblcms\\Tool\\Implementation\\ExamAssignment\\Manager::context();\n }",
"public function getSchool()\n \t{\n $school_id = $this->school_id;\n if($school_id == null) return null;\n $this->load->model(\"Schools_model\");\n return Schools_model::LoadWithData(Schools_model::LoadById($school_id));\n \t}",
"final public function getSchoolId()\n\t{\n\t\treturn $this->school_id;\n\t}",
"public function get_school_record() \n\t\t{\n\t\t\t$res=$this->get_record('schools');\n\t\t\treturn $res;\n\t\t}",
"function getCategoryOfContext()\n {\n return 'dhtmlx';\n }",
"public function getSchool(): string\n {\n return $this->school;\n }",
"public function getActiveSheet() {\r\n //fetch the excel object\r\n $excelObj = $this->phpXl;\r\n return $excelObj->getActiveSheet();\r\n }",
"public function getTeachersPrimarySchool()\n {\n $authid = Auth::user()->id;\n $primarySchoolId = Auth::user()->userMeta->default_school;\n if (!empty($primarySchoolId)) {\n $teacher_school = School::withTrashed()->where('id', '=', $primarySchoolId)->get();\n } else {\n $teacher_school = self::getTeacherSchools(true);\n }\n /* $teacher_school = usersSchools::join('schools','school_id','=','schools.id')\n ->where('user_id','=',$authid)->first();*/\n return $teacher_school;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve information of local rgb bulb | public function RetrieveLocalRgbBulbInfo($ipAddress)
{
try {
$this->jeedomHelper->logDebug("Retrieve info of wifi bulb " . $ipAddress);
$url = "http://" . $ipAddress . "/api/v1/device";
$result = $this->doHttpCall($url, null, "GET");
if ($result === false) {
return null;
}
$jsonObj = json_decode($result);
$macAddress = key($properties = get_object_vars($jsonObj));
$mystromBulb = new MystromWifiBulb();
$mystromBulb->macAddress = $macAddress;
$mystromBulb->ipAddress = $ipAddress;
$mystromBulb->state = $jsonObj->$macAddress->on == true ? "on" : "off";
$mystromBulb->power = $jsonObj->$macAddress->power;
$mystromBulb->color = $jsonObj->$macAddress->color;
$hsv = explode(";", $mystromBulb->color);
$rgb = explode(";", $this->hsvToRgb($hsv[0], $hsv[1], $hsv[2]));
$mystromBulb->color = "#" . \sprintf("%'.02s", \dechex($rgb[0]))
. \sprintf("%'.02s", \dechex($rgb[1]))
. \sprintf("%'.02s", \dechex($rgb[2]));
return $mystromBulb;
} catch (Exception $e) {
$this->jeedomHelper->logWarning("RetrieveLocalRgbBulbInfo - " . $e);
return null;
}
} | [
"function GetRGB(){}",
"public function getRGB()\n {\n if ($this->resource->getFormat() == \"code\") {\n $this->findRGBByCode();\n } elseif ($this->resource->getFormat() == \"name\") {\n $this->findRGBByName();\n } else {\n return;\n }\n }",
"public function luminance();",
"public function getImageBluePrimary () {}",
"public function getimagemattecolor()\n {\n }",
"protected function findRGBByCode()\n {\n $hexCode = str_replace(\"#\", \"\", $this->resource->getCode());\n $hexCodes = str_split($hexCode, 2);\n $this->resource->setRGB(hexdec($hexCodes[0]), hexdec($hexCodes[1]), hexdec($hexCodes[2]));\n }",
"public function getImageGreenPrimary () {}",
"function lpi_getcolor( $string ) {\r\n if( strlen($string)!=6 )\r\n return( null );\r\n return array(\r\n 'R' => hexdec(substr($string,0,2)),\r\n 'G' => hexdec(substr($string,2,2)),\r\n 'B' => hexdec(substr($string,4,2))\r\n );\r\n}",
"public function getImageRedPrimary () {}",
"public function getBboxLightsStatus()\n {\n log::add('bbox_sagemcom', 'debug', '['.__FUNCTION__.'] Function called');\n $result = $this->sendApiRequest('device');\n if ($result == false) {\n log::add('bbox_sagemcom', 'debug', '['.__FUNCTION__.'] BBox not detected or bad response');\n } else {\n log::add('bbox_sagemcom', 'debug', '['.__FUNCTION__.'] BBox response is : '.$result);\n return $result[0]['device']['display']['luminosity'] == 0 ? false : true;\n }\n }",
"public function getBlue();",
"function getRGBFill(){}",
"public function getRGB()\n {\n return \"rgb({$this->red},{$this->green},{$this->blue})\";\n }",
"public static function Plum()\r\n {return RgbColor::CreateRgbColor(\"Plum\");}",
"function cb_illuminance($illuminance)\n{\n echo \"Illuminance: \" . $illuminance / 10.0 . \" Lux\\n\";\n}",
"public function getRGB() {\n return $this->value;\n }",
"protected function getRGBMap()\n {\n $this->rgbMap->offsetSet(\"aliceblue\", array(240, 248, 255));\n $this->rgbMap->offsetSet(\"black\", array(0, 0, 0));\n $this->rgbMap->offsetSet(\"blue\", array(0, 0, 255));\n $this->rgbMap->offsetSet(\"brown\", array(165,42,42));\n $this->rgbMap->offsetSet(\"coral\", array(255,127,80));\n $this->rgbMap->offsetSet(\"cyan\", array(0,255,255));\n $this->rgbMap->offsetSet(\"fuchsia\", array(255,0,255));\n $this->rgbMap->offsetSet(\"gold\", array(255,215,0));\n $this->rgbMap->offsetSet(\"green\", array(0,255,0));\n $this->rgbMap->offsetSet(\"grey\", array(128,128,128));\n $this->rgbMap->offsetSet(\"indigo\", array(75,0,130));\n $this->rgbMap->offsetSet(\"lavander\", array(230,230,250));\n $this->rgbMap->offsetSet(\"maroon\", array(128,0,0));\n $this->rgbMap->offsetSet(\"navy\", array(0,0,128));\n $this->rgbMap->offsetSet(\"orange\", array(255,165,0));\n $this->rgbMap->offsetSet(\"pink\", array(255,192,203));\n $this->rgbMap->offsetSet(\"purple\", array(128,0,128));\n $this->rgbMap->offsetSet(\"red\", array(255,0,0));\n $this->rgbMap->offsetSet(\"silver\", array(192,192,192));\n $this->rgbMap->offsetSet(\"turquoise\", array(64,224,208));\n $this->rgbMap->offsetSet(\"violet\", array(238,130,238));\n $this->rgbMap->offsetSet(\"white\", array(255,255,255));\n $this->rgbMap->offsetSet(\"yellow\", array(255,255,0));\n }",
"function rgbfromip() {\n\t\t$h = array_map('ord', str_split(md5(get_ip(), true)));\n\t\treturn \"$h[0],$h[1],$h[2]\";\n\t}",
"public function getColorInfo()\n {\n return $this->color_info;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cURL Operations Set the internal data members to valued representing a bad handle error. | private function set_bad_handle() /*void*/ {
$this->_response = '';
$this->_errno = CURLM_BAD_HANDLE;
$this->_error = 'The passed-in handle is not a valid cURL handle.';
$this->_status = 0;
} | [
"private function __set_curl_errors() {\n\t\tif (! $this->success) {\n\t\t\t\n\t\t\t$err = error_get_last ();\n\t\t\tif (! empty ( $this->curl_errors )) {\n\t\t\t\t$err = array (\n\t\t\t\t\t\t\"message\" => $this->curl_errors \n\t\t\t\t);\n\t\t\t}\n\t\t\tif (! $err) {\n\t\t\t\t$err = array (\n\t\t\t\t\t\t\"message\" => $this->error_messages ['INVALID_URL'] \n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->error = $err [\"message\"];\n\t\t}\n\t}",
"public function _check_error() {\n if( ( @curl_error( $this->handle_id ) != 0 ) && ( $this->debug == TRUE ) ) {\n //show_error( @curl_error( $this->handle_id ) );\n throw new Kohana_Exception( 'curl.general_error', @curl_error( $this->handle_id ) );\n }\n }",
"function curl_multi_errno($mh){}",
"final private function validate()\n {\n if (curl_errno($this->ch)) {\n throw new Exception(curl_error($this->ch));\n }\n\n $httpCode = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);\n switch ($httpCode) {\n case 200:\n case 201:\n // Successful API HTTP response codes\n break;\n case 400:\n case 401:\n case 403:\n case 404:\n case 429:\n case 500:\n case 503:\n // Failed\n $statusCode = $this->results->statusCode;\n $error = $this->results->error;\n $message = $this->results->message;\n $effectiveUrl = curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL);\n throw new \\Exception(\"[ $effectiveUrl ] ($statusCode) $error - $message\");\n break;\n default:\n throw new \\Exception(\"Uh-oh... An unexpected error has occurred (HTTP $httpCode).\");\n break;\n }\n }",
"public function setScrapingError(): void;",
"private function processFailure($curl) {\n $this->setError($curl->getCurlError());\n }",
"private function curl_no_error_fail()\n {\n $this->curl_add_option(CURLOPT_FAILONERROR, FALSE);\n }",
"protected function setErrors()\n {\n // Get the status if given, then record errors\n if (isset($this->response->status)) {\n $this->status = $this->response->status;\n }\n\n if (isset($this->response->serviceErrorCode)) {\n $this->errors = isset($this->response->message) ? $this->response->message : '';\n }\n }",
"abstract protected function setErrors();",
"function handle_errors($lib)\n{\n if ($lib->resp_error) {\n echo \"Invalid request: \";\n foreach ($lib->resp_errors_list as $m => $message) {\n echo \"<br />\".$message[\"message\"];\n }\n } elseif ($lib->curl_error) {\n echo \"Unable to send the request: \".$lib->curl_error_text;\n }\n}",
"protected function ensureData(): void\n {\n if (is_null($this->responseData)) {\n // We'll ignore the HTTP status and go by the statusCode provided by the service.\n $this->responseData = json_decode($this->response->getContent(false), true);\n if (!isset($this->responseData['statusCode']) || $this->responseData['statusCode'] != 200) {\n $message = $this->responseData['error_description'] ?? $this->responseData['error'] ?? 'Unknown error';\n throw new RequestError($message);\n }\n }\n }",
"public function getCurlError()\n {\n return curl_error($this->_curlHandle);\n }",
"function set_error()\n\t{\n\t\t$args = func_get_args();\n\n\t\t$this->error = call_user_func_array('fetch_error', $args);\n\n\t\tif (!empty($this->upload['location']))\n\t\t{\n\t\t\t@unlink($this->upload['location']);\n\t\t}\n\t}",
"private function setErrors()\n\t{\n\t\t$this->errorCode = mysql_errno();\n\t\t$this->errorStr = mysql_error();\n\t}",
"function get_curl_error_message(){\n return $this->curl_error_message;\n }",
"protected function handleError() {\n $meta= $this->stream->get('vlength/Vnumber/Cstate/Cclass', 8);\n $message= $this->stream->getString($this->stream->getShort());\n $server= $this->stream->getString($this->stream->getByte());\n $proc= $this->stream->getString($this->stream->getByte());\n $line= $this->stream->getByte();\n\n $this->handleMessage($message, $meta['number'], $meta['state'], $meta['class'], $server, $proc, $line);\n }",
"function _setErrorVariables()\n\t{\n\t\tif (!empty($this->m_link_id))\n\t\t{\n\t\t\t$this->m_errno = mysql_errno($this->m_link_id);\n\t\t\t$this->m_error = mysql_error($this->m_link_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->m_errno = mysql_errno();\n\t\t\t$this->m_error = mysql_error();\n\t\t}\n\t}",
"private function initCurlHandle()\n {\n $this->closeCurlHandle();\n $this->curlHandle = \\curl_init();\n\n if (false === $this->curlHandle) {\n // @codeCoverageIgnoreStart\n throw new ApiConnectException('Could not init cURL');\n // @codeCoverageIgnoreEnd\n }\n }",
"abstract protected function setErrorHandler(): self;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the riskLevel Level of the detected risk. Note: Details for this property are only available for Workload Identities Premium customers. Events in tenants without this license will be returned hidden. The possible values are: low, medium, high, hidden, none. | public function setRiskLevel($val)
{
$this->_propDict["riskLevel"] = $val;
return $this;
} | [
"public function addRiskLevel($riskLevel) {\r\n \t$this->riskLevel = $riskLevel;\r\n }",
"public function riskLevel(?string $value): self\n {\n $this->instance->setRiskLevel($value);\n return $this;\n }",
"public function setLevel($Level){\n $this->Level = $Level;\n }",
"public function setLevel( $level )\r\n {\r\n $this->level = $level;\r\n }",
"public function setRiskScore($val)\n {\n $this->_propDict[\"riskScore\"] = $val;\n return $this;\n }",
"public function level($level) {\n\t\t$this->_level = $level;\n\t}",
"public function setEnergyLevel(int $energyLevel): void{\n if($energyLevel > 0){\n if($energyLevel > 100){\n $energyLevel = 100;\n }\n } else{\n $energyLevel = 0;\n }\n \n $this->energyLevel = $energyLevel;\n }",
"public function setRiskScore($val)\n {\n $this->_propDict[\"riskScore\"] = $val;\n return $this;\n }",
"public function setLevel($level) {\n $this->record->setLevel($level);\n }",
"public function setRiskEvaluation(?RiskEvaluation $riskEvaluation): void\n {\n $this->riskEvaluation = $riskEvaluation;\n }",
"public function setPetLevel(int $petLevel): void {\n\t\tif($this->petLevel !== $petLevel) {\n\t\t\t$this->petLevel = $petLevel;\n\n\t\t\t$loader = $this->getLoader();\n\t\t\tif($loader->getBlockPetsConfig()->storeToDatabase()) {\n\t\t\t\t$loader->getDatabase()->updateExperience($this);\n\t\t\t}\n\t\t}\n\t}",
"public function setRichness($level) {\n\t\t$this->parameterRichness = intval($level);\n\t}",
"public function setWinningLevel($level) {\n\t\t$this->winningLevel = $level;\n\t}",
"public function setSecurityLevel($securityLevel)\n {\n $min = self::MIN_SECURITY_LEVEL;\n $max = self::MAX_SECURITY_LEVEL;\n\n if (!is_numeric($securityLevel)) {\n throw new \\InvalidArgumentException(\"Security level must be numeric. Given: $securityLevel\");\n }\n\n if ($securityLevel < $min || $securityLevel > $max) {\n throw new \\InvalidArgumentException(\"Security level must be between $min and $max. Given: $securityLevel\");\n }\n\n $this->securityLevel = intval($securityLevel);\n }",
"public function setFuelLevel($fuelLevel){\n $this->fuelLevel = $fuelLevel;\n self::notifyObserver($fuelLevel);\n }",
"function setIssueLevel( $sessionID, $issueID, $level ){\r\n\t \tif($this->userCanSetIssueLevel( $sessionID, $issueID )){\r\n\t \t\t$userID = $_SESSION[ 'userid' ];\r\n\t\t\t$this->sendIssueAlerts($issueID, 'Issue level changed.');\r\n\t\t\t$query=\"UPDATE issues SET Modifier='$userID', Level='$level' WHERE ID='$issueID'\";\r\n\t\t\t$result=mysql_query($query);\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}",
"public function setScore($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dlp\\V2\\SensitivityScore\\SensitivityScoreLevel::class);\n $this->score = $var;\n\n return $this;\n }",
"private function calcSecurityLevel()\n\t{\n\t\tswitch($this->risk_factor)\n\t\t{\n\t\tcase ChecklistItem::GREAT:\n\t\t\tif ($this->potential_injury == ChecklistItem::GREAT) {\n\t\t\t\t$this->security_level = ChecklistItem::A1;\n\t\t\t} else if ($this->potential_injury == ChecklistItem::SMALL) {\n\t\t\t\t$this->security_level = ChecklistItem::A2;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ChecklistItem::SMALL:\n\t\t\tif ($this->potential_injury == ChecklistItem::GREAT) {\n\t\t\t\t$this->security_level = ChecklistItem::B1;\n\t\t\t} else if ($this->potential_injury == ChecklistItem::SMALL) {\n\t\t\t\t$this->security_level = ChecklistItem::B2;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ChecklistItem::NEGLIGIBLE:\n\t\t\t$this->security_level = ChecklistItem::C;\n\t\t\tbreak;\n\n\t\tdefault: throw new RuntimeException(\"RiskFactor was set \"\n\t\t\t. \"to unknown value.\");\n\t\t}\n\t}",
"public function setRiskScore(?string $value): void {\n $this->getBackingStore()->set('riskScore', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the TelegramBot model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = TelegramBot::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));
} | [
"protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"public function find(mixed $primaryKey): ?ModelInterface;",
"protected function findModel(array $pk) {\n /** @var ActiveRecord $class */\n $class = $this->getModelClass();\n if (($model = $class::findOne($pk)) !== null) {\n return $model;\n }\n\n $error = \\Yii::t('yii', 'The requested page does not exist.');\n Yii::$app->session->addFlash('error', $error );\n\n return null;\n }",
"protected function findModel($id)\n {\n if (($model = AeExtTickerTrade::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"protected function findModel( $id ) {\n\t\tif ( ( $model = BotEmotion::findOne( $id ) ) !== null ) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException( 'The requested page does not exist.' );\n\t}",
"protected function findModel($id)\n {\n if (($model = BotUse::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id) {\n if (($model = Config::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"protected function findModel($id) {\r\n\t\tif (($model = Sender::findOne ( $id )) !== null) {\r\n\t\t\treturn $model;\r\n\t\t} else {\r\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\r\n\t\t}\r\n\t}",
"protected function findModel($id) {\n if (($model = \\dmstr\\modules\\pages\\models\\TreeTranslation::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"public function findModel(): ?Model\n {\n return $this->getModelQuery()->find($this->route('id'));\n }",
"protected function findModel($id)\n {\n if (($model = Timetable::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Webhook::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"protected function findModel($id){\n\t\tif (($model = JobApplication::findOne($id)) !== NULL){\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"protected function findModel($id)\n {\n if (($model = Room::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app','SYSTEM_TEXT_PAGE_NOT_FOUND'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = ApiKeys::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n if (($model = CoreLanguages::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the active token for the given series. | public function loadTokenBySeries(string $series): PersistentTokenInterface; | [
"public function loadTokenBySeries($series)\n {\n $token = $this->query()->where('series', $series)->first();\n\n if (!$token) {\n throw new TokenNotFoundException(\"Token with series '$series' was not found\");\n }\n\n return $token;\n }",
"function loadToken() {\r\n\t\treturn isset($_SESSION['token']) ? $_SESSION['token'] : null;\r\n\t}",
"protected function loadStoredAccessToken(array $token) {\n if (!empty($token['access_token']) && !empty($token['token_expiry'])) {\n // Set new access token.\n $this->access_token = $token['access_token'];\n $this->access_token_expiry = $token['token_expiry'];\n }\n }",
"public function loadByTokenString($tokenString)\n\t{\n\t\t$token = $this->getOne(array('token' => $tokenString));\n\t\tif ($token) {\n\t\t\t$this->exchangeArray($token->toArray());\n\t\t}\n\t\treturn $token;\n\t}",
"public function loadAccessToken()\n {\n $loader = new ConfigLoader(__DIR__ . '/../../../config');\n return $loader->load('slack', 'token');\n }",
"public function get($token);",
"private function loadAccessToken() {\n\n try {\n $savedAccessTokenString = file_get_contents(self::TOKEN_FILE_PATH);\n $this->log('File token loaded.');\n }\n catch (\\Exception $e) {\n $this->log(\"Failed to open token file. {$e->getMessage()}\", self::LOG_ERROR);\n throw new \\Exception(\"Failed to open token file. {$e->getMessage()}\");\n }\n \n return json_decode($savedAccessTokenString, true);\n\n }",
"protected function loadResumptionToken($token)\n {\n // Create object for loading tokens:\n $search = new Oai_resumption();\n\n // Clean up expired records before doing our search:\n $search->removeExpired();\n\n // Load the requested token if it still exists:\n $search->id = $token;\n if ($search->find(true)) {\n return $search->restoreParams();\n }\n\n // If we got this far, the token is invalid or expired:\n return false;\n }",
"abstract function loadTokenFromCache();",
"protected static function loadTokens(){\n //Load tokens from file and check current time save into array\n $token_file = self::$tmp_directory.'tokens.txt';\n if(file_exists($token_file)){\n $token_file = fopen($token_file, 'r');\n $contents = stream_get_contents($token_file);\n fclose($token_file);\n //Accessing contents and comparing Time\n $data = array();\n foreach(preg_split(\"/((\\r?\\n)|(\\r\\n?))/\", $contents) as $line){\n if(!empty($line)){\n $line = explode(\":\", $line);\n $data[trim($line[0])] = trim($line[1]);\n }\n }\n self::$token_created_time = $data['Created'];\n self::$access_token = $data['access_token'];\n self::$refresh_token = $data['refresh_token'];\n self::$token_lifetime = $data['expires_in'];\n\n }\n else {\n self::requestAccessToken();\n self::loadTokens();\n }\n }",
"private function fetchToken()\n {\n // fetch it.\n $token = false;\n $hasCache = !is_null($this->cache);\n if ($hasCache) {\n $token = $this->cache->get($this->buildCacheKey(), $this->cacheConfig['lifetime']);\n }\n if (!$token) {\n $token = call_user_func($this->tokenFunc, $this->scopes);\n if ($hasCache) {\n $this->cache->set($this->buildCacheKey(), $token);\n }\n }\n return $token;\n }",
"public static function get_tokens_from_store() {\n\n\t\t$response = json_decode(file_get_contents(token_store), TRUE);\n\n\t\treturn $response;\n\n\t}",
"public function loadUserByApiToken($token);",
"public static function acquire_token() {\n\n\t\t\n\n\t\t$response = skydrive_tokenstore::get_tokens_from_store();\n\n\t\tif (empty($response['access_token'])) {\t// No token at all, needs to go through login flow. Return false to indicate this.\n\n\t\t\treturn false;\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\tif (time() > (int)$response['access_token_expires']) { // Token needs refreshing. Refresh it and then return the new one.\n\n\t\t\t\t$refreshed = skydrive_auth::refresh_oauth_token($response['refresh_token']);\n\n\t\t\t\tif (skydrive_tokenstore::save_tokens_to_store($refreshed)) {\n\n\t\t\t\t\t$newtokens = skydrive_tokenstore::get_tokens_from_store();\n\n\t\t\t\t\treturn $newtokens['access_token'];\n\n\t\t\t\t}\n\n\t\t\t\texit;\n\n\t\t\t} else {\n\n\t\t\t\treturn $response['access_token']; // Token currently valid. Return it.\n\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"protected function prepareToken()\n\t{\n\t\t// If we haven't retrieved the bearer yet, get it if in the site application\n\t\tif (($this->token == null) && JFactory::getApplication()->isSite())\n\t\t{\n\t\t\t// Get the cache controller\n\t\t\t/** @var JCacheControllerCallback $cache */\n\t\t\t$cache = JFactory::getCache('mod_tweetdisplayback', 'callback');\n\n\t\t\t// Bearer tokens are ALWAYS cached\n\t\t\t$cache->setCaching(true);\n\n\t\t\t// Set the lifetime to match the module params\n\t\t\t$cache->setLifeTime($this->cacheTime());\n\n\t\t\t// Generate a cache ID that we can reuse for all modules sharing this token source\n\t\t\t$source = $this->params->get('token_source', 'consumer');\n\t\t\t$url = $this->params->get('remote_url', 'http://tdbtoken-v2.gopagoda.io/tokenRequest.php');\n\n\t\t\t$cacheId = md5(\"mod_tweetdisplayback_bearer_$source\" . ($source == 'remote' ? \"_$url\" : ''));\n\n\t\t\t// If cache API throws a fatal error, let's work around it to try and keep the module functioning\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// As of 3.6 the callback controller doesn't accept Closures so we have to direct it to a public method here in the class\n\t\t\t\t$this->token = $cache->get([$this, 'getToken'], [], $cacheId);\n\t\t\t}\n\t\t\tcatch (RuntimeException $e)\n\t\t\t{\n\t\t\t\t$this->token = $this->getToken();\n\t\t\t}\n\t\t}\n\n\t\treturn !empty($this->token);\n\t}",
"function Load_token($valore_blog) {\n require_once('security.php');\n\t$id_admin = get_id_admin_from_blog($valore_blog);\n\t$token = decrypt(get_user_meta($id_admin , \"CalendApp_GToken\", \"true\"));\t \t\n\treturn $token;\n}",
"function load_record_by_token_credentials($db, $token_credentials)\r\n\t{\r\n\t\t$table = $this->config['auth']['table'];\r\n\t\t$st = $db->prepare(\"SELECT * FROM {$table} WHERE oauth_token = ?\");\r\n\t\t$st->execute(array($token_credentials['oauth_token']));\r\n\t\treturn $st->fetch();\r\n\t}",
"private function _get_api_token()\n\t{\n\t\t$query = $this->EE->db->get($this->module_name);\n\t\t\n\t\tif( $query->num_rows() != 0 )\n\t\t{\n\t\t\t$this->api_token = $query->row()->api_key;\n\t\t} \n\t}",
"function LoadCloudABISToken()\n {\n // cloudABISCredentials.AppKey = AppSettingsReader.CloudABISAppKey;\n // cloudABISCredentials.SecretKey = AppSettingsReader.CloudABISSecretKey;\n // cloudABISCredentials.BaseAPIURL = AppSettingsReader.CloudABIS_API_URL;\n // cloudABISCredentials.CustomerKey = AppSettingsReader.CloudABISCustomerKey;\n // cloudABISCredentials.EngineName = EngineName();\n\n //Read token from CloudABIS Server\n $cloudABISConnector = new CloudABISConnector(CloudABISAppKey, CloudABISSecretKey, CloudABIS_API_URL, CloudABISCustomerKey, ENGINE_NAME);\n\n $token = $cloudABISConnector->GetCloudABISToken();\n if ( ! is_null($token) && isset($token->access_token) != \"\" )\n {\n $_SESSION['access_token'] = $token->access_token;\n //SessionManager.CloudABISAPIToken = token.AccessToken;\n //SessionManager.CloudABISCredentials = cloudABISCredentials;\n }\n else\n {\n SetStatus(\"CloudABIS Not Authorized!. Please check credentails\");\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ nkList configuration Define the list of forum | function getForumListCfg() {
return array(
'sqlQuery' => 'SELECT A.id, A.nom, A.niveau, A.level, B.nom AS category FROM '. FORUM_TABLE .' AS A LEFT JOIN '. FORUM_CAT_TABLE .' AS B ON B.id = A.cat',
'defaultSortables' => array(
'order' => array('B.ordre', 'B.nom', 'A.ordre', 'A.nom')
),
'fields' => array(
'nom' => array('label' => __('NAME')),
'category' => array('label' => __('CATEGORY')),
'niveau' => array('label' => __('LEVEL_ACCES')),
'level' => array('label' => __('LEVEL_POST'))
),
'edit' => array(),
'delete' => array()
);
} | [
"public function getForumList()\n\t{\t\t\t\n\t\t$this->DB->build( array( 'select' => 'f.*',\n\t\t\t\t\t\t\t\t 'from' => array( 'forums' => 'f' ),\n\t\t\t\t\t\t\t\t 'add_join' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray( 'select' => 'm.member_group_id as last_poster_group_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"m.member_id = f.last_poster_id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t \t\t\t\t\tarray( 'select' => 'p.*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'permission_index' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"p.perm_type='forum' AND p.app='forums' AND p.perm_type_id=f.id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->registry->classItemMarking->getSqlJoin( array( 'item_app_key_1' => 'f.id' ) ) ) ) );\n\t\t\t\t\t\t\n\t\t$q = $this->DB->execute();\n\t\t\n\t\t/* Loop through and build an array of forums */\n\t\t$forums_list\t= array();\n\t\t$update_seo\t\t= array();\n\t\t$tempForums = array();\n\t\t\n\t\twhile( $f = $this->DB->fetch( $q ) )\n\t\t{\n\t\t\t$tempForums[ $f['parent_id'] . '.' . $f['position'] . '.' . $f['id'] ] = $f;\n\t\t}\n\n\t\t/* Sort in PHP */\n\t\t$tempForums = IPSLib::knatsort( $tempForums );\n\t\t\n\t\tforeach( $tempForums as $posData => $f )\n\t\t{\n\t\t\t$fr = array();\n\t\t\t\n\t\t\t/* Add back into topic markers */\n\t\t\t$f = $this->registry->classItemMarking->setFromSqlJoin( $f, 'forums' );\n\t\t\t\n\t\t\t/**\n\t\t\t * This is here in case the SEO name isn't stored for some reason.\n\t\t\t * We'll parse it and then update the forums table - should only happen once\n\t\t\t */\n\t\t\tif ( ! $f['name_seo'] )\n\t\t\t{\n\t\t\t\t/* SEO name */\n\t\t\t\t$f['name_seo'] = IPSText::makeSeoTitle( $f['name'] );\n\t\t\t\t\n\t\t\t\t$update_seo[ $f['id'] ]\t= $f['name_seo'];\n\t\t\t}\n\n\t\t\t/* Last Post Info (author stuff!) */\n\t\t\t$f['last_poster_name'] = IPSMember::makeNameFormatted( $f['last_poster_name'], $f['last_poster_group_id'] );\n\t\t\n\t\t\t/* Reformat the array for a category */\n\t\t\tif ( $f['parent_id'] == -1 )\n\t\t\t{\n\t\t\t\t$fr['id']\t\t\t\t = $f['id'];\n\t\t\t\t$fr['sub_can_post'] = $f['sub_can_post'];\n\t\t\t\t$fr['name'] \t\t = $f['name'];\n\t\t\t\t$fr['name_seo'] \t\t\t= $f['name_seo'];\n\t\t\t\t$fr['parent_id']\t = $f['parent_id'];\n\t\t\t\t$fr['skin_id']\t\t = $f['skin_id'];\n\t\t\t\t$fr['permission_showtopic'] = $f['permission_showtopic'];\n\t\t\t\t$fr['forums_bitoptions'] = $f['forums_bitoptions'];\n\t\t\t\t$fr['hide_last_info']\t\t= 0;\n\t\t\t\t$fr['can_view_others']\t\t= 0;\n\t\t\t\t$fr['password']\t\t\t\t= $f['password'];\n\t\t\t\t\n\t\t\t\t/* Permission index columns */\n\t\t\t\t$fr['app']\t\t\t\t\t= $f['app'];\n\t\t\t\t$fr['perm_id']\t\t\t\t= $f['perm_id'];\n\t\t\t\t$fr['perm_type']\t\t\t= $f['perm_type'];\n\t\t\t\t$fr['perm_type_id']\t\t\t= $f['perm_type_id'];\n\t\t\t\t$fr['perm_view']\t\t\t= $f['perm_view'];\n\t\t\t\t$fr['perm_2']\t\t\t\t= $f['perm_2'];\n\t\t\t\t$fr['perm_3']\t\t\t\t= $f['perm_3'];\n\t\t\t\t$fr['perm_4']\t\t\t\t= $f['perm_4'];\n\t\t\t\t$fr['perm_5']\t\t\t\t= $f['perm_5'];\n\t\t\t\t$fr['perm_6']\t\t\t\t= $f['perm_6'];\n\t\t\t\t$fr['perm_7']\t\t\t\t= $f['perm_7'];\n\t\t\t\t$fr['owner_only']\t\t\t= $f['owner_only'];\n\t\t\t\t$fr['friend_only']\t\t\t= $f['friend_only'];\n\t\t\t\t$fr['authorized_users']\t\t= $f['authorized_users'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fr = $f;\n\n\t\t\t\t$fr['description'] = isset( $f['description'] ) ? $f['description'] : '';\n\t\t\t}\n\t\t\t\n\t\t\t$fr = array_merge( $fr, $this->registry->permissions->parse( $f ) );\n\n\t\t\t/* Unpack bitwise fields */\n\t\t\t$_tmp = IPSBWOptions::thaw( $fr['forums_bitoptions'], 'forums', 'forums' );\n\n\t\t\tif ( count( $_tmp ) )\n\t\t\t{\n\t\t\t\tforeach( $_tmp as $k => $v )\n\t\t\t\t{\n\t\t\t\t\t/* Trigger notice if we have DB field */\n\t\t\t\t\tif ( isset( $fr[ $k ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\ttrigger_error( \"Thawing bitwise options for FORUMS: Bitwise field '$k' has overwritten DB field '$k'\", E_USER_WARNING );\n\t\t\t\t\t}\n\n\t\t\t\t\t$fr[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Add... */\n\t\t\t$forums_list[ $fr['id'] ] = $fr;\n\t\t}\n\n\t\t$this->allForums\t= $forums_list;\n\t\t\n\t\t/**\n\t\t * Update forums table if SEO name wasn't cached yet\n\t\t */\n\t\tif( count($update_seo) )\n\t\t{\n\t\t\tforeach( $update_seo as $k => $v )\n\t\t\t{\n\t\t\t\t$this->DB->update( 'forums', array( 'name_seo' => $v ), 'id=' . $k );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $forums_list;\n\t}",
"public function forum_list ($theCode) {\n\t\tglobal $TSFE;\n\n\t\t$local_cObj = &t3lib_div::getUserObj('&tx_div2007_cobj');\n\t\t$local_cObj->setCurrentVal($TSFE->id);\n\n\t\tif (!$this->tt_board_uid) {\n\t\t\t$forumlist = 0;\t\t// set to true if this is a list of forums and not categories + forums\n\t\t\tif ($theCode == 'LIST_CATEGORIES') {\n\t\t\t\t\t// Config if categories are listed.\n\t\t\t\t$lConf = $this->conf['list_categories.'];\n\t\t\t} else {\n\t\t\t\t$forumlist = 1;\n\t\t\t\t\t// Config if forums are listed.\n\t\t\t\t$lConf = $this->conf['list_forums.'];\n\t\t\t\t$lConf['noForums'] = 0;\n\t\t\t}\n\t\t\t$GLOBALS['TSFE']->set_cache_timeout_default($lConf['cache_timeout'] ? intval($lConf['cache_timeout']) : 300);\n\t\t\t$templateCode = $local_cObj->getSubpart($this->orig_templateCode, '###TEMPLATE_OVERVIEW###');\n\n\t\t\tif ($templateCode) {\n\t\t\t\t\t// Clear\n\t\t\t\t$subpartMarkerArray = array();\n\t\t\t\t$wrappedSubpartContentArray = array();\n\n\t\t\t\t\t// Getting the specific parts of the template\n\t\t\t\t$markerArray = $this->markerObj->getColumnMarkers();\n\t\t\t\t$templateCode = $local_cObj->substituteMarkerArrayCached($templateCode,$markerArray,$subpartMarkerArray,$wrappedSubpartContentArray);\n\n\t\t\t\t\t// Getting the specific parts of the template\n\t\t\t\t$categoryHeader = $this->markerObj->getLayouts($templateCode, $this->alternativeLayouts, 'CATEGORY');\n\t\t\t\t$forumHeader = $this->markerObj->getLayouts($templateCode, $this->alternativeLayouts, 'FORUM');\n\t\t\t\t$postHeader = $this->markerObj->getLayouts($templateCode, $this->alternativeLayouts, 'POST');\n\t\t\t\t$subpartContent = '';\n\n\t\t\t\t\t// Getting categories\n\t\t\t\t$categories = $this->modelObj->getPagesInPage($this->pid_list);\n\t\t\t\treset($categories);\n\t\t\t\t$c_cat = 0;\n\n\t\t\t\tforeach ($categories as $k => $catData) {\n\t\t\t\t\t\t// Getting forums in category\n\t\t\t\t\tif ($forumlist)\t{\n\t\t\t\t\t\t$forums = $categories;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$forums = $this->modelObj->getPagesInPage($catData['uid']);\n\t\t\t\t\t}\n\t\t\t\t\tif (!$forumlist && count($categoryHeader)) {\n\t\t\t\t\t\t\t// Rendering category\n\t\t\t\t\t\t$out=$categoryHeader[$c_cat%count($categoryHeader)];\n\t\t\t\t\t\t$c_cat++;\n\t\t\t\t\t\t$local_cObj->start($catData);\n\n\t\t\t\t\t\t\t// Clear\n\t\t\t\t\t\t$markerArray = array();\n\t\t\t\t\t\t$wrappedSubpartContentArray = array();\n\n\t\t\t\t\t\t\t// Markers\n\t\t\t\t\t\t$markerArray['###CATEGORY_TITLE###'] = $local_cObj->stdWrap($this->markerObj->formatStr($catData['title']), $lConf['title_stdWrap.']);\n\t\t\t\t\t\t$markerArray['###CATEGORY_DESCRIPTION###'] = $local_cObj->stdWrap($this->markerObj->formatStr($catData['subtitle']), $lConf['subtitle_stdWrap.']);\n\t\t\t\t\t\t$markerArray['###CATEGORY_FORUMNUMBER###'] = $local_cObj->stdWrap(count($forums), $lConf['count_stdWrap.']);\n\n\t\t\t\t\t\t\t// Link to the category (wrap)\n\t\t\t\t\t\t$overrulePIvars = array();\n\t\t\t\t\t\t$pageLink = htmlspecialchars(\n\t\t\t\t\t\t\t$this->pi_linkTP_keepPIvars_url(\n\t\t\t\t\t\t\t\t$overrulePIvars,\n\t\t\t\t\t\t\t\t$this->allowCaching,\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t$catData['uid']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$wrappedSubpartContentArray['###LINK###'] = array('<a href=\"'. $pageLink .'\">','</a>');\n\n\t\t\t\t\t\t\t// Substitute\n\t\t\t\t\t\t$subpartContent .= $local_cObj->substituteMarkerArrayCached($out,$markerArray,array(),$wrappedSubpartContentArray);\n\t\t\t\t\t}\n\t\t\t\t\tif (count($forumHeader) && !$lConf['noForums']) {\n\t\t\t\t\t\t\t// Rendering forums\n\t\t\t\t\t\t$c_forum = 0;\n\t\t\t\t\t\tforeach($forums as $forumData) {\n\t\t\t\t\t\t\t$contentRow = $this->getContentRecord($forumData['uid']);\n\t\t\t\t\t\t\t$out=$forumHeader[$c_forum%count($forumHeader)];\n\t\t\t\t\t\t\t$c_forum++;\n\t\t\t\t\t\t\t$local_cObj->start($forumData);\n\n\t\t\t\t\t\t\t\t// Clear\n\t\t\t\t\t\t\t$markerArray=array();\n\t\t\t\t\t\t\t$wrappedSubpartContentArray=array();\n\n\t\t\t\t\t\t\t\t// Markers\n\t\t\t\t\t\t\t$markerArray['###FORUM_TITLE###'] = $local_cObj->stdWrap($this->markerObj->formatStr($forumData['title']), $lConf['forum_title_stdWrap.']);\n\t\t\t\t\t\t\t$markerArray['###FORUM_DESCRIPTION###'] = $local_cObj->stdWrap($this->markerObj->formatStr($forumData['subtitle']), $lConf['forum_description_stdWrap.']);\n\n\t\t\t\t\t\t\t$pid = (isset($contentRow) && is_array($contentRow) && $contentRow['pages'] ? $contentRow['pages'] : $forumData['uid']);\n\t\t\t\t\t\t\t$markerArray['###FORUM_POSTS###'] = $local_cObj->stdWrap($this->modelObj->getNumPosts($pid), $lConf['forum_posts_stdWrap.']);\n\t\t\t\t\t\t\t$markerArray['###FORUM_THREADS###'] = $local_cObj->stdWrap($this->modelObj->getNumThreads($pid), $lConf['forum_threads_stdWrap.']);\n\n\t\t\t\t\t\t\t\t// Link to the forum (wrap)\n\t\t\t\t\t\t\t$overrulePIvars = array();\n\t\t\t\t\t\t\t$pageLink = htmlspecialchars(\n\t\t\t\t\t\t\t\t$this->pi_linkTP_keepPIvars_url(\n\t\t\t\t\t\t\t\t\t$overrulePIvars,\n\t\t\t\t\t\t\t\t\t$this->allowCaching,\n\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t$forumData['uid']\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$wrappedSubpartContentArray['###LINK###'] = array('<a href=\"'. $pageLink .'\">','</a>');\n\n\t\t\t\t\t\t\t\t// LAST POST:\n\t\t\t\t\t\t\t$lastPostInfo = $this->modelObj->getLastPost($pid);\n\t\t\t\t\t\t\t$local_cObj->start($lastPostInfo);\n\t\t\t\t\t\t\tif ($lastPostInfo) {\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_AUTHOR###'] = $local_cObj->stdWrap($this->markerObj->formatStr($lastPostInfo['author']), $lConf['last_post_author_stdWrap.']);\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_DATE###'] = $local_cObj->stdWrap($this->modelObj->recentDate($lastPostInfo),$this->conf['date_stdWrap.']);\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_TIME###'] = $local_cObj->stdWrap($this->modelObj->recentDate($lastPostInfo),$this->conf['time_stdWrap.']);\n\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_AGE###'] = $local_cObj->stdWrap($this->modelObj->recentDate($lastPostInfo),$this->conf['age_stdWrap.']);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_AUTHOR###'] = '';\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_DATE###'] = '';\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_TIME###'] = '';\n\t\t\t\t\t\t\t\t$markerArray['###LAST_POST_AGE###'] = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Link to the last post\n\t\t\t\t\t\t\t$overrulePIvars = array('uid'=>$lastPostInfo['uid']);\n\t\t\t\t\t\t\t$pageLink = htmlspecialchars(\n\t\t\t\t\t\t\t\t$this->pi_linkTP_keepPIvars_url(\n\t\t\t\t\t\t\t\t\t$overrulePIvars,\n\t\t\t\t\t\t\t\t\t$this->allowCaching,\n\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t$contentRow['pid']\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$wrappedSubpartContentArray['###LINK_LAST_POST###'] = array('<a href=\"'. $pageLink.'\">','</a>');\n\n\t\t\t\t\t\t\t\t// Add result\n\t\t\t\t\t\t\t$subpartContent .= $local_cObj->substituteMarkerArrayCached($out,$markerArray,array(),$wrappedSubpartContentArray);\n\n\t\t\t\t\t\t\t\t// Rendering the most recent posts\n\t\t\t\t\t\t\tif (count($postHeader) && $lConf['numberOfRecentPosts']) {\n\t\t\t\t\t\t\t\t$recentPosts = $this->modelObj->getMostRecentPosts($forumData['uid'],intval($lConf['numberOfRecentPosts']));\n\t\t\t\t\t\t\t\t$c_post=0;\n\t\t\t\t\t\t\t\tforeach($recentPosts as $recentPost) {\n\t\t\t\t\t\t\t\t\t$out=$postHeader[$c_post % count($postHeader)];\n\t\t\t\t\t\t\t\t\t$c_post++;\n\t\t\t\t\t\t\t\t\t$local_cObj->start($recentPost);\n\n\t\t\t\t\t\t\t\t\t\t// Clear:\n\t\t\t\t\t\t\t\t\t$markerArray=array();\n\t\t\t\t\t\t\t\t\t$wrappedSubpartContentArray=array();\n\n\t\t\t\t\t\t\t\t\t\t// markers:\n\t\t\t\t\t\t\t\t\t$markerArray['###POST_TITLE###'] =\n\t\t\t\t\t\t\t\t\t\t$local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t$this->markerObj->formatStr(\n\t\t\t\t\t\t\t\t\t\t\t\t$recentPost['subject']\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t$lConf['post_title_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$markerArray['###POST_CONTENT###'] =\n\t\t\t\t\t\t\t\t\t\t$this->substituteEmoticons(\n\t\t\t\t\t\t\t\t\t\t\t$local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t\t$this->markerObj->formatStr(\n\t\t\t\t\t\t\t\t\t\t\t\t\t$recentPost['message']\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t$lConf['post_content_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$markerArray['###POST_REPLIES###'] =\n\t\t\t\t\t\t\t\t\t\t$local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t$this->modelObj->getNumReplies(\n\t\t\t\t\t\t\t\t\t\t\t\t$recentPost['pid'],\n\t\t\t\t\t\t\t\t\t\t\t\t$recentPost['uid']\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t$lConf['post_replies_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$markerArray['###POST_AUTHOR###'] =\n\t\t\t\t\t\t\t\t\t\t$local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t$this->markerObj->formatStr(\n\t\t\t\t\t\t\t\t\t\t\t\t$recentPost['author']\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t$lConf['post_author_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$markerArray['###POST_DATE###'] =\n\t\t\t\t\t\t\t\t\t\t$local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t$this->modelObj->recentDate(\n\t\t\t\t\t\t\t\t\t\t\t\t$recentPost\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t$this->conf['date_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$markerArray['###POST_TIME###'] =\n\t\t\t\t\t\t\t\t\t\t$local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t$this->modelObj->recentDate(\n\t\t\t\t\t\t\t\t\t\t\t\t$recentPost\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t$this->conf['time_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$markerArray['###POST_AGE###'] =\n\t\t\t\t\t\t\t\t\t\t$local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t$this->modelObj->recentDate(\n\t\t\t\t\t\t\t\t\t\t\t\t$recentPost\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t$this->conf['age_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Link to the post:\n\t\t\t\t\t\t\t\t\t$local_cObj->setCurrentVal($recentPost['pid']);\n\t\t\t\t\t\t\t\t\t$temp_conf=$this->typolink_conf;\n\t\t\t\t\t\t\t\t\t$temp_conf['additionalParams'] .= '&tt_board_uid=' . $recentPost['uid'];\n\t\t\t\t\t\t\t\t\t$temp_conf['useCacheHash'] = $this->allowCaching;\n\t\t\t\t\t\t\t\t\t$temp_conf['no_cache'] = !$this->allowCaching;\n\t\t\t\t\t\t\t\t\t$wrappedSubpartContentArray['###LINK###'] = $local_cObj->typolinkWrap($temp_conf);\n\n\t\t\t\t\t\t\t\t\t$overrulePIvars = array('uid' => $recentPost['uid']);\n\t\t\t\t\t\t\t\t\t$pageLink = htmlspecialchars(\n\t\t\t\t\t\t\t\t\t\t$this->pi_linkTP_keepPIvars_url(\n\t\t\t\t\t\t\t\t\t\t\t$overrulePIvars,\n\t\t\t\t\t\t\t\t\t\t\t$this->allowCaching,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t$forumData['pid']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$wrappedSubpartContentArray['###LINK###'] = array('<a href=\"' . $pageLink . '\">', '</a>');\n\t\t\t\t\t\t\t\t\t$subpartContent .=\n\t\t\t\t\t\t\t\t\t\t$local_cObj->substituteMarkerArrayCached(\n\t\t\t\t\t\t\t\t\t\t\t$out,\n\t\t\t\t\t\t\t\t\t\t\t$markerArray,\n\t\t\t\t\t\t\t\t\t\t\tarray(),\n\t\t\t\t\t\t\t\t\t\t\t$wrappedSubpartContentArray\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t// add result\n\t\t\t\t\t\t\t\t\t#$subpartContent.=$out;\t// 250902\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($forumlist) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t// Substitution:\n\t\t\t\t$content .=\n\t\t\t\t\t$local_cObj->substituteSubpart(\n\t\t\t\t\t\t$templateCode,\n\t\t\t\t\t\t'###CONTENT###',\n\t\t\t\t\t\t$subpartContent\n\t\t\t\t\t) ;\n\t\t\t} else {\n\t\t\t\t$content = $this->outMessage('No template code for ###TEMPLATE_OVERVIEW###');\n\t\t\t}\n\t\t}\n\t\treturn $content;\n\t}",
"public function mailingList() {\n $this->category = \"MAILING_LIST\";\n }",
"function plugin_initconfig_forum()\r\n{\r\n global $CONF_FORUM, $CONF_FORUM_DEFAULT;\r\n\r\n if (is_array($CONF_FORUM) && (count($CONF_FORUM) > 1)) {\r\n $CONF_FORUM_DEFAULT = array_merge($CONF_FORUM_DEFAULT, $CONF_FORUM);\r\n }\r\n $c = config::get_instance();\r\n if (!$c->group_exists('forum')) {\r\n\r\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'forum');\r\n\r\n $c->add('ff_public', NULL, 'fieldset', 0, 0, NULL, 0, true, 'forum');\r\n $c->add('registration_required', $CONF_FORUM_DEFAULT['registration_required'], 'select',\r\n 0, 0, 0, 10, true, 'forum');\r\n $c->add('registered_to_post', $CONF_FORUM_DEFAULT['registered_to_post'], 'select',\r\n 0, 0, 0, 20, true, 'forum');\r\n $c->add('allow_memberlist', $CONF_FORUM_DEFAULT['allow_memberlist'], 'select',\r\n 0, 0, 0, 30, true, 'forum');\r\n $c->add('allow_notification', $CONF_FORUM_DEFAULT['allow_notification'], 'select',\r\n 0, 0, 0, 40, true, 'forum');\r\n $c->add('notification_format', $CONF_FORUM_DEFAULT['notification_format'], 'select',\r\n 0, 0, 10, 41, true, 'forum');\r\n $c->add('show_topicreview', $CONF_FORUM_DEFAULT['show_topicreview'], 'select',\r\n 0, 0, 0, 50, true, 'forum');\r\n $c->add('showtopic_review_order', $CONF_FORUM_DEFAULT['showtopic_review_order'], 'select',\r\n 0, 0, 5, 60, true, 'forum');\r\n $c->add('allow_user_dateformat', $CONF_FORUM_DEFAULT['allow_user_dateformat'], 'select',\r\n 0, 0, 0, 70, true, 'forum');\r\n $c->add('use_pm_plugin', $CONF_FORUM_DEFAULT['use_pm_plugin'], 'select',\r\n 0, 0, 0, 80, true, 'forum');\r\n $c->add('use_autorefresh', $CONF_FORUM_DEFAULT['use_autorefresh'], 'select',\r\n 0, 0, 0, 90, true, 'forum');\r\n $c->add('autorefresh_delay', $CONF_FORUM_DEFAULT['autorefresh_delay'], 'text',\r\n 0, 0, 0, 100, true, 'forum');\r\n $c->add('show_topics_perpage', $CONF_FORUM_DEFAULT['show_topics_perpage'], 'text',\r\n 0, 0, 0, 110, true, 'forum');\r\n $c->add('show_posts_perpage', $CONF_FORUM_DEFAULT['show_posts_perpage'], 'text',\r\n 0, 0, 0, 120, true, 'forum');\r\n $c->add('show_messages_perpage', $CONF_FORUM_DEFAULT['show_messages_perpage'], 'text',\r\n 0, 0, 0, 130, true, 'forum');\r\n $c->add('show_searches_perpage', $CONF_FORUM_DEFAULT['show_searches_perpage'], 'text',\r\n 0, 0, 0, 140, true, 'forum');\r\n $c->add('showblocks', $CONF_FORUM_DEFAULT['showblocks'], 'select',\r\n 0, 0, 3, 150, true, 'forum');\r\n $c->add('usermenu', $CONF_FORUM_DEFAULT['usermenu'], 'select',\r\n 0, 0, 4, 160, true, 'forum');\r\n $c->add('menustyle', $CONF_FORUM_DEFAULT['menustyle'], 'select',\r\n 0,0,7,170, true, 'forum');\r\n $c->add('mysql4+', $CONF_FORUM_DEFAULT['mysql4+'], 'select',\r\n 0, 0, 0, 180, true, 'forum');\r\n $c->add('pre2.5_mode', $CONF_FORUM_DEFAULT['pre2.5_mode'], 'select',\r\n 0, 0, 0, 190, true, 'forum');\r\n $c->add('silent_edit_default', $CONF_FORUM_DEFAULT['silent_edit_default'], 'select',\r\n 0, 0, 0, 200, true, 'forum');\r\n $c->add('avatar_width', $CONF_FORUM_DEFAULT['avatar_width'], 'text',\r\n 0, 0, 0, 210, true, 'forum');\r\n $c->add('allow_img_bbcode', $CONF_FORUM_DEFAULT['allow_img_bbcode'], 'select',\r\n 0, 0, 0, 220, true, 'forum');\r\n $c->add('show_moderators', $CONF_FORUM_DEFAULT['show_moderators'], 'select',\r\n 0, 0, 0, 230, true, 'forum');\r\n $c->add('default_Datetime_format', $CONF_FORUM_DEFAULT['default_Datetime_format'], 'text',\r\n 0, 0, 0, 240, true, 'forum');\r\n $c->add('default_Topic_Datetime_format', $CONF_FORUM_DEFAULT['default_Topic_Datetime_format'], 'text',\r\n 0, 0, 0, 250, true, 'forum');\r\n $c->add('contentinfo_numchars', $CONF_FORUM_DEFAULT['contentinfo_numchars'], 'text',\r\n 0, 0, 0, 260, true, 'forum');\r\n $c->add('linkinfo_width', $CONF_FORUM_DEFAULT['linkinfo_width'], 'text',\r\n 0, 0, 0, 270, true, 'forum');\r\n $c->add('quoteformat', $CONF_FORUM_DEFAULT['quoteformat'], 'text',\r\n 0, 0, 0, 280, true, 'forum');\r\n $c->add('show_last_post_count', $CONF_FORUM_DEFAULT['show_last_post_count'], 'text',\r\n 0, 0, 0, 290, true, 'forum');\r\n $c->add('grouptags',$CONF_FORUM_DEFAULT['grouptags'],'*text',\r\n 0,0,NULL,300,true,'forum');\r\n\r\n $c->add('ff_attachments_settings', NULL, 'fieldset', 0, 1, NULL, 0, true,'forum');\r\n $c->add('maxattachments', $CONF_FORUM_DEFAULT['maxattachments'], 'text',\r\n 0, 1, 0, 10, true, 'forum');\r\n $c->add('uploadpath', $CONF_FORUM_DEFAULT['uploadpath'], 'text',\r\n 0, 1, 0, 20, true, 'forum');\r\n $c->add('downloadURL', $CONF_FORUM_DEFAULT['downloadURL'], 'text',\r\n 0, 1, 0, 30, true, 'forum');\r\n $c->add('fileperms', $CONF_FORUM_DEFAULT['fileperms'], 'text',\r\n 0, 1, 0, 40, true, 'forum');\r\n $c->add('max_uploadimage_width', $CONF_FORUM_DEFAULT['max_uploadimage_width'], 'text',\r\n 0, 1, 0, 50, true, 'forum');\r\n $c->add('max_uploadimage_height', $CONF_FORUM_DEFAULT['max_uploadimage_height'], 'text',\r\n 0, 1, 0, 60, true, 'forum');\r\n $c->add('max_uploadfile_size', $CONF_FORUM_DEFAULT['max_uploadfile_size'], 'text',\r\n 0, 1, 0, 70, true, 'forum');\r\n $c->add('inlineimage_width', $CONF_FORUM_DEFAULT['inlineimage_width'], 'text',\r\n 0, 1, 0, 80, true, 'forum');\r\n $c->add('inlineimage_height', $CONF_FORUM_DEFAULT['inlineimage_height'], 'text',\r\n 0, 1, 0, 90, true, 'forum');\r\n $c->add('allowablefiletypes',$CONF_FORUM_DEFAULT['allowablefiletypes'], '*text',\r\n 0,1,NULL,100,true,'forum');\r\n $c->add('inlineimageypes',$CONF_FORUM_DEFAULT['inlineimageypes'], '*text',\r\n 0,1,NULL,110,true,'forum');\r\n $c->add('filestorage_plugin', $CONF_FORUM_DEFAULT['filestorage_plugin'], 'select',\r\n 0,1,6,120, true, 'forum');\r\n\r\n $c->add('ff_topic_post_settings', NULL, 'fieldset', 0, 2, NULL, 0, true,'forum');\r\n $c->add('show_subject_length', $CONF_FORUM_DEFAULT['show_subject_length'], 'text',\r\n 0, 2, 0, 10, true, 'forum');\r\n $c->add('min_username_length', $CONF_FORUM_DEFAULT['min_username_length'], 'text',\r\n 0, 2, 0, 20, true, 'forum');\r\n $c->add('min_subject_length', $CONF_FORUM_DEFAULT['min_subject_length'], 'text',\r\n 0, 2, 0, 30, true, 'forum');\r\n $c->add('min_comment_length', $CONF_FORUM_DEFAULT['min_comment_length'], 'text',\r\n 0, 2, 0, 40, true, 'forum');\r\n $c->add('views_tobe_popular', $CONF_FORUM_DEFAULT['views_tobe_popular'], 'text',\r\n 0, 2, 0, 50, true, 'forum');\r\n $c->add('post_speedlimit', $CONF_FORUM_DEFAULT['post_speedlimit'], 'text',\r\n 0, 2, 0, 60, true, 'forum');\r\n $c->add('allowed_editwindow', $CONF_FORUM_DEFAULT['allowed_editwindow'], 'text',\r\n 0, 2, 0, 70, true, 'forum');\r\n $c->add('allow_html', $CONF_FORUM_DEFAULT['allow_html'], 'select',\r\n 0, 2, 0, 80, true, 'forum');\r\n $c->add('post_htmlmode', $CONF_FORUM_DEFAULT['post_htmlmode'], 'select',\r\n 0, 2, 0, 90, true, 'forum');\r\n $c->add('use_censor', $CONF_FORUM_DEFAULT['use_censor'], 'select',\r\n 0, 2, 0, 100, true, 'forum');\r\n $c->add('use_geshi', $CONF_FORUM_DEFAULT['use_geshi'], 'select',\r\n 0, 2, 0, 120, true, 'forum');\r\n $c->add('use_spamx_filter', $CONF_FORUM_DEFAULT['use_spamx_filter'], 'select',\r\n 0, 2, 0, 130, true, 'forum');\r\n $c->add('show_moods', $CONF_FORUM_DEFAULT['show_moods'], 'select',\r\n 0, 2, 0, 140, true, 'forum');\r\n $c->add('allow_smilies', $CONF_FORUM_DEFAULT['allow_smilies'], 'select',\r\n 0, 2, 0, 150, true, 'forum');\r\n $c->add('use_smilies_plugin', $CONF_FORUM_DEFAULT['use_smilies_plugin'], 'select',\r\n 0, 2, 0, 160, true, 'forum');\r\n\r\n $c->add('ff_centerblock', NULL, 'fieldset', 0, 3, NULL, 0, true,\r\n 'forum');\r\n $c->add('show_centerblock', $CONF_FORUM_DEFAULT['show_centerblock'], 'select',\r\n 0, 3, 0, 10, true, 'forum');\r\n $c->add('centerblock_homepage', $CONF_FORUM_DEFAULT['centerblock_homepage'], 'select',\r\n 0, 3, 0, 20, true, 'forum');\r\n $c->add('centerblock_numposts', $CONF_FORUM_DEFAULT['centerblock_numposts'], 'text',\r\n 0, 3, 0, 30, true, 'forum');\r\n $c->add('cb_subject_size', $CONF_FORUM_DEFAULT['cb_subject_size'], 'text',\r\n 0, 3, 0, 40, true, 'forum');\r\n $c->add('centerblock_where', $CONF_FORUM_DEFAULT['centerblock_where'], 'select',\r\n 0, 3, 2, 50, true, 'forum');\r\n\r\n $c->add('ff_latest_post_block', NULL, 'fieldset', 0, 4, NULL, 0, true,\r\n 'forum');\r\n $c->add('sideblock_numposts', $CONF_FORUM_DEFAULT['sideblock_numposts'], 'text',\r\n 0, 4, 0, 10, true, 'forum');\r\n $c->add('sb_subject_size', $CONF_FORUM_DEFAULT['sb_subject_size'], 'text',\r\n 0, 4, 0, 20, true, 'forum');\r\n $c->add('sb_latestpostonly', $CONF_FORUM_DEFAULT['sb_latestpostonly'], 'select',\r\n 0, 4, 0, 20, true, 'forum');\r\n\r\n $c->add('ff_notification_settings', NULL, 'fieldset', 0, 5, NULL, 0, true,\r\n 'forum');\r\n $c->add('notifyoptions_allowedGroup', $CONF_FORUM_DEFAULT['notifyoptions_allowedGroup'], 'select',\r\n 0, 5, 8, 10, true, 'forum');\r\n $c->add('notify_defaultOption', $CONF_FORUM_DEFAULT['notify_defaultOption'], 'select',\r\n 0, 5, 9, 20, true, 'forum');\r\n $c->add('notifyall_allowedGroup', $CONF_FORUM_DEFAULT['notifyall_allowedGroup'], 'select',\r\n 0, 5, 8, 30, true, 'forum');\r\n $c->add('notifyall_default', $CONF_FORUM_DEFAULT['notifyall_default'], 'select',\r\n 0, 5, 0, 40, true, 'forum');\r\n\r\n $c->add('ff_rank_settings', NULL, 'fieldset', 0, 6, NULL, 0, true,\r\n 'forum');\r\n $c->add('level1', $CONF_FORUM_DEFAULT['level1'], 'text',\r\n 0, 6, 0, 10, true, 'forum');\r\n $c->add('level1name', $CONF_FORUM_DEFAULT['level1name'], 'text',\r\n 0, 6, 0, 20, true, 'forum');\r\n $c->add('level2', $CONF_FORUM_DEFAULT['level2'], 'text',\r\n 0, 6, 0, 30, true, 'forum');\r\n $c->add('level2name', $CONF_FORUM_DEFAULT['level2name'], 'text',\r\n 0, 6, 0, 40, true, 'forum');\r\n $c->add('level3', $CONF_FORUM_DEFAULT['level3'], 'text',\r\n 0, 6, 0, 50, true, 'forum');\r\n $c->add('level3name', $CONF_FORUM_DEFAULT['level3name'], 'text',\r\n 0, 6, 0, 60, true, 'forum');\r\n $c->add('level4', $CONF_FORUM_DEFAULT['level4'], 'text',\r\n 0, 6, 0, 70, true, 'forum');\r\n $c->add('level4name', $CONF_FORUM_DEFAULT['level4name'], 'text',\r\n 0, 6, 0, 80, true, 'forum');\r\n $c->add('level5', $CONF_FORUM_DEFAULT['level5'], 'text',\r\n 0, 6, 0, 90, true, 'forum');\r\n $c->add('level5name', $CONF_FORUM_DEFAULT['level5name'], 'text',\r\n 0, 6, 0, 100, true, 'forum');\r\n }\r\n\r\n return true;\r\n}",
"function plugin_initconfig_forum()\n{\n global $CONF_FORUM, $_FORUM_DEFAULT, $_TABLES;\n\n if (is_array($CONF_FORUM) && (count($CONF_FORUM) > 1)) {\n $_FORUM_DEFAULT = array_merge($_FORUM_DEFAULT, $CONF_FORUM);\n }\n\n $c = config::get_instance();\n $n = 'forum';\n $o = 1;\n if (!$c->group_exists($n)) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, $n);\n // ----------------------------------\n $t = 0;\n $c->add('tab_main', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, $n, $t);\n $c->add('registration_required', $_FORUM_DEFAULT['registration_required'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('registered_to_post', $_FORUM_DEFAULT['registered_to_post'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('allow_notification', $_FORUM_DEFAULT['allow_notification'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_topicreview', $_FORUM_DEFAULT['show_topicreview'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('allow_user_dateformat', $_FORUM_DEFAULT['allow_user_dateformat'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('use_pm_plugin', $_FORUM_DEFAULT['use_pm_plugin'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_topics_perpage', $_FORUM_DEFAULT['show_topics_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_posts_perpage', $_FORUM_DEFAULT['show_posts_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_messages_perpage', $_FORUM_DEFAULT['show_messages_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_searches_perpage', $_FORUM_DEFAULT['show_searches_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('showblocks', $_FORUM_DEFAULT['showblocks'], 'select', 0, 0, 6, $o++, true, $n, $t);\n $c->add('usermenu', $_FORUM_DEFAULT['usermenu'], 'select', 0, 0, 7, $o++, true, $n, $t);\n //$c->add('use_themes_template', $_FORUM_DEFAULT['use_themes_template'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('likes_forum', $_FORUM_DEFAULT['likes_forum'], 'select', 0, 0, 41, $o++, true, $n, $t);\n $c->add('recaptcha', $_FORUM_DEFAULT['recaptcha'], 'select', 0, 0, 16, $o++, true, $n, $t);\n // ----------------------------------\n $t = 1;\n $c->add('tab_topicposting', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_topicposting', NULL, 'fieldset', 0, 1, NULL, 0, true, $n, $t);\n $c->add('show_subject_length', $_FORUM_DEFAULT['show_subject_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_username_length', $_FORUM_DEFAULT['min_username_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_subject_length', $_FORUM_DEFAULT['min_subject_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_comment_length', $_FORUM_DEFAULT['min_comment_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('views_tobe_popular', $_FORUM_DEFAULT['views_tobe_popular'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('post_speedlimit', $_FORUM_DEFAULT['post_speedlimit'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allowed_editwindow', $_FORUM_DEFAULT['allowed_editwindow'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allow_html', $_FORUM_DEFAULT['allow_html'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('post_htmlmode', $_FORUM_DEFAULT['post_htmlmode'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('convert_break', $_FORUM_DEFAULT['convert_break'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_censor', $_FORUM_DEFAULT['use_censor'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_glfilter', $_FORUM_DEFAULT['use_glfilter'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_geshi', $_FORUM_DEFAULT['use_geshi'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_spamx_filter', $_FORUM_DEFAULT['use_spamx_filter'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('show_moods', $_FORUM_DEFAULT['show_moods'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allow_smilies', $_FORUM_DEFAULT['allow_smilies'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_smilies_plugin', $_FORUM_DEFAULT['use_smilies_plugin'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('avatar_width', $_FORUM_DEFAULT['avatar_width'], 'text', 0, 1, 0, $o++, true, $n, $t);\n // ----------------------------------\n $t = 2;\n $c->add('tab_centerblock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_centerblock', NULL, 'fieldset', 0, 2, NULL, 0, true, $n, $t);\n $c->add('show_centerblock', $_FORUM_DEFAULT['show_centerblock'], 'select', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_homepage', $_FORUM_DEFAULT['centerblock_homepage'], 'select', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_numposts', $_FORUM_DEFAULT['centerblock_numposts'], 'text', 0, 2, 0, $o++, true, $n, $t);\n $c->add('cb_subject_size', $_FORUM_DEFAULT['cb_subject_size'], 'text', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_where', $_FORUM_DEFAULT['centerblock_where'], 'select', 0, 2, 5, $o++, true, $n, $t);\n // ----------------------------------\n $t = 3;\n $c->add('tab_sideblock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_sideblock', NULL, 'fieldset', 0, 3, NULL, 0, true, $n, $t);\n $c->add('sideblock_numposts', $_FORUM_DEFAULT['sideblock_numposts'], 'text', 0, 3, 0, $o++, true, $n, $t);\n $c->add('sb_subject_size', $_FORUM_DEFAULT['sb_subject_size'], 'text', 0, 3, 0, $o++, true, $n, $t);\n $c->add('sb_latestpostonly', $_FORUM_DEFAULT['sb_latestpostonly'], 'select', 0, 3, 0, $o++, true, $n, $t);\n\n $c->add('fs_sideblock_settings', NULL, 'fieldset', 0, 5, NULL, 0, true, $n, $t);\n $c->add('sideblock_enable', $_FORUM_DEFAULT['sideblock_enable'], 'select', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_isleft', $_FORUM_DEFAULT['sideblock_isleft'], 'select', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_order', $_FORUM_DEFAULT['sideblock_order'], 'text', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_topic_option',$_FORUM_DEFAULT['sideblock_topic_option'],'select', 0, 5, 15, $o++, true, $n, $t);\n $c->add('sideblock_topic', $_FORUM_DEFAULT['sideblock_topic'], '%select', 0, 5, NULL, $o++, true, $n, $t);\n\n $c->add('fs_sideblock_permissions', NULL, 'fieldset', 0, 6, NULL, 0, true, $n, $t);\n $new_group_id = 0;\n if (isset($_GROUPS['Forum Admin'])) {\n $new_group_id = $_GROUPS['Forum Admin'];\n } else {\n $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Forum Admin'\");\n if ($new_group_id == 0) {\n if (isset($_GROUPS['Root'])) {\n $new_group_id = $_GROUPS['Root'];\n } else {\n $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Root'\");\n }\n }\n }\n $c->add('sideblock_group_id', $new_group_id, 'select', 0, 6, NULL, $o++, true, $n, $t);\n $c->add('sideblock_permissions', $_FORUM_DEFAULT['sideblock_permissions'], '@select', 0, 6, 14, $o++, true, $n, $t);\n // ----------------------------------\n $t = 4;\n $c->add('tab_rank', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_rank', NULL, 'fieldset', 0, 4, NULL, 0, true, $n, $t);\n $c->add('level1', $_FORUM_DEFAULT['level1'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level2', $_FORUM_DEFAULT['level2'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level3', $_FORUM_DEFAULT['level3'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level4', $_FORUM_DEFAULT['level4'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level5', $_FORUM_DEFAULT['level5'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level1name', $_FORUM_DEFAULT['level1name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level2name', $_FORUM_DEFAULT['level2name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level3name', $_FORUM_DEFAULT['level3name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level4name', $_FORUM_DEFAULT['level4name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level5name', $_FORUM_DEFAULT['level5name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n // ----------------------------------\n $t = 5;\n $c->add('tab_menublock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_menublock_settings', NULL, 'fieldset', 0, 7, NULL, 0, true, $n, $t);\n $c->add('menublock_isleft', $_FORUM_DEFAULT['menublock_isleft'], 'select', 0, 7, 0, $o++, true, $n, $t);\n $c->add('menublock_order', $_FORUM_DEFAULT['menublock_order'], 'text', 0, 7, 0, $o++, true, $n, $t);\n }\n\n return true;\n}",
"function subForumListing($f3){\n\t\t\n\t\t// Sanitise forum id on address bar\n\t\t$publicId = $f3->get('PARAMS.fid');\n\t\t$publicId = $f3->scrub($publicId);\n\t\t\n\t\t// Get the forum details\n\t\t$f3->set('forumData', $f3->get('DB')->exec('\n\t\t\tSELECT `fid`, `publicId`, `grouptype`, `title`, `prompt`\n\t\t\tFROM `forum_meta`\n\t\t\tWHERE `publicId`=:publicId',\n\t\t\tarray( \n\t\t\t\t':publicId'=>$publicId\n\t\t\t)\n\t\t));\n\n\t\t// Find all of the sub-forums\n\t\t$f3->set('subforums', $f3->get('DB')->exec('\n\t\t\tSELECT \n\t\t\t\t`sub_forum`.`sfid`,\n\t\t\t\t`sub_forum`.`publicId`,\n\t\t\t\tCOUNT(`membership`.`sfid`) AS \"members\" \n\t\t\tFROM `sub_forum` \n\t\t\t\tJOIN `membership` ON `sub_forum`.`sfid` = `membership`.`sfid` \n\t\t\tWHERE \n\t\t\t\t`sub_forum`.`fid` = :fid \n\t\t\tGROUP BY \n\t\t\t\t`sub_forum`.`sfid`',\n\t\t\tarray( \n\t\t\t\t':fid'=>$f3->get('forumData')[0]['fid']\n\t\t\t)\n\t\t));\n\t\t\n\t\t// Present the list\n\t\techo Template::instance()->render('app/views/subforumlist.php');\n\t}",
"function forum_admin_show ($forum_db, $index, $sid, $level=1)\r\n{\r\n # Display our post\r\n $post = $forum_db[$index];\r\n\r\n $subject = $post['subject'];\r\n if (strpos($subject, '@') !== false)\r\n {\r\n $subject = fast_wordwrap($subject, FORUM_FORCE_WRAP_MAIN, '`');\r\n $subject = html_unicode($subject);\r\n $subject = str_replace('`', FORUM_WRAP, $subject);\r\n }\r\n else\r\n {\r\n $subject = fast_wordwrap($subject, FORUM_FORCE_WRAP_MAIN, FORUM_WRAP);\r\n }\r\n\r\n $name = $post['name'];\r\n if (strpos($name, '@') !== false)\r\n {\r\n $name = fast_wordwrap($name, FORUM_FORCE_WRAP_MAIN, '`');\r\n $name = html_unicode($name);\r\n $name = str_replace('`', FORUM_WRAP, $name);\r\n }\r\n else\r\n {\r\n $name = fast_wordwrap($name, FORUM_FORCE_WRAP_MAIN, FORUM_WRAP);\r\n }\r\n\r\n $notext = '';\r\n if ($post['notext']) $notext = FORUM_NT_MARKER.' ';\r\n\r\n if ($level == 1)\r\n print('<li class=\"forum_li1\" style=\"margin-left:'.FORUM_MARGIN_ADJUST.'; text-indent:-'.FORUM_MARGIN_ADJUST.';\">');\r\n else\r\n print('<li class=\"forum_li2\">');\r\n print('<input type=\"checkbox\" class=\"forum_default\" name=\"remove[]\" value=\"'.$post['id'].'\"> <a href=\"'.php_self().'?action=admin'.$sid.'&edit='.$post['id'].'\">'.$subject.'</a> '.$notext.' - <b>'.$name.'</b> <a href=\"'.php_self().'?action=admin'.$sid.'&removeip='.$post['ip'].'\">'.$post['ip'].'</a> <span class=\"forum_date\">('.date(DATE_FORMAT, $post['time']+TIME_OFFSET).')</span>');\r\n\r\n # If there are any replies, display them by calling ourself recursively\r\n if ($post['replies'] > 0)\r\n {\r\n print('<ul class=\"forum_ul\">');\r\n $level++;\r\n for ($i=0; $i<$post['replies']; $i++)\r\n {\r\n $index++;\r\n $index = forum_admin_show($forum_db, $index, $sid, $level);\r\n }\r\n print('</ul>'.BR);\r\n }\r\n print('</li>'.BR);\r\n\r\n # Return the updated db array index\r\n return $index;\r\n}",
"public function listForum()\n {\n $forum = QueryBuilder::for(Forum::class)\n ->allowedIncludes(['dataComment','dataUser','likers'])\n ->allowedSorts(['nama_kategori','judul','isi','image','user_id','views','status','created_at','id'])\n ->allowedFilters(['nama_kategori','judul','isi','image','user_id','views','status'])\n ->jsonPaginate()->appends(Request()->input());\n\n return new ForumCollection($forum);\n }",
"public function page_list_faq()\n\t{\n\t\t// Chargement de la FAQ\n\t\tFsb::$session->load_lang('lg_forum_faq');\n\n\t\t$list_section = array();\n\t\tforeach ($GLOBALS['faq_data'] AS $section_name => $section)\n\t\t{\n\t\t\t$list_section[$section_name] = Fsb::$session->lang('faq_section_' . $section_name);\n\t\t}\n\n\t\tFsb::$tpl->set_switch('lang_faq');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'LIST_LANG' =>\t\tHtml::list_langs('language', $this->language),\n\t\t\t'LIST_SECTION' =>\tHtml::make_list('faq_section', '', $list_section),\n\t\t));\n\n\t\t// Chargement des clefs pour la FAQ\n\t\t$sql = 'SELECT lang_key, lang_value\n\t\t\t\tFROM ' . SQL_PREFIX . 'langs\n\t\t\t\tWHERE lang_name = \\'' . $this->language . '\\'\n\t\t\t\t\tAND lang_key LIKE \\'_fsb_faq_%\\'';\n\t\t$result = Fsb::$db->query($sql, 'langs_');\n\t\twhile ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tif (preg_match('#^_fsb_faq_\\[([a-zA-Z0-9_]+?)\\]\\[([a-zA-Z0-9_]+?)\\]\\[(question|answer)\\]$#', $row['lang_key'], $match))\n\t\t\t{\n\t\t\t\t$GLOBALS['faq_data'][$match[1]][$match[2]][$match[3]] = $row['lang_value'];\n\t\t\t}\n\t\t}\n\t\tFsb::$db->free($result);\n\n\t\t// Affichage des donnees de la FAQ\n\t\tforeach ($GLOBALS['faq_data'] AS $section_name => $section)\n\t\t{\n\t\t\tFsb::$tpl->set_blocks('section', array(\n\t\t\t\t'NAME' =>\t\t$section_name,\n\t\t\t\t'TITLE' =>\t\tFsb::$session->lang('faq_section_' . $section_name),\n\t\t\t));\n\n\t\t\t// Affichage des questions / reponses\n\t\t\tforeach ($section AS $name => $item)\n\t\t\t{\n\t\t\t\tFsb::$tpl->set_blocks('section.item', array(\n\t\t\t\t\t'NAME' =>\t\t\t$name,\n\t\t\t\t\t'QUESTION' =>\t\thtmlspecialchars($item['question']),\n\t\t\t\t\t'ANSWER' =>\t\t\thtmlspecialchars($item['answer']),\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}",
"public function listTopics();",
"function flash_build_allowed_forums_list()\n{\n\t$allowed_forums = '';\n\t$forum_types = array(FORUM_POST);\n\t$forums_array = get_forums_ids($forum_types, true, false, true, true);\n\tforeach ($forums_array as $forum)\n\t{\n\t\t$allowed_forums .= (empty($allowed_forums) ? '' : ',') . $forum['forum_id'];\n\t}\n\n\treturn $allowed_forums;\n}",
"function get_wiki_list() {\n\tglobal $config;\n\t\n\t$wikis = array();\n\t\n\tforeach ($config as $k => $v) {\n\t\tif ( is_array($v) && $k != \"DEFAULT\" ) {\n\t\t\tif ( !empty($v['label']) ) $label = $v['label'];\n\t\t\telse $label = $k;\n\t\t\t\n\t\t\t$wikis[$k] = $label;\n\t\t}\n\t}\n\t\n\treturn $wikis;\n}",
"public function forum () {\n $this->category = \"FORUM\";\n }",
"function getForumSettingFormCfg() {\n return array(\n 'items' => array(\n 'forum_title' => array(\n 'label' => __('FORUM_TITLE'),\n 'type' => 'text',\n 'size' => 40\n ),\n 'forum_desc' => array(\n 'label' => __('FORUM_DESCRIPTION'),\n 'type' => 'textarea',\n 'cols' => 55,\n 'rows' => 5\n ),\n 'forum_rank_team' => array(\n 'label' => __('USE_RANK_TEAM'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_image' => array(\n 'label' => __('DISPLAY_FORUM_IMAGE'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_cat_image' => array(\n 'label' => __('DISPLAY_CATEGORY_IMAGE'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_birthday' => array(\n 'label' => __('DISPLAY_BIRTHDAY'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_gamer_details' => array(\n 'label' => __('DISPLAY_GAMER_DETAILS'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_user_details' => array(\n 'label' => __('DISPLAY_USER_DETAILS'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_labels_active' => array(\n 'label' => __('DISPLAY_LABELS'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_display_modos' => array(\n 'label' => __('DISPLAY_MODERATORS'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'thread_forum_page' => array(\n 'label' => __('NUMBER_THREAD'),\n 'type' => 'text',\n 'size' => 2,\n 'dataType' => 'integer',\n 'required' => true\n ),\n 'mess_forum_page' => array(\n 'label' => __('NUMBER_POST'),\n 'type' => 'text',\n 'size' => 2,\n 'dataType' => 'integer',\n 'required' => true\n ),\n 'hot_topic' => array(\n 'label' => __('TOPIC_HOT'),\n 'type' => 'text',\n 'size' => 2,\n 'dataType' => 'integer',\n 'required' => true\n ),\n 'post_flood' => array(\n 'label' => __('POST_FLOOD'),\n 'type' => 'text',\n 'size' => 2,\n 'dataType' => 'integer',\n 'required' => true\n ),\n 'forum_field_max' => array(\n 'label' => __('MAX_SURVEY_FIELD'),\n 'type' => 'text',\n 'size' => 2,\n 'dataType' => 'integer',\n 'required' => true\n ),\n 'forum_file' => array(\n 'label' => __('JOINED_FILES'),\n 'type' => 'checkbox',\n 'inputValue' => 'on',\n 'defaultValue' => 'off'\n ),\n 'forum_file_level' => array(\n 'label' => __('FILE_LEVEL'),\n 'type' => 'select',\n 'options' => array(\n 0 => 0,\n 1 => 1,\n 2 => 2,\n 3 => 3,\n 4 => 4,\n 5 => 5,\n 6 => 6,\n 7 => 7,\n 8 => 8,\n 9 => 9\n )\n ),\n 'forum_file_maxsize' => array(\n 'label' => __('MAX_SIZE_FILE'),\n 'type' => 'text',\n 'size' => 6,\n 'dataType' => 'integer',\n 'required' => true\n )\n ),\n 'itemsFooter' => array(\n 'submit' => array(\n 'type' => 'submit',\n 'value' => __('SEND'),\n 'inputClass' => array('button')\n )\n )\n );\n}",
"public function forum_list ($theCode, $storeObject, array $linkParams) {\n $conf = $storeObject->getConf();\n $modelObj = $storeObject->getModelObj();\n $markerObj = $storeObject->getMarkerObj();\n $languageObj = $storeObject->getLanguageObj();\n $alternativeLayouts = $storeObject->getAlternativeLayouts();\n $allowCaching = $storeObject->getAllowCaching();\n\n $local_cObj = \\JambageCom\\Div2007\\Utility\\FrontendUtility::getContentObjectRenderer();\n $local_cObj->setCurrentVal($GLOBALS['TSFE']->id);\n $forum_cObj = \\JambageCom\\Div2007\\Utility\\FrontendUtility::getContentObjectRenderer(array(), $modelObj->getTablename());\n\n if (!$storeObject->getTtBoardUid()) {\n $forumlist = 0;\t\t// set to true if this is a list of forums and not categories + forums\n if ($theCode == 'LIST_CATEGORIES') {\n // Config if categories are listed.\n $lConf = $conf['list_categories.'];\n } else {\n $forumlist = 1;\n // Config if forums are listed.\n $lConf = $conf['list_forums.'];\n $lConf['noForums'] = 0;\n }\n\n $GLOBALS['TSFE']->set_cache_timeout_default($lConf['cache_timeout'] ? intval($lConf['cache_timeout']) : 300);\n $templateCode =\n $local_cObj->getSubpart(\n $storeObject->getOrigTemplateCode(),\n '###TEMPLATE_OVERVIEW###'\n );\n\n if ($templateCode) {\n // Clear\n $subpartMarkerArray = array();\n $wrappedSubpartContentArray = array();\n\n // Getting the specific parts of the template\n $markerObj->getColumnMarkers(\n $markerArray,\n $languageObj\n );\n $templateCode =\n $local_cObj->substituteMarkerArrayCached(\n $templateCode,\n $markerArray,\n $subpartMarkerArray,\n $wrappedSubpartContentArray\n );\n\n // Getting the specific parts of the template\n $categoryHeader =\n $markerObj->getLayouts(\n $templateCode,\n $alternativeLayouts,\n 'CATEGORY'\n );\n $forumHeader =\n $markerObj->getLayouts(\n $templateCode,\n $alternativeLayouts,\n 'FORUM'\n );\n $postHeader =\n $markerObj->getLayouts(\n $templateCode,\n $alternativeLayouts,\n 'POST'\n );\n $subpartContent = '';\n\n // Getting categories\n $categories = $modelObj->getPagesInPage($storeObject->getPidList());\n $c_cat = 0;\n\n foreach ($categories as $k => $catData) {\n // Getting forums in category\n if ($forumlist) {\n $forums = $categories;\n } else {\n $forums = $modelObj->getPagesInPage($catData['uid']);\n }\n\n if (!$forumlist && count($categoryHeader)) {\n // Rendering category\n $out = $categoryHeader[$c_cat % count($categoryHeader)];\n $c_cat++;\n $local_cObj->start($catData);\n\n // Clear\n $markerArray = array();\n $wrappedSubpartContentArray = array();\n\n // Markers\n $markerArray['###CATEGORY_TITLE###'] =\n $local_cObj->stdWrap(\n $markerObj->formatStr(\n $catData['title']\n ),\n $lConf['title_stdWrap.']\n );\n $markerArray['###CATEGORY_DESCRIPTION###'] =\n $local_cObj->stdWrap(\n $markerObj->formatStr(\n $catData['subtitle']\n ),\n $lConf['subtitle_stdWrap.']\n );\n $markerArray['###CATEGORY_FORUMNUMBER###'] =\n $local_cObj->stdWrap(\n count($forums),\n $lConf['count_stdWrap.']\n );\n\n $pageLink =\n \\tx_div2007_alpha5::getPageLink_fh003(\n $storeObject->getCObj(),\n $catData['uid'],\n '',\n $linkParams,\n array('useCacheHash' => $allowCaching)\n );\n\n $wrappedSubpartContentArray['###LINK###'] =\n array('<a href=\"' . htmlspecialchars($pageLink) . '\">',\n '</a>'\n );\n\n // Substitute\n $subpartContent .=\n $local_cObj->substituteMarkerArrayCached(\n $out,\n $markerArray,\n array(),\n $wrappedSubpartContentArray\n );\n }\n\n if (count($forumHeader) && !$lConf['noForums']) {\n // Rendering forums\n $c_forum = 0;\n foreach($forums as $forumData) {\n $contentRow = $this->getContentRecord($forumData['uid']);\n $out = $forumHeader[$c_forum % count($forumHeader)];\n $c_forum++;\n $forum_cObj->start($forumData);\n\n // Clear\n $markerArray = array();\n $wrappedSubpartContentArray = array();\n\n // Markers\n $markerArray['###FORUM_TITLE###'] =\n $forum_cObj->stdWrap(\n $markerObj->formatStr(\n $forumData['title']\n ),\n $lConf['forum_title_stdWrap.']\n );\n\n $markerArray['###FORUM_DESCRIPTION###'] =\n $forum_cObj->stdWrap(\n $markerObj->formatStr(\n $forumData['subtitle']\n ),\n $lConf['forum_description_stdWrap.']\n );\n\n $pid = (\n isset($contentRow) &&\n is_array($contentRow) &&\n $contentRow['pages'] ?\n $contentRow['pages'] :\n $forumData['uid']\n );\n $markerArray['###FORUM_POSTS###'] =\n $forum_cObj->stdWrap(\n $modelObj->getNumPosts($pid),\n $lConf['forum_posts_stdWrap.']\n );\n $markerArray['###FORUM_THREADS###'] =\n $forum_cObj->stdWrap(\n $modelObj->getNumThreads($pid),\n $lConf['forum_threads_stdWrap.']\n );\n\n // Link to the forum (wrap)\n $pageLink =\n \\tx_div2007_alpha5::getPageLink_fh003(\n $storeObject->getCObj(),\n $forumData['uid'],\n '',\n $linkParams,\n array('useCacheHash' => $allowCaching)\n );\n $wrappedSubpartContentArray['###LINK###'] =\n array(\n '<a href=\"' . htmlspecialchars($pageLink) . '\">',\n '</a>'\n );\n\n // LAST POST:\n $lastPostInfo = $modelObj->getLastPost($pid);\n $forum_cObj->start($lastPostInfo);\n\n if ($lastPostInfo) {\n $markerArray['###LAST_POST_AUTHOR###'] =\n $forum_cObj->stdWrap($markerObj->formatStr($lastPostInfo['author']), $lConf['last_post_author_stdWrap.']);\n $markerArray['###LAST_POST_DATE###'] =\n $forum_cObj->stdWrap(\n $modelObj->recentDate(\n $lastPostInfo\n ),\n $conf['date_stdWrap.']\n );\n $markerArray['###LAST_POST_TIME###'] =\n $forum_cObj->stdWrap(\n $modelObj->recentDate(\n $lastPostInfo\n ),\n $conf['time_stdWrap.']\n );\n $markerArray['###LAST_POST_AGE###'] =\n $forum_cObj->stdWrap(\n $modelObj->recentDate($lastPostInfo),\n $conf['age_stdWrap.']\n );\n } else {\n $markerArray['###LAST_POST_AUTHOR###'] = '';\n $markerArray['###LAST_POST_DATE###'] = '';\n $markerArray['###LAST_POST_TIME###'] = '';\n $markerArray['###LAST_POST_AGE###'] = '';\n }\n\n // Link to the last post\n $overrulePIvars =\n array_merge(\n $linkParams,\n array('uid' => $lastPostInfo['uid'])\n );\n $pageLink =\n \\tx_div2007_alpha5::getPageLink_fh003(\n $storeObject->getCObj(),\n $contentRow['pid'],\n '',\n $overrulePIvars,\n array('useCacheHash' => $allowCaching)\n );\n\n $wrappedSubpartContentArray['###LINK_LAST_POST###'] =\n array(\n '<a href=\"' . htmlspecialchars($pageLink) . '\">',\n '</a>'\n );\n\n // Add result\n $subpartContent .=\n $forum_cObj->substituteMarkerArrayCached(\n $out,\n $markerArray,\n array(),\n $wrappedSubpartContentArray\n );\n\n // Rendering the most recent posts\n if (count($postHeader) && $lConf['numberOfRecentPosts']) {\n $recentPosts =\n $modelObj->getMostRecentPosts(\n $forumData['uid'],\n intval($lConf['numberOfRecentPosts']),\n intval($lConf['numberOfRecentDays'])\n );\n\n $c_post = 0;\n foreach($recentPosts as $recentPost) {\n $out = $postHeader[$c_post % count($postHeader)];\n $c_post++;\n $forum_cObj->start($recentPost);\n\n // Clear:\n $markerArray = array();\n $wrappedSubpartContentArray = array();\n\n // markers:\n $markerArray['###POST_TITLE###'] =\n $forum_cObj->stdWrap(\n $markerObj->formatStr(\n $recentPost['subject']\n ),\n $lConf['post_title_stdWrap.']\n );\n $markerArray['###POST_CONTENT###'] =\n $markerObj->substituteEmoticons(\n $forum_cObj->stdWrap(\n $markerObj->formatStr(\n $recentPost['message']\n ),\n $lConf['post_content_stdWrap.']\n )\n );\n $markerArray['###POST_REPLIES###'] =\n $forum_cObj->stdWrap(\n $modelObj->getNumReplies(\n $recentPost['pid'],\n $recentPost['uid']\n ),\n $lConf['post_replies_stdWrap.']\n );\n $markerArray['###POST_AUTHOR###'] =\n $forum_cObj->stdWrap(\n $markerObj->formatStr(\n $recentPost['author']\n ),\n $lConf['post_author_stdWrap.']\n );\n $markerArray['###POST_DATE###'] =\n $forum_cObj->stdWrap(\n $modelObj->recentDate(\n $recentPost\n ),\n $conf['date_stdWrap.']\n );\n $markerArray['###POST_TIME###'] =\n $forum_cObj->stdWrap(\n $modelObj->recentDate(\n $recentPost\n ),\n $conf['time_stdWrap.']\n );\n $markerArray['###POST_AGE###'] =\n $forum_cObj->stdWrap(\n $modelObj->recentDate(\n $recentPost\n ),\n $conf['age_stdWrap.']\n );\n\n // Link to the post:\n $forum_cObj->setCurrentVal($recentPost['pid']);\n $temp_conf = $storeObject->getTypolinkConf();\n $temp_conf['additionalParams'] .= '&tt_board_uid=' . $recentPost['uid'];\n $temp_conf['useCacheHash'] = $allowCaching;\n $temp_conf['no_cache'] = !$allowCaching;\n $wrappedSubpartContentArray['###LINK###'] =\n $forum_cObj->typolinkWrap($temp_conf);\n\n $overrulePIvars =\n array_merge(\n $linkParams,\n array('uid' => $recentPost['uid'])\n );\n $pageLink =\n \\tx_div2007_alpha5::getPageLink_fh003(\n $storeObject->getCObj(),\n $recentPost['pid'],\n '',\n $overrulePIvars,\n array('useCacheHash' => $allowCaching)\n );\n\n $wrappedSubpartContentArray['###LINK###'] =\n array(\n '<a href=\"' . htmlspecialchars($pageLink) . '\">',\n '</a>'\n );\n\n $subpartContent .=\n $forum_cObj->substituteMarkerArrayCached(\n $out,\n $markerArray,\n array(),\n $wrappedSubpartContentArray\n );\n }\n }\n }\n }\n if ($forumlist) {\n break;\n }\n }\n\n // Substitution:\n $content .=\n $local_cObj->substituteSubpart(\n $templateCode,\n '###CONTENT###',\n $subpartContent\n ) ;\n } else {\n $content = $this->outMessage('No template code for ###TEMPLATE_OVERVIEW###');\n }\n }\n\n return $content;\n }",
"function displayForumSearchForm() {\n global $visiteur;\n\n /* TODO :\n - jQuery autocomplete missing\n - list function of Members module missing\n\n nkTemplate_addJS(\n '$(\"#author\").autocomplete(\"index.php?file=Members&op=list\", {\n minChars:2,\n max:200\n });', 'jqueryDomReady'\n );\n */\n\n // Get Forum list (sort by Forum category)\n $dbrForum = nkDB_selectMany(\n 'SELECT FC.id AS catId, FC.nom AS catName, F.id AS forumId, F.nom AS forumName\n FROM '. FORUM_CAT_TABLE .' AS FC\n INNER JOIN '. FORUM_TABLE .' AS F\n ON F.cat = FC.id\n WHERE '. $visiteur .' >= FC.niveau AND '. $visiteur .' >= F.niveau',\n array('FC.ordre', 'FC.nom', 'F.ordre', 'F.nom')\n );\n\n // Display Forum search form\n echo applyTemplate('modules/Forum/searchForm', array(\n 'forumList' => $dbrForum\n ));\n}",
"public function configureForums() {\n\t\t$this -> forumManager = new ForumManager();\n\t\t$this -> forumManager -> configure();\n\t}",
"function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = false)\n{\n\tglobal $_CLASS;\n\tstatic $forum_rows;\n\t\n//print_r($_CLASS['forums_auth']->acl_getf('f_read'));\r\n\n\tif (empty($forum_rows))\n\t{\n\t\t// This query is identical to the jumpbox one\n\t\t$sql = 'SELECT forum_id, parent_id, forum_name, forum_type, left_id, right_id\n\t\t\tFROM ' . FORUMS_FORUMS_TABLE . ' ORDER BY left_id ASC';\n\t\t$result = $_CLASS['core_db']->query($sql);\n\n\t\twhile ($row = $_CLASS['core_db']->fetch_row_assoc($result))\n\t\t{\n\t\t\t$forum_rows[] = $row;\n\t\t}\n\t\t$_CLASS['core_db']->free_result();\n\t}\n\n\t$rowset = array();\n\n\tforeach ($forum_rows as $row)\n\t{\n\t\tif ($postable_only && $row['forum_type'] != FORUM_POST)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!$acl_list || $_CLASS['forums_auth']->acl_gets($acl_list, $row['forum_id']))\n\t\t{\n\t\t\t$rowset[] = ($id_only) ? $row['forum_id'] : $row;\n\t\t}\n\t}\n\n\treturn $rowset;\n}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $forums = $em->getRepository('ForumBundle:Forum')->findAll();\n\n return $this->render('index_admin.html.twig', array(\n 'forums' => $forums,\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTIONS Creates a fake user. To make testing easier. | public function createFakeUser(){
$email = 'user@user.com';
$lastname = 'fakeLastName';
$firstname = 'fakeFirstName';
$password = 'pwd';
$status = 2;
$password_hash = password_hash($password, PASSWORD_BCRYPT);
$this->user->setLastName($lastname);
$this->user->setFirstName($firstname);
$this->user->setEmail($email);
$this->user->setPasswordHash($password_hash);
// OPE : save info in DB
$sid = $this->user->signin();
// OPE : save session info
$_SESSION['id'] = $sid;
$_SESSION['status'] = 2;
// OPE : redirect to success page
changeLocation("?action=signinSuccess");
} | [
"private function createTestUser()\n {\n return factory(App\\User::class)->create(['email' => config('credentials.vocabulary.email'), 'password' => bcrypt(config('credentials.vocabulary.password'))]);\n }",
"protected function createTestUser() {\n\t\treturn wp_insert_user(array(\n\t\t\t'user_login' => 'test_developer',\n\t\t\t'user_pass' => '123456789',\n\t\t\t'user_email' => 'unittest@example.org',\n\t\t\t'role' => 'developer',\n\t\t\t));\n\t}",
"public function createRandomUser(){\n return factory(User::class)->create([\n 'email' => 'test'.rand(1, 100).'@example.com.unknown',\n ]);\n }",
"private function _createUser(){\r\n\r\n }",
"public function simulateUser() {}",
"public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }",
"protected function dummyUser()\n {\n $attributes = array(\n 'id' => 123,\n 'username' => 'chuckles',\n 'password' => \\Hash::make('SuperSecret'),\n 'name' => 'Dummy User',\n );\n return new GenericUser($attributes);\n }",
"private function createFakeUser()\n {\n $name = $this->faker->name;\n\n $user = config('multi-tenant.user_class')::create([\n 'name' => $name,\n 'email' => $this->faker->unique()->safeEmail,\n 'password' => bcrypt('tester'),\n ]);\n\n $add_to_tenant = $this->anticipate('Would you like to assign the user to a tenant?', ['Yes', 'No'], 'Yes');\n\n if ($add_to_tenant == 'Yes') {\n $headers = ['Name', 'ID'];\n $tenants = config('multi-tenant.tenant_class')::all('name', 'id');\n\n if($tenants->count() <= 0) {\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n } else {\n $this->table($headers, $tenants->toArray());\n\n $tenant_id = (int) $this->ask('Please enter the id of the desired tenant.');\n\n $tenant = config('multi-tenant.tenant_class')::findOrFail($tenant_id);\n\n $tenant->update(['owner_id' => $user->id]);\n\n $this->comment('The user ' . $user->email . ' is now the owner of ' . $tenant->name . ' with the password `tester`');\n }\n }\n }",
"public function testCreateMinimalUser() {\n $this->createMinimalTestUser();\n }",
"protected function dummyUser()\n\t{\n\t\t$attributes = array(\n\t\t\t'id' => 123,\n\t\t\t'username' => 'chuckles',\n\t\t\t'password' => \\Hash::make('SuperSecret'),\n\t\t\t'name' => 'Dummy User',\n\t\t);\n\t\treturn new GenericUser($attributes);\n\t}",
"private function create_test_user() {\n global $CFG;\n require_once($CFG->dirroot.'/elis/program/lib/data/user.class.php');\n\n $user = new user(array(\n 'username' => 'testuserusername',\n 'email' => 'testuser@email.com',\n 'idnumber' => 'testuseridnumber',\n 'firstname' => 'testuserfirstname',\n 'lastname' => 'testuserlastname',\n 'country' => 'CA'\n ));\n $user->save();\n }",
"public function createAUserAndBringIt()\n {\n return factory(User::class)->create();\n }",
"public function testCreateUser()\n {\n }",
"public function testCreateUser() {\n\t\t$user = $this->createUser();\n\n\t\t$this->actingAs($user)\n\t\t\t->get('/api/v1/authenticate')\n\t\t\t->receiveJson()\n\t\t\t->seeJsonStructure([\n\t\t\t\t'user' => [\n\t\t\t\t\t'id',\n\t\t\t\t\t'email',\n\t\t\t\t\t'first_name',\n\t\t\t\t\t'last_name',\n\t\t\t\t\t'created_at',\n\t\t\t\t\t'updated_at',\n\t\t\t\t],\n\t\t\t]);\n\t}",
"protected function createUser() {\n\t\t$this->u_key = null;\n\t\t$this->u_key = $this->u_obj->create();\n\t}",
"public function create_test_user()\n {\n DB::table('users')->insert([\n 'name' => 'Cypress Test',\n 'email' => 'test@cypress.dev',\n 'password' => bcrypt('test'),\n ]);\n }",
"private static function create_user($user_data){\r\n\r\n }",
"private function newUser()\n {\n return factory(User::class)->create([\n 'name' => 'John Doe',\n 'email' => 'john.doe@example.com',\n 'email_verified_at' => '2019-06-01 16:45:00',\n 'password' => Hash::make('test1234'),\n 'photo' => 'https://lorempixel.com/640/480/?65533',\n 'created_at' => '2019-06-01 16:45:00',\n 'updated_at' => '2019-06-01 16:45:00',\n 'deleted_at' => '2019-06-01 16:45:00',\n 'logged_in_at' => '2019-06-01 16:45:00',\n ]);\n }",
"public function createUser()\n {\n $user = $this->domainFactory->createUser();\n $user->addRole(User::ROLE_USER);\n return $user;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Check if window is currently hidden (only PLATFORM_DESKTOP) | function IsWindowHidden(): bool { return false; } | [
"public static function isWindowHidden() : bool {}",
"function IsShownOnScreen(){}",
"public static function isWindowFullscreen() : bool {}",
"public function canBeShown()\n {\n if (!is_null($this->_show_window)) {\n return $this->_show_window;\n }\n\n if (!$this->isOutputEnabled('Mage_AdminNotification')) {\n $this->_show_window = false;\n return false;\n }\n\n if (!$this->_isAllowed()) {\n $this->_show_window = false;\n return false;\n }\n \n if(!$this->windowLogsEnabled()) {\n $this->_show_window = false;\n return false;\n }\n\n if (is_null($this->_show_window)) {\n $this->_show_window = $this->isShow();\n }\n return $this->_show_window;\n }",
"public function isDesktop();",
"function is_desktop()\n {\n return dev::isDesktop();\n }",
"function IsWindow(){}",
"public function is_desktop () {\n\t\treturn $this->is_desktop;\n\t}",
"public function isHidden(): bool\n {\n return $this->is('visible', false);\n }",
"public function isHidden();",
"public function theSizeIsDesktop()\n {\n $this->getSession()->resizeWindow(1400, 900, 'current');\n }",
"function IsWindowChange(){}",
"public function isHidden(): bool\n {\n $location = $this->getLocation();\n if ($location === null) {\n return false;\n }\n\n return $location->getHideFromSearch();\n }",
"function IsShown(){}",
"public function isHidden()\n {\n return !$this->canShowTab();\n }",
"public function getShowInfoWindow()\n {\n return ($this->Content && !$this->HideContent);\n }",
"public function isRealInterfaceDesktop()\n {\n return ($this->defaultUserInterfaceType != self::MOBILE && $this->defaultUserInterfaceType != self::TABLET);\n }",
"protected function isInFullScreenMode() {}",
"public function getWidgetVisible();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hookable method called after Latte has been initialized. Use this method to customize the passed $latte instance, e.g. adding functions and filters. | protected function ___initLatte(Engine $latte)
{
} | [
"protected function initLatte() {\r\n $template = new Nette\\Templating\\FileTemplate;\r\n $template->setCacheStorage(new Nette\\Caching\\Storages\\PhpFileStorage(self::$cacheDir . '/latte/'));\r\n $template->registerHelperLoader('Nette\\Templating\\Helpers::loader');\r\n\r\n $class = new \\Plugins\\Latte\\MyPlugin();\r\n $template->registerHelper('changeText', array($class, 'changeText'));\r\n\r\n $template->onPrepareFilters[] = function ($template) {\r\n $template->registerFilter(new Nette\\Latte\\Engine);\r\n };\r\n return $template;\r\n }",
"public function customize_preview_init()\n {\n }",
"function lavaConstruct()\n {\n //settingActions\n $hookTag = \"settingActions\";\n add_filter( $this->_slug( \"{$hookTag}-type/skin\" ), array( $this, \"removeActions\" ), 20, 2 );\n\n //settingControl\n $hookTag = \"settingControl\";\n add_filter( $this->_slug( \"{$hookTag}-type/skin\" ), array( $this, \"addSkinsUx\" ), 10, 2 );\n\n\t\t//skinRibbons\n $hookTag = \"skinRibbons\";\n add_action( $this->_slug( \"{$hookTag}\" ), array( $this, \"addActiveRibbon\" ), 10, 2 );\n\n\t\t$hookTag = \"_templateVars_bodyClass\";\n\t\t$this->addAction( $hookTag );\n\n\t\t$hookTag = \"_templateVars\";\n\t\t$this->addAction( $hookTag );\n\n\t\t$hookTag = \"_templateVars_env\";\n\t\t$this->addAction( $hookTag );\n }",
"public function setTea()\r\n {\r\n $this->proxy->setTea();\r\n }",
"private function on_initialization() {\n\t\t$this->dir = WPPF_PLUGIN_DIR . 'cpt';\n\t\t$this->add_action( 'init@load_cpt' );\n\t}",
"function initialize()\n {\n\n // Add javascript file\n $this->addJavascript(\"assets/highlightjs/highlight.pack.min.js\");\n\n // Add CSS file\n $theme = $this->config['theme'];\n $this->addCSS(\"assets/highlightjs/styles/\" . $theme . \".css\");\n\n $snippet = \"<script>hljs.initHighlightingOnLoad();</script>\";\n\n // Add string snippet to endofbody\n $this->addSnippet('endofbody', $snippet);\n\n // Initialize the Twig function\n $this->addTwigFunction('highlight', 'twigHighlight');\n\n }",
"protected function initialize()\n {\n $this->sanitizations = [\n 'html' => new HtmlSanitization\n ];\n }",
"public function __construct() {\n\t\t$this->addHooks();\n\t}",
"public function hookInitialize()\n {\n // Register the SelectFilter controller plugin.\n $front = Zend_Controller_Front::getInstance();\n $front->registerPlugin(new SimpleVocabPlus_Controller_Plugin_Autosuggest);\n // Add translation.\n //add_translation_source(dirname(__FILE__) . '/languages');\n }",
"public function atGaletteInitStep()\n {\n $this->_step = self::STEP_GALETTE_INIT;\n }",
"public static function set_hooks() {\n\t}",
"private function add_hooks() {\n\t\tadd_filter( 'slp_get_text_string' , array( $this , 'augment_text_string' ) , 10 , 2 );\n\t}",
"function lavaConstruct()\n {\n //settingActions\n $hookTag = \"settingActions\";\n add_filter( $this->_slug( \"{$hookTag}-type/password\" ), array( $this, \"addShowPassword\" ) );\n add_filter( $this->_slug( \"{$hookTag}-tag/reset-to-default\" ), array( $this, \"addResetToDefault\" ) );\n\n //settingControl\n $hookTag = \"settingControl\";\n add_filter( $this->_slug( \"{$hookTag}-type/timeperiod\" ), array( $this, \"addTimePeriodSelector\" ), 10, 2 );\n add_filter( $this->_slug( \"{$hookTag}-type/password\" ), array( $this, \"addPasswordWrapper\" ), 10, 2 );\n add_filter( $this->_slug( \"{$hookTag}-type/checkbox\" ), array( $this, \"addCheckboxUx\" ), 10, 2 );\n add_filter( $this->_slug( \"{$hookTag}-type/text\" ), array( $this, \"addTextWrapper\" ), 10, 2 );\n add_filter( $this->_slug( \"{$hookTag}-type/select\" ), array( $this, \"addSelectUx\" ), 10, 2 );\n\t\t$this->addFilter( \"{$hookTag}-type/image\", \"addImageUx\", 10, 2 );\n $this->addFilter( \"{$hookTag}-type/color\", \"addColorUx\", 10, 2 );\n $this->addFilter( \"{$hookTag}-type/code\", \"addCodeUx\", 10, 2 );\n $this->addFilter( \"{$hookTag}-type/textarea\", \"addTextareaUx\", 10, 2 );\n\n //settingsHiddenInputs\n $hookTag = \"settingsHiddenInputs\";\n add_action( $this->_slug( \"{$hookTag}\"), array( $this, \"nonces\") );\n\n //hiddenForms\n $hooktag = \"hiddenForms\";\n $this->addFilter( \"hiddenForms\" );\n }",
"function wp_teaser_init()\r\n{\r\n\t\r\n\tif(is_admin())\r\n\t{\r\n\t\tadd_action('admin_menu', 'wp_teaser_menu');\r\n\t\tadd_action('admin_init', 'wp_teaser_options_register');\r\n\t}\r\n\telse\r\n\t{\r\n\t\tadd_filter('request', 'wp_teaser_request');\r\n\t}\r\n}",
"public static function initialize() {\r\n\t\t// Defined in /media-library-assistant/includes/class-mla-data.php\r\n\t\t//add_filter( 'mla_expand_custom_data_source', 'MLASubstitutionParameterExample::mla_expand_custom_data_source', 10, 9 );\r\n\t\tadd_filter( 'mla_expand_custom_prefix', 'MLASubstitutionParameterExample::mla_expand_custom_prefix', 10, 8 );\r\n\t\t//add_filter( 'mla_apply_custom_format', 'MLASubstitutionParameterExample::mla_apply_custom_format', 10, 2 );\r\n\r\n\t\t// Defined in /media-library-assistant/includes/class-mla-data-source.php\r\n\t\t//add_filter( 'mla_evaluate_custom_data_source', 'MLASubstitutionParameterExample::mla_evaluate_custom_data_source', 10, 5 );\r\n\r\n\t\t/*\r\n\t\t * Additional hooks defined in \"MLA Custom Field and IPTC/EXIF Mapping Actions and Filters (Hooks)\".\r\n\t\t * These are only required for the \"conditional:is_upload\" prefix processing.\r\n\t\t */\r\n\t\tadd_filter( 'mla_update_attachment_metadata_prefilter', 'MLASubstitutionParameterExample::mla_update_attachment_metadata_prefilter', 10, 3 );\r\n\t\tadd_filter( 'mla_update_attachment_metadata_postfilter', 'MLASubstitutionParameterExample::mla_update_attachment_metadata_postfilter', 10, 3 );\r\n\t}",
"function GalaxyZoo(){\r\n\t\r\n\t\t$this->add_init_hook();\r\n\t}",
"public static function init()\n {\n Phug::setRendererClassName(static::class);\n }",
"protected function beforeThemeHook(){}",
"protected function postInit()\n {\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compiles the regex necessary to capture all match types within a route. | protected function compileRegex($route)
{
$pattern = '`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`';
if (preg_match_all($pattern, $route, $matches, PREG_SET_ORDER)) {
$match_types = array(
'i' => '[0-9]++',
'a' => '[0-9A-Za-z]++',
'h' => '[0-9A-Fa-f]++',
'*' => '.+?',
'' => '[^/]++'
);
foreach ($matches as $match) {
list ($block, $pre, $type, $param, $optional) = $match;
if (isset($match_types[$type])) {
$type = $match_types[$type];
}
if ($param) {
$param = "?<{$param}>";
}
if ($optional) {
$optional = '?';
}
$replaced = "(?:{$pre}({$param}{$type})){$optional}";
$route = str_replace($block, $replaced, $route);
}
}
if (substr($route, strlen($route) - 1) != '/') {
$route .= '/?';
}
return "`^{$route}$`";
} | [
"function compile_matcher($route) {\r\n\t if (preg_match_all('`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`', $route, $matches, PREG_SET_ORDER)) {\r\n\t $match_types = array(\r\n\t 'i' => '[0-9]++',\r\n\t 'a' => '[0-9A-Za-z]++',\r\n\t 'h' => '[0-9A-Fa-f]++',\r\n\t '*' => '.+?',\r\n\t '**' => '.++',\r\n\t '' => '[^/]++'\r\n\t );\r\n\t foreach ($matches as $match) {\r\n\t list($block, $pre, $type, $param, $optional) = $match;\r\n\t\r\n\t if (isset($match_types[$type])) {\r\n\t $type = $match_types[$type];\r\n\t }\r\n\t if ($pre === '.') {\r\n\t $pre = '\\.';\r\n\t }\r\n\t //Older versions of PCRE require the 'P' in (?P<named>)\r\n\t $pattern = '(?:'\r\n\t . ($pre !== '' ? $pre : null)\r\n\t . '('\r\n\t . ($param !== '' ? \"?P<$param>\" : null)\r\n\t . $type\r\n\t . '))'\r\n\t . ($optional !== '' ? '?' : null);\r\n\t\r\n\t $route = str_replace($block, $pattern, $route);\r\n\t }\r\n\t }\r\n\t return \"`^$route$`\";\r\n\t}",
"protected function compileRoute($route)\r\n {\r\n // First escape all of the non-named param (non [block]s) for regex-chars\r\n $route = preg_replace_callback(\r\n static::ROUTE_ESCAPE_REGEX,\r\n function ($match) {\r\n return preg_quote($match[0]);\r\n },\r\n $route\r\n );\r\n\r\n // Get a local reference of the match types to pass into our closure\r\n $match_types = $this->match_types;\r\n\r\n // Now let's actually compile the path\r\n $route = preg_replace_callback(\r\n static::ROUTE_COMPILE_REGEX,\r\n function ($match) use ($match_types) {\r\n list(, $pre, $type, $param, $optional) = $match;\r\n\r\n if (isset($match_types[$type])) {\r\n $type = $match_types[$type];\r\n }\r\n\r\n // Older versions of PCRE require the 'P' in (?P<named>)\r\n $pattern = '(?:'\r\n . ($pre !== '' ? $pre : null)\r\n . '('\r\n . ($param !== '' ? \"?P<$param>\" : null)\r\n . $type\r\n . '))'\r\n . ($optional !== '' ? '?' : null);\r\n\r\n return $pattern;\r\n },\r\n $route\r\n );\r\n\r\n $regex = \"`^$route$`\";\r\n\r\n // Check if our regular expression is valid\r\n $this->validateRegularExpression($regex);\r\n\r\n return $regex;\r\n }",
"public function testRegExpConstructionParamsWithAllTypes() {\n foreach(UrlPattern::TYPES as $type=>$typeExpr) {\n $urlPattern = new UrlPattern('/foo/:id<'.$type.'>', $this->mockTransactionMap);\n $this->assertEquals('/^\\/?foo\\/(' . $typeExpr . ')\\/?$/', $urlPattern->getRegExp());\n }\n }",
"private function prepareRegex(string $route): string {\n $regex = \"^\";\n $routeParts = array_filter(explode('/', $route));\n foreach ($routeParts as $part) {\n if ($part[0] === \"{\" && $part[strlen($part) - 1] === \"}\") {\n $expression = substr($part, 1, -1);\n if (substr_count($expression, \":\") == 1) {\n $parts = explode(':', $expression);\n\n $regex = $regex . \"\\\\/(?P<\" . $parts[0] . \">\" . $parts[1] . \"+)\";\n } else {\n $regex = $regex . \"\\\\/(?P<\" . $expression . \">[^\\\\/]+)\";\n }\n } else {\n $regex = $regex . \"\\\\/\" . $part;\n }\n }\n $regex = $regex . \"$\";\n return $regex;\n }",
"private function compile()\n {\n // Check if route matches our expectations\n $parts = array();\n if (preg_match(\n '#^(?:(?P<methods>(?:(?:GET|POST|PUT|DELETE|HEAD|OPTIONS)\\|?)*)\\s)?(?P<path>[^\\s]+)$#',\n $this->Route,\n $parts\n )) {\n $this->Methods = !empty($parts['methods']) ? explode('|', trim($parts['methods'])) : null;\n $path = $parts['path'];\n } else {\n throw new \\InvalidArgumentException(\n 'Invalid route format, route should look like GET|POST /example/[i:id]'\n );\n }\n\n // No do further processing of path...\n\n if ($path[0] != '/') {\n throw new \\InvalidArgumentException(\n 'Invalid route format, path should start with /'\n );\n }\n\n // Remove trailing slash\n if (substr($path, -1) == '/') {\n $path = substr($path, 0, -1);\n }\n\n $this->Path = $path;\n\n $match_types = array(\n 'i' => '[0-9]++',\n 'a' => '[0-9A-Za-z]++',\n 'h' => '[0-9A-Fa-f]++',\n '*' => '.+?',\n '**' => '.++',\n '' => '[^/]++'\n );\n\n // Create regex that can be used for matching\n $field_names = array();\n $this->Regex = preg_replace_callback(\n '~(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)~',\n function ($part) use ($match_types, &$field_names) {\n list($match, $sep, $type, $name, $optional) = $part;\n\n // Check if type is in list of predefined types\n // else tread it als an regular expression\n\t\t\t\tif (isset($match_types[$type])) {\n\t\t\t\t\t$type= $match_types[$type];\n\t\t\t\t}\n\n // Segments can be split on / and .\n // Escape the latter\n\t\t\t\tif ($sep == '.') {\n\t\t\t\t\t$sep = '\\.';\n\t\t\t\t}\n\n // Check if we should make it a named group that can be\n // used for retrieving parameter\n if ($name != '') {\n $field_names[] = $name;\n $match_group = '(?P<' . preg_quote($name) . '>' . $type . ')';\n } else {\n $match_group = '(?:' . $type . ')';\n }\n\n // Create full regex\n $match = '(?:' . $sep . $match_group . ')' . $optional;\n\n // Return replacement\n return $match;\n\n },\n '^' . $path . '$'\n );\n\n // Save field names\n $this->FieldNames = $field_names;\n\n // Add PCRE delimiters\n $this->Regex = '~' . str_replace('~', '\\~', $this->Regex) . '~';\n\n }",
"protected function buildPatterns() {\n\t\tpreg_match_all('#{([a-z]+):([^}]+)?}#i', $this->pattern, $match);\n\n\t\t$match[3] = array();\n\t\tforeach($match[0] as $key => $trash) {\n\t\t\tif(!isset($this->arguments[$match[1][$key]])) {\n\t\t\t\t$this->arguments[$match[1][$key]] = null;\n\t\t\t}\n\n\t\t\t$this->required[$match[1][$key]] = '*';\n\n\t\t\t$match[3][$key] = '#' . $match[1][$key] . '#';\n\t\t\t$match[2][$key] = '(?P<' . $match[1][$key] . '>[' . $match[2][$key] . ']+)';\n\t\t\t$match[1][$key] = ':' . $match[1][$key];\n\t\t}\n\n\t\tif(empty($this->required)) {\n\t\t\t$this->required = $this->arguments;\n\t\t}\n\n\t\t$this->regexpUrl = $this->pattern;\n\t\t$this->regexpUrl = str_replace($match[0], $match[3], $this->regexpUrl);\n\t\t$this->regexpUrl = preg_quote($this->regexpUrl, '/');\n\t\t$this->regexpUrl = str_replace($match[3], $match[2], $this->regexpUrl);\n\n\t\tif(!empty($this->regexpUrl)) {\n\t\t\t$this->regexpUrl .= '?';\n\t\t}\n\n\t\t$this->regexpUrl = '/^' . $this->regexpUrl . '$/i';\n\t\t$this->regexpDomain = '/^' . (!empty($this->domain) ? preg_replace('/^(https?|ftp):\\/\\/([^\\/]+)\\/?/i', '$2', $this->domain) : null) . '.*$/';\n\n\t\t$this->pattern = str_replace($match[0], $match[1], $this->pattern);\n\t}",
"public function compile($regex, $user = array()){\n\t\t\t// Compile the regex from the route, making any parts optional if they aren't required.\n\t\t\t$regex = str_replace(array('(', ')'), array('(?:', ')?'), $regex);\n\n\t\t\t// Replace any modifiers that we have, :all, :num, :alpha\n\t\t\t$regex = str_replace(array(':any',':num',':alpha'), array('(.+)?','(\\d+)?','([a-zA-Z]+)?'), $regex);\n\n\t\t\t// The most important subpattern is the :special subpattern, which allows special requests.\n\t\t\t$regex = preg_replace('#:special#', '\\:(?P<special>[\\w\\d\\-\\[\\],\\.\\:/\\S]+)', $regex);\n\n\t\t\t// Replace any params with subpattern strings.\n\t\t\t$regex = preg_replace('#:(\\w+)#', '(?P<\\\\1>[0-9a-zA-Z_\\-]+)', $regex);\n\t\t\t\n\t\t\t// Any user provided regex?\n\t\t\tif(!empty($user)){\n\t\t\t\tforeach($user as $key => $value){\n\t\t\t\t\t$regex = str_replace('<' . $key . '>[0-9a-zA-Z_\\-]+', '<' . $key . '>' . $value, $regex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Replace any modifiers that we have, :all, :num, :alpha\n\t\t\t$regex = str_replace(array(':any',':num',':alpha'), array('(.+)?','(\\d+)?','([a-zA-Z]+)?'), $regex);\n\n\t\t\t// Return the compiled regex.\n\t\t\treturn '#^' . $regex . '$#';\n\t\t}",
"private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"/^\".$regex.\"$/\";\t// This REGEX will make finding exact match rather than subpatterns.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function klein_compile_route( $route ) {\n\tif ( preg_match_all( '`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`', $route, $matches, PREG_SET_ORDER ) ) {\n\t\t$match_types = array(\n\t\t\t'i' => '[0-9]++',\n\t\t\t'a' => '[0-9A-Za-z]++',\n\t\t\t'h' => '[0-9A-Fa-f]++',\n\t\t\t'*' => '.+?',\n\t\t\t'**' => '.++',\n\t\t\t'' => '[^/]+?',\n\t\t);\n\t\tforeach ( $matches as $match ) {\n\t\t\tlist( $block, $pre, $type, $param, $optional ) = $match;\n\n\t\t\tif ( isset( $match_types[ $type ] ) ) {\n\t\t\t\t$type = $match_types[ $type ];\n\t\t\t}\n\t\t\tif ( $pre === '.' ) {\n\t\t\t\t$pre = '\\.';\n\t\t\t}\n\t\t\t// Older versions of PCRE require the 'P' in (?P<named>)\n\t\t\t$pattern = '(?:' . ( $pre !== '' ? $pre : null ) . '(' . ( $param !== '' ? \"?P<$param>\" : null ) . $type . '))' . ( $optional !== '' ? '?' : null );\n\n\t\t\t$route = str_replace( $block, $pattern, $route );\n\t\t}\n\t}\n\n\treturn \"`^$route$`\";\n}",
"private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->appendSearchPath($regex);\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$regex = $this->appendDirPath($regex,$type);\n\t\t\t\t\t\t$regex = $this->wrapQuotes($regex);\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"#\".$regex.\"#s\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function compileRoute($route)\n {\n if ( ($matches = Stringify::matchAll('`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`',$route,-1,PREG_SET_ORDER)) ) {\n $matchTypes = $this->matchTypes;\n foreach ($matches as $match) {\n list($block, $pre, $type, $param, $optional) = $match;\n if ( isset($matchTypes[$type]) ) {\n $type = $matchTypes[$type];\n }\n if ( $pre === '.' ) {\n $pre = '\\.';\n }\n $optional = $optional !== '' ? '?' : null;\n // Older versions of PCRE require the 'P' in (?P<named>)\n $pattern = '(?:'\n . ($pre !== '' ? $pre : null)\n . '('\n . ($param !== '' ? \"?P<$param>\" : null)\n . $type\n . ')'\n . $optional\n . ')'\n . $optional;\n\n $route = Stringify::replace($block,$pattern,$route);\n }\n }\n return \"`^$route$`u\";\n }",
"protected function buildRegexPatterns()\n {\n $regex = [];\n $regex[self::ESCAPABLE] = self::REGEX_ESCAPABLE;\n $regex[self::ESCAPED_CHAR] = '\\\\\\\\' . $regex[self::ESCAPABLE];\n $regex[self::IN_DOUBLE_QUOTES] = '\"(' . $regex[self::ESCAPED_CHAR] . '|[^\"\\x00])*\"';\n $regex[self::IN_SINGLE_QUOTES] = '\\'(' . $regex[self::ESCAPED_CHAR] . '|[^\\'\\x00])*\\'';\n $regex[self::IN_PARENS] = '\\\\((' . $regex[self::ESCAPED_CHAR] . '|[^)\\x00])*\\\\)';\n $regex[self::REG_CHAR] = '[^\\\\\\\\()\\x00-\\x20]';\n $regex[self::IN_PARENS_NOSP] = '\\((' . $regex[self::REG_CHAR] . '|' . $regex[self::ESCAPED_CHAR] . '|\\\\\\\\)*\\)';\n $regex[self::TAGNAME] = '[A-Za-z][A-Za-z0-9-]*';\n $regex[self::BLOCKTAGNAME] = '(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)';\n $regex[self::ATTRIBUTENAME] = '[a-zA-Z_:][a-zA-Z0-9:._-]*';\n $regex[self::UNQUOTEDVALUE] = '[^\"\\'=<>`\\x00-\\x20]+';\n $regex[self::SINGLEQUOTEDVALUE] = '\\'[^\\']*\\'';\n $regex[self::DOUBLEQUOTEDVALUE] = '\"[^\"]*\"';\n $regex[self::ATTRIBUTEVALUE] = '(?:' . $regex[self::UNQUOTEDVALUE] . '|' . $regex[self::SINGLEQUOTEDVALUE] . '|' . $regex[self::DOUBLEQUOTEDVALUE] . ')';\n $regex[self::ATTRIBUTEVALUESPEC] = '(?:' . '\\s*=' . '\\s*' . $regex[self::ATTRIBUTEVALUE] . ')';\n $regex[self::ATTRIBUTE] = '(?:' . '\\s+' . $regex[self::ATTRIBUTENAME] . $regex[self::ATTRIBUTEVALUESPEC] . '?)';\n $regex[self::OPENTAG] = '<' . $regex[self::TAGNAME] . $regex[self::ATTRIBUTE] . '*' . '\\s*\\/?>';\n $regex[self::CLOSETAG] = '<\\/' . $regex[self::TAGNAME] . '\\s*[>]';\n $regex[self::OPENBLOCKTAG] = '<' . $regex[self::BLOCKTAGNAME] . $regex[self::ATTRIBUTE] . '*' . '\\s*\\/?>';\n $regex[self::CLOSEBLOCKTAG] = '<\\/' . $regex[self::BLOCKTAGNAME] . '\\s*[>]';\n $regex[self::HTMLCOMMENT] = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';\n $regex[self::PROCESSINGINSTRUCTION] = '[<][?].*?[?][>]';\n $regex[self::DECLARATION] = '<![A-Z]+' . '\\s+[^>]*>';\n $regex[self::CDATA] = '<!\\[CDATA\\[[\\s\\S]*?]\\]>';\n $regex[self::HTMLTAG] = '(?:' . $regex[self::OPENTAG] . '|' . $regex[self::CLOSETAG] . '|' . $regex[self::HTMLCOMMENT] . '|' .\n $regex[self::PROCESSINGINSTRUCTION] . '|' . $regex[self::DECLARATION] . '|' . $regex[self::CDATA] . ')';\n $regex[self::HTMLBLOCKOPEN] = '<(?:' . $regex[self::BLOCKTAGNAME] . '(?:[\\s\\/>]|$)' . '|' .\n '\\/' . $regex[self::BLOCKTAGNAME] . '(?:[\\s>]|$)' . '|' . '[?!])';\n $regex[self::LINK_TITLE] = '^(?:\"(' . $regex[self::ESCAPED_CHAR] . '|[^\"\\x00])*\"' .\n '|' . '\\'(' . $regex[self::ESCAPED_CHAR] . '|[^\\'\\x00])*\\'' .\n '|' . '\\((' . $regex[self::ESCAPED_CHAR] . '|[^)\\x00])*\\))';\n\n $this->regex = $regex;\n }",
"private function buildRegexp()\n {\n $numbers= array(\n 'min'=>'[0-5]?\\d',\n 'hour'=>'[01]?\\d|2[0-3]',\n 'day'=>'0?[1-9]|[12]\\d|3[01]',\n 'month'=>'[1-9]|1[012]',\n 'dow'=>'[0-7]'\n );\n\n foreach($numbers as $field=>$number) {\n $range= \"($number)(-($number)(\\/\\d+)?)?\";\n $field_re[$field]= \"\\*(\\/\\d+)?|$range(,$range)*\";\n }\n\n $field_re['month'].='|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec';\n $field_re['dow'].='|mon|tue|wed|thu|fri|sat|sun';\n\n $fields_re= '('.join(')\\s+(', $field_re).')';\n\n $replacements= '@reboot|@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly';\n\n return '^\\s*('.\n '$'.\n '|#'.\n '|\\w+\\s*='.\n \"|$fields_re\\s+\\S\".\n \"|($replacements)\\s+\\S\".\n ')';\n }",
"public function testRouteCompileBraces(): void\n {\n $route = new Route(\n '/fighters/{id}/move/{x}/{y}',\n ['controller' => 'Fighters', 'action' => 'move'],\n ['id' => '\\d+', 'x' => '\\d+', 'y' => '\\d+', 'pass' => ['id', 'x', 'y']]\n );\n $this->assertMatchesRegularExpression($route->compile(), '/fighters/123/move/8/42');\n\n $result = $route->match([\n 'controller' => 'Fighters',\n 'action' => 'move',\n 'id' => '123',\n 'x' => '8',\n 'y' => '42',\n ]);\n $this->assertSame('/fighters/123/move/8/42', $result);\n\n $route = new Route(\n '/images/{id}/{x}x{y}',\n ['controller' => 'Images', 'action' => 'view']\n );\n $this->assertMatchesRegularExpression($route->compile(), '/images/123/640x480');\n\n $result = $route->match([\n 'controller' => 'Images',\n 'action' => 'view',\n 'id' => '123',\n 'x' => '8',\n 'y' => '42',\n ]);\n $this->assertSame('/images/123/8x42', $result);\n }",
"public function compile() {\n\t\tforeach ($this->_params as $key => $value) {\n\t\t\tif (!strpos($key, ':')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tunset($this->_params[$key]);\n\t\t\t$this->_meta[$key] = $value;\n\t\t}\n\n\t\t$this->_match = $this->_params;\n\n\t\tif ($this->_template === '/' || $this->_template === '') {\n\t\t\t$this->_pattern = '@^/*$@';\n\t\t\treturn;\n\t\t}\n\t\t$this->_pattern = \"@^{$this->_template}\\$@\";\n\t\t$match = '@([/.])?\\{:([^:}]+):?((?:[^{]+?(?:\\{[0-9,]+\\})?)*?)\\}@S';\n\n\t\tif ($this->_config['unicode']) {\n\t\t\t$this->_pattern .= 'u';\n\t\t}\n\t\tpreg_match_all($match, $this->_pattern, $m);\n\n\t\tif (!$tokens = $m[0]) {\n\t\t\treturn;\n\t\t}\n\t\t$slashes = $m[1];\n\t\t$params = $m[2];\n\t\t$regexs = $m[3];\n\t\tunset($m);\n\t\t$this->_keys = [];\n\n\t\tforeach ($params as $i => $param) {\n\t\t\t$this->_keys[$param] = $param;\n\t\t\t$this->_pattern = $this->_regex($regexs[$i], $param, $tokens[$i], $slashes[$i]);\n\t\t}\n\t\t$this->_defaults += array_intersect_key($this->_params, $this->_keys);\n\t\t$this->_match = array_diff_key($this->_params, $this->_defaults);\n\t}",
"private function compileRegexPattern(string $path): string\n\t{\n\t\t$parts = [];\n\n\t\tforeach( \\explode(\"/\", \\trim($path, \"/\")) as $part ){\n\n\t\t\t// Is this a named parameter?\n\t\t\tif( \\preg_match(\"/{([a-z0-9_]+)(?:\\:([a-z0-9_]+))?}/i\", $part, $match) ){\n\n\t\t\t\t// Predefined pattern\n\t\t\t\tif( isset($match[2]) ){\n\t\t\t\t\t$part = Router::getPattern($match[2]);\n\n\t\t\t\t\tif( empty($part) ){\n\t\t\t\t\t\tthrow new RouteException(\"Router pattern \\\"{$match[2]}\\\" not found.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Match anything\n\t\t\t\telse {\n\t\t\t\t\t$part = \"[^\\/]+\";\n\t\t\t\t}\n\n\t\t\t\t$part = \"(?<{$match[1]}>{$part})\";\n\t\t\t}\n\n\t\t\t$parts[] = $part;\n\t\t}\n\n\t\treturn \\sprintf(\"/^%s$/\", \\implode(\"\\/\", $parts));\n\t}",
"private function compileRegexp(): void\n {\n // In the context of this sniff, these are functions that can be called without any arguments.\n $special_functions = [\n 'exit',\n 'die',\n ];\n\n // In the context of this sniff, these are functions that must be called with one or more arguments.\n $functions = array_merge([\n 'print_r',\n 'var_dump',\n 'print',\n 'echo',\n ], $special_functions);\n\n $function_list = $this->createPCREPatternList($functions);\n\n $pattern_templates = [\n '\\b(%s)\\s*\\(',\n '\\b(%s)\\s*[\"\\']',\n '\\b(%s)\\s*\\$',\n ];\n\n $patterns = [];\n\n foreach ($pattern_templates as $pattern_template) {\n $patterns[] = sprintf($pattern_template, $function_list);\n }\n\n // Add a pattern to deal with the special case of 'function' calls with no argument list at all.\n $patterns[] = '\\b(' . $this->createPCREPatternList($special_functions) . ')\\s*;';\n\n $this->regExp = '/' . implode('|', $patterns) . '/';\n }",
"public function testRouteCompileMixedPlaceholders(): void\n {\n $route = new Route(\n '/images/{open/{id}',\n ['controller' => 'Images', 'action' => 'open']\n );\n $pattern = $route->compile();\n $this->assertMatchesRegularExpression($pattern, '/images/{open/9', 'Need both {} to enable brace mode');\n $result = $route->match([\n 'controller' => 'Images',\n 'action' => 'open',\n 'id' => 123,\n ]);\n $this->assertSame('/images/{open/123', $result);\n\n $route = new Route(\n '/fighters/{id}/move/{x}/:y',\n ['controller' => 'Fighters', 'action' => 'move'],\n ['id' => '\\d+', 'x' => '\\d+', 'pass' => ['id', 'x']]\n );\n $pattern = $route->compile();\n $this->assertMatchesRegularExpression($pattern, '/fighters/123/move/8/:y');\n\n $result = $route->match([\n 'controller' => 'Fighters',\n 'action' => 'move',\n 'id' => '123',\n 'x' => '8',\n '?' => ['y' => '9'],\n ]);\n $this->assertSame('/fighters/123/move/8/:y?y=9', $result);\n }",
"static private function recompileMatch() {\n if(AngieApplication::isInDevelopment() || AngieApplication::isInDebugMode()) {\n Logger::log('Compiling match file. Routes defined: ' . count(self::$routes), Logger::INFO, 'routing');\n } // if\n \n $match_file_path = self::getCompiledMatchFilePath();\n \n $handle = fopen($match_file_path, 'w');\n if($handle) {\n fwrite($handle, \"<?php\\n \\n\");\n \n fwrite($handle, ' return function ($path, $query_string) {' . \"\\n\");\n fwrite($handle, ' $matches = null;' . \"\\n\");\n \n $routes = array_reverse(self::$routes);\n \n $counter = 0;\n foreach($routes as $route_name => $route) {\n $counter++;\n \n if($counter == 1) {\n fwrite($handle, ' if(preg_match(' . var_export($route->getRegularExpression(), true) . ', $path, $matches)) {' . \"\\n\");\n } else {\n fwrite($handle, ' } elseif(preg_match(' . var_export($route->getRegularExpression(), true) . ', $path, $matches)) {' . \"\\n\");\n } // if\n \n $name = var_export($route->getName(), true);\n $route_string = var_export($route->getRouteString(), true);\n \n $defaults = var_export($route->getDefaults(), true);\n if(strpos($defaults, \"\\n\") !== false) {\n $defaults = explode(\"\\n\", $defaults);\n foreach($defaults as $k => $v) {\n $defaults[$k] = trim($v);\n } // foreach\n \n $defaults = implode(' ', $defaults);\n } // if\n \n $parameters = $route->getNamedParameters();\n \n if(count($parameters)) {\n $parameters = var_export($parameters, true);\n } else {\n $parameters = 'array()';\n } // if\n \n fwrite($handle, ' return Router::doMatch($path, ' . $name . ', ' . $route_string . ', ' . $defaults . ', ' . $parameters . ', $matches, $query_string);' . \"\\n\");\n } // foreach\n \n fwrite($handle, \" }\\n\\n\");\n fwrite($handle, \" return array(null, null);\\n\");\n fwrite($handle, ' };');\n \n fclose($handle);\n \n if(AngieApplication::isInDevelopment() || AngieApplication::isInDebugMode()) {\n Logger::log(\"Compiled match file created at '$match_file_path'\", Logger::INFO, 'routing');\n } // if\n } else {\n throw new FileCreateError($match_file_path);\n } // if\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation siteListsSiteListIdSitesPost Add Sites to Site List | public function siteListsSiteListIdSitesPost($site_list_id, $body)
{
$this->siteListsSiteListIdSitesPostWithHttpInfo($site_list_id, $body);
} | [
"public function siteListsSiteListIdSitesPostWithHttpInfo($site_list_id, $body)\n {\n $request = $this->siteListsSiteListIdSitesPostRequest($site_list_id, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function add_site_post()\n {\n // $user_keys = array('first_name', 'last_name', 'organization_name', 'email_1', 'email_type_1', 'email_2', 'email_type_2', 'phone_1', 'phone_type_1', 'phone_2', 'phone_type_2', 'phone_3', 'phone_type_3', 'company_id', 'customer_preferred_contact');\n // $user_address_keys = array('address_type', 'address', 'address_ext', 'country', 'city', 'state', 'zipcode');\n // $site_keys = array('address', 'address_ext', 'city', 'state', 'zipcode', 'address_type'); \n\n $data = $this->post();\n $response = $this->site->add_site($data);\n $this->response($response, 200);\n }",
"public function postSite($body)\n {\n list($response) = $this->postSiteWithHttpInfo($body);\n return $response;\n }",
"public function addSite(Site $site)\n {\n $this->siteList->add($site);\n }",
"public function siteListsSiteListIdPut($site_list_id, $name = null, $active = null, $relation_type = null, $file_name = null)\n {\n $this->siteListsSiteListIdPutWithHttpInfo($site_list_id, $name, $active, $relation_type, $file_name);\n }",
"public function add_sites_to_user($user_id) {\n $data = array();\n $sites = $this->input->post('sites');\n if (is_array($sites)) {\n foreach ($sites as $site_id) {\n if ($site_id == 'none') {\n continue;\n }\n // Non-Official site\n if ($site_id == 'other') {\n $site_id = $this->get_site_by_name_or_create($this->input->post('new_site'));\n }\n\n $data[] = array('user_id' => $user_id,\n 'site_id' => $site_id);\n }\n if (count($data)) {\n $this->db->insert_batch('users2sites', $data);\n }\n }\n }",
"public function siteListsSiteListIdSitesPostAsyncWithHttpInfo($site_list_id, $body)\n {\n $returnType = '';\n $request = $this->siteListsSiteListIdSitesPostRequest($site_list_id, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function add_site($site_data) {\n $date_added = date('Y-m-d H:i:s', time());\n \n $added = $this->db_wrapper->insert_data($this->table_name, array(\n 'title' => $site_data['title'],\n 'description' => $site_data['description'],\n 'date_added' => $date_added,\n 'url' => $site_data['url'],\n 'user_added' => $site_data['user_id'],\n 'rss_ready' => $site_data['rss_ready'],\n 'feed_url' => $site_data['feed_url']\n ));\n \n if($added) {\n return $this->db_wrapper->get_insert_id();\n } else {\n return false;\n }\n }",
"public function add($name,$site = []);",
"public function actionAddSite()\n {\n $model = new PortalSites;\n\n if (isset($_POST['PortalSites']))\n {\n $user = $_POST['PortalSites'];\n \n $model->attributes = $_POST['PortalSites'];\n\n //Save site into database. \n $model->save(false);\n $this->redirect('/SeniorPortal/index.php/admin/admin');\n return;\n }\n $error = '';\n $this->render('siteCreate', array('model' => $model, 'error' => $error));\n }",
"public function setSites($sites)\n\t{\n\t\t$this->sites = /*.(array[string]string).*/ array();\n\t\tif (is_array($sites))\n\t\t{\n\t\t\tforeach ($sites as $site_id)\n\t\t\t\t$this->sites[$site_id] = $site_id;\n\t\t}\n\t\treturn $this;\n\t}",
"public function setSites(?array $sites): void\n {\n $this->sites = $sites;\n }",
"public function saveSites($sites)\n {\n $p4 = $this->p4;\n $result = $p4->run('streams');\n foreach ($result->getData() as $stream) {\n // remove any clients of this stream so we can delete it\n $clients = $p4->run('clients', array('-S', $stream['Stream']));\n foreach ($clients->getData() as $client) {\n $p4->run('client', array('-d', '-f', $client['client']));\n }\n\n $p4->run('stream', array('-d', '-f', $stream['Stream']));\n }\n\n // we're done if no sites were passed; return early\n if (empty($sites)) {\n return;\n }\n\n // remember our original test client\n // (site->setConnection will change it below)\n $client = $p4->getClient();\n\n foreach ($sites as $id => $config) {\n preg_match('#^//([^/]+)/(.+)#', $id, $matches);\n $depot = $matches[1];\n $stream = $matches[2];\n\n $input = array(\n 'Depot' => $depot,\n 'Type' => 'stream',\n 'Map' => $depot . '/...'\n );\n $result = $p4->run('depot', '-i', $input);\n\n $input = array(\n 'Stream' => $id,\n 'Name' => $stream,\n 'Parent' => 'none',\n 'Type' => 'mainline',\n 'Owner' => $p4->getUser(),\n 'Paths' => array('share ...')\n );\n $result = $p4->run('stream', '-i', $input);\n\n // write site branch config.\n $site = new P4Cms_Site;\n $site->setId($id)\n ->setConnection($p4)\n ->getConfig()\n ->setValues($config)\n ->save();\n }\n\n // force the disconnect callback(s) the site objects\n // added to run prior to setting back our client\n $p4->disconnect()->connect();\n\n // restore original client.\n $p4->setClient($client);\n }",
"public static function create(array $values) {\n\t\t$insert = array();\n\t\t\n\t\t// validate - id\n\t\tif (!isset($values['id']) || empty($values['id'])) {\n\t\t\tthrow new Yadda_Model_Exception('Please supply an ID for the new site.');\n\t\t} else {\n\t\t\t$id = trim($values['id']);\n\t\t\t$site = null;\n\t\t\ttry {\n\t\t\t\t$site = self::find($id);\n\t\t\t} catch (Yadda_Model_Exception $e) { }\n\t\t\tif ($site !== null) {\n\t\t\t\tthrow new Yadda_Model_Exception('There is already a site with the supplied ID.');\n\t\t\t}\n\t\t\t$insert['id'] = $id;\n\t\t}\n\t\t\n\t\t// validate - name\n\t\tif (!isset($values['name']) || empty($values['name'])) {\n\t\t\tthrow new Yadda_Model_Exception('Please supply a name for the new site.');\n\t\t} else {\n\t\t\t$insert['name'] = trim($values['name']);\n\t\t}\n\t\t\n\t\t// validate - url\n\t\tif (!isset($values['url']) || empty($values['url'])) {\n\t\t\tthrow new Yadda_Model_Exception('Please provide a URL for this site.');\n\t\t} else {\n\t\t\t$url = trim($values['url']);\n\t\t\ttry {\n\t\t\t\t$uri = Zend_Uri::factory($url);\n\t\t\t} catch (Zend_Uri_Exception $e) {\n\t\t\t\tthrow new Yadda_Model_Exception('Please provide a valid URL for the new site.');\n\t\t\t}\n\t\t\t$insert['url'] = $url;\n\t\t}\n\t\t\n\t\t// insert\n\t\t$siteDb = Yadda_Db_Table::getInstance('site');\n\t\t$siteDb->getAdapter()->beginTransaction();\n\t\ttry {\n\t\t\t$siteId = $siteDb->insert($insert + array(\n\t\t\t\t'created' => Yadda_Db::now()\n\t\t\t));\n\t\t\t$siteDb->getAdapter()->commit();\n\t\t} catch (Exception $e) {\n\t\t\t$siteDb->getAdapter()->rollBack();\n\t\t}\n\t\t\n\t\treturn $siteId;\n\t}",
"public function domainsPost($body)\n {\n list($response) = $this->domainsPostWithHttpInfo($body);\n return $response;\n }",
"public function addSite() {\n\t\t$site = $this->owner->getNewItem('new-Site-0', false);\n\t\t$site->write();\n\n\t\treturn $this->owner->redirect(\n\t\t\tsingleton('CMSPageEditController')->Link(\"show/$site->ID\")\n\t\t);\n\t}",
"protected function _loadSiteData()\n {\n $this->utility->saveSites(\n array(\n $this->_qualifySiteId('basic') => array(\n 'urls' => array(\n 'basic.com',\n 'www.basic.com'\n )\n ),\n $this->_qualifySiteId('other') => array(\n 'urls' => array(\n 'othersite.com'\n )\n ),\n $this->_qualifySiteId('subdir') => array(\n 'urls' => array(\n 'subdir.com/foo'\n )\n ),\n $this->_qualifySiteId('secure') => array(\n 'urls' => array(\n 'https://secure.com'\n )\n )\n )\n );\n }",
"protected function siteListsSiteListIdSitesGetRequest($site_list_id, $limit, $offset)\n {\n // verify the required parameter 'site_list_id' is set\n if ($site_list_id === null || (is_array($site_list_id) && count($site_list_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $site_list_id when calling siteListsSiteListIdSitesGet'\n );\n }\n // verify the required parameter 'limit' is set\n if ($limit === null || (is_array($limit) && count($limit) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $limit when calling siteListsSiteListIdSitesGet'\n );\n }\n // verify the required parameter 'offset' is set\n if ($offset === null || (is_array($offset) && count($offset) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $offset when calling siteListsSiteListIdSitesGet'\n );\n }\n\n $resourcePath = '/site_lists/{site_list_id}/sites';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n\n\n // path params\n if ($site_list_id !== null) {\n $resourcePath = str_replace(\n '{' . 'site_list_id' . '}',\n ObjectSerializer::toPathValue($site_list_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api_key');\n if ($apiKey !== null) {\n $queryParams['api_key'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createSite($data)\n\t{\n\t\t## create site first.\n\t\t$data_site\t= Array(\n\t\t\t\t\t\"siteName\"=>$data['siteName'],\n\t\t\t\t\t\"siteSlug\"=>$data['siteSlug'],\n\t\t\t\t\t\"siteCreatedDate\"=>now(),\n\t\t\t\t\t\"siteCreatedUser\"=>session::get(\"userID\"),\n\t\t\t\t\t\"stateID\"=>$data['stateID'],\n\t\t\t\t\t\"siteRefID\"=>$data['siteRefID']\n\t\t\t\t\t\t\t);\n\n\t\tdb::insert(\"site\",$data_site);\n\n\t\t$siteID\t= db::getLastID(\"site\",\"siteID\");\n\n\t\t## create site_manager.\n\t\tforeach($data['userID'] as $userID)\n\t\t{\n\t\t\t$data_manager\t= Array(\n\t\t\t\t\t\"siteID\"=>$siteID,\n\t\t\t\t\t\"userID\"=>$userID,\n\t\t\t\t\t\"siteManagerCreatedDate\"=>now(),\n\t\t\t\t\t\"siteManagerCreatedUser\"=>session::get(\"userID\"),\n\t\t\t\t\t\"siteManagerStatus\"=>1\n\t\t\t\t\t\t\t\t);\n\n\t\t\tdb::insert(\"site_manager\",$data_manager);\n\t\t}\n\n\t\t## create site_info\n\t\t$data_siteinfo\t= Array(\n\t\t\t\t\t\"siteID\"=>$siteID,\n\t\t\t\t\t\"siteInfoPhone\"=>$data['siteInfoPhone'],\n\t\t\t\t\t\"siteInfoFax\"=>$data['siteInfoFax'],\n\t\t\t\t\t\"siteInfoLatitude\"=>$data['siteInfoLatitude'],\n\t\t\t\t\t\"siteInfoLongitude\"=>$data['siteInfoLongitude'],\n\t\t\t\t\t\"siteInfoAddress\"=>$data['siteInfoAddress'],\n\t\t\t\t\t\"siteInfoDescription\"=>$data['siteInfoDescription']\n\t\t\t\t\t\t\t\t);\n\n\t\tdb::insert(\"site_info\",$data_siteinfo);\n\n\t\t## create menu for the site.\n\t\t### comp 1 ### pages\n\t\t# create page type 1, about-us.\n\t\t$page\t\t= model::load(\"page/page\");\n\t\t$menu\t\t= model::load(\"site/menu\");\n\n\t\t\t$data_page\t= Array(\n\t\t\t\t\t\t\"pageApprovedStatus\"=>1,\n\t\t\t\t\t\t\"pageName\"=>\"\",\n\t\t\t\t\t\t\"pageSlug\"=>\"\",\n\t\t\t\t\t\t\"pageText\"=>\"Page ini masih baru. Sila kemaskini terlebih dahulu\",\n\t\t\t\t\t\t\"pageDefaultType\"=>1, # about-us and about us\n\t\t\t\t\t\t\t\t);\n\n\t\t\t## insert and return pageID\n\t\t\t$pageID\t\t= $page->create($siteID,1,$data_page);\n\n\t\t# create menu\n\t\t$data_menu\t= Array(\n\t\t\t\t\t\"menuName\"=>\"Tentang Kami\",\n\t\t\t\t\t\"menuType\"=>1,#top menu\n\t\t\t\t\t\"menuNo\"=>2,\n\t\t\t\t\t\"menuRefID\"=>$pageID\n\t\t\t\t\t\t\t);\n\t\t$menu->create($siteID,1,$data_menu);\n\n\t\t\t# create page type 2, about-manager, children to the about-us.\n\t\t\t$data_page\t= Array(\n\t\t\t\t\t\t\"pageParentID\"=>$pageID,\n\t\t\t\t\t\t\"pageApprovedStatus\"=>1,\n\t\t\t\t\t\t\"pageName\"=>\"\",\n\t\t\t\t\t\t\"pageText\"=>\"Page ini masih baru. Sila kemaskini terlebih dahulu\",\n\t\t\t\t\t\t\"pageSlug\"=>\"\",\n\t\t\t\t\t\t\"pageDefaultType\"=>2 #tentang pengurus\n\t\t\t\t\t\t\t\t);\n\t\t\t$page->create($siteID,1,$data_page);\n\n\t\t\t# create page type 2, ajk-kampung, children to about-us\n\t\t\t$data_page\t= Array(\n\t\t\t\t\t\t\"pageParentID\"=>$pageID,\n\t\t\t\t\t\t\"pageApprovedStatus\"=>1,\n\t\t\t\t\t\t\"pageText\"=>\"Page ini masih baru. Sila kemaskini terlebih dahulu\",\n\t\t\t\t\t\t\"pageName\"=>\"\",\n\t\t\t\t\t\t\"pageSlug\"=>\"\",\n\t\t\t\t\t\t\"pageDefaultType\"=>3 #ajk kampung.\n\t\t\t\t\t\t\t\t);\n\t\t\t$page->create($siteID,1,$data_page);\n\n\t\t### comp 2 ### main landing.\n\t\t$data_menu\t= Array(\n\t\t\t\t\t\"menuName\"=>\"Utama\",\n\t\t\t\t\t\"menuType\"=>1,\n\t\t\t\t\t\"menuNo\"=>1\n\t\t\t\t\t\t\t);\n\n\t\t$menu->create($siteID,2,$data_menu);\n\n\t\t### comp 3 ### activity\n\t\t$data_menu\t= Array(\n\t\t\t\t\t\"menuName\"=>\"Aktiviti\",\n\t\t\t\t\t\"menuType\"=>1,\n\t\t\t\t\t\"menuNo\"=>3\n\t\t\t\t\t\t\t);\n\t\t$menu->create($siteID,3,$data_menu);\n\n\t\t### comp 4 ### members.\n\t\t$data_menu\t= Array(\n\t\t\t\t\t\"menuName\"=>\"Ruangan Ahli\",\n\t\t\t\t\t\"menuType\"=>1,\n\t\t\t\t\t\"menuNo\"=>4\n\t\t\t\t\t\t\t);\n\t\t$menu->create($siteID,4,$data_menu);\n\n\t\t### comp 6 ### blog.\n\t\t$data_menu\t= Array(\n\t\t\t\t\t\"menuName\"=>\"Blog\",\n\t\t\t\t\t\"menuType\"=>1,\n\t\t\t\t\t\"menuNo\"=>5\n\t\t\t\t\t\t\t);\n\t\t$menu->create($siteID,6,$data_menu);\n\n\t\t### comp 5 ### contact us.\n\t\t$data_menu\t= Array(\n\t\t\t\t\t\"menuName\"=>\"Hubungi Kami\",\n\t\t\t\t\t\"menuType\"=>1,\n\t\t\t\t\t\"menuNo\"=>6\n\t\t\t\t\t\t\t);\n\t\t$menu->create($siteID,5,$data_menu);\n\n\t\t// initiate default pages other than the specified 3 above.\n\t\t$defaultPages = orm('page/page_default')->execute();\n\t\torm('site/site')->find($siteID)->initiateDefaultPages($defaultPages);\n\n\t\t// *** Start API to create new site in AVEO ***\n\n\t\t// Create new location & site\n\n\t\t$url = apps::config('aveo');\n\n\t //1: create, 2: update\n\t $process = 1;\n\n\t $id = $siteID;\n\t $name = $data['siteName'];\n\t $address = $data['siteInfoAddress'];\n\t $code = $data['siteRefID'];\n\t $state_id = $data['stateID'];\n\n\t $myvars = 'process=' . $process;\n\t $myvars .= '&id=' . $id;\n\t $myvars .= '&name=' . $name;\n\t $myvars .= '&address=' . $address;\n\t $myvars .= '&code=' . $code;\n\t $myvars .= '&state_id=' . $state_id;\n\n\t $ch = curl_init( $url );\n\t curl_setopt( $ch, CURLOPT_POST, 1);\n\t curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);\n\t curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);\n\t curl_setopt( $ch, CURLOPT_HEADER, 0);\n\t curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t $response = curl_exec( $ch );\n\n\t // Update manager\n\n\t $url = 'http://localhost/aveo/app/controllers/api/user.php';\n\n\t //1: create, 2: update, 3: change password, 4: delete, 5: update location\n\t $process = 5;\n\n\t $id = $userID;\n\t $location_id = $siteID;\n\n\t $myvars = 'process=' . $process;\n\t $myvars .= '&id=' . $id;\n\t $myvars .= '&location_id=' . $location_id;\n\n\t $ch = curl_init( $url );\n\t curl_setopt( $ch, CURLOPT_POST, 1);\n\t curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);\n\t curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);\n\t curl_setopt( $ch, CURLOPT_HEADER, 0);\n\t curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t $response = curl_exec( $ch );\n\n\n\t\t// *** End API to create new site in AVEO ***\n\n\t\treturn $this->getSite($siteID);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Answers a string of meta image caption class names for the template. | public function getMetaImageCaptionClass()
{
return ViewTools::singleton()->array2att($this->owner->getMetaImageCaptionClassNames());
} | [
"public function getMetaImageCaptionClassNames()\n {\n $classes = ['caption'];\n \n if ($alignment = $this->owner->getMetaImageAlignment()) {\n $classes[] = $alignment;\n }\n \n return $classes;\n }",
"public function getMetaImageWrapperClassNames()\n {\n $classes = [$this->owner->MetaImageCaptionShown ? 'captionImage' : 'image'];\n \n if ($alignment = $this->owner->getMetaImageAlignment()) {\n $classes[] = $alignment;\n }\n \n return $classes;\n }",
"public function getMetaImageWrapperClass()\n {\n return ViewTools::singleton()->array2att($this->owner->getMetaImageWrapperClassNames());\n }",
"public function getImageClassNames()\n {\n $classes = array_merge(\n parent::getImageClassNames(),\n $this->styles('image.fluid', 'carousel.image')\n );\n \n return $classes;\n }",
"function caption() {\n\t\treturn 'caption';\n\t}",
"public function getCaptionClass() {\n if (null != $this->captionClass) {\n return $this->captionClass;\n }\n $_ve = $this->getValueExpression(\"captionClass\");\n if ($_ve != null) {\n return $_ve->getValue($this->getFacesContext()->getELContext());\n } else {\n return null;\n }\n }",
"public function getCaption()\n {\n return isset($this->image_meta['image_meta']['caption']) ? $this->image_meta['caption'] : null;\n }",
"public function getCaptionClassNames(Slide $slide)\n {\n $classes = $this->styles('carousel.caption');\n \n if ($this->HideCaptionsOnMobile) {\n $classes[] = $this->style('carousel.hide-mobile');\n }\n \n return $classes;\n }",
"public function getPreviewImageClassName()\n {\n $className = 'ec-editor-previewImage';\n // Check for a page 2 (back)\n $orientation = 'landscape';\n foreach ($this->_customizableDesigns as $page => $design) {\n if (2 == $design->orientation) {\n $orientation = 'portrait';\n }\n $sku = $design->product->sku;\n }\n $className .= '-' . $sku . '-' . $orientation;\n return $className;\n }",
"function getCaption() { return $this->imageObject['caption']; }",
"protected function getClassName()\n {\n return 'img-polaroid';\n }",
"function zuhaus_mikado_get_title_holder_classes() {\n\t\t$page_id = zuhaus_mikado_get_page_id();\n\t\t$title_type_meta = zuhaus_mikado_get_meta_field_intersect( 'title_area_type', $page_id );\n\t\t$title_type = ! empty( $title_type_meta ) ? $title_type_meta : 'standard';\n\t\t$title_in_grid_meta = zuhaus_mikado_get_meta_field_intersect( 'title_area_in_grid', $page_id );\n\t\t$title_img = zuhaus_mikado_get_meta_field_intersect( 'title_area_background_image', $page_id );\n\t\t$title_img_behavior = zuhaus_mikado_get_meta_field_intersect( 'title_area_background_image_behavior', $page_id );\n\t\t\n\t\t$classes = array();\n\t\t\n\t\t$classes[] = 'mkdf-' . $title_type . '-type';\n\t\t\n\t\tif ( $title_in_grid_meta === 'no' ) {\n\t\t\t$classes[] = 'mkdf-title-full-width';\n\t\t}\n\t\t\n\t\tif ( ! empty( $title_img ) && $title_img_behavior !== 'hide' ) {\n\t\t\t$classes[] = 'mkdf-preload-background';\n\t\t\t$classes[] = 'mkdf-has-bg-image';\n\t\t\t\n\t\t\tif ( ! empty( $title_img_behavior ) ) {\n\t\t\t\t$classes[] = 'mkdf-bg-' . $title_img_behavior;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $title_img_behavior === 'parallax-zoom-out' ) {\n\t\t\t\t$classes[] = 'mkdf-bg-parallax';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn implode( ' ', apply_filters( 'zuhaus_mikado_title_holder_classes', $classes ) );\n\t}",
"function flow_elated_quote_bck_img_class(){\n\t\t\n\t\t$class = '';\n\t\t\n\t\tif(has_post_thumbnail()){\n\t\t\t$class = 'eltd-quote-bck-img';\n\t\t}\n\t\t\n\t\tprint $class;\n\t\t\n\t}",
"function voyage_mikado_title_classes($classes = array()) {\n\t\t$classes = array();\n\t\t$classes = apply_filters('voyage_mikado_title_classes', $classes);\n\n\t\tif(is_array($classes) && count($classes)) {\n\t\t\techo implode(' ', $classes);\n\t\t}\n\t}",
"function _govstrap_custom_token_caption($attr, $extras = NULL, $tag) {\n $output = '';\n\n if (strpos($extras, '<img') !== FALSE) {\n $output = '<div class=\"caption\">';\n $output .= $extras;\n $output .= \"</div>\";\n }\n\n return $output;\n}",
"public function getMediaClassNames()\n {\n $classes = [$this->MediaType];\n \n if ($this->MediaType == 'video') {\n $classes[] = $this->VideoAspect;\n }\n \n if ($this->CaptionShown) {\n $classes[] = $this->style('figure.image');\n }\n \n $this->extend('updateMediaClassNames', $classes);\n \n return $classes;\n }",
"function biagiotti_mikado_get_title_holder_classes() {\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$title_type_meta = biagiotti_mikado_get_meta_field_intersect( 'title_area_type', $page_id );\n\t\t$title_type = ! empty( $title_type_meta ) ? $title_type_meta : 'standard';\n\t\t$title_in_grid_meta = biagiotti_mikado_get_meta_field_intersect( 'title_area_in_grid', $page_id );\n\t\t$title_img = biagiotti_mikado_get_meta_field_intersect( 'title_area_background_image', $page_id );\n\t\t$title_img_behavior = biagiotti_mikado_get_meta_field_intersect( 'title_area_background_image_behavior', $page_id );\n\t\t$title_img_size_optimize_touch = biagiotti_mikado_get_meta_field_intersect( 'title_area_background_image_size_optimize_touch', $page_id );\n\t\t$title_vertical_alignment = biagiotti_mikado_get_meta_field_intersect( 'title_area_vertical_alignment', $page_id );\n\t\t\n\t\t$classes = array();\n\t\t\n\t\t$classes[] = 'mkdf-' . $title_type . '-type';\n\t\t\n\t\tif ( $title_in_grid_meta === 'no' ) {\n\t\t\t$classes[] = 'mkdf-title-full-width';\n\t\t}\n\t\t\n\t\tif ( ! empty( $title_vertical_alignment ) ) {\n\t\t\t$classes[] = 'mkdf-title-va-' . $title_vertical_alignment;\n\t\t}\n\t\t\n\t\tif ( ! empty( $title_img ) && $title_img_behavior !== 'hide' ) {\n\t\t\t$classes[] = 'mkdf-preload-background';\n\t\t\t$classes[] = 'mkdf-has-bg-image';\n\t\t\t\n\t\t\tif ( ! empty( $title_img_behavior ) ) {\n\t\t\t\t$classes[] = 'mkdf-bg-' . $title_img_behavior;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $title_img_behavior === 'parallax-zoom-out' ) {\n\t\t\t\t$classes[] = 'mkdf-bg-parallax';\n\t\t\t}\n\n\t\t\tif ( $title_img_size_optimize_touch === 'yes' ) {\n\t\t\t\t$classes[] = 'mkdf-bg-touch-cover';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn implode( ' ', apply_filters( 'biagiotti_mikado_filter_title_holder_classes', $classes ) );\n\t}",
"protected function generateClassName()\n\t{\n\t // Set the first required className\n\t\t$className = 'notice';\n\n\t\t// Add specific className from type\n $noticeTypeName = strtolower(trim($this->type));\n if( in_array($noticeTypeName, $this->allowedTypes) ) $className .= ' notice-' . $noticeTypeName;\n\n // Add specific className for a removable notice\n if( true === $this->isRemovable ) $className .= ' is-dismissible';\n\n\t\treturn $className;\n\t}",
"public function getCssClasses(): string\n {\n // Basic classes\n $class = ['portfolio', make_css_name($this->type)];\n\n if ($this->isInteresting()) {\n $class[] = 'interesting';\n }\n\n if ($this->isRunning()) {\n $class[] = 'running';\n }\n\n return implode(' ', $class);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates an existing PostHistory model. If update is successful, the browser will be redirected to the 'view' page. | public function actionUpdate($id)
{
if (!\Yii::$app->user->can('cmsPostHistoriesUpdate')) {
throw new ForbiddenHttpException('You do not have privileges to view this content.');
}
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
} | [
"public function actionUpdate()\n\t{\n\t\t$post=$this->loadPost();\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\tif(isset($_POST['Post']))\n\t\t\t\t$post->setAttributes($_POST['Post']);\n\t\t\tif($post->save())\n\t\t\t\t$this->redirect(array('show','id'=>$post->id));\n\t\t}\n\t\t$this->render('update',array('post'=>$post));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->indoor_history_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n $model = $this->findModel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \\Yii::$app->getSession()->setFlash('success', $this->getFlashMsg('success'));\n return $this->redirect(ArrayHelper::merge(['view'], $model->getPrimaryKey(true)));\n } else {\n if ($model->hasErrors()) {\n \\Yii::$app->getSession()->setFlash('error', $this->getFlashMsg('error'));\n }\n return $this->render($this->viewID, [\n 'model' => $model,\n ]);\n }\n }",
"public function updatePost()\n {\n $route = $this->router->getRoute();\n\n if ( $route[1] != 'updatePost' ){\n $this->template('Errors/404');\n\n } else {\n $idPost = intval( $route[2] );\n $data = $this->postManager->readPost($idPost);\n\n $this->writePost($data); \n }\n }",
"public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n return $this->refresh();\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id,$historyId)\n {\n $model = Cms::findOne($id);\n \n /**\n * 注意此处为ajax验证,需要在html中的$form->field($model, 'identityNumber',['enableAjaxValidation'=>true])...\n * 多用于验证规则复杂或者需要调用后端接口的时候\n */\n if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post()))\n {\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return \\yii\\widgets\\ActiveForm::validate($model);\n }\n\n if ($model->load(Yii::$app->request->post()) ) {\n Tools::checkRepeatSubmit();\n \n $model->time = time();\n $model->layout = Yii::$app->params['activityConf'][$model->platform][$model->activity]['layout'];\n \n if(CmsHistory::createHistory($id) && $model->save()) {\n return $this->redirect(['//cms/index']);\n }\n } else {\n $historyModel = $this->findModel($historyId);\n $model->template = $historyModel->template;\n \n $history = new CmsHistory();\n $dataProvider = $history->getCmsHistoryById($id);\n $platform = isset($_COOKIE['platform']) ? $_COOKIE['platform'] : setcookie('platform',1 , time() + 3600 * 24 * 30, '/');\n foreach(Yii::$app->params['activityConf'][$platform] as $key => $val){\n $activity[$key] = Yii::t('app',$val['name']);\n }\n return $this->render('//cms/update', [\n 'model' => $model,\n 'activity' => $activity,\n 'dataProvider' => $dataProvider,\n ]);\n }\n }",
"private function postHistory()\n {\n /* @var User $user */\n $user = $this->data['user'];\n\n foreach ($_POST['history'] as &$item) {\n $item = array_map('sanitize_text_field', $item);\n }\n\n $user->history = $_POST['history'];\n $user->save();\n\n FlashMessage::add(FlashMessage::TYPE_SUCCESS, 'Historie wurde erfolgreich gespeichert.');\n Helpers::redirect(str_replace('&edit=1', '', $_SERVER['REQUEST_URI']));\n }",
"public function actionUpdate()\n {\n $post = Yii::$app->request->post();\n\n $model = $this->findModel($post['InsightsDef']['name']);\n $content = InsightsContent::findOne($post['InsightsContent']['id']);\n\n if ($model->load($post)) {\n $priorityCounter = 0;\n foreach ($post['InsightsDef'] as $key => $value) {\n if (!in_array($key, ['id', 'id_category', 'priority', 'hospitals', 'units', 'specialities', 'name']) && $value != '') {\n $priorityCounter++;\n }\n }\n $model->priority = $priorityCounter;\n $model->save();\n $content->load($post);\n $content->save();\n }\n return $this->redirect(['create', 'idCategory' => $model->id_category, 'id' => $model->id]);\n }",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post(),'') && $model->save()) {\n return $this->success();\n }\n\n return $this->fail();\n }",
"public function actionUpdate($id) \r\n\r\n\t{\r\n\t\t$model = $this->findModel ( $id );\r\n\t\t\r\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\r\n\t\t\treturn $this->redirect ( [ \r\n\t\t\t\t\t'view',\r\n\t\t\t\t\t'id' => $model->followID \r\n\t\t\t] );\r\n\t\t} else {\r\n\t\t\treturn $this->render ( 'update', [ \r\n\t\t\t\t\t'model' => $model \r\n\t\t\t] );\r\n\t\t}\r\n\t}",
"public function actionUpdate()\n {\n $purifier = new HtmlPurifier;\n $param = $purifier->process(Yii::$app->request->get('id'));\n $model = $this->findModel($param);\n\n //if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->idperscom]);\n //}\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"protected function addPostHistory(Posts $model)\n {\n $model->clearCache();\n\n if (!container()->has('session')) {\n return;\n }\n\n if (!container('session')->isStarted()) {\n return;\n }\n\n // In case of updating post through creating PostsViews\n if (!container('session')->has('identity')) {\n return;\n }\n\n $history = new PostsHistory([\n 'posts_id' => $model->id,\n 'users_id' => container('session')->get('identity'),\n 'content' => $model->content,\n ]);\n\n if (!$history->save()) {\n $reason = [];\n\n foreach ($history->getMessages() as $message) {\n /** @var \\Phalcon\\Mvc\\Model\\MessageInterface $message */\n $reason[] = $message->getMessage();\n }\n\n container('logger')->error('Unable to store post history. Post id: {id}. Reason: {reason}', [\n 'id' => $model->id,\n 'reason' => implode('. ', $reason)\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->logId]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionEdit() {\n if (Yii::app()->request->getParam('id')\n && ( $model = WikiPages::model()->byUser()->findByPk(Yii::app()->request->getParam('id')) )\n && ($revisionModel = WikiPagesRev::model()->find('pageid=:pageid AND revisionid=:revisionid', array(':pageid' => $model->id, ':revisionid' => $model->workingrevision)))) {\n if (isset($_POST['WikiPages'])) {\n // Add description to the activity\n if ($_POST['WikiPages']['title'] != $model->title) {\n $model->activity['description'] = 'Changed title from <strong>{old}</strong> to <strong>{new}</strong>';\n $model->activity['params']['{old}'] = $model->title;\n $model->activity['params']['{new}'] = $_POST['WikiPages']['title'];\n }\n\n $newRevisionModel = new WikiPagesRev;\n $model->setAttributes($_POST['WikiPages']);\n $newRevisionModel->setAttributes($_POST['WikiPagesRev']);\n $revisionModel->setAttributes($_POST['WikiPagesRev']);\n // Did we submit the form?\n if (isset($_POST['submit'])) {\n if ($model->validate() && $newRevisionModel->validate()) {\n $model->workingrevision++;\n $model->save();\n $newRevisionModel->pageid = $model->id;\n $newRevisionModel->save();\n // Update working revision\n Activity::$toSave = false;\n $model->update();\n // Flash and redirect\n Functions::setFlash(Yii::t('wiki', 'Wiki: Page Updated.'));\n $this->redirect(array('/wiki'));\n }\n }\n }\n\n // Blank comment\n $revisionModel->comment = '';\n\n // Add title\n $this->pageTitle[] = Yii::t('wiki', 'Editing Wiki Page');\n $this->render('edit', array('model' => $model, 'revisionModel' => $revisionModel));\n } else {\n $this->redirect(array('/wiki'));\n }\n }",
"public function actionUpdate()\n {\n /** @var User $model */\n $model = $this->loadOrCreateModel('content\\models\\User');\n\n if ($model->load($_POST)) {\n if ($model->save()) {\n $this->flash = \"{$model->name} successful saved\";\n return $this->redirect(['index']);\n }\n $this->errorFlash = 'Error saving';\n }\n\n\n $this->pageTitle = $model->isNewRecord ? 'Create new ' : ('Edit ' . $model->name);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function updatePosts();",
"public function updated(CandidacyHistory $candidacyHistory)\n {\n //\n }",
"public function updating(Posts $Posts)\n {\n //code...\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \tMsgUtils::success();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n \t'vipBlogTypeList' => $this->findVipBlogTypeList(),\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Add flags and structures to a "pages tree" in respect of the current page within that tree. Takes a "pages tree", as produced by user/getpagestree and adds the necessary flags, returning the tree again. TODO: would probably be more efficient if the pages tree could be passed by reference. | function publications_userapi_addcurrentpageflags($args)
{
extract($args);
if (empty($pagedata) || empty($id)) {return array();}
$targetpagekey = false;
foreach ($pagedata['pages'] as $key => $page) {
if ($page['id'] == $id) {
$targetpagekey = true;
break;
}
}
if (!$targetpagekey) return array();
if (empty($root_ids) || !is_array($root_ids)) {
$root_ids = array();
}
// Set up a bunch of flags against pages to allow hierarchical menus
// to be generated. We do not want to make any assumptions here as to
// how the menus will look and function (i.e. what will be displayed,
// what will be suppressed, hidden etc) but rather just provide flags
// that allow a template to build a menu of its choice.
//
// The basic flags are:
// 'depth' - 0 for root, counting up for each subsequent level
// 'is_ancestor' - flag indicates an ancestor of the current page
// 'is_child' - flag indicates a child of the current page
// 'is_sibling' - flag indicates a sibling of the current page
// 'is_ancestor_sibling' - flag indicates a sibling of an ancestor of the current page
// 'is_current' - flag indicates the current page
// 'is_root' - flag indicates the page is a root page of the hierarchy - good
// starting point for menus
// 'has_children' - flag indicates a page has children [done in getpagestree]
//
// Any page will have a depth flag, and may have one or more of the
// remaining flags.
// NOTE: with the exception of the following, all the above flags are
// set in previous loops.
// Point the current page at the page in the tree.
$pagedata['current_page'] =& $pagedata['pages'][$key];
// Create an ancestors array.
// Shift the pages onto the start of the array, so the resultant array
// is in order furthest ancestor towards the current page.
// The ancestors array includes the current page.
// TODO: stop at a non-ACTIVE page. Non-ACTIVE pages act as blockers
// in the hierarchy.
// Ancestors will include self - filter out in the template if required.
$pagedata['ancestors'] = array();
$this_id = $key;
// TODO: allow a 'virtual root' to stop before we reach the real root page. Used
// when we are filtering lower sections of a tree. Physically remove pages that
// do not fall into this range.
// This *could* happen if a root page is set to INACTIVE and a child page is
// set as a module alias.
$ancestor_ids = array();
while (true) {
// Set flag for menus.
$pagedata['pages'][$this_id]['is_ancestor'] = true;
// Record the id, so we don't accidently include this page again.
array_unshift($ancestor_ids, $this_id);
// Reference the page. Note we are working back down the tree
// towards the root page, so will unshift each page to the front
// of the ancestors array.
array_unshift($pagedata['ancestors'], NULL);
$pagedata['ancestors'][0] =& $pagedata['pages'][$this_id];
// Get the parent page.
try {
$id_ancestor = $pagedata['pages'][$this_id]['parent_key'];
} catch (Exception $e) {
$id_ancestor = 0;
}
// If there is no parent, then stop.
// Likewise if this is a page we have already seen (infinite loop protection).
if ($id_ancestor == 0 || in_array($id_ancestor, $ancestor_ids) || in_array($this_id, $root_ids)) {
// Make a note of the final root page.
$root_id = $this_id;
// Since we have reached the 'root' page for the purposes
// of this ancestry, make sure this root page has no parents
// by resetting any parent links.
$pagedata['pages'][$this_id]['parent_key'] = 0;
// Reference the root page in the main structure.
$pagedata['root_page'] =& $pagedata['pages'][$root_id];
// Finished the loop.
break;
}
// Move to the parent page and loop.
$this_id = $id_ancestor;
}
// Create a 'children' array for children of the current page.
$pagedata['children'] = array();
if (!empty($pagedata['current_page']['child_keys'])) {
foreach ($pagedata['current_page']['child_keys'] as $key => $child) {
// Set flag for menus. The flag 'is_child' means the page is a
// child of the 'current' page.
$pagedata['pages'][$key]['is_child'] = true;
// Reference the child page from the children array.
$pagedata['children'][$key] =& $pagedata['pages'][$child];
}
}
// TODO: create a 'siblings' array.
// Siblings are the children of the current page parent.
// The root page will have no siblings, as we want to keep this in
// a single tree.
// Siblings will include self - filter out in the template if necessary.
$pagedata['siblings'] = array();
if (!empty($pagedata['current_page']['parent_key']) && isset($pagedata['pages'][$pagedata['current_page']['parent_key']]['child_keys'])) {
// Loop though all children of the parent.
foreach ($pagedata['pages'][$pagedata['current_page']['parent_key']]['child_keys'] as $key => $child) {
// Set flag for menus.
$pagedata['pages'][$key]['is_sibling'] = true;
// Reference the page.
$pagedata['siblings'][$key] =& $pagedata['pages'][$child];
}
}
// Go through each ancestor and flag up the siblings of those ancestors.
// They will be all pages that are children of the ancestors, assuming the
// root ancestor does not have any siblings.
foreach($pagedata['ancestors'] as $key => $value) {
if (isset($value['child_keys']) && is_array($value['child_keys'])) {
foreach($value['child_keys'] as $value2) {
$pagedata['pages'][$value2]['is_ancestor_sibling'] = true;
}
}
}
$pagedata['id'] = $this_id;
$pagedata['pages'][$this_id]['is_current'] = true;
return $pagedata;
} | [
"protected function getPageTreeStructure()\n {\n // Get page record for tree starting point\n // from where we currently are navigated\n $startingPoint = $GLOBALS['TSFE']->rootLine[0]['uid'];\n $pageRecord = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord(\n 'pages',\n $startingPoint\n );\n\n // Create and initialize the tree object\n $tree = new \\TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView();\n $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));\n\n // Creating the icon for the current page and add it to the tree\n $html = $this->iconFactory->getIconForRecord(\n 'pages',\n $pageRecord,\n Icon::SIZE_SMALL\n );\n\n $tree->tree[] = [\n 'row' => $pageRecord,\n 'HTML' => $html\n ];\n\n // Create the page tree, from the starting point, infinite levels down\n $tree->getTree(\n $startingPoint\n );\n\n return $tree->tree;\n }",
"protected function initializeTree()\n {\n $tree = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Backend\\\\Tree\\\\View\\\\PageTreeView');\n /** @var \\TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView $tree */\n $tree->addField('nav_title', true);\n $tree->addField('alias', true);\n $tree->addField('tx_realurl_pathsegment', true);\n $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));\n\n $treeStartingPoint = intval($this->pObj->id);\n $treeStartingRecord = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', $treeStartingPoint);\n \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::workspaceOL('pages', $treeStartingRecord);\n\n // Creating top icon; the current page\n $tree->tree[] = array(\n 'row' => $treeStartingRecord,\n 'HTML' => $tree->getIcon($treeStartingRecord)\n );\n\n // Create the tree from starting point:\n if ($this->pObj->MOD_SETTINGS['depth'] > 0) {\n $tree->getTree($treeStartingPoint, $this->pObj->MOD_SETTINGS['depth'], '');\n }\n return $tree;\n }",
"function get_pages($root,$level,$current,$edit=\"\")\n {\n $page=get_page($root);\n if ($page[\"pageDisplay\"]==1&&authorised($page))\n {\n if ($edit==\"edit\")\n {\n echo \"<a href='/page-edit/\".$page[\"pageID\"].\"'>\".$page[\"title\"].\"</a>\";\n }\n else\n {\n echo \"<a href='/\".$page[\"URL\"].\"'>\";\n if ($page[\"pageID\"]==$current[\"pageID\"])\n echo \"<span id='h\".$page[\"pageID\"].\"nav' class='nav_sel left'>\";\n else\n echo \"<span id='h\".$page[\"pageID\"].\"nav' class='nav left'>\";\n \n if ($page[\"pageID\"]==1) $title=\"Home\"; \n elseif ($page[\"pageID\"]==41) $title=\"Contact Us\"; \n elseif ($page[\"pageID\"]==42) $title=\"Prices\"; \n elseif ($page[\"pageID\"]==44) $title=\"Blog\";\n elseif ($page[\"pageID\"]==49) $title=\"About Us\";\n else $title=$page[\"title\"];\n \n echo $title;\n echo \"</span>\";\n echo \"</a>\";\n }\n }\n $count_subs=site_query(\"select * from Page where parentID=\".$root.\" order by pageOrder\",\"get_pages() - count subs query\");\n if (mysql_num_rows($count_subs)>0)\n {\n $level=$level+1;\n while ($sub=mysql_fetch_array($count_subs))\n get_pages($sub[\"pageID\"],$level,$current);\n }\n }",
"function savePageTree() {\n\t\t\t$timeNow = time();\n\t\t\t$userId = $GLOBALS['BE_USER']->user['uid'];\n\t\t\t$pageTree = $this->t3dkptw['page'];\n\t\t\t$parentId = $this->t3dkptw['parentPage'];\n\t\t\tif (is_array($pageTree)) {\n\t\t\t\t \n\t\t\t\t$saveData = array(\n\t\t\t\t\t'pid' => intval($parentId),\n\t\t\t\t\t'title' => 'TS Templates',\n\t\t\t\t\t'doktype' => 254,\n\t\t\t\t\t'crdate' => $timeNow,\n\t\t\t\t\t'tstamp' => $timeNow,\n\t\t\t\t\t'cruser_id' => $userId,\n\t\t\t\t\t'perms_userid' => $userId,\n\t\t\t\t\t'perms_user' => 31,\n\t\t\t\t\t'perms_group' => 27,\n\t\t\t\t\t'SYS_LASTCHANGED' => $timeNow,\n\t\t\t\t\t'sorting' => 100000000 );\n\t\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('pages', $saveData);\n\t\t\t\t$this->TScontainerID = $GLOBALS['TYPO3_DB']->sql_insert_id();\n\t\t\t\t$this->savePageTreeLevel($pageTree, $parentId, $userId, $timeNow);\n\t\t\t}\n\t\t}",
"public function add_pages() {\r\n\t\tif ( ! doing_action( 'admin_menu' ) || ! $this->pages ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tforeach ( $this->pages as $page ) {\r\n\t\t\t$this->add_page( $page, $this->toplevel );\r\n\t\t}\r\n\t}",
"public function &getFullPageTree() {\n\t\tif ($this->fullPageTree !== null) {\n\t\t\treturn $this->fullPageTree;\n\t\t}\n\t\t\n\t\t$identifier = 'tx_contentstage_ContentRepository_getFullPageTree_' . $this->tag;\n\t\tif (TX_CONTENTSTAGE_USECACHE && $this->cache->has($identifier)) {\n\t\t\t$this->fullPageTree = $this->cache->get($identifier);\n\t\t\treturn $this->fullPageTree;\n\t\t}\n\t\t$this->log->log($this->translate('pageTree.rebuild', array($this->tag)), Tx_CabagExtbase_Utility_Logging::INFORMATION);\n\t\t\n\t\t$res = $this->db->exec_SELECT_queryArray(array(\n\t\t\t'SELECT' => implode(', ', $this->fieldNames),\n\t\t\t'FROM' => 'pages',\n\t\t\t'WHERE' => '',\n\t\t\t'GROUPBY' => '',\n\t\t\t'ORDERBY' => 'sorting ASC',\n\t\t\t'LIMIT' => ''\n\t\t));\n\t\t$tree = array();\n\t\t$index = array();\n\t\t$index[0]['_children'] = &$tree;\n\t\t\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$uid = intval($row['uid']);\n\t\t\t\n\t\t\tif (isset($index[$uid]) && isset($index[$uid]['_children'])) {\n\t\t\t\t$row['_children'] = &$index[$uid]['_children'];\n\t\t\t} else {\n\t\t\t\t$row['_children'] = array();\n\t\t\t}\n\t\t\t\n\t\t\t$index[$uid] = &$row;\n\t\t\t$index[intval($row['pid'])]['_children'][intval($row['uid'])] = &$row;\n\t\t\tunset($row);\n\t\t}\n\t\t\n\t\tif (TX_CONTENTSTAGE_USECACHE) {\n\t\t\t$this->cache->set($identifier, $index, array(), TX_CONTENTSTAGE_CACHETIME);\n\t\t}\n\t\t$this->fullPageTree = &$index;\n\t\t$this->log->log($this->translate('pageTree.rebuilt', array($this->tag)), Tx_CabagExtbase_Utility_Logging::INFORMATION);\n\t\treturn $index;\n\t}",
"function _menu_sub_pages_default_page_manager_pages() {\n $page = new stdClass;\n $page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */\n $page->api_version = 1;\n $page->name = 'sub_page';\n $page->task = 'page';\n $page->admin_title = 'Add a sub page';\n $page->admin_description = '';\n $page->path = 'node/%node/add_sub_page';\n $page->access = array(\n 'plugins' => array(\n '0' => array(\n 'name' => 'node_type',\n 'settings' => array(\n 'type' => array(\n 'page' => 'page',\n ),\n ),\n 'context' => 'argument_nid_1',\n ),\n '1' => array(\n 'name' => 'perm',\n 'settings' => array(\n 'perm' => 'create page content',\n ),\n 'context' => 'logged-in-user',\n ),\n '2' => array(\n 'name' => 'node_menu_depth',\n 'settings' => array(\n 'menu' => 'primary-links',\n 'menu_depth' => 'p2',\n ),\n 'context' => 'argument_nid_1',\n ),\n ),\n 'logic' => 'and',\n );\n $page->menu = array(\n 'type' => 'tab',\n 'title' => 'Add Sub Page',\n 'name' => 'navigation',\n 'weight' => '10',\n 'parent' => array(\n 'type' => 'none',\n 'title' => '',\n 'name' => 'navigation',\n 'weight' => '0',\n ),\n );\n $page->arguments = array(\n 'node' => array(\n 'id' => 1,\n 'identifier' => 'Node: ID',\n 'name' => 'nid',\n 'settings' => array(),\n ),\n );\n $page->conf = array();\n $page->default_handlers = array();\n $handler = new stdClass;\n $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */\n $handler->api_version = 1;\n $handler->name = 'page_sub_page_menu_context';\n $handler->task = 'page';\n $handler->subtask = 'sub_page';\n $handler->handler = 'menu_context';\n $handler->weight = 0;\n $handler->conf = array(\n 'title' => 'Context Admin',\n 'no_blocks' => FALSE,\n 'css_id' => '',\n 'css' => '',\n 'contexts' => array(),\n 'relationships' => array(),\n 'context_admin_options' => 'node_create_menu',\n 'context_admin_options_items' => 'page',\n 'context_admin_sub_page' => 1,\n );\n $page->default_handlers[$handler->name] = $handler;\n $pages['sub_page'] = $page;\n\n return $pages;\n\n}",
"private function SaveNew()\n {\n $treeBuilder = new TreeBuilder(new PageTreeProvider($this->site));\n $treeBuilder->Insert($this->page, $this->parent, $this->previous);\n }",
"function ouwiki_build_tree(&$index) {\n // Set up new data to fill\n foreach ($index as $indexitem) {\n $indexitem->linksto = array();\n $indexitem->children = array();\n }\n\n // Preprocess: build links TO as well as FROM\n foreach ($index as $indexitem) {\n foreach ($indexitem->linksfrom as $fromid) {\n $index[$fromid]->linksto[] = $indexitem->pageid;\n }\n }\n\n // Begin with top level, which is first in results\n reset($index);\n $index[key($index)]->placed = true;\n $nextlevel = array(reset($index)->pageid);\n do {\n $thislevel = $nextlevel;\n $nextlevel = array();\n foreach ($thislevel as $sourcepageid) {\n foreach ($index[$sourcepageid]->linksto as $linkto) {\n if (empty($index[$linkto]->placed)) {\n $index[$linkto]->placed = true;\n $index[$sourcepageid]->children[] = $linkto;\n $nextlevel[] = $linkto;\n }\n }\n }\n } while (count($nextlevel) > 0);\n}",
"function smarty_function_pages_tree($params, &$smarty) {\n $user = array_var($params, 'user');\n if(!instance_of($user, 'User')) {\n return new InvalidParamError('user', $user, '$user is expected to be an instance of User class', true);\n } // if\n \n $smarty->assign('_show_visibility', array_var($params, 'show_visibility', true));\n \n $pages = array_var($params, 'pages');\n if(is_foreachable($pages)) {\n $result = \"<table class=\\\"pages_tree\\\">\\n\";\n foreach($pages as $page) {\n $result .= _pages_tree_render_cell($page, $user, $smarty);\n } // foreach\n return \"$result\\n</table>\";\n } // if\n }",
"function buildTreeLanguageVariantNow($objPages, $intLevel = 0)\n{\n global $objModelFolders, $core;\n\n foreach ($objPages as $objPage) {\n\n for ($i = 0; $i < ($intLevel * 2); $i++) {\n echo \"-\";\n }\n echo $objPage->id . ' :: ' . $objPage->elementType . ' :: ' . $objPage->title . '|' . $objPage->guiTitle . ' :: ' . $objPage->genericFormId . ' :: ' . $objPage->templateId . \"\\n\";\n\n switch ($objPage->elementType) {\n case 'folder':\n $objNewPage = $objModelFolders->loadChildNavigation($objPage->id);\n buildFolderLanguageVariant($objPage);\n buildTreeLanguageVariantNow($objNewPage, ($intLevel + 1));\n break;\n case 'page':\n buildPageLanguageVariant($objPage);\n break;\n }\n }\n}",
"public function setAndMakeRoomForNewPage(Page $page)\n {\n if ( ! $page->parent->rgt) {\n $this->addToNestedSet($page->parent);\n }\n\n $parentRgt = $page->parent->rgt;\n\n $page->lft = $parentRgt;\n $page->rgt = $parentRgt + 1;\n\n $page->level = $page->parent->getLevel() + 1;\n\n $this->db->update(Page::TABLE, [Page::FIELD_RGT], [new RawValue(\"rgt + 2\")], \"rgt >= \" . $parentRgt);\n $this->db->update(Page::TABLE, [Page::FIELD_LFT], [new RawValue(\"lft + 2\")], \"lft >= \" . $parentRgt);\n }",
"function smarty_function_reorder_pages_tree($params, &$smarty) {\n $user = array_var($params, 'user');\n if(!instance_of($user, 'User')) {\n return new InvalidParamError('user', $user, '$user is expected to be an instance of User class', true);\n } // if\n \n $smarty->assign('_show_visibility', array_var($params, 'show_visibility', true));\n \n $pages = array_var($params, 'pages');\n if(is_foreachable($pages)) {\n $result = \"<ul class=\\\"reorder_pages_tree\\\">\\n\";\n foreach($pages as $page) {\n $result .= _pages_reorder_tree_render_cell($page, $user, $smarty);\n } // foreach\n return \"$result\\n</ul>\";\n } // if\n }",
"function socialwiki_build_tree($page, $node, &$keys) {\n $content = array();\n static $icon;\n $icon = new pix_icon('f/odt', '');\n $pages = socialwiki_get_linked_pages($page->id);\n foreach ($pages as $p) {\n $key = $page->id . ':' . $p->id;\n if (in_array($key, $keys)) {\n break;\n }\n array_push($keys, $key);\n $l = socialwiki_parser_link($p);\n $link = new moodle_url('/mod/socialwiki/view.php', array('pageid' => $p->id));\n // navigation_node::get_content will format the title for us\n $nodeaux = $node->add($p->title, $link, null, null, null, $icon);\n if ($l['new']) {\n $nodeaux->add_class('socialwiki_newentry');\n }\n socialwiki_build_tree($p, $nodeaux, $keys);\n }\n $content[] = $node;\n return $content;\n}",
"public function _edit_tree()\n {\n if (get_option('wiki_enable_children') == '0') {\n warn_exit(do_lang_tempcode('INTERNAL_ERROR'));\n }\n\n $_title = get_screen_title('WIKI_EDIT_TREE');\n\n $_id = get_param_wiki_chain('id');\n $id = $_id[0];\n\n if (!has_category_access(get_member(), 'wiki_page', strval($id))) {\n access_denied('CATEGORY_ACCESS');\n }\n\n $child_links = post_param_string('children');\n\n $member = get_member();\n check_privilege('wiki_manage_tree', array('wiki_page', $id));\n\n $hide_posts = $GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'hide_posts', array('id' => $id));\n $page_title = $GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'title', array('id' => $id));\n if (get_option('wiki_enable_content_posts') == '0') {\n $hide_posts = 1;\n }\n\n if ((substr($child_links, -1, 1) != \"\\n\") && (strlen($child_links) > 0)) {\n $child_links .= \"\\n\";\n }\n $no_children = substr_count($child_links, \"\\n\");\n if ($no_children > 300) {\n warn_exit(do_lang_tempcode('TOO_MANY_WIKI_CHILDREN'));\n }\n $start = 0;\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('parent_id' => $id));\n require_code('seo2');\n for ($i = 0; $i < $no_children; $i++) {\n $length = strpos($child_links, \"\\n\", $start) - $start;\n $new_link = trim(substr($child_links, $start, $length));\n $start = $start + $length + 1;\n if ($new_link != '') {\n // Find ID and title\n $q_pos = strpos($new_link, '=');\n $child_id_on_start = (($q_pos !== false) && ($q_pos > 0) && (is_numeric(substr($new_link, 0, $q_pos))));\n\n if ($child_id_on_start) { // Existing\n $title = substr(substr($new_link, $q_pos + 1), 0, 255);\n $child_id = intval(substr($new_link, 0, $q_pos));\n if ($child_id == $id) {\n continue;\n }\n $title_id = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $child_id));\n if (is_null($title_id)) {\n attach_message(do_lang_tempcode('BROKEN_WIKI_CHILD_LINK', strval($child_id)), 'warn');\n continue;\n }\n if ($title == '') {\n $title = get_translated_text($title_id);\n } else {\n if (get_translated_text($title_id) != $title) {\n require_code('urls2');\n suggest_new_idmoniker_for('wiki', 'browse', strval($child_id), '', $title);\n $GLOBALS['SITE_DB']->query_update('wiki_pages', lang_remap('title', $title_id, $title), array('id' => $child_id), '', 1);\n }\n }\n } else { // New\n $title = substr($new_link, 0, 255);\n $child_id = wiki_add_page($title, '', '', $hide_posts, null, null, 0, '', '', null, false);\n\n require_code('permissions2');\n set_global_category_access('wiki_page', $child_id);\n\n require_code('notifications2');\n copy_notifications_to_new_child('wiki', strval($id), strval($child_id));\n }\n\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('parent_id' => $id, 'child_id' => $child_id), '', 1); // Just in case it was repeated\n $GLOBALS['SITE_DB']->query_insert('wiki_children', array('parent_id' => $id, 'child_id' => $child_id, 'the_order' => $i, 'title' => $title));\n\n require_code('notifications2');\n copy_notifications_to_new_child('wiki', strval($id), strval($child_id));\n }\n }\n\n log_it('WIKI_EDIT_TREE', strval($id), get_translated_text($page_title));\n\n // Show it worked / Refresh\n $url = get_param_string('redirect');\n return redirect_screen($_title, $url, do_lang_tempcode('SUCCESS'));\n }",
"function mindmap_extend_settings_navigation(settings_navigation $settings, navigation_node $mindmap) {\n global $PAGE;\n}",
"public function pageItemTree($parent, $output = '')\n {\n $this->db->join('language', 'language.language_code = page.language_code', 'LEFT');\n $this->db->where('parent_id', $parent);\n $this->db->where('page.language_code', 'en');\n $this->db->order_by('sort_order', 'ASC');\n $query = $this->db->get('page');\n if ($query->num_rows() > 0) {\n if ($parent == 0) {\n $output .= '<ul id=\"pagetree\">' . \"\\r\\n\";\n } else {\n $output .= \"<ul style='display:block;'>\\r\\n\";\n }\n foreach ($query->result_array() as $row) {\n if ($row['page_type'] != 'system_page') {\n //var_dump($row);\n //link edit\n $edit_href = 'cms/page/edit/' . $row['page_id'] . '/2';\n\n //language\n $language = ' <span style=\"padding-left: 20px; color: #bbb\">' . $row['page_uri'] . ' ';\n if ($row['language_code'] != 'en') {\n $language = '(' . $row['language'] . ')';\n }\n $language .= '</span>';\n\n //link delete\n $del_href = 'cms/page/delete/' . $row['page_id'];\n\n //link split versions\n $splitversion_href = 'cms/page_version/index/' . $row['page_id'];\n\n //link blockd\n $block_href = 'cms/block/index/' . $row['page_id'];\n\n //link blockd\n $Pagebulider_href = 'cms/pagebuilder/index/' . $row['page_id'];\n\n //link duplicate page\n $duplicate_href = 'cms/page/duplicate/' . $row['page_id'];\n\n //link translate page\n $translate_href = 'cms/translate/index/' . $row['page_id'];\n\n //older split versions\n $olderversion_href = 'older_version/index/' . $row['page_id'];\n\n $pageBuilder_link = \"\";\n $page_arr = [1, 3, 8];\n if (in_array($row['page_template_id'], $page_arr)) {\n $pageBuilder_link = \"<a href=\\\"\" . $Pagebulider_href . \"\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Page Builder'> <i class='glyphicon glyphicon-th-large'></i></a> |\";\n }\n //$output .= '<li id=\"page_' . $row['page_id'] . '\"><div class=\"page_item\"><div class=\"page_item_name\"><a href=\"' . $edit_href . '\">' . $row['title'] . \"</a></div> \" . $language . \" <div class=\\\"page_item_options\\\"> <a href=\\\"\" . $translate_href . \"\\\">Translate</a> | <a href=\\\"\" . $duplicate_href . \"\\\">Duplicate Page</a> | <a href=\\\"\" . $block_href . \"\\\"> Manage Blocks</a> | <a href=\\\"\" . $edit_href . \"\\\">Edit</a> | <a href=\\\"\" . $del_href . \"\\\" onclick=\\\"return confirm('Are you sure you want to Delete this Link ?');\\\">Delete</a> | <a href=\\\"\" . $splitversion_href . \"\\\">Split Versions</a></div></div>\";\n // $output .= '<li id=\"page_' . $row['page_id'] . '\"><div class=\"page_item\"><div class=\"page_item_name\"><a href=\"' . $edit_href . '\">' . $row['title'] . \"</a></div> \" . $language . \" <div class=\\\"page_item_options\\\"> <a href=\\\"\" . $Pagebulider_href . \"\\\"> Page Builder </a> | <a href=\\\"\" . $block_href . \"\\\"> Manage Blocks</a> | <a href=\\\"\" . $edit_href . \"\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Edit'><i class='glyph-icon icon-linecons-pencil'></i></a> | <a href=\\\"\" . $del_href . \"\\\" onclick=\\\"return confirm('Are you sure you want to Delete this Link ?');\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Delete'><i class='glyph-icon icon-linecons-trash red-color'></i></a></div></div>\";\n $output .= '<li id=\"page_' . $row['page_id'] . '\"><div class=\"page_item\"><div class=\"page_item_name\"><a href=\"' . $edit_href . '\">' . $row['title'] . \"</a></div> \" . $language . \" <div class=\\\"page_item_options\\\"> $pageBuilder_link <a href=\\\"\" . $edit_href . \"\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Edit'><i class='glyph-icon icon-linecons-pencil'></i></a> | <a href=\\\"\" . $del_href . \"\\\" onclick=\\\"return confirm('Are you sure you want to Delete this Link ?');\\\" class='tooltip-button' data-toggle='tooltip' data-placement='top' title='Delete'><i class='glyph-icon icon-linecons-trash red-color'></i></a></div></div>\";\n $output = $this->pageItemTree($row['page_id'], $output);\n $output .= \"</li>\\r\\n\";\n }\n }\n $output .= \"</ul>\\r\\n\";\n }\n return $output;\n }",
"public function createNestedPagesAndCopyDraftParentPage() {}",
"private function create_pages(){\n\n\n if(!file_exists(INIT_DIR.\"/theme_builder.ini\")) return false;\n\n //get theme_builder.ini ---> rsearch() // for pages\n // get pages.ini -----> rsearch(); //for templates\n\n if($pages['pages']){\n\n add_action('after_switch_theme',function() use($pages){\n\n foreach ( $pages['pages'] as $title => $params){\n\n if(!is_array($params)){\n $params['template'] = $params;\n }\n\n if($pages['templates'][$params['template']]){\n $params['template'] = $pages['templates'][$params['template']];\n }\n\n if(!$params['title']) $params['title'] = $title;\n\n Pages::add_page($params);\n\n }\n\n });\n \n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new role for the guild. Requires the 'MANAGE_ROLES' permission. Returns the new role object on success. Fires a Guild Role Create Gateway event. | public static function createRole($guild_id)
{
$result = Api::post(
'/guilds/' . $guild_id . '/roles',
[
/**
* All JSON params are optional.
JSON Params
Field Type Description Default
name string name of the role "new role"
permissions integer bitwise of the enabled/disabled permissions @everyone permissions in guild
color integer RGB color value 0
hoist bool whether the role should be displayed separately in the sidebar false
mentionable bool whether the role should be mentionable false
*/
]
);
return RoleFactory::instatiate($result->getBody);
} | [
"public function createRole() {\n\t\t\tif (!$this->roleExists()) {\n\t\t\t\t$role = Mage::getModel('api/roles')\n\t\t\t\t\t->setName($this->rolename)\n\t\t\t\t\t->setPid(false)\n\t\t\t\t\t->setRoleType('G')\n\t\t\t\t\t->save();\n\t\t\t}\n\n\t\t\t//attach rule to role\n\t\t\tMage::getModel(\"api/rules\")\n\t\t\t\t->setRoleId($this->getRole()->getId())\n\t\t\t\t->setResources(array('all'))\n\t\t\t\t->saveRel();\t\t\n\t\t}",
"private function createRole()\n\t{\n\t\t$role = new Role();\n\t\t$role->setRolename(time());\n\t\t$role->setDescription(time());\n\t\treturn $role;\n\t}",
"public function create(string $roleName): Role;",
"public static function createRole()\n {\n // Add web-administrator role if required\n if (!Utils::roleExists('web-administrator')) {\n self::addNewAdministratorRole();\n }\n }",
"public static function createRole()\n {\n // Add site-manager role if required\n if (!Utils::roleExists('site-manager')) {\n self::addNewRole();\n }\n }",
"public function create($role);",
"private function createAdminRole()\n {\n $role = $this->manager->getRepository('SmartCityUserBundle:Role')->findByRoleName('ROLE_ADMIN');\n if (! $role) {\n $role = new Role();\n $role->setTitle(\"Admin\");\n $role->setRole(\"ROLE_ADMIN\");\n $role->setVisible(true);\n\n $this->manager->persist($role);\n $this->manager->flush();\n }\n return $role;\n }",
"public function createAdminRole()\n {\n if ($this->adminRole) {\n return $this->adminRole;\n }\n\n return $this->adminRole = Role::create([\n 'name' => 'Admin',\n 'slug' => 'admin'\n ]);\n }",
"public function createRole(string $role, array $body = [])\n {\n $body = OptionsResolver::resolve($body, ['allowed_policies', 'orphan', 'period', 'renewable', 'path_suffix', 'explicit_max_ttl']);\n $params = ['body' => json_encode($body)];\n return $this->client->post('/v1/auth/token/roles/' . $role, $params);\n }",
"public function created(Role $role)\n {\n //\n }",
"public function create()\n {\n $this->authorize('admin.roles.create');\n\n $form = $this->presenter->form($this->role);\n\n return view('admin.roles.create', compact('form'));\n }",
"public function create()\n\t{\n\t\n\t\t$this->form_validation->set_rules('role', 'Role', 'trim|required|xss_clean');\n\t\t\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\n\t\t\t$this->session->set_flashdata('error_message', $this->lang->line('roles_create_error').validation_errors());\n\t\t\t\n\t\t\tredirect(\"/roles/\", \"refresh\");\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$userName = $this->rolemodel->newRole($_POST);\n\t\t\t\n\t\t\t$this->session->set_flashdata('success_message', $this->lang->line('roles_create_success'));\n\t\t\t\n\t\t\tredirect(\"/roles/\".$userName, \"refresh\");\n\t\t\n\t\t}\n\t\n\t}",
"public function created(Role $role)\n {\n Log::info(\"Role id {$role->id} created.\");\n }",
"private function addRole()\n {\n if($this->roleExists())\n {\n $this->error(\"The role {$this->name} already exists.\");\n return;\n }\n $this->role = $this->role->create(['name' => $this->name]);\n $this->line(\"The role {$this->name} has been created with an id of {$this->role->id}.\");\n }",
"public function create()\n {\n $role = new Role;\n return view('admin.roles.create', compact('role'));\n }",
"public function actionCreate()\n {\n $model = new Role();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->role_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"function shd_admin_create_role()\n{\n\tglobal $context, $txt, $smcFunc;\n\n\t$_REQUEST['template'] = isset($_REQUEST['template']) ? (int) $_REQUEST['template'] : 0;\n\tif (empty($context['shd_permissions']['roles'][$_REQUEST['template']]))\n\t\tfatal_lang_error('shd_unknown_template', false);\n\n\tif (empty($_REQUEST['part']))\n\t{\n\t\t$context['page_title'] = $txt['shd_create_role'];\n\t\t$context['sub_template'] = 'shd_create_role';\n\t\tcheckSubmitOnce('register');\n\t}\n\telse\n\t{\n\t\tcheckSubmitOnce('check');\n\t\tcheckSession();\n\n\t\t// Boring stuff like session checks done. Were you a naughty admin and didn't set it properly?\n\t\tif (!isset($_POST['rolename']) || $smcFunc['htmltrim']($smcFunc['htmlspecialchars']($_POST['rolename'])) === '')\n\t\t\tfatal_lang_error('shd_no_role_name', false);\n\t\telse\n\t\t\t$_POST['rolename'] = strtr($smcFunc['htmlspecialchars']($_POST['rolename']), array(\"\\r\" => '', \"\\n\" => '', \"\\t\" => ''));\n\n\t\t// So here we are, template id is valid, we're good little admins and specified a name, so let's create the new role in the DB.\n\t\t$smcFunc['db_insert']('insert',\n\t\t\t'{db_prefix}helpdesk_roles',\n\t\t\tarray(\n\t\t\t\t'template' => 'int', 'role_name' => 'string',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t$_REQUEST['template'], $_POST['rolename'],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id_role',\n\t\t\t)\n\t\t);\n\n\t\t$newrole = $smcFunc['db_insert_id']('{db_prefix}helpdesk_roles', 'id_role');\n\t\tif (empty($newrole))\n\t\t\tfatal_lang_error('shd_could_not_create_role', false);\n\n\t\t// Take them to the edit screen!\n\t\tredirectexit('action=admin;area=helpdesk_permissions;sa=editrole;role=' . $newrole);\n\t}\n}",
"public function created(Role $role)\n {\n $role->created_by_user_id = Auth::id();\n }",
"public function create_in_moodle() {\n global $DB;\n\n $data = $this->get_data_mapping();\n if ($data === false) {\n \\local_connect\\util\\helpers::error(\"No role mapping for: '{$this->name}'!\");\n return false;\n }\n\n // Create it if it doesnt already exist.\n if (!$DB->record_exists('role', array('shortname' => $data['short']))) {\n $this->mid = create_role($data['name'], $data['short'], $data['desc'], $data['archetype']);\n $this->save();\n return true;\n }\n\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Operation getParagraphFormatAsyncWithHttpInfo Reads the formatting properties of a paragraph from the document node. | private function getParagraphFormatAsyncWithHttpInfo(Requests\getParagraphFormatRequest $request)
{
$returnType = '\Aspose\Words\Model\ParagraphFormatResponse';
$request = $request->createRequest($this->config);
return $this->client
->sendAsync($request, $this->_createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject' || $returnType === 'FILES_COLLECTION') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
if ($this->config->getDebug()) {
$this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));
}
return [
ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
if ($exception instanceof RepeatRequestException) {
$this->_requestToken();
throw new RepeatRequestException("Request must be retried", 401, null, null);
}
throw new ApiException(
sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()
);
}
);
} | [
"private function getParagraphListFormatAsyncWithHttpInfo(Requests\\getParagraphListFormatRequest $request) \n {\n $returnType = '\\Aspose\\Words\\Model\\ParagraphListFormatResponse';\n $request = $request->createRequest($this->config);\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"public function getParagraphFormatAsync(Requests\\getParagraphFormatRequest $request) \n {\n return $this->getParagraphFormatAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"private function updateParagraphListFormatAsyncWithHttpInfo(Requests\\updateParagraphListFormatRequest $request) \n {\n $returnType = '\\Aspose\\Words\\Model\\ParagraphListFormatResponse';\n $request = $request->createRequest($this->config);\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"private function updateParagraphFormatWithHttpInfo(Requests\\updateParagraphFormatRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\ParagraphFormatResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\ParagraphFormatResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getParagraphListFormatAsync(Requests\\getParagraphListFormatRequest $request) \n {\n return $this->getParagraphListFormatAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getSupportedFileFormatsAsyncWithHttpInfo() \n {\n $returnType = '\\GroupDocs\\Signature\\Model\\FormatsResult';\n $request = $this->getSupportedFileFormatsRequest();\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n \n if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode(); \n \n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode\n );\n }\n );\n }",
"public function convertDocumentPdfToTxtAsyncWithHttpInfo($input_file, $text_formatting_mode = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TextConversionResult';\n $request = $this->convertDocumentPdfToTxtRequest($input_file, $text_formatting_mode);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function convertDocumentPptxToPptAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->convertDocumentPptxToPptRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function fontProcessorPreparePreviewUrlAsyncWithHttpInfo($id, $namespace, $name, $width, $height, $text = null, $format = null, $max_width = null, $font_size = null, $horizontal_alignment = null, $vertical_alignment = null, $background = null, $text_color = null, $force = false, $tenant_id = null)\n {\n $returnType = 'string';\n $request = $this->fontProcessorPreparePreviewUrlRequest($id, $namespace, $name, $width, $height, $text, $format, $max_width, $font_size, $horizontal_alignment, $vertical_alignment, $background, $text_color, $force, $tenant_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getDocumentWithFormatAsync(Requests\\getDocumentWithFormatRequest $request) \n {\n return $this->getDocumentWithFormatAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function convertDocumentAutodetectToTxtAsyncWithHttpInfo($input_file, $text_formatting_mode = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TextConversionResult';\n $request = $this->convertDocumentAutodetectToTxtRequest($input_file, $text_formatting_mode);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function fontProcessorPreparePreviewAsyncWithHttpInfo($id, $namespace, $name, $width, $height, $text = null, $format = null, $max_width = null, $font_size = null, $horizontal_alignment = null, $vertical_alignment = null, $background = null, $text_color = null, $force = false, $tenant_id = null)\n {\n $returnType = '\\SplFileObject';\n $request = $this->fontProcessorPreparePreviewRequest($id, $namespace, $name, $width, $height, $text, $format, $max_width, $font_size, $horizontal_alignment, $vertical_alignment, $background, $text_color, $force, $tenant_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getTaskDocumentWithFormatAsync(Requests\\GetTaskDocumentWithFormatRequest $request) \n {\n return $this->getTaskDocumentWithFormatAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"private function getTableRowFormatAsyncWithHttpInfo(Requests\\getTableRowFormatRequest $request) \n {\n $returnType = '\\Aspose\\Words\\Model\\TableRowFormatResponse';\n $request = $request->createRequest($this->config);\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"public function convertDocumentDocxToTxtAsyncWithHttpInfo($input_file, $text_formatting_mode = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TextConversionResult';\n $request = $this->convertDocumentDocxToTxtRequest($input_file, $text_formatting_mode);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"private function updateParagraphListFormatWithHttpInfo(Requests\\updateParagraphListFormatRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\ParagraphListFormatResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\ParagraphListFormatResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getParcelLabelAsyncWithHttpInfo($parcel_id, $page_format = null)\n {\n $returnType = '\\SplFileObject';\n $request = $this->getParcelLabelRequest($parcel_id, $page_format);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateParagraphFormatAsync(Requests\\updateParagraphFormatRequest $request) \n {\n return $this->updateParagraphFormatAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"private function updateParagraphFormatOnlineAsyncWithHttpInfo(Requests\\updateParagraphFormatOnlineRequest $request) \n {\n $returnType = 'UpdateParagraphFormatOnlineResponse';\n $request = $request->createRequest($this->config);\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'gaufrette.sylius_image_filesystem' shared service. | protected function getGaufrette_SyliusImageFilesystemService()
{
return $this->services['gaufrette.sylius_image_filesystem'] = new \Gaufrette\Filesystem(new \Gaufrette\Adapter\Local(($this->targetDirs[3].'/web/media/image'), true));
} | [
"protected function getSylius_ImageUploaderService()\n {\n return $this->services['sylius.image_uploader'] = new \\Sylius\\Component\\Core\\Uploader\\ImageUploader(${($_ = isset($this->services['knp_gaufrette.filesystem_map']) ? $this->services['knp_gaufrette.filesystem_map'] : $this->get('knp_gaufrette.filesystem_map')) && false ?: '_'}->get('sylius_image'));\n }",
"protected function getFilesystemService()\n {\n return $this->services['filesystem'] = new \\Symfony\\Component\\Filesystem\\Filesystem();\n }",
"public function getFileStorageService()\n {\n return $this->sm->get('application_service_storage');\n }",
"protected function getSonata_Media_Filesystem_LocalService()\n {\n return $this->services['sonata.media.filesystem.local'] = new \\Gaufrette\\Filesystem(${($_ = isset($this->services['sonata.media.adapter.filesystem.local']) ? $this->services['sonata.media.adapter.filesystem.local'] : $this->get('sonata.media.adapter.filesystem.local')) && false ?: '_'});\n }",
"protected function getSonata_Media_Filesystem_LocalService()\n {\n return $this->services['sonata.media.filesystem.local'] = new \\Gaufrette\\Filesystem($this->get('sonata.media.adapter.filesystem.local'));\n }",
"public function filesystem()\n {\n return app(MountManager::class)->getFilesystem($this->getDiskSlug());\n }",
"protected function filesystem()\n {\n return Storage::disk(config('biologer.photos_disk'));\n }",
"protected function getSession_Storage_FilesystemService()\n {\n return $this->services['session.storage.filesystem'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockFileSessionStorage('/Users/pete.robinson/Sites/wam/image/tests/SupportFiles/app/../../../tmp/cache/sessions');\n }",
"public function getFilesystem()\n {\n if (!isset($this->filesystem))\n {\n $this->filesystem = new sfFilesystem();\n }\n\n return $this->filesystem;\n }",
"public function get_filesystem()\n\t{\n\t\treturn $this->filesystem;\n\t}",
"protected function getImageProcessingServiceService()\n {\n return $this->privates['TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Service\\\\ImageProcessingService'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\Resource\\Service\\ImageProcessingService::class, ($this->services['TYPO3\\\\CMS\\\\Core\\\\Resource\\\\ProcessedFileRepository'] ?? $this->getProcessedFileRepositoryService()), ($this->services['TYPO3\\\\CMS\\\\Core\\\\Context\\\\Context'] ?? $this->getContextService()), \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\Locking\\ResourceMutex::class, ($this->services['TYPO3\\\\CMS\\\\Core\\\\Locking\\\\LockFactory'] ?? ($this->services['TYPO3\\\\CMS\\\\Core\\\\Locking\\\\LockFactory'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\Locking\\LockFactory::class)))));\n }",
"protected function getKnpGaufrette_FilesystemMapService()\n {\n return $this->services['knp_gaufrette.filesystem_map'] = new \\Knp\\Bundle\\GaufretteBundle\\FilesystemMap(array('sylius_image' => ${($_ = isset($this->services['gaufrette.sylius_image_filesystem']) ? $this->services['gaufrette.sylius_image_filesystem'] : $this->get('gaufrette.sylius_image_filesystem')) && false ?: '_'}));\n }",
"protected function getOneupFlysystem_FileFilesystemFilesystemService()\n {\n return $this->services['oneup_flysystem.file_filesystem_filesystem'] = new \\League\\Flysystem\\Filesystem(new \\League\\Flysystem\\AwsS3v3\\AwsS3Adapter(($this->privates['app.s3_client'] ?? $this->getApp_S3ClientService()), $this->getEnv('AWS_S3_BUCKET_FILE_NAME'), NULL, []), ['visibility' => 'public', 'disable_asserts' => false]);\n }",
"public function getStorageService();",
"protected function getMainImageService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Generators\\\\Schema\\\\Main_Image'] = new \\Yoast\\WP\\SEO\\Generators\\Schema\\Main_Image();\n }",
"protected function getImageService()\n {\n return $this->objectManager->get(ImageService::class);\n }",
"public function getSharedStoragePath(): string\n {\n if (empty($this->sharedStoragePath)) return $this->getStoragepath();\n\n return $this->sharedStoragePath;\n }",
"protected function getDistributionImageViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\ViewHelpers\\DistributionImageViewHelper::class);\n }",
"protected function getSession_Storage_FilesystemService()\n {\n return $this->services['session.storage.filesystem'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockFileSessionStorage((__DIR__.'/sessions'), 'MOCKSESSID', ${($_ = isset($this->services['session.storage.metadata_bag']) ? $this->services['session.storage.metadata_bag'] : $this->getSession_Storage_MetadataBagService()) && false ?: '_'});\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the context of a metabox by ID. | protected function get_metabox_context( $metabox ) {
$context = 'normal';
if ( in_array( $metabox, array(
'categorydiv',
'tagsdiv-post_tag',
'pageparentdiv',
), true ) ) {
$context = 'side';
} elseif ( in_array( $metabox, array(
'members-cp',
), true ) ) {
$context = 'advanced';
}
return apply_filters( 'wps_posttype_get_metabox_context', $context, $metabox, $this->post_type, $this );
} | [
"public function get_categorycontextid($id){\n\t\tglobal $remotedb;\n\t\t\n $contextid = $remotedb->get_record_sql(\"SELECT id\n FROM {context}\n WHERE contextlevel = 40 AND instanceid = ?\", array($id));\n\t\treturn $contextid->id;\n\t}",
"public function metabox() {\n\t\t\n\t\t/**\n\t\t * Initialize the metabox\n\t\t */\n\t\t$cmb = new_cmb2_box( array(\n\t\t\t'id' => 'expedia_hotel_id',\n\t\t\t'title' => __( 'Expedia Hotel ID', 'cmb2' ),\n\t\t\t'object_types' => array( 'hawaii-hotels', ), // Post type\n\t\t\t'context' => 'side',\n\t\t\t'priority' => 'high',\n\t\t\t'closed' => true,\n\t\t\t'show_names' => false, // Show field names on the left\n\t\t\t'show_on_cb' => [ $this, 'excludeFromPages' ],\n\t\t) );\n\n\t\t// Regular text field\n\t\t$cmb->add_field( array(\n\t\t\t'name' => __( 'Expedia Hotel ID', 'cmb2' ),\n\t\t\t'id' => '_expedia_hotel_id',\n\t\t\t'type' => 'text_small',\n\t\t\t'sanitization_cb' => [ $this, 'sanitize' ], // custom sanitization callback parameter\n\t\t\t'on_front' => false, // Optionally designate a field to wp-admin only\n\t\t\t'attributes' => array(\n\t\t\t\t'placeholder' => 'Must be 6 numbers',\n\t\t\t),\n\t\t\t'render_row_cb' => [$this, 'renderRow'],\n\t\t) );\n\t\t\n\t}",
"public function getMetaboxId($id)\n\t{\n\t\treturn sprintf('%s_%s', $this->getPrefix(), $id);\n\t}",
"public function getIdcontexte()\n {\n return $this->idcontexte;\n }",
"function &getMetaByID($myID = \"\") {\n foreach($this->meta as $metael){\n if ($metael[\"ID\"] == $myID) {\n return $metael;\n }\n }\n return NULL;\n }",
"function emarking_get_cm_course_instance_by_id($cmid) {\n global $DB;\n // Validate course module.\n if (!$cm = get_coursemodule_from_id('emarking', $cmid)) {\n print_error(get_string('invalidcoursemodule', 'mod_emarking') . \" id: $cmid\");\n }\n // Validate eMarking activity //TODO: validar draft si está selccionado.\n if (!$emarking = $DB->get_record('emarking', array(\n 'id' => $cm->instance\n ))) {\n print_error(get_string('invalidid', 'mod_emarking') . \" id: $cm->id\");\n }\n // Validate course.\n if (!$course = $DB->get_record('course', array(\n 'id' => $emarking->course\n ))) {\n print_error(get_string('invalidcourseid', 'mod_emarking'));\n }\n $context = context_module::instance($cm->id);\n return array(\n $cm,\n $emarking,\n $course,\n $context\n );\n}",
"public function get_context() {\n if (empty($this->context)) {\n if (!empty($this->instanceid)) {\n $this->context = \\context_module::instance($this->instanceid);\n } else {\n $this->context = false;\n }\n }\n return $this->context;\n }",
"public function getChunkContextId()\n {\n return $this->chunk_context_id;\n }",
"function getContextId() {\n\t\treturn $this->getData('contextId');\n\t}",
"public function getIdTypeContexte()\n {\n return $this->idTypeContexte;\n }",
"public function getMetaboxes()\n\t{\n\t\treturn $this->_metaboxes;\n\t}",
"function ot_frontend_cmb2_get() {\n\t// Use ID of metabox in ot_frontend_form_register\n\t$metabox_id = '_ot_bv_link_submit_front-end-post-form';\n\n\t// Post/object ID is not applicable since we're using this form for submission\n\t$object_id = 'fake-object-id';\n\n\t// Get CMB2 metabox object\n\treturn cmb2_get_metabox( $metabox_id, $object_id );\n}",
"function getContextId() {\n\t\treturn $this->_contextId;\n\t}",
"function _getContextId() {\n\t\treturn $this->_contextId;\n\t}",
"public function getById ( $id ) { return $this->atoms[$id]; }",
"public function getIdMeta(){\n return $this->idMeta;\n }",
"public function getIdMetas()\n {\n return $this->id_metas;\n }",
"function get_box_options( $id )\n\t{\n\t\t$defaults = array(\n\t\t\t'css' => array(\n\t\t\t\t'position' \t\t\t=> 'centered',\n\t\t\t\t'bgopacity'\t\t\t=> '0.5',\n\t\t\t\t'background_color'\t=> '#eeeeee',\n\t\t\t\t'color'\t\t\t\t=> '#333',\n\t\t\t\t'width'\t\t\t\t=> '600px',\n\t\t\t\t'border_color'\t\t=> '#555',\n\t\t\t\t'border_width'\t\t=> '8',\n\t\t\t),\n\t\t\t'trigger'\t\t\t=> 'seconds',\n\t\t\t'trigger_number'\t=> '5',\n\t\t\t'animation'\t\t\t=> 'fade',\n\t\t\t'cookie'\t\t\t=> '99',\n\t\t\t'auto_hide'\t\t\t=> 0,\n\t\t\t'test_mode'\t\t\t=> 0,\n\t\t\t'conversion_close' => '1',\n\t\t\t'powered_link' => '1',\n\t\t);\n\t\t\n\t\t$opts = get_post_meta( $id, 'ppl_options', true );\n\n\t\treturn wp_parse_args( $opts, apply_filters( 'ppl/metaboxes/default_options', $defaults ) );\n\t}",
"function yourprefix_frontend_cmb2_get() {\n // Use ID of metabox in yourprefix_frontend_form_register\n $metabox_id = 'front-end-post-form';\n // Post/object ID is not applicable since we're using this form for submission\n $object_id = 'fake-oject-id';\n // Get CMB2 metabox object\n return cmb2_get_metabox( $metabox_id, $object_id );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function that doubles every other digit in the array | function double_every_other($reversed) {
// Loop through the reversed base number array and multiply each number by
// its proper weight.
foreach ($reversed as $key => $value) {
if ($key % 2 == 0) {
$reversed[$key] = $value * 2;
}
}
return $reversed;
} | [
"function tripledouble($num1, $num2)\n{\n $num1_digits = array_map('intval', str_split($num1));\n $num2_digits = array_map('intval', str_split($num2));\n\n $num1_digits_occurrences = array_count_values($num1_digits);\n $num2_digits_occurrences = array_count_values($num2_digits);\n\n $three_consecutive_array_items = false;\n $two_consecutive_array_items = false;\n\n foreach ($num1_digits_occurrences as $key => $value) {\n if ($value > 2) {\n $first_occurrence_index = array_search($key, $num1_digits);\n\n if ($num1_digits[$first_occurrence_index + 1] == $key\n && $num1_digits[$first_occurrence_index + 2] == $key) {\n $three_consecutive_array_items = true;\n }\n }\n }\n\n foreach ($num2_digits_occurrences as $key => $value) {\n if ($value > 1) {\n $first_occurrence_index = array_search($key, $num2_digits);\n\n if ($num2_digits[$first_occurrence_index + 1] == $key) {\n $two_consecutive_array_items = true;\n }\n }\n }\n\n return ($three_consecutive_array_items && $two_consecutive_array_items) ? 1 : 0;\n}",
"function double(array $nums) : array {\r\n\r\n $doubledNums = [];\r\n\r\n foreach ($nums as $key => $value) {\r\n $doubledNums[] = $value * 2;\r\n };\r\n\r\n return $doubledNums;\r\n}",
"function evenArray($mainArray)\n{\n $arrayFilter = array_filter($mainArray, function ($value) {\n $total = 0;\n while ($value > 0) {\n $total += $value % 10;\n $value = $value / 10;\n }\n return ($total % 2 == 0) ? true : false;\n });\n $result = implode(', ', $arrayFilter);\n echo '<b>' . $result . '</b><br>';\n}",
"function evenNumbers(array $array): array\n{\n $resultArray = [];\n\n if (count($array) !== 0) {\n foreach ($array as $elementArray) {\n if (($elementArray % 2) === 0) {\n $resultArray[] = $elementArray;\n }\n }\n }\n return $resultArray;\n}",
"function doubleEveryCharacter($str) {\n $doubled = \"\";\n $len = strlen($str);\n\n for ($k = 0; $k < $len; $k++) {\n $doubled = $doubled . $str[$k] . $str[$k];\n }\n return $doubled;\n}",
"function double_number($number){\n\treturn $number * 2;\n}",
"function alternatingSums($a) {\n $count = count($a);\n $arr = [0,0];\n for($i = 0; $i < $count; $i++) {\n if($i % 2 === 0) {\n $arr[0] += $a[$i];\n } else {\n $arr[1] += $a[$i];\n }\n }\n return $arr;\n}",
"function Multiplication($DEArray){\n $Character = 0;\n $NewChr = \"\";\n while ($Character < count($DEArray)) {\n if ($DEArray[$Character] === \"*\" AND (is_numeric($DEArray[$Character-1])) AND (is_numeric($DEArray[$Character+1]))){\n $NewChr = floatval(($DEArray[$Character-1])*floatval($DEArray[$Character+1]));\n array_splice($DEArray, $Character-1, 3 , $NewChr);\n $Character = 0;\n }\n elseif ((($DEArray[$Character]===\"0\") OR ($DEArray[$Character+1]===\"0\")) AND (is_numeric($DEArray[$Character])) AND (is_numeric($DEArray[$Character+1]))){\n array_splice($DEArray, $Character, 2 , 0);\n $Character = 0;\n }\n elseif ((is_numeric($DEArray[$Character])) AND (is_numeric($DEArray[$Character+1]))) {\n $NewChr = (floatval($DEArray[$Character])*floatval($DEArray[$Character+1]));\n array_splice($DEArray, $Character, 2 , $NewChr);\n $Character = 0;\n }\n $Character = $Character + 1;\n }\n return($DEArray);\n\n }",
"function addOneToNumber($arr) {\n // remove forward 0s \n for ($i=0; $i < sizeof($arr); $i++) { \n if ($arr[$i] == 0) {\n unset($arr[$i]);\n } else {\n break;\n }\n }\n $arr = array_values($arr);\n $exp = 1;\n $num = 0;\n for ($i=sizeof($arr)-1; $i >= 0; $i--) { \n $num += $arr[$i] * $exp;\n $exp *= 10;\n }\n $num += 1;\n $result = [];\n while ($num > 1) {\n array_unshift($result, $num % 10);\n $num /= 10;\n }\n return $result;\n}",
"function evenDigitsOnly($n) {\n $a = str_split($n);\n foreach($a as $l) {\n if($l % 2 > 0){\n return false;\n }\n }\n return true;\n}",
"function invert(array $a): array {\n$newarr = [];\nforeach ($a as $item){\n $double = $item *2;\n array_push($newarr, $item-$double);\n}\n return $newarr;\n}",
"function square_the_values($arr){\n foreach ($arr as $index => $value) {\n $arr[$index] = $value * $value;\n }\n var_dump($arr);\n return $arr;\n}",
"function DVCampo($campo) {\n // vetor estatico com valores \"2\" e \"1\" utilizado para calculo de MODULO 10\n $DOIS_UM = array(2, 1);\n $soma = 0;\n $tam = strlen($campo);\n $campo = strrev($campo);\n\n for ($i = 0; $i < $tam; $i++) {\n $aux = $DOIS_UM[$i % 2] * $campo[$i];\n $soma += ($aux >= 10) ? (floor($aux / 10) + $aux % 10) : $aux;\n }\n\n $soma %= 10;\n return ($soma > 0) ? (10 - $soma) : 0;\n}",
"function array_with_odds() {\n $odds = [];\n for ($i = 1; $i <= 255; $i++) {\n if ($i % 2 == 1) {\n array_push($odds, $i);\n }\n }\n var_dump($odds);\n return $odds;\n}",
"function MultiplyByLength($arr){\n $len = count($arr);\n foreach($arr as $a){\n echo $len * $a;\n }\n }",
"function findEvenValues($arrayToCycle){\n\n\t$newArray = [];\n\t// creating empty array to later be returned by function\n\n\tfor($i = 0; $i < count($arrayToCycle); $i++){\n\t\tif($arrayToCycle[$i] % 2 == 0){\n\t\t// divide by 2, if no remainder, then the item is even and can be added to the new array\n\t\t\t$newArray[] = $arrayToCycle[$i];\n\t\t}\n\t}\n\n\treturn($newArray);\n\n}",
"function doubleInteger($i)\n{\n return $i * 2;\n}",
"function bitGrup($a){\r\n\r\n $z=explode('0', $a);\r\n $z=array_diff($z, [null]);\r\n $z=array_values($z);\r\n return $z;\r\n}",
"public function alternate($array) {\n return $array[$this->count++ % count($array)];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// Funcao que fecha a conexao com o banco de dados // | public function fechaConexaoBD()
{
$_USER = "dgi";
$_HOST = "150.163.134.104:3333";
$_PWD = "dgi.2013";
$desconec = @mysql_connect($_HOST, $_USER, $_PWD) or die("NÃO CONECTADO COM O BANCO!");
mysql_close($desconec);
} | [
"function Conectar() {\n\t//Revisamos si la conexion est vacia \n\t\tif(!isset($this->conexion)){\n\t\t\t$this->conexion = (mysqli_connect($this->dbhost,$this->dbuser,$this->dbpass,$this->db)) \n\t\t\t\tor die (\"ERROR: NO se puede conectar al Gestor de Base de Datos.\" . mysqli_connect_error($this->conexion));\n\t\t\t//funcion/Metodo para seleccionar la base de datos\n\t\t}\t\n\t}",
"function bd_conectar(){\n // Variaveis de conexao\n $dns = 'mysql:host=localhost;dbname=projeto_php';\n $user = 'root';\n $senha = null; \n\n $conexao = new PDO($dns, $user, $senha);\n return $conexao;\n}",
"public function Connect() {\n\n try {\n //atribuindo usuario de acesso ao banco ao atributo user\n $this->user = \"root\";\n \n //atribuindo a senha de acesso ao banco no atributo pass\n $this->pass = \"\";\n\n //atribuindo o endereço do banco no atributoi host \n $this->host = \"localhost\";\n \n //atribuindo o nome do banco criado no atributo base\n $this->base = \"mydb\";\n\n\n\n $parametros = array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES UTF8\"); //Definimos a conexão com o banco no padrão URF-8\n\n\n\n // atribuindo os parametros de conexao no atrinuto file\n $this->file = \"mysql:host=\" . $this->host . \";dbname=\" . $this->base;\n\n //atribuido a linha de comando PDO(para iniciação na conexao) no atributo pdo\n $this->pdo = new PDO($this->file, $this->user, $this->pass, $parametros);\n\n\n\n //atribuindo os atributos complementares PDO no atributo pdo\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $this->pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n\n $this->pdo->setAttribute(PDO::ATTR_PERSISTENT, true);\n\n if (!$this->pdo) {\n echo \"Erro na conexão\";\n }\n \n return $this->pdo;\n } catch (PDOException $ex) {\n\n echo \"Erro no sistema\" . $ex->getMessage();\n }\n }",
"function conectarBD(){\n if($this->enlace=mysql_connect($this->servidor, $this->nombreDeUsuario, $this->contrasena)){\n\n if(mysql_select_db($this->nombreBD, $enlace)){\n\n $this->enlace=$enlace;\n }else{\n\n echo \"Error al seleccionar la base de datos!\";\n exit();\n }\n }else{\n\n echo \"Error al enlazar al Servidor!\";\n exit();\n }\n }",
"function conecta() {\n\t\t//Conectar com o banco de dados\n\t\t$this->link = mysqli_connect($this->host,$this->user,$this->pass)\n\t\t\tor die(mysqli_error());\n //Selecionar o banco após a conexão\n\t\tif($this->link) {\n\t\t\tmysqli_select_db($this->link,$this->base)\n\t\t\tor die(\"Não foi possível selecionar o banco\");\n\t\t} else {\n\t\t\techo \"Não foi possível selecionar o banco de dados. Não conectado.\";\n\t\t}\n }",
"private function conectaBD() {\n $this->q = new BDpgsql();\n define('DB_HOST', $this->getParameter('database_host'));\n define('DB_NAME', $this->getParameter('database_name'));\n define('DB_USER', $this->getParameter('database_user'));\n define('DB_PASSWORD', $this->getParameter('database_password'));\n $this->q->conectar(DB_NAME, DB_HOST, DB_USER, DB_PASSWORD);\n }",
"public static function conectar()\n\t\t{\n\t\t\t//Cargar los datos de configuración de las conexiones\t\t\t\t\t\n\t\t\trequire(\"config/data_base_connection.php\");\n\n\t\t\ttry {\n\t\t\t\tif(!isset(self::$conexion)){\n\t self::$conexion = new PDO('mysql:host='. $wc_servidor .';port='. $wc_puerto .';dbname='. $wc_base_datos .';charset=utf8', $wc_usuario, $wc_clave);\n\t self::$conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t }\n } catch (PDOException $e) {\n \t$error = SeguridadModel::$ERROR_GLOBAL;\n \t$error[\"codigo\"] = $e->getMessage();\n \techo json_encode($error);\n \texit();\n }\n\t\t}",
"function DBFecha($link)\n{\n // recebe o $link da conexao e fecha-o\n mysqli_close($link) or die(mysqli_error($link));\n}",
"function connexionpdo($nombdd) {\n\n/* Variables de connexion à la BDD ============================================= */\n $serveur = 'localhost'; $loginserveur = 'root'; $mdpserveur = '';\n\n/* CONNEXION serveur, définition du charset, connexion BDD, requete SQL ===== */\n\n $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;\n $pdo_options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES utf8';\n $con = new PDO('mysql:host='.$serveur.';dbname='.$nombdd, $loginserveur, $mdpserveur, $pdo_options); // Connexion à la BDD\n return $con; /* pour récupérer identifiant de connexion */\n\n }",
"function conectar() \n\t {\n\t\t//conectarme con el servidor de base de datos\n\t\t$con=mysql_connect($this->Servidor,$this->Usuario,$this->Clave);\n\t\t// si hubo problemas al conectarme con el servidor de base de datos\n\t\tif (!$con)\n\t\t{\n\t\t\tdie(\"Error al conectarme con el Servidor de Base de Datos\");\n\t\t}\n\t\t//Seleccionar la base de datos\n\t\t$bd=mysql_select_db($this->BaseDatos,$con);\n\t\t//error al seleccionar la base de datos\n\t\tif (!$bd)\n\t\t{\n\t\t\tdie(\"Error al seleccionar la Base de Datos\");\n\t\t}\n\t\t//almaceno la conexion en la propiedad conect\n\t\t$this->conect=$con;\n\t\t//devuelvo la conexion desde donde fue invocada\n\t\treturn true;\t\n\t}",
"protected function bddConnexion()\n\t{\n\t\t$bdd = new \\PDO('mysql:host=localhost;dbname=blog_myrna;charset=utf8','root','');\t \n return $bdd;\t \n\t}",
"function conectarBD($ruta) { \n\n$cadena_config = file_get_contents($ruta); // obtenemos la cadena json en formato string\n$json_a=json_decode($cadena_config,true); // decodificamos al formato json \n\n\n// obenemos la configuracion de la base de datos desde la cadena json\n$DB_HOST = $json_a['ConfigDatabase']['DB_HOST'];\n$DB_USER = $json_a['ConfigDatabase']['DB_USER'];\n$DB_PASSWORD = $json_a['ConfigDatabase']['DB_PASSWORD'];\n$DB_DATABASE = $json_a['ConfigDatabase']['DB_DATABASE'];\n\n// requerido para conectar ala base de datos\n require_once 'connectbd.php';\n$pConexion;\n // connecting to database\n\n$Con = new DB_Connect();\n$pConexion = $Con->connect($DB_HOST, $DB_USER, $DB_PASSWORD, $DB_DATABASE);\n\n// return el objeto de conexion.\nreturn $pConexion;\n\n}",
"function bddBase($PARAM_hote,$PARAM_port,$PARAM_nom_bd,$PARAM_utilisateur,$PARAM_mot_passe)\n{\n global $bdd;\n\n try\n {\n $bdd= new PDO('mysql:host='.$PARAM_hote.';port='.$PARAM_port.';dbname='.$PARAM_nom_bd, $PARAM_utilisateur, $PARAM_mot_passe);\n }\n\n catch(Exception $e)\n {\n echo 'Erreur : '.$e->getMessage().'<br/>';\n echo 'N° : '.$e->getcode();\n }\n}",
"function connetti() {\r\n return new PDO('mysql:host=localhost;dbname=db-italfrutta', 'italfrutta', 'ipass2013+', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\r\n}",
"function conectaDb()\n{\n try {\n $db = new PDO(\"sqlsrv:Server=INFORMATICA09\\SQL2008 ; Database = BDDESA \", \"sa\", \"guillermo\");\n $db->setAttribute(PDO::SQLSRV_ATTR_DIRECT_QUERY, true);\n return($db);\n } catch (PDOException $e) {\n \t\tprint \"<p><b>Error : </b> No puede conectarse con la base de datos.</p>\\n\";\n exit();\n }\n}",
"private function conectar(){\r\n\t\t$this->mysqli = new mysqli($this->servidor,$this->usuario,$this->password,$this->basedatos);\r\n\t}",
"function otvoriKonekciju()\n{\n return new PDO('mysql:host=127.0.0.1:3306;dbname=obuka_irc', 'root', 'root');\n}",
"public function dbConection($db=''){\n\t\t\tif (!is_array($db))\n\t\t\t\trequire '../config/dbconfig.php';\n\n\t\t\t$stringcon = \"host=\".$db['db_serv'].\" dbname=\".$db['db_name'].\" user=\".$db['db_user'].\" password=\".$db['db_pass'];\n\t \t$this->conection = pg_pconnect($stringcon) or die (\"No hay Conexión con el Servidor!\");\n\t\t}",
"function conectDB() {\r\n try {\r\n $db = new PDO(\"sqlite:../BBDD/MERCADOS.sqlite\");\r\n return($db);\r\n }\r\n catch (PDOException $e) {\r\n print \"<p>Error: Fallo al conectar con la base de datos</p>\\n\";\r\n exit();\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
WordPress will prevent post data saving if a page template has been selected that does not exist. This is especially a problem when switching themes, and old page templates are in the post data. Unset the page template if the page does not exist to allow the post to save. | public function fix_page_template( WP_Post $post ) {
$template = get_post_meta( $post->ID, '_wp_page_template', true );
$page_templates = wp_get_theme()->get_page_templates();
// If the template doesn't exists, remove the data to allow WordPress to save.
if ( ! isset( $page_templates[ $template ] ) ) {
delete_post_meta( $post->ID, '_wp_page_template' );
}
} | [
"function blackfyre_recreate_page_template_transients( $post_id = 0 ) {\n\tglobal $post;\n\tif ( ! is_admin() )\n\t\treturn $post_id;\n\n\tif ( ! $post_id )\n\t\treturn $post_id;\n\n\t// 'Add New' admin page check\n\t$page = get_post( $post_id );\n\tif(! empty($post) && is_a($post, 'WP_Post')){\n\tif ( $post->post_status == 'auto-draft' )\n\t\treturn $post_id;\n\t}\n\t// Autosave check\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\treturn $post_id;\n\n\t// Capability check\n\tif(! empty($post) && is_a($post, 'WP_Post')){\n\tif ( isset( $POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) )\n\t\t\treturn;\n\t} else {\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\treturn;\n\t}\n\t}\n\n\tif ( get_post_type( $post_id ) == 'page' ) {\n\t\t$template = get_post_meta( $post_id, '_wp_page_template', true );\n\n\t\tif ( ! empty( $template ) && $template != 'default' ) {\n\t\t\t$template_name = substr( $template, 0, -4 );\n\n\t\t\t$is_wpml = function_exists( 'icl_object_id' ) ? true : false;\n\n\t\t\tif ( $is_wpml ) {\n\t\t\t\tglobal $sitepress, $wpdb;\n\n\t\t\t\t$default_lang = $sitepress->get_default_language();\n\t\t\t\t$current_lang = isset( $_POST['icl_post_language'] ) ? $_POST['icl_post_language'] : $default_lang;\n\n\t\t\t\tif ( $current_lang != $default_lang ) {\n\t\t\t\t\t$template_name = $template_name . '_' . $current_lang;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tset_transient( 'bf_pwt_' . $template_name, $page->ID, 60*60*24*7 );\n\t\t}\n\t}\n\n\treturn $post_id;\n}",
"function restore_page() {\n if(get_page_by_title( 'Deklaracja dostępności' )) {\n $declaration_page_id = get_option('declaration_page_id');\n\n wp_untrash_post($declaration_page_id);\n }\n }",
"function wlfw_page_title_exclude_save( $post_id ) {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t return;\n\t \n\tif ( isset($_POST['post_type']) && 'page' == $_POST['post_type'] ) {\n\t\tif ( !current_user_can( 'edit_page', $post_id ) ) return;\n\t} \n\telse {\n\t\tif ( !current_user_can( 'edit_post', $post_id ) )return;\n\t}\n\t\n\tif(isset($_POST['_wlfw_exclude_title']))\n\t\tupdate_post_meta( $post_id, '_wlfw_exclude_title', $_POST['_wlfw_exclude_title'] );\n\telse\n\t\tdelete_post_meta( $post_id, '_wlfw_exclude_title');\t\n\nreturn $post_id;\n}",
"static function remove_template(){\n\t\t\t\t\n\t\t\t\tif( !check_ajax_referer('gdlr_core_page_builder', 'security', false) ){\n\t\t\t\t\tdie(json_encode(array(\n\t\t\t\t\t\t'status' => 'failed',\n\t\t\t\t\t\t'head' => esc_html__('Invalid Nonce', 'goodlayers-core'),\n\t\t\t\t\t\t'message'=> esc_html__('Unable to remove the template. Please refresh the page and try again.' ,'goodlayers-core')\n\t\t\t\t\t)));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( !empty($_POST['slug']) ){\n\t\t\t\t\t\n\t\t\t\t\tunset(self::$pb_custom_templates[$_POST['slug']]);\n\t\t\t\t\tupdate_option(self::$pb_custom_templates_slug, self::$pb_custom_templates);\n\n\t\t\t\t\tdie(json_encode(array('status' => 'success'))); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"function hide_editor()\n{\n // Get the Post ID.\n if(isset($_GET['post']))\n $post_id = $_GET['post'];\n\n else if(isset($_POST['post_ID']))\n $post_id = $_POST['post_ID'];\n\n else\n return;\n\n // Get the name of the Page Template file.\n $template_file = get_post_meta($post_id, '_wp_page_template', true);\n\n switch ($template_file)\n {\n // add correct template file name\n case '?.php':\n remove_post_type_support('page', 'editor');\n break;\n }\n}",
"public static function use_parent_template() {\n add_action('save_post', array('core_admin', 'switch_page_template'));\n }",
"function uw_reset_templates(){\n global $wpdb;\n \n if( is_multisite() ){\n $prefix = $wpdb->base_prefix . get_current_blog_id() . '_';\n } else {\n $prefix = $wpdb->prefix;\n }\n\n $results = $wpdb->get_results( \"DELETE FROM {$prefix}postmeta WHERE meta_key='_wp_page_template'\" );\n\n return $results;\n}",
"function cp_remove_page_template($page_templates) {\n\n // Remove the template we don’t need.\n unset($page_templates['elementor_canvas']);\n unset($page_templates['elementor_header_footer']);\n\n return $page_templates;\n}",
"function THEME_PREFIX_remove_default_post_type()\n{\n remove_menu_page( 'edit.php' );\n}",
"function _reset_front_page_settings_for_post($post_id)\n {\n }",
"function remove_default_post_type() {\n remove_menu_page( 'edit.php' );\n}",
"function bethel_custom_template() {\n global $post;\n if (is_page() && isset($post) && is_object($post)) {\n $post->page_template = get_post_meta( $post->ID, '_wp_page_template', true );\n }\n}",
"public function removePageSupport(){\n\t\tremove_post_type_support( 'page', 'author' );\n\t\tremove_post_type_support( 'page', 'custom-fields' );\n\t}",
"public function reinstate_editor_for_posts_page() {\n\t\tglobal $post;\n\t\tif ( $post->ID == get_option( 'page_for_posts' ) && $post->post_content === '' ) {\n\t\t\t$post->post_content = ' ';\n\t\t}\n\t}",
"function cfct_module_loop_subpages_post_save($post_id, $post) {\n\t\tglobal $cfct_build;\n\t\tif (!$cfct_build->in_ajax() && $post->post_type == 'page') {\n\t\t\tdelete_transient('cfct-build-loop-parent_pages');\n\t\t}\n\t}",
"public static function hidePostEditor()\n {\n\n // get the Post ID.\n $postId = isset($_GET['post']) ? $_GET['post'] : (isset($_POST['post_ID']) ? $_POST['post_ID'] : null);\n if(!isset($postId) ) {\n return;\n }\n\n // get the name of the Page Template file.\n $templateFile = get_post_meta($postId, '_wp_page_template', true);\n\n // remove editor if template in FC list\n if (in_array($templateFile, self::$flexibleContentTemplates)) {\n remove_post_type_support('page', 'editor');\n }\n }",
"function _save_post_hook($post_id, $post) {\n\tif ( $post->post_type == 'page' ) {\n\t\tclean_page_cache($post_id);\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->flush_rules();\n\t} else {\n\t\tclean_post_cache($post_id);\n\t}\n}",
"public static function fix_no_editor_on_posts_page( $post ) {\n\n\t\tif ( $post->ID != get_option( 'page_for_posts' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tremove_action( 'edit_form_after_title', '_wp_posts_page_notice' );\n\t\tadd_post_type_support( 'page', 'editor' );\n\n\t}",
"public function reset_global_post() {\n\t\tglobal $post;\n\t\t$post = get_post($this->_build_post_id);\n\t\tsetup_postdata($post);\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of pubishers from the offset position, ordered by publisher name from the table 'journals' using SQL. | public function list_all_publishers($limit, $offset, $status = false, $matching = false, $search = false, $letter = false)
{
$this->db->select('trim(publisher_name) as publisher_name');
$this->db->from($this->journals_table);
$this->set_status_criteria($status);
if ($search) {
switch ($matching) {
case 'contains':
$this->db->like('publisher_name', $search);
$this->db->or_like('title_search', remove_accents($search));
break;
case 'extact_title':
$this->db->where('title_search', remove_accents($search));
$this->db->or_where('title_search', remove_accents($search));
break;
case 'starts_with':
$this->db->like('publisher_name', $search, 'after');
$this->db->or_like('title_search', remove_accents($search), 'after');
break;
}
}
if ($letter) {
$this->db->like('publisher_name', $letter, 'after');
}
$this->db->limit($limit, $offset);
$this->db->group_by('publisher_name');
$this->db->order_by('trim(publisher_name)', 'ASC');
return $this->get_results_obj();
} | [
"public function getAllPublishersOrderedById(){\n $query = \"SELECT * FROM publishers ORDER BY id\";\n $result = $this->connection->query($query);\n $result = $result->fetchAll(PDO::FETCH_ASSOC);\n $publishers = [];\n foreach($result as $data){\n $publishers[] = new Publisher($data);\n }\n return $publishers;\n }",
"public function getPublishers() {\n $sql = \"SELECT * FROM `publisher`\";\n $results = $this->conn->query($sql);\n return $results->fetchAll(PDO::FETCH_CLASS);\n }",
"public function list_all_journals_by_publisher($publisher_name, $status = false)\n {\n\n $this->db->from($this->journals_table);\n $this->db->where('publisher_name', $publisher_name);\n\n $this->set_status_criteria($status);\n\n $this->db->group_by('title_search');\n $this->db->order_by('title_search', 'ASC');\n\n return $this->get_results_obj();\n }",
"public static function getAllJournals() :array {\n \tglobal $base, $login, $password;\n\n $publicationGW = new PublicationGateway(new Connection($base, $login, $password));\n $results = $publicationGW->getAllJournals(); \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 }",
"function getSpeakersListOrder() {\n return fetchDataArray(\"SELECT id FROM countries ORDER BY points ASC, order_num ASC\",null);\n}",
"public function getPublishers()\n {\n $result = $this->executeSql($this->getSelect())->fetchAll();\n\n return $this->getObjectMapper()->populateCollection($result, PublishersMaps::MAP_PUBLISHER);\n }",
"public function listAllPublishers(): array {\n\t\t$publishers = [];\n\t\t$q = $this->pdo->query(\"SELECT `Publisher` from `articles` GROUP BY `Publisher`\");\n\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\tif(!in_array($a[\"Publisher\"], $publishers, true)){\n\t\t\t\t$publishers[] = $a[\"Publisher\"];\n\t\t\t}\n\t\t}\n\t\tsort($publishers);\n\t\treturn $publishers;\n\t}",
"public function getAllPublications() :array {\n $query='SELECT * FROM Publication ORDER BY ID;';\n $this->connection->executeQuery($query);\n \n return $this->connection->getResults();\n }",
"static function getPublishedMangas($publisher_id) {\n $sql = <<< SQL\n SELECT *\n FROM manga\n WHERE author_id = (SELECT id FROM Author WHERE publisher_id = $publisher_id);\n SQL;\n\n $conn = Database::getConnection();\n $statement = $conn->prepare($sql);\n $statement->execute();\n $result = $statement->get_result();\n\n $publishedMangas = array();\n while ($row = $result->fetch_assoc()) {\n $manga = Manga::toObject($row);\n array_push($publishedMangas, $manga);\n }\n return $publishedMangas;\n }",
"public function getNewsListings () {\n\n $sql = 'SELECT * FROM news\n ORDER BY position ASC';\n $this->stm = $this->prepare($sql);\n\n $this->stm->execute();\n $this->rows= $this->stm->fetchAll(PDO::FETCH_ASSOC);\n $this->count = $this->stm->rowCount();\n $this->rowIdx = 0;\n\n // set row to first\n $this->row=$this->rows[$this->rowIdx++];\n\n }",
"public function getPublications()\n {\n return $this->getArchive()->getSortedPublications(Publication::get()->filter('ParentID', $this->ID));\n }",
"function get_journals_posts() {\n\t\t//$query = $this->db->query('SELECT * FROM wp_journal_posts WHERE deleted=\"1\"');\t\n\n\t\t$query = $this->db->query('SELECT jp.id, jp.post_name, j.journal_name, mc.category_name,jp.created_date, jp.updated_date FROM wp_journal_posts jp INNER JOIN wp_journals j on jp.journal_id = j.id INNER JOIN wp_journal_main_categories mc on mc.category_id = j.main_category_id WHERE jp.deleted=\"1\"');\n\t\t//print_r($query);\t\t\t\t\n\t\treturn $query->result_array();\n\t}",
"function lib4ridora_get_journals($identifier, $asObject = FALSE) {\n $issn_field = variable_get('lib4ridora_issn_solr_field', 'mods_identifier_issn_s');\n $e_issn_field = variable_get('lib4ridora_e_issn_solr_field', 'mods_identifier_e-issn_s');\n if ( !strpos($identifier,'-') ) {\n $identifier = substr(ltrim($identifier),0,4) . '-' . substr(rtrim($identifier),-4); // long-dash work-around (possibly in CSV, DORA-value assumed to be OK)\n }\n $solr = new IslandoraSolrQueryProcessor();\n $solr->buildQuery(\"PID:journals%5c%3a* AND ({$issn_field}:\\\"$identifier\\\" OR {$e_issn_field}:\\\"$identifier\\\")\");\n $solr->solrLimit = 987654321;\n $solr->solrParams['fl'] = implode(\n ',',\n array(\n 'PID',\n $issn_field,\n $e_issn_field,\n )\n );\n $solr->executeQuery(FALSE);\n $journalAry = array();\n if ( isset($solr->islandoraSolrResult['response']['objects']) ) {\n foreach( $solr->islandoraSolrResult['response']['objects'] as $solrItem ) {\n $journal = $solrItem['solr_doc']['PID'];\n $journalAry[] = ( !$asObject ? $journal : islandora_object_load($journal) );\n }\n }\n return $journalAry;\n}",
"function journals() {\n\t\tparent::validate();\n\t\tparent::setupTemplate(true);\n\n\t\t$rangeInfo = Handler::getRangeInfo('journals');\n\n\t\t$journalDao = &DAORegistry::getDAO('JournalDAO');\n\t\t$journals = &$journalDao->getJournals($rangeInfo);\n\n\t\t$templateMgr = &TemplateManager::getManager();\n\t\t$templateMgr->assign_by_ref('journals', $journals);\n\t\t$templateMgr->assign('helpTopicId', 'site.siteManagement');\n\t\t$templateMgr->display('admin/journals.tpl');\n\t}",
"public function getUniversalTransferDocumentSellerTitlesAt($offset)\n {\n return $this->get(self::UNIVERSALTRANSFERDOCUMENTSELLERTITLES, $offset);\n }",
"public function findAllPublishedOrderedByNewest()\n {\n return $this->addIsPublishedQueryBuilder()\n ->orderBy('p.createdAt', 'DESC')\n ->getQuery()\n ->getResult();\n }",
"function getEventsByRunner($count, $offset, $id) {\n $query = \"SELECT *, lower(termin)::date AS von, upper(termin)::date AS bis, wettkampf.anzahl_strecken FROM main.wettkampf JOIN wettkampfteilnahme ON wettkampf.id = wettkampfteilnahme.wettkampf_id WHERE wettkampfteilnahme.laeufer_id = \".pg_escape_literal($id).\" ORDER BY id DESC LIMIT \".pg_escape_literal($count).\" OFFSET \".pg_escape_literal($offset).\";\";\n return $query;\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 getPauperData(){\n $sql = \"select * from tournaments\n where format_tournament = 'pauper'\n order by tstamp DESC \n limit 5;\";\n\n $this->db->query($sql);\n\n //Assign Result Set\n $results = $this->db->resultSet();\n\n return $results;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the syntax highlighting object | abstract public function getSyntaxHighlighter(): SyntaxHighlighter; | [
"public function syntaxHighlighting()\n {\n return $this->withMeta([\n 'syntaxHighlighting' => true,\n ]);\n }",
"function SyntaxHighlighter() {\n\tglobal $SyntaxHighlighter;\n\n\tif ( ! isset( $SyntaxHighlighter ) ) {\n\t\t$SyntaxHighlighter = new SyntaxHighlighter();\n\t}\n\n\treturn $SyntaxHighlighter;\n}",
"public function getHighlighter() {\n return $this->getPane()->getSyntaxHighlighter();\n }",
"public function getHighlightUsePhraseHighlighter() {}",
"public function getHighlighting()\n {\n return $this->result->getHighlighting();\n }",
"function syntax_highlight($text, $language)\n{\n if ($language == \"Plain Text\") return $text;\n\n define(\"normal_text\", 1, true);\n define(\"dq_literal\", 2, true);\n define(\"dq_escape\", 3, true);\n define(\"sq_literal\", 4, true);\n define(\"sq_escape\", 5, true);\n define(\"slash_begin\", 6, true);\n define(\"star_comment\", 7, true);\n define(\"star_end\", 8, true);\n define(\"line_comment\", 9, true);\n define(\"html_entity\", 10, true);\n define(\"lc_escape\", 11, true);\n define(\"block_comment\",12, true);\n define(\"paren_begin\", 13, true);\n define(\"dash_begin\", 14, true);\n define(\"bt_literal\", 15, true);\n define(\"bt_escape\", 16, true);\n define(\"xml_tag_begin\",17, true);\n define(\"xml_tag\", 18, true);\n define(\"xml_pi\", 19, true);\n define(\"sch_normal\", 20, true);\n define(\"sch_stresc\", 21, true);\n define(\"sch_idexpr\", 22, true);\n define(\"sch_numlit\", 23, true);\n define(\"sch_chrlit\", 24, true);\n define(\"sch_strlit\", 25, true);\n\n $initial_state[\"Scheme\"] = sch_normal;\n\n $sch[sch_normal][0] = sch_normal;\n $sch[sch_normal]['\"'] = sch_strlit;\n $sch[sch_normal][\"#\"] = sch_chrlit;\n $sch[sch_normal][\"0\"] = sch_numlit;\n $sch[sch_normal][\"1\"] = sch_numlit;\n $sch[sch_normal][\"2\"] = sch_numlit;\n $sch[sch_normal][\"3\"] = sch_numlit;\n $sch[sch_normal][\"4\"] = sch_numlit;\n $sch[sch_normal][\"5\"] = sch_numlit;\n $sch[sch_normal][\"6\"] = sch_numlit;\n $sch[sch_normal][\"7\"] = sch_numlit;\n $sch[sch_normal][\"8\"] = sch_numlit;\n $sch[sch_normal][\"9\"] = sch_numlit;\n\n $sch[sch_strlit]['\"'] = sch_normal;\n $sch[sch_strlit][\"\\n\"] = sch_normal;\n $sch[sch_strlit][\"\\\\\"] = sch_stresc;\n $sch[sch_strlit][0] = sch_strlit;\n\n $sch[sch_chrlit][\" \"] = sch_normal;\n $sch[sch_chrlit][\"\\t\"] = sch_normal;\n $sch[sch_chrlit][\"\\n\"] = sch_normal;\n $sch[sch_chrlit][\"\\r\"] = sch_normal;\n $sch[sch_chrlit][0] = sch_chrlit;\n\n $sch[sch_numlit][\" \"] = sch_normal;\n $sch[sch_numlit][\"\\t\"] = sch_normal;\n $sch[sch_numlit][\"\\n\"] = sch_normal;\n $sch[sch_numlit][\"\\r\"] = sch_normal;\n $sch[sch_numlit][0] = sch_numlit;\n\n //\n // State transitions for C\n //\n $c89[normal_text][\"\\\"\"] = dq_literal;\n $c89[normal_text][\"'\"] = sq_literal;\n $c89[normal_text][\"/\"] = slash_begin;\n $c89[normal_text][0] = normal_text;\n\n $c89[dq_literal][\"\\\"\"] = normal_text;\n $c89[dq_literal][\"\\n\"] = normal_text;\n $c89[dq_literal][\"\\\\\"] = dq_escape;\n $c89[dq_literal][0] = dq_literal;\n\n $c89[dq_escape][0] = dq_literal;\n\n $c89[sq_literal][\"'\"] = normal_text;\n $c89[sq_literal][\"\\n\"] = normal_text;\n $c89[sq_literal][\"\\\\\"] = sq_escape;\n $c89[sq_literal][0] = sq_literal;\n\n $c89[sq_escape][0] = sq_literal;\n\n $c89[slash_begin][\"*\"] = star_comment;\n $c89[slash_begin][0] = normal_text;\n\n $c89[star_comment][\"*\"] = star_end;\n $c89[star_comment][0] = star_comment;\n\n $c89[star_end][\"/\"] = normal_text;\n $c89[star_end][\"*\"] = star_end;\n $c89[star_end][0] = star_comment;\n\n //\n // State transitions for C++\n // Inherit transitions from C, and add line comment support\n //\n $cpp = $c89;\n $cpp[slash_begin][\"/\"] = line_comment;\n $cpp[line_comment][\"\\n\"] = normal_text;\n $cpp[line_comment][\"\\\\\"] = lc_escape;\n $cpp[line_comment][0] = line_comment;\n\n $cpp[lc_escape][\"\\r\"] = lc_escape;\n $cpp[lc_escape][0] = line_comment;\n\n //\n // State transitions for C99.\n // C99 supports line comments like C++\n //\n $c99 = $cpp;\n\n // State transitions for PL/I\n // Kinda like C\n $pli = $c89;\n\n //\n // State transitions for PHP\n // Inherit transitions from C++, and add perl-style line comment support\n $php = $cpp;\n $php[normal_text][\"#\"] = line_comment;\n $php[sq_literal][\"\\n\"] = sq_literal;\n $php[dq_literal][\"\\n\"] = dq_literal;\n\n //\n // State transitions for Perl\n $perl[normal_text][\"#\"] = line_comment;\n $perl[normal_text][\"\\\"\"] = dq_literal;\n $perl[normal_text][\"'\"] = sq_literal;\n $perl[normal_text][0] = normal_text;\n\n $perl[dq_literal][\"\\\"\"] = normal_text;\n $perl[dq_literal][\"\\\\\"] = dq_escape;\n $perl[dq_literal][0] = dq_literal;\n\n $perl[dq_escape][0] = dq_literal;\n\n $perl[sq_literal][\"'\"] = normal_text;\n $perl[sq_literal][\"\\\\\"] = sq_escape;\n $perl[sq_literal][0] = sq_literal;\n\n $perl[sq_escape][0] = sq_literal;\n\n $perl[line_comment][\"\\n\"] = normal_text;\n $perl[line_comment][0] = line_comment;\n\n $mirc[normal_text][\"\\\"\"] = dq_literal;\n $mirc[normal_text][\";\"] = line_comment;\n $mirc[normal_text][0] = normal_text;\n\n $mirc[dq_literal][\"\\\"\"] = normal_text;\n $mirc[dq_literal][\"\\\\\"] = dq_escape;\n $mirc[dq_literal][0] = dq_literal;\n\n $mirc[dq_escape][0] = dq_literal;\n\n $mirc[line_comment][\"\\n\"] = normal_text;\n $mirc[line_comment][0] = line_comment;\n\n $ruby = $perl;\n\n $python = $perl;\n\n $java = $cpp;\n\n $vb = $perl;\n $vb[normal_text][\"#\"] = normal_text;\n $vb[normal_text][\"'\"] = line_comment;\n\n $cs = $java;\n\n $pascal = $c89;\n $pascal[normal_text][\"(\"] = paren_begin;\n $pascal[normal_text][\"/\"] = slash_begin;\n $pascal[normal_text][\"{\"] = block_comment;\n\n $pascal[paren_begin][\"*\"] = star_comment;\n $pascal[paren_begin][\"'\"] = sq_literal;\n $pascal[paren_begin]['\"'] = dq_literal;\n $pascal[paren_begin][0] = normal_text;\n\n $pascal[slash_begin][\"'\"] = sq_literal;\n $pascal[slash_begin]['\"'] = dq_literal;\n $pascal[slash_begin]['/'] = line_comment;\n $pascal[slash_begin][0] = normal_text;\n\n $pascal[star_comment][\"*\"] = star_end;\n $pascal[star_comment][0] = star_comment;\n\n $pascal[block_comment][\"}\"] = normal_text;\n $pascal[block_comment][0] = block_comment;\n\n $pascal[line_comment][\"\\n\"] = normal_text;\n $pascal[line_comment][0] = line_comment;\n\n $pascal[star_end][\")\"] = normal_text;\n $pascal[star_end][\"*\"] = star_end;\n $pascal[star_end][0] = star_comment;\n\n $sql[normal_text]['\"'] = dq_literal;\n $sql[normal_text][\"'\"] = sq_literal;\n $sql[normal_text]['`'] = bt_literal;\n $sql[normal_text]['-'] = dash_begin;\n $sql[normal_text][0] = normal_text;\n\n $sql[dq_literal]['\"'] = normal_text;\n $sql[dq_literal]['\\\\'] = dq_escape;\n $sql[dq_literal][0] = dq_literal;\n\n $sql[sq_literal][\"'\"] = normal_text;\n $sql[sq_literal]['\\\\'] = sq_escape;\n $sql[sq_literal][0] = sq_literal;\n\n $sql[bt_literal]['`'] = normal_text;\n $sql[bt_literal]['\\\\'] = bt_escape;\n $sql[bt_literal][0] = bt_literal;\n\n $sql[dq_escape][0] = dq_literal;\n $sql[sq_escape][0] = sq_literal;\n $sql[bt_escape][0] = bt_literal;\n\n $sql[dash_begin][\"-\"] = line_comment;\n $sql[dash_begin][0] = normal_text;\n\n $sql[line_comment][\"\\n\"] = normal_text;\n $sql[line_comment][\"\\\\\"] = lc_escape;\n $sql[line_comment][0] = line_comment;\n\n $sql[lc_escape][\"\\r\"] = lc_escape;\n $sql[lc_escape][0] = line_comment;\n\n $xml[normal_text][\"<\"] = xml_tag_begin; \n $xml[normal_text][\"&\"] = html_entity; \n $xml[normal_text][0] = normal_text; \n $xml[html_entity][\";\"] = normal_text; \n $xml[html_entity][\"<\"] = xml_tag_begin;\n $xml[html_entity][0] = html_entity; \n $xml[xml_tag_begin][\"?\"] = xml_pi; \n $xml[xml_tag_begin][\"!\"] = line_comment; \n $xml[xml_tag_begin][0] = xml_tag; \n $xml[xml_tag][\">\"] = normal_text; \n $xml[xml_tag][\"\\\"\"] = dq_literal; \n $xml[xml_tag][\"'\"] = sq_literal; \n $xml[xml_tag][0] = xml_tag; \n $xml[xml_pi][\">\"] = normal_text; \n $xml[xml_pi][0] = xml_tag; \n $xml[line_comment][\">\"] = normal_text; \n $xml[line_comment][0] = line_comment; \n $xml[dq_literal][\"\\\"\"] = xml_tag; \n $xml[dq_literal][\"&\"] = dq_escape; \n $xml[dq_literal][0] = dq_literal; \n $xml[sq_literal][\"'\"] = xml_tag; \n $xml[sq_literal][\"&\"] = sq_escape; \n $xml[sq_literal][0] = sq_literal; \n $xml[dq_escape][\";\"] = dq_literal; \n $xml[dq_escape][0] = dq_escape; \n \n //\n // Main state transition table\n //\n $states = array(\n \"C89\" => $c89,\n \"C\" => $c99,\n \"C++\" => $cpp,\n \"PHP\" => $php,\n \"Perl\" => $perl,\n \"Java\" => $java,\n \"VB\" => $vb,\n \"C#\" => $cs,\n \"Ruby\" => $ruby,\n \"Python\" => $python,\n \"Pascal\" => $pascal,\n \"mIRC\" => $mirc,\n \"PL/I\" => $pli,\n \"SQL\" => $sql,\n \"XML\" => $xml,\n \"Scheme\" => $sch\n );\n\n\n //\n // Process functions\n //\n $process[\"C89\"][normal_text][sq_literal] = \"rtrim1\";\n $process[\"C89\"][normal_text][dq_literal] = \"rtrim1\";\n $process[\"C89\"][normal_text][slash_begin] = \"rtrim1\";\n $process[\"C89\"][normal_text][0] = \"syn_proc\";\n\n $process[\"C89\"][slash_begin][star_comment] = \"rtrim1\";\n $process[\"C89\"][slash_begin][0] = \"slash_putback\";\n\n $process[\"Scheme\"][sch_normal][sch_strlit] = \"sch_rtrim1\";\n $process[\"Scheme\"][sch_normal][sch_chrlit] = \"sch_rtrim1\";\n $process[\"Scheme\"][sch_normal][sch_numlit] = \"sch_rtrim1\";\n\n $process[\"SQL\"][normal_text][sq_literal] = \"rtrim1\";\n $process[\"SQL\"][normal_text][dq_literal] = \"rtrim1\";\n $process[\"SQL\"][normal_text][bt_literal] = \"rtrim1\";\n $process[\"SQL\"][normal_text][dash_begin] = \"rtrim1\";\n $process[\"SQL\"][normal_text][0] = \"syn_proc\";\n\n $process[\"SQL\"][dash_begin][line_comment] = \"rtrim1\";\n $process[\"SQL\"][dash_begin][0] = \"dash_putback\";\n\n $process[\"PL/I\"] = $process[\"C89\"];\n\n $process[\"C++\"] = $process[\"C89\"];\n $process[\"C++\"][slash_begin][line_comment] = \"rtrim1\";\n\n $process[\"C\"] = $process[\"C++\"];\n\n $process[\"PHP\"] = $process[\"C++\"];\n $process[\"PHP\"][normal_text][line_comment] = \"rtrim1\";\n\n $process[\"Perl\"][normal_text][sq_literal] = \"rtrim1\";\n $process[\"Perl\"][normal_text][dq_literal] = \"rtrim1\";\n $process[\"Perl\"][normal_text][line_comment] = \"rtrim1\";\n $process[\"Perl\"][normal_text][0] = \"syn_proc\";\n\n $process[\"Ruby\"] = $process[\"Perl\"];\n $process[\"Python\"] = $process[\"Perl\"];\n\n $process[\"mIRC\"][normal_text][dq_literal] = \"rtrim1\";\n $process[\"mIRC\"][normal_text][line_comment] = \"rtrim1\";\n $process[\"mIRC\"][normal_text][0] = \"syn_proc\";\n\n $process[\"VB\"] = $process[\"Perl\"];\n\n $process[\"Java\"] = $process[\"C++\"];\n\n $process[\"C#\"] = $process[\"Java\"];\n\n $process[\"Pascal\"] = $process[\"C++\"];\n $process[\"Pascal\"][normal_text][line_comment] = \"rtrim1\";\n $process[\"Pascal\"][normal_text][block_comment] = \"rtrim1\";\n $process[\"Pascal\"][normal_text][paren_begin] = \"rtrim1\";\n $process[\"Pascal\"][slash_begin][sq_literal] = \"slash_putback_rtrim1\";\n $process[\"Pascal\"][slash_begin][dq_literal] = \"slash_putback_rtrim1\";\n $process[\"Pascal\"][slash_begin][0] = \"slash_putback\";\n $process[\"Pascal\"][paren_begin][sq_literal] = \"lparen_putback_rtrim1\";\n $process[\"Pascal\"][paren_begin][dq_literal] = \"lparen_putback_rtrim1\";\n $process[\"Pascal\"][paren_begin][star_comment] = \"rtrim1\";\n $process[\"Pascal\"][paren_begin][0] = \"lparen_putback\";\n\n $process[\"XML\"][normal_text][xml_tag_begin] = \"rtrim1\";\n $process[\"XML\"][normal_text][html_entity] = \"rtrim1\";\n $process[\"XML\"][html_entity][xml_tag_begin] = \"rtrim1\";\n $process[\"XML\"][html_entity][0] = \"proc_void\";\n $process[\"XML\"][xml_tag_begin][xml_tag] = \"prepend_xml_opentag\";\n $process[\"XML\"][xml_tag_begin][xml_pi] = \"rtrim1\";\n $process[\"XML\"][xml_tag_begin][line_comment] = \"rtrim1\";\n $process[\"XML\"][line_comment][normal_text] = \"rtrim1_htmlesc\";\n $process[\"XML\"][xml_tag][normal_text] = \"rtrim1\";\n $process[\"XML\"][xml_tag][dq_literal] = \"rtrim1\";\n $process[\"XML\"][dq_literal][xml_tag] = \"rtrim1\";\n $process[\"XML\"][dq_literal][dq_escape] = \"rtrim1\";\n\n $process_end[\"C89\"] = \"syntax_highlight_helper\";\n $process_end[\"C++\"] = $process_end[\"C89\"];\n $process_end[\"C\"] = $process_end[\"C89\"];\n $process_end[\"PHP\"] = $process_end[\"C89\"];\n $process_end[\"Perl\"] = $process_end[\"C89\"];\n $process_end[\"Java\"] = $process_end[\"C89\"];\n $process_end[\"VB\"] = $process_end[\"C89\"];\n $process_end[\"C#\"] = $process_end[\"C89\"];\n $process_end[\"Ruby\"] = $process_end[\"C89\"];\n $process_end[\"Python\"] = $process_end[\"C89\"];\n $process_end[\"Pascal\"] = $process_end[\"C89\"];\n $process_end[\"mIRC\"] = $process_end[\"C89\"];\n $process_end[\"PL/I\"] = $process_end[\"C89\"];\n $process_end[\"SQL\"] = $process_end[\"C89\"];\n $process_end[\"Scheme\"] = \"sch_syntax_helper\";\n\n\n $edges[\"C89\"][normal_text .\",\". dq_literal] = '<span class=\"literal\">\"';\n $edges[\"C89\"][normal_text .\",\". sq_literal] = '<span class=\"literal\">\\'';\n $edges[\"C89\"][slash_begin .\",\". star_comment] = '<span class=\"comment\">/*';\n $edges[\"C89\"][dq_literal .\",\". normal_text] = '</span>';\n $edges[\"C89\"][sq_literal .\",\". normal_text] = '</span>';\n $edges[\"C89\"][star_end .\",\". normal_text] = '</span>';\n\n $edges[\"Scheme\"][sch_normal .\",\". sch_strlit] = '<span class=\"sch_str\">\"';\n $edges[\"Scheme\"][sch_normal .\",\". sch_numlit] = '<span class=\"sch_num\">';\n $edges[\"Scheme\"][sch_normal .\",\". sch_chrlit] = '<span class=\"sch_chr\">#';\n $edges[\"Scheme\"][sch_strlit .\",\". sch_normal] = '</span>';\n $edges[\"Scheme\"][sch_numlit .\",\". sch_normal] = '</span>';\n $edges[\"Scheme\"][sch_chrlit .\",\". sch_normal] = '</span>';\n\n $edges[\"SQL\"][normal_text .\",\". dq_literal] = '<span class=\"literal\">\"';\n $edges[\"SQL\"][normal_text .\",\". sq_literal] = '<span class=\"literal\">\\'';\n $edges[\"SQL\"][dash_begin .\",\". line_comment] = '<span class=\"comment\">--';\n $edges[\"SQL\"][normal_text .\",\". bt_literal] = '`';\n $edges[\"SQL\"][dq_literal .\",\". normal_text] = '</span>';\n $edges[\"SQL\"][sq_literal .\",\". normal_text] = '</span>';\n $edges[\"SQL\"][line_comment .\",\". normal_text] = '</span>';\n\n $edges[\"PL/I\"] = $edges[\"C89\"];\n\n $edges[\"C++\"] = $edges[\"C89\"];\n $edges[\"C++\"][slash_begin .\",\". line_comment] = '<span class=\"comment\">//';\n $edges[\"C++\"][line_comment .\",\". normal_text] = '</span>';\n\n $edges[\"C\"] = $edges[\"C++\"];\n\n $edges[\"PHP\"] = $edges[\"C++\"];\n $edges[\"PHP\"][normal_text .\",\". line_comment] = '<span class=\"comment\">#';\n\n $edges[\"Perl\"][normal_text .\",\". dq_literal] = '<span class=\"literal\">\"';\n $edges[\"Perl\"][normal_text .\",\". sq_literal] = '<span class=\"literal\">\\'';\n $edges[\"Perl\"][dq_literal .\",\". normal_text] = '</span>';\n $edges[\"Perl\"][sq_literal .\",\". normal_text] = '</span>';\n $edges[\"Perl\"][normal_text .\",\". line_comment] = '<span class=\"comment\">#';\n $edges[\"Perl\"][line_comment .\",\". normal_text] = '</span>';\n\n $edges[\"Ruby\"] = $edges[\"Perl\"];\n\n $edges[\"Python\"] = $edges[\"Perl\"];\n\n $edges[\"mIRC\"][normal_text .\",\". dq_literal] = '<span class=\"literal\">\"';\n $edges[\"mIRC\"][normal_text .\",\". line_comment] = '<span class=\"comment\">;';\n $edges[\"mIRC\"][dq_literal .\",\". normal_text] = '</span>';\n $edges[\"mIRC\"][line_comment .\",\". normal_text] = '</span>';\n\n $edges[\"VB\"] = $edges[\"Perl\"];\n $edges[\"VB\"][normal_text .\",\". line_comment] = '<span class=\"comment\">\\'';\n\n $edges[\"Java\"] = $edges[\"C++\"];\n\n $edges[\"C#\"] = $edges[\"Java\"];\n\n $edges[\"Pascal\"] = $edges[\"C89\"];\n $edges[\"Pascal\"][paren_begin .\",\". star_comment] = '<span class=\"comment\">(*';\n $edges[\"Pascal\"][paren_begin .\",\". dq_literal] = '<span class=\"literal\">\"';\n $edges[\"Pascal\"][paren_begin .\",\". sq_literal] = '<span class=\"literal\">\\'';\n $edges[\"Pascal\"][slash_begin .\",\". dq_literal] = '<span class=\"literal\">\"';\n $edges[\"Pascal\"][slash_begin .\",\". sq_literal] = '<span class=\"literal\">\\'';\n $edges[\"Pascal\"][slash_begin .\",\". line_comment] = '<span class=\"comment\">//';\n $edges[\"Pascal\"][normal_text . \",\" . block_comment] = '<span class=\"comment\">{';\n $edges[\"Pascal\"][line_comment . \",\" . normal_text] = '</span>';\n $edges[\"Pascal\"][block_comment . \",\" . normal_text] = '</span>';\n\n $edges[\"XML\"][normal_text . \",\" . html_entity] = '<span class=\"html_entity\">&';\n $edges[\"XML\"][html_entity . \",\" . normal_text] = '</span>';\n $edges[\"XML\"][html_entity . \",\" . xml_tag_begin] = '</span>';\n $edges[\"XML\"][xml_tag . \",\" . normal_text] = '></span>';\n $edges[\"XML\"][xml_tag_begin . \",\" . xml_pi] = '<span class=\"xml_pi\"><?';\n $edges[\"XML\"][xml_tag_begin . \",\" . line_comment] = '<span class=\"comment\"><!';\n $edges[\"XML\"][line_comment . \",\" . normal_text] = '></span>'; \n $edges[\"XML\"][xml_tag .\",\". dq_literal] = '<span class=\"literal\">\"';\n $edges[\"XML\"][dq_literal . \",\" . xml_tag] = '\"</span>';\n $edges[\"XML\"][dq_literal . \",\" . dq_escape] = '<span class=\"html_entity\">&';\n $edges[\"XML\"][dq_escape . \",\" . dq_literal] = '</span>';\n $edges[\"XML\"][xml_tag .\",\". sq_literal] = '<span class=\"literal\">\\'';\n $edges[\"XML\"][sq_literal . \",\" . xml_tag] = '\\'</span>';\n $edges[\"XML\"][sq_literal . \",\" . sq_escape] = '<span class=\"html_entity\">&'; \n $edges[\"XML\"][sq_escape . \",\" . sq_literal] = '</span>'; \n\n //\n // The State Machine\n //\n if (array_key_exists($language, $initial_state))\n $state = $initial_state[$language];\n else\n $state = normal_text;\n $output = \"\";\n $span = \"\";\n while (strlen($text) > 0)\n {\n $ch = substr($text, 0, 1);\n $text = substr($text, 1);\n\n $oldstate = $state;\n $state = (array_key_exists($ch, $states[$language][$state]))?\n $states[$language][$state][$ch] :\n $states[$language][$state][0];\n\n $span .= $ch;\n\n if ($oldstate != $state)\n {\n if (array_key_exists($language, $process) &&\n array_key_exists($oldstate, $process[$language]))\n {\n if (array_key_exists($state, $process[$language][$oldstate]))\n {\n $pf = $process[$language][$oldstate][$state];\n $output .= $pf($span, $language, $ch);\n }\n else\n {\n $pf = $process[$language][$oldstate][0];\n $output .= $pf($span, $language, $ch);\n }\n }\n else\n {\n $output .= $span;\n }\n\n if (array_key_exists($language, $edges) &&\n array_key_exists(\"$oldstate,$state\", $edges[$language]))\n $output .= $edges[$language][\"$oldstate,$state\"];\n\n $span = \"\";\n }\n }\n\n if (array_key_exists($language, $process_end) && $state == normal_text)\n $output .= $process_end[$language]($span, $language);\n else\n $output .= $span;\n\n if ($state != normal_text)\n {\n if (array_key_exists($language, $edges) &&\n array_key_exists(\"$state,\" . normal_text, $edges[$language]))\n $output .= $edges[$language][\"$state,\" . normal_text];\n }\n \n return $output;\n}",
"public static function getSyntaxHighlightingStyle()\n {\n $styles_library = array(\n 'agate',\n 'androidstudio',\n 'atom one dark',\n 'darcula',\n 'dark',\n 'gruvbox dark',\n 'hybrid',\n 'monokai sublime',\n 'obsidian',\n 'ocean'\n );\n return $styles_library;\n }",
"public function getHighlight()\n {\n return $this->highlight;\n }",
"public static function highlightBuilder()\n {\n return new wrappers\\HighlightWrapper();\n }",
"public function silo_highlights() {}",
"function GetHighlight() {\n $data = $this->db\n ->where('is_delete', 0)\n ->where('is_active', 1)\n ->limit(1)\n ->get('highlight')\n ->row_array();\n return $data;\n }",
"public function getHighlighting(): Highlighting\n {\n return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_HIGHLIGHTING, true);\n }",
"public function getSyntax() {}",
"public function getHighlightRegexPattern(){}",
"public function silo_highlights()\n\t{\n\t}",
"public function getHighlightUsePhraseHighlighter(): bool {}",
"public function getHighlightRegexPattern(): string {}",
"function &lispHighlight( $string )\r\n {\r\n $len = strlen( $string );\r\n $index = 0;\r\n $tmpstring = \"\";\r\n\r\n while ( $index < $len )\r\n {\r\n $char = $string[$index];\r\n if ( $char == ';' )\r\n {\r\n $end = strpos( $string, \"\\n\", $index );\r\n if ( $end === false )\r\n {\r\n $tmpstring .= \"<font color=\\\"orange\\\">\" . $this->sptobsp( substr( $string, $index ) ) . \"</font>\\n\";\r\n $index = $len;\r\n }\r\n else\r\n {\r\n $tmpstring .= \"<font color=\\\"orange\\\">\" . $this->sptobsp( substr( $string, $index, $end - $index ) ) . \"</font>\\n\";\r\n $index = $end + 1;\r\n }\r\n }\r\n else if ( $char == ' ' )\r\n {\r\n $tmpstring .= \" \";\r\n ++$index;\r\n }\r\n else if ( $char == '(' )\r\n {\r\n $end = strpos( $string, \" \", $index + 1 );\r\n $end_paren = strpos( $string, \")\", $index + 1 );\r\n if ( $end_paren < $end )\r\n $end = $end_paren;\r\n if ( $end === false )\r\n {\r\n $tmpstring .= \"(\";\r\n ++$index;\r\n }\r\n else\r\n {\r\n $tmpstring .= \"<font color=\\\"red\\\">(</font>\";\r\n $command = substr( $string, $index + 1, $end - $index - 1 );\r\n if ( preg_match( \"/(let|if|while)/i\", $command ) )\r\n {\r\n $tmpstring .= \"<font color=\\\"blue\\\">\" . $command . \"</font>\";\r\n }\r\n else if ( preg_match( \"/(defun|defvar)/i\", $command ) )\r\n {\r\n $name_end = strpos( $string, \" \", $end + 1 );\r\n if ( $name_end === false )\r\n {\r\n $tmpstring .= \"<font color=\\\"blue\\\">\" . $command . \"</font>\";\r\n $end = $len;\r\n }\r\n else\r\n {\r\n $name = substr( $string, $end + 1, $name_end - $end - 1 );\r\n $tmpstring .= \"<font color=\\\"blue\\\">\" . $command . \"</font> \";\r\n $tmpstring .= \"<font color=\\\"magenta\\\">\" . $name . \"</font>\";\r\n $end = $name_end;\r\n }\r\n }\r\n else\r\n {\r\n $tmpstring .= $command;\r\n }\r\n $index = $end;\r\n }\r\n }\r\n else if ( $char == ')' )\r\n {\r\n $tmpstring .= \"<font color=\\\"red\\\">)</font>\";\r\n ++$index;\r\n }\r\n else if ( $char == '\"' )\r\n {\r\n $end = strpos( $string, \"\\\"\", $index + 1 );\r\n if ( $end === false )\r\n {\r\n $tmpstring .= \"<font color=\\\"green\\\">\\\"\" . $this->sptobsp( substr( $string, $index + 1 ) ) . \"</font>\";\r\n $index = $len;\r\n }\r\n else\r\n {\r\n $tmpstring .= \"<font color=\\\"green\\\">\\\"\" . $this->sptobsp( substr( $string, $index + 1, $end - $index - 1 ) ) . \"\\\"</font>\";\r\n $index = $end + 1;\r\n }\r\n }\r\n else\r\n {\r\n $tmpstring .= $char;\r\n ++$index;\r\n }\r\n }\r\n $string = \"<br clear=\\\"all\\\"><p><table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\" border=\\\"0\\\"><tr><td bgcolor=\\\"#f0f0f0\\\"><pre>\" .\r\n $tmpstring . \"</pre></td></tr></table></p>\";\r\n\r\n return $string;\r\n\r\n// $string = preg_replace ( \"/(<)/\", \"<\", $string );\r\n// $string = preg_replace ( \"/(>)/\", \">\", $string );\r\n\r\n// // comments\r\n// $string = preg_replace ( \"#(;.*$)#m\", \"<font color=\\\"orange\\\">\\\\1</font>\", $string );\r\n\r\n// // indenting\r\n// $string = preg_replace( \"/( )/m\", \" \", $string );\r\n\r\n// $string = preg_replace( \"/(\\\"[^\\\"]*\\\")/\", \"<font color=\\\"green\\\">\\\\1</font>\", $string );\r\n\r\n// // some special characters\r\n// $string = preg_replace ( \"/([(){}+-]|\\[|\\])/\", \"<font color=\\\"red\\\">\\\\1</font>\", $string );\r\n\r\n// $string = preg_replace( \"/(defun|let|if|while)/\", \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n// // reserved words\r\n// // $string = preg_replace ( \"/(foreach|function|for|while|switch|as)/\", \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n\r\n// $string = preg_replace( \"/( [0-9]+)/\", \"<font color=\\\"green\\\">\\\\1</font>\", $string );\r\n\r\n// $string = preg_replace( \"/(\\$[a-zA-Z0-9]+)/\", \"<font color=\\\"#00ffff\\\">\\\\1</font>\", $string );\r\n\r\n// $string = \"<p><table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\" border=\\\"0\\\"><tr><td bgcolor=\\\"#f0f0f0\\\"><pre>\" .\r\n// $string . \"</pre></td></tr></table></p>\";\r\n\r\n// return $string;\r\n }",
"public function highlight() {\n\n // TODO: those characters seem ignored by htmlentities(). Converting manually for now, check out why.\n $open_tag = \\Quanta\\Common\\Api::string_normalize($this->delimiters[0]);\n $close_tag = \\Quanta\\Common\\Api::string_normalize($this->delimiters[1]);\n $highlighted = '<span class=\"qtag\">';\n $highlighted .= '<span class=\"qtag-open-close\">' . $open_tag . '</span><span class=\"qtag-name\">' . $this->tag . '</span>';\n foreach ($this->attributes as $attribute_name => $attribute_value) {\n if (($attribute_value != \"showtag\") && ($attribute_value != \"highlight\")) {\n $attribute_full = $attribute_name . (empty($attribute_value) ? '' : ('=' . $attribute_value));\n $highlighted .= '<span class=\"qtag-attribute-separator\">|</span>';\n $highlighted .= '<span class=\"qtag-attribute\">' . $attribute_full . '</span>';\n }\n }\n if (!empty($this->getTarget())) {\n $highlighted .= '<span class=\"qtag-target-separator\">:</span>';\n $highlighted .= '<span class=\"qtag-target\">' . $this->getTarget() . '</span>';\n }\n\n $highlighted .= '<span class=\"qtag-open-close\">' . $close_tag . '</span>';\n\n $highlighted .= '</span>';\n return $highlighted;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds pre & post flags to the domainname | function _addFlags() {
$this->host = ( $this->_checkValue( 'preFlags' ) ? $this->_checkValue( 'preFlags' ) . ' ' : '' )
. $this->host
. ( $this->_checkValue( 'postFlags' ) ? ' ' . $this->_checkValue( 'postFlags' ) : '' );
} | [
"function domain_migrate_modify_subdomain(&$sd_prefix, $sd_string, $sd_modify) {\n\n if (!empty($sd_string)) { \n switch($sd_modify) {\n \n case 'add': \n $sd_prefix = $sd_string . $sd_prefix;\n break; \n case 'subtract':\n $sd_pos = strpos($sd_prefix, $sd_string); \n if($sd_pos === 0) {\n $sd_prefix = substr($sd_prefix, strlen($sd_string)); \n } \n break; \n case 'no':\n break; \n } \n } \n}",
"function vpopmail_add_domain_ex($domain, $passwd, $quota = NULL, $bounce = NULL, $apop = NULL)\n{\n}",
"function vpopmail_add_domain($domain, $dir, $uid, $gid){}",
"public function testHookDomainRequestAlter() {\n // Set the request.\n $negotiator = \\Drupal::service('domain.negotiator');\n $negotiator->setRequestDomain($this->baseHostname);\n\n // Check that the property was added by our hook.\n $domain = $negotiator->getActiveDomain();\n $this->assertTrue($domain->foo1 == 'bar1', 'The foo1 property was set to <em>bar1</em> by hook_domain_request_alter');\n }",
"function multiserver_add_domain()\n\t{\n\t\tglobal $dnsserverips, $webserverips, $mailserverips, $mysqlserverips, $domainname, $ftpusername, $ftppassword, $quota, $upload, $download, $panelusername, $paneluserpass, $_insert, $email;\n\t\t$vars = $this->getVariable(array('dnsserverips', 'webserverips', 'mailserverips', 'mysqlserverips', 'domainname', 'ftpusername', 'ftppassword', 'quota', 'upload', 'download', 'panelusername', 'paneluserpass', '_insert', 'email'));\n\t\t$success = True;\n\n\t\tif (!$_insert) {\n\t\t\tif (!$this->beforeInputControls(\"adddomain\", array()))\n\t\t\t\treturn false;\n\t\t\t$inputparams = array(\n\n\t\t\t\t'domainname',\n\t\t\t\tarray('panelusername', 'lefttext' => 'Panel Username'),\n\t\t\t\tarray('paneluserpass', 'password_with_generate', 'lefttext' => 'Paneluser Password'),\n\t\t\t\tarray('ftpusername', 'lefttext' => 'FTP Username'),\n\t\t\t\tarray('ftppassword', 'password_with_generate', 'lefttext' => 'FTP Password'),\n\t\t\t\tarray('quota', 'default' => '200', 'lefttext' => \"Quota (MB)\"),\n\t\t\t\tarray('upload', 'default' => '200', 'lefttext' => \"Upload Bandwidth (KB/s)\"),\n\t\t\t\tarray('download', 'default' => '200', 'lefttext' => \"Download Bandwidth (KB/s)\"),\n\t\t\t\tarray('email', 'default' => $this->miscconfig['adminemail']),\n\t\t\t\tarray('dnsserverips', 'hidden&text', 'lefttext' => 'DNS Server IPs', 'default' => $this->miscconfig['defaultdnsserverips']),\n\t\t\t\tarray('webserverips', 'hidden&text', 'lefttext' => 'Webserver IPs', 'default' => $this->miscconfig['defaultwebserverips']),\n\t\t\t\tarray('mailserverips', 'hidden&text', 'lefttext' => 'Mailserver IPs', 'default' => $this->miscconfig['defaultmailserverips']),\n\t\t\t\tarray('mysqlserverips', 'hidden&text', 'lefttext' => 'MySQL Server IPs', 'default' => $this->miscconfig['defaultmysqlserverips']),\n\t\t\t\tarray('op', 'hidden', 'default' => __FUNCTION__)\n\t\t\t);\n\n\t\t\t$this->output .= \"(These will be done using ServerPlans in future)<br>\" . inputform5($inputparams);\n\t\t} else {\n\t\t\t$status = $this->status_active;\n\t\t\t$success = $success && $this->multiserver_add_domain_direct(compact('dnsserverips', 'webserverips', 'mailserverips', 'mysqlserverips', 'domainname', 'panelusername', 'paneluserpass', 'ftpusername', 'ftppassword', 'status', 'email', 'quota'));\n\t\t\t$success = $success && $this->setselecteddomain($domainname);\n\t\t\t$this->ok_err_text($success, 'Successfully added domain(s).', 'Failed to add domain (adddomain)');\n\t\t}\n\t\t$this->showSimilarFunctions('domain');\n\t\treturn $success;\n\t}",
"function dnssec_set_presigned($domain_name) {\n call_dnssec('set-presigned', $domain_name);\n}",
"function af_domaintolower( $fields ){\n\t\n\tforeach($fields as $index => $url){\n\t\t\t\n\t\tif( stripos($url, 'http://') === false and stripos($url, 'https://') === false ){\n\t\t\t$url = 'http://' . $url;\n\t\t\t$edited = true; // if http or https was added in code - remove it in the end\n\t\t}\n\t\t\t\t\n\t\t$domain = parse_url( $url, PHP_URL_HOST );\n\t\t$domain_lower = str_ireplace($domain, strtolower($domain), $url);\n\t\t$fields[$index] = $domain_lower;\n\t\t\n\t\tif( isset($edited) ){\n\t\t\t$fields[$index] = str_ireplace( array('http://', 'https://'), '', $fields[$index] );\t\n\t\t\tunset($edited);\n\t\t}\t\n\t}\n\treturn $fields;\n}",
"function vpopmail_add_alias_domain_ex($olddomain, $newdomain){}",
"private function _set_cookie_domain() {}",
"function ms_subdomain_constants() {}",
"function action_cdn_rename_domain() {\n $w3_plugin_cdn = & w3_instance('W3_Plugin_CdnAdmin');\n\n $total = $w3_plugin_cdn->get_rename_posts_count();\n\n $title = 'Modify attachment URLs';\n\n include W3TC_INC_DIR . '/popup/cdn_rename_domain.php';\n }",
"function ms_subdomain_constants()\n {\n }",
"function vpopmail_add_alias_domain_ex($olddomain, $newdomain)\n{\n}",
"private function formatDomain()\n {\n $this->printToScreen('formatDomain()');\n $this->domain = rtrim(str_replace(\"https://\",\"\",str_replace(\"http://\",\"\",strtolower($this->website))),\"/\");\n $this->printToScreen($this->domain);\n }",
"function hook_domain_validate_alter(array &$error_list, $hostname) {\n // Only allow TLDs to be .org for our site.\n if (substr($hostname, -4) != '.org') {\n $error_list[] = t('Only .org domains may be registered.');\n }\n}",
"private function updateHost(): void\n {\n if ($this->domainNotEmpty()) {\n $this->host = ($this->subdomain ? $this->subdomain . '.' : '') . $this->domain->__toString();\n } else {\n $this->host = '';\n }\n }",
"function guifi_domain_form($form_state, $params = array()) {\n global $user;\n\n guifi_log(GUIFILOG_TRACE,'function guifi_domain_form()',$params);\n\n if (empty($form_state['values']))\n $form_state['values'] = $params;\n $form_state['#redirect'] = FALSE;\n\n // if new domain, initializing variables\n if (($form_state['values']['sid'] == NULL) && ($params['add'] != NULL)) {\n $form_state['values']['sid'] = $params['add'];\n $form_state['values']['new'] = TRUE;\n if ($params['mname']) {\n $masteridqry = db_query(\"SELECT name FROM {guifi_dns_domains} WHERE name = '%s'\",$params['mname']);\n $mname = db_fetch_object($masteridqry);\n $form_state['values']['mname'] = $mname->name;\n $form_state['values']['name'] = $params['dname'].'.'.$params['mname'];\n } else {\n $form_state['values']['name'] = $params['dname'];\n }\n $form_state['values']['type'] = $params['type'];\n\n if ($params['scope'] == 'external') {\n $form_state['values']['ipv4'] = '';\n } else {\n $form_state['values']['ipv4'] = $params['ipv4'];\n }\n $form_state['values']['scope'] = $params['scope'];\n $form_state['values']['management'] = $params['management'];\n $form_state['values']['allow'] = 'disabled';\n $form_state['values']['hosts']['0']['new'] = TRUE;\n $form_state['values']['hosts']['0']['counter'] = '0';\n $form_state['values']['hosts']['0']['host'] = 'ns1';\n $form_state['values']['hosts']['0']['ipv4'] = $params['ipv4'];\n $form_state['values']['hosts']['0']['ipv6'] = $params['ipv6'];\n $form_state['values']['hosts']['0']['opt']['options'] = array( 'NS' => 'NS', 'MX' => '0' );\n }\n\n drupal_set_breadcrumb(guifi_node_ariadna($form_state['values']['sid']));\n\n // Check permissions\n if ($params['edit']){\n if (!guifi_domain_access('update',$params['edit'])){\n drupal_set_message(t('You are not authorized to edit this domain','error'));\n return;\n }\n }\n\n // Loading node & zone where the domain belongs to (some information will be used)\n $node = node_load(array('nid' => $form_state['values']['sid']));\n\n // Setting the breadcrumb\n drupal_set_breadcrumb(guifi_node_ariadna($form_state['values']['sid']));\n\n // if contact is NULL, then get it from the node or the user logged in drupal\n if (is_null($form_state['values']['notification']))\n if (guifi_notification_validate($node->notification)) {\n $form_state['values']['notification'] = $node->notification;\n } else {\n drupal_set_message(t('The service has not a valid email address as a contact. Using your email as a default. Change the contact mail address if necessary.'));\n $form_state['values']['notification'] = $user->mail;\n }\n\n if (isset($form_state['action'])) {\n guifi_log(GUIFILOG_TRACE,'action',$form_state['action']);\n if (function_exists($form_state['action'])) {\n if (!call_user_func_array($form_state['action'],\n array(&$form,&$form_state)))\n return $form;\n }\n }\n\n $form_weight = -20;\n if ($form_state['values']['id'])\n $form['id'] = array(\n '#type' => 'hidden',\n '#name' => 'id',\n '#value'=> $form_state['values']['id']\n );\n else\n $form['new'] = array(\n '#type' => 'hidden',\n '#name' => 'new',\n '#value'=> TRUE\n );\n\n if ($params['add'] != NULL){\n drupal_set_title(t('adding a new type %domain at %node',\n array('%node' => $node->nick,\n '%domain' => $form_state['values']['type']\n )));\n } else {\n drupal_set_title(t('edit domain %dname',array('%dname' => $form_state['values']['name'])));\n }\n\n // All preprocess is complete, now going to create the form\n\n $form['main'] = array(\n '#type' => 'fieldset',\n '#title' => t('Domain name main settings').' ('.\n $form_state['values']['name'].')',\n '#weight' => $form_weight++,\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n\n $form['main']['sid'] = array(\n '#type' => 'hidden',\n '#value'=> $form_state['values']['sid'],\n );\n\n $form['main']['type'] = array(\n '#type' => 'hidden',\n '#value'=> $form_state['values']['type'],\n );\n\n $form['main']['mname'] = array(\n '#type' => 'hidden',\n '#value'=> $form_state['values']['mname'],\n );\n\n $form['main']['scope'] = array(\n '#type' => 'hidden',\n '#value'=> $form_state['values']['scope'],\n );\n\n $form['main']['name'] = array(\n '#type' => 'textfield',\n '#size' => 32,\n '#maxlength' => 32,\n '#title' => t('Domain Name'),\n '#required' => TRUE,\n '#default_value' => $form_state['values']['name'],\n '#description' => t('The Domain Name'),\n '#weight' => $form_weight++,\n );\n\n $form['main']['notification'] = array(\n '#type' => 'textfield',\n '#size' => 60,\n '#maxlength' => 1024,\n '#title' => t('contact'),\n '#required' => TRUE,\n '#element_validate' => array('guifi_emails_validate'),\n '#default_value' => $form_state['values']['notification'],\n '#description' => t('Mails where changes on the domain will be notified, if many, separated by \\',\\'')\n .'<br />'\n .t('used for network administration.'),\n '#weight' => $form_weight++,\n );\n\n if ($form_state['values']['scope'] == 'external') {\n $form['main']['ipv4'] = array(\n '#type' => 'textfield',\n '#title' => t('Set the Nameserver IP Address'),\n '#size' => 16,\n '#maxlength' => 16,\n '#required' => TRUE,\n '#default_value'=> $form_state['values']['ipv4'],\n '#element_validate' => array('guifi_ipv4_validate'),\n '#description' => t('External scope: Put the Internet IP Address of NameServer.'),\n '#weight' => $form_weight++,\n );\n } else {\n $form['main']['ipv4'] = array(\n '#type' => 'hidden',\n '#default_value'=> $form_state['values']['ipv4'],\n );\n }\n\n $form['main']['settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Advanced domain name settings'),\n '#weight' => $form_weight++,\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n\n $form['main']['settings']['management'] = array(\n '#type' => 'select',\n '#title' => t('Management'),\n '#default_value' => $form_state['values']['management'],\n '#options' => array('automatic' => 'automatic', 'manual' => 'manual'),\n '#description' => t('Choose <strong>Automatic</strong> if you want to use your domain management with the utility for servers \"DNSServices\"')\n .'<br \\>'\n .t('Choose <strong>Manual</strong>, if you just want to keep track of your domain/hosts here but want to do the management in your server manually.'),\n );\n $form['main']['settings']['public'] = array(\n '#type' => 'select',\n '#title' => t('Public domain'),\n '#default_value' => $form_state['values']['public'],\n '#options' => array('yes' => 'Yes', 'no' => 'No'),\n '#description' => t('Choose <strong>Yes</strong> if you want your domain/subdomain can be delegated subdomains from other users. (Ex: DELEGATED.yourdomain.net.')\n .'<br/>'\n .t('Choose <strong>No</strong> if your domain/subdomain is private and you do not want to allow delegates subdomains.'),\n );\n $form['main']['settings']['allow'] = array(\n '#type' => 'radios',\n '#required' => TRUE,\n '#title' => t('Transfer Options'),\n '#default_value' => $form_state['values']['allow'],\n '#options' => array('slave' => t('Allow to be enslaved (Recommended)'), 'forward' => t('Allow Forward'), 'disabled' => t('Disabled')),\n '#description' => t('<strong>Enslaved</strong>, Allow other DNS servers on the network have an exact copy of the domain, so, if the original DNS does not work, can access to the hosts.')\n .'<br \\>'\n .t('<strong>Forward</strong>, Allow other DNS servers on the network to forward the request to the master server transparently saving bandwidth.')\n .'<br \\>'\n .t('<strong>Disabled</strong>, If you select this option, the management of your domain may not be transferred in any way, your domain will not be visible to other network servers.'),\n );\n\n $form['main']['settings']['defipv4'] = array(\n '#type' => 'textfield',\n '#title' => t(\"Default Domain IPv4 Address\"),\n '#default_value' => $form_state['values']['defipv4'],\n '#element_validate' => array('guifi_ipv4_validate'),\n '#description' => t(\"Ex: domain.net without hostname resolve this IPv4 Address, tends to be the same address as hostname: www.\")\n .\"<br />\"\n .t(\"leave it blank if not needed.\"),\n '#required' => FALSE,\n );\n $form['main']['settings']['defipv6'] = array(\n '#type' => 'textfield',\n '#title' => t(\"Default Domain IPv6 Address\"),\n '#default_value' => $form_state['values']['defipv6'],\n '#element_validate' => array('guifi_ipv6_validate'),\n '#description' => t(\"Ex: domain.net without hostname resolve this IPv6 Address, tends to be the same address as hostname: www.\")\n .\"<br />\"\n .t(\"leave it blank if not needed.\"),\n '#required' => FALSE,\n );\n\n $form['main']['settings']['externalmx'] = array(\n '#type' => 'textfield',\n '#title' => t(\"External Mailservers MX \"),\n '#default_value' => $form_state['values']['externalmx'],\n '#description' => t(\"Separated by ','. Put them here only if the mail servers are external, if they are not, leave it blank.\")\n .\"<br />\"\n .t(\"Internal MailServers should be configured in the advanced options of the hosts.\"),\n '#required' => FALSE,\n );\n $form['main']['settings']['externalns'] = array(\n '#type' => 'textfield',\n '#title' => t(\"External Namservers \"),\n '#default_value' => $form_state['values']['externalns'],\n '#description' => t(\"Separated by ','. Put external nameserver IP address if you need it, if they are not, leave it blank.\")\n .\"<br />\"\n .t(\"Internal domain Nameservers should be configured in the advanced options of the hosts.\"),\n '#required' => FALSE,\n );\n\n if ($form_state['values']['management'] == 'automatic') {\n if (function_exists('guifi_host_form')){\n $form = array_merge($form,\n call_user_func('guifi_host_form',\n $form_state['values'],\n $form_weight));\n }\n }\n // Comments\n $form_weight = 200;\n\n $form['comment'] = array(\n '#type' => 'textarea',\n '#title' => t('Comments'),\n '#default_value' => $form_state['values']['comment'],\n '#description' => t('This text will be displayed as an information of the domain.'),\n '#cols' => 60,\n '#rows' => 5,\n '#weight' => $form_weight++,\n );\n\n // save/validate/reset buttons\n $form['dbuttons'] = guifi_domain_buttons(FALSE,'',$form_weight);\n\n return $form;\n}",
"function vpopmail_add_alias_domain($domain, $aliasdomain)\n{\n}",
"protected function setHostnames() {\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'])) {\n\t\t\tif ($this->mode == self::MODE_DECODE) {\n\t\t\t\t$this->setHostnamesForDecoding();\n\t\t\t} else {\n\t\t\t\t$this->setHostnamesForEncoding();\n\t\t\t}\n\t\t\tif (substr($this->hostName, 0, 4) === 'www.') {\n\t\t\t\t$this->alternativeHostName = substr($this->hostName, 4);\n\t\t\t} elseif (substr_count($this->hostName, '.') === 1) {\n\t\t\t\t$this->alternativeHostName = 'www.' . $this->hostName;\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |