query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
See if a Given Session code looks valid
function validCode($request_code): bool { # Test to See Session Code is 32 character hexadecimal if (preg_match("/^[0-9a-f]{64}$/i",$request_code)) return true; #error_log("Invalid session code: $request_code"); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function check($code) {\n\t\t\n\t\t//isset($_SESSION) || session_start();\t\t\n\t\t//Verify code can not be empty\n\t\tif(empty($code) || empty($_SESSION[self::$seKey])) {\n\t\t\treturn false;\n\t\t}\n\t\t//session expired\n\t\tif(time() - $_SESSION[self::$seKey]['time'] > self::$expire) {\n\t\t\tunset($_SESSION[self::$seKey]);\n\t\t\treturn false;\n\t\t}\n\n\t\tif(strtolower($code) == strtolower($_SESSION[self::$seKey]['code'])) {\n\t\t\treturn true;\n\t\t}\t\t\n\n\t\treturn false;\n\t}", "private function verifySession()\n {\n if ((isset($this->session['id']))\n && (is_numeric($this->session['id']))\n && (isset($this->session['legit']))\n && ($this->session['legit'] === $this->sessionHash())\n ) {\n return true;\n }\n return false;\n }", "public function validate() {\n \n $session_id = 0;\n\t\t$session_hash = '';\n\t\n if (isset($GLOBALS[\"_COOKIE\"][\"sessionid\"])) { \n \t $cookie_array = explode('|', $GLOBALS[\"_COOKIE\"][\"sessionid\"]);\n\t\t\tif ($cookie_array[0]) {\n\t\t\t\t$session_id = $cookie_array[0];\n\t\t\t\t$session_hash = $cookie_array[1];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\n if (!($session_id && $session_hash)) { return false; }\n\n /* Pull the information for the SessionID out of the database. */\n\n $this->load($session_id);\n\t\tif ($this->sessionid == 0 || $this->expired == 1) {\n\t\t\treturn false;\n\t\t}\n\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n $session_string = $this->session;\n\n if ($session_hash == md5($session_string . $ipaddress . 'scfgshatfk')) {\n return true;\n } elseif ($session_hash == md5($session_string . 'scfgshatfk')) {\n return true; \n } else {\n\t\t\t$this->clear();\n\t\t\treturn false;\n\t\t}\n }", "function _session_is_valid(){\n\t\treturn session_is_valid($this->_state_session_id);\n\t}", "public function sessionIsValid()\n {\n return $this->authClient->sessionIsValid();\n }", "private function checkSessionId() {\r\n\r\n $hijackTest = FALSE;\r\n \r\n if ($this->hijackBlock) {\r\n $this->SQLStatement_GetSessionInfos->bindParam(':sid', $this->sessionId, PDO::PARAM_STR, $this->sid_len);\r\n $this->SQLStatement_GetSessionInfos->execute();\r\n $val = $this->SQLStatement_GetSessionInfos->fetchAll(PDO::FETCH_ASSOC);\r\n //var_dump($val);\r\n //echo \"<br> UA:\".$this->getUa().\"<br>\";\r\n if ($val[0][\"ua\"] ==$this->getUa()) {\r\n $hijackTest = TRUE;\r\n } else {\r\n $hijackTest = FALSE;\r\n }\r\n } else {\r\n $hijackTest = TRUE;\r\n }\r\n\r\n if ($hijackTest==TRUE) return true;\r\n else return false;\r\n \r\n }", "public function isValidSession(string $token):bool;", "public function session_valid()\n\t{\n\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\n\t\t$user_agent = $_SERVER['HTTP_USER_AGENT'];\n\n\t\t$ip_blacklist = [\n\t\t\t'0.0.0.0',\n\t\t\t'127.0.0.1'\n\t\t];\n\n\t\t$ua_blacklist = [\n\t\t\t'false',\n\t\t\tFALSE,\n\t\t\t'',\n\t\t\t'PHPUnit'\n\t\t];\n\n\t\tif (in_array($ip_address, $ip_blacklist) || in_array($user_agent, $ua_blacklist))\n\t\t{\n\t\t\t$this->sess_destroy();\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function checkSession()\n{\n if(sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh').md5($_SERVER['HTTP_USER_AGENT'].'afke'))\n != @$_SESSION['fingerprint'])\n {\n Flash::create('Session check failed');\n return false;\n }\n if(mt_rand(1, 20) == 1)\n {\n regenerateSession();\n }\n return true;\n}", "public function isValid()\n {\n // Initialize\n $bReturn = false;\n\n // Session should be started\n if (($this->_pStorage->status() == PHP_SESSION_ACTIVE )) {\n // Get stored UID\n $uidSaved = $this->_pStorage->getOffset(self::UID, APPLICATION_NAME);\n\n // Compare with the client uid\n $bReturn = ( $this->_iCRC == $uidSaved );\n } else {\n throw new \\Foundation\\Exception\\BadMethodCallException('The session was not successfully started.');\n }//if(...\n\n return $bReturn;\n }", "static public function sessionIsValid()\n {\n try {\n $ret = false;\n\n session_start();\n\n // TODO: Make sure this is correct\n if (isset($_SESSION) && $_SESSION['sessionkey']) {\n $ret = true;\n\n // Update last activity time stamp\n $_SESSION['LAST_ACTIVITY'] = time();\n } else {\n session_unset();\n session_destroy();\n }\n\n return $ret;\n } catch (Exception $e) {\n return false;\n }\n }", "public function verify_code($name, $code)\n {\n if (!$this->ci->config->item('captchas_enabled')) return true;\n\n $session_code = $this->ci->session->userdata('captcha_' . $name);\n\n if ($session_code !== null)\n {\n // delete the old image from cache\n $this->redis->del('captcha:' . $session_code);\n\n // the code matches\n if ($session_code == $code)\n {\n return true;\n }\n\n // generate a new code and image\n $new_code = $this->generate_code();\n $captcha_image = $this->generate_image($new_code);\n\n // code doesn't match, store the new captcha\n $this->ci->session->set_tempdata('captcha_' . $name, $new_code, 600);\n $this->redis->set('captcha:' . $new_code, serialize($captcha_image), ['ex'=> 120]);\n }\n else\n {\n return $session_code;\n }\n return false;\n }", "public function isValid()\n {\n return ($this->_code > 0) ? true : false;\n }", "public static function get_session_code(){\n\t\t$limit = ModelBruno::getMStime() - (24*3600*1000); //Cut 24H\n\t\t//For session where user_id exists, it means it's a fix session (no time limit!)\n\t\tSession::WhereNotNull('code')->where('u_at', '<', $limit)->whereNull('question_hashid')->getQuery()->update(['code' => null]);\n\n\t\t//Get a unique code number\n\t\t$length = 4;\n\t\t$tries = 5000;\n\t\t$code = null;\n\t\t$loop = true;\n\t\twhile($loop){\n\t\t\t$loop = false;\n\t\t\t$code = rand( pow(10, $length-1), pow(10, $length)-1 ); //for length 4, min is 1000, max is 9999\n\t\t\t//Find a unique md5\n\t\t\tif(Session::Where('code', $code)->first(array('id'))){\n\t\t\t\t$loop = true;\n\t\t\t\t$tries--;\n\t\t\t\tif($tries<=0){\n\t\t\t\t\t$tries = 5000;\n\t\t\t\t\t$length = $length + 2; //It's easier for user to insert a even number length, 4 6 8\n\t\t\t\t}\n\t\t\t\tif($length>8){\n\t\t\t\t\t$code = null;\n\t\t\t\t\t$loop = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $code;\n\t}", "private function isSessionValid($session)\n {\n return is_null(self::getSecurityToken()) || !$session || $session != self::getSecurityToken();\n }", "public function validateCurrentSession(){$this->lhDB->connect('ibdlhsession');self::getCurrentPhpSid();self::validatePhpSid();$this->lhDB->disconnect();if($this->valid){$uid=$this->uid;return $uid;}else{return false;}}", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "protected function IsValidCode($code)\n\t\t{\n\t\t\tif (preg_match('/^[a-z]{3}$/i', $code)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function isValidCodeMachine($codeMachine) {\n\tglobal $DB_DB;\n\t$request = $DB_DB->prepare(\"SELECT * FROM Machine WHERE codeMachine LIKE :codeMachine\");\n\n\ttry {\n\t\t$request->execute(array(\n\t\t\t'codeMachine' => $codeMachine\n\t\t));\n\t}\n\tcatch(Exception $e) {\n\t\tif($DEBUG_MODE)\n\t\t\techo $e;\n\t\treturn -2;\n\t}\n\n\tif($request->rowCount() != 0)\n\t\treturn false;\n\treturn true;\n}", "static public function isCurrentSessionValid() {\n\t\t$session = self::getCurrentSession();\n\t\t\n\t\tif (!empty($session)) {\n\t\t\t\n\t\t\t$now = new DateTime('now', new DateTimeZone('UTC'));\n\t\t\t$ssoSessionExpires = new DateTime($session->SSOSessionExpires);\n\t\t\t\n\t\t\tif ($ssoSessionExpires > $now) \n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t\tself::clearCurrentSession();\n\t\t\t}\n\t\t} \n\t\t\n\t\treturn false;\n\t}", "protected final function is_still_valid($session)\n {\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "private function check()\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}", "protected function isSessionValid() {\n if(empty($this->metadata)) {\n throw new \\RuntimeException(\n \"Session metadata key is missing from SESSION superglobal.\"\n );\n }\n return (\n $this->isValidFingerprint() === true &&\n (\n $this->metadata->isActive === true ||\n $this->isForwardedSession()\n )\n );\n }", "private static function verify() {\r\n\t\t// create code object for the given code we will be verifying\r\n\t\tif (!isset($_SESSION['user'])) {\r\n\t\t\tself::alertMessage('danger', 'Unable to find session user data. Try logging out and logging in again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$userID = $_POST['userID'] = $_SESSION['user']->getUserID();\r\n\t\t$code = new VerificationCode($_POST);\r\n\r\n\t\t// load and validate expected code from database\r\n\t\t$codeInDatabase = VerificationCodesDB::get($userID);\r\n\t\tif (is_null($codeInDatabase)) {\r\n\t\t\tself::alertMessage('danger', 'No active verification code found. Your code may have expired. Click \"Resend Code\" to send a new code to your phone.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// compare given/expected codes\r\n\t\tif ($code->getCode() !== $codeInDatabase->getCode()) {\r\n\t\t\tself::alertMessage('danger', 'The code you entered is incorrect. Please check your code and try again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// verification successful. mark phone number as verified\r\n\t\t$user = UsersDB::getUser($userID);\r\n\t\t$user->setIsPhoneVerified(true);\r\n\t\tUsersDB::edit($user);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// clean up and show dashboard\r\n\t\tVerificationCodesDB::clear($userID);\r\n\t\tDashboardView::show();\r\n\t}", "function hasValidUid()\n{\n return isset($_SESSION[\"state\"]) && isUid($_SESSION[\"state\"]);\n}", "protected function checkSession($args) {\n\n if ($args['ent_user_type'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 15);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], $args['ent_user_type']);\n\n if (is_array($returned))\n return $returned;\n else\n return $this->_getStatusMessage(73, 15);\n }", "protected function checkSessionToken() {}", "function is_validlogin($sessionID, $debug = false) {\n\t\t$q = (new QueryBuilder())->table('logperm');\n\t\t$q->field($q->expr(\"IF(validlogin = 'Y', 1, 0)\"));\n\t\t$q->where('sessionid', $sessionID);\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery();\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}" ]
[ "0.7383039", "0.63376766", "0.6312602", "0.63003135", "0.6235491", "0.6204099", "0.60853755", "0.60826063", "0.6047968", "0.60451895", "0.6043378", "0.60299194", "0.59063065", "0.5809733", "0.57624805", "0.57618713", "0.5720451", "0.5712945", "0.57014513", "0.567079", "0.56607014", "0.5660554", "0.5660554", "0.5635909", "0.5611238", "0.5610962", "0.56086946", "0.5601638", "0.55925125", "0.5578522" ]
0.7858994
0
function GenArray($mode = NULL, $params = NULL)
function GenArray($params = []) { if ($this->templateName == "admin_desktop"){ if (!isset($params[1])){ $mode = "users"; } else { $mode = $params[1]; } if ($mode === "qq_categories"){ $result = $this->genArrayCategories(); }elseif ($mode === "users"){ $result = $this->genArrayUsers(); }elseif ($mode === "qq"){ $currentCategoryId = $params[2]; $result = $this->genArrayQQ($currentCategoryId); }elseif ($mode === "qq_without_answer"){ $result = $this->genArrayQQWitoutAnswer(); }elseif ($mode === "answers"){ $currentQuestionId = $params[2]; $result = $this->genArrayAnswers($currentQuestionId); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function maker(): array;", "public function generate(): array;", "function getArray();", "abstract public function getArray();", "public function aArray() {}", "public function build(): array;", "public function build(): array;", "public function getArrayParameters(): array;", "function InicializaArray($Limite){\n\t\tfor($i = 1; $i <= $Limite; $i++) \n\t\t{ \n\t\t ${'array'}[$i] = 0; \n\t\t} \n\treturn $array;\n}", "function aarr(&$R,$nn,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"int8\",$n,$m);\t\t\t\n\t\t}", "public static function arrayWithObjects()\n {\n return new RsoArray(func_get_args());\n }", "public function generateArray()\r\n\t{\t\r\n\t\t$data = array('logID'=>$this->logID,'text'=>$this->Text,'timestamp'=>$this->timestamp, 'textid'=>$this->textID);\r\n\t\tif($this->user!=null)\r\n\t\t\t$data['user'] = $this->user->generateArray();\r\n\t\tif($this->building!=null)\r\n\t\t\t$data['building'] = $this->building->generateArray('normal');\r\n\t\tif($this->card!=null)\r\n\t\t\t$data['card']=$this->card->generateArray();\r\n\t\tif($this->location!=null)\r\n\t\t\t$data['location']=$this->location->generateArray();\r\n\t\tif($this->icon!=null)\r\n\t\t\t$data['icon']=$this->icon;\r\n\t\tif($this->game!=null)\r\n\t\t\t$data['game']=$this->game;\r\n\t\treturn $data;\r\n\t\r\n\t}", "function crearArray($ind1,$ind2,$val1,$val2,$n=5){\n\t\t$v=array();\n\t\t//Primero construyo el array\n\t\tfor($i=0;count($v)<$n;$i++){\n\t\t\t//Un random para el indice y otro para el valor contenido\n\t\t\t$indice=\"X\".rand($ind1,$ind2);//calcular un numero aleatorio entre ind1 y ind2\n\t\t\t$valor=rand($val1,$val2);\n\t\t\t$v[$indice]=$valor;\n\t\t}\n\t\t//Ahora que ya esta construido puede consultarla\n\t\t/*Se pueden devolver dos valores en el return?*/\n\t\tglobal $max; //La variable tiene que ser global\n\t\t$max=max($v); //El maximo del array\n\treturn $v; //Devuelve el array\n\t}", "function GenerateData(){\r\n\t\r\n\t$data = array();\r\n\r\n\tfor($i=0; $i<10000; $i++){\r\n\r\n\t\t$data[$i] = array(rand(0,6),rand(0,4),rand(0,4),rand(0,6),rand(0,3));\r\n \r\n\t}\r\n\r\nreturn $data;\t\r\n\t\r\n}", "public function params(): array;", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "function dynamicArray($n, $queries) {\n\n}", "public function AsArray();", "public function getArray($create = false) {}", "public function getArray($create = false) {}", "public function getParams() :array;", "function make()\n{\n return [];\n}", "abstract public function definition(): array;", "private function _paramArrGenerator( $funcParam, $args )\n\t{\n\t\t$paramArray = array();\n\n\t\tforeach ($funcParam as $key => $value) \n\t\t{\n\t\t\tif( isset( $args[ $value ] ) )\n\t\t\t\t$paramArray[] = $args[ $value ];\n\t\t}\n\n\t\treturn $paramArray;\n\t}", "abstract public function values(): array;", "protected function buildJSAbbreviationArray() {}", "public function parameters(): array;", "function createLibClassArray(){\n return array(\n \"MA2090\",\n \"ED3700\",\n \"ML4220\",\n \"EL1000\",\n \"VA2010\",\n \"PY2010\",\n \"HI2681\",\n \"BS2400\",\n \"BS2401\",\n \"MA2310\",\n \"ED3820\",\n \"ML1100\",\n \"EL2206\",\n \"VA2020\",\n \"PY3410\",\n \"AS2112\",\n \"CP2220\",\n \"CP2221\",\n \"CS2511\",\n \"ED3950\",\n \"ML1101\",\n \"EL4312\",\n \"VA2030\",\n \"PY3420\",\n \"HI3091\",\n \"BS2410\",\n \"BS2411\",\n \"CS2511\",\n \"EL3865\",\n \"VA3100\",\n \"HI2810\",\n \"HI3002\",\n \"HI3011\",\n \"HI3021\"\n );\n }", "public abstract function FetchArray();", "function C() {\n $arr = func_get_args();\n return Carr($arr);\n }" ]
[ "0.69954973", "0.67968947", "0.6660896", "0.6359964", "0.63305676", "0.6174535", "0.6174535", "0.6073001", "0.60497713", "0.5895262", "0.5868703", "0.582139", "0.57906157", "0.5784861", "0.5761005", "0.5758971", "0.57567227", "0.57567203", "0.5749407", "0.57469475", "0.57466054", "0.57312065", "0.56680954", "0.5634927", "0.5616168", "0.5614283", "0.56062675", "0.5594345", "0.55902636", "0.5578601" ]
0.7248972
0
Creates a form to delete a role entity.
private function createDeleteForm(Role $role) { return $this->createFormBuilder() ->setAction($this->generateUrl('role_delete', array('id' => $role->getId()))) ->setMethod('DELETE') ->getForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm(Roles $role)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_roles_delete', array('id' => $role->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }", "public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}", "function uc_roles_deletion_form($form, &$form_state, $account, $rid) {\n $expiration = db_query(\"SELECT expiration FROM {uc_roles_expirations} WHERE uid = :uid AND rid = :rid\", array(':uid' => $account->uid, ':rid' => $rid))->fetchField();\n if ($expiration) {\n\n $role_name = _uc_roles_get_name($rid);\n\n $form['user'] = array('#type' => 'value', '#value' => format_username($account->name));\n $form['uid'] = array('#type' => 'value', '#value' => $account->uid);\n $form['role'] = array('#type' => 'value', '#value' => $role_name);\n $form['rid'] = array('#type' => 'value', '#value' => $rid);\n\n $form = confirm_form(\n $form,\n t('Delete expiration of %role_name role for the user !user?', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n 'admin/user/user/expiration',\n t('Deleting the expiration will give !user privileges set by the %role_name role indefinitely unless manually removed.', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n t('Yes'),\n t('No')\n );\n }\n else {\n $form['error'] = array(\n '#markup' => t('Invalid user id or role id.'),\n );\n }\n\n return $form;\n}", "private function createDeleteForm(Event $event)\n {\n // $this->enforceUserSecurity('ROLE_USER');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('slug' => $event->getSlug())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function roleDelete(Role $role);", "private function createDeleteForm(Efunction $efunction)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('efunction_delete', array('id' => $efunction->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Acte $acte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acte_delete', array('id' => $acte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDeleteRole(DeleteRequest $request)\n {\n $id = \\Input::get('id');\n // $student = Student::find($id);\n $gen_user_role = GenUserRole::find($id);\n $gen_user_role->delete();\n return redirect('gen_user');\n }", "public function deleting(Role $role)\n {\n }", "private function createDeleteForm(MostraMizaUllirit $mostraMizaUllirit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mostramizaullirit_delete', array('id' => $mostraMizaUllirit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }", "public function getForm()\n {\n return new RoleForm;\n }", "private function createDeleteForm(Events $event) {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('events_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ArmasMedico $armasMedico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('armasmedico_delete', array('id' => $armasMedico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RhythmMaterial $rhythmMaterial)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rhythmmaterial_delete', array('id' => $rhythmMaterial->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Projecte $projecte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('projecte_delete', array('id' => $projecte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Musicien $musicien)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('musicien_delete', array('codeMusicien' => $musicien->getCodemusicien())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function executeDelete()\n {\n if($this->hasRequestParameter('ids')){\n $roles = array_reverse(RolePeer::retrieveByPKs(json_decode($this->getRequestParameter('ids'))));\n\n foreach($roles as $role){\n\t$role->delete();\n }\n\n }elseif($this->hasRequestParameter('id')){\n $role = RolePeer::retrieveByPk($this->getRequestParameter('id'));\n $role->delete();\n }\n\n $this->msg_alert = array('info', $this->getContext()->getI18N()->__(\"Rol borrado.\"));\n return $this->renderComponent('roles', 'list');\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Recette $recette)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('recette_delete', array('id' => $recette->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Team $entity)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('app_team_delete', array('id' => $entity->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "function travel_delete_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Show confirm dialog.\n $entity_uri = entity_uri('travel', $entity);\n $message = t('Are you sure you want to delete entity %title?', array('%title' => entity_label('travel', $entity)));\n return confirm_form(\n $form,\n $message,\n $entity_uri['path'],\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}" ]
[ "0.80152273", "0.69734687", "0.69086474", "0.6816056", "0.6799801", "0.6702436", "0.6464739", "0.64358765", "0.6387753", "0.6355804", "0.63335204", "0.63201606", "0.63201606", "0.63201606", "0.63067895", "0.6303177", "0.62701714", "0.62513304", "0.6242807", "0.62261164", "0.6204073", "0.6181939", "0.6166027", "0.61537284", "0.6152475", "0.61454445", "0.61361235", "0.6128081", "0.6126932", "0.61123484" ]
0.79986936
1
Cria o objeto button Alterar que recebe o indice do cadastro que vai alterar
function botaoAlterar($indiceCadastro){ echo " <form method='post'> <button type='submit' class='btn btn-outline-warning btn-sm' name='botaoAlterar' value='$indiceCadastro'><i class='material-icons'>create</i></button> </form>";//o botão vai receber o valor do indice correspondente a sua linha na tabela de cadastros }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeInputButton() {}", "public function editar()\n {\n }", "function bt_alterar_naoClick($sender, $params)\r\n {\r\n\r\n $this->hd_alterar_produto_numero->Value = '';\r\n $this->hd_alterar_produto_codigo->Value = '';\r\n $this->hd_alterar_produto_referencia->Value = '';\r\n $this->hd_alterar_produto_descricao->Value = '';\r\n $this->hd_alterar_produto_qtde->Value = '';\r\n $this->hd_alterar_produto_preco->Value = '';\r\n $this->hd_alterar_produto_valor_total->Value = '';\r\n $this->hd_alterar_produto_lote->Value = '';\r\n $this->hd_alterar_produto_unidade->Value = '';\r\n $this->hd_alterar_produto_ipi->Value = '';\r\n $this->hd_alterar_produto_valor_ipi->Value = '';\r\n\r\n $this->alterar_produto->Top = 1188;\r\n $this->alterar_produto->Visible = false;\r\n }", "public function create_edit_aluno()\n\t\t{\n\t\t\t//agora carregar todos os alunos acordo com o curso\n\t\t\t$this->data['alunos'] = $this->Aluno_model->get_aluno_por_curso($this->data['Turma']['curso_id'],$this->data['Turma']['id']);\n\t\t\t$this->view(\"turma/create_edit_aluno\",$this->data);\n\t\t}", "protected function editar()\n {\n }", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "function rt_button_edit($target)\n{\n return rt_ui_button('edit', $target, 'pencil');\n}", "public static function createEdTablebutton($table='no_table_provided',$id=0){\n\t\tif(empty($id)) return \"<span>xEdx</span>\";\n\t\treturn \"<button type='button' class='btn_edit' onclick='btnEditTableItem(\\\"{$table}\\\",{$id});'>edit</button>\";\n\t}", "public function getButton() {}", "public function editar ()\n {\n try {\n // Define a ação de editar\n $acao = Orcamento_Business_Dados::ACTION_EDITAR;\n \n if ( $this->_requisicao->isGet () ) {\n // Retorna parâmetros informados via get, após validações\n $parametros = $this->trataParametroGet ( 'cod' );\n \n // Busca os dados a exibir, após validações\n $registro = $this->trataRegistro ( $acao, $parametros );\n \n // Cria o formulário populado com os dados\n $formulario = $this->popularFormulario ( $acao, $registro );\n \n // Faz transformações no formulário, se necessário\n $formulario = $this->transformaFormulario ( $formulario, $acao );\n \n // Bloqueia a edição de campos de chave primária (ou composta)\n $this->bloqueiaCamposChave ( $formulario );\n \n // Bloqueia todos os campos\n $this->bloqueiaCamposTodos ( $acao, $formulario, $registro );\n \n // Exibe o formulário\n $this->view->formulario = $formulario;\n } else {\n // Cria o formulário vazio\n $formulario = $this->retornaFormulario ( $acao );\n \n // Grava o novo registro\n $this->gravaDados ( $acao, $formulario );\n }\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "public function set_button($button) { $this->button = $button; }", "public function addButton(\\SetaPDF_FormFiller_Field_Button $button) {}", "public function cerraModal(){\n\n $this->folio='';\n\n $this->nombre= ''; \n\n $this->apellido_p= '';\n\n $this->apellido_m= '';\n\n $this->puesto= ''; \n }", "public function constructArrayButton()\n { \n //- récupération des boutons par défaut\n $arra_bouton=parent::constructArrayButton();\n \n //- suppression des boutons superflus\n unset($arra_bouton['actionNew']);\n \n //- récupération du modèle\n $obj_model=$this->getModel();\n \n //- s'il n'y a pas d'historique de déplacement \n if(!$obj_model->getHasHisto())\n {\n unset($arra_bouton['actionBack']);\n } \n \n return $arra_bouton;\n }", "public function addsButtons() {}", "function bt_fecharClick($sender, $params)\r\n {\r\n\r\n $this->mgt_nota_fiscal_data_ini->Text = '';\r\n $this->mgt_nota_fiscal_data_fim->Text = '';\r\n $this->mgt_nota_fiscal_numero->Text = '';\r\n\r\n //*** Limpa a Tabela de Cobrancas ***\r\n\r\n $Comando_SQL = \"TRUNCATE TABLE mgt_swap_cobrancas\";\r\n\r\n GetConexaoPrincipal()->SQL_Comunitario->Close();\r\n GetConexaoPrincipal()->SQL_Comunitario->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_Comunitario->Open();\r\n GetConexaoPrincipal()->SQL_Comunitario->Close();\r\n\r\n //*** Fecha a Tela de Cobranca ***\r\n\r\n redirect('frame_corpo.php');\r\n }", "function eventclass_TambahPergerakan()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "function bindActionButtonObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'ActionButtons', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->actionbutton_id))\r\n\t {\r\n\t $table->load( $this->actionbutton_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t $key_name = $prop;\r\n\t\t if (!array_key_exists($key_name, $properties))\r\n\t\t {\r\n\t\t $this->$key_name = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}", "function edit_insert_button($caption, $js_onclick, $title = '')\t{\n\t?>\n\tif (toolbar) {\n\t\tvar theButton = document.createElement('input');\n\t\ttheButton.type = 'button';\n\t\ttheButton.value = '<?php echo $caption; ?>';\n\t\ttheButton.onclick = <?php echo $js_onclick; ?>;\n\t\ttheButton.className = 'ed_button';\n\t\ttheButton.title = \"<?php echo $title; ?>\";\n\t\ttheButton.id = \"<?php echo \"ed_{$caption}\"; ?>\";\n\t\ttoolbar.appendChild(theButton);\n\t}\n\t\n<?php }", "public function edit_toko(){\n\t}", "public function annimalEditAction()\n {\n }", "function botaoExcluir($indiceCadastro){\n echo \"\n <form method='post'>\n <button type='submit' class='btn btn-outline-danger btn-sm' name='botaoExcluir' value='$indiceCadastro'><i class='material-icons'>delete</i></button>\n </form>\";//o botão vai receber o valor do indice correspondente a sua linha na tabela de cadastros\n }", "public function edit()\n {\n \n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "function add_ind_button($buttons) {\n\tarray_push($buttons, 'Indizar');\n\treturn $buttons;\n}" ]
[ "0.63423556", "0.6075979", "0.6075357", "0.6016722", "0.6013879", "0.59494007", "0.5862443", "0.57042223", "0.57017875", "0.56977326", "0.56298447", "0.55922425", "0.55315554", "0.5508346", "0.54967076", "0.5489526", "0.54884547", "0.5483526", "0.5483503", "0.5466931", "0.54647374", "0.54439414", "0.54267085", "0.54097307", "0.540875", "0.53914225", "0.53914225", "0.53914225", "0.53864104", "0.537043" ]
0.6786495
0
Example: require_once ('class.tx_cal_api.php'); $calAPI = &tx_cal_functions::makeInstance('tx_cal_api',$this>cObj, &$conf); $event = $calAPI>findEvent('2','tx_cal_phpicalendar');
function tx_cal_api_with(&$cObj, &$conf){ //global $TCA,$_EXTKEY; $this->cObj = &$cObj; $this->conf = &$conf; if(!$GLOBALS['TCA']){ $GLOBALS['TSFE']->includeTCA(); } $this->conf['useInternalCaching'] = 1; $this->conf['cachingEngine'] = 'cachingFramework'; $this->conf['writeCachingInfoToDevlog'] = 0; $GLOBALS['TSFE']->settingLocale(); $this->controller = &t3lib_div :: makeInstance('tx_cal_controller'); $this->controller->cObj = &$this->cObj; $this->controller->conf = &$this->conf; $this->controller->setWeekStartDay(); require_once(t3lib_extMgm::extPath('cal').'model/class.tx_cal_date.php'); require_once(t3lib_extMgm::extPath('cal').'res/pearLoader.php'); $this->controller->cleanPiVarParam($this->piVars); $this->controller->clearPiVarParams(); $this->controller->getParamsFromSession(); $this->controller->initCaching(); $this->controller->initConfigs(); tx_cal_controller::initRegistry($this->controller); $this->rightsObj = &tx_cal_registry::Registry('basic','rightscontroller'); $this->rightsObj = t3lib_div::makeInstanceService('cal_rights_model', 'rights'); $this->rightsObj->setDefaultSaveToPage(); $this->modelObj = &tx_cal_registry::Registry('basic','modelcontroller'); $this->modelObj = tx_cal_functions::makeInstance('tx_cal_modelcontroller'); $this->viewObj = &tx_cal_registry::Registry('basic','viewcontroller'); $this->viewObj = tx_cal_functions::makeInstance('tx_cal_viewcontroller'); /*$this->rightsObj = &tx_cal_registry::Registry('basic','rightscontroller'); $this->modelObj = &tx_cal_registry::Registry('basic','modelcontroller'); $this->viewObj = &tx_cal_registry::Registry('basic','viewcontroller');*/ return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }", "protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }", "public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }", "public static function getCalendarApplication();", "public function getEvent(): EventInterface;", "public function getEvent();", "public function testAntBackendGetEvent()\r\n\t{\r\n\t\t// Set testing timezone\r\n\t\t//$cur_tz = date_default_timezone_get();\r\n\t\t//date_default_timezone_set('America/Los_Angeles'); // -8\r\n\r\n\t\t$calid = GetDefaultCalendar($this->dbh, $this->user->id);\r\n\r\n\t\t// Create a new calendar event for testing\r\n\t\t$event = new CAntObject_CalendarEvent($this->dbh, null, $this->user);\r\n\t\t$event->setValue(\"name\", \"UnitTest Event\");\r\n\t\t$event->setValue(\"ts_start\", \"10/8/2011 2:30 PM\");\r\n\t\t$event->setValue(\"ts_end\", \"10/8/2011 3:30 PM\");\r\n\t\t$event->setValue(\"calendar\", $calid);\r\n\t\t$rp = $event->getRecurrencePattern();\r\n\t\t$rp->type = RECUR_MONTHLY;\r\n\t\t$rp->dayOfMonth = 1;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"11/1/2011\";\r\n\t\t$eid = $event->save();\r\n\r\n\t\t// Get the event and make sure the recurrence is set right\r\n\t\t$syncEvent = $this->backend->getAppointment($eid);\r\n\t\t$this->assertEquals($syncEvent->subject, $event->getValue(\"name\"));\r\n\t\t$this->assertEquals($syncEvent->recurrence->type, 2); // 2 = monthly\r\n\t\t$this->assertEquals($syncEvent->recurrence->dayofmonth , 1);\r\n\r\n\t\t// Cleanup\r\n\t\t$event->removeHard();\r\n\t}", "public function calendar_get_list($ews,$startdate, $enddate){\n\t\t// Set init class\n\t\t$request = new EWSType_FindItemType();\n\t\t// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED\n\t\t// to identify \"soft deleted\" items, i.e. not visible and not in the trash can.\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t// This identifies the set of properties to return in an item or folder response\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;//Returns ID_ONLY - DEFAULT_PROPERTIES - ALL_PROPERTIES\n\t\t\n\t\t// Define the timeframe to load calendar items\n\t\t$request->CalendarView = new EWSType_CalendarViewType();\n\t\t$request->CalendarView->StartDate = $startdate; // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00\n\t\t$request->CalendarView->EndDate = $enddate; // an ISO8601 date later than the above\n\t\t\n\t\t// Only look in the \"calendars folder\"\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add events to array if event(s) were found in the timeframe specified\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($events)){\n\t\t\t\t$events = \"No Events Found\"; \t\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $events; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }", "private function getCalendar($calendar_obj_list, $cal_id){\n\t\t$main_cal_obj = false;\n\t\tforeach($calendar_obj_list as $cal){\n\t\t\tif($cal->getId() == $cal_id){\n\t\t\t\t$main_cal_obj = $cal;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!is_object($main_cal_obj) && is_object($calendar_obj_list[0])){\n\t\t\t// they specified an incorrect calendar id\n\t\t\t// just use the first calendar\n\t\t\t$main_cal_obj = $calendar_obj_list[0];\n\t\t}\n\t\treturn $main_cal_obj;\n\t}", "function get_event(){\n\t\tglobal $EM_Event;\n\t\tif( is_object($EM_Event) && $EM_Event->event_id == $this->event_id ){\n\t\t\treturn $EM_Event;\n\t\t}else{\n\t\t\tif( is_numeric($this->event_id) && $this->event_id > 0 ){\n\t\t\t\treturn em_get_event($this->event_id, 'event_id');\n\t\t\t}elseif( is_array($this->bookings) ){\n\t\t\t\tforeach($this->bookings as $EM_Booking){\n\t\t\t\t\t/* @var $EM_Booking EM_Booking */\n\t\t\t\t\treturn em_get_event($EM_Booking->event_id, 'event_id');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn em_get_event($this->event_id, 'event_id');\n\t}", "public function getEvent() {\n\t}", "public static function Get(){\n static $inst = NULL;\n if( $inst == NULL )\n $inst = new Calendar();\n return( $inst );\n }", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function cal()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Start up\n\t\t// -------------------------------------\n\n\t\t$this->get_first_day_of_week();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date',\n\t\t\t\t//'default' => 'today'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_days',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => 1\n\t\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_months',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_years',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2359'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'day_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '10'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '0'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'pad_short_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'bool',\n\t\t\t\t'default' => 'yes',\n\t\t\t\t'allowed_values' => array('yes', 'no')\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// Let's go build us a gosh darn calendar!\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "public function getCalendarPage();", "public function testFactory()\r\n\t{\r\n\t\t$obj = CAntObject::factory($this->dbh, \"calendar_event\");\r\n\t\t$this->assertTrue($obj instanceof CAntObject_CalendarEvent);\r\n\t}", "public function getEvent()\n {\n $result = new stdClass;\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $event = $kronolith_driver->getEvent($this->vars->id, $this->vars->date);\n $event->setTimezone(true);\n $result->event = $event->toJson(null, true, $GLOBALS['prefs']->getValue('twentyFour') ? 'H:i' : 'h:i A');\n // If recurring, we need to format the dates of this instance, since\n // Kronolith_Driver#getEvent will return the start/end dates of the\n // original event in the series.\n if ($event->recurs() && $this->vars->rsd) {\n $rs = new Horde_Date($this->vars->rsd);\n $result->event->rsd = $rs->strftime('%x');\n $re = new Horde_Date($this->vars->red);\n $result->event->red = $re->strftime('%x');\n }\n } catch (Horde_Exception_NotFound $e) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n }\n\n return $result;\n }", "public function getEventDispatch();", "function getEvent($idEvent)\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT * FROM bdd_satisfevent.events WHERE idEvents = ?');\n $request->execute(array($idEvent));\n $result = $request->fetchAll();\n return $result[0];\n}", "function fetch_feed($cal, $start, $end) {\n $url = build_calendar_url($cal, $start, $end);\n $json = @file_get_contents($url);\n if ( !$json ) { throw new Exception(\"Unable to obtain feed for `\". $cal . \"`\"); }\n\n return json_decode($json, true);\n}", "function getCalendarEvents() {\n$client = getClient();\n$service = new Google_Service_Calendar($client);\n\n// Print the next 10 events on the user's calendar.\n$calendarId = 'primary';\n$optParams = array(\n 'maxResults' => 10,\n 'orderBy' => 'startTime',\n 'singleEvents' => TRUE,\n 'timeMin' => date('c'),\n);\n$results = $service->events->listEvents($calendarId, $optParams);\n\nif (count($results->getItems()) == 0) {\n print \"No upcoming events found.\\n\";\n} else {\n print \"Upcoming events:\\n\";\n foreach ($results->getItems() as $event) {\n $start = $event->start->dateTime;\n if (empty($start)) {\n $start = $event->start->date;\n }\n printf(\"%s (%s)\\n\", $event->getSummary(), $start);\n }\n}\n}", "function getEventById()\n\t{\n\t\t//echo \" From ByID: \" . $this->_id;\n\t\t$eventId = 1;\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%d.%m.%Y')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%H:%i')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_end, '%H:%i')\");\n\t\t$query->select($db->nameQuote('t1.s_category'));\n\t\t$query->select($db->nameQuote('t1.s_place'));\n\t\t$query->select($db->nameQuote('t1.s_price'));\n\t\t$query->select($db->nameQuote('t1.idt_drivin_event'));\n\t\t$query->select($db->nameQuote('t1.n_num_part'));\n\t\t$query->select('t1.`n_num_part` - (SELECT COUNT(t2.`idt_drivin_event_apply`) ' .\n\t\t\t' FROM #__jevent_events_apply as t2 ' .\n\t\t\t' WHERE t2.`idt_drivin_event` = t1.`idt_drivin_event` AND t2.dt_cancel is null) as n_num_free');\n\t\t$query->from('#__jevent_events as t1');\n\t\t$query->where($db->nameQuote('idt_drivin_event') . '=' . $this->_id);\n\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t}\n\t\t//echo \" From ByID: \" . count($link);\n\t\t//echo \" From ByID: \" . $query;\n\t\treturn $link;\n\t}", "public function icalendar()\n\t{\n\t\t$s = 'EJURI3ia8aj#912IKa';\n\t\t$r = '#';\n\t\t$e = 'aAEah38a;a33';\n\n\t\t// -------------------------------------\n\t\t// Some dummy tagdata we'll hand off to events()\n\t\t// -------------------------------------\n\n\t\t$vars = array(\n\t\t\t'event_title'\t\t\t\t\t=> 'title',\n\t\t\t'event_id'\t\t\t\t\t\t=> 'id',\n\t\t\t'event_summary'\t\t\t\t\t=> 'summary',\n\t\t\t'event_location'\t\t\t\t=> 'location',\n\t\t\t'event_start_date format=\"%Y\"'\t=> 'start_year',\n\t\t\t'event_start_date format=\"%m\"'\t=> 'start_month',\n\t\t\t'event_start_date format=\"%d\"'\t=> 'start_day',\n\t\t\t'event_start_date format=\"%H\"'\t=> 'start_hour',\n\t\t\t'event_start_date format=\"%i\"'\t=> 'start_minute',\n\t\t\t'event_end_date format=\"%Y\"'\t=> 'end_year',\n\t\t\t'event_end_date format=\"%m\"'\t=> 'end_month',\n\t\t\t'event_end_date format=\"%d\"'\t=> 'end_day',\n\t\t\t'event_end_date format=\"%H\"'\t=> 'end_hour',\n\t\t\t'event_end_date format=\"%i\"'\t=> 'end_minute',\n\t\t\t'event_calendar_tz_offset'\t\t=> 'tz_offset',\n\t\t\t'event_calendar_timezone'\t\t=> 'timezone'\n\t\t);\n\n\t\t$rvars = array(\n\t\t\t'rule_type',\n\t\t\t'rule_start_date',\n\t\t\t'rule_repeat_years',\n\t\t\t'rule_repeat_months',\n\t\t\t'rule_repeat_days',\n\t\t\t'rule_repeat_weeks',\n\t\t\t'rule_days_of_week',\n\t\t\t'rule_relative_dow',\n\t\t\t'rule_days_of_month',\n\t\t\t'rule_months_of_year',\n\t\t\t'rule_stop_by',\n\t\t\t'rule_stop_after'\n\t\t);\n\n\t\t$evars = array(\n\t\t\t'exception_start_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t$ovars = array(\n\t\t\t'occurrence_start_date format=\"%Y%m%dT%H%i00\"',\n\t\t\t'occurrence_end_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing tagdata');\n\n\t\t$summary_field = ee()->TMPL->fetch_param('summary_field', 'event_title');\n\n\t\tee()->TMPL->tagdata =\timplode($s, array(\n\t\t\tLD . $summary_field . RD,\n\t\t\tLD . 'event_id' . RD,\n\t\t\tLD . 'if event_summary' . RD .\n\t\t\t\tLD . 'event_summary' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'if event_location' . RD .\n\t\t\t\tLD . 'event_location' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'event_start_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_calendar_tz_offset' . RD,\n\t\t\tLD . 'event_calendar_timezone' . RD,\n\t\t\t'RULES' .\n\t\t\t\tLD . 'if event_has_rules' . RD .\n\t\t\t\tLD . 'rules' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $rvars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'rules' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'OCCURRENCES'.\n\t\t\t\tLD . 'if event_has_occurrences' . RD .\n\t\t\t\tLD . 'occurrences' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $ovars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'occurrences' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'EXCEPTIONS'.\n\t\t\t\tLD . 'if event_has_exceptions' . RD .\n\t\t\t\tLD . 'exceptions' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $evars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'exceptions' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t$e\n\t\t));\n\n\t\t$tvars \t\t\t\t\t= ee()->functions->assign_variables(\n\t\t\tee()->TMPL->tagdata\n\t\t);\n\t\tee()->TMPL->var_single \t= $tvars['var_single'];\n\t\tee()->TMPL->var_pair \t= $tvars['var_pair'];\n\t\tee()->TMPL->tagdata \t= ee()->functions->prep_conditionals(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tarray_keys($vars)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Fire up events()\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Firing up Events()');\n\n\t\t$tagdata = ee()->TMPL->advanced_conditionals($this->events());\n\n\t\t// -------------------------------------\n\t\t// Collect the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting events');\n\n\t\t$events = explode($e, $tagdata);\n\n\t\t// -------------------------------------\n\t\t// Fire up iCalCreator\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting iCalCreator');\n\n\t\tif ( ! class_exists('vcalendar'))\n\t\t{\n\t\t\trequire_once 'libraries/icalcreator/iCalcreator.class.php';\n\t\t}\n\n\t\t$ICAL = new vcalendar();\n\n\t\t//we are setting this manually because we need individual ones for each event for this to work\n\t\t//$ICAL->setConfig('unique_id', parse_url(ee()->config->item('site_url'), PHP_URL_HOST));\n\t\t$host = parse_url(ee()->config->item('site_url'), PHP_URL_HOST);\n\n\n\t\t$vars = array_values($vars);\n\n\t\t//ee()->TMPL->log_item('Calendar: Iterating through the events');\n\n\t\tforeach ($events as $key => $event)\n\t\t{\n\t\t\tif (trim($event) == '') continue;\n\n\t\t\t$E \t\t\t\t= new vevent();\n\n\t\t\t$event \t\t\t= explode($s, $event);\n\t\t\t$rules \t\t\t= '';\n\t\t\t$occurrences \t= '';\n\t\t\t$exceptions \t= '';\n\n\t\t\tforeach ($event as $k => $v)\n\t\t\t{\n\t\t\t\tif (isset($vars[$k]))\n\t\t\t\t{\n\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t//\tMakes the local vars from above, if available:\n\t\t\t\t\t// \t$title, $summary, $location,\n\t\t\t\t\t// $start_year, $start_month, $start_day,\n\t\t\t\t\t// $start_hour, $start_minute, $end_year,\n\t\t\t\t\t// $end_month, $end_day, $end_hour,\n\t\t\t\t\t// \t$end_minute, $tz_offset, $timezone\n\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t$$vars[$k] = $v;\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 5) == 'RULES')\n\t\t\t\t{\n\t\t\t\t\t$rules = substr($v, 5);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 11) == 'OCCURRENCES')\n\t\t\t\t{\n\t\t\t\t\t$occurrences = substr($v, 11);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 10) == 'EXCEPTIONS')\n\t\t\t\t{\n\t\t\t\t\t$exceptions = substr($v, 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Set the timezone for this calendar based on the first event's info\n\t\t\t// -------------------------------------\n\n\t\t\tif ($key == 0)\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Convert calendar_name to calendar_id\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t\t\t$this->P->value('calendar_name') != '')\n\t\t\t\t{\n\t\t\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\tlets try to get the timezone from the\n\t\t\t\t//\tpassed calendar ID if there is one\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t$cal_timezone \t= FALSE;\n\t\t\t\t$cal_tz_offset \t= FALSE;\n\n\t\t\t\tif ($this->P->value('calendar_id') != '')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"SELECT \ttz_offset, timezone\n\t\t\t\t\t\t\tFROM\texp_calendar_calendars\n\t\t\t\t\t\t\tWHERE \tcalendar_id\n\t\t\t\t\t\t\tIN \t\t(\" . ee()->db->escape_str(\n\t\t\t\t\t\t\t\t\t\t\timplode(',',\n\t\t\t\t\t\t\t\t\t\t\t\texplode('|',\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->P->value('calendar_id')\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) .\n\t\t\t\t\t\t\t\t\t\")\n\t\t\t\t\t\t\tLIMIT\t1\";\n\n\t\t\t\t\t$cal_tz_query = ee()->db->query($sql);\n\n\t\t\t\t\tif ($cal_tz_query->num_rows() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_timezone \t= $cal_tz_query->row('timezone');\n\t\t\t\t\t\t$cal_tz_offset \t= $cal_tz_query->row('tz_offset');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//last resort, we get it from the current event\n\n\t\t\t\t$T = new vtimezone();\n\t\t\t\t$T->setProperty('tzid', ($cal_timezone ? $cal_timezone : $timezone));\n\t\t\t\t$T->setProperty('tzoffsetfrom', '+0000');\n\n\t\t\t\t$tzoffsetto = ($cal_tz_offset ? $cal_tz_offset : $tz_offset);\n\n\t\t\t\tif ($tzoffsetto === '0000')\n\t\t\t\t{\n\t\t\t\t\t$tzoffsetto = '+0000';\n\t\t\t\t}\n\n\t\t\t\t$T->setProperty('tzoffsetto', $tzoffsetto);\n\t\t\t\t$ICAL->setComponent($T);\n\t\t\t}\n\n\t\t\t$title\t\t\t= strip_tags($title);\n\t\t\t$description\t= strip_tags(trim($summary));\n\t\t\t$location\t\t= strip_tags(trim($location));\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrences?\n\t\t\t// -------------------------------------\n\n\t\t\t$occurrences\t= explode('|', rtrim($occurrences, '|'));\n\t\t\t$odata\t\t\t= array();\n\n\t\t\tforeach ($occurrences as $k => $occ)\n\t\t\t{\n\t\t\t\t$occ = trim($occ);\n\t\t\t\tif ($occ == '') continue;\n\n\t\t\t\t$occ = explode($r, $occ);\n\t\t\t\t$odata[$k][] = $occ[0];\n\t\t\t\t$odata[$k][] = $occ[1];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Exceptions?\n\t\t\t// -------------------------------------\n\n\t\t\t$exceptions\t= explode('|', rtrim($exceptions, '|'));\n\t\t\t$exdata\t\t= array();\n\n\t\t\tforeach ($exceptions as $k => $exc)\n\t\t\t{\n\t\t\t\t$exc = trim($exc);\n\n\t\t\t\tif ($exc == '') continue;\n\n\t\t\t\t$exdata[] = $exc;\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Rules?\n\t\t\t// -------------------------------------\n\n\t\t\t$add_rules \t= FALSE;\n\t\t\t$erules \t= array();\n\t\t\t$rules \t\t= explode('|', rtrim($rules, '|'));\n\n\t\t\tforeach ($rules as $rule)\n\t\t\t{\n\t\t\t\t$temp = explode($r, $rule);\n\t\t\t\t$rule = array();\n\n\t\t\t\tforeach ($temp as $k => $v)\n\t\t\t\t{\n\t\t\t\t\tif ($v != FALSE) $add_rules = TRUE;\n\t\t\t\t\t$rule[substr($rvars[$k], 5)] = $v;\n\t\t\t\t}\n\n\t\t\t\tif ($add_rules === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$temp = array();\n\n\t\t\t\t\tif ($rule['repeat_years'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'YEARLY';\n\n\t\t\t\t\t\tif ($rule['repeat_years'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_years'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_months'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'MONTHLY';\n\n\t\t\t\t\t\tif ($rule['repeat_months'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_months'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_weeks'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'WEEKLY';\n\n\t\t\t\t\t\tif ($rule['repeat_weeks'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_weeks'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_days'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'DAILY';\n\n\t\t\t\t\t\tif ($rule['repeat_days'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_days'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['months_of_year'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'c' => 12, etc\n\t\t\t\t\t\t$m = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['months_of_year'] > 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$months = str_split($rule['months_of_year']);\n\t\t\t\t\t\t\tforeach ($months as $month)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTH'][] = $m[$month] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTH'] = $m[$month] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_month'] > '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'v' => 30, etc\n\t\t\t\t\t\t$d = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9,\n\t\t\t\t\t\t\t'A', 'B', 'C', 'D', 'E', 'F',\n\t\t\t\t\t\t\t'G', 'H', 'I', 'J', 'K', 'L',\n\t\t\t\t\t\t\t'M', 'N', 'O', 'P', 'Q', 'R',\n\t\t\t\t\t\t\t'S', 'T', 'U', 'V'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['days_of_month']) > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$days = str_split($rule['days_of_month']);\n\t\t\t\t\t\t\tforeach ($days as $day)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTHDAY'][] = $d[$day] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTHDAY'] = $d[$rule['days_of_month']] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_week'] != '' OR $rule['days_of_week'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d \t\t\t= array('SU','MO','TU','WE','TH','FR','SA');\n\t\t\t\t\t\t$d_letter \t= array('U','M','T','W','R','F','S');\n\n\t\t\t\t\t\t$dows \t\t= str_split($rule['days_of_week']);\n\n\t\t\t\t\t\tif ($rule['relative_dow'] > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rels = str_split($rule['relative_dow']);\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($rels as $rel)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($rel == 6) $rel = -1;\n\t\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $rel.$d[array_search($dow, $d_letter)];\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\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['stop_after'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['COUNT'] = $rule['stop_after'];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['stop_by'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Add time\n\t\t\t\t\t\t// TODO: The \"+1\" below is because the ical standard treats\n\t\t\t\t\t\t// \tUNTIL as \"less than\", not \"less than or equal to\" (which\n\t\t\t\t\t\t// \tis how Calendar treats stop_by). Double check that a simple\n\t\t\t\t\t\t// \t\"+1\" accurately addresses this difference.\n\t\t\t\t\t\t$temp['UNTIL'] = $rule['stop_by'] + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t$erules[] = $temp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Put it together\n\t\t\t// -------------------------------------\n\n\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\tif ($this->_is_all_day($start_hour, $start_minute, $end_hour, $end_minute))\n\t\t\t{\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $start_year,\n\t\t\t\t\t\t'month' => $start_month,\n\t\t\t\t\t\t'day'\t=> $start_day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t{\n\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t$end_year,\n\t\t\t\t\t$end_month,\n\t\t\t\t\t$end_day\n\t\t\t\t);\n\n\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t$E->setProperty('summary', $title);\n\n\t\t\tif ( ! empty($erules))\n\t\t\t{\n\t\t\t\tforeach ($erules as $rule)\n\t\t\t\t{\n\t\t\t\t\t$E->setProperty('rrule', $rule);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extras = array();\n\t\t\t$edits\t= array();\n\n\t\t\tif ( ! empty($odata))\n\t\t\t{\n\t\t\t\t$query = ee()->db->query(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM\texp_calendar_events_occurrences\n\t\t\t\t\t WHERE\tevent_id = \" . ee()->db->escape_str($id)\n\t\t\t\t);\n\n\t\t\t\tforeach ($query->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t//fix blank times\n\t\t\t\t\t$row['start_time'] \t= ($row['start_time'] == 0) ? '0000' \t: $row['start_time'];\n\t\t\t\t\t$row['end_time'] \t= ($row['end_time'] == 0) ? '2400' \t\t: $row['end_time'];\n\n\t\t\t\t\t//looks like an edited occurrence\n\t\t\t\t\t//edits without rules arent really edits.\n\t\t\t\t\tif ($row['event_id'] != $row['entry_id'] AND empty($rules))\n\t\t\t\t\t{\n\t\t\t\t\t\t$edits[] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t//probably entered with the date picker or something\n\t\t\t\t\t//these loose occurences\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$extras[] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty($exdata))\n\t\t\t{\n\t\t\t\t$E->setProperty('exdate', $exdata);\n\t\t\t}\n\n\t\t\tif ($description != '') $E->setProperty('description', $description);\n\t\t\tif ($location != '') $E->setProperty('location', $location);\n\n\n\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t$ICAL->setComponent($E);\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tremove rules for subsequent items\n\t\t\t//--------------------------------------------\n\n\t\t\twhile( $E->deleteProperty( \"RRULE\" )) continue;\n\n\t\t\t//edits must come right after\n\t\t\tif ( ! empty($edits))\n\t\t\t{\n\t\t\t\tforeach ($edits as $edit)\n\t\t\t\t{\n\t\t\t\t\t$edit_date = array(\n\t\t\t\t\t\t\"year\" \t=> $edit['start_year'],\n\t\t\t\t\t\t\"month\" => $edit['start_month'],\n\t\t\t\t\t\t\"day\" \t=> $edit['start_day'] ,\n\t\t\t\t\t\t\"hour\" \t=> substr($edit['start_time'], 0, 2) ,\n\t\t\t\t\t\t\"min\" \t=> substr($edit['start_time'], 2, 2)\n\t\t\t\t\t);\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($edit['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $edit['start_year'],\n\t\t\t\t\t\t\t\t'month' => $edit['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $edit['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$edit_date['year'],\n\t\t\t\t\t\t\t$edit_date['month'],\n\t\t\t\t\t\t\t$edit_date['day'],\n\t\t\t\t\t\t\t$edit_date['hour'],\n\t\t\t\t\t\t\t$edit_date['min'],\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day'] ,\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"RECURRENCE-ID\", $edit_date);\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//cleanup\n\t\t\t\t$E->deleteProperty(\"RECURRENCE-ID\");\n\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t// these random ass add-in dates are non-standard to most cal creation\n\t\t\t// and need to be treated seperately as lumping don't work, dog\n\t\t\tif ( ! empty($extras))\n\t\t\t{\n\t\t\t\tforeach ($extras as $extra)\n\t\t\t\t{\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $extra['start_year'],\n\t\t\t\t\t\t\t\t'month' => $extra['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $extra['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$extra['start_year'],\n\t\t\t\t\t\t\t$extra['start_month'],\n\t\t\t\t\t\t\t$extra['start_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//clean in case we need to add more later\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\t\t}\n\t\t//return $ICAL->createCalendar();\n\t\treturn $ICAL->returnCalendar();\n\t}", "function get_calendar($initial = \\true, $display = \\true)\n {\n }", "public static function event() {\n return self::service()->get('events');\n }", "public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }", "function build_calendar_url($cal, $start, $end) {\n return GOOGLE_CALENDAR_URL_BASE\n . $cal\n . \"/events?\"\n . (defined(\"CALENDAR_FIELDS\") ? \"fields=\" . CALENDAR_FIELDS : \"\")\n . \"&singleEvents=true\"\n\n // timeMin needs to start at 3a (maybe 4a?) instead of 00:00:00 because\n // otherwise it'll grab the sunday prior b/c of it ending at 1a\n . \"&timeMin=\" . date(\"Y-m-d\\T03:00:00P\", $start)\n . \"&timeMax=\" . date(\"Y-m-d\\T23:59:59P\", $end)\n . \"&key=\" . GOOGLE_API_KEY\n ;\n}", "public function event($apiId)\n {\n try {\n $googleEvent = $this->service->events->get($this->calendarId, $apiId);\n\n /*\n * If the google event is part of an HTTP request, return the request,\n * and if not, convert the google event into an event object and return it.\n *\n * This is so a correct response is given if preparing a batch request\n */\n if ($googleEvent instanceof \\Google_Http_Request) {\n return $googleEvent;\n } else {\n return $this->createEventObject($googleEvent);\n }\n } catch (\\Google_Service_Exception $e) {\n // Event wasn't found, return false\n return false;\n }\n }", "private function loadEvent()\n {\n $api_event = $this->product->getWebUrlApi() . \"segments?_sort=id&_order=desc&_start=0&_end=26&is_displayed=1\";\n $api_event = $this->httpClient->get($api_event);\n $api_event = json_decode($api_event->getRawBody(), true);\n return $api_event;\n }", "public function calendar_get_item($ews,$event_id){\n\t\t// Form the GetItem request\n\t\t$request = new EWSType_GetItemType();\n\t\t\n\t\t// Define which item properties are returned in the response\n\t\t$itemProperties = new EWSType_ItemResponseShapeType();\n\t\t$itemProperties->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;\n\t\t\n\t\t// Add properties shape to request\n\t\t$request->ItemShape = $itemProperties;\n\t\t\n\t\t// Set the itemID of the desired item to retrieve\n\t\t$id = new EWSType_ItemIdType();\n\t\t$id->Id = $event_id;\n\t\t\n\t\t$request->ItemIds->ItemId = $id;\n\t\t\n\t\t// Send the listing (find) request and get the response\n\t\t$response = $ews->GetItem($request);\n\t\t//create an array to hold response data\n\t\t$event_data = array();\n\t\tarray_push($event_data,$response->ResponseMessages->GetItemResponseMessage->Items->CalendarItem);\n\t\treturn $event_data;\n\t }" ]
[ "0.61911637", "0.61911637", "0.61595875", "0.61106616", "0.6103388", "0.6053598", "0.60464287", "0.6000605", "0.5976347", "0.5940125", "0.59264165", "0.5887486", "0.58792514", "0.5868849", "0.5839377", "0.5815823", "0.5802411", "0.57957554", "0.578182", "0.57710457", "0.5737916", "0.5729268", "0.5640168", "0.55125606", "0.55021006", "0.54935944", "0.5489164", "0.5469016", "0.54510075", "0.54359305" ]
0.62628776
0
Public methods Initializes the server with the given configuration. This method will also spawn any configured FastCGI processes required at startup, and load the configured request handlers. Once initialized, it starts the main server loop.
public static function start($config) { // Add the config if (!is_array($config)) { trigger_error("Cannot start server, invalid configuration settings", E_USER_ERROR); } MHTTPD::addConfig($config); // Load the mime types info $mimes = @parse_ini_file(MHTTPD::getExepath().'lib\minihttpd\config\mimes.ini', true); MHTTPD::$config['Mimes'] = array_map('listToArray', $mimes['Mimes']); // Set the initial server info values MHTTPD::$info['software'] = 'MiniHTTPD/'.MHTTPD::VERSION.' ('.php_uname('s').')'; $addr = $config['Server']['address']; $port = $config['Server']['port']; MHTTPD::$info['signature'] = 'MiniHTTPD/'.MHTTPD::VERSION.' ('.php_uname('s').") Server at {$addr} Port {$port}"; MHTTPD::$info['launched'] = time(); // Spawn any FCGI processes MFCGI::$debug = MHTTPD::$debug; MFCGI::spawn(null, MHTTPD::$config); // Load the configured request handlers if (MHTTPD::$debug) {cecho(chrule()."\n");} foreach (MHTTPD::$config['Handlers'] as $type=>$handler) { if (class_exists($handler)) { if (MHTTPD::$debug) {cecho("Handler loaded ... $type\n");} MHTTPD::$handlers[$type] = new $handler; } } // Create the queue object for the handlers MHTTPD::$handlersQueue = new MHTTPD_Handlers_Queue(MHTTPD::$handlers); // Start running the main loop MHTTPD::$running = true; MHTTPD::main(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function start()\n {\n $this->registerDefaultServices();\n\n $this->handle($this->request->createFromGlobals());\n }", "private function run()\n {\n error_reporting(E_ALL|E_STRICT);\n $namespace = 'cli';\n if (defined('NAMESPACE')) {\n $namespace = constant('NAMESPACE');\n }\n elseif (isset($_SERVER, $_SERVER['SERVER_NAME'])) {\n $namespace = $_SERVER['SERVER_NAME'];\n }\n if (!defined('BOOTSTRAP_FILE')) {\n die('Please define BOOTSTRAP_FILE before calling Init::run()');\n }\n Zend_Registry::set('namespace', $namespace);\n try {\n $this->startTimer();\n $this->loadConfig(str_replace(array('.','-'), '_', $namespace));\n $this->setDebug();\n $this->initResources();\n $this->initTimezone();\n $this->initRequest(constant('BOOTSTRAP_FILE'), $namespace);\n $this->initLocale();\n $this->initTranslate();\n $this->initLogging($namespace);\n $this->parseRequest($namespace);\n } catch (WrappedException $we) {\n $this->spawnInitError($we);\n }\n }", "public function run()\n {\n $this->server->start();\n }", "public static function start()\n {\n if (self::$config === null) {\n self::$config = Config::get('routes');\n self::$mimeTypes = Config::get('mimetypes');\n }\n\n foreach (self::$config['routes'] as $route) {\n include self::$config['path'].$route.'.php';\n }\n }", "public function start()\n\t{\n\t\t$this->define_home_dir_constant();\n\t\t$this->register_root_namespace();\n\t\tspl_autoload_register(array($this, 'autoload'));\n\t}", "public function run()\n {\n $this->run_configuration();\n\n $this->request->plugins = $this->pluggins;\n\n $app = $this;\n\n $this->router->start($app);\n }", "public function init()\n\t{\n\t\t$this->update();\n\t\t\n\t\tif ($this->config->enable->value)\n\t\t{\n\t\t\t$this->bindSockets(\n\t\t\t\t$this->config->listen->value,\n\t\t\t\t$this->config->listenport->value\n\t\t\t);\n\t\t}\n\t}", "protected function setupServers()\n\t{\n\t\t$docRoot = realpath(__DIR__ . '/..') . '/web';\n $serverPort = self::choosePort(\n self::URL_SERVER_PORT_MIN,\n self::URL_SERVER_PORT_MAX\n );\n self::$webServerUrl = self::URL_SERVER_BASE . ':' . $serverPort;\n\t\t$server = new Server($docRoot, self::$webServerUrl);\n\n\t\t// Wait for an alive response\n $integrationRoot = realpath(__DIR__ . '/..');\n\t\t$server->setRouterScriptPath($integrationRoot . '/scripts/router.php');\n\t\t$server->setCheckAliveUri('/server-check');\n\n\t\t$this->addServer($server);\n\t}", "public function run(): void\n {\n $requestBody = $this->getConfig()->getInputAdapter()::getParsedBody();\n $request = ServerRequestFactory::fromGlobals(\n $_SERVER,\n $_GET,\n $requestBody,\n $_COOKIE,\n $_FILES\n );\n\n $queue = [];\n\n $queue[] = new \\Middlewares\\Emitter();\n $queue[] = new ErrorHandler([new JsonFormatter()]);\n $queue[] = (new \\Middlewares\\PhpSession())->name('VENUSSESSID')\n ->regenerateId(60); // Prevent session fixation attacks\n\n $queue[] = (new \\Middlewares\\FastRoute(\n $this->getConfig()->getDispatcher()\n ))->attribute('handler');\n\n $queue = array_merge($queue, $this->getConfig()->getMiddlewares());\n\n // Use router access permission check\n if ($this->getConfig()->usePermission()) {\n $queue[] = (new Permission(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n }\n\n $queue[] = (new RequestHandler(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n\n $dispatcher = new Dispatcher($queue);\n $dispatcher->dispatch($request);\n }", "protected function initialize()\n {\n $this->setupLogger();\n $this->writePidfile();\n $this->addDefaultHandlers();\n }", "public function init(ServerConfigurationInterface $serverConfig);", "private function serveStart()\n {\n if (static::$run) {\n return;\n }\n\n static::$run = true;\n\n print \"Running dev/build...\\n\";\n @exec(\"framework/sake dev/build flush=1 > /dev/null 2> /dev/null\");\n\n print \"Finding open port...\\n\";\n\n while (!$this->addressAvailable($this->getHost(), $this->getPort())) {\n $this->setPort($this->getPort() + 1);\n }\n\n if (!$this->running) {\n $host = $this->getHost();\n $port = $this->getPort();\n\n $hash = spl_object_hash($this);\n\n print \"Starting development server...\\n\";\n $command = \"framework/sake dev/tasks/SilverStripe-Serve-Task hash={$hash} host={$host} port={$port} > /dev/null 2> /dev/null &\";\n\n exec($command, $output);\n\n $command = \"ps -o pid,command | grep {$hash}\";\n @exec($command, $output);\n\n if (count($output) > 0) {\n foreach ($output as $line) {\n $parts = explode(\" \", $line);\n $this->pid[] = $parts[0];\n }\n }\n\n sleep(1);\n }\n }", "public function init()\n\t{\n\t\t$this->serversInit();\n\t}", "public function __construct()\n\t{\n\t\tself::$classRouter\t= RecursiveRouter::class;\n\t\tself::$configFile\t= \"config/config.ini\";\n\t\t$this->detectSelf( FALSE );\n\t\t$this->uri\t= getCwd().'/';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hack for console jobs\n\t\t$this->initClock();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup clock\n\t\t$this->initConfiguration();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup configuration\n\t\t$this->initModules();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup module support\n\t\t$this->initDatabase();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup database connection\n\t\t$this->initCache();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup cache support\n\t\t$this->initRequest();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup HTTP request handler\n\t\t$this->initResponse();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup HTTP response handler\n\t\t$this->initRouter();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup request router\n\t\t$this->initLanguage();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// [DO NOT] setup language support\n\t\t$this->initPage();\n\t\t$this->__onInit();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// call init event (implemented by extending classes)\n\t\tif( $this->getModules()->has( 'Resource_Database' ) )\n\t\t\t$this->dbc->query( 'SET NAMES \"utf8\"' );\t\t\t\t\t\t\t\t\t\t\t\t// ...\n\t}", "public static function start($config) {\n\t\ttry {\n\n\t\t\tset_error_handler(function ($err_severity, $err_msg, $err_file, $err_line, array $err_context) {\n\t\t\t if (0 === error_reporting()) { return false;}\n\t\t\t if(!self::_initError($err_msg, $err_file, $err_line)) {\n\t\t\t \tthrow new Exception ($err_msg . \" | File: \". $err_file .\"(\". $err_line .\")\", 0);\n\t\t\t }\n\t\t\t\t\n\t\t\t});\n\n\t\t\tself::$_config = include $config;\n\n\t\t\t// Missing htaccess web server files\n\t\t\tself::_initHtaccess();\n\t\t\t\n\t\t\t// Checks if PHP is greater than 7\n\t\t\tself::_initPHP();\n\n\t\t\tdefine(\"FRAMEWORK\", __DIR__);\n\t\t\tdefine('APP', self::config('appDir'));\n\t\t\tdefine(\"RUNTIME\", $_SERVER[\"DOCUMENT_ROOT\"] . \"/\" . SBJ::config(\"runtimeDir\"));\n\t\t\tdefine(\"ROOT\", $_SERVER[\"DOCUMENT_ROOT\"]);\n\t\t\tdefine(\"CONFIG_DIR\", dirname($config));\n\t\t\tdefine(\"CONFIG_PATH\", $config);\n\n\t\t\tif (!defined( \"PATH_SEPARATOR\" )) { \n\t\t\t\tif (strpos( $_ENV[ \"OS\" ], \"Win\") !== false ) \n\t\t\t\t\tdefine( \"PATH_SEPARATOR\", \";\" ); \n\t\t\t\telse define( \"PATH_SEPARATOR\", \":\" ); \n\t\t\t} \n\t\t\tset_include_path(APP . self::config('controllerDir') .'/'. PATH_SEPARATOR . APP . self::config('modelDir') .'/'. PATH_SEPARATOR. FRAMEWORK . '/'. PATH_SEPARATOR . FRAMEWORK . '/base/');\n\t\t\tspl_autoload_register(function ($class) {\n\t\t\t\tinclude $class . '.class.php';\n\t\t\t});\n\n\t\t\t// Parse URL and write controller and action to constants (CONTROLLER, ACTION)\n\t\t\tURL::init();\n\n\t\t\t$error = explode(\"/\", self::config(\"error_404\"));\n\n\n\t\t\tif(false === self::_initAction(CONTROLLER, ACTION) && false == self::_initAction($error[0], $error[1])) {\n\t\t\t\tthrow new Exception(\"Not Found \". CONTROLLER . \" / \" . ACTION, 404);\n\t\t\t};\n\n\t\t} catch (Exception $e) {\n\t\t\tself::_displayError($e);\n\t\t} catch (Error $e) {\n\t\t\tself::_displayError($e);\n\t\t} catch (Throwable $e) {\n\t\t\tself::_displayError($e);\n\n\t\t}\n\t}", "function start_application() {\n\t// The SAPI type is cgi-fcgi when accessed from the browser.\n\tif (PHP_SAPI === 'cgi-fcgi') {\n\t\t// Force secure site.\n\t\tif (FORCE_SECURE) {\n\t\t\tredirect_to_https();\n\t\t}\n\t}\n\n\trequire ABSPATH . 'vendor/autoload.php';\n\n\t// Make sure OpenOffice is running.\n\t// start_openoffice();\n\n\t// Include base classes.\n\tinclude_classes();\n\n\t// Include controllers.\n\tinclude_controllers();\n\n\t// Activate query string parameters.\n\tinclude_query_string();\n}", "public function __construct()\n\t{\n\t\t$configuration = new Config();\n\t\t// Configure socket server\n\t\tparent::__construct($configuration->socket_host, $configuration->socket_controller_port);\n\n\t\t// Run the server\n\t\t$this->run();\n\t}", "public function __construct()\n {\n $this->http = new swoole_http_server(self::HOST, self::PORT);\n\n $this->http->set([\n \"enable_static_handler\" => true,\n \"document_root\" => \"/home/alex/study/thinkphp/public/static/\",\n 'worker_num' => 2,\n 'task_worker_num' => 2,\n\n ]);\n\n $this->http->on(\"WorkerStart\", [$this, 'onWorkerStart']);\n $this->http->on(\"request\", [$this, 'onRequest']);\n $this->http->on(\"task\", [$this, 'onTask']);\n $this->http->on(\"finish\", [$this, 'onFinish']);\n $this->http->on(\"close\", [$this, 'onClose']);\n\n\n $this->http->start();\n }", "public function init() {\n #Get bootstrap object.\n $bootstrap = $this->getInvokeArg('bootstrap');\n #Get Logger\n $this->log = $bootstrap->getResource('Log');\n #Get Doctrine Entity Manager\n $this->em = $bootstrap->getContainer()->get('entity.manager');\n #Get config\n $this->config = $bootstrap->getContainer()->get('config');\n\n #Init REST Server\n $this->_server = new Server($this->getRequest());\n $aliases = array(\n 'resources' \t=> self::RESOURCES,\n 'variations' \t=> self::VARIATIONS,\n 'galleries' \t=> self::GALLERIES,\n 'pages' \t\t=> self::PAGES,\n 'menuitems' => self::MenuItems,\n 'templates' \t=> self::TEMPLATES,\n 'tvars' \t\t=> self::TVARS,\n 'tvarconts' \t=> self::TVARCONTENTS,\n 'users' \t\t=> self::USERS,\n 'blog' \t\t=> self::BLOGITEMS,\n 'discounts' \t=> self::DISCOUNTS,\n 'vcard' \t\t=> self::HCARDS,\n 'categories' \t=> self::CATEGORIES,\n 'tags' \t\t=> self::TAGS,\n 'settings' \t\t=> self::SETTINGS,\n 'addresses' \t=> self::ADDRESSES,\n 'metadata' \t\t=> self::METADATA,\n 'homepageitems' => self::HOMEPAGEITEMS,\n 'homepage' \t\t=> self::HOMEPAGE,\n 'brands'\t\t=> self::BRANDS,\n 'products'\t\t=> self::PRODUCTS,\n 'looks'\t\t\t=> self::LOOKS,\n 'grids'\t\t\t=> self::GRIDS,\n 'acluserroles'\t=> self::ACLUSERROLES,\n 'collections' => self::COLLECTIONS,\n );\n $actions = array(\n 'auth' => self::AUTH,\n 'mediabrowser' => self::MEDIABROWSER,\n 'mediavariations' => self::MEDIA_VARIATIONS,\n 'search' => self::SEARCH,\n 'videos' => self::RESOURCES_VIDEOS\n );\n $this->_server->setAliases($aliases);\n $this->_server->setActions($actions);\n $this->method = $this->_server->getResponseActionName();\n $this->_repo = $this->_server->execute();\n\n #Enable Context Switching\n $contextSwitch = $this->_helper->getHelper('contextSwitch');\n $contextSwitch\n ->addActionContext('index', array('xml', 'json'))\n ->addActionContext('get', array('xml', 'json'))\n ->addActionContext('put', array('xml', 'json'))\n ->addActionContext('post', array('xml', 'json'))\n ->addActionContext('delete', array('xml', 'json'))\n ->addActionContext('head', array('xml', 'json'))\n ->addActionContext('option', array('xml', 'json'))\n ->setAutoJsonSerialization(true)\n ->initContext();\n #disable view rendering\n //$this->_helper->viewRenderer->setNeverRender(true);\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout->disableLayout();\n #Set Action Name for Request.\n if ($this->_server->getActionType() == 'action') {\n $this->method = 'method';\n }\n #Authentication\n// $this->_server->setPassword($password)->setUsername($username);\n #Security Options ::\n #Get Acl Object\n #TODO Set auth request inside server to allow you to use auth\n #Get Zend Auth.\n// $this->auth = Zend_Auth::getInstance();\n// if(!$this->auth->hasIdentity()) {\n// $this->_redirect('/admin/auth/login/');\n// }\n $this->getRequest()->setActionName($this->method);\n $this->view->response = \"\";\n $this->log->info(get_class($this) . '::init(' . $this->method . ')');\n #Allow xml to use view rendering.\n if ($this->getRequest()->getParam('format') == 'xml') {\n $this->_helper->viewRenderer->setNoRender(false);\n }\n// #TODO Find a way to allow entity to decide how it should interact with REST?\n// $reader = new AnnotationReader();\n// $reflClass = new \\ReflectionClass($this->_server->getActiveNamespace());\n// $classAnnotations = $reader->getClassAnnotations($reflClass);\n// $reflProperties = $reflClass->getProperties();\n// $mappedConstants = $reflClass->getConstants();\n// $this->log->info($classAnnotations);\n// foreach($reflProperties as $property) {\n// $reflProperties = new \\ReflectionProperty($property->class, $property->name);\n// $annotations = $reader->getPropertyAnnotations($reflProperties);\n// $this->log->info($property);\n// $this->log->info($annotations);\n// }\n// $this->log->info(\"EO Props\");\n\n $this->messageQueue = $this->_helper->getHelper('FlashMessenger');\n $this->view->messages = $this->messageQueue->getMessages();\n\n $frontendOptions = array(\n 'lifetime' => self::CACHE_LIFETIME, // cache lifetime of 2 hours\n 'automatic_serialization' => true\n );\n\n $backendOptions = array(\n 'cache_dir' => WEB_PATH . self::CACHE_DIR // Directory where to put the cache files\n );\n\n // getting a Zend_Cache_Core object\n $this->cache = \\Zend_Cache::factory('Core',\n 'File',\n $frontendOptions,\n $backendOptions);\n }", "private function start()\n {\n // CSRF Watchdog\n $this->csrfWatchdog();\n\n // Retrieve and other services\n $this->retriever->watchdog();\n\n // Router Templater Hybrid\n $this->renderer->route();\n }", "public function init()\n {\n parent::init();\n\n $this->command('serve', Serve::class);\n }", "private function startup()\n\t{\n\t\t$this->registerSigHandlers();\n\t\t$this->pruneDeadWorkers();\n\t\tEvent::trigger('beforeFirstFork', $this);\n\t\t$this->registerWorker();\n\t}", "public static function Init ()\r\n\t{\r\n\t\t$sessions = config('sessions');\r\n\r\n\t\tif ($sessions) {\r\n\t\t\tforeach ($sessions as $sid => $cfg)\r\n\t\t\t{\r\n\t\t\t\t// We are creating a new session based on our config file definitions,\r\n\t\t\t\t// so its safer to use createSession than getSession, since we're sure\r\n\t\t\t\t// there's no session in the instances container with same SID.\r\n\t\t\t\tself::$instances->$sid = self::createSession($sid, $cfg);\r\n\t\t\t\tif (true == self::$instances->$sid->autostart) {\r\n\t\t\t\t\tself::$instances->$sid->start();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static function Initialize()\n\t\t{\n\t\t\tself::SetIniDirectives();\n\t\t\tself::AddRoutes();\n\t\t}", "protected function configureSwooleServer()\n {\n $config = $this->container['config']->get('swoole.server');\n\n $this->server->set($config);\n }", "private function init($serverData = null)\n {\n //Use global most of the time\n if (is_null($serverData)) {\n $serverData = $_SERVER;\n }\n\n //Get the protocol and port\n $this->port = (strpos($serverData['HTTP_HOST'], ':'))\n ? end(explode(':', $serverData['HTTP_HOST']))\n : $serverData['SERVER_PORT'];\n $this->protocol = ($this->port == 443 || ( ! empty($serverData['HTTPS']) && $serverData['HTTPS'] == 'on')) ? 'https' : 'http';\n $this->https = ($this->protocol == 'https');\n\n //Get the server name\n $this->hostname = (isset($serverData['SERVER_NAME'])) ? $serverData['SERVER_NAME'] : $serverData['HTTP_HOST'];\n $this->hostIP = $serverData['SERVER_ADDR'];\n\n //Get the base URL path & script name\n $scriptname = basename($serverData['SCRIPT_FILENAME']);\n $this->basepath = str_replace($scriptname, '', $serverData['SCRIPT_NAME']);\n\n //Set the script name.\n if (strpos($serverData['REQUEST_URI'], $scriptname) !== false) {\n $this->scriptname = $scriptname;\n }\n else {\n $this->scriptname = '';\n }\n\n //Set the request_uri\n $reqURI = explode('?', $serverData['REQUEST_URI'], 2);\n $reqURI = $this->reduceDoubleSlashes(array_shift($reqURI));\n\n //The query string\n $this->query = $serverData['QUERY_STRING'];\n\n //Get the PATH\n $pathinfo = substr($reqURI, strlen($this->basepath . $this->scriptname));\n\n $segments = array();\n if ( ! empty($pathinfo)) {\n $arr = array_values(array_filter(explode('/', $pathinfo)));\n for($i = 0; $i < count($arr); $i++)\n $segments[($i+1)] = $arr[$i];\n }\n $this->path = implode('/', $segments);\n\n //Build the baseurl and currenturl\n if (($this->protocol == 'https' && $this->port != 443) OR ($this->protocol == 'http' && $this->port != 80))\n $port = ':' . $this->port;\n else\n $port = '';\n\n $this->baseurl = $this->reduceDoubleSlashes($this->protocol . '://' . $this->hostname . $port . '/' . $this->basepath . '/');\n $this->appurl = $this->reduceDoubleSlashes($this->baseurl . $this->scriptname . '/');\n\n $this->currenturl = $this->reduceDoubleSlashes($this->appurl . '/' . $this->path);\n $this->fullurl = ( ! empty($this->query)) ? $this->currenturl . '?' . $serverData['QUERY_STRING'] : $this->currenturl;\n }", "public static function initialize()\n {\n // Load Global Functions\n self::loadGlobalFunctions();\n\n // Load the configuration into system\n if (! IOFunctions::loadConfig()) {\n exit();\n }\n\n // Enabele error reporting\n ini_set('display_errors', 0);\n ini_set('display_startup_errors', 0);\n error_reporting(E_ALL);\n if (sf_conf('system.display_errors')) {\n ini_set('display_errors', 1);\n ini_set('display_startup_errors', 1);\n }\n\n // Set error handler and shutdown hook\n set_error_handler('\\\\Synful\\\\IO\\\\IOFunctions::catchError', E_ALL);\n register_shutdown_function('\\\\Synful\\\\IO\\\\IOFunctions::onShutDown');\n\n // Check Cross Origin Resource Sharing\n if (sf_conf('system.cors_enabled')) {\n if (in_array('all', sf_conf('system.cors_domains'))) {\n header('Access-Control-Allow-Origin: *');\n } else {\n foreach (sf_conf('system.cors_domains') as $domain) {\n if ($_SERVER['HTTP_ORIGIN'] == $domain) {\n header('Access-Control-Allow-Origin: '.$domain);\n break;\n }\n }\n }\n }\n\n // Check global rate limiter\n if (sf_conf('rate.global')) {\n if (! RateLimit::global()->isUnlimited()) {\n if (RateLimit::global()->isLimited(self::getClientIP())) {\n $response = (new SynfulException(500, 1028))->response;\n sf_respond($response->code, $response->serialize());\n exit;\n }\n }\n }\n\n // Load Template Plugins\n if (sf_conf('templating.enabled')) {\n self::loadTemplatePlugins();\n }\n\n // Initialize the Database Connections\n self::initializeDatabases();\n\n // Load routes\n self::loadRoutes();\n\n // Parse Command Line\n if (self::isCommandLineInterface()) {\n global $argv;\n $commandLine = new CommandLine();\n $results = $commandLine->parse($argv);\n\n // Output Results\n if ((array_key_exists('hc', $results) && ! $results['hc']) ||\n ! array_key_exists('hc', $results)) {\n if (array_key_exists('cl', $results)) {\n $str = (sf_conf('system.color')) ? 'true' : 'false';\n sf_note('CONFIG: Set console color to \\''.$str.'\\'.');\n }\n\n if (array_key_exists('o', $results)) {\n sf_note('CONFIG: Set output level to \\''.$results['o'].'\\'.');\n }\n }\n\n if ((count($argv) < 2 || substr($argv[1], 0, 7) == '-output' ||\n substr($argv[1], 0, 2) == '-o')) {\n $commandLine->printUsage();\n exit(3);\n }\n\n self::$command_results = $results;\n }\n\n // Initialize WebListener\n (new WebListener())->initialize();\n }", "public static function setUpBeforeClass()\n {\n /*\n * First, start the PHP build-in server:\n * php -S 127.0.0.1:8000 -t PHP/Compound/MVC/Public\n */\n self::$process = new Process('php -S 127.0.0.1:8000 -t PHP/Compound/MVC/Public');\n self::$process->start();\n\n /*\n * Wait for server\n */\n usleep(100000);\n }", "protected static function main()\n\t{\n\t\t// Create a TCP/SSL server socket context\n\t\t$context = MHTTPD::getContext();\n\t\t\n\t\t// Start the listener\n\t\tMHTTPD::createListener($context);\n\n\t\t// Initialize some handy vars\n\t\t$timeout = ini_get('default_socket_timeout');\n\t\t$maxClients = MHTTPD::$config['Server']['max_clients'];\n\t\t$maxHeaderBlockSize = MHTTPD_Message::getMaxHeaderBlockSize();\n\t\tif (MHTTPD::$debug) {\n\t\t\t$listener_name = stream_socket_get_name(MHTTPD::$listener, false);\n\t\t}\n\t\t\n\t\t// Start the browser\n\t\tMHTTPD::launchBrowser();\n\t\t\n\t\t// The main loop\n\t\twhile (MHTTPD::$running) \t{\t\n\t\t\n\t\t\t// Build a list of active streams to monitor\n\t\t\t$read = array('listener' => MHTTPD::$listener);\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\t\t\t\t\n\t\t\t\t// Add any client sockets\n\t\t\t\tif ($csock = $client->getSocket()) {\n\t\t\t\t\t$read[\"client_$i\"] = $csock;\n\t\t\t\t\t\n\t\t\t\t\t// Add any client FCGI sockets\n\t\t\t\t\tif ($cfsock = $client->getFCGISocket()) {\n\t\t\t\t\t\t$read[\"clfcgi_$i\"] = $cfsock;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add any client file streams\n\t\t\t\t\tif ($client->isStreaming()) {\n\t\t\t\t\t\t$read[\"clstrm_$i\"] = $client->getStream();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Add any aborted FCGI requests\n\t\t\tforeach (MHTTPD::$aborted as $aID=>$ab) {\n\t\t\t\t$read['aborted_'.$aID.'_'.$ab['client'].'_'.$ab['pid']] = $ab['socket'];\n\t\t\t}\n\n\t\t\tif (MHTTPD::$debug) {\n\t\t\t\tcecho(\"FCGI scoreboard:\\n\"); cprint_r(MFCGI::getScoreboard(true)); cecho(\"\\n\");\n\t\t\t\tcecho(\"Pre-select:\\n\"); cprint_r($read);\n\t\t\t\tcecho(chrule().\"\\n>>>> Waiting for server activity ($listener_name)\\n\".chrule().\"\\n\\n\");\n\t\t\t}\n\n\t\t\t// Wait for any new activity\n\t\t\tif (!($ready = @stream_select($read, $write=null, $error=null, null))) {\n\t\t\t\ttrigger_error(\"Could not select streams\", E_USER_WARNING);\n\t\t\t}\n\t\t\t\n\t\t\tif (MHTTPD::$debug) {cecho(\"Post-select:\\n\"); cprint_r($read);}\n\t\t\t\t\t\t\n\t\t\t// Check if the listener has a new client connection\n\t\t\tif (in_array(MHTTPD::$listener, $read)) {\n\t\t\t\t\n\t\t\t\t// Search for a free slot to add the new client\n\t\t\t\tfor ($i = 1; $i <= $maxClients; $i++) {\n\t\t\t\t\t\n\t\t\t\t\tif (!isset(MHTTPD::$clients[$i])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// This slot is free, so add the new client connection\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"New client ($i): \");}\n\t\t\t\t\t\tif (!($sock = @stream_socket_accept(MHTTPD::$listener, $timeout, $peername))) {\n\t\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"\\nCould not accept client stream\\n\");}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"$peername\\n\");}\n\t\t\t\t\t\t$client = new MHTTPD_Client($i, $sock, $peername);\n\t\t\t\t\t\t$client->debug = MHTTPD::$debug;\n\t\t\t\t\t\tMHTTPD::$clients[$i] = $client;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t} elseif ($i == $maxClients) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No free slots, so the request goes to the backlog\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"No free client slots!\\n\");}\n\t\t\t\t\t\ttrigger_error(\"Too many clients\", E_USER_NOTICE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return to waiting if only the listener is active\n\t\t\t\tif ($ready == 1) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"No other connections to handle\\n\\n\");}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Handle any incoming client data on selected sockets\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t \n\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... \");}\n\t\t\t\t$csock = $client->getSocket();\n\n\t\t\t\t// Handle any new client requests\n\t\t\t\tif ($client->isReady() && $csock && in_array($csock, $read)) {\n\t\t\t\t\n\t\t\t\t\t// Start reading the request\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"reading ... \");}\n\t\t\t\t\t$client->setTimeout(10);\n\t\t\t\t\t$input = '';\n\t\t\t\t\t\n\t\t\t\t\t// Get the request header block only\n\t\t\t\t\twhile ($buffer = @fgets($csock, 1024)) {\n\t\t\t\t\t\t$input .= $buffer;\n\t\t\t\t\t\tif ($buffer == '' || substr($input, -4) == \"\\r\\n\\r\\n\" \n\t\t\t\t\t\t\t|| strlen($input) > $maxHeaderBlockSize\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($input) {\n\t\t\t\t\t\n\t\t\t\t\t\t// Store the headers and process the request\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"done\\n\");}\n\t\t\t\t\t\t$client->setInput(trim($input));\n\t\t\t\t\t\tif (!$client->processRequest() && !$client->needsAuthorization()) {\n\t\t\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No request data, client is disconnecting\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"disconnected\\n\");}\n\t\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Handle any request body data\n\t\t\t\t} elseif ($client->isPosting() && $csock && in_array($csock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"reading body \");}\n\t\t\t\t\t$client->readRequestBody();\n\t\t\t\t\n\t\t\t\t// Handle any disconnects or malformed requests\n\t\t\t\t} elseif ($csock && in_array($csock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"aborted connection\\n\");}\n\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// Handle any inactive client connections\n\t\t\t\t} else {\n\t\t\t\t\tif (MHTTPD::$debug) {\n\t\t\t\t\t\tcecho('inactive (');\n\t\t\t\t\t\tcecho('req:'.$client->hasRequest());\n\t\t\t\t\t\tcecho(' resp:'.$client->hasResponse());\n\t\t\t\t\t\tcecho(' fcgi:'.$client->hasFCGI());\n\t\t\t\t\t\tcecho(\")\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Handle any incoming FCGI responses\n\t\t\t\tif (($clfsock = $client->getFCGISocket()) && in_array($clfsock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... reading FCGI socket: {$clfsock}\\n\");}\n\t\t\t\t\tif (!$client->readFCGIResponse()) {\n\t\t\t\t\t\tMHTTPD::removeClient($client); // abort any hanging connections\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle any outgoing FCGI requests\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\tif ($client->hasFCGI() && !$client->hasSentFCGI()\n\t\t\t\t\t&& (!$client->isPosting() || $client->hasFullRequestBuffer())\n\t\t\t\t\t) {\n\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... sending FCGI request\\n\");}\n\t\t\t\t\tif (!$client->sendFCGIRequest()) {\n\t\t\t\t\t\tMHTTPD::removeClient($client); // abort any failed connections\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Handle any outgoing client responses\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\tif ($client->hasRequest()) {\n\t\t\t\t\tif (!$client->isPosting() && $client->hasSentFCGI() && !$client->hasResponse()) {\n\t\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... waiting for FCGI response\\n\");}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} elseif ($client->needsAuthorization()) {\n\t\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... waiting for authorization\\n\");}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} elseif ($client->hasResponse()) {\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... handling response\\n\");}\n\t\t\t\t\t\tMHTTPD::handleResponse($client);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// Handle any aborted FCGI requests\n\t\t\tforeach ($read as $r) {\n\t\t\t\tforeach (MHTTPD::$aborted as $aID=>$ab) {\n\t\t\t\t\tif ($r == $ab['socket']) {\n\t\t\t\t\t\tMFCGI::removeClient($ab['process']);\n\t\t\t\t\t\tMHTTPD::closeSocket($r);\n\t\t\t\t\t\tunset(MHTTPD::$aborted[$aID]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// End of main loop\n\t\t\tif (MHTTPD::$debug) {cecho(\"\\n\");}\n\t\t}\n\t\t\n\t\t// Quit the server cleanly\n\t\tMHTTPD::shutdown();\n\t}", "public function setup() {\n $this->socket = socket_create(AF_INET, SOCK_STREAM, 0);\n if (!socket_bind($this->socket, $this->ip, $this->port)) {\n $errno = socket_last_error();\n $this->error(sprintf('Could not bind to address %s:%s [%s] %s', $this->ip, $this->port, $errno, socket_strerror($errno)));\n throw new Exception('Could not start server.');\n }\n\n socket_listen($this->socket);\n $this->daemon->on(Daemon::ON_POSTEXECUTE, array($this, 'run'));\n }" ]
[ "0.6591059", "0.61278903", "0.6025732", "0.5967823", "0.59510744", "0.5892644", "0.58199817", "0.57597095", "0.5740682", "0.5739555", "0.5731995", "0.56559885", "0.56442", "0.563607", "0.563023", "0.56243163", "0.56119245", "0.5531699", "0.5523953", "0.55203754", "0.55101335", "0.549272", "0.549171", "0.54651946", "0.54648703", "0.54593694", "0.54515976", "0.544827", "0.5442842", "0.5440654" ]
0.7307075
0
Factory method for creating MiniHTTPD objects. This is a helper method used mainly for creating chainable objects.
public static function factory($type) { $class = 'MHTTPD_'.ucfirst($type); return new $class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function create()\n {\n $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : 'text/html';\n return (new Request(\n $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'] ,\n $_REQUEST, $contentType\n ))->processBody();\n }", "public static function factory()\n {\n $request = new Request();\n static::$_current = $request;\n return $request;\n }", "private function getBuilder(): RequestBuilder\n {\n return new RequestBuilder(new StreamFactory());\n }", "static public function createFromGlobals()\n {\n $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);\n\n if (0 === strpos($request->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')\n && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE'))\n ) {\n parse_str($request->getContent(), $data);\n $request->request = new Collection($data);\n }\n\n return $request;\n }", "private function createHttpHandler()\n {\n $this->httpMock = new MockHandler();\n\n $handlerStack = HandlerStack::create($this->httpMock);\n $handlerStack->push(Middleware::history($this->curlHistory));\n\n $this->client = new Client(['handler' => $handlerStack]);\n\n app()->instance(Client::class, $this->client);\n }", "private function createSlim()\r\n {\r\n return new \\Slim\\Slim();\r\n }", "public static function createFromGlobals()\r\n {\r\n // Create and return a new instance of this\r\n return new static(\r\n $_GET,\r\n $_POST,\r\n $_COOKIE,\r\n $_SERVER,\r\n $_FILES,\r\n null // Let our content getter take care of the \"body\"\r\n );\r\n }", "public static function create($type)\n\t{\n\t\tif (empty($type) || 0 === strpos($type, 'text/html')) {\n\t\t\treturn new HttpGetRequest;\n\t\t}\n\n\t\tif (0 === strpos($type, 'application/json')) {\n\t\t\treturn new HttpJsonRequest;\n\t\t}\n\n\t\treturn new HttpPostRequest;\n\t}", "public static function createFromGlobals()\n {\n $class = __CLASS__;\n\n \n //Modification for modouth flow TODO: extend request class and override createFromGlobals method\n //to handle params stored in session\n \n $OAUTH_PARAMS = array();\n \n $clientKey = 'modoauth-clientid';\n $resTypeKey = 'modoauth-responsetype';\n $stateKey = 'modoauth-state';\n \n if(isset($_SESSION['modoauth'])){\n $oauthParams = $_SESSION['modoauth'];\n $OAUTH_PARAMS = array(\n \"client_id\"=>$oauthParams[$clientKey],\n \"response_type\"=>$oauthParams[$resTypeKey],\n \"state\"=>$oauthParams[$stateKey]\n );\n }\n \n $request = new $class(array_merge($_GET,$OAUTH_PARAMS), $_POST, array(), $_COOKIE, $_FILES, $_SERVER);\n\n $contentType = $request->server('CONTENT_TYPE', '');\n $requestMethod = $request->server('REQUEST_METHOD', 'GET'); \n if (0 === strpos($contentType, 'application/x-www-form-urlencoded')\n && in_array(strtoupper($requestMethod), array('PUT', 'DELETE'))\n ) {\n parse_str($request->getContent(), $data);\n $request->request = $data;\n } elseif (0 === strpos($contentType, 'application/json')\n && in_array(strtoupper($requestMethod), array('POST', 'PUT', 'DELETE'))\n ) {\n $data = json_decode($request->getContent(), true);\n $request->request = $data;\n }\n \n return $request;\n }", "protected function factory()\n {\n $this->request = $this->request();\n $this->response = $this->response();\n $this->route = $this->route();\n\n return $this;\n }", "public function __construct(){\n\t\t$this->headers = apache_request_headers();\n\t\t// Save the special x-RESTProxy-* headers\n\t\t$this->Host = $this->Host? $this->Host : $this->headers['x-RESTProxy-Host'];\n\t\t$this->Port = $this->headers['x-RESTProxy-Port'] ? ':'.$this->headers['x-RESTProxy-Port'] : \"\";\n\t\t$this->Https = ($this->headers['x-RESTProxy-HTTPS'])? $this->headers['x-RESTProxy-HTTPS'] : false;\n\t\t// Create a temp file in memory\n\t\t$this->fp = fopen('php://temp/maxmemory:256000','w');\n\t\tif (!$this->fp){\n\t\t\t$this->Error(100);\n\t\t}\n\t\t// Write the input into the in-memory tempfile\n\t\t$this->input = file_get_contents(\"php://input\");\n\t\tfwrite($this->fp,$this->input);\n\t\tfseek($this->fp,0);\n\n\t\t//Get the REST Path\n\t\tif(!empty($_SERVER['PATH_INFO'])){\n\t\t $this->_G = substr($_SERVER['PATH_INFO'], 1);\n\t\t //$this->_G = explode('/', $_mGET);\n\t\t }\n\t\t \n\t\t // Get the raw GET request\n\t\t $tmp = explode('?',$_SERVER['REQUEST_URI']);\n\t\t if ($tmp[1]) {\n\t\t \t$this->_RawGET = $tmp[1];\n\t\t } else {\n\t\t \t$this->_RawGET = \"\";\n\t\t }\n\t \n\t}", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "private function newRequest($queryString= '') {\n return new Request(new TestInput('GET', '/'.$queryString));\n }", "function request() {\n return new Request;\n }", "public static function factory($uri)\n\t{\n\t\treturn new Request($uri);\n\t}", "protected function _getRequest() {\n\t\treturn new Request;\n\t}", "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "protected function createHttpRequest()\n {\n return $this->createMock(RequestInterface::class);\n }", "protected function http()\n {\n return new Client;\n }", "public static function parse(ServerRequest $request)\n {\n $factory = new static($request);\n return $factory;\n }", "private function createRequest(): ServerRequest\n {\n return new ServerRequest(\n 'POST',\n 'https://localhost/',\n [\n 'Accept' => '*/*',\n 'content-type' => 'application/json',\n 'User-Agent' => 'GitHub-Hookshot/0000000',\n 'X-GitHub-Delivery' => '00000000-0000-0000-0000-000000000000',\n 'X-GitHub-Event' => 'ping',\n 'X-Hub-Signature' =>\n 'sha1=5563c89a2f4743278567358293adc9a65680725b',\n ],\n '{\"zen\":\"Approachable is better than simple.\",\"hook_id\":202756468,\"sender\":{\"url\":\"https://api.github.com/users/loilo\"}}'\n );\n }", "protected function _createRouter(){\n\t\treturn new SimpleRouter();\n\t}", "protected function initFramework()\n {\n self::$request = Request::createFromGlobals();\n\n return $this;\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "function WP_Http() {\n\t\t$this->__construct();\n\t}", "public function __construct() {\n $this->setGetter( new HttpGetter() );\n }", "protected function buildWebRequest()\n {\n $args = $_REQUEST;\n $params = array();\n\n $route = $_SERVER['REQUEST_URI'];\n $posQuestionMark = strpos($route, '?');\n if ($posQuestionMark !== false) {\n $route = substr($route, 0, $posQuestionMark);\n }\n \n $posIndex = strpos($route, 'index.php');\n if ($posIndex !== false) {\n $route = substr($route, $posIndex + strlen('index.php'));\n }\n \n // Transform the arguments\n foreach ($args as $key => $value) {\n if (is_numeric($value)) {\n // Transform the value into the correct data type\n $value = $value * 1;\n }\n \n $params[$key] = $value;\n }\n\n // Generate the full url and extract the base\n $scheme = $this->getScheme();\n $fullUrl = $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n $isSsl = false;\n if ($scheme == 'https') {\n $isSsl = true;\n }\n \n $routePosition = strlen($fullUrl);\n if ($route !== '' && $route !== '/') {\n $routePosition = strpos($fullUrl, $route);\n }\n \n $method = $_SERVER['REQUEST_METHOD'];\n $requestedUrl = $this->getRequestedUrl();\n $base = substr($fullUrl, 0, $routePosition);\n $headers = $this->getHeaders($_SERVER);\n $protocol = $_SERVER['SERVER_PROTOCOL'];\n \n $locale = 'en_US';\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $locale = $this->getLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n }\n \n $operatingSystem = $this->getOperatingSystem();\n\n return new WebRequest($method, $requestedUrl, $route, $params, $base, $locale, $operatingSystem, $isSsl, $headers, $protocol);\n }" ]
[ "0.6102798", "0.5686488", "0.5676856", "0.56387836", "0.5626504", "0.5542996", "0.5530503", "0.54471457", "0.5439173", "0.5395884", "0.5351625", "0.5317065", "0.5317065", "0.53085923", "0.5293327", "0.5268499", "0.523159", "0.5205661", "0.51904166", "0.51703006", "0.5164401", "0.5159632", "0.51311356", "0.5119471", "0.51005137", "0.51005137", "0.51005137", "0.508696", "0.508067", "0.5080032" ]
0.58542013
1
Determines whether the server is running in its main loop.
public static function isRunning() { return MHTTPD::$running; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function isMyServer(): bool {\n\t\ttry {\n\t\t\treturn Server::singleton($this->application)->id() === $this->memberInteger('server');\n\t\t} catch (Throwable) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function serverIsRunning(): bool\n {\n [\n 'masterProcessId' => $masterProcessId,\n ] = $this->serverStateFile->read();\n\n return $masterProcessId && $this->posix->kill($masterProcessId, 0);\n }", "public function isForServer()\n {\n return $this->server !== null;\n }", "public function isRunning(): bool\n {\n return $this->handle && $this->handle->status !== ProcessStatus::ENDED;\n }", "public function getIsSystemOn(): bool\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->getIsLive();\n }", "public function isRunning() {\n\t\treturn (\"running\" == $this->status());\n\t}", "public function runningInConsole()\n {\n return in_array(php_sapi_name(), ['cli', 'phpdbg']);\n }", "public function runningInConsole()\n {\n return in_array(php_sapi_name(), ['cli', 'phpdbg']);\n }", "public function isRunning()\n {\n return ($this->getStatus() == self::RUNNING);\n }", "public function runningInConsole()\n {\n return php_sapi_name() == 'cli' || php_sapi_name() == 'phpdbg';\n }", "private function _isMine(): bool {\n\t\treturn $this->isMyServer() && $this->isMyPID();\n\t}", "private function get_is_running(): bool\n\t{\n\t\treturn $this->status === self::STATUS_RUNNING;\n\t}", "public function isRunning(): bool;", "public function isStarted()\n\t{\n\t\treturn true;\n\t}", "public function isRunning()\n {\n if (OS::isWin()) {\n $cmd = \"wmic process get processid | findstr \\\"{$this->pid}\\\"\";\n $res = array_filter(explode(\" \", shell_exec($cmd)));\n return count($res) > 0 && $this->pid == reset($res);\n } else {\n return !!posix_getsid($this->pid);\n }\n }", "public function isListened()\n {\n return !empty($this->socket);\n }", "public function isStarted()\n {\n return true;\n }", "public function isStarted()\n {\n return true;\n }", "public function isStarted()\n {\n return true;\n }", "public function runningInConsole()\n {\n return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';\n }", "public function hasRunning()\n {\n return $this->running !== null;\n }", "public static function isServerMode(): bool\n {\n /** @phpstan-ignore-next-line */\n return (defined('SPLASH_SERVER_MODE') && !empty(SPLASH_SERVER_MODE));\n }", "public function hasServerType()\n {\n return $this->server_type !== null;\n }", "public function runningInConsole()\n {\n return \\PHP_SAPI === 'cli' || \\PHP_SAPI === 'phpdbg';\n }", "private function isRunningConsole(): bool\n {\n return $this->app->runningInConsole();\n }", "private static function isStarted()\r\n {\r\n // several functions has been added in php 5.4\r\n // disallow determining session stuff when running from command line\r\n if (php_sapi_name() !== 'cli')\r\n {\r\n // are we on PHP 5.4 or higher?\r\n if (version_compare(phpversion(), '5.4.0', '>='))\r\n return (session_status() === PHP_SESSION_ACTIVE);\r\n else\r\n return (session_id() !== '');\r\n }\r\n\r\n return false;\r\n }", "function isStarted()\n {\n return (TRUE == $this->started);\n }", "public static function getRunning()\n\t{\n\t\treturn false;\n\t}", "public function isStarted()\n {\n return $this->_manager->isStarted();\n }", "public function isMain() {\n\t\treturn $this->_page == null;\n\t}" ]
[ "0.6746405", "0.6707584", "0.6622919", "0.64110506", "0.63055545", "0.6265126", "0.62634087", "0.62634087", "0.62060827", "0.62021744", "0.61749005", "0.6170871", "0.6155611", "0.6134765", "0.6132051", "0.61135215", "0.61058754", "0.61058754", "0.61058754", "0.608774", "0.60759753", "0.6032958", "0.60175955", "0.60134685", "0.60097283", "0.6008658", "0.5982918", "0.59771657", "0.59585905", "0.5952282" ]
0.68174803
0
Returns the configured public docroot path.
public static function getDocroot() { return MHTTPD::$config['Paths']['docroot']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPublicRoot()\n {\n $this->initializeVendorDir();\n return realpath($this->public_root);\n }", "function public_path()\n {\n $paths = getPaths();\n\n return $paths['public'];\n }", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }", "public static function getServerDocroot() \n\t{\n\t\treturn MHTTPD::$config['Paths']['server_docroot'];\n\t}", "public function getPublicDir():string {\n return $this->getProjectDir() . '/public';\n }", "public function publicPath()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'public';\n }", "public function publicPath()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'public';\n }", "public function getPublicBasePath();", "public function root(): string\n {\n return $this->instances->demo()->config()->root() . '/public/' . $this->name;\n }", "public function publicPath()\n {\n return rtrim($this->publicPath, '/') .'/';\n }", "public function getPublicDirectory(): string\n {\n return config('theme-system.public', 'public') ?? 'public';\n }", "public function getPublicPath()\n {\n return $this->getSettingArray()[\"public_path\"];\n }", "function public_path()\n {\n return base_path() . '/public';\n }", "protected static function getDocumentRoot() {\n\t\treturn BootstrapConfig::getParam(\"document_root\", $_SERVER['DOCUMENT_ROOT']);\n\t}", "private static function getWebRoot() {\n if (file_exists(realpath(__DIR__ . '/../../../../../public_html'))) {\n return self::addlSash(\"public_html\");\n } else {\n return self::addlSash(\"web\");\n }\n }", "public function getDocumentRoot()\n {\n $documentRoot = '';\n $normalized = $this->getNormalized();\n if (empty($normalized['web']['locations'])) {\n return $documentRoot;\n }\n foreach ($this->getNormalized()['web']['locations'] as $path => $location) {\n if (isset($location['root'])) {\n $documentRoot = $location['root'];\n }\n if ($path === '/') {\n break;\n }\n }\n\n return ltrim($documentRoot, '/');\n }", "public function getPublicPath(): string\n {\n return Path::unifyPath(Environment::getPublicPath());\n }", "public function getPublicDir()\n\t{\n\t\treturn $this->_publicDir;\n\t}", "public function public_path();", "public static function getDocumentRoot()\r\n\t{\r\n\t\tstatic $documentRoot = null;\r\n\t\tif ($documentRoot != null)\r\n\t\t\treturn $documentRoot;\r\n\r\n\t\t$context = Application::getInstance()->getContext();\r\n\t\tif ($context != null)\r\n\t\t{\r\n\t\t\t$server = $context->getServer();\r\n\t\t\tif ($server != null)\r\n\t\t\t\treturn $documentRoot = $server->getDocumentRoot();\r\n\t\t}\r\n\r\n\t\treturn rtrim($_SERVER[\"DOCUMENT_ROOT\"], \"\\\\/\");\r\n\t}", "public function publicPath(): string\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'public';\n }", "function public_path($path=null)\n\t{\n\t\treturn rtrim(app()->basePath('../public_html/'.$path), '/');\n\t}", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../../web/'.$this->getUploadDir();\n }", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "function getWebsiteRootPath()\n {\n // Check that the absolute path to the current directory is accessible\n // (some webhosts denies access this way)\n if ( file_exists (FCPATH) ) {\n return FCPATH;\n } else {\n // Fake relative path by using subdirectory\n return 'js/../';\n }\n }", "public function getWebroot() {\n return Yii::getAlias('@static') .DIRECTORY_SEPARATOR. 'web' .DIRECTORY_SEPARATOR.$this->module.DIRECTORY_SEPARATOR. $this->parent_id .DIRECTORY_SEPARATOR;\n }", "public function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../web/'.$this->getUploadDir().\"/\".$this->getHash();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\r\n {\r\n // documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }", "function public_url() {\n return url(\"/\");\n }" ]
[ "0.79588366", "0.7954139", "0.78660136", "0.7685791", "0.76250887", "0.76140064", "0.76140064", "0.7585091", "0.75733835", "0.75661373", "0.7545899", "0.7538565", "0.74869585", "0.7439908", "0.7412197", "0.7378347", "0.73596746", "0.73179036", "0.73125345", "0.7305334", "0.7296336", "0.71790713", "0.7158245", "0.71551245", "0.7151778", "0.71511805", "0.71384805", "0.7128773", "0.7123866", "0.71237427" ]
0.80986744
0
Returns the private server docroot path.
public static function getServerDocroot() { return MHTTPD::$config['Paths']['server_docroot']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getDocroot() \n\t{\n\t\treturn MHTTPD::$config['Paths']['docroot'];\n\t}", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "function base_path() {\n return (new Server)->get('DOCUMENT_ROOT');\n }", "public static function getDocumentRoot()\r\n\t{\r\n\t\tstatic $documentRoot = null;\r\n\t\tif ($documentRoot != null)\r\n\t\t\treturn $documentRoot;\r\n\r\n\t\t$context = Application::getInstance()->getContext();\r\n\t\tif ($context != null)\r\n\t\t{\r\n\t\t\t$server = $context->getServer();\r\n\t\t\tif ($server != null)\r\n\t\t\t\treturn $documentRoot = $server->getDocumentRoot();\r\n\t\t}\r\n\r\n\t\treturn rtrim($_SERVER[\"DOCUMENT_ROOT\"], \"\\\\/\");\r\n\t}", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }", "public function getConfiguredServerRoot()\n {\n return $this->server_root;\n }", "static public function getSecureRootPath() {\n\t\treturn Page::$base_ssl_path;\n\t}", "public function getRootPath(): string\n {\n return $this->rootPath;\n }", "protected static function getDocumentRoot() {\n\t\treturn BootstrapConfig::getParam(\"document_root\", $_SERVER['DOCUMENT_ROOT']);\n\t}", "public function getPublicRoot()\n {\n $this->initializeVendorDir();\n return realpath($this->public_root);\n }", "private static function getWebRoot() {\n if (file_exists(realpath(__DIR__ . '/../../../../../public_html'))) {\n return self::addlSash(\"public_html\");\n } else {\n return self::addlSash(\"web\");\n }\n }", "public function getFileRootPath(): string\n {\n return str_replace(\n ':',\n '.',\n $this->getDatasetSubmission()->getDataset()->getUdi()\n ) . DIRECTORY_SEPARATOR;\n }", "public function root(): string\n {\n return $this->instances->demo()->config()->root() . '/public/' . $this->name;\n }", "public function getRootPath()\r\n\t{\r\n\t\treturn $this->rootPath;\r\n\t}", "public static function getSiteRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder';\n }\n else {\n return Config::getHTTPS() . '://' . $_SERVER['SERVER_NAME'];\n }\n }", "public function rootDir(): string\n {\n return $this->root;\n }", "function public_path()\n {\n $paths = getPaths();\n\n return $paths['public'];\n }", "public function root()\n {\n if ($this['environment']->has('SCRIPT_FILENAME') === false) {\n throw new \\RuntimeException(\n 'The \"`\"SCRIPT_FILENAME\" server variable could not be found.\n It is required by \"Workbench::root()\".'\n );\n }\n\n return dirname($this['environment']->get('SCRIPT_FILENAME'));\n }", "protected function privateAbsolutePath() : string {\n return $this->privateFolder['absolute'];\n }", "public function getDocumentRoot()\n {\n $documentRoot = '';\n $normalized = $this->getNormalized();\n if (empty($normalized['web']['locations'])) {\n return $documentRoot;\n }\n foreach ($this->getNormalized()['web']['locations'] as $path => $location) {\n if (isset($location['root'])) {\n $documentRoot = $location['root'];\n }\n if ($path === '/') {\n break;\n }\n }\n\n return ltrim($documentRoot, '/');\n }", "function getDocumentRoot(){\n\t\t$document_root = isset($_SERVER[\"DOCUMENT_ROOT\"]) ? $_SERVER[\"DOCUMENT_ROOT\"] : \"\";\n\t\t#get env variables under IIS\n\t\tif( !$document_root ){\n\t\t $sf = str_replace(\"\\\\\",\"/\",$_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t $sn = $_SERVER[\"SCRIPT_NAME\"];\n\t\t $document_root = str_replace( $sn, \"\", $sf );\n\t\t}\n\t\treturn $document_root;\n}", "public function getRootPath()\n {\n return $this->rootPath;\n }", "public function get_server_http_root()\n {\n\t\t$split = explode('.',$_SERVER['HTTP_HOST']);\n\t\t\n\t\t$root=$split[0];\n\t\t//makes it devbrad from just brad\n\t\tif( in_array($root,array('sam','ryan','brad'))) $root = \"dev\".$root;\n\t\t//else it is just stage or live, leave it alone\n\t\t\n\t\treturn \"endeavor/\".$root.\"/\";\n\t\t\n }", "public static function privateFilesDirectory() {\n $status = static::parseStatus();\n $path = $status->get('private');\n\n if (!empty($path)) {\n return $path;\n }\n\n return NULL;\n }", "public function getRootPath()\n {\n return $this->root_path;\n }", "public function public_path();", "public function get_root_path()\n\t{\n\t\treturn $this->ext_root_path;\n\t}", "protected function getUploadRootDir(): string\n {\n // documents should be saved\n return __DIR__.'/../../public/'.$this->getUploadDir();\n }", "public function getPublicBasePath();", "public function getWebroot() {\n return Yii::getAlias('@static') .DIRECTORY_SEPARATOR. 'web' .DIRECTORY_SEPARATOR.$this->module.DIRECTORY_SEPARATOR. $this->parent_id .DIRECTORY_SEPARATOR;\n }" ]
[ "0.74405473", "0.7284044", "0.7262614", "0.71985906", "0.7049879", "0.6978768", "0.69082654", "0.68648136", "0.6806023", "0.6805294", "0.67474943", "0.6711657", "0.6694753", "0.667781", "0.6663147", "0.663424", "0.6625719", "0.66089225", "0.66029876", "0.65919304", "0.658228", "0.6561938", "0.65338635", "0.6522999", "0.65055597", "0.6503516", "0.6487183", "0.64792436", "0.6476283", "0.6467108" ]
0.8346813
0
Returns the list of paths from which XSendFile requests may be served.
public static function getSendFilePaths() { if (!empty(MHTTPD::$send_file_paths)) { return MHTTPD::$send_file_paths; } // Store the absolute paths $paths = listToArray(MHTTPD::$config['Paths']['send_file']); $real_paths = array(); foreach ($paths as $path) { if (($rpath = realpath(MHTTPD::getInipath().$path)) || ($rpath = realpath($path))) { $real_paths[] = $rpath; } } MHTTPD::$send_file_paths = $real_paths; return $real_paths; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/trickstr.php',\n 'sources_custom/programe/.htaccess',\n 'sources_custom/programe/aiml/.htaccess',\n 'sources_custom/programe/aiml/index.html',\n 'sources_custom/programe/index.html',\n 'sources_custom/hooks/modules/chat_bots/knowledge.txt',\n 'sources_custom/hooks/modules/chat_bots/trickstr.php',\n 'sources_custom/programe/aiml/readme.txt',\n 'sources_custom/programe/aiml/startup.xml',\n 'sources_custom/programe/aiml/std-65percent.aiml',\n 'sources_custom/programe/aiml/std-pickup.aiml',\n 'sources_custom/programe/botloaderfuncs.php',\n 'sources_custom/programe/customtags.php',\n 'sources_custom/programe/db.sql',\n 'sources_custom/programe/graphnew.php',\n 'sources_custom/programe/respond.php',\n 'sources_custom/programe/util.php',\n );\n }", "public function getCopyFileUrls() {\n if (!$this->copyFilePaths) return [];\n\n $urls = [];\n\n foreach($this->copyFilePaths as $filePath) {\n $url = FileService::getInstance()->getUrlForPathUnderUploadsDir($filePath);\n if (!$url) continue;\n\n $urls[] = $url;\n }\n\n return $urls;\n }", "public function get_paths()\n\t{\n\t\tif ( ! ee()->session->cache(__CLASS__, 'paths'))\n\t\t{\n\t\t\t$paths = array();\n\t\t\t$upload_prefs = $this->get_file_upload_preferences(NULL, NULL, TRUE);\n\n\t\t\tif (count($upload_prefs) == 0)\n\t\t\t{\n\t\t\t\treturn $paths;\n\t\t\t}\n\n\t\t\tforeach ($upload_prefs as $row)\n\t\t\t{\n\t\t\t\t$paths[$row['id']] = $row['url'];\n\t\t\t}\n\n\t\t\tee()->session->set_cache(__CLASS__, 'paths', $paths);\n\t\t}\n\n\t\treturn ee()->session->cache(__CLASS__, 'paths');\n\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/wiki_sync.php',\n '_tests/tests/unit_tests/wiki_sync.php',\n 'lang_custom/EN/wiki_sync.ini',\n 'sources_custom/wiki_sync.php',\n 'sources_custom/hooks/systems/config/wiki_alt_changes_link_stub.php',\n 'sources_custom/hooks/systems/config/wiki_enable_git_sync.php',\n 'sources_custom/hooks/systems/config/wiki_enable_wysiwyg.php',\n 'sources_custom/hooks/systems/config/wiki_sync_media_directory.php',\n 'sources_custom/hooks/systems/config/wiki_sync_page_directory.php',\n 'sources_custom/hooks/systems/cron/wiki_sync_git.php',\n 'sources_custom/hooks/systems/notifications/wiki_failed_git_pull.php',\n 'sources_custom/wiki.php',\n 'site/pages/modules_custom/wiki.php',\n 'cms/pages/modules_custom/cms_wiki.php',\n );\n }", "function getPaths()\n {\n $paths = array();\n foreach ($this->names as $name) {\n $paths[] = $this->dir.$name.$this->ext;\n }\n return $paths;\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/google_search.php',\n 'lang_custom/EN/google_search.ini',\n 'sources_custom/blocks/side_google_search.php',\n 'sources_custom/blocks/main_google_results.php',\n 'themes/default/templates_custom/BLOCK_SIDE_GOOGLE_SEARCH.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_GOOGLE_SEARCH_RESULTS.tpl',\n 'themes/default/css_custom/google_search.css',\n 'pages/comcode_custom/EN/_google_search.txt',\n );\n }", "public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }", "public function getLocalPaths()\n {\n return array_map(\n function (LocalResource $r) { return $r->getLocalPath(); },\n $this->toArray()\n );\n }", "final public function get_paths() {\n return array();\n }", "public function getFiles()\n {\n $request = $this->getRequest();\n return (array)$request->getFiles();\n }", "public function getPaths(): array\n {\n return $this->paths;\n }", "public function getPaths(): array\n {\n return $this->paths;\n }", "private function _getRequestPaths()\n {\n $paths = array();\n \n // Find maxPages with the ceil of the total properties / the maximum\n // pageSize\n $maxPages = ceil($this->getTotal() / $this->getMaxPageSize());\n \n // Use plus one as the first page will have already be requested\n for ($i = $this->getPage() + 1; $i <= $maxPages; $i++) {\n $paths[] = $this->getRequestPath($i, $this->getMaxPageSize());\n }\n \n return $paths;\n }", "protected function sourceFiles()\n {\n static $files;\n\n if ($files === null) {\n $basePath = $this->basePath();\n $includedPaths = $this->includedPaths();\n $excludedPaths = $this->excludedPaths();\n\n $included = [];\n foreach ($includedPaths as $relPath) {\n $included = array_merge($included, $this->globRecursive($basePath.'/'.$relPath, GLOB_BRACE));\n }\n\n $excluded = [];\n foreach ($excludedPaths as $relPath) {\n $excluded = array_merge($excluded, $this->globRecursive($basePath.'/'.$relPath, GLOB_BRACE));\n }\n\n $files = array_diff($included, $excluded);\n }\n\n return $files;\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/jestr.php',\n 'sources_custom/forum/cns.php',\n 'lang_custom/EN/jestr.ini',\n 'themes/default/templates_custom/EMOTICON_IMG_CODE_THEMED.tpl',\n 'forum/pages/modules_custom/topicview.php',\n 'sources_custom/hooks/systems/config/jestr_avatar_switch_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_emoticon_magnet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_leet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_piglatin_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes_shown_for.php',\n );\n }", "private function attachmentPaths(): array\n {\n $sql = \"SELECT meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s\";\n /** @var \\stdClass[] $metadata */\n $metadata = $this->wpdb->get_results($this->wpdb->prepare($sql, '_wp_attachment_metadata'));\n\n if (!$metadata) {\n return [];\n }\n\n $paths = [];\n foreach ($metadata as $metadataValue) {\n list($dir, $files) = $this->attachmentPathFiles($metadataValue);\n if ($dir && $files) {\n array_key_exists($dir, $paths)\n ? $paths[$dir] = array_merge($paths[$dir], $files)\n : $paths[$dir] = $files;\n }\n }\n\n return $paths;\n }", "public function getPaths();", "public static function getIndexFiles()\n\t{\n\t\tif (empty(MHTTPD::$config['Server']['index_files'])) {\n\t\t\treturn array();\n\t\t}\n\t\treturn MHTTPD::$config['Server']['index_files'];\n\t}", "public function getSrcFiles()\n\t{\n\t\t// src files are cached to be less calls on the fs\n\t\tif (!$this->srcFiles) {\n\t\t\t$this->srcFiles = $this->getFiles($this->config['src']);\n\t\t}\n\n\t\treturn $this->srcFiles;\n\t}", "public function getFiles() {\r\n\r\n $files = array();\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n $dir = FILEPATH . $userId. '/' . $trackingId;\r\n\r\n if (is_dir($dir)) {\r\n if ($dh = opendir($dir)) {\r\n while (($file = readdir($dh)) !== false) {\r\n if($file != '.' && $file != '..') {\r\n $size = $this->Size($dir . '/' . $file);\r\n array_push($files, array('name'=>$file,\r\n 'urlfilename'=>urlencode($file),\r\n 'size'=>$size));\r\n }\r\n }\r\n closedir($dh);\r\n }\r\n }\r\n\r\n return $files;\r\n }", "public function getDeviceFiles()\n {\n return [$this->getPreferredDeviceFile()];\n }", "public static final function paths()\n {\n\treturn self::$_paths;\n }", "public function getPaths()\n {\n return $this->paths;\n }", "public function getPaths()\n {\n return $this->_paths;\n }", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "public function getPrintFiles()\n {\n $key = $this->specification->key;\n\n $files = glob(storage_path('prints' . DIRECTORY_SEPARATOR . $key . DIRECTORY_SEPARATOR . '*.docx'));\n $file_names = array_map('basename', $files);\n\n return $file_names;\n }", "protected function getAvailableFiles() {\n\t\t$sql = \"SELECT\tfilename\n\t\t\tFROM\twcf\".WCF_N.'_'.$this->tableName.\"\n\t\t\tWHERE\tpackageID = \".$this->installation->getPackageID();\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\n\t\t$availableFiles = array();\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$availableFiles[] = $row['filename'];\n\t\t}\n\t\t\n\t\treturn $availableFiles;\n\t}", "public function getAvailablePaths()\n {\n $paths = [];\n $datasources = array_reverse($this->datasources);\n foreach ($datasources as $datasource) {\n $paths = array_merge($paths, $datasource->getAvailablePaths());\n }\n return $paths;\n }", "public function listApplicationFiles() {\r\n\t\t$preload = array(\r\n\t\t\t\"config/main.js\"\r\n\t\t);\r\n\t\t\r\n\t\t$return = array();\r\n\t\t$fullPath = $this->applicationPath;\r\n\t\r\n\t\tforeach($preload as $file) {\r\n\t\t\t$return[] = $fullPath.\"/\".$file;\r\n\t\t}\r\n\t\t\r\n\t\t$options = array(\r\n\t\t\t\"fileTypes\" => array(\"js\"),\r\n\t\t\t\"exclude\" => array_merge($preload, array(\r\n\t\t\t\t\"data\", \"messages\", \"compiled.js\"\r\n\t\t\t))\r\n\t\t);\r\n\t\t\r\n\t\t$return = array_merge($return, CFileHelper::findFiles($fullPath,$options));\r\n\t\t\r\n\t\t\r\n\t\treturn $return;\r\n\t}" ]
[ "0.66162944", "0.6567059", "0.6561348", "0.6464385", "0.6464098", "0.6408907", "0.6354905", "0.6340888", "0.63334733", "0.6308133", "0.6256872", "0.62493", "0.62493", "0.6247828", "0.6246778", "0.6213495", "0.6192444", "0.61869603", "0.61307496", "0.61296743", "0.61213833", "0.60838926", "0.6079984", "0.6065066", "0.60512614", "0.60485893", "0.604116", "0.6038561", "0.6030427", "0.60059184" ]
0.808459
0
Returns the maximum number of requests allowed for KeepAlive connections.
public static function getMaxRequests() { return MHTTPD::$config['Server']['keep_alive_max_requests']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function max_connections()\n {\n $channel = ChannelRepository::getPublic($this);\n\n return $channel->max_connections;\n }", "public function getMaxConnections() {\n return @$this->attributes['max_connections'];\n }", "public function getMaxInstanceRequestConcurrency()\n {\n return $this->max_instance_request_concurrency;\n }", "public static function getAliveTimeout()\n\t{\n\t\treturn MHTTPD::$config['Server']['keep_alive_timeout'];\n\t}", "public function getServerFailureLimit()\n {\n return $this->serverFailureLimit;\n }", "public function maxTries() {\n\t\treturn 1;\n\t}", "public function getMaxConnectionsPerIp()\n {\n return $this->_maxConnectionsPerIp;\n }", "public function count() {\n return sizeof(self::$connections);\n }", "public function getMaxRetries()\n {\n return $this->_maxRetries;\n }", "public function getconnectioncount()\n\t{\n\t\treturn $this->connect('getconnectioncount');\n\t}", "public function get_maximum_tries() {\n $max = 1;\n foreach ($this->get_response_class_ids() as $responseclassid) {\n $max = max($max, $this->get_response_class($responseclassid)->get_maximum_tries());\n }\n return $max;\n }", "public function getMaxClients()\n {\n return $this->_maxClients;\n }", "public function getRequestCount()\n {\n return $this->requestCount;\n }", "final public static function HpsMaximumNumberOfRetryTransactionWasBreached()\n {\n return self::get(822);\n }", "function get_number_of_requests() {\n return CourseRequestManager::count_course_requests(COURSE_REQUEST_REJECTED);\n}", "public function getIdleWorkerCount(): int;", "protected function maxLoginAttempts()\n {\n return Arr::get(static::$config, 'attempts', 5);\n }", "public function getMaxConfs()\n {\n return $this->max_confs;\n }", "public function getRateLimitLimit(): int\n {\n return $this->httpClient->getRateLimitLimit();\n }", "public function getNotificationCounterMax()\n {\n return self::NOTIFICATIONS_COUNTER_MAX;\n }", "public function getMaxAllowedPacket(): int\n {\n if (!isset($this->maxAllowedPacket))\n {\n $query = \"show variables like 'max_allowed_packet'\";\n $max_allowed_packet = $this->executeRow1($query);\n\n $this->maxAllowedPacket = $max_allowed_packet['Value'];\n\n // Note: When setting $chunkSize equal to $maxAllowedPacket it is not possible to transmit a LOB\n // with size $maxAllowedPacket bytes (but only $maxAllowedPacket - 8 bytes). But when setting the size of\n // $chunkSize less than $maxAllowedPacket than it is possible to transmit a LOB with size\n // $maxAllowedPacket bytes.\n $this->chunkSize = (int)min($this->maxAllowedPacket - 8, 1024 * 1024);\n }\n\n return (int)$this->maxAllowedPacket;\n }", "public function getConnectionCount();", "public function getNumberOfRequests()\n {\n return array_sum($this->numberOfRequestsByPattern);\n }", "public function maxTries();", "public function getHttpHeartbeatTimeout()\n {\n return $this->httpHeartbeatTimeout;\n }", "public function getHeartbeatInterval(): int\n {\n }", "public function getconnectioncount() {\n return $this->bitcoin->getconnectioncount();\n }", "function http_persistent_handles_count() {}", "public function getMaxReplicas(): int {\n return $this->maxReplicas;\n }", "function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}" ]
[ "0.7217943", "0.6995841", "0.684907", "0.68140244", "0.63810813", "0.6331577", "0.62962025", "0.62707025", "0.62273926", "0.6217283", "0.6155623", "0.60660195", "0.60581654", "0.5992669", "0.5967646", "0.59664196", "0.596065", "0.59484506", "0.5941985", "0.5936001", "0.587745", "0.58446", "0.5806039", "0.57867473", "0.5786745", "0.57789755", "0.57525545", "0.5752373", "0.5740867", "0.5734335" ]
0.8511005
0
Returns the configured timeout for KeepAlive connections.
public static function getAliveTimeout() { return MHTTPD::$config['Server']['keep_alive_timeout']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConnectTimeout();", "public function getConnectionTimeout();", "public function getHeartbeatTimeout()\n {\n return $this->heartbeatTimeout;\n }", "public function getConnectTimeout() {\n\t\treturn $this->connectionTimeout;\n\t}", "public static function getTimeout()\n {\n return static::$timeout;\n }", "public function getTimeout()\n {\n return self::$timeout;\n }", "public function getConnectTimeout()\n {\n return $this->connectTimeout;\n }", "public function getTimeout(): int\n {\n return $this->timeout;\n }", "public function getTimeout()\n {\n return $this->timeout;\n }", "public function getTimeout()\n {\n return $this->timeout;\n }", "public function getTimeout()\n {\n return $this->timeout;\n }", "public function getTimeout()\n {\n return $this->timeout;\n }", "public function getTimeout()\n {\n return $this->timeout;\n }", "public function getTimeout() {\r\n\t\treturn $this->timeout;\r\n\t}", "public function getTimeout()\n {\n return $this->getHttpClient()->getTimeout();\n }", "public function getConnectTimeout(): float\n {\n }", "public function getTimeout() {\r\n return $this->timeout;\r\n }", "public function getTimeout()\n {\n return $this->timeout;\n }", "public function getTimeout()\n\t{\n\t\treturn $this->timeout;\n\t}", "public function getHttpHeartbeatTimeout()\n {\n return $this->httpHeartbeatTimeout;\n }", "public function getTimeout() {\n return $this->_timeout;\n }", "public function getTimeout()\n {\n return $this->Timeout;\n }", "public function getTimeout()\n {\n return $this->get(self::_TIMEOUT);\n }", "public function getTimeout()\n {\n return $this->_timeout;\n }", "public function getTimeout()\n {\n return $this->_timeout;\n }", "public function getTimeout()\n {\n return isset($this->timeout) ? $this->timeout : 0;\n }", "public function getCurlConnectTimeout()\n {\n return $this->curlConnectTimeout;\n }", "public function timeout(): int\n {\n return $this->timeout;\n }", "public function timeout()\n\t{\n\t\treturn $this->timeout;\n\t}", "public function getCookiesTimeOut() \n {\n $cookiesTimeout = Mage::getStoreConfig(self::XML_PATH_COOKIES_TIMEOUT);\n return $cookiesTimeout;\n }" ]
[ "0.7273374", "0.7048277", "0.69791263", "0.6954576", "0.68341064", "0.6831145", "0.67914665", "0.6779526", "0.6732166", "0.6732166", "0.6732166", "0.6732166", "0.6732166", "0.67231953", "0.6705623", "0.6700998", "0.6695791", "0.6689187", "0.6688377", "0.6670053", "0.661954", "0.66130584", "0.6596779", "0.65816903", "0.65816903", "0.6580486", "0.65546197", "0.6514409", "0.6426698", "0.64258796" ]
0.78974396
0
Returns the list of default directory index files.
public static function getIndexFiles() { if (empty(MHTTPD::$config['Server']['index_files'])) { return array(); } return MHTTPD::$config['Server']['index_files']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultIndexDirectoryPath();", "public function getIndexDirectoryPath();", "public function hasDefaultIndexDirectoryPath();", "function index($dir = '.') {\n\t\t$index = array();\n\t\tif ($handle = opendir($dir)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\") {\n\t\t\t\t\tif (isAllowedFile($dir.'/'.$file)) $index[preg_replace(\"/^\\.\\//i\",\"\",$dir.'/'.$file)] = filemtime($dir.'/'.$file);\n\t\t\t\t\telseif (is_dir($dir.'/'.$file)) $index = array_merge($index, index($dir.'/'.$file));\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\treturn $index;\n\t}", "public function index() {\n\t\treturn array_keys($this->info->centralDirectory);\n\t}", "protected function getIndexDefaults() {\n return array(\n 'page_id' => 0,\n 'page_size' => 25,\n 'sort_by' => 'update_date',\n 'sort_order' => 'asc'\n );\n }", "public static function get_default_dirs() {\n\t\t// Always include default admin and include directories.\n\t\t$defaults = [ '/wp-admin/', '/wp-includes/' ];\n\n\t\t// Include directories set by dependencies classes if parent directory not already included.\n\t\treturn array_unique( array_merge( $defaults, (array) wp_scripts()->default_dirs, (array) wp_styles()->default_dirs ) );\n\t}", "static function getDirectoryListing();", "public function getFallbackDirs();", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "public function listAll()\n {\n $files = \\Core\\File\\System::listFiles($this->_getPath(), \\Core\\File\\System::EXCLUDE_DIRS);\n $result = [];\n foreach (array_keys($files) as $file) {\n $result[] = pathinfo($file, PATHINFO_FILENAME);\n }\n return $result;\n }", "public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }", "function _generateFilesList() {\n return array();\n }", "public function actionIndexFiles()\n {\n $manager = new Manager(['module' => $this->module]);\n $manager->indexAll();\n }", "public function getDefaultIndex()\n {\n return $this->defaultIndex;\n }", "public function getDefaultFolder() {}", "public function getDefaultFolder() {}", "function getDefaultFolder() ;", "public static function get_log_index() {\n\t\t$server = WD_Utils::determine_server( content_url( 'index.php' ) );\n\t\tif ( $server == 'apache' ) {\n\t\t\t$is_apache = true;\n\t\t} else {\n\t\t\t$is_apache = false;\n\t\t}\n\n\t\t$result = array();\n\t\tif ( $is_apache ) {\n\t\t\t$upload_dirs = wp_upload_dir();\n\t\t\t$log_dir = $upload_dirs['basedir'] . DIRECTORY_SEPARATOR . 'wp-defender/';\n\t\t\t$result = WD_Utils::get_dir_tree( $log_dir, true, false, array(), array(\n\t\t\t\t'ext' => array( 'log' )\n\t\t\t) );\n\t\t} else {\n\t\t\tglobal $wpdb;\n\t\t\t$table = is_multisite() ? $wpdb->sitemeta : $wpdb->options;\n\t\t\t$key = is_multisite() ? 'meta_key' : 'option_name';\n\t\t\t$sql = \"SELECT $key FROM $table WHERE $key LIKE %s\";\n\t\t\t$result = $wpdb->get_col( $wpdb->prepare( $sql, 'wd_log%' ) );\n\t\t}\n\n\t\treturn $result;\n\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/wiki_sync.php',\n '_tests/tests/unit_tests/wiki_sync.php',\n 'lang_custom/EN/wiki_sync.ini',\n 'sources_custom/wiki_sync.php',\n 'sources_custom/hooks/systems/config/wiki_alt_changes_link_stub.php',\n 'sources_custom/hooks/systems/config/wiki_enable_git_sync.php',\n 'sources_custom/hooks/systems/config/wiki_enable_wysiwyg.php',\n 'sources_custom/hooks/systems/config/wiki_sync_media_directory.php',\n 'sources_custom/hooks/systems/config/wiki_sync_page_directory.php',\n 'sources_custom/hooks/systems/cron/wiki_sync_git.php',\n 'sources_custom/hooks/systems/notifications/wiki_failed_git_pull.php',\n 'sources_custom/wiki.php',\n 'site/pages/modules_custom/wiki.php',\n 'cms/pages/modules_custom/cms_wiki.php',\n );\n }", "public function initDefaultDirectories()\n {\n $this->setParam(DirectoryKeys::TMP, ParamNode::TYPE_STRING, '/tmp');\n $this->setParam(DirectoryKeys::DEPLOY, ParamNode::TYPE_STRING, '/deploy');\n $this->setParam(DirectoryKeys::WEBAPPS, ParamNode::TYPE_STRING, '/webapps');\n $this->setParam(DirectoryKeys::VAR_LOG, ParamNode::TYPE_STRING, '/var/log');\n $this->setParam(DirectoryKeys::VAR_RUN, ParamNode::TYPE_STRING, '/var/run');\n $this->setParam(DirectoryKeys::VAR_TMP, ParamNode::TYPE_STRING, '/var/tmp');\n $this->setParam(DirectoryKeys::ETC_APPSERVER, ParamNode::TYPE_STRING, '/etc/appserver');\n $this->setParam(DirectoryKeys::ETC_APPSERVER_CONFD, ParamNode::TYPE_STRING, '/etc/appserver/conf.d');\n }", "public static function getIndexFile() {\n return self::$config->index_file;\n }", "protected function getFileList()\n\t\t{\n\t\t\t$dirname=opendir($this->ruta);\n\t\t\t$files=scandir($this->ruta);\n\t\t\tclosedir ($dirname);\t\n\t\t\t\n\t\t\treturn $files;\t\t\n\t\t}", "public function index()\n {\n $files = $this->files\n ->getFilesPaginated(config('core.sys.file.default_per_page'))\n ->items();\n return $this->handler\n ->apiResponse($files);\n }", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "function ft_hook_dirlist() {}" ]
[ "0.81148845", "0.687959", "0.66285294", "0.65067387", "0.6299508", "0.6262346", "0.6238817", "0.6220107", "0.61614054", "0.61104447", "0.6050074", "0.6044287", "0.5988231", "0.5980011", "0.5911843", "0.5888357", "0.5887802", "0.5885508", "0.58421993", "0.5833251", "0.58232915", "0.5811206", "0.574451", "0.5737928", "0.5732788", "0.5732788", "0.5732693", "0.5732693", "0.5732693", "0.57107276" ]
0.7434387
1
Returns the list of file extensions to be interpreted by the PHP FastCGI processes.
public static function getFCGIExtensions() { if (empty(MHTTPD::$config['FCGI']['extensions'])) { return array(); } return MHTTPD::$config['FCGI']['extensions']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSupportedFileExtensions() {}", "public function getSupportedFileExtensions()\n {\n return array_keys($GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['onlineMediaHelpers']);\n }", "public function getAllowFileExtensions()\n\t{\n\t\treturn implode(',', array_merge($this->videoExtensions, $this->imageExtensions, $this->audioExtensions, $this->docExtensions ));\n\t\t//return Yii::app()->params['fileExtensions'];\n\t}", "protected function getAcceptFileTypes()\n {\n $extensions = $this->getValidator()->getAllowedExtensions();\n if (!$extensions) {\n return [];\n }\n $extentionString = \"\";\n $i = 0;\n foreach ($extensions as $extension) {\n if ($i == 0) {\n $extentionString .= \".{$extension}\";\n } else {\n $extentionString .= \", .{$extension}\";\n }\n $i++;\n }\n return $extentionString;\n }", "protected function getFileExtensions() {\n\t\treturn $this->fileExtensions;\n\t}", "public function get_supported_extensions() {\n return array();\n }", "public function getAllowedExtensions()\n {\n return $this->allowedFiles;\n }", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "protected function extensions() \n {\n return ['php'];\n }", "protected function _getAllowedExtensions()\n {\n return ['jpg', 'jpeg', 'gif', 'png', 'svg'];\n }", "static public function getAllowedExtensions()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('extention')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->extention;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getAllowedExtensions()\n {\n return $this->allowedExtensions;\n }", "public function getAllowedExtensions()\n {\n return $this->allowedExtensions;\n }", "public function getAllowedExtensions()\n {\n return $this->_allowedExtensions;\n }", "public static function getExtensions()\n {\n return self::$_extensions;\n }", "public function getAllowedExtensions(){\n return $this->allowedExtensions;\n }", "public static function getAllowedExtension()\n\t{\n\t\treturn ['xml' => 'XML'];\n\t}", "protected function getExtensions()\n {\n if (file_exists(realpath(__DIR__.'/../../../../../config/twig.php'))) {\n $this->config = require realpath(__DIR__.'/../../../../../config/twig.php');\n } else {\n $this->config = require realpath(__DIR__.'/../../config/twig.php');\n }\n\n return isset($this->config['extensions']) ? $this->config['extensions'] : [];\n }", "public function provideFileAndExtension()\n {\n return [\n [__FILE__, 'php'],\n ['.htaccess', 'htaccess'],\n ['name', ''],\n ['a.combined.filename.with.multiple.ext.separator', 'separator']\n ];\n }", "public function getAllowedFileExtensions()\n {\n return ['jpg', 'jpeg', 'gif', 'png'];\n }", "public function getExtensionAllowed()\n {\n return array_merge($this->imageTypes, $this->videoTypes, $this->documentTypes);\n }", "public static function getAllowedFileExtensions() {\n\t\tif (self::$allowedFileExtensions === null) {\n\t\t\tself::$allowedFileExtensions = array();\n\t\t\tself::$allowedFileExtensions = array_unique(explode(\"\\n\", StringUtil::unifyNewlines(WCF::getUser()->getPermission('user.profile.avatar.allowedFileExtensions'))));\n\t\t\tself::$allowedFileExtensions = array_diff(self::$allowedFileExtensions, self::$illegalFileExtensions);\n\t\t}\n\t\t\n\t\treturn self::$allowedFileExtensions;\n\t}", "public final function getAcceptedExtensions() { \n return $this->acceptedExtensions; }", "public function getSupportedExtensions()\n {\n return array_keys($this->convertersByExtension);\n }", "public function getExtensions()\n {\n return $this->extension;\n }", "public function extensions(): array;", "public function getFileExtension();", "public function getSupportedExtensions()\n\t{\n\t\treturn array('xml');\n\t}", "public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach ($extensions as $extension) {\n $results[$extension] = extension_loaded($extension);\n }\n\n return $results;\n }" ]
[ "0.75095266", "0.7450413", "0.7387379", "0.73495805", "0.72481513", "0.7211943", "0.7183596", "0.7134137", "0.7134137", "0.7122811", "0.70979065", "0.7062294", "0.7054121", "0.7054121", "0.70047903", "0.69241256", "0.69082946", "0.6902633", "0.68864197", "0.6818086", "0.68168354", "0.6795593", "0.6765817", "0.6764719", "0.66949874", "0.6691254", "0.663636", "0.6595003", "0.6570836", "0.6554775" ]
0.80703557
0
Returns the configured server signature for displaying on pages.
public static function getSignature() { return MHTTPD::$info['signature']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSignature() {\n $headers = $this->getHeaders();\n foreach ($headers as $key => $value) {\n if (strtolower($key) === 'x-hub-signature') {\n return $value;\n }\n }\n return '';\n }", "public function getSignature(): string\n {\n return $this->signature;\n }", "public function getSignature(): string\n {\n return $this->signature;\n }", "public function getSignature() : string\n {\n return $this->signature;\n }", "public function getStringForResponseSignature()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__TARGET_API]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__DATE]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__PLATFORM_GID]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__SOURCE_GID]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__RANDOM]\r\n\t\t\t\t. $this->body;\r\n\t}", "public function showSignature()\n {\n return $this->view->make('welcome');\n }", "public function getSignature();", "function signature()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\t$t_sig = $this->parser->unconvert($this->member['signature'], $ibforums->vars['sig_allow_ibc'], $ibforums->vars['sig_allow_html']);\r\n\r\n\t\t$ibforums->lang['the_max_length'] = $ibforums->vars['max_sig_length']\r\n\t\t\t? $ibforums->vars['max_sig_length']\r\n\t\t\t: 0;\r\n\r\n\t\t$data = array(\r\n\t\t\t'TEXT' => $this->member['signature'],\r\n\t\t\t'SMILIES' => 1,\r\n\t\t\t'CODE' => 1,\r\n\t\t\t'SIGNATURE' => 0,\r\n\t\t\t'HTML' => $ibforums->vars['sig_allow_html'],\r\n\t\t);\r\n\r\n\t\t$this->member['signature'] = $this->parser->prepare($data);\r\n\r\n\t\tif ($ibforums->vars['sig_allow_html'] == 1)\r\n\t\t{\r\n\t\t\t$this->member['signature'] = $this->parser->parse_html($this->member['signature'], 0);\r\n\t\t}\r\n\r\n\t\t$this->output .= View::make(\r\n\t\t\t\"ucp.signature\",\r\n\t\t\t[\r\n\t\t\t\t'sig' => $this->member['signature'],\r\n\t\t\t\t't_sig' => $t_sig,\r\n\t\t\t\t'key' => $std->return_md5_check(),\r\n\t\t\t\t'select_syntax' => $std->code_tag_button()\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "private function getSignature(): string {\r\n return base64_encode(hash_hmac(\"sha1\", $this->buildSigningBase(), $this->buildSigningKey(), true));\r\n }", "public function getSignature() : string\n {\n\n return $this->httpMethod . ':' . $this->uri;\n }", "public static function getSignature()\n {\n return ':meta';\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "function getSignature()\n {\n return $this->_signature;\n }", "protected function getServer(string $signature): string\n {\n if (\n preg_match(\n '/(apache\\/\\d+\\.\\d+)|(nginx\\/\\d+\\.\\d+)|(iis\\/\\d+\\.\\d+)'\n . '|(lighttpd\\/\\d+\\.\\d+)/i',\n $signature,\n $matches\n )\n ) {\n return $matches[0];\n }\n\n return 'UNKNOWN';\n }", "public function getSignature(): string\n {\n return $this->getName();\n }", "public static function signature($includeIncludedFiles = null) {\n\t\tif ($includeIncludedFiles == null) {\n\t\t\t$includeIncludedFiles = false;\n\t\t}\n\n\t\t$signature = sprintf(\"server: %s (%s)\\n\", static::serverIp(), static::hostName());\n\n\t\tif (PHP_SAPI != 'cli') {\n\t\t\t$signature .= 'URI: ' . $_SERVER['REQUEST_METHOD'] . '=' . Application::getConfig('application', 'site_url') . Application::getUri() . \"\\n\";\n\t\t\t$signature .= sprintf(\"User IP: %s (%s)%s\", static::ip(), static::host(), (static::hasProxy() ? sprintf(\" via %s for %s\\n\", static::proxySignature(), static::httpXForwardedFor()) : \"\\n\"));\n\t\t\t$signature .= sprintf(\"UAS: %s\\n\", (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'no user agent set'));\n\t\t} else {\n\t\t\t$signature .= 'CLI Name: ' . Application::getCliName() . \"\\n\";\n\t\t\t$signature .= 'CLI Script: ' . Application::getCliScript() . \"\\n\";\n\n\t\t\t$params = Cli::getParameters();\n\t\t\tif (count($params) > 0) {\n\t\t\t\t$signature .= 'CLI Params: ' . print_r($params, true) . \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\t$signature .= sprintf(\"Server load: %s\\n\", Server::getServerLoad());\n\n\t\t$peak = memory_get_peak_usage(true);\n\t\t$memoryLimit = ini_get('memory_limit');\n\n\t\t$signature .= sprintf(\"Memory: %s; peak: %s; limit: %s; spent: %s%%\\n\",\n\t\t\tConvert::bytesToString(memory_get_usage(true)),\n\t\t\tConvert::bytesToString($peak),\n\t\t\t$memoryLimit,\n\t\t\t($memoryLimit !== false && $memoryLimit > 0 ? round($peak * 100 / Convert::stringToBytes($memoryLimit), 2) : 'null')\n\t\t);\n\n\t\tif ($includeIncludedFiles) {\n\t\t\t$signature .= sprintf(\"included files: %s\\n\", print_r(get_included_files(), true));\n\t\t}\n\n\t\treturn $signature;\n\t}", "public function getSignature() {\n\t\treturn $this->signature;\n\t}", "public function getSignedUrl(): string\n {\n $query = base64_encode(json_encode($this->buildQuery()));\n $signature = hash_hmac('sha256', $this->templateId . $query, $this->token);\n\n return $this->signedUrlBase . $this->templateId . '.png?' . http_build_query(['s' => $signature, 'v' => $query]);\n }", "public function getSignature()\n {\n $headers = $this->getHeaders();\n return isset($headers['X-Hub-Signature']) ? $headers['X-Hub-Signature'] : null;\n }", "public function getSignatureType(): string\n {\n return $this->type->getSignatureType();\n }", "public function setSignature()\n {\n \t$options = array('user_id' => $this->user_id,\n \t 'profile_key' => 'sig'\n \t );\n $result = DatabaseObject_UserProfile::getUserProfileData($this->_db, $options);\n \t\n \tif (!$result) {\n \t return \"\";\n \t}\n \t \n \treturn $this->signature = html_entity_decode($result);\n }", "private function getSignature()\n\t{\n\t\t$string_to_sign = mb_convert_encoding(\n\t\t\t$this->http_verb . $this->uri . $this->timestamp . $this->nonce,\n\t\t\t'UTF-8'\n\t\t);\n\t\treturn base64_encode(\n\t\t\thash_hmac(\n\t\t\t\t'sha1',\n\t\t\t\t$string_to_sign,\n\t\t\t\t$this->secret,\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t}", "function getAuthSignature()\n {\n return $this->_authSignature;\n }", "public function customize_preview_signature()\n {\n }", "public function getHeaderSignature()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__SIGNATURE];\r\n\t}", "private function get_signature_image_options() {\n\t\t$width = $this->get_signature_image_width();\n\t\t$height = $this->get_signature_image_height();\n\n\t\t$options = array( 'bgColour' => 'transparent' );\n\n\t\tif ( is_numeric( $height ) ) {\n\t\t\t$options['imageSize'] = array( (int) $width, (int) $height );\n\t\t\t$options['drawMultiplier'] = apply_filters( 'frm_sig_multiplier', 5, $this->field );\n\t\t}\n\n\t\treturn apply_filters( 'frm_sig_output_options', $options, array( 'field' => $this->field ) );\n\t}" ]
[ "0.64923227", "0.6383859", "0.6383859", "0.6373031", "0.6329084", "0.62366974", "0.6089666", "0.60710776", "0.60570353", "0.6019753", "0.60176116", "0.59977907", "0.59977907", "0.59977907", "0.59977907", "0.59977907", "0.5948271", "0.59415567", "0.5914705", "0.58922476", "0.58852494", "0.5874494", "0.58423454", "0.5745416", "0.57379985", "0.5724754", "0.5685636", "0.5642927", "0.56422764", "0.56326514" ]
0.7002486
0
Returns information about the current server software.
public static function getSoftwareInfo() { return MHTTPD::$info['software']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function software() \n\t{\n\t\treturn $this->server( 'SERVER_SOFTWARE' );\n\t}", "public function getServerInfo()\n {\n return $this->sendServerCommand(\"serverinfo\");\n }", "public static function detectServerSoftware()\n\t{\n\n\t\tif(preg_match('/^lighttpd/', $_SERVER['SERVER_SOFTWARE']))\n\t\t{\n\t\t\treturn self::LIGHTTPD;\n\t\t}\n\n\t\tif(preg_match('/^Apache/', $_SERVER['SERVER_SOFTWARE']))\n\t\t{\n\t\t\treturn self::APACHE;\n\t\t}\n\n\t\treturn self::OTHER;\n\t}", "private function getSysInfo(){\r\n $array = array('version' => phpversion(),\r\n 'system info' =>array('server name' => $_SERVER['SERVER_NAME'],\r\n 'server software' => $_SERVER['SERVER_SOFTWARE'],\r\n 'browser' => $_SERVER['HTTP_USER_AGENT']\r\n )\r\n \r\n );\r\n return $array;\r\n }", "public function getInfo() {\r\n\t\t$response = $this->Client->execute('show version');\r\n\t\treturn $response;\r\n\t}", "public function getServerInfo() {\n\t\treturn $this->getServerVersion();\n\t}", "function tep_get_system_information() {\n global $_SERVER;\n\n $db_query = tep_db_query(\"select now() as datetime\");\n $db = tep_db_fetch_array($db_query);\n\n list($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5);\n\n return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),\n 'system' => $system,\n 'kernel' => $kernel,\n 'host' => $host,\n 'ip' => gethostbyname($host),\n 'uptime' => @exec('uptime'),\n 'http_server' => $_SERVER['SERVER_SOFTWARE'],\n 'php' => PHP_VERSION,\n 'zend' => (function_exists('zend_version') ? zend_version() : ''),\n 'db_server' => DB_SERVER,\n 'db_ip' => gethostbyname(DB_SERVER),\n 'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''),\n 'db_date' => tep_datetime_short($db['datetime']));\n}", "function olc_get_system_information() {\n\n\t$db_query = olc_db_query(SELECT.\"now() as datetime\");\n\t$db = olc_db_fetch_array($db_query);\n\n\tlist($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5);\n\n\treturn array('date' => olc_datetime_short(date('Y-m-d H:i:s')),\n\t'system' => $system,\n\t'kernel' => $kernel,\n\t'host' => $host,\n\t'ip' => gethostbyname($host),\n\t'uptime' => @exec('uptime'),\n\t'http_server' => $_SERVER['SERVER_SOFTWARE'],\n\t'php' => PHP_VERSION,\n\t'zend' => (function_exists('zend_version') ? zend_version() : EMPTY_STRING),\n\t'db_server' => DB_SERVER,\n\t'db_ip' => gethostbyname(DB_SERVER),\n\t'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : EMPTY_STRING),\n\t'db_date' => olc_datetime_short($db['datetime']));\n}", "public function getInfo()\n {\n return php_uname();\n }", "public function getInfo()\n {\n return $this->getServer()->getInfo();\n }", "public function getSoftwareName()\n {\n return $this->getParam(self::SOFTWARE_PARAM_NAME);\n }", "public function getOperatingSystem() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = '';\n\t\t\t$cmd = 'sw_vers';\n\t\t\t\n\t\t\t// Execute Command/Parse Results\n\t\t\tself::execute($cmd, $output);\n\t\t\t\n\t\t\t$name = explode(':', $output[0]);\n\t\t\t$name = trim($name[1]);\n\t\t\t\n\t\t\t$version = explode(':', $output[1]);\n\t\t\t$version = trim($version[1]);\n\t\t\t\n\t\t\t$result = $name . ' (' . $version . ')';\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function getSoftwareConfig()\n {\n return $this->software_config;\n }", "public function getServerSoftware(): string\n {\n return \"Magma\";\n }", "function serverInfo() {\n\t}", "public static function getServerStatusInfo()\n\t{\n\t\treturn array(\n\t\t\tMHTTPD::getSoftwareInfo(),\n\t\t\tdate('r', MHTTPD::$info['launched']),\n\t\t\tMHTTPD::getStatCount('up', true),\n\t\t\tMHTTPD::getStatCount('down', true),\n\t\t\tMHTTPD::getClientsSummary(),\n\t\t\tMFCGI::getScoreboard(true),\n\t\t\tMHTTPD::getAbortedSummary(),\n\t\t\tMHTTPD::getHandlers(true),\n\t\t\tMHTTPD::getSignature(),\n\t\t);\n\t}", "function getServerInfo() {\n $serverInfo = mysql_get_server_info();\n return $serverInfo;\n }", "public function getSysInfo() : array;", "protected function systemInfo()\n {\n $this->osname = php_uname('s');\n $this->hostname = php_uname('n');\n $this->osrelease = php_uname('r');\n $this->osversion = php_uname('v');\n $this->ostype = php_uname('m');\n }", "public function GetServerInfo()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->server_info; \r\n }", "function ServerInfo() {}", "protected static function getShopwareSystemInfo()\n {\n /** @var Configuration $config */\n $config = ServiceRegister::getService(Configuration::CLASS_NAME);\n\n $result['Shopware version'] = $config->getECommerceVersion();\n $result['theme'] = static::getShopTheme();\n $result['admin url'] = Shopware()->Front()->Router()->assemble(['module' => 'backend']);\n $result['async process url'] = $config->getAsyncProcessUrl('test');\n $result['plugin version'] = $config->getModuleVersion();\n $result['webhook_url'] = $config->getWebHookUrl();\n\n return json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n }", "function tep_get_system_information() {\n $OSCOM_Db = Registry::get('Db');\n\n $Qdate = $OSCOM_Db->query('select now() as datetime');\n\n @list($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5);\n\n $data = array();\n\n $data['oscommerce'] = array('version' => OSCOM::getVersion());\n\n $data['system'] = array('date' => date('Y-m-d H:i:s O T'),\n 'os' => PHP_OS,\n 'kernel' => $kernel,\n 'uptime' => @exec('uptime'),\n 'http_server' => $_SERVER['SERVER_SOFTWARE']);\n\n $data['mysql'] = array('version' => $OSCOM_Db->getAttribute(\\PDO::ATTR_SERVER_VERSION),\n 'date' => $Qdate->value('datetime'));\n\n $data['php'] = array('version' => PHP_VERSION,\n 'zend' => zend_version(),\n 'sapi' => PHP_SAPI,\n 'int_size'\t=> defined('PHP_INT_SIZE') ? PHP_INT_SIZE : '',\n 'safe_mode'\t=> (int) @ini_get('safe_mode'),\n 'open_basedir' => (int) @ini_get('open_basedir'),\n 'memory_limit' => @ini_get('memory_limit'),\n 'error_reporting' => error_reporting(),\n 'display_errors' => (int)@ini_get('display_errors'),\n 'allow_url_fopen' => (int) @ini_get('allow_url_fopen'),\n 'allow_url_include' => (int) @ini_get('allow_url_include'),\n 'file_uploads' => (int) @ini_get('file_uploads'),\n 'upload_max_filesize' => @ini_get('upload_max_filesize'),\n 'post_max_size' => @ini_get('post_max_size'),\n 'disable_functions' => @ini_get('disable_functions'),\n 'disable_classes' => @ini_get('disable_classes'),\n 'enable_dl'\t=> (int) @ini_get('enable_dl'),\n 'filter.default' => @ini_get('filter.default'),\n 'default_charset' => @ini_get('default_charset'),\n 'mbstring.func_overload' => @ini_get('mbstring.func_overload'),\n 'mbstring.internal_encoding' => @ini_get('mbstring.internal_encoding'),\n 'unicode.semantics' => (int) @ini_get('unicode.semantics'),\n 'zend_thread_safty'\t=> (int) function_exists('zend_thread_id'),\n 'opcache.enable' => @ini_get('opcache.enable'),\n 'extensions' => get_loaded_extensions());\n\n return $data;\n }", "public function getServerInfo(){\n return mysql_get_server_info($this->connection);\n }", "function getServerInfo();", "public function license_info() {\n\t\treturn $this->make_request( 'GET', 'license/info' );\n\t}", "public function getVersion(){\n return mysqli_get_server_info( $this->resourceId );\n }", "private function get_server_data() {\n\t\tglobal $wp_version;\n\t\t$data = [\n\t\t\t'server' => [\n\t\t\t\t'name' => esc_html__( 'PHP Version', 'Avada' ),\n\t\t\t\t'value' => phpversion(),\n\t\t\t],\n\t\t\t'php' => [\n\t\t\t\t'name' => esc_html__( 'Server Software', 'Avada' ),\n\t\t\t\t'value' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',\n\t\t\t],\n\t\t\t'wp' => [\n\t\t\t\t'name' => esc_html__( 'WordPress Version', 'Avada' ),\n\t\t\t\t'value' => $wp_version,\n\t\t\t],\n\t\t\t'avada_ver' => [\n\t\t\t\t'name' => esc_html__( 'Avada Version', 'Avada' ),\n\t\t\t\t'value' => ( defined( 'AVADA_VERSION' ) ) ? AVADA_VERSION : '',\n\t\t\t],\n\t\t\t'url' => [\n\t\t\t\t'name' => esc_html__( 'Encrypted Site URL', 'Avada' ),\n\t\t\t\t'value' => md5( site_url() ),\n\t\t\t],\n\t\t\t'token' => [\n\t\t\t\t'name' => esc_html__( 'Token', 'Avada' ),\n\t\t\t\t'value' => class_exists( 'Avada' ) ? Avada()->registration->get_token() : '',\n\t\t\t],\n\t\t];\n\t\treturn $data;\n\t}", "public function shopsystemInfoAction()\n\t{\n $this->checkShopToken();\n \n $shopsystem = 'shopware';\n $shopsystem_human = Shopware()->App().' '.Shopware()->Config()->version;\n $shopsystem_version = Shopware()->Config()->version;\n $api_version = Shopware_Plugins_Frontend_EasymIntegration_Bootstrap::getVersion();\n \n $jsondata = array(\n 'shopsystem' => $shopsystem,\n 'shopsystem_human' => $shopsystem_human,\n 'shopsystem_version' => $shopsystem_version,\n 'api_version' => $api_version \n );\n \n $this->printOutput($jsondata);\n }", "public function getOS()\n {\n return $this->getParam(self::SOFTWARE_OS_PARAM_NAME);\n }" ]
[ "0.82948077", "0.71080875", "0.70880634", "0.6942562", "0.69406426", "0.693396", "0.68584883", "0.6842566", "0.6775766", "0.67655456", "0.6717535", "0.6596546", "0.65899944", "0.6583866", "0.6542156", "0.6489403", "0.64702284", "0.6460313", "0.64597917", "0.64231384", "0.6380949", "0.6301337", "0.62665486", "0.623559", "0.6202075", "0.61730963", "0.6137153", "0.6119298", "0.61091584", "0.6102306" ]
0.8412379
0
Returns information for listing on the Server Status page.
public static function getServerStatusInfo() { return array( MHTTPD::getSoftwareInfo(), date('r', MHTTPD::$info['launched']), MHTTPD::getStatCount('up', true), MHTTPD::getStatCount('down', true), MHTTPD::getClientsSummary(), MFCGI::getScoreboard(true), MHTTPD::getAbortedSummary(), MHTTPD::getHandlers(true), MHTTPD::getSignature(), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function info() {\n return self::instance()->getClient()->get('api/status/info');\n }", "public function index()\n {\n try {\n $processStatuses = ProcessStatus::get();\n return $this->showAll($processStatuses);\n } catch (Exception $ex) {\n return $this->errorResponse(\"Process statuses can not be show.\", Response::HTTP_INTERNAL_SERVER_ERROR);\n }\n }", "public function index()\n {\n\n $statusRepo = new StatusRepository();\n $out = $statusRepo->getStatusAll();\n return $this->respondWithData($out);\n }", "abstract protected function getStatusesInfos();", "public function getServerInfo()\n {\n return $this->sendServerCommand(\"serverinfo\");\n }", "public function listsstatusget()\r\n {\r\n $response = Status::all();\r\n return response()->json($response,200);\r\n }", "public function getServerStatus()\n {\n global $app_strings, $sugar_config;\n $isValid = false;\n $displayText = \"\";\n try {\n $response = $this->_client->request('', \\Elastica\\Request::GET);\n if ($response->isOk()) {\n $isValid = true;\n if (!empty($GLOBALS['app_strings'])) {\n $displayText = $app_strings['LBL_EMAIL_SUCCESS'];\n } else {\n //Fix a notice error during install when we verify the Elastic Search settings\n $displayText = 'Success';\n }\n } else {\n $displayText = $app_strings['ERR_ELASTIC_TEST_FAILED'];\n }\n } catch (Exception $e) {\n $this->reportException(\"Unable to get server status\", $e);\n $displayText = $e->getMessage();\n }\n return array('valid' => $isValid, 'status' => $displayText);\n }", "public function lists()\n {\n return $this->statuses;\n }", "public function status() {\r\n\t\treturn self::request(self::HTTP_GET, 'status');\r\n\t}", "public function status()\n {\n $response = $this->call(Request::METHOD_GET, '/api/v1/status');\n return $response->getApiData();\n }", "public static function statuses()\n {\n return Lastus::statuses(static::class);\n }", "public function index()\n {\n $this->authorize('viewAny', Status::class);\n return Status::all();\n }", "public function index()\n {\n $this->authorize(StatusesPolicy::PERMISSION_LIST);\n\n $statuses = BackupStatuses::all();\n\n $this->setTitle($title = trans('backups::statuses.titles.monitor-statuses-list'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.statuses.index', compact('statuses'));\n }", "public function listAction() \n {\n $model = new Application_Model_Mapper_Server($vars);\n $result = $model->getMlsDetails();\n $data = array();\n $result = json_encode($result);\n $this->view->assign('result', $result);\n $this->_helper->viewRenderer('index');\n }", "public function getStatuses()\n {\n $endpoint = $this->endpoints['getStatuses'];\n return $this->sendRequest($endpoint['method'], $endpoint['uri']);\n }", "public function getStatusesList(){\n return $this->_get(1);\n }", "public function status() {\n\t\treturn self::STATUS_DESCRIPTIONS[$this->oehhstat];\n\t}", "public function getServerInfoCount()\n {\n return $this->count(self::_SERVER_INFO);\n }", "function getDetailedStatus() ;", "public function GetServerStatus()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->stat();\r\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Status::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "function monitor_list_statuses() {\n $query = \"select distinct(`wf_status`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_status'];\n }\n return $ret;\n }", "public function getHealthStatusList() {\n return $this->_get(8);\n }", "function getServerInfo();", "static public function getServerStatus() {\n\t\treturn (int)self::$serverstatus;\n\t}", "public function index()\n {\n // TODO : faire fonctionner avec le auth::id\n return response($this->status->all()->jsonSerialize(), Response::HTTP_OK);\n }", "public function getStatuses() {\n\t}", "public function status()\n {\n return array_map(\n function (array $status) {\n return Status::fromArray($status);\n },\n $this->client->get('status')\n );\n }", "public function show_list()\n {\n $this->output('Workstatus/v_workstatus_ajax');\n }", "public function list() : Response\n {\n return $this->client->get(new Route([static::STATUSES_ROUTE]));\n }" ]
[ "0.69967014", "0.6762573", "0.67358404", "0.67139465", "0.6638641", "0.6636018", "0.6619285", "0.65864766", "0.6580739", "0.6566443", "0.6557896", "0.651211", "0.65062374", "0.64727914", "0.64126945", "0.63449055", "0.6335868", "0.6325586", "0.63220274", "0.631772", "0.6314987", "0.63063616", "0.6305257", "0.6291095", "0.62683326", "0.62580854", "0.6253379", "0.6223395", "0.6220947", "0.62026757" ]
0.74566585
0
Returns the path to the configured access and error logs directory.
public static function getLogPath() { return MHTTPD::$config['Paths']['logs']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function getLogPathFolder(){\n return dirname(__FILE__).self::ERROR_LOGS_DIRECTORY;\n }", "public static function errorlogDirectory()\n\t{\n\t\treturn false;\n\t\treturn '../errorlogs';\n\t}", "public function getLogDir();", "public function getLogPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_LOG);\r\n\t}", "public function getLogDir()\n {\n return $this->rootDir . '/../logs';\n }", "public function getLogDir(): string\n {\n return __DIR__ . '/../../../../../../var/logs';\n }", "public function getLogDir()\n {\n return dirname(__DIR__) . '/var/log';\n }", "public function getLogDir()\n {\n return __DIR__ . '/../var/log';\n }", "public function getLogPath() \n {\n return Light_Config::get('CTM_Config', 'log_dir') . '/' . $this->id;\n }", "public function getLogDir()\n {\n return __DIR__.'/../var/log';\n }", "public function getLogPath()\n {\n return $this->_logPath;\n }", "public function getLogPath() : string\n {\n return $this->logPath;\n }", "public function getLog()\n {\n return join_paths($this->getPath(), 'import.log');\n }", "public function getLogFilePath()\n {\n return $this->getSettingArray()[\"log_file_path\"];\n }", "public function functional_log_path() {\n\n\t\t// write to Docker's stderr\n\t\t$log_path = 'php://stderr';\n\n\t\treturn apply_filters( 'nginx_log_path', $log_path );\n\n\t}", "public function errDir(): string\n {\n return $this->root.'/var/err';\n }", "public function getLogFilePath(): string\n {\n return $this->logger->getLogFilePath();\n }", "public static function location()\r\n {\r\n $logDir = Mage::getBaseDir('var') . DIRECTORY_SEPARATOR . 'log';\r\n $logFile = $logDir . DIRECTORY_SEPARATOR . self::DEFAULT_FILE;\r\n\r\n return $logFile;\r\n }", "public static function getCurrentErrorLog()\n {\n return ROOT . '/data/logs/log-' . date('Y-m-d') . '.log';\n }", "public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$config[\"log\"][\"file\"] : __DIR__.\"/app.log\";\n }", "public function getLogFilePath(){\n\n\t\treturn $this->_log_file_path; \n\t}", "function osdi_log_dir()\n {\n $log_dir = ABSPATH . '/wp-content/osdi';\n return $log_dir;\n }", "private function getLoggerFolder()\n {\n return $this->directoryList->getPath(DirectoryList::VAR_DIR) .\n DIRECTORY_SEPARATOR . 'log';\n }", "public function getDirectoryLog();", "private function getFilePath()\n {\n return \\Application::dirLogs() . '/console.log';\n }", "public function directorio_logs()\n\t{\n\t\tif (! isset($this->dir_logs)) {\n\t\t\t$id_instancia = toba_instancia::get_id();\n\t\t\t$this->dir_logs = toba_nucleo::toba_instalacion_dir().\"/i__$id_instancia/p__{$this->proyecto_actual}/logs\";\n\t\t}\n\t\treturn $this->dir_logs;\n\t}", "public static function getLogPath($sPath=''){\n return self::getWritablePath('log'.DIRECTORY_SEPARATOR.$sPath);\n }", "private static function getLogFile(): string\n {\n return \\sprintf(\n '%s/logs/log_report_%s.txt',\n \\dirname(__DIR__),\n \\date('d-m-Y')\n );\n }", "function get_current_log_dir()\n{\n $date = date('Ymd');\n $dir = di('config')->application->logDir;\n return $dir . $date . '/';\n}", "public static function getPath()\n {\n return rex_path::coreData('system.log');\n }" ]
[ "0.8142427", "0.7879407", "0.76910794", "0.7677407", "0.7656658", "0.7656572", "0.7411818", "0.740294", "0.7401859", "0.7195321", "0.7129751", "0.7070933", "0.70112145", "0.698613", "0.6974255", "0.69395703", "0.6938829", "0.6855665", "0.6851775", "0.6812543", "0.67810524", "0.6752704", "0.67491007", "0.6711039", "0.6684692", "0.66472197", "0.6547779", "0.6525158", "0.64711624", "0.6442914" ]
0.8133025
1
Determines whether the Server Status page should be displayed or not.
public static function allowServerStatus() { return MHTTPD::$config['Admin']['allow_server_status']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function BeforePageDisplay( &$out ){\n\t\tglobal $wgRequest, $wgUser;\n\t\tglobal $wgUseAjax;\n\n\t\tif( $wgUser->isLoggedIn() && $wgUseAjax ){\n\t\t\t$out->addModules( 'ext.onlineStatus' );\n\t\t}\n\n\t\tif( !in_array( $wgRequest->getVal( 'action', 'view' ), array( 'view', 'purge' ) ) )\n\t\t\treturn true;\n\t\t$status = self::GetUserStatus( $out->getTitle(), true );\n\t\tif( $status === null )\n\t\t\treturn true;\n\t\t$out->setSubtitle( wfMsgExt( 'onlinestatus-subtitle-' . $status, array( 'parse' ) ) );\n\n\t\treturn true;\n\t}", "static public function getServerStatus() {\n\t\treturn (int)self::$serverstatus;\n\t}", "public function isServerError() {\n return (5 === $this->getStatusClass());\n }", "function _showStatus() {\r\n $okMessage = implode('<br />', $this->_okMessage);\r\n $errMessage = implode('<br />', $this->_errMessage);\r\n\r\n if (!empty($errMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_ERROR_MESSAGE', $errMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('errormsg');\r\n }\r\n\r\n if (!empty($okMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_OK_MESSAGE', $okMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('okmsg');\r\n }\r\n }", "public static function allowServerInfo()\n\t{\n\t\treturn MHTTPD::$config['Admin']['allow_server_info'];\n\t}", "public function isForServer()\n {\n return $this->server !== null;\n }", "public function getServerStatus()\n {\n global $app_strings, $sugar_config;\n $isValid = false;\n $displayText = \"\";\n try {\n $response = $this->_client->request('', \\Elastica\\Request::GET);\n if ($response->isOk()) {\n $isValid = true;\n if (!empty($GLOBALS['app_strings'])) {\n $displayText = $app_strings['LBL_EMAIL_SUCCESS'];\n } else {\n //Fix a notice error during install when we verify the Elastic Search settings\n $displayText = 'Success';\n }\n } else {\n $displayText = $app_strings['ERR_ELASTIC_TEST_FAILED'];\n }\n } catch (Exception $e) {\n $this->reportException(\"Unable to get server status\", $e);\n $displayText = $e->getMessage();\n }\n return array('valid' => $isValid, 'status' => $displayText);\n }", "public static function isServerSide() {\n\t\treturn (bool) apply_filters( 'cmtt_is_serverside_pagination', get_option( 'cmtt_glossaryServerSidePagination' ) == 1 );\n\t}", "public function getStatus() {\n\t\tif(!$this->server) {\n\t\t\treturn false;\n\t\t}\n\t\tif(!$this->status_new) {\n\t\t\t$this->update();\n\t\t}\n\t\treturn $this->status_new;\n\t}", "public function isStatus()\n {\n return $this->getStatus();\n }", "public function IsInMaintenanceMode(){\n\n\t\t// Obtain maintenance_mode index from config file\n $config_maintenance = $this->instance->config->item(\"maintenance_mode\");\n\n // validate if it's true\n if( $config_maintenance ){\n\n \t// load view and terminate output\n echo $this->instance->load->view('system/maintenance_mode', false, true);\n die();\n }\n }", "public function getSiteStatus()\n {\n return 'OK';\n }", "public function statusAction() {\n $status = $this->_getParam('status');\n $infoId = $this->_getParam('id');\n if (empty($status)) {\n $this->view->title = $this->view->translate(\"Disable Page?\");\n $this->view->discription = $this->view->translate(\"Are you sure that you want to disable this page? After being disabled this will not be shown to users.\");\n $this->view->bouttonLink = $this->view->translate(\"Disable\");\n } else {\n $this->view->title = $this->view->translate(\"Enable Page?\");\n $this->view->discription = $this->view->translate(\"Are you sure that you want to enable this page? After being enabled this will be shown to users.\");\n $this->view->bouttonLink = $this->view->translate(\"Enable\");\n }\n // Check post\n if ($this->getRequest()->isPost()) {\n $pagesettingsTable = Engine_Api::_()->getDbTable('startuppages', 'sitestoreproduct');\n $pagesettingsTable->update(array('status' => $status), array('startuppages_id =?' => $infoId));\n\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('Successfully done.')\n ));\n }\n }", "function checkPanelMode()\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->displayStatusPanel();\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->displayProcessPanel();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function getStatus(){\r\n if($this->scopeConfigInterface->getValue(self::XML_PATH_ENABLED,ScopeInterface::SCOPE_WEBSITE) ==1){\r\n return true;\r\n }\r\n return false;\r\n }", "public function getPageStatus()\n {\n return $this->pageStatus;\n }", "public function hasServerType()\n {\n return $this->server_type !== null;\n }", "public function getStatus() {\r\n if ($this->status === \"error\") {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public static function isServerMode(): bool\n {\n /** @phpstan-ignore-next-line */\n return (defined('SPLASH_SERVER_MODE') && !empty(SPLASH_SERVER_MODE));\n }", "public function GetServerStatus()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->stat();\r\n }", "public function getStatus() \n {\n if ($this->status) \n {\n \techo 'user status : присутствует<br><br><br>';\n }\n else\n {\n \techo 'user status : отсутствует<br><br><br>';\t\n }\n }", "public function statusAction()\n {\n // enforce permissions.\n $this->acl->check('content', 'manage');\n\n // set context\n $this->contextSwitch->initContext('json');\n\n $processId = $this->getRequest()->getParam('processId');\n $statusFile = sys_get_temp_dir() . '/' . static::STATUS_FILE . $processId;\n\n if (!file_exists($statusFile) ) {\n $status = array(\n 'label' => 'no status',\n 'message' => 'No current status file.',\n 'done' => true\n );\n $this->view->status = $status;\n return;\n }\n\n $this->view->status = $this->_readStatusFile($processId);\n }", "public function isInformation() {\n return (1 === $this->getStatusClass());\n }", "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 function show(Server $server)\n {\n $this->authorize('server-control', $server);\n\n return ($server->installed === $server::INSTALLED && $server->enabled && !$server->blocked) ?\n view('servers.view', compact('server'))\n : view('servers.not_active', compact('server'));\n }", "public function get_status() {\n\t\t//Returns true or false. Values are set in their object ($switches, $thermometers, etc)\n\t\treturn $this->_get_status();\n\t}", "public function getSiteStatus();", "public static function getServerStatusInfo()\n\t{\n\t\treturn array(\n\t\t\tMHTTPD::getSoftwareInfo(),\n\t\t\tdate('r', MHTTPD::$info['launched']),\n\t\t\tMHTTPD::getStatCount('up', true),\n\t\t\tMHTTPD::getStatCount('down', true),\n\t\t\tMHTTPD::getClientsSummary(),\n\t\t\tMFCGI::getScoreboard(true),\n\t\t\tMHTTPD::getAbortedSummary(),\n\t\t\tMHTTPD::getHandlers(true),\n\t\t\tMHTTPD::getSignature(),\n\t\t);\n\t}", "public function hasStatus(){\n return $this->_has(10);\n }", "public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }" ]
[ "0.636028", "0.6359578", "0.63501185", "0.62520367", "0.62330663", "0.62324655", "0.6188043", "0.6183963", "0.61637515", "0.605326", "0.6037759", "0.5988386", "0.5972265", "0.59405714", "0.5925474", "0.5896578", "0.58809817", "0.5876161", "0.58642876", "0.58542144", "0.58256996", "0.5824131", "0.5822576", "0.58188975", "0.58155394", "0.5797478", "0.57956225", "0.5785426", "0.5763883", "0.5740963" ]
0.7045054
0
Determines whether the Server Info page should be displayed or not.
public static function allowServerInfo() { return MHTTPD::$config['Admin']['allow_server_info']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isInformationVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_INFORMATION);\n }", "public function canShowInfo() {}", "public function isForServer()\n {\n return $this->server !== null;\n }", "public function isCatalogInformationVisible()\n {\n return (\n $this->isInformationVisible() && Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_INFORMATION)\n ) ? true : false;\n }", "public function showInfo(){\n if(defined('PLUGIN_OPTIONS'))\n return $this->moduleShowInfo();\n return browser\\msg::pageNotFound();\n }", "function serverInfo() {\n\t}", "function showInfoAlways() {\n\t\t// true: will show the story statistics to everyone.\n\t\treturn true;\n\t}", "public function hasInfoWindow() {\n return (!empty($this->_text));\n }", "function ServerInfo() {}", "public function info()\n\t{\n\t\treturn false;\n\t}", "public function hasServerType()\n {\n return $this->server_type !== null;\n }", "public function isInformation() {\n return (1 === $this->getStatusClass());\n }", "public function isInformational(): bool\n {\n return $this->getStatusCode() < 200;\n }", "private function isMyServer(): bool {\n\t\ttry {\n\t\t\treturn Server::singleton($this->application)->id() === $this->memberInteger('server');\n\t\t} catch (Throwable) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function isServerSide() {\n\t\treturn (bool) apply_filters( 'cmtt_is_serverside_pagination', get_option( 'cmtt_glossaryServerSidePagination' ) == 1 );\n\t}", "public function show(Server $server)\n {\n $this->authorize('server-control', $server);\n\n return ($server->installed === $server::INSTALLED && $server->enabled && !$server->blocked) ?\n view('servers.view', compact('server'))\n : view('servers.not_active', compact('server'));\n }", "public function hasServerHibernation()\n {\n return $this->server_hibernation !== null;\n }", "private function shouldInfoTableBeExported()\n {\n return $this->shouldInfoTableBeExported;\n }", "public function DisplayNice()\n {\n return $this->DisplayOnSite ? 'Yes' : 'No';\n }", "public function show(Server $server)\n {\n //\n }", "public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }", "protected function is_view_page() {\n\t\treturn false;\n\t}", "public static function isServerMode(): bool\n {\n /** @phpstan-ignore-next-line */\n return (defined('SPLASH_SERVER_MODE') && !empty(SPLASH_SERVER_MODE));\n }", "public function hasInfo()\n {\n return !empty($this->info) || !empty($this->seat);\n }", "public function isDisplayed()\n {\n return $this->configuration->isMultiShippingEnabled();\n }", "function checkPanelMode()\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->displayStatusPanel();\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->displayProcessPanel();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static function allowServerStatus()\n\t{\n\t\treturn MHTTPD::$config['Admin']['allow_server_status'];\n\t}", "public function hasInfo() {\n return $this->_has(11);\n }", "public function hasInfo() {\n return $this->_has(10);\n }", "public function isOriginVisible()\n {\n return (\n $this->isInformationVisible() && \n Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_ORIGIN)\n ) ? true : false;\n }" ]
[ "0.71416783", "0.6807295", "0.66978884", "0.6455347", "0.6452842", "0.64419526", "0.63281745", "0.62444586", "0.6220971", "0.6198597", "0.6167629", "0.61568666", "0.60403675", "0.5992973", "0.59840673", "0.5955948", "0.59019166", "0.5888251", "0.58680236", "0.58520234", "0.5837599", "0.58350354", "0.57993525", "0.57167226", "0.57095206", "0.56949127", "0.5690503", "0.56899875", "0.5683919", "0.56696683" ]
0.73005015
0
Determines whether the API Documentation page should be displayed or not.
public static function allowAPIDocs() { return MHTTPD::$config['Admin']['allow_api_docs']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isApi()\n {\n return (self::getRequestType() == 'api')?true:false;\n }", "public function documentation() {\n\t\t$this->display(API_VIEWS_BASE.'/backend/documentation/index'); \n }", "protected function is_list_page() {\n\t\treturn false;\n\t}", "public function is_page();", "static public function isApi() {\n return\n isset($_SERVER['REQUEST_URI'])\n && strpos($_SERVER['REQUEST_URI'], \"/passage/\") !== false;\n }", "public function isAPI(){\n $paths = explode(\"/\", $this->path);\n if(isset($paths[0]) && strtolower($paths[0])==\"api\"){\n return true;\n }\n return false;\n }", "public function is_on_page_with_description() {\n return ($this->page->pagelayout == 'pagewithdescription');\n }", "public function documentation()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t$this->display('mbblog/views/admin/docs');\n\t\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}", "public function isGeneratePage() {}", "public function getDetailedDocumentation();", "public function canAccessPage(){\n\n\t\t\t$nav = $this->getNavigationArray();\n\t\t\t$page = '/' . trim(getCurrentPage(), '/') . '/';\n\n\t\t\t$page_limit = 'author';\n\n\t\t\tforeach($nav as $item){\n\t\t\t\tif(General::in_array_multi($page, $item['children'])){\n\n\t\t\t\t\tif(is_array($item['children'])){\n\t\t\t\t\t\tforeach($item['children'] as $c){\n\t\t\t\t\t\t\tif($c['type'] == 'section' && $c['visible'] == 'no' && preg_match('#^' . $c['link'] . '#', $page)) {\n\t\t\t\t\t\t\t\t$page_limit = 'developer';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($c['link'] == $page && isset($c['limit'])) {\n\t\t\t\t\t\t\t\t$page_limit\t= $c['limit'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isset($item['limit']) && $page_limit != 'primary'){\n\t\t\t\t\t\tif($page_limit == 'author' && $item['limit'] == 'developer') $page_limit = 'developer';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telseif(isset($item['link']) && ($page == $item['link']) && isset($item['limit'])){\n\t\t\t\t\t$page_limit\t= $item['limit'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($page_limit == 'author')\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}", "public static function isPage();", "public function isVisible(): bool\n {\n return $this->scopeConfig->getValue('helloworld/general/enable');\n }", "public static function is_builder_page() {\n\t\treturn (bool) get_post_meta(get_the_ID(), '_mkb_enable_home_page', true);\n\t}", "public function isOnepage()\r\n {\r\n if($this->_params['layout'] != 'onepage'){\r\n return false;\r\n }\r\n return true;\r\n }", "public function isApi()\n {\n return $this->controller() instanceof ApiController;\n }", "protected function is_view_page() {\n\t\treturn false;\n\t}", "public function is_paged()\n {\n }", "public function apiDocs(){\n\t\t$data = array(\n \"pagedata\" => array(\n \"apidocs\" => true\n ) ,\n \"vars\" => $this->variables->getAll()\n );\n\t\t$this->view(\"system/capture.html\", $data);\n\t}", "public function getGeneralDocumentation();", "public function isPage()\n {\n if(is_string($this->url)) return false;\n return $this->url->hasTarget();\n }", "public function isSearchPage();", "public function isPaged() {\n\t\treturn Arr::get($this->params, 'paged', true) ? true : false;\n\t}", "public function isInformationVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_INFORMATION);\n }", "public function hasPages();", "public function hasPages();", "public function shouldRender()\n {\n if ($this->totalPages > 1) {\n \n return true;\n }\n \n return false;\n }", "private function isInternal()\n {\n return Request::segment(1) != 'api';\n }", "public function isDocumented()\n\t{\n\t\tif (null === $this->isDocumented) {\n\t\t\t$this->isDocumented = $this->reflection->isTokenized() || $this->reflection->isInternal();\n\n\t\t\tif ($this->isDocumented) {\n\t\t\t\tif (!$this->config->php && $this->reflection->isInternal()) {\n\t\t\t\t\t$this->isDocumented = false;\n\t\t\t\t} elseif (!$this->config->deprecated && $this->reflection->isDeprecated()) {\n\t\t\t\t\t$this->isDocumented = false;\n\t\t\t\t} elseif (!$this->config->internal && ($internal = $this->reflection->getAnnotation('internal')) && empty($internal[0])) {\n\t\t\t\t\t$this->isDocumented = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->isDocumented;\n\t}", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Actadmin::model('Page'));\n }" ]
[ "0.6362983", "0.6280511", "0.6213664", "0.6171089", "0.6167899", "0.6056447", "0.6049501", "0.60412884", "0.59809875", "0.5977476", "0.59451985", "0.5838461", "0.5780866", "0.5777056", "0.57674026", "0.5739612", "0.5728993", "0.57217425", "0.5712196", "0.57112235", "0.5707998", "0.5703815", "0.5684016", "0.5672837", "0.56718093", "0.56718093", "0.5666853", "0.56415266", "0.5617873", "0.56100714" ]
0.70562786
0
Returns the configured user information for the server administrator.
public static function getAdminAuth() { if (empty(MHTTPD::$config['Admin']['admin_user'])) { return false; } return array( 'realm' => 'server admin', 'user' => MHTTPD::$config['Admin']['admin_user'], 'pass' => MHTTPD::$config['Admin']['admin_pass'], ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getUser() {\n return self::$ADMIN_USER;\n }", "public function getAdminUser()\n {\n return $this->registry->registry('current_admin_user');\n }", "public function getAdminUser()\n {\n $user = array(\n 'username' => $this->getConfiguration()->getValue('testing.magento.admin.user'),\n 'password' => $this->getConfiguration()->getValue('testing.magento.admin.password')\n );\n\n if ($user['username'] == null) {\n $user['username'] = $this->defaultLogin['username'];\n }\n if ($user['password'] == null) {\n $user['password'] = $this->defaultLogin['password'];\n }\n return $user;\n }", "public function getAdminUser()\n {\n $user = array(\n 'username' => $this->getConfiguration()->getValue('testing.magento.admin.user'),\n 'password' => $this->getConfiguration()->getValue('testing.magento.admin.password')\n );\n\n if ($user['username'] == null) {\n $user['username'] = $this->defaultLogin['username'];\n }\n if ($user['password'] == null) {\n $user['password'] = $this->defaultLogin['password'];\n }\n return $user;\n }", "private function getUserInfo()\n\t{\n\t\t$user = Sentry::user();\n\t\t$result = array(\n\t\t\t'username' => $user->get('username'),\n\t\t\t'isAdmin' => $user->in_group('admin'),\n\t\t);\n\t\treturn $result;\n\t}", "public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }", "function userAdmin( )\n {\n return $this->UserAdmin ;\n }", "public function getAdministrator() {}", "public function getApiUser()\n {\n return Mage::getStoreConfig('magebridge/settings/api_user');\n }", "private function get_user_info() {\n $user_info = $this->_api_call('https://api.twitter.com/1.1/account/settings.json');\n return $user_info;\n }", "protected function getUser()\n {\n return $this->loadUser(array(\n 'user_name' => $this->context['admin'],\n ));\n }", "public function user()\n {\n return $this->app->auth->guard('admin')->user();\n }", "public function getUserInfo()\n {\n\n if (empty($this->_user))\n return '';\n\n $userInfo = $this->_user;\n\n if (!empty($this->_password))\n $userInfo .= \":{$this->_password}\";\n\n return $userInfo;\n }", "public function getUserInformation()\n {\n return $this->userInformation;\n }", "public function user()\n\t{\n\t\treturn $this->config('email');\n\t}", "function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }", "function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }", "public function getCurrentUserConfig();", "public static function getAdminUser()\n {\n return User::find(1);\n }", "public function getUserAdmin()\n {\n if ($this->user->isOnline()) {\n return '<div class=\"user-block\">\n\t\t\t\t\t<img class=\"img-circle\" src=\"' . $this->user->avatar_square_tiny . '\" alt=\"User Image\">\n\t\t\t\t\t<span class=\"username\"><a href=\"' . $this->user->url .'\" target=\"_blank\">' . $this->user->name . '</a></span>\n\t\t\t\t\t<span class=\"description\"><i class=\"fa fa-circle text-success\"></i> Online</span>\n\t\t\t\t</div>';\n } else {\n return '<div class=\"user-block\">\n\t\t\t\t\t\t<img class=\"img-circle\" src=\"' . $this->user->avatar_square_tiny . '\" alt=\"User Image\">\n\t\t\t\t\t\t<span class=\"username\"><a href=\"' . $this->user->url .'\" target=\"_blank\">' . $this->user->name . '</a></span>\n\t\t\t\t\t\t<span class=\"description\"><i class=\"fa fa-circle text-danger\"></i> Offline</span>\n\t\t\t\t\t</div>';\n }\n }", "private function getUserInfo()\n {\n // TODO This could be cached\n return $this->userInfoApi->getUserInfo();\n }", "public function getLogged()\n {\n $user = \\Auth::user();\n return $this->repo->getAdministrator(\n $user\n );\n }", "function admin_user_id()\n {\n return Admin::app()->auth()->id();\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo() {\n\n if (empty($this->uriParts['user'])) {\n return '';\n }\n $val = $this->uriParts['user'];\n\n if (!empty($this->uriParts['pass'])) {\n $val .= ':' . $this->uriParts['pass'];\n }\n return $val;\n }", "public function getAdminAttribute()\n {\n return User::whereId($this->accountId)->first();\n }", "public function getUserInfo() {\n\t\t$session = Yii::$app->session;\n\t\t$session->open();\n\t\t$session->regenerateID();\n\t\t\n\t\treturn $session['accountInfo'];\n\t}", "function admin_user(): ?Authenticatable\n {\n return Admin::app()->user();\n }" ]
[ "0.71476805", "0.71118903", "0.71110106", "0.71110106", "0.6934066", "0.692421", "0.69149846", "0.69060063", "0.68164015", "0.6707965", "0.65576684", "0.6525031", "0.64981616", "0.6476507", "0.6445292", "0.6391442", "0.6391442", "0.638917", "0.6382252", "0.6382135", "0.6381036", "0.63321996", "0.63224906", "0.62723166", "0.62723166", "0.62723166", "0.6268599", "0.6254762", "0.6250094", "0.6236433" ]
0.7352966
0
Returns a list of loaded request handlers as an array of objects or a formatted string, or a single handler object by configured type.
public static function getHandlers($asString=false, $type=null) { if (!$asString && !$type) { // Return the list of loaded objects return MHTTPD::$handlers; } elseif ($type && !$asString) { // Return a single loaded object if (!isset(MHTTPD::$handlers[$type])) {return false;} return MHTTPD::$handlers[$type]; } // Or format the list as a string $ret = ''; foreach (MHTTPD::$handlers as $type=>$handler) { $ret .= str_pad(ucfirst($type.' '), 20, '.') .sprintf(' I: %-8s M: %-8s S: %-8s E: %-8s', $handler->getCount('init'), $handler->getCount('match'), $handler->getCount('success'), $handler->getCount('error') ).PHP_EOL; } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function defaultHandlerTypes()\n {\n return [\n 'maintenance',\n 'notFound',\n 'notAllowed',\n 'error',\n 'phpError',\n ];\n }", "public function getTypeHandler()\n {\n return $this->handlers[$this->getType()];\n }", "public function getTypeHandlers()\n {\n return array_keys($this->handlers);\n }", "public function getRegisteredRequestHandlerClassNames() {}", "public function getHandlers(): array\n {\n }", "public function getHandlers() : array {\r\n return $this->handlers;\r\n }", "public function getHandlers()\n {\n return $this->handlers;\n }", "public function getHandlers(): array\n\t{\n\t\treturn $this->classes;\n\t}", "public function getHandlerForType($type)\n {\n $bestHandler = $this->defaultHandler;\n foreach ($this->handlers as $handler) {\n if ($handler->getType() == $type && $handler->getPriority() > $bestHandler->getPriority()) {\n $bestHandler = $handler;\n }\n }\n\n return $bestHandler;\n }", "public static function getHandlerClass(): string;", "public function resolveRequestHandler() {\n\t\t$availableRequestHandlerClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface('F3\\FLOW3\\MVC\\RequestHandlerInterface');\n\n\t\t$suitableRequestHandlers = array();\n\t\tforeach ($availableRequestHandlerClassNames as $requestHandlerClassName) {\n\t\t\tif (!$this->objectManager->isObjectRegistered($requestHandlerClassName)) continue;\n\n\t\t\t$requestHandler = $this->objectManager->getObject($requestHandlerClassName);\n\t\t\tif ($requestHandler->canHandleRequest()) {\n\t\t\t\t$priority = $requestHandler->getPriority();\n\t\t\t\tif (isset($suitableRequestHandlers[$priority])) throw new \\F3\\FLOW3\\MVC\\Exception('More than one request handler with the same priority can handle the request, but only one handler may be active at a time!', 1176475350);\n\t\t\t\t$suitableRequestHandlers[$priority] = $requestHandler;\n\t\t\t}\n\t\t}\n\t\tif (count($suitableRequestHandlers) === 0) throw new \\F3\\FLOW3\\MVC\\Exception('No suitable request handler found.', 1205414233);\n\t\tksort($suitableRequestHandlers);\n\t\treturn array_pop($suitableRequestHandlers);\n\t}", "public static function getUrlHandlers($url = null)\n {\n if (!valid($url))\n {\n $url = self::getUrlQ();\n }\n if (!valid($url))\n {\n $url = BaseConfig::HOME_URL;\n }\n $url_parts = explode(\"/\", $url);\n $num_parts = count($url_parts);\n\n $sql = \"SELECT uh.module, uh.permission, md.status FROM url_handler uh LEFT JOIN module md ON (uh.module = md.name) WHERE (num_parts='$num_parts' OR num_parts='0') AND md.status = 1\";\n $c = 0;\n $args = array();\n foreach ($url_parts as $part)\n {\n $sql .= \" AND (p$c = '::p$c' OR p$c = '%')\";\n $args[\"::p$c\"] = $part;\n $c++;\n }\n $sql .= \" ORDER BY num_parts DESC\";\n\n $db = Sweia::getInstance()->getDB();\n\n $rs = $db->query($sql, $args);\n $handlers = array();\n\n /* Store the handlers */\n while ($handler = $db->fetchObject($rs))\n {\n $handlers[$handler->module] = array(\"module\" => $handler->module, \"permission\" => $handler->permission);\n }\n return $handlers;\n }", "protected function getInternalHandlers(): array\n {\n return [\n JsonRenderable::class => function (JsonRenderable $exception) {\n return $exception->renderAsJson();\n },\n ModelNotFoundException::class => [$this, 'modelNotFoundJson'],\n AuthenticationException::class => [$this, 'unauthenticatedJson'],\n AuthorizationException::class => [$this, 'unauthorizedJson'],\n SpatieAuthorizationException::class => [$this, 'spatieUnauthorizedJson'],\n ValidationException::class => [$this, 'validationJson'],\n HttpException::class => [$this, 'httpExceptionJson']\n ];\n }", "public function getHandlerData()\n {\n $uri = $this->request->getUri();\n $method = $this->request->getMethod();\n $searches = array_keys($this->patterns);\n $replaces = array_values($this->patterns);\n\n $this->routes = str_replace('//', '/', $this->routes);\n\n $routes = $this->routes;\n foreach ($routes as $pos => $route) {\n $curRoute = str_replace(['//', '\\\\'], '/', $route);\n if (strpos($curRoute, ':') !== false) {\n $curRoute = str_replace($searches, $replaces, $curRoute);\n }\n if (preg_match('#^' . $curRoute . '$#', $uri, $matched)) {\n\n if (isset($this->callbacks[$pos][$method])) {\n //remove $matched[0] as [1] is the first parameter.\n array_shift($matched);\n\n $this->currentRoute = $curRoute;\n $this->currentVars = $matched;\n\n return $this->getHandlerDetail($this->callbacks[$pos][$method], $matched);\n }\n }\n }\n\n return $this->getHandlerDetail($this->errorCallback, []);\n }", "public function getAllHandlers(): array {\n $base_path = $this->pathToHandlers;\n $directory_listing = scandir($base_path);\n self::$handlers = [];\n foreach ($directory_listing as $basename) {\n $filepath = \"$base_path/$basename\";\n if ($basename !== '.' && $basename !== '..' && is_dir($filepath)) {\n $id = pathinfo($filepath, PATHINFO_FILENAME);\n $filename = Strings::upperCamel($id);\n self::$handlers[] = [\n 'id' => $id,\n 'path' => $filepath,\n 'autoload' => $filepath . \"/$filename.php\",\n 'classname' => '\\\\AKlump\\\\CheckPages\\\\Handlers\\\\' . $filename,\n ];\n }\n }\n\n return self::$handlers;\n }", "protected function getCustomHandlers(): array\n {\n return [];\n }", "public function getPaidContentHandlers()\r\n {\r\n $classes = $this->getContentTypesWithField('paid_content_handler_class');\r\n $handlers = array();\r\n foreach ($classes as $contentType => $class) {\r\n if (!class_exists($class)) {\r\n continue;\r\n }\r\n \r\n $class = XenForo_Application::resolveDynamicClass($class);\r\n $handlers[$contentType] = new $class();\r\n }\r\n \r\n return $handlers;\r\n }", "public function setHandler($typeHandler = 'xml')\n {\n Assertion::keyIsset($this->handlers, $typeHandler);\n $this->currentHandler = app($this->handlers[$typeHandler]);\n return $this->currentHandler;\n }", "protected function _default_handler_for ($handler_type, $options = null)\n {\n switch ($handler_type)\n {\n case Handler_navigator:\n include_once ('webcore/gui/entry_navigator.php');\n return new ENTRY_NAVIGATOR ($this);\n case Handler_commands:\n include_once ('webcore/cmd/entry_commands.php');\n return new ENTRY_COMMANDS ($this);\n case Handler_history_item:\n include_once ('webcore/obj/webcore_history_items.php');\n return new ENTRY_HISTORY_ITEM ($this->app);\n case Handler_rss_renderer:\n include_once ('webcore/gui/rss_renderer.php');\n return new ENTRY_RSS_RENDERER ($this->app, $options);\n case Handler_atom_renderer:\n include_once ('webcore/gui/atom_renderer.php');\n return new ENTRY_ATOM_RENDERER ($this->app, $options);\n case Handler_associated_data:\n include_once ('webcore/gui/entry_renderer.php');\n return new ENTRY_ASSOCIATED_DATA_RENDERER ($this->app, $options);\n case Handler_subscriptions:\n include_once ('webcore/gui/subscription_renderer.php');\n return new ENTRY_SUBSCRIPTION_RENDERER ($this->app, $options);\n default:\n return parent::_default_handler_for ($handler_type, $options);\n }\n }", "static function handler() {\n self::setUristr();\n self::setArray();\n self::setRequests();\n self::check();\n return array(self::$module, self::$model, self::$resource, self::$arg, self::$api);\n }", "public function getHandler() {\n\t\t/** @var \\Cundd\\Rest\\HandlerInterface $handler */\n\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());\n\n\t\t// Check if an extension provides a Handler\n\t\t$handlerClass = 'Tx_' . $extension . '_Rest_Handler';\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\Handler';\n\t\t}\n\n\t\t// Get the specific builtin handler\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\Handler\\\\' . $extension . 'Handler';\n\t\t\t// Get the default handler\n\t\t\tif (!class_exists($handlerClass)) {\n\t\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\HandlerInterface';\n\t\t\t}\n\t\t}\n\t\t$handler = $this->get($handlerClass);\n\t\t//$handler->setRequest($this->dispatcher->getRequest());\n\t\treturn $handler;\n\t}", "public function getTypeLoaders(): array\n {\n return $this->typeLoaders;\n }", "protected function load_objtype_list()\n {\n header('Content-type: application/json');\n\n $l_dao = $_GET['dao'];\n\n if (class_exists($l_dao))\n {\n return isys_factory::get_instance($l_dao, $this->m_database_component)\n ->set_object_type((int) $_GET['object_type'])\n ->get_list_data((int) $_POST['offset_block']);\n } // if\n\n return '';\n }", "public function getHandler();", "public function getHandler();", "protected function getHandlerClassName($type)\n {\n // Translate the file into a FileHandler\n $class = get_class($this);\n $handler = substr_replace($class, $type . 'Handler', strrpos($class, $type));\n\n // Check if the handler exists\n if (!class_exists($handler))\n throw new ExcelException(\"$type handler [$handler] does not exist.\");\n\n return $handler;\n }", "public static function getHandlersQueue($init=true)\n\t{\n\t\tif ($init) {MHTTPD::$handlersQueue->init();}\n\t\treturn MHTTPD::$handlersQueue;\n\t}", "public function resultOf(string $handler): array;", "public function forType(string $type): HandlerInterface\n {\n return $this->forTypes(explode('|', $type));\n }", "protected function getHandlers()\n {\n return (fn () => $this->signalHandlers)\n ->call($this->registry);\n }" ]
[ "0.6279439", "0.61567026", "0.6139796", "0.59524524", "0.5945656", "0.5936977", "0.59269285", "0.58899313", "0.5876111", "0.5817937", "0.5660135", "0.5629119", "0.54595536", "0.5453537", "0.5377144", "0.527308", "0.52565545", "0.52547616", "0.5229512", "0.5192247", "0.51893884", "0.5180392", "0.515632", "0.5148224", "0.5148224", "0.5122648", "0.51013535", "0.50779516", "0.49903974", "0.49846187" ]
0.76155186
0
Returns the currently loaded handlers queue.
public static function getHandlersQueue($init=true) { if ($init) {MHTTPD::$handlersQueue->init();} return MHTTPD::$handlersQueue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHandlers()\n {\n return $this->handlers;\n }", "public function fetchQueue() {\n\t\tif (TRUE === self::$instance instanceof QueueInterface) {\n\t\t\treturn self::$instance;\n\t\t}\n\t\treturn $this->initializeQueue();\n\t}", "public function getQueue();", "public function getQueue();", "public function get_queue()\n\t\t{\n\t\t\treturn $this->queue;\n\t\t}", "public function getQueue()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('queue');\n }", "public function getAppQueue()\n {\n return $this->get(self::_APP_QUEUE);\n }", "public function getAppQueue()\n {\n return $this->get(self::_APP_QUEUE);\n }", "public function getQueue()\n {\n return $this->doRequest('GET', \"queue\", []);\n }", "public function getHandlers() : array {\r\n return $this->handlers;\r\n }", "public function getQueue() {\n return $this->_queue;\n }", "public function getQueue()\n\t{\n\t\treturn $this->queue;\n\t}", "public function getQueue()\n {\n return $this->queue;\n }", "public function getGuildAppQueue()\n {\n return $this->get(self::_GUILD_APP_QUEUE);\n }", "public function getQueue() {\n\t\treturn null;\n\t}", "public function getQueue()\n {\n return array();\n }", "public function getQueue()\n {\n return isset($this->Queue) ? $this->Queue : null;\n }", "public function getHandlerStack()\n {\n\n $handlerStack = HandlerStack::create();\n\n foreach ($this->middleware as $name => $middleware) {\n $handlerStack->push($middleware, $name);\n }\n\n return $handlerStack;\n }", "public function getHandlerStack(): HandlerStack\n {\n if ($this->handlerStack) {\n return $this->handlerStack;\n }\n\n $this->handlerStack = HandlerStack::create($this->getGuzzleHandler());\n\n foreach ($this->middlewares as $name => $middleware) {\n $this->handlerStack->push($middleware, $name);\n }\n\n return $this->handlerStack;\n }", "static function get_queued_scripts() {\n\t\tglobal $wp_scripts;\n\n\t\t$loading_scripts = array();\n\t\tforeach ( $wp_scripts->queue as $key => $handle ) {\n\t\t\t$loading_scripts[ $handle ] = $wp_scripts->registered[ $handle ]->src;\n\t\t}\n\t\treturn $loading_scripts;\n\t}", "protected function getHandlers()\n {\n return (fn () => $this->signalHandlers)\n ->call($this->registry);\n }", "public function getHandler(){\n return($this->handle); \n }", "public static function getLastRegisteredHandler() {\n return self::$lastRegisteredHandler;\n }", "public function getHandler()\n\t{\n\t\treturn $this->handler;\n\t}", "public function getHandler()\n {\n return $this->handler;\n }", "public function getHandler()\n {\n return $this->handler;\n }", "protected function get_handler() {\n\n\t\treturn $this->handler;\n\t}", "public function getHandlerManager()\n {\n return $this->handlerManager;\n }", "function getHandlers()\n {\n eval(PUBSUB_MUTATE);\n return $this->_handlers;\n }", "public function &_getStorage()\n\t{\n\t\t$hash = md5(serialize($this->_options));\n\n\t\tif (isset(self::$_handler[$hash]))\n\t\t{\n\t\t\treturn self::$_handler[$hash];\n\t\t}\n\n\t\tself::$_handler[$hash] = TCacheStorage::getInstance($this->_options['storage'], $this->_options);\n\n\t\treturn self::$_handler[$hash];\n\t}" ]
[ "0.69382656", "0.6792673", "0.67824286", "0.67824286", "0.67304206", "0.66839796", "0.6668459", "0.6668459", "0.66399014", "0.66365814", "0.66221076", "0.66018504", "0.6586128", "0.6577119", "0.6531101", "0.6521215", "0.6496578", "0.6447995", "0.6435249", "0.6395472", "0.6350144", "0.63218176", "0.63180166", "0.629357", "0.6269947", "0.6269947", "0.62615186", "0.6260836", "0.62264997", "0.621627" ]
0.74156415
0
Returns the list of configured access authentication details.
public static function getAuthList() { return !empty(MHTTPD::$config['Auth']) ? MHTTPD::$config['Auth'] : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getAuthenticationConfig() {\n\t\t$config = $this->getServiceLocator()->get('config');\n\t\tif (isset($config['authentication'])) return $config['authentication'];\n\t\telse return [];\n\t}", "public function getAccessList() {\n return $this->_get(16);\n }", "public function getAuthInfoArray() {}", "public static function getAuthData()\n {\n return array(\n 'roles_list' => self::getUserRoles(),\n );\n }", "public static function getAuthenticationParameters(): array\n {\n return FoodDatabase::getApiCredentials();\n }", "public function retrieveAuthCredentials()\n\t{\n\t\t// Since PHP saves the HTTP Password in a bunch of places, we have to be able to test for all of them\n\t\t$username = $password = NULL;\n\t\t\n\t\t// mod_php\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) \n\t\t{\n\t\t $username = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : NULL;\n\t\t $password = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : NULL;\n\t\t}\n\n\t\t// most other servers\n\t\telseif ($_SERVER['HTTP_AUTHENTICATION'])\n\t\t{\n\t\t\tif (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'basic') === 0)\n\t\t\t{\n\t\t\t\tlist($username,$password) = explode(':',base64_decode(substr($_SERVER['HTTP_AUTHENTICATION'], 6)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check them - if they're null a/o empty, they're invalid.\n\t\tif ( is_null($username) OR is_null($password) OR empty($username) OR empty($password))\n\t\t\treturn FALSE;\n\t\telse\n\t\t\treturn array('username' => $username, 'password' => $password);\n\t}", "public function getCredentials()\n {\n if ($this->login) return array( $this->login, $this->password);\n\n //Using static PureBilling as fallback\n if (class_exists('\\PureBilling') && \\PureBilling::getPrivateKey()) {\n return array('api', \\PureBilling::getPrivateKey());\n }\n }", "public static function get_access_lists() { \n\n\t\t$sql = \"SELECT `id` FROM `access_list`\";\n\t\t$db_results = Dba::read($sql);\n\t\n\t\t$results = array(); \n\t\n\t\t// Man this is the wrong way to do it...\n\t\twhile ($row = Dba::fetch_assoc($db_results)) {\n\t\t\t$results[] = $row['id'];\n\t\t} // end while access list mojo\n\n\t\treturn $results;\n\n\t}", "public function getAuthInfo() {\n return [\n 'host' => [\n 'account_num' => 9999999999,\n ],\n ];\n }", "public function getAccessConfig()\n {\n return $this->access_config;\n }", "function getAllAuth(){\n return ['none','clickLicense','registration','duaIndividual','duaInstitution'];\n}", "protected function getCredentials(): array\n {\n return [\n 'auth_corpid' => $this->authCorpid,\n 'permanent_code' => $this->permanentCode,\n ];\n }", "public function allCredentialDescriptors(): array;", "public function getAccessInformation() {\n $fields = array(\n 'accessInformation' => array(\n 'accessUrl',\n 'accessUrlDescriptor',\n 'accessUrlDisplay',\n )\n );\n return TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n }", "public static function getAuthentication():array\n {\n if (Config::SANDBOX === true)\n {\n return [\n \"email\"=>Config::SANDBOX_EMAIL,\n \"token\"=>Config::SANBOX_TOKEN\n ];\n }\n else \n {\n return [\n \"email\"=>Config::PRODUCTION_EMAIL,\n \"token\"=>Config::PRODUCTION_TOKEN\n ];\n }\n }", "protected function credentials() : array\n {\n return array_combine(\n ['cellphone', 'email', 'password'],\n [$this->login, $this->login, $this->password]\n );\n }", "public function getAccessionsList(){\n return $this->_get(2);\n }", "public function getAccessionsList(){\n return $this->_get(2);\n }", "public static function listKeys()\n {\n $return = parent::listKeys();\n $return['enumAuthType']['options'] = array('basicauth' => 'basicauth');\n $return['username']['required'] = 'user';\n $return['password']['required'] = 'user';\n $return['password']['input_type'] = 'password';\n return $return;\n }", "function getAllAccess() {\n return ['download', 'remoteAccess', 'remoteService', 'enclave','notAvailable'];\n}", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}", "public function accessList()\n {\n $this->startBrokerSession();\n $user = null;\n\n $username = $this->getSessionData('sso_user');\n\n if ($username) {\n $accessList = $this->getAccessList($username);\n } else {\n return $this->fail(\"User not found\", 500); // Shouldn't happen\n }\n\n header('Content-type: application/json; charset=UTF-8');\n echo json_encode($accessList);\n }", "public function get_auth_methods()\n {\n return [\n 'hooks' => [\n 'title' => 'Event-Hooks',\n 'type' => 'boolean',\n 'rights' => [\n isys_auth::VIEW,\n isys_auth::EDIT\n ]\n ],\n 'history' => [\n 'title' => _L('LC__MODULE__EVENTS__HISTORY'),\n 'type' => 'boolean',\n 'rights' => [\n isys_auth::VIEW,\n isys_auth::EDIT\n ]\n ]\n /*,\n\t\t\t'config' => array(\n\t\t\t\t'title' => _L('LC__CONFIGURATION'),\n\t\t\t\t'type' => 'boolean',\n\t\t\t\t'rights' => array(isys_auth::VIEW, isys_auth::EDIT)\n\t\t\t)*/\n ];\n }", "private function itemsList()\n {\n /**\n * Defined variables\n */\n $request = $this->getRequest();\n $publicKey = $request->getServer('PHP_AUTH_USER');\n\n $searchCriteriaBuilder = $this->searchCriteria;\n $searchCriteria = $searchCriteriaBuilder->addFilter(\n 'auth_key',\n $publicKey,\n 'eq'\n )->create();\n $authenticationList = $this->customerAuthRepository->getList($searchCriteria);\n $items = $authenticationList->getItems();\n\n return $items;\n }", "private function getCredentials(AuthenticateRequest $request)\n {\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password'),\n ];\n }", "public function getAuthAssignments(){\n return array_keys(Yii::app()->getAuthManager()->getAuthAssignments($this->id));\n }", "function UserAccessList()\n\t{\t$areas = array();\n\t\tforeach ($this->accessAreas as $area=>$digit)\n\t\t{\tif($this->CanUserAccess($area))\n\t\t\t{\t$areas[] = $area;\n\t\t\t}\n\t\t}\n\t\treturn implode(\", \", $areas);\n\t}", "public function getOtherAccessList() {\n return $this->_get(17);\n }", "public function getAuthenticationAvailable();", "public function getAuthConfig() {\n $users = [\n 'publicKey1' => 'key1',\n 'publicKey2' => 'key2',\n ];\n\n return [\n 'no public keys exists' => [[], 'public', null],\n 'public key exists' => [$users, 'publicKey2', 'key2'],\n 'public key does not exist' => [$users, 'publicKey3', null],\n ];\n }" ]
[ "0.6853585", "0.672578", "0.66362697", "0.66301346", "0.64560455", "0.64475787", "0.6401969", "0.6383257", "0.63169754", "0.63145745", "0.6226347", "0.62010014", "0.61057127", "0.6086777", "0.6073327", "0.60561275", "0.6019459", "0.6019459", "0.60118395", "0.60103583", "0.5967561", "0.59627086", "0.59533286", "0.593546", "0.5893096", "0.58927006", "0.58888805", "0.58888024", "0.58735573", "0.5834899" ]
0.72461665
0
Returns the server stat count of the given name.
public static function getStatCount($name, $formatted=false) { if (isset(MHTTPD::$stats[$name])) { return $formatted ? MHTTPD::formatSize(MHTTPD::$stats[$name]) : MHTTPD::$stats[$name]; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function countNameservers(): int {}", "public function getServerInfoCount()\n {\n return $this->count(self::_SERVER_INFO);\n }", "public function findServersCount()\r\n {\r\n \t$query = \"select count(*) as count from `servers`\";\r\n \r\n \t$result = $this->DB->fetchColumn($query);\r\n \r\n \treturn $result;\r\n }", "public function getCachedServersCountAttribute(): int\n {\n return Cache::remember($this->cacheKey().':servers_count', 10, function () {\n return $this->servers()->count();\n });\n }", "public static function addStatCount($name, $count)\n\t{\n\t\tif (isset(MHTTPD::$stats[$name])) {\n\t\t\tMHTTPD::$stats[$name] += $count;\n\t\t}\n\t}", "public function getServerCountAttribute()\n {\n return $this->servers->count();\n }", "function getTotalServerCount() {\n\t\t$count = 0;\n\t\tforeach ($this->masterservers as $masterserver) {\n\t\t\tif (isset($masterserver['num_servers_loaded'])) {\n\t\t\t\t$count += $masterserver['num_servers_loaded'];\n\t\t\t} else if (isset($masterserver['num_servers'])) {\n\t\t\t\t$count += $masterserver['num_servers'];\n\t\t\t}\n\t\t}\n\t\treturn $count;\n\t}", "public function getStat($name)\n\t{\n\t\treturn $this->_stat[$name];\n\t}", "public function count()\n {\n return $this->client->count($this->compile())['count'];\n }", "public static function countOccurences($name)\n {\n $session = self::getSession();\n\n if (! isset($session->counts, $session->counts[$name])) {\n $session->counts[$name] = 1;\n } else {\n $session->counts[$name]++;\n }\n }", "function getCount() {\n $this->putCount();\n //opens countlog.data to read the number of hits\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n return $count;\n }", "public function stat()\n\t{\n\t\treturn csscrush_stat(\n\t\t\t$this->get_params('stat_name')\n\t\t);\n\t}", "public function findByNameCount(string $name): int\n {\n $exists = Kalyannaya::select('id')\n ->where('name', '=', $name)\n ->get()\n ->count();\n\n return $exists;\n }", "public function getCachedStatusesCountAttribute(): int\n {\n return Cache::remember($this->cacheKey().':statuses_count', 10, function () {\n return $this->statuses()->count();\n });\n }", "public function getCount() {\n\t\tif ($this->_count === null) {\n\t\t\tif ($this->name === null) {\n\t\t\t\tthrow new Exception(get_class($this).\" requires a name!\");\n\t\t\t}\n\t\t\t$this->_count = $this->getConnection()->getClient()->hlen($this->name);\n\t\t}\n\t\treturn $this->_count;\n\t}", "public function computeCount() {\n $count = 0;\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n $count = count($data);\n }\n }\n return $count;\n }", "public function count_inventory( $pBuffer = FALSE )\n\t{\n\t\ttry {\n\t\t\t$invsize = $this->steam_command(\n\t\t\t$this,\n\t\t\t\t\t\"get_size\",\n\t\t\tarray(),\n\t\t\t$pBuffer\n\t\t\t);\n\t\t} catch (steam_exception $e) { //this will happen on e.g. /home; function not allowed for this folder\n\t\t\t$invsize = sizeof($this->get_inventory());\n\t\t}\n\t\treturn $invsize;\n\t}", "public function count (): int {\n return count($this->clients);\n }", "public function count()\n {\n return count($this->_loadedPackets);\n }", "function getSize()\n {\n $this->loadStats();\n return $this->stat['size'];\n }", "public function getCallCount()\n {\n return count($this->data['calls']);\n }", "function count_access($base_path, $name) {\r\n $filename = $base_path . DIRECTORY_SEPARATOR . \"stats.json\";\r\n $stats = json_decode(file_get_contents($filename), true);\r\n $stats[$name][mktime(0, 0, 0)] += 1;\r\n file_put_contents($filename, json_encode($stats, JSON_PRETTY_PRINT));\r\n}", "public function count()\n\t{\n\t\t$content = $this->resource->get($this->name)->getContent();\n\t\t\n\t\treturn $content['doc_count'];\n\t}", "public function getPingCount() {\n return $this->ping_count;\n }", "function talker_stats($statname)\n{\n\tglobal $talker_stats_values;\n\tflush();\n\t$errno = 0;\n\t$errstr = \"\";\n\t$fp = fsockopen($GLOBALS['livehost'], $GLOBALS['liveport'], $errno, $errstr, 5);\n\t$buff = \"\";\n\t$statname_value = \"\";\n\n\tif ($GLOBALS['talker_stats'] == -1)\n\t{\n\t\t// the stats haven't been grabbed on this passthrough, grab them now\n\t\tif (!$fp )\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfputs($fp, \"stats_info\\n\");\n\t\t\t\n\t\t\twhile (!feof($fp))\n\t\t\t{\n\t\t\t\t$buff .= fgets($fp, 255);\n\t\t\t}\n\t\t\t\n\t\t\t$values = explode(\"ÿù\", $buff);\n\t\t\t$namevalues = explode(\"\\n\",$values[1]);\n\t\t\t\n\t\t\tfor ($i=0;$i<count($namevalues)-1;$i++)\n\t\t\t{\n\t\t\t\tlist($name,$value) = explode(\": \", $namevalues[$i]);\n\t\t\t\tif (strlen($name) > 1)\n\t\t\t\t{\n\t\t\t\t\t$talker_stats_values[$name] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// set the talker_stats array status to true\n\t\t\t$GLOBALS['talker_stats'] = true;\n\t\t\t// return the originally requested stat\n\t\t\treturn $talker_stats_values[$statname];\n\t\t\tfclose($fp);\n\t\t}\n\t}\n\telse\n\t{\n\t\t// the stats already exist, return the associated value for the name\n\t\treturn $talker_stats_values[$statname];\n\t}\n}", "function PKG_countPackages($clientName)\n{\n\tCHECK_FW(CC_clientname, $clientName);\n\t$sql = \"SELECT COUNT(*) FROM `clientpackages` WHERE clientname='$clientName'\";\n\t$clientpackages = db_query($sql); //FW ok\n\t$counted_clientpackages = mysql_fetch_row( $clientpackages );\n\n\treturn($counted_clientpackages[0]);\n}", "public function count()\n {\n if (array_key_exists('count', $this->information))\n $totalCount = $this->information['count'];\n else\n $totalCount = 0;\n if ($this->limit < $totalCount)\n return $this->limit;\n else\n return $totalCount;\n }", "public static function get(string $stat): int\n {\n return (int)Resque::redis()->get(\"stat:$stat\");\n }", "public function count(): int\n {\n return count($this->pool);\n }", "public function getSize()\n {\n return $this->getStat('size');\n }" ]
[ "0.71840847", "0.69439983", "0.6360713", "0.6333928", "0.6242203", "0.62119746", "0.5971724", "0.59704536", "0.58511055", "0.57915604", "0.5768736", "0.57394224", "0.5716797", "0.5703957", "0.56953984", "0.5689674", "0.5650134", "0.55853677", "0.55847144", "0.556826", "0.5515334", "0.5510801", "0.5507672", "0.54881024", "0.5480001", "0.5459555", "0.5451558", "0.54363793", "0.54294026", "0.54243946" ]
0.72159755
0
Creates a brief summary list of the connected clients.
public static function getClientsSummary() { $summary = ''; foreach (MHTTPD::$clients as $client) { $summary .= $client->getSummary()."\n"; } return $summary; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clientList() {\n return $this->returnCommand(['CLIENT', 'LIST'], null, null, ResponseParser::PARSE_CLIENT_LIST);\n }", "public function client_list()\n {\n return ClientList::latest()->paginate(10);\n }", "public function listClients(){\n $mysql= $this->database->databaseConnect();\n $sql = 'SELECT * FROM client';\n $query = mysqli_query($mysql, $sql) or die(mysqli_connect_error());\n $this->database->databaseClose();\n\n while($row = mysqli_fetch_assoc($query)){\n $this->clients[] = $row;\n }\n\n return $this->clients;\n }", "function displayClientList()\n\t{\n\t\t$_SESSION[\"ClientId\"] = \"\";\n\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.clientlist.html\", \"setup\");\n\t\t$this->tpl->setVariable(\"TXT_INFO\", $this->lng->txt(\"info_text_list\"));\n\t\tilUtil::sendInfo();\n\n\t\t// common\n\t\t$this->tpl->setVariable(\"TXT_HEADER\",$this->lng->txt(\"list_clients\"));\n\t\t$this->tpl->setVariable(\"TXT_LISTSTATUS\",($this->setup->ini->readVariable(\"clients\",\"list\")) ? $this->lng->txt(\"display_clientlist\") : $this->lng->txt(\"hide_clientlist\"));\n\t\t$this->tpl->setVariable(\"TXT_TOGGLELIST\",($this->setup->ini->readVariable(\"clients\",\"list\")) ? $this->lng->txt(\"disable\") : $this->lng->txt(\"enable\"));\n\n\t\tinclude_once(\"./setup/classes/class.ilClientListTableGUI.php\");\n\t\t$tab = new ilClientListTableGUI($this->setup);\n\t\t$this->tpl->setVariable(\"CLIENT_LIST\", $tab->getHTML());\n\n\t\t// create new client button\n\t\t$this->btn_next_on = true;\n\t\t$this->btn_next_lng = $this->lng->txt(\"create_new_client\").\"...\";\n\t\t$this->btn_next_cmd = \"newclient\";\n\t}", "public function index() {\n\n\t\techo json_encode($this->Database->clients_list());\n\t}", "public function listClient()\n\t {\n\t\t$tab = array();\n\t\t\t$rqt = mysql_query(\"SELECT * FROM clients\");\n\t\t\twhile($data = mysql_fetch_assoc($rqt))\n\t\t\t\t$tab[] = $data;\n\t\t\treturn $tab;\n\t }", "function retrieve_client_statistics(){\n\t\t\n\t}", "public function clientList()\n\t{\n\t\treturn $this->client()->latest()\n\t\t\t->where('password_client', true)\n\t\t\t->where('revoked', false)->get()\n\t\t\t->makeVisible('secret');\n\t}", "public function allClients()\n\t{\n\t\t$data['clients'] = $this->MainModel->selectAll('client_details', 'client_name');\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/sidebar');\n\t\t$this->load->view('template/all-clients', $data);\n\t\t$this->load->view('layout/footer');\n\t}", "function Listar_Clientes()\n\t {\n\t\tlog_message('INFO','#TRAZA| CLIENTES | Listar_Clientes() >> ');\n\t\t$data['list'] = $this->Clientes->Listar_Clientes();\n return $data;\n\t }", "function renderClients(){\n\t\t$clients = $this->cache->getClients();\n\t\tforeach($clients as $c){\n\t\t\t$size = $c->getSize();\n\t\t\t$this->ret_clients[] = array('ip'=>$c->getIp(),'mb'=>$size['mb']);\n\t\t}\n\t}", "public function display_all_client()\n {\n \n if ( ! file_exists(APPPATH.'views/pages/list.php'))\n {\n // Whoops, we don't have a page for that!\n show_404();\n }\n if (!isset($this->session->userdata['user_role']) || $this->session->userdata['user_role'] < 30)\n {\n $this->session->set_flashdata('message', 'Vous devez avoir les droits de superviseur');\n redirect($_SERVER['HTTP_REFERER']); \n } \n \n $data['title'] = 'Liste des Clients'; \n $data['membres'] = $this->member_model->get_by_type('name = \"Client\"'); \n \n // breadcrumb\n $data['breadcrumbs'] = $this->breadcrumbs('liste');\n \n $this->load->template('pages/list_members',$data);\n }", "public function index()\n {\n $client = Client::all();\n return view('clients.listCl', compact('client'));\n }", "public function index()\n {\n $client = new Clients;\n return $client->allClients();\n }", "function clientsListAction()\n\t{\n\t\t$searchParameters=$this->_request->getParams();\n\t\t\n\t\t$client_obj = new Ep_Quote_Client();\n\t\t$clients=$client_obj->getClients($searchParameters);\n\t\tif($clients!='NO')\n\t\t\t$this->_view->clients =$clients;\n\t\t\n\t\t$this->_view->client_creators=$client_obj->getClientCreatorUsers();\t\n\t\t\n\t\t$this->render('clients-list');\n\t}", "public function index()\n {\n $clients = Client::orderBy('id', 'desc')->paginate(15);\n return view('application.client.list', compact('clients'));\n }", "function statistics_client_info() {\n $n_users = db_query(\"SELECT count(uid) FROM {users}\")->fetchField();\n $software = $_SERVER['SERVER_SOFTWARE'];\n $phpversion = phpversion();\n $class = 'DatabaseTasks_' . Database::getConnection()->driver();\n $tasks = new $class();\n $dbname = '';\n $dbversion = '';\n $dbname = $tasks->name();\n $dbversion = Database::getConnection()->version();\n return array(\n 'client_version' => '0.01',\n 'time' => date('l jS \\of F Y h:i:s A'),\n 'drupal_version' => VERSION,\n 'web_server' => $software,\n 'php' => $phpversion,\n 'db' => $dbname . $dbversion,\n 'n_users' => $n_users,\n 'modules' => module_list(),\n );\n}", "public function index()\n {\n $clients = Client::orderBy('id', 'desc')->paginate(10);\n return view('clients.list',compact('clients'));\n }", "public function clientList()\n {\n return $this->getParent()->channelGroupClientList($this->getId());\n }", "public function index()\n {\n $title = $this->title;\n $clients = $this->client->where('user_id', Auth::user()->id)->paginate(10);\n return view('admin.clients.index', compact('title','clients'));\n }", "function getClientList()\n\t{\n\t\t//Update Client List\n\t\t$this->Client_List = null;\n\t\t$assigned_clients_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Client');\n\t\tforeach($assigned_clients_rows as $assigned_client)\n\t\t\t$this->Client_List[] = new Client( $assigned_client['ClientProjectTask'] );\n\t\t\n\t\treturn $this->Client_List;\n\t}", "public function index()\n {\n $clients = Client::all();\n\n return $this->showAll($clients);\n }", "public function index()\n {\n $clients = auth()->user()->clients()->paginate(100);\n return view('main.client.index', compact('clients'));\n }", "public function index()\n {\n $clients = Client::orderBy('name', 'ASC')\n ->paginate(env('PAGINATION', 20));\n\n return view('client.index')->with(compact('clients'));\n }", "public function index()\n {\n // Get clients\n // Use Laravel’s pagination for showing Clients/Transactions list, 10 entries per page\n $clients = Client::paginate(10);\n return ClientResource::collection($clients);\n }", "function index() {\n\t\t$this->paginate = array(\n\t\t\t'conditions'=>array('user_id'=>$this->Auth->user('id')),\n\t\t\t'limit'=>'10',\n\t\t\t'order'=>'modified DESC'\n\t\t);\n\t\t$clients = $this->paginate();\n\t\t$this->set(compact('clients'));\n\t}", "public function index()\n {\n return View('internal.client.index')\n //->with('clients', Client::limit(5))\n ;\n }", "public function index()\n {\n return view('statuses.clients.index');\n }", "public function index()\n {\n $data = [\n 'title' => $this->title,\n 'clients' => auth()->user()->getClients()\n ];\n\n return view('clients.index', $data);\n }", "public function index()\n\t{\n $clients = $this->client\n ->orderBy('title', 'asc')\n ->get();\n\n \t\treturn view('clients.index.index')->with('clients', $clients);\n\t}" ]
[ "0.6483087", "0.63488656", "0.62941134", "0.62731576", "0.6247569", "0.6229187", "0.62164766", "0.61918414", "0.6045793", "0.5990428", "0.5954051", "0.5940975", "0.59273565", "0.59249496", "0.5913745", "0.5910921", "0.5909654", "0.5908593", "0.5892994", "0.587324", "0.5868813", "0.5855052", "0.5826546", "0.5799421", "0.57938653", "0.57837355", "0.57651824", "0.5726249", "0.57066345", "0.5700082" ]
0.7423469
0
Creates a brief summary list of any aborted requests.
public static function getAbortedSummary() { $summary = ''; foreach (MHTTPD::$aborted as $num=>$ab) { $summary .= "({$num}) C: {$ab['client']}, F: {$ab['fcgi_client']}, " . "P: {$ab['process']} ({$ab['pid']}), T: {$ab['time']}\n"; } $summary = $summary != '' ? $summary : 'None'; return $summary; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function invalidRequests()\n {\n return [\n [\n HttpRequestMethod::GET,\n 'https://postman-echo.com/status/404',\n '',\n [],\n HttpClientErrorException::class\n ],\n [\n HttpRequestMethod::GET,\n 'https://postman-echo.com/status/500',\n '',\n [],\n HttpServerErrorException::class\n ],\n ];\n }", "private function handleDiagnosticsRequest()\n {\n $statusApiConfigurator = new Webinterpret_Connector_StatusApi_StatusApiConfigurator(Mage::app(), Mage::getConfig());\n\n $statusApi = $statusApiConfigurator->getExtendedStatusApi();\n\n $json = $statusApi->getJsonTestResults();\n header('Content-Type: application/json');\n header('Content-Length: '.strlen($json));\n echo $json;\n }", "public function viewFailedTransactions()\n {\n return $this->getFailedTransactions(self::GATEWAY);\n }", "function printNewRequests() {\r\n $criteria = array('status' => Appeal::$STATUS_NEW);\r\n return printAppealList($criteria);\r\n}", "public function table(Request $request)\n\t{\n\t\t$failedJobs = FailedJob::latest('failed_at');\n\n\t\treturn paginateResult(\n\t\t\t$failedJobs,\n\t\t\t$request->get('itemPerPage'),\n\t\t\t$request->get('page')\n\t\t);\n\t}", "public function scopeIncompleteResponses() {\n\t\t$commaSeparatedStatuses = '\\'' . implode('\\', \\'', self::getIncompleteStatuses()) . '\\'';\n\n\t\t$this->getDbCriteria()->mergeWith(array(\n\t\t\t'condition' => 'status IN (' . $commaSeparatedStatuses . ')',\n\t\t));\n\t\treturn $this;\n\t}", "protected function killExceededTasks()\n\t{\n\t\t$exceededTasks = $this->taskRepository->findExceededTasks();\n\t\tforeach ($exceededTasks as $task) {\n\t\t\t$task->lastSuccess = false;\n\t\t\t$this->setTaskIdleAndSave($task);\n\t\t\t// task history ..\n\t\t\t$taskHistory = new TaskHistory();\n\t\t\t$taskHistory->taskId = $task->id;\n\t\t\t$taskHistory->started = new DateTime();\n\t\t\t$taskHistory->finished = new DateTime();\n\t\t\t$taskHistory->output = new Output;\n\t\t\t$taskHistory->output->error(\"Exceeded time to run\");\n\t\t\t$taskHistory->resultCode = -1;\n\t\t\t$this->taskHistoryRepository->save($taskHistory);\n\t\t}\n\t}", "public function removeHistoryStatusFilter()\n {\n $status = $this->helper()->getConfigData('sro_status_delayed');\n $trackList = $this->getRequestCollection();\n \n foreach ($trackList as $key => $track) {\n foreach ($track->getShipment()->getOrder()->getAllStatusHistory() as $history) {\n if ($status == $history->getData('status')) {\n Mage::log(\"{$track->getNumber()}: history found ({$status}) / ignored status\");\n $trackList->removeItemByKey($key);\n break;\n }\n }\n }\n \n $this->setLog(\"{$trackList->count()} never-delayed of {$this->getLog()}\");\n return $this->setRequestCollection($trackList);\n }", "public function index()\n\t{\n\t\t$view_path = $this->view_path('view');\n\n\t\t$current_status = $this->get_current_status();\n\n\t\t# HOSTS DOWN / problems\n\t\t$problem = array();\n\t\t$i = 0;\n\n\t\tif ($current_status->hosts_down_acknowledged) {\n\t\t\t$problem[$i]['type'] = _('Host');\n\t\t\t$problem[$i]['status'] = _('Down');\n\t\t\t$problem[$i]['url'] = 'status/host/all/'.nagstat::HOST_DOWN.'/?hostprops='.nagstat::HOST_STATE_ACKNOWLEDGED;\n\t\t\t$problem[$i]['title'] = $current_status->hosts_down_acknowledged.' '._('Acknowledged hosts');\n\t\t\t$i++;\n\t\t}\n\n\t\tif ($current_status->hosts_unreachable_acknowledged) {\n\t\t\t$problem[$i]['type'] = _('Host');\n\t\t\t$problem[$i]['status'] = _('Unreachable');\n\t\t\t$problem[$i]['url'] = 'status/host/all/'.nagstat::HOST_UNREACHABLE.'/?hostprops='.nagstat::HOST_STATE_ACKNOWLEDGED;\n\t\t\t$problem[$i]['title'] = $current_status->hosts_unreachable_acknowledged.' '._('Acknowledged hosts');\n\t\t\t$i++;\n\t\t}\n\n\t\tif ($current_status->services_critical_acknowledged) {\n\t\t\t$problem[$i]['type'] = _('Service');\n\t\t\t$problem[$i]['status'] = _('Critical');\n\t\t\t$problem[$i]['url'] = 'status/service/all/'.(nagstat::HOST_UP|nagstat::HOST_DOWN|nagstat::HOST_UNREACHABLE|nagstat::HOST_PENDING).\n\t\t\t\t'/'.nagstat::SERVICE_CRITICAL.'/'.nagstat::SERVICE_STATE_ACKNOWLEDGED;\n\t\t\t$problem[$i]['title'] = $current_status->services_critical_acknowledged.' '._('Acknowledged services');\n\t\t\t$i++;\n\t\t}\n\n\t\tif ($current_status->services_warning_acknowledged) {\n\t\t\t$problem[$i]['type'] = _('Service');\n\t\t\t$problem[$i]['status'] = _('Warning');\n\t\t\t$problem[$i]['url'] = 'status/service/all/'.(nagstat::HOST_UP|nagstat::HOST_DOWN|nagstat::HOST_UNREACHABLE|nagstat::HOST_PENDING).\n\t\t\t\t'/'.nagstat::SERVICE_WARNING.'/'.nagstat::SERVICE_STATE_ACKNOWLEDGED;\n\t\t\t$problem[$i]['title'] = $current_status->services_warning_acknowledged.' '._('Acknowledged services');\n\t\t\t$i++;\n\t\t}\n\n\t\tif ($current_status->services_unknown_acknowledged) {\n\t\t\t$problem[$i]['type'] = _('Service');\n\t\t\t$problem[$i]['status'] = _('Unknown');\n\t\t\t$problem[$i]['url'] = 'status/service/all/'.(nagstat::HOST_UP|nagstat::HOST_DOWN|nagstat::HOST_UNREACHABLE|nagstat::HOST_PENDING).\n\t\t\t\t'/'.nagstat::SERVICE_UNKNOWN.'/'.nagstat::SERVICE_STATE_ACKNOWLEDGED;\n\t\t\t$problem[$i]['title'] = $current_status->services_unknown_acknowledged.' '._('Acknowledged services');\n\t\t\t$i++;\n\t\t}\n\n\t\trequire($view_path);\n\t}", "public function summaryAction()\n {\n $reporter = $this->getDI()->get('reporter');\n\n $this->getOutput()->last_15_min_mo_count = $reporter->getLastMoCount(new DateTime('15 minutes ago'));\n $this->getOutput()->time_span_last_10k = $reporter->getTimeSpan(10000);\n return $this->initResponse();\n }", "public function incomplete()\n {\n $this->update(['completion_date' => null]);\n LogController::set(get_class($this).'@'.__FUNCTION__);\n // $this->recordActivity('incompleted_task');\n }", "public function deleteExpiredRequests()\n {\n $helper = Mage::helper('mp_debug');\n if (!$helper->isEnabled()) {\n return 'skipped: module is disabled.';\n }\n\n if ($helper->getPersistLifetime() == 0) {\n return 'skipped: lifetime is set to 0';\n }\n\n $expirationDate = $this->getExpirationDate(date(self::DATE_FORMAT));\n $table = $this->getRequestsTable();\n $deleteSql = \"DELETE FROM {$table} WHERE date <= '{$expirationDate}'\";\n\n /** @var Magento_Db_Adapter_Pdo_Mysql $connection */\n $connection = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n /** @var Varien_Db_Statement_Pdo_Mysql $result */\n $result = $connection->query($deleteSql);\n return \"{$result->rowCount()} requests deleted\";\n }", "private function build_FNCsummary(){\n $reply = array();\n\n ob_start();\n ksort($this->collected_highlights);\n $title = x('strong','Not all the formalities are completed:');\n foreach($this->collected_highlights as $reason=>$info){\n if (!empty($title)) {\n\tprint $title; $title = '';\n\t$t = new b_table(\"class='width100'\");\n }\n $h = array_keys($info);\n $n = array_values($info);\n $a = '&nbsp;';\n if (in_array($h[0],array('highlightRose','highlightYellow')) && \n\t $this->doing =='lists' && \n\t VM::hasRightTo('endorse_event')){\n\t$a = 'Please '.(is_object(VM::$e) && VM::$e->isEventEndorsed()?'UNLOCK the budget and':'').\n\t ($h[0] == 'highlightRose' ? 'resolve the issue' : 'approve or reject the applicants');\n }\t\n $t->tro();\n $t->td($n[0],\"class='$h[0] align_right'\");\n $t->td(($message=$reason.(($n[0]>1 && strpos($reason,')')===False)?'s':'')).\"<br/>$a\",\"class='$h[0]'\");\n if (!isset($FNC_message)) $FNC_message = \"$n[0] $message\";\n $t->trc();\n }\n if (empty($title)) $t->close();\n $summary = ob_get_contents();\n ob_end_clean();\n if (isset($FNC_message)) $reply[$FNC_message] = $summary;\n\n // accommodation\n foreach($this->no_accommodation as $action_message=>$list){\n $list = array_unique($list);\n sort($list);\n $title = ($n=count($list)) . ' approved visitor'.($n>1?'s':'').' without accommodation.';\n if (VM::hasRightTo('book_ah') && VM::$e->getValue('e_end') > time()) $title .= \" The budget can't be approved unless this problem is solved.\";\n if ($n > 1){\n\t$summary = \"$action_message:\" . x('ul',b_fmt::joinMap('li',$list));\n }else{\n\t$summary = \"$action_message $list[0]\";\n }\n $reply[$title] = $summary;\n }\n return $reply;\n }", "protected function _reportSkipped($summary)\n {\n foreach ([\n 'pending' => 'cyan',\n 'excluded' => 'yellow',\n 'skipped' => 'light-grey'\n ] as $type => $color) {\n if (!$logs = $summary->logs($type)) {\n continue;\n }\n $count = count($logs);\n if ($this->_colors) {\n $this->prefix($this->format(' ', \"n;;{$color}\") . ' ');\n }\n $this->write(ucfirst($type) . \" specification\" . ($count > 1 ? 's' : '') . \": {$count}\\n\");\n\n foreach ($logs as $log) {\n $this->write(\"{$log->file()}, line {$log->line()}\\n\", 'dark-grey');\n }\n $this->prefix('');\n $this->write(\"\\n\");\n }\n }", "public function get_errors()\n\t{\n\t\t$profile_start = microtime(true);\n\t\t$this->display->errors();\n\t\t$profile_start = profiler($profile_start,__CLASS__,__FUNCTION__,'openapi');\n\t}", "public function getRequestsWithErrorsCount()\n {\n return $this->requests_with_errors_count;\n }", "public function getRequestsWithErrorsCount()\n {\n return $this->requests_with_errors_count;\n }", "public function getStatusDescriptions()\n {\n $statuses = $this->getSortedStatuses();\n // concatenate the descriptions\n $reasons = [];\n foreach($statuses as $s) {\n $reason = $s->getReason();\n if ($reason) {\n $reasons[] = $reason;\n }\n }\n if (!empty($reasons)) {\n return $reasons;\n }\n return null;\n }", "protected function get_request_counts()\n {\n }", "public function testRetrieveListUnsuccessfulReason()\n {\n }", "public function internalErrorAction(Request $request)\n {\n $required = ['description', 'judgehostlog', 'disabled'];\n foreach ($required as $argument) {\n if (!$request->request->has($argument)) {\n throw new BadRequestHttpException(sprintf(\"Argument '%s' is mandatory\", $argument));\n }\n }\n $description = $request->request->get('description');\n $judgehostlog = $request->request->get('judgehostlog');\n $disabled = $request->request->get('disabled');\n\n // Both cid and judgingid are allowed to be NULL.\n $cid = $request->request->get('cid');\n $judgingId = $request->request->get('judgingid');\n\n // Group together duplicate internal errors\n // Note that it may be good to be able to ignore fields here, e.g. judgingid with compile errors\n $queryBuilder = $this->em->createQueryBuilder()\n ->from(InternalError::class, 'e')\n ->select('e')\n ->andWhere('e.description = :description')\n ->andWhere('e.disabled = :disabled')\n ->andWhere('e.status = :status')\n ->setParameter(':description', $description)\n ->setParameter(':disabled', $disabled)\n ->setParameter(':status', 'open')\n ->setMaxResults(1);\n\n /** @var Contest|null $contest */\n $contest = null;\n if ($cid) {\n $contestIdField = $this->eventLogService->externalIdFieldForEntity(Contest::class) ?? 'cid';\n $contest = $this->em->createQueryBuilder()\n ->from(Contest::class, 'c')\n ->select('c')\n ->andWhere(sprintf('c.%s = :cid', $contestIdField))\n ->setParameter(':cid', $cid)\n ->getQuery()\n ->getSingleResult();\n }\n\n /** @var InternalError $error */\n $error = $queryBuilder->getQuery()->getOneOrNullResult();\n\n if ($error) {\n // FIXME: in some cases it makes sense to extend the known information, e.g. the judgehostlog\n return $error->getErrorid();\n }\n\n $error = new InternalError();\n $error\n ->setJudging($judgingId ? $this->em->getReference(Judging::class, $judgingId) : null)\n ->setContest($contest)\n ->setDescription($description)\n ->setJudgehostlog($judgehostlog)\n ->setTime(Utils::now())\n ->setDisabled(json_decode($disabled, true));\n\n $this->em->persist($error);\n $this->em->flush();\n\n $disabled = $this->dj->jsonDecode($disabled);\n\n $this->dj->setInternalError($disabled, $contest, false);\n\n if (in_array($disabled['kind'], ['problem', 'language', 'judgehost']) && $judgingId) {\n // give back judging if we have to\n $this->giveBackJudging((int)$judgingId);\n }\n\n return $error->getErrorid();\n }", "public function actionIndex()\n {\n $reportBuilder = new SummaryReport;\n\n $reportBuilder->on(SummaryReport::EVENT_BEFORE_BUILD, [\\RS\\Visitor\\Event\\ReportEvent::class, 'deleteVisitsOverhead']);\n\n $report = $reportBuilder->build();\n\n return $report;\n }", "public function diagnostics()\n {\n $diagnostics = array();\n $utilityObj = new Utility;\n $domains = array('', 'Action', 'Credential', 'Group', 'User', 'Tag', 'Webhook');\n $queue = $this->getBatchRequest();\n foreach($domains as $domain)\n $this->db->batch($queue)->domain_metadata(\"{$this->domainPhoto}{$domain}\");\n $responses = $this->db->batch($queue)->send();\n if($responses->areOK())\n {\n $diagnostics[] = $utilityObj->diagnosticLine(true, 'All SimpleDb domains are accessible.');\n }\n else\n {\n foreach($responses as $key => $res)\n {\n if((int)$res->status !== 200)\n $diagnostics[] = $utilityObj->diagnosticLine(false, sprintf('The SimpleDb domains \"%s\" is NOT accessible.', $domains[$key]));\n }\n }\n return $diagnostics;\n }", "public function viewallmaintenancerequestsAction(){\n\t\t$maint = new Maintenance_Model_MaintenanceRequest();\n\t\t$records = $maint->fetchAllRequests();\n\n\t\tif( $records ){\n\t\t $this->view->paginator = $this->paginate($records);\n\t\t}\n\t}", "private function getStatusInfo(array $aggregations): array\n {\n $datasetCount = function ($status) use ($aggregations) {\n if (array_key_exists($status, $aggregations)) {\n return $aggregations[$status];\n } else {\n return 0;\n }\n };\n\n $statusInfo = [\n [\n 'id' => 1,\n 'name' => 'Identified',\n 'count' => $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_NOT_AVAILABLE),\n ],\n [\n 'id' => 2,\n 'name' => 'Submitted',\n 'count' => (\n $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PENDING_METADATA_SUBMISSION)\n + $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PENDING_METADATA_APPROVAL)\n ),\n ],\n [\n 'id' => 3,\n 'name' => 'Restricted',\n 'count' => (\n $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_RESTRICTED_REMOTELY_HOSTED)\n + $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_RESTRICTED)\n ),\n ],\n [\n 'id' => 4,\n 'name' => 'Available',\n 'count' => (\n $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PUBLICLY_AVAILABLE_REMOTELY_HOSTED)\n + $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PUBLICLY_AVAILABLE)\n ),\n ],\n ];\n\n // Remove any element with a count of 0.\n foreach ($statusInfo as $key => $value) {\n if (0 === $value['count']) {\n unset($statusInfo[$key]);\n }\n }\n\n // Sorting based on highest count\n $array_column = array_column($statusInfo, 'count');\n array_multisort($array_column, SORT_DESC, $statusInfo);\n\n return $statusInfo;\n }", "public function clearFailed()\n {\n $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_FETCH_FAILED);\n $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_PARSE_ERROR);\n $this->getLogger()->debug('Cleared \"failed\" and \"not-parsed\" filters');\n }", "function resubmitFailures() {\n\tglobal $gStatusTable, $gErrBase;\n\t$cmd = \"update $gStatusTable set status=0, wptid='', wptRetCode='', medianRun=0 where status >= $gErrBase;\";\n\tdoSimpleCommand($cmd);\n}", "public function getHistories(Request $request)\n {\n //takes trip ended, user cancelled, driver cancelled ride requests\n $rideRequests = $this->rideRequest->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::COMPLETED, Ride::TRIP_ENDED, Ride::USER_CANCELED, Ride::DRIVER_CANCELED])\n ->with(['user', 'invoice'])\n ->orderBy('updated_at', 'desc')\n ->paginate(500);\n\n $rideRequests->map(function($rideRequest){\n \n if($rideRequest->invoice) {\n $rideRequest->invoice['map_url'] = $rideRequest->invoice->getStaticMapUrl();\n }\n \n });\n\n return $this->api->json(true, 'RIDE_REQUEST_HISTORIES', 'Ride request histories', [\n 'ride_requests'=> $rideRequests->items(),\n 'paging' => [\n 'total' => $rideRequests->total(),\n 'has_more' => $rideRequests->hasMorePages(),\n 'next_page_url' => $rideRequests->nextPageUrl()?:'',\n 'count' => $rideRequests->count(),\n ]\n ]);\n\n\n }", "private function getFailedList()\n\t{\n\t\treturn $this->failed_list;\n\t}", "public function declineAllPendingThreads()\n {\n return $this->ig->request('direct_v2/threads/decline_all/')\n ->addPost('_csrftoken', $this->ig->client->getToken())\n ->addPost('_uuid', $this->ig->uuid)\n ->setSignedPost(false)\n ->getResponse(new Response\\GenericResponse());\n }" ]
[ "0.5053492", "0.49973387", "0.4973631", "0.47482452", "0.47321114", "0.47072265", "0.4687579", "0.4658795", "0.46562237", "0.46489137", "0.46448314", "0.46394044", "0.46201023", "0.46197483", "0.46164912", "0.45974174", "0.45974174", "0.45554206", "0.454678", "0.45338333", "0.45295396", "0.452725", "0.45220116", "0.45214328", "0.45054314", "0.4500907", "0.4498524", "0.4498354", "0.44813207", "0.44810656" ]
0.692993
0
Returns the list of configured mime types.
public static function getMimeTypes() { return MHTTPD::$config['Mimes']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMimetypes()\n\t{\n\t\treturn $this->mimeTypes;\n\t}", "public function getMimeTypes() {\n return $this->mimeTypes;\n }", "public static function getAllMimeTypes():array;", "public function getAvailableMimeTypes()\n {\n return $this->availableMimeTypes;\n }", "static public function getAllowedMimeTypes()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('content_type')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->content_type;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function mimetypes()\n {\n return json_decode(file_get_contents(__DIR__.'/../../resources/data/mimetypes.json'), true);\n }", "public static function getCustomMimeTypeList()\n {\n # Returns the system MIME type mapping of extensions to MIME types.\n $out = array();\n $file = fopen( Configuration::mimeTypeList, 'r' );\n while ( ( $line = fgets( $file ) ) !== false ) {\n $line = trim( preg_replace( '/#.*/', '', $line ) );\n if ( ! $line )\n continue;\n $parts = preg_split( '/\\s+/', $line );\n if ( count( $parts ) == 1 )\n continue;\n $type = array_shift( $parts );\n foreach( $parts as $part )\n $out[$part] = $type;\n }\n fclose( $file );\n return $out;\n }", "public function getSupportedMimes()\n {\n if ($this->mimes) {\n return $this->mimes;\n }\n\n $response = $this->get(\n 'mime-types',\n $this->getGuzzleOptions([\n 'headers' => [\n 'Accept' => 'application/json',\n ],\n ])\n );\n\n return $this->mimes = json_decode($response->getBody(), true);\n }", "public function provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}", "public function getMimetypeMapping()\n {\n if (isset($this->raw->mimetypes)) {\n return (array) $this->raw->mimetypes;\n }\n\n return array();\n }", "public static function &getMimes()\n {\n static $_mimes;\n\n if (empty($_mimes)) {\n $_mimes = file_exists(__DIR__ . '/../Config/Mimes.php')\n ? include __DIR__ . '/../Config/Mimes.php'\n : array();\n\n if (file_exists(__DIR__ . '/../Config/Mimes.php')) {\n $_mimes = array_merge($_mimes, include __DIR__ . '/../Config/Mimes.php');\n }\n }\n\n return $_mimes;\n }", "public function getSupportedMimeTypes()\n {\n return array_keys($this->convertersByMimeType);\n }", "public function getImageMimeTypes()\n {\n return array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap',\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_',\n 'image/png',\n 'application/png',\n 'application/x-png'\n );\n }", "function wp_get_mime_types()\n {\n }", "public function getMimeTypes()\n {\n return explode(';', $this->response->getHeader('Content-Type')[0]);\n }", "public function getSupportedMIMETypes(): array\n {\n $mime = null;\n $mimeTypes = [];\n\n $response = preg_split(\"/\\n/\", $this->request('mime-types')) ?: [];\n\n foreach($response as $line)\n {\n if(preg_match('/^\\w+/', $line))\n {\n $mime = trim($line);\n $mimeTypes[$mime] = ['alias' => []];\n }\n else\n {\n [$key, $value] = preg_split('/:\\s+/', trim($line));\n\n if($key == 'alias')\n {\n $mimeTypes[$mime]['alias'][] = $value;\n }\n else\n {\n $mimeTypes[$mime][$key] = $value;\n }\n }\n }\n\n\n return $mimeTypes;\n }", "private function getMimeTypes()\n {\n return apply_filters('wplms_assignments_upload_mimes_array',array(\n 'JPG' => array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap'),\n 'GIF' => array(\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_'),\n 'PNG' => array(\n 'image/png',\n 'application/png',\n 'application/x-png'),\n 'DOCX'=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'RAR'=> 'application/x-rar',\n 'ZIP' => array(\n 'application/zip',\n 'application/x-zip',\n 'application/x-zip-compressed',\n 'application/x-compress',\n 'application/x-compressed',\n 'multipart/x-zip'),\n 'DOC' => array(\n 'application/msword',\n 'application/doc',\n 'application/text',\n 'application/vnd.msword',\n 'application/vnd.ms-word',\n 'application/winword',\n 'application/word',\n 'application/x-msw6',\n 'application/x-msword'),\n 'PDF' => array(\n 'application/pdf',\n 'application/x-pdf',\n 'application/acrobat',\n 'applications/vnd.pdf',\n 'text/pdf',\n 'text/x-pdf'),\n 'PPT' => array(\n 'application/vnd.ms-powerpoint',\n 'application/mspowerpoint',\n 'application/ms-powerpoint',\n 'application/mspowerpnt',\n 'application/vnd-mspowerpoint',\n 'application/powerpoint',\n 'application/x-powerpoint',\n 'application/x-m'),\n 'PPTX'=> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'PPS' => 'application/vnd.ms-powerpoint',\n 'PPSX'=> 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'PSD' => array('application/octet-stream',\n 'image/vnd.adobe.photoshop'\n ),\n 'ODT' => array(\n 'application/vnd.oasis.opendocument.text',\n 'application/x-vnd.oasis.opendocument.text'),\n 'XLS' => array(\n 'application/vnd.ms-excel',\n 'application/msexcel',\n 'application/x-msexcel',\n 'application/x-ms-excel',\n 'application/vnd.ms-excel',\n 'application/x-excel',\n 'application/x-dos_ms_excel',\n 'application/xls'),\n 'XLSX'=> array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'),\n 'MP3' => array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio'),\n 'M4A' => array(\n 'audio/mp4a-latm',\n 'audio/m4a',\n 'audio/mp4'),\n 'OGG' => array(\n 'audio/ogg',\n 'application/ogg'),\n 'WAV' => array(\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav'),\n 'WMA' => 'audio/x-ms-wma',\n 'MP4' => array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4'),\n 'M4V' => array(\n 'video/mp4',\n 'video/x-m4v'),\n 'MOV' => array(\n 'video/quicktime',\n 'video/x-quicktime',\n 'image/mov',\n 'audio/aiff',\n 'audio/x-midi',\n 'audio/x-wav',\n 'video/avi'),\n 'WMV' => 'video/x-ms-wmv',\n 'AVI' => array(\n 'video/avi',\n 'video/msvideo',\n 'video/x-msvideo',\n 'image/avi',\n 'video/xmpg2',\n 'application/x-troff-msvideo',\n 'audio/aiff',\n 'audio/avi'),\n 'MPG' => array(\n 'video/avi',\n 'video/mpeg',\n 'video/mpg',\n 'video/x-mpg',\n 'video/mpeg2',\n 'application/x-pn-mpg',\n 'video/x-mpeg',\n 'video/x-mpeg2a',\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'image/mpg'),\n 'OGV' => 'video/ogg',\n '3GP' => array(\n 'audio/3gpp',\n 'video/3gpp'),\n '3G2' => array(\n 'video/3gpp2',\n 'audio/3gpp2'),\n 'FLV' => 'video/x-flv',\n 'WEBM'=> 'video/webm',\n 'APK' => 'application/vnd.android.package-archive',\n ));\n }", "function loadMimeTypes() {\n\t\tif( empty( $this->mMimeTypes )) {\n\t\t\t// use bitweavers mime.types file to ensure everyone has our set unless user forces his own.\n\t\t\tif( defined( 'MIME_TYPES' ) && is_file( MIME_TYPES )) {\n\t\t\t\t$mimeFile = MIME_TYPES;\n\t\t\t} else {\n\t\t\t\t$mimeFile = KERNEL_PKG_PATH.'admin/mime.types';\n\t\t\t}\n\n\t\t\t$this->mMimeTypes = array();\n\t\t\tif( $fp = fopen( $mimeFile,\"r\" ) ) {\n\t\t\t\twhile( FALSE != ( $line = fgets( $fp, 4096 ) ) ) {\n\t\t\t\t\tif( !preg_match( \"/^\\s*(?!#)\\s*(\\S+)\\s+(?=\\S)(.+)/\", $line, $match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = preg_split( \"/\\s/\",trim( $match[2] ) );\n\t\t\t\t\tforeach( $tmp as $type ) {\n\t\t\t\t\t\t$this->mMimeTypes[strtolower( $type )] = $match[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose( $fp );\n\t\t\t}\n\t\t}\n\t}", "private function loadMimeTypes ()\n\t\t{\n\t\t\tif ($this->mimeTypes === null)\n\t\t\t{\n\t\t\t\t$this->mimeTypes = [];\n\n\t\t\t\t$lines = file($this->mimeFile);\n\t\t\t\tforeach($lines as $line) {\n\t\t\t\t\t// skip comments\n\t\t\t\t\t$line = preg_replace('/#.*$/', '', $line);\n\t\t\t\t\t$line = trim($line);\n\t\t\t\t\tif($line === '') continue;\n\n\t\t\t\t\t$exts = preg_split('/\\s+/', $line);\n\t\t\t\t\t$mime = array_shift($exts);\n\t\t\t\t\tif(!$exts) continue;\n\t\t\t\t\tforeach($exts as $ext) {\n\t\t\t\t\t\tif(empty($ext)) continue;\n\t\t\t\t\t\tif(strlen($ext) > 4) continue; // we only handle 4 chars or less\n\t\t\t\t\t\t$this->mimeTypes[$ext] = $mime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "static function loadMimeTypes() {\n\t\tif(@file_exists('/etc/mime.types')) {\n\t\t\t$mimeTypes = file('/etc/mime.types');\n\t\t\tforeach($mimeTypes as $typeSpec) {\n\t\t\t\tif(($typeSpec = trim($typeSpec)) && substr($typeSpec,0,1) != \"#\") {\n\t\t\t\t\t$parts = split(\"[ \\t\\r\\n]+\", $typeSpec);\n\t\t\t\t\tif(sizeof($parts) > 1) {\n\t\t\t\t\t\t$mimeType = array_shift($parts);\n\t\t\t\t\t\tforeach($parts as $ext) {\n\t\t\t\t\t\t\t$ext = strtolower($ext);\n\t\t\t\t\t\t\t$mimeData[$ext] = $mimeType;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Fail-over for if people don't have /etc/mime.types on their server. it's unclear how important this actually is\n\t\t} else {\n\t\t\t$mimeData = array(\n\t\t\t\t\"doc\" => \"application/msword\",\n\t\t\t\t\"xls\" => \"application/vnd.ms-excel\",\n\t\t\t\t\"rtf\" => \"application/rtf\",\n\t\t\t);\n\t\t}\n\n\t\tglobal $global_mimetypes;\n\t\t$global_mimetypes = $mimeData;\n\t\treturn $mimeData;\n\t}", "private function getAllowedFileTypes()\n {\n return str_replace('.', '', config('media.allowed', ''));\n }", "function get_post_mime_types()\n {\n }", "public function mime_types( $mimes ) {\r\n\r\n\t\t$mimes['ttf'] = 'font/ttf';\r\n\t\t$mimes['woff'] = 'font/woff';\r\n\t\t$mimes['svg'] = 'font/svg';\r\n\t\t$mimes['eot'] = 'font/eot';\r\n\r\n\t\treturn $mimes;\r\n\r\n\t}", "public function getAllowedMimeTypes($post_id=null)\n { \n if(empty($post_id)){\n global $post;\n $post_id = $post->ID;\n }\n $return = array();\n $pluginFileTypes = $this->getMimeTypes();\n $ext=$this->getAllowedFileExtensions($post_id);\n foreach($ext as $key){\n if(array_key_exists($key, $pluginFileTypes)){\n if(!function_exists('finfo_file') || !function_exists('mime_content_type')){\n if(($key == 'DOCX') || ($key == 'DOC') || ($key == 'PDF') ||\n ($key == 'ZIP') || ($key == 'RAR')){\n $return[] = 'application/octet-stream';\n }\n }\n if(is_array($pluginFileTypes[$key])){\n foreach($pluginFileTypes[$key] as $fileType){\n $return[] = $fileType;\n }\n } else {\n $return[] = $pluginFileTypes[$key];\n }\n }\n }\n return $return;\n }", "public function getAudioMimeTypes()\n {\n return array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio',\n 'audio/mp4a-latm',\n 'audio/ogg',\n 'application/ogg',\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav',\n 'audio/x-ms-wma'\n );\n }", "public static function getMimeMapping()\n\t{\n\t\t// get current mimes\n\t\t$mimes = parent::getMimeMapping();\n\n\t\t// add missing mimes\n\t\t$mimes['mp3'][] = 'audio/mp3'; // necesary for Chrome unsolved bug\n\t\t$mimes['p7m'][] = 'application/pkcs7-mime';\n\t\t$mimes['kml'][] = 'application/octet-stream';\n\t\t$mimes['kmz'][] = 'application/octet-stream';\n\t\t\n\t\treturn $mimes;\n\t}", "public function supported_filetypes() {\n return '*';\n }", "public function getSupportedFileTypes(){\n\t\t$_url = $this->constants['SERVICE_ENTRY_POINT'].$this->constants['SERVICE_VERSION'].'/'.$this->constants['MISC_PATH'].'/supported-file-types';\n\t\t$response = $this->getRequests($_url)['response'];\n\t\treturn $response;\n\t}", "public static function exts_by_mime($type)\r\n {\r\n static $types = array();\r\n\r\n // Fill the static array\r\n if (empty($types))\r\n {\r\n $mimes = Core::config('mimes');\r\n foreach ($mimes as $ext => $ms)\r\n {\r\n foreach ($ms as $mime)\r\n {\r\n if ($mime == 'application/octet-stream')\r\n {\r\n // octet-stream is a generic binary\r\n continue;\r\n }\r\n\r\n if (!isset($types[$mime]))\r\n {\r\n $types[$mime] = array((string)$ext);\r\n }\r\n elseif (!in_array($ext, $types[$mime]))\r\n {\r\n $types[$mime][] = (string)$ext;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return isset($types[$type])?$types[$type]:false;\r\n }", "public static function _mime_types($ext = '')\n {\n $mimes = array(\n 'xl' => 'application/excel',\n 'js' => 'application/javascript',\n 'hqx' => 'application/mac-binhex40',\n 'cpt' => 'application/mac-compactpro',\n 'bin' => 'application/macbinary',\n 'doc' => 'application/msword',\n 'word' => 'application/msword',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n 'class' => 'application/octet-stream',\n 'dll' => 'application/octet-stream',\n 'dms' => 'application/octet-stream',\n 'exe' => 'application/octet-stream',\n 'lha' => 'application/octet-stream',\n 'lzh' => 'application/octet-stream',\n 'psd' => 'application/octet-stream',\n 'sea' => 'application/octet-stream',\n 'so' => 'application/octet-stream',\n 'oda' => 'application/oda',\n 'pdf' => 'application/pdf',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'smi' => 'application/smil',\n 'smil' => 'application/smil',\n 'mif' => 'application/vnd.mif',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'wbxml' => 'application/vnd.wap.wbxml',\n 'wmlc' => 'application/vnd.wap.wmlc',\n 'dcr' => 'application/x-director',\n 'dir' => 'application/x-director',\n 'dxr' => 'application/x-director',\n 'dvi' => 'application/x-dvi',\n 'gtar' => 'application/x-gtar',\n 'php3' => 'application/x-httpd-php',\n 'php4' => 'application/x-httpd-php',\n 'php' => 'application/x-httpd-php',\n 'phtml' => 'application/x-httpd-php',\n 'phps' => 'application/x-httpd-php-source',\n 'swf' => 'application/x-shockwave-flash',\n 'sit' => 'application/x-stuffit',\n 'tar' => 'application/x-tar',\n 'tgz' => 'application/x-tar',\n 'xht' => 'application/xhtml+xml',\n 'xhtml' => 'application/xhtml+xml',\n 'zip' => 'application/zip',\n 'mid' => 'audio/midi',\n 'midi' => 'audio/midi',\n 'mp2' => 'audio/mpeg',\n 'mp3' => 'audio/mpeg',\n 'mpga' => 'audio/mpeg',\n 'aif' => 'audio/x-aiff',\n 'aifc' => 'audio/x-aiff',\n 'aiff' => 'audio/x-aiff',\n 'ram' => 'audio/x-pn-realaudio',\n 'rm' => 'audio/x-pn-realaudio',\n 'rpm' => 'audio/x-pn-realaudio-plugin',\n 'ra' => 'audio/x-realaudio',\n 'wav' => 'audio/x-wav',\n 'bmp' => 'image/bmp',\n 'gif' => 'image/gif',\n 'jpeg' => 'image/jpeg',\n 'jpe' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'eml' => 'message/rfc822',\n 'css' => 'text/css',\n 'html' => 'text/html',\n 'htm' => 'text/html',\n 'shtml' => 'text/html',\n 'log' => 'text/plain',\n 'text' => 'text/plain',\n 'txt' => 'text/plain',\n 'rtx' => 'text/richtext',\n 'rtf' => 'text/rtf',\n 'vcf' => 'text/vcard',\n 'vcard' => 'text/vcard',\n 'xml' => 'text/xml',\n 'xsl' => 'text/xml',\n 'mpeg' => 'video/mpeg',\n 'mpe' => 'video/mpeg',\n 'mpg' => 'video/mpeg',\n 'mov' => 'video/quicktime',\n 'qt' => 'video/quicktime',\n 'rv' => 'video/vnd.rn-realvideo',\n 'avi' => 'video/x-msvideo',\n 'movie' => 'video/x-sgi-movie'\n );\n if (array_key_exists(strtolower($ext), $mimes)) {\n return $mimes[strtolower($ext)];\n }\n return 'application/octet-stream';\n }" ]
[ "0.8294866", "0.82882845", "0.8181627", "0.807407", "0.7963864", "0.79494417", "0.7847374", "0.78200144", "0.77975315", "0.7652592", "0.7638057", "0.76056087", "0.7526512", "0.75212085", "0.7460236", "0.743895", "0.7347182", "0.7296489", "0.7280664", "0.7184006", "0.7124255", "0.71070135", "0.70799786", "0.7072943", "0.7003612", "0.6959172", "0.68845695", "0.688114", "0.68523616", "0.6850086" ]
0.84952116
0
Returns the default formatted charset string.
public static function getDefaultCharset() { if (MHTTPD::$charset !== null) { return MHTTPD::$charset; } $charset = ini_get('default_charset'); if ($charset != '') {$charset = "; charset={$charset}";} MHTTPD::$charset = $charset; return $charset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_formatted_charset(): string\n\t{\n\t\t$charset = $this->charset;\n\n\t\tif (!$charset)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tlist($charset, $collate) = explode('/', $charset) + [ 1 => null ];\n\n\t\treturn \"CHARSET $charset\" . ($collate ? \" COLLATE {$charset}_{$collate}\" : '');\n\t}", "function atkGetCharset()\n{\n\treturn atkconfig('default_charset',atktext('charset','atk'));\n}", "protected function get_formatted_default(): string\n\t{\n\t\t$default = $this->default;\n\n\t\tif (!$default)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tswitch ($default)\n\t\t{\n\t\t\tcase 'CURRENT_TIMESTAMP':\n\n\t\t\t\treturn \"DEFAULT $default\";\n\n\t\t\tdefault:\n\n\t\t\t\treturn \"DEFAULT '$default'\";\n\t\t}\n\t}", "public function getDefaultStringFormat()\n {\n if (null !== $this->defaultStringFormat) {\n return $this->defaultStringFormat;\n }\n\n return $this->database->getDefaultStringFormat();\n }", "public static function getDefaultFormat(): string\n {\n return static::$default_format;\n }", "public function getCharset(): string\n {\n $charsetCollate = '';\n\n $mySlqVersion = $this->getVariable('SELECT VERSION() as mysql_version');\n\n if (version_compare($mySlqVersion, '4.1.0', '>=')) {\n if (!empty($this->wpDatabase->charset)) {\n $charsetCollate = \"DEFAULT CHARACTER SET {$this->wpDatabase->charset}\";\n }\n\n if (!empty($this->wpDatabase->collate)) {\n $charsetCollate .= \" COLLATE {$this->wpDatabase->collate}\";\n }\n }\n\n return $charsetCollate;\n }", "public function getDefaultChar() {}", "public static function determine_charset() {\n global $wpdb;\n $charset = '';\n\n if (!empty($wpdb->charset)) {\n $charset = \"DEFAULT CHARACTER SET {$wpdb->charset}\";\n\n if (!empty($wpdb->collate)) {\n $charset .= \" COLLATE {$wpdb->collate}\";\n }\n }\n return $charset;\n }", "public function getCharset(): string\n {\n return $this->charset;\n }", "public function getCharset(): string\n {\n return $this->charset;\n }", "static public function getCharsetString($cs)\n {\n /**\n * From http://www.iana.org/assignments/character-sets\n */\n $charsetString = array(3 => 'US-ASCII',\n 4 => 'ISO-8859-1',\n 106 => 'UTF-8',\n 1013 => 'UTF-16BE',\n 1014 => 'UTF-16LE',\n 1015 => 'UTF-16');\n\n return isset($charsetString[$cs]) ? $charsetString[$cs] : null;\n }", "public static function getCurrentCharset() {}", "public function getDefaultStringFormatter(): DefaultStringFormatter;", "function getCharset(): ?string;", "public function getCharset()\n {\n $charset = Config::get('view.charset');\n return ($charset !== null) ? $charset : $this->charset;\n }", "public function get_charset_collate()\n {\n }", "public function charset()\n\t{\n\t\treturn Kohana::$charset;\n\t}", "public function getCharset()\n {\n return $this->options['charset'];\n }", "public static function getDefaultFormat()\n {\n return self::$defaultFormat;\n }", "public function getCharset(): string {\n\t\treturn $this->charset;\n\t}", "public static function default(): string\n {\n $default = Cache::get('locale_default');\n\n if ($default === null) {\n $default = static::select('locale')->where('is_default', '=', true)->first();\n $default = ! empty($default) ? $default->locale : config('contentful.default_locale');\n\n // Cache is cleaned in Console\\Commands\\SyncLocales (run at least daily)\n Cache::forever('locale_default', $default);\n }\n\n return $default;\n }", "public function getDefaultCharacterSet()\n {\n $characterSet = $this->config->get('database.preferred_character_set');\n $characterSet = $this->normalizeCharacterSet($characterSet);\n\n return $characterSet;\n }", "public function getCharset();", "public function getCharset();", "public function defaultFormat()\n\t{\n\t\treturn $this->format();\n\t}", "public function getCharSet() {}", "public function getCharset(): ?string;", "public function getCharset()\n {\n return $this->_db->getOption('charset');\n }", "function getDefaultCollationForCharset($charset) {\n $row = DB::executeFirstRow(\"SHOW CHARACTER SET LIKE ?\", array($charset));\n \n if($row && isset($row['Default collation'])) {\n return $row['Default collation'];\n } else {\n throw new InvalidParamError('charset', $charset, \"Unknown MySQL charset '$charset'\");\n } // if\n }", "public function getMessageEncoding() {\n\t\treturn $this->messageEncoding ?: static::config()->default_message_encoding;\n\t}" ]
[ "0.72111094", "0.680433", "0.67340255", "0.6672375", "0.6600745", "0.65656215", "0.6442014", "0.6424496", "0.6264112", "0.6264112", "0.61998695", "0.61642283", "0.61569554", "0.6154951", "0.6102674", "0.6069433", "0.6068933", "0.6043149", "0.6037679", "0.60196555", "0.60084265", "0.5991668", "0.59598213", "0.59598213", "0.5936321", "0.5924356", "0.5921274", "0.5905501", "0.58379096", "0.58243316" ]
0.6977547
1
Creates a stream context for the main server listening socket based on the configured settings.
protected static function getContext() { $opts = array( 'socket' => array( 'backlog' => MHTTPD::$config['Server']['queue_backlog'], ), ); if (MHTTPD::$config['SSL']['enabled']) { // Find SSL certificate file $cert = MHTTPD::$config['SSL']['cert_file']; if ( !($cert_file = realpath($cert)) && !($cert_file = realpath(MHTTPD::getInipath().$cert)) ) { trigger_error("Cannot find SSL certificate file: {$cert}", E_USER_ERROR); } // Add SSL options $opts['ssl'] = array( 'local_cert' => $cert_file, 'passphrase' => MHTTPD::$config['SSL']['passphrase'], 'allow_self_signed' => true, 'verify_peer' => false, ); } return stream_context_create($opts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getStreamContext()\n {\n $ctx = stream_context_create();\n\n stream_context_set_option($ctx, \"ssl\", \"local_cert\", $this->pem);\n if (strlen($this->passphrase)) {\n stream_context_set_option($ctx, \"ssl\", \"passphrase\", $this->passphrase);\n }\n\n return $ctx;\n }", "protected static function createListener($context)\n\t{\n\t\t$type = MHTTPD::$config['SSL']['enabled'] ? 'ssl' : 'tcp';\n\t\t$addr = MHTTPD::$config['Server']['address'];\n\t\t$port = MHTTPD::$config['Server']['port'];\n\n\t\tif (!(MHTTPD::$listener = stream_socket_server(\"{$type}://{$addr}:{$port}\", $errno, $errstr, \n\t\t\tSTREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context))\n\t\t\t) {\n\t\t\ttrigger_error(\"Could not create \".strtoupper($type).\" server socket\", E_USER_ERROR);\n\t\t}\n\n\t\tif (MHTTPD::$debug) {\n\t\t\tcecho(\"\\n\".chrule().\"\\n\");\n\t\t\tcecho(\"Created \".strtoupper($type).\" listener: \".stream_socket_get_name(MHTTPD::$listener, false).\"\\n\\n\");\n\t\t} else {\n\t\t\t$t = ($type == 'ssl') ? ' (SSL)' : '';\n\t\t\tcecho(\"Started MiniHTTPD server on {$addr}, port {$port}{$t} ...\\n\\n\");\n\t\t}\n\t}", "protected function _createContext() {\n\t\t$options = [];\n\n\t\tif ($this->_userAgent) {\n\t\t\t$options['http']['user_agent'] = $this->_userAgent;\n\t\t}\n\n\t\treturn stream_context_create($options);\n\t}", "protected function createStream()\n {\n $host = sprintf('udp://%s:%d', $this->config['host'], $this->config['port']);\n\n // stream the data using UDP and suppress any errors\n $this->stream = @stream_socket_client($host);\n }", "public function stream_context_create($options = null, $params = null)\n {\n return stream_context_create($options, $params);\n }", "public function streamContextCreate(array $options)\n {\n $this->stream = stream_context_create($options);\n }", "public function injectStreamContext($streamContext);", "public function stream_context_create(array $parameters);", "public function __construct()\n {\n Socket::$isServer = true;\n self::$server = new sockbase();\n self::$server->onmsg(__NAMESPACE__ . '\\SqlPool::inmsg');\n self::$server->dismsg(__NAMESPACE__ . '\\SqlPool::dis');\n $poolconf = ng169\\lib\\Option::get('pool');\n self::$pwd = $poolconf['pwd'];\n\n self::$server->start($poolconf['ip'], $poolconf['port']);\n\n // self::$server->start(\"127.0.0.1\", \"4563\");\n }", "public function setSwooleMode(Request $swoole_raw_request, Response $swoole_raw_response): IoContextInterface;", "public function createSocket()\n {\n //Create TCP/IP sream socket\n $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n //reuseable port\n socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\n //bind socket to specified host\n socket_bind($this->socket, 0, $this->port);\n\n //listen to port\n socket_listen($this->socket);\n\n //create & add listning socket to the list\n $this->clients[0] = [\n $this->socket\n ];\n }", "function stream_context_set_params($stream_or_context, $params)\n{\n}", "public function __construct()\n\t{\n\t\t$configuration = new Config();\n\t\t// Configure socket server\n\t\tparent::__construct($configuration->socket_host, $configuration->socket_controller_port);\n\n\t\t// Run the server\n\t\t$this->run();\n\t}", "public function prepareContext()\n {\n $headers = [\n 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n 'Accept-Encoding: gzip, deflate',\n 'Accept-Language: ru-RU,ru;q=0.9',\n 'Accept-Charset: utf-8',\n 'Connection: keep-alive',\n 'Host: www.kinopoisk.ru',\n 'user_country=ru',\n 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0'\n ];\n\n $options = [\n 'http' => [\n 'method' => 'GET',\n //'protocol_version' => 1.1,\n //'proxy' => 'http://proxy:8080',\n //'timeout' => 4.0,\n 'header' => implode(\"\\r\\n\", $headers),\n //'request_fulluri' => true\n ]\n ];\n\n $context = stream_context_create($options);\n\n return $context;\n }", "public function initListeningEvent()\n {\n if(!$this->server instanceof \\Swoole\\WebSocket\\Server){\n throw new \\Exception('swoole的websocket服务还未开启');\n }\n try{\n $processor = new LoginCommonCallServiceProcessor(new LoginCommonService($this->server));\n $tFactory = new TTransportFactory();\n $pFactory = new TBinaryProtocolFactory();\n $transport = new ServerTransport($this->server);\n $server = new \\src\\Thrift\\Server\\Server($processor, $transport, $tFactory, $tFactory, $pFactory, $pFactory);\n $server->serve();\n }catch (\\TException $e){\n throw new \\Exception('thrift启动失败');\n }\n }", "protected function getConfiguredSocket() {}", "public static function createSocket($uri, array $context = [])\n {\n if ((string)(int)$uri === (string)$uri) {\n $uri = '127.0.0.1:' . $uri;\n }\n\n // assume default scheme if none has been given\n if (\\strpos($uri, '://') === false) {\n $uri = 'tcp://' . $uri;\n }\n\n // parse_url() does not accept null ports (random port assignment) => manually remove\n if (\\substr($uri, -2) === ':0') {\n $parts = \\parse_url(\\substr($uri, 0, -2));\n if ($parts) {\n $parts['port'] = 0;\n }\n } else {\n $parts = \\parse_url($uri);\n }\n\n // ensure URI contains TCP scheme, host and port\n if (!$parts || !isset($parts['scheme'], $parts['host'], $parts['port']) || $parts['scheme'] !== 'tcp') {\n throw new \\InvalidArgumentException('Invalid URI \"' . $uri . '\" given');\n }\n\n if (false === \\filter_var(\\trim($parts['host'], '[]'), \\FILTER_VALIDATE_IP)) {\n throw new \\InvalidArgumentException('Given URI \"' . $uri . '\" does not contain a valid host IP');\n }\n\n $socket = @\\stream_socket_server(\n $uri,\n $errno,\n $errstr,\n \\STREAM_SERVER_BIND | \\STREAM_SERVER_LISTEN,\n \\stream_context_create(['socket' => $context + ['backlog' => 511]])\n );\n\n if (false === $socket) {\n throw new \\RuntimeException('Failed to listen on \"' . $uri . '\": ' . $errstr, $errno);\n }\n\n return $socket;\n }", "protected function createStream()\n {\n if (empty($this->host)) {\n throw new \\Kafka\\Exception('Cannot open null host.');\n }\n if ($this->port <= 0) {\n throw new \\Kafka\\Exception('Cannot open without port.');\n }\n\n $remoteSocket = sprintf('tcp://%s:%s', $this->host, $this->port);\n\n $context = stream_context_create([]);\n if ($this->config != null && $this->config->getSslEnable()) { // ssl connection\n $remoteSocket = sprintf('ssl://%s:%s', $this->host, $this->port);\n $localCert = $this->config->getSslLocalCert();\n $localKey = $this->config->getSslLocalPk();\n $verifyPeer = $this->config->getSslVerifyPeer();\n $passphrase = $this->config->getSslPassphrase();\n $cafile = $this->config->getSslCafile();\n $peerName = $this->config->getSslPeerName();\n\n $context = stream_context_create(['ssl' => [\n 'local_cert' => $localCert,\n 'local_pk' => $localKey,\n 'verify_peer' => $verifyPeer,\n 'passphrase' => $passphrase,\n 'cafile' => $cafile,\n 'peer_name' => $peerName\n ]]);\n }\n \n $this->stream = $this->createSocket($remoteSocket, $context, $errno, $errstr);\n\n if ($this->stream == false) {\n $error = 'Could not connect to '\n . $this->host . ':' . $this->port\n . ' (' . $errstr . ' [' . $errno . '])';\n throw new \\Kafka\\Exception($error);\n }\n // SASL auth\n if ($this->saslMechanismProvider !== null) {\n $this->saslMechanismProvider->authenticate($this);\n }\n }", "public function open_socket(){\n //Create the server socket\n if($this->socket === null){\n \n //Create socket\n if (($this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {\n echo \"Socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_KEEPALIVE, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_bind($this->socket, $this->host, $this->port) === false) {\n echo \"Socket_bind() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_listen($this->socket, 5) === false) {\n echo \"Socket_listen() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n }\n return $this->socket;\n }", "public function createServer(\n IContext $ctx\n ): IServer;", "private function getSocketStream()\n {\n if ($this->socketStream !== null && is_resource($this->socketStream)) return $this->socketStream;\n\n if ($this->overlapContext === null) {\n $context = stream_context_create($this->contextArgs);\n } else {\n $context = $this->overlapContext;\n }\n\n $socket = stream_socket_client($this->remoteSocket, $this->socketErrorCode, $this->socketError, $this->timeoutSeconds, $this->socketFlags, $context);\n if ($socket === false) {\n throw new SocketStreamException('Unable to create event socket stream: ' . $this->socketError . ' (' . $this->socketErrorCode . ').');\n }\n\n stream_set_blocking($socket, true);\n stream_set_timeout($socket, $this->timeoutSeconds, $this->timeoutMicroseconds);\n\n $this->socketStream = $socket;\n\n return $socket;\n }", "public function listen (array $options = [])\r\n\t\t{\r\n\t\t\t\tif ($this -> isListening ())\r\n\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;\r\n\t\t\t\t$context = stream_context_create ($options);\r\n\t\t\t\t$scheme = (string) $this -> getTransport () . '://' . $this -> getAddress () . ':' . $this -> getPort ();\r\n\t\t\t\t$resourcePointer = stream_socket_server ($scheme, $errno, $errstr, $flags, $context);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Determine on which port we bound.\r\n\t\t\t\t*/\r\n\t\t\t\tif ($this -> getPort () == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t\t$localAddress = stream_socket_get_name ($resourcePointer, false);\r\n\t\t\t\t\t\t$port = substr ($localAddress, strrpos ($localAddress, ':') + 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this -> setPort ($port);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Check if we succeeded to make the resource\r\n\t\t\t\t*/\r\n\t\t\t\tif (!is_resource ($resourcePointer) || $errno || $errstr )\r\n\t\t\t\t{\r\n\t\t\t\t\t\tthrow new SocketException (sprintf ('Failed to create socket resource, error: %s', $errstr));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Callback for when a new connection has been received.\r\n\t\t\t\t*/\r\n\t\t\t\t$acceptCallback = function (PollerInterface $pollerInterface, $resourcePointer)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tif (false === $newConnection = stream_socket_accept ($resourcePointer))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$event = new AcceptingFailedEvent ($this);\r\n\t\t\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_EXCEPTION, $event);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$socket = $this -> handleNewConnection ($newConnection);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($this -> getTransport () == self :: TRANSPORT_SSL)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$socket -> setTransport (ClientStream :: TRANSPORT_SSL);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$event = new AcceptingSucceededEvent ($this, $socket);\r\n\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_ACCEPTED_CONN, $event);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Insert callback into poller\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> pollerInstance -> addReadStream ($resourcePointer, $acceptCallback);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Finishing up..\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> currentState = self :: STATE_LISTENING;\r\n\t\t\t\t$this -> resourcePointer = $resourcePointer;\r\n\t\t\t\t$this -> resourcePointerId = (int) $resourcePointer;\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t}", "public function initTcpListenServer()\n {\n $listenConfig = config('websocketlogin.listern');\n $this->listern = $this->server->addListener($listenConfig['uri'], $listenConfig['port'], $listenConfig['type']);\n return $this->listern;\n }", "public function setFastcgiMode(): IoContextInterface;", "protected function configureSwooleServer()\n {\n $config = $this->container['config']->get('swoole.server');\n\n $this->server->set($config);\n }", "private function setupStreamNotify() {\n\t\t$this->notifier = new SocketNotifier(\n\t\t\t$this->stream,\n\t\t\tSocketNotifier::ACTIVITY_READ | SocketNotifier::ACTIVITY_WRITE | SocketNotifier::ACTIVITY_ERROR,\n\t\t\tarray($this, 'onStreamActivity')\n\t\t);\n\t\t$this->socketManager->addSocketNotifier($this->notifier);\n\t}", "abstract protected function finalize_stream_context_settings(): void;", "public function setSocketContext($context)\n {\n $this->overlapContext = $context;\n }", "public function __construct($sockType=SWOOLE_SOCK_TCP)\n {\n $this->client =new \\Swoole\\Async\\Client($sockType);\n }", "public function __construct(IServer $stream) {\n $this->_stream = $stream;\n }" ]
[ "0.65937775", "0.63524294", "0.61987245", "0.6120276", "0.5942839", "0.5922673", "0.5695063", "0.56058484", "0.55532527", "0.5538928", "0.5454523", "0.54109675", "0.5406407", "0.53507173", "0.5337277", "0.5319977", "0.5292695", "0.5284051", "0.52714616", "0.5258502", "0.5213531", "0.51922435", "0.51719826", "0.51649773", "0.5162611", "0.5154219", "0.5153681", "0.5147893", "0.5123183", "0.5115878" ]
0.6733285
0
Creates the main server listening socket on the configured address/port. stream_socket_server() is used here rather than the sockets extension mainly due to its inbuilt support for SSL connections.
protected static function createListener($context) { $type = MHTTPD::$config['SSL']['enabled'] ? 'ssl' : 'tcp'; $addr = MHTTPD::$config['Server']['address']; $port = MHTTPD::$config['Server']['port']; if (!(MHTTPD::$listener = stream_socket_server("{$type}://{$addr}:{$port}", $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context)) ) { trigger_error("Could not create ".strtoupper($type)." server socket", E_USER_ERROR); } if (MHTTPD::$debug) { cecho("\n".chrule()."\n"); cecho("Created ".strtoupper($type)." listener: ".stream_socket_get_name(MHTTPD::$listener, false)."\n\n"); } else { $t = ($type == 'ssl') ? ' (SSL)' : ''; cecho("Started MiniHTTPD server on {$addr}, port {$port}{$t} ...\n\n"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSocket()\n {\n //Create TCP/IP sream socket\n $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n //reuseable port\n socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\n //bind socket to specified host\n socket_bind($this->socket, 0, $this->port);\n\n //listen to port\n socket_listen($this->socket);\n\n //create & add listning socket to the list\n $this->clients[0] = [\n $this->socket\n ];\n }", "public function listen (array $options = [])\r\n\t\t{\r\n\t\t\t\tif ($this -> isListening ())\r\n\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;\r\n\t\t\t\t$context = stream_context_create ($options);\r\n\t\t\t\t$scheme = (string) $this -> getTransport () . '://' . $this -> getAddress () . ':' . $this -> getPort ();\r\n\t\t\t\t$resourcePointer = stream_socket_server ($scheme, $errno, $errstr, $flags, $context);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Determine on which port we bound.\r\n\t\t\t\t*/\r\n\t\t\t\tif ($this -> getPort () == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t\t$localAddress = stream_socket_get_name ($resourcePointer, false);\r\n\t\t\t\t\t\t$port = substr ($localAddress, strrpos ($localAddress, ':') + 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this -> setPort ($port);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Check if we succeeded to make the resource\r\n\t\t\t\t*/\r\n\t\t\t\tif (!is_resource ($resourcePointer) || $errno || $errstr )\r\n\t\t\t\t{\r\n\t\t\t\t\t\tthrow new SocketException (sprintf ('Failed to create socket resource, error: %s', $errstr));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Callback for when a new connection has been received.\r\n\t\t\t\t*/\r\n\t\t\t\t$acceptCallback = function (PollerInterface $pollerInterface, $resourcePointer)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tif (false === $newConnection = stream_socket_accept ($resourcePointer))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$event = new AcceptingFailedEvent ($this);\r\n\t\t\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_EXCEPTION, $event);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$socket = $this -> handleNewConnection ($newConnection);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($this -> getTransport () == self :: TRANSPORT_SSL)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$socket -> setTransport (ClientStream :: TRANSPORT_SSL);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$event = new AcceptingSucceededEvent ($this, $socket);\r\n\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_ACCEPTED_CONN, $event);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Insert callback into poller\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> pollerInstance -> addReadStream ($resourcePointer, $acceptCallback);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Finishing up..\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> currentState = self :: STATE_LISTENING;\r\n\t\t\t\t$this -> resourcePointer = $resourcePointer;\r\n\t\t\t\t$this -> resourcePointerId = (int) $resourcePointer;\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t}", "public function open_socket(){\n //Create the server socket\n if($this->socket === null){\n \n //Create socket\n if (($this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {\n echo \"Socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_KEEPALIVE, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_bind($this->socket, $this->host, $this->port) === false) {\n echo \"Socket_bind() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_listen($this->socket, 5) === false) {\n echo \"Socket_listen() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n }\n return $this->socket;\n }", "public static function createSocket($uri, array $context = [])\n {\n if ((string)(int)$uri === (string)$uri) {\n $uri = '127.0.0.1:' . $uri;\n }\n\n // assume default scheme if none has been given\n if (\\strpos($uri, '://') === false) {\n $uri = 'tcp://' . $uri;\n }\n\n // parse_url() does not accept null ports (random port assignment) => manually remove\n if (\\substr($uri, -2) === ':0') {\n $parts = \\parse_url(\\substr($uri, 0, -2));\n if ($parts) {\n $parts['port'] = 0;\n }\n } else {\n $parts = \\parse_url($uri);\n }\n\n // ensure URI contains TCP scheme, host and port\n if (!$parts || !isset($parts['scheme'], $parts['host'], $parts['port']) || $parts['scheme'] !== 'tcp') {\n throw new \\InvalidArgumentException('Invalid URI \"' . $uri . '\" given');\n }\n\n if (false === \\filter_var(\\trim($parts['host'], '[]'), \\FILTER_VALIDATE_IP)) {\n throw new \\InvalidArgumentException('Given URI \"' . $uri . '\" does not contain a valid host IP');\n }\n\n $socket = @\\stream_socket_server(\n $uri,\n $errno,\n $errstr,\n \\STREAM_SERVER_BIND | \\STREAM_SERVER_LISTEN,\n \\stream_context_create(['socket' => $context + ['backlog' => 511]])\n );\n\n if (false === $socket) {\n throw new \\RuntimeException('Failed to listen on \"' . $uri . '\": ' . $errstr, $errno);\n }\n\n return $socket;\n }", "protected abstract function newSocket($addr, $port);", "public function createSocket()\n\t{\n\t\t$this->socket = new Socket($this->host, $this->port);\n\n\t\tif ($this->port == static::SSL_PORT) {\n\t\t\t$this->socket->tls($this->sslOptions);\n\t\t}\n\n\t\treturn $this->socket;\n\t}", "private function startServer() {\n\t\t$serverLog = PHPUNIT_TEMP_DIR . '/socketServer.log';\n\t\t$descriptorspec = array(\n\t\t\t0 => array(\"pipe\", \"r\"), // stdin\n\t\t\t1 => array(\"file\", $serverLog, \"a\"),// stdout\n\t\t\t2 => array(\"file\", $serverLog, \"a\") // stderr\n\t\t);\n\n\t\t$cmd = \"php \" . dirname(__FILE__) . '/socketServer.php';\n\t\t$this->server = proc_open($cmd, $descriptorspec, $this->pipes);\n\t\tif ($this->server === false) {\n\t\t\tthrow new Exception(\"Failed starting the socket server process.\");\n\t\t}\n\t\t\n\t\t// Sleep a bit to allow server to start\n\t\tusleep(200000);\n\t\t\n\t\t// Verify the server is running\n\t\t$status = proc_get_status($this->server);\n\t\tif (!$status['running']) {\n\t\t\tthrow new Exception(\"Socket server process failed to start. Check the log at [$serverLog].\");\n\t\t}\n\t}", "private function listenSocket() {\n $result = socket_listen($this->listeningSocket);\n $this->checkResult($result);\n }", "function server_loop($address, $port)\n{\n GLOBAL $fh;\n GLOBAL $__server_listening;\n\t\n\t//printLog($fh, \"server_looping...\");\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n\t\t//printLog($fh, \"failed to create socket: \".socket_strerror($sock));\n exit();\n }\n\n\tif(($ret = socket_bind($sock, $address, $port)) < 0)\n\t{\n\t\t//printLog($fh, \"failed to bind socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tif( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n\t{\n\t\t//printLog($fh, \"failed to listen to socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tsocket_set_nonblock($sock);\n\n\t//printLog($fh, \"waiting for clients to connect...\");\n\n\twhile ($__server_listening)\n\t{\n\t\t$connection = @socket_accept($sock);\n\t\tif ($connection === false)\n\t\t{\n\t\t\tusleep(100);\n\t\t} elseif ($connection > 0) {\n\t\t\thandle_client($sock, $connection);\n\t\t} else {\n\t\t\t//printLog($fh, \"error: \".socket_strerror($connection));\n\t\t\tdie;\n\t\t}\n\t}\n}", "function server_loop($address, $port)\n{\n GLOBAL $__server_listening;\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n echo \"failed to create socket: \".socket_strerror($sock).\"\\n\";\n exit();\n }\n\n if(($ret = socket_bind($sock, $address, $port)) < 0)\n {\n echo \"failed to bind socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n if( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n {\n echo \"failed to listen to socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n socket_set_nonblock($sock);\n \n echo \"waiting for clients to connect\\n\";\n\n while ($__server_listening)\n {\n $connection = @socket_accept($sock);\n if ($connection === false)\n {\n usleep(100);\n }elseif ($connection > 0)\n {\n handle_client($sock, $connection);\n }else\n {\n echo \"error: \".socket_strerror($connection);\n die;\n }\n }\n}", "public function run()\n {\n $port = (int) CommandLine::getInput('p');\n\n if (!$port) {\n die('You must specify a valid port for the socket server. For example: \"-p=1024\"');\n }\n\n $server = new SocketServer('127.0.0.1', $port);\n\n // Set greetings for the new connection\n $server->greetings(\"\\nHi! Just type your brackets sequence and you will see the result\\n\");\n\n // Set handler of the incoming messages\n $server->setMessageHandler($this->messageHandler);\n\n // Start up the server\n $server->run();\n }", "public function setup() {\n $this->socket = socket_create(AF_INET, SOCK_STREAM, 0);\n if (!socket_bind($this->socket, $this->ip, $this->port)) {\n $errno = socket_last_error();\n $this->error(sprintf('Could not bind to address %s:%s [%s] %s', $this->ip, $this->port, $errno, socket_strerror($errno)));\n throw new Exception('Could not start server.');\n }\n\n socket_listen($this->socket);\n $this->daemon->on(Daemon::ON_POSTEXECUTE, array($this, 'run'));\n }", "public static function http_server(): void\n {\n sock::$type = 'http:server';\n sock::$host = '0.0.0.0';\n sock::$port = 80;\n $ok = sock::create();\n\n if (!$ok) exit('HTTP Server creation failed!');\n\n do {\n //IMPORTANT!!! Reset all data & read list & client list\n $data = $read = $client = [];\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read HTTP Request data\n $msg = sock::read($client);\n\n var_dump($msg);\n\n //Prepare simple data\n $key = key($client);\n $sock = current($client);\n\n $data[$key]['sock'] = $sock;\n\n $data[$key]['msg'] = 'Hello! I am a simple HTTP Server running under PHP~';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Your request message was: ';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= trim(current($msg)['msg']);\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Thanks for your test!';\n\n //Send to browser\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "function __construct($addr, $port, $bufferLength = 2048) \n\t{\n\t\t$this->maxBufferSize = $bufferLength;\n\n\t\t$this->master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die(\"Failed: socket_create()\");\n\n\t\tsocket_set_option($this->master, SOL_SOCKET, SO_REUSEADDR, 1) or die(\"Failed: socket_option()\");\n\t\tsocket_bind($this->master, $addr, $port)or die(\"Failed: socket_bind()\");\n\t\tsocket_listen($this->master,20) or die(\"Failed: socket_listen()\");\n\n\t\t$this->sockets['m'] = $this->master;\n\n\t\t$this->stdout(\"Server started\".PHP_EOL.\"Listening on: $addr:$port\".PHP_EOL.\"Master socket: \".$this->master);\n\t}", "protected function bindSwooleServer()\n {\n $this->app->singleton('swoole.server', function () {\n return $this->server;\n });\n }", "protected function listen()\n {\n // Set time limit to indefinite execution\n set_time_limit (0);\n\n $this->socket = socket_create(\n AF_INET,\n SOCK_DGRAM,\n SOL_UDP\n );\n\n if (!is_resource($this->socket))\n {\n $this->logger->log(\"Failed to create a socket for the discovery server. The reason was: \" .\n socket_strerror(socket_last_error()));\n }\n\n if (!@socket_bind(\n $this->socket,\n $this->config->getSetting('discovery-address'),\n $this->config->getSetting('discovery-port')))\n {\n $this->logger->log(\"Failed to bind to socket while initialising the discovery server.\");\n }\n\n // enter an infinite loop, waiting for data\n $data = '';\n while (true)\n {\n if (@socket_recv($this->socket, $data, 9999, MSG_WAITALL))\n {\n $this->logger->log(\"Discovery server received the following: $data\");\n\n $this->handleMessage($data);\n }\n }\n }", "public function createServer(\n IContext $ctx\n ): IServer;", "function create_socket() {\n\t$address = '127.0.0.1';\n\t$port = 5555;\n\n\tif (($sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {\n\t echo \"socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n\t}\n\n\tif(socket_connect($sock, $address, $port) == false) {\n\t\techo \"socket_connect() failed: reason: \" . socket_strerror(socket_last_error($sock)) . \"\\n\";\n\t}\n\treturn $sock;\n}", "public function init() {\n\t\t$errno = \"\";\n\t\t$errstr = \"\";\n\t\t\n\t\t//Si la socket est un fichier\n\t\tif (file_exists ( $this->nom_socket )) {\n\t\t\t@unlink ( $this->nom_socket );\n\t\t}\n\t\t\n\t\t$nom_complet = $this->type_socket . \"://\" . $this->nom_socket;\n\t\tif ($this->port_socket != \"\") {\n\t\t\t$nom_complet .= \":\" . $this->port_socket;\n\t\t}\n\t\t$this->socket = stream_socket_server ( $nom_complet, $errno, $errstr );\n\t\t$this->onDebug ( $errstr . \" (\" . $errno . \") sur \" . $nom_complet, 1 );\n\t\t\n\t\tif (! $this->socket) {\n\t\t\treturn $this->onError ( $errstr . \" (\" . $errno . \") sur \" . $nom_complet );\n\t\t\tif ($errstr == \"Address already in use\") {\n\t\t\t\t$CODE_RETOUR = 2;\n\t\t\t} else {\n\t\t\t\t$CODE_RETOUR = 0;\n\t\t\t}\n\t\t} else {\n\t\t\t$CODE_RETOUR = 1;\n\t\t}\n\t\t\n\t\treturn $CODE_RETOUR;\n\t}", "public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }", "protected function createStream()\n {\n $host = sprintf('udp://%s:%d', $this->config['host'], $this->config['port']);\n\n // stream the data using UDP and suppress any errors\n $this->stream = @stream_socket_client($host);\n }", "function serve($cb) {\n\t$offset = rand(0,2000);\n\tforeach (range(40000+$offset, 50000+$offset) as $port) {\n\t\tlogger(\"serve: Trying port %d\", $port);\n\t\tif (($server = @stream_socket_server(\"tcp://localhost:$port\"))) {\n\t\t\tfprintf(STDERR, \"%s\\n\", $port);\n\t\t\tlogger(\"serve: Using port %d\", $port);\n\t\t\tdo {\n\t\t\t\t$R = array($server); $W = array(); $E = array();\n\t\t\t\t$select = stream_select($R, $E, $E, 10, 0);\n\t\t\t\tif ($select && ($client = stream_socket_accept($server, 1))) {\n\t\t\t\t\tlogger(\"serve: Accept client %d\", (int) $client);\n\t\t\t\t\tif (getenv(\"PHP_HTTP_TEST_SSL\")) {\n\t\t\t\t\t\tstream_socket_enable_crypto($client, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$R = array($client);\n\t\t\t\t\t\twhile (!feof($client) && stream_select($R, $W, $E, 1, 0)) {\n\t\t\t\t\t\t\tlogger(\"serve: Handle client %d\", (int) $client);\n\t\t\t\t\t\t\t$cb($client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger(\"serve: EOF/timeout on client %d\", (int) $client);\n\t\t\t\t\t} catch (Exception $ex) {\n\t\t\t\t\t\tlogger(\"serve: Exception on client %d: %s\", (int) $client, $ex->getMessage());\n\t\t\t\t\t\t/* ignore disconnect */\n\t\t\t\t\t\tif ($ex->getMessage() !== \"Empty message received from stream\") {\n\t\t\t\t\t\t\tfprintf(STDERR, \"%s\\n\", $ex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while ($select);\n\t\t\treturn;\n\t\t}\n\t}\n}", "public function createServer($config = array()) {\n $this->server = new LimelightServer($config);\n }", "protected function _generateSocket() {\n\t}", "public function listen($address, $port, $socket_class='IntroSocket', $live_past_shutdown=false) {\r\n\t\t$listener = new ListenerSocket();\r\n\t\t$listener->init($address, $port, $this, $socket_class, $live_past_shutdown);\r\n\t}", "public function createServer(Websocket $websocket) : Promise\n {\n $socket = SocketServer::listen('tcp://127.0.0.1:0');\n $port = $socket->getAddress()->getPort();\n $server = new Server([$socket], $websocket, new NullLogger());\n return call(static function () use($server, $port) {\n (yield $server->start());\n return [$server, $port];\n });\n }", "function connect($address, $options = [])\n{\n $server = new Socket($address, $options);\n signal($server, null_exhaust(null));\n return $server;\n}", "public function startServer()\n {\n // fork\n $pid = pcntl_fork();\n\n // if we're in the child process, start the server and listen for data\n if ($pid > 0)\n {\n return $pid;\n }\n elseif ($pid === 0)\n {\n return $this->listen();\n }\n }", "public static function tcp_server(): void\n {\n sock::$type = 'tcp:server';\n sock::$host = '0.0.0.0';\n sock::$port = self::port;\n $ok = sock::create();\n\n if (!$ok) exit('TCP Server creation failed!');\n\n //Set Client list alone\n $client = [];\n\n do {\n //Copy client list to read list\n $read = $client;\n\n //Listen to TCP port\n sock::listen($read);\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read TCP Data\n $msg = sock::read($read, $client);\n\n var_dump($msg);\n\n $data = [];\n\n //example: from message and send back to client\n foreach ($client as $k => $v) {\n foreach ($msg as $key => $value) {\n $data[$k]['sock'] = $v;\n $data[$k]['msg'] = $key !== $k ? $value['msg'] : 'OK! ' . count($client) . ' players are online waiting!';\n }\n }\n\n //Send data back and maintain clients\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "public function __construct()\n {\n Socket::$isServer = true;\n self::$server = new sockbase();\n self::$server->onmsg(__NAMESPACE__ . '\\SqlPool::inmsg');\n self::$server->dismsg(__NAMESPACE__ . '\\SqlPool::dis');\n $poolconf = ng169\\lib\\Option::get('pool');\n self::$pwd = $poolconf['pwd'];\n\n self::$server->start($poolconf['ip'], $poolconf['port']);\n\n // self::$server->start(\"127.0.0.1\", \"4563\");\n }" ]
[ "0.66744286", "0.66344595", "0.6532833", "0.6388822", "0.62629676", "0.6219293", "0.62053305", "0.60998553", "0.6059594", "0.6051707", "0.6030889", "0.5921175", "0.5849558", "0.5837673", "0.58367616", "0.5802052", "0.5749525", "0.57254183", "0.5706855", "0.5681658", "0.56767297", "0.56724197", "0.5617779", "0.56036973", "0.5544448", "0.5536868", "0.55252063", "0.5507769", "0.55021137", "0.5493826" ]
0.7015434
0
This method should be called to gracefully shut down the server.
protected static function shutdown() { if (MHTTPD::$debug) {cecho("Shutting down the server ...\n");} MHTTPD::$running = false; // Close listener MHTTPD::closeSocket(MHTTPD::$listener); // Kill all running FCGI processes exec('taskkill /F /IM php-cgi.exe'); // Remove any active clients foreach ($this->clients as $client) { MHTTPD::removeClient($client); } // Flush any buffered logs MHTTPD_Logger::flushLogs(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {\n\t\t$this->stop();\n\t}", "public function shutdown();", "public function shutdown();", "public function shutdown() {\r\n\t\tif($this->status == 'running') {\r\n\t\t\toutput('Shutting Down Blossom Server');\r\n\t\t\t$this->status = 'shutdown';\r\n\t\t\t$this->start_shutdown_time = time();\r\n\t\t\r\n\t\t\tforeach ($this->socket_array as $socket) {\r\n\t\t\t\tif(!$socket->live_past_shutdown) {\r\n\t\t\t\t\t$socket->trigger_remove();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->set_interval($this, 'check_shutdown', 1);\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function stop(): void\n {\n $server = $this->createServer();\n\n // Check if it has started\n if (!$server->isRunning()) {\n output()->writeln('<error>The server is not running! cannot stop.</error>');\n return;\n }\n\n // Do stopping.\n $server->stop();\n }", "private function stopServer() {\n\t\t$this->socketSend('shutdown');\n\t\tforeach($this->pipes as $pipe) {\n\t\t\tfclose($pipe);\n\t\t}\n\t\tproc_close($this->server);\n\t}", "public function shutdown() {\n\t\t\t//\n\t\t}", "public function shutdown()\n {\n }", "public function shutdown()\n {\n }", "public function shutdown()\r\n {\r\n }", "abstract public function shutdown();", "protected function shutdown()\n {\n }", "public function shutdown()\n {\n \n }", "public function shutdown()\n {\n // do nothing here\n }", "abstract function shutdown();", "public function shutdown()\n {\n // Do nothing. Can be overridden by extending classes.\n }", "public function shutdown(){\r\n\r\n\t}", "public function shutdown()\n\t{\n\t\t$this->shutdown = true;\n\t\t$this->logger->log(LogLevel::NOTICE, 'Shutting down');\n\t}", "public function shutdown ()\n {\n $this->_signalAllWorkers(SIGKILL);\n \n $this->_logger->info('Exiting...');\n $this->_shutdown = true;\n \n exit(1);\n }", "function shutdown()\n {\n }", "abstract function shutdown ();", "abstract function shutdown ();", "public function shutdown(): void\n {\n $this->handleOnShutDownListeners();\n }", "public function shutdown(): void\n {\n $this->handleOnShutDownListeners();\n }", "static function shutdown()\n\t{\n\t\tif (!empty(self::$channel))\n\t\t{\n\t\t\tself::$channel->close();\n\t\t\tself::$channel = null;\n\t\t}\n\n\t\tif (!empty(self::$connection))\n\t\t{\n\t\t\tself::$connection->close();\n\t\t\tself::$connection = null;\n\t\t}\n\t}" ]
[ "0.78425866", "0.78425866", "0.78425866", "0.78425866", "0.78425866", "0.7825372", "0.7802271", "0.7802271", "0.76985943", "0.75290066", "0.7504021", "0.74799824", "0.7451315", "0.744412", "0.741093", "0.73860574", "0.7334429", "0.7305934", "0.7255227", "0.71839285", "0.71667624", "0.7078299", "0.70675915", "0.70256454", "0.6976372", "0.6960874", "0.6960874", "0.68787545", "0.68787545", "0.68703973" ]
0.8219987
0
Launches the default browser in the background and navigates to the default index page (after a brief delay). rundll32.exe/url.dll is called here using WScript over the other options due to its generally more reliable performance ('start $url' produces an annoying error popup if the browser isn't already open).
protected static function launchBrowser() { if (MHTTPD::$config['Other']['browser_autolaunch']) { $url = MHTTPD::$config['SSL']['enabled'] ? 'https://' : 'http://'; $url .= MHTTPD::$config['Server']['address'].':'.MHTTPD::$config['Server']['port'].'/'; $cmd = 'cmd.exe /C start /B /WAIT PING 127.0.0.1 -n 3 -w 1000 >NUL ' .'& start /B rundll32.exe url.dll,FileProtocolHandler '.$url; $wshShell = new COM('WScript.Shell'); $wshShell->Run($cmd, 0, false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function openBrowser($url, SymfonyStyle $io) {\n $is_windows = defined('PHP_WINDOWS_VERSION_BUILD');\n if ($is_windows) {\n // Handle escaping ourselves.\n $cmd = 'start \"web\" \"' . $url . '\"\"';\n }\n else {\n $url = escapeshellarg($url);\n }\n\n $is_linux = Process::fromShellCommandline('which xdg-open')->run();\n $is_osx = Process::fromShellCommandline('which open')->run();\n if ($is_linux === 0) {\n $cmd = 'xdg-open ' . $url;\n }\n elseif ($is_osx === 0) {\n $cmd = 'open ' . $url;\n }\n\n if (empty($cmd)) {\n $io->getErrorStyle()\n ->error('No suitable browser opening command found, open yourself: ' . $url);\n return;\n }\n\n if ($io->isVerbose()) {\n $io->writeln(\"<info>Browser command:</info> $cmd\");\n }\n\n // Need to escape double quotes in the command so the PHP will work.\n $cmd = str_replace('\"', '\\\"', $cmd);\n // Sleep for 2 seconds before opening the browser. This allows the command\n // to start up the PHP built-in webserver in the meantime. We use a\n // PhpProcess so that Windows powershell users also get a browser opened\n // for them.\n $php = \"<?php sleep(2); passthru(\\\"$cmd\\\"); ?>\";\n $process = new PhpProcess($php);\n $process->start();\n }", "public function launchApp()\n {\n if ($this->findAppPort()) {\n return;\n }\n\n exec('open ' . self::APP_LAUNCH_URL);\n\n while (!$this->findAppPort()) {\n sleep(2);\n }\n }", "public function testOpenBrowser()\n\t{\n\t\t$this->url('/');//The test page has only phpinfo(); as HTML content\n\t\t$content = $this->byTag('body')->text();\n\t\t// $this->assertEquals('PHP Version 5.6.20-1+deb.sury.org~trusty+1', $content);\n\t\t$this->assertContains('PHP Version 5.6.20-1+deb.sury.org~trusty+1', $content);\n\n\t\t//Simulating and ajax call\n\t\t//Will loop on the callback for 2 seconds before continuing scripts below\n\t\t// $this->timeouts()->implicitWait(300); //milliseconds\n\t\t$this->waitUntil(function(){\n\t\t\ttry{\n\t\t\t\t// $webdriver->byId('rootElement');//select by id\n\t\t\t\t$this->byCssSelector('h1.p');//select by css\n\n\t\t\t\treturn true;\n\t\t\t}catch (Exception $ex){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}, 2000);//2 seconds\n\t\t//This is run after the waitUntil finished in 2 seconds\n\t\t$content = $this->byCssSelector('h1.p')->text();\n\t\t$this->assertEquals('PHP Version 5.6.20-1+deb.sury.org~trusty+1', $content);\n\n\t}", "function invokeDefaultPage() {\r\n require(\"controllers/IndexController.php\");\r\n $controller = new IndexController();\r\n $controller->index();\r\n }", "protected function openInNewWindow() {}", "function go($url){\n\theader(\"Location: \".$url);\n\texit();\n}", "public function invoke()\r\n\t{\r\n\t\tif(isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$pageName = $_GET['page'];\r\n\t\t\t$this->loadPage($pageName);\r\n\t\t}\r\n\t\telseif(!isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$this->loadPage('home');\r\n\t\t}\r\n\t}", "public function go($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function launch()\n {\n global $interface;\n global $configArray;\n\n if (isset($_POST['submit'])) {\n $process = $this->_processSubmit();\n }\n\n // Display Page\n if (isset($_GET['lightbox'])) {\n return $this->_processLightbox();\n } else {\n $this->_processNonLightbox();\n }\n }", "public static function goToHome(){\n $protocol = stripos($_SERVER['SERVER_PROTOCOL'],'https') === true ? 'https://' : 'http://';\n $host = $_SERVER['HTTP_HOST'];\n $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n header(\"Location: $protocol$host$uri\");\n \n die();\n }", "static function goToURL($url) {\n header('Location: ' . $url);\n }", "function redirect ($url)\n{\n\t// Behave as per HTTP/1.1 spec for cool webservers\n\theader('Location: ' . $url);\n\n\t// Redirect via an HTML form for un-cool webservers\n\tprint(\n\t\t'<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">'\n\t\t. '<html>'\n\t\t\t. '<head>'\n\t\t\t\t. '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">'\n\t\t\t\t. '<meta http-equiv=\"refresh\" content=\"0; url=' . $url . '\">'\n\t\t\t\t. '<title>Redirecting...</title>'\n\t\t\t. '</head>'\n\t\t\t. '<body>'\n\t\t\t\t. 'If you are not redirected in 5 seconds, please click <a href=\"' . $url . '\">here</a>.'\n\t\t\t. '</body>'\n\t\t. '</html>'\n\t);\n\t\n\t// Exit\n\texit;\n}", "public function index()\n\t{\n\t\tredirect(base_url(\"index.php\"));\n\t}", "function goToSite() {\n header('Location: index.php?action=start-app');\n\n}", "public function start()\n {\n $this->unvisitedUrl[] = $this->baseUrl;\n $counter = count($this->unvisitedUrl);\n\n while (($counter > 0) && ($url = array_shift($this->unvisitedUrl))) {\n $this->crawl($url);\n\n $counter = count($this->unvisitedUrl);\n }\n }", "function run_background() {\n\t\t$url = $this->dobj->db_fetch($this->dobj->db_query(\"SELECT background_id, url FROM backgrounds WHERE running='f' AND complete IS NULL ORDER BY background_id LIMIT 1\"));\n\t\tif ($url) {\n\t\t\t/* Mark the background as running */\n\t\t\t$data = array();\n\t\t\t$data['running'] = \"t\";\n\t\t\t$save = $this->dobj->db_query($this->dobj->update($data, \"background_id\", $url['background_id'], \"backgrounds\"));\n\t\t\t\n\t\t\t$newurl = explode(\"/\", $url['url']);\n\t\t\t$this->set_this($newurl);\n\t\t\t$_REQUEST['url'] = $url['url'];\n\t\t\t$res = $this->call_function($this->module, \"view_\".$this->action);\n\n\t\t\t$data = array();\n\t\t\t$data['running'] = \"f\";\n\t\t\t$data['complete'] = \"now()\";\n\t\t\t$data['results'] = $res[$this->module]->data;\n\t\t\t$save = $this->dobj->db_query($this->dobj->update($data, \"background_id\", $url['background_id'], \"backgrounds\"));\n\t\t}\n\t\treturn $res;\n\t}", "function ltiLaunchCheck() {\n global $CFG, $PDO;\n if ( ! ltiIsRequest() ) return false;\n $session_id = ltiSetupSession($PDO);\n if ( $session_id === false ) return false;\n\n // Redirect back to ourselves...\n $url = curPageURL();\n $query = false;\n if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) {\n $query = true;\n $url .= '?' . $_SERVER['QUERY_STRING'];\n }\n\n $location = sessionize($url);\n session_write_close(); // To avoid any race conditions...\n\n if ( headers_sent() ) {\n echo('<p><a href=\"'.$url.'\">Click to continue</a></p>');\n } else { \n header('Location: '.$location);\n }\n exit();\n}", "function httpd_start()\n {\n\n // Load dependencies\n //------------------\n\n $this->load->library('web_server/Httpd');\n\n try {\n $this->httpd->set_running_state(TRUE);\n $this->httpd->set_boot_state(TRUE);\n if ($this->httpd->get_running_state() != TRUE)\n $this->page->set_message(lang('wpad_unable_start_httpd'), 'warning');\n } catch (Exception $e) {\n $this->page->set_message(clearos_exception_message($e), 'warning');\n }\n\n redirect('wpad');\n }", "public function run()\n {\n $this->browser->open($_ENV['app_frontend_url'] . $this->product->getUrlKey() . '.html');\n }", "function javascript($page,$timeout=null) {\n \n $mytimeout=$timeout?$timeout:100;\n \n $ret = \"\nfunction neu()\n{\t\n\ttop.frames.location.href = \\\"$page\\\"\n}\nwindow.setTimeout(\\\"neu()\\\",$mytimeout);\n\";\n\t \n\t return ($ret);\n }", "public function showMeHtmlPageInBrowser() {\n\n $html_data = $this->getSession()->getDriver()->getContent();\n $file_and_path = '/tmp/behat_page.html';\n file_put_contents($file_and_path, $html_data);\n\n if (PHP_OS === \"Darwin\" && PHP_SAPI === \"cli\") {\n exec('open -a \"Safari.app\" ' . $file_and_path);\n };\n }", "function refreshPage($tiempo,$url)\n{\n print \"<META HTTP-EQUIV=\\\"Refresh\\\" CONTENT=\\\"$tiempo; URL=$url\\\">\";\n if($tiempo==0)\n exit();\n}", "public function index()\n {\n $this->locate(inlink('browse'));\n }", "public function index()\n {\n $this->locate(inlink('browse'));\n }", "public function openUrlWindow($url, $options = 'chrome') {\n $this->callMethod( 'openUrlWindow', array($url, $options) );\n }", "public function goHome()\n {\n $this->redirect(url($this->getHomeUrl()));\n }", "public function Run ($singleFileUrl = FALSE);", "function redirect($url=null)\n\t{\n\t\tif (is_null($url))\n\t\t\t$url = $_SERVER['PHP_SELF'];\n\t\theader(\"Location: $url\");\n\t\texit();\n\t}", "function redirect_to($url = 'index.php')\n\t{\n\t\t$redirect = 'location: ' . $url;\n\t\theader($redirect);\n\t\t\n\t\tdie(); /*halt the execution*/\n\t}", "public function gotoUrlAndExit($url, array $options = [])\n {\n $this->setGotoUrl($url, $options);\n $this->redirectAndExit();\n }" ]
[ "0.6087888", "0.56739134", "0.5212936", "0.5155909", "0.5042084", "0.49425703", "0.4905557", "0.48766857", "0.48760805", "0.48596776", "0.48519766", "0.48236823", "0.48012367", "0.47742614", "0.47495607", "0.47486478", "0.47334105", "0.4711", "0.4704783", "0.47029334", "0.469127", "0.46807644", "0.46801585", "0.46801585", "0.46647546", "0.46524498", "0.46502113", "0.46499926", "0.46362582", "0.4635792" ]
0.7576014
0
Runs the main server loop. This is where the server does most if its work. Once the listening socket is established, iterations of the the main loop are controlled entirely by stream_select() for both client connections and FCGI requests as well as any open file streams. Each loop should ideally finish as quickly as possible to enable best concurrency.
protected static function main() { // Create a TCP/SSL server socket context $context = MHTTPD::getContext(); // Start the listener MHTTPD::createListener($context); // Initialize some handy vars $timeout = ini_get('default_socket_timeout'); $maxClients = MHTTPD::$config['Server']['max_clients']; $maxHeaderBlockSize = MHTTPD_Message::getMaxHeaderBlockSize(); if (MHTTPD::$debug) { $listener_name = stream_socket_get_name(MHTTPD::$listener, false); } // Start the browser MHTTPD::launchBrowser(); // The main loop while (MHTTPD::$running) { // Build a list of active streams to monitor $read = array('listener' => MHTTPD::$listener); foreach (MHTTPD::$clients as $i=>$client) { // Add any client sockets if ($csock = $client->getSocket()) { $read["client_$i"] = $csock; // Add any client FCGI sockets if ($cfsock = $client->getFCGISocket()) { $read["clfcgi_$i"] = $cfsock; } // Add any client file streams if ($client->isStreaming()) { $read["clstrm_$i"] = $client->getStream(); } } } // Add any aborted FCGI requests foreach (MHTTPD::$aborted as $aID=>$ab) { $read['aborted_'.$aID.'_'.$ab['client'].'_'.$ab['pid']] = $ab['socket']; } if (MHTTPD::$debug) { cecho("FCGI scoreboard:\n"); cprint_r(MFCGI::getScoreboard(true)); cecho("\n"); cecho("Pre-select:\n"); cprint_r($read); cecho(chrule()."\n>>>> Waiting for server activity ($listener_name)\n".chrule()."\n\n"); } // Wait for any new activity if (!($ready = @stream_select($read, $write=null, $error=null, null))) { trigger_error("Could not select streams", E_USER_WARNING); } if (MHTTPD::$debug) {cecho("Post-select:\n"); cprint_r($read);} // Check if the listener has a new client connection if (in_array(MHTTPD::$listener, $read)) { // Search for a free slot to add the new client for ($i = 1; $i <= $maxClients; $i++) { if (!isset(MHTTPD::$clients[$i])) { // This slot is free, so add the new client connection if (MHTTPD::$debug) {cecho("New client ($i): ");} if (!($sock = @stream_socket_accept(MHTTPD::$listener, $timeout, $peername))) { if (MHTTPD::$debug) {cecho("\nCould not accept client stream\n");} break; } if (MHTTPD::$debug) {cecho("$peername\n");} $client = new MHTTPD_Client($i, $sock, $peername); $client->debug = MHTTPD::$debug; MHTTPD::$clients[$i] = $client; break; } elseif ($i == $maxClients) { // No free slots, so the request goes to the backlog if (MHTTPD::$debug) {cecho("No free client slots!\n");} trigger_error("Too many clients", E_USER_NOTICE); } } // Return to waiting if only the listener is active if ($ready == 1) { if (MHTTPD::$debug) {cecho("No other connections to handle\n\n");} continue; } } // Handle any incoming client data on selected sockets foreach (MHTTPD::$clients as $i=>$client) { if (MHTTPD::$debug) {cecho("Client ($i) ... ");} $csock = $client->getSocket(); // Handle any new client requests if ($client->isReady() && $csock && in_array($csock, $read)) { // Start reading the request if (MHTTPD::$debug) {cecho("reading ... ");} $client->setTimeout(10); $input = ''; // Get the request header block only while ($buffer = @fgets($csock, 1024)) { $input .= $buffer; if ($buffer == '' || substr($input, -4) == "\r\n\r\n" || strlen($input) > $maxHeaderBlockSize ) { break; } } if ($input) { // Store the headers and process the request if (MHTTPD::$debug) {cecho("done\n");} $client->setInput(trim($input)); if (!$client->processRequest() && !$client->needsAuthorization()) { MHTTPD::removeClient($client); } } else { // No request data, client is disconnecting if (MHTTPD::$debug) {cecho("disconnected\n");} MHTTPD::removeClient($client); continue; } // Handle any request body data } elseif ($client->isPosting() && $csock && in_array($csock, $read)) { if (MHTTPD::$debug) {cecho("reading body ");} $client->readRequestBody(); // Handle any disconnects or malformed requests } elseif ($csock && in_array($csock, $read)) { if (MHTTPD::$debug) {cecho("aborted connection\n");} MHTTPD::removeClient($client); continue; // Handle any inactive client connections } else { if (MHTTPD::$debug) { cecho('inactive ('); cecho('req:'.$client->hasRequest()); cecho(' resp:'.$client->hasResponse()); cecho(' fcgi:'.$client->hasFCGI()); cecho(")\n"); } } // Handle any incoming FCGI responses if (($clfsock = $client->getFCGISocket()) && in_array($clfsock, $read)) { if (MHTTPD::$debug) {cecho("Client ($i) ... reading FCGI socket: {$clfsock}\n");} if (!$client->readFCGIResponse()) { MHTTPD::removeClient($client); // abort any hanging connections } } } // Handle any outgoing FCGI requests foreach (MHTTPD::$clients as $i=>$client) { if ($client->hasFCGI() && !$client->hasSentFCGI() && (!$client->isPosting() || $client->hasFullRequestBuffer()) ) { if (MHTTPD::$debug){cecho("Client ($i) ... sending FCGI request\n");} if (!$client->sendFCGIRequest()) { MHTTPD::removeClient($client); // abort any failed connections } } } // Handle any outgoing client responses foreach (MHTTPD::$clients as $i=>$client) { if ($client->hasRequest()) { if (!$client->isPosting() && $client->hasSentFCGI() && !$client->hasResponse()) { if (MHTTPD::$debug){cecho("Client ($i) ... waiting for FCGI response\n");} continue; } elseif ($client->needsAuthorization()) { if (MHTTPD::$debug){cecho("Client ($i) ... waiting for authorization\n");} continue; } elseif ($client->hasResponse()) { if (MHTTPD::$debug) {cecho("Client ($i) ... handling response\n");} MHTTPD::handleResponse($client); } } } // Handle any aborted FCGI requests foreach ($read as $r) { foreach (MHTTPD::$aborted as $aID=>$ab) { if ($r == $ab['socket']) { MFCGI::removeClient($ab['process']); MHTTPD::closeSocket($r); unset(MHTTPD::$aborted[$aID]); } } } // End of main loop if (MHTTPD::$debug) {cecho("\n");} } // Quit the server cleanly MHTTPD::shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run() {\n while ($this->running) {\n $read = $this->readStreams;\n $write = $this->writeStreams;\n $except = null;\n\n if ($read || $write) {\n @stream_select($read, $write, $except, 0, 100);\n\n foreach ($read as $stream) {\n $this->readHandlers[(int) $stream]($stream);\n }\n\n foreach ($write as $stream) {\n $this->writeHandlers[(int) $stream]($stream);\n }\n } else {\n usleep(100);\n }\n }\n }", "public function run() \n\t{\n\t\twhile( true ) \n\t\t{\n\t\t\tif ( empty($this->sockets) )\n\t\t\t\t$this->sockets['m'] = $this->master;\n\n\t\t\t$read = $this->sockets;\n\t\t\t$write = $except = null;\n\n\t\t\t$this->_tick();\n\t\t\t$this->tick();\n\n\t\t\t@socket_select($read, $write, $except, 1);\n\n\t\t\tforeach ( $read as $socket ) \n\t\t\t{\n\t\t\t\tif ( $socket == $this->master ) \n\t\t\t\t{\n\t\t\t\t\t$client = socket_accept($socket);\n\n\t\t\t\t\tif ( $client < 0 ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->stderr(\"Failed: socket_accept()\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->connect($client);\n\t\t\t\t\t\t$this->stdout(\"Client connected. \" . $client);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$numBytes = @socket_recv($socket, $buffer, $this->maxBufferSize, 0);\n\n\t\t\t\t\tif ( $numBytes === false ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$sockErrNo = socket_last_error($socket);\n\n\t\t\t\t\t\tswitch ($sockErrNo)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 102: // ENETRESET-- Network dropped connection because of reset\n\t\t\t\t\t\t\tcase 103: // ECONNABORTED -- Software caused connection abort\n\t\t\t\t\t\t\tcase 104: // ECONNRESET -- Connection reset by peer\n\t\t\t\t\t\t\tcase 108: // ESHUTDOWN-- Cannot send after transport endpoint shutdown -- probably more of an error on our part, if we're trying to write after the socket is closed.Probably not a critical error, though.\n\t\t\t\t\t\t\tcase 110: // ETIMEDOUT-- Connection timed out\n\t\t\t\t\t\t\tcase 111: // ECONNREFUSED -- Connection refused -- We shouldn't see this one, since we're listening... Still not a critical error.\n\t\t\t\t\t\t\tcase 112: // EHOSTDOWN-- Host is down -- Again, we shouldn't see this, and again, not critical because it's just one connection and we still want to listen to/for others.\n\t\t\t\t\t\t\tcase 113: // EHOSTUNREACH -- No route to host\n\t\t\t\t\t\t\tcase 121: // EREMOTEIO-- Rempte I/O error -- Their hard drive just blew up.\n\t\t\t\t\t\t\tcase 125: // ECANCELED-- Operation canceled\n\t\t\t\t\t\t\t\t$this->stderr(\"Unusual disconnect on socket \" . $socket);\n\t\t\t\t\t\t\t\t$this->disconnect($socket, true, $sockErrNo); // disconnect before clearing error, in case someone with their own implementation wants to check for error conditions on the socket.\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->stderr('Socket error: ' . socket_strerror($sockErrNo));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telseif ( $numBytes == 0 ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->disconnect($socket);\n\t\t\t\t\t\t$this->stderr(\"Client disconnected. TCP connection lost: \" . $socket);\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$user = $this->getUserBySocket($socket);\n\n\t\t\t\t\t\tif ( !$user->handshake ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tmp = str_replace(\"\\r\", '', $buffer);\n\n\t\t\t\t\t\t\tif (strpos($tmp, \"\\n\\n\") === false ) \n\t\t\t\t\t\t\t\tcontinue; // If the client has not finished sending the header, then wait before sending our upgrade response.\n\n\t\t\t\t\t\t\t$this->doHandshake($user, $buffer);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//split packet into frame and send it to deframe\n\t\t\t\t\t\t\t$this->split_packet($numBytes, $buffer, $user);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function server_loop($address, $port)\n{\n GLOBAL $fh;\n GLOBAL $__server_listening;\n\t\n\t//printLog($fh, \"server_looping...\");\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n\t\t//printLog($fh, \"failed to create socket: \".socket_strerror($sock));\n exit();\n }\n\n\tif(($ret = socket_bind($sock, $address, $port)) < 0)\n\t{\n\t\t//printLog($fh, \"failed to bind socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tif( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n\t{\n\t\t//printLog($fh, \"failed to listen to socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tsocket_set_nonblock($sock);\n\n\t//printLog($fh, \"waiting for clients to connect...\");\n\n\twhile ($__server_listening)\n\t{\n\t\t$connection = @socket_accept($sock);\n\t\tif ($connection === false)\n\t\t{\n\t\t\tusleep(100);\n\t\t} elseif ($connection > 0) {\n\t\t\thandle_client($sock, $connection);\n\t\t} else {\n\t\t\t//printLog($fh, \"error: \".socket_strerror($connection));\n\t\t\tdie;\n\t\t}\n\t}\n}", "public function run() {\n $read = array (\n 0 => $this->socket\n );\n\n foreach($this->clients as $client)\n $read[] = $client->socket;\n\n $result = @ socket_select($read, $write = null, $except = null, $this->blocking ? null : 1);\n if ($result === false || ($result === 0 && $this->blocking)) {\n $this->error('Socket Select Interruption: ' . socket_strerror(socket_last_error()));\n return false;\n }\n\n // If the master socket is in the $read array, there's a pending connection\n if (in_array($this->socket, $read))\n $this->connect();\n\n // Handle input from sockets in the $read array.\n $daemon = $this->daemon;\n $printer = function($str) use ($daemon) {\n $daemon->log($str, 'SocketServer');\n };\n\n foreach($this->clients as $slot => $client) {\n if (!in_array($client->socket, $read))\n continue;\n\n $input = socket_read($client->socket, $this->max_read);\n if ($input === null) {\n $this->disconnect($slot);\n continue;\n }\n\n $this->command($input, array($client->write, $printer));\n }\n }", "function server_loop($address, $port)\n{\n GLOBAL $__server_listening;\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n echo \"failed to create socket: \".socket_strerror($sock).\"\\n\";\n exit();\n }\n\n if(($ret = socket_bind($sock, $address, $port)) < 0)\n {\n echo \"failed to bind socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n if( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n {\n echo \"failed to listen to socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n socket_set_nonblock($sock);\n \n echo \"waiting for clients to connect\\n\";\n\n while ($__server_listening)\n {\n $connection = @socket_accept($sock);\n if ($connection === false)\n {\n usleep(100);\n }elseif ($connection > 0)\n {\n handle_client($sock, $connection);\n }else\n {\n echo \"error: \".socket_strerror($connection);\n die;\n }\n }\n}", "public function run()\n {\n while(true)\n {\n $changed_sockets = $this->allsockets;\n $write = null;\n $except = null;\n @stream_select($changed_sockets, $write, $except, 0, 5000); \n foreach($changed_sockets as $socket)\n {\n if($socket == $this->master)\n {\n if(($ressource = stream_socket_accept($this->master)) === false)\n {\n $this->log('Socket error: ' . socket_strerror(socket_last_error($ressource)));\n continue;\n }\n else\n {\n $client = $this->createConnection($ressource);\n $this->clients[(int)$ressource] = $client;\n $this->allsockets[] = $ressource;\n \n if(count($this->clients) > $this->_maxClients)\n {\n $this->log('Attention: Client Limit Reached!');\n $client->onDisconnect();\n if($this->getApplication('status') !== false)\n {\n $this->getApplication('status')->statusMsg('Attention: Client Limit Reached!', 'warning');\n }\n continue;\n }\n \n $this->_addIpToStorage($client->getClientIp());\n if($this->_checkMaxConnectionsPerIp($client->getClientIp()) === false)\n {\n $this->log('Connection/Ip limit for ip ' . $client->getClientIp() . ' was reached!');\n $client->onDisconnect();\n if($this->getApplication('status') !== false)\n {\n $this->getApplication('status')->statusMsg('Connection/Ip limit for ip ' . $client->getClientIp() . ' was reached!', 'warning');\n }\n continue;\n } \n }\n }\n else\n { \n $client = $this->clients[(int)$socket];\n if(!is_object($client))\n {\n unset($this->clients[(int)$socket]);\n continue;\n }\n $data = $this->readBuffer($socket); \n $bytes = strlen($data);\n \n if($bytes === 0)\n {\n $client->onDisconnect(); \n continue;\n }\n elseif($data === false)\n {\n $this->removeClientOnError($client);\n continue;\n }\n elseif($client->waitingForData === false && $this->_checkRequestLimit($client->getClientId()) === false)\n {\n $client->onDisconnect();\n }\n else\n { \n $client->onData($data);\n }\n }\n }\n }\n }", "public function run()\n {\n $this->init();\n\n while (true) {\n $this->processControl->checkForSignals();\n $this->checkOnConsumers();\n\n usleep(self::LOOP_PAUSE);\n }\n }", "function serve($cb) {\n\t$offset = rand(0,2000);\n\tforeach (range(40000+$offset, 50000+$offset) as $port) {\n\t\tlogger(\"serve: Trying port %d\", $port);\n\t\tif (($server = @stream_socket_server(\"tcp://localhost:$port\"))) {\n\t\t\tfprintf(STDERR, \"%s\\n\", $port);\n\t\t\tlogger(\"serve: Using port %d\", $port);\n\t\t\tdo {\n\t\t\t\t$R = array($server); $W = array(); $E = array();\n\t\t\t\t$select = stream_select($R, $E, $E, 10, 0);\n\t\t\t\tif ($select && ($client = stream_socket_accept($server, 1))) {\n\t\t\t\t\tlogger(\"serve: Accept client %d\", (int) $client);\n\t\t\t\t\tif (getenv(\"PHP_HTTP_TEST_SSL\")) {\n\t\t\t\t\t\tstream_socket_enable_crypto($client, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$R = array($client);\n\t\t\t\t\t\twhile (!feof($client) && stream_select($R, $W, $E, 1, 0)) {\n\t\t\t\t\t\t\tlogger(\"serve: Handle client %d\", (int) $client);\n\t\t\t\t\t\t\t$cb($client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger(\"serve: EOF/timeout on client %d\", (int) $client);\n\t\t\t\t\t} catch (Exception $ex) {\n\t\t\t\t\t\tlogger(\"serve: Exception on client %d: %s\", (int) $client, $ex->getMessage());\n\t\t\t\t\t\t/* ignore disconnect */\n\t\t\t\t\t\tif ($ex->getMessage() !== \"Empty message received from stream\") {\n\t\t\t\t\t\t\tfprintf(STDERR, \"%s\\n\", $ex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while ($select);\n\t\t\treturn;\n\t\t}\n\t}\n}", "public function run()\n {\n $this->server->start();\n }", "public function run()\n {\n $port = (int) CommandLine::getInput('p');\n\n if (!$port) {\n die('You must specify a valid port for the socket server. For example: \"-p=1024\"');\n }\n\n $server = new SocketServer('127.0.0.1', $port);\n\n // Set greetings for the new connection\n $server->greetings(\"\\nHi! Just type your brackets sequence and you will see the result\\n\");\n\n // Set handler of the incoming messages\n $server->setMessageHandler($this->messageHandler);\n\n // Start up the server\n $server->run();\n }", "protected function run()\n {\n while (true)\n {\n $changedSockets = $this->sockets;\n\n $write = $except = $tv = $tvu = null;\n\n $result = socket_select($changedSockets, $write, $except, $tv, $tvu);\n\n if ($result === false)\n {\n socket_close($this->socket);\n\n $error = static::getLastError($this->socket);\n\n throw new Exception('Checking for changed sockets failed: ' . $error->message . ' [' . $error->code . ']');\n }\n\n foreach ($changedSockets as $socket)\n {\n if ($socket == $this->socket)\n {\n $newSocket = socket_accept($this->socket);\n\n if ($newSocket !== false)\n {\n $this->connectClient($newSocket);\n }\n else\n {\n $error = static::getLastError($this->socket);\n\n trigger_error('Failed to accept incoming client: ' . $error->message . ' [' . $error->code . ']', E_USER_WARNING);\n }\n }\n else\n {\n $client = $this->getClientBySocket($socket);\n\n if (!isset($client))\n {\n trigger_error('Failed to match given socket to client', E_USER_WARNING);\n\n socket_close($socket);\n\n continue;\n }\n\n $buffer = '';\n $message = '';\n\n $bytes = @socket_recv($socket, $buffer, 4096, 0);\n\n if ($bytes === false)\n {\n $error = static::getLastError($this->socket);\n\n trigger_error('Failed to receive data from client #' . $client->id . ': ' . $error->message . ' [' . $error->code . ']', E_USER_WARNING);\n\n $this->disconnectClient($client->socket);\n\n continue;\n }\n\n $len = ord($buffer[1]) & 127;\n\n $masks = null;\n $data = null;\n\n if ($len === 126)\n {\n $masks = substr($buffer, 4, 4);\n $data = substr($buffer, 8);\n }\n else if ($len === 127)\n {\n $masks = substr($buffer, 10, 4);\n $data = substr($buffer, 14);\n }\n else\n {\n $masks = substr($buffer, 2, 4);\n $data = substr($buffer, 6);\n }\n\n for ($index = 0; $index < strlen($data); $index++)\n {\n $message .= $data[$index] ^ $masks[$index % 4];\n }\n\n if ($bytes == 0)\n {\n $this->disconnectClient($socket);\n }\n else\n {\n if ($client->state == WebSocketClient::STATE_OPEN)\n {\n $client->lastRecieveTime = time();\n\n $this->debug('Received from socket #' . $client->id . ': ' . $message);\n\n $this->onMessageRecieved($client, $message);\n }\n else if ($client->state == WebSocketClient::STATE_CONNECTING)\n {\n $client->performHandshake($buffer);\n }\n }\n }\n }\n }\n }", "public function run():void\n\t{\n\t\t$this->ensureUnclosed();\n\t\t\n\t\tif( $this->_status === self::STATUSES['RUNNING'] )\n\t\t\treturn;\n\t\t\n\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\n\t\t$this->_loop();\n\t\t\n\t\t$this->_status= self::STATUSES['DONE'];\n\t}", "public function run()\n {\n if ($this->connect()) {\n $this->login();\n $this->join();\n $this->listen();\n }\n }", "protected function listen()\n {\n do {\n $data = fgets($this->socket, 512);\n if (!empty($data)) {\n $request = $this->receive($data);\n $cmd = strtolower($request->getCommand());\n\n if ($cmd === 'privmsg') {\n $event_name = 'message.' . ($request->isPrivateMessage() ? 'private' : 'channel');\n } else {\n $event_name = 'server.' . $cmd;\n }\n\n // Skip processing if the incoming message is from the bot\n if ($request->getSendingUser() === $this->config['nick']) {\n continue;\n }\n\n $event = new Event($request);\n $this->dispatcher->dispatch($event_name, $event);\n $responses = $event->getResponses();\n\n if (!empty($responses)) {\n $this->send($responses);\n }\n }\n } while (!feof($this->socket));\n }", "public function run()\n {\n $serv = new \\swoole_server($this->host, $this->port);\n $serv->set(\n array(\n 'process_name' => 'ershoufang_crawler', //swoole 进程名称\n 'worker_num' => 2,//开启的worker进程数\n 'task_worker_num' => 2,//开启的task进程数\n 'open_cpu_affinity' => true,\n 'daemonize' => false,\n 'max_request' => 10000,\n 'dispatch_mode' => 2,\n 'debug_mode' => 0,\n 'log_file' => 'swoole.log',\n 'open_tcp_nodelay' => true,\n \"task_ipc_mode\" => 2,\n 'task_max_request' => 10000\n )\n );\n\n $serv->on('Start', array($this, 'onStart'));\n $serv->on('Connect', array($this, 'onConnect'));\n $serv->on('Receive', array($this, 'onReceive'));\n $serv->on('WorkerStart', array($this, 'onWorkerStart'));\n $serv->on('Task', array($this, 'onTask'));\n $serv->on('Finish', array($this, 'onFinish'));\n $serv->on('Close', array($this, 'onClose'));\n $serv->start();\n }", "public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function run(Closure $loopCallback = null): Server {\n $this->_stream->stop()\n ->start();\n\n $condition = ($loopCallback ?? function() {\n return true;\n });\n\n while ($condition($this)) {\n $timeout = empty($this->_messages) ? 1000 : 1;\n $message = $this->_stream->select($timeout);\n if ($message) {\n $this->_messages[] = $message;\n }\n\n foreach ($this->_messages as $key => $message) { /* @var $message IMessage */\n try {\n $message->notify();\n if ($message->isCompleted() || $message->isTimeoutReached()) {\n unset($this->_messages[$key]);\n $message->close();\n }\n } catch (Exception $e) {\n $this->_errors[] = $e;\n $message->close();\n unset($this->_messages[$key]);\n }\n }\n }\n\n return $this;\n }", "private function listenSocket() {\n $result = socket_listen($this->listeningSocket);\n $this->checkResult($result);\n }", "protected function listen()\n {\n // Set time limit to indefinite execution\n set_time_limit (0);\n\n $this->socket = socket_create(\n AF_INET,\n SOCK_DGRAM,\n SOL_UDP\n );\n\n if (!is_resource($this->socket))\n {\n $this->logger->log(\"Failed to create a socket for the discovery server. The reason was: \" .\n socket_strerror(socket_last_error()));\n }\n\n if (!@socket_bind(\n $this->socket,\n $this->config->getSetting('discovery-address'),\n $this->config->getSetting('discovery-port')))\n {\n $this->logger->log(\"Failed to bind to socket while initialising the discovery server.\");\n }\n\n // enter an infinite loop, waiting for data\n $data = '';\n while (true)\n {\n if (@socket_recv($this->socket, $data, 9999, MSG_WAITALL))\n {\n $this->logger->log(\"Discovery server received the following: $data\");\n\n $this->handleMessage($data);\n }\n }\n }", "protected function main()\r\n {\r\n // save incomming data and chop the leading white space\r\n $this->_raw = chop( fgets( $this->_conn ) );\r\n \r\n $this->debug( '<- ' . $this->_raw );\r\n \r\n $data = explode( ' ', $this->_raw );\r\n \r\n // first make sure we are connected and registered on the server\r\n if ( ! $this->_loggedOn )\r\n {\r\n // if not logged on, wait with processing events till we can login\r\n if ( strstr( $this->_raw, \"Found your hostname\" ) )\r\n {\r\n // save the servername so we can use it to identify server notices\r\n $this->_serverName = substr( $data[0], 1 );\r\n \r\n // start login\r\n $this->login();\r\n }\r\n }\r\n else\r\n {\r\n $this->observe( $data );\r\n }\r\n \r\n // if we are still connecting continue monitoring the data\r\n if ( ! feof( $this->_conn ) )\r\n {\r\n $this->main();\r\n }\r\n else\r\n {\r\n // we are disconnected so remove the socket\r\n unset( $this->_conn );\r\n \r\n // reconnect if required\r\n if ( $this->_autoReconnect )\r\n {\r\n $this->reconnect();\r\n }\r\n else\r\n {\r\n $this->log( \"Disconnected from server.\" );\r\n \r\n exit;\r\n }\r\n }\r\n }", "public function socketPerform() {\n \n //if (!$this->active) { requests added on runtime\n $this->initProcessing();\n //}\n $remaining = count($this->requests);\n if ($remaining > 0) {\n curl_multi_exec($this->mh, $running);\n \n $this->readAll();\n /* Remove timeout requests */\n $this->cleanupTimeoutedRequests();\n \n return $running > 0 or count($this->requests)>0;\n }\n return false;\n }", "public function run()\n {\n $this->openWorker();\n while (($payload = $this->pop(0)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n $this->closeWorker();\n }", "public function loop()\n\t{\n\t\t$time = time() + 3;\n\n\t\twhile ($time > time())\n\t\t{\n\t\t\t$read = $this->client->read();\n\n\t\t\tif ($read === NULL)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (Application::$security->get_action() == 'drop')\n\t\t\t\t{\n\t\t\t\t\tApplication::$log->warning('Connection dropped by security');\n\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\n\t\t\t\t$this->request->set_request($read);\n\t\t\t\t$this->request->process();\n\n\t\t\t\tif ($response = $this->request->get_response())\n\t\t\t\t{\n\t\t\t\t\t$this->client->send($response);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (\\Exception $e)\n\t\t\t{\n\t\t\t\t$this->client->send('Internal error! Please try again later.');\n\n\t\t\t\tthrow new RuntimeException($e->getMessage());\n\t\t\t}\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tApplication::$log->warning('Request is not readed from client socket');\n\n\t\treturn FALSE;\n\t}", "public function run()\n {\n $quit = false;\n while (!$quit)\n {\n \\Mutex::lock($this->thread_mutex);\n if (count($this->req_queue) == 0)\n {\n \\Cond::wait($this->thread_cond, $this->thread_mutex);\n if (count($this->req_queue) == 0)\n {\n \\Mutex::unlock($this->thread_mutex);\n continue;\n }\n }\n $reqs = array();\n while (count($this->req_queue) > 0 and count($reqs) < 10)\n {\n $m = $this->req_queue->shift();\n if ($m[0] == 'stop')\n {\n $quit = true;\n break;\n }\n $reqs[] = array($m[1], $m[2], $m[3], $m[4]);\n }\n \\Mutex::unlock($this->thread_mutex);\n if (count($reqs) > 0)\n $this->pubbatch($reqs);\n }\n }", "public function loop();", "public function run()\n {\n $this->bootGameState($this->container->get(GlobalGameState::class));\n /*\n * Main loop\n */\n while (!Window::shouldClose()) {\n // Track kernel state\n $this->iterating++;\n\n // Update Physics, then\n if ($this->getDeltaTime() > 1) {\n echo \"FPS: \" . Timming::getFPS() . PHP_EOL;\n $this->currentTime = time();\n }\n\n // ..actual physics process..\n $this->physicsProcess($this->getDeltaTime());\n\n // Update the Scene graphics, then\n Draw::begin();\n Draw::clearBackground(BasicColors::rayWhite());\n $this->process($this->getDeltaTime());\n Draw::end();\n\n // Receive the user input and act upon it, then\n // \"performance updates\" (AKA mem management and culling), then\n // update App state to verify user didn't quite or game crash. (Think this is implicit to raylib)\n }\n }", "private function execRunHandler()\n {\n // guarantee that only one process can be run at one time\n // use socket as lock\n Log::info('Try to start handling process...');\n\n // bounce\n $handlers = BounceHandler::get();\n Log::info(sizeof($handlers).' bounce handlers found');\n $count = 1;\n foreach ($handlers as $handler) {\n Log::info('Starting handler '.$handler->name.\" ($count/\".sizeof($handlers).')');\n $handler->start();\n Log::info('Finish processing handler '.$handler->name);\n $count += 1;\n }\n\n // abuse\n $handlers = FeedbackLoopHandler::get();\n Log::info(sizeof($handlers).' feedback loop handlers found');\n $count = 1;\n foreach ($handlers as $handler) {\n Log::info('Starting handler '.$handler->name.\" ($count/\".sizeof($handlers).')');\n $handler->start();\n Log::info('Finish processing handler '.$handler->name);\n $count += 1;\n }\n }", "public static function http_server(): void\n {\n sock::$type = 'http:server';\n sock::$host = '0.0.0.0';\n sock::$port = 80;\n $ok = sock::create();\n\n if (!$ok) exit('HTTP Server creation failed!');\n\n do {\n //IMPORTANT!!! Reset all data & read list & client list\n $data = $read = $client = [];\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read HTTP Request data\n $msg = sock::read($client);\n\n var_dump($msg);\n\n //Prepare simple data\n $key = key($client);\n $sock = current($client);\n\n $data[$key]['sock'] = $sock;\n\n $data[$key]['msg'] = 'Hello! I am a simple HTTP Server running under PHP~';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Your request message was: ';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= trim(current($msg)['msg']);\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Thanks for your test!';\n\n //Send to browser\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "public function run()\n {\n $timeout = $this->_options[self::OPT_TIMEOUT];\n Streamwide_Engine_Logger::info( 'Going to main loop' );\n \n for ( ; ; ) {\n // Fetch a new signal from the SW Engine's queue\n $signal = Streamwide_Engine_Signal::dequeue( array( 'timeout' => $timeout ) );\n if ( false === $signal ) {\n continue;\n }\n \n // Update the loggers event items\n Streamwide_Engine_Logger::updateLogEventItems( array( $signal->getPhpId() => $signal->getParams() ) );\n // Log the received signal\n Streamwide_Engine_Logger::dump( $signal->toArray(), 'Received event from SW Engine:' );\n \n if ( $signal->getName() === Streamwide_Engine_Signal::CREATE ) {\n // We have received a CREATE (new call), we need to create a new application to handle\n // the call\n if ( false === ( $application = $this->_createNewApplication( $signal ) ) ) {\n continue;\n }\n \n // Add the new application to the controller's running apps storage (will call\n // the application's start method)\n $this->addApp( $signal->getPhpId(), $application );\n } else {\n // We have received a signal from SW Engine, we need to notify the listeners\n $event = new Streamwide_Engine_Events_Event( $signal->getName() );\n $event->setParam( 'signal', $signal );\n $this->dispatchEvent( $event );\n }\n }\n }" ]
[ "0.7016053", "0.69488436", "0.69133306", "0.67089456", "0.6646561", "0.63550645", "0.61900896", "0.6105044", "0.6089636", "0.6083241", "0.594207", "0.5900055", "0.57835525", "0.5762794", "0.5738868", "0.56662667", "0.5645363", "0.5559845", "0.550113", "0.5467251", "0.5466518", "0.54644877", "0.5443199", "0.5416026", "0.53888947", "0.5383081", "0.5351932", "0.5341841", "0.5308041", "0.52664095" ]
0.7146619
0
create a collapsible menue by iterating throug items
function createCollapsibleMenue($items,$current,$key){ unset($items[$key ]); ?> <!-- Schreibe aktuellen Eintrag in collapsible Header --> <?php if ($current['collapsible']) { $collapsible = '<i class="material-icons right">keyboard_arrow_down</i>'; $link = ''; } else { $collapsible = ""; if($current['popup'] == 1) { $link = "href=\"#\" onClick=\"MM_openBrWindow('?type=".$current['type']."','','width=800,height=900,screenX=200,resizable=yes')\""; } else { $link = 'href="?type='.$current['type'].'"'; } } ?> <li> <div class="collapsible-header"> <a class="mdl-navigation__link orange-text btn-flat" <?php echo $link; ?> > <i class="material-icons left"><?php echo $current['icon']; ?></i> <?php echo $current['value']; ?> <?php echo $collapsible; ?> </a> </div> <!-- Prüfe ob zu diesem Einbtrag ein Submenue existiert --> <?php if ($current['collapsible']) { ?> <div class="collapsible-body" > <ul class="collapsible" data-collapsible="expandable"> <?php foreach ($items as $key => $value) { if ($value['navarea'] == $current['id']) { createCollapsibleMenue($items,$value,$key); } } ?> </ul> </div> <?php } ?> </li> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->id() == $this->current->id() ) {\n $this->menu[]=$item;\n $this->appendChildren();\n } else if ( $item->parent_id() == $this->current->parent_id() ) {\n $this->menu[]=$item;\n }\n }\n reset ( $this->menu );\n }", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->isRoot() ) {\n $this->menu[]=$item;\n $this->appendChildren($item);\n }\n }\n reset ( $this->menu );\n }", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function generarMenu(ResultSet $rs) {\n $padres=obtenerPrimerNivel($rs);\n $contPadres=count($padres);\n $menu=\"\";\n for($i=0;$i<$contPadres;$i++) {\n $elemento=$padres[$i];\n $id=$elemento[\"IdMenu\"];\n $hijos=obtenerHijos($rs, $id);\n\n $menu.=\"<li class=\\\"\\\" >\";\n\n $menu.='<a href=\"'.$elemento[\"URL\"].'\" >';\n $menu.=\"<i class=\\\"fa fa-\".$elemento[\"NombreImagen\"].\"\\\"></i>&nbsp; \";\n $menu.='<span class=\"link-title\">'.$elemento[\"Titulo\"].'</span>';\n if(count($hijos)>0){\n $menu.='<span class=\"fa arrow\"></span>';\n }\n $menu.='</a>';\n\n if(count($hijos)>0) {\n $menu.=\"<ul class='collapse' >\n \";\n $menu.=imprimirHijos($hijos, 2,$rs);\n $menu.=\"\n </ul>\";\n }\n $menu.='</li>\n ';\n }\n return $menu;\n}", "public function run()\n {\n $aboutUs = App\\MenuItem::create([\n 'title' => 'About us',\n 'url' => '#',\n 'menu_id' => 1,\n ]);\n\n App\\MenuItem::create([\n 'title' => 'About us #1',\n 'url' => '#',\n 'parent_id' => $aboutUs->id,\n 'menu_id' => 1,\n ]);\n\n App\\MenuItem::create([\n 'title' => 'About us #2',\n 'url' => '#',\n 'parent_id' => $aboutUs->id,\n 'menu_id' => 1,\n ]);\n\n App\\MenuItem::create([\n 'title' => 'About us #3',\n 'url' => '#',\n 'parent_id' => $aboutUs->id,\n 'menu_id' => 1,\n ]);\n\n $services = App\\MenuItem::create([\n 'title' => 'Our Services',\n 'url' => '#',\n 'menu_id' => 1,\n ]);\n\n App\\MenuItem::create([\n 'title' => 'Services #1',\n 'url' => '#',\n 'menu_id' => 1,\n 'parent_id' => $services->id\n ]);\n\n App\\MenuItem::create([\n 'title' => 'Services #2',\n 'url' => '#',\n 'menu_id' => 1,\n 'parent_id' => $services->id\n ]);\n\n App\\MenuItem::create([\n 'title' => 'Services #3',\n 'url' => '#',\n 'parent_id' => 16,\n 'menu_id' => 1,\n 'parent_id' => $services->id\n ]);\n }", "function appendChildren () {\n $this->menu[]=new Marker('start');\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $this->current->id() ) {\n $this->menu[]=$item;\n }\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }", "public function collapsable()\n {\n $this->id = Util::randomString();\n\n $this->rightTools()->append(\n \"<a id='collapse-{$this->id}' data-toggle=\\\"collapse\\\" href=\\\"#{$this->id}\\\"><i class=\\\"zmdi zmdi-minus\\\"></i></a>\"\n );\n\n return $this;\n }", "function makeNav ($sheetName, $pages, $sheet) {\n if (isset($sheet)) {\n echo '<div class=\"panel panel-default\">';\n echo '<div class=\"panel-heading\" role=\"tab\" id=\"'.clean($sheetName).'\">';\n echo '<h4 class=\"panel-title\">';\n echo '<a ';\n if (clean($sheetName) != $sheet) {\n echo 'class=\"collapsed\" ';\n }\n echo 'role=\"button\" data-toggle=\"collapse\" data-parent=\"#'.$section.'Nav\" href=\"#collapse-'.clean($sheetName).'\" aria-expanded=\"';\n if (clean($sheetName) != $sheet) {\n echo 'false';\n } else {\n echo 'true';\n }\n echo '\" aria-controls=\"collapse-'.clean($sheetName).'\">'.$sheetName.'</a>';\n echo '</h4>';\n echo '</div>';\n echo '<div id=\"collapse-'.clean($sheetName).'\" class=\"panel-collapse collapse';\n if (clean($sheetName) == $sheet) {\n echo ' in';\n }\n echo '\" role=\"tabpanel\" aria-labelledby=\"'.clean($sheetName).'\">';\n echo '<ul class=\"list-group\">';\n foreach ($pages as $pageName => $data) {\n if (!isset($data['show']) || $data['show'] < mktime()) {\n echo '<li class=\"list-group-item\">';\n echo '<a href=\"'.$data['link'].'\">'.formatText($pageName,0).'</a>';\n echo '</li>';\n }\n }\n echo '</ul>';\n echo '</div>';\n echo '</div>';\n } else {\n echo '<div class=\"row\">';\n echo '<div class=\"col-xs-12\">';\n echo '<h2>'.$sheetName.'</h2>';\n echo '</div>';\n foreach ($pages as $title => $page) {\n if (!isset($page['show']) || $page['show'] < mktime()) {\n echo '<div class=\"col-xs-6\">';\n echo '<a href=\"'.$page['link'].'\">';\n echo '<p>'.formatText($title,0).'</p>';\n echo '</a>';\n echo '</div>';\n }\n }\n echo '</div>';\n }\n}", "protected function renderItems($items)\n {\n $n=count($items);\n $lines=[];\n foreach($items as $i => $item)\n {\n $options=array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', []));\n $tag=ArrayHelper::remove($options, 'tag', 'li');\n $class=[];\n $this->getItemClasses($item,$class,$i,$n);\n $this->getClassOptions($class,$options);\n $menu=$this->renderItem($item);\n\n if(!empty($item['items']))\n {\n $menu.=strtr($this->submenuTemplate, [\n '{show}' => $item['active'] ? \"style='display: block'\" : \"style='display: none'\",\n '{items}' => $this->renderItems($item['items']),\n ]);\n }\n $lines[]=Html::tag($tag, $menu, $options);\n }\n\n if(Yii::$app->sys->discord_invite_url!==false)\n $lines[]='<li class=\"nav-item\"><b>'.Html::a('<i class=\"fab fa-discord text-discord\"></i><p class=\"text-discord\">Join our Discord!</p>', Yii::$app->sys->discord_invite_url, ['target'=>'_blank','class'=>'nav-link']).'</b></li>';\n if(Yii::$app->sys->patreon_menu===false)\n {\n $lines[]='<li><hr/></li>';\n $lines[]='<li class=\"nav-item\"><b>'.Html::a('<i class=\"fab fa-patreon text-danger\"></i><p class=\"text-danger\">Become a Patron!</p>', 'https://www.patreon.com/bePatron?u=31165836', ['target'=>'_blank','class'=>'nav-link']).'</b></li>';\n }\n\n return implode(\"\\n\", $lines);\n }", "public static function run()\n {\n $Menus = [\n ['id' => '1' , 'name' => 'ManagementTools' ,'status' => 1 , 'menu_id' => 1, 'icon' => 'fa-cog'],\n ['id' => '2' , 'name' => 'Application' ,'status' => 1 , 'menu_id' => 2, 'icon' => 'fa-suitcase'],\n ['id' => '3' , 'name' => 'ManageUsers' ,'status' => 1 , 'menu_id' => 1, 'url' => 'users', 'icon' => 'fa-user'],\n ['id' => '4' , 'name' => 'ManagePermission' ,'status' => 1 , 'menu_id' => 1, 'url' => 'permissions', 'icon' => 'fa-wrench'],\n ['id' => '5' , 'name' => 'ManageRoles' ,'status' => 1 , 'menu_id' => 1, 'url' => 'roles', 'icon' => 'fa-lock'],\n ['id' => '6' , 'name' => 'ManageMenu' ,'status' => 1 , 'menu_id' => 1, 'url' => 'menus', 'icon' => 'fa-th-list'],\n ['id' => '7' , 'name' => 'Master' ,'status' => 1 , 'menu_id' => 2],\n ['id' => '8' , 'name' => 'ClientMenu' ,'status' => 1 , 'menu_id' => 2],\n ['id' => '9' , 'name' => 'Inspection' ,'status' => 1 , 'menu_id' => 2],\n ['id' => '10' , 'name' => 'Profession' ,'status' => 1 , 'menu_id' => 7 , 'url' => 'professions'],\n ['id' => '11' , 'name' => 'InspectorType' ,'status' => 1 , 'menu_id' => 7 , 'url' => 'inspectortypes'],\n ['id' => '12' , 'name' => 'InspectionType' ,'status' => 1 , 'menu_id' => 7 , 'url' => 'inspectiontypes'],\n ['id' => '13' , 'name' => 'InspectionSubtype' ,'status' => 1 , 'menu_id' => 7 , 'url' => 'inspectionsubtypes'],\n ['id' => '14' , 'name' => 'Client' ,'status' => 1 , 'menu_id' => 8 , 'url' => 'clients'],\n ['id' => '15' , 'name' => 'Headquarters' ,'status' => 1 , 'menu_id' => 8 , 'url' => 'headquarters'],\n ['id' => '16' , 'name' => 'Company' ,'status' => 1 , 'menu_id' => 8 , 'url' => 'companies'],\n ['id' => '17' , 'name' => 'Contract' ,'status' => 1 , 'menu_id' => 8 , 'url' => 'contracts'],\n ['id' => '18' , 'name' => 'Inspector' ,'status' => 1 , 'menu_id' => 9 , 'url' => 'inspectors'],\n ['id' => '19' , 'name' => 'InspectorAgenda' ,'status' => 1 , 'menu_id' => 9 , 'url' => 'inspectoragendas'],\n ['id' => '20' , 'name' => 'Inspectionappointment' ,'status' => 1 , 'menu_id' => 9 , 'url' => 'inspectionappointments'],\n ['id' => '21' , 'name' => 'Format' ,'status' => 1 , 'menu_id' => 9 , 'url' => 'formats'],\n ['id' => '22' , 'name' => 'Preformato' ,'status' => 1 , 'menu_id' => 7, 'url' => 'preformatos'],\n\n ];\n\n\t\tforeach ($Menus as $Menu) {\n\t\t\tMenu::create($Menu);\n\t\t}\n }", "public function menustoreAction() {\n $panel_pages = array();\n $menut = Model_Menu::getInstance();\n $panel_names = $menut->panels();\n $pages = array();\n // at this point have selected all the menus of all active modules\n // return a tree of pages from each top level page sorted by sort_by and label\n foreach($panel_names as $panel):\n $panel_data = array('id' => $panel, 'label' => ucwords(str_replace('_', ' ', $panel)),\n 'children' => array());\n foreach($menut->find(array('panel' => $panel, 'parent' => 0), 'sort_by') as $menu):\n $panel_data['children'][] = $menu->pages_tree();\n endforeach;\n $pages[] = $panel_data;\n endforeach;\n $this->view->data = new Zend_Dojo_Data('id', $pages, 'label');\n $this->_helper->layout->disableLayout();\n }", "function content_nav() {\n\t\t$current_individual_nav_items = 0;\n\t\t$max_individual_nav_items = 4;\n\t\t\n\t\tforeach($this->data['content_actions'] as $key => $item) :\n\t\t\tif ( $current_individual_nav_items == $max_individual_nav_items ) { ?>\n\t\t\t\t<?\n\t\t\t}\n\t\t\t\n\t\t\techo $this->makeListItem( $key, $item );\n\t\t\t$current_individual_nav_items++;\n\t\tendforeach;\n\t\t\n\t\t?></ul></li><?\n\t}", "public function createNavigation() {\n\t \n\t // 1. Gruppen auslesen\n\t\t$groups = array();\n\t\t$items = array();\n\t\n\t $items = $this->applicationHandler->getApplications(array(\n\t \t'groups' => true,\n\t \t'isVisible' => 1\n\t ));\n\n\t // 2. Elemente auslesen und parsen\n\t foreach ($items as $g) {\n\t \t\n\t \t$groupIsEmpty = true;\n\t \t$groupSelected = false;\n\n\t \tforeach ($g['cmtApplications'] as $r) {\n\t\n\t \t\t// Zugriffsrechte prüfen\n\t\t \tif (!$this->user->checkUserAccessRight($r['id'])) {\n\t\t \t\tcontinue;\t\n\t\t \t}\n\t\t \t\n\t\t\t\t// Da ist was drin in der Gruppe!\n\t\t\t\t$groupIsEmpty = false;\n\t\t\t\t$itemSelected = false;\n\t\t\t\t\t\t\n\t\t\t\t// Default-Einstellungen holen, sofern es welche gibt.\n\t\t\t\tif ($r['cmt_type'] == 'table') {\n\t\t\t\t\t$settingsPath = 'app_showtable/';\n\t\t\t\t} else {\n\t\t\t\t\t$a = explode('.', $r['cmt_include']);\n\t\t\t\t\t$settingsPath = $a[0].'/';\n\t\t\t\t\tunset ($a);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$itemSettings = $r['cmt_tablesettings'];\n\t\t\t\t\n\t\t\t\tif (!isset($itemSettings['icon'])) {\n\t\t\t\t\t$itemSettings['icon'] = 'default';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch ($itemSettings['icon']) {\n\t\t\t\t\tcase 'otherIcon':\n\t\t\t\t \t$itemIcon = CMT_TEMPLATE.$itemSettings['iconPath'];\n\t\t\t\t \tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'none':\n\t\t\t\t\t\t$itemIcon = '';\n\t\t\t\t\t\tunset ($itemSettings['iconPath']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (isset($itemSettings['iconPath']) && is_file(CMT_TEMPLATE.$settingsPath.$itemSettings['iconPath'])) {\n\t\t\t\t\t\t\t$itemIcon = CMT_TEMPLATE.$settingsPath.$itemSettings['iconPath'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$itemIcon = CMT_TEMPLATE.'general/img/'.str_replace('table', $r['cmt_type'], 'cmt_defaulttableicon_16px.png');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$itemSettings['icon'] = 'default';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Das 16px große Icon anzeigen\n\t\t\t\tif (!strstr($itemIcon, 'cmt_default')) {\n\t\t\t\t\t$iconParts = explode('.', (basename($itemIcon)));\n\t\t\t\t\t$itemIcon = dirname($itemIcon).'/'.array_shift($iconParts).'_16px.'.implode('.', $iconParts);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!is_file($itemIcon)) {\n\t\t\t\t\t$itemIcon = CMT_TEMPLATE.'general/img/'.str_replace('table', $r['cmt_type'], 'cmt_defaulttableicon_16px.png');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($r['id'] == $this->selectedApplicationID) {\n\t\t\t\t\t$itemSelected = true;\n\t\t\t\t\t$groupSelected = true;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$itemSelected = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// generate query variables\n\t\t\t\t$queryVars = '';\n\t\t\t\tif ($r['cmt_queryvars']) {\n\t\t\t\t\t$queryVars = str_replace(array(\"\\n\", \"\\r\"), array('&amp;', ''), $r['cmt_queryvars']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$parserVars = array(\n\t\t\t\t\t'itemIcon' => $itemIcon,\n\t\t\t\t\t'itemName' => $r['cmt_showname'],\n\t\t\t\t\t'itemId' => $r['id'],\n\t\t\t\t\t'itemSelected' => $itemSelected,\n\t\t\t\t\t'groupSelected' => $groupSelected,\n\t\t\t\t\t'queryVars' => $queryVars\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->parser->setMultipleParserVars($parserVars);\n\t\t\t\t$groupHtml .= $this->parser->parse($this->itemTemplate);\n\t \t}\n\t \t\n\t \t// Falls was in der Gruppe drin ist, dann anzeigen\n\t \tif (!$groupIsEmpty) {\n\t \t\t\n\t \t\t$groupSettings = $g['cmt_groupsettings'];\n\t \t\t\n\t \t\tif (!is_array($groupSettings)) {\n\t \t\t\t$groupSettings = array();\n\t \t\t}\n\t \t\t\n\t\t\t\t// Icon suchen\n\t\t\t switch ($groupSettings['icon']) {\n\t\t\t \tcase 'otherIcon':\n\t\t\t \t\t$groupIcon = CMT_TEMPLATE.$groupSettings['iconPath'];\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \tcase 'none':\n\t\t\t \t\t$groupIcon = '';\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \tdefault:\n\t\t\t \t\tif ($groupSettings['iconPath']) {\n\t\t\t \t\t\t$groupIcon = CMT_TEMPLATE.$groupSettings['iconPath'];\n\t\t\t \t\t} else {\n\t\t\t \t\t\t$groupIcon = CMT_TEMPLATE.'general/img/cmt_defaultgroupicon_32px.png';\n\t\t\t \t\t}\n\t\t\t \t\t$groupSettings['icon'] = 'default';\n\t\t\t \t\tbreak;\n\t\t\t }\n\t\t\t \n\t\t\t // Das 32px große Icon auswählen\n\t\t\t if (!strstr($groupIcon, 'cmt_defaultgroupicon_32px.png') && $groupIcon != '') {\n\t\t\t \t$iconParts = explode('.', (basename($groupIcon)));\n\t\t\t \t$groupIcon = dirname($groupIcon).'/'.array_shift($iconParts).'_32px.'.implode('.', $iconParts);\n\t\t\t }\n\t\t\t \n\t\t\t if ($groupIcon != '' && !is_file($groupIcon)) {\n\t\t\t \t$groupIcon = CMT_TEMPLATE.'general/img/cmt_defaultgroupicon_32px.png';\n\t\t\t }\n\t\t\t \n\t\t\t // Gruppentemplate parsen\n\t\t\t $this->parserVars = array(\n\t\t \t\t'groupIcon' => $groupIcon,\n\t\t\t\t\t'groupName' => $g['cmt_groupname'],\n\t\t\t\t\t'groupId' => $g['id'],\n\t\t\t\t\t'groupHtml' => $groupHtml,\n\t\t \t\t'groupSelected' => $groupSelected\n\t\t\t \t);\n\t\t\t\t\t\t\n\t\t\t $this->parser->SetMultipleParserVars($this->parserVars);\n\t\t\t $navigation .= $this->parser->parse($this->groupTemplate);\n\t\t\t \n\t\t\t unset($groupHtml);\n\t \t}\n\t }\n\t $this->parser->setParserVar('cmtNavigationGroups', $navigation);\t \n\t return $this->parser->parseTemplate('administration/cmt_navigation.tpl');\n\t}", "function appendChildren ($item) {\n if (array_key_exists($item->name(),$this->parents)) {\n $this->menu[]=new Marker('start');\n foreach ( $this->children[$item->name()] as $child ) {\n $this->menu[]=$child;\n $this->appendChildren($child);\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }\n }", "protected function _render()\n {\n $sidebar = $GLOBALS['injector']->getInstance('Horde_View_Sidebar');\n\n $container = 0;\n foreach ($this->_menu as $m) {\n /* Check for separators. */\n if ($m == 'separator') {\n $container++;\n continue;\n }\n\n $row = array(\n 'cssClass' => $m['icon'],\n 'url' => $m['url'],\n 'label' => $m['text'],\n 'target' => $m['target'],\n 'onclick' => $m['onclick'],\n );\n\n /* Item class and selected indication. */\n if (!isset($m['class'])) {\n /* Try to match the item's path against the current\n * script filename as well as other possible URLs to\n * this script. */\n if ($this->isSelected($m['url'])) {\n $row['selected'] = true;\n }\n } elseif ($m['class'] === '__noselection') {\n unset($m['class']);\n } elseif ($m['class'] === 'current') {\n $row['selected'] = true;\n } else {\n $row['class'] = $m['class'];\n }\n\n $sidebar->addRow($row);\n }\n\n return $sidebar;\n }", "function renderTocList(array $elements, Aura\\View\\View $context)\n{\n\n foreach ($elements as $entry) {\n echo '<li class=\"list-group-item\">';\n echo '<div class=\"row clearfix\">';\n echo '<div class=\"col-sm-2\">'.\"{$entry['number']}\".'</div>';\n echo '<div class=\"col-sm-10\">'. $context->anchorRaw($entry['href'], $entry['title']) . '</div>';\n echo '</div>';\n if (isset($entry['nested'])) {\n $collapseId = 'collapse-' . str_replace('.', '-', rtrim($entry['number'], '.'));\n echo '<a class=\"bbt-toc-toggle\" href=\"#' . $collapseId . '\" data-toggle=\"collapse\" aria-expanded=\"false\" aria-controls=\"' . $collapseId . '\"><span class=\"badge\">+</span></a>';\n echo '<ul class=\"list-group bbt-toc-nested-list collapse\" id=\"' . $collapseId . '\">';\n renderTocList($entry['nested'], $context);\n echo '</ul>';\n }\n echo '</li>';\n }\n}", "static function CreateMenuItem(array $item)\r\n\t\t{\r\n\t\t\tif (!empty($item[sub]))\r\n\t\t\t{\r\n\t\t\t\techo \"<li><a href='$item[url]' class = '$item[class]' title = '$item[tip]' $item[attributes]>$item[text]</a>\";\r\n\t\t\t\techo \"<ul>\";\r\n\t\t\t\t\tforeach ($item[sub] as $sub)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tself::CreateMenuItem($sub);\r\n\t\t\t\t\t}\r\n\t\t\t\techo \"</ul></li>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo \"<li><a href='$item[url]' class = '$item[class]' title = '$item[tip]' $item[attributes]>$item[text]</a></li>\";\r\n\t\t\t}\r\n\t\t}", "protected function renderItems($items)\n {\n $n = count($items);\n $lines = [];\n foreach ($items as $i => $item) {\n if (!empty($item['assign'])) {\n $compare = array_intersect($this->group, $item['assign']);\n if (!empty($compare)) {\n $options = [];\n $tag = $this->CI->helpers->arrayRemove($options, 'tag', 'li');\n $class = [];\n $activeLink = false;\n\n if ($item['active']) {\n $class[] = $this->activeCssClass;\n $activeLink = true;\n }\n\n if (!empty($class)) {\n if (empty($options['class'])) {\n $options['class'] = implode(' ', $class);\n } else {\n $options['class'] .= ' ' . implode(' ', $class);\n }\n }\n $menu = $this->renderItem($item, $activeLink);\n if (!empty($item['items'])) {\n $menu .= strtr($this->submenuTemplate, [\n '{show}' => $item['active'] ? \"style='display: block'\" : '',\n '{items}' => $this->renderItems($item['items']),\n ]);\n }\n\n if (isset($options['class'])) {\n $options['class'] .= ' nav-item';\n } else {\n $options['class'] = 'nav-item';\n }\n\n $lines[] = Html::tag($tag, $menu, $options);\n }\n }\n }\n return implode(\"\\n\", $lines);\n }", "public function processCollapse()\n {\n $this->addCollapse($this->createWrapper('div', ['class' => 'collapse navbar-collapse', 'id' => $this->getWidgetId() . '_collapse'], $this->stringifyNav()));\n }", "public function run()\n {\n foreach ($this->data() as $item){\n CoreMenu::create($item);\n }\n }", "public function menuItems()\n {\n return array(\n array('label'=>Yii::t('app','Compras'), 'icon'=>'fa fa-shopping-cart', 'url'=>array('#'), 'items'=>array(\n \n // array('label'=>Yii::t('app','Home Información'), 'icon'=>'fa fa-star-half-o', 'url'=>array('/'.$this->id.'/info/')),\n // array('label'=>Yii::t('app','Beneficios'), 'icon'=>'fa fa-rocket', 'url'=>array('/'.$this->id.'/features/admin')),\n \n \tarray('label'=>Yii::t('app','Compras'), 'icon'=>'fa fa-shopping-cart', 'url'=>array('/'.$this->id.'/header/admin')),\n\n \tarray('label'=>Yii::t('app','Términos y condiciones'), 'icon'=>'fa fa-gavel', 'url'=>array('/'.$this->id.'/conditions/')),\n \tarray('label'=>Yii::t('app','Config'), 'icon'=>'fa fa-cog', 'url'=>array('/'.$this->id.'/config/')),\n \n \n )),\n array('label'=>Yii::t('app','Productos'), 'icon'=>'fa fa-barcode', 'url'=>array('#'), 'items'=>array(\n \n array('label'=>Yii::t('app','Categorías'), 'icon'=>'fa fa-list-ol', 'url'=>array('/'.$this->id.'/categories/admin')),\n array('label'=>Yii::t('app','Productos'), 'icon'=>'fa fa-barcode', 'url'=>array('/'.$this->id.'/items/admin')),\n \t// array('label'=>Yii::t('app','Facilitadores'), 'icon'=>'fa fa-graduation-cap', 'url'=>array('/'.$this->id.'/facilitador/admin')),\n \n )),\n );\n }", "protected function generateModuleMenu() {}", "public function MenuItemGroup()\n {\n $this->items = new ArrayList();\n }", "function buildMenu($obj, $style)\r\n\t{\r\n\r\n\t\t$js = \"\";\r\n\r\n\t\trequire_once(SITE_DIR.'_classes/_collections/_SubSectionPageList.php');\r\n\t\t$pages = new SubSectionPageList($obj->id);\r\n\t\t$i=0;\r\n\r\n\t\tlist($temp_js, $subsections) = $this->createMilonicJSList($pages->itemList);\r\n\t\tif(!empty($temp_js)){\r\n\t\t\t$js.=\"\\n\".'with(milonic=new menuname(\"'.$this->convertToMenuName($obj->name).'\")){'.\"\\n\r\n\t\t\t\t\t\tstyle=$style;\\n\";\r\n\t\t\t$js.=$temp_js;\r\n\t\t\t$js.=\"\\n} \" .$subsections;\r\n\t\t}\r\n\r\n\t\treturn $js;\r\n\r\n/*\r\n\t\tif(count($items)>0)\r\n\t\t{\r\n\r\n\t\t\t$js=\"\\n\".'with(milonic=new menuname(\"'.$menu_name.'\")){'.\"\\n\r\n\t\t\t\t\tstyle=$style;\\n\";\r\n\t\t\t$js.=$this->createMilonicJSList($items);\r\n\t\t\t$js.=\"\\n}\";\r\n\t\t}\r\n\t\treturn $js;\r\n*/\r\n\t}", "public function run() {\n $menus = [\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '0',\n 'body' => 'Main Navigation',\n 'type' => 'separator'\n ],\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '1',\n 'icon' => 'home',\n 'name' => 'dashboard',\n 'uri' => 'admin',\n 'title' => 'Go to Dashboard',\n 'body' => 'Dashboard'\n ],\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '5.1',\n 'icon' => 'group',\n 'name' => 'user',\n 'uri' => 'admin/user',\n 'title' => 'User Management',\n 'body' => 'Users'\n ],\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '9',\n 'body' => 'Settings',\n 'type' => 'separator'\n ],\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '9.1',\n 'name' => 'setting',\n 'icon' => 'gear',\n 'uri' => '',\n 'title' => 'Pengaturan Website',\n 'body' => 'Pengaturan',\n 'type' => 'parent'\n ],\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '9.2',\n 'name' => 'menu',\n 'icon' => 'bars',\n 'uri' => 'admin/menu',\n 'title' => 'Pengaturan Menu',\n 'body' => 'Menus'\n ],\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '9.3',\n 'icon' => 'key',\n 'name' => 'permission',\n 'uri' => 'admin/permission',\n 'title' => 'Roles & Permissions',\n 'body' => 'Permissions'\n ],\n [\n 'module_target' => 'sidebar-admin',\n 'position' => '9.1-1',\n 'name' => 'setting',\n 'icon' => '',\n 'uri' => 'admin/setting/global/update',\n 'title' => 'Pengaturan Global',\n 'body' => 'Global'\n ]\n ];\n\n for ($i = 0; $i < count($menus); $i++) {\n $menus[$i] = factory(\\App\\Menu::class)->create($menus[$i]);\n }\n\n $menus[0]->roles()->attach(3);\n $menus[1]->roles()->attach(3);\n $menus[2]->roles()->attach(2);\n $menus[3]->roles()->attach(2);\n $menus[4]->roles()->attach(2);\n $menus[5]->roles()->attach(1);\n $menus[6]->roles()->attach(1);\n $menus[7]->roles()->attach(1);\n }" ]
[ "0.6325584", "0.5737215", "0.566524", "0.566524", "0.566524", "0.566524", "0.566524", "0.566524", "0.5544741", "0.5541232", "0.55274785", "0.5511908", "0.5474864", "0.5455559", "0.54525465", "0.54476434", "0.5440442", "0.5411988", "0.54038256", "0.5398209", "0.5396687", "0.5390701", "0.5383247", "0.53783154", "0.53237134", "0.5312225", "0.5309012", "0.5289997", "0.5284069", "0.5283889" ]
0.7483723
0
Create a temporary table and try to use the headlines for rownames
protected function generateTmpTable($firstLine) { $arrHeadline = $this->getHeadlines($firstLine); // Drop existing temp table if($this->Database->tableExists($this->tmpTbl)) { $this->Database->executeUncached('DROP TABLE '.$this->tmpTbl); $this->msg('Table '.$this->tmpTbl.' dropped.','info'); } // generate temp table $strQry = 'CREATE TABLE `'.$this->tmpTbl.'` ('; $strQry .= '`id` int(10) unsigned NOT NULL auto_increment,'; foreach($arrHeadline as $row) { $strQry .= '`'.$row.'` text NULL,'; } $strQry .= 'PRIMARY KEY (`id`)'; $strQry .= ') ENGINE=MyISAM DEFAULT CHARSET=utf8;'; $this->Database->executeUncached($strQry); $this->msg('Table '.$this->tmpTbl.' created.','info'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDummyTable() {}", "private function _createTemporaryTable(){\n\n $tempTable = $this->getTemporaryTablename();\n $this->_liquetDatabase->query(\"DROP TABLE IF EXISTS {$tempTable}\")->run();\n $this->_liquetDatabase->query(\"CREATE TEMPORARY TABLE {$tempTable} LIKE {$this->_tablename}\")->run();\n\n return $tempTable;\n }", "private function populateDummyTable() {}", "function verifyCreateTableWithHeadRow(){\n $WIKI_TABLE_ROW = 3;\n $WIKI_TABLE_COL = \"4\";\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_ADDTABLE);\n $this->click(CHK_BOARDER);\n $this->type(TEXT_ROW, $WIKI_TABLE_ROW);\n $this->type(TEXT_COL, $WIKI_TABLE_COL);\n $this->click(BUTTON_INSERTABLE);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;\n $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER .\n TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .\n TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .\n TEXT_VALIDATE_TABLE_PART3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "private function createTempTable()\n\t{\n\t\t// generate a temp table name\n\t\t$this->tempTable = 'crawl_index_temp';\n\n\t\t// ensure the temp table doesnt exist\n\t\t$sql = sprintf('DROP TABLE IF EXISTS %s', $this->tempTable);\n\t\tmysql_query($sql, $this->db);\n\n\t\t// create the table and give an exclusive write lock\n\t\t$sql = sprintf('CREATE TEMPORARY TABLE %s (page_id INT(10) UNSIGNED NOT NULL) ENGINE=MEMORY', $this->tempTable);\n\t\tmysql_query($sql, $this->db);\n\t}", "function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4095b8d30f50f34fdd6acf8dd566b1','CELLS'=>$cells));\n}", "abstract public function openTableHead();", "function createTable($name, $rows);", "protected abstract function createTestTable();", "function table_begin($p_headrow, $p_class = '', $p_tr_attr = '', $p_th_attr = array()){\n\techo '<table class=\"table ' . $p_class . '\">';\n\techo '<thead>';\n\techo '<tr ' . $p_tr_attr . '>';\n\t\n\tfor($t_i=0; $t_i<count($p_headrow); $t_i++)\n\t\techo '<th ' . (isset($p_th_attr[$t_i]) ? $p_th_attr[$t_i] : '') . '>' . $p_headrow[$t_i] . '</th>';\n\n\techo '</tr>';\n\techo '</thead>';\n}", "private function prepareTables() {}", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "function _create_tmp_table()\n {\n //$this->tmp_search_table = (string)'_'.$GLOBALS['B']->util->unique_crc32();\n $this->tmp_search_table = \"earchvetmp\";\n $sql = \"CREATE TEMPORARY TABLE {$this->tmp_search_table} (mid INT NOT NULL default 0)\";\n \n $result = $GLOBALS['B']->db->query($sql);\n \n if (DB::isError($result)) \n {\n trigger_error($result->getMessage().\"\\n\\nSQL: \".$sql.\"\\n\\nFILE: \".__FILE__.\"\\nLINE: \".__LINE__, E_USER_ERROR);\n return FALSE;\n }\n }", "public static function create_table_head()\n\t{\n\t\t\n\t\tif (!static::$columns)\n\t\t{\n\t\t\treturn static::$template['wrapper_start'].'<tr><th>No columns config</th></tr>'.static::$template['wrapper_end'];\n\t\t}\n\n\t\t$table_head = static::$template['wrapper_start'];\n\t\t$table_head .= '<tr>';\n\t\t\n\t\tforeach(static::$columns as $column)\n\t\t{\n\t\t\t$sort_key \t= (is_array($column) ? isset($column[1]) ? $column[1] : strtolower($column[0]) : $column);\n\t\t\t$col_attr\t= (is_array($column) && isset($column[2]) ? $column[2] : array());\n\t\t\t\n\t\t\t$new_direction = static::$direction;\n\t\t\t\n\t\t\tif(static::$sort_by == $sort_key)\n\t\t\t{\n\t\t\t\t$active_class_name = static::$template['col_class_active'].' '.static::$template['col_class_active'].'_'.$new_direction;\n\t\t\t\tif(isset($col_attr['class']))\n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] .= ' '.$active_class_name;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] = $active_class_name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_direction = (static::$direction == 'asc' ? 'desc' : 'asc');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(is_array($column) && (!isset($column[1]) || isset($column[1]) && $column[1] !== false)){\n\t\t\t\t\n\t\t\t\t$url \t\t\t= rtrim(static::$base_url, '/').(static::$current_page ? '/'.static::$current_page : '');\n\t\t\t\t$url \t\t\t.= '/'.$sort_key.static::$uri_delimiter.$new_direction;\n\t\t\t\t\n\t\t\t\t$cell_content \t= rtrim(static::$template['link_start'], '> ').' href=\"'.$url.'\">';\n\t\t\t\t$cell_content \t.= $column[0];\n\t\t\t\t$cell_content \t.= static::$template['link_end'];\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif(is_array($column))\n\t\t\t\t{\n\t\t\t\t\t$column = $column[0];\n\t\t\t\t}\n\t\t\t\t$cell_content = static::$template['nolink_start'].$column.static::$template['nolink_end'];\t\n\t\t\t}\n\t\t\t\n\t\t\t$table_head .= html_tag(static::$template['col_tag'], $col_attr, $cell_content);\n\t\t\t\n\t\t}\n\t\t\n\t\t$table_head .= '</tr>';\n\t\t$table_head .= static::$template['wrapper_end'];\n\n\t\treturn $table_head;\n\t}", "abstract protected function getRowsHeader(): array;", "function html_generate_row($row, $prepend, $heading=false) {\n $html = '<tr>';\n if ($prepend !== null) {\n $html .= '<th>'.$prepend.'</th>';\n }\n for ($i=0; $i <= count($row)-1; $i++) {\n if (!$heading) {\n $html .= '<td>'.round($row[$i], 1).'</td>';\n } else {\n $html .= '<th>'.round($row[$i], 1).'</th>';\n }\n }\n $html .= '</tr>';\n return $html;\n}", "protected function TitleTable() {\n\treturn $this->GetConnection()->MakeTableWrapper(KS_CLASS_CATALOG_TITLES);\n }", "private function createFileHeadings() {\n\t\t// Allow other plugins to add their own column headers\n\t\t$headings = elgg_trigger_plugin_hook('row:headers', 'userexport', array(), $this->fields);\n\n\t\t// Attempt to translate the fields\n\t\tforeach ($headings as $key => $field) {\n\t\t\t$lang_string = \"profile:{$field}\";\n\t\t\t$heading = elgg_echo($lang_string);\n\n\t\t\t// No translation was found, fall back to the original string\n\t\t\tif ($heading === $lang_string) {\n\t\t\t\t$heading = elgg_echo($field);\n\t\t\t}\n\n\t\t\t$headings[$key] = $heading;\n\t\t}\n\n\t\t$this->writeToCSV($headings);\n\t}", "function write_table_head()//scrie capul de tabel pentru perioadele de vacanta\r\n{\r\n\t$output = \"\";\r\n\tadd($output,'<table width=\"500px\" cellpadding=\"1\" cellspacing=\"1\" class=\"special\">');\r\n\tadd($output,'<tr class=\"tr_head\"><td>Nr</td><td>Data inceput</td><td>Data sfarsit</td></tr>');\r\n\t\r\n\treturn $output;\r\n}", "public function getTableRowNames()\n \t{\n \t\treturn array('title', 'author', 'publishDate', 'client', 'workType', 'briefDescription', 'description', 'caseStudyID', 'isPrivate', 'commentsAllowed', 'screenshots', 'prevImageURL', 'finalURL');\n \t}", "public function tableHeaderRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($cols as $k){\n $out .= '<td>'.$k.'</td>';\n }\n return('<tr>'.$out.'</tr>');\n }", "function rallies_table_row_header($hdrs)\r\n{\r\n global $MYKEYWORDS;\r\n\r\n\t$OK = ($_SESSION['ACCESSLEVEL'] >= $GLOBALS['ACCESSLEVEL_READONLY']);\r\n\r\n\t$res = '';\r\n\t$hdrcols = explode(';',$hdrs);\r\n\tforeach ($hdrcols as $col)\r\n\t\t$res .= \"<th>\".$col.\"</th>\";\r\n\r\n return $res;\r\n}", "function buildTempTableFromData($uniqueId){\n\t\t//require_once($_SERVER['DOCUMENT_ROOT'] .\"/inc/php/classes/sql_safe.php\" );\n\t\t//Grab first row\n\t\t if(!isset($this->data[0])){\n\t\t \tthrow new Exception(\"Bad Data Format. Foxpro report needs an array of arrays\");\n\t\t }\n\t\t$firstRow = $this->data[0];\n\t\t$columns = array_keys($firstRow);\n\n\t\t//See the excel sheet in project files for an explanation of this logic.\n\t\t$paramLimit = 1500; //sqlsrv max escaped params is 2100. driver will throw an error if you exceed 2100.\n\t\t$rowCount = count($this->data);\n\t\t$columnCount = count($this->data[0]);\n\t\tif($columnCount > $paramLimit){\n\t\t\tthrow new Exception(\"Cannot insert more columns than the parameter limit! Column Count = {$columnCount}. Parameter Limit = {$paramLimit}.\");\n\t\t}\n\t\t$paramTotal = $columnCount*$rowCount;\n\t\t$groupsNeeded = ceil($paramTotal/$paramLimit);\n\t\t$chunkSize = floor($rowCount/$groupsNeeded);\n\t\t$chunks = array_chunk($this->data,$chunkSize);\n\n\t\t$tableName = \"tmp_foxpro_autogen_\".$uniqueId;\n\n\t\t$columnSqlArray = array();\n\t\tforeach ($columns as $column) {\n\t\t\t$columnSqlArray[] = \"[{$column}] [varchar](MAX) NULL\";\n\t\t}\n\t\t$tableNameQuery = \"FWE_DEV..[{$tableName}]\";\n\t\t$createQuery = \"CREATE TABLE {$tableNameQuery} (\" . implode(\",\", $columnSqlArray) . \")\";\n\t\t$this->mssqlHelperInstance->query($createQuery);\n\n\t\t$dbClass = get_class($this->mssqlHelperInstance);\n\t\tif ($dbClass == 'mssql_helper') {\n\t\t\trequire_once($_SERVER['DOCUMENT_ROOT'] . '/inc/php/classes/sqlsrv_helper.php');\n\t\t\t$insertInstance = new sqlsrv_helper('m2m');\n\t\t} else {\n\t\t\t$insertInstance = $this->mssqlHelperInstance;\n\t\t}\n\n\t\tforeach($chunks as $chunk) {\n\n\t\t\t$insertSqlArray = array();\n\t\t\t$queryValues = array();\n\t\t\tforeach ($chunk as $row) {\n\t\t\t\t$values = array_values($row);\n\t\t\t\t$rowArray = array();\n\t\t\t\tforeach ($values as $value) {\n\t\t\t\t\t$rowArray[] = \"?\";\n\t\t\t\t\t$queryValues[] = (string)$value;\n\t\t\t\t}\n\t\t\t\t$insertSqlArray[] = \"(\" . implode(\",\", $rowArray) . \")\";\n\t\t\t}\n\t\t\t$insertQuery = \"INSERT INTO {$tableNameQuery} (\" . implode(\",\", $columns) . \") VALUES \" . implode(\",\", $insertSqlArray) . \"\";\n\n\t\t\t$insertInstance->query($insertQuery, $queryValues);\n\t\t}\n\t\t$this->tableName = $tableNameQuery;\n\t}", "public function createTable()\n {\n // Create out table\n // First line of the file.\n $fh = $this->getInputFileHandle();\n rewind($fh);\n $fl = fgets($fh);\n // Trim and htmlentities the first line of the file to make column names\n $cols = array_map('trim', array_map('htmlentities', str_getcsv($fl, $this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar'])));\n // array to hold definitions\n $defs = array();\n // if our table *doesn't* have headers, give generic names\n if (!$this->vars['hh']) {\n $oc = $cols;\n $c = count($cols);\n $cols = array();\n for ($i = 0; $i < $c; $i++) {\n $col = \" `Column_\" . $i . \"` \";\n $col .= is_numeric($oc[$i]) ? \"DECIMAL(12,6) DEFAULT NULL\" :\n \"VARCHAR(512) CHARACTER SET \" . $this->vars['characterSet'] . \" COLLATE \" . $this->vars['collation'] . \" DEFAULT NULL\";\n $cols[] = $col;\n }\n } else {\n // if our table *does* have headers\n $file = new SplFileObject($this->vars['ifn']);\n $headers = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n\n // number of columns to get for guessing types\n $n = min(10, $this->numLines());\n $firstNCols = array();\n for($i = 0; $i < $n; $i++){\n $firstNCols[$i] = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n }\n $sl = $firstNCols[0];\n if(count($sl) !== count($cols)){\n $baseurl = explode('?', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])[0];\n trigger_error(\"Number of columns inconsistent throughout file. For more information, see the error documentation.\");\n exit(1);\n }\n\n // guess the column types from the first n rows of info\n $colTypes = array_fill(0,count($cols),null);\n for($i = 0; $i < $n; $i++){\n foreach ($cols as $j => $col) {\n if(!isset($firstNCols[$i])){\n trigger_error('Why don\\'t we have row ' . $i . '??');\n }\n if(!isset($firstNCols[$i][$j])){\n if(count($firstNCols[$i]) !== count($cols)){\n trigger_error('Column count is inconsistent throughout the file. If you\\'re sure you have the right amount of columns, please check the delimiter options.');\n }\n trigger_error('Why don\\'t we have column ' . $j . '??');\n }\n $colTypes[$j] = $this->guessType(\n $firstNCols[$i][$j],\n $colTypes[$j]\n );\n }\n }\n\n foreach($colTypes as $i => &$type){\n $type = (is_null($type)) ? 'VARCHAR(512) CHARACTER SET ' . $this->vars['characterSet'] . ' COLLATE ' . $this->vars['collation'] . '' : $type;\n }\n\n /*echo \"<pre>\";\n print_r(array_combine($cols,$colTypes));\n echo \"</pre>\";\n exit();*/\n\n // We can pretty much only guess two data types from one row of information\n foreach ($cols as $i => &$col) {\n $cname = $col;\n $col = ' `' . $cname . '` ';\n $col .= $colTypes[$i];\n $col .= \" COMMENT '$cname'\";\n }\n }\n // Always have an id column!\n array_unshift($cols, ' `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT \\'id\\'');\n $SQL = \"CREATE TABLE IF NOT EXISTS `{$this->vars['db']['db']}`.`{$this->vars['db']['table']}` (\\n\";\n $SQL .= implode(\",\\n\", $cols);\n $SQL .= \"\\n) ENGINE=InnoDB DEFAULT CHARSET=\".$this->vars['characterSet'].\" CHARSET=\".$this->vars['characterSet'].\" COLLATE \".$this->vars['collation'].\";\";\n $this->executeSql($SQL);\n\n return $this;\n }", "public function buildHead(Table $table): Table {\n if (!empty($this->theadData)) {\n $head = new Thead();\n $head->appendHeaderRow($this->theadData);\n $table->setThead($head);\n }\n return $table;\n }", "function CreateTemporaryTable($tableName, $tableDefinition)\n{\n $stmt = SQL_CREATE_TEMPORARY_TABLE . \" $tableName ($tableDefinition);\";\n return mysql_query($stmt);\n}", "private function get_row($rows) {\n\t\t$head = null;\n\n\t\tforeach ($rows as $key=>$val) {\n\n\t\t\t/*\n\t\t\t * check type rows\n\t\t\t */\n\t\t\tswitch ($val['type']) {\n\t\t\t\tcase 'heading': $element = 'th'; break;\n\t\t\t\tcase 'body': $element = 'td'; break;\n\t\t\t\tcase 'footer': $element = 'th'; break;\n\t\t\t\tdefault : $element = 'th'; break;\n\t\t\t}\n\n\t\t\t$head .= $this->set_template()->tr_open;\n\t\t\tforeach ($val['datas'] as $k=>$v) {\n\t\t\t\tif (is_array($v)) {\n\t\t\t\t\t$head .= '<'.$element;\n\t\t\t\t\t$head .= $this->attributes($v['attributes']).'>';\n\t\t\t\t\t$head .= !empty($v['content']) ? $v['content'] : $this->empty;\n\t\t\t\t\t$head .= '</'.$element.'>';\n\t\t\t\t} else {\n\t\t\t\t\t$head .= '<'.$element.'>';\n\t\t\t\t\t$head .= !empty($v) ? $v : $this->empty;\n\t\t\t\t\t$head .= '</'.$element.'>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$head .= $this->set_template()->tr_close;\n\t\t}\n\n\t\treturn $head;\n\t}", "abstract public function closeTableHead();", "public function build_table()\n {\n if (count($this->properties) > 0)\n {\n foreach ($this->properties as $property => $values)\n {\n $contents = array();\n $contents[] = $property;\n \n if (! is_array($values))\n {\n $values = array($values);\n }\n \n if (count($values) > 0)\n {\n foreach ($values as $value)\n {\n $contents[] = $value;\n }\n }\n \n $this->addRow($contents);\n }\n \n $this->setColAttributes(0, array('class' => 'header'));\n }\n else\n {\n $contents = array();\n $contents[] = Translation::get('NoResults', null, Utilities::COMMON_LIBRARIES);\n $row = $this->addRow($contents);\n $this->setCellAttributes($row, 0, 'style=\"font-style: italic;text-align:center;\" colspan=2');\n }\n }", "public function fullTableRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($in as $k => $v){\n if(!isset($v)) $v = 'n/a';\n $out .= '<td><a title=\"'.$k.'\">'.$v.'</a></td>';\n }\n return('<tr>'.$out.'</tr>');\n }" ]
[ "0.6863029", "0.6492692", "0.6335658", "0.62894595", "0.6214419", "0.6193982", "0.61939144", "0.6050768", "0.60431063", "0.59875673", "0.5984472", "0.5874888", "0.5863243", "0.58206713", "0.5747921", "0.57388544", "0.5723985", "0.57143", "0.5707151", "0.57059443", "0.5643449", "0.5632357", "0.56215745", "0.56123596", "0.560778", "0.5607006", "0.5605955", "0.5586919", "0.55818385", "0.5578014" ]
0.66587317
1
Inserts a new billing assignment and returns the new assignment. Only one of advertiser_id or campaign_id is support per request. If the new assignment has no effect (assigning a campaign to the parent advertiser billing profile or assigning an advertiser to the account billing profile), no assignment will be returned. (billingAssignments.insert)
public function insert($profileId, $billingProfileId, BillingAssignment $postBody, $optParams = []) { $params = ['profileId' => $profileId, 'billingProfileId' => $billingProfileId, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('insert', [$params], BillingAssignment::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(AssignmentRequest $request)\n { \n /** AssignmentRequest will automatically return all errors if validation failed */\n\n $input = $request->validated();\n $record = AssetAssignment::create($input);\n\n event(new AssignmentAlert(Auth()->user()));\n \n return $this->sendResponse(new AssetAssignResource($record), 'record created successfully.');\n }", "function insertEditAssignment(&$editAssignment) {\n\t\t$this->update(\n\t\t\tsprintf('INSERT INTO edit_assignments\n\t\t\t\t(article_id, editor_id, can_edit, can_review, date_notified, date_underway)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, ?, %s, %s)',\n\t\t\t\t$this->datetimeToDB($editAssignment->getDateNotified()),\n\t\t\t\t$this->datetimeToDB($editAssignment->getDateUnderway())),\n\t\t\tarray(\n\t\t\t\t$editAssignment->getArticleId(),\n\t\t\t\t$editAssignment->getEditorId(),\n\t\t\t\t$editAssignment->getCanEdit()?1:0,\n\t\t\t\t$editAssignment->getCanReview()?1:0\n\t\t\t)\n\t\t);\n\n\t\t$editAssignment->setEditId($this->getInsertEditId());\n\t\treturn $editAssignment->getEditId();\n\t}", "function insertObject(&$reviewAssignment) {\n\t\t$this->update(\n\t\t\tsprintf('INSERT INTO review_assignments (\n\t\t\t\tsubmission_id,\n\t\t\t\treviewer_id,\n\t\t\t\tstage_id,\n\t\t\t\treview_method,\n\t\t\t\tregret_message,\n\t\t\t\tround,\n\t\t\t\tcompeting_interests,\n\t\t\t\trecommendation,\n\t\t\t\tdeclined, replaced, cancelled,\n\t\t\t\tdate_assigned, date_notified, date_confirmed,\n\t\t\t\tdate_completed, date_acknowledged, date_due, date_response_due,\n\t\t\t\treviewer_file_id,\n\t\t\t\tquality, date_rated,\n\t\t\t\tlast_modified,\n\t\t\t\tdate_reminded, reminder_was_automatic,\n\t\t\t\treview_form_id,\n\t\t\t\treview_round_id,\n\t\t\t\tunconsidered\n\t\t\t\t) VALUES (\n\t\t\t\t?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, %s, %s, %s, %s, %s, %s, %s, ?, ?, %s, %s, %s, ?, ?, ?, ?\n\t\t\t\t)',\n\t\t\t\t$this->datetimeToDB($reviewAssignment->getDateAssigned()), $this->datetimeToDB($reviewAssignment->getDateNotified()), $this->datetimeToDB($reviewAssignment->getDateConfirmed()), $this->datetimeToDB($reviewAssignment->getDateCompleted()), $this->datetimeToDB($reviewAssignment->getDateAcknowledged()), $this->datetimeToDB($reviewAssignment->getDateDue()), $this->datetimeToDB($reviewAssignment->getDateResponseDue()), $this->datetimeToDB($reviewAssignment->getDateRated()), $this->datetimeToDB($reviewAssignment->getLastModified()), $this->datetimeToDB($reviewAssignment->getDateReminded())),\n\t\t\tarray(\n\t\t\t\t(int) $reviewAssignment->getSubmissionId(),\n\t\t\t\t(int) $reviewAssignment->getReviewerId(),\n\t\t\t\t(int) $reviewAssignment->getStageId(),\n\t\t\t\t(int) $reviewAssignment->getReviewMethod(),\n\t\t\t\t$reviewAssignment->getRegretMessage(),\n\t\t\t\tmax((int) $reviewAssignment->getRound(), 1),\n\t\t\t\t$reviewAssignment->getCompetingInterests(),\n\t\t\t\t$reviewAssignment->getRecommendation(),\n\t\t\t\t(int) $reviewAssignment->getDeclined(),\n\t\t\t\t(int) $reviewAssignment->getReplaced(),\n\t\t\t\t(int) $reviewAssignment->getCancelled(),\n\t\t\t\t$reviewAssignment->getReviewerFileId(),\n\t\t\t\t$reviewAssignment->getQuality(),\n\t\t\t\t$reviewAssignment->getReminderWasAutomatic(),\n\t\t\t\t$reviewAssignment->getReviewFormId(),\n\t\t\t\t(int) $reviewAssignment->getReviewRoundId(),\n\t\t\t\t(int) $reviewAssignment->getUnconsidered(),\n\t\t\t)\n\t\t);\n\n\t\t$reviewAssignment->setId($this->getInsertReviewId());\n\t\treturn $reviewAssignment->getId();\n\t}", "function add_assignment($params)\n {\n $this->db->insert('assignments',$params);\n return $this->db->insert_id();\n }", "function addReviewAssignment($reviewAssignment) {\r\n\t\tif ($reviewAssignment->getDecisionId() == null) {\r\n\t\t\t$reviewAssignment->setDecisionId($this->getId());\r\n\t\t}\r\n\r\n\t\tif (isset($this->reviewAssignments)) {\r\n\t\t\t$reviewAssignments = $this->reviewAssignments;\r\n\t\t} else {\r\n\t\t\t$reviewAssignments = Array();\r\n\t\t}\r\n\t\tarray_push($reviewAssignments, $reviewAssignment);\r\n\r\n\t\treturn $this->reviewAssignments = $reviewAssignments;\r\n\t}", "public function post_create()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$input = array();\n\n\t\t\tif(Assignments::check_unique_assignment(Input::get('user_id'), Input::get('room_id') ))\n\t\t\t{\n\t\t\t\t$input['user_id'] = Input::get('user_id');\n\t\t\t\t$input['room_id'] = Input::get('room_id');\n\n\t\t\t\t$success = Assignments::create($input);\n\n\t\t\t\tif( $success )\n\t\t\t\t{\n\t\t\t\t\treturn Redirect::to_route('details')\n\t\t\t\t\t->with('message', 'Created new assignment successfully!');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn Redirect::to_route('details')\n\t\t\t\t\t->with('error', 'Assignment Failed!');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to_route('details')\n\t\t\t\t->with('error', 'Assignment already exists!');\n\t\t\t}\n\n\t\t}\n\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\treturn Response::error('500');\n\t\t}\n\n\t}", "public function store(Request $request)\n {\n if (Gate::denies('is_admin', Auth::user()))\n return back();\n\n $input = $request->all();\n $input['author_user_id'] = Auth::user()->id;\n $input['date'] = now();\n $input['status'] = config('string.status.open');\n $input['update_status'] = config('string.status.open');\n\n Assignment::create($input);\n return redirect()->action('AssignmentController@index')->with('message', 'Create successfully.');\n }", "public static function getAssignments($bannerId) {\n $sah = new StudentAssignmentHistory($bannerId);\n return $sah;\n }", "function addBilling($shipmentID, $freightCharge, $addOnCharge, $cratingCharge, $osaCharge, $valuationCharge, $totalCharge) {\n try {\n /** Instantiate the Database model. **/\n $db = Database::getInstance();\n\n /** Connect to the database. **/\n $dbh = $db->getConnection();\n\n /** Prepare the sql query to be used. **/\n $stmt = $dbh->prepare(\"INSERT INTO billing (shipmentID, freightCharge, addOnCharge, cratingCharge, osaCharge, valuationCharge, totalCharge) VALUES(:shipmentID, :freightCharge, :addOnCharge, :cratingCharge, :osaCharge, :valuationCharge, :totalCharge)\");\n\n /** Bind the parameters to the sql query. **/\n $stmt->bindParam(':shipmentID', $shipmentID);\n $stmt->bindParam(':freightCharge', $freightCharge);\n $stmt->bindParam(':addOnCharge', $addOnCharge);\n $stmt->bindParam(':cratingCharge', $cratingCharge);\n $stmt->bindParam(':osaCharge', $osaCharge);\n $stmt->bindParam(':valuationCharge', $valuationCharge);\n $stmt->bindParam(':totalCharge', $totalCharge);\n\n /** Execute the query. **/\n $stmt->execute();\n\n /** Check if insert was successful. **/\n $count = $stmt->rowCount();\n if($count > 0) {\n return true;\n }\n\n else {\n return false;\n }\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }", "public function store(Request $request)\n {\n $data = $this->assignmentService->createAssignment($request->input());\n return response()->json($data);\n }", "private function insertPlan($accountId, $planId, $effectiveDate) {\n $stmt = $this->pdo->prepare(\n 'INSERT INTO account_plans(account_id,plan_id,effective_date) '\n . 'VALUES(:account_id,:plan_id,:effective_date)');\n \n return $stmt->execute([\n ':account_id' => $accountId,\n ':plan_id' => $planId,\n ':effective_date' => $effectiveDate,\n ]);\n }", "public function add_billing(Request $request, $campaign_id)\n {\n $inputs = $request->validate([\n 'target_clicks' => 'required',\n 'target_shares' => 'required',\n 'target_days' => 'required'\n ]);\n\n $campaign = Campaign::find($campaign_id);\n if ($campaign->update($inputs)) {\n return redirect()->route('campaigns.show', [$campaign_id])->with('msg','Billing info set');\n } else {\n return back()->with('errors', 'Failed to update billing information');\n }\n }", "function sb_assignment_insert ($node) {\n\n db_query(\"INSERT INTO {eto_assignments}\n (\" . $node->key_field . \", \" . $node->target_field . \")\n VALUES\n (%d, %d)\",\n\t $node->uid, $node->selected_uid);\n\n}", "public function creating(assignment $assignment)\n {\n //code...\n }", "function insert() {\n\t\tglobal $_DB_DATAOBJECT; //Indicate to PHP that we want to use the already-defined global, as opposed to declaring a local var\n\t\t//Grab the database connection that has already been made by the parent's constructor:\n\t\t$__DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];\n\t\tif ($this->reg_type != null) {\n\t\t\t$this->badge_number = $__DB->nextId('badge_number'); //Fetch the next id in the sequence. To set the sequence to a specifc value, use phpMyAdmin to tweak the value in the badge_number_seq table\n\t\t}\n\t\treturn DB_DataObject::insert();\n\t}", "public function store(Campaign $campaign, CampaignRequest $request)\n {\n// dump($request->all());\n $campaign ->create($request->all());\n// dump($request->all('bunch'));\n// dump($campaign);\n return redirect()->route('campaign.index');\n }", "public function create()\n {\n return view('backend.assignments.assignment-add');\n }", "public function assign($objToAssign){\n if($this->ID != NULL and\n $objToAssign instanceof Employee and\n $objToAssign->ID != NULL){\n $myAssignment = new Assignment($this->ID, $objToAssign->ID);\n return $myAssignment->save();\n }\n }", "public function getAssignmentId()\n\t{\n\t\treturn $this->assignmentId;\n\t}", "public function save()\n\t{\n\t\tglobal $ilDB;\n\n\t\t// sequence\n\t\t$this->setId($ilDB->nextId(\"adn_ep_assignment\"));\n \t$id = $this->getId();\n\n\t\t$fields = $this->propertiesToFields();\n\t\t$fields[\"id\"] = array(\"integer\", $id);\n\t\t\t\n\t\t$ilDB->insert(\"adn_ep_assignment\", $fields);\n\n\t\tparent::save($id, \"adn_ep_assignment\");\n\n\t\treturn $id;\n\t}", "function insertSingleAbility($text,$cost){\n //foreach ($abs as &$ab){\n $ab=$text;\n if($ab){\n\t$s = new Abscript();\n\t$t=parseAbility(trim($ab));\n\tif($t!=''){\n\t\t$s->setAbility(parseAbility(trim($t)));\n\t\t$s->setSample(trim($cost.$ab));\n\t\ttry {\n\t\t\t$s->save();\t\n\t\t} catch (Exception $e) {\n\t\t\tunset($e);\n\t\t}\n\t\tunset($s);\n\t\tpreg_match('/a\\([^\\)]*\\)/',$ab,$sabs);\n\t\tforeach ($sabs as $sab){\n\t\t\t//$s = AbscriptQuery::create()->findPk($sab);\n\t\t\tif($sab ){\n\t\t\t\t$s = new Abscript();\n\n\t\t\t\t$s->setAbility(parseAbility(trim($sab)));\n\t\t\t\t$s->setSample(trim($cost.$sab));\n\t\t\t\ttry {\n\t\t\t\t\t$s->save();\t\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tunset($e);\n\t\t\t\t}\n\t\t\t\tunset($s);\t\t\n\t\t\t}\n\t\t}\n\t}\n }\n //}\n}", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "private function insertOrUpdateGoal($action = 'PUT') {\r\n $post_array = json_decode($this->requestParameters);\r\n $this->clientOwnsProject();\r\n $this->checkReadOnlyFields(FALSE, 400601);\r\n\r\n self::getCurrentPrimaryGoal();\r\n\r\n if ($action == 'POST') {\r\n $this->checkMandatoryFields(FALSE, 400600);\r\n }\r\n\r\n $goal = self::setGoalsArray($action);\r\n $goal['status'] = 1;\r\n\r\n if (array_key_exists('level', $post_array)) {\r\n if ($post_array->level == 'PRIMARY') {\r\n if ($action == 'PUT') {\r\n $this->newPrimaryGoalId = $this->goal;\r\n }\r\n }\r\n }\r\n\r\n if (isset($this->group) && $this->group != -1) {\r\n $goal['page_groupid'] = $this->group;\r\n }\r\n $goal['landingpage_collectionid'] = $this->project;\r\n $goal['deleteddate'] = NULL;\r\n\r\n if ($this->goal == NULL) {\r\n $this->goal = self::goalAlreadyExists();\r\n }\r\n\r\n if ($this->goal) {\r\n self::updateExistingGoal($goal);\r\n } else {\r\n $this->db->insert('collection_goals', $goal);\r\n $this->goal = $this->db->insert_id();\r\n if ($this->goal > 0) {\r\n $this->flushClientCache($this->account);\r\n }\r\n }\r\n\r\n if (is_numeric($this->goal) && $this->goal > 0) {\r\n\r\n $this->syncCollectionGoals();\r\n\r\n if (!array_key_exists('level', $post_array) || $post_array->level == 'PRIMARY') {\r\n self::setPrimaryGoal();\r\n }\r\n\r\n self::setDefaultPrimaryGoalIfNotSet();\r\n return $this->successResponse(200, $this->goal);\r\n }\r\n\r\n throw new Exception('Could not add or update the goal for the given project', 500);\r\n }", "function cemhub_insert_campaign_source_id_entry($node_id, $submission_id, $campaign_source_id) {\n db_insert('cemhub_campaign_source')\n ->fields(array(\n 'sid' => $submission_id,\n 'nid' => $node_id,\n 'campaign' => $campaign_source_id,\n ))\n ->execute();\n}", "public function insert($embargoCountryaccessrule);", "public function run()\n\t{\n\t\tDB::table('assignments')->delete();\n\n\t\tAssignment::create(\n\t\t\tarray(\n\t\t\t\t'date_assigned' => now(),\n\t\t\t\t'date_inspected' => now(),\n\t\t\t\t'insurer' => 'Malayan',\n\t\t\t\t'broker' => 'MARSH',\n\t\t\t\t'ref_no' => '19-8641',\n\t\t\t\t'name_insured' => 'Masterpiece Asia Property, Inc.',\n\t\t\t\t'adjuster' => 'JMC',\n\t\t\t\t'third_party' => 'H&M Store',\n\t\t\t\t'pol_no' => '',\n\t\t\t\t'pol_type' => 'CAR',\n\t\t\t\t'risk_location' => 'Highway',\n\t\t\t\t'nature_loss' => 'CAR',\n\t\t\t\t'date_loss' => now(),\n\t\t\t\t'contact_person' => '',\n\t\t\t\t'loss_reserve' => '2000.00',\n\t\t\t\t'status_list_id' => 1,\n\t\t\t\t'remarks' => '',\n\t\t\t\t'created_by' => 'Jonathan Quebral',\n\t\t\t\t'updated_by' => 'Jonathan Quebral'\n\t\t\t)\n\t\t);\n\t}", "public function insert($productId, $skuId, Google_Service_Licensing_LicenseAssignmentInsert $postBody, $optParams = array())\n {\n $params = array('productId' => $productId, 'skuId' => $skuId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Google_Service_Licensing_LicenseAssignment\");\n }", "public function testAssignmentOfferingMethod()\n {\n $assignment = factory(Assignment::class)->create();\n $offering = factory(Offering::class)->create();\n $assignment->offering()->associate($offering);\n $assignment->save();\n\n $this->assertDatabaseHas('assignments', [\n 'id' => $assignment->id,\n 'offering_id' => $offering->id,\n ]);\n }", "public function actionCreateAllocation()\n {\n $model = new AllocationDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $wpLoc = WpLocation::findOne(['id'=>$model->wpLocCode]);\n $model->name = $wpLoc->name;\n \n $year = CurrentYear::getCurrentYear();\n $model->yearId =(string) $year->_id;\n $yearstring =substr($year->yearStartDate,-4).substr($year->yearEndDate,-4);\n $model->allocationID = $model->wpLocCode.$yearstring;\n $model->save();\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createNewCampaign(){\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData();\n\n\t\t$cc = new CollegeCampaign;\n\t\t$cc->save();\n\n\t\tCache::put(env('ENVIRONMENT').'_'.$data['user_id'].'_newCampaignId', $cc->id, 600);\n\t}" ]
[ "0.522903", "0.5226232", "0.51708555", "0.49826762", "0.4742517", "0.47291124", "0.4624129", "0.46131203", "0.46039164", "0.45879176", "0.45495614", "0.4543962", "0.45149127", "0.45074227", "0.4470292", "0.44189334", "0.4390513", "0.4387687", "0.43753195", "0.43630984", "0.43554503", "0.43528935", "0.43306196", "0.43194106", "0.4315435", "0.43035838", "0.42863947", "0.42831093", "0.42643362", "0.4251846" ]
0.6681009
0
Retrieves a list of billing assignments. (billingAssignments.listBillingAssignments)
public function listBillingAssignments($profileId, $billingProfileId, $optParams = []) { $params = ['profileId' => $profileId, 'billingProfileId' => $billingProfileId]; $params = array_merge($params, $optParams); return $this->call('list', [$params], BillingAssignmentsListResponse::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAssignments()\n {\n return $this->queryBuilder('tx_deepl_settings')->select('*')\n ->from('tx_deepl_settings')\n ->execute()\n ->fetchAll();\n }", "public function listBillingAccounts($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_Cloudbilling_ListBillingAccountsResponse\");\n }", "public function getAssignments()\n {\n if (array_key_exists(\"assignments\", $this->_propDict)) {\n return $this->_propDict[\"assignments\"];\n } else {\n return null;\n }\n }", "public function getAssignments(): array;", "public function getAuthAssignments(){\n return array_keys(Yii::app()->getAuthManager()->getAuthAssignments($this->id));\n }", "public function getBillingAddressIds()\n {\n return $this->billingAddressIds;\n }", "function &getIncompleteReviewAssignments() {\n\t\t$reviewAssignments = array();\n\t\t$reviewRoundJoinString = $this->getReviewRoundJoin();\n\t\tif ($reviewRoundJoinString) {\n\t\t\t$result =& $this->retrieve(\n\t\t\t\t\t\t'SELECT\tr.*, r2.review_revision, u.first_name, u.last_name\n\t\t\t\t\t\tFROM\treview_assignments r\n\t\t\t\t\t\t\tLEFT JOIN users u ON (r.reviewer_id = u.user_id)\n\t\t\t\t\t\t\tLEFT JOIN review_rounds r2 ON (' . $reviewRoundJoinString . ')\n\t\t\t\t\t\tWHERE' . $this->getIncompleteReviewAssignmentsWhereString() .\n\t\t\t\t\t\t' ORDER BY r.submission_id'\n\t\t\t);\n\n\t\t\twhile (!$result->EOF) {\n\t\t\t\t$reviewAssignments[] =& $this->_fromRow($result->GetRowAssoc(false));\n\t\t\t\t$result->MoveNext();\n\t\t\t}\n\n\t\t\t$result->Close();\n\t\t\tunset($result);\n\t\t} else {\n\t\t\tassert(false);\n\t\t}\n\n\t\treturn $reviewAssignments;\n\t}", "public static function getAssignments($bannerId) {\n $sah = new StudentAssignmentHistory($bannerId);\n return $sah;\n }", "public function get_assignments(){\n if($this->ID != NULL){\n $sql = \"SELECT ID FROM assignment WHERE Task=\".$this->ID.\";\";\n $myAssignmentIDs = $this->get_by_query($sql);\n $myAssignmentsList = array();\n foreach ($myAssignmentIDs as &$aID) {\n $myAssignment = new Assignment();\n $myAssignment = $myAssignment->get_by_ID($aID['ID']);\n array_push($myAssignmentsList, $myAssignment);\n }\n return $myAssignmentsList;\n }\n }", "public function getBillingReport()\n {\n list($response) = $this->getBillingReportWithHttpInfo();\n return $response;\n }", "public function getBilling()\n {\n return $this->billing;\n }", "public function getBilling()\n {\n return $this->billing;\n }", "public function getBillingFields() {\n\t\treturn $this->billingDetails;\n\t}", "public function getBillingDetails()\n {\n return $this->_billing;\n }", "public function getBilling()\n {\n return isset($this->billing) ? $this->billing : null;\n }", "public function getBillingCountries()\n {\n if (!isset($this->arrCache['billingCountries'])) {\n\n $arrCountries = deserialize($this->billing_countries);\n\n if (empty($arrCountries) || !is_array($arrCountries)) {\n $arrCountries = array_keys(\\System::getCountries());\n }\n\n $this->arrCache['billingCountries'] = $arrCountries;\n }\n\n return $this->arrCache['billingCountries'];\n }", "public function getBillingFields()\n {\n if (!isset($this->arrCache['billingFields'])) {\n\n $this->arrCache['billingFields'] = array_filter(array_map(\n function($field) {\n return $field['enabled'] ? $field['value'] : null;\n },\n $this->getBillingFieldsConfig()\n ));\n\n }\n\n return $this->arrCache['billingFields'];\n }", "public function getBillingAddresses()\n {\n return $this->morphMany(Address::class, 'addressable', ['type' => Address::TYPE_BILLING]);\n }", "function &getReviewAssignments() {\r\n\t\treturn $this->reviewAssignments;\r\n\t}", "public function getBillingReference()\n {\n return $this->billingReference;\n }", "public function getBillingReference()\n {\n return $this->billingReference;\n }", "public function getBillingFields()\n {\n $aRequiredFields = $this->getRequiredFields();\n\n return $this->_filterFields($aRequiredFields, 'oxuser__');\n }", "public function billingInfos() {\n return new BillingInfo($this);\n }", "function getAssignmentList($subtaskId)\n {\n $rs = $this->dbQuery(\n 'SELECT * FROM assignmnts ' .\n 'WHERE subtask_id=' . $subtaskId . ' ' .\n 'AND year=' . $this->schoolyear\n );\n return $rs;\n }", "public function getAccountingList() {\n $accountingListQuery = \"SELECT es_fa_groupsid,fa_groupname,fa_undergroup FROM dlvry_fa_groups\";\n $accountingListData = $this->db->query($accountingListQuery);\n $accountingListResult = $accountingListData->result_array();\n return $accountingListResult;\n }", "public function getBillingData(): array\n {\n return [\n 'billing.street1' => 'Wilaya center, Avenue Ali Yaeta, étage 3, n 31, Tétouan',\n 'billing.city' => 'TETOUAN',\n 'billing.state' => 'TETOUAN',\n 'billing.country' => 'MA',\n 'billing.postcode' => '35000',\n ];\n }", "public function getAssignments()\n {\n if (array_key_exists(\"assignments\", $this->_propDict)) {\n if (is_a($this->_propDict[\"assignments\"], \"\\Beta\\Microsoft\\Graph\\Model\\PlannerFieldRules\") || is_null($this->_propDict[\"assignments\"])) {\n return $this->_propDict[\"assignments\"];\n } else {\n $this->_propDict[\"assignments\"] = new PlannerFieldRules($this->_propDict[\"assignments\"]);\n return $this->_propDict[\"assignments\"];\n }\n }\n return null;\n }", "public function listBillingAccountsProjects($name, $optParams = array())\n {\n $params = array('name' => $name);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_Cloudbilling_ListProjectBillingInfoResponse\");\n }", "public function getBilling();", "public function setBilling($billing);" ]
[ "0.5390474", "0.53052366", "0.5003872", "0.49572343", "0.4950013", "0.4923144", "0.4899255", "0.4845753", "0.48416504", "0.48410812", "0.4840595", "0.4840595", "0.47305214", "0.47015536", "0.4641276", "0.4637623", "0.45906094", "0.45587975", "0.45277014", "0.45177555", "0.45177555", "0.45011508", "0.44763428", "0.44754076", "0.44751748", "0.4465652", "0.4456035", "0.44534034", "0.44368595", "0.44094175" ]
0.74661344
0
/ Function: index compiles an array with hypha's system files and their creation timestamp Parameters: $dir directory needed for the recursive operation of this function
function index($dir = '.') { $index = array(); if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (isAllowedFile($dir.'/'.$file)) $index[preg_replace("/^\.\//i","",$dir.'/'.$file)] = filemtime($dir.'/'.$file); elseif (is_dir($dir.'/'.$file)) $index = array_merge($index, index($dir.'/'.$file)); } } closedir($handle); } return $index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getFileStruct($dir){\n $command = \"find \". $dir . \" -name '*.md'\";\n $list = array();\n\n exec ( $command, $list );\n\n $output = new \\StdClass;\n $list = array_reverse($list);\n\n\n $pages = array();\n\n\n\n foreach ($list as $path) {\n $relpath = str_replace($dir, '', $path);\n $info = $this->getFileInfo($path);\n $info['fullpath'] = $path;\n\n $part = explode('/', $relpath);\n $relfile = str_replace('.md', '', $part[count($part)-1]);\n\n\n $slug = $relpath;\n if (substr($slug, -9) == '/index.md'){\n $slug = str_replace('index.md','', $slug);\n } else {\n $slug = str_replace('.md','/', $slug);\n }\n $pages[$slug] = (object) $info;\n\n }\n\n\n $this->flatStruct = $pages;\n }", "function xcscandir($dir, &$expic_array)\r\n{\r\n static $dir_id = 0;\r\n static $count =0;\r\n static $pic_id=0;\r\n\r\n $pic_array = array();\r\n $dir_array = array();\r\n\r\n getfoldercontent($dir, $dir_array, $pic_array, $expic_array );\r\n\r\n if (count($pic_array) > 0){\r\n $dir_id_str=sprintf(\"d%04d\", $dir_id++);\r\n echo dirheader($dir, $dir_id_str);\r\n foreach ($pic_array as $picture) {\r\n $count++;\r\n $pic_id_str=sprintf(\"i%04d\", $pic_id++);\r\n echo picrow($dir.$picture, $pic_id_str, $dir_id_str );\r\n }\r\n }\r\n if (count($dir_array) > 0){\r\n foreach ($dir_array as $directory) {\r\n xcscandir($dir.$directory.'/', $expic_array);\r\n }\r\n }\r\n return $count;\r\n}", "function sortedFilesIndexed($mig_dir) {\n // Prepare a sorted list of up and down migrations scripts.\n $mig_files = glob($mig_dir.'*.{sql}', GLOB_BRACE);\n $mig_indexed = array();\n foreach ($mig_files as $idx=>$filename) {\n $timestamp = $this->getTS($filename);\n if ($timestamp) {\n $mig_indexed[$timestamp] = $filename;\n }\n }\n\t\tasort($mig_indexed, SORT_NUMERIC);\n return $mig_indexed;\n }", "function load_results($dir) {\n\n\t\t$data = array();\n\n\t\t$fs_dir = opendir($dir);\n\t\twhile ($fs = readdir($fs_dir)) {\n\n\t\t\tif ((! is_dir(\"$dir/$fs\")) || (in_array($fs,array('.','..')))) { continue; }\n\n\t\t\techo \"$dir/$fs\\n\";\n\n\t\t\t$data[$fs] = array();\n\n\t\t\t$pgbs_dir = opendir(\"$dir/$fs\");\n\t\t\twhile ($pgbs = readdir($pgbs_dir)) {\n\n\t\t\t\tif ($pgbs == '.' || $pgbs == '..') { continue; }\n\n\t\t\t\techo \"\\t$pgbs:\";\n\n\t\t\t\t$data[$fs][$pgbs] = array();\n\n\t\t\t\t$fsbs_dir = opendir(\"$dir/$fs/$pgbs\");\n\t\t\t\twhile ($fsbs = readdir($fsbs_dir)) {\n\n\t\t\t\t\tif ($fsbs == '.' || $fsbs == '..') { continue; }\n\n\t\t\t\t\techo \" $fsbs\";\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs] = array();\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['hash'] = md5(\"$fs/$pgbs/$fsbs\" . microtime(true));\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['pgbench'] = array();\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['pgbench']['ro'] = load_pgbench(\"$dir/$fs/$pgbs/$fsbs/pgbench/ro\", 1);\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['pgbench']['rw'] = load_pgbench(\"$dir/$fs/$pgbs/$fsbs/pgbench/rw\", 9);\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['tpch'] = load_tpch(\"$dir/$fs/$pgbs/$fsbs/tpch\");\n\n\t\t\t\t}\n\t\t\t\tclosedir($fsbs_dir);\n\t\t\t\techo \"\\n\";\n\n\t\t\t}\n\t\t\tclosedir($pgbs_dir);\n\n\t\t}\n\t\tclosedir($fs_dir);\n\n\t\treturn $data;\n\t}", "function buildArray($dir,$file,$onlyDir,$type,$allFiles,$files) {\n\n\t$typeFormat = FALSE;\n\tforeach ($type as $item)\n {\n \tif (strtolower($item) == substr(strtolower($file), -strlen($item)))\n\t\t\t$typeFormat = TRUE;\n\t}\n\n\tif($allFiles || $typeFormat == TRUE)\n\t{\n\t\tif(empty($onlyDir))\n\t\t\t$onlyDir = substr($dir, -strlen($dir), -1);\n\t\t$files[$dir.$file]['path'] = $dir;\n\t\t$files[$dir.$file]['file'] = $file;\n\t\t$files[$dir.$file]['size'] = fsize($dir.$file);\n\t\t$files[$dir.$file]['date'] = filemtime($dir.$file);\n\t}\n\treturn $files;\n}", "function directory_list($dir, $type = \"php\", $excl = array(), $sort = 0)\n{\n $directory_array = array();\n if (is_dir($dir)) {\n $handle = opendir($dir);\n while ($file = readdir($handle))\n {\n $file_arr = explode(\".\", $file);\n if (!is_dir($file)) {\n if (isset($file_arr[1]) && $file_arr[1] == $type && !in_array($file_arr[0], $excl)) {\n //array_push($directory_array, $file_arr[0]); //eroforras igenyesebb\n if ($sort == 0) {\n $directory_array[] = $file_arr[0];\n }\n if ($sort == 1) {\n $directory_array[$file_arr[0]] = $file_arr[0];\n }\n }\n }\n }\n closedir($handle);\n if ($sort == 0) {\n sort($directory_array);\n }\n if ($sort == 1) {\n ksort($directory_array);\n }\n }\n return $directory_array;\n}", "private static function makeJSON(string $dir) : array\n\t{\n\t\tstatic $index = 0;\n\n\t\t$aeFiles = \\MarkNotes\\Files::getInstance();\n\t\t$aeEvents = \\MarkNotes\\Events::getInstance();\n\t\t$aeSession = \\MarkNotes\\Session::getInstance();\n\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\n\t\t$root = str_replace('/', DS, $aeSettings->getFolderDocs(true));\n\n\t\t$rootNode = $aeSettings->getFolderDocs(false);\n\n\t\t// Get the list of files and folders for the treeview\n\t\t$arrEntries = self::directoryToArray($dir);\n\n\t\t// Now, prepare the JSON return\n\t\t$sDirectoryText = basename($dir);\n\t\t$sID = str_replace(dirname($root) . DS, '', $dir);\n\t\t$sID = rtrim($sID, DS) . DS;\n\n\t\t// It's a folder node\n\t\t$dataURL = str_replace(DS, '/', str_replace(dirname($root) . DS, '', $dir));\n\t\t$dataURL .= (($root == $dir) ? '' : '/') . 'index.html';\n\n\t\tif (PHP_7_0) {\n\t\t\t// Avoid PHP 7.0.x bug : handle accents\n\t\t\t$arrSettings = $aeSettings->getPlugins('/interface');\n\t\t\t$bConvert = boolval($arrSettings['accent_conversion'] ?? 1);\n\n\t\t\tif ($bConvert) {\n\t\t\t\t$sID = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($sID));\n\n\t\t\t\t// accent_conversion in settings.json has\n\t\t\t\t// been initialized to 1 => make the conversion\n\t\t\t\t$sDirectoryText = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($sDirectoryText));\n\n\t\t\t\t$dataURL = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($dataURL));\n\t\t\t}\n\t\t}\n\n\t\t$listDir = [\n\t\t\t'id' => md5($sID),\n\t\t\t'type' => 'folder',\n\t\t\t'icon' => 'folder',\n\t\t\t'text' => str_replace(DS, '/', $sDirectoryText),\n\t\t\t'state' => [\n\t\t\t\t// Opened only if the top root folder\n\t\t\t\t'opened' => (($root == $dir) ? 1 : 0),\n\t\t\t\t'disabled' => 1\n\t\t\t],\n\t\t\t'data' => [\n\t\t\t\t//'task' => 'display',\n\t\t\t\t// Right clic on the node ?\n\t\t\t\t// Open the_folder/index.html page\n\t\t\t\t'url' => $dataURL,\n\t\t\t\t'path' => str_replace(DS, '/', $sID)\n\t\t\t],\n\t\t\t'children' => []\n\t\t];\n\n\t\t$dirs = [];\n\t\t$files = [];\n\n\t\tforeach ($arrEntries as $entry) {\n\t\t\tif ($entry['type'] == 'file') {\n\t\t\t\t$entry['name'] = str_replace('/', DS, $entry['name']);\n\n\t\t\t\t// We're processing a filename\n\t\t\t\t$index += 1;\n\n\t\t\t\t//Filename but without the extension (and no path)\n\t\t\t\t$filename = str_replace('.md', '', basename($entry['name']));\n\n\t\t\t\t// Relative filename like f.i.\n\t\t\t\t// docs/the_folder/a_note.md\n\t\t\t\t$id = str_replace($root, $rootNode, $entry['name']);\n\n\t\t\t\tif (PHP_7_0) {\n\t\t\t\t\tif ($bConvert) {\n\t\t\t\t\t\t// accent_conversion in settings.json has\n\t\t\t\t\t\t// been initialized to 1 => make the conversion\n\t\t\t\t\t\t$id = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($id));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Right-click on a file = open it's HTML version\n\t\t\t\t$dataURL = str_replace($root, '', $entry['name']);\n\n\t\t\t\t// Should be relative to the /docs folder\n\t\t\t\t$dataURL = $aeSettings->getFolderDocs(false) . $dataURL;\n\t\t\t\t$dataURL = str_replace(DS, '/', $dataURL) . '.html';\n\n\t\t\t\t$sFileText = $filename;\n\n\t\t\t\t// If the title is really long, …\n\t\t\t\t// 30 characters in the treeview are enough\n\t\t\t\tif (strlen($sFileText) > TREEVIEW_MAX_FILENAME_LENGTH) {\n\t\t\t\t\t/* We'll truncate the filename to only the first ...\n\t\t\t\t\tthirty ... characters\n\t\t\t\t\tBut, special case, when the filename is truncated,\n\t\t\t\t\tif the very last position is an accentuated char.,\n\t\t\t\t\twe can't truncate exactly at that size because such\n\t\t\t\t\tcharacter is on two bytes. We can only keep the first\n\t\t\t\t\tone otherwise we'll have an encoding problem.\n\t\t\t\t\tSo, in this case, truncate one more char (so keep\n\t\t\t\t\t29 f.i.)\n\t\t\t\t\t*/\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$wLen = TREEVIEW_MAX_FILENAME_LENGTH;\n\t\t\t\t\t\t$tmp = json_encode(substr($sFileText, 0, $wLen));\n\t\t\t\t\t\tif (json_last_error() === JSON_ERROR_UTF8) {\n\t\t\t\t\t\t\t$wLen--;\n\t\t\t\t\t\t\t$tmp = json_encode(substr($sFileText, 0, $wLen));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$sFileText = substr($sFileText, 0, $wLen) . ' …';\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\t/*<!-- build:debug -->*/\n\t\t\t\t\t\tdie(\"<pre style='background-color:yellow;'>\" . __FILE__ . ' - ' . __LINE__ . ' ' . print_r($sFileText, true) . '</pre>');\n\t\t\t\t\t\t/*<!-- endbuild -->*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$dataBasename = $aeFiles->removeExtension(basename($dataURL));\n\n\t\t\t\t$dataFile = str_replace($root, '', $entry['name']);\n\t\t\t\t$dataFile = str_replace(DS, '/', $dataFile);\n\n\t\t\t\t$default_task = 'task.export.html';\n\n\t\t\t\t// In the list of files, help the jsTree plugin\n\t\t\t\t// to know that the action should be EDIT and not DISPLAY\n\t\t\t\t// when the user click on the note that was just created\n\t\t\t\t$lastAddedNote = trim($aeSession->get('last_added_note', ''));\n\n\t\t\t\tif ($dataBasename === $lastAddedNote) {\n\t\t\t\t\t$default_task = 'task.edit.form';\n\t\t\t\t}\n\n\t\t\t\tif (PHP_7_0) {\n\t\t\t\t\tif ($bConvert) {\n\t\t\t\t\t\t// accent_conversion in settings.json has\n\t\t\t\t\t\t// been initialized to 1 => make the conversion\n\t\t\t\t\t\t$sFileText = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($sFileText));\n\n\t\t\t\t\t\t$dataBasename = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($dataBasename));\n\n\t\t\t\t\t\t$dataFile = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($dataFile));\n\n\t\t\t\t\t\t$dataURL = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($dataURL));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$files[] = [\n\t\t\t\t\t'id' => md5($id),\n\t\t\t\t\t'icon' => 'file file-md',\n\t\t\t\t\t'text' => $sFileText,\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'basename' => $dataBasename,\n\t\t\t\t\t\t'task' => $default_task,\n\t\t\t\t\t\t'file' => $dataFile,\n\t\t\t\t\t\t'url' => $dataURL\n\t\t\t\t\t],\n\t\t\t\t\t'state' => [\n\t\t\t\t\t\t'opened' => 0,\t// A file isn't opened\n\t\t\t\t\t\t'selected' => 0 // and isn't selected by default\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t} elseif ($entry['type'] == 'folder') {\n\t\t\t\t// It's a folder\n\n\t\t\t\t// Derive the folder name\n\t\t\t\t// From c:/sites/marknotes/docs/the_folder, keep /the_folder/\n\t\t\t\t$fname = str_replace($root, '', $entry['name']);\n\t\t\t\t$fname = DS . ltrim(rtrim($fname, DS), DS) . DS;\n\n\t\t\t\t// The folder should start and end with the slash\n\t\t\t\t// so \"/the_folder/\" and not something else.\n\t\t\t\t$tmp = [\n\t\t\t\t\t'folder' => rtrim($root, DS) . $fname,\n\t\t\t\t\t'return' => true\n\t\t\t\t];\n\n\t\t\t\t$args = [&$tmp];\n\n\t\t\t\t// If the task.acls.cansee wasn't fired i.e. when\n\t\t\t\t// there was no folder to protect, the trigger even\n\t\t\t\t// return False. Otherwise, trigger return True :\n\t\t\t\t// the plugin has been fired\n\t\t\t\tif (static::$bACLsLoaded) {\n\t\t\t\t\t$bReturn = $aeEvents->trigger('task.acls.cansee::run', $args);\n\t\t\t\t} else {\n\t\t\t\t\t// ACLs plugin not loaded; every files / folders\n\t\t\t\t\t// can be accessed\n\t\t\t\t\t$args[0]['return'] = 1;\n\t\t\t\t\t$bReturn = true;\n\t\t\t\t}\n\n\t\t\t\t// The canSeeFolder event will initialize the 'return'\n\t\t\t\t// parameter to false when the current user can't see the\n\t\t\t\t// folder i.e. don't have the permission to see it. This\n\t\t\t\t// permission is defined in the acls plugin options\n\t\t\t\t//\n\t\t\t\t// See function run() of\n\t\t\t\t// MarkNotes\\Plugins\\Task\\ACLs\\cansee.php\n\t\t\t\t// for more information\n\t\t\t\t//\n\t\t\t\t// $bReturn === false ==> there was no protected folder.\n\t\t\t\tif (($bReturn === false) || ($args[0]['return'] === 1)) {\n\t\t\t\t\t//$dirs [] = utf8_decode($entry['name']);\n\t\t\t\t\t$dirs[] = $entry['name'];\n\t\t\t\t}\n\t\t\t} // if ($entry['type']=='folder')\n\t\t} // foreach\n\n\t\t// The current folder has been processed, are\n\t\t// there subfolders in it ?\n\t\tif (count($dirs) > 0) {\n\t\t\tforeach ($dirs as $d) {\n\t\t\t\tlist($arrChildren, $tmp) = self::makeJSON($d);\n\t\t\t\t$listDir['children'][] = $arrChildren;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($files as $file) {\n\t\t\t$listDir['children'][] = $file;\n\t\t}\n\n\t\treturn [$listDir, $index];\n\t}", "function outputFiles($path)\n{\n // totalOutput contains 2 arrays - valid (for valid file types), invalid (for unsupported file types)\n $totalOutput = [\"valid\" => [], \"invalid\" => []];\n $totalExecOutput = [];\n $internsSubmitted = 0;\n\n // Check directory exists or not\n if (file_exists($path) && is_dir($path)) {\n // Scan the files in this directory\n $result = scandir($path);\n // Filter out the current (.) and parent (..) directories\n $files = array_diff($result, array('.', '..'));\n if (count($files) > 0) {\n // Loop through return array\n foreach ($files as $file) {\n $filePath = \"$path/$file\";\n // increase the internsSubmitted\n $internsSubmitted += 1;\n if (is_file($filePath)) {\n // Split the filename\n $fileExtension = getFileExtension($file);\n if ($fileExtension) {\n switch ($fileExtension) {\n case 'js':\n $scriptOut = run_script(\"node $filePath 2>&1\", \"Javascript\", $file);\n array_push($totalExecOutput, $scriptOut);\n break;\n\n case 'py':\n $scriptOut = run_script(\"python3 $filePath 2>&1\", \"Python\", $file);\n array_push($totalExecOutput, $scriptOut);\n break;\n\n case 'php':\n $scriptOut = run_script(\"php $filePath 2>&1\", \"PHP\", $file);\n array_push($totalExecOutput, $scriptOut);\n break;\n\n default:\n $scriptOut = [];\n $properResponse = \"Files with .\" . $fileExtension . \" extension are not supported!\";\n $scriptOut['output'] = $properResponse;\n $scriptOut['name'] = \"null\";\n $scriptOut['file'] = $file;\n $scriptOut['id'] = \"null\";\n $scriptOut['email'] = \"null\";\n $scriptOut['language'] = \"null\";\n $scriptOut['status'] = \"fail\";\n array_push($totalOutput['invalid'], $scriptOut);\n break;\n }\n }\n }\n }\n }\n }\n foreach ($totalExecOutput as $execOutput) {\n $processedOutput = analyzeScript($execOutput[0], $execOutput[1], $execOutput[2]);\n array_push($totalOutput['valid'], $processedOutput);\n }\n list($totalPass, $totalFail) = getPassedAndFailed($totalOutput);\n return array($totalOutput, $internsSubmitted, $totalPass, $totalFail);\n}", "public function getDataFilesList(){\r\n $data_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Data';\r\n $files = scandir($data_dir);\r\n\r\n $files_list = array();\r\n $index = 0;\r\n foreach ($files as $file) {\r\n if($file != '.' && $file != '..'){\r\n $files_list[$index]['name'] = $file;\r\n $files_list[$index]['update_time'] = filemtime($data_dir . DIRECTORY_SEPARATOR . $file);\r\n $files_list[$index]['type'] = $this->getFileType($file);\r\n $index++;\r\n }\r\n }\r\n\r\n $update_times = array();\r\n foreach($files_list as $data){\r\n $update_times[] = $data['update_time'];\r\n }\r\n array_multisort($update_times, SORT_DESC, $files_list);\r\n return $files_list;\r\n }", "public function buildIndexes() {\n\t\t$return = array();\n\t\t$indexes = array(\n\t\t\t\"work\" => __DIR__.'/../content/work',\n\t\t\t\"authors\" => __DIR__.'/../content/authors',\n\t\t\t\"tags\" => __DIR__.'/../content/tags'\n\t\t);\n\t\tforeach ($indexes as $type => $location) {\n\t\t\tforeach(glob($location . '/*.json') as $file) {\n\t\t\t\t$entry = json_decode(file_get_contents($file),true);\n\t\t\t\tif ($entry) {\n\t\t\t\t\t$key = str_replace(array('.json',$location.'/'),'',$file);\n\t\t\t\t\t$return[$type][$key] = $entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// move author details\n\t\t$details = $return['authors'];\n\t\tunset($return['authors']);\n\t\t$return['authors']['details'] = $details;\n\n\t\t// add author details and permalink to work\n\t\tforeach ($return['work'] as $key => &$entry) {\n\t\t\t$entry['permalink'] = $this->root_url . '/view/' . $entry['id'];\n\t\t\tif (is_array($return['authors']['details'][$entry['author_id']])) {\n\t\t\t\t$entry['author_name'] = $return['authors']['details'][$entry['author_id']]['name'];\n\t\t\t\t$entry['author_byline'] = $return['authors']['details'][$entry['author_id']]['byline'];\n\t\t\t}\n\t\t}\n\n\t\t// sort work to newest-first\n\t\tuasort($return['work'], array(\"Harvard\", \"sortIndex\"));\n\n\t\t// do tag stuff\n\t\t$details = $return['tags'];\n\t\tunset($return['tags']);\n\t\t$return['tags']['details'] = $details;\n\t\t$tag_list = array();\n\t\t$tag_index = array();\n\t\t$author_index = array();\n\t\tif (is_array($return['work'])) {\n\t\t\tforeach ($return['work'] as $work) {\n\t\t\t\t$author_index[$work['author_id']][] = $work['id'];\n\t\t\t\tif (is_array($work['tags'])) {\n\t\t\t\t\tif (count($work['tags'])) {\n\t\t\t\t\t\tforeach ($work['tags'] as $tag) {\n\t\t\t\t\t\t\t$tag_index[$tag][] = $work['id'];\n\t\t\t\t\t\t\t$tag_list[] = $tag;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$tag_list = array_unique($tag_list); // trim tags to unique\n\t\tsort($tag_list); // alphabetize\n\n\t\t// format the tag list for mustache iteration\n\t\t$tmp_array = array();\n\t\tforeach ($tag_list as $tag) {\n\t\t\t$tmp_array[]['tag'] = $tag;\n\t\t}\n\t\t$tag_list = $tmp_array;\n\n\t\t$return['tags']['count'] = count($tag_list);\n\t\t$return['tags']['list'] = $tag_list;\n\t\t$return['tags']['index'] = $tag_index;\n\n\t\t$return['authors']['index'] = $author_index;\n\n\t\tforeach ($return as $type => $data) {\n\t\t\tfile_put_contents(__DIR__.'/../content/_generated_'.$type.'.json',json_encode($data));\n\t\t}\n\t\treturn $return;\n\t}", "function dirtree_array($folder){\n // counter for $docnr\n static $i = 1;\n // if folder can be opend\n if($handle = opendir($folder)){\n // read folder content\n while(($file_name = readdir($handle)) !== false){\n // make dir_path for link\n $dir_path = str_replace(FILE_FOLDER,DS.APP_FOLDER,$folder);\n // cleanup filename\n if(!preg_match(\"#^\\.#\", $file_name))\n // make folder entry and call this function again for files\n if(is_dir($folder.DS.$file_name )){\n // jump over forbidden file or folder\n if (in_array($file_name, FORBIDDEN_FOLDERS)){continue;}\n // dreate file properties\n $file_properties[$file_name] = array(\n \"nr\" => $i++,\n \"path\" => $dir_path,\n \"name\" => $file_name,\n \"ext\" => \"folder\",\n \"childs\" => dirtree_array($folder.DS.$file_name));\n }else{\n $ext = '.'.pathinfo($file_name, PATHINFO_EXTENSION);\n // read only files with allowed extensions\n if($ext != EXTENSION){continue;}\n $file_name = str_replace($ext,'',$file_name);\n // jump over forbidden file or folder\n if (in_array($file_name, INVISIBLE_FILES)){continue;}\n // dreate file properties\n $file_properties[$file_name] = array(\n \"nr\" => $i++,\n \"path\" => $dir_path,\n \"name\" => $file_name,\n \"ext\" => $ext,\n \"childs\" => false);\n }\n }\n closedir($handle);\n }\n return $file_properties ;\n}", "function prev_files(){\n\tglobal $sleep;\n\t$files_list = array();\n\t$scan_dir = scandir(OUTPUT_FOLDER, 1);\n\t$prev_file = isset($scan_dir[0]) ? $scan_dir[0] : '';\n\tif(empty($prev_file) || $prev_file == '.' || $prev_file == '..'){\n\t\treturn $files_list;\n\t}\n\t$prev_file = OUTPUT_FOLDER.'/'.$prev_file;\n\tif(file_exists($prev_file)){\n\t\t$available_list = $dir_lists = array();\n\t\t$file_content = file_get_contents($prev_file);\n\t\t$json = json_decode($file_content);\n\t\tforeach($json as $file_info){\n\t\t\t$file = $file_info->file;\n\t\t\tif(!is_dir($file)){\n\t\t\t\t$dir_array = explode('/',$file);\n\t\t\t\t$dir_count = count($dir_array);\n\t\t\t\t$dir_list = '';\n\t\t\t\tfor($x = 0; $x < $dir_count - 1; $x++){\n\t\t\t\t\t$dir_list .= $dir_array[$x].'/';\n\t\t\t\t}\n\t\t\t\tif(!in_array($dir_list,$dir_lists)){\n\t\t\t\t\tarray_push($dir_lists,$dir_list);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$info = $file_info->info;\n\t\t\t$dt = array();\n\t\t\tforeach($info as $key=>$val){\n\t\t\t\t$dt[$key] = $val;\n\t\t\t}\n\t\t\t$data = array(\n\t\t\t\t'file'=>$file,\n\t\t\t\t'info'=>$dt\n\t\t\t);\n\t\t\tarray_push($files_list,$data);\n\t\t}\n\t\tif(count($dir_lists) > 0){\n\t\t\t//See if we have directories that are not listed as scanned from previous scan\n\t\t\tforeach($dir_lists as $dir){\n\t\t\t\tif(array_multi_search($files_list,'file',$dir)){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$dir_stat = stat($dir);\n\t\t\t\t$dt = array();\n\t\t\t\tforeach($dir_stat as $key=>$val){\n\t\t\t\t\t$dt[$key] = $val;\n\t\t\t\t}\n\t\t\t\t$data = array(\n\t\t\t\t\t'file'=>$dir,\n\t\t\t\t\t'info'=>$dt\n\t\t\t\t);\n\t\t\t\tarray_push($files_list,$data);\n\t\t\t}\n\t\t}\n\t}\n\treturn $files_list;\n}", "function scanDir($cfg) //$view, $tdir , $subdir='', $match)\n {\n $ff = HTML_FlexyFramework::get();\n \n $subdir = $cfg['subdir'];\n $scandir = $cfg['tdir']. (empty($subdir) ? '' : '/') . $subdir;\n \n if (in_array($subdir, $cfg['skipdir'])) {\n return array();\n }\n // skip dom_templates\n \n if (!file_exists($scandir)) {\n return array();\n }\n $dh = opendir($scandir);\n if(!$dh){\n return array(); // something went wrong!?\n }\n $ret = array();\n \n while (($fn = readdir($dh)) !== false) {\n // do we care that it will try and parse the template directory??? - not really..\n // as we are only looking for php files..\n if(empty($fn) || $fn[0] == '.'){\n continue;\n }\n \n $fullpath = $scandir.(empty($scandir) ? '' : \"/\").$fn;\n // echo \"filename: $fullpath \\n\";\n \n if (is_link($fullpath)) {\n continue;\n }\n \n if(is_dir($fullpath)){\n // then recursively call self...\n $cfg['subdir'] = $subdir . (empty($subdir) ? '' : '/') . $fn;\n $children = $this->scanDir($cfg);\n if (count($children)) {\n $ret = array_merge($ret, $children);\n \n }\n continue;\n \n }\n \n if (!preg_match($cfg['match'], $fn) || !is_file($fullpath)) {\n continue;\n }\n \n \n \n $ret[] = $subdir . (empty($subdir) ? '' : '/'). $fn; /// this used to be strtolower?? why???\n\n \n \n }\n// print_r($ret);\n \n return $ret;\n \n \n \n \n }", "function _generateFilesList() {\n return array();\n }", "function experiments_index()\n{\n $text = '<ul>';\n\n foreach( scandir('content/experiments/') as $file )\n {\n if( $file !== '.' && $file !== '..' )\n if( is_dir('content/experiments/'.$file) )\n\t{\n\t $text .= '<li>';\n\t $text .= '<a href=\"/experiments/'.$file.'\">'.$file.'</a>';\n\t $text .= '</li>';\n\t}\n }\n\n $text .= '</ul>';\n\n global $page;\n $page['posts'][]= array('text'=>$text);\n}", "private function createFolderIndex(){\n //Just testing the command\n //$this->info('Starting to search the folder: '.$this->file_storage);\n $this->folders = array();\n $this->invalid_files = array();\n $this->count = 0;\n\n //Tagging all files to be able to find removed files at the end\n $SQL = \"UPDATE files SET found = '0'\";\n DB::connection('mysql')->update($SQL);\n $SQL = \"UPDATE folders SET found = '0'\";\n DB::connection('mysql')->update($SQL);\n\n //Checking if cache file exist, if not just create all the index on ES\n $this->checkCacheFolder();\n //Loop through the directories to get files ad folders\n $this->listFolderFiles($this->file_storage);//$_ENV['EBT_FILE_STORAGE']);\n //Check if any folder is missing from cache and try to create on ES\n $this->compareCacheFolders();\n\n //Remove files/folders that hasn't been found\n //if ($this->confirm('Do you wish to remove missing files? [y|N]')) {\n $this->removeMissingFiles();\n //}\n }", "public function directoryWithFilesDataProvider(): array\n {\n $multiMap = ['OtherFile' => 'other_file.json', 'JSONFile' => 'j_s_o_n_file.json'];\n $multiDirMap = ['FileFirst' => 'first/file_first.exe', 'FileSecond' => 'first/file_second.exe'];\n $multiDirMap['FileThird'] = 'second/file_third.exe';\n $multiDirMap['SomeExt'] = 'some_ext.exe';\n $singleLoadData = ['OneFile' => ['param1' => 'some_value']];\n $multiLoadData = ['OtherFile' => ['param2' => 'other_value'], 'JSONFile' => ['param3' => 'last_value']];\n $multiDirLoadData = ['FileFirst' => ['param4' => 'no_value'], 'FileSecond' => ['param5' => 'ext_value']];\n $multiDirLoadData['FileThird'] = ['param6' => 'this_value'];\n $multiDirLoadData['SomeExt'] = ['param7' => 'that_value'];\n\n return [\n 'single file' => ['single', '/^.*\\..*$/', ['OneFile' => 'one_file.json'], $singleLoadData],\n 'multiple files with mask' => ['multi', '/^.*\\.json$/', $multiMap, $multiLoadData],\n 'multiple directories' => ['container', '/^.*\\.exe$/', $multiDirMap, $multiDirLoadData],\n ];\n }", "function files_management($inputFile, $files){\n \n if($inputFile == \"./\"){\n $inputFile = \".\";\n } \n rtrim($inputFile, '\\\\/'); //odstranenie prebytocneho lomitka na konci \n $tmp_files = array();\n \n if(is_file($inputFile)){ //je to citatelny subor s priponou h\n if(is_readable($inputFile)){\n if(pathinfo($inputFile, PATHINFO_EXTENSION) == 'h'){\n array_push($files, $inputFile); //pridame ho do pola\n } \n }\n }\n elseif(is_dir($inputFile)){ //jedna sa o adresar\n $tmp_files = scandir($inputFile); //nacitame si vsetky subory v adresari\n foreach($tmp_files as $tmp){\n if($tmp != \".\" && $tmp != \"..\"){ //vynechame aktualny a nadradeny adresar\n if(is_dir($inputFile.'/'.$tmp.'/')){ //rekurzivne zanorenie v pripade, ze tu mame dalsi adresar\n if(is_readable($inputFile.'/'.$tmp)){\n files_management($inputFile.'/'.$tmp.'/', $files);\n }\n else{ //v adresari nemame pravo na citanie => chyba\n fprintf(STDERR, \"Adresar nie je mozne prehladavat.\");\n exit(2); \n } \n }\n elseif(is_file($inputFile.'/'.$tmp)){ //citatelny hlavickovy subor pridame do pola\n if(is_readable($inputFile.'/'.$tmp)){\n if(pathinfo($inputFile.'/'.$tmp, PATHINFO_EXTENSION) == 'h'){\n array_push($files, $inputFile.'/'.$tmp);\n }\n }\n }\n else{\n fprintf(STDERR, \"Zadana cesta nie je ani subor, ani adresar.\");\n exit(2);\n }\n }\n } \n \n \n }\n else{\n fprintf(STDERR, \"Zadana cesta nie je ani subor, ani adresar.\");\n exit(2);\n } \n \n return $files;\n}", "function scanfiles( $path = '' ) {\n\t\t\t\n\t\t\tglobal $bwpsoptions;\n\t\t\t\n\t\t\t$tz = get_option( 'gmt_offset' ) * 60 * 60;\n\n $data = array();\n\n\t\t\tif ( $dirHandle = @opendir( ABSPATH . $path ) ) { //get the directory\n\t\t\t\n\t\t\t\twhile ( ( $item = readdir( $dirHandle ) ) !== false ) { // loop through dirs\n\t\t\t\t\t\n\t\t\t\t\tif ( $item != '.' && $item != '..' ) { //don't scan parent/etc\n\n\t\t\t\t\t\t$relname = $path . $item;\n \n\t\t\t\t\t\t$absname = ABSPATH . $relname;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->checkFile( $relname ) == true ) { //make sure the user wants this file scanned\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( filetype( $absname ) == 'dir' ) { //if directory scan it\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data = array_merge( $data, $this->scanfiles( $relname . '/' ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else { //is file so add to array\n\n\t\t\t\t\t\t\t\t$data[$relname] = array();\n\t\t\t\t\t\t\t\t$data[$relname]['mod_date'] = @filemtime( $absname ) + $tz;\n\t\t\t\t\t\t\t\t$data[$relname]['hash'] = @md5_file( $absname );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t@closedir( $dirHandle ); //close the directory we're working with\n \n\t\t\t} \n\t\t\t\n\t\t\treturn $data; // return the files we found in this dir\n\t\t\t\n\t\t}", "public function scanIniDir($dir) {\n\n //prevent ../../../ attach\n $full_data_dir = realpath($this->configuration['base_ini_dir']);\n $full_dir_unsafe = realpath($full_data_dir . '/' . $dir);\n $full_dir = $full_data_dir . str_replace($full_data_dir, '', $full_dir_unsafe);\n\n $a_out = array();\n if (!is_dir($full_dir_unsafe)) {\n die(\"pqz.class.php: Directory $dir Not Found / full dir $full_dir\");\n }\n\n $scanned_directory = array_diff(scandir($full_dir), array('..', '.'));\n $index = 0;\n foreach ($scanned_directory as $entry) {\n\n if (is_dir(\"$full_dir/$entry\")) {\n $a_out[$index]['type'] = \"dir\";\n $a_out[$index]['path'] = $dir . $entry . '/';\n $a_out[$index]['name'] = $entry;\n $index ++;\n } else {\n // is a file\n\n $filename = $full_dir . '/' . $entry;\n\n $file_parts = pathinfo($filename);\n if (strtolower($file_parts['extension']) == 'ini') {\n \n } else {\n if ($this->debug) {\n echo \"$filename NOT an ini file\";\n }\n }\n $ini_array = parse_ini_file($filename);\n\n if (isset($ini_array['title'])) {\n $a_out[$index] = $ini_array;\n $a_out[$index]['type'] = \"file\";\n $a_out[$index]['path'] = $dir . $entry;\n $a_out[$index]['name'] = $entry;\n $index ++;\n }\n }\n }\n\n // --- sort the multidimensional array ---\n // Obtain a list of columns\n foreach ($a_out as $key => $row) {\n $type[$key] = $row['type'];\n $name[$key] = $row['name'];\n $path[$key] = $row['path'];\n }\n\n// Sort the data with volume descending, edition ascending\n// Add $data as the last parameter, to sort by the common key\n array_multisort($type, SORT_ASC, $name, SORT_ASC, $path, SORT_ASC, $a_out);\n\n return $a_out;\n }", "function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}", "function read_dir($path,$type) {\n\t $dir_array=array();\n $handle = opendir($path);\n\n $array_indx = 0;\n\n while (false != ($file = readdir($handle))) {\n\n \t\t//show only ELT files\n\t\t\tif ($type == \"elt\") {\n \t\t\tif (strstr($file, \".elt\") == \".elt\" ) {\n\t\t\t\t\t$dir_array[$array_indx] = $file;\n\t\t\t\t\t$array_indx ++;\n\t \t\t}\n\t\t\t} elseif ($type == \"dir\") {\n\t\t\t\tif (is_dir($file) && $file != \".\") {\n\t\t\t\t\t$dir_array[$array_indx] = $file;\n\t\t\t\t\t$array_indx ++;\n\t\t\t\t}\n\t\t\t}\n }\n\tif (!empty($dir_array)) {\n\t\tarray_multisort($dir_array);\n\t\t}\n\treturn $dir_array;\n}", "function file_open(){\n //$file_pointer = array();\n $read_file = array();\n $num_file = 0;\n $dir = \"/var/www/html/src/files/*\";\n foreach(glob($dir) as $file) {\n $read_file[$num_file++] = file_get_contents($file);\n }\n\n $write_file = fopen(\"/var/www/html/src/vlab/main.php\", \"w\") or die(\"Unable to open file!\");\n\n return array($read_file, $write_file);\n}", "function _get_templates()\n\t{\n\t\t$location = FILESYSTEM_PATH .'modules/customcats/templates/cattemplates/';\n\t\t$filelist=array();\n\t\tif ($handle = opendir($location))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{\n\t\t\t\tif ($file != \".\" && $file != \"..\" && $file!=\".svn\" && $file!=\"index.htm\")\n\t\t\t\t{\n\t\t\t\t\t$filelist[]=$file;\n\t\t\t\t}\n\t\t\t}\n \t\t\tclosedir($handle);\n\t\t}\n\t\treturn $filelist;\n\t}", "function getFiles(){\r\n\r\n global $dirPtr, $theFiles;\r\n \r\n chdir(\".\");\r\n $dirPtr = openDir(\".\");\r\n $currentFile = readDir($dirPtr);\r\n while ($currentFile !== false){\r\n $theFiles[] = $currentFile;\r\n $currentFile = readDir($dirPtr);\r\n } // end while\r\n \r\n}", "protected function auto_register_files()\r\n\t\t{\r\n\t\t\t// initialize variables\r\n\t\t\t$level = 0;\r\n\t\t\t\r\n\t\t\t// look through each director\r\n\t\t\tforeach( $this->paths as $i => $path )\r\n\t\t\t{\r\n\t\t\t\t// initialize variables\r\n\t\t\t\t$j \t\t= $level + 1001;\r\n\t\t\t\t$files \t= glob( \"{$path}*\" . self::REAL_EXT );\r\n\t\t\t\t$len \t= strlen( self::REAL_EXT );\r\n\t\t\t\t\r\n\t\t\t\tforeach( $files as $f )\r\n\t\t\t\t{\r\n\t\t\t\t\t// determine handle\r\n\t\t\t\t\t$file_name \t= substr( $f, 0, strlen( $f ) - $len );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( strpos( $file_name, $this->local ) !== false )\r\n\t\t\t\t\t\t$file_name = substr( $file_name, strlen( $this->local ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$handle \t= $i == self::ROOT_PATH ? strtoupper( self::ROOT_PATH ) . \"_\" : \"\";\r\n\t\t\t\t\t$handle \t.= preg_replace( \"/[^\\w]/\", \"_\", strtoupper( $file_name ) );\r\n\t\t\t\t\tdefine( $handle, $handle );\r\n\t\t\t\t\t/* The old page id number define( $handle . '_PAGEID', $j );*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t// get rid of system directories\r\n\t\t\t\t\tif ( strpos( $file_name, $this->local ) !== false )\r\n\t\t\t\t\t\t$file_name = substr( $file_name, strlen( $this->local ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t// define properties\r\n\t\t\t\t\t$this->files[ $handle ] = $file_name;\r\n\t\t\t\t\t$this->urls[ $handle ] = $this->url . str_replace( \"\\\\\", \"/\", $file_name );\r\n\t\t\t\t\t$j++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// increment for next path\r\n\t\t\t\t$level += 1000;\r\n\t\t\t\t$j = 1;\r\n\t\t\t}\r\n\t\t}", "function getPageFiles() {\n $directory = \"\";\n $pages = glob($directory . \"*.php\");\n //print each file name\n foreach ($pages as $page) {\n $row[$page] = $page;\n }\n return $row;\n}", "function listFiles ($dir)\n{\n global $filetype1, $PHP_SELF;\n if ($dir)\n { \n $file_extension = '.php';\n $d = dir($dir);\n while ($file = $d->read()){ \n $file_array[$file]=$file;\n foreach ( $file_array as $file){\n while (false !== ($entry = $d->read())) {\n // echo $entry.\"<br> \\n\";\n // echo substr($entry, strrpos($entry, '.'));\n if (substr($entry, strrpos($entry, '.')) == $file_extension){\n echo '<tr><td class=\"smallText\">' . ' <a href=\"' . tep_href_link(FILENAME_EDIT_TEXT, '&action=edit&filename=' . $entry) . '\" title=\"' . $entry . '\">' . ($entry) . '</a></td></tr>' . \"\\n\";\n }\n }\n } \n }\n $d->close();\n }\n}", "function getPageFiles() {\n\t$directory = \"../\";\n\t$pages = glob($directory . \"*.php\");\n\tforeach ($pages as $page){\n\t\t$fixed = str_replace('../','/'.$us_url_root,$page);\n\t\t$row[$fixed] = $fixed;\n\t}\n\treturn $row;\n}", "function open_and_scan($SCAN_DIRECTORY,$prev_files){\n\tglobal $files,$exempt_files,$prev_files,$exempt_directory;\n\t$changed_files = '';\n\t$file_details = stat($SCAN_DIRECTORY);\n\t$dt = array();\n\tforeach($file_details as $key=>$info){\n\t\t$dt[$key] = $info;\n\t}\n\t$data = array(\n\t\t'file'=>$SCAN_DIRECTORY,\n\t\t'info'=>$dt\n\t);\n\tarray_push($files,$data);\n\t$changed_files .= get_prev_stats($SCAN_DIRECTORY,$prev_files);\n\t\t\t\t\t\n\t$handle = opendir($SCAN_DIRECTORY);\n\twhile($f = readdir($handle)){\n\t\tif($f != '.' && $f != '..'){\n\t\t\tif(!is_dir($SCAN_DIRECTORY.$f)){\n\t\t\t\t$file_array = explode('.',$f);\n\t\t\t\t$count = count($file_array);\n\t\t\t\t$extension = $file_array[$count-1];\n\t\t\t\tif($count > 1 && !in_array($extension,$exempt_files)){\n\t\t\t\t\t$file_details = stat($SCAN_DIRECTORY.$f);\n\t\t\t\t\t$dt = array();\n\t\t\t\t\tforeach($file_details as $key=>$info){\n\t\t\t\t\t\t$dt[$key] = $info;\n\t\t\t\t\t}\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'file'=>$SCAN_DIRECTORY.$f,\n\t\t\t\t\t\t'info'=>$dt\n\t\t\t\t\t);\n\t\t\t\t\tarray_push($files,$data);\n\t\t\t\t\t$changed_files .= get_prev_stats($SCAN_DIRECTORY.$f,$prev_files);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!in_array($f,$exempt_directory)){\n\t\t\t\t\topen_and_scan($SCAN_DIRECTORY.$f.'/',$prev_files);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn array(\n\t\t'changed'=>$changed_files,\n\t\t'files'=>$files\n\t);\n}" ]
[ "0.60269266", "0.5949143", "0.58472645", "0.5707478", "0.5705214", "0.569494", "0.5678531", "0.56539243", "0.56381667", "0.55899674", "0.55722976", "0.5549382", "0.5529906", "0.55294245", "0.55207664", "0.551794", "0.5513688", "0.5500355", "0.5496562", "0.5441807", "0.54316515", "0.5417024", "0.54099125", "0.5376482", "0.53537774", "0.53404963", "0.5336317", "0.5319596", "0.5301832", "0.52954143" ]
0.6792
0
/ Function: buildzip builds a hypha.php containing all system files as zipped strings and sends it to client for download
function buildzip() { // make list of files to include $files = array_keys(index()); foreach($_POST as $p => $v) if (substr($p, 0, 6) == 'build_') $files[] = substr($p, 6).'.php'; // get the base script to modify $hypha = file_get_contents('hypha.php'); // insert superuser name and password $hypha = preg_replace('/\$username = \'.*?\';/', '\$username = \''.$_POST['username'].'\';', $hypha); $hypha = preg_replace('/\$password = \'.*?\';/', '\$password = \''.$_POST['password'].'\';', $hypha); // build data library of zipped files to include $data = " //START_OF_DATA\n"; $data .= ' case \'index\': $zip = "'.base64_encode(gzencode(implode(',', array_keys(index())), 9)).'"; break;'."\n"; foreach ($files as $file) $data.= ' case \''.$file.'\': $zip = "'.base64_encode(gzencode(file_get_contents($file), 9)).'"; break;'."\n"; $data .= " //END_OF_DATA\n"; // include data library $hypha = preg_replace('#^\t*//START_OF_DATA\n.*//END_OF_DATA\n#ms', $data, $hypha); // push script to client header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="hypha.php"'); echo $hypha; exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function build_zip() {\n\n\t\t$file_uploads = isset($_POST['file_uploads']) ? $_POST['file_uploads'] : '';\n\n\t\t$all_file_paths = array();\n\t\tif($file_uploads){\n\t\t\tforeach ($file_uploads as $key => $id) {\n\t\t\t\t$post_thumbnail_id = get_post_thumbnail_id( $id );\n\t\t\t\t$file_path = get_attached_file( $post_thumbnail_id ); \n\n\t\t\t\tif( file_exists( $file_path ) ){\n\t\t\t\t\t$all_file_paths[] = $file_path;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n \tini_set('max_execution_time', 0);\n\n \t$file_name = time() . '_all_banners.zip';\n \t$dirname = ABSPATH . trailingslashit( get_option('upload_path') ) . 'zip_downloads';\n\n \tif ( !is_dir( $dirname ) )\n \t\tmkdir( $dirname, 0777, true );\n\n \t$zip_path = $dirname . '/' . $file_name;//location of zip on server. set in construct\n\n \t$files_to_zip = $all_file_paths;\n\n \tif( count( $files_to_zip ) ){//check we have valid files\n\n\t \t$zip = new ZipArchive;\n\t \t$opened = $zip->open( $zip_path, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE );\n\n\t \tif( $opened !== true ){\n\t\n\t \tdie(\"cannot open file.zip for writing. Please try again in a moment.\");\n\t\n\t \t}//endif\n\t\n\t \tforeach ( $files_to_zip as $file ) {\n\t\n\t \t$short_name = basename( $file );\n\t \t$zip->addFile( $file, $short_name );\n\t\n\t }//end foreach\n\n \t\t$zip->close();\n\n \t}//endif\n\n \t\t$download_link = trailingslashit( get_site_url() ) . trailingslashit( get_option('upload_path') ) . 'zip_downloads'. '/' . $file_name;\n \t\techo $download_link;\n\n \tdie();\n\n\t}", "public function GenerateZipArchive(){\n $datetime = new DateTime();\n $timestamp = $datetime->getTimestamp();\n $zip = new ZipArchive();\n $zip_file_path = '../storage/app/public/media/DECIMER_results_' . $timestamp . '.zip';\n if ($zip->open($zip_file_path, ZipArchive::CREATE)!==TRUE) {\n exit(\"Cannot open <$zip_file_path>\\n\");\n }\n return [$zip, $zip_file_path];\n }", "function generate_zip($filename){\n\n try {\n $filename = $this->parent_dir() . ($filename);\n\t\t\t@unlink($filename);\n \n\t\t\t$zip = new ZipArchive();\n\t\t\t$ret = $zip->open($filename, ZipArchive::CREATE );\t\t\t\n\t\t\t$files = glob( $this->working_dir .'page*' );\n foreach($files as $fn){\n $zip->addFile($fn,basename($fn));\n }\n\n $zip->close();\n \n return $filename;\n } catch (Exception $ex){\n error_log($ex->getMessage() );\n }\n }", "public function createZipFileFromExtensionGeneratesCorrectArchive() {}", "protected function compile() {\n\t\tglobal $objPage;\n\n\t\t$downloadPath = TL_ROOT.'/web/bundles/siowebdownloadfolder/downloads/';\n\t\t$downloadFile = 'bundles/siowebdownloadfolder/downloads/'.$this->downloadFileTitle.'.zip';\n\n\t\tif(is_file($downloadFile)) {\n\t\t\tunlink($downloadFile);\n\t\t}\n\t\t\n\t\t$files = array();\n\t\t$auxDate = array();\n\n\t\t$objFiles = $this->objFiles;\n\t\t$allowedDownload = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));\n\n\t\tif(!is_dir($downloadPath)) {\n\t\t\tSystem::log('Try to Zip files, can\\'t find folder \\'dowloads\\' in '.TL_ROOT.'/bundles/siowebdownloadfolder/','compile ZIP-Download',false);\n\t\t\treturn false;\n\t\t}\n\t\tif(!$this->downloadFileTitle) {\n\t\t\tSystem::log('No downloadfile-title found, please add a filename.','compile ZIP-Download',false);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get all files\n\t\twhile($objFiles->next()) {\n\t\t\t// Continue if the files has been processed or does not exist\n\t\t\tif(isset($files[$objFiles->path]) || !file_exists(TL_ROOT . '/' . $objFiles->path))\n\t\t\t\tcontinue;\n\n\t\t\t// Single files\n\t\t\tif($objFiles->type == 'file') {\n\t\t\t\t$objFile = new \\File($objFiles->path, true);\n\n\t\t\t\tif(!in_array($objFile->extension, $allowedDownload) || preg_match('/^meta(_[a-z]{2})?\\.txt$/', $objFile->basename)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$Pathinfo = pathinfo($objFiles->path);\n\t\t\t\t/* The Zip-Path D: */\n\t\t\t\t// echo \"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"<br>\";\n\t\t\t\t// echo '<pre>'.print_r($Pathinfo,1).'</pre>';\n\t\t\t\texec(\"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"\",$var);\n\t\t\t\t// echo 'Dirname: '.$Pathinfo['dirname'].'<br>';\n\t\t\t\t// echo '<pre>'.print_r($var,1).'</pre>';\n\t\t\t} else {\n\t\t\t\t$objSubfiles = \\FilesModel::findByPid($objFiles->uuid);\n\t\t\t\t\n\t\t\t\tif($objSubfiles === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twhile($objSubfiles->next()) {\n\t\t\t\t\tif(isset($files[$objFiles->path]) || !file_exists(TL_ROOT . '/' . $objFiles->path)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$Pathinfo = pathinfo($objSubfiles->path);\n\t\t\t\t\t/* The Zip-Path D: */\n\t\t\t\t\t// echo \"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"<br>\";\n\t\t\t\t\t// echo '<pre>'.print_r($Pathinfo,1).'</pre>';\n\t\t\t\t\texec(\"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"\",$var);\n\t\t\t\t\t// echo 'Dirname: '.$Pathinfo['dirname'].'<br>';\n\t\t\t\t\t// echo '<pre>'.print_r($var,1).'</pre>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->Template->title = $this->Template->link = $this->Template->name = $this->downloadFileTitle;\n\t\t$this->Template->href = $downloadFile;\n\t\t$this->Template->icon = TL_ASSETS_URL . 'assets/contao/images/iconRAR.gif';\n\t\t$this->Template->extension = 'zip';\n\t\t$this->Template->mime = 'application/zip';\n\t\t$this->Template->path = $newDownloadPath;\n\t}", "public function getZippedfile() {\r\n\r\n $data = implode(\"\", $this -> compressedData); \r\n $controlDirectory = implode(\"\", $this -> centralDirectory); \r\n\r\n return \r\n $data. \r\n $controlDirectory. \r\n $this -> endOfCentralDirectory. \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"V\", strlen($controlDirectory)). \r\n pack(\"V\", strlen($data)). \r\n \"\\x00\\x00\"; \r\n }", "function makeZip ($zip_name, $array_to_zip) {\n global $wpdb;\n $upload_dir = wp_upload_dir();\n $zip = new ZipArchive();\n // On crée l’archive.\n $archive_name = $zip_name . '.zip';\n \n $return = '';\n $error = '';\n foreach ($array_to_zip as $post_type => $post) {\n if ('attachement' == $post_type) {\n $sql = 'SELECT `ID`, `guid`\n FROM `' . $wpdb->prefix . 'posts`\n WHERE `ID` IN (' . implode(',', $array_to_zip[$post_type]) . ')\n AND `post_type` = \"' . $post_type . '\"';\n $results = $wpdb->get_results($sql);\n \n if (0 < $wpdb->num_rows) {\n if ($zip->open($upload_dir['basedir'] . '/' . $archive_name, ZipArchive::CREATE) == TRUE) {\n // echo 'Zip.zip ouvert';\n foreach ($results as $result) {\n $file = str_replace($upload_dir['baseurl'], $upload_dir['basedir'], $result->guid);\n $file = str_replace('\\\\', '/', $file);\n $file_title = basename($file);\n setlocale(LC_ALL, 'fr_FR.UTF-8');\n $file_title = iconv('UTF-8', 'ASCII//TRANSLIT', $file_title);\n $zip->addFile($file, $file_title);\n }\n $zip->close();\n\n $return = $upload_dir['baseurl'] . '/' . $archive_name;\n } else {\n $error .= 'no-open-archive';\n // Traitement des erreurs avec un switch(), par exemple.\n }\n } else {\n $error .= 'no-files-in-db';\n }\n } else {\n $sql = 'SELECT `ID`, `post_title`, `post_content`, `guid`\n FROM `' . $wpdb->prefix . 'posts`\n WHERE `ID` IN (' . implode(',', $array_to_zip[$post_type]) . ')\n AND `post_type` = \"' . $post_type . '\"';\n $results = $wpdb->get_results($sql);\n \n if (0 < $wpdb->num_rows) {\n if (file_exists($upload_dir['basedir'] . '/' . $archive_name)) {\n $open_zip = $zip->open($upload_dir['basedir'] . '/' . $archive_name);\n } else {\n $open_zip = $zip->open($upload_dir['basedir'] . '/' . $archive_name, ZipArchive::CREATE);\n }\n if ($open_zip == TRUE) {\n foreach ($results as $result) {\n $url = ajouterParametreGET($result->guid, 'is_print', 'yes');\n $html = file_get_contents(html_entity_decode($url));\n setlocale(LC_ALL, 'fr_FR.UTF-8');\n $title = iconv('UTF-8', 'ASCII//TRANSLIT', $result->post_title);\n $title = preg_replace(\"#['\\\"\\r\\n]#\", ' ', $title);\n $title = preg_replace(\"#\\s+#\", ' ', $title);\n $zip->addFromString($result->ID . ' - ' . $title . '.html', $html);\n }\n $zip->close();\n $return = $upload_dir['baseurl'] . '/' . $archive_name;\n // error_log($return);\n } else {\n $error .= 'no-open-archive';\n // Traitement des erreurs avec un switch(), par exemple.\n }\n }else {\n $error .= 'no-articles-in-db';\n }\n }\n }\n if ('' == $error) {\n echo $return;\n } else {\n echo $error;\n }\n}", "function zip_download ($array)\r\n{\r\n\tglobal $_course;\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user;\r\n\tglobal $files;\r\n\t\r\n\t$sys_course_path = api_get_path(SYS_COURSE_PATH);\r\n\t\r\n\t// zip library for creation of the zipfile\r\n\tinclude(api_get_path(LIBRARY_PATH).\"/pclzip/pclzip.lib.php\");\r\n\r\n\t// place to temporarily stash the zipfiles\r\n\t$temp_zip_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\";\r\n\r\n\t// create the directory if it does not exist yet.\r\n\tif(!is_dir($temp_zip_dir))\r\n\t{\r\n\t\tmkdir($temp_zip_dir);\r\n\t}\r\n\r\n\tcleanup_temp_dropbox();\r\n\r\n\t$files='';\r\n\r\n\t// note: we also have to add the check if the user has received or sent this file. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\t$sql=\"SELECT distinct file.filename, file.title, file.author, file.description\r\n\t\t\tFROM \".$dropbox_cnf[\"tbl_file\"].\" file, \".$dropbox_cnf[\"tbl_person\"].\" person\r\n\t\t\tWHERE file.id IN (\".implode(', ',$array).\")\r\n\t\t\tAND file.id=person.file_id\r\n\t\t\tAND person.user_id='\".$_user['user_id'].\"'\";\r\n\t$result=api_sql_query($sql,__FILE__,__LINE__);\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$files[$row['filename']]=array('filename'=>$row['filename'],'title'=>$row['title'], 'author'=>$row['author'], 'description'=>$row['description']);\r\n\t}\r\n\r\n\t//$alternative is a variable that uses an alternative method to create the zip\r\n\t// because the renaming of the files inside the zip causes error on php5 (unexpected end of archive)\r\n\t$alternative=true;\r\n\tif ($alternative)\r\n\t{\r\n\t\tzip_download_alternative($files);\r\n\t\texit;\r\n\t}\r\n\r\n\t// create the zip file\r\n\t$temp_zip_file=$temp_zip_dir.'/dropboxdownload-'.$_user['user_id'].'-'.mktime().'.zip';\r\n\t$zip_folder=new PclZip($temp_zip_file);\r\n\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\t// met hernoemen van de files in de zip\r\n\t\t$zip_folder->add(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox/\".$value['filename'],PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox\", PCLZIP_CB_PRE_ADD, 'my_pre_add_callback');\r\n\t\t// zonder hernoemen van de files in de zip\r\n\t\t//$zip_folder->add(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox/\".$value['filename'],PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox\");\r\n\t}\r\n\r\n\t// create the overview file\r\n\t$overview_file_content=generate_html_overview($files, array('filename'), array('title'));\r\n\t$overview_file=$temp_zip_dir.'/overview.html';\r\n\t$handle=fopen($overview_file,'w');\r\n\tfwrite($handle,$overview_file_content);\r\n\r\n\r\n\t// send the zip file\r\n\tDocumentManager::file_send_for_download($temp_zip_file,true,$name);\r\n\texit;\r\n}", "protected function prepareSequenzes ($blZip = true) {\n if (!MLCache::gi()->exists($this->sCacheName)) {\n $this->blUseZip = false;\n if ($blZip && class_exists('ZipArchive', false)) {\n try {\n if (count(\n MLHelper::getFilesystemInstance()\n ->rm($this->getPath('zip'))\n ->write($this->getPath('zip'))\n ->readDir($this->getPath('zip').'/', array())\n ) == 0\n ) {\n try {\n $sBuild = MLSetting::gi()->get('sClientBuild');\n } catch (Exception $ex) {\n $sBuild = '';\n }\n foreach (array(\n 'files.list?format=zip&build='.$sBuild => '__plugin', \n 'external.list?format=zip&shopsystem='.MLShop::gi()->getShopSystemName().'&build='.$sBuild => '__external'\n ) as $sRequest => $sType) {\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start: $sType = '.$sType.')' => __LINE__, '$sRequest' => $sRequest));\n @set_time_limit(60 * 10); // 10 minutes\n $sZipName = 'updater'.$sType.'.zip';\n MLCache::gi()->delete($sZipName);\n $warnings = null;\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start-zip: $sType = '.$sType.')' => __LINE__));\n $sContent = MLHelper::gi('remote')->fileGetContents($this->getPath('server').$sRequest, $warnings, 20);\n MLCache::gi()->set($sZipName, $sContent, 60);\n $oZip = new ZipArchive();\n $oZip->open(MLFilesystem::getCachePath('updater'.$sType.'.zip'));\n @set_time_limit(60 * 10); // 10 minutes\n $oZip->extractTo($this->getPath('zip').$sType);\n $oZip->close();\n if (count(MLHelper::getFilesystemInstance()->readDir($this->getPath('zip').'/'.$sType.'/', array())) < 1) {\n throw new Exception('Problems with archiv files.', 1462872613);\n }\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end-zip: $sType = '.$sType.')' => __LINE__));\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end: $sType = '.$sType.')' => __LINE__, '$sRequest' => $sRequest));\n }\n @set_time_limit(60 * 10); // 10 minutes\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start: rm-__plugin-start)' => __LINE__));\n $this->rm(array('dst' => $this->getPath('staging').'/__plugin/'));// in zip mode dont scan staging again - all data comes from zip\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end: rm-__plugin-start)' => __LINE__));\n $this->blUseZip = true;\n }\n } catch (Exception $oEx) {\n// echo $oEx->getMessage();\n }\n }\n $aMerged = array();\n foreach(array('server', 'plugin', 'staging') as $sFolder ) {\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start: $sFolder = '.$sFolder.')' => __LINE__));\n @set_time_limit(60 * 10); // 10 minutes\n if ($this->blUseZip == true && $sFolder == 'plugin') {// add customer and dev-module to staging, plugin dont have external files\n foreach ($this->aCopyLocal2Staging as $sCopyLocal2Staging) {\n $aPluginOrExtenal = MLHelper::gi('remote')->getFileList(MLFilesystem::getLibPath($sCopyLocal2Staging));\n foreach ($aPluginOrExtenal['__plugin'] as $sFolderFileIdent => $aFolderFilesData) {\n $aMerged[$sCopyLocal2Staging.$sFolderFileIdent]['plugin'] = array(\n 'src' => $sCopyLocal2Staging.$aFolderFilesData['src'],\n 'dst' => $sCopyLocal2Staging.$aFolderFilesData['dst'],\n 'hash' => $aFolderFilesData['hash'],\n );\n }\n $aMerged[$sCopyLocal2Staging]['plugin'] = array(\n 'src' => $sCopyLocal2Staging,\n 'dst' => $sCopyLocal2Staging,\n 'hash' => 0,\n );\n }\n } else {\n foreach (MLHelper::gi('remote')->getFileList($this->getPath($sFolder)) as $aPluginOrExtenal) {\n foreach ($aPluginOrExtenal as $sIdentPath => $aData) {\n if ($sIdentPath == '__/') { // path dont comes from server.lst, but path is part of plugin\n continue;\n }\n $aMerged[$sIdentPath][$sFolder] = $aData;\n }\n }\n }\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end: $sFolder = '.$sFolder.')' => __LINE__));\n }\n foreach ($this->aCopyLocal2Staging as $sCopyLocal2Staging) {\n $aPluginOrExtenal = MLHelper::gi('remote')->getFileList(MLFilesystem::getLibPath($sCopyLocal2Staging));\n foreach ($aPluginOrExtenal['__plugin'] as $sFolderFileIdent => $aFolderFilesData) {\n $aMerged[$sCopyLocal2Staging.$sFolderFileIdent]['server'] = array(\n 'src' => $sCopyLocal2Staging.$aFolderFilesData['src'],\n 'dst' => $sCopyLocal2Staging.$aFolderFilesData['dst'],\n 'hash' => $aFolderFilesData['hash'],\n );\n }\n $aMerged[$sCopyLocal2Staging]['server'] = array(\n 'src' => $sCopyLocal2Staging,\n 'dst' => $sCopyLocal2Staging,\n 'hash' => 0,\n );\n }\n \n /* @var $aSequences output array */\n $aSequences = array();\n \n //prefill actions\n foreach (array(\n 'staging', // (server||plugin) => staging\n 'plugin', // staging => plugin\n ) as $sDstType) {\n $aSequences[$sDstType] = array(\n '' => array(), // do nothing just statistic\n 'mkdir' => array(), // create folders before copy\n 'cp' => array(),\n 'rm' => array(),\n 'rmdir' => array(), // delete folders afer delete files\n );\n }\n foreach ($aMerged as $sIdentPath => &$aFolderData) {\n \n // check ignore patterns\n foreach($this->aIgnorePatterns as $sPattern){\n if(preg_match('/'.$sPattern.'/Uis', $sIdentPath)){\n continue 2;\n }\n }\n \n // fill plugin data dynamicly, plugin dont know external files before\n $this->addPluginDataDynamicly($aFolderData, $sIdentPath);\n \n // (plugin || server) => staging\n $aStaging = $this->calcStagingSequence($aFolderData, $sIdentPath);\n if ($this->blDebug) {\n $aStaging['data']['data'] = $aFolderData;\n }\n $aSequences['staging'][$aStaging['action']][$sIdentPath] = $aStaging['data'];\n \n // now staging is equal to server\n if (isset($aFolderData['server'])) {\n $aFolderData['staging'] = $aFolderData['server'];\n }\n \n // staging => plugin\n $aPlugin = $this->calcPluginSequence($aFolderData, $sIdentPath);\n if ($this->blDebug) {\n $aPlugin['data']['data'] = $aFolderData;\n }\n $aSequences['plugin'][$aPlugin['action']][$sIdentPath] = $aPlugin['data'];\n }\n //sorting\n foreach ($aSequences as $sSequence => $aSequence) {\n if (isset($aSequence['mkdir'])) { // create dirs ascending\n ksort($aSequences[$sSequence]['mkdir']);\n }\n if (isset($aSequence['rmdir'])) { // delete dirs descending\n krsort($aSequences[$sSequence]['rmdir']);\n }\n }\n foreach ($aSequences as $sSequence => $aSequence) {\n foreach ($aSequence as $sSequenceType => $aSequenceData) { // remote actions\n if (!empty($sSequenceType)) {\n foreach ($aSequenceData as $sActionIdent => $aActionData) {\n if (strpos($sActionIdent, '__/') === 0) {\n $this->aMeta['remoteActions'][$sSequence][$sActionIdent] = array($sSequenceType =>$aActionData);\n }\n }\n }\n }\n }\n $this->aSequences = $aSequences;\n } elseif (empty($this->aSequences)) {// load cached\n $aCached = MLCache::gi()->get($this->sCacheName);\n $this->aSequences = $aCached['sequences'];\n $this->aMeta = $aCached['meta'];\n } \n if (empty($this->aSequences)) {\n MLCache::gi()->delete($this->sCacheName);\n } else {\n MLCache::gi()->set($this->sCacheName, array('sequences' => $this->aSequences, 'meta' => $this->aMeta), 10 * 60);\n }\n return $this;\n }", "private function createZip(){\n $zipper = new \\Chumper\\Zipper\\Zipper;\n $files = glob(public_path('storage/*'));\n $zipper->make(public_path('allImages.zip'))->add($files);\n }", "protected function compile()\n\t{\n#\t\t$objArchive = new \\ZipWriter('system/tmp/'. $strTmp);\n\t\tif(\\Input::Get('download') && FE_USER_LOGGED_IN)\n\t\t{\n\t\t\t$objDownload = $this->Database->prepare(\"SELECT * FROM tl_download_item WHERE id=?\")->execute(\\Input::Get('download'));\n\t\t\t$objFile = \\FilesModel::findByUuid($objDownload->fileSRC);\n\n\t\t\t$this->sendFileToBrowser($objFile->path);\n\t\t}\n\n\t\t$objPage = \\PageModel::findById($GLOBALS['objPage']->id);\n\t\t$strUrl = $this->generateFrontendUrl($objPage->row(), '/download/%s');\n\n\t\t$objCategory = $this->Database->prepare(\"SELECT * FROM tl_download_category WHERE alias=?\")->execute(\\Input::Get('category'));\n\t\t$objArchiv = $this->Database->prepare(\"SELECT * FROM tl_download_archiv WHERE id=?\")->execute($objCategory->pid);\n\n\t\t$objData = $this->Database->prepare(\"SELECT * FROM tl_download_item WHERE pid=? && published=1 ORDER BY sorting ASC\")->execute($objCategory->id);\n\t\twhile($objData->next())\n\t\t{\n\t\t\t$objItem = (object) $objData->row();\n\n#\t\t\t$objItem->archiv = $objArchiv->title;\n#\n#\t\t\tif($objCategory->singleSRC)\n#\t\t\t{\n#\t\t\t\t$objItem->archivIcon = \\FilesModel::findByUuid($objCategory->singleSRC)->path;\n#\t\t\t}\n#\n#\t\t\t$objItem->category = $objCategory->title;\n#\t\t\t$objItem->singleSRC = deserialize($objItem->singleSRC);\n#\n#\t\t\t$arrImages = array();\n#\t\t\tif(is_array($objItem->singleSRC))\n#\t\t\t{\n#\t\t\t\tforeach($objItem->singleSRC as $image)\n#\t\t\t\t{\n#\t\t\t\t\t$arrImages[] = (object) array\n#\t\t\t\t\t(\n#\t\t\t\t\t\t'css' => '',\n#\t\t\t\t\t\t'path' => \\FilesModel::findByUuid($image)->path\n#\t\t\t\t\t);\n#\t\t\t\t}\n#\n#\t\t\t\t$arrImages[0]->css = 'first';\n#\t\t\t}\n#\n#\n#\t\t\tif(FE_USER_LOGGED_IN)\n#\t\t\t{\n#\t\t\t\t$objItem->url = sprintf($strUrl, $objItem->id);\n#\t\t\t\t$objItem->css = 'active';\n#\t\t\t\t$objItem->preview = $arrImages;\n#\t\t\t}\n#\t\t\telse\n#\t\t\t{\n#\t\t\t\t$objItem->css = 'inactive';\n#\t\t\t\t$objItem->preview = array($arrImages[0]);\n#\n#\t\t\t}\n\n\t\t\t$arrData[] = $objItem;\n\t\t}\n\n#\t\tif(!count($arrDaata)) { $arrData = array(); }\n\n\t\t$this->Template->items = $arrData;\n\t}", "function zipFilesAndDownload($storyid)\r\n\r\n\t\t{\t \r\n\r\n \t\t\t$getMediaData = getMediaData($storyid);\r\n\r\n \t\t\t$file_path = './uploads/';\r\n\r\n\t\t\t$files = array_filter($getMediaData);\r\n\r\n \t\t\t//array('59c8d31fdc4db.jpg', '59c8d320ca186.jpg');\r\n\r\n \t\t\t ##\r\n\r\n \t\t\t \t##merge all the elements in a string with comma separated string\r\n\r\n\t\t\t\tforeach($files as $f){ \r\n\r\n\t\t\t\t\t$result_file .= ','.$f;\r\n\r\n\t\t\t\t}\r\n\r\n \t\t\t\t$files_all = array();\r\n\r\n\t\t\t\t$files_all = array_filter(explode(',',$result_file));\r\n\r\n\t\t\t ##\r\n\r\n \t\t\t$zipname = 'file.zip';\r\n\r\n \t\t\t$zip = new ZipArchive;\r\n\r\n\t\t\t$zip->open($zipname, ZipArchive::CREATE);\r\n\r\n\t\t\t \r\n\r\n\t\t\tforeach ($files_all as $file) {//echo '<pre>';print_r($file);exit;\r\n\r\n \t\t\t\t$zip->addFile(trim($file_path).trim($file)); \r\n\r\n \t\t\t} \r\n\r\n\t\t\t$zip->close();\r\n\r\n \t\t\t//then send the headers to download the zip file\r\n\r\n \t\t\theader(\"Content-type: application/zip\");\r\n\r\n\t\t\theader(\"Content-Disposition: attachment; filename=$zipname\");\r\n\r\n \t\t\theader(\"Cache-Control: no-cache, must-revalidate\");\r\n\r\n\t\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\r\n\r\n \t\t\t//header(\"Pragma: no-cache\");\r\n\r\n\t\t\t//header(\"Expires: 0\");\r\n\r\n\t\t\treadfile(\"$zipname\");\r\n\r\n\t\t\texit; \r\n\r\n\t\t}", "protected function createArchive()\n {\n $branch = $this->getCurrenBranch();\n\n $dir = HOME.'/repos/'.$this->getRepoName().'/'.$branch.'/archives/';\n\n if (!$this->getFilesystem()->exists($dir)) {\n $this->getFilesystem()->makeDirectory($dir);\n }\n\n $output = $dir.time().'.zip';\n $this->repository->archive(['--format=zip', $branch, '--output='.$output]);\n\n return $output;\n }", "public function index()\n {\n $fileName = 'itsolutionstuff.txt';\n $fileData = 'This file created by Itsolutionstuff.com';\n \n $this->zip->add_data($fileName, $fileData);\n \n $fileName2 = 'itsolutionstuff_file2.txt';\n $fileData2 = 'This file created by Itsolutionstuff.com - 2';\n \n $this->zip->add_data($fileName2, $fileData2);\n \n $this->zip->download('Itsolutionstuff_zip.zip');\n }", "public function default_zip($val) {\n\t\t$this->mutter(\"\\ngzipping \".basename($val).\"...\");\n\t\t$data['file_size'] = filesize($val);\n\t\texec(\"/usr/bin/gzip -c $val > $val.gz\",$output);\n\t\tusleep(10000);\n\t\t//unlink(\"{$this->dir}/$val\");\n\t\t$data['file_size_compressed'] = filesize(\"$val.gz\");\n\t\t$data['file_name'] = basename($val);\n\t\treturn $data;\n\t}", "function create_zip($files1 = array(), $files2 = array(), $files3 = array(), $destination = '',$overwrite = false, $lab_config_id) \n{\n\t//if the zip file already exists and overwrite is false, return false\n\tif(file_exists($destination) && !$overwrite) { return false; }\n\t//vars\n\t$valid_files1 = array();\n\t$valid_files2 = array();\n\t//if files were passed in...\n\tif(is_array($files1)) \n\t{\n\t\t//cycle through each file\n\t\tforeach($files1 as $file) \n\t\t{\n\t\t\t//make sure the file exists\n\t\t\tif(file_exists($file)) \n\t\t\t{\n\t\t\t\t$valid_files1[] = $file;\n\t\t\t}\n\t\t}\n\t}\n\tif(is_array($files2)) \n\t{\n\t\t//cycle through each file\n\t\tforeach($files2 as $file) \n\t\t{\n\t\t\t//make sure the file exists\n\t\t\tif(file_exists($file)) \n\t\t\t{\n\t\t\t\t$valid_files2[] = $file;\n\t\t\t}\n\t\t}\n\t}\n\tif(is_array($files3)) \n\t{\n\t\t//cycle through each file\n\t\tforeach($files3 as $file) \n\t\t{\n\t\t\t//make sure the file exists\n\t\t\tif(file_exists($file)) \n\t\t\t{\n\t\t\t\t$valid_files3[] = $file;\n\t\t\t}\n\t\t}\n\t}\n\t//create the archive\n\t$zip = new ZipArchive();\n\t//if($zip->open($destination, $overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) \n\tif($zip->open($destination, ZIPARCHIVE::OVERWRITE) !== true) \n\t{\n\t\treturn false;\n\t}\n\t//if we have good files...\n\tif(count($valid_files1)) \n\t{\n\t\t//add the files\n\t\tforeach($valid_files1 as $file) \n\t\t{\n\t\t\t$file_parts = explode(\"/\", $file);\n\t\t\t$zip->addFile($file, \"blis_\".$lab_config_id.\"/\".$file_parts[4]);\n\t\t}\n\t}\n\tif(count($valid_files2)) \n\t{\n\t\t//add the files\n\t\tforeach($valid_files2 as $file) \n\t\t{\n\t\t\t$file_parts = explode(\"/\", $file);\n\t\t\t$zip->addFile($file, \"blis_revamp/\".$file_parts[4]);\n\t\t}\n\t}\n\tif(count($valid_files3)) \n\t{\n\t\t//add the files\n\t\tforeach($valid_files3 as $file) \n\t\t{\n\t\t\t$file_parts = explode(\"/\", $file);\n\t\t\t$zip->addFile($file, \"langdata/\".$file_parts[2]);\n\t\t}\t\n\t}\n\t$timestamp = date(\"Y-m-d H:i\");\n\t$lab_config = LabConfig::getById($lab_config_id);\n\t$site_name = $lab_config->getSiteName();\n\t$readme_content = \"\";\n\tif($_SESSION['locale'] != \"fr\")\n\t{\n\t$readme_content = <<<EOF\nBLIS Data Backup\n================\nFacility: $site_name .\nBackup date and time: $timestamp .\nTo restore data, copy and overwrite folders named \"blis_revamp\" and \"blis_$lab_config_id\" in \"dbdir\" directory.\nTo restore language translation values, copy and overwrite folder named \"langdata\" in \"htdocs\" directory.\n-\nEOF;\n\t}\n\telse\n\t{\n\t$readme_content = <<<EOF\nBLIS Data Backup\n================\nFacilité: $site_name .\nDate de sauvegarde et de temps: $timestamp .\nPour restaurer les données, de copier et écraser les dossiers nommés \"blis_revamp\" et \"blis_$lab_config_id\" dans \"dbdir\" dossier\".\nPour restaurer les valeurs de la traduction, copier le répertoire et remplacer le nom \"langdata\" dans \"htdocs\" dossier.\n-\nEOF;\n\t}\n\t$zip->addFromString('readme.txt', $readme_content);\n\t//debug\n\techo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->getStatusString();\n\t//close the zip -- done!\n\t$zip->close();\n\t//check to make sure the file exists\n\treturn file_exists($destination);\n}", "function ready_zip_for_remote($copy)\n{\n\t$file_locs=json_decode($copy);\n\t$zip_file_name=date(\"Ymdhis\");\n\tcreate_zip($file_locs, \"tmp/\".$zip_file_name.\".zip\");\n\techo $zip_file_name;\n}", "function write_zip($repo) {\n $p = basename($repo);\n $proj = explode(\".\", $p);\n $proj = $proj[0];\n //TODO: clean this up\n exec(\"cd /tmp && git-clone $repo && rm -Rf /tmp/$proj && zip -r $proj.zip $proj && rm -Rf /tmp/$proj\");\n\n $filesize = filesize(\"/tmp/$proj.zip\");\n header(\"Pragma: public\"); // required\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false); // required for certain browsers\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Type: application/x-zip\");\n header(\"Content-Length: \" . $filesize);\n header(\"Content-Disposition: attachment; filename=\\\"$proj.zip\\\";\");\n echo file_get_contents(\"/tmp/$proj.zip\");\n die();\n}", "function _createZIPFile(& $contents, & $ctrlDir, $path) \n {\n\t \n $data = implode('', $contents);\n $dir = implode('', $ctrlDir);\n\n $buffer = $data . $dir . $this->_ctrlDirEnd .\n /* Total # of entries \"on this disk\". */\n pack('v', count($ctrlDir)) .\n /* Total # of entries overall. */\n pack('v', count($ctrlDir)) .\n /* Size of central directory. */\n pack('V', strlen($dir)) .\n /* Offset to start of central dir. */\n pack('V', strlen($data)) .\n /* ZIP file comment length. */\n \"\\x00\\x00\";\n \n $w = $this->_vfile->write($path, $buffer);\n if (VWP::isWarning($w)) {\n return $w;\n }\t\t\n return true;\n }", "function api_download($extension_id) {\n\t$extension = new Extension($extension_id);\n\t\n\t$locales = $extension->locales;\n\t\n\t$zip_location = tempnam(sys_get_temp_dir(), \"\");\n\t\n\t$zip = new ZipArchive();\n\t$zip->open($zip_location, ZIPARCHIVE::CREATE);\n\t\n\tforeach ($locales as $locale) {\n\t\tif ($locale->message_count > 0) {\n\t\t\t$directory_name = format_locale_code($locale->locale_code, $extension->type);\n\t\t\t\n\t\t\t$zip->addEmptyDir($directory_name);\n\t\t\t\n\t\t\t$files = $locale->files_messages;\n\t\t\t\n\t\t\tforeach ($files as $file => $messages) {\n\t\t\t\t$zip->addFromString(\n\t\t\t\t\t$directory_name . \"/\" . $file,\n\t\t\t\t\tconvert_unicode_escapes(\n\t\t\t\t\t\tformat_locale_file($locale->getMessagesJSON($file), $file)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$zip->close();\n\t\n\theader(\"Content-Type: application/zip\");\n\theader(\"Content-Disposition: attachment; filename=\".slugify($extension->name).\"-locales.zip\");\n\theader(\"Pragma: no-cache\");\n\theader(\"Expires: 0\");\n\theader(\"Content-Length: \" . filesize($zip_location));\n\treadfile($zip_location);\n\texit;\n}", "private function createZipBackup() {\n\t\t$zip = new \\ZipArchive ();\n\t\t$file_name = $this->file_name . '.zip';\n\t\tif ($zip->open ( $file_name, \\ZipArchive::CREATE ) === TRUE) {\n\t\t\t$zip->addFile ( $this->file_name, basename ( $this->file_name ) );\n\t\t\t$zip->close ();\n\t\t\t\n\t\t\t@unlink ( $this->file_name );\n\t\t}\n\t}", "private function createZipBackup() {\n\t\t$zip = new \\ZipArchive ();\n\t\t$file_name = $this->file_name . '.zip';\n\t\tif ($zip->open ( $file_name, \\ZipArchive::CREATE ) === TRUE) {\n\t\t\t$zip->addFile ( $this->file_name, basename ( $this->file_name ) );\n\t\t\t$zip->close ();\n\t\t\t\n\t\t\t@unlink ( $this->file_name );\n\t\t}\n\t}", "function createPackage() {\n\t\t$package = new ZipArchive();\n\t\t$package->open($this->getPackageFilePath(), ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE);\n\t\tforeach ($this->_files as $fileName => $filePath) {\n\t\t\t$package->addFile($filePath, $fileName);\n\t\t}\n\t\t$package->close();\n\t}", "function doArchive($course_id, $course_code) {\n global $webDir, $tool_content, $langGeneralError;\n\n // Remove previous back-ups older than 10 minutes\n touch(\"$webDir/courses/archive/index.html\");\n cleanup(\"$webDir/courses/archive\", 600);\n\n $basedir = \"$webDir/courses/archive/$_SESSION[csrf_token]/$course_code\";\n file_exists($basedir) or make_dir($basedir);\n\n $backup_date = date('Ymd-His');\n $backup_date_short = date('Ymd');\n\n $archivedir = $basedir . '/' . $backup_date;\n file_exists($archivedir) or make_dir($archivedir);\n\n archiveTables($course_id, $course_code, $archivedir);\n\n $zipfile = \"$webDir/courses/archive/$_SESSION[csrf_token]/$course_code-$backup_date_short.zip\";\n if (file_exists($zipfile)) {\n unlink($zipfile);\n }\n\n // create zip file\n $zip = new ZipArchive;\n if ($zip->open($zipfile, ZipArchive::CREATE) !== true) {\n //Session::Messages($langGeneralError, 'alert-danger');\n Session::flash('message',$langGeneralError);\n Session::flash('alert-class', 'alert-danger');\n redirect_to_home_page('modules/course_info/index.php?course=' . $course_code);\n }\n $result = $zip->addGlob($archivedir . '/*', GLOB_NOSORT, [\n 'remove_path' => \"$webDir/courses/archive/$_SESSION[csrf_token]\" ]) &&\n addDir($zip, \"$webDir/courses/$course_code\", \"$course_code/$backup_date/html\") &&\n addDir($zip, \"$webDir/video/$course_code\", \"$course_code/$backup_date/video_files\");\n $zip->close();\n removeDir($basedir);\n\n if (!$result) {\n //Session::Messages($langGeneralError, 'alert-danger');\n Session::flash('message',$langGeneralError);\n Session::flash('alert-class', 'alert-danger');\n redirect_to_home_page('modules/course_info/index.php?course=' . $course_code);\n }\n\n return $zipfile;\n}", "public function generateZipCommandDataProvider() {\n return [\n [\n 'php://pii_data/',\n 'filename', '123',\n 'zip -jP \"123\" /tmp/pii_data/filename.zip /tmp/pii_data/filename.csv',\n ],\n ['php://pii_data/',\n 'filename',\n FALSE,\n 'zip -j /tmp/pii_data/filename.zip /tmp/pii_data/filename.csv',\n ],\n ];\n }", "function create_zip_from_files()\r\n{\r\n $rootPath = realpath(build_dir());\r\n // Initialize archive object\r\n $zip = new ZipArchive();\r\n $zip->open(zip_path(), ZipArchive::CREATE | ZipArchive::OVERWRITE);\r\n\r\n // Initialize empty \"delete list\"\r\n $filesToDelete = array();\r\n\r\n // Create recursive directory iterator\r\n /**\r\n * * * * * * * * * * * * * * * * * * * * * * * * * * * @var SplFileInfo[] $files */\r\n $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($rootPath),\r\n RecursiveIteratorIterator::LEAVES_ONLY);\r\n\r\n foreach ($files as $name => $file) {\r\n // Skip directories (they would be added automatically)\r\n if (!$file->isDir()) {\r\n // Get real and relative path for current file\r\n $filePath = $file->getRealPath();\r\n $relativePath = substr($filePath, strlen($rootPath) + 1);\r\n\r\n if (fn_not_yaml($fn = $file->getFilename())) {\r\n echo \"file skipped: $fn<br />\";\r\n continue;\r\n //$filesToDelete[] = $filePath;\r\n }\r\n // Add current file to archive\r\n $zip->addFile($filePath, $relativePath);\r\n\r\n // Add current file to \"delete list\"\r\n // delete it later cause ZipArchive create archive only after calling close function and ZipArchive lock files until archive created)\r\n if ($file->getFilename() != 'important.txt') {\r\n //$filesToDelete[] = $filePath;\r\n }\r\n }\r\n }\r\n\r\n // Zip archive will be created only after closing object\r\n $zip->close();\r\n\r\n // Delete all files from \"delete list\"\r\n foreach ($filesToDelete as $file) {\r\n unlink($file);\r\n }\r\n}", "function create_zip($files = array(),$destination = '',$overwrite = false) {\n if(file_exists($destination) && !$overwrite) { return false; }\n //vars\n $valid_files = array();\n //if files were passed in...\n if(is_array($files)) {\n //cycle through each file\n foreach($files as $file) {\n //make sure the file exists\n if(file_exists(__DIR__.'/../../uploadedFiles/auditeeFiles/'.$file)) {\n error_log(\"valid file\");\n $valid_files[] = $file;\n }\n }\n }\n //if we have good files...\n if(count($valid_files)) {\n //create the archive\n $zip = new ZipArchive();\n if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {\n return false;\n }\n //add the files\n foreach($valid_files as $file) {\n $zip->addFile(__DIR__.'/../../uploadedFiles/auditeeFiles/'.$file,$file);\n }\n //debug\n //echo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status;\n \n //close the zip -- done!\n $zip->close();\n \n //check to make sure the file exists\n return file_exists($destination);\n }\n else\n {\n return false;\n }\n}", "function zipFilesAndDownload($_files) {\n\n $zip = new ZipArchive();\n\n // create a temp file & open it\n $tmp_file = tempnam('.', '');\n $zip->open($tmp_file, ZipArchive::CREATE);\n\n // loop through each file and add to zip\n foreach ($_files as $file) {\n $download_file = file_get_contents($file);\n $zip->addFromString(basename($file), $download_file);\n }\n\n $zip->close();\n\n // send the file to the browser as a download\n header('Content-disposition: attachment; filename=Resumes.zip');\n header('Content-type: application/zip');\n\n // return contents of zip file and then remove it\n readfile($tmp_file);\n unlink($tmp_file);\n}", "function fm_zip_files ($originalfiles, $destination, $zipname=\"zip01\", $rootdir=0, $groupid=0) {\r\n//Zip an array of files/dirs to a destination zip file\r\n//Both parameters must be FULL paths to the files/dirs\r\n// Modded for Myfiles \r\n// Michael Avelar 1/19/06\r\n\r\n global $CFG, $USER;\r\n\r\n //Extract everything from destination\r\n $path_parts = pathinfo(cleardoubleslashes($destination));\r\n $destpath = $path_parts['dirname']; //The path of the zip file\r\n $destfilename = $path_parts['basename']; //The name of the zip file\r\n\t// To put the zipped file into the current directory\r\n\t$destpath = $destpath.\"/\".$destfilename;\r\n\t// To allow naming of zipfiles\r\n\t$destfilename = $zipname;\r\n //If no file, error\r\n if (empty($destfilename)) {\r\n return false;\r\n }\r\n\r\n //If no extension, add it\r\n if (empty($path_parts['extension'])) {\r\n $extension = 'zip';\r\n $destfilename = $destfilename.'.'.$extension;\r\n } else {\r\n $extension = $path_parts['extension']; //The extension of the file\r\n }\r\n\r\n //Check destination path exists\r\n if (!is_dir($destpath)) {\r\n return false;\r\n }\r\n\r\n //Check destination path is writable. TODO!!\r\n\r\n //Clean destination filename\r\n $destfilename = clean_filename($destfilename);\r\n\r\n //Now check and prepare every file\r\n $files = array();\r\n $origpath = NULL;\r\n\r\n foreach ($originalfiles as $file) { //Iterate over each file\r\n //Check for every file\r\n $tempfile = cleardoubleslashes($file); // no doubleslashes!\r\n //Calculate the base path for all files if it isn't set\r\n if ($origpath === NULL) {\r\n $origpath = rtrim(cleardoubleslashes(dirname($tempfile)), \"/\");\r\n }\r\n //See if the file is readable\r\n if (!is_readable($tempfile)) { //Is readable\r\n continue;\r\n }\r\n //See if the file/dir is in the same directory than the rest\r\n if (rtrim(cleardoubleslashes(dirname($tempfile)), \"/\") != $origpath) {\r\n continue;\r\n }\r\n //Add the file to the array\r\n $files[] = $tempfile;\r\n }\r\n\r\n //Everything is ready:\r\n // -$origpath is the path where ALL the files to be compressed reside (dir).\r\n // -$destpath is the destination path where the zip file will go (dir).\r\n // -$files is an array of files/dirs to compress (fullpath)\r\n // -$destfilename is the name of the zip file (without path)\r\n\r\n //print_object($files); //Debug\r\n\r\n if (empty($CFG->zip)) { // Use built-in php-based zip function\r\n\r\n include_once(\"$CFG->libdir/pclzip/pclzip.lib.php\");\r\n $archive = new PclZip(cleardoubleslashes(\"$destpath/$destfilename\"));\r\n if (($list = $archive->create($files, PCLZIP_OPT_REMOVE_PATH,$origpath) == 0)) {\r\n notice($archive->errorInfo(true));\r\n return false;\r\n }\r\n\r\n } else { // Use external zip program\r\n\r\n $filestozip = \"\";\r\n foreach ($files as $filetozip) {\r\n $filestozip .= escapeshellarg(basename($filetozip));\r\n $filestozip .= \" \";\r\n }\r\n //Construct the command\r\n $separator = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? ' &' : ' ;';\r\n $command = 'cd '.escapeshellarg($origpath).$separator.\r\n escapeshellarg($CFG->zip).' -r '.\r\n escapeshellarg(cleardoubleslashes(\"$destpath/$destfilename\")).' '.$filestozip;\r\n //All converted to backslashes in WIN\r\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\r\n $command = str_replace('/','\\\\',$command);\r\n }\r\n Exec($command);\r\n }\r\n\t// Adds an entry into myfiles api\r\n\t$newentry = NULL;\r\n\tif($groupid == 0){\r\n\t\t$newentry->owner = $USER->id;\r\n\t}else{\r\n\t\t$newentry->owner = $groupid;\r\n\t}\r\n\t$newentry->type = TYPE_ZIP;\r\n\t$newentry->folder = $rootdir;\r\n\t$newentry->category = 0;\r\n\t$newentry->name = substr($destfilename,0,-4);\r\n\t$newentry->description = '';\r\n\t$newentry->link = $destfilename;\r\n\t$newentry->timemodified = time();\r\n\tif (!fm_update_link($newentry,$groupid)) {\r\n\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t}\r\n return true;\r\n}", "protected function createZip()\n {\n $unit1 = new Unit('functional', 'key1');\n $unit1->setTranslation('en', 'value1');\n $unit1->setTranslation('fr', 'value_fr');\n $unit2 = new Unit('functional', 'key2');\n $unit2->setTranslation('en', 'new_value2');\n $unit2->setTranslation('fr', 'value2_fr');\n $unit3 = new Unit('functional', 'compound.translation2');\n $unit3->setTranslation('en', 'compound 2 en');\n $unit3->setTranslation('fr', 'compound 2 fr');\n $unit4 = new Unit('functional', 'compound.translation1');\n $unit4->setTranslation('en', 'new compound 2 en');\n $exporter = new ZipExporter();\n $exporter->setUnits(array($unit1, $unit2, $unit3, $unit4));\n\n return new UploadedFile($exporter->createZipFile(sys_get_temp_dir().'/trans.zip'), 'trans.zip');\n }" ]
[ "0.7098431", "0.67109716", "0.6523865", "0.64830923", "0.64051837", "0.6371909", "0.63708913", "0.63435286", "0.6339241", "0.6333282", "0.6309595", "0.6145113", "0.61130774", "0.61100155", "0.61039877", "0.6102134", "0.60285014", "0.5964613", "0.5953326", "0.5940628", "0.59306043", "0.59306043", "0.5929503", "0.59223706", "0.5886135", "0.58720005", "0.5860648", "0.5845868", "0.5840479", "0.5832667" ]
0.8474213
0
/ Function: tools generates a html table with all the system files and actions on them depending on possible changes between the local file and the version on a remote hypha Parameters: $hyphaServer url of remove hypha
function tools($hyphaServer) { global $errorMessage; switch($_POST['command']) { case 'add': $data = gzdecode(base64_decode(file_get_contents($hyphaServer.'?file='.$_POST['argument']))); if ($data) { file_put_contents($_POST['argument'], $data); chmod($_POST['argument'], 0664); } else $errorMessage.= 'file transfer failed<br/>'; break; case 'remove': unlink($_POST['argument']); break; } $localIndex = index(); $serverIndex = unserialize(file_get_contents($hyphaServer.'?file=index')); ksort($serverIndex); ob_start(); ?> <div style="width:600px;"> <input type="submit" name="command" value="back" style="float:right;" /> <h1>hypha system tools</h1> Here you can manage the files of your hypha configuration. <ul> <li><b>install</b> install a (datatype) module that available on the hypha server but is currently not installed on your system.</li> <li><b>remove</b> remove a (datatype) module that is currently installed on your system.</li> <li><b>update</b> update a file on your system with a newer version available from the hypha server.</li> <li><b>reset</b> your file is newer than the version on the hypha server. You can use this option to revert to the older version. This can be useful when a file got broken or some css code was messed up.</li> </ul> </div> <table class="section"> <tr><th style="text-align:left">file</th><th colspan="2">action</th></tr> <?php foreach ($serverIndex as $file => $info) { echo '<tr><td style="white-space:nowrap;">'.$file.'</td>'; if (array_key_exists($file, $localIndex)) { echo '<td><input type="button" value="'.($localIndex[$file] < $serverIndex[$file] ? 'update' : 'reset').'" onclick="hypha(\'add\', \''.$file.'\');" /></td>'; $path = pathinfo($file); $dir = explode('/', $path['dirname']); while (isset($dir[0]) && $dir[0] == '.') array_shift($dir); $level0 = isset($dir[0]) ? $dir[0] : false; $level1 = isset($dir[1]) ? $dir[1] : false; if ($level0 == 'system' && ($level1=='datatypes' || $level1=='languages') && $path['basename']!='settings.php') echo '<td><input type="button" value="remove" onclick="hypha(\'remove\', \''.$file.'\');" /></td>'; else echo '<td></td>'; } else echo '<td></td><td><input type="button" value="install" onclick="hypha(\'add\', \''.$file.'\');" /></td>'; echo '</tr>'; } echo '</table>'; return ob_get_clean(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show_changed_files() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n\r\n //echo branch\r\n $branch = $git->getCurrentBranch();\r\n echo \"<p><strong>Current branch:</strong> \" . $branch . \"</p>\";\r\n \r\n // [0] => Array\r\n //(\r\n // [file] => WPide.php\r\n // [x] => \r\n // [y] => M\r\n // [renamed] => \r\n //)\r\n $status = $git->getStatus();\r\n $i=0;//row counter\r\n if ( count($status) ){\r\n \r\n //echo out rows of staged files \r\n foreach ($status as $item){\r\n echo \"<div class='gitfilerow \". ($i % 2 != 0 ? \"light\" : \"\") .\"'><span class='filename'>{$item['file']}</span> <input type='checkbox' name='\". str_replace(\"=\", '_', base64_encode($item['file']) ) .\"' value='\". base64_encode($item['file']) .\"' checked /> \r\n <a href='\". base64_encode($item['file']) .\"' class='viewdiff'>[view diff]</a> <div class='gitdivdiff \". str_replace(\"=\", '_', base64_encode($item['file']) ) .\"'></div> </div>\";\r\n $i++;\r\n }\r\n }else{\r\n echo \"<p class='red'>No changed files in this repo so nothing to commit.</p>\";\r\n }\r\n \r\n //output the commit message box\r\n echo \"<div id='gitdivcommit'><label>Commit message</label><br /><input type='text' id='gitmessage' name='message' class='message' />\r\n <p><a href='#' class='button-primary'>Commit the staged chanages</a></p></div>\";\r\n \r\n //echo $thebinary;\r\n \r\n //$git = Repository::open($repo_path, new Binary('/var/www/siddtes/wpsites.co.uk/git') );\r\n //echo $git->getFileCreationMode().\" ----- \";\r\n // get status of working directory\r\n //$branch = $git->getCurrentBranch();\r\n //echo \"current branch: \" . $branch;\r\n \r\n \r\n //print_r($_POST);\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "public function main() {\n\t\t$content = '';\n\n\t\t$this->getExtConf();\n\n\t\tif (empty ($_REQUEST['command'])) {\n\t\t\t$_GET['command'] = '';\n\t\t}\n\t\tswitch ($_REQUEST['command']) {\n\t\t\tcase 'exclude':\n\t\t\t\t\t// set table in EXTCONF as excluded\n\t\t\t\t$this\n\t\t\t\t\t->getTableList() // check access\n\t\t\t\t\t->excludeTable();\n\t\t\t\tbreak;\n\t\t\tcase 'backup':\n\t\t\t\t\t// create table backup\n\t\t\t\t$this\n\t\t\t\t\t->getTableList() // check access\n\t\t\t\t\t->backupTable();\n\t\t\t\tbreak;\n\t\t\tcase 'convert':\n\t\t\t\t\t// convert table\n\t\t\t\t$this\n\t\t\t\t\t->getTableList() // check access\n\t\t\t\t\t->convertTable();\n\t\t\t\tbreak;\n\t\t\tcase 'update-localconf':\n\t\t\t\t\t// convert table\n\t\t\t\t$this->updateLocalconf();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\t// display table list\n\t\t\t\t$this\n\t\t\t\t\t->getPaths()\n\t\t\t\t\t->loadTemplate()\n\t\t\t\t\t->includeJQuery(TRUE)\n\t\t\t\t\t->getTableList()\n\t\t\t\t\t->displayTableList();\n\t\t\t\t$content .= $this->content;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $content;\n\t}", "function createOverviewTable($htmFileName,$filelist,$langList){\n\techo \"\\n\\n=============================\\n\";\n\techo \"Creating overview table at $htmFileName\\n\";\n\techo \"=============================\\n\";\n\t$out = \"<th>&nbsp;</th><th>(original)</th>\";\n\tforeach ($langList as $key){\n\t\t$out.=\"<th>$key</th>\";\n\t}\n\t$out = \"<tr>$out</tr>\";\n\t//loop through the files\n\tforeach ($filelist as $file){\n\t\t$filenamepart=explodeFile($file);\n\t\techo \"-----------------------------\\n\";\n\t\techo \"File $file\\n\";\n\t\techo \"-----------------------------\\n\";\n\t\techo \"* Reading original at $file\\n\";\n\t\t$row =\"<th>$file</th>\";\n\t\t$row.=\"<td>\".file_get_contents($file).\"</td>\";\n\t\t//loop through the languages\n\t\tforeach ($langList as $key){\n\t\t\t$row.=\"\\n<!-- ----------------------------------------->\\n\";\n\t\t\t$langFile=$filenamepart[0].\"$key/\".$filenamepart[1];\n\t\t\techo \"* Reading language $key at $langFile\\n\";\n\t\t\t$row.=\"\\n<td>\\n\".file_get_contents($langFile).\"\\n</td>\\n\";\n\t\t}\n\t\t$out .= \"<tr>$row</tr>\";\n\t\t$row.=\"\\n\\n<!-- =========================================== -->\\n\\n\";\n\t}\n\t$out=htmlHeader(\"Overview table\").\"<table border=1>$out</table>\".htmlFooter();\n\tfile_put_contents($htmFileName,$out);\n}", "function main()\t{\n\n\t\t$content = '';\n\n\t\t$content .= '<br /><b>Change table tx_realurl_redirects:</b><br />\n\t\tRemove the field url_hash from the table tx_realurl_redirects, <br />because it\\'s not needed anymore and it\\'s replaced by the standard TCA field uid as soon as you do <br />the DB updates by the extension manager in the main view of this extension.<br /><br />ALTER TABLE tx_realurl_redirects DROP url_hash<br />ALTER TABLE tx_realurl_redirects ADD uid int(11) auto_increment PRIMARY KEY';\n\t\t\n\t\t$import = t3lib_div::_GP('update');\n\n\t\tif ($import == 'Update') {\n\t\t\t$result = $this->updateRedirectsTable();\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<p>Result: '.$result.'</p>';\n\t\t\t$content2 .= '<p>Done. Please accept the update suggestions of the extension manager now!</p>';\n\t\t} else {\n\t\t\t$content2 = '</form>';\n\t\t\t$content2 .= '<form action=\"'.htmlspecialchars(t3lib_div::linkThisScript()).'\" method=\"post\">';\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<input type=\"submit\" name=\"update\" value=\"Update\" />';\n\t\t\t$content2 .= '</form>';\n\t\t} \n\n\t\treturn $content.$content2;\n\t}", "function PKG_showPreviewUpdateSystem($clientName,$completeUpdate)\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n//write table header\n\techo (\"<br><br>\n\t\t<span class=\\\"title\\\">$I18N_updatePreview</span><br><br>\n\t\t\t<table class=\\\"subtable\\\" align=\\\"center\\\" border=0 cellspacing=5>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t\".PKG_previewUpdateSystem($clientName,$completeUpdate).\"\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\");\n}", "function display_results($branch, $html=false)\n{\n\tglobal $commit_url, $revision;\n\n\tif (!$html)\n\t{\n\t\techo \"Percent\\tSuccess\\tFailed\\tScript\\t(Features)\\tFile\\tUpdated\\tTime\\n\";\n\t}\n\telse\n\t{\n\t\t$etag = check_send_etag($branch);\n\t\thtml_header();\n\t\techo \"<div class='topmenu'>\".\n\t\t\t\"<input type='button' id='serverinfo' value='Edit serverinfo' onclick='location.href=\\\"/serverinfo.php\\\";'/>\\n\".\n\t\t\t\"Revision: <input id='revision' size='10' placeholder='\".htmlspecialchars($revision).\"' title='Set revision, if it can not be determined from git'/></div>\\n\";\n\t\techo \"<table class='results' data-commit-url='\".htmlspecialchars($commit_url).\"' data-etag='\".htmlspecialchars($etag).\"'>\\n\";\n\t\techo \"<tr class='header'><th></th><th>Percent</th><th>Success</th><th>Failed</th><th>Script (Features)</th><th>File</th><th>Updated</th><th class='time'>Time</th><th class='notes'>N</th></tr>\\n\";\n\t}\n\tforeach(get_script_results($branch) as $script)\n\t{\n\t\tif (empty($script['description']))\n\t\t{\n\t\t\t$script['description'] = strtr($script['name'], array(\n\t\t\t\t'/' => ' ',\n\t\t\t\t'.xml' => '',\n\t\t\t));\n\t\t}\n\t\tif ($script['ignore-all']) $script['require-feature'][] = 'ignore-all';\n\n\t\t$script['time'] = isset($script['time']) ? number_format($script['time'], 2, '.', '') : '';\n\n\t\tif (!$html)\n\t\t{\n\t\t\techo \"$script[percent]\\t$script[success]\\t$script[failed]\\t$script[description] (\".\n\t\t\t\timplode(', ', $script['require-feature']).\")\\t$script[name]\\t$script[updated]\\t$script[time]t$script[notes]\\n\";\n\t\t\tcontinue;\n\t\t}\n\t\t// todo html\n\t\tif (empty($script['name']))\n\t\t{\n\t\t\techo \"<tr class='footer'><td></td>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<tr id='\".htmlspecialchars($script['name']).\"' class='\".\n\t\t\t\t((string)$script['percent'] === '' ? 'ignored' :\n\t\t\t\t($script['percent']==100.0?'green':($script['percent'] < 50.0 ? 'red' : 'yellow'))).\"'>\".\n\t\t\t\t\"<td class='expand'></td>\";\n\t\t}\n\t\techo \"<td class='percent'>\".htmlspecialchars($script['percent']).\n\t\t\t\"</td><td class='success'>\".htmlspecialchars($script['success']).\n\t\t\t\"</td><td class='failed'>\".htmlspecialchars($script['failed']).\n\t\t\t\"</td><td>\".htmlspecialchars($script['description']).\n\t\t\t\t($script['require-feature'] ? ' ('.htmlspecialchars(implode(', ', $script['require-feature'])).')' : '').\n\t\t\t\"</td><td class='script'>\".htmlspecialchars($script['name']).\n\t\t\t\"</td><td class='updated'>\".htmlspecialchars(substr($script['updated'], 0, -3)).\n\t\t\t\"</td><td class='time'>\".htmlspecialchars($script['time']).\n\t\t\t\"</td><td class='notes'>\".htmlspecialchars($script['notes']).\n\t\t\t\"</td><tr>\\n\";\n\t}\n\tif ($html)\n\t{\n\t\techo \"</table>\\n</body>\\n</html>\\n\";\n\t}\n}", "function mainHTML()\n {\n ?>\n <h1>Upgrade Andromeda From Subversion</h1>\n \n <br/>\n This program will pull the latest release code for\n Andromeda directly from our Sourceforget.net Subversion tree. \n\n <br/>\n <br/>\n <b>This program directly overwrites the running Node Manager\n Code.</b> <span style=\"color:red\"><b>If you have been making changes to your Andromeda\n code on this machine all of those changes will be lost!</b><span>\n \n <br/>\n <br/>\n <a href=\"javascript:Popup('?gp_page=a_pullsvna&gp_out=none')\"\n >Step 1: Pull Code Now</a>\n \n <br/>\n <br/>\n <a href=\"javascript:Popup('?gp_page=a_builder&gp_out=none&txt_application=andro')\"\n >Step 2: Rebuild Node Manager</a>\n \n <?php\n \n }", "function monitis_addon_output($vars) {\n //debug(\"Starting monitis_addon_output\", array($vars, $_POST, $_GET));\n //info(\"This is an info log\");\n //warn(\"This is a warning\");\n //error(\"This is an error\");\n\n // Dispatch output based on get/post params\n // default to the server table\n $success_msg = array();\n $error_msg = array();\n\n if ($_POST) {\n $action = $_POST['action'];\n if ($action) {\n if ($action == 'agent_name') {\n $result = update_agent_name($vars, $_POST['agent_name'], $_POST['ip']);\n print $result;\n return;\n }\n foreach ($_POST['servers'] as $server_ip) {\n if ($action == 'add') {\n $result = add_ping_monitor($vars, $server_ip);\n }\n elseif ($action == 'remove') {\n $result = remove_ping_monitor($vars, $server_ip);\n }\n //elseif ($action == 'remove_deleted') {\n //$result = remove_ping_monitor($vars, $server_ip);\n //}\n if ($msg = $result['ok']) {\n $success_msg[] = $msg;\n }\n else {\n $error_msg[] = $result['err'];\n }\n }\n }\n }\n else { // no POST, check for specific GET-based views\n // Detail view for a specific test ID\n $view = $_GET['view']; \n if ($view == 'detail') {\n if ($test_id = $_GET['test_id']) {\n print view_detail($vars, $test_id);\n }\n }\n elseif ($view == 'save') {\n return;\n }\n elseif ($view == 'agents') {\n print json_encode(agent_names($vars));\n }\n }\n\n print view_status_messages($success_msg, $error_msg);\n print view_server_table($vars);\n //print view_deleted_server_table($vars);\n}", "function overview_install()\n{\n overview_uninstall();\n\n global $db;\n\n // Insert templates\n $templatearray = array(\n \"title\" => \"overview\",\n \"template\" => \"<table width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"{\\$theme[\\'borderwidth\\']}\\\" cellpadding=\\\"0\\\" class=\\\"tborder\\\">\n <thead>\n <tr><td colspan=\\\"{\\$num_columns}\\\"><table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"{\\$theme[\\'tablespace\\']}\\\" width=\\\"100%\\\"><tr class=\\\"thead\\\"><td>{\\$collapseinsert1}<strong>{\\$lang->overview_overview}</strong></td></tr></table></td>\n </tr>\n </thead>\n <tbody{\\$collapseinsert2}>\n {\\$trow_message}\n <tr>\n {\\$overview_content}\n </tr>\n </tbody>\n </table>\n <br />\",\n \"sid\" => -1\n );\n $db->insert_query(\"templates\", $templatearray);\n\n $templatearray = array(\n \"title\" => \"overview_2_columns\",\n \"template\" => \"<td valign=\\\"top\\\" class=\\\"{\\$trow}\\\"><table width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"{\\$theme[\\'tablespace\\']}\\\">\n <tr class=\\\"tcat\\\">\n <td colspan=\\\"2\\\" valign=\\\"top\\\"><strong>{\\$table_heading}</strong></td>\n </tr>\n <tr class=\\\"{\\$trow}\\\">\n <td valign=\\\"top\\\"><strong>{\\$column1_heading}</strong></td>\n <td align=\\\"right\\\" valign=\\\"top\\\"><strong>{\\$column2_heading}</strong></td>\n </tr>\n {\\$table_content}\n </table></td>\",\n \"sid\" => -1\n );\n $db->insert_query(\"templates\", $templatearray);\n\n $templatearray = array(\n \"title\" => \"overview_2_columns_row\",\n \"template\" => \"<tr class=\\\"{\\$trow}\\\">\n <td valign=\\\"top\\\"><div class=\\\"smalltext\\\">{\\$val1}</div></td>\n <td align=\\\"right\\\" valign=\\\"top\\\"><div class=\\\"smalltext\\\">{\\$val2}</div></td>\n </tr>\",\n \"sid\" => -1\n );\n $db->insert_query(\"templates\", $templatearray);\n\n $templatearray = array(\n \"title\" => \"overview_3_columns\",\n \"template\" => \"<td valign=\\\"top\\\" class=\\\"{\\$trow}\\\"><table width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"{\\$theme[\\'tablespace\\']}\\\">\n <tr class=\\\"tcat\\\">\n <td colspan=\\\"3\\\" valign=\\\"top\\\"><strong>{\\$table_heading}</strong></td>\n </tr>\n <tr class=\\\"{\\$trow}\\\">\n <td valign=\\\"top\\\"><strong>{\\$column1_heading}</strong></td>\n <td valign=\\\"top\\\"><strong>{\\$column2_heading}</strong></td>\n <td align=\\\"right\\\" valign=\\\"top\\\"><strong>{\\$column3_heading}</strong></td>\n </tr>\n {\\$table_content}\n </table></td>\",\n \"sid\" => -1\n );\n $db->insert_query(\"templates\", $templatearray);\n\n $templatearray = array(\n \"title\" => \"overview_3_columns_row\",\n \"template\" => \"<tr class=\\\"{\\$trow}\\\">\n <td valign=\\\"top\\\"><div class=\\\"smalltext\\\">{\\$val1}</div></td>\n <td valign=\\\"top\\\"><div class=\\\"smalltext\\\">{\\$val2}</div></td>\n <td align=\\\"right\\\" valign=\\\"top\\\"><div class=\\\"smalltext\\\">{\\$val3}</div></td>\n </tr>\",\n \"sid\" => -1\n );\n $db->insert_query(\"templates\", $templatearray);\n\n $templatearray = array(\n \"title\" => \"overview_message\",\n \"template\" => \"<tr class=\\\"trow1\\\">\n <td colspan=\\\"{\\$num_columns}\\\">\n <table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"{\\$theme[\\'tablespace\\']}\\\" width=\\\"100%\\\">\n <tr>\n <td class=\\\"smalltext\\\">\n {\\$overview_message}\n </td>\n </tr>\n </table>\n </td>\n </tr>\",\n \"sid\" => -1\n );\n $db->insert_query(\"templates\", $templatearray);\n\n $query = $db->query(\"SELECT MAX(disporder) as disporder\n FROM \".TABLE_PREFIX.\"settinggroups\");\n $row = $db->fetch_array($query);\n $disporder = $row['disporder'] + 1;\n\n // Insert setting groups\n $overview_group = array(\n \"name\" => \"Overview\",\n \"title\" => \"Overview\",\n \"description\" => \"Settings for the \\\"Overview\\\"-Plugin.\",\n \"disporder\" => $disporder,\n \"isdefault\" => 0\n );\n $db->insert_query(\"settinggroups\", $overview_group);\n $gid = intval($db->insert_id());\n\n $disp = 1;\n $spalte = 1;\n\n // Drop down menu with 10 items\n $select10 = implode(\"\\n\", array(\"select\", \"0=No\", \"1=Yes (Order 1)\",\n \"2=Yes (Order 2)\", \"3=Yes (Order 3)\",\n \"4=Yes (Order 4)\", \"5=Yes (Order 5)\",\n \"6=Yes (Order 6)\", \"7=Yes (Order 7)\",\n \"8=Yes (Order 8)\", \"9=Yes (Order 9)\",\n \"10=Yes (Order 10)\"));\n\n // Insert settings\n $setting = array(\n \"name\" => \"overview_max\",\n \"title\" => \"Number of Items\",\n \"description\" => \"Enter the number of items (Users/Threads/Posts) to be shown.\",\n \"optionscode\" => \"text\",\n \"value\" => 5,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_newest_members\",\n \"title\" => \"Show newest members?\",\n \"description\" => \"Choose if you want the newest members to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => $spalte++,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_top_posters\",\n \"title\" => \"Show Top Posters?\",\n \"description\" => \"Choose if you want the top posters to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => intval($gid)\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_newest_threads\",\n \"title\" => \"Show newest threads?\",\n \"description\" => \"Choose if you want the newest threads to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => $spalte++,\n \"disporder\" => $disp++,\n \"gid\" => intval($gid)\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_most_replies\",\n \"title\" => \"Show threads with most replies?\",\n \"description\" => \"Choose if you want the threads with the most replies to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_favourite_threads\",\n \"title\" => \"Show favourite Threads?\",\n \"description\" => \"Choose if you want the favourite threads to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_newest_posts\",\n \"title\" => \"Show newest posts?\",\n \"description\" => \"Choose if you want the newest posts to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => $spalte++,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_edited_posts\",\n \"title\" => \"Show recently edited posts?\",\n \"description\" => \"Choose if you want the recently edited posts to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_bestrep_members\",\n \"title\" => \"Show best reputated members?\",\n \"description\" => \"Choose if you want the best reputated members to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_newest_polls\",\n \"title\" => \"Show best newest polls?\",\n \"description\" => \"Choose if you want the newest polls to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_next_events\",\n \"title\" => \"Show best next events?\",\n \"description\" => \"Choose if you want the next events to be shown.\",\n \"optionscode\" => $select10,\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_show_re\",\n \"title\" => \"Do you want to show the \\\"RE:\\\" from the subjects of replies?\",\n \"description\" => \"Choose if you want the \\\"RE:\\\" to be shown in front of the subjects of replies.\",\n \"optionscode\" => \"yesno\",\n \"value\" => 1,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_subjects_length\",\n \"title\" => \"Number of Characters\",\n \"description\" => \"How many characters of subjects should be shown (0 = show all)?\",\n \"optionscode\" => \"text\",\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_usernamestyle\",\n \"title\" => \"Format usernames?\",\n \"description\" => \"Do you want to format the usernames in the style of their usergroups?\",\n \"optionscode\" => \"yesno\",\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_showicon\",\n \"title\" => \"Show post icons?\",\n \"description\" => \"Do you want to display post icons in front of subjects?\",\n \"optionscode\" => \"yesno\",\n \"value\" => 1,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_showprefix\",\n \"title\" => \"Show thread prefix?\",\n \"description\" => \"Do you want to display thread prefix in front of subjects?\",\n \"optionscode\" => \"yesno\",\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_trow_message_onoff\",\n \"title\" => \"Show message?\",\n \"description\" => \"Choose if you want to show a message.\",\n \"optionscode\" => \"yesno\",\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_trow_message\",\n \"title\" => \"Message\",\n \"description\" => \"Enter the message. You can use MyCode.\",\n \"optionscode\" => \"textarea\",\n \"value\" => \"Enter your message here!\",\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_ajax\",\n \"title\" => \"AJAX\",\n \"description\" => \"Time (in seconds) if you want the overview box to reload itself periodically using AJAX. Set to 0 to disable.\",\n \"optionscode\" => \"text\",\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_ajax_loading\",\n \"title\" => \"Loading\",\n \"description\" => \"When using AJAX, do you want to show a \\\"Loading\\\"-Window?\",\n \"optionscode\" => \"yesno\",\n \"value\" => 1,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_usergroups\",\n \"title\" => \"Disable overview for usergroups\",\n \"description\" => \"Enter the IDs of the usergroups that should not see the overview table (0 = none). Seperate several IDs with commas.\",\n \"optionscode\" => \"text\",\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_noindex\",\n \"title\" => \"Hide overview from index page\",\n \"description\" => \"If you don\\\\'t want the overview to display on the index page, say yes. This is only useful if you make a custom overview page.\",\n \"optionscode\" => \"yesno\",\n \"value\" => 0,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n $setting = array(\n \"name\" => \"overview_cache\",\n \"title\" => \"Cache overview\",\n \"description\" => \"Building the Overview requires some database queries. The Overview result can be cached to reduce server load. Specify for how long the cache should be used (in seconds). Setting to 0 disables the cache.\",\n \"optionscode\" => \"text\",\n \"value\" => 300,\n \"disporder\" => $disp++,\n \"gid\" => $gid,\n );\n $db->insert_query(\"settings\", $setting);\n\n // rebuild settings.php\n rebuild_settings();\n}", "function main() {\n\t\t// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!\n\t\tglobal $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// set the path for navigation bar\n\t\t$infoPath = $this->pObj->getFolderNavBar($this->pObj->pathInfo);\n\n\t\t// create a instance of dam object\n\t\t$damObj = &t3lib_div::getUserObj('tx_dam');\n\n\t\t// create a html table with the informations from local server\n\t\t$table = '';\n\t\t$table .= '<table class=\"typo3-dblist typo3-filelist\" cellspacing=\"0\" border=\"0\" style=\"width:100%\">';\n\t\t$table .= '<tr>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"filename\").'</td>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"size\").'</td>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"status\").'</td>';\n\t\t$table .= '</tr>';\n\n\n\t\t$dh = dir($this->pObj->pathInfo['dir_path_absolute']);\n\t\t$count = 0;\n\t\twhile (false !== ($entry = $dh->read()))\n\t\t{\n\t\t\tif($entry!=='.' and $entry!=='..' and is_file($this->pObj->pathInfo['dir_path_absolute'].$entry))\n\t\t\t{\n\t\t\t\tif(($count%2) == 0)\n\t\t\t\t\t$rowColor = '#FAFAFA';\n\t\t\t\telse\n\t\t\t\t\t$rowColor = '#F5F5F5';\n\n\t\t\t\t$fieldList = 'uid,pid,file_name, file_path, file_size,tx_damivsvideobasic_encode,tx_damivsvideobasic_status';\n\t\t\t\t$meta = $damObj->meta_getDataForFile($this->pObj->pathInfo['dir_path_absolute'].$entry, $fieldList);\n\t\t\t\t//t3lib_div::devLog('File Meta', 'dam_ivs_videobasic', 1, array('result' => $meta));\n\t\t\t\t$table .= '<tr style=\"background-color:'.$rowColor.';\">';\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['file_name'].'</td>';\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['file_size'].'</td>';\n\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='0')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"notsubmitted\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='1')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"wait\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='2')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"encodingerror\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='3')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"ready\");\n\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['tx_damivsvideobasic_status'].'</td>';\n\t\t\t\t$table .= '</tr>';\n\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$table .= '</table>';\n\n\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section($LANG->getLL(\"title\"),$table,0,1);\n\n\t\t$theOutput.=$this->pObj->doc->divider(5);\n\n\t\t$menu=array();\n\t\t$menu[]=t3lib_BEfunc::getFuncCheck($this->pObj->id,\"SET[tx_dam_ivs_videobasic_modfunc_status_check]\",$this->pObj->MOD_SETTINGS[\"tx_dam_ivs_videobasic_modfunc_status_check\"]).$LANG->getLL(\"checklabel\");\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section(\"Menu\",implode(\" - \",$menu),0,1);\n\n\t\treturn $theOutput;\n\t}", "function DisplayDirListing()\n{\n\tglobal $gBitSmarty, $env;\n\n\t// Create our CVS connection object and set the required properties.\n\t$CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['passwd']);\n\n\t// Connect to the CVS server.\n\tif ($CVSServer->Connect() === true) {\n\n\t\t// Authenticate against the server.\n\t\t$Response = $CVSServer->Authenticate();\n\t\tif ($Response !== true) {\n\t\t\t$gBitSmarty->assign('error', \"ERROR: \".$Response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get a RLOG of the module path specified in $env['mod_path'].\n\t\t$CVSServer->RLog($env['mod_path']);\n\t\t\n\t\t// If we are in the Root of the CVS Repository then lets get the Module list.\n\t\tif (strlen($env['mod_path']) < 2) {\n\t\t\t$Modules = $CVSServer->getModuleList();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$Modules = false;\n\t\t}\n\n\t\t// Do we need the \"Back\" operation.\n\t\tif (strlen($env['mod_path']) > 2) {\n\t\t\t$hrefup = str_replace(\"//\", \"/\", $env['script_name'].\"?mp=\".substr($env['mod_path'], 0, strrpos(substr($env['mod_path'], 0, -1), \"/\")).\"/\");\n\t\t\t$gBitSmarty->assign('hrefup', $hrefup );\n\t\t\t$gBitSmarty->assign('ParentIcon', $env['script_path'].'/icons/parent.png' );\n\t\t}\n\n\t\t$HREF = str_replace(\"//\", \"/\", $env['script_name'].\"?mp=\".$env['mod_path'].\"/\");\n\t\t$gBitSmarty->assign('HREF', $HREF );\n\t\t$gBitSmarty->assign('DownloadIcon', $env['script_path'].'/icons/download.png' );\n\t\t$gBitSmarty->assign('FolderIcon', $env['script_path'].'/icons/folder.png' );\n\t\t$gBitSmarty->assign('ModuleIcon', $env['script_path'].'/icons/module.png' );\n\t\t$gBitSmarty->assign('FileIcon', $env['script_path'].'/icons/file.png' );\n\t\t$gBitSmarty->assign_by_ref('folders', $CVSServer->FOLDERS);\n\t\tif ($Modules !== false) {\n\t\t\t$gBitSmarty->assign_by_ref('modules', $Modules);\n\t\t}\n\t\t$lfiles = array();\n\t\t$i = 0;\n\t\tforeach ($CVSServer->FILES as $File) {\n\t\t\t$lfiles[$i]['Name'] = $File['Name'];\n\t\t\t$lfiles[$i]['Head'] = $File['Head'];\n\t\t\t$lfiles[$i]['HREF'] = str_replace(\"//\", \"/\", $env['script_name'].\"?mp=\".$env['mod_path'].\"/\".$File[\"Name\"]);\n\t\t\t$lfiles[$i]['DateTime'] = strtotime($File[\"Revisions\"][$File[\"Head\"]][\"date\"]);\n\t\t\t$lfiles[$i]['AGE'] = CalculateDateDiff($lfiles[$i]['DateTime'], strtotime(gmdate(\"M d Y H:i:s\")));\n\t\t\t$lfiles[$i]['Author'] = $File[\"Revisions\"][$File[\"Head\"]][\"author\"];\n\t\t\t$lfiles[$i]['Log'] = $File[\"Revisions\"][$File[\"Head\"]][\"LogMessage\"];\n\t\t\t$i++;\n\t\t}\n\t\t$gBitSmarty->assign_by_ref('files', $lfiles);\n\n\t\t$CVSServer->Disconnect();\n\t} else {\n\t\t$gBitSmarty->assign('error', \"ERROR: Could not connect to the PServer\" );\n\t}\n}", "function VersionDetail()\n{\n\tglobal $txt, $context;\n\n\tisAllowedTo('admin_forum');\n\n\t// Call the function that'll get all the version info we need.\n\tloadSource('Subs-Admin');\n\n\t// Get a list of current server versions.\n\t$checkFor = array(\n\t\t'left' => array(\n\t\t\t'server',\n\t\t\t'php',\n\t\t\t'db_server',\n\t\t),\n\t\t'right_top' => array(\n\t\t\t'safe_mode',\n\t\t\t'gd',\n\t\t\t'ffmpeg',\n\t\t\t'imagick',\n\t\t),\n\t\t'right_bot' => array(\n\t\t\t'phpa',\n\t\t\t'apc',\n\t\t\t'memcache',\n\t\t\t'xcache',\n\t\t),\n\t);\n\tforeach ($checkFor as $key => $list)\n\t\t$context['current_versions'][$key] = getServerVersions($list);\n\n\t// Then we need to prepend some stuff into the left column - Wedge versions etc.\n\t$context['current_versions']['left'] = array(\n\t\t'yourVersion' => array(\n\t\t\t'title' => $txt['support_versions_forum'],\n\t\t\t'version' => WEDGE_VERSION,\n\t\t),\n\t\t'wedgeVersion' => array(\n\t\t\t'title' => $txt['support_versions_current'],\n\t\t\t'version' => '??',\n\t\t),\n\t\t'sep1' => '',\n\t) + $context['current_versions']['left'];\n\n\t// And combine the right\n\t$context['current_versions']['right'] = $context['current_versions']['right_top'] + array('sep2' => '') + $context['current_versions']['right_bot'];\n\tunset($context['current_versions']['right_top'], $context['current_versions']['right_bot']);\n\n\t// Now the file versions.\n\t$versionOptions = array(\n\t\t'include_ssi' => true,\n\t\t'include_subscriptions' => true,\n\t\t'sort_results' => true,\n\t);\n\t$version_info = getFileVersions($versionOptions);\n\n\t// Add the new info to the template context.\n\t$context += array(\n\t\t'file_versions' => $version_info['file_versions'],\n\t\t'default_template_versions' => $version_info['default_template_versions'],\n\t\t'template_versions' => $version_info['template_versions'],\n\t\t'default_language_versions' => $version_info['default_language_versions'],\n\t\t'default_known_languages' => array_keys($version_info['default_language_versions']),\n\t);\n\n\t// Make it easier to manage for the template.\n\t$context['forum_version'] = WEDGE_VERSION;\n\n\twetem::load('view_versions');\n\t$context['page_title'] = $txt['admin_version_check'];\n}", "public function getOldFileOffenders()\n\t{\n\t $this->load->model('cleanup','',FALSE);\n\t $this->load->model('configuration');\n\t $dbList = $this->configuration->getDBList();\n\t foreach($dbList->result() as $db) {\n\t \t//if($db == \"som\") {\n\t \techo \"Starting Old File Detection For: \".$db->friendlyName;\n\t \techo \"<br />\";\n\t \t$this->cleanup->getOldFiles($db->dbGroup,$db->fullpath,$db->fsInodeNumber,$db->friendlyName);\n\t \techo \"<hr /><br />\";\n\t //}\n\t }\n\t //$this->cleanup->sendNotices(\"oldfile\");\n\t}", "function list_files($file_paths, $root_path, $student_class_folder, array $code_exts, array $validation_exts) {\n // Prepare header row\n $output = \"<table>\\n<tr>\";\n $output .= \"<th>Permission</th>\";\n //$output .= \"<th>User</th>\";\n //$output .= \"<th>Group</th>\";\n $output .= \"<th>File</th>\";\n $output .= \"<th>Modify Date</th>\";\n $output .= \"<th>Size</th>\";\n $output .= \"<th>Extra</th>\";\n $output .= \"</tr>\\n\";\n\n foreach ($file_paths as $file_path) {\n $relative_path = substr($file_path, strlen($root_path) + 1);\n // $split = split(\"/\", $relative_path);\n $split = explode(\"/\", $relative_path);\n $filename = $split[count($split) - 1];\n $stat = @stat($file_path);\n\n $output .= '<tr>';\n $output .= '<td>' . perms($stat['mode']) . '</td>';\n //$output .= '<td>' . $stat['uid'] . '</td>';\n //$output .= '<td>' . $stat['gid'] . '</td>';\n // Display the correct link to our files\n if (is_dir($file_path))\n $output .= \"<td><a class=\\\"folder\\\" href=\\\"?folder=$relative_path\\\"\";\n elseif (in_array(strtolower(pathinfo($file_path, PATHINFO_EXTENSION)), $code_exts))\n $output .= \"<td><a class=\\\"code\\\" href=\\\"?file=$relative_path\\\"\";\n else\n $output .= \"<td><a class=\\\"show\\\" target=\\\"_blank\\\" href=\\\"/${student_class_folder}/${relative_path}\\\"\";\n $output .= \">\" . $relative_path . \"</a></td>\"; //. $filename \n\n // Show the date. Depending on the due date color the text\n $ctime = date('Y-m-d H:i:s', $stat['ctime']);\n $mtime = date('Y-m-d H:i:s', $stat['mtime']);\n $output .= \"<td\";\n \n $output .= \">$mtime</td>\";\n\n // Add a cell for the size. Ignore directories\n if (is_dir($file_path))\n $output .= \"<td>&nbsp</td>\";\n else\n $output .= '<td class=\"right\">' . $stat['size'] . '</td>';\n\n // Add a cell for a validation link. Only do it for files we're checking.\n if (in_array(strtolower(pathinfo($file_path, PATHINFO_EXTENSION)), $validation_exts)) {\n $server_name = filter_input(INPUT_SERVER, 'SERVER_NAME');\n $url = \"https://${server_name}/${student_class_folder}/${relative_path}\";\n $output .= \"<td><a target=\\\"_blank\\\" href=\\\"http://validator.w3.org/check?uri=$url\\\">Validate</a></td>\";\n } elseif (is_dir($file_path))\n $output .= \"<td><a class=\\\"code\\\" href=\\\"?files=${relative_path}\\\">View Code</a></td>\";\n\n //$output .= \"<td>&nbsp;</td>\";\n\n $output .= \"</tr>\\n\";\n }\n $output .= \"</table>\\n\";\n\n if (count($file_paths) == 0)\n $output .= \"<p class=\\\"error\\\">There are no files to display</p>\";\n\n return $output;\n}", "function getTechFiles($mission = array())\n\t{\n\t\t$exploded_file_paths = array_filter(explode(\"|\",$mission['documents_path']));\n\t\t$exploded_file_names = explode(\"|\",$mission['documents_name']);\n\t\t$zip = \"\";\n\t\t\n\t\t$files = '<table class=\"table\">';\n\t\t$k=0;\n\t\tif($mission['delete']):\n\t\tforeach($exploded_file_paths as $row)\n\t\t{\n\t\t\t$file_path=$this->mission_documents_path.$row;\n\t\t\tif(file_exists($file_path) && !is_dir($file_path))\n\t\t\t{\n\t\t\t\t$zip = true;\n\t\t\t\t$fname = $exploded_file_names[$k];\n\t\t\t\tif($fname==\"\")\n\t\t\t\t\t$fname = basename($row);\n\t\t\t\t$ofilename = pathinfo($file_path);\n\t\t\t\t$files .= '<tr><td width=\"30%\">'.$fname.'</td><td width=\"35%\">'.substr($ofilename['filename'],0,-3).\".\".$ofilename['extension'].'</td><td width=\"20%\">'.formatSizeUnits(filesize($file_path)).'</td><td>Tech</td><td align=\"center\" width=\"15%\"><a href=\"/quote/download-document?type=tech_mission&mission_id='.$mission['id'].'&index='.$k.'\"><i style=\"margin-right:5px\" class=\"splashy-download\"></i></a><span class=\"deletetech\" rel=\"'.$k.'_'.$mission['id'].'\"> <i class=\"icon-adt_trash\"></i></span></td></tr>';\t\n\t\t\t}\n\t\t\t$k++;\n\t\t}\n\t\telse:\n\t\tforeach($exploded_file_paths as $row)\n\t\t{\n\t\t\t$file_path=$this->mission_documents_path.$row;\n\t\t\tif(file_exists($file_path) && !is_dir($file_path))\n\t\t\t{\n\t\t\t\t$zip = true;\n\t\t\t\t$fname = $exploded_file_names[$k];\n\t\t\t\tif($fname==\"\")\n\t\t\t\t\t$fname = basename($row);\n\t\t\t\t$ofilename = pathinfo($file_path);\n\t\t\t\t$files .= '<tr><td width=\"30%\">'.$fname.'</td><td width=\"35%\">'.substr($ofilename['filename'],0,-3).\".\".$ofilename['extension'].'</td><td width=\"20%\">'.formatSizeUnits(filesize($file_path)).'</td><td>Tech</td><td align=\"center\" width=\"15%\"><a href=\"/quote/download-document?type=tech_mission&mission_id='.$mission['id'].'&index='.$k.'\"><i style=\"margin-right:5px\" class=\"splashy-download\"></i></a></td></tr>';\t\n\t\t\t}\n\t\t\t$k++;\n\t\t}\n\t\tendif;\t\t\t\n\t\tif($zip)\n\t\t\t$zip = '<thead><tr><td colspan=\"5\"><a href=\"/quote/download-document?type=tech_mission&index=-1&mission_id='.$mission['id'].'\" class=\"btn btn-small pull-right\">Download Zip</a></td></tr></thead>';\n\t\t$files .=$zip.\"</table>\";\n\t\treturn $files;\n\t}", "function testReport($aServer='', $aHTDetect='')\n {\n global $iConfig, $sys_lang;\n \n $aPHPval = array_keys($iConfig['php_modules']);\n $aPaths = array_keys($iConfig['chmod_paths']);\n\n $dataServer = (empty($aServer)) ? $this->parsePHPConfig($iConfig['server_info']) : $this->parsePHPConfig($aServer);\n $dataMods = (empty($aHTDetect)) ? $this->parseApacheModules($iConfig['server_modules']) : $this->parseApacheModules($iConfig['server_modules'], $aHTDetect);\n\t\t$dataModsOpt = (empty($aHTDetect)) ? $this->parseApacheModules($iConfig['server_modules_optional']) : $this->parseApacheModules($iConfig['server_modules_optional'], $aHTDetect);\n $dataPHP = $this->parsePHPConfig($aPHPval);\n $dataPaths = $this->setCHMOD($iConfig['chmod_paths']);\n $is_error=false;\n ob_start();\n ?>\n <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n <html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />\n\n <title><?php echo $this->t('report_title');?></title>\n\n <link type=\"text/css\" href=\"css/report.css\" rel=\"stylesheet\" media=\"screen\" />\n <link rel=\"shortcut icon\" href=\"css/favicon.ico\" />\n <script type=\"text/javascript\" src=\"js/jquery.js\"></script>\n <script>\n $(document).ready(function(){\n var cookie = document.cookie.toUpperCase();\n $('.browser_js').show();\n if(cookie.indexOf(\"PHPSESSID\")<0)\n {\n $('.browser_cookie_disabled').show();\n } \n else\n {\n $('.browser_cookie_enabled').show();\n $('.browser_control').hide();\n }\n });\n </script>\n \n </head>\n <body>\n <div class=\"center\">\n <table border=\"0\" cellpadding=\"3\" width=\"600\">\n <tr class=\"h\"><td><a href=\"http://www.primadg.com/\"><img border=\"0\" src=\"css/logo.png\" alt=\"Logo\" /></a><h1 class=\"p\"><?php echo $this->t('report_title');?></h1></td></tr>\n <tr class=\"nav\"><td><?php echo $this->languageSelect($sys_lang, '', 'get');?></td></tr>\n </table>\n <br />\n <?php\n $is_cgi = strtolower($this->parsePHPConfig('server_api'));\n $aCGI = array('cgi');\n if (in_array($is_cgi, $aCGI))\n {\n echo '<h1 class=\"warning\">'. $this->t('w_cgi_module') .'</h1>';\n }\n if (strpos('apache',strtolower($is_cgi))<0)\n {\n echo '<h1 class=\"warning\">'. $this->t('w_not_apache') .'</h1>';\n }\n ?>\n <table border=\"0\" cellpadding=\"3\" width=\"600\">\n <?php\n foreach ($dataServer as $k => $v)\n {\n echo ' <tr><td class=\"e\" width=\"200px\" title=\"'. $k .'\">'. $v['label'] .'</td><td class=\"v\">'. $v['value'] .'</td></tr>';\n }\n ?>\n </table>\n\n <h2><?php echo $this->t('report_mod_server');?></h2>\n <table width=\"600\" cellpadding=\"3\" border=\"0\">\n <tbody>\n <tr class=\"h\"><th width=\"200\"><?php echo $this->t('report_module');?></th><th><?php echo $this->t('report_module_local');?></th><th><?php echo $this->t('report_module_desired');?></th><th><?php echo $this->t('report_module_hosting');?></th></tr>\n <?php\n if ($dataMods === FALSE)\n {\n echo ' <tr><td class=\"error\" colspan=\"4\">'. $this->t('e_apache_modules') .'</td></tr>';\n }else{\n foreach ($dataMods as $k => $v)\n {\n $td_class = 'error';\n $msg = $this->t('report_module_fail');\n\n if ($v)\n {\n $td_class = 'v';\n $msg = $this->t('report_module_ok');\n }\n \n if($td_class == 'error')\n {\n $is_error=true;\n }\n\n echo ' <tr><td class=\"e\">'. $k .'</td><td class=\"'. $td_class .'\">'. $msg .'</td><td class=\"'. $td_class .'\">'. $this->t('report_module_ok') .'</td><td class=\"'. $td_class .'\">'. $this->t('report_module_ok') .'</td></tr>';\n }\n\t\t\t$out_td = '';\n foreach ($dataModsOpt as $k => $v)\n {\n $td_class = 'test_warning';\n $msg = $this->t('report_module_fail');\n\n if ($v)\n {\n $td_class = 'v';\n $msg = $this->t('report_module_ok');\n }\n \n if($td_class == 'error')\n {\n $is_error=true;\n }\n\n $out_td .= '<tr><td class=\"e\">'. $k .'</td><td class=\"'. $td_class .'\">'. $msg .'</td><td class=\"'. $td_class .'\">'. $this->t('report_module_ok') .'</td><td class=\"'. $td_class .'\">'. $this->t('report_module_ok') .'</td></tr>';\n if (!$v)\n $out_td .= '<tr><td colspan=\"4\" class=\"wt\">'.$this->t($k.'_optional').'</td></td></tr>';\n \n }\n echo $out_td;\n }\n ?>\n </tbody>\n </table>\n\n <h2><?php echo $this->t('report_mod_php');?></h2>\n <table width=\"600\" cellpadding=\"3\" border=\"0\">\n <tbody>\n <tr class=\"h\"><th width=\"200\"><?php echo $this->t('report_module');?></th><th><?php echo $this->t('report_module_local');?></th><th><?php echo $this->t('report_module_desired');?></th><th><?php echo $this->t('report_module_hosting');?></th></tr>\n <?php\n foreach ($iConfig['php_modules'] as $k => $v)\n {\n $td_class = 'error';\n $val=isset($dataPHP[$k]) ? $dataPHP[$k]['value'] : $this->t('report_browser_local');\n \n if (isset($dataPHP[$k]) && $dataPHP[$k]['value'] == $v)\n {\n $td_class = 'v';\n } \n if ($k == 'php_version' && version_compare($dataPHP[$k]['value'], $v, \">=\"))\n {\n $td_class = 'v';\n }\n if($td_class == 'error')\n {\n $is_error=true;\n }\n \tif ($k == 'openssl_support')\n\t\t\techo ' <tr><td class=\"e\">'. $k .'</td><td class=\"'. $td_class .'\">'. $val .'</td><td class=\"'. $td_class .'\">'. 'for hosting only' .'</td><td class=\"'. $td_class .'\">'. $v .'</td></tr>';\n\t\telse\n \t\techo ' <tr><td class=\"e\">'. $k .'</td><td class=\"'. $td_class .'\">'. $val .'</td><td class=\"'. $td_class .'\">'. $v .'</td><td class=\"'. $td_class .'\">'. $v .'</td></tr>';\n }\n ?>\n </tbody>\n </table>\n \n <h2><?php echo $this->t('report_mysql');?></h2>\n <?php \n $td_class = 'error';\n $version=$this->getMysqlVersion();\n if ($version===false||version_compare($version, $iConfig['mysql']['mysql_version'], \">=\"))\n {\n $td_class = 'v';\n }\n if($td_class == 'error')\n {\n $is_error=true;\n }\n ?>\n <table width=\"600\" cellpadding=\"3\" border=\"0\">\n <tbody>\n <tr class=\"h\"><th width=\"200\"><?php echo $this->t('report_module');?></th><th><?php echo $this->t('report_module_local');?></th><th><?php echo $this->t('report_module_desired');?></th><th><?php echo $this->t('report_module_hosting');?></th></tr>\n <tr><td class=\"e\"><?php echo $this->t('report_mysql_version');?></td><td class=\"<?php echo $td_class;?>\"><?php echo ($version!==false)?$version:'Undefined';?></td><td class=\"<?php echo $td_class;?>\"><?php echo $iConfig['mysql']['mysql_version'];?></td><td class=\"<?php echo $td_class;?>\"><?php echo $iConfig['mysql']['mysql_version'];?></td></tr>\n </tbody>\n </table>\n\n <!--<h2><?php echo $this->t('report_paths');?></h2>\n <table width=\"600\" cellpadding=\"3\" border=\"0\">\n <tbody>\n <tr class=\"h\"><th width=\"400\"><?php echo $this->t('report_path');?></th><th><?php echo $this->t('report_module_local');?></th><th><?php echo $this->t('report_module_desired');?></th></tr>\n <?php\n foreach ($iConfig['chmod_paths'] as $k => $v)\n {\n $td_class = 'error';\n \n if (empty($dataPaths[$k]['status'])) $td_class = 'v';\n\n echo ' <tr><td class=\"e\">'. $k .'</td><td class=\"'. $td_class .'\" title=\"'. $dataPaths[$k]['status'] .'\">'. $dataPaths[$k]['mode'] .'</td><td class=\"'. $td_class .'\">'. $v .'</td></tr>';\n }\n ?>\n </tbody>\n </table>-->\n \n <h2><?php echo $this->t('report_browser');?></h2>\n <table border=\"0\" cellpadding=\"3\" width=\"600\">\n <tbody>\n <tr class=\"h\">\n <th width=\"200\"><?php echo $this->t('report_browser_test');?></th>\n <th><?php echo $this->t('report_module_local');?></th>\n <th><?php echo $this->t('report_module_desired');?></th>\n <th><?php echo $this->t('report_module_hosting');?></th>\n </tr>\n <noscript>\n <tr>\n <td class=\"e\">JavaScript</td>\n <td class='error'><?php echo $this->t('report_browser_local');?></td>\n <td class='error'><?php echo $this->t('report_browser_desired');?></td>\n <td class='error'><?php echo $this->t('report_browser_desired');?></td>\n </tr>\n <tr class=\"browser_cookie\">\n <td class=\"e\">Cookie</td>\n <td class='error'><?php echo $this->t('report_browser_undefined');?></td>\n <td class='error'><?php echo $this->t('report_browser_desired');?></td>\n <td class='error'><?php echo $this->t('report_browser_desired');?></td>\n </tr>\n </noscript>\n <tr class=\"browser_js\" style=\"display:none;\">\n <td class=\"e\">JavaScript</td>\n <td class='v'><?php echo $this->t('report_browser_desired');?></td>\n <td class='v'><?php echo $this->t('report_browser_desired');?></td>\n <td class='v'><?php echo $this->t('report_browser_desired');?></td>\n </tr>\n <tr class=\"browser_cookie_disabled\" style=\"display:none;\">\n <td class=\"e\">Cookie</td>\n <td class='error'><?php echo $this->t('report_browser_local');?></td>\n <td class='error'><?php echo $this->t('report_browser_desired');?></td>\n <td class='error'><?php echo $this->t('report_browser_desired');?></td>\n </tr>\n <tr class=\"browser_cookie_enabled\" style=\"display:none;\">\n <td class=\"e\">Cookie</td>\n <td class='v'><?php echo $this->t('report_browser_desired');?></td>\n <td class='v'><?php echo $this->t('report_browser_desired');?></td>\n <td class='v'><?php echo $this->t('report_browser_desired');?></td>\n </tr>\n </tbody></table> \n <table <?php echo (!$is_error) ? \"class='browser_control'\" : \"\";?> width=\"600\"><tr><td width=\"20\" class=\"error\"></td><td> - <?php echo sprintf($this->t('report_error_happens'), $iConfig['support_mail']);?></td></tr></table>\n <hr />\n <div id=\"copi\"><a href=\"<?php echo $iConfig['support_site'];?>\"><?php echo $this->t('copyright').date(\" 2002 - Y \").$this->t('global_copy');?></a></div>\n </div>\n </body>\n </html>\n <?php\n ob_end_flush();\n }", "function show_tools()\n{\n\tglobal $ns,$tp;\n\t\n\tif(is_readable(e_ADMIN.\"ver.php\"))\n\t{\n\t\tinclude(e_ADMIN.\"ver.php\");\n\t\tlist($ver, $tmp) = explode(\" \", $e107info['e107_version']);\n\t}\n\t\t\n\t$lans = getLanList();\n\t\n\t$release_diz = defined(\"LANG_LAN_30\") ? LANG_LAN_30 : \"Release Date\";\n\t$compat_diz = defined(\"LANG_LAN_31\") ? LANG_LAN_31 : \"Compatibility\";\n\t$lan_pleasewait = (defsettrue('LAN_PLEASEWAIT')) ? $tp->toJS(LAN_PLEASEWAIT) : \"Please Wait\";\n\t$lan_displayerrors = (defsettrue('LANG_LAN_33')) ? LANG_LAN_33 : \"Display only errors during verification\";\n\t\n\t\n\t$text = \"<form id='lancheck' method='post' action='\".e_SELF.\"?tools'>\n\t\t\t<table class='fborder' style='\".ADMIN_WIDTH.\"'>\";\n\t$text .= \"\n\t\t<tr>\n\t\t<td class='fcaption'>\".ADLAN_132.\"</td>\n\t\t<td class='fcaption'>\".$release_diz.\"</td>\t\t\n\t\t<td class='fcaption'>\".$compat_diz.\"</td>\n\t\t<td class='fcaption' style='text-align:center'>\".ADLAN_134.\"</td>\n\t\t<td class='fcaption' style='text-align:center;width:25%;white-space:nowrap'>\".LAN_OPTIONS.\"</td>\n\t\t</tr>\n\t\t\";\n\t\n\trequire_once(e_HANDLER.\"xml_class.php\");\n\t$xm = new XMLParse();\n\t\n\tforeach($lans as $language)\n\t{\n\t\tif($language == \"English\")\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$metaFile = e_LANGUAGEDIR.$language.\"/\".$language.\".xml\";\n\t\t\n\t\tif(is_readable($metaFile))\n\t\t{\n\t\t\t$rawData = file_get_contents($metaFile);\n\t\t\tif($rawData)\n\t\t\t{\n\t\t\t\t$array = $xm->parse($rawData);\n\t\t\t\t$value = $array['e107Language']['attributes'];\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = array(\n\t\t\t\t'date' \t\t\t=> \"&nbsp;\",\n\t\t\t\t'compatibility' => '&nbsp;'\n\t\t\t);\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$value = array(\n\t\t\t\t'date' \t\t\t=> \"&nbsp;\",\n\t\t\t\t'compatibility' => '&nbsp;'\n\t\t\t);\t\n\t\t}\n\t\t\n\t\t$errFound = (isset($_SESSION['lancheck'][$language]['total']) && $_SESSION['lancheck'][$language]['total'] > 0) ? TRUE : FALSE;\n\t\t\n\t\t\t\t\t\t\n\t\t$text .= \"<tr>\n\t\t\t<td class='forumheader3' >\".$language.\"</td>\n\t\t\t<td class='forumheader3' >\".$value['date'].\"</td>\n\t\t\t<td class='forumheader3' >\".$value['compatibility'].\"</td>\n\t\t\t<td class='forumheader3' style='text-align:center' >\".($ver != $value['compatibility'] || $errFound ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON ).\"</td>\n\t\t\t<td class='forumheader3' style='text-align:center'><input type='submit' name='language_sel[{$language}]' value=\\\"\".LAN_CHECK_2.\"\\\" class='button' />\n\t\t\t<input type='submit' name='ziplang[{$language}]' value=\\\"\".LANG_LAN_23.\"\\\" class='button' onclick=\\\"this.value = '\".$lan_pleasewait.\"'\\\" /></td>\t\n\t\t\t</tr>\";\n\t\t}\n\t\t\n\t\t$srch = array(\"[\",\"]\");\n\t\t$repl = array(\"<a rel='external' href='http://e107.org/content/About-Us:The-Team#translation-team'>\",\"</a>\");\n\t\t$diz = (defsettrue(\"LANG_LAN_28\")) ? LANG_LAN_28 : \"Check this box if you're an [e107 certified translator].\";\n\t\n\t\t$checked = varset($_COOKIE['e107_certified']) == 1 ? \"checked='checked'\" : \"\";\n\t\t$text .= \"<tr><td class='forumheader' colspan='4' style='text-align:center'>\n\t\t <input type='checkbox' name='contribute_pack' value='1' {$checked} />\".str_replace($srch,$repl,$diz);\n\t\t\n\t\t$echecked = varset($_SESSION['lancheck-errors-only']) == 1 ? \"checked='checked'\" : \"\";\t\t\n\t\t$text .= \"</td>\n\t\t<td class='forumheader' style='text-align:center'>\n\t\t<input type='checkbox' name='errorsonly' value='1' {$echecked} /> \".$lan_displayerrors.\" </td>\n\t\t\n\t\t</tr></table>\";\n\t\t\n\t\t\n\t\t$text .= \"</form>\";\n\t\n\t$text .= \"<div class='smalltext' style='padding-top:50px;text-align:center'>\".LANG_LAN_AGR.\"</div>\";\t\n\t$ns->tablerender(LANG_LAN_32, $text);\t\t\n\treturn;\n\t\t\n}", "function templ_system_status()\r\n\t{\r\n\t\trequire_once(TEMPL_MONETIZE_FOLDER_PATH.'templ_header_section.php' );\r\n\t\t?>\r\n\t\t\t<table class=\"tmpl-general-settings form-table\" cellspacing=\"0\" id=\"status\">\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th colspan=\"3\" data-export-label=\"WordPress Environment\"><h2><?php _e( 'WordPress Environment', 'templatic-admin' ); ?></h2></th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"Home URL\"><?php _e( 'Home URL', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php echo get_option( 'home' ); ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"Site URL\"><?php _e( 'Site URL', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php echo get_option( 'siteurl' ); ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"WP Version\"><?php _e( 'WP Version', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php bloginfo('version'); ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"WP Multisite\"><?php _e( 'WP Multisite', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php if ( is_multisite() ) echo '&#10004;'; else echo '&ndash;'; ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"WP Memory Limit\"><?php _e( 'WP Memory Limit', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php\r\n\t\t\t\t\t\t\t$memory = $this->tmpl_let_to_num( WP_MEMORY_LIMIT );\r\n\r\n\t\t\t\t\t\t\tif ( function_exists( 'memory_get_usage' ) ) {\r\n\t\t\t\t\t\t\t\t$system_memory = $this->tmpl_let_to_num( @ini_get( 'memory_limit' ) );\r\n\t\t\t\t\t\t\t\t$memory = max( $memory, $system_memory );\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ( $memory < 67108864 ) {\r\n\t\t\t\t\t\t\t\techo '<mark class=\"error\">' . sprintf( __( '%s - We recommend setting memory to at least 64MB. See: %s', 'templatic-admin' ), size_format( $memory ), '<a href=\"http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP\" target=\"_blank\">' . __( 'Increasing memory allocated to PHP', 'templatic-admin' ) . '</a>' ) . '</mark>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\techo '<mark class=\"yes\">' . size_format( $memory ) . '</mark>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"WP Debug Mode\"><?php _e( 'WP Debug Mode', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php if ( defined('WP_DEBUG') && WP_DEBUG ) echo '<mark class=\"yes\">&#10004;</mark>'; else echo '<mark class=\"no\">&ndash;</mark>'; ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"Language\"><?php _e( 'Language', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php echo get_locale(); ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t\r\n\t\t\t<table class=\"tmpl-general-settings form-table\" cellspacing=\"0\">\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th colspan=\"3\" data-export-label=\"Server Environment\"><h2><?php _e( 'Server Environment', 'templatic-admin' ); ?></h2></th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"Server Info\"><?php _e( 'Server Info', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"PHP Version\"><?php _e( 'PHP Version', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php\r\n\t\t\t\t\t\t\t// Check if phpversion function exists.\r\n\t\t\t\t\t\t\tif ( function_exists( 'phpversion' ) ) {\r\n\t\t\t\t\t\t\t\t$php_version = phpversion();\r\n\r\n\t\t\t\t\t\t\t\tif ( version_compare( $php_version, '5.4', '<' ) ) {\r\n\t\t\t\t\t\t\t\t\techo '<mark class=\"error\">' . sprintf( __( '%s - We recommend a minimum PHP version of 5.4. See: %s', 'templatic-admin' ), esc_html( $php_version ), '<a href=\"http://docs.woothemes.com/document/how-to-update-your-php-version/\" target=\"_blank\">' . __( 'How to update your PHP version', 'templatic-admin' ) . '</a>' ) . '</mark>';\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\techo '<mark class=\"yes\">' . esc_html( $php_version ) . '</mark>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t_e( \"Couldn't determine PHP version because phpversion() doesn't exist.\", 'templatic-admin' );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php if ( function_exists( 'ini_get' ) ) : ?>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th data-export-label=\"PHP Post Max Size\"><?php _e( 'PHP Post Max Size', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t\t<td><?php echo size_format( $this->tmpl_let_to_num( ini_get( 'post_max_size' ) ) ); ?></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th data-export-label=\"PHP Time Limit\"><?php _e( 'PHP Time Limit', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t\t<td><?php echo ini_get( 'max_execution_time' ); ?></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th data-export-label=\"PHP Max Input Vars\"><?php _e( 'PHP Max Input Vars', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t\t<td><?php echo ini_get( 'max_input_vars' ); ?></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"MySQL Version\"><?php _e( 'MySQL Version', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t/** @global wpdb $wpdb */\r\n\t\t\t\t\t\t\tglobal $wpdb;\r\n\t\t\t\t\t\t\techo $wpdb->db_version();\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"Max Upload Size\"><?php _e( 'Max Upload Size', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php echo size_format( wp_max_upload_size() ); ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"Default Timezone is UTC\"><?php _e( 'PHP Allow URL fopen', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php\r\n\t\t\t\t\t\t\tif ( ini_get( 'allow_url_fopen' ) ) {\r\n\t\t\t\t\t\t\t\t$allow_url_fopen = __( 'On', 'templatic-admin' );\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$allow_url_fopen = __( 'Off', 'templatic-admin' );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$default_timezone = date_default_timezone_get();\r\n\t\t\t\t\t\t\tif ( 'On' !== $allow_url_fopen ) {\r\n\t\t\t\t\t\t\t\techo '-';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\techo '<mark class=\"yes\">&#10004;</mark>';\r\n\t\t\t\t\t\t\t}?>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th data-export-label=\"Default Timezone is UTC\"><?php _e( 'fsockopen/cURL', 'templatic-admin' ); ?>:</th>\r\n\t\t\t\t\t\t<td><?php\r\n\t\t\t\t\t\t\tif ( function_exists('curl_version') ) {\r\n\t\t\t\t\t\t\t\t$allow_url_fopen = __( 'On', 'templatic-admin' );\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$allow_url_fopen = __( 'Off', 'templatic-admin' );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$default_timezone = date_default_timezone_get();\r\n\t\t\t\t\t\t\tif ( !function_exists('curl_version') ) {\r\n\t\t\t\t\t\t\t\techo '-';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\techo '<mark class=\"yes\">&#10004;</mark>';\r\n\t\t\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\r\n\t\t<?php\r\n\t}", "function adminMain() {\r\n global $language, $hlpfile, $admin, $aid, $prefix, $file, $dbi;\r\n $hlpfile = \"manual/admin.html\";\r\n include (\"header.php\");\r\n $dummy = 0;\r\n GraphicAdmin($hlpfile);\r\n $result2 = sql_query(\"select radminarticle, radminsuper, admlanguage from $prefix\"._authors.\" where aid='$aid'\", $dbi);\r\n list($radminarticle, $radminsuper, $admlanguage) = sql_fetch_row($result2, $dbi);\r\n if ($admlanguage != \"\" ) {\r\n\t$queryalang = \"WHERE alanguage='$admlanguage' \";\r\n\t$queryplang = \"WHERE planguage='$admlanguage' \";\r\n } else {\r\n\t$queryalang = \"\";\r\n\t$queryplang = \"WHERE planguage='$language' \";\r\n }\r\n OpenTable();\r\n echo \"<center><b>\"._AUTOMATEDARTICLES.\"</b></center><br>\";\r\n $count = 0;\r\n $result = sql_query(\"select anid, aid, title, time, alanguage from $prefix\"._autonews.\" $queryalang order by time ASC\", $dbi);\r\n while(list($anid, $said, $title, $time, $alanguage) = sql_fetch_row($result, $dbi)) {\r\n\tif ($alanguage == \"\") {\r\n\t $alanguage = \"\"._ALL.\"\";\r\n\t}\r\n\tif ($anid != \"\") {\r\n\t if ($count == 0) {\r\n\t\techo \"<table border=\\\"1\\\" width=\\\"100%\\\">\";\r\n\t\t$count = 1;\r\n\t }\r\n\t $time = ereg_replace(\" \", \"@\", $time);\r\n\t if (($radminarticle==1) OR ($radminsuper==1)) {\r\n\t\tif (($radminarticle==1) AND ($aid == $said) OR ($radminsuper==1)) {\r\n \t\t echo \"<tr><td nowrap>&nbsp;(<a href=\\\"admin.php?op=autoEdit&amp;anid=$anid\\\">\"._EDIT.\"</a>-<a href=\\\"admin.php?op=autoDelete&amp;anid=$anid\\\">\"._DELETE.\"</a>)&nbsp;</td><td width=\\\"100%\\\">&nbsp;$title&nbsp;</td><td align=\\\"center\\\">&nbsp;$alanguage&nbsp;</td><td nowrap>&nbsp;$time&nbsp;</td></tr>\"; /* Multilingual Code : added column to display language */\r\n\t\t} else {\r\n\t\t echo \"<tr><td>&nbsp;(\"._NOFUNCTIONS.\")&nbsp;</td><td width=\\\"100%\\\">&nbsp;$title&nbsp;</td><td align=\\\"center\\\">&nbsp;$alanguage&nbsp;</td><td nowrap>&nbsp;$time&nbsp;</td></tr>\"; /* Multilingual Code : added column to display language */\r\n\t\t}\r\n\t } else {\r\n\t\techo \"<tr><td width=\\\"100%\\\">&nbsp;$title&nbsp;</td><td align=\\\"center\\\">&nbsp;$alanguage&nbsp;</td><td nowrap>&nbsp;$time&nbsp;</td></tr>\"; /* Multilingual Code : added column to display language */\r\n\t }\r\n\t}\r\n }\r\n if (($anid == \"\") AND ($count == 0)) {\r\n\techo \"<center><i>\"._NOAUTOARTICLES.\"</i></center>\";\r\n }\r\n if ($count == 1) {\r\n echo \"</table>\";\r\n }\r\n CloseTable();\r\n echo \"<br>\";\r\n OpenTable();\r\n echo \"<center><b>\"._LAST.\" 20 \"._ARTICLES.\"</b></center><br>\";\r\n $result = sql_query(\"select sid, aid, title, time, topic, informant, alanguage from $prefix\"._stories.\" $queryalang order by time desc limit 0,20\", $dbi);\r\n echo \"<center><table border=\\\"1\\\" width=\\\"100%\\\" bgcolor=\\\"$bgcolor1\\\">\";\r\n while(list($sid, $said, $title, $time, $topic, $informant, $alanguage) = sql_fetch_row($result, $dbi)) {\r\n\t$ta = sql_query(\"select topicname from $prefix\"._topics.\" where topicid=$topic\", $dbi);\r\n\tlist($topicname) = sql_fetch_row($ta, $dbi);\r\n\tif ($alanguage == \"\") {\r\n\t $alanguage = \"\"._ALL.\"\";\r\n\t}\r\n\tformatTimestamp($time);\r\n\techo \"<tr><td align=\\\"right\\\"><b>$sid</b>\"\r\n\t .\"</td><td align=\\\"left\\\" width=\\\"100%\\\"><a href=\\\"article.php?sid=$sid\\\">$title</a>\"\r\n\t .\"</td><td align=\\\"center\\\">$alanguage\"\r\n\t .\"</td><td align=\\\"right\\\">$topicname\";\r\n\tif (($radminarticle==1) OR ($radminsuper==1)) {\r\n\t if (($radminarticle==1) AND ($aid == $said) OR ($radminsuper==1)) {\r\n\t\techo \"</td><td align=\\\"right\\\" nowrap>(<a href=\\\"admin.php?op=EditStory&sid=$sid\\\">\"._EDIT.\"</a>-<a href=\\\"admin.php?op=RemoveStory&sid=$sid\\\">\"._DELETE.\"</a>)\"\r\n\t\t .\"</td></tr>\";\r\n\t } else {\r\n\t\techo \"</td><td align=\\\"right\\\" nowrap><font class=\\\"content\\\"><i>(\"._NOFUNCTIONS.\")</i></font>\"\r\n\t\t .\"</td></tr>\";\r\n\t }\r\n\t} else {\r\n\t echo \"</td></tr>\";\r\n\t}\r\n }\r\n echo \"\r\n </table>\";\r\n if (($radminarticle==1) OR ($radminsuper==1)) {\r\n\techo \"<center>\r\n\t<form action=\\\"admin.php\\\" method=\\\"post\\\">\r\n\t\"._STORYID.\": <input type=\\\"text\\\" NAME=\\\"sid\\\" SIZE=\\\"10\\\">\r\n\t<select name=\\\"op\\\">\r\n\t<option value=\\\"EditStory\\\" SELECTED>\"._EDIT.\"</option>\r\n\t<option value=\\\"RemoveStory\\\">\"._DELETE.\"</option>\r\n\t</select>\r\n\t<input type=\\\"submit\\\" value=\\\"\"._GO.\"\\\">\r\n\t</form></center>\";\r\n }\r\n CloseTable();\r\n $result = sql_query(\"SELECT pollID, pollTitle, timeStamp FROM $prefix\"._poll_desc.\" $queryplang ORDER BY pollID DESC limit 1\", $dbi);\r\n $object = sql_fetch_object($result, $dbi);\r\n $pollID = $object->pollID;\r\n $pollTitle = $object->pollTitle;\r\n echo \"<br>\";\r\n OpenTable();\r\n echo \"<center><b>\"._CURRENTPOLL.\":</b> $pollTitle [ <a href=\\\"admin.php?op=polledit&pollID=$pollID\\\">\"._EDIT.\"</a> | <a href=\\\"admin.php?op=create\\\">\"._ADD.\"</a> ]</center>\";\r\n CloseTable();\r\n include (\"footer.php\");\r\n}", "function jigoshop_system_info() {\n\t?>\n\t<div class=\"wrap jigoshop\">\n\t\t<div class=\"icon32 icon32-jigoshop-debug\" id=\"icon-jigoshop\"><br/></div>\n\t <h2><?php _e('System Information','jigoshop') ?></h2>\n\t <p>Use the information below when submitting technical support requests via <a href=\"http://support.jigoshop.com/\" title=\"Jigoshop Support\" target=\"_blank\">Jigoshop Support</a>.</p>\n\t\t<div id=\"tabs-wrap\">\n\t\t\t<ul class=\"tabs\">\n\t\t\t\t<li><a href=\"#versions\"><?php _e('Environment', 'jigoshop'); ?></a></li>\n\t\t\t\t<li><a href=\"#debugging\"><?php _e('Debugging', 'jigoshop'); ?></a></li>\n\t\t\t</ul>\n\t\t\t<div id=\"versions\" class=\"panel\">\n\t\t\t\t<table class=\"widefat fixed\">\n\t\t <thead>\t\t \n\t\t \t<tr>\n\t\t <th scope=\"col\" width=\"200px\"><?php _e('Software Versions','jigoshop')?></th>\n\t\t <th scope=\"col\">&nbsp;</th>\n\t\t </tr>\n\t\t \t</thead>\n\t\t \t<tbody>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('Jigoshop Version','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php echo jigoshop::get_var('version'); ?></td>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('WordPress Version','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php if (is_multisite()) echo 'WPMU'; else echo 'WP'; ?> <?php echo bloginfo('version'); ?></td>\n\t\t </tr>\n\t\t </tbody>\n\t\t <thead>\n\t\t <tr>\n\t\t <th scope=\"col\" width=\"200px\"><?php _e('Server','jigoshop')?></th>\n\t\t <th scope=\"col\"><?php echo (defined('PHP_OS')) ? (string)(PHP_OS) : 'N/A'; ?></th>\n\t\t </tr>\n\t\t </thead>\n\t\t \t<tbody>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('PHP Version','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php if(function_exists('phpversion')) echo phpversion(); ?></td>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('Server Software','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>\n\t\t </tr>\n\t\t \t</tbody>\n\t\t </table>\n\t\t\t</div>\n\t\t\t<div id=\"debugging\" class=\"panel\">\n\t\t\t\t<table class=\"widefat fixed\">\n\t\t <tbody>\n\t\t \t<tr>\n\t\t <th scope=\"col\" width=\"200px\"><?php _e('Debug Information','jigoshop')?></th>\n\t\t <th scope=\"col\">&nbsp;</th>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('UPLOAD_MAX_FILESIZE','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php \n\t\t \tif(function_exists('phpversion')) echo (jigoshop_let_to_num(ini_get('upload_max_filesize'))/(1024*1024)).\"MB\";\n\t\t ?></td>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('POST_MAX_SIZE','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php \n\t\t \tif(function_exists('phpversion')) echo (jigoshop_let_to_num(ini_get('post_max_size'))/(1024*1024)).\"MB\";\n\t\t ?></td>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('WordPress Memory Limit','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php \n\t\t \techo (jigoshop_let_to_num(WP_MEMORY_LIMIT)/(1024*1024)).\"MB\";\n\t\t ?></td>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('WP_DEBUG','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php echo (WP_DEBUG) ? __('On', 'jigoshop') : __('Off', 'jigoshop'); ?></td>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('DISPLAY_ERRORS','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php echo (ini_get('display_errors')) ? 'On (' . ini_get('display_errors') . ')' : 'N/A'; ?></td>\n\t\t </tr>\n\t\t <tr>\n\t\t <td class=\"titledesc\"><?php _e('FSOCKOPEN','jigoshop')?></td>\n\t\t <td class=\"forminp\"><?php if(function_exists('fsockopen')) echo '<span style=\"color:green\">' . __('Your server supports fsockopen.', 'jigoshop'). '</span>'; else echo '<span style=\"color:red\">' . __('Your server does not support fsockopen.', 'jigoshop'). '</span>'; ?></td>\n\t\t </tr>\n\t\t \t</tbody>\n\t\t </table>\n\t\t\t</div>\n\t\t</div> \n </div>\n <script type=\"text/javascript\">\n\tjQuery(function() {\n\t // Tabs\n\t\tjQuery('ul.tabs').show();\n\t\tjQuery('ul.tabs li:first').addClass('active');\n\t\tjQuery('div.panel:not(div.panel:first)').hide();\n\t\tjQuery('ul.tabs a').click(function(){\n\t\t\tjQuery('ul.tabs li').removeClass('active');\n\t\t\tjQuery(this).parent().addClass('active');\n\t\t\tjQuery('div.panel').hide();\n\t\t\tjQuery( jQuery(this).attr('href') ).show();\n\t\t\treturn false;\n\t\t});\n\t});\n\t</script>\n\t<?php\n}", "function PKG_listSpecialpackages($key,$lala,$distr)\n{\ninclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n//if the key is empty select all packages\nif (empty($key))\n\t $grep=\" | sort\";\n\t else //only get packages matching the key\n\t $grep=\" | grep -i $key | sort\";\n\n\tHTML_showTableHeader();\n\n//write table header\n\techo (\"\n\t\t<tr>\n\t\t\t<td><span class=\\\"subhighlight\\\">$I18N_package_name</span></td>\n\t\t\t<td><span class=\\\"subhighlight\\\">$I18N_size</span></td>\n\t\t\t<td><span class=\\\"subhighlight\\\">$I18N_description</span></td>\n\t\t\t<td><span class=\\\"subhighlight\\\">$I18N_selected</span></td>\n\t\t</tr>\n\t\t\");\n\n//list all m23 special packages and cut the path\n$file=popen(\"find /m23/data+scripts/packages/ /m23/inc/distr/$distr/packages -xtype f -name 'm23*Install.php' -printf \\\"%f\\\\n\\\" $grep;\nfind /m23/data+scripts/packages/userPackages/ -xtype f -name 'm23*Install.php' -printf \\\"%f\\\\n\\\" $grep | awk '{print(\\\"?\\\"$0)}';\" ,\"r\");\n\n$i=0;\nwhile (!feof($file))\n\t{\n\t\t$line=fgets($file,10000);\n\t\t//if we can't get a package: break\n\t\tif (empty($line))\n\t\t\tbreak;\n\n\t\t//User scripts are marked with a ?\n\t\tif ($line[0] == \"?\")\n\t\t\t{\n\t\t\t\t$userScript = '<img border=\"0\" src=\"/gfx/scriptEditor-mini.png\"> ';\n\t\t\t\t$temp = explode(\"?\",$line);\n\t\t\t\t$line = $temp[1];\n\t\t\t}\n\t\telse\n\t\t\t$userScript = '';\n\n\t\tif (($i % 2) == 0)\n\t\t\t$col = 'bgcolor=\"#A4D9FF\" bordercolor=\"#A4D9FF\"';\n\t\telse\n\t\t\t$col = '';\n\n\t\t//split package name and extension\n\t\t$name_extension=explode(\"Install.php\",$line);\n\n\t\t//adds remove line for other packages\n\t\t$var=\"CB_specialPkg\".$i;\n\t\t\n\t\techo(\"<tr $col><td>$userScript\".$name_extension[0].\"</td><td></td><td>\".PKG_getSpecialPackageDescription($name_extension[0],$distr).\"</td><td><input type=\\\"checkbox\\\" name=\\\"$var\\\" value=\\\"\".$name_extension[0].\"\\\"></td></tr>\\n\");\n\n\t\t$i++;\n\t};\n\t\n\tpclose($file);\n\n\tHTML_showTableEnd();\n\nreturn($i);\n}", "function hi_updateVersion() {\n global $pth;\n\n return '<h1>CMSimple_XH - Update-Check</h1>' . \"\\n\"\n . tag('img src=\"' . $pth['folder']['plugins'] . 'hi_updatecheck/images/software-update-icon.png\" class=\"upd_plugin_icon\"')\n . '<p>Version: ' . UPD_VERSION . ' - ' . UPD_DATE . '</p>' . \"\\n\"\n . '<p>Copyright &copy;2013-2014 <a href=\"http://cmsimple.holgerirmler.de/\">Holger Irmler</a> - all rights reserved' . tag('br')\n . '<p class=\"upd_license\">License: GPL3</p>' . \"\\n\"\n . '<p class=\"upd_license\">THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR'\n . ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,'\n . ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE'\n . ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER'\n . ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,'\n . ' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE'\n . ' SOFTWARE.</p>' . \"\\n\";\n}", "function setup()\n\t{\n\t\t// Make sure there are directories\n\t\t$dirs = $this->directories(FALSE, TRUE);\n\t\tif (empty($dirs))\n\t\t{\n\t\t\treturn ee()->output->send_ajax_response(array(\n\t\t\t\t'error' => lang('no_upload_dirs')\n\t\t\t));\n\t\t}\n\n\t\tif (REQ != 'CP')\n\t\t{\n\t\t\tee()->load->helper('form');\n\t\t\t$action_id = '';\n\n\t\t\tee()->db->select('action_id');\n\t\t\tee()->db->where('class', 'Channel');\n\t\t\tee()->db->where('method', 'filemanager_endpoint');\n\t\t\t$query = ee()->db->get('actions');\n\n\t\t\tif ($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$row = $query->row();\n\t\t\t\t$action_id = $row->action_id;\n\t\t\t}\n\n\t\t\t$vars['filemanager_backend_url'] = str_replace('&amp;', '&', ee()->functions->fetch_site_index(0, 0).QUERY_MARKER).'ACT='.$action_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars['filemanager_backend_url'] = ee()->cp->get_safe_refresh();\n\t\t}\n\n\t\tunset($_GET['action']);\t// current url == get_safe_refresh()\n\n\t\t$vars['filemanager_directories'] = $this->directories(FALSE);\n\n\t\t// Generate the filters\n\t\t// $vars['selected_filters'] = form_dropdown('selected', array('all' => lang('all'), 'selected' => lang('selected'), 'unselected' => lang('unselected')), 'all');\n\t\t// $vars['category_filters'] = form_dropdown('category', array());\n\t\t$vars['view_filters'] = form_dropdown(\n\t\t\t'view_type',\n\t\t\tarray(\n\t\t\t\t'list' => lang('list'),\n\t\t\t\t'thumb' => lang('thumbnails')\n\t\t\t),\n\t\t\t'list', 'id=\"view_type\"'\n\t\t);\n\n\t\t$data = $this->datatables(key($vars['filemanager_directories']));\n\t\t$vars = array_merge($vars, $data);\n\n\t\t$filebrowser_html = ee()->load->ee_view('_shared/file/browser', $vars, TRUE);\n\n\t\tee()->output->send_ajax_response(array(\n\t\t\t'manager'\t\t=> str_replace(array(\"\\n\", \"\\t\"), '', $filebrowser_html),\t// reduces transfer size\n\t\t\t'directories'\t=> $vars['filemanager_directories']\n\t\t));\n\t}", "function skin_diff_overview($content, $missing, $changed) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<script type=\"text/javascript\" src='{$this->ipsclass->skin_acp_url}/acp_template.js'></script>\n<div class='tableborder'>\n <div class='tableheaderalt'>\n <table cellpadding='0' cellspacing='0' border='0' width='100%'>\n <tr>\n <td align='left' width='95%' style='font-size:12px; vertical-align:middle;font-weight:bold; color:#FFF;'>Сравнение стилей</td>\n <td align='right' width='5%' nowrap='nowrap'>\n &nbsp;\n </td>\n </tr>\n</table>\n </div>\n <table cellpadding='0' cellspacing='0' width='100%'>\n <tr>\n <td class='tablesubheader' width='90%'><strong>Название шаблона</strong></td>\n <td class='tablesubheader' width='5%'>Различия</a>\n <td class='tablesubheader' width='5%'>Размер</a>\n <td class='tablesubheader' width='5%'>&nbsp;</a>\n </tr>\n $content\n </table>\n <div align='right' class='tablefooter'>$missing новых шаблонов и $changed измененных</div>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function fileDotPHP(){\n\t\t// Gets the file or files based on URL\n\t\tif(isset($_GET['file'])){\n\t\t\t$result = mysql_query(getFile($_GET['file']));\n\t\t}else{\n\t\t\t$result = mysql_query(getFile(\"\"));\n\t\t}\n\t\t\n\t\t// Displays what was retrieved\n\t\twhile ($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tif(isset($_GET['file'])){\n\t\t\t\t$GLOBALS['adminObjectId'] = $GLOBALS['fileId'];\n\t\t\t}\t?>\n\t\t\t<div class=\"clear\">\n\t\t\t\t<div class=\"fl\">\n\t\t\t\t<?\tif(isset($_GET['file'])){ ?>\n\t\t\t\t\t\t<h1><? printHTML($GLOBALS['objectTitle']); ?></h1>\n\t\t\t\t<?\t}else{ ?>\n\t\t\t\t\t\t<h2><a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['fileId'])); ?>\"><? printHTML($GLOBALS['objectTitle']); ?></a></h2>\n\t\t\t\t<?\t} ?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"fr\">\n\t\t\t\t<?\t$result2 = mysql_query(getUser($GLOBALS['createdId'], \"userId\"));\n\t\t\t\t\t\n\t\t\t\t\t$row2 = mysql_fetch_assoc($result2);\n\t\t\t\t\tgetUserGlobals($row2);\n\t\t\t\t?>\t<h3>Created By: <a href=\"<? printHTML(fullURL(getLangVar(\"userURL\")) . $GLOBALS['userId']); ?>\"><? printHTML($GLOBALS['userName']); ?></a></h3>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cl\">\n\t\t\t\t\t<? printHTML($GLOBALS['objectText']); ?>\n\t\t\t\t</div>\n\t\t\t<?\tif(isset($_GET['file'])){ ?>\n\t\t\t\t<div>\n\t\t\t\t\t<h3><a href=\"<? printHTML($GLOBALS['filePath']); ?>\">Download</a></h3>\n\t\t\t\t</div>\n\t\t\t<?\t}\t?>\n\t\t\t\t<div class=\"fl\">\n\t\t\t\t\t<h4>Created: <? printHTML(date($GLOBALS['dateTimeFormat'], addDate($GLOBALS['createdOn'], $GLOBALS['timeOffset'], \"hour\"))); ?></h4>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"fr\">\n\t\t\t\t\t<h4><a href=\"<? printHTML(fullURL(getLangVar(\"eventURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Sub Event</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"messageURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Reply</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Attach File</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['fileId'], \"edit\")); ?>\">Edit</a></h4>\n\t\t\t\t</div>\n\t\t\t</div>\n\t<?\t}\n\t\t\n\t\t// Gets related objects\n\t\tif(isset($_GET['file'])){\n\t\t\tgetRelatedObjects($GLOBALS['objectId']);\n\t\t}\n\t}", "function havp_AVupdate_script() {\n\t$hvdef_freshclam_path = HVDEF_FRESHCLAM_PATH;\n\t$hvdef_sigtool_path = HVDEF_SIGTOOL_PATH;\n\t$f = HVDEF_UPD_STATUS_FILE;\n\t$u = HVDEF_FRESHCLAM_STATUS_FILE;\n\treturn <<< EOD\n#!/bin/sh\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update started.\" > $f\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus database already is updated.\" > $u\n{$hvdef_freshclam_path}\nwait\n/bin/cat $u >> $f\n{$hvdef_sigtool_path} --unpack-current daily.cvd\n{$hvdef_sigtool_path} --unpack-current main.cvd\nwait\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update end.\" >> $f\nEOD;\n\n}", "public function main() {\n\t\t$content = '';\n\t\t/** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n\t\t$objectManager = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n\t\t// Clear the class cache\n\t\t/** @var \\SJBR\\StaticInfoTables\\Cache\\ClassCacheManager $classCacheManager */\n\t\t$classCacheManager = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Cache\\\\ClassCacheManager');\n\t\t$classCacheManager->reBuild();\n\n\t\t// Update the database\n\t\t/** @var \\SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility $databaseUpdateUtility */\n\t\t$databaseUpdateUtility = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Utility\\\\DatabaseUpdateUtility');\n\t\t$databaseUpdateUtility->doUpdate('static_info_tables_it');\n\n\t\t$content.= '<p>' . LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables') . ' static_info_tables_it.</p>';\n\t\treturn $content;\n\t}", "function update_tables($inst=null) {\n// create the nodes of all the tables\n\tglobal $conn,$DB,$DTB_PRE,$TB_PRE,$wise_table,$VWMLDBM;\n\tif($inst==1) {\n\t\tif($_SESSION['vwmldbm_inst']!=1) return; // inst=1 is super inst,so access should be protected\n\t}\n\telseif($inst>1 && $inst!=$_SESSION['vwmldbm_inst'] && $_SESSION['vwmldbm_inst']!=1) return; // inst=1 can access other inst\n\telseif(!$inst) $inst=$_SESSION['vwmldbm_inst']; \n\n// SJH_MOD \n\tif($TB_PRE==\"\" || $TB_PRE==null) $sql=\"select no from {$DTB_PRE}vwmldbm_tb where name like '%'\";\n\telse $sql=\"select no from {$DTB_PRE}vwmldbm_tb where name like '$TB_PRE\".\"\\_%'\";\n\n\t$res_tables=mysqli_query($conn,$sql);\n \n\tif($res_tables) {\n\t\twhile($rs_tables=mysqli_fetch_array($res_tables)) $wise_table[]=Table_node::get_new_node($rs_tables['no'],$inst);\n\t}\n\t$num_tables=0;\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$num_tables++;\n\t}\n\techo \"The number of tables: <b>$num_tables</b> <br>\";\n\t\n\tif($num_tables<1) return;\n\n// update upLinks and downlinks\n\t$res_f=mysqli_query($conn,\"select * from {$DTB_PRE}vwmldbm_rmd_fkey_info \");\n\t\n\tif($res_f) {\n\t\tif(mysqli_num_rows($res_f)<1) return; // there is no data in wise_rmd_feky_info\n\t\twhile($rs_f=mysqli_fetch_array($res_f)) {\n\t\t\t$from_tb_no=get_tree_no($rs_f['from_db'],$rs_f['from_tb'],$inst);\n\t\t\t$to_tb_no=get_tree_no($rs_f['to_db'],$rs_f['to_tb'],$inst);\n\t\t\t//echo $from_tb_no .\" => \".$to_tb_no.\"<br>\";\n\t\t\tupdate_node($from_tb_no,$to_tb_no);\n\t\t}\n\t}\n\n\t\n// root/terminal node unmarking\t\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif(count($wise_table[$i]->upLink))\n\t\t\t$wise_table[$i]->is_root=false;\n\t\tif(count($wise_table[$i]->downLink)){\n\t\t\t$wise_table[$i]->is_terminal=false;\n\t\t}\n\t}\n\t\n\t\n// Find each root node and do the df_traversal.\n\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->is_root) { // root node found\n\t\t\tif($wise_table[$i]->is_terminal) {\n\t\t\t\t//echo \"#\".$wise_table[$i]->tb_no.\" is an isolated node.<br>\";\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach($wise_table[$i]->downLink as $child) \n\t\t\t\t\tdf_traversal(find_node($child),$wise_table[$i]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\n// Update the orders of creation into wise2_vwmldbm_tb\n\t$how_many_in_each_level=array();\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\t$how_many_in_each_level[$wise_table[$i]->level]++;\t\n\t}\n\t$cnt=0;\n\tfor($i=0;$i<count($wise_table);$i++){ // update the isolated nodes\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\tif(type_of_table($DB,$TB_PRE,get_tb_name($wise_table[$i]->tb_no),$inst)=='V') continue; // skip VIEW\n\t\tif($wise_table[$i]->is_root==true && $wise_table[$i]->is_terminal==true) $wise_table[$i]->order_of_creation=++$cnt;\n\t}\n\tfor($i=count($how_many_in_each_level)-1;$i>=0;$i--){ // update all other nodes\n\t\tfor($j=0;$j<count($wise_table);$j++){\n\t\t\tif($wise_table[$j]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t\tif(type_of_table($DB,$TB_PRE,get_tb_name($wise_table[$i]->tb_no,$inst))=='V') continue; // skip VIEW\n\t\t\tif($wise_table[$j]->is_root==true && $wise_table[$j]->is_terminal==true) continue; // these isolated nodes were counted already before.\n\t\t\tif($wise_table[$j]->level==$i){\n\t\t\t\t$wise_table[$j]->order_of_creation=++$cnt;\t\t\t\n\t\t\t}\n\t\t}\n\t}\n // update the order of creation info into wise2.wise2_system.wise_table\t\n\tfor($i=0;$i<count($wise_table);$i++){ // Tables (not views)\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$tb_name=get_tb_name($wise_table[$i]->tb_no,$inst);\n\t\tif(type_of_table($DB,$TB_PRE,$tb_name)=='V') continue; // skip VIEW\n\t\t\t\n\t\tmysqli_query($conn,\"update {$DTB_PRE}vwmldbm_tb set creating_order='\".$wise_table[$i]->order_of_creation.\"' where name='$tb_name'\");\n\t\t//echo $wise_table[$i]->tb_no.\": \".$wise_table[$i]->order_of_creation.\"<br>\";\t\n\t}\n\n// Determine the creating order of views from installation file\n\tif(file_exists($VWMLDBM['wise_rt'].\"/install/sql/view.php\")){\t\t\n\t\t$sql_view=array();\n\t\trequire_once($VWMLDBM['wise_rt'].\"/install/sql/view.php\");\t\n\t}\n\t\n// Remark: during the init_inst, view.php didn't become the part of the array.\n// But second time is okay. So for now let it go.\n//echo \"COUNT SQL_VIEW=\".count($sql_view);\n\n\tfor($i=0;$i<count($wise_table);$i++){ // Views (not tables)\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$tb_name=get_tb_name($wise_table[$i]->tb_no,$inst);\n\t\tif(type_of_table($DB,$TB_PRE,$tb_name)!='V') continue; // skip Tables (Not views)\n\t\t$view_name=substr($tb_name,strlen($TB_PRE)+1);\n\t\tif($sql_view) $tb_c_order=array_search($view_name,array_keys($sql_view))+$cnt+1;\n\t\t\n\t\tmysqli_query($conn,\"update {$DTB_PRE}vwmldbm_tb set creating_order='$tb_c_order' where name='$tb_name'\");\t\n\t}\n}", "function import_sync($localexec=null) {\n $link = GetGlobal('db');\n\t \n\t if ($localexec!=null) {//bin file get in\n\t //html out to mail\n\t $html_start = null;//'<html><body>';\n\t\t $html_end = null;//'</body></html>';\t \n\t $execbin = remote_paramload('RCIMPORTDB','binsyncfile',$this->path);\n\t if (!$execbin) \n\t return($html_start.'<h2>Sevice Deactivated!</h2>'.$html_end);\n }\n\t else { \n\t //no html web exec\n\t $html_start = null;\n\t\t $html_end = null;\n\t }\t\n\t \n if (is_array($this->syncfiles)) {\n\t \n\t foreach ($this->syncfiles as $f=>$sfile) {\n\t\t $ret .= '<br><h2>'.$sfile.'</h2><br>';\n\t\t \n\t\t $fparts = explode('.',$sfile);\n\t\t \t\t \n $ret .= $this->import_table($fparts[0],$sfile,'<@>');\n\t\t \n $ret .= '---------------------------<br><br>';\t\t \n\t\t }\n\t }\n\t \n\t return ($html_start.$ret.$html_end);\t \t \n\t \n }", "function ninja_forms_tab_system_status(){\n\t// Display the system status!\n\tinclude(\"system-status-html.php\");\n}" ]
[ "0.5896481", "0.574359", "0.57088673", "0.5664245", "0.5571651", "0.5555847", "0.55236053", "0.55213886", "0.54514915", "0.5437935", "0.5396095", "0.53941524", "0.5381396", "0.5348468", "0.5346898", "0.5336269", "0.5310747", "0.5294862", "0.52886534", "0.527385", "0.522084", "0.52089655", "0.51808673", "0.51738167", "0.5155043", "0.51523596", "0.5150812", "0.51413953", "0.5134173", "0.51311487" ]
0.74232733
0
/ Function: build produces html page for selecting hypha modules and languages to package in a new hypha.php install script
function build() { $localIndex = index(); arsort($localIndex); ob_start(); ?> <div style="width:600px;"> <h1>hypha builder</h1> Here you can compose your own hypha system. <ol> <li>First you have to enter a name and password for the so called 'superuser' account.</li> <li>Then you can select a number of modules for different data types you want to incorporate in your hypha system.</li> <li>When you click 'build' your superuser account and selection of modules will be packed into one php file ('hypha.php') which is offered for download.</li> <li>Upload the downloaded file into a webdirectory on your server and make shure php has write access to the folder. Open the file in a browser. You will be asked to login as superuser and after setting up some variables hypha will be installed.</li> </ol> </div> <table class="section"> <tr><th style="text-align:right; white-space:nowrap;">superuser name:</th><td><input id="username" name="username" type="text" /></td></tr> <tr><th style="text-align:right; white-space:nowrap;">superuser password:</th><td><input name="password" type="password" /></td></tr> <tr name="datatype"> <th style="text-align:right; white-space:nowrap;">modules to include:</th><td> <?php foreach ($localIndex as $file => $timestamp) { if (substr($file, 0, 17) == 'system/datatypes/') { $name = substr($file, 17, -4); if ($name!='settings') echo '<input type="checkbox" name="build_'.substr($file,0,-4).'"'.($name == 'text' ? ' checked="checked"' : '').' /> '.$name.'<br/>'."\n"; } } ?> </td></tr> <tr name="language"> <th style="text-align:right; white-space:nowrap;">languages to include:</th><td> <?php foreach ($localIndex as $file => $timestamp) { if (substr($file, 0, 17) == 'system/languages/' && substr($file, -4) == '.php') { $name = substr($file, 17, -4); echo '<input type="checkbox" name="build_'.substr($file,0,-4).'"'.($name == 'en' ? ' checked="checked"' : '').' /> '.$name.'<br/>'."\n"; } } ?> </td></tr> <tr><td colspan="2" style="text-align:right;"><input type="submit" id="gobutton" name="command" value="build"></td></tr> </table> <?php return ob_get_clean(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function install() {\n\t\tglobal $errorMessage;\n\n\t\tif ($_POST['command'] == 'install' && is_writable('.')) {\n\t\t\t// upzip and install files\n\t\t\t$files = explode(',', data('index'));\n\t\t\tforeach ($files as $file) {\n\t\t\t\tif (!$file)\n\t\t\t\t\tcontinue;\n\t\t\t\t$path = pathinfo($file);\n\t\t\t\t$dir = explode('/', $path['dirname']);\n\t\t\t\t$folder = '';\n\t\t\t\tforeach($dir as $d) {\n\t\t\t\t\t$folder.= ($folder ? '/' : '').$d;\n\t\t\t\t\tif (!file_exists($folder)) mkdir($folder, 0755);\n\t\t\t\t}\n\t\t\t\tfile_put_contents($file, data($file));\n\t\t\t\tchmod($file, 0664);\n\t\t\t}\n\n\t\t\t// Needed for password hashing\n\t\t\trequire_once('system/core/crypto.php');\n\n\t\t\t// create data folders\n\t\t\tmkdir('data/pages', 0755);\n\t\t\tmkdir('data/images', 0755);\n\n\t\t\t// create default page\n\t\t\t$id = uniqid();\n\t\t\t$xml = new DomDocument('1.0', 'UTF-8');\n\t\t\t$xml->preserveWhiteSpace = false;\n\t\t\t$xml->formatOutput = true;\n\t\t\t$hypha = $xml->createElement('hypha');\n\t\t\t$hypha->setAttribute('type', 'textpage');\n\t\t\t$hypha->setAttribute('multiLingual', 'on');\n\t\t\t$hypha->setAttribute('versions', 'on');\n\t\t\t$hypha->setAttribute('schemaVersion', 1);\n\t\t\t$language = $xml->createElement('language', '');\n\t\t\t$language->setAttribute('xml:id', $_POST['setupDefaultLanguage']);\n\t\t\t$version = $xml->createElement('version', '<p>welcome to your brand new hypha website.</p>');\n\t\t\t$version->setAttribute('xml:id', 't'.time());\n\t\t\t$version->setAttribute('author', '');\n\t\t\tsetNodeHtml($version, '<p>welcome to your brand new hypha website.</p>');\n\t\t\t$language->appendChild($version);\n\t\t\t$hypha->appendChild($language);\n\t\t\t$xml->appendChild($hypha);\n\t\t\t$xml->save('data/pages/'.$id);\n\n\t\t\t// build hypha.xml\n\t\t\t$xml = new DomDocument('1.0', 'UTF-8');\n\t\t\t$xml->preserveWhiteSpace = false;\n\t\t\t$xml->formatOutput = true;\n\t\t\t$hypha = $xml->createElement('hypha');\n\t\t\t$hypha->setAttribute('type', 'project');\n\t\t\t$hypha->setAttribute('defaultLanguage', $_POST['setupDefaultLanguage']);\n\t\t\t$hypha->setAttribute('defaultPage', $_POST['setupDefaultPage']);\n\t\t\t$hypha->setAttribute('email', $_POST['setupEmail']);\n\t\t\t$hypha->setAttribute('digestInterval', '21600');\n\t\t\t$hypha->setAttribute('schemaVersion', 1);\n\t\t\t$hypha->appendChild($xml->createElement('title', $_POST['setupTitle']));\n\t\t\t$header = $xml->createElement('header', $_POST['setupTitle']);\n\t\t\t$hypha->appendChild($header);\n\t\t\t$footer = $xml->createElement('footer', '');\n\t\t\tsetNodeHtml($footer, '<a href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img alt=\"Creative Commons License\" style=\"border-width: 0pt; float: right; margin-left: 5px;\" src=\"//i.creativecommons.org/l/by-sa/3.0/88x31.png\" /></a> This work is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>. Website powered by <a href=\"http://www.hypha.net\">hypha</a>.');\n\t\t\t$hypha->appendChild($footer);\n\t\t\t$menu = $xml->createElement('menu', '');\n\t\t\tsetNodeHtml($menu, '<a href=\"hypha:'.$id.'\"/>');\n\t\t\t$hypha->appendChild($menu);\n\t\t\t$userList = $xml->createElement('userList', '');\n\t\t\t$user = $xml->createElement('user', '');\n\t\t\t$user->setAttribute('id', uniqid());\n\t\t\t$user->setAttribute('username', $_POST['setupUsername']);\n\t\t\t$user->setAttribute('password', hashPassword($_POST['setupPassword']));\n\t\t\t$user->setAttribute('fullname', $_POST['setupFullname']);\n\t\t\t$user->setAttribute('email', $_POST['setupEmail']);\n\t\t\t$user->setAttribute('rights', 'admin');\n\t\t\t$userList->appendChild($user);\n\t\t\t$hypha->appendChild($userList);\n\t\t\t$pageList = $xml->createElement('pageList', '');\n\t\t\t$page = $xml->createElement('page', '');\n\t\t\t$page->setAttribute('id', $id);\n\t\t\t$page->setAttribute('type', 'textpage');\n\t\t\t$page->setAttribute('private', 'off');\n\t\t\t$language = $xml->createElement('language', '');\n\t\t\t$language->setAttribute('id', $_POST['setupDefaultLanguage']);\n\t\t\t$language->setAttribute('name', $_POST['setupDefaultPage']);\n\t\t\t$page->appendChild($language);\n\t\t\t$pageList->appendChild($page);\n\t\t\t$hypha->appendChild($pageList);\n\t\t\t$hypha->appendChild($xml->createElement('digest', ''));\n\t\t\t$xml->appendChild($hypha);\n\t\t\t$xml->save('data/hypha.xml');\n\n\t\t\t// goto hypha site\n\t\t\theader('Location: '.$_POST['setupBaseUrl']);\n\t\t\texit;\n\t\t}\n\t\telse {\n\t\t\tif (!is_writable('.')) $errorMessage.= 'php has no write access to the hypa installation directory on the server<br/>';\n\n\t\t\t// extract list of languages\n\t\t\t$iso639 = json_decode(data('system/languages/languages.json'), true);\n\t\t\t$languageOptionList = '';\n\t\t\tforeach($iso639 as $code => $langName) $languageOptionList.= '<option value=\"'.$code.'\"'.( $code=='en' ? ' selected' : '').'>'.$code.': '.$langName.'</option>';\n\n\t\t\t// build html\n\t\t\tob_start();\n?>\n\t\t<div style=\"width:800px;\">\n\t\t\t<h1>hypha installer</h1>\n\t\t\tIn order to set up this new hypha site you need to fill out a few things. This is a once only procedure. The entered data will be used to create some folders, include scripts and config files in the folder where the hypha script resides.\n\t\t\t<h2>system configuration</h2>\n\t\t\tThe following settings are used to set up your project website. All settings can be changed after the initial installation.<br/>\n\t\t\t<table style=\"width:800px;\" class=\"section\">\n\t\t\t\t<tr><td width=\"240\"></td><td></td><td width=\"400\"></td></tr>\n\t\t\t\t<tr><th>title</th><td><input name=\"setupTitle\" size=\"40\" value=\"<?=$_POST['setupTitle'];?>\" /></td><td class=\"help\">The name of your site as it will appear in the browers title bar.</td></tr>\n\t\t\t\t<tr><th>base url</th><td><input name=\"setupBaseUrl\" size=\"40\" value=\"http://<?=$_SERVER[\"SERVER_NAME\"].str_replace('/hypha.php', '', $_SERVER[\"REQUEST_URI\"])?>\" /></td><td class=\"help\">This is the address where the hypha site can be found.</td></tr>\n\t\t\t\t<tr><th>default page</th><td><input name=\"setupDefaultPage\" size=\"40\" value=\"home\" value=\"<?=$_POST['setupDefaultPage'];?>\" /></td><td class=\"help\">Hypha lets you create wiki style pages which can link to each other. If no particular page is selected the site will default to this page.</td></tr>\n\t\t\t\t<tr><th>default language</th><td><select name=\"setupDefaultLanguage\"><?=$languageOptionList?></select></td><td class=\"help\">All pages can be multilingual. If a user does not choose a language the site will default to this language.</td></tr>\n\t\t\t\t<tr><th>login</th><td><input name=\"setupUsername\" size=\"40\" value=\"<?=$_POST['setupUsername'];?>\" /></td><td class=\"help\">This first user account will automatically have admin rights for site maintenance.</td></tr>\n\t\t\t\t<tr><th>password</th><td><input name=\"setupPassword\" size=\"40\" value=\"<?=$_POST['setupPassword'];?>\" /></td><td class=\"help\">The superuser password.</td></tr>\n\t\t\t\t<tr><th>full name</th><td><input name=\"setupFullname\" size=\"40\" value=\"<?=$_POST['setupFullname'];?>\" /></td><td class=\"help\">This name will be used for email messages generated by the system.</td></tr>\n\t\t\t\t<tr><th>email</th><td><input name=\"setupEmail\" size=\"40\" value=\"<?=$_POST['setupEmail'];?>\" /></td><td class=\"help\">This email adress will be the reply-to address of system sent messages. You may want to use an email alias that forwards messages to all collaborators in the group.</td></tr>\n\t\t\t\t<tr><td colspan=\"3\" style=\"text-align:right;\"><input type=\"submit\" name=\"command\" value=\"install\" /></td></tr>\n\t\t\t</table>\n\t\t</div>\n<?php\n\t\t\treturn ob_get_clean();\n\t\t}\n\t}", "function mainHTML()\n {\n ?>\n <h1>Upgrade Andromeda From Subversion</h1>\n \n <br/>\n This program will pull the latest release code for\n Andromeda directly from our Sourceforget.net Subversion tree. \n\n <br/>\n <br/>\n <b>This program directly overwrites the running Node Manager\n Code.</b> <span style=\"color:red\"><b>If you have been making changes to your Andromeda\n code on this machine all of those changes will be lost!</b><span>\n \n <br/>\n <br/>\n <a href=\"javascript:Popup('?gp_page=a_pullsvna&gp_out=none')\"\n >Step 1: Pull Code Now</a>\n \n <br/>\n <br/>\n <a href=\"javascript:Popup('?gp_page=a_builder&gp_out=none&txt_application=andro')\"\n >Step 2: Rebuild Node Manager</a>\n \n <?php\n \n }", "private function printToolHead() {\n\t\t\t$this->page->openBlock('div', 'iw-content');\n\t\t\t$this->page->addInline('p', 'This tool generates reports about wikilinks in one article:');\n\t\t\t$this->page->openBlock('ul');\n\t\t\t$this->page->addInline('li', 'Links from given article which have no backlinks from target article');\n\t\t\t$this->page->addInline('li', 'Backlinks from other articles which have no links from given article');\n\t\t\t$this->page->addInline('li', 'Links from given article with backlinks from other articles');\n\t\t\t$this->page->closeBlock();\n\t\t\t$this->page->addInline('h2', 'Options');\n\t\t\t\n\t\t\t// options\n\t\t\t$optionForm = new HtmlForm('index.php', 'GET');\n\t\t\t$optionForm->addHTML('<table class=\"iw-nostyle\">');\n\t\t\t\n\t\t\t// lang/project\n\t\t\t$optionForm->addHTML('<tr><td>');\n\t\t\t$optionForm->addLabel('lang', 'Project');\n\t\t\t$optionForm->addHTML('</td><td>');\n\t\t\t$optionForm->addInput('lang', $this->par['lang'], '', 7, true);\n\t\t\t$optionForm->addHTML('&nbsp;.&nbsp;');\n\t\t\t$optionForm->addInput('project', $this->par['project'], '', 20, true);\n\t\t\t$optionForm->addHTML('&nbsp;.org</td></tr>');\n\t\t\t\n\t\t\t// page\n\t\t\t$optionForm->addHTML('<tr><td>');\n\t\t\t$optionForm->addLabel('page', 'Page title');\n\t\t\t$optionForm->addHTML('</td><td>');\n\t\t\t$optionForm->addInput('page', $this->par['page'], 'A page title in the main namespace (0)', 0, true);\n\t\t\t$optionForm->addHTML('</td></tr>');\n\t\t\t\n\t\t\t// submit button\n\t\t\t$optionForm->addHTML('<tr><td colspan=\"2\">');\n\t\t\t$optionForm->addButton('submit', 'View page conjunction');\n\t\t\t$optionForm->addHTML('</td></tr>');\n\t\t\t\n\t\t\t$optionForm->addHTML('</table>');\n\t\t\t$optionForm->output();\n\t\t\t\n\t\t\t$this->page->closeBlock();\n\t\t}", "public static function installation_page()\n\t{\n\t\tmz_Func::user_has_access();\n\n\t\techo '\n\n\t\t\t<div class=\"wrap\">\n\n\t\t\t\t<h2>Mentorz - Installation Guidelines</h2>\n\t\t\t\t<p>Installation.</p>\n\t\t\t\t<p>Create three pages.</p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>/'.PLUGIN_ROOT_PAGE.'</li>\n\t\t\t\t\t<li>/'.PLUGIN_CREATE_PAGE.'</li>\n\t\t\t\t\t<li>/'.PLUGIN_READ_PAGE.'</li>\n\t\t\t\t</ol>\n\n\t\t\t\t<p>\n\t\t\t\tThese pages can be modified in settings.php if required.\n\t\t\t\t</p>\n\n\t\t\t\t<h3>Users</h3>\n\t\t\t\t<p>The system uses two types of user.</p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>Mentor</li>\n\t\t\t\t\t<li>Student</li>\n\t\t\t\t</ol>\n\n\t\t\t\t<p>When managing users in the WordPress User module ensure that users have the proper role.</p>\n\n\n\t\t\t\t<h3>Tags</h3>\n\n\t\t\t\t<p>The following tags are designed to be placed inside the WordPress page content area</p>\n\n\t\t\t\t<p><input value=\"[mentorz_inbox]\"> can be placed in the page to generate the inbox view. Pages must be /inbox (Or defined above)</p>\n\n\t\t\t\t<p><input value=\"[mentorz_create]\"> can be placed in the page to generate the message creation form. Page must be /inbox/create (Or defined above)</p>\n\n\t\t\t\t<p><input value=\"[mentorz_show]\"> can be placed in the page to generate the message view. Page must be /inbox/show (Or defined above)</p>\n\n\t\t\t\t<h3>Emails</h3>\n\t\t\t\t<p>When a message is generated the system will email the relevant user to notify them of the message</p>\n\t\t\t\t<p>The message content is NOT emailed for security reasons.</p>\n\t\t\t\t<p>The email details can be modified in settings.php</p>\n\n\t\t\t</div>\n\n\t\t';\n\t}", "public function buildHTML() {\n $vars = array('page' => &$this);\n\n // Trigger various page hooks.\n // Page init.\n $this->env->hook('page_preload', $vars);\n\n // This is an AJAX request. Skip loading index.html and just provide requested content.\n if (isset($_REQUEST['ajax'])) {\n $this->html = NodeFactory::render($this->env);\n }\n // This is an actual HTML page request. Commonly index.html.\n elseif (!empty($this->getIndexFile())) {\n $this->html = file_get_contents($this->env->dir['docroot'] . '/' . $this->getIndexFile());\n }\n // In case of a special pre-loaded page request, i.e. Shadow node edit.\n elseif (!empty($this->getData('content'))) {\n $this->html = $this->getData('content');\n }\n elseif (!is_file($this->env->dir['docroot'] . '/' . $this->getIndexFile())) {\n $this->html = t('Hello! Quanta seems not installed (yet) in your system. Please follow the <a href=\"https://www.quanta.org/installation-instructions\">Installation Instructions</a><br /><br />Reason: file not found(' . $this->getIndexFile() . ')');\n }\n\n // Trigger various page hooks.\n // Page init.\n $this->env->hook('page_init', $vars);\n\n // Page's body classes. // TODO: deprecate, include in page init.\n $this->env->hook('body_classes', $vars);\n\n // Page after build.\n $this->env->hook('page_after_build', $vars);\n\n // Page complete.\n $this->env->hook('page_complete', $vars);\n\n }", "function dashboard_admin_buildContent($data,$db) {\n\t//$url = 'http://localhost/proprietary/version/'; // base url for version \n\t$url = 'https://sitesense.org/dev/version/'; // base url for version \n\t// modules versions contact\n\t$statement = $db->prepare('getEnabledModules','admin_modules'); // modules don't register versions until they're enabled, so this function is borderline useless if you get every module\n\t$statement->execute();\n\t$modules = $statement->fetchAll();\n\t$moduleQuery = array();\n\tforeach($modules as $module){\n\t\tif(file_exists('modules/'.$module['name'].'/README.md')&&dashboard_parse_readme('modules/'.$module['name'].'/README.md')){\n\t\t\t$moduleQuery[$module['shortName']]=$module['version'];\n\t\t}\n\t}\n\t$statement=$db->prepare('getEnabledPlugins','plugins');\n\t$statement->execute();\n\twhile($fetch=$statement->fetch(PDO::FETCH_ASSOC)){\n\t\tif(file_exists('plugins/'.$module['name'].'/README.md')&&dashboard_parse_readme('modules/'.$module['name'].'/README.md')){\n\t\t\tif(file_exists('plugins/'.$fetch['name'].'/install.php')){\n\t\t\t\tcommon_include('plugins/'.$fetch['name'].'/install.php');\n\t\t\t}\n\t\t\tif(function_exists($fetch['name'].'_settings')){\n\t\t\t\t$settings=call_user_func($fetch['name'].'_settings');\n\t\t\t\tif(isset($settings['version'])){\n\t\t\t\t\t$moduleQuery[$fetch['name']]=$settings['version'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$moduleQuery = http_build_query(array('modules'=>$moduleQuery));\n\t$moduleQuery = rawurldecode($moduleQuery);\n\t$moduleUrl = $url . 'modules?' . $moduleQuery;\n\tif(isset($data->version)){\n\t\t$moduleUrl .= '&core='.$data->version;\n\t}\n\t$ch = curl_init($moduleUrl);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$data->output['moduleUpdates'] = curl_exec($ch);\n\t$data->output['moduleUpdates'] = json_decode($data->output['moduleUpdates'],TRUE);\n\n\t// sitesense version contact\n $info['SiteSense Version'] = $data->version;\n\t$info['Server time']=strftime('%B %d, %Y, %I:%M:%S %p');\n\t$info['Server Signature']=$_SERVER['SERVER_SIGNATURE'];\n\t$info['Server Name']=$_SERVER['SERVER_NAME'];\n\t$info['Server Address']=$_SERVER['SERVER_ADDR'];\n\t$info['Gateway Interface']=$_SERVER['GATEWAY_INTERFACE'];\n\t$info['Server Protocol']=$_SERVER['SERVER_PROTOCOL'];\n\t$info['PHP Version']=phpversion().'</td></tr><tr><td colspan=\"2\">\n\t\t<img src=\"'.$_SERVER['PHP_SELF'].'?='.php_logo_guid().'\" alt=\"PHP Logo\" />';\n\t$info['Zend Version']=zend_version().'</td></tr><tr><td colspan=\"2\">\n\t\t<img src=\"'.$_SERVER['PHP_SELF'].'?='.zend_logo_guid().'\" alt=\"Zend Logo\" />';\n\t$info['Host OS']=PHP_OS;\n\t$data->output['secondSidebar']='\n\t<table class=\"sysInfo\">\n\t\t<caption>System Info</caption>\n\t\t';\n\tforeach ($info as $title => $value) {\n\t\tif (is_array($value)) {\n\t\t\t$data->output['secondSidebar'].='<tr>\n\t\t\t<th colspan=\"2\" class=\"section\">'.$title.'</th>';\n\t\t\tforeach ($value as $subTitle => $subValue) {\n\t\t\t\t$data->output['secondSidebar'].='<tr>\n\t\t\t<th>'.$subTitle.'</th>\n\t\t\t<td>'.$subValue.'</td>\n\t\t</tr>';\n\t\t\t}\n\t\t} else {\n\t\t\t$data->output['secondSidebar'].='<tr>\n\t\t\t<th>'.$title.'</th>\n\t\t\t<td>'.$value.'</td>\n\t\t</tr>';\n\t\t}\n\t}\n\t$data->output['secondSidebar'].='\n\t</table>';\n\t$data->output['pageTitle']='About This CMS -';\n\t//-----Call Home-----//\n\t$field = array(\n\t\t'version' => $data->version,\n\t\t'host' => $data->domainName . $data->linkRoot,\n\t\t'removeAttribution' => $data->settings['removeAttribution'],\n\t\t'serverName' => $info['Server Name'],\n\t\t'serverAddress' => $info['Server Address'],\n\t\t'gatewayInterface' => $info['Gateway Interface'],\n\t\t'serverProtocol' => $info['Server Protocol'],\n\t\t'phpVersion' => phpversion(),\n\t\t'zendVersion' => zend_version()\n\t);\n\t\n\t$ch = curl_init($url);\n\tcurl_setopt($ch,CURLOPT_POST,true);\n\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$field);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n\t$data->output['result'] = curl_exec($ch);\n\t$data->output['result'] = json_decode($data->output['result'],TRUE);\n\n\t/* \n\t *\n\t * 0 = Attribution\n\t * 1 = Version\n\t**/\n\t// Update Attribution Setting In The DB\n\t$statement = $db->prepare('updateSettings','admin_settings');\n\t$statement->execute(array(\n\t\t':name' => 'removeAttribution',\n\t\t':value' => $data->output['result']['removeAttribution']\n\t));\n\t// Push Across All Languages...\n\tcommon_updateAcrossLanguageTables($data,$db,'settings',array('name'=>'removeAttribution'),array('value'=>$data->output['result']['removeAttribution']));\n\t\n}", "public function install() {\n $strReturn = \"\";\n\n $strReturn .= \"Assigning null-properties and elements to the default language.\\n\";\n if($this->strContentLanguage == \"de\") {\n\n $strReturn .= \" Target language: de\\n\";\n\n if(class_exists(\"class_module_pages_page\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_page\") !== false)\n class_module_pages_page::assignNullProperties(\"de\", true);\n if(class_exists(\"class_module_pages_pageelement\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_pageelement\") !== false)\n class_module_pages_pageelement::assignNullElements(\"de\");\n\n $objLang = new class_module_languages_language();\n $objLang->setStrAdminLanguageToWorkOn(\"de\");\n }\n else {\n\n $strReturn .= \" Target language: en\\n\";\n\n if(class_exists(\"class_module_pages_page\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_page\") !== false)\n class_module_pages_page::assignNullProperties(\"en\", true);\n if(class_exists(\"class_module_pages_pageelement\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_pageelement\") !== false)\n class_module_pages_pageelement::assignNullElements(\"en\");\n\n $objLang = new class_module_languages_language();\n $objLang->setStrAdminLanguageToWorkOn(\"en\");\n\n }\n\n\n return $strReturn;\n }", "public function buildHTML() {\n\n\t\t// Load the header\n\t\tinclude 'templates/header.php';\n\n\t\t// Load the content\n\t\t$this->contentHTML();\n\n\t\t// Load the footer\n\t\tinclude 'templates/footer.php';\n\n\t}", "public function build() {\n $pref = new Pref(\"system\");\n $this->setMainTemplate($pref->template);\n\n\n if ($this->data['url']['application'] == \"admin\")\n $tpl = new Template(PATH_SITEADMIN_TEMPLATES);\n else\n $tpl = new Template(PATH_TEMPLATES);\n if (!USER_ID && !$this->isAllowed())\n header(\"location: \" . page(\"user\", \"login\"));\n\n if (!USER_ID && $this->isAllowed())\n $tpl->login = true;\n else\n $tpl->login = false;\n $tpl->loadFile(\"template.php\");\n $tpl->data = $this->data;\n $tpl->build();\n }", "private function makeHTML($path) {\n $output = shell_exec(\"sudo /var/www/sphinx/./myMake.sh \" . $path . \" html\");\n //$output = shell_exec(\"sudo sphinx-build -b html $path/source/ $path/build/html\");\n //dd($output);\n $this->addNewNews(0, 0, 3, \"Erstellt HTML\");\n }", "function buildModuleHelpFile() {\n\tglobal $menu, $__FM_CONFIG;\n\t\n\t$body = <<<HTML\n<h3>{$_SESSION['module']}</h3>\n<ul>\n\t<li>\n\t\t<a class=\"list_title\">Configure Zones</a>\n\t\t<div>\n\t\t\t<p>Zones (aka domains) can be managed from the <a href=\"__menu{Zones}\">Zones</a> menu item. From \n\t\t\tthere you can add, edit {$__FM_CONFIG['icons']['edit']}, delete \n\t\t\t{$__FM_CONFIG['icons']['delete']}, and reload {$__FM_CONFIG['icons']['reload']} zones depending on your user permissions.</p>\n\t\t\t<p>You can define a zone as a clone <i class=\"mini-icon fa fa-clone\"></i> of another previously defined master zone. The cloned zone will contain all of the same records\n\t\t\tpresent in the parent zone. This is useful if you have multiple zones with identical records as you won't have to repeat the record\n\t\t\tdefinitions. You can also skip records and define new ones inside clone zones for those that are slightly different than the parent.</p>\n\t\t\t<p>Zones can also be saved as a template and applied to an unlimited number of zones. This can speed up your zone additions and\n\t\t\tmanagement if you have several zones with a similar framework. You can create a zone template when creating a new zone or you can \n\t\t\tcompletely manage them from <a href=\"__menu{Zone Templates}\">Templates</a>. All zones based on a template will be shown with the\n\t\t\t<i class=\"mini-icon fa fa-picture-o\"></i> icon. Zone templates can only be deleted when there are no zones associated \n\t\t\twith them. In addition, clones of a zone based on a template cannot be shortened to a DNAME RR.</p>\n\t\t\t<p>Zones can support dynamic updates only if the checkbox is ticked while creating or editing individual zones. This will cause \n\t\t\t{$_SESSION['module']} to compare the zone file from the DNS server with that in the database and make any necessary changes. This option\n\t\t\twill increase processing time while reloading zones.</p>\n\t\t\t<p>Zones can support DNSSEC signing only if the checkbox is ticked while creating or editing individual zones. You must create the KSK and ZSK\n\t\t\tbefore zones will be signed (only offline signing is supported). This option will increase processing time while reloading zones.</p>\n\t\t\t<p><i>The 'Zone Management' or 'Super Admin' permission is required to add, edit, and delete zones and templates.</i></p>\n\t\t\t<p><i>The 'Reload Zone' or 'Super Admin' permission is required for reloading zones.</i></p>\n\t\t\t<p>Reverse zones can be entered by either their subnet value (192.168.1) or by their arpa value (1.168.192.in-addr.arpa). You can also\n\t\t\tdelegate reverse zones by specifying the classless IP range in the zone name (1-128.168.192.in-addr.arpa).</p>\n\t\t\t<p>Zones that are missing SOA and NS records will be highlighted with a red background and will not be built or reloaded until the \n\t\t\trecords exists.</p>\n\t\t\t<p>You can also import BIND-compatible zone dump files instead of adding records individually. Go to Admin &rarr; \n\t\t\t<a href=\"__menu{Tools}\">Tools</a> and use the Import Zone Files utility. Select your dump file and click 'Import Zones'\n\t\t\twhich will import any views, zones, and records listed in the file.</p>\n\t\t\t<br />\n\t\t</div>\n\t</li>\n\t<li>\n\t\t<a class=\"list_title\">Manage Zone Records</a>\n\t\t<div>\n\t\t\t<p>Records are managed from the <a href=\"__menu{Zones}\">Zones</a> menu item. From \n\t\t\tthere you can select the zone you want manage records for. Select from the upper-right the type of record(s) you want to \n\t\t\tmanage and then you can add, modify, and delete records depending on your user permissions.</p>\n\t\t\t<p>You can add IPv4 A type and IPv6 AAAA type records under the same page. Select A or AAAA from the upper-right and add your \n\t\t\tIPv4 and IPv6 records and {$_SESSION['module']} will auto-detect their type.</p>\n\t\t\t<p>When adding certain records (such as CNAME, MX, SRV, SOA, NS, etc.), you have the option append the domain to the record. This \n\t\t\tmeans {$_SESSION['module']} will automatically add the domain to the record so you don't have to give the fully qualified domain name \n\t\t\tin the record value. {$_SESSION['module']} will attemnpt to auto-detect whether or not the domain should be appended if no choice is\n\t\t\tmade at the time of record creation.</p>\n\t\t\t<p><i>The 'Record Management' or 'Super Admin' permission is required to add, edit, and delete records.</i></p>\n\t\t\t<p>When adding or updating a SOA record for a zone, the domain can be appended to the Master Server and Email Address if selected. This\n\t\t\tmeans you could simply enter 'ns1' and 'username' for the Master Server and Email Address respectively. If you prefer to enter the entire\n\t\t\tentry, make sure you select 'no' for Append Domain.</p>\n\t\t\t<p>SOA records can also be saved as a template and applied to an unlimited number of zones. This can speed up your zone additions and\n\t\t\tmanagement. You can create a SOA template when managing zone records or you can completely manage them from \n\t\t\t<a href=\"__menu{SOA Templates}\">Templates</a>. SOA templates can only be deleted when there are no zones associated with them.</p>\n\t\t\t<p><i>The 'Zone Management' or 'Super Admin' permission is required to add, edit, and delete SOA templates.</i></p>\n\t\t\t<p>Adding A and AAAA records provides the option of automatically creating the associated PTR record. However, the reverse zone must first\n\t\t\texist in order for PTR records to automatically be created. You can enable the automatic reverse zone creation in the \n\t\t\t<a href=\"__menu{{$_SESSION['module']} Settings}\">Settings</a>. In this case, the reverse zone will inherit the same SOA as the \n\t\t\tforward zone.</p>\n\t\t\t<p>When viewing the records of a cloned zone, the parent records will not be editable, but you can choose to skip them or add new records\n\t\t\tthat impacts the cloned zone only.</p>\n\t\t\t<p>You can also import BIND-compatible zone files instead of adding records individually. Go to Admin &rarr; \n\t\t\t<a href=\"__menu{Tools}\">Tools</a> and use the Import Zone Files utility. After selecting the file and zone \n\t\t\tto import to, you have one final chance to review what gets imported before the records are actually imported.</p>\n\t\t\t<br />\n\t\t</div>\n\t</li>\n\t<li>\n\t\t<a class=\"list_title\">Configure Servers</a>\n\t\t<div>\n\t\t\t<p>All aspects of server configuration takes place in the Config menu \n\t\t\titem. From there you can add, edit {$__FM_CONFIG['icons']['edit']}, \n\t\t\tdelete {$__FM_CONFIG['icons']['delete']} servers and options depending on your user permissions.</p>\n\t\t\t\n\t\t\t<p><b>Servers</b><br />\n\t\t\tDNS servers can be defined at Config &rarr; <a href=\"__menu{Servers}\">Servers</a>. In the add/edit server \n\t\t\twindow, select and define the server hostname, key (if applicable), system account the daemon runs as, update method, configuration file, \n\t\t\tserver root, chroot directory (if applicable), and directory to keep the zone files in.</p>\n\t\t\t<p>The server can be updated via the following methods:</p>\n\t\t\t<ul>\n\t\t\t\t<li><i>http(s) -</i> $fm_name will initiate a http(s) connection to the DNS server which updates the configs.</li>\n\t\t\t\t<li><i>cron -</i> The DNS servers will initiate a http connection to $fm_name to update the configs.</li>\n\t\t\t\t<li><i>ssh -</i> $fm_name will SSH to the DNS server which updates the configs.</li>\n\t\t\t</ul>\n\t\t\t<p>In order for the server to be enabled, the client app needs to be installed on the DNS server.</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to add, edit, and delete servers.</i></p>\n\t\t\t<p>Once a server is added or modified, the configuration files for the server will need to be built before zone reloads will be available. \n\t\t\tBefore building the configuration {$__FM_CONFIG['icons']['build']} you can preview {$__FM_CONFIG['icons']['preview']} the configs to \n\t\t\tensure they are how you desire them. Both the preview and the build will check the configuration files with named-checkconf and named-checkzone\n\t\t\tif enabled in the <a href=\"__menu{{$_SESSION['module']} Settings}\">Settings</a>.</p>\n\t\t\t<p><i>The 'Build Server Configs' or 'Super Admin' permission is required to build the DNS server configurations.</i></p>\n\t\t\t<br />\n\t\t\t\n\t\t\t<p><b>Views</b><br />\n\t\t\tIf you want to use views, they need to be defined at Config &rarr; <a href=\"__menu{Views}\">Views</a>. View names \n\t\t\tcan be defined globally for all DNS servers or on a per-server basis. This is controlled by the servers drop-down menu in the upper right.</p>\n\t\t\t<p>Once you define a view, you can select it in the list to manage the options for that view - either globally or server-based. See the section \n\t\t\ton 'Options' for further details.</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to manage views.</i></p>\n\t\t\t<br />\n\t\t\t\n\t\t\t<p><b>ACLs</b><br />\n\t\t\tAccess Control Lists are defined at Config &rarr; <a href=\"__menu{ACLs}\">ACLs</a> and can be defined globally \n\t\t\tfor all DNS servers or on a per-server basis. This is controlled by the servers drop-down menu in the upper right.</p>\n\t\t\t<p>When defining an ACL, specify the name and the address list. You can use the pre-defined addresses or specify your own delimited by a space,\n\t\t\tsemi-colon, or newline.</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to manage ACLs.</i></p>\n\t\t\t<br />\n\t\t\t\n\t\t\t<p><b>Keys</b><br />\n\t\t\tCurrently, {$_SESSION['module']} does not generate server keys (TSIG), but once you create them on your server, you can define them in the UI \n\t\t\tat Config &rarr; <a href=\"__menu{Keys}\">Keys</a>. DNSSEC keys, however, can be automatically generated and managed by {$_SESSION['module']}.\n\t\t\tDNSSEC keys can only be deleted when they are not used for signing and/or have been revoked.</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to manage keys.</i></p>\n\t\t\t<br />\n\t\t\t\n\t\t\t<p><b>Masters</b><br />\n\t\t\tMasters can be defined globally or server-based which is controlled by the servers drop-down menu in the upper right. To define the masters, \n\t\t\tgo to Config &rarr; <a href=\"__menu{Masters}\">Masters</a>.</p>\n\t\t\t<p>Masters can then be used when defining zones and defining the <i>masters</i> and <i>also-notify</i> options.</p>\n\t\t\t<p>Server-level masters always supercede global ones.</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to manage the masters.</i></p>\n\t\t\t<br />\n\t\t\t\n\t\t\t<p><b>Options</b><br />\n\t\t\tOptions can be defined globally or server-based which is controlled by the servers drop-down menu in the upper right. Currently, the options \n\t\t\tconfiguration is rudimentary and can be defined at Config &rarr; <a href=\"__menu{Options}\">Options</a>.</p>\n\t\t\t<p>Server-level options always supercede global options (including global view options).</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to manage server options.</i></p>\n\t\t\t<br />\n\t\t\t\n\t\t\t<p><b>Logging</b><br />\n\t\t\tLogging channels and categories can be defined globally or server-based which is controlled by the servers drop-down menu in the upper right. \n\t\t\tTo manage the logging configuration, go to Config &rarr; <a href=\"__menu{Logging}\">Logging</a>.</p>\n\t\t\t<p>Server-level channels and categories always supercede global ones.</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to manage server logging.</i></p>\n\t\t\t<br />\n\t\t\t\n\t\t\t<p><b>Controls</b><br />\n\t\t\tControls can be defined globally or server-based which is controlled by the servers drop-down menu in the upper right. \n\t\t\tTo manage the controls configuration, go to Config &rarr; <a href=\"__menu{Operations}\">Operations</a>.</p>\n\t\t\t<p>Server-level controls always supercede global ones.</p>\n\t\t\t<p><i>The 'Server Management' or 'Super Admin' permission is required to manage server controls.</i></p>\n\t\t\t<br />\n\t\t</div>\n\t</li>\n\t<li>\n\t\t<a class=\"list_title\">Module Settings</a>\n\t\t<div>\n\t\t\t<p>Settings for {$_SESSION['module']} can be updated from the <a href=\"__menu{{$_SESSION['module']} Settings}\">Settings</a> menu item.</p>\n\t\t\t<br />\n\t\t</div>\n\t</li>\n\t\nHTML;\n\treturn $body;\n}", "function displaySetup(& $tpl)\n {\n\n $return_string = '';\n\n\n $this->admin_auth_handler_->perm_->addLanguage('en', 'english', 'English language');\n $this->admin_auth_handler_->perm_->setCurrentLanguage('en');\n $app_id = $this->admin_auth_handler_->perm_->addApplication('HEM', 'Heuristic Evaluation Manager');\n if(PEAR::isError($app_id))\n {\n\t$return_string.= \"<pre>Adding App:\";\n\t$return_string.= var_export($app_id);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Application $app_id<br/>\";\n \n $area_id = $this->admin_auth_handler_->perm_->addArea($app_id, 'AREA', 'The Only Area');\n \n if(PEAR::isError($area_id))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($area_id);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Area $area_id<br/>\"; \n \n\n $group_id_1 = $this->admin_auth_handler_->perm_->addGroup('evaluator', 'The Evaluators', TRUE, 'EVALUATOR');\n if(PEAR::isError($group_id_1))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_1);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_1<br/>\"; \n\n $group_id_2 = $this->admin_auth_handler_->perm_->addGroup('manager', 'The Managers', TRUE, 'MANAGER');\n if(PEAR::isError($group_id_2))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_2);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_2<br/>\"; \n\n $group_id_3 = $this->admin_auth_handler_->perm_->addGroup('admin', 'The Administrators', TRUE, 'ADMIN');\n if(PEAR::isError($group_id_3))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_3);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_3<br/>\"; \n\n\n\n $tpl->setCurrentBlock('main_block');\n \n $tpl->setVar('CONTENT', $return_string);\n \n $tpl->parseCurrentBlock();\n\n return 1;\n\n }", "function show_tools()\n{\n\tglobal $ns,$tp;\n\t\n\tif(is_readable(e_ADMIN.\"ver.php\"))\n\t{\n\t\tinclude(e_ADMIN.\"ver.php\");\n\t\tlist($ver, $tmp) = explode(\" \", $e107info['e107_version']);\n\t}\n\t\t\n\t$lans = getLanList();\n\t\n\t$release_diz = defined(\"LANG_LAN_30\") ? LANG_LAN_30 : \"Release Date\";\n\t$compat_diz = defined(\"LANG_LAN_31\") ? LANG_LAN_31 : \"Compatibility\";\n\t$lan_pleasewait = (defsettrue('LAN_PLEASEWAIT')) ? $tp->toJS(LAN_PLEASEWAIT) : \"Please Wait\";\n\t$lan_displayerrors = (defsettrue('LANG_LAN_33')) ? LANG_LAN_33 : \"Display only errors during verification\";\n\t\n\t\n\t$text = \"<form id='lancheck' method='post' action='\".e_SELF.\"?tools'>\n\t\t\t<table class='fborder' style='\".ADMIN_WIDTH.\"'>\";\n\t$text .= \"\n\t\t<tr>\n\t\t<td class='fcaption'>\".ADLAN_132.\"</td>\n\t\t<td class='fcaption'>\".$release_diz.\"</td>\t\t\n\t\t<td class='fcaption'>\".$compat_diz.\"</td>\n\t\t<td class='fcaption' style='text-align:center'>\".ADLAN_134.\"</td>\n\t\t<td class='fcaption' style='text-align:center;width:25%;white-space:nowrap'>\".LAN_OPTIONS.\"</td>\n\t\t</tr>\n\t\t\";\n\t\n\trequire_once(e_HANDLER.\"xml_class.php\");\n\t$xm = new XMLParse();\n\t\n\tforeach($lans as $language)\n\t{\n\t\tif($language == \"English\")\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$metaFile = e_LANGUAGEDIR.$language.\"/\".$language.\".xml\";\n\t\t\n\t\tif(is_readable($metaFile))\n\t\t{\n\t\t\t$rawData = file_get_contents($metaFile);\n\t\t\tif($rawData)\n\t\t\t{\n\t\t\t\t$array = $xm->parse($rawData);\n\t\t\t\t$value = $array['e107Language']['attributes'];\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = array(\n\t\t\t\t'date' \t\t\t=> \"&nbsp;\",\n\t\t\t\t'compatibility' => '&nbsp;'\n\t\t\t);\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$value = array(\n\t\t\t\t'date' \t\t\t=> \"&nbsp;\",\n\t\t\t\t'compatibility' => '&nbsp;'\n\t\t\t);\t\n\t\t}\n\t\t\n\t\t$errFound = (isset($_SESSION['lancheck'][$language]['total']) && $_SESSION['lancheck'][$language]['total'] > 0) ? TRUE : FALSE;\n\t\t\n\t\t\t\t\t\t\n\t\t$text .= \"<tr>\n\t\t\t<td class='forumheader3' >\".$language.\"</td>\n\t\t\t<td class='forumheader3' >\".$value['date'].\"</td>\n\t\t\t<td class='forumheader3' >\".$value['compatibility'].\"</td>\n\t\t\t<td class='forumheader3' style='text-align:center' >\".($ver != $value['compatibility'] || $errFound ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON ).\"</td>\n\t\t\t<td class='forumheader3' style='text-align:center'><input type='submit' name='language_sel[{$language}]' value=\\\"\".LAN_CHECK_2.\"\\\" class='button' />\n\t\t\t<input type='submit' name='ziplang[{$language}]' value=\\\"\".LANG_LAN_23.\"\\\" class='button' onclick=\\\"this.value = '\".$lan_pleasewait.\"'\\\" /></td>\t\n\t\t\t</tr>\";\n\t\t}\n\t\t\n\t\t$srch = array(\"[\",\"]\");\n\t\t$repl = array(\"<a rel='external' href='http://e107.org/content/About-Us:The-Team#translation-team'>\",\"</a>\");\n\t\t$diz = (defsettrue(\"LANG_LAN_28\")) ? LANG_LAN_28 : \"Check this box if you're an [e107 certified translator].\";\n\t\n\t\t$checked = varset($_COOKIE['e107_certified']) == 1 ? \"checked='checked'\" : \"\";\n\t\t$text .= \"<tr><td class='forumheader' colspan='4' style='text-align:center'>\n\t\t <input type='checkbox' name='contribute_pack' value='1' {$checked} />\".str_replace($srch,$repl,$diz);\n\t\t\n\t\t$echecked = varset($_SESSION['lancheck-errors-only']) == 1 ? \"checked='checked'\" : \"\";\t\t\n\t\t$text .= \"</td>\n\t\t<td class='forumheader' style='text-align:center'>\n\t\t<input type='checkbox' name='errorsonly' value='1' {$echecked} /> \".$lan_displayerrors.\" </td>\n\t\t\n\t\t</tr></table>\";\n\t\t\n\t\t\n\t\t$text .= \"</form>\";\n\t\n\t$text .= \"<div class='smalltext' style='padding-top:50px;text-align:center'>\".LANG_LAN_AGR.\"</div>\";\t\n\t$ns->tablerender(LANG_LAN_32, $text);\t\t\n\treturn;\n\t\t\n}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "public function build(Array $context = array()){\n\t\t\t$this->_context = $context;\n\n\t\t\tif(!$this->canAccessPage()){\n\t\t\t\tAdministration::instance()->customError(__('Access Denied'), __('You are not authorised to access this page.'));\n\t\t\t}\n\n\t\t\t$this->Html->setDTD('<!DOCTYPE html>');\n\t\t\t$this->Html->setAttribute('lang', Lang::get());\n\t\t\t$this->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0);\n\t\t\t$this->addStylesheetToHead(SYMPHONY_URL . '/assets/basic.css', 'screen', 40);\n\t\t\t$this->addStylesheetToHead(SYMPHONY_URL . '/assets/admin.css', 'screen', 41);\n\t\t\t$this->addStylesheetToHead(SYMPHONY_URL . '/assets/symphony.duplicator.css', 'screen', 70);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/jquery.js', 50);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/jquery.color.js', 51);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/symphony.collapsible.js', 60);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/symphony.orderable.js', 61);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/symphony.selectable.js', 62);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/symphony.duplicator.js', 63);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/symphony.tags.js', 64);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/symphony.pickable.js', 65);\n\t\t\t$this->addScriptToHead(SYMPHONY_URL . '/assets/admin.js', 71);\n\n\t\t\t$this->addElementToHead(\n\t\t\t\tnew XMLElement(\n\t\t\t\t\t'script',\n\t\t\t\t\t\"Symphony.Context.add('env', \" . json_encode($this->_context) . \"); Symphony.Context.add('root', '\" . URL . \"');\",\n\t\t\t\t\tarray('type' => 'text/javascript')\n\t\t\t\t), 72\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Allows developers to insert items into the page HEAD. Use `$context['parent']->Page`\n\t\t\t * for access to the page object\n\t\t\t *\n\t\t\t * @delegate InitaliseAdminPageHead\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('InitaliseAdminPageHead', '/backend/');\n\n\t\t\t$this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8');\n\n\t\t\tif(isset($_REQUEST['action'])){\n\t\t\t\t$this->action();\n\t\t\t\tAdministration::instance()->Profiler->sample('Page action run', PROFILE_LAP);\n\t\t\t}\n\n\t\t\t$this->Wrapper = new XMLElement('div', NULL, array('id' => 'wrapper'));\n\t\t\t$this->Header = new XMLElement('div', NULL, array('id' => 'header'));\n\n\t\t\t$h1 = new XMLElement('h1');\n\t\t\t$h1->appendChild(Widget::Anchor(Symphony::Configuration()->get('sitename', 'general'), rtrim(URL, '/') . '/'));\n\t\t\t$this->Header->appendChild($h1);\n\n\t\t\t$this->appendNavigation();\n\n\t\t\t$this->Contents = new XMLElement('div', NULL, array('id' => 'contents'));\n\n\t\t\t## Build the form\n\t\t\t$this->Form = Widget::Form(Administration::instance()->getCurrentPageURL(), 'post');\n\n\t\t\t$this->view();\n\t\t\t$this->Contents->appendChild($this->Form);\n\n\t\t\t$this->Footer = new XMLElement('div', NULL, array('id' => 'footer'));\n\n\t\t\t/**\n\t\t\t * Allows developers to add items just above the page footer. Use `$context['parent']->Page`\n\t\t\t * for access to the page object\n\t\t\t *\n\t\t\t * @delegate AppendElementBelowView\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('AppendElementBelowView', '/backend/');\n\n\t\t\t$this->appendFooter();\n\t\t\t$this->appendAlert();\n\n\t\t\tAdministration::instance()->Profiler->sample('Page content created', PROFILE_LAP);\n\t\t}", "function templ_extend(){\r\n\t\t$modules_array = array();\r\n\t\t$modules_array = array('templatic-custom_taxonomy','templatic-custom_fields','templatic-registration','templatic-monetization','templatic-claim_ownership');\r\n\t\trequire_once(TEMPL_MONETIZE_FOLDER_PATH.'templ_header_section.php' );\r\n\t\t?>\r\n <p class=\"tevolution_desc\"><?php echo __('Here are the most popular directory extensions to extend the functionality of your Business Directory site and make it more powerful. Please click the \"Details & Purchase\" button next to any of them to find out more about the functions they each offer.','templatic-admin');?></p>\r\n <?php\r\n\t\techo '\r\n\t\t<div id=\"tevolution_bundled\" class=\"metabox-holder wrapper widgets-holder-wrap\"><table cellspacing=\"0\" class=\"wp-list-tev-table postbox fixed pages \">\r\n\t\t\t<tbody style=\"background:white; padding:40px;\">\r\n\t\t\t<tr><td>\r\n\t\t\t';\r\n\t\t/* This is the correct way to loop over the directory. */\t\t\t\r\n\t\tdo_action('tevolution_extend_box');\r\n\t\t/* to get t plugins */\t\t\t\r\n\t\techo '</td></tr>\r\n\t\t</tbody></table>\r\n\t\t</div>\r\n\t\t';\r\n\t\r\n\t\trequire_once(TEMPL_MONETIZE_FOLDER_PATH.'templ_footer_section.php' );\r\n\t}", "function execute() {\n\t\tglobal $wgUser;\n\t\t$skin = $wgUser->getSkin();\n\n\t\t// Suppress warnings to prevent notices about missing indexes in $this->data\n\t\twfSuppressWarnings();\n\n?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"<?php $this->text('lang') ?>\" lang=\"<?php $this->text('lang') ?>\" dir=\"<?php $this->text('dir') ?>\">\n\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>\" />\n\t\t<?php $this->html('headlinks') ?>\n\t\t<title><?php $this->text('pagetitle') ?></title>\n <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection\" href=\"<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" <?php if(empty($this->data['printable']) ) { ?>media=\"print\"<?php } ?> href=\"<?php $this->text('stylepath') ?>/common/commonPrint.css\" />\n <style type=\"text/css\">@media print { #head, #left, #right, #foot, .editsection { display: none; }}</style>\n\t\t<?php print Skin::makeGlobalVariablesScript( $this->data ); ?>\n\t\t<script type=\"<?php $this->text('jsmimetype') ?>\" src=\"<?php $this->text('stylepath') ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>\"></script>\n <?php if($this->data['jsvarurl']) { ?><script type=\"<?php $this->text('jsmimetype') ?>\" src=\"<?php $this->text('jsvarurl') ?>\"></script><?php\t} ?>\n <?php\tif($this->data['pagecss']) { ?><style type=\"text/css\"><?php $this->html('pagecss') ?></style><?php } ?>\n\t\t<?php if($this->data['usercss']) { ?><style type=\"text/css\"><?php $this->html('usercss') ?></style><?php } ?>\n <?php if($this->data['userjs']) { ?><script type=\"<?php $this->text('jsmimetype') ?>\" src=\"<?php $this->text('userjs') ?>\"></script><?php\t} ?>\n <?php if($this->data['userjsprev']) { ?><script type=\"<?php $this->text('jsmimetype') ?>\"><?php $this->html('userjsprev') ?></script><?php } ?>\n\t\t<?php if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?><?php $this->html('headscripts') ?>\n </head>\n\t<body\n\t\t<?php if($this->data['body_ondblclick']) { ?>ondblclick=\"<?php $this->text('body_ondblclick') ?>\"<?php } ?>\n\t\t<?php if($this->data['body_onload']) { ?>onload=\"<?php $this->text('body_onload') ?>\"<?php } ?>\n\t\tclass=\"<?php $this->text('nsclass') ?>\"\n\t>\n <a name=\"top\" id=\"top\"></a>\n <div id=\"content\">\n <div id=\"head\">\n <?php if ($this->data['loggedin']) { ?>\n\t <h5><?php $this->msg('views') ?></h5>\n\t <ul>\n\t <?php foreach($this->data['content_actions'] as $key => $action) {\n\t ?><li id=\"ca-<?php echo htmlspecialchars($key) ?>\"\n\t <?php if($action['class']) { ?>class=\"<?php echo htmlspecialchars($action['class']) ?>\"<?php } ?>\n\t ><a href=\"<?php echo htmlspecialchars($action['href']) ?>\"><?php\n\t echo htmlspecialchars($action['text']) ?></a></li><?php\n\t } ?>\n\t </ul>\n <?php } ?>\n </div>\n <div id=\"left\" class=\"sidebar\">\n\t\t\t<?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>\n\t\t\t\t<h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5>\n\t\t\t\t<ul>\n <?php foreach($cont as $key => $val) { ?>\n <li id=\"<?php echo Sanitizer::escapeId($val['id']) ?>\"><a href=\"<?php echo htmlspecialchars($val['href']) ?>\"<?php echo $skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>\n <?php } ?>\n\t\t\t\t</ul>\n\t\t\t<?php } ?>\n\t\t\t<?php if($this->data['loggedin']) { ?>\n\t <h5><?php $this->msg('toolbox') ?></h5>\n\t\t\t <ul>\n\t <?php if($this->data['notspecialpage']) { ?>\n\t \t<li><a href=\"<?php echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href']) ?>\" <?php echo $skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li>\n\t <?php if( $this->data['nav_urls']['recentchangeslinked'] ) { ?><li><a href=\"<?php\techo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href']) ?>\"<?php echo $skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked') ?></a></li><?php } ?>\n\t <?php\t} ?>\n\t <?php\tif(isset($this->data['nav_urls']['trackbacklink'])) { ?><li><a href=\"<?php echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])\t?>\"<?php echo $skin->tooltipAndAccesskey('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li><?php } ?>\n\t <?php\tif($this->data['feeds']) { ?><li><?php foreach($this->data['feeds'] as $key => $feed) {\t?><a href=\"<?php echo htmlspecialchars($feed['href']) ?>\"<?php echo $skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a><?php } ?></li><?php } ?>\n\t <?php\tforeach( array('contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) { ?>\n\t \t <?php\tif($this->data['nav_urls'][$special]) {\t?><li><a href=\"<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href']) ?>\"<?php echo $skin->tooltipAndAccesskey('t-'.$special) ?>><?php $this->msg($special) ?></a></li><?php } ?>\n\t \t <?php\t} ?>\n\t \t <?php\tif(!empty($this->data['nav_urls']['permalink']['href'])) { ?><li><a href=\"<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])\t?>\"<?php echo $skin->tooltipAndAccesskey('t-permalink') ?>><?php $this->msg('permalink') ?></a></li><?php\t} elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?><li><?php $this->msg('permalink') ?></li><?php\t} ?>\n\t \t <?php\twfRunHooks( 'NordlichtTemplateToolboxEnd', array( &$this ) ); ?>\n\t\t\t </ul>\n\t\t <?php } ?>\n </div>\n <div id=\"main\">\n \t\t<?php if($this->data['sitenotice']) { ?><?php $this->html('sitenotice') ?><?php } ?>\n\t\t <h1 class=\"firstHeading\"><?php $this->data['displaytitle']!=\"\"?$this->html('title'):$this->text('title') ?></h1>\n\t\t\t<h3 id=\"siteSub\"><?php $this->msg('tagline') ?></h3>\n\t\t\t<div id=\"contentSub\"><?php $this->html('subtitle') ?></div>\n\t\t\t<?php if($this->data['undelete']) { ?><div id=\"contentSub2\"><?php $this->html('undelete') ?></div><?php } ?>\n\t\t\t<?php if($this->data['newtalk'] ) { ?><div class=\"usermessage\"><?php $this->html('newtalk') ?></div><?php } ?>\n\t\t\t<!-- start content -->\n\t\t\t<?php $this->html('bodytext') ?>\n\t\t\t<?php if($this->data['catlinks']) { ?><?php $this->html('catlinks') ?><?php } ?>\n </div>\n <div id=\"right\" class=\"sidebar\">\n \t <h5><label for=\"searchInput\"><?php $this->msg('search') ?></label></h5>\n\t\t <form action=\"<?php $this->text('searchaction') ?>\" id=\"searchform\">\n\t\t \t<input id=\"searchInput\" name=\"search\" type=\"text\"<?php echo $skin->tooltipAndAccesskey('search');\tif( isset( $this->data['search'] ) ) { ?> value=\"<?php $this->text('search') ?>\"<?php } ?> />\n\t\t\t\t<input type='submit' name=\"go\" class=\"searchButton\" id=\"searchGoButton\"\tvalue=\"<?php $this->msg('searcharticle') ?>\" />&nbsp;\n\t\t\t\t<input type='submit' name=\"fulltext\" class=\"searchButton\" id=\"mw-searchButton\" value=\"<?php $this->msg('searchbutton') ?>\" />\n\t\t\t</form>\n \t\t<h5><?php $this->msg('personaltools') ?></h5>\n\t\t\t<ul>\n <?php\tforeach($this->data['personal_urls'] as $key => $item) { ?>\n\t\t\t\t<li><a href=\"<?php echo htmlspecialchars($item['href']) ?>\"<?php echo $skin->tooltipAndAccesskey('pt-'.$key) ?>><?php\techo htmlspecialchars($item['text']) ?></a></li><?php } ?>\n\t\t </ul>\n </div>\n <div id=\"foot\">\n\t\t\t<ul>\n\t\t\t <?php\t$footerlinks = array('lastmod', 'viewcount'); ?>\n\t\t\t <?php\tforeach( $footerlinks as $aLink ) {?>\n\t\t\t \t<?php\tif( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { ?><li><?php $this->html($aLink) ?></li><?php } ?>\n\t\t\t <?php } ?>\n\t\t\t</ul>\n </div>\n </div>\n\t<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>\n <?php $this->html('reporttime') ?>\n <?php if ( $this->data['debug'] ): ?>\n <!-- Debug output:\n <?php $this->text( 'debug' ); ?>\n -->\n <?php endif; ?>\n </body>\n</html>\n<?php\n\twfRestoreWarnings();\n\t}", "function my_theme_create_options() {\r\n $titan = TitanFramework::getInstance( 'genietheme' );\r\n \r\n // Create my admin panel\r\n $panel = $titan->createAdminPanel( array(\r\n 'name' => 'Theme Options',\r\n ) );\r\n \r\n \r\n $generaltab = $panel->createTab( array(\r\n 'name' => 'General Tab',\r\n ) );\r\n \r\n // Create options for my admin panel\r\n $generaltab->createOption( array(\r\n 'name' => 'LOGO',\r\n 'id' => 'head_logo',\r\n 'type' => 'upload',\r\n 'desc' => 'Upoad logo of site.'\r\n ) );\r\n \r\n $generaltab->createOption( array(\r\n 'name' => 'Header Scripts',\r\n 'id' => 'header_scripts',\r\n 'type' => 'textarea',\r\n 'desc' => 'Enter your header scripts or code like google analytics,webmaster code etc...'\r\n ) );\r\n \r\n \r\n $generaltab->createOption( array(\r\n 'name' => 'Footer Scripts',\r\n 'id' => 'footer_scripts',\r\n 'type' => 'textarea',\r\n 'desc' => 'Enter your footer scripts or code like google analytics,webmaster code etc...'\r\n ) );\r\n \r\n \r\n $generaltab->createOption( array(\r\n 'type' => 'save'\r\n ) );\r\n \r\n \r\n $titan = TitanFramework::getInstance( 'genietheme' );\r\n$productMetaBox = $titan->createMetaBox( array(\r\n 'name' => 'Additinal Job Information',\r\n 'post_type' => 'jobs',\r\n) );\r\n\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Job Link',\r\n 'id' => 'j_link',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Experience Required',\r\n 'id' => 'exp_required',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Education Qualification',\r\n 'id' => 'edu_qual',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Preffered Nationality',\r\n 'id' => 'nationality',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Salary',\r\n 'id' => 'salary',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'No. of vaccancies',\r\n 'id' => 'vaccancies',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Benefits',\r\n 'id' => 'benefits',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Gender',\r\n 'id' => 'gender',\r\n 'options' => array(\r\n '1' => 'Male',\r\n '2' => 'Female',\r\n '3' => 'Male/Female',\r\n ),\r\n 'type' => 'radio',\r\n 'desc' => 'Select gender',\r\n 'default' => '1',\r\n \r\n ) );\r\n\r\n \r\n}", "public function main()\n {\n // Produce browse-tree:\n $tree = $this->pagetree->getBrowsableTree();\n // Outputting page tree:\n $this->content .= $tree;\n\n $docHeaderButtons = $this->getButtons();\n\n $markers = array(\n 'IMG_RESET' => '',\n 'WORKSPACEINFO' => '',\n 'CONTENT' => $this->content,\n );\n\n // Build the <body> for the module\n $this->content = $this->doc->startPage(\n $this->getLanguageService()->sl(\n 'LLL:EXT:commerce/Resources/Private/Language/locallang_be.xml:mod_orders.navigation_title'\n )\n );\n\n $subparts = array();\n // Build the <body> for the module\n $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markers, $subparts);\n $this->content .= $this->doc->endPage();\n $this->content = $this->doc->insertStylesAndJS($this->content);\n }", "function install_templates()\n\t{\n\t\t//-----------------------------------------\n\t\t// Get DB\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( INS_KERNEL_PATH . 'class_db_' . $this->install->saved_data['sql_driver'] . '.php' );\t\t\n\t\t\n\t\t$this->install->ipsclass->init_db_connection( $this->install->saved_data['db_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_user'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pass'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_host'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pre'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->ipsclass->vars['mysql_codepage'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['sql_driver'] );\n\t\t//-----------------------------------------\n\t\t// Install settings\n\t\t//-----------------------------------------\n\t\n\t\t$output[] = \"Добавление шаблонов стилей...\";\n\t\t$xml = new class_xml();\n\t\t$xml->lite_parser = 1;\n\t\t\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/ipb_templates.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Install\n\t\t//-----------------------------------------\n\t\t\n\t\tforeach( $xml->xml_array['templateexport']['templategroup']['template'] as $id => $entry )\n\t\t{\n\t\t\t$newrow = array();\n\n\t\t\t$newrow['group_name'] = $entry[ 'group_name' ]['VALUE'];\n\t\t\t$newrow['section_content'] = $entry[ 'section_content' ]['VALUE'];\n\t\t\t$newrow['func_name'] = $entry[ 'func_name' ]['VALUE'];\n\t\t\t$newrow['func_data'] = $entry[ 'func_data' ]['VALUE'];\n\t\t\t$newrow['set_id'] = 1;\n\t\t\t$newrow['updated'] = time();\n\n\t\t\t$this->install->ipsclass->DB->allow_sub_select = 1;\n\t\t\t$this->install->ipsclass->DB->do_insert( 'skin_templates', $newrow );\n\t\t}\n\n\t\t//-------------------------------\n\t\t// GET MACROS\n\t\t//-------------------------------\n\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/macro.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\n\t\t//-------------------------------\n\t\t// (MACRO)\n\t\t//-------------------------------\n\n\t\tforeach( $xml->xml_array['macroexport']['macrogroup']['macro'] as $id => $entry )\n\t\t{\n\t\t\t$newrow = array();\n\n\t\t\t$newrow['macro_value'] = $entry[ 'macro_value' ]['VALUE'];\n\t\t\t$newrow['macro_replace'] = $entry[ 'macro_replace' ]['VALUE'];\n\t\t\t$newrow['macro_set'] = 1;\n\n\t\t\t$this->install->ipsclass->DB->do_insert( 'skin_macro', $newrow );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->install->template->append( $this->install->template->install_page_refresh( $output ) );\t\n\t\t$this->install->template->next_action = '?p=install&sub=other';\n\t\t$this->install->template->hide_next = 1;\n\t}", "function INSTALL($e) { $s=$im='';\n\n\nif($GLOBALS['admin']) {\n\n$GLOBALS['article']['template']='blank';\n\n\nSTYLES(\"mod\",\"\n.iDIR,.iYES,.iNON,.iDEL,.iUPD,.iADD { cursor:pointer; clear:left;float:left; }\n.iNON {color: #aaa}\n.iDEL {color: red}\n.iYES,.iUPD {color: green}\n.iADD {color: rgb(0,255,0)}\n.iNON,.iSS {text-decoration:line-through}\n.iNON:before,.iNON:after,.iSS:before,.iSS:after {content:' '}\n.iYES,.iOK {text-decoration:none}\n\n.iDIR {font-weight: bold; float:left; valign:top; }\n.iT {float:left;margin-top:20pt;}\n\n.p1 { color: #3F3F3F; text-decoration: line-through; background: #DFDFDF; } /* вычеркнутый */\n.p2 { background: #FFD0C0; } /* вставленный */\n\n\");\n\n $upgrade=gglob($GLOBALS['host_module'].\"install/*.php\");\n foreach($upgrade as $l) { $xi=explode('/',$l); $m=array_pop($xi);\n\t\t$im.=\"'$m',\";\n\t\t$s.=\"<div class='mod' id='module__$m'>\".$m.\"</div>\";\n\t}\n\nSCRIPTS(\"mod\",\"\nvar install_modules_n=0;\nfunction check_mod_do() { if(typeof install_modules[install_modules_n] == 'undefined') { install_modules_n=0; return; }\n\tvar m=install_modules[install_modules_n++];\n\tzabil('module__'+m,'<img src='+www_design+'img/ajax.gif>'+vzyal('module__'+m));\n\tmajax('module.php',{mod:'INSTALL',a:'testmod',module:m});\n}\nvar install_modules=[\".trim($im,',').\"];\n\nvar timestart;\nfunction dodo(module,allwork,time,skip,aram) {\n\tif(skip) {\n\t\tvar timenow = new Date();\n\t\tvar t=timenow.getTime()-timestart.getTime();\n\t\tvar e=parseInt((t/skip)*allwork)-t;\n\t\tzabilc('timet',' &nbsp; &nbsp; &nbsp; осталось: '+pr_time(e)+' сек');\n\t} else { timestart = new Date(); }\n\tvar ara={mod:'INSTALL',a:'do',module:module,allwork:allwork,time:time,skip:skip};\n\tif(typeof(aram)=='object') for(var i in aram) ara[i]=aram[i];\n\tmajax('module.php',ara);\n}\n\nfunction pr_time(t) { var N=new Date(); N.setTime(t); var s=pr00(N.getUTCSeconds());\n\tif(N.getUTCMinutes()) s=pr00(N.getUTCMinutes())+':'+s;\n\tif(N.getUTCHours()) s=pr00(N.getUTCHours())+':'+s;\n\treturn s;\n} function pr00(n){return ((''+n).length<2?'0'+n:n)}\n\n\npage_onstart.push('check_mod_do()');\n\n\");\n\n}\n\nreturn \"<table width=100% style='border: 1px dotted red'>\n<tr valign=top>\n\t<td>\n\t\t\n\t\t<div id='mesto_module'>$s</div>\n\t</td>\n\t<td width='100%'><div id='mesto_otvet'>\".admin_login().\"</div></td>\n</tr></table>\";\n\n}", "function prepare_html(){\n generate_html_head();\n Tests::run_tests($GLOBALS['directory_path']);\n generate_html_tail();\n}", "function m_packageBuild()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_PACKAGE_FILE\",$this->packageTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_DEPARTMENT_BLK\", \"dept_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_ITEMS_BLK\", \"items_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_MAIN_BLK\", \"main_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_MAIN_BLK\",\"TPL_ATTACHED_BLK\", \"attached_blk\");\n\t\t#INTIALIZING VARIABLES\n\t\tif(!isset($this->request['owner']))\n\t\t{\n\t\t\t$this->request['owner']=\"0\";\n\t\t}\n\t\tif(!isset($this->request['type']))\n\t\t{\n\t\t\t$this->request['type']=\"product\";\n\t\t}\n\t\tif(!isset($this->request['otype']))\n\t\t{\n\t\t\t$this->request['otype']=\"department\";\n\t\t}\n\t\tif(!isset($this->request['kitid']))\n\t\t{\n\t\t\t$this->request['kitid']=\"\";\n\t\t}\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_SHOPURL\",SITE_URL.\"ecom/\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OWNER\",$this->request['owner']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_TYPE\",$this->request['type']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OTYPE\",$this->request['otype']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\t\n\t\t//defining language variables\n\t\t$this->ObTpl->set_var(\"LANG_VAR_BUILDPACKAGE\",LANG_BUILDPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CURRENTPACKAGE\",LANG_CURRENTPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CODE\",LANG_CODE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_PRODUCT\",LANG_PRODUCTSTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_QTY\",LANG_QTYTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_SORT\",LANG_SORT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_REMOVE\",LANG_REMOVE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_HOME\",LANG_HOME);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_ALLORPHAN\",LANG_ALLORPHAN);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_RETURNPACK\",LANG_RETURNTOPACK);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_VIEWITEMS\",LANG_VIEWITEMS);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_UPDATEPACKAGE\",LANG_UPDATEPACKAGE);\n\t\t#START DISPLAY DEPARETMENT BLOCK\n\t\t$this->obDb->query = \"SELECT vTitle,iDeptId_PK FROM \".DEPARTMENTS.\", \".FUSIONS.\" WHERE iDeptId_PK=iSubId_FK AND vType='department'\";\n\t\t$deptResult = $this->obDb->fetchQuery();\n\t\t $recordCount=$this->obDb->record_count;\n\t\t#PARSING DEPARTMENT BLOCK\n\t\t$this->ObTpl->set_var(\"SELECTED1\",\"selected\");\n\t\t\n\t\t\n\t\tif($recordCount>0)\n\t\t{\n\t\t\tfor($i=0;$i<$recordCount;$i++)\n\t\t\t{\n\t\t\t\t$_SESSION['dspTitle']=\"\";\t\t\n\t\t\t\t $this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->m_getTitle($deptResult[$i]->iDeptId_PK,'department'));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$deptResult[$i]->iDeptId_PK);\n\t\t\t\tif(isset($this->request['postOwner']) && $this->request['postOwner'] == $deptResult[$i]->iDeptId_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED1\",\"\");\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ObTpl->parse(\"dept_blk\",\"TPL_DEPARTMENT_BLK\",true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"dept_blk\",\"\");\n\t\t}\n\t\t#END DISPLAY DEPARETMENT BLOCK\n\n\t\t#START DISPLAY PRODUCT BLOCK\n\t\t#IF TYPE IS CONTENT\n\t\tif(isset($this->request['postOwner']))#PRODUCT\n\t\t{#FOR ORPHAN PRODUCT\n\t\t\tif($this->request['postOwner']==\"orphan\")\n\t\t\t{\n\t\t\t\t $this->obDb->query= \"SELECT vTitle,fusionid,iProdId_PK FROM \".PRODUCTS.\" LEFT JOIN \".FUSIONS.\" ON iProdId_PK = iSubId_FK \" ;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\t\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(empty($queryResult[$j]->fusionid))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{#IF OTHER THAN ORPHAN\n\t\t\t\t$query = \"SELECT vTitle,iProdId_PK FROM \".PRODUCTS.\", \".FUSIONS.\" WHERE iProdId_PK=iSubId_FK AND iOwner_FK='\".$this->request['postOwner'].\"' AND vOwnerType='department' AND vType='\".$this->request['type'].\"'\";\n\t\t\t\t$this->obDb->query=$query;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",$this->request['postOwner']);\n\t\t}\n\t\telse#POST OWNER NOT SET\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",\"\");\n\t\t}\n\n\t\t$this->obDb->query=\"SELECT vTitle FROM \".PRODUCTS.\" WHERE iProdId_PK='\".$this->request['kitid'].\"'\";\n\t\t$rs = $this->obDb->fetchQuery();\n\t\tif(!empty($rs[0]->vTitle))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",$this->libFunc->m_displayContent($rs[0]->vTitle));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",\"\");\n\t\t}\n\t\t\t\n\t\t#TO DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$query1 = \"SELECT vSku,vTitle,iProdId_PK,iKitId_PK,iSort,iQty FROM \".PRODUCTS.\", \".PRODUCTKITS.\" WHERE iProdId_PK=iProdId_FK AND iKitId='\".$this->request['kitid'].\"' order by iSort\";\n\t\t$this->obDb->query=$query1;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$recordCount=$this->obDb->record_count;\n\t\tif($recordCount>0)\n\t\t{\n\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t{\n\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_QTY\",$queryResult[$j]->iQty);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SORT\",$queryResult[$j]->iSort);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SKU\",$this->libFunc->m_displayContent($queryResult[$j]->vSku));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$str=str_replace(\"'\",\"\\'\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE1\",$str);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_KID\",$queryResult[$j]->iKitId_PK);\n\t\t\t\t\t$this->ObTpl->parse(\"attached_blk\",\"TPL_ATTACHED_BLK\",true);\n\t\t\t\n\t\t\t}\n\n\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"attached_blk\",\"\");\n\t\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\t#END DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\tif(empty($this->request['kitid']))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"main_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_BUILDPACK);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_ADDTOPACK);\n\t\t}\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_PACKAGE_FILE\"));\n\t}", "function adminHTML($content, $lang, $wisig = false, $se = \"\", $conf = array(), $jQuery = false, $options = array(\"title\" => \"Admin\")){\necho '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\".$lang.\">\n\t<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\" />\n\t<title>BackpackCSM &middot; '.$options[\"title\"].'</title>\n\t<link rel=\"icon\" href=\"../favicon.ico\" type=\"image/x-icon\" />\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"admin.css\" />';\n\t\n\tfunction sel($e, $i){\n\t\tif($i==$e){\n\t\treturn ' class=\"selected\"';\n\t\t}\n\t}\n\t\n\tfunction selImg($e,$i){\n\t\tif($i==$e){\n\t\t// return '_sel';\n\t\treturn '';\n\t\t}\n\t}\n\t\n\t// Inclusion de jQuery sur certaines pages (+ scripts perso)\n\tif(is_array($conf) && $jQuery == true){\n\t\techo '<script src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/jquery-1.4.2.min.js\" type=\"text/javascript\"></script>';\n\t\techo '<script src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/BackpackCMS.js\" type=\"text/javascript\"></script>';\n\t}\n\t// Inclusions du WISIG sur certaines pages\n\tif(is_array($conf) && $wisig == true){\n\t\techo '<script type=\"text/javascript\" src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/nice.edit.js\"></script>';\n\t\techo '<script type=\"text/javascript\" src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/tinymce/tiny_mce.js\"></script>';\n\t\techo '<script type=\"text/javascript\" src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/WisigEditor.js\"></script>';\n\t}\n\t\n\techo '</head>\n\t<body>\n\t<div id=\"admin-container\">';\n\t\techo '<div id=\"admin-header\">';\n\t\t\t// Inclusion du lien de déconnexion et rappel du login si connect\"\n\t\t\tif($_SESSION[\"valid\"] == true){\n\t\t\t\techo '<div id=\"admin-user\"><span style=\"color:#DFDDD0\">'.$_SESSION[\"login\"].'</span> &middot; <a href=\"logout\">'.tr(\"Déconnexion\").'</a></div>';\n\t\t\t}\n\t\techo '<h1 class=\"admin-title\">BackpackCMS</h1>';\n\t\techo '</div>';\n\t\t\n\t\t$s = '';\n\t\tif($_SESSION['valid'] == true){\n\t\techo '<div id=\"admin-nav-menu\" class=\"admin-nav round\">\n\t\t\t<div class=\"box-title first\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/panel.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Gestion du contenu\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m1\" href=\"index?m=m1\"'.sel($se,'m1').'>'.tr(\"Tableau de bord\").'</a></li>\n\t\t\t\t<li><a id=\"m2\" href=\"pages-new?m=m2\"'.sel($se,'m2').'>'.tr(\"Nouvelle page\").'</a></li>\n\t\t\t\t<li><a id=\"m3\" href=\"pages-manage?m=m3\"'.sel($se,'m3').'>'.tr(\"Gestion de pages\").'</a></li>\n\t\t\t\t<li><a id=\"m7\" href=\"media-uploads?m=m7\"'.sel($se,'m7').'>'.tr(\"Media et images\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/layout.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Apparence\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table></div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m5\" href=\"settings?m=m5\"'.sel($se,'m5').'>'.tr(\"Réglages et paramètres\").'</a></li>\n\t\t\t\t<li><a id=\"m10\" href=\"template-edit?m=m10\"'.sel($se,'m10').'>'.tr(\"Modifier l'apparence\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/list.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Administration\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table></div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m6\" href=\"accounts?m=m6\"'.sel($se,'m6').'>'.tr(\"Comptes utilisateurs\").'</a></li>\n\t\t\t\t<li><a id=\"m7\" href=\"import-export?m=m11\"'.sel($se,'m11').'>'.tr(\"Importer, exporter\").'</a></li>\n\t\t\t\t<li><a id=\"m8\" href=\"plugins-manage?m=m8\"'.sel($se,'m8').'>'.tr(\"Gestion des extensions\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/eye.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Visusalisation\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table></div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m9\" href=\"../index\"'.sel($se,'m9').' target=\"_target\">'.tr(\"Voir le site\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/help.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Autres liens\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<ul>\n\t\t\t\t<li><a href=\"SpecialArnosteo.php\">Pense-bête</a></li>\n\t\t\t\t<li><a href=\"https://sites.google.com/site/backpackcmsaide/presentation/modifier-le-theme\" target=\"_blank\">Modifier l\\'apparence</a></li>\n\t\t\t\t<li><a href=\"https://sites.google.com/site/backpackcmsaide/presentation/sauvegarder-son-site\" target=\"_blank\">Sauvegarder mon site</a></li>\n\t\t\t</ul>\n\t\t</div>';\n\t\t\n\t\t// Enlève la marge admin content\n\t\t} else {\n\t\t\t$st = ' style=\"margin-left:0px;\"';\n\t\t}\n\t\n\techo '<div id=\"admin-content\"'.$st.'>'.$content.'</div>';\n\t\n\techo '<div class=\"clear\"></div>';\n\techo '<br />';\n\t// echo '<div id=\"admin-footer\">&copy; Copyright 2011 BackpackCMS | <a href=\"logout\">Déconnexion</a> | <a href=\"http://backpackcms.honeyshare.fr/bug\">Déclarer un bug</a></div>';\necho '</div>\n</body>\n</html>';\n}", "function educoAdminPrepareHead() {\n global $langs, $conf;\n\n $langs->load(\"educo@educo\");\n\n $h = 0;\n $head = array();\n\n $head[$h][0] = dol_buildpath(\"/educo/admin/setup.php\", 1);\n $head[$h][1] = $langs->trans(\"Settings\");\n $head[$h][2] = 'settings';\n $h++;\n $head[$h][0] = dol_buildpath(\"/educo/admin/about.php\", 1);\n $head[$h][1] = $langs->trans(\"About\");\n $head[$h][2] = 'about';\n $h++;\n\n // Show more tabs from modules\n // Entries must be declared in modules descriptor with line\n //$tabs = array(\n //\t'entity:+tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to add new tab\n //$tabs = array(\n //\t'entity:-tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to remove a tab\n complete_head_from_modules($conf, $langs, $object, $head, $h, 'educo');\n\n return $head;\n}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "public function htmlOutput()\n {\n $arrayOfLattes = glob('template/*.latte');\n if ($arrayOfLattes === false) {\n return 'No templates found.';\n }\n $found = []; // translations found in latte templates\n foreach ($arrayOfLattes as $file) {\n $tempFileContents = file_get_contents($file);\n Assert::string($tempFileContents);\n preg_match_all('~\\{=(\"([^\"]+)\"|\\'([^\\']+)\\')\\|translate\\}~i', $tempFileContents, $matches);\n $found = array_merge($found, $matches[2]);\n }\n $found = array_unique($found);\n $output = '<h1><i class=\"fa fa-globe\"></i> ' . $this->tableAdmin->translate('Translations')\n . '</h1><div id=\"agenda-translations\">'\n . '<form action=\"\" method=\"post\" onsubmit=\"return confirm(\\''\n . $this->tableAdmin->translate('Are you sure?') . '\\')\">'\n . Tools::htmlInput('translations', '', 1, array('type' => 'hidden'))\n . Tools::htmlInput('token', '', end($_SESSION['token']), 'hidden')\n . Tools::htmlInput('old_name', '', '', array('type' => 'hidden', 'id' => 'old_name'))\n . '<table class=\"table table-striped\"><thead><tr><th style=\"width:'\n . intval(100 / (count($this->tableAdmin->TRANSLATIONS) + 1)) . '%\">'\n . Tools::htmlInput('one', '', false, 'radio') . '</th>';\n $translations = $keys = [];\n $localisation = new L10n($this->prefixUiL10n, $this->tableAdmin->TRANSLATIONS);\n foreach ($this->tableAdmin->TRANSLATIONS as $key => $value) {\n $output .= \"<th>$value</th>\";\n $translations[$key] = $localisation->readLocalisation($key);\n $keys = array_merge($keys, array_keys($translations[$key]));\n }\n $output .= '</tr></thead><tbody>' . PHP_EOL;\n $keys = array_unique($keys);\n natcasesort($keys);\n foreach ($keys as $key) {\n $output .= '<tr><th>'\n . Tools::htmlInput('one', '', $key, array('type' => 'radio', 'class' => 'translation')) . ' '\n . Tools::h((string) $key) . '</th>';\n foreach ($this->tableAdmin->TRANSLATIONS as $code => $value) {\n $output .= '<td>' . Tools::htmlInput(\n \"tr[$code][$key]\",\n '',\n Tools::set($translations[$code][$key], ''),\n ['class' => 'form-control form-control-sm', 'title' => \"$code: $key\"]\n ) . '</td>';\n }\n $output .= '</tr>' . PHP_EOL;\n if ($key = array_search($key, $found)) {\n unset($found[$key]);\n }\n }\n $output .= '<tr><td>' . Tools::htmlInput(\n 'new[0]',\n '',\n '',\n ['class' => 'form-control form-control-sm', 'title' => $this->tableAdmin->translate('New record')]\n ) . '</td>';\n foreach ($this->tableAdmin->TRANSLATIONS as $key => $value) {\n $output .= '<td>' . Tools::htmlInput(\n \"new[$key]\",\n '',\n '',\n ['class' => 'form-control form-control-sm',\n 'title' => $this->tableAdmin->translate('New record') . ' (' . $value . ')']\n ) . '</td>';\n }\n $output .= '</tr></tbody></table>\n <button name=\"translations\" type=\"submit\" class=\"btn btn-secondary\"><i class=\"fa fa-save\"></i> '\n . $this->tableAdmin->translate('Save') . '</button>\n <button name=\"delete\" type=\"submit\" class=\"btn btn-secondary\" value=\"1\"><i class=\"fa fa-dot-circle\"></i>\n <i class=\"fa fa-trash\"></i> ' . $this->tableAdmin->translate('Delete') . '</button>\n <fieldset class=\"d-inline-block position-relative\"><div class=\"input-group\" id=\"rename-fieldset\">'\n . '<div class=\"input-group-prepend\">\n <button class=\"btn btn-secondary\" type=\"submit\"><i class=\"fa fa-dot-circle\"></i> '\n . '<i class=\"fa fa-i-cursor\"></i> ' . $this->tableAdmin->translate('Rename') . '</button>\n </div>'\n . Tools::htmlInput('new_name', '', '', ['class' => 'form-control', 'id' => 'new_name'])\n . '</div></fieldset>\n </form></div>' . PHP_EOL;\n $output .= count($found)\n ? ('<h2 class=\"mt-4\">' . $this->tableAdmin->translate('Missing translations in templates') . '</h2><ul>')\n : '';\n foreach ($found as $value) {\n $output .= '<li><code>' . Tools::h($value) . '</code></li>' . PHP_EOL;\n }\n $output .= count($found) ? '</ul>' : '';\n return $output;\n }", "function mgt_page($xerte_toolkits_site, $extra)\n{\n ?>\n <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <title><?PHP echo $xerte_toolkits_site->site_title; ?></title>\n <link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\n <link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\n <script type=\"text/javascript\">\n <?PHP\n echo \"var site_url = \\\"\" . $xerte_toolkits_site->site_url . \"\\\";\\n\";\n\n echo \"var site_apache = \\\"\" . $xerte_toolkits_site->apache . \"\\\";\\n\";\n\n echo \"var properties_ajax_php_path = \\\"website_code/php/properties/\\\";\\n var management_ajax_php_path = \\\"website_code/php/management/\\\";\\n var ajax_php_path = \\\"website_code/php/\\\";\\n\";\n ?></script>\n\n\n\n <link href=\"website_code/styles/frontpage.css\" media=\"screen\" type=\"text/css\" rel=\"stylesheet\" />\n <link href=\"website_code/styles/xerte_buttons.css\" media=\"screen\" type=\"text/css\" rel=\"stylesheet\" />\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"modules/xerte/parent_templates/Nottingham/common_html5/font-awesome-4.3.0/css/font-awesome.min.css\">\n\n <!--\n\n HTML to use to set up the login page\n The {{}} pairs are replaced in the page formatting functions in display library\n\n Version 1.0\n\n -->\n <style>\n body {\n background:white;\n }\n </style>\n\n <?php\n if (file_exists($xerte_toolkits_site->root_file_path . \"branding/branding.css\"))\n {\n ?>\n <link href='branding/branding.css' rel='stylesheet' type='text/css'>\n <?php\n }\n else {\n ?>\n <?php\n }\n ?>\n </head>\n\n <body>\n\n <header class=\"topbar\">\n <?php\n if (file_exists($xerte_toolkits_site->root_file_path . \"branding/logo_right.png\"))\n {\n ?>\n <div\n style=\"width:50%; height:100%; float:right; position:relative; background-image:url(<?php echo \"branding/logo_right.png\";?>); background-repeat:no-repeat; background-position:right; margin-right:10px; float:right\">\n </div>\n <?php\n }\n else {\n ?>\n <div\n style=\"width:50%; height:100%; float:right; position:relative; background-image:url(website_code/images/apereoLogo.png); background-repeat:no-repeat; background-position:right; margin-right:10px; float:right\">\n </div>\n <?php\n }\n if (file_exists($xerte_toolkits_site->root_file_path . \"branding/logo_left.png\"))\n {\n ?>\n <img src=\"<?php echo \"branding/logo_left.png\";?>\" style=\"margin-left:10px; float:left\" alt=\"<?php echo MANAGEMENT_LOGO_ALT; ?>\"/>\n <?php\n }\n else {\n ?>\n <img src=\"website_code/images/logo.png\" style=\"margin-left:10px; float:left\" alt=\"<?php echo MANAGEMENT_LOGO_ALT; ?>\"/>\n <?php\n }\n ?>\n </header>\n\n\n\t\t\t<main class=\"mainbody\">\n\t\t\t\t<div class=\"title_holder\">\n\t\t\t\t\t<h1 class=\"title_welcome\">\n\t\t\t\t\t\t<?PHP echo $xerte_toolkits_site->welcome_message; ?>\n\t\t\t\t\t</h1>\n\t\t\t\t\t<div class=\"mainbody_holder\">\n\t\t\t\t\t\t<div style=\"margin:0 7px 4px 0\"><?PHP echo MANAGEMENT_LOGIN; ?></div>\n\t\t\t\t\t\t<form method=\"post\" enctype=\"application/x-www-form-urlencoded\" >\n\t\t\t\t\t\t\t<p style=\"margin:4px\"><label for=\"login_box\"><?PHP echo MANAGEMENT_USERNAME; ?>:</label>\n\t\t\t\t\t\t\t<input class=\"xerte_input_box\" type=\"text\" size=\"20\" maxlength=\"100\" name=\"login\" id=\"login_box\"/></p>\n\t\t\t\t\t\t\t<p style=\"margin:4px\"><label for=\"password\"><?PHP echo MANAGEMENT_PASSWORD; ?>:</label>\n\t\t\t\t\t\t\t<input class=\"xerte_input_box\" type=\"password\" size=\"20\" maxlength=\"100\" name=\"password\" id=\"password\"/></p>\n\t\t\t\t\t\t\t<button type=\"submit\" class=\"xerte_button\" style=\"margin:0 3px 0 0\"><i class=\"fa fa-sign-in\"></i> <?php echo MANAGEMENT_BUTTON_LOGIN; ?></button>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t\t<script>document.getElementById(\"login_box\").focus();</script>\n\t\t\t\t\t\t<!--<p><?PHP echo $extra; ?></p>-->\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</main>\n\n\t\t\t<div class=\"bottompart\">\n\t\t\t\t<div class=\"border\"></div>\n\t\t\t\t<footer>\n\t\t\t\t\t<p class=\"copyright\">\n\t\t\t\t\t\t<?php echo $xerte_toolkits_site->copyright; ?> <i class=\"fa fa-info-circle\" aria-hidden=\"true\" style=\"color:#f86718; cursor: help;\" title=\"<?PHP $vtext = \"version.txt\";$lines = file($vtext);echo $lines[0];?>\"></i>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div class=\"footerlogos\">\n\t\t\t\t\t\t<a href=\"https://xot.xerte.org.uk/play.php?template_id=214#home\" target=\"_blank\" title=\"Xerte accessibility statement https://xot.xerte.org.uk/play.php?template_id=214\"><img src=\"website_code/images/wcag2.1AA-blue-v.png\" border=\"0\" alt=\"<?php echo MANAGEMENT_WCAG_LOGO_ALT; ?>\"></a><a href=\"https://opensource.org/\" target=\"_blank\" title=\"Open Source Initiative: https://opensource.org/\"><img src=\"website_code/images/osiFooterLogo.png\" border=\"0\" alt=\"<?php echo MANAGEMENT_OSI_LOGO_ALT; ?>\"></a><a href=\"https://www.apereo.org\" target=\"_blank\" title=\"Apereo: https://www.apereo.org\"><img src=\"website_code/images/apereoFooterLogo.png\" border=\"0\" alt=\"<?php echo MANAGEMENT_APEREO_LOGO_ALT; ?>\"></a><a href=\"https://xerte.org.uk\" target=\"_blank\" title=\"Xerte: https://xerte.org.uk\"><img src=\"website_code/images/xerteFooterLogo.png\" border=\"0\" alt=\"<?php echo MANAGEMENT_XERTE_LOGO_ALT; ?>\"></a>\n\t\t\t\t\t</div>\n\t\t\t\t</footer>\n\t\t\t</div>\n </body>\n </html>\n\n\n <?PHP\n}", "public function generate()\n\t{\n if (is_array($GLOBALS['TL_JAVASCRIPT']))\n\t\t{\n\t\t\tarray_insert($GLOBALS['TL_JAVASCRIPT'], 1, 'bundles/hschottmtextwizard/js/textwizard.min.js');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$GLOBALS['TL_JAVASCRIPT'] = array('bundles/hschottmtextwizard/js/textwizard.min.js');\n\t\t}\n\n\t\t$arrButtons = array('new', 'copy', 'delete', 'drag');\n\t\t// Make sure there is at least an empty array\n\t\tif (empty($this->varValue) || !\\is_array($this->varValue))\n\t\t{\n\t\t\t$this->varValue = array('');\n\t\t}\n\t\t// Initialize the tab index\n\t\tif (!\\Cache::has('tabindex'))\n\t\t{\n\t\t\t\\Cache::set('tabindex', 1);\n\t\t}\n\n $hasTitles = array_key_exists('buttonTitles', $this->arrConfiguration) && is_array($this->arrConfiguration['buttonTitles']);\n\n $return = ($this->wizard) ? '<div class=\"tl_wizard\">' . $this->wizard . '</div>' : '';\n\t\t$return .= '<ul id=\"ctrl_'.$this->strId.'\" class=\"tl_listwizard tl_textwizard\">';\n\t\t// Add input fields\n\t\tfor ($i=0, $c=\\count($this->varValue); $i<$c; $i++)\n\t\t{\n\t\t\t$return .= '\n <li><input type=\"text\" name=\"'.$this->strId.'[]\" class=\"tl_text\" value=\"'.\\StringUtil::specialchars($this->varValue[$i]).'\"' . $this->getAttributes() . '> ';\n\t\t\t// Add buttons\n\t\t\tforeach ($arrButtons as $button)\n\t\t\t{\n\t\t\t\tif ($button == 'drag')\n\t\t\t\t{\n\t\t\t\t\t$return .= ' <button type=\"button\" class=\"drag-handle\" title=\"' . \\StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['move']) . '\" aria-hidden=\"true\">' . \\Image::getHtml('drag.svg') . '</button>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n $buttontitle = ($hasTitles && array_key_exists($button, $this->arrConfiguration['buttonTitles'])) ? $this->arrConfiguration['buttonTitles'][$button] : $GLOBALS['TL_LANG']['MSC']['lw_'.$button];\n\t\t\t\t\t$return .= ' <button type=\"button\" data-command=\"' . $button . '\" title=\"' . \\StringUtil::specialchars($buttontitle) . '\">' . \\Image::getHtml($button.'.svg') . '</button>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$return .= '</li>';\n\t\t}\n\t\treturn $return.'\n </ul>\n <script>TextWizard.textWizard(\"ctrl_'.$this->strId.'\")</script>';\n\t}", "public function run()\n {\n $modules = [\n 'Computer Science',\n 'Information Systems',\n 'Computer Engineering',\n 'Business Analytics',\n 'Information Security',\n 'Algorithms & Theory',\n 'Artificial Intelligence',\n 'Computer Graphics and Games',\n 'Computer Security',\n 'Database Systems',\n 'Multimedia Information Retrieval',\n 'Networking and Distributed Systems',\n 'Parallel Computing',\n 'Programming Languages',\n 'Software Engineering',\n 'Interactive Media',\n 'Visual Computing',\n 'CS1010 Programming Methodology',\n 'CS1020 Data Structures and Algorithms I',\n 'CS2010 Data Structures and Algorithms II',\n 'CS1231 Discrete Structures',\n 'CS2100 Computer Organisation',\n 'CS2103T Software Engineering',\n 'CS2105 Introduction to Computer Networks',\n 'CS2106 Introduction to Operating Systems',\n 'CS3230 Design and Analysis of Algorithms',\n 'CS3201 Software Engineering Project',\n 'CS3202 Software Engineering Project II',\n 'CS3216 Software Product Engineering for Digital Markets',\n 'CS3217 Software Engineering on Modern Application Platforms',\n 'CS3281 Thematic Systems Project I',\n 'CS3282 Thematic Systems Project II',\n 'CS3283 Media Technology Project I',\n 'CS3284 Media Technology Project II',\n 'IS1103/FC/X Computing and Society',\n 'CS2101 Effective Communication for Computing Professionals',\n 'ES2660 Communicating in the Information Age',\n 'MA1301/FC/X Introductory Mathematics',\n 'MA1521 Calculus for Computing',\n 'MA1101R Linear Algebra I',\n 'ST2334 Probability and Statistics',\n 'ST2131 Probability',\n 'ST2132 Mathematical Statistics',\n 'PC1221/FC/X Fundamental of Physics I',\n 'PC1222/X Fundamentals of Physics II',\n 'CS1101S Programming Methodology',\n 'CS2020 Data Structures and Algorithms Accelerated',\n 'CM1121 ORGANIC CHEMISTRY 1',\n 'CM1131 PHYSICAL CHEMISTRY 1',\n 'CM1417 FUNDAMENTALS OF CHEMISTRY',\n 'LSM1301 GENERAL BIOLOGY',\n 'LSM1302 GENES AND SOCIETY',\n 'PC1141 PHYSICS I',\n 'PC1142 PHYSICS II',\n 'PC1143 PHYSICS III',\n 'PC1144 PHYSICS IV',\n 'PC1221 FUNDAMENTALS OF PHYSICS I ',\n 'PC1222 FUNDAMENTALS OF PHYSICS II PC1432 PHYSICS IIE',\n 'MA2213 NUMERICAL ANALYSIS I',\n 'MA2214 COMBINATORICS AND GRAPHS I',\n 'CM1101 PRINCIPLES OF MODERN CHEMISTRY ',\n 'CM1111 INORGANIC CHEMISTRY 1',\n 'CM1161 PRINCIPLESOF CHEMICAL PROCESS I ',\n 'CM1191 EXPERIMENTS IN CHEMISTRY 1 ',\n 'CM1401 CHEMISTRY FOR LIFE SCIENCES',\n 'CM1402 GENERAL CHEMISTRY',\n 'CM1501 ORGANIC CHEMISTRY FOR ENGINEERS',\n 'CM1502 GENERAL AND PHYSICAL CHEMISTRY FOR ENGINEERS ',\n 'LSM1303 ANIMAL BEHAVIOUR',\n 'PC1421 PHYSICS FOR LIFE SCIENCES',\n 'PC1431 PHYSICS IE',\n 'PC1433 MECHANICS AND WAVES',\n 'MA1104 MULTIVARIABLE CALCULUS',\n 'MA2101 LINEAR ALGEBRA II',\n 'MA2108 MATHEMATICAL ANALYSIS I',\n 'MA2501 DIFFERENTIAL EQUATIONS AND SYSTEMS',\n 'ST2132 MATHEMATICAL STATISTICS',\n 'ST2137 COMPUTER AIDED DATA ANALYSIS',\n 'CS3230 Design and Analysis of Algorithms (CFM)',\n 'CS3236 Introduction to Information Theory',\n 'CS4231 Parallel and Distributed Algorithms',\n 'CS4232 Theory of Computation',\n 'CS4234 Optimisation Algorithms',\n 'CS3233 Competitive Programming',\n 'CS5230 Computational Complexity',\n 'CS5234 Combinatorial and Graph Algorithms',\n 'CS5237 Computational Geometry and Applications',\n 'CS5238 Advanced Combinatorial Methods in Bioinformatics',\n 'CS3243 Introduction to Artificial Intelligence',\n 'CS3244 Machine Learning',\n 'CS4244 Knowledge-Based Systems',\n 'CS4246 AI Planning and Decision Making',\n 'CS4216 Constraint Logic Programming',\n 'CS4220 Knowledge Discovery Methods in Bioinformatics',\n 'CS4248 Natural Language Processing',\n 'CS5209 Foundation in Logic & AI',\n 'CS5215 Constrained Programming',\n 'CS5228 Knowledge Discovery and Data Mining',\n 'CS5247 Motion Planning and Applications',\n 'CS5340 Uncertainty Modelling in AI',\n 'CS3241 Computer Graphics',\n 'CS3242 3D Modelling and Animation',\n 'CS3247 Game Development',\n 'CS4247 Graphics Rendering Techniques',\n 'CS4350 Game Development Project',\n 'CS3218 Multimodal Processing in Mobile Platforms',\n 'CS3240 Interaction Design',\n 'CS3249 User Interface Development',\n 'CS3343 Digital Media Production',\n 'CS4243 Computer Vision and Pattern Recognition',\n 'CS4249 Phenomena and Theories of HCI',\n 'CS4340 Digital Special Effects',\n 'CS4344 Network and Mobile Gaming',\n 'CS4345 General-Purpose Computation on GPU',\n 'CS5240 Theoretical Foundation of Multimedia',\n 'CS2107 Introduction to Information Security',\n 'CS3235 Computer Security',\n 'CS4236 Cryptography Theory and Practice',\n 'CS4238 Computer Security Practices',\n 'CS3221 Operating Systems Design and Pragmatics',\n 'CS4239 Software Security',\n 'CS5231 Systems Security',\n 'CS5321 Network Security',\n 'CS5322 Database Security',\n 'CS5331 Web Security',\n 'IFS4101 Legal Aspects of Information Security',\n 'IS3230 Principles of Information Security',\n 'IS4231 Information Security Management',\n 'IS4232 Topics in Information Security',\n 'CS2102 Database Systems',\n 'CS3223 Database Systems Implementation',\n 'CS4221 Database Applications Design and Tuning',\n 'CS4224 Distributed Databases',\n 'CS4225 Massive Data Processing Techniques in Data Science',\n 'CS5226 Database Tuning',\n 'CS2108 Introduction to Media Computing&',\n 'CS3245 Information Retrieval',\n 'CS4242 Social Media Computing',\n 'CS4347 Sound and Music Computing',\n 'CS5246 Text Processing on the Web',\n 'CS5241 Speech Processing',\n 'CS6242 Digital Libraries',\n 'CS5342 Multimedia Computing and Applications',\n 'CS3103 Computer Networks Practice',\n 'CS4222 Wireless Computing',\n 'CS4226 Internet Architecture',\n 'CS4274 Mobile and Multimedia Networking',\n 'CS4344 Networked and Mobile Gaming',\n 'CS5223 Distributed Systems',\n 'CS5229 Advanced Computer Networks',\n 'CS5248 Systems Support for Continuous Media',\n 'CS3210 Parallel Computing',\n 'CS3211 Parallel and Concurrent Programming',\n 'CS4223 Multi-core Architecture',\n 'CS4237 Systems Modelling and Simulation',\n 'CS4271 Critical Systems and Their Verification',\n 'CS5207 Foundation in Operating Systems',\n 'CS5222 Advanced Computer Architectures',\n 'CS5239 Computer System Performance Analysis',\n 'CS2104 Programming Language Concepts',\n 'CS4215 Programming Language Implementation',\n 'CS4212 Compiler Design',\n 'CS3234 Logic and Formal Systems',\n 'CS5205 Foundation in Programming Languages',\n 'CS5232 Formal Specification & Design Techniques',\n 'CS5214 Design of Optimising Compilers',\n 'CS5218 Principles of Program Analysis',\n 'CS2103 Software Engineering',\n 'CS3213 Software Systems Design',\n 'CS3219 Software Engineering Principles and Patterns',\n 'CS4211 Formal Methods for Software Engineering',\n 'CS4218 Software Testing',\n 'CS3216 Software Development on Evolving Platforms',\n 'CS3226 Web Programming and Applications',\n 'CS3882 Breakthrough Ideas for Digital Markets',\n 'CS4217 Software Development Technologies',\n 'CS5219 Automatic Software Validation',\n 'CS5272 Embedded Software Design',\n 'IS2102 Requirements Analysis and Design',\n 'IS2104 Software Team Dynamics',\n 'CS3242 3D Modeling and Animation',\n 'CS6243 Computational Photography',\n 'CS1010J Programming Methodology',\n 'IS1103/FC Computing and Society',\n 'IS1105 Strategic IT Applications',\n 'IS2101 Business and Technical Communication',\n 'IS2103 Enterprise Systems Development Concepts',\n 'IS3101 Management of Information Systems',\n 'IS3102 Enterprise Systems Development Project',\n 'IS4100 IT Project Management',\n 'ACC1002X Financial Accounting',\n 'MA1301 Introductory Mathematics',\n 'MA1312 Calculus with Applications',\n 'CP4101 B.Comp. Dissertation',\n 'CS2106 Introduction to Operating Systems ',\n 'CS3235 Introduction to Computer Security',\n 'IS3220 Service Science ',\n 'IS3221 Enterprise Resource Planning Systems',\n 'IS3222 IT and Customer Relationship Management ',\n 'IS3223 IT and Supply Chain Management ',\n 'IS3240 Economics of E-Business',\n 'IS3241 Enterprise Social Systems',\n 'IS3242 Software Quality Management',\n 'IS3243 Technology Strategy and Management',\n 'IS3250 Health Informatics',\n 'IS3251 Principles of Technology Entrepreneurship',\n 'IS3260 Gamification for Organisations and Individuals',\n 'IS3261 Mobile Apps Development',\n 'CS4880 Digital Entrepreneurship',\n 'IS4202 Global Virtual Project',\n 'IS4203 IT Adoption and Change Management',\n 'IS4204 IT Governance',\n 'IS4224 Service Systems ',\n 'IS4225 Strategic IS Planning ',\n 'IS4226 IT Outsourcing and Offshoring Management ',\n 'IS4227 Enterprise Service-Oriented Architecture ',\n 'IS4228 Information Technologies in Financial Services',\n 'IS4232 Topics in Information Security Management',\n 'IS4233 Legal Aspects of Information Technology',\n 'IS4234 Control and Audit of Information Systems',\n 'IS4240 Business Intelligence Systems',\n 'IS4241 Social Media Network Analysis',\n 'IS4243 Information Systems Consulting',\n 'IS4250 Healthcare Analytics',\n 'IS3150 Digital and New Media Marketing',\n 'IS4150 Mobile and Ubiquitous Commerce',\n 'IS4260 E-Commerce Business Models',\n 'IS3222 IT and Customer Relationship Management',\n 'IS3261 Mobile Apps Development for Enterprise',\n 'IS4225 Strategic IS Planning',\n 'IS4010 Industry Internship Programme',\n 'BT1101 Introduction to Business Analytics',\n 'CS1010S Programming Methodology',\n 'EC1301 Principles of Economics',\n 'IS1103 Computing and Society',\n 'MA1311 Matrix Algebra and Applications',\n 'MA1101R Linear Algebra I2',\n 'MA1102R Calculus2',\n 'MKT1003X Marketing',\n 'BT2101 IT and Decision Making',\n 'BT2102 Data Management and Visualisation',\n 'IE2110 Operations Research I3',\n 'DSC3214 Introduction To Optimisation',\n 'IS2101 Business and Technical Communication4',\n 'BT3101 Business Analytics Capstone Project',\n 'BT3102 Computational Methods for Business Analytics',\n 'BT3103 Application Systems Development for Business Analytics',\n 'ST3131 Regression Analysis',\n 'BT4101 B.Sc. Dissertation',\n 'DSC3224 Dynamic Pricing and Revenue Management',\n 'IE3120 Manufacturing Logistics',\n 'BT4211 Data-Driven Marketing',\n 'BT4212 Search Engine Optimization and Analytics',\n 'DSC4213 Analytical Tools for Consulting',\n 'MKT4415C Seminars in Marketing: Applied Market Research',\n 'DSC3216 Forecasting for Managerial Decisions',\n 'BSP4513 Econometrics: Theory & Practical Business Application',\n 'BT4221 Big Data Techniques and Technologies',\n 'BT4222 Mining Web Data for Business Insights',\n 'IE4210 Operations Research II',\n 'ST4240 Data Mining',\n 'ST4245 Statistical Methods for Finance',\n\n ];\n\n foreach ($modules as $module) {\n \\App\\Topic::create([\n 'name' => $module,\n ], 1);\n }\n }" ]
[ "0.68117386", "0.6257656", "0.6169114", "0.61197644", "0.60670847", "0.6035333", "0.5963818", "0.59474105", "0.59227645", "0.5908078", "0.58754194", "0.58266115", "0.5825155", "0.58153105", "0.5814015", "0.58116204", "0.5811198", "0.5806034", "0.57935363", "0.5782737", "0.57774144", "0.5774136", "0.57641417", "0.57376343", "0.57366806", "0.57235074", "0.57140076", "0.5713918", "0.5709597", "0.5706254" ]
0.7260305
0
/ Function: setNodeHtml convenience function to write inner HTML content to a XML node, and suppress warnings from html parser
function setNodeHtml($node, $content) { while ($node->childNodes->length) $node->removeChild($node->childNodes->item(0)); libxml_use_internal_errors(true); $nodeXml = new DOMDocument('1.0', 'UTF-8'); if(!$nodeXml->loadHTML('<?xml encoding="UTF-8"><html><body><div xml:id="hyphaImport">'.preg_replace('/\r/i', '', $content).'</div></body></html>')) return __('error-loading-html'); libxml_clear_errors(); libxml_use_internal_errors(false); foreach($nodeXml->getElementById('hyphaImport')->childNodes as $child) $node->appendChild($node->ownerDocument->importNode($child, true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSetHtml()\n {\n $document = $this->createDomDocument();\n $element = $document->createElementNS(Atom::NS, 'content');\n $document->documentElement->appendChild($element);\n $content = new Content($this->createFakeNode(), $element);\n $content->setContent('<em> &lt; </em>', 'html');\n static::assertEquals(\n '<content type=\"html\">&lt;em&gt; &lt; &lt;/em&gt;</content>',\n $document->saveXML($element)\n );\n }", "protected function setHtmlFromDomDocument()\n {\n // retain the modified html\n $this->html = trim($this->doc->saveHtml($this->doc->documentElement));\n\n // strip the html and body tags added by DomDocument\n $this->html = substr(\n $this->html,\n strlen('<html><body>'),\n -1 * strlen('</body></html>')\n );\n\n // still may be whitespace all about\n $this->html = trim($this->html) . PHP_EOL;\n }", "protected function setHtmlContent() {}", "public function setHtml();", "private function setInnerHTML($element, $html)\n\t{\n\t $fragment = $element->ownerDocument->createDocumentFragment();\n\t $fragment->appendXML($html);\n\t while ($element->hasChildNodes())\n\t $element->removeChild($element->firstChild);\n\t @$element->appendChild($fragment);\n\t}", "public function testSetXhtml()\n {\n $document = $this->createDomDocument('<content/>');\n $content = new Content($this->createFakeNode(), $document->documentElement->firstChild);\n\n $xhtml = $this->createDomElement('foo');\n $element = $xhtml->ownerDocument->createElement('bar', 'BAR');\n $element->setAttribute('a', 'b');\n $xhtml->appendChild($element);\n $xhtml->appendChild($xhtml->ownerDocument->createElement('baz', 'BAZ'));\n\n $content->setContent($xhtml, 'xhtml');\n static::assertEquals(\n '<content type=\"xhtml\">' .\n '<xhtml:div><xhtml:bar a=\"b\">BAR</xhtml:bar><xhtml:baz>BAZ</xhtml:baz></xhtml:div>' .\n '</content>',\n $document->saveXML($document->documentElement->firstChild)\n );\n }", "public function testGetHtml()\n {\n $doc = $this->createDomDocument('<content type=\"html\">&lt;em> &amp;lt; &lt;/em></content>');\n $content = new Content($this->createFakeNode(), $doc->documentElement->firstChild);\n static::assertEquals('html', $content->getType());\n static::assertEquals('<em> &lt; </em>', (string) $content);\n }", "public final function setHtml($html)\n {\n $this->children = [(string) $html];\n return $this;\n }", "static function replaceHtmlDom($element, $html, $encoding = 'UTF-8', $preserveAttr = true)\n {\n if ($html == null) {\n return;\n }\n\n $html = self::cleanXml($html, $encoding);\n if (substr($html, 0, 5) == '<?xml') {\n $html = substr($html, strpos($html, \"\\n\", 5) + 1);\n }\n $elementDoc = $element->ownerDocument;\n\n $contentNode = self::makeContentNode($html);\n $contentNode = $contentNode->firstChild;\n $contentNode = $elementDoc->importNode($contentNode, true);\n if ($element->hasAttributes() && $preserveAttr && $contentNode->nodeType == \\XML_ELEMENT_NODE) {\n foreach ($element->attributes as $attr) {\n $contentNode->setAttribute($attr->nodeName, $attr->nodeValue);\n }\n }\n $element->parentNode->replaceChild($contentNode, $element);\n return $contentNode;\n }", "public function getHtml(BBcodeElementNode $el);", "public function setBodyHtml($html);", "function setCustomHTML($html) {\n\t\t$this->customHTML = $html;\n\t}", "public abstract function asHTML();", "public function html($html = null) { \r\n\t\t\r\n\t\tif (!isset($html)) return $this[0]->C14N(); \r\n\t\t\r\n\t\tforeach ($this as $node) {\r\n\t\t\t\r\n\t\t\t$node = $this->initListObject($node);\r\n\t\t\t$node->emptyNode();\r\n\t\t\t$node->append($html);\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function setHtml($html)\n\t{\n\t\t$this->_html = $this->buildHtml($html);\n\t}", "function set_html($html=true)\n\t{\n\t\t$this->html = true;\n\t}", "protected function setElementContent($node, $value)\n\t{\n\t\tif ($node->tagName == 'input') {\n\t\t\t$node->setAttribute('value', $value);\n\t\t} else if ($node->tagName == 'img') {\n\t\t\t$node->setAttribute('src', $value);\n\t\t} else if ($node->tagName == 'a') {\n\t\t\t$node->setAttribute('href', $value);\n\t\t} else if ($node->tagName == 'meta') {\n\t\t\t$node->setAttribute('content', $value);\n\t\t} else {\n\t\t\t$node->nodeValue = htmlentities($value);\n\t\t}\n\t}", "public function wrap_HTML_with_HTML_tags()\n\t{\n\t\t$this->HTML = '<html><body>'.$this->HTML.'</body></html>';\n\t}", "public static function appendHTML(DOMNode $parent, String $source) {\n\t\t$tmpDoc = new DOMDocument(\"1.0\", \"UTF-8\");\n\t\t$html = \"<html><body>\";\n\t\t$html .= $source;\n\t\t$html .= \"</body></html>\";\n\t\t$tmpDoc->loadHTML('<?xml encoding=\"UTF-8\">'.$html);\n\n\t\t/** @var DOMNode $item */\n\t\tforeach ($tmpDoc->childNodes as $item)\n\t\tif ($item->nodeType == XML_PI_NODE)\n\t\t$tmpDoc->removeChild($item);\n\t\t$tmpDoc->encoding = 'UTF-8';\n\n\t\t/** @var DOMNode $node */\n\t\tforeach($tmpDoc->getElementsByTagName('body')->item(0)->childNodes as $node) {\n\t\t\t$importedNode = $parent->ownerDocument->importNode($node, true);\n\t\t\t$parent->appendChild($importedNode);\n\t\t}\n\t}", "public function setHtmlContent($html)\n {\n $this->htmlContent = $html;\n }", "public function html()\n\t{\n\t\t$output = \"\";\n\t\t\n\t\t$doc = new DOMDocument(\"1.0\", \"UTF-8\");\n\t\t$element = $doc->importNode(dom_import_simplexml($this), true);\n\t\t\n\t\t$doc->appendChild($element);\n\t\t\n\t\tforeach($doc->firstChild->childNodes as $child)\n\t\t\t$output .= $child->ownerDocument->saveHTML($child);\n\t\t\n\t\treturn $output;\n\t}", "function setInnerXML($node,$xml) {\n\t\t$doc=$node->ownerDocument;\n\t\t$f = $doc->createDocumentFragment();\n\t\t$f->appendXML($xml);\n\t\t$node->parentNode->replaceChild($f,$node);\n\t}", "public function testScanDomHTML(): void\n {\n // http://php.net/manual/de/libxml.constants.php\n if (version_compare(LIBXML_DOTTED_VERSION, '2.7.8', '<')) {\n $this->markTestSkipped(\n 'libxml 2.7.8+ required but found ' . LIBXML_DOTTED_VERSION\n );\n }\n\n $dom = new DOMDocument('1.0');\n $html = <<<HTML\n <p>a simple test</p>\n HTML;\n $constants = LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED;\n $result = XmlSecurity::scanHtml($html, $dom, $constants);\n $this->assertTrue($result instanceof DOMDocument);\n $this->assertEquals($html, trim($result->saveHtml()));\n }", "protected function parseHtml() {\r\n\t\tif (is_array($this->cfg->html))\r\n\t\t\t$this->cfg->html = utils::render($this->cfg->html);\r\n\t}", "public function innerHTML($_node) {\n\t\treturn preg_replace(\n\t\t\t'/^<(\\w+)\\b[^>]*>(.*)<\\/\\1?>/s','$2',\n\t\t\t$_node->ownerDocument->saveXML($_node)\n\t\t);\n\t}", "public function testAddInvalidHTML(string $html)\n {\n (new Dom())->add($html);\n }", "public function doXHTML_cleaning() {}", "public function setContent($editor, $html){\n\t\treturn \"if (tinyMCE.get('\".$editor.\"') == null) {tinyMCE.execCommand('mceAddEditor',0,'\".$editor.\"');} tinyMCE.get('\".$editor.\"').setContent('\".$html.\"');\";\n\t}", "public abstract function cleanHTML($content);", "protected function childNodesToHtml()\n {\n return array_reduce($this->childNodes, function ($html, $childNode) {\n return $html . $childNode->toHtml();\n }, '');\n }" ]
[ "0.6731877", "0.655108", "0.62616074", "0.6237627", "0.5918751", "0.5906924", "0.5657758", "0.5592191", "0.55770046", "0.55665153", "0.5505404", "0.546114", "0.54439807", "0.54349995", "0.5431439", "0.5400031", "0.53781843", "0.5377683", "0.53760046", "0.53624934", "0.5359384", "0.52652365", "0.5239236", "0.52384675", "0.52350354", "0.52336246", "0.5233192", "0.521044", "0.5184499", "0.5182955" ]
0.67978185
0
Alterar dados de SicasConsultaMedica
public function alterar($oSicasConsultaMedica = NULL){ if($oSicasConsultaMedica == NULL){ // recebe dados do formulario $post = DadosFormulario::formSicasConsultaMedica(NULL, 2); // valida dados do formulario $oValidador = new ValidadorFormulario(); if(!$oValidador->validaFormSicasConsultaMedica($post,2)){ $this->msg = $oValidador->msg; return false; } // cria variaveis para validacao com as chaves do array foreach($post as $i => $v) $$i = utf8_encode($v); // cria objeto para grava-lo no BD $oSicasAtendimento = new SicasAtendimento($cd_atendimento); $oSicasMedico = new SicasMedico($cd_medico); $oSicasTipoAtendimento = new SicasTipoAtendimento($cd_tipo_atendimento); $oSicasConsultaMedica = new SicasConsultaMedica($cd_consulta_medica,$oSicasAtendimento,$dt_consulta,$oSicasMedico,$qp_paciente,$exame_fisico,$exame_solicitado,$diag_paciente,$oSicasTipoAtendimento,$resultado,$tratamento,$status); } $oSicasConsultaMedicaBD = new SicasConsultaMedicaBD(); if(!$oSicasConsultaMedicaBD->alterar($oSicasConsultaMedica)){ $this->msg = $oSicasConsultaMedicaBD->msg; return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Alterar() {\n $SQL = \"UPDATE dd_dados_domicilio SET \n IDTIPOLOGRADOURO ='\" . $this->IDTIPOLOGRADOURO . \"',\n NOMELOGRADOURO ='\" . $this->NOMELOGRADOURO . \"',\n NUMDOMICILIO ='\" . $this->NUMDOMICILIO . \"',\n COMPLEMENTO ='\" . $this->COMPLEMENTO . \"',\n BAIRRO ='\" . $this->BAIRRO . \"',\n CEP ='\" . $this->CEP . \"',\n IDESTADO ='\" . $this->IDESTADO . \"',\n IDMUNICIPIO ='\" . $this->IDMUNICIPIO . \"',\n REFERENCIA ='\" . $this->REFERENCIA . \"',\n IDCONSTRUCAO ='\" . $this->IDCONSTRUCAO . \"',\n IDESTCONSERVACAO ='\" . $this->IDESTCONSERVACAO . \"',\n IDUTILIZACAO ='\" . $this->IDUTILIZACAO . \"',\n IDTIPOUSO ='\" . $this->IDTIPOUSO . \"',\n IDESPECIEDOMICILIO ='\" . $this->IDESPECIEDOMICILIO . \"',\n DATAINICIOMORARMUNICIP ='\" . $this->DATAINICIOMORARMUNICIP . \"',\n DATAINICIOMORARDOMICILIO ='\" . $this->DATAINICIOMORARDOMICILIO . \"',\n QUANTCOMODOS ='\" . $this->QUANTCOMODOS . \"',\n QUANTDORMIT ='\" . $this->QUANTDORMIT . \"',\n IDTIPOMATERIALPISOINT ='\" . $this->IDTIPOMATERIALPISOINT . \"',\n IDTIPOMATERIALPAREDEEXT ='\" . $this->IDTIPOMATERIALPAREDEEXT . \"',\n QTAGUACANALIZADA ='\" . $this->QTAGUACANALIZADA . \"',\n IDFORMAABASTECIMENTO ='\" . $this->IDFORMAABASTECIMENTO . \"',\n IDFORMAESCOASANITARIO ='\" . $this->IDFORMAESCOASANITARIO . \"',\n IDDESTINOLIXO ='\" . $this->IDDESTINOLIXO . \"',\n IDILUMINACAOCASA ='\" . $this->IDILUMINACAOCASA . \"',\n VALAGUAESGOTO ='\" . $this->VALAGUAESGOTO . \"',\n VALENERGIA ='\" . $this->VALENERGIA . \"',\n VALALUGUEL ='\" . $this->VALALUGUEL . \"',\n NUMFAMILIAS ='\" . $this->NUMFAMILIAS . \"',\n IDDADOSOLICITANTE ='\" . $this->IDDADOSOLICITANTE . \"'\n WHERE IDDADODOMICILIO='\" . $this->codigo . \"'\";\n\n //die($SQL);\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $con->gtiExecutaSQL($SQL);\n $con->gtiDesconecta();\n }", "protected function alterar(){\n header(\"Content-type: text/html;charset=utf-8\");\n $sql = \"SHOW FULL FIELDS FROM \" . $this->table;\n $execute = conexao::toConnect()->executeS($sql);\n $sets = \"\";\n $id_registro = '';\n $contador = \"\";\n $count = 1;\n foreach ($execute as $contar) {\n if ($contar->Key != 'PRI') {\n $atributos_field = $contar->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n $contador = $contador + 1;\n }\n }\n }\n foreach ($execute as $key => $attr){\n if ($attr->Key != 'PRI') {\n $atributos_field = $attr->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n if ($count != $contador) {\n $sets .= $attr->Field . \" = '\" . $this->$get() . \"',\";\n } else {\n $sets .= $attr->Field . \" = '\" . $this->$get().\"'\";\n }\n $count = $count + 1;\n }\n }else{\n $id_registro = $attr->Field;\n }\n }\n $update = \"UPDATE \".$this->table.\" SET \".$sets.\" WHERE \".$id_registro.\" = \".$this->getIdTable();\n\n $execute_into = conexao::toConnect()->executeQuery($update);\n if (count($execute_into) > 0) {\n return $execute_into;\n }else{\n return false;\n }\n }", "public function modificar($datosCampos) {\n $guardar = new SqlQuery(); //instancio objeto de la clase sqlQuery\n (string) $tabla = get_class($this); //obtengo el nombre de la clase para poder realizar la consulta\n $id = $datosCampos[\"id\"];\n switch ($datosCampos[\"acceso\"]) //cambio los dato que vienen de la vista\n {\n case \"total\":\n $datosCampos[\"acceso\"] = 1;\n break;\n case \"restringido\":\n $datosCampos[\"acceso\"] = 2;\n break;\n default:\n $datosCampos[\"acceso\"] = 0;\n break;\n }\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción \n $arrayCabecera = $guardar->meta($tabla);//armo el array con la cabecera de los datos\n $sentencia = $guardar->armarSentenciaModificar($arrayCabecera, $tabla);//genero sentencia\n $array = $guardar->armarArray($arrayCabecera, $datosCampos);//Armo el array con los datos que vienen de la vista y la cabecera de la BD\n array_shift($array);//elimino primer elemento del array que es el id\n array_push($array, $id);//agrego el id al final del array para realizar la consulta\n $this->refControladorPersistencia->ejecutarSentencia($sentencia, $array);//genero la consulta a la BD \n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit \n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n $respuesta = $this->getUsuario($id);\n return $respuesta;\n }", "public function alterar(){\r\n // recebe dados do formulario\r\n $post = DadosFormulario::formularioCadastroSicasEspecialidadeMedica(2);\r\n // valida dados do formulario\r\n $oValidador = new ValidadorFormulario();\r\n if(!$oValidador->validaFormularioCadastroSicasEspecialidadeMedica($post, 2)){\r\n $this->msg = $oValidador->msg;\r\n return false;\r\n }\r\n // cria variaveis para validacao com as chaves do array\r\n foreach($post as $i => $v) $$i = utf8_encode($v);\r\n \r\n // cria objeto para grava-lo no BD\r\n $oSicasEspecialidadeMedica = new SicasEspecialidadeMedica($cd_especialidade_medica, $nm_especialidade, $status);\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n if(!$oSicasEspecialidadeMedicaBD->alterar($oSicasEspecialidadeMedica)){\r\n $this->msg = $oSicasEspecialidadeMedicaBD->msg;\r\n return false;\r\n }\r\n return true;\r\n }", "public function alterarDados($conexao,$id_pessoa){\n $query = \"update empresa_startup set modelo_negocio = ?,publico_alvo = ?, momento = ?, segmento_principal = ?, segmento_secundario = ?, tamanho_time = ?, faturamento_anual = ? where id_pessoa = ?;\";\n $stmt = $conexao->prepare($query);\n $stmt->execute([$this->getModeloNegocio(),$this->getPublicoAlvo(),$this->getMomento(),$this->getSegmentoPricipal(),$this->getSegmentoSecundario(),$this->getTamanhoTime(),$this->getFaturamentoAnual(),$id_pessoa]);\n }", "protected function migrarDados()\n {\n $serviceDemanda = $this->getService('OrdemServico\\Service\\DemandaFile');\n try {\n $serviceDemanda->begin();\n $arrUsuario = $this->getService('OrdemServico\\Service\\UsuarioFile')->fetchPairs([], 'getNoUsuario', 'getIdUsuario');\n $OrdemSevicoSevice = $this->getService('OrdemServico\\Service\\OrdemServicoDemandaFile');\n $arrDemanda = $serviceDemanda->findBy([], ['id_demanda' => 'asc']);\n $serviceDemanda::setFlush(false);\n foreach ($arrDemanda as $demanda) {\n $intIdUsuario = $arrUsuario[$demanda->getNoExecutor()];\n if ($intIdUsuario) {\n $demanda->setVlComplexidade(null)\n ->setVlImpacto(null)\n ->setVlCriticidade(null)\n ->setVlFatorPonderacao(null)\n ->setVlFacim(null)\n ->setVlQma(null)\n ->setIdUsuario($intIdUsuario);\n $serviceDemanda->getEntityManager()->persist($demanda);\n $arrDemandaServico = $OrdemSevicoSevice->findBy(['id_demanda' => $demanda->getIdDemanda()]);\n if ($arrDemandaServico) {\n $ordemServicoDemanda = reset($arrDemandaServico);\n $ordemServicoDemanda->setIdUsuarioAlteracao($demanda->getIdUsuario())\n ->setDtAlteracao(Date::convertDateTemplate($demanda->getDtAbertura()));\n $OrdemSevicoSevice->getEntityManager()->persist($demanda);\n }\n }\n }\n $serviceDemanda::setFlush(true);\n $serviceDemanda->commit();\n } catch (\\Exception $exception) {\n $serviceDemanda->rollback();\n var_dump($exception->getMessage());\n die;\n }\n }", "public function alterarDadosGerais($conexao,$id_pessoa){\n $query = \"update empresa_startup set nome = ?, razao_social = ?, cnpj = ?, email = ?, data_fundacao = ?, telefone = ? where id_pessoa = ?;\";\n $stmt = $conexao->prepare($query);\n $stmt->execute([$this->getNome(),$this->getRazaoSocial(),$this->getCnpj(),$this->getEmail(),$this->getDataFundacao(),$this->getTelefone(),$id_pessoa]);\n }", "public function update($maeMedico);", "function normalizarCodificacionPlaneServicios($cadenaBusqueda,$cadenaReemplazo) {\n\t\t// Busca y reemplaza ocurrencias en una tabla\n\t\t\t$cnx= conectar_postgres();\n\t\t\t$cons = \"UPDATE ContratacionSalud.PlaneServicios SET nombreplan = replace( nombreplan,'$cadenaBusqueda','$cadenaReemplazo')\";\n\t\t\t\n\t\t\t$res = pg_query($cnx , $cons);\n\t\t\t\tif (!$res) {\n\t\t\t\t\techo \"<p class='error1'> Error en la normalizacion de la codificacion </p>\".pg_last_error().\"<br>\";\n\t\t\t\t\techo \"<p class= 'subtitulo1'>Comando SQL </p> <br>\".$consUTF8.\"<br/> <br/> <br/>\"; \n\t\t\t\t}\n\n\t\t}", "public function atualizar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE MinisterioTemDiscipulo SET \t ministerioId= ? , funcaoId = ?\n WHERE discipuloId = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->ministerioId );\n $stm->bindParam(2, $this->funcaoId );\n $stm->bindParam(3, $this->discipuloId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function atualizar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE MinisterioTemDiscipulo SET \t ministerioId= ? , funcaoId = ?\n WHERE discipuloId = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->ministerioId );\n $stm->bindParam(2, $this->funcaoId );\n $stm->bindParam(3, $this->discipuloId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "private function ajustarDataReporte()\r\n\t\t{\r\n\t\t\tself::setConexion();\r\n\t\t\t$this->_conn->open();\r\n\t\t\t$this->_transaccion = $this->_conn->beginTransaction();\r\n\r\n\t\t\t$tabla = $this->tableName();\r\n\r\n\t\t\t//lapso=2 and ano_impositivo<year(fecha_pago) and impuesto=9 and fecha_pago>='2014-06-01\r\n\t\t\t$sql = \"UPDATE {$tabla} SET codigo=301035900, nombre_impuesto='Deuda Morosa Por Tasas'\r\n\t\t\t WHERE lapso=2 AND ano_impositivo<year(fecha_pago) AND impuesto=9 AND fecha_pago>='2014-06-01'\";\r\n\r\n\t\t\t$result = $this->_conn->createCommand($sql)->execute();\r\n\t\t\tif ( $result ) {\r\n\t\t\t\t$this->_transaccion->commit();\r\n\t\t\t} else {\r\n\t\t\t\t$this->_transaccion->rollBack();\r\n\t\t\t}\r\n\t\t\t$this->_conn->close();\r\n\t\t\treturn $result;\r\n\t\t}", "public function recalcula() {\n\n //Si el cliente no está sujeto a iva\n //pongo el iva a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n $cliente = new Clientes($this->IDCliente);\n if ($cliente->getIva()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Iva\" => 0, \"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n //Si el cliente no está sujeto a recargo de equivalencia\n //lo pongo a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n elseif ($cliente->getRecargoEqu()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n unset($cliente);\n\n //SI TIENE DESCUENTO, CALCULO EL PORCENTAJE QUE SUPONE RESPECTO AL IMPORTE BRUTO\n //PARA REPERCUTUIRLO PORCENTUALMENTE A CADA BASE\n $pordcto = 0;\n if ($this->getDescuento() != 0)\n $pordcto = round(100 * ($this->getDescuento() / $this->getImporte()), 2);\n\n //Calcular los totales, desglosados por tipo de iva.\n $this->conecta();\n if (is_resource($this->_dbLink)) {\n $lineas = new FemitidasLineas();\n $tableLineas = \"{$lineas->getDataBaseName()}.{$lineas->getTableName()}\";\n $articulos = new Articulos();\n $tableArticulos = \"{$articulos->getDataBaseName()}.{$articulos->getTableName()}\";\n unset($lineas);\n unset($articulos);\n\n $query = \"select sum(Importe) as Bruto,sum(ImporteCosto) as Costo from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"')\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $bruto = $rows[0]['Bruto'];\n\n $query = \"select Iva,Recargo, sum(Importe) as Importe from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"') group by Iva,Recargo order by Iva\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $totbases = 0;\n $totiva = 0;\n $totrec = 0;\n $bases = array();\n\n foreach ($rows as $key => $row) {\n $importe = $row['Importe'] * (1 - $pordcto / 100);\n $cuotaiva = round($importe * $row['Iva'] / 100, 2);\n $cuotarecargo = round($importe * $row['Recargo'] / 100, 2);\n $totbases += $importe;\n $totiva += $cuotaiva;\n $totrec += $cuotarecargo;\n\n $bases[$key] = array(\n 'b' => $importe,\n 'i' => $row['Iva'],\n 'ci' => $cuotaiva,\n 'r' => $row['Recargo'],\n 'cr' => $cuotarecargo\n );\n }\n\n $subtotal = $totbases + $totiva + $totrec;\n\n // Calcular el recargo financiero según la forma de pago\n $formaPago = new FormasPago($this->IDFP);\n $recFinanciero = $formaPago->getRecargoFinanciero();\n $cuotaRecFinanciero = $subtotal * $recFinanciero / 100;\n unset($formaPago);\n\n $total = $subtotal + $cuotaRecFinanciero;\n\n //Calcular el peso, volumen y n. de bultos de los productos inventariables\n switch ($_SESSION['ver']) {\n case '0': //Estandar\n $columna = \"Unidades\";\n break;\n case '1': //Cristal\n $columna = \"MtsAl\";\n break;\n }\n $em = new EntityManager($this->getConectionName());\n $query = \"select sum(a.Peso*l.{$columna}) as Peso,\n sum(aVolumen*l.{$columna}) as Volumen,\n sum(Unidades) as Bultos \n from {$tableArticulos} as a,{$tableLineas} as l\n where (l.IDArticulo=a.IDArticulo)\n and (a.Inventario='1')\n and (l.IDFactura='{$this->IDFactura}')\";\n $em->query($query);\n $rows = $em->fetchResult();\n $em->desConecta();\n\n $this->setImporte($bruto);\n $this->setBaseImponible1($bases[0]['b']);\n $this->setIva1($bases[0]['i']);\n $this->setCuotaIva1($bases[0]['ci']);\n $this->setRecargo1($bases[0]['r']);\n $this->setCuotaRecargo1($bases[0]['cr']);\n $this->setBaseImponible2($bases[1]['b']);\n $this->setIva2($bases[1]['i']);\n $this->setCuotaIva2($bases[1]['ci']);\n $this->setRecargo2($bases[1]['r']);\n $this->setCuotaRecargo2($bases[1]['cr']);\n $this->setBaseImponible3($bases[2]['b']);\n $this->setIva3($bases[2]['i']);\n $this->setCuotaIva3($bases[2]['ci']);\n $this->setRecargo3($bases[2]['r']);\n $this->setCuotaRecargo3($bases[2]['cr']);\n $this->setTotalBases($totbases);\n $this->setTotalIva($totiva);\n $this->setTotalRecargo($totrec);\n $this->setRecargoFinanciero($recFinanciero);\n $this->setCuotaRecargoFinanciero($cuotaRecFinanciero);\n $this->setTotal($total);\n $this->setPeso($rows[0]['Peso']);\n $this->setVolumen($rows[0]['Volumen']);\n $this->setBultos($rows[0]['Bultos']);\n\n $this->save();\n }\n }", "public function desenfocarCamaraAlumnos1() {\n\n self::$alumnos1->desenfocar();\n\n }", "public function alterarResponsavel($idPessoaResponsavel, Responsavel $responsavel) {\n $obj_conecta = new bd();\n $obj_conecta->conecta();\n $obj_conecta->seleciona_bd();\n\n //echo \"<br> Chegou no metodo IdPessoaResponsavel = [\".$idPessoaResponsavel.\"] <br><br>\";\n\n $sql = \"UPDATE `sigar`.`responsavel` SET `categoria` = '\" . $responsavel->getCategoria() . \"', `telefoneTrabalho` = '\" . $responsavel->getTelTrabalho() . \"' WHERE `responsavel`.`idPessoa` =\" . $idPessoaResponsavel . \";\";\n\n $alteraTabResponsavel = mysql_query($sql);\n if ($alteraTabResponsavel) {\n //echo \"<br> Tabela RESPONSAVEL alterado com sucesso <br>\";\n } else {\n //echo \"<br> ERRO alteração tabela RESPONSAVEL <br>\"; \n }\n\n\n $sql = \"UPDATE `pessoa` SET `nome` = '\" . $responsavel->getNome() . \"', `email` = '\" . $responsavel->getEmail() . \"', `telefoneResidencial` = '\" . $responsavel->getTelefoneResidencial() . \"', \n `telefoneCelular` = '\" . $responsavel->getCelular() . \"', `sexo` = '\" . $responsavel->getSexo() . \"', `dataNascimento` = '\" . $responsavel->getNascimento() . \"', `cpf` = '\" . $responsavel->getCpf() . \"' WHERE `pessoa`.`idPessoa` = \" . $idPessoaResponsavel . \";\";\n\n $alteraTabPessoaResp = mysql_query($sql);\n if ($alteraTabPessoaResp) {\n //echo \" <br> Tabela PESSOARESPONSAVEL alterado com sucesso <br>\";\n } else {\n //echo \"<br> EROO alteração tabela PESSOARESPONSAVEL <br>\"; \n }\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "function AlterarADM($id) {\n// if($this->GetClienteCPF($this->getCli_cpf())>0 && $this->getCli_cpf() != $_REQUEST['CLI']['cli_cpf']):\n// echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este CPF já esta cadastrado ';\n// Sistema::VoltarPagina();\n// echo '</div>';\n// exit();\n// endif;\n \n //se o email for diferente da sessao----------------------\n// if($this->GetClienteEmail($this->getCli_email())>0 && $this->getCli_email() != $_REQUEST['CLI']['cli_email']):\n// echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este Email já esta cadastrado ';\n// Sistema::VoltarPagina();\n// echo '</div>';\n// exit();\n// endif;\n \n \n \n //Caso passou na verificação os dados serão gravados no banco-------------------------\n $query = \"UPDATE \".$this->prefix.\"clientes SET cli_nome=:cli_nome,\n cli_sobrenome=:cli_sobrenome,\n cli_data_nasc=:cli_data_nasc,\n cli_rg=:cli_rg,\n cli_cpf=:cli_cpf,\n cli_ddd=:cli_ddd,\n cli_fone=:cli_fone,\n cli_celular=:cli_celular,\n cli_endereco=:cli_endereco,\n cli_numero=:cli_numero,\n cli_bairro=:cli_bairro,\n cli_cidade=:cli_cidade,\n cli_uf=:cli_uf,\n cli_cep=:cli_cep,\n cli_email=:cli_email \n WHERE cli_id =:cli_id\";\n \n \n $params = array(\n ':cli_nome'=> $this->getCli_nome(),\n ':cli_sobrenome'=> $this->getCli_sobrenome(),\n ':cli_data_nasc'=> $this->getCli_data_nasc(),\n ':cli_rg'=> $this->getCli_rg(),\n ':cli_cpf'=> $this->getCli_cpf(),\n ':cli_ddd'=> $this->getCli_ddd(),\n ':cli_fone'=> $this->getCli_fone(),\n ':cli_celular'=> $this->getCli_celular(),\n ':cli_endereco'=> $this->getCli_endereco(),\n ':cli_numero'=> $this->getCli_numero(),\n ':cli_bairro'=> $this->getCli_bairro(),\n ':cli_cidade'=> $this->getCli_cidade(),\n ':cli_uf'=> $this->getCli_uf(),\n ':cli_cep'=> $this->getCli_cep(),\n ':cli_email'=> $this->getCli_email(),\n \n ':cli_id' => (int)$id\n \n \n );\n \n //echo $query;\n \n \n if($this->ExecuteSQL($query, $params)):\n return true;\n else:\n return false;\n endif;\n \n \n }", "function setDeleteSocio(){\n\t\t$socio\t\t= $this->mCodigo;\n\t\t$msg \t\t= \"\";\n\t\t$msg \t\t.= \"================== ELIMINANDO UN NUMERO DE SOCIO \\r\\n\";\n\t\t$msg \t\t.= \"================== SOCIO $socio \\r\\n\";\n\t\t$xRuls\t= new cReglaDeNegocio();\n\t\t$xRuls->reglas()->RN_ELIMINAR_PERSONA;\t\t\n\t\t/**\n\t\t * Elimina un socio de las Tabla de Socios\n\t\t */\n\t\t//Eliminar Socio\n\t\t$sqlD[] = \"DELETE FROM socios_general WHERE codigo=$socio \";\n\t\t//Eliminar Relaciones\n\t\t$sqlD[] = \"DELETE FROM socios_relaciones WHERE socio_relacionado=$socio \";\n\t\t//Eliminar\n\t\t$sqlD[] = \"DELETE FROM socios_vivienda WHERE socio_numero=$socio \";\n\t\t//Eliminar actividad economica\n\t\t$sqlD[] = \"DELETE FROM socios_aeconomica WHERE socio_aeconomica=$socio \";\n\t\t//Eliminar Patrimonio\n\t\t$sqlD[] = \"DELETE FROM socios_patrimonio WHERE socio_patrimonio=$socio \";\n\t\t$sqlD[]\t= \"DELETE FROM creditos_solicitud WHERE numero_socio = $socio \";\n\t\t\n\t\t$sqlD[]\t= \"DELETE FROM captacion_cuentas WHERE numero_socio = $socio \";\n\t\t$sqlD[]\t= \"DELETE FROM captacion_sdpm_historico WHERE numero_de_socio = $socio \";\n\t\t$sqlD[]\t= \"DELETE FROM creditos_flujoefvo WHERE socio_flujo = $socio \";\n\t\t$sqlD[]\t= \"DELETE FROM creditos_garantias WHERE socio_garantia = $socio \";\n\t\t$sqlD[]\t= \"DELETE FROM creditos_lineas WHERE numero_socio = $socio \";\n\t\t\n\t\t//Eliminar Memos\n\t\t$sqlD[] = \"DELETE FROM socios_memo WHERE numero_socio=$socio \";\n\t\t$sqlD[] = \"DELETE FROM operaciones_mvtos WHERE socio_afectado =$socio \";\n\t\t$sqlD[] = \"DELETE FROM operaciones_recibos WHERE numero_socio =$socio \";\n\t\t//Nuevos\n\t\t$sqlD[] = \"DELETE FROM socios_baja WHERE numero_de_socio = $socio\";\n\t\t//creditos\n\t\t$sqlD[]\t= \"DELETE FROM creditos_parametros_negociados \t\t\t\t\t\tWHERE numero_de_socio=$socio\";\n\t\t$sqlD[]\t= \"DELETE FROM creditos_sdpm_historico \t\t\t\t\t\t\t\tWHERE numero_de_socio = $socio \";\n\t\t\n\t\t$sqlD[]\t= \"DELETE FROM `seguimiento_compromisos` \t\t\t\t\t\t\tWHERE `socio_comprometido`=$socio\";\n\t\t$sqlD[]\t= \"DELETE FROM `seguimiento_llamadas` \t\t\t\t\t\t\t\tWHERE `numero_socio`=$socio\";\n\t\t$sqlD[]\t= \"DELETE FROM `seguimiento_notificaciones` \t\t\t\t\t\tWHERE `socio_notificado`=$socio\";\n\n\t\t$sqlD[]\t= \"DELETE FROM `socios_memo` \t\t\t\t\t\t\t\t\t\tWHERE `numero_socio`=$socio\";\n\t\t$sqlD[]\t= \"DELETE FROM `socios_otros_parametros`\t\t\t\t\t\t\tWHERE `clave_de_persona`=$socio\";\n\t\t\n\t\t$sqlD[]\t= \"DELETE FROM `personas_documentacion`\t\t\t\t\t\t\tWHERE `clave_de_persona`=$socio\";\n\t\t$sqlD[]\t= \"DELETE FROM `personas_perfil_transaccional`\t\t\t\t\t\tWHERE `clave_de_persona`=$socio\";\n\t\t\n\t\t$sqlD[]\t= \"UPDATE contable_polizas_proforma SET socio=\" . DEFAULT_SOCIO . \" WHERE socio=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `usuarios_web_notas` SET `socio`=\" . DEFAULT_SOCIO . \" \tWHERE `socio`=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `socios_aeconomica_dependencias` SET `clave_de_persona`\t\t=\" . DEFAULT_SOCIO . \" \tWHERE `clave_de_persona`=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `socios_grupossolidarios` SET `representante_numerosocio`\t\t=\" . DEFAULT_SOCIO . \" \tWHERE `representante_numerosocio`=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `socios_grupossolidarios` SET `vocalvigilancia_numerosocio`\t=\" . DEFAULT_SOCIO . \" WHERE `vocalvigilancia_numerosocio`=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `socios_grupossolidarios` SET `clave_de_persona`\t\t=\" . DEFAULT_SOCIO . \" \tWHERE `clave_de_persona`=$socio\";\n\t\t\n\t\t$sqlD[]\t= \"UPDATE `aml_alerts` SET `persona_de_destino`\t=\" . DEFAULT_SOCIO . \" WHERE `persona_de_destino`=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `aml_alerts` SET `persona_de_origen`\t=\" . DEFAULT_SOCIO . \" WHERE `persona_de_origen`=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `aml_risk_register` SET `persona_relacionada`\t=\" . DEFAULT_SOCIO . \" WHERE `persona_relacionada`=$socio\";\n\t\t$sqlD[]\t= \"UPDATE `bancos_operaciones` SET `numero_de_socio`\t=\" . DEFAULT_SOCIO . \" WHERE `numero_de_socio`=$socio\";\n\t\t\n\t\t$sqlD[]\t= \" UPDATE creditos_solicitud SET persona_asociada = \" . DEFAULT_SOCIO . \" WHERE persona_asociada = $socio \";\n\t\t$sqlD[]\t= \" UPDATE `t_03f996214fba4a1d05a68b18fece8e71` SET `codigo_de_persona` = \" . DEFAULT_SOCIO . \" WHERE `codigo_de_persona` = $socio \";\n\t\t$sqlD[]\t= \" UPDATE `tesoreria_cajas_movimientos` SET `persona` = \" . DEFAULT_SOCIO . \" WHERE `persona` = $socio \";\n\t\t$sqlD[]\t= \" UPDATE `socios_relaciones` SET `numero_socio` = \" . DEFAULT_SOCIO . \" WHERE `numero_socio` = $socio \";\n\t\t\n\t\t$sqlD[]\t= \" UPDATE `general_sucursales` SET `clave_de_persona` = \" . DEFAULT_SOCIO . \" WHERE `clave_de_persona` = $socio \";\n\t\t$sqlD[]\t= \" UPDATE `operaciones_recibos` SET `persona_asociada` = \" . DEFAULT_SOCIO . \" WHERE `persona_asociada` = $socio \";\n\t\t$sqlD[]\t= \" UPDATE `socios_aeconomica_dependencias` SET `clave_de_persona` = \" . DEFAULT_SOCIO . \" WHERE `clave_de_persona` = $socio \";\n\t\t\n\t\t//$sqlD[] = \" UPDATE operaciones_mvtos SET socio_afectado = \" . DEFAULT_SOCIO . \" WHERE socio_afectado =$socio \";\n\t\t//$sqlD[] = \" UPDATE operaciones_recibos SET numero_socio = \" . DEFAULT_SOCIO . \" WHERE numero_socio =$socio \";\n\t\t//\n\t\t\n\t\t//Cambiar referencias, garantias\n\t\tforeach ($sqlD as $key => $send){\n\t\t\t$x\t= my_query($send);\n\t\t\t$msg\t.= $x[SYS_INFO];\n\t\t}\n\t\treturn $msg;\n\t}", "public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sSqlSubsidio = \"select c16_mes, \";\n $sSqlSubsidio .= \" c16_ano,\";\n $sSqlSubsidio .= \" c16_subsidiomensal,\";\n $sSqlSubsidio .= \" c16_subsidioextraordinario,\";\n $sSqlSubsidio .= \" z01_nome, \";\n $sSqlSubsidio .= \" z01_cgccpf \";\n $sSqlSubsidio .= \" from padsigapsubsidiosvereadores \"; \n $sSqlSubsidio .= \" inner join cgm on z01_numcgm = c16_numcgm \"; \n $sSqlSubsidio .= \" where c16_ano = {$iAno} \";\n $sSqlSubsidio .= \" and c16_mes <= $iMes\"; \n $sSqlSubsidio .= \" and c16_instit = {$sListaInstit}\";\n $sSqlSubsidio .= \" order by c16_ano, c16_mes\";\n $rsSubsidio = db_query($sSqlSubsidio); \n $iTotalLinhas = pg_num_rows($rsSubsidio);\n for ($i = 0; $i < $iTotalLinhas; $i++) {\n \n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n $oSubSidio = db_utils::fieldsMemory($rsSubsidio, $i);\n \n $oRetorno = new stdClass();\n $oRetorno->subCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oRetorno->subMesAnoMovimento = $sDiaMesAno;\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oSubSidio->c16_mes, $oSubSidio->c16_ano); \n $oRetorno->subMesAnoReferencia = $oSubSidio->c16_ano.\"-\".str_pad($oSubSidio->c16_mes, 2, \"0\", STR_PAD_LEFT).\"-\".\n str_pad($iUltimoDiaMes, 2, \"0\", STR_PAD_LEFT);\n $oRetorno->subNomeVereador = substr($oSubSidio->z01_nome, 0, 80); \n $oRetorno->subCPF = str_pad($oSubSidio->z01_cgccpf, 11, \"0\", STR_PAD_LEFT); \n $oRetorno->subMensal = $this->corrigeValor($oSubSidio->c16_subsidiomensal, 13); \n $oRetorno->subExtraordinario = $this->corrigeValor($oSubSidio->c16_subsidioextraordinario, 13); \n $oRetorno->subTotal = $this->corrigeValor(($oSubSidio->c16_subsidioextraordinario+\n $oSubSidio->c16_subsidiomensal), 13);\n array_push($this->aDados, $oRetorno); \n }\n return true;\n }", "public function alterar($oSicasAtendimento = NULL){\r\n\t\tif($oSicasAtendimento == NULL){\r\n\t\t\t// recebe dados do formulario\r\n\t\t\t$post = DadosFormulario::formSicasAtendimento(NULL, 2);\t\t\r\n\t\t\t// valida dados do formulario\r\n\t\t\t$oValidador = new ValidadorFormulario();\r\n\t\t\tif(!$oValidador->validaFormSicasAtendimento($post,2)){\r\n\t\t\t\t$this->msg = $oValidador->msg;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// cria variaveis para validacao com as chaves do array\r\n\t\t\tforeach($post as $i => $v) $$i = utf8_encode($v);\r\n\t\t\t// cria objeto para grava-lo no BD\r\n\t\t\t$oSicasMedico = new SicasMedico($cd_medico);\r\n\t\t\t$oSicasPessoa = new SicasPessoa($cd_pessoa);\n\t\t\t$oSicasAtendimento = new SicasAtendimento($cd_atendimento, $oSicasPessoa, $dt_ini_atendimento, $dt_fim_atendimento, $oSicasMedico, $status);\r\n\t\t}\t\t\r\n\t\t$oSicasAtendimentoBD = new SicasAtendimentoBD();\r\n\t\tif(!$oSicasAtendimentoBD->alterar($oSicasAtendimento)){\r\n\t\t\t$this->msg = $oSicasAtendimentoBD->msg;\r\n\t\t\treturn false;\t\r\n\t\t}\t\t\r\n\t\treturn true;\t\t\r\n\t}", "public function alterarRede($conexao,$id_pessoa){\n $query = \"update empresa_startup set website = ?,linkedin = ?, facebook = ?, app_store = ?, google_play = ?, youtube = ?, instagram = ? where id_pessoa = ?;\";\n $stmt = $conexao->prepare($query);\n $stmt->execute([$this->getWebsite(),$this->getLinkedin(),$this->getFacebook(),$this->getAppStore(),$this->getGooglePlay(),$this->getYoutube(),$this->getInstagram(),$id_pessoa]);\n }", "function modificarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_ime';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t\r\n\t\t$parametros = $this->aParam->getArregloParametros('asignacion');\r\n\t\t//si esdel tipo matriz verifica en la primera posicion el tipo de vista\r\n\t\tif($this->esMatriz){\r\n\t\t $tipo_operacion =$parametros[0]['tipo_operacion'];\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$tipo_operacion =$parametros['tipo_operacion'];\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif($tipo_operacion=='asignacion'){\r\n\t\t $this->transaccion='tgv_SERVIC_MOD';\r\n } \r\n elseif($tipo_operacion=='cambiar_estado'){ \r\n\t\t $this->transaccion='tgv_SERCAMEST_MOD';\r\n\t\t $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\telseif ($tipo_operacion=='def_fechas'){ \r\n\t\t $this->transaccion='tgv_DEFFECHA_MOD';\r\n\t\t // $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_servicio','id_servicio','int4');\r\n\t\t$this->setParametro('estado','estado','varchar');\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('id_lugar_destino','id_lugar_destino','int4');\r\n\t\t$this->setParametro('id_ep','id_ep','int4');\r\n\t\t$this->setParametro('fecha_asig_fin','fecha_asig_fin','date');\r\n\t\t$this->setParametro('fecha_sol_ini','fecha_sol_ini','date');\r\n\t\t$this->setParametro('descripcion','descripcion','varchar');\r\n\t\t$this->setParametro('id_lugar_origen','id_lugar_origen','int4');\r\n\t\t$this->setParametro('cant_personas','cant_personas','int4');\r\n\t\t$this->setParametro('fecha_sol_fin','fecha_sol_fin','date');\r\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\r\n\t\t$this->setParametro('fecha_asig_ini','fecha_asig_ini','date');\r\n\t\t$this->setParametro('id_funcionario_autoriz','id_funcionario_autoriz','int4');\r\n\t\t$this->setParametro('observaciones','observaciones','varchar');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function editarProducto($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"UPDATE producto set nombre='$datos[0]',descripcion='$datos[1]',imagen='$datos[2]', \n codigo_categoria='$datos[3]', stock='$datos[4]', precio='$datos[5]' WHERE id='$datos[6]'\";\n return $result= mysqli_query($conexion, $sql);\n }", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "function registrarMedicacion($dosis,$hora,$viaAdministracion,$cantidadUnidades,$idDetalleKit,$idHistoriaClinica){\n $sql = \"insert into tbl_medicamento(dosis,hora,viaAdministracion,cantidadUnidades,idDetalleKit,idHistoriaClinica) values(:dosis,:hora,:viaAdministracion,:cantidadUnidades,:idDetalleKit,:idHistoriaClinica);\";\n // \"CALL spRegistrarMedicacionDmc\";\n $query = $this->_CONEXION->prepare($sql);\n $query->bindParam(\":dosis\",$dosis,PDO::PARAM_STR);\n $query->bindParam(\":hora\",$hora,PDO::PARAM_STR);\n $query->bindParam(\":viaAdministracion\",$viaAdministracion,PDO::PARAM_STR);\n $query->bindParam(\":cantidadUnidades\",$cantidadUnidades,PDO::PARAM_STR);\n $query->bindParam(\":idDetalleKit\",$idDetalleKit,PDO::PARAM_STR);\n $query->bindParam(\":idHistoriaClinica\",$idHistoriaClinica,PDO::PARAM_STR);\n $query->execute();\n $sql = \"update tbl_detallekit dt1,(select cantidadFinal-:cantidadUnidades as nuevaCantidad from tbl_detallekit where idDetallekit = :idDetalleKit)as dt2 set dt1.cantidadFinal = dt2.nuevaCantidad where idDetallekit = :idDetalleKit;\";\n //\"CALL spActualizarMedicacionDmc\";\n $query = $this->_CONEXION->prepare($sql);\n $query->bindParam(\":cantidadUnidades\",$cantidadUnidades,PDO::PARAM_INT);\n $query->bindParam(\":idDetalleKit\",$idDetalleKit,PDO::PARAM_STR);\n $query->execute();\n }", "function ActuzalizarMascotas($nombre_mascota, $idgenero, $idraza, $sexo, $tipo_sangre, $color, $fecha_creo, $usuario_creo){\n $conexion = Conectar();\n $sql = \"UPDATE mascotas SET nombre_mascota=:nombre_mascota and idgenero=:idgenero and idraza=:idraza and sexo=:sexo and tipo_sangre=:tipo_sangre and color=:color and fecha_creo=:fecha_creo and usuario_creo=:usuario_creo\";\n $statement = $conexion->prepare($sql);\n $statement->bindParam(':nombre_mascota', $nombre_mascota);\n $statement->bindParam(':idgenero', $idgenero);\n $statement->bindParam(':idraza', $idraza);\n $statement->bindParam(':sexo', $sexo);\n $statement->bindParam(':tipo_sangre', $tipo_sangre);\n $statement->bindParam(':color', $color);\n $statement->bindParam(':fecha_creo', $fecha_creo);\n $statement->bindParam(':usuario_creo', $usuario_creo);\n $statement->execute();\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $res=$statement->fetchAll();\n return $res;\n}", "function modificarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_maquinaria','id_maquinaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function establecer_m2_reservas_concretadas() {\n// inner join lote on (res_lot_id=lot_id)\n// inner join zona on (lot_zon_id=zon_id)\n// where res_promotor like 'NET%'\");\n// $reservas = FUNCIONES::lista_bd_sql(\"select res_id,zon_precio from reserva_terreno\n// inner join lote on (res_lot_id=lot_id)\n// inner join zona on (lot_zon_id=zon_id)\n// where res_multinivel = 'si' and res_monto_m2=0\");\n\n\n\n $reservas = FUNCIONES::lista_bd_sql(\"select res_id,ven_metro from reserva_terreno\n\n inner join venta on (ven_res_id=res_id)\n\n where res_monto_m2=0 and res_estado in ('Concretado') and ven_estado in ('Pendiente','Pagado')\");\n\n\n\n $conec = new ADO();\n\n foreach ($reservas as $res) {\n\n $conec->ejecutar(\"update reserva_terreno set res_monto_m2=$res->ven_metro where res_id=$res->res_id\");\n }\n}", "static public function mdlEditarServicios($tabla, $datos){\n$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET nombre_servicio = :nombre_servicio, precio = :precio\n WHERE id = :id\");\n\n\t\t$stmt->bindParam(\":id\", $datos[\"id\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":nombre_servicio\", $datos[\"nombre_servicio\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":precio\", $datos[\"precio\"], PDO::PARAM_INT);\n\t\t\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function alterFotoFisi($conexao, $foto_coment, $foto_nome, $foto_tel, $foto_cel, $foto_cpf, $foto_end, $foto_num, $foto_estado, $foto_cidade, $foto_email, $foto_especi, $foto_img,$foto_emp='', $foto_cep=''){\n\t\techo \"<br/>Dentro do foto_especi: \".print_r($foto_especi).\"<br/>\";\n\n\t\t$sql_update = sprintf(\"\n\t\t\t\tupdate fotografo f, fotografo_fisico fs, localizacao_foto lf\n\t\t\t\tset f.foto_comentario = '%s', f.foto_img_perf = '%s',\n\t\t\t\t fs.foto_fisi_nome = '%s', fs.foto_fisi_tel = '%s', fs.foto_fisi_cel = '%s', fs.foto_fisi_cpf = '%s',\n\t\t\t\t lf.loca_end_foto = '%s',lf.loca_num_foto = '%s', lf.loca_estado_foto = %u, lf.loca_cidade_foto = %u,\n\t\t\t\t fs.foto_fisi_nome_emp = '%s', lf.loca_cep_foto = '%s'\n\t\t\t\twhere f.foto_cod = fs.foto_cod\n\t\t\t\tand f.foto_cod\t = lf.foto_cod\n\t\t\t\tand fs.foto_fisi_email = '%s' \", $foto_coment, $foto_img,$foto_nome, $foto_tel, $foto_cel, $foto_cpf, $foto_end, $foto_num, $foto_estado, $foto_cidade, $foto_emp, $foto_cep, $foto_email);\n\t\t$resultado_update = mysqli_query($conexao, $sql_update) or die(mysqli_error($conexao).\"<br/>\".$sql_update);\n\t\t$resulUpEspeci \t = atualizarEspecialidadeFotografo($conexao,$foto_email,$foto_especi);\n\n\t\tif($resultado_update){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t}" ]
[ "0.6761109", "0.6747411", "0.66255254", "0.6487145", "0.64740616", "0.6313572", "0.6304311", "0.62440556", "0.6227445", "0.6141292", "0.6141292", "0.61313254", "0.61217004", "0.60833186", "0.6046655", "0.5988509", "0.5977099", "0.59689313", "0.5963143", "0.5945785", "0.5943795", "0.5942563", "0.59338844", "0.59276533", "0.5925792", "0.5919356", "0.59187996", "0.59138036", "0.5912843", "0.5909516" ]
0.70868915
0
Consultar registros de SicasConsultaMedica
public function consultar($valor){ $oSicasConsultaMedicaBD = new SicasConsultaMedicaBD(); return $oSicasConsultaMedicaBD->consultar($valor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function consultar($valor){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->consultar($valor);\r\n }", "public function consultar_asistencia()\n\t{\n\t\t$this->seguridad_lib->acceso_metodo(__METHOD__);\n\n\t\t$datos['titulo_contenedor'] = 'Reportes';\n\t\t$datos['titulo_descripcion'] = 'Consultar asistencia';\n\t\t$datos['contenido'] = 'reportes/consulta_asistencia_form';\n\n\t\t$datos['form_action'] = 'Reportes/registros_asistencia';\n\n\t\t$datos['e_footer'][] = array('nombre' => 'DatePicker JS','path' => base_url('assets/datepicker/dist/js/bootstrap-datepicker.js'), 'ext' =>'js');\n\t\t$datos['e_footer'][] = array('nombre' => 'DatePicker Languaje JS','path' => base_url('assets/datepicker/dist/locales/bootstrap-datepicker.es.min.js'), 'ext' =>'js');\n\t\t$datos['e_header'][] = array('nombre' => 'DatePicker CSS','path' => base_url('assets/datepicker/dist/css/bootstrap-datepicker3.min.css'), 'ext' =>'css');\n\n\t\t$datos['e_footer'][] = array('nombre' => 'jQuery Validate','path' => base_url('assets/jqueryvalidate/dist/jquery.validate.js'), 'ext' =>'js');\n\t\t$datos['e_footer'][] = array('nombre' => 'jQuery Validate Language ES','path' => base_url('assets/jqueryvalidate/dist/localization/messages_es.js'), 'ext' =>'js');\n\n\t\t$datos['e_footer'][] = array('nombre' => 'Config Form JS','path' => base_url('assets/js/reportes/v_consultar_asistencia_form.js'), 'ext' =>'js');\n\n\t\t$this->template_lib->render($datos);\n\t}", "public function buscarEstudiante() {\n\n $sql = \"SELECT D.tipodocumento, D.nombrecortodocumento, E.codigocarrera,\n EG.numerodocumento, EG.idestudiantegeneral, EG.nombresestudiantegeneral, \n EG.apellidosestudiantegeneral, EG.expedidodocumento, EG.codigogenero, \n EG.ciudadresidenciaestudiantegeneral, EG.fechanacimientoestudiantegeneral, EG.direccionresidenciaestudiantegeneral, \n EG.telefonoresidenciaestudiantegeneral, EG.emailestudiantegeneral, D.nombredocumento\n\t\tFROM \n estudiantegeneral EG\n\t\tINNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n\t\tINNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n\t\tWHERE\n E.codigoestudiante = ? \";\n /* FIN MODIFICACION */\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n $this->setFechaNacimiento($this->persistencia->getParametro(\"fechanacimientoestudiantegeneral\"));\n $this->setDireccion($this->persistencia->getParametro(\"direccionresidenciaestudiantegeneral\"));\n $this->setTelefono($this->persistencia->getParametro(\"telefonoresidenciaestudiantegeneral\"));\n $this->setEmail($this->persistencia->getParametro(\"emailestudiantegeneral\"));\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n $this->setCarrera($carrera);\n\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n $tipoDocumento->setNombreDocumento($this->persistencia->getParametro(\"nombredocumento\"));\n\n $genero = new Genero(null);\n $genero->setCodigo($this->persistencia->getParametro(\"codigogenero\"));\n\n $ciudad = new Ciudad(null);\n $ciudad->setId($this->persistencia->getParametro(\"ciudadresidenciaestudiantegeneral\"));\n\n $this->setCiudad($ciudad);\n $this->setGenero($genero);\n $this->setTipoDocumento($tipoDocumento);\n }\n\n $this->persistencia->freeResult();\n }", "public function buscarEstudianteAcuerdo() {\n\n $sql = \"SELECT \n D.tipodocumento, D.nombrecortodocumento, EG.numerodocumento, EG.idestudiantegeneral,\n EG.nombresestudiantegeneral, EG.apellidosestudiantegeneral, EG.expedidodocumento, C.codigocarrera\n FROM \n estudiantegeneral EG\n INNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n INNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n INNER JOIN carrera C ON ( C.codigocarrera = E.codigocarrera )\n INNER JOIN FechaGrado FG ON ( FG.CarreraId = C.codigocarrera )\n INNER JOIN AcuerdoActa A ON ( A.FechaGradoId = FG.FechaGradoId )\n INNER JOIN DetalleAcuerdoActa DAC ON ( DAC.AcuerdoActaId = A.AcuerdoActaId AND E.codigoestudiante = DAC.EstudianteId )\n WHERE\n E.codigoestudiante = ?\n AND D.CodigoEstado = 100\n AND DAC.EstadoAcuerdo = 0\n AND DAC.CodigoEstado = 100\";\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n\n $fechaGrado = new FechaGrado(null);\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n\n $fechaGrado->setCarrera($carrera);\n\n $this->setTipoDocumento($tipoDocumento);\n\n $this->setFechaGrado($fechaGrado);\n }\n\n $this->persistencia->freeResult();\n }", "private function iniciarRecolectarData()\r\n\t\t{\r\n\t\t\tself::findPagoDetalleActividadEconomica();\r\n\t\t\tself::findPagoDetalleInmuebleUrbano();\r\n\t\t\tself::findPagoDetalleVehiculo();\r\n\t\t\tself::findPagoDetalleAseo();\r\n\t\t\tself::findPagoDetallePropaganda();\r\n\t\t\tself::findPagoDetalleEspectaculo();\r\n\t\t\tself::findPagoDetalleApuesta();\r\n\t\t\tself::findPagoDetalleVario();\r\n\t\t\tself::findPagoDetalleMontoNegativo();\r\n\t\t\tself::ajustarDataReporte();\r\n\t\t}", "function consulta_registro_ventas_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=2\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED)\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function obtener_facultades (){\n \n //$nombre_usuario=toba::usuario()->get_nombre();\n //$sql=\"SELECT t_s.sigla FROM sede t_s, administrador t_a WHERE t_a.nombre_usuario=$nombre_usuario AND t_s.id_sede=t_a.id_sede\";\n //$sql=\"SELECT t_ua.sigla, t_ua.descripcion FROM unidad_academica t_ua, sede t_s JOIN administrador t_a ON (t_a.nombre_usuario=$nombre_usuario) JOIN (t_a.id_sede=t_s.id_sede) WHERE t_s.sigla=t_ua.id_sede\";\n $sql=\"SELECT sigla, descripcion FROM unidad_academica WHERE sigla <> 'RECT'\";\n return toba::db('gestion_aulas')->consultar($sql);\n \n }", "public function consulta_asistencia()\n {\n $fecha_reporte = cambiaf_a_mysql($this->txt_fecha_desde->Text);\n $dir = $this->drop_direcciones->SelectedValue;\n $cod_organizacion = usuario_actual('cod_organizacion');\n\n // se obtienen las justificaciones del día seleccionado\n $sql=\"SELECT (p.cedula) as cedula_just, p.nombres, p.apellidos, j.codigo, jd.fecha_desde, jd.hora_desde,\n jd.fecha_hasta, jd.hora_hasta, jd.observaciones, jd.lun, jd.mar, jd.mie, jd.jue, jd.vie,\n tf.descripcion as descripcion_falta, tj.descripcion as descripcion_tipo_justificacion\n\t\t\t\t\t FROM asistencias.justificaciones as j, asistencias.justificaciones_dias as jd,\n\t\t\t\t\t\t asistencias.justificaciones_personas as jp, organizacion.personas as p, organizacion.personas_nivel_dir as n, asistencias.tipo_faltas tf, asistencias.tipo_justificaciones tj\n\t\t\t\t\t\tWHERE ((p.cedula = jp.cedula) and\n\t\t\t\t\t\t (p.cedula = n.cedula) and (jd.codigo_tipo_falta = tf.codigo) and (tj.id = jd.codigo_tipo_justificacion) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t (jd.fecha_desde <= '$fecha_reporte') and\n\t\t\t\t\t\t\t (jd.fecha_hasta >= '$fecha_reporte') and\n\t\t\t\t\t\t\t (j.estatus='1') and (j.codigo=jd.codigo_just) and (j.codigo=jp.codigo_just))\n\t\t\t\t\t\tORDER BY p.nombres, p.apellidos, jp.cedula \";\n $this->justificaciones=cargar_data($sql,$this); \n\n // se obtiene el horario vigente para la fecha seleccionada\n $this->horario_vigente = obtener_horario_vigente($cod_organizacion,$fecha_reporte,$this);\n \n // se realizan las consultas para mostrar los listados\n // Se consultan los asistentes\n $sql=\"SELECT (p.cedula) as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre,\n e.cedula, e.fecha, MIN(e.hora) as entrada, MAX(e.hora) as salida\n FROM asistencias.entrada_salida as e, organizacion.personas as p, organizacion.personas_nivel_dir as n\n WHERE ((p.cedula = e.cedula) and\n (p.cedula = n.cedula) and\n (n.cod_direccion LIKE '$dir%') and\n (p.fecha_ingreso <= '$fecha_reporte') and\n (e.fecha <= '$fecha_reporte') and\n (e.fecha >= '$fecha_reporte'))\n GROUP BY e.cedula\n ORDER BY entrada, p.nombres, p.apellidos \";\n $this->asistentes=cargar_data($sql,$this);\n $this->ind_asistentes = count($this->asistentes);\n\n // se consultan los inasistentes\n $sql2=\"SELECT p.cedula as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre\n\t\t\t\t\t\t\t\t\t FROM organizacion.personas as p, asistencias.personas_status_asistencias as s,\n\t\t\t\t\t\t\t\t\t organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t WHERE ((s.status_asistencia = '1') and\n\t\t\t\t\t\t\t\t\t \t\t (s.cedula = p.cedula) and\n\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t (p.cedula not in\n\t\t\t\t\t\t\t\t\t (SELECT e.cedula\n\t\t\t\t\t\t\t\t\t\t FROM asistencias.entrada_salida as e, organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t\t \t WHERE ((e.fecha = '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%'))\n\t\t\t\t\t\t\t\t\t\t\t GROUP BY e.cedula)))\n\t\t\t\t\t\t\t\t\t ORDER BY p.nombres, p.apellidos\";\n $this->inasistentes=cargar_data($sql2,$this);\n\n\n // Se consultan los asistentes para comparar inconsistencia de horas en el marcado\n // Si le falta hora\n $inconsistentes = array();\n foreach($this->asistentes as $arreglo){\n \n $sql2=\"SELECT COUNT(*) as n_horas FROM asistencias.entrada_salida as e\n\t\t\t WHERE e.fecha = '$fecha_reporte' AND e.cedula = '$arreglo[cedula_integrantes]' \";\n $resultado2=cargar_data($sql2,$this);\n if(!empty($resultado2)){\n if ($resultado2[0][n_horas]%2!=0) {//impar\n array_unshift($inconsistentes, array('cedula'=>$arreglo[cedula_integrantes], 'nombre'=>$arreglo[nombre],'salida'=>$arreglo[salida]));\n }//fin si\n }//fin si\n }//fin each\n\n\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n //$this->DataGrid_fj->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n if(!empty($inconsistentes)){\n $this->DataGrid_fh->DataSource=$inconsistentes;\n $this->DataGrid_fh->dataBind();\n }\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n $this->DataGrid->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n $this->DataGrid->DataSource=$this->asistentes;\n $this->DataGrid->dataBind();\n\n\n $this->DataGrid_ina->Caption=\"Inasistentes el d&iacute;a \".$this->txt_fecha_desde->Text;\n $this->DataGrid_ina->DataSource=$this->inasistentes;\n $this->DataGrid_ina->dataBind();\n\n /* Por un error que no supe identificar, el cual suma un numero adicional a la variable\n * de inasistentes no justificados, he tenido que sacarla del procedimiento donde normalmente\n * se contaba y tuve que realizarla por resta en esta sección.\n */\n $this->ind_inasistentes_no_just = count($this->inasistentes) - $this->ind_inasistentes_si_just;\n\n $this->Repeater->DataSource = $this->justificaciones;\n $this->Repeater->dataBind();\n\n $xale=rand(100,99999);\n // Se realiza la construcción del gráfico para indicadores\n\n $chart = new PieChart();\n $dataSet = new XYDataSet();\n if ($this->ind_asistentes>=1) {$dataSet->addPoint(new Point(\"Funcionarios Asistentes: (\".$this->ind_asistentes.\")\", $this->ind_asistentes));};\n if ($this->ind_inasistentes_no_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes NO JUSTIFICADOS: (\".$this->ind_inasistentes_no_just.\")\", $this->ind_inasistentes_no_just));};\n if ($this->ind_inasistentes_si_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes JUSTIFICADOS: (\".$this->ind_inasistentes_si_just.\")\", $this->ind_inasistentes_si_just));};\n $chart->setDataSet($dataSet);\n $chart->setTitle(\"Porcentajes de Asistencias / Inasistencias del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_01.png\");\n $chart->render(\"imagenes/temporales/\".$xale.\"_01.png\");\n $this->grafico1->ImageUrl = \"imagenes/temporales/\".$xale.\"_01.png\";\n\n\n $chart2 = new PieChart();\n $dataSet2 = new XYDataSet();\n $this->ind_asistentes_no_retrasados=$this->ind_asistentes-$this->ind_asistentes_tarde_no_just-$this->ind_asistentes_tarde_si_just;\n if ($this->ind_asistentes_no_retrasados>=1) {$dataSet2->addPoint(new Point(\"Puntuales: (\".$this->ind_asistentes_no_retrasados.\")\", $this->ind_asistentes_no_retrasados));};\n if ($this->ind_asistentes_tarde_no_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales NO JUSTIFICADOS: (\".$this->ind_asistentes_tarde_no_just.\")\", $this->ind_asistentes_tarde_no_just));};\n if ($this->ind_asistentes_tarde_si_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales JUSTIFICADOS: (\".$this->ind_asistentes_tarde_si_just.\")\", $this->ind_asistentes_tarde_si_just));};\n $chart2->setDataSet($dataSet2);\n $chart2->setTitle(\"Porcentajes de Retrasos del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_02.png\");\n $chart2->render(\"imagenes/temporales/\".$xale.\"_02.png\");\n $this->grafico2->ImageUrl = \"imagenes/temporales/\".$xale.\"_02.png\";\n\n // si la consulta de asistentes tiene resultados se habilita la impresion, sino, se deshabilita\n if (!empty($this->asistentes)) {$this->btn_imprimir->Enabled = true;} else {$this->btn_imprimir->Enabled = false;}\n\n }", "function mostrarFormulario(){\r\n $this->consultaFacultades();\r\n }", "function buscar_materiales($registrado,$texto_buscar,$licencia,$sql) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND material_estado=1\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (material_titulo LIKE '%$texto_buscar%' \n\t\t\tOR material_descripcion LIKE '%$texto_buscar%' \n\t\t\tOR material_objetivos LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t}\n\t\t\n\t\t$query = \"SELECT COUNT(*) FROM materiales\n\t\tWHERE material_licencia = '$licencia'\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY fecha_alta desc\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows[0] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $numrows[0];\n\t\t}\n\t}", "function mdatosEjercicioInformacion() {\n\t\t$conexion = conexionbasedatos();\n\t\t\n\t\t$idejercicio = $_GET[\"idejercicio\"];\n\n\t\t$consulta = \"select FE.IDEJERCICIO, FE.NOMBRE_EJERCICIO, FG.NOMBRE_MUSCULO , FE.NIVEL_EJERCICIO, FE.DESCRIPCION, FE.IDFOTO\n\t\t\t\t\tfrom final_ejercicio FE, final_grupo FG\n\t\t\t\t\twhere FE.MUSCULO = FG.IDGRUPO AND FE.IDEJERCICIO = $idejercicio;\";\n\n\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\treturn $resultado;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "function consultaMedida( $accion, $data )\n\t{\n\t\t$validar = new Validar();\n\n\t\t// INICIALIZACIÓN VAR\n\t\t$idMedida = 'NULL';\n\t\t$medida = NULL;\n\n\t\t// SETEO VARIABLES GENERALES\n \t\t$data->medida = isset( $data->medida ) ? (string)$data->medida : NULL;\n\n \t\t// VALIDACIONES\n \t\tif( $accion == 'update' ):\n \t\t\t$data->idMedida = isset( $data->idMedida ) ? (int)$data->idMedida : NULL;\n \t\t\t$idMedida = $validar->validarEntero( $data->idMedida, NULL, TRUE, 'El ID del Menú no es válido, verifique.' );\n \t\tendif;\n\n \t\t$medida = $this->con->real_escape_string( $validar->validarTexto( $data->medida, NULL, TRUE, 3, 45, 'en la descripcíón de la medida' ) );\n\n\t\t// OBTENER RESULTADO DE VALIDACIONES\n \t\tif( $validar->getIsError() ):\n\t \t\t$this->respuesta = 'danger';\n\t \t\t$this->mensaje = $validar->getMsj();\n\n \t\telse:\n\t \t\t$sql = \"CALL consultaMedida( '{$accion}', {$idMedida}, '{$medida}' );\";\n\n\t \t\tif( $rs = $this->con->query( $sql ) ){\n\t \t\t\t$this->con->siguienteResultado();\n\n\t \t\t\tif( $row = $rs->fetch_object() ){\n\t \t\t\t\t$this->respuesta = $row->respuesta;\n\t \t\t\t\t$this->mensaje = $row->mensaje;\n\n\t \t\t\t\tif( $accion == 'insert' AND $this->respuesta == 'success' )\n\t \t\t\t\t\t$this->data = (int)$row->id;\n\t \t\t\t}\n\t \t\t}\n\t \t\telse{\n\t \t\t\t$this->respuesta = 'danger';\n\t \t\t\t$this->mensaje = 'Error al ejecutar la instrucción.';\n\t \t\t}\n\t \t\t\n \t\tendif;\n\n \t\treturn $this->getRespuesta();\n\t}", "function consulta_registro_compras_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n\t, prosic_comprobante.referencia_fecha\n\t, prosic_comprobante.referencia_serie\n\t, prosic_comprobante.referencia_nro\n\t, prosic_comprobante.referecia_tipo_doc\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=3\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,prosic_comprobante.codigo_comprobante\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function getRegistros(){\n $query = $this->db->query('select c.orden_servicio,c.p1,c.p2,c.p3,c.p4,c.p5,c.p6,c.p7,r.DISTRIB,r.RAZON,r.CIUCLIEN,r.NUMSERIE,r.TIPORDEN,r.OPER1,r.ORDEN,r.CLIENTE,r.TELCASA,r.TELOFIC,r.TELCEL,r.EMAIL,r.ASESOR,r.RFCASESOR,r.DESCRIP\n from reporte r\n left join calificacion c\n on r.orden like concat(\"%\",c.orden_servicio,\"%\")');\n return $query->result();\n }", "function consulta_personalizada_registro_compras_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=3\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED),prosic_tipo_comprobante.sunat_tipo_comprobante\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function listarSocios() {\r\n $sql = \"select j.nombre,j.apellido,j.cedula,j.fechanac, j.porcentaje, m.nombre from juntadirectiva as j, municipio as m \"\r\n\t\t .\" where j.ciudadnac = m.id\";\t\t\r\n $respuesta = $this->object->ejecutar($sql);\r\n $this->construirListadoSocio($respuesta);\r\n }", "public function Consultar(){\n require_once 'view/include/cabecera_usuario.php';\n require_once 'view/mostrar_estadobien.php';\n require_once 'view/include/pie_mostrar.php';\n }", "function consultar(){\n\t\t\n\t\t$this->mysqli = conectarBD();\n\t\t\n\t\t$sql = \"SELECT Linea_Factura.Id_Linea_Factura,Linea_Factura.Id_Factura,Servicio.Nombre,Linea_Factura.Importe,Linea_Factura.Descripcion FROM Linea_Factura INNER JOIN Servicio WHERE Linea_Factura.Id_Factura='\".$this->factura.\"' AND Linea_Factura.Id_Servicio=Servicio.Id_Servicio AND Linea_Factura.Borrado='0';\";\n\t\t$resultado = $this->mysqli->query($sql);\t\n\t\tif ($resultado->num_rows > 0){\n\t\t\twhile($row = $resultado->fetch_array()){\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t\treturn $array;\n\t\t}\n\t}", "function _ConsultarResultadosPruebasIMM1($tipo_prueba, $id_cliente) //consulta el último biotest para imm se necesitan 16 campos.\n\t{\n\t\t$query='\n\t\t\tselect * from sg_pruebas \n\t\t\twhere Tipo_Prueba=\"'.$tipo_prueba.'\" \n\t\t\tand id_cliente=\"'.$id_cliente.'\" order by fecha and id asc limit 16\n\n\t\t';\n\t\t$con=Conectar::_con();\n\t\t$result=$con->query($query) or die(\"Error en: $query \".mysqli_error($query));\n\t\treturn $result;\n\t}", "public function listarc()\n {\n $sql = \"SELECT * FROM miembros \n \";\n\n return ejecutarConsulta($sql);\n }", "public function readAllInfo()\n {\n //recupération des données en post\n $data = $this->request->data;\n try\n {\n //selection d'une UE en foction de l'identifiant\n if (!empty($data['id_matiere'])) {\n $results = $this->model->read_all_info_id((int)$data['id_matiere']);\n\n if (empty($results)) {\n $this->_return('la matière demandée n\\'existe pas dans la base de donnée', false);\n }\n $this->_return('Informations sur la matière '.$results->nom_matiere.' ', true, $results);\n }\n //selection de toutes les UE d'enseignement\n $results = $this->model->read_all_info_matiere();\n if (empty($results)) {\n $this->_return('Vous n\\'avez pas encore de matière en base de données', false);\n }\n $this->_return('liste des matières disponibles dans la base de données', true, $results);\n }\n catch(Exception $e)\n {\n $this->_exception($e);\n }\n }", "public function ConsultarSoporteMatricula($param) {\n extract($param);\n $resultado = array();\n $registro = array();\n $sql = \"CALL SPCONSULTARCARGAMASIVASM($tipodocumento,$busqueda);\";\n $rs=null;\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $host= $_SERVER[\"HTTP_HOST\"];\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n foreach ($fila as $key => $value) {\n $rutaFuente= \"<a href='/\".$fila['RutaFuente'].\"'>Descargar Archivo Fuente</a>\";\n $rutaEscaneado= \"<a href='/\".$fila['RutaSoporte'].\"'>Descargar Archivo Soporte</a>\";\n array_push($registro, $fila['TipoIdentificacion'],$fila['NumeroIdentificacion'],$fila['Nombres'],$fila['Fecha'],$fila['Salon'],$rutaFuente, $rutaEscaneado ,$value);\n \n array_push($registro, $value);\n }\n array_push($resultado, $registro);\n $registro = array();\n }\n }\n } else {\n $registro = 0;\n }\n echo json_encode($resultado);\n }", "function listarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_sel';\n\t\t$this->transaccion='GEM_GEMETO_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_metodologia','int4');\n\t\t$this->captura('codigo','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function listarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_sel';\r\n\t\t$this->transaccion='tgv_SERVIC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n\t\t$this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_servicio','int4');\r\n\t\t$this->captura('estado','varchar');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('id_lugar_destino','int4');\r\n\t\t$this->captura('id_ep','int4');\r\n\t\t$this->captura('fecha_asig_fin','date');\r\n\t\t$this->captura('fecha_sol_ini','date');\r\n\t\t$this->captura('descripcion','varchar');\r\n\t\t$this->captura('id_lugar_origen','int4');\r\n\t\t$this->captura('cant_personas','int4');\r\n\t\t$this->captura('fecha_sol_fin','date');\r\n\t\t$this->captura('id_funcionario','int4');\r\n\t\t$this->captura('fecha_asig_ini','date');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('fecha_reg','timestamp');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('fecha_mod','timestamp');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('desc_funcionario','text');\r\n\t\t$this->captura('desc_lugar_ini','varchar');\r\n\t\t$this->captura('desc_lugar_des','varchar');\r\n\t\t$this->captura('id_funcionario_autoriz','int4');\r\n\t\t$this->captura('observaciones','varchar');\r\n\t\t$this->captura('desc_funcionario_autoriz','text');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t//echo '--->'.$this->getConsulta(); exit;\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function buscarMaterias($datos){\n try {\n $parametros = array(\"id_plan\" => $datos[\"id_plan\"] , \n \"anio\" => $datos[\"anio\"]);\n $resultado = $this->refControladorPersistencia->ejecutarSentencia(DbSentencias::BUSCAR_MATERIAS_EC, $parametros);\n $fila = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\n return $fila;\n } catch(Exception $e){\n echo \"Error :\" . $e->getMessage(); \n }\n }", "public function ConsultarAsistenciaDiarias()\n {\n try {\n $datos = $_REQUEST;\n $filtros = array_filter($datos);\n $dbm = new DbmControlescolar($this->get(\"db_manager\")->getEntityManager());\n if($filtros['permiso'] != 1) {\n $id = $dbm->BuscarIProfesorTitular($filtros['grupoid']);\n if(!$id) {\n return new View(\"No se han encontrado profesores en el grupo consultado\", Response::HTTP_PARTIAL_CONTENT);\n }\n\n $usuario = $dbm->getRepositorioById('Usuario', 'profesorid', $id[0][\"profesorid\"]);\n if(!$usuario) {\n return new View(\"Se requiere tener un permiso especial o ser el profesor titular para poder consultar\", Response::HTTP_PARTIAL_CONTENT);\n \n }\n if($usuario->getUsuarioid() != $filtros['usuarioid']) {\n return new View(\"Se requiere tener un permiso especial o ser el profesor titular para poder consultar\", Response::HTTP_PARTIAL_CONTENT);\n }\n } \n $respuesta = $this->asistenciasDiarias($filtros, $dbm);\n if($respuesta['error']) {\n return new View($respuesta['mensaje'], Response::HTTP_PARTIAL_CONTENT);\n }\n return new View($respuesta, Response::HTTP_OK);\n } catch (\\Exception $e) {\n return new View($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n }", "function armar_consulta($pdia,$udia,$anio){\n //designaciones sin licencia UNION designaciones c/licencia sin norma UNION designaciones c/licencia c norma UNION reservas\n// $sql=\"(SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON ( m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND not exists(SELECT * from novedad t_no\n// where t_no.id_designacion=t_d.id_designacion\n// and (t_no.tipo_nov=1 or t_no.tipo_nov=2 or t_no.tipo_nov=4 or t_no.tipo_nov=5)))\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND t_no.id_designacion=t_d.id_designacion\n// AND (((t_no.tipo_nov=2 or t_no.tipo_nov=5 ) AND (t_no.tipo_norma is null or t_no.tipo_emite is null or t_no.norma_legal is null))\n// OR (t_no.tipo_nov=1 or t_no.tipo_nov=4))\n// )\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// sum((case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen ) as dias_lic,\n// case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// \tAND t_d.carac = t_c.id_car \n// \tAND t_d.uni_acad = t_ua.sigla \n// \tAND t_d.tipo_desig=1 \n// \tAND t_no.id_designacion=t_d.id_designacion \n// \tAND (t_no.tipo_nov=2 or t_no.tipo_nov=5) \n// \tAND t_no.tipo_norma is not null \n// \tAND t_no.tipo_emite is not null \n// \tAND t_no.norma_legal is not null\n// GROUP BY t_d.id_designacion,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\n// )\".\n //--sino tiene novedad entonces dias_lic es 0 case when t_no.id_novedad is null \n //--si tiene novedad tipo 2,5 y no tiene norma entonces dias_lic es 0\n $sql=\" SELECT distinct t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n sum(case when t_no.id_novedad is null then 0 else (case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen end) as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d \n LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\n LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo)\n LEFT OUTER JOIN novedad t_no ON (t_d.id_designacion=t_no.id_designacion and t_no.tipo_nov in (2,5) and t_no.tipo_norma is not null \n \t\t\t\t\tand t_no.tipo_emite is not null \n \t\t\t\t\tand t_no.norma_legal is not null \n \t\t\t\t\tand t_no.desde<='\".$udia.\"' and t_no.hasta>='\".$pdia.\"'),\n docente as t_d1,\n caracter as t_c,\n unidad_acad as t_ua \n WHERE t_d.id_docente = t_d1.id_docente\n AND t_d.carac = t_c.id_car \n AND t_d.uni_acad = t_ua.sigla \n AND t_d.tipo_desig=1 \n GROUP BY t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\".\n\n \" UNION\n (SELECT distinct t_d.id_designacion,0 as por_permuta,t_d.tipo_desig, 'RESERVA'||': '||t_r.descripcion as docente_nombre, 0, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento, t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n 0 as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n caracter as t_c,\n unidad_acad as t_ua,\n reserva as t_r \n \n WHERE t_d.carac = t_c.id_car \n \tAND t_d.uni_acad = t_ua.sigla \n \tAND t_d.tipo_desig=2 \n \tAND t_d.id_reserva = t_r.id_reserva \t\n )\";\n //esto es para las designaciones que tienen mas de un departamento,area,orientacion\n $sql2=\"SELECT distinct sub1.id_designacion,sub1.por_permuta,sub1.tipo_desig,sub1.docente_nombre,sub1.legajo,sub1.nro_cargo,sub1.anio_acad,sub1.desde,sub1.hasta,sub1.cat_mapuche, sub1.cat_mapuche_nombre,\n sub1.cat_estat, sub1.dedic, sub1.carac,case when sub2.id_designacion is not null then sub2.dpto else sub1.id_departamento end as id_departamento,case when sub2.id_designacion is not null then sub2.area else sub1.id_area end as id_area,case when sub2.id_designacion is not null then sub2.orientacion else sub1.id_orientacion end as id_orientacion\n , sub1.uni_acad, sub1.emite_norma, sub1.nro_norma, sub1.tipo_norma, sub1.nro_540, sub1.observaciones, sub1.id_programa, sub1.programa, sub1.porc, sub1.costo_diario, sub1.check_presup, sub1.licencia, sub1.estado, sub1.dias_lic, sub1.dias_des\n FROM (\".$sql.\")sub1\"\n . \" LEFT OUTER JOIN (select d.id_designacion,excepcion_departamento(a.id_designacion)as dpto,excepcion_area(a.id_designacion) as area,excepcion_orientacion(a.id_designacion) as orientacion\n from designacion d,dao_designa a \n where d.desde <='\".$udia.\"' and (d.hasta>='\".$pdia.\"' or d.hasta is null)\n and a.id_designacion=d.id_designacion)sub2 ON (sub1.id_designacion=sub2.id_designacion)\";\n return $sql2;\n }", "function ConsultarMedicamentosAPH(){\n $sql = \"CALL spConsultarMedicamentosAPH(?)\";\n $query = $this->_CONEXION->prepare($sql);\n $query->bindParam(1, $this->idReporteAPH);\n $query->execute();\n if ($query->rowCount() > 0) {\n return array('medicamentos' => $query->fetchAll());\n }else{\n return array('medicamentos' => null);\n }\n }", "function consultarFacultades() {\r\n $cadena_sql=$this->sql->cadena_sql(\"datos_facultades\",\"\");\r\n $resultado=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\");\r\n return $resultado;\r\n }", "public function Listar(){\n $dica_saude = new Exame();\n\n //Chama o método para selecionar os registros\n return $dica_saude::Select();\n }" ]
[ "0.6942287", "0.6733404", "0.6662758", "0.6646386", "0.66270703", "0.6613926", "0.6568316", "0.65396035", "0.6521171", "0.6500633", "0.647779", "0.64602244", "0.64294916", "0.6425878", "0.64187217", "0.6413232", "0.64018667", "0.6383395", "0.63566506", "0.635061", "0.6348245", "0.63425004", "0.63390017", "0.63158697", "0.63122034", "0.6309378", "0.6291725", "0.62898743", "0.62733865", "0.62600195" ]
0.6920164
1
Total de registros de SicasConsultaMedica
public function totalColecao(){ $oSicasConsultaMedicaBD = new SicasConsultaMedicaBD(); return $oSicasConsultaMedicaBD->totalColecao(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function totalRegistros();", "public function totalColecao(){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->totalColecao();\r\n }", "public function total(){\n $total = $this->qualification + $this->referee_report + $this->interview;\n }", "public function reporteMensualTotal(){\n\n }", "public function totcarte()\n {\n $detalle = FacturaDet::join('factura_cab', 'factura_cab.numfac', '=', 'factura_det.numfac')\n ->select(DB::raw('sum(cantserv*valserv) as total'))\n ->where('factura_cab.estfac','<>','0')\n ->where('factura_cab.estfac','<>','1')\n ->first();\n $total=$detalle->total+0;\n $pagos = Pago::select(DB::raw('sum(valpago) as total'))\n ->first();\n if($pagos)\n $pagado = $pagos->total;\n else\n $pagado=0;\n $total = $total - $pagado;\n return $total;\n }", "public static function ctrSumaTotalEgresos()\n {\n\n $tabla = \"finanzas\";\n\n $respuesta = ModeloFinanzas::mdlSumaTotalEgresos($tabla);\n\n return $respuesta;\n\n }", "public function getTotal();", "public function getTotal();", "static public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_cotacoes_produtos where mgt_cotacao_produto_numero_cotacao = '\" . trim($this->mgt_pedido_numero->Text) . \"' order by mgt_cotacao_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }", "public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "public function getMaduracionTotal(){\n \n $q = Doctrine_Query::create();\n $q->select('SUM(cantidad_actual) as suma');\n $q->from('Lote');\n $q->where('producto_id = ?', $this->getId());\n $q->andWhere('accion = \"En Maduración\"');\n $cantidad = $q->fetchOne();\n if($cantidad->getSuma() != 0){\n return $cantidad->getSuma();\n }\n else{\n return 0;\n }\n \n }", "public function total();", "public function total();", "public function total();", "function totalboaralla(){\n\n\t$crud = new CRUD();\n\t$crud->disconnect();\n\n\t$crud -> sql(\"select SUM(native_boar) as totalboaralla from farmers_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['totalboaralla'];\n\t}\n\t$crud->disconnect();\n}", "public function totalMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor+c.troco),0) as total from tbpedido_pagamento c WHERE MONTH(c.data_pagamento) = MONTH(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_assoc();\n $totalgeral = $result['total'];\n\n return $totalgeral;\n }", "public static function GetTotalVendas(){\n self::$results = self::query(\"SELECT sum(vlTotal) from tbComanda\");\n if (is_array(self::$results) || is_object(self::$results)){\n foreach(self::$results as $result){\n $result[0] = str_replace('.', ',', $result[0]);\n array_push(self::$resultRetorno, $result);\n return $result[0];\n }\n }\n return 0;\n }", "public function formulas_TotalAplicarFiltrosFormulas($fechaInicial, $fechaFinal, $usuarios, $idMedicamento, $idPropietario, $paciente){\n \t\n\t\t\t$resultado = 0;\n\t\t\t//$adicionQuery = \"WHERE 1 \";\n\t\t\t\n\t\t\tif($idMedicamento != '0'){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$adicionQuery = \" INNER JOIN tb_medicamentosFormula AS MF ON MF.idFormula = F.idFormula\n\t\t\t\t\t\t\t\t INNER JOIN tb_listadoMedicamentos AS ME ON ME.idMedicamento = MF.idMedicamento\n\t\t\t\t\t\t\t\t WHERE ME.idMedicamento = '$idMedicamento' \";\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$adicionQuery = \"WHERE 1 \";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif($usuarios != \"\"){\t\t\t\t\n\t\t\t\t\n\t\t\t\t$adicionQuery = \" AND F.idUsuario = '$usuarios' \";\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($fechaInicial != \"\" AND $fechaFinal != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \"AND ( F.fecha BETWEEN '$fechaInicial' AND '$fechaFinal')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tif($idPropietario != \"0\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND P.idPropietario = '$idPropietario' \";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($paciente != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND F.idMascota = '$paciente' \";\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$query = \"SELECT \n\t\t\t\t\t\t count(F.idFormula) as totalRegistros\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_formulas AS F\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_mascotas AS M ON F.idMascota = M.idMascota\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_propietarios AS P ON P.idPropietario = M.idPropietario\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_sucursales AS SU ON SU.idSucursal = F.idSucursal\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_usuarios AS U ON U.idUsuario = F.idUsuario\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\".$adicionQuery.\"\n\t\t\t\t\t\t \";\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas['totalRegistros'];\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\t\n\t\t\t\n }", "public function numTotalDeRegistros(){\r\n return $this->numTotalDeRegistros;\r\n }", "static public function mdlSumaTotales($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\t$campo=\"id_caja\";\n\t$rsp=array();\n\t\n\t$ventas=self::mdlSumaTotalVentas($tabla, $item, $valor, $cerrado, $fechacutvta);\n\t$ventasgral=$ventas[\"sinpromo\"]>0?$ventas[\"sinpromo\"]:0;\n\t$ventaspromo=$ventas[\"promo\"]>0?$ventas[\"promo\"]:0;\n\t$sumaventasgral=$ventasgral+$ventaspromo;\n\t//array_push($rsp, \"ventasgral\", $sumaventasgral);\n\t$rsp[\"ventasgral\"]=$sumaventasgral; // Se crea la key \n\n\t$vtaEnv = self::mdlSumTotVtasEnv($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasenvases=$vtaEnv[\"total\"]>0?$vtaEnv[\"total\"]:0;\n\t//array_push($rsp, \"ventasenvases\", $ventasenvases);\n\t$rsp[\"ventasenvases\"]=$ventasenvases; // Se crea la key \n\n\t$vtaServ = self::mdlSumTotVtasServ($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasservicios=$vtaServ[\"total\"]>0?$vtaServ[\"total\"]:0;\n\t//array_push($rsp, \"ventaservicios\", $ventasservicios);\n\t$rsp[\"ventaservicios\"]=$ventasservicios; // Se crea la key \n\t\t\t\t\t \n\t$ventasaba=self::mdlSumTotVtasOtros($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasgralaba=$ventasaba[\"sinpromo\"]>0?$ventasaba[\"sinpromo\"]:0;\n\t$ventaspromoaba=$ventasaba[\"promo\"]>0?$ventasaba[\"promo\"]:0;\n\t$ventasabarrotes=$ventasgralaba+$ventaspromoaba;\n\t//array_push($rsp, \"ventasabarrotes\", $ventasabarrotes);\n\t$rsp[\"ventasabarrotes\"]=$ventasabarrotes; // Se crea la key \n\n\t$vtaCred = self::mdlSumTotVtasCred($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventascredito=$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]>0?$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]:0;\n\t//array_push($rsp, \"ventascredito\", $ventascredito);\n\t$rsp[\"ventascredito\"]=$ventascredito; // Se crea la key \n\n\t$totingyegr=self::mdlTotalingresoegreso($campo, $valor, $cerrado, $fechacutvta);\n\t$ingresodia=$totingyegr[\"monto_ingreso\"]>0?$totingyegr[\"monto_ingreso\"]:0;\n\t//array_push($rsp, \"ingresodia\", $ingresodia);\n\t$rsp[\"ingresodia\"]=$ingresodia; // Se crea la key \n\t$egresodia=$totingyegr[\"monto_egreso\"]>0?$totingyegr[\"monto_egreso\"]:0;\n\t//array_push($rsp, \"egresodia\", $egresodia);\n\t$rsp[\"egresodia\"]=$egresodia; // Se crea la key \n\n\t$totVentaDia=$ventasgral+$ventaspromo+$ventasenvases+$ventasservicios+$ventasgralaba+$ventaspromoaba+$ventascredito;\n\t//array_push($rsp, \"totalventadia\", $totVentaDia);\n\t$rsp[\"totalventadia\"]=$totVentaDia; // Se crea la key \n\n\treturn $rsp;\n \n}", "public function totalColecao(){\r\n\t\t$oSicasSalarioMinimoBD = new SicasSalarioMinimoBD();\r\n\t\treturn $oSicasSalarioMinimoBD->totalColecao();\r\n\t}", "function ObtenerTotales($id_factura) {\n $query=\"SELECT SUM(total) total, SUM(valorseguro) total_seguro\nFROM \".Guia::$table.\" WHERE idfactura=$id_factura\";\n return DBManager::execute($query);\n }", "function ventas_totales(){\n\t\tglobal $link;\n\t\n\t\t$sql =\"SELECT SUM(importe) FROM consumos\";\n\t\t$query = mysqli_query($link,$sql);\n\t\t$total = mysqli_fetch_assoc($query);\n\t\t\n\t\treturn $total[\"SUM(importe)\"];\n}", "public function prixtotal(){\r\n\t\t\t\trequire(\"connexiondatabase.php\");\r\n\t\t/*on fait ici une somme des différent object commandé et on reourne*/\r\n\t\t$prixtotal=0;\r\n\t\t//on recupere les id des produis sélectionner pour faire la requette\r\n\t\t$ids = array_keys($_SESSION['panier']);\r\n\t\tif (empty($ids)) {//si les id sont vide, \r\n\t\t\t$produits=array(); // \r\n\t\t}else{\r\n\r\n\t\t$produits = $connexion->prepare('SELECT id, prix FROM produits WHERE id IN ('.implode(',' ,$ids).')');\r\n\t\t$produits->execute();\r\n\t\t}\r\n\r\n\t\twhile ($produit=$produits->fetch(PDO::FETCH_OBJ)){\r\n\t\t\t$prixtotal +=$produit->prix*$_SESSION['panier'][$produit->id];\r\n\t\t}\r\n\t\treturn $prixtotal;\r\n\t}", "public function calcularCosto(){\n $detalles = DetalleOrden::where('codOrden','=',$this->codOrden)->get();\n $sumaTotal = 0;\n foreach ($detalles as $x) {\n $sumaTotal = $sumaTotal + ($x->precio*$x->cantidad);\n }\n\n return $sumaTotal;\n\n }", "public function cesta_sin_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta>0?$elArticulo->oferta:$elArticulo->precio;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "public function getTotal(){\n\t\t\t$sql = \"SELECT COUNT(*) as c FROM servico\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql = $sql->fetch();\n\t\n\t\t\treturn $sql['c'];\n\t\t}", "function getCreditosComprometidos(){ return $this->getOEstats()->getTotalCreditosSaldo(); }" ]
[ "0.7712316", "0.72848725", "0.71452045", "0.71007335", "0.7094024", "0.7076156", "0.69729894", "0.69729894", "0.69711214", "0.6940392", "0.6938759", "0.6914168", "0.69066447", "0.6897834", "0.6897834", "0.6897834", "0.68754953", "0.687157", "0.68109006", "0.67490286", "0.67136127", "0.66895276", "0.6667859", "0.6666922", "0.6642814", "0.6633882", "0.6631069", "0.66305244", "0.66238093", "0.66230124" ]
0.7308667
1
Determine whether the user can restore the auth key.
public function restore(User $user, ServerAuthKey $key) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function can_restore() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'restore' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function hasValidResetKey()\n {\n return (boolean) $this->isActive() && $this->_getVar('user_resetkey_valid');\n }", "public function restore(User $user): bool\n {\n return $user->can('Restore Role');\n }", "public function restore(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:restore')\n );\n }", "private function check_auth() {\n if (empty($this->user_id) || empty($this->privatekey)) {\n $this->send_error('AUTH_FAIL');\n exit;\n } elseif ($this->users_model->validate_privatekey($this->user_id, $this->privatekey)) {\n return true;\n }\n }", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "public function restore($user, $model)\n {\n\n if( $user->hasPermissionTo('restore ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function restore(User $user)\n {\n return config('mailcare.auth') && config('mailcare.automations');\n }", "private function needs_auth($key) {\r\n $needs_auth = (phpsaaswrapper()->needs_auth($key) == 'true') ? true : false;\r\n if($needs_auth) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected function isRestoring()\n {\n return $this->option('restore') == 'true';\n }", "private function validateReviewerKey(){\n\t\treturn true;\n\t}", "public function restore(Provider $provider)\n {\n\t if (Auth::guard('provider-web')->user()->id == $provider->id) return true;\n\t return false;\n }", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function restore(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "function renren_user_logined() {\n global $RR_config;\n return isset($_COOKIE[$RR_config->APIKey.'_session_key']) || !empty($_COOKIE[$RR_config->APIKey.'_session_key']);\n}", "public function hasPersistentLogin();", "public function isPasswordRecoveryEnabled();", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuth();", "public function hasCrypt(): bool;", "public function can_reset_password() {\n return false;\n }", "public function resume(): bool\n {\n if ($this->values->offsetExists('principal')) {\n $this->principal = $this->values->get('principal');\n\n $this->logger->info(\n \"Authentication resume: {user}\",\n ['user' => $this->principal]\n );\n $this->publishResume($this->principal, $this->values);\n\n $this->values->offsetSet('lastActive', microtime(true));\n\n return true;\n }\n return false;\n }", "protected function hasAuth()\n {\n return !! $this->options['authentication'];\n }", "public function validateAuthKey($authKey): bool;", "function checkResetKey($username, $key) {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $auth_error[] = $this->lang['resetpass_lockedout'];\n $auth_error[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if (strlen($username) == 0) {\n return false;\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($key) == 0) {\n return false;\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n return false;\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n return false;\n } else {\n $query = $this->db->select(\"SELECT resetkey FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHECKRESETKEY_FAIL\", \"Username doesn't exist ({$username})\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHECKRESETKEY_FAIL\", \"Key provided is different to DB key ( DB : {$db_key} / Given : {$key} )\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n }\n }\n }\n }\n }", "function userCanSetDbPassword(){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function chkRbac()\n\t{\n\t\treturn $this->chkRbac;\n\t}", "public function isAuth() {}", "public function restore(User $user, Interview $interview)\n {\n return $user->hasPermissionTo('restore interview');\n }", "function can_reset_password() {\n return false;\n }" ]
[ "0.69855917", "0.6302176", "0.6097778", "0.60794586", "0.6045934", "0.6015025", "0.59512925", "0.5928465", "0.59031117", "0.58317214", "0.5807743", "0.5799083", "0.5779006", "0.5767851", "0.57035506", "0.566946", "0.5643295", "0.5632672", "0.56311005", "0.5609709", "0.5603563", "0.5594496", "0.55905366", "0.55888534", "0.55776054", "0.5575796", "0.55733746", "0.5533381", "0.5533361", "0.55240726" ]
0.6545664
1
Determine whether the user can add a server host.
public function addServerHost(User $user, ServerAuthKey $key) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasServer(string $name): bool {}", "public function host_exist() {\n return D( 'User/Host' )->host_exist_verifition( array( 'usr_login_id' => get_session_id() ) );\n }", "public function shouldCheckHttpHost()\n {\n return !Director::is_cli() && isset($_SERVER['HTTP_HOST']);\n }", "public function isHoster()\n\t{\n\t\t$hosters = include('OWNER.php');\n\t\treturn in_array($this->getFullName(), $hosters, true);\n\t}", "public static function hostAllowed($conn, $host_id, $user = '') \n { \n Ossim_db::check_connection($conn);\n \n $cnd_1 = (!$_SESSION['_user_vision']['host_where'] || self::only_ff_host());\n $cnd_2 = ($_SESSION['_user_vision']['net_where'] && !self::only_ff_net());\n \n if ($cnd_1 && $cnd_2) \n {\n return Asset_host::is_in_allowed_nets($conn, $host_id); // if host_id is in allowed nets\n }\n \n return self::is_asset_allowed($conn, $host_id, 'host', $user);\n }", "private function isMyServer(): bool {\n\t\ttry {\n\t\t\treturn Server::singleton($this->application)->id() === $this->memberInteger('server');\n\t\t} catch (Throwable) {\n\t\t\treturn false;\n\t\t}\n\t}", "protected function isHostConfigured() {}", "public function has_server( $key ) \n\t{\n\t\treturn array_key_exists( strtoupper($key), $this->SERVER );\n\t}", "public function addServerAlias(string $alias): bool {}", "public function supportsHost(string $host) : bool\n {\n return in_array($host, [\n 'android.googleapis.com',\n 'fcm.googleapis.com',\n ]);\n }", "function canAdd() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\tif(!$permission->CanAdd) return false;\r\n\t\treturn true;\r\n\t}", "public function isHostBackend()\n {\n $backendUrl = $this->configInterface->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);\n $backendHost = parse_url(trim($backendUrl), PHP_URL_HOST);\n $host = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';\n return (strcasecmp($backendHost, $host) === 0);\n }", "public function isForServer()\n {\n return $this->server !== null;\n }", "public static function allowServerInfo()\n\t{\n\t\treturn MHTTPD::$config['Admin']['allow_server_info'];\n\t}", "function adminChk(){\r\n\treturn $_SERVER[\"REMOTE_ADDR\"] == \"118.36.189.171\" || $_SERVER[\"REMOTE_ADDR\"] == \"39.115.229.173\" || $_SERVER[\"REMOTE_ADDR\"] == \"127.0.0.1\";\r\n}", "public function addNameserverIp(string $ip): bool {}", "public function isLocalhost()\n {\n $whitelist = [ '127.0.0.1', '::1', ];\n return in_array( $this->getServerVar('REMOTE_ADDR' ), $whitelist, true );\n }", "public function hasServerPublicIpAddr()\n {\n return $this->server_public_ip_addr !== null;\n }", "public function canAdd()\n {\n return $this->options->getOption(\"canAdd\");\n }", "function okcomputer($allowed) {\n\n $allowed_hosts = array($allowed);\n if (!isset($_SERVER['HTTP_HOST']) || !in_array($_SERVER['HTTP_HOST'], $allowed_hosts)) {\n header($_SERVER['SERVER_PROTOCOL'].' 400 Bad Request');\n exit;\n }\n}", "public static function hasAccess(): bool\n {\n return in_array(Helper::getClientIP(), self::$ips);\n }", "protected function canAdd()\n {\n return $this->hasStrategy(self::STRATEGY_ADD);\n }", "public function hasServerKey()\n {\n return $this->server_key !== null;\n }", "public function can_do_default() {\n $context = context_system::instance();\n return has_capability('local/elisprogram:manage', $context);\n }", "public function pushHosts(): bool;", "function is_subdomain_install()\n {\n }", "private function validateCurrentHostname(): bool\n {\n // check that current base url is configured as an allowed hostname\n $baseUrl = $this->url->getBaseUrl();\n foreach ($this->getAllowedBypassHostnames() as $hostname) {\n if (strpos($baseUrl, $hostname) !== false) {\n return true;\n }\n }\n return false;\n }", "public function addServerUser(User $user, ServerAuthKey $key)\n {\n return false;\n }", "public function canManageOwnSubdomain();", "public function checkInServerList()\n {\n $serverList = preg_split('/\\r\\n|[\\r\\n]/', ConfPPM::getConf('server_list'));\n $myIP = array();\n $myIP[] = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['GEOIP_ADDR']) ? $_SERVER['GEOIP_ADDR'] : '127.0.0.1';\n if (empty(array_intersect($serverList, $myIP))) {\n return false;\n } else {\n return true;\n }\n }" ]
[ "0.6472003", "0.6393594", "0.63456297", "0.6293234", "0.6217722", "0.6145836", "0.606648", "0.60478276", "0.6045852", "0.60220313", "0.6005659", "0.5988217", "0.59685993", "0.5964756", "0.59636235", "0.5941678", "0.5936683", "0.59210706", "0.5901499", "0.58996457", "0.5896767", "0.58886623", "0.58803886", "0.58603823", "0.584023", "0.5829129", "0.58187824", "0.58139557", "0.580786", "0.5803055" ]
0.67002326
0
Altera o email do cliente
public function changeEmail($cliente_id) { try { $email = \Request::get('email'); $data = (self::MODEL)::find($cliente_id); $data->email = $email; $data->save(); return $this->showResponse($data); } catch (\Exception $exception) { return $this->clientErrorResponse([ 'exception' => '[' . $exception->getLine() . '] ' . $exception->getMessage() ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function changeEmail()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['new_email']) || $request['new_email']==\"\")\n throw_error_msg(\"provide new_email\");\n\n if(!isset($request['cnew_email']) || $request['cnew_email']==\"\")\n throw_error_msg(\"provide cnew_email\");\n\n if($request['new_email']!=$request['cnew_email'])\n throw_error_msg(\"new email and confirm email do not match\");\n\n $request['userid'] = userid();\n $userquery->change_email($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"email has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function setEmail($value) {\n if(!strstr($value, \"@\")){\n throw new Exception(\"Errore in setEmail\");\n }\n // se esiste\n\n $this->email = $value;\n\n //$this->generateUserId();\n }", "public function changeEmail($newValue){\n\n $this->email = $newValue;\n $this ->save();\n\n }", "public function verificarClienteEmail(ICliente $cliente);", "function changeemail($member,$oldemail,$newemail) {\n\t\n}", "public function setEmail($newEmail){\n\t}", "public function setGiftcardSenderEmail($value);", "function setEmail($newEmail){\n $this->email = $newEmail;\n }", "private function setEmail()\n {\n\t if ( empty( $_POST['email'] ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n }\n \n $e = trim( $_POST['email'] );\n \n\t\tif ( ! filter_var( $e, FILTER_VALIDATE_EMAIL ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n\t\t}\n \n\t\t$this->data['email'] = $e;\n }", "public function setEmail($value)\n {\n $this->_email = $value;\n }", "public function setEmail($value) {\r\n $this->email = $value;\r\n }", "public function cmschangeMailCliente(Request $request){\n $correo = $request->correo;\n $ncorreo = $request->ncorreo;\n $sap_code_sponsor = $request->sap_code_sponsor;\n\n $update = User::Where('email', 'like', '%' . \"$correo\" . '%')\n ->where('client_type', '=', 'CLIENTE')\n ->where('sap_code_sponsor', '=', $sap_code_sponsor)\n ->where('locked', '=', 0)\n ->where('status', '=', 1)\n ->update(['email' => \"$ncorreo\" ]);\n \n return '1';\n }", "public function setUsernameToEmail()\n {\n $this->username = $this->email;\n $this->usernameCanonical = $this->emailCanonical;\n }", "public function resetOriginalEmail() : void;", "private function emailAtLogin() {}", "function changeEmail() {\r\n\r\n\tglobal $SALT;\r\n\tglobal $DB;\r\n\tglobal $MySelf;\r\n\r\n\t// Are we allowed to change our email?\r\n\tif (!$MySelf->canChangeEmail()) {\r\n\t\tmakeNotice(\"You are not allowed to change your email. Ask your CEO to re-enable this feature for your account.\", \"error\", \"Forbidden\");\r\n\t}\r\n\r\n\t/*\r\n\t* At this point we know that the user who submited the\r\n\t* email change form is both legit and the form was not tampered\r\n\t* with. Proceed with the email-change.\r\n\t*/\r\n\r\n\t// its easier on the eyes.\r\n\t$email = sanitize($_POST[email]);\r\n\t$username = $MySelf->getUsername();\r\n\r\n\t// Update the Database. \r\n\tglobal $IS_DEMO;\r\n\tif (!$IS_DEMO) {\r\n\t\t$DB->query(\"update users set email = '$email', emailvalid = '0' where username = '$username'\");\r\n\t\tmakeNotice(\"Your email information has been updated. Thank you for keeping your records straight!\", \"notice\", \"Information updated\");\r\n\t} else {\r\n\t\tmakeNotice(\"Your email would have been changed. (Operation canceled due to demo site restrictions.)\", \"notice\", \"Email change confirmed\");\r\n\t}\r\n\r\n}", "public function changeEmail()\n {\n $breadCrumb = $this->userEngine\n ->breadcrumbGenerate('change-email');\n\n $recentEmail = $this->userEngine\n ->getChangeRequestedEmail();\n \n JavaScript::put(['newEmail' => __ifIsset($recentEmail['data'], $recentEmail['data']['new_email'], false)]);\n\n return $this->loadPublicView('user.change-email', $breadCrumb['data']);\n }", "public function change_email()\n {\n if ($this->input->get('email')) {\n $res = $this->_api('user')->update_email([\n 'id' => $this->current_user->_operator_id(),\n 'email' => $this->input->get('email')\n ]);\n if ($res['submit']) {\n $this->_flash_message('メールアドレスを変更しました');\n redirect('setting');\n return;\n }\n }\n\n $view_data = [\n 'form_errors' => []\n ];\n\n\n // Check input data\n if ($this->input->is_post()) {\n // Call API to send verify email\n $res = $this->_api('user')->send_verify_email([\n 'user_id' => $this->current_user->id,\n 'email_type' => 'change_email',\n 'email' => $this->input->post('email'),\n ]);\n if ($res['submit']) {\n redirect('setting/change_email_sent');\n }\n\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n $view_data['post'] = $this->input->post();\n }\n $user_res = $this->get_current_user_detail();\n $view_data['post'] = $user_res['result'];\n\n $this->_render($view_data);\n }", "public function setGiftcardRecipientEmail($value);", "public function change_email() {\n if($_SESSION['user']->set_email($this->email)) {\n return true;\n } else {\n // An error occured updating the email address, return false\n return false;\n }\n }", "public function setEmailAttribute($value)\n {\n if (!empty($value)) {\n $this->attributes['email'] = $this->mayaEncrypt($value);\n }\n }", "public function setEmail($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_9'));\n\t\tif(!Validator::AccountEmail($value)) throw new Exception(lang('error_9'));\n\t\t\n\t\t$this->_email = $value;\n\t}", "public static function editMail($data)\n {\n $response = self::send('reservas/editar_email', [\n 'cliente_id' => $data['cliente_id'],\n 'email' => $data['email'],\n ]);\n\n return $response;\n }", "public function saveEmail()\n {\n $this->validate([\n 'email' => [\n 'sometimes',\n 'required',\n 'email',\n Rule::unique(shopper_table('users'), 'email')->ignore($this->customer_id),\n ],\n ]);\n\n $this->updateValue(\n 'email',\n $this->email,\n 'Customer Email address updated successfully.'\n );\n\n $this->emailUpdate = false;\n $this->emit('profileUpdate');\n }", "public function setEmail($newEmail) {\n //first, trim the input of excess whitespace\n $newEmail = trim($newEmail);\n \n //second, sanitize the email of all invalid email characters\n $newEmail = filter_var($newEmail, FILTER_SANITIZE_EMAIL);\n \n //finally, bring the email out of quarantine\n $this->email = $newEmail;\n }", "public function email_must_be_unique_on_update()\n {\n User::factory()->create([\n 'email' => '[email protected]',\n ]);\n\n $this\n ->from(\"nova/resources/users/{$this->user->id}/edit\")\n ->put(\n \"nova-api/users/{$this->user->id}\",\n [\n 'email' => '[email protected]',\n ]\n )\n ->assertRedirect(\"nova/resources/users/{$this->user->id}/edit\")\n ->assertSessionHasErrors('email');\n }", "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_failed'));\n\t\t}\n\t}", "function change_recipient() {\n\t\treturn \"[email protected]\";\n\t}", "public function setEmail($mail);", "function reset_email()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Reset email\n if ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_new_email_failed'));\n }\n }" ]
[ "0.70404285", "0.69316673", "0.6927139", "0.69175583", "0.6824979", "0.6813773", "0.6729215", "0.66532266", "0.66166764", "0.6589006", "0.6583843", "0.6566653", "0.6562603", "0.65510255", "0.65164363", "0.6454262", "0.64516854", "0.64249766", "0.6392025", "0.63789344", "0.63657", "0.63506997", "0.6346708", "0.6334765", "0.6330153", "0.6321162", "0.6320392", "0.6317959", "0.63160855", "0.6312737" ]
0.71975356
0
Search clients by taxvat and name based on term
public function search($term) { try { $list = (self::MODEL) ::with('enderecos') ->where('nome', 'LIKE', "%{$term}%") ->orWhere('taxvat', 'LIKE', "%{$term}%") ->get(); return $this->listResponse(ClientTransformer::directSearch($list)); } catch (\Exception $exception) { return $this->listResponse([]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientByNameOrSurnameOrDni() {\n $term = Request::input('term', '');\n $results = array();\n $queries = User::where('role_id', 6)\n ->where(function($query) use ($term){\n $query->where('name', 'LIKE', '%'.$term.'%');\n $query->orWhere('surname', 'LIKE', '%'.$term.'%');\n $query->orWhere('dni', 'LIKE', '%'.$term.'%');\n })\n ->take(10)->get();\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->fullname().' ['.$query->dni.']'];\n return response()->json($results);\n }", "public function findByName() { \n\n $term = Request::input('term');\n $cities = []; \n if (($term) && ($term !== '')) {\n $search_term = Helpers::accentToRegex($term);\n $query_term = '/.*' . $search_term . '*/i';\n $cities = Cities::where('properties.nome_municipio', 'regexp', $query_term)->\n orderBy('properties.nome_municipio')->\n get(array('properties.geo_codigo', 'properties.nome_municipio', 'properties.sigla')); \n }\n\n return Response::json($cities); \n }", "function searchQuery($client, $textoAbuscar)\n {\n echo '<h2>SOLR: This is the result of your search in the Solr database with this text: \"'.$textoAbuscar.'\"</h2><br />';\n // get a select query instance\n $query = $client->createSelect();\n\n // get the facetset component\n $facetSet = $query->getFacetSet();\n\n // create a facet field instance and set options\n $facetSet->createFacetField('Rts')->setField('retweet_count');\n\n // set a query (all prices starting from 12)\n //$query->setQuery('price:[12 TO *]');\n $query->setQuery('full_text: *'.$textoAbuscar.'*');\n\n // set start and rows param (comparable to SQL limit) using fluent interface\n $query->setStart(2)->setRows(20);\n\n // set fields to fetch (this overrides the default setting 'all fields')\n //$query->setFields(array('ID','username','favorite_count', 'description','full_text'));\n\n // sort the results by price ascending\n //$query->addSort('price', $query::SORT_ASC);\n $query->addSort('favorite_count', $query::SORT_ASC);\n\n // this executes the query and returns the result\n $resultset = $client->select($query);\n\n // display the total number of documents found by solr\n echo 'NumFound: '.$resultset->getNumFound();\n\n // show documents using the resultset iterator\n foreach ($resultset as $document) {\n\n echo '<hr/><table>';\n\n // the documents are also iterable, to get all fields\n foreach ($document as $field => $value) {\n // this converts multivalue fields to a comma-separated string\n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n\n echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';\n }\n\n echo '</table>';\n }\n\n // display facet counts\n echo '<hr/>Facet counts for field \"retweet_count\":<br/>';\n $facet = $resultset->getFacetSet()->getFacet('Rts');\n foreach ($facet as $value => $count) {\n echo $value . ' [' . $count . ']<br/>';\n }\n\n }", "public function query($term) {\n $matches = $this->getMatchesService('vienna',$term,array('showSyn'=>false,'NearMatch'=>false,'includeCommonNames'=>true));\n return $matches;\n }", "public function get_trainees_by_taxcode() {\n $query_string = htmlspecialchars($_GET['query'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->trainee_user_list_autocomplete($query_string);\n print json_encode($result);\n exit;\n }", "function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }", "public function queryTaxonSearch(string $searchText, int $maxResponseAmount = 50, int $pageNumber = 1): Result\n {\n $findCommand = $this->fileMaker->newFindCommand($this->search_layout->getName());\n $findCommand->setLogicalOperator(operator: FileMaker::FIND_OR);\n\n # TODO move this to a database and UI to change options\n $taxonFields = match ($this->name) {\n \"avian\", \"herpetology\", \"mammal\" => array('Taxon::order', 'Taxon::family', 'Taxon::phylum', 'Taxon::genus', 'Taxon::class', 'Taxon::specificEpithet', 'Taxon::infraspecificEpithet'),\n \"entomology\" => array('Phylum', 'Class', 'Order', 'Family', 'Genus', 'Species', 'Subspecies'),\n \"algae\" => array('Phylum', 'Class', 'Genus', 'Species', 'Subspecies'),\n \"bryophytes\", \"fungi\", \"lichen\", \"vwsp\" => array('Family', 'Genus', 'Species', 'Subspecies'),\n \"fish\" => array('Class', 'Order', 'Family', 'Subfamily', 'nomenNoun', 'specificEpithet'),\n \"miw\" => array('Phylum', 'Class', 'Family', 'Genus', 'Species'),\n \"mi\" => array('Phylum', 'Class', 'Family', 'Genus', 'Specific epithet'),\n \"fossil\" => array('Phylum', 'Class', 'Family', 'Genus', 'Kingdom', 'Subphylum', 'Superclass', 'Subclass', 'Order', 'Suborder', 'Species', 'Common Name'),\n };\n\n $searchFieldNames = $this->search_layout->listFields();\n\n foreach ($taxonFields as $fieldName) {\n\n # check to make sure the field name is valid in the search layout\n # if a wrong field name is used a (Table not found) error is thrown by FMP\n if (in_array($fieldName, $searchFieldNames)) {\n $findCommand->addFindCriterion(\n fieldName: $fieldName, value: $searchText\n );\n }\n\n }\n\n $findCommand->setRange(skip: ($pageNumber - 1) * $maxResponseAmount, max: $maxResponseAmount);\n\n return $findCommand->execute();\n }", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}", "function get_customer_list_search($terms)\n {\n $this->company_db->select(\"c.*, CONCAT(c.tele_country_code, ' ', c.telephone_number) as telephone_number, CONCAT(c.cell_country_code , ' ', c.cellphone_number) as cellphone_number, CONCAT(c.fname, ' ', c.lname) as name\");\n $this->company_db->from('tbl_customer c');\n //$this->company_db->where('c.void', 'No');\n $column_search = array(\"c.address_line1\", \"CONCAT(c.tele_country_code, ' ', c.telephone_number)\", \"CONCAT(c.cell_country_code , ' ', c.cellphone_number)\", \"CONCAT(c.fname, ' ', c.lname)\");\n\n if(isset($terms) && !empty($terms)) // if datatable send POST for search\n {\n $i = 0;\n foreach ($column_search as $item) // loop column \n { \n if($i===0) // first loop\n {\n $this->company_db->group_start(); // open bracket. query Where with OR clause better with bracket. because maybe can combine with other WHERE with AND.\n $this->company_db->like($item, $terms);\n }\n else\n {\n $this->company_db->or_like($item, $terms);\n }\n \n if(count($column_search) - 1 == $i) //last loop\n $this->company_db->group_end(); //close bracket\n \n $i++;\n }\n }\n\n $query = $this->company_db->get();\n\n if($query->num_rows() >= 1)\n {\n return $query->result_array();\n }\n else\n {\n return array();\n }\n }", "function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }", "function search($term, $location, $price, $radius, $categories, $sort) {\n $url_params = array();\n \n $url_params['term'] = $term;\n $url_params['location'] = $location;\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\n\t$url_params['open_now'] = true;\n $url_params['price'] = $price;\n $url_params['radius'] = $radius;\n $url_params['categories'] = $categories;\n $url_params['sort_by'] = $sort;\n \n return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n}", "public function search($term = null);", "public static function getAllSdById($term){\n // ->join('clienttype as ct', function($join){\n // $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n // })\n // ->join('acctstat as as', function($join){\n // $join->on('c.AccountStatus', '=', 'as.AcctStatID');\n // })\n // ->where('c.ClientID', '=', $clientIdSd)\n // ->get();\n\n return DB::table('client as c')\n ->join('clienttype as ct', function($join) {\n $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n })\n ->join('acctstat as acs', function($join){\n $join->on('c.AccountStatus', '=', 'acs.AcctStatID');\n })\n ->where('c.ClientID', '=', $term)\n ->orWhere('c.FName', 'like', '%'.$term.'%')\n ->orWhere('c.LName', 'like', '%'.$term.'%')\n // ->where('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n ->paginate(10);\n }", "function customer_search() {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "public function getAccountsBasedOnSearchTerm(Request $request)\n {\n $searchTerm = $request -> searchTerm;\n $options;\n if(!isset($request -> searchTerm))\n $options = ChartOfAccount::get();\n else\n {\n $options = ChartOfAccount :: where('description','like','%'.$searchTerm.'%')\n ->Orwhere('general_code','like','%'.$searchTerm.'%')\n ->Orwhere('name','like','%'.$searchTerm.'%')\n ->Orwhere('company_code','like','%'.$searchTerm.'%')\n ->get();\n }\n $data = array();\n foreach($options as $option)\n {\n $data[] = array('id' => $option -> id,'text' => $option -> name.'('.$option -> general_code.')');\n }\n return json_encode($data);\n }", "public function searchAction() {\n\t\n\t if($this->getRequest()->isXmlHttpRequest()){\n\t\n\t $term = $this->getParam('term');\n\t $id = $this->getParam('id');\n\t\n\t if(!empty($term)){\n\t $term = \"%$term%\";\n\t $records = Invoices::findbyCustomFields(\"formatted_number LIKE ? OR number LIKE ?\", array($term, $term));\n\t die(json_encode($records));\n\t }\n\t\n\t if(!empty($id)){\n\t $records = Invoices::find($id);\n\t if($records){\n\t $records = $records->toArray();\n\t }\n\t die(json_encode(array($records)));\n\t }\n\t\n\t $records = Invoices::getAll();\n\t die(json_encode($records));\n\t }else{\n\t die();\n\t }\n\t}", "public function getListOfCustomers($term)\n {\n // build find() options\n $filter = NULL;\n if ($term) {\n $regex = new Regex($term, 'i');\n $filter = ['name' => $regex];\n }\n $options = [\n 'sort' => ['name' => 1],\n 'projection' => ['name' => 1]\n ];\n\n // perform find\n $result = [];\n try {\n $cursor = $this->find($this->customers, $filter, $options);\n foreach ($cursor as $document) {\n //$result[] = var_export($document, TRUE);\n $result[$document->name] = $document->name;\n }\n } catch (Throwable $e) {\n error_log(__METHOD__ . ':' . $e->getMessage());\n $result[] = 'ERROR: unable to find customers';\n }\n return $result;\n }", "public function actionCustomerSearch()\t\r\n {// for autocomplete will do DB search for Customers and Lands\r\n\t\t\r\n\t\tif (isset($_GET['term'])) { // first search that \r\n // if user arabic name \r\n // or english name \r\n // or miobile number match\r\n \r\n \r\n $keyword = $_GET[\"term\"];\r\n\r\n $searchCriteria=new CDbCriteria;\r\n // the new library \r\n if (isset($_GET['term'])) \r\n if ($keyword != '') {\r\n $keyword = @$keyword;\r\n $keyword = str_replace('\\\"', '\"', $keyword);\r\n\r\n $obj = new ArQuery();\r\n $obj->setStrFields('CustomerNameArabic');\r\n $obj->setMode(1);\r\n\r\n $strCondition = $obj->getWhereCondition($keyword);\r\n } \r\n\r\n\r\n//\t\t\t$qtxt = 'SELECT CustomerID, Nationality, CustomerNameArabic from CustomerMaster WHERE ('.$strCondition.' OR CustomerNameEnglish LIKE :name OR MobilePhone Like :name) limit 25';\r\n//\t\t\t$command = Yii::app()->db->createCommand($qtxt);\r\n//\t\t\t$command->bindValue(':name','%'.$_GET['term'].'%',PDO::PARAM_STR);\r\n//\t\t\t$res = $command->queryAll();\r\n// if( count($res)<1){//run if no customer found \r\n //search DB if Land ID matches\r\n\r\n $qtxt = 'SELECT LandID lnd from LandMaster WHERE LandID Like :name';\r\n $command = Yii::app()->db->createCommand($qtxt);\r\n $command->bindValue(':name','%'.$_GET['term'].'%',PDO::PARAM_STR);\r\n $res = $command->queryColumn();\r\n\r\n// }\r\n\t\t}\r\n\t\tprint CJSON::encode($res);\r\n \r\n // die ($strCondition);\r\n\t}", "function getCustomers() {\n $filter = $_POST['filter']; // User's selected filter (default \"Amount Owed\")\n $search = $_POST['clientSearch']; // User's entered search term\n\n if ($search === \"\") {\n $stmt = $GLOBALS['con']->prepare(\"SELECT * FROM customerInfo ORDER BY $filter\");\n // $stmt->bind_param(\"s\", $filter);\n } else {\n $stmt = $GLOBALS['con']->prepare(\"SELECT * FROM customerInfo WHERE first_name LIKE ? OR last_name LIKE ? ORDER BY $filter\");\n $stmt->bind_param(\"ss\", $search, $search);\n }\n\n // $result = mysqli_query($GLOBALS[\"con\"], $sql);\n $stmt->execute();\n $result = $stmt->get_result();\n \n if (mysqli_num_rows($result) > 0) {\n return $result;\n }\n }", "public function get_trainees_by_taxcode_autocomplete() {\n\n $query_string = htmlspecialchars($_GET['query'], ENT_QUOTES, 'UTF-8');\n $this->load->model('trainee_model', 'traineemodel');\n $result = $this->traineemodel->trainee_user_list_autocomplete($query_string);\n print json_encode($result);\n exit;\n }", "function customer_search()\n {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'),100);\n echo json_encode($suggestions);\n }", "function get_term_by($field, $value, $taxonomy = '', $output = \\OBJECT, $filter = 'raw')\n {\n }", "public static function getPersons($term) {\n $sql = \"SELECT \n usuarios.dni, usuarios.nombre_persona, usuarios.dni+' '+usuarios.nombre_persona as label\n FROM\n (select \n persona.CodPer as dni\n ,persona.Nombres\n ,persona.Ape1\n ,persona.Ape2\n ,(RTRIM(persona.Nombres)+' '+RTRIM(persona.Ape1)+' '+RTRIM(persona.Ape2)) as nombre_persona\n from dbo.Identis persona\n left join dbo.permis usuario ON(\n persona.CodPer = usuario.LogIn\n )\n where usuario.FHasta >= GETDATE()\n ) usuarios\n WHERE usuarios.nombre_persona+usuarios.dni LIKE '%{$term}%'\n group BY usuarios.dni, usuarios.nombre_persona \";\n\n $command = Yii::$app->chacad->createCommand($sql);\n return $command->queryAll();\n }", "public function scopeSearch($query, $term);", "function nameSearch($conn, $search_term)\n {\n $query = \"SELECT DISTINCT whwp_Advert.advert_id FROM whwp_Advert \"\n . \"WHERE advert_bookname = :search_term \"\n . \"ORDER BY whwp_Advert.advert_price DESC\";\n $conn->prepQuery($query);\n $conn->bind('search_term', $search_term);\n $advert = $conn->resultset();\n return $advert;\n }", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function search() {\n // Get CDbCriteria instance\n $dbCriteria = new CDbCriteria;\n // Search for client name\n $dbCriteria->compare('name', Yii::app()->request->getQuery('name', ''), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $dbCriteria,\n 'pagination' => array(\n 'pageSize' => 10,\n ),\n ));\n }", "public function filtrarclientes(){\n\n $this->request->allowMethod(['get']);\n \n $keyword = $this->request->query('keyword');\n $activo = $this->request->query('activo');\n\n $condiciones = array();\n\n $condiciones['name like '] = '%'.$keyword.'%';\n\n if($activo){\n $condiciones['borrado = '] = false;\n }\n \n $query = $this->Clientes->find('all', [\n 'conditions' => $condiciones,\n 'order' => [\n 'Clientes.id' => 'ASC'\n ],\n 'limit' => 100\n ]);\n\n $clientes = $this->paginate($query);\n $this->set(compact('clientes'));\n $this->set('_serialize', 'clientes');\n }", "public function search();" ]
[ "0.5964222", "0.58904326", "0.58880407", "0.5870145", "0.5857385", "0.58512956", "0.58434504", "0.58061737", "0.57879436", "0.57647765", "0.5729846", "0.57204103", "0.5701965", "0.56787694", "0.56764734", "0.5640589", "0.5637458", "0.56226903", "0.5610206", "0.5608447", "0.55702066", "0.55365133", "0.55297625", "0.54624265", "0.5450473", "0.54376966", "0.5423939", "0.5419672", "0.54190063", "0.5413779" ]
0.62356377
0
constructor that initializes shelves
function __construct() { $this->shelf = new SplFixedArray(10); include("../Database/db_connect.php"); $shelf_id_results = mysqli_query($dbhandle, "SELECT DISTINCT(Shelfid) FROM shelves WHERE Groupnumber = '31' ORDER BY Shelfid") or die(mysql_error()); // $i = 0; // while($row = mysqli_fetch_array($shelf_id_results) && $i < 10) // { // $this->shelf[$i] = new shelf($row['Shelfid']); // $i++; // } for($i = 0; $i < 10; $i++) { $this->shelf[$i] = new shelf($i); } //set copyID to value of highest found copyID $result = mysqli_query($dbhandle, "SELECT * FROM bookscopy WHERE Groupnumber = '31'") or die(mysql_error()); $highest_copyID = 0; while($row = mysqli_fetch_array($result)) { if($row['Copyid'] > $highest_copyID) { $highest_copyID = $row['Copyid']; } } $this->copyid = $highest_copyID; include("../Database/db_close.php"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->shelfs[0] = new Shelf;\n $this->shelfs[1] = new Shelf;\n $this->shelfs[2] = new Shelf;\n }", "function __construct()\n\t{\n parent::__construct();\n\t\t$this->set_table_name(\"shelf\");\n\n\t}", "public function __construct()\n {\n $this->_storage = new \\SplObjectStorage();\n }", "protected function __construct()\n {\n $this->instances = new Registry;\n }", "public function __construct(/* ... */)\n {\n $this->_storage = new \\SplObjectStorage();\n }", "public function __construct()\n {\n $this->sicBlocks = [];\n $this->cachedInstances = [];\n }", "public function __construct()\n {\n $this->initStorageObjects();\n }", "public function __construct() {\n $this->blueprints = collect([]);\n // Where to store the latest index\n $this->index = collect([]);\n }", "public function __construct() {\n\t\t\t$this->clients = new \\SplObjectStorage;\n\t\t}", "public function __construct(){\n\n $this->routes = new \\SplObjectStorage();\n\n }", "public function __construct()\n\t{\n\t\t$this->clients = new \\SplObjectStorage();\n\t}", "public function __construct() {\n\t\t$this->keysDB = array();\n\t}", "public function __construct()\n {\n $this->roles = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n $this->helpers = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }", "public function __construct() {\n\t\t@mkdir($this->storage, 0777, true);\n\t}", "protected function initStorageObjects() {\n\t\t$this->spieler = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t}", "public function __construct()\n {\n $this->sharedInstances = [];\n }", "protected function initStorageObjects() {}", "protected function initStorageObjects() {}", "protected function initStorageObjects() {}", "public function __construct()\n {\n $this->hosts = [];\n $this->directInjectors = [];\n $this->defaultItems = [];\n }", "protected function initStorageObjects() {\n\t\t\n\t}", "protected function initStorageObjects() {\n\t\t\n\t}", "public function initStorage() {}", "public function __construct()\n {\n $this->storage = array();\n }", "protected function _construct()\n {\n $this->_init('varnish/cms_page_store');\n }", "protected function initializeStorageObjects() {}", "public function __construct() {\n $this->_map = [];\n $this->_keys = [];\n }", "protected function initStorageObjects() {\n\t\t$this->konzerts = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t\t$this->singers = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t}", "protected function initStorageObjects()\n {\n }", "public function __construct() {\n\t\t// creating a collection for storing menus\n\t\t$this->collection = new Collection ();\n\t}" ]
[ "0.7105411", "0.6188716", "0.5965632", "0.5897682", "0.58831143", "0.5865134", "0.5843209", "0.58344215", "0.57937664", "0.5765493", "0.57462496", "0.57411635", "0.5698522", "0.5690351", "0.5674755", "0.5655588", "0.5643194", "0.5641339", "0.5641339", "0.5639945", "0.5603471", "0.5603471", "0.5590518", "0.5585123", "0.55690193", "0.55483496", "0.55458033", "0.5537617", "0.55370694", "0.5513286" ]
0.6195977
1
Reading data from inaccessible properties is not allowed.
public function __get($name) { throw new \Foundation\Exception\BadMethodCallException('Reading data from inaccessible properties is not allowed.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function allowProperties() {}", "public function shouldSkipUnknownProperties() {}", "abstract protected function getProperties();", "function shouldSkipUnknownProperties() ;", "abstract protected function get_properties();", "protected function _getReadonlyProperties()\n {\n return array();\n }", "abstract protected function properties();", "public function skipUnknownProperties() {}", "abstract public function getProperties();", "function testInvalidPropertyGet() {\n\t\t$o = new \\Scrivo\\UserRole(self::$context);\n\t\t$data = $o->sabicasElRey;\n\t}", "public function allowAllProperties() {}", "private function readLoaderProperties()\n {\n // Read all properties of the loader.\n foreach ((new \\ReflectionClass($this->loader))->getProperties(\\ReflectionProperty::IS_PRIVATE) as $property) {\n $this->properties[$property->name] = static::getObjectAttribute($this->loader, $property->name);\n }\n }", "public function skipProperties() {}", "public function allowAllPropertiesExcept() {}", "public function getPropData(): array{\n if(!$this->logged) throw new ClientNotLogged();\n else return $this->proprietary;\n }", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function readObject();", "abstract public function getRawAdditionalProperties();", "public function isReadProtected() {\n\t\treturn $this->getReadProtected();\n\t}", "private function _validateModifiable()\n {\n if(!($this->_getDataSource() instanceof wCrudAdapter))\n {\n throw new Exception('Object is read-only.');\n }\n }", "public function _getCleanProperties() {}", "public function listInvalidProperties();", "private function loadReadDataIntoMDR() {\r\n \r\n }", "public function getReadOnlyFields();", "public function getExposedProperties(): array;", "public function read()\n {\n }", "public function shouldSkipUnknownProperties(): bool\n {\n return $this->skipUnknownProperties;\n }" ]
[ "0.70132905", "0.6672684", "0.6667319", "0.66350776", "0.6629763", "0.65768623", "0.65514445", "0.64856416", "0.63355434", "0.6268636", "0.6250038", "0.6249849", "0.61742264", "0.61074954", "0.5956313", "0.5937971", "0.5937971", "0.5937971", "0.59364015", "0.59116644", "0.5884877", "0.58267313", "0.5774249", "0.5774176", "0.5772645", "0.5753539", "0.5744263", "0.5684921", "0.5677862", "0.5676897" ]
0.7304745
1
Sync the changes that were pending for the recurring downtime configuration after apply config is complete Runs after apply/reconfigure subsys command has been completed
function recurringdowntime_apply_pending_changes($cbtype, &$cbargs) { // Verify this is an apply config and it finished successfully if ($cbargs['command'] != COMMAND_NAGIOSCORE_APPLYCONFIG || $cbargs['return_code'] != 0) { return; } // Verify there are pending changes $pending = recurringdowntime_get_pending_changes(); if (empty($pending)) { return; } // Apply the actual changes to the cfg $cfg = recurringdowntime_get_cfg(); foreach ($pending as $p) { if (array_key_exists('host_name', $p)) { $cfg[$p['cfg_id']]['host_name'] = $p['host_name']; } else if (array_key_exists('service_description', $p)) { $cfg[$p['cfg_id']]['service_description'] = $p['service_description']; } else if (array_key_exists('hostgroup_name', $p)) { $cfg[$p['cfg_id']]['hostgroup_name'] = $p['hostgroup_name']; } else if (array_key_exists('servicegroup_name', $p)) { $cfg[$p['cfg_id']]['servicegroup_name'] = $p['servicegroup_name']; } } recurringdowntime_write_cfg($cfg); recurringdowntime_update_pending_changes(array()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reload_all_sync() {\n\tglobal $config;\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* set up our timezone */\n\tsystem_timezone_configure();\n\n\t/* set up our hostname */\n\tsystem_hostname_configure();\n\n\t/* make hosts file */\n\tsystem_hosts_generate();\n\n\t/* generate resolv.conf */\n\tsystem_resolvconf_generate();\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n\n\t/* start dyndns service */\n\tservices_dyndns_configure();\n\n\t/* configure cron service */\n\tconfigure_cron();\n\n\t/* start the NTP client */\n\tsystem_ntp_configure();\n\n\t/* sync pw database */\n\tunlink_if_exists(\"/etc/spwd.db.tmp\");\n\tmwexec(\"/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd\");\n\n\t/* restart sshd */\n\tsend_event(\"service restart sshd\");\n\n\t/* restart webConfigurator if needed */\n\tsend_event(\"service restart webgui\");\n}", "function recurringdowntime_ccm_hostservice_sync($cbtype, &$cbargs)\n{\n $cfg = recurringdowntime_get_cfg();\n $pending = recurringdowntime_get_pending_changes();\n\n // Check if the object is part of the pending changes\n foreach ($pending as $i => $p) {\n if ($p['object_id'] == $cbargs['id']) {\n $tmp = $p;\n if ($cbargs['type'] == 'host') {\n $tmp['host_name'] = $cbargs['host_name'];\n } else if ($cbargs['type'] == 'service') {\n $tmp['service_description'] = $cbargs['service_description'];\n }\n $pending[$i] = $tmp;\n recurringdowntime_update_pending_changes($pending);\n return;\n }\n }\n\n // Check if host name changed\n if ($cbargs['type'] == 'host') {\n\n // Check if host name changed\n if (!empty($cbargs['old_host_name']) && $cbargs['host_name'] != $cbargs['old_host_name']) {\n foreach ($cfg as $id => $c) {\n\n if ($c['schedule_type'] == 'host' || $c['schedule_type'] == 'service') {\n\n // Replace config host_name that used the old host name\n if ($c['host_name'] == $cbargs['old_host_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'host_name' => $cbargs['host_name']\n );\n }\n\n }\n\n }\n }\n\n\n // Check for service description change\n } else if ($cbargs['type'] == 'service') {\n\n // This one is complicated ... we will only do the hosts defined directly to the service\n if (!empty($cbargs['old_service_description']) && $cbargs['service_description'] != $cbargs['old_service_description']) {\n foreach ($cfg as $id => $c) {\n if (array_key_exists('service_description', $c) && $c['service_description'] == $cbargs['old_service_description']) {\n\n // Get all hosts attached to service\n $sql = \"SELECT host_name FROM nagiosql.tbl_lnkServiceToHost AS lnk\n LEFT JOIN nagiosql.tbl_host AS h ON h.id = lnk.idSlave\n WHERE idMaster = \".intval($cbargs['id']).\";\";\n if (!($rs = exec_sql_query(DB_NAGIOSQL, $sql))) {\n continue;\n }\n\n // Check all hosts against current cfg\n $arr = $rs->GetArray();\n foreach ($arr as $a) {\n if ($c['host_name'] == $a['host_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'service_description' => $cbargs['service_description']\n );\n }\n }\n\n }\n }\n }\n\n }\n\n // Save pending changes\n recurringdowntime_update_pending_changes($pending);\n}", "function checkmk_sync_on_changes() {\n\tglobal $config;\n\n\tif (is_array($config['installedpackages']['checkmksync']['config'])) {\n\t\t$checkmk_sync = $config['installedpackages']['checkmksync']['config'][0];\n\t\t$synconchanges = $checkmk_sync['synconchanges'];\n\t\t$synctimeout = $checkmk_sync['synctimeout'] ?: '250';\n\t\tswitch ($synconchanges) {\n\t\t\tcase \"manual\":\n\t\t\t\tif (is_array($checkmk_sync['row'])) {\n\t\t\t\t\t$rs = $checkmk_sync['row'];\n\t\t\t\t} else {\n\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync is enabled but there are no hosts configured as replication targets.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"auto\":\n\t\t\t\tif (is_array($config['hasync'])) {\n\t\t\t\t\t$system_carp = $config['hasync'];\n\t\t\t\t\t$rs[0]['ipaddress'] = $system_carp['synchronizetoip'];\n\t\t\t\t\t$rs[0]['username'] = $system_carp['username'];\n\t\t\t\t\t$rs[0]['password'] = $system_carp['password'];\n\t\t\t\t\t$rs[0]['syncdestinenable'] = FALSE;\n\n\t\t\t\t\t// XMLRPC sync is currently only supported over connections using the same protocol and port as this system\n\t\t\t\t\tif ($config['system']['webgui']['protocol'] == \"http\") {\n\t\t\t\t\t\t$rs[0]['syncprotocol'] = \"http\";\n\t\t\t\t\t\t$rs[0]['syncport'] = $config['system']['webgui']['port'] ?: '80';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rs[0]['syncprotocol'] = \"https\";\n\t\t\t\t\t\t$rs[0]['syncport'] = $config['system']['webgui']['port'] ?: '443';\n\t\t\t\t\t}\n\t\t\t\t\tif ($system_carp['synchronizetoip'] == \"\") {\n\t\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC CARP/HA sync is enabled but there are no system backup hosts configured as replication targets.\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rs[0]['syncdestinenable'] = TRUE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC CARP/HA sync is enabled but there are no system backup hosts configured as replication targets.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t\t\tbreak;\n\t\t}\n\t\tif (is_array($rs)) {\n\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync is starting.\");\n\t\t\tforeach ($rs as $sh) {\n\t\t\t\t// Only sync enabled replication targets\n\t\t\t\tif ($sh['syncdestinenable']) {\n\t\t\t\t\t$sync_to_ip = $sh['ipaddress'];\n\t\t\t\t\t$port = $sh['syncport'];\n\t\t\t\t\t$username = $sh['username'] ?: 'admin';\n\t\t\t\t\t$password = $sh['password'];\n\t\t\t\t\t$protocol = $sh['syncprotocol'];\n\n\t\t\t\t\t$error = '';\n\t\t\t\t\t$valid = TRUE;\n\n\t\t\t\t\tif ($password == \"\") {\n\t\t\t\t\t\t$error = \"Password parameter is empty. \";\n\t\t\t\t\t\t$valid = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_ipaddr($sync_to_ip) && !is_hostname($sync_to_ip) && !is_domain($sync_to_ip)) {\n\t\t\t\t\t\t$error .= \"Misconfigured Replication Target IP Address or Hostname. \";\n\t\t\t\t\t\t$valid = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_port($port)) {\n\t\t\t\t\t\t$error .= \"Misconfigured Replication Target Port. \";\n\t\t\t\t\t\t$valid = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tif ($valid) {\n\t\t\t\t\t\tcheckmk_do_xmlrpc_sync($sync_to_ip, $port, $protocol, $username, $password, $synctimeout);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync with '{$sync_to_ip}' aborted due to the following error(s): {$error}\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync completed.\");\n\t\t}\n \t}\n}", "public static function syncConfig()\n {\n $addon = self::addon();\n\n if (!self::isBackwardsCompatible() && !$addon->hasConfig('synchronize')) {\n $addon->setConfig('synchronize', false);\n\n if (\n $addon->getConfig('synchronize_actions') == true ||\n $addon->getConfig('synchronize_modules') == true ||\n $addon->getConfig('synchronize_templates') == true ||\n $addon->getConfig('synchronize_yformemails') == true\n ) {\n $addon->setConfig('synchronize', true);\n\n // Set developer synchronizing actions according to theme settings\n if ($addon->getConfig('synchronize_templates')) {\n rex_addon::get('developer')->setConfig('templates', true);\n }\n if ($addon->getConfig('synchronize_modules')) {\n rex_addon::get('developer')->setConfig('modules', true);\n }\n if ($addon->getConfig('synchronize_actions')) {\n rex_addon::get('developer')->setConfig('actions', true);\n }\n if ($addon->getConfig('synchronize_yformemails')) {\n rex_addon::get('developer')->setConfig('yform_email', true);\n }\n }\n\n $addon->removeConfig('synchronize_actions');\n $addon->removeConfig('synchronize_modules');\n $addon->removeConfig('synchronize_templates');\n $addon->removeConfig('synchronize_yformemails');\n }\n }", "function recurringdowntime_ccm_group_sync($cbtype, &$cbargs)\n{\n $cfg = recurringdowntime_get_cfg();\n $pending = recurringdowntime_get_pending_changes();\n\n // Check if the object is part of the pending changes\n foreach ($pending as $i => $p) {\n if ($p['object_id'] == $cbargs['id']) {\n $tmp = $p;\n if ($cbargs['type'] == 'hostgroup') {\n $tmp['hostgroup_name'] = $cbargs['hostgroup_name'];\n } else if ($cbargs['type'] == 'servicegroup') {\n $tmp['servicegroup_name'] = $cbargs['servicegroup_name'];\n }\n $pending[$i] = $tmp;\n recurringdowntime_update_pending_changes($pending);\n return;\n }\n }\n\n if ($cbargs['type'] == 'hostgroup') {\n\n if ($cbargs['old_hostgroup_name'] != $cbargs['hostgroup_name']) {\n foreach ($cfg as $id => $c) {\n if (array_key_exists('hostgroup_name', $c) && $c['hostgroup_name'] == $cbargs['old_hostgroup_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'hostgroup_name' => $cbargs['hostgroup_name']\n );\n }\n }\n }\n\n } else if ($cbargs['type'] == 'servicegroup') {\n\n if ($cbargs['old_servicegroup_name'] != $cbargs['servicegroup_name']) {\n foreach ($cfg as $id => $c) {\n if (array_key_exists('servicegroup_name', $c) && $c['servicegroup_name'] == $cbargs['old_servicegroup_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'servicegroup_name' => $cbargs['servicegroup_name']\n );\n }\n }\n }\n\n }\n\n // Save pending changes\n recurringdowntime_update_pending_changes($pending);\n}", "function postUpdate()\n\t{\n\t\t$this->write();\n\n\t\tif ($this->subaction === 'schedule_conf') {\n\t\t\texec(\"sh /script/fix-cron-backup\");\n\n\t\t}\n\t}", "public function afterSyncing() {}", "public function run_sync_process(){\n //Verify if module is enabled\n if(Mage::helper('connector')->isEnabled()) {\n\n \t//Set sync type\n \t\t$sync_type = Minematic_Connector_Model_Config::SYNC_TYPE_MAGENTO_SIDE;\n\n //Log Starting sync process msg\n Mage::helper('connector')->logSyncProcess(\"Starting synchronization task job...\", $sync_type);\n\n try {\n\n //Sync all data\n Mage::getModel('connector/synchronization')->sync_data($sync_type, Minematic_Connector_Model_Config::DATA_TYPE_ALL);\n\n } catch (Exception $e) {\n\n \t// Logging Exceptions\n Mage::helper('connector')->logSyncProcess($e->getMessage(), $sync_type, \"ERROR\");\n \t\n }\n\n //Log Finishing sync process msg\n Mage::helper('connector')->logSyncProcess(\"Finishing synchronization task job.\", $sync_type);\n }\n }", "public function applyChanges()\n {\n $em = $this->doctrine->getManager();\n $em->flush();\n\n // TODO: Can we be sure that the changes are available in the DB now?\n $ch = $this->getMasterRabbit()->channel();\n $msg = new AMQPMessage(\"sync\");\n $ch->basic_publish($msg, \"\", $this->name . \"_master\");\n }", "function resync_all_package_configs($show_message = false) {\n\tlog_error(gettext(\"Resyncing configuration for all packages.\"));\n\n\tif ($show_message == true) {\n\t\techo \"Syncing packages:\";\n\t}\n\n\tforeach (config_get_path('installedpackages/package', []) as $idx => $package) {\n\t\tif (empty($package['name'])) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ($show_message == true) {\n\t\t\techo \" \" . $package['name'];\n\t\t}\n\t\tif (platform_booting() != true) {\n\t\t\tstop_service(get_package_internal_name($package));\n\t\t}\n\t\tsync_package($package['name']);\n\t\tupdate_status(gettext(\"Syncing packages...\") . \"\\n\");\n\t}\n\n\tif ($show_message == true) {\n\t\techo \" done.\\n\";\n\t}\n}", "public function sync()\n {\n $result = '';\n foreach ($this->hosts() as $host) {\n $result .= $host;\n $result .= \"\\n\";\n }\n file_put_contents($this->configFilePath(), $result);\n }", "function tcupdate(){\n $settings = $this->get_settings();\n exec( $settings['CMD_SUDO'].' /usr/local/pia/include/transmission-config.sh');\n}", "private function refresh_db_config()\n {\n $this->systemConfiguration->where(true, true);\n foreach ($this->scheduleMapping as $scheduleType) {\n foreach ($scheduleType as $where) {\n $this->systemConfiguration->orWhere('type', $where);\n }\n }\n $this->config = $this->systemConfiguration->select('type', 'value')->get()->toArray();\n }", "public function beforeSyncing() {}", "public function cleanUpOldRunningConfigurations() {}", "abstract protected function _updateConfiguration();", "public function manualSync()\n {\n // Only run Auto Sync Jobs\n \n $job = Mage::getModel('mailup/job');\n /* @var $job MailUp_MailUpSync_Model_Job */\n \n foreach($job->fetchManualSyncQueuedJobsCollection() as $job) {\n \n }\n }", "public function migrate() : void {\r\n\t\t\t$currentSettings = new ConfigContainer();\r\n\r\n\t\t\tif (file_exists($this->settingsFile)) {\r\n\t\t\t\t$currentSettings = new ConfigContainer(file_get_contents($this->settingsFile));\r\n\t\t\t}\r\n\r\n\t\t\tif (!$currentSettings->has('configVersion')) {\r\n\t\t\t\t$currentSettings->set('configVersion', 0, FieldTypes::INTEGER);\r\n\t\t\t}\r\n\r\n\t\t\t$filesToApply = array();\r\n\t\t\t$currentVersion = $currentSettings->get('configVersion');\r\n\r\n\t\t\tforeach ($this->files as $file) {\r\n\t\t\t\tif ($file->origVersion >= $currentVersion) {\r\n\t\t\t\t\t$filesToApply[] = $file;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($filesToApply as $file) {\r\n\t\t\t\tforeach ($file->actions as $action) {\r\n\t\t\t\t\tswitch ($action->operator->getValue()) {\r\n\t\t\t\t\t\tcase MigrationOperators::ADD:\r\n\t\t\t\t\t\t\tif (!$currentSettings->has($action->field)) {\r\n\t\t\t\t\t\t\t\t$currentSettings->set($action->field, $action->value, $action->type->getValue());\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::CHANGE:\r\n\t\t\t\t\t\t\t$currentSettings->set($action->field, $action->value);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::REMOVE:\r\n\t\t\t\t\t\t\t$currentSettings->remove($action->field);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::RENAME:\r\n\t\t\t\t\t\t\t$currentSettings->rename($action->field, $action->value);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// @codeCoverageIgnoreStart\r\n\t\t\t\t\t\tdefault:\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// @codeCoverageIgnoreEnd\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$currentSettings->set('configVersion', intval($file->destVersion));\r\n\t\t\t}\r\n\r\n\t\t\tfile_put_contents($this->settingsFile, json_encode($currentSettings, JSON_PRETTY_PRINT));\r\n\r\n\t\t\treturn;\r\n\t\t}", "public function saveSystemConfig($observer)\n {\n Mage::getSingleton('adminhtml/session')->setMessages(Mage::getModel('core/message_collection'));\n\n Mage::getModel('core/config_data')\n ->load(self::CRON_STRING_PATH, 'path')\n ->setValue($this->_getSchedule())\n ->setPath(self::CRON_STRING_PATH)\n ->save();\n\n Mage::app()->cleanCache();\n\n $this->configCheck();\n\n // If there are errors in config, do not progress further as it may be testing old data\n $currentMessages = Mage::getSingleton('adminhtml/session')->getMessages();\n foreach ($currentMessages->getItems() as $msg) {\n if ($msg->getType() != 'success') {\n return;\n }\n }\n\n $messages = array();\n\n // Close connection to avoid mysql gone away errors\n $res = Mage::getSingleton('core/resource');\n $res->getConnection('core_write')->closeConnection();\n\n // Test connection\n $storeId = Mage::app()->getStore();\n $usernameWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/username_ws');\n $passwordWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/password_ws');\n $retConn = Mage::helper('emailchef')->testConnection($usernameWs, $passwordWs, $storeId);\n $messages = array_merge($messages, $retConn);\n\n // Config tests\n $retConfig = Mage::helper('emailchef')->testConfig();\n $messages = array_merge($messages, $retConfig);\n\n // Re-open connection to avoid mysql gone away errors\n $res->getConnection('core_write')->getConnection();\n\n // Add messages from test\n if (count($messages) > 0) {\n foreach ($messages as $msg) {\n $msgObj = Mage::getSingleton('core/message')->$msg['type']($msg['message']);\n Mage::getSingleton('adminhtml/session')->addMessage($msgObj);\n }\n }\n }", "public function setup_sync()\n {\n }", "public function run()\n {\n // Include everything we will potentially run here.\n // To make sure that old code is executed for this instance.\n include_once 'Libs/FileSystem/FileSystem.inc';\n Channels::includeSystem('Patching');\n Channels::includeSystem('SystemConfig');\n\n if (Channels::systemExists('Log') === TRUE) {\n Channels::includeSystem('Log');\n }\n\n if (Channels::systemExists('SystemConfigSplashScreenWidget') === TRUE) {\n Channels::includeSystem('SystemConfigSplashScreenWidget');\n }\n\n // Let it get the up-to-date Bugzilla login info and update the file.\n if (Channels::systemExists('Bugzilla') === TRUE) {\n Channels::includeSystem('Bugzilla');\n Bugzilla::writeBugzillaLoginInfo();\n }\n\n // Find the first scheduled patch and apply it.\n $config = Patching::getPatchingConfig();\n $patches = Patching::getPendingPatches();\n $info = Patching::getPatchingInfo();\n $oldRev = $config['revision'];\n $reboot = FALSE;\n if (empty($patches) === FALSE) {\n $name = array_shift($patches);\n $parts = explode('_', $name);\n $newRev = $parts[2];\n $status = self::applyPatch($name);\n if ($status === TRUE) {\n // Apply ok, archive it and notify central server.\n Patching::archivePatch($name);\n Patching::wsNotifyApplied($newRev, $oldRev);\n foreach ($info as $i) {\n if ($i['name'] === $name) {\n if (isset($i['reboot']) === TRUE) {\n if ($i['reboot'] === TRUE) {\n // Need to issue a system reboot command.\n $reboot = TRUE;\n break;\n }\n }\n }\n }\n\n // Update the patching config.\n $config['revision'] = $newRev;\n $config['last_updated'] = time();\n } else {\n // Apply fail, unschedule all pending patches.\n $pendingPatches = Patching::getPendingPatches();\n foreach ($pendingPatches as $p) {\n Patching::schedulePatch($p, NULL);\n }\n\n // Send error email and notify central server.\n Patching::sendInternalErrorMessage('ERR_PATCH_FAILED', $name);\n Patching::wsNotifyApplied($newRev, $oldRev, 'Failed to apply '.$name);\n }//end if\n } else {\n // Ask the central server for new updates, if any.\n $now = time();\n if ($now > ($config['last_checked'] + $config['check_interval'])) {\n Patching::wsCheckForUpdates();\n $config['last_checked'] = time();\n SystemConfig::setConfig('Patching', $config);\n }\n }//end if\n\n // No more pending patch, turn off the schedule toggle.\n $pendingPatches = Patching::getPendingPatches();\n if (empty($pendingPatches) === TRUE) {\n $config['schedule'] = FALSE;\n }\n\n SystemConfig::setConfig('Patching', $config);\n // Tells debian where to get operating system updates from.\n Channels::includeSystem('SquizSuite');\n $currProduct = SquizSuite::getProduct();\n $status = Patching::wsReleaseStatus();\n if ($status === 'GA') {\n @FileSystem::filePutContents('/etc/apt/sources.list', 'deb http://aptrepo-stable.squiz.net/ stable main');\n } else {\n @FileSystem::filePutContents('/etc/apt/sources.list', 'deb http://aptrepo-beta.squiz.net/ stable main');\n }\n\n // Issues a system reboot command if required.\n if ($reboot === TRUE) {\n exec('/sbin/reboot');\n }\n\n }", "function local_campusconnect_cron() {\n $ecslist = ecssettings::list_ecs();\n foreach ($ecslist as $ecsid => $name) {\n $ecssettings = new ecssettings($ecsid);\n\n if ($ecssettings->time_for_cron()) {\n mtrace(\"Checking for updates on ECS server '\".$ecssettings->get_name().\"'\");\n $connect = new connect($ecssettings);\n $queue = new receivequeue();\n\n try {\n $queue->update_from_ecs($connect);\n $queue->process_queue($ecssettings);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n mtrace(\"Sending updates to ECS server '\".$ecssettings->get_name().\"'\");\n try {\n export::update_ecs($connect);\n course_url::update_ecs($connect);\n enrolment::update_ecs($connect);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n $cms = participantsettings::get_cms_participant();\n if ($cms && $cms->get_ecs_id() == $ecssettings->get_id()) {\n // If we are updating from the ECS with the CMS attached, then check the directory mappings (and sort order).\n directorytree::check_all_mappings();\n }\n\n mtrace(\"Emailing any necessary notifications for '\".$ecssettings->get_name().\"'\");\n notification::send_notifications($ecssettings);\n\n $ecssettings->update_last_cron();\n }\n }\n}", "protected function updateConfig() {\n $config_factory = \\Drupal::configFactory();\n $settings = $config_factory->getEditable('message_subscribe.settings');\n $settings->set('use_queue', TRUE);\n $settings->save(TRUE);\n\n $settings = $config_factory->getEditable('mailsystem.settings');\n $settings->set('defaults', [\n 'sender' => 'swiftmailer',\n 'formatter' => 'swiftmailer',\n ]);\n $settings->set('modules', [\n 'swiftmailer' => [\n 'none' => [\n 'formatter' => 'swiftmailer',\n 'sender' => 'swiftmailer',\n ],\n ],\n 'message_notify' => [\n 'none' => [\n 'formatter' => 'swiftmailer',\n 'sender' => 'swiftmailer',\n ],\n ],\n ]);\n $settings->save(TRUE);\n\n $settings = $config_factory->getEditable('swiftmailer.message');\n $settings->set('format', 'text/html');\n $settings->set('respect_format', FALSE);\n $settings->save(TRUE);\n\n $settings = $config_factory->getEditable('flag.flag.subscribe_node');\n $settings->set('status', TRUE);\n $settings->save(TRUE);\n\n $settings = $config_factory->getEditable('user.role.authenticated');\n $permissions = $settings->get('permissions');\n foreach ([\n 'flag subscribe_node',\n 'unflag subscribe_node',\n ] as $perm) {\n if (!in_array($perm, $permissions)) {\n $permissions[] = $perm;\n }\n }\n $settings->set('permissions', $permissions);\n $settings->save(TRUE);\n\n }", "function configurationApply(){\n\t\t// this create a \"config/files/config-XXX.conf\" whith the maker found\n\t\t$makers = glob($_SERVER['DOCUMENT_ROOT'].'/config/makers/make-config-*.php', GLOB_BRACE);\n\t\t\n\t\t// get an unique ID for this apply action\n\t\t$actionId = uniqid();\n\n\t\t// run all makers in the directory\n\t\tforeach($makers as $maker) {\n\t\t\t$pat[0]= 'make-config-';\n\t\t\t$pat[1]= '.php';\n\t\t\t$remp[0]= '';\n\t\t\t$remp[1]= '';\n\t\t\t// get the single maker name\n\t\t\t$maker_name = basename($maker);\n\t\t\t$maker_name = str_replace($pat,$remp,$maker_name);\n\t\t\t// set the temp conf file for the maker\n\t\t\tglobal $config_done;\n\t\t\t$config_done = $_SERVER['DOCUMENT_ROOT'].'/config/files/config-'.$maker_name.'.conf';\n\t\t\tglobal $config_generated;\n\t\t\tglobal $config_user_do;\n\t\t\tglobal $config_syst;\n\t\t\t// run the maker\n\t\t\tinclude($maker);\n\t\t\t// create the config temp file\n\t\t\tif($file = @fopen($config_done, 'w')) {\n\t\t\t\tfwrite($file,$config_generated);\n\t\t\t\tfclose($file);\n\t\t\t\t// add the task to the \"podServerSystem\" queue (copy files to their system path to apply configuration)\n\t\t\t\t$this->podServerSystem->addTask($config_user_do,'cp ' . $config_done . ' ' . $config_syst,TASK_COPY_FILE_CONFIG,$actionId);\n\n\t\t\t\t/* NOTE : you can add all makers you want by adding a file \"config/makers/make-config-YOURMAKERNAME.php\" \n\t\t\t\t In your maker file, you have to correctly configure \n\t\t\t\t\t\"$config_syst\" : the conf file path in your system\n\t\t\t\t\t\"$config_user_do\" : the user that copy the configuration system file (for \"podServerSystem\" tasks queue)\n\t\t\t\t And feed correctly the configuration \n\t\t\t\t\t\"$config_generated\" : the content of the conf. file to write to the system\n\t\t\t\t This action will execute it automatically when \"apply\" action will be used\n\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t\t\n\t\t// copy uploaded files items of the global configuration to their system directory\n\t\tforeach ($this->itemsConfiguration as $item){\n\t\t\tif ($item->type == 'file') {\n\t\t\t\t$file_uploads = $_SERVER['DOCUMENT_ROOT'].'/uploads/' . $item->name;\n\t\t\t\t// if the directory does not exists, create it by adding a \"mkdir\" task for the system user\n\t\t\t\tif (!file_exists($item->values)) {\n\t\t\t\t\t$this->podServerSystem->addTask($item->value,'mkdir ' . $item->values,TASK_MKDIR_AUTO);\n\t\t\t\t}\n\t\t\t\t$file_system = $item->values . $item->name;\n\t\t\t\t// adding a \"cp\" task for the system user\t\t\t\n\t\t\t\tif ($item->values != '' && file_exists($file_uploads) ) {\n\t\t\t\t\t$this->podServerSystem->addTask($item->value,'cp ' . $file_uploads . ' ' . $file_system,TASK_COPY_FILE_ITEM,$actionId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function reload_interfaces_sync() {\n\tglobal $config, $g;\n\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"reload_interfaces_sync() is starting.\"));\n\t}\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"Enabling system routing\"));\n\t}\n\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"Cleaning up Interfaces\"));\n\t}\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n}", "private function updateConfigTable()\n {\n $connection = $this->resource->getConnection(ResourceConnection::DEFAULT_CONNECTION);\n $lsTableName = $this->resource->getTableName('core_config_data');\n $websiteQuery = \"UPDATE $lsTableName set scope = 'websites', scope_id = 1 WHERE path IN ('\" . implode(\"','\", $this->websiteScopeFields) . \"')\";\n $storeQuery = \"UPDATE $lsTableName set scope = 'stores', scope_id = 1 WHERE path IN ('\" . implode(\"','\", $this->nonwebsiteScopeFields) . \"')\";\n try {\n $connection->query($websiteQuery);\n $connection->query($storeQuery);\n\n } catch (Exception $e) {\n $this->logger->debug($e->getMessage());\n }\n }", "protected function resetSynchronised()\n {\n /*\n * Lists\n */\n\n /** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */\n $lists = Mage::getModel('lapostaconnect/list')->getCollection();\n\n /** @var $list Laposta_Connect_Model_List */\n foreach ($lists as $list) {\n $list->setLapostaId('');\n $list->setWebhookToken('');\n $list->setSyncTime(null);\n }\n\n $lists->save();\n\n Mage::helper('lapostaconnect')->log('Lists reset OK.');\n\n /*\n * Fields\n */\n\n $fields = Mage::getModel('lapostaconnect/field')->getCollection();\n\n /** @var $field Laposta_Connect_Model_Field */\n foreach ($fields as $field) {\n $field->setLapostaId('');\n $field->setLapostaTag('');\n $field->setSyncTime(null);\n }\n\n $fields->save();\n\n Mage::helper('lapostaconnect')->log('Fields reset OK.');\n\n /*\n * Subscribers\n */\n\n /** @var $subscribers Laposta_Connect_Model_Mysql4_Subscriber_Collection */\n $subscribers = Mage::getModel('lapostaconnect/subscriber')->getCollection();\n\n /** @var $subscriber Laposta_Connect_Model_Subscriber */\n foreach ($subscribers as $subscriber) {\n $subscriber->setLapostaId('');\n $subscriber->setSyncTime(null);\n }\n\n $subscribers->save();\n\n Mage::helper('lapostaconnect')->log('Subscribers reset OK.');\n }", "private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }", "public function check_sync()\n {\n }", "function sync() {\n\t\t// TODO\n\t}" ]
[ "0.69894373", "0.6581784", "0.62709355", "0.6176952", "0.6142984", "0.6103777", "0.6029013", "0.59590673", "0.5909277", "0.57832086", "0.57815963", "0.5752379", "0.572294", "0.571582", "0.56891197", "0.56780326", "0.5594504", "0.55939543", "0.546231", "0.5432511", "0.542029", "0.5394851", "0.5394166", "0.53850377", "0.53814995", "0.5341253", "0.53195786", "0.53085935", "0.5288253", "0.52760714" ]
0.73544157
0
Sync the modified host/service objects Runs after CCM host or service is saved Runs after Bulk Renaming Tool is saved
function recurringdowntime_ccm_hostservice_sync($cbtype, &$cbargs) { $cfg = recurringdowntime_get_cfg(); $pending = recurringdowntime_get_pending_changes(); // Check if the object is part of the pending changes foreach ($pending as $i => $p) { if ($p['object_id'] == $cbargs['id']) { $tmp = $p; if ($cbargs['type'] == 'host') { $tmp['host_name'] = $cbargs['host_name']; } else if ($cbargs['type'] == 'service') { $tmp['service_description'] = $cbargs['service_description']; } $pending[$i] = $tmp; recurringdowntime_update_pending_changes($pending); return; } } // Check if host name changed if ($cbargs['type'] == 'host') { // Check if host name changed if (!empty($cbargs['old_host_name']) && $cbargs['host_name'] != $cbargs['old_host_name']) { foreach ($cfg as $id => $c) { if ($c['schedule_type'] == 'host' || $c['schedule_type'] == 'service') { // Replace config host_name that used the old host name if ($c['host_name'] == $cbargs['old_host_name']) { $pending[] = array( 'cfg_id' => $id, 'object_id' => $cbargs['id'], 'host_name' => $cbargs['host_name'] ); } } } } // Check for service description change } else if ($cbargs['type'] == 'service') { // This one is complicated ... we will only do the hosts defined directly to the service if (!empty($cbargs['old_service_description']) && $cbargs['service_description'] != $cbargs['old_service_description']) { foreach ($cfg as $id => $c) { if (array_key_exists('service_description', $c) && $c['service_description'] == $cbargs['old_service_description']) { // Get all hosts attached to service $sql = "SELECT host_name FROM nagiosql.tbl_lnkServiceToHost AS lnk LEFT JOIN nagiosql.tbl_host AS h ON h.id = lnk.idSlave WHERE idMaster = ".intval($cbargs['id']).";"; if (!($rs = exec_sql_query(DB_NAGIOSQL, $sql))) { continue; } // Check all hosts against current cfg $arr = $rs->GetArray(); foreach ($arr as $a) { if ($c['host_name'] == $a['host_name']) { $pending[] = array( 'cfg_id' => $id, 'object_id' => $cbargs['id'], 'service_description' => $cbargs['service_description'] ); } } } } } } // Save pending changes recurringdowntime_update_pending_changes($pending); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterSyncing() {}", "public function run_sync_process(){\n //Verify if module is enabled\n if(Mage::helper('connector')->isEnabled()) {\n\n \t//Set sync type\n \t\t$sync_type = Minematic_Connector_Model_Config::SYNC_TYPE_MAGENTO_SIDE;\n\n //Log Starting sync process msg\n Mage::helper('connector')->logSyncProcess(\"Starting synchronization task job...\", $sync_type);\n\n try {\n\n //Sync all data\n Mage::getModel('connector/synchronization')->sync_data($sync_type, Minematic_Connector_Model_Config::DATA_TYPE_ALL);\n\n } catch (Exception $e) {\n\n \t// Logging Exceptions\n Mage::helper('connector')->logSyncProcess($e->getMessage(), $sync_type, \"ERROR\");\n \t\n }\n\n //Log Finishing sync process msg\n Mage::helper('connector')->logSyncProcess(\"Finishing synchronization task job.\", $sync_type);\n }\n }", "function reload_all_sync() {\n\tglobal $config;\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* set up our timezone */\n\tsystem_timezone_configure();\n\n\t/* set up our hostname */\n\tsystem_hostname_configure();\n\n\t/* make hosts file */\n\tsystem_hosts_generate();\n\n\t/* generate resolv.conf */\n\tsystem_resolvconf_generate();\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n\n\t/* start dyndns service */\n\tservices_dyndns_configure();\n\n\t/* configure cron service */\n\tconfigure_cron();\n\n\t/* start the NTP client */\n\tsystem_ntp_configure();\n\n\t/* sync pw database */\n\tunlink_if_exists(\"/etc/spwd.db.tmp\");\n\tmwexec(\"/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd\");\n\n\t/* restart sshd */\n\tsend_event(\"service restart sshd\");\n\n\t/* restart webConfigurator if needed */\n\tsend_event(\"service restart webgui\");\n}", "public function performSyncOperation() {\n switch ($this->syncOperation) {\n case 'create':\n // Sets up the data array\n $data['LdapObject'] = $this->stagingData;\n $dn = 'uid' . '=' . $this->stagingData['uid'] . ',' . $this->LdapObject->getLdapContext();\n $data['LdapObject']['dn'] = $dn;\n $data['LdapObject']['objectclass'] = $this->ldapObjectClass;\n \n // Save the data\n $createResult = $this->LdapObject->save($data);\n \n if ($createResult) {\n $this->log('SYNC: Created LDAP Object: ' . $createResult['LdapObject']['dn'], LOG_INFO);\n // Sets the properties on the LdapObject for reporting the sync result\n $this->LdapObject->id = $dn;\n $this->LdapObject->primaryKey = 'dn';\n } else {\n $this->log('SYNC: Failed to create LDAP Object: ' . $dn . '. Salesforce ID: '. $this->sforceData['Id'] . '. LDAP Error: ' . $this->LdapObject->getLdapError() . '.', LOG_ERR);\n }\n break;\n case 'update':\n // Push everything to lower case, so String comparison will be accurate.\n $stagingObject = array_change_key_case($this->stagingData, CASE_LOWER);\n $ldapObject = array_change_key_case($this->ldapData, CASE_LOWER);\n // Diff the arrays. Should be efficient. Since we are doing a one way push from Salesforce\n // to LDAP, this also provides a clean way to get exactly the attributes we want to update.\n $diffObject = array_diff_assoc($stagingObject, $ldapObject);\n if (!empty($diffObject)) {\n $data['LdapObject'] = $diffObject;\n \n // Save the data\n $updateResult = $this->LdapObject->save($data);\n \n if ($updateResult) {\n $this->log('SYNC: Updated LDAP Object: ' . $this->LdapObject->id, LOG_INFO);\n } else {\n $this->log('SYNC: Failed to update LDAP Object: ' . $this->LdapObject->id, LOG_ERR);\n }\n } else {\n // Sets the sync operation, so unchanged records (which is the usual case) are separately reported\n $this->syncOperation = 'unchanged';\n $this->log('SYNC: LDAP Object ' . $this->LdapObject->id . ' left unchanged.', LOG_INFO);\n }\n break;\n case 'delete':\n $id = $this->LdapObject->id;\n $deleteResult = $this->LdapObject->delete($this->LdapObject->id);\n if ($deleteResult) {\n $this->log('SYNC: Deleted LDAP Object: ' . $id, LOG_INFO);\n // Sets id on the LdapObject for reporting the sync result\n $this->LdapObject->id = $id;\n } else {\n $this->log('SYNC: Failed to delete LDAP Object: ' . $id , LOG_ERR);\n $ldapError = $this->LdapObject->getLdapError();\n if (!empty($ldapError)) {\n $this->log($ldapError, LOG_ERR);\n }\n }\n break;\n case 'nothing':\n $this->log('SYNC: No action performed on record: ' . $this->sforceData['Id'], LOG_DEBUG);\n break;\n default:\n $this->log('SYNC: No operation found for Salesforce Id \"' . $this->sforceData['Id'] . '\". This object was not synced.', LOG_INFO);\n }\n }", "public function run()\r\n {\r\n $services = App\\service::all();\r\n\r\n foreach ($services as $service)\r\n {\r\n $service->stylists()->save(\\App\\service::find(1));\r\n $service->stylists()->save(\\App\\service::find(2));\r\n $service->stylists()->save(\\App\\service::find(3));\r\n }\r\n\r\n }", "public function applyChanges()\n {\n $em = $this->doctrine->getManager();\n $em->flush();\n\n // TODO: Can we be sure that the changes are available in the DB now?\n $ch = $this->getMasterRabbit()->channel();\n $msg = new AMQPMessage(\"sync\");\n $ch->basic_publish($msg, \"\", $this->name . \"_master\");\n }", "public static function syncActiveJobs()\n {\n $hosts = Host::getAll();\n\n foreach ($hosts as $Host) {\n\n // Get pending jobs for host\n $pendingJobs = static::getAllByWhere([\n 'Status' => 'pending',\n 'HostID' => $Host->ID\n ]);\n\n if (!$pendingJobs) {\n continue;\n }\n\n // Get active jobs from host\n $activeJobs = $Host->executeRequest('/jobs', 'GET')['jobs'];\n\n // Search active jobs for pending jobs to find updates\n foreach ($pendingJobs as $PendingJob) {\n\n // Update any lost jobs\n if (empty($activeJobs[$PendingJob->Site->Handle])) {\n $PendingJob->Status = 'failed';\n $PendingJob->Result = 'lost on server';\n if ($PendingJob->Site) {\n $PendingJob->Site->Updating = false;\n }\n $PendingJob->save();\n continue;\n }\n\n $activeJob = $activeJobs[$PendingJob->Site->Handle][$PendingJob->UID];\n\n if ($activeJob && $activeJob['status'] !== 'pending') {\n\n // Update job\n $PendingJob->Status = $activeJob['status'];\n if (!empty($activeJob['started'])) {\n $PendingJob->Started = $activeJob['started'] / 1000;\n }\n if (!empty($activeJob['completed'])) {\n $PendingJob->Completed = $activeJob['completed'] / 1000;\n }\n\n if (!empty($activeJob['command']['result'])) {\n if (strlen(json_encode($activeJob['command']['result'])) > 60000) {\n $PendingJob->Result = 'Output too long';\n } else {\n $PendingJob->Result = $activeJob['command']['result'];\n }\n } elseif (!empty($activeJob['message'])) {\n $PendingJob->Result = $activeJob['message'];\n }\n $PendingJob->save();\n\n // Update site on vfs update\n if ($PendingJob->Action == 'vfs-update') {\n\n // Get updated site record\n $Site = Site::getByID($PendingJob->SiteID);\n\n // Skip vfs-update actions on failed job\n if ($PendingJob->Status == 'failed') {\n $Site->Updating = false;\n $Site->save();\n continue;\n }\n\n // Update pending job's site\n $initialUpdate = !boolval($Site->ParentCursor);\n $Site->ParentCursor = $activeJob['command']['result']['parentCursor'];\n $Site->LocalCursor = $activeJob['command']['result']['localCursor'];\n $Site->Updating = false;\n $Site->save();\n\n // Conditionally update child site\n if (!empty($activeJob['command']['updateChild']) && $activeJob['command']['updateChild'] === true) {\n $childSites = Site::getAllByField('ParentSiteID', $Site->ID);\n foreach ($childSites as $ChildSite) {\n $ChildSite->requestFileSystemUpdate();\n }\n }\n\n // Fire initial vfs update event\n if ($initialUpdate) {\n \\Emergence\\EventBus::fireEvent(\n 'afterInitialVFSUpdate',\n $Site->getRootClass(),\n [\n 'Record' => $Site,\n 'Job' => $PendingJob\n ]\n );\n }\n }\n }\n }\n }\n }", "protected function resetSynchronised()\n {\n /*\n * Lists\n */\n\n /** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */\n $lists = Mage::getModel('lapostaconnect/list')->getCollection();\n\n /** @var $list Laposta_Connect_Model_List */\n foreach ($lists as $list) {\n $list->setLapostaId('');\n $list->setWebhookToken('');\n $list->setSyncTime(null);\n }\n\n $lists->save();\n\n Mage::helper('lapostaconnect')->log('Lists reset OK.');\n\n /*\n * Fields\n */\n\n $fields = Mage::getModel('lapostaconnect/field')->getCollection();\n\n /** @var $field Laposta_Connect_Model_Field */\n foreach ($fields as $field) {\n $field->setLapostaId('');\n $field->setLapostaTag('');\n $field->setSyncTime(null);\n }\n\n $fields->save();\n\n Mage::helper('lapostaconnect')->log('Fields reset OK.');\n\n /*\n * Subscribers\n */\n\n /** @var $subscribers Laposta_Connect_Model_Mysql4_Subscriber_Collection */\n $subscribers = Mage::getModel('lapostaconnect/subscriber')->getCollection();\n\n /** @var $subscriber Laposta_Connect_Model_Subscriber */\n foreach ($subscribers as $subscriber) {\n $subscriber->setLapostaId('');\n $subscriber->setSyncTime(null);\n }\n\n $subscribers->save();\n\n Mage::helper('lapostaconnect')->log('Subscribers reset OK.');\n }", "public function postFlush(): void\n {\n try {\n foreach ($this->createdObjects as $object) {\n $this->publishUpdate($object, $this->createdObjects[$object], 'create');\n }\n\n foreach ($this->updatedObjects as $object) {\n $this->publishUpdate($object, $this->updatedObjects[$object], 'update');\n }\n\n foreach ($this->deletedObjects as $object) {\n $this->publishUpdate($object, $this->deletedObjects[$object], 'delete');\n }\n } finally {\n $this->reset();\n }\n }", "public function beforeSyncing() {}", "public function execute()\n {\n $this->cleanHistory();\n $this->log();\n $this->instanceManager->update($this->instance);\n }", "public function syncLdap()\n {\n $this->updateName();\n $this->updateEmail();\n $this->updateInfo();\n $this->save();\n }", "private function updateCustomSelfservicesDelta() {\n $importedSsIds = $this->getSelfservices(FALSE, ['uid' => 0]);\n\n $orderedSsTargets = [];\n if (!empty($importedSsIds)) {\n foreach ($importedSsIds as $id) {\n $orderedSsTargets[] = ['target_id' => $id];\n }\n\n $customSsIds = $this->getSelfservices(FALSE, ['uid' => [0, '<>']]);\n foreach ($customSsIds as $id) {\n $orderedSsTargets[] = ['target_id' => $id];\n }\n\n $this->set('os2web_borgerdk_selfservices', $orderedSsTargets);\n }\n }", "public function manualSync()\n {\n // Only run Auto Sync Jobs\n \n $job = Mage::getModel('mailup/job');\n /* @var $job MailUp_MailUpSync_Model_Job */\n \n foreach($job->fetchManualSyncQueuedJobsCollection() as $job) {\n \n }\n }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n $triggerID = $this->ReadPropertyInteger('InputTriggerID');\n\n //Delete all registrations in order to readd them\n foreach ($this->GetMessageList() as $senderID => $messages) {\n foreach ($messages as $message) {\n $this->UnregisterMessage($senderID, $message);\n }\n }\n $this->RegisterMessage($triggerID, VM_UPDATE);\n\n if (method_exists($this, 'GetReferenceList')) {\n $refs = $this->GetReferenceList();\n foreach ($refs as $ref) {\n $this->UnregisterReference($ref);\n }\n\n $inputTriggerID = $this->ReadPropertyInteger('InputTriggerID');\n if ($inputTriggerID) {\n $this->RegisterReference($inputTriggerID);\n }\n\n $notificationLevels = json_decode($this->ReadPropertyString('NotificationLevels'), true);\n\n foreach ($notificationLevels as $notificationLevel) {\n foreach ($notificationLevel['actions'] as $action) {\n if ($action['recipientObjectID']) {\n $this->RegisterReference($action['recipientObjectID']);\n }\n }\n }\n }\n //Delete all associations\n $profile = IPS_GetVariableProfile('BN.Actions');\n foreach ($profile['Associations'] as $association) {\n IPS_SetVariableProfileAssociation('BN.Actions', $association['Value'], '', '', '-1');\n }\n //Setting the instance status\n $this->setInstanceStatus();\n\n //Set Associations\n if ($this->ReadPropertyBoolean('AdvancedResponse')) {\n //Return if action is not unique\n //Only important, if advanced response actions are used\n if ($this->GetStatus() != IS_ACTIVE) {\n return;\n }\n $responseActions = json_decode($this->ReadPropertyString('AdvancedResponseActions'), true);\n foreach ($responseActions as $responseAction) {\n IPS_SetVariableProfileAssociation('BN.Actions', $responseAction['Index'], $responseAction['CustomName'], '', '-1');\n }\n } else {\n IPS_SetVariableProfileAssociation('BN.Actions', 0, $this->Translate('Reset'), '', '-1');\n }\n }", "public function onPostDispatch()\n {\n /** @var Shipperhq_Shipper_Model_Storage[] $storageList */\n $storageList = Mage::helper('shipperhq_shipper')->storageManager()->getStorageObjects();\n foreach ($storageList as $storage) {\n if ($storage->hasDataChanges() && $storage->getId()) {\n $this->_saveStorageInstance($storage);\n }\n }\n }", "protected function after_execute() {\n $this->add_related_files('mod_activitystatus', 'default_background', null);\n $this->add_related_files('mod_activitystatus', 'default_status', null);\n $this->add_related_files('mod_activitystatus', 'modstatusimages', null);\n $this->add_related_files('mod_activitystatus', 'coursestatusimages', null);\n\n $oldmodid = $this->task->get_old_activityid();\n $newmodid = $this->task->get_old_moduleid();\n }", "public static function auth_ldap_sync_cron() {\n $auths = get_records_array('auth_instance', 'authname', 'ldap', 'id', 'id');\n if (!$auths) {\n return;\n }\n foreach ($auths as $auth) {\n /* @var $authobj AuthLdap */\n $authobj = AuthFactory::create($auth->id);\n // Each instance will decide for itself whether it should sync users and/or groups\n // User sync needs to be called before group sync in order for new users to wind\n // up in the correct groups\n $authobj->sync_users();\n $authobj->sync_groups();\n }\n }", "public function testUpdateServiceData()\n {\n\n }", "function save()\n {\n foreach ($this->plugins as $name => $obj) {\n $this->updateServicesVars($name);\n\n if ($this->plugins[$name]->is_account) {\n $this->plugins[$name]->save();\n } elseif ($this->plugins[$name]->initially_was_account) {\n $this->plugins[$name]->remove_from_parent();\n }\n }\n }", "public function run()\n {\n $services = [\n [\"type\" =>'wifi'],\n [\"type\" =>'posto auto'],\n [\"type\" =>'piscina'],\n [\"type\" =>'sauna'],\n [\"type\" =>'vista mare'],\n [\"type\" =>'reception']\n ];\n \n foreach($services as $service){\n $newService = new Service;\n $newService -> fill($service) -> save();\n }\n }", "public function sync()\n {\n $result = '';\n foreach ($this->hosts() as $host) {\n $result .= $host;\n $result .= \"\\n\";\n }\n file_put_contents($this->configFilePath(), $result);\n }", "function sync() {\n\t\t// TODO\n\t}", "protected function _flushVars() {\n if (isset($this->LdapObject->id)) {\n $this->LdapObject->id = null;\n }\n if (isset($this->LdapObject->primaryKey)) {\n $this->LdapObject->primaryKey = 'uid';\n }\n \n $this->sforceData = array();\n $this->stagingData = array();\n $this->ldapData = array();\n $this->syncOperation = 'nothing';\n \n }", "public function applyServices(Host $host): void;", "public function testSyncEntitiesFromOneRemoteService()\n {\n $this->setupRemoteService();\n\n //Setup the synchonization configuration\n $this->setupConfiguration();\n\n //Setup the synchronization state\n $this->setSyncState();\n\n //Perform synchronization\n $this->manager->execute(array('product'));\n\n\n //Test if all requested entities have been synced\n $state = $this->manager->getState('product');\n\n $this->assertEquals($state->getLastValue(), 10);\n\n }", "function recurringdowntime_ccm_group_sync($cbtype, &$cbargs)\n{\n $cfg = recurringdowntime_get_cfg();\n $pending = recurringdowntime_get_pending_changes();\n\n // Check if the object is part of the pending changes\n foreach ($pending as $i => $p) {\n if ($p['object_id'] == $cbargs['id']) {\n $tmp = $p;\n if ($cbargs['type'] == 'hostgroup') {\n $tmp['hostgroup_name'] = $cbargs['hostgroup_name'];\n } else if ($cbargs['type'] == 'servicegroup') {\n $tmp['servicegroup_name'] = $cbargs['servicegroup_name'];\n }\n $pending[$i] = $tmp;\n recurringdowntime_update_pending_changes($pending);\n return;\n }\n }\n\n if ($cbargs['type'] == 'hostgroup') {\n\n if ($cbargs['old_hostgroup_name'] != $cbargs['hostgroup_name']) {\n foreach ($cfg as $id => $c) {\n if (array_key_exists('hostgroup_name', $c) && $c['hostgroup_name'] == $cbargs['old_hostgroup_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'hostgroup_name' => $cbargs['hostgroup_name']\n );\n }\n }\n }\n\n } else if ($cbargs['type'] == 'servicegroup') {\n\n if ($cbargs['old_servicegroup_name'] != $cbargs['servicegroup_name']) {\n foreach ($cfg as $id => $c) {\n if (array_key_exists('servicegroup_name', $c) && $c['servicegroup_name'] == $cbargs['old_servicegroup_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'servicegroup_name' => $cbargs['servicegroup_name']\n );\n }\n }\n }\n\n }\n\n // Save pending changes\n recurringdowntime_update_pending_changes($pending);\n}", "protected function callAfterSuccessfulSave()\n\t{\n\t\tforeach($this->editFields as $f)\n\t\t{\n\t\t\t$this->getControl($f, $this->id)->afterSuccessfulSave();\n\t\t}\n\t}", "public function afterUpdate()\n {\n // $this->getDI()\n // ->getMail()\n // ->send([\"[email protected]\" => \"Admin GamanAds\"],\"Update Adspace\", 'updateadspace',\n // [ 'emailBody'=> \"Update Adspace : <b>$this->ad_url</b> from Client Id : <b>$this->client_id</b> Client Name: <b>$this->client_name</b>\"]);\n }", "public function run()\n {\n $stores = Mage::app()->getStores();\n\n // get emulation model\n $appEmulation = Mage::getSingleton('core/app_emulation');\n\n foreach ($stores as $store) {\n // Start Store Emulation\n $environment = $appEmulation->startEnvironmentEmulation($store);\n\n $syncOrders = $this->getSyncOrders($store);\n\n foreach ($syncOrders as $syncOrder) {\n $this->sync($syncOrder);\n }\n\n // Stop Store Emulation\n $appEmulation->stopEnvironmentEmulation($environment);\n }\n }" ]
[ "0.5997599", "0.58403236", "0.5769199", "0.5768103", "0.5746364", "0.55999434", "0.5587502", "0.5563259", "0.5528158", "0.5499976", "0.5495799", "0.54830134", "0.545524", "0.54161316", "0.5412736", "0.5392773", "0.5353069", "0.53394127", "0.5325165", "0.52678555", "0.52451086", "0.52357966", "0.5235398", "0.52172387", "0.51979357", "0.51846987", "0.517651", "0.5166399", "0.51011884", "0.509653" ]
0.65392864
0
Sync the modified host/service group objects Runs after CCM hostgroup or servicegroup is saved
function recurringdowntime_ccm_group_sync($cbtype, &$cbargs) { $cfg = recurringdowntime_get_cfg(); $pending = recurringdowntime_get_pending_changes(); // Check if the object is part of the pending changes foreach ($pending as $i => $p) { if ($p['object_id'] == $cbargs['id']) { $tmp = $p; if ($cbargs['type'] == 'hostgroup') { $tmp['hostgroup_name'] = $cbargs['hostgroup_name']; } else if ($cbargs['type'] == 'servicegroup') { $tmp['servicegroup_name'] = $cbargs['servicegroup_name']; } $pending[$i] = $tmp; recurringdowntime_update_pending_changes($pending); return; } } if ($cbargs['type'] == 'hostgroup') { if ($cbargs['old_hostgroup_name'] != $cbargs['hostgroup_name']) { foreach ($cfg as $id => $c) { if (array_key_exists('hostgroup_name', $c) && $c['hostgroup_name'] == $cbargs['old_hostgroup_name']) { $pending[] = array( 'cfg_id' => $id, 'object_id' => $cbargs['id'], 'hostgroup_name' => $cbargs['hostgroup_name'] ); } } } } else if ($cbargs['type'] == 'servicegroup') { if ($cbargs['old_servicegroup_name'] != $cbargs['servicegroup_name']) { foreach ($cfg as $id => $c) { if (array_key_exists('servicegroup_name', $c) && $c['servicegroup_name'] == $cbargs['old_servicegroup_name']) { $pending[] = array( 'cfg_id' => $id, 'object_id' => $cbargs['id'], 'servicegroup_name' => $cbargs['servicegroup_name'] ); } } } } // Save pending changes recurringdowntime_update_pending_changes($pending); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function syncSystemGroup()\n\t{\n\t\t$members = Owner::getIds($this->get('id'), Owner::ROLE_COLLABORATOR, 1);\n\t\t$authors = Owner::getIds($this->get('id'), Owner::ROLE_AUTHOR, 1);\n\t\t$managers = Owner::getIds($this->get('id'), Owner::ROLE_MANAGER, 1);\n\n\t\t$all = array_merge($members, $managers, $authors);\n\t\t$all = array_unique($all);\n\n\t\t$group = $this->systemGroup();\n\t\t$group->set('members', $all);\n\t\t$group->set('managers', $managers);\n\t\t$group->set('type', 2);\n\t\t$group->set('published', 1);\n\t\t$group->set('discoverability', 1);\n\n\t\tif (!$group->update())\n\t\t{\n\t\t\t$this->addError(Lang::txt('COM_PROJECTS_ERROR_SAVING_SYS_GROUP'));\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function recurringdowntime_ccm_hostservice_sync($cbtype, &$cbargs)\n{\n $cfg = recurringdowntime_get_cfg();\n $pending = recurringdowntime_get_pending_changes();\n\n // Check if the object is part of the pending changes\n foreach ($pending as $i => $p) {\n if ($p['object_id'] == $cbargs['id']) {\n $tmp = $p;\n if ($cbargs['type'] == 'host') {\n $tmp['host_name'] = $cbargs['host_name'];\n } else if ($cbargs['type'] == 'service') {\n $tmp['service_description'] = $cbargs['service_description'];\n }\n $pending[$i] = $tmp;\n recurringdowntime_update_pending_changes($pending);\n return;\n }\n }\n\n // Check if host name changed\n if ($cbargs['type'] == 'host') {\n\n // Check if host name changed\n if (!empty($cbargs['old_host_name']) && $cbargs['host_name'] != $cbargs['old_host_name']) {\n foreach ($cfg as $id => $c) {\n\n if ($c['schedule_type'] == 'host' || $c['schedule_type'] == 'service') {\n\n // Replace config host_name that used the old host name\n if ($c['host_name'] == $cbargs['old_host_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'host_name' => $cbargs['host_name']\n );\n }\n\n }\n\n }\n }\n\n\n // Check for service description change\n } else if ($cbargs['type'] == 'service') {\n\n // This one is complicated ... we will only do the hosts defined directly to the service\n if (!empty($cbargs['old_service_description']) && $cbargs['service_description'] != $cbargs['old_service_description']) {\n foreach ($cfg as $id => $c) {\n if (array_key_exists('service_description', $c) && $c['service_description'] == $cbargs['old_service_description']) {\n\n // Get all hosts attached to service\n $sql = \"SELECT host_name FROM nagiosql.tbl_lnkServiceToHost AS lnk\n LEFT JOIN nagiosql.tbl_host AS h ON h.id = lnk.idSlave\n WHERE idMaster = \".intval($cbargs['id']).\";\";\n if (!($rs = exec_sql_query(DB_NAGIOSQL, $sql))) {\n continue;\n }\n\n // Check all hosts against current cfg\n $arr = $rs->GetArray();\n foreach ($arr as $a) {\n if ($c['host_name'] == $a['host_name']) {\n $pending[] = array(\n 'cfg_id' => $id,\n 'object_id' => $cbargs['id'],\n 'service_description' => $cbargs['service_description']\n );\n }\n }\n\n }\n }\n }\n\n }\n\n // Save pending changes\n recurringdowntime_update_pending_changes($pending);\n}", "public function syncLdap()\n {\n $this->updateName();\n $this->updateEmail();\n $this->updateInfo();\n $this->save();\n }", "public function afterSave($object)\n {\n \n $websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId();\n $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0;\n $groupRows = $object->getData($this->getAttribute()->getName());\n \n \n \n if (empty( $groupRows)) {\n $this->_getResource()->deleteGroupData($object->getId());\n return $this;\n }\n \n $old = array();\n $new = array();\n \n $origGroupRows = $object->getOrigData($this->getAttribute()->getName());\n if (!is_array( $origGroupRows )) {\n $origGroupRows = array();\n }\n foreach ( $origGroupRows as $data) {\n if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) {\n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n $old[$key] = $data;\n }\n }\n \n // prepare data for save\n foreach ($groupRows as $data) {\n $hasEmptyData = false;\n foreach ($this->_getAdditionalUniqueFields($data) as $field) {\n if (empty($field)) {\n $hasEmptyData = true;\n break;\n }\n }\n\n if ($hasEmptyData || !isset($data['cust_group']) || !empty($data['delete'])) {\n continue;\n }\n if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) {\n continue;\n }\n if (!$isGlobal && (int)$data['website_id'] == 0) {\n continue;\n }\n\n if(!isset($data['website_id'])) $data['website_id'] =0;\n \n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n\n $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL;\n $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0;\n\n \n $new[$key] = array_merge(array(\n 'website_id' => $data['website_id'],\n 'all_groups' => $useForAllGroups ? 1 : 0,\n 'customer_group_id' => $customerGroupId,\n 'value' => $data['value'],\n ), $this->_getAdditionalUniqueFields($data));\n }\n\n $delete = array_diff_key($old, $new);\n $insert = array_diff_key($new, $old);\n $update = array_intersect_key($new, $old);\n\n $isChanged = false;\n $productId = $object->getId();\n\n if (!empty($delete)) {\n foreach ($delete as $data) {\n $this->_getResource()->deleteGroupData($productId, null, $data['group_id']);\n $isChanged = true;\n }\n }\n\n if (!empty($insert)) {\n foreach ($insert as $data) {\n $group = new Varien_Object($data);\n $group->setEntityId($productId);\n $this->_getResource()->saveGroupData($group);\n\n $isChanged = true;\n }\n }\n\n if (!empty($update)) {\n foreach ($update as $k => $v) {\n \n \n \n if ($old[$k]['value'] != $v['value']) {\n $group = new Varien_Object(array(\n 'value_id' => $old[$k]['value_id'],\n 'value' => $v['value']\n ));\n $this->_getResource()->saveGroupData($group);\n\n $isChanged = true;\n }\n }\n }\n\n if ($isChanged) {\n $valueChangedKey = $this->getAttribute()->getName() . '_changed';\n $object->setData($valueChangedKey, 1);\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n /*$websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId();\n $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0;\n\n $priceRows = $object->getData($this->getAttribute()->getName());\n if (empty($priceRows)) {\n if ($isGlobal) {\n $this->_getResource()->deletePriceData($object->getId());\n } else {\n $this->_getResource()->deletePriceData($object->getId(), $websiteId);\n }\n return $this;\n }\n\n $old = array();\n $new = array();\n\n // prepare original data for compare\n $origGroupPrices = $object->getOrigData($this->getAttribute()->getName());\n if (!is_array($origGroupPrices)) {\n $origGroupPrices = array();\n }\n foreach ($origGroupPrices as $data) {\n if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) {\n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n $old[$key] = $data;\n }\n }\n\n // prepare data for save\n foreach ($priceRows as $data) {\n $hasEmptyData = false;\n foreach ($this->_getAdditionalUniqueFields($data) as $field) {\n if (empty($field)) {\n $hasEmptyData = true;\n break;\n }\n }\n\n if ($hasEmptyData || !isset($data['cust_group']) || !empty($data['delete'])) {\n continue;\n }\n if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) {\n continue;\n }\n if (!$isGlobal && (int)$data['website_id'] == 0) {\n continue;\n }\n\n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n\n $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL;\n $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0;\n\n $new[$key] = array_merge(array(\n 'website_id' => $data['website_id'],\n 'all_groups' => $useForAllGroups ? 1 : 0,\n 'customer_group_id' => $customerGroupId,\n 'value' => $data['price'],\n ), $this->_getAdditionalUniqueFields($data));\n }\n\n $delete = array_diff_key($old, $new);\n $insert = array_diff_key($new, $old);\n $update = array_intersect_key($new, $old);\n\n $isChanged = false;\n $productId = $object->getId();\n\n if (!empty($delete)) {\n foreach ($delete as $data) {\n $this->_getResource()->deletePriceData($productId, null, $data['price_id']);\n $isChanged = true;\n }\n }\n\n if (!empty($insert)) {\n foreach ($insert as $data) {\n $price = new Varien_Object($data);\n $price->setEntityId($productId);\n $this->_getResource()->savePriceData($price);\n\n $isChanged = true;\n }\n }\n\n if (!empty($update)) {\n foreach ($update as $k => $v) {\n if ($old[$k]['price'] != $v['value']) {\n $price = new Varien_Object(array(\n 'value_id' => $old[$k]['price_id'],\n 'value' => $v['value']\n ));\n $this->_getResource()->savePriceData($price);\n\n $isChanged = true;\n }\n }\n }\n\n if ($isChanged) {\n $valueChangedKey = $this->getAttribute()->getName() . '_changed';\n $object->setData($valueChangedKey, 1);\n }*/\n\n return $this;\n }", "public function performSyncOperation() {\n switch ($this->syncOperation) {\n case 'create':\n // Sets up the data array\n $data['LdapObject'] = $this->stagingData;\n $dn = 'uid' . '=' . $this->stagingData['uid'] . ',' . $this->LdapObject->getLdapContext();\n $data['LdapObject']['dn'] = $dn;\n $data['LdapObject']['objectclass'] = $this->ldapObjectClass;\n \n // Save the data\n $createResult = $this->LdapObject->save($data);\n \n if ($createResult) {\n $this->log('SYNC: Created LDAP Object: ' . $createResult['LdapObject']['dn'], LOG_INFO);\n // Sets the properties on the LdapObject for reporting the sync result\n $this->LdapObject->id = $dn;\n $this->LdapObject->primaryKey = 'dn';\n } else {\n $this->log('SYNC: Failed to create LDAP Object: ' . $dn . '. Salesforce ID: '. $this->sforceData['Id'] . '. LDAP Error: ' . $this->LdapObject->getLdapError() . '.', LOG_ERR);\n }\n break;\n case 'update':\n // Push everything to lower case, so String comparison will be accurate.\n $stagingObject = array_change_key_case($this->stagingData, CASE_LOWER);\n $ldapObject = array_change_key_case($this->ldapData, CASE_LOWER);\n // Diff the arrays. Should be efficient. Since we are doing a one way push from Salesforce\n // to LDAP, this also provides a clean way to get exactly the attributes we want to update.\n $diffObject = array_diff_assoc($stagingObject, $ldapObject);\n if (!empty($diffObject)) {\n $data['LdapObject'] = $diffObject;\n \n // Save the data\n $updateResult = $this->LdapObject->save($data);\n \n if ($updateResult) {\n $this->log('SYNC: Updated LDAP Object: ' . $this->LdapObject->id, LOG_INFO);\n } else {\n $this->log('SYNC: Failed to update LDAP Object: ' . $this->LdapObject->id, LOG_ERR);\n }\n } else {\n // Sets the sync operation, so unchanged records (which is the usual case) are separately reported\n $this->syncOperation = 'unchanged';\n $this->log('SYNC: LDAP Object ' . $this->LdapObject->id . ' left unchanged.', LOG_INFO);\n }\n break;\n case 'delete':\n $id = $this->LdapObject->id;\n $deleteResult = $this->LdapObject->delete($this->LdapObject->id);\n if ($deleteResult) {\n $this->log('SYNC: Deleted LDAP Object: ' . $id, LOG_INFO);\n // Sets id on the LdapObject for reporting the sync result\n $this->LdapObject->id = $id;\n } else {\n $this->log('SYNC: Failed to delete LDAP Object: ' . $id , LOG_ERR);\n $ldapError = $this->LdapObject->getLdapError();\n if (!empty($ldapError)) {\n $this->log($ldapError, LOG_ERR);\n }\n }\n break;\n case 'nothing':\n $this->log('SYNC: No action performed on record: ' . $this->sforceData['Id'], LOG_DEBUG);\n break;\n default:\n $this->log('SYNC: No operation found for Salesforce Id \"' . $this->sforceData['Id'] . '\". This object was not synced.', LOG_INFO);\n }\n }", "public function update() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'],'tx_passwordmgr_group'),\n\t\t\t$data\n\t\t);\n\t\t$this->checkAffectedRows('updateGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'updateGroup', 'Update group '.$data['name'].' uid '.$this['uid']);\n\t}", "public function testUpdateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function refreshGroupSettings()\n {\n $group = $this->currentUser->getGroup();\n if ($group instanceof \\Gems\\User\\Group) {\n $group->applyGroupToModel($this, false);\n }\n }", "public function testComAdobeCqSocialSyncImplGroupSyncListenerImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.sync.impl.GroupSyncListenerImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public function updateGroup() {\n if(!$this->request->is('restful')) {\n try {\n $this->CoGroupMember->updateGroupMemberships($this->request->data['CoGroupMember']['co_group_id'],\n $this->request->data['CoGroupMember']['rows'],\n $this->Session->read('Auth.User.co_person_id'));\n \n $this->Flash->set(_txt('rs.saved'), array('key' => 'success'));\n }\n catch(Exception $e) {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n }\n \n // Issue redirect\n \n $this->redirect(array('controller' => 'co_groups',\n 'action' => 'edit',\n $this->request->data['CoGroupMember']['co_group_id'],\n 'co' => $this->cur_co['Co']['id']));\n }\n }", "public function flush_group($group)\n {\n }", "public function afterSyncing() {}", "protected function _flushVars() {\n if (isset($this->LdapObject->id)) {\n $this->LdapObject->id = null;\n }\n if (isset($this->LdapObject->primaryKey)) {\n $this->LdapObject->primaryKey = 'uid';\n }\n \n $this->sforceData = array();\n $this->stagingData = array();\n $this->ldapData = array();\n $this->syncOperation = 'nothing';\n \n }", "public function run()\n {\n $groups = config('groups');\n\n foreach ($groups as $group) {\n $new_group_obj = new Group();\n $new_group_obj->name = $group['name'];\n $new_group_obj->save();\n }\n }", "public function update() {\r\n\r\n // Does the Group object have an id?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::update(): Attempt to update a Group object that does not have its ID property set.\", E_USER_ERROR );\r\n \r\n // Update the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $sql = \"UPDATE \" . DB_PREFIX . \"groups SET title = :title, dashboard = :dashboard, content = :content, themes = :themes, files = :files, settings = :settings, users = :users, status = :status WHERE id = :id\";\r\n \r\n $st = $conn->prepare ( $sql );\r\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\r\n $st->bindValue( \":dashboard\", $this->dashboard, PDO::PARAM_INT );\r\n $st->bindValue( \":content\", $this->content, PDO::PARAM_INT );\r\n $st->bindValue( \":themes\", $this->themes, PDO::PARAM_INT );\r\n $st->bindValue( \":files\", $this->files, PDO::PARAM_INT );\r\n $st->bindValue( \":settings\", $this->settings, PDO::PARAM_INT );\r\n $st->bindValue( \":users\", $this->users, PDO::PARAM_INT );\r\n $st->bindValue( \":status\", $this->status, PDO::PARAM_INT );\r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n \r\n }", "public function applyChanges()\n {\n $em = $this->doctrine->getManager();\n $em->flush();\n\n // TODO: Can we be sure that the changes are available in the DB now?\n $ch = $this->getMasterRabbit()->channel();\n $msg = new AMQPMessage(\"sync\");\n $ch->basic_publish($msg, \"\", $this->name . \"_master\");\n }", "function sync_groups($dryrun = false) {\n global $USER;\n log_info('---------- started groupsync auth instance ' . $this->instanceid . ' at ' . date('r', time()) . ' ----------');\n\n if (!$this->get_config('syncgroupscron')) {\n log_info('Not set to sync groups, so exiting');\n return true;\n }\n\n // We need to tell the session that we are the admin user, so that we have permission to manipulate groups\n $USER->reanimate(1, 1);\n\n $syncbyattribute = $this->get_config('syncgroupsbyuserfield') && $this->get_config('syncgroupsgroupattribute');\n $syncbyclass = $this->get_config('syncgroupsbyclass') && $this->get_config('syncgroupsgroupclass')\n && $this->get_config('syncgroupsgroupattribute') && $this->get_config('syncgroupsmemberattribute');\n\n $excludelist = $this->get_config('syncgroupsexcludelist');\n $includelist = $this->get_config('syncgroupsincludelist');\n $searchsub = $this->get_config('syncgroupssearchsub');\n $grouptype = $this->get_config('syncgroupsgrouptype');\n $groupattribute = $this->get_config('syncgroupsgroupattribute');\n $docreate = $this->get_config('syncgroupsautocreate');\n\n // If neither one is set, return\n if (!$syncbyattribute && !$syncbyclass) {\n log_info('not set to sync by user attribute or by group objects, so exiting');\n return true;\n }\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug(\"exclusion list : \");\n var_dump($excludelist);\n log_debug(\"inclusion list : \");\n var_dump($includelist);\n }\n\n // fetch userids of current members of that institution\n if ($this->institution == 'mahara') {\n $currentmembers = get_records_sql_assoc('select u.username as username, u.id as id from {usr} u where u.deleted=0 and not exists (select 1 from {usr_institution} ui where ui.usr=u.id)', array());\n }\n else {\n $currentmembers = get_records_sql_assoc('select u.username as username, u.id as id from {usr} u inner join {usr_institution} ui on u.id=ui.usr where u.deleted=0 and ui.institution=?', array($this->institution));\n }\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug(\"current members : \".count($currentmembers));\n var_dump($currentmembers);\n }\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug(\"config. LDAP : \");\n var_dump($this->get_config());\n }\n\n $groups = array();\n if ($syncbyattribute) {\n // get the distinct values of the used attribute by a LDAP search\n // that may be restricted by flags -c or -o\n $groups = array_merge($groups, $this->get_attribute_distinct_values($searchsub));\n }\n\n if ($syncbyclass) {\n $groups = array_merge($groups, $this->ldap_get_grouplist('*', $searchsub));\n }\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug(\"Found LDAP groups : \");\n var_dump($groups);\n }\n\n $nbadded = 0;\n foreach ($groups as $group) {\n $nomatch = false;\n\n log_debug(\"Processing group '{$group}'\");\n\n if (!ldap_sync_filter_name($group, $includelist, $excludelist)) {\n continue;\n }\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug(\"processing group : \");\n var_dump($group);\n }\n\n $ldapusers = array();\n if ($syncbyattribute) {\n $ldapusers = array_merge($ldapusers, $this->get_users_having_attribute_value($group));\n }\n\n if ($syncbyclass) {\n $ldapusers = array_merge($ldapusers, $this->ldap_get_group_members($group));\n }\n\n // test whether this group exists within the institution\n // group.shortname is limited to 255 characters. Unlikely anyone will hit this, but why not?\n $shortname = substr($group, 0, 255);\n if (!$dbgroup = get_record('group', 'shortname', $shortname, 'institution', $this->institution)) {\n if (!$docreate) {\n log_debug('autocreation is off so skipping Mahara not existing group ' . $group);\n continue;\n }\n\n if (count($ldapusers)==0) {\n log_debug('will not autocreate an empty Mahara group ' . $group);\n continue;\n }\n\n try {\n log_info('creating group ' . $group);\n // Make sure the name is unique (across all institutions)\n // group.name only allows 128 characters. In the event of\n // really long group names, we'll arbitrarily truncate them\n $basename = $this->institution . ' : ' . $group;\n $name = substr($basename, 0, 128);\n $n = 0;\n while (record_exists('group', 'name', $name)) {\n $n++;\n $tail = \" $n\";\n $name .= substr($basename, 0, (128-strlen($tail))) . $tail;\n }\n $dbgroup = array();\n $dbgroup['name'] = $name;\n $dbgroup['institution'] = $this->institution;\n $dbgroup['shortname'] = $shortname;\n $dbgroup['grouptype'] = $grouptype; // default standard (change to course)\n $dbgroup['controlled'] = 1; //definitively\n $nbadded++;\n if (!$dryrun) {\n $groupid = group_create($dbgroup);\n }\n }\n catch (Exception $ex) {\n log_warn($ex->getMessage());\n continue;\n }\n }\n else {\n $groupid = $dbgroup->id;\n log_debug('group exists ' . $group);\n }\n // now it does exist see what members should be added/removed\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug($group . ' : ');\n var_dump($ldapusers);\n }\n\n // Puts the site's \"admin\" user into the group as a group admin\n $members = array('1' => 'admin'); //must be set otherwise fatal error group_update_members: no group admins listed for group\n foreach ($ldapusers as $username) {\n if (isset($currentmembers[$username])) {\n $id = $currentmembers[$username]->id;\n $members[$id] = 'member';\n }\n }\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug('new members list : '.count($members));\n var_dump($members);\n }\n\n unset($ldapusers); //try to save memory before memory consuming call to API\n\n $result = $dryrun ? false : group_update_members($groupid, $members);\n if ($result) {\n log_info(\" -> added : {$result['added']} removed : {$result['removed']} updated : {$result['updated']}\");\n }\n else {\n log_debug('-> no change for ' . $group);\n }\n unset ($members);\n //break;\n }\n log_info('---------- finished groupsync auth instance ' . $this->instanceid . ' at ' . date('r', time()) . ' ----------');\n return true;\n }", "function updateProjectGroups() {\n $projects_table = TABLE_PREFIX . 'projects';\n $project_groups_table = TABLE_PREFIX . 'project_groups';\n $categories_table = TABLE_PREFIX . 'categories';\n $config_options_table = TABLE_PREFIX . 'config_options';\n\n try {\n $templates_group_id = DB::executeFirstCell(\"SELECT value FROM $config_options_table WHERE name = ?\", 'project_templates_group');\n $templates_group_id = $templates_group_id ? (integer) unserialize($templates_group_id) : 0;\n\n $templates_category_id = 0;\n\n DB::execute(\"ALTER TABLE $projects_table ADD category_id int(10) unsigned null default null AFTER group_id\");\n\n $rows = DB::execute(\"SELECT id, name FROM $project_groups_table\");\n if($rows) {\n list($admin_user_id, $admin_display_name, $admin_email_address) = $this->getFirstAdministrator();\n\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $categories_table (type, name, created_on, created_by_id, created_by_name, created_by_email) VALUES (?, ?, UTC_TIMESTAMP(), ?, ?, ?)\", 'ProjectCategory', $row['name'], $admin_user_id, $admin_display_name, $admin_email_address);\n\n $category_id = DB::lastInsertId();\n\n DB::execute(\"UPDATE $projects_table SET category_id = ? WHERE group_id = ?\", $category_id, $row['id']);\n\n if($row['id'] == $templates_group_id) {\n $templates_category_id = $category_id;\n } // if\n } // foreach\n } // if\n\n DB::execute(\"UPDATE $config_options_table SET name = ?, value = ? WHERE name = ?\", 'project_templates_category', serialize($templates_category_id), 'project_templates_group');\n DB::execute(\"ALTER TABLE $projects_table DROP group_id\");\n DB::execute(\"ALTER TABLE $projects_table ADD INDEX (company_id)\");\n DB::execute(\"DROP TABLE $project_groups_table\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "protected function resetSynchronised()\n {\n /*\n * Lists\n */\n\n /** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */\n $lists = Mage::getModel('lapostaconnect/list')->getCollection();\n\n /** @var $list Laposta_Connect_Model_List */\n foreach ($lists as $list) {\n $list->setLapostaId('');\n $list->setWebhookToken('');\n $list->setSyncTime(null);\n }\n\n $lists->save();\n\n Mage::helper('lapostaconnect')->log('Lists reset OK.');\n\n /*\n * Fields\n */\n\n $fields = Mage::getModel('lapostaconnect/field')->getCollection();\n\n /** @var $field Laposta_Connect_Model_Field */\n foreach ($fields as $field) {\n $field->setLapostaId('');\n $field->setLapostaTag('');\n $field->setSyncTime(null);\n }\n\n $fields->save();\n\n Mage::helper('lapostaconnect')->log('Fields reset OK.');\n\n /*\n * Subscribers\n */\n\n /** @var $subscribers Laposta_Connect_Model_Mysql4_Subscriber_Collection */\n $subscribers = Mage::getModel('lapostaconnect/subscriber')->getCollection();\n\n /** @var $subscriber Laposta_Connect_Model_Subscriber */\n foreach ($subscribers as $subscriber) {\n $subscriber->setLapostaId('');\n $subscriber->setSyncTime(null);\n }\n\n $subscribers->save();\n\n Mage::helper('lapostaconnect')->log('Subscribers reset OK.');\n }", "public function syncGroups($groups)\n {\n $groups = is_array($groups) || $groups instanceof Collection ? $groups : func_get_args();\n\n $this->groups()->detach();\n\n $this->assignGroup($groups);\n }", "function auth_ldap_sync_groups(\n $institutionname,\n $syncbyclass = false,\n $excludelist = null,\n $includelist = null,\n $onlycontexts = null,\n $searchsub = null,\n $grouptype = null,\n $docreate = null,\n $nestedgroups = null,\n $groupclass = null,\n $groupattribute = null,\n $syncbyattribute = false,\n $userattribute = null,\n $attrgroupnames = null,\n $dryrun = false\n) {\n log_info('---------- started institution group sync for \"' . $institutionname . '\" at ' . date('r', time()) . ' ----------');\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug(\"exclusion list : \");\n var_dump($excludelist);\n log_debug(\"inclusion list : \");\n var_dump($includelist);\n }\n\n $auths = get_records_select_array('auth_instance', \"authname in ('cas', 'ldap') and institution=?\", array($institutionname));\n\n if (get_config('auth_ldap_debug_sync_cron')) {\n log_debug(\"auths candidates : \");\n var_dump($auths);\n }\n\n if (count($auths) == 0) {\n log_warn(get_string('nomatchingauths', 'auth.ldap'));\n return false;\n }\n\n $result = true;\n foreach ($auths as $auth) {\n $instance = new AuthLdap($auth->id);\n $instance->set_config('syncgroupscron', true);\n $instance->set_config('syncgroupsbyclass', $syncbyclass);\n $instance->set_config('syncgroupsbyuserfield', $syncbyattribute);\n if ($excludelist !== null) {\n if (!is_array($excludelist)) {\n $excludelist = preg_split('/\\s*,\\s*/', trim($excludelist));\n }\n $instance->set_config('syncgroupsexcludelist', $excludelist);\n }\n if ($includelist !== null) {\n if (!is_array($includelist)) {\n $includelist = preg_split('/\\s*,\\s*/', trim($includelist));\n }\n $instance->set_config('syncgroupsincludelist', $includelist);\n }\n if ($onlycontexts !== null) {\n $instance->set_config('syncgroupscontexts', $onlycontexts);\n }\n if ($searchsub !== null) {\n $instance->set_config('syncgroupssearchsub', $searchsub);\n }\n if ($grouptype !== null) {\n $instance->set_config('syncgroupsgrouptype', $grouptype);\n }\n if ($nestedgroups !== null) {\n $instance->set_config('nestedgroups', $nestedgroups);\n }\n if ($groupclass !== null) {\n $instance->set_config('syncgroupsgroupclass', $groupclass);\n }\n if ($groupattribute !== null) {\n $instance->set_config('syncgroupsgroupattribute', $groupattribute);\n }\n if ($docreate !== null) {\n $instance->set_config('syncgroupsautocreate', $docreate);\n }\n\n $result = $result && $instance->sync_groups($dryrun);\n }\n log_info('---------- finished institution group sync at ' . date('r', time()) . ' ----------');\n return $result;\n}", "public function syncGroups(...$groups): HasGroups;", "public function run_sync_process(){\n //Verify if module is enabled\n if(Mage::helper('connector')->isEnabled()) {\n\n \t//Set sync type\n \t\t$sync_type = Minematic_Connector_Model_Config::SYNC_TYPE_MAGENTO_SIDE;\n\n //Log Starting sync process msg\n Mage::helper('connector')->logSyncProcess(\"Starting synchronization task job...\", $sync_type);\n\n try {\n\n //Sync all data\n Mage::getModel('connector/synchronization')->sync_data($sync_type, Minematic_Connector_Model_Config::DATA_TYPE_ALL);\n\n } catch (Exception $e) {\n\n \t// Logging Exceptions\n Mage::helper('connector')->logSyncProcess($e->getMessage(), $sync_type, \"ERROR\");\n \t\n }\n\n //Log Finishing sync process msg\n Mage::helper('connector')->logSyncProcess(\"Finishing synchronization task job.\", $sync_type);\n }\n }", "public function sync()\n {\n $result = '';\n foreach ($this->hosts() as $host) {\n $result .= $host;\n $result .= \"\\n\";\n }\n file_put_contents($this->configFilePath(), $result);\n }", "public function postFlush(): void\n {\n try {\n foreach ($this->createdObjects as $object) {\n $this->publishUpdate($object, $this->createdObjects[$object], 'create');\n }\n\n foreach ($this->updatedObjects as $object) {\n $this->publishUpdate($object, $this->updatedObjects[$object], 'update');\n }\n\n foreach ($this->deletedObjects as $object) {\n $this->publishUpdate($object, $this->deletedObjects[$object], 'delete');\n }\n } finally {\n $this->reset();\n }\n }", "public function SaveGroupCategory() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstGroup) $this->objGroupCategory->GroupId = $this->lstGroup->SelectedValue;\n\t\t\t\tif ($this->calDateRefreshed) $this->objGroupCategory->DateRefreshed = $this->calDateRefreshed->DateTime;\n\t\t\t\tif ($this->txtProcessTimeMs) $this->objGroupCategory->ProcessTimeMs = $this->txtProcessTimeMs->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the GroupCategory object\n\t\t\t\t$this->objGroupCategory->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}", "function sync() {\n\t\t// TODO\n\t}", "public function postProcess(): void {\n $groupsToAddTo = (array) $this->getSubmittedValue('groups');\n $summaryInfo = ['groups' => [], 'tags' => []];\n foreach ($groupsToAddTo as $groupID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which groups were created vs already existed.\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => Group::get(FALSE)\n ->addWhere('id', '=', $groupID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n\n if ($this->getSubmittedValue('newGroupName')) {\n /* Create a new group */\n $groupsToAddTo[] = $groupID = Group::create(FALSE)->setValues([\n 'title' => $this->getSubmittedValue('newGroupName'),\n 'description' => $this->getSubmittedValue('newGroupDesc'),\n 'group_type' => $this->getSubmittedValue('newGroupType') ?? [],\n 'is_active' => TRUE,\n ])->execute()->first()['id'];\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => $this->getSubmittedValue('newGroupName'),\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n $tagsToAdd = (array) $this->getSubmittedValue('tag');\n foreach ($tagsToAdd as $tagID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which tags were created vs already existed.\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => Tag::get(FALSE)\n ->addWhere('id', '=', $tagID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n if ($this->getSubmittedValue('newTagName')) {\n $tagsToAdd[] = $tagID = Tag::create(FALSE)->setValues([\n 'name' => $this->getSubmittedValue('newTagName'),\n 'description' => $this->getSubmittedValue('newTagDesc'),\n 'is_selectable' => TRUE,\n 'used_for' => 'civicrm_contact',\n //NYSS new tags during import should be imported as keywords\n 'parent_id'\t=> 296,\n ])->execute()->first()['id'];\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => $this->getSubmittedValue('newTagName'),\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n // Store the actions to take on each row & the data to present at the end to the userJob.\n $this->updateUserJobMetadata('post_actions', [\n 'group' => $groupsToAddTo,\n 'tag' => $tagsToAdd,\n ]);\n $this->updateUserJobMetadata('summary_info', $summaryInfo);\n\n // If ACL applies to the current user, update cache before running the import.\n if (!CRM_Core_Permission::check('view all contacts')) {\n $userID = CRM_Core_Session::getLoggedInContactID();\n CRM_ACL_BAO_Cache::deleteEntry($userID);\n CRM_ACL_BAO_Cache::deleteContactCacheEntry($userID);\n }\n\n $this->runTheImport();\n }", "public function sync($data, EntityManagerInterface $em, SyncMapping $mapping, $serializationGroups = array(\"sync_basic\"));", "public function syncDataNode() {}" ]
[ "0.65281314", "0.6265716", "0.5901688", "0.58230424", "0.58114886", "0.5726704", "0.57096225", "0.551641", "0.55151224", "0.54759413", "0.54642814", "0.54345965", "0.54327697", "0.5428166", "0.5390167", "0.5378169", "0.53712213", "0.53666484", "0.53377974", "0.53340757", "0.53314525", "0.53305066", "0.5328226", "0.5320292", "0.53074056", "0.53068805", "0.53037566", "0.524518", "0.5229717", "0.5226301" ]
0.6503954
1
Convert a PHP array containing recurring downtime config to a string appropriate for downtime's schedule.cfg
function recurringdowntime_array_to_cfg($arr) { if (count($arr) == 0) { return ""; } $cfg_str = ""; foreach ($arr as $sid => $schedule) { if (count($schedule) == 0) { continue; } $cfg_str .= "define schedule {\n"; $cfg_str .= "\tsid\t\t\t$sid\n"; foreach ($schedule as $var => $val) { // get a sane tab count for proper viewing/troubleshooting $tabs = "\t\t"; if ($var == 'servicegroup_name' || $var == 'service_description') $tabs = "\t"; if ($var == 'user' || $var == 'comment' || $var == 'time' || $var == 'svcalso') $tabs .= "\t"; $cfg_str .= "\t$var{$tabs}$val\n"; } $cfg_str .= "}\n\n"; } return $cfg_str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurringdowntime_get_cfg()\n{\n recurringdowntime_check_cfg();\n $cfg = file_get_contents(RECURRINGDOWNTIME_CFG);\n return recurringdowntime_cfg_to_array($cfg);\n}", "function recurringdowntime_write_cfg($cfg)\n{\n if (is_array($cfg)) {\n $cfg_str = recurringdowntime_array_to_cfg($cfg);\n } else {\n $cfg_str = $cfg;\n }\n recurringdowntime_check_cfg();\n file_put_contents(RECURRINGDOWNTIME_CFG, $cfg_str);\n return true;\n}", "function recurringdowntime_get_service_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"host\") {\n continue;\n }\n }\n\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n\n if (array_key_exists('host_name', $schedule)) {\n if (array_key_exists('service_description', $schedule)) {\n if ($schedule[\"service_description\"] != '*') {\n $search_str = $schedule[\"service_description\"];\n\n if (strstr($schedule[\"service_description\"], \"*\")) {\n $search_str = \"lk:\" . str_replace(\"*\", \"%\", $schedule[\"service_description\"]);\n }\n if (!is_authorized_for_service(0, $schedule[\"host_name\"], $search_str)) {\n continue;\n }\n }\n }\n\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_update_pending_changes($arr)\n{\n if (empty($arr)) {\n $arr = array();\n }\n\n // Save the array into an option\n $encoded = base64_encode(json_encode($arr));\n set_option('recurringdowntime_pending_changes', $encoded);\n}", "function recurringdowntime_get_host_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"service\") {\n continue;\n }\n }\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n if (array_key_exists('host_name', $schedule)) {\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "public static function getSchedulePattern(): string;", "function recurringdowntime_get_hostgroup_cfg($hostgroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"hostgroup\") {\n continue;\n }\n }\n if ($hostgroup && !(strtolower($schedule[\"hostgroup_name\"]) == strtolower($hostgroup))) {\n continue;\n }\n if (array_key_exists('hostgroup_name', $schedule)) {\n if (is_authorized_for_hostgroup(0, $schedule[\"hostgroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_get_servicegroup_cfg($servicegroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"servicegroup\") {\n continue;\n }\n }\n if ($servicegroup && !(strtolower($schedule[\"servicegroup_name\"]) == strtolower($servicegroup))) {\n continue;\n }\n if (array_key_exists('servicegroup_name', $schedule)) {\n if (is_authorized_for_servicegroup(0, $schedule[\"servicegroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function serendipity_replaceEmbeddedConfigVars ($s) {\n return str_replace(\n array(\n '%clock%'\n ),\n\n array(\n date('H:i')\n ),\n\n $s);\n}", "function my_cron_schedules($schedules){\r\n if(!isset($schedules[\"5min\"])){\r\n $schedules[\"5min\"] = array(\r\n 'interval' => 5*60,\r\n 'display' => __('Once every 5 minutes'));\r\n }\r\n if(!isset($schedules[\"15min\"])){\r\n $schedules[\"15min\"] = array(\r\n 'interval' => 15*60,\r\n 'display' => __('Once every 15 minutes'));\r\n }\r\n return $schedules;\r\n}", "function cfgArray2CfgString($cfgArr) {\r\n\r\n // Initialize:\r\n $inLines = array();\r\n\r\n // Traverse the elements of the form wizard and transform the settings into configuration code.\r\n foreach($cfgArr as $vv) {\r\n if ($vv['comment']) {\r\n // If \"content\" is found, then just pass it over.\r\n $inLines[] = trim($vv['comment']);\r\n } else {\r\n // Begin to put together the single-line configuration code of this field:\r\n\r\n // Reset:\r\n $thisLine = array();\r\n\r\n // Set Label:\r\n $thisLine[0] = str_replace('|', '', $vv['label']);\r\n\r\n // Set Type:\r\n if ($vv['type']) {\r\n $thisLine[1] = ($vv['required']?'*':'').str_replace(',', '', ($vv['fieldname']?$vv['fieldname'].'=':'').$vv['type']);\r\n\r\n // Default:\r\n $tArr = array('', '', '', '', '', '');\r\n switch((string)$vv['type']) {\r\n case 'textarea':\r\n if (intval($vv['cols'])) $tArr[0] = intval($vv['cols']);\r\n if (intval($vv['rows'])) $tArr[1] = intval($vv['rows']);\r\n if (trim($vv['extra'])) $tArr[2] = trim($vv['extra']);\r\n if (strlen($vv['specialEval'])) {\r\n $thisLine[2] = '';\r\n // Preset blank default value so position 3 can get a value...\r\n $thisLine[3] = $vv['specialEval'];\r\n }\r\n break;\r\n case 'input':\r\n case 'password':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n if (intval($vv['max'])) $tArr[1] = intval($vv['max']);\r\n if (strlen($vv['specialEval'])) {\r\n $thisLine[2] = '';\r\n // Preset blank default value so position 3 can get a value...\r\n $thisLine[3] = $vv['specialEval'];\r\n }\r\n break;\r\n case 'file':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n break;\r\n case 'select':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n if ($vv['autosize']) $tArr[0] = 'auto';\r\n if ($vv['multiple']) $tArr[1] = 'm';\r\n\r\n }\r\n $tArr = $this->cleanT($tArr);\r\n if (count($tArr)) $thisLine[1] .= ','.implode(',', $tArr);\r\n\r\n $thisLine[1] = str_replace('|', '', $thisLine[1]);\r\n\r\n // Default:\r\n if ($vv['type'] == 'select' || $vv['type'] == 'radio') {\r\n $thisLine[2] = str_replace(chr(10), ', ', str_replace(',', '', $vv['options']));\r\n } elseif ($vv['type'] == 'checkbox') {\r\n if ($vv['default']) $thisLine[2] = 1;\r\n } elseif (strcmp(trim($vv['default']), '')) {\r\n $thisLine[2] = $vv['default'];\r\n }\r\n if (isset($thisLine[2])) $thisLine[2] = str_replace('|', '', $thisLine[2]);\r\n }\r\n\r\n // Compile the final line:\r\n $inLines[] = ereg_replace(\"[\\n\\r]*\", '', implode(' | ', $thisLine));\r\n }\r\n }\r\n // Finally, implode the lines into a string, and return it:\r\n return implode(chr(10), $inLines);\r\n }", "public function getScheduleDescription() {\n\t\t\n\t\t$description = '';\n\t\t\n\t\tif ($this->isEveryDaySchedule()) {\n\t\t\t$description .= 'Envio Diario';\n\t\t}\n\t\t\n\t\tif ($this->isOnceAWeekSchedule()) {\n\t\t\t\n\t\t\t$description .= 'Envio Semanal ';\n\t\t\t$weekdays = NewsletterSchedulePeer::getWeekdays();\n\t\t\t$description .= '(Se realiza los dias ' . $weekdays[$this->getDeliveryDay()] . ')';\n\t\t}\n\n\t\tif ($this->isOnceAMonthSchedule()) {\n\t\t\t\n\t\t\t$description .= 'Envio Mensual ';\n\t\t\t$description .= '(Se realiza el dia ' . $this->getDeliveryDayNumber() . ' del mes)';\n\t\t}\n\t\t\n\t\tif ($this->isOnceSchedule()) {\n\t\t\t\n\t\t\t$description .= 'Envio Unico ';\n\t\t\t$description .= '(Se realiza el dia ' . date(\"d-m-Y\",strtotime($this->getDeliveryDate())) . ')';\n\t\t}\t\t\n\t\t\n\t\treturn $description;\n\t\t\n\t}", "function filter_cron_schedules($schedules) {\n $schedules['once_half_hour'] = array(\n 'interval' => 1800, // seconds\n 'display' => __('Once Half an Hour')\n );\n $schedules['half_part_time'] = array(\n 'interval' => 900, // seconds\n 'display' => __('Half Part Time')\n );\n\n return $schedules;\n}", "public function schedules()\n {\n $inVacation = config('schedules')['vacation'];\n $weekdays = config('schedules')['tabData']['days'];\n\n if ($inVacation) {\n $schedules = [\n 'sun' => null,\n 'mon' => null,\n 'tue' => null,\n 'wed' => null,\n 'thu' => null,\n 'fri' => null,\n 'sat' => null\n ];\n\n $scheduleMessage = config('schedules')['vacationMessage'] . '<br>...';\n } else {\n $schedules = $this->schedules->getByDay();\n $scheduleMessage = 'Sem horários<br>...';\n }\n\n return [\n 'weekDays' => $weekdays,\n 'currentDay' => \\strtolower(\\date('D')),\n 'schedules' => $schedules,\n 'scheduleEmptyMessage' => $scheduleMessage\n ];\n }", "function nhymxu_weekly_cron_job_recurrence( $schedules ) {\n\t$schedules['weekly'] = array(\n\t\t'display' => 'weekly',\n\t\t'interval' => 604800,\n\t);\n\treturn $schedules;\n}", "function recurringdowntime_check_cfg()\n{\n if (!file_exists(RECURRINGDOWNTIME_CFG)) {\n $fh = @fopen(RECURRINGDOWNTIME_CFG, \"w+\");\n fclose($fh);\n }\n}", "function cron_add_weekly( $schedules ) {\n $schedules['weekly'] = array(\n 'interval' => 604800,\n 'display' => __( 'Once Weekly' )\n );\n return $schedules;\n}", "function recurringdowntime_get_pending_changes()\n{\n $obj = get_option('recurringdowntime_pending_changes', array());\n if (!is_array($obj)) {\n $obj = json_decode(base64_decode($obj), true);\n }\n return $obj;\n}", "public function get_timming_config()\n {\n return array(\"4\" => \"1\", \"5\" => \"7\", \"6\" => \"30\", \"8\" => \"60\", \"9\" => \"90\", \"17\" => \"w\", \"31\" => \"m\",\n \"3\" => \"3\", \"14\" => \"14\");\n }", "function ds_add_email_cron_schedules( $param ) {\n\n $param['fifteen_minute'] = array(\n 'interval' => 900, // seconds* 900/60 = 15 mins\n 'display' => __( 'Every Fifteen Minutes' )\n );\n\n return $param;\n\n }", "function add_cuentadigital_interval($schedules){\n $schedules['cuentadigital_interval'] = array(\n 'interval' => $this->cuentadigital_interval,\n 'display' => __( 'CuentaDigital Interval', 'se' )\n );\n return $schedules;\n }", "function emp_cron_schedules($schedules){\n\t$schedules['em_minute'] = array(\n\t\t'interval' => 60,\n\t\t'display' => 'Every Minute'\n\t);\n\treturn $schedules;\n}", "protected function getConfigName()\n {\n return 'realtime';\n }", "function nde_edreports_add_intervals($schedules)\n\t{\n\t\t$schedules['weekly'] = array(\n\t\t\t'interval' => 604800,\n\t\t\t'display' => __('Once Weekly')\n\t\t);\n\t\t$schedules['monthly'] = array(\n\t\t\t'interval' => 2635200,\n\t\t\t'display' => __('Once a month')\n\t\t);\n\t\t$schedules['tenminutes'] = array(\n\t\t\t'interval' => 600,\n\t\t\t'display' => __('Every 10 Minutes')\n\t\t);\n\t\treturn $schedules;\n\t}", "function dcs_dropship_cron_definer($schedules)\r\n{ \r\n\t$schedules['monthly'] = array( \r\n\t\t'interval'=> 2592000, \r\n\t\t'display'=> __('Once Every 30 Days') \r\n\t\t); \r\n\treturn $schedules;\r\n}", "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "public function __toString()\n {\n $s = \"ScheduleExpression[\";\n $s .= \"second=\";\n $s .= $this->second;\n $s .= \" minute=\";\n $s .= $this->minute;\n $s .= \" hour=\";\n $s .= $this->hour;\n $s .= \" dayOfWeek=\";\n $s .= $this->dayOfWeek;\n $s .= \" dayOfMonth=\";\n $s .= $this->dayOfMonth;\n $s .= \" month=\";\n $s .= $this->month;\n $s .= \" year=\";\n $s .= $this->year;\n $s .= \" start=\";\n $s .= (string)$this->start;\n $s .= \" end=\";\n $s .= (string)$this->end;\n $s .= \" timezone=\";\n $s .= $this->timezone;\n $s .= \"]\";\n\n return $s;\n }", "function recurringdowntime_apply_pending_changes($cbtype, &$cbargs)\n{\n // Verify this is an apply config and it finished successfully\n if ($cbargs['command'] != COMMAND_NAGIOSCORE_APPLYCONFIG || $cbargs['return_code'] != 0) {\n return;\n }\n\n // Verify there are pending changes\n $pending = recurringdowntime_get_pending_changes();\n if (empty($pending)) {\n return;\n }\n\n // Apply the actual changes to the cfg\n $cfg = recurringdowntime_get_cfg();\n foreach ($pending as $p) {\n if (array_key_exists('host_name', $p)) {\n $cfg[$p['cfg_id']]['host_name'] = $p['host_name'];\n } else if (array_key_exists('service_description', $p)) {\n $cfg[$p['cfg_id']]['service_description'] = $p['service_description'];\n } else if (array_key_exists('hostgroup_name', $p)) {\n $cfg[$p['cfg_id']]['hostgroup_name'] = $p['hostgroup_name'];\n } else if (array_key_exists('servicegroup_name', $p)) {\n $cfg[$p['cfg_id']]['servicegroup_name'] = $p['servicegroup_name'];\n }\n }\n\n recurringdowntime_write_cfg($cfg);\n recurringdowntime_update_pending_changes(array());\n}", "function toString() {\r\n\r\n\t\t$sb = 'MessageResourcesConfig[';\r\n\t\t$sb .= 'factory=';\r\n\t\t$sb .= $this->factory;\r\n\t\t$sb .= 'null=';\r\n\t\t$sb .= $this->nullValue;\r\n\t\t$sb .= ',parameter=';\r\n\t\t$sb .= $this->parameter;\r\n\t\t$sb .= ']';\r\n\t\treturn $sb;\r\n\r\n\t}", "function wpcron_intervals( $schedules ) {\n\n\t// one minute\n\n\t$one_minute = array(\n\t\t\t\t\t'interval' => 60,\n\t\t\t\t\t'display' => 'One Minute'\n\t\t\t\t);\n\n\t$schedules[ 'one_minute' ] = $one_minute;\n\n\t// five minutes\n\n\t$five_minutes = array(\n\t\t\t\t\t'interval' => 300,\n\t\t\t\t\t'display' => 'Five Minutes'\n\t\t\t\t);\n\n\t$schedules[ 'five_minutes' ] = $five_minutes;\n\n\t// return data\n\n\treturn $schedules;\n\n}" ]
[ "0.6528919", "0.6488773", "0.57189596", "0.56734097", "0.56181705", "0.547865", "0.53784984", "0.53151447", "0.53020585", "0.5278031", "0.5262727", "0.5217304", "0.52019185", "0.5122828", "0.51058817", "0.5093991", "0.50462073", "0.5026799", "0.5025568", "0.50076693", "0.5005107", "0.50014824", "0.4961539", "0.4960573", "0.49586123", "0.49543977", "0.49506253", "0.49288103", "0.49196574", "0.49152792" ]
0.8173625
0
/ Make sure cfg file exists, and if not, create it.
function recurringdowntime_check_cfg() { if (!file_exists(RECURRINGDOWNTIME_CFG)) { $fh = @fopen(RECURRINGDOWNTIME_CFG, "w+"); fclose($fh); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testCreateConfigFile(){\n\t\tTestsHelper::Print(\"testing magratheaConfig checking if we can create a config file...\");\n\t\t$this->magConfig->Save();\n\t\t$this->assertTrue(file_exists($this->configPath.\"/\".$this->fileName));\n\t}", "function testCreateConfigFile(){\n\t\t\techo \"testing magratheaConfig checking if we can create a config file... <br/>\";\n\t\t\t$this->magConfig->Save();\n\t\t\t$this->assertTrue(file_exists($this->configPath.\"test_conf.conf\"));\n\t\t}", "private function copyFromTemplateIfNeeded() {\n\t\t$templatePath = __DIR__ . '/../conf/config.template.php';\n\t\tif (!file_exists($this->filePath)) {\n\t\t\tcopy($templatePath, $this->filePath) or LegacyLogger::log('ERROR', 'StartUp', \"could not create config file: {$this->filePath}\");\n\t\t}\n\t}", "private function writeConfigFile()\n {\n if (!$this->configFile) {\n $confDir = $this->scratchSpace . DIRECTORY_SEPARATOR . 'config';\n mkdir($confDir);\n $this->configFile = $confDir . DIRECTORY_SEPARATOR . 'config.yml';\n }\n file_put_contents($this->configFile, $this->configYaml);\n $this->container->setParameter('config.filename', $this->configFile);\n }", "public function configFileExists() {\n $_fileName = \\Config::get('fontello::config.file');\n $_folderName = \\Config::get('fontello::config.folder');\n if (\\File::exists($_folderName . $_fileName)) {\n $this->_configFile = $_folderName . $_fileName;\n return true;\n }\n return false;\n }", "private function useTmpConfigDatabase() {\n\t\t$configFile = sprintf(\"%s/../data/config.xml\", getcwd());\n\t\t$tmpConfigFile = tempnam(\"/tmp\", \"cfg\");\n\t\tcopy($configFile, $tmpConfigFile);\n\t\t\\OMV\\Environment::set(\"OMV_CONFIG_FILE\", $tmpConfigFile);\n\t}", "private function copyConfigFile()\n {\n $path = $this->getConfigPath();\n\n // if generatords config already exist\n if ($this->files->exists($path) && $this->option('force') === false) {\n $this->error(\"{$path} already exists! Run 'generate:publish-stubs --force' to override the config file.\");\n die;\n }\n\n File::copy(__DIR__ . '/../config/config.php', $path);\n }", "public function createConfig()\n\t{\n\t}", "public function prepareCfg() {\n if($result = DB::get()->query(\"SELECT * FROM `config` WHERE `sid` = '\" . $this->sid . \"'\")) {\n $row = $result->fetch_assoc();\n $result->close();\n\n $file = PATH . '/serverdata/server' . $this->sid . '.cfg';\n if(!file_exists($file)) {\n touch($file);\n chmod($file, 0777);\n }\n file_put_contents($file, $row['cfg']);\n\n $file = PATH . '/serverdata/mapcycle' . $this->sid . '.txt';\n if(!file_exists($file)) {\n touch($file);\n chmod($file, 0777);\n }\n file_put_contents($file, $row['mapcycle']);\n }\n }", "public static function writeConfig($basePath, array $cfg)\n {\n foreach ($cfg as $key => $value) {\n if (!in_array($key, self::validLfsParams) && !in_array($key, self::validExtraParams)) {\n throw new LsnException(\"Parameter '$cfg' is not recognized\");\n }\n }\n\n if (!file_exists($basePath)) {\n if (!@mkdir($basePath, 0775, true)) {\n throw new LsnException(\"Can't create directory '$basePath'! Permission problem?\");\n }\n }\n\n if (@file_put_contents(\"$basePath/welcome.txt\", isset($cfg['welcome']) ? $cfg['welcome'] : '') === false) {\n throw new LsnException(\"Failed to write at '\\\"$basePath/welcome.cfg\\\"'\");\n }\n\n if (@file_put_contents(\"$basePath/tracks.txt\", isset($cfg['tracks']) ? implode(PHP_EOL, (array)$cfg['tracks']) : '') === false) {\n throw new LsnException(\"Failed to write at '\\\"$basePath/tracks.cfg\\\"'\");\n }\n\n\n $fileContents = [];\n $fileContents[] = '// This file is automatically generated at '.date('Y-m-d H:i:s').'';\n\n $lfsConfig = [];\n foreach (self::validLfsParams as $key) {\n if (array_key_exists($key, $cfg) && !empty($cfg[$key])) {\n $lfsConfig[$key] = $cfg[$key];\n } elseif (array_key_exists($key, self::defaultConfig)) {\n $lfsConfig[$key] = self::defaultConfig[$key];\n }\n }\n\n if (!empty($cfg['welcome'])) {\n $lfsConfig['welcome'] = 'welcome.txt';\n }\n\n if (!empty($cfg['tracks'])) {\n $lfsConfig['tracks'] = 'tracks.txt';\n }\n\n foreach ($lfsConfig as $key => $value) {\n $fileContents[] = \"/$key=$value\";\n }\n $fileContents[] = \"\"; // new line at the end\n\n if (!@file_put_contents(\"$basePath/setup.cfg\", implode(\"\\n\", $fileContents))) {\n throw new LsnException(\"Failed to write at '\\\"$basePath/setup.cfg\\\"'\");\n }\n }", "function configfile_writeable() {\n\t\treturn is_writeable( CLASSPATH.\"payment/\".__CLASS__.\".cfg.php\" );\n\t}", "function test_config()\n{\n\treturn is_writable('includes/config.php');\n}", "public function testConfigExists() {\n if (isset($this->app->config) && sizeof($this->app->config) > 0) {\n $this->pass(\"The configuration file has been loaded.\");\n }\n else {\n $this->fail(\"The configuration file was not loaded or is empty.\");\n }\n }", "public function testCreatesFileOnRead()\n {\n Wallet::read();\n $this->assertFileExists(Wallet::WALLET_CONFIG);\n }", "public function createNewConfig() { \n\n\t\t/** \n\t\t * Start by creating the top of the php file\n\t\t *\n\t\t */\n\t\t$this->newFileStr = \"<?php\\n\\n\";\n\n\t\t/** \n\t\t * We want to loop through the new config variables\n\t\t * and concatenate the variable\n\t\t *\n\t\t * @var string stores new variables.\n\t\t */\n\n\t\tforeach ($this->fileSettings as $name => $val) {\n\n\t\t/** \n\t\t * Output our config variables comment\n\t\t * and concatenate the variable\n\t\t *\n\t\t * @var string stores new config comment\n\t\t */\n\n\t\t$this->newFileStr .= \"\\n\\n//\" . $val['1'] . \"\\n\";\n\t\t\n\n\t\t/** \n\t\t *\n\t\t * Using var_export() allows you to set complex values \n\t\t * such as arrays and also ensures types will be correct\n\t\t *\n\t\t * @var string stores new config setting\n\t\t */\n\t\t\n\t\t$this->newFileStr .= \"$\".$name.\" = \".var_export($val['0'], TRUE).\";\\n\";\n\n\n\t\t} // end of foreach\n\n\t\t/** \n\t\t *\n\t\t * End our php file\n\t\t *\n\t\t */\n\n\t\t$this->newFileStr .= \"\\n?>\";\n\n\t\t/** \n\t\t *\n\t\t * Create out new config\n\t\t *\n\t\t */\n\t\tfile_put_contents($this->filePath, $this->newFileStr, LOCK_EX);\n\n\t}", "private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }", "function recurringdowntime_write_cfg($cfg)\n{\n if (is_array($cfg)) {\n $cfg_str = recurringdowntime_array_to_cfg($cfg);\n } else {\n $cfg_str = $cfg;\n }\n recurringdowntime_check_cfg();\n file_put_contents(RECURRINGDOWNTIME_CFG, $cfg_str);\n return true;\n}", "function testSaveConfigFile(){\n\t\tTestsHelper::Print(\"testing magratheaConfig saving a config file...\");\n\t\t$confs = array(\"config_test\" => \"ok\", \n\t\t\t\"config_test2\" => \"another_ok\" );\n\t\t$this->magConfig->setConfig($confs);\n\t\t$this->magConfig->Save(false);\n\t\t$this->assertTrue(file_exists($this->configPath.\"/\".$this->fileName));\n\t}", "function testSaveConfigFile(){\n\t\t\techo \"testing magratheaConfig saving a config file... <br/>\";\n\t\t\t$confs = array(\"config_test\" => \"ok\", \n\t\t\t\t\"config_test2\" => \"another_ok\" );\n\t\t\t$this->magConfig->setConfig($confs);\n\t\t\t$this->magConfig->Save(false);\n\t\t\t$this->assertTrue(file_exists($this->configPath.\"test_conf.conf\"));\n\t\t}", "function creat_conf_for_offline($project){\n $str = 'workingDir='.$project->outputPython.\"\\r\\n\";\n $str = $str.'git='.$project->userProjectRoot.\"\\\\\".$project->gitName.\"\\r\\n\";\n $str = $str.'issue_tracker_product_name='.$project->issue_tracker_product_name.\"\\r\\n\";\n $str = $str.'issue_tracker_url='.$project->issue_tracker_url.\"\\r\\n\";\n $str = $str.'issue_tracker='.$project->issue_tracker.\"\\r\\n\";\n $str = $str.\"vers=(\". $project->all_versions.\")\";\n file_put_contents($project->learnDir.\"\\\\antConf.txt\",$str); \n\t}", "public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }", "public function createCfg() {\n global $hostlist;\n $hostinfo = $hostlist[$this->host];\n $this->prepareCfg();\n $src = PATH . '/serverdata';\n $dest = GAMEPATH . '/users/ts' . $this->sid;\n if($ssh = new SSH($hostinfo)) {\n $ret1 = $ssh->sendFile($src . '/server' . $this->sid . '.cfg', $dest . '/server.cfg');\n $ret2 = $ssh->sendFile($src . '/mapcycle' . $this->sid . '.txt', $dest . '/mapcycle.txt');\n return $ret1 && $ret2;\n }\n }", "protected function createEnvFile()\n {\n if (! file_exists('.env')) {\n copy('.env.example', '.env');\n $this->line('.env file successfully created');\n }\n }", "function createDirectoryIfNonExistent() {\n if (! file_exists($this->path)) {\n mkdir($this->path);\n }\n }", "private static function check_config ()\n\t{\n\t\t// load config file here\n\t\tif (count(self::$_config) == 0)\n\t\t{\n\t\t\tself::LoadConfigFile();\n\t\t}\n\t}", "function saveConfig(Config_Lite $inConfig) {\r\n\t\ttry {\r\n $inConfig->save();\r\n\t\t} catch (Config_Lite_Exception $e) {\r\n\t\t\techo \"\\n\" . 'Exception Message: ' . $e->getMessage();\r\n\t\t\twrite_log('Error saving configuration.','ERROR');\r\n\t\t}\r\n\t\t$configFile = dirname(__FILE__) . '/config.ini.php';\r\n\t\t$cache_new = \"'; <?php die('Access denied'); ?>\"; // Adds this to the top of the config so that PHP kills the execution if someone tries to request the config-file remotely.\r\n\t\t$cache_new .= file_get_contents($configFile);\r\n\t\tfile_put_contents($configFile,$cache_new);\r\n\t\t\r\n\t}", "public function checkConfiguration()\n\t{\n\t\tglobal $langs;\n\n\t\t$errors = array();\n\n\t\t$filename = $this->getFilename();\n\n\t\tif (file_exists($filename) && is_writable($filename))\n\t\t{\n\t\t\tdol_syslog('admin/syslog: file '.$filename);\n\t\t}\n\t\telse $errors[] = $langs->trans(\"ErrorFailedToOpenFile\", $filename);\n\n\t\treturn $errors;\n\t}", "public function writeFullConfFile()\n {\n return $this->writeFile(\n $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR .\n self::GITOLITE_CONF_DIR . self::GITOLITE_CONF_FILE,\n $this->renderFullConfFile()\n );\n }", "static function create_config_inc($dbhost, $dbuser, $dbpass, $dbname, \n $title, $google, $copyright)\n {\n // create the file\n if (!$f = @fopen(dirname(__FILE__).'/../../inc/config.inc.php', 'w')) {\n return 'Could not create config inside of folder \"inc\". '.\n 'Check folder permissions and try again.';\n }\n \n // check the google tracking ID\n $googleTrackingID = '$googleTrackingID = ';\n if ($google === '') {\n $googleTrackingID .= 'null;';\n } else {\n $googleTrackingID .= '\\''.$google.'\\';';\n }\n \n // put in the header\n $today = getdate();\n $toWrite = '\n<?php\n/**\n * RMS Site Settings and Configuration\n *\n * Contains the site settings and configurations for the RMS. This file is\n * auto-generated and should not be edited by hand.\n *\n * @author Auto Generated via Setup Script\n * @copyright 2013 Russell Toris, Worcester Polytechnic Institute\n * @license BSD -- see LICENSE file\n * @version '.$today['month'].' '.$today['mday'].', '.$today['year'].'\n * @package inc\n * @link http://ros.org/wiki/rms\n */\n\n// database information\n$dbhost = \\''.$dbhost.'\\';\n$dbuser = \\''.$dbuser.'\\';\n$dbpass = \\''.$dbpass.'\\';\n$dbname = \\''.$dbname.'\\';\n$db = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname)\nor DIE(\\'Connection has failed. Please try again later.\\');\n\n// Google Analytics tracking ID -- unset if no tracking is being used.\n'.$googleTrackingID.'\n\n// site copyright and design information\n$copyright = \\'&copy '.addslashes($copyright).'\\';\n$title = \\''.addslashes($title).'\\';\n// original site design information\n$designedBy = \\'Site design by\n <a href=\"http://users.wpi.edu/~rctoris/\">Russell Toris</a>\\';\n';\n fwrite($f, $toWrite);\n \n // close the file\n fclose($f);\n \n // everything went fine, no errors\n return false;\n }", "protected function ensure_path_exists() {\n global $CFG;\n if (!is_writable($this->path)) {\n if ($this->custompath && !$this->autocreate) {\n throw new coding_exception('File store path does not exist. It must exist and be writable by the web server.');\n }\n $createdcfg = false;\n if (!isset($CFG)) {\n // This can only happen during destruction of objects.\n // A cache is being used within a destructor, php is ending a request and $CFG has\n // already being cleaned up.\n // Rebuild $CFG with directory permissions just to complete this write.\n $CFG = $this->cfg;\n $createdcfg = true;\n }\n if (!make_writable_directory($this->path, false)) {\n throw new coding_exception('File store path does not exist and can not be created.');\n }\n if ($createdcfg) {\n // We re-created it so we'll clean it up.\n unset($CFG);\n }\n }\n return true;\n }" ]
[ "0.68288004", "0.6795925", "0.6556549", "0.64912236", "0.64732426", "0.64545083", "0.6379413", "0.6316263", "0.62382543", "0.62193733", "0.61433065", "0.60766554", "0.60611635", "0.6059164", "0.6027296", "0.60121304", "0.59842795", "0.59118146", "0.5885892", "0.5874434", "0.5861598", "0.58594453", "0.5839903", "0.58103156", "0.5797395", "0.57842803", "0.5767194", "0.57597196", "0.57326525", "0.57242656" ]
0.6995747
0
Get downtime schedule for specified host
function recurringdowntime_get_host_cfg($host = false) { $cfg = recurringdowntime_get_cfg(); $ret = array(); foreach ($cfg as $sid => $schedule) { if (array_key_exists('schedule_type', $schedule)) { if ($schedule["schedule_type"] == "hostgroup") { continue; } if ($schedule["schedule_type"] == "servicegroup") { continue; } if ($schedule["schedule_type"] == "service") { continue; } } if ($host && !(strtolower($schedule["host_name"]) == strtolower($host))) { continue; } if (array_key_exists('host_name', $schedule)) { if (is_authorized_for_host(0, $schedule["host_name"])) { $ret[$sid] = $schedule; } } } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurringdowntime_get_service_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"host\") {\n continue;\n }\n }\n\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n\n if (array_key_exists('host_name', $schedule)) {\n if (array_key_exists('service_description', $schedule)) {\n if ($schedule[\"service_description\"] != '*') {\n $search_str = $schedule[\"service_description\"];\n\n if (strstr($schedule[\"service_description\"], \"*\")) {\n $search_str = \"lk:\" . str_replace(\"*\", \"%\", $schedule[\"service_description\"]);\n }\n if (!is_authorized_for_service(0, $schedule[\"host_name\"], $search_str)) {\n continue;\n }\n }\n }\n\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_get_hostgroup_cfg($hostgroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"hostgroup\") {\n continue;\n }\n }\n if ($hostgroup && !(strtolower($schedule[\"hostgroup_name\"]) == strtolower($hostgroup))) {\n continue;\n }\n if (array_key_exists('hostgroup_name', $schedule)) {\n if (is_authorized_for_hostgroup(0, $schedule[\"hostgroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "public function findHostDowntimesForAdminUser(): array;", "public function findHostDowntimesForNonAdminUser(): array;", "function recurringdowntime_show_downtime()\n{\n global $request;\n\n do_page_start(array(\"page_title\" => _(\"Recurring Downtime\")), true);\n\n if (isset($request[\"host\"])) {\n $host_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n $service_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n if (is_authorized_for_host(0, $request[\"host\"])) {\n $host_data = recurringdowntime_get_host_cfg($request[\"host\"]);\n $service_data = recurringdowntime_get_service_cfg($request[\"host\"]);\n }\n } elseif (isset($request[\"hostgroup\"])) {\n $hostgroup_tbl_header = _(\"Recurring Downtime for Hostgroup: \") . $request[\"hostgroup\"];\n if (is_authorized_for_hostgroup(0, $request[\"hostgroup\"])) {\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($request[\"hostgroup\"]);\n }\n } elseif (isset($request[\"servicegroup\"])) {\n $servicegroup_tbl_header = _(\"Recurring Downtime for Servicegroup: \") . $request[\"servicegroup\"];\n if (is_authorized_for_servicegroup(0, $request[\"servicegroup\"])) {\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($request[\"servicegroup\"]);\n }\n }\n\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n /*\n $host_tbl_header = \"Recurring Downtime for All Hosts\";\n $hostgroup_tbl_header = \"Recurring Downtime for All Hostgroups\";\n $servicegroup_tbl_header = \"Recurring Downtime for All Servicegroups\";\n */\n $host_tbl_header = _(\"Host Schedules\");\n $service_tbl_header = _(\"Service Schedules\");\n $hostgroup_tbl_header = _(\"Hostgroup Schedules\");\n $servicegroup_tbl_header = _(\"Servicegroup Schedules\");\n $host_data = recurringdowntime_get_host_cfg($host = false);\n $service_data = recurringdowntime_get_service_cfg($host = false);\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($hostgroup = false);\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($servicegroup = false);\n $showall = true;\n }\n\n ?>\n <h1><?php echo _(\"Recurring Downtime\"); ?></h1>\n\n <?php echo _(\"Scheduled downtime definitions that are designed to repeat (recur) at set intervals are shown below. The next schedule for each host/service are added to the monitoring engine when the cron runs at the top of the hour.\"); ?>\n\n <?php\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n ?>\n <p>\n <?php } ?>\n\n <script type=\"text/javascript\">\n function do_delete_sid(sid) {\n input = confirm('<?php echo _(\"Are you sure you wish to delete this downtime schedule?\"); ?>');\n if (input == true) {\n window.location.href = 'recurringdowntime.php?mode=delete&sid=' + sid + '&nsp=<?php echo get_nagios_session_protector_id();?>';\n }\n }\n </script>\n\n <?php\n if ($showall) {\n ?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n $(\"#tabs\").tabs().show();\n });\n </script>\n\n <div id=\"tabs\" class=\"hide\">\n <ul>\n <li><a href=\"#host-tab\"><?php echo _(\"Hosts\"); ?></a></li>\n <li><a href=\"#service-tab\"><?php echo _(\"Services\"); ?></a></li>\n <li><a href=\"#hostgroup-tab\"><?php echo _(\"Hostgroups\"); ?></a></li>\n <li><a href=\"#servicegroup-tab\"><?php echo _(\"Servicegroups\"); ?></a></li>\n </ul>\n <?php\n }\n ?>\n\n <?php if (!empty($_GET[\"host\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n\n // hosts tab\n if ($showall) {\n echo \"<div id='host-tab'>\";\n }\n ?>\n\n <h4 <?php if ($host) { echo 'style=\"margin-top: 20px;\"'; } ?>><?php echo $host_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n }\n ?>\n\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Months\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Handle Child Hosts\"); ?></th>\n <th class=\"center\" style=\"width: 80px;\"><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($host_data) {\n $i = 0;\n\n $host_names = array();\n foreach ($host_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n }\n array_multisort($host_names, SORT_ASC, $host_data);\n\n foreach ($host_data as $sid => $schedule) {\n if (empty($schedule['childoptions'])) {\n $schedule['childoptions'] = 0;\n }\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? _(\"Yes\") : _(\"No\"); ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"months_of_year\"]) {\n echo $schedule[\"months_of_year\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"childoptions\"] == 0) {\n echo _(\"No\");\n } elseif ($schedule[\"childoptions\"] == 1) {\n echo _(\"Yes, triggered\");\n } elseif ($schedule[\"childoptions\"] == 2) {\n echo _(\"Yes, non-triggered\");\n } ?></td>\n <td class=\"center\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>&nbsp;\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"10\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if host_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end host tab?>\n\n<?php } // end if host or showall\n\nif (!empty($_GET[\"service\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n $service = grab_request_var('service', '');\n\n if ($showall) {\n echo \"<div id='service-tab'>\";\n }\n ?>\n\n <h4><?php echo $service_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Service\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($service_data) {\n $i = 0;\n\n $host_names = array();\n $service_names = array();\n foreach ($service_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n $service_names[$k] = $data['service_description'];\n }\n\n array_multisort($host_names, SORT_ASC, $service_names, SORT_ASC, $service_data);\n\n foreach ($service_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo $schedule[\"service_description\"]; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php'. \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php }?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"9\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host/service recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if service_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end service tab?>\n\n<?php } // end if service or showall\n\nif (!empty($_GET[\"hostgroup\"]) || $showall) {\n\n $hostgroup = grab_request_var('hostgroup', '');\n\n if ($showall) {\n echo \"<div id='hostgroup-tab'>\";\n }\n ?>\n\n <h4><?php echo $hostgroup_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($hostgroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&hostgroup_name=<?php echo $hostgroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this hostgroup\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Hostgroup\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n\n <?php\n\n if ($hostgroup_data) {\n $i = 0;\n\n $hostgroup_names = array();\n foreach ($hostgroup_data as $k => $data) {\n $hostgroup_names[$k] = $data['hostgroup_name'];\n }\n\n array_multisort($hostgroup_names, SORT_ASC, $hostgroup_data);\n\n foreach ($hostgroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"hostgroup_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? \"Yes\" : \"No\"; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n <?php } else { ?>\n <tr>\n <td colspan=\"8\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no hostgroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if hostrgroup_data ?>\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end hostgroup tab?>\n\n<?php } // end if hostgroup or showall\n\nif (!empty($_GET[\"servicegroup\"]) || $showall) {\n\n $servicegroup = grab_request_var('servicegroup', '');\n\n if ($showall) {\n echo \"<div id='servicegroup-tab'>\";\n }\n ?>\n <h4><?php echo $servicegroup_tbl_header; ?></h4>\n <?php\n if (!is_readonly_user(0)) {\n if ($servicegroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&servicegroup_name=<?php echo $servicegroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this servicegroup\"); ?></a>\n </div>\n <?php } else { ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?>\n </a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Servicegroup\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n\n if ($servicegroup_data) {\n $i = 0;\n\n $servicegroup_names = array();\n foreach ($servicegroup_data as $k => $data) {\n $servicegroup_names[$k] = $data['servicegroup_name'];\n }\n\n array_multisort($servicegroup_names, SORT_ASC, $servicegroup_data);\n\n foreach ($servicegroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"servicegroup_name\"]; ?></td>\n <td><?php echo $schedule[\"comment\"]; ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"recurringdowntime.php?mode=edit&sid=<?php echo $sid; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"7\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no servicegroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if servicegroup_data ?>\n\n\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end servicegroup tab?>\n\n <?php } // end if servicegroup or showall ?>\n\n <?php\n if ($showall) { // end of tabs container\n ?>\n </div>\n <?php\n }\n do_page_end(true);\n}", "public function findDowntimes(int $hostId, int $serviceId): array;", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function testSetGet_schedule_where_time_of_day_has_past() {\n\t\t//The blog time is 10 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '+10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$this->config->set_schedule( date( 'D', $blog_time ), date( 'H', $blog_time ) . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Next week in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', strtotime( '+7 days', $blog_time ) ) . ' ' . date( 'H', $blog_time ) . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Next week in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+7 days', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "protected function schedule(Schedule $schedule){\n\n\t\t$schedule->command('CheckChallengeDeadlines:expirations')->dailyAt('04:00')->timezone('America/New_York');\n\t\t$schedule->command('CheckChallengeDeadlines:summaries', [3])->weekly()->mondays()->at('04:30')->timezone('America/New_York');\n\t\t$schedule->command('CheckChallengeDeadlines:summaries', [4])->weekly()->thursdays()->at('04:30')->timezone('America/New_York');\n\n\t}", "public function testSetGet_schedule_where_time_of_day_has_not_past() {\n\t\t//The blog time is 2 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '-10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$day = date( 'H', $blog_time ) + 1;\n\t\tif ( $day < 10 ) {\n\t\t\t$day = \"0$day\";\n\t\t}\n\n\t\t$this->config->set_schedule( date( 'D', $blog_time ), $day . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Today in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', $blog_time ) . ' ' . $day . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Today in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+1 hour', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "function get_schedule($usrid){\r\n\t\r\n}", "public function getBackupSchedule()\n {\n return $this->backup_schedule;\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }", "public function getWeeklySchedule()\n {\n return $this->weekly_schedule;\n }", "public function getWeeklySchedule()\n {\n return $this->weekly_schedule;\n }", "public function findDowntimesByServiceForAdminUser(int $hostId, int $serviceId): array;", "public function getScheduleTime(){return $this->time_of_day;}", "public function testSetGet_schedule_where_time_of_day_has_past_and_no_day_supplied() {\n\t\t//The blog time is -4 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '-10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$this->config->set_schedule( null, date( 'H', $blog_time ) . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Today in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', strtotime( '+1 day', $blog_time ) ) . ' ' . date( 'H', $blog_time ) . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Today in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+1 day', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "protected function schedule(Schedule $schedule)\n {\n // $configuracao = DB::table('configuracao')->first();\n\n // if($configuracao->frequencia == 'Diária')\n // {\n // $schedule->call(function (){\n // Ente::importar();\n // HistoricoDeAcesso::importar();\n // })->dailyAt($configuracao->horario); \n // }\n // else\n // {\n // $schedule->call(function (){\n // Ente::importar();\n // HistoricoDeAcesso::importar();\n // })->weekly()->fridays()->at($configuracao->horario); \n // }\n \n }", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->hourly();\n }", "public function schedule(): Schedule\n {\n return $this->schedule;\n }", "public function findDowntimesByServiceForNonAdminUser(int $hostId, int $serviceId): array;", "public function getWFScheduleTime() {\n\t\tif (isset($this->multipleschtime)) {\n\t\t\t$multipleschtime = explode(',', $this->multipleschtime);\n\t\t\tusort($multipleschtime, function ($time1, $time2) {\n\t\t\t\t$t1 = strtotime($time1);\n\t\t\t\t$t2 = strtotime($time2);\n\t\t\t\treturn $t1 - $t2;\n\t\t\t});\n\t\t\t$currentTrigger = array_search(date('g:i a', strtotime($this->schtime)), $multipleschtime);\n\t\t\tif (!$currentTrigger && $currentTrigger !== 0) {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[0]));\n\t\t\t\t$this->updateSchtime($multipleschtime[0]);\n\t\t\t} elseif (!isset($multipleschtime[$currentTrigger + 1])) {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[count($multipleschtime)-1]));\n\t\t\t\t$this->updateSchtime($nextTiggerTime);\n\t\t\t} else {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[$currentTrigger + 1]));\n\t\t\t\t$this->updateSchtime($nextTiggerTime);\n\t\t\t}\n\t\t\treturn $nextTiggerTime;\n\t\t}\n\t\treturn $this->schtime;\n\t}", "function card_schedule_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('autoBanSubscribeJob')->everyThirtyMinutes();\n $schedule->command('autoBanUserJob')->everyTenMinutes();\n $schedule->command('autoCheckNodeStatusJob')->everyMinute();\n $schedule->command('autoClearLogJob')->everyThirtyMinutes();\n $schedule->command('autoCloseOrderJob')->everyMinute();\n $schedule->command('autoDecGoodsTrafficJob')->everyTenMinutes();\n $schedule->command('autoDisableExpireUserJob')->everyMinute();\n $schedule->command('autoDisableUserJob')->everyMinute();\n $schedule->command('autoExpireCouponJob')->everyThirtyMinutes();\n $schedule->command('autoExpireInviteJob')->everyThirtyMinutes();\n $schedule->command('autoReleasePortJob')->everyMinute();\n $schedule->command('autoReopenUserJob')->everyMinute();\n $schedule->command('autoResetUserTrafficJob')->everyFiveMinutes();\n $schedule->command('autoStatisticsNodeDailyTrafficJob')->dailyAt('04:30');\n $schedule->command('autoStatisticsNodeHourlyTrafficJob')->hourly();\n $schedule->command('autoStatisticsUserDailyTrafficJob')->dailyAt('03:00');\n $schedule->command('autoStatisticsUserHourlyTrafficJob')->hourly();\n $schedule->command('userExpireWarningJob')->daily();\n $schedule->command('userTrafficWarningJob')->daily();\n $schedule->command('autoStatisticsNodeHourlyTestJob')->hourlyAt(10);\n// $schedule->command('autoStatisticsNodeHourlyTestJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpJob')->dailyAt('00:00');\n// $schedule->command('autoMysqlBackUpJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpRemoteJob')->dailyAt('00:30');\n $schedule->command('cPJob')->everyMinute();\n $schedule->command('deleteAuthJob')->everyMinute();\n $schedule->command('pushJob')->dailyAt('13:37');\n $schedule->command('telegramJob')->everyMinute();\n $schedule->command('autoCountNodeFlow')->everyMinute();\n\n\n\n }", "public function findDowntimesForAdminUser(): array;" ]
[ "0.5987272", "0.5782062", "0.5704168", "0.55294657", "0.55109507", "0.5332869", "0.53317463", "0.53317463", "0.5288101", "0.52256316", "0.52190703", "0.5199032", "0.5156059", "0.5156059", "0.5024774", "0.50046283", "0.49804658", "0.49520847", "0.49520847", "0.4936416", "0.4927169", "0.4889396", "0.48837748", "0.48628607", "0.48546863", "0.48356766", "0.48314422", "0.48160127", "0.48026028", "0.47983304" ]
0.6442558
0
Get downtime schedule for specified host
function recurringdowntime_get_service_cfg($host = false) { $cfg = recurringdowntime_get_cfg(); $ret = array(); foreach ($cfg as $sid => $schedule) { if (array_key_exists('schedule_type', $schedule)) { if ($schedule["schedule_type"] == "hostgroup") { continue; } if ($schedule["schedule_type"] == "servicegroup") { continue; } if ($schedule["schedule_type"] == "host") { continue; } } if ($host && !(strtolower($schedule["host_name"]) == strtolower($host))) { continue; } if (array_key_exists('host_name', $schedule)) { if (array_key_exists('service_description', $schedule)) { if ($schedule["service_description"] != '*') { $search_str = $schedule["service_description"]; if (strstr($schedule["service_description"], "*")) { $search_str = "lk:" . str_replace("*", "%", $schedule["service_description"]); } if (!is_authorized_for_service(0, $schedule["host_name"], $search_str)) { continue; } } } if (is_authorized_for_host(0, $schedule["host_name"])) { $ret[$sid] = $schedule; } } } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurringdowntime_get_host_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"service\") {\n continue;\n }\n }\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n if (array_key_exists('host_name', $schedule)) {\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_get_hostgroup_cfg($hostgroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"hostgroup\") {\n continue;\n }\n }\n if ($hostgroup && !(strtolower($schedule[\"hostgroup_name\"]) == strtolower($hostgroup))) {\n continue;\n }\n if (array_key_exists('hostgroup_name', $schedule)) {\n if (is_authorized_for_hostgroup(0, $schedule[\"hostgroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "public function findHostDowntimesForAdminUser(): array;", "public function findHostDowntimesForNonAdminUser(): array;", "function recurringdowntime_show_downtime()\n{\n global $request;\n\n do_page_start(array(\"page_title\" => _(\"Recurring Downtime\")), true);\n\n if (isset($request[\"host\"])) {\n $host_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n $service_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n if (is_authorized_for_host(0, $request[\"host\"])) {\n $host_data = recurringdowntime_get_host_cfg($request[\"host\"]);\n $service_data = recurringdowntime_get_service_cfg($request[\"host\"]);\n }\n } elseif (isset($request[\"hostgroup\"])) {\n $hostgroup_tbl_header = _(\"Recurring Downtime for Hostgroup: \") . $request[\"hostgroup\"];\n if (is_authorized_for_hostgroup(0, $request[\"hostgroup\"])) {\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($request[\"hostgroup\"]);\n }\n } elseif (isset($request[\"servicegroup\"])) {\n $servicegroup_tbl_header = _(\"Recurring Downtime for Servicegroup: \") . $request[\"servicegroup\"];\n if (is_authorized_for_servicegroup(0, $request[\"servicegroup\"])) {\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($request[\"servicegroup\"]);\n }\n }\n\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n /*\n $host_tbl_header = \"Recurring Downtime for All Hosts\";\n $hostgroup_tbl_header = \"Recurring Downtime for All Hostgroups\";\n $servicegroup_tbl_header = \"Recurring Downtime for All Servicegroups\";\n */\n $host_tbl_header = _(\"Host Schedules\");\n $service_tbl_header = _(\"Service Schedules\");\n $hostgroup_tbl_header = _(\"Hostgroup Schedules\");\n $servicegroup_tbl_header = _(\"Servicegroup Schedules\");\n $host_data = recurringdowntime_get_host_cfg($host = false);\n $service_data = recurringdowntime_get_service_cfg($host = false);\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($hostgroup = false);\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($servicegroup = false);\n $showall = true;\n }\n\n ?>\n <h1><?php echo _(\"Recurring Downtime\"); ?></h1>\n\n <?php echo _(\"Scheduled downtime definitions that are designed to repeat (recur) at set intervals are shown below. The next schedule for each host/service are added to the monitoring engine when the cron runs at the top of the hour.\"); ?>\n\n <?php\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n ?>\n <p>\n <?php } ?>\n\n <script type=\"text/javascript\">\n function do_delete_sid(sid) {\n input = confirm('<?php echo _(\"Are you sure you wish to delete this downtime schedule?\"); ?>');\n if (input == true) {\n window.location.href = 'recurringdowntime.php?mode=delete&sid=' + sid + '&nsp=<?php echo get_nagios_session_protector_id();?>';\n }\n }\n </script>\n\n <?php\n if ($showall) {\n ?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n $(\"#tabs\").tabs().show();\n });\n </script>\n\n <div id=\"tabs\" class=\"hide\">\n <ul>\n <li><a href=\"#host-tab\"><?php echo _(\"Hosts\"); ?></a></li>\n <li><a href=\"#service-tab\"><?php echo _(\"Services\"); ?></a></li>\n <li><a href=\"#hostgroup-tab\"><?php echo _(\"Hostgroups\"); ?></a></li>\n <li><a href=\"#servicegroup-tab\"><?php echo _(\"Servicegroups\"); ?></a></li>\n </ul>\n <?php\n }\n ?>\n\n <?php if (!empty($_GET[\"host\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n\n // hosts tab\n if ($showall) {\n echo \"<div id='host-tab'>\";\n }\n ?>\n\n <h4 <?php if ($host) { echo 'style=\"margin-top: 20px;\"'; } ?>><?php echo $host_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n }\n ?>\n\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Months\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Handle Child Hosts\"); ?></th>\n <th class=\"center\" style=\"width: 80px;\"><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($host_data) {\n $i = 0;\n\n $host_names = array();\n foreach ($host_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n }\n array_multisort($host_names, SORT_ASC, $host_data);\n\n foreach ($host_data as $sid => $schedule) {\n if (empty($schedule['childoptions'])) {\n $schedule['childoptions'] = 0;\n }\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? _(\"Yes\") : _(\"No\"); ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"months_of_year\"]) {\n echo $schedule[\"months_of_year\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"childoptions\"] == 0) {\n echo _(\"No\");\n } elseif ($schedule[\"childoptions\"] == 1) {\n echo _(\"Yes, triggered\");\n } elseif ($schedule[\"childoptions\"] == 2) {\n echo _(\"Yes, non-triggered\");\n } ?></td>\n <td class=\"center\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>&nbsp;\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"10\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if host_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end host tab?>\n\n<?php } // end if host or showall\n\nif (!empty($_GET[\"service\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n $service = grab_request_var('service', '');\n\n if ($showall) {\n echo \"<div id='service-tab'>\";\n }\n ?>\n\n <h4><?php echo $service_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Service\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($service_data) {\n $i = 0;\n\n $host_names = array();\n $service_names = array();\n foreach ($service_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n $service_names[$k] = $data['service_description'];\n }\n\n array_multisort($host_names, SORT_ASC, $service_names, SORT_ASC, $service_data);\n\n foreach ($service_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo $schedule[\"service_description\"]; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php'. \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php }?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"9\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host/service recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if service_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end service tab?>\n\n<?php } // end if service or showall\n\nif (!empty($_GET[\"hostgroup\"]) || $showall) {\n\n $hostgroup = grab_request_var('hostgroup', '');\n\n if ($showall) {\n echo \"<div id='hostgroup-tab'>\";\n }\n ?>\n\n <h4><?php echo $hostgroup_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($hostgroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&hostgroup_name=<?php echo $hostgroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this hostgroup\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Hostgroup\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n\n <?php\n\n if ($hostgroup_data) {\n $i = 0;\n\n $hostgroup_names = array();\n foreach ($hostgroup_data as $k => $data) {\n $hostgroup_names[$k] = $data['hostgroup_name'];\n }\n\n array_multisort($hostgroup_names, SORT_ASC, $hostgroup_data);\n\n foreach ($hostgroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"hostgroup_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? \"Yes\" : \"No\"; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n <?php } else { ?>\n <tr>\n <td colspan=\"8\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no hostgroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if hostrgroup_data ?>\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end hostgroup tab?>\n\n<?php } // end if hostgroup or showall\n\nif (!empty($_GET[\"servicegroup\"]) || $showall) {\n\n $servicegroup = grab_request_var('servicegroup', '');\n\n if ($showall) {\n echo \"<div id='servicegroup-tab'>\";\n }\n ?>\n <h4><?php echo $servicegroup_tbl_header; ?></h4>\n <?php\n if (!is_readonly_user(0)) {\n if ($servicegroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&servicegroup_name=<?php echo $servicegroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this servicegroup\"); ?></a>\n </div>\n <?php } else { ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?>\n </a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Servicegroup\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n\n if ($servicegroup_data) {\n $i = 0;\n\n $servicegroup_names = array();\n foreach ($servicegroup_data as $k => $data) {\n $servicegroup_names[$k] = $data['servicegroup_name'];\n }\n\n array_multisort($servicegroup_names, SORT_ASC, $servicegroup_data);\n\n foreach ($servicegroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"servicegroup_name\"]; ?></td>\n <td><?php echo $schedule[\"comment\"]; ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"recurringdowntime.php?mode=edit&sid=<?php echo $sid; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"7\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no servicegroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if servicegroup_data ?>\n\n\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end servicegroup tab?>\n\n <?php } // end if servicegroup or showall ?>\n\n <?php\n if ($showall) { // end of tabs container\n ?>\n </div>\n <?php\n }\n do_page_end(true);\n}", "public function findDowntimes(int $hostId, int $serviceId): array;", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function testSetGet_schedule_where_time_of_day_has_past() {\n\t\t//The blog time is 10 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '+10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$this->config->set_schedule( date( 'D', $blog_time ), date( 'H', $blog_time ) . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Next week in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', strtotime( '+7 days', $blog_time ) ) . ' ' . date( 'H', $blog_time ) . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Next week in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+7 days', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "protected function schedule(Schedule $schedule){\n\n\t\t$schedule->command('CheckChallengeDeadlines:expirations')->dailyAt('04:00')->timezone('America/New_York');\n\t\t$schedule->command('CheckChallengeDeadlines:summaries', [3])->weekly()->mondays()->at('04:30')->timezone('America/New_York');\n\t\t$schedule->command('CheckChallengeDeadlines:summaries', [4])->weekly()->thursdays()->at('04:30')->timezone('America/New_York');\n\n\t}", "public function testSetGet_schedule_where_time_of_day_has_not_past() {\n\t\t//The blog time is 2 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '-10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$day = date( 'H', $blog_time ) + 1;\n\t\tif ( $day < 10 ) {\n\t\t\t$day = \"0$day\";\n\t\t}\n\n\t\t$this->config->set_schedule( date( 'D', $blog_time ), $day . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Today in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', $blog_time ) . ' ' . $day . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Today in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+1 hour', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "function get_schedule($usrid){\r\n\t\r\n}", "public function getBackupSchedule()\n {\n return $this->backup_schedule;\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }", "public function getWeeklySchedule()\n {\n return $this->weekly_schedule;\n }", "public function getWeeklySchedule()\n {\n return $this->weekly_schedule;\n }", "public function findDowntimesByServiceForAdminUser(int $hostId, int $serviceId): array;", "public function getScheduleTime(){return $this->time_of_day;}", "public function testSetGet_schedule_where_time_of_day_has_past_and_no_day_supplied() {\n\t\t//The blog time is -4 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '-10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$this->config->set_schedule( null, date( 'H', $blog_time ) . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Today in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', strtotime( '+1 day', $blog_time ) ) . ' ' . date( 'H', $blog_time ) . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Today in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+1 day', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "protected function schedule(Schedule $schedule)\n {\n // $configuracao = DB::table('configuracao')->first();\n\n // if($configuracao->frequencia == 'Diária')\n // {\n // $schedule->call(function (){\n // Ente::importar();\n // HistoricoDeAcesso::importar();\n // })->dailyAt($configuracao->horario); \n // }\n // else\n // {\n // $schedule->call(function (){\n // Ente::importar();\n // HistoricoDeAcesso::importar();\n // })->weekly()->fridays()->at($configuracao->horario); \n // }\n \n }", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->hourly();\n }", "public function schedule(): Schedule\n {\n return $this->schedule;\n }", "public function findDowntimesByServiceForNonAdminUser(int $hostId, int $serviceId): array;", "public function getWFScheduleTime() {\n\t\tif (isset($this->multipleschtime)) {\n\t\t\t$multipleschtime = explode(',', $this->multipleschtime);\n\t\t\tusort($multipleschtime, function ($time1, $time2) {\n\t\t\t\t$t1 = strtotime($time1);\n\t\t\t\t$t2 = strtotime($time2);\n\t\t\t\treturn $t1 - $t2;\n\t\t\t});\n\t\t\t$currentTrigger = array_search(date('g:i a', strtotime($this->schtime)), $multipleschtime);\n\t\t\tif (!$currentTrigger && $currentTrigger !== 0) {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[0]));\n\t\t\t\t$this->updateSchtime($multipleschtime[0]);\n\t\t\t} elseif (!isset($multipleschtime[$currentTrigger + 1])) {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[count($multipleschtime)-1]));\n\t\t\t\t$this->updateSchtime($nextTiggerTime);\n\t\t\t} else {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[$currentTrigger + 1]));\n\t\t\t\t$this->updateSchtime($nextTiggerTime);\n\t\t\t}\n\t\t\treturn $nextTiggerTime;\n\t\t}\n\t\treturn $this->schtime;\n\t}", "function card_schedule_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('autoBanSubscribeJob')->everyThirtyMinutes();\n $schedule->command('autoBanUserJob')->everyTenMinutes();\n $schedule->command('autoCheckNodeStatusJob')->everyMinute();\n $schedule->command('autoClearLogJob')->everyThirtyMinutes();\n $schedule->command('autoCloseOrderJob')->everyMinute();\n $schedule->command('autoDecGoodsTrafficJob')->everyTenMinutes();\n $schedule->command('autoDisableExpireUserJob')->everyMinute();\n $schedule->command('autoDisableUserJob')->everyMinute();\n $schedule->command('autoExpireCouponJob')->everyThirtyMinutes();\n $schedule->command('autoExpireInviteJob')->everyThirtyMinutes();\n $schedule->command('autoReleasePortJob')->everyMinute();\n $schedule->command('autoReopenUserJob')->everyMinute();\n $schedule->command('autoResetUserTrafficJob')->everyFiveMinutes();\n $schedule->command('autoStatisticsNodeDailyTrafficJob')->dailyAt('04:30');\n $schedule->command('autoStatisticsNodeHourlyTrafficJob')->hourly();\n $schedule->command('autoStatisticsUserDailyTrafficJob')->dailyAt('03:00');\n $schedule->command('autoStatisticsUserHourlyTrafficJob')->hourly();\n $schedule->command('userExpireWarningJob')->daily();\n $schedule->command('userTrafficWarningJob')->daily();\n $schedule->command('autoStatisticsNodeHourlyTestJob')->hourlyAt(10);\n// $schedule->command('autoStatisticsNodeHourlyTestJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpJob')->dailyAt('00:00');\n// $schedule->command('autoMysqlBackUpJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpRemoteJob')->dailyAt('00:30');\n $schedule->command('cPJob')->everyMinute();\n $schedule->command('deleteAuthJob')->everyMinute();\n $schedule->command('pushJob')->dailyAt('13:37');\n $schedule->command('telegramJob')->everyMinute();\n $schedule->command('autoCountNodeFlow')->everyMinute();\n\n\n\n }", "public function findDowntimesForAdminUser(): array;" ]
[ "0.6441508", "0.5780437", "0.5704298", "0.55298406", "0.5511373", "0.53337395", "0.5330446", "0.5330446", "0.5286463", "0.52236176", "0.52180034", "0.51969993", "0.51543605", "0.51543605", "0.502302", "0.5002092", "0.49786305", "0.4949699", "0.4949699", "0.49372575", "0.49258074", "0.48882324", "0.48824474", "0.48610678", "0.48523596", "0.4836941", "0.4828622", "0.48160744", "0.4801189", "0.47990522" ]
0.5986708
1
Get downtime schedule for specified hostgroup
function recurringdowntime_get_hostgroup_cfg($hostgroup = false) { $cfg = recurringdowntime_get_cfg(); $ret = array(); foreach ($cfg as $sid => $schedule) { if (array_key_exists('schedule_type', $schedule)) { if ($schedule["schedule_type"] != "hostgroup") { continue; } } if ($hostgroup && !(strtolower($schedule["hostgroup_name"]) == strtolower($hostgroup))) { continue; } if (array_key_exists('hostgroup_name', $schedule)) { if (is_authorized_for_hostgroup(0, $schedule["hostgroup_name"])) { $ret[$sid] = $schedule; } } } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurringdowntime_get_host_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"service\") {\n continue;\n }\n }\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n if (array_key_exists('host_name', $schedule)) {\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_get_servicegroup_cfg($servicegroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"servicegroup\") {\n continue;\n }\n }\n if ($servicegroup && !(strtolower($schedule[\"servicegroup_name\"]) == strtolower($servicegroup))) {\n continue;\n }\n if (array_key_exists('servicegroup_name', $schedule)) {\n if (is_authorized_for_servicegroup(0, $schedule[\"servicegroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_get_service_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"host\") {\n continue;\n }\n }\n\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n\n if (array_key_exists('host_name', $schedule)) {\n if (array_key_exists('service_description', $schedule)) {\n if ($schedule[\"service_description\"] != '*') {\n $search_str = $schedule[\"service_description\"];\n\n if (strstr($schedule[\"service_description\"], \"*\")) {\n $search_str = \"lk:\" . str_replace(\"*\", \"%\", $schedule[\"service_description\"]);\n }\n if (!is_authorized_for_service(0, $schedule[\"host_name\"], $search_str)) {\n continue;\n }\n }\n }\n\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_show_downtime()\n{\n global $request;\n\n do_page_start(array(\"page_title\" => _(\"Recurring Downtime\")), true);\n\n if (isset($request[\"host\"])) {\n $host_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n $service_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n if (is_authorized_for_host(0, $request[\"host\"])) {\n $host_data = recurringdowntime_get_host_cfg($request[\"host\"]);\n $service_data = recurringdowntime_get_service_cfg($request[\"host\"]);\n }\n } elseif (isset($request[\"hostgroup\"])) {\n $hostgroup_tbl_header = _(\"Recurring Downtime for Hostgroup: \") . $request[\"hostgroup\"];\n if (is_authorized_for_hostgroup(0, $request[\"hostgroup\"])) {\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($request[\"hostgroup\"]);\n }\n } elseif (isset($request[\"servicegroup\"])) {\n $servicegroup_tbl_header = _(\"Recurring Downtime for Servicegroup: \") . $request[\"servicegroup\"];\n if (is_authorized_for_servicegroup(0, $request[\"servicegroup\"])) {\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($request[\"servicegroup\"]);\n }\n }\n\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n /*\n $host_tbl_header = \"Recurring Downtime for All Hosts\";\n $hostgroup_tbl_header = \"Recurring Downtime for All Hostgroups\";\n $servicegroup_tbl_header = \"Recurring Downtime for All Servicegroups\";\n */\n $host_tbl_header = _(\"Host Schedules\");\n $service_tbl_header = _(\"Service Schedules\");\n $hostgroup_tbl_header = _(\"Hostgroup Schedules\");\n $servicegroup_tbl_header = _(\"Servicegroup Schedules\");\n $host_data = recurringdowntime_get_host_cfg($host = false);\n $service_data = recurringdowntime_get_service_cfg($host = false);\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($hostgroup = false);\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($servicegroup = false);\n $showall = true;\n }\n\n ?>\n <h1><?php echo _(\"Recurring Downtime\"); ?></h1>\n\n <?php echo _(\"Scheduled downtime definitions that are designed to repeat (recur) at set intervals are shown below. The next schedule for each host/service are added to the monitoring engine when the cron runs at the top of the hour.\"); ?>\n\n <?php\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n ?>\n <p>\n <?php } ?>\n\n <script type=\"text/javascript\">\n function do_delete_sid(sid) {\n input = confirm('<?php echo _(\"Are you sure you wish to delete this downtime schedule?\"); ?>');\n if (input == true) {\n window.location.href = 'recurringdowntime.php?mode=delete&sid=' + sid + '&nsp=<?php echo get_nagios_session_protector_id();?>';\n }\n }\n </script>\n\n <?php\n if ($showall) {\n ?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n $(\"#tabs\").tabs().show();\n });\n </script>\n\n <div id=\"tabs\" class=\"hide\">\n <ul>\n <li><a href=\"#host-tab\"><?php echo _(\"Hosts\"); ?></a></li>\n <li><a href=\"#service-tab\"><?php echo _(\"Services\"); ?></a></li>\n <li><a href=\"#hostgroup-tab\"><?php echo _(\"Hostgroups\"); ?></a></li>\n <li><a href=\"#servicegroup-tab\"><?php echo _(\"Servicegroups\"); ?></a></li>\n </ul>\n <?php\n }\n ?>\n\n <?php if (!empty($_GET[\"host\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n\n // hosts tab\n if ($showall) {\n echo \"<div id='host-tab'>\";\n }\n ?>\n\n <h4 <?php if ($host) { echo 'style=\"margin-top: 20px;\"'; } ?>><?php echo $host_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n }\n ?>\n\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Months\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Handle Child Hosts\"); ?></th>\n <th class=\"center\" style=\"width: 80px;\"><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($host_data) {\n $i = 0;\n\n $host_names = array();\n foreach ($host_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n }\n array_multisort($host_names, SORT_ASC, $host_data);\n\n foreach ($host_data as $sid => $schedule) {\n if (empty($schedule['childoptions'])) {\n $schedule['childoptions'] = 0;\n }\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? _(\"Yes\") : _(\"No\"); ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"months_of_year\"]) {\n echo $schedule[\"months_of_year\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"childoptions\"] == 0) {\n echo _(\"No\");\n } elseif ($schedule[\"childoptions\"] == 1) {\n echo _(\"Yes, triggered\");\n } elseif ($schedule[\"childoptions\"] == 2) {\n echo _(\"Yes, non-triggered\");\n } ?></td>\n <td class=\"center\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>&nbsp;\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"10\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if host_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end host tab?>\n\n<?php } // end if host or showall\n\nif (!empty($_GET[\"service\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n $service = grab_request_var('service', '');\n\n if ($showall) {\n echo \"<div id='service-tab'>\";\n }\n ?>\n\n <h4><?php echo $service_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Service\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($service_data) {\n $i = 0;\n\n $host_names = array();\n $service_names = array();\n foreach ($service_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n $service_names[$k] = $data['service_description'];\n }\n\n array_multisort($host_names, SORT_ASC, $service_names, SORT_ASC, $service_data);\n\n foreach ($service_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo $schedule[\"service_description\"]; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php'. \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php }?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"9\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host/service recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if service_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end service tab?>\n\n<?php } // end if service or showall\n\nif (!empty($_GET[\"hostgroup\"]) || $showall) {\n\n $hostgroup = grab_request_var('hostgroup', '');\n\n if ($showall) {\n echo \"<div id='hostgroup-tab'>\";\n }\n ?>\n\n <h4><?php echo $hostgroup_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($hostgroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&hostgroup_name=<?php echo $hostgroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this hostgroup\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Hostgroup\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n\n <?php\n\n if ($hostgroup_data) {\n $i = 0;\n\n $hostgroup_names = array();\n foreach ($hostgroup_data as $k => $data) {\n $hostgroup_names[$k] = $data['hostgroup_name'];\n }\n\n array_multisort($hostgroup_names, SORT_ASC, $hostgroup_data);\n\n foreach ($hostgroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"hostgroup_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? \"Yes\" : \"No\"; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n <?php } else { ?>\n <tr>\n <td colspan=\"8\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no hostgroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if hostrgroup_data ?>\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end hostgroup tab?>\n\n<?php } // end if hostgroup or showall\n\nif (!empty($_GET[\"servicegroup\"]) || $showall) {\n\n $servicegroup = grab_request_var('servicegroup', '');\n\n if ($showall) {\n echo \"<div id='servicegroup-tab'>\";\n }\n ?>\n <h4><?php echo $servicegroup_tbl_header; ?></h4>\n <?php\n if (!is_readonly_user(0)) {\n if ($servicegroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&servicegroup_name=<?php echo $servicegroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this servicegroup\"); ?></a>\n </div>\n <?php } else { ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?>\n </a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Servicegroup\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n\n if ($servicegroup_data) {\n $i = 0;\n\n $servicegroup_names = array();\n foreach ($servicegroup_data as $k => $data) {\n $servicegroup_names[$k] = $data['servicegroup_name'];\n }\n\n array_multisort($servicegroup_names, SORT_ASC, $servicegroup_data);\n\n foreach ($servicegroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"servicegroup_name\"]; ?></td>\n <td><?php echo $schedule[\"comment\"]; ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"recurringdowntime.php?mode=edit&sid=<?php echo $sid; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"7\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no servicegroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if servicegroup_data ?>\n\n\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end servicegroup tab?>\n\n <?php } // end if servicegroup or showall ?>\n\n <?php\n if ($showall) { // end of tabs container\n ?>\n </div>\n <?php\n }\n do_page_end(true);\n}", "public function findHostDowntimesForAdminUser(): array;", "public function findHostDowntimesForNonAdminUser(): array;", "public static function get24HourDivisionIntervals($groupScheduledIntervals)\n {\n foreach ($groupScheduledIntervals as &$scheduledIntervals) {\n foreach ($scheduledIntervals as &$schedulerInterval) {\n $schedulerInterval['start'] = $schedulerInterval['start']->format('H:i');\n $end = clone $schedulerInterval['end'];\n $schedulerInterval['end'] = $end->add(new DateInterval(\"PT1H\"))->format('H:i');\n }\n }\n\n return $groupScheduledIntervals;\n }", "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "public function getTaskGroup() {}", "public function findDowntimes(int $hostId, int $serviceId): array;", "public static function get24ScheduledIntervals($groupedPeriods, $groupFieldName)\n {\n\n $groupScheduledIntervals = array();\n $scheduledIndex = 0;\n foreach ($groupedPeriods as $periods) {\n\n $startPeriod = TimezoneHelper::getDateFromString(reset($periods)->$groupFieldName);\n $endPeriod = clone TimezoneHelper::getDateFromString(end($periods)->$groupFieldName);\n $endPeriod->add(new DateInterval('PT1H'));\n\n $dateRange = new DatePeriod($startPeriod, new DateInterval('PT1H'), $endPeriod);\n $dateRange = iterator_to_array($dateRange);\n $dateRangeCount = count($dateRange);\n\n //init first start day\n for ($dateRangeIndex = 0; $dateRangeIndex < $dateRangeCount; $dateRangeIndex++) {\n $date = $dateRange[$dateRangeIndex];\n// print $dateRangeCount.' = '.$dateRangeIndex.' = '.$scheduledIndex.' == '.$date->format('Y-m-d H:i:s').\"\\n\";\n $formatDate = $date->format('Y-m-d');\n\n //if first element\n if ($dateRangeIndex == 0) {\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['start'] = $date;\n if ($dateRangeCount == 1) {\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['end'] = clone $date;\n $scheduledIndex++;\n }\n } else if ($dateRangeIndex == $dateRangeCount - 1) {\n //if last element\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['end'] = $date;\n $scheduledIndex++;\n }\n\n if (isset($dateRange[$dateRangeIndex + 1]) && $dateRange[$dateRangeIndex + 1]->format('Y-m-d') != $date->format('Y-m-d')) {\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['end'] = $dateRange[$dateRangeIndex];\n $scheduledIndex = 0;\n $startDate = $dateRange[$dateRangeIndex + 1]->format('Y-m-d');\n $groupScheduledIntervals[$startDate][$scheduledIndex]['start'] = $dateRange[$dateRangeIndex + 1];\n }\n }\n }\n\n return $groupScheduledIntervals;\n }", "function has_schedules( $group_id = null ) {\r\n global $bp;\r\n $schedule_ids = null;\r\n $schedules = array();\r\n \r\n if( empty( $group_id ) )\r\n $group_id = $bp->groups->current_group->id;\r\n \r\n $term_id = get_term_by( 'slug', $group_id, 'group_id' );\r\n if( !empty( $term_id ) )\r\n $schedule_ids = get_objects_in_term( $term_id->term_id, 'group_id' );\r\n \r\n if( !empty( $schedule_ids ) )\r\n arsort( $schedule_ids ); // Get latest entries first\r\n else\r\n return null;\r\n \r\n foreach ( $schedule_ids as $sid )\r\n $schedules[] = self::is_schedule( $sid );\r\n \r\n return array_filter( $schedules );\r\n }", "public function findDowntimesForAdminUser(): array;", "function get_schedule($usrid){\r\n\t\r\n}", "public function testSetGet_schedule_where_time_of_day_has_past() {\n\t\t//The blog time is 10 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '+10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$this->config->set_schedule( date( 'D', $blog_time ), date( 'H', $blog_time ) . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Next week in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', strtotime( '+7 days', $blog_time ) ) . ' ' . date( 'H', $blog_time ) . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Next week in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+7 days', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "function timeconditions_timegroups_buildtime( $hour_start, $minute_start, $hour_finish, $minute_finish, $wday_start, $wday_finish, $mday_start, $mday_finish, $month_start, $month_finish) {\n\t//\n\tif ($minute_start == '-') {\n\t\t$time_minute_start = \"00\";\n\t} else {\n\t\t$time_minute_start = sprintf(\"%02d\",$minute_start);\n\t}\n\tif ($minute_finish == '-') {\n\t\t$time_minute_finish = \"00\";\n\t} else {\n\t\t$time_minute_finish = sprintf(\"%02d\",$minute_finish);\n\t}\n\tif ($hour_start == '-') {\n\t\t$time_hour_start = '*';\n\t} else {\n\t\t$time_hour_start = sprintf(\"%02d\",$hour_start) . ':' . $time_minute_start;\n\t}\n\tif ($hour_finish == '-') {\n\t\t$time_hour_finish = '*';\n\t} else {\n\t\t$time_hour_finish = sprintf(\"%02d\",$hour_finish) . ':' . $time_minute_finish;\n\t}\n\tif ($time_hour_start === '*') {\n\t\t$time_hour_start = $time_hour_finish;\n\t}\n\tif ($time_hour_finish === '*') {$time_hour_finish = $time_hour_start;}\n\tif ($time_hour_start == $time_hour_finish) {\n\t\t$time_hour = $time_hour_start;\n\t} else {\n\t\t$time_hour = $time_hour_start . '-' . $time_hour_finish;\n\t}\n\n\t//----- Time Week Day Interval proccess -----\n\t//\n\tif ($wday_start == '-') {\n\t\t$time_wday_start = '*';\n\t} else {\n\t\t$time_wday_start = $wday_start;\n\t}\n\tif ($wday_finish == '-') {\n\t\t$time_wday_finish = '*';\n\t} else {\n\t\t$time_wday_finish = $wday_finish;\n\t}\n\tif ($time_wday_start === '*') {\n\t\t$time_wday_start = $time_wday_finish;\n\t}\n\tif ($time_wday_finish === '*') {\n\t\t$time_wday_finish = $time_wday_start;\n\t}\n\tif ($time_wday_start == $time_wday_finish) {\n\t\t$time_wday = $time_wday_start;\n\t} else {\n\t\t$time_wday = $time_wday_start . '-' . $time_wday_finish;\n\t}\n\n\t//----- Time Month Day Interval proccess -----\n\t//\n\tif ($mday_start == '-') {\n\t\t$time_mday_start = '*';\n\t} else {\n\t\t$time_mday_start = $mday_start;\n\t}\n\tif ($mday_finish == '-') {\n\t\t$time_mday_finish = '*';\n\t} else {\n\t\t$time_mday_finish = $mday_finish;\n\t}\n\tif ($time_mday_start === '*') {\n\t\t$time_mday_start = $time_mday_finish;\n\t}\n\tif ($time_mday_finish === '*') {\n\t\t$time_mday_finish = $time_mday_start;\n\t}\n\tif ($time_mday_start == $time_mday_finish) {\n\t\t$time_mday = $time_mday_start;\n\t} else {\n\t\t$time_mday = $time_mday_start . '-' . $time_mday_finish;\n\t}\n\n\t//----- Time Month Interval proccess -----\n\t//\n\tif ($month_start == '-') {\n\t\t$time_month_start = '*';\n\t} else {\n\t\t$time_month_start = $month_start;\n\t}\n\tif ($month_finish == '-') {\n\t\t$time_month_finish = '*';\n\t} else {\n\t\t$time_month_finish = $month_finish;\n\t}\n\tif ($time_month_start === '*') {\n\t\t$time_month_start = $time_month_finish;\n\t}\n\tif ($time_month_finish === '*') {\n\t\t$time_month_finish = $time_month_start;\n\t}\n\tif ($time_month_start == $time_month_finish) {\n\t\t$time_month = $time_month_start;\n\t} else {\n\t\t$time_month = $time_month_start . '-' . $time_month_finish;\n\t}\n\t$time = $time_hour . '|' . $time_wday . '|' . $time_mday . '|' . $time_month;\n\treturn $time;\n}", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function findDowntimesByServiceForAdminUser(int $hostId, int $serviceId): array;", "function nth_weekly_schedule($action,$id,$start,$end,$day,$non_workdays,$nth_value=1)\n {\n $params = array($start,$end,$day);\n $results = array();\n $this->_where = $this->_where.' AND `cal_day_of_week` = ?';\n switch ($non_workdays){\n case 1:\n $sched_date = 'next_work_day';\n break;\n case 2:\n $sched_date = 'prev_work_day';\n break;\n case 0:\n $sched_date = 'cal_date';\n $this->_where = $this->_where.' AND `cal_is_weekday` = ?';\n array_push($params,1);\n break;\n }\n $sql = 'SELECT `cal_date` AS `report_date`, '.$sched_date.' AS `sched_date`,`cal_is_work_day` FROM `calendar__bank_holiday_offsets` ';\n $sql = $sql.$this->_where;\n \n $query = $this->_db->query($sql,$params);\n //echo $nth_value;\n \n if($query->count()){\n $results = $query->results();\n $results = ($nth_value > 1 || $non_workdays == 0 ? $this->nth_date($results,$nth_value):$results);\n if($action == 'preview') {\n return $results;\n } else if ($action == 'commit') {\n $this->commit_schedule($results,$id);\n }\n }\n }", "public function findDowntimesForNonAdminUser(): array;", "function timeconditions_timegroups_get_group($timegroup) {\n\tglobal $db;\n\n\t$sql = \"select id, description from timegroups_groups where id = $timegroup\";\n\t$results = $db->getAll($sql);\n\tif(DB::IsError($results)) {\n \t\t$results = null;\n\t}\n\t$tmparray = array($results[0][0], $results[0][1]);\n\treturn $tmparray;\n}", "public function findDowntimesByServiceForNonAdminUser(int $hostId, int $serviceId): array;", "function retrieve_day_guest_lists($weekday){\n\t\t\n\t\t\n\t\t//Do any given operation for a specific weekday...\n\t\tswitch($weekday){\n\t\t\tcase 'mondays':\n\t\t\t\tbreak;\n\t\t\tcase 'tuesdays':\n\t\t\t\tbreak;\n\t\t\tcase 'wednesdays':\n\t\t\t\tbreak;\n\t\t\tcase 'thursdays':\n\t\t\t\tbreak;\n\t\t\tcase 'fridays':\n\t\t\t\tbreak;\n\t\t\tcase 'saturdays':\n\t\t\t\tbreak;\n\t\t\tcase 'sundays':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tshow_404('Invalid url');\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->CI->load->model('model_guest_lists', 'guest_lists', true);\n\t\treturn $this->CI->guest_lists->retrieve_day_guest_lists($this->promoter->up_id, $weekday, $this->promoter->t_fan_page_id);\n\t\t\n\t}", "public static function getSchedulePattern(): string;", "public function testSetGet_schedule_where_time_of_day_has_not_past() {\n\t\t//The blog time is 2 hours from now\n\t\t$blog_time = strtotime( date( 'Y-m-d H:00:00', strtotime( '-10 hours' ) ) );\n\t\t$this->setBlogTime( date( 'Y-m-d H:i:s ', $blog_time ) );\n\n\t\t$day = date( 'H', $blog_time ) + 1;\n\t\tif ( $day < 10 ) {\n\t\t\t$day = \"0$day\";\n\t\t}\n\n\t\t$this->config->set_schedule( date( 'D', $blog_time ), $day . ':00', 'daily' );\n\t\t$schedule = $this->config->get_schedule();\n\n\t\t//Today in the blog time time is expected\n\t\t$expected_date_time = date( 'Y-m-d', $blog_time ) . ' ' . $day . ':00:00';\n\t\t$this->assertEquals( $expected_date_time, date( 'Y-m-d H:i:s', $schedule[0] ) );\n\t\t$this->assertEquals( 'daily', $schedule[1] );\n\n\t\t//Today in the server time is expected\n\t\t$schedule = wp_next_scheduled( 'execute_periodic_drobox_backup' );\n\t\t$this->assertEquals( strtotime( '+1 hour', strtotime( date( 'Y-m-d H:00:00' ) ) ), $schedule );\n\t}", "function block_ranking_get_points_evolution_by_group($groupid) {\n global $DB;\n\n $sql = \"SELECT\n rl.id, rl.points, rl.timecreated\n FROM {ranking_logs} rl\n INNER JOIN {ranking_points} rp ON rp.id = rl.rankingid\n INNER JOIN {groups_members} gm ON gm.userid = rp.userid\n INNER JOIN {groups} g ON g.id = gm.groupid\n WHERE g.id = :groupid AND rl.timecreated > :lastweek\";\n\n $lastweek = time() - (7 * 24 * 60 * 60);\n\n $params['groupid'] = $groupid;\n $params['lastweek'] = $lastweek;\n\n return array_values($DB->get_records_sql($sql, $params));\n}", "public function findDowntimesByHostForAdminUser(int $hostId, bool $withServices): array;", "public function getBackupSchedule()\n {\n return $this->backup_schedule;\n }", "function getScheduledTasks ( $notification )\n\t{\n\t\t$maxHourOffset = 0;\n\t\t$sites = Piwik_SitesManager_API::getInstance()->getSitesWithAtLeastViewAccess();\n\t\t$baseDate = Piwik_Date::factory(\"1971-01-01\");\n\t\tforeach($sites as &$site)\n\t\t{\n\t\t\t$offsetDate = Piwik_Date::factory($baseDate, $site['timezone']);\n\n\t\t\t// Earlier means a negative timezone\n\t\t\tif ( $offsetDate->isEarlier($baseDate) )\n\t\t\t{\n\t\t\t\t// Gets the timezone offset\n\t\t\t\t$hourOffset = (24 - date ('H', $offsetDate->getTimestamp()));\n\n\t\t\t\tif ( $hourOffset > $maxHourOffset )\n\t\t\t\t{\n\t\t\t\t\t$maxHourOffset = $hourOffset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tasks = &$notification->getNotificationObject();\n\n\t\t$dailySchedule = new Piwik_ScheduledTime_Daily();\n\t\t$dailySchedule->setHour($maxHourOffset);\n\t\t$tasks[] = new Piwik_ScheduledTask ( $this, 'dailySchedule', $dailySchedule );\n\n\t\t$weeklySchedule = new Piwik_ScheduledTime_Weekly();\n\t\t$weeklySchedule->setHour($maxHourOffset);\n\t\t$tasks[] = new Piwik_ScheduledTask ( $this, 'weeklySchedule', $weeklySchedule );\n\n\t\t$monthlySchedule = new Piwik_ScheduledTime_Monthly();\n\t\t$monthlySchedule->setHour($maxHourOffset);\n\t\t$tasks[] = new Piwik_ScheduledTask ( $this, 'monthlySchedule', $monthlySchedule );\n\t}" ]
[ "0.5926294", "0.57772595", "0.5629028", "0.5561237", "0.5469031", "0.5372213", "0.53004146", "0.5245684", "0.5170883", "0.5101887", "0.49500608", "0.4927373", "0.4859486", "0.4842459", "0.4835791", "0.48098764", "0.47947094", "0.47947094", "0.4790069", "0.47781736", "0.47557384", "0.47427857", "0.47409266", "0.47135225", "0.4680135", "0.4635542", "0.4626696", "0.46069995", "0.4577087", "0.45739117" ]
0.6838731
0
Get downtime schedule for specified servicegroup
function recurringdowntime_get_servicegroup_cfg($servicegroup = false) { $cfg = recurringdowntime_get_cfg(); $ret = array(); foreach ($cfg as $sid => $schedule) { if (array_key_exists('schedule_type', $schedule)) { if ($schedule["schedule_type"] != "servicegroup") { continue; } } if ($servicegroup && !(strtolower($schedule["servicegroup_name"]) == strtolower($servicegroup))) { continue; } if (array_key_exists('servicegroup_name', $schedule)) { if (is_authorized_for_servicegroup(0, $schedule["servicegroup_name"])) { $ret[$sid] = $schedule; } } } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurringdowntime_get_hostgroup_cfg($hostgroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"hostgroup\") {\n continue;\n }\n }\n if ($hostgroup && !(strtolower($schedule[\"hostgroup_name\"]) == strtolower($hostgroup))) {\n continue;\n }\n if (array_key_exists('hostgroup_name', $schedule)) {\n if (is_authorized_for_hostgroup(0, $schedule[\"hostgroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_get_service_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"host\") {\n continue;\n }\n }\n\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n\n if (array_key_exists('host_name', $schedule)) {\n if (array_key_exists('service_description', $schedule)) {\n if ($schedule[\"service_description\"] != '*') {\n $search_str = $schedule[\"service_description\"];\n\n if (strstr($schedule[\"service_description\"], \"*\")) {\n $search_str = \"lk:\" . str_replace(\"*\", \"%\", $schedule[\"service_description\"]);\n }\n if (!is_authorized_for_service(0, $schedule[\"host_name\"], $search_str)) {\n continue;\n }\n }\n }\n\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function recurringdowntime_show_downtime()\n{\n global $request;\n\n do_page_start(array(\"page_title\" => _(\"Recurring Downtime\")), true);\n\n if (isset($request[\"host\"])) {\n $host_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n $service_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n if (is_authorized_for_host(0, $request[\"host\"])) {\n $host_data = recurringdowntime_get_host_cfg($request[\"host\"]);\n $service_data = recurringdowntime_get_service_cfg($request[\"host\"]);\n }\n } elseif (isset($request[\"hostgroup\"])) {\n $hostgroup_tbl_header = _(\"Recurring Downtime for Hostgroup: \") . $request[\"hostgroup\"];\n if (is_authorized_for_hostgroup(0, $request[\"hostgroup\"])) {\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($request[\"hostgroup\"]);\n }\n } elseif (isset($request[\"servicegroup\"])) {\n $servicegroup_tbl_header = _(\"Recurring Downtime for Servicegroup: \") . $request[\"servicegroup\"];\n if (is_authorized_for_servicegroup(0, $request[\"servicegroup\"])) {\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($request[\"servicegroup\"]);\n }\n }\n\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n /*\n $host_tbl_header = \"Recurring Downtime for All Hosts\";\n $hostgroup_tbl_header = \"Recurring Downtime for All Hostgroups\";\n $servicegroup_tbl_header = \"Recurring Downtime for All Servicegroups\";\n */\n $host_tbl_header = _(\"Host Schedules\");\n $service_tbl_header = _(\"Service Schedules\");\n $hostgroup_tbl_header = _(\"Hostgroup Schedules\");\n $servicegroup_tbl_header = _(\"Servicegroup Schedules\");\n $host_data = recurringdowntime_get_host_cfg($host = false);\n $service_data = recurringdowntime_get_service_cfg($host = false);\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($hostgroup = false);\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($servicegroup = false);\n $showall = true;\n }\n\n ?>\n <h1><?php echo _(\"Recurring Downtime\"); ?></h1>\n\n <?php echo _(\"Scheduled downtime definitions that are designed to repeat (recur) at set intervals are shown below. The next schedule for each host/service are added to the monitoring engine when the cron runs at the top of the hour.\"); ?>\n\n <?php\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n ?>\n <p>\n <?php } ?>\n\n <script type=\"text/javascript\">\n function do_delete_sid(sid) {\n input = confirm('<?php echo _(\"Are you sure you wish to delete this downtime schedule?\"); ?>');\n if (input == true) {\n window.location.href = 'recurringdowntime.php?mode=delete&sid=' + sid + '&nsp=<?php echo get_nagios_session_protector_id();?>';\n }\n }\n </script>\n\n <?php\n if ($showall) {\n ?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n $(\"#tabs\").tabs().show();\n });\n </script>\n\n <div id=\"tabs\" class=\"hide\">\n <ul>\n <li><a href=\"#host-tab\"><?php echo _(\"Hosts\"); ?></a></li>\n <li><a href=\"#service-tab\"><?php echo _(\"Services\"); ?></a></li>\n <li><a href=\"#hostgroup-tab\"><?php echo _(\"Hostgroups\"); ?></a></li>\n <li><a href=\"#servicegroup-tab\"><?php echo _(\"Servicegroups\"); ?></a></li>\n </ul>\n <?php\n }\n ?>\n\n <?php if (!empty($_GET[\"host\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n\n // hosts tab\n if ($showall) {\n echo \"<div id='host-tab'>\";\n }\n ?>\n\n <h4 <?php if ($host) { echo 'style=\"margin-top: 20px;\"'; } ?>><?php echo $host_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n }\n ?>\n\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Months\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Handle Child Hosts\"); ?></th>\n <th class=\"center\" style=\"width: 80px;\"><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($host_data) {\n $i = 0;\n\n $host_names = array();\n foreach ($host_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n }\n array_multisort($host_names, SORT_ASC, $host_data);\n\n foreach ($host_data as $sid => $schedule) {\n if (empty($schedule['childoptions'])) {\n $schedule['childoptions'] = 0;\n }\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? _(\"Yes\") : _(\"No\"); ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"months_of_year\"]) {\n echo $schedule[\"months_of_year\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"childoptions\"] == 0) {\n echo _(\"No\");\n } elseif ($schedule[\"childoptions\"] == 1) {\n echo _(\"Yes, triggered\");\n } elseif ($schedule[\"childoptions\"] == 2) {\n echo _(\"Yes, non-triggered\");\n } ?></td>\n <td class=\"center\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>&nbsp;\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"10\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if host_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end host tab?>\n\n<?php } // end if host or showall\n\nif (!empty($_GET[\"service\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n $service = grab_request_var('service', '');\n\n if ($showall) {\n echo \"<div id='service-tab'>\";\n }\n ?>\n\n <h4><?php echo $service_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Service\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($service_data) {\n $i = 0;\n\n $host_names = array();\n $service_names = array();\n foreach ($service_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n $service_names[$k] = $data['service_description'];\n }\n\n array_multisort($host_names, SORT_ASC, $service_names, SORT_ASC, $service_data);\n\n foreach ($service_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo $schedule[\"service_description\"]; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php'. \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php }?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"9\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host/service recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if service_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end service tab?>\n\n<?php } // end if service or showall\n\nif (!empty($_GET[\"hostgroup\"]) || $showall) {\n\n $hostgroup = grab_request_var('hostgroup', '');\n\n if ($showall) {\n echo \"<div id='hostgroup-tab'>\";\n }\n ?>\n\n <h4><?php echo $hostgroup_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($hostgroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&hostgroup_name=<?php echo $hostgroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this hostgroup\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Hostgroup\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n\n <?php\n\n if ($hostgroup_data) {\n $i = 0;\n\n $hostgroup_names = array();\n foreach ($hostgroup_data as $k => $data) {\n $hostgroup_names[$k] = $data['hostgroup_name'];\n }\n\n array_multisort($hostgroup_names, SORT_ASC, $hostgroup_data);\n\n foreach ($hostgroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"hostgroup_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? \"Yes\" : \"No\"; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n <?php } else { ?>\n <tr>\n <td colspan=\"8\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no hostgroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if hostrgroup_data ?>\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end hostgroup tab?>\n\n<?php } // end if hostgroup or showall\n\nif (!empty($_GET[\"servicegroup\"]) || $showall) {\n\n $servicegroup = grab_request_var('servicegroup', '');\n\n if ($showall) {\n echo \"<div id='servicegroup-tab'>\";\n }\n ?>\n <h4><?php echo $servicegroup_tbl_header; ?></h4>\n <?php\n if (!is_readonly_user(0)) {\n if ($servicegroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&servicegroup_name=<?php echo $servicegroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this servicegroup\"); ?></a>\n </div>\n <?php } else { ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?>\n </a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Servicegroup\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n\n if ($servicegroup_data) {\n $i = 0;\n\n $servicegroup_names = array();\n foreach ($servicegroup_data as $k => $data) {\n $servicegroup_names[$k] = $data['servicegroup_name'];\n }\n\n array_multisort($servicegroup_names, SORT_ASC, $servicegroup_data);\n\n foreach ($servicegroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"servicegroup_name\"]; ?></td>\n <td><?php echo $schedule[\"comment\"]; ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"recurringdowntime.php?mode=edit&sid=<?php echo $sid; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"7\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no servicegroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if servicegroup_data ?>\n\n\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end servicegroup tab?>\n\n <?php } // end if servicegroup or showall ?>\n\n <?php\n if ($showall) { // end of tabs container\n ?>\n </div>\n <?php\n }\n do_page_end(true);\n}", "function has_schedules( $group_id = null ) {\r\n global $bp;\r\n $schedule_ids = null;\r\n $schedules = array();\r\n \r\n if( empty( $group_id ) )\r\n $group_id = $bp->groups->current_group->id;\r\n \r\n $term_id = get_term_by( 'slug', $group_id, 'group_id' );\r\n if( !empty( $term_id ) )\r\n $schedule_ids = get_objects_in_term( $term_id->term_id, 'group_id' );\r\n \r\n if( !empty( $schedule_ids ) )\r\n arsort( $schedule_ids ); // Get latest entries first\r\n else\r\n return null;\r\n \r\n foreach ( $schedule_ids as $sid )\r\n $schedules[] = self::is_schedule( $sid );\r\n \r\n return array_filter( $schedules );\r\n }", "public function findDowntimes(int $hostId, int $serviceId): array;", "public function findDowntimesByServiceForNonAdminUser(int $hostId, int $serviceId): array;", "public function getTaskGroup() {}", "public function findDowntimesByServiceForAdminUser(int $hostId, int $serviceId): array;", "function get_schedule($usrid){\r\n\t\r\n}", "public function findServicesDowntimesForAdminUser(): array;", "public function findServicesDowntimesForNonAdminUser(): array;", "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "private function retrieveSchedule($team_id, $start_date, $end_date)\n {\n if (isset($team_id, $start_date, $end_date)) {\n try {\n $start_date = new Carbon($start_date);\n $end_date = new Carbon($end_date);\n $schedule = \\Roster::where('date_start', '=', $start_date->toDateString())->where('team_id', '=', $team_id)->first();\n if (!isset($schedule)) {\n $schedule = new \\Roster;\n $schedule->team_id = $team_id;\n $schedule->date_start = $start_date->toDateString();\n $schedule->date_ending = $end_date->toDateString();\n $schedule->roster_stage = 'pending';\n $schedule->save();\n }\n $schedule = \\Roster::where('date_start', '=', $start_date->toDateString())->where('team_id', '=', $team_id)\n ->with('rosteredshift.task')->with(array('team.user' => function ($query) use ($start_date, $end_date) {\n $query->where('user.active', '=', true)\n ->with(array('availspecific' => function ($query) use ($start_date, $end_date) {\n $query->where(function ($query) use ($start_date, $end_date) {\n $query->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '<=', $start_date->toDateString())\n ->where('end_date', '>=', $start_date->toDateString());\n })->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '>=', $start_date->toDateString())\n ->where('start_date', '<=', $end_date->toDateString());\n })->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '<=', $start_date->toDateString())\n ->where('end_date', '>=', $end_date->toDateString());\n })->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '>=', $start_date->toDateString())\n ->where('end_date', '<=', $end_date->toDateString());\n });\n })\n ->where('user_avail_spec.authorized', '=', 'approved');\n }))\n ->with('availgeneral');\n }))->first();\n } catch (\\Exception $e) {\n return Helper::jsonLoader(EXCEPTION, array(\"message\" => $e->getMessage(), \"line\" => $e->getLine(), \"file\" => $e->getFile()));\n }\n foreach ($schedule->rosteredshift as $key => $shift) {\n if ($shift->rostered_start_time !== '0000-00-00 00:00:00') {\n $temp = Carbon::parse($shift->rostered_start_time)->timezone(Helper::organisationTimezone())->toDateTimeString();\n $schedule->rosteredshift[$key]->rostered_start_time = $temp;\n }\n if ($shift->rostered_end_time !== '0000-00-00 00:00:00') {\n $temp = Carbon::parse($shift->rostered_end_time)->timezone(Helper::organisationTimezone())->toDateTimeString();\n $schedule->rosteredshift[$key]->rostered_end_time = $temp;\n }\n }\n $schedule = $schedule->toArray();\n $schedule['timezone'] = Carbon::now(Helper::organisationTimezone())->offset / 60;\n return $schedule;\n } else {\n return Helper::jsonLoader(INCORRECT_DATA);\n }\n }", "function recurringdowntime_get_host_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"service\") {\n continue;\n }\n }\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n if (array_key_exists('host_name', $schedule)) {\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "public static function get24HourDivisionIntervals($groupScheduledIntervals)\n {\n foreach ($groupScheduledIntervals as &$scheduledIntervals) {\n foreach ($scheduledIntervals as &$schedulerInterval) {\n $schedulerInterval['start'] = $schedulerInterval['start']->format('H:i');\n $end = clone $schedulerInterval['end'];\n $schedulerInterval['end'] = $end->add(new DateInterval(\"PT1H\"))->format('H:i');\n }\n }\n\n return $groupScheduledIntervals;\n }", "public function getManualDateStop() {}", "public static function get24ScheduledIntervals($groupedPeriods, $groupFieldName)\n {\n\n $groupScheduledIntervals = array();\n $scheduledIndex = 0;\n foreach ($groupedPeriods as $periods) {\n\n $startPeriod = TimezoneHelper::getDateFromString(reset($periods)->$groupFieldName);\n $endPeriod = clone TimezoneHelper::getDateFromString(end($periods)->$groupFieldName);\n $endPeriod->add(new DateInterval('PT1H'));\n\n $dateRange = new DatePeriod($startPeriod, new DateInterval('PT1H'), $endPeriod);\n $dateRange = iterator_to_array($dateRange);\n $dateRangeCount = count($dateRange);\n\n //init first start day\n for ($dateRangeIndex = 0; $dateRangeIndex < $dateRangeCount; $dateRangeIndex++) {\n $date = $dateRange[$dateRangeIndex];\n// print $dateRangeCount.' = '.$dateRangeIndex.' = '.$scheduledIndex.' == '.$date->format('Y-m-d H:i:s').\"\\n\";\n $formatDate = $date->format('Y-m-d');\n\n //if first element\n if ($dateRangeIndex == 0) {\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['start'] = $date;\n if ($dateRangeCount == 1) {\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['end'] = clone $date;\n $scheduledIndex++;\n }\n } else if ($dateRangeIndex == $dateRangeCount - 1) {\n //if last element\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['end'] = $date;\n $scheduledIndex++;\n }\n\n if (isset($dateRange[$dateRangeIndex + 1]) && $dateRange[$dateRangeIndex + 1]->format('Y-m-d') != $date->format('Y-m-d')) {\n $groupScheduledIntervals[$formatDate][$scheduledIndex]['end'] = $dateRange[$dateRangeIndex];\n $scheduledIndex = 0;\n $startDate = $dateRange[$dateRangeIndex + 1]->format('Y-m-d');\n $groupScheduledIntervals[$startDate][$scheduledIndex]['start'] = $dateRange[$dateRangeIndex + 1];\n }\n }\n }\n\n return $groupScheduledIntervals;\n }", "public static function service_schedule_interval($version_id , $service_schedule_id , $lang){\n\t\t$api_param = $version_id.\"/\".$service_schedule_id.\"/\".$lang; \n\t\t$url = \"services_interval/\".$api_param;\n\t\t$database_response = Kromeda::get_response_api($url);\n\t\t if($database_response == FALSE){\n\t\t\t $sess_key = sHelper::generate_kromeda_session_key();\n\t\t\t $third_party_response = sHelper::Get_kromeda_Request($sess_key , 'SMR_GetIntervals' , false , $api_param);\n\t\t\t $add_response = Kromeda::add_response($url , $third_party_response , \"SMR_GetIntervals\");\n\t\t\t if($add_response){\n\t\t\t\t $database_response = Kromeda::get_response_api($url);\n\t\t\t\t}\n\t\t\t }\n\t\t return self::smr_response($database_response);\t \n\t}", "public function getStationsWithSchedules();", "public function getServices() {\n $services = Service::active()->get()->toArray();\n $outputArray = array();\n if ($services) {\n foreach ($services as $key => $value) {\n $begin = new DateTime($value['start_date']);\n $end = new DateTime($value['end_date']);\n if ($value['service_type'] == 'daily') {\n\n $interval = DateInterval::createFromDateString('1 day');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"#605ca8\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n if ($value['service_type'] == 'weekly') {\n\n $schedule = Schedule::where('service_id', $value['id'])->get()->toArray();\n\n $weekNumber = array();\n for ($i = 0; $i < count($schedule); $i++) {\n $weekNumber[] = $schedule[$i]['week_number'];\n }\n\n $interval = DateInterval::createFromDateString('1 day');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n if (in_array($dt->format(\"w\"), $weekNumber)) {\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"#f012be\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n }\n\n if ($value['service_type'] == 'monthly') {\n $interval = DateInterval::createFromDateString('1 month');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"#00a65a\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n\n if ($value['service_type'] == 'yearly') {\n $interval = DateInterval::createFromDateString('1 year');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"orange\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n }\n }\n// echo \"<pre>\";\n// print_r($outputArray);\n// echo \"</pre>\";\n echo json_encode($outputArray);\n }", "public function findDowntimesForAdminUser(): array;", "public static function getSchedulePattern(): string;", "function getSportsDays($params = array()){\r\n $seasonID = trim($this->seasonInfo['id']);\r\n if(!$seasonID) {\r\n $this->errorMessage[] = 'SeasonID is not specified';\r\n return array();\r\n }\r\n $leagueID = trim($this->seasonInfo['league_id']);\r\n if(!$leagueID) {\r\n $this->errorMessage[] = 'leagueID is not specified';\r\n return array();\r\n }\r\n if(!is_array($params)) $params = array();\r\n // $this->dbInstance()->queryParams['fields'] = '*';\r\n $this->dbInstance()->queryParams['table'] = 'league_season_sportsday';\r\n\r\n\r\n if(isset($params['scheduledAfter']) && intval($params['scheduledAfter'])){\r\n $scheduledAfter = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` > \".intval($params['scheduledAfter']).\")\";\r\n }\r\n if(isset($params['scheduledBefore']) && intval($params['scheduledBefore'])){\r\n $scheduledBefore = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` < \".intval($params['scheduledBefore']).\")\";\r\n }\r\n $this->dbInstance()->queryParams['where'] = \"\r\n `league_id` = :leagueID && \r\n `season_id` = :seasonID \" . \r\n $scheduledAfter . \r\n $scheduledBefore;\r\n\r\n $this->dbInstance()->queryParams['params'] = array(\r\n 'leagueID' => $leagueID,\r\n 'seasonID' => $seasonID\r\n );\r\n \r\n $this->dbInstance()->queryParams['order'] = $this->dbInstance()->calcORDERcondition($params, 'sort', 'DESC');\r\n \r\n // $offset = ($page - 1) * $limit;\r\n $this->dbInstance()->queryParams['limit'] = $this->dbInstance()->calcLIMITcondition($params);\r\n $result = $this->dbInstance()->select();\r\n\r\n if(isset($params['extend'])){\r\n if(!is_array($params['extend'])) $params['extend'] = array($params['extend']);\r\n if(in_array('games', $params['extend'])){\r\n foreach ($result as $key => $value) {\r\n $result[$key]['games'] = $this->getSportsDayGames(\r\n $result[$key]['id'], \r\n array(\r\n 'scheduledAfter'=>$params['scheduledAfter'],\r\n 'scheduledBefore'=>$params['scheduledBefore']\r\n )\r\n );\r\n }\r\n }\r\n }\r\n\r\n return $result;\r\n }", "function nth_weekly_schedule($action,$id,$start,$end,$day,$non_workdays,$nth_value=1)\n {\n $params = array($start,$end,$day);\n $results = array();\n $this->_where = $this->_where.' AND `cal_day_of_week` = ?';\n switch ($non_workdays){\n case 1:\n $sched_date = 'next_work_day';\n break;\n case 2:\n $sched_date = 'prev_work_day';\n break;\n case 0:\n $sched_date = 'cal_date';\n $this->_where = $this->_where.' AND `cal_is_weekday` = ?';\n array_push($params,1);\n break;\n }\n $sql = 'SELECT `cal_date` AS `report_date`, '.$sched_date.' AS `sched_date`,`cal_is_work_day` FROM `calendar__bank_holiday_offsets` ';\n $sql = $sql.$this->_where;\n \n $query = $this->_db->query($sql,$params);\n //echo $nth_value;\n \n if($query->count()){\n $results = $query->results();\n $results = ($nth_value > 1 || $non_workdays == 0 ? $this->nth_date($results,$nth_value):$results);\n if($action == 'preview') {\n return $results;\n } else if ($action == 'commit') {\n $this->commit_schedule($results,$id);\n }\n }\n }", "public function findDowntimesForNonAdminUser(): array;", "function eo_schedule_end($format='d-m-Y',$id=''){\n\techo eo_get_schedule_end($format,$id);\n}", "function get_scheduled_days() {\n\t\treturn Clean::ids( $this->get_option( 'scheduled_day' ) );\n\t}", "public static function get($group);" ]
[ "0.58345044", "0.5736114", "0.53156585", "0.5276781", "0.52673954", "0.51724213", "0.516231", "0.5149847", "0.51063615", "0.5032685", "0.50106406", "0.4944303", "0.4937936", "0.4937936", "0.49121478", "0.48890203", "0.4878822", "0.48649114", "0.4848549", "0.48189926", "0.47774595", "0.4765342", "0.47357452", "0.47152668", "0.46744213", "0.4672752", "0.46719733", "0.46698928", "0.46468604", "0.4635773" ]
0.68916076
0
'gender' is required but not primary key; has a default
public function testFieldIsRequiredAndHasDefault() { $tableName = 'ramp_enumTesting'; $table = new Application_Model_DbTable_Table($tableName); $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA); $whichField = 'gender'; $field = new Application_Model_Field($whichField, array(), $metaInfo[$whichField]); $this->assertTrue($field->isInTable()); $this->assertTrue($field->isInDB()); $this->assertTrue($field->isRequired()); $this->assertFalse($field->isPrimaryKey()); $this->assertFalse($field->isAutoIncremented()); $this->assertSame('Unknown', $field->getDefault()); // User does not have to provide this value; default will serve. $this->assertFalse($field->valueNecessaryForAdd()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gender()\n {\n return $this->belongsTo('App\\Gender', 'gender_id', 'id');\n }", "public function gender()\n {\n return $this->belongsTo('Poketracker\\Model\\Gender', 'gender_id');\n }", "public function genderID()\n {\n return $this->belongsTo(Lookups::class, 'gender', 'id');\n }", "function setGender( $gender )\n {\n\t if (is_int($gender)) {\n\t\t \n\t\t switch ( $gender ) {\n\t\t\t \n\t\t\t case RowManager_PersonManager::GENDER_MALE:\n\t\t\t \t$this->setValueByFieldName( 'gender_id', RowManager_PersonManager::GENDER_MALE );\n\t\t\t \tbreak;\n\t\t\t \t\n\t\t\t case RowManager_PersonManager::GENDER_FEMALE:\n\t\t\t \t$this->setValueByFieldName( 'gender_id', RowManager_PersonManager::GENDER_FEMALE );\n\t\t\t \tbreak;\n\t\t\t default:\n\t\t\t \t$this->setValueByFieldName( 'gender_id', RowManager_PersonManager::GENDER_UNKNOWN );\n\t\t }\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$gender = mb_convert_case($gender, MB_CASE_UPPER);\n\t \tswitch( $gender ) {\n\t\t \n\t\t \tcase 'M':\n\t\t \tcase 'MALE':\n \t\t\t$this->setValueByFieldName( 'gender_id', RowManager_PersonManager::GENDER_MALE );\n \t\t\tbreak;\n \t\tcase 'F':\n \t\tcase 'FEMALE':\n \t\t\t$this->setValueByFieldName( 'gender_id', RowManager_PersonManager::GENDER_FEMALE );\n \t\t\tbreak; \n\t\t \tdefault:\n\t\t\t \t$this->setValueByFieldName( 'gender_id', RowManager_PersonManager::GENDER_UNKNOWN ); \t\t\t \t\t\n \t\t}\n \t\t}\n \t\t\n return;\n }", "public function getIdGender();", "public function gender()\n {\n return $this->belongsTo('App\\Models\\Lists\\Gender', 'gender_id');\n }", "public function getGender()\n {\n return $this->hasOne(Gender::class, ['id' => 'gender_id']);\n }", "private function setGenderValue()\n {\n $value = $this->getData(self::$genderAttributeCode);\n \n if (!$value) {\n $this->setCustomAttribute(self::$genderAttributeCode, 'N/A');\n return;\n }\n\n try {\n $attributeMetadata = $this->customerMetadata->getAttributeMetadata(self::$genderAttributeCode);\n $option = $attributeMetadata->getOptions()[$value];\n $this->setCustomAttribute(self::$genderAttributeCode, $option->getLabel());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$genderAttributeCode, 'N/A');\n }\n }", "function female() \n { \n $this->sex_id=\"F\";\n $this->sex_name=\"Female\";\n return($this->sex_id);\n }", "function set_identity($gender='*', $first_name='*', $last_name='*')\r\n{\r\n\t// primary identifiers\r\n\t$this->set_gender($gender);\r\n\t$this->set_first_name($first_name);\r\n\t$this->set_last_name($last_name);\r\n\t\r\n\t// secondary\r\n\t$this->full_name = $this->first_name . ' ' . $this->last_name;\r\n\t$this->set_user_name();\r\n\t$this->set_email();\r\n}", "public function setGender($gender)\n {\n $this->gender = $gender;\n }", "public function testBadGender()\n {\n $gender1 = new GenderEntity();\n $gender1->setGender('w');\n $this->_em->persist($gender1);\n\n $this->_em->flush();\n }", "public function sex()\n {\n return $this->belongsTo(\\App\\Models\\Sex::class, 'sex_uuid');\n }", "public function setGenderAttribute($gender)\n {\n $this->attributes['gender'] = empty($gender) ? 'M' : strtoupper($gender);\n }", "function set_gender($gender='*')\r\n{\r\n\t$this->gender = 0;\t\t// return\r\n\r\n\t// normalize gender\r\n\tif ( is_string($gender) )\r\n\t{\r\n\t\t$gender = substr($gender,0,1);\r\n\t\t$gender = strtoupper($gender);\r\n\t}\r\n\r\n\t// validity check\r\n\tif ( $gender != '*' && !in_array($gender, $this->VALID['GENDER']) )\r\n\t{\r\n\t\ttrigger_error('invalid value -- gender will be picked at random', E_USER_NOTICE);\r\n\t\t$gender = '*';\r\n\t}\r\n\t\r\n\t// random gender\r\n\tif ( $gender == '*' )\r\n\t{\r\n\t\t$this->gender = mt_rand(1,2);\r\n\t\t$this->_normalize_gender($this->gender);\r\n\t}\r\n\telseif ( is_numeric($gender) )\r\n\t{\r\n\t\t$this->gender = $gender;\r\n\t\t$this->_normalize_gender($this->gender);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$this->gender_name = $gender;\r\n\t\t$this->_normalize_gender($this->gender_name);\r\n\t}\r\n\r\n\treturn $this->gender;\r\n}", "public function setCustomerGender($customerGender);", "public function setGender($gender_name){\n $this->gender = $gender_name;\n }", "public function setIdGender(int $idGender = Gender::UNKNOWN): ParamsInterface;", "public function setGender($value)\n {\n return $this->setParameter('gender', $value);\n }", "function __construct($name,$gender) {\n $this->name = $name;\n $this->gender = $gender;\n }", "public function getGenderFieldDefault ()\n {\n $genderDefault = $this->scopeConfig->getValue(\n 'customer/address/gender_show',\n ScopeInterface::SCOPE_STORE\n );\n return $genderDefault;\n }", "function isGenderUnknown() {\n\tglobal $USER;\n\tif(!isset($USER['gender'])) return true; //If we don't know guess they aren't\n if($USER['gender']==\"u\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function getGender($userid) {\n return NULL;\n }", "protected function createGender($value) {\r\n switch ($value) {\r\n case \"m\":\r\n return Person::TYPE_GENDER_MALE;\r\n break;\r\n case \"f\":\r\n return Person::TYPE_GENDER_FEMALE;\r\n break;\r\n case \"c\":\r\n return Person::TYPE_GENDER_UNDEFINED;\r\n break;\r\n default:\r\n return null;\r\n break;\r\n }\r\n }", "public function create_default() {\n if (!$this->model->has_default()) {\n $default_data = [\n 'id' => 1,\n 'name' => 'Beregu',\n 'desc' => 'team vs team',\n ];\n $this->model->create_default($default_data);\n\n $default_data = [\n 'id' => 2,\n 'name' => 'Individu',\n 'desc' => 'individu vs individu',\n ];\n $this->model->create_default($default_data);\n }\n }", "public function getGenderId($aid) {\n $gender = db::table('myapplicants')\n -> where('aid', $aid) -> value('gender');\n if($gender) {\n $criteria_id = $this -> get_sorting_id($gender);\n if($criteria_id) return $criteria_id;\n return false;\n }\n return false;\n }", "public function testFieldIsRequiredAndHasNoDefault()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'status';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isRequired());\n $this->assertFalse($field->isPrimaryKey());\n $this->assertFalse($field->isAutoIncremented());\n $this->assertNull($field->getDefault());\n // User must provide this value.\n $this->assertTrue($field->valueNecessaryForAdd());\n }", "function getGender() {\n return $this->gender;\n }", "public function __construct($name, $salary, $gender, $id=\"\") \n {\n $this->id = $id;\n $this->name = $name;\n $this->salary = $salary;\n $this->gender = $gender;\n }", "public function getCustomerGender();" ]
[ "0.6369725", "0.6201123", "0.610377", "0.6097473", "0.6038414", "0.5955394", "0.5931999", "0.57520205", "0.5707818", "0.5682033", "0.5573807", "0.5571645", "0.5563719", "0.55358887", "0.5498666", "0.53888345", "0.53607166", "0.53215164", "0.53172004", "0.5282661", "0.52764624", "0.52753896", "0.52635765", "0.5246534", "0.5210121", "0.5148933", "0.5120136", "0.5113519", "0.5108543", "0.50932366" ]
0.6580803
0
Test isEnum, enum data type & values, and default.
public function testEnumDataType() { $tableName = 'ramp_enumTesting'; $table = new Application_Model_DbTable_Table($tableName); $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA); $whichField = 'gender'; $field = new Application_Model_Field($whichField, array(), $metaInfo[$whichField]); $this->assertTrue($field->isInTable()); $this->assertTrue($field->isInDB()); $this->assertTrue($field->isEnum()); $this->assertSame("enum('Unknown','M','F')", $field->getDataType()); $this->assertSame(array('Unknown','M','F'), array_keys($field->getEnumValues())); $this->assertSame('Unknown', $field->getDefault()); $this->_assertWholelyLocal($field); $this->_assertMetaInfoValues($tableName, $whichField, $field); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testEnumField()\n {\n $field = $this->table->getField('yeahnay'); // An enum column\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Enumerated',\n $field);\n $enumValues = $field->getValues();\n $this->assertCount(2, $enumValues);\n $this->assertEquals('Yes', $enumValues[0]);\n $this->assertEquals('No', $enumValues[1]);\n }", "public function forValueWithValues()\n {\n assert(\n TestEnumWithValues::forValue(10),\n isSameAs(TestEnumWithValues::$FOO)\n );\n }", "public function testAcceptsAWellDefinedEnumTypeWithEmptyValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => [\n 'FOO' => [],\n 'BAR' => [],\n ],\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals('FOO', $enumType->getValue('FOO')->getValue());\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals('BAR', $enumType->getValue('BAR')->getValue());\n }", "function check_enum_value_type($received_value, $table_name, $table_field, \\PDO $db) {\n $options = \\k1lib\\sql\\get_db_table_enum_values($db, $table_name, $table_field);\n $options_fliped = array_flip($options);\n\n if (!isset($options_fliped[$received_value])) {\n $error_type = print_r($options_fliped, TRUE) . \" value: '$received_value'\";\n// d($received_value, TRUE);\n } else {\n $error_type = FALSE;\n }\n return $error_type;\n}", "public function useEnumValues(): bool\n {\n return $this->useEnumValues;\n }", "public function testRejectsAnEnumTypeWithMissingValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => ['FOO' => null],\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'SomeEnum.FOO must refer to an object with a \"value\" key representing ' .\n 'an internal value but got: null.'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType->getValues();\n\n $this->addToAssertionCount(1);\n }", "public function testIfWrongValueThrows() : void\n {\n\n $this->expectException(FieldValueInproperException::class);\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setModel(( new Model() )->setName('test'));\n $field->setValues('one', 'two', 'three');\n\n // Test.\n $this->assertFalse($field->isValueValid('four'));\n }", "abstract protected function getSupportedEnumType() : string;", "final public function isEnum():bool\n {\n return $this->mode === 'enum';\n }", "public function testRejectsAnEnumWithIncorrectlyTypedValues()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => [['FOO' => 10]],\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('SomeEnum values must be an associative array with value names as keys.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType->getValues();\n\n $this->addToAssertionCount(1);\n }", "function is_enum(mixed $var): bool\n{\n return is_object($var) && enum_exists($var::class, false);\n}", "public function testAcceptsAWellDefinedEnumTypeWithInternalValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => [\n 'FOO' => ['value' => 10],\n 'BAR' => ['value' => 20],\n ],\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals(10, $enumType->getValue('FOO')->getValue());\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals(20, $enumType->getValue('BAR')->getValue());\n }", "public function testFieldIsRequiredAndHasDefault()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'gender';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isRequired());\n $this->assertFalse($field->isPrimaryKey());\n $this->assertFalse($field->isAutoIncremented());\n $this->assertSame('Unknown', $field->getDefault());\n // User does not have to provide this value; default will serve.\n $this->assertFalse($field->valueNecessaryForAdd());\n }", "public function forValueWithoutValues()\n {\n assert(\n TestEnumWithoutValues::forValue('FOO'),\n isSameAs(TestEnumWithoutValues::$FOO)\n );\n }", "public function isEnumType()\n {\n return $this->getType() == PropelTypes::ENUM;\n }", "public function testRejectsAnEnumTypeWithIncorrectlyTypedValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => ['FOO' => 10],\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'SomeEnum.FOO must refer to an object with a \"value\" key representing ' .\n 'an internal value but got: 10.'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType->getValues();\n\n $this->addToAssertionCount(1);\n }", "public static function Parse($enumType, $value, $ignoreCase) {\r\n /*\r\n * ArgumentNullException\t\r\n enumType or value is null.\r\n * \r\n ArgumentException\r\n enumType is not an Enum.\r\n -or-\r\n value is either an empty string (\"\") or only contains white space.\r\n -or-\r\n value is a name, but not one of the named constants defined for the enumeration.\r\n * \r\n OverflowException\r\n value is outside the range of the underlying type of enumType.\r\n */\r\n return false;\r\n }", "public function testIfWorks() : void\n {\n\n // Lvd.\n $dicts = [\n 'main' => [ 'one', 'two', 'three' ],\n 'pl:pl' => [ 'jeden', 'dwa', 'trzy' ],\n ];\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setValues(...$dicts['main']);\n $field->setDict('pl:pl', ...$dicts['pl:pl']);\n\n // Test.\n $this->assertEquals($dicts['main'], $field->getValues());\n $this->assertEquals($dicts['main'], $field->getMainDict());\n $this->assertEquals($dicts['pl:pl'], $field->getDict('pl:pl'));\n $this->assertEquals($dicts, $field->getDicts());\n $this->assertEquals($dicts['main'][0], $field->getDictValue('one'));\n $this->assertEquals($dicts['main'][0], $field->getDictValue('one', 'main'));\n $this->assertEquals($dicts['pl:pl'][0], $field->getDictValue('one', 'pl:pl'));\n $this->assertTrue($field->isValueValid(null));\n $this->assertTrue($field->isValueValid('one'));\n $this->assertFalse($field->isValueValid('jeden', false));\n $this->assertFalse($field->isValueValid('1', false));\n }", "public function testInvalidEnum()\n {\n $this->expectException(UnexpectedValueException::class);\n\n $createPaymentAccountRequest = new CreatePaymentAccountRequest(\n 'Valid Description',\n 'INVALID_ENUM_VALUE'\n );\n }", "static public function Enum ( $var, $allowed ) { return in_array( $var, $allowed ) ? $var : false; }", "static public function isEnumValue ($value) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:461: characters 3-31\n\t\treturn ($value instanceof HxEnum);\n\t}", "public static function are_valid_enums($enum_property_list, $params){\n foreach ($enum_property_list as $item){\n $property = $item[\"property\"];\n $enum = $item[\"enum\"];\n if(isset($params[$property])){\n if(!Media::is_valid_enum($enum, $params[$property])){\n $http_response = HttpFailCodes::http_response_fail()->valid_enums;\n $http_response->message = \"Must choose a valid value for \" . $property . \".\";\n APIService::response_fail($http_response);\n }\n }\n }\n return true;\n }", "public function testValueIsInvalid()\n {\n $init = 'foo';\n $set = array('test');\n $str = new \\Pv\\PEnum($init, null, $set);\n }", "public function hasEnumFields()\n {\n foreach ($this->fields as $col) {\n if ($col->isEnumType()) {\n return true;\n }\n }\n\n return false;\n }", "private function enumsHaveValues() : bool\n {\n foreach ($this->enums as $enum) {\n if ($enum->value !== null) {\n return true;\n }\n }\n\n return false;\n }", "public static function is_valid_enum($enum, $value){\n foreach ($enum as $key => $enum_value) {\n if ($enum_value == $value){\n return true;\n }\n }\n return false;\n }", "public function testValueIsCorrect()\n {\n $init = 'test';\n $set = array('test');\n $str = new \\Pv\\PEnum($init, null, $set);\n }", "public static function IsDefined($enumType, $value) {\r\n /*\r\n * ArgumentNullException\t\r\n enumType or value is null.\r\n * \r\n ArgumentException\r\n enumType is not an Enum.\r\n -or-\r\n The type of value is an enumeration, but it is not an enumeration of type enumType.\r\n -or-\r\n The type of value is not an underlying type of enumType.\r\n * \r\n InvalidOperationException\r\n value is not type SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64, or String.\r\n */\r\n }", "function _mysql_enum_values($tableName,$fieldName){\n\n\t\t#$result = @mysql_query(\"DESCRIBE $tableName\");\n\n\t\t foreach($this->fields as $row){\n\n\t\t\tereg('^([^ (]+)(\\((.+)\\))?([ ](.+))?$',$row['Type'],$fieldTypeSplit);\n\n\t\t\t//split type up into array\n\t\t\t$fieldType = $fieldTypeSplit[1];\n\t\t\t$fieldLen = $fieldTypeSplit[3];\n\n\t\t\tif ( ($fieldType=='enum' || $fieldType=='set') && ($row['Field']==$fieldName) ){\n\t\t\t\t$fieldOptions = split(\"','\",substr($fieldLen,1,-1));\n\t\t\t\treturn $fieldOptions;\n\t\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "public function testFieldIsRequiredAndHasNoDefault()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'status';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isRequired());\n $this->assertFalse($field->isPrimaryKey());\n $this->assertFalse($field->isAutoIncremented());\n $this->assertNull($field->getDefault());\n // User must provide this value.\n $this->assertTrue($field->valueNecessaryForAdd());\n }" ]
[ "0.66813856", "0.6616936", "0.658729", "0.6516475", "0.6394785", "0.6283025", "0.62467676", "0.6185788", "0.61654186", "0.615975", "0.6111784", "0.6082374", "0.602988", "0.6029672", "0.5976864", "0.5963048", "0.5950302", "0.5904844", "0.58995205", "0.5874721", "0.5867007", "0.5847112", "0.5838767", "0.5832237", "0.5815099", "0.5810904", "0.5791245", "0.5781232", "0.57703507", "0.57694924" ]
0.7388066
0
Set the Page Grouping descriptionMoreInfoHtml
public function setDescriptionMoreInfoHtml($descriptionMoreInfoHtml = "") { $this->descriptionMoreInfoHtml = !empty($descriptionMoreInfoHtml) ? trim($descriptionMoreInfoHtml) : NULL; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDescriptionMoreInfoHtml() { return $this->descriptionMoreInfoHtml; }", "protected function setDescription() {\r\n\t\t$descriptionCrop = intval($this->settings['news']['semantic']['general']['description']['crop']);\r\n\t\t$descriptionAction = $this->settings['news']['semantic']['general']['description']['action'];\r\n\t\t$descriptionText = $this->newsItem->getTeaser();\r\n\t\tif (empty($descriptionText)) {\r\n\t\t\t$descriptionText = $this->newsItem->getBodytext();\r\n\t\t}\r\n\t\tif (!empty($descriptionText) && !empty($descriptionAction)) {\r\n\t\t\tif (!empty($GLOBALS['TSFE']->page['description'])) {\r\n\t\t\t\tswitch ($descriptionAction) {\r\n\t\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t\t$descriptionText .= ': ' . $GLOBALS['TSFE']->page['description'];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'append':\r\n\t\t\t\t\t\t$descriptionText = $GLOBALS['TSFE']->page['description'] . ': ' . $descriptionText;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->description = $this->contentObject->crop($descriptionText, $descriptionCrop . '|...|' . TRUE);\r\n\t\t}\r\n\t}", "protected function setHtmlContent() {}", "public function setHtml();", "public function setPageDescription($text)\n {\n $metaDescription = $this->query('meta[name=\"description\"]')->first();\n if ($text === '') {\n // If empty value passed we need to remove title tag\n if ($metaDescription) {\n $this->removeElement($metaDescription);\n }\n } else {\n if ($metaDescription) {\n $metaDescription->setAttribute('content', $text);\n } else {\n // Try to insert meta description tag into head\n $metaDescription = new Meta('description', $text);\n $head = $this->query('head');\n if ($head->count() > 0) {\n /* @var Element $head */\n $this->appendTo($head->first(), $metaDescription);\n }\n }\n }\n }", "static public function setDescription($new_description) {\n\t\tself::$page_description = (string)$new_description;\n\t}", "public function setDescription ($value) {\n\t\t$this->setData(\"pageDescription\", $value);\n\t\treturn true;\n\t}", "function description( $html = true )\r\n {\r\n if ( $html )\r\n return eZTextTool::fixhtmlentities( htmlspecialchars( $this->Description ) );\r\n else\r\n return $this->Description;\r\n }", "public function getDescriptionTextHtml() { return $this->descriptionTextHtml; }", "public function setDescription($description) {\n\t\tTemplate::setSiteMetaDescription($description);\n\t}", "function setDescription( $value )\r\n {\r\n $this->Description = $value;\r\n }", "function setDescription( $value )\r\n {\r\n $this->Description = $value;\r\n }", "function setElementDescription($elemName, $html)\n\t{\n\t\t// Only update if element is custom\n\t\tif (isset($this->elementListNames[$elemName])) {\n\t\t\t$this->elementListNames[$elemName]->description = $html;\n\t\t}\n\t}", "public function setDescription($description)\n\t{\n\t\t$this->description = $description;\n\n\t\tif($this->pageInitialized)\n\t\t\t$this->setMetaTag('description', $this->description);\n\t}", "public function setPageDescription($pageDescription)\n {\n $this->_pageDescription = $pageDescription;\n }", "public function property_overview_desc() {\n\n\t\t\t$short_description_1 = get_field( 'short_description_1' );\n\t\t\t$short_description_2 = get_field( 'short_description_2' );\n\n\t\t\t$out = '<h6>Overview Description:</h6>';\n\t\t\t$out .= '<p>';\n\t\t\t$out .= ( get_field( 'advertisement_package' ) == '165' )\n\t\t\t\t? $short_description_1\n\t\t\t\t: $short_description_2;\n\t\t\t$out .= '</p>';\n\t\t\t$out .= '<div class=\"hr hr-default\"><span class=\"hr-inner \"><span class=\"hr-inner-style\"></span></span></div>';\n\n\t\t\tif ( $this->add_package == 3 ) {\n\t\t\t$out .= '<h3>Practice Details:</h3>';\n\t\t\t}\n\n\t\t\treturn $out;\n\t\t}", "function medigroup_mikado_excerpt_more($more) {\n return '...';\n }", "public static function description($description)\n {\n // Set page description\n self::$data['description'] = $description;\n }", "function bg_AddSettingsSectionHtml() { }", "public function KemiSitemap_description()\n {\n echo '<p>Kemi Sitemap Description</p>';\n }", "protected function _setMetaDescription(array $metaDescription)\n {\n $metaDescription = $this->_insertContent(\n $this->getOriginPageMetaDescription(),\n $metaDescription,\n self::HEADING_DESCRIPTION_SEPARATOR\n );\n $this->category->setData('meta_description', $metaDescription);\n return $this;\n }", "public function set_description($desciption){\n\t\t$this->set_channel_element('description', $desciption);\n\t}", "protected function assignDescription()\n {\n $this->description = '';\n }", "protected function setHTMLVar() {\r\n $this->htmlVar = array(\r\n 'htmlTitle' => HTML_TITLE,\r\n 'htmlTitleSuffix' => ''\r\n );\r\n }", "function field_details() \n { ?>\n <div class=\"field-details\">\n <?php if($this->setting['type'] != 'radio' && $this->setting['type'] != 'checkbox') : ?><label <?php $this->for_tag(\"inferno-concrete-setting-\"); ?>><?php endif; ?>\n <?php echo $this->setting['desc']; ?>\n <?php if($this->setting['type'] != 'radio' && $this->setting['type'] != 'checkbox') : ?></label><?php endif; ?>\n\n <?php if(isset($this->setting['more']) && $this->setting['more'] != '') : ?>\n <span class=\"more\"><?php echo $this->setting['more']; ?></span>\n <?php endif; ?>\n\n <?php if($this->setting['type'] == 'font') : ?>\n <div class=\"googlefont-desc\">\n <label <?php $this->for_tag(\"inferno-concrete-setting-\", \"-googlefont\"); ?>>\n <?php _e('Enter the Name of the Google Webfont You want to use, for example \"Droid Serif\" (without quotes). Leave blank to use a Font from the selector above.', 'inferno'); ?>\n </label>\n <span class=\"more\">\n <?php _e('You can view all Google fonts <a href=\"http://www.google.com/webfonts\">here</a>. Consider, that You have to respect case-sensitivity. If the font has been successfully recognized, the demo text will change to the entered font.', 'inferno'); ?>\n </span>\n </div>\n <?php endif; ?>\n </div>\n <?php\n }", "public function setEmailFootHtml($value) { $this->_emailFootHtml = $value; }", "public function setDescription($data)\n {\n $this->_Description=$data;\n return $this;\n }", "private function getCommonDescriptionforField() {\n if(strlen($this->description) > 0) {\n return '<span id=\"'.$this->name.'-help\" class=\"help-block\">'.$this->description.'</span>'.\"\\n \\t\";\n }\n }", "public function setSetDescription($description) {\r\n\t\t$this -> setdescription = $description;\r\n\t}", "public function seoDescription(){\n return ($this->excerpt ? descriptionMaker($this->excerpt) : descriptionMaker($this->description));\n }" ]
[ "0.67480886", "0.60148144", "0.5888587", "0.5723601", "0.568397", "0.56631184", "0.56386054", "0.54860467", "0.5457825", "0.5443679", "0.5334175", "0.5334175", "0.53106445", "0.5308413", "0.53028333", "0.5297064", "0.526465", "0.5248049", "0.5245327", "0.5242192", "0.52301085", "0.52107507", "0.5194948", "0.5146114", "0.51015335", "0.5086144", "0.50700074", "0.50602955", "0.5058345", "0.5056068" ]
0.6606442
1
Set the Page Grouping specialHeaderClassName
public function setSpecialHeaderClassName($specialHeaderClassName = "") { $this->specialHeaderClassName = !empty($specialHeaderClassName) ? trim($specialHeaderClassName) : NULL; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSpecialHeaderClassName() { return $this->specialHeaderClassName; }", "public function setHeaderClass($class) {\r\n $this->headerClass = \"class=\\\"$class\\\"\";\r\n }", "public function setHeaderClass($class) {\n $this->headerClass = \"class=\\\"$class\\\"\";\n }", "function voyage_mikado_header_class($classes) {\n\t\t$header_type = voyage_mikado_get_meta_field_intersect('header_type', voyage_mikado_get_page_id());\n\n\t\t$classes[] = 'mkdf-'.$header_type;\n\n\t\treturn $classes;\n\t}", "public function setHeaderClass($headerClass) {\n $this->headerClass = $headerClass;\n }", "function voyage_mikado_header_behaviour_class($classes) {\n\n\t\t$classes[] = 'mkdf-'.voyage_mikado_options()->getOptionValue('header_behaviour');\n\n\t\treturn $classes;\n\t}", "function flatsome_header_title_classes(){\n echo implode(' ', apply_filters( 'flatsome_header_title_class', array() ) );\n}", "function header_class( $class = '' ) {\n\techo 'class=\"' . join( ' ', get_header_class( $class ) ) . '\"';\n}", "public function prePageHeader();", "function set_page_header( $page_header )\n {\n $this->includes[ 'page_header' ] = $page_header;\n return $this;\n }", "function get_body_class($classes){\n $group=groups_get_current_group();\n \n if(!empty($group))\n $classes[]='is-single-group';\n\n return $classes;\n\n\n }", "function flatsome_header_classes(){\n echo implode(' ', apply_filters( 'flatsome_header_class', array() ) );\n}", "function PREFIX_add_grid_class_to_body($classes) {\n\t$classes[] = 'fs-grid';\n\t$classes = array_diff( $classes, array(\"page\") );\n\n\treturn $classes;\n}", "function add_page_name_class($classes)\n\t{\n\t\tglobal $post;\n\t\tif ( is_page() || is_singular() ) {\n\t\t\t$classes[] = sanitize_html_class($post->post_name);\n\t\t}\n\t\treturn $classes;\n\t}", "function page_class( $classes ) {\n\tglobal $post;\n\t$slug = ( isset( get_post( $post )->post_name ) ? get_post( $post )->post_name : 'no-slug' );\n\t$new_class = 'page-' . $slug;\n\t$classes[] = $new_class;\n\treturn $classes;\n}", "public function _assign_xoops_header()\n {\n $header_class = webphoto_xoops_header::getInstance($this->_DIRNAME, $this->_TRUST_DIRNAME);\n $header_class->set_flag_css(true);\n $header_class->assign_for_main();\n }", "function wprt_feature_title_heading_classes() {\n\t// Define classes\n\t$classes = '';\n\n\t// Get topbar style\n\tif ( wprt_get_mod( 'featured_title_heading_shadow' ) ) {\n\t\t$classes .= 'has-shadow';\n\t}\n\n\t// Return classes\n\treturn esc_attr( $classes );\n}", "public function addColgroupClass($class)\n {\n if (is_array($class)) {\n self::slugArray($class);\n $this->html_colgroup_class = array_unique(array_merge($this->html_colgroup_class, $class));\n } elseif (is_string($class)) {\n $this->html_colgroup_class[] = self::slug($class);\n $this->html_colgroup_class = array_unique($this->html_colgroup_class);\n }\n }", "protected function getPageClassName()\n {\n return ContainerPage::className();\n }", "public function setBasePageClass($value)\r\n\t{\r\n\t\t$this->_basePageClass=$value;\r\n\t}", "function voyage_mikado_header_class_first_level_bg_color($classes) {\n\n\t\t//check if first level hover background color is set\n\t\tif(voyage_mikado_options()->getOptionValue('menu_hover_background_color') !== '') {\n\t\t\t$classes[] = 'mkdf-menu-item-first-level-bg-color';\n\t\t}\n\n\t\treturn $classes;\n\t}", "public function CustomClassName()\n\t{\n\t\tif ($this->CopyContentFromID > 0) {\n\t\t\tif ($this->CopyContentFrom()->ClassName == \"NavigationModule\") {\n\t\t\t\treturn \"NavigationModule_\" . $this->CopyContentFrom()->ModuleLayout;\n\t\t\t} else {\n\t\t\t\treturn $this->CopyContentFrom()->ClassName;\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->ClassName;\n\t\t}\n\t}", "function wpex_header_classes() {\n\n\t// Vars\n\t$post_id = wpex_get_current_post_id();\n\t$header_style = wpex_header_style( $post_id );\n\n\t// Setup classes array\n\t$classes = array();\n\n\t// Main header style\n\t$classes['header_style'] = 'header-'. $header_style;\n\n\t// Full width header\n\tif ( 'full-width' == wpex_site_layout() && wpex_get_mod( 'full_width_header' ) ) {\n\t\t$classes[] = 'wpex-full-width';\n\t}\n\n\t// Sticky Header\n\tif ( wpex_has_sticky_header() ) {\n\n\t\t// Fixed header style\n\t\t$fixed_header_style = wpex_sticky_header_style();\n\n\t\t// Main fixed class\n\t\t$classes['fixed_scroll'] = 'fixed-scroll'; // @todo rename this at some point?\n\t\tif ( wpex_has_shrink_sticky_header() ) {\n\t\t\t$classes['shrink-sticky-header'] = 'shrink-sticky-header';\n\t\t\tif ( 'shrink_animated' == $fixed_header_style ) {\n\t\t\t\t$classes['anim-shrink-header'] = 'anim-shrink-header';\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// Reposition cart and search dropdowns\n\tif ( 'three' == $header_style\n\t\t|| 'four' == $header_style\n\t\t|| 'five' == $header_style\n\t\t|| ( 'two' == $header_style && wpex_get_mod( 'header_menu_center', false ) )\n\t) {\n\t\t$classes[] = 'wpex-reposition-cart-search-drops';\n\t}\n\n\t// Dropdown style (must be added here so we can target shop/search dropdowns)\n\t$dropdown_style = wpex_get_mod( 'menu_dropdown_style' );\n\tif ( $dropdown_style && 'default' != $dropdown_style ) {\n\t\t$classes['wpex-dropdown-style-'. $dropdown_style] = 'wpex-dropdown-style-'. $dropdown_style;\n\t}\n\n\t// Dropdown shadows\n\tif ( $shadow = wpex_get_mod( 'menu_dropdown_dropshadow' ) ) {\n\t\t$classes[] = 'wpex-dropdowns-shadow-'. $shadow;\n\t}\n\n\t// Header Overlay Style\n\tif ( wpex_has_overlay_header() ) {\n\n\t\t// Get header style\n\t\t$overlay_style = wpex_overlay_header_style();\n\t\t$overlay_style = $overlay_style ? $overlay_style : 'light';\n\n\t\t// Dark dropdowns for overlay header\n\t\tif ( 'core' != $overlay_style ) {\n\t\t\tif ( $post_id && $dropdown_style_meta = get_post_meta( $post_id, 'wpex_overlay_header_dropdown_style', true ) ) {\n\t\t\t\tif ( 'default' != $dropdown_style_meta ) {\n\t\t\t\t\t$classes[] = 'wpex-dropdown-style-'. $dropdown_style_meta;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset( $classes['wpex-dropdown-style-'. $dropdown_style] );\n\t\t\t\t$classes[] = 'wpex-dropdown-style-black';\n\t\t\t}\n\t\t}\n\n\t\t// Add overlay header class\n\t\t$classes[] = 'overlay-header';\n\n\t\t// Add overlay header style class\n\t\t$classes[] = $overlay_style .'-style';\n\n\t}\n\n\t// Dynamic style class\n\t$classes[] = 'dyn-styles';\n\n\t// Clearfix class\n\t$classes[] = 'clr';\n\n\t// Set keys equal to vals\n\t$classes = array_combine( $classes, $classes );\n\n\t// Apply filters for child theming\n\t$classes = apply_filters( 'wpex_header_classes', $classes );\n\n\t// Turn classes into space seperated string\n\t$classes = implode( ' ', $classes );\n\n\t// return classes\n\treturn $classes;\n\n}", "function cs_subheader_classes( $header_banner_selection = ''){\n\tif ($header_banner_selection == \"No Image\") {\n \techo 'cs-no-image';\n }elseif($header_banner_selection == 'Custom Image'){\n\t\techo 'cs-custom-image';\n\t} elseif ($header_banner_selection == \"Default Image\") {\n \techo \"default-image\";\n } else {\n \techo \"default-image\";\n }\n}", "private function addHeaderToStaticMap()\n {\n HeaderLoader::addStaticMap(\n [\n 'xmagentotags' => XMagentoTags::class,\n ]\n );\n }", "public function clearColgroupClass()\n {\n $this->html_colgroup_class = [];\n }", "function setup_config_display_header($body_classes = array())\n {\n }", "protected function draw_groupsHeaderHorizontal()\n {\n // $this->output->setColumnNo(0);\n $lastcolumno = $this->output->getColumnNo();\n $this->output->setColumnNo(0);\n $this->draw_groupsHeader();\n $this->output->setColumnNo($lastcolumno);\n $this->currentRowTop = $this->output->getLastBandEndY();\n \n //output print group\n //set callback use next page instead\n // echo 'a'; \n }", "public function getPageClasses( $title ) {\n\t\t$className = parent::getPageClasses( $title );\n\t\t$className .= ' ' . $this->getMode();\n\t\tif ( $title->isMainPage() ) {\n\t\t\t$className .= ' page-Main_Page ';\n\t\t} elseif ( $title->isSpecialPage() ) {\n\t\t\t$className .= ' mw-mf-special ';\n\t\t}\n\n\t\tif ( $this->isAuthenticatedUser() ) {\n\t\t\t$className .= ' is-authenticated';\n\t\t}\n\t\treturn $className;\n\t}", "public function addClassHeader($classHeader) {\n\t\t$this->processedClassCode = preg_replace_callback(self::PATTERN_CLASS_SIGNATURE, function($matches) use ($classHeader) {\n\t\t\treturn $classHeader . chr(10) . $matches['modifiers'] . $matches['className'] . $matches['parents'];\n\t\t}, $this->processedClassCode);\n\t}" ]
[ "0.67822284", "0.6517376", "0.64062715", "0.6094492", "0.57520664", "0.56397563", "0.5452493", "0.5432467", "0.5396821", "0.5377883", "0.537453", "0.52890724", "0.52877814", "0.528752", "0.52807635", "0.5233675", "0.52175856", "0.5202263", "0.51882803", "0.51798403", "0.516564", "0.51650006", "0.51492417", "0.51338893", "0.5127688", "0.50962114", "0.50758564", "0.5072603", "0.50539124", "0.50461185" ]
0.66253924
1
Get the Grouping page image description
public function getDescriptionImage() { return $this->descriptionImage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_description()\n {\n return 'Populate your image of the day gallery with 40 LOLCAT images. After installing the addon select the image of the day in the usual way by going to Admin zone > Content > Images of the day and select the image you want to display.';\n }", "public function getGroupDescription()\n {\n return $this->__get(self::FIELD_GROUP_DESCRIPTION);\n }", "function get_group_description($group) {\n\tglobal $home_locale, $current_locale;\n\tif ($home_locale == $current_locale\n\t\t\t|| !isset($group['vccommondescription'])\n\t\t\t|| !$group['vccommondescription']) {\n\t\treturn $group['vclocaldescription'];\n\t} else {\n\t\treturn $group['vccommondescription'];\n\t}\n}", "public function getGroupDescription() : string\n {\n return $this->groupDescription;\n }", "public function get_image_title()\n {\n }", "public function getMetaSummary()\n {\n return $this->dbObject('ImageMetaCaption');\n }", "function showcaseGallery($groupId, $title) {\n\t$config = new ConfigReader();\n\t$config->loadConfigFile('assets/core/config/widgets/showGroup/gallery.properties');\n\t\n\t$maxDisplay = $config->readValue('maxDisplay');\n\t$maxPerRow = $config->readValue('maxPerRow');\n\t$w = $config->readValue('maxImageSizeX');\n\t$h = $config->readValue('maxImageSizeY');\n\t\n\t//if the user is not an admin, validate that the user is a member of this group\n\t$result = mysql_query(\"SELECT parentId, imageUrl FROM imagesGroups WHERE parentId = '{$groupId}' AND inSeriesImage = 1 ORDER BY RAND() LIMIT $maxDisplay\");\n\t$total = mysql_num_rows($result);\n\t\n\tif ($total > 0) {\n\t\t\n\t\t$urlCategory =urlencode($row->category);\n\t\t$caption = htmlentities($row->caption);\n\t\t\n\t\t$x = 0;\n\t\t$count = 0;\n\t\t\n\t\t//adjust maxPerRow is it's greater than the returned number of objects\n\t\tif ($maxPerRow > $total) {\n\t\t\t\n\t\t\t$maxPerRow = $total;\n\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"\t\t\t\t<div id=\\\"gallery_container\\\">\\n\";\n\t\t$return .= \"\t\t\t\t\t<div class=\\\"header\\\"><a href=\\\"/groupgalleries/id/$groupId\\\">$title</a></div>\\n\";\n\t\t$return .= \"\t\t\t\t\t<div class=\\\"body\\\">\\n\";\n\t\t\n\t\twhile ($row = mysql_fetch_object($result)) {\n\t\t\t\n\t\t\t//count this row's column itteration\n\t\t\t$x++;\n\t\t\t\n\t\t\t//keep track of total displayed so far\n\t\t\t$count++;\n\t\t\t\n\t\t\t//determine if separator class is applied\n\t\t\tif ($x % $maxPerRow != 0) {\n\t\t\t\t\n\t\t\t\t$separator = \" separator\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$separator = \"\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return .= \"<div class=\\\"gallery_image_container$separator\\\">\\n\";\n\t\t\t$return .= \"\t<a href=\\\"/groupgalleries/id/$groupId\\\"><img src=\\\"/file.php?load=$row->imageUrl&w=$w&h=$h\\\" border=\\\"0\\\"></a>\\n\";\n\t\t\t$return .= \"</div>\\n\";\n\t\t\t\n\t\t\t//row separator\n\t\t\tif ($x == $maxPerRow && $count < $total) {\n\t\t\t\t\n\t\t\t\t$return .= \"\t\t\t<div class=\\\"gallery_image_row_separator\\\"></div>\\n\";\n\t\t\t\t$x = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"\t\t\t\t\t</div>\\n\";\n\t\t$return .= \"\t\t\t\t</div>\\n\";\n\t\t\n\t}\t\n\t\n\treturn($return);\n\t\n}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "public function options_page_overview() \n\t\t{\n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach( $this->size_groups as $size_group => $sizes ) \n\t\t\t{\n\t\t\t\t$html .= '<h3>' . $this->get_group_headline( $size_group ) . '</h3>';\n\t\t\t\t\n\t\t\t\t$html .= '<ul>';\n\t\t\t\t\n\t\t\t\tforeach( $sizes as $key => $image ) \n\t\t\t\t{\n\t\t\t\t\t$info = $image['width'] . '*' . $image['height'];\n\t\t\t\t\tif( isset( $image['crop'] ) && true === $image['crop'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$info .= ' ' . __( '(cropped)', 'avia_framework' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$info .= ' - ' . $this->get_image_key_info( $key );\n\t\t\t\t\t\n\t\t\t\t\t$html .= '<li>' . $info . '</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '</ul>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "public function getSummaryThumbnail() {\n $data = [];\n if ($this->Image() && $this->Image()->exists()) {\n // Stretch to maximum of 36px either way then trim the extra off\n if ($this->Image()->getOrientation() === Image_Backend::ORIENTATION_PORTRAIT) {\n $data['Image'] = $this->Image()->ScaleWidth(36)->CropHeight(36);\n } else {\n $data['Image'] = $this->Image()->ScaleHeight(36)->CropWidth(36);\n }\n }\n return $this->customise($data)->renderWith(__CLASS__ . '/SummaryThumbnail')->forTemplate();\n }", "public function getDescriptionImages() {\n preg_match( '@src=\"([^\"]+)\"@' , $this->description, $match);\n return $match;\n }", "public function getGroup()\n {\n $ProductGroup = ProductGroup::find($this->group_id); \n \n return $ProductGroup->description;\n }", "public function RenderImages_withLink_andSummary() {\n\t$htTitle = $this->NameString();\n\t$htStatus = $this->RenderCatalogSummary_HTML();\n\t$qStock = $this->QtyInStock();\n\t$htStock = \"$qStock in stock\";\n\t$htPopup = \"&ldquo;$htTitle&rdquo;%attr%\\n$htStatus\\n$htStock\";\n\t$htImgs = $this->RenderImages_forRow($htPopup,vctImages::SIZE_THUMB);\n\t$htTitle = $this->ShopLink($htImgs);\n\treturn $htTitle;\n }", "function album_gallery_get_page_content_show($GUID_USER, $GUID_IMAGE)\n{\n if(!$GUID_IMAGE || !$img = get_entity($GUID_IMAGE))\n {\n $immagine = elgg_view('elgg-album-gallery/error', array('error' => elgg_echo('gallery:no:imageshow')));\n $titolo = elgg_echo('gallery:title:error',array(elgg_echo('gallery:no:imageshow')));\n }\n else\n {\n $titolo = elgg_echo('gallery:title:showone',array($img->title));\n $immagine = elgg_view('elgg-album-gallery/show',array('title' => $img->title, 'desc' => $img->description, 'image' => $img->getIconURL('large'), 'guid' => $img->guid, 'guid_user' => $GUID_USER, 'action' => elgg_echo('gallery:delete:link')));\n }\n\n $return = array(\n 'title' => $titolo,\n 'content' => $immagine\n );\n\n return $return;\n}", "public function RenderImages() {\n\t$outYes = $outNo = NULL;\n\twhile ($this->NextRow()) {\n\t $htTitle = $this->RenderImages_withLink_andSummary();\n\t if ($this->IsForSale()) {\n\t\t$outYes .= $htTitle;\n\t } else {\n\t\t$outNo .= $htTitle;\n\t }\n\t}\n\t\n\tif (is_null($outYes)) {\n\t $htYes = '<span class=content>There are currently no titles available for this topic.</spaN>';\n\t} else {\n\t $oSection = new vcHideableSection('hide-available','Titles Available',$outYes);\n\t $htYes = $oSection->Render();\n\t}\n\tif (is_null($outNo)) {\n\t $htNo = NULL;\t// no point in mentioning lack of unavailable titles\n\t} else {\n\t $oSection = new vcHideableSection('show-retired','Titles NOT available',$outNo);\n\t $oSection->SetDefaultHide(TRUE);\n\t $htNo = $oSection->Render();\n\t}\n\treturn $htYes.$htNo;\n }", "private function get_title_img()\n {\n $this->char_count = count($this->strings);\n $this->init_img();\n $font_size = L_FONT_SIZE / $this->char_count;\n $img_y = (L_IMG_HEIGHT + $font_size) / 2;\n $this->create_img($this->string,$font_size,$img_y);\n }", "public function getContent()\n\t\t{\n\t\t\treturn $this->getGroup();\n\t\t\t\n\t\t}", "public function description()\n\t{\n\t\t$txt = array();\n\t\t$txt['wiki'] = \"Displays group events\";\n\t\t$txt['html'] = '<p>Displays group events.</p>';\n\t\t$txt['html'] = '<p>Examples:</p>\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(number=3)]]</code> - Displays the next three group events</li>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(title=Group Events, number=2)]]</code> - Adds title above event list. Displays 2 events.</li>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(id=123)]]</code> - Displays single group event with ID # 123</li>\n\t\t\t\t\t\t\t</ul>';\n\t\treturn $txt['html'];\n\t}", "public function getGroupsDescription()\n {\n if (class_exists(Subsite::class)) {\n Subsite::disable_subsite_filter(true);\n }\n\n // Get the member's groups, if any\n $groups = $this->owner->Groups();\n if ($groups->Count()) {\n // Collect the group names\n $groupNames = array();\n foreach ($groups as $group) {\n /** @var Group $group */\n $groupNames[] = html_entity_decode($group->getTreeTitle() ?? '');\n }\n // return a csv string of the group names, sans-markup\n $result = preg_replace(\"#</?[^>]>#\", '', implode(', ', $groupNames));\n } else {\n // If no groups then return a status label\n $result = _t(__CLASS__ . '.NOGROUPS', 'Not in a Security Group');\n }\n\n if (class_exists(Subsite::class)) {\n Subsite::disable_subsite_filter(false);\n }\n return $result;\n }", "public function detail(): string\n {\n return $this->groupDetail ?? '';\n }", "public function getImagemd() {\n return $this->imagemd;\n }", "public function introTextImage(){\n if(isset($this->imageIntro)){\n return $this->imageIntro;\n }\n $this->fetchIntroImage();\n return $this->imageIntro;\n }", "function get_header_image()\n {\n }", "function frmgetcourse_summary_image($courseid) {\n\tglobal $CFG;\n\t$contentimage = '';\n\tforeach (frmgetcourse_overviewfiles($courseid) as $file) {\n\t\t$isimage = $file->is_valid_image();\n\t\t$url = file_encode_url(\"$CFG->wwwroot/pluginfile.php\",\n\t\t'/'. $file->get_contextid(). '/'. $file->get_component(). '/'.\n\t\t$file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);\n\t\tif ($isimage) {\n\t\t\t$contentimage = html_writer::empty_tag('img', array('src' => $url, 'alt' => 'Course Image '. $course->fullname,'class' => 'card-img-top w-100'));\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (empty($contentimage)) {\n\t\t$url = $CFG->wwwroot . \"/theme/\".$CFG->theme.\"/pix/default_course.jpg\";\n\t\t$contentimage = html_writer::empty_tag('img', array('src' => $url, 'alt' => 'Course Image '. $course->fullname,'class' => 'card-img-top w-100'));\n\t}\n\treturn $contentimage;\n}", "function _imageTitle($img) {\n global $ID;\n\n // some fixes on $img['src']\n // see internalmedia() and externalmedia()\n list($img['src']) = explode('#', $img['src'], 2);\n if($img['type'] == 'internalmedia') {\n resolve_mediaid(getNS($ID), $img['src'], $exists ,$this->date_at, true);\n }\n\n return $this->_media(\n $img['src'],\n $img['title'],\n $img['align'],\n $img['width'],\n $img['height'],\n $img['cache']\n );\n }", "function GetImage()\n {\n //Obtient les images par défaut de chaque produit de la fiche\n $ficheProduct = new EeCommerceFicheProductProduct($this->Core);\n $ficheProduct->AddArgument(new Argument(\"EeCommerceFicheProductProduct\", \"FicheId\", EQUAL, $this->IdEntite));\n $products = $ficheProduct->GetByArg();\n \n $html = \"<div>\";\n \n foreach($products as $product)\n {\n $img = new Image($product->Product->Value->ImageDefault->Value);\n $img->Alt = $img->Title = $product->Product->Value->NameProduct->Value;\n \n $html .= \"<div class='col-md-4' >\" . $img->Show().\"</div>\"; \n }\n \n $html .= \"</div>\";\n \n return $html;\n \n }", "public function GetPageImage()\n {\n $imageID = $this->GetImageFromPageTable();\n if (is_null($imageID)) {\n $imageID = $this->GetImageFromDivisionTable();\n }\n\n $oImage = null;\n if (!is_null($imageID)) {\n /** @var $oImage TCMSImage */\n $oImage = new TCMSImage();\n $oImage->Load($imageID);\n }\n\n return $oImage;\n }", "function extract_image_url($text,$pageTitle) {\r\n\t $text = trim(preg_replace(\"/<[^>]+>/\",\" \",$text));\r\n\r\n \tif (preg_match_all(\"/(\\[\\[image:)([^\\]\\|]*)(\\|[^\\]]*)?\\]\\]/i\", $text, $match)) {\r\n\t \t$name = $match[2][0];\r\n\t \tif (preg_match(\"/\\{\\{logo\\}\\}/\",$name)) {\r\n\t \t$name = ucwords(strtolower($pageTitle)).\".png\";\r\n\t }\r\n\t\t} else if (preg_match_all(\"/([a-z0-9_ -]+\\.)(?:jpe?g|png|gif)/i\", $text, $match)) {\r\n\t $name = $match[0][0];\r\n\t }\r\n\t if (!isset($name)) return null;\r\n\t\treturn $this->make_image_url($name);\r\n\t}", "public function getMetaImage() {\n return (isset($this->metaImage) && $this->metaImage!='') ? $this->metaImage : LOGO;\n }" ]
[ "0.63247466", "0.6130827", "0.6121675", "0.61037827", "0.608119", "0.60653335", "0.605454", "0.59207773", "0.59084535", "0.5888933", "0.58692646", "0.58255994", "0.58178234", "0.58129114", "0.58096987", "0.57675207", "0.5737811", "0.57258177", "0.5707907", "0.5690064", "0.5682436", "0.56807685", "0.5638178", "0.56294036", "0.56279474", "0.5596201", "0.5541986", "0.55392325", "0.55361456", "0.55290985" ]
0.6395539
0
Get the Grouping page image template
public function getImageTemplate() { return $this->imageTemplate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function GetPageImage()\n {\n $imageID = $this->GetImageFromPageTable();\n if (is_null($imageID)) {\n $imageID = $this->GetImageFromDivisionTable();\n }\n\n $oImage = null;\n if (!is_null($imageID)) {\n /** @var $oImage TCMSImage */\n $oImage = new TCMSImage();\n $oImage->Load($imageID);\n }\n\n return $oImage;\n }", "public function template()\n {\n return $this->getView('flagrow.download.templates::image-preview');\n }", "abstract public function getTemplate();", "function getTemplate();", "function display_full_image_template($classified_id)\n {\n if (!$classified_id) {\n return false;\n }\n $db = DataAccess::getInstance();\n $listing = geoListing::getListing($classified_id);\n if ($listing && $listing->category) {\n $template_category = (int)$listing->category;\n } else {\n return false;\n }\n\n $view = geoView::getInstance();\n $view->setCategory((int)$template_category);\n //don't do the template stuff, let view class do that...\n //just set the vars\n $template_file = $view->getTemplateAttachment('84_detail', $this->language_id, $template_category);\n\n $this->get_image_data($db, $classified_id, 1);\n reset($this->images_to_display);\n\n $images = array();\n\n foreach ($this->images_to_display as $value) {\n $tpl = new geoTemplate(geoTemplate::MAIN_PAGE, '');\n\n //check any full sized image limits\n if (\n ($value[\"original_image_width\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH) ||\n ($value[\"original_image_height\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT)\n ) {\n if (($value[\"original_image_width\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH) && ($value[\"original_image_height\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT)) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH * 100) / $value[\"original_image_width\"];\n $imagevsize = ($value[\"original_image_height\"] * $imageprop) / 100 ;\n $image_width = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH;\n $image_height = ceil($imagevsize);\n\n if ($image_height > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT * 100) / $value[\"original_image_height\"];\n $imagehsize = ($value[\"original_image_width\"] * $imageprop) / 100 ;\n $image_height = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT;\n $image_width = ceil($imagehsize);\n }\n } elseif ($value[\"original_image_width\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH * 100) / $value[\"original_image_width\"];\n $imagevsize = ($value[\"original_image_height\"] * $imageprop) / 100 ;\n $image_width = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH;\n $image_height = ceil($imagevsize);\n } elseif ($value[\"original_image_height\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT * 100) / $value[\"original_image_height\"];\n $imagehsize = ($value[\"original_image_width\"] * $imageprop) / 100 ;\n $image_height = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT;\n $image_width = ceil($imagehsize);\n } else {\n $image_width = $value[\"original_image_width\"];\n $image_height = $value[\"original_image_height\"];\n }\n } else {\n $image_width = $value[\"original_image_width\"];\n $image_height = $value[\"original_image_height\"];\n }\n\n if ($value['icon']) {\n $image = \"<a href=\\\"\" . $value['url'] . \"\\\"><img src=\\\"\" . geoTemplate::getUrl('', $value['icon']) . \"\\\" alt=\\\"\\\" style=\\\"border: none;\\\" /></a>\";\n } else {\n $image = \"<img src='{$value[\"url\"]}' alt='' />\";\n }\n\n $tpl->assign('full_size_image', $image);\n if (strlen($value[\"image_text\"]) > 0) {\n $text = \"<br />\" . $value[\"image_text\"];\n $tpl->assign('full_size_text', $text);\n }\n\n $images[] = $tpl->fetch($template_file);\n }\n return $images;\n }", "public function getTemplate() {}", "public function getGroupByPage() {}", "public function getTemplatesHtml()\n\t{\n\t\t$path = 'global/slider/content/custom/groups';\n\n\t\t$templates = '';\n\t\tforeach (Mage::getConfig()->getNode($path)->children() as $group) {\n\t\t\t$templates .= $this->getChildHtml($group->getName() .'_content_type'). \"\\n\" ;\n\t\t}\n\n\t\treturn $templates;\n\t}", "function getTemplateHierarchy($template) {\n\t\t// whether or not .php was added\n\t\t$template_slug = rtrim($template, '.php');\n\t\t$template = $template_slug . '.php';\n\t\t\n\t\tif ( $theme_file = locate_template(array('image-widget/'.$template)) ) {\n\t\t\t$file = $theme_file;\n\t\t} else {\n\t\t\t$file = 'views/' . $template;\n\t\t}\n\t\treturn apply_filters( 'sp_template_image-widget_'.$template, $file);\n\t}", "public function getPrimaryImageOfPage()\n {\n return $this->primaryImageOfPage;\n }", "protected function GetImageFromDivisionTable()\n {\n $imageID = null;\n $activePage = $this->getActivePageService()->getActivePage();\n $oDivision = $activePage->getDivision();\n\n if (null !== $oDivision && is_array($oDivision->sqlData) && array_key_exists('images', $oDivision->sqlData)) {\n $oDivisionImages = $oDivision->GetImages('images');\n\n if ($oDivisionImages->Length() > 0) {\n /** @var $oImage TCMSImage */\n if ($this->bPickRandomImage) {\n $oImage = $oDivisionImages->Random();\n } else {\n $oImage = $oDivisionImages->Current();\n }\n $imageID = $oImage->id;\n }\n }\n\n return $imageID;\n }", "function get_gallery_single_template( $single_template ) {\n\n\tglobal $post;\n\n\tif ( $post->post_type == 'gallery' ) {\n\t\t$single_template = dirname( __FILE__ ) . '/templates/single-gallery.php';\n\t}\n\treturn $single_template;\n}", "public function getImage()\n\t{\n\t\treturn $this->generator->render($this->generateCode(), $this->params);\n\t}", "public function getGathercontentTemplate();", "function get_mob_template_imgs($mob_oper) {\n return $this->Trader_mdl->get_mobprefix($mob_oper);\n }", "public function getTemplatePathname() : string {\n\t\treturn $this->templateBasePath . '/linklist-group.mustache';\n\t}", "public function getNewsModalTemplates()\n {\n return $this->getTemplateGroup('news_');\n }", "function get_paged_template()\n {\n }", "function get_template()\n {\n }", "function pageGroup() {\n $thisDir = pathinfo($_SERVER['PHP_SELF'], PATHINFO_DIRNAME);\n $thisPage = pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME);\n\n $result = '';\n\n if (($thisDir == '/') && ($thisPage == 'index.php')) {\n $result = 'Home';\n }\n else if ($thisDir == '/why-choose-us') {\n $result = 'Why Choose Us?';\n }\n else if (($thisDir == '/big-button-cell-phone') && ($thisPage == 'index.php')) {\n $result = 'Phone';\n }\n else if ($thisDir == '/senior-cell-phone-plans') {\n $result = 'Plans';\n }\n else if ($thisDir == '/shop') {\n $result = 'Shop';\n }\n else if ($thisDir == '/catalog') {\n $result = 'Shop';\n }\n else if ($thisDir == '/one-call') {\n $result = 'oneCall';\n }\n else if ($thisDir == '/activate') {\n $result = 'Activate Phone';\n }\n\n return $result;\n //error_log(\"result: \" . $result);\n }", "function get_templ_image($post_id,$size='thumbnail') {\r\n\r\n\tglobal $post;\r\n\t/*get the thumb image*/\t\r\n\t$thumbnail = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post_id ), $size ) ;\t\r\n\tif($thumbnail[0]!='')\r\n\t{\r\n\t\t$image_src=$thumbnail[0];\t\t\r\n\t}else\r\n\t{\r\n\t\t$post_img_thumb = bdw_get_images_plugin($post_id,$size); \r\n\t\t$image_src = $post_img_thumb[0]['file'];\r\n\t}\t\r\n\treturn $image_src;\r\n}", "function GetImage()\n {\n //Obtient les images par défaut de chaque produit de la fiche\n $ficheProduct = new EeCommerceFicheProductProduct($this->Core);\n $ficheProduct->AddArgument(new Argument(\"EeCommerceFicheProductProduct\", \"FicheId\", EQUAL, $this->IdEntite));\n $products = $ficheProduct->GetByArg();\n \n $html = \"<div>\";\n \n foreach($products as $product)\n {\n $img = new Image($product->Product->Value->ImageDefault->Value);\n $img->Alt = $img->Title = $product->Product->Value->NameProduct->Value;\n \n $html .= \"<div class='col-md-4' >\" . $img->Show().\"</div>\"; \n }\n \n $html .= \"</div>\";\n \n return $html;\n \n }", "function bethel_add_image_to_pages() {\n\tglobal $post;\n\tif ($post) {\n\t\t$image_id = get_post_thumbnail_id ($post->ID);\n\t\tif ($image_id) {\n\t\t\tif ($post->post_type != 'bethel_stories' && $post->page_template != 'stories.php') {\n\t\t\t\t$image = wp_get_attachment_image_src($image_id, 'bethel_supersize');\n\t\t\t\tif ($image) {\n\t\t\t\t\tif ($image[1] < 800) { //width\n\t\t\t\t\t\t$image[2] = round($image [2] / $image[1] * 800);\n\t\t\t\t\t}\n\t\t\t\t\t$image[2] = ($image[2] > 400) ? 400 : $image[2]; //height\n\t\t\t\t\techo \"<style type=\\\"text/css\\\">.entry-header { height: {$image[2]}px; background-image: url('{$image[0]}')}</style>\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\techo \"<style type=\\\"text/css\\\">\n .content .entry-header { margin-top: 75px; margin-top: 7.5rem }\n .content .entry-content { padding-top: 25px; padding-top: 2.5rem; }\n </style>\";\n\t\t}\n\t}\n}", "function get_header_image()\n {\n }" ]
[ "0.606352", "0.606352", "0.606352", "0.606352", "0.606352", "0.606352", "0.60310316", "0.60152334", "0.5967853", "0.58967674", "0.58528733", "0.5826934", "0.57025737", "0.5688037", "0.5671982", "0.56544805", "0.5644574", "0.5632341", "0.5596304", "0.55674213", "0.556342", "0.5535117", "0.55079395", "0.54976696", "0.5495515", "0.5471671", "0.5462954", "0.54624003", "0.54622966", "0.5458241" ]
0.69365734
0
Get the Grouping page description of more info html
public function getDescriptionMoreInfoHtml() { return $this->descriptionMoreInfoHtml; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function description()\n\t{\n\t\t$txt = array();\n\t\t$txt['wiki'] = \"Displays group events\";\n\t\t$txt['html'] = '<p>Displays group events.</p>';\n\t\t$txt['html'] = '<p>Examples:</p>\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(number=3)]]</code> - Displays the next three group events</li>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(title=Group Events, number=2)]]</code> - Adds title above event list. Displays 2 events.</li>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(id=123)]]</code> - Displays single group event with ID # 123</li>\n\t\t\t\t\t\t\t</ul>';\n\t\treturn $txt['html'];\n\t}", "public function description()\n\t{\n\t\t$txt = array();\n\t\t$txt['wiki'] = 'Generates a link to a random page.';\n\t\t$txt['html'] = '<p>Generates a link to a random page.</p>';\n\t\treturn $txt['html'];\n\t}", "public function get_description () {\r\n\t\t$content = file_get_contents($this->url);\r\n\t\t$regex = preg_match('/<p id=\"eow-description\" class=\"\" >(.*)<\\/p>/i', $content, $matches);\r\n\t\treturn $matches[1];\r\n\t}", "static public function getDescription() {\n\t\treturn self::$page_description;\n\t}", "public abstract function get_html();", "abstract function get_html();", "public function options_page_overview() \n\t\t{\n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach( $this->size_groups as $size_group => $sizes ) \n\t\t\t{\n\t\t\t\t$html .= '<h3>' . $this->get_group_headline( $size_group ) . '</h3>';\n\t\t\t\t\n\t\t\t\t$html .= '<ul>';\n\t\t\t\t\n\t\t\t\tforeach( $sizes as $key => $image ) \n\t\t\t\t{\n\t\t\t\t\t$info = $image['width'] . '*' . $image['height'];\n\t\t\t\t\tif( isset( $image['crop'] ) && true === $image['crop'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$info .= ' ' . __( '(cropped)', 'avia_framework' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$info .= ' - ' . $this->get_image_key_info( $key );\n\t\t\t\t\t\n\t\t\t\t\t$html .= '<li>' . $info . '</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '</ul>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "function getInfo ()\n\t{\n\t\t$node = $this->getElementsByTagname(\"MetaData\");\n\n\t\tif($node !== false)\n\t\t{\n\t\t\t$childs = $node[0]->child_nodes();\n\n\t\t\tforeach ($childs as $child)\n\t\t\t{\n\t\t\t\t\tif (($child->node_type() == XML_ELEMENT_NODE) && ($child->tagname == \"General\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t$childs2 = $child->child_nodes();\n\n\t\t\t\t\t\tforeach ($childs2 as $child2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($child2->node_type() == XML_ELEMENT_NODE) && ($child2->tagname == \"Title\" || $child2->tagname == \"Description\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$arr[$child2->tagname] = $child2->get_content();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// General-tag was found. Stop foreach-loop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// for compatibility reasons:\n\t\t$arr[\"title\"] = $arr[\"Title\"];\n\t\t$arr[\"desc\"] = $arr[\"Description\"];\n\n\t\treturn $arr;\n\t}", "public function getPageDescription()\n {\n $element = $this->query('meta[name=\"description\"]')->first();\n if ($element) {\n return $element->getAttribute('content');\n }\n\n return '';\n }", "function getDataDescription($data)\n{\n\t$dataDesc = getData($data, \"Page/Description\");\n\treturn $dataDesc[0];\n}", "public function getGroupDescription() : string\n {\n return $this->groupDescription;\n }", "public function detail(): string\n {\n return $this->groupDetail ?? '';\n }", "function PageSummaries_getHtml($id) {\n\t$PAGEDATA=Page::getInstance($id);\n\tglobal $sitedomain;\n\t$r=dbRow('select * from page_summaries where page_id=\"'.$PAGEDATA->id.'\"');\n\tif (!count($r)) {\n\t\treturn '<em>'.__(\n\t\t\t'This page is marked as a page summary, but there is no '\n\t\t\t.'information on how to handle it.'\n\t\t)\n\t\t\t.'</em>';\n\t}\n\tif ($r['rss']) {\n\t\treturn PageSummaries_rssToHtml($r['rss']);\n\t}\n\t// { build rss\n\t$title=($PAGEDATA->title=='')\n\t\t?$sitedomain\n\t\t:htmlspecialchars($PAGEDATA->title);\n\t$rss='<'.'?xml version=\"1.0\" ?'.'><rss version=\"2.0\"><channel><title>'\n\t\t.$title.'</title>';\n\t$rss.='<link>'.$_SERVER['REQUEST_URI'].'</link><description>RSS for '\n\t\t.$PAGEDATA->name.'</description>';\n\t$category=$PAGEDATA->category?' and category=\"'.$PAGEDATA->category.'\"':'';\n\t$containedpages=PageSummaries_getContainedPages($r['parent_id']);\n\tif (count($containedpages)) {\n\t\t$q2=dbAll(\n\t\t\t'select edate,name,title,body from pages where id in ('\n\t\t\t.join(',', $containedpages).')'.$category.' order by cdate desc limit 20'\n\t\t);\n\t\tforeach ($q2 as $r2) {\n\t\t\t$rss.='<item>';\n\t\t\tif (!$r2['title']) {\n\t\t\t\t$r2['title']=$r2['name'];\n\t\t\t}\n\t\t\t$rss.='<title>'.htmlspecialchars($r2['title']).'</title>';\n\t\t\t$rss.='<pubDate>'.Core_dateM2H($r2['edate']).'</pubDate>';\n\t\t\t// { build body\n\t\t\tif ($r['amount_to_show']==0 || $r['amount_to_show']==1) {\n\t\t\t\t$length=$r['amount_to_show']==0?300:600;\n\t\t\t\t$body=substr(\n\t\t\t\t\tpreg_replace(\n\t\t\t\t\t\t'/<[^>]*>/',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t\tarray('&amp;', '&nbsp;', '&lsquo;'),\n\t\t\t\t\t\t\tarray('&',' ','&apos;'),\n\t\t\t\t\t\t\t$r2['body']\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t0,\n\t\t\t\t\t$length\n\t\t\t\t)\n\t\t\t\t.'...';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$body=$r2['body'];\n\t\t\t}\n\t\t\t$body=str_replace('&euro;', '&#8364;', $body);\n\t\t\t// }\n\t\t\t$rss.='<description>'.$body.'</description>';\n\t\t\t$rss.='<link>http://'.$_SERVER['HTTP_HOST'].'/'\n\t\t\t\t.urlencode(str_replace(' ', '-', $r2['name'])).'</link>';\n\t\t\t$rss.='</item>';\n\t\t}\n\t}\n\t$rss.='</channel></rss>';\n\tdbQuery(\n\t\t'update page_summaries set rss=\"'.addslashes($rss)\n\t\t.'\" where page_id=\"'.$PAGEDATA->id.'\"'\n\t);\n\t// }\n\treturn PageSummaries_rssToHtml($rss);\n}", "function get_group_description($group) {\n\tglobal $home_locale, $current_locale;\n\tif ($home_locale == $current_locale\n\t\t\t|| !isset($group['vccommondescription'])\n\t\t\t|| !$group['vccommondescription']) {\n\t\treturn $group['vclocaldescription'];\n\t} else {\n\t\treturn $group['vccommondescription'];\n\t}\n}", "public function getInfoHtml()\n {\n return $this->getInfoBlock()->toHtml();\n }", "public function getInfo()\n {\n ob_start();\n echo '<h3>ForWeb framework Page package</h3>';\n echo '<p>Contain main page rendering functions and database tables:</p>';\n echo '<ul>';\n echo '<li>Pages table</li>';\n echo '<li>Templates table</li>';\n echo '<li>Blocks table</li>';\n echo '<li>Includes table</li>';\n echo '</ul>';\n $out = ob_get_contents();\n ob_end_clean();\n return $out;\n }", "public function pageContent()\r\n\t{\r\n\t\t$this->displayList();\r\n\t\t$content = '\r\n<div align=\"center\"><table width=\"60%\" border=\"1\" class=\"infoView\">\r\n <tbody>\r\n <tr>\r\n <th scope=\"col\">Manage a Department</th>\r\n </tr>\r\n \t '.$this->dList.'\r\n </tbody>\r\n</table></div>\r\n\t\t';\r\n\t\treturn $content;\r\n\t}", "function getDescription() {\r\n\t\treturn 'Lets you determine how many comments to show on item page, what order to show them in and provides pagination of results';\r\n\t}", "public function testDetailPageContent() \n {\n $this->visit('/detail/brandonvega/')\n ->see('<strong>Title:</strong>')\n ->see('<strong>Email:</strong> <a href=\"mailto:')\n ->see('<strong>Telephone:</strong> <a href=\"tel:')\n ->see('<strong>Office Address:</strong>')\n ->see('<strong>Mailing Address:</strong>');\n }", "function DF_read_more($matches) {\r\n\treturn '<p>'.$matches[1].'</p><p><a '.$matches[3].' class=\"more-link\"><i class=\"icon-double-angle-right\"></i>'.$matches[4].'</a></p> ';\r\n}", "private function getDetailedDescription($classInfo) {\n\t\t$class = file_get_html($classInfo->getCourseLink());\n\t\t\n\t\t// page is broken up into 2 sections: top and bottom. Below are the HTML Nodes for Top section and bottom section\n\t\t$top = $class->find('section[id=main] div[class=gray-noise-box pad-box no-sides]', 0);\n\t\t$bottom = $class->find('section[id=main] div[class=light-bg pad-box no-sides top-rule-box]', 0);\n\t\t\n\t\t// get image url\n\t\t$imageURL = $this->getClassImageURL($top);\n\t\t\n\t\t// get course title\n\t\t$title = $top->find('div.course-detail-info h2', 0)->text();\n\t\t\n\t\t// start and end dates\n\t\t$startDate = $this->getStartDate($top);\n\t\t$endDate = $this->getEndDate($top);\n\n\t\t// get price of this class\n\t\t$price = $this->getClassPrice($top);\n\n\t\t// get full class description\n\t\t$description = $this->getFullDescription($bottom);\n\t\t\n\t\t// get prof name\n\t\t$profName = $this->getProfName($bottom);\n\t\t\n\t\t// get prof image\n\t\t$profImage = $this->getProfImage($bottom);\n\t\t\n\t\t// get class category\n\t\t$category = $this->getClassCategory($class);\n\t\t\n\t\t// get class status\n\t\t$isFull = $this->getClassStatus($top);\n\t\t\n\t\t// get class duration in weeks\n\t\t$duration = $this->getClassDuration($startDate, $endDate);\n\t\t\n\t\t$classInfo->setTitle(trim($title));\n\t\t$classInfo->setLongDescription(trim($description));\n\t\t$classInfo->setVideoLink(\"\");\n\t\t$classInfo->setStartDate($startDate);\n\t\t$classInfo->setCourseLength($duration);\n\t\t$classInfo->setCategory(\"Science\");\n\t\t$classInfo->setCourseImage($imageURL);\n\t\t$classInfo->setProfName($profName);\n\t\t$classInfo->setProfImage($profImage);\n\t\t\n\t\t#return $retVal;\n\t}", "public function property_overview_desc() {\n\n\t\t\t$short_description_1 = get_field( 'short_description_1' );\n\t\t\t$short_description_2 = get_field( 'short_description_2' );\n\n\t\t\t$out = '<h6>Overview Description:</h6>';\n\t\t\t$out .= '<p>';\n\t\t\t$out .= ( get_field( 'advertisement_package' ) == '165' )\n\t\t\t\t? $short_description_1\n\t\t\t\t: $short_description_2;\n\t\t\t$out .= '</p>';\n\t\t\t$out .= '<div class=\"hr hr-default\"><span class=\"hr-inner \"><span class=\"hr-inner-style\"></span></span></div>';\n\n\t\t\tif ( $this->add_package == 3 ) {\n\t\t\t$out .= '<h3>Practice Details:</h3>';\n\t\t\t}\n\n\t\t\treturn $out;\n\t\t}", "function get_html()\n\t{\n\n\t// incrase views\n\n\t}", "public function getGroupDescription()\n {\n return $this->__get(self::FIELD_GROUP_DESCRIPTION);\n }", "abstract public function getHtml();", "protected function renderInformationContent() {}", "function emc_the_cpt_description(){\r\n\r\n\t$desc = get_page_by_path( 'description', OBJECT, 'emc_content_focus' );\r\n\t$html = apply_filters( 'the_content', $desc->post_content );\r\n\techo $html;\r\n\r\n}", "function get_site_description() {\r\n\t?>\r\n\t\t<div id=\"title-description\" class=\"five3-font\">Meal Replacement<br/>Energy Drink Mix</div>\r\n\t<?php\r\n}", "public function get_moduleinfo_output() {\n\n global $CFG, $DB, $OUTPUT;\n require_once($CFG->libdir . '/filelib.php');\n\n $result = '';\n\n // Now build HTML\n if (! empty ($this->data->module_code)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_code', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_code);\n \t$result .= html_writer::end_tag('p');\n }\n if (! empty ($this->data->module_level)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_level', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_level);\n \t$result .= html_writer::end_tag('p');\n }\n if (! empty ($this->data->module_credit)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_credit', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_credit);\n \t$result .= html_writer::end_tag('p');\n }\n if (! empty ($this->data->module_semester)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_semester', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_semester);\n \t$result .= html_writer::end_tag('p');\n }\n\n // If by this stage result is still empty then display a warning.\n if(empty($result)) {\n $result .= html_writer::tag('p', get_string( 'missing_module', 'block_module_info'), array('class'=>'missing_module'));\n }\n\n return $result;\n\n }", "public function getDescription() {\r\n\t\t$tmp_body = strip_tags($this -> body);\r\n\t\t$description = Engine_Api::_() -> ynblog() -> subPhrase($tmp_body, 150);\r\n\t\treturn $description;\r\n\t}" ]
[ "0.65902627", "0.62305623", "0.6092215", "0.6064208", "0.6004666", "0.59977794", "0.59437317", "0.5936913", "0.5925137", "0.58859575", "0.5874702", "0.58557254", "0.5845434", "0.5817111", "0.5805628", "0.5800575", "0.5799283", "0.57827085", "0.5751813", "0.5749961", "0.5734186", "0.5729453", "0.5686248", "0.56841207", "0.5661133", "0.56369364", "0.5626642", "0.5623676", "0.56173754", "0.561252" ]
0.66243196
0
Get the Grouping page special header class name
public function getSpecialHeaderClassName() { return $this->specialHeaderClassName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function voyage_mikado_header_class($classes) {\n\t\t$header_type = voyage_mikado_get_meta_field_intersect('header_type', voyage_mikado_get_page_id());\n\n\t\t$classes[] = 'mkdf-'.$header_type;\n\n\t\treturn $classes;\n\t}", "public function getGroupHeader()\n {\n if (is_null($this->groupHeader)) {\n $this->groupHeader = new SEPAGroupHeader();\n }\n\n return $this->groupHeader;\n }", "function publisher_get_header_layout_class() {\n\n\t\tstatic $class;\n\n\t\tif ( isset( $class ) ) {\n\t\t\treturn $class;\n\t\t}\n\n\t\t$class = '';\n\t\t$layout = publisher_get_header_layout();\n\n\t\t$class_map = array(\n\t\t\t'boxed' => 'boxed',\n\t\t\t'full-width' => 'full-width',\n\t\t\t'stretched' => 'full-width stretched',\n\t\t\t'out-full-width' => 'full-width',\n\t\t\t'out-stretched' => 'full-width stretched',\n\t\t);\n\n\t\tif ( isset( $class_map[ $layout ] ) ) {\n\n\t\t\t$class = $class_map[ $layout ];\n\t\t}\n\n\t\treturn $class;\n\t}", "public function getHeaderClass() {\n if (null != $this->headerClass) {\n return $this->headerClass;\n }\n $_ve = $this->getValueExpression(\"headerClass\");\n if ($_ve != null) {\n return $_ve->getValue($this->getFacesContext()->getELContext());\n } else {\n return null;\n }\n }", "public function get_name()\n {\n return 'section-heading';\n }", "function header_class( $class = '' ) {\n\techo 'class=\"' . join( ' ', get_header_class( $class ) ) . '\"';\n}", "public function get_header()\n\t{\n\t\t$header\t\t=\t$this->lang->get_line( \"controller_title\", $this->table );\n\t\tif ( !$header )\n\t\t{\n\t\t\t$header\t\t=\t( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t$controller\t=\t$this->singlepack->get_controller( $header );\n\t\t\tif ( !$controller )\n\t\t\t{\n\t\t\t\treturn ucfirst( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $controller->nome; // str_replace( '_', ' ', $header );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $header;\n\t\t}\n\t}", "function get_body_class($classes){\n $group=groups_get_current_group();\n \n if(!empty($group))\n $classes[]='is-single-group';\n\n return $classes;\n\n\n }", "function wprt_feature_title_heading_classes() {\n\t// Define classes\n\t$classes = '';\n\n\t// Get topbar style\n\tif ( wprt_get_mod( 'featured_title_heading_shadow' ) ) {\n\t\t$classes .= 'has-shadow';\n\t}\n\n\t// Return classes\n\treturn esc_attr( $classes );\n}", "function get_page_heading()\n {\n return $this->object->get_page_title();\n }", "function flatsome_header_title_classes(){\n echo implode(' ', apply_filters( 'flatsome_header_title_class', array() ) );\n}", "protected function getGroupName() {\n\t\treturn 'tilesheet';\n\t}", "function cs_subheader_classes( $header_banner_selection = ''){\n\tif ($header_banner_selection == \"No Image\") {\n \techo 'cs-no-image';\n }elseif($header_banner_selection == 'Custom Image'){\n\t\techo 'cs-custom-image';\n\t} elseif ($header_banner_selection == \"Default Image\") {\n \techo \"default-image\";\n } else {\n \techo \"default-image\";\n }\n}", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "function flatsome_header_classes(){\n echo implode(' ', apply_filters( 'flatsome_header_class', array() ) );\n}", "function voyage_mikado_header_behaviour_class($classes) {\n\n\t\t$classes[] = 'mkdf-'.voyage_mikado_options()->getOptionValue('header_behaviour');\n\n\t\treturn $classes;\n\t}", "protected function getPageClassName()\n {\n return ContainerPage::className();\n }", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function getPageHeader()\n\t{\n\t\treturn $this->_pageHeader;\n\t}", "public function CustomClassName()\n\t{\n\t\tif ($this->CopyContentFromID > 0) {\n\t\t\tif ($this->CopyContentFrom()->ClassName == \"NavigationModule\") {\n\t\t\t\treturn \"NavigationModule_\" . $this->CopyContentFrom()->ModuleLayout;\n\t\t\t} else {\n\t\t\t\treturn $this->CopyContentFrom()->ClassName;\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->ClassName;\n\t\t}\n\t}", "function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}", "public function get_name() {\n return 'apr_modern_heading';\n }", "function PageHead($d,$e) {\n\n print \"<header class=\\\"$e\\\">\\n\";\n print \"<H1>$d</H1>\\n\";\n print \"</header>\\n\";\n\n}", "public function getTabTitle()\r\n {\r\n return __('General Group');\r\n }", "public function GetHeader()\n {\n return $this->HeaderName;\n }", "public function getClassName() ;", "function Name(){\n\t\tif(!$this->title) {\n\t\t\t$fs = $this->FieldSet();\n\t\t\t$compositeTitle = '';\n\t\t\t$count = 0;\n\t\t\tforeach($fs as $subfield){\n\t\t\t\t$compositeTitle .= $subfield->Name();\n\t\t\t\tif($subfield->Name()) $count++;\n\t\t\t}\n\t\t\tif($count == 1) $compositeTitle .= 'Group';\n\t\t\treturn ereg_replace(\"[^a-zA-Z0-9]+\",\"\",$compositeTitle);\n\t\t}\n\n\t\treturn ereg_replace(\"[^a-zA-Z0-9]+\",\"\",$this->title);\t\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nGROUP BY Command\nMAINHEADING;\n }", "function macro_get_class_repo_header($path)\n{\n $ns = explode('\\\\', macro_convert_path_to_class_name($path));\n array_pop($ns);\n $ns = implode('\\\\', $ns);\n\n return macro_get_file_header($path)\n . <<<HEAD\nnamespace $ns;\n\n\nHEAD;\n}", "public function getTagsHeaderName()\n {\n return $this->headerFormatter->getTagsHeaderName();\n }" ]
[ "0.683053", "0.6637812", "0.65224344", "0.64930576", "0.6322837", "0.6313183", "0.6256681", "0.61974657", "0.6134622", "0.61165714", "0.6082234", "0.6048214", "0.602517", "0.598934", "0.59839225", "0.5978656", "0.5940422", "0.5926847", "0.591176", "0.589264", "0.5875535", "0.58600813", "0.58493996", "0.5841686", "0.5812467", "0.57574147", "0.57522804", "0.5716632", "0.5705041", "0.5694507" ]
0.70012313
0
Get the Grouping page intro supplement html
public function getIntroSupplementHtml() { return $this->introSupplementHtml; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_html()\n\t{\n\n\t// incrase views\n\n\t}", "public function getSplashBlock() {\r\n\t\t$html = '<p>Personnel handles the storing & presentation of faculty & staff records.</p>';\r\n\t\t$html .= '<p><b>Available Shortcode:</b><br /><code>[ofa-personnel][/ofa-personnel]</code></p>';\r\n\t\t$html .= '<p><b>Shortcode Attributes:</b><br /><code>view=\"list-all\"</code> (default)</br /><code>view=\"profile\"</code><br /><code>search=\"true\"</code><br /><code>search=\"false\"</code> (default)<br /><code>groupid=\"#\"</code> (The ID of the group to list)</p>';\r\n\t\treturn $html;\r\n\t}", "abstract function get_html();", "public abstract function get_html();", "abstract public function getHtml();", "public function getHtml();", "public function getIntro();", "function employees_baseline_html() {\r\n $baseline = '<section id=\"get-more\" class=\"get-more\">';\r\n $baseline .= '<a href=\"#\" class=\"get-more-employees\">Load More</a>';\r\n $baseline .= '<div class=\"ajax-loader\"><img src=\"' . plugin_dir_url( __FILE__ ) . 'css/spinner.svg\" width=\"32\" height=\"32\" /></div>';\r\n $baseline .= '</section><!-- .get-more -->';\r\n return $baseline;\r\n}", "function getHTML()\n\t{\t\t\t\t\n\t\t// getHTML() is called by ilRepositoryGUI::show()\n\t\tif($this->id_type == self::REPOSITORY_NODE_ID)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// there is no way to do a permissions check here, we have no wsp\n\t\t\n\t\t$this->filterInactivePostings();\n\t\t\n\t\t$list_items = $this->getListItems();\t\t\n\t\t\n\t\t$list = $nav = \"\";\n\t\tif($list_items)\n\t\t{\t\t\t\t\n\t\t\t$list = $this->renderList($list_items, \"previewEmbedded\");\n\t\t\t$nav = $this->renderNavigation($this->items, \"gethtml\", \"previewEmbedded\");\n\t\t}\t\t\n\t\t\n\t\treturn $this->buildEmbedded($list, $nav);\t\t\n\t}", "public function getHTML();", "public function options_page_overview() \n\t\t{\n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach( $this->size_groups as $size_group => $sizes ) \n\t\t\t{\n\t\t\t\t$html .= '<h3>' . $this->get_group_headline( $size_group ) . '</h3>';\n\t\t\t\t\n\t\t\t\t$html .= '<ul>';\n\t\t\t\t\n\t\t\t\tforeach( $sizes as $key => $image ) \n\t\t\t\t{\n\t\t\t\t\t$info = $image['width'] . '*' . $image['height'];\n\t\t\t\t\tif( isset( $image['crop'] ) && true === $image['crop'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$info .= ' ' . __( '(cropped)', 'avia_framework' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$info .= ' - ' . $this->get_image_key_info( $key );\n\t\t\t\t\t\n\t\t\t\t\t$html .= '<li>' . $info . '</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '</ul>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "function get_html_pre_page_end();", "public function getHTML() {\n\t\tglobal $tpl;\n\n $tpl->addCss(\n 'Customizing/global/plugins/Services/Repository/RepositoryObject/'\n . 'Review/templates/default/css/Review.css'\n );\n $path_to_il_tpl = ilPlugin::getPluginObject(\n IL_COMP_SERVICE,\n 'Repository',\n 'robj',\n 'Review'\n )->getDirectory();\n $custom_tpl = new ilTemplate(\n \"tpl.aspect_row.html\",\n true,\n true,\n $path_to_il_tpl\n );\n\t\tforeach ($this->si_guis as $si_gui) {\n\t\t\t$si_gui->insert($custom_tpl);\n\t\t}\n\t\treturn $custom_tpl->get();\n\t}", "function training_page_html() {\n return t('This is the landing page of the Training module');\n}", "public function get_content_html()\n {\n\n ob_start();\n RP_SUB_Help::include_template($this->template_html, array_merge($this->template_variables, array('plain_text' => false)));\n return ob_get_clean();\n }", "public static function help_inner () \n { \n $html = null;\n\n $top = __( 'Instruction Manual', 'label' );\n $inner = self::help_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'help', $top, $inner, $bottom );\n\n return $html;\n }", "public function getIntro()\n {\n return $this->getData('intro') ?? '';\n }", "public function intro(){\n\t\t$html = \"\";\n\t\t$html.= '\n\t\t<div class=\"row description\">\n\t\t\t<div class=\"small-12 large-12 columns\">\n\t\t\t\t\t<h1>Actualites</h1>\n\t\t\t\t<hr/>\n\t\t\t</div>\n\t\t\t<div class=\"small-8 large-8 columns\">\n\t\t\t\t<div class=\"center\">\n\t\t\t\t\t<h2>Qu\\'est ce qui ce trame en Altraya ?</h2>\n\t\t\t\t</div>\n\t\t\t\t<hr/>\n\t\t\t\t<p>- Ajout d\\'une fonctionnalité d\\'élevage : la reproduction</p>\n\t\t\t</div>\n\t\t\t<div class=\"small-4 large-4 columns\">\n\t\t\t\t<a class=\"twitter-timeline\" href=\"https://twitter.com/Karakayne\" data-widget-id=\"579726233640005632\">Tweets de @Karakayne</a>\n\t\t\t\n\t\t\t\t<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\\'http\\':\\'https\\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\"://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t';\n\n\t\techo($html);\n\t}", "function showIntro() {\n if (! $_SESSION[\"eligible\"]) {\n return $this->showStart();\n }\n $nexturl = $this->action . '?mode=details';\n $safety = $this->action . '?mode=safety';\n $extra = array('next' => $nexturl, 'safetyurl' => $safety);\n $output = $this->outputBoilerplate('introduction.html', $extra);\n return $output;\n }", "public static function GetExtendedSearchHtml() {\n return <<<html\n<div class=\"col3 alignRight\"><span data-target=\"#ExtendedSearch\" class=\"linkPseudo blockLabel contentToggle\"><span>Расширенный поиск</span></span></div>\nhtml;\n }", "public function getHtml()\n {\n return $this->_getHtml();\n }", "public function get_html() {\n\t\treturn wp_json_encode( $this->context->to_array(), JSON_PRETTY_PRINT );\n\t}", "function &renderIntro( )\r\n {\r\n $generator =& $this->generator();\r\n \r\n return $generator->renderIntro();\r\n }", "function wp_credits_section_title($group_data = array())\n {\n }", "protected function getContents()\n {\n $contents = $this->crawler->filter('.page.group');\n if (!$contents->count()) {\n return;\n }\n\n $contents = $contents->html();\n\n // I'll have my own syntax highlighting, WITH BLACKJACK AND HOOKERS\n $this->crawler->filter('pre')->each(function ($code) use (&$contents) {\n $unformatted = htmlentities($code->text());\n $unformatted = '<pre><code class=\"php\">'.$unformatted.'</code></pre>';\n $contents = str_replace('<pre class=\"code php\">'.$code->html().'</pre>', $unformatted, $contents);\n });\n\n return $contents;\n }", "public function getGathercontentTemplate();", "public function getHtmlTemplate() {}", "function get_html_header();", "function &getHTML()\n\t{\n\t\tinclude_once(\"./Services/PersonalDesktop/classes/class.ilBookmarkBlockGUI.php\");\n\t\t$bookmark_block_gui = new ilBookmarkBlockGUI(\"ilpersonaldesktopgui\", \"show\");\n\t\t\n\t\treturn $bookmark_block_gui->getHTML();\n\t}", "function RBTM_RelPost_baseline_html() {\n\t// Set up container etc\n\t$baseline = '<section id=\"related-posts\" class=\"related-posts\">';\n\t$baseline .= '<a href=\"#\" class=\"get-related-posts\">Get related posts</a>';\n \t$baseline .= '<div class=\"ajax-loader\"><img src=\"' . plugin_dir_url( __FILE__ ) . 'css/spinner.svg\" width=\"32\" height=\"32\" /></div>';\n\t$baseline .= '</section><!-- .related-posts -->';\n\n\treturn $baseline;\n}" ]
[ "0.62485236", "0.62111086", "0.6011276", "0.5994408", "0.58516866", "0.58427656", "0.58406705", "0.581698", "0.5804497", "0.57989424", "0.5778012", "0.5756614", "0.57398367", "0.573101", "0.5701372", "0.5694383", "0.56618476", "0.56567687", "0.5638123", "0.5607691", "0.56018394", "0.5594832", "0.5591007", "0.55856013", "0.5581815", "0.55243886", "0.5521838", "0.5503277", "0.5500992", "0.54951876" ]
0.6681547
0
Get the Grouping page popup html
public function getPopupHtml() { return $this->popHtml; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function group_link_popup() {\n $r = '<div id=\"group-link-popup-container\" style=\"display: none\"><div id=\"group-link-popup\">';\n $r .= '<p>' . lang::get('Send this link to other people to allow them to view or join this group.') . '</p>';\n $r .= '<textarea style=\"width: 100%;\" id=\"share-link\" rows=\"4\"></textarea>';\n $r .= '</div></div>';\n return $r;\n }", "public function getPopupContent();", "public function getPopup() {}", "public function options_page_overview() \n\t\t{\n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach( $this->size_groups as $size_group => $sizes ) \n\t\t\t{\n\t\t\t\t$html .= '<h3>' . $this->get_group_headline( $size_group ) . '</h3>';\n\t\t\t\t\n\t\t\t\t$html .= '<ul>';\n\t\t\t\t\n\t\t\t\tforeach( $sizes as $key => $image ) \n\t\t\t\t{\n\t\t\t\t\t$info = $image['width'] . '*' . $image['height'];\n\t\t\t\t\tif( isset( $image['crop'] ) && true === $image['crop'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$info .= ' ' . __( '(cropped)', 'avia_framework' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$info .= ' - ' . $this->get_image_key_info( $key );\n\t\t\t\t\t\n\t\t\t\t\t$html .= '<li>' . $info . '</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '</ul>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "public function GalleriesDisplay()\n\t{\tob_start();\n\t\techo '<div class=\"mmdisplay\"><div id=\"mmdContainer\">', $this->GalleriesTable(), '</div><script type=\"text/javascript\">$().ready(function(){$(\"body\").append($(\".jqmWindow\"));$(\"#rlp_modal_popup\").jqm();});</script>',\n\t\t\t'<!-- START instructor list modal popup --><div id=\"rlp_modal_popup\" class=\"jqmWindow\" style=\"padding-bottom: 5px; width: 640px; margin-left: -320px; top: 10px; height: 600px; \"><a href=\"#\" class=\"jqmClose submit\">Close</a><div id=\"rlpModalInner\" style=\"height: 500px; overflow:auto;\"></div></div></div>';\n\t\treturn ob_get_clean();\n\t}", "public abstract function getDatasetPopupHtml():string;", "public function displayPage()\n {\n $this->getState()->template = 'displaygroup-page';\n }", "private function get_reporting_block_html()\n {\n if (! $this->assignment->get_allow_group_submissions())\n {\n return $this->get_reporting_data_html(AssignmentSubmission::SUBMITTER_TYPE_USER);\n }\n else\n {\n $type = Request::get(self::PARAM_TYPE);\n \n if ($type == null)\n {\n $type = self::TYPE_COURSE_GROUP;\n }\n switch ($type)\n {\n case self::TYPE_COURSE_GROUP :\n return $this->get_reporting_data_html(AssignmentSubmission::SUBMITTER_TYPE_COURSE_GROUP);\n case self::TYPE_GROUP :\n return $this->get_reporting_data_html(AssignmentSubmission::SUBMITTER_TYPE_PLATFORM_GROUP);\n }\n }\n }", "function member_groups_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-groups.php\" );\r\n }", "public function getGroupByPage() {}", "public abstract function getDatasetFilterPopupHtml():string;", "public function group_find_main_screen_function() {\n\t\t// add title and content here - last is to call the members plugin.php template.\n\t\t\\add_action( 'bp_template_content', array( $this, 'group_find_main_content_action' ) );\n\t\t\\bp_core_load_template( \\apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t\t// echo do_shortcode ( '[youzer_groups per_page=\"10\"]' );\n\t}", "function popup_elements()\n\t\t{\n\t\t\t\n\t\t}", "protected function page_popup () {\n\t\t$skeleton = make::tpl ('skeleton.basic');\n\n\t\t/**\n\t\t * Fetch the body content template\n\t\t */\n\t\t$body = make::tpl ('body.login-widget.popup');\n\n\t\t/**\n\t\t * Fetch the page details\n\t\t */\n\t\t/*$page = new page('terms');*/\n\n\t\t/**\n\t\t * Build the output\n\t\t */\n\t\t$skeleton->assign (\n\t\t\tarray (\n\t\t\t\t'title'\t\t\t=> /*$page->title()*/'Login Widget',\n\t\t\t\t'keywords'\t\t=> /*$page->keywords()*/'',\n\t\t\t\t'description'\t=> /*$page->description()*/'',\n\t\t\t\t'body'\t\t\t=> $body\n\t\t\t)\n\t\t);\n\n\t\toutput::as_html($skeleton,true);\n\n\t}", "public function getGridParentHtml()\n {\n $templateName = Mage::getDesign()->getTemplateFilename($this->_parentTemplate, array('_relative'=>true));\n return $this->fetchView($templateName);\n }", "function getGroupName() {\n\t\treturn 'pagetools';\n\t}", "function getHTML()\n\t{\t\t\t\t\n\t\t// getHTML() is called by ilRepositoryGUI::show()\n\t\tif($this->id_type == self::REPOSITORY_NODE_ID)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// there is no way to do a permissions check here, we have no wsp\n\t\t\n\t\t$this->filterInactivePostings();\n\t\t\n\t\t$list_items = $this->getListItems();\t\t\n\t\t\n\t\t$list = $nav = \"\";\n\t\tif($list_items)\n\t\t{\t\t\t\t\n\t\t\t$list = $this->renderList($list_items, \"previewEmbedded\");\n\t\t\t$nav = $this->renderNavigation($this->items, \"gethtml\", \"previewEmbedded\");\n\t\t}\t\t\n\t\t\n\t\treturn $this->buildEmbedded($list, $nav);\t\t\n\t}", "public function getTemplatesHtml()\n\t{\n\t\t$path = 'global/slider/content/custom/groups';\n\n\t\t$templates = '';\n\t\tforeach (Mage::getConfig()->getNode($path)->children() as $group) {\n\t\t\t$templates .= $this->getChildHtml($group->getName() .'_content_type'). \"\\n\" ;\n\t\t}\n\n\t\treturn $templates;\n\t}", "function pageGroup() {\n $thisDir = pathinfo($_SERVER['PHP_SELF'], PATHINFO_DIRNAME);\n $thisPage = pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME);\n\n $result = '';\n\n if (($thisDir == '/') && ($thisPage == 'index.php')) {\n $result = 'Home';\n }\n else if ($thisDir == '/why-choose-us') {\n $result = 'Why Choose Us?';\n }\n else if (($thisDir == '/big-button-cell-phone') && ($thisPage == 'index.php')) {\n $result = 'Phone';\n }\n else if ($thisDir == '/senior-cell-phone-plans') {\n $result = 'Plans';\n }\n else if ($thisDir == '/shop') {\n $result = 'Shop';\n }\n else if ($thisDir == '/catalog') {\n $result = 'Shop';\n }\n else if ($thisDir == '/one-call') {\n $result = 'oneCall';\n }\n else if ($thisDir == '/activate') {\n $result = 'Activate Phone';\n }\n\n return $result;\n //error_log(\"result: \" . $result);\n }", "public static function printGallery() {\r\n\t\t$elts = Acid::mod('Photo')->dbList(array(array('active','=',1)),array('pos'=>'ASC'));\r\n\t\treturn Acid::tpl('pages/gallery.tpl',array('elts'=>$elts),Acid::mod('Photo'));\r\n\t}", "abstract public function getPanelGroup();", "function showPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilCtrl;\n\t\t\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t$grps = ilPageEditorSettings::getGroups();\n\t\t\n\t\t$this->cgrp = $_GET[\"grp\"];\n\t\tif ($this->cgrp == \"\")\n\t\t{\n\t\t\t$this->cgrp = key($grps);\n\t\t}\n\n\t\t$ilCtrl->setParameter($this, \"grp\", $this->cgrp);\n\t\t$ilTabs->setSubTabActive(\"adve_grp_\".$this->cgrp);\n\t\t\n\t\t$this->initPageEditorForm();\n\t\t$tpl->setContent($this->form->getHtml());\n\t}", "function getHTML()\n\t{\n\t\tswitch ($this->cmd) {\n\t\t\tcase \"updateSiteImportTable\" :\n\t\t\t\treturn $this->_updateSiteImportTable();\n\t\t\t\tbreak;\n\t\t\tcase \"createWePageSettings\" :\n\t\t\t\treturn $this->_getCreateWePageSettingsHTML();\n\t\t\t\tbreak;\n\t\t\tcase \"saveWePageSettings\" :\n\t\t\t\treturn $this->_getSaveWePageSettingsHTML();\n\t\t\t\tbreak;\n\t\t\tcase \"content\" :\n\t\t\t\treturn $this->_getContentHTML();\n\t\t\t\tbreak;\n\t\t\tcase \"buttons\" :\n\t\t\t\treturn $this->_getButtonsHTML();\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\treturn $this->_getFrameset();\n\t\t}\n\t}", "function layout_preview_links($data, $channel_id)\n{\n $layout_preview_links = \"<p>\" . ee()->lang->line('choose_layout_group_preview') . NBS . \"<span class='notice'>\" . ee()->lang->line('layout_save_warning') . \"</span></p>\";\n $layout_preview_links .= \"<ul class='bullets'>\";\n foreach ($data->result() as $group) {\n $layout_preview_links .= '<li><a href=\\\"' . BASE . AMP . 'C=content_publish' . AMP . \"M=entry_form\" . AMP . \"channel_id=\" . $channel_id . AMP . \"layout_preview=\" . $group->group_id . '\\\">' . $group->group_title . \"</a></li>\";\n }\n $layout_preview_links .= \"</ul>\";\n\n return $layout_preview_links;\n}", "public function getSplashBlock() {\r\n\t\t$html = '<p>Personnel handles the storing & presentation of faculty & staff records.</p>';\r\n\t\t$html .= '<p><b>Available Shortcode:</b><br /><code>[ofa-personnel][/ofa-personnel]</code></p>';\r\n\t\t$html .= '<p><b>Shortcode Attributes:</b><br /><code>view=\"list-all\"</code> (default)</br /><code>view=\"profile\"</code><br /><code>search=\"true\"</code><br /><code>search=\"false\"</code> (default)<br /><code>groupid=\"#\"</code> (The ID of the group to list)</p>';\r\n\t\treturn $html;\r\n\t}", "public function getPopup() { \n if($this->blocks) {\n return $this->desc . \"<BR />&nbsp;<BR />\" . \n \"<b>Blocks\" . \n ($this->charges > 0 ? \" \" . $this->charges . \" more\" : \"\") .\n ($this->blockActionTypes != \"all\" ? $this->blockActionTypes : \"\") . \" actions\" . \n ($this->blockChance < 1 ? \" with a chance of \" . floor($this->blockChance * 100) . \"%\" : \"\") . \n ($this->turns > 0 ? \" within the next \" . $this->turns . \" rounds\" : \"\") .\n \".\";\n }\n return $this->desc;\n }", "public function getPanel()\n {\n if (!$this->auth->hasIdentity()) {\n $html = '<h4>No identity</h4>';\n } else {\n $html = '<h4>Identity</h4>';\n $html .= $this->cleanData($this->auth->getIdentity());\n }\n\n return $html;\n }", "public static function manager_inner () \n { \n $html = null;\n\n $top = self::manager_inner_top();\n $inner = self::manager_inner_center();\n $bottom = self::manager_inner_bottom();\n\n $html .= self::page_body( 'manager', $top, $inner, $bottom );\n\n return $html;\n }", "public function getHTML()\n {\n static::addPageResources(array(\n 'js' => '/lib/js/jquery.hoverIntent.js'\n ));\n\n list($large_conf, $small_conf) = $this->getItemsConfs();\n\n $items = $this->getItemIDs();\n\n $large = Client::getItems($items, $large_conf);\n $small = Client::getItems($items, $small_conf);\n\n if (!is_array($small)) return;\n if (!is_object($small[0])) return;\n\n if (!is_array($large)) return;\n if (!is_object($large[0])) return;\n\n $small[0]->class = $large[0]->class = \"first selected\";\n\n $data = array(\n 'folders_path' => $this->folder->path,\n 'transition' => $this->transition,\n 'delay' => $this->delay,\n 'autohide' => $this->auto_hide_toolbar ? 'yes' : 'no',\n 'autostart' => $this->autostart ? 'true' : 'false',\n 'enlarge' => $this->enlarge,\n 'controls' => $this->controls,\n 'captions' => $this->captions,\n 'main' => $large,\n 'thumbs' => $small,\n 'width' => $this->width,\n 'height' => $this->height\n );\n\n return $this->html = static::getMustache('slideshow', $data);\n }", "public function index() {\n\t\t$data = Group::get()->map( function ( $s ) {\n\t\t\treturn [\n\t\t\t\t'id' => $s->id,\n\t\t\t\t'name' => $s->getShortName(),\n\t\t\t\t'content' => $s->getShortContent(),\n\t\t\t\t'created_at' => $s->created_at_formatted,\n\t\t\t\t'created_at_time' => $s->created_at_time,\n\t\t\t\t'active' => $s->getActiveFullResponse()\n\t\t\t];\n\t\t} );\n\n\t\t$this->page->response = $data;\n\t\t$this->page->create_option = 1;\n\t\treturn view('pages.settings.parts.groups.index' )\n\t\t\t->with( 'Page', $this->page );\n\t}" ]
[ "0.6723676", "0.64861923", "0.6319084", "0.6128063", "0.61273724", "0.6080793", "0.59977853", "0.5755861", "0.57258224", "0.56997746", "0.5687457", "0.5664227", "0.5656377", "0.5650595", "0.5648252", "0.5640764", "0.56347835", "0.56125414", "0.55917865", "0.5569221", "0.556492", "0.5557425", "0.5552808", "0.55498207", "0.5545803", "0.554246", "0.55220056", "0.5514304", "0.547351", "0.5470311" ]
0.6543845
1
Used to get listings based off of a location on the page. Example: 'grid' will return all listings on the grouping page grid (aka subcategories)
public function getListings($location) { $stmt = NULL; $results = NULL; switch ($location) { case 'grid': $sql = "SELECT t.pagetype AS type, c.id AS id, n.nickname AS nickname, IF(COUNT(c.id) > 0, TRUE, FALSE) AS validity, c.name AS name, u.url AS short_url, t.template_secure AS secure, c.slug AS slug, t.template_filename AS filename, c.id AS canonical, c.page_title AS title, c.meta_description AS meta_description, c.meta_keywords AS meta_keywords, c.page_heading AS heading, t.allow_target AS allow_target, t.requires_login AS requires_login, t.disallow_guests AS disallow_guests, c.sitemap_show AS visibility, c.sitemap_page_priority AS priority, c.sitemap_page_change_frequency AS change_frequency, c.* FROM bs_subcategories c JOIN bs_pagetypes t LEFT JOIN bs_page_urls u ON (u.id = c.canonical_page_url AND u.pagetype = t.pagetype AND u.pageid = c.id) LEFT JOIN bs_groupings grp ON (grp.id = c.grouping_id) LEFT JOIN bs_categories cat ON (cat.id = grp.category_id) LEFT JOIN bs_page_nicknames n ON (t.pagetype = n.pagetype AND c.id = n.pageid) WHERE cat.active = TRUE AND grp.active = TRUE AND c.active = TRUE AND grp.id = ? AND t.pagetype = 'subcategory' GROUP BY c.id ORDER BY c.position ASC, c.name ASC"; break; case 'sidebar': $sql = "SELECT t.pagetype AS type, c.id AS id, n.nickname AS nickname, IF(COUNT(c.id) > 0, TRUE, FALSE) AS validity, c.name AS name, u.url AS short_url, t.template_secure AS secure, c.slug AS slug, t.template_filename AS filename, c.id AS canonical, c.page_title AS title, c.meta_description AS meta_description, c.meta_keywords AS meta_keywords, c.page_heading AS heading, t.allow_target AS allow_target, t.requires_login AS requires_login, t.disallow_guests AS disallow_guests, c.sitemap_show AS visibility, c.sitemap_page_priority AS priority, c.sitemap_page_change_frequency AS change_frequency, grp.accessory FROM bs_subcategories c JOIN bs_pagetypes t LEFT JOIN bs_page_urls u ON (u.id = c.canonical_page_url AND u.pagetype = t.pagetype AND u.pageid = c.id) LEFT JOIN bs_groupings grp ON (grp.id = c.grouping_id) LEFT JOIN bs_categories cat ON (cat.id = grp.category_id) LEFT JOIN bs_page_nicknames n ON (t.pagetype = n.pagetype AND c.id = n.pageid) WHERE cat.active = TRUE AND grp.active = TRUE AND c.active = TRUE AND grp.id = ? AND t.pagetype = 'subcategory' GROUP BY c.id ORDER BY c.name ASC"; break; } $stmt = Connection::getHandle()->prepare($sql); if( $stmt->execute(array ($this->getId())) ) { while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $results[] = $row; } } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getListByLocation()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t//$this->addFilter(\"entity_type\", 6, true); // exclude events from tag cloud\r\n $this->addFilter(\"entity_type\", 2); // get tags for groups Only\r\n\t\t\treturn parent::getList(\"name\", \"@count\");\r\n\t\t} else {\r\n\t\t\techo 3;exit;\r\n\t\t\tif ( $this->getGroupId() !== null ) {\r\n\t\t\t\t$this->addWhere('group_id = ?', $this->getGroupId());\r\n\t\t\t}\r\n\t\t\t$where = $this->getWhere();\r\n\t\t\tif ($where) $where = 'where '.$where;\r\n\t\t\t$fields = array();\r\n\t\t\tif ( $this->isAsAssoc() ) {\r\n\t\t\t\t$fields[] = ( $this->getAssocKey() === null ) ? 'name' : $this->getAssocKey();\r\n\t\t\t\t$fields[] = ( $this->getAssocValue() === null ) ? 'rating' : $this->getAssocValue();\r\n\t\t\t} else {\r\n\t\t\t\t$fields[] = 'id';\r\n\t\t\t}\r\n\t\t\t$fields = implode(', ', $fields);\r\n\t\t\t$limit = \"\";\r\n\t\t\tif ( $this->getCurrentPage() !== null && $this->getListSize() !== null ) {\r\n\t\t\t\t$limit = \"LIMIT \".(($this->getCurrentPage()-1) * $this->getListSize()) .\", \". $this->getListSize();\r\n\t\t\t}\r\n\t\t\t$order = \"\";\r\n\t\t\tif ( $this->getOrder() !== null ) {\r\n\t\t\t\t$order = \"ORDER BY \".$this->getOrder();\r\n\t\t\t}\r\n\r\n\t\t\t$query = \"SELECT distinct {$fields} FROM (\r\n\t#get groups tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 2 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\tUNION\r\n\t#get documents tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 5 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id FROM zanby_documents__items\r\n\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get members tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 1 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT user_id FROM zanby_groups__members\r\n\t\t\t\t\t WHERE group_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\tUNION\r\n\t#get events tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 6 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\tSELECT id FROM zanby_event__items\r\n\t\t\t\t\t\tWHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\tIN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get photos tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\tIN (\r\n\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t WHERE entity_type_id = 4 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id from zanby_galleries__photos\r\n\t\t\t\t\t WHERE gallery_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT id FROM zanby_galleries__items\r\n\t\t\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t\t\tSELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t\t\t )\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t )\r\n\t\t)\r\n\tUNION\r\n\t#get lists tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 20 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\tSELECT id FROM zanby_lists__items\r\n\t\t\t\t\t\tWHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\tIN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get lists items tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\tIN (\r\n\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t WHERE entity_type_id = 21 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id from zanby_lists__records\r\n\t\t\t\t\t WHERE list_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT id FROM zanby_lists__items\r\n\t\t\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t\t\tSELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t\t\t )\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t )\r\n\t\t)\r\n\t)\r\n\tAS result {$order} {$limit}\";\r\n\r\n\t\t\t$items = $this->getTagListFromSQL($query);\r\n\t\t}\r\n return $items;\r\n }", "function _syndicated_content_listings_page()\n{\n}", "public function getLocations()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Location (Linnworks API)');\n\t\t}", "public function getListings($pageSize = 250, $pageNum = 1, $filter = NULL, $displayAmenities = FALSE) {\n if (empty($filter)) {\n // Default filter which should return all listings.\n $filter = SimpleViewFilter::filterAllListings();\n }\n\n $response = $this->getData('getListings', [\n $pageSize,\n $pageNum,\n $filter,\n $displayAmenities,\n ]);\n if (!empty($response['DATA'])) {\n foreach ($response['DATA'] as &$listing) {\n $listing = $this->parseListing($listing);\n }\n }\n\n return $response;\n }", "public static function location_listing($location_id,$limit = 15)\n {\n \n \n\n $query = \"SELECT id, category_id,created_by, title,description, url, featured_image, create_time,primary_phone,primary_email,\n\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.city = 9jb_locations.id) AS city_name,\n (SELECT fa_icon FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS icon,\n (SELECT color FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS color,\n (SELECT title FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS category_name,\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.state = 9jb_locations.id) AS state_name,\n (SELECT count(*) FROM 9jb_reviews WHERE 9jb_reviews.listing_id = 9jb_listings.id) AS reviews\n\n FROM 9jb_listings\n WHERE (city = ? or state = ?) AND status='activated'\n ORDER BY create_time DESC LIMIT $limit \";\n\n return \\DB::select($query,[$location_id,$location_id]) ;\n }", "public function listing();", "public function my_listings(Request $request, Listing $listing = null)\n {\n // 'Private Seller 11', 'Financial Institution 39', 'Bank Liaison 3', 'Asset Manager 24', 'Consumer Direct 36'\n\n $listings = Listing::query()\n ->whereHas(\n 'users',\n fn ($builder) => $builder->where('user_id', auth()->user()->id)\n ->whereIn('group_id', [11, 39, 3, 24, 36])\n )\n ->when($request['sort_by'] && $request['sort_dir'], fn ($query) => $query->orderBy($request['sort_by'], $request['sort_dir']))\n ->get();\n\n if($listing)\n return view('frontend.dashboard.listings-stats', compact('listings', 'listing'));\n else\n return view('frontend.dashboard.my-listings', compact('listings'));\n }", "public function byLocationsAction() {\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('group')) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('group_main', array(), 'sitetagcheckin_main_grouplocation');\n $this->_helper->content->setEnabled();\n } elseif (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('advgroup')) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('advgroup_main', array(), 'sitetagcheckin_main_groupbylocation');\n $this->_helper->content->setEnabled();\n } else {\n return $this->_forward('notfound', 'error', 'core');\n }\n }", "public function listings(Request $request) {\n return redirect(route('home'));\n foreach($request->only(['lat', 'lng', 'bounds', 'location']) as $k => $v) {\n session([$k => $v]);\n }\n\n $data = $this->getListingData($request);\n if($request->get('ajax')) {\n return response()->json($data);\n }\n MetaTag::set('title', __(\"Browse listings\"));\n $reflFunc = new \\ReflectionFunction('active');\n $finder = $reflFunc->getFileName() . ':' .$reflFunc->getStartLine();\n //$data['finder'] = $finder;\n return view('scan.index', $data);\n }", "public function listLocations(Request $request)\n {\n// $docs = TourLocation::orderBy('id', 'DESC');\n// $docs = $docs->paginate($limit);\n// $total = $docs->total();\n// $data = [\n// 'docs' => TourLocationResource::collection($docs),\n// 'total' => $total,\n// ];\n// return $this->jsonApi(ResponseStatusCode::OK, __('flash.list_tour_location'), $data);\n }", "function locationsAction() {\n\t $this->_helper->layout->disableLayout();\n\t $this->_helper->viewRenderer->setNoRender(TRUE);\n\t $conn = Doctrine_Manager::connection(); \n \t$session = SessionWrapper::getInstance();\n \t$formvalues = $this->_getAllParams();\n \t// debugMessage($formvalues);\n \t// debugMessage($this->_getAllParams());\n \t\n \t \t$feed = '';\n \t$hasall = true;\n \t$issearch = false;\n \t$iscount = false;\n \t$ispaged = false;\n \t$where_query = \" \";\n \t$type_query = \" \";\n \t$group_query = \" GROUP BY l.id \";\n \t$limit_query = \"\";\n \t$select_query = \" l.id, l.name as `Location`, l.locationtype as `Type`,\n \t\tCASE `locationtype` \n \t\t\tWHEN '1' THEN 'Region' \n \t\t\tWHEN '2' THEN 'District' \n \t\t\tWHEN '3' THEN 'County' \n \t\t\tWHEN '4' THEN 'SubCounty' \n \t\t\tWHEN '5' THEN 'Parish' \n \t\t\tWHEN '6' THEN 'Village' \n \t\tEND AS `TypeName` \";\n \t$join_query = \"\";\n \t\n \tif(isArrayKeyAnEmptyString('filter', $formvalues)){\n \t\techo \"NO_FILTER_SPECIFIED\";\n \t\texit();\n \t}\n \t\n \t$isregion = false; $isdistrict = false; $iscounty = false; $issubcounty = false; $isparish = false; $isvillage = false;\n \t$loc_type = '';\n \t# fetch commodities filtered by categoryid\n \tif($formvalues['filter'] == 'type'){\n \t\tswitch ($this->_getParam('category')) {\n \t\t\tcase 'region':\n \t\t\tcase 1:\n \t\t\t\t$where_query .= \" AND l.locationtype = 1 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isregion = true;\n \t\t\t\tbreak;\n \t\t\tcase 'district':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 2 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isdistrict = true;\n\t\t\t \tif(!isArrayKeyAnEmptyString('regionid', $formvalues) || !isArrayKeyAnEmptyString('region', $formvalues)){\n\t\t\t \t\t\t$region = new Region();\n\t\t\t \t\t\tif(!isArrayKeyAnEmptyString('regionid', $formvalues)){\n\t\t\t\t \t\t$region->populate($formvalues['regionid']);\n\t\t\t\t \t\t// debugMessage(region->toArray());\n\t\t\t\t \t\tif(isEmptyString($region->getID()) || !is_numeric($formvalues['regionid'])){\n\t\t\t\t \t\t\techo \"REGION_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t\t \t\t$regid = $formvalues['regionid'];\n\t\t\t \t\t\t}\n\t\t\t \t\tif(!isEmptyString($this->_getParam('region'))){\n\t\t\t \t\t\t\t$regid = $region->findByName($formvalues['region'], 1);\n\t\t\t \t\t\tif(isEmptyString($regid)){\n\t\t\t\t \t\t\techo \"REGION_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t \t\t\t}\n\t\t\t \t\t$where_query .= \" AND l.regionid = '\".$regid.\"' \";\n\t\t\t \t}\n \t\t\t\tbreak;\n \t\t\tcase 'county':\n \t\t\tcase 3:\n \t\t\t\t$where_query .= \" AND l.locationtype = 3 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$iscounty = true;\n\t\t\t \tif(!isArrayKeyAnEmptyString('districtid', $formvalues) || !isArrayKeyAnEmptyString('district', $formvalues)){\n\t\t\t \t\t\t$district = new District();\n\t\t\t \t\t\tif(!isArrayKeyAnEmptyString('districtid', $formvalues)){\n\t\t\t\t \t\t$district->populate($formvalues['districtid']);\n\t\t\t\t \t\t// debugMessage($market->toArray());\n\t\t\t\t \t\tif(isEmptyString($district->getID()) || !is_numeric($formvalues['districtid'])){\n\t\t\t\t \t\t\techo \"DISTRICT_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t\t \t\t$distid = $formvalues['districtid'];\n\t\t\t \t\t\t}\n\t\t\t \t\t\tif(!isArrayKeyAnEmptyString('district', $formvalues)){\n\t\t\t \t\t\t\t$distid = $district->findByName($formvalues['district'], 2);\n\t\t\t \t\t\tif(isEmptyString($distid)){\n\t\t\t\t \t\t\techo \"DISTRICT_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t \t\t\t}\n\t\t\t \t\t$where_query .= \" AND l.districtid = '\".$distid.\"' \";\n\t\t\t \t}\n \t\t\t\tbreak;\n \t\t\tcase 'subcountry':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 4 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$issubcounty = true;\n \t\t\t\tbreak;\n \t\t\tcase 'parish':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 5 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isparish = true;\n \t\t\t\tbreak;\n \t\t\tcase 'village':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 6 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isvillage = true;\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\tbreak;\n \t\t}\n \t}\n \t\n \t// when fetching total results\n \tif(!isEmptyString($this->_getParam('fetch')) && $this->_getParam('fetch') == 'total'){\n \t\t$select_query = \" count(l.id) as records \";\n \t\t$group_query = \"\";\n \t\t$iscount = true;\n \t}\n \t\n \t// when fetching limited results via pagination \n \tif(!isEmptyString($this->_getParam('paged')) && $this->_getParam('paged') == 'Y'){\n \t\t$ispaged = true;\n \t\t$hasall = false;\n \t\t$start = $this->_getParam('start');\n \t\t$limit = $this->_getParam('limit');\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_START_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_START\";\n\t \t\texit();\n \t\t}\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_LIMIT_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_LIMIT\";\n\t \t\texit();\n \t\t}\n \t\t$limit_query = \" limit \".$start.\",\".$limit.\" \";\n \t}\n \t\n \t// \n \t$com_query = \"SELECT \".$select_query.\" FROM location l WHERE l.name <> '' \".$type_query.$where_query.\" \n \t\".$group_query.\" ORDER BY l.name ASC \".$limit_query;\n \tdebugMessage($com_query);\n \t\n \t$result = $conn->fetchAll($com_query);\n \t$comcount = count($result);\n \t// debugMessage($result); // exit();\n \t\n \tif($comcount == 0){\n \t\techo \"RESULT_NULL\";\n \t\texit();\n \t} else {\n \t\tif($iscount){\n \t\t\t$feed .= '<item>';\n\t \t\t$feed .= '<total>'.$result[0]['records'].'</total>';\n\t\t\t $feed .= '</item>';\n \t\t}\n \t\tif(!$iscount){\n\t \t\tforeach ($result as $line){\n\t\t\t \t$feed .= '<item>';\n\t\t \t\t$feed .= '<id>'.$line['id'].'</id>';\n\t\t \t\t$feed .= '<name>'.$line['Location'].'</name>';\n\t\t \t\t$feed .= '<type>'.$line['Type'].'</type>';\n\t\t\t \t$feed .= '<typename>'.$line['TypeName'].'</typename>';\n\t\t\t\t $feed .= '</item>';\n\t\t \t}\n \t\t}\n \t}\n \t\n \t# output the xml returned\n \tif(isEmptyString($feed)){\n \t\techo \"EXCEPTION_ERROR\";\n \t\texit();\n \t} else {\n \t\techo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><items>'.$feed.'</items>';\n \t}\n }", "public function getList($page);", "public function locations($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'locations', $_query);\r\n }", "public function findAllWithLocations()\n {\n $query = $this->createQuery();\n $fieldName = ((bool)ConfigurationUtility::getExtensionConfiguration()['enableFilterCategories']) ? 'filter_categories' : 'categories';\n $query->statement('\n SELECT DISTINCT\n sys_category.*\n FROM\n sys_category\n JOIN\n sys_category_record_mm\n ON sys_category_record_mm.uid_local = sys_category.uid\n WHERE\n sys_category_record_mm.tablenames = \"tx_locationmanager_domain_model_location\" AND\n sys_category_record_mm.fieldname = \"' . $fieldName . '\"\n GROUP BY\n sys_category.uid\n ');\n return $query->execute();\n }", "public function getLocations()\n {\n $conds = new CondsList();\n $conds->subjoin(new Param('post_type', '==', 'post'));\n $conds->subjoin(new Param('post_type', '==', 'page'));\n\n return $conds->toArray();\n }", "public function client_listings(Request $request, Listing $listing = null)\n {\n // 'Real Estate Agent', 'Listing Agent', 'RH Agent', 'Co-broke'\n\n $listings = Listing::query()\n ->whereHas(\n 'users',\n fn ($builder) => $builder->where('user_id', auth()->user()->id)\n ->whereIn('group_id', [6, 10, 38, 37])\n )\n ->when($request['sort_by'] && $request['sort_dir'], fn ($query) => $query->orderBy($request['sort_by'], $request['sort_dir']))\n ->get();\n\n if($listing)\n return view('frontend.dashboard.listings-stats', compact('listings', 'listing'));\n else\n return view('frontend.dashboard.client-listings', compact('listings'));\n\n }", "function permission_group_list($category, $offset, $limit, $phrase)\n\t{\n\t\tlog_message('debug', '_setting/permission_group_list');\n\t\tlog_message('debug', '_setting/permission_group_list:: [1] category='.$category.' offset='.$offset.' limit='.$limit.' phrase='.$phrase);\n\n\t\t$values['phrase_condition'] = !empty($phrase)? \" AND G.name LIKE '%\".htmlentities($phrase, ENT_QUOTES).\"%'\": '';\n\t\t$values['category_condition'] = $category != 'all'? \" AND G.group_category ='\".$category.\"' \": \"\";\n\t\t$values['limit_text'] = \" LIMIT \".$offset.\",\".$limit.\" \";\n\n\t\t$result = server_curl(IAM_SERVER_URL, array('__action'=>'get_list', 'query'=>'get_permission_group_list', 'variables'=>$values));\n\t\tlog_message('debug', '_setting/permission_group_list:: [2] result='.json_encode($result));\n\n\t\treturn $result;\n\t}", "public function getPageFolders();", "public function byLocation(string $location);", "public function travelListing() {\n\t\t$pageTitle = 'Travel Listing';\n\t\t$this->viewBuilder()->setLayout('homelayout');\n\t\t$this->loadModel('Travels');\n\n\t\t$travels = $this->Travels->find()->where(['Travels.published' => 1])->order(['Travels.created' => 'DESC'])->limit(3)->all();\n\n\t\t$this->set(compact('pageTitle', 'travels'));\n\t}", "function render_locations($locations = null) {\n $html = '';\n\n // If no locations specified, get all locations in alphabetical order.\n if ($locations == null) {\n $location_ids = get_posts(array(\n 'post_type' => 'location',\n 'post_status' => 'publish',\n 'orderby' => 'title',\n 'order' => 'ASC',\n 'posts_per_page' => -1,\n 'fields' => 'ids',\n ));\n\n foreach($location_ids as $loc) {\n $html .= get_location_card($loc);\n }\n\n echo $html;\n } else {\n foreach($locations as $loc) {\n $html .= get_location_card($loc['id'], $loc['distance']);\n }\n\n echo $html;\n }\n\n return;\n}", "public function load_pagination_listings() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_popup_pagination_listings\" );\n\n\t\t$html = forminator_template( 'settings/popup/edit-pagination-listings-content' );\n\n\t\twp_send_json_success( $html );\n\t}", "function field_group_location_list($field_group){\n \n if(!acf_maybe_get($field_group, 'location'))\n return $field_group;\n \n foreach($field_group['location'] as &$or){\n \n foreach($or as &$and){\n \n if(!isset($and['value']))\n continue;\n \n // Post Type List\n if($and['param'] === 'post_type' && acfe_ends_with($and['value'], '_archive')){\n \n $and['param'] = 'post_type_list';\n $and['value'] = substr_replace($and['value'], '', -8);\n \n }\n \n // Taxonomy List\n elseif($and['param'] === 'taxonomy' && acfe_ends_with($and['value'], '_archive')){\n \n $and['param'] = 'taxonomy_list';\n $and['value'] = substr_replace($and['value'], '', -8);\n \n }\n \n }\n \n }\n \n return $field_group;\n \n }", "public function findAllLocations(WP_REST_Request $request)\n {\n\n $args = [\n 'post_type' => 'session',\n 'status' => 'publish',\n 'posts_per_page' => -1,\n ];\n\n $query = new WP_Query($args);\n\n // one-liner to map the session object to an array of unique locations.\n // This needs to be revisited to see if WP_Query support getting this information\n // without having to iterate over every session post type.\n return array_values(\n array_unique(\n array_map(\n function (WP_Post $post): array {\n $session = new Session($post);\n $shortName = $session->getVenueShortname();\n $room = $session->getRoom();\n return [\n 'import_id' => str_replace([' ', '{', '}', '(', ')', '/', '\\\\', '@', ':'], '_', \"$shortName.$room\"),\n 'name' => \"$room, $shortName\",\n 'location_type' => 2\n ];\n },\n $query->get_posts()\n ),\n SORT_REGULAR)\n );\n\n }", "public function get_listing($path='', $page = '') {\n if (empty($path)) {\n $path = $this->build_node_path('root', get_string('pluginname', 'repository_googledrive'));\n }\n\n // We analyse the path to extract what to browse.\n $trail = explode('/', $path);\n $uri = array_pop($trail);\n list($id, $name) = $this->explode_node_path($uri);\n\n // Handle the special keyword 'search', which we defined in self::search() so that\n // we could set up a breadcrumb in the search results. In any other case ID would be\n // 'root' which is a special keyword set up by Google, or a parent (folder) ID.\n if ($id === 'search') {\n return $this->search($name);\n }\n\n // Query the Drive.\n $q = \"'\" . str_replace(\"'\", \"\\'\", $id) . \"' in parents\";\n $q .= ' AND trashed = false';\n $results = $this->query($q, $path);\n\n $ret = array();\n $ret['dynload'] = true;\n $ret['path'] = $this->build_breadcrumb($path);\n $ret['list'] = $results;\n return $ret;\n }", "public abstract function get_url_list($page_num, $object_subtype = '');", "function block_core_navigation_get_menu_items_at_location($location)\n {\n }", "function listing_location_taxonomy() {\n\n\t\t$name = __( 'Locations', 'wp_listings' );\n\t\t$singular_name = __( 'Location', 'wp_listings' );\n\n\t\treturn array(\n\t\t\t'locations' => array(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name'\t\t\t\t\t=> strip_tags( $name ),\n\t\t\t\t\t'singular_name' \t\t=> strip_tags( $singular_name ),\n\t\t\t\t\t'menu_name'\t\t\t\t=> strip_tags( $name ),\n\n\t\t\t\t\t'search_items'\t\t\t=> sprintf( __( 'Search %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'popular_items'\t\t\t=> sprintf( __( 'Popular %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'all_items'\t\t\t\t=> sprintf( __( 'All %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'edit_item'\t\t\t\t=> sprintf( __( 'Edit %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'update_item'\t\t\t=> sprintf( __( 'Update %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'add_new_item'\t\t\t=> sprintf( __( 'Add New %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'new_item_name'\t\t\t=> sprintf( __( 'New %s Name', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'add_or_remove_items'\t=> sprintf( __( 'Add or Remove %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'choose_from_most_used'\t=> sprintf( __( 'Choose from the most used %s', 'wp_listings' ), strip_tags( $name ) )\n\t\t\t\t),\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'rewrite' => array( __( 'locations', 'wp_listings' ), 'with_front' => false ),\n\t\t\t\t'editable' => 0\n\t\t\t)\n\t\t);\n\n\t}", "public static function allListings()\n {\n $listings = Listing::all();\n return $listings;\n }", "public function index(Request $request)\n {\n $draw = $request->post('draw', 1);\n\n $columns = array(\n 'Location', \n 'Shore'\n );\n \n $start = $request->post('start', 0);\n $length = $request->post('length', Location::$limit);\n \n $page = $start / $length + 1;\n \n $additionalInput = array('page' => $page);\n $request->merge($additionalInput);\n \n $predicates = array();\n\n $records = Location::getWithPredicates($predicates, $page);\n \n $resourceCollection = new LocationResourceCollection($records);\n\n $resourceCollection->additional([\n 'draw' => $draw,\n 'columns' => $columns\n ]);\n \n return $resourceCollection; \n }" ]
[ "0.62172973", "0.607114", "0.5840782", "0.5789351", "0.57889295", "0.57296777", "0.566635", "0.56627524", "0.564338", "0.56263614", "0.555925", "0.55474997", "0.5512467", "0.55071145", "0.5496947", "0.5473101", "0.5467323", "0.54619676", "0.54393935", "0.54306227", "0.54259634", "0.5422482", "0.5420676", "0.54160774", "0.54063153", "0.54041487", "0.5403311", "0.53748536", "0.53708637", "0.53678197" ]
0.78246146
0
/ Plugin Name: Facebook Share Feed Dialog Plugin URI: Description: This plugin creates a javascript function fb_share_feed_dialog(). You can use this function to let people post directly to their Timeline Version: 1.01 Author: The Anh Author URI:
function ta_share_fb_script() { wp_enqueue_script( 'social-share-fb', plugins_url('js/share-fb.js', __FILE__), array( 'jquery' ), '1.0.0', true ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function culturefeed_search_ui_add_facebook_share() {\n\n $fb_app_id = variable_get('culturefeed_search_ui_fb_app_id', '');\n if (!empty($fb_app_id)) {\n drupal_add_js(drupal_get_path('module', 'culturefeed') . '/js/facebook_share.js');\n drupal_add_js(array('culturefeed' => array('fbAppId' => $fb_app_id)), 'setting');\n }\n\n}", "function add_social_sharing() { ?>\r\n\t<h3>Share this post</h3>\r\n\t<ul class=\"share-buttons\">\r\n <li><a href=\"https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Flocalhost%2Ftestsite&t=Test%20site\" title=\"Share on Facebook\" target=\"_blank\" onclick=\"window.open('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.URL)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Facebook.png\"></a></li>\r\n <li><a href=\"https://twitter.com/intent/tweet?source=http%3A%2F%2Flocalhost%2Ftestsite&text=Test%20site:%20http%3A%2F%2Flocalhost%2Ftestsite\" target=\"_blank\" title=\"Tweet\" onclick=\"window.open('https://twitter.com/intent/tweet?text=' + encodeURIComponent(document.title) + ':%20' + encodeURIComponent(document.URL)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Twitter.png\"></a></li>\r\n <li><a href=\"https://plus.google.com/share?url=http%3A%2F%2Flocalhost%2Ftestsite\" target=\"_blank\" title=\"Share on Google+\" onclick=\"window.open('https://plus.google.com/share?url=' + encodeURIComponent(document.URL)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Google+.png\"></a></li>\r\n <li><a href=\"http://www.tumblr.com/share?v=3&u=http%3A%2F%2Flocalhost%2Ftestsite&t=Test%20site&s=\" target=\"_blank\" title=\"Post to Tumblr\" onclick=\"window.open('http://www.tumblr.com/share?v=3&u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.title)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Tumblr.png\"></a></li>\r\n <li><a href=\"http://pinterest.com/pin/create/button/?url=http%3A%2F%2Flocalhost%2Ftestsite&description=Test%20site\" target=\"_blank\" title=\"Pin it\" onclick=\"window.open('http://pinterest.com/pin/create/button/?url=' + encodeURIComponent(document.URL) + '&description=' + encodeURIComponent(document.title)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Pinterest.png\"></a></li>\r\n <li><a href=\"https://getpocket.com/save?url=http%3A%2F%2Flocalhost%2Ftestsite&title=Test%20site\" target=\"_blank\" title=\"Add to Pocket\" onclick=\"window.open('https://getpocket.com/save?url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Pocket.png\"></a></li>\r\n <li><a href=\"http://www.reddit.com/submit?url=http%3A%2F%2Flocalhost%2Ftestsite&title=Test%20site\" target=\"_blank\" title=\"Submit to Reddit\" onclick=\"window.open('http://www.reddit.com/submit?url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Reddit.png\"></a></li>\r\n <li><a href=\"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Flocalhost%2Ftestsite&title=Test%20site&summary=Test%20site&source=http%3A%2F%2Flocalhost%2Ftestsite\" target=\"_blank\" title=\"Share on LinkedIn\" onclick=\"window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/LinkedIn.png\"></a></li>\r\n <li><a href=\"http://wordpress.com/press-this.php?u=http%3A%2F%2Flocalhost%2Ftestsite&t=Test%20site&s=Test%20site\" target=\"_blank\" title=\"Publish on WordPress\" onclick=\"window.open('http://wordpress.com/press-this.php?u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.title)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Wordpress.png\"></a></li>\r\n <li><a href=\"https://pinboard.in/popup_login/?url=http%3A%2F%2Flocalhost%2Ftestsite&title=Test%20site&description=Test%20site\" target=\"_blank\" title=\"Save to Pinboard\" onclick=\"window.open('https://pinboard.in/popup_login/?url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Pinboard.png\"></a></li>\r\n <li><a href=\"mailto:?subject=Test%20site&body=Test%20site:%20http%3A%2F%2Flocalhost%2Ftestsite\" target=\"_blank\" title=\"Email\" onclick=\"window.open('mailto:?subject=' + encodeURIComponent(document.title) + '&body=' + encodeURIComponent(document.URL)); return false;\"><img src=\"http://your-wp-site.com/wp-content/themes/twentyfifteen-child/images/flat_web_icon_set/black/Email.png\"></a></li>\r\n</ul>\r\n\r\n<?php }", "function facebook_share_button($content){\n if(get_post_detail('url',false)!==''){\n $content .= '<div id=\"fb-root\"></div>\n <script>(function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=840986119244731&version=v2.0\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document,\\'script\\', \\'facebook-jssdk\\'));\n </script>\n <div class=\"fb-share-button\" data-href=\"'.WWW.get_post_detail('url',false).'.html\" data-layout=\"button\"></div>';\n }\n return $content;\n}", "function frame_share($provider, $post_id = null)\n{\n\n // $postid = url_to_postid( $url );\n\n $defaults = array(\n 'provider' => null,\n 'post_id' => $post_id,\n 'url' => ($post_id === null) ? $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] : get_permalink($post_id),\n 'title' => ($post_id === null) ? '' : get_the_title($post_id),\n 'description' => '',\n 'tags' => '',\n 'source' => ''\n );\n\n if (is_array($provider))\n {\n $args = wp_parse_args($provider, $defaults);\n }\n else if (is_string($provider))\n {\n\n }\n\n\n\n // Get the URL to share\n $url = ($post_id === null) ? $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] : get_permalink($post_id);\n $url = urlencode($url);\n\n switch($args['provider'])\n {\n case 'facebook':\n break;\n\n case 'google':\n break;\n\n case 'linkedin':\n break;\n\n case 'pinterest':\n break;\n\n case 'reddit':\n break;\n\n case 'twitter':\n break;\n\n default:\n break;\n }\n\n\n}", "function foucs_share_this_post($title,$permalink){\n\n\t$twitterHandler = ( get_option('twitter_handler') ? '&amp;via='.esc_attr( get_option('twitter_handler') ) : '' );\n\t\t\n\t$twitter = 'https://twitter.com/intent/tweet?text=Hey! Read this: ' . $title . '&amp;url=' . $permalink . $twitterHandler .'';\n\t$facebook = 'https://www.facebook.com/sharer/sharer.php?u=' . $permalink;\n\t$google = 'https://plus.google.com/share?url=' . $permalink;\n\t$pinterest = 'http://pinterest.com/pin/create/bookmarklet/?is_video=false&url=' . $permalink;\n\techo '<li><a href=\"'. $facebook .'\" target=\"_blank\" rel=\"nofollow\"><i class=\"fab fa-facebook-f\" aria-hidden=\"true\"></i></a></li>';\n\techo '<li><a href=\"'. $twitter .'\" target=\"_blank\" rel=\"nofollow\"><i class=\"fab fa-twitter\" aria-hidden=\"true\"></i></a></li>';\n\techo '<li><a href=\"'. $pinterest .'\" target=\"_blank\" rel=\"nofollow\"><i class=\"fab fa-pinterest\" aria-hidden=\"true\"></i></a></li>';\n\techo '<li><a href=\"'. $google .'\" target=\"_blank\" rel=\"nofollow\"><i class=\"fab fa-google-plus-g\" aria-hidden=\"true\"> </i></a></li>';\n\t\t\t\n}", "function widget_ffes_feed($args) {\r\n extract($args);\r\n $defaults = array('count' => 10, 'username' => 'wordpress');\r\n $options = (array) get_option('widget_ffes_feed');\r\n\r\n foreach ( $defaults as $key => $value )\r\n if ( !isset($options[$key]) )\r\n $options[$key] = $defaults[$key];\r\n//feed copy\r\n$feed_text = \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">document.write('<scr' + 'ipt language=\\\"JavaScript\\\" type=\\\"text/javascript\\\" src=\\\"http://www.familyfeatures.com/wordpress/food/foodhandler.ashx' + window.location.search + '\\\"></scr' + 'ipt>'\r\n);</script>\";\r\n ?>\r\n <?php echo $before_widget; ?>\r\n <?php echo $before_title . $options['title'] . $after_title; ?>\r\n <?php echo \"$feed_text\"; ?>\r\n <?php echo $after_widget; ?>\r\n<?php\r\n }", "function quasar_get_post_share($args=null){\n\tglobal $post;\n\t\t\n\t$social_html\t=\t'';\n\t$social_js\t\t=\t'';\n\t\n\tif($args && is_array($args)){\n\t\textract($args);\n\t}\n\t\t\n\t//Facebook\n\t$social_html\t.=\t'<div class=\"fb-like\" data-href=\"'.get_permalink().'\" data-width=\"90\" data-layout=\"button_count\" data-show-faces=\"false\" data-send=\"false\"></div>';\t\n\t$social_js\t\t.=\t'\n\t\t(function(d, s, id) {\n\t\t var js, fjs = d.getElementsByTagName(s)[0];\n\t\t if (d.getElementById(id)) return;\n\t\t js = d.createElement(s); js.id = id;\n\t\t js.src = \"//connect.facebook.net/en_US/all.js#xfbml=1\";\n\t\t fjs.parentNode.insertBefore(js, fjs);\n\t\t}(document, \"script\", \"facebook-jssdk\"));\n\t';\n\t\n\t//Twitter\n\t$social_html\t.=\t'<a href=\"https://twitter.com/share\" class=\"twitter-share-button\">Tweet</a>';\n\t$social_js\t\t.=\t'!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\"http\":\"https\";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\"://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document, \"script\", \"twitter-wjs\");';\n\n\t//Google+\n\t$social_html\t.=\t'<div class=\"g-plusone\" data-size=\"medium\"></div>';\n\t$social_js\t\t.=\t'\n\t (function() {\n\t\tvar po = document.createElement(\"script\"); po.type = \"text/javascript\"; po.async = true;\n\t\tpo.src = \"https://apis.google.com/js/plusone.js\";\n\t\tvar s = document.getElementsByTagName(\"script\")[0]; s.parentNode.insertBefore(po, s);\n\t })();\n\t';\n\t\n\t//Pinterest\n\t$social_html\t.=\t'<a href=\"//pinterest.com/pin/create/button/?url='.get_permalink().'&media='.get_permalink().'&description='.get_permalink().'\" data-pin-do=\"buttonPin\" data-pin-config=\"beside\"><img src=\"//assets.pinterest.com/images/pidgets/pin_it_button.png\" /></a>';\n\n\t\n\t$social_html\t=\tapply_filters('quasar_post_social_html',$social_html);\n\t$social_js\t\t=\tapply_filters('quasar_post_social_js',$social_js);\n\t\n\t$return\t\t=\t'';\n\t\n\t$return\t\t.=\t'<script type=\"text/javascript\">'.$social_js.'</script>';\n\t\n\t$return\t\t.=\t'<div class=\"quasar-post-social\">'.$social_html.'</div><div class=\"clear\"></div>';\n\t\n\treturn $return;\n}", "function ubiq_add_socialgraph() {\n if (!get_option('ubiq_fb_opengraph')) { return; }\n\n if (is_single()) {\n global $post;\n \n $image_id = get_post_thumbnail_id();\n $image_url = wp_get_attachment_image_src($image_id,'large', true);\n \n \n $content = $post->post_content;\n $content = strip_shortcodes( $content );\n \t\t$content = strip_tags($content);\n\t\t$excerpt_length = 55;\n\t\t$words = explode(' ', $content, $excerpt_length + 1);\n\t\tif(count($words) > $excerpt_length) :\n\t\t\tarray_pop($words);\n\t\t\tarray_push($words, '...');\n\t\t\t$content = implode(' ', $words);\n\t\tendif;\n \n ?>\n <meta property=\"og:title\" content=\"<?php the_title() ?>\"/>\n <meta property=\"og:type\" content=\"article\"/>\n <meta property=\"og:url\" content=\"<?php echo get_permalink() ?>\"/>\n <?php\n if (get_the_post_thumbnail()) {\n ?>\n <meta property=\"og:image\" content=\"<?php echo $image_url[0] ?>\"/>\n <?php } else { ?>\n <meta property=\"og:image\" content=\"<?php header_image(); ?>\"/>\n <?php } ?>\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name') ?>\"/> \n <meta property=\"og:description\" content=\"<?php echo $content ?>\"/>\n <?php if (get_option('ubiq_fb_appid')) { ?>\n <meta property=\"fb:app_id\" content=\"<?php echo get_option('ubiq_fb_appid') ?>\" />\n <?php } ?>\n <?php\n if (function_exists('sharing_display')) {\n add_filter( 'excerpt_length', 'calculate_excerpt_length' ); \n add_filter( 'the_excerpt', 'sharing_display', 19 );\n }\n } else if(is_home()) {\n ?>\n <meta property=\"og:title\" content=\"<?php echo get_bloginfo('name') ?>\"/>\n <meta property=\"og:type\" content=\"website\"/>\n <meta property=\"og:url\" content=\"<?php bloginfo('url') ?>\"/>\n <meta property=\"og:image\" content=\"<?php header_image(); ?>\"/>\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name') ?>\"/> \n <meta property=\"og:description\" content=\"<?php echo bloginfo('description') ?>\"/>\n <?php if (get_option('ubiq_fb_appid')) { ?>\n <meta property=\"fb:app_id\" content=\"<?php echo get_option('ubiq_fb_appid') ?>\" />\n <?php } ?>\n <?php\n }\n}", "function ejo_social_share() {\n ?>\n <aside class=\"social-share\">\n <h3>Deel dit bericht</h3>\n <a target=\"_blank\" title=\"Share on Twitter\" href=\"https://twitter.com/share?url=<?php echo get_permalink(); ?>\">Twitter</a>\n <a target=\"_blank\" title=\"Share on Facebook\" href=\"https://www.facebook.com/sharer/sharer.php?<?php echo get_permalink(); ?>\">Facebook</a>\n </aside>\n <?php\n}", "public function hook_js()\n {\n ?>\n <script>window.fbAsyncInit = function () {\n FB.init({\n appId: '<?php echo get_option('grimage_facebook_appid');?>',\n xfbml: true,\n version: 'v2.6'\n });\n };\n (function (d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) {\n return;\n }\n js = d.createElement(s);\n js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n\n (function ($) {\n $(document).ready(function () {\n function getCookie(cname) {\n var name = cname + \"=\";\n var ca = document.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n }\n // bind it late for infinite scroll posts....\n $('.grimage .clicker').on('click',function (e) {\n console.log('sharing this page...'+$(e.currentTarget).data('url'));\n var image_url = $(e.currentTarget).siblings('img').attr('src');\n FB.ui({\n method: 'share',\n href: $(e.currentTarget).data('url'),\n // title: 'This should be set in the meta headers..',\n picture: image_url,\n // caption: 'This should be set in the meta headers..',\n // description: 'This should be set in the meta headers..'\n }, function (response) {\n // Debug response (optional)\n //console.log(response);\n // Make sure the modal hasn't been shown in the last 7 days, and make sure the modal hasn't already been clicked like.\n if (getCookie('grimage_modal_shown') == \"\" && getCookie('grimage_modal_liked') == \"\") {\n setTimeout(function () {\n // click the modal button to show the modal :)\n //$('#show_grimage_modal').click();\n $('.grimage_modal .grimage_modal-dialog').css('-webkit-transform', 'translate(0, 0)');\n $('.grimage_modal .grimage_modal-dialog').css('-ms-transform', 'translate(0, 0)');\n $('.grimage_modal .grimage_modal-dialog').css('transform', 'translate(0, 0)');\n $('.grimage_modal .grimage_modal-dialog').css('top', '20%');\n $('.grimage_modalclose').click(function (e) {\n e.preventDefault();\n\n // User clicked the close button, so lets set a cookie to prevent the modal from popping up for a few days..\n document.cookie = \"grimage_modal_shown=true; expires=<?php echo date('D, d M Y', strtotime('+1 WEEK'));?> 12:00:00 UTC\";\n $('.grimage_modal').hide();\n });\n }, 500);\n } // end if hide modal...\n });\n FB.Event.subscribe('edge.create', function (response) {\n document.cookie = \"grimage_modal_liked=true; expires=<?php echo date('D, d M Y', strtotime('+1 YEAR'));?> 12:00:00 UTC\";\n //console.log('like button clicked!');\n $('.grimage_modal').hide();\n });\n });\n });\n }(jQuery))</script>\n <?php\n }", "function ejos_register_social_share_shortcode() {\n add_shortcode( 'social_share', 'ejos_social_share_shortcode' );\n}", "function social_share(){\n\t?>\n\t<style type=\"text/css\">\n\t\tp.share-info{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.share-buttons .has-tip{\n\t\t\tborder: none;\n\t\t}\n\t\t.share-buttons a{\n\t\t\tborder: none;\n\t\t\twidth: 33px;\n\t\t\theight: 33px;\n\t\t}\n\t\t.share-buttons a.button{\n\t\t\tpadding: 0;\n\t\t\tmargin-right: 3px;\n\t\t}\n\t\t.share-buttons a.button.facebook{\n\t\t\tbackground: rgb(59, 89, 152);\n\t\t}\n\t\t.share-buttons a.button.twitter{\n\t\t\tbackground: rgb(29, 161, 242);\n\t\t}\n\t\t.share-buttons a.button.linkedin{\n\t\t\tbackground: rgb(0, 119, 181);\n\t\t}\n\t\t.share-buttons a.button.google-plus{\n\t\t\tbackground: rgb(220, 78, 65);\n\t\t}\n\t\t.share-buttons a i{\n\t\t\tfont-size: 1.4rem;\n\t\t\tline-height: 2.4rem;\n\t\t}\n\t</style>\n\t<p class=\"share-info\"><small>Compartilhe:</small></p>\n\t<div class=\"button-group share-buttons\">\n\t\t<span data-tooltip aria-haspopup=\"true\" class=\"has-tip top\" data-disable-hover=\"false\" tabindex=\"1\" title=\"Facebook\">\n\t\t\t<a class=\"button facebook\" href=\"https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>\" onclick=\"window.open(this.href, 'Compartilhar notícia', 'width=490,height=530');return false;\"><i class=\"fa fa-facebook\"></i></a>\n\t\t</span>\n\t\t<span data-tooltip aria-haspopup=\"true\" class=\"has-tip top\" data-disable-hover=\"false\" tabindex=\"1\" title=\"Twitter\">\n\t\t\t<a class=\"button twitter\" href=\"https://twitter.com/home?status=<?php the_permalink(); ?>\" onclick=\"window.open(this.href, 'Compartilhar notícia', 'width=490,height=530');return false;\"><i class=\"fa fa-twitter\"></i></a>\n\t\t</span>\n\t\t<span data-tooltip aria-haspopup=\"true\" class=\"has-tip top\" data-disable-hover=\"false\" tabindex=\"1\" title=\"LinkedIn\">\n\t\t\t<a class=\"button linkedin\" href=\"https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title( ); ?>&summary=&source=<?php bloginfo( 'url' ); ?>\" onclick=\"window.open(this.href, 'Compartilhar notícia', 'width=490,height=530');return false;\"><i class=\"fa fa-linkedin\"></i></a>\n\t\t</span>\n\t\t<span data-tooltip aria-haspopup=\"true\" class=\"has-tip top\" data-disable-hover=\"false\" tabindex=\"1\" title=\"Google plus\">\n\t\t\t<a class=\"button google-plus\" href=\"https://plus.google.com/share?url=<?php the_permalink(); ?>\" onclick=\"window.open(this.href, 'Compartilhar notícia', 'width=490,height=530');return false;\"><i class=\"fa fa-google-plus\"></i></a>\n\t\t</span>\t\t\t\t\t\t\t\n\t</div>\n\t<?php\n}", "function get_facebook_share_url( $the_post = null ) {\n\tglobal $post;\n\tif ( empty( $the_post ) ) {\n\t\t$the_post = $post;\n\t}\n\n\t$permalink = get_the_permalink( $the_post->ID );\n\t$the_title = get_the_title( $the_post->ID );\n\t$handle = get_theme_mod( 'facebook_url' );\n\n\treturn 'http://www.facebook.com/sharer.php?&u=' . $permalink;\n}", "function x_add_social_sharing ( $content ) {\n\t\n if ( is_singular('post') ) {\n\t \n echo do_shortcode('[share title=\"Share this Post\" facebook=\"true\" twitter=\"true\" google_plus=\"true\" linkedin=\"true\" pinterest=\"false\" reddit=\"false\" email=\"true\"]');\n \n }\n}", "public function getFacebookShareUrl() {\n return 'http://www.facebook.com/sharer.php?s=100&p[url]='.$this->socialData['url']\n .'&p[images][0]='.$this->socialData['image']\n .'&p[title]='.$this->socialData['title']\n .'&p[summary]='.$this->socialData['description'];\n }", "public function displayFastSocialSharing($content = null)\n {\n global $post;\n\n // Get current page URL\n $fssURL = urlencode(get_permalink());\n\n // Get current page title\n $fssTitle = str_replace(' ', '%20', get_the_title());\n\n // Get Post Thumbnail for pinterest\n //$fssThumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');\n if (is_page() || is_single()) {\n $fssThumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');\n } else {\n $fssThumbnail[0] = '';\n }\n\n // Construct sharing URL without using any script\n $twitterURL = 'https://twitter.com/intent/tweet?text='.$fssTitle.'&amp;url='.$fssURL;\n $facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$fssURL;\n $googleURL = 'https://plus.google.com/share?url='.$fssURL;\n //$bufferURL = 'https://bufferapp.com/add?url='.$fssURL.'&amp;text='.$fssTitle;\n //$whatsappURL = 'whatsapp://send?text='.$fssTitle . ' ' . $fssURL;\n //$linkedInURL = 'https://www.linkedin.com/shareArticle?mini=true&url='.$fssURL.'&amp;title='.$fssTitle;\n $pinterestURL = 'https://pinterest.com/pin/create/button/?url='.$fssURL.'&amp;media='.$fssThumbnail[0].'&amp;description='.$fssTitle;\n $emailURL = 'mailto:?&subject='.$fssTitle.'&body='.$fssURL;\n\n // Add sharing button at the end of page/page content\n $content .= '<div class=\"fss-social\">';\n\n //$content .= '<h5>SHARE ON</h5> <a class=\"fss-link fss-twitter\" href=\"'. $twitterURL .'\" target=\"_blank\">Twitter</a>';\n //$content .= '<a class=\"fss-link fss-facebook\" href=\"'.$facebookURL.'\" target=\"_blank\">Facebook</a>';\n //$content .= '<a class=\"fss-link fss-whatsapp\" href=\"'.$whatsappURL.'\" target=\"_blank\">WhatsApp</a>';\n //$content .= '<a class=\"fss-link fss-googleplus\" href=\"'.$googleURL.'\" target=\"_blank\">Google+</a>';\n //$content .= '<a class=\"fss-link fss-buffer\" href=\"'.$bufferURL.'\" target=\"_blank\">Buffer</a>';\n //$content .= '<a class=\"fss-link fss-linkedin\" href=\"'.$linkedInURL.'\" target=\"_blank\">LinkedIn</a>';\n //$content .= '<a class=\"fss-link fss-pinterest\" href=\"'.$pinterestURL.'\" data-pin-custom=\"true\" target=\"_blank\">Pin It</a>';\n\n $content .= '<h5>SHARE ON</h5><a class=\"fss-link fss-facebook\" href=\"'.$facebookURL.'\" target=\"_blank\"></a>';\n $content .= '<a class=\"fss-link fss-twitter\" href=\"'. $twitterURL .'\" target=\"_blank\"></a>';\n $content .= '<a class=\"fss-link fss-googleplus\" href=\"'.$googleURL.'\" target=\"_blank\"></a>';\n $content .= '<a class=\"fss-link fss-pinterest\" href=\"'.$pinterestURL.'\" data-pin-custom=\"true\" target=\"_blank\"></a>';\n $content .= '<a class=\"fss-link fss-email\" href=\"'.$emailURL.'\" target=\"_blank\"></a>';\n $content .= '</div>';\n\n return $content;\n }", "function genesisawesome_subscribe_sharebox() {\n\n\tif ( ! is_singular( 'post' ) )\n\t\treturn;\n\t?>\n\n\t<?php if ( genesis_get_option( 'enable_post_subscribe_box', GA_CHILDTHEME_FIELD ) ) : ?>\n<div id='ga-subscribebox'>\n\t<h4><?php _e( 'Subscribe to Our Blog Updates!', 'genesisawesome' );?></h4>\n\t<p class='message'><?php _e( 'Subscribe to Our Free Email Updates!', 'genesisawesome' );?></p>\n\t<form action='http://feedburner.google.com/fb/a/mailverify' class='subscribeform' method='post' onsubmit='window.open(\"http://feedburner.google.com/fb/a/mailverify?uri=<?php echo esc_attr( genesis_get_option( 'feedburner_id', GA_CHILDTHEME_FIELD ) );?>\", \"popupwindow\", \"scrollbars=yes,width=550,height=520\");return true' target='popupwindow'>\n\t\t<input name='uri' type='hidden' value='<?php echo esc_attr( genesis_get_option( 'feedburner_id', GA_CHILDTHEME_FIELD ) );?>'/>\n\t\t<input name='loc' type='hidden' value='en_US'/>\n\t\t<input class='einput' name='email' onblur='if (this.value == \"\") {this.value = \"Enter your email...\";}' onfocus='if (this.value == \"Enter your email...\") {this.value = \"\"}' type='text' value='Enter your email...'/>\n\t\t<input class='ebutton' title='' type='submit' value='<?php _e( 'Subscribe', 'genesisawesome' );?>'/>\n\t</form>\n</div>\n\t<?php endif; ?>\n\n\t<?php if ( genesis_get_option( 'enable_post_social_share', GA_CHILDTHEME_FIELD ) ) : ?>\n<div id=\"ga-sharebox\">\n\t<h4><?php _e( 'Share this article!', 'genesisawesome' );?></h4>\n\t<table width='100%'>\n\t\t<tr>\n\t\t\t<td><iframe allowTransparency='true' src='//www.facebook.com/plugins/like.php?href=<?php echo urlencode( get_permalink() ); ?>&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=65' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:50px; height:65px;'></iframe></td>\n\t\t\t<td><a class='twitter-share-button' data-count='vertical' data-lang='en' data-title='<?php the_title_attribute(); ?>' data-url='<?php the_permalink(); ?>' href='https://twitter.com/share'>Tweet</a></td>\n\t\t\t<td>\t\n\t\t\t\t<div style='position:relative;'>\n\t\t\t\t\t<a class='pin-it-button' count-layout='vertical' href='http://pinterest.com/pin/create/button/?url=<?php echo urldecode( get_permalink() ); ?>'>Pin It now!</a>\n\t\t\t\t\t<a href='javascript:void(run_pinmarklet())' style='position:absolute;top:0;bottom:0;left:0;right:0;'></a>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td><g:plusone href='<?php the_permalink(); ?>' size='tall'></g:plusone></td>\n\t\t\t<td>\n\t\t\t\t<su:badge layout=\"5\" location=\"<?php get_permalink();?>\"></su:badge>\n\t\t\t</td>\n\t\t\t<td><a class='DiggThisButton DiggMedium'></a></td>\n\t\t\t<td>\n\t\t\t\t<script src='//platform.linkedin.com/in.js' type='text/javascript'></script>\n\t\t\t\t<script data-counter='top' data-url='<?php the_permalink(); ?>' type='IN/Share'></script>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</div>\n\t<?php endif; ?>\n\n\t<?php if ( genesis_get_option( 'enable_post_related_posts', GA_CHILDTHEME_FIELD ) ) :?>\n<div id='ga-relatedposts'>\n\t <h4><?php _e( 'Related Posts', 'genesisawesome' );?></h4>\n\t <?php genesisawesome_related_posts(); ?>\n</div>\n\t<?php endif; ?>\n\n\t<?php\n\n}", "public function social() {\n\t\t?>\n\t\t<p>\n\t\t<div class=\"g-plusone\" data-size=\"medium\" data-href=\"http://wp-buddy.com/products/plugins/google-drive-as-wordpress-cdn-plugin/\"></div>\n\t\t</p>\n\n\t\t<script type=\"text/javascript\">\n\t\t\t(function () {\n\t\t\t\tvar po = document.createElement( 'script' );\n\t\t\t\tpo.type = 'text/javascript';\n\t\t\t\tpo.async = true;\n\t\t\t\tpo.src = 'https://apis.google.com/js/plusone.js';\n\t\t\t\tvar s = document.getElementsByTagName( 'script' )[0];\n\t\t\t\ts.parentNode.insertBefore( po, s );\n\t\t\t})();\n\t\t</script>\n\n\t\t<p>\n\t\t\t<a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://wp-buddy.com/products/plugins/google-drive-as-wordpress-cdn-plugin/\" data-text=\"Check out the Google Drive as CDN WordPress Plugin\" data-related=\"wp_buddy\">Tweet</a>\n\t\t</p>\n\t\t<script>!function ( d, s, id ) {\n\t\t\t\tvar js, fjs = d.getElementsByTagName( s )[0];\n\t\t\t\tif ( !d.getElementById( id ) ) {\n\t\t\t\t\tjs = d.createElement( s );\n\t\t\t\t\tjs.id = id;\n\t\t\t\t\tjs.src = \"//platform.twitter.com/widgets.js\";\n\t\t\t\t\tfjs.parentNode.insertBefore( js, fjs );\n\t\t\t\t}\n\t\t\t}( document, \"script\", \"twitter-wjs\" );</script>\n\n\t\t<p>\n\t\t\t<iframe src=\"//www.facebook.com/plugins/like.php?href=<?php echo urlencode( 'http://wp-buddy.com/products/plugins/google-drive-as-wordpress-cdn-plugin/' ); ?>&amp;send=false&amp;layout=button_count&amp;width=150&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:150px; height:21px;\" allowTransparency=\"true\"></iframe>\n\t\t</p>\n\t<?php\n\t}", "public function widget( $args, $instance ) {\n\t$title = apply_filters( 'widget_title', $instance['title'] );\n\t// before and after widget arguments are defined by themes\n\techo $args['before_widget'];\n\tif ( ! empty( $title ) )\n\t\techo $args['before_title'] . $title . $args['after_title'];\n\t// This is where you run the code and display the output\n\t\techo '<div class=\"social-share\"> <a data-fb-link=\"';\n\t\techo the_permalink();\n\t\techo '\" href=\"https://www.facebook.com/sharer/sharer.php?u=';\n\t\techo the_permalink();\n\t\techo '\" title=\"Share on Facebook\" name=\"fb_share\" onclick=\"window.open(this.href,\\'targetWindow\\',\\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=660,height=380,left=100,top=100\\');return false;\" class=\"facebook\"><span><i class=\"fab fa-facebook-f\"></i></span> Facebook</a>';\n\t\techo '<a href=\"https://twitter.com/intent/tweet?text=';\n\t\techo the_title(); \n\t\techo '&url=';\n\t\techo the_permalink();\n\t\techo '\" class=\"share-icon share-button share-icon-twitter twitter\" title=\"Share on Twitter\" onclick=\"window.open(this.href,\\'targetWindow\\',\\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=660,height=380,left=100,top=100\\');return false;\"><span><i class=\"fab fa-twitter\"></i></span> Twitter</a>'; \n\t\techo '<a href=\"https://plus.google.com/share?url=';\n\t\techo the_permalink();\n\t\techo '\" class=\"share-icon share-button share-icon-google-plus google\" title=\"Share on Google+\" onclick=\"window.open(this.href,\\'targetWindow\\',\\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=480,height=400,left=100,top=100\\');return false;\"><span><i class=\"fab fa-google-plus-g\"></i></span> Google +</a>'; \n\t\techo '<a class=\"social-email\" href=\"mailto:?subject=I wanted to share this story with you: || ';\n\t\techo the_title();\n\t\techo '&body=I found this story on '; \n\t\techo bloginfo('url');\n\t\techo 'and I thought you would like it:';\n\t\techo the_permalink();\n\t\techo ' Here is an excerpt:';\n\t\techo strip_tags( get_the_excerpt() );\n\t\techo '\"><span><i class=\"fa fa-share-square\"></i></span>Email a Friend</a></div>';\n\t\techo $args['after_widget'];\n}", "function desertdelta_social_sharing_buttons($content) {\n\tglobal $post;\n\tif(is_singular() || is_home()){\n\n\t\t// Get current page URL\n\t\t$desertdeltaURL = urlencode(get_permalink());\n\n\t\t// Get current page title\n\t\t$desertdeltaTitle = htmlspecialchars(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8');\n\t\t// $desertdeltaTitle = str_replace( ' ', '%20', get_the_title());\n\n\t\t// Get Post Thumbnail for pinterest\n\t\t$desertdeltaThumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );\n\n\t\t// Construct sharing URL without using any script\n\t\t$twitterURL = 'https://twitter.com/intent/tweet?text='.$desertdeltaTitle.'&amp;url='.$desertdeltaURL.'&amp;via=Crunchify';\n\t\t$facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$desertdeltaURL;\n\n\t\t// Based on popular demand added Pinterest too\n\t\t$pinterestURL = 'https://pinterest.com/pin/create/button/?url='.$desertdeltaURL.'&amp;media='.$desertdeltaThumbnail[0].'&amp;description='.$desertdeltaTitle;\n\n\t\t// Add sharing button at the end of page/page content\n\t\t$content .= '<!-- Implement your own superfast social sharing buttons without any JavaScript loading. No plugin required. Detailed steps here: http://crunchify.me/1VIxAsz -->';\n\t\t$content .= '<div class=\"contactSocials\"><h5 class=\"heading heading__sm\">SHARE </h5>';\n\t\t$content .= ' <a href=\"'. $twitterURL .'\" target=\"_blank\"><i class=\"fab fa-twitter\"></i></a>';\n\t\t$content .= '<a href=\"'.$facebookURL.'\" target=\"_blank\"><i class=\"fab fa-facebook-square\"></i></a>';\n\t\t$content .= '</div>';\n\n\t\treturn $content;\n\t}else{\n\t\t// if not a post/page then don't include sharing button\n\t\treturn $content;\n\t}\n}", "function social_sharing_buttons() {\n $siteURL = site_url();\n $pageURL = wp_get_shortlink();\n\n // Get current page title\n $pageTitle = str_replace( ' ', '%20', get_the_title());\n\n // Construct sharing URL without using any script\n $twitterURL = 'https://twitter.com/intent/tweet?text='.$pageTitle.'&amp;url='.$pageURL.'&amp;via=YOUR_TWITTER_USERNAME';\n $facebookURL = 'https://facebook.com/sharer/sharer.php?u='.$pageURL;\n $googleURL = 'https://plus.google.com/share?url='.$pageURL;\n $linkedinURL = 'https://www.linkedin.com/shareArticle?mini=true&url='.$pageURL.'&title='.$pageTitle.'&source='.$siteURL;\n $telegramURL = 'https://telegram.me/share/url?url='.$pageURL.'&text='.$pageTitle;\n\n // Add sharing button at the end of page/page content\n $content = '<div class=\"share-modal share-modal--close\" >\n <div class=\"share-body\">\n <a class=\"share-modal__close\" href=\"#\" id=\"closeModalButton\">\n <i class=\"fa fa-close icon\" aria-hidden=\"true\"></i>\n </a>\n <p class=\"share-modal__title\">\n <span>انتشار مطلب</span>\n <i class=\"fa fa-share icon\" aria-hidden=\"true\"></i>\n </p>\n <p class=\"share-modal__post-title\">'.urldecode($pageTitle).'</p>\n\n <div class=\"share-buttons-container\">\n <a class=\"twitter\" href=\"'.$twitterURL .'\" target=\"_blank\"><i class=\"fa fa-twitter icon\" aria-hidden=\"true\"></i></a>\n <a class=\"facebook\" href=\"'.$facebookURL.'\" target=\"_blank\"><i class=\"fa fa-facebook icon\" aria-hidden=\"true\"></i></a>\n <a class=\"google-plus\" href=\"'.$googleURL.'\" target=\"_blank\"><i class=\"fa fa-google-plus icon\" aria-hidden=\"true\"></i></a>\n <a class=\"linkedin\" href=\"'.$linkedinURL.'\" target=\"_blank\"><i class=\"fa fa-linkedin icon\" aria-hidden=\"true\"></i></a>\n <a class=\"telegram\" href=\"'.$telegramURL.'\" target=\"_blank\"><i class=\"fa fa-paper-plane icon\" aria-hidden=\"true\"></i></a>\n </div>\n\n <p class=\"share-modal__post-title share-modal__post-title--small\">آدرس کوتاه شده این مطلب</p>\n <input type=\"text\" readonly=\"\" class=\"share-modal__link-box\" value=\"'.$pageURL.'\" onClick=\"this.select();\">\n </div>\n</div>';\n\n return $content;\n}", "function wpbook_safe_publish_to_facebook($post_ID) { \n\t$debug_file= WP_PLUGIN_DIR .'/wpbook/wpbook_pub_debug.txt';\n\n\tif(!class_exists('Facebook')) {\n\t\tinclude_once(WP_PLUGIN_DIR.'/wpbook/includes/client/facebook.php');\n\t}\t \n\t$wpbookOptions = get_option('wpbookAdminOptions');\n \n\tif (!empty($wpbookOptions)) {\n\t\tforeach ($wpbookOptions as $key => $option)\n\t\t$wpbookAdminOptions[$key] = $option;\n\t}\n \n\tif($wpbookOptions['wpbook_enable_debug'] == \"true\")\n\t\tdefine ('WPBOOKDEBUG',true);\n\telse\n\t\tdefine ('WPBOOKDEBUG',false);\n \n\t$api_key = $wpbookAdminOptions['fb_api_key'];\n\t$secret = $wpbookAdminOptions['fb_secret'];\n\t$target_admin = $wpbookAdminOptions['fb_admin_target'];\n\t$target_page = $wpbookAdminOptions['fb_page_target'];\n\t$stream_publish = $wpbookAdminOptions['stream_publish'];\n\t$stream_publish_pages = $wpbookAdminOptions['stream_publish_pages'];\n\t$wpbook_show_errors = $wpbookAdminOptions['show_errors'];\n\t$wpbook_promote_external = $wpbookAdminOptions['promote_external'];\n\t$wpbook_attribution_line = $wpbookAdminOptions['attribution_line'];\n\t$wpbook_as_note = $wpbookAdminOptions['wpbook_as_note'];\n\t$wpbook_target_group = $wpbookAdminOptions['wpbook_target_group'];\n \n\tif($wpbookOptions['wpbook_disable_sslverify'] == \"true\") {\n\t\tFacebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;\n\t\tFacebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;\n\t}\n \n \n\t$facebook = new Facebook($api_key, $secret);\n\t$wpbook_user_access_token = get_option('wpbook_user_access_token','');\n\t$wpbook_page_access_token = get_option('wpbook_page_access_token','');\n \n\tif($wpbook_user_access_token == '') {\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\tif(($fp) && (filesize($debug_file) > 500 * 1024)) { // 500k max to file\n\t\t\t\tfclose($fp);\n\t\t\t\t$fp = @fopen($debug_file,'w+'); // start over with a new file\n\t\t\t}\n\t\t\tif(!$fp) \n\t\t\t\tdefine('WPBOOKDEBUG',false); // stop trying\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No user access token\\n\";\n\t\t\tif(is_writeable($debug_file)) {\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t} else {\n\t\t\t\tfclose($fp);\n\t\t\t\tdefine (WPBOOKDEBUG,false); // if it isn't writeable don't keep trying \n\t\t\t}\n\t\t}\n\t}\n\tif((!empty($api_key)) && (!empty($secret)) && (!empty($target_admin)) && (($stream_publish == \"true\") || $stream_publish_pages == \"true\")) {\n\t\tif(($wpbook_user_access_token == '')&&($wpbook_page_access_token == '')) {\n\t\t\t// if both of these are blank, no point in the rest of publish_to_facebook\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No user access token or page access token.\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\tif($wpbook_show_errors) {\n\t\t\t\t$wpbook_message = 'Both user access token AND page access_token are blank. You must grant permissions before publishing will work.'; \n\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t}\n\t\treturn;\n\t\t} \n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : publish_to_facebook running, target_admin is \" . $target_admin .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$my_post = get_post($post_ID);\n\t\tif(!empty($my_post->post_password)) { // post is password protected, don't post\n\t\t\treturn;\n\t\t}\n\t\tif(get_post_type($my_post->ID) != 'post') { // only do this for posts\n\t\t\treturn;\n\t\t}\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post ID is \". $my_post->ID .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$publish_meta = get_post_meta($my_post->ID,'wpbook_fb_publish',true); \n\t\tif(($publish_meta == 'no')) { // user chose not to post this one\n\t\t\treturn;\n\t\t}\n\t\t$my_title=$my_post->post_title;\n\t\t$my_author=get_userdata($my_post->post_author)->display_name;\n\t\tif($wpbook_promote_external) { \n\t\t\t$my_permalink = get_permalink($post_ID);\n\t\t} else {\n\t\t\t$my_permalink = wpbook_always_filter_postlink(get_permalink($post_ID));\n\t\t}\n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : My permalink is \". $my_permalink .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$publish_meta_message = get_post_meta($my_post->ID,'wpbook_message',true); \n\t\tif($publish_meta_message) {\n\t\t\t$wpbook_description = $publish_meta_message;\n\t\t} else {\n\t\t\tif(($my_post->post_excerpt) && ($my_post->post_excerpt != '')) {\n\t\t\t\t$wpbook_description = stripslashes(wp_filter_nohtml_kses(apply_filters('the_content',$my_post->post_excerpt)));\n\t\t\t} else { \n\t\t\t\t$wpbook_description = stripslashes(wp_filter_nohtml_kses(apply_filters('the_content',$my_post->post_content)));\n\t\t\t}\n\t\t}\n\t\tif(strlen($wpbook_description) >= 995) {\n\t\t\t$space_index = strrpos(substr($wpbook_description, 0, 995), ' ');\n\t\t\t$short_desc = substr($wpbook_description, 0, $space_index);\n\t\t\t$short_desc .= '...';\n\t\t\t$wpbook_description = $short_desc;\n\t\t}\n\n\t\tif (function_exists('get_the_post_thumbnail') && has_post_thumbnail($my_post->ID)) {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : function exists, and this post has_post_thumbnail - post_Id is \". $my_post->ID .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t} \n\t\t\t$my_thumb_id = get_post_thumbnail_id($my_post->ID);\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : my_thumb_id is \". $my_thumb_id .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\t$my_thumb_array = wp_get_attachment_image_src($my_thumb_id);\n\t\t\t$my_image = $my_thumb_array[0]; // this should be the url\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : my_image is \". $my_image .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t} else {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Get Post Thumbnail function does not exist, or no thumb \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\t\t \n\t\t\t$my_image = '';\n\t\t}\n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post thumbail is \". $my_image .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n\t\t$actions = json_encode(array(array('name'=>'Read More','link'=>$my_permalink)));\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post share link is \". $my_link .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t/* This section handles publishing to user's wall */ \n\t\tif($stream_publish == \"true\") {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to personal wall, admin is \" .$target_admin .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_user_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting user access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t \n\t\t\t$fb_response = '';\n\t\t\ttry{\n\t\t\t\tif(($wpbook_as_note == 'note') || ($wpbook_as_note == 'true')) {\n\t\t\t\t\t/* notes on walls don't allow much */ \n\t\t\t\t\t$allowedtags = array('img'=>array('src'=>array(), 'style'=>array()), \n 'span'=>array('id'=>array(), 'style'=>array()), \n 'a'=>array('href'=>array()), 'p'=>array(),\n 'b'=>array(),'i'=>array(),'u'=>array(),'big'=>array(),\n 'small'=>array(), 'ul' => array(), 'li'=>array(),\n 'ol'=> array(), 'blockquote'=> array(),'h1'=>array(),\n 'h2'=> array(), 'h3'=>array(),\n );\n\t\t\t\t\tif(!empty($my_image)) {\n /* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'subject' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'message' => wp_kses(stripslashes(apply_filters('the_content',$my_post->post_content)),$allowedtags), \n\t\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'subject' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'message' => wp_kses(stripslashes(apply_filters('the_content',$my_post->post_content)),$allowedtags), \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t}\n\t\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing as note, $my_image is \" . $my_image .\" \\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/notes', 'POST', $attachment);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t} elseif ($wpbook_as_note == 'link') {\n\t\t\t\t\t// post as link\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/links', 'POST', $attachment);\n\t\t\t\t} else {\n\t\t\t\t\t// post as a post\n\t\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t\t'picture' => $my_image,\n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t\t'comments_xid' => $post_ID, \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t}\n\t\t\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing as excerpt, $my_image is \" . $my_image .\" \\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/feed', 'POST', $attachment); \n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception in stream publish for user: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_user_stream_id', $fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_user_stream_time',0); // no comments imported yet\n\t\t\t} // end of if $response\n\t\t} // end of if stream_publish \n \n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Past stream_publish, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t/* This section handls publishing to group wall */ \n\t\tif(($stream_publish_pages == \"true\") && (!empty($wpbook_target_group))) {\n\t\t\t$fb_response = '';\n\t\t\t/* Publishing to a group's wall requires the user access token, and \n\t\t\t * is published as coming from the user, not the group - different process\n\t\t\t * than Pages \n\t\t\t */ \n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_user_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting user access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Group access token is \". $wpbook_user_access_token .\"\\n\";\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to group \" . $wpbook_target_group .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry{\n\t\t\t\t// post as an excerpt\n\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t} else {\n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t}\n\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to group, image is \" . $my_image .\" \\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\tif($wpbook_as_link == 'link') {\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $wpbook_target_group .'/links','POST',$attachment);\n\t\t\t\t} else {\n\t\t\t\t\t$fb_response = $facebook->api('/'. $wpbook_target_group .'/feed/','POST', $attachment); \n\t\t\t\t}\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to group via api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$wpbook_message = 'Caught exception in publish to group ' . $e->getMessage() . ' Error code: ' . $e->getCode();\n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try/catch for publish to group\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_group_stream_id',$fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_group_stream_time',0); // no comments imported\n\t\t\t} else {\n\t\t\t\t$wpbook_message = 'No post id returned from Facebook, $fb_response was ' . print_r($fb_response,true) . '/n';\n\t\t\t\t$wpbook_message = $wpbook_message . ' and $fb_page_type was ' . $fb_page_type;\n\t\t\t\t$wpbook_message .= ' and $wpbook_description was ' . $wpbook_description;\n\t\t\t\t$wpbook_message .= ' and $my_title was ' . $my_title;\n\t\t\t\twp_die($wpbook_message,'WPBook Error publishing to group'); \n\t\t\t} \n\t\t} // end of publish to group\n \n\t\t/* This section handles publishing to page wall */ \n\t\tif(($stream_publish_pages == \"true\") && (!empty($target_page))) { \n\t\t\t// publish to page with new api\n\t\t\t$fb_response = '';\n\t\t\tif($wpbook_page_access_token == '') {\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No Access Token for Publishing to Page\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\treturn; // no page access token, no point in trying to publish\n\t\t\t} \t \n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Page access token is \". $wpbook_page_access_token .\"\\n\";\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to page \" . $target_page .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_page_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting page access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t\t\ttry{\n\t\t\t\t// post as an excerpt\n\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions, \n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t} else {\n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t}\n\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to page, image is \" . $my_image .\" \\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\tif($wpbook_as_link == 'link') {\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_page .'/links/','POST',$attachment); \n\t\t\t\t} else {\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_page .'/feed/','POST', $attachment); \n\t\t\t\t}\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published as page to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$wpbook_message = 'Caught exception in publish to page ' . $e->getMessage() . ' Error code: ' . $e->getCode();\n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try/catch for publish to page\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_page_stream_id',$fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_page_stream_time',0); // no comments imported\n\t\t\t} else {\n\t\t\t\t$wpbook_message = 'No post id returned from Facebook, $fb_response was ' . print_r($fb_response,true) . '/n';\n\t\t\t\t$wpbook_message = $wpbook_message . ' and $fb_page_type was ' . $fb_page_type;\n\t\t\t\t$wpbook_message .= ' and $wpbook_description was ' . $wpbook_description;\n\t\t\t\t$wpbook_message .= ' and $my_title was ' . $my_title;\n\t\t\t\twp_die($wpbook_message,'WPBook Error publishing to page'); \n\t\t\t}\n\t\t} // end of if stream_publish_pages is true AND target_page non-empty\n\t} // end for if stream_publish OR stream_publish_pages is true\n}", "function insert_fb_in_head()\n{\n\t\tglobal $post;\n\t\tif (!is_singular()) //if it is not a post or a page\n\t\t\t\treturn;\n\n\t\tif ($excerpt = $post->post_excerpt)\n\t\t{\n\t\t\t\t$excerpt = strip_tags($post->post_excerpt);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$excerpt = get_bloginfo('description');\n\t\t}\n\n\t\t//echo '<meta property=\"fb:app_id\" content=\"YOUR APPID\"/>'; //<-- this is optional\n\t\techo '<meta property=\"og:title\" content=\"' . get_the_title() . '\"/>';\n\t\techo '<meta property=\"og:description\" content=\"' . $excerpt . '\"/>';\n\t\techo '<meta property=\"og:type\" content=\"article\"/>';\n\t\techo '<meta property=\"og:url\" content=\"' . get_permalink() . '\"/>';\n\t\techo '<meta property=\"og:site_name\" content=\"' . get_bloginfo() . '\"/>';\n\n\t\techo '<meta name=\"twitter:title\" content=\"' . get_the_title() . '\"/>';\n\t\techo '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\techo '<meta name=\"twitter:description\" content=\"' . $excerpt . '\" />';\n\t\techo '<meta name=\"twitter:url\" content=\"' . get_permalink() . '\"/>';\n\n\t\tif (!has_post_thumbnail($post->ID))\n\t\t{\n\t\t\t\t//the post does not have featured image, use a default image\n\t\t\t\t//$default_image = \"http://example.com/image.jpg\"; //<--replace this with a default image on your server or an image in your media library\n\t\t\t\t//echo '<meta property=\"og:image\" content=\"' . $default_image . '\"/>';\n\t\t\t\t//echo '<meta name=\"twitter:image\" content=\"' . $default_image . '\"/>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'large');\n\t\t\t\techo '<meta property=\"og:image\" content=\"' . esc_attr($thumbnail_src[0]) . '\"/>';\n\t\t\t\techo '<meta name=\"twitter:image\" content=\"' . esc_attr($thumbnail_src[0]) . '\"/>';\n\t\t}\n}", "function post_like() {\n\t\n$like = '<iframe src=\"http://www.facebook.com/plugins/like.php?href=' . get_permalink() .'&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px; height:60px;\"></iframe>';\necho $like;\n $twwite='<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-text=\"<?php the_title(); ?>\" data-url=\"' . get_permalink() .'\" data-via=\"diythemes\">Tweet</a>\n <script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>';\necho $twwite;\n\t\t\n}", "function sfc_publish_automatic($id, $post) {\r\n\tif ($post->post_status !== 'publish') return;\r\n\t\r\n\t// check options to see if we need to send to FB at all\r\n\t$options = get_option('sfc_options');\r\n\tif (!$options['autopublish_app'] && !$options['autopublish_profile']) \r\n\t\treturn; \r\n\r\n\t// load facebook platform\r\n\tinclude_once 'facebook-platform/facebook.php';\r\n\t$fb=new Facebook($options['api_key'], $options['app_secret']);\r\n\r\n\t// check to see if we can send to FB at all\r\n\t$result = $fb->api_client->users_hasAppPermission('publish_stream');\r\n\tif (!$result) return; \r\n\t\r\n\t// build the post to send to FB\r\n\t\r\n\t// apply the content filters, in case some plugin is doing weird image stuff\r\n\t$content = apply_filters('the_content', $post->post_content);\r\n\r\n\t// look for the images to add with image_src\r\n\t// TODO use the new post thumbnail functionality in 2.9, somehow. Perhaps force that image first? Dunno.\r\n\t$images = array();\r\n\tif ( preg_match_all('/<img (.+?)>/', $content, $matches) ) {\r\n\t\tforeach ($matches[1] as $match) {\r\n\t\t\tforeach ( wp_kses_hair($match, array('http')) as $attr) \r\n\t\t\t\t$img[$attr['name']] = $attr['value'];\r\n\t\t\tif ( isset($img['src']) ) {\r\n\t\t\t\tif ( isset( $img['class'] ) && false === strpos( $img['class'], 'wp-smiley' ) ) { // ignore smilies\r\n\t\t\t\t\t$images[] = $img['src'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// build the attachment\r\n\t$permalink = get_permalink($post->ID);\r\n\t$attachment['name'] = $post->post_title;\r\n\t$attachment['href'] = $permalink;\r\n\t$attachment['description'] = sfc_publish_make_excerpt($post->post_content);\r\n\t$attachment['comments_xid'] = urlencode($permalink);\r\n\r\n\t// image attachments (up to 5, as that's all FB allows)\r\n\t$count=0;\r\n\tforeach ($images as $image) {\r\n\t\t$attachment['media'][$count]['type'] = 'image';\r\n\t\t$attachment['media'][$count]['src'] = $image;\r\n\t\t$attachment['media'][$count]['href'] = $permalink;\r\n\t\t$count++; if ($count==5) break;\r\n\t}\r\n\r\n\t// Read Post link\r\n\t$action_links[0]['text'] = 'Read Post';\r\n\t$action_links[0]['href'] = $permalink;\r\n\t\r\n\t// Link to comments\r\n\t$action_links[1]['text'] = 'See Comments';\r\n\t$action_links[1]['href'] = get_comments_link($post->ID);\r\n\r\n\r\n\t// publish to page\r\n\t/* Does not work yet: See http://bugs.developers.facebook.com/show_bug.cgi?id=8184\r\n\tif ($options['autopublish_app'] && !get_post_meta($id,'_fb_post_id_app',true)) {\r\n\t\tif ($options['fanpage']) $who = $options['fanpage'];\r\n\t\telse $who = $options['appid'];\r\n\t\t$fb_post_id = $fb->api_client->stream_publish(null, json_encode($attachment), json_encode($action_links), $who, $who);\r\n\t\tif ($fb_post_id) {\r\n\t\t\t// update the post id so as to prevent automatically posting it twice\r\n\t\t\tupdate_post_meta($id,'_fb_post_id_app',$fb_post_id);\r\n\t\t}\r\n\t}\r\n\t*/\r\n\t\r\n\t// publish to profile\r\n\tif ($options['autopublish_profile'] && !get_post_meta($id,'_fb_post_id_profile',true)) {\r\n\t\t$fb_post_prof_id = $fb->api_client->stream_publish(null, json_encode($attachment), json_encode($action_links));\r\n\t\tif ($fb_post_prof_id) {\r\n\t\t\t// update the post id so as to prevent automatically posting it twice\r\n\t\t\tupdate_post_meta($id,'_fb_post_id_profile',$fb_post_prof_id);\r\n\t\t}\r\n\t}\t\r\n}", "function widget_ffes_feed_init() {\r\n\r\n // Check for the required API functions\r\n if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )\r\n return;\r\n\r\n // This saves options and prints the widget's config form.\r\n function widget_ffes_feed_control() {\r\n $options = $newoptions = get_option('widget_ffes_feed');\r\n if ( $_POST['ffes-feed-submit'] ) {\r\n $newoptions['title'] = strip_tags(stripslashes($_POST['ffes-feed-title']));\r\n }\r\n if ( $options != $newoptions ) {\r\n $options = $newoptions;\r\n update_option('widget_ffes_feed', $options);\r\n }\r\n ?>\r\n <div style=\"text-align:right\">\r\n <label for=\"ffes-feed-title\" style=\"line-height:35px;display:block;\"><?php _e('Widget title:', 'ffes_widgets'); ?>\r\n <input type=\"text\" id=\"ffes-feed-title\" name=\"ffes-feed-title\" value=\"<?php echo wp_specialchars($options['title'], true); ?>\" /></label>\r\n <input type=\"hidden\" name=\"ffes-feed-submit\" id=\"ffes-feed-submit\" value=\"1\" />\r\n </div>\r\n <?php\r\n }\r\n\r\n // This prints the widget\r\n function widget_ffes_feed($args) {\r\n extract($args);\r\n $defaults = array('count' => 10, 'username' => 'wordpress');\r\n $options = (array) get_option('widget_ffes_feed');\r\n\r\n foreach ( $defaults as $key => $value )\r\n if ( !isset($options[$key]) )\r\n $options[$key] = $defaults[$key];\r\n//feed copy\r\n$feed_text = \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">document.write('<scr' + 'ipt language=\\\"JavaScript\\\" type=\\\"text/javascript\\\" src=\\\"http://www.familyfeatures.com/wordpress/food/foodhandler.ashx' + window.location.search + '\\\"></scr' + 'ipt>'\r\n);</script>\";\r\n ?>\r\n <?php echo $before_widget; ?>\r\n <?php echo $before_title . $options['title'] . $after_title; ?>\r\n <?php echo \"$feed_text\"; ?>\r\n <?php echo $after_widget; ?>\r\n<?php\r\n }\r\n\r\n // Tell Dynamic Sidebar about our new widget and its control\r\n register_sidebar_widget(array('Weekly Food Section Widget', 'ffes_widgets'), 'widget_ffes_feed');\r\n register_widget_control(array('Weekly Food Section Widget', 'ffes_widgets'), 'widget_ffes_feed_control');\r\n\r\n}", "function print_embed_sharing_dialog()\n {\n }", "public function add_open_graph_meta() {\n\t\t// Create/check default values\n\t\t$info = array(\n\t\t\t'postID' => absint( get_the_ID() ),\n\t\t\t'title' => esc_html( get_the_title() ),\n\t\t\t'imageURL' => get_post_thumbnail_id( absint( get_the_ID() ) ),\n\t\t\t'description' => esc_html( Kiwi_Social_Share_Helper::get_excerpt_by_id( absint( get_the_ID() ) ) ),\n\t\t\t'fb_app_id' => esc_attr( Kiwi_Social_Share_Helper::get_setting_value( 'facebook_page_id', '', 'kiwi_social_identities' ) ),\n\t\t\t'fp_url' => esc_attr( Kiwi_Social_Share_Helper::get_setting_value( 'facebook_page_url', '', 'kiwi_social_identities' ) ),\n\t\t\t'user_twitter_handle' => esc_attr( Kiwi_Social_Share_Helper::get_setting_value( 'twitter_username', '', 'kiwi_social_identities' ) )\n\t\t);\n\n\t\tif ( ! empty( $info['user_twitter_handle'] ) ) {\n\t\t\t$info['user_twitter_handle'] = str_replace( '@', '', $info['user_twitter_handle'] );\n\t\t}\n\n\t\t$metabox = array(\n\t\t\t'title' => get_post_meta( get_the_ID(), 'kiwi_social-media-title', true ),\n\t\t\t'description' => get_post_meta( get_the_ID(), 'kiwi_social-media-description', true ),\n\t\t\t'imageURL' => get_post_meta( get_the_ID(), 'kiwi_social-media-image', true ),\n\t\t\t'twitter_description' => get_post_meta( get_the_ID(), 'kiwi_social-media-custom-tweet', true ),\n\t\t);\n\n\t\t$info = wp_parse_args( $metabox, $info );\n\n\t\t$twitter_button = new Kiwi_Social_Share_Social_Button_Twitter();\n\t\t$url = $twitter_button->get_current_page_url( get_the_ID() );\n\n\t\t$info['header_output'] = '';\n\t\t// We only modify the Open Graph tags on single blog post pages\n\t\tif ( is_singular() ) {\n\t\t\tif ( ( isset( $info['title'] ) && $info['title'] ) || ( isset( $info['description'] ) && $info['description'] ) || ( isset( $info['imageURL'] ) && $info['imageURL'] ) ) {\n\n\t\t\t\t// Check if Yoast Exists so we can coordinate output with their plugin accordingly\n\t\t\t\tif ( ! defined( 'WPSEO_VERSION' ) ) {\n\t\t\t\t\t// Add twitter stuff\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<!-- Twitter OG tags by Kiwi Social Sharing Plugin -->';\n\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta name=\"twitter:title\" content=\"' . trim( $info['title'] ) . '\" />';\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta name=\"twitter:url\" content=\"' . esc_url( $url ) . '\" />';\n\n\t\t\t\t\tif ( ! empty( $info['user_twitter_handle'] ) ) {\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta name=\"twitter:site\" content=\"' . trim( $info['user_twitter_handle'] ) . '\" />';\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta name=\"twitter:creator\" content=\"' . trim( $info['user_twitter_handle'] ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $info['twitter_description'] ) ) {\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta name=\"twitter:description\" content=\"' . esc_attr( $info['twitter_description'] ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $info['imageURL'] ) ) {\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta name=\"twitter:image\" content=\"' . esc_attr( $info['imageURL'] ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<!-- / Twitter OG tags by Kiwi Social Sharing Plugin -->';\n\n\t\t\t\t\t// Add all our Open Graph Tags to the Return Header Output\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<!-- Meta OG tags by Kiwi Social Sharing Plugin -->';\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"og:type\" content=\"article\" /> ';\n\n\t\t\t\t\t// Open Graph Title: Create an open graph title meta tag\n\t\t\t\t\tif ( $info['title'] ) {\n\t\t\t\t\t\t// If nothing else is defined, let's use the post title\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"og:title\" content=\"' . Kiwi_Social_Share_Helper::convert_smart_quotes( htmlspecialchars_decode( get_the_title() ) ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $info['description'] ) {\n\t\t\t\t\t\t// If nothing else is defined, let's use the post excerpt\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"og:description\" content=\"' . Kiwi_Social_Share_Helper::convert_smart_quotes( $info['description'] ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( has_post_thumbnail( $info['postID'] ) ) {\n\t\t\t\t\t\t// If nothing else is defined, let's use the post Thumbnail as long as we have the URL cached\n\t\t\t\t\t\t$og_image = wp_get_attachment_image_src( get_post_thumbnail_id( $info['postID'] ), 'full' );\n\t\t\t\t\t\tif ( $og_image ) {\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"og:image\" content=\"' . esc_url( $og_image[0] ) . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"og:url\" content=\"' . esc_url( $url ) . '\" />';\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"og:site_name\" content=\"' . esc_attr( get_bloginfo( 'name' ) ) . '\" />';\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"article:published_time\" content=\"' . esc_attr( get_post_time( 'c' ) ) . '\" />';\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"article:modified_time\" content=\"' . esc_attr( get_post_modified_time( 'c' ) ) . '\" />';\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"og:updated_time\" content=\"' . esc_attr( get_post_modified_time( 'c' ) ) . '\" />';\n\n\t\t\t\t\t// add facebook app id\n\t\t\t\t\tif ( ! empty( $info['fb_app_id'] ) ) {\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property = \"fb:app_id\" content=\"' . trim( $info['fb_app_id'] ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\t// add facebook url\n\t\t\t\t\tif ( ! empty( $info['fp_url'] ) ) {\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<meta property=\"article:publisher\" content=\"' . trim( $info['fp_url'] ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\t// append the closing comment :)\n\t\t\t\t\t$info['header_output'] .= PHP_EOL . '<!--/end meta tags by Kiwi Social Sharing Plugin -->';\n\t\t\t\t\t// Return the variable containing our information for the meta tags\n\t\t\t\t\techo $info['header_output'] . PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function ailyak_facebook_group_feed()\n{\n // fuck options!\n // hardcode everything!\n \n // @TODO remove access_token before github publishing\n $token = ''; // put your token here!\n $url = \"https://graph.facebook.com/v2.3/561003627289743/feed?limit=10&access_token={$token}\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n\n $data = curl_exec($ch);\n curl_close($ch);\n $dataDecoded = json_decode($data, true);\n $posts = $dataDecoded['data'];\n \n // I have twig template,\n // but I don't have time to\n // include twig in stupid the wordpress\n \n // yes, I know ....\n // code sux... I know...\n // Today worktime: 10h 25min\n \n $return = '\n <style>\n\n .fbcomments {\n width: 100%;\n }\n \n .fbcommentreply {\n margin-left: 30px !important;\n }\n\n .fbcomments div {\n margin: auto; \n }\n\n /* Default Facebook CSS */\n .fbbody\n {\n font-family: \"lucida grande\" ,tahoma,verdana,arial,sans-serif;\n font-size: 11px;\n color: #333333;\n }\n /* Default Anchor Style */\n .fbbody a\n {\n color: #3b5998;\n outline-style: none;\n text-decoration: none;\n font-size: 11px;\n font-weight: bold;\n }\n .fbbody a:hover\n {\n text-decoration: underline;\n }\n /* Facebook Box Styles */\n .fbgreybox\n {\n background-color: #f7f7f7;\n border: 1px solid #cccccc;\n color: #333333;\n padding: 10px;\n font-size: 13px;\n font-weight: bold;\n }\n .fbbluebox\n {\n background-color: #eceff6;\n border: 1px solid #d4dae8;\n color: #333333;\n padding: 10px;\n font-size: 13px;\n font-weight: bold;\n }\n .fbinfobox\n {\n background-color: #fff9d7;\n border: 1px solid #e2c822;\n color: #333333;\n padding: 10px;\n font-size: 13px;\n font-weight: bold;\n }\n\n .fbcomment {\n text-align: left;\n }\n\n .fberrorbox\n {\n background-color: #ffebe8;\n border: 1px solid #dd3c10;\n color: #333333;\n padding: 10px;\n font-size: 13px;\n font-weight: bold;\n }\n /* Content Divider on White Background */\n .fbcontentdivider\n {\n margin-top: 15px;\n margin-bottom: 15px;\n width: 520px;\n height: 1px;\n background-color: #d8dfea;\n }\n /* Facebook Tab Style */\n .fbtab\n {\n padding: 8px;\n background-color: #d8dfea;\n color: #3b5998;\n font-weight: bold;\n float: left;\n margin-right: 4px;\n text-decoration: none;\n }\n .fbtab:hover\n {\n background-color: #3b5998;\n color: #ffffff;\n cursor: hand;\n }\n\n </style>\n ';\n \n $return .= '<div class=\"fbcomments\">';\n foreach ($posts as $post) :\n \n array_walk_recursive($post, 'ailyak_facebook_group_feed_html_escape');\n if (!empty($post['message'])):\n $postId = $post['id'];\n $postName = $post['from']['name'];\n $message = nl2br($post['message']);\n $postTimeDatetime = new \\DateTime($post['created_time']);\n $postTime = $postTimeDatetime->format(\"M, d, D, G:h\");\n $postLink = $post['actions'][0]['link'];\n \n $return .= '\n <div class=\"fbinfobox fbcomment\"> \n <div>\n <a href=\"https://www.facebook.com/' . $postId . '\">' . $postName . '</a>,\n <a href=\"' . $postLink . '\">\n ' . $postTime . '\n </a>\n </div>\n\n ' . $message . '\n </div>\n ';\n\n if (!empty($post['comments'])):\n foreach ($post['comments']['data'] as $comment):\n $commentId = $comment['id'];\n $commentFromName = $comment['from']['name'];\n $commentMessage = nl2br($comment['message']);\n $commentDateDatetime = new \\DateTime($comment['created_time']);\n $commentDate = $commentDateDatetime->format(\"M, d, D, G:h\");\n $return .= '\n <div class=\"fbgreybox fbcommentreply\"> \n <div>\n <a href=\"https://www.facebook.com/' . $commentId . '\">' . $commentFromName . '</a>,\n ' . $commentDate . '\n </div> \n ' . $commentMessage . '\n </div>\n ';\n endforeach;\n endif;\n endif;\n endforeach;\n \n return $return;\n}", "function insert_fb_in_head()\r\n{\r\n global $post;\r\n if (!is_singular()) //if it is not a post or a page\r\n return;\r\n\r\n if ($excerpt = $post->post_excerpt)\r\n {\r\n $excerpt = strip_tags($post->post_excerpt);\r\n }\r\n else\r\n {\r\n $excerpt = get_bloginfo('description');\r\n }\r\n\r\n echo '<meta property=\"fb:app_id\" content=\"YOUR APPID\"/>'; //<-- this is optional\r\n echo '<meta property=\"og:title\" content=\"' . get_the_title() . '\"/>';\r\n echo '<meta property=\"og:description\" content=\"' . $excerpt . '\"/>';\r\n echo '<meta property=\"og:type\" content=\"article\"/>';\r\n echo '<meta property=\"og:url\" content=\"' . get_permalink() . '\"/>';\r\n echo '<meta property=\"og:site_name\" content=\"' . get_bloginfo() . '\"/>';\r\n\r\n echo '<meta name=\"twitter:title\" content=\"' . get_the_title() . '\"/>';\r\n echo '<meta name=\"twitter:card\" content=\"summary\" />';\r\n echo '<meta name=\"twitter:description\" content=\"' . $excerpt . '\" />';\r\n echo '<meta name=\"twitter:url\" content=\"' . get_permalink() . '\"/>';\r\n\r\n if (!has_post_thumbnail($post->ID))\r\n {\r\n //the post does not have featured image, use a default image\r\n $default_image = \"https://www.absolutefencinggear.com/shopping/images/Not_available.jpg\"; //<--replace this with a default image on your server\r\n echo '<meta property=\"og:image\" content=\"' . $default_image . '\"/>';\r\n echo '<meta name=\"twitter:image\" content=\"' . $default_image . '\"/>';\r\n }\r\n else\r\n {\r\n $thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium');\r\n echo '<meta property=\"og:image\" content=\"' . esc_attr($thumbnail_src[0]) . '\"/>';\r\n echo '<meta name=\"twitter:image\" content=\"' . esc_attr($thumbnail_src[0]) . '\"/>';\r\n }\r\n}" ]
[ "0.7134015", "0.69734704", "0.6950652", "0.68945396", "0.6762442", "0.6704617", "0.66035175", "0.6524725", "0.64954287", "0.64785564", "0.6419238", "0.6357457", "0.6352444", "0.6305331", "0.6249466", "0.6247981", "0.6233407", "0.62130547", "0.62030596", "0.61674535", "0.61103326", "0.60713696", "0.6056141", "0.6046659", "0.59899014", "0.5980931", "0.59722924", "0.59684604", "0.59660363", "0.5952438" ]
0.72939587
0
method check checking or token exists and in session have the same token if token exists delete them and return true.
public static function check($token){ $tokenName = Config::get('session/token_name'); if (Session::exists($tokenName) && $token === Session::get($tokenName)) { Session::delete($tokenName); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function check($token) {\r\n\t\t$tokenName = Config::get('session/token_name');\r\n\r\n\t\tif (Session::exists($tokenName) && $token === Session::get($tokenName)) {\r\n\t\t\tSession::delete($tokenName);//dont need it any more\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public static function check($token) \n{\n // set the `$tokenKey variable` by calling `get method` on `Config object`\n $tokenKey = Config::get('session.tokenKey'); // returns string\n\n /* checks whether `token` KEY exists in the `$_SESSION[] array` AND\n `form's token value` is equal to `token VALUE` in the `$_SESSION[] array` */\n if(Session::exists($tokenKey) && $token == Session::get($tokenKey)) {\n Session::delete($tokenKey);\n return true;\n }\n\n return false;\n}", "public static function check($token){\n\t\t$tokenName = Config::get('session/token_name');\t\t\t\t\t\t\t\t\n\n\t\tif(Session::exists($tokenName) && $token === Session::get($tokenName)){\t\t// Checkif the token supplied by the form is equal to the session token.\n\t\t\tSession::delete($tokenName);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Return false if none of the above is true.\n\t}", "protected function check_tok($token)\r\n {\r\n if (isset($_SESSION['token']) && $token === $_SESSION['token'])\r\n {\r\n unset($_SESSION['token']);\r\n return true;\r\n }\r\n return false;\r\n }", "function isTokenValid($token){\n if(!empty($_SESSION['tokens'][$token])){\n unset($_SESSION['tokens'][$token]);\n return true;\n }\n return false;\n}", "protected function checkSessionToken() {}", "function checkToken($token){\n\t\tif(checkTimeout($token)){\n\t\t\treturn false;\n\t\t}else{\n\t\t\tif(isset($_SESSION[$token])){\n\t\t\t\tif($_SESSION[$token] == $_GET['token']){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function token_exist($token): bool\r\n{\r\n\tglobal $DATABASE;\r\n\t\r\n\ttoken_invalidate();\r\n\t\r\n\tif($token == NULL) return false;\r\n\t\r\n\tforeach($DATABASE->execute_query(\"SELECT token FROM `logged_in`\") as $value)\r\n\t\tif(strcmp($value[0], $token) == 0)\r\n\t\t\treturn true;\r\n\t\r\n\treturn false;\r\n}", "static function tokenGatekeeper() {\n $token = getInput(\"token\");\n $session_token = Cache::get(\"token\", \"session\");\n if ($token == $session_token) {\n return true;\n }\n return false;\n }", "public static function check_token($token)\r\n {\r\n if ($token == $_SESSION['token'])\r\n return true;\r\n\r\n return false;\r\n }", "public function checkToken() {\n if (!isset($this->requestToken)) {\n trigger_error(tr('Request token missing. Is the session module missing?'), E_USER_WARNING);\n return false;\n }\n if (!isset($this->data['access_token'])) {\n return false;\n }\n return $this->requestToken->getToken() === $this->data['access_token'];\n }", "public function ssoTokenExists() {\n if ($this->httpSession != null && array_key_exists('maestrano', $this->httpSession)) {\n return true;\n }\n\n return false;\n }", "public function regenerateSessionAuthToken(): bool;", "public function isValidSession(string $token):bool;", "function checkAuthToken() {\n if ( !isset( $_POST['authToken'] ) || $_POST['authToken'] != $_SESSION['authToken'] ) {\n logout();\n return false;\n } else {\n return true;\n }\n}", "protected function _isNewToken()\n {\n $info = $this->_quote->getPayment();\n Mage::helper('ewayrapid')->unserializeInfoInstace($info);\n if ($token = Mage::getSingleton('core/session')->getData('newToken')) {\n Mage::getSingleton('core/session')->unsetData('newToken');\n return true;\n }\n return false;\n }", "function Check() {\n\t\t// Check if the token has been sent.\n\t\tif(isset($_REQUEST['spack_token'])) {\n\t\t\t// Check if the token exists\n\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t// Check if the token isn't empty\n\t\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t\t$age = time()-$_SESSION[\"spackt_\".$_REQUEST['spack_token']];\n\t\t\t\t\t// Check if the token did not timeout\n\t\t\t\t\tif($age > $this->timeout*60) $this->error = 4;\n\t\t\t\t}\n\t\t\t\telse $this->error = 3;\n\t\t\t}\n\t\t\telse $this->error = 2;\n\t\t}\n\t\telse $this->error = 1;\n\t\t// Anyway, destroys the old token.\n\t\t$this->tokenDelAll();\n\t\tif($this->error==0) return true;\n\t\telse return false;\n\t}", "public function checkToken(string $token)\n {\n if ($token = Token::select()->where('token', $token)->first()) {\n if (new DateTime($token->getAttribute('expire')) < $this->timeService->getDate()) {\n $this->deleteToken($token);\n return false;\n } else {\n $this->renewToken($token);\n $token->save();\n return true;\n }\n }\n return false;\n }", "public function isTokenValid() {\n if (!isset($_SESSION['token']) || $this->_token != $_SESSION['token'])\n \n\t\t\t$this->_errors[] = 'invalid submission';\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "public function ssoInvalidateToken($token)\n {\n $apiEndpoint = '/1/session/'.$token;\n $apiReturn = $this->runCrowdAPI($apiEndpoint, \"DELETE\", array());\n if ($apiReturn['status'] == '204') {\n return true;\n }\n return false;\n }", "function checkToken() {\n\t\t\t// Split the token up again to make sure the first 40 chars are the same (TOKEN)\n\t\t\t$splitToken = substr($this->tokenFromCookie, 0, 40);\n\t\t\t\n\t\t\t// Split the token up again to make sure the second 40 chars are the same (ZIPPED)\n\t\t\t$splitZipped = substr($this->tokenFromCookie, 40, 40);\n\t\t\t\n\t\t\t// Unzip the second 40 chars\n\t\t\t$result = $this->unzip($splitZipped);\n\n\t\t\t// Check if the sha of the zipped portion matches the token.\n\t\t\t// If so, no one has messed with the token\n\t\t\tif(strcmp($splitToken, sha1($splitZipped) == 0)) {\n\t\t\t\t// Grab all data from unzip\n\t\t\t\t$ip = base_convert($result[0], IP_ADDRESS, 10);\n\t\t\t\t$time = base_convert($result[1], REQUEST_TIME, 10);\n\t\t\t\t$user = $result[2];\n\t\t\t\t$random = $result[3];\n\t\t\t\t$expires = substr($this->tokenFromCookie, 80, strlen($this->tokenFromCookie));\n\n\t\t\t\t// Check if token is expired after one hour\n\t\t\t\tif(time() - $expires <= 3600) {\n\t\t\t\t\tif(strpos($_SERVER['REMOTE_ADDR'], \":\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\":\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\telseif(strpos($_SERVER['REMOTE_ADDR'], \".\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\".\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Check if userIp is the same as when s/he originally logged in\n\t\t\t\t\t$validity = (strcmp($ip, $userIpAddImp) == 0) ? true : false;\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\t$validity = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$validity = false;\n\t\t\t}\n\t\t\t\n\t\t\treturn $validity;\n\t\t}", "public function hasSessionToken()\n\t{\n\t\treturn \\Session::has('google.access_token');\n\t}", "function checkDeviceToken()\n {\n $sql = $this->db->select('id')->where('deviceToken', $deviceToken)->get('users');\n if($sql->num_rows())\n {\n $id = array();\n foreach($sql->result() as $result)\n {\n $id[] = $result->id;\n }\n $this->db->where_in('id', $id);\n $this->db->update('users',array('deviceToken'=>''));\n\n if($this->db->affected_rows() > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n return true;\n }", "public function checkToken( )\n {\n\n $this->getTokenPost();\n if ( $this->token_post && $this->is_active() ) {\n if (empty($this->project_id) || $this->project_id != $this->token_post['meta_data']['pr-projekt'][0]) {\n $this->set_result_error('notfound');\n return false;\n }\n return $this->result;\n } else {\n return false;\n }\n\n }", "public function hasToken();", "public static function validToken()\r\n {\r\n $header = apache_request_headers();\r\n if(!isset($_SESSION['CSRF_TOKEN']) || !isset($header['CSRF_TOKEN']) || $header['CSRF_TOKEN'] != $_SESSION['CSRF_TOKEN']){\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }", "public function validateToken($token, $maxAge = 300){\n $this->maxAge = $maxAge;\n if($token != $_SESSION['token'] || ((time() - (int)$_SESSION['tokenAge']) > (int)$this->maxAge)){\n return false;\n }else{\n unset($_SESSION['token'], $_SESSION['tokenAge']);\n return true;\n }\n }", "function csrf_token_is_valid() {\n\tif(isset($_POST['csrf_token'])) {\n\t\t$user_token = $_POST['csrf_token'];\n\t\t$stored_token = $_SESSION['csrf_token'];\n\t\treturn $user_token === $stored_token;\n\t} else {\n\t\treturn false;\n\t}\n}", "static function isValid($user, $token){\n\n\t\t$verificationToken = self::get(\"user = $user->id AND token = '$token'\");\n\t\tif($verificationToken && time() - strtotime($verificationToken->createdOn) + $verificationToken->lifespan > 0){\n\n\t\t\t$result = true;\n\t\t\t$verificationToken->delete();\n\t\t}\n\t\telse{\n\n\t\t\t$result = false;\n\t\t}\n\t\treturn $result;\n\t}" ]
[ "0.8104914", "0.8099782", "0.8097319", "0.800509", "0.7889978", "0.7459198", "0.74321926", "0.72856367", "0.7197678", "0.71761227", "0.7157418", "0.70978606", "0.7001567", "0.6988043", "0.6958434", "0.6947647", "0.69197774", "0.6891097", "0.6850057", "0.6777711", "0.67703754", "0.67551863", "0.6742724", "0.6739903", "0.67373514", "0.6700945", "0.66755587", "0.6653728", "0.66477543", "0.66407084" ]
0.8151756
0
Default "to string" handler Allows pages to _p()/echo()/print() this object, and to define the default way this object would be outputted. Can also be called directly via $objGroupParticipation>__toString().
public function __toString() { return sprintf('GroupParticipation Object %s', $this->intId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __toString()\n {\n return Text::format(self::DEFAULT_TO_STRING, get_class($this));\n }", "public function __toString()\n\t{\n\t\tswitch ($this->last_called) {\n\t\t\tcase \"Get_Documents_By_Name\":\n\t\t\tcase \"Get_Documents\":\n\t\t\tcase \"Get_Document_List\":\n\t\t\t\treturn $this->formatDocumentList();\n\t\t\t\t\n\t\t\tcase \"Get_Document_Log\":\n\t\t\tcase \"Log_Document\":\n\t\t\tcase \"Send_Document\":\n\t\t\tcase \"Get_Document_Id\":\n\t\t\tcase \"Get_Application_Data\":\n\t\t\tcase \"Get_Application_History\":\n\t\t\tdefault:\n\t\t\t\treturn $this->obj->__toString();\n\t\t}\n\t}", "public function __toString()\n {\n return (string) $this->exportTo(SekolahPaudPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString()\n {\n return (string) $this->exportTo(SanitasiPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString () {\r\n\t\treturn '';\r\n\t}", "public function __tostring();", "public function __toString()\n\t{\n\t\treturn \n\t\t\t'$id\t\t\t\t: ' . $this->id .\t\t\t\t'<br/>' .\n\t\t\t'$id_person\t\t\t: ' . $this->id_person .\t\t\t'<br/>' .\n\t\t\t'$aanvraag\t\t\t: ' . $this->aanvraag .\t\t\t'<br/>' .\n\t\t\t'$invitation\t\t: ' . $this->invitation\t . '<br/>' .\n\t\t\t'$invitationSent\t: ' . $this->invitationSent . '<br/>' .\n\t\t\t'$reaction\t: ' . $this->reaction . '<br/>';\n\t\t\t'$emailadres\t: ' . $this->emailadres . '<br/>';\n\t}", "public function __toString()\n {\n return (string) $this->exportTo(JadwalPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();" ]
[ "0.6584186", "0.64531374", "0.6373067", "0.63469106", "0.6318043", "0.63144076", "0.6307043", "0.62735796", "0.6257036", "0.6257036", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803", "0.62569803" ]
0.7102918
0
Returns true if the user requested to serialize the output data (&serialize=1 in the request)
private function shouldSerialize() { $serialize = Common::getRequestVar('serialize', 0, 'int', $this->request); return !empty($serialize); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isOutputting() {}", "public static function serialized(string $name): bool\n {\n return static::$serialize;\n }", "public function isSerialized()\n {\n if (!isset($this->str[0])) {\n return false;\n }\n\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n if (\n $this->str === 'b:0;'\n ||\n @unserialize($this->str) !== false\n ) {\n return true;\n } else {\n return false;\n }\n }", "public function serialize($value) : bool\n {\n }", "protected function caseRendererPHPSerialize($defaultSerializeValue = 1)\n\t{\n\t\t$serialize = Piwik_Common::getRequestVar('serialize', $defaultSerializeValue, 'int', $this->request);\n\t\tif($serialize)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function isOutputSet ()\n\t{\n\t\tif (!$this->outputFile)\n\t\t{\n\t\t\treturn $this->stop('no output file is set');\n\t\t}\n\n\t\tif (!is_file($this->outputFile))\n\t\t{\n\t\t\treturn $this->stop('requested file doesn\\'t exist or cannot be read');\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "abstract public function getIsSerializedAttribute() : bool;", "public static function bufferOutputEnabled(): bool\n {\n $configuration = DynamicalWeb::getWebConfiguration();\n\n if(isset($configuration[\"configuration\"][\"buffer_output\"]))\n {\n return (bool)$configuration[\"configuration\"][\"buffer_output\"];\n }\n\n return true;\n }", "function allowserialize($propname)\r\n {\r\n return(true);\r\n }", "public static function hasOutput()\n {\n $session = self::getSession();\n return isset($session->content);\n }", "public static function isSerialized($data) {\n return (@unserialize($data) !== false);\n }", "public function isSavable(): bool\n {\n return true;\n }", "public function hasOutput()\n {\n return count($this->_otherOutput) + count($this->_formsOutput) > 0;\n }", "function _outputTree () {\r\n if ($this->_noOutput) {\r\n return true;\r\n }\r\n $output = $this->_outputNode ($this->_root);\r\n if (is_string ($output)) {\r\n $this->_output = $this->_applyPostfilters ($output);\r\n unset ($output);\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "private function isSerialized($value)\n {\n $data = @unserialize($value);\n if ($value === 'b:0;' || $data !== false) {\n return true;\n } else {\n return false;\n }\n }", "function _outputTree () {\r\n // this could e.g. call _applyPostfilters\r\n return true;\r\n }", "function generateOutput () {\n $this->outputMode = 0;\n if (!$this->generateOutputPage()) return false;\n return true; }", "public function isSerializable($data = null)\n {\n if (is_object($data) || is_array($data)) {\n return true;\n }\n\n return false;\n }", "public static function isSerialized($str) {}", "public function isReturnAdditionalDataOnResponse(): bool\n {\n return $this->returnAdditionalDataOnResponse;\n }", "public function serialize()\n\t{\n\t\t// Load all of the inputs.\n\t\t$this->loadAllInputs();\n\n\t\t// Remove $_ENV and $_SERVER from the inputs.\n\t\t$inputs = $this->inputs;\n\t\tunset($inputs['env']);\n\t\tunset($inputs['server']);\n\n\t\t// Serialize the executable, args, options, data, and inputs.\n\t\treturn serialize(array($this->calledScript, $this->args, $this->filter, $this->data, $inputs));\n\t}", "public function isSerializerEnabled()\n {\n $this->initialize();\n return $this->serializerEnabled;\n }", "function maybe_serialize($data)\n {\n }", "public function isOutputDecorated();", "public function serialize();", "public function serialize();", "public function serialize();", "public abstract function serialize();", "private function __isExportFieldSpecified(){\r\n if(empty($this->data)){\r\n return false;\r\n }\r\n /* Define an empty query object */\r\n $specified = array(\r\n 'fields' => array(),\r\n 'order' => null,\r\n 'conditions' => array()\r\n );\r\n /* Handle posted fields */\r\n $data = $this->data['Student']['export'];\r\n $fields = $data['fields'];\r\n foreach($fields as $field=>$value){\r\n if($value){\r\n $specified['fields'][] = $field;\r\n }\r\n }\r\n /* Set sort orders */\r\n $specified['order'] = 'Student.'.$data['order']['by'];\r\n $specified['order'] .= $data['order']['order'] ? ' ASC' : ' DESC';\r\n return $specified;\r\n }", "abstract public function serialize();" ]
[ "0.6654072", "0.6415039", "0.63699776", "0.6330348", "0.63162905", "0.6225804", "0.6064652", "0.6011371", "0.59884924", "0.594241", "0.5907368", "0.59025705", "0.587237", "0.5847748", "0.5745106", "0.5695224", "0.5662562", "0.56160754", "0.5597635", "0.5592475", "0.5576934", "0.55740833", "0.55683994", "0.5563934", "0.5560726", "0.5560726", "0.5560726", "0.5545815", "0.5535231", "0.550162" ]
0.76032305
0
Extract the second of a day from a DateTime object
private function datetime2second($date) { return intval($date->format('G'))*3600+intval($date->format('i'))*60+intval($date->format('s')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stampToSecond($stamp)\n {\n $date = Calendar_Engine_PearDate::stampCollection($stamp);\n return (int)$date->second;\n }", "function get_day()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"mday\"];\n }", "function second()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n\r\n return $second;\r\n }", "public function day() {\n return $this->day;\n }", "public static function getDaySecondsOfDateTime(\\DateTimeInterface $dateTime): int\n {\n $hours = (int)$dateTime->format('G');\n $minutes = $hours * self::SECONDS_MINUTE + (int)$dateTime->format('i');\n\n return $minutes * self::SECONDS_MINUTE + (int)$dateTime->format('s');\n }", "public function getDayOrdinal()\r\n\t{\r\n\t\treturn $this->format('jS');\r\n\t}", "public function getSecond(string $field = 'created_at'): string\n {\n return $this->parseCarbon($this->$field)->format(\"s\");\n }", "public function getDay() : int \n {\n return $this->day;\n }", "public function getFirstDay(){$day = getdate(mktime(0, 0, 0, $this->getMonth(), 1, $this->getYear())); return $day['wday'];}", "public function getDay()\n {\n return $this->day;\n }", "public function getDay()\n {\n return $this->day;\n }", "protected function getDay(string $day) {\n return $day;\n }", "public function getDay()\n {\n return $this->_getDateValue('d');\n }", "function DateToSec($date)\n{\n $date = ltrim($date);\n $arr = explode(\"-\", $date);\n if( count($arr) == 1 ) {\n $arr = explode(\"/\", $date);\n }\n if( count($arr) != 3 ) {\n return \"\";\n }\n return(mktime(0,0,0, $arr[0], $arr[1], $arr[2]));\n}", "public function getForecastDay($day)\n {\n return $this->_periods[$day];\n }", "function unix_to_jd($t) {\n\t\treturn ( UNIX_EPOCH + t / SECS_IN_DAY);\n\t}", "function getDay(){\r\n return date('l',$this->timestamp);\r\n }", "public static function getNormalizedDaySecondsOfDateTime(\\DateTimeInterface $dateTime): int\n {\n $date = self::normalizeDateTimeSingle($dateTime);\n\n return self::getDaySecondsOfDateTime($date);\n }", "public static function getDateFromSeconds($scd) {\n $date = date('m/d/Y h:i:s', time());\n $stamp = strtotime($date) - $scd;\n return date(\"d/m/y\", $stamp);\n }", "function date_day($date){\r\n\t$day = NULL;\r\n\tfor($i = 0; $i < strlen($date); $i++){\r\n\t\tif(is_numeric(substr($date, $i, 1))){\r\n\t\t\t$day .= substr($date, $i, 1);\r\n\t\t}else{\r\n\t\t\treturn $day;\r\n\t\t}\r\n\t}\r\n\treturn $day;\r\n}", "function day($day= 1)\n{\n return $day * 24 * 60 *60;\n}", "function day_from_iso_date($date) {\n $datetime = date_create($date);\n $d = date_format($datetime,\"D\");\n switch ($d) {\n case 'Sun':\n return 1;\n case 'Mon':\n return 2;\n case 'Tue':\n return 3;\n case 'Wed':\n return 4;\n case 'Thu':\n return 5;\n case 'Fri':\n return 6;\n case 'Sat':\n return 7;\n default:\n return 0;\n }\n}", "public function getDay(){\n\t\treturn $this->_day;\n\t}", "function getrsstime($d) \r\n{ \r\n $parts=explode(' ',$d); \r\n $month=$parts[2]; \r\n $monthreal=getmonth($month);\r\n $time=explode(':',$parts[4]); \r\n $date=\"$parts[3]-$monthreal-$parts[1] $time[0]:$time[1]:$time[2]\"; \r\n return $date;\r\n}", "function get_day_of_week($day)\n{\n return jddayofweek($day, 1);\n}", "public function getTimeOfDay() {\n\t\treturn $this->_time_of_day;\n\t}", "function int_to_day($int){\n\tglobal $days;\n\treturn $days[$int];\n}", "function DateTimeToInt ($s) {\n\tGlobal $iTimeType;\n\t\n\t$y = (int)substr($s, 0, 4);\t\t// year\n\t$m = (int)substr($s, 4, 2);\t\t// month\n\t$d = (int)substr($s, 6, 2);\t\t// day\n\t$h = (int)substr($s, 8, 2);\t\t// hour\n\t$n = (int)substr($s,10, 2);\t\t// minute\n\t\n\tif ($m < 1) $m = 1;\n\tif (12 < $m) $m = 12;\n\tif ($d < 1) $d = 1;\n\tif (31 < $d) $d = 31;\n\tif ($h < 0) $h = 0;\n\tif (23 < $h) $h = 23;\n\tif ($n < 0) $n = 0;\n\tif (59 < $n) $n = 59;\n\t\n\tif ($iTimeType == 1) {\n\t\t$z = (int)substr($s,12, 2);\t// second\n\t\tif ($y < 1970) $y = 1970;\n\t\tif (2037 < $y) $y = 2037;\n\t\tif ($z < 0) $z = 0;\n\t\tif (59 < $z) $z = 59;\n\t\treturn mktime($h,$n,$z,$m,$d,$y);\n\t}\n\t\n\t$y -= 2000;\n\tif ($y < 0) $y = 0;\n\tif (213 < $y) $y = 213;\n\treturn ($y*10000000)+((50+$m*50+$d)*10000) + ($h*100) + $n;\t// 3+3+2+2\n}", "public function calculateDay()\r\n {\r\n return date('N', strtotime($this->getDate())) - 1;\r\n }", "public static function getSecondsToWholeDays($seconds) {\n\t\treturn round($seconds / (3600 * 24));\n\t}" ]
[ "0.58714426", "0.58472395", "0.5830755", "0.54943687", "0.543878", "0.54035527", "0.5393143", "0.53861195", "0.53767323", "0.5329648", "0.5329648", "0.53255045", "0.53186613", "0.52984077", "0.52660316", "0.52089304", "0.5203206", "0.5190748", "0.51672184", "0.5164698", "0.513569", "0.5124702", "0.51034254", "0.5095188", "0.50144905", "0.5013839", "0.50011754", "0.4990979", "0.49756607", "0.4963532" ]
0.6039
0
Validate a date against the library date range
private function validateDate($date) { $dateHead = new \DateTime(); $dateTail = (new \DateTime('+2 weeks, +1 day'))->modify('midnight'); if ($date < $dateHead || $date >= $dateTail) { throw new Exceptions\InvalidDateException('Date outside acceptable range'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateDate()\n {\n if (\n ($from = $this->getAvailableFrom()) &&\n ($till = $this->getAvailableTill()) &&\n $from->InPast() &&\n $till->InFuture()\n ) {\n return true;\n }\n\n return false;\n }", "function check_date($date_str)\r\n{\r\n\tif (strlen($date_str) != 10) return false;\r\n\t$pattern = \"/[0-9]{4}-[0-9]{2}-[0-9]{2}/\";\r\n\tif (!preg_match($pattern, $date_str)) return false;\r\n\t// correct format, now check ranges\r\n\treturn strtotime($date_str);\r\n}", "function is_valid_date_range($date_start, $date_end){\n $d1 = strtotime($date_start);\n $d2 = strtotime($date_end);\n\n if($d2 >= $d1){\n return true;\n }else{\n return false;\n }\n\n}", "public function checkDateRange($date,$dateRange){\r\r\n\t\t\t//provide date in format m/d/y\r\r\n\t\t\tlist($month, $day, $year) = split(\"/\", $date);\r\r\n\t\t\t$month = (int)$month;\r\r\n\t\t\t$day = (int)$day;\r\r\n\t\t\t$year = (int)$year;\r\r\n\t\t\t$fails = false;\r\r\n\t\t\tif ($year >= $dateRange['startYear'] && $year <= $dateRange['endYear']){\r\r\n\t\t\t\t//if year is within B-E\r\r\n\t\t\t\tif($year == $dateRange['startYear'] ){\r\r\n\t\t\t\t\t//Y=B\r\r\n\t\t\t\t\tif($month >= $dateRange['startMonth']){\r\r\n\t\t\t\t\t\tif($month == $dateRange['startMonth']){\r\r\n\t\t\t\t\t\t\tif($day >= $dateRange['startDay']){\r\r\n\t\t\t\t\t\t\t\t// start < contactDate\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif($year == $dateRange['endYear'] ){\r\r\n\t\t\t\t\tif($month <= $dateRange['endMonth']){\r\r\n\t\t\t\t\t\tif($month == $dateRange['endMonth']){\r\r\n\t\t\t\t\t\t\tif($day <= $dateRange['endDay']){\r\r\n\t\t\t\t\t\t\t\t// end > contactDate\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t}else{\r\r\n\t\t\t\t$fails = true;\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\tif($fails){\r\r\n\t\t\t\treturn false;\r\r\n\t\t\t} else {\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t}", "function valida_dates($enter_date, $obsolescense_date)\n{\n $day1 = substr($enter_date, 0, 2);\n $month1 = substr($enter_date, 3, 2);\n $year1 = substr($enter_date, 6, 4);\n $day2 = substr($obsolescense_date, 0, 2);\n $month2 = substr($obsolescense_date, 3, 2);\n $year2 = substr($obsolescense_date, 6, 4);\n\n if ($enter_date <= $obsolescense_date) {\n return true;\n }\n\n return false;\n}", "function validate_date($date) {\n $d = \\DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') === $date;\n }", "private function checkDatesValidity(){\n\t\t$valid=true;\n\t\t$today = date(\"Y-m-d\");\n\t\tif($this->validFrom!=\"\" && $this->validFrom!=\"0000-00-00\" && $today<$this->validFrom) $valid=false;\n\t\tif($this->validUntil!=\"\" && $this->validUntil!=\"0000-00-00\" && $today>$this->validUntil) $valid=false;\n\t\treturn $valid;\n\t}", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "public function isValidDate() {\n\t\t// TODO\n\t\treturn TRUE;\n\t}", "public static function validate_date( $date )\n {\n return preg_match(\n '/^(19|20)\\d\\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/',\n $date );\n }", "function validateDateRange($date1, $date2){\n\treturn ( strtotime($date1) - strtotime($date2) ) <= 0;\t//should be a negative number, or 0 if posts=expiration\n}", "function is_date_valid($date)\n{\n $is_date_valid = false;\n\n if (strtotime($date)) {\n list($day, $month, $year) = explode('.', $date);\n $is_date_valid = checkdate($month, $day, $year);\n }\n\n return $is_date_valid;\n}", "public function validateDates(&$start, &$end) {\n $sixMonthsAgo = strtotime(\"-6 months\");\n $day = 86400;\n $end = time();\n \n if (!$start) {\n $start = strtotime(\"-7 days\");\n }\n \n $gap = $end - $start; \n \n //Don't mess the dates!\n switch ($gap) {\n case $gap < ($day * 31) :\n $gap = $day * 7;\n break;\n\n case $gap < ($day * 180) ://6 months\n $gap = $day * 31;\n break;\n \n case $gap >= ($day * 180) : \n default : \n $gap = $day * 180; \n break;\n }\n \n $end = time();\n $start = $end - $gap;\n }", "function validaNascimento($ano, $mes, $dia)\n{\n\n $dataCheck = $ano.'-'.$mes.'-'.$dia;\n if (checkdate($mes, $dia, $ano) && $dataCheck<=date('Y-m-d'))\n return true;\n else return false;\n}", "protected function validateDate($value) {\n if (preg_match(\"/^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$/\", $value))\n return true;\n $this->setError(t(\"Invalid date (YYYY-MM-DD)\"));\n return false;\n }", "function valid_date($date){\r\n\t$day = date_day($date);\r\n\t$month = date_month($date);\r\n\t$year = date_year($date);\r\n\tif(!is_numeric($day) || !is_numeric($month) || !is_numeric($year)){\r\n\t\treturn FALSE;\r\n\t}elseif($month < 1 || $month > 12){\r\n\t\treturn FALSE;\r\n\t}elseif(($day < 1) || ($day > 30 && ($month == 4 || $month == 6 || $month == 9 || $month == 11 )) || ($day > 31)){\r\n\t\treturn FALSE;\r\n\t}elseif($month == 2 && ($day > 29 || ($day > 28 && (floor($year / 4) != $year / 4)))){\r\n\t\treturn FALSE;\r\n\t}else{\r\n\t\treturn TRUE;\r\n\t}\r\n}", "function isDateValid($dateInput){\n\t\t$d = DateTime::createFromFormat('Y-m-d', $dateInput);\n\t\treturn $d && $d->format('Y-m-d') === $dateInput;\n\t}", "public function testValidationOk($date)\n {\n // We set the \"fake\" time with timeTravel method\n $this->timeTravel('2018-11-26 00:00:00');\n $notPastDateConstraint = new NotPastDate();\n $notPastDateValidator = $this->initValidator();\n\n $this->purchase->setDateOfVisit($date);\n $notPastDateValidator->validate($this->purchase, $notPastDateConstraint);\n }", "function isValidDate($date) {\n $d = DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') == $date;\n}", "public function isValidPaydate($date);", "function valid_date( $value = '', $format = 'Y-m-d H:i:s' )\n\t{\n\t\t$date = date_parse($value);\n\t\t$valid = ( $date['error_count'] == 0 && checkdate($date['month'], $date['day'], $date['year']) );\n\t\t\n\t\t/*\n\t\t// Create a date depending on PHP version\n\t\t$version = explode('.', phpversion());\n\t\tif (((int) $version[0] >= 5 && (int) $version[1] >= 2 && (int) $version[2] > 17))\n\t\t{\n\t\t\t$d = DateTime::createFromFormat($format, $date);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$d = new DateTime(date($format, strtotime($date)));\n\t\t}\n\t\t*/\n\t\t/*\n\t\t// Check valid date\n\t\t$format = 'Y-m-d H:i:s';\n\t\t$d = new DateTime(date($format, strtotime($date)));\n\t\t$valid_date = ( $d && $d->format($format) == $date );\n\t\t// or\n\t\t$date = date_parse($date);\n\t\t$valid_date = ( $date['error_count'] == 0 && checkdate($date['month'], $date['day'], $date['year']) );\n\t\tif ( ! $valid_date )\n\t\t{\n\t\t\t$valid = false;\n\t\t\t$return_message[] = 'The approved date is invalid.';\n\t\t}\n\t\t*/\n\t\t\n\t\tif ( ! $valid )\n\t\t{\n\t\t\t$this->set_message('valid_date', 'The %s field has in invalid date.');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function isDateValid($date) {\r\n //$uy = $uyear->format(\"Y\");\r\n //$sy = date(\"Y\");\r\n \r\n if(preg_match('^(((0[1-9]|[12]\\d|3[01])\\/(0[13578]|1[02])\\/((19|[2-9]\\d)\\d{2}))|((0[1-9]|[12]\\d|30)\\/(0[13456789]|1[012])\\/((19|[2-9]\\d)\\d{2}))|((0[1-9]|1\\d|2[0-8])\\/02\\/((19|[2-9]\\d)\\d{2}))|(29\\/02\\/((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$^', $date))\r\n return false;\r\n else\r\n return true;\r\n \r\n}", "public static function validateDate($date) {\r\n if(preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\", $date)) // has to be YYYY-MM-DD\r\n {\r\n $dt = new DateTime($date);\r\n $d = $dt->format(self::dateDay);\r\n $m = $dt->format(self::dateMonth);\r\n $y = $dt->format(self::dateYear);\r\n if(!checkdate($m, $d, $y))\r\n {\r\n throw new Exception(\"Das Datum [\".$date.\"] entspricht keinem g&uuml;ltigen Format\");\r\n }\r\n else\r\n {\r\n return true; \r\n }\r\n }\r\n else\r\n {\r\n throw new Exception(\"Das Datum [\".$date.\"] entspricht nicht dem Format 'YYYY-MM-DD'\");\r\n }\r\n }", "protected function isValidDate($value)\n\t{\n\t\t$minValue=$this->getMinValue();\n\t\t$maxValue=$this->getMaxValue();\n\t\t \n\t\t$valid=true;\n\n\t\t$dateFormat = $this->getDateFormat();\n\t\tif (strlen($dateFormat)) \n\t\t{\n\t\t\t$value = pradoParseDate($value, $dateFormat);\n\t\t\tif (strlen($minValue)) \n\t\t\t\t$valid=$valid && ($value>=pradoParseDate($minValue, $dateFormat)); \n\t\t\tif (strlen($maxValue)) \n\t\t\t\t$valid=$valid && ($value <= pradoParseDate($maxValue, $dateFormat));\n\t\t\treturn $valid;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$value=strtotime($value);\n\t\t\tif(strlen($minValue))\n\t\t\t\t$valid=$valid && ($value>=strtotime($minValue));\n\t\t\tif(strlen($maxValue))\n\t\t\t\t$valid=$valid && ($value<=strtotime($maxValue));\n\t\t\treturn $valid;\n\t\t} \n\t}", "public static function validateDate($input)\r\n\t{\r\n\t\treturn preg_match('/\\d{2}-\\d{2}-\\d{4}/', $input) && (strlen($input) == 10);\r\n\t}", "function verifyDate($date, $date_format)\n {\n $datetime=DateTime::createFromFormat($date_format, $date);\n $errors=DateTime::getLastErrors();\n if (!$datetime || !empty($errors['warning_count'])) //date was invalid\n {\n $date_check_ok=false;\n }\n else //everything OK\n {\n $date_check_ok=true;\n }\n\n return $date_check_ok;\n }", "public function checkDateWithInvalidDateValuesDataProvider() {}", "function validateDate($date_joined) {\n if((preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date_joined))) {\n list( $y, $m, $d ) = preg_split( '/[-\\.\\/ ]/', $date_joined );\n return (checkdate( $m, $d, $y ) && ($y >= date('Y') - 2) && ($y <= date('Y')));\n } else {\n // wrong format, convert to correct format\n $date_joined = date('Y-m-d', strtotime(str_replace('-', '/', $date_joined)));\n list( $y, $m, $d ) = preg_split( '/[-\\.\\/ ]/', $date_joined );\n return (checkdate( $m, $d, $y ) && ($y >= date('Y') - 2) && ($y <= date('Y')));\n }\n }", "function is_date_format_valid($date)\n{\n return preg_match(\"/(0[1-9]|[12][0-9]|3[01])[ \\.](0[1-9]|1[012])[ \\.](19|20)\\d\\d/\", $date) !== 0;\n}" ]
[ "0.7795238", "0.73932344", "0.7290823", "0.7254914", "0.720043", "0.7170928", "0.71708786", "0.7164757", "0.7164757", "0.7162809", "0.71460426", "0.7125207", "0.71076894", "0.71010727", "0.7009659", "0.6985997", "0.6983555", "0.69765687", "0.6964718", "0.69596475", "0.6943207", "0.689521", "0.6892125", "0.68699086", "0.68404174", "0.6797642", "0.6770373", "0.6763908", "0.67591375", "0.6758442" ]
0.74756885
1
Test case to assert the event middleware definition is created correctly.
public function testGetEventMiddlewareDefinition() { $clientName = 'clientName'; $eventMiddleware = $this->subject->getEventMiddlewareDefinition($clientName); $this->assertCount(2, $eventMiddleware->getArguments()); $this->assertSame('%mapudo.guzzle.middleware.event_dispatch_middleware.class%', $eventMiddleware->getClass()); // Assert the Reference has been set correctly /** @var Reference $reference */ $reference = $eventMiddleware->getArgument(0); $this->assertInstanceOf(Reference::class, $reference); $this->assertSame('event_dispatcher', $reference->__toString()); $this->assertSame(ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $reference->getInvalidBehavior()); // Assert the client name $this->assertSame($clientName, $eventMiddleware->getArgument(1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetHandlerDefinition()\n {\n $clientName = 'clientName';\n\n /** @var ContainerBuilder|ObjectProphecy $container */\n $container = $this->prophesize(ContainerBuilder::class);\n\n $middleware = ['test_middleware' => [\n ['method' => 'attach']\n ]];\n\n $handler = $this->subject->getHandlerDefinition($container->reveal(), $clientName, $middleware);\n\n // Test basic stuff\n $this->assertSame('%guzzle_http.handler_stack.class%', $handler->getClass());\n $this->assertSame(['%guzzle_http.handler_stack.class%', 'create'], $handler->getFactory());\n\n $methodCalls = $handler->getMethodCalls();\n // Count is the number of the given middleware + the default event and log middleware expressions\n $this->assertCount(3, $methodCalls);\n\n $customMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('push', array_shift($customMiddlewareCall));\n /** @var Expression[] $customMiddlewareExpressions */\n $customMiddlewareExpressions = array_shift($customMiddlewareCall);\n $customMiddlewareExpression = array_shift($customMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $customMiddlewareExpression);\n $this->assertSame('service(\"test_middleware\").attach()', $customMiddlewareExpression->__toString());\n\n $logMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('push', array_shift($logMiddlewareCall));\n /** @var Expression[] $logMiddlewareExpressions */\n $logMiddlewareExpressions = array_shift($logMiddlewareCall);\n $logMiddlewareExpression = array_shift($logMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $logMiddlewareExpression);\n $this->assertSame(\n 'service(\"guzzle_bundle.middleware.log.clientName\").log()',\n $logMiddlewareExpression->__toString()\n );\n\n $eventDispatchMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('unshift', array_shift($eventDispatchMiddlewareCall));\n /** @var Expression[] $eventDispatchMiddlewareExpressions */\n $eventDispatchMiddlewareExpressions = array_shift($eventDispatchMiddlewareCall);\n $eventDispatchMiddlewareExpression = array_shift($eventDispatchMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $eventDispatchMiddlewareExpression);\n $this->assertSame(\n 'service(\"guzzle_bundle.middleware.event_dispatch.clientName\").dispatch()',\n $eventDispatchMiddlewareExpression->__toString()\n );\n }", "public function testGetLogMiddlewareDefinition()\n {\n $client = 'client';\n $logMiddleware = $this->subject->getLogMiddlewareDefinition($client);\n\n $this->assertCount(3, $logMiddleware->getArguments());\n $this->assertSame('%mapudo.guzzle.middleware.log_middleware.class%', $logMiddleware->getClass());\n\n // Assert the references have been set correctly\n $arguments = ['monolog.logger.guzzle', 'guzzle_bundle.formatter', 'mapudo_bundle_guzzle.serializer'];\n for ($i = 0; $i < 3; $i++) {\n /** @var Reference $reference */\n $reference = $logMiddleware->getArgument($i);\n $this->assertInstanceOf(Reference::class, $reference);\n $this->assertSame($arguments[$i], $reference->__toString());\n $this->assertSame(ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $reference->getInvalidBehavior());\n }\n\n $this->assertCount(1, $logMiddleware->getMethodCalls());\n $this->assertTrue($logMiddleware->hasMethodCall('setClientName'));\n }", "public function testEventCreate()\n {\n $response = $this->get('events/create');\n\n $response->assertStatus(200);\n }", "protected function expectAddEvent()\n {\n $this->eventPublisher->expects($this->once())\n ->method('addEvent')\n ->with(['uuid' => '123']);\n }", "public function testMiddlewarePasses()\n {\n $authorizationLine = 'Basic ' . base64_encode('foo:bar');\n\n $request = new Request();\n $request->headers->add([\n 'Authorization' => $authorizationLine,\n ]);\n\n $middleware = new WebhookAuthenticationMiddleware('foo', 'bar');\n $this->assertTrue($middleware->handle($request, function () {\n return true;\n }));\n }", "public function testHandleCreateEvents()\n {\n $mock_storage_writer_map = Mockery::mock(StorageWriterMap::CLASS)->shouldNotReceive('getItem')->mock();\n $mock_query_service_map = Mockery::mock(QueryServiceMap::CLASS)->shouldNotReceive('getItem')->mock();\n $mock_event_bus = Mockery::mock(EventBus::CLASS)->shouldNotReceive('distribute')->mock();\n\n // prepare and test subject\n $relation_projection_updater = new RelationProjectionUpdater(\n new ArrayConfig([]),\n new NullLogger,\n $mock_storage_writer_map,\n $mock_query_service_map,\n $this->projection_type_map,\n $mock_event_bus\n );\n\n $event = $this->buildEvent([\n '@type' => 'Honeybee\\Projection\\Event\\ProjectionCreatedEvent',\n 'uuid' => '44c4597c-f463-4916-a330-2db87ef36547',\n 'projection_type' => 'honeybee_tests.game_schema.player::projection.standard',\n 'projection_identifier' => 'honeybee.fixtures.player-a726301d-dbae-4fb6-91e9-a19188a17e71-de_DE-1',\n 'data' => []\n ]);\n $relation_projection_updater->handleEvent($event);\n }", "public function testDeleteChallengeEvent()\n {\n }", "public function testEventStoreWithoutValidationErr()\n {\n $user = factory(User::class)->create();\n\n $input = [\n 'author_id' => $user->id,\n 'title' => 'Ik ben een titel',\n 'description' => 'Ik ben een beschrijving',\n 'start_date' => '10/10/1995',\n 'end_date' => '11/10/1996',\n 'status' => 'Y',\n 'end_hour' => '10:10',\n 'start_hour' => '12:10',\n ];\n\n $this->actingAs($user)\n ->seeIsAuthenticatedAs($user)\n ->post(route('events.store'), $input)\n ->assertStatus(302)\n ->assertSessionHasAll(['flash_notification.0.message' => trans('events.flash-event-create')]);\n\n $this->assertDatabaseHas('events', [\n 'author_id' => $user->id,\n 'title' => 'Ik ben een titel',\n 'description' => 'Ik ben een beschrijving',\n ]);\n }", "public function testGetWebhookEvents()\n {\n }", "public function testConstruct()\n\t{\n\t\t$middlewareAdaptor = $this->createMock(MiddlewareAdaptorInterface::class);\n\t\t$middlewareAdaptor->method('setResolver');\n\n\t\t$resolveAdaptor = $this->createMock(\\Weave\\Resolve\\ResolveAdaptorInterface::class);\n\t\t$dispatchAdaptor = $this->createMock(\\Weave\\Dispatch\\DispatchAdaptorInterface::class);\n\n\t\t$requestFactory = $this->createMock(\\Weave\\Http\\RequestFactoryInterface::class);\n\t\t$responseFactory = $this->createMock(\\Weave\\Http\\ResponseFactoryInterface::class);\n\t\t$emitter = $this->createMock(\\Weave\\Http\\ResponseEmitterInterface::class);\n\n\t\t$middleware = new Middleware(\n\t\t\t$middlewareAdaptor,\n\t\t\tfn () => 'pipelineFoo',\n\t\t\t$resolveAdaptor,\n\t\t\t$dispatchAdaptor,\n\t\t\t$requestFactory,\n\t\t\t$responseFactory,\n\t\t\t$emitter\n\t\t);\n\n\t\t$this->assertInstanceOf(Middleware::class, $middleware);\n\t}", "protected function setUp()\n {\n //$this->object = new Middleware;\n }", "public function testEventStoreWithValidationErr()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user)\n ->seeIsAuthenticatedAs($user)\n ->post(route('events.store'), [])\n ->assertStatus(200)\n ->assertSessionHasErrors()\n ->assertSessionMissing(['flash_notification.0.message' => trans('events.flash-event-create')]);\n }", "public function testGetChallengeEvent()\n {\n }", "public function testValidToken()\n {\n // Create the user with a token we know\n $token = bin2hex(random_bytes(64));\n $this->writedown->getService('api')->user()->create([\n 'email' => $this->faker->email,\n 'password' => $this->faker->word,\n 'token' => $token,\n ]);\n\n // Add the token to the session\n $session = new SessionStub;\n $session->set('auth_token', $token);\n\n // Create the middleware\n $provider = new AuthenticatedMiddleware($this->writedown->getService('auth'), $session);\n\n // Make mocks\n $request = \\Mockery::mock('\\Psr\\Http\\Message\\ServerRequestInterface')->makePartial();\n $response = \\Mockery::mock('\\Psr\\Http\\Message\\ResponseInterface')->makePartial();\n\n // Check it works\n $result = $provider->validate($request, $response, function () {\n return true;\n });\n\n $this->assertTrue($result);\n }", "public function testValidation()\n {\n $this->expectException(ValidationException::class);\n\n $validation = new ValidationMiddleware();\n $validation->execute(new SearchRemovedSince(), function () {});\n }", "public function testEvent()\n {\n $dispatcher = new Events();\n $this->app->bind(DispatcherInterface::class, function() use ($dispatcher) {\n return $dispatcher;\n });\n $response = (new Command())->testEvent(new Event());\n $event = array_shift($response);\n\n $this->assertSame(Event::class, $event['name'], 'The event that should have been dispatched should match the event passed to event().');\n $this->assertFalse($event['halt'], 'The event should not halt when dispatched from event().');\n }", "public function testDeleteEvent()\n {\n }", "public function setUp()\n {\n parent::setUp();\n\n // SETUP: Testing route\n $this->route = 'test/middleware';\n\n app('router')->get($this->route, function () {\n return 'passed!';\n })->middleware(isNotConfirmed::class);\n }", "public function testValidateTokenTestEnvironment()\n {\n $request = new Request();\n $response = new Response();\n $middleware = new CsrfProtectionMiddleware();\n $request->data('title', 'Article Title');\n $middleware->handle($request);\n $middleware->process($request, $response);\n $this->assertNull(null); // This would normally trigger error\n }", "public function testEmittedEventName()\n {\n $expected = array(\n 'request.before_send' => 'onBeforeSend'\n );\n $this->assertEquals($expected, DaWandaPlugin::getSubscribedEvents());\n }", "public function testWebinarCreate()\n {\n }", "public function testRouteMiddleware()\n {\n $callable1 = function () {};\n $callable2 = function () {};\n //Case A\n $r1 = new \\Slim\\Route('/foo', function () {});\n $r1->setMiddleware($callable1);\n $mw = $r1->getMiddleware();\n $this->assertInternalType('array', $mw);\n $this->assertEquals(1, count($mw));\n //Case B\n $r1->setMiddleware($callable2);\n $mw = $r1->getMiddleware();\n $this->assertEquals(2, count($mw));\n //Case C\n $r2 = new \\Slim\\Route('/foo', function () {});\n $r2->setMiddleware(array($callable1, $callable2));\n $mw = $r2->getMiddleware();\n $this->assertInternalType('array', $mw);\n $this->assertEquals(2, count($mw));\n //Case D\n $r3 = new \\Slim\\Route('/foo', function () {});\n $r3->setMiddleware(array($this, 'callableTestFunction'));\n $mw = $r3->getMiddleware();\n $this->assertInternalType('array', $mw);\n $this->assertEquals(1, count($mw));\n //Case E\n try {\n $r3->setMiddleware('sdjfsoi788');\n $this->fail('Did not catch InvalidArgumentException when setting invalid route middleware');\n } catch ( \\InvalidArgumentException $e ) {}\n //Case F\n try {\n $r3->setMiddleware(array($callable1, $callable2, 'sdjfsoi788'));\n $this->fail('Did not catch InvalidArgumentException when setting an array with one invalid route middleware');\n } catch ( \\InvalidArgumentException $e ) {}\n }", "public function testGetChallengeEvents()\n {\n }", "public function testWebinarPollCreate()\n {\n }", "public function testInboundDocumentCreateDocument()\n {\n }", "public function test_event_notification()\n {\n $this->event_notification_helper('event_method', true);\n }", "public function setUp()\n {\n $first = new class implements MiddlewareInterface {\n\n public function request($body)\n {\n return \"foo \" . $body;\n }\n\n public function response($body)\n {\n if (strpos($body, \"foo \")===0) {\n return substr($body, 4);\n }\n\n return $body;\n }\n\n };\n\n // First will add the word bar to the start of a string, and remove it if it's there\n $second = new class implements MiddlewareInterface {\n public function request($body)\n {\n return \"bar \" . $body;\n }\n\n public function response($body)\n {\n if (strpos($body, \"bar \")===0) {\n return substr($body, 4);\n }\n\n return $body;\n }\n\n };\n\n $this->middleware = new MiddlewareGroup([$first, $second]);\n }", "public function testEventCallBackCreate()\n {\n }", "public function user_can_visit_create_event_page()\n {\n $response = $this->get('/events/create');\n $response->assertStatus(200);\n $response->assertSeeText('Name');\n }", "public function user_can_create_event()\n {\n $user = User::factory()->create();\n $event = Event::factory()->make()->toArray();\n $response = $this->actingAs($user)->post('/events', $event);\n $response->assertStatus(302);\n $this->assertNotNull(Event::where('name', $event['name'])->first());\n }" ]
[ "0.6642569", "0.6582048", "0.64233357", "0.62353176", "0.6153294", "0.6129908", "0.5991054", "0.5949481", "0.5934481", "0.5876484", "0.5872267", "0.58649874", "0.58563125", "0.58379316", "0.58311373", "0.5824571", "0.5823644", "0.58207476", "0.5815057", "0.5806604", "0.5804549", "0.57910913", "0.5782904", "0.57796633", "0.57686424", "0.57529426", "0.5730285", "0.5728296", "0.569681", "0.56869054" ]
0.8089062
0
Test case to assert the log middleware definition is created correctly.
public function testGetLogMiddlewareDefinition() { $client = 'client'; $logMiddleware = $this->subject->getLogMiddlewareDefinition($client); $this->assertCount(3, $logMiddleware->getArguments()); $this->assertSame('%mapudo.guzzle.middleware.log_middleware.class%', $logMiddleware->getClass()); // Assert the references have been set correctly $arguments = ['monolog.logger.guzzle', 'guzzle_bundle.formatter', 'mapudo_bundle_guzzle.serializer']; for ($i = 0; $i < 3; $i++) { /** @var Reference $reference */ $reference = $logMiddleware->getArgument($i); $this->assertInstanceOf(Reference::class, $reference); $this->assertSame($arguments[$i], $reference->__toString()); $this->assertSame(ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $reference->getInvalidBehavior()); } $this->assertCount(1, $logMiddleware->getMethodCalls()); $this->assertTrue($logMiddleware->hasMethodCall('setClientName')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSetUpLoggerName()\n\t{\t\n\t\t$this->__Log->setupLogger('log_name',new \\Monolog\\Handler\\TestHandler());\n\t\t$logger = $this->__Log->getLogger('log_name');\n\n\t\t$this->assertInternalType('object',$logger);\n\t}", "public function testGetLogger()\n\t{\t\t\n\t\t$this->__Log->setupLogger('testing',new \\Monolog\\Handler\\TestHandler());\n\t\t$logger = $this->__Log->getLogger('testing');\n\t\t$loggerTest = new \\Monolog\\Logger('testing');\n\t\t$loggerTest->pushHandler(new \\Monolog\\Handler\\TestHandler());\n\n\t\t$this->assertEquals($loggerTest,$logger);\n\t}", "public function testGetEventMiddlewareDefinition()\n {\n $clientName = 'clientName';\n $eventMiddleware = $this->subject->getEventMiddlewareDefinition($clientName);\n\n $this->assertCount(2, $eventMiddleware->getArguments());\n $this->assertSame('%mapudo.guzzle.middleware.event_dispatch_middleware.class%', $eventMiddleware->getClass());\n\n // Assert the Reference has been set correctly\n /** @var Reference $reference */\n $reference = $eventMiddleware->getArgument(0);\n $this->assertInstanceOf(Reference::class, $reference);\n $this->assertSame('event_dispatcher', $reference->__toString());\n $this->assertSame(ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $reference->getInvalidBehavior());\n\n // Assert the client name\n $this->assertSame($clientName, $eventMiddleware->getArgument(1));\n }", "public function testMiddlewarePasses()\n {\n $authorizationLine = 'Basic ' . base64_encode('foo:bar');\n\n $request = new Request();\n $request->headers->add([\n 'Authorization' => $authorizationLine,\n ]);\n\n $middleware = new WebhookAuthenticationMiddleware('foo', 'bar');\n $this->assertTrue($middleware->handle($request, function () {\n return true;\n }));\n }", "public function testGetHandlerDefinition()\n {\n $clientName = 'clientName';\n\n /** @var ContainerBuilder|ObjectProphecy $container */\n $container = $this->prophesize(ContainerBuilder::class);\n\n $middleware = ['test_middleware' => [\n ['method' => 'attach']\n ]];\n\n $handler = $this->subject->getHandlerDefinition($container->reveal(), $clientName, $middleware);\n\n // Test basic stuff\n $this->assertSame('%guzzle_http.handler_stack.class%', $handler->getClass());\n $this->assertSame(['%guzzle_http.handler_stack.class%', 'create'], $handler->getFactory());\n\n $methodCalls = $handler->getMethodCalls();\n // Count is the number of the given middleware + the default event and log middleware expressions\n $this->assertCount(3, $methodCalls);\n\n $customMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('push', array_shift($customMiddlewareCall));\n /** @var Expression[] $customMiddlewareExpressions */\n $customMiddlewareExpressions = array_shift($customMiddlewareCall);\n $customMiddlewareExpression = array_shift($customMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $customMiddlewareExpression);\n $this->assertSame('service(\"test_middleware\").attach()', $customMiddlewareExpression->__toString());\n\n $logMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('push', array_shift($logMiddlewareCall));\n /** @var Expression[] $logMiddlewareExpressions */\n $logMiddlewareExpressions = array_shift($logMiddlewareCall);\n $logMiddlewareExpression = array_shift($logMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $logMiddlewareExpression);\n $this->assertSame(\n 'service(\"guzzle_bundle.middleware.log.clientName\").log()',\n $logMiddlewareExpression->__toString()\n );\n\n $eventDispatchMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('unshift', array_shift($eventDispatchMiddlewareCall));\n /** @var Expression[] $eventDispatchMiddlewareExpressions */\n $eventDispatchMiddlewareExpressions = array_shift($eventDispatchMiddlewareCall);\n $eventDispatchMiddlewareExpression = array_shift($eventDispatchMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $eventDispatchMiddlewareExpression);\n $this->assertSame(\n 'service(\"guzzle_bundle.middleware.event_dispatch.clientName\").dispatch()',\n $eventDispatchMiddlewareExpression->__toString()\n );\n }", "public function testLoggerExists()\n\t{\t\t\n\t\t$this->__Log->setupLogger('test1',new \\Monolog\\Handler\\TestHandler());\n\t\t$this->assertTrue($this->__Log->isLoggerExists('test1'));\n\t\t$this->assertFalse($this->__Log->isLoggerExists('test3'));\n\t}", "protected function createMockedLoggerAndLogManager() {}", "public function testTokenGeneration()\n {\n $token = LogServiceProvider::createToken();\n\n $log = FileLog::where('token', $token)->first();\n\n $this->assertNull($log);\n }", "public function testLogCreation()\n {\n // if the file was previously created, delete it\n if (file_exists(LOG_PATH . '/' . get_class($this) . '.log')) {\n unlink(LOG_PATH . '/' . get_class($this) . '.log');\n }\n\n // the test\n $this->logMessage('this is a test');\n\n // asserts\n $this->assertTrue(file_exists(LOG_PATH . '/' . get_class($this) . '.log'));\n $this->assertGreaterThan(0, filesize(LOG_PATH . '/' . get_class($this) . '.log'));\n }", "public function testValidKeyName() {\n\t\tCakeLog::config('valid', array('engine' => 'File'));\n\t\t$stream = CakeLog::stream('valid');\n\t\t$this->assertInstanceOf('FileLog', $stream);\n\t\tCakeLog::drop('valid');\n\t}", "public function createdLogEntryCallsGivenLogger()\n {\n $this->mockLogger->expects($this->once())\n ->method('log')\n ->with($this->logEntry);\n $this->logEntry->log();\n }", "public function testCustomLogCreation()\n {\n $logName = 'test.log';\n\n // if the file was previously created, delete it\n if (file_exists(LOG_PATH . '/' . $logName)) {\n unlink(LOG_PATH . '/' . $logName);\n }\n\n // the test\n $this->logMessage('this is a test', $logName);\n\n // asserts\n $this->assertTrue(file_exists(LOG_PATH . '/' . get_class($this) . '.log'));\n $this->assertGreaterThan(0, filesize(LOG_PATH . '/' . get_class($this) . '.log'));\n }", "public function testGeneralMethods()\n {\n $logger = $this->lh->getLogger();\n $this->assertInstanceOf('Psr\\Log\\NullLogger', $logger);\n }", "public function testWriteIsCalled()\n {\n // Mock the SentryLogWriter\n $spy = \\Phockito::spy('phptek\\Sentry\\SentryLogWriter');\n\n // Register it\n \\SS_Log::add_writer($spy, \\SS_Log::ERR, '<=');\n\n // Invoke SentryLogWriter::_write()\n \\SS_Log::log('You have one minute to reach minimum safe distance.', \\SS_Log::ERR);\n\n // Verificate\n \\Phockito::verify($spy, 1)->_write(arrayValue());\n }", "public function setUp()\n {\n $first = new class implements MiddlewareInterface {\n\n public function request($body)\n {\n return \"foo \" . $body;\n }\n\n public function response($body)\n {\n if (strpos($body, \"foo \")===0) {\n return substr($body, 4);\n }\n\n return $body;\n }\n\n };\n\n // First will add the word bar to the start of a string, and remove it if it's there\n $second = new class implements MiddlewareInterface {\n public function request($body)\n {\n return \"bar \" . $body;\n }\n\n public function response($body)\n {\n if (strpos($body, \"bar \")===0) {\n return substr($body, 4);\n }\n\n return $body;\n }\n\n };\n\n $this->middleware = new MiddlewareGroup([$first, $second]);\n }", "public function testValidKeyNameLogSuffix() {\n\t\tCakeLog::config('valid', array('engine' => 'FileLog'));\n\t\t$stream = CakeLog::stream('valid');\n\t\t$this->assertInstanceOf('FileLog', $stream);\n\t\tCakeLog::drop('valid');\n\t}", "public function testBasicTest()\n {\n /*\n $mock = app(LogTrait_0::class);\n\n $this->instance(LogTrait_0::class, $mock);\n\n $instance = new LogTrait_0();\n dd($instance);\n $instance->error(\"error\");\n\n LogTrait_0::info(\"test\");\n */\n $name = \"\";\n // $name = $clazz->get\n // $request = Request::capture();\n // $instance = new Controller_0($request);\n // $name = $instance->getShortName();\n //$name = Controller_0::getControllerName();\n $this->assertEquals(\"\", $name);\n }", "public function testLogSimpleUsingPOST()\n {\n\n }", "public function testSetLogger() {\n $file_name = getLogFileName();\n $message = 'The sky is the daily bread of the eyes.';\n setOutputDestination($file_name);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertFalse(strpos($output, $message) !== false);\n Terminus::setLogger(['debug' => true, 'format' => 'json']);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertTrue(strpos($output, $message) !== false);\n resetOutputDestination($file_name);\n }", "public function testLogInfo() {\n\n $obj = new TestProvider($this->logger);\n\n $this->assertSame($obj, $obj->logInfo(\"message\", []));\n }", "public function testLogger(): void\n {\n $loggerMock = $this->createMock(LoggerInterface::class);\n\n $loggerMock->expects(self::once())\n ->method('log')\n ->with(LoggerInterface::FATAL, 'Log log', []);\n\n $subject = new TransitLogger();\n\n $this->assertInstanceOf(TransitLogger::class, $subject);\n\n $subject->addLogger($loggerMock);\n $subject->log(LoggerInterface::FATAL, 'Log log', []);\n }", "public function testExtrasAvailable()\n {\n // Register SentryLogWriter with some custom context\n $fixture = [\n 'extra' => [\n 'foo' => 'bar'\n ],\n 'env' => 'live'\n ];\n $logger = new Logger('error-log');\n $logger->pushHandler(new SentryMonologHandler(100, true, $fixture));\n\n // Invoke SentryLogWriter::_write()\n \\SS_Log::log('You have 10 seconds to comply.', \\SS_Log::ERR);\n\n $envThatWasSet = $logger->getClient()->getData()['env'];\n $xtraThatWasSet = $logger->getClient()->getData()['extra'];\n\n $this->assertEquals('live', $envThatWasSet);\n $this->assertArrayHasKey('foo', $xtraThatWasSet);\n $this->assertContains('bar', $xtraThatWasSet['foo']);\n\n // Cleanup\n \\SS_Log::remove_writer($logger);\n }", "public function testLogUsingPOST()\n {\n\n }", "public function testLoggingLoaded()\n {\n $this->assertInstanceOf('\\interview\\Logging', new \\interview\\Logging);\n }", "public function testSuccessfulMiddleware()\n {\n $model = factory(Server::class)->make();\n $subuser = factory(Subuser::class)->make([\n 'server_id' => $model->id,\n ]);\n $this->setRequestAttribute('server', $model);\n\n $this->request->shouldReceive('route->parameter')->with('subuser', 0)->once()->andReturn('abc123');\n $this->hashids->shouldReceive('decodeFirst')->with('abc123', 0)->once()->andReturn($subuser->id);\n $this->repository->shouldReceive('find')->with($subuser->id)->once()->andReturn($subuser);\n\n $this->request->shouldReceive('method')->withNoArgs()->once()->andReturn('GET');\n\n $this->getMiddleware()->handle($this->request, $this->getClosureAssertions());\n $this->assertRequestHasAttribute('subuser');\n $this->assertRequestAttributeEquals($subuser, 'subuser');\n }", "public function testConvenienceScopedLogging() {\n\t\tif (file_exists(LOGS . 'shops.log')) {\n\t\t\tunlink(LOGS . 'shops.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'error.log')) {\n\t\t\tunlink(LOGS . 'error.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'debug.log')) {\n\t\t\tunlink(LOGS . 'debug.log');\n\t\t}\n\n\t\t$this->_resetLogConfig();\n\t\tCakeLog::config('shops', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => array('info', 'debug', 'notice', 'warning'),\n\t\t\t'scopes' => array('transactions', 'orders'),\n\t\t\t'file' => 'shops',\n\t\t));\n\n\t\tCakeLog::info('info message', 'transactions');\n\t\t$this->assertFalse(file_exists(LOGS . 'error.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'shops.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'debug.log'));\n\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::error('error message', 'orders');\n\t\t$this->assertTrue(file_exists(LOGS . 'error.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'debug.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'shops.log'));\n\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::warning('warning message', 'orders');\n\t\t$this->assertTrue(file_exists(LOGS . 'error.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'shops.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'debug.log'));\n\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::drop('shops');\n\t}", "public function testRouteMiddleware()\n {\n $callable1 = function () {};\n $callable2 = function () {};\n //Case A\n $r1 = new \\Slim\\Route('/foo', function () {});\n $r1->setMiddleware($callable1);\n $mw = $r1->getMiddleware();\n $this->assertInternalType('array', $mw);\n $this->assertEquals(1, count($mw));\n //Case B\n $r1->setMiddleware($callable2);\n $mw = $r1->getMiddleware();\n $this->assertEquals(2, count($mw));\n //Case C\n $r2 = new \\Slim\\Route('/foo', function () {});\n $r2->setMiddleware(array($callable1, $callable2));\n $mw = $r2->getMiddleware();\n $this->assertInternalType('array', $mw);\n $this->assertEquals(2, count($mw));\n //Case D\n $r3 = new \\Slim\\Route('/foo', function () {});\n $r3->setMiddleware(array($this, 'callableTestFunction'));\n $mw = $r3->getMiddleware();\n $this->assertInternalType('array', $mw);\n $this->assertEquals(1, count($mw));\n //Case E\n try {\n $r3->setMiddleware('sdjfsoi788');\n $this->fail('Did not catch InvalidArgumentException when setting invalid route middleware');\n } catch ( \\InvalidArgumentException $e ) {}\n //Case F\n try {\n $r3->setMiddleware(array($callable1, $callable2, 'sdjfsoi788'));\n $this->fail('Did not catch InvalidArgumentException when setting an array with one invalid route middleware');\n } catch ( \\InvalidArgumentException $e ) {}\n }", "public function testBasicTest()\n {\n Log::shouldReceive('info')\n ->once()\n ->with('some one want to sneak in');\n $response = $this->get('/admin/panel');\n\n $response->assertRedirect('/welcome');\n }", "public function setUp()\n {\n $this->logger = NewInstance::stub(Logger::class);\n $this->timedLogEntryFactory = new TimedLogEntryFactory();\n $this->logEntry = $this->timedLogEntryFactory->create(\n 'testTarget',\n $this->logger\n );\n }", "public function testOrgApacheSlingCommonsLogLogManagerFactoryWriter()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.commons.log.LogManager.factory.writer';\n\n $crawler = $client->request('POST', $path);\n }" ]
[ "0.64303166", "0.62236476", "0.6179338", "0.6123543", "0.6102211", "0.6064592", "0.60590047", "0.5807065", "0.5782111", "0.57602566", "0.57544774", "0.57536954", "0.5702917", "0.5694712", "0.5658459", "0.56430435", "0.56424373", "0.56367004", "0.5616396", "0.5614831", "0.56008583", "0.55910313", "0.5589259", "0.5568631", "0.5543399", "0.55409455", "0.5524451", "0.55209154", "0.5517614", "0.5510592" ]
0.78026134
0
Do select list for: Suppliers Additional Emails
function do_select_list_suppliers_additional_emails($avalue, $aname) { # Dim some Vars: global $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp; $_out = ''; # Set Query for select. $query = 'SELECT contacts_id, contacts_s_id, contacts_name_first, contacts_name_last, contacts_email FROM '.$_DBCFG['suppliers_contacts']; IF ($avalue) {$query .= ' WHERE contacts_s_id='.$avalue;} $query .= ' ORDER BY contacts_name_last ASC, contacts_name_first ASC'; # Do select $result = $db_coin->db_query_execute($query); $numrows = $db_coin->db_query_numrows($result); IF ($numrows) { # Process query results to list individual clients while(list($contacts_id, $contacts_cl_id, $contacts_name_first, $contacts_name_last, $contacts_email) = $db_coin->db_fetch_row($result)) { $i++; $_out .= '<option value="'.'alias|'.$contacts_id.'">'; $_out .= $_sp.$_sp.$_sp.$aname.' - '.$contacts_name_last.', '.$contacts_name_first.' ('.$_LANG['_BASE']['Email_Additional'].')</option>'.$_nl; } return $_out; } ELSE { return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_select_list_suppliers($aname, $avalue) {\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Set Query for select.\n\t\t$query\t = 'SELECT s_id, s_company, s_name_first, s_name_last FROM '.$_DBCFG['suppliers'];\n\t\t$query\t.= \" WHERE s_email <> ''\";\n\t\t$query\t.= ' ORDER BY s_company ASC, s_name_last ASC, s_name_first ASC';\n\t\t$result\t = $db_coin->db_query_execute($query);\n\t\t$numrows\t = $db_coin->db_query_numrows($result);\n\n\t# Build form field output\n\t\t$_out .= '<select class=\"select_form\" name=\"'.$aname.'\" size=\"1\">'.$_nl;\n\t\t$_out .= '<option value=\"0\">'.$_LANG['_BASE']['Please_Select'].'</option>'.$_nl;\n\t\t$_out .= '<option value=\"-1\"';\n\t\tIF ($avalue == -1) {$_out .= ' selected';}\n\t\t$_out .= '>'.$_LANG['_MAIL']['All_Active_Suppliers'].'</option>'.$_nl;\n\n\t# Process query results to list individual suppliers\n\t\twhile(list($s_id, $s_company, $s_name_first, $s_name_last) = $db_coin->db_fetch_row($result)) {\n\t\t\t$_more = '';\n\n\t\t# Add supplier info, indenting if additional emails present\n\t\t\t$_out .= '<option value=\"'.$s_id.'\"';\n\t\t\tIF ($s_id == $avalue) {$_out .= ' selected';}\n\t\t\t$_out .= '>';\n\t\t\t$_out .= $s_company.' - '.$s_name_last.', '.$s_name_first.'</option>'.$_nl;\n\n\t\t# Grab any additional emails for this client, so they are all together in the list\n\t\t\t$_more = do_select_list_suppliers_additional_emails($s_id, $s_company);\n\n\t\t# Add \"All\" option, if necessary\n\t\t\tIF ($_more) {\n\t\t\t\tIF (substr_count($_more, '<option') > 1) {\n\t\t\t\t\t$_out .= '<option value=\"contacts|'.$cl_id.'\">'.$_sp.$_sp.$_sp.$s_company.' - '.$s_name_last.', '.$s_name_first.' ('.$_LANG['_BASE']['All_Contacts'].')</option>'.$_nl;\n\t\t\t\t}\n\t\t\t\t$_out .= $_more;\n\t\t\t}\n\t\t}\n\t\t$_out .= '</select>'.$_nl;\n\t\treturn $_out;\n}", "function listSuppliers($suppliers) {\n \n echo \"<input list=suppliers name=supplier>\";\n echo \"<datalist id=suppliers>\";\n \n // Loop through the suppliers and insert it as an option\n foreach ($suppliers as $supplier) {\n \n echo '<option value=\"' . $supplier[\"SNAME\"] . ' \">' . '</option>';\n \n }\n \n echo \"</datalist>\";\n \n \n }", "function cp_do_view_supplier_emails($adata) {\n\t# Get security vars\n\t\t$_SEC \t= get_security_flags();\n\t\t$_PERMS\t= do_decode_perms_admin($_SEC['_sadmin_perms']);\n\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Get all email addresses for a supplier\n\t\t$sinfo\t= get_contact_supplier_info($adata['s_id']);\n\t\t$s_emails\t= get_contact_supplier_info_alias($adata['s_id'], 1);\n\t\t$x\t\t= sizeof($s_emails);\n\n\t# Set Query parameters for select.\n\t\t$query\t = 'SELECT *';\n\t\t$_from\t = ' FROM '.$_DBCFG['mail_archive'];\n\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n\t\t\t$_where\t = ' WHERE '.$_DBCFG['mail_archive'].\".ma_fld_from='\".$sinfo['s_email'].\"'\";\n\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip='\".$sinfo['s_email'].\"'\";\n\t\t} ELSE {\n\t\t\t$_where\t = ' WHERE '.$_DBCFG['mail_archive'].\".ma_fld_from LIKE '%<\".$sinfo['s_email'].\">%'\";\n\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip LIKE '%<\".$sinfo['s_email'].\">%'\";\n\t\t}\n\t\tIF ($x) {\n\t\t\tFOR ($i=0; $i<=$x; $i++) {\n\t\t\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n\t\t\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_from='\".$s_emails[$i]['c_email'].\"'\";\n\t\t\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip='\".$s_emails[$i]['c_email'].\"'\";\n\t\t\t\t} ELSE {\n\t\t \t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_from LIKE '%<\".$s_emails[$i]['c_email'].\">%'\";\n\t\t\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip LIKE '%<\".$s_emails[$i]['c_email'].\">%'\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$_order = ' ORDER BY '.$_DBCFG['mail_archive'].'.ma_time_stamp DESC';\n\n\t\tIF (!$_CCFG['IPL_SUPPLIERS'] > 0) {$_CCFG['IPL_SUPPLIERS'] = 5;}\n\t\t$_limit = ' LIMIT 0, '.$_CCFG['IPL_SUPPLIERS'];\n\n\t# Get count of rows total:\n\t\t$query_ttl = 'SELECT COUNT(*)';\n\t\t$query_ttl .= $_from;\n\t\t$query_ttl .= $_where;\n\t\t$result_ttl\t= $db_coin->db_query_execute($query_ttl);\n\t\twhile(list($cnt) = $db_coin->db_fetch_row($result_ttl)) {$numrows_ttl = $cnt;}\n\n\t# Do select listing records and return check\n\t\t$query\t.= $_from.$_where.$_order.$_limit;\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\n\t# Build form output\n\t\t$_out .= '<div align=\"center\">'.$_nl;\n\t\t$_out .= '<table width=\"100%\" border=\"0\" bordercolor=\"'.$_TCFG['_TAG_TABLE_BRDR_COLOR'].'\" bgcolor=\"'.$_TCFG['_TAG_TRTD_BKGRND_COLOR'].'\" cellpadding=\"0\" cellspacing=\"1\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_TITLE\"><td class=\"TP3MED_NC\" colspan=\"7\">'.$_nl;\n\n\t\t$_out .= '<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_IT_TITLE_TXT\">'.$_nl.'<td class=\"TP0MED_NL\">'.$_nl;\n\t\t$_out .= '<b>'.$_LANG['_ADMIN']['l_Email_Archive'];\n\t\t$_out .= ' ('.$numrows.$_sp.$_LANG['_ADMIN']['of'].$_sp.$numrows_ttl.$_sp.$_LANG['_ADMIN']['total_entries'].')</b><br>'.$_nl;\n\t\t$_out .= '</td>'.$_nl.'<td class=\"TP0MED_NR\">'.$_nl;\n\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\tIF ($numrows_ttl > $_CCFG['IPL_SUPPLIERS']) {\n\t \t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=search&sw=archive&search_type=1&s_to='.$sinfo['s_email'].'&s_from='.$sinfo['s_email'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t \t\t}\n\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=search&sw=archive', $_TCFG['_S_IMG_SEARCH_S'],$_TCFG['_S_IMG_SEARCH_S_MO'],'','');\n\t\t} ELSE {\n\t\t\t$_out .= $_sp;\n\t\t}\n\t\t$_out .= '</td>'.$_nl.'</tr>'.$_nl.'</table>'.$_nl;\n\n\t\t$_out .= '</td></tr>'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Id'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Date_Sent'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\">'.$_LANG['_ADMIN']['l_Subject'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\">'.$_LANG['_CCFG']['Actions'].'</td>'.$_nl;\n\t\t$_out .= '</tr>'.$_nl;\n\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\t\t\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.$row['ma_id'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.dt_make_datetime($row['ma_time_stamp'], $_CCFG['_PKG_DATE_FORMAT_SHORT_DT'] ).'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.htmlspecialchars($row['ma_fld_subject']).'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\"><nobr>'.$_nl;\n\t\t\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=resend&obj=arch&ma_id='.$row['ma_id'], $_TCFG['_S_IMG_EMAIL_S'],$_TCFG['_S_IMG_EMAIL_S_MO'],'','');\n\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=view&obj=arch&ma_id='.$row['ma_id'].'&_suser_id='.$adata['_suser_id'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t\t\t\t\t$_out .= do_nav_link('mod_print.php?mod=mail&mode=view&obj=arch&ma_id='.$row['ma_id'], $_TCFG['_S_IMG_PRINT_S'],$_TCFG['_S_IMG_PRINT_S_MO'],'_new','');\n\t\t\t\t\tIF ($_PERMS['AP16'] == 1 || $_PERMS['AP05'] == 1) {\n\t\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=delete&obj=arch&stage=2&ma_id='.$row['ma_id'], $_TCFG['_S_IMG_DEL_S'],$_TCFG['_S_IMG_DEL_S_MO'],'','');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$_out .= '</nobr></td>'.$_nl;\n\t\t\t\t$_out .= '</tr>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t\t$_out .= '</table>'.$_nl;\n\t\t$_out .= '</div>'.$_nl;\n\t\t$_out .= '<br>'.$_nl;\n\n\t# Return results\n\t\treturn $_out;\n}", "function cp_do_select_listing_suppliers($adata) {\n\t# Get security vars\n\t\t$_SEC\t= get_security_flags();\n\t\t$_PERMS\t= do_decode_perms_admin($_SEC['_sadmin_perms']);\n\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_LANG, $_nl, $_sp;\n\t\t$_where\t= '';\n\t\t$_out\t= '';\n\t\t$_ps\t\t= '';\n\t\tIF ($adata['status'] && $adata['status'] != 'all') {$_ps .= '&status='.$adata['status'];}\n\t\tIF ($adata['notstatus']) {$_ps .= '&notstatus='.$adata['notstatus'];}\n\n\n\t# Set Query for select.\n\t\t$query = 'SELECT * FROM '.$_DBCFG['suppliers'];\n\n\t# Set Filters\n\t\tIF (!$adata['fb'])\t\t{$adata['fb'] = '';}\n\t\tIF ($adata['fb'] == '1')\t{$_where .= \" WHERE s_status='\".$db_coin->db_sanitize_data($adata['fs']).\"'\";}\n\n\t# Show only selected status suppliers\n\t\tIF ($adata['status'] && $adata['status'] != 'all') {\n\t\t\tIF ($_where) {$_where .= ' AND ';} ELSE {$_where .= ' WHERE ';}\n\t\t\t$_where .= \"s_status='\".$db_coin->db_sanitize_data($adata['status']).\"'\";\n\t\t}\n\t\tIF ($adata['notstatus']) {\n\t\t\tIF ($_where) {$_where .= ' AND ';} ELSE {$_where .= ' WHERE ';}\n\t\t\t$_where .= \"s_status != '\".$db_coin->db_sanitize_data($adata['notstatus']).\"'\";\n\t\t}\n\n\t# Set Order ASC / DESC part of sort\n\t\tIF (!$adata['so'])\t\t{$adata['so'] = 'A';}\n\t\tIF ($adata['so'] == 'A')\t{$order_AD = ' ASC';}\n\t\tIF ($adata['so'] == 'D')\t{$order_AD = ' DESC';}\n\n\t# Set Sort orders\n\t\tIF (!$adata['sb'])\t\t{$adata['sb'] = '3';}\n\t\tIF ($adata['sb'] == '1')\t{$_order = ' ORDER BY s_id'.$order_AD;}\n\t\tIF ($adata['sb'] == '2')\t{$_order = ' ORDER BY s_status'.$order_AD;}\n\t\tIF ($adata['sb'] == '3')\t{$_order = ' ORDER BY s_company'.$order_AD;}\n\t\tIF ($adata['sb'] == '4')\t{$_order = ' ORDER BY s_name_last'.$order_AD.', s_name_first'.$order_AD;}\n\t\tIF ($adata['sb'] == '5')\t{$_order = ' ORDER BY s_email'.$order_AD;}\n\n\t# Set / Calc additional paramters string\n\t\tIF ($adata['sb'])\t{$_argsb= '&sb='.$adata['sb'];}\n\t\tIF ($adata['so'])\t{$_argso= '&so='.$adata['so'];}\n\t\tIF ($adata['fb'])\t{$_argfb= '&fb='.$adata['fb'];}\n\t\tIF ($adata['fs'])\t{$_argfs= '&fs='.$adata['fs'];}\n\t\t$_link_xtra = $_argsb.$_argso.$_argfb.$_argfs;\n\n\t# Build Page menu\n\t# Get count of rows total for pages menu:\n\t\t$query_ttl = 'SELECT COUNT(*)';\n\t\t$query_ttl .= ' FROM '.$_DBCFG['suppliers'];\n\t\t$query_ttl .= $_where;\n\n\t\t$result_ttl= $db_coin->db_query_execute($query_ttl);\n\t\twhile(list($cnt) = $db_coin->db_fetch_row($result_ttl)) {$numrows_ttl = $cnt;}\n\n\t# Page Loading first rec number\n\t# $_rec_next\t- is page loading first record number\n\t# $_rec_start\t- is a given page start record (which will be rec_next)\n\t\tIF (!$_CCFG['IPP_SUPPLIERS'] > 0) {$_CCFG['IPP_SUPPLIERS'] = 15;}\n\t\t$_rec_page\t= $_CCFG['IPP_SUPPLIERS'];\n\t\t$_rec_next\t= $adata['rec_next'];\n\t\tIF (!$_rec_next) {$_rec_next=0;}\n\n\t# Range of records on current page\n\t\t$_rec_next_lo = $_rec_next+1;\n\t\t$_rec_next_hi = $_rec_next+$_rec_page;\n\t\tIF ($_rec_next_hi > $numrows_ttl) {$_rec_next_hi = $numrows_ttl;}\n\n\t# Calc no pages,\n\t\t$_num_pages = round(($numrows_ttl/$_rec_page), 0);\n\t\tIF ($_num_pages < ($numrows_ttl/$_rec_page)) {$_num_pages = $_num_pages+1;}\n\n\t# Loop Array and Print Out Page Menu HTML\n\t\t$_page_menu = $_LANG['_ADMIN']['l_Pages'].$_sp;\n\t\tfor ($i = 1; $i <= $_num_pages; $i++) {\n\t\t\t$_rec_start = (($i*$_rec_page)-$_rec_page);\n\t\t\tIF ($_rec_start == $_rec_next) {\n\t\t\t# Loading Page start record so no link for this page.\n\t\t\t\t$_page_menu .= $i;\n\t\t\t} ELSE {\n\t\t\t\t$_page_menu .= '<a href=\"admin.php?cp=suppliers'.$_link_xtra.$_ps.'&rec_next='.$_rec_start.'\">'.$i.'</a>';\n\t\t\t}\n\t\t\tIF ($i < $_num_pages) {$_page_menu .= ','.$_sp;}\n\t\t} # End page menu\n\n\t# Finish out query with record limits and do data select for display and return check\n\t\t$query\t.= $_where.$_order.\" LIMIT $_rec_next, $_rec_page\";\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\n\t# Generate links for sorting\n\t\t$_hdr_link_prefix = '<a href=\"admin.php?cp=suppliers&sb=';\n\t\t$_hdr_link_suffix = '&fb='.$adata['fb'].'&fs='.$adata['fs'].'&fc='.$adata['fc'].'&rec_next='.$_rec_next.$_ps.'\">';\n\n\t\t$_hdr_link_1 = $_LANG['_ADMIN']['l_Supplier_ID'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_1 .= $_hdr_link_prefix.'1&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_1 .= $_hdr_link_prefix.'1&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_2 = $_LANG['_ADMIN']['l_Status'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_2 .= $_hdr_link_prefix.'2&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_2 .= $_hdr_link_prefix.'2&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_3 = $_LANG['_ADMIN']['l_Company'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_3 .= $_hdr_link_prefix.'3&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_3 .= $_hdr_link_prefix.'3&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_4 = $_LANG['_ADMIN']['l_Full_Name'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_4 .= $_hdr_link_prefix.'4&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_4 .= $_hdr_link_prefix.'4&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_5 = $_LANG['_ADMIN']['l_Email_Address'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_5 .= $_hdr_link_prefix.'5&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_5 .= $_hdr_link_prefix.'5&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_6 .= $_LANG['_ADMIN']['l_Balance'].$_sp.'<br>';\n\n\t# Build Status header bar for viewing only certain types\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_out .= '&nbsp;&nbsp;&nbsp;<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\"><tr>';\n\t\t\t$_out .= '<td>'.$_LANG['_BASE']['Only'].':</td>';\n\t\t\t$_out .= '<td>&nbsp;[<a href=\"admin.php?cp=suppliers&op=none&status=all'.$_link_xtra;\n\t\t\t$_out .= '\">'.$_LANG['_BASE']['All'].'</a>]&nbsp;</td>';\n\t\t\tfor ($i=0; $i< sizeof($_CCFG['S_STATUS']); $i++) {\n\t\t\t\t$_out .= '<td align=\"right\"><nobr>&nbsp;[<a href=\"admin.php?cp=suppliers&op=none&status='.$_CCFG['S_STATUS'][$i].$_link_xtra;\n\t\t\t\t$_out .= '\">'.$_CCFG['S_STATUS'][$i].'</a>]&nbsp;</nobr></td>';\n\t\t\t}\n\t\t\t$_out .= '</tr><tr>';\n\t\t\t$_out .= '<td>'.$_LANG['_BASE']['Except'].':</td>';\n\t\t\t$_out .= '<td>&nbsp;</td>';\n\t\t\tfor ($i=0; $i< sizeof($_CCFG['S_STATUS']); $i++) {\n\t\t\t\t$_out .= '<td><nobr>&nbsp;[<a href=\"admin.php?cp=suppliers&op=none&notstatus='.$_CCFG['S_STATUS'][$i].$_link_xtra;\n\t\t\t\t$_out .= '\">'.$_CCFG['S_STATUS'][$i].'</a>]&nbsp;</nobr></td>';\n\t\t\t}\n\t\t\t$_out .= '</tr></table>';\n\t\t\t$_out .= '<br><br>';\n\t\t}\n\n\t# Build form output\n\t\t$_out .= '<div align=\"center\">'.$_nl;\n\t\t$_out .= '<table width=\"95%\" border=\"0\" bordercolor=\"'.$_TCFG['_TAG_TABLE_BRDR_COLOR'].'\" bgcolor=\"'.$_TCFG['_TAG_TRTD_BKGRND_COLOR'].'\" cellpadding=\"0\" cellspacing=\"1\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_TITLE\"><td class=\"TP3MED_NC\" colspan=\"'.(7-$_CCFG['_IS_PRINT']).'\">'.$_nl;\n\n\t\t$_out .= '<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_IT_TITLE_TXT\">'.$_nl.'<td class=\"TP0MED_NL\">'.$_nl;\n\t\t$_out .= '<b>'.$_LANG['_ADMIN']['Suppliers'].':'.$_sp.'('.$_rec_next_lo.'-'.$_rec_next_hi.$_sp.$_LANG['_ADMIN']['of'].$_sp.$numrows_ttl.$_sp.$_LANG['_ADMIN']['total_entries'].')</b><br>'.$_nl;\n\t\t$_out .= '</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP0MED_NR\">'.$_sp.'</td>'.$_nl;\n\t\t$_out .= '</tr>'.$_nl.'</table>'.$_nl;\n\n\t\t$_out .= '</td></tr>'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_1.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_2.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_3.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_4.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_5.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BR\" valign=\"top\">'.$_hdr_link_6.'</td>'.$_nl;\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_LANG['_CCFG']['Actions'].'</td>'.$_nl;\n\t\t}\n\t\t$_out .= '</tr>'.$_nl;\n\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\t\t\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_id'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_status'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_company'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_name_last'];\n\t\t\t\tIF ($row['s_name_last']) {$_out .= ', ';}\n\t\t\t\t$_out .= $row['s_name_first'];\n\t\t\t\t$_out .= '</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_email'].'</td>'.$_nl;\n\t\t\t\t$idata = do_get_bill_supplier_balance($row['s_id']);\n\t\t\t\t$_out .= '<td class=\"TP3SML_NR\">';\n\t\t\t\tIF ($idata['net_balance']) {$_out .= do_currency_format($idata['net_balance'],1,0,$_CCFG['CURRENCY_DISPLAY_DIGITS_AMOUNT']);}\n\t\t\t\t$_out .= $_sp.'</td>'.$_nl;\n\n\t\t\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t\t\t$_out .= '<td class=\"TP3SML_NL\"><nobr>'.$_nl;\n\t\t\t\t\t$_out .= do_nav_link('admin.php?cp=suppliers&op=view&s_id='.$row['s_id'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t\t\t\t\tIF ($_PERMS['AP16'] == 1 || $_PERMS['AP04'] == 1) {\n\t\t\t\t\t\t$_out .= do_nav_link('admin.php?cp=suppliers&op=edit&s_id='.$row['s_id'], $_TCFG['_S_IMG_EDIT_S'],$_TCFG['_S_IMG_EDIT_S_MO'],'','');\n\t\t\t\t\t\t$_out .= do_nav_link('admin.php?cp=suppliers&op=delete&stage=1&s_id='.$row['s_id'].'&s_name_first='.$row['s_name_first'].'&s_name_last='.$row['s_name_last'], $_TCFG['_S_IMG_DEL_S'],$_TCFG['_S_IMG_DEL_S_MO'],'','');\n\t\t\t\t\t}\n\t\t\t\t\t$_out .= '</nobr></td>'.$_nl;\n\t\t\t\t}\n\t\t\t\t$_out .= '</tr>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\"><td class=\"TP3MED_NC\" colspan=\"'.(7-$_CCFG['_IS_PRINT']).'\">'.$_nl;\n\t\t$_out .= $_page_menu.$_nl;\n\t\t$_out .= '</td></tr>'.$_nl;\n\n\t\t$_out .= '</table>'.$_nl;\n\t\t$_out .= '</div>'.$_nl;\n\t\t$_out .= '<br>'.$_nl;\n\n\t\treturn $_out;\n}", "function cmdMailTo($name, $caption) {\n $optpostaddr = array\n (\n array(\"\", \"\"),\n array(\"Office\", \"1\"),\n array(\"Home\", \"2\"),\n array(\"Do not send\", \"3\"),\n );\n ?>\n <tr>\n <td><?php getCaption($caption); ?> :</td>\n <td>\n <select class=\"easyui-combobox\"\n id=\"<?php echo $name; ?>\"\n name=\"<?php echo $name; ?>\"\n style=\"width:120;\"\n data-options=\"panelHeight:100,editable:false,width:120\"\n disabled=true\n >\n <?php\n foreach ($optpostaddr as $val) {\n echo '<option value=\"' . $val[1] . '\">' . $val[0] . '</option>';\n }\n ?>\n </select>\n </td>\n </tr>\n <?php\n}", "function give_me_address_list($curr_value, $java=true, $fname = '', $wbt){\r\n\tglobal $database, $section_id, $TEXT, $tpl;\r\n\t$rt = false;\r\n\t\r\n\t// add authenticated user:\r\n\t$s = \"<option value=\\\"wbu\\\"\";\r\n\tif($curr_value == 'wbu') {\r\n\t\t$s .= \" selected='selected'\";\r\n\t\t$rt = true;\r\n\t}\r\n\tif ($java) $s .= \" onclick=\\\"javascript: document.getElementById('\". $fname.\"_slave').style.display = 'none';\\\"\";\r\n\t$s .= \">$wbt</option>\";\r\n\t$s .= '';\r\n\r\n\t$query_email_fields = $database->query(\"SELECT `field_id`,`title` FROM `\".TABLE_PREFIX.\"mod_mpform_fields` WHERE `section_id` = '$section_id' AND (`type` = 'email') ORDER BY `position` ASC\");\r\n\tif($query_email_fields->numRows() > 0) {\r\n\t\twhile($field = $query_email_fields->fetchRow()) {\r\n\t\t\t$s = \"<option value=\\\"field\".$field['field_id'].\"\\\"\";\r\n\t\t\tif($curr_value == 'field'.$field['field_id']) {\r\n\t\t\t\t$s .= \" selected='selected'\";\r\n\t\t\t\t$rt = true;\r\n\t\t\t}\r\n\t\t\tif ($java) $s .= \" onclick=\\\"javascript: document.getElementById('\". $fname.\"_slave').style.display = 'none';\\\"\";\r\n\t\t\t$s .= \">\".$TEXT['FIELD'].': '.$field['title']. \"</option>\";\r\n\t\t}\r\n\t}\r\n\treturn $rt;\r\n}", "function do_contact_supplier_email_all($adata, $aret_flag=0) {\n\t# Dim Some Vars\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\t\t$DesiredGroup\t= 0;\n\t\t$DesiredServer\t= 0;\n\t\t$DesiredAlias\t= 0;\n\t\t$DesiredClient\t= 0;\n\t\t$_ret_msg\t\t= '';\n\n\t# Check if we are sending to an alias for a supplier\n\t\t$pos1 = strpos(strtolower($adata['cc_s_id']), 'alias');\n\t\tIF ($pos1 !== false) {\n\t\t\t$pieces = explode('|', $adata['cc_s_id']);\n\t\t\t$DesiredAlias = $pieces[1];\n\t\t}\n\n\t# Check if we are sending to all contacts for a supplier\n\t\t$pos2 = strpos(strtolower($adata['cc_s_id']), 'contacts');\n\t\tIF ($pos2 !== false) {\n\t\t\t$pieces = explode('|', $adata['cc_s_id']);\n\t\t\t$DesiredSupplier = $pieces[1];\n\t\t}\n\n\t# Get site contact information array\n\t\t$_mcinfo\t= get_contact_info($adata['cc_mc_id']);\n\n\t# Set Query for select\n\t\t$query\t= 'SELECT ';\n\n\t\tIF ($DesiredAlias) {\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_email, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_last';\n\t\t} ELSEIF ($DesiredSupplier) {\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_email, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_last, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_email, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_last';\n\t\t} ELSE {\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_email, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_last';\n\t\t}\n\n\t\t$query .= ' FROM ';\n\n\t\tIF ($DesiredAlias) {\n\t\t\t$query .= $_DBCFG['suppliers_contacts'];\n\t\t\t$query .= ' WHERE ('.$_DBCFG['suppliers_contacts'].'.contacts_id='.$DesiredAlias.')';\n\n\t\t} ELSEIF ($DesiredSupplier) {\n\t\t\t$query .= $_DBCFG['suppliers'].', '.$_DBCFG['suppliers_contacts'];\n\t\t\t$query .= ' WHERE (';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_id='.$DesiredSupplier.' OR (';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_id='.$_DBCFG['suppliers_contacts'].'.contacts_s_id AND ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_s_id='.$DesiredSupplier.')';\n\t\t\t$query .= ')';\n\n\t\t} ELSEIF ($adata['cc_s_id'] == '-1') {\n\t\t\t$query .= $_DBCFG['suppliers'];\n\t\t\t$query .= \" WHERE s_status='active' OR s_status='\".$db_coin->db_sanitize_data($_CCFG['S_STATUS'][1]).\"'\";\n\n\t\t} ELSE {\n\t\t\t$query .= $_DBCFG['suppliers'];\n\t\t\t$query .= ' WHERE ('.$_DBCFG['suppliers'].'.s_id='.$adata['cc_s_id'].')';\n\t\t}\n\n\t# Do select\n\t\t$result\t\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t\t= $db_coin->db_query_numrows($result);\n\t\t$_emails_sent\t= 0;\n\t\t$_emails_error\t= 0;\n\t\t$_sento\t\t= '';\n\n\t# Process query results\n\t\twhile($row = $db_coin->db_fetch_array($result)) {\n\n\t\t# Only send email if an address exists\n\t\t\tIF ($row['contacts_email'] || $row['s_email']) {\n\n\t\t\t# Loop all suppliers and send email\n\t\t\t# Set eMail Parameters (pre-eval template, some used in template)\n\t\t\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n\t\t\t\t\t$mail['recip']\t\t= $row['contacts_email'] ? $row['contacts_email'] : $row['s_email'];\n\t\t\t\t\t$mail['from']\t\t= $_mcinfo['c_email'];\n\t\t\t\t} ELSE {\n\t\t\t\t\t$mail['recip']\t\t= $row['contacts_name_first'] ? $row['contacts_name_first'] : $row['s_name_first'];\n\t\t\t\t\t$mail['recip']\t\t.= ' ';\n\t\t\t\t\t$mail['recip']\t\t.= $row['contacts_name_last'] ? $row['contacts_name_last'] : $row['s_name_last'];\n\t\t\t\t\t$mail['recip']\t\t.= ' <';\n\t\t\t\t\t$mail['recip']\t\t.= $row['contacts_email'] ? $row['contacts_email'] : $row['s_email'];\n\t\t\t\t\t$mail['recip']\t\t.= '>';\n\t\t\t\t\t$mail['from']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t\t\t}\n\t\t\t\t#\t$mail['cc']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\n\t\t\t\tIF ($_CCFG['MAIL_USE_CUSTOM_SUBJECT']) {\n\t\t\t\t\t$mail['subject']\t= $adata['cc_subj'];\n\t\t\t\t} ELSE {\n\t\t\t\t\t$mail['subject']\t= $_CCFG['_PKG_NAME_SHORT'].$_LANG['_MAIL']['CC_FORM_SUBJECT_PRE'];\n\t\t\t\t}\n\n\t\t\t# Set MTP (Mail Template Parameters) array\n\t\t\t\t$_MTP['to_name']\t = $row['contacts_name_first'] ? $row['contacts_name_first'] : $row['s_name_first'];\n\t\t\t\t$_MTP['to_name']\t.= ' ';\n\t\t\t\t$_MTP['to_name']\t.= $row['contacts_name_last'] ? $row['contacts_name_last'] : $row['s_name_last'];\n\t\t\t\t$_MTP['to_email']\t = $row['contacts_email'] ? $row['contacts_email'] : $row['s_email'];\n\t\t\t\t$_MTP['from_name']\t = $_mcinfo['c_name'];\n\t\t\t\t$_MTP['from_email']\t = $_mcinfo['c_email'];\n\t\t\t\t$_MTP['subject']\t = $adata['cc_subj'];\n\t\t\t\t$_MTP['message']\t = $adata['cc_msg'];\n\t\t\t\t$_MTP['site']\t\t = $_CCFG['_PKG_NAME_SHORT'];\n\n\t\t\t# Load message template (processed)\n\t\t\t\t$mail['message']\t= get_mail_template('email_contact_supplier_form', $_MTP);\n\n\t\t\t# Call basic email function (ret=1 on error)\n\t\t\t\t$_ret = do_mail_basic($mail);\n\n\t\t\t# Show what was sent\n\t\t\t\t$_sento .= htmlspecialchars($mail['recip']).'<br>';\n\n\t\t\t# Check return\n\t\t\t\tIF ($_ret) {$_emails_error++;} ELSE {$_emails_sent++;}\n\t\t\t}\n\t\t}\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr = $_LANG['_MAIL']['CC_FORM_RESULT_TITLE'];\n\n\t\t$_cstr .= '<center>'.$_nl;\n\t\t$_cstr .= '<table cellpadding=\"5\">'.$_nl;\n\t\t$_cstr .= '<tr><td class=\"TP5MED_NL\">'.$_nl;\n\t\tIF ($_emails_error) {\n\t\t\t$_cstr .= $_LANG['_MAIL']['CC_FORM_MSG_02_L1'];\n\t\t\t$_cstr .= '<br>'.$_LANG['_MAIL']['CC_FORM_MSG_02_L2'];\n\t\t} ELSE {\n\t\t\t$_cstr .= $_LANG['_MAIL']['CC_FORM_MSG_04_L1'];\n\t\t}\n\t\t$_cstr .= '<br>'.$_LANG['_MAIL']['total'].':'.$_sp.$_emails_sent.$_sp.$_LANG['_MAIL']['sent'];\n\t\t$_cstr .= '<br><br>'.$_sento;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</center>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr\t\t= '&nbsp;'.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "public function llenarCombo()\n {\n\n \n \t$area_destino = $_POST[\"dir\"];\n\n \t$options=\"\";\n \t\n \t$deptos = $this ->Modelo_direccion->obtenerCorreoDepto($area_destino);\n\n \tforeach ($deptos as $row){\n \t\t$options= '\n \t\t<option value='.$row->email.'>'.$row->email.'</option>\n \t\t'; \n \t\techo $options; \n \t}\n \t\n\n }", "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "function do_form_additional_emails($s_id) {\n\t# Dim some Vars:\n\t\tglobal $_TCFG, $_DBCFG, $db_coin, $_LANG, $_nl, $_sp;\n\n\t# Build common td start tag / col strings (reduce text)\n\t\t$_td_str_left\t= '<td class=\"TP1SML_NL\">'.$_nl;\n\t\t$_td_str_ctr\t= '<td class=\"TP1SML_NC\">'.$_nl;\n\n\t# Build table row beginning and ending\n\t\t$_cstart = '<b>'.$_LANG['_ADMIN']['l_Email_Address_Additional'].$_sp.'</b><br>'.$_nl;\n\t\t$_cstart .= '<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\"><tr>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_First_Name'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_Last_Name'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_Email_Address'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_ctr.$_LANG['_CCFG']['Actions'].'</td></tr>'.$_nl;\n\n\t\t$_cend = '</table>'.$_nl;\n\n\t# Set Query for select (additional emails).\n\t\t$query = 'SELECT *';\n\t\t$query .= ' FROM '.$_DBCFG['suppliers_contacts'];\n\t\t$query .= ' WHERE contacts_s_id='.$s_id;\n\t\t$query .= ' ORDER BY contacts_email ASC';\n\n\t# Do select and return check\n\t\tIF (is_numeric($s_id)) {\n\t\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\t\t}\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\t$button = str_replace('<img src=\"', '', $_TCFG['_IMG_SAVE_S']);\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\n\t\t\t# Display the \"edit/delete data\" form for this row\n\t\t\t\t$_out .= '<form method=\"POST\" action=\"admin.php\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"s_id\" value=\"'.$s_id.'\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"stage\" value=\"\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"op\" value=\"ae_mail_update\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"contacts_id\" value=\"'.$row['contacts_id'].'\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"cp\" value=\"suppliers\">'.$_nl;\n\t\t\t\t$_out .= '<tr>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_fname\" size=\"15\" value=\"'.htmlspecialchars($row['contacts_name_first']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_lname\" size=\"15\" value=\"'.htmlspecialchars($row['contacts_name_last']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_email\" size=\"35\" value=\"'.htmlspecialchars($row['contacts_email']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'&nbsp;&nbsp;&nbsp;'.$_nl;\n\n\t\t\t# Display \"update\" button\n\t\t\t\t$_out .= '<input type=\"image\" src=\"'.$button.$_nl;\n\n\t\t\t# Display \"Delete\" button\n\t\t\t\t$_out .= '&nbsp;<a href=\"admin.php?cp=suppliers&op=ae_mail_delete&stage=0&s_id='.$s_id.'&contacts_id='.$row['contacts_id'].'\">'.$_TCFG['_IMG_DEL_S'].'</a>'.$_nl;\n\n\t\t\t# End row\n\t\t\t\t$_out .= '</td></tr></form>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t# Display form for adding a new entry\n\t\t$button = str_replace('<img src=\"', '', $_TCFG['_IMG_ADD_S']);\n\t\t$_out .= '<form method=\"POST\" action=\"'.$_SERVER['PHP_SELF'].'\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"s_id\" value=\"'.$s_id.'\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"stage\" value=\"\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"cp\" value=\"suppliers\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"op\" value=\"ae_mail_add\">'.$_nl;\n\t\t$_out .= '<tr>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_fname\" size=\"15\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_lname\" size=\"15\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_email\" size=\"35\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'&nbsp;&nbsp;&nbsp;'.$_nl;\n\t\t$_out .= '<input type=\"image\" src=\"'.$button.'</td></tr></form>'.$_nl;\n\n\t# Build return string\n\t\t$returning = $_cstart.$_out.$_cend;\n\n\t# Return the form\n\t\treturn $returning;\n}", "protected function createUserAndGroupListForSelectOptions() {}", "function offerEmail() {\n\t\t$this->set('title_for_layout', 'Advertiser Offer Email');\n\t\t$this->set('advertiserList',$this->common->getAdvertiserProfileAll());\n\t}", "function fill_in_additional_list_fields()\r\n\t{\r\n\t}", "public function getminquali(){\n\t\t\t$prgid = $this->input->post('stu_prgname');\n\t\t\t//print_r($prgid);die;\n\t\t\t//$selectfield=array('admop_min_qual');\n\t\t\t//$whdata = array('admop_prgname_branch' => $prgid);\n\t\t\t//$eligible = $this->commodel->get_distinctrecord('admissionopen',$selectfield,$whdata);\n\t\t\t$eligible = $this->commodel->get_listspfic2('admissionopen','','admop_min_qual','admop_prgname_branch',$prgid,'admop_min_qual');\n\t\tforeach($eligible as $datas):\n\t\t\t\t$eligible = $datas->admop_min_qual; \n\t\t\t\t//echo \"<option id='stu_eligble' value='$eligible'>\".\"$eligible\".\"</option>\";\n\t\t\t\techo \"<span id='stu_eligble'>$eligible</span>\";\n \t\tendforeach;\n\t }", "public function ctlBuscaProveedores(){\n\n\t\t$respuesta = Datos::mdlProveedores();\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}", "function getNameOptions(){\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n \n // Select some fields\n //$query->select('DISTINCT name');\n $query->select('name');\n // From the hello table\n $query->from('#__helloworld_message');\n\t\t\t\t\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$result = $db->loadObjectList();\n\t\t\t\n\t\t\tforeach($result as $item){\n\t\t\t\t$name = $item->name;\n\t\t\t\t$filter_name_options[] = JHTML::_('select.option', $name , $name);\n\t\t\t\t}\n\t\t\treturn $filter_name_options;\n\t\t\t\n\t\t\t}", "function get_vendor_for_product()\n{\n\n $sql = \"select * from vendor order by f_name,l_name \";\n $send_query = query($sql);\n confirm($send_query);\n while ($row = fetch_array($send_query)) {\n $vendor_name = <<<DELIMETER\n <option value=\"{$row['id']}\">{$row['id']} :: {$row['f_name']} {$row['l_name']}</option>\nDELIMETER;\n echo $vendor_name;\n }\n\n\n}", "function GetSupplierList($arryDetails)\r\n\t\t{\r\n\t\t\textract($arryDetails);\t\t\t\r\n\t\t\t$strAddQuery ='';\r\n\t\t\t#$strAddQuery .= (!empty($SuppID))?(\" and s.SuppID='\".$SuppID.\"'\"):(\" and s.locationID='\".$_SESSION['locationID'].\"'\");\r\n\t\t\t$strAddQuery .= (!empty($SuppID))?(\" and s.SuppID='\".mysql_real_escape_string($SuppID).\"'\"):(\" \");\r\n\t\t\t$strAddQuery .= (!empty($Status))?(\" and s.Status='\".$Status.\"'\"):(\"\");\r\n\t\t\t$strAddQuery .= (!empty($primaryVendor))?(\" and s.primaryVendor='1'\"):(\"\");\r\n\t\t\t$strAddQuery .= (!empty($CreditCard))?(\" and s.CreditCard='1'\"):(\"\");\r\n\t\t\t$strSQLQuery = \"select s.SuppID,s.SuppCode,s.UserName,s.Email,s.CompanyName,s.Address,s.Landline,s.Mobile,s.UserName as SuppContact,s.ZipCode,s.Country,s.City,s.State, IF(s.SuppType = 'Individual' and s.UserName!='', s.UserName, CompanyName) as VendorName from p_supplier s where 1 \".$strAddQuery.\" having VendorName!='' order by CompanyName asc\";\r\n\t\treturn $this->query($strSQLQuery, 1);\r\n\t\t}", "function countryList($fieldname=\"country\", $classes=\"form-control\", $important=false, $country=\"\")\n\t{\n\t\tif($important)\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Country' required>\";\n\t\telse\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Country'>\";\n\t\t$con = dbConnect(\"localhost\", \"root\", \"\", \"jobPortal\");\n\t\tif($con)\n\t\t{\n\t\t\t$rsCountry = mysqli_query($con, \"SELECT * FROM countries\");\n\t\t\twhile($row = mysqli_fetch_array($rsCountry))\n\t\t\t{\n\t\t\t\tif($row[\"countries_name\"]==$country)\n\t\t\t\techo \"<option value='\".$row['countries_id'].\"' selected>\".$row['countries_name'].\"</option>\";\n\t\t\t\telse\n\t\t\t\techo \"<option value='\".$row['countries_id'].\"'>\".$row['countries_name'].\"</option>\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t}", "function sub_company_user_list() {\n\t$result=mysql_query(\"SELECT `username`,`name` FROM `users`,`company` WHERE NOT `type`=1 AND NOT `name`='Liberty International' AND users.company = company.company_id ORDER BY `name` ASC\"); \n\t\n\t$options=\"\"; \n\twhile ($row=mysql_fetch_array($result)) { \n\t\t$username=$row['username']; \n\t\t$company=$row['name']; \n\t\t$options.=\"<OPTION VALUE=\".$username.\">\".$company.\" - \". $username; \n\t} \n\treturn $options;\n}", "function PopulateGuestList()\t\n\t{\n\t\t$outStr = \"<option value=\\\" \\\" selected></option>\\n\";\n\t\t\n\t\t// Populate drop-down list with all guests' names\n\t\t$result = mysql_query( \"SELECT last_name, first_name, guest_id FROM rsvps WHERE attendance='yes' ORDER BY last_name\");\n\t\twhile ( $row = mysql_fetch_row( $result ) ) \n\t\t\t$outStr .= \"<option value=\\\"$row[2]\\\">$row[0], $row[1]</option>\\n\";\n\t\t\t\n\t\t$outStr .= \"<option value=\\\"-1\\\"> [Add myself to this list] </option>\\n\";\n\t\treturn $outStr;\n\t}", "function give_me_name_list($curr_value, $java=true, $fname = '', $wbt){\r\n\tglobal $database, $section_id, $TEXT, $tpl;\r\n\t// $tpl->set_block('main_block', $fname.'_block' , $fname);\r\n\t$rt = false;\r\n\t\r\n\t// add authenticated user:\r\n\t$s = \"<option value=\\\"wbu\\\"\";\r\n\tif($curr_value == 'wbu') {\r\n\t\t$s .= \" selected='selected'\";\r\n\t\t$rt = true;\r\n\t}\r\n\tif ($java) $s .= \" onclick=\\\"javascript: document.getElementById('\". $fname.\"_slave').style.display = 'none';\\\"\";\r\n\t$s .= \">$wbt</option>\";\r\n\t$s = '';\r\n\t\r\n\t$query_email_fields = $database->query(\"SELECT `field_id`,`title` FROM `\".TABLE_PREFIX.\"mod_mpform_fields` WHERE `section_id` = '$section_id' AND (`type` = 'textfield') ORDER BY `position` ASC\");\r\n\tif($query_email_fields->numRows() > 0) {\r\n\t\twhile($field = $query_email_fields->fetchRow()) {\r\n\t\t\t$s = \"<option value=\\\"field\".$field['field_id'].\"\\\"\";\r\n\t\t\tif($curr_value == 'field'.$field['field_id']) {\r\n\t\t\t\t$s .= \" selected='selected'\";\r\n\t\t\t\t$rt = true;\r\n\t\t\t}\r\n\t\t\tif ($java) $s .= \" onclick=\\\"javascript: document.getElementById('\". $fname.\"_slave').style.display = 'none';\\\"\";\r\n\t\t\t$s .= \">\".$TEXT['FIELD'].': '.$field['title']. \"</option>\";\r\n\t\t}\r\n\t}\r\n\treturn $rt;\r\n}", "public function smtp_secure_select( $args ) {\n $field_id = $args['label_for'];\n $options = $args['options'];\n $value = get_option( $field_id, $args['default'] );\n \n printf( \"<select name='%s' id='%s'>\", $field_id, $field_id );\n\n foreach ( $options as $option ) {\n $selected = '';\n\n if ( $value == $option ) {\n $selected = 'selected';\n }\n\n printf( \"<option value=%s %s>%s</option>\", $option, $selected, $option );\n }\n \n printf( \"</select>\" );\n }", "function build_insurance_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$insurance_list = '<select name=\"business_id\" class=\"forminput\">';\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"'.$selected.'\" selected=\"selected\">'.$selected_name.'</option>';\n\t\t\t$insurance_list .= '<option value=\"\">------</option>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"\">'.$lang['Select_A_Business'].'</option>';\n\t\t\t$insurance_list .= '<option value=\"\">------</option>';\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE insurance = 1 ORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $insurance = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"'.$insurance['id'].'\">'.$insurance['title'].'</option>';\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$insurance_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'INSURANCE_LIST' => $insurance_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "public function getSupplierList()\n {\n return 'supplier';\n }", "function industryList($fieldname=\"industry\", $classes=\"form-control\", $important=false, $ind=\"Aerospace Industry\")\n\t{\n\t\tif($important)\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Industry' required>\";\n\t\telse\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Industry'>\";\n\t\t$con = dbConnect(\"localhost\", \"root\", \"\", \"jobPortal\");\n\t\tif($con)\n\t\t{\n\t\t\t$rsIndustry = mysqli_query($con, \"SELECT * FROM industries\");\n\t\t\tif($rsIndustry)\n\t\t\t{\n\t\t\t\twhile($row = mysqli_fetch_array($rsIndustry))\n\t\t\t\t{\n\t\t\t\t\tif($row[\"indName\"]==$ind)\n\t\t\t\t\techo \"<option value='\".$row['indId'].\"' selected>\".$row['indName'].\"</option>\";\n\t\t\t\t\telse\n\t\t\t\t\techo \"<option value='\".$row['indId'].\"'>\".$row['indName'].\"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t}", "public function getClientTypeListAction()\n\t{\n\t\t$clientParameters=$this->_request->getParams();\n\t\t$client_types=$clientParameters['client_type'];\t\n\n\t\t$client_obj=new Ep_Quote_Client();\n\t\t\n\t\t$searchparams['client_type']=explode(\",\",$client_types);\t\t\n\t\t$company_list=$client_obj->getAllCompanyList($searchparams);\n\n\t\t$options='<option></option>';\n\n\t\tif($company_list!='NO')\n\t\t{\n\t\t\tforeach($company_list as $id=>$email)\n\t\t\t{\n\t\t\t\t$options.='<option value=\"'.$id.'\"\">'.$email.'</option>';\n\t\t\t}\n\t\t}\n\t\techo $options;\n\n\t}", "function clients_importDisplaySelectValues($data) {\n\tglobal $gSession;\n\t\n\t$current_group = intval($_GET['group']);\n\t$update = intval($_GET['update']);\n\t\n\t## setup the template\n\t$file = ENGINE.\"modules/clients/interface/import_asssign_fields.tpl\";\n\t$select_template = new Template();\n\t$select_template->set_templatefile(array(\"body\" => $file,'column'=>$file));\n\n\t$select_template->set_var('language_inputhead','Match the file with your subscriber fields');\n\t$select_template->set_var('language_inputbody',\"For each column, select the field it corresponds to in 'Belongs to'. Click the 'Next' button when you're do\");\n\t$select_template->set_var('element_desc',' ');\n\t\n\t$targetURL = \"module.php?cmd=import&step=4&group=\".$current_group.'&update='.$update;\n\t$targetURL = $gSession->url($targetURL);\n\t$select_template->set_var('actionURL',$targetURL);\t\n\t\n\t## prepare the select element wiht all available fields\n\t$wt = new ctlparser(MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/base.xml');\n\t$wt->parse();\t\t\n\t$elements = $wt->getElements();\t\n\t\n\t$allowed_types = array('text','email','copytext','tags','selectbox','date');\n\t$field_selector = '<option label=\"\" value=\"-1\">Skip This Column</option><option label=\"\" value=\"-1\"></option>';\n\tforeach($elements as $current_row) {\n\t\tforeach($current_row as $current_element) {\n\t\t\t$type = strtolower($current_element['TYPE']);\n\t\t\t$identifier = strtolower($current_element['IDENTIFIER']);\n\t\t\t\n\t\t\tif(in_array($type,$allowed_types)) {\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(MATRIX_BASEDIR.\"/matrix_engine/modules/clients/attributetypes/\".$type.\"/attribute.php\");\t\t\t\n\t\t\t\tif(function_exists(\"clients_\".$type.\"_getData\")) {\n\t\t\t\t\t$field_selector .= '<option label=\"'.$current_element['NAME'].'\" value=\"'.$identifier.'\">'.$current_element['NAME'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\t\n\t## now we will output each colum recoginzed by the system\n\t$output = '';\n\t$counter = 0;\n\n\tforeach($data as $key=>$value) {\n\t\t$current_selector = '<select name=\"COLUMN_'.$counter.'\">'.$field_selector.'</select>';\n\t\n\t\t$select_template->set_var('COLUMN_NAME',$key);\n\t\t$select_template->set_var('COLUMN_SELECTOR',$current_selector);\n\t\t\n\t\t$output .= $select_template->fill_block(\"column\");\n\t\t$counter++;\n\t}\n\t\n\t## prpeare the hidden fields\n\t$hiddenfields = '<input name=\"column_count\" id=\"column_count\" type=\"hidden\" value=\"'.($counter-1).'\">';\n\t\n\t$select_template->set_var('COLUMNS',$output);\t\n\t$select_template->set_var('hiddenfields',$hiddenfields);\n\t\n\t$select_template->pfill_block(\"body\");\n\t\n}", "function pmprowoo_gift_levels_add_recipient_fields() {\r\n global $product;\t\r\n $product_id = $product->get_id();\r\n\t\r\n $gift_membership_code = get_post_meta( $product_id, '_gift_membership_code', true);\r\n $gift_membership_email_option = get_post_meta($product_id, '_gift_membership_email_option', true);\r\n\t\r\n if(!empty($gift_membership_code) && !empty($gift_membership_email_option)){\r\n if($gift_membership_email_option == '1'){\r\n echo '<table class=\"variations gift-membership-fields\" cellspacing=\"0\">\r\n <tbody>\r\n <tr>\r\n <td class=\"label\"><label for=\"gift-recipient-name\">'. __( 'Recipient Name', 'pmpro-woocommerce' ).'</label></td>\r\n <td class=\"value\"><input type=\"text\" name=\"gift-recipient-name\" value=\"\" style=\"margin:0;\" /></td>\r\n </tr> \r\n <tr>\r\n <td class=\"label\"><label for=\"gift-recipient-email\">'. __( 'Recipient Email', 'pmpro-woocommerce' ).'</label></td>\r\n <td class=\"value\"><input type=\"text\" name=\"gift-recipient-email\" value=\"\" style=\"margin:0;\" /></td>\r\n </tr> \r\n </tbody>\r\n </table>';\r\n }elseif($gift_membership_email_option == '3'){\r\n echo '<table class=\"variations gift-membership-fields\" cellspacing=\"0\">\r\n <tbody>\r\n <tr>\r\n <td class=\"label\"><label for=\"gift-recipient-email\">'. __( 'Send Email to Recipient?', 'pmpro-woocommerce' ).'</label></td>\r\n <td class=\"value\"><select id=\"pa_send-email\" class=\"\" name=\"gift-send-email\"> \r\n <option selected=\"selected\" value=\"\">Choose an option</option>\r\n <option class=\"attached enabled\" value=\"1\">YES</option>\r\n <option class=\"attached enabled\" value=\"0\">NO</option>\r\n </select></td>\r\n </tr> \r\n <tr id=\"recipient-name\" style=\"display:none;\">\r\n <td class=\"label\"><label for=\"gift-recipient-name\">'. __( 'Recipient Name', 'pmpro-woocommerce' ).'</label></td>\r\n <td class=\"value\"><input type=\"text\" name=\"gift-recipient-name\" value=\"\" style=\"margin:0;\" /></td>\r\n </tr>\r\n <tr id=\"recipient-email\" style=\"display:none;\">\r\n <td class=\"label\"><label for=\"gift-recipient-email\">'. __( 'Recipient Email', 'pmpro-woocommerce' ).'</label></td>\r\n <td class=\"value\"><input type=\"text\" name=\"gift-recipient-email\" value=\"\" style=\"margin:0;\" /></td>\r\n </tr> \r\n </tbody>\r\n </table>';\r\n echo \"<script type='text/javascript'>\r\n jQuery(document).ready(function($){\r\n if ( $('#pa_send-email').val() == '1') {\r\n $('#recipient-name').show();\r\n $('#recipient-email').show();\r\n }\r\n $('#pa_send-email').on('change', function() {\r\n if ( this.value == '1') {\r\n $('#recipient-name').show();\r\n $('#recipient-email').show();\r\n } else {\r\n $('#recipient-name').hide();\r\n $('#recipient-email').hide();\r\n }\r\n });\r\n });\r\n </script>\";\r\n }\r\n }\r\n\r\n}" ]
[ "0.72284275", "0.6165431", "0.6056979", "0.59823215", "0.5956728", "0.59533775", "0.58541936", "0.57612777", "0.5747015", "0.5694604", "0.56943625", "0.56774485", "0.56399715", "0.5569345", "0.5537811", "0.552397", "0.5484817", "0.54840535", "0.5479395", "0.5476864", "0.54493684", "0.54450995", "0.54246974", "0.541825", "0.54134196", "0.53851914", "0.5377689", "0.5366084", "0.53521764", "0.534728" ]
0.77125174
0
Do select list for: Suppliers
function do_select_list_suppliers($aname, $avalue) { # Dim some Vars: global $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp; # Set Query for select. $query = 'SELECT s_id, s_company, s_name_first, s_name_last FROM '.$_DBCFG['suppliers']; $query .= " WHERE s_email <> ''"; $query .= ' ORDER BY s_company ASC, s_name_last ASC, s_name_first ASC'; $result = $db_coin->db_query_execute($query); $numrows = $db_coin->db_query_numrows($result); # Build form field output $_out .= '<select class="select_form" name="'.$aname.'" size="1">'.$_nl; $_out .= '<option value="0">'.$_LANG['_BASE']['Please_Select'].'</option>'.$_nl; $_out .= '<option value="-1"'; IF ($avalue == -1) {$_out .= ' selected';} $_out .= '>'.$_LANG['_MAIL']['All_Active_Suppliers'].'</option>'.$_nl; # Process query results to list individual suppliers while(list($s_id, $s_company, $s_name_first, $s_name_last) = $db_coin->db_fetch_row($result)) { $_more = ''; # Add supplier info, indenting if additional emails present $_out .= '<option value="'.$s_id.'"'; IF ($s_id == $avalue) {$_out .= ' selected';} $_out .= '>'; $_out .= $s_company.' - '.$s_name_last.', '.$s_name_first.'</option>'.$_nl; # Grab any additional emails for this client, so they are all together in the list $_more = do_select_list_suppliers_additional_emails($s_id, $s_company); # Add "All" option, if necessary IF ($_more) { IF (substr_count($_more, '<option') > 1) { $_out .= '<option value="contacts|'.$cl_id.'">'.$_sp.$_sp.$_sp.$s_company.' - '.$s_name_last.', '.$s_name_first.' ('.$_LANG['_BASE']['All_Contacts'].')</option>'.$_nl; } $_out .= $_more; } } $_out .= '</select>'.$_nl; return $_out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listSuppliers($suppliers) {\n \n echo \"<input list=suppliers name=supplier>\";\n echo \"<datalist id=suppliers>\";\n \n // Loop through the suppliers and insert it as an option\n foreach ($suppliers as $supplier) {\n \n echo '<option value=\"' . $supplier[\"SNAME\"] . ' \">' . '</option>';\n \n }\n \n echo \"</datalist>\";\n \n \n }", "function cp_do_select_listing_suppliers($adata) {\n\t# Get security vars\n\t\t$_SEC\t= get_security_flags();\n\t\t$_PERMS\t= do_decode_perms_admin($_SEC['_sadmin_perms']);\n\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_LANG, $_nl, $_sp;\n\t\t$_where\t= '';\n\t\t$_out\t= '';\n\t\t$_ps\t\t= '';\n\t\tIF ($adata['status'] && $adata['status'] != 'all') {$_ps .= '&status='.$adata['status'];}\n\t\tIF ($adata['notstatus']) {$_ps .= '&notstatus='.$adata['notstatus'];}\n\n\n\t# Set Query for select.\n\t\t$query = 'SELECT * FROM '.$_DBCFG['suppliers'];\n\n\t# Set Filters\n\t\tIF (!$adata['fb'])\t\t{$adata['fb'] = '';}\n\t\tIF ($adata['fb'] == '1')\t{$_where .= \" WHERE s_status='\".$db_coin->db_sanitize_data($adata['fs']).\"'\";}\n\n\t# Show only selected status suppliers\n\t\tIF ($adata['status'] && $adata['status'] != 'all') {\n\t\t\tIF ($_where) {$_where .= ' AND ';} ELSE {$_where .= ' WHERE ';}\n\t\t\t$_where .= \"s_status='\".$db_coin->db_sanitize_data($adata['status']).\"'\";\n\t\t}\n\t\tIF ($adata['notstatus']) {\n\t\t\tIF ($_where) {$_where .= ' AND ';} ELSE {$_where .= ' WHERE ';}\n\t\t\t$_where .= \"s_status != '\".$db_coin->db_sanitize_data($adata['notstatus']).\"'\";\n\t\t}\n\n\t# Set Order ASC / DESC part of sort\n\t\tIF (!$adata['so'])\t\t{$adata['so'] = 'A';}\n\t\tIF ($adata['so'] == 'A')\t{$order_AD = ' ASC';}\n\t\tIF ($adata['so'] == 'D')\t{$order_AD = ' DESC';}\n\n\t# Set Sort orders\n\t\tIF (!$adata['sb'])\t\t{$adata['sb'] = '3';}\n\t\tIF ($adata['sb'] == '1')\t{$_order = ' ORDER BY s_id'.$order_AD;}\n\t\tIF ($adata['sb'] == '2')\t{$_order = ' ORDER BY s_status'.$order_AD;}\n\t\tIF ($adata['sb'] == '3')\t{$_order = ' ORDER BY s_company'.$order_AD;}\n\t\tIF ($adata['sb'] == '4')\t{$_order = ' ORDER BY s_name_last'.$order_AD.', s_name_first'.$order_AD;}\n\t\tIF ($adata['sb'] == '5')\t{$_order = ' ORDER BY s_email'.$order_AD;}\n\n\t# Set / Calc additional paramters string\n\t\tIF ($adata['sb'])\t{$_argsb= '&sb='.$adata['sb'];}\n\t\tIF ($adata['so'])\t{$_argso= '&so='.$adata['so'];}\n\t\tIF ($adata['fb'])\t{$_argfb= '&fb='.$adata['fb'];}\n\t\tIF ($adata['fs'])\t{$_argfs= '&fs='.$adata['fs'];}\n\t\t$_link_xtra = $_argsb.$_argso.$_argfb.$_argfs;\n\n\t# Build Page menu\n\t# Get count of rows total for pages menu:\n\t\t$query_ttl = 'SELECT COUNT(*)';\n\t\t$query_ttl .= ' FROM '.$_DBCFG['suppliers'];\n\t\t$query_ttl .= $_where;\n\n\t\t$result_ttl= $db_coin->db_query_execute($query_ttl);\n\t\twhile(list($cnt) = $db_coin->db_fetch_row($result_ttl)) {$numrows_ttl = $cnt;}\n\n\t# Page Loading first rec number\n\t# $_rec_next\t- is page loading first record number\n\t# $_rec_start\t- is a given page start record (which will be rec_next)\n\t\tIF (!$_CCFG['IPP_SUPPLIERS'] > 0) {$_CCFG['IPP_SUPPLIERS'] = 15;}\n\t\t$_rec_page\t= $_CCFG['IPP_SUPPLIERS'];\n\t\t$_rec_next\t= $adata['rec_next'];\n\t\tIF (!$_rec_next) {$_rec_next=0;}\n\n\t# Range of records on current page\n\t\t$_rec_next_lo = $_rec_next+1;\n\t\t$_rec_next_hi = $_rec_next+$_rec_page;\n\t\tIF ($_rec_next_hi > $numrows_ttl) {$_rec_next_hi = $numrows_ttl;}\n\n\t# Calc no pages,\n\t\t$_num_pages = round(($numrows_ttl/$_rec_page), 0);\n\t\tIF ($_num_pages < ($numrows_ttl/$_rec_page)) {$_num_pages = $_num_pages+1;}\n\n\t# Loop Array and Print Out Page Menu HTML\n\t\t$_page_menu = $_LANG['_ADMIN']['l_Pages'].$_sp;\n\t\tfor ($i = 1; $i <= $_num_pages; $i++) {\n\t\t\t$_rec_start = (($i*$_rec_page)-$_rec_page);\n\t\t\tIF ($_rec_start == $_rec_next) {\n\t\t\t# Loading Page start record so no link for this page.\n\t\t\t\t$_page_menu .= $i;\n\t\t\t} ELSE {\n\t\t\t\t$_page_menu .= '<a href=\"admin.php?cp=suppliers'.$_link_xtra.$_ps.'&rec_next='.$_rec_start.'\">'.$i.'</a>';\n\t\t\t}\n\t\t\tIF ($i < $_num_pages) {$_page_menu .= ','.$_sp;}\n\t\t} # End page menu\n\n\t# Finish out query with record limits and do data select for display and return check\n\t\t$query\t.= $_where.$_order.\" LIMIT $_rec_next, $_rec_page\";\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\n\t# Generate links for sorting\n\t\t$_hdr_link_prefix = '<a href=\"admin.php?cp=suppliers&sb=';\n\t\t$_hdr_link_suffix = '&fb='.$adata['fb'].'&fs='.$adata['fs'].'&fc='.$adata['fc'].'&rec_next='.$_rec_next.$_ps.'\">';\n\n\t\t$_hdr_link_1 = $_LANG['_ADMIN']['l_Supplier_ID'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_1 .= $_hdr_link_prefix.'1&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_1 .= $_hdr_link_prefix.'1&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_2 = $_LANG['_ADMIN']['l_Status'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_2 .= $_hdr_link_prefix.'2&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_2 .= $_hdr_link_prefix.'2&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_3 = $_LANG['_ADMIN']['l_Company'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_3 .= $_hdr_link_prefix.'3&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_3 .= $_hdr_link_prefix.'3&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_4 = $_LANG['_ADMIN']['l_Full_Name'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_4 .= $_hdr_link_prefix.'4&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_4 .= $_hdr_link_prefix.'4&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_5 = $_LANG['_ADMIN']['l_Email_Address'].$_sp.'<br>';\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_hdr_link_5 .= $_hdr_link_prefix.'5&so=A'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_ASC_S'].'</a>';\n\t\t\t$_hdr_link_5 .= $_hdr_link_prefix.'5&so=D'.$_hdr_link_suffix.$_TCFG['_IMG_SORT_DSC_S'].'</a>';\n\t\t}\n\n\t\t$_hdr_link_6 .= $_LANG['_ADMIN']['l_Balance'].$_sp.'<br>';\n\n\t# Build Status header bar for viewing only certain types\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_out .= '&nbsp;&nbsp;&nbsp;<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\"><tr>';\n\t\t\t$_out .= '<td>'.$_LANG['_BASE']['Only'].':</td>';\n\t\t\t$_out .= '<td>&nbsp;[<a href=\"admin.php?cp=suppliers&op=none&status=all'.$_link_xtra;\n\t\t\t$_out .= '\">'.$_LANG['_BASE']['All'].'</a>]&nbsp;</td>';\n\t\t\tfor ($i=0; $i< sizeof($_CCFG['S_STATUS']); $i++) {\n\t\t\t\t$_out .= '<td align=\"right\"><nobr>&nbsp;[<a href=\"admin.php?cp=suppliers&op=none&status='.$_CCFG['S_STATUS'][$i].$_link_xtra;\n\t\t\t\t$_out .= '\">'.$_CCFG['S_STATUS'][$i].'</a>]&nbsp;</nobr></td>';\n\t\t\t}\n\t\t\t$_out .= '</tr><tr>';\n\t\t\t$_out .= '<td>'.$_LANG['_BASE']['Except'].':</td>';\n\t\t\t$_out .= '<td>&nbsp;</td>';\n\t\t\tfor ($i=0; $i< sizeof($_CCFG['S_STATUS']); $i++) {\n\t\t\t\t$_out .= '<td><nobr>&nbsp;[<a href=\"admin.php?cp=suppliers&op=none&notstatus='.$_CCFG['S_STATUS'][$i].$_link_xtra;\n\t\t\t\t$_out .= '\">'.$_CCFG['S_STATUS'][$i].'</a>]&nbsp;</nobr></td>';\n\t\t\t}\n\t\t\t$_out .= '</tr></table>';\n\t\t\t$_out .= '<br><br>';\n\t\t}\n\n\t# Build form output\n\t\t$_out .= '<div align=\"center\">'.$_nl;\n\t\t$_out .= '<table width=\"95%\" border=\"0\" bordercolor=\"'.$_TCFG['_TAG_TABLE_BRDR_COLOR'].'\" bgcolor=\"'.$_TCFG['_TAG_TRTD_BKGRND_COLOR'].'\" cellpadding=\"0\" cellspacing=\"1\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_TITLE\"><td class=\"TP3MED_NC\" colspan=\"'.(7-$_CCFG['_IS_PRINT']).'\">'.$_nl;\n\n\t\t$_out .= '<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_IT_TITLE_TXT\">'.$_nl.'<td class=\"TP0MED_NL\">'.$_nl;\n\t\t$_out .= '<b>'.$_LANG['_ADMIN']['Suppliers'].':'.$_sp.'('.$_rec_next_lo.'-'.$_rec_next_hi.$_sp.$_LANG['_ADMIN']['of'].$_sp.$numrows_ttl.$_sp.$_LANG['_ADMIN']['total_entries'].')</b><br>'.$_nl;\n\t\t$_out .= '</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP0MED_NR\">'.$_sp.'</td>'.$_nl;\n\t\t$_out .= '</tr>'.$_nl.'</table>'.$_nl;\n\n\t\t$_out .= '</td></tr>'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_1.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_2.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_3.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_4.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_hdr_link_5.'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BR\" valign=\"top\">'.$_hdr_link_6.'</td>'.$_nl;\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t$_out .= '<td class=\"TP3SML_BL\" valign=\"top\">'.$_LANG['_CCFG']['Actions'].'</td>'.$_nl;\n\t\t}\n\t\t$_out .= '</tr>'.$_nl;\n\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\t\t\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_id'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_status'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_company'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_name_last'];\n\t\t\t\tIF ($row['s_name_last']) {$_out .= ', ';}\n\t\t\t\t$_out .= $row['s_name_first'];\n\t\t\t\t$_out .= '</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.$row['s_email'].'</td>'.$_nl;\n\t\t\t\t$idata = do_get_bill_supplier_balance($row['s_id']);\n\t\t\t\t$_out .= '<td class=\"TP3SML_NR\">';\n\t\t\t\tIF ($idata['net_balance']) {$_out .= do_currency_format($idata['net_balance'],1,0,$_CCFG['CURRENCY_DISPLAY_DIGITS_AMOUNT']);}\n\t\t\t\t$_out .= $_sp.'</td>'.$_nl;\n\n\t\t\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t\t\t$_out .= '<td class=\"TP3SML_NL\"><nobr>'.$_nl;\n\t\t\t\t\t$_out .= do_nav_link('admin.php?cp=suppliers&op=view&s_id='.$row['s_id'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t\t\t\t\tIF ($_PERMS['AP16'] == 1 || $_PERMS['AP04'] == 1) {\n\t\t\t\t\t\t$_out .= do_nav_link('admin.php?cp=suppliers&op=edit&s_id='.$row['s_id'], $_TCFG['_S_IMG_EDIT_S'],$_TCFG['_S_IMG_EDIT_S_MO'],'','');\n\t\t\t\t\t\t$_out .= do_nav_link('admin.php?cp=suppliers&op=delete&stage=1&s_id='.$row['s_id'].'&s_name_first='.$row['s_name_first'].'&s_name_last='.$row['s_name_last'], $_TCFG['_S_IMG_DEL_S'],$_TCFG['_S_IMG_DEL_S_MO'],'','');\n\t\t\t\t\t}\n\t\t\t\t\t$_out .= '</nobr></td>'.$_nl;\n\t\t\t\t}\n\t\t\t\t$_out .= '</tr>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\"><td class=\"TP3MED_NC\" colspan=\"'.(7-$_CCFG['_IS_PRINT']).'\">'.$_nl;\n\t\t$_out .= $_page_menu.$_nl;\n\t\t$_out .= '</td></tr>'.$_nl;\n\n\t\t$_out .= '</table>'.$_nl;\n\t\t$_out .= '</div>'.$_nl;\n\t\t$_out .= '<br>'.$_nl;\n\n\t\treturn $_out;\n}", "public function getSuppliers($suppliers_id);", "public function get_suppliers_list()\n\t {\n\t \t$userId=$this->checklogin();\n\t \t$query=$this->ApiModel->get_suppliers_list($userId);\n\t \techo json_encode($query);\n\t }", "public function suppliers_by_cat($id_cat, $clang = 'ro'){\n\t\t\n\t\t\t$str = '<option value=\"\" label=\"' . lang('invoices_pick') . '\">' . lang('invoices_pick') . '</option>';\n\t\t\t$options = $this->ss_suppliers_model->options_list(NULL, NULL, array('id_cat' => $id_cat));\n\t\t\t$selectedSupplier = $this->input->post('supplier');\n\t\t\t\n\t\t\tforeach($options as $key => $val)\n\t\t\t{\n\t\t\t\t$str = $str . '<option value=\"'. $key .'\"'. ($key != $selectedSupplier ? '' : ' selected') .'>'.$val.'</option>';\n\t\t\t}\n\t\t\t\n\t\t\techo $str;\n\t\t}", "public function getProductSelections();", "public function getSupplierList()\n {\n return 'supplier';\n }", "public function brandsSearchDrop(){\n $table = \"brands\";\n $cresults = $this->getAllrecords($table);\n if($cresults == \"NO_RECORDS_FOUND\"){\n echo(\"NO_PRODUCT_FOUND\");\n }\n else{\n foreach($cresults as $brands){\n echo('<option value=\"'.$brands[\"brand_id\"].'\">'.$brands[\"brand_name\"].'</option>');\n }\n\n\n }\n\n \n}", "public function getAllSuppliersToDataTables();", "public function getSuppliers($options = array())\n {\n return $this->getListe(\"suppliers\", $options);\n }", "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "public function draw_product_selection() {\n\n // Get products in the wooCommerce store\n $products = $this->getProducts();\n\n echo \"<select name='product'>\";\n /** @var Product $product */\n foreach ($products as $product) {\n echo \"<option value='\".$product->getId().\"'>\".$product->getTitle().\"</option>\";\n }\n echo \"</select>\";\n }", "public function getListOfSuppliers() {\n return $this->client->GetListOfSuppliers();\n }", "public function brandForm(){\n $table = \"brands\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $brand){\n echo('<option value=\"'.$brand[\"brand_id\"].'\">'.$brand[\"brand_name\"].'</option>');\n }\n\n\n }", "function GetSupplierList($arryDetails)\r\n\t\t{\r\n\t\t\textract($arryDetails);\t\t\t\r\n\t\t\t$strAddQuery ='';\r\n\t\t\t#$strAddQuery .= (!empty($SuppID))?(\" and s.SuppID='\".$SuppID.\"'\"):(\" and s.locationID='\".$_SESSION['locationID'].\"'\");\r\n\t\t\t$strAddQuery .= (!empty($SuppID))?(\" and s.SuppID='\".mysql_real_escape_string($SuppID).\"'\"):(\" \");\r\n\t\t\t$strAddQuery .= (!empty($Status))?(\" and s.Status='\".$Status.\"'\"):(\"\");\r\n\t\t\t$strAddQuery .= (!empty($primaryVendor))?(\" and s.primaryVendor='1'\"):(\"\");\r\n\t\t\t$strAddQuery .= (!empty($CreditCard))?(\" and s.CreditCard='1'\"):(\"\");\r\n\t\t\t$strSQLQuery = \"select s.SuppID,s.SuppCode,s.UserName,s.Email,s.CompanyName,s.Address,s.Landline,s.Mobile,s.UserName as SuppContact,s.ZipCode,s.Country,s.City,s.State, IF(s.SuppType = 'Individual' and s.UserName!='', s.UserName, CompanyName) as VendorName from p_supplier s where 1 \".$strAddQuery.\" having VendorName!='' order by CompanyName asc\";\r\n\t\treturn $this->query($strSQLQuery, 1);\r\n\t\t}", "public function viewSupplies() {\n\t\t//SQL\n\t\t$servername = \"localhost\";\n\t\t$username = \"root\";\n\t\t$password = \"\";\n\t\t$dbname = \"a2Database\";\n\n\t\t// Create connection\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t\t// Check connection\n\t\tif ($conn->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\n\t\t} \n\n\t\t$sql = \"SELECT * FROM supplies\";\n\t\t$result = $conn->query($sql);\n\n\t\tif ($result->num_rows > 0) {\n\t\t\t// output data of each row\n\t\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t\techo \"<br>code: \" . $row[\"code\"]. \"<br> name: \" . $row[\"name\"]. \"<br> description: \" . $row[\"description\"] . \"<br> receiving_cost: \" . $row[\"receiving_cost\"] . \"<br> receiving_unit: \" . $row[\"receiving_unit\"] . \"<br> stocking_unit: \" . $row[\"stocking_unit\"] . \"<br> quantity: \" . $row[\"quantity\"] .\"<br>\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0 results\";\n\t\t}\n\t\t$conn->close();\n\t\t//SQL//\n\t}", "public function ctlBuscaProveedores(){\n\n\t\t$respuesta = Datos::mdlProveedores();\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}", "function spec()\r\n\t{\r\n\t\t$obr = \"SELECT NameSpec, ID FROM SPEC ORDER BY ID\";\t\r\n\t\t$res_obr = mysql_query($obr);\r\n\t\t$number = 1;\r\n /* show result */\r\n\t \twhile ($row = mysql_fetch_array($res_obr, MYSQL_ASSOC)) \r\n\t\t{\r\n\t\t\tprintf(\"<option value='\".$row[\"ID\"].\"'>\");\r\n \tprintf ($row[\"NameSpec\"]);\r\n\t\t\tprintf(\"</option>\");\r\n\t\t\t$number ++;\r\n\t\t}\r\n\t\tmysql_free_result($res_obr);\r\n\t}", "public function select($proveedor);", "function genreopties(){\r\n\t\tglobal $pdo;\r\n\t\t\t//maken sql query\r\n\t\t$sql = \"SELECT DISTINCT genre_name FROM Genre\";\r\n\t\t\t//afschieten query\r\n\t\t$result = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\r\n\t\tforeach($result as $row){\r\n\t\t\tforeach($row as $genre){\r\n\t\t\t\techo '<option value='.$genre.'>'.$genre.'</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getSuppliers()\n {\n $conditions = \"job_type = :job_type: AND job_id = :job_id:\";\n $parameters = array(\n 'job_type' => $this->job_type,\n 'job_id' => $this->job_id\n );\n $quotes = Quote::find(array(\n $conditions,\n \"bind\" => $parameters\n ));\n $suppliers = array();\n $users = array();\n foreach($quotes as $quote) {\n if (!in_array($quote->user_id, $users)) {\n $users[] = $quote->user_id;\n $supplier = Supplier::findFirstByUserId($quote->user_id);\n if ($supplier) {\n $supplier = $supplier->toArray();\n $supplier['quote_status'] = $quote->status;\n $suppliers[] = $supplier;\n }\n }\n }\n return $suppliers;\n }", "function colores_drop_list(){\n\n$sql =\"SELECT * FROM colores ;\";\n$result = $this->database->query($sql);\n$result = $this->database->result;\nwhile($row = mysql_fetch_array($result)){\n$id= $row['id_color'];\n$name= $row['nombre_color'];\necho '<option value='.$id.'>'.$name.'</option>';\n}\n}", "function comboRecompensas($id_recompensa = 0, $filter = \"\", $name_control = \"id_recompensa\"){\n\t$elements = recompensasController::getListAction(9999, $filter); ?>\n\t<select name=\"<?php echo $name_control;?>\" id=\"<?php echo $name_control;?>\" class=\"form-control\">\n\t\t<option value=\"0\"> ---- Selecciona una recompensa ---- </option>\n\t\t<?php foreach($elements['items'] as $element):?>\n\t\t<option value=\"<?php echo $element['id_recompensa'];?>\" <?php if ($id_recompensa == $element['id_recompensa']) echo ' selected=\"selected\" ';?>><?php echo $element['recompensa_name'];?></option>\n\t\t<?php endforeach;?>\n\t</select>\n<?php }", "function listadoSelect();", "function bls_sf_selectForTypes() {\n\tbls_ut_backTrace(\"bls_sf_selectForTypes\");\n\tglobal $bls_sf_location;\n\n\techo \"<select name=\\\"s_pkg_srctype\\\">\";\n\tforeach ($bls_sf_location as $key => $val) {\n\t\techo \"<option value=\\\"$key\\\">$val</option>\";\n\t}\n\techo \"</select>\";\n}", "function laboratorist_options($lab_scientist) {\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT * from laboratorist WHERE store_id=\"'.$_SESSION['store_id'].'\" ORDER by laboratorist_name ASC';\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t$options = '';\r\n\t\tif($lab_scientist != '') { \r\n\t\t\twhile($row = $result->fetch_array()) { \r\n\t\t\t\tif($sample_id == $row['sample_id']) {\r\n\t\t\t\t$options .= '<option selected=\"selected\" value=\"'.$row['laboratorist_id'].'\">'.$row['laboratorist_name'].' ('.$row['laboratorist_manual_id'].')</option>';\r\n\t\t\t\t} else { \r\n\t\t\t\t$options .= '<option value=\"'.$row['laboratorist_id'].'\">'.$row['laboratorist_name'].' ('.$row['laboratorist_manual_id'].')</option>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { \r\n\t\t\twhile($row = $result->fetch_array()) { \r\n\t\t\t\t$options .= '<option value=\"'.$row['laboratorist_id'].'\">'.$row['laboratorist_name'].' ('.$row['laboratorist_manual_id'].')</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t\techo $options;\t\r\n\t}", "function vList() {\n $vlist=$this->getListVars();\n //need database,table,varname,tableinfo for variable =\n // browse=varname;ctrl=whatever;titl=something;whatever other options\n $postStrng=\"method=useQonFly\".\n '&db='.$this->dbName.\n '&tabl='.$this->tabl.\n '&index='.$this->indx;\n if ($vlist) {\n $postStrng.=\"&cmnd=qlist\";\n $chStrng=\"document.getElementById('updBrowse').style.visibility='visible';\";\n $chStrng.=\"jtAjaxLibSelect('$postStrng','varinfo','jtSpecs','1');\";\n echo \"<p><strong>Filter by</strong>\\n<select id=\\\"varinfo\\\" name=\\\"varinfo\\\"\";\n echo \" />\\n\";\n echo \"<option value=\\\"0\\\"> -- </option>\\n\";\n foreach ($vlist as $item) {\n $a=$this->xQueryInfo[\"$item\"];\n $code=\"$item;ctrl=\".$a->getSize().';titl='.$a->getLabel().';'.\n $this->implodeAllOpts($a);\n echo \"<option value=\\\"$code\\\">\",$a->getLabel(),\"</option>\\n\";\n }\n echo \"</select>\\n\";\n addButton('myChoice','Choose',$chStrng); \n //echo \"</p>\\n\";\n } //vlist not empty\n }", "public function add_new_supplier()\n {\n if ($this->input->post())\n {\n $ac_payable = $this->MSettings->get_by_company_id($this->session->user_company);\n $chart = $this->MAc_charts->get_by_id($ac_payable['ac_payable']);\n $siblings = $this->MAc_charts->get_by_parent_id($ac_payable['ac_payable']);\n if (count($siblings) > 0)\n {\n $ac_code_temp = explode('.', $siblings['code']);\n $ac_last = count($ac_code_temp) - 1;\n $ac_new = (int)$ac_code_temp[$ac_last] + 10;\n $ac_code = $chart['code'] . '.' . $ac_new;\n }\n else\n {\n $ac_code = $chart['code'] . '.10';\n }\n $ac_id = $this->MAc_charts->account_create($ac_payable['ac_payable'], $ac_code, $this->input->post('name'));\n $insert_id = $this->MSuppliers->create(trim($this->input->post('code')), $ac_id);\n $suppliers = $this->MSuppliers->get_all();\n $html = '';\n foreach ($suppliers as $supplier)\n {\n if ($insert_id == $supplier['id'])\n {\n $html .= '<option value=\"' . $supplier['id'] . '\" selected>' . $supplier['name'] . '</option>';\n }\n else\n {\n $html .= '<option value=\"' . $supplier['id'] . '\">' . $supplier['name'] . '</option>';\n }\n }\n echo $html;\n }\n }", "function do_select_list_suppliers_additional_emails($avalue, $aname) {\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\t\t$_out = '';\n\n\t# Set Query for select.\n\t\t$query\t= 'SELECT contacts_id, contacts_s_id, contacts_name_first, contacts_name_last, contacts_email FROM '.$_DBCFG['suppliers_contacts'];\n\t\tIF ($avalue) {$query .= ' WHERE contacts_s_id='.$avalue;}\n\t\t$query .= ' ORDER BY contacts_name_last ASC, contacts_name_first ASC';\n\n\t# Do select\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\n\t\tIF ($numrows) {\n\t\t# Process query results to list individual clients\n\t\t\twhile(list($contacts_id, $contacts_cl_id, $contacts_name_first, $contacts_name_last, $contacts_email) = $db_coin->db_fetch_row($result)) {\n\t\t \t$i++;\n\t\t\t\t$_out .= '<option value=\"'.'alias|'.$contacts_id.'\">';\n\t\t\t\t$_out .= $_sp.$_sp.$_sp.$aname.' - '.$contacts_name_last.', '.$contacts_name_first.' ('.$_LANG['_BASE']['Email_Additional'].')</option>'.$_nl;\n\t\t\t}\n\t\t\treturn $_out;\n\t\t} ELSE {\n\t\t return '';\n\t\t}\n}", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}" ]
[ "0.7001589", "0.6967833", "0.6549886", "0.65221965", "0.6438195", "0.6177406", "0.61446697", "0.6135953", "0.60139185", "0.5904682", "0.5903299", "0.5884091", "0.5876469", "0.5834687", "0.58083737", "0.5690744", "0.56835616", "0.56834364", "0.5672376", "0.56717235", "0.5670463", "0.56660897", "0.565087", "0.56437254", "0.5622073", "0.5619893", "0.56152505", "0.5601382", "0.56009346", "0.5590239" ]
0.6991193
1
Do process contact sitetoallsupplier email form (build, set email))
function do_contact_supplier_email_all($adata, $aret_flag=0) { # Dim Some Vars global $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp; $DesiredGroup = 0; $DesiredServer = 0; $DesiredAlias = 0; $DesiredClient = 0; $_ret_msg = ''; # Check if we are sending to an alias for a supplier $pos1 = strpos(strtolower($adata['cc_s_id']), 'alias'); IF ($pos1 !== false) { $pieces = explode('|', $adata['cc_s_id']); $DesiredAlias = $pieces[1]; } # Check if we are sending to all contacts for a supplier $pos2 = strpos(strtolower($adata['cc_s_id']), 'contacts'); IF ($pos2 !== false) { $pieces = explode('|', $adata['cc_s_id']); $DesiredSupplier = $pieces[1]; } # Get site contact information array $_mcinfo = get_contact_info($adata['cc_mc_id']); # Set Query for select $query = 'SELECT '; IF ($DesiredAlias) { $query .= $_DBCFG['suppliers_contacts'].'.contacts_email, '; $query .= $_DBCFG['suppliers_contacts'].'.contacts_name_first, '; $query .= $_DBCFG['suppliers_contacts'].'.contacts_name_last'; } ELSEIF ($DesiredSupplier) { $query .= $_DBCFG['suppliers'].'.s_email, '; $query .= $_DBCFG['suppliers'].'.s_name_first, '; $query .= $_DBCFG['suppliers'].'.s_name_last, '; $query .= $_DBCFG['suppliers_contacts'].'.contacts_email, '; $query .= $_DBCFG['suppliers_contacts'].'.contacts_name_first, '; $query .= $_DBCFG['suppliers_contacts'].'.contacts_name_last'; } ELSE { $query .= $_DBCFG['suppliers'].'.s_email, '; $query .= $_DBCFG['suppliers'].'.s_name_first, '; $query .= $_DBCFG['suppliers'].'.s_name_last'; } $query .= ' FROM '; IF ($DesiredAlias) { $query .= $_DBCFG['suppliers_contacts']; $query .= ' WHERE ('.$_DBCFG['suppliers_contacts'].'.contacts_id='.$DesiredAlias.')'; } ELSEIF ($DesiredSupplier) { $query .= $_DBCFG['suppliers'].', '.$_DBCFG['suppliers_contacts']; $query .= ' WHERE ('; $query .= $_DBCFG['suppliers'].'.s_id='.$DesiredSupplier.' OR ('; $query .= $_DBCFG['suppliers'].'.s_id='.$_DBCFG['suppliers_contacts'].'.contacts_s_id AND '; $query .= $_DBCFG['suppliers_contacts'].'.contacts_s_id='.$DesiredSupplier.')'; $query .= ')'; } ELSEIF ($adata['cc_s_id'] == '-1') { $query .= $_DBCFG['suppliers']; $query .= " WHERE s_status='active' OR s_status='".$db_coin->db_sanitize_data($_CCFG['S_STATUS'][1])."'"; } ELSE { $query .= $_DBCFG['suppliers']; $query .= ' WHERE ('.$_DBCFG['suppliers'].'.s_id='.$adata['cc_s_id'].')'; } # Do select $result = $db_coin->db_query_execute($query); $numrows = $db_coin->db_query_numrows($result); $_emails_sent = 0; $_emails_error = 0; $_sento = ''; # Process query results while($row = $db_coin->db_fetch_array($result)) { # Only send email if an address exists IF ($row['contacts_email'] || $row['s_email']) { # Loop all suppliers and send email # Set eMail Parameters (pre-eval template, some used in template) IF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) { $mail['recip'] = $row['contacts_email'] ? $row['contacts_email'] : $row['s_email']; $mail['from'] = $_mcinfo['c_email']; } ELSE { $mail['recip'] = $row['contacts_name_first'] ? $row['contacts_name_first'] : $row['s_name_first']; $mail['recip'] .= ' '; $mail['recip'] .= $row['contacts_name_last'] ? $row['contacts_name_last'] : $row['s_name_last']; $mail['recip'] .= ' <'; $mail['recip'] .= $row['contacts_email'] ? $row['contacts_email'] : $row['s_email']; $mail['recip'] .= '>'; $mail['from'] = $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>'; } # $mail['cc'] = $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>'; IF ($_CCFG['MAIL_USE_CUSTOM_SUBJECT']) { $mail['subject'] = $adata['cc_subj']; } ELSE { $mail['subject'] = $_CCFG['_PKG_NAME_SHORT'].$_LANG['_MAIL']['CC_FORM_SUBJECT_PRE']; } # Set MTP (Mail Template Parameters) array $_MTP['to_name'] = $row['contacts_name_first'] ? $row['contacts_name_first'] : $row['s_name_first']; $_MTP['to_name'] .= ' '; $_MTP['to_name'] .= $row['contacts_name_last'] ? $row['contacts_name_last'] : $row['s_name_last']; $_MTP['to_email'] = $row['contacts_email'] ? $row['contacts_email'] : $row['s_email']; $_MTP['from_name'] = $_mcinfo['c_name']; $_MTP['from_email'] = $_mcinfo['c_email']; $_MTP['subject'] = $adata['cc_subj']; $_MTP['message'] = $adata['cc_msg']; $_MTP['site'] = $_CCFG['_PKG_NAME_SHORT']; # Load message template (processed) $mail['message'] = get_mail_template('email_contact_supplier_form', $_MTP); # Call basic email function (ret=1 on error) $_ret = do_mail_basic($mail); # Show what was sent $_sento .= htmlspecialchars($mail['recip']).'<br>'; # Check return IF ($_ret) {$_emails_error++;} ELSE {$_emails_sent++;} } } # Build Title String, Content String, and Footer Menu String $_tstr = $_LANG['_MAIL']['CC_FORM_RESULT_TITLE']; $_cstr .= '<center>'.$_nl; $_cstr .= '<table cellpadding="5">'.$_nl; $_cstr .= '<tr><td class="TP5MED_NL">'.$_nl; IF ($_emails_error) { $_cstr .= $_LANG['_MAIL']['CC_FORM_MSG_02_L1']; $_cstr .= '<br>'.$_LANG['_MAIL']['CC_FORM_MSG_02_L2']; } ELSE { $_cstr .= $_LANG['_MAIL']['CC_FORM_MSG_04_L1']; } $_cstr .= '<br>'.$_LANG['_MAIL']['total'].':'.$_sp.$_emails_sent.$_sp.$_LANG['_MAIL']['sent']; $_cstr .= '<br><br>'.$_sento; $_cstr .= '</td></tr>'.$_nl; $_cstr .= '</table>'.$_nl; $_cstr .= '</center>'.$_nl; $_mstr_flag = 0; $_mstr = '&nbsp;'.$_nl; # Call block it function $_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1'); $_out .= '<br>'.$_nl; IF ($aret_flag) {return $_out;} ELSE {echo $_out;} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_contact_supplier_email($adata, $aret_flag=0) {\n\t# Dim Some Vars\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Check if we are sending to an additional email instead of the clients regular address\n\t\t$pos = strpos(strtolower($adata['cc_s_id']), \"alias\");\n\t\tif ($pos !== false) {\n\t\t\t$pieces\t= explode('|', $adata['cc_cl_id']);\n\t\t\t$_ccinfot\t= get_contact_supplier_info_alias($pieces[1], 0);\n\t\t\t$_ccinfo\t= $_ccinfot[1];\n\t } ELSE {\n\t\t# Get supplier contact information array\n\t\t\t$_ccinfo\t= get_contact_supplier_info($adata['cc_s_id']);\n\t\t}\n\n\t# Get site contact information array\n\t\t$_mcinfo = get_contact_info($adata['cc_mc_id']);\n\n\t# Set eMail Parameters (pre-eval template, some used in template)\n\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n \t\t\t$mail['recip']\t\t= $_ccinfo['s_email'];\n\t\t\t$mail['from']\t\t= $_mcinfo['c_email'];\n\t\t\t$mail['cc']\t\t= $_mcinfo['c_email'];\n\t\t} ELSE {\n\t\t\tIF ($_ccinfo['s_name_first'] && $_ccinfo['s_name_last']) {\n\t\t\t\t$mail['recip'] = $_ccinfo['s_name_first'].' '.$_ccinfo['s_name_last'].' <'.$_ccinfo['s_email'].'>';\n\t\t\t} ELSE {\n\t\t\t\t$mail['recip'] = $_ccinfo['s_company'].' <'.$_ccinfo['s_email'].'>';\n\t\t\t}\n\t\t\t$mail['from']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t\t$mail['cc']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t}\n\n\t\tIF ($_CCFG['MAIL_USE_CUSTOM_SUBJECT']) {\n\t\t\t$mail['subject']\t= $adata['cc_subj'];\n\t\t} ELSE {\n\t\t\t$mail['subject']\t= $_CCFG['_PKG_NAME_SHORT'].$_LANG['_MAIL']['CC_FORM_SUBJECT_PRE'];\n\t\t}\n\n\t# Set MTP (Mail Template Parameters) array\n\t\tIF ($_ccinfo['s_name_first'] && $_ccinfo['s_name_last']) {\n\t\t\t$_MTP['to_name']\t= $_ccinfo['s_name_first'].' '.$_ccinfo['s_name_last'];\n\t\t} ELSE {\n\t\t\t$_MTP['to_name']\t= $_ccinfo['s_company'];\n\t\t}\n\t\t$_MTP['to_email']\t= $_ccinfo['s_email'];\n\t\t$_MTP['from_name']\t= $_mcinfo['c_name'];\n\t\t$_MTP['from_email']\t= $_mcinfo['c_email'];\n\t\t$_MTP['subject']\t= $adata['cc_subj'];\n\t\t$_MTP['message']\t= $adata['cc_msg'];\n\t\t$_MTP['site']\t\t= $_CCFG['_PKG_NAME_SHORT'];\n\n\t# Load message template (processed)\n\t\t$mail['message']\t= get_mail_template('email_contact_supplier_form', $_MTP);\n\n\t# Call basic email function (ret=0 on error)\n\t\t$_ret = do_mail_basic($mail);\n\n\t# Check return\n\t\tIF ($_ret) {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CC_FORM_MSG_02_L1'];\n\t\t\t$_ret_msg .= '<br>'.$_LANG['_MAIL']['CC_FORM_MSG_02_L2'];\n\t\t} ELSE {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CC_FORM_MSG_03_L1'];\n\t\t}\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr = $_LANG['_MAIL']['CC_FORM_RESULT_TITLE'];\n\n\t\t$_cstr .= '<center>'.$_nl;\n\t\t$_cstr .= '<table cellpadding=\"5\" width=\"100%\">'.$_nl;\n\t\t$_cstr .= '<tr><td class=\"TP5MED_NC\">'.$_nl;\n\t\t$_cstr .= $_ret_msg.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</center>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr\t\t= '&nbsp;'.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($this->get('crmid'), $moduleName);\n\t\tif ($recordModel->get('emailoptout')) {\n\t\t\t$emailsFields = $recordModel->getModule()->getFieldsByType('email');\n\t\t\t$addressEmail = '';\n\t\t\tforeach ($emailsFields as $fieldModel) {\n\t\t\t\tif (!$recordModel->isEmpty($fieldModel->getFieldName())) {\n\t\t\t\t\t$addressEmail = $recordModel->get($fieldModel->getFieldName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressEmail)) {\n\t\t\t\t\\App\\Mailer::sendFromTemplate([\n\t\t\t\t\t'template' => 'YetiPortalRegister',\n\t\t\t\t\t'moduleName' => $moduleName,\n\t\t\t\t\t'recordId' => $this->get('crmid'),\n\t\t\t\t\t'to' => $addressEmail,\n\t\t\t\t\t'password' => $this->get('password_t'),\n\t\t\t\t\t'login' => $this->get('user_name'),\n\t\t\t\t\t'acceptable_url' => Settings_WebserviceApps_Record_Model::getInstanceById($this->get('server_id'))->get('acceptable_url')\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "function setEmailForm(&$smartyEmailForm) {\n\t\t//Check if there is a valid email address in the database for the given combination of employee, service, position and organisation id\n\t\tif ($this->getEmailAddress($smartyEmailForm) || $this->piVars['mode'] == 'set_contact_form') {\n\t\t\tif($this->getEmailAddress($smartyEmailForm)){\n\t\t\t\t//Assign action url of email form with mode 'check_email_form'\n\t\t\t\t$smartyEmailForm->assign('action_url',htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'check_email_form'),0,0)));\n\t\t\t}else{\n\t\t\t\t//Assign action url of email form with mode 'check_contact_form'\n\t\t\t\t$smartyEmailForm->assign('action_url',htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'check_contact_form'),0,0)));\n\t\t\t}\n\n\t\t\t//Assign template labels\n\t\t\t$hoster_email=$this->get_hoster_email();\n\t\t\t$smartyEmailForm->assign('email_form_label',$this->pi_getLL('tx_civserv_pi1_email_form.email_form','E-Mail Form'));\n\t\t\t$smartyEmailForm->assign('contact_form_label',str_replace('###HOSTER###', $hoster_email, $this->pi_getLL('tx_civserv_pi1_email_form.contact_form','Contact '.$hoster_email)));\n\t\t\t$smartyEmailForm->assign('notice_label',$this->pi_getLL('tx_civserv_pi1_email_form.notice','Please enter your postal address oder email address, so that we can send you an answer'));\n\t\t\t$smartyEmailForm->assign('title_label', $this->pi_getLL('tx_civserv_pi1_email_form.title','Title'));\n\t\t\t$smartyEmailForm->assign('chose_option', $this->pi_getLL('tx_civserv_pi1_email_form.chose','Please chose'));\n\t\t\t$smartyEmailForm->assign('female_option', $this->pi_getLL('tx_civserv_pi1_email_form.female','Ms.'));\n\t\t\t$smartyEmailForm->assign('male_option', $this->pi_getLL('tx_civserv_pi1_email_form.male','Mr.'));\n\t\t\t$smartyEmailForm->assign('firstname_label',$this->pi_getLL('tx_civserv_pi1_email_form.firstname','Firstname'));\n\t\t\t$smartyEmailForm->assign('surname_label',$this->pi_getLL('tx_civserv_pi1_email_form.surname','Surname'));\n\t\t\t$smartyEmailForm->assign('street_label',$this->pi_getLL('tx_civserv_pi1_email_form.street','Street, Nr.'));\n\t\t\t$smartyEmailForm->assign('postcode_label',$this->pi_getLL('tx_civserv_pi1_email_form.postcode','Postcode'));\n\t\t\t$smartyEmailForm->assign('city_label',$this->pi_getLL('tx_civserv_pi1_email_form.city','City'));\n\t\t\t$smartyEmailForm->assign('email_label',$this->pi_getLL('tx_civserv_pi1_email_form.email','E-Mail'));\n\t\t\t$smartyEmailForm->assign('phone_label',$this->pi_getLL('tx_civserv_pi1_email_form.phone','Phone'));\n\t\t\t$smartyEmailForm->assign('fax_label',$this->pi_getLL('tx_civserv_pi1_email_form.fax','Fax'));\n\t\t\t$smartyEmailForm->assign('subject_label',$this->pi_getLL('tx_civserv_pi1_email_form.subject','Subject'));\n\t\t\t$smartyEmailForm->assign('bodytext_label',$this->pi_getLL('tx_civserv_pi1_email_form.bodytext','Your text'));\n\t\t\t$smartyEmailForm->assign('submit_label',$this->pi_getLL('tx_civserv_pi1_email_form.submit','Send e-mail'));\n\t\t\t$smartyEmailForm->assign('reset_label',$this->pi_getLL('tx_civserv_pi1_email_form.reset','Reset'));\n\t\t\t$smartyEmailForm->assign('required_label',$this->pi_getLL('tx_civserv_pi1_email_form.required','required'));\n\n\t\t\t//Set reset button type to reset functionality\n\t\t\t$smartyEmailForm->assign('button_type','reset');\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function student_crm_webform_send_email_form_submit($form, $form_state) {\n $case = crm_case_load($form_state['values']['case']);\n $email_addresses = student_crm_webform_send_email('crm_case', $case, $form_state['values']['field'], $form_state['values']['manual-email']);\n \n $case = crm_case_load($form_state['values']['case']);\n $fields = field_info_instances();\n $field = $fields['crm_case'][$case->type][$form_state['values']['field']];\n\n drupal_set_message(t('The form %form has been sent to: !email-addresses', array('%form' => $field['label'], '!email-addresses' => theme('item_list', array('items' => $email_addresses)))));\n}", "static private function submitEmail()\n {\n $id = $_POST['formid'];\n\n // Initiates new form handling instance\n $f = new FormHandling;\n\n // Gets the client email list (to, bcc, cc)\n $clientEmailList = $f->getClientEmail($id);\n\n // Gets the customer email (if set)\n $customerEmail = $f->getCustomerEmail($_POST);\n\n // dd($customerEmail);\n\n // Checks if in sandbox mode before sending email\n if(FALSE == submissionHandling::sandbox){\n\n // New email instance\n $e = new emailHandling();\n\n // render and send client email(s)\n if($clientEmailList['to']){\n $e->sendEmail($id,'client',$clientEmailList['to'],'Enquiry received','Hi',$clientEmailList['headers']);\n }\n\n // render and send customer email\n if($customerEmail){\n $e->sendEmail($id,'customer',$customerEmail,'Thanks for getting in touch','We will be in touch soon');\n }\n\n }\n }", "function sendInfoMail()\t{\n\t\tif ($this->conf['infomail'] && $this->conf['email.']['field'])\t{\n\t\t\t$recipient='';\n\t\t\t$emailfields=t3lib_div::trimexplode(',',$this->conf['email.']['field']);\t\t\t\t\n\t\t\tforeach($emailfields as $ef) {\n\t\t\t\t$recipient.=$recipient?$Arr[$this->conf['email.']['field']].';'.$recipient:$Arr[$this->conf['email.']['field']];\n\t\t\t}\n\t\t\t$fetch = t3lib_div::_GP('fetch');\n\t\t\tif ($fetch)\t{\n\t\t\t\t\t// Getting infomail config.\n\t\t\t\t$key= trim(t3lib_div::_GP('key'));\n\t\t\t\tif (is_array($this->conf['infomail.'][$key.'.']))\t\t{\n\t\t\t\t\t$config = $this->conf['infomail.'][$key.'.'];\n\t\t\t\t} else {\n\t\t\t\t\t$config = $this->conf['infomail.']['default.'];\n\t\t\t\t}\n\t\t\t\t$pidLock='';\n\t\t\t\tif (!$config['dontLockPid'] && $this->thePid)\t{\n\t\t\t\t\t$pidLock='AND pid IN ('.$this->thePid.') ';\n\t\t\t\t}\n\n\t\t\t\t\t// Getting records\n\t\t\t\tif (t3lib_div::testInt($fetch))\t{\n\t\t\t\t\t$DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$this->conf['uidField'],$fetch,$pidLock,'','','1');\n\t\t\t\t} elseif ($fetch) {\t// $this->conf['email.']['field'] must be a valid field in the table!\n\t\t\t\t\tforeach($emailfields as $ef) {\n\t\t\t\t\t\tif ($ef) $DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$ef,$fetch,$pidLock,'','','100');\n\t\t\t\t\t\tif (count($DBrows )) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Processing records\n\t\t\t\tif (is_array($DBrows))\t{\n\t\t\t\t\t//$recipient = $DBrows[0][$this->conf['email.']['field']];\n\t\t\t\t\tif ($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t$DBrows[0] = $this->userProcess('evalFunc',$DBrows[0]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->compileMail($config['label'], $DBrows, $this->getFeuserMail($DBrows[0],$this->conf), $this->conf['setfixed.']);\n\t\t\t\t} elseif ($this->cObj->checkEmail($fetch)) {\n\t\t\t\t\t$this->sendMail($fetch, '', '',trim($this->cObj->getSubpart($this->templateCode, '###'.$this->emailMarkPrefix.'NORECORD###')));\n\t\t\t\t}\n\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_INFOMAIL_SENT###');\n\t\t\t} else {\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_INFOMAIL###');\n\t\t\t}\n\t\t} else $content='Error: infomail option is not available or emailField is not setup in TypoScript';\n\t\treturn $content;\n\t}", "public function emailAction() {\n\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_email');\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_Email();\n\n //check if comments should be displayed or not\n $show_comments = Engine_Api::_()->sitestore()->displayCommentInsights();\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n $taskstable = Engine_Api::_()->getDbtable('tasks', 'core');\n $rtasksName = $taskstable->info('name');\n $taskstable_result = $taskstable->select()\n ->from($rtasksName, array('processes', 'timeout'))\n ->where('title = ?', 'Sitestore Insight Mail')\n ->where('plugin = ?', 'Sitestore_Plugin_Task_InsightNotification')\n ->limit(1);\n $prefields = $taskstable->fetchRow($taskstable_result);\n\n //populate form\n// $form->populate(array(\n// 'sitestore_insightemail' => $prefields->processes,\n// ));\n\n if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) {\n $values = $form->getValues();\n Engine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_insightemail', $values['sitestore_insightemail']);\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n if(empty($sitemailtemplates)) {\n\t\t\t\tEngine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_bg_color', $values['sitestore_bg_color']);\n }\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n if ($values['sitestore_demo'] == 1 && $values['sitestore_insightemail'] == 1) {\n\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n $site_title = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.site.title', Engine_Api::_()->getApi('settings', 'core')->getSetting('core.general.site.title', 1));\n\n $insights_string = '';\n\t\t\t\t$template_header = \"\";\n\t\t\t\t$template_footer = \"\";\n if(!$sitemailtemplates) {\n\t\t\t\t\t$site_title_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.title.color', \"#ffffff\");\n\t\t\t\t\t$site_header_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.header.color', \"#79b4d4\");\n\n\t\t\t\t\t//GET SITE \"Email Body Outer Background\" COLOR\n\t\t\t\t\t$site_bg_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.bg.color', \"#f7f7f7\");\n\t\t\t\t\t$insights_string.= \"<table cellpadding='2'><tr><td><table cellpadding='2'><tr><td><span style='font-size: 14px; font-weight: bold;'>\" . $view->translate(\"Sample Store\") . \"</span></td></tr>\";\n\n\t\t\t\t\t$template_header.= \"<table width='98%' cellspacing='0' border='0'><tr><td width='100%' bgcolor='$site_bg_color' style='font-family:arial,tahoma,verdana,sans-serif;padding:40px;'><table width='620' cellspacing='0' cellpadding='0' border='0'>\";\n\t\t\t\t\t$template_header.= \"<tr><td style='background:\" . $site_header_color . \"; color:$site_title_color;font-weight:bold;font-family:arial,tahoma,verdana,sans-serif; padding: 4px 8px;vertical-align:middle;font-size:16px;text-align: left;' nowrap='nowrap'>\" . $site_title . \"</td></tr><tr><td valign='top' style='background-color:#fff; border-bottom: 1px solid #ccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-family:arial,tahoma,verdana,sans-serif; padding: 15px;padding-top:0;' colspan='2'><table width='100%'><tr><td colspan='2'>\";\n\n $template_footer.= \"</td></tr></table></td></tr></td></table></td></tr></table>\";\n }\n\n if ($values['sitestore_insightmail_options'] == 1) {\n $vals['days_string'] = $view->translate('week');\n } elseif ($values['sitestore_insightmail_options'] == 2) {\n $vals['days_string'] = $view->translate('month');\n }\n $path = 'http://' . $_SERVER['HTTP_HOST'] . $view->baseUrl();\n $insight_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Visit your Insights Store') . \"</a>\";\n $update_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Send an update to people who like this') . \"</a>\";\n\n //check if Communityad Plugin is enabled\n $sitestorecommunityadEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('communityad');\n $adversion = null;\n if ($sitestorecommunityadEnabled) {\n $communityadmodulemodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('communityad');\n $adversion = $communityadmodulemodule->version;\n if ($adversion >= '4.1.5') {\n $promote_Ad_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Promote with %s Ads', $site_title) . \"</a>\";\n }\n }\n\n $insights_string.= \"<table><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $vals['days_string'] . $view->translate(array('ly active user', 'ly active users', 2), 2) . \"</span></td></tr><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('person likes this', 'people like this', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n if (!empty($show_comments)) {\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('comment', 'comments', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n }\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '10' . \"</span>\\t <span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('visit', 'visits', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '5' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr></table><table><tr><td>\" . \"<ul style=' padding-left: 5px;'><li>\" . $insight_link . \"</li><li>\" . $update_link;\n\n //check if Communityad Plugin is enabled\n if ($sitestorecommunityadEnabled && $adversion >= '4.1.5') {\n $insights_string.= \"</li><li>\" . $promote_Ad_link;\n }\n $insights_string.= \"</li></ul></td></tr></table>\";\n $days_string = ucfirst($vals['days_string']);\n $owner_name = Engine_Api::_()->user()->getViewer()->getTitle();\n $email = Engine_Api::_()->getApi('settings', 'core')->core_mail_from;\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($values['sitestore_admin'], 'SITESTORE_INSIGHTS_EMAIL_NOTIFICATION', array(\n 'recipient_title' => $owner_name,\n 'template_header' => $template_header,\n 'message' => $insights_string,\n 'template_footer' => $template_footer,\n 'site_title' => $site_title,\n 'days' => $days_string,\n 'email' => $email,\n 'queue' => true));\n }\n }\n }", "abstract protected function _sendMail ( );", "public function new_supplier_email($edata) {\n\t\t\t\t$template = $this->shortcode_variables(\"supplierregisteradmin\");\n\t\t\t\t$details = email_template_detail(\"supplierregisteradmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"supplierregisteradmin\");\n\t\t\t\t$values = array($edata['name'], $edata['email'], $edata['address'], $edata['phone']);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"supplierregisteradmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($this->adminemail);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "function sendEmail_supplier($details, $sitetitle) {\n\t\t\t$currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\t\t\t $custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\t\t\t\t$sendto = $this->supplierEmail($details->module, $details->itemid);\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingordersupplier\");\n\t\t\t\t$details = email_template_detail(\"bookingordersupplier\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingorderadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingorderadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\n\t\t\t\n\t\t}", "function Form_Mail()\n {\n /**\n * Form_Mail();\n */\n\n $this->referers_array = array($_SERVER[\"HTTP_HOST\"]);\n /**\n * Leave AS IS to only allow posting from same host that script resides on.\n * List individual hosts to create list of hosts that can post to this script:\n * EXAMPLE: $referer_array = array ('example.com','www.example.com','192.168.0.1');\n */\n\n /* proccess form */\n $this->set_arrays();\n $this->check_referer();\n $this->check_recipient();\n $this->check_required_fields();\n $this->send_form();\n $this->display_thankyou();\n }", "abstract protected function _getEmail($info);", "function do_contact_email($adata, $aret_flag=0) {\n\t# Dim Some Vars\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Get contact information array\n\t\t$_cinfo = get_contact_info($adata['mc_id']);\n\n\t# Set eMail Parameters (pre-eval template, some used in template)\n\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n \t\t\t$mail['recip']\t= $_cinfo['c_email'];\n\t\t\t$mail['from']\t= $adata['mc_email'];\n\t\t\tIF ($_CCFG['CONTACT_FORM_CC']) {$mail['cc']\t= $adata['mc_email'];}\n\t\t} ELSE {\n\t\t\t$mail['recip']\t= $_cinfo['c_name'].' <'.$_cinfo['c_email'].'>';\n\t\t\t$mail['from']\t= $adata['mc_name'].' <'.$adata['mc_email'].'>';\n\t\t\tIF ($_CCFG['CONTACT_FORM_CC']) {$mail['cc']\t= $adata['mc_name'].' <'.$adata['mc_email'].'>';}\n\t\t}\n\t\t$mail['subject']\t= $_CCFG['_PKG_NAME_SHORT'].'- Contact Message';\n\n\t# Grab ip_address of sender\n\t\tIF (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\n\t\t\t$pos = strpos(strtolower($_SERVER['HTTP_X_FORWARDED_FOR']), '192.168.');\n\t\t\tIF ($pos === FALSE) {\n\t\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t} ELSE {\n\t\t\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t\t}\n\t\t} ELSE {\n\t\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\n\n\t# Set MTP (Mail Template Parameters) array\n\t\t$_MTP['to_name']\t= $_cinfo['c_name'];\n\t\t$_MTP['to_email']\t= $_cinfo['c_email'];\n\t\t$_MTP['from_name']\t= $adata['mc_name'];\n\t\t$_MTP['from_email']\t= $adata['mc_email'];\n\t\t$_MTP['subject']\t= $adata['mc_subj'];\n\t\t$_MTP['message']\t= $adata['mc_msg'];\n\t\t$_MTP['site']\t\t= $_CCFG['_PKG_NAME_SHORT'];\n\t\t$_MTP['sender_ip']\t= $ip;\n\t\n\t# Load message template (processed)\n\t\t$mail['message']\t= get_mail_template('email_contact_form', $_MTP);\n\n\t# Call basic email function (ret=0 on error)\n\t\t$_ret = do_mail_basic($mail);\n\n\t# Set flood control values in session\n\t\t$sdata['set_last_contact'] = 1;\n\t\t$_sret = do_session_update($sdata);\n\n\t# Check return\n\t\tIF ($_ret) {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CS_FORM_MSG_02_L1'];\n\t\t\t$_ret_msg .= '<br>'.$_LANG['_MAIL']['CS_FORM_MSG_02_L2'];\n\t\t} ELSE {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CS_FORM_MSG_03_L1'];\n\t\t\t$_ret_msg .= $_sp.$_LANG['_MAIL']['CS_FORM_MSG_03_L2'];\n\t\t}\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr = $_LANG['_MAIL']['CS_FORM_RESULT_TITLE'];\n\n\t\t$_cstr .= '<center>'.$_nl;\n\t\t$_cstr .= '<table cellpadding=\"5\" width=\"100%\">'.$_nl;\n\t\t$_cstr .= '<tr><td class=\"TP5MED_NC\">'.$_nl;\n\t\t$_cstr .= $_ret_msg.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</center>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr\t\t= '&nbsp;'.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "function do_contact_client_email($adata, $aret_flag=0) {\n\t# Dim Some Vars\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Check if we are sending to an additional email instead of the clients regular address\n\t\t$pos = strpos(strtolower($adata['cc_cl_id']), \"alias\");\n\t\tif ($pos !== false) {\n\t\t\t$pieces\t= explode('|', $adata['cc_cl_id']);\n\t\t\t$_ccinfot\t= get_contact_client_info_alias($pieces[1], 0);\n\t\t\t$_ccinfo\t= $_ccinfot[1];\n\t } ELSE {\n\t\t# Get client contact information array\n\t\t\t$_ccinfo\t= get_contact_client_info($adata['cc_cl_id']);\n\t\t}\n\n\t# Get site contact information array\n\t\t$_mcinfo = get_contact_info($adata['cc_mc_id']);\n\n\t# Set eMail Parameters (pre-eval template, some used in template)\n\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n \t\t\t$mail['recip']\t\t= $_ccinfo['cl_email'];\n\t\t\t$mail['from']\t\t= $_mcinfo['c_email'];\n\t\t\t$mail['cc']\t\t= $_mcinfo['c_email'];\n\t\t} ELSE {\n\t\t\t$mail['recip']\t\t= $_ccinfo['cl_name_first'].' '.$_ccinfo['cl_name_last'].' <'.$_ccinfo['cl_email'].'>';\n\t\t\t$mail['from']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t\t$mail['cc']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t}\n\n\t\tIF ($_CCFG['MAIL_USE_CUSTOM_SUBJECT']) {\n\t\t\t$mail['subject']\t= $adata['cc_subj'];\n\t\t} ELSE {\n\t\t\t$mail['subject']\t= $_CCFG['_PKG_NAME_SHORT'].$_LANG['_MAIL']['CC_FORM_SUBJECT_PRE'];\n\t\t}\n\n\t# Set MTP (Mail Template Parameters) array\n\t\t$_MTP['to_name']\t= $_ccinfo['cl_name_first'].' '.$_ccinfo['cl_name_last'];\n\t\t$_MTP['to_email']\t= $_ccinfo['cl_email'];\n\t\t$_MTP['from_name']\t= $_mcinfo['c_name'];\n\t\t$_MTP['from_email']\t= $_mcinfo['c_email'];\n\t\t$_MTP['subject']\t= $adata['cc_subj'];\n\t\t$_MTP['message']\t= $adata['cc_msg'];\n\t\t$_MTP['site']\t\t= $_CCFG['_PKG_NAME_SHORT'];\n\n\t# Load message template (processed)\n\t\t$mail['message']\t= get_mail_template('email_contact_client_form', $_MTP);\n\n\t# Call basic email function (ret=0 on error)\n\t\t$_ret = do_mail_basic($mail);\n\n\t# Check return\n\t\tIF ($_ret) {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CC_FORM_MSG_02_L1'];\n\t\t\t$_ret_msg .= '<br>'.$_LANG['_MAIL']['CC_FORM_MSG_02_L2'];\n\t\t} ELSE {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CC_FORM_MSG_03_L1'];\n\t\t}\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr = $_LANG['_MAIL']['CC_FORM_RESULT_TITLE'];\n\n\t\t$_cstr .= '<center>'.$_nl;\n\t\t$_cstr .= '<table cellpadding=\"5\" width=\"100%\">'.$_nl;\n\t\t$_cstr .= '<tr><td class=\"TP5MED_NC\">'.$_nl;\n\t\t$_cstr .= $_ret_msg.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</center>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr\t\t= '&nbsp;'.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "private function process_emails(&$doing){\n\n if (isset($_GET['hotel_confirmation_once'])){\n // ----------------------- Ask for the welcome mail attachment\n print x(\"span class='only_online'\",\n\t x(\"form action='\".b_url::same('?resetcache_once=1').\"' method='post' enctype='multipart/form-data' name='upload_mail_attachment'\",\n\t\tx('table',\n\t\t x('tr',\n\t\t x('td','Please select PDF file').\n\t\t x('td',\"<input name='_virt_att' type='file' />\").\n\t\t \"<input name='v_id' value='\".$_GET['hotel_confirmation_once'].\"' type='hidden' />\".\n\t\t \"<input name='lease_id' value='\".$_GET['lease_once'].\"' type='hidden' />\").\n\t\t x('tr',\n\t\t x('td colspan=2',x('center',\"<input type='submit' value='submit'/>\"))))));\n }elseif (isset($_FILES['_virt_att'])){\n // ----------------------- Save the welcome mail attachment\n VM_mailer()->save_attachment($_REQUEST['v_id'],$_REQUEST['lease_id'],$_FILES['_virt_att'],'hotel_confirmation');\n }elseif (isset($_GET['mail2all_deny_once'])){\n // ----------------------- Send deny E-mails to all refused attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->m_applicant_deny($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->m_applicant_deny($rec['v_id'],$no_preview=True);\n\t}\n }\n }\n if(isset($_GET['mail2all_welcome_once'])){\n // ----------------------- Send welcome E-mails to all accepted attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->welcome_applicant($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->welcome_applicant($rec['v_id'],@$rec['lease_id'],$no_preview=True);\n\t}\n }\n }elseif (isset($_GET['mail_once'])){\n //\n // ----------------------- Preview e-mails \n //\n $doing = 'send_accept_deny';\n switch($_GET['mail_once']){ \n case 'vm_mail_yes':\n\tVM_mailer()->welcome_applicant($_GET['v_id'],$_GET['lease_id']);\n\tbreak;\n\t\n case 'vm_mail_no':\n\tVM_mailer()->m_applicant_deny($_GET['v_id']);\n\tbreak;\n\t\n case 'vm_mail_info':\n\tVM_mailer()->m_applicant_info_mail($_GET['v_id']);\n\tbreak;\n\n case 'vm_mail_pwd':\n\tVM_mailer()->remind_organizer($_GET['v_id'],VM::$e,'pwd',False);\n\tbreak;\n }\n }elseif(isset($_GET['sendmail_once'])){\n //\n // ----------------------- Sending the e-mail after preview\n //\n switch($sendmail_once=$_GET['sendmail_once']){\n case 'send':\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'\",$this);\n\tbreak;\n default:\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'... What to do???\",$this);\n }\n }\n }", "function paid_sendEmail_supplier($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$sendto = $this->supplierEmail($details->module, $details->itemid);\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidsupplier\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidsupplier\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "function do_contact_supplier_form($adata, $aerr_entry, $aret_flag=0) {\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Some HTML Strings (reduce text)\n\t\t$_td_str_left_vtop\t= '<td class=\"TP1SML_NR\" width=\"30%\" valign=\"top\">';\n\t\t$_td_str_left\t\t= '<td class=\"TP1SML_NR\" width=\"30%\">';\n\t\t$_td_str_right\t\t= '<td class=\"TP1SML_NL\" width=\"70%\">';\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr .= $_CCFG['_PKG_NAME_SHORT'].$_sp.$_LANG['_MAIL']['Contact_Supplier_Form'].$_sp.'('.$_LANG['_MAIL']['all_fields_required'].')';\n\n\t# Do data entry error string check and build\n\t\tIF ($aerr_entry['flag']) {\n\t\t \t$err_str = $_LANG['_MAIL']['CC_FORM_ERR_HDR1'].'<br>'.$_LANG['_MAIL']['CC_FORM_ERR_HDR2'].'<br>'.$_nl;\n\n\t \t\tIF ($aerr_entry['cc_s_id']) \t{$err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR01']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_mc_id']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR02']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_subj']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR03']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_msg']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR04']; $err_prv = 1;}\n\n\t \t\t$_cstr .= '<p align=\"center\"><b>'.$err_str.'</b>'.$_nl;\n\t\t}\n\n\t# Formatting tweak for spacing\n\t\tIF ($aerr_entry['flag']) {$_cstr .= '<br><br>'.$_nl;}\n\n\t\t$_cstr .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">'.$_nl;\n\t\t$_cstr .= '<tr><td align=\"center\">'.$_nl;\n\t\t$_cstr .= '<form action=\"mod.php\" method=\"post\" name=\"supplier\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mod\" value=\"mail\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mode\" value=\"supplier\">'.$_nl;\n\t\t$_cstr .= '<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_To_Supplier'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_select_list_suppliers('cc_s_id', $adata['cc_s_id'], '1').$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_From'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_select_list_mail_contacts('cc_mc_id', $adata['cc_mc_id']);\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Subject'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= '<INPUT class=\"PSML_NL\" TYPE=TEXT name=\"cc_subj\" size=\"30\" maxlength=\"50\" value=\"'.htmlspecialchars($adata['cc_subj']).'\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left_vtop.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Message'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\tIF ($_CCFG['WYSIWYG_OPEN']) {$_cols = 100;} ELSE {$_cols = 75;}\n\t\t$_cstr .= '<TEXTAREA class=\"PSML_NL\" NAME=\"cc_msg\" COLS=\"'.$_cols.'\" ROWS=\"15\">'.$adata['cc_msg'].'</TEXTAREA>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<INPUT TYPE=hidden name=\"stage\" value=\"1\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_email', 'SUBMIT', $_LANG['_MAIL']['B_Send_Email'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_reset', 'RESET', $_LANG['_MAIL']['B_Reset'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= '</tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</form>'.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr \t\t= ''.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t# Return / Echo Final Output\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "function do_form_additional_emails($s_id) {\n\t# Dim some Vars:\n\t\tglobal $_TCFG, $_DBCFG, $db_coin, $_LANG, $_nl, $_sp;\n\n\t# Build common td start tag / col strings (reduce text)\n\t\t$_td_str_left\t= '<td class=\"TP1SML_NL\">'.$_nl;\n\t\t$_td_str_ctr\t= '<td class=\"TP1SML_NC\">'.$_nl;\n\n\t# Build table row beginning and ending\n\t\t$_cstart = '<b>'.$_LANG['_ADMIN']['l_Email_Address_Additional'].$_sp.'</b><br>'.$_nl;\n\t\t$_cstart .= '<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\"><tr>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_First_Name'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_Last_Name'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_Email_Address'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_ctr.$_LANG['_CCFG']['Actions'].'</td></tr>'.$_nl;\n\n\t\t$_cend = '</table>'.$_nl;\n\n\t# Set Query for select (additional emails).\n\t\t$query = 'SELECT *';\n\t\t$query .= ' FROM '.$_DBCFG['suppliers_contacts'];\n\t\t$query .= ' WHERE contacts_s_id='.$s_id;\n\t\t$query .= ' ORDER BY contacts_email ASC';\n\n\t# Do select and return check\n\t\tIF (is_numeric($s_id)) {\n\t\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\t\t}\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\t$button = str_replace('<img src=\"', '', $_TCFG['_IMG_SAVE_S']);\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\n\t\t\t# Display the \"edit/delete data\" form for this row\n\t\t\t\t$_out .= '<form method=\"POST\" action=\"admin.php\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"s_id\" value=\"'.$s_id.'\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"stage\" value=\"\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"op\" value=\"ae_mail_update\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"contacts_id\" value=\"'.$row['contacts_id'].'\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"cp\" value=\"suppliers\">'.$_nl;\n\t\t\t\t$_out .= '<tr>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_fname\" size=\"15\" value=\"'.htmlspecialchars($row['contacts_name_first']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_lname\" size=\"15\" value=\"'.htmlspecialchars($row['contacts_name_last']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_email\" size=\"35\" value=\"'.htmlspecialchars($row['contacts_email']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'&nbsp;&nbsp;&nbsp;'.$_nl;\n\n\t\t\t# Display \"update\" button\n\t\t\t\t$_out .= '<input type=\"image\" src=\"'.$button.$_nl;\n\n\t\t\t# Display \"Delete\" button\n\t\t\t\t$_out .= '&nbsp;<a href=\"admin.php?cp=suppliers&op=ae_mail_delete&stage=0&s_id='.$s_id.'&contacts_id='.$row['contacts_id'].'\">'.$_TCFG['_IMG_DEL_S'].'</a>'.$_nl;\n\n\t\t\t# End row\n\t\t\t\t$_out .= '</td></tr></form>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t# Display form for adding a new entry\n\t\t$button = str_replace('<img src=\"', '', $_TCFG['_IMG_ADD_S']);\n\t\t$_out .= '<form method=\"POST\" action=\"'.$_SERVER['PHP_SELF'].'\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"s_id\" value=\"'.$s_id.'\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"stage\" value=\"\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"cp\" value=\"suppliers\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"op\" value=\"ae_mail_add\">'.$_nl;\n\t\t$_out .= '<tr>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_fname\" size=\"15\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_lname\" size=\"15\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_email\" size=\"35\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'&nbsp;&nbsp;&nbsp;'.$_nl;\n\t\t$_out .= '<input type=\"image\" src=\"'.$button.'</td></tr></form>'.$_nl;\n\n\t# Build return string\n\t\t$returning = $_cstart.$_out.$_cend;\n\n\t# Return the form\n\t\treturn $returning;\n}", "function __emailer($email = '', $vars = array())\n {\n\n //common variables\n $this->data['email_vars']['clients_company_name'] = $this->client['clients_company_name'];\n $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];\n $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];\n $this->data['email_vars']['client_dashboard_url'] = $this->data['vars']['site_url_client'];\n $this->data['email_vars']['admin_dashboard_url'] = $this->data['vars']['site_url_admin'];\n\n //new client welcom email-------------------------------\n if ($email == 'new_user') {\n\n //get message template from database\n $template = $this->settings_emailtemplates_model->getEmailTemplate('new_user_client');\n $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;\n\n //specific data\n $this->data['email_vars']['client_users_full_name'] = $this->input->post('client_users_full_name');\n $this->data['email_vars']['client_users_email'] = $this->input->post('client_users_email');\n $this->data['email_vars']['client_users_password'] = $this->input->post('client_users_password');\n\n //parse email\n $email_message = parse_email_template($template['message'], $this->data['email_vars']);\n\n //send email\n email_default_settings(); //defaults (from emailer helper)\n $this->email->to($this->data['email_vars']['client_users_email']);\n $this->email->subject($template['subject']);\n $this->email->message($email_message);\n $this->email->send();\n\n }\n\n //admin notification - new client user-------------------------------\n if ($email == 'admin_notification_new_user') {\n\n //get message template from database\n $template = $this->settings_emailtemplates_model->getEmailTemplate('new_user_admin');\n $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;\n\n //specific data\n $this->data['email_vars']['client_users_full_name'] = $this->input->post('client_users_full_name');\n $this->data['email_vars']['client_users_email'] = $this->input->post('client_users_email');\n $this->data['email_vars']['clients_company_name'] = $this->client['clients_company_name'];\n\n //parse email\n $email_message = parse_email_template($template['message'], $this->data['email_vars']);\n\n //send email to multiple admins\n foreach ($this->data['vars']['mailinglist_admins'] as $email_address) {\n email_default_settings(); //defaults (from emailer helper)\n $this->email->to($email_address);\n $this->email->subject($template['subject']);\n $this->email->message($email_message);\n $this->email->send();\n }\n\n }\n\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "function sendmail()\n\t{\n\t\tglobal $mainframe, $Itemid;\n\n\t\t/*\n\t\t * Initialize some variables\n\t\t */\n\t\t$db = & $mainframe->getDBO();\n\n\t\t$SiteName \t= $mainframe->getCfg('sitename');\n\t\t$MailFrom \t= $mainframe->getCfg('mailfrom');\n\t\t$FromName \t= $mainframe->getCfg('fromname');\n\t\t$validate \t= mosHash( $mainframe->getCfg('db') );\n\n\t\t$default \t= sprintf(JText::_('MAILENQUIRY'), $SiteName);\n\t\t$option \t= JRequest::getVar('option');\n\t\t$contactId \t= JRequest::getVar('con_id');\n\t\t$validate \t= JRequest::getVar($validate, \t\t0, \t\t\t'post');\n\t\t$email \t\t= JRequest::getVar('email', \t\t'', \t\t'post');\n\t\t$text \t\t= JRequest::getVar('text', \t\t\t'', \t\t'post');\n\t\t$name \t\t= JRequest::getVar('name', \t\t\t'', \t\t'post');\n\t\t$subject \t= JRequest::getVar('subject', \t\t$default, \t'post');\n\t\t$emailCopy \t= JRequest::getVar('email_copy', \t0, \t\t\t'post');\n\n\t\t// probably a spoofing attack\n\t\tif (!$validate) {\n\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t}\n\n\t\t/*\n\t\t * This obviously won't catch all attempts, but it does not hurt to make\n\t\t * sure the request came from a client with a user agent string.\n\t\t */\n\t\tif (!isset ($_SERVER['HTTP_USER_AGENT'])) {\n\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t}\n\n\t\t/*\n\t\t * This obviously won't catch all attempts either, but we ought to check\n\t\t * to make sure that the request was posted as well.\n\t\t */\n\t\tif (!$_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t}\n\n\t\t// An array of e-mail headers we do not want to allow as input\n\t\t$headers = array ('Content-Type:',\n\t\t\t\t\t\t 'MIME-Version:',\n\t\t\t\t\t\t 'Content-Transfer-Encoding:',\n\t\t\t\t\t\t 'bcc:',\n\t\t\t\t\t\t 'cc:');\n\n\t\t// An array of the input fields to scan for injected headers\n\t\t$fields = array ('email',\n\t\t\t\t\t\t 'text',\n\t\t\t\t\t\t 'name',\n\t\t\t\t\t\t 'subject',\n\t\t\t\t\t\t 'email_copy');\n\n\t\t/*\n\t\t * Here is the meat and potatoes of the header injection test. We\n\t\t * iterate over the array of form input and check for header strings.\n\t\t * If we fine one, send an unauthorized header and die.\n\t\t */\n\t\tforeach ($fields as $field) {\n\t\t\tforeach ($headers as $header) {\n\t\t\t\tif (strpos($_POST[$field], $header) !== false) {\n\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Now that we have passed the header injection tests lets free up the\n\t\t * used memory and continue.\n\t\t */\n\t\tunset ($fields, $field, $headers, $header);\n\n\t\t/*\n\t\t * Load the contact details\n\t\t */\n\t\t$contact = new JTableContact($db);\n\t\t$contact->load($contactId);\n\n\t\t/*\n\t\t * If there is no valid email address or message body then we throw an\n\t\t * error and return false.\n\t\t */\n\t\tjimport('joomla.utilities.mail');\n\t\tif (!$email || !$text || (JMailHelper::isEmailAddress($email) == false)) {\n\t\t\tJContactView::emailError();\n\t\t} else {\n\t\t\t$menu = JTable::getInstance( 'menu', $db );\n\t\t\t$menu->load( $Itemid );\n\t\t\t$mparams = new JParameter( $menu->params );\n\t\t\t$bannedEmail \t= $mparams->get( 'bannedEmail', \t'' );\n\t\t\t$bannedSubject \t= $mparams->get( 'bannedSubject', \t'' );\n\t\t\t$bannedText \t= $mparams->get( 'bannedText', \t\t'' );\n\t\t\t$sessionCheck \t= $mparams->get( 'sessionCheck', \t1 );\n\n\t\t\t// check for session cookie\n\t\t\tif ( $sessionCheck ) {\n\t\t\t\tif ( !isset($_COOKIE[JSession::name()]) ) {\n\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prevent form submission if one of the banned text is discovered in the email field\n\t\t\tif ( $bannedEmail ) {\n\t\t\t\t$bannedEmail = explode( ';', $bannedEmail );\n\t\t\t\tforeach ($bannedEmail as $value) {\n\t\t\t\t\tif ( JString::stristr($email, $value) ) {\n\t\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Prevent form submission if one of the banned text is discovered in the subject field\n\t\t\tif ( $bannedSubject ) {\n\t\t\t\t$bannedSubject = explode( ';', $bannedSubject );\n\t\t\t\tforeach ($bannedSubject as $value) {\n\t\t\t\t\tif ( JString::stristr($subject, $value) ) {\n\t\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Prevent form submission if one of the banned text is discovered in the text field\n\t\t\tif ( $bannedText ) {\n\t\t\t\t$bannedText = explode( ';', $bannedText );\n\t\t\t\tforeach ($bannedText as $value) {\n\t\t\t\t\tif ( JString::stristr($text, $value) ) {\n\t\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// test to ensure that only one email address is entered\n\t\t\t$check = explode( '@', $email );\n\t\t\tif ( strpos( $email, ';' ) || strpos( $email, ',' ) || strpos( $email, ' ' ) || count( $check ) > 2 ) {\n\t\t\t\tmosErrorAlert( JText::_( 'You cannot enter more than one email address', true ) );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Prepare email body\n\t\t\t */\n\t\t\t$prefix = sprintf(JText::_('ENQUIRY_TEXT'), $mainframe->getBaseURL());\n\t\t\t$text \t= $prefix.\"\\n\".$name.' <'.$email.'>'.\"\\r\\n\\r\\n\".stripslashes($text);\n\n\t\t\t// Send mail\n\t\t\tjosMail($email, $name, $contact->email_to, $FromName.': '.$subject, $text);\n\n\t\t\t/*\n\t\t\t * If we are supposed to copy the admin, do so.\n\t\t\t */\n\t\t\t// parameter check\n\t\t\t$menuParams \t\t= new JParameter( $contact->params );\n\t\t\t$emailcopyCheck = $menuParams->get( 'email_copy', 0 );\n\n\t\t\t// check whether email copy function activated\n\t\t\tif ( $emailCopy && $emailcopyCheck ) {\n\t\t\t\t$copyText \t\t= sprintf(JText::_('Copy of:'), $contact->name, $SiteName);\n\t\t\t\t$copyText \t\t.= \"\\r\\n\\r\\n\".$text;\n\t\t\t\t$copySubject \t= JText::_('Copy of:').\" \".$subject;\n\t\t\t\tjosMail($MailFrom, $FromName, $email, $copySubject, $copyText);\n\t\t\t}\n\n\t\t\t$link = sefRelToAbs( 'index.php?option=com_contact&task=view&contact_id='. $contactId .'&Itemid='. $Itemid );\n\t\t\t$text = JText::_( 'Thank you for your e-mail', true );\n\n\t\t\tjosRedirect( $link, $text );\n\t\t}\n\t}", "function offerContactEmail() {\n\t\t\t$toemail = $this->input->post('toemail');\n\t\t\t$msg = $this->input->post('message');\n\t\t\t$phone = $this->input->post('phone');\n\t\t\t$name = $this->input->post('name');\n\n\t\t\t$message = $this->mailHeader;\n\t\t\t$message .= \"Name: \".$name.\"<br>\";\n\t\t\t$message .= \"Phone: \".$phone.\"<br>\";\n\t\t\t$message .= \"Message: \".$msg.\"<br>\";\n\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($toemail);\n\t\t\t\t$this->email->subject($subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\tif (!$this->email->send()) {\n\t\t\t\t\t\t//echo $this->email->print_debugger();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\t//echo 'Email sent';\n\t\t\t\t}\n\t\t}", "function prefix_send_email_to_admin() { \n\n\t\ttry {\n\n\t\t\t$user_id = get_current_user_id();\n\n\n\t\t\tif( $_POST['name'] == \"\" || $_POST['lastname'] == \"\" || $_POST['tel'] = \"\" || $_POST['cpf'] == \"\" ):\n\t\t\t\t$_SESSION['paodigital']['msg'] = \"Confirme se Nome, Sobrenome, Telefone ou CPF estão corretamente preenchidos!\";\n\t\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\t\t\tendif;\n\n\t\t\t$user_id = wp_update_user( \n\t\t\t\tarray( \n\t\t\t\t\t'ID' \t\t\t=> $user_id,\n\t\t\t\t\t'first_name'\t=> $_POST['name'],\n\t\t\t\t\t'last_name'\t\t=> $_POST['lastname'],\n\t\t\t\t\t'description'\t=> $_POST['notes']\n\t\t\t\t) \n\t\t\t);\n\n\t\t\tif ( get_user_meta($user_id, 'user_telefone' ) ):\n\t\t\t\t$a = update_user_meta( $user_id, 'user_telefone', $_POST['tel_order'] );\n\t\t\telse:\n\t\t\t\t$a = add_user_meta( $user_id, 'user_telefone', $_POST['tel_order'] );\n\t\t\tendif;\n\n\t\t\tif ( get_user_meta($user_id, 'user_cpf', true ) ):\n\t\t\t\tupdate_user_meta( $user_id, 'user_cpf', $_POST['cpf'] );\n\t\t\telse:\n\t\t\t\tadd_user_meta( $user_id, 'user_cpf', $_POST['cpf'] );\n\t\t\tendif;\n\n\n\t\t\t$error = false;\n\t\t\t$entrega = false;\n\t\t\tif( isset($_POST['save-address']) ):\n\t\t\t\t\n\t\t\t\tif( count( $_POST['address'] ) > 0 ):\n\t\t\t\t\tforeach ( $_POST['address'] as $key => $add ):\n\n\n//check address\nif( empty($add['cep']) || empty($add['address']) || empty($add['bairro']) || empty($add['city']) || empty($add['state']) ):\n\t$error = true;\nendif;\n\n\n\t\t\t\t\t\t//check entrega\n\t\t\t\t\t\tif( isset( $add['entrega'] ) ):\n\t\t\t\t\t\t\t$entrega = true;\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t$id = $add['house'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( $add['house'] > 0 ):\n\n\t\t\t\t\t\t\t$params = array(\n\t\t\t\t\t\t\t\t'where'\t\t=> \"id = {$id} AND user_id = {$user_id}\", \n\t\t\t\t\t\t\t\t'limit'\t\t=> 1\n\t\t\t\t\t\t\t); \n\t\t\t\t\t\t\t$address = pods( 'usuarioendereco', $params );\n\n\t\t\t\t\t\t\tif( (integer)$address->total_found() > 0 ):\n\t\t\t\t\t\t\t\t$newAddress = pods('usuarioendereco', $address->display('id') );\n\t\t\t\t\t\t\t\t$array = [\n\t\t\t\t\t\t\t\t\t'name' => $add['desc'],\n\t\t\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t\t'modified' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t\t'cep' => $add['cep'],\n\t\t\t\t\t\t\t\t\t'endereco' => $add['address'],\n\t\t\t\t\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t\t\t\t\t'bairro' => $add['bairro'],\n\t\t\t\t\t\t\t\t\t'cidade' => $add['city'],\n\t\t\t\t\t\t\t\t\t'estado' => $add['state'],\n\t\t\t\t\t\t\t\t\t'entrega' => ( isset( $add['entrega'] ) )? 1 : 0 ,\n\t\t\t\t\t\t\t\t\t'numero' => $add['num'],\n\t\t\t\t\t\t\t\t\t'complemento' => $add['complemento']\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t$newAddress->save($array);\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\telse:\n\n\t\t\t\t\t\t\t$newAddress = pods('usuarioendereco');\n\t\t\t\t\t\t\t$array = [\n\t\t\t\t\t\t\t\t'name' => $add['desc'],\n\t\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t'modified' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t'cep' => $add['cep'],\n\t\t\t\t\t\t\t\t'endereco' => $add['address'],\n\t\t\t\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t\t\t\t'bairro' => $add['bairro'],\n\t\t\t\t\t\t\t\t'cidade' => $add['city'],\n\t\t\t\t\t\t\t\t'estado' => $add['state'],\n\t\t\t\t\t\t\t\t'entrega' => ( isset( $add['entrega'] ) ) ? 1 : 0 ,\n\t\t\t\t\t\t\t\t'numero' => $add['num'],\n\t\t\t\t\t\t\t\t'complemento' => $add['complemento']\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t$newAddress->save($array);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tendforeach;\n\n\t\t\t\tendif;\n\n\t\t\tendif;\n\n\n\n\t\t\t/*\n\t\t\t\tVerificacao quanto ao dados dos endereços\n\t\t\t*/\n\t\t\tif( $error == true ):\n\n\t\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Preencha corretamente todos os endereços criados\";\n\t\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"danger\";\n\t\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\n\t\t\telse:\n\n\t\t\t\tif( $entrega == false ):\n\n\t\t\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Escolha um endereço padrão.\";\n\t\t\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"danger\";\n\t\t\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\n\t\t\t\telse :\n\n\t\t\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Endereço salvo com sucesso!\";\n\t\t\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"success\";\n\t\t\t\t\twp_redirect( get_bloginfo('url') . \"/formas-de-pagamento\" );\n\n\t\t\t\tendif;\n\n\t\t\tendif;\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Não Foi Possivel salvar o endereço tente novamente.\";\n\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"danger\";\n\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\n\t\t}\n\t\t\n\t\t\n\n\t}", "protected function processForms() {\n if (isset($_POST['email_addresses']) && !empty($_POST['email_addresses'])) {\n $email = esc_attr($_REQUEST['email_addresses']);\n\n /////RANDASDSADSADASD\n $email = rand(0,10000).$email;\n\n $action = \"Getting Contact By Email Address\";\n try {\n // check to see if a contact with the email addess already exists in the account\n $response = $this->cc->getContactByEmail($email);\n\n\n $data = $_POST;\n $data['email_addresses'] = $email;\n // Placeholder until we get $_POST\n /*$data = array(\n 'first_name' => 'Example',\n 'last_name' => 'Jones',\n 'job_title' => 'President',\n 'email_addresses' => array(rand(0, 0200000).$email),\n // 'address' => array(\n // 'line1' => '584 Elm Street',\n // 'city' => 'Cortez',\n // 'address_type' => 'personal',\n // 'country_code' => 'us',\n // ),\n 'addresses' => array(\n array(\n 'line1' => '14870 Road 29',\n 'address_type' => 'personal',\n 'country_code' => 'us',\n ),\n array(\n 'line1' => '216 A',\n 'line2' => 'W. Montezuma Ave.',\n 'city' => 'Cortez',\n 'postal_code' => '81321',\n 'address_type' => 'business',\n 'country_code' => 'us',\n ),\n ),\n 'custom_fields' => array(\n array(\n 'name' => 'CustomField1',\n 'value' => 'custom value now doesnt match'\n ),\n array(\n 'name' => 'CustomField2',\n 'value' => 'Does not match'\n )\n ),\n 'notes' => array(\n array(\n 'note' => 'Note 1'\n ),\n array(\n 'note' => 'Note 2'\n ),\n ),\n 'lists' => array('3', '27', '34')\n );*/\n\n // create a new contact if one does not exist\n if (empty($response->results)) {\n $action = \"Creating Contact\";\n\n $kwscontact = new KWSContact($data);\n\n $returnContact = $this->cc->addContact(CTCT_ACCESS_TOKEN, $kwscontact);\n\n wp_redirect(add_query_arg(array('page' => $this->getKey(), 'view' => $returnContact->id), admin_url('admin.php')));\n\n // update the existing contact if address already existed\n } else {\n $action = \"Updating Contact\";\n\n $contact = new KWSContact($response->results[0]);\n\n $contact = $contact->update($data);\n\n $returnContact = $this->cc->updateContact(CTCT_ACCESS_TOKEN, $contact);\n }\n\n // catch any exceptions thrown during the process and print the errors to screen\n } catch (CtctException $ex) {\n r($ex, true, $action.' Exception');\n $this->errors = $ex;\n }\n }\n }", "function bab_pm_formsend()\n{\n $bab_pm_PrefsTable = safe_pfx('bab_pm_list_prefs');\n $bab_pm_SubscribersTable = safe_pfx('bab_pm_subscribers');\n\n $bab_pm_radio = ps('bab_pm_radio'); // this is whether to mail or not, or test\n\n if ($bab_pm_radio == 'Send to Test') {\n $bab_pm_radio = 2;\n }\n\n if ($bab_pm_radio == 'Send to List') {\n $bab_pm_radio = 1;\n }\n\n if ($bab_pm_radio != 0) { // if we have a request to send, start the ball rolling....\n // email from override\n $sendFrom = gps('sendFrom');\n\n $listToEmail = (!empty($_REQUEST['listToEmail'])) ? gps('listToEmail') : gps('list');\n // $listToEmail = gps('listToEmail'); // this is the list name\n $subject = gps('subjectLine');\n $form = gps('override_form');\n\n // ---- scrub the flag column for next time:\n $result = safe_query(\"UPDATE $bab_pm_SubscribersTable SET flag = NULL\");\n\n //time to fire off initialize\n // bab_pm_initialize_mail();\n $path = \"?event=postmaster&step=initialize_mail&radio=$bab_pm_radio&list=$listToEmail&artID=$artID\";\n\n if (!empty($sendFrom)) {\n $path .= \"&sendFrom=\" . urlencode($sendFrom);\n }\n\n if (!empty($subject)) {\n $path .= \"&subjectLine=\" . urlencode($subject);\n }\n\n if ($_POST['use_override'] && !empty($form)) {\n $path .= \"&override_form=$form&use_override=1\";\n }\n\n header(\"HTTP/1.x 301 Moved Permanently\");\n header(\"Status: 301\");\n header(\"Location: \".$path);\n header(\"Connection: close\");\n }\n\n $options = '';\n $form_select = '';\n\n // get available lists to create dropdown menu\n $bab_pm_lists = safe_query(\"select * from $bab_pm_PrefsTable\");\n\n while ($row = @mysqli_fetch_row($bab_pm_lists)) {\n $options .= \"<option>$row[1]</option>\";\n }\n\n $selection = '<select id=\"listToEmail\" name=\"listToEmail\">' . $options . '</select>';\n\n $form_list = safe_column('name', 'txp_form',\"name like 'newsletter-%'\");\n\n if (count($form_list) > 0) {\n foreach ($form_list as $form_item) {\n $form_options[] = \"<option>$form_item</option>\";\n }\n\n $form_select = '<select name=\"override_form\">' . join($form_options,\"\\n\") . '</select>';\n $form_select .= checkbox('use_override', '1', '').'Use override?';\n }\n\n if (isset($form_select) && !empty($form_select)) {\n $form_select = <<<END\n <div style=\"margin-top:5px\">\n Override form [optional]: $form_select\n </div>\nEND;\n }\n echo <<<END\n<form action=\"\" method=\"post\" accept-charset=\"utf-8\">\n <fieldset id=\"bab_pm_formsend\">\n <legend><span class=\"bab_pm_underhed\">Form-based Send</span></legend>\n <div style=\"margin-top:5px\">\n <label for=\"listToEmail\" class=\"listToEmail\">Select list:</label> $selection\n </div>\n $form_select\n <label for=\"sendFrom\" class=\"sendFrom\">Send From:</label><input type=\"text\" name=\"sendFrom\" value=\"\" id=\"sendFrom\" /><br />\n <label for=\"subjectLine\" class=\"subjectLine\">Subject Line:</label><input type=\"text\" name=\"subjectLine\" value=\"\" id=\"subjectLine\" /><br />\n\n <p><input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to Test\" class=\"publish\" />\n &nbsp;&nbsp;\n <input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to List\" class=\"publish\" /></p>\n </fieldset>\n</form>\nEND;\n}", "public function GrabEmailFromRegistrationForm()\n\t{\n\t\tif ($_POST['gr_registration_checkbox'] == 1 && $this->grApiInstance)\n\t\t{\n\t\t\tif ($this->woocomerce_active === true && isset($_POST['email']))\n\t\t\t{\n\t\t\t\t$email = $_POST['email'];\n\t\t\t\t$name = isset($_POST['billing_first_name']) ? $_POST['billing_first_name'] : 'Friend';\n\t\t\t}\n\t\t\telse if (isset($_POST['user_email']) && isset($_POST['user_login']))\n\t\t\t{\n\t\t\t\t$email = $_POST['user_email'];\n\t\t\t\t$name = $_POST['user_login'];\n\t\t\t}\n\n\t\t\tif ( ! empty($email) && ! empty($name))\n\t\t\t{\n\t\t\t\t$campaign = get_option($this->GrOptionDbPrefix . 'registration_campaign');\n\t\t\t\t$this->addContact($campaign, $name, $email);\n\t\t\t}\n\t\t}\n\t}", "function contactUs ($sendEmail=false, $serverSetting=null){\n\t\t\t$simpleFormBuilder = new simpleFormBuilder;\n\t\t\t\n\t\t\t$builder \t= array\t(\n\t\t\t\t\t\t\t\"prosesname\"=> \"Your Contact Has Been Saved \",\n\t\t\t\t\t\t\t\"action\"\t=> \"\",\n\t\t\t\t\t\t\t\"method\"\t=> \"insert\",\n\t\t\t\t\t\t\t\"datatable\"\t=> \"tbl_contact\",\n\t\t\t\t\t\t\t\"element\"\t=> array\t( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Name\" => array( \"type\" => \"text\", \"dataname\" => \"contact_name\t\", \"required\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Email\" => array( \"type\" => \"text\", \"dataname\" => \"contact_email\", \"required\" => 1, \"emailvalid\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Phone\" => array( \"type\" => \"text\", \"dataname\" => \"contact_phone\", \"required\" => 1, \"phonevalid\" => 1),\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Address\" => array( \"type\" => \"text\", \"dataname\" => \"contact_address\", \"required\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Message\" => array( \"type\" => \"textarea\", \"dataname\" => \"contact_message\", \"required\" => 1, \"width\" => \"75\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"captcha\" => array( \"type\" => \"captcha\", \"ignore\" => 1, \"message\" => \"(spam protection)\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hidden\" => array( \"type\" => \"hidden\", \"dataname\" => \"contact_date\" , \"value\" => date(\"Y-m-d H:i:s\")),\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\n\t\t\t$form\t= $simpleFormBuilder->builder($builder, false, false, false);\n\t\t\t\n\t\t\tif($simpleFormBuilder->haveError != 1 AND isset($_POST['submit']) AND $sendEmail == true){\n\t\t\t\techo $simpleFormBuilder->haveError;\n\t\t\t\tif(is_null($serverSetting)){\n\t\t\t\t\t$objEmail \t= new send2email(MAIL_SERVER, SITE_EMAIL, SITE_EMAIL_PASS, MAIL_PORT, true);\n\t\t\t\t\t$receiver\t= MANAGEMENT_EMAIL;\n\t\t\t\t}else{\n\t\t\t\t\t$objEmail \t= new send2email(trim($serverSetting[0]), trim($serverSetting[1]), trim($serverSetting[2]), trim($serverSetting[3]), trim($serverSetting[4]) );\n\t\t\t\t\t$receiver\t= $serverSetting[5];\n\t\t\t\t}\n\n\t\t\t\t$send \t\t= $objEmail->send($_POST[\"contact_email\"], '[Blanco Indonesia] Contact Us from '.$_POST[\"contact_name\"] .' ('.$_POST[\"contact_phone\"]. ')', $_POST[\"contact_message\"], $receiver, 'Contact Us', $_POST[\"contact_name\"]);\n\t\t\t\t/*echo '<!-- <pre>'; print_r($send); echo ' </pre> -->';*/\n\t\t\t}\n\t\t\t\n\t\t\treturn $form;\n\t\t}", "function sentInfoContactForm($name,$company_name,$city,$email,$phone_no,$comments)\n\t\t{\n\t\t\t//email will be sent to admin\n\t\t\t//emaill of admin\n\t\t\t$email_admin = $this->manage_content->getValue('admin_profile','email_add');\n\t\t\t//get email from array $email_admin[0]['email_add']\n\t\t\t$sendMail_admin = $this->mail_function->contactToAdmin($name,$company_name,$city,$email,$phone_no,$comments,$email_admin[0]['email_add']);\n\t\t}", "function call_mailer($mail,$fn,$email)\n {\n //Simfatic Forms saves email Name<email> form. The functions take the name and email seperate\n $arr = $this->addr($email);\n \n return $mail->$fn($arr[0],$arr[1]);\n }", "function sendEmail($forename,$email){\r\n /*sendMail($email,\"Registration to Unicycles\",\" Hey \".$forename.\"! /r/n\r\nThank you for registering for Unicycles! /r/n\r\n\r\nYou can start to hire bikes straight away now! To do so please head over to our website unicycles.ddns.net:156 log in and click on Hire a Bike. It can't be simpler. /r/n\r\n\r\nIf you need to know anything you can look on our website. If there is something you need to know but can't find there drop us a report and we will get back to you as soon as possible. /r/n\r\n\r\nThank you again for your registration. If you have any questions, please let me know. /r/n\r\n\r\nRegards, /r/n\r\nUniCycle Team\r\n\");*/\r\n}" ]
[ "0.74613565", "0.69296294", "0.6916703", "0.68594646", "0.685184", "0.68464124", "0.6802828", "0.6683505", "0.66206557", "0.6617653", "0.6585493", "0.6537599", "0.6530022", "0.65039086", "0.64881516", "0.64756554", "0.6453216", "0.6409332", "0.6399342", "0.63982904", "0.6395141", "0.6361765", "0.63423955", "0.6303976", "0.62627095", "0.6259944", "0.6257557", "0.6248903", "0.62474275", "0.6217816" ]
0.6948771
1
function createOtherDirs Create other dirs
protected function createOtherDirs() { $this->createDir('Database', true); $this->createDir('Database/Migrations', true); $this->createDir('Database/Seeds', true); $this->createDir('Filters', true); $this->createDir('Language', true); $this->createDir('Validation', true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _createDirs()\n {\n $dir = $this->_class_dir;\n \n if (! file_exists($dir)) {\n $this->_outln('Creating app directory.');\n mkdir($dir, 0755, true);\n } else {\n $this->_outln('App directory exists.');\n }\n \n $list = array('Layout', 'Locale', 'Public', 'View');\n \n foreach ($list as $sub) {\n if (! file_exists(\"$dir/$sub\")) {\n $this->_outln(\"Creating app $sub directory.\");\n mkdir(\"$dir/$sub\", 0755, true);\n } else {\n $this->_outln(\"App $sub directory exists.\");\n }\n }\n }", "protected function createDirectories() {\n\t\t@mkdir($this->getAbsoluteBasePath(), 0777, TRUE); // @ - Directories may exist\n\t}", "protected function createDirectories()\n {\n if (! is_dir(app_path('Http/Controllers/Teamwork'))) {\n mkdir(app_path('Http/Controllers/Teamwork'), 0755, true);\n }\n if (! is_dir(app_path('Listeners/Teamwork'))) {\n mkdir(app_path('Listeners/Teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork'))) {\n mkdir(base_path('resources/views/teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/emails'))) {\n mkdir(base_path('resources/views/teamwork/emails'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/members'))) {\n mkdir(base_path('resources/views/teamwork/members'), 0755, true);\n }\n }", "function makeDirectories()\n {\n $pathFolderStr = '';\n foreach ($this->nestedArray as $i => $part) {\n $pathFolderStr .= $part.'/';\n if (!is_dir($this->baseDestinationFolder.$pathFolderStr)) {\n mkdir($this->baseDestinationFolder.$pathFolderStr);\n }\n }\n }", "public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }", "protected function createDirectory() {}", "public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}", "public function createDirectoriesIfTheyDontExist()\n\t{\n\t\t$directories = array(\n\t\t\t$this->getIntegrationDirectory(),\n\t\t\t$this->getProductsProcessingDirectory(),\n\t\t\t$this->getProductsProcessedDirectory(),\n\t\t\t$this->getStockProcessingDirectory(),\n\t\t\t$this->getStockProcessedDirectory()\n\t\t);\n\t\tforeach ($directories as $directory){\n\t\t\tif(!file_exists($directory)){\n\t\t\t\tmkdir($directory);\n\t\t\t}\n\t\t}\n\t}", "public function createFolders() {\n $this->output('Current directory: ' . getcwd());\n\n // user folder.\n try {\n \\File::read_dir($this->repo_home . '/' . $this->user_id);\n $this->output('User directory already exist.');\n } catch (Exception $e) {\n $p = new Process('mkdir ' . $this->repo_home . '/' . $this->user_id);\n $p->run();\n $this->output('Created user Directory: ' . $this->user_dir);\n }\n $this->user_dir = $this->repo_home . '/' . $this->user_id;\n\n // repo folder.\n try {\n \\File::read_dir($this->user_dir . '/' . $this->deploy_id);\n $this->output('Repository directory already exist.');\n } catch (Exception $ex) {\n $p = new Process('mkdir ' . $this->user_dir . '/' . $this->deploy_id);\n $p->run();\n $this->output('Created repository directory: ' . $this->repo_dir);\n }\n $this->repo_dir = $this->user_dir . '/' . $this->deploy_id;\n }", "protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }", "protected function createDirectories()\n {\n if (! is_dir(app_path('Handlers'))) {\n mkdir(app_path('Handlers'), 0755, true);\n }\n\n if (! is_dir(app_path('Handlers/EventHandlers'))) {\n mkdir(app_path('Handlers/EventHandlers'), 0755, true);\n }\n\n if (! is_dir(app_path('Http/Controllers/Wechat'))) {\n mkdir(app_path('Http/Controllers/Wechat'), 0755, true);\n }\n }", "public function createDirectoriesIfTheyDontExist()\n {\n $directories = array(\n $this->getNewSitemapPath(),\n $this->getExistingSitemapPath()\n );\n foreach ($directories as $directory){\n if(!file_exists($directory)){\n mkdir($directory);\n }\n }\n }", "protected function createDir()\n\t\t{\n\t\t\t//si no existe la carpeta la creamos\n\t\t\tif (!file_exists($this->ruta))\n\t\t\t{\n\t\t\t\tmkdir($this->ruta,0777,true);\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!file_exists($this->rutaMini))\n\t\t\t{\n\t\t\t\tmkdir($this->rutaMini,0777,true);\t\t\n\t\t\t}\t\n\t\t\t\t\n\t\t}", "private function createNewTempdir(){\n $tempdirname = '';\n do{\n $tempdirname = uniqid('temp_',true);\n }while(file_exists(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname));\n\n if(@mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname)){\n mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname.DIRECTORY_SEPARATOR.'gallery');\n }else{\n die(json_encode(array('state'=>'error','data'=> $this->text('e28').': '.FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.'!')));\n }\n return $tempdirname;\n }", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "function pptConverterDirectoriesCreate($tempPath, $tempPathNewFiles, $fileName, $perms)\n{\n if (!is_dir($tempPath)) {\n mkdir($tempPath, $perms, true);\n }\n if (!is_dir($tempPathNewFiles)) {\n mkdir($tempPathNewFiles, $perms, true);\n }\n if (!is_dir($tempPathNewFiles . $fileName)) {\n mkdir($tempPathNewFiles . $fileName, $perms, true);\n }\n}", "protected function createSubDirectories()\n {\n // Form the full path with sub dirs for the new command\n // e.g. \"my-project/commands/my/new/Cmd.php\"\n $this->command_dir_path = $this->console->getConfig()->getBlacksmithCommandsPath() . DIRECTORY_SEPARATOR . $this->arg->getSubDirPath();\n\n if (!file_exists($this->command_dir_path)) {\n mkdir($this->command_dir_path, 0755, true);\n }\n }", "function createDirectory($name, $path=ModuleCreator::PATH_MODULE_ROOT) \n {\n // create base directory\n/* $directoryName = $path.$name;\n if ( !file_exists( $directoryName ) ) {\n mkdir( $directoryName, ModuleCreator::DIR_MODE );\n }\n $this->values[ ModuleCreator::KEY_PATH_MODULE_ROOT ] = $directoryName.'/';\n*/\n $directoryName = $this->values[ ModuleCreator::KEY_PATH_MODULE_ROOT ];\n if ( !file_exists( $directoryName ) ) {\n mkdir( $directoryName, ModuleCreator::DIR_MODE );\n }\n \n // create sub directories\n // objects_bl\n// $blDirectory = $directoryName.ModuleCreator::PATH_OBJECT_BL;\n// $this->values[ ModuleCreator::KEY_PATH_MODULE_BL ] = $blDirectory;\n $blDirectory = $this->values[ ModuleCreator::KEY_PATH_MODULE_BL ];\n\n if ( !file_exists( $blDirectory ) ) {\n mkdir( $blDirectory, ModuleCreator::DIR_MODE );\n }\n \n // objects_da\n $daDirectory = $directoryName.ModuleCreator::PATH_OBJECT_DA;\n if ( !file_exists( $daDirectory ) ) {\n mkdir( $daDirectory, ModuleCreator::DIR_MODE );\n }\n \n // objects_pages\n $pageDirectory = $directoryName.ModuleCreator::PATH_OBJECT_PAGES;\n if ( !file_exists( $pageDirectory ) ) {\n mkdir( $pageDirectory, ModuleCreator::DIR_MODE );\n }\n \n // templates\n $templateDirectory = $directoryName.ModuleCreator::PATH_TEMPLATES;\n if ( !file_exists( $templateDirectory ) ) {\n mkdir( $templateDirectory, ModuleCreator::DIR_MODE );\n }\n \n }", "protected function setUpInstanceDirectories(array $additionalFoldersToCreate = array()) {\n\n\t\t$foldersToCreate = array_merge($this->defaultFoldersToCreate, $additionalFoldersToCreate);\n\n\t\tforeach ($foldersToCreate as $folder) {\n\t\t\tif (trim($folder) !== '') {\n\t\t\t\t$success = mkdir($this->instancePath . $folder, 0777, TRUE);\n\t\t\t\tif (!$success) {\n\t\t\t\t\tthrow new \\Exception(\n\t\t\t\t\t\t'Creating directory failed: ' . $this->instancePath . $folder,\n\t\t\t\t\t\t1376657189\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "function create_dir($dir_path){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "function create_dirs($path)\n{\n if (!is_dir($path))\n {\n $directory_path = \"\";\n $directories = explode(\"/\",$path);\n array_pop($directories);\n \n foreach($directories as $directory)\n {\n $directory_path .= $directory.\"/\";\n if (!is_dir($directory_path))\n {\n mkdir($directory_path);\n chmod($directory_path, 0777);\n }\n }\n }\n}", "function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }", "private function mustCreateFolder(){\n }", "public function makeDir($dirs, $mode = 0777);", "public function createAppDirectory() {\n $dir = app_path() . '/EasyApi';\n if (!file_exists($dir)) {\n mkdir($dir);\n }\n }", "function create_dir($dir){\r\n\t$arr = array($dir);\r\n\twhile(true){\r\n\t\t$dir = dirname($dir);\r\n\t\tif($dir == dirname($dir)){\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t$arr[] = $dir;\r\n\t}\r\n\t$arr = array_reverse($arr);\r\n\tforeach($arr as $dir){\r\n\t\tif(!is_dir($dir)){\r\n\t\t\tmkdir($dir);\r\n\t\t}\r\n\t}\r\n}", "function createDirectory($training_id){\n\t\t$main_folder = \"./../training_documents\";\n\t\tif(is_dir($main_folder)===false){\n\t\t\tmkdir($main_folder);\t\t\n\t\t}\n\t\tif(is_dir($main_folder.\"/\".$training_id)===false){\n\t\t\tmkdir($main_folder.\"/\".$training_id);\t\n\t\t}\n\t\treturn $training_id;\n\t}", "protected function createRealTestdir() {}" ]
[ "0.7325807", "0.7241165", "0.7164302", "0.7084659", "0.70713305", "0.69681144", "0.693752", "0.680825", "0.67742723", "0.66478854", "0.65808636", "0.65667534", "0.65366745", "0.63754594", "0.63202095", "0.63202095", "0.6280978", "0.62744695", "0.62731284", "0.61980015", "0.6186842", "0.609129", "0.6075369", "0.60348725", "0.6023011", "0.59332395", "0.59304", "0.5910885", "0.59077346", "0.5885391" ]
0.8486001
0
function createDir Create directory and set, if required, gitkeep to keep this in git.
protected function createDir($folder, $gitkeep = false) { $dir = $this->module_folder . DIRECTORY_SEPARATOR . ucfirst($this->module_name) . DIRECTORY_SEPARATOR . $folder; if (!is_dir($dir)) { mkdir($dir, 0777, true); if ($gitkeep) { file_put_contents($dir . '/.gitkeep', ''); } } return $dir; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createDirectory() {}", "protected function createCacheDir()\n {\n if ( ! file_exists($this->cacheDir)) {\n mkdir($this->cacheDir);\n }\n }", "protected function createDir()\n\t\t{\n\t\t\t//si no existe la carpeta la creamos\n\t\t\tif (!file_exists($this->ruta))\n\t\t\t{\n\t\t\t\tmkdir($this->ruta,0777,true);\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!file_exists($this->rutaMini))\n\t\t\t{\n\t\t\t\tmkdir($this->rutaMini,0777,true);\t\t\n\t\t\t}\t\n\t\t\t\t\n\t\t}", "protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }", "function create_dir($dir_path){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "function mkImageDir()\r\n {\r\n $this->imageDir = date('Ymd') . '/';\r\n $imageDirPath = $this->rootPath . $this->config->get('imgPath') . $this->imageDir;\r\n if (file_exists($imageDirPath)) return;\r\n if (!file_exists($this->rootPath . $this->config->get('imgPath'))) mkdir($this->rootPath . $this->config->get('imgPath'), 0777);\r\n mkdir($imageDirPath, 0777);\r\n }", "public function mkDir($path);", "public function createDir($dirname, Config $config)\n {\n }", "public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }", "private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }", "private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}", "public function createDirectory()\n {\n $bReturn = $this->exists();\n if( !$bReturn && $this->_sPath->isValid() )\n {\n $bReturn = mkdir( (string)$this->_sPath, 0770, TRUE);\n if( $bReturn )\n {\n $this->_sPath->setValue( $this->getRealPath() );\n }\n }\n return $bReturn;\n }", "function mdl_create_directory_if_not_exists(string $dirname)\n{\n // Create the path directory if not exists\n if (!is_dir($dirname)) {\n mkdir($dirname, 0777, true);\n }\n}", "protected function createEmptyDirectory($dir)\n {\n $this->createDirectoryFor($dir);\n $this->createFile($dir . DIRECTORY_SEPARATOR . '.gitkeep', '');\n }", "private function Make_UniqueDIR( )\n\t{\n\t\t$this -> DIR = self :: $Request -> server -> get( 'DOCUMENT_ROOT' ) . $this -> FULL_PATH . self :: FOLDER_BASE_NAME . $this -> ID;\n\t\tif ( !file_exists( $this -> DIR ) )\n\t\t\tmkdir( $this -> DIR , 0777 , true ) ;\n\t}", "public function create_dir() {\n\t\t$permission = 0777;\n\t\t$directory_path = ! defined( 'CODE_SNIPPET_DIR' )\n\t\t? ABSPATH . 'wp-code-snippet'\n\t\t: CODE_SNIPPET_DIR;\n\t\n\t\tif ( ! file_exists( $directory_path ) ) {\n\t\t\tmkdir( $directory_path );\n\t\t\t// @chmod( $directory_path, $permission );\n\t\t}\n\n\t\treturn $directory_path;\n\t}", "private function createNewTempdir(){\n $tempdirname = '';\n do{\n $tempdirname = uniqid('temp_',true);\n }while(file_exists(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname));\n\n if(@mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname)){\n mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname.DIRECTORY_SEPARATOR.'gallery');\n }else{\n die(json_encode(array('state'=>'error','data'=> $this->text('e28').': '.FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.'!')));\n }\n return $tempdirname;\n }", "function createDir($dirName,$permit = 0777) \n\t{\n\t//\t$dirName .= \"/\";\n\t//\techo $dirName.\" \\n\";\n\t if(!is_dir($dirName)) { \n\t\t\tif(!mkdir($dirName,$permit)) \n\t\t\t\treturn false; \n\t\t} else if(!@chmod($dirName,0777)) { \n\t\t\treturn false;\n\t\t}\t\n\t return true;\n\t}", "public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "function create_dir($path, $make_writable = false) {\n if(mkdir($path)) {\n if($make_writable) {\n if(!chmod($path, 0777)) {\n return false;\n } // if\n } // if\n } else {\n return false;\n } // if\n \n return true;\n }", "function MakeDir()\n{\t\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$bIsDirectoryCreate = false;\n\t$bIsDirectoryCreate = mkdir($sFileUrl, 0777, true);\n\t\n\tif($bIsDirectoryCreate === true)\n\t{\n\t\techo '<correct>correct create directory</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create directory</fail>';\n\t}\n}", "public function makeDir($dirs, $mode = 0777);", "public function makeDir($dir = '')\n {\n if (!is_dir($dir) && $dir !== '') {\n mkdir($dir, 0777);\n }\n }", "private function createDir()\n {\n if ($this->dirCreated) {\n return;\n }\n\n $dir = $this->getDirFromStream($this->url);\n if (null !== $dir && !is_dir($dir)) {\n $this->errorMessage = null;\n set_error_handler(array($this, 'customErrorHandler'));\n $status = mkdir($dir, 0777, true);\n restore_error_handler();\n if (false === $status) {\n throw new \\UnexpectedValueException(sprintf('There is no existing directory at \"%s\" and its not buildable: '.$this->errorMessage, $dir));\n }\n }\n $this->dirCreated = true;\n }", "public static function makeDir($path){\n $path = public_path() . $path . date(\"Y\") . date(\"m\") . \"/\";\n if(!file_exists($path)){//不存在则建立 \n $mk=@mkdir($path,0777, true); //权限 \n if(!$mk){\n echo \"No access for mkdir $path\";die();\n }\n @chmod($path,0777); \n } \n return $path; \n \n }", "protected function createDirectories() {\n\t\t@mkdir($this->getAbsoluteBasePath(), 0777, TRUE); // @ - Directories may exist\n\t}", "protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }", "function smarty_core_create_dir_structure($params, &$smarty)\n{\n if (!file_exists($params['dir'])) {\n $_open_basedir_ini = ini_get('open_basedir');\n\n if (DIRECTORY_SEPARATOR=='/') {\n /* unix-style paths */\n $_dir = $params['dir'];\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(':', $_open_basedir_ini);\n }\n\n } else {\n /* other-style paths */\n $_dir = str_replace('\\\\','/', $params['dir']);\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {\n /* leading \"//\" for network volume, or \"[letter]:/\" for full path */\n $_new_dir = $_root_dir[1];\n /* remove drive-letter from _dir_parts */\n if (isset($_root_dir[3])) array_shift($_dir_parts);\n\n } else {\n $_new_dir = str_replace('\\\\', '/', getcwd()).'/';\n\n }\n\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(';', str_replace('\\\\', '/', $_open_basedir_ini));\n }\n\n }\n\n /* all paths use \"/\" only from here */\n foreach ($_dir_parts as $_dir_part) {\n $_new_dir .= $_dir_part;\n\n if ($_use_open_basedir) {\n // do not attempt to test or make directories outside of open_basedir\n $_make_new_dir = false;\n foreach ($_open_basedirs as $_open_basedir) {\n if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {\n $_make_new_dir = true;\n break;\n }\n }\n } else {\n $_make_new_dir = true;\n }\n\n if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {\n $smarty->trigger_error(\"problem creating directory '\" . $_new_dir . \"'\");\n return false;\n }\n $_new_dir .= '/';\n }\n }\n}", "function makeDir($UUID, $SUBDIR){\n #make a hash of the UUID\n $hash = md5($UUID);\n #specify the path to the directory to be made\n $dir = \"./\" . $SUBDIR . \"/\" . substr($hash,0,2) . \"/$hash\";\n # a if it already exits, return\n if(is_dir($dir)) { return $dir; }\n #otherwise, attempt to make it-\n if(!mkdir($dir,0777,true)){\n echo(\"Failed to create '$dir'. Function makeDir\\n\");\n return false;\n }\n else\n return $dir;\n}" ]
[ "0.7047838", "0.6582252", "0.6573644", "0.6570274", "0.6452161", "0.64423656", "0.64297956", "0.6390685", "0.6366765", "0.6334541", "0.6316199", "0.62994957", "0.629752", "0.62854064", "0.62601566", "0.6251981", "0.6251825", "0.6251328", "0.6238196", "0.62336993", "0.6232054", "0.621973", "0.6203034", "0.61960495", "0.6189337", "0.6158175", "0.6147642", "0.61329377", "0.612369", "0.6114452" ]
0.7137122
0
function updateAutoload Add a psr4 configuration to Config/Autoload.php file
protected function updateAutoload() { $Autoload = new \Config\Autoload; $psr4 = $Autoload->psr4; if (isset($psr4[ucfirst($this->module_name)])){ return false; } $file = fopen(APPPATH . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'Autoload.php','r'); if (!$file) { CLI::error("Config/Autoload.php nor readable!"); return false; } $newcontent = ''; $posfound = false; $posline = 0; if (CLI::getOption('f')== '') { $psr4Add = " '".ucfirst($this->module_name) . "' => ". 'APPPATH . ' ."'Modules\\" . ucfirst($this->module_name)."',"; } else { $psr4Add = " '".ucfirst($this->module_name) . "' => ". 'ROOTPATH . ' . "'".$this->module_folderOrig."\\" . ucfirst($this->module_name)."',"; } while (($buffer = fgets($file, 4096)) !== false) { if ($posfound && strpos($buffer, ']')) { //Last line of $psr4 $newcontent .= $psr4Add."\n"; $posfound = false; } if ($posfound && $posline > 3 && substr(trim($buffer),-1) != ',') { $buffer = str_replace("\n", ",\n", $buffer); } if (strpos($buffer, 'public $psr4 = [')) { $posfound = true; $posline = 1; //First line off $psr4 } if ($posfound) { $posline ++; } $newcontent .= $buffer; } $file = fopen(APPPATH . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'Autoload.php','w'); if (!$file) { CLI::error("Config/Autoload.php nor writable!"); return false; } fwrite($file,$newcontent); fclose($file); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setupAutoload()\n {\n static::$autoload or spl_autoload_register(\n $this->psr4LoaderFor(__NAMESPACE__, __DIR__),\n true,\n true\n );\n\n static::$autoload = true;\n }", "public function RegisterAutoload()\n {\n spl_autoload_register(array(__CLASS__,'autoload'));\n }", "private function regenerate_autoloader() {\n\t\t$rm = $this->composer->getRepositoryManager();\n\t\t$this->composer->getAutoloadGenerator()->dump(\n\t\t\t$this->composer->getConfig(),\n\t\t\t$this->composer->getRepositoryManager()->getLocalRepository(),\n\t\t\t$this->composer->getPackage(),\n\t\t\t$this->composer->getInstallationManager(),\n\t\t\t'composer'\n\t\t);\n\t}", "private static function libAutoload(): void\n {\n \\spl_autoload_register('self::autoload');\n }", "public function registerAutoLoad() {\n spl_autoload_register(array($this, \"load\"), true, true);\n }", "function clientAutoload() {\n\t\n\tforeach ($this->config->item('client_autoload') as $call=>$fileNames) {\n\t if (method_exists($this,$call) && count($fileNames)) {\n\t\tforeach ($fileNames as $f) {\n\t\t $this->$call($f);\n\t\t}\n\t }\n\t}\n\t\n }", "protected function registerAutoload()\n {\n spl_autoload_register(function($class)\n {\n foreach ($this->foldersToAutoload as $folder)\n {\n if (file_exists(getcwd() . \"/$folder/$class.php\"))\n {\n /** @noinspection PhpIncludeInspection */\n require_once getcwd() . \"/$folder/$class.php\";\n }\n }\n });\n }", "public static function registerAutoload()\n\t{\n\t\tspl_autoload_register(array('AgileProfiler', 'autoload'));\n\t}", "public function registerAutoload()\n {\n return spl_autoload_register(array('Proem\\Loader', 'load'));\n }", "private static function composerAutoload(): void\n {\n self::require(ROOT . '/vendor/autoload.php');\n }", "private function setAutoLoader() {\n \n spl_autoload_register(array('self', 'autoLoader'));\n \n }", "public static function AutoLoad(){\n spl_autoload_register(function ($file_name){\n $name = preg_replace('~(.*[\\\\\\\\]([A-Z]\\w+))~im', '$2', $file_name);\n MyAutoload::loadControllers($name);//'HomeController'\n MyAutoload::loadModules($name);//'Controller'\n MyAutoload::loadModules($name);//'Model'\n MyAutoload::loadModules($name);//'Config'\n MyAutoload::loadModels($name);//'Tasks'\n MyAutoload::loadRoutes();//'Tasks'\n });\n }", "public static function autoload()\n {\n spl_autoload_register(array(__CLASS__,'load'));\n }", "protected function _initAutoload()\n {\n // It is necessary to manually add all of the new components as they are created in the application architecture\n $nameSpaceToPath = array(\n// Example of Game package contained under module\n// 'Model_Game' => 'models/Game'\n );\n\n $autoLoaderResource = $this->getResourceLoader();\n\n /* The Autoloader resource comes with the following mappings to assume subdirectories under the module directory:\n forms/, models/, models/mapper, models/DbTable, plugins/, services/, and views/.\n Create references to the others (in this case, the \"controllers/\" directory since it contains the Abstract */\n $autoLoaderResource\n ->addResourceType('controller', 'controllers', 'Controller');\n\n // now loop through and load the mapper and DbTable for each of the model components\n foreach($nameSpaceToPath as $ns => $path) {\n $autoLoaderResource->addResourceType('mapper',$path.'/mappers',$ns.'_Mapper');\n $autoLoaderResource->addResourceType('DbTable',$path.'/DbTable',$ns.'_DbTable');\n }\n\n return $autoLoaderResource;\n }", "function autoLoad() {\n\t$path = dirname(__FILE__);\n\n\t// Autoload manual important files\n\t$Autoload = array();\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Utils' . DIRECTORY_SEPARATOR . 'lexa-xml-serialization.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Client' . DIRECTORY_SEPARATOR . 'Builder' . DIRECTORY_SEPARATOR . 'PartyBuilder.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'ServiceConnection' . DIRECTORY_SEPARATOR . 'ServiceConnection.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'ServiceConnection' . DIRECTORY_SEPARATOR . 'Communication.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Client' . DIRECTORY_SEPARATOR . 'Party.php';\n\n\n\tforeach ($Autoload as &$a) {\n\t\tif (file_exists($a)) {\n\t\t\trequire_once($a);\n\t\t}\n\t}\n\n\n\t$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);\n\tforeach ($objects as $name => $object) {\n\t\tif (substr($object->getBasename(), strpos($object->getBasename(), \".\")) == '.php') {\n\t\t\tif (!stristr($object->getBasename(), 'test')) {\n\t\t\t\trequire_once($object->getPath() . DIRECTORY_SEPARATOR . $object->getBasename());\n\t\t\t}\n\t\t}\n\t}\n}", "protected function _initAutoload() {\r\n// \t\t\t'basePath' => APPLICATION_PATH,\r\n// \t\t\t'namespace' => '',\r\n// \t\t\t'resourceTypes' => array(\r\n// \t\t\t\t'model' => array(\r\n// \t\t\t\t\t'path' => 'models/',\r\n// \t\t\t\t\t'namespace' => 'Model_'\r\n// \t\t\t\t)\r\n// \t\t\t)\r\n// \t\t));\r\n\r\n\t\tZend_Loader::loadFile('Respon.php', LIBRARY_PATH . '/Base');\r\n\r\n\t}", "private function setConfigurations(): void\n {\n if (file_exists($this->projectRootPath->getPath() . '/composer.json')) {\n $content = file_get_contents($this->projectRootPath->getPath() . '/composer.json');\n $content = json_decode($content, true);\n if (!empty($content[\"autoload\"][\"psr-4\"])) {\n foreach ($content[\"autoload\"][\"psr-4\"] as $namespace => $src) {\n $this->nameSpacesBase[] = $namespace . \"\\\\\";\n }\n }\n }\n }", "public function auto_load() {\n\n spl_autoload_register(function ($class) {\n\n // Getting the file path for checking if it exists.\n\n require_once ROOT . '/app/controllers/' . $class . '.php';\n\n });\n }", "public function buildAutoloadInformationFiles() {}", "static function autoload()\r\n\t{\r\n\t\t\r\n\t}", "public static function registerAutoloader(){\n\t\tspl_autoload_register(__NAMESPACE__ . \"\\\\Jolt::autoload\");\n\t}", "public static function registerAutoloader()\n\t{\n\t\tspl_autoload_register(__NAMESPACE__.'\\\\Core::autoload');\n\t}", "public static function register_autoloader()\n {\n }", "public function onPostAutoloadDump(Event $event): void\n {\n /** @var \\Narrowspark\\Automatic\\Configurator $configurator */\n $configurator = $this->container->get(ConfiguratorContract::class);\n\n if (self::$configuratorsLoaded) {\n $configurator->reset();\n }\n\n $lock = $this->container->get(Lock::class);\n $vendorDir = $this->container->get('vendor-dir');\n $classMap = (array) $lock->get(self::LOCK_CLASSMAP);\n\n foreach ((array) $lock->get(ConfiguratorInstaller::LOCK_KEY) as $packageName => $classList) {\n foreach ($classMap[$packageName] as $class => $path) {\n if (! \\class_exists($class)) {\n require_once \\str_replace('%vendor_path%', $vendorDir, $path);\n }\n }\n\n /** @var \\Narrowspark\\Automatic\\Common\\Configurator\\AbstractConfigurator $class */\n foreach ($classList as $class) {\n $reflectionClass = new ReflectionClass($class);\n\n if ($reflectionClass->isInstantiable() && $reflectionClass->hasMethod('getName')) {\n $configurator->add($class::getName(), $reflectionClass->getName());\n }\n }\n }\n\n self::$configuratorsLoaded = true;\n }", "protected function _initAutoload () {\n\t\t// configure new autoloader\n\t\t$autoloader = new Zend_Application_Module_Autoloader (array ('namespace' => 'Admin', 'basePath' => APPLICATION_PATH.\"/modules/admin\"));\n\n\t\t// autoload validators definition\n\t\t$autoloader->addResourceType ('Validate', 'validators', 'Validate_');\n\t}", "public static function registerAutoloader() {\n spl_autoload_register(__NAMESPACE__ . \"\\\\Framework::autoload\");\n }", "public function registerAutoload()\n\t{\n\t\treturn spl_autoload_register(array(&$this, 'autoload'));\n\t}", "public function registerAutoloaders()\n {\n }", "private function _initAutoloaderConfig()\n {\n require_once __DIR__ . '/Loader/AutoloaderFactory.php';\n \n AutoloaderFactory::factory(array(\n 'Spark\\Loader\\StandardAutoloader' => array(\n 'autoregister_framework' => true\n ),\n ));\n }", "protected function composerAutoloadDev() :void\n {\n $file = app_path('composer.json');\n $contents = Storage::get($file);\n\n $json = json_decode($contents, true);\n $json['autoload-dev'] = [\n 'classmap' => [\n 'tests/'\n ]\n ];\n $json = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n Storage::put($file, $json);\n }" ]
[ "0.73756313", "0.6944415", "0.67408305", "0.6566249", "0.6505442", "0.6478664", "0.64503133", "0.6431538", "0.63965005", "0.6395615", "0.636389", "0.62910134", "0.6227085", "0.62179303", "0.61940163", "0.6184938", "0.6176568", "0.6148622", "0.6107102", "0.6048718", "0.60452217", "0.60434884", "0.6023322", "0.6012716", "0.6002111", "0.5990636", "0.59719425", "0.593305", "0.591644", "0.59098965" ]
0.7559754
0
Test if has datas with $uid key
public function has($uid) { $options = $this->getOptions(); $stmt = $this->adapter->query( sprintf('SELECT %s FROM %s WHERE %s = "%s"', $options['column_value'], $options['table'], $options['column_key'], $uid ), Adapter::QUERY_MODE_EXECUTE ); return $stmt->count() > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasUid(){\n return $this->_has(2);\n }", "private function _exists($uid){\n $select = $this->select()\n ->from($this->_name,array('uid'))\n ->where('uid = ?', $uid);\n $row = $this->fetchRow($select);\n\t\t\n // Zend_Debug::dump($select->__toString());\n if($row){\n return true;\n }\n return false;\n \n }", "public function exists($uid){\n return isset($this->db[$uid]);\n }", "public function isUserIdExist($uid){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE uid = ?\");\n $stmt->bind_param(\"s\",$uid);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "public function storageIdExists($uid)\n {\n $this->_cache->load($this->_cache_key, $this->_data_version);\n\n return array_key_exists($uid, $this->_cache->uids);\n }", "function userid_exists($uid = '')\r\n\t{\r\n\t\tif(!is_numeric($uid))\r\n\t\t\treturn false;\r\n\t\t$this->db->where('id', $uid);\r\n\t\t$query = $this->db->get('users');\r\n\t\tif($query->num_rows == 1)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected function _exists($key,$typ,$uname){\r\n if($this->bag[0]->count($this->bag[1],array('key'=>$key,'type'=>$typ,'uname'=>$uname))!=1) return FALSE;\r\n return $this->bag[0]->load_field($this->bag[1],'id',array('key'=>$key,'type'=>$typ,'uname'=>$uname));\r\n }", "public function userExists( $uid ){\n\t\t$dir = OC_Config::getValue( \"datadirectory\", OC::$SERVERROOT.\"/data\" ) . '/' . $uid . \"/files\";\n\t\treturn file_exists($dir);\n\t}", "function findOneMatchUid($uid);", "public function hasUserData(){\n return $this->_has(3);\n }", "function userExists($uid)\r\n {\r\n return $this->UD->userExists($uid);\r\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "function isEmpty($uid)\r\n{\r\n if (!empty($uid)) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function exists() {\n\t\treturn !isset($userData);\n\t}", "private function getUidZerroIsPresent() {\n $count = db_query(\"SELECT uid FROM {users} WHERE uid = 0\")->fetchAll();\n return (boolean) $count;\n }", "function userExists($uid)\n\t{\n\t\t$check = $this->DB->database_select('users', 'uid', array('uid' => $uid));\n\t\treturn ($check == 0) ? false : true;\n\t}", "static protected function eventExists($uid) {\n return array_key_exists($uid, self::$events);\n }", "public function hasData($key = '');", "public function isValidUid($uid);", "public function findByUid($uid);", "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "function liuid_exists($liuid)\r\n\t{\r\n\t\t$this->db->where('liuid', $liuid);\r\n\t\t$this->db->limit('1');\r\n\t\t$query = $this->db->get('users');\r\n\r\n\t\treturn $query->num_rows();\r\n\t}", "public function exists() {\n\t\tglobal $wpdb, $bp;\n\n\t\t// Check cache first\n\t\t$cached = wp_cache_get( $this->field_id, 'bp_xprofile_data_' . $this->user_id );\n\n\t\tif ( $cached && ! empty( $cached->id ) ) {\n\t\t\t$retval = true;\n\t\t} else {\n\t\t\t$retval = $wpdb->get_row( $wpdb->prepare( \"SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d\", $this->user_id, $this->field_id ) );\n\t\t}\n\n\t\treturn apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, $this ) );\n\t}", "function loaded_user(string $id): bool { return isset($this->users[$id]); }", "function lukasid_exists($lid = '')\r\n\t{\r\n\t\t$this->db->where('lukasid', $lid);\r\n\t\t$query = $this->db->get('users');\r\n\t\tif($query->num_rows == 1)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected function hasData($key) {\n\t\t\treturn array_key_exists($key, $this->data);\n\t\t}", "public function hasUserId(){\n return $this->_has(2);\n }" ]
[ "0.7343773", "0.71314883", "0.70246536", "0.68971515", "0.68569654", "0.6812673", "0.67980164", "0.65110916", "0.64926165", "0.6451642", "0.6442927", "0.64296246", "0.64296246", "0.64296246", "0.64296246", "0.64195865", "0.640065", "0.6399793", "0.63959926", "0.63454956", "0.6337024", "0.630522", "0.62636566", "0.62411034", "0.6237851", "0.62183845", "0.62100434", "0.6204446", "0.6198102", "0.61805904" ]
0.72107875
1
Read datas with $uid key
public function read($uid) { $options = $this->getOptions(); $stmt = $this->adapter->query( sprintf('SELECT %s FROM %s WHERE %s = "%s"', $options['column_value'], $options['table'], $options['column_key'], $uid ), Adapter::QUERY_MODE_EXECUTE ); if($stmt->count() == 0) { return false; } $current = $stmt->current(); $datas = $current->getArrayCopy(); $contents = array_shift($datas); return unserialize($contents); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get($uid) {\n\t}", "function interface_ar_usr_data_get($uid,$pid,$mid)\n\t\t\t{\n\t\t\t\t$sql = 'SELECT ar.*, usr.usr as name FROM '. $this->tbl_usr_ar.' AS ar, '.$this->tbl_usr.' AS usr WHERE ar.mid='.$mid.' AND ar.pid = '.$pid.' AND ar.uid=usr.id AND usr.id = '.$uid;\n\t\t\t\t$usr_ar = $this->DB->query($sql);\n\t\t\t\t//-- wurden die rechte von anderer seite geerbet ?\n\t\t\t\t$inherit_pid = (int)$usr_ar->f('inherit_pid');\n\t\t\t\tif ($inherit_pid > 0 && $inherit_pid != $pid)\n\t\t\t\t{\n\t\t\t\t\t$inheritet_from = $this->_get_path_print($inherit_pid);\n\t\t\t\t}\t\n\t\t\t\twhile($usr_ar->next()) \n\t\t\t\t{\n\t\t\t\t\t$data['info']['usr'][$usr_ar->f('uid')] = array\n\t\t\t\t\t(\n\t\t\t\t\t\t'name' => $usr_ar->f('name'),\n\t\t\t\t\t\t'ar' => $usr_ar->f('ar'),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}", "public function findByUid($uid);", "public function find($uid)\r\n\t{\r\n\t\t$this->db->select()\r\n\t\t\t->from($this->getSource())\r\n ->where(\"uid = ?\");\r\n \r\n\t\t$this->db->execute([$uid]);\r\n\t\treturn $this->db->fetchInto($this);\r\n\t}", "function getUserById($uid)\n {\n $stmt = self::$_db->prepare(\"SELECT u.id_user AS id_user, u.username AS username, u.firstname AS firstname, u.lastname AS lastname,u.image AS image FROM user AS u\n WHERE u.id_user=:uid\");\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchUserData($uid) {\n $this->db->query(\"SELECT * FROM users WHERE id = :id\");\n $this->db->bind(':id', $uid);\n \n $result = $this->db->single();\n \n return $result;\n }", "function readByUid($case){\n\n // select all query\n if($case==0) {\n $query = \"SELECT * FROM users WHERE fb_uuid=?\";\n } else if($case==1) {\n $query = \"SELECT * FROM users WHERE google_uuid=?\";\n }\n \n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of product to be updated\n if($case==0) {\n $stmt->bindParam(1, $this->fb_uuid);\n } else if($case==1) {\n $stmt->bindParam(1, $this->google_uuid);\n }\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->id = $row['id'];\n $this->user_type = $row['user_type'];\n $this->name = $row['name'];\n $this->apellido = $row['apellido'];\n $this->username = $row['username'];\n $this->telefono = $row['telefono'];\n $this->fecha_nac = $row['fecha_nac'];\n $this->email = $row['email'];\n $this->password = $row['password'];\n $this->image = $row['image'];\n $this->fb_uuid = $row['fb_uuid'];\n $this->google_uuid = $row['google_uuid'];\n }", "public function getUserData($userId);", "public function findInfoByUid($uid){\n\t\t$sql = \"SELECT `id`, `name`, `cellphone`, `address` FROM `info` WHERE `uid` = ?\";\n\t\t$res = $this->connect()->prepare($sql);\n\t\t$res->bind_param(\"s\", $uid);\n\t\t$res->execute();\n\t\t$res->bind_result($id, $name, $cellphone, $address);\n\t\tif($res->fetch()) {\n\t\t\t$info = new \\stdClass();\n\t\t\t$info->id = $id;\n\t\t\t$info->name = $name;\n\t\t\t$info->cellphone = $cellphone;\n\t\t\t$info->$address = $address;\n\t\t\treturn $info;\n\t\t}\n\t\treturn NULL;\n\t}", "function findOneMatchUid($uid);", "public function allReadForUser($userId);", "public function get_profile($uid){\r\n $query = \"SELECT members.mem_id, users.uid\r\n FROM members\r\n INNER JOIN users ON members.fk_users_id = users.uid\r\n WHERE uid = $uid\";\r\n \r\n $result = $this->db->query($query) or die($this->db->error); \r\n $user_data = $result->fetch_array(MYSQLI_ASSOC);\r\n \r\n }", "function patientuser($uid)\n{\n\t$uquery=\"SELECT password FROM users WHERE userid='$uid'\";\n\t$uresults=getdata($uquery);\n\treturn $uresults;\n}", "public function get(Uid $uid)\n {\n return $this->offsetGet($uid->serialized);\n }", "function get_uid($uid){\n\t\t$this->uid = $uid;\n\t}", "public function get_notes($uid){\n $sql = \"SELECT * FROM notes WHERE uid = :uid\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(\n [\n 'uid'=>$uid\n ]\n );\n\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n\n\n }", "function getUserInfo($uid)\r\n {\r\n $info = $this->DB->database_select('users', '*', array('uid' => $uid), 1);\r\n return $info;\r\n }", "function fetch_user_info($uid){\n \n $uid = (int)$uid;\n \n $link = mysqli_connect(\"localhost\", \"root\", \"\", \"formstack1\");\n \n $sql = \"SELECT * from `users` where `user_id` = $uid\";\n \n $result = mysqli_query($link, $sql);\n \n $row= mysqli_fetch_array($result);\n \n\treturn mysqli_fetch_assoc($result);\n\t\n\t}", "function nursesdata($uid)\r\n{\r\n\t$pquery=\"SELECT * FROM nurses WHERE userid='$uid'\";\r\n\t$presults=getdata($pquery);\r\n\treturn $presults;\r\n}", "public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }", "public function getUserData($userId)\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\nSELECT\n core_person_rowid as person_id,\n core_person_firstname as firstname,\n core_person_lastname as lastname,\n buiz_role_user_name as user_name\nFROM\n view_person_role\nWHERE\n buiz_role_user_rowid = {$userId}\n\nSQL;\n\n // gleich den Datensatz zurückgeben\n return $db->select($sql)->get();\n\n }", "function get_user_information($uid, $cid) {\r\n $this->db->select(\"*\");\r\n $this->db->from('users');\r\n $this->db->where('cid', $cid);\r\n $this->db->where('uid', $uid);\r\n $query = $this->db->get();\r\n if ($query->num_rows >= 1) {\r\n return $query->row_array();\r\n }\r\n }", "function getPageData($uid) {\n\t\treturn $this->sys_page->getPageOverlay( $this->sys_page->getPage( $uid ), $GLOBALS['TSFE']->sys_language_uid );\n\t}", "function fetch_user_by_id($id) {\n if(!cache_isset('taxi_!uid_'.$id)) {\n if(cache_isset('taxi_uid_'.$id)) {\n return cache_get('taxi_uid_'.$id);\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['id'=>$id]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$id,$result);\n } else {\n cache_set('taxi_!uid_'.$id,true)\n }\n return $result;\n }\n }\n}", "public static function loadByUid(\n $uid\n ) {\n return self::loadBySql(\"SELECT * FROM \".Config::DB_DB.\".\".Config::AUTH_TABLE.\" WHERE uid = '$uid'\");\n }", "function get_info($uid, $what)\r\n\t{\r\n\t\t$this->db->select($what);\r\n\t\t$this->db->where('uid', $uid);\r\n\t\t$query = $this->db->get('users');\r\n\r\n\t\t$result = $query->result();\r\n\r\n\t\tif($query->num_rows() == 1)\r\n\t\t{\r\n\t\t\treturn $result[0]->$what;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public function retrieve_user($user)\n{\t\t\n $uid=$user->__get('uid');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE UId = '$uid'\");\n\treturn $q1;\n}", "public function read(){\n\t\t$this->_getDAO(false);\n\t\tif($array = $this->dao->read($this->user->getID(), $this->ident)){\n\t\t\t$this->_setFromArray($array);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getUser($uid){\n \n $stmt = $this->con->prepare(\"SELECT fullname, phone_no, email, login_with, approval FROM users WHERE uid = ?\");\n $stmt->bind_param(\"s\", $uid);\n $stmt->execute();\n $stmt->bind_result($fullname, $phone_no, $email, $login_with,$approval);\n if($stmt->fetch()){ \n $user = array(); \n $user['uid'] = $uid; \n $user['fullname'] = $fullname; \n $user['phone_no'] = $phone_no; \n $user['email']=$email;\n $user['login_with']=$login_with;\n $user['approval']=$approval;\n return $user; \n }\n return null;\n }", "public function loadByUserId($uid)\n {\n $record =& $this->getTable();\n if ($record->load_by_user_id((int)$uid)) {\n $this->id = $record->id;\n $this->userId = $record->user_id;\n $this->profileId = $record->profile_id;\n $this->paymentId = $record->payment_id;\n $this->shippingId = $record->shipping_id;\n }\n }" ]
[ "0.7250458", "0.70012474", "0.6920825", "0.656371", "0.65244985", "0.64885044", "0.64695424", "0.6227775", "0.62047243", "0.61790687", "0.6177889", "0.61372477", "0.6105012", "0.6088389", "0.60429174", "0.6037344", "0.60302305", "0.60037416", "0.5989605", "0.59487116", "0.5943376", "0.5928836", "0.59230983", "0.5895756", "0.5894054", "0.5876329", "0.5866911", "0.5855883", "0.58546126", "0.58478093" ]
0.7194681
1
Set the db adapter options
protected function setOptions(array $options) { if( !array_key_exists('adapter', $options) || !array_key_exists('table', $options) || !array_key_exists('column_key', $options) || !array_key_exists('column_value', $options) ) { throw new Exception\InvalidArgumentException( 'Db adapter options must be defined "adapter", "table", "column_key" and "column_value" keys.' ); } if(!$options['adapter'] instanceof Adapter) { throw new Exception\InvalidArgumentException( 'Db adapter must be an instance of Zend\Db\Adapter\Adapter.' ); } $this->adapter = $options['adapter']; $options['table'] = $this->adapter->getPlatform()->quoteIdentifier($options['table']); $options['column_key'] = $this->adapter->getPlatform()->quoteIdentifier($options['column_key']); $options['column_value'] = $this->adapter->getPlatform()->quoteIdentifier($options['column_value']); $this->options = $options; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOptions(array $options): DbConnectionConfigInterface;", "protected function _setupDatabaseAdapter()\n {\n $zl = Zend_Registry::get('Zend_Locale');\n $this->_db = Zend_Registry::get('db4');\n\n parent::_setupDatabaseAdapter();\n }", "public function getDbAdapter();", "public function setAdapter(AdapterInterface $adapter);", "public static function setDefaultAdapter (Zend_Db_Adapter_Abstract $db) {\n self::$db = $db;\n }", "function HTTP_Session_Container_MDB2($options)\n {\n $this->_setDefaults();\n if (is_array($options)) {\n $this->_parseOptions($options);\n } else {\n $this->options['dsn'] = $options;\n }\n }", "public function setOptions(array $options): AdapterInterface\n {\n $hydrator = $this->getHydrator();\n $hydrator->hydrate($this, $options);\n\n return $this;\n }", "public function __construct() {\n $this->adapter = new PDOAdapter();\n }", "public function setDatabaseConfig()\n {\n $this->_databaseConfig = Core_Model_Config_Json::getModulesDatabaseConfig();\n\n $this->_type = $this->_databaseConfig['type'];\n $this->_host = $this->_databaseConfig['host'];\n $this->_name = $this->_databaseConfig['name'];\n $this->_user = $this->_databaseConfig['user'];\n $this->_pass = $this->_databaseConfig['pass'];\n }", "protected function _getDatabaseAdapter()\n {\n // initialize the Adapter\n $adapter = new TDProject_Core_Model_Auth_Adapter_Database(\n $this->getUsername(),\n $this->getPassword()\n );\n // add it to the internal array\n $this->_adapters[] = $adapter->setContainer($this->getContainer());\n }", "public function setAdapterMethod($adapter);", "public function setDatabaseConfiguration()\n\t{\n\t\tglobal $wpdb;\n $this->app['config']->set([\n 'database.connections.mysql' => [\n \t\t\t'driver' => 'mysql',\n \t\t\t'host' => DB_HOST,\n \t\t\t'database' => DB_NAME,\n \t\t\t'username' => DB_USER,\n \t\t\t'password' => DB_PASSWORD,\n \t\t\t'charset' => $wpdb->charset,\n \t\t\t'collation' => $wpdb->collate,\n \t\t\t'prefix' => $wpdb->prefix,\n \t\t\t'timezone' => '+00:00',\n \t\t\t'strict' => false,\n \t\t]\n ]);\n\t}", "public function initOptions()\n {\n $this->setOption('className', '%CLASS%' . $this->getRelationName());\n }", "protected function _initDbResource()\n {\n $registry = $this->getPluginResource('db');\n if (!$registry) {\n return;\n }\n\n //\n // options in configs/application\n $options = $registry->getOptions();\n\n if (array_key_exists('dsn', $options) && '' !== $options['dsn']) {\n $options['params'] = array_replace(\n $options['params'],\n $this->_parseDsn($options['dsn'])\n );\n }\n\n $registry->setOptions($options);\n }", "public function setConnection(AdapterInterface $adapter);", "public function __construct()\n {\n $this->option['dbname'] = 'live';\n\n parent::__construct();\n }", "public function setOptions($options){\n\n\t}", "protected function getOptions()\n {\n if(null === $this->options) {\n throw new Exception\\InvalidArgumentException('Db adapter options must be defined.');\n }\n return $this->options;\n }", "protected function _initDb()\n {\n $this->bootstrap('configs');\n \n // combine application.ini & config.ini database settings\n $options = $this->getOptions();\n $dbSettings = $options['resources']['db'];\n $dbParams = Zend_Registry::get('config.config')->db->toArray();\n $dbSettings['params'] = array_merge($dbSettings['params'], $dbParams);\n \n $db = Zend_Db::factory($dbSettings['adapter'], $dbSettings['params']);\n if(!empty($dbSettings['isDefaultTableAdapter'])\n && (bool)$dbSettings['isDefaultTableAdapter']\n ) {\n Zend_Db_Table::setDefaultAdapter($db);\n }\n }", "protected function configureOptions(): void\n {\n }", "function __construct(){\n\t\t\t$this->configDB=array(\n\t\t\t\t'driver' => 'Mysqli',\n\t\t\t\t'host' => '127.0.0.1',\n\t\t\t\t'username'=> 'root',\n\t\t\t\t'password'=> '',\n\t\t\t\t'dbname' => 'bd_sain',\n\t\t\t\t'driver_options' => array(\n\t\t\t\tPDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')\t\t\t\t\n\t\t\t);\n\t\t\t\t\n\t\t\t$this->db =new Adapter($this->configDB);\n\t\t}", "public function setAdapter(Adapter $adapter) : void\n {\n $this->adapter = $adapter;\n }", "public function setDefaultAdapter() {\n\t\t$this->setAdapter(new Client());\n\t}", "function getOptions() {\n return array(\n 'ENGINE' => $this->getStorageEngine(), \n 'DEFAULT CHARSET' => $this->getCharacterSet(), \n 'COLLATE' => $this->getCollation(), \n );\n }", "abstract public function setOptions($options);", "public function configureOptions();", "public function __construct(array $options = null) {\n\t\tparent::__construct( $options );\n\t\t$this->setDbTable('Unit_Model_DbTable_RentSettings');\n\t}", "public function setConnectionOverride(\\codename\\core\\database $db) {\r\n $this->db = $db;\r\n }", "abstract public function setOptions($options = array());", "public function setAdapterType($adapterType)\n {\n \t$this->adapterType = $adapterType;\n }" ]
[ "0.6705718", "0.6310306", "0.6225778", "0.5997318", "0.5966678", "0.59628737", "0.5923485", "0.5908635", "0.5891502", "0.58901894", "0.58620524", "0.5860792", "0.5835917", "0.58231765", "0.58178616", "0.5810769", "0.58008796", "0.57981116", "0.5790879", "0.57748616", "0.57653743", "0.5754529", "0.57545215", "0.5727668", "0.57211524", "0.570801", "0.57009035", "0.56872344", "0.56749594", "0.56694895" ]
0.68069464
0
Can we convert settings?
public static function canConvertSettings() { return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _convertSettings(&$settings)\n {\n foreach ($settings as $item => $val) {\n\n if (substr($item, 0, 6) == 'allow_') {\n $settings[$item] = ($val == 0) ? false : true;\n }\n }\n\n $settings['exclude'] = explode(',', $settings['exclude']);\n if (strlen($settings['exclude'][0]) > 0) {\n $settings['exclude'] = array_merge($settings['exclude'], self::$exclude);\n } else {\n $settings['exclude'] = self::$exclude;\n }\n\n return $settings;\n }", "public function sanitizeSettings($settings) {\n // Make sure 'enable_ads' isn't missing altogether when not checked\n if (!array_key_exists('enable_ads', $settings)) {\n $settings['enable_ads'] = '0';\n }\n return $settings;\n }", "function wp_convert_widget_settings($base_name, $option_name, $settings)\n {\n }", "public static function normalize_values($settings) {\n\t\treturn array_map(function($value) {\n\t\t\tif ($value === 'true') {\n\t\t\t\treturn true;\n\t\t\t} else if ($value === 'false') {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}, $settings);\n\t}", "abstract public function settings(): array;", "private function upgrade_settings()\n {\n $currentModVars = $this->getVars();\n $defVars = $this->getDefaultVars();\n\n foreach ($defVars as $key => $defVar) {\n if (array_key_exists($key, $currentModVars)) {\n $type = gettype($defVar);\n switch ($type) {\n case 'boolean':\n if (in_array($currentModVars[$key], ['yes', 'no'])) {\n $var = 'yes' === $currentModVars[$key] ? true : false;\n } else {\n $var = ((bool) ($currentModVars[$key]));\n }\n\n break;\n default:\n $var = $defVar;\n\n break;\n }\n if ('defaultPoster' === $key) {\n $var = 2; // not bolean anymore assume admin id but maybe guest?\n }\n }\n $this->setVar($key, $var);\n }\n\n return true;\n }", "abstract public function get_settings();", "function saveSettings() {\n\t\t//# convert class variables into an array and save using\n\t\t//# Wordpress functions, \"update_option\" or \"add_option\"\n\t\t//#convert class into array...\n\t\t$settings_array = array();\n\t\t$obj = $this;\n\t\tforeach (array_keys(get_class_vars(get_class($obj))) as $k){\n\t\t\tif (is_array($obj->$k)) {\n\t\t\t\t//serialize any arrays within $obj\n\t\t\t\tif (count($obj->$k)>0) {\n\t\t\t\t\t$settings_array[$k] = esc_attr(serialize($obj->$k));\n\t\t\t\t} else {\n\t\t\t\t\t$settings_array[$k] = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$settings_array[$k] = \"{$obj->$k}\";\n\t\t\t}\n\t\t}\n\t\t//#save array to options table...\n\t\t$options_check = get_option('wassup_settings');\n\t\tif (!empty($options_check)) {\n\t\t\tupdate_option('wassup_settings', $settings_array);\n\t\t} else {\n\t\t\tadd_option('wassup_settings', $settings_array, 'Options for WassUp');\n\t\t}\n\t\treturn true;\n\t}", "private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}", "public function import_settings($settings) {\n\t\t// A bug in UD releases around 1.12.40 - 1.13.3 meant that it was saved in URL-string format, instead of JSON\n\t\t$perhaps_not_yet_parsed = json_decode(stripslashes($settings['settings']), true);\n\n\t\tif (!is_array($perhaps_not_yet_parsed)) {\n\t\t\tparse_str($perhaps_not_yet_parsed, $posted_settings);\n\t\t} else {\n\t\t\t$posted_settings = $perhaps_not_yet_parsed;\n\t\t}\n\n\t\tif (!empty($settings['updraftplus_version'])) $posted_settings['updraftplus_version'] = $settings['updraftplus_version'];\n\n\t\t// Handle the settings name change of WebDAV and SFTP (Apr 2017) if someone tries to import an old settings to this version\n\t\tif (isset($posted_settings['updraft_webdav_settings'])) {\n\t\t\t$posted_settings['updraft_webdav'] = $posted_settings['updraft_webdav_settings'];\n\t\t\tunset($posted_settings['updraft_webdav_settings']);\n\t\t}\n\n\t\tif (isset($posted_settings['updraft_sftp_settings'])) {\n\t\t\t$posted_settings['updraft_sftp'] = $posted_settings['updraft_sftp_settings'];\n\t\t\tunset($posted_settings['updraft_sftp_settings']);\n\t\t}\n\n\t\t// We also need to wrap some of the options in the new style settings array otherwise later on we will lose the settings if this information is missing\n\t\tif (empty($posted_settings['updraft_webdav']['settings'])) $posted_settings['updraft_webdav'] = UpdraftPlus_Storage_Methods_Interface::wrap_remote_storage_options($posted_settings['updraft_webdav']);\n\t\tif (empty($posted_settings['updraft_googledrive']['settings'])) $posted_settings['updraft_googledrive'] = UpdraftPlus_Storage_Methods_Interface::wrap_remote_storage_options($posted_settings['updraft_googledrive']);\n\t\tif (empty($posted_settings['updraft_googlecloud']['settings'])) $posted_settings['updraft_googlecloud'] = UpdraftPlus_Storage_Methods_Interface::wrap_remote_storage_options($posted_settings['updraft_googlecloud']);\n\t\tif (empty($posted_settings['updraft_onedrive']['settings'])) $posted_settings['updraft_onedrive'] = UpdraftPlus_Storage_Methods_Interface::wrap_remote_storage_options($posted_settings['updraft_onedrive']);\n\t\tif (empty($posted_settings['updraft_azure']['settings'])) $posted_settings['updraft_azure'] = UpdraftPlus_Storage_Methods_Interface::wrap_remote_storage_options($posted_settings['updraft_azure']);\n\t\tif (empty($posted_settings['updraft_dropbox']['settings'])) $posted_settings['updraft_dropbox'] = UpdraftPlus_Storage_Methods_Interface::wrap_remote_storage_options($posted_settings['updraft_dropbox']);\n\n\t\techo json_encode($this->save_settings($posted_settings));\n\n\t\tdie;\n\t}", "private function load_settings() {\n\t\t\n\t}", "public static function filter_stashbox_register_settings( $settings ) {\n $settings['sb_domain_reminders'] = 'boolval';\n $settings['sb_domain_reminder_distance'] = 'stashbox_sanitize_array';\n $settings['sb_domain_reminder_count'] = 'intval';\n $settings['sb_domain_reminder_recipient'] = 'sanitize_email';\n return $settings;\n }", "abstract public function getSettings();", "function test_settings($settings)\n {\n //can even register results, so you can give errors or whatever if you want..\n geoAdmin::m('I\\'m sure the settings are just fine. (CHANGE THIS! FOR DEMONSTRATION ONLY)');\n\n return true;\n }", "public static function parseSettings()\n\t{\n\t\t$settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sd_googlemaps']);\n\n\t\tif (!is_array($settings)) {\n\t\t\t$settings = [];\n\t\t}\n\t\treturn $settings;\n\t}", "function wp_is_ini_value_changeable($setting)\n {\n }", "static function updateSettings( $settings )\n {\n unset( $GLOBALS['eZTextCodecInternalCharsetReal'] );\n unset( $GLOBALS['eZTextCodecHTTPCharsetReal'] );\n unset( $GLOBALS['eZTextCodecCharsetCheck'] );\n $GLOBALS['eZTextCodecInternalCharset'] = $settings['internal-charset'];\n $GLOBALS['eZTextCodecHTTPCharset'] = $settings['http-charset'];\n $GLOBALS['eZTextCodecMBStringExtension'] = $settings['mbstring-extension'];\n if ( function_exists( 'mb_internal_encoding' ) )\n {\n @mb_internal_encoding( $settings['internal-charset'] );\n }\n }", "public static function convertSettings($settings)\n\t{\n\t\t$defaults = array(\n\t\t\t'field_pre_populate'\t=> 'n',\n\t\t\t'field_fmt'\t\t\t\t=> 'none',\n\t\t\t'field_list_items'\t\t=> array(),\n\t\t);\n\n\t\tif (isset($settings['options']) && is_array($settings['options']))\n\t\t{\n\t\t\t// Some values may be arrays if options list is separated in to groups,\n\t\t\t// we need to flatten the array\n\t\t\t$new_values = array();\n\t\t\t$iterator = new \\RecursiveIteratorIterator(new \\RecursiveArrayIterator($settings['options']));\n\t\t\tforeach ($iterator as $value)\n\t\t\t{\n\t\t\t\t$new_values[] = $value;\n\t\t\t}\n\n\t\t\t$defaults['field_list_items'] = implode(\"\\n\", $new_values);\n\t\t}\n\t\t// Switch celltype\n\t\telse if (isset($settings['off_label']) && isset($settings['on_label']))\n\t\t{\n\t\t\t$defaults['field_list_items'] = implode(\"\\n\", array($settings['off_label'], $settings['on_label']));\n\t\t}\n\n\t\treturn $defaults;\n\t}", "abstract protected function loadSettings();", "function get_settings()\n\t{\n\t\t$this->settings = array();\n\t\t\n\t\treturn true;\n\t}", "public function sanitize_settings($input) {\n $output = $input;\n $output['db_version'] = $this->plugin->db_version();\n $output['debug'] = (bool) $input['debug'];\n\n return $output;\n }", "function ffw_port_settings_sanitize( $input = array() ) {\n\n global $ffw_port_settings;\n\n parse_str( $_POST['_wp_http_referer'], $referrer );\n\n $output = array();\n $settings = ffw_port_get_registered_settings();\n $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';\n $post_data = isset( $_POST[ 'ffw_port_settings_' . $tab ] ) ? $_POST[ 'ffw_port_settings_' . $tab ] : array();\n\n $input = apply_filters( 'ffw_port_settings_' . $tab . '_sanitize', $post_data );\n\n // Loop through each setting being saved and pass it through a sanitization filter\n foreach( $input as $key => $value ) {\n\n // Get the setting type (checkbox, select, etc)\n $type = isset( $settings[ $key ][ 'type' ] ) ? $settings[ $key ][ 'type' ] : false;\n\n if( $type ) {\n // Field type specific filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize_' . $type, $value, $key );\n }\n\n // General filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize', $value, $key );\n }\n\n\n // Loop through the whitelist and unset any that are empty for the tab being saved\n if( ! empty( $settings[ $tab ] ) ) {\n foreach( $settings[ $tab ] as $key => $value ) {\n\n // settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work\n if( is_numeric( $key ) ) {\n $key = $value['id'];\n }\n\n if( empty( $_POST[ 'ffw_port_settings_' . $tab ][ $key ] ) ) {\n unset( $ffw_port_settings[ $key ] );\n }\n\n }\n }\n\n // Merge our new settings with the existing\n $output = array_merge( $ffw_port_settings, $output );\n\n // @TODO: Get Notices Working in the backend.\n add_settings_error( 'ffw_port-notices', '', __( 'Settings Updated', 'ffw_port' ), 'updated' );\n\n return $output;\n\n}", "function loadSettings($settings=array()) {\n\t\t//# load class variables with settings parameter or load\n\t\t//# wp_options if no parameter\n\t\tif (empty($settings) || count($settings) == 0) {\n\t\t\t$settings = $this->getSettings();\n\t\t}\n\t\tif (!empty($settings) && is_array($settings)) {\n\t\t\t$this->options2class($settings);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static function get_allowed_settings()\n {\n }", "protected function loadSettings() {}", "protected function loadSettings() {}", "protected function loadSettings() {}", "public function loadSettings()\n {\n // old Alfred v4 settings\n $settings = \\Alfred\\getVariables(self::$settingsArgs);\n\n\n if (\\Alfred\\getAlfredVersion() >= 5) {\n $new_settings = \\Alfred\\getVariables(self::$settingsArgsV5);\n\n if (!empty($settings['language']) && $settings['language'] !== 'en_EN' && $new_settings['language'] !== 'en_EN') {\n $settings['language'] = $new_settings['language'];\n }\n if (empty($settings['language'])) {\n $settings['language'] = $new_settings['language'];\n }\n if (!empty($new_settings['timezone']) && $new_settings['timezone'] !== 'none') {\n $settings['time_zone'] = $new_settings['timezone'];\n }\n if (!empty($new_settings['base_currencies'])) {\n $settings['base_currency'] = str_replace(' ', '', $new_settings['base_currencies']);\n $settings['base_currency'] = explode(',', $settings['base_currency']);\n }\n if (!empty($new_settings['apikey_fixer'])) {\n $settings['fixer_apikey'] = $new_settings['apikey_fixer'];\n }\n if (!empty($new_settings['apikey_coinmarket'])) {\n $settings['coinmarket_apikey'] = $new_settings['apikey_coinmarket'];\n }\n if (!empty($new_settings['crypto_decimals'])) {\n $settings['crypto_decimals'] = $new_settings['crypto_decimals'];\n }\n if (!empty($new_settings['vat_value'])) {\n $settings['vat_percentage'] = $new_settings['vat_value'];\n }\n if (!empty($new_settings['pixels_base'])) {\n $settings['base_pixels'] = $new_settings['pixels_base'];\n }\n if (\n !empty($new_settings['date_format']) && $new_settings['date_format'] !== 'j F, Y, g:i:s a' ||\n empty($settings['time_format'])\n ) {\n $settings['time_format'] = $new_settings['date_format'];\n if (is_string($settings['time_format'])) {\n $settings['time_format'] = explode('|', $new_settings['date_format']);\n }\n }\n if (!empty($new_settings['number_output_format'])) {\n $settings['number_output_format'] = $new_settings['number_output_format'];\n }\n if (!empty($new_settings['currency_decimals'])) {\n $settings['currency_decimals'] = $new_settings['currency_decimals'];\n }\n }\n\n return $settings;\n }", "public function saveExportSetting($settings)\r\n {\r\n\r\n }", "function tptn_read_options() {\r\n\r\n\t// Upgrade table code\r\n\tglobal $tptn_db_version;\r\n\t$installed_ver = get_option( \"tptn_db_version\" );\r\n\r\n\tif( $installed_ver != $tptn_db_version ) tptn_install();\r\n\r\n\t$tptn_settings_changed = false;\r\n\t\r\n\t$defaults = tptn_default_options();\r\n\t\r\n\t$tptn_settings = array_map('stripslashes',(array)get_option('ald_tptn_settings'));\r\n\tunset($tptn_settings[0]); // produced by the (array) casting when there's nothing in the DB\r\n\t\r\n\tforeach ($defaults as $k=>$v) {\r\n\t\tif (!isset($tptn_settings[$k])) {\r\n\t\t\t$tptn_settings[$k] = $v;\r\n\t\t\t$tptn_settings_changed = true;\r\n\t\t}\r\n\t}\r\n\tif ($tptn_settings_changed == true)\r\n\t\tupdate_option('ald_tptn_settings', $tptn_settings);\r\n\t\r\n\treturn $tptn_settings;\r\n\r\n}" ]
[ "0.7237023", "0.62781686", "0.6194147", "0.6181555", "0.5971173", "0.59524965", "0.59232116", "0.5901699", "0.58868", "0.5862349", "0.5831167", "0.5825477", "0.5814863", "0.57985187", "0.5780242", "0.57667965", "0.5748498", "0.57260287", "0.5725605", "0.57029235", "0.5691813", "0.56793946", "0.56714594", "0.56705", "0.56684977", "0.56684977", "0.56679755", "0.5653758", "0.5635695", "0.56303537" ]
0.79969263
1
Helper method to retrieve forums from nodes
protected function fetchForums() { $forums = array(); foreach( $this->db->select( '*', 'node', array( "node.nodeid<>2 AND closure.parent=? AND node.contenttypeid=?", $this->fetchType( 'Thread' ), $this->fetchType( 'Channel' ) ) )->join( 'closure', "closure.child = node.nodeid" ) AS $node ) { $forums[$node['nodeid']] = $node; } return $forums; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_forum_list() {\n return $this->call('get_forum_list');\n }", "public function forumNode()\n {\n if (!$this->forumNode)\n {\n $this->forumNode = eZContentObjectTreeNode::fetch(\n $this->attribute('node_id'),\n $this->languageCode()\n );\n }\n return $this->forumNode;\n }", "public function get_forum() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_forum() function\n\t\t\treturn $this->forum;\n\t\t}", "public function getAllForums() : array\r\n {\r\n // $result = $getAPI->getAllForums();\r\n\r\n $postdata = http_build_query(\r\n array(\r\n 'token' => $this->config['app-token'],\r\n 'getForumName' => $this->getForumName\r\n )\r\n );\r\n $opts = array('http' =>\r\n array(\r\n 'method' => 'POST',\r\n 'header' => 'Content-Type: application/x-www-form-urlencoded',\r\n 'content' => $postdata\r\n )\r\n );\r\n $context = stream_context_create($opts);\r\n $result = file_get_contents($this->config['endPoint'] .'GetAllForums', true, $context);\r\n\r\n $data = json_decode($result, true);\r\n if($data['statusCode'] == 'SUCCESS'){\r\n //TODO create message or change page locations\r\n return $data;\r\n }\r\n else if($data['statusCode'] == 'INVALID_TOKEN'){\r\n return [\"message\" => \"there was a problem with your request please contact system administrator.\"];\r\n }\r\n else{\r\n //TODO throw error with end user message\r\n return [\"message\" => \"there was a error processing your request please contact system administrator.\"];\r\n }\r\n }", "public function getForumList() : array\r\n {\r\n $postdata = http_build_query(\r\n array(\r\n 'token' => $this->config['app-token'],\r\n 'getForumName' => $this->getForumName\r\n )\r\n );\r\n $opts = array('http' =>\r\n array(\r\n 'method' => 'POST',\r\n 'header' => 'Content-Type: application/x-www-form-urlencoded',\r\n 'content' => $postdata\r\n )\r\n );\r\n $context = stream_context_create($opts);\r\n $result = file_get_contents($this->config['endPoint'] .'GetForumList', true, $context);\r\n\r\n $data = json_decode($result, true);\r\n if($data['statusCode'] == 'SUCCESS'){\r\n //TODO create message or change page locations\r\n return $data;\r\n }\r\n else if($data['statusCode'] == 'INVALID_TOKEN'){\r\n return [\"message\" => \"there was a problem with your request please contact system administrator.\"];\r\n }\r\n else{\r\n //TODO throw error with end user message\r\n return [\"message\" => \"there was a error processing your request please contact system administrator.\"];\r\n }\r\n }", "public function getForum()\n {\n // get articles\n $articles = Article::orderBy('updated_at', 'desc')->take(10)->get();\n\n // return view with articles\n return view('articles.forum', [\n 'articles' => $articles,\n 'article_type_hash' => $this->article_type_hash,\n ]);\n }", "function Forum_showForums(&$PAGEDATA, &$forums) {\n\t$c='<div class=\"forums-list\"><div class=\"forums-list-intro\">'\n\t\t.'Forums on this page</div>';\n\tforeach($forums as $forum) {\n\t\t$c.='<div class=\"forum-forum\">'\n\t\t\t.'<a href=\"'.$PAGEDATA->getRelativeURL.'?forum-f='.$forum['id'].'\">'\n\t\t\t\t.$forum['name'].'</a></div>';\n\t}\n\t$c.='</div>';\n\treturn $c;\n}", "function asForumTopics($data) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<tr class='__topic __tid{$data['tid']} <if test=\"!$data['_icon']['is_read']\">unread</if> expandable <if test=\"$data['approved'] != 1\"> moderated</if>' id='trow_{$data['tid']}' data-tid=\"{$data['tid']}\">\n\t<td class='col_f_icon short altrow'>\n\t\t{parse template=\"generateTopicIcon\" group=\"global_other\" params=\"$data['_icon'], $data['_unreadUrl']\"}\n\t</td>\n\t<td>\n\t\t<if test=\"archivedBadge:|:$this->registry->class_forums->fetchArchiveTopicType( $data ) == 'archived'\">\n\t\t\t<span class='ipsBadge ipsBadge_lightgrey'>{$this->lang->words['topic_is_archived']}</span>\n\t\t</if>\n\t\t<if test=\"hasPrefix:|:!empty($data['tags']['formatted']['prefix'])\">\n\t\t\t{$data['tags']['formatted']['prefix']}\n\t\t</if>\n\t\t<h4><a href='{parse url=\"showtopic={$data['tid']}<if test=\"isNewPostTR:|:$this->request['do']=='new_posts' OR $this->request['do']=='active'\">&amp;view=getnewpost<else /><if test=\"resultIsPostTR:|:$data['pid'] AND $data['pid'] != $data['topic_firstpost']\">&amp;view=findpost&amp;p={$data['pid']}</if></if>&amp;hl={$data['cleanSearchTerm']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['view_result']}'>{$data['_shortTitle']}</a></h4>\n\t\t<span class='desc blend_links'>\n\t\t\t<foreach loop=\"topicsForumTrail:$data['_forum_trail'] as $i => $f\">\n\t\t\t<if test=\"notLastFtAsForum:|:$i+1 == count( $data['_forum_trail'] )\"><span class='desc lighter'>{$this->lang->words['search_aft_in']}</span> <a href='{parse url=\"{$f[1]}\" template=\"showforum\" seotitle=\"{$f[2]}\" base=\"public\"}'>{$f[0]}</a></if>\n\t\t\t</foreach>\n\t\t</span>\n\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t<br />{$this->lang->words['aft_started_by']} {$data['starter']}, {parse date=\"$data['start_date']\" format=\"DATE\"}\n\t\t\t<if test=\"hasTags:|:count($data['tags']['formatted'])\">\n\t\t\t\t&nbsp;<img src='{$this->settings['img_url']}/icon_tag.png' /> {$data['tags']['formatted']['truncatedWithLinks']}\n\t\t\t</if>\n\t\t</span>\n\t\t<if test=\"multipages:|:isset( $data['pages'] ) AND is_array( $data['pages'] ) AND count( $data['pages'] )\">\n\t\t\t<ul class='mini_pagination toggle_notify_off'>\n\t\t\t<foreach loop=\"pages:$data['pages'] as $page\">\n\t\t\t\t\t<if test=\"haslastpage:|:$page['last']\">\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']} {$this->lang->words['_rarr']}</a></li>\n\t\t\t\t\t<else />\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']}</a></li>\n\t\t\t\t\t</if>\n\t\t\t</foreach>\n\t\t\t</ul>\n\t\t</if>\n\t\t<if test=\"bothSearchUnderTitle:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t\t<br />{$this->lang->words['n_last_post_by']} {$data['last_poster']},\n\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t</span>\n\t\t</if>\n\t\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t\t{parse template=\"followData\" group=\"search\" params=\"$data['_followData']\"}\n\t\t</if>\n\t</td>\n\t<td class='col_f_preview __topic_preview'>\n\t\t<a href='#' class='expander closed' title='{$this->lang->words['view_topic_preview']}'>&nbsp;</a>\n\t</td>\n\t<td class='col_f_views'>\n\t\t<ul>\n\t\t\t<li>{parse format_number=\"$data['posts']\"} <if test=\"replylang:|:intval($data['posts']) == 1\">{$this->lang->words['reply']}<else />{$this->lang->words['replies']}</if></li>\n\t\t\t<li class='views desc'>{parse format_number=\"$data['views']\"} {$this->lang->words['views']}</li>\n\t\t</ul>\n\t</td>\n\t<td class='col_f_post'>\n\t\t{parse template=\"userSmallPhoto\" group=\"global\" params=\"$data\"}\n\t\t<ul class='last_post ipsType_small'>\n\t\t\t<if test=\"bothSearch:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t\t<li>{parse template=\"userHoverCard\" group=\"global\" params=\"$data\"}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{$this->lang->words['n_posted']} {parse date=\"$data['_post_date']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t<else />\n\t\t\t\t<li>{$data['last_poster']}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t</if>\n\t\t</ul>\n\t</td>\n\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t<td class='col_f_mod'>\n\t\t\t<input class='input_check checkall toggle_notify_on' type=\"checkbox\" name=\"likes[]\" value=\"{$data['_followData']['like_app']}-{$data['_followData']['like_area']}-{$data['_followData']['like_rel_id']}\" />\n\t\t</td>\n\t<else />\n\t\t<if test=\"isAdmin:|:$this->memberData['g_is_supmod']\">\n\t\t\t<td class='col_f_mod'>\n\t\t\t\t<if test=\"isArchivedCb:|:$this->request['search_app_filters']['forums']['liveOrArchive'] == 'archive'\">\n\t\t\t\t\t&nbsp;\n\t\t\t\t<else />\n\t\t\t\t\t<input type='checkbox' class='input_check topic_mod' id='tmod_{$data['tid']}' />\n\t\t\t\t</if>\n\t\t\t</td>\n\t\t</if>\n\t</if>\n</tr>\n<if test=\"$data['pid']\">\n<script type='text/javascript'>\nipb.global.searchResults[ {$data['tid']} ] = { pid: {parse expression=\"intval($data['pid'])\"}, searchterm:\"{$data['cleanSearchTerm']}\" };\n</script>\n</if>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "function DisplayForums($parent_id, $forum_id, $title)\n {\n global $DB, $categoryid, $mainsettings, $userinfo, $usersystem;\n\n // SD313: check for view permission for usergroup (id enclosed in pipes!)\n // and moderation status of forums\n $forums_tbl = PRGM_TABLE_PREFIX.'p_forum_forums';\n $posts_tbl = PRGM_TABLE_PREFIX.'p_forum_posts';\n $topics_tbl = PRGM_TABLE_PREFIX.'p_forum_topics';\n $forum_id = (int)$forum_id;\n\n if(empty($parent_id) || !isset($this->conf->forums_cache['parents'][$parent_id])) // SD343: \"isset\"\n {\n $source = array($forum_id);\n }\n else\n {\n $parent_id = (int)$parent_id;\n $source = &$this->conf->forums_cache['parents'][$parent_id];\n }\n\n $output = '';\n $do_body = false;\n if(isset($source) && is_array($source))\n foreach($source as $fid)\n {\n $forum_arr = isset($this->conf->forums_cache['forums'][$fid]) ?\n (array)$this->conf->forums_cache['forums'][$fid] : false;\n if(!$forum_arr) continue;\n $forum_groups = sd_ConvertStrToArray($forum_arr['access_view'],'|');\n if(!$this->conf->IsSiteAdmin)\n {\n if(empty($forum_arr['online'])) continue;\n if(!empty($forum_groups) && !count(@array_intersect($userinfo['usergroupids'], $forum_groups)))\n continue;\n }\n\n if(!$do_body)\n {\n $output .= '\n <tbody>';\n $do_body = true;\n }\n\n $external = false;\n $target = '';\n if(!empty($forum_arr['is_category']))\n {\n $link = '#';\n }\n else\n if(empty($forum_arr['link_to']) || !strlen(trim($forum_arr['link_to'])))\n {\n //SD343 SEO Forum Title linking\n $link = $this->conf->RewriteForumLink($fid);\n }\n else\n {\n $external = true;\n $link = trim($forum_arr['link_to']);\n $target = strlen($forum_arr['target']) ? ' target=\"'.$forum_arr['target'].'\" ' : '';\n }\n\n // Display forum image\n $img_col = false;\n if(!empty($this->conf->plugin_settings_arr['display_forum_image']))\n {\n $image = false;\n if(!empty($forum_arr['image']) && !empty($forum_arr['image_h']) && !empty($forum_arr['image_w']))\n {\n $image = $forum_arr['image'].'\" alt=\"\" width=\"'.$forum_arr['image_w'].'\" height=\"'.$forum_arr['image_h'].'\" style=\"border:none\" />';\n }\n if($image) $image = '<img src=\"'.SDUserCache::$img_path.$image;\n $img_col = '<td class=\"col-forum-icon\"><a class=\"forum-title-link\" '.$target.'href=\"'.$link.'\">'. $image.'</a></td>';\n }\n\n $output .= '\n <tr>'.($img_col?$img_col:'').'\n <td class=\"col-forum-title\"><a class=\"forum-title-link\" '.$target.'href=\"'.$link.'\">'.\n (!$forum_arr['online'] ? '<img src=\"'.SDUserCache::$img_path.'lock.png\" alt=\"'.\n strip_alltags($this->conf->plugin_phrases_arr['forum_offline']).'\" />' : '').$forum_arr['title'].'</a>'.\n (strlen($forum_arr['description']) ? ' <p class=\"forum-description\">' . $forum_arr['description'].'</p>' : '');\n\n // Display sub-forums of current forum\n if(!empty($forum_arr['subforums']))\n {\n $sub_links = array();\n foreach($this->conf->forums_cache['parents'][$fid] as $subid)\n {\n $sub_output = '';\n $sub = $this->conf->forums_cache['forums'][$subid];\n if(!$this->conf->IsSiteAdmin)\n {\n if(empty($sub['online'])) continue;\n $subforum_groups = sd_ConvertStrToArray($sub['access_view'],'|');\n if(!empty($subforum_groups) && !count(@array_intersect($userinfo['usergroupids'], $subforum_groups)))\n continue;\n }\n\n $image = '';\n if(empty($sub['online']) && (empty($sub['link_to']) || !strlen(trim($sub['link_to']))))\n {\n $image = '<img src=\"'.SDUserCache::$img_path.'lock.png\" width=\"16\" height=\"16\" alt=\"'.\n htmlspecialchars($this->conf->plugin_phrases_arr['forum_offline'], ENT_COMPAT).'\" />';\n }\n else\n if(!empty($this->conf->plugin_settings_arr['display_forum_image']))\n {\n if(!empty($sub['image']) && !empty($sub['image_h']) && !empty($sub['image_w']))\n {\n $image = '<img src=\"'.SDUserCache::$img_path.$sub['image'].'\" alt=\"\" width=\"'.$sub['image_w'].'\" height=\"'.$sub['image_h'].'\" style=\"border:none\" />';\n }\n $descr = strip_tags(str_replace(array('<br>','<br />','&quot;'),array(' ',' ',''), $sub['description']));\n }\n\n if(empty($sub['link_to']) || !strlen(trim($sub['link_to'])))\n {\n $target = '';\n //SD343 SEO Forum Title linking\n $link = $this->conf->RewriteForumLink($sub['forum_id']);\n }\n else\n {\n $link = trim($sub['link_to']);\n $target = strlen($sub['target']) ? ' target=\"'.$sub['target'].'\" ' : '';\n if(!$image)\n $image = '<img src=\"'.SDUserCache::$img_path.'arrow-right.png\" width=\"14\" height=\"14\" alt=\"\" />';\n }\n if($descr = strip_tags(str_replace(array('<br>','<br />','&quot;'),array(' ',' ',' '), $sub['description'])))\n {\n $descr = 'title=\"'.htmlspecialchars($descr).'\" ';\n }\n $sub_output .= $image.'<a class=\"forum-sublink\" '.$target.$descr.'href=\"'.$link.'\">'.$sub['title'].'</a>';\n $sub_links[] = $sub_output;\n }\n if(!empty($sub_links))\n $output .= '\n <p class=\"sub-forums\">'.implode(', ',$sub_links).'</p>';\n unset($sub_links);\n }\n\n $output .= '\n </td>';\n if(!empty($mainsettings['enable_rss_forum']))\n {\n $output .= '\n <td class=\"col-rss\"><a title=\"RSS\" class=\"rss-icon\" href=\"forumrss.php?forum_id=' . $fid . '\">RSS</a></td>';\n }\n\n //SD342: add first 100 chars as link title for preview\n $post_hint = '';\n if(!empty($forum_arr['post_text']))\n $post_hint = SDForumConfig::GetBBCodeExtract($forum_arr['post_text']);\n\n $output .= '\n <td class=\"col-topic-count\">' . number_format($forum_arr['topic_count']) . '</td>\n <td class=\"col-post-count\">' . number_format($forum_arr['post_count']) . '</td>\n <td class=\"col-last-updated\"'.$post_hint.' style=\"cursor:normal\">';\n\n if(!empty($forum_arr['last_post_date']))\n {\n $thread_title = $forum_arr['last_topic_title'];\n //SD370: fetch prefix (if present and uncensored) and display it\n $thread_prefix = '';\n if(!empty($forum_arr['last_topic_id']))\n {\n if($prefix = $this->GetTopicPrefix($forum_arr['last_topic_id']))\n {\n $thread_prefix = str_replace('[tagname]', $prefix['tag'], $prefix['html_prefix']).' ';\n }\n unset($prefix);\n }\n\n if(strlen($thread_title) > 30)\n {\n $space_position = strrpos($thread_title, \" \") - 1;\n //SD343: respect utf-8\n if($space_position === false)\n $space_position = 30;\n else\n $space_position++;\n $thread_title = sd_substr($thread_title, 0, $space_position) . '...';\n }\n\n //SD343 SEO Forum Title linking\n $link = $forum_arr['last_topic_seo_url'];\n $output .= '<a class=\"jump-post-link\" href=\"'.$link.'\">'.$thread_prefix.trim($thread_title).'</a>';\n if(!empty($forum_arr['poster_id']))\n {\n $poster_id = (int)$forum_arr['poster_id'];\n //SD342: user caching\n $poster = SDUserCache::CacheUser($poster_id, $forum_arr['last_post_username'], false);\n $output .= '<br />'.$this->conf->plugin_phrases_arr['posted_by'].' '.$poster['profile_link'];\n }\n else\n {\n $output .= $forum_arr['last_post_username'];\n }\n $output .= '<br />\n ' . $this->conf->GetForumDate($forum_arr['last_post_date']);\n }\n\n $output .= '</td>\n </tr>';\n\n } //while\n\n if($do_body)\n {\n $output .= '\n </tbody>\n <!-- DisplayForums -->\n ';\n return $output;\n }\n return false;\n\n }", "private function load_forums($id)\n {\n /*--------------------------------------------------------------------------\n * send the 8 most recent forums to the user who just connected to the group\n *-------------------------------------------------------------------------*/\n $forum_obj = new forum_mdl();\n return $forum_obj->get_forums($id,\"department\");\n }", "public function show_forums()\n\t{\n\t\t// Navigation de la page\n\t\tif ($this->cat)\n\t\t{\n\t\t\t$this->nav = Forum::nav($this->cat, array(), $this);\n\t\t\tFsb::$tpl->set_vars(array(\n\t\t\t\t'U_LOW_FORUM' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?p=low&amp;id=' . $this->cat),\n\t\t\t));\n\t\t}\n\n\t\t// Derniere visite sur l'index ?\n\t\tif (Fsb::$mods->is_active('update_last_visit') && Fsb::$mods->is_active('last_visit_index') && Fsb::$session->id() <> VISITOR_ID && $last_visit = Http::getcookie('last_visit'))\n\t\t{\n\t\t\tFsb::$tpl->set_vars(array(\n\t\t\t\t'L_LAST_VISIT_INDEX' =>\t\tsprintf(Fsb::$session->lang('last_visit_index'), Fsb::$session->print_date($last_visit)),\n\t\t\t));\n\t\t}\n\n\t\t// Balise META pour la syndications RSS\n\t\tHttp::add_meta('link', array(\n\t\t\t'rel' =>\t\t'alternate',\n\t\t\t'type' =>\t\t'application/rss+xml',\n\t\t\t'title' =>\t\tFsb::$session->lang('rss'),\n\t\t\t'href' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?p=rss&amp;mode=index&amp;cat=' . $this->cat),\n\t\t));\n\n\t\tFsb::$tpl->set_file('forum/forum_index.html');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'IS_CAT' =>\t\t\t\t\t($this->cat) ? true : false,\n\n\t\t\t'U_MARKREAD_FORUMS' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?markread=true' . (($this->cat) ? '&amp;cat=' . $this->cat : '')),\n\t\t));\n\n\t\t// Sujets lus\n\t\t$forum_topic_read = (!Fsb::$session->is_logged()) ? array() : Forum::get_topics_read(1);\n\n\t\t// On recupere les forums, avec une jointure sur les messages lus pour voir si\n\t\t// le dernier message a ete lu ou non\n\t\t$result = Forum::query(($this->cat == null) ? '' : 'WHERE f.f_cat_id = ' . $this->cat);\n\n\t\t$can_display_subforum = false;\n\t\twhile ($forum = Fsb::$db->row($result))\n\t\t{\n\t\t\tif ($forum['f_parent'] == 0)\n\t\t\t{\n\t\t\t\t$parent_id = $forum['f_id'];\n\t\t\t\t$last_cat = $forum;\n\t\t\t\t$can_display_subforum = false;\n\t\t\t}\n\t\t\telse if (Fsb::$session->is_authorized($forum['f_id'], 'ga_view') && (Fsb::$cfg->get('display_subforums') || $forum['f_parent'] == $parent_id))\n\t\t\t{\n\t\t\t\t// On affiche la categorie\n\t\t\t\tif ($last_cat)\n\t\t\t\t{\n\t\t\t\t\tFsb::$tpl->set_blocks('cat', array(\n\t\t\t\t\t\t'CAT_ID' =>\t\t$forum['f_id'],\n\t\t\t\t\t\t'NAME' =>\t\thtmlspecialchars($last_cat['f_name']),\n\t\t\t\t\t\t'U_CAT' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?cat=' . $last_cat['f_id']),\n\t\t\t\t\t));\n\t\t\t\t\t$last_cat = null;\n\t\t\t\t}\n\n\t\t\t\t// Forum lu ou non lu ?\n\t\t\t\t$is_read = (Fsb::$session->is_logged() && isset($forum_topic_read[$forum['f_id']]) && $forum_topic_read[$forum['f_id']] > 0) ? false : true;\n\n\t\t\t\t// On affiche le forum\n\t\t\t\tForum::display($forum, 'forum', 0, $is_read);\n\t\t\t\t\n\t\t\t\t$can_display_subforum = true;\n\t\t\t\t$sub_parent_id = $forum['f_id'];\n\t\t\t}\n\t\t\telse if ($can_display_subforum && Fsb::$session->is_authorized($forum['f_id'], 'ga_view') && !Fsb::$cfg->get('display_subforums') && $forum['f_parent'] == $sub_parent_id)\n\t\t\t{\n\t\t\t\t// Forum lu ou non lu ?\n\t\t\t\t$is_read = (Fsb::$session->is_logged() && isset($forum_topic_read[$forum['f_id']]) && $forum_topic_read[$forum['f_id']] > 0) ? false : true;\n\n\t\t\t\t// On affiche le sous forum\n\t\t\t\tForum::display($forum, 'subforum', 0, $is_read);\n\t\t\t}\n\t\t}\n\t\tFsb::$db->free($result);\n\t}", "public function readforums($args=array())\n {\n $permcheck = (isset($args['permcheck'])) ? strtoupper($args['permcheck']): ACCESS_READ;\n if (!empty($permcheck) &&\n ($permcheck <> ACCESS_OVERVIEW) &&\n ($permcheck <> ACCESS_READ) &&\n ($permcheck <> ACCESS_COMMENT) &&\n ($permcheck <> ACCESS_MODERATE) &&\n ($permcheck <> ACCESS_ADMIN) &&\n ($permcheck <> 'NOCHECK') ) {\n return LogUtil::registerError($this->__('Error! The action you wanted to perform was not successful for some reason, maybe because of a problem with what you input. Please check and try again.'));\n }\n \n $where = '';\n if (isset($args['forum_id'])) {\n $where = \"WHERE tbl.forum_id='\". (int)DataUtil::formatForStore($args['forum_id']) .\"' \";\n } elseif (isset($args['cat_id'])) {\n $where = \"WHERE tbl.cat_id='\". (int)DataUtil::formatForStore($args['cat_id']) .\"' \";\n }\n \n if ($permcheck <> 'NOCHECK') {\n $permfilter[] = array('realm' => 0,\n 'component_left' => 'Dizkus',\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'cat_id',\n 'instance_middle' => 'forum_id',\n 'instance_right' => '',\n 'level' => $permcheck);\n } else {\n $permfilter = null;\n }\n \n $joininfo[] = array ('join_table' => 'dizkus_categories',\n 'join_field' => array('cat_title', 'cat_id'),\n 'object_field_name' => array('cat_title', 'cat_id'),\n 'compare_field_table'=> 'cat_id',\n 'compare_field_join' => 'cat_id');\n \n $orderby = 'a.cat_order, tbl.forum_order, tbl.forum_name';\n \n $forums = DBUtil::selectExpandedObjectArray('dizkus_forums', $joininfo, $where, $orderby, -1, -1, '', $permfilter);\n \n for ($i = 0; $i < count($forums); $i++) {\n // rename some fields for BC compatibility\n $forums[$i]['pop3_active'] = $forums[$i]['forum_pop3_active'];\n $forums[$i]['pop3_server'] = $forums[$i]['forum_pop3_server'];\n $forums[$i]['pop3_port'] = $forums[$i]['forum_pop3_port'];\n $forums[$i]['pop3_login'] = $forums[$i]['forum_pop3_login'];\n $forums[$i]['pop3_password'] = $forums[$i]['forum_pop3_password'];\n $forums[$i]['pop3_interval'] = $forums[$i]['forum_pop3_interval'];\n $forums[$i]['pop3_lastconnect'] = $forums[$i]['forum_pop3_lastconnect'];\n $forums[$i]['pop3_matchstring'] = $forums[$i]['forum_pop3_matchstring'];\n $forums[$i]['pop3_pnuser'] = $forums[$i]['forum_pop3_pnuser'];\n $forums[$i]['pop3_pnpassword'] = $forums[$i]['forum_pop3_pnpassword'];\n \n // we re-use the pop3_active field to distinguish between\n // 0 - no external source\n // 1 - mail\n // 2 - rss\n // now\n // to do: rename the db fields: \n $forums[$i]['externalsource'] = $forums[$i]['forum_pop3_active'];\n $forums[$i]['externalsourceurl'] = $forums[$i]['forum_pop3_server'];\n $forums[$i]['externalsourceport'] = $forums[$i]['forum_pop3_port'];\n $forums[$i]['pnuser'] = $forums[$i]['forum_pop3_pnuser'];\n $forums[$i]['pnpassword'] = $forums[$i]['forum_pop3_pnpassword'];\n }\n \n if (count($forums) > 0) {\n if (isset($args['forum_id'])) {\n return $forums[0];\n }\n }\n \n return $forums;\n }", "public function actionIndex()\n\t{\n\t\t$forumId = $this->_input->filterSingle('node_id', XenForo_Input::UINT);\n\t\tif (empty($forumId))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t\n\t\t$options = XenForo_Application::get('options');\n\t\tif (($forumId && $forumId != $options->cmfUserBlogsNode) || $this->_routeMatch->getResponseType() == 'rss' || $this->_input->filterSingle('user_id', XenForo_Input::UINT))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t/** @var $ftpHelper XenForo_ControllerHelper_ForumThreadPost */\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$forum = $ftpHelper->assertForumValidAndViewable(\n\t\t\t$forumId,\n\t\t\t$this->_getForumFetchOptions()\n\t\t);\n\t\t$forumId = $forum['node_id'];\n\n\t\t$visitor = XenForo_Visitor::getInstance();\n\t\t$userBlogModel = $this->_getUserBlogModel();\n\t\t$forumModel = $this->_getForumModel();\n\n\t\t$page = max(1, $this->_input->filterSingle('page', XenForo_Input::UINT));\n\t\t$usersPerPage = $options->cmfUserBlogsPerPage;\n\n\t\t$this->canonicalizeRequestUrl(\n\t\t\tXenForo_Link::buildPublicLink('forums', $forum, array('page' => $page))\n\t\t);\n\n\t\tlist($defaultOrder, $defaultOrderDirection) = $this->_getDefaultThreadSort($forum);\n\n\t\t// only default sort by last_post_date desc\n\t\t$order = $defaultOrder;\n\t\t$orderDirection = $defaultOrderDirection;\n\n\t\t//all threads and fake value for disabling \"mark read\"\n\t\t$displayConditions = array();\n\n\t\t$fetchElements = $this->_getThreadFetchElements(\n\t\t\t$forum, $displayConditions,\n\t\t\t$usersPerPage, $page, $order, $orderDirection\n\t\t);\n\t\t$threadFetchConditions = $fetchElements['conditions'];\n\t\t$threadFetchOptions = $fetchElements['options'] + array(\n\t\t\t'perPage' => $usersPerPage,\n\t\t\t'page' => $page,\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection\n\t\t);\n\t\tunset($fetchElements);\n\n\n\t\t$totalUserBlogs = $userBlogModel->countUserBlogs($threadFetchConditions);\n\t\t$this->canonicalizePageNumber($page, $usersPerPage, $totalUserBlogs, 'forums', $forum);\n\n\t\t$permissions = $visitor->getNodePermissions($forumId);\n\n\t\t// get the ordering params set for the header links\n\t\t$orderParams = array();\n\t\t$pageNavParams = $displayConditions;\n//\t\t$pageNavParams['order'] = ($order != $defaultOrder ? $order : false);\n//\t\t$pageNavParams['direction'] = ($orderDirection != $defaultOrderDirection ? $orderDirection : false);\n\t\t$pageNavParams['order'] = false;\n\t\t$pageNavParams['direction'] = false;\n\n\t\t$userBlogs = $userBlogModel->getNodeUserDataForListDisplay($forum, $threadFetchConditions, $threadFetchOptions, $permissions);\n\t\t$viewParams = array(\n\t\t\t'nodeList' => $userBlogs,\n\t\t\t'forum' => $forum,\n\t\t\t'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum, false),\n\n\t\t\t'canPostThread' => $forumModel->canPostThreadInForum($forum),\n\t\t\t'canSearch' => $visitor->canSearch(),\n\n\t\t\t//TODO Ignore List\n\t\t\t'ignoredNames' => array(), //$this->_getIgnoredContentUserNames($threads) + $this->_getIgnoredContentUserNames($stickyThreads),\n\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection,\n\t\t\t'orderParams' => $orderParams,\n\t\t\t'displayConditions' => $displayConditions,\n\n\t\t\t'pageNavParams' => $pageNavParams,\n\t\t\t'page' => $page,\n\t\t\t'blogsStartOffset' => ($page - 1) * $usersPerPage + 1,\n\t\t\t'blogsEndOffset' => ($page - 1) * $usersPerPage + count($userBlogs['nodesGrouped'][$forumId]),\n\t\t\t'blogsPerPage' => $usersPerPage,\n\t\t\t'totalBlogs' => $totalUserBlogs,\n\n\t\t\t'showPostedNotice' => $this->_input->filterSingle('posted', XenForo_Input::UINT)\n\t\t);\n\n\t\treturn $this->responseView('XenForo_ViewPublic_Forum_View', 'cmf_user_blog_view', $viewParams);\n\t}", "final private function getAll(&$db)\n {\n $method = 'ForumMain->getAll()';\n\n // Switch\n $db->sql_switch('sketchbookcafe');\n\n // Get Categories\n $sql = 'SELECT id, name, description\n FROM forums\n WHERE iscategory=1\n AND isdeleted=0\n ORDER BY forum_order\n ASC';\n $result = $db->sql_query($sql);\n $rownum = $db->sql_numrows($result);\n\n // Set\n $this->categories_result = $result;\n $this->categories_rownum = $rownum;\n\n // Unset\n unset($result);\n unset($rownum);\n\n // Get Forums\n $sql = 'SELECT id, parent_id, name, description, total_threads, total_posts, last_thread_id \n FROM forums\n WHERE isforum=1\n AND isdeleted=0\n ORDER BY forum_order\n ASC';\n $result = $db->sql_query($sql);\n $rownum = $db->sql_numrows($result);\n\n // Set\n $this->forums_result = $result;\n $this->forums_rownum = $rownum;\n }", "public function rss_forum()\n\t{\n\t\tif (!$this->id || !Fsb::$session->is_authorized($this->id, 'ga_view') || !Fsb::$session->is_authorized($this->id, 'ga_view_topics'))\n\t\t{\n\t\t\tDisplay::message('not_allowed');\n\t\t}\n\n\t\t// Liste des messages\n\t\t$sql = 'SELECT f.f_name, p.p_id, p.u_id, p.f_id, p.p_text, p.p_time, p.p_nickname, p.p_map, t.t_id, t.t_title, t.t_description, u.u_activate_email, u.u_email, u.u_auth\n\t\t\t\tFROM ' . SQL_PREFIX . 'forums f\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tON f.f_id = t.f_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'posts p\n\t\t\t\t\tON p.p_id = t.t_first_p_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\t\tON u.u_id = p.u_id\n\t\t\t\tWHERE t.f_id = ' . $this->id . '\n\t\t\t\t\tAND p.p_approve = 0\n\t\t\t\tORDER BY t.t_last_p_time DESC\n\t\t\t\tLIMIT 100';\n\t\t$this->check_caching($sql, 'rss_' . $this->id . '_');\n\t\t$result = Fsb::$db->query($sql, 'rss_' . $this->id . '_');\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\t$this->rss->open(\n\t\t\t\thtmlspecialchars(Fsb::$cfg->get('forum_name') . Fsb::$session->getStyle('other', 'title_separator') . $row['f_name']),\n\t\t\t\thtmlspecialchars(sprintf(Fsb::$session->lang('rss_forum_name'), $row['f_name'])),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=forum&amp;id=' . $this->id),\n\t\t\t\t$row['p_time']\n\t\t\t);\n\n\t\t\t$parser = new Parser();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Informations passees au parseur de message\n\t\t\t\t$parser_info = array(\n\t\t\t\t\t'u_id' =>\t\t\t$row['u_id'],\n\t\t\t\t\t'p_nickname' =>\t\t$row['p_nickname'],\n\t\t\t\t\t'u_auth' =>\t\t\t$row['u_auth'],\n\t\t\t\t\t'f_id' =>\t\t\t$row['f_id'],\n\t\t\t\t\t't_id' =>\t\t\t$row['t_id'],\n\t\t\t\t);\n\t\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t\t$this->rss->add_entry(\n\t\t\t\t\tParser::title($row['t_title']),\n\t\t\t\t\thtmlspecialchars(($row['t_description']) ? $row['t_description'] : $parser->mapped_message($row['p_text'], $row['p_map'], $parser_info)),\n\t\t\t\t\t(($row['u_activate_email'] & 2) ? 'mailto:' . $row['u_email'] : Fsb::$cfg->get('forum_mail')) . ' ' . htmlspecialchars($row['p_nickname']),\n\t\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=topic&t_id=' . $row['t_id']),\n\t\t\t\t\t$row['p_time']\n\t\t\t\t);\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t}\n\t\t// Aucun sujet, on pioche donc directement les informations dans le forum\n\t\telse \n\t\t{\n\t\t\t$sql = 'SELECT f_id, f_name, f_text\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'forums\n\t\t\t\t\tWHERE f_id = ' . $this->id;\n\t\t\t$row = Fsb::$db->request($sql);\n\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['f_name']),\n\t\t\t\thtmlspecialchars($row['f_text']),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=forum&amp;id=' . $this->id),\n\t\t\t\tCURRENT_TIME\n\t\t\t);\n\t\t}\n\t}", "function forumHandler() {}", "public function getFaqs() {\r\n $result = $this -> db -> query (\r\n \"SELECT\r\n *\r\n FROM\r\n faqs\r\n \"\r\n );\r\n\r\n $return = array();\r\n \r\n if ($result ) {\r\n /* fetch associative array */\r\n while ($row = $result->fetch_assoc()) {\r\n $return['faq'][]['nodes'] = array (\"question\" => $row['question'],\r\n \"answer\" => $row['answer']\r\n );\r\n }\r\n\r\n /* free result set */\r\n $result->free();\r\n }\r\n \r\n return $return;\r\n }", "public function index()\n {\n return Forum::all();\n }", "public function forum()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Forum');\n\t}", "function xthreads_buildcache_forums($fp) {\r\n\tglobal $cache;\r\n\t$forums = $cache->read('forums');\r\n\t$xtforums = array();\r\n\trequire_once MYBB_ROOT.'inc/xthreads/xt_phptpl_lib.php';\r\n\tfwrite($fp, '\r\n\t\tfunction xthreads_evalcacheForums($fid) {\r\n\t\t\tswitch($fid) {');\r\n\tforeach($forums as $fid => $forum) {\r\n\t\t$tplprefix = $forum['xthreads_tplprefix'];\r\n\t\txthreads_sanitize_eval($tplprefix);\r\n\t\t$langprefix = $forum['xthreads_langprefix'];\r\n\t\txthreads_sanitize_eval($langprefix);\r\n\t\t\r\n\t\t$settingoverrides = '';\r\n\t\tforeach(explode(\"\\n\", str_replace(\"{\\n}\", \"\\r\", str_replace(\"\\r\", '', $forum['xthreads_settingoverrides']))) as $override) {\r\n\t\t\t$kv = explode('=', str_replace(\"\\r\", \"\\n\", $override), 2);\r\n\t\t\tif(!isset($kv[1])) continue;\r\n\t\t\t$kv[0] = strtr($kv[0], array('\\\\' => '', '\\'' => ''));\r\n\t\t\txthreads_sanitize_eval($kv[1]);\r\n\t\t\t$settingoverrides .= '\\''.$kv[0].'\\' => \"'.$kv[1].'\", ';\r\n\t\t}\r\n\t\t\r\n\t\tif(!xthreads_empty($tplprefix) || !xthreads_empty($langprefix) || $settingoverrides !== '') // slight optimisation: only write if there's something interesting\r\n\t\t\tfwrite($fp, '\r\n\t\t\t\tcase '.$fid.': return array(\r\n\t\t\t\t\t\\'tplprefix\\' => '.(xthreads_empty($tplprefix) ? '\\'\\'' : 'array_map(\\'trim\\', explode(\\',\\', \"'.$tplprefix.'\"))').',\r\n\t\t\t\t\t\\'langprefix\\' => '.(xthreads_empty($langprefix) ? '\\'\\'' : 'array_map(\\'trim\\', explode(\\',\\', \"'.$langprefix.'\"))').',\r\n\t\t\t\t\t\\'settingoverrides\\' => '.($settingoverrides==='' ? '\\'\\'' : 'array('.$settingoverrides.')').',\r\n\t\t\t\t);');\r\n\t\t$xtforum = array(\r\n\t\t\t'defaultfilter_tf' => array(),\r\n\t\t\t'defaultfilter_xt' => array(),\r\n\t\t);\r\n\t\t\r\n\t\tforeach(explode(\"\\n\", str_replace(\"{\\n}\", \"\\r\", str_replace(\"\\r\", '', $forum['xthreads_defaultfilter']))) as $filter) {\r\n\t\t\t$kv = explode('=', str_replace(\"\\r\", \"\\n\", $filter), 2);\r\n\t\t\tif(!isset($kv[1])) continue;\r\n\t\t\t$kv[0] = strtr($kv[0], array('\\\\' => '', '\\'' => ''));\r\n\t\t\t//$kv[0] = urldecode($kv[0]); // - this is not necessary, since $kv[0] can never contain newlines or = signs\r\n\t\t\t$isarray = false;\r\n\t\t\tif($p = strrpos($kv[0], '[')) {\r\n\t\t\t\t$kv[0] = substr($kv[0], 0, $p);\r\n\t\t\t\t$isarray = true;\r\n\t\t\t}\r\n\t\t\tunset($filter_array);\r\n\t\t\tif(substr($kv[0], 0, 5) == '__xt_') {\r\n\t\t\t\t$kv[0] = substr($kv[0], 5);\r\n\t\t\t\tif(in_array($kv[0], array('uid','lastposteruid','icon','prefix')))\r\n\t\t\t\t\t$filter_array =& $xtforum['defaultfilter_xt'];\r\n\t\t\t} else {\r\n\t\t\t\tif(!isset($threadfield_cache))\r\n\t\t\t\t\t$threadfield_cache = xthreads_gettfcache($fid);\r\n\t\t\t\tif(isset($threadfield_cache[$kv[0]]) && $threadfield_cache[$kv[0]]['allowfilter'])\r\n\t\t\t\t\t$filter_array =& $xtforum['defaultfilter_tf'];\r\n\t\t\t}\r\n\t\t\tif(isset($filter_array)) {\r\n\t\t\t\txthreads_sanitize_eval($kv[1]);\r\n\t\t\t\tif($isarray)\r\n\t\t\t\t\t$filter_array[$kv[0]][] = $kv[1];\r\n\t\t\t\telse\r\n\t\t\t\t\t$filter_array[$kv[0]] = $kv[1];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tunset($forum['xthreads_tplprefix'], $forum['xthreads_langprefix'], $forum['xthreads_defaultfilter'], $forum['xthreads_settingoverrides']);\r\n\t\tif(!empty($xtforum)) $xtforums[$fid] = $xtforum;\r\n\t}\r\n\tfwrite($fp, '\r\n\t\t\t} return array(\\'tplprefix\\' => \\'\\', \\'langprefix\\' => \\'\\', \\'settingoverrides\\' => \\'\\');\r\n\t\t}\r\n\t\t\r\n\t\tfunction xthreads_evalcacheForumFilters($fid) {\r\n\t\t\tswitch($fid) {');\r\n\t\t\r\n\t{ // dummy brace\r\n\t\tforeach($xtforums as $fid => &$xtforum) {\r\n\t\t\t// check to see if everything is empty\r\n\t\t\t$allempty = true;\r\n\t\t\tforeach($xtforum as $k => &$filter)\r\n\t\t\t\tif(!empty($filter)) {\r\n\t\t\t\t\t$allempty = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\tif($allempty) continue; // don't write anything if there's nothing interesting to write about\r\n\t\t\tfwrite($fp, '\r\n\t\t\t\tcase '.$fid.': return array(');\r\n\t\t\tforeach($xtforum as $k => &$filter) {\r\n\t\t\t\tfwrite($fp, '\r\n\t\t\t\t\t\\''.$k.'\\' => array(');\r\n\t\t\t\tforeach($filter as $n => &$v) {\r\n\t\t\t\t\tfwrite($fp, '\\''.$n.'\\' => ');\r\n\t\t\t\t\tif(is_array($v))\r\n\t\t\t\t\t\tfwrite($fp, 'array(\"'.implode('\",\"', $v).'\"),');\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tfwrite($fp, '\"'.$v.'\",');\r\n\t\t\t\t}\r\n\t\t\t\tfwrite($fp, '\r\n\t\t\t\t\t),');\r\n\t\t\t}\r\n\t\t\tfwrite($fp, '\r\n\t\t\t\t);');\r\n\t\t}\r\n\t}\r\n\t\r\n\tfwrite($fp, '\r\n\t\t\t} return array(\\'defaultfilter_tf\\' => array(), \\'defaultfilter_xt\\' => array());\r\n\t\t}');\r\n\t$cache->update('forums', $forums);\r\n}", "function sql_recherche_donnees_forum ($idr, $idf, $ida, $idb, $ids) {\n\n\t// changer la table de reference s'il y a lieu (pour afficher_groupes[] !!)\n\tif ($ida) {\n\t\t$r = \"SELECT titre FROM spip_articles WHERE id_article = $ida\";\n\t\t$table = \"articles\";\n\t} else if ($idb) {\n\t\t$r = \"SELECT titre FROM spip_breves WHERE id_breve = $idb\";\n\t\t$table = \"breves\";\n\t} else if ($ids) {\n\t\t$r = \"SELECT nom_site AS titre FROM spip_syndic WHERE id_syndic = $ids\";\n\t\t$table = \"syndic\";\n\t} else if ($idr) {\n\t\t$r = \"SELECT titre FROM spip_rubriques WHERE id_rubrique = $idr\";\n\t\t$table = \"rubriques\";\n\t}\n\n\tif ($idf)\n\t\t$r = \"SELECT titre FROM spip_forum WHERE id_forum = $idf\";\n\n\tif ($r) {\n\t\tlist($titre) = spip_fetch_array(spip_query($r));\n\t\t$titre = supprimer_numero($titre);\n\t} else {\n\t\t$titre = _T('forum_titre_erreur');\n\t\t$table = '';\n\t}\n\n\t// quelle est la configuration du forum ?\n\tif ($ida)\n\t\tlist($accepter_forum) = spip_fetch_array(spip_query(\n\t\t\"SELECT accepter_forum FROM spip_articles WHERE id_article=$ida\"));\n\tif (!$accepter_forum)\n\t\t$accepter_forum = substr(lire_meta(\"forums_publics\"),0,3);\n\t// valeurs possibles : 'pos'teriori, 'pri'ori, 'abo'nnement\n\tif ($accepter_forum == \"non\")\n\t\treturn false;\n\n\treturn array ($titre, $table, $accepter_forum);\n}", "public function getForum()\n {\n return $this->hasOne(Forum::class, ['id' => 'fk_forum']);\n }", "public function topics()\n {\n return $this->hasMany('ForumTopic', 'forum_id', 'id');\n }", "function cemhub_get_available_webforms() {\n $available_webforms = db_select('node', 'nd')\n ->fields('nd', array('title', 'nid'))\n ->condition('type', 'webform')\n ->execute()\n ->fetchAll();\n\n return $available_webforms;\n}", "function get_searchable_forums()\n\t{\n\t\tglobal $ibforums, $std;\n\n\t\t$forum_array = array();\n\t\t$forum_string = \"\";\n\t\t$sql_query = \"\";\n\t\t$check_sub = 0;\n\n\t\t$cats = array();\n\t\t$forums = array();\n\n\t\t// If we have an array of \"forums\", loop\n\t\t// through and build our *SQL IN( ) statement.\n\n\t\t//------------------------------------------------\n\t\t// Check for an array\n\t\t//------------------------------------------------\n\n\t\tif (is_array($_REQUEST['forums']))\n\t\t{\n\n\t\t\tif (in_array('all', $_REQUEST['forums']))\n\t\t\t{\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// Searching all forums..\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t$sql_query = \"SELECT\n\t\t\t\t\tid, read_perms, password\n\t\t\t\t FROM ibf_forums\";\n\n\t\t\t} else // NOT all forums\n\t\t\t{\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// Go loopy loo\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\tforeach ($_REQUEST['forums'] as $l)\n\t\t\t\t{\n\t\t\t\t\tif (preg_match(\"/^c_/\", $l))\n\t\t\t\t\t{\n\t\t\t\t\t\t$cats[] = intval(str_replace(\"c_\", \"\", $l));\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$forums[] = intval($l);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// Do we have cats? Give 'em to Charles!\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\tif (count($cats))\n\t\t\t\t{\n\t\t\t\t\t$sql_query = \"SELECT\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tread_perms,\n\t\t\t\t\t\tpassword,\n\t\t\t\t\t\tsubwrap\n\t\t\t\t\t FROM ibf_forums\n\t\t\t\t\t WHERE category IN(\" . implode(\",\", $cats) . \")\";\n\t\t\t\t\t$boolean = \"OR\";\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$sql_query = \"SELECT\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tread_perms,\n\t\t\t\t\t\tpassword,\n\t\t\t\t\t\tsubwrap\n\t\t\t\t\t FROM ibf_forums\";\n\t\t\t\t\t$boolean = \"WHERE\";\n\t\t\t\t}\n\n\t\t\t\tif (count($forums))\n\t\t\t\t{\n\t\t\t\t\tif ($ibforums->input['searchsubs'] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_query .= \" $boolean (id IN(\" . implode(\",\", $forums) . \") or parent_id IN(\" . implode(\",\", $forums) . \") )\";\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_query .= \" $boolean id IN(\" . implode(\",\", $forums) . \")\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($sql_query == \"\")\n\t\t\t\t{\n\t\t\t\t\t// Return empty..\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t// Run query and finish up..\n\t\t\t//--------------------------------------------\n\n\t\t\t$stmt = $ibforums->db->query($sql_query);\n\n\t\t\twhile ($i = $stmt->fetch())\n\t\t\t{\n\t\t\t\tif ($this->check_access($i))\n\t\t\t\t{\n\t\t\t\t\t$forum_array[] = $i['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t} else // ( is_array( $_REUEST['forums'] ) )\n\t\t{\n\t\t\t//--------------------------------------------\n\t\t\t// Not an array...\n\t\t\t//--------------------------------------------\n\n\t\t\tif ($ibforums->input['forums'] == 'all')\n\t\t\t{\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tread_perms,\n\t\t\t\t\t\tpassword\n\t\t\t\t\tFROM ibf_forums\");\n\n\t\t\t\twhile ($i = $stmt->fetch())\n\t\t\t\t{\n\t\t\t\t\tif ($this->check_access($i))\n\t\t\t\t\t{\n\t\t\t\t\t\t$forum_array[] = $i['id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else // NOT ( $ibforums->input['forums'] == 'all' )\n\t\t\t{\n\t\t\t\tif ($ibforums->input['forums'] != \"\")\n\t\t\t\t{\n\t\t\t\t\t$l = $ibforums->input['forums'];\n\n\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t// Single Cat\n\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\tif (preg_match(\"/^c_/\", $l))\n\t\t\t\t\t{\n\t\t\t\t\t\t$c = intval(str_replace(\"c_\", \"\", $l));\n\n\t\t\t\t\t\tif ($c)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tread_perms,\n\t\t\t\t\t\t\t\tpassword\n\t\t\t\t\t\t\tFROM ibf_forums\n\t\t\t\t\t\t\tWHERE category=$c\");\n\n\t\t\t\t\t\t\twhile ($i = $stmt->fetch())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($this->check_access($i))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$forum_array[] = $i['id'];\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} else // NOT ( preg_match( \"/^c_/\", $l ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t// Single forum\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\t$f = intval($l);\n\n\t\t\t\t\t\tif ($f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$qe = ($ibforums->input['searchsubs'] == 1)\n\t\t\t\t\t\t\t\t? \" OR parent_id=$f \"\n\t\t\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tread_perms,\n\t\t\t\t\t\t\t\tpassword\n\t\t\t\t\t\t\tFROM ibf_forums\n\t\t\t\t\t\t\tWHERE id=$f\" . $qe);\n\n\t\t\t\t\t\t\twhile ($i = $stmt->fetch())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($this->check_access($i))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$forum_array[] = $i['id'];\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}\n\t\t\t}\n\t\t}\n\n\t\t$forum_string = implode(\",\", $forum_array);\n\n\t\treturn $forum_string;\n\n\t}", "function DisplayForumCategories()\n {\n global $DB, $categoryid, $mainsettings, $sdlanguage, $sdurl, $userinfo, $usersystem;\n\n //SD343: display optional tag cloud\n $forum_tags = false;\n if(!empty($this->conf->plugin_settings_arr['display_tagcloud']))\n {\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n SD_Tags::$maxentries = 30;\n SD_Tags::$plugins = $this->conf->plugin_id;\n SD_Tags::$tags_title = $sdlanguage['tags_title'];\n SD_Tags::$targetpageid = $categoryid;\n SD_Tags::$tag_as_param = 'tag';\n if($forum_tags = SD_Tags::DisplayCloud(false))\n {\n if(in_array($this->conf->plugin_settings_arr['display_tagcloud'],array(1,3)))\n {\n echo $forum_tags;\n }\n }\n }\n\n echo '\n <table border=\"0\" class=\"forums\" cellpadding=\"0\" cellspacing=\"0\" summary=\"layout\" width=\"100%\"><thead><tr>';\n if(!empty($this->conf->plugin_settings_arr['display_forum_image']))\n {\n echo '<th class=\"col-forum-icon\"> </th>';\n }\n echo '<th class=\"col-forum-title\">'.$this->conf->plugin_phrases_arr['column_forum'].'</th>';\n if(!empty($mainsettings['enable_rss_forum']))\n {\n echo '<th class=\"col-rss\"><a title=\"RSS\" class=\"rss-icon\" href=\"forumrss.php\">RSS</a></th>';\n }\n echo '<th class=\"col-topic-count\">'.$this->conf->plugin_phrases_arr['column_topics'].'</th>\n <th class=\"col-post-count\">'.$this->conf->plugin_phrases_arr['column_posts'].'</th>\n <th class=\"col-last-updated\">'.$this->conf->plugin_phrases_arr['column_last_updated'].'</th>\n </tr></thead>';\n\n if(isset($this->conf) && isset($this->conf->forums_cache['categories'])) //SD343\n foreach($this->conf->forums_cache['categories'] as $fid)\n {\n if(!isset($this->conf->forums_cache['forums'][$fid])) continue; //SD343\n $entry = $this->conf->forums_cache['forums'][$fid];\n\n if(!$this->conf->IsSiteAdmin)\n {\n if(empty($entry['online'])) continue;\n $entry_groups = sd_ConvertStrToArray($entry['access_view'],'|');\n if(!empty($entry_groups) && !count(@array_intersect($userinfo['usergroupids'], $entry_groups)))\n continue;\n }\n\n if(empty($entry['parent_forum_id']) && empty($entry['is_category']))\n {\n if($res = $this->DisplayForums(0,$fid,$entry['title']))\n {\n echo $res;\n }\n continue;\n }\n\n $output = '\n <tbody>\n <tr>\n <td colspan=\"6\" class=\"category-cell\">\n <div class=\"category-title-container\">';\n\n if(strlen($entry['title']))\n {\n $image = '';\n if(!empty($entry['image']) && !empty($entry['image_h']) && !empty($entry['image_w']))\n {\n $image = '<img src=\"'.SDUserCache::$img_path.$entry['image'].'\" alt=\"\" width=\"'.(int)$entry['image_w'].'\" height=\"'.(int)$entry['image_h'].'\" />';\n }\n $output .= '<span class=\"category-image\">'.($image?$image:'&nbsp;').'</span> <span class=\"category-title\">'.$entry['title'].'</span>';\n if(strlen($entry['description']))\n {\n $output .= '\n <span class=\"category-description\">' . $entry['description']. '</span>';\n }\n }\n $output .= '\n </div>\n </td>\n </tr>\n </tbody>';\n\n if($res = $this->DisplayForums($fid,0,$entry['title']))\n {\n echo $output . $res;\n }\n\n } //foreach\n\n echo '\n </table>\n ';\n\n //SD343: display optional tag cloud\n if(!empty($forum_tags) && !empty($this->conf->plugin_settings_arr['display_tagcloud']) &&\n in_array($this->conf->plugin_settings_arr['display_tagcloud'],array(2,3)))\n {\n echo $forum_tags;\n }\n\n }", "function searchResultsAsForum($results, $titlesOnly) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n{parse js_module=\"forums\"}\n<if test=\"asTawpiks:|:$titlesOnly\">\n<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.forums.js'></script>\n<table class='ipb_table topic_list' id='forum_table'>\n</if>\n\t<if test=\"count($results)\">\n\t\t<if test=\"asPostsStart:|:!$titlesOnly\"><div class='ipsBox'></if>\n\t\t<foreach loop=\"NCresultsAsForum:$results as $result\">\n\t\t\t{$result['html']}\n\t\t</foreach>\n\t\t<if test=\"asPostsEnd:|:!$titlesOnly\"></div></if>\n\t</if>\n<if test=\"asTawpiks2:|:$titlesOnly\">\n\t</table>\n\t<if test=\"isAdminBottom:|:$this->memberData['g_is_supmod'] && $this->request['search_app_filters']['forums']['liveOrArchive'] != 'archive'\">\n\t\t<div id='topic_mod' class='moderation_bar rounded with_action clear'>\n\t\t\t<form id='modform' method=\"post\" action=\"{parse url=\"\" base=\"public\"}\">\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input type=\"hidden\" name=\"app\" value=\"forums\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"module\" value=\"moderate\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"section\" value=\"moderate\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"do\" value=\"topicchoice\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"st\" value=\"{$this->request['st']}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"auth_key\" value=\"{$this->member->form_hash}\" />\n\t\t\t\t\t<input type='hidden' name='fromSearch' value='1' />\n\t\t\t\t\t<input type='hidden' name='returnUrl' id='returnUrl' value='{$this->request['returnUrl']}' />\n\t\t\t\t\t<input type=\"hidden\" name=\"modfilter\" value=\"{$this->request['modfilter']}\" />\n\t\t\t\t\t<input type=\"hidden\" value=\"{$this->request['selectedtids']}\" id='selectedtids' name=\"selectedtids\" />\n\t\t\t\t\n\t\t\t\t\t<select name=\"tact\" id='mod_tact'>\n\t\t\t\t\t\t<option value='approve'>{$this->lang->words['cpt_approve_f']}</option>\n\t\t\t\t\t\t<option value='pin'>{$this->lang->words['cpt_pin_f']}</option>\n\t\t\t\t\t\t<option value='unpin'>{$this->lang->words['cpt_unpin_f']}</option>\n\t\t\t\t\t\t<option value='open'>{$this->lang->words['cpt_open_f']}</option>\n\t\t\t\t\t\t<option value='close'>{$this->lang->words['cpt_close_f']}</option>\n\t\t\t\t\t\t<option value='move'>{$this->lang->words['cpt_move_f']}</option>\n\t\t\t\t\t\t<option value='merge'>{$this->lang->words['cpt_merge_f']}</option>\n\t\t\t\t\t\t<option value='delete'>{$this->lang->words['cpt_hide_f']}</option>\n\t\t\t\t\t\t<option value='sundelete'>{$this->lang->words['cpt_unhide_f']}</option>\n\t\t\t\t\t\t<option value='deletedo'>{$this->lang->words['cpt_delete_f']}</option>\n\t\t\t\t\t</select>&nbsp;\n\t\t\t\t\t<input type=\"submit\" name=\"gobutton\" value=\"{$this->lang->words['f_go']}\" class=\"input_submit alt\" id='mod_submit' />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t\t<script type='text/javascript'>\n\t\t\t\t/* Set return string */\n\t\t\t\t$('returnUrl').value = $('urlString').value;\n\t\t\t\t$('modform').observe('submit', ipb.forums.submitModForm);\n\t\t\t\t$('mod_tact').observe('change', ipb.forums.updateTopicModButton);\n\t\t\t</script>\n\t\t</div>\n\t</if>\n<else />\n\t<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.topic.js'></script>\n\t<script type=\"text/javascript\">\n\t\tipb.topic.inSection = 'searchview';\n\t</script>\n\t<if test=\"isAdmin:|:$this->memberData['g_is_supmod'] && $this->request['search_app_filters']['forums']['liveOrArchive'] != 'archive'\">\n\t<div id='topic_mod_2' class='moderation_bar rounded'>\n\t\t<form method=\"post\" id=\"modform\" name=\"modform\" action=\"{parse url=\"\" base=\"public\"}\">\n\t\t\t<fieldset>\n\t\t\t\t<input type=\"hidden\" name=\"app\" value=\"forums\" />\n\t \t\t\t<input type=\"hidden\" name=\"module\" value=\"moderate\" />\n\t \t\t\t<input type=\"hidden\" name=\"section\" value=\"moderate\" />\n\t \t\t\t<input type=\"hidden\" name=\"do\" value=\"postchoice\" />\n\t \t\t\t<input type=\"hidden\" name=\"auth_key\" value=\"{$this->member->form_hash}\" />\n\t \t\t\t<input type=\"hidden\" name=\"st\" value=\"{$this->request['st']}\" />\n\t \t\t\t<input type=\"hidden\" value=\"{$this->request['selectedpids']}\" name=\"selectedpidsJS\" id='selectedpidsJS' />\n\t\t\t\t<input type='hidden' name='fromSearch' value='1' />\n\t\t\t\t<input type='hidden' name='returnUrl' id='returnUrl' value='{$this->request['returnUrl']}' />\n\t\t\t\t<select name=\"tact\" class=\"input_select\" id='topic_moderation'>\n\t\t\t\t\t<option value='approve'>{$this->lang->words['cpt_approve']}</option>\n\t\t\t\t\t<option value='delete'>{$this->lang->words['cpt_hide']}</option>\n\t\t\t\t\t<option value='sundelete'>{$this->lang->words['cpt_undelete']}</option>\n\t\t\t\t\t<option value='deletedo'>{$this->lang->words['cpt_delete']}</option>\n\t\t\t\t\t<option value='merge'>{$this->lang->words['cpt_merge']}</option>\n\t\t\t\t\t<option value='split'>{$this->lang->words['cpt_split']}</option>\n\t\t\t\t\t<option value='move'>{$this->lang->words['cpt_move']}</option>\n\t\t\t\t</select>&nbsp;\n\t\t\t\t<input type=\"submit\" value=\"{$this->lang->words['jmp_go']}\" class=\"input_submit alt\" />\n\t\t\t</fieldset>\n\t\t</form>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\t/* Set return string */\n\t\t\t$('returnUrl').value = $('urlString').value;\n\t\t\t$('modform').observe('submit', ipb.topic.submitPostModeration );\n\t\t</script>\n\t</div>\n\t</if>\n\t<if test=\"disablelightbox:|:!$this->settings['disable_lightbox']\">\n\t\t{parse template=\"include_lightbox\" group=\"global\" params=\"\"}\n\t</if>\n</if>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "public function getForumManager() {\n\t\treturn $this -> forumManager;\n\t}", "public function articles()\n {\n return Board::where('news', 1)->first()->threads;\n }", "function forum_get_child_posts_fast($parent, $forum_id) {\n global $CFG;\n \n $query = \"\n SELECT \n p.id, \n p.subject, \n p.discussion, \n p.message, \n p.created, \n {$forum_id} AS forum,\n p.userid,\n d.groupid,\n u.firstname, \n u.lastname\n FROM \n {$CFG->prefix}forum_discussions d\n JOIN \n {$CFG->prefix}forum_posts p \n ON \n p.discussion = d.id\n JOIN \n {$CFG->prefix}user u \n ON \n p.userid = u.id\n WHERE \n p.parent = '{$parent}'\n ORDER BY \n p.created ASC\n \";\n return get_records_sql($query);\n}" ]
[ "0.6809902", "0.64836293", "0.62971747", "0.62333465", "0.6196451", "0.6077108", "0.6073764", "0.6012346", "0.5999543", "0.59736747", "0.59313697", "0.5922558", "0.59117043", "0.5878383", "0.5867455", "0.5851826", "0.5819603", "0.57968575", "0.5795073", "0.57663786", "0.5745191", "0.5718643", "0.5660524", "0.5625138", "0.56206757", "0.56160426", "0.56045943", "0.5590736", "0.5586715", "0.5566211" ]
0.7513412
0
Gets a string representation of this server
public function __toString() { return $this->host . ':' . $this->port; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function GetServerString() : STRING\r\n {\r\n switch(DRIVER)\r\n {\r\n case 'MySQL':\r\n return('mysql:host=' . HOST . ';dbname=' . DATABASE_NAME);\r\n default:\r\n return('mysql:host=' . HOST . ';dbname=' . DATABASE_NAME);\r\n }\r\n }", "public function __toString() {\n return \"[\".$this->getName().\"] \".$this->getIp().\":\".$this->getPort();\n }", "public function __toString() {\n return \"Host :\" . $this->host .\n \", Username :\" . $this->username .\n \", Password :\" . $this->password .\n \", Database :\" . $this->database;\n }", "public function getAmavisServerRepresentation() : string {\n return \"$this->name \" . $this->getAmavisServerEmailRepresentation();\n }", "public function toString()\n {\n return sprintf( '%s://%s:%s', $this->protocol, $this->ip, $this->port );\n }", "public function __tostring()\n {\n $res = __CLASS__ . \": [{$this->code}]: {$this->message}\";\n $res.= ': ' . $this->_storage->id . '\\n';\n return $res;\n }", "public function toString(): string\n {\n if ($this->isSingleHost()) {\n return $this->addrStr;\n } else {\n return $this->toCidrString();\n }\n }", "public function toString() {\n return sprintf(\n \"%s@(jndi= %s) {\\n\".\n \" [Home ]: %s\\n\".\n \" [Remote]: %s\\n\".\n \"}\",\n $this->getClassName(),\n $this->jndiName,\n xp::stringOf($this->interfaces[HOME_INTERFACE]),\n xp::stringOf($this->interfaces[REMOTE_INTERFACE])\n );\n }", "public function __toString()\r\n {\r\n return $this->scheme . '://' . $this->server . '/offering/' . $this->version . '/' . $this->offering .'/';\r\n }", "public function __tostring(){\n\t\treturn $this->_base.\" - \".$this->_password.\" - \".$this->_server.\" - \".$this->_usuario;\n\t}", "public function __toString()\n {\n $str = \"\\n---Remote Control---\\n\";\n for ($i=0; $i<=4; $i++) {\n $str .= \"\\nSlot[$i]\" . $this->onCommand[$i]->getName() . \" <===> \" . $this->offCommand[$i]->getName();\n }\n return $str;\n }", "public function __toString()\n\t{\n\t\treturn (string) $this->response;\n\t}", "public function toString()\n {\n return $this->cast('string');\n }", "public function toString(): string\n\t{\n\t\t$aPkt = unpack('C*',$this->getData());\n\t\t$sReturn = \"Header | Type : \".$this->getPacketType().\" Port : \".$this->getPort().\" Control : \".$this->iCb.\" Pad : \".$this->iPadding.\" Seq : \".$this->iSeq.\" | Body |\".implode(\":\",$aPkt).\" |\";\n\t\treturn $sReturn;\t\n\t}", "public function __toString()\n {\n if ($this->m_hostname && $this->m_community)\n {\n return implode(', ', snmpwalk($this->m_hostname, $this->m_community, null));\n } // if\n\n return \"\";\n }", "public function getServerInfo()\n {\n return $this->sendServerCommand(\"serverinfo\");\n }", "protected function getServer(string $key): string\n {\n return (true === isset($this->server[$key]))\n ? (string) $this->server[$key]\n : '';\n }", "public function toString()\n\t{\n\t\treturn (string) $this;\n\t}", "public function toString()\n\t{\n\t\treturn (string) $this;\n\t}", "public function __toString(): string\n {\n return sprintf('%s:%s', $this->getChannel(), $this->getPath());\n }", "public function __toString()\n {\n $domain = '';\n $domain .= $this->scheme ? $this->scheme . '://' : '';\n $domain .= $this->hostname;\n if ($this->port !== null) {\n switch ($this->scheme) {\n case 'http':\n $domain .= ($this->port !== 80 ? ':' . $this->port : '');\n break;\n case 'https':\n $domain .= ($this->port !== 443 ? ':' . $this->port : '');\n break;\n default:\n $domain .= (isset($this->port) ? ':' . $this->port : '');\n }\n }\n return $domain;\n }", "public function toString() {\n\n\n $data = \"Information client: <ul>\";\n\n $data .= \"<li>Nom: \".$this->name.\"</li>\";\n\n $data .= \"<li>Age: \".$this->age.\"</li>\";\n\n $data .= \"</ul>\";\n\n return $data;\n\n }", "public function __toString()\n {\n $headers = $this->headers();\n\n $buffer = [];\n foreach ($headers as $k => $v) {\n $buffer[] = $k . ': ' . $v;\n }\n\n return implode(\"\\t\", $buffer);\n }", "public function getServerName()\n {\n return $this->get(self::_SERVER_NAME);\n }", "public function __toString()\n {\n return $this->databaseName;\n }", "public function __toString(): string\n {\n return $this->getBody();\n }", "public function __toString()\n {\n return long2ip($this->ip);\n }", "public function GetServer()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_my_server;\n }", "public function toString() : string\n {\n return $this->address;\n }", "public function __toString(): string\n {\n $result = [];\n foreach ($this->headers as $name => $value) {\n $result[] = $name . ': ' . $value;\n }\n\n return join(\"\\r\\n\", $result);\n }" ]
[ "0.7205736", "0.71613693", "0.7022998", "0.69365484", "0.6842634", "0.665858", "0.6634126", "0.66328466", "0.6573421", "0.6537226", "0.6498204", "0.6468685", "0.6450126", "0.6450028", "0.6421601", "0.6346564", "0.634359", "0.63338494", "0.63338494", "0.63306314", "0.6305399", "0.62711793", "0.6268371", "0.62348974", "0.62197584", "0.6219571", "0.621932", "0.62189263", "0.62117535", "0.6197752" ]
0.7609525
0
Sets the log instance
public function setLog(Log $log) { $this->log = $log; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLogInstance(): void\n {\n $this->log_instance = QueryLogger::initializeQueryChainLog($this);\n }", "private function _setLog($log)\n {\n $this->log = $log;\n return $this;\n }", "protected static function configureInstance()\n\t{\n\t\t$logger = new Logger('Default');\n\t\t$logger->pushHandler(new StreamHandler(__DIR__.'/../../logs/app.log', Logger::DEBUG));\n\n\t\tself::$instance = $logger;\n\t}", "public static function set($logger)\n {\n self::$instance = $logger;\n }", "public function setLog(Applog $log)\n\t\t{\n\t\t\t$this->log = $log;\n\t\t}", "public function log($log) {\n //$this->log = $log;\n }", "public function setLogger(CsviHelperLog $log)\n\t{\n\t\t$this->log = $log;\n\t}", "public function setLog($log)\n {\n $this->log = $log;\n\n return $this;\n }", "private function set_log_type () {\n\t\t# check settings\n\t\t$this->log_type = $this->settings->log;\n\t}", "public function __construct(){\n Logger::configure('../../loggingconfiguration.xml');\n // Fetch a logger, it will inherit settings from the root logger\n $this->log = Logger::getLogger(__CLASS__);\n }", "protected function log()\n {\n\n $this->worker\n ->setInstance($this->instance);\n // If instance can be called\n if($this->worker->ping()) {\n $infos = $this->worker->getInfos();\n $createdAt = new \\DateTime();\n\n $log = $this->logManager->createNew();\n $log->setMemory($infos['Memory']['used_memory']);\n $log->setCpu($infos['CPU']['used_cpu_sys']);\n $log->setNbClients(sizeof($this->worker->getClients()));\n $log->setCreatedAt($createdAt);\n // Add log\n $this->instance->addLog($log);\n }\n }", "public function setLogger(LoggerInterface $log);", "function setLogger(&$logger) {\n\t\t$this->logger = $logger;\n\t}", "function __construct()\n {\n $this->mylog = new mylog;\n }", "public function __construct(Log $log)\n {\n $this->log = $log;\n }", "public function setLogger( &$logger )\n {\n $this->_logger = $logger;\n }", "public function setLogger(Logger $logger);", "public function setLoger($_loger){\n\t\t$this->_loger = $_loger;\n\n\t\treturn $this;\n\t}", "public final function withLog ()\n {\n\n $this->withLog = true;\n\n }", "function setLogFile($logFile)\n {\n $this->logFile = $logFile;\n }", "public function setLogger($logger){\n\t\t$this->_logger = $logger;\n\t}", "public function setLogger(LoggerInterface $logger)\n {\n $this->instances->setEntry('logger',$logger);\n }", "public function setLogger(Logger $logger)\n {\n $this->_logger = $logger;\n }", "public function set_logger( $logger ) {\n\t\t$this->logger = $logger;\n\t}", "function __construct() {\r\n\t\tparent::__construct();\r\n\t\t$this->log = Logger::getInstance();\r\n\t}", "public function setLogger(DocBlox_Core_Log $log = null)\n {\n foreach ($this->behaviours as $behaviour) {\n $behaviour->setLogger($log);\n }\n }", "public function __construct(){\n $this->clientLog = new Logger('client');\n $this->clientLog->pushHandler(new StreamHandler(storage_path('logs/client.log')), Logger::INFO);\n }", "public function setLogger($logger);", "public function __construct(Log $log)\n {\n parent::__construct();\n $this->log = $log;\n }", "public function __construct(Log $log)\n {\n parent::__construct();\n $this->log = $log;\n }" ]
[ "0.8322471", "0.7328089", "0.72294253", "0.7228605", "0.7155914", "0.7099329", "0.6887902", "0.68365806", "0.67171067", "0.6703447", "0.653512", "0.64418817", "0.64296293", "0.6427446", "0.64124346", "0.6409742", "0.63905984", "0.6385901", "0.63822573", "0.63462514", "0.62814", "0.6268196", "0.62680256", "0.6266203", "0.62659174", "0.6234488", "0.6218447", "0.6217831", "0.6214123", "0.6214123" ]
0.74368733
1
Gets the VCL of the provided configuration
public function getVcl($name) { return $this->execute('vcl.show ' . $name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadVclFromConfiguration($configuration, $name = null) {\n if (!$name) {\n $name = $this->generateConfigurationName();\n }\n\n $this->execute('vcl.inline ' . $name . \" << EOVCL\\n\" . $configuration . \"\\nEOVCL\");\n\n return $name;\n }", "public function getCLSc() {\n\t\treturn $this->clsc;\n\t}", "public function getVariantConfig();", "public static function GetDetectionBySystemConfig () {\n\t\treturn static::$detectionBySystemConfig;\n\t}", "public function getCLINICA()\r\n {\r\n return $this->CLINICA;\r\n }", "public function getCLSa() {\n\t\treturn $this->clsa;\n\t}", "abstract public function getKernel(): PlaisioKernel;", "public function getVclList() {\n $list = array();\n\n $response = $this->execute('vcl.list');\n\n $lines = explode(\"\\n\", $response);\n foreach ($lines as $line) {\n $line = trim($line);\n if (!$line) {\n continue;\n }\n\n $tokens = explode(' ', $line);\n\n $name = array_pop($tokens);\n\n $list[$name] = $tokens[0] == 'active';\n }\n\n return $list;\n }", "public static function getGlobalGVPC() {\n $configModel = new Configurations();\n return $configModel->get(\\Config::get('configurations.gvpc_key'));\n }", "public function useVcl($name) {\n $this->execute('vcl.use ' . $name);\n }", "function slcr_core_vc() {\n\treturn Slcr_Core_Vc::slcr_instance();\n}", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function loadComponent()\r\n {\r\n return $this->selectVersion($this->currentVersion);\r\n }", "public function getConfig() {\n $configFiles = [\n 4 => 'laravel-haml::config',\n 5 => 'laravel-haml',\n 6 => 'haml'\n ];\n\n\t\t$key = $configFiles[$this->version()];\n\t\treturn $this->app->make('config')->get($key);\n\t}", "function plex_config_get_current_version() {\n\treturn PLEX_CONFIG_CURRENT_VERSION;\n}", "public function config_get(){\n\t\treturn $this->fb->exec('dhcp.config_get');\n\t}", "public function loadVclFromFile($file, $name = null) {\n if (!$name) {\n $name = $this->generateConfigurationName();\n }\n\n $this->execute('vcl.load ' . $name . ' ' . $file);\n\n return $name;\n }", "abstract protected function getConfig();", "abstract public function getConfig();", "function getConfiguration() ;", "public function getCvv()\n {\n return $this->getParameter('cvv');\n }", "public static function get() { return static::$slimConfiguration; }", "public static function getConfiguration();" ]
[ "0.5744419", "0.5526279", "0.5361364", "0.51902497", "0.4949216", "0.49375418", "0.4930432", "0.4859281", "0.48358038", "0.4811929", "0.46900862", "0.46600547", "0.46600547", "0.46600547", "0.46600547", "0.46600547", "0.46600547", "0.46600547", "0.46600547", "0.4601317", "0.45955643", "0.4588665", "0.45666617", "0.45157686", "0.450026", "0.4496544", "0.44960007", "0.4480242", "0.44652027", "0.44107932" ]
0.60544956
0
Clears the last panic
public function clearPanic() { $this->execute('panic.clear'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_EXIT] = Down_ErrorInfo_Exit::noneed;\n }", "public function clear()\n {\n $this->log = [];\n }", "public function reset()\n {\n $this->values[self::_EXCAVATE] = null;\n }", "protected function clearError()\n {\n $this->lastError = null;\n }", "public function clearExceptions()\r\r\n {\r\r\n $this->exceptions = array();\r\r\n }", "public static function clear() : void\n {\n static::$stack = array();\n \n }", "private function clear_log()\n {\n if ($this->_log && is_array($this->_log)) {\n $this->_log = array();\n }\n }", "function error_clear_last(){\n\t// var_dump or anything else, as this will never be called because of the 0\n\tset_error_handler('var_dump', 0);\n\t@$error_clear_tmp523457901;\n\trestore_error_handler();\n\n\tvar_dump(error_get_last());\n}", "protected function clear() {}", "public function reset()\n {\n $this->values[self::_INFO] = null;\n }", "private function clearLog() {\n $this -> log = array();\n $this -> log[\"success\"] = array();\n $this -> log[\"failure\"] = array();\n }", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function reset()\n {\n $this->values[self::ERRMSG] = null;\n $this->values[self::RET] = null;\n }", "public function clearTempLog(): void\n {\n $this->tempLog = '';\n }", "function ClearError() \r\n{ \r\n$this->LastError = null; \r\n}", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_ADDR] = null;\n }", "function clear() {\n\t\txdebug_stop_code_coverage();\n\t}", "public function clear()\n {\n try {\n $this->imagick->clear();\n $this->imagick->destroy();\n } catch (Exception $e) {\n\n }\n }", "function clear() {}", "public function reset() {\n $this->values[self::ERR_NO] = null;\n $this->values[self::ERR_MSG] = null;\n $this->values[self::CONTENTS] = array();\n }", "function clear() {}", "public function clear() {\n $this->_errors = array();\n }", "public function reset() /*void*/\n {\n foreach(array_keys($_SESSION[self::KEY]) as $key)\n {\n unset($_SESSION[self::KEY][$key]);\n }\n $_SESSION[self::ERRORS] = array();\n $this->notice(null);\n }", "public function clear();", "public function clear();", "public function clear();", "public function clear();" ]
[ "0.629562", "0.62381667", "0.6087309", "0.6073643", "0.60643715", "0.6013155", "0.5992769", "0.5945287", "0.5941233", "0.5936783", "0.59355295", "0.5891133", "0.5891133", "0.5891133", "0.5891133", "0.58668864", "0.5859087", "0.58491504", "0.5827192", "0.5811038", "0.57933146", "0.57773775", "0.57672054", "0.5764329", "0.5761209", "0.57526904", "0.57454973", "0.57454973", "0.57454973", "0.57454973" ]
0.8144025
0
Collect node geolocation in background via Ajax
public function actionAjaxCollectGeo() { $lock = Yii::getAlias('@runtime') . DIRECTORY_SEPARATOR . 'geo.lock'; $response = ['status' => 'warning', 'msg' => $this->module::t('general', 'Geolocation collecting is already running.')]; if (!file_exists($lock)) { $console = new ConsoleRunner(['file' => '@app/yii']); $console->run('plugins/geomapping/run/get-geolocation'); $response = [ 'status' => 'success', 'msg' => $this->module::t('general', 'Node geolocation collecting started in background. See log for more info.') ]; } return Json::encode($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionAjaxRecollectGeo($location, $prepend_location, $node_id)\n {\n try {\n\n $model = new Geolocation();\n\n /** Save node location */\n $prepend_location = (!empty($prepend_location)) ? $prepend_location : null;\n $save_location = $model->saveNodeLocation($location, $prepend_location, $node_id);\n\n if ($save_location) {\n $response = ['status' => 'success', 'msg' => Yii::t('app', 'Action successfully finished')];\n }\n else if (is_null($save_location)) {\n $response = [\n 'status' => 'warning',\n 'msg' => $this->module::t('general', 'Google API cannot find given address {0}', $model->prepareNodeLocation($location, $prepend_location))\n ];\n }\n else {\n $response = ['status' => 'error', 'msg' => Yii::t('app', 'An error occurred while processing your request')];\n }\n\n } catch (\\Exception $e) {\n $response = ['status' => 'error', 'msg' => $e->getMessage()];\n }\n\n return Json::encode($response);\n }", "private function updateGeoCoords()\n\t{\n\t\t// $this->attributes contains payload of the session\n\t\t// $this->handler->get_table_row() contains extended Row's field like IP and Platform\n\t\t$row = $this->handler->get_table_row();\n\t\t$current_ip = PlatformDetector::getClientIp();\n\n\t\t// define the flag for new re-detection\n\t\t// if no coordinates is set\n\t\t$should_recheck_coords = !isset($this->attributes['geo_coords']);\n\t\t// or if IP address was changed\n\t\t$should_recheck_coords |= $row && $row['ip_address'] != $current_ip;\n\n\t\tif ($should_recheck_coords) {\n\t\t\t//Log::info('Recheck GEO coords for session');\n\t\t\t// we need to update geo coordinates\n\t\t\t$coords = GeoIPLib::get_lat_lon($current_ip);\n\t\t\t$this->attributes['geo_coords'] = [\n\t\t\t\t'latitude' => $coords[0],\n\t\t\t\t'longitude' => $coords[1],\n\t\t\t];\n\t\t}\n\n\t}", "function venture_geo_process_geocodes() {\n $geocoded = false;\n \n $query = \"SELECT nid FROM {content_type_profile} WHERE LENGTH(IFNULL(field_location_value, '')) = 0\";\n $result = db_query($query);\n \n while ($row = db_fetch_object($result)) {\n $profile = node_load($row->nid);\n $city = $profile->field_city[0]['value'];\n $state = $profile->field_state[0]['value'];\n $country = $profile->field_country[0]['value'];\n \n $geo_location = $city . ',' . $state . ',' . $country;\n $geo_query = array('query' => $geo_location, 'maxRows' => 1);\n $geo_result = geonames_query('search', $geo_query);\n \n $location = 'invalid';\n \n if (!$geo_result) {\n watchdog('venture', \"Unable to geocode $location\");\n continue;\n }\n else if ($geo_result->results) {\n $geocode = $geo_result->results[0];\n $location = $geocode['name'] . '|' . $geocode['lat'] . '|' . $geocode['lng'];\n $geocoded = true;\n }\n \n $profile->field_location[0]['value'] = $location;\n node_save($profile);\n }\n \n return $geocoded;\n}", "function geolocate($address)\r\n\t{\r\n\t\t$lat = 0;\r\n\t\t$lng = 0;\r\n\t\t\r\n\t\t$data_location = \"http://maps.google.com/maps/api/geocode/json?address=\".str_replace(\" \", \"+\", $address).\"&sensor=false\";\r\n\t\t\r\n\t\tif ($this->region!=\"\" && strlen($this->region)==2) { $data_location .= \"&region=\".$this->region; }\r\n\t\t$data = file_get_contents($data_location);\r\n\t\tusleep(200000);\r\n\t\t\r\n\t\t// turn this on to see if we are being blocked\r\n\t\t// echo $data;\r\n\t\t\r\n\t\t$data = json_decode($data);\r\n\t\t\r\n\t\tif ($data->status==\"OK\") {\r\n\t\t\t$lat = $data->results[0]->geometry->location->lat;\r\n\t\t\t$lng = $data->results[0]->geometry->location->lng;\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate lat/long coordinates\r\n\t\t$coords['lat'] = $lat;\r\n\t\t$coords['lng'] = $lng;\r\n\t\t\r\n\t\treturn $coords;\r\n\t}", "function getLocation();", "public function gr_traceroute_ajax_request()\n\t{\n\t\t$response = '';\n\t\tif (preg_match(\"/^win.*/i\", PHP_OS))\n\t\t{\n\t\t\texec('tracert ' . $this->traceroute_host, $out, $code);\n\t\t}\n\t\telse\n\t\t{\n\t\t\texec('traceroute -m15 ' . $this->traceroute_host . ' 2>&1', $out, $code);\n\t\t}\n\t\tif ($code && is_array($out))\n\t\t{\n\t\t\t$response = __('An error occurred while trying to traceroute: ', 'Gr_Integration') . join(\"\\n\", $out);\n\t\t}\n\t\tif ( !empty($out))\n\t\t{\n\t\t\tforeach ($out as $line)\n\t\t\t{\n\t\t\t\t$response .= $line . \"<br/>\";\n\t\t\t}\n\t\t}\n\t\t$response = json_encode(array('success' => $response));\n\t\theader(\"Content-Type: application/json\");\n\t\techo $response;\n\t\texit;\n\t}", "public function get_locations($nodes);", "private function getLocation() {\n $location = false;\n \t$result = new StdClass();\n \t// $result->location = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->nearest = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->location = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $this->coordinates->latitude . ',' . $this->coordinates->longitude . '&sensor=false';\n\n \t$result = json_decode($this->getUrlContents($result->location));\n \t// $result->nearest = unserialize($this->getUrlContents($result->nearest));\n\n $location = $this->validateLocation($result);\n\n if(is_array($location))\n \t $location = $this->filterLocation($location);\n }", "function getLocation($xml){\n\t$latitude = $xml->result->geometry->location->lat;\n $longitude = $xml->result->geometry->location->lng;\n $location = array(\"latitude\" => $latitude, \"longitude\" => $longitude);\n return ($location);\n}", "public function _before_index(){\n// $ip = get_client_ip();\n// $res = $ip_class->getlocation('113.102.162.102');\n// print_r($res);\n \n \n }", "private function get_json_geo_data()\n {\n $response = false;\n if ($this->ipaddress != 'UNKNOWN') {\n foreach (self::$geo_service_url as $key => $url) {\n $response = wp_remote_get($url . $this->ipaddress);\n if (is_array($response) && array_key_exists('region_code', json_decode($response['body']))) {\n continue;\n }\n }\n }\n\n if (is_array($response)) {\n $this->body = json_decode($response['body']);\n } else {\n $this->body = false;\n }\n }", "function _get_cloudflare_geolocation() {\n\t\treturn IMFORZA_Utils::get_cloudflare_geolocation();\n\t}", "function get_lat_long($address)\r\n{\t\r\n\t//sleep(1);\r\n $address = str_replace(\" \", \"+\", $address);\r\n $json = file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=$region\");\r\n $json = json_decode($json);\r\n\t// echo \"<pre>\"; print_r($json); \r\n\r\n $lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n $long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\r\n return $lat.','.$long;\r\n}", "public function executeAjaxGetLocation($request)\n {\n $this->getResponse()->setContentType('application/json');\n $org = $request->getParameter(\"organization\");\n $result = array();\n \n if ($request->isXmlHttpRequest()) {\n $locationRep = new LocationRepository();\n $locations = $locationRep->getLocationByOrg($org);\n\n if (is_object($locations)) {\n foreach ($locations as $location) {\n array_push($result, $location->getLocation());\n }\n }\n }\n\n $data_json = json_encode($result);\n return $this->renderText($data_json);\n }", "function updateAllLocations () {\n //updateFacebookCurrentCity();\n //updateOkCupidCurrentCity();\n }", "public function action_index()\n\t{\n\t\t// Called every minute\n\t\tif ($this->modules['geocoded_addresses'])\n\t\t{\n\t\t\t$requests = Jelly::select('address_geocode_request')->where('status', '=', 'queued')->limit(10)->execute();\n\t\t\tforeach ($requests as $request)\n\t\t\t{\n\t\t\t\t$request->process();\n\t\t\t}\n\t\t}\n\t\texit();\n\t}", "function whereabouts_addmap_fetch_location_go() {\n\n // Get auth code\n\t$auth_code = get_option( 'whereabouts_swarm_auth_code' );\n\n // Check if file path is set and exists\n if ( isset( $auth_code ) AND ! empty( $auth_code ) ) {\n\n\t\t$url = 'https://api.foursquare.com/v2/users/self/checkins?oauth_token='.$auth_code.'&v=20140806&locale=en&limit=1';\n\n\t\t$response = wp_remote_get( $url );\n\n\t\tif ( is_wp_error( $response ) ) {\n\n\t\t\t$error_messages = $response->get_error_messages();\n\t\t\tforeach( $error_messages as $message ) {\n\t\t\t\techo '<span class=\"error\">' . implode( $error_messages, '<br />' ) . '<br />Maybe the <a href=\"http://where.abouts.io/faq/\">FAQs</a> are helpful?</span>';\n\t\t\t}\n\n\t\t}\n\t\telse {\n \n \t$obj = json_decode( $response['body'] );\n\n\t\t\tif ( isset( $obj->meta->code ) AND $obj->meta->code == 200 ) {\n\n\t\t\t\t$current_location = $obj->response->checkins->items[0];\n\n\t\t\t\tupdate_option( 'whereabouts_swarm_current_location', $current_location );\n\n\t\t\t\treturn '<span class=\"updated\">' . __( 'You current location was updated successfully.', 'whereabouts-swarm' ) . '</span>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn '<span class=\"error\">' . __( '<strong>Error:</strong> The data received from Swarm could not be processed. Please check our <a href=\"https://where.abouts.io/faq\">FAQs</a> for details. ', 'whereabouts-swarm' ) . '</span>';\n\t\t\t}\n\t\t}\n\t}\n}", "function ip_data()\n {\n if(!$this->input->is_ajax_request()){\n $this->session->set_userdata('timestamp', time());\n $user_data = $this->session->userdata('surfer_info');\n $ip = $_SERVER['REMOTE_ADDR'];\n if (!$user_data) {\n if ($_SERVER['HTTP_HOST'] !== 'localhost') {\n $ip_data = file_get_contents(\"http://ip-api.com/json/\" . $ip);\n $this->session->set_userdata('surfer_info', $ip_data);\n }\n }\n }\n }", "function rec_regenerate_coordinates() {\n\n\tif( ! isset( $_GET['coord_debug'] ) ) {\n\t\treturn;\n\t}\n\n\t$posts = new WP_Query(\n\t\tarray(\n\t\t\t'post_type'\t\t=>\tepl_get_core_post_types(),\n\t\t\t'post_status'\t=>\t'any',\n\t\t\t'posts_per_page' =>\t-1,\n\t\t\t'meta_query'\t=>\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'key'\t\t=>\t'property_address_coordinates',\n\t\t\t\t\t'value'\t\t=>\tarray(\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t','\n\t\t\t\t\t),\n\t\t\t\t\t'compare'\t=>\t'IN'\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n\twhile( $posts->have_posts() ) {\n\t\t$posts->the_post();\n\t\t$coord = get_property_meta( 'property_address_coordinates' );\n\t\t\n\t\t$query_address = epl_property_get_the_full_address();\n\t\t$query_address = trim( $query_address );\n\n\t\tif( $query_address != ',' ) {\n\t\n\t\t\t$googleapiurl = \"https://maps.google.com/maps/api/geocode/json?address=$query_address&sensor=false\";\n\t if( epl_get_option('epl_google_api_key') != '' ) {\n\t $googleapiurl = $googleapiurl.'&key='.epl_get_option('epl_google_api_key');\n\t }\n\n\t $geo_response = wp_remote_get( $googleapiurl );\n\t $geocode = $geo_response['body'];\n\t $output = json_decode($geocode);\n\t /** if address is validated & google returned response **/\n\t if( !empty($output->results) && $output->status == 'OK' ) {\n\n\t $lat = $output->results[0]->geometry->location->lat;\n\t $long = $output->results[0]->geometry->location->lng;\n\t $coord = $lat.','.$long;\n\n\t update_post_meta( get_the_ID(), 'property_address_coordinates', $coord);\n\t update_post_meta( get_the_ID(), 'property_address_display', 'yes');\n\t }\n }\n\t}\n}", "public static function updateUserLocation() {\r\n $debug = \\Drupal::config('smart_ip.settings')->get('debug_mode');\r\n if (!$debug) {\r\n $ip = \\Drupal::request()->getClientIp();\r\n $smartIpSession = self::getSession('smart_ip');\r\n if (!isset($smartIpSession['location']['ipAddress']) || $smartIpSession['location']['ipAddress'] != $ip) {\r\n $result = self::query();\r\n self::userLocationFallback($result);\r\n /** @var \\Drupal\\smart_ip\\SmartIpLocation $location */\r\n $location = \\Drupal::service('smart_ip.smart_ip_location');\r\n $location->setData($result);\r\n $location->save();\r\n }\r\n }\r\n }", "function location($gps){\n\tglobal $api;\n\t$lat = $gps['lat'];\n\t$lon = $gps['lon'];\n\t$endpoint = \"https://us1.locationiq.com/v1/reverse.php?key=$api&lat=$lat&lon=$lon&format=json\";\n\techo \"https://www.google.com/maps/search/?q=$lat,$lon\\n\";\n\treturn file_get_contents($endpoint);\n}", "private function getLocation() {\n }", "function getLocationByIp($data)\n\t{\n\t\t$passArray = array();\n\t\t\n\t\t$ipAddress = $data['ipAddress'];\n\t\t$ipResult = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ipAddress));\n\t\tif(sizeof($ipResult)>0)\n\t\t{\n\t\t\t$status =SUCCESS;\n\t\t\t$message = MESSAGE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$status =FAIL;\n\t\t\t$message = ERRORMESSAGE;\n\t\t}\t\t\n\t\t$response = array(\n\t\t\t\t\t\t\t\"Status\" => $status,\n\t\t\t\t\t\t\t\"Message\"=> $message,\n\t\t\t\t\t\t\t\"Result\" =>$ipResult\n\t\t\t\t\t\t);\n\n\t\treturn $response;\n\t}", "public function getLocation($data) {\n $query = $this->con->prepare(\"SELECT * FROM `location_requests` WHERE id = ?\");\n $query->bind_param('d', $data['id']);\n $query->execute();\n //Getting the student result array\n $result = $query->get_result()->fetch_assoc();\n $query->close();\n if($result['permit_status'] == 'rejected') {\n return 'safe';\n } else {\n if($result['permit_status'] == 'granted' || $result['time'] < strtotime('-30 seconds')) {\n $statement = $this->con->prepare(\"SELECT `location`, `time` FROM `location_details` WHERE (user_id = ? AND time > ?)\");\n $time_lower = strtotime('-6 hours');\n $statement->bind_param('sd', $result['user_id'], $time_lower);\n $statement->execute();\n //Getting the student result array\n $information = $statement->get_result();\n $result_object = array();\n $flag = False;\n while ( $row = $information->fetch_assoc()) {\n $flag = true;\n array_push($result_object, $row);\n }\n $statement->close();\n \n $searchGCM = $this->con->prepare(\"SELECT gcm FROM `user_gcm_details` WHERE user_id = ?\");\n // echo $result['user_id'];\n $searchGCM->bind_param('s', $result['user_id']);\n $searchGCM->execute();\n $resultGCM = $searchGCM->get_result()->fetch_assoc();\n $searchGCM->close();\n if ($flag) {\n sendNotification($resultGCM['gcm'], $result['asker_id'], True);\n }\n return $result_object;\n } else {\n return 'wait';\n }\n }\n }", "function ping(){\n\t\t$.ajax({url:\"handleajax.php\", success:function(result)\n\t\t{\n\t\t\tstat=false;\n\t\t\tvar obj=$.parseJSON(result);\n\t\t\tvar len=obj.length;\n\t\t\tvar i=0;\n\t\t\twhile(i<len)\n\t\t\t{\n\t\t\t\tvar lat=obj[i].lat;\n\t\t\t\tvar lon=obj[i].lon;\n\t\t\t\tvar status=\"\";\n\t\t\t\tstatus=space_status(obj[i].is_occupied,obj[i].is_reserved);\n\t\t\t\tvar google_latlon= new google.maps.LatLng(lat,lon);\n\t\t\t\tvar nmarker = new google.maps.Marker(\n\t\t\t\t{\n\t\t\t\t\tposition: google_latlon,\n\t\t\t\t\ttitle: \"Here you live!\",\n\t\t\t\t\ticon: status\n\t\t\t\t});\n\t\t\t\tnewmarkers.push(nmarker);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\t// For the first time oldmarkers is 0\n\t\t\t// This runs for the first time\n\t\t\tif(oldmarkers.length<=0)\n\t\t\t{\n\t\t\t\tfor(b=0;b<newmarkers.length;b++)\n\t\t\t\t{\n\t\t\t\t\tnewmarkers[b].setMap(map);\n\t\t\t\t\tif(newmarkers[b].icon==\"vacant.png\"){\n\t\t\t\t\tgoogle.maps.event.addListener(newmarkers[b],'click',function(){popup.open(map,this)});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toldmarkers=newmarkers;\n\t\t\t\tnewmarkers=[];\n\t\t\t}\n\t\t\t// For rest of the loop oldmarkers will have some objects\n\t\t\t// This is when comparision needed\n\t\t\telse if(oldmarkers.length>0)\n\t\t\t{\n\t\t\tvar rm_ind=[];\n\t\t\tvar map_rm_ind=[];\n\t\t\t\tfor(q=0;q<oldmarkers.length;q++)\n\t\t\t\t{\n\t\t\t\t\tstat=false;\n\t\t\t\t\tfor(w=0;w<newmarkers.length;w++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar chk=oldmarkers[q].getPosition().equals(newmarkers[w].getPosition());\n\t\t\t\t\t\tstat |=chk;\n\t\t\t\t\t\tif(chk)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toldmarkers[q].setIcon(newmarkers[w].icon);\n\t\t\t\t\t\t\t// Save these indices in array to remove at end of the loop\n\t\t\t\t\t\t\trm_ind.push(w);\n\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(stat==false | stat==0)\n\t\t\t\t\t{\n\t\t\t\t\t// Store the indices to remove them from map\n\t\t\t\t\tmap_rm_ind.push(q);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//remove obsolete markers from map\n\t\t\t\tfor(u=0;u<map_rm_ind.length;u++)\n\t\t\t\t{\n\t\t\t\t\toldmarkers[u].setMap(null);\n\t\t\t\t\toldmarkers[u]=null;\n\t\t\t\t\toldmarkers.splice(u,1);\n\t\t\t\t}\n\t\t\t\tmap_rm_ind=[];\n\t\t\t\t// remove existing markers from newmarkers\n\t\t\t\tfor(f=0;f<rm_ind.length;f++)\n\t\t\t\t{\n\t\t\t\t\tnewmarkers.splice(f,1);\n\t\t\t\t}\n\t\t\t\trm_ind=[];\n\t\t\t\tfor(r=0;r<newmarkers.length;r++)\n\t\t\t\t{\n\t\t\t\t\tnewmarkers[r].setMap(map);\n\t\t\t\t\tif(newmarkers[r].icon==\"vacant.png\"){\n\t\t\t\t\tgoogle.maps.event.addListener(newmarkers[r],'click',function(){popup.open(map,this)});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toldmarkers=oldmarkers.concat(newmarkers);\n\t\t\t\tnewmarkers=[];\n\t\t\t}\n\t\t\t\t\n\t}\n\t});\n\t}", "protected function collectSessionData() {\n\n\t\t$time_started = time();\n\t\t$time_ended = $time_started;\n\n\t\t$user_guid = elgg_get_logged_in_user_guid();\n\n\t\t$ip_address = $this->getIpAddress();\n\n\t\t$geolite = elgg_get_config('geolite_db');\n\t\tif (file_exists($geolite)) {\n\t\t\t$reader = new Reader($geolite);\n\t\t\t$geoip = $reader->get($ip_address);\n\t\t} else {\n\t\t\t$geoip = [];\n\t\t}\n\n\t\t$city = '';\n\t\tif (!empty($geoip['city']['names']['en'])) {\n\t\t\t$city = $geoip['city']['names']['en'];\n\t\t}\n\n\t\t$state = '';\n\t\tif (!empty($geoip['subdivisions'])) {\n\t\t\t$state = array_shift($geoip['subdivisions']);\n\t\t\tif (!empty($state['names']['en'])) {\n\t\t\t\t$state = $state['names']['en'];\n\t\t\t}\n\t\t}\n\n\t\t$country = '';\n\t\tif (!empty($geoip['country']['iso_code'])) {\n\t\t\t$country = $geoip['country']['iso_code'];\n\t\t}\n\n\t\t$latitude = '';\n\t\tif (!empty($geoip['location']['latitude'])) {\n\t\t\t$latitude = $geoip['location']['latitude'];\n\t\t}\n\n\t\t$longitude = '';\n\t\tif (!empty($geoip['location']['longitude'])) {\n\t\t\t$longitude = $geoip['location']['longitude'];\n\t\t}\n\n\t\t$timezone = '';\n\t\tif (!empty($geoip['location']['time_zone'])) {\n\t\t\t$timezone = $geoip['location']['time_zone'];\n\t\t}\n\n\t\treturn [\n\t\t\t'user_guid' => $user_guid,\n\t\t\t'time_started' => $time_started,\n\t\t\t'time_ended' => $time_ended,\n\t\t\t'ip_address' => $ip_address,\n\t\t\t'city' => $city,\n\t\t\t'state' => $state,\n\t\t\t'country' => $country,\n\t\t\t'latitude' => $latitude,\n\t\t\t'longitude' => $longitude,\n\t\t\t'timezone' => $timezone,\n\t\t];\n\t}", "public function actionProximitycatlist($latitude, $longitude, $radius, $kind)\n {\n \n // clean term\n //$term = str_replace(',', '', $term);\n //$term = str_replace(' ', '', $term);\n //$term = str_replace(' ', '', $term);\n\t\n\t$url = \"http://ec2-54-204-2-189.compute-1.amazonaws.com/api/nearby\";\n\t$params = array('latitude' => $latitude, 'longitude' => $longitude, 'radius' => $radius, 'kind' => $kind);\n\t// Update URL to container Query String of Paramaters \n\t$url .= '?' . http_build_query($params);\n\t\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t$json = curl_exec($curl);\n\tcurl_close($curl);\n\t\t\n\t$return_array = json_decode($json);\n\t\t\n $location_service_rows = array(); \n \n\tif ($return_array) {\n $location_service_rows = $return_array->message->rows;\n\t}\n\t\t\n // Did we get some results?\n if(empty($location_service_rows)) {\n // No\n $this->_sendResponse(200, \n sprintf('No items where found.') );\n } else {\n // Prepare response\n $rows = array();\n foreach($location_service_rows as $row) {\n $id = $row->id;\n $name = $row->name;\n $address = $row->address->address;\n $address_extended = $row->address->address_extended;\n $po_box = $row->address->po_box;\n $locality = $row->address->locality;\n $region = $row->address->region;\n $post_town = $row->address->post_town;\n $admin_region = $row->address->admin_region;\n $postcode = $row->address->postcode;\n $country = $row->address->country;\n $tel = $row->address->tel;\n $fax = $row->address->fax;\n $neighbourhood = $row->address->neighbourhood;\n $website = $row->website;\n $email = $row->email;\n $category_ids = $row->category_ids;\n\t\t$category_labels = $row->category_labels;\n $status = $row->status;\n $chain_name = $row->chain_name;\n $chain_id = $row->chain_id;\n $row_longitude = $row->longitude;\n $row_latitude = $row->latitude;\n $abslongitude = $row->abslongitude;\n $abslatitude = $row->abslatitude;\n $distance = $row->distance;\n \n \n //$terms_array = explode(' ',$terms);\n //$match_count = 0;\n //foreach ($terms_array as $term) {\n //if(stripos($name, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n //if(stripos($category_labels, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n $match_count = 1;\n //}\n //$term_match_count = array('term_match_count' => $match_count);\n //array_push($row, $term_match_count);\n //$row['term_match_count'] = $match_count;\n $new_row = array(\n 'id' => $id,\n 'name' => $name,\n 'address' => $address,\n 'address_extended' => $address_extended,\n 'po_box' => $po_box,\n 'locality' => $locality,\n 'region' => $region,\n 'post_town' => $post_town,\n 'admin_region' => $admin_region,\n 'postcode' => $postcode,\n 'country' => $country,\n 'tel' => $tel,\n 'fax' => $fax,\n 'neighbourhood' => $neighbourhood,\n 'website' => $website,\n 'email' => $email,\n 'category_ids' => $category_ids,\n 'category_labels' => $category_labels,\n 'status' => $status,\n 'chain_name' => $chain_name,\n 'chain_id' => $chain_id,\n 'longitude' => $row_longitude,\n 'latitude' => $row_latitude,\n 'abslongitude' => $abslongitude,\n 'abslatitude' => $abslatitude,\n 'distance' => $distance,\n 'term_match_count' => $match_count\n );\n //if ($match_count > 0) {\n $rows[] = $new_row;\n //}\n } // end foreach location service row\n // Send the response\n $this->_sendResponse(200, CJSON::encode($rows));\n }\n }", "function plg_ipData($pro) {\r\n global $lib;\r\n $re = \"\";\r\n\r\n\r\n$lib = new Libs;\r\n\r\n\r\n\r\n\r\n\r\n if (isset($_GET['site'])) {\r\n $re = '';\r\n } else {\r\n\r\n\r\n $IP = $_SERVER['REMOTE_ADDR'];\r\n // $tt = file_get_contents('http://geoip.maxmind.com/a?l=hVWzBFybLR8f&i=' . $IP);\r\n\r\n $tt = \"EG\";\r\n // echo $lib->util->cities->urlConvert($tt);\r\n\r\n \r\n\r\n if (!isset($_GET['alias'])) {\r\n $re = ' <script>window.location = \\'/site/' . $lib->util->cities->urlConvert($tt) . '/\\'</script>';\r\n } else {\r\n $url = curPageURL();\r\n $u = explode($_GET['alias'], $url);\r\n\r\n $re = ' <script>window.location = \\'/site/' . $lib->util->cities->urlConvert($tt) . \"/\" . $_GET['alias'] . $u[1] . '\\'</script>';\r\n }\r\n }\r\n return $re;\r\n}", "function ip_data()\n {\n if(!$this->input->is_ajax_request()){\n $this->session->set_userdata('timestamp', time());\n $user_data = $this->session->userdata('surfer_info');\n $ip = $_SERVER['REMOTE_ADDR'];\n if (!$user_data) {\n if ($_SERVER['HTTP_HOST'] !== 'localhost' OR $_SERVER['HTTP_HOST'] !== 'ebuymazon.dev') {\n $ip_data = file_get_contents(\"http://ip-api.com/json/\" . $ip);\n $this->session->set_userdata('surfer_info', $ip_data);\n }\n }\n }\n }", "function amap_ma_geocode_location($location) {\n $coords = array();\n $google_api_key = trim(elgg_get_plugin_setting('google_api_key', AMAP_MA_PLUGIN_ID));\n $mapquest_api_key = trim(elgg_get_plugin_setting('mapquest_api_key', AMAP_MA_PLUGIN_ID));\n\n $geocoder = new \\Geocoder\\ProviderAggregator();\n $adapter = new \\Ivory\\HttpAdapter\\CurlHttpAdapter();\n $chain = new \\Geocoder\\Provider\\Chain([\n new \\Geocoder\\Provider\\GoogleMaps($adapter, $google_api_key),\n new \\Geocoder\\Provider\\MapQuest($adapter, $mapquest_api_key),\n ]);\n\n $geocoder->registerProvider($chain);\n\n try {\n $geocode = $geocoder->geocode($location);\n } catch (Exception $e) {\n error_log('amap_maps_api --------->' . $e->getMessage());\n return false;\n }\n\n if ($geocode->count() > 0) {\n $coords['lat'] = $geocode->first()->getLatitude();\n $coords['long'] = $geocode->first()->getLongitude();\n return $coords;\n }\n\n return false;\n}" ]
[ "0.6518053", "0.5714243", "0.57016975", "0.55131465", "0.5488123", "0.5484338", "0.53941697", "0.5384275", "0.53001124", "0.5276162", "0.52747524", "0.5263827", "0.522112", "0.52108216", "0.5209827", "0.51691926", "0.51688325", "0.5131373", "0.5115591", "0.5107836", "0.5107835", "0.50913125", "0.5089501", "0.5074535", "0.5060805", "0.5050545", "0.5041478", "0.5009052", "0.50071937", "0.50040245" ]
0.8112957
0
Load geolocation info via Ajax
public function actionAjaxGetGeoInfo($id) { /** Do not load JqueryAsset in info view */ Yii::$app->assetManager->bundles['yii\web\JqueryAsset'] = false; return $this->renderAjax('_info', [ 'data' => Geolocation::find()->where(['id' => $id])->one() ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionAjaxCollectGeo()\n {\n $lock = Yii::getAlias('@runtime') . DIRECTORY_SEPARATOR . 'geo.lock';\n $response = ['status' => 'warning', 'msg' => $this->module::t('general', 'Geolocation collecting is already running.')];\n\n if (!file_exists($lock)) {\n $console = new ConsoleRunner(['file' => '@app/yii']);\n $console->run('plugins/geomapping/run/get-geolocation');\n $response = [\n 'status' => 'success',\n 'msg' => $this->module::t('general', 'Node geolocation collecting started in background. See log for more info.')\n ];\n }\n\n return Json::encode($response);\n }", "function geocode() {\n if ( ! $this->input->is_ajax_request() || ! $this->auth->is_login()) {\n return redirect(config_item('site_url'));\n }\n \n $latitude = filter($this->input->get('lat'), 'float', 20);\n $longitude = filter($this->input->get('lon'), 'float', 20);\n\n if (empty($latitude) || empty($longitude)) {\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n\n $this->load->library('Location');\n \n $geocode = $this->location->get_address($latitude, $longitude);\n\n if ( ! empty($geocode) && is_array($geocode)) {\n return $this->output->set_output(json_encode(array(\n 'code' => 'luck',\n 'address' => $geocode['address']\n )));\n }\n\n log_write(LOG_WARNING, 'Yandex geocode error, USER: ' . $this->auth->get_user_id(), __METHOD__);\n\n return $this->output->set_output(json_encode(array(\n 'code' => 'error',\n 'address' => 'Сервер определения местоположения недоступен. Попробуйте позже.'\n )));\n }", "public function getPostalCodeFromCoords() {\r\n\t\t$this->autoRender = false;\r\n\r\n\t\t$this->layout = 'ajax';\r\n\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$response = $this->StreetAddress->getPostalCodeFromCoords(\r\n\t\t\t$this->request->data('latitude'),\r\n\t\t\t$this->request->data('longitude')\r\n\t\t);\r\n\r\n\t\tif ($response) {\r\n\t\t\t$this->response->body(json_encode($response));\r\n\t\t} else {\r\n\t\t\t$this->response->body(false);\r\n\t\t}\r\n\r\n\r\n\t}", "public function show_map() {\n $restaurant_location = Restaurant::where('id',$_POST['restaurant_id'])->first();\n $html = view('admin.restaurants.map-address')->with('restaurant_location', $restaurant_location)->render();\n if ($html) {\n $res_array = array(\n 'msg' => 'success',\n 'response' => $html,\n );\n echo json_encode($res_array);\n exit;\n } \n }", "function getLocation();", "public function getUserLocation() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_note = 'HTTP_CLIENT_IP='.$_SERVER['HTTP_CLIENT_IP'];\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_note = 'HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR'];\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip_note = 'REMOTE_ADDR='.$_SERVER['REMOTE_ADDR'];\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $ip = '117.20.119.245';\n $loc = file_get_contents(\"http://ipinfo.io/\".$ip.\"/loc\");\n\n if($loc) {\n $array_loc = explode(',', $loc);\n return ['lat'=> ((isset($array_loc[0]))? $array_loc[0]:'') ,'lon'=> ((isset($array_loc[1]))? $array_loc[1]:'')];\n }\n\n return ['lat'=>'','lon'=>''];\n\n }", "private function getLocation() {\n $location = false;\n \t$result = new StdClass();\n \t// $result->location = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->nearest = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->location = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $this->coordinates->latitude . ',' . $this->coordinates->longitude . '&sensor=false';\n\n \t$result = json_decode($this->getUrlContents($result->location));\n \t// $result->nearest = unserialize($this->getUrlContents($result->nearest));\n\n $location = $this->validateLocation($result);\n\n if(is_array($location))\n \t $location = $this->filterLocation($location);\n }", "private function get_json_geo_data()\n {\n $response = false;\n if ($this->ipaddress != 'UNKNOWN') {\n foreach (self::$geo_service_url as $key => $url) {\n $response = wp_remote_get($url . $this->ipaddress);\n if (is_array($response) && array_key_exists('region_code', json_decode($response['body']))) {\n continue;\n }\n }\n }\n\n if (is_array($response)) {\n $this->body = json_decode($response['body']);\n } else {\n $this->body = false;\n }\n }", "public function executeAjaxGetLocation($request)\n {\n $this->getResponse()->setContentType('application/json');\n $org = $request->getParameter(\"organization\");\n $result = array();\n \n if ($request->isXmlHttpRequest()) {\n $locationRep = new LocationRepository();\n $locations = $locationRep->getLocationByOrg($org);\n\n if (is_object($locations)) {\n foreach ($locations as $location) {\n array_push($result, $location->getLocation());\n }\n }\n }\n\n $data_json = json_encode($result);\n return $this->renderText($data_json);\n }", "public function actionAjaxRecollectGeo($location, $prepend_location, $node_id)\n {\n try {\n\n $model = new Geolocation();\n\n /** Save node location */\n $prepend_location = (!empty($prepend_location)) ? $prepend_location : null;\n $save_location = $model->saveNodeLocation($location, $prepend_location, $node_id);\n\n if ($save_location) {\n $response = ['status' => 'success', 'msg' => Yii::t('app', 'Action successfully finished')];\n }\n else if (is_null($save_location)) {\n $response = [\n 'status' => 'warning',\n 'msg' => $this->module::t('general', 'Google API cannot find given address {0}', $model->prepareNodeLocation($location, $prepend_location))\n ];\n }\n else {\n $response = ['status' => 'error', 'msg' => Yii::t('app', 'An error occurred while processing your request')];\n }\n\n } catch (\\Exception $e) {\n $response = ['status' => 'error', 'msg' => $e->getMessage()];\n }\n\n return Json::encode($response);\n }", "function get_lat_long($address)\r\n{\t\r\n\t//sleep(1);\r\n $address = str_replace(\" \", \"+\", $address);\r\n $json = file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=$region\");\r\n $json = json_decode($json);\r\n\t// echo \"<pre>\"; print_r($json); \r\n\r\n $lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n $long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\r\n return $lat.','.$long;\r\n}", "function geolocate($address)\r\n\t{\r\n\t\t$lat = 0;\r\n\t\t$lng = 0;\r\n\t\t\r\n\t\t$data_location = \"http://maps.google.com/maps/api/geocode/json?address=\".str_replace(\" \", \"+\", $address).\"&sensor=false\";\r\n\t\t\r\n\t\tif ($this->region!=\"\" && strlen($this->region)==2) { $data_location .= \"&region=\".$this->region; }\r\n\t\t$data = file_get_contents($data_location);\r\n\t\tusleep(200000);\r\n\t\t\r\n\t\t// turn this on to see if we are being blocked\r\n\t\t// echo $data;\r\n\t\t\r\n\t\t$data = json_decode($data);\r\n\t\t\r\n\t\tif ($data->status==\"OK\") {\r\n\t\t\t$lat = $data->results[0]->geometry->location->lat;\r\n\t\t\t$lng = $data->results[0]->geometry->location->lng;\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate lat/long coordinates\r\n\t\t$coords['lat'] = $lat;\r\n\t\t$coords['lng'] = $lng;\r\n\t\t\r\n\t\treturn $coords;\r\n\t}", "function getAddressAjax() {\n $this->load->model('Usermodel');\n $this->load->library('form_validation');\n $this->load->helper('form');\n $this->load->helper('string');\n $this->load->library('encrypt');\n\n $id = $this->input->post('id', TRUE);\n if (!$id) {\n show_404();\n }\n $rs = $this->Usermodel->getAddressbyID($id);\n $inner = array();\n $inner['addressdata'] = $rs;\n $page = array();\n $data = $this->load->view('edit-new-address-ajax', $inner, TRUE);\n\n $resArr = array();\n $resArr['type'] = 'true';\n $resArr['userhtml'] = $data;\n echo json_encode($resArr);\n }", "function location($gps){\n\tglobal $api;\n\t$lat = $gps['lat'];\n\t$lon = $gps['lon'];\n\t$endpoint = \"https://us1.locationiq.com/v1/reverse.php?key=$api&lat=$lat&lon=$lon&format=json\";\n\techo \"https://www.google.com/maps/search/?q=$lat,$lon\\n\";\n\treturn file_get_contents($endpoint);\n}", "function getLocationByIp($data)\n\t{\n\t\t$passArray = array();\n\t\t\n\t\t$ipAddress = $data['ipAddress'];\n\t\t$ipResult = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ipAddress));\n\t\tif(sizeof($ipResult)>0)\n\t\t{\n\t\t\t$status =SUCCESS;\n\t\t\t$message = MESSAGE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$status =FAIL;\n\t\t\t$message = ERRORMESSAGE;\n\t\t}\t\t\n\t\t$response = array(\n\t\t\t\t\t\t\t\"Status\" => $status,\n\t\t\t\t\t\t\t\"Message\"=> $message,\n\t\t\t\t\t\t\t\"Result\" =>$ipResult\n\t\t\t\t\t\t);\n\n\t\treturn $response;\n\t}", "function load_map_full_view($values) {\n $datas = DataManager::searchByData(null, $values['address']);\n \n $tpl = new Template(SiteConfig::templatesPath() . \"views/pages/map-view\");\n $tpl->address = $datas[0]->address.\",+\".$datas[0]->district.\"+\";\n $tpl->search = $datas[0]->lat.\",\".$datas[0]->lang;\n $tpl->id = $datas[0]->id;\n $resp = new AjaxResponse(true);\n $resp->setData($tpl->parse());\n\n if (count($datas) > 1) {\n $tpl = new Template(SiteConfig::templatesPath() . \"views/pages/search-detailed-result\");\n $tpl->datas = $datas;\n $tpl->addr = $values['address'];\n } else {\n $tpl = new Template(SiteConfig::templatesPath() . \"views/pages/search-result\");\n $mgr = new DataManager();\n $arr = array();\n $mgr->setAddress($values['address']);\n array_push($arr, $mgr);\n $tpl->datas = $arr;\n }\n\n\n\n $resp->setCustomData($tpl->parse());\n echo $resp->getOutput();\n exit();\n}", "public function getLocation();", "public function getLocation();", "private function getLocation() {\n }", "function check_geolocation($nameofgeo){\n\t$url = \"https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=\".str_replace(\" \",\"%\",$nameofgeo).\"&inputtype=textquery&fields=photos,formatted_address,name&locationbias=circle:[email protected],-122.2226413&key=AIzaSyDQfsEll4lB-xdxkLXGZA7_a2rMCyVM4Ok\";\n\t$json = file_get_contents($url);\n\t$json_data = json_decode($json, true);\n\tif ($json_data[\"status\"]==\"ZERO_RESULTS\")\n\t\treturn(\"Numele introdus nu este o geolocatie!\");\n\telse{\n\t\t#print_r($json_data['candidates'][0]['name']);\n\t\t#echo \" este nume pentru-> \"; \n\t\t#echo \"<br><br>\";\n\t\treturn($json_data[\"status\"]);\n\t}\n}", "function getLocationInfoByIp() {\n\t\t$client = @$_SERVER['HTTP_CLIENT_IP'];\n\t\t$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t$remote = @$_SERVER['REMOTE_ADDR'];\n\t\t$result = array('country'=>'', 'city'=>'');\n\t\tif(filter_var($client, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $client;\n\t\t}elseif(filter_var($forward, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $forward;\n\t\t}else{\n\t\t\t$ip = $remote;\n\t\t}\n\t\t$ip_data = @json_decode(file_get_contents(\"http://www.geoplugin.net/json.gp?ip=\".$ip));\n\t\tif($ip_data && $ip_data->geoplugin_countryName != null){\n\t\t\t$result['country'] = $ip_data->geoplugin_countryName;\n\t\t\t$result['city'] = $ip_data->geoplugin_city;\n\t\t\t$result['ip'] = $remote;\n\t\t}\n\t\treturn $result;\n }", "public function getLocation_get(){\n $user_id = $this->input->get('user_id');\n\n $data = $this->User_model->select_data('latitude,longitude','tbl_users',array('id'=>$user_id));\n\n if(empty($data))\n\n {\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"getLocation\",\n \"ResponseCode\" => false,\n \"MessageWhatHappen\" => \"Not Found\"\n\n );\n }else{\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"getLocation\",\n \"ResponseCode\" => true,\n \"getLocationResponse\" => $data\n\n );\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "function getLocation($xml){\n\t$latitude = $xml->result->geometry->location->lat;\n $longitude = $xml->result->geometry->location->lng;\n $location = array(\"latitude\" => $latitude, \"longitude\" => $longitude);\n return ($location);\n}", "function ip_data()\n {\n if(!$this->input->is_ajax_request()){\n $this->session->set_userdata('timestamp', time());\n $user_data = $this->session->userdata('surfer_info');\n $ip = $_SERVER['REMOTE_ADDR'];\n if (!$user_data) {\n if ($_SERVER['HTTP_HOST'] !== 'localhost') {\n $ip_data = file_get_contents(\"http://ip-api.com/json/\" . $ip);\n $this->session->set_userdata('surfer_info', $ip_data);\n }\n }\n }\n }", "function _get_cloudflare_geolocation() {\n\t\treturn IMFORZA_Utils::get_cloudflare_geolocation();\n\t}", "function getCoordination($address){\r\n $address = str_replace(\" \", \"+\", $address); // replace all the white space with \"+\" sign to match with google search pattern\r\n \r\n $url = \"http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address\";\r\n \r\n $response = file_get_contents($url);\r\n \r\n $json = json_decode($response,TRUE); //generate array object from the response from the web\r\n\r\n $latitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]);\r\n $longitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]);\r\n\r\n return array(\"latitude\" => $latitude, \"longitude\" => $longitude);\r\n }", "function getLatLong($address, $city, $postalCode) {\n $combinedAddress = $address . \", \" . $postalCode . \" \" . $city;\n\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" . urlencode($combinedAddress) . \"&key=\" . Config::GOOGLE_API_KEY;\n $context = stream_context_create();\n $result = file_get_contents($url, false, $context);\n\n if (isset($result)) {\n $parsedResult = json_decode($result, true);\n\n if (isset($parsedResult[\"results\"])) {\n $results = $parsedResult[\"results\"];\n $firstLocation = $results[0];\n return $firstLocation[\"geometry\"][\"location\"];\n } else {\n echo($result);\n }\n } else {\n echo \"HELP\";\n }\n}", "function grabUserLocation($input){\n $user_city = $input;\n $request_url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$user_city.\"%20Canada&sensor=false\";\n $USERJSON = file_get_contents($request_url);\n $result = json_decode($USERJSON);\n $lat=$result->results[0]->geometry->location->lat;\n $long=$result->results[0]->geometry->location->lng;\n return compact('lat','long');\n}", "function geoCheckIP($ip){\n $CI =& get_instance();\n\n if(isset($_SESSION['geo_ip_location']) && $_SESSION['geo_ip_location']['ip'] == $ip) {\n return $_SESSION['geo_ip_location'];\n }\n\n log_message('debug', \"geoCheckIP\");\n\t \n\t\t$json_data = file_get_contents(\"http://apinotes.com/ipaddress/ip.php?ip=$ip\");\n\t\t$ip_data = json_decode($json_data, TRUE);\n\t\tif ($ip_data['status'] == 'success') {\n $_SESSION['geo_ip_location'] = array(\n 'ip' => $ip,\n 'country_code' => $ip_data['country_code'],\n 'country_name' => $ip_data['country_name']\n );\n\n\t\t\t/*\n\t\t <p>Ip Address: <?php echo $ip_data['ip'] ?></p>\n\t\t <p>Country Name: <?php echo $ip_data['country_name'] ?></p>\n\t\t <p>Country Code: <?php echo $ip_data['country_code'] ?></p>\n\t\t <p>Country Code (3 digit): <?php echo $ip_data['country_code3'] ?></p>\n\t\t <p>Region Code: <?php echo $ip_data['region_code'] ?></p>\n\t\t <p>Region Name: <?php echo $ip_data['region_name'] ?></p>\n\t\t <p>City Name: <?php echo $ip_data['city_name'] ?></p>\n\t\t <p>Latitude: <?php echo $ip_data['latitude'] ?></p>\n\t\t <p>Longitude: <?php echo $ip_data['longitude'] ?></p>\n\t\t\t*/\n \n\t\t\treturn $ip_data;\n\t\t}\n\t}", "function location_cmn($lat, $long, $usegeolocation, $customerno = null) {\n $address = NULL;\n $customerno = (!isset($customerno)) ? $_SESSION['customerno'] : $customerno;\n if (isset($lat) && isset($long)) {\n $GeoCoder_Obj = new GeoCoder($customerno);\n $address = $GeoCoder_Obj->get_location_bylatlong($lat, $long);\n }\n return $address;\n}" ]
[ "0.66101533", "0.61367625", "0.6015483", "0.60123855", "0.5960278", "0.586756", "0.58545876", "0.5834137", "0.58313656", "0.5772265", "0.57561314", "0.571694", "0.565401", "0.56371737", "0.5608076", "0.55945003", "0.5571893", "0.5571893", "0.55613744", "0.5553205", "0.55112016", "0.5494891", "0.547919", "0.5474777", "0.5467186", "0.54646283", "0.54547274", "0.54529", "0.5430559", "0.5420713" ]
0.65096796
1
Render Geolocation log view
public function actionLog() { $searchModel = new LogGeoSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('log', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'users' => (new User())->getUsers('name'), 'severities' => ArrayHelper::map(Severity::find()->all(), 'name', 'name'), 'actions' => LogGeo::find()->select('action')->indexBy('action')->asArray()->column() ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render($data) {\n\t\t$this->body->set_template('report_geolocation.tpl');\n\t\t$this->body->set('latest_visits', $this->get('latest_visits'));\n\t\t$this->body->set('site_id', $this->get('site_id') );\n\t\t$this->setjs('jmaps', 'base/js/includes/jquery/jquery.jmap-r72.js');\n\t\t$this->setjs('owa.map', 'base/js/owa.map.js');\n\t}", "public function displaysGoogleMapWithDatestampedLocation()\n {\n\n // Arrange\n $this->login();\n $org = $this->orgSet[0];\n $loc = json_decode($this->viewLocationSetJson,true)[0];\n $vehicle = $this->vehicleSet[0];\n $expectedDatetime = (new \\DateTime($loc['received_at']))->format('j/m/Y, G:i:s');\n\n // Act\n $this->byCssSelector('#accordion a[href=\"#locate_vehicles_collapsible\"]')->click();\n $this->wait();\n $this->byId('#location'.$loc['_id'])->click();\n $this->wait();\n $this->byCssSelector('button.open-modal-location-view')->click();\n $this->wait(8000);\n\n // Assert\n $this\n ->assertThat($this\n ->byId('view_location_vehicle_registration_number')\n ->text(),$this\n ->equalTo($vehicle['registration_number']));\n $this\n ->assertThat($this\n ->byId('view_location_datetime')\n ->text(),$this->equalTo($expectedDatetime));\n\n $this\n ->assertThat($this\n ->byCssSelector('.gmnoprint[title^=\"'.$vehicle['registration_number'].'\"]')\n ->attribute('title'), $this\n ->equalTo($vehicle['registration_number']));\n\n }", "function showNoticeLocation()\n {\n $id = $this->notice->id;\n\n $location = $this->notice->getLocation();\n\n if (empty($location)) {\n return;\n }\n\n $name = $location->getName();\n\n $lat = $this->notice->lat;\n $lon = $this->notice->lon;\n $latlon = (!empty($lat) && !empty($lon)) ? $lat.';'.$lon : '';\n\n if (empty($name)) {\n $latdms = $this->decimalDegreesToDMS(abs($lat));\n $londms = $this->decimalDegreesToDMS(abs($lon));\n // TRANS: Used in coordinates as abbreviation of north.\n $north = _('N');\n // TRANS: Used in coordinates as abbreviation of south.\n $south = _('S');\n // TRANS: Used in coordinates as abbreviation of east.\n $east = _('E');\n // TRANS: Used in coordinates as abbreviation of west.\n $west = _('W');\n $name = sprintf(\n // TRANS: Coordinates message.\n // TRANS: %1$s is lattitude degrees, %2$s is lattitude minutes,\n // TRANS: %3$s is lattitude seconds, %4$s is N (north) or S (south) depending on lattitude,\n // TRANS: %5$s is longitude degrees, %6$s is longitude minutes,\n // TRANS: %7$s is longitude seconds, %8$s is E (east) or W (west) depending on longitude,\n _('%1$u°%2$u\\'%3$u\"%4$s %5$u°%6$u\\'%7$u\"%8$s'),\n $latdms['deg'],$latdms['min'], $latdms['sec'],($lat>0? $north:$south),\n $londms['deg'],$londms['min'], $londms['sec'],($lon>0? $east:$west));\n }\n\n $url = $location->getUrl();\n\n $this->out->text(' ');\n $this->out->elementStart('span', array('class' => 'location'));\n // TRANS: Followed by geo location.\n $this->out->text(_('at'));\n $this->out->text(' ');\n if (empty($url)) {\n $this->out->element('abbr', array('class' => 'geo',\n 'title' => $latlon),\n $name);\n } else {\n $xstr = new XMLStringer(false);\n $xstr->elementStart('a', array('href' => $url,\n 'rel' => 'external'));\n $xstr->element('abbr', array('class' => 'geo',\n 'title' => $latlon),\n $name);\n $xstr->elementEnd('a');\n $this->out->raw($xstr->getString());\n }\n $this->out->elementEnd('span');\n }", "function render_geolocation_comments_table() {\n\t\techo \"<table id='geolocate_table'>\\n\";\n\t\techo \"\\t<tr><td><strong>Location</strong></td><td><strong>Number of Comments</strong></td></tr>\\n\";\n\t\tforeach ( $this->countries as $countryKey => $eachCountry ) {\n\t\t\techo \"\\t<tr><td>$countryKey</td><td align='center'>$eachCountry</td></tr>\\n\";\n\t\t}\n\t\techo \"\\n</table>\\n\";\n\t}", "public function tracking()\n {\n\n $imeis = ['RIDD0172431', 'RIDD0172248', 'RIDD0172421'];\n\n $object = DB::table('gs_objects')->where('imei', 'RIDD0172431')->get()->first();\n\n return view('map.tracking', [\n 'object' => $object,\n ]);\n }", "public function render()\n {\n $control = $this->getControl();\n $inner = $this->getInner($this->inner);\n $plugins = $this->getInner($this->plugins);\n \n $body = <<<EOF\n<div style='height: {$this->height}px; '>\n <v-map :zoom=13 :center=\"[$this->Lat,$this->Lon]\" :options='$this->options'>\n $control\n <v-tilelayer url=\"$this->tileServer\" name=\"Cхема\" layer-type='base'></v-tilelayer>\n $plugins\n $inner\n </v-map>\n</div>\nEOF;\n\n return view($this->view, \n [\n $this->mapId => $body,\n ]\n )->render();\n }", "public function displayMap()\n {\n $buses = User::where('wei', 1)->whereNotNull('latitude')->whereNotNull('longitude')->orderBy('updated_at')->groupBy('bus_id')->get();\n\n $pts = [];\n foreach ($buses as $bus) {\n $pts [] = [\n 'title' => 'Bus '.$bus->bus_id,\n 'lat' => $bus->latitude,\n 'lng' => $bus->longitude,\n ];\n }\n\n return view('dashboard.maps.index', compact('pts'));\n\n }", "public function index()\n {\n $map = Currentlocation::with('riders')->get();\n \n return view('administrator.riders.map', compact('map'));\n \n }", "public function location()\n {\n //\n return view('event.location');\n }", "public function index()\n {\n //get user ip address\n $ip_address = $_SERVER['REMOTE_ADDR'];\n //get user ip address details with geoplugin.net\n $geopluginURL = 'http://www.geoplugin.net/php.gp?id='.$ip_address;\n $addrDetailsArr = unserialize(file_get_contents($geopluginURL)); \n //dd($addrDetailsArr['geoplugin_countryName']);\n $geoAlbums = Http::get('http://ws.audioscrobbler.com/2.0/?method=geo.gettoptracks&country='.$addrDetailsArr['geoplugin_countryName'].'&api_key=915e43bd2c345fdb1aa3e2c00aca0c03&format=json')\n ->json()['tracks']['track'];\n //dump($geoAlbums);\n\n return view('geolocation', [\n 'addrDetailsArr' => $addrDetailsArr,\n 'geoAlbums' => collect($geoAlbums)->take(8),\n ]);\n }", "public function getLocationIndex()\n {\n return view('admin.world_expansion.locations', [\n 'locations' => Location::orderBy('sort', 'DESC')->get()\n ]);\n }", "public function show_map() {\n $restaurant_location = Restaurant::where('id',$_POST['restaurant_id'])->first();\n $html = view('admin.restaurants.map-address')->with('restaurant_location', $restaurant_location)->render();\n if ($html) {\n $res_array = array(\n 'msg' => 'success',\n 'response' => $html,\n );\n echo json_encode($res_array);\n exit;\n } \n }", "function shipments_transit_log()\r\n\t\t{\r\n\t\t\t$this->erpm->auth(PNH_SHIPMENT_MANAGER|CALLCENTER_ROLE);\r\n\t\t\t$data['page']='pnh_shipments_transit_log';\r\n\t\t\t$this->load->view('admin',$data);\r\n\t\t}", "public function render()\n {\n return view('components.location-actions');\n }", "public function index()\n {\n //\n $mos_device=mosdevice::all();\n $k=0;\n foreach($mos_device as $key){\n $data[$k]['location']=$key->location;\n $NewString = explode(\",\", $data[$k]['location'] ) ;\n $data[$k]['x_location']= $NewString[0];\n $data[$k]['y_location']= $NewString[1];\n $data[$k]['loc_addr']=$key->device_number;\n $k++;\n }\n //$json=json_encode($data);\n //json_encode($json, JSON_UNESCAPED_UNICODE); \n //return $data;\n //return $data;\n //return $data[1]['device_number'];\n\n //return $data[1]['device_number'];\n //$data=json_encode($data);\n //json_encode($data, JSON_UNESCAPED_UNICODE); \n //$data=urldecode(json_encode($data));\n //return urldecode(json_encode($data));\n return view('mos_web.mos_goolgemap',compact('data'));\n }", "public function getWeatherMap()\n {\n return $this->renderView(\n __DIR__ . DIRECTORY_SEPARATOR . 'views/weather_map.php',\n [\n 'center_id' => $this->centerID,\n 'token' => $this->token,\n 'wx_base_url' => $this->wxBaseUrl,\n 'wx_map_zones' => $this->wxMapZones,\n 'external_modal_links' => $this->externalModalLinks\n ]\n );\n }", "function showLocationBox () {\n\t\t$template['list'] = $this->cObj2->getSubpart($this->templateCode,'###TEMPLATE_LOCATIONBOX###');\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['location.']['LL'], 'location');\n\n\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['list'],$markerArray);\n\t\treturn $content;\n\t}", "public function view_map_target()\n {\n\n return view('admin.gps.gps_target_index');\n }", "public function format() : void\n {\n $locations = $this->resolveLocations();\n \n foreach($locations as $location)\n {\n $location->format();\n \n $this->log = array_merge($this->log, $location->getLog());\n }\n }", "public function index()\n {\n $user_id = auth()->user()->id;\n $user = User::find($user_id);\n return view('locations.index')->with('locations', $user->locations->sortBy('title')->values()->all())->with('user', $user);\n }", "public function overview() {\r\n\r\n // load model\r\n require_once APP_PATH . '/models/LocationsModel.php';\r\n\r\n // get all locations\r\n $locationsModel = new LocationsModel();\r\n $locations = $locationsModel->getAll();\r\n\r\n // show views\r\n loadView('theme/header');\r\n loadView('locations/overview', [\r\n 'locations' => $locations,\r\n ]);\r\n loadView('theme/footer');\r\n }", "function fumseck_display_exif_geocoord($featured_image_exif) {\n\t\n\t$exif_latitude = $featured_image_exif['image_meta']['latitude_DegDec'];\n\t$exif_longitude = $featured_image_exif['image_meta']['longitude_DegDec'];\n\t\n\tif ( $exif_latitude && $exif_longitude ) {\n\t\t\n\t\t$output = sprintf(\n\t\t\t\t'%d° %d′ %d″ %s, %d° %d′ %d″ %s', \n\t\t\t\t$featured_image_exif['image_meta']['latitude_DMS']['degrees'],\n\t\t\t\t$featured_image_exif['image_meta']['latitude_DMS']['minutes'],\n\t\t\t\t$featured_image_exif['image_meta']['latitude_DMS']['seconds'],\n\t\t\t\t$featured_image_exif['image_meta']['latitude_DMS']['direction'],\n\t\t\t\t$featured_image_exif['image_meta']['longitude_DMS']['degrees'],\n\t\t\t\t$featured_image_exif['image_meta']['longitude_DMS']['minutes'],\n\t\t\t\t$featured_image_exif['image_meta']['longitude_DMS']['seconds'],\n\t\t\t\t$featured_image_exif['image_meta']['longitude_DMS']['direction']\n\t\t\t\t);\n\t\t\n\t\t$output = '(<a '\n\t\t\t\t. 'href=\"http://www.openstreetmap.org/?mlat=' . $exif_latitude . '&mlon=' . $exif_longitude . '\" '\n\t\t\t\t. 'title=\"' . __('View this location on OpenStreetMap (opens in another window)', 'fumseck') . '\" '\n\t\t\t\t. 'target=\"_blank\"'\n\t\t\t\t. '>' . $output . '</a>)';\n\t\t\n\t\techo $output;\n\t}\n}", "function simple_geo_views_data() {\n // Position Fields\n $data['simple_geo_position']['table']['group'] = t('Simple Geo');\n $data['simple_geo_position']['table']['join']['node'] = array(\n 'left_field' => 'nid',\n 'field' => 'nid',\n 'extra' => array(\n array(\n 'field' => 'type',\n 'value' => 'node',\n ),\n ),\n );\n $data['simple_geo_position']['position'] = array(\n 'title' => t('Position'),\n 'help' => t('The position of the node.'), // The help that appears on the UI,\n // Information for displaying the nid\n 'field' => array(\n 'handler' => 'simple_geo_views_handler_field_point',\n ),\n 'filter' => array(\n 'handler' => 'simple_geo_views_handler_filter_point',\n 'label' => t('Has position'),\n 'type' => 'yes-no',\n 'accept null' => TRUE,\n ),\n );\n\n return $data;\n}", "public function get_timezone_info_view() {\n $google_calendar_timezone = $this->get_timezone_info();\n\n $args = array(\n 'is_calendar_sync_enabled' => $this->is_calendar_sync_enabled(),\n 'google_calendar_timezone' => $google_calendar_timezone,\n 'current_timezone' => yith_wcbk_get_timezone( 'human' )\n );\n\n return $this->get_view( 'timezone-info.php', $args );\n }", "public function getUserLocation() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_note = 'HTTP_CLIENT_IP='.$_SERVER['HTTP_CLIENT_IP'];\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_note = 'HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR'];\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip_note = 'REMOTE_ADDR='.$_SERVER['REMOTE_ADDR'];\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $ip = '117.20.119.245';\n $loc = file_get_contents(\"http://ipinfo.io/\".$ip.\"/loc\");\n\n if($loc) {\n $array_loc = explode(',', $loc);\n return ['lat'=> ((isset($array_loc[0]))? $array_loc[0]:'') ,'lon'=> ((isset($array_loc[1]))? $array_loc[1]:'')];\n }\n\n return ['lat'=>'','lon'=>''];\n\n }", "public function index()\n {\n $owner_id = auth()->user()->id;\n $company_id = CarCompany::where('owner_id', '=', $owner_id)->first()->id;\n $locations = Location::where('company_id', '=', $company_id)->get();\n\n return view('/company/location', ['displays' => $locations]);\n }", "public function show()\n {\n \t$locations = Locations::orderBy('city', 'ASC')->get();\n\n \t$mr = Hours::orderBy('day', 'ASC')->wherelocations_id(1)->get();\n \t$gf = Hours::orderBy('day', 'ASC')->wherelocations_id(2)->get();\n \t$nm = Hours::orderBy('day', 'ASC')->wherelocations_id(3)->get();\n \t$rm = Hours::orderBy('day', 'ASC')->wherelocations_id(4)->get();\n \t$wr = Hours::orderBy('day', 'ASC')->wherelocations_id(5)->get();\n return View::make('locations')\n \t\t\t->with('locations', $locations)\n \t\t\t->with('mr', $mr)\n \t\t\t->with('gf', $gf)\n \t\t\t->with('nm', $nm)\n \t\t\t->with('rm', $rm)\n \t\t\t->with('wr', $wr);\n }", "public function getLocations()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Location (Linnworks API)');\n\t\t}", "public function index()\n {\n return view('location');\n }", "public function show(geoip $geoip)\n {\n //\n }" ]
[ "0.6094862", "0.573639", "0.5736111", "0.5702951", "0.5568251", "0.55526716", "0.553553", "0.55191576", "0.5502245", "0.54797536", "0.54207766", "0.5406463", "0.538621", "0.532568", "0.5315119", "0.5235307", "0.52312756", "0.5223405", "0.52166647", "0.52158874", "0.5207647", "0.519355", "0.51912284", "0.5159566", "0.5153467", "0.51494837", "0.51186955", "0.5094601", "0.508066", "0.50743747" ]
0.5887237
1