query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Sets the greeting message for ftpbased group access. | function set_ftp_group_greeting($name, $greeting)
{
clearos_profile(__METHOD__, __LINE__);
$this->_set_parameter($name, 'FtpGroupGreeting', $greeting);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_ftp_group_greeting($greeting)\n {\n clearos_profile(__METHOD__, __LINE__);\n // Invalid characters in greeting?\n //if (preg_match(\"//\" $greeting))\n // return lang('flexshare_greeting_invalid');\n }",
"private function getGreeting()\n {\n return sprintf(UUP_MAIL_MESSAGE_GREETER, $this->data->options->contact_name, $this->data->options->contact_addr);\n }",
"public function setGreeting($greeting) {\r\n\t\t$this->greeting = $greeting;\r\n\t\treturn $this;\r\n\t}",
"protected static function sendWelcomeMessage(\\ElggUser $recipient, \\ElggGroup $group): void {\n\t\t// get welcome message\n\t\t$welcome_message = $group->getPluginSetting('group_tools', 'welcome_message', '');\n\t\t$check_message = trim(strip_tags($welcome_message));\n\t\tif (empty($check_message)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// replace the placeholders\n\t\t$welcome_message = str_ireplace('[name]', $recipient->getDisplayName(), $welcome_message);\n\t\t$welcome_message = str_ireplace('[group_name]', $group->getDisplayName(), $welcome_message);\n\t\t$welcome_message = str_ireplace('[group_url]', $group->getURL(), $welcome_message);\n\t\t\n\t\t// get notification preferences for this group\n\t\t$methods = elgg_get_notification_methods();\n\t\tif ($group->hasSubscription($recipient->guid, $methods)) {\n\t\t\t$subscription = elgg_echo('on', [], $recipient->getLanguage());\n\t\t} else {\n\t\t\t$subscription = elgg_echo('off', [], $recipient->getLanguage());\n\t\t}\n\t\t\n\t\t$subscription = elgg_format_element('b', [], $subscription);\n\t\t\n\t\t$welcome_message .= PHP_EOL . PHP_EOL . elgg_echo('group_tools:welcome_message:notifications', [\n\t\t\t$subscription,\n\t\t], $recipient->getLanguage());\n\t\t\n\t\t// subject\n\t\t$subject = elgg_echo('group_tools:welcome_message:subject', [$group->getDisplayName()], $recipient->getLanguage());\n\t\t\n\t\t// mail params\n\t\t$mail_params = [\n\t\t\t'object' => $group,\n\t\t\t'action' => 'welcome',\n\t\t];\n\t\t\n\t\t// notify the user\n\t\tnotify_user($recipient->guid, $group->guid, $subject, $welcome_message, $mail_params);\n\t}",
"public function getGreeting() {\r\n\t\treturn $this->greeting;\r\n\t}",
"function set_ftp_group_permission($name, $permission)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n Validation_Exception::is_valid($this->validate_ftp_group_permission($permission));\n\n $this->_set_parameter($name, 'FtpGroupPermission', $permission);\n }",
"public function formalGreeting(){\n echo \"Sir, Nice to meet you. You can call me \" .$this->name . \"</br>\";\n \n }",
"function chgrp ($filename, $group) {}",
"public function setGroup($group) {\n chgrp($this->__full_path, $group);\n }",
"public function greeting(){\n\t\techo \"$this->name $this->lastname </br>\";\n\t}",
"public function setGroup($value)\n {\n $this->setProperty(\"Group\", $value, true);\n }",
"function set_ftp_group_access($name, $access)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FtpGroupAccess', implode(' ', $access));\n }",
"function nt_group_hub( ) {\n\t\tglobal $debug;\n\n\t\t/* handle form request if pending */\n\t\tnt_group_handle_form( );\n\n\t\tnt_display_groups();\n}",
"public function getGreeting()\n {\n date_default_timezone_set(\"Asia/Shanghai\");\n $hour = isset($this->currentHour) ? $this->currentHour : date('H', time());\n switch ($hour >= 0) {\n case $hour < 12:\n $greeterMsg = 'Good morning';\n break;\n case $hour < 18:\n $greeterMsg = 'Good afternoon';\n break;\n case $hour < 24:\n $greeterMsg = 'Good evening';\n break;\n default:\n $greeterMsg = 'Invalid Hour';\n }\n unset($hour);\n return $greeterMsg;\n }",
"public function showWelcomeMsg()\n\t\t{\n\t\t\tif(isset($this->CFG['user']['user_name']) && $this->CFG['user']['user_name'])\n\t\t\t\t$display_name = $this->CFG['user']['user_name'];\n\t\t\telse\n\t\t\t\t$display_name = $this->CFG['user']['name'];\n\t\t\t$mysolutions_link = getMemberUrl($this->CFG['user']['user_id'], $display_name);\n\t\t\techo $this->LANG['header_hi'].' <a href=\"'.$mysolutions_link.'\">'.$display_name.'</a>';\n\t\t}",
"function change_identity_group_name($telegram_id, $group_name = NULL) {\n $group_name_db = is_null($group_name) ? 'NULL' : \"'\" . db_escape($group_name) . \"'\";\n\n return db_perform_action(\"UPDATE `identity` SET `group_name` = {$group_name_db} WHERE `identity`.`telegram_id` = {$telegram_id}\");\n}",
"function group($group){\n\t\t\t$this->group = $group;\n\t\t}",
"public function for ( Person $person ) : Greeting\n\t{\n\t\t$this->message .= ' ' . $person->name;\n\t\treturn $this;\n\t}",
"function on_group_change( $id, $new_group )\n\t{\n\t\tglobal $DB, $std, $ibforums;\n\t\t\n\t\t//---- START\n\t\t\n\t\t\n\t\t//---- END\n\t}",
"function greet()\n {\n }",
"function testGroupRename()\r\n {\r\n // Instantiate IC controller\r\n $icController = new InfocenterController($this->ant, $this->user);\r\n $icController->debug = true;\r\n \r\n $params['name'] = \"UnitTest GroupName\";\r\n $params['color'] = \"eeeeee\";\r\n \r\n // create group data\r\n $gid = $icController->groupAdd($params);\r\n $this->assertTrue($gid > 0);\r\n \r\n $params['gid'] = $gid;\r\n \r\n // test group rename\r\n $params['name'] = \"UnitTest GroupRename\";\r\n $name = $icController->groupRename($params);\r\n $this->assertTrue(count($name) > 0);\r\n $this->assertEquals($name, $params['name']);\r\n \r\n // clear data \r\n $ret = $icController->groupDelete($params);\r\n $this->assertTrue($ret > 0);\r\n $this->assertEquals($gid, $ret);\r\n }",
"function get_greeting($name) {\n\t\t$greeting = 'Hello';\n\t\tif (strlen($name) > 0) {\n\t\t\t$greeting .= ' ' . $name; // string concatenation\n\t\t}\n\t\treturn $greeting . '!';\n\t}",
"function welcome_message_login()\r\n{\r\n\tglobal $SITEURL;\r\n\t$Feul = new Feul;\r\n\tif(isset($_SESSION['LoggedIn']))\r\n\t{\r\n\t\t$name = $_SESSION['Username'];\r\n\t\t//Display Welcome Message\r\n\t\t$welcome_box = '<div class=\"user_login_welcome_box_container\"><span class=\\\"user-login-welcome-label\\\">'. i18n_r(THISFILE_UL.'/WELCOME') .' </span>'.$name.'</div>';\r\n\r\n\t\t//Display Logout Link\r\n\t\t$logout_link = '<a href=\"'.$SITEURL.'?logout=yes\" class=\"user-login-logout-link\">'. i18n_r(THISFILE_UL.'/LOGOUT') .'</a>';\r\n\t\techo $Feul->getData('welcomebox').$welcome_box.$logout_link ;\r\n\t}\r\n}",
"function chgrp($files, $group, $recursive = false);",
"function lchgrp ($filename, $group) {}",
"public function setFamily(string $family);",
"public function setGroup($value) {}",
"public function setFirstGroup(?string $group): void;",
"function sendMessage($group, $message) {\n global $TOKEN;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"https://api.groupme.com/v3/groups/{$group}/messages?token=${TOKEN}\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\")); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"message\\\": {\\\"text\\\":\\\"$message\\\"}}\");\n $contents = json_decode(curl_exec($ch), true);\n curl_close($ch);\n }",
"public function setFamilyName(?string $familyName): void\n {\n $this->familyName = $familyName;\n }"
] | [
"0.63119555",
"0.59145695",
"0.5594835",
"0.5576391",
"0.5325539",
"0.5126934",
"0.50904185",
"0.5083798",
"0.5063965",
"0.49775243",
"0.49489647",
"0.4935721",
"0.48420203",
"0.4779538",
"0.4768117",
"0.47598377",
"0.47490883",
"0.47267076",
"0.4719179",
"0.4680982",
"0.466152",
"0.46342596",
"0.4622037",
"0.46175307",
"0.46161115",
"0.45884067",
"0.457826",
"0.45458788",
"0.45159358",
"0.4503517"
] | 0.8470408 | 0 |
////////////////////////////// F I L E (S A M B A) // ////////////////////////////// Sets the audit log state. | function set_file_audit_log($name, $state)
{
clearos_profile(__METHOD__, __LINE__);
$this->_set_parameter($name, 'FileAuditLog', $state);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setLog(){\n $model= Useraudit::instance();\n $model->setAttributes($this->attrMin());$model->save();\n }",
"public function setA ($log_a) {\n\t\t$this->log_a = $log_a;\n\t}",
"public function set_verbose($state)\n\t{\n\t\t$this->_verbose = $state;\n\t}",
"public function set_logined_status() {\r\n\t\r\n\t\t//设置登录session uid\r\n\t\t$GLOBALS['user']->uid = $this->uid;\r\n\r\n\t\t//重新变更session id\r\n\t\tSimPHP::$session->regenerate_id();\r\n\t\t\r\n\t\t//新起一个对象来编辑,避免过多更新\r\n\t\t$nUser = new self($this->uid);\r\n\t\t$nUser->lastlogin = simphp_time();\r\n\t\t$nUser->lastip = Request::ip();\r\n\t\t$nUser->save();\r\n\t}",
"final public function set_state($state) \n {\n $this->_state = $state;\n }",
"public static function setLog($log=FALSE) {\n self::$log = $log;\n }",
"function quiz_mark_session_change(&$state) {\n if (!$state->changed) {\n $state->changed = true;\n $state->seq_number++;\n $state->timestamp = time();\n }\n}",
"public function set_state(){\n\n foreach( $this->kernel->params as $key => $val )\n $_SESSION[\"state\"][$this->kernel->app][$this->kernel->object][$key] = $val;\n\n }",
"public function setState(string $state)\n\t{\n\t\t$this->state=$state; \n\t\t$this->keyModified['$state'] = 1; \n\n\t}",
"function setState($state) {\n \n $this->state = $state;\n \n }",
"public function setState($state){\n\n $this->session->set('state', $state);\n }",
"public function state()\n {\n $stateRequest = new StateRequest(StateRequest::$states[0]);\n $rawRequest = $stateRequest->getRawRequestFromAttribute();\n\n $this->output->manageMessageOfGivenLogLevel('Client: '.$rawRequest, Logger::INFO);\n fwrite($this->fileDescriptor, $rawRequest);\n }",
"public function setState($state) {\n\t\t$this->state = $state;\n\t}",
"protected function audit() : void\n {\n $user = Security::getCurrentUser();\n\n // Auditing: CREATE, when:\n // - A user is present AND\n // - User is in group that can access admin AND\n // - Record is new\n $doAudit = (\n !$this->exists() &&\n $user && (\n $user->getIsSA() ||\n $user->getIsCISO() ||\n $user->getIsAdmin()\n )\n );\n\n $userData = '';\n\n if ($user) {\n $groups = $user->Groups()->column('Title');\n $userData = implode('. ', [\n 'Email: ' . $user->Email,\n 'Group(s): ' . ($groups ? implode(' : ', $groups) : 'N/A'),\n ]);\n }\n\n if ($doAudit) {\n $msg = sprintf('\"%s\" was created', $this->Name);\n $this->auditService->commit('Create', $msg, $this, $userData);\n }\n\n // Auditing: CREATE, when:\n // - ANY user is present AND\n // - Record is new AND\n // - Task is \"Standalone\" (DisplayOnHomePage field has been set)\n $doAudit = (\n !$this->exists() &&\n $user &&\n $this->isStandalone()\n );\n\n if ($doAudit) {\n $msg = sprintf('\"%s\" (Standalone Task) was created', $this->Name);\n $this->auditService->commit('Create', $msg, $this, $userData);\n }\n\n // Auditing: CHANGE, when:\n // - User is present AND\n // - User is an Administrator\n // - Record exists\n $doAudit = (\n $this->exists() &&\n $user &&\n $user->getIsAdmin()\n );\n\n if ($doAudit) {\n $msg = sprintf('\"%s\" was modified', $this->Name);\n $groups = $user->Groups()->column('Title');\n $this->auditService->commit('Change', $msg, $this, $userData);\n }\n }",
"public function setState() {\r\n\t\tif(isset($_SESSION[$this->_config->dbTableNames->Pracownik]) && $_SESSION[$this->_config->dbTableNames->Pracownik]['state']==1) self::$adminState = true;\r\n\t\tif(isset($_SESSION[$this->_config->dbTableNames->Klient]) && $_SESSION[$this->_config->dbTableNames->Klient]['state']==1) self::$userState = true;\r\n\t}",
"public function setTrace()\n\t{\n\t\t$this->trace=1;\n\t}",
"public function setLoglevel()\n {\n $loglevel = (string)$this->model->getNodeByReference('settings.logLevel');\n\n switch ($loglevel) {\n case 'extended':\n $this->acme_args[] = '--syslog 6';\n $this->acme_args[] = '--log-level 2';\n $this->acme_syslog = 6;\n $this->debug = false;\n break;\n case 'debug':\n $this->acme_args[] = '--syslog 7';\n $this->acme_args[] = '--debug';\n $this->acme_syslog = 7;\n $this->debug = true;\n break;\n case 'debug2':\n $this->acme_args[] = '--syslog 7';\n $this->acme_args[] = '--debug 2';\n $this->acme_syslog = 7;\n $this->debug = true;\n break;\n case 'debug3':\n $this->acme_args[] = '--syslog 7';\n $this->acme_args[] = '--debug 3';\n $this->acme_syslog = 7;\n $this->debug = true;\n break;\n default:\n $this->acme_args[] = '--syslog 6';\n $this->acme_args[] = '--log-level 1';\n $this->acme_syslog = 6;\n $this->debug = false;\n break;\n }\n }",
"public function setState($state);",
"public function setState($state);",
"public function setState($state);",
"public function setCaptureBatch($state)\n {\n $this->_captureBatch = $state;\n }",
"public function logIg($state, $message)\n {\n $my_log = new MyLog();\n $my_log->type = 'ig';\n $my_log->state = $state;\n $my_log->message = $message;\n $my_log->save();\n }",
"public static function __set_state($data);",
"public function setState($state)\n {\n fhread_mutex_lock($this->stateMutex);\n $this->state = $state;\n fhread_mutex_unlock($this->stateMutex);\n }",
"static public function __set_state( array $array )\n {\n return new ezcLogEntry( $array['message'], $array['severity'],\n $array['source'], $array['category'], $array['optional'],\n $array['timestamp'] );\n }",
"public function setstatusAction() {\n $username = $this->_identity->username;\n //--------------------------\n // Получим обьект сообщения\n $request = $this->getRequest();\n $post_id = (int) $request->getPost('id');\n $post = new Default_Model_DbTable_BlogPost($this->db);\n\n if (!$post->loadForUser($this->_identity->user_id, $post_id)) {\n $this->_redirect('/blogmanager');\n }\n\n $title = $post->profile->title;\n\n // URL to redirect back to\n $url = '/blogmanager/preview' . '?id=' . $post->getId();\n\n if ($request->getPost('edit')) {\n $this->_redirect('/blogmanager/edit' . '?id=' . $post->getId());\n } else if ($request->getPost('publish')) {\n $post->sendLive();\n $post->save();\n\n $this->_flashMessenger->addMessage($this->Translate('Сообщение успешно опубликовано в блоге'));\n $message_log = \"User-\\\"$username\\\" has successfully published a blog post-\\\"$title\\\"\";\n } else if ($request->getPost('unpublish')) {\n $post->sendBackToDraft();\n $post->save();\n\n $this->_flashMessenger->addMessage($this->Translate('Сообщение переведено в состояние не опубликовано'));\n $message_log = \"User-\\\"$username\\\" set message-\\\"$title\\\" to the state is not published\";\n } else if ($request->getPost('delete')) {\n $post->delete();\n\n // Preview page no longer exists for this page so go back to index\n $url = '/blogmanager';\n\n $this->_flashMessenger->addMessage($this->Translate('Сообщение удалено из блога'));\n $message_log = \"User-\\\"$username\\\" deletes a message-\\\"$title\\\" from the blog\";\n }\n\n // Запомним в логе сообщений\n $this->_logMsg->post_set_status($message_log);\n\n $this->_redirect($url);\n }",
"public function setState($state)\n {\n $this->state = $state;\n }",
"function WriteAuditTrailDummy($typ) {\n\t\t$table = 'academicmissions';\n\t $usr = CurrentUserName();\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\n\t}",
"function setOnState($state) {\n if(is_bool($state)) {\n $conn = new ApiConnection();\n $URL = \"lights/\" . $this->lightID . \"/state\";\n $state = $state ? 'true' : 'false';\n $data = '{\"on\": ' . $state .'}';\n $result = $conn->sendPutCmd($URL, $data);\n return $result;\n } else {\n return null;\n }\n }",
"public function setState(string $state)\n\t{\n\t\t$this->addKeyValue('state', $state); \n\n\t}"
] | [
"0.62325114",
"0.58225036",
"0.5757751",
"0.5668394",
"0.5611714",
"0.5597298",
"0.5549319",
"0.53634936",
"0.53460854",
"0.5343837",
"0.5323489",
"0.53044015",
"0.52774346",
"0.5274555",
"0.5250679",
"0.52212226",
"0.52066535",
"0.5188539",
"0.5188539",
"0.5188539",
"0.51342934",
"0.51308954",
"0.51292366",
"0.51270115",
"0.51248586",
"0.51197374",
"0.51150644",
"0.50981766",
"0.5074344",
"0.5069755"
] | 0.74637204 | 0 |
Sets file sharing comment for the flexshare. | function set_file_comment($name, $comment)
{
clearos_profile(__METHOD__, __LINE__);
$this->_set_parameter($name, 'FileComment', $comment);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setShare($val)\n {\n $this->_propDict[\"share\"] = $val;\n return $this;\n }",
"protected function _set_parameter($name, $key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // Grab location of configuration (flexshare.conf or configlet) \n $config_file = $this->_get_parameter($name, 'ShareConfig');\n\n // Convert carriage returns\n $value = preg_replace(\"/\\n/\", \"\", $value);\n\n // Update tag if it exists\n try {\n $match = FALSE;\n $file = new File($config_file);\n\n $needle = \"/^\\s*$key\\s*=\\s*/i\";\n $match = $file->replace_lines_between($needle, \" $key=$value\\n\", \"/<Share $name>/\", \"/<\\/Share>/\");\n } catch (File_No_Match_Exception $e) {\n // Do nothing\n }\n\n // If tag does not exist, add it\n if (! $match)\n $file->add_lines_after(\" $key=$value\\n\", \"/<Share $name>/\");\n\n $this->shares = NULL; // Force a configuration reload\n\n // Update last modified\n if (preg_match(\"/^Web/\", $key))\n $lastmod = \"WebModified\";\n else if (preg_match(\"/^Ftp/\", $key))\n $lastmod = \"FtpModified\";\n else if (preg_match(\"/^File/\", $key))\n $lastmod = \"FileModified\";\n else if (preg_match(\"/^Email/\", $key))\n $lastmod = \"EmailModified\";\n else\n return;\n\n try {\n $mod = \" \" . $lastmod . \"=\" . time() . \"\\n\";\n $file->replace_lines_between(\"/\" . $lastmod . \"/\", $mod, \"/<Share $name>/\", \"/<\\/Share>/\");\n } catch (File_No_Match_Exception $e) {\n $file->add_lines_after($mod, \"/<Share $name>/\");\n }\n }",
"public function setShareType($shareType);",
"public function setShareCounter($shareCounter) {\r\n\t$this->shareCounter = $shareCounter;\r\n }",
"public function setComment($value)\n {\n $this->comment = $value;\n }",
"protected function setComment($comment){\r\n $this->comment = $comment;\r\n }",
"public function setShared($shared);",
"function set_share_state($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $share = $this->get_share($name);\n $state_value = ($state) ? 1 : 0;\n\n $this->_set_parameter($name, 'ShareEnabled', $state_value);\n\n $this->_update_folder_links($name, $this->_get_parameter($name, 'ShareDir'));\n }",
"public function share(bool $share = true)\n {\n // cannot be shared\n }",
"public function setDefaultShareLinkType($value)\n {\n $this->setProperty(\"DefaultShareLinkType\", $value, true);\n }",
"public function setComment(string $comment): void;",
"function setComment($a_sComment)\n {\n $this->_sComment = (string) $a_sComment;\n $this->setSearchParameter('comment', $this->_sComment);\n }",
"public static function setComment($index_or_filename, $comment = null)\n {\n self::instance()->setComment($index_or_filename, $comment);\n }",
"function _set_comment() {\n if (!$this->has_arg('t')) $this->_error('No data type specified');\n if (!$this->arg('id')) $this->_error('No data collection id specified');\n if (!$this->arg('value')) $this->_error('No comment specified');\n \n $types = array('data' => array('datacollection', 'datacollectionid'),\n 'edge' => array('energyscan', 'energyscanid'),\n 'mca' => array('xfefluorescencespectrum', 'xfefluorescencespectrumid'),\n );\n \n if (!array_key_exists($this->arg('t'), $types)) $this->_error('No such data type');\n $t = $types[$this->arg('t')];\n \n $com = $this->db->pq('SELECT comments from ispyb4a_db.'.$t[0].' WHERE '.$t[1].'=:1', array($this->arg('id')));\n \n if (!sizeof($com)) $this->_error('No such data collection');\n \n $this->db->pq(\"UPDATE ispyb4a_db.$t[0] set comments=:1 where $t[1]=:2\", array($this->arg('value'), $this->arg('id')));\n \n print $this->arg('value');\n }",
"public function setComment($data)\n {\n $this->comment = $data;\n }",
"public function setComment( $comment )\n {\n $this->properties[\"comment\"] = $comment;\n $this->properties[\"commentLength\"] = strlen( $comment );\n }",
"public function setPermalink($permalink) {\r\n\t\t$this->_comment['permalink'] = $permalink;\r\n\t}",
"public static function setComment(string $comment): void\n {\n self::$comment = str_replace([\"\\r\", \"\\n\"], '', $comment);\n }",
"public function setDefaultShareLinkPermission($value)\n {\n $this->setProperty(\"DefaultShareLinkPermission\", $value, true);\n }",
"function set_activity_share_count( $content, $user_id, $activity_id ) {\n\t\t$this->update_activity_share_count( $activity_id );\n\t}",
"function setComment($value) {\n return $this->setFieldValue('comment', $value);\n }",
"public function setShowExternalSharingWarning($value)\n {\n $this->setProperty(\"ShowExternalSharingWarning\", $value, true);\n }",
"function update_share_permissions()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $enforce = $this->get_enforce_group_permissions();\n\n if ($enforce == self::ENFORCE_OFF)\n return;\n\n $type = ($enforce == self::ENFORCE_FULL) ? self::TYPE_ALL : self::TYPE_FILE_SHARE;\n $shares = $this->_get_shares($type);\n\n foreach ($shares as $name => $detail)\n $this->_update_folder_attributes($detail['ShareDir'], $detail['ShareOwner'], $detail['ShareGroup'], $detail['ShareSystemPermissions']);\n }",
"public function setComment($comment)\n\t{\n\t\t$this->comment = $comment;\n\t}",
"protected function _generate_file_flexshares()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('samba_common/Samba'))\n return;\n\n $samba = new Samba();\n\n if (! $samba->is_file_server())\n return;\n\n // Create a unique file identifier\n $backup_key = time();\n\n // Backup original file\n $backup = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);\n if ($backup->exists()) {\n $backup->move_to(self::PATH_TEMP . \"/$backup_key.bak\");\n $backup_exists = TRUE;\n } else {\n $backup_exists = FALSE;\n }\n\n // Samba is slightly different. We dump all flexshare-related 'stuff' in one file\n $file = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);\n if ($file->exists())\n $file->delete();\n\n $file->create('root', 'root', '0644');\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n $linestoadd = '';\n\n // Recreate samba flexshare.conf\n\n foreach ($shares as $name => $share) {\n // If not enabled, continue through loop - we're re-creating lines here\n if (! isset($share['ShareEnabled']) || ! $share['ShareEnabled'])\n continue;\n\n if (! isset($share['FileEnabled']) || ! $share['FileEnabled'])\n continue;\n\n $linestoadd .= \"[\" . $name . \"]\\n\";\n $linestoadd .= \"\\tpath = \" . $share[\"ShareDir\"] . \"\\n\";\n $linestoadd .= \"\\tcomment = \" . $share[\"FileComment\"] . \"\\n\";\n $linestoadd .= \"\\tbrowseable = Yes\\n\";\n\n if ((int)$share[\"FilePermission\"] == self::PERMISSION_READ_WRITE)\n $linestoadd .= \"\\tread only = No\\n\";\n\n if (isset($share[\"FilePublicAccess\"]) && $share[\"FilePublicAccess\"]) {\n $linestoadd .= \"\\tguest ok = Yes\\n\";\n } else {\n $linestoadd .= \"\\tguest ok = No\\n\";\n $linestoadd .= \"\\tdirectory mask = 0775\\n\";\n $linestoadd .= \"\\tcreate mask = 0664\\n\";\n $linestoadd .= \"\\tvalid users = @\\\"%D\" . '\\\\' . trim($share[\"ShareGroup\"]) . \"\\\", @\" .\n trim($share[\"ShareGroup\"]) . \"\\n\";\n }\n\n $linestoadd .= \"\\tveto files = /.flexshare*/\\n\";\n\n $vfsobject = \"\";\n\n if (isset($share[\"FileRecycleBin\"]) && $share[\"FileRecycleBin\"]) {\n $vfsobject .= \" recycle:recycle\";\n $linestoadd .= \"\\trecycle:repository = .trash/%U\\n\";\n $linestoadd .= \"\\trecycle:maxsize = 0\\n\";\n $linestoadd .= \"\\trecycle:versions = Yes\\n\";\n $linestoadd .= \"\\trecycle:keeptree = Yes\\n\";\n $linestoadd .= \"\\trecycle:touch = No\\n\";\n $linestoadd .= \"\\trecycle:directory_mode = 0775\\n\";\n }\n\n if (isset($share[\"FileAuditLog\"]) && $share[\"FileAuditLog\"]) {\n $vfsobject .= \" full_audit:audit\";\n $linestoadd .= \"\\taudit:prefix = %u\\n\";\n $linestoadd .= \"\\taudit:success = open opendir\\n\";\n $linestoadd .= \"\\taudit:failure = all\\n\";\n $linestoadd .= \"\\taudit:facility = LOCAL5\\n\";\n $linestoadd .= \"\\taudit:priority = NOTICE\\n\";\n }\n\n if ($vfsobject)\n $linestoadd .= \"\\tvfs object =$vfsobject\\n\";\n\n $linestoadd .= \"\\n\";\n }\n\n $file->add_lines($linestoadd);\n\n // Make sure Samba has flexshare include\n //--------------------------------------\n\n $samba->add_include('/etc/samba/flexshare.conf');\n\n // Validate smbd configuration\n //----------------------------\n\n $config_ok = TRUE;\n\n try {\n $shell = new Shell();\n $options['validate_exit_code'] = FALSE;\n $exitcode = $shell->execute(self::CMD_VALIDATE_SMBD, '-s', FALSE, $options);\n } catch (Exception $e) {\n $config_ok = FALSE;\n clearos_log(self::LOG_TAG, \"Invalid Samba config: \" . clearos_exception_message($e));\n }\n\n if ($config_ok) {\n // Delete backups\n if ($backup_exists)\n $backup->delete();\n } else {\n // Recover backups\n if ($backup_exists) {\n try {\n $backup->move_to(self::SMB_VIRTUAL_HOST_PATH . \"/\" . self::FILE_SMB_VIRTUAL);\n } catch (Exception $e) {\n // Supresss error here...could be same file\n }\n }\n\n throw new Engine_Exception(lang('flexshare_config_validation_failed'));\n }\n }",
"function setShareOb(&$shareOb)\n {\n if (!is_a($shareOb, 'Horde_Share')) {\n return PEAR::raiseError('This object needs a Horde_Share instance as storage handler!');\n }\n $this->_shareOb = &$shareOb;\n }",
"public function updateShare(Share $share)\n {\n $this->request->getSession()->start();\n $contents = $this->request->request->all(); \n $data = json_decode($this->request->getContent(), true); \n $content = $contents['share']['content'] ?? $data['content'];\n\n $share->setContent($content);\n $share->setUpdateAt(new \\DateTime(null, new \\DateTimeZone(\"UTC\")));\n $this->dm->flush();\n }",
"function update_share($name, $update_perms = TRUE)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $share = $this->get_share($name);\n\n $this->_generate_web_flexshares();\n $this->_generate_ftp_flexshares();\n $this->_generate_file_flexshares();\n\n $this->_update_folder_links($name, $this->_get_parameter($name, 'ShareDir'));\n\n if ($update_perms)\n $this->_update_folder_attributes($share['ShareDir'], $share['ShareOwner'], $share['ShareGroup'], $share['ShareSystemPermissions']);\n }",
"public function setShareWith($user);",
"public function setShared($name, $flag)\n {\n $this->configure(['shared' => [$name => (bool) $flag]]);\n }"
] | [
"0.5975998",
"0.567545",
"0.55768365",
"0.5405922",
"0.5395243",
"0.5377395",
"0.5346309",
"0.5309125",
"0.5298229",
"0.52815795",
"0.52597827",
"0.5251755",
"0.52334446",
"0.5233108",
"0.5226505",
"0.52197707",
"0.5193306",
"0.5125719",
"0.51255184",
"0.5064724",
"0.5049621",
"0.50482166",
"0.50479776",
"0.5032459",
"0.50217235",
"0.50182724",
"0.500656",
"0.5006435",
"0.5005799",
"0.49880162"
] | 0.5681774 | 1 |
Sets the enabled of filebased (SAMBA) access. | function set_file_enabled($name, $enabled)
{
clearos_profile(__METHOD__, __LINE__);
$this->_set_parameter($name, 'FileEnabled', $enabled);
$this->_generate_file_flexshares();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function enableSetFile($settings = array())\n {\n if ($settings === true) {\n $settings = array();\n }\n\n self::structSet('modules', 'setFile', $settings + array(\n 'path' => dSystem::getGlobal('baseDir') . '/dat/',\n 'cbAfterFileAccept' => false, // Callback(filename, Ofilename)\n ));\n }",
"public function setPermission(File $f, $access, $enable = null, $owneronly = null)\n {\n $mode = $this->generateAccessMode($f, $enable, $owneronly);\n $this->fs->chmod($f->getAbsolutePath(), $mode);\n }",
"function setAllowFile($file){\n $this->allow_file = array_map('strtolower', $file);\n $this->forbid_file = array();\n }",
"public function setReadOnly(File $f)\n {\n $string = sprintf('%o', $this->getBooleanAttributes($f));\n $string[3] = \"4\";\n return $this->fs->chmod($f->getAbsolutePath(), octdec($string));\n }",
"function set_file_public_access($name, $public_access)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FilePublicAccess', $public_access);\n }",
"protected function enableReadWrite()\n {\n //Make sure we are bound in write mode\n $auth = \\Flipside\\AuthProvider::getInstance();\n $ldap = $auth->getMethodByName('Flipside\\Auth\\LDAPAuthenticator');\n if($ldap !== false)\n {\n $this->server = $ldap->getAndBindServer(true);\n }\n }",
"public function setReadOnly($value){\n\t\t$this->readOnly=$value;\n\t}",
"function set_file_browseable($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FileBrowseable', $state);\n }",
"public function setEnabled($enabled);",
"public function setEnabled($enabled);",
"public function setEnabled(bool $enable);",
"public static function setPermission( $file, $access=null )\n {\n\n if( $access == null )\n {\n\n $access = Settings::getSetting('filesystem_default_access');\n }\n\n chmod( self::getFilePath( $file ), $access );\n }",
"function setForbidFile($file){\n $this->forbid_file = array_map('strtolower',$file);\n $this->allow_file = array();\n }",
"public function setAccountEnabled(?bool $value): void {\n $this->getBackingStore()->set('accountEnabled', $value);\n }",
"public final function setEnabled($enabled) {\n\t\t$this->_disabled = empty($enabled);\n\t}",
"public function setEnabled($enabled)\n {\n $this->enabled = $enabled;\n }",
"public function setEnabled($enabled)\n {\n $this->enabled = $enabled;\n }",
"public function setEnabled($enabled)\n {\n $this->enabled = $enabled;\n }",
"protected function setApplicationPermissions()\n\t{\n\t\t$files = (array) $this->rocketeer->getOption('remote.permissions.files');\n\t\tforeach ($files as $file) {\n\t\t\t$this->setPermissions($file);\n\t\t}\n\t}",
"public function setScanEnabled($enabled){\n $this->scanEnabled = $enabled;\n }",
"public function setAllowUpload(bool $value = true): self\r\n {\r\n $this->extras['allow_upload'] = $value;\r\n return $this;\r\n }",
"public function setEnabled(bool $enabled);",
"function set_ftp_enabled($name, $enabled)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FtpEnabled', $enabled);\n $this->_generate_ftp_flexshares();\n }",
"public function setReadOnly() { \n $this->setAttribute('readonly', 'readonly');\n }",
"public static function enableGlobally($enabled)\n {\n self::$enabledGlobally = $enabled;\n\n }",
"public static function enable()\n {\n self::$enabled = true;\n }",
"public function setDirectoryExtensionsEnabled(?bool $value): void {\n $this->getBackingStore()->set('directoryExtensionsEnabled', $value);\n }",
"public function setEnable( $value = true )\r\n\t{\r\n\t\t$this->enabled = (bool) $value;\r\n\t}",
"public function changeMod($setting = false) {\n\tif (!$setting) {$setting = Prefs::FILE_DEFAULT_PERMISSIONS;}\n\tif (!is_numeric($setting)) {throw new DStructGeneralException('FSPermission::changeMod() - value must be numeric');}\n\tchmod($this->path, $setting);\n}",
"function setDefaultAccess($value) {\n\t $this->defaultAccess = (int) $value == 0 ? 0 : 1;\n\t}"
] | [
"0.65618473",
"0.5961018",
"0.5756387",
"0.57385343",
"0.5531341",
"0.5495109",
"0.5489682",
"0.54382235",
"0.5428467",
"0.5428467",
"0.53870726",
"0.5362964",
"0.5339313",
"0.5320262",
"0.52772206",
"0.52723116",
"0.52723116",
"0.52723116",
"0.52654016",
"0.52162904",
"0.52146345",
"0.52140546",
"0.52101487",
"0.520251",
"0.52021027",
"0.5199553",
"0.5194189",
"0.51904136",
"0.5186871",
"0.51649463"
] | 0.6674318 | 0 |
Sets file sharing public access flag for the flexshare. | function set_file_public_access($name, $public_access)
{
clearos_profile(__METHOD__, __LINE__);
$this->_set_parameter($name, 'FilePublicAccess', $public_access);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCanCurrentUserShareExternally($value)\n {\n $this->setProperty(\"CanCurrentUserShareExternally\", $value, true);\n }",
"public function setIsExternalShareEnabled($val)\n {\n $this->_propDict[\"isExternalShareEnabled\"] = $val;\n return $this;\n }",
"function allowSharing() {\n\t\tVtiger_Access::allowSharing($this, true);\n\t}",
"public function setPublic(): void\n {\n $this->setCacheControlOption('_public', true);\n }",
"public function share(bool $share = true)\n {\n // cannot be shared\n }",
"public function setShare($val)\n {\n $this->_propDict[\"share\"] = $val;\n return $this;\n }",
"function update_share_permissions()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $enforce = $this->get_enforce_group_permissions();\n\n if ($enforce == self::ENFORCE_OFF)\n return;\n\n $type = ($enforce == self::ENFORCE_FULL) ? self::TYPE_ALL : self::TYPE_FILE_SHARE;\n $shares = $this->_get_shares($type);\n\n foreach ($shares as $name => $detail)\n $this->_update_folder_attributes($detail['ShareDir'], $detail['ShareOwner'], $detail['ShareGroup'], $detail['ShareSystemPermissions']);\n }",
"public function setCanCurrentUserShareInternally($value)\n {\n $this->setProperty(\"CanCurrentUserShareInternally\", $value, true);\n }",
"function set_share_state($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $share = $this->get_share($name);\n $state_value = ($state) ? 1 : 0;\n\n $this->_set_parameter($name, 'ShareEnabled', $state_value);\n\n $this->_update_folder_links($name, $this->_get_parameter($name, 'ShareDir'));\n }",
"public function setPublic($flag = true)\n\t{\n\t\t$this->_public = $flag;\n\t\treturn $this;\n\t}",
"public function setCanShareFolder($value)\n {\n $this->setProperty(\"CanShareFolder\", $value, true);\n }",
"public function set_is_public( $value ) {\n\t\t$this->definition[ self::DEF_PUBLIC ] = ( $value ? 'public' : 'hidden' );\n\t}",
"public function update_public()\n {\n\t\t$file_id = Input::get('file_id');\n\t\t$public = Input::get('public');\n\t\tif(isset($public)) {\n\t\t\t$public = true;\n\t\t} else {\n\t\t\t$public = false;\n\t\t}\n\n\t\t$upload = Upload::find($file_id);\n\t\tif(isset($upload->id)) {\n\t\t\tif($upload->user_id == Auth::user()->id || Auth::user()->hasRole('SUPER_ADMIN|ADMIN')) {\n\n\t\t\t\t// Update Caption\n\t\t\t\t$upload->public = $public;\n\t\t\t\t$upload->save();\n\n\t\t\t\treturn response()->json([\n\t\t\t\t\t'status' => \"success\"\n\t\t\t\t]);\n\n\t\t\t} else {\n\t\t\t\treturn response()->json([\n\t\t\t\t\t'status' => \"failure\",\n\t\t\t\t\t'message' => \"Unauthorized Access 1\"\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Upload not found\"\n\t\t\t]);\n\t\t}\n }",
"abstract public function setPublic($storageGroup, $storageId, $isPublic, $mimeType);",
"public function setDefaultShareLinkPermission($value)\n {\n $this->setProperty(\"DefaultShareLinkPermission\", $value, true);\n }",
"public function setShared($shared);",
"public function setIsPublic($flag = true) {\n $this->headers->removeCacheControlDirective(HeaderContainer::CACHE_CONTROL_PRIVATE);\n if ($flag) {\n $this->headers->addCacheControlDirective(HeaderContainer::CACHE_CONTROL_PUBLIC);\n } else {\n $this->headers->removeCacheControlDirective(HeaderContainer::CACHE_CONTROL_PUBLIC);\n }\n }",
"public function setShared($name, $flag)\n {\n $this->configure(['shared' => [$name => (bool) $flag]]);\n }",
"public function setAccess($access);",
"public function setPublicWriteAccess($allowed)\n {\n return $this->setWriteAccess(self::PUBLIC_KEY, $allowed);\n }",
"public function getIsExternalShareEnabled()\n {\n if (array_key_exists(\"isExternalShareEnabled\", $this->_propDict)) {\n return $this->_propDict[\"isExternalShareEnabled\"];\n } else {\n return null;\n }\n }",
"public function set_publicPage(bool $publicPage){\n\t\t$this->publicPage = $publicPage;\n\t}",
"private function insideOfPublic()\n {\n if ($this->isInsideOfStorage) {\n return $this->isInsideOfPublic = false;\n }\n \n $inside = Str::contains($this->fileAsset, $this->fullUrl);\n\n if ($inside) {\n $this->fileUrlUri = str_replace($this->fullUrl, ' ', $this->fileAsset);\n $this->fakePath = str_replace('/', ' > ', $this->fileUrlUri);\n if (file_exists(public_path(ltrim(trim($this->fileUrlUri),'/')))) {\n $this->fileType = File::mimeType(public_path(ltrim(trim($this->fileUrlUri),'/'))); \n }\n }\n\n return $this->isInsideOfPublic = $inside;\n }",
"public function setPublicReadAccess($allowed)\n {\n return $this->setReadAccess(self::PUBLIC_KEY, $allowed);\n }",
"function is_public()\n {\n return $this->cdn_enabled == True ? True : False;\n }",
"public static function setPermission( $file, $access=null )\n {\n\n if( $access == null )\n {\n\n $access = Settings::getSetting('filesystem_default_access');\n }\n\n chmod( self::getFilePath( $file ), $access );\n }",
"function setDefaultSharing($permission_text='Public_ReadWriteDelete') {\n\t\tVtiger_Access::setDefaultSharing($this, $permission_text);\n\t}",
"public function allowPublicAccess($set)\n {\n $action = new AllowPublicAccessAction($this->storage);\n $action->setAllowPublicAccess($set);\n\n return $action;\n }",
"public function setFilesPermissionInS3($v)\r\n\t{\r\n\t\tif (!is_null($v)){\r\n\t \t$this->putInCustomData(self::CUSTOM_DATA_FILES_PERMISSION_IN_S3, $v);\r\n\t\t}\r\n\t}",
"public function isPublic()\r\n\t{\r\n\t\treturn true; \r\n\t}"
] | [
"0.6613685",
"0.65886295",
"0.6469735",
"0.63175035",
"0.6282412",
"0.6193231",
"0.6160159",
"0.61133647",
"0.6100735",
"0.5971921",
"0.59633285",
"0.59301627",
"0.5815958",
"0.5815301",
"0.58045495",
"0.5713837",
"0.5701119",
"0.5696229",
"0.56791407",
"0.5675191",
"0.56654096",
"0.55710936",
"0.5563668",
"0.55577636",
"0.55107766",
"0.55061936",
"0.54986966",
"0.5495921",
"0.5452702",
"0.544229"
] | 0.72395027 | 0 |
Sets the recycle bin state. | function set_file_recycle_bin($name, $state)
{
clearos_profile(__METHOD__, __LINE__);
$this->_set_parameter($name, 'FileRecycleBin', $state);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDirtyState(int $dirtyState);",
"public function setState($state)\n {\n parent::setDataSet($state);\n }",
"public static function __set_state($data);",
"final public function set_state($state) \n {\n $this->_state = $state;\n }",
"public function setDirtyState($dirtyState);",
"public function setReindexZeroReplica($flag)\n {\n $this->reindexZeroReplica = (bool) $flag;\n }",
"protected function resetStatus()\n\t\t{\n\t\t\t$this->status =\n\t\t\t[\n\t\t\t\t'state' => interfaces\\Process::READY,\n\t\t\t\t'process' => [],\n\t\t\t\t'times' =>\n\t\t\t\t[\n\t\t\t\t\t'start' => null,\n\t\t\t\t\t'stop' => null\n\t\t\t\t]\n\t\t\t];\n\t\t}",
"public function resetState();",
"public function resetState();",
"public function setDirty()\n\t{\n\t\t$this->_initCache();\n\t\t$this->_dirty = true;\n\t}",
"public function setBin($bin)\n {\n $this->bin = $bin;\n\n return $this;\n }",
"public function setBin($bin)\n {\n $this->bin = $bin;\n\n return $this;\n }",
"function setStatus($bS=false){\n $this->bStatus = is_bool($bS) ? $bS : false;\n }",
"public function markAsRead(){\n if($this->getStatus() == self::STATUS_UNDREAD){\n $this->setStatus(self::STATUS_READ)->save();\n }\n $this->getResource()->markAsRead($this);\n }",
"public function setnetworkactive($state = true) {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n $args[ \"params\" ] = [ $state ];\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }",
"public function markAsRead()\n {\n $this->status = self::STATUS_READ;\n $this->save();\n }",
"public function setBitLockerStatus($val)\n {\n $this->_propDict[\"bitLockerStatus\"] = $val;\n return $this;\n }",
"public function recoverState()\n\t{\n\t\tparent::recoverState();\n\t\t$this->setType('checkbox');\n\t}",
"public function changeState($state)\n {\n $this->model->status = 1 * $state;\n $this->model->save();\n }",
"public function set_state(array $state)\n {\n $state_query = http_build_query($state, '', '&'); \n\n //tell the UCS to load the serialized state\n $this->send_raw_command('l '.$state_query);\n\n //discard the response\n $this->read_response();\n }",
"function setState($state) {\n \n $this->state = $state;\n \n }",
"public function reset(array $state = array())\n\t{\n\t\t$state += array(\n\t\t\t'connection' => TRUE,\n\t\t\t'failed_circuits' => 0,\n\t\t\t'failed_total' => 0,\n\t\t\t'ttl' => 0,\n\t\t);\n\n\t\t$this->state = $state;\n\n\t\t// Save the state\n\t\t$this->_driver->save($this->name, $this->state);\n\n\t\treturn $this;\n\t}",
"function setRunningStatus($a_nr)\n\t{\n\t\tinclude_once './Services/Administration/classes/class.ilSetting.php';\n\t\t$set = new ilSetting();\n\t\t$set->set(\"adn_db_update_running\", $a_nr);\n\t\t$this->db_update_running = $a_nr;\n\t}",
"public function setFlag( $flag ) { $this->flags = $this->flags | $flag; }",
"public function setRead(){\n bbs_setmailreaded($this->_box->getFullPath(), $this->num);\n }",
"public function recycled()\n {\n //\n }",
"protected function _setIsDirty()\n {\n $this->_is_dirty = true;\n }",
"public function setState($state)\n {\n fhread_mutex_lock($this->stateMutex);\n $this->state = $state;\n fhread_mutex_unlock($this->stateMutex);\n }",
"public function testSetRib() {\n\n $obj = new Banques();\n\n $obj->setRib(\"rib\");\n $this->assertEquals(\"rib\", $obj->getRib());\n }",
"public function setState($state) {\n\t\t$this->state = $state;\n\t}"
] | [
"0.52698237",
"0.5192759",
"0.51762736",
"0.5136284",
"0.51239383",
"0.51225746",
"0.51030403",
"0.502305",
"0.502305",
"0.49858955",
"0.4960124",
"0.4960124",
"0.49301422",
"0.4883136",
"0.48697528",
"0.48663867",
"0.48587686",
"0.48549998",
"0.4853451",
"0.48495245",
"0.48446026",
"0.4776285",
"0.47566417",
"0.4744966",
"0.4699542",
"0.4699077",
"0.4677963",
"0.4677729",
"0.46750176",
"0.4658286"
] | 0.7006958 | 0 |
Updates the share for some API calls. This method should be called after updating the group (set_group) or description (set_description), i.e. information that needs to get propagated to FTP, Web, and Samba configlets. | function update_share($name, $update_perms = TRUE)
{
clearos_profile(__METHOD__, __LINE__);
$share = $this->get_share($name);
$this->_generate_web_flexshares();
$this->_generate_ftp_flexshares();
$this->_generate_file_flexshares();
$this->_update_folder_links($name, $this->_get_parameter($name, 'ShareDir'));
if ($update_perms)
$this->_update_folder_attributes($share['ShareDir'], $share['ShareOwner'], $share['ShareGroup'], $share['ShareSystemPermissions']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_share_permissions()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $enforce = $this->get_enforce_group_permissions();\n\n if ($enforce == self::ENFORCE_OFF)\n return;\n\n $type = ($enforce == self::ENFORCE_FULL) ? self::TYPE_ALL : self::TYPE_FILE_SHARE;\n $shares = $this->_get_shares($type);\n\n foreach ($shares as $name => $detail)\n $this->_update_folder_attributes($detail['ShareDir'], $detail['ShareOwner'], $detail['ShareGroup'], $detail['ShareSystemPermissions']);\n }",
"public function updateShare(Share $share)\n {\n $this->request->getSession()->start();\n $contents = $this->request->request->all(); \n $data = json_decode($this->request->getContent(), true); \n $content = $contents['share']['content'] ?? $data['content'];\n\n $share->setContent($content);\n $share->setUpdateAt(new \\DateTime(null, new \\DateTimeZone(\"UTC\")));\n $this->dm->flush();\n }",
"public function update(User $user, share $share)\n {\n //\n }",
"public function updateShareableAction() {\n // Validate request methods\n $this->validateRequestMethod('POST');\n\n $db = Engine_Api::_()->getDbtable('actions', 'advancedactivity')->getAdapter();\n $db->beginTransaction();\n try {\n $this->_action->shareable = !$this->_action->shareable;\n $this->_action->save();\n $db->commit();\n\n $this->respondWithSuccess($this->_action->shareable);\n } catch (Exception $e) {\n $db->rollBack();\n $this->respondWithValidationError('internal_server_error', $e->getMessage());\n }\n }",
"public function setShare($val)\n {\n $this->_propDict[\"share\"] = $val;\n return $this;\n }",
"protected function _set_parameter($name, $key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // Grab location of configuration (flexshare.conf or configlet) \n $config_file = $this->_get_parameter($name, 'ShareConfig');\n\n // Convert carriage returns\n $value = preg_replace(\"/\\n/\", \"\", $value);\n\n // Update tag if it exists\n try {\n $match = FALSE;\n $file = new File($config_file);\n\n $needle = \"/^\\s*$key\\s*=\\s*/i\";\n $match = $file->replace_lines_between($needle, \" $key=$value\\n\", \"/<Share $name>/\", \"/<\\/Share>/\");\n } catch (File_No_Match_Exception $e) {\n // Do nothing\n }\n\n // If tag does not exist, add it\n if (! $match)\n $file->add_lines_after(\" $key=$value\\n\", \"/<Share $name>/\");\n\n $this->shares = NULL; // Force a configuration reload\n\n // Update last modified\n if (preg_match(\"/^Web/\", $key))\n $lastmod = \"WebModified\";\n else if (preg_match(\"/^Ftp/\", $key))\n $lastmod = \"FtpModified\";\n else if (preg_match(\"/^File/\", $key))\n $lastmod = \"FileModified\";\n else if (preg_match(\"/^Email/\", $key))\n $lastmod = \"EmailModified\";\n else\n return;\n\n try {\n $mod = \" \" . $lastmod . \"=\" . time() . \"\\n\";\n $file->replace_lines_between(\"/\" . $lastmod . \"/\", $mod, \"/<Share $name>/\", \"/<\\/Share>/\");\n } catch (File_No_Match_Exception $e) {\n $file->add_lines_after($mod, \"/<Share $name>/\");\n }\n }",
"public function setShareType($shareType);",
"function add_share($name, $description, $group, $directory, $type = FALSE)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $name = strtolower($name);\n\n // if directory = root share path... tack on name\n if ($directory == self::SHARE_PATH)\n $directory .= '/' . $name;\n\n // Validate\n // --------\n\n Validation_Exception::is_valid($this->validate_name($name));\n Validation_Exception::is_valid($this->validate_description($description));\n Validation_Exception::is_valid($this->validate_group($group));\n Validation_Exception::is_valid($this->validate_directory($directory));\n\n // Windows limitations\n //--------------------\n\n $groupobj = Group_Factory::create($name);\n\n if ($groupobj->exists())\n throw new Validation_Exception(lang('flexshare_name_overlaps_with_group'));\n\n $userobj = User_Factory::create($name);\n\n if ($userobj->exists())\n throw new Validation_Exception(lang('flexshare_name_overlaps_with_username'));\n\n $file = new File(self::FILE_CONFIG);\n\n if (! $file->exists()) {\n $file->create('root', 'root', '0640');\n $file->add_lines(\"# Flexshare Configuration\");\n }\n\n // Check for non-uniques\n if (count($file->get_search_results(\"<Share $name>\")) > 0)\n throw new Engine_Exception(lang('flexshare_share_already_exists'));\n\n // Handle the type\n // This parameter used to be a boolean $internal.\n // Keep this logic for now\n\n if (($type === FALSE) || ($type === self::TYPE_FILE_SHARE))\n $internal = '';\n else if (($type === TRUE) || ($type === self::TYPE_WEB_SITE))\n $internal = 1;\n else if ($type === self::TYPE_WEB_APP)\n $internal = 2;\n\n // Create folder (if necessary) and add skeleton\n $folder = new Folder(self::SHARE_PATH . \"/$name\");\n\n if (! $folder->exists()) {\n if ($internal == 1)\n $folder_owner = self::CONSTANT_WEB_SITE_USERNAME;\n else if ($internal == 2)\n $folder_owner = self::CONSTANT_WEB_APP_USERNAME;\n else\n $folder_owner = self::CONSTANT_FILES_USERNAME;\n\n $folder->create($folder_owner, $group, '0770');\n }\n\n // Add it\n $newshare = \"<Share $name>\\n\" .\n \" ShareDescription=$description\\n\" .\n \" ShareGroup=$group\\n\" .\n \" ShareCreated=\" . time() . \"\\n\" .\n \" ShareModified=\" . time() . \"\\n\" .\n \" ShareEnabled=0\\n\" .\n \" ShareDir=\" . self::SHARE_PATH . \"/$name\\n\" .\n \" ShareInternal=$internal\\n\" .\n \"</Share>\\n\"\n ;\n $file->add_lines($newshare);\n\n $this->shares = NULL; // Force a configuration reload\n\n // Now set directory\n $this->set_directory($name, $directory);\n }",
"function set_share_state($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $share = $this->get_share($name);\n $state_value = ($state) ? 1 : 0;\n\n $this->_set_parameter($name, 'ShareEnabled', $state_value);\n\n $this->_update_folder_links($name, $this->_get_parameter($name, 'ShareDir'));\n }",
"function setShareOb(&$shareOb)\n {\n if (!is_a($shareOb, 'Horde_Share')) {\n return PEAR::raiseError('This object needs a Horde_Share instance as storage handler!');\n }\n $this->_shareOb = &$shareOb;\n }",
"function save()\n {\n $result = Horde::callHook('_horde_hook_share_modify', array($this),\n 'horde', false);\n if (is_a($result, 'PEAR_Error')) {\n return $result;\n }\n\n return $this->_save();\n }",
"public function _addShareToGroup()\r\n {\r\n if(empty($_POST)){$_POST = json_decode(file_get_contents(\"php://input\"),true);}\r\n\t\tif(!empty($_POST['group_ids']) && intval($_POST['share_id'])){\r\n\t\t\t// Try to assign POST values to attributes\r\n\t\t\t$share_arr = array();\r\n\t\t\t$share_arr['share_id'] = intval($_POST['share_id']);\r\n\t\t\t$share_arr['create_date'] = intval($_POST['create_date']);\r\n\t\t\t$group_ids = trim($_POST['group_ids']);\r\n\t\t\t$group_arr = explode(',',rtrim($group_ids,','));\r\n\t\t\t$i = 0;\r\n\t\t\tforeach($group_arr as $k=>$v){\r\n\t\t\t\t$model = new ShareToGroup;\r\n\t\t\t\t$share_arr['group_id'] = intval($v);\r\n\t\t\t\t// Find the item by group_id and share_id\r\n\t\t\t\t$share_info = ShareToGroup::model()->find('group_id=:group_id AND share_id=:share_id', array(':group_id'=>$share_arr['group_id'], ':share_id'=>$share_arr['share_id']));\r\n\t\t\t\tif(empty($share_info)){\r\n\t\t\t\t\tforeach($share_arr as $var=>$value) {\r\n\t\t\t\t\t\t// Does the model have this attribute?\r\n\t\t\t\t\t\tif($model->hasAttribute($var)) {\r\n\t\t\t\t\t\t\t$model->$var = $value;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// No, raise an error\r\n\t\t\t\t\t\t\t$this->_sendResponse(500, sprintf('Parameter [%s] is not allowed for model [%s]', $var, $_GET['model']) );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Try to save the model\r\n\t\t\t\tif($model->save()){\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->_sendResponse(200, sprintf('There are [%s] new items has been pushed.', $i) );\r\n\t\t}else{\r\n\t\t\t$this->_sendResponse(501, sprintf('Error: Parameter share_id and group_ids is required') );\r\n\t\t\treturn;\r\n\t\t}\r\n }",
"public function setShared($shared);",
"function _get_shares($type)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($this->shares === NULL) {\n $shares = array();\n\n $folder = new Folder(self::PATH_CONFIGLET);\n $configlets = $folder->get_recursive_listing();\n\n $configs = array(self::FILE_CONFIG);\n\n foreach ($configlets as $configlet) {\n if (preg_match('/\\.conf$/', $configlet))\n $configs[] = self::PATH_CONFIGLET . '/' . $configlet;\n }\n\n foreach ($configs as $config_file) {\n $file = new File($config_file);\n\n if (!$file->exists())\n continue;\n\n $lines = $file->get_contents_as_array();\n\n $match = array();\n\n foreach ($lines as $line) {\n if (preg_match(self::REGEX_OPEN, $line, $match)) {\n $share['Name'] = $match[1];\n } elseif (preg_match(\"/^\\s*([[:alpha:]]+)\\s*=\\s*(.*$)/i\", $line, $match)) {\n $share[$match[1]] = $match[2];\n } elseif (preg_match(self::REGEX_CLOSE, $line)) {\n // ShareConfig and ShareOwner are implied fields\n if ($share['ShareInternal'] == 2)\n $share['ShareOwner'] = self::CONSTANT_WEB_APP_USERNAME;\n else if (clearos_app_installed('web_server'))\n $share['ShareOwner'] = self::CONSTANT_WEB_SITE_USERNAME;\n else\n $share['ShareOwner'] = self::CONSTANT_FILES_USERNAME;\n\n $share['ShareConfig'] = $config_file;\n $share['WebDefaultSite'] = ($share['ShareDir'] == '/var/www/html') ? 1 : 0;\n\n // Legacy web server configuration\n if ($share['ShareInternal'] == 1) {\n if (empty($share['WebDefaultSite']))\n $vhost_filename = 'virtual.' . $share['Name'] . '.conf';\n else\n $vhost_filename = 'clearos.default.conf';\n\n $file = new File(self::WEB_VIRTUAL_HOST_PATH . '/' . $vhost_filename);\n\n if ($file->exists())\n $share['WebCustomConfiguration'] = TRUE;\n else\n $share['WebCustomConfiguration'] = FALSE;\n }\n\n if (empty($share['ShareSystemPermissions']))\n $share['ShareSystemPermissions'] = self::DEFAULT_SYSTEM_PERMISSIONS;\n\n $shares[$share['Name']] = $share;\n\n $share = array('WebEnabled' => 0, 'FtpEnabled' => 0, 'FileEnabled' => 0, 'EmailEnabled' => 0);\n }\n }\n }\n\n $this->shares = $shares;\n }\n\n if ($type === self::TYPE_ALL) {\n return $this->shares;\n } else {\n $shares = array();\n\n foreach ($this->shares as $name => $details) {\n if ((($type === self::TYPE_FILE_SHARE) && empty($details['ShareInternal']))\n || (($type === self::TYPE_WEB_SITE) && ($details['ShareInternal'] == 1))\n || (($type === self::TYPE_WEB_APP) && ($details['ShareInternal'] == 2))\n )\n $shares[$name] = $details;\n }\n } \n\n return $shares;\n }",
"public function setSharingType($sharingType)\n {\n $this->_sharingType = $sharingType;\n }",
"function inkpro_ajax_share() {\r\n\t\textract( $_POST );\r\n\t\tif ( isset( $_POST['postId'] ) ){\r\n\t\t\t$post_id = absint( $_POST['postId'] );\r\n\t\t\t$shares = absint( get_post_meta( $post_id , '_inkpro_shares', true ) );\r\n\t\t\t$new_shares = $shares + 1;\r\n\t\t\tupdate_post_meta( $post_id, '_inkpro_shares', $new_shares );\r\n\t\t\techo absint( $new_shares );\r\n\t\t\texit;\r\n\t\t}\r\n\t}",
"private function save_sharing_data()\n\t{\n\t\t// Remove all existing records\n\t\tDB::delete(self::SHARING_TABLE)->where('report_id', '=', $this->id)->execute();\n\n\t\t// Add new records\n\t\tif (count($this->shared_with_groups) > 0)\n\t\t{\n\t\t\t$q = DB::insert(self::SHARING_TABLE)->columns(array('report_id', 'group_id'));\n\t\t\tforeach ($this->shared_with_groups as $group_id)\n\t\t\t{\n\t\t\t\t$q->values(array($this->id, $group_id));\n\t\t\t}\n\t\t\t$q->execute();\n\t\t}\n\t}",
"public function setShareCounter($shareCounter) {\r\n\t$this->shareCounter = $shareCounter;\r\n }",
"function update_activity_share_count( $activity_id ) {\n\n\t\t// Get Activity\n\t\t$activity = new BP_Activity_Activity( $activity_id );\n\n\t\t// Shared Activity ID.\n\t\t$shared_activity_id = $activity->secondary_item_id;\n\n\t\tif ( $activity->type != 'activity_share' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get share count.\n\t\t$share_count = bp_activity_get_meta( $shared_activity_id, 'yz_activity_share_count' );\n\n\t\t// Calc share count.\n\t\t$share_count = ! empty( $share_count ) ? (int) $share_count + 1 : 1;\n\n\t\t// Update count.\n\t\tbp_activity_update_meta( $shared_activity_id, 'yz_activity_share_count', $share_count );\n\n\t\t// Action.\n\t\tdo_action( 'yz_after_activity_share', $activity_id, $shared_activity_id );\n\t}",
"function share($share_type = \"FB_POST_TO_WALL\", \n $provider_id, \n $provider_response = \"200\", \n $extra_app_details = \"\", \n $url = \"\")\n {\n // Assemble Resource URI\n $target_url = \"http://\" . $this->client_id . \".vsocial.com/api/v1/me/share/\";\n\n // Preparing POST data\n $post_fields = array(\n \"vsoc_access_token\" => $this->session->userdata('vsoc_access_token'),\n \"providerId\" => $provider_id,\n \"providerResponse\" => $provider_response,\n \"extraAppDetails\" => $extra_app_details,\n \"shareType\" => $share_type,\n \"url\" => $url\n );\n\n // URL Encode all POST fields\n foreach ($post_fields as $key => $value) {$post_string .= $key . '=' . urlencode($value) . '&';}\n rtrim($post_string, '&');\n\n // Initiate cURL\n $ch = curl_init($target_url);\n\n curl_setopt($ch, CURLOPT_POST, count($post_fields));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //Execute cURL\n $return_json = curl_exec($ch);\n\n\n }",
"public function update(Request $request, shareholder $shareholder)\n {\n //\n }",
"public function share(bool $share = true)\n {\n // cannot be shared\n }",
"public function getShare();",
"public function setSharingManager(SharingManagerInterface $sharingManager);",
"public function mainShareFunction()\n {\n if ($this->userHasRight(18, 0) == true) {\n $besitzer = $this->getUserID($_SESSION['username']);\n $this->sharenav($besitzer);\n $this->createKontoShare($besitzer);\n $this->deleteKontoShare($besitzer);\n $this->showAllShares($besitzer);\n } else {\n echo \"<p class='info'>Du besitzt keine Schreibrechte in diesem Bereich.</p>\";\n }\n }",
"function set_group_activity_share_count( $content, $user_id, $group_id, $activity_id ) {\n\t\t$this->update_activity_share_count( $activity_id );\n\t}",
"public function edit(Sharing $sharing)\n {\n //\n }",
"function delete_share($name, $delete_dir)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n Validation_Exception::is_valid($this->validate_name($name));\n\n // Set directory back to default\n // This will remove any mount points\n\n $defaultdir = self::SHARE_PATH . '/' . $name;\n $this->set_directory($name, $defaultdir);\n\n $file = new File(self::FILE_CONFIG);\n\n if (! $file->exists())\n throw new File_Not_Found_Exception(self::FILE_CONFIG);\n\n // Backup in case we need to go back to original\n $file->move_to(self::PATH_TEMP . \"/flexshare.conf.orig\");\n\n // Create new file in parallel\n $newfile = new File(self::FILE_CONFIG . \".cctmp\", TRUE);\n\n if ($newfile->exists())\n $newfile->delete();\n\n $newfile->create('root', 'root', '0644');\n\n $lines = $file->get_contents_as_array();\n $found = FALSE;\n $match = array();\n $new_lines = '';\n\n foreach ($lines as $line) {\n if (preg_match(self::REGEX_OPEN, $line, $match) && $match[1] == $name) {\n $found = TRUE;\n } elseif (preg_match(self::REGEX_CLOSE, $line) && $found) {\n $found = FALSE;\n continue;\n }\n\n if ($found)\n continue;\n\n $new_lines .= \"$line\\n\";\n }\n\n $newfile->add_lines($new_lines);\n $newfile->move_to(self::FILE_CONFIG);\n\n $this->shares = NULL; // Force a configuration reload\n\n try {\n $this->_generate_web_flexshares();\n $this->_generate_ftp_flexshares();\n $this->_generate_file_flexshares();\n\n try {\n $file->delete();\n } catch (Exception $ignore) {\n // Just log\n }\n } catch (Exception $e) {\n // Any exception here, toggle...well, toggle.\n $file->move_to(self::FILE_CONFIG);\n throw new Engine_Exception(clearos_exception_message($e), CLEAROS_ERROR);\n }\n\n // If you get here, it's OK to delete (as required)\n if ($delete_dir) {\n try {\n $folder = new Folder(self::SHARE_PATH . \"/$name\");\n if ($folder->exists())\n $folder->delete(TRUE);\n } catch (Exception $e) {\n // Just log\n }\n }\n }",
"private function handleEditMediaGroup() {\n\t\t// check if locked\n\t\tif (isset($this->mediaGroup)\n\t\t\t\t&& Utils::isFlagged($this->mediaGroup['options'], MediaGroupOperations::LOCKED_OPTION)) {\n\t\t\t$this->state = false;\n\t\t\t$this->message = 'MEDIA_GROUP_LOCKED';\n\t\t\treturn;\n\t\t}\n\t\t$updateColumns = [];\n\t\t// check fields\n\t\tif (!Utils::isValidFieldWithContentNoLinebreak('title', 256)) {\n\t\t\t$this->state = false;\n\t\t\t$this->message = 'INVALID_MEDIA_GROUP_TITLE';\n\t\t\treturn;\n\t\t}\n\t\t$updateColumns['title'] = Utils::getValidFieldString('title');\n\t\tif (!Utils::isValidFieldWithMaxLength('description', 1024)) {\n\t\t\t$this->state = false;\n\t\t\t$this->message = 'INVALID_MEDIA_GROUP_DESCRIPTION';\n\t\t\treturn;\n\t\t}\n\t\t$updateColumns['description'] = Utils::getValidFieldStringOrNull('description');\n\t\tif (!Utils::isValidFieldWithTags('tags', 256)) {\n\t\t\t$this->state = false;\n\t\t\t$this->message = 'INVALID_MEDIA_GROUP_TAGS';\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize tags\n\t\t$updateColumns['tags'] = Utils::normalizeTags(Utils::getValidFieldString('tags'));\n\n\t\t$result = false;\n\t\t// create media group\n\t\tif (!isset($this->mediaGroup)) {\n\t\t\t$result = $this->mediaGroupOperations->addMediaGroup(\n\t\t\t\t$updateColumns['title'],\n\t\t\t\t$updateColumns['description'],\n\t\t\t\t$updateColumns['tags'],\n\t\t\t\t$this->createGlobal ? MediaGroupOperations::GLOBAL_GROUP_OPTION : 0);\n\t\t\tif ($result === false) {\n\t\t\t\t$this->state = false;\n\t\t\t\t$this->message = 'UNKNOWN_ERROR';\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t// redirect\n\t\t\t\tUtils::redirect($this->config->getPublicRoot() . '/admin/media-group/' .\n\t\t\t\t\t$result . '/.success');\n\t\t\t}\n\t\t}\n\t\t// update existing media group\n\t\telse {\n\t\t\tif ($updateColumns['title'] === $this->mediaGroup['title']) {\n\t\t\t\tunset($updateColumns['title']);\n\t\t\t}\n\t\t\tif ($updateColumns['description'] === $this->mediaGroup['description']) {\n\t\t\t\tunset($updateColumns['description']);\n\t\t\t}\n\t\t\tif ($updateColumns['tags'] === $this->mediaGroup['tags']) {\n\t\t\t\tunset($updateColumns['tags']);\n\t\t\t}\n\t\t\t$result = $this->mediaGroupOperations->updateMediaGroup($this->mediaGroup['mgid'], $updateColumns);\n\t\t\tif ($result === false) {\n\t\t\t\t$this->state = false;\n\t\t\t\t$this->message = 'UNKNOWN_ERROR';\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t$this->state = true;\n\t\t\t\t$this->message = 'MEDIA_GROUP_EDITED';\n\t\t\t}\n\t\t}\n\t}",
"function block_openshare_updategroup($courseid,$groupid){\r\n\t$sql = 'SELECT u.id FROM mdl_user u \r\n\tJOIN mdl_role_assignments ra ON ra.userid = u.id \r\n\tJOIN mdl_role r ON ra.roleid = r.id \r\n\tJOIN mdl_context con ON ra.contextid = con.id \r\n\tJOIN mdl_course c ON c.id = con.instanceid AND con.contextlevel = 50 WHERE (r.shortname = \\'student\\' OR r.shortname = \\'teacher\\' OR r.shortname = \\'editingteacher\\' OR r.shortname = \\'coursecreator\\') AND c.id = '.$courseid;\r\n\t$rs = get_recordset_sql($sql);\r\n\t\r\n\tif(!empty($rs)){\r\n\t\twhile ($rec = rs_fetch_next_record($rs)) {\r\n\t\t\t//prep dataobject for door\r\n\t\t\t$groupenroll = new object();\r\n\t\t\t$groupenroll->timeadded = time();\r\n\t\t\t$groupenroll->groupid = $groupid;\r\n\t\t\t$groupenroll->userid = $rec->id;\r\n\t\t\t\r\n\t\t\t$ingroup = get_record(\"groups_members\", \"groupid\", $groupid, \"userid\", $rec->id);\r\n\t\t\tif (empty($ingroup)){\r\n\t\t\t\tinsert_record(\"groups_members\", $groupenroll);\r\n\t\t\t\tprint 'updated'.$groupenroll->groupid.$groupenroll->userid.'<br/>';\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\t\tprint_error(\"No users in this course!\");\r\n\t}\r\n\r\n\t// Close the recordset to save memory\r\n\trs_close($rs);\r\n}"
] | [
"0.7273293",
"0.6793118",
"0.631402",
"0.61949605",
"0.6186065",
"0.6154307",
"0.6146082",
"0.573998",
"0.56976026",
"0.5657101",
"0.54800093",
"0.5433691",
"0.5421712",
"0.53481084",
"0.5341366",
"0.53209805",
"0.5316242",
"0.5299361",
"0.5290612",
"0.52699894",
"0.5232958",
"0.5215075",
"0.5214485",
"0.5198243",
"0.51868886",
"0.5169251",
"0.51681465",
"0.514777",
"0.5141324",
"0.51247835"
] | 0.6943867 | 1 |
Upgrades virtual hosts implementation. See tracker 1219 for more information | function upgrade_web_site($name)
{
clearos_profile(__METHOD__, __LINE__);
try {
$share = $this->get_share($name);
if (empty($share['WebDefaultSite']))
$vhost_filename = 'virtual.' . $name . '.conf';
else
$vhost_filename = 'clearos.default.conf';
} catch (File_No_Match_Exception $e) {
return;
} catch (File_Not_Found_Exception $e) {
return;
}
clearos_log('flexshare', 'converting web server virtual host: ' . $name);
$file = new File(self::WEB_VIRTUAL_HOST_PATH . '/' . $vhost_filename);
$file->move_to(self::PATH_BACKUP . '/' . $vhost_filename . '-' . time());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function OnHostUp(HostUpEvent $event)\r\n\t\t{\r\n\t\t\t$farminfo = $this->DB->GetRow(\"SELECT * FROM farms WHERE id=?\", array($this->FarmID));\r\n\r\n\t\t\t$DBFarmRole = DBFarmRole::LoadByID($event->DBInstance->FarmRoleID);\r\n\t\t\t\r\n\t\t\tif ($DBFarmRole->GetSetting(DBFarmRole::SETTING_EXCLUDE_FROM_DNS) != 1)\r\n\t\t\t\t$this->AddInstanceToDNS($farminfo, $event->DBInstance);\r\n\t\t}",
"function unbound_hosts_generate() {\n\t// Generate our hosts file\n\tunbound_add_host_entries();\n\n\t// Reload our service to read the updates\n\tunbound_control(\"reload\");\n}",
"public function applyConfig()\n\t{\n\t $cmd = \"sudo omv-mkconf virtualhosts 2>&1\";\n\n if (0 !== $this->exec($cmd, $output))\n throw new OMVException(OMVErrorMsg::E_EXEC_FAILED,\n $cmd, implode(\"\\n\", $output));\n\t}",
"public function upgrade() {\r\n }",
"public function upgrade();",
"function stregistry_ModifyNameserver($params) \n{\n // init connection\n\tif (($status = __initConnectionAndAuthorize($params)) !== true) {\n\t\treturn __errorArray($status);\n\t}\n\n\t$json = STRegistry::Hosts()->query($params['nameserver']);\n\tif (!ResponseHelper::isSuccess($json)) {\n\t\treturn __errorArray(ResponseHelper::fromJSON($json)->message);\n\t}\n\t$host = Host::fromJSON($json);\n\tif (!empty($params['currentipaddress'])) {\n\t\t$host->removeIP($params['currentipaddress'], CommonFunctions::detectIPType($params['currentipaddress']));\n\t}\n\tif (!empty($params['newipaddress'])) {\n\t\t$host->addIP($params['newipaddress'], CommonFunctions::detectIPType($params['newipaddress']));\n\t}\n\n\t$json = STRegistry::Hosts()->update($host);\n\tif (!ResponseHelper::isSuccess($json)) {\n\t\treturn __errorArray(ResponseHelper::fromJSON($json)->message);\n\t}\n\n\treturn 'success';\n}",
"public function upgrade() {\n }",
"function drush_upgrade_site_upgrade($target_key) {\n // Presume we are ready to go (n.b. some checks already performed in 'validate')\n $ready_to_upgrade = TRUE;\n $result = TRUE;\n \n // PREPARE: Find the target version and determine the contrib projects and enabled modules installed.\n\n $source_version = drush_drupal_major_version();\n $target_version = $source_version + 1;\n $target_alias = drush_sitealias_get_record($target_key);\n if (empty($target_alias)) {\n return drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt(\"Could not find target site for upgrade: !target\", array(\"!target\" => $target_key)));\n }\n\n $destination_core = $target_alias['root'];\n\n $destination_conf_path = conf_path();\n if (drush_get_option('force-sites-default')) {\n $destination_conf_path = 'sites/default';\n }\n\n // Get a list of enabled contrib extensions.\n $values = drush_invoke_process_args('pm-list', array(), array('status'=>'enabled','no-core'=>TRUE, '#integrate' => FALSE, '#override-simulated' => TRUE));\n if ($values['error_status'] != 0) return FALSE;\n $contrib_extensions = array_keys($values['object']);\n\n // Get a list of enabled core extensions.\n $values = drush_invoke_process_args('pm-list', array(), array('status'=>'enabled','core'=>TRUE, '#integrate' => FALSE, '#override-simulated' => TRUE));\n if ($values['error_status'] != 0) return FALSE;\n $core_extensions = array_keys($values['object']);\n\n // Make a list of modules that are not available to be enabled in the target\n // version of Drupal, either because they have not been ported yet, or because\n // they have been rolled into core.\n $unavailable_extensions = array();\n \n // Get the list of modules the user would like to uninstall (if any).\n $uninstall_extensions = drush_get_option('uninstall', '');\n if ($uninstall_extensions == \"all\") {\n $uninstall_extensions = $contrib_extensions;\n }\n else {\n $uninstall_extensions = explode(',', $uninstall_extensions);\n }\n \n // WARN: Tell the user about any special situations that might exist with contrib modules.\n\n $project_download_list = array();\n $extension_info = drush_pm_get_extensions();\n if (!empty($contrib_extensions) && !drush_get_option('core-only')) {\n // Make a list of all of the extensions to download. We will\n // download everything in the contrib extension list, but we\n // will skip projects that already exist.\n $special_projects = drush_upgrade_project_map($target_version);\n $in_core = array();\n $special_warning = array();\n foreach ($contrib_extensions as $extension_name) {\n // Only check extensions that are NOT in our uninstall list.\n if (!in_array($extension_name, $uninstall_extensions) && array_key_exists($extension_name, $extension_info)) {\n $project = $extension_info[$extension_name]->info['project'];\n // Check our lookup table to see if a project has been renamed.\n if (array_key_exists($project, $special_projects['project-remap'])) {\n $project = $special_projects['project-remap'][$project];\n }\n // If the module has been rolled into core in the next major release of\n // Drupal, then we do not need to download it. Add it to an array for\n // reporting purposes.\n if ((in_array($project, $special_projects['projects-in-core'])) || (in_array($extension_name, $special_projects['modules-in-core']))) {\n $in_core[$extension_name] = $extension_name;\n // Might some of these need to be enabled?\n $unavailable_extensions[] = $extension_name;\n }\n elseif (($extension_info[$extension_name]->type == 'module') && !is_dir($destination_core . '/sites/all/modules/' . $project) && !is_dir($destination_core . '/' . $destination_conf_path . '/modules/' . $project)) {\n $project_download_list[$project][] = $extension_name;\n }\n // If there is a special warning about a project, then add it \n // to the warning list for later reporting.\n if (array_key_exists($project . ':' . $extension_name, $special_projects['warning'])) {\n $special_warning[$project] = $special_projects['warning'][$project . ':' . $extension_name];\n }\n elseif ((array_key_exists($project, $special_projects['warning'])) && (!array_key_exists($project, $special_warning))) {\n $special_warning[$project] = $special_projects['warning'][$project];\n }\n }\n }\n \n // Consider each project from the contrib extensions and check with PM to see if there is\n // a recommended release available to download. If there is NO release available, then\n // we are not ready to upgrade (but still can, without that project); if there is no RECOMMENDED \n // release, then we might not be ready to upgrade (but still can, with a non-recommended release).\n if (!empty($project_download_list)) {\n $result = drush_invoke_process('@none', 'pm-releases', array_keys($project_download_list), array('default-major' => $target_version, '#integrate' => FALSE, '#override-simulated' => TRUE));\n $project_releases = $result['object'];\n foreach ($project_download_list as $project => $extension_list) {\n if (!array_key_exists($project, $project_releases)) {\n drush_log(dt('The project !project has no releases in version !version', array('!project' => $project, '!version' => $target_version)), 'warning');\n $unavailable_extensions = array_merge($unavailable_extensions, $extension_list);\n $ready_to_upgrade = FALSE;\n }\n else {\n if (empty($project_releases[$project]['recommended'])) {\n drush_log(dt('The project !project has no recommended release in version !version', array('!project' => $project, '!version' => $target_version)), 'warning');\n $ready_to_upgrade = 'maybe';\n }\n }\n }\n }\n \n // Print out some messages about projects that migrated to core, or modules that will require special processing.\n if (!empty($in_core)) {\n drush_log(dt('The following contrib modules were enabled in your Drupal site, but are now standard in core: !in_core. These modules may need to be reconfigured after the upgrade is complete.', array('!in_core' => implode(', ', $in_core))), 'ok');\n }\n foreach ($special_warning as $project => $warning) {\n if ($warning === TRUE) {\n $warning = 'Please see !project_page and !source for more information on how to do this.';\n }\n if ($warning === FALSE) {\n $warning = 'So far there is no indication of when a migration path will be provided. Check !project_page for updates.';\n $ready_to_upgrade = 'maybe';\n }\n drush_log(dt(\"You are using the project !project, which requires data migration or other special processing. $warning\", array('!project' => $project, '!project_page' => 'http://drupal.org/project/' . $project, '!source' => $special_projects['source'])), 'warning');\n }\n }\n\n // CONFIRM: Ask the user before overwriting an exsiting site, and ask if an upgrade is really decided if the site is not ready yet.\n\n // Summarize whether or not there is a good chance that the site can be upgraded.\n if ($ready_to_upgrade !== TRUE) {\n drush_log(dt(\"Based on the contrib modules enabled in this site, it is possible that the site-upgrade command might fail. See warnings above.\"), (($ready_to_upgrade === FALSE) ? 'warning' : 'notice'));\n }\n // Check to see what we should do if the target Drupal folder already exists.\n $options = array(\n 'replace' => dt(\"Delete the existing site and start over.\"),\n 'reuse' => dt(\"Re-use the existing code, re-import the database from the source site and run updatedb again.\"),\n );\n $selection = NULL;\n foreach ($options as $option => $msg) {\n if (drush_get_option($option, FALSE)) {\n $selection = $option;\n }\n }\n if (!isset($selection) && (file_exists($destination_core))) {\n $selection = drush_choice($options, dt(\"Drupal site already exists at !root. Would you like to:\", array('!root' => $destination_core)));\n if (!$selection) {\n return drush_user_abort();\n }\n }\n elseif($ready_to_upgrade !== TRUE) {\n if (!drush_confirm('Would you like to continue anyway?')) {\n return drush_user_abort();\n }\n }\n\n // User has already been prompted; skip further confirms.\n drush_set_context('DRUSH_AFFIRMATIVE', TRUE);\n \n // We need to know where our destination settings file is regardless of which\n // code path we take; therefore, we will precompute it here.\n \n $settings_destination = $destination_core . '/' . $destination_conf_path . '/settings.php';\n \n // STEP 1: Download the next major version of Drupal.\n\n if (($selection == 'replace') || (!is_dir($destination_core))) {\n drush_upgrade_download_drupal($target_version, $destination_core);\n if (drush_get_error()) return FALSE; // Early exit if we see an error.\n drush_upgrade_copy_settings($target_alias, $settings_destination);\n }\n else {\n // Move sites/all/modules and $conf_path()/modules out of the way\n // so that updatedb can be run on core only.\n if (_drush_upgrade_preserve_modules($destination_core) === FALSE) {\n return FALSE;\n }\n }\n\n // Copy source database to target database. The source DB is not changed.\n // Always set 'common' at minimum. Sites that want other can create other key in drushrc.php.\n if (!drush_get_option('structure-tables-key')) {\n drush_set_option('structure-tables-key', 'common');\n }\n // Always blow away the target database so we start fresh.\n // We still have DRUSH_AFFIRMATIVE set from above, so this will not prompt.\n drush_set_option('create-db', TRUE);\n drush_include(DRUSH_BASE_PATH . '/commands/sql', 'sync.sql');\n drush_invoke('sql-sync', '@self', $target_key);\n if (drush_get_error()) return FALSE; // Early exit if we see an error.\n\n if (!empty($contrib_extensions)) {\n $target_alias_databases = sitealias_get_databases_from_record($target_alias);\n $modify_site_conf_path = NULL;\n\n // Make an alias record that uses the CODE from @self and the DATABASE from $target.\n // Since we just did an sql-sync from @self to @target, we can use this hybrid specification\n // to do manipulations on the target database before runing updatedb. In brief, we are going\n // to disable all contrib modules to prevent problems with updatedb.\n $modify_site = array (\n 'root' => DRUPAL_ROOT,\n 'uri' => $target_alias_databases['default']['default']['database'],\n );\n \n if (!drush_get_context('DRUSH_SIMULATE')) {\n // In theory, if the sql-sync worked, this should never be empty.\n if (empty($modify_site['uri'])) {\n return drush_set_error('DRUSH_UPGRADE_DATABASE_SPEC_UNKNOWN', dt('Failed to look up database spec for @target', array('@target' => $target_key)));\n }\n $modify_site_conf_path = dirname(conf_path()) . '/' . $modify_site['uri'];\n $modify_site_settings = $modify_site_conf_path . '/settings.php';\n drush_log('set up a fake site by copying ' . $settings_destination . ' to ' . $modify_site_settings);\n if (!file_exists($modify_site_settings)) {\n if ((drush_mkdir($modify_site_conf_path) === FALSE) || drush_op('copy', $settings_destination, $modify_site_settings) !== TRUE) {\n return drush_set_error('DRUSH_UPGRADE_COULD_NOT_DISABLE', dt(\"Could not create a temporary multisite \"));\n }\n }\n }\n $result = (drush_invoke_sitealias_args($modify_site, 'site-upgrade-prepare', $contrib_extensions, array('uninstall' => implode(',', $uninstall_extensions), 'yes' => TRUE, '#interactive' => TRUE)) == 0);\n\n // Delete the temporary site now that we're done with it.\n if (isset($modify_site_conf_path)) {\n drush_delete_dir($modify_site_conf_path);\n }\n if ($result === FALSE) return FALSE;\n }\n\n // STEP 2: Call updatedb for Drupal core.\n\n // Run update.php in a subshell. It is run on @target site whereas this request was on @self.\n drush_log(dt('About to perform updatedb for Drupal core on !target', array('!target' => $target_key)), 'ok');\n // When we call drush_invoke_sitealias_args in #interactive mode, the result code comes from drush_op_system, where 0 == success.\n $result = drush_invoke_sitealias_args($target_alias, 'updatedb', array(), array('yes' => TRUE, '#interactive' => TRUE)) == 0;\n if ($result === FALSE) {\n return drush_set_error('DRUSH_DRUPAL_CORE_UPGRADE_FAILED', dt(\"The call to updatedb failed for Drupal core. This may be caused by a contrib module that is not yet ready for upgrade. Try running site-upgrade again with '--uninstall={module list}' to remove all contrib extensions prior to upgrade. Add modules back in until the problematic one is isolated. Please report problems in the issue queue of the module that is causing problems.\"));\n }\n drush_log(dt('updatedb complete for Drupal core'), 'ok');\n\n // If we moved our modules out of the way, bring them back now.\n _drush_upgrade_restore_preserved_modules();\n\n // STEP 3: Download and re-enable the contrib modules.\n\n if (!empty($contrib_extensions) && !drush_get_option('core-only')) {\n $options = array('#interactive' => TRUE);\n if (!empty($project_download_list)) {\n $projects = implode(',', array_keys($project_download_list));\n $options['projects'] = $projects;\n }\n // If a module changed name, then rename it prior to calling pm-enable.\n foreach ($contrib_extensions as $extension_name) {\n if (array_key_exists($extension_name, $special_projects['module-remap'])) {\n $unavailable_extensions[] = $extension_name;\n $contrib_extensions[] = $special_projects['module-remap'][$extension_name];\n }\n }\n \n // Redispatch to site-upgrade-modules command, so that we will be\n // bootstrapped to the target site.\n $result = (drush_invoke_sitealias_args($target_alias, 'site-upgrade-modules', array_merge($core_extensions, array_diff($contrib_extensions, $unavailable_extensions, $uninstall_extensions)), $options) == 0);\n }\n \n return $result;\n}",
"function update($event_name, $data)\t{\n\t\tglobal $app, $conf;\n\n\t\t//* $VAR: command to run after vhost insert/update/delete\n\t\t$final_command = '/etc/init.d/nginx reload';\n\n\t\tif ($this->action != 'insert') {\n\t\t\t$this->action = 'update';\n\t\t}\n\n\t\t$app->uses('getconf');\n\t\t$app->uses('system');\n\t\t$web_config = $app->getconf->get_server_config($conf['server_id'], 'web');\n\n\t\t$app->load('tpl');\n\n\t\t$tpl = new tpl();\n\t\t$tpl->newTemplate('nginx_reverse_proxy_plugin.vhost.conf.master');\n\n\t\t$web_folder = 'web';\n\t\tif($data['new']['type'] == 'vhostsubdomain') {\n\t\t\t$tmp = $app->db->queryOneRecord('SELECT `domain` FROM web_domain WHERE domain_id = '.intval($data['new']['parent_domain_id']));\n\t\t\t$subdomain_host = preg_replace('/^(.*)\\.' . preg_quote($tmp['domain'], '/') . '$/', '$1', $data['new']['domain']);\n\n\t\t\tif($subdomain_host == '') {\n\t\t\t\t$subdomain_host = 'web'.$data['new']['domain_id'];\n\t\t\t}\n\n\t\t\t$web_folder = $data['new']['web_folder'];\n\t\t\tunset($tmp);\n\t\t}\n\n\t\t$vhost_data = $data['new'];\n\t\t$vhost_data['web_document_root'] = $data['new']['document_root'].'/'.$web_folder;\n\t\t$vhost_data['web_document_root_www'] = $web_config['website_basedir'].'/'.$data['new']['domain'].'/'.$web_folder;\n\t\t$vhost_data['web_basedir'] = $web_config['website_basedir'];\n\t\t$vhost_data['ssl_domain'] = $data['new']['ssl_domain'];\n\n\t\t/* __ VHOST & VHOSTSUBDOMAIN - section for vhosts and vhostsubdomains //////////////*/\n\t\tif ($data['new']['type'] == 'vhost' || $data['new']['type'] == 'vhostsubdomain') {\n\t\t\tif ($data['new']['ipv6_address'] != '') {\n\t\t\t\t$tpl->setVar('ipv6_enabled', 1);\n\t\t\t}\n\n\t\t\t$server_alias = array();\n\t\t\tswitch($data['new']['subdomain']) {\n\t\t\t\tcase 'www':\n\t\t\t\t\t// if seo-redirect is enabled, this should be placed in separate server block\n\t\t\t\t\t// to prevent if statement in server/request!\n\t\t\t\t\t$server_alias[] .= 'www.'. $data['new']['domain'] .' ';\n\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\t$server_alias[] .= '*.'. $data['new']['domain'] .' ';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$alias_result = array();\n\t\t\t$alias_result = $app->dbmaster->queryAllRecords('SELECT * FROM web_domain WHERE parent_domain_id = '.$data['new']['domain_id'].\" AND active = 'y' AND type != 'vhostsubdomain'\");\n\n\t\t\tif (count($alias_result) > 0) {\n\t\t\t\t// if alias is redirect type, put in server block with seo-redirect to prevent\n\t\t\t\t// if statement in server/request!\n\t\t\t\tforeach($alias_result as $alias) {\n\t\t\t\t\tswitch($alias['subdomain']) {\n\t\t\t\t\t\tcase 'www':\n\t\t\t\t\t\t\t$server_alias[] .= 'www.'. $alias['domain'] .' '. $alias['domain'] .' ';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '*':\n\t\t\t\t\t\t\t$server_alias[] .= '*.'. $alias['domain'] .' '. $alias['domain'] .' ';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$server_alias[] .= $alias['domain'] .' ';\n\t\t\t\t\t}\n\n\t\t\t\t\t$app->log('Add server alias: '. $alias['domain'], LOGLEVEL_DEBUG);\n\t\t\t\t}\n\n\t\t\t\tunset($alias);\n\t\t\t}\n\n\t\t\tif (count($server_alias) > 0) {\n\t\t\t\t$server_alias_str = '';\n\n\t\t\t\tforeach($server_alias as $tmp_alias) {\n\t\t\t\t\t$server_alias_str .= $tmp_alias;\n\t\t\t\t}\n\n\t\t\t\tunset($tmp_alias);\n\t\t\t\t$tpl->setVar('alias', $server_alias_str);\n\t\t\t} else {\n\t\t\t\t$tpl->setVar('alias', '');\n\t\t\t}\n\n\t\t\tif (!isset($rewrite_rules)) {\n\t\t\t\t$rewrite_rules = array();\n\t\t\t}\n\n\t\t\tif ($data['new']['redirect_type'] != '' && $data['new']['redirect_path'] != '')\t{\n\t\t\t\tif (substr($data['new']['redirect_path'], -1) != '/') {\n\t\t\t\t\t$data['new']['redirect_path'] .= '/';\n\t\t\t\t}\n\n\t\t\t\tif (substr($data['new']['redirect_path'], 0, 8) == '[scheme]') {\n\t\t\t\t\t$rewrite_target = 'http'.substr($data['new']['redirect_path'], 8);\n\t\t\t\t\t$rewrite_target_ssl = 'https'.substr($data['new']['redirect_path'], 8);\n\t\t\t\t} else {\n\t\t\t\t\t$rewrite_target = $data['new']['redirect_path'];\n\t\t\t\t\t$rewrite_target_ssl = $data['new']['redirect_path'];\n\t\t\t\t}\n\n\t\t\t\tif (substr($data['new']['redirect_path'], 0, 4) == 'http') {\n\t\t\t\t\t$data['new']['redirect_type'] = 'permanent';\n\t\t\t\t} else {\n\t\t\t\t\tswitch($data['new']['redirect_type']) {\n\t\t\t\t\t\tcase 'no':\n\t\t\t\t\t\t\t$data['new']['redirect_type'] = 'break';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'L':\n\t\t\t\t\t\t\t$data['new']['redirect_type'] = 'break';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$data['new']['redirect_type'] = 'permanent';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tswitch($data['new']['subdomain']) {\n\t\t\t\t\tcase 'www':\n\t\t\t\t\t\t$rewrite_rules[] = array(\n\t\t\t\t\t\t\t'rewrite_domain' => '^'.$data['new']['domain'],\n\t\t\t\t\t\t\t'rewrite_type' => ($data['new']['redirect_type'] == 'no') ? '' : $data['new']['redirect_type'],\n\t\t\t\t\t\t\t'rewrite_target' => $rewrite_target,\n\t\t\t\t\t\t\t'rewrite_target_ssl' => $rewrite_target_ssl\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$rewrite_rules[] = array(\n\t\t\t\t\t\t\t'rewrite_domain' => '^www.'.$data['new']['domain'],\n\t\t\t\t\t\t\t'rewrite_type' => ($data['new']['redirect_type'] == 'no') ? '' : $data['new']['redirect_type'],\n\t\t\t\t\t\t\t'rewrite_target' => $rewrite_target,\n\t\t\t\t\t\t\t'rewrite_target_ssl' => $rewrite_target_ssl\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\t$rewrite_rules[] = array(\n\t\t\t\t\t\t\t'rewrite_domain' => '(^|\\.)'.$data['new']['domain'],\n\t\t\t\t\t\t\t'rewrite_type' => ($data['new']['redirect_type'] == 'no') ? '' : $data['new']['redirect_type'],\n\t\t\t\t\t\t\t'rewrite_target' => $rewrite_target,\n\t\t\t\t\t\t\t'rewrite_target_ssl' => $rewrite_target_ssl\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$rewrite_rules[] = array(\n\t\t\t\t\t\t\t'rewrite_domain' => '^'.$data['new']['domain'],\n\t\t\t\t\t\t\t'rewrite_type' => ($data['new']['redirect_type'] == 'no') ? '' : $data['new']['redirect_type'],\n\t\t\t\t\t\t\t'rewrite_target' => $rewrite_target,\n\t\t\t\t\t\t\t'rewrite_target_ssl' => $rewrite_target_ssl\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($data['new']['seo_redirect'] != '' && ($data['new']['subdomain'] == 'www' || $data['new']['subdomain'] == '*')) {\n\t\t\t\t$vhost_data['seo_redirect_enabled'] = 1;\n\n\t\t\t\tif ($data['new']['seo_redirect'] == 'non_www_to_www') {\n\t\t\t\t\t$vhost_data['seo_redirect_origin_domain'] = $data['new']['domain'];\n\t\t\t\t\t$vhost_data['seo_redirect_target_domain'] = 'www.'. $data['new']['domain'];\n\t\t\t\t}\n\n\t\t\t\tif ($data['new']['seo_redirect'] == 'www_to_non_www') {\n\t\t\t\t\t$vhost_data['seo_redirect_origin_domain'] = 'www.'. $data['new']['domain'];\n\t\t\t\t\t$vhost_data['seo_redirect_target_domain'] = $data['new']['domain'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$vhost_data['seo_redirect_enabled'] = 0;\n\t\t\t}\n\n\t\t\t$errordocs = !$data['new']['errordocs'];\n\n\t\t\t$nginx_directives = $data['new']['nginx_directives'];\n\t\t\t$nginx_directives = str_replace(\"\\r\\n\", \"\\n\", $nginx_directives);\n\t\t\t$nginx_directives = str_replace(\"\\r\", \"\\n\", $nginx_directives);\n\n\t\t\t$crt_file = escapeshellcmd($data['new']['document_root'] .'/ssl/'. $data['new']['ssl_domain'] .'.crt');\n\t\t\t$key_file = escapeshellcmd($data['new']['document_root'] .'/ssl/'. $data['new']['ssl_domain'] .'.key');\n\n\t\t\tif ($data['new']['ssl_domain'] != '' && $data['new']['ssl'] == 'y' && is_file($crt_file) && is_file($key_file) && (filesize($crt_file) > 0) && (filesize($key_file) > 0)) {\n\t\t\t\t$http_to_https = 1;\n\t\t\t} else {\n\t\t\t\t$http_to_https = 0;\n\t\t\t}\n\n\t\t\t// non-ssl vhost loop\n\t\t\tif (count($rewrite_rules) > 0) {\n\t\t\t\t$vhosts[] = array(\n\t\t\t\t\t'ip_address' => $data['new']['ip_address'],\n\t\t\t\t\t'ipv6_address' => $data['new']['ipv6_address'],\n\t\t\t\t\t'ssl_enabled' => 0,\n\t\t\t\t\t'http_to_https' => $http_to_https,\n\t\t\t\t\t'nginx_directives' => $nginx_directives,\n\t\t\t\t\t'errordocs' => $errordocs,\n\t\t\t\t\t'port' => 80\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$vhosts[] = array(\n\t\t\t\t\t'ip_address' => $data['new']['ip_address'],\n\t\t\t\t\t'ipv6_address' => $data['new']['ipv6_address'],\n\t\t\t\t\t'ssl_enabled' => 0,\n\t\t\t\t\t'http_to_https' => $http_to_https,\n\t\t\t\t\t'nginx_directives' => $nginx_directives,\n\t\t\t\t\t'errordocs' => $errordocs,\n\t\t\t\t\t'port' => 80\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// ssl vhost loop\n\t\t\tif ($http_to_https == 1) {\n\t\t\t\t$vhost_data['web_document_root_ssl'] = $data['new']['document_root'] .'/ssl';\n\n\t\t\t\tif (count($rewrite_rules) > 0) {\n\t\t\t\t\t$vhosts[] = array(\n\t\t\t\t\t\t'ip_address' => $data['new']['ip_address'],\n\t\t\t\t\t\t'ipv6_address' => $data['new']['ipv6_address'],\n\t\t\t\t\t\t'ssl_enabled' => 1,\n\t\t\t\t\t\t'http_to_https' => 0,\n\t\t\t\t\t\t'rewrite_enabled' => 1,\n\t\t\t\t\t\t'nginx_directives' => $nginx_directives,\n\t\t\t\t\t\t'errordocs' => $errordocs,\n\t\t\t\t\t\t'port' => 443\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$vhosts[] = array(\n\t\t\t\t\t\t'ip_address' => $data['new']['ip_address'],\n\t\t\t\t\t\t'ipv6_address' => $data['new']['ipv6_address'],\n\t\t\t\t\t\t'ssl_enabled' => 1,\n\t\t\t\t\t\t'http_to_https' => 0,\n\t\t\t\t\t\t'rewrite_enabled' => 0,\n\t\t\t\t\t\t'nginx_directives' => $nginx_directives,\n\t\t\t\t\t\t'errordocs' => $errordocs,\n\t\t\t\t\t\t'port' => 443\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$tpl->setLoop('vhosts', $vhosts);\n\t\t\t$tpl->setVar($vhost_data);\n\n\t\t\tif ($this->action == 'insert') {\n\t\t\t\t$this->vhost_helper('insert', $data, $tpl->grab());\n\t\t\t}\n\n\t\t\tif ($this->action == 'update') {\n\t\t\t\t$vhost_backup = $this->vhost_helper('update', $data, $tpl->grab());\n\t\t\t}\n\t\t}\n\n\n\t\t/**\n\t\t * Section for aliasdomains.\n\t\t *\n\t\t * This section is used for aliasdomains.\n\t\t */\n\t\tif ($data['new']['type'] == 'alias') {\n\t\t\t$parent_domain = $app->dbmaster->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '. intval($data['new']['parent_domain_id']) .'');\n\n\t\t\t$parent_domain['parent_domain_id'] = $data['new']['parent_domain_id'];\n\t\t\t$data['old'] = $parent_domain;\n\t\t\t$data['new'] = $parent_domain;\n\n\t\t\t$this->update($event_name, $data);\n\t\t}\n\n\t\t/**\n\t\t * Section for classic subdomains.\n\t\t *\n\t\t * This section is used for classic subdomains (non vhost subdomains).\n\t\t */\n\t\tif ($data['new']['type'] == 'subdomain') {\n\t\t\t$parent_domain = $app->dbmaster->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '. intval($data['new']['parent_domain_id']) .'');\n\n\t\t\t$parent_domain['parent_domain_id'] = $data['new']['parent_domain_id'];\n\t\t\t$data['old'] = $parent_domain;\n\t\t\t$data['new'] = $parent_domain;\n\n\t\t\t$this->update($event_name, $data);\n\t\t}\n\n\t\texec($final_command);\n\n\t\tif (isset($vhost_backup)) {\n\t\t\t$app->system->unlink($vhost_backup['file_new'].'~');\n\t\t}\n\n\t\tunset($vhost_backup);\n\t\t$this->action = '';\n\t}",
"function upgrade_all() {\n\tupgrade_071();\n\tupgrade_072();\n\tupgrade_100();\n\tupgrade_101();\n\tupgrade_110();\n}",
"function apply_virtual_ip($vip_ent) {\n $check_carp = false;\n if (is_array($vip_ent)) {\n foreach ($vip_ent as $vid => $ovip) {\n if (!empty($ovip)) {\n interface_vip_bring_down($ovip);\n }\n if ($vip_ent) {\n switch ($vip_ent['mode']) {\n case \"ipalias\":\n interface_ipalias_configure($vip_ent);\n break;\n case \"proxyarp\":\n interface_proxyarp_configure($vip_ent['interface']);\n break;\n case \"carp\":\n $check_carp = true;\n interface_carp_configure($vip_ent);\n break;\n default:\n break;\n }\n }\n }\n }\n /* Before changing check #4633 */\n if ($check_carp === true && !get_carp_status()) {\n set_single_sysctl(\"net.inet.carp.allow\", \"1\");\n }\n filter_configure();\n}",
"public function editHost($newHost){\n //Check for the variable's existance:\n if(!isset($_host)){\n //Echo the necessary notice if there is no variable to change\n echo \"Please Define a Connection before changing the host.\";\n }else{\n //Set the class variable to the new value:\n $_host = $newHost;\n //Implement the new variable in the database connection: \n $this->createConnection();\n }\n }",
"public function deploy();",
"public function setVisitViewsHosts($data){\n\t\n \t\n\t $post = VisitsTable::find()->select(\"*\")->where(array('data' => $data))->one();\n if($post->views && $post->hosts){\n \n $post->views += 1;\n $post->hosts += 1;\n\t $post->save(); \n }\n\t return;\n \n\t\n }",
"public function getName()\n\t{\n\t\treturn \"virtualhosts\";\n\t}",
"public function actionRemVhostList()\r\n {\r\n if (isset($_POST['vhostToRemove'])) {\r\n $removedVhosts = array();\r\n $vhostsToRemove = Vhost::model()->findAllByPk($_POST['vhostToRemove'],'owner_id=' . Yii::app()->user->getId());\r\n if (is_array($vhostsToRemove) && count($vhostsToRemove) > 0) {\r\n foreach ($vhostsToRemove as $vhostToRemove) {\r\n $removedVhosts[] = $vhostToRemove->id;\r\n $vhostToRemove->delete();\r\n }\r\n $status = (count($removedVhosts) == count($_POST['vhostToRemove'])) ? 'OK' : 'PARTLY';\r\n echo json_encode(array('status'=>$status,'vhostIds'=>$removedVhosts));\r\n Yii::app()->end();\r\n }\r\n }\r\n // Return 404 by default\r\n throw new CHttpException(404,'The requested page does not exist.');\r\n Yii::app()->end();\r\n }",
"abstract protected function preDeploy($go);",
"public function testGetVirtualHosts()\n {\n\n // initialize the array with expected result\n $virtualHosts = json_decode(file_get_contents(__DIR__ . '/Api/Node/_files/prepareVirtualHosts.json'));\n\n // create a mock configuration instance\n $mockNode = $this->getMock('AppserverIo\\Appserver\\Core\\Api\\Node\\ServerNode', array('getVirtualHostsAsArray'));\n $mockNode->expects($this->once())\n ->method('getVirtualHostsAsArray')\n ->will($this->returnValue($virtualHosts));\n\n // initialize the server node\n $serverNode = new ServerNodeConfiguration($mockNode);\n\n // check the array with the virtual hosts data\n $this->assertSame($virtualHosts, $serverNode->getVirtualHosts());\n }",
"abstract protected function postDeploy($go);",
"private function sysOrderViHosts($hostName)\n {\n $filename = getenv('TMPDIR') . $hostName;\n\n if (file_exists($filename)) {\n unlink($filename);\n }\n\n touch($filename);\n\n $content = $this->allHosts[$hostName]->content ? : \"\";\n\n file_put_contents($filename, $content);\n\n passthru(\"vi \" . $filename . \" >/dev/tty\", $result_var);\n\n $this->allHosts[$hostName]->content = file_get_contents($filename, \"r\");\n\n unlink($filename);\n }",
"function upgrade($from_version = false)\n {\n //to display messages.\n $db = $admin = true;\n include GEO_BASE_DIR . 'get_common_vars.php';\n //upgrade from the version passed in.\n switch ($from_version) {\n case '1.0.0':\n //break omitted on purpose for this case\n case '1.0.1':\n $this->CreateTable();\n\n $this->registry_id = 'install';\n $settings = array('type' => 2, 'continue' => 0, 'use_old_redirects' => 1);\n $this->set('settings', $settings);\n $this->save();\n\n $this->common_tasks();\n $filename = $db->get_site_setting('classifieds_file_name');\n $index = str_replace('.php', '', $filename);\n\n $this->resetUpgradeSettings();\n\n //$db->set_site_setting('addon.SEO.cat_url',$begin.'/listings/category(!ID!).htm'); //EXAMPLE\n //set rest of settings to match \"old\" way SEO worked.\n\n $admin->userNotice('The way the SEO works has changed, be sure to read the user manual for more information, and test to make sure links work correctly. If you have any problems, you may need to adjust settings for the SEO addon or update your .htaccess file.');\n\n //break to keep from going down to default\n break;\n case '1.1.0':\n //Beta version, force stuff to be re-inited\n $this->uninstall();\n $this->install();\n geoAdmin::m('All SEO settings were reset, due to changes in how the SEO addon works.', geoAdmin::NOTICE);\n break;\n\n default:\n break;\n }\n\n //fix the orders of the url parts to remove duplicate orders\n $this->fixOrders();\n\n\n if ($this->fixRegexes()) {\n //regexes needed to be changed, until the .htaccess is re-generated, still use old URL's\n $reg = geoAddon::getRegistry('SEO', true);\n if ($reg) {\n $reg->useUnderscore = 1;\n $reg->save();\n }\n $admin->userNotice('Note: Titles in URL now use dashes - for word separators instead of underscore _. Also a few non alpha-numeric characters\n\t\t\tare now allowed in the title. You will need to re-generate the\n\t\t\t.htaccess file to take advantage of these changes. Until you do, it will continue to use underscores for word separators. Note that old\n\t\t\tURLs that use underscore, will now have a 301 redirect to new urls using - if the setting \"Force SEO URLs\" setting is enabled.');\n } else {\n $admin->userNotice('Note: make sure to re-generate the .htaccess file\n\t\t\t\t\tcontents to take advantage of any improvements or changes to\n\t\t\t\t\thow it works in the new version.');\n }\n //add any new URL's\n $util = geoAddon::getUtil('SEO', true);\n if ($util) {\n //make it add any new URL's\n $util->RegisterSettings(false, true);\n }\n\n\n //if upgrade is successful, return true.\n return true;\n }",
"function generateVirtualHost($nodeName)\n {\n try{\n $node=getDAONode($nodeName);\n header(\"Content-Type: text/plain\", true);\n \n $HTTP_VHOST_ADDR=$node->getLocalIP();\n $HTTP_VHOST_PORT=$node->getPort(); \n $HTTP_VHOST_NAME=$node->getServerFQDN();\n $NODE_NAME=$node->getNodeName();\n \n $HTTP_VHOST_TOP_DOMAIN=\"\"; \n $domParts=explode(\".\", $node->getServerFQDN());\n if (count($domParts)>1) {\n for ($i=1;$i<count($domParts);$i++) {\n $HTTP_VHOST_TOP_DOMAIN = $HTTP_VHOST_TOP_DOMAIN . \n \".\" . $domParts[$i];\n }\n } else {\n $HTTP_VHOST_TOP_DOMAIN=$node->getServerFQDN();\n }\n \n $ADDITIONAL_CONFIGURATION=$node->getAdditionalConfiguration();\n \n \n if ($node->getIsHTTPS()==0) {\n include \"../resources/apache.conf/http_virtualhost_template.php\";\n } else {\n $HTTPS_HAVE_CA_CERT=false; \n $HTTPS_HAVE_CHAIN_CERT=false; \n if ($node->getCa() != \"\") {\n $HTTPS_HAVE_CA_CERT=true;\n }\n if ($node->getChain() != \"\") {\n $HTTPS_HAVE_CHAIN_CERT=true;\n }\n include \"../resources/apache.conf/https_virtualhost_template.php\";\n }\n }catch (Exception $e) {\n throw new RestException($e->getCode(), $e->getMessage());\n }\n }",
"public static function upgrade() {\n\t\t$db = Loader::db();\n\t\t$relativeLinkType = BlockType::getByHandle('clov_relative_link');\n\t\t$relativeLinkRows = $db->getAll('select bID from Blocks where btID = ?', array($relativeLinkType->getBlockTypeID()));\n\t\tforeach($relativeLinkRows as $relativeLinkRow) {\n\t\t\t$relativeLink = Block::getByID($relativeLinkRow['bID']);\n\t\t\tself::convertRelativeLinkActionToLegacyRoute($relativeLink);\n\t\t}\n\t}",
"function wpv_admin_socket( $host, $post, $vers ){\n if( ! class_exists('VarnishAdminSocket') ){\n include dirname(__FILE__).'/VarnishAdminSocket.php';\n if( ! class_exists('VarnishAdminSocket') ){\n throw new Exception('Failed to include VarnishAdminSocket class');\n }\n }\n return new VarnishAdminSocket( $host, $post, $vers );\n}",
"public function promote($node){\n if(!$node){\n return(NULL);\n }\n\n $output = array();\n\n foreach($this->get_nodes() as $host => $obj){\n $this->upload_scripts($obj['id']);\n }\n\n #stop db on master\n $current_primary = $this->get_current_primary_node();\n $output[] = $this->stop_db($old_primary_id = $current_primary['id']);\n\n #promote on new master\n $output[] = $this->ssh($node, \"cd {$this->postgres_home}/scripts ; /usr/bin/perl watch.pl './promote.sh' 'STANDBY PROMOTE successful'\", 'postgres');\n\n $needs_start = array();\n #follow on all new standbys\n foreach($this->standby_nodes as $standby_node){\n if($standby_node['id'] == $node || $standby_node['id'] == $old_primary_id){\n continue;\n }\n\n #repmgrd is supposed to be able to detect a new master, but i have rarely seen this\n #so we kill them all and start them again\n\n foreach($this->remote_ps($standby_node['id']) as $ps){\n $this->remote_kill($standby_node['id'], $ps['pid']);\n }\n \n $output[] = $this->ssh($standby_node['id'], \"cd {$this->postgres_home}/scripts ; /usr/bin/perl watch.pl './follow.sh' 'server starting'\", 'postgres');\n \n $needs_start[] = $standby_node['id'];\n }\n\n sleep(5); \n \n #reinitialize $dbw\n global $dbw_host, $db_host;\n\n $this->set_write_db($this->get_node_host($node));\n\n $dbw = $this->get_db_connection($dbw_host);\n\n #cleanup repmgr tables\n $this->cleanup_repl_monitor($old_primary_id);\n\n foreach($needs_start as $id){\n $this->remote_start($id);\n }\n\n #update our object to contain correct information\n $this->generate_nodes($db_host);\n \n return($output);\n }",
"public function envProvision()\n {\n $this->taskVagrantProvision()->run();\n }",
"public function deployMultiSite() {\n // Ask for which application to deploy in.\n $this->writeln('Getting Applications...');\n $appHelper = new ChoiceQuestion('Select which Acquia Cloud Application you want to deploy a site on', $this->getApplicationsId());\n $appName = $this->doAsk($appHelper);\n // Attempt to get the UUID of this application.\n try {\n $appUuId = $this->getUuidFromName($appName);\n }\n catch (Exception $e) {\n $this->say('Incorrect Application ID.');\n }\n // Get a list of environments for this App UUID.\n $this->writeln('Getting Environment ID\\'s...');\n $envList = $this->getEnvironments($appUuId);\n // Get the From Env for this deploy.\n $fromEnvHelper = new ChoiceQuestion('Select which Environment to deploy from', $envList);\n $fromEnv = $this->doAsk($fromEnvHelper);\n // Get the To Env for this deploy.\n $toEnvHelper = new ChoiceQuestion('Select which Environment to deploy to', array_diff($envList, [$fromEnv]));\n $toEnv = $this->doAsk($toEnvHelper);\n // Get th Site to deploy.\n $siteDbList = $this->getDatabases($appUuId);\n $siteHelper = new ChoiceQuestion('Select which Site to deploy.', $siteDbList);\n $siteDb = $this->doAsk($siteHelper);\n $siteUrl = str_replace('_', '.', $siteDb);\n $verifySiteUrl = $this->ask(\"Is this the correct domain ${siteUrl}\");\n if ($verifySiteUrl === \"n\") {\n $updateSiteUrl = $this->ask(\"What is the correct domain of the site?\");\n $siteUrl = $updateSiteUrl;\n }\n try {\n $envUuidFrom = $this->getEnvUuIdFromApp($appUuId, $fromEnv);\n }\n catch (Exception $e) {\n }\n try {\n $envUuidTo = $this->getEnvUuIdFromApp($appUuId, $toEnv);\n }\n catch (Exception $e) {\n }\n $verifyAnswer = $this->ask(\"You are about to deploy ${siteUrl} from {$fromEnv} to ${toEnv} in the application ${appName}, do you wish to continue? (y/n)\");\n if ($verifyAnswer === 'y') {\n $this->say(\"Creating Backup in Destination Environment\");\n // DO the site deploy with DB backup in destination environment.\n $this->createDbBackup($siteDb, $envUuidTo);\n // Need to wait for task.\n $this->say(\"Coping Database from ${fromEnv} to ${toEnv}.\");\n // Copy DB to destination environment.\n $this->copyDb($siteDb, $envUuidFrom, $envUuidTo);\n // Need to wait for task.\n // Copy files\n $this->say(\"Coping files from ${fromEnv} to ${toEnv}.\");\n $this->rsyncFiles($appUuId, $siteUrl, $envUuidFrom, $envUuidTo);\n // Flush varnish.\n $checkToFlushVarnish = $this->ask(\"Flush varnish?\");\n if ($checkToFlushVarnish === 'y') {\n $this->say('Getting Domains...');\n $domains = $this->getDomains($envUuidTo);\n $domainHelper = new ChoiceQuestion(\"Which Domains do you want to flush? Separate multiple by comma\", $domains);\n $domainHelper->setMultiselect(TRUE);\n /** @var array $domain */\n $domain = $this->doAsk($domainHelper);\n $this->output()\n ->writeln('Flushing Domains ' . implode(',', $domain));\n $this->flushVarnish($envUuidTo, $domain);\n }\n }\n else {\n exit();\n }\n }",
"private function v17_upgrades() {\n\n\t\t@affiliate_wp()->referrals->create_table();\n\t\t@affiliate_wp()->visits->create_table();\n\t\t@affiliate_wp()->campaigns->create_view();\n\n\t\t$this->v17_upgrade_referral_rates();\n\n\t\t$this->v17_upgrade_gforms();\n\n\t\t$this->v17_upgrade_nforms();\n\n\t\t$this->upgraded = true;\n\n\t}",
"function upgrade_plugins()\r\n{\r\n\t$h = new Hotaru();\r\n\t\r\n template($h, 'upgrade/upgrade_plugins.php');\r\n}",
"function config_upgrade_0dot9() {\n\tglobal $config;\n\n\tarray_make_branch($config,'system');\n\t$config['system']['hostname'] = 'xigmanas';\n\tarray_make_branch($config,'samba');\n\t$config['samba']['netbiosname'] = 'xigmanas';\n\t$config['samba']['serverdesc'] = 'XigmaNAS Server';\n}"
] | [
"0.5832547",
"0.55056936",
"0.54005504",
"0.53640807",
"0.53560084",
"0.52883464",
"0.5282546",
"0.52442914",
"0.52321565",
"0.5231193",
"0.52252",
"0.5214347",
"0.51527786",
"0.5129678",
"0.5103551",
"0.5073847",
"0.5034835",
"0.5028194",
"0.50088334",
"0.49819404",
"0.49799046",
"0.49731365",
"0.49581957",
"0.49415618",
"0.49071625",
"0.48919055",
"0.48637903",
"0.48458883",
"0.48378083",
"0.48275107"
] | 0.61182684 | 0 |
///////////////////////////////////////////////////////////////////////////// V A L I D A T I O N M E T H O D S ///////////////////////////////////////////////////////////////////////////// Validation routine for flexshare name. | function validate_name($name)
{
clearos_profile(__METHOD__, __LINE__);
if (!preg_match("/^([A-Za-z0-9\-\.\_]+)$/", $name))
return lang('flexshare_name_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function isValidName()\n {\n }",
"function name_valid($name) {\n $ok = true;\n \n $array = explode(' ', $name); \n if (sizeof($array) < 2) {\n $ok = false;\n }\n \n return $ok;\n}",
"public function validateName($name){\n // Preg Match for Name Value\n $name_exception = preg_match('/[\\d\\[\\]\\/\\'`^£$%&*()};\"!:{@#~?><>,|=_+¬-]/', $name);\n $name_back_slash_check = preg_match('/\\\\\\\\/', $name);\n\n // Conditions for Name field\n if(empty($name)){\n $_SESSION['user_edit_name_error']=\"You Must have to Give Name Here\";\n return false;\n }elseif(empty(trim($name)) || $name_exception || $name_back_slash_check){\n $_SESSION['user_edit_name_error']=\"Please Give a Valid Name\";\n return false;\n }else{\n return true;\n }\n }",
"function validName($name){\n if(strlen(trim($name))>4 && !empty($name)){\n return true;\n }\n else return false;\n }",
"private function is_valid_name($name) {\r\n $valid = TRUE;\r\n\r\n /* Just checks if the string length is between 3 and 16 */\r\n if (mb_strlen($name) < 3) {\r\n $valid = FALSE;\r\n//echo \"\\$name = $name is not valid, mb_strlen(\\$name) = \"\r\n// . \"$mb_strlen($name) <br>\";\r\n } else if (mb_strlen($name) > 16) {\r\n $valid = FALSE;\r\n//echo \"\\$name = $name is not valid, mb_strlen(\\$name) = \"\r\n// . \".$mb_strlen($name) <br>\";\r\n }\r\n//echo \"$name is \".$valid.\"<br>\";\r\n\r\n return $valid;\r\n }",
"public function nameIsValid($name) {\r\n \r\n }",
"function check_publisher($name) {\r\n if(strlen($name) <= 0 || strlen($name) > 80) return 0;\r\n else if(!preg_match(\"/^[A-Za-z0-9, ]{1,20}$/\", $name)) return 0;\r\n else return 1;\r\n }",
"function checkusername($name) {\n \t\tif (preg_match(\"/^[a-zA-z0-9-_.]{3;20}$/\", $name)) return true;\n\t}",
"public function validateName($name){\n if(preg_match(\"/^[.@&]?[a-zA-Z0-9 ]+[ !.@&()]?[ a-zA-Z0-9!()]+/\",$name)){\n return true;\n }else{\n return false;\n }\n }",
"function validateName($name)\n {\n // check if the name is empty or not\n $name = trim($name);\n \n // check if empty\n if(empty($name))\n\t\t{\n\t\t\t// if empty, return an error that the name is empty\n\t\t\treturn \"Please provide a database name\";\n\t\t}\n\t\t// check the length of the database name\n\t\telse if(strlen($name) > 15 || strlen($name) < 5)\n\t\t{\n\t\t\t// return a message that the length is not valid\n\t\t\treturn \"Database name should be 5-15 characters long\";\n\t\t}\n // check the syntax\n else if(eregi(\"[^a-zA-Z0-9\\_\\-]\", $name))\n {\n // if it has a wrong syntx, return an error that the name is invalid\n return \"Please provide a valid database name\"; \n }\n \n return;\n }",
"public function validateName()\n {\n\t \tif ((strlen($this->changeNameInput)<3) || (strlen($this->changeNameInput)>20))\n\t\t{\n\t\t\t$this->error_name[] = \"Name has to consist of 3 to 20 characters\";\n\t\t}\n\t\t\n\t\tif (ctype_alnum($this->changeNameInput) == false)\n\t\t{\n\t\t\t$this->error_name[] = \"Name has to consist only of alphanumeric characters\";\n\t\t}\n\t}",
"function validate_name_pattern($name){\n\n\tif(strlen($name) < 2)\n\t return FALSE;\n\n\treturn TRUE;\n\n\tif (ereg ('^[a-zA-Z0-9\\s.\\-_\\']+$', $name, $match_results)) {\n\t return TRUE;\n\t}\n\treturn FALSE;\n}",
"function isValidName($name)\n{\n $nameRegex = '/^[A-Za-z\\s]+$/';\n if (preg_match($nameRegex, $name))\n {\n return true;\n }\n else \n {\n return false;\n }\n\n}",
"function clean_field($name)\n\t{\n\t\tif (preg_match('/[^a-z0-9\\_\\-]/i', $name))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telseif (trim($name) == '')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"function validName($name) {\n\t\tif (preg_match('/[a-zA-Z]+/', $name)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function validName($name)\n{\n return !empty($name) && strlen($name) > 1 && ctype_alpha($name);\n}",
"public function name_check($str=null)\n\t{\n\t\t\n\t\t$result = $this->ObjM->get_video_name();\n\t\t\n\t\tfor($i=0;$i<count($result);$i++) {\n\t\t\t\n \t\tif ($str == $result[$i]['video_name'])\n\t\t{\n\t\t\t\n\t\t\t$this->form_validation->set_message('name_check', 'The %s field can not be the word \"'.$str.'\". It must contain a unique value.');\n\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn true;\n\t\t\n\t}",
"function nameValidCheck($name) {\n\t\t\t\tif (preg_match(Parameters::incompatibruMid, $name, $out)) {\n\t\t\t\t\terr(\"Invalid element name.\", 50);\n\t\t\t\t}\n\t\t\t}",
"function checkName($name){\n if(!preg_match('/^[a-zA-Z0-9.,!? -\\']+$/', $name)){\n return false;\n }\n else {\n return true;\n }\n }",
"public static function isNameValid(string $name): bool {\n $valid = TRUE;\n\n $len = mb_strlen($name);\n\n if ($len < 8 OR $len > 16) {\n $valid = FALSE;\n }\n\n return $valid;\n }",
"public function nameformt($name) {\n\n $ok = preg_match(\"/^\\w{8,20}$/\", $name);\n\n return $ok; \n\n }",
"function validAdminName($name) {\r\n global $f3;\r\n\r\n if(!alphabetical($name)) {\r\n $f3->set(\"adminErrors['name']\", \"Please enter a valid name\");\r\n return false;\r\n }\r\n\r\n return true;\r\n}",
"final public static function isValidName(?string $name): bool\n {\n return '' === $name || null === $name || preg_match('/^[a-zA-Z0-9_][a-zA-Z0-9_\\-:]*$/D', $name);\n }",
"function check()\n\t{\n\t\t// setting alias\n\t\tif ( empty( $this->alias ) )\n\t\t{\n\t\t\t$this->alias = OutputFilter::stringURLSafe( $this->name );\n\t\t}\n\t\telse {\n\t\t\t$this->alias = OutputFilter::stringURLSafe( $this->alias ); // make sure the user didn't modify it to something illegal...\n\t\t}\n\t\t//should check name unicity\n\t\treturn true;\n\t}",
"function validate_name($sName, $iMin = 2, $iMax = 20)\n{\n return (is_string($sName) && mb_strlen($sName) >= $iMin && mb_strlen($sName) <= $iMax);\n}",
"function validName($name)\r\n {\r\n return !ctype_alpha($name);\r\n }",
"function validName($name)\n {\n return preg_match('/[a-z]/i', $name);\n }",
"function IsValidName($name) {\n return ! preg_match('/[^A-Za-z0-9]/', $name);\n }",
"function invalidName($name){\n\t$result;\n\n\t// preg_match(pattern, subject) returns true, if the pattern is exists in the subject.\n\tif (!preg_match(\"/^[a-zA-Z0-9 ]*$/\", $name)) {\n\t\t$result = true;\n\t}\n\telse{\n\t\t$result = false;\n\t}\n\n\treturn $result;\n}",
"function validateName($str)\r\n{\r\n if ($str == \"\"){return false;}\r\n $str = cleanInput($str);\r\n\r\n if (preg_match(\"/^[a-zA-Z ]*$/\", $str)) {\r\n return true;\r\n }else return false;\r\n}"
] | [
"0.6856545",
"0.6717575",
"0.6611014",
"0.6582313",
"0.6549713",
"0.65124667",
"0.65122664",
"0.651103",
"0.64969856",
"0.6452991",
"0.64260525",
"0.6387568",
"0.6341591",
"0.6336366",
"0.63346153",
"0.6315795",
"0.63105696",
"0.6276226",
"0.62731826",
"0.626263",
"0.6237223",
"0.623422",
"0.62256587",
"0.62157476",
"0.6204782",
"0.61981267",
"0.6195994",
"0.6192715",
"0.6174729",
"0.6157657"
] | 0.77045155 | 0 |
Validation routine for an owner. | function validate_owner($owner)
{
clearos_profile(__METHOD__, __LINE__);
if (empty($owner))
return lang('flexshare_owner_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function checkOwnerExistence()\n {\n $this->owner = Show::find($this->getOwnerId());\n if (empty($this->owner)) {\n abort(404);\n }\n }",
"protected function checkOwnerExistence()\n {\n $this->owner = Review::find($this->getOwnerId());\n if (empty($this->owner)) {\n abort(404);\n }\n }",
"abstract protected function validate();",
"abstract protected function validate();",
"private function validateOwnerShip(Container $container) {\n $user = Auth::user();\n if ($user->id !== $container->user_id) {\n throw new ModelNotFoundException(\"The element with the {$container->id} was not found\");\n }\n }",
"abstract protected function validation();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"public abstract function validate();",
"public function validateOwner()\n {\n if (!isset($_SERVER['HTTP_OAUTH_SECRET']))\n return [\n false, 'HTTP header is not correct. Client key is not provided.'\n ];\n \n if ($this->client === null)\n return [\n false, 'CLIENT HAS NO CREDENTIALS FOR THIS SERVICE.'\n ];\n\n if (count($this->links) == 0)\n return [\n false, 'Fatal error: the user who granted access to the resources is not an owner of any clubs or he is not the owner any more. Sorry but you can not use them.'\n ];\n\n return [true];\n }",
"public static function validate() {}",
"protected function _childValidation() { }",
"public function hasOwner()\n {\n return (\n isset($this->_data->from)\n && is_object($this->_data->from)\n && $this->from->id\n && is_numeric($this->from->id)\n );\n }",
"protected function _childValidation()\r\r\n {\r\r\n }",
"public function validate();",
"public function validate();",
"public function validate();",
"public function valid() {}",
"public function valid() {}",
"abstract public function validateUser();",
"public static function ownerExists()\n {\n return static::where('user_type', static::OWNER)->count() == 1;\n }",
"function v0_check_owner_code($instruction, $class, $gen_cc_id, $gen_cc_code, $developer, $user_upload, &$result, &$errors, &$l_errors) {\n\t// Get name\n\t$parameter_name=$instruction['attributes']['NAME'];\n\t\n\t// Get value of name\n\tswitch (substr($parameter_name, 0, 1)) {\n\t\tcase '*':\n\t\t\t// Local element\n\t\t\tif (!v0_ul_get_element($parameter_name, $class, $parameter_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\t// Attribute\n\t\t\tif (!v0_ul_get_attribute($parameter_name, $class, $parameter_value, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Static value\n\t\t\t$parameter_value=$parameter_name;\n\t}\n\t\n\t// If a NULL value was returned\n\tif ($parameter_value==NULL) {\n\t\t// Return gen_cc_id\n\t\t$result=$gen_cc_id;\n\t\treturn TRUE;\n\t}\n\t\n\t// Compare local owner code with general owner code\n\tif ($parameter_value==$gen_cc_code) {\n\t\t// Return gen_cc_id\n\t\t$result=$gen_cc_id;\n\t\treturn TRUE;\n\t}\n\t\n\t// Different owner code, get cc_id from DB\n\t$table_name='cc';\n\t$field_name=array();\n\t$field_value=array();\n\t$field_name[0]='cc_id';\n\t$where_field_name=array();\n\t$where_field_comp=array();\n\t$where_field_value=array();\n\t$where_logical=array();\n\t$where_field_name[0]='cc_code';\n\t$where_field_comp[0]='=';\n\t$where_field_value[0]=$parameter_value;\n\t$where_logical[0]='OR';\n\t$where_field_name[1]='cc_code2';\n\t$where_field_comp[1]='=';\n\t$where_field_value[1]=$parameter_value;\n\t$local_error=\"\";\n\tif (!db_select_ext($table_name, $field_name, $where_field_name, $where_field_comp, $where_field_value, $where_logical, $field_value, $local_error)) {\n\t\tswitch ($local_error) {\n\t\t\tcase \"Error in the parameters given\":\n\t\t\t\t$errors[$l_errors]=array();\n\t\t\t\t$errors[$l_errors]['code']=1412;\n\t\t\t\t$errors[$l_errors]['message']=$local_error.\" to db_select()\";\n\t\t\t\t$l_errors++;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$errors[$l_errors]=array();\n\t\t\t\t$errors[$l_errors]['code']=4100;\n\t\t\t\t$errors[$l_errors]['message']=$local_error;\n\t\t\t\t$l_errors++;\n\t\t}\n\t\treturn FALSE;\n\t}\n\t$l_field_value=count($field_value);\n\tif ($l_field_value>1) {\n\t\t// Only 1 result should be found\n\t\t$errors[$l_errors]=array();\n\t\t$errors[$l_errors]['code']=1411;\n\t\t$errors[$l_errors]['message']=\"Multiple rows in the cc table correspond to this cc_code: '\".$parameter_value.\"'\";\n\t\t$l_errors++;\n\t\treturn FALSE;\n\t}\n\telseif ($l_field_value==0) {\n\t\t// Only 1 result should be found\n\t\t$errors[$l_errors]=array();\n\t\t$errors[$l_errors]['code']=9;\n\t\t$errors[$l_errors]['message']=\"ownerCode with value '\".$parameter_value.\"' from '\".$class['tag'].\"' class with code '\".$class['attributes']['CODE'].\"' could not be found in the database\";\n\t\t$l_errors++;\n\t\treturn FALSE;\n\t}\n\t$cc_id=$field_value[0][0];\n\t\n\t// If loader is not a developer\n\tif (!$developer) {\n\t\t// Check permission\n\t\t$found=FALSE;\n\t\t// Loop on array of users who permitted user to upload data for them\n\t\tfor ($i=0; $i<count($user_upload); $i++) {\n\t\t\tif ($cc_id==$user_upload['id'][$i]) {\n\t\t\t\t// User found in the list\n\t\t\t\t$found=TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Check boolean\n\t\tif (!$found) {\n\t\t\t$errors[$l_errors]=array();\n\t\t\t$errors[$l_errors]['code']=3;\n\t\t\t$errors[$l_errors]['message']=\"You do not have the rights to upload for owner with code '\".$elements[$i]['value'][0].\"'. If you wish to be granted this permission, please contact them directly.\";\n\t\t\t$l_errors++;\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t\n\t// Return cc_id\n\t$result=$cc_id;\n\t\n\treturn TRUE;\n}",
"public function testIsOwner() {\n // Check the membership of the group owner.\n $membership = Og::createMembership($this->group, $this->owner);\n $this->assertTrue($membership->isOwner());\n\n // Check the membership of a normal user.\n $membership = Og::createMembership($this->group, $this->user);\n $this->assertFalse($membership->isOwner());\n }",
"public function valid () {}"
] | [
"0.6615926",
"0.65914035",
"0.6248647",
"0.6248647",
"0.6212154",
"0.6204084",
"0.6033576",
"0.6033576",
"0.6033576",
"0.6033576",
"0.6033576",
"0.6033576",
"0.6033576",
"0.6033576",
"0.6023769",
"0.5857299",
"0.5850791",
"0.57724696",
"0.5747596",
"0.572023",
"0.570545",
"0.570545",
"0.570545",
"0.56777465",
"0.56777465",
"0.5672693",
"0.56546056",
"0.5648854",
"0.56371623",
"0.5634183"
] | 0.77334964 | 0 |
Validation routine for directory path. | function validate_directory($dir)
{
clearos_profile(__METHOD__, __LINE__);
if (!preg_match("/^([A-Za-z0-9\-\.\_\/]+)$/", $dir))
return lang('flexshare_directory_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isValidDirectory()\n {\n $path = SystemUtility::refactorDS(ROOT . $this->name);\n $directories = Nishchay::getStructureProcessor()->getDirectories($this->type);\n\n $options = [];\n $i = 1;\n foreach ($directories as $namespace => $path) {\n $options[$i++] = $namespace;\n }\n $options[$i] = 'Select this if you have entered namespace';\n\n $answer = (int) $this->getInput('Where do you want to create(Type number)', $options, 3, true);\n if ($answer !== $i) {\n $this->name = $options[$answer] . '\\\\' . $this->name;\n }\n $path = SystemUtility::refactorDS(ROOT . $this->name);\n try {\n if (file_exists($path)) {\n $input = $this->getInput('Directory already exist,'\n . ' Do you create in same'\n . ' directory?', 'YN');\n if ($input === 'n') {\n throw new ApplicationException('Operation terminated by user.', null, null, 933005);\n }\n return $path;\n }\n if (($type = Nishchay::getStructureProcessor()\n ->isValidDirectory($path)) === false ||\n $type !== $this->type) {\n goto INVALID;\n }\n return $path;\n } catch (InvalidStructureException $e) {\n INVALID:\n throw new ApplicationException('Directory [' . $this->name . '] is not valid as'\n . ' per structure definition.', null, null, 933006);\n }\n }",
"private function validatePath()\n\t{\n\t\t$this->path = CLASSOVERRIDER_PATH;\n\t\tif( strpos(strrev($this->path), '/') !== 0 ) {\n\t\t\t$this->path .= '/';\n\t\t}\n\t}",
"function validate_dir_path($uid, $dir)\n{\n\t$user_dir = ROOT_DIR . '/' . $uid;\n\t$full_path = $user_dir . '/' . trim($dir, '/');\n\n\treturn strpos(abspath($full_path), $user_dir) === 0;\n}",
"public function validate_dir()\n\t{\n\t\tif (substr_count($this->ext_name, '/') !== 1 || $this->ext_name != $this->get_metadata('name'))\n\t\t{\n\t\t\tthrow new \\phpbb\\extension\\exception('EXTENSION_DIR_INVALID');\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isPathValid()\n {\n $path = $this->deletefiles_directory;\n\n return\n strlen($path) > 0 &&\n file_exists(PATH_site.$path) &&\n GeneralUtility::isAllowedAbsPath(PATH_site.$path) &&\n GeneralUtility::validPathStr($path)\n ;\n }",
"function _filefield_widget_settings_file_path_validate($element, &$form_state) {\r\n $form_state['values']['file_path'] = trim($form_state['values']['file_path'], '\\\\/');\r\n\r\n // Do not allow the file path to be the same as the file_directory_path().\r\n // This causes all sorts of problems with things like file_create_url().\r\n if (strpos($form_state['values']['file_path'], file_directory_path()) === 0) {\r\n form_error($element, t('The file path (@file_path) cannot start with the system files directory (@files_directory), as this may cause conflicts when building file URLs.', array('@file_path' => $form_state['values']['file_path'], '@files_directory' => file_directory_path())));\r\n }\r\n}",
"public function testIsValidPath(): void\n {\n $testCases = [\n \"\" => true,\n \"users\" => true,\n \"users/\" => true,\n \"users/1\" => true,\n \"users/1/\" => true,\n \"users/%AA\" => true,\n // Arbitrary numbers of consecutive slashes are allowed in the paths\n \"/users/1\" => true,\n \"//users/1\" => true,\n \"///users/1\" => true,\n \"users//1\" => true,\n // All of the valid characters together\n \"%00azAZ09-._~!$&'()*+,;=:@/\" => true,\n // Invalid characters and percent encodings\n \"?\" => false,\n \"#\" => false,\n \"[\" => false,\n \"]\" => false,\n \"%A\" => false,\n \"%G\" => false,\n \"%GA\" => false,\n \"%AG\" => false\n ];\n\n foreach ($testCases as $path => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidPath($path), \"Failed for case '$path'.\");\n }\n }",
"public function is_valid_dir() {\n if ($this->filecount > 0) {\n return true;\n } else {\n return false;\n }\n }",
"static protected function validateCacheDir()\n\t{\n\n\t\tself::validateOpt('cacheDir');\n\n\t\tself::$_cacheDir = self::$_opt['cacheDir'];\n\t\t$isValid = self::validateDir(self::$_cacheDir);\n\n\t\treturn $isValid;\n\n\t}",
"private static function test_valid_path($y_path) {\n\t\t//--\n\t\t$y_path = (string) $y_path;\n\t\t//--\n\t\tif(!preg_match('/^[_a-zA-Z0-9\\-\\.@#\\/]+$/', (string)$y_path)) { // {{{SYNC-SAFE-PATH-CHARS}}} {{{SYNC-CHK-SAFE-PATH}}} only ISO-8859-1 characters are allowed in paths (unicode paths are unsafe for the network environments !!!)\n\t\t\treturn 0;\n\t\t} //end if\n\t\t//--\n\t\tif(\n\t\t\t((string)trim($y_path) == '') OR \t\t\t// empty path: error\n\t\t\t((string)trim($y_path) == '.') OR \t\t\t// special: protected\n\t\t\t((string)trim($y_path) == '..') OR \t\t\t// special: protected\n\t\t\t((string)trim($y_path) == '/') OR \t\t\t// root dir: security\n\t\t\t(strpos($y_path, ' ') !== false) OR \t\t// no space allowed\n\t\t\t(strpos($y_path, '\\\\') !== false) OR \t\t// no backslash allowed\n\t\t\t(strpos($y_path, ':') !== false) OR \t\t// no dos/win disk access allowed\n\t\t\t(strpos($y_path, '|') !== false) OR \t\t// no macos disk access allowed\n\t\t\t((string)trim($y_path) == './') OR \t\t\t// this must not be used - dissalow FS operations to the app root path, enforce use relative paths such as path/to/something\n\t\t\t((string)trim($y_path) == '../') OR \t\t// backward path access denied: security\n\t\t\t((string)trim($y_path) == './.') OR \t\t// this is a risk that can lead to unpredictable results\n\t\t\t(strpos($y_path, '...') !== false) OR \t\t// this is a risk that can lead to unpredictable results\n\t\t\t(substr(trim($y_path), -2, 2) == '/.') OR \t// special: protected ; this may lead to rewrite/delete the special protected . in a directory if refered as a filename or dirname that may break the filesystem\n\t\t\t(substr(trim($y_path), -3, 3) == '/..') \t// special: protected ; this may lead to rewrite/delete the special protected .. in a directory if refered as a filename or dirname that may break the filesystem\n\t\t) {\n\t\t\treturn 0;\n\t\t} //end if else\n\t\t//--\n\t\treturn 1; // valid\n\t\t//--\n\t}",
"public function testValidatePath(){\n $template = array(\n 'path' => Settings::MANDATORY | Settings::PATH,\n 'dir' => Settings::PATH,\n );\n $this->config->path = __FILE__;\n $this->config->dir = dirname(__FILE__);\n // test\n $this->assertTrue( $this->config->validate($template) );\n }",
"public function validate_directory($path) {\n if(!File::isDirectory($path)){\n if(File::makeDirectory($path, 0777, true, true)) {\n return true;\n } else {\n # Unable to create directory.\n return false;\n }\n\n } else {\n return true;\n }\n }",
"function isValidDir(&$model, $check) {\n\t\t$field = array_pop(array_keys($check));\n\n\t\treturn is_dir($this->settings[$model->alias][$field]['path']);\n\t}",
"public function admin_options_section_validate_templateDirectory($field_val)\n { \n $return = false;\n $field_val = trim($field_val);\n // validate input\n if ( $field_val == '' ){\n $return = ' '; //blank, not empty or you'll get trouble emptying the value!\n }else{\n if( substr( $field_val, -1 ) != \"/\" ) $field_val = $field_val.\"/\";\n if ( is_dir( $field_val ) and is_readable( $field_val ) ){\n $return = $field_val;\n }else{\n // create a nice Error including you field_id\n add_settings_error(\n 'templateDirectory', \n 'settings_updated', \n 'Enter a existing and readable Template Directory Path\n @ templateDirectory<br />Path must be absolute and readable.\n <br /> You entered: \"'.$field_val.'\"'\n );\n }\n }\n return $return;\n }",
"private function checkDir()\n {\n if (!is_dir($this->option['templateDir'])) {\n $this->core->err('101', $this->option['templateDir']);\n }\n\n if (!is_dir($this->option['compileDir'])) {\n $this->core->err('101', $this->option['compileDir']);\n }\n\n if (!is_dir($this->option['cacheDir'])) {\n $this->core->err('101', $this->option['cacheDir']);\n }\n\n }",
"static protected function validateOutputDir()\n\t{\n\n\t\tself::validateOpt('outputDir');\n\n\t\tself::$_outputDir = self::$_opt['outputDir'];\n\t\t$isValid = self::validateDir(self::$_outputDir);\n\n\t\treturn $isValid;\n\n\t}",
"function _sensation_check_dir($dir) {\n // Normalize directory name\n $dir = file_stream_wrapper_uri_normalize($dir);\n\n // Create directory (if not exist)\n file_prepare_directory($dir, FILE_CREATE_DIRECTORY);\n}",
"private function _verifyPath($path) {\n if (!is_dir($path)) {\n throw new Exception('save path is not a valid directory');\n }\n if (!is_writable($path)) {\n throw new Exception('save path is not writable');\n }\n }",
"private function isValidPath(string $path = null) : bool {\n if (null === $path) {\n return false;\n }\n\n if (!preg_match(self::PATH_REGEX, $path)) {\n return false;\n }\n\n if ($path === '/..' // Trying to go via the parent dir\n || strpos($path, '/../') === 0 // Trying to go via the parent dir\n ) {\n return false;\n }\n\n return !$this->isOff(self::ALLOW_2_SLASHES) || $this->countToken('//', $path) <= 0;\n }",
"public function testInvalidDir(): void\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage(\"Passed path \\\"./tests/invalid/path\\\" (false) isn't a directory\");\n\n Tools::walkDir(\"./tests/invalid/path\", [$this, \"buildDirStructure\"]);\n }",
"protected function validatePath(Symfony\\Component\\Finder\\SplFileInfo $file) {\n $filename = $file->getRelativePathname();\n if (substr($filename, 0, 1) == '/') {\n $filename = substr($filename, 1);\n }\n\n $isThumb = false;\n if (strpos($filename, 'typo3temp/comvosfilelist/') === 0) {\n $pid = (int) preg_replace('/(typo3temp\\/comvosfilelist\\/)([0-9]+)(\\/.*)/', '$2', $filename);\n if ($pid == $GLOBALS['TSFE']->id) {\n $isThumb = true;\n }\n }\n return (t3lib_div::verifyFilenameAgainstDenyPattern($file->getRealPath())\n && t3lib_div::isAllowedAbsPath($file->getRealPath())\n && ($isThumb || !$this->conf['directory']) || t3lib_div::isFirstPartOfStr($filename, $this->conf['directory'])\n && $file->isFile()\n && $file->isReadable()\n );\n }",
"function file_check_directory(&$directory) {\n $directory = rtrim($directory, '/\\\\');\n return is_dir($directory) && is_writable($directory);\n}",
"public function validateFileStructure() {\n\n\t\t// if home directory is not defined, create this one now.\n\t\tif (!is_dir($this->settings['documentsCache'])) {\n\t\t\t// @todo: check whether a set up action would be preferable\n\t\t\t//throw new Exception('Exception thrown #1294746784: temp directory does not exist \"' . $this->settings['documentsCache'] . '\". Run command setUp', 1294746784);\n\t\t\ttry {\n\t\t\t\tt3lib_div::mkdir($this->settings['documentsCache']);\n\t\t\t} catch (Exception $e) {\n\t\t\t\tTx_TerDoc_Utility_Cli::log($e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\t// Check if configuration is valid ...and throw error if that is not the case\n\t\tif (!is_dir($this->settings['repositoryDir'])) {\n\t\t\tthrow new Exception('Exception thrown #1294657643: directory does not exist \"' . $this->settings['repositoryDir'] . '\". Make sure key \"repositoryDir\" is properly defined.', 1294657643);\n\t\t}\n\t}",
"public function validateFileExists($value)\n {\n if($value==\"\")\n return true;\n\n if(file_exists(getcwd().\"\\\\$value\"))\n return true;\n\n $this->form_validation->set_message('validateFileExists', _l(\"The entered path in {field} is not exists.\", $this));\n return false;\n }",
"protected function validatePath(string $name)\n {\n if (false !== strpos($name, \"\\0\")) {\n throw new LoaderException('A template name cannot contain NUL bytes');\n }\n\n $name = ltrim($name, '/');\n $parts = explode('/', $name);\n $level = 0;\n foreach ($parts as $part) {\n if ('..' === $part) {\n --$level;\n } elseif ('.' !== $part) {\n ++$level;\n }\n\n if ($level < 0) {\n throw new LoaderException(sprintf(\n 'Looks like you try to load a template outside configured directories (%s)',\n $name\n ));\n }\n }\n }",
"public function checkDir($path)\n\t{\n\t\tif(!file_exists($path)){\r\n\t\t\tmkdir($path);\r\n\t\t}\n\t\t\n\t\treturn $path;\n\t}",
"static protected function validatePublicDir()\n\t{\n\t\t\n\t\tif (self::$_opt['publicDir'] === null) {\n\t\t\n\t\t\tself::$_publicDir = self::$_outputDir;\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\tself::$_publicDir = self::$_opt['publicDir'];\n\n\t\t}\n\n\t\t$char = substr(self::$_publicDir, 0, 1);\n\n\t\tif (self::$_opt['absolutePaths'] === true && $char !== '/') {\n\n\t\t\tself::$_publicDir = '/'.self::$_publicDir;\n\n\t\t}\n\n\n\t}",
"public function valid() {\n\t\t// We are still valid if there is a directory left to scan.\n\t\treturn count($this->dir) != 0;\n\t}",
"function file_check_path(&$path) {\n // Check if path is a directory.\n if (file_check_directory($path)) {\n return '';\n }\n\n // Check if path is a possible dir/file.\n $filename = basename($path);\n $path = dirname($path);\n if (file_check_directory($path)) {\n return $filename;\n }\n\n return false;\n}",
"static protected function validateDir($dir)\n\t{\n\n\t\tif (is_dir($dir) === false && mkdir($dir, 0777, true) === false) {\n\n\t\t\t$msg = '\"%s\" is not a valid directory.';\n\t\t\t$msg = sprintf($msg, $dir);\n\n\t\t\tthrow new MinifyException($msg);\n\n\t\t}\n\n\t\tif (is_writable($dir) === false) {\n\n\t\t\t$msg = '\"%s\" is not writable.';\n\t\t\t$msg = sprintf($msg, $dir);\n\n\t\t\tthrow new MinifyException($msg);\n\n\t\t}\n\n\t\treturn true;\n\n\t}"
] | [
"0.71443266",
"0.710137",
"0.70848197",
"0.6989168",
"0.6966818",
"0.6875103",
"0.68503076",
"0.67652583",
"0.6760652",
"0.6740876",
"0.6675855",
"0.66731566",
"0.65789515",
"0.65611154",
"0.64759064",
"0.64703554",
"0.6460755",
"0.63803",
"0.63484246",
"0.6210148",
"0.6171287",
"0.6169712",
"0.6161933",
"0.61404806",
"0.61151993",
"0.61151475",
"0.61028427",
"0.60786283",
"0.60631514",
"0.6052362"
] | 0.7452509 | 0 |
Validation routine for flexshare file comment. | function validate_file_comment($comment)
{
clearos_profile(__METHOD__, __LINE__);
// TODO: validate
if (FALSE)
return lang('flexshare_file_comment_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _comment_validate()\n {\n// TODO: Check and refactor if required\n global $_ARRAYLANG;\n\n if (!isset($_REQUEST['cAuthorID']) && (!isset($_REQUEST['cAuthor']) || $_REQUEST['cAuthor'] == '')) {\n $this->strErrMessage = $_ARRAYLANG['TXT_NEWS_COMMENT_NOT_VALID_AUTHOR'];\n } elseif (!isset($_REQUEST['cTitle']) || $_REQUEST['cTitle'] == '') {\n $this->strErrMessage = $_ARRAYLANG['TXT_NEWS_COMMENT_NOT_VALID_TITLE'];\n } elseif (!isset($_REQUEST['cMessage']) || $_REQUEST['cMessage'] == '') {\n $this->strErrMessage = $_ARRAYLANG['TXT_NEWS_COMMENT_NOT_VALID_MESSAGE'];\n }\n\n if (empty($this->strErrMessage)) {\n return true;\n } else {\n return false;\n }\n }",
"public function validateFile(){\n\t\t\t\n\t\t}",
"function validate_content(DocumentInfo $doc) {\n // need not be checked by load_content.\n return true;\n }",
"function validate_file() {\n return validate_post_file($this->request->getPost(\"file_name\"));\n }",
"function validate_upload(DocumentInfo $doc) {\n return true;\n }",
"private function validateFile() {\n $filesPostName = $this->filesPostName;\n\n // dissallow upload if upload file doesn't match\n if (!is_uploaded_file($_FILES[\"$filesPostName\"]['tmp_name']) ) {\n $this->throwError(\"user tried to upload a file but file name didn't match the actual upload\");\n return 0;\n }\n\n // disallow upload if reports of the browser header,and mime type do not match.\n else if ($this->file_type !== $this->file_mime) {\n $this->throwError(\"File Validation Fails\\n \\$file_type !== \\$file_mime \\n\");\n return 0;\n\n // disallow upload if mimetype does not match the file extention\n } else if ($this->file_mime !== $this->file_extention) {\n\n $message = \"File Validation Fails\n \\n \\$file_mime !== \\$file_extention\n \\n \\$file_mime => $this->file_mime\n \\n \\$file_extention => $this->file_extention\";\n\n $this->throwError(\"$message\");\n return 0;\n\n // allow upload if there are no <?php tags or <script tags in the file>\n } else if ($this->inDeptValidation() ) {\n return 1;\n }\n }",
"function check(){ \n\t\t// check for valid name \n\t\tif (trim($this->comment) == '')\n\t\t{\n\t\t\t$this->setError(JText::_('ROW_WAS_NOT_FOUND'));\n\t\t\treturn false;\n\t\t}\n\t\t$this->comment = nl2br( $this->comment );\n\t\t$this->article_id = intval($this->article_id);\n\t\t// check for valid name \n\t\tif( !$this->article_id )\n\t\t{\n\t\t\t$this->setError(JText::_('SYSTEM ERROR!!!'));\n\t\t\treturn false;\n\t\t}\t// check for valid name \n\n\t\t/*if( !$this->check_email_address($this->mail) )\n\t\t{\n\t\t\t$this->setError(JText::_('Your E-Mail is Incorrect!'));\n\t\t\treturn false;\n\t\t}*/\t// check for valid name \n\t\treturn true;\n\t}",
"function validFile($name) {\n\t\t$ext = TODTDocs::_ext($name);\n\t\t\n\t\tif($ext=='.odt' || $ext=='.docx' || $ext=='.xlsx' || $ext=='.ods') return TRUE;\n\t\telse { print \"Type de fichier ($ext) non supporté ($name).\"; return false; }\n\t\t\n\t}",
"public function validate($filename = null) {}",
"public function validateExternal() {\n\t\t\t$this->setSize($this->target);\n\t\t\ttry {\n\t\t\t\tif($this->fileType == 'image') $this->checkReal();\n\t\t\t\t$this->checkType();\n\t\t\t\t$this->checkSize();\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$this->delete($this->target); // File is invalid - delete.\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"function filefield_widget_validate(&$element, &$form_state) {\r\n // If referencing an existing file, only allow if there are existing\r\n // references. This prevents unmanaged files (outside of FileField) from\r\n // being deleted if this node were to be deleted.\r\n if (!empty($element['fid']['#value'])) {\r\n $field = content_fields($element['#field_name'], $element['#type_name']);\r\n if ($file = field_file_load($element['fid']['#value'])) {\r\n $file = (object) $file;\r\n if ($file->status == FILE_STATUS_PERMANENT) {\r\n if (field_file_references($file) == 0) {\r\n form_error($element, t('Referencing to the file used in the %field field is not allowed.', array('%field' => $element['#title'])));\r\n }\r\n }\r\n }\r\n else {\r\n form_error($element, t('The file referenced by the %field field does not exist.', array('%field' => $element['#title'])));\r\n }\r\n }\r\n}",
"private function validateTags()\n {\n $tagTokens = $this->getCommentTagTokens();\n\n $tagValidatorFactory = new TagValidatorFactory();\n\n foreach ($tagTokens as $tagPtr => $tagToken) {\n $validator = $tagValidatorFactory->createFromTagName($this->file, $tagToken['content']);\n\n if ($validator === null) {\n continue;\n }\n\n $tagEndPtr = $this->getTagEndPointer($tagPtr);\n $stringPtr = $this->file->findNext([T_DOC_COMMENT_STRING], $tagPtr + 1, $tagEndPtr + 1);\n\n\n $validator->validate($tagToken, $stringPtr, $stringPtr > 0 ? $this->tokens[$stringPtr] : null);\n }\n }",
"public function validate( DBFile_File $file );",
"abstract protected function isValidFile($filename);",
"private function validate()\n {\n // Now\n if (!is_array($this->fileContents[\"now\"])) {\n $this->fileContents[\"now\"] = array();\n }\n if (!is_array($this->fileContents[\"now\"][\"users\"])) {\n $this->fileContents[\"now\"][\"users\"] = array();\n }\n\n // Daily\n if (!is_array($this->fileContents[\"daily\"])) {\n $this->fileContents[\"daily\"] = array();\n }\n if (!is_int($this->fileContents[\"daily\"][\"day\"])) {\n $this->fileContents[\"daily\"][\"day\"] = intval(date(\"d\"));\n }\n if (!is_array($this->fileContents[\"daily\"][\"users\"])) {\n $this->fileContents[\"daily\"][\"users\"] = array();\n }\n\n // Total\n if (!is_array($this->fileContents[\"total\"])) {\n $this->fileContents[\"total\"] = array();\n }\n if (!is_int($this->fileContents[\"total\"][\"count\"])) {\n $this->fileContents[\"total\"][\"count\"] = 0;\n }\n }",
"public function testComments() {\n if (isset($this->comments)) {\n $this->commentValid = true;\n $this->comments = $this->test_input($this->comments);\n } else {\n $this->commentValid = false;\n $this->commentsError = \"Please provide a comment.\";\n }\n }",
"public function validate()\n {\n if ( $this->data === null && !file_exists( $this->path ) )\n throw new System_Core_Exception( 'Attachment file does not exist' );\n }",
"function _filecheck()\n\t{\n\t\t$filename=$this->filename;\n\t\tif (file_exists($filename))\n\t\t{\n\t\t\t$tmp = explode('.',$filename);\n\t\t\t$filetype=strtolower(array_pop($tmp));\n\t\t\t/*if(!in_array($filetype,$this->Filter))\n\t\t\t{\n\t\t\t\t$this->errormsg.=$filename.' is not allowed to download';\n\t\t\t\tif($this->debug) exit($filename.' is not allowed to download') ;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{*/\n\t\t\t\tif ( function_exists( \"mime_content_type\" ) )\n\t\t\t\t{\n\t\t\t\t\t$this->mineType = mime_content_type( $filename );\n\t\t\t\t}\n\t\t\t\tif(empty($this->mineType))\n\t\t\t\t{\n\t\t\t\t\tif( isset($this->xlq_filetype[$filetype]) ) $this->mineType = $this->xlq_filetype[$filetype];\n\t\t\t\t}\n\n\t\t\t\tif(!empty($this->mineType)) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t$this->errormsg.='get '.$filename.' file type error, or there is no file type in the default';\n\t\t\t\t\tif($this->debug) exit('get file type error.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errormsg.=$filename.' is not exist!';\n\t\t\tif($this->debug) exit($filename.' is not exist!') ;\n\t\t\treturn false;\n\t\t}\n\t}",
"function validate_description($description)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_\\' ]*)$/\", $description))\n return lang('flexshare_description_invalid');\n }",
"public function rules()\n {\n return [\n 'share_file' => 'required|file|max:10240'\n ];\n }",
"public function validateUploadFile($file)\n {\n }",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n\n\t\t$valid = false;\n\n\t\tif (preg_match('|//\\s|', $tokens[$stackPtr]['content']))\n\t\t{\n\t\t\t$valid = true;\n\t\t}\n\n\t\tif (preg_match('|\\*[\\s/]|', $tokens[$stackPtr]['content']))\n\t\t{\n\t\t\t$valid = true;\n\t\t}\n\n\t\tif ($valid === false)\n\t\t{\n $error = 'A space is required at the start of the comment %s';\n $data = array(trim($tokens[$stackPtr]['content']));\n $phpcsFile->addError($error, $stackPtr, 'Found', $data);\n }\n\n }",
"function check()\n {\n $message = plugin::check();\n if($this->cn == \"\" ){\n $message[] = msgPool::required(_(\"Name\"));\n }\n if(!count($this->use_gotoMimeFilePattern)){\n $message[] = msgPool::required(_(\"File pattern\"));\n }\n\n // Check if a wrong base was supplied\n if(!$this->baseSelector->checkLastBaseUpdate()){\n $message[]= msgPool::check_base();;\n }\n\n /* Check if there is already a mime type with this cn */\n $ldap = $this->config->get_ldap_link();\n $ldap->cd($this->config->current[\"BASE\"]);\n\n if($this->is_release()){\n $base = $this->parent->parent->mime_release;\n }else{\n $base = get_ou(\"mimetype\", \"mimetypeRDN\").$this->base;\n }\n\n $ldap->ls(\"(&(objectClass=gotoMimeType)(cn=\".$this->cn.\"))\",$base,array(\"cn\"));\n if($ldap->count()){\n $attrs = $ldap->fetch();\n if($this->dn != $attrs['dn']) {\n $message[]= msgPool::duplicated(\"cn\");\n }\n }\n\n /* Check if we are allowed to create or move this object\n */\n if($this->orig_dn == \"new\" && !$this->acl_is_createable($this->base)){\n $message[] = msgPool::permCreate();\n }elseif($this->orig_dn != \"new\" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){\n $message[] = msgPool::permMove();\n }\n\n return($message);\n }",
"function hook_file_validate($file) {\n $errors = array();\n\n if (empty($file->filename)) {\n $errors[] = t(\"The file's name is empty. Please give a name to the file.\");\n }\n if (strlen($file->filename) > 255) {\n $errors[] = t(\"The file's name exceeds the 255 characters limit. Please rename the file and try again.\");\n }\n\n return $errors;\n}",
"function validateAttachment($pName, $pParams, &$pErrors) {\n\t\tif (is_array($pParams['format']) && !empty($_FILES[$pName]) && !empty($_FILES[$pName]['type'])) {\n\n\t\t\tglobal $gBitSystem;\n\t\t\t// Get the mime type since the php type can not be trusted\n\t\t\t$mimeType = $gBitSystem->verifyMimeType( $_FILES[$pName]['tmp_name'] );\n\t\t\t// Check this type against the allowed formats for this attachment\n\t\t\tif (!in_array($mimeType, $pParams['format'])) {\n\t\t\t\t$pErrors[$pName] = \"Invalid file format for \" . $pParams['name'];\n\t\t\t}\n\t\t}\t\t\t\n\t}",
"private function checkFile()\n {\n $this->err_no_file = false;\n\n if ( !(isset($this->file['size']) && (int) $this->file['size']) )\n $this->err_no_file = true;\n\n return $this->err_no_file;\n }",
"abstract protected function checkFilename($filename);",
"public function validateFileStructure() {\n\n\t\t// if home directory is not defined, create this one now.\n\t\tif (!is_dir($this->settings['documentsCache'])) {\n\t\t\t// @todo: check whether a set up action would be preferable\n\t\t\t//throw new Exception('Exception thrown #1294746784: temp directory does not exist \"' . $this->settings['documentsCache'] . '\". Run command setUp', 1294746784);\n\t\t\ttry {\n\t\t\t\tt3lib_div::mkdir($this->settings['documentsCache']);\n\t\t\t} catch (Exception $e) {\n\t\t\t\tTx_TerDoc_Utility_Cli::log($e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\t// Check if configuration is valid ...and throw error if that is not the case\n\t\tif (!is_dir($this->settings['repositoryDir'])) {\n\t\t\tthrow new Exception('Exception thrown #1294657643: directory does not exist \"' . $this->settings['repositoryDir'] . '\". Make sure key \"repositoryDir\" is properly defined.', 1294657643);\n\t\t}\n\t}",
"private function inDeptValidation() {\n $content = file_get_contents($this->tmp_name);\n $screenedContent = file_get_contents($this->tmp_name);\n\n // Scan for Html and script tags\n $screenedContent = str_replace(\"script\",\"\",\"$screenedContent\");\n $screenedContent = str_replace(\"<?php\",\"\",\"$screenedContent\");\n\n // if there are no php or script tags found return true\n if ($screenedContent === $content) {\n $return = 1;\n } else {\n $return = 0;\n }\n\n unset($content);\n unset($screenedContent);\n return $return;\n }",
"protected function validateDocument()\n {\n // no-op\n }"
] | [
"0.69115657",
"0.6466534",
"0.622435",
"0.6162288",
"0.60234004",
"0.6020412",
"0.600508",
"0.5973711",
"0.5972033",
"0.59540546",
"0.5908068",
"0.57949406",
"0.5787582",
"0.5721466",
"0.57110745",
"0.5696539",
"0.56232405",
"0.55600196",
"0.5554707",
"0.55335337",
"0.5503925",
"0.549937",
"0.54991275",
"0.548297",
"0.54792655",
"0.5477574",
"0.5463761",
"0.5458342",
"0.5450661",
"0.54341424"
] | 0.7948672 | 0 |
Validation routine for web directory alias. | function validate_web_directory_alias($alias)
{
clearos_profile(__METHOD__, __LINE__);
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_web_server_alias($server_alias)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('web_server/Httpd'))\n return;\n\n $httpd = new Httpd();\n\n return $httpd->validate_aliases($server_alias);\n }",
"function check()\n\t{\n\t\t// setting alias\n\t\tif ( empty( $this->alias ) )\n\t\t{\n\t\t\t$this->alias = OutputFilter::stringURLSafe( $this->name );\n\t\t}\n\t\telse {\n\t\t\t$this->alias = OutputFilter::stringURLSafe( $this->alias ); // make sure the user didn't modify it to something illegal...\n\t\t}\n\t\t//should check name unicity\n\t\treturn true;\n\t}",
"function validate_directory($dir)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_\\/]+)$/\", $dir))\n return lang('flexshare_directory_invalid');\n }",
"static protected function validatePublicDir()\n\t{\n\t\t\n\t\tif (self::$_opt['publicDir'] === null) {\n\t\t\n\t\t\tself::$_publicDir = self::$_outputDir;\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\tself::$_publicDir = self::$_opt['publicDir'];\n\n\t\t}\n\n\t\t$char = substr(self::$_publicDir, 0, 1);\n\n\t\tif (self::$_opt['absolutePaths'] === true && $char !== '/') {\n\n\t\t\tself::$_publicDir = '/'.self::$_publicDir;\n\n\t\t}\n\n\n\t}",
"function digidiss_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"function drstk_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"function shorturl_admin_settings_form_validate($form, &$form_state) {\n \n // Make sure the domain URL is fully formed and valid\n if (!valid_url($form_state['values']['shorturl_domain'], TRUE)) {\n form_set_error('shorturl_domain', t('Invalid URL: %url', array('%url' => $form_state['values']['shorturl_domain'])));\n }\n \n}",
"protected function validateAlias()\n {\n if (!is_string($this->alias)) {\n throw new InvalidArgumentException(\"Alias must be a string.\");\n }\n\n if (\n strpos($this->alias, ' ') !== false\n ) {\n throw new DomainException(\n \"Alias must not contain spaces.\"\n );\n }\n }",
"public static function validateAlias()\n\t{\n\t\treturn array(\n\t\t\tnew Entity\\Validator\\Length(NULL, 255),\n\t\t);\n\t}",
"function validateURL($field){\n $field = filter_var($field, FILTER_SANITIZE_URL);\n if(filter_var($field, FILTER_VALIDATE_URL)){\n return \"\";\n }else{\n return \"Invalided URL \";\n }\n}",
"function PageLinkIsInvalid ($link)\r\n{\r\n\tif (trim($link) == \"\")\r\n\t{\r\n\t\treturn false;//no characters\r\n\t}\r\n\t#check if alpha numeric\r\n\tif (eregi(\"[^a-zA-Z0-9-]\", $link))\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\telse \r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}",
"function validate_web_server_name($server_name)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('web_server/Httpd'))\n return;\n\n if (empty($server_name))\n return;\n\n $httpd = new Httpd();\n\n return $httpd->validate_server_name($server_name);\n }",
"function validate_name($name)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_]+)$/\", $name))\n return lang('flexshare_name_invalid');\n }",
"public static function isValidName($name)\n {\n return preg_match('/^[a-z0-9-_\\.]+\\/[a-z0-9-_\\.]+$/i', $name) > 0;\n }",
"public function validateUrl($url);",
"function validate_web_realm($realm)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_\\/\\' ]+)$/\", $realm))\n return lang('flexshare_web_realm_invalid');\n }",
"public function validate_dir()\n\t{\n\t\tif (substr_count($this->ext_name, '/') !== 1 || $this->ext_name != $this->get_metadata('name'))\n\t\t{\n\t\t\tthrow new \\phpbb\\extension\\exception('EXTENSION_DIR_INVALID');\n\t\t}\n\n\t\treturn true;\n\t}",
"function is_valid_domain_name(){\n // add more `domain-name`\n $domains = array('localhost','192.168.43.147','kamal');\n if (in_array($_SERVER['HTTP_HOST'], $domains)){\n // $domain = $_SERVER['HTTP_HOST'];\n return true;\n }\n else{\n // $domain = 'localhost';\n return false;\n }\n}",
"function fourzerofour_options_validate($input){\r\r\n $url_redirect = $input['fourzerofour_url'];\r\r\n\tif(empty($url_redirect)) return $url_redirect;\r\r\n if(strpos($url_redirect,'http://')===false){\r\r\n $url_redirect = 'http://'.$url_redirect;\r\r\n }\r\r\n $validated['fourzerofour_url'] = $url_redirect;\r\r\n return $validated;\r\r\n}",
"function validateUrl($str3)\r\n{\r\nif (!preg_match('#^http\\\\:\\\\/\\\\/[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)?[a-z]+#i', $str3)) \r\n{\r\n\treturn false;\r\n}\r\nelse\r\n{\r\n\r\n\t$fp = @fopen($str3,\"r\"); \r\n if ($fp) { \r\n fclose($fp); \r\n return true; \r\n } else { \r\n return false; \r\n } \r\n}\r\n}",
"public function htaccess_admin_settings_generate_validate($form, &$form_state) {\n $profile_name = $form_state['values']['htaccess_settings_generate_name'];\n\n if(preg_match('/[^a-z0-9]/', $profile_name)) {\n form_error($form, t('The name of the profile must be lowercase and without any special character.'));\n }\n // The name of the profile must be unique\n $htaccess_name = db_select('htaccess', 'h')\n ->fields('h')\n ->condition('name', $profile_name, '=')\n ->execute()\n ->fetchAssoc();\n\n if($htaccess_name){\n form_error($form, t('The profile @profile already exists.', array('@profile' => $profile_name)));\n }\n }",
"public function validate()\n {\n $url = self::getHostUrl($this->url);\n $site_url = self::getHostUrl();\n if ($site_url === null) {\n $site_url = self::getHostUrl(site_url('url'));\n }\n if ($url === $site_url || !$url) {\n return false;\n }\n return true;\n }",
"function valida_string_alias_reservado($cadena){\n\t//\techo \"**\".$cadena.\"**\";\n\t\t$valido=true;\n\t\n\t\t$cadena=strtolower($cadena);\n\t\n\t\tswitch($cadena){\n\t\t\tcase 'perfil_emp': \t\n\t\t\tcase 'negocios': \t\n\t\t\tcase 'campana': \n\t\t\tcase 'a1': \n\t\t\tcase 'mapknawer':\n\t\t\tcase 'css': \n\t\t\tcase 'cpanel': \n\t\t\tcase 'activacion_cuenta': \n\t\t\tcase 'fbconect': \n\t\t\tcase 'presentacion': \n\t\t\tcase 'js': \n\t\t\tcase 'ral': \n\t\t\tcase 'conexion': \n\t\t\tcase 'img': \n\t\t\tcase 'html': \n\t\t\tcase 'login': \n\t\t\tcase 'pag_web': \n\t\t\tcase 'plantillas': \n\t\t\tcase 'post': \n\t\t\tcase 'usuario': \n\t\t\tcase 'util': \n\t\t\tcase 'dao': \n\t\t\tcase 'cpanel': \n\t\t\tcase 'artist': \n\t\t\tcase 'embed': \n\t\t\tcase 'worker': \n\t\t\tcase 'donate': \n\t\t\tcase 'transit': \n\t\t\tcase 'taxi': \n\t\t\tcase 'pets': \n\t\t\tcase 'developers': \n\t\t\tcase 'mobile': \n\t\t\tcase 'musicians': \n\t\t\tcase 'academics': \n\t\t\tcase 'foundedStuffs':\t\t\n\t\t\tcase 'tourist': \n\t\t\tcase 'default': $valido=false; break;\n\t\t}\n\t\t\n\t\t\n\t\treturn $valido;\n\t}",
"protected function validateURIFormat() {\n\n\t\tarray_shift( $this->path_fragments );\n\t\t$end_i = count($this->path_fragments)-1;\n\n\t\t//last char in URI path must be /\n\t\tif( $this->path_fragments[$end_i]===\"\" ) {\n\t\t\tunset($this->path_fragments[$end_i]);\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//... or some opened document, or XML and so on\n\t\tif( strpos( $this->path_fragments[$end_i], \".\")!==false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn true;\n\n\t\t/*\n\t\t$this->setRedirect(\n\t\t\t$this->base_URL\n\t\t\t\t. $this->path . \"/\"\n\t\t\t\t. (($this->query) ? \"?\".$this->query : \"\"),\n\t\t\tMvc_Router::REDIRECT_TYPE_PERMANENTLY\n\t\t);\n\n\t\treturn false;\n\t\t*/\n\t}",
"private static function validatePart(string $part, bool $isDirectory, ?string &$error): bool\n {\n if (preg_match('/[^0-9a-zA-Z._~!\\$&\\'()*+,;=:@\\[\\]%-]/', $part, $matches)) {\n $error = ($isDirectory ? 'Part of directory' : 'Filename') . ' \"' . $part . '\" contains invalid character \"' . $matches[0] . '\".';\n\n return false;\n }\n\n return true;\n }",
"function validate_dir_path($uid, $dir)\n{\n\t$user_dir = ROOT_DIR . '/' . $uid;\n\t$full_path = $user_dir . '/' . trim($dir, '/');\n\n\treturn strpos(abspath($full_path), $user_dir) === 0;\n}",
"function druid_validate_url($url)\n {\n /*\n * This pattern is derived from Symfony\\Component\\Validator\\Constraints\\UrlValidator (2.7.4)\n * (c) Fabien Potencier <[email protected]> http://symfony.com\n */\n $pattern = '~^\n ((aaa|aaas|about|acap|acct|acr|adiumxtra|afp|afs|aim|apt|attachment|aw|barion|beshare|bitcoin|blob|bolo|callto|cap|chrome|chrome-extension|cid|coap|coaps|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-playcontainer|dlna-playsingle|dns|dntp|dtn|dvb|ed2k|example|facetime|fax|feed|feedready|file|filesystem|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|ham|hcp|http|https|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|ms-help|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|msnim|msrp|msrps|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|oid|opaquelocktoken|pack|palm|paparazzi|pkcs11|platform|pop|pres|prospero|proxy|psyc|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|secondlife|service|session|sftp|sgn|shttp|sieve|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|things|thismessage|tip|tn3270|turn|turns|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|videotex|view-source|wais|webcal|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc\\.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39\\.50|z39\\.50r|z39\\.50s)):// # protocol\n (([\\pL\\pN-]+:)?([\\pL\\pN-]+)@)? # basic auth\n (\n ([\\pL\\pN\\pS-\\.])+(\\.?([\\pL]|xn\\-\\-[\\pL\\pN-]+)+\\.?) # a domain name\n | # or\n \\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3} # a IP address\n | # or\n \\[\n (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))\n \\] # a IPv6 address\n )\n (:[0-9]+)? # a port (optional)\n (/?|/\\S+) # a /, nothing or a / with something\n $~ixu';\n\n return preg_match($pattern, $url) === 1;\n }",
"function nameValidCheck($name) {\n\t\t\t\tif (preg_match(Parameters::incompatibruMid, $name, $out)) {\n\t\t\t\t\terr(\"Invalid element name.\", 50);\n\t\t\t\t}\n\t\t\t}",
"function validURL(&$url) {\r\n\tif ( empty($url) ) return false;\r\n\tif ( strpos($url, \"https://\") !== 0 ) return false;\t// ensures https AND avoids \"javascript:\" urls\r\n\tif ( !preg_match('|^[a-zA-Z0-9$_.+!*\\'(),/?=&#;:%-]+$|D', $url) ) return false;\r\n\tif( !filter_var($url, FILTER_VALIDATE_URL) ) return false;\r\n\treturn true;\r\n}",
"function drush_upgrade_site_upgrade_validate($target_key = NULL) {\n if (empty($target_key)) {\n return drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Missing argument: target'));\n }\n\n if (!$target_alias = drush_sitealias_get_record($target_key)) {\n return drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Site alias not found: @target-key. See example.drushrc.php.', array('@target-key' => $target_key)));\n }\n\n if (!file_exists(dirname($target_alias['root']))) {\n drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Parent directory for site alias root not found: @root; this folder must exist before running site-upgrade. See example.drushrc.php.', array('@root' => dirname($target_alias['root']))));\n }\n\n if (realpath($target_alias['root']) == realpath(DRUPAL_ROOT)) {\n drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Target site alias must have a different Drupal root directory than the source site. Both are at @root.', array('@root' => $target_alias['root'])));\n }\n}"
] | [
"0.66421694",
"0.6431478",
"0.62450916",
"0.62176645",
"0.61529464",
"0.6114978",
"0.60897607",
"0.597625",
"0.5877266",
"0.5838391",
"0.58360887",
"0.58302295",
"0.5820462",
"0.58099705",
"0.5801135",
"0.57948476",
"0.5732743",
"0.57305616",
"0.57260257",
"0.57168204",
"0.57147",
"0.57102185",
"0.5705262",
"0.5702287",
"0.5700943",
"0.5667554",
"0.565634",
"0.5615413",
"0.5578333",
"0.5562749"
] | 0.7727147 | 0 |
Validation routine for web server alias. | function validate_web_server_alias($server_alias)
{
clearos_profile(__METHOD__, __LINE__);
if (!clearos_library_installed('web_server/Httpd'))
return;
$httpd = new Httpd();
return $httpd->validate_aliases($server_alias);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_web_directory_alias($alias)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return;\n }",
"function validate_web_server_name($server_name)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('web_server/Httpd'))\n return;\n\n if (empty($server_name))\n return;\n\n $httpd = new Httpd();\n\n return $httpd->validate_server_name($server_name);\n }",
"function check()\n\t{\n\t\t// setting alias\n\t\tif ( empty( $this->alias ) )\n\t\t{\n\t\t\t$this->alias = OutputFilter::stringURLSafe( $this->name );\n\t\t}\n\t\telse {\n\t\t\t$this->alias = OutputFilter::stringURLSafe( $this->alias ); // make sure the user didn't modify it to something illegal...\n\t\t}\n\t\t//should check name unicity\n\t\treturn true;\n\t}",
"public function validate_host() {\n if (isset($this->initial_data[\"host\"])) {\n # Ensure it is a valid hostname\n if (is_hostname($this->initial_data[\"host\"])) {\n $this->validated_data[\"host\"] = $this->initial_data['host'];\n } else {\n $this->errors[] = APIResponse\\get(2046);\n }\n } else {\n $this->errors[] = APIResponse\\get(2007);\n }\n }",
"function is_valid_domain_name(){\n // add more `domain-name`\n $domains = array('localhost','192.168.43.147','kamal');\n if (in_array($_SERVER['HTTP_HOST'], $domains)){\n // $domain = $_SERVER['HTTP_HOST'];\n return true;\n }\n else{\n // $domain = 'localhost';\n return false;\n }\n}",
"public function checkHost() {\n\t\tif (!$this->host) {\n\t\t\tthrow new URLException(120);\n\t\t}\n\t\t$regexp = '/^\\d{2,3}(\\.\\d{1,3}){3}$/';\n\t\tif (!checkdnsrr($this->host, 'A') && !preg_match($regexp, $this->host)) {\n\t\t\tthrow new URLException(120);\n\t\t}\n\t}",
"function shorturl_admin_settings_form_validate($form, &$form_state) {\n \n // Make sure the domain URL is fully formed and valid\n if (!valid_url($form_state['values']['shorturl_domain'], TRUE)) {\n form_set_error('shorturl_domain', t('Invalid URL: %url', array('%url' => $form_state['values']['shorturl_domain'])));\n }\n \n}",
"function ipAndPortValidator($serverIPAddress, $serverPort)\r\n{\r\n\t//So, now that we have the IP address and port from our source of choice, MAKE SURE to validate them before we go ANY further!\r\n\tif($serverPort != \"\") $serverPort = numericValidator($serverPort, 1, 65535, 29070);\r\n\tif($serverIPAddress != \"\") $serverIPAddress = ipAddressValidator($serverIPAddress);\r\n\r\n\t//Check for path exploits\r\n\tif(strpos($serverPort, \"..\") !== false || strpos($serverIPAddress, \"..\") !== false)\r\n\t{\r\n\t\tdisplayError(\"Server address exploit detected! This event has been logged.\", \"\", \"\");\r\n\t\treturn array(\"\", \"\");\r\n\t}\r\n\r\n\treturn array($serverIPAddress, $serverPort);\r\n}",
"public static function validateAlias()\n\t{\n\t\treturn array(\n\t\t\tnew Entity\\Validator\\Length(NULL, 255),\n\t\t);\n\t}",
"public function validate()\n {\n $url = self::getHostUrl($this->url);\n $site_url = self::getHostUrl();\n if ($site_url === null) {\n $site_url = self::getHostUrl(site_url('url'));\n }\n if ($url === $site_url || !$url) {\n return false;\n }\n return true;\n }",
"function is_valid_addr()\n{\n\t$disallow = \"/hotmail\\.com|msn\\.com|yahoo\\.com|bigoot\\.com|lycos\\.com/\";\n\t$email = sanitize_variable($_REQUEST['email']);\n\tif($email == '' )\n\t{\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\treturn 1;\n\t}\n}",
"function valida_string_alias_reservado($cadena){\n\t//\techo \"**\".$cadena.\"**\";\n\t\t$valido=true;\n\t\n\t\t$cadena=strtolower($cadena);\n\t\n\t\tswitch($cadena){\n\t\t\tcase 'perfil_emp': \t\n\t\t\tcase 'negocios': \t\n\t\t\tcase 'campana': \n\t\t\tcase 'a1': \n\t\t\tcase 'mapknawer':\n\t\t\tcase 'css': \n\t\t\tcase 'cpanel': \n\t\t\tcase 'activacion_cuenta': \n\t\t\tcase 'fbconect': \n\t\t\tcase 'presentacion': \n\t\t\tcase 'js': \n\t\t\tcase 'ral': \n\t\t\tcase 'conexion': \n\t\t\tcase 'img': \n\t\t\tcase 'html': \n\t\t\tcase 'login': \n\t\t\tcase 'pag_web': \n\t\t\tcase 'plantillas': \n\t\t\tcase 'post': \n\t\t\tcase 'usuario': \n\t\t\tcase 'util': \n\t\t\tcase 'dao': \n\t\t\tcase 'cpanel': \n\t\t\tcase 'artist': \n\t\t\tcase 'embed': \n\t\t\tcase 'worker': \n\t\t\tcase 'donate': \n\t\t\tcase 'transit': \n\t\t\tcase 'taxi': \n\t\t\tcase 'pets': \n\t\t\tcase 'developers': \n\t\t\tcase 'mobile': \n\t\t\tcase 'musicians': \n\t\t\tcase 'academics': \n\t\t\tcase 'foundedStuffs':\t\t\n\t\t\tcase 'tourist': \n\t\t\tcase 'default': $valido=false; break;\n\t\t}\n\t\t\n\t\t\n\t\treturn $valido;\n\t}",
"function _validHost($host) {\n return preg_match('/^\\[?(?:[a-zA-Z0-9-:\\]_]+\\.?)+$/', $host);\n}",
"public function isValid()\n {\n if (isset($this->servers[$this->TLDs][0])\n && strlen($this->servers[$this->TLDs][0]) > 6\n ) {\n $tmp_domain = mb_strtolower($this->subDomain);\n if (preg_match('/^[=]?[a-z0-9\\-]+$/', $tmp_domain)\n && !preg_match('/^-|-$/', $tmp_domain)\n // && !preg_match(\"/--/\", $tmp_domain)\n ) {\n return true;\n }\n }\n\n return false;\n }",
"protected function validateAlias()\n {\n if (!is_string($this->alias)) {\n throw new InvalidArgumentException(\"Alias must be a string.\");\n }\n\n if (\n strpos($this->alias, ' ') !== false\n ) {\n throw new DomainException(\n \"Alias must not contain spaces.\"\n );\n }\n }",
"function validate_dns($dns)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function validate_hostname($hostname)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (empty($hostname))\n return lang('network_hostname_is_invalid');\n }",
"public function isValid()\n {\n return parent::isValid() && $this->isHostnameSafe();\n }",
"public function validate_domain() {\n if (isset($this->initial_data[\"domain\"])) {\n # Ensure it is a validate hostname\n if (is_hostname($this->initial_data[\"domain\"])) {\n $this->validated_data[\"domain\"] = $this->initial_data['domain'];\n } else {\n $this->errors[] = APIResponse\\get(2047);\n }\n } else {\n $this->errors[] = APIResponse\\get(2008);\n }\n }",
"function drupal_valid_http_host($host) {\n return preg_match('/^\\[?(?:[a-zA-Z0-9-:\\]_]+\\.?)+$/', $host);\n}",
"function nameValidCheck($name) {\n\t\t\t\tif (preg_match(Parameters::incompatibruMid, $name, $out)) {\n\t\t\t\t\terr(\"Invalid element name.\", 50);\n\t\t\t\t}\n\t\t\t}",
"function digidiss_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"function validate_name($name)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_]+)$/\", $name))\n return lang('flexshare_name_invalid');\n }",
"function fourzerofour_options_validate($input){\r\r\n $url_redirect = $input['fourzerofour_url'];\r\r\n\tif(empty($url_redirect)) return $url_redirect;\r\r\n if(strpos($url_redirect,'http://')===false){\r\r\n $url_redirect = 'http://'.$url_redirect;\r\r\n }\r\r\n $validated['fourzerofour_url'] = $url_redirect;\r\r\n return $validated;\r\r\n}",
"protected function checkHost($value = '')\n {\n return preg_match('/[a-zA-Z0-9.-]{1,253}/', $value);\n }",
"function drstk_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"function inlay_admin_options_validate_url_prefix($input) {\n\n if (preg_match('@<script src=\"([^\"]+/)(?:inlay-[a-z0-9]+\\.js\") .*</script>$@s', $input, $matches)) {\n // They pasted a whole inlay script in, e.g.\n // <script src=\"https://example.org/sites/default/files/civicrm/inlay-abcdef012345.js\" data-inlay-id=\"abcdef012345\" ></script>\n // Just extract the bit we need.\n $input = $matches[1];\n }\n\n if (preg_match('@^https?://.*/$@', $input)) {\n // Looks ok.\n return $input;\n }\n\n return '';\n}",
"public function htaccess_admin_settings_generate_validate($form, &$form_state) {\n $profile_name = $form_state['values']['htaccess_settings_generate_name'];\n\n if(preg_match('/[^a-z0-9]/', $profile_name)) {\n form_error($form, t('The name of the profile must be lowercase and without any special character.'));\n }\n // The name of the profile must be unique\n $htaccess_name = db_select('htaccess', 'h')\n ->fields('h')\n ->condition('name', $profile_name, '=')\n ->execute()\n ->fetchAssoc();\n\n if($htaccess_name){\n form_error($form, t('The profile @profile already exists.', array('@profile' => $profile_name)));\n }\n }",
"function checkSpoof() {\n\tif (!eregi(\"http://\",$_GET['r']) && !eregi(\"ftp://\",$_GET['r']) && !eregi(\"https://\",$_GET['r'])) {\n\t\thttpredir($_GET['r']);\n\t} else {\n\t\thttpredir(\"index.php\");\n\t}\n}",
"function PageLinkIsInvalid ($link)\r\n{\r\n\tif (trim($link) == \"\")\r\n\t{\r\n\t\treturn false;//no characters\r\n\t}\r\n\t#check if alpha numeric\r\n\tif (eregi(\"[^a-zA-Z0-9-]\", $link))\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\telse \r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}"
] | [
"0.70416003",
"0.67586017",
"0.65724224",
"0.6488922",
"0.6403822",
"0.63237715",
"0.6292861",
"0.61095226",
"0.6051894",
"0.59816897",
"0.5974288",
"0.59685737",
"0.59643203",
"0.5935482",
"0.5886221",
"0.58283633",
"0.5821751",
"0.5790881",
"0.57761097",
"0.57708436",
"0.5745638",
"0.5736974",
"0.5707934",
"0.5707194",
"0.5679038",
"0.5678973",
"0.56775373",
"0.5667097",
"0.5651873",
"0.5631427"
] | 0.7593947 | 0 |
Validation routine for web server name. | function validate_web_server_name($server_name)
{
clearos_profile(__METHOD__, __LINE__);
if (!clearos_library_installed('web_server/Httpd'))
return;
if (empty($server_name))
return;
$httpd = new Httpd();
return $httpd->validate_server_name($server_name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_valid_domain_name(){\n // add more `domain-name`\n $domains = array('localhost','192.168.43.147','kamal');\n if (in_array($_SERVER['HTTP_HOST'], $domains)){\n // $domain = $_SERVER['HTTP_HOST'];\n return true;\n }\n else{\n // $domain = 'localhost';\n return false;\n }\n}",
"static function isValidName()\n {\n }",
"function validate_name($name)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_]+)$/\", $name))\n return lang('flexshare_name_invalid');\n }",
"private function validateSubmitterName() {\r\n\t\t$this->submitterName = $this->extractForm('submitterName');\r\n\t\tif (empty($this->submitterName)) \r\n\t\t\t$this->setError('submitterName', 'SUBMITTER_NAME_EMPTY');\r\n\t\telseif (!filter_var($this->submitterName, FILTER_VALIDATE_REGEXP,\r\n\t\t\tarray(\"options\"=>array(\"regexp\" =>\"/^([a-zA-Z0-9\\-\\_])+$/i\")) )) {\r\n\t\t\t$this->setError('submitterName', 'SUBMITTER_NAME_HAS_INVALID_CHARS');\r\n\t\t}\r\n\t}",
"public function validateName()\n {\n\t \tif ((strlen($this->changeNameInput)<3) || (strlen($this->changeNameInput)>20))\n\t\t{\n\t\t\t$this->error_name[] = \"Name has to consist of 3 to 20 characters\";\n\t\t}\n\t\t\n\t\tif (ctype_alnum($this->changeNameInput) == false)\n\t\t{\n\t\t\t$this->error_name[] = \"Name has to consist only of alphanumeric characters\";\n\t\t}\n\t}",
"function name_valid($name) {\n $ok = true;\n \n $array = explode(' ', $name); \n if (sizeof($array) < 2) {\n $ok = false;\n }\n \n return $ok;\n}",
"function nameValidCheck($name) {\n\t\t\t\tif (preg_match(Parameters::incompatibruMid, $name, $out)) {\n\t\t\t\t\terr(\"Invalid element name.\", 50);\n\t\t\t\t}\n\t\t\t}",
"public function validateHostName($host_name)\n {\n $validator = new Server();\n\n return $validator->isDomain($host_name) || $validator->isIp($host_name);\n }",
"public function validate_host() {\n if (isset($this->initial_data[\"host\"])) {\n # Ensure it is a valid hostname\n if (is_hostname($this->initial_data[\"host\"])) {\n $this->validated_data[\"host\"] = $this->initial_data['host'];\n } else {\n $this->errors[] = APIResponse\\get(2046);\n }\n } else {\n $this->errors[] = APIResponse\\get(2007);\n }\n }",
"function checkusername($name) {\n \t\tif (preg_match(\"/^[a-zA-z0-9-_.]{3;20}$/\", $name)) return true;\n\t}",
"function validateUsername($name) {\n\t\t// dummy for now #note\n\t\treturn $name;\n\t}",
"public function nameIsValid($name) {\r\n \r\n }",
"function validateName($name)\n {\n // check if the name is empty or not\n $name = trim($name);\n \n // check if empty\n if(empty($name))\n\t\t{\n\t\t\t// if empty, return an error that the name is empty\n\t\t\treturn \"Please provide a database name\";\n\t\t}\n\t\t// check the length of the database name\n\t\telse if(strlen($name) > 15 || strlen($name) < 5)\n\t\t{\n\t\t\t// return a message that the length is not valid\n\t\t\treturn \"Database name should be 5-15 characters long\";\n\t\t}\n // check the syntax\n else if(eregi(\"[^a-zA-Z0-9\\_\\-]\", $name))\n {\n // if it has a wrong syntx, return an error that the name is invalid\n return \"Please provide a valid database name\"; \n }\n \n return;\n }",
"public function validateName($name){\n // Preg Match for Name Value\n $name_exception = preg_match('/[\\d\\[\\]\\/\\'`^£$%&*()};\"!:{@#~?><>,|=_+¬-]/', $name);\n $name_back_slash_check = preg_match('/\\\\\\\\/', $name);\n\n // Conditions for Name field\n if(empty($name)){\n $_SESSION['user_edit_name_error']=\"You Must have to Give Name Here\";\n return false;\n }elseif(empty(trim($name)) || $name_exception || $name_back_slash_check){\n $_SESSION['user_edit_name_error']=\"Please Give a Valid Name\";\n return false;\n }else{\n return true;\n }\n }",
"function set_web_server_name($name, $server_name)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n Validation_Exception::is_valid($this->validate_web_server_name($server_name));\n\n $this->_set_parameter($name, 'WebServerName', $server_name);\n }",
"function validate_hostname($hostname)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (empty($hostname))\n return lang('network_hostname_is_invalid');\n }",
"function validName($_PASSED/*allows use of both $_GET and $_POST*/){\n\tif(!isset($_PASSED[\"name\"]))\n\t\treturn false;\n\treturn preg_match(\"/\\S+/\", $_PASSED[\"name\"]);\n}",
"function validate_username($username) {\n //return preg_match(\"/^[A-Za-z0-9_- ]+$/\", $username);\n return preg_match(\"/^[A-Za-z0-9_-]+$/\", $username);\n }",
"public static function isValidName($name)\n {\n return preg_match('/^[a-z0-9-_\\.]+\\/[a-z0-9-_\\.]+$/i', $name) > 0;\n }",
"private static function sanitize_name($name) {\n if(!isset($name)) {\n $name = $_SERVER['REQUEST_URI'];\n if(stripos($name, BASE_URL) == 0)\n $name = substr($name, strlen(BASE_URL));\n $queryidx = strpos($name, '?');\n if($queryidx !== false)\n $name = substr($name, 0, $queryidx);\n }\n \n $name = trim($name, \" \\t\\n\\r\\0\\x0B/\");\n if(empty($name))\n $name = 'home';\n if(!isset(self::$config[$name]))\n $name = '404';\n return $name;\n }",
"function validate_name_pattern($name){\n\n\tif(strlen($name) < 2)\n\t return FALSE;\n\n\treturn TRUE;\n\n\tif (ereg ('^[a-zA-Z0-9\\s.\\-_\\']+$', $name, $match_results)) {\n\t return TRUE;\n\t}\n\treturn FALSE;\n}",
"function validateName( $value ) {\n // last name or hyphenated lastname.\n $numOfSpaces = substr_count($value, \" \");\n if ($numOfSpaces != 1) {\n return 0;\n }\n\n // Ensure user has only entered letters, space(s), and hypen\n $pattern = '/^[a-z A-Z-]+$/';\n $matchesPattern = preg_match($pattern, $value);\n if ($matchesPattern != 1) {\n return 0;\n } \n\n return 1;\n }",
"public function is_survey_name_valid()\n {\n //get_survey_by_user_name($name)\n $name=$_GET['name'];\n $data=$this->survey->get_survey_by_user_name($name);\n if(empty($data))\n {\n echo json_encode('true');\n }\n else\n {\n echo json_encode('false');\n }\n }",
"function validName($name){\n if(strlen(trim($name))>4 && !empty($name)){\n return true;\n }\n else return false;\n }",
"private function _validateName($name) {\n if (!isset($name) || strlen($name) === 0) {\n throw new Exception(\"name must be set and not empty\");\n }\n }",
"function validate_web_server_alias($server_alias)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('web_server/Httpd'))\n return;\n\n $httpd = new Httpd();\n\n return $httpd->validate_aliases($server_alias);\n }",
"public function validName()\n {\n return !empty($this->name);\n }",
"public function validate_name() {\n if (!parent::validate_string_length($this->genrename, 2, 50)) {\n return 'Please insert a valid genre (2-50 characters)';\n }\n }",
"function validName($name)\n{\n return !empty($name) && strlen($name) > 1 && ctype_alpha($name);\n}",
"protected function checkHost($value = '')\n {\n return preg_match('/[a-zA-Z0-9.-]{1,253}/', $value);\n }"
] | [
"0.65030825",
"0.6433834",
"0.6421408",
"0.63350374",
"0.630424",
"0.6246921",
"0.61975265",
"0.61762774",
"0.6148072",
"0.61452365",
"0.60944915",
"0.60602",
"0.6055567",
"0.6047333",
"0.6027674",
"0.6024526",
"0.5973184",
"0.5963223",
"0.5957376",
"0.5945223",
"0.594184",
"0.59306055",
"0.58765113",
"0.58463234",
"0.5808953",
"0.5807579",
"0.5800913",
"0.58001894",
"0.5800142",
"0.5787365"
] | 0.80267096 | 0 |
Validation routine for web realm. | function validate_web_realm($realm)
{
clearos_profile(__METHOD__, __LINE__);
if (!preg_match("/^([A-Za-z0-9\-\.\_\/\' ]+)$/", $realm))
return lang('flexshare_web_realm_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function validation();",
"public function validate();",
"public function validate();",
"public function validate();",
"abstract protected function validate();",
"abstract protected function validate();",
"public static function validate() {}",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"public abstract function validate();",
"public function valid() {}",
"public function valid() {}",
"public function valid () {}",
"public function validate()\n\t{\n\t}",
"public function validate()\n\t{\n\t}",
"abstract public function validateUser();",
"public function validateLogin() {\nglobal $_LW;\nif ($response=$this->getResponse('/grouptypes')) {\n\tif (!empty($response['results'])) {\n\t\treturn true;\n\t};\n};\nreturn false;\n}",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"function validate()\n\t{\n\t}"
] | [
"0.6953446",
"0.68469393",
"0.68469393",
"0.68469393",
"0.6774547",
"0.6774547",
"0.6712202",
"0.67121863",
"0.67121863",
"0.67121863",
"0.67121863",
"0.67121863",
"0.67121863",
"0.67121863",
"0.67121863",
"0.664659",
"0.63797843",
"0.63797843",
"0.6365193",
"0.6359671",
"0.6359671",
"0.63510716",
"0.6343604",
"0.63254344",
"0.63254344",
"0.63254344",
"0.63254344",
"0.63254344",
"0.63254344",
"0.63242674"
] | 0.7098042 | 0 |
Validation routine for web SSL certificate. | function validate_web_ssl_certificate($certificate)
{
clearos_profile(__METHOD__, __LINE__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasValidCert()\n\t\t{\n\t\t\t\tif (!isset($_SERVER['SSL_CLIENT_M_SERIAL'])\n\t\t\t\t\t|| !isset($_SERVER['SSL_CLIENT_V_END'])\n\t\t\t\t\t|| !isset($_SERVER['SSL_CLIENT_VERIFY'])\n\t\t\t\t\t|| $_SERVER['SSL_CLIENT_VERIFY'] !== 'SUCCESS'\n\t\t\t\t\t|| !isset($_SERVER['SSL_CLIENT_I_DN'])\n\t\t\t\t) {\n\t\t\t\t\techo \"No valid certificate found(1).<br>\";\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t \n\t\t\t\tif ($_SERVER['SSL_CLIENT_V_REMAIN'] <= 0) {\n\t\t\t\t\techo \"No valid certificate found(2).<br>\";\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\techo \"Valid certificate found!<br>\";\n\t\t}",
"public function isSslCertificateRequired(){\n\t\t$url = Environment::getApiUrl($this->environment);\n\t\t\n\t\treturn (stristr($url, PayUHttpRequestInfo::PAYMENTS_PRD_URL) || \n\t\t\tstristr($url, PayUHttpRequestInfo::PAYMENTS_SANDBOX_URL));\n\t}",
"public function validateCert($certPath);",
"function certificateCheck($metadata) {\n $doc = new DOMDocument();\n $doc->load($metadata);\n $xpath = new DOMXpath($doc);\n $xpath->registerNameSpace(\"ds\", \"http://www.w3.org/2000/09/xmldsig#\");\n $certificates = $xpath->query(\"//ds:X509Certificate\");\n $certsInfo = array();\n $messages = array();\n\n if($certificates->length > 0) {\n foreach($certificates as $cert) {\n $X509Certificate = \"-----BEGIN CERTIFICATE-----\\n\" . trim ($cert->nodeValue) . \"\\n-----END CERTIFICATE-----\";\n $cert_info = openssl_x509_parse($X509Certificate, true);\n $cert_validTo = date(\"Y-m-d\", $cert_info[\"validTo_time_t\"]);\n $cert_validFor = floor((strtotime($cert_validTo)-time ())/(60*60*24));\n $pub_key = openssl_pkey_get_details(openssl_pkey_get_public($X509Certificate));\n\n array_push($certsInfo, array($cert_validTo, $cert_validFor, $pub_key[\"bits\"]));\n }\n } else {\n array_push($messages, \"No certificate found.\");\n }\n\n $certsResults = array_fill(0, count($certsInfo), array_fill(0, 2, null));\n for($i=0; $i<count($certsInfo); $i++) {\n if($certsInfo[$i][2] < $GLOBALS[\"KEY_SIZE\"]) {\n $certsResults[$i][0] = \"Public key size must be at least \" . $GLOBALS[\"KEY_SIZE\"] . \" bits. Yours is only \" . $certsInfo[$i][2] . \".\";\n }\n\n if($certsInfo[$i][1] < $GLOBALS[\"CERTIFICATE_VALIDITY\"]) {\n $certsResults[$i][1] = \"Certificate must be valid at least for \" . $GLOBALS[\"CERTIFICATE_VALIDITY\"] . \" days. Yours is \" . $certsInfo[$i][1] . \".\";\n }\n }\n\n for($i=0; $i<count($certsResults); $i++) {\n if($i%2 === 0) {\n continue;\n }\n\n if(($certsResults[$i][0] !== null) || ($certsResults[$i][1] !== null)) {\n foreach($certsResults[$i] as $m) {\n array_push($messages, $m);\n }\n }\n\n if($certsResults[$i][0] !== null) {\n foreach($certsResults[$i] as $m) {\n array_push($messages, $m);\n }\n }\n }\n\n list($returncode, $message) = generateResult($messages);\n return array($returncode, $message);\n}",
"function validate_web_require_ssl($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function verifyPeerCert(): bool\n {\n }",
"public function setVerifySslCertificate($value) { $this->verifySslCertificate = $value; }",
"public function has_ssl() {\n $domain = 'https://'.$_SERVER['HTTP_HOST'];\n $stream = stream_context_create (array(\"ssl\" => array(\"capture_peer_cert\" => true)));\n if( $read = @fopen($domain, \"rb\", false, $stream)){\n $cont = stream_context_get_params($read);\n if(isset($cont[\"options\"][\"ssl\"][\"peer_certificate\"])){\n $var = ($cont[\"options\"][\"ssl\"][\"peer_certificate\"]);\n $result = (!is_null($var)) ? true : false;\n }else {\n $result = false;\n } \n } else {\n $result = false;\n }\n \n return array(\n 'status' => $result,\n );\n }",
"public function validateCaCert($caCertPath);",
"public function willValidateCertificate() {\n return $this->willValidateCertificate;\n }",
"function assets_pull_test_endpoint_sslverify( $verify, $domain ) {\n\t\treturn false;\n\t}",
"public function isUsingSSL();",
"public function checkSSLCerts()\n {\n $info = array(\n 'name' => 'SSL Certificate Info',\n 'state' => 'missing',\n 'success' => self::FAILURE,\n 'more' => 'ssl'\n );\n\n\n if (!function_exists('openssl_get_cert_locations')) {\n return $info;\n }\n\n $stores = openssl_get_cert_locations();\n\n foreach (array('ini_cafile', 'default_cert_file') as $key) {\n if (!empty($stores[$key]) && file_exists($stores[$key])) {\n $info['success'] = self::SUCCESS;\n $info['state'] = $stores[$key];\n return $info;\n }\n }\n\n foreach (array('ini_capath', 'default_cert_dir') as $key) {\n if (!empty($stores[$key]) && is_dir($stores[$key]) && glob($stores[$key] . '/*')) {\n $info['success'] = self::SUCCESS;\n $info['state'] = $stores[$key];\n return $info;\n }\n }\n\n return $info;\n }",
"public function getVerifySslCertificate() { return $this->verifySslCertificate; }",
"function validate_chain($certs) {\n // so we an pass as a list of untrusted certs to verify. \n $untrusted_file = $this->save_cert_chain($certs);\n $trusted = openssl_x509_checkpurpose($certs[0], X509_PURPOSE_ANY, $this->trust_roots, $untrusted_file);\n $msg = openssl_error_string();\n unlink($untrusted_file);\n return $trusted;\n }",
"public function checkRequirements(){\n\t\t\tif (function_exists('openssl_verify') && (int)$this->config->get('rootcert_revoked') != 1) return true;\n\t\t\t\n\t\t\treturn false;\n\t\t}",
"public function do_ssl_check() {\n if( $this->enabled == \"yes\" ) {\n if( get_option( 'woocommerce_force_ssl_checkout' ) == \"no\" ) {\n echo \"<div class=\\\"error\\\"><p>\". sprintf( __( \"<strong>%s</strong> is enabled and WooCommerce is not forcing the SSL certificate on your checkout page. Please ensure that you have a valid SSL certificate and that you are <a href=\\\"%s\\\">forcing the checkout pages to be secured.</a>\" ), $this->method_title, admin_url( 'admin.php?page=wc-settings&tab=checkout' ) ) .\"</p></div>\";\n }\n }\n }",
"public function validateW3C(){\n $this->initW3c();\n\n return $this->w3cValid;\n }",
"public function ssl_check() {\n\t\tglobal $current_user;\n\n\t\tget_currentuserinfo();\n\n\t\t$settings = get_option( 'woocommerce_paypal_pro_settings', array() );\n\n\t \t// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS plugin is not detected\n\t\tif ( get_option( 'woocommerce_force_ssl_checkout' ) === 'no'\n\t\t\t&& ! class_exists( 'WordPressHTTPS' )\n\t\t\t&& isset( $settings['enabled'] )\n\t\t\t&& $settings['enabled'] === 'yes'\n\t\t\t&& $settings['testmode'] !== 'yes'\n\t\t\t&& ! get_user_meta( $current_user->ID, '_wc_paypal_pro_ssl_nag_hide' )\n\t\t) {\n\t\t\techo '<div class=\"error\"><p>' . sprintf( __( 'PayPal Pro requires that the <a href=\"%s\">Force secure checkout</a> option is enabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate - PayPal Pro will only work in test mode.', 'woocommerce-gateway-paypal-pro') . ' <a href=\"%s\">' . __( 'Hide Notice', 'woocommerce' ) . '</a>', admin_url('admin.php?page=woocommerce' ), wp_nonce_url( add_query_arg( 'wc_paypal_pro_ssl_nag', '1' ), 'wc_paypal_pro_ssl_nag_hide' ) ) . '</p></div>';\n\t\t}\n\n\t\treturn true;\n\t}",
"public function setWillValidateCertificate($flag) {\n $this->willValidateCertificate = $flag;\n }",
"function wp_cron_conditionally_prevent_sslverify( $request ) {\n\tif ( 'https' === wp_parse_url( $request['url'], PHP_URL_SCHEME ) ) {\n\t\t$request['args']['sslverify'] = false;\n\t}\n\treturn $request;\n}",
"public function checkSecure()\n {\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'on') {\n $postData = Mage::app()->getRequest()->getParams();\n\n // Set sandbox mode because admin is not secured.\n $this->setSandbox($postData);\n\n // Check if ssl is installed to show the right message.\n if ($this->isExistSsl(Mage::getBaseUrl()) === true) {\n return self::STORE_DOES_NOT_USE_SSL;\n }\n } else {\n $checkoutUseSsl = Mage::helper('bluesnap')\n ->checkCheckoutRedirect(Mage::getBaseUrl());\n if ($checkoutUseSsl === false) {\n return self::FRONTEND_DOES_NOT_USE_SSL;\n }\n\n if (!$this->checkAllWebsites()) {\n return self::FRONTEND_DOES_NOT_USE_SSL;\n }\n\n if (!Mage::app()->getStore()->isAdminUrlSecure()) {\n return self::ADMIN_DOES_NOT_USE_SSL;\n }\n }\n\n return self::CORRECT_SSL_CONFIG;\n }",
"public function isValid() {\n\t\tif ($this->_scheme == Http::SCHEME_HTTPS && $this->_isSecure || $this->_scheme == Http::SCHEME_HTTP && !$this->_isSecure) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private function C2CEsRejectCheckReq($at_data,$ssl_flag)\n {\n $ret_txt=\"reply_cd=0299\\n\";\n\n if( strcmp($ssl_flag,\"SSL\")==0 ){\n $ret_txt=$this->SendRepo($at_data,allat_addr_ssl,c2c_esrejectcheck_uri,allat_host,443);\n }else{\n $isEnc=$this->checkEnc($at_data);\n if( $isEnc ){ //암호화 됨\n $ret_txt=$this->SendRepo($at_data,allat_addr,c2c_esrejectcheck_uri,allat_host,80);\n }else{\n return \"reply_cd=0230\\nreply_msg=암호화 오류\\n\";\n }\n }\n return $ret_txt;\n }",
"public function getCertificate()\n {\n $polling = 0;\n while ($this->status == 'processing' && $polling < 4) {\n sleep(5);\n $this->updateOrderData();\n $polling++;\n }\n if ($this->status == 'valid' && !empty($this->certificateURL)) {\n $get = $this->connector->get($this->certificateURL);\n if (strpos($get['header'], \"200 OK\") !== false) {\n return $get['body'];\n }\n }\n return false;\n }",
"function validateCaFile($contents)\r\n{\r\n // https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html\r\n if (\r\n PHP_VERSION_ID <= 50327\r\n || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50422)\r\n || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50506)\r\n ) {\r\n return !empty($contents);\r\n }\r\n\r\n return (bool) openssl_x509_parse($contents);\r\n}",
"public function enableSSL(): bool\n {\n }",
"public function validateCert ($certPath) {\n\t\tif (!is_null($this->certPathToMatch) && $this->certPathToMatch != $certPath)\n\t\t\treturn false;\n\t\treturn true;\n\t}",
"function ssl($event_name, $data) {\n\t\tglobal $app, $conf;\n\n\t\t$app->uses('system');\n\n\t\t//* Only vhosts can have a ssl cert\n\t\tif($data[\"new\"][\"type\"] != \"vhost\" && $data[\"new\"][\"type\"] != \"vhostsubdomain\") {\n\t\t\treturn;\n\t\t}\n\n\t\tif ($data['new']['ssl_action'] == 'del') {\n\t\t\t$this->cert_helper('delete', $data);\n\t\t} else {\n\t\t\t$this->cert_helper('update', $data);\n\t\t}\n\t}",
"function openssl_x509_read($x509certdata)\n{\n}"
] | [
"0.69321567",
"0.67592436",
"0.6707104",
"0.6552662",
"0.63992834",
"0.63680005",
"0.6343642",
"0.63030636",
"0.615501",
"0.6102927",
"0.60466355",
"0.60345185",
"0.5979086",
"0.5877399",
"0.5859646",
"0.5786461",
"0.57830894",
"0.5716676",
"0.5714256",
"0.56122047",
"0.5504413",
"0.54808325",
"0.54799634",
"0.54341644",
"0.53961074",
"0.5387233",
"0.5376042",
"0.53564817",
"0.5355875",
"0.5346498"
] | 0.70553833 | 0 |
Validation routine for flexshare group permission on FTP. | function validate_ftp_group_permission($permission)
{
clearos_profile(__METHOD__, __LINE__);
$options = $this->get_ftp_permission_options();
if (!array_key_exists($permission, $options))
return lang('flexshare_permissions_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_group($group)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $group = Group_Factory::create($group);\n\n if (! $group->exists())\n return lang('flexshare_group_invalid');\n }",
"public function is_allowed($path, $group)\n\t{\t\n\t\t// declares a sub-function which will be used to \n\t\t// clean all white-spaces and transforme elements into lower case.\n\t\tif (!function_exists(\"_remove_white_spaces\"))\n\t\t{\n\t\t\tfunction _remove_white_spaces($str)\n\t\t\t{\n\t\t\t\treturn strtolower(trim($str));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// default result is 'not allowed'\n\t\t$result = FALSE;\n\t\t\n\t\t// if given path doesn't exists then, deny.\n\t\t// otherwise, validates it.\n\t\tif (isset($this->_rules[$path]))\n\t\t{\n\t\t\t// retrieve identified groups\n\t\t\t$groups = array_keys($this->_rules[$path]);\n\t\t\t$groups_to_test = explode(',', $group);\n\t\t\t\n\t\t\tarray_walk($groups_to_test, \"_remove_white_spaces\");\n\t\t\t\n\t\t\tforeach ($groups_to_test as $g)\n\t\t\t{\n\t\t\t\t$result = (in_array($g, $groups) && $this->_rules[$path][$g]) ? TRUE : FALSE;\n\t\t\t\tif ($result) break;\n\t\t\t}\n\t\t\t\n\t\t} // isset($this->_rules[$path])\n\n\t\treturn $result;\t\t\t\n\t}",
"function get_enforce_group_permissions()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $option = $this->_get_global_parameter('FlexshareSecurityPermissions');\n } catch (Flexshare_Parameter_Not_Found_Exception $e) {\n // Ignore\n } catch (Engine_Exception $e) {\n // Ignore\n }\n\n if (empty($option))\n $option = 'on';\n\n return $option;\n }",
"function TimeIt_groupPermissionCheck($obj, $secLevel=ACCESS_READ)\n{\n Loader::loadClass('UserUtil');\n \n if($obj['group'] != 'all')\n {\n $group = UserUtil::getPNGroup((int)$obj['group']);\n $obj['group'] = $group['name'];\n }\n \n if(SecurityUtil::checkPermission( 'TimeIt:Group:', $obj['group'].\"::\", $secLevel))\n {\n return true;\n } else \n {\t\n return false;\n }\n}",
"function allow_access($group) {\n\t$allowed = \"no\";\n\tif (isset($_SESSION[\"group1\"]) || isset($_SESSION[\"user_name\"])) {\n\t\tif ($_SESSION[\"group1\"] == \"$group\" || $_SESSION[\"group2\"] == \"$group\" || $_SESSION[\"group3\"] == \"$group\" ||\n\t\t\t//\t$_SESSION[\"group1\"] == \"Administrators\" || $_SESSION[\"group2\"] == \"Administrators\" || \n\t\t\t// \t$_SESSION[\"group3\"] == \"Administrators\" ||\n\t\t\t$_SESSION[\"user_name\"] == \"$group\") {\n\t\t$allowed = \"yes\";\n\t} else {\n\t\t$allowed = \"no\";\n\t}\n\t}\n\treturn $allowed;\n}",
"function ftpValidate()\n\t{\n\t\tJClientHelper::setCredentialsFromRequest('ftp');\n\t}",
"function check_permissions($Content_type)\n {\n // Check and enforce access permissions\n if ($Content_type->access == 1)\n {\n $this->secure->require_auth();\n }\n else if ($Content_type->access == 2)\n {\n // This might cause a problem if some dumbass\n // names one of his groups false\n $group_access = @unserialize($Content_type->restrict_to);\n $this->secure->groups($group_access)->require_auth();\n }\n }",
"function checkGroup( $group )\n {\n if( ( $user = authData(\"group\") ) != NULL )\n return in_array( $user, explode('|', $group) );\n return false;\n }",
"private function _check_permissions() {\n \n }",
"function validate_ftp_group_greeting($greeting)\n {\n clearos_profile(__METHOD__, __LINE__);\n // Invalid characters in greeting?\n //if (preg_match(\"//\" $greeting))\n // return lang('flexshare_greeting_invalid');\n }",
"function rm_check_group_access() {\n\t// exception: company directory/pages are ok\n\n\tif ( 'groups' !== bp_current_component() ) {\n\t\treturn;\n\t}\n\n\t// echo bp_groups_get_group_type( bp_get_current_group_id() );\n\n\tif ( bp_get_current_group_id() && 'company' !== bp_groups_get_group_type( bp_get_current_group_id() ) ) {\n\t\t// ok you are on a group page now\n\t\tif ( ! current_user_can( 'administrator' ) ) {\n\t\t\twp_safe_redirect( home_url() );\n\t\t\texit;\n\t\t}\n\t}\n\n\t// echo bp_current_component() . '-----';\n\t// echo bp_current_action() . '-----';\n\n}",
"function check()\n {\n $message = plugin::check();\n if($this->cn == \"\" ){\n $message[] = msgPool::required(_(\"Name\"));\n }\n if(!count($this->use_gotoMimeFilePattern)){\n $message[] = msgPool::required(_(\"File pattern\"));\n }\n\n // Check if a wrong base was supplied\n if(!$this->baseSelector->checkLastBaseUpdate()){\n $message[]= msgPool::check_base();;\n }\n\n /* Check if there is already a mime type with this cn */\n $ldap = $this->config->get_ldap_link();\n $ldap->cd($this->config->current[\"BASE\"]);\n\n if($this->is_release()){\n $base = $this->parent->parent->mime_release;\n }else{\n $base = get_ou(\"mimetype\", \"mimetypeRDN\").$this->base;\n }\n\n $ldap->ls(\"(&(objectClass=gotoMimeType)(cn=\".$this->cn.\"))\",$base,array(\"cn\"));\n if($ldap->count()){\n $attrs = $ldap->fetch();\n if($this->dn != $attrs['dn']) {\n $message[]= msgPool::duplicated(\"cn\");\n }\n }\n\n /* Check if we are allowed to create or move this object\n */\n if($this->orig_dn == \"new\" && !$this->acl_is_createable($this->base)){\n $message[] = msgPool::permCreate();\n }elseif($this->orig_dn != \"new\" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){\n $message[] = msgPool::permMove();\n }\n\n return($message);\n }",
"function xcms_check_rights($groups)\n{\n $u = xcms_user();\n foreach ($groups as $v)\n {\n if ($v && $v[0] == \"#\")\n {\n // this is a group\n if ($u->check_rights(substr($v, 1), false))\n return true;\n }\n else\n {\n if ($u->login() == $v)\n return true;\n }\n }\n return false;\n}",
"function _check_folder_privileges($id_folder = NULL)\n\t{\n\t\t//$this->\n\t}",
"function db_check_group_acl( $username, $dbh ) {\n\t\n\tglobal $CONF;\n\t\n\t$schema\t\t\t\t\t\t\t= db_determine_schema();\n \n\t$query\t\t\t\t\t\t\t= \"SELECT svn_groups_responsible.allowed, svn_groups_responsible.group_id \" .\n\t\t\t\t\t\t\t\t\t \" FROM \".$schema.\"svn_groups_responsible, \".$schema.\"svnusers \" .\n\t\t\t\t\t\t\t\t\t \" WHERE (svnusers.id = svn_groups_responsible.user_id) \" .\n\t\t\t\t\t\t\t\t\t \" AND (svnusers.userid = '$username') \" .\n\t\t\t\t\t\t\t\t\t \" AND (svn_groups_responsible.deleted = '00000000000000') \" .\n\t\t\t\t\t\t\t\t\t \" AND (svnusers.deleted = '00000000000000')\";\n\t$result\t\t\t\t\t\t\t= db_query( $query, $dbh );\n\t$tAllowedGroups\t\t\t\t\t= array();\n\t\n\tif( $result['rows'] > 0 ) {\n\t\t\n\t\t\n\t\twhile( $row = db_assoc( $result['result'] ) ) {\n\t\t\t\n\t\t\t$groupid\t\t\t\t\t= $row['group_id'];\n\t\t\t$right \t\t\t\t\t\t= $row['allowed'];\n\t\t\t$tAllowedGroups[$groupid]\t= $right;\n\t\t}\n\t\t\n\t}\n\t\n\treturn $tAllowedGroups;\n}",
"public function isValid()\n\t{\n\t\treturn isset($this->groups[$this->extension]);\n\t}",
"function check_permissions() {\n\n\n\n }",
"function lchgrp(string $filename, string|int $group): bool {}",
"function isGSDirBNS_TEST($fn) {\n\n // get DMP file\n if ($asRoot){\n $_SESSION['errorData']['Error'][]=\"Sorry, no admin role defined in DMP yet. Not allowed to check isGSDir $fn being user \".$_SESSION['User']['id'];\n return 0;\n }\n //$user_id = ($asRoot?$asRoot:$_SESSION['User']['id']);\n $params = array(\"file_id\" => $fn);\n $fileDMP = DMP_http(\"get\",\"file_meta\",$params);\n\n //check files attribute\n if (isset($fileDMP['files']))\n return false;\n else\n return true;\n}",
"protected function validate_access()\n {\n return true;\n }",
"function validateUpload($fileName, $folderName) {\n\n return true;\n}",
"function check_permissions($type/*,$imgid*/)\n{\n /**\n * get data\n */ \n $query = $GLOBALS['db']->Execute(\"SELECT who, groups_exceptions, groups_additional \" .\t// , and_or, alb, albums\n \t\t\"FROM \".PREFIX.\"permissions WHERE type = '\".linpha_addslashes($type).\"'\");\n $data = $query->FetchRow(ADODB_FETCH_ASSOC);\n \n /**\n * check for group permissions\n */\n $passed_groups = false;\n if($data['who'] == 2) // everybody\n {\n $passed_groups = true;\n }\n else\n {\n /**\n * quick check for default values (empty groups)\n */\n if($data['who'] == 0 && // nobody\n (empty($data['groups_additional']) OR $data['groups_additional'] == ';'))\n {\n /**\n * nobody and no additional groups -> not possible -> disable\n */\n $passed_groups = false;\n }\n elseif($data['who'] == 1 && $GLOBALS['passed'] && // only logged in (not anonymous)\n (empty($data['groups_exceptions']) OR $data['groups_exceptions'] == ';'))\n {\n /**\n * logged in (not anonymous) and no exceptions -> valid\n */\n $passed_groups = true;\n }\n else\n {\n /**\n * get groups\n */\n $query = $GLOBALS['db']->Execute(\"SELECT id, groups FROM \".PREFIX.\"groups\");\n while($groups_data = $query->FetchRow())\n {\n $groups[$groups_data['id']] = $groups_data['groups'];\n }\n \n /**\n * get array with groups which current user is member of\n */\n $my_groups = Array();\n if(isset($_SESSION['user_groups']))\n {\n $group_member_of = explode_and_slice($_SESSION['user_groups'],';');\n foreach($group_member_of AS $value)\n {\n if( isset($groups[$value]) )\n {\n $my_groups[] = $value;\n }\n }\n }\n \n if($data['who'] == 0) // nobody\n {\n /**\n * need to be in one of $groups_additional\n */\n \n $groups_additional = explode_and_slice($data['groups_additional'],';');\n $array = array_intersect($my_groups,$groups_additional);\n if(count($array) > 0)\n {\n $passed_groups = true;\n }\n }\n elseif($data['who'] == 1) // only logged in (not anonymous)\n {\n /**\n * need to be logged in and not to be in one of the $groups_exceptions\n */\n \t\t\tif(!isset($my_groups)) : $my_groups = array(); endif; //prevent notice\n \t\t\t\n $groups_exceptions = explode_and_slice($data['groups_exceptions'],';');\n $array = array_intersect($my_groups,$groups_exceptions);\n if($GLOBALS['passed'] && count($array) == 0)\n {\n $passed_groups = true;\n }\n }\n }\n }\n\n /**\n * if the condition is OR and $passed_groups = true the album check is waste time\n \n if($data['and_or'] == 1 && $passed_groups)\n {\n return true;\n }\n \n /**\n * check for albums permissions\n \n\n /**\n * check if there selected albums\n \n $passed_albums = false;\n if(empty($data['albums']) OR $data['albums'] == '//')\n {\n $empty_data = true;\n }\n else\n {\n $empty_data = false;\n }\n \n if($data['alb'] == 0) // without\n {\n if($empty_data)\n {\n $passed_albums = true;\n $need_detail_check = false;\n }\n else\n {\n $need_detail_check = true;\n }\n }\n elseif($data['alb'] == 1) // only\n {\n if($empty_data)\n {\n $passed_albums = false;\n $need_detail_check = false;\n }\n else\n {\n $need_detail_check = true;\n }\n }\n \n if($need_detail_check)\n {\n /**\n * at basket_print, basket_download, basket_mail, it is not imgid based, but\n\t\t* albid\n * only for javascript menu\n * in basket_build_*.php each imgid is checked, because the albid could\n * be changed from a user\n \n $pos = strpos($imgid,'basket_');\n if($pos !== false)\n {\n $stage = get_stage();\n $albid = substr($imgid,7);\n $query = $GLOBALS['db']->Execute(\"SELECT path FROM \".PREFIX.$stage.\"_lev_album \".\n \"WHERE id = '\".linpha_addslashes($albid).\"'\");\n $img_data = $query->FetchRow(ADODB_FETCH_ASSOC);\n $path = $img_data['path'];\n }\n else\n {\n $query = $GLOBALS['db']->Execute(\"SELECT prev_path FROM \".PREFIX.\"photos \".\n \"WHERE id = '\".linpha_addslashes($imgid).\"'\");\n $img_data = $query->FetchRow(ADODB_FETCH_ASSOC);\n $path = $img_data['prev_path'];\n }\n \n /**\n * remove leading 'albums/'\n \n\t $pos = strpos($path,'/');\n\t $path = substr($path,$pos+1);\n\n \n $array_albums = explode_and_slice($data['albums'],'//');\n \n /**\n * @todo if $img_data['prev_path'] is folder1/subfolder1 and $array_albums[1] = folder1\n * $passed_albums should also be true\n \n if(in_array($path,$array_albums))\n {\n if($data['alb'] == 1) // only\n {\n $passed_albums = true;\n }\n }\n else\n {\n if($data['alb'] == 0) // without\n {\n $passed_albums = true;\n }\n }\n }\n\n /**\n * take care of and/or\n \n if($data['and_or'] == 0) // and\n {\n if($passed_groups AND $passed_albums)\n {\n return true;\n }\n }\n else // or\n {\n if($passed_groups OR $passed_albums)\n {\n return true;\n }\n }\n */\n if( $passed_groups )\n {\n return true;\n } \n return false;\n}",
"public function valid_users()\n\t{\n\t\t$action = (array) Http::request('action', 'post');\n\t\t$action = array_map('intval', $action);\n\n\t\tif ($action)\n\t\t{\n\t\t\t// On verifie que les membres sont bien dans le groupe\n\t\t\t$sql = 'SELECT u_id\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'groups_users\n\t\t\t\t\tWHERE g_id = ' . $this->id . '\n\t\t\t\t\t\tAND gu_status = ' . GROUP_WAIT;\n\t\t\t$result = Fsb::$db->query($sql);\n\t\t\t$idx = array();\n\t\t\twhile ($row = Fsb::$db->row($result))\n\t\t\t{\n\t\t\t\tif (in_array($row['u_id'], $action))\n\t\t\t\t{\n\t\t\t\t\t$idx[] = $row['u_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t\tFsb::$db->free($result);\n\n\t\t\tif ($idx)\n\t\t\t{\n\t\t\t\t// On verifie si le groupe est bien normal\n\t\t\t\t$sql = 'SELECT g_id\n\t\t\t\t\t\tFROM ' . SQL_PREFIX . 'groups\n\t\t\t\t\t\tWHERE g_id = ' . $this->id . '\n\t\t\t\t\t\t\tAND g_type = ' . GROUP_NORMAL . '';\n\t\t\t\t$row = Fsb::$db->request($sql);\n\n\t\t\t\t// Validation des membres selectionnes\n\t\t\t\tif ($row)\n\t\t\t\t{\n\t\t\t\t\tGroup::delete_users($idx, $this->id, false);\n\t\t\t\t\tGroup::add_users($idx, $this->id, GROUP_USER);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDisplay::message('userlist_submit_add', ROOT . 'index.' . PHPEXT . '?p=userlist&g_id=' . $this->id, 'forum_userlist');\n\t}",
"public function testFoldersSetFolderPermission()\n {\n }",
"function check_permission() {\n ## Load config and store\n $CFG = $this->config->item('user_category_configure');\n if (!addPermission($CFG[\"sector\"][\"add\"])) {\n $this->form_validation->set_message('check_permission', _e('access denied'));\n return false;\n }\n }",
"function update_share_permissions()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $enforce = $this->get_enforce_group_permissions();\n\n if ($enforce == self::ENFORCE_OFF)\n return;\n\n $type = ($enforce == self::ENFORCE_FULL) ? self::TYPE_ALL : self::TYPE_FILE_SHARE;\n $shares = $this->_get_shares($type);\n\n foreach ($shares as $name => $detail)\n $this->_update_folder_attributes($detail['ShareDir'], $detail['ShareOwner'], $detail['ShareGroup'], $detail['ShareSystemPermissions']);\n }",
"function check_permission($service,$id) {\n\n\t/* groups that can access into the admin panel*/\n\t$q1 = (\"select grp from services_groups where service=(select id from services where\nname='{$service}')\");\n\n\t$data1 = getResult($q1);\n\n\t/*user group*/\n\t$q2 = (\"select grp from users_groups where user ='{$id}'\");\n\n\t$data2 = getResult($q2);\n\t\n\treturn match_verifier($data1, $data2);\n\n}",
"protected function validate_access()\n\t{\n\t\tif (!$this->userAccess->isAdmin) {\n\t\t\tif (is_null($this->chatKey) || is_null($this->memberId))\n\t\t\t\tthrow new Exception(get_system_response(\"entries\", \"notAMemberMsg\"));\n\t\t\tif (is_null($this->chatId))\n\t\t\t\tthrow new Exception(\"Invalid request\");\n\n\t\t\t$urabe = $this->urabe->get_clone();\n\t\t\t$sql = \"SELECT COUNT(*) as total FROM chat_members WHERE chatId = @1 AND userId = @2\";\n\t\t\t$sql = $urabe->format_sql_place_holders($sql);\n\t\t\t$total = intval($urabe->select_one($sql, array($this->chatId, $this->userAccess->userId)));\n\t\t\treturn $total > 0;\n\t\t} else\n\t\t\treturn true;\n\t}",
"public function actionValidateAddGroupData() {\n $req = $this->getRequest();\n $name = $req->getPost(\"name\");\n $locale = $req->getPost(\"locale\");\n $parentGroupId = $req->getPost(\"parentGroupId\");\n $instance = $this->instances->findOrThrow($req->getPost(\"instanceId\"));\n $parentGroup = $parentGroupId !== null ? $this->groups->findOrThrow($parentGroupId) : $instance->getRootGroup();\n\n if (!$this->groupAcl->canAddSubgroup($parentGroup)) {\n throw new ForbiddenRequestException();\n }\n\n $this->sendSuccessResponse([\n \"groupNameIsFree\" => count($this->groups->findByName($locale, $name, $instance, $parentGroup)) === 0\n ]);\n }",
"function spgm_CheckPerms($strFilePath) {\n\t\n spgm_Trace(\n '<p>function spgm_CheckPerms</p>'.\"\\n\"\n .'strFilePath: '.$strFilePath.'<br />'.\"\\n\"\n );\n\t\n if (! file_exists($strFilePath)) return false;\n\n $fileperms = fileperms($strFilePath);\n $isreadable = $fileperms & 4;\n if ( is_file($strFilePath) ) {\n // pictures, thumbnails, config files and comments only need to be readable\n if (! $isreadable) {\n spgm_Warning(\n $strFilePath.': '.WARNMSG_DIR_INSUFFICIENT_PERMISSIONS.'<br />'\n );\n }\n return $isreadable;\t\n }\n else if ( is_dir($strFilePath) ) {\n // galleries need to be both readable and executable\n $isexecutable = $fileperms & 1;\n if (! $isreadable || ! $isexecutable)\n spgm_Warning(\n $strFilePath.': '.WARNMSG_DIR_INSUFFICIENT_PERMISSIONS.'<br />'\n );\n return ( $isreadable && $isexecutable); // ($dirperms & 5) == 5 ?\n }\n \n // default behavior: the strFilePath does not exist\n return false;\n}"
] | [
"0.5965461",
"0.5952588",
"0.5943216",
"0.5863797",
"0.57844543",
"0.5780668",
"0.57635194",
"0.5736534",
"0.5677637",
"0.5654943",
"0.5630483",
"0.55995685",
"0.5558481",
"0.5543664",
"0.5542026",
"0.54889405",
"0.54883343",
"0.5486067",
"0.5476464",
"0.54542637",
"0.5453109",
"0.54494244",
"0.5401658",
"0.538859",
"0.5381893",
"0.5378082",
"0.53166056",
"0.53005046",
"0.52873063",
"0.5275877"
] | 0.70113355 | 0 |
Validation routine for flexshare group greeting on FTP. | function validate_ftp_group_greeting($greeting)
{
clearos_profile(__METHOD__, __LINE__);
// Invalid characters in greeting?
//if (preg_match("//" $greeting))
// return lang('flexshare_greeting_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ftpValidate()\n\t{\n\t\tJClientHelper::setCredentialsFromRequest('ftp');\n\t}",
"function validate_group($group)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $group = Group_Factory::create($group);\n\n if (! $group->exists())\n return lang('flexshare_group_invalid');\n }",
"function test_for_guest()\n{\n\tglobal $reply_nouser, $reply_error;\n\t\n\tif ( preg_match( \"/(^|,)\".$ipsclass->vars['guest_group'].\"(,|$)/\", $access_groups ) )\n\t{\n\t\tshow_message( $reply_nouser );\n\t\t//## EXIT ##\n\t}\n\telse\n\t{\n\t\tshow_message( $reply_error );\n\t\t//## EXIT ##\n\t}\n}",
"function validate()\n\t{\n\t\t$errors = array();\n\n\t\t// Name checks (length and validity)\n\n\t\t// Check length of username\n\t\tif (strlen($this->username) < 4 || strlen($this->username) > 16) {\n\t\t\t// TODO: add name too long error?\n\t\t\t$errors[] = gettext(\"Username is too short\");\n\t\t}\n\n\t\t// Check if name consists of valid charachers (letters,\n\t\t// numbers, -, and _)\n\t\tif (\n\t\t\t!ereg('^([[:alnum:]]|-|_)*$', $this->username)\n\t\t) {\n\t\t\t$errors[] = gettext(\"Username contains illegal characters\");\n\t\t}\n\n\t\treturn $errors;\n\t}",
"function check()\n {\n /* Call common method to give check the hook */\n $message= plugin::check();\n\n if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn && \n $this->parent->SubObjects[$this->cn]['status'] != 'delete'){\n $message[] = msgPool::duplicated(_(\"Name\"));\n }\n \n if($this->FAIvariableContent == \"\") {\n $message[]= msgPool::required(_(\"Content\")); \n }\n \n $c = trim($this->cn);\n if($c == \"\"){\n $message[] = msgPool::required(_(\"Name\"));\n }\n if(preg_match(\"/[^a-z0-9_\\-]/i\",$c)){\n $message[] = msgPool::invalid(_(\"Name\"),$c,\"/[a-z0-9_\\-]/i\");\n }\n\n return ($message);\n }",
"function check($groupname)\n {\n // parse group name into separate words\n $groupParse = explode(' ', $groupname); \n \n // check each word to see if it is a SQL Key Word\n foreach($groupParse as $word) \n {\n // convert word to all uppercase\n $word = strtoupper($word);\n \n // check if word is in file sqlKeyWords.txt\n // if so, it is an invalid user name\n\n if (strpos(file_get_contents(\"../includes/sqlKeyWords.txt\"), $word) !== FALSE || !ctype_alnum ($word))\n {\n apologize(\"Invalid Group Name\");\n }\n\n }\n }",
"public function check_input(&$data) {\n\n $errors=array();\n \n if(preg_match('/![a-zA-Z0-9.]/', $data['name'])) {\n $errors[] = \"Invalid Host Name!\";\n }\n\t\n // 'normalize' the MAC address to all upper case letters\n $data['primary_mac'] = strtoupper($data['primary_mac']);\n // then validate it... -ish\n if(!preg_match('/^([0-9A-F]{2}\\:){5}[0-9A-F]{2}$/i',$data['primary_mac'])){\n \t$errors[] = \"Invalid MAC Address \" . $data['primary_mac'] . \".\";\n }\n\n if(count($errors) > 0 ) {\n return $errors;\n }\n else {\n return NULL;\n }\n\n }",
"function check() {\n if (trim($this->name == \"\")) {\n $this->setError( JText::sprintf('ERR_INVALIDX', JText::_(\"Client Name\")) );\n return false;\n }\n // check for valid client contact\n // if (trim($this->contact == \"\")) {\n // $this->_error = \"Invalid Client Contact\";\n // return false;\n // }\n // check for valid client email\n // if ((trim($this->email == \"\")) || (preg_match(\"/[\\w\\.\\-]+@\\w+[\\w\\.\\-]*?\\.\\w{1,4}/\", $this->email )==false)) {\n // $this->_error = \"Invalid Contact Email Address\";\n // return false;\n // }\n return true;\n }",
"function validate_name($name)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_]+)$/\", $name))\n return lang('flexshare_name_invalid');\n }",
"function check()\n {\n $message = plugin::check();\n if($this->cn == \"\" ){\n $message[] = msgPool::required(_(\"Name\"));\n }\n if(!count($this->use_gotoMimeFilePattern)){\n $message[] = msgPool::required(_(\"File pattern\"));\n }\n\n // Check if a wrong base was supplied\n if(!$this->baseSelector->checkLastBaseUpdate()){\n $message[]= msgPool::check_base();;\n }\n\n /* Check if there is already a mime type with this cn */\n $ldap = $this->config->get_ldap_link();\n $ldap->cd($this->config->current[\"BASE\"]);\n\n if($this->is_release()){\n $base = $this->parent->parent->mime_release;\n }else{\n $base = get_ou(\"mimetype\", \"mimetypeRDN\").$this->base;\n }\n\n $ldap->ls(\"(&(objectClass=gotoMimeType)(cn=\".$this->cn.\"))\",$base,array(\"cn\"));\n if($ldap->count()){\n $attrs = $ldap->fetch();\n if($this->dn != $attrs['dn']) {\n $message[]= msgPool::duplicated(\"cn\");\n }\n }\n\n /* Check if we are allowed to create or move this object\n */\n if($this->orig_dn == \"new\" && !$this->acl_is_createable($this->base)){\n $message[] = msgPool::permCreate();\n }elseif($this->orig_dn != \"new\" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){\n $message[] = msgPool::permMove();\n }\n\n return($message);\n }",
"function validate_ftp_group_permission($permission)\n {\n clearos_profile(__METHOD__, __LINE__);\n $options = $this->get_ftp_permission_options();\n if (!array_key_exists($permission, $options))\n return lang('flexshare_permissions_invalid');\n }",
"function set_ftp_group_greeting($name, $greeting)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FtpGroupGreeting', $greeting);\n }",
"function check()\n {\n if(!$this->is_account) return array();\n $ldap= $this->config->get_ldap_link();\n\n\n /* Call common method to give check the hook */\n $message= plugin::check();\n\n /* Ensure that this group isn't renamed if the mailMethod enforces cn mailAttributes \n */\n if($this->mailMethod->mailEqualsCN() && $this->initially_was_account){\n if($this->cn != $this->orig_cn){\n $message[] = sprintf(_(\"The group 'cn' has changed. It can't be changed due to the fact that mail method '%s' relies on it!\")\n ,get_class($this->mailMethod));\n }\n }\n\n if(empty($this->gosaMailServer)){\n $message[]= msgPool::noserver(_(\"Mail\"));\n }\n\n /* Mail address checks */\n $mail = $this->mail;\n if(!(!$this->mailMethod->isModifyableMail() && $this->initially_was_account)){\n if($this->mailMethod->domainSelectionEnabled() || $this->mailMethod->mailEqualsCN()){\n $mail.= \"@\".$this->mailDomainPart;\n }\n if (empty($mail)){\n $message[]= msgPool::required(_(\"Primary address\"));\n }elseif (!tests::is_email($mail)){\n $message[]= msgPool::invalid(_(\"Mail address\"),\"\",\"\",\"[email protected]\");\n }\n }\n\n /* Check quota */\n if ($this->gosaMailQuota != '' && $this->acl_is_writeable(\"gosaMailQuota\")){\n if (!is_numeric($this->gosaMailQuota)) {\n $message[]= msgPool::invalid(_(\"Quota size\"),$this->gosaMailQuota,\"/[0-9]/\");\n } else {\n $this->gosaMailQuota= (int) $this->gosaMailQuota;\n }\n }\n\n /* Check if this mail address is already in use */\n $ldap->cd($this->config->current['BASE']);\n $chk_attr = \"cn\";\n if ($this->cn != $this->orig_cn) {\n $chk_attr = \"orig_cn\";\n }\n $filter = \"(&(!(objectClass=gosaUserTemplate))(!(cn=\".$this->$chk_attr.\"))\".\n \"(objectClass=gosaMailAccount)\".\n \"(|(mail=\".$mail.\")(alias=\".$mail.\")(gosaMailAlternateAddress=\".$mail.\")))\";\n $ldap->search($filter,array(\"cn\"));\n if ($ldap->count() != 0){\n $message[]= msgPool::duplicated(_(\"Mail address\"));\n }\n\n /* Check rejectsize for integer */\n if ($this->gosaMailMaxSize != '' && $this->acl_is_writeable(\"gosaMailQuota\")){\n if (!is_numeric($this->gosaMailMaxSize)){\n $message[]= msgPool::invalid(_(\"Mail max size\"));\n } else {\n $this->gosaMailMaxSize= (int) $this->gosaMailMaxSize;\n }\n }\n\n /* Need gosaMailMaxSize if use_mailsize_limit is checked */\n if (is_integer(strpos($this->gosaMailDeliveryMode, \"reject\")) && $this->gosaMailMaxSize == \"\"){\n $message[]= _(\"You need to set the maximum mail size in order to reject anything.\");\n }\n\n if(empty($this->gosaMailServer)){\n $message[] = msgPool::required(_(\"Mail server\"));\n }\n\n return ($message);\n }",
"public function validate_host() {\n if (isset($this->initial_data[\"host\"])) {\n # Ensure it is a valid hostname\n if (is_hostname($this->initial_data[\"host\"])) {\n $this->validated_data[\"host\"] = $this->initial_data['host'];\n } else {\n $this->errors[] = APIResponse\\get(2046);\n }\n } else {\n $this->errors[] = APIResponse\\get(2007);\n }\n }",
"function validAdminName($name) {\r\n global $f3;\r\n\r\n if(!alphabetical($name)) {\r\n $f3->set(\"adminErrors['name']\", \"Please enter a valid name\");\r\n return false;\r\n }\r\n\r\n return true;\r\n}",
"function check()\n {\n /* Call common method to give check the hook */\n $message= plugin::check();\n \n /* Only allow limited set of characters as class name to avoid issues */\n if (!preg_match('/^[A-Za-z0-9_-]*$/', $this->ClassName)) {\n $message[] = msgPool::invalid(_(\"Name\"), $this->ClassName, \"/[A-Za-z0-9_-]/\");\n }\n\n if($this->ClassName == \"\"){\n $message[]= msgPool::required(_(\"Name\"));\n }\n\n if(in_array_strict($this->ClassName,$this->forbidden)){\n $message[]= msgPool::duplicated(_(\"Name\"));\n }\n else {\n /* Check if the given ClassName is already used in another administrative unit */\n switch($this->objectClass) {\n case \"FAIpartitionTable\": $rdn = get_ou('faiPartition', 'faiPartitionRDN'); break;\n case \"FAIpackageList\" : $rdn = get_ou('faiPackage', 'faiPackageRDN'); break;\n case \"FAIscript\" : $rdn = get_ou('faiScript', 'faiScriptRDN'); break;\n case \"FAIvariable\" : $rdn = get_ou('faiVariable', 'faiVariableRDN'); break;\n case \"FAIhook\" : $rdn = get_ou('faiHook','faiHookRDN'); break;\n case \"FAIprofile\" : $rdn = get_ou('faiProfile', 'faiProfileRDN'); break;\n case \"FAItemplate\" : $rdn = get_ou('faiTemplate', 'faiTemplateRDN'); break;\n }\n $ldap= $this->config->get_ldap_link();\n $filter = \"(&(cn=\".$this->ClassName.\")(!(FAIstate=|removed)))\";\n $base = $rdn . $this->parent->fai_release;\n $ldap->cd($base);\n $ldap->search($filter, array(\"dn\",\"gosaUnitTag\"));\n\n if ($ldap->count() > 0) {\n $entry = $ldap->fetch();\n\n /* Find out which administrative unit is using the classname */\n $ldap->cd($this->config->current['BASE']);\n $filter = \"(&(objectClass=gosaAdministrativeUnit)(gosaUnitTag=\".$entry['gosaUnitTag'][0].\"))\";\n $ldap->search($filter, array('dn', 'ou'));\n\n if ($ldap->count() > 0) {\n $entry = $ldap->fetch();\n $used_by = $entry['ou'][0];\n } else {\n $used_by = $entry['gosaUnitTag'][0];\n }\n \n $message[]= sprintf(_(\"This FAI class name is already in use by the administrative unit '%s'.\"), $used_by);\n }\n }\n\n return ($message);\n }",
"function validateFrm()//Integrity testing function, if well send the following form\n{\n \techo 'Starting validation <br>';\n\t$val = true;\n\techo \"hello \" . $_POST[\"fname\"];\n\t$result = preg_match('/[a-zA-Z0-9]/', $_POST[\"fname\"]);\n\tif($result==0) \n\t{\n\t\t$nameErr=\"Login must only include letters, or numbers.\";\n\t\t$val = false;\n\t}\n\techo '<br>';\n\techo \"hello\".$_POST[\"fpass\"];\n\t$resultp = preg_match('/[a-zA-Z0-9]/', $_POST[\"fpass\"]);\n\tif($resultp==0 )\n\t{\n\t\techo $error.=\"Your password must only include letters or numbers.\";\n\t\t$val = false;\n\t}\n\treturn $val;\n}",
"function acceptChar(){\r\n if ( preg_match ( \" \\^[a-zA-Z0-9_]{3,16}$\\ \" , $_POST['name'] ) )\r\n {\r\n echo \"Le pseudo ou login est valide\";\r\n }\r\n }",
"function valida_email($correo) {\n if (preg_match_all(\"^[_.0-9a-z-]+@[0-9a-z._-]+.[a-z]{2,4}$\", $correo)) return true; else return false;\n }",
"function add_contact_validate($form) {\n // Make sure that there is at least a name with each contact.\n $form_errors = array();\n\n // We need to have a username.\n if (!$form['fields']['title']['value']) {\n $form_errors['title'] = 'The contact\\'s namer is required';\n }\n\n // If there are any errors we return must tell the user about them and return the form.\n if (!empty($form_errors)) {\n form_set_error($form, $form_errors);\n return false;\n }\n\n // If everyone is happy we can return true.\n return true;\n }",
"public static function newGroup()\n {\n if (!Input::exists('name')) {\n Check::addUserError('You must specify a name');\n return false;\n }\n if (!Check::dataTitle(Input::exists('name'))) {\n Check::addUserError('invalid group name');\n return false;\n }\n if (!Input::exists('pageLimit')) {\n Check::addUserError('You must specify a pageLimit');\n return false;\n }\n if (!Check::token()) {\n return false;\n }\n return true;\n }",
"function validate_add(&$d) {\n $valid = true;\n\n if (!$d[\"last_name\"]) {\n $d[\"error\"] .= \"'Last Name' is a required field.<br>\";\n $valid = false;\n }\n if (!$d[\"first_name\"]) {\n $d[\"error\"] .= \"'First Name' is a required field.<br>\";\n $valid = false;\n }\n if (!$d[\"username\"]) {\n $d[\"error\"] .= \"'Username' is a required field.<br>\";\n $valid = false;\n }\n if (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*$\", $d[\"username\"])) {\n $d[\"error\"] .= \"'Username' cannot contain spaces.<br>\";\n $valid = false;\n }\n\n if (!$d[\"password_1\"]) {\n $d[\"error\"] .= \"'Password' is a required field.<br>\";\n $valid = false;\n }\n if ($d[\"password_1\"] != $d[\"password_2\"]) {\n $d[\"error\"] .= \"The passwords entered do not match.<br>\";\n $valid = false;\n }\n// if (!$d[\"perms\"]) {\n// $d[\"error\"] .= \"You must assign the user to a group.<br>\";\n// $valid = false;\n// }\n if (!$d[\"user_email\"]) {\n $d[\"error\"] .= \"'Email' is a required field.<br>\";\n $valid = false;\n }\n elseif (!validate_email($d[\"user_email\"])) {\n $d[\"error\"] .= \"Please provide a valid email address.<br>\";\n $valid = false;\n }\n $db = new ps_DB;\n $q = \"SELECT * from auth_user_md5 where username='\" . $d[\"username\"] . \"'\";\n $db->query($q);\n if ($db->next_record()) {\n $d[\"error\"] .= \"The given username already exists. \";\n $d[\"error\"] .= \"Please try another username.<br>\";\n $valid = false;\n }\n return $valid;\n }",
"static function isValidName()\n {\n }",
"function checkFields(){\n\t\t\t\n\t\t\t$problem = 0;\n\t\t\n\t\t\t$this->var_array = array(\"From email\"=>$this->_from_email,\"From name\"=>$this->_from_name,\"Reply to email\"=>$this->_replyto_email,\"Reply to name\"=>$this->_replyto_name,\"Subject\"=>$this->_subject,\"Send to email\"=>$this->_send_to,\"Send to name\"=>$this->_send_to_name,\"Plain text version\"=>$this->_plain_text,\"HTML version\"=>$this->_html_body);\n\t\t\t\n\t\t\tforeach($this->var_array as $key=>$val):\n\t\t\t\t\n\t\t\t\tif(!isset($val)){\n\t\t\t\t\t$problem++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->send_errors[] = sprintf(gettext(\"%s not set! Given: %s\"),$key,$val);\n\t\t\t\t\n\t\t\tendforeach;\n\t\t\t\n\t\t\tif($problem>0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t\n\t\t}",
"function name_validation($text){\n $re = \"/^[A-Za-z\\s\\']+$/\";\n\n if (strlen($text)<1 || strlen($text)>120){\n echo \"\n <div class='regi_error'>\n Please enter a valid name\n </div>\n \";\n return false;\n }\n\n else if (preg_match($re, $text)==false){\n echo \"\n <div class='regi_error'>\n Please enter a valid name\n </div>\n \";\n return false;\n }\n else {\n return true;\n }\n}",
"function checkusername($name) {\n \t\tif (preg_match(\"/^[a-zA-z0-9-_.]{3;20}$/\", $name)) return true;\n\t}",
"function oa_core_add_member_form_validate($form, &$form_state) {\n $account = user_load_by_name($form_state['values']['name']);\n $space = $form['#space'];\n if (!$account || empty($account->uid)) {\n form_set_error('name', t('You have entered an invalid user name.'));\n }\n elseif (og_get_membership('node', $space->nid, 'user', $account->uid)) {\n form_set_error('name', t('User %name is already subscribed to @type.', array('@type' => drupal_strtolower(node_type_get_name($space->type)), '%name' => format_username($account))));\n }\n}",
"function checkPersonnel() {\n\t\t## get access to POST and requiredfields variables.\n\t\tglobal $requiredFields, $personnelInputFields, $errorField;\n\t\tglobal $_POST;\n\t\t## check if 'personnel' is set.\n\t\tif (isset($_POST['personnel'])) {\n\t\t\t## check the value of 'app_same', if the value is not 'yes'\n\t\t\t## add the remaining required fields.\n\t\t\tif ( preg_match(\"/^yes$/\",$_POST['personnel']) ) {\n\t\t\t\t## add other required fields since applicant is not a PI.\n\t\t\t\t$requiredFields = array_merge($requiredFields, $personnelInputFields);\n\t\t\t\tcheckTitle(\"personnel_title_name\",\"personnel_spec_title_name\");\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t## if radio button is not set flag error\n\t\t\t$tmpErrorField = array (\"personnel\" => \"personnel\");\n\t\t\t$errorField = array_merge ($errorField,$tmpErrorField);\n\t\t}\n\t}",
"function check_upload() {\n\t\t\t$is_echo_file = $this->get_entries( array( &$this, 'count_entries' ));\n\t\n\t\t\tif ( $is_echo_file ) {\n\t\t\t\t$this->options();\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo '<h2>'.__('Invalid file', 'echo-importer').'</h2>';\n\t\t\t\techo '<p>'.__('Please upload a valid Echo export file.', 'echo-importer').'</p>';\n\t\t\t}\n\t\t}",
"public function checkValidity()\n {\n \t\n \tif (trim($this->title . ' ') == '')\n {\n $this->lastErrorMsg = \"Infos Pratiques : le nom de la ville est obligatoire\";\n return false;\n }\n \telse if (trim($this->country . ' ') == '')\n {\n $this->lastErrorMsg = \"Infos Pratiques : le nom de du pays est obligatoire\";\n return false;\n }\n else\n \treturn true;\n }"
] | [
"0.5906073",
"0.5849044",
"0.5745649",
"0.5721308",
"0.565945",
"0.56528705",
"0.56319857",
"0.561223",
"0.5610798",
"0.5610781",
"0.5446649",
"0.54335815",
"0.54298",
"0.5404487",
"0.53903544",
"0.5274309",
"0.5264578",
"0.5252998",
"0.52350885",
"0.52166224",
"0.5201358",
"0.51939917",
"0.5173651",
"0.5166059",
"0.5132042",
"0.51312566",
"0.5129743",
"0.5120127",
"0.5119485",
"0.51163006"
] | 0.8159049 | 0 |
Validation routine for allow passive state. | function validate_ftp_allow_passive_state($state)
{
clearos_profile(__METHOD__, __LINE__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function passive()\n\t{\n\t\t// We can't create a passive data connection without a primary one first being there.\n\t\tif (!is_resource($this->connection))\n\t\t\treturn false;\n\n\t\t// Request a passive connection - this means, we'll talk to you, you don't talk to us.\n\t\t@fwrite($this->connection, 'PASV' . \"\\r\\n\");\n\t\t$time = time();\n\t\tdo\n\t\t\t$response = fgets($this->connection, 1024);\n\t\twhile (strpos($response, ' ', 3) !== 3 && time() - $time < 5);\n\n\t\t// If it's not 227, we weren't given an IP and port, which means it failed.\n\t\tif (strpos($response, '227 ') !== 0)\n\t\t{\n\t\t\t$this->error = 'bad_response';\n\t\t\treturn false;\n\t\t}\n\n\t\t// Snatch the IP and port information, or die horribly trying...\n\t\tif (preg_match('~\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*(\\d+))\\)~', $response, $match) == 0)\n\t\t{\n\t\t\t$this->error = 'bad_response';\n\t\t\treturn false;\n\t\t}\n\n\t\t// This is pretty simple - store it for later use ;).\n\t\t$this->pasv = array('ip' => $match[1] . '.' . $match[2] . '.' . $match[3] . '.' . $match[4], 'port' => $match[5] * 256 + $match[6]);\n\n\t\treturn true;\n\t}",
"public function valid () {}",
"function validate_ftp_protocol_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function isValidstate() {\n\t\treturn $this->validstate;\n\t}",
"public function valid() {}",
"public function valid() {}",
"public function testIsPassive()\n {\n $settingsDir = TEST_ROOT .'/settings/';\n include $settingsDir.'settings1.php';\n\n $settings = new OneLogin_Saml2_Settings($settingsInfo);\n $authnRequest = new OneLogin_Saml2_AuthnRequest($settings);\n $encodedRequest = $authnRequest->getRequest();\n $decoded = base64_decode($encodedRequest);\n $request = gzinflate($decoded);\n $this->assertNotContains('IsPassive=\"true\"', $request);\n\n $authnRequest2 = new OneLogin_Saml2_AuthnRequest($settings, false, false);\n $encodedRequest2 = $authnRequest2->getRequest();\n $decoded2 = base64_decode($encodedRequest2);\n $request2 = gzinflate($decoded2);\n $this->assertNotContains('IsPassive=\"true\"', $request2);\n\n $authnRequest3 = new OneLogin_Saml2_AuthnRequest($settings, false, true);\n $encodedRequest3 = $authnRequest3->getRequest();\n $decoded3 = base64_decode($encodedRequest3);\n $request3 = gzinflate($decoded3);\n $this->assertContains('IsPassive=\"true\"', $request3);\n }",
"function validate_web_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"abstract public function isValid();",
"private static function isNoPassiveForm($passive)\n\t{\n\t\t$exception = ['merupakan','memunculkan', 'mengenaskan'];\n\t\tif(in_array($passive, $exception)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function valid(){ }",
"public function valid()\n {\n $allowed_values = [\"PENDING\", \"OPEN\", \"COMPLETED\", \"CANCELED\", \"REFUNDED\", \"REJECTED\"];\n if (!in_array($this->container['state'], $allowed_values)) {\n return false;\n }\n return true;\n }",
"public function valid()\n\t{\n\t\treturn !$this->faking;\n\t}",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();",
"public function isValid();"
] | [
"0.6351522",
"0.6331979",
"0.6330834",
"0.62694573",
"0.62694573",
"0.62694573",
"0.62694573",
"0.62694573",
"0.62694573",
"0.62200797",
"0.62171876",
"0.62171876",
"0.6214266",
"0.61446625",
"0.61129165",
"0.6108799",
"0.6044484",
"0.6043337",
"0.6021542",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316",
"0.6010316"
] | 0.72013533 | 0 |
Validation routine for FTP override port. | function validate_ftp_override_port($port)
{
clearos_profile(__METHOD__, __LINE__);
if (! Network_Utils::is_valid_port($port))
return lang('flexshare_port_invalid');
if (($port == self::DEFAULT_PORT_FTP) || ($port == self::DEFAULT_PORT_FTPS))
return lang('flexshare_non_custom_port_warning');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_ftp_passive_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n }",
"function validate_web_override_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n\n if ($port == self::DEFAULT_PORT_WEB)\n return lang('flexshare_non_custom_port_warning');\n }",
"function validate_ftp_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"public function testIsValidPort(): void\n {\n $testCases = [\n 8000 => true,\n \"8080\" => true,\n \"1.1\" => false,\n \"abc\" => false,\n -999999 => false,\n +999999 => false\n ];\n\n foreach ($testCases as $port => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidPort($port), \"Failed for case '$port'.\");\n }\n }",
"function ftpValidate()\n\t{\n\t\tJClientHelper::setCredentialsFromRequest('ftp');\n\t}",
"function set_ftp_override_port($name, $override_port, $port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($override_port && ($port == self::DEFAULT_PORT_FTP || $port == self::DEFAULT_PORT_FTPS))\n throw new Engine_Exception(lang('flexshare_non_custom_port_warning'), CLEAROS_ERROR);\n\n if ($override_port && ($port == 21 || $port == 990))\n throw new Engine_Exception(lang('flexshare_ftp_cannot_use_default_ports'), CLEAROS_ERROR);\n\n // Find all ports and see if any conflicts with n-1\n if ($override_port) {\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n foreach ($shares as $share_name => $share) {\n if ($share_name != $name) {\n if ((int)$share[\"FtpPort\"] == ($port - 1)) {\n throw new Engine_Exception(lang('flexshare_ftp_port_conflict'), CLEAROS_ERROR);\n } else if (((int)$share[\"FtpPort\"] -1) == $port) {\n throw new Engine_Exception(lang('flexshare_ftp_port_conflict'), CLEAROS_ERROR);\n }\n }\n }\n }\n\n $this->_set_parameter($name, 'FtpOverridePort', $override_port);\n $this->_set_parameter($name, 'FtpPort', $port);\n }",
"function validate_proxy_port($proxy_port)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!is_numeric($proxy_port) || $proxy_port < -1 || $proxy_port > 65535)\n return lang('wpad_proxy_port_is_invalid');\n }",
"function validate_passive_port_range($port_min, $port_max)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port_range($port_min, $port_max))\n return lang('flexshare_port_range_invalid');\n\n if ($port_min < 1023 || $port_max < 1023)\n return lang('flexshare_passive_port_below_min');\n }",
"public static function validatePort($port)\n {\n if (!is_numeric($port) || $port < 0 || $port > 65535) {\n return false;\n }\n\n return !in_array($port, self::$unsafePorts);\n }",
"function ipAndPortValidator($serverIPAddress, $serverPort)\r\n{\r\n\t//So, now that we have the IP address and port from our source of choice, MAKE SURE to validate them before we go ANY further!\r\n\tif($serverPort != \"\") $serverPort = numericValidator($serverPort, 1, 65535, 29070);\r\n\tif($serverIPAddress != \"\") $serverIPAddress = ipAddressValidator($serverIPAddress);\r\n\r\n\t//Check for path exploits\r\n\tif(strpos($serverPort, \"..\") !== false || strpos($serverIPAddress, \"..\") !== false)\r\n\t{\r\n\t\tdisplayError(\"Server address exploit detected! This event has been logged.\", \"\", \"\");\r\n\t\treturn array(\"\", \"\");\r\n\t}\r\n\r\n\treturn array($serverIPAddress, $serverPort);\r\n}",
"protected function canTryAnotherPort()\n {\n return is_null($this->input->getOption('port')) &&\n ($this->input->getOption('tries') > $this->portOffset);\n }",
"function CheckPort( $sServer, $iPort, $iTimeout = 5 )\n {\n $bPass = false;\n if ( $sServer && $iPort && $iTimeout )\n {\n if ( @fsockopen(\"$sServer\", $iPort, $iErrno, $sErrstr, $iTimeout) )\n {\n $bPass = true;\n }\n }\n\n return $bPass;\n }",
"public static function isValidPort(int|string $port): bool\n {\n return (\n (is_int($port) || boolval(preg_match(\"/^[0-9]+$/\", $port))) &&\n intval($port) >= self::TCP_LOWER_PORT_RANGE &&\n intval($port) <= self::TCP_UPPER_PORT_RANGE\n );\n }",
"private function setPort($port)\n {\n $this->_port = $port;\n \n\treturn TRUE;\n }",
"public function guessPortAndTLS() {\n\t\tif(!$this->checkRequirements(array('ldapHost',\n\t\t\t\t\t\t\t\t\t\t ))) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->checkHost();\n\t\t$portSettings = $this->getPortSettingsToTry();\n\n\t\tif(!is_array($portSettings)) {\n\t\t\tthrow new \\Exception(print_r($portSettings, true));\n\t\t}\n\n\t\t//proceed from the best configuration and return on first success\n\t\tforeach($portSettings as $setting) {\n\t\t\t$p = $setting['port'];\n\t\t\t$t = $setting['tls'];\n\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: trying port '. $p . ', TLS '. $t, \\OCP\\Util::DEBUG);\n\t\t\t//connectAndBind may throw Exception, it needs to be catched by the\n\t\t\t//callee of this method\n\t\t\tif($this->connectAndBind($p, $t) === true) {\n\t\t\t\t$config = array('ldapPort' => $p,\n\t\t\t\t\t\t\t\t'ldapTLS' => intval($t)\n\t\t\t\t\t\t\t);\n\t\t\t\t$this->configuration->setConfiguration($config);\n\t\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: detected Port '. $p, \\OCP\\Util::DEBUG);\n\t\t\t\t$this->result->addChange('ldap_port', $p);\n\t\t\t\treturn $this->result;\n\t\t\t}\n\t\t}\n\n\t\t//custom port, undetected (we do not brute force)\n\t\treturn false;\n\t}",
"public function hasPort() {\n return $this->port != self::MISSING_PORT;\n }",
"public function matchPort(?int $port)\n {\n $this->port = $port;\n }",
"private static function isNonStandardPort(string $scheme, int $port): bool\n {\n return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme];\n }",
"function set_ftp_allow_passive($name, $allow_passive, $port_min = self::FTP_PASV_MIN, $port_max = self::FTP_PASV_MAX)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($allow_passive)\n Validation_Exception::is_valid($this->validate_passive_port_range($port_min, $port_max));\n\n $this->_set_parameter($name, 'FtpAllowPassive', $allow_passive);\n\n if ($allow_passive) {\n $this->_set_parameter($name, 'FtpPassivePortMin', $port_min);\n $this->_set_parameter($name, 'FtpPassivePortMax', $port_max);\n }\n }",
"protected function isNonStandardPort($scheme, $port): bool\n {\n return ! isset($this->allowedSchemes[$scheme]) || $this->allowedSchemes[$scheme] !== $port;\n }",
"protected function validatePort($port)\n {\n if (is_bool($port)) {\n throw new InvalidArgumentException('The submitted port is invalid');\n }\n\n if ($port === null || $port === '') {\n return null;\n }\n\n $res = filter_var($port, FILTER_VALIDATE_INT, ['options' => [\n 'min_range' => 1,\n 'max_range' => 65535,\n ]]);\n\n if (!$res) {\n throw new InvalidArgumentException(\n sprintf('Invalid port: %d. Must be between 1 and 65535', $port)\n );\n }\n\n return $res;\n }",
"function validate_ftp_protocol_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public static function tcpPort($port)\n {\n if (false === filter_var($port, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0, 'max_range' => 65535]])) {\n return false;\n }\n\n return true;\n }",
"function validate_ftp_allow_passive_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function validate_web_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function setPort($port)\n {\n // Check port\n if (!preg_match(\"#^[0-9]{1,5}$#\", $port)) return false;\n\n // Add port to the starting-URL\n $url_parts = PHPCrawlerUtils::splitURL($this->starting_url);\n $url_parts[\"port\"] = $port;\n $this->starting_url = PHPCrawlerUtils::buildURLFromParts($url_parts, true);\n \n return true;\n }",
"public function setPort($port)\n\t{\n\t\tif($this->connected)\n\t\t\tthrow new FTPException('Unable to set port: open connnection');\n \n\t\t$this->port = $port;\n\t}",
"public function check_server_port($host, $port)\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$_retVal=0;\n\t\t$timeout=5;\t// Timeout in seconds\n\n\t\tif (function_exists('fsockopen'))\n\t\t{\n\t\t\t$keyforsmtpserver='MAIN_MAIL_SMTP_SERVER';\n\t\t\t$keyforsmtpport ='MAIN_MAIL_SMTP_PORT';\n\t\t\t$keyforsmtpid ='MAIN_MAIL_SMTPS_ID';\n\t\t\t$keyforsmtppw ='MAIN_MAIL_SMTPS_PW';\n\t\t\t$keyfortls ='MAIN_MAIL_EMAIL_TLS';\n\t\t\t$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS';\n\t\t\tif ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default')\n\t\t\t{\n\t\t\t\t$keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING';\n\t\t\t\t$keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING';\n\t\t\t\t$keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING';\n\t\t\t\t$keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING';\n\t\t\t\t$keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING';\n\t\t\t\t$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING';\n\t\t\t}\n\n\t\t\t// If we use SSL/TLS\n\t\t\tif (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $host='ssl://'.$host;\n\t\t\t// tls smtp start with no encryption\n\t\t\t//if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host;\n\n\t\t\tdol_syslog(\"Try socket connection to host=\".$host.\" port=\".$port);\n\t\t\t//See if we can connect to the SMTP server\n if ($socket = @fsockopen(\n\t\t\t\t\t$host, // Host to test, IP or domain. Add ssl:// for SSL/TLS.\n\t\t\t\t\t$port, // which Port number to use\n\t\t\t\t\t$errno, // actual system level error\n\t\t\t\t\t$errstr, // and any text that goes with the error\n\t\t\t\t\t$timeout // timeout for reading/writing data over the socket\n\t\t\t)) {\n\t\t\t\t// Windows still does not have support for this timeout function\n\t\t\t\tif (function_exists('stream_set_timeout')) stream_set_timeout($socket, $timeout, 0);\n\n\t\t\t\tdol_syslog(\"Now we wait for answer 220\");\n\n\t\t\t\t// Check response from Server\n\t\t\t\tif ($_retVal = $this->server_parse($socket, \"220\")) $_retVal = $socket;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error = utf8_check('Error '.$errno.' - '.$errstr)?'Error '.$errno.' - '.$errstr:utf8_encode('Error '.$errno.' - '.$errstr);\n\t\t\t}\n\t\t}\n\t\treturn $_retVal;\n\t}",
"function checkConnection($ip, $port){\n\t\t\t$fp = @fsockopen($ip, $port, $err1, $err2, 4);\n\t\t\t\n\t\t\tif (!$fp){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"function set_web_override_port($name, $override_port, $port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($override_port && ($port == 80 || $port == 443))\n throw new Engine_Exception(lang('flexshare_non_custom_port_warning'), CLEAROS_ERROR);\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n $ssl = isset($shares[$name]['WebReqSsl']) ? $shares[$name]['WebReqSsl'] : FALSE;\n\n $inuse_ports = array();\n\n foreach ($shares as $share_name => $share) {\n $ssl_for_share = isset($share['WebReqSsl']) ? $share['WebReqSsl'] : FALSE;\n if (($name != $share_name) && ($ssl != $ssl_for_share))\n $inuse_ports[] = $share['WebPort'];\n }\n\n if ($override_port && (in_array($port, $this->bad_ports) || in_array($port, $inuse_ports)))\n throw new Validation_Exception(lang('flexshare_port_already_in_use'));\n\n $this->_set_parameter($name, 'WebOverridePort', $override_port);\n $this->_set_parameter($name, 'WebPort', $port);\n }"
] | [
"0.76920605",
"0.6832862",
"0.67608845",
"0.6730024",
"0.6421314",
"0.64097995",
"0.63807714",
"0.6212837",
"0.6139762",
"0.61358273",
"0.6075166",
"0.59127647",
"0.5844877",
"0.58072424",
"0.5767981",
"0.57475656",
"0.5702",
"0.5669537",
"0.5655897",
"0.5647494",
"0.5589354",
"0.5573987",
"0.55190533",
"0.550175",
"0.546124",
"0.5460233",
"0.5436887",
"0.54058903",
"0.5325751",
"0.530586"
] | 0.84552497 | 0 |
Validation routine for FTP override port state. | function validate_ftp_override_port_state($state)
{
clearos_profile(__METHOD__, __LINE__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_ftp_override_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n if (($port == self::DEFAULT_PORT_FTP) || ($port == self::DEFAULT_PORT_FTPS))\n return lang('flexshare_non_custom_port_warning');\n }",
"function validate_ftp_passive_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n }",
"public function testIsValidPort(): void\n {\n $testCases = [\n 8000 => true,\n \"8080\" => true,\n \"1.1\" => false,\n \"abc\" => false,\n -999999 => false,\n +999999 => false\n ];\n\n foreach ($testCases as $port => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidPort($port), \"Failed for case '$port'.\");\n }\n }",
"function validate_web_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"function validate_web_override_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n\n if ($port == self::DEFAULT_PORT_WEB)\n return lang('flexshare_non_custom_port_warning');\n }",
"function validate_ftp_protocol_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"function validate_ftp_allow_passive_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function validate_passive_port_range($port_min, $port_max)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port_range($port_min, $port_max))\n return lang('flexshare_port_range_invalid');\n\n if ($port_min < 1023 || $port_max < 1023)\n return lang('flexshare_passive_port_below_min');\n }",
"function set_ftp_override_port($name, $override_port, $port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($override_port && ($port == self::DEFAULT_PORT_FTP || $port == self::DEFAULT_PORT_FTPS))\n throw new Engine_Exception(lang('flexshare_non_custom_port_warning'), CLEAROS_ERROR);\n\n if ($override_port && ($port == 21 || $port == 990))\n throw new Engine_Exception(lang('flexshare_ftp_cannot_use_default_ports'), CLEAROS_ERROR);\n\n // Find all ports and see if any conflicts with n-1\n if ($override_port) {\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n foreach ($shares as $share_name => $share) {\n if ($share_name != $name) {\n if ((int)$share[\"FtpPort\"] == ($port - 1)) {\n throw new Engine_Exception(lang('flexshare_ftp_port_conflict'), CLEAROS_ERROR);\n } else if (((int)$share[\"FtpPort\"] -1) == $port) {\n throw new Engine_Exception(lang('flexshare_ftp_port_conflict'), CLEAROS_ERROR);\n }\n }\n }\n }\n\n $this->_set_parameter($name, 'FtpOverridePort', $override_port);\n $this->_set_parameter($name, 'FtpPort', $port);\n }",
"function validate_proxy_port($proxy_port)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!is_numeric($proxy_port) || $proxy_port < -1 || $proxy_port > 65535)\n return lang('wpad_proxy_port_is_invalid');\n }",
"function ftpValidate()\n\t{\n\t\tJClientHelper::setCredentialsFromRequest('ftp');\n\t}",
"public static function validatePort($port)\n {\n if (!is_numeric($port) || $port < 0 || $port > 65535) {\n return false;\n }\n\n return !in_array($port, self::$unsafePorts);\n }",
"protected function canTryAnotherPort()\n {\n return is_null($this->input->getOption('port')) &&\n ($this->input->getOption('tries') > $this->portOffset);\n }",
"public function hasPort() {\n return $this->port != self::MISSING_PORT;\n }",
"public function guessPortAndTLS() {\n\t\tif(!$this->checkRequirements(array('ldapHost',\n\t\t\t\t\t\t\t\t\t\t ))) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->checkHost();\n\t\t$portSettings = $this->getPortSettingsToTry();\n\n\t\tif(!is_array($portSettings)) {\n\t\t\tthrow new \\Exception(print_r($portSettings, true));\n\t\t}\n\n\t\t//proceed from the best configuration and return on first success\n\t\tforeach($portSettings as $setting) {\n\t\t\t$p = $setting['port'];\n\t\t\t$t = $setting['tls'];\n\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: trying port '. $p . ', TLS '. $t, \\OCP\\Util::DEBUG);\n\t\t\t//connectAndBind may throw Exception, it needs to be catched by the\n\t\t\t//callee of this method\n\t\t\tif($this->connectAndBind($p, $t) === true) {\n\t\t\t\t$config = array('ldapPort' => $p,\n\t\t\t\t\t\t\t\t'ldapTLS' => intval($t)\n\t\t\t\t\t\t\t);\n\t\t\t\t$this->configuration->setConfiguration($config);\n\t\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: detected Port '. $p, \\OCP\\Util::DEBUG);\n\t\t\t\t$this->result->addChange('ldap_port', $p);\n\t\t\t\treturn $this->result;\n\t\t\t}\n\t\t}\n\n\t\t//custom port, undetected (we do not brute force)\n\t\treturn false;\n\t}",
"function CheckPort( $sServer, $iPort, $iTimeout = 5 )\n {\n $bPass = false;\n if ( $sServer && $iPort && $iTimeout )\n {\n if ( @fsockopen(\"$sServer\", $iPort, $iErrno, $sErrstr, $iTimeout) )\n {\n $bPass = true;\n }\n }\n\n return $bPass;\n }",
"function ipAndPortValidator($serverIPAddress, $serverPort)\r\n{\r\n\t//So, now that we have the IP address and port from our source of choice, MAKE SURE to validate them before we go ANY further!\r\n\tif($serverPort != \"\") $serverPort = numericValidator($serverPort, 1, 65535, 29070);\r\n\tif($serverIPAddress != \"\") $serverIPAddress = ipAddressValidator($serverIPAddress);\r\n\r\n\t//Check for path exploits\r\n\tif(strpos($serverPort, \"..\") !== false || strpos($serverIPAddress, \"..\") !== false)\r\n\t{\r\n\t\tdisplayError(\"Server address exploit detected! This event has been logged.\", \"\", \"\");\r\n\t\treturn array(\"\", \"\");\r\n\t}\r\n\r\n\treturn array($serverIPAddress, $serverPort);\r\n}",
"public static function isValidPort(int|string $port): bool\n {\n return (\n (is_int($port) || boolval(preg_match(\"/^[0-9]+$/\", $port))) &&\n intval($port) >= self::TCP_LOWER_PORT_RANGE &&\n intval($port) <= self::TCP_UPPER_PORT_RANGE\n );\n }",
"private function setPort($port)\n {\n $this->_port = $port;\n \n\treturn TRUE;\n }",
"private static function isNonStandardPort(string $scheme, int $port): bool\n {\n return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme];\n }",
"protected function isNonStandardPort($scheme, $port): bool\n {\n return ! isset($this->allowedSchemes[$scheme]) || $this->allowedSchemes[$scheme] !== $port;\n }",
"function set_ftp_allow_passive($name, $allow_passive, $port_min = self::FTP_PASV_MIN, $port_max = self::FTP_PASV_MAX)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($allow_passive)\n Validation_Exception::is_valid($this->validate_passive_port_range($port_min, $port_max));\n\n $this->_set_parameter($name, 'FtpAllowPassive', $allow_passive);\n\n if ($allow_passive) {\n $this->_set_parameter($name, 'FtpPassivePortMin', $port_min);\n $this->_set_parameter($name, 'FtpPassivePortMax', $port_max);\n }\n }",
"public function matchPort(?int $port)\n {\n $this->port = $port;\n }",
"protected function validatePort($port)\n {\n if (is_bool($port)) {\n throw new InvalidArgumentException('The submitted port is invalid');\n }\n\n if ($port === null || $port === '') {\n return null;\n }\n\n $res = filter_var($port, FILTER_VALIDATE_INT, ['options' => [\n 'min_range' => 1,\n 'max_range' => 65535,\n ]]);\n\n if (!$res) {\n throw new InvalidArgumentException(\n sprintf('Invalid port: %d. Must be between 1 and 65535', $port)\n );\n }\n\n return $res;\n }",
"private function _valid_funnel()\n\t{\n\t\t// create post array to determine valid funnel\n\t\t$valid\t\t= array(\n\t\t\t'funnel_id'\t\t=> $this->_funnel_id,\n\t\t\t'partner_id'\t=> $this->_partner_id,\n\t\t\t'affiliate_id'\t=> $this->_affiliate_id\n\t\t);\n\t\t\n\t\t// gets the default version for this partner/affiliate\n\t\t$default\t= $this->platform->post('sales_funnel/version/valid_funnel',$valid);\n\n\t\t// if not valid, return false\n\t\tif ( ! $default['success'] OR ! $default['data']) return FALSE;\n\t\t\n\t\t// if we made it here, then we have a valid funnel\n\t\treturn TRUE;\n\t}",
"public static function tcpPort($port)\n {\n if (false === filter_var($port, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0, 'max_range' => 65535]])) {\n return false;\n }\n\n return true;\n }",
"public function hasPort(): bool\n {\n return !empty($this->port);\n }",
"public function hasPort()\n {\n return isset($this->port);\n }",
"public function setPort($port)\n\t{\n\t\tif($this->connected)\n\t\t\tthrow new FTPException('Unable to set port: open connnection');\n \n\t\t$this->port = $port;\n\t}",
"public function setPort($port)\n {\n // Check port\n if (!preg_match(\"#^[0-9]{1,5}$#\", $port)) return false;\n\n // Add port to the starting-URL\n $url_parts = PHPCrawlerUtils::splitURL($this->starting_url);\n $url_parts[\"port\"] = $port;\n $this->starting_url = PHPCrawlerUtils::buildURLFromParts($url_parts, true);\n \n return true;\n }"
] | [
"0.8111966",
"0.7469244",
"0.6645683",
"0.6563338",
"0.647246",
"0.6430504",
"0.63401395",
"0.61287904",
"0.60953605",
"0.60784954",
"0.60392004",
"0.60197276",
"0.5997858",
"0.5804556",
"0.57728505",
"0.5745045",
"0.5736289",
"0.5717504",
"0.57016855",
"0.56013",
"0.5516525",
"0.549725",
"0.5473322",
"0.5467287",
"0.53409046",
"0.5324791",
"0.53181326",
"0.5285666",
"0.51990736",
"0.5198339"
] | 0.7644789 | 1 |
Validation routine for FTP passive port. | function validate_ftp_passive_port($port)
{
clearos_profile(__METHOD__, __LINE__);
if (! Network_Utils::is_valid_port($port))
return lang('flexshare_port_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_ftp_override_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n if (($port == self::DEFAULT_PORT_FTP) || ($port == self::DEFAULT_PORT_FTPS))\n return lang('flexshare_non_custom_port_warning');\n }",
"function validate_ftp_allow_passive_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function set_ftp_allow_passive($name, $allow_passive, $port_min = self::FTP_PASV_MIN, $port_max = self::FTP_PASV_MAX)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($allow_passive)\n Validation_Exception::is_valid($this->validate_passive_port_range($port_min, $port_max));\n\n $this->_set_parameter($name, 'FtpAllowPassive', $allow_passive);\n\n if ($allow_passive) {\n $this->_set_parameter($name, 'FtpPassivePortMin', $port_min);\n $this->_set_parameter($name, 'FtpPassivePortMax', $port_max);\n }\n }",
"public function passive()\n\t{\n\t\t// We can't create a passive data connection without a primary one first being there.\n\t\tif (!is_resource($this->connection))\n\t\t\treturn false;\n\n\t\t// Request a passive connection - this means, we'll talk to you, you don't talk to us.\n\t\t@fwrite($this->connection, 'PASV' . \"\\r\\n\");\n\t\t$time = time();\n\t\tdo\n\t\t\t$response = fgets($this->connection, 1024);\n\t\twhile (strpos($response, ' ', 3) !== 3 && time() - $time < 5);\n\n\t\t// If it's not 227, we weren't given an IP and port, which means it failed.\n\t\tif (strpos($response, '227 ') !== 0)\n\t\t{\n\t\t\t$this->error = 'bad_response';\n\t\t\treturn false;\n\t\t}\n\n\t\t// Snatch the IP and port information, or die horribly trying...\n\t\tif (preg_match('~\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*(\\d+))\\)~', $response, $match) == 0)\n\t\t{\n\t\t\t$this->error = 'bad_response';\n\t\t\treturn false;\n\t\t}\n\n\t\t// This is pretty simple - store it for later use ;).\n\t\t$this->pasv = array('ip' => $match[1] . '.' . $match[2] . '.' . $match[3] . '.' . $match[4], 'port' => $match[5] * 256 + $match[6]);\n\n\t\treturn true;\n\t}",
"function validate_passive_port_range($port_min, $port_max)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port_range($port_min, $port_max))\n return lang('flexshare_port_range_invalid');\n\n if ($port_min < 1023 || $port_max < 1023)\n return lang('flexshare_passive_port_below_min');\n }",
"public function testIsValidPort(): void\n {\n $testCases = [\n 8000 => true,\n \"8080\" => true,\n \"1.1\" => false,\n \"abc\" => false,\n -999999 => false,\n +999999 => false\n ];\n\n foreach ($testCases as $port => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidPort($port), \"Failed for case '$port'.\");\n }\n }",
"function ftpValidate()\n\t{\n\t\tJClientHelper::setCredentialsFromRequest('ftp');\n\t}",
"public function setPassive($passive)\n\t{\n\t\tif(!$this->connected)\n\t\t\tthrow new FTPException('Could not change passive mode: not connected to remote FTP server');\n \n\t\tif($this->passive != $passive)\n\t\t{\n\t\t\tif(!ftp_pasv($this->resource, $passive))\n\t\t\t\t\tthrow new FTPException('Could not change passive mode: unknown error');\n\t\t\t$this->passive = $passive;\n\t\t}\n\t}",
"function CheckPort( $sServer, $iPort, $iTimeout = 5 )\n {\n $bPass = false;\n if ( $sServer && $iPort && $iTimeout )\n {\n if ( @fsockopen(\"$sServer\", $iPort, $iErrno, $sErrstr, $iTimeout) )\n {\n $bPass = true;\n }\n }\n\n return $bPass;\n }",
"public function isPassive()\n {\n return $this->passive;\n }",
"function validate_ftp_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"protected function Passive($pasv=false) {\r\n\t\tif (!function_exists('ftp_pasv')){\r\n\t\t\t$this->SendMSG(\"Fatal error: Call to undefined function ftp_pasv\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$ret = ftp_pasv($this->_conn_id, $pasv);\r\n\t\t$this->SendMSG(\"Passive mode \".($pasv?\"on\":\"off\"));\r\n\t\treturn $ret;\r\n\t}",
"function validate_ftp_protocol_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function isPassive()\n {\n return $this->getTypeObject()->isPassive();\n }",
"public static function validatePort($port)\n {\n if (!is_numeric($port) || $port < 0 || $port > 65535) {\n return false;\n }\n\n return !in_array($port, self::$unsafePorts);\n }",
"function validate_proxy_port($proxy_port)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!is_numeric($proxy_port) || $proxy_port < -1 || $proxy_port > 65535)\n return lang('wpad_proxy_port_is_invalid');\n }",
"protected function canTryAnotherPort()\n {\n return is_null($this->input->getOption('port')) &&\n ($this->input->getOption('tries') > $this->portOffset);\n }",
"public function pasv($pasv) {\n\t\t$this->connectIfNeeded();\n\t\t$this->param = $pasv;\n\n\t\tif (!ftp_pasv($this->handle, $pasv === true)) {\n\t\t\tthrow new GFtpException(\n\t\t\t\t\tYii::t('gftp', 'Could not {set} passive mode on server \"{host}\": {message}',\n\t\t\t\t\t\t\tarray('{host}' => $this->host, '{set}' => $pasv ? \"set\" : \"unset\")\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"public function testIsPassive()\n {\n $settingsDir = TEST_ROOT .'/settings/';\n include $settingsDir.'settings1.php';\n\n $settings = new OneLogin_Saml2_Settings($settingsInfo);\n $authnRequest = new OneLogin_Saml2_AuthnRequest($settings);\n $encodedRequest = $authnRequest->getRequest();\n $decoded = base64_decode($encodedRequest);\n $request = gzinflate($decoded);\n $this->assertNotContains('IsPassive=\"true\"', $request);\n\n $authnRequest2 = new OneLogin_Saml2_AuthnRequest($settings, false, false);\n $encodedRequest2 = $authnRequest2->getRequest();\n $decoded2 = base64_decode($encodedRequest2);\n $request2 = gzinflate($decoded2);\n $this->assertNotContains('IsPassive=\"true\"', $request2);\n\n $authnRequest3 = new OneLogin_Saml2_AuthnRequest($settings, false, true);\n $encodedRequest3 = $authnRequest3->getRequest();\n $decoded3 = base64_decode($encodedRequest3);\n $request3 = gzinflate($decoded3);\n $this->assertContains('IsPassive=\"true\"', $request3);\n }",
"public function guessPortAndTLS() {\n\t\tif(!$this->checkRequirements(array('ldapHost',\n\t\t\t\t\t\t\t\t\t\t ))) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->checkHost();\n\t\t$portSettings = $this->getPortSettingsToTry();\n\n\t\tif(!is_array($portSettings)) {\n\t\t\tthrow new \\Exception(print_r($portSettings, true));\n\t\t}\n\n\t\t//proceed from the best configuration and return on first success\n\t\tforeach($portSettings as $setting) {\n\t\t\t$p = $setting['port'];\n\t\t\t$t = $setting['tls'];\n\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: trying port '. $p . ', TLS '. $t, \\OCP\\Util::DEBUG);\n\t\t\t//connectAndBind may throw Exception, it needs to be catched by the\n\t\t\t//callee of this method\n\t\t\tif($this->connectAndBind($p, $t) === true) {\n\t\t\t\t$config = array('ldapPort' => $p,\n\t\t\t\t\t\t\t\t'ldapTLS' => intval($t)\n\t\t\t\t\t\t\t);\n\t\t\t\t$this->configuration->setConfiguration($config);\n\t\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: detected Port '. $p, \\OCP\\Util::DEBUG);\n\t\t\t\t$this->result->addChange('ldap_port', $p);\n\t\t\t\treturn $this->result;\n\t\t\t}\n\t\t}\n\n\t\t//custom port, undetected (we do not brute force)\n\t\treturn false;\n\t}",
"public function hasPort() {\n return $this->port != self::MISSING_PORT;\n }",
"public static function isValidPort(int|string $port): bool\n {\n return (\n (is_int($port) || boolval(preg_match(\"/^[0-9]+$/\", $port))) &&\n intval($port) >= self::TCP_LOWER_PORT_RANGE &&\n intval($port) <= self::TCP_UPPER_PORT_RANGE\n );\n }",
"function validate_ftp_enabled($status)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"public function getPassive()\n\t{\n\t\treturn $this->passive;\n\t}",
"public function setPassive($passive, $test = false)\n {\n if (false === $test) {\n @ftp_pasv($this->_getFtp(), (bool) $passive);\n }\n return $this;\n }",
"private static function isNoPassiveForm($passive)\n\t{\n\t\t$exception = ['merupakan','memunculkan', 'mengenaskan'];\n\t\tif(in_array($passive, $exception)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static function tcpPort($port)\n {\n if (false === filter_var($port, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0, 'max_range' => 65535]])) {\n return false;\n }\n\n return true;\n }",
"function realm_status($host, $port)\r\n {\r\n error_reporting(0);\r\n $etat = fsockopen($host,$port,$errno,$errstr,3);\r\n \r\n if(!$etat)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }",
"function checkConnection($ip, $port){\n\t\t\t$fp = @fsockopen($ip, $port, $err1, $err2, 4);\n\t\t\t\n\t\t\tif (!$fp){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"public function check_server_port($host, $port)\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$_retVal=0;\n\t\t$timeout=5;\t// Timeout in seconds\n\n\t\tif (function_exists('fsockopen'))\n\t\t{\n\t\t\t$keyforsmtpserver='MAIN_MAIL_SMTP_SERVER';\n\t\t\t$keyforsmtpport ='MAIN_MAIL_SMTP_PORT';\n\t\t\t$keyforsmtpid ='MAIN_MAIL_SMTPS_ID';\n\t\t\t$keyforsmtppw ='MAIN_MAIL_SMTPS_PW';\n\t\t\t$keyfortls ='MAIN_MAIL_EMAIL_TLS';\n\t\t\t$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS';\n\t\t\tif ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default')\n\t\t\t{\n\t\t\t\t$keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING';\n\t\t\t\t$keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING';\n\t\t\t\t$keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING';\n\t\t\t\t$keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING';\n\t\t\t\t$keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING';\n\t\t\t\t$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING';\n\t\t\t}\n\n\t\t\t// If we use SSL/TLS\n\t\t\tif (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $host='ssl://'.$host;\n\t\t\t// tls smtp start with no encryption\n\t\t\t//if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host;\n\n\t\t\tdol_syslog(\"Try socket connection to host=\".$host.\" port=\".$port);\n\t\t\t//See if we can connect to the SMTP server\n if ($socket = @fsockopen(\n\t\t\t\t\t$host, // Host to test, IP or domain. Add ssl:// for SSL/TLS.\n\t\t\t\t\t$port, // which Port number to use\n\t\t\t\t\t$errno, // actual system level error\n\t\t\t\t\t$errstr, // and any text that goes with the error\n\t\t\t\t\t$timeout // timeout for reading/writing data over the socket\n\t\t\t)) {\n\t\t\t\t// Windows still does not have support for this timeout function\n\t\t\t\tif (function_exists('stream_set_timeout')) stream_set_timeout($socket, $timeout, 0);\n\n\t\t\t\tdol_syslog(\"Now we wait for answer 220\");\n\n\t\t\t\t// Check response from Server\n\t\t\t\tif ($_retVal = $this->server_parse($socket, \"220\")) $_retVal = $socket;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error = utf8_check('Error '.$errno.' - '.$errstr)?'Error '.$errno.' - '.$errstr:utf8_encode('Error '.$errno.' - '.$errstr);\n\t\t\t}\n\t\t}\n\t\treturn $_retVal;\n\t}"
] | [
"0.73252165",
"0.6845491",
"0.67635673",
"0.6730564",
"0.6713364",
"0.659191",
"0.6393251",
"0.63719565",
"0.62820977",
"0.62619156",
"0.6216944",
"0.61487645",
"0.61413294",
"0.6056366",
"0.6037659",
"0.58931154",
"0.5884348",
"0.58717394",
"0.5834597",
"0.58209413",
"0.57806903",
"0.5725786",
"0.5635899",
"0.5580277",
"0.5559585",
"0.55246127",
"0.55226165",
"0.5476351",
"0.5445954",
"0.5435699"
] | 0.84664726 | 0 |
Validation routine for FTP protocol state. | function validate_ftp_protocol_state($state)
{
clearos_profile(__METHOD__, __LINE__);
if (! clearos_is_valid_boolean($state))
return lang('base_state_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_ftp_allow_passive_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function ftpValidate()\n\t{\n\t\tJClientHelper::setCredentialsFromRequest('ftp');\n\t}",
"function validate_ftp_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function validate_ftp_enabled($status)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function validate_ftp_passive_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n }",
"function validate_ftp_override_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n if (($port == self::DEFAULT_PORT_FTP) || ($port == self::DEFAULT_PORT_FTPS))\n return lang('flexshare_non_custom_port_warning');\n }",
"function validate_web_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"function set_ftp_protocol_ftpes($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FtpEnableFtpes', $state);\n }",
"function set_ftp_protocol_ftp($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FtpEnableFtp', $state);\n }",
"public function testIsValidPort(): void\n {\n $testCases = [\n 8000 => true,\n \"8080\" => true,\n \"1.1\" => false,\n \"abc\" => false,\n -999999 => false,\n +999999 => false\n ];\n\n foreach ($testCases as $port => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidPort($port), \"Failed for case '$port'.\");\n }\n }",
"private static function _valid()\n {\n return self::_send() == 'valid';\n }",
"function set_ftp_protocol_ftps($name, $state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'FtpEnableFtps', $state);\n }",
"public function isValidstate() {\n\t\treturn $this->validstate;\n\t}",
"public function valid () {}",
"function validate_web_php($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function isValid() {\n $pollStatus = $this->extractData('open');\n // Check if there is a status\n if($pollStatus === null) {\n return false;\n }\n\n return true;\n }",
"public function valid() {}",
"public function valid() {}",
"private function validateLoginStatus()\n\t{\n\n\t}",
"private function _valid_funnel()\n\t{\n\t\t// create post array to determine valid funnel\n\t\t$valid\t\t= array(\n\t\t\t'funnel_id'\t\t=> $this->_funnel_id,\n\t\t\t'partner_id'\t=> $this->_partner_id,\n\t\t\t'affiliate_id'\t=> $this->_affiliate_id\n\t\t);\n\t\t\n\t\t// gets the default version for this partner/affiliate\n\t\t$default\t= $this->platform->post('sales_funnel/version/valid_funnel',$valid);\n\n\t\t// if not valid, return false\n\t\tif ( ! $default['success'] OR ! $default['data']) return FALSE;\n\t\t\n\t\t// if we made it here, then we have a valid funnel\n\t\treturn TRUE;\n\t}",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"function validate_web_follow_symlinks($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function validate() {\n\n if (! is_int($this->configValues['ttl'])) {\n throw new Neoform\\Config\\Exception('\\'ttl\\' must be an integer');\n }\n\n if (empty($this->configValues['path'])) {\n throw new Neoform\\Config\\Exception('\\'path\\' must be set');\n }\n\n if (! is_bool($this->configValues['secure'])) {\n throw new Neoform\\Config\\Exception('\\'secure\\' must be a bool');\n }\n\n if (! is_bool($this->configValues['httponly'])) {\n throw new Neoform\\Config\\Exception('\\'httponly\\' must be a bool');\n }\n }",
"function validate_web_require_ssl($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function validate() {\r\n if ($this->pass!=$this->conf) {\r\n $this->setError('Passwords do not match');\r\n }\r\n if (!preg_match('/^[a-zA-Z0-9_]+$/',$this->pass )) {\r\n $this->setError('Password contains invalid characters');\r\n }\r\n if (strlen($this->pass) < 6 ) {\r\n $this->setError('Password is too short');\r\n }\r\n if (strlen($this->pass) > 20 ) {\r\n $this->setError('Password is too long');\r\n }\r\n }"
] | [
"0.70067465",
"0.69434774",
"0.6822855",
"0.64343256",
"0.61874956",
"0.58461547",
"0.5726687",
"0.5702564",
"0.568185",
"0.5521357",
"0.54754895",
"0.5448565",
"0.54194343",
"0.5409465",
"0.53493434",
"0.5302919",
"0.5302746",
"0.5302746",
"0.52978677",
"0.5284927",
"0.5264852",
"0.5264852",
"0.5264852",
"0.5264852",
"0.5264852",
"0.5264852",
"0.5264356",
"0.5261827",
"0.5254169",
"0.52421665"
] | 0.81918377 | 0 |
Validation routine for flexshare web access on Web. | function validate_web_access($accessibility)
{
clearos_profile(__METHOD__, __LINE__);
$options = $this->get_web_access_options();
if (!array_key_exists($accessibility, $options))
return lang('flexshare_accessibility_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validate()\n {\n $url = self::getHostUrl($this->url);\n $site_url = self::getHostUrl();\n if ($site_url === null) {\n $site_url = self::getHostUrl(site_url('url'));\n }\n if ($url === $site_url || !$url) {\n return false;\n }\n return true;\n }",
"private function __validateApiAccess() {\n if ($this->type == 'api') {\n if (!empty($this->request->params['code'])) {\n //for direct access to the urls\n return true;\n }\n if (!$this->__isValidAccessKey()) {\n// $error = array('response_code' => 1101, 'api_call_time' => date('Y-m-d H:i:s'), 'error' => array($this->apiErrors));\n $error = array('response_code' => 1101, 'error' => array($this->apiErrors));\n echo json_encode($error);\n exit();\n }\n if (!$this->__isValidUserKey()) {\n $error = array('response_code' => 1101, 'error' => array($this->apiErrors));\n echo json_encode($error);\n exit();\n }\n return true;\n }\n }",
"public function validate_account_url() {\n\t\t\n\t\t/* Execute request. */\n\t\t$response = wp_remote_request( 'https://' . $this->subdomain . '.campfirenow.com/?' . time() );\n\t\t\n\t\tif ( $response['response']['code'] !== 200 ) {\n\t\t\tthrow new Exception( 'Account URL is invalid.' );\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"function validate_web_realm($realm)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_\\/\\' ]+)$/\", $realm))\n return lang('flexshare_web_realm_invalid');\n }",
"protected function validate_access()\n {\n return true;\n }",
"public function validateUrl($url);",
"private function checkForbidden(){\n\n }",
"public function checkHost() {\n\t\tif (!$this->host) {\n\t\t\tthrow new URLException(120);\n\t\t}\n\t\t$regexp = '/^\\d{2,3}(\\.\\d{1,3}){3}$/';\n\t\tif (!checkdnsrr($this->host, 'A') && !preg_match($regexp, $this->host)) {\n\t\t\tthrow new URLException(120);\n\t\t}\n\t}",
"public function isValid(): bool\n {\n // these schemes are allowed\n $allowedSchemes = $this->getAllowedSchemes();\n\n // get the field value\n $url = $this->field->getValue();\n\n // not required and empty? Then its valid\n if ($this->isNotRequiredAndEmpty($url)) {\n return true;\n }\n\n if ($this->getMaxLength() && strlen($url) > $this->getMaxLength()) {\n // Over maximum length.\n return false;\n }\n\n // do simple validation\n if (!filter_var($url, FILTER_VALIDATE_URL)) {\n return false;\n }\n\n $hostname = (string)parse_url($url, PHP_URL_HOST);\n\n // check if we have a tld\n if (!$this->isSkipTldCheck() && !preg_match('#\\.[a-z]{2,}$#', $hostname)) {\n return false;\n }\n\n // further validation is required.\n if (in_array(parse_url($url, PHP_URL_SCHEME), $allowedSchemes)) {\n return true;\n }\n\n return false;\n }",
"function validate_web_server_name($server_name)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('web_server/Httpd'))\n return;\n\n if (empty($server_name))\n return;\n\n $httpd = new Httpd();\n\n return $httpd->validate_server_name($server_name);\n }",
"public static function handle_validate_request() {\n\t\tcheck_admin_referer( self::NONCE_ACTION );\n\t\tif ( ! AMP_Validation_Manager::has_cap() ) {\n\t\t\twp_die( esc_html__( 'You do not have permissions to validate an AMP URL. Did you get logged out?', 'amp' ) );\n\t\t}\n\n\t\t$post = null;\n\t\t$url = null;\n\t\t$args = [];\n\n\t\ttry {\n\t\t\tif ( isset( $_GET['post'] ) ) {\n\t\t\t\t$post = (int) $_GET['post'];\n\t\t\t\tif ( $post <= 0 ) {\n\t\t\t\t\tthrow new Exception( 'unknown_post' );\n\t\t\t\t}\n\t\t\t\t$post = get_post( $post );\n\t\t\t\tif ( ! $post || self::POST_TYPE_SLUG !== $post->post_type ) {\n\t\t\t\t\tthrow new Exception( 'invalid_post' );\n\t\t\t\t}\n\t\t\t\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\t\t\tthrow new Exception( 'unauthorized' );\n\t\t\t\t}\n\t\t\t\t$url = self::get_url_from_post( $post );\n\t\t\t} elseif ( isset( $_GET['url'] ) ) {\n\t\t\t\t$url = wp_validate_redirect( esc_url_raw( wp_unslash( $_GET['url'] ) ), null );\n\t\t\t\tif ( ! $url ) {\n\t\t\t\t\tthrow new Exception( 'illegal_url' );\n\t\t\t\t}\n\t\t\t\t// Don't let non-admins create new amp_validated_url posts.\n\t\t\t\tif ( ! AMP_Validation_Manager::has_cap() ) {\n\t\t\t\t\tthrow new Exception( 'unauthorized' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $url ) {\n\t\t\t\tthrow new Exception( 'missing_url' );\n\t\t\t}\n\n\t\t\t$validity = AMP_Validation_Manager::validate_url_and_store( $url );\n\t\t\tif ( is_wp_error( $validity ) ) {\n\t\t\t\tthrow new Exception( AMP_Validation_Manager::get_validate_url_error_message( $validity->get_error_code(), $validity->get_error_message() ) );\n\t\t\t}\n\n\t\t\t$errors = wp_list_pluck( $validity['results'], 'error' );\n\t\t\t$redirect = get_edit_post_link( $validity['post_id'], 'raw' );\n\n\t\t\t$error_count = count(\n\t\t\t\tarray_filter(\n\t\t\t\t\t$errors,\n\t\t\t\t\tstatic function ( $error ) {\n\t\t\t\t\t\treturn ! AMP_Validation_Error_Taxonomy::is_validation_error_sanitized( $error );\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$args[ self::URLS_TESTED ] = '1';\n\t\t\t$args[ self::REMAINING_ERRORS ] = $error_count;\n\t\t} catch ( Exception $e ) {\n\t\t\t$args['amp_validate_error'] = AMP_Validation_Manager::serialize_validation_error_messages(\n\t\t\t\t[ $e->getMessage() ]\n\t\t\t);\n\t\t\t$args[ self::URLS_TESTED ] = '0';\n\n\t\t\tif ( $post && self::POST_TYPE_SLUG === $post->post_type ) {\n\t\t\t\t$redirect = get_edit_post_link( $post->ID, 'raw' );\n\t\t\t} else {\n\t\t\t\t$redirect = admin_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t[ 'post_type' => self::POST_TYPE_SLUG ],\n\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\twp_safe_redirect( add_query_arg( rawurlencode_deep( $args ), $redirect ) );\n\t\texit();\n\t}",
"static function checkValidReferer() {\n global $CFG_GLPI;\n\n $isvalidReferer = true;\n\n if (!isset($_SERVER['HTTP_REFERER'])) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"No HTTP_REFERER found in request. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n } else if (!is_array($url = parse_url($_SERVER['HTTP_REFERER']))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"Error when parsing HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!isset($url['host'])\n || (($url['host'] != $_SERVER['SERVER_NAME'])\n && (!isset($_SERVER['HTTP_X_FORWARDED_SERVER'])\n || ($url['host'] != $_SERVER['HTTP_X_FORWARDED_SERVER'])))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"None or Invalid host in HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!isset($url['path'])\n || (!empty($CFG_GLPI['root_doc'])\n && (strpos($url['path'], $CFG_GLPI['root_doc']) !== 0))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"None or Invalid path in HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!$isvalidReferer && $_SESSION['glpi_use_mode'] != Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"The action you have requested is not allowed. Reload previous page before doing action again.\"),\n true);\n }\n }",
"function validateUrl($url){\r\n\t\t\t$ch = curl_init($url);\r\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, true); \r\n\t\t\tcurl_setopt($ch, CURLOPT_NOBODY, true); \r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); \r\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT,10);\r\n\t\t\t$output = curl_exec($ch);\r\n\t\t\t$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n\t\t\tcurl_close($ch);\r\n\r\n\t\t\tif($httpcode == \"200\"){\r\n\t\t\t\treturn true;\r\n\t\t\t \r\n\t\t\t}else{\r\n\t\t\t return false;\r\n\t\t\t}\r\n\r\n\t\t}",
"public function validateLogin() {\nglobal $_LW;\nif ($response=$this->getResponse('/grouptypes')) {\n\tif (!empty($response['results'])) {\n\t\treturn true;\n\t};\n};\nreturn false;\n}",
"function checkUrl($ss__url='')\n\t\t{\n\t\t\t//if(eregi(\"^http://[a-z0-9]{1}[-_./~a-z0-9]{1,}[a-z0-9?&=:]{0,}$\",$ss__url))\n\t\t\tif(preg_match(\"/^(http|https|ftp):\\/\\/([a-z0-9]([a-z0-9_-]*[a-z0-9])?\\.)+[a-z]{2,6}\\/?([a-z0-9\\?\\._-~&#=+%]*)?/\", $ss__url))\n\t\t\treturn false;\n\t\t\treturn true;\t\t\n\t\t}",
"private function validate_website($url)\n\t{\n\t\tif ($url == '')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ((strpos($url, 'http')) === false)\n\t\t{\n\t\t\t$url = 'http://' . $url;\n\t\t}\n\t\t\n\t\t$header = @get_headers($url);\n\t\t\n\t\tif (is_array($header))\n\t\t{\n\t\t\tif($header[0] == 'HTTP/1.1 404 Not Found') \n\t\t\t{\n\t\t\t\treturn $url . ' is not a valid website';\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn $url . ' is not a valid website';\n\t}",
"public function ValidateUrl($_url){\n\t\t\t$validator = new Validator();\n\t\t\tif ($validator->validUrl($_url) == true){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$errorMessage = new ErrorMessage(ErrorStrings::InvalidDishUrl);\n\t\t\t\treturn $errorMessage;\n\t\t\t}\n\t\t}",
"function url_check($url) { \n $hdrs = @get_headers($url); \n return is_array($hdrs) ? preg_match('/^HTTP\\\\/\\\\d+\\\\.\\\\d+\\\\s+2\\\\d\\\\d\\\\s+.*$/',$hdrs[0]) : false; \n }",
"function ol_check_url() {\r\n $feedsmart_settings = $this->get_options();\r\n switch (basename($_SERVER['PHP_SELF'])) {\r\n case 'wp-rss.php':\r\n case 'wp-rss2.php':\r\n case 'wp-atom.php':\r\n case 'wp-rdf.php':\r\n if (trim($feedsmart_settings['feedsmart_url']) != '') {\r\n if (function_exists('status_header')) status_header( 302 );\r\n header(\"Location:\" . trim($feedsmart_settings['feedsmart_url']));\r\n header(\"HTTP/1.1 302 Temporary Redirect\");\r\n exit();\r\n }\r\n break;\r\n case 'wp-commentsrss2.php':\r\n if (trim($feedsmart_settings['feedsmart_comments_url']) != '') {\r\n if (function_exists('status_header')) status_header( 302 );\r\n header(\"Location:\" . trim($feedsmart_settings['feedsmart_comments_url']));\r\n header(\"HTTP/1.1 302 Temporary Redirect\");\r\n exit();\r\n }\r\n break;\r\n }\r\n }",
"public function checkUrl() {\r\n\r\n\t\t// Get the user's current URL\r\n\t\t$pageURL = (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\" ? \"https://\" : \"http://\") . $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\r\n\r\n\t\t// Parse the URL, and reform it with the query string omitted\r\n\t\t$parsedURL = parse_url($pageURL);\r\n\r\n if ( $parsedURL['path'] == '/' ) $parsedURL['path'] = str_replace(APP_ROOT, '', $this->filename);\r\n\r\n\t\t$constructedURL = $parsedURL['scheme'] . '://' . $parsedURL['host'] . $parsedURL['path'];\r\n\r\n\t\t// Compare the user's current URL with the proper constructed URL and see if they match\r\n return (isset($this->url, $this->requestPath) && $this->url === $constructedURL);\r\n\t}",
"function scheck($full,$port=80){\n // default to standard HTTP port\n $this->port = isset($port) ? $port : 80 ;\n\n if(ereg(\"http://\",$full)){\n $this->convert_fqdn($full); \n\t\t// make http connection to server \n $this->open($this->domain,$this->port);\n\t if($this->skip==0){// $this->skip only occurs in HTTP response codes of 301 or 302\n\t\t $this->get($this->doc,\"check\");\n }\n\n\t }else{ \n\t $this->bugout(\"IMPROPER DATA: expects a FQDN like 'http://host/document'\");\n }\n }",
"function validUrl($text){\n \n\t\t$regex = \"((https?|ftp)\\:\\/\\/)?\"; // SCHEME \n\t\t$regex .= \"([a-z0-9+!*(),;?&=\\$_.-]+(\\:[a-z0-9+!*(),;?&=\\$_.-]+)?@)?\"; // User and Pass \n\t\t$regex .= \"([a-z0-9-.]*)\\.([a-z]{2,3})\"; // Host or IP \n\t\t$regex .= \"(\\:[0-9]{2,5})?\"; // Port \n\t\t$regex .= \"(\\/([a-z0-9+\\$_-]\\.?)+)*\\/?\"; // Path \n\t\t$regex .= \"(\\?[a-z+&\\$_.-][a-z0-9;:@&%=+\\/\\$_.-]*)?\"; // GET Query \n\t\t$regex .= \"(#[a-z_.-][a-z0-9+\\$_.-]*)?\"; // Anchor\n\t\t\n\t\tif(preg_match(\"/^$regex$/\", $text, $matches)){ \n\t\t\t\t\n\t\t\t\treturn $matches;\t\n }else{\n\t return false;\n }\n \n }",
"function validateUrl($str3)\r\n{\r\nif (!preg_match('#^http\\\\:\\\\/\\\\/[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)?[a-z]+#i', $str3)) \r\n{\r\n\treturn false;\r\n}\r\nelse\r\n{\r\n\r\n\t$fp = @fopen($str3,\"r\"); \r\n if ($fp) { \r\n fclose($fp); \r\n return true; \r\n } else { \r\n return false; \r\n } \r\n}\r\n}",
"public function validateSite()\n {\n $validationStatus = (\n is_dir($this->siteDir)\n && file_exists($this->siteDir.'/index.html')\n && filesize($this->siteDir.'/index.html') > 0\n && is_dir($this->siteDir.'/espanol')\n && file_exists($this->siteDir.'/espanol/index.html')\n && filesize($this->siteDir.'/espanol/index.html') > 0\n );\n \n if ( empty($validationStatus) ){\n $this->log(\"Validate Site: Empty Site \\n\");\n }\n else $this->log(\"Validate Site: Valid\\n\");\n\n return $validationStatus;\n \n /*\n if ( empty($this->pagesByUrl) )\n {\n $this->log(\"Validate Site: no site found to validate\\n\");\n return null;\n }\n $requiredPages = 0;\n $renderedPages = 0;\n /// shouldn't be duplicating the logic here, it's too easy to break\n foreach ( $this->pagesByUrl as $url=>&$page )\n {\n /// only validate pages that should be generated\n if ( array_key_exists('generate_page',$page) && $page['generate_page']!='yes' )\n {\n continue;\n }\n $requiredPages++;\n $pageDir = rtrim( $this->siteDir.'/'.trim($url,'/'), '/' );\n $pageFile = $pageDir.'/index.html';\n\n if ( $this->validatePage($pageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$url} : {$page['uuid']}\\n\");\n }\n\n /// some special pages generate further sub-pages\n if ( $page['pageType'] == 'AZPage' )\n {\n /// add for-use-by \n foreach ( $this->siteIndexAZ as $letter => $list )\n {\n $requiredPages++;\n $subUrl = $url.'/'.strtolower($letter);\n $subPageDir = rtrim( $pageDir.'/'.trim(strtolower($letter),'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n\n if ( isset($page['az_index_data_source']) \n && $page['az_index_data_source'] == 'directory-records-federal' )\n {\n foreach ( $page['for_use_by'] as $fub )\n {\n if ( !array_key_exists($fub,$this->directoryRecordGroups) ) { continue; }\n foreach ( $this->directoryRecordGroups[$fub]['all']['Federal Agencies']['all'] as $agencyInfo )\n {\n $requiredPages++;\n $agency = $this->source->entities[$agencyInfo['uuid']];\n\n $urlSafeTitle = $this->sanitizeForUrl($agency['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n //$this->log(\"**Valid: {$subUrl} // {$agency['title']}\\n\");\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl} // {$agency['title']} // {$agency['uuid']}\\n\");\n } \n }\n }\n }\n } else if ( $page['pageType'] == '50StatePage' ) {\n if ( !empty($page['usa_gov_50_state_category']) \n && preg_match('/^autogenerate\\-(.*)/',$page['usa_gov_50_state_category']) )\n {\n foreach ( $this->stateAcronyms as $stateAcronym=>$stateName ) \n {\n $requiredPages++;\n $subUrl = $url.'/'.$this->sanitizeForUrl($stateName);\n if ( !empty($page['usa_gov_50_state_prefix']) )\n {\n $subUrl = $page['usa_gov_50_state_prefix']\n .'/'.$this->sanitizeForUrl($stateName);\n }\n $subPageDir = rtrim( $this->siteDir.'/'.trim($subUrl,'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n } else if ( $page['pageType'] == 'Features' ) {\n \n foreach ( $page['for_use_by'] as $fub )\n {\n foreach ( $this->features[$fub] as $feature ) \n {\n $requiredPages++;\n $urlSafeTitle = $this->sanitizeForUrl($feature['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n }\n }\n $this->log(\"Site Validation: $renderedPages of $requiredPages pages rendered to /sites/{$this->config['siteName']} \\n\");\n return ($requiredPages <= $renderedPages);\n */\n }",
"function validate_script_url( $url ) {\n\t\t// If url is empty, there's nothing to validate\n\t\t// Fixes issue with DFP JS\n\t\tif ( empty( $url ) )\n\t\t\treturn true;\n\n\t\t$domain = parse_url( $url, PHP_URL_HOST );\n\n\t\t// Check if we match the domain exactly\n\t\tif ( in_array( $domain, $this->current_provider->whitelisted_script_urls ) )\n\t\t\treturn true;\n\n\t\t$valid = false;\n\n\t\tforeach ( $this->current_provider->whitelisted_script_urls as $whitelisted_domain ) {\n\t\t\t$whitelisted_domain = '.' . $whitelisted_domain; // Prevent things like 'evilsitetime.com'\n\t\t\tif ( strpos( $domain, $whitelisted_domain ) === ( strlen( $domain ) - strlen( $whitelisted_domain ) ) ) {\n\t\t\t\t$valid = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}",
"public static function validateSiteUrl()\n\t{\n\t\treturn [\n\t\t\tnew LengthValidator(null, 2000),\n\t\t];\n\t}",
"public function validateSetup() {\n if (empty($this->method)) $this->errors[] = \"Please set a valid method in the configuration page\";\n if ($this->method == 'web-service-url' && empty($this->getSystemSetting('web-service-url'))) $this->errors[] = \"Please set a valid web-service-url that when called will return the required user details\";\n\n return empty($this->errors);\n }",
"public function validateEndpoint ()\n {\n switch ($this->object)\n {\n case 'proposal-votes':\n if ($this->ID === null)\n return true;\n else\n return false;\n break;\n case 'sabats':\n if ($this->ID === null || $this->subject === 'proposals' || $this->subject === 'candidates')\n return true;\n else\n return false;\n break;\n case 'sabat-results':\n if ($this->ID !== null && ($this->subject === 'proposals' || $this->subject === 'candidates'))\n return true;\n else\n return false;\n break;\n case 'login':\n if ($this->ID === null)\n {\n include_once './resources/auth.php';\n return true;\n }\n else\n return false;\n break;\n default:\n return false;\n }\n }",
"function validate($rule,$value) \r\n\t{\r\n\t\tglobal $web_path;\r\n\t\t\r\n\t\t$valid = TRUE;\r\n\t\t$invalid = FALSE;\r\n\t\t\r\n\t\tswitch($rule) {\r\n\t\t\tcase \"required\": \r\n\t\t\t\t$output = (strlen($value) > 0) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"username\":\r\n\t\t\t\t$pattern = '/^[a-z\\d_]{5,20}$/i';\r\n\t\t\t\t$output = (preg_match($pattern, $value)) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"url\":\r\n\t\t\t\t$output=(filter_var($value, FILTER_VALIDATE_URL)) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"email\":\r\n\t\t\t\t$pattern = '/^([a-z0-9])(([-a-z0-9._\\+])*([a-z0-9]))*\\@([a-z0-9])' . '(([a-z0-9-])*([a-z0-9]))+' . '(\\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i';\r\n\t\t\t\t$output = (preg_match($pattern, $value)) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ssn\":\r\n\t\t\t\t$pattern = '/^[\\d]{3}-[\\d]{2}-[\\d]{4}$/';\r\n\t\t\t\t$output = (preg_match($pattern, $value)) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"phone\":\r\n\t\t\t\t$pattern = '/[\\(?\\d{3}\\)?]?\t[-\\s.]?\\d{3}[-\\s.]\\d{4}/x';\r\n\t\t\t\t$output = (preg_match($pattern, $value)) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"date\":\r\n\t\t\t\t$pattern = \"^((18|19|20)\\d\\d)-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])$\";\r\n\t\t\t\t$output = (preg_match($pattern, $value)) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"zipcode\":\r\n\t\t\t\t$pattern = \"/^([0-9]{5})(-[0-9]{4})?$/i\";\r\n\t\t\t\t$output = (preg_match($pattern, $value)) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"password\":\r\n\t\t\t\t$output = (strlen($value) >= 5) ? $valid : $invalid;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn $output;\r\n\t}",
"public function validate()\n {\n preg_match(\"/^(?:http(?:s)?:\\/\\/)?(?:www\\.)?(?:m\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:(?:watch)?\\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\\/))([^\\?&\\\"'>]+)/\",\n $this->url, $matches);\n\n if (isset($matches[1])) {\n return $matches[1];\n }\n\n return false;\n }"
] | [
"0.6373057",
"0.6158602",
"0.6145397",
"0.60655725",
"0.5978592",
"0.59698635",
"0.5888409",
"0.5846606",
"0.5816316",
"0.58121943",
"0.57707477",
"0.57324564",
"0.57295847",
"0.572312",
"0.57063407",
"0.57053757",
"0.5694306",
"0.5687839",
"0.56769484",
"0.5647209",
"0.5645958",
"0.56436545",
"0.5636559",
"0.5618799",
"0.56128436",
"0.55686104",
"0.5557614",
"0.55544084",
"0.55368036",
"0.5536305"
] | 0.6596549 | 0 |
Validation routine for web allow SSI. | function validate_web_allow_ssi($state)
{
clearos_profile(__METHOD__, __LINE__);
if (! clearos_is_valid_boolean($state))
return lang('base_state_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function XSSProtection()\n{\n if (strstr($_GET['page'], '../') !== false) {\n throw new \\Exception(\"Directory traversal attempt!\");\n }\n\n // Checking remote file inclusions\n if (strstr($_GET['page'], 'file://') !== false) {\n throw new \\Exception(\"Remote file inclusion attempt!\");\n }\n}",
"function set_web_allow_ssi($name, $ssi)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'WebAllowSSI', $ssi);\n }",
"function checkSpoof() {\n\tif (!eregi(\"http://\",$_GET['r']) && !eregi(\"ftp://\",$_GET['r']) && !eregi(\"https://\",$_GET['r'])) {\n\t\thttpredir($_GET['r']);\n\t} else {\n\t\thttpredir(\"index.php\");\n\t}\n}",
"function checkUrl($ss__url='')\n\t\t{\n\t\t\t//if(eregi(\"^http://[a-z0-9]{1}[-_./~a-z0-9]{1,}[a-z0-9?&=:]{0,}$\",$ss__url))\n\t\t\tif(preg_match(\"/^(http|https|ftp):\\/\\/([a-z0-9]([a-z0-9_-]*[a-z0-9])?\\.)+[a-z]{2,6}\\/?([a-z0-9\\?\\._-~&#=+%]*)?/\", $ss__url))\n\t\t\treturn false;\n\t\t\treturn true;\t\t\n\t\t}",
"function pnSecureInput()\n{\n // Cross-Site Scripting attack defense - Sent by larsneo\n // some syntax checking against injected javascript\n // extended by Neo\n\n if (count($_GET) > 0) {\n // Lets now sanitize the GET vars\n foreach ($_GET as $secvalue) {\n if (!is_array($secvalue)) {\n if ((preg_match(\"/<[^>]*script.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/.*[[:space:]](or|and)[[:space:]].*(=|like).*/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*object.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*iframe.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*applet.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*meta.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*style.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*form.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*window.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*alert.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*img.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*document.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*cookie.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/\\\"\", $secvalue))) {\n pnMailHackAttempt('pnAntiCracker',__LINE__,'pnSecurity Alert','GET Intrusion detection.');\n Header(\"Location: index.php\");\n }\n }\n }\n }\n\n // Lets now sanitize the POST vars\n if ( count($_POST) > 0) {\n foreach ($_POST as $secvalue) {\n if (!is_array($secvalue)) {\n if ((preg_match(\"/<[^>]*script.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*object.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*iframe.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*applet.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*window.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*alert.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*document.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*cookie.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*meta.*\\\"?[^>]*>/i\", $secvalue))\n ) {\n\n pnMailHackAttempt('pnAntiCracker',__LINE__,'pnSecurity Alert','POST Intrusion detection.');\n Header(\"Location: index.php\");\n }\n }\n }\n }\n\n // Lets now sanitize the COOKIE vars\n if ( count($_COOKIE) > 0) {\n foreach ($_COOKIE as $secvalue) {\n if (!is_array($secvalue)) {\n if ((preg_match(\"/<[^>]*script.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/.*[[:space:]](or|and)[[:space:]].*(=|like).*/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*object.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*iframe.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*applet.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*meta.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*style.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*form.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*window.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*alert.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*document.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*cookie.*\\\"?[^>]*>/i\", $secvalue)) ||\n (preg_match(\"/<[^>]*img.*\\\"?[^>]*>/i\", $secvalue))\n ) {\n\n pnMailHackAttempt('pnAntiCracker',__LINE__,'pnSecurity Alert','COOKIE Intrusion detection.');\n Header(\"Location: index.php\");\n }\n }\n }\n }\n}",
"private function inDeptValidation() {\n $content = file_get_contents($this->tmp_name);\n $screenedContent = file_get_contents($this->tmp_name);\n\n // Scan for Html and script tags\n $screenedContent = str_replace(\"script\",\"\",\"$screenedContent\");\n $screenedContent = str_replace(\"<?php\",\"\",\"$screenedContent\");\n\n // if there are no php or script tags found return true\n if ($screenedContent === $content) {\n $return = 1;\n } else {\n $return = 0;\n }\n\n unset($content);\n unset($screenedContent);\n return $return;\n }",
"function addressbook_userapi_SecurityCheck($value) \n{\n //SecurityCheck\n $value = preg_replace(\"'<img(.*)src=(.*)(;|\\()(.*?)>'i\",\"*******\",$value);\n $value = preg_replace(\"#(<[a-zA-Z])(.*)(;|\\()(.*?)(/[a-zA-Z])(.*?)>#si\",\"*******\",$value);\n $value = eregi_replace(\"javascript:\",\"*******\",$value);\n\n return $value;\n}",
"function validate_content(DocumentInfo $doc) {\n // need not be checked by load_content.\n return true;\n }",
"public function isValidReferer(){\nglobal $util; \n $valid_referer = strpos(\"\".$_SERVER['HTTP_REFERER'].\"\",SERVER_URL);\n if ($valid_referer === false) {\n $util->js_redirect(SERVER_URL);\n die();\t\n }\n}",
"function is_bad_request()\n{\n\n // Ensure the request method is either PUT or GET\n if($GLOBALS['RM_REQ']['METHOD'] != \"GET\" && $GLOBALS['RM_REQ']['METHOD'] != \"PUT\")\n return 1;\n\n // Ensure the page requested is in the site map\n $found = false;\n \n switch($GLOBALS['RM_REQ']['URI'][1])\n {\n case \"index.html\":\n case \"index.php\":\n case \"robots.txt\":\n case \"about\":\n case \"faq\":\n case \"\":\n if($GLOBALS['RM_REQ']['URI'][2] == \"\")\n $found = true;\n else\n $found = false;\n break;\n case \"movies\":\n $found = true;\n break;\n case \"critics\":\n $found = true;\n break;\n case \"common\":\n if($GLOBALS['RM_REQ']['URI'][2] == \"img\" &&\n $GLOBALS['RM_REQ']['URI'][3] != \"\")\n {\n $found = true;\n }\n else if($GLOBALS['RM_REQ']['URI'][2] == \"css\" &&\n $GLOBALS['RM_REQ']['URI'][3] != \"\")\n {\n $found = true;\n }\n else\n {\n $found = false;\n }\n break;\n case \"users\":\n $found = true;\n break;\n case \"form\":\n if($GLOBALS['RM_REQ']['URI'][3] == \"\")\n $found = true;\n else\n $found = false;\n break;\n case \"search\":\n if(sizeof($GLOBALS['RM_REQ']['URI']) > 3)\n $found = false;\n else\n $found = true;\n default:\n $found = false;\n break;\n }\n\n if($found == false)\n return 2;\n\n return false;\n \n}",
"private function checkForbidden(){\n\n }",
"private function checkURL() {\n\t\t$url = $_SERVER['PHP_SELF'];\n\t\t$url .= !empty($_SERVER['QUERY_STRING'])? \"?{$_SERVER['QUERY_STRING']}\" : '';\n\t\t$from = $_SERVER['REMOTE_ADDR'];\n\t\tif (preg_match('/^\\/(index\\.php)(\\?.*)?$/', $url) === 0) {\n\t\t\tlog_entry(\"REQUEST FILTERED: $url from $from\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tlog_entry(\"REQUEST: $url from $from\");\n\t\t\treturn true;\n\t\t}\n\t}",
"public function valid()\n {\n\t\tif($_GET[\"echostr\"])\n\t\t{\n\t\t\t$echoStr = $_GET[\"echostr\"];\n\t\t\tif($this->checkSignature())\n\t\t\t{\n\t\t\t\techo $echoStr;\n\t\t\t\texit;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->responseMsg();\t\n\t\t}\n }",
"public function allowed();",
"function validate_web_cgi($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function passesCSRFCheck();",
"function url_script_validar($mensaje) { //UTILIZADA PARA EVITAR EL Cross Site Scripting in URL\n $lleva = 0;\n $salir = false;\n\n\n for ($x = 0; $x <= count($mensaje) - 1; $x++) {\n if (is_array($mensaje[$x])) {\n foreach ($mensaje[$x] as $part_mensaje) {\n $valor = url_script($part_mensaje, $arg);\n if ($valor == 1) {\n $salir = true;\n break;\n }\n }\n } else {\n $valor = url_script($mensaje[$x], $arg);\n }\n if ($valor == 1) {\n break;\n $salir = true;\n }\n }\n\n if ($salir) {\n $marca = 1;\n } else {\n $marca = 0;\n }\n\n return $marca;\n\n}",
"function validate_script_url( $url ) {\n\t\t// If url is empty, there's nothing to validate\n\t\t// Fixes issue with DFP JS\n\t\tif ( empty( $url ) )\n\t\t\treturn true;\n\n\t\t$domain = parse_url( $url, PHP_URL_HOST );\n\n\t\t// Check if we match the domain exactly\n\t\tif ( in_array( $domain, $this->current_provider->whitelisted_script_urls ) )\n\t\t\treturn true;\n\n\t\t$valid = false;\n\n\t\tforeach ( $this->current_provider->whitelisted_script_urls as $whitelisted_domain ) {\n\t\t\t$whitelisted_domain = '.' . $whitelisted_domain; // Prevent things like 'evilsitetime.com'\n\t\t\tif ( strpos( $domain, $whitelisted_domain ) === ( strlen( $domain ) - strlen( $whitelisted_domain ) ) ) {\n\t\t\t\t$valid = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}",
"public function validateUrl($url);",
"public function VERIFYURL($url)\r\n {\r\n \r\n $oldurl=$url;\r\n\r\n $url=str_replace(\"\\\\\",\"\",$url);\r\n\r\n $url=str_replace('\"',\"\",$url);\r\n \r\n \r\n\t\t if($this->START($url,\"//\")==1)\r\n\t\t {\r\n\t\t $url=$this->urltype.$url;\r\n\t\t //echo \"</br>//------>\".$url.\"</br>\";\r\n\t\t }\r\n\r\n\t\t else if($this->START($url,\"/\")==1)\r\n\t\t {\r\n\t\t \r\n\t\t $url=$this->urltype.\"//\".$this->domain.$url;\r\n\t\t //echo \"</br>/------>\".$url.\"</br>\";\r\n\t\t }\r\n\r\n\r\n\t\t else if($this->START($url,\"./\")==1)\r\n\t\t {\r\n\t\t \t\r\n\t\t $url=str_replace(\"./\",\"\",$url);\r\n\t\t $url=$this->urltype.\"//\".$this->domain.\"/\".$url;\r\n\t\t //echo \"</br>./------>\".$url.\"</br>\";\r\n\t\t }\r\n\r\n\r\n\t\t else if($this->START($url,\".\")==1)\r\n\t\t {\r\n\t\t $url=$this->url;\r\n\t\t //echo \"</br>...------>\".$url.\"</br>\";\r\n\t\t }\r\n\r\n\t\t else if($this->START($url,\"www\")==1)\r\n\t\t {\r\n\t\t \r\n\t\t $url=$this->urltype.\"://\".$url;\r\n\t\t //echo \"</br>www------>\".$url.\"</br>\";\r\n\r\n\t\t }\r\n\t\t else if($this->START($url,\"#\")==1)\r\n\t\t {\r\n\t\t $url=$this->url;\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t\t else\r\n\t\t {\r\n\t\t \t\r\n\t\t \r\n\t\t //$url=$this->url.$url;\r\n\t\t }\r\n\r\n \r\n\r\n\t\t \r\n\r\n\t if($this->END($url, '.jpg') ==1||$this->END($url, '.png') ==1||$this->END($url, '.js') ==1||$this->END($url, '.css') ==1||$this->END($url, 'javascript:void') ==1||$this->END($url, '.gif') ==1||$this->END($url, '.ico') ==1)\r\n\t {\r\n\t $this->xa[$oldurl]=\"\"; \r\n\t }\r\n\t else\r\n\t {\r\n\t \tif($this->CHECKNULL($url)==1&&$this->START($url,\"http\")==1)\r\n\t \t{\r\n\t \t\t$this->a[$url]=\"\";\t\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t$url=trim($url);\r\n\t \t\tif($url!=\"\")\r\n\t \t\t{\r\n\t \t\t\t/*echo \"::\".$url.\"::</br>\";*/\r\n\t\t \t\t$url=$url=$this->url.\"/\".$url;\r\n\t\t \t\t$this->a[$url]=\"\";\r\n\t\t \t\t\r\n\t\t \t\t/*echo \"[\".$url.\"]</br>\";\t*/\r\n\t \t\t}\r\n\t \t\t\r\n\t \t}\r\n\t \t\r\n\r\n\t }\r\n\t \r\n\r\n\r\n }",
"public function validateSite()\n {\n $validationStatus = (\n is_dir($this->siteDir)\n && file_exists($this->siteDir.'/index.html')\n && filesize($this->siteDir.'/index.html') > 0\n && is_dir($this->siteDir.'/espanol')\n && file_exists($this->siteDir.'/espanol/index.html')\n && filesize($this->siteDir.'/espanol/index.html') > 0\n );\n \n if ( empty($validationStatus) ){\n $this->log(\"Validate Site: Empty Site \\n\");\n }\n else $this->log(\"Validate Site: Valid\\n\");\n\n return $validationStatus;\n \n /*\n if ( empty($this->pagesByUrl) )\n {\n $this->log(\"Validate Site: no site found to validate\\n\");\n return null;\n }\n $requiredPages = 0;\n $renderedPages = 0;\n /// shouldn't be duplicating the logic here, it's too easy to break\n foreach ( $this->pagesByUrl as $url=>&$page )\n {\n /// only validate pages that should be generated\n if ( array_key_exists('generate_page',$page) && $page['generate_page']!='yes' )\n {\n continue;\n }\n $requiredPages++;\n $pageDir = rtrim( $this->siteDir.'/'.trim($url,'/'), '/' );\n $pageFile = $pageDir.'/index.html';\n\n if ( $this->validatePage($pageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$url} : {$page['uuid']}\\n\");\n }\n\n /// some special pages generate further sub-pages\n if ( $page['pageType'] == 'AZPage' )\n {\n /// add for-use-by \n foreach ( $this->siteIndexAZ as $letter => $list )\n {\n $requiredPages++;\n $subUrl = $url.'/'.strtolower($letter);\n $subPageDir = rtrim( $pageDir.'/'.trim(strtolower($letter),'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n\n if ( isset($page['az_index_data_source']) \n && $page['az_index_data_source'] == 'directory-records-federal' )\n {\n foreach ( $page['for_use_by'] as $fub )\n {\n if ( !array_key_exists($fub,$this->directoryRecordGroups) ) { continue; }\n foreach ( $this->directoryRecordGroups[$fub]['all']['Federal Agencies']['all'] as $agencyInfo )\n {\n $requiredPages++;\n $agency = $this->source->entities[$agencyInfo['uuid']];\n\n $urlSafeTitle = $this->sanitizeForUrl($agency['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n //$this->log(\"**Valid: {$subUrl} // {$agency['title']}\\n\");\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl} // {$agency['title']} // {$agency['uuid']}\\n\");\n } \n }\n }\n }\n } else if ( $page['pageType'] == '50StatePage' ) {\n if ( !empty($page['usa_gov_50_state_category']) \n && preg_match('/^autogenerate\\-(.*)/',$page['usa_gov_50_state_category']) )\n {\n foreach ( $this->stateAcronyms as $stateAcronym=>$stateName ) \n {\n $requiredPages++;\n $subUrl = $url.'/'.$this->sanitizeForUrl($stateName);\n if ( !empty($page['usa_gov_50_state_prefix']) )\n {\n $subUrl = $page['usa_gov_50_state_prefix']\n .'/'.$this->sanitizeForUrl($stateName);\n }\n $subPageDir = rtrim( $this->siteDir.'/'.trim($subUrl,'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n } else if ( $page['pageType'] == 'Features' ) {\n \n foreach ( $page['for_use_by'] as $fub )\n {\n foreach ( $this->features[$fub] as $feature ) \n {\n $requiredPages++;\n $urlSafeTitle = $this->sanitizeForUrl($feature['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n }\n }\n $this->log(\"Site Validation: $renderedPages of $requiredPages pages rendered to /sites/{$this->config['siteName']} \\n\");\n return ($requiredPages <= $renderedPages);\n */\n }",
"public static function should_validate_response() {\n\t\treturn self::has_cap() && isset( $_GET[ self::VALIDATE_QUERY_VAR ] ); // WPCS: CSRF ok.\n\t}",
"public function url()\n\t{\n\t\t$this->addValidaterule('url', 'true');\n\t}",
"function check_login_SSP()\n{\n\tglobal $CONF_BASE;\n\tif(!isset($_SESSION[\"user\"][APLIKACE_UNIQ_ID])) {\n\t\theader(\"location: \".$CONF_BASE);\n\t\texit;\n\t}\n\n\n\t// KONTROLA, ZDA JE SPRAVNY TYP APLIKACE!!!\n\tif(isset($_SESSION[\"aplikace_typ_id\"]) && fetch_uri(\"aplikace_typ_id_control\",\"g\") != $_SESSION[\"aplikace_typ_id\"]) {\n//\t\techo $CONF_BASE;\n\t\theader(\"location: \".$CONF_BASE);\n\t\texit;\n\t}\n}",
"function defend()\r\n{\r\n// For basic web-forms, we don't care about anything\r\n// other than requests from a browser: \r\nif(!isset($_SERVER['HTTP_USER_AGENT'])){\r\n //echo(\"Forbidden 1- You are not authorized to view this page\");\r\n return false;\r\n}\r\n\r\n// Make sure the form was indeed POST'ed:\r\n// (requires your html form to use: action=\"post\") \r\nif(!$_SERVER['REQUEST_METHOD'] == \"POST\"){\r\n //echo(\"Forbidden 2- You are not authorized to view this page\");\r\n return false; \r\n}\r\n\r\n// Host names from where the form is authorized\r\n// to be posted from: \r\n$authHosts = array(\"127.0.0.1\", \"nitjsr.ac.in\");\r\n\r\n// Where have we been posted from?\r\n$fromArray = parse_url(strtolower($_SERVER['HTTP_REFERER']));\r\n\r\n// Test to see if the $fromArray used www to get here.\r\n$wwwUsed = strpos($fromArray['host'], \"www.\");\r\n\r\n// Make sure the form was posted from an approved host name.\r\nif(!in_array(($wwwUsed === false ? $fromArray['host'] : substr(stristr($fromArray['host'], '.'), 1)), $authHosts)){ \r\n //logBadRequest();\r\n //header(\"HTTP/1.0 403 Forbidden\");\r\n //echo(\"Forbidden 3- You are not authorized to view this page\");\r\n return false; \r\n}\r\n\r\n// Attempt to defend against header injections:\r\n$badStrings = array(\"Content-Type:\",\r\n \"MIME-Version:\",\r\n \"Content-Transfer-Encoding:\",\r\n \"bcc:\",\r\n \"cc:\");\r\n\r\n// Loop through each POST'ed value and test if it contains\r\n// one of the $badStrings:\r\nforeach($_POST as $k => $v){\r\n foreach($badStrings as $v2){\r\n if(strpos($v, $v2) !== false){\r\n //logBadRequest();\r\n // header(\"HTTP/1.0 403 Forbidden\");\r\n //echo(\"Forbidden 4- You are not authorized to view this page\");\r\n return false;\r\n }\r\n }\r\n} \r\n\r\n// Made it past spammer test, free up some memory\r\n// and continue rest of script: \r\nunset($k, $v, $v2, $badStrings, $authHosts, $fromArray, $wwwUsed); \r\nreturn true;\r\n}",
"public function validate()\n {\n $url = self::getHostUrl($this->url);\n $site_url = self::getHostUrl();\n if ($site_url === null) {\n $site_url = self::getHostUrl(site_url('url'));\n }\n if ($url === $site_url || !$url) {\n return false;\n }\n return true;\n }",
"function url_valid($url) {\n // Quick check to see if url exists\n if ($f = @fopen($url,\"r\")) {\n // If so: Let's check if we don't get redirected\n $headers = get_headers($url);\n if (strpos($headers[0], '200') !== FALSE) {\n // Finally: Check if content-type matches\n if (isset($headers[8]) && strpos($headers[8], 'audio') !== false)\t\n return true;\n }\n fclose($f);\n }\n return false;\n }",
"private function augment_general_server_security() {\n\t\t$new_options['use_nonces'] = array( 'type' => 'checkbox', 'default' > '1' , 'use_in_javascript' => true );\n\t\t$this->attach_to_slp( $new_options , array( 'page'=> 'slp_general','section' => 'server', 'group' => 'security' ) );\n\t}",
"static function checkValidReferer() {\n global $CFG_GLPI;\n\n $isvalidReferer = true;\n\n if (!isset($_SERVER['HTTP_REFERER'])) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"No HTTP_REFERER found in request. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n } else if (!is_array($url = parse_url($_SERVER['HTTP_REFERER']))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"Error when parsing HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!isset($url['host'])\n || (($url['host'] != $_SERVER['SERVER_NAME'])\n && (!isset($_SERVER['HTTP_X_FORWARDED_SERVER'])\n || ($url['host'] != $_SERVER['HTTP_X_FORWARDED_SERVER'])))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"None or Invalid host in HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!isset($url['path'])\n || (!empty($CFG_GLPI['root_doc'])\n && (strpos($url['path'], $CFG_GLPI['root_doc']) !== 0))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"None or Invalid path in HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!$isvalidReferer && $_SESSION['glpi_use_mode'] != Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"The action you have requested is not allowed. Reload previous page before doing action again.\"),\n true);\n }\n }",
"function allowed();"
] | [
"0.5890715",
"0.58869904",
"0.5810721",
"0.57139415",
"0.5711224",
"0.55664545",
"0.54956526",
"0.54657805",
"0.5438897",
"0.53955734",
"0.5388748",
"0.5358907",
"0.5313198",
"0.53118616",
"0.5309168",
"0.5298302",
"0.52774894",
"0.5238544",
"0.52347463",
"0.5226766",
"0.5204908",
"0.5178906",
"0.51771796",
"0.51679426",
"0.51674986",
"0.51518697",
"0.51419866",
"0.51337266",
"0.51249915",
"0.51203185"
] | 0.616728 | 0 |
Validation routine for CGI state. | function validate_web_cgi($state)
{
clearos_profile(__METHOD__, __LINE__);
if (! clearos_is_valid_boolean($state))
return lang('base_state_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_web_php($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"function validateState() {\n\t\t$error_message = \"\";\n\n if (!$GLOBALS[\"state\"] == 'vic' && !$GLOBALS[\"state\"] == 'nsw' && !$GLOBALS[\"state\"] == 'qld' && !$GLOBALS[\"state\"] == 'nt' && !$GLOBALS[\"state\"] == 'wa' && !$GLOBALS[\"state\"] == 'sa' || !$GLOBALS[\"state\"] == 'tas' && !$GLOBALS[\"state\"] == 'act' && !$GLOBALS[\"state\"] == \"no-state\") {\n $error_message = $error_message.\"<p>\".$state.\" is not a valid state!</p>\";\n } else if ($GLOBALS[\"state\"] == \"no-state\") {\n $error_message = $error_message.\"<p>State has not been entered.</p>\";\n } else if (!checkPostcode($GLOBALS[\"state\"])) {\n\t\t\t$error_message = $error_message.\"<p>\".$GLOBALS[\"postcode\"].\" is not a valid postcode for \".$GLOBALS[\"state\"].\".</p>\";\n\t\t}\n\n\t\treturn $error_message;\n }",
"public function validateInput() {}",
"function validate_web_allow_ssi($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function valid () {}",
"function validate_web_require_authentication($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"function valid() {}",
"function islandora_webpage_admin_validate($form, &$form_state) {\n \n}",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid() {}",
"public function valid() {}",
"function validateForm2($state) {\r\n\tglobal $state_error;\r\n\tif ($state == \"0\") {\r\n\t\t$state_error = \"Please choose the critera of overview!\";\r\n\t\t$_SESSION [\"state_error\"] = $state_error;\r\n\t\treturn false;\r\n\t} else {\r\n\t\t$state_error = \"\";\r\n\t\t$_SESSION [\"state_error\"] = $state_error;\r\n\t\treturn true;\r\n\t}\r\n}",
"function stsform_form_validate($form, &$form_state) {\r\n\t$url = $form_state['values']['stsform_URL'];\r\n\t$forwarding = $form_state['values']['stsform_status'];\r\n\t$stsform_defaultStatus = variable_get('stsform_defaultStatus');\r\n\t$url = trim($url); \r\n\r\n\t//If no default URL is specified and forwarding is on\r\n\tif (($forwarding == 1) && ($stsform_defaultStatus == 0)) {\r\n\t\tif ($url == \"\") {\r\n\t\t\tform_set_error('stsform_URL', 'Please enter a url.');\r\n\t\t}\r\n\t} \r\n}",
"abstract protected function validation();",
"function check_valid_state($state)\n{\nif(strlen($state)==0)\n\t{\n\t\techo\"No code given.\\n\";\n\t\treturn false;\n\t}\n\telseif(strlen($state)>2)\n\t{\n\t\techo\"State Code is too long.\\n\";\n\t\treturn false;\n\t}\n\telseif(ctype_alpha($state) == false)\n\t{\n\t\techo\"State code does not contain only alphabet letters.\\n\";\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}",
"function validate_web_show_index($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"abstract protected function validate();",
"abstract protected function validate();",
"function validate_web_htaccess_override($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"private function __is_valid() {\n return true;\n }",
"public function is_valid();",
"function validate_web_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public static function validate ()\n {\n $str = filter_input(INPUT_POST, 'input', \\FILTER_SANITIZE_SPECIAL_CHARS);\n \n if (ctype_alnum($str))\n {\n $sheetname = $str;\n }\n \n if (ctype_digit($str) && strlen($str) == 8) {\n $hashcode = $str;\n } \n \n }",
"public function valid(){ }",
"public function valid()\n {\n\t\tif($_GET[\"echostr\"])\n\t\t{\n\t\t\t$echoStr = $_GET[\"echostr\"];\n\t\t\tif($this->checkSignature())\n\t\t\t{\n\t\t\t\techo $echoStr;\n\t\t\t\texit;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->responseMsg();\t\n\t\t}\n }"
] | [
"0.6860063",
"0.6376442",
"0.6356442",
"0.63542545",
"0.63437486",
"0.632215",
"0.6301516",
"0.6277536",
"0.62714267",
"0.62714267",
"0.62714267",
"0.62714267",
"0.62714267",
"0.62714267",
"0.6202027",
"0.6202027",
"0.6194084",
"0.6187439",
"0.6159876",
"0.61457324",
"0.61230016",
"0.61228514",
"0.61228514",
"0.6117271",
"0.6074899",
"0.6072737",
"0.602395",
"0.6002377",
"0.59846205",
"0.5967183"
] | 0.77904207 | 0 |
Validation routine for flexshare web folder layout. | function validate_web_folder_layout($layout)
{
clearos_profile(__METHOD__, __LINE__);
$options = $this->get_web_folder_layout_options();
if (!array_key_exists($layout, $options))
return lang('flexshare_folder_layout_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validateFileStructure() {\n\n\t\t// if home directory is not defined, create this one now.\n\t\tif (!is_dir($this->settings['documentsCache'])) {\n\t\t\t// @todo: check whether a set up action would be preferable\n\t\t\t//throw new Exception('Exception thrown #1294746784: temp directory does not exist \"' . $this->settings['documentsCache'] . '\". Run command setUp', 1294746784);\n\t\t\ttry {\n\t\t\t\tt3lib_div::mkdir($this->settings['documentsCache']);\n\t\t\t} catch (Exception $e) {\n\t\t\t\tTx_TerDoc_Utility_Cli::log($e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\t// Check if configuration is valid ...and throw error if that is not the case\n\t\tif (!is_dir($this->settings['repositoryDir'])) {\n\t\t\tthrow new Exception('Exception thrown #1294657643: directory does not exist \"' . $this->settings['repositoryDir'] . '\". Make sure key \"repositoryDir\" is properly defined.', 1294657643);\n\t\t}\n\t}",
"public function validateSite()\n {\n $validationStatus = (\n is_dir($this->siteDir)\n && file_exists($this->siteDir.'/index.html')\n && filesize($this->siteDir.'/index.html') > 0\n && is_dir($this->siteDir.'/espanol')\n && file_exists($this->siteDir.'/espanol/index.html')\n && filesize($this->siteDir.'/espanol/index.html') > 0\n );\n \n if ( empty($validationStatus) ){\n $this->log(\"Validate Site: Empty Site \\n\");\n }\n else $this->log(\"Validate Site: Valid\\n\");\n\n return $validationStatus;\n \n /*\n if ( empty($this->pagesByUrl) )\n {\n $this->log(\"Validate Site: no site found to validate\\n\");\n return null;\n }\n $requiredPages = 0;\n $renderedPages = 0;\n /// shouldn't be duplicating the logic here, it's too easy to break\n foreach ( $this->pagesByUrl as $url=>&$page )\n {\n /// only validate pages that should be generated\n if ( array_key_exists('generate_page',$page) && $page['generate_page']!='yes' )\n {\n continue;\n }\n $requiredPages++;\n $pageDir = rtrim( $this->siteDir.'/'.trim($url,'/'), '/' );\n $pageFile = $pageDir.'/index.html';\n\n if ( $this->validatePage($pageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$url} : {$page['uuid']}\\n\");\n }\n\n /// some special pages generate further sub-pages\n if ( $page['pageType'] == 'AZPage' )\n {\n /// add for-use-by \n foreach ( $this->siteIndexAZ as $letter => $list )\n {\n $requiredPages++;\n $subUrl = $url.'/'.strtolower($letter);\n $subPageDir = rtrim( $pageDir.'/'.trim(strtolower($letter),'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n\n if ( isset($page['az_index_data_source']) \n && $page['az_index_data_source'] == 'directory-records-federal' )\n {\n foreach ( $page['for_use_by'] as $fub )\n {\n if ( !array_key_exists($fub,$this->directoryRecordGroups) ) { continue; }\n foreach ( $this->directoryRecordGroups[$fub]['all']['Federal Agencies']['all'] as $agencyInfo )\n {\n $requiredPages++;\n $agency = $this->source->entities[$agencyInfo['uuid']];\n\n $urlSafeTitle = $this->sanitizeForUrl($agency['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n //$this->log(\"**Valid: {$subUrl} // {$agency['title']}\\n\");\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl} // {$agency['title']} // {$agency['uuid']}\\n\");\n } \n }\n }\n }\n } else if ( $page['pageType'] == '50StatePage' ) {\n if ( !empty($page['usa_gov_50_state_category']) \n && preg_match('/^autogenerate\\-(.*)/',$page['usa_gov_50_state_category']) )\n {\n foreach ( $this->stateAcronyms as $stateAcronym=>$stateName ) \n {\n $requiredPages++;\n $subUrl = $url.'/'.$this->sanitizeForUrl($stateName);\n if ( !empty($page['usa_gov_50_state_prefix']) )\n {\n $subUrl = $page['usa_gov_50_state_prefix']\n .'/'.$this->sanitizeForUrl($stateName);\n }\n $subPageDir = rtrim( $this->siteDir.'/'.trim($subUrl,'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n } else if ( $page['pageType'] == 'Features' ) {\n \n foreach ( $page['for_use_by'] as $fub )\n {\n foreach ( $this->features[$fub] as $feature ) \n {\n $requiredPages++;\n $urlSafeTitle = $this->sanitizeForUrl($feature['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n }\n }\n $this->log(\"Site Validation: $renderedPages of $requiredPages pages rendered to /sites/{$this->config['siteName']} \\n\");\n return ($requiredPages <= $renderedPages);\n */\n }",
"function checkFolder()\n\t{\n\t\t$ignoredPageTypes = Config::inst()->get($this->class, 'ignored_classes');\n\n\t\tforeach ($ignoredPageTypes as $pagetype) {\n\t\t\tif (is_a($this->owner, $pagetype)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (class_exists('Translatable')\n\t\t\t&& $this->owner->Locale !== Translatable::default_locale()\n\t\t\t&& !Config::inst()->get($this->class, 'create_folder_for_translations')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->owner->RootFolderID) {\n\t\t\t$this->createRootFolder();\n\t\t} else {\n\t\t\t$this->updateRootFolder();\n\t\t}\n\t}",
"public static function validStructure()\r\n {\r\n // define o caminho para as pastas relacionadas com boletos\r\n $paths = [\r\n \\Yii::$app->params['boleto']['base'],\r\n \\Yii::$app->params['boleto']['pdf'],\r\n \\Yii::$app->params['boleto']['remessa'],\r\n \\Yii::$app->params['boleto']['retorno']\r\n ];\r\n \r\n // verifica se o diretorio existe e se possui permissao\r\n foreach ($paths as $path) {\r\n // verifica se o diretorio existe\r\n if (!file_exists($path)) {\r\n mkdir($path);\r\n chmod($path, 0775);\r\n }\r\n // verifica a permissao\r\n if (!is_writable($path) || !is_readable($path)) {\r\n chmod($path, 0775);\r\n }\r\n }\r\n }",
"protected function validateWebRoot() {\n $web_directory = empty($this->config['web_directory']) ? 'web' : $this->config['web_directory'];\n $this->webRoot = $this->getRoot() . trim($web_directory, '/') . '/';\n }",
"public function isValid()\r\n {\r\n return @$this->schemaValidate(__DIR__ . DIRECTORY_SEPARATOR . 'page.xsd');\r\n }",
"static protected function validatePublicDir()\n\t{\n\t\t\n\t\tif (self::$_opt['publicDir'] === null) {\n\t\t\n\t\t\tself::$_publicDir = self::$_outputDir;\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\tself::$_publicDir = self::$_opt['publicDir'];\n\n\t\t}\n\n\t\t$char = substr(self::$_publicDir, 0, 1);\n\n\t\tif (self::$_opt['absolutePaths'] === true && $char !== '/') {\n\n\t\t\tself::$_publicDir = '/'.self::$_publicDir;\n\n\t\t}\n\n\n\t}",
"public static function Folderize()\n\t{\n\t\t$parts = explode( \"?\", self::$url );\n\t\tif ($parts[0][ strlen($parts[0]) - 1 ] != '/') {\n\t\t\t$parts[0] .= '/';\n\t\t\t$url = implode( '?', $parts );\n\t\t\tself::Redirect( $url );\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function validate_dir()\n\t{\n\t\tif (substr_count($this->ext_name, '/') !== 1 || $this->ext_name != $this->get_metadata('name'))\n\t\t{\n\t\t\tthrow new \\phpbb\\extension\\exception('EXTENSION_DIR_INVALID');\n\t\t}\n\n\t\treturn true;\n\t}",
"function validate_directory($dir)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!preg_match(\"/^([A-Za-z0-9\\-\\.\\_\\/]+)$/\", $dir))\n return lang('flexshare_directory_invalid');\n }",
"function check_upload_folder()\n{\n}",
"public function validate()\n\t{\n\t\t$this->reset_error_msg();\n\t\t$id = ($this->id > 0) ? $this->id : -1;\n\t\t$result = ajax::asset_validate(\n\t\t\t\t\t\t$this->schema->folder_id,\n\t\t\t\t\t\t$this->schema->view_name,\n\t\t\t\t\t\t$this->fields,\n\t\t\t\t\t\t$id\n\t\t);\n\t\tif (count($result)>0) {\n\t\t\t$this->set_error_msg($result);\n\t\t}\t\n\t}",
"function validateUpload($fileName, $folderName) {\n\n return true;\n}",
"function validHome()\r\n{\r\n}",
"public function validate()\n {\n $url = self::getHostUrl($this->url);\n $site_url = self::getHostUrl();\n if ($site_url === null) {\n $site_url = self::getHostUrl(site_url('url'));\n }\n if ($url === $site_url || !$url) {\n return false;\n }\n return true;\n }",
"static protected function validateCacheDir()\n\t{\n\n\t\tself::validateOpt('cacheDir');\n\n\t\tself::$_cacheDir = self::$_opt['cacheDir'];\n\t\t$isValid = self::validateDir(self::$_cacheDir);\n\n\t\treturn $isValid;\n\n\t}",
"protected function validateURIFormat() {\n\n\t\tarray_shift( $this->path_fragments );\n\t\t$end_i = count($this->path_fragments)-1;\n\n\t\t//last char in URI path must be /\n\t\tif( $this->path_fragments[$end_i]===\"\" ) {\n\t\t\tunset($this->path_fragments[$end_i]);\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//... or some opened document, or XML and so on\n\t\tif( strpos( $this->path_fragments[$end_i], \".\")!==false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn true;\n\n\t\t/*\n\t\t$this->setRedirect(\n\t\t\t$this->base_URL\n\t\t\t\t. $this->path . \"/\"\n\t\t\t\t. (($this->query) ? \"?\".$this->query : \"\"),\n\t\t\tMvc_Router::REDIRECT_TYPE_PERMANENTLY\n\t\t);\n\n\t\treturn false;\n\t\t*/\n\t}",
"public function onValidateMigrate($from_host, $path, $source) {\nglobal $_LW;\nreturn true; // return true/false depending on whether the file at $path with HTML source $source should be migrated\n}",
"public function validate_standard_paths() {\n\t\tif ( ! defined( 'WP_PLUGIN_URL' ) ) {\n\t\t\tif ( ! defined( 'WP_CONTENT_DIR' ) ) {\n\t\t\t\tdefine( 'WP_CONTENT_DIR', ABSPATH.'wp-content' );\n\t\t\t}\n\t\t\tif ( ! defined( 'WP_CONTENT_URL' ) ) {\n\t\t\t\tdefine( 'WP_CONTENT_URL', get_option( 'siteurl' ).'/wp-content' );\n\t\t\t}\n\t\t\tif ( ! defined( 'WP_PLUGIN_DIR' ) ) {\n\t\t\t\tdefine( 'WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins' );\n\t\t\t}\n\t\t\tdefine( 'WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins' );\n\t\t}\n\t}",
"function drstk_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"static private function validatePage(){\r\n\r\n\t\tif (empty(self::$page)){\r\n\t\t\tself::$page = 'main';\r\n\t\t\treturn true;\r\n\t\t} elseif (!file_exists('pages/' . self::$page . '.php')){\r\n\t\t\tthrow new \\TaskerMAN\\Core\\FatalException('404 - Page Not Found', new \\Exception('Requested page (' . self::$page . ') was not found'));\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"function validate_content(DocumentInfo $doc) {\n // need not be checked by load_content.\n return true;\n }",
"private function validatePath()\n\t{\n\t\t$this->path = CLASSOVERRIDER_PATH;\n\t\tif( strpos(strrev($this->path), '/') !== 0 ) {\n\t\t\t$this->path .= '/';\n\t\t}\n\t}",
"function check()\n {\n $message = plugin::check();\n if($this->cn == \"\" ){\n $message[] = msgPool::required(_(\"Name\"));\n }\n if(!count($this->use_gotoMimeFilePattern)){\n $message[] = msgPool::required(_(\"File pattern\"));\n }\n\n // Check if a wrong base was supplied\n if(!$this->baseSelector->checkLastBaseUpdate()){\n $message[]= msgPool::check_base();;\n }\n\n /* Check if there is already a mime type with this cn */\n $ldap = $this->config->get_ldap_link();\n $ldap->cd($this->config->current[\"BASE\"]);\n\n if($this->is_release()){\n $base = $this->parent->parent->mime_release;\n }else{\n $base = get_ou(\"mimetype\", \"mimetypeRDN\").$this->base;\n }\n\n $ldap->ls(\"(&(objectClass=gotoMimeType)(cn=\".$this->cn.\"))\",$base,array(\"cn\"));\n if($ldap->count()){\n $attrs = $ldap->fetch();\n if($this->dn != $attrs['dn']) {\n $message[]= msgPool::duplicated(\"cn\");\n }\n }\n\n /* Check if we are allowed to create or move this object\n */\n if($this->orig_dn == \"new\" && !$this->acl_is_createable($this->base)){\n $message[] = msgPool::permCreate();\n }elseif($this->orig_dn != \"new\" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){\n $message[] = msgPool::permMove();\n }\n\n return($message);\n }",
"protected function isValidDirectory()\n {\n $path = SystemUtility::refactorDS(ROOT . $this->name);\n $directories = Nishchay::getStructureProcessor()->getDirectories($this->type);\n\n $options = [];\n $i = 1;\n foreach ($directories as $namespace => $path) {\n $options[$i++] = $namespace;\n }\n $options[$i] = 'Select this if you have entered namespace';\n\n $answer = (int) $this->getInput('Where do you want to create(Type number)', $options, 3, true);\n if ($answer !== $i) {\n $this->name = $options[$answer] . '\\\\' . $this->name;\n }\n $path = SystemUtility::refactorDS(ROOT . $this->name);\n try {\n if (file_exists($path)) {\n $input = $this->getInput('Directory already exist,'\n . ' Do you create in same'\n . ' directory?', 'YN');\n if ($input === 'n') {\n throw new ApplicationException('Operation terminated by user.', null, null, 933005);\n }\n return $path;\n }\n if (($type = Nishchay::getStructureProcessor()\n ->isValidDirectory($path)) === false ||\n $type !== $this->type) {\n goto INVALID;\n }\n return $path;\n } catch (InvalidStructureException $e) {\n INVALID:\n throw new ApplicationException('Directory [' . $this->name . '] is not valid as'\n . ' per structure definition.', null, null, 933006);\n }\n }",
"public function isPathValid()\n {\n $path = $this->deletefiles_directory;\n\n return\n strlen($path) > 0 &&\n file_exists(PATH_site.$path) &&\n GeneralUtility::isAllowedAbsPath(PATH_site.$path) &&\n GeneralUtility::validPathStr($path)\n ;\n }",
"function digidiss_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"public function validateFile(){\n\t\t\t\n\t\t}",
"public function validateExternal() {\n\t\t\t$this->setSize($this->target);\n\t\t\ttry {\n\t\t\t\tif($this->fileType == 'image') $this->checkReal();\n\t\t\t\t$this->checkType();\n\t\t\t\t$this->checkSize();\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$this->delete($this->target); // File is invalid - delete.\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"private function validate()\n {\n \t$cms_root = getcwd().'/';\t\t\n\t\t\n if ( ! is_writable($cms_root . '../app/config/app.php'))\n {\n $this->errors[] = $cms_root . '../app/config/app.php is not writable.';\n }\n\n if ( ! is_writable($cms_root . '../app/config/database.php'))\n {\n $this->errors[] = $cms_root . '../app/config/database.php is not writable.';\n }\n\t\tif ( ! is_writable($cms_root . '../app/config/a2zcms.php'))\n {\n $this->errors[] = $cms_root . '../app/config/a2zcms.php is not writable.';\n }\n\t\t$writable_dirs = $this->writable_dirs;\n foreach ($writable_dirs as $path => $is_writable)\n {\n if(!is_writable($cms_root . $path))\n {\n \t$this->errors[] = $cms_root . $path . ' is not writable.';\n }\n }\n\n if (phpversion() < '5.3.7')\n {\n $this->errors[] = 'You need to use PHP 5.3.7 or greater.';\n }\n\n if ( ! ini_get('file_uploads'))\n {\n $this->errors[] = 'File uploads need to be enabled in your PHP configuration.';\n }\n\n if ( ! extension_loaded('mysql'))\n {\n $this->errors[] = 'The PHP MySQL extension is required.';\n }\n\n if ( ! extension_loaded('gd'))\n {\n $this->errors[] = 'The PHP GD extension is required.';\n }\n\n if ( ! extension_loaded('curl'))\n {\n $this->errors[] = 'The PHP cURL extension is required.';\n }\n if (empty($this->errors))\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }"
] | [
"0.6102785",
"0.5916059",
"0.5869951",
"0.57678616",
"0.57589895",
"0.56774",
"0.5669757",
"0.56549644",
"0.5617001",
"0.55951744",
"0.55679727",
"0.55577415",
"0.5546935",
"0.55255353",
"0.55056196",
"0.54959744",
"0.54889643",
"0.5453057",
"0.5432482",
"0.54186845",
"0.5398597",
"0.5389677",
"0.53810066",
"0.5374579",
"0.53709173",
"0.53404605",
"0.5308864",
"0.52991277",
"0.52733344",
"0.5271558"
] | 0.7378453 | 0 |
Validation routine for web follow symlinks. | function validate_web_follow_symlinks($state)
{
clearos_profile(__METHOD__, __LINE__);
if (! clearos_is_valid_boolean($state))
return lang('base_state_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function checkLinks($parsed)\n {\n $slugs = array();\n\n // Collect the headline slugs\n foreach ($parsed[\"headlines\"] as $ln => $headline) {\n $slugs['#' . $headline[\"slug\"]] = '#' . $headline[\"slug\"];\n }\n\n $return = true;\n $links = array();\n // Collect the links urls\n foreach ($parsed[\"links\"] as $ln => $line) {\n foreach ($line[\"links\"] as $key => $link) {\n $this->addVerboseDetail(\n \"Checking link with target \" . $link[\"url\"]\n );\n if ($link[\"url\"][0] === '#') {\n if (!isset($slugs[$link[\"url\"]])) {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n }\n } elseif (filter_var($link[\"url\"], FILTER_VALIDATE_URL)) {\n try {\n $response = $this->browser->request(\n 'GET',\n $link[\"url\"]\n );\n } catch (\\GuzzleHttp\\Exception\\RequestException $e) {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n } catch (Exception $e) {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n }\n\n if ($response->getStatusCode() == \"404\") {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n }\n } else {\n // It is not an anchor or a url, so it is file\n // Clear the anchor text with file name\n // like CONTRIBUTING.md#add-new-metric\n $file = $link[\"url\"];\n $file = explode('#', $link[\"url\"]);\n $file = $file[0];\n\n if (!file_exists($file)) {\n $return = false;\n continue;\n }\n }\n\n $links[] = $link[\"url\"];\n }\n }\n\n $this->addVerboseDetail(\n \"There is/are \" . count($links) . \" link(s) in README.\"\n );\n\n return $return;\n }",
"public function checkLink($link);",
"public function shouldCheckLink($url);",
"function is_link ($filename) {}",
"static function checkValidReferer() {\n global $CFG_GLPI;\n\n $isvalidReferer = true;\n\n if (!isset($_SERVER['HTTP_REFERER'])) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"No HTTP_REFERER found in request. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n } else if (!is_array($url = parse_url($_SERVER['HTTP_REFERER']))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"Error when parsing HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!isset($url['host'])\n || (($url['host'] != $_SERVER['SERVER_NAME'])\n && (!isset($_SERVER['HTTP_X_FORWARDED_SERVER'])\n || ($url['host'] != $_SERVER['HTTP_X_FORWARDED_SERVER'])))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"None or Invalid host in HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!isset($url['path'])\n || (!empty($CFG_GLPI['root_doc'])\n && (strpos($url['path'], $CFG_GLPI['root_doc']) !== 0))) {\n if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"None or Invalid path in HTTP_REFERER. Reload previous page before doing action again.\"),\n true);\n $isvalidReferer = false;\n }\n }\n\n if (!$isvalidReferer && $_SESSION['glpi_use_mode'] != Session::DEBUG_MODE) {\n Html::displayErrorAndDie(__(\"The action you have requested is not allowed. Reload previous page before doing action again.\"),\n true);\n }\n }",
"function v0_check_link($instruction, $is_list, $full_xml_array, $gen_cc_id, $gen_cc_code, $gen_vd_id, $gen_vd_code, $developer, $user_upload, &$class, &$answer, &$errors, &$l_errors) {\n\t// Get target name\n\t$target=$instruction['attributes']['TARGET'];\n\t\n\t// If link was already set, continue\n\tif (isset($class['results'][$target])) {\n\t\treturn TRUE;\n\t}\n\t\n\t// Depending on type of instruction\n\tswitch ($instruction['attributes']['TYPE']) {\n\t\tcase \"ownerCode\":\n\t\t\t// Call v0_check_owner_code\n\t\t\tif (!v0_check_owner_code($instruction, $class, $gen_cc_id, $gen_cc_code, $developer, $user_upload, $result, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"volcanoCode\":\n\t\t\t// Call v0_check_volcano_code\n\t\t\tif (!v0_check_volcano_code($instruction, $class, $gen_vd_id, $gen_vd_code, $result, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"simple\":\n\t\t\t// Call v0_check_link_simple\n\t\t\tif (!v0_check_link_simple($instruction, $class, $is_list, $full_xml_array, $answer, $result, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"include1\":\n\t\tcase \"include2\":\n\t\t\t// Call v0_check_link_include\n\t\t\tif (!v0_check_link_include($instruction, $class, $full_xml_array, $answer, $result, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"before\":\n\t\t\t// Call v0_check_link_before\n\t\t\tif (!v0_check_link_before($instruction, $class, $full_xml_array, $answer, $result, $errors, $l_errors)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Error\n\t\t\t$errors[$l_errors]=array();\n\t\t\t$errors[$l_errors]['code']=1405;\n\t\t\t$errors[$l_errors]['message']=\"A type of 'checkLink' instruction in WOVOMLToWOVOdat.xml could not be recognized: \".$instruction['attributes']['TYPE'];\n\t\t\t$l_errors++;\n\t\t\treturn FALSE;\n\t}\n\t\n\t// Store returned value\n\tif (!$is_list) {\n\t\t$class['results'][$target]=$result;\n\t}\n\t\n\treturn TRUE;\n}",
"public function checkUrl() {\r\n\r\n\t\t// Get the user's current URL\r\n\t\t$pageURL = (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\" ? \"https://\" : \"http://\") . $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\r\n\r\n\t\t// Parse the URL, and reform it with the query string omitted\r\n\t\t$parsedURL = parse_url($pageURL);\r\n\r\n if ( $parsedURL['path'] == '/' ) $parsedURL['path'] = str_replace(APP_ROOT, '', $this->filename);\r\n\r\n\t\t$constructedURL = $parsedURL['scheme'] . '://' . $parsedURL['host'] . $parsedURL['path'];\r\n\r\n\t\t// Compare the user's current URL with the proper constructed URL and see if they match\r\n return (isset($this->url, $this->requestPath) && $this->url === $constructedURL);\r\n\t}",
"function validateUrl($str3)\r\n{\r\nif (!preg_match('#^http\\\\:\\\\/\\\\/[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)?[a-z]+#i', $str3)) \r\n{\r\n\treturn false;\r\n}\r\nelse\r\n{\r\n\r\n\t$fp = @fopen($str3,\"r\"); \r\n if ($fp) { \r\n fclose($fp); \r\n return true; \r\n } else { \r\n return false; \r\n } \r\n}\r\n}",
"#[Pure(true)]\nfunction is_link(string $filename): bool {}",
"public function validate()\n {\n $url = self::getHostUrl($this->url);\n $site_url = self::getHostUrl();\n if ($site_url === null) {\n $site_url = self::getHostUrl(site_url('url'));\n }\n if ($url === $site_url || !$url) {\n return false;\n }\n return true;\n }",
"function drush_scr_redirect_validate($redirect) {\n if (url($redirect->source) == url($redirect->redirect)) {\n drupal_set_message(t('You are attempting to redirect the page to itself. Source=%source; Target=%target', array(\n '%source' => $redirect->source,\n '%target' => $redirect->redirect\n ), array('langcode' => LANGUAGE_NONE, 'context' => '')), \"error\");\n return FALSE;\n }\n\n // Make sure a redirect with the same hash doesn't exist already\n redirect_hash($redirect);\n $result = db_query(\"select source, redirect from {redirect} where hash = :hash\", array(\n ':hash' => $redirect->hash\n ));\n if (count($result->fetchallKeyed)) {\n foreach ($result->fetchAllKeyed() as $source => $redirect) {\n drupal_set_message(t(\"A redirect of :source --> :redirect already exists.\", array(\n ':source' => $source,\n ':redirect' => $redirect\n ), array('langcode' => LANGUAGE_NONE, 'context' => '')), \"error\");\n }\n return FALSE;\n }\n\n if ($existing = redirect_load_by_hash($redirect->hash)) {\n if ($redirect->rid != $existing->rid) {\n drupal_set_message(t('The source path %source is already being redirected: Source=%source; Target=%target', array(\n '%source' => $existing->source,\n '%target' => $existing->redirect\n ), array('langcode' => LANGUAGE_NONE, 'context' => '')), \"error\");\n return FALSE;\n }\n }\n\n\n return TRUE;\n}",
"function ol_check_url() {\r\n $feedsmart_settings = $this->get_options();\r\n switch (basename($_SERVER['PHP_SELF'])) {\r\n case 'wp-rss.php':\r\n case 'wp-rss2.php':\r\n case 'wp-atom.php':\r\n case 'wp-rdf.php':\r\n if (trim($feedsmart_settings['feedsmart_url']) != '') {\r\n if (function_exists('status_header')) status_header( 302 );\r\n header(\"Location:\" . trim($feedsmart_settings['feedsmart_url']));\r\n header(\"HTTP/1.1 302 Temporary Redirect\");\r\n exit();\r\n }\r\n break;\r\n case 'wp-commentsrss2.php':\r\n if (trim($feedsmart_settings['feedsmart_comments_url']) != '') {\r\n if (function_exists('status_header')) status_header( 302 );\r\n header(\"Location:\" . trim($feedsmart_settings['feedsmart_comments_url']));\r\n header(\"HTTP/1.1 302 Temporary Redirect\");\r\n exit();\r\n }\r\n break;\r\n }\r\n }",
"function isValidUrl( $url )\r\n\t{\r\n\t\t$response = wp_remote_head( $url );\r\n\t\t$accepted_status_codes = array( 200, 301, 302 );\r\n \r\n /* If no error occured and the status code matches one of the above, go on... */\r\n if ( ! is_wp_error( $response ) && in_array( wp_remote_retrieve_response_code( $response ), $accepted_status_codes ) ) {\r\n /* Target URL exists. Let's return the (working) URL */\r\n return true;\r\n }\r\n /* If we have reached this point, it means that either the HEAD request didn't work or that the URL\r\n * doesn't exist. This is a fallback so we don't show the malformed URL */\r\n return false;\r\n\t}",
"function check_crawl_url($url) {\n foreach($GLOBALS['eregi_url_blacklist'] as $black_url) {\n if(eregi($black_url, $url)) return(0);\n }\n if(in_array($url, $GLOBALS['urls'])) return(0);\n $file_url = explode('?', $url, 2); $file_url = $file_url[0];\n if(in_array($file_url, $GLOBALS['history'])) return(0);\n return(1);\n}",
"public function validate_link(){\n \n \n if($this->syllabus_m->validate_link()){\n \n return true;\n }\n else{\n $this->form_validation->set_message('validate_link','Youtube link is already in use'); //setting the message for the function form_validation\n return false;\n }\n }",
"private function isRelativeRef($ref)\n {\n return !preg_match('#^.+\\:\\/\\/.*#', $ref);\n }",
"function test9() {\r\n return check_test(fixLinkDomain(\"../img/pics.jpg\", \"andrewburton.biz\", \"https\"),\r\n \"https://andrewburton.biz/img/pics.jpg\",\r\n \"Failed to fix domain with ../img/pics.jpg at the start.\"); \r\n}",
"function checkReferer($docheck = 1)\n {\n $ref = xoops_getenv('HTTP_REFERER');\n if ($docheck == 0) {\n return true;\n }\n if ($ref == '') {\n return false;\n }\n if (strpos($ref, XOOPS_URL) !== 0 ) {\n return false;\n }\n return true;\n }",
"function checkURLs($advisor) {\n $urlList = array(\"url\", \"facebook\", \"finraBrokercheck\", \"linkedin\", \"twitter\", \"brochure\");\n foreach($urlList as $target) {\n $advisor->$target = addScheme($advisor->$target);\n }\n return $advisor;\n }",
"function element_validate_url($element, &$form_state) {\n $value = $element['#value'];\n if (filter_var($value, FILTER_VALIDATE_URL) === FALSE) {\n form_error($element, t('%name must be a valid link.', array('%name' => $element['#title'])));\n }\n}",
"public function isLink(): bool;",
"function checkUrl($ss__url='')\n\t\t{\n\t\t\t//if(eregi(\"^http://[a-z0-9]{1}[-_./~a-z0-9]{1,}[a-z0-9?&=:]{0,}$\",$ss__url))\n\t\t\tif(preg_match(\"/^(http|https|ftp):\\/\\/([a-z0-9]([a-z0-9_-]*[a-z0-9])?\\.)+[a-z]{2,6}\\/?([a-z0-9\\?\\._-~&#=+%]*)?/\", $ss__url))\n\t\t\treturn false;\n\t\t\treturn true;\t\t\n\t\t}",
"public function validateUrl($url);",
"public function pruneLinks()\n {\n $this->files->ensureDirExists($this->sitesPath(), user());\n\n $this->files->removeBrokenLinksAt($this->sitesPath());\n }",
"function set_web_follow_symlinks($name, $follow_symlinks)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_set_parameter($name, 'WebFollowSymLinks', $follow_symlinks);\n }",
"protected function validateURIFormat() {\n\n\t\tarray_shift( $this->path_fragments );\n\t\t$end_i = count($this->path_fragments)-1;\n\n\t\t//last char in URI path must be /\n\t\tif( $this->path_fragments[$end_i]===\"\" ) {\n\t\t\tunset($this->path_fragments[$end_i]);\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//... or some opened document, or XML and so on\n\t\tif( strpos( $this->path_fragments[$end_i], \".\")!==false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn true;\n\n\t\t/*\n\t\t$this->setRedirect(\n\t\t\t$this->base_URL\n\t\t\t\t. $this->path . \"/\"\n\t\t\t\t. (($this->query) ? \"?\".$this->query : \"\"),\n\t\t\tMvc_Router::REDIRECT_TYPE_PERMANENTLY\n\t\t);\n\n\t\treturn false;\n\t\t*/\n\t}",
"function check_url($url) {\n if($url && $fp = @fopen($url, \"r\")) {\n return true;\n @fclose($fp);\n }\n\n return false;\n}",
"public function testIsValidAbsolutePath(): void\n {\n $testCases = [\n \"\" => false,\n \"users/1\" => false,\n \"/users/1\" => true,\n \"//users/1\" => false,\n \"///users/1\" => false\n ];\n\n foreach ($testCases as $path => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidAbsolutePath($path), \"Failed for case '$path'.\");\n }\n }",
"public function isValidReferer(){\nglobal $util; \n $valid_referer = strpos(\"\".$_SERVER['HTTP_REFERER'].\"\",SERVER_URL);\n if ($valid_referer === false) {\n $util->js_redirect(SERVER_URL);\n die();\t\n }\n}",
"function url_valid($url) {\n // Quick check to see if url exists\n if ($f = @fopen($url,\"r\")) {\n // If so: Let's check if we don't get redirected\n $headers = get_headers($url);\n if (strpos($headers[0], '200') !== FALSE) {\n // Finally: Check if content-type matches\n if (isset($headers[8]) && strpos($headers[8], 'audio') !== false)\t\n return true;\n }\n fclose($f);\n }\n return false;\n }"
] | [
"0.6389895",
"0.60470176",
"0.6034091",
"0.5835748",
"0.58177775",
"0.5808838",
"0.57399106",
"0.5713181",
"0.5674713",
"0.56593573",
"0.56311685",
"0.5593163",
"0.55894923",
"0.5568211",
"0.5566549",
"0.5558551",
"0.55486655",
"0.5495061",
"0.54729074",
"0.54721993",
"0.5451112",
"0.5442279",
"0.54416376",
"0.54353714",
"0.5396191",
"0.5396023",
"0.5389113",
"0.53854823",
"0.5380576",
"0.5370286"
] | 0.7101794 | 0 |
Validation routine for htaccess override. | function validate_web_htaccess_override($state)
{
clearos_profile(__METHOD__, __LINE__);
if (! clearos_is_valid_boolean($state))
return lang('base_state_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSpoof() {\n\tif (!eregi(\"http://\",$_GET['r']) && !eregi(\"ftp://\",$_GET['r']) && !eregi(\"https://\",$_GET['r'])) {\n\t\thttpredir($_GET['r']);\n\t} else {\n\t\thttpredir(\"index.php\");\n\t}\n}",
"function bframework_check_premission(){\nif(substr(PHP_VERSION, 0, 6) >= 5.3 && extension_loaded('curl') && in_array('mod_rewrite' , apache_get_modules())){\nreturn true;\n} else {\nreturn false;\n }\n}",
"function checkUrl()\n{\n if(isset($_GET['url'])) // 'url' is the name of the query string var set in the mod_rewrite\n {\n $urlArray = explode('-', rawurlencode($_GET['url'])); // Urls in the view are called with the format of controller-action. Revise later: Fix the trailing slash bug in the mod_rewrite to allow con/action format\n file_exists('app/controllers/' . $urlArray[0] . 'Con.class.php') ? splitUrl($urlArray) : include('app/views/errors/error404.php'); // Check if the incoming controller name is valid\n }\n else\n {\n $controller = 'UnderCon'; // For when the site is under construction\n //$controller = 'HomeCon'; // Default landing page\n $action = null;\n init($controller, $action);\n }\n}",
"function _isRewriteRule(){\n\treturn (strcasecmp(REQUEST_URI, _r()) !== 0) ? true : false;\n}",
"public function checkhtaccess()\n {\n $appPath = \"application/.htaccess\";\n $modPath = \"modules/.htaccess\";\n \n if(!file_exists($appPath)){\n print \"<strong>htaccess file missing from application path - creating now</strong> \";\n $fh = fopen($appPath, 'w') or print(\"can't create file\");\n $accessText = \"order allow,deny\\nallow from 127.0.0.1\\ndeny from all\\n\";\n fwrite($fh, $accessText);\n fclose($fh);\n print \"<br/>Written\";\n }\n else{\n print \"htaccess application file exists<br/>\";\n }\n if(!file_exists($modPath)){\n print \"<strong>htaccess file missing from module path - creating now</strong> \";\n $fh = fopen($modPath, 'w') or print(\"can't create file\");\n $accessText = \"order allow,deny\\nallow from 127.0.0.1\\ndeny from all\\n\";\n fwrite($fh, $accessText);\n fclose($fh);\n print \"<br/>Written\";\n }\n else{\n print \"htaccess module file exists<br/>\";\n }\n return;\n }",
"protected function validate_access()\n {\n return true;\n }",
"public function should_redirect() : bool {\n\t\tif ( function_exists( 'is_admin' ) && is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$uri = filter_input( INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL );\n\t\t$uri = ltrim( $uri, '/' );\n\t\treturn ( $this->pattern() === $uri || $this->is_regex_target() );\n\t}",
"public function validate()\n {\n $url = self::getHostUrl($this->url);\n $site_url = self::getHostUrl();\n if ($site_url === null) {\n $site_url = self::getHostUrl(site_url('url'));\n }\n if ($url === $site_url || !$url) {\n return false;\n }\n return true;\n }",
"private function checkURL() {\n\t\t$url = $_SERVER['PHP_SELF'];\n\t\t$url .= !empty($_SERVER['QUERY_STRING'])? \"?{$_SERVER['QUERY_STRING']}\" : '';\n\t\t$from = $_SERVER['REMOTE_ADDR'];\n\t\tif (preg_match('/^\\/(index\\.php)(\\?.*)?$/', $url) === 0) {\n\t\t\tlog_entry(\"REQUEST FILTERED: $url from $from\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tlog_entry(\"REQUEST: $url from $from\");\n\t\t\treturn true;\n\t\t}\n\t}",
"public function validateUrl($url);",
"function fourzerofour_options_validate($input){\r\r\n $url_redirect = $input['fourzerofour_url'];\r\r\n\tif(empty($url_redirect)) return $url_redirect;\r\r\n if(strpos($url_redirect,'http://')===false){\r\r\n $url_redirect = 'http://'.$url_redirect;\r\r\n }\r\r\n $validated['fourzerofour_url'] = $url_redirect;\r\r\n return $validated;\r\r\n}",
"function isValidURL($url)\n{\n return preg_match('|^(ht)?(f)?tp(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);\n}",
"private function checkUrl()\n {\n if ($this->route !== strtolower($this->route)) {\n http_response_code(301);\n header('location: ' . strtolower($this->route));\n }\n }",
"function drstk_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"function makeHTAccess() {\n\t\t$out = false;\n\t\t$self = rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/';\t// relative self path\n\t\t$path = rtrim(dirname($_SERVER['SCRIPT_FILENAME']), '/') . '/'; // also PATH_TRANSLATED?\n\t\t$htaccess = $path . '.htaccess';\n\t\t\n\t\tif (file_exists($htaccess) && is_writable($htaccess)\n\t\t\t|| is_writable($path)) {\n\t\t\t// ****** Prepare text\n\t\t\t$content = '';\n\t\t\t$content .= \"\\n\\n\";\n\t\t\t$content .= '<IfModule mod_rewrite.c>' . \"\\n\";\n\t\t\t$content .= ' RewriteEngine On' . \"\\n\";\n\t\t\t$content .= ' RewriteBase ' . str_replace(\" \", \"%20\", $self) . \"\\n\";\n\t\t\t$content .= ' RewriteCond %{REQUEST_FILENAME} !-f' . \"\\n\";\n\t\t\t$content .= ' RewriteCond %{REQUEST_FILENAME} !-d' . \"\\n\";\n\t\t\t$content .= ' RewriteRule . ' . str_replace(\" \", \"\\ \", $self) . 'index.php [L]' . \"\\n\";\n\t\t\t$content .= '</IfModule>' . \"\\n\";\n\t\t\t$content .= \"\\n\";\n\t\t\t\n\t\t\t// ****** Existence check\n\t\t\t$old = file_get_contents($htaccess);\n\t\t\t\n\t\t\tif (strpos($old, $content) === false) {\n\t\t\t\t// ****** Write the mod_rewrite rules\n\t\t\t\t$hfile = @fopen($htaccess, 'a');\n\t\t\t\tif ($hfile) {\n\t\t\t\t\t// *** Write\n\t\t\t\t\tif (@fwrite($hfile, $content) !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Rewrites written!\n\t\t\t\t\t\t$out = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@fclose($hfile);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The Rewrites are already there!\n\t\t\t\t$out = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $out;\n\t}",
"function suggestFriendlyUrls()\n{\n\treturn !empty($_SERVER[\"REQUEST_URI\"]);\n}",
"function htaccess_rewrite(){\n\tglobal $SETTINGS;\n\n\t$Plugins = Plugins::getInstance( );\n\n\tif(function_exists('apache_get_modules')){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n \t\terror('The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">Apache Module mod_rewrite</a> for more details.','Apache Error');\n\t}\n\n\t$htaccess=\n\t\t\"# .htaccess - Furasta.Org\\n\".\n\t\t\"<IfModule mod_deflate.c>\\n\".\n \t\"\tSetOutputFilter DEFLATE\\n\".\n\t\t\"\tHeader append Vary User-Agent env=!dont-vary\\n\".\n \t\"</IfModule>\\n\\n\".\n\n \t\"php_flag magic_quotes_gpc off\\n\\n\".\n\n\t\t\"RewriteEngine on\\n\".\n\t\t\"RewriteCond %{SCRIPT_NAME} !\\.php\\n\".\n\t\t\"RewriteRule ^admin[/]*$ /admin/index.php [L]\\n\".\n\t \"RewriteRule ^sitemap.xml /_inc/sitemap.php [L]\\n\".\n\t\t\"RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1 [QSA,L]\\n\\n\".\n\n\t\t\"AddCharset utf-8 .js\\n\".\n\t\t\"AddCharset utf-8 .xml\\n\".\n\t\t\"AddCharset utf-8 .css\\n\".\n \"AddCharset utf-8 .php\";\n\n\t$htaccess = $Plugins->filter( 'general', 'filter_htaccess', $htaccess );\n\n\tfile_put_contents(HOME.'.htaccess',$htaccess);\n\t$_url='http://'.$_SERVER[\"SERVER_NAME\"].'/';\n\t\n\tif($SETTINGS['index']==0){\n\t\t$robots=\n\t\t\"# robots.txt - Furasta.Org\\n\".\n\t\t\"User-agent: *\\n\".\n\t\t\"Disallow: /admin\\n\".\n\t\t\"Disallow: /install\\n\".\n\t\t\"Disallow: /_user\\n\".\n\t\t\"Sitemap: \".$_url.\"sitemap.xml\";\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots=\n \"# robots.txt - Furasta.Org\\n\".\n \"User-agent: *\\n\".\n \"Disallow: /\\n\";\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n }\n\treturn file_put_contents(HOME.'robots.txt',$robots);\n}",
"public function htaccess_admin_settings_generate_validate($form, &$form_state) {\n $profile_name = $form_state['values']['htaccess_settings_generate_name'];\n\n if(preg_match('/[^a-z0-9]/', $profile_name)) {\n form_error($form, t('The name of the profile must be lowercase and without any special character.'));\n }\n // The name of the profile must be unique\n $htaccess_name = db_select('htaccess', 'h')\n ->fields('h')\n ->condition('name', $profile_name, '=')\n ->execute()\n ->fetchAssoc();\n\n if($htaccess_name){\n form_error($form, t('The profile @profile already exists.', array('@profile' => $profile_name)));\n }\n }",
"public function checkUrl() {\r\n\r\n\t\t// Get the user's current URL\r\n\t\t$pageURL = (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\" ? \"https://\" : \"http://\") . $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\r\n\r\n\t\t// Parse the URL, and reform it with the query string omitted\r\n\t\t$parsedURL = parse_url($pageURL);\r\n\r\n if ( $parsedURL['path'] == '/' ) $parsedURL['path'] = str_replace(APP_ROOT, '', $this->filename);\r\n\r\n\t\t$constructedURL = $parsedURL['scheme'] . '://' . $parsedURL['host'] . $parsedURL['path'];\r\n\r\n\t\t// Compare the user's current URL with the proper constructed URL and see if they match\r\n return (isset($this->url, $this->requestPath) && $this->url === $constructedURL);\r\n\t}",
"function validUrl ($url)\r\n\t{\r\n\t\treturn (!ereg('^http://',$url));\r\n\t}",
"function env_check(){\n// if (in_array('mod_rewrite', apache_get_modules())){\n// echo 'mod_rewrite is installed';\n// } else {\n// echo 'mod_rewrite is NOT installed';\n// }\n return true;\n}",
"function checkUrl($ss__url='')\n\t\t{\n\t\t\t//if(eregi(\"^http://[a-z0-9]{1}[-_./~a-z0-9]{1,}[a-z0-9?&=:]{0,}$\",$ss__url))\n\t\t\tif(preg_match(\"/^(http|https|ftp):\\/\\/([a-z0-9]([a-z0-9_-]*[a-z0-9])?\\.)+[a-z]{2,6}\\/?([a-z0-9\\?\\._-~&#=+%]*)?/\", $ss__url))\n\t\t\treturn false;\n\t\t\treturn true;\t\t\n\t\t}",
"function digidiss_home_url_validation($input){\n $url_base = '';\n $parts = explode(\"/\", $input);\n foreach ($parts as $part) {\n if ($part != '') {\n $safe_part = sanitize_title($part);\n if ($safe_part) {\n $url_base .= sanitize_title($part);\n $url_base .= '/';\n }\n }\n }\n return $url_base;\n}",
"function iin_panels_extras_url_param_bypass_ctools_access_check($conf, $context) {\n // If for some unknown reason that $context isn't set, we just want to be sure.\n //if (empty($context) || empty($context->data)) {\n // return FALSE;\n //}\n\n // Grab the setting for this instance and compare it to the url parameters from the context\n $param = $conf['url_param'];\n \n //grab the indexed version of $_GET\n //$url_params = $context->data['query_index'];\n \n //foreach($url_params as $key => $val) {\n if (!empty($_GET)) {\n\t \n\t foreach ($_GET as $key => $val) {\n\t\t if (!empty($val)) {\n\t\t\t if (strpos($param, $val) !== FALSE) {\n\t\t\t\t return TRUE;\n\t\t\t }\n\t\t }\n\t\t \n\t }\n }\n \n}",
"function is_url_rewrite()\n{\n if (!is_file(PH7_ROOT_INSTALL . '.htaccess')) {\n return false;\n }\n\n // Check if mod_rewrite is installed and is configured to be used via .htaccess\n $sHttpModRewrite = (string)getenv('HTTP_MOD_REWRITE');\n if (!$bIsRewrite = (strtolower($sHttpModRewrite) === 'on')) {\n $sOutputMsg = 'mod_rewrite Works!';\n\n if (!empty($_GET['a']) && $_GET['a'] === 'test_mod_rewrite') {\n exit($sOutputMsg);\n }\n\n $sPage = @file_get_contents(PH7_URL_INSTALL . 'test_mod_rewrite');\n $bIsRewrite = ($sPage === $sOutputMsg);\n }\n\n return $bIsRewrite;\n}",
"function stsform_form_validate($form, &$form_state) {\r\n\t$url = $form_state['values']['stsform_URL'];\r\n\t$forwarding = $form_state['values']['stsform_status'];\r\n\t$stsform_defaultStatus = variable_get('stsform_defaultStatus');\r\n\t$url = trim($url); \r\n\r\n\t//If no default URL is specified and forwarding is on\r\n\tif (($forwarding == 1) && ($stsform_defaultStatus == 0)) {\r\n\t\tif ($url == \"\") {\r\n\t\t\tform_set_error('stsform_URL', 'Please enter a url.');\r\n\t\t}\r\n\t} \r\n}",
"abstract protected function validateRequest($request);",
"private function checkDisabledUris()\n\t{\n\t\tif ($this->uri) {\n\n\t\t\t$disabledPatterns = [\n\t\t\t\t'wordpress',\n\t\t\t\t'wp-includes',\n\t\t\t\t'wp-admin',\n\t\t\t\t'autodiscover',\n\t\t\t];\n\n\t\t\tforeach ($disabledPatterns as $pattern) {\n\t\t\t\tif (preg_match('/' . $pattern . '/', $this->uri)) {\n\t\t\t\t\t$this->event->setResponse(new RedirectResponse($this->request->getSchemeAndHttpHost(), 301));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function securepages_can_alter_url($url) {\n global $base_path, $base_url;\n\n $url = @parse_url($url);\n\n // If there is no scheme then it is a relative url and can be altered\n if (!isset($url['scheme']) && $base_path == '/') {\n return TRUE;\n }\n\n // If the host names are not the same then don't allow altering of the path.\n $http_host = \\Drupal::request()->server->get('HTTP_HOST');\n if (isset($url['host']) && strtolower($url['host']) != strtolower($http_host)) {\n return FALSE;\n }\n\n if (strlen($base_path) > 1 && substr($base_url, -1) != substr($url['path'], 1, strlen($base_path))) {\n return FALSE;\n }\n\n return TRUE;\n }",
"public function check_uri() {\r\n\r\n /* Load the cached access control list or show error */\r\n (is_file($cached_acl = $this->_cache_path . 'mx_acl' . EXT)) OR show_error($this->_config['error_msg']);\r\n\r\n $acl = include $cached_acl;\r\n\r\n /* Match current url to access list */\r\n if (is_array($acl) AND $acl = $this->match_uri($this->current_uri(), $acl)) {\r\n\r\n /* Check session group against access level group */\r\n $allow_access = (bool) (in_array($this->session->userdata($this->_config['session_var']), $acl['allowed']));\r\n\r\n /* Additional check to allow IP addresses in range */\r\n if (!$allow_access AND isset($acl['ipl']))\r\n $allow_access = $this->check_ip($acl['ipl']);\r\n\r\n if ($allow_access == FALSE) {\r\n\r\n /* Set a return url into the session */\r\n $this->session->set_userdata('return_url', $this->uri->uri_string());\r\n\r\n /* set the error message... */\r\n $error_msg = (isset($acl['error_msg'])) ? $acl['error_msg'] : $this->_config['error_msg'];\r\n\r\n /* set a flash message... */\r\n $this->session->set_flashdata($this->_config['error_var'], $error_msg);\r\n\r\n /* redirect to absolute url */\r\n die(header(\"Location: \" . $acl['error_uri'], TRUE, 302));\r\n }\r\n }\r\n }"
] | [
"0.6302439",
"0.6198725",
"0.61888903",
"0.60437334",
"0.60204834",
"0.6014628",
"0.59985733",
"0.58876896",
"0.58639336",
"0.57597995",
"0.5754988",
"0.5750559",
"0.5746267",
"0.5718843",
"0.5644272",
"0.5625912",
"0.5623129",
"0.5618014",
"0.5617318",
"0.5611741",
"0.5609441",
"0.56030023",
"0.5575571",
"0.556731",
"0.5558357",
"0.5556567",
"0.55481404",
"0.55430686",
"0.55301124",
"0.55206805"
] | 0.67931575 | 0 |
Validation routine for web override port. | function validate_web_override_port($port)
{
clearos_profile(__METHOD__, __LINE__);
if (! Network_Utils::is_valid_port($port))
return lang('flexshare_port_invalid');
if ($port == self::DEFAULT_PORT_WEB)
return lang('flexshare_non_custom_port_warning');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_ftp_override_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n if (($port == self::DEFAULT_PORT_FTP) || ($port == self::DEFAULT_PORT_FTPS))\n return lang('flexshare_non_custom_port_warning');\n }",
"function ipAndPortValidator($serverIPAddress, $serverPort)\r\n{\r\n\t//So, now that we have the IP address and port from our source of choice, MAKE SURE to validate them before we go ANY further!\r\n\tif($serverPort != \"\") $serverPort = numericValidator($serverPort, 1, 65535, 29070);\r\n\tif($serverIPAddress != \"\") $serverIPAddress = ipAddressValidator($serverIPAddress);\r\n\r\n\t//Check for path exploits\r\n\tif(strpos($serverPort, \"..\") !== false || strpos($serverIPAddress, \"..\") !== false)\r\n\t{\r\n\t\tdisplayError(\"Server address exploit detected! This event has been logged.\", \"\", \"\");\r\n\t\treturn array(\"\", \"\");\r\n\t}\r\n\r\n\treturn array($serverIPAddress, $serverPort);\r\n}",
"public function testIsValidPort(): void\n {\n $testCases = [\n 8000 => true,\n \"8080\" => true,\n \"1.1\" => false,\n \"abc\" => false,\n -999999 => false,\n +999999 => false\n ];\n\n foreach ($testCases as $port => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidPort($port), \"Failed for case '$port'.\");\n }\n }",
"function validate_proxy_port($proxy_port)\n {\n clearos_profile(__METHOD__, __LINE__);\n if (!is_numeric($proxy_port) || $proxy_port < -1 || $proxy_port > 65535)\n return lang('wpad_proxy_port_is_invalid');\n }",
"function set_web_override_port($name, $override_port, $port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($override_port && ($port == 80 || $port == 443))\n throw new Engine_Exception(lang('flexshare_non_custom_port_warning'), CLEAROS_ERROR);\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n $ssl = isset($shares[$name]['WebReqSsl']) ? $shares[$name]['WebReqSsl'] : FALSE;\n\n $inuse_ports = array();\n\n foreach ($shares as $share_name => $share) {\n $ssl_for_share = isset($share['WebReqSsl']) ? $share['WebReqSsl'] : FALSE;\n if (($name != $share_name) && ($ssl != $ssl_for_share))\n $inuse_ports[] = $share['WebPort'];\n }\n\n if ($override_port && (in_array($port, $this->bad_ports) || in_array($port, $inuse_ports)))\n throw new Validation_Exception(lang('flexshare_port_already_in_use'));\n\n $this->_set_parameter($name, 'WebOverridePort', $override_port);\n $this->_set_parameter($name, 'WebPort', $port);\n }",
"function validate_web_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"function validate_passive_port_range($port_min, $port_max)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port_range($port_min, $port_max))\n return lang('flexshare_port_range_invalid');\n\n if ($port_min < 1023 || $port_max < 1023)\n return lang('flexshare_passive_port_below_min');\n }",
"public function validate_host() {\n if (isset($this->initial_data[\"host\"])) {\n # Ensure it is a valid hostname\n if (is_hostname($this->initial_data[\"host\"])) {\n $this->validated_data[\"host\"] = $this->initial_data['host'];\n } else {\n $this->errors[] = APIResponse\\get(2046);\n }\n } else {\n $this->errors[] = APIResponse\\get(2007);\n }\n }",
"protected function canTryAnotherPort()\n {\n return is_null($this->input->getOption('port')) &&\n ($this->input->getOption('tries') > $this->portOffset);\n }",
"public static function validatePort($port)\n {\n if (!is_numeric($port) || $port < 0 || $port > 65535) {\n return false;\n }\n\n return !in_array($port, self::$unsafePorts);\n }",
"function validate_ftp_passive_port($port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_port($port))\n return lang('flexshare_port_invalid');\n }",
"public function checkHost() {\n\t\tif (!$this->host) {\n\t\t\tthrow new URLException(120);\n\t\t}\n\t\t$regexp = '/^\\d{2,3}(\\.\\d{1,3}){3}$/';\n\t\tif (!checkdnsrr($this->host, 'A') && !preg_match($regexp, $this->host)) {\n\t\t\tthrow new URLException(120);\n\t\t}\n\t}",
"protected function checkEndpoint()\n {\n if (0 === strpos($this->endpoint, 'http://')) {\n $this->endpoint = substr($this->endpoint, strlen('http://'));\n $this->useSSL = false;\n } elseif (0 === strpos($this->endpoint, 'https://')) {\n $this->endpoint = substr($this->endpoint, strlen('https://'));\n $this->useSSL = true;\n }\n }",
"protected function checkEndpoint()\n {\n if (0 === strpos($this->endpoint, 'http://')) {\n $this->endpoint = substr($this->endpoint, strlen('http://'));\n $this->useSSL = false;\n } elseif (0 === strpos($this->endpoint, 'https://')) {\n $this->endpoint = substr($this->endpoint, strlen('https://'));\n $this->useSSL = true;\n }\n }",
"public function hasPort() {\n return $this->port != self::MISSING_PORT;\n }",
"function validate_ftp_override_port_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n }",
"function scheck($full,$port=80){\n // default to standard HTTP port\n $this->port = isset($port) ? $port : 80 ;\n\n if(ereg(\"http://\",$full)){\n $this->convert_fqdn($full); \n\t\t// make http connection to server \n $this->open($this->domain,$this->port);\n\t if($this->skip==0){// $this->skip only occurs in HTTP response codes of 301 or 302\n\t\t $this->get($this->doc,\"check\");\n }\n\n\t }else{ \n\t $this->bugout(\"IMPROPER DATA: expects a FQDN like 'http://host/document'\");\n }\n }",
"public function setPort($port)\n {\n // Check port\n if (!preg_match(\"#^[0-9]{1,5}$#\", $port)) return false;\n\n // Add port to the starting-URL\n $url_parts = PHPCrawlerUtils::splitURL($this->starting_url);\n $url_parts[\"port\"] = $port;\n $this->starting_url = PHPCrawlerUtils::buildURLFromParts($url_parts, true);\n \n return true;\n }",
"public static function isValidPort(int|string $port): bool\n {\n return (\n (is_int($port) || boolval(preg_match(\"/^[0-9]+$/\", $port))) &&\n intval($port) >= self::TCP_LOWER_PORT_RANGE &&\n intval($port) <= self::TCP_UPPER_PORT_RANGE\n );\n }",
"public function checkApacheListen(&$toFix)\n {\n\n $this->log('Validating Apache Listen');\n $fixed = false;\n\n foreach (array('/etc/apache2/ports.conf', '/etc/apache2/apache2.conf') as $file) {\n if (!file_exists($file)) {\n continue;\n }\n $content = file_get_contents($file);\n if (preg_match_all('/Listen.*(80|443)/im', $content, $matches)) {\n $newLine = 'Listen 127.0.0.1:${1}';\n $content = preg_replace('/Listen.*(80|443)/im', $newLine, $content);\n file_put_contents($file, $content);\n $fixed = true;\n }\n }\n\n if ($fixed) {\n $this->_apacheRestartRequired = true;\n $this->log(' * Fixed!');\n } else {\n $this->log(' * Listen 80 or Listen 443 not found');\n }\n\n }",
"private function setPort($port)\n {\n $this->_port = $port;\n \n\treturn TRUE;\n }",
"private static function isNonStandardPort(string $scheme, int $port): bool\n {\n return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme];\n }",
"public static function isDefaultPort(array $parsedUrl)\n {\n $scheme = strtolower($parsedUrl['scheme']);\n $port = array_key_exists('port', $parsedUrl) ? $parsedUrl['port'] : $scheme == 'https' ? 443 : 0;\n return $port <= 0 or ($port == 80 and $scheme == 'http') or ($port == 443 and $scheme == 'https');\n }",
"public function validateBindToIp()\n {\n if ($this->bind_to_ip) {\n $ips = explode(',', $this->bind_to_ip);\n\n foreach ($ips as $ip) {\n if (!filter_var(trim($ip), FILTER_VALIDATE_IP)) {\n $this->addError('bind_to_ip', Yii::t('app', \"Wrong format. Enter valid IPs separated by comma\"));\n }\n }\n }\n }",
"public function matchPort(?int $port)\n {\n $this->port = $port;\n }",
"public function guessPortAndTLS() {\n\t\tif(!$this->checkRequirements(array('ldapHost',\n\t\t\t\t\t\t\t\t\t\t ))) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->checkHost();\n\t\t$portSettings = $this->getPortSettingsToTry();\n\n\t\tif(!is_array($portSettings)) {\n\t\t\tthrow new \\Exception(print_r($portSettings, true));\n\t\t}\n\n\t\t//proceed from the best configuration and return on first success\n\t\tforeach($portSettings as $setting) {\n\t\t\t$p = $setting['port'];\n\t\t\t$t = $setting['tls'];\n\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: trying port '. $p . ', TLS '. $t, \\OCP\\Util::DEBUG);\n\t\t\t//connectAndBind may throw Exception, it needs to be catched by the\n\t\t\t//callee of this method\n\t\t\tif($this->connectAndBind($p, $t) === true) {\n\t\t\t\t$config = array('ldapPort' => $p,\n\t\t\t\t\t\t\t\t'ldapTLS' => intval($t)\n\t\t\t\t\t\t\t);\n\t\t\t\t$this->configuration->setConfiguration($config);\n\t\t\t\t\\OCP\\Util::writeLog('user_ldap', 'Wiz: detected Port '. $p, \\OCP\\Util::DEBUG);\n\t\t\t\t$this->result->addChange('ldap_port', $p);\n\t\t\t\treturn $this->result;\n\t\t\t}\n\t\t}\n\n\t\t//custom port, undetected (we do not brute force)\n\t\treturn false;\n\t}",
"function fourzerofour_options_validate($input){\r\r\n $url_redirect = $input['fourzerofour_url'];\r\r\n\tif(empty($url_redirect)) return $url_redirect;\r\r\n if(strpos($url_redirect,'http://')===false){\r\r\n $url_redirect = 'http://'.$url_redirect;\r\r\n }\r\r\n $validated['fourzerofour_url'] = $url_redirect;\r\r\n return $validated;\r\r\n}",
"protected function isNonStandardPort($scheme, $port): bool\n {\n return ! isset($this->allowedSchemes[$scheme]) || $this->allowedSchemes[$scheme] !== $port;\n }",
"private function validate()\n\t{\n\t\tif ($this->useragent != $_SERVER['HTTP_USER_AGENT'] || $this->clientip != $_SERVER['REMOTE_ADDR']) {\n\t\t\t$this->destroy();\n\t\t\tthrow new \\Exception('User IP has changed...');\n\t\t}\n\t}",
"public function testUrlPortSetter()\n {\n $url = new ObjectUrl(self::URL);\n $this->assertEquals(443, $url->setPort(443)->getPort());\n $url->setPort(123456789);\n }"
] | [
"0.6743045",
"0.6713118",
"0.668365",
"0.64661705",
"0.6427954",
"0.62804455",
"0.60794663",
"0.60003036",
"0.5892164",
"0.58893883",
"0.5790553",
"0.570799",
"0.56436336",
"0.56436336",
"0.5586555",
"0.5580514",
"0.5563308",
"0.55311346",
"0.5522321",
"0.5499537",
"0.5498143",
"0.548767",
"0.54582626",
"0.5431658",
"0.5411948",
"0.53832823",
"0.53487736",
"0.53466797",
"0.53232354",
"0.53193057"
] | 0.79578614 | 0 |
Validation routine for PHP state. | function validate_web_php($state)
{
clearos_profile(__METHOD__, __LINE__);
if (! clearos_is_valid_boolean($state))
return lang('base_state_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateState() {\n\t\t$error_message = \"\";\n\n if (!$GLOBALS[\"state\"] == 'vic' && !$GLOBALS[\"state\"] == 'nsw' && !$GLOBALS[\"state\"] == 'qld' && !$GLOBALS[\"state\"] == 'nt' && !$GLOBALS[\"state\"] == 'wa' && !$GLOBALS[\"state\"] == 'sa' || !$GLOBALS[\"state\"] == 'tas' && !$GLOBALS[\"state\"] == 'act' && !$GLOBALS[\"state\"] == \"no-state\") {\n $error_message = $error_message.\"<p>\".$state.\" is not a valid state!</p>\";\n } else if ($GLOBALS[\"state\"] == \"no-state\") {\n $error_message = $error_message.\"<p>State has not been entered.</p>\";\n } else if (!checkPostcode($GLOBALS[\"state\"])) {\n\t\t\t$error_message = $error_message.\"<p>\".$GLOBALS[\"postcode\"].\" is not a valid postcode for \".$GLOBALS[\"state\"].\".</p>\";\n\t\t}\n\n\t\treturn $error_message;\n }",
"function check_valid_state($state)\n{\nif(strlen($state)==0)\n\t{\n\t\techo\"No code given.\\n\";\n\t\treturn false;\n\t}\n\telseif(strlen($state)>2)\n\t{\n\t\techo\"State Code is too long.\\n\";\n\t\treturn false;\n\t}\n\telseif(ctype_alpha($state) == false)\n\t{\n\t\techo\"State code does not contain only alphabet letters.\\n\";\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}",
"public function valid () {}",
"public function valid() {}",
"public function valid() {}",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function valid();",
"public function testStateValidatesCorrectly()\n {\n @$test_store = new SessionStore();\n $test_state = new SessionStateHandler($test_store);\n $uniqid_returned_1 = $test_state->issue();\n \n $this->assertTrue($test_state->validate($uniqid_returned_1));\n $this->assertNull($test_store->get(SessionStateHandler::STATE_NAME));\n \n $uniqid_returned_2 = $test_state->issue();\n $this->assertFalse($test_state->validate($uniqid_returned_2 . 'false'));\n }",
"public function isValidstate() {\n\t\treturn $this->validstate;\n\t}",
"public function validateEventState(string $state): void;",
"function validate_web_cgi($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"abstract protected function validate();",
"abstract protected function validate();",
"public function valid(){ }",
"function valid() {}",
"function venture_deal_validate_state($element) {\n global $form_values;\n if ($form_values['field_deal_country']['key'] == 'United States') {\n if (!$form_values['field_deal_state']['key']) {\n form_set_error('field_deal_state', 'State field is required.');\n }\n }\n}",
"abstract protected function validation();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"public function validateInput() {}"
] | [
"0.6976255",
"0.6744305",
"0.6739544",
"0.6560613",
"0.6560613",
"0.6551257",
"0.6551257",
"0.6551257",
"0.6551257",
"0.6551257",
"0.6551257",
"0.6522753",
"0.6511036",
"0.65053034",
"0.64840424",
"0.6479824",
"0.6479824",
"0.6429783",
"0.6423051",
"0.6393938",
"0.6387522",
"0.6384366",
"0.6384366",
"0.6384366",
"0.6384366",
"0.6384366",
"0.6384366",
"0.6384366",
"0.6384366",
"0.63115484"
] | 0.7450502 | 0 |
Validation routine for web show index. | function validate_web_show_index($state)
{
clearos_profile(__METHOD__, __LINE__);
if (! clearos_is_valid_boolean($state))
return lang('base_state_invalid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexValidate();",
"function bibdk_custom_search_edit_page_validate($form, &$form_state) {\n return TRUE;\n}",
"function verify_home() {\n //Validation Rules\n $this->form_validation->set_rules('title','Title','trim|required|min_length[4]|xss_clean');\n $this->form_validation->set_rules('description','Description','trim|required|xss_clean');\n $this->form_validation->set_rules('button_title','Button Title','trim|required|xss_clean');\n $this->form_validation->set_rules('button_link','Button Link','trim|required|xss_clean');\n $this->form_validation->set_rules('published','Publish','required');\n\n if (!$this->form_validation->run()) {\n return false ;\n } else {\n return true;\n }\n }",
"function index() {\n\t\t$this->validate();\n\t\t$this->advanced();\n\t}",
"function index() {\r\n\t\t$this->validate();\r\n\t\t$this->advanced();\r\n\t}",
"public function shouldIndex();",
"static public function showInvalidAction(): void\n {\n $erroHandler = new ErrorHandler(ENVIROMENT);\n $erroHandler->showDevMessages(\"Acción inexistente para la url\",\n \"Puede que este intentado realizar una acción que no exista, por ejemplo, para un controlador foo que tenga una acción bar la ruta seria http://dominio/foo/bar\",\n $_SERVER['REQUEST_URI']);\n }",
"function islandora_webpage_admin_validate($form, &$form_state) {\n \n}",
"protected function validateDocument()\n {\n // no-op\n }",
"abstract protected function validation();",
"public function valid()\n {\n\t\tif($_GET[\"echostr\"])\n\t\t{\n\t\t\t$echoStr = $_GET[\"echostr\"];\n\t\t\tif($this->checkSignature())\n\t\t\t{\n\t\t\t\techo $echoStr;\n\t\t\t\texit;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->responseMsg();\t\n\t\t}\n }",
"public function clientSideValidation($view)\n\t{\n\t}",
"public function isValid()\r\n {\r\n return @$this->schemaValidate(__DIR__ . DIRECTORY_SEPARATOR . 'page.xsd');\r\n }",
"public function validateSite()\n {\n $validationStatus = (\n is_dir($this->siteDir)\n && file_exists($this->siteDir.'/index.html')\n && filesize($this->siteDir.'/index.html') > 0\n && is_dir($this->siteDir.'/espanol')\n && file_exists($this->siteDir.'/espanol/index.html')\n && filesize($this->siteDir.'/espanol/index.html') > 0\n );\n \n if ( empty($validationStatus) ){\n $this->log(\"Validate Site: Empty Site \\n\");\n }\n else $this->log(\"Validate Site: Valid\\n\");\n\n return $validationStatus;\n \n /*\n if ( empty($this->pagesByUrl) )\n {\n $this->log(\"Validate Site: no site found to validate\\n\");\n return null;\n }\n $requiredPages = 0;\n $renderedPages = 0;\n /// shouldn't be duplicating the logic here, it's too easy to break\n foreach ( $this->pagesByUrl as $url=>&$page )\n {\n /// only validate pages that should be generated\n if ( array_key_exists('generate_page',$page) && $page['generate_page']!='yes' )\n {\n continue;\n }\n $requiredPages++;\n $pageDir = rtrim( $this->siteDir.'/'.trim($url,'/'), '/' );\n $pageFile = $pageDir.'/index.html';\n\n if ( $this->validatePage($pageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$url} : {$page['uuid']}\\n\");\n }\n\n /// some special pages generate further sub-pages\n if ( $page['pageType'] == 'AZPage' )\n {\n /// add for-use-by \n foreach ( $this->siteIndexAZ as $letter => $list )\n {\n $requiredPages++;\n $subUrl = $url.'/'.strtolower($letter);\n $subPageDir = rtrim( $pageDir.'/'.trim(strtolower($letter),'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n\n if ( isset($page['az_index_data_source']) \n && $page['az_index_data_source'] == 'directory-records-federal' )\n {\n foreach ( $page['for_use_by'] as $fub )\n {\n if ( !array_key_exists($fub,$this->directoryRecordGroups) ) { continue; }\n foreach ( $this->directoryRecordGroups[$fub]['all']['Federal Agencies']['all'] as $agencyInfo )\n {\n $requiredPages++;\n $agency = $this->source->entities[$agencyInfo['uuid']];\n\n $urlSafeTitle = $this->sanitizeForUrl($agency['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n //$this->log(\"**Valid: {$subUrl} // {$agency['title']}\\n\");\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl} // {$agency['title']} // {$agency['uuid']}\\n\");\n } \n }\n }\n }\n } else if ( $page['pageType'] == '50StatePage' ) {\n if ( !empty($page['usa_gov_50_state_category']) \n && preg_match('/^autogenerate\\-(.*)/',$page['usa_gov_50_state_category']) )\n {\n foreach ( $this->stateAcronyms as $stateAcronym=>$stateName ) \n {\n $requiredPages++;\n $subUrl = $url.'/'.$this->sanitizeForUrl($stateName);\n if ( !empty($page['usa_gov_50_state_prefix']) )\n {\n $subUrl = $page['usa_gov_50_state_prefix']\n .'/'.$this->sanitizeForUrl($stateName);\n }\n $subPageDir = rtrim( $this->siteDir.'/'.trim($subUrl,'/'), '/' );\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n } else if ( $page['pageType'] == 'Features' ) {\n \n foreach ( $page['for_use_by'] as $fub )\n {\n foreach ( $this->features[$fub] as $feature ) \n {\n $requiredPages++;\n $urlSafeTitle = $this->sanitizeForUrl($feature['title']);\n $subUrl = $url.'/'.$urlSafeTitle;\n $subPageDir = rtrim( $pageDir.'/'.$urlSafeTitle, '/');\n $subPageFile = $subPageDir.'/index.html';\n if ( $this->validatePage($subPageFile) )\n {\n $renderedPages++;\n } else {\n $this->log(\"Invalid: {$subUrl}\\n\");\n } \n }\n }\n }\n }\n $this->log(\"Site Validation: $renderedPages of $requiredPages pages rendered to /sites/{$this->config['siteName']} \\n\");\n return ($requiredPages <= $renderedPages);\n */\n }",
"function inbound_checker_form_list_validate($form, &$form_state) {\n // Check the keyword text field in settings tab for it isn't empty.\n if (!variable_get('inbound_checker_keyword', '')) {\n form_set_error('inbound_checker_check_zeros', t('Please fill the keyword textfield in settings tab.'));\n }\n // Check available sites.\n // TODO: @sepehr: Use module's API when ready.\n if ($form_state['values']['inbound_checker_check_zeros']) {\n $results = db_result(db_query(\"SELECT COUNT(icid) FROM {inbound_checker} WHERE count = 0\"));\n if (!$results) {\n form_set_error('inbound_checker_check_zeros', t('There were no links to check.'));\n }\n }\n}",
"protected function validate()\n\t{\n\t\t$id\t\t= $this->getData($this->getArgument());\n\t\t$news\t= $this->getContext()->getModel('NewsManager', 'News')->retrieveById($id);\n\t\t$lang\t= $this->getContext()->getTranslationManager()\n\t\t\t\t\t ->getCurrentLocale()->getLocaleLanguage();\n\n\t\t// Checking for existance!\n\t\tif ($news == null || empty ($news[$lang])) {\n\t\t\t$this->throwError();\n\t\t\treturn false;\n\t\t}\n\n\t\t// Pass fetched News object to EditAction\n\t\t$this->export($news, 'news');\n\t\treturn true;\n\t}",
"public function validate();",
"public function validate();",
"public function validate();",
"public static function validate() {}",
"function validHome()\r\n{\r\n}",
"function page_validator() {\n $f = $this->add('Form');\n $f->addField('large_number')->validate('>1000?is not large enough');\n $f->addField('mandatory')->validate('required');\n $f->addField('mandatory2')->validateNotNull();\n $f->addSubmit();\n\n $f->onSubmit(function($f){\n return 'all good';\n });\n }",
"public function validate() {\n\t\t\n\t\t$data = $this->getData();\n\t\t\n\t\tif(!isset($data['title']) || empty($data['title'])) {\n\t\t\tGregory::get()->addError('Vous devez entrer un titre');\n\t\t}\n\t\t\n\t\tif(!isset($data['date']) || empty($data['date'])) {\n\t\t\tGregory::get()->addError('Vous devez entrer une date');\n\t\t}\n\t\t\n\t\tif(isset($data['date']) && !preg_match('/^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$/',$data['date'])) {\n\t\t\tGregory::get()->addError('Vous devez entrer une date au format AAAA-MM-JJ');\n\t\t}\n\t\t\n\t\tif(Gregory::get()->hasErrors()) throw new Exception('Votre formulaire contient des erreurs');\n\t\t\n\t}",
"abstract protected function validate();",
"abstract protected function validate();",
"static function valid_content_page_fields($array)\n {\n return isset($array['title']) && isset($array['menu']) \n && isset($array['index']) && ((isset($array['js']) \n && (count($array) === 4)) || (count($array) === 3));\n }",
"public function valid(&$err = null) {\n $err = array();\n $ret = true;\n \n if (!$this->is_valid_dir()) {\n $err['dir'] = get_string('invalidindexerror', 'search');\n $ret = false;\n }\n \n if (!$this->is_valid_db()) {\n $err['db'] = get_string('emptydatabaseerror', 'search');\n $ret = false;\n }\n \n if (!$this->complete) {\n $err['index'] = get_string('uncompleteindexingerror','search');\n $ret = false;\n }\n \n return $ret;\n }",
"public function valid () {}",
"function wid_not_set() {\n $check = new check;\n if ( ! isset($_GET['workout_id']) || strlen($_GET['workout_id']) < 1 ) {\n $check->set_error('Missing workout_id', 'index.php');\n }\n }",
"function index()\n {\n $this->vew->render('error/index');\n // echo \"This page doesn't exist\";\n }"
] | [
"0.71227604",
"0.5787052",
"0.5730732",
"0.5701568",
"0.5700744",
"0.5677468",
"0.566843",
"0.563516",
"0.5599532",
"0.5593324",
"0.55191284",
"0.55137223",
"0.54767686",
"0.5472372",
"0.5454507",
"0.5451009",
"0.543726",
"0.543726",
"0.543726",
"0.5436931",
"0.5435637",
"0.5412641",
"0.53992456",
"0.5398197",
"0.5398197",
"0.53807044",
"0.53755844",
"0.5374958",
"0.5372445",
"0.5371398"
] | 0.693015 | 1 |
///////////////////////////////////////////////////////////////////////////// P R I V A T E M E T H O D S ///////////////////////////////////////////////////////////////////////////// Create the Samba configuration files for the specificed flexshare. | protected function _generate_file_flexshares()
{
clearos_profile(__METHOD__, __LINE__);
if (!clearos_library_installed('samba_common/Samba'))
return;
$samba = new Samba();
if (! $samba->is_file_server())
return;
// Create a unique file identifier
$backup_key = time();
// Backup original file
$backup = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);
if ($backup->exists()) {
$backup->move_to(self::PATH_TEMP . "/$backup_key.bak");
$backup_exists = TRUE;
} else {
$backup_exists = FALSE;
}
// Samba is slightly different. We dump all flexshare-related 'stuff' in one file
$file = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);
if ($file->exists())
$file->delete();
$file->create('root', 'root', '0644');
$shares = $this->_get_shares(self::TYPE_ALL);
$linestoadd = '';
// Recreate samba flexshare.conf
foreach ($shares as $name => $share) {
// If not enabled, continue through loop - we're re-creating lines here
if (! isset($share['ShareEnabled']) || ! $share['ShareEnabled'])
continue;
if (! isset($share['FileEnabled']) || ! $share['FileEnabled'])
continue;
$linestoadd .= "[" . $name . "]\n";
$linestoadd .= "\tpath = " . $share["ShareDir"] . "\n";
$linestoadd .= "\tcomment = " . $share["FileComment"] . "\n";
$linestoadd .= "\tbrowseable = Yes\n";
if ((int)$share["FilePermission"] == self::PERMISSION_READ_WRITE)
$linestoadd .= "\tread only = No\n";
if (isset($share["FilePublicAccess"]) && $share["FilePublicAccess"]) {
$linestoadd .= "\tguest ok = Yes\n";
} else {
$linestoadd .= "\tguest ok = No\n";
$linestoadd .= "\tdirectory mask = 0775\n";
$linestoadd .= "\tcreate mask = 0664\n";
$linestoadd .= "\tvalid users = @\"%D" . '\\' . trim($share["ShareGroup"]) . "\", @" .
trim($share["ShareGroup"]) . "\n";
}
$linestoadd .= "\tveto files = /.flexshare*/\n";
$vfsobject = "";
if (isset($share["FileRecycleBin"]) && $share["FileRecycleBin"]) {
$vfsobject .= " recycle:recycle";
$linestoadd .= "\trecycle:repository = .trash/%U\n";
$linestoadd .= "\trecycle:maxsize = 0\n";
$linestoadd .= "\trecycle:versions = Yes\n";
$linestoadd .= "\trecycle:keeptree = Yes\n";
$linestoadd .= "\trecycle:touch = No\n";
$linestoadd .= "\trecycle:directory_mode = 0775\n";
}
if (isset($share["FileAuditLog"]) && $share["FileAuditLog"]) {
$vfsobject .= " full_audit:audit";
$linestoadd .= "\taudit:prefix = %u\n";
$linestoadd .= "\taudit:success = open opendir\n";
$linestoadd .= "\taudit:failure = all\n";
$linestoadd .= "\taudit:facility = LOCAL5\n";
$linestoadd .= "\taudit:priority = NOTICE\n";
}
if ($vfsobject)
$linestoadd .= "\tvfs object =$vfsobject\n";
$linestoadd .= "\n";
}
$file->add_lines($linestoadd);
// Make sure Samba has flexshare include
//--------------------------------------
$samba->add_include('/etc/samba/flexshare.conf');
// Validate smbd configuration
//----------------------------
$config_ok = TRUE;
try {
$shell = new Shell();
$options['validate_exit_code'] = FALSE;
$exitcode = $shell->execute(self::CMD_VALIDATE_SMBD, '-s', FALSE, $options);
} catch (Exception $e) {
$config_ok = FALSE;
clearos_log(self::LOG_TAG, "Invalid Samba config: " . clearos_exception_message($e));
}
if ($config_ok) {
// Delete backups
if ($backup_exists)
$backup->delete();
} else {
// Recover backups
if ($backup_exists) {
try {
$backup->move_to(self::SMB_VIRTUAL_HOST_PATH . "/" . self::FILE_SMB_VIRTUAL);
} catch (Exception $e) {
// Supresss error here...could be same file
}
}
throw new Engine_Exception(lang('flexshare_config_validation_failed'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _generate_ftp_flexshares()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('ftp/ProFTPd'))\n return;\n\n $confs = array();\n $proftpd = new ProFTPd();\n\n // Create a unique file identifier\n $backup_key = time();\n\n // Get file listing in FTP confs dir\n $folder = new Folder(self::FTP_VIRTUAL_HOST_PATH);\n\n if (!$folder->exists())\n return;\n\n $confs = $folder->get_listing();\n $index = 0;\n\n foreach ($confs as $conf) {\n if (preg_match(\"/^\" . self::PREFIX . \".*conf$/i\", $conf)) {\n $conf_file = new File(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $conf);\n // Backup existing file\n $conf_file->move_to(self::PATH_TEMP . \"/$conf.$backup_key.bak\");\n } else {\n unset($confs[$index]);\n }\n\n $index++;\n }\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n $ftps_filename = '';\n\n // Recreate all virtual configs\n foreach ($shares as $name => $share) {\n\n $newlines = array();\n $append = FALSE;\n\n // If not enabled, continue through loop - we're re-creating lines here\n if (!isset($share['ShareEnabled']) || !$share['ShareEnabled'])\n continue;\n\n if (!isset($share['FtpEnabled']) || !$share['FtpEnabled'])\n continue;\n\n // Add group greeting file\n try {\n // This isn't fatal. Log and continue on exception\n $file = new File(self::SHARE_PATH . \"/$name/.flexshare-group.txt\");\n if ($file->exists())\n $file->delete();\n\n if ($share['FtpGroupGreeting']) {\n $file->create(\"root\", \"root\", 644);\n $file->add_lines($share['FtpGroupGreeting'] . \"\\n\");\n }\n } catch (Exception $e) {\n //\n }\n\n // Need to know which file we'll be writing to.\n // We determine this by port\n // Ie. /etc/proftpd.d/flex-<port>.conf\n\n // Port\n if ($share['FtpOverridePort'])\n $port = $share['FtpPort'];\n else\n $port = self::DEFAULT_PORT_FTP;\n\n // Passive mode flag\n $pasv = '';\n if ($share['FtpAllowPassive'])\n $pasv = ' PASV';\n\n // Overwrite permission\n if ((int)$share['FtpGroupPermission'] == self::PERMISSION_WRITE_PLUS)\n $group_write = 'on';\n else if ((int)$share['FtpGroupPermission'] == self::PERMISSION_READ_WRITE_PLUS)\n $group_write = 'on';\n else\n $group_write = 'off';\n\n // Create new file in parallel\n $filename = self::PREFIX . $port . '.conf';\n $ftps_filename = self::PREFIX . '990' . '.conf';\n\n // Add to confs array in case of failure\n if (!in_array($filename, $confs))\n $confs[] = $filename;\n\n $file = new File(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $filename);\n $tempfile = new File(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $filename . '.cctmp');\n\n if ($tempfile->exists())\n $tempfile->delete();\n\n $tempfile->create('root', 'root', '0644');\n\n if ($file->exists()) {\n $oldlines = $file->get_contents_as_array();\n $found_start = FALSE;\n\n $linestoadd = \"\";\n foreach ($oldlines as $line) {\n if (preg_match(\"/^\\s*# DNR:Webconfig start - $name$/\", $line))\n $found_start = TRUE;\n\n if ($found_start && preg_match(\"/^\\s*# DNR:Webconfig end - $name$/\", $line)) {\n $found_start = FALSE;\n continue;\n }\n\n if ($found_start)\n continue;\n\n $linestoadd .= $line . \"\\n\";\n\n // We need to know if we are working on top of another define or not\n $append = TRUE;\n }\n\n $tempfile->add_lines($linestoadd);\n }\n\n try {\n $proftpd_conf = new File(ProFTPd::FILE_CONFIG);\n $proftpd_conf->lookup_line(\"/Include \\/etc\\/proftpd.d\\/\\*.conf/i\");\n } catch (File_No_Match_Exception $e) {\n // Need this line to include flexshare confs\n $proftpd_conf->add_lines(\"Include /etc/proftpd.d/*.conf\\n\");\n } catch (Exception $e) {\n throw new Engine_Exception(clearos_exception_message($e), CLEAROS_ERROR);\n }\n\n if (! $append) {\n $newlines[] = self::WRITE_WARNING;\n // Note: event system will automatically handle IP address changes.\n $iface_manager = new Iface_Manager();\n $external_ips = $iface_manager->get_external_ip_addresses();\n $trusted_ips = $iface_manager->get_most_trusted_ips();\n\n $ips = array_merge($external_ips, $trusted_ips);\n $ip_list = implode(' ', array_unique($ips));\n\n $newlines[] = \"<VirtualHost $ip_list>\";\n $newlines[] = \"\\tPort $port\";\n $newlines[] = \"\\tDefaultRoot \" . self::SHARE_PATH . \"/\";\n $newlines[] = \"\\tRequireValidShell off\";\n $newlines[] = \"\\tAuthPam on\";\n $newlines[] = \"\\tAuthPAMConfig proftpd\";\n\n if ($share[\"FtpPassivePortMin\"] && $share[\"FtpPassivePortMax\"])\n $newlines[] = \"\\tPassivePorts \" . $share[\"FtpPassivePortMin\"] . \" \" . $share[\"FtpPassivePortMax\"];\n\n $newlines[] = \"\\tCapabilitiesEngine on\";\n $newlines[] = \"\\tCapabilitiesSet +CAP_CHOWN\";\n\n $newlines[] = \"\";\n $newlines[] = \"\\t<Limit LOGIN CDUP PWD XPWD LIST PROT$pasv>\";\n $newlines[] = \"\\t\\tAllowAll\";\n $newlines[] = \"\\t</Limit>\";\n $newlines[] = \"\\t<Limit ALL>\";\n $newlines[] = \"\\t\\tDenyAll\";\n $newlines[] = \"\\t</Limit>\";\n $newlines[] = \"\";\n\n // FTPES (SSL)\n // if ($share['FtpEnableFtpes']) {\n $newlines[] = \"\\t<IfModule mod_tls.c>\";\n $newlines[] = \"\\t\\tTLSEngine on\";\n $newlines[] = \"\\t\\tTLSLog /var/log/tls.log\";\n $newlines[] = \"\\t\\tTLSOptions NoCertRequest\";\n $newlines[] = \"\\t\\tTLSRequired off\";\n $newlines[] = \"\\t\\tTLSRSACertificateFile /etc/pki/CA/bootstrap.crt\";\n $newlines[] = \"\\t\\tTLSRSACertificateKeyFile /etc/pki/CA/bootstrap.key\";\n $newlines[] = \"\\t\\tTLSVerifyClient off\";\n $newlines[] = \"\\t</IfModule>\";\n $newlines[] = \"\\n\";\n } else {\n if ($share['FtpAllowPassive']) {\n $tempfile->replace_lines(\n \"/\\sPassivePorts \\d+\\s+\\d+/\",\n \"\\tPassivePorts \" . $share['FtpPassivePortMin'] . \" \" . $share['FtpPassivePortMax'] . \"\\n\"\n );\n }\n }\n\n // Add flexshare specific directory directives\n $newlines[] = \"\\t# DNR:Webconfig start - $name\";\n $newlines[] = \"\\t<Directory \" . self::SHARE_PATH . \"/$name>\";\n $newlines[] = \"\\t\\tAllowOverwrite \" . $group_write;\n $newlines[] = \"\\t\\tAllowRetrieveRestart on\";\n $newlines[] = \"\\t\\tAllowStoreRestart on\";\n $newlines[] = \"\\t\\tDisplayChdir .flexshare-group.txt TRUE\";\n $newlines[] = \"\\t\\tHideNoAccess on\";\n $newlines[] = \"\\t\\tHideFiles (.flexshare)\";\n $newlines[] = \"\\t\\tGroupOwner \\\"\" . $share[\"ShareGroup\"] . \"\\\"\";\n $newlines[] = \"\\t\\tUmask 0113 0002\";\n $newlines[] = \"\\t\\t<Limit \" . $this->access[$share['FtpGroupPermission']] . \"$pasv>\";\n $newlines[] = \"\\t\\t AllowGroup \\\"\" . $share['ShareGroup'] . \"\\\"\";\n $newlines[] = \"\\t\\t IgnoreHidden on\";\n $newlines[] = \"\\t\\t</Limit>\";\n $newlines[] = \"\\t\\t<Limit ALL>\";\n $newlines[] = \"\\t\\t DenyAll\";\n $newlines[] = \"\\t\\t</Limit>\";\n\n $newlines[] = \"\\t</Directory>\";\n $newlines[] = \"\\t# DNR:Webconfig end - $name\";\n $newlines[] = \"\";\n\n if ($append) {\n $tempfile->delete_lines(\"/<\\/VirtualHost>/\");\n $tempfile->add_lines(implode(\"\\n\", $newlines) . \"\\n</VirtualHost>\\n\");\n } else {\n $tempfile->add_lines(implode(\"\\n\", $newlines) . \"\\n</VirtualHost>\\n\");\n }\n\n $tempfile->move_to(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $filename);\n }\n\n // Validate proftpd configuration before restarting server\n $config_ok = TRUE;\n\n try {\n $options['validate_exit_code'] = FALSE;\n $shell = new Shell();\n // TODO: this fails on DNS lookup issues\n //$exitcode = $shell->execute(self::CMD_VALIDATE_PROFTPD, '-t', TRUE, $options);\n $exitcode = 0;\n } catch (Exception $e) {\n $config_ok = FALSE;\n }\n\n if ($exitcode !== 0) {\n $config_ok = FALSE;\n $output = $shell->get_output();\n clearos_log(self::LOG_TAG, \"Invalid ProFTP configuration!\");\n\n foreach ($output as $line)\n clearos_log(self::LOG_TAG, $line);\n }\n\n foreach ($confs as $conf) {\n // Not a flexshare conf file\n if (!isset($conf))\n continue;\n\n $file = new File(self::PATH_TEMP . \"/$conf.$backup_key.bak\");\n\n if (! $file->exists()) {\n // Conf was newly created\n $file = new File(self::FTP_VIRTUAL_HOST_PATH . \"/$conf\");\n\n if (! $config_ok)\n $file->delete();\n\n continue;\n }\n\n if ($config_ok) {\n // Delete backups\n $file->delete();\n } else {\n // Recover backups\n $file->move_to(self::FTP_VIRTUAL_HOST_PATH . \"/$conf\");\n }\n }\n\n if (!$config_ok)\n throw new Engine_Exception(lang('flexshare_config_validation_failed'));\n\n // Copy to FTPS configuration\n if (!empty($ftps_filename)) {\n $base_config = new File(self::FTP_VIRTUAL_HOST_PATH . '/' . $filename);\n $lines = $base_config->get_contents_as_array();\n $newlines = array();\n\n foreach ($lines as $line) {\n if (preg_match(\"/^\\s*Port\\s+[\\d]+$/\", $line))\n $newlines[] = \"\\tPort 990\";\n else if (preg_match(\"/^\\s*TLSOptions\\s+/\", $line))\n $newlines[] = \"\\t\\tTLSOptions NoCertRequest UseImplicitSSL\";\n else\n $newlines[] = $line;\n }\n\n $file = new File(self::FTP_VIRTUAL_HOST_PATH . '/' . $ftps_filename);\n if ($file->exists())\n $file->delete();\n\n $file->create('root', 'root', '0644');\n $file->dump_contents_from_array($newlines);\n }\n\n if ($config_ok) {\n try {\n $proftpd = new ProFTPd();\n $proftpd->reset(TRUE);\n } catch (Exception $e) {\n // Keep going\n }\n }\n }",
"function gen_astmanproxy_conf()\n{\n\tglobal $__BRD_SUM__;\n\tglobal $__BRD_HEAD__;\n\t$cfg_path = '/etc/asterisk/gw/astmanproxy.conf';\t\n\t$usr_path = '/etc/asterisk/gw/astmanproxy.users';\n\t$default_ast_username = 'internalspecifyuser';\n\t$default_ast_password = '2rujzdndyznbg7u6xju';\n\t$default_amp_username = 'internalspecifyuser';\n\t$default_amp_password = 'xn60qvh9dqx1j6ekcj1';\n\n\tif(!file_exists($cfg_path)){\n\t\ttouch($cfg_path);\n\t}\n\n\t$cluster_info = get_cluster_info();\n\n\t$lock = lock_file($cfg_path);\n\t$contents = \"host = 127.0.0.1, 5038, $default_ast_username, $default_ast_password, off, off\\n\";\n\tif($cluster_info['mode'] == 'master') {\n\t\tfor($b=2; $b<=$__BRD_SUM__; $b++) {\n\t\t\tif(isset($cluster_info[$__BRD_HEAD__.$b.'_ip']) && $cluster_info[$__BRD_HEAD__.$b.'_ip'] != '') {\n\t\t\t\t$ip = $cluster_info[$__BRD_HEAD__.$b.'_ip'];\n\t\t\t\t$contents .= \"host = $ip, 5038, $default_ast_username, $default_ast_password, off, off\\n\";\n\t\t\t} \n\t\t} \n\t} \n\n\t$contents .= \"listenaddress = *\\n\";\n\t$contents .= \"listenport = 1234\\n\";\n\t$contents .= \"inputformat = standard\\n\";\n\t$contents .= \"outputformat = standard\\n\";\n\t$contents .= \"autofilter = off\\n\";\n\t$contents .= \"authrequired = yes\\n\";\n\t$contents .= \"retryinterval = 2\\n\";\n\t$contents .= \"maxretries = 0\\n\";\n\t$contents .= \"sslclienthellotimeout = 200\\n\";\n\t$contents .= \"acceptencryptedconnection = yes\\n\";\n\t$contents .= \"acceptunencryptedconnection = yes\\n\";\n\t$contents .= \"asteriskwritetimeout=100\\n\";\n\t$contents .= \"clientwritetimeout=200\\n\";\n\n\tfile_put_contents($cfg_path, $contents);\n\tunlock_file($lock);\n\n\t/* generate astmanproxy.users */\n\t$lock = lock_file($usr_path);\n\tfile_put_contents($usr_path, \"$default_amp_username=$default_amp_password\\n\");\n\tunlock_file($lock);\n}",
"public function createAdmConfig($servarray) {\n //check for the directory structure\n if (! file_exists ( $this->objConfig->getcontentBasePath () . 'adm/' )) {\n mkdir ( $this->objConfig->getcontentBasePath () . 'adm/', 0777 );\n }\n // write the server list file\n $cfile = $this->objConfig->getcontentBasePath () . 'adm/adm.xml';\n if (! file_exists ( $cfile )) {\n $conf = new Config_Container ( 'section', 'adm' ); //$servarray['name']);\n $conf_serv = & $conf->createSection ( $servarray ['name'] );\n $conf_serv->createDirective ( 'servername', $servarray ['name'] );\n $conf_serv->createDirective ( 'serverapiurl', $servarray ['url'] );\n $conf_serv->createDirective ( 'serveremail', $servarray ['email'] );\n $conf_serv->createDirective ( 'regtime', date ( 'r' ) );\n\n $config = new Config ( );\n $config->setRoot ( $conf );\n // write the container to an XML document\n $config->writeConfig ( $cfile, 'XML' );\n } else {\n // update the xml with the new server\n $root = & $config->parseConfig ( $cfile, 'XML', array ('name' => 'adm' ) );\n log_debug ( $root );\n $conf_serv = & $root->createSection ( $servarray ['name'] );\n $conf_serv->createDirective ( 'servername', $servarray ['name'] );\n $conf_serv->createDirective ( 'serverapiurl', $servarray ['url'] );\n $conf_serv->createDirective ( 'serveremail', $servarray ['email'] );\n $conf_serv->createDirective ( 'regtime', date ( 'r' ) );\n\n $config = new Config ( );\n $config->setRoot ( $root );\n // write the container to an XML document\n $config->writeConfig ( $cfile, 'XML' );\n }\n\n }",
"function create_barnyard2_conf() {\n global $bconfig, $bg;\n /* write out barnyard2_conf */\n\tconf_mount_rw();\n $barnyard2_conf_text = generate_barnyard2_conf();\n $bconf = fopen(\"/usr/local/etc/barnyard2.conf\", \"w\");\n if(!$bconf) {\n log_error(\"Could not open /usr/local/etc/barnyard2.conf for writing.\");\n exit;\n }\n fwrite($bconf, $barnyard2_conf_text);\n fclose($bconf);\n\tconf_mount_ro();\n}",
"abstract public static function getSapConfigFile();",
"function snort_create_barnyard2_conf($snortcfg, $if_real) {\n\tglobal $config, $g;\n\n\t$snortdir = SNORTDIR;\n\t$snort_uuid = $snortcfg['uuid'];\n\n\tif (!file_exists(\"{$snortdir}/snort_{$snort_uuid}_{$if_real}/barnyard2.conf\"))\n\t\texec(\"/usr/bin/touch {$snortdir}/snort_{$snort_uuid}_{$if_real}/barnyard2.conf\");\n\n\tif (!file_exists(\"/var/log/snort/snort_{$if_real}{$snort_uuid}/barnyard2/{$snort_uuid}_{$if_real}.waldo\")) {\n\t\t@touch(\"/var/log/snort/snort_{$if_real}{$snort_uuid}/barnyard2/{$snort_uuid}_{$if_real}.waldo\");\n\t\tmwexec(\"/bin/chmod 770 /var/log/snort/barnyard2/{$snort_uuid}_{$if_real}.waldo\", true);\n\t}\n\n\t$barnyard2_conf_text = snort_generate_barnyard2_conf($snortcfg, $if_real);\n\n\t/* write out barnyard2_conf */\n\t@file_put_contents(\"{$snortdir}/snort_{$snort_uuid}_{$if_real}/barnyard2.conf\", $barnyard2_conf_text);\n}",
"private function createConfig()\n\t{\n\t\t$configFilename = __DIR__ . '/app/config/config.local.neon';\n\n\t\tcopy(__DIR__ . '/app/config/config.local.example.neon', $configFilename);\n\n\t\t$lines = file($configFilename);\n\n\t\tforeach ($lines as $key => $line)\n\t\t{\n\t\t\tforeach (array('username', 'password', 'database') as $subject)\n\t\t\t{\n\t\t\t\tif (strpos($line, \"\\t\" . $subject))\n\t\t\t\t{\n\t\t\t\t\t$lines[$key] = $this->deleteNewline($line, \"\\n\") . ' ' . $this->config['db'][$subject] . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (file_put_contents($configFilename, $lines))\n\t\t{\n\t\t\t$this->success('Local config file created ...');\n\t\t}\n\t}",
"function init_config() {\n\t\n\t/**\n\t*\tCONFIGURATION FILE FOR THE APPLICATION\n\t*\n\t*\t\n\t*/\n\t$configuration = array (\n\t\n\t/**\n\t*\tLog file directory\n\t*\n\t*/\n\t\t\"LOGGER_CONFIG\"\t\t=> array (\n\t\t\t\t\"LOG_DIR\" \t\t=> \"bin\\logs\\\\\", # Default Value = \"bin\\logs\\\\\"\n\t\t\t\t\"LOG_FILE\"\t\t=> \"app_log.log\" # Default Value = \"app_log.log\"\n\t\t),\n\t\t\n\t\t\n\t/**\n\t*\tEncoding type\n\t*\n\t*/\n\t\t\"ENCODING_TYPE\"\t\t=> array (\n\t\t\t\t\"CHARSET\" \t\t=> \"UTF-8\"\n\t\t),\n\t\t\n\t\t\n\t/**\t\n\t*\tto configure server:\n\t*\t\t\"DB_SERVER_\"=> array (\n\t*\t\t\t\"_HOST\" \t=> \"host_ip/host_name\",\n\t*\t\t\t\"_DATABASE\" => \"Database_name\",\n\t*\t\t\t\"_USER\"\t\t=> \"Database_username\",\n\t*\t\t\t\"_PASS\"\t\t=> \"Database_password\",\n\t*\t\t\t\"_PORT\"\t\t=> \"Database_host_port\" \n\t*\t\t),\n\t*/\n\t\t\"DB_SERVER_\"\t\t=> array (\n\t\t\t\t\"HOST\" \t\t\t=> \"\",\n\t\t\t\t\"DATABASE\" \t\t=> \"\",\n\t\t\t\t\"USER\"\t\t\t=> \"\",\n\t\t\t\t\"PASS\"\t\t\t=> \"\",\n\t\t\t\t\"PORT\"\t\t\t=> \"\" #,\n\t\t\t)\n\t/**\n\t*\tto add another database server add \n\t*\n\t*\t\t\"DB_SERVER_01\"\t=> array (\n\t*\t\t\t\"_HOST_1\" \t\t=> \"host_ip/host_name\",\n\t*\t\t\t\"_DATABASE_1\" => \"Database_name\",\n\t*\t\t\t\"_USER_1\"\t\t=> \"Database_username\",\n\t*\t\t\t\"_PASS_1\"\t\t=> \"Database_password\",\n\t*\t\t\t\"_PORT_1\"\t\t=> \"Database_host_port\" \n\t*\t\t),\n\t*/\n\t);\n\n\n\t/*\n\t*\tinitialize the configurations to a global constant\n\t*\n\t*/\n\tforeach($configuration as $category) {\n\t\tforeach($category as $key => $value) { define($key,$value); }\n\t}\n}",
"function writeVoximalConf() {\n\n\tglobal $astman;\n//freepbx_log(FPBX_LOG_CRITICAL,\"==== DBGJYG: writeVoximalConf called!\");\n\n\t$confFile = \"/etc/asterisk/voximal.conf\";\n\t$content = \"\n;--------------------------------------------------------------------------------;\n; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;\n; this file must be done via the web gui. There are alternative files to make ;\n; custom modifications. ;\n;--------------------------------------------------------------------------------;\n\n;*********************************************************************************\n; AUTO-GENERATED AND CUSTOM USER VOXIMAL CONFIGURATION INCLUDED HERE *\n;*********************************************************************************\n\n[general]\";\n\n\t//$settings = getVoximalConfiguration('*');\n $settings = getGeneralConf(true);\n//print_r($settings);\n\t$settingsArrayKeys = array_keys($settings);\n\tvar_dump($settingsArrayKeys);\n\t$content = $content.\"\\n\";\n /*\n\t$content = $content.\"autoanswer=yes\\n\";\n\t$content = $content.\"videosilence=\\n\";\n\t$content = $content.\"audiosilence=\\n\";\n\t$content = $content.\"speechprovider=unimrcp\\n\";\n\t$content = $content.\"speechscore=30\\n\";\n */\n\t$content = $content.\"speechbeepstart=speech_start\\n\";\n\t$content = $content.\"speechbeepstop=speech_stop\\n\";\n\n\tforeach ($settingsArrayKeys as $key) {\n\t\t$value = trim($settings[$key]);\n\t\t//if (!empty($value))\n {\n\t\t\tif ($key == \"id\" ) {\n\t\t\t\tcontinue;\n\t\t\t} elseif ($key == \"wavdefaulcodec\") {\n\t\t\t\t$content = $content.\"wavcodec=\".strtolower($settings[$key]).\"\\n\";\n\t\t\t} elseif ($key == \"dialformat\") {\n\t\t\t\t$content = $content.\"dialformat=\".strtolower($settings[$key]).\"\\n\";\n\t\t\t} elseif ($key == \"monitor\") {\n\t\t\t\tif (strcasecmp($settings['monitor'], \"yes\") == 0)\n $monitor = \"yes\";\n\t\t\t\telse\n $monitor = \"no\";\n\t\t\t\t$content = $content.\"monitordirectory=\". \"@freepbx\" .\"\\n\";\n\t\t\t\t$content = $content.\"monitor=\". $monitor .\"\\n\";\n\t\t\t} else {\n\t\t\t\t$content = $content.$key.\"=\".strtolower($settings[$key]).\"\\n\";\n\t\t\t}\n\t\t}\n\t}\n\n\t$content = $content.\"\\n#include voximal_general_custom.conf\\n\\n\";\n\n\t//TODO Change this part when the page Settings is finished.\n\t$content = $content.\"\n[control]\nforward=#\nreverse=*\nstop=123456789\npause=\nrestart=0\nskipms=5000\n\";\n\n\t$license = getVoximalLicense();\n if (!empty($license[\"licensekey\"])) {\n $key = strtolower($license[\"licensekey\"]);\n\n $options = explode(';', $key);\n $key = $options[0];\n\n $content = $content.\"\\n[license]\\n\";\n $max = 1;\n $texttospeech = false;\n $speech = false;\n\n foreach ($options as &$value) {\n if (($value == \"texttospeech\") || ($value == \"tts\"))\n $texttospeech=true;\n else if (($value == \"speech\") || ($value == \"asr\") || ($value == \"stt\"))\n $speech=true;\n else if (is_numeric($value))\n $max= $value;\n }\n\n if ($texttospeech)\n $content = $content.\"texttospeech=\". \"yes\" .\"\\n\";\n else\n $content = $content.\"texttospeech=\". \"no\" .\"\\n\";\n\n if ($speech)\n $content = $content.\"speech=\". \"yes\" .\"\\n\";\n else\n $content = $content.\"speech=\". \"no\" .\"\\n\";\n\n $content = $content.\"max=\". $max .\"\\n\";\n\n $content = $content.\"key=\".strtolower($license[\"licensekey\"]).\"\\n\";\n }\n else\n {\n $content = $content.\"\\n[license]\\n\";\n\n $content = $content.\"texttospeech=\". \"yes\" .\"\\n\";\n\t\t$content = $content.\"speech=\". \"automatic\" .\"\\n\";\n }\n\n\t//TTS settings\n\t$content = $content.\"\\n[prompt]\\n\";\n\t$content.= getPromptConf();\n\t$content = $content.\"\\n#include voximal_prompt_custom.conf\\n\\n\";\n\n\t//ASR settings\n\t$content = $content.\"\\n[recognize]\\n\";\n\t$content.= getRecognizeConf();\n\t$content = $content.\"\\n#include voximal_recognize_custom.conf\\n\\n\";\n\n\t//Interpreter settings\n\t$content = $content.\"\\n[interpreter]\\n\";\n\t$content = $content.\"\\n#include voximal_interpreter_custom.conf\\n\\n\";\n\n\n\t$voximalList = getVoximalList(\"*\");\n\t$i = 0;\n\tforeach ($voximalList as $voximal) {\n\t\t$content = $content.\"\\n[account$i]\\n\";\n\t\t$voximalKeyList = array_keys($voximal);\n\t\tforeach ($voximalKeyList as $key) {\n //freepbx_log(FPBX_LOG_CRITICAL,\"==== DBGJYG: wrVoxiCFG:\".$i.\"$key=\".$voximal[$key] );\n\t\t\tif (!empty($voximal[$key]) && $key != \"id\") {\n if ($key == \"maxsessions\")\n $content = $content.\"max=\".$voximal[$key].\"\\n\";\n else if ($key == \"vxmlparam\")\n $content = $content.\"param=\".$voximal[$key].\"\\n\";\n else if ($key == \"startdelay\")\n $content = $content.\"wait=\".$voximal[$key].\"\\n\";\n else\n $content = $content.$key.\"=\".$voximal[$key].\"\\n\";\n }\n\t\t}\n\t\t$i++;\n\t}\n\n $content = $content.\"\n#include voximal_accounts_custom.conf\n\";\n\n\tfile_put_contents($confFile,$content);\n\n #include voximal_general_custom.conf\n\n\tif ($astman) {\n\t\t$out = $astman->send_request('Command',array('Command'=>\"voximal reload\"));\n\t}\n\n\treturn;\n}",
"function build_bind_conf($options=\"\") {\n\n // The important globals\n global $conf, $self, $onadb;\n\n // Version - UPDATE on every edit!\n $version = '1.51';\n\n printmsg(\"DEBUG => build_bind_conf({$options}) called\", 3);\n\n // Parse incoming options string to an array\n $options = parse_options($options);\n\n // Return the usage summary if we need to\n if ($options['help'] or !($options['server'] and $options['path'])) {\n // NOTE: Help message lines should not exceed 80 characters for proper display on a console\n $self['error'] = 'ERROR => Insufficient parameters';\n return(array(1,\n<<<EOF\n\nbuild_bind_conf-v{$version}\nBuilds a named.conf for a dns server from the database (bind 8+)\n\n Synopsis: build_bind_conf [KEY=VALUE] ...\n\n Required:\n server=NAME[.DOMAIN] or ID Build conf by server name or ID\n path=STRING Absolute prefix path for local zone files\n\n Notes:\n * Specified host must be a valid DNS server\n * Paths are absolute but MUST NOT contain a leading /, this will be added.\n\\n\nEOF\n\n ));\n }\n\n\n // NOTE: the whole path absolute thing with no leading slash is confusing I know\n // the problem here is that DCM.pl tries to load the contents of the path you pass in\n // as a file and will always return blank for path. this is a work around for now\n // until dcm gets fixed. Maybe fix it by checking if it is a DIR or a FILE.\n\n\n\n\n // Determine the hostname and domain to be used --\n // i.e. add the default domain, or find the part of the host provided\n // that will be used as the \"zone\" or \"domain\". This means testing many\n // zone name's against the DB to see what's valid.\n list($status, $rows, $shost) = ona_find_host($options['server']);\n printmsg(\"DEBUG => build_bind_conf() server record: {$domain['server']}\", 3);\n if (!$shost['id']) {\n printmsg(\"DEBUG => Unknown server record: {$options['server']}\",3);\n $self['error'] = \"ERROR => Unknown server record: {$options['server']}\";\n return(array(3, $self['error'] . \"\\n\"));\n }\n\n // For the given server id. find all domains for that server\n list($status, $rows, $records) = db_get_records($onadb, 'dns_server_domains', array('host_id' => $shost['id']), '');\n\n\n // Start building the named.conf - save it in $text\n $text = \"# Named.conf file for {$shost['fqdn']} built on \" . date($conf['date_format']) . \"\\n\";\n $text .= \"# TOTAL DOMAINS (count={$rows})\\n\\n\";\n\n////////////// Header stuff //////////////////\n\n // Allow for a local header include.. I expect this to rarely be used\n // MP: it is probably best to let the user set up all their own stuff and just include the resulting config\n // file in whatever their own config is. SOOO no need for this\n// $text .= \"; Allow for a local header include.. I expect this to rarely be used.\\n\";\n// $text .= \"include \\\"/etc/named.conf-header\\\";\\n\\n\";\n\n\n////////////// End Header stuff //////////////////\n\n foreach ($records as $sdomain) {\n list($status, $rows, $domain) = ona_get_domain_record(array('id' => $sdomain['domain_id']));\n // what is the role for this server.\n switch (strtolower($sdomain['role'])) {\n case \"forward\":\n //TODO: fixme.. this needs IPs like slaves do.. no file\n $text .= \"zone \\\"{$domain['fqdn']}\\\" in {\\n type forward;\\n file \\\"/{$options['path']}/named-{$domain['fqdn']}\\\";}\\n\";\n break;\n case \"master\":\n $text .= \"zone \\\"{$domain['fqdn']}\\\" in {\\n type master;\\n file \\\"/{$options['path']}/named-{$domain['fqdn']}\\\";\\n};\\n\\n\";\n break;\n\n case \"slave\":\n\n // get the IP addresses for the master domain servers for this domain\n list($status, $rows, $records) = db_get_records($onadb, 'dns_server_domains', array('domain_id' => $domain['id'], 'role' => 'master'), '');\n\n // TODO: if there are no rows then bail\n // TODO: look for static master list stored in DB and append it to the list.\n\n $text .= \"zone \\\"{$domain['fqdn']}\\\" in {\\n type slave;\\n file \\\"/{$options['path']}/named-{$domain['fqdn']}\\\";\\n masterfile-format text;\\n\";\n // Print the master statement\n $text .= \" masters { \";\n foreach ($records as $master ) {\n // Lookup a bunch of crap.. this should be done better.\n list($status, $rows, $rec) = ona_get_host_record(array('id' => $master['host_id']));\n list($status, $rows, $rec) = ona_get_dns_record(array('id' => $rec['primary_dns_id']));\n list($status, $rows, $rec) = ona_get_interface_record(array('id' => $rec['interface_id']));\n $text .= $rec['ip_addr_text'].\"; \";\n }\n $text .= \"};\\n\";\n $text .= \"};\\n\\n\";\n break;\n\n default:\n $text .= \"# {$domain['name']} has an invalid value for the column ROLE.\\n\";\n break;\n\n }\n }\n\n\n // Return the config file\n return(array(0, $text));\n\n}",
"public function setConfigfile();",
"function config_upgrade_1dot2() {\n\tglobal $config;\n\n\tarray_make_branch($config,'samba');\n\tif($config['samba']['aiorsize'] < 4096):\n\t\t$config['samba']['aiorsize'] = 4096;\n\tendif;\n\tif($config['samba']['aiowsize'] < 4096):\n\t\t$config['samba']['aiowsize'] = 4096;\n\tendif;\n\tarray_make_branch($config,'iscsitarget');\n\tif(empty($config['iscsitarget']['uctladdress'])):\n\t\t$config['iscsitarget']['uctladdress'] = '127.0.0.1';\n\t\t$config['iscsitarget']['uctlport'] = '3261';\n\t\t$config['iscsitarget']['uctlnetmask'] = '127.0.0.1/8';\n\t\t$config['iscsitarget']['uctlauthmethod'] = 'CHAP';\n\t\t$config['iscsitarget']['uctlauthgroup'] = 0;\n\t\t$config['iscsitarget']['mediadirectory'] = '/mnt';\n\tendif;\n\tarray_make_branch($config,'system','sysctl','param');\n\t$index = array_search_ex('kern.maxfilesperproc',$config['system']['sysctl']['param'],'name');\n\tif($index !== false):\n\t\tif($config['system']['sysctl']['param'][$index]['value'] === '32768'):\n\t\t\t$config['system']['sysctl']['param'][$index]['value'] = '50000';\n\t\tendif;\n\tendif;\n\t//\tremove unused key\n\t$index = array_search_ex('hw.ata.to',$config['system']['sysctl']['param'],'name');\n\tif($index !== false):\n\t\tunset($config['system']['sysctl']['param'][$index]);\n\tendif;\n\t//\tremove empty entry\n\tif(isset($config['system']['hosts'])):\n\t\t$hosts_tmp = [];\n\t\tforeach($config['system']['hosts'] as &$host):\n\t\t\tif(empty($host) || !isset($host['uuid'])):\n\t\t\t\tcontinue;\n\t\t\tendif;\n\t\t\t$hosts_tmp[] = $host;\n\t\tendforeach;\n\t\t$config['system']['hosts'] = $hosts_tmp;\n\tendif;\n\t//\tadd missing values\n\tarray_make_branch($config,'zfs','pools','pool');\n\tforeach($config['zfs']['pools']['pool'] as &$pool):\n\t\t$pool['desc'] = $pool['desc'] ?? '';\n\tendforeach;\n\tarray_make_branch($config,'zfs','vdevices','vdevice');\n\tforeach($config['zfs']['vdevices']['vdevice'] as &$vdevice):\n\t\t$vdevice['desc'] = $vdevice['desc'] ?? '';\n\tendforeach;\n\tarray_make_branch($config,'zfs','datasets','dataset');\n\tforeach($config['zfs']['datasets']['dataset'] as &$dataset):\n\t\t$dataset['desc'] = $dataset['desc'] ?? '';\n\t\t$dataset['atime'] = $dataset['atime'] ?? 'on';\n\tendforeach;\n\tarray_make_branch($config,'zfs','volumes','volume');\n\tforeach($config['zfs']['volumes']['volume'] as &$volume):\n\t\t$volume['desc'] = $volume['desc'] ?? '';\n\tendforeach;\n\t//\treplace certificate and privatekey\n\tarray_make_branch($config,'system','webgui');\n\tif(md5($config['system']['webgui']['certificate']) === 'ee3e3c2ddc0f186e8d40e797e8af6f36'):\n\t\t$config['system']['webgui']['certificate'] = 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlEWURDQ0FrZ0NDUUNZaG9rNlRyekZCakFOQmdrcWhraUc5dzBCQVFVRkFEQnlNUXN3Q1FZRFZRUUdFd0pLDQpVREVUTUJFR0ExVUVDQk1LVTI5dFpTMVRkR0YwWlRFUk1BOEdBMVVFQ2hNSVRrRlRORVp5WldVeEZ6QVZCZ05WDQpCQU1URG01aGN6Um1jbVZsTG14dlkyRnNNU0l3SUFZSktvWklodmNOQVFrQkZoTnBibVp2UUc1aGN6Um1jbVZsDQpMbXh2WTJGc01CNFhEVEV5TURreE56RXlNVEkxTmxvWERUTXlNRGt4TWpFeU1USTFObG93Y2pFTE1Ba0dBMVVFDQpCaE1DU2xBeEV6QVJCZ05WQkFnVENsTnZiV1V0VTNSaGRHVXhFVEFQQmdOVkJBb1RDRTVCVXpSR2NtVmxNUmN3DQpGUVlEVlFRREV3NXVZWE0wWm5KbFpTNXNiMk5oYkRFaU1DQUdDU3FHU0liM0RRRUpBUllUYVc1bWIwQnVZWE0wDQpabkpsWlM1c2IyTmhiRENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFMSCtTR1hrDQpjSzRnNVp2MWRSRFJKQVh0NVhHMVVpZVEzZ1UzdlIvZjBYZnJ5RFBPNjJ3WkhnTWdONTJocGVRL1VvNXl4dTRMDQp1azJtUlpTYlpPai92b0xSZWlpSy8zY0grUStRVml4SFpaMlpQNThBeWpHTXNUOGJ0T3pwYlN4MWtkQkEvUkhqDQpmYmpPamRFK0FocDJiWkVoQzVmaXlYVjlrdjFzTmZmMnFlM0REMUZtd0RGbDM0cVdPT1g2SEFYNHpWOWcrY1dJDQo0S0FRdEYwZ3FJWWd5Z29OckM5dDI4VVc4Z2dqcWs4T0EycnNMUFRsMmkzMk5DanVJSThjL1EzOUhYNkZBRUdvDQo1VGZGL3V0WTlBaFBaaHpWbk0zazJtUFR1RGdMbVZaZmtieml1eHVES293ZzBGUC9IZlZabWRoMkV3M3Y1NmZGDQpDLzh3N1F2QkdPRjF2SXNDQXdFQUFUQU5CZ2txaGtpRzl3MEJBUVVGQUFPQ0FRRUFidWxJNlJCTXFJTzFMT21jDQo1OGg5aHJ1Z25vTFkxNndIRFZQdTE4WmpUSzZYcDBDYWlONVYyR1MwdWdUNzJ2QzVrcXQ0cW1CUWFBa2MwbVdWDQpQQi9YUXhyaEFTd25VMzh1TGVJeWlnMzFCWkx3Yll5S3IzTUJ4cVI5dWwvdWY1MWErR2dVOGFETk42VDRQbGJJDQp5Z0M2dDUxa2E1VzBLbFFGeWhwNTlXT21GOElLOURRTlZpQWpTWkk0WUZsZXhJc1dFTC9DNCtMTGNhTVp3YUUzDQpLUTVKK1lFcG5qMFBKOUYvU1Y4MHFNdnE0RWJ4YmUzbGpFSGlMSVU0VktwV2I0VWJMSWxVNEZNeWtTSzNYMGp4DQpESzJGcERPRnUxL3c2d0FrYW5KanFSQXozUVViRVVocFhCNnVUVUVGcTVJSHNqNkZkbTBkMThkU2NiT0xWcmJGDQpBYlYrZHc9PQ0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQ==';\n\t\t$config['system']['webgui']['privatekey'] = 'LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQ0KTUlJRXBBSUJBQUtDQVFFQXNmNUlaZVJ3cmlEbG0vVjFFTkVrQmUzbGNiVlNKNURlQlRlOUg5L1JkK3ZJTTg3cg0KYkJrZUF5QTNuYUdsNUQ5U2puTEc3Z3U2VGFaRmxKdGs2UCsrZ3RGNktJci9kd2Y1RDVCV0xFZGxuWmsvbndESw0KTVl5eFB4dTA3T2x0TEhXUjBFRDlFZU45dU02TjBUNENHblp0a1NFTGwrTEpkWDJTL1d3MTkvYXA3Y01QVVdiQQ0KTVdYZmlwWTQ1Zm9jQmZqTlgyRDV4WWpnb0JDMFhTQ29oaURLQ2cyc0wyM2J4UmJ5Q0NPcVR3NERhdXdzOU9YYQ0KTGZZMEtPNGdqeHo5RGYwZGZvVUFRYWpsTjhYKzYxajBDRTltSE5XY3plVGFZOU80T0F1WlZsK1J2T0s3RzRNcQ0KakNEUVUvOGQ5Vm1aMkhZVERlL25wOFVML3pEdEM4RVk0WFc4aXdJREFRQUJBb0lCQUU0TTFTNXBCOGd6Z0x2cw0KM0pLdFF3Q2VteGhMakdUeEw0cFdNTWFEWE5VYlBVVUtuVTFmamp1TXF4YWlSWjVhN2hhczJmS1VqZk55ejl3aw0KY0JHRDQ4UjFtdjJnUmZtcU0xclJ6aGZJanhTV21NRmVsVXM1Q0poRnpBWi9MWEpyYzY5QWNEaWg2d1ZZL2ZNZA0KSDhyKzEzam1ackVKcjVHbnFRY2JwbWEvY1RCaXR2TnNib3VSZmlQSFB5ck84UlBEdXVIc3k1VXovSVB6cDFMTA0KWmNNd2hwK1RsSjlnVmNDMHRvN2VlemxUMEZ6a2hsMTgwVTlla09wTlB1WUJGc1NsdWZyVEhqTnBzRVE5aGtmKw0KeGJjQjdlZTFvZXJtUjdOSmdBRWVHeS9FeXVuK0UvOWZpOUovb1JCbjZnVXhiaDkvQ1dPd2VGeVRZVVZvd1d1RA0KUC9NY0prRUNnWUVBNUs4YzJKdmtQbWhpWGtNRU9GQkxZQkxvaFBKa2hqdU0rQWlMaERxeENpRTg4S0pod3d3WQ0KdWFpaU0rbXkraTcrbzBDZVF5NlJvb0d2UVRYVHRFUkhEMldtaS9JZzlDdFF0cWNibnRsbEtGYVQrcnZHdmp0RA0KZ3dzV1Y0N09Ia3pwUThWUkZueVZOMnBLZVNudzVnR1F3a2RXaFdIR0wwdXBJNklIakExVVI1c0NnWUVBeDBFYg0KY01BYXVkNXZlZW1NQzN5ZmZTMEx0Z2dtR2dGMGxLSFBJTm5XbXBWdkhjTkZZaGtXMENKMVdNQm5sTlhESkdJKw0KWHkyU3lBNVlteWZCN2FTWWdxVTI5S3ZSejJVR0kvOUlJY1NTM09TK2NEdjcyQjljQjlQN3VMUVBSN281S0s3eA0KSEM4NkxuWVIrb2lqbDBXYzJYUmxrdmt4U0h0YkhVVm8yUXIzeGRFQ2dZRUFubmgyN2VnQm4vbW9DUmc1eVdoag0KQTEyM0FjSVRSUzNwUDB4MG1ob3Q2dzRqYzhHaks0MnJhS1RpV2tVZGdOK21GNjFFdnR0N2tuaDU0UitTNkQzVQ0KWEdnZHBLY1NqUUdqT2gvTk5TUURSSlBTa2hNajQxbWdMQ1EzeEU4eXFLNjFpd0FtZEFXN1JaNkRvemtjTmRkcA0KNENlZFhtcmw4b3BrMkV1RkhWbHpTUGNDZ1lCdFRsb3ZVRE5aSTUwajArcnZvajRiL1VvZllma0U2eWQ1SWdydQ0KaXBJZjJ6cEpxWVcyZXV6NDRPNWU4YTNoQ0NNMUltLzA1cHRQQkErM2plZms1aGFFRlA1QTJzRU9kTzBaY2tHdg0KeEphTWR5L0JnaVoyT1QzVFRZY1puQzJGdTdML2pualdiVklOaXRmeUNHTTE2UXBTZ0hmNFdKdWdsNHMwVTQ5aA0KQVpOTEFRS0JnUURKZzNlUWV0TWR3WUpKbjFzZmVTbUVnTVFNMjZOLzNidURSUG1rTUVtdTgvcVJRYTM4T3VXOA0KUUFmTFVNOC83Vm5OUlhvbmZMR2s0eUpKdG5RSlQ0TlZLdjEvUzgweldNSXJ5azM4L3ZreGVsbDA1Q1Y2Rnp5eA0KdGVtcjRZcE8yMDBxWFl5MjR0aC9QM0RhbFYwcDhWcXJvemJ4eExiS1k5TUpLSWZpWHo5bnV3PT0NCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0t';\n\tendif;\n}",
"function config_upgrade_1dot8() {\n\tglobal $config;\n\n\tarray_make_branch($config,'system','rcconf','param');\n\t$index = array_search_ex('varsize',$config['system']['rcconf']['param'],'name');\n\tif($index !== false):\n\t\t$config['system']['rcconf']['param'][$index]['value'] = '256m';\n\telse:\n\t\t$config['system']['rcconf']['param'][] = [\n\t\t\t'uuid' => uuid(),\n\t\t\t'name' => 'varsize',\n\t\t\t'value' => '256m',\n\t\t\t'comment' => 'Default /var size',\n\t\t\t'enable' => true\n\t\t];\n\tendif;\n\t$index = array_search_ex('vartmpsize',$config['system']['rcconf']['param'],'name');\n\tif($index !== false):\n\t\t$config['system']['rcconf']['param'][$index]['value'] = '128m';\n\telse:\n\t\t$config['system']['rcconf']['param'][] = [\n\t\t\t'uuid' => uuid(),\n\t\t\t'name' => 'vartmpsize',\n\t\t\t'value' => '128m',\n\t\t\t'comment' => 'Default /var/tmp size',\n\t\t\t'enable' => true\n\t\t];\n\tendif;\n\tarray_make_branch($config,'samba');\n\tif($config['samba']['rcvbuf'] < 128480):\n\t\t$config['samba']['rcvbuf'] = 128480;\n\tendif;\n\tif($config['samba']['sndbuf'] < 128480):\n\t\t$config['samba']['sndbuf'] = 128480;\n\tendif;\n\tif($config['samba']['aiorsize'] == 4096):\n\t\t$config['samba']['aiorsize'] = 1024;\n\tendif;\n\tif($config['samba']['aiowsize'] == 4096):\n\t\t$config['samba']['aiowsize'] = 1024;\n\tendif;\n}",
"function createAacConfig()\n{\n global $bitmovinApi;\n\n $aacConfig = new AacAudioConfiguration();\n $aacConfig->name(\"AAC 128 kbit/s\");\n $aacConfig->bitrate(128000);\n\n return $bitmovinApi->encoding->configurations->audio->aac->create($aacConfig);\n}",
"function generate_barnyard2_conf() {\n\n global $config, $g;\n conf_mount_rw();\n\n/* define snortbarnyardlog */\n/* TODO add support for the other 5 output plugins */\n\n$snortbarnyardlog_database_info_chk = $config['installedpackages']['snortadvanced']['config'][0]['snortbarnyardlog_database'];\n$snortbarnyardlog_hostname_info_chk = $config['installedpackages']['snortadvanced']['config'][0]['snortbarnyardlog_hostname'];\n$snortbarnyardlog_interface_info_chk = $config['installedpackages']['snortadvanced']['config'][0]['snortbarnyardlog_interface'];\n\n$barnyard2_conf_text = <<<EOD\n\n#\tbarnyard2.conf\n# barnyard2 can be found at http://www.securixlive.com/barnyard2/index.php\n\n#\tCopyright (C) 2006 Robert Zelaya\n#\tpart of pfSense\n#\tAll rights reserved.\n\n#\tRedistribution and use in source and binary forms, with or without\n#\tmodification, are permitted provided that the following conditions are met:\n\n#\t1. Redistributions of source code must retain the above copyright notice,\n#\t this list of conditions and the following disclaimer.\n\n#\t2. Redistributions in binary form must reproduce the above copyright\n#\t notice, this list of conditions and the following disclaimer in the\n#\t documentation and/or other materials provided with the distribution.\n\n#\tTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,\n#\tINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n#\tAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n#\tAUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n#\tOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n#\tSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n#\tINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n#\tCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n#\tARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n#\tPOSSIBILITY OF SUCH DAMAGE.\n\n# set the appropriate paths to the file(s) your Snort process is using\nconfig reference-map: /usr/local/etc/snort/reference.config\nconfig class-map: /usr/local/etc/snort/classification.config\nconfig gen-msg-map: /usr/local/etc/snort/gen-msg.map\nconfig sid-msg-map: /usr/local/etc/snort/sid-msg.map\n\nconfig hostname: $snortbarnyardlog_hostname_info_chk\nconfig interface: $snortbarnyardlog_interface_info_chk\n\n# Step 2: setup the input plugins\ninput unified2\n\n# database: log to a variety of databases\n# output database: log, mysql, user=xxxx password=xxxxxx dbname=xxxx host=xxx.xxx.xxx.xxxx\n\n$snortbarnyardlog_database_info_chk\n\nEOD;\n\tconf_mount_rw();\n return $barnyard2_conf_text;\n\n}",
"abstract public function setupConfig();",
"public function makeConfigFile()\n\t{\n\t\t// Make sure we are called by an expected caller\n\t\tServerTechnology::checkCaller($this->allowedCallersForMake);\n\n\t\tJLoader::import('joomla.utilities.date');\n\n\t\t$date = new Date();\n\t\t$tz = new DateTimeZone($this->container->platform->getUser()->getParam('timezone', $this->container->platform->getConfig()->get('offset', 'UTC')));\n\t\t$date->setTimezone($tz);\n\t\t$d = $date->format('Y-m-d H:i:s T', true);\n\t\t$version = ADMINTOOLS_VERSION;\n\n\t\t$config = $this->loadConfiguration();\n\n\t\t// Load the fastcgi_pass setting\n\t\t$fastcgi_pass_block = $config->fastcgi_pass_block;\n\n\t\tif (empty($fastcgi_pass_block))\n\t\t{\n\t\t\t$fastcgi_pass_block = 'fastcgi_pass 127.0.0.1:9000;';\n\t\t}\n\n\t\t$fastcgi_pass_block = trim($fastcgi_pass_block);\n\n\t\t// Get the directory to the site's root\n\t\t$rewritebase = $config->rewritebase;\n\t\t$rewritebaseSlash = '/' . trim($rewritebase, '/ ');\n\t\t$rewritebaseSlash = ($rewritebaseSlash == '/') ? '' : $rewritebaseSlash;\n\t\t$rewritebase = '/' . trim($rewritebase, '/ ');\n\n\t\t$nginxConf = <<<END\n### ===========================================================================\n### Security Enhanced & Highly Optimized NginX Configuration File for Joomla!\n### automatically generated by Admin Tools $version on $d\n### ===========================================================================\n###\n### Admin Tools is Free Software, distributed under the terms of the GNU\n### General Public License version 3 or, at your option, any later version\n### published by the Free Software Foundation.\n###\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n### !! !!\n### !! If you get an Internal Server Error 500 or a blank page when trying !!\n### !! to access your site, remove this file and try tweaking its settings !!\n### !! in the back-end of the Admin Tools component. !!\n### !! !!\n### !! Remember to include this file in your site's configuration file. !!\n### !! Also remember to reload or restart NginX after making any change to !!\n### !! this file. !!\n### !! !!\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n###\n\n### Prevent access to this file\nlocation = $rewritebaseSlash/nginx.conf {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/nginx.conf.admintools {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\n\t\t// Protect against common file injection attacks?\n\t\tif ($config->fileinj == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< CONFDATA\n######################################################################\n## Protect against common file injection attacks\n######################################################################\nset \\$file_injection 0;\nif (\\$query_string ~ \"[a-zA-Z0-9_]=http://\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=(\\.\\.//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=/([a-z0-9_.]//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$file_injection = 1) {\n\treturn 403;\n\tbreak;\n}\n\nCONFDATA;\n\t\t}\n\n\t\tif ($config->phpeaster == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Disable PHP Easter Eggs\n######################################################################\nif (\\$query_string ~ \"\\=PHP[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\") {\n\treturn 403;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->leftovers == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Block access to configuration.php-dist and htaccess.txt\n######################################################################\nlocation = $rewritebaseSlash/configuration.php-dist {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/htaccess.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/configuration.php {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/CONTRIBUTING.md {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/joomla.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/LICENSE.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/phpunit.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/README.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->clickjacking == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Protect against clickjacking\nadd_header X-Frame-Options SAMEORIGIN;\n\nENDCONF;\n\t\t}\n\n\t\tif (!empty($config->hoggeragents) && ($config->nohoggers == 1))\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n######################################################################\n## Block access from specific user agents\n######################################################################\nset \\$bad_ua 0;\n\nENDCONF;\n\n\t\t\tforeach ($config->hoggeragents as $agent)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$http_user_agent ~ \"$agent\") {\n\tset \\$bad_ua 1;\n}\n\nENDCONF;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$bad_ua = 1) {\n\treturn 403;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif (($config->fileorder == 1) || ($config->nodirlists == 1))\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Directory indices and no automatic directory listings\n## Forces index.php to be read before the index.htm(l) files\n## Also disables showing files in a directory automatically\n######################################################################\nindex index.php index.html index.htm;\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->symlinks != 0)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Disable following symlinks\n######################################################################\n\nENDCONF;\n\t\t\tswitch ($config->symlinks)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks on;\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks if_not_owner;\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->exptime == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Set default expiration time\n######################################################################\n # CSS and JavaScript : 1 week\nlocation ~* \\.(css|js)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1w;\n}\n\n# Image files : 1 month\nlocation ~* \\.(bmp|gif|jpg|jpeg|jp2|png|svg|tif|tiff|ico|wbmp|wbxml|smil|webp)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Font files : 1 week\nlocation ~* \\.(woff|woff2|ttf|otf|eot)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Document files : 1 month\nlocation ~* \\.(pdf|txt|xml)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Audio files : 1 month\nlocation ~* \\.(mid|midi|mp3|m4a|m4r|aif|aiff|ra|wav|voc|ogg)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Video files : 1 month\nlocation ~* \\.(swf|vrml|avi|mkv|mpg|mpeg|mp4|m4v|mov|asf)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->autocompress == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Automatic compression of static resources\n## Compress text, html, javascript, css, xml and other static resources\n## May kill access to your site for old versions of Internet Explorer\n######################################################################\n# The following is the actual automatic compression setup\ngzip on;\ngzip_vary\t\ton;\ngzip_comp_level 6;\ngzip_proxied\texpired no-cache no-store private auth;\ngzip_min_length 1000;\ngzip_http_version 1.1;\ngzip_types text/plain text/css application/xhtml+xml application/xml+rss application/rss+xml application/x-javascript application/javascript text/javascript application/json text/xml application/xml image/svg+xml;\ngzip_buffers 16 8k;\ngzip_disable \"MSIE [1-6]\\.(?!.*SV1)\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->etagtype != -1)\n\t\t{\n\t\t\t$etagValue = ($config->etagtype == 1) ? 'on' : 'off';\n\t\t\t$nginxConf .= <<< CONF\n## Send ETag (you have set it to '$etagValue')\netag $etagValue;\n\nCONF;\n\n\t\t}\n\n\t\t$host = strtolower($config->httphost);\n\n\t\tif (substr($host, 0, 4) == 'www.')\n\t\t{\n\t\t\t$wwwHost = $host;\n\t\t\t$noWwwHost = substr($host, 4);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$noWwwHost = $host;\n\t\t\t$wwwHost = 'www.' . $host;\n\t\t}\n\n\t\t$subfolder = trim($config->rewritebase, '/') ? trim($config->rewritebase, '/').'/' : '';\n\n\t\tswitch ($config->wwwredir)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t// non-www to www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect non-www to www\n######################################################################\nif (\\$host = '$noWwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$wwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t// www to non-www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect www to non-www\n######################################################################\nif (\\$host = '$wwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$noWwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!empty($config->olddomain))\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect old to new domains\n######################################################################\n\nEND;\n\t\t\t$domains = trim($config->olddomain);\n\t\t\t$domains = explode(',', $domains);\n\t\t\t$newdomain = $config->httphost;\n\n\t\t\tforeach ($domains as $olddomain)\n\t\t\t{\n\t\t\t\t$olddomain = trim($olddomain);\n\n\t\t\t\tif (empty($olddomain))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$olddomain = $this->escape_string_for_regex($olddomain);\n\n\t\t\t\t$nginxConf .= <<<END\nif (\\$host ~ \"$olddomain$\" ) {\n\trewrite ^/(.*)$ \\$scheme://$newdomain/$1 permanent;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->hstsheader == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## HSTS Header - See http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security\nadd_header Strict-Transport-Security max-age=31536000;\n\nEND;\n\t\t}\n\n\t\tif ($config->cors == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Cross-Origin Resource Sharing (CORS)\nadd_header Access-Control-Allow-Origin \"*\";\nadd_header Timing-Allow-Origin \"*\";\n\nEND;\n\t\t}\n\n\t\tif ($config->referrerpolicy !== '-1')\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Referrer-policy\nadd_header Referrer-Policy \"{$config->referrerpolicy}\";\n\nEND;\n\t\t}\n\n\t\tif ($config->notracetrack == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Disable HTTP methods TRACE and TRACK (protect against XST)\nif (\\$request_method ~ ^(TRACE|TRACK)$ ) {\n\treturn 405;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->reducemimetyperisks == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reduce MIME type security risks\nadd_header X-Content-Type-Options \"nosniff\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->reflectedxss == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reflected XSS prevention\nadd_header X-XSS-Protection \"1; mode=block\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->notransform == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Prevent content transformation\nadd_header Cache-Control \"no-transform\";\n\nENDCONF;\n\t\t}\n\n\n\t\tif ($config->cfipfwd == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## CloudFlare support - see https://support.cloudflare.com/hc/en-us/articles/200170706-Does-CloudFlare-have-an-IP-module-for-Nginx-\n######################################################################\nset_real_ip_from 199.27.128.0/21;\nset_real_ip_from 173.245.48.0/20;\nset_real_ip_from 103.21.244.0/22;\nset_real_ip_from 103.22.200.0/22;\nset_real_ip_from 103.31.4.0/22;\nset_real_ip_from 141.101.64.0/18;\nset_real_ip_from 108.162.192.0/18;\nset_real_ip_from 190.93.240.0/20;\nset_real_ip_from 188.114.96.0/20;\nset_real_ip_from 197.234.240.0/22;\nset_real_ip_from 198.41.128.0/17;\nset_real_ip_from 162.158.0.0/15;\nset_real_ip_from 104.16.0.0/12;\nset_real_ip_from 2400:cb00::/32;\nset_real_ip_from 2606:4700::/32;\nset_real_ip_from 2803:f800::/32;\nset_real_ip_from 2405:b500::/32;\nset_real_ip_from 2405:8100::/32;\nreal_ip_header X-Forwarded-For;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttimeout == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Timeout handling, see http://wiki.nginx.org/HttpCoreModule\nclient_header_timeout 10;\nclient_body_timeout 10;\nsend_timeout 30;\nkeepalive_timeout 30s;\n\nEND;\n\t\t}\n\n\t\tif ($config->optsockets == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Socket settings, see http://wiki.nginx.org/HttpCoreModule\nconnection_pool_size 8192;\nclient_header_buffer_size 4k;\nlarge_client_header_buffers 8 8k;\nrequest_pool_size 8k;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttcpperf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Performance, see http://wiki.nginx.org/HttpCoreModule\nsendfile on;\nsendfile_max_chunk 1m;\npostpone_output 0;\ntcp_nopush on;\ntcp_nodelay on;\n\nEND;\n\t\t}\n\n\t\tif ($config->optoutbuf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Output buffering, see http://wiki.nginx.org/HttpCoreModule\noutput_buffers 8 32k;\n\nEND;\n\t\t}\n\n\t\tif ($config->optfhndlcache == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Filehandle Cache, useful when serving a large number of static files (Joomla! sites do that)\nopen_file_cache max=2000 inactive=20s;\nopen_file_cache_valid 30s;\nopen_file_cache_min_uses 2;\nopen_file_cache_errors on;\n\nEND;\n\t\t}\n\n\t\tif ($config->encutf8 == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Character encoding, see http://wiki.nginx.org/HttpCharsetModule\ncharset utf-8;\nsource_charset utf-8;\n\nEND;\n\t\t}\n\n\t\tif ($config->nginxsecurity == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Security options, see http://wiki.nginx.org/HttpCoreModule\nserver_name_in_redirect off;\nserver_tokens off;\nignore_invalid_headers on;\n\nEND;\n\t\t}\n\n\t\tif ($config->maxclientbody == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Maximum client body size set to 1 Gigabyte\nclient_max_body_size 1G;\n\nEND;\n\t\t}\n\n\t\tif ($config->blockcommon == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\nset \\$common_exploit 0;\nif (\\$query_string ~ \"proc/self/environ\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"mosConfig_[a-zA-Z_]{1,21}(=|\\%3D)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"base64_(en|de)code\\(.*\\)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"(<|%3C).*script.*(>|%3E)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"GLOBALS(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"_REQUEST(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$common_exploit = 1) {\n\treturn 403;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->enablesef == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Enable SEF URLs\nlocation / {\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\nlocation ~* /index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection rules exceptions\n######################################################################\n\nEND;\n\n\t\tif (!empty($config->exceptionfiles))\n\t\t{\n\t\t\tforeach ($config->exceptionfiles as $file)\n\t\t\t{\n\t\t\t\tif (substr($file, -4) == '.php')\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->exceptiondirs))\n\t\t{\n\t\t\tforeach ($config->exceptiondirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*\\.php$\n{\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->fullaccessdirs))\n\t\t{\n\t\t\tforeach ($config->fullaccessdirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection\n######################################################################\n\nEND;\n\n\t\tif ($config->backendprot == 1)\n\t\t{\n\t\t\t$bedirs = implode('|', $config->bepexdirs);\n\t\t\t$betypes = implode('|', $config->bepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select back-end directories\nlocation ~* ^$rewritebaseSlash/administrator/($bedirs)/.*.($betypes)$ {\n\tbreak;\n}\n\n# Allow access to the back-end index.php file\nlocation = $rewritebaseSlash/administrator/index.php {\n\t$fastcgi_pass_block\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/administrator$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\nlocation ~* ^$rewritebaseSlash/administrator/$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* $rewritebaseSlash/administrator.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /administrator/index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->frontendprot == 1)\n\t\t{\n\t\t\t$fedirs = implode('|', $config->fepexdirs);\n\t\t\t$fetypes = implode('|', $config->fepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select front-end directories\nlocation ~* ^$rewritebaseSlash/($fedirs)/.*.($fetypes)$ {\n\tbreak;\n}\n\n## Disallow front-end access for certain Joomla! system directories (unless access to their files is allowed above)\nlocation ~* ^$rewritebaseSlash/includes/js/ {\n\treturn 403;\n}\nlocation ~* ^$rewritebaseSlash/(cache|includes|language|logs|log|tmp)/ {\n\treturn 403;\n}\n\nEND;\n\t\t\tif ($config->enablesef != 1)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<<END\n# Allow access to the front-end index.php file\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\nlocation ^$rewritebaseSlash/index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<<END\n# Allow access to /\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* ^$rewritebaseSlash/.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= \"##### Advanced server protection -- END\\n\\n\";\n\n\t\treturn $nginxConf;\n\t}",
"function createConfigFile() {\n\t\t$templateFilename = 'config.template.php';\n\t\t$templateHandle = fopen($templateFilename, \"r\");\n\t\tif($templateHandle) {\n\t\t\t/* open include configuration file write only */\n\t\t\t$includeFilename = 'config.inc.php';\n\t \t$includeHandle = fopen($includeFilename, \"w\");\n\t\t\tif($includeHandle) {\n\t\t\t \twhile (!feof($templateHandle)) {\n\t \t\t\t\t$buffer = fgets($templateHandle);\n\n\t\t \t\t\t/* replace _DBC_ variable */\n\t\t \t\t\t$buffer = str_replace( \"_DBC_SERVER_\", $this->dbHostname, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PORT_\", $this->dbPort, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_USER_\", $this->dbUsername, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PASS_\", $this->dbPassword, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_NAME_\", $this->dbName, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_TYPE_\", $this->dbType, $buffer);\n\n\t\t \t\t\t$buffer = str_replace( \"_SITE_URL_\", $this->siteUrl, $buffer);\n\n\t\t \t\t\t/* replace dir variable */\n\t\t \t\t\t$buffer = str_replace( \"_VT_ROOTDIR_\", $this->rootDirectory, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_CACHEDIR_\", $this->cacheDir, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_TMPDIR_\", $this->cacheDir.\"images/\", $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_UPLOADDIR_\", $this->cacheDir.\"upload/\", $buffer);\n\t\t\t \t$buffer = str_replace( \"_DB_STAT_\", \"true\", $buffer);\n\n\t\t\t\t\t/* replace charset variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_CHARSET_\", $this->vtCharset, $buffer);\n\n\t\t\t\t\t/* replace default lanugage variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_DEFAULT_LANGUAGE_\", $this->vtDefaultLanguage, $buffer);\n\n\t\t\t \t/* replace master currency variable */\n\t\t \t\t\t$buffer = str_replace( \"_MASTER_CURRENCY_\", $this->currencyName, $buffer);\n\n\t\t\t \t/* replace the application unique key variable */\n\t\t \t\t$buffer = str_replace( \"_VT_APP_UNIQKEY_\", md5(time() . rand(1,9999999) . md5($this->rootDirectory)) , $buffer);\n\n\t\t\t\t\t/* replace support email variable */\n\t\t\t\t\t$buffer = str_replace( \"_USER_SUPPORT_EMAIL_\", $this->adminEmail, $buffer);\n\n\t\t \t\tfwrite($includeHandle, $buffer);\n\t \t\t}\n\t \t\t\tfclose($includeHandle);\n\t \t\t}\n\t \t\tfclose($templateHandle);\n\t \t}\n\n\t \tif ($templateHandle && $includeHandle) {\n\t \t\treturn true;\n\t \t}\n\t \treturn false;\n\t}",
"function config_upgrade_0dot9() {\n\tglobal $config;\n\n\tarray_make_branch($config,'system');\n\t$config['system']['hostname'] = 'xigmanas';\n\tarray_make_branch($config,'samba');\n\t$config['samba']['netbiosname'] = 'xigmanas';\n\t$config['samba']['serverdesc'] = 'XigmaNAS Server';\n}",
"private function createConfigFile(): void\n {\n if (!file_exists($this->getModulePath() . '/config.php')) {\n $configFile = fopen($this->getModulePath() . '/config.php', 'a+');\n $content = require __DIR__ . '/templates/config.php';\n fputs($configFile, $content);\n fclose($configFile);\n }\n }",
"private static function createConfigFile() {\n $args = array();\n $args[\"dbname\"] = self::$config->getDbName();\n $args[\"dbuser\"] = self::$config->getDbUser();\n if (self::$config->getDbPassword()) $args[\"dbpass\"] = self::$config->getDbPassword();\n if (self::$config->getDbHost()) $args[\"dbhost\"] = self::$config->getDbHost();\n\n self::runWpCliCommand(\"core\", \"config\", $args);\n }",
"public function storeConfig() {\n\n\t\t$config[] \t= $this->getLine('dbname', \t\t$this->dbname);\n\t\t$config[] \t= $this->getLine('dbhost', \t\t$this->dbhost);\n\t\t$config[] \t= $this->getLine('dbuser', \t\t$this->dbuser);\n\t\t$config[] \t= $this->getLine('dbpass', \t\t$this->dbpass);\n\t\t$config[] \t= $this->getLine('log', \t\t$this->log);\n\t\t$config[] \t= $this->getLine('attempts', \t$this->attempts);\n\t\t$config[] \t= $this->getLine('delay', \t\t$this->delay);\n\t\t$config[] \t= $this->getLine('alarm', \t\t$this->alarm);\n\n\t\ttry {\n\t\t\tfile_put_contents(SendQueueDefs::CONFIGFILE, $config);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception $exception) {\n\t\t\tthrow new Exception(SendQueueDefs::ERROR_CONFIGFILE);\n\t\t}\n\n\t}",
"public function init()\n {\n $this->_basePath = dirname(dirname(__DIR__));\n\t if(!file_exists($this->_basePath . '/data/amazon.conf'))\n\t\t throw new Exception('data/amazon.conf doesn\\'t exist! Please reinstall the module!');\n\t $_config = file_get_contents($this->_basePath . '/data/amazon.conf');\n\t preg_match_all('/(.*)=(.*)/m', $_config, $configs, PREG_SET_ORDER, 0);\n\t foreach($configs as $match)\n\t\t $this->_config[$match[1]] = trim($match[2]);\n\n if(!empty($this->_config)){\n\t $domainlist = ['admin'=>[]];\n\t $_domains = urldecode($this->api_get('/CMD_API_SHOW_USER_DOMAINS?user=admin')).'&';\n\t preg_match_all('/(.*)=(.*)\\&/mU', $_domains, $domains, PREG_SET_ORDER, 0);\n\t foreach($domains as $domain)\n\t \t$domainlist['admin'][$domain[1]] = 'pending';\n \t$_users = $this->api_get('/CMD_API_SHOW_ALL_USERS');\n\t preg_match_all('/(.*)=(.*)/m', $_users, $matches, PREG_SET_ORDER, 0);\n\t foreach($matches as $match) {\n\t\t $domainlist[$match[2]] = [];\n\t\t $_domains = urldecode($this->api_get('/CMD_API_SHOW_USER_DOMAINS?user='.$match[2])).'&';\n\t\t preg_match_all('/(.*)=(.*)\\&/mU', $_domains, $domains, PREG_SET_ORDER, 0);\n\t\t foreach($domains as $domain)\n\t\t\t $domainlist[$match[2]][$domain[1]] = 'pending';\n\t }\n\t $this->_domains = $domainlist;\n }else{\n throw new Exception('No config data available!');\n }\n }",
"protected function _generate_web_aliases($share)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $name = $share['Name'];\n $config_aliases = array();\n\n // cgi-bin Alias must come first\n\n if ($share['WebCgi']) \n $config_aliases[] = \"ScriptAlias /flexshare/$name/cgi-bin/ \" . self::SHARE_PATH . \"/$name/cgi-bin/\";\n\n if (empty($share['ShareInternal'])) {\n $server_names[] = $name . '.' . trim($share['WebServerName']);\n $share_aliases[] = \"/flexshare/$name\";\n $document_roots[] = self::SHARE_PATH . \"/$name\";\n } else if ($share['ShareInternal'] == 2) {\n $server_names[] = $name . '.' . trim($share['WebServerName']);\n $share_aliases[] = \"/flexshare/$name\";\n $document_roots[] = self::SHARE_PATH . \"/$name\";\n } else {\n $server_names[] = trim($share['WebServerName']);\n $share_aliases[] = \"/flexshare/$name\";\n $document_roots[] = $share['ShareDir'];\n }\n\n // Build aliases\n //--------------\n\n $inx = 0;\n\n foreach ($server_names as $server_name) {\n if (empty($share['ShareInternal'])) {\n $config_aliases[] = \"Alias \" . $share_aliases[$inx] . \" \" . self::SHARE_PATH . \"/$name\\n\";\n } else if ($share['ShareInternal'] == 2) {\n if (!empty($share_aliases[$inx]))\n $config_aliases[] = \"Alias \" . $share_aliases[$inx] . \" \" . $document_roots[$inx] . \"\\n\";\n }\n\n $inx++;\n }\n\n return $config_aliases;\n }",
"function config_upgrade_40() {\n\tglobal $config;\n\n\t$a_share = &array_make_branch($config,'nfsd','share');\n\t$a_export = &array_make_branch($config,'nfsd','export','param');\n\t$a_root = &array_make_branch($config,'nfsd','root','param');\n\tforeach($a_share as $r_share):\n\t\t$r_param = [];\n\t\t$r_param['enable'] = true;\n\t\t$r_param['uuid'] = $r_share['uuid'] ?? uuid();\n\t\t$r_param['path'] = $r_share['path'] ?? '/';\n\t\t$r_param['network'] = $r_share['network'] ?? '';\n\t\t$r_param['description'] = $r_share['comment'] ?? '';\n\t\tif(array_key_exists('v4rootdir',$r_share)):\n\t\t\t$a_root[] = $r_param;\n\t\telse:\n\t\t\t$r_param['mapall'] = $r_share['mapall'] ?? 'nomap';\n\t\t\t$r_param['opt_alldirs'] = isset($r_share['options']['alldirs']);\n\t\t\t$r_param['opt_readonly'] = isset($r_share['options']['ro']);\n\t\t\t$r_param['opt_quiet'] = isset($r_share['options']['quiet']);\n\t\t\t$a_export[] = $r_param;\n\t\tendif;\n\tendforeach;\n\tunset($config['nfsd']['share']);\n}",
"function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\nif (!defined('PDNSADMIN')) {\n header('HTTP/1.0 403 Forbidden');\n die;\n}\n\n\\$set = array();\n\n\";\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}",
"function setConfig(){\r\n\t\t$file = \"DATABASE.config\";\r\n\t\t$f = fopen($file, \"r\");\r\n\t\t$start = false;\r\n\t\twhile ($line = fgets($f, 1000)) {\r\n\t\t $arrayLine = explode('=', $line);\r\n\t\t $lineParams = $arrayLine[0];\r\n\t\t $lineValue = str_replace(\"\\n\",\"\",$arrayLine[1]);\r\n\t\t $lineValue = str_replace(\"\\r\",\"\",$lineValue);\r\n\t\t if($lineParams == \"HOST\")$this->hostName = $lineValue;\r\n\t\t if($lineParams == \"USER\")$this->userMysql = $lineValue;\r\n\t\t if($lineParams == \"PASSWORD\")$this->passwordMysql = $lineValue;\r\n\t\t if($lineParams == \"DATABASENAME\")$this->databaseName = $lineValue;\r\n\t\t}\r\n\t\treturn array(\r\n\t\t\t\"HOST\" => $this->hostName,\r\n\t\t\t\"USER\" => $this->userMysql,\r\n\t\t\t\"PASSWORD\" => $this->passwordMysql,\r\n\t\t\t\"DATABASENAME\" => $this->databaseName,\r\n\t\t);\r\n\t}",
"function wrk_mpdconf($outpath,$db) {\n\t$dbh = cfgdb_connect($db);\n\t$query_cfg = \"SELECT param,value_player FROM cfg_mpd WHERE value_player!=''\";\n\t$mpdcfg = sdbquery($query_cfg,$dbh);\n\t$dbh = null;\n\n\t\n\t\n// set mpd.conf file header\n\t$output = \"###################################\\n\";\n\t$output .= \"# Auto generated mpd.conf file\\n\";\n\t$output .= \"# please DO NOT edit it manually!\\n\";\n\t$output .= \"# Use player-UI MPD config section\\n\";\n\t$output .= \"###################################\\n\";\n\t$output .= \"\\n\";\n \n// parse DB output\n\tforeach ($mpdcfg as $cfg) {\n\t\tif ($cfg['param'] == 'audio_output_format' && $cfg['value_player'] == 'disabled'){\n\t\t$output .= '';\n\t\t} else if ($cfg['param'] == 'dop') {\n\t\t$dop = $cfg['value_player'];\n\t\t} else if ($cfg['param'] == 'priority') {\n\t\t$priority = $cfg['value_player'];\n\t\t} else if ($cfg['param'] == 'device') {\n\t\t$device = $cfg['value_player'];\n\t\tvar_export($device);\n\t\t// $output .= '';\n\t\t} else if ($cfg['param'] == 'mixer_type' && $cfg['value_player'] == 'hardware' ) { \n\t\t// $hwmixer['device'] = 'hw:0';\n\t\t$hwmixer['control'] = alsa_findHwMixerControl($device);\n\t\t// $hwmixer['index'] = '1';\n\t\t} else {\n\t\t$output .= $cfg['param'].\" \\t\\\"\".$cfg['value_player'].\"\\\"\\n\";\n\t\t}\n\t}\n\n// format audio input / output interfaces\n\t$output .= \"max_connections \\\"30\\\"\\n\";\n\t$output .= \"\\n\";\n\t$output .= \"realtime_option {\\n\";\n\t$output .= \"memlock \\\"yes\\\"\\n\";\n\t$output .= \"stack_reserve \\\"1024\\\"\\n\";\t\n\t$output .= \"heap_reserve \\\"10240\\\"\\n\";\t\n\t$output .= \"main_priority \\\"OTHER:0\\\"\\n\";\t\n\t$output .= \"player_priority \\\"FIFO:50\\\"\\n\";\t\n\t$output .= \"decoder_priority \\\"FIFO:47\\\"\\n\";\t\n\t$output .= \"}\\n\";\n\t$output .= \"\\n\";\t\n\t$output .= \"decoder {\\n\";\n\t$output .= \"\\t\\tplugin \\\"ffmpeg\\\"\\n\";\n\t$output .= \"\\t\\tenabled \\\"yes\\\"\\n\";\n\t$output .= \"}\\n\";\n\t$output .= \"\\n\";\n\t$output .= \"input {\\n\";\n\t$output .= \"\\t\\tplugin \\\"curl\\\"\\n\";\n\t$output .= \"}\\n\";\n\t$output .= \"\\n\";\n\t$output .= \"audio_output {\\n\\n\";\n\t$output .= \"\\t\\t type \\t\\t\\\"alsa\\\"\\n\";\n\t$output .= \"\\t\\t name \\t\\t\\\"Output\\\"\\n\";\n\t$output .= \"\\t\\t device \\t\\\"hw:\".$device.\",0\\\"\\n\";\n\tif (isset($hwmixer)) {\n\t//$output .= \"\\t\\t mixer_device \\t\\\"\".$hwmixer['device'].\"\\\"\\n\";\n\t$output .= \"\\t\\t mixer_control \\t\\\"\".$hwmixer['control'].\"\\\"\\n\";\n\t$output .= \"\\t\\t mixer_device \\t\\\"hw:\".$device.\"\\\"\\n\";\n\t$output .= \"\\t\\t mixer_index \\t\\\"0\\\"\\n\";\n\t//$output .= \"\\t\\t mixer_index \\t\\\"\".$hwmixer['index'].\"\\\"\\n\";\n\t}\n\t$output .= \"\\t\\t dop \\t\\\"\".$dop.\"\\\"\\n\";\n\t$output .= \"\\t\\t priority \\t\\\"\".$priority.\"\\\"\\n\";\n\t$output .= \"\\n}\\n\";\n\n// write mpd.conf file\n\t$fh = fopen($outpath.\"/mpd.conf\", 'w');\n\tfwrite($fh, $output);\n\tfclose($fh);\n}",
"private static function setupBaseConfiguration() {\n\n\t\t// server data\n\t\tself::set('host', $_SERVER['SERVER_NAME']);\n\t\tself::set('domain', 'http://' . $_SERVER['SERVER_NAME']);\n\t\tself::set('current_file', basename($_SERVER['PHP_SELF']));\n\t\tself::set('webroot', '/');\n\t\tself::set('web_address', self::get('domain') . self::get('webroot'));\n\t\tself::set('web_address_no_slash', substr(self::get('domain') . self::get('webroot'), 0, -1));\n\t\tself::set('root', $_SERVER['DOCUMENT_ROOT'] . self::get('webroot'));\n\t\t\n\t\t// folder locations\n\t\tself::set('modules', self::get('root') . 'modules/');\n\t\tself::set('config', self::get('root') . 'app/config/');\n self::set('temp', self::get('root') . 'runtime/');\n self::set('app', self::get('root') . 'app/');\n\t\t\n\t\t// errors\n\t\tself::set('error_log', self::get('temp') . 'errors/php.txt');\n\n\t\tself::parseIniConfig('system');\n self::parseIniConfig('source');\n self::parseIniConfig('custom');\n \n }",
"function theme_esco_ldap_config(){\n global $DB;\n $configs = $DB->get_records('config_plugins', array(\"plugin\" => \"enrol_simplesco\"));\n $config = array(\n \"host_url\" => \"\",\n \"bind_dn\" => \"\",\n \"bind_pw\" => \"\",\n \"branch\" => \"\",\n );\n\n foreach($configs as $tmp){\n if(isset($config[$tmp->name])){\n $config[$tmp->name] = $tmp->value;\n }\n }\n\n $config[\"branch\"] = str_ireplace(\"people\",\"structures\",$config[\"branch\"]);\n return $config;\n}"
] | [
"0.6129952",
"0.6112094",
"0.5938857",
"0.57451165",
"0.55411404",
"0.5516494",
"0.54800355",
"0.54198945",
"0.5365908",
"0.53429395",
"0.53282285",
"0.52996856",
"0.52733773",
"0.5271555",
"0.5216584",
"0.5206126",
"0.51994944",
"0.51854026",
"0.51719517",
"0.51429886",
"0.51356405",
"0.5095842",
"0.5059055",
"0.5044409",
"0.5020849",
"0.5008027",
"0.49869993",
"0.49869892",
"0.49406883",
"0.49310625"
] | 0.71018934 | 0 |
Create the ProFtp configuration files for the specificed flexshare. | protected function _generate_ftp_flexshares()
{
clearos_profile(__METHOD__, __LINE__);
if (!clearos_library_installed('ftp/ProFTPd'))
return;
$confs = array();
$proftpd = new ProFTPd();
// Create a unique file identifier
$backup_key = time();
// Get file listing in FTP confs dir
$folder = new Folder(self::FTP_VIRTUAL_HOST_PATH);
if (!$folder->exists())
return;
$confs = $folder->get_listing();
$index = 0;
foreach ($confs as $conf) {
if (preg_match("/^" . self::PREFIX . ".*conf$/i", $conf)) {
$conf_file = new File(self::FTP_VIRTUAL_HOST_PATH . "/" . $conf);
// Backup existing file
$conf_file->move_to(self::PATH_TEMP . "/$conf.$backup_key.bak");
} else {
unset($confs[$index]);
}
$index++;
}
$shares = $this->_get_shares(self::TYPE_ALL);
$ftps_filename = '';
// Recreate all virtual configs
foreach ($shares as $name => $share) {
$newlines = array();
$append = FALSE;
// If not enabled, continue through loop - we're re-creating lines here
if (!isset($share['ShareEnabled']) || !$share['ShareEnabled'])
continue;
if (!isset($share['FtpEnabled']) || !$share['FtpEnabled'])
continue;
// Add group greeting file
try {
// This isn't fatal. Log and continue on exception
$file = new File(self::SHARE_PATH . "/$name/.flexshare-group.txt");
if ($file->exists())
$file->delete();
if ($share['FtpGroupGreeting']) {
$file->create("root", "root", 644);
$file->add_lines($share['FtpGroupGreeting'] . "\n");
}
} catch (Exception $e) {
//
}
// Need to know which file we'll be writing to.
// We determine this by port
// Ie. /etc/proftpd.d/flex-<port>.conf
// Port
if ($share['FtpOverridePort'])
$port = $share['FtpPort'];
else
$port = self::DEFAULT_PORT_FTP;
// Passive mode flag
$pasv = '';
if ($share['FtpAllowPassive'])
$pasv = ' PASV';
// Overwrite permission
if ((int)$share['FtpGroupPermission'] == self::PERMISSION_WRITE_PLUS)
$group_write = 'on';
else if ((int)$share['FtpGroupPermission'] == self::PERMISSION_READ_WRITE_PLUS)
$group_write = 'on';
else
$group_write = 'off';
// Create new file in parallel
$filename = self::PREFIX . $port . '.conf';
$ftps_filename = self::PREFIX . '990' . '.conf';
// Add to confs array in case of failure
if (!in_array($filename, $confs))
$confs[] = $filename;
$file = new File(self::FTP_VIRTUAL_HOST_PATH . "/" . $filename);
$tempfile = new File(self::FTP_VIRTUAL_HOST_PATH . "/" . $filename . '.cctmp');
if ($tempfile->exists())
$tempfile->delete();
$tempfile->create('root', 'root', '0644');
if ($file->exists()) {
$oldlines = $file->get_contents_as_array();
$found_start = FALSE;
$linestoadd = "";
foreach ($oldlines as $line) {
if (preg_match("/^\s*# DNR:Webconfig start - $name$/", $line))
$found_start = TRUE;
if ($found_start && preg_match("/^\s*# DNR:Webconfig end - $name$/", $line)) {
$found_start = FALSE;
continue;
}
if ($found_start)
continue;
$linestoadd .= $line . "\n";
// We need to know if we are working on top of another define or not
$append = TRUE;
}
$tempfile->add_lines($linestoadd);
}
try {
$proftpd_conf = new File(ProFTPd::FILE_CONFIG);
$proftpd_conf->lookup_line("/Include \/etc\/proftpd.d\/\*.conf/i");
} catch (File_No_Match_Exception $e) {
// Need this line to include flexshare confs
$proftpd_conf->add_lines("Include /etc/proftpd.d/*.conf\n");
} catch (Exception $e) {
throw new Engine_Exception(clearos_exception_message($e), CLEAROS_ERROR);
}
if (! $append) {
$newlines[] = self::WRITE_WARNING;
// Note: event system will automatically handle IP address changes.
$iface_manager = new Iface_Manager();
$external_ips = $iface_manager->get_external_ip_addresses();
$trusted_ips = $iface_manager->get_most_trusted_ips();
$ips = array_merge($external_ips, $trusted_ips);
$ip_list = implode(' ', array_unique($ips));
$newlines[] = "<VirtualHost $ip_list>";
$newlines[] = "\tPort $port";
$newlines[] = "\tDefaultRoot " . self::SHARE_PATH . "/";
$newlines[] = "\tRequireValidShell off";
$newlines[] = "\tAuthPam on";
$newlines[] = "\tAuthPAMConfig proftpd";
if ($share["FtpPassivePortMin"] && $share["FtpPassivePortMax"])
$newlines[] = "\tPassivePorts " . $share["FtpPassivePortMin"] . " " . $share["FtpPassivePortMax"];
$newlines[] = "\tCapabilitiesEngine on";
$newlines[] = "\tCapabilitiesSet +CAP_CHOWN";
$newlines[] = "";
$newlines[] = "\t<Limit LOGIN CDUP PWD XPWD LIST PROT$pasv>";
$newlines[] = "\t\tAllowAll";
$newlines[] = "\t</Limit>";
$newlines[] = "\t<Limit ALL>";
$newlines[] = "\t\tDenyAll";
$newlines[] = "\t</Limit>";
$newlines[] = "";
// FTPES (SSL)
// if ($share['FtpEnableFtpes']) {
$newlines[] = "\t<IfModule mod_tls.c>";
$newlines[] = "\t\tTLSEngine on";
$newlines[] = "\t\tTLSLog /var/log/tls.log";
$newlines[] = "\t\tTLSOptions NoCertRequest";
$newlines[] = "\t\tTLSRequired off";
$newlines[] = "\t\tTLSRSACertificateFile /etc/pki/CA/bootstrap.crt";
$newlines[] = "\t\tTLSRSACertificateKeyFile /etc/pki/CA/bootstrap.key";
$newlines[] = "\t\tTLSVerifyClient off";
$newlines[] = "\t</IfModule>";
$newlines[] = "\n";
} else {
if ($share['FtpAllowPassive']) {
$tempfile->replace_lines(
"/\sPassivePorts \d+\s+\d+/",
"\tPassivePorts " . $share['FtpPassivePortMin'] . " " . $share['FtpPassivePortMax'] . "\n"
);
}
}
// Add flexshare specific directory directives
$newlines[] = "\t# DNR:Webconfig start - $name";
$newlines[] = "\t<Directory " . self::SHARE_PATH . "/$name>";
$newlines[] = "\t\tAllowOverwrite " . $group_write;
$newlines[] = "\t\tAllowRetrieveRestart on";
$newlines[] = "\t\tAllowStoreRestart on";
$newlines[] = "\t\tDisplayChdir .flexshare-group.txt TRUE";
$newlines[] = "\t\tHideNoAccess on";
$newlines[] = "\t\tHideFiles (.flexshare)";
$newlines[] = "\t\tGroupOwner \"" . $share["ShareGroup"] . "\"";
$newlines[] = "\t\tUmask 0113 0002";
$newlines[] = "\t\t<Limit " . $this->access[$share['FtpGroupPermission']] . "$pasv>";
$newlines[] = "\t\t AllowGroup \"" . $share['ShareGroup'] . "\"";
$newlines[] = "\t\t IgnoreHidden on";
$newlines[] = "\t\t</Limit>";
$newlines[] = "\t\t<Limit ALL>";
$newlines[] = "\t\t DenyAll";
$newlines[] = "\t\t</Limit>";
$newlines[] = "\t</Directory>";
$newlines[] = "\t# DNR:Webconfig end - $name";
$newlines[] = "";
if ($append) {
$tempfile->delete_lines("/<\/VirtualHost>/");
$tempfile->add_lines(implode("\n", $newlines) . "\n</VirtualHost>\n");
} else {
$tempfile->add_lines(implode("\n", $newlines) . "\n</VirtualHost>\n");
}
$tempfile->move_to(self::FTP_VIRTUAL_HOST_PATH . "/" . $filename);
}
// Validate proftpd configuration before restarting server
$config_ok = TRUE;
try {
$options['validate_exit_code'] = FALSE;
$shell = new Shell();
// TODO: this fails on DNS lookup issues
//$exitcode = $shell->execute(self::CMD_VALIDATE_PROFTPD, '-t', TRUE, $options);
$exitcode = 0;
} catch (Exception $e) {
$config_ok = FALSE;
}
if ($exitcode !== 0) {
$config_ok = FALSE;
$output = $shell->get_output();
clearos_log(self::LOG_TAG, "Invalid ProFTP configuration!");
foreach ($output as $line)
clearos_log(self::LOG_TAG, $line);
}
foreach ($confs as $conf) {
// Not a flexshare conf file
if (!isset($conf))
continue;
$file = new File(self::PATH_TEMP . "/$conf.$backup_key.bak");
if (! $file->exists()) {
// Conf was newly created
$file = new File(self::FTP_VIRTUAL_HOST_PATH . "/$conf");
if (! $config_ok)
$file->delete();
continue;
}
if ($config_ok) {
// Delete backups
$file->delete();
} else {
// Recover backups
$file->move_to(self::FTP_VIRTUAL_HOST_PATH . "/$conf");
}
}
if (!$config_ok)
throw new Engine_Exception(lang('flexshare_config_validation_failed'));
// Copy to FTPS configuration
if (!empty($ftps_filename)) {
$base_config = new File(self::FTP_VIRTUAL_HOST_PATH . '/' . $filename);
$lines = $base_config->get_contents_as_array();
$newlines = array();
foreach ($lines as $line) {
if (preg_match("/^\s*Port\s+[\d]+$/", $line))
$newlines[] = "\tPort 990";
else if (preg_match("/^\s*TLSOptions\s+/", $line))
$newlines[] = "\t\tTLSOptions NoCertRequest UseImplicitSSL";
else
$newlines[] = $line;
}
$file = new File(self::FTP_VIRTUAL_HOST_PATH . '/' . $ftps_filename);
if ($file->exists())
$file->delete();
$file->create('root', 'root', '0644');
$file->dump_contents_from_array($newlines);
}
if ($config_ok) {
try {
$proftpd = new ProFTPd();
$proftpd->reset(TRUE);
} catch (Exception $e) {
// Keep going
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createConfig()\n\t{\n\t\t$configFilename = __DIR__ . '/app/config/config.local.neon';\n\n\t\tcopy(__DIR__ . '/app/config/config.local.example.neon', $configFilename);\n\n\t\t$lines = file($configFilename);\n\n\t\tforeach ($lines as $key => $line)\n\t\t{\n\t\t\tforeach (array('username', 'password', 'database') as $subject)\n\t\t\t{\n\t\t\t\tif (strpos($line, \"\\t\" . $subject))\n\t\t\t\t{\n\t\t\t\t\t$lines[$key] = $this->deleteNewline($line, \"\\n\") . ' ' . $this->config['db'][$subject] . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (file_put_contents($configFilename, $lines))\n\t\t{\n\t\t\t$this->success('Local config file created ...');\n\t\t}\n\t}",
"function auto_configure()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n if (clearos_library_installed('ftp/ProFTPd')) {\n $this->_generate_ftp_flexshares();\n\n $proftpd = new ProFTPd();\n $proftpd->reset(TRUE);\n }\n } catch (Exception $e) {\n // Not fatal\n }\n\n try {\n if (clearos_library_installed('web_server/Httpd')) {\n $this->_generate_web_flexshares();\n\n $httpd = new Httpd();\n $httpd->reset(TRUE);\n }\n } catch (Exception $e) {\n // Not fatal\n }\n }",
"protected function _generate_file_flexshares()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('samba_common/Samba'))\n return;\n\n $samba = new Samba();\n\n if (! $samba->is_file_server())\n return;\n\n // Create a unique file identifier\n $backup_key = time();\n\n // Backup original file\n $backup = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);\n if ($backup->exists()) {\n $backup->move_to(self::PATH_TEMP . \"/$backup_key.bak\");\n $backup_exists = TRUE;\n } else {\n $backup_exists = FALSE;\n }\n\n // Samba is slightly different. We dump all flexshare-related 'stuff' in one file\n $file = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);\n if ($file->exists())\n $file->delete();\n\n $file->create('root', 'root', '0644');\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n $linestoadd = '';\n\n // Recreate samba flexshare.conf\n\n foreach ($shares as $name => $share) {\n // If not enabled, continue through loop - we're re-creating lines here\n if (! isset($share['ShareEnabled']) || ! $share['ShareEnabled'])\n continue;\n\n if (! isset($share['FileEnabled']) || ! $share['FileEnabled'])\n continue;\n\n $linestoadd .= \"[\" . $name . \"]\\n\";\n $linestoadd .= \"\\tpath = \" . $share[\"ShareDir\"] . \"\\n\";\n $linestoadd .= \"\\tcomment = \" . $share[\"FileComment\"] . \"\\n\";\n $linestoadd .= \"\\tbrowseable = Yes\\n\";\n\n if ((int)$share[\"FilePermission\"] == self::PERMISSION_READ_WRITE)\n $linestoadd .= \"\\tread only = No\\n\";\n\n if (isset($share[\"FilePublicAccess\"]) && $share[\"FilePublicAccess\"]) {\n $linestoadd .= \"\\tguest ok = Yes\\n\";\n } else {\n $linestoadd .= \"\\tguest ok = No\\n\";\n $linestoadd .= \"\\tdirectory mask = 0775\\n\";\n $linestoadd .= \"\\tcreate mask = 0664\\n\";\n $linestoadd .= \"\\tvalid users = @\\\"%D\" . '\\\\' . trim($share[\"ShareGroup\"]) . \"\\\", @\" .\n trim($share[\"ShareGroup\"]) . \"\\n\";\n }\n\n $linestoadd .= \"\\tveto files = /.flexshare*/\\n\";\n\n $vfsobject = \"\";\n\n if (isset($share[\"FileRecycleBin\"]) && $share[\"FileRecycleBin\"]) {\n $vfsobject .= \" recycle:recycle\";\n $linestoadd .= \"\\trecycle:repository = .trash/%U\\n\";\n $linestoadd .= \"\\trecycle:maxsize = 0\\n\";\n $linestoadd .= \"\\trecycle:versions = Yes\\n\";\n $linestoadd .= \"\\trecycle:keeptree = Yes\\n\";\n $linestoadd .= \"\\trecycle:touch = No\\n\";\n $linestoadd .= \"\\trecycle:directory_mode = 0775\\n\";\n }\n\n if (isset($share[\"FileAuditLog\"]) && $share[\"FileAuditLog\"]) {\n $vfsobject .= \" full_audit:audit\";\n $linestoadd .= \"\\taudit:prefix = %u\\n\";\n $linestoadd .= \"\\taudit:success = open opendir\\n\";\n $linestoadd .= \"\\taudit:failure = all\\n\";\n $linestoadd .= \"\\taudit:facility = LOCAL5\\n\";\n $linestoadd .= \"\\taudit:priority = NOTICE\\n\";\n }\n\n if ($vfsobject)\n $linestoadd .= \"\\tvfs object =$vfsobject\\n\";\n\n $linestoadd .= \"\\n\";\n }\n\n $file->add_lines($linestoadd);\n\n // Make sure Samba has flexshare include\n //--------------------------------------\n\n $samba->add_include('/etc/samba/flexshare.conf');\n\n // Validate smbd configuration\n //----------------------------\n\n $config_ok = TRUE;\n\n try {\n $shell = new Shell();\n $options['validate_exit_code'] = FALSE;\n $exitcode = $shell->execute(self::CMD_VALIDATE_SMBD, '-s', FALSE, $options);\n } catch (Exception $e) {\n $config_ok = FALSE;\n clearos_log(self::LOG_TAG, \"Invalid Samba config: \" . clearos_exception_message($e));\n }\n\n if ($config_ok) {\n // Delete backups\n if ($backup_exists)\n $backup->delete();\n } else {\n // Recover backups\n if ($backup_exists) {\n try {\n $backup->move_to(self::SMB_VIRTUAL_HOST_PATH . \"/\" . self::FILE_SMB_VIRTUAL);\n } catch (Exception $e) {\n // Supresss error here...could be same file\n }\n }\n\n throw new Engine_Exception(lang('flexshare_config_validation_failed'));\n }\n }",
"public function createStructure() {\n\t\t$output = $this->sshCommand('rm -rf ' . $this->directory . '*');\n\t\t$output = $this->sshCommand('mkdir -p ' . $this->directory . 'shared/Configuration/Production');\n\t\t$this->sshCommand('cp ' . $this->directory . '../Settings.yaml ' . $this->directory . '/shared/Configuration/Production/Settings.yaml ');\n\t\t$output = $this->sshCommand('cd ' . $this->directory . ' && ln -s releases/current/Web Web');\n\t}",
"private function CreateConfigFile()\n {\n $f = @fopen(dirname(__FILE__) . '/' . $this->configFile, 'wb');\n fclose($f);\n }",
"public function copyConfigFiles()\n {\n $cfg = Storage::disk('projects')->get($this->project->path . '/cfg/yolo.cfg');\n $data = Storage::disk('projects')->get($this->project->path . '/data/obj.data');\n $names = Storage::disk('projects')->get($this->project->path . '/data/obj.names');\n\n Storage::put($this->jobPath . '/cfg/yolo.cfg', $cfg);\n Storage::put($this->jobPath . '/data/obj.data', $data);\n Storage::put($this->jobPath . '/data/obj.names', $names);\n }",
"private static function createConfigFile() {\n $args = array();\n $args[\"dbname\"] = self::$config->getDbName();\n $args[\"dbuser\"] = self::$config->getDbUser();\n if (self::$config->getDbPassword()) $args[\"dbpass\"] = self::$config->getDbPassword();\n if (self::$config->getDbHost()) $args[\"dbhost\"] = self::$config->getDbHost();\n\n self::runWpCliCommand(\"core\", \"config\", $args);\n }",
"private function createConfigFile(): void\n {\n if (!file_exists($this->getModulePath() . '/config.php')) {\n $configFile = fopen($this->getModulePath() . '/config.php', 'a+');\n $content = require __DIR__ . '/templates/config.php';\n fputs($configFile, $content);\n fclose($configFile);\n }\n }",
"private static function setupBaseConfiguration() {\n\n\t\t// server data\n\t\tself::set('host', $_SERVER['SERVER_NAME']);\n\t\tself::set('domain', 'http://' . $_SERVER['SERVER_NAME']);\n\t\tself::set('current_file', basename($_SERVER['PHP_SELF']));\n\t\tself::set('webroot', '/');\n\t\tself::set('web_address', self::get('domain') . self::get('webroot'));\n\t\tself::set('web_address_no_slash', substr(self::get('domain') . self::get('webroot'), 0, -1));\n\t\tself::set('root', $_SERVER['DOCUMENT_ROOT'] . self::get('webroot'));\n\t\t\n\t\t// folder locations\n\t\tself::set('modules', self::get('root') . 'modules/');\n\t\tself::set('config', self::get('root') . 'app/config/');\n self::set('temp', self::get('root') . 'runtime/');\n self::set('app', self::get('root') . 'app/');\n\t\t\n\t\t// errors\n\t\tself::set('error_log', self::get('temp') . 'errors/php.txt');\n\n\t\tself::parseIniConfig('system');\n self::parseIniConfig('source');\n self::parseIniConfig('custom');\n \n }",
"protected function _createFpmPool()\n {\n $fpmPoolFileName = $this->_fpmPoolDirectory . $this->_fpmPool . '.conf';\n\n $this->log(\"\\nChecking PHP-FPM pool file [$fpmPoolFileName]\");\n\n list($devUser, $devGroup) = $this->getMyOwner();\n $devUserQuoted = fpm_quote($devUser);\n $devGroupQuoted = fpm_quote($devGroup);\n\n $nginxOwner = getNginxOwner();\n $socketUserQuoted = fpm_quote($nginxOwner['user']);\n $socketGroupQuoted = fpm_quote($nginxOwner['group']);\n\n $poolConfig = <<<POOLCONFIG\n[$this->_fpmPool]\n\nuser = $devUserQuoted\ngroup = $devGroupQuoted\n\nlisten.owner = $socketUserQuoted\nlisten.group = $socketGroupQuoted\nlisten = $this->_fpmListenSocket\n\npm = dynamic\n\n; max requests concurrency\npm.max_children = 80\n\n; min fpm instances which should be available always\npm.start_servers = 10\n\n; min additional instances if pm.start_servers aren't enough to handle all requests\npm.min_spare_servers = 5\n\n; max additional instances if pm.start_servers is not enough to handle all requests\npm.max_spare_servers = 15\n\nphp_value[memory_limit] = 1G\nphp_value[error_reporting] = E_ALL|E_STRICT\nphp_value[max_execution_time] = 0\nphp_value[max_input_time] = -1\nphp_value[short_open_tag] = 1\nphp_value[display_errors] = 1\nphp_value[log_errors] = 1\n\n; disable user agent verification to not break multiple image upload\nphp_value[suhosin.session.cryptua] = 0\n\n; turn off compatibility with PHP4 when dealing with objects\nphp_value[zend.ze1_compatibility_mode] = 0\n\n; Disable APC\nphp_value[apc.enabled] = 0\nphp_value[apc.cache_by_default] = 0\n\nPOOLCONFIG;\n\n $this->log(\"Creating new PHP-FPM pool file.\");\n file_put_contents($fpmPoolFileName, $poolConfig);\n\n $this->_fpmRestartRequired = true;\n\n $this->log('Done');\n }",
"function config_install($conffile) {\n\tglobal $g,$config;\n\n\tif(!file_exists($conffile)):\n\t\treturn 1;\n\tendif;\n\tconfig_lock();\n\tconf_mount_rw();\n\t$result = copy($conffile,\"{$g['conf_path']}/config.xml\");\n\tconf_mount_ro();\n\tconfig_unlock();\n\tif(true === $result):\n\t\twrite_loader_config();\n\t\treturn 0;\n\tendif;\n\treturn 1;\n}",
"public function prepareUploadDirs() {\n\n $uploadPath = $this->_params->connect->supportingDocFilePath;\n if(!file_exists($uploadPath)) {\n mkdir($uploadPath, 0777);\n }\n if(!file_exists($uploadPath.$this->_onlineclaimDir.\"/\")) {\n mkdir($uploadPath.$this->_onlineclaimDir.\"/\", 0777);\n }\n if(!file_exists($uploadPath.$this->_onlineclaimDir.\"/\".$this->_agentSchemeNumber.\"/\")) {\n mkdir($uploadPath.$this->_onlineclaimDir.\"/\".$this->_agentSchemeNumber.\"/\", 0777);\n }\n\n $supportDocPath = $uploadPath.$this->_onlineclaimDir.\"/\".$this->_agentSchemeNumber.\"/\".$this->_claimReferenceNumber.\"/\";\n\n if(!file_exists($supportDocPath)) {\n mkdir($supportDocPath, 0777);\n }\n\n }",
"private static function prepareFiles() {\n self::ensureCleanInstallationIsAvailable();\n FileSystem::setPermisionsForGitDirectory(self::$config->getSitePath()); // Windows hack (enables to delete files under .git/objects directory)\n \\Nette\\Utils\\FileSystem::delete(self::$config->getSitePath() . '/*');\n \\Nette\\Utils\\FileSystem::copy(self::getCleanInstallationPath(), self::$config->getSitePath());\n }",
"function gen_astmanproxy_conf()\n{\n\tglobal $__BRD_SUM__;\n\tglobal $__BRD_HEAD__;\n\t$cfg_path = '/etc/asterisk/gw/astmanproxy.conf';\t\n\t$usr_path = '/etc/asterisk/gw/astmanproxy.users';\n\t$default_ast_username = 'internalspecifyuser';\n\t$default_ast_password = '2rujzdndyznbg7u6xju';\n\t$default_amp_username = 'internalspecifyuser';\n\t$default_amp_password = 'xn60qvh9dqx1j6ekcj1';\n\n\tif(!file_exists($cfg_path)){\n\t\ttouch($cfg_path);\n\t}\n\n\t$cluster_info = get_cluster_info();\n\n\t$lock = lock_file($cfg_path);\n\t$contents = \"host = 127.0.0.1, 5038, $default_ast_username, $default_ast_password, off, off\\n\";\n\tif($cluster_info['mode'] == 'master') {\n\t\tfor($b=2; $b<=$__BRD_SUM__; $b++) {\n\t\t\tif(isset($cluster_info[$__BRD_HEAD__.$b.'_ip']) && $cluster_info[$__BRD_HEAD__.$b.'_ip'] != '') {\n\t\t\t\t$ip = $cluster_info[$__BRD_HEAD__.$b.'_ip'];\n\t\t\t\t$contents .= \"host = $ip, 5038, $default_ast_username, $default_ast_password, off, off\\n\";\n\t\t\t} \n\t\t} \n\t} \n\n\t$contents .= \"listenaddress = *\\n\";\n\t$contents .= \"listenport = 1234\\n\";\n\t$contents .= \"inputformat = standard\\n\";\n\t$contents .= \"outputformat = standard\\n\";\n\t$contents .= \"autofilter = off\\n\";\n\t$contents .= \"authrequired = yes\\n\";\n\t$contents .= \"retryinterval = 2\\n\";\n\t$contents .= \"maxretries = 0\\n\";\n\t$contents .= \"sslclienthellotimeout = 200\\n\";\n\t$contents .= \"acceptencryptedconnection = yes\\n\";\n\t$contents .= \"acceptunencryptedconnection = yes\\n\";\n\t$contents .= \"asteriskwritetimeout=100\\n\";\n\t$contents .= \"clientwritetimeout=200\\n\";\n\n\tfile_put_contents($cfg_path, $contents);\n\tunlock_file($lock);\n\n\t/* generate astmanproxy.users */\n\t$lock = lock_file($usr_path);\n\tfile_put_contents($usr_path, \"$default_amp_username=$default_amp_password\\n\");\n\tunlock_file($lock);\n}",
"private static function _initSetting()\n {\n define('TFTP_HOST', \"172.17.0.3\");\n define('TFTP_FTP_USERNAME', \"fog\");\n define(\n 'TFTP_FTP_PASSWORD',\n \"hntHUsD11EGXMzOyPZr3TSw/1X3as5WfK8tAjoOJsPE=\"\n );\n define('TFTP_PXE_KERNEL_DIR', \"/var/www/html/fog//service/ipxe/\");\n define('PXE_KERNEL', 'bzImage');\n define('PXE_KERNEL_RAMDISK', 127000);\n define('USE_SLOPPY_NAME_LOOKUPS', true);\n define('MEMTEST_KERNEL', 'memtest.bin');\n define('PXE_IMAGE', 'init.xz');\n define('STORAGE_HOST', \"172.17.0.3\");\n define('STORAGE_FTP_USERNAME', \"fog\");\n define(\n 'STORAGE_FTP_PASSWORD',\n \"hntHUsD11EGXMzOyPZr3TSw/1X3as5WfK8tAjoOJsPE=\"\n );\n define('STORAGE_DATADIR', '/images/');\n define('STORAGE_DATADIR_CAPTURE', '/images/dev');\n define('STORAGE_BANDWIDTHPATH', '/fog/status/bandwidth.php');\n define('STORAGE_INTERFACE', 'eth0');\n define('CAPTURERESIZEPCT', 5);\n define('WEB_HOST', \"172.17.0.3\");\n define('WOL_HOST', \"172.17.0.3\");\n define('WOL_PATH', '//fog/wol/wol.php');\n define('WOL_INTERFACE', \"eth0\");\n define('SNAPINDIR', \"/opt/fog/snapins/\");\n define('QUEUESIZE', '10');\n define('CHECKIN_TIMEOUT', 600);\n define('USER_MINPASSLENGTH', 4);\n define('NFS_ETH_MONITOR', \"eth0\");\n define('UDPCAST_INTERFACE', \"eth0\");\n // Must be an even number! recommended between 49152 to 65535\n define('UDPCAST_STARTINGPORT', 63100);\n define('FOG_MULTICAST_MAX_SESSIONS', 64);\n define('FOG_JPGRAPH_VERSION', '2.3');\n define('FOG_REPORT_DIR', './reports/');\n define('FOG_CAPTUREIGNOREPAGEHIBER', true);\n }",
"private function create_wp_config()\n\t{\n\t\tcopy('assets/wp-config-start.php', $this->site_path.'wp-config.php');\n\n\t\t// read wp-config and salts into arrays\n\t\t$wp_config = file($this->site_path.'wp-config.php');\n\t\t$salts = file(\"https://api.wordpress.org/secret-key/1.1/salt/\");\n\n\t\t// define values for DB_NAME, DB_PASSWORD and all salts\n\t\t$wp_config[18] = \"define('DB_NAME', '\".$this->project_slug.\"');\\r\\n\";\n\t\t$wp_config[21] = \"define('DB_USER', '\".get_config('db_user').\"');\\r\\n\";\n\t\t$wp_config[24] = \"define('DB_PASSWORD', '\".get_config('db_pass').\"');\\r\\n\";\n\n\t\tfor($i=44, $j=0; $i<52; $i++, $j++) {\n\t\t\t$wp_config[$i] = $salts[$j];\n\t\t}\n\n\t\t// update wp-config file\n\t\tfile_put_contents($this->site_path.'wp-config.php', $wp_config);\n\t}",
"private static function _updateConfigFiles($vars) {\n\n $values = self::_buildParams($GLOBALS['_SERVER']);\n\n $path = $vars['argv'][0];\n\n $paths = array(\n 'tempPath' => str_replace('/scripts/configure', '/htdocs/setup/', $path),\n 'installationPath' => strip_tags($vars['WEB__contenido_DIR']) . '/'\n );\n\n // old http_path\n $fePath = file_get_contents($paths['installationPath'] . 'http_path.txt');\n\n // update config.php\n self::_updateConfig($fePath, $paths, $values, $vars);\n\n // update config.clients.php\n self::_updateClientConfig($fePath, $paths, $values);\n\n // update http_path.txt this file is used to identify the last value => needed for replacing\n // in config files\n self::_updateHttpPath($paths, $values);\n\n // update admin data => run cronjob\n self::_runAdminUpdateJob($vars, $values);\n }",
"Public static function setup() {\n\t\tself::$data = require PPAC_ROOT . \"config.php\";\n\t}",
"function createConfigFile() {\n\t\t$templateFilename = 'config.template.php';\n\t\t$templateHandle = fopen($templateFilename, \"r\");\n\t\tif($templateHandle) {\n\t\t\t/* open include configuration file write only */\n\t\t\t$includeFilename = 'config.inc.php';\n\t \t$includeHandle = fopen($includeFilename, \"w\");\n\t\t\tif($includeHandle) {\n\t\t\t \twhile (!feof($templateHandle)) {\n\t \t\t\t\t$buffer = fgets($templateHandle);\n\n\t\t \t\t\t/* replace _DBC_ variable */\n\t\t \t\t\t$buffer = str_replace( \"_DBC_SERVER_\", $this->dbHostname, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PORT_\", $this->dbPort, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_USER_\", $this->dbUsername, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PASS_\", $this->dbPassword, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_NAME_\", $this->dbName, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_TYPE_\", $this->dbType, $buffer);\n\n\t\t \t\t\t$buffer = str_replace( \"_SITE_URL_\", $this->siteUrl, $buffer);\n\n\t\t \t\t\t/* replace dir variable */\n\t\t \t\t\t$buffer = str_replace( \"_VT_ROOTDIR_\", $this->rootDirectory, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_CACHEDIR_\", $this->cacheDir, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_TMPDIR_\", $this->cacheDir.\"images/\", $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_UPLOADDIR_\", $this->cacheDir.\"upload/\", $buffer);\n\t\t\t \t$buffer = str_replace( \"_DB_STAT_\", \"true\", $buffer);\n\n\t\t\t\t\t/* replace charset variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_CHARSET_\", $this->vtCharset, $buffer);\n\n\t\t\t\t\t/* replace default lanugage variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_DEFAULT_LANGUAGE_\", $this->vtDefaultLanguage, $buffer);\n\n\t\t\t \t/* replace master currency variable */\n\t\t \t\t\t$buffer = str_replace( \"_MASTER_CURRENCY_\", $this->currencyName, $buffer);\n\n\t\t\t \t/* replace the application unique key variable */\n\t\t \t\t$buffer = str_replace( \"_VT_APP_UNIQKEY_\", md5(time() . rand(1,9999999) . md5($this->rootDirectory)) , $buffer);\n\n\t\t\t\t\t/* replace support email variable */\n\t\t\t\t\t$buffer = str_replace( \"_USER_SUPPORT_EMAIL_\", $this->adminEmail, $buffer);\n\n\t\t \t\tfwrite($includeHandle, $buffer);\n\t \t\t}\n\t \t\t\tfclose($includeHandle);\n\t \t\t}\n\t \t\tfclose($templateHandle);\n\t \t}\n\n\t \tif ($templateHandle && $includeHandle) {\n\t \t\treturn true;\n\t \t}\n\t \treturn false;\n\t}",
"function install_create_config($web_path,$username,$password,$hostname,$database) { \n\n $data['database_username'] = $username;\n $data['database_password'] = $password;\n $data['database_hostname'] = $hostname;\n $data['database_name'] = $database;\n\t$data['web_path']\t = $web_path; \n\n Config::set_by_array($data,'1');\n\n /* Attempt to make DB connection */\n $dbh = Dba::dbh();\n\n\t/* \n\t First Test The Variables they've given us to make\n\t sure that they actually work!\n\t*/\n\t// Connect to the DB\n\tif(!is_resource($dbh)) { \n\t\tError::add('general',\"Database Connection Failed Check Hostname, Username and Password\");\n\t\treturn false;\n\t}\n\tif (!$db_selected = @mysql_select_db($database, $dbh)) { \n\t\tError::add('general',\"Database Selection Failure Check Existance of $database\");\n\t\treturn false;\n\t}\n\n\t$final = generate_config($data); \n\n\t$browser = new Browser(); \n\t$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize('config/ampache.cfg.php.dist')); \n\techo $final; \n\texit();\n\n\treturn true;\n\n}",
"public function create() {\n //$this->configuration->setContainer($this->container);\n //$this->configuration->setConfigRootDirectory('/src/Garbanzo/Core');\n //$this->configuration->loadFile($this->mainConfigFileName);\n }",
"public function setConfigfile();",
"abstract public function setupConfig();",
"public static function WriteTemplateXML()\n\t{\n\t\t$theme = Input::clean($_POST['options']['frontend_theme'], 'FILENAME');\n//\t\t$theme = self::GetDBOptions('frontend_theme');\n\n\t\tif(!$theme) return false;\n\n\t\t$path = Path::Get('path:site').'/templates/'.$theme.'/_config.xml';\n\n\t\tif(!file_exists($path))\n\t\t\tdie('Could not find the _config.xml in template directory');\n\n\t\trequire \"Zend/Config/Writer/Xml.php\";\n\t\t$Zendconf = new Zend_Config(array(), true);\n\n\t\t//root\n\t\t$Zendconf->templateconfig = array();\n\n\t\t//autmatic thumbnails grabbing size:\n\t\t//only one size pair each.\n\t\t\t$Zendconf->templateconfig->picturegrab_thumbnailsize = array();\n\t\t\tif(isset($_POST['options']['picturegrab_thumbnailsize']))\n\t\t\t\t$Zendconf->templateconfig->picturegrab_thumbnailsize = self::$config['picturegrab_thumbnailsize'] = Input::clean($_POST['options']['picturegrab_thumbnailsize'], 'UINT');\n\n\t\t\t$Zendconf->templateconfig->videograb_thumbnailsize = array();\n\t\t\tif(isset($_POST['options']['videograb_thumbnailsize']))\n\t\t\t\t$Zendconf->templateconfig->videograb_thumbnailsize = self::$config['videograb_thumbnailsize'] = Input::clean($_POST['options']['videograb_thumbnailsize'], 'UINT');\n\n\t\t//model sizes\n\t\t\t$insert = array(); //multiple sizes ordered by internal_id\n\t\t\t$Zendconf->templateconfig->model_thumbnailsize = array();\n\t\t\t$Zendconf->templateconfig->model_thumbnailsize->size = array();\n\t\t\tif(isset($_POST['options']['model_thumbnailsize']))\n\t\t\t{\n\t\t\t\tforeach($_POST['options']['model_thumbnailsize'] as $pot)\n\t\t\t\t\t$insert[] = self::$config['model_thumbnailsize'] = Input::clean($pot, 'UINT');\n\t\t\t}\n\t\t\tif(!empty($insert))\n\t\t\t\t$Zendconf->templateconfig->model_thumbnailsize->size = $insert;\n\n\n\t\t//picture set sizes\n\t\t\t$insert = array(); //multiple sizes ordered by internal_id\n\t\t\t$Zendconf->templateconfig->picture_thumbnailsize = array();\n\t\t\t$Zendconf->templateconfig->picture_thumbnailsize->size = array();\n\t\t\tif(isset($_POST['options']['picture_thumbnailsize']))\n\t\t\t{\n\t\t\t\tforeach($_POST['options']['picture_thumbnailsize'] as $pot)\n\t\t\t\t\t$insert[] = self::$config['picture_thumbnailsize'] = Input::clean($pot, 'UINT');\n\t\t\t}\n\t\t\tif(!empty($insert))\n\t\t\t\t$Zendconf->templateconfig->picture_thumbnailsize->size = $insert;\n\n\t\t//video set sizes\n\t\t\t$insert = array(); //multiple sizes ordered by internal_id\n\t\t\t$Zendconf->templateconfig->video_thumbnailsize = array();\n\t\t\t$Zendconf->templateconfig->video_thumbnailsize->size = array();\n\t\t\tif(isset($_POST['options']['video_thumbnailsize']))\n\t\t\t{\n\t\t\t\tforeach($_POST['options']['video_thumbnailsize'] as $pot)\n\t\t\t\t\t$insert[] = self::$config['video_thumbnailsize'] = Input::clean($pot, 'UINT');\n\t\t\t}\n\t\t\tif(!empty($insert))\n\t\t\t\t$Zendconf->templateconfig->video_thumbnailsize->size = $insert;\n\n\n\t\t/* write */\n\t\t$writer = new Zend_Config_Writer_Xml();\n\t\t$writer->write($path, $Zendconf);\n\n\t\tunset($Zendconf);\n\t\tunset($writer);\n\n\t}",
"protected function copyConfigFiles()\n\t{\n\t\t$aFiles = $this->getConfigFiles();\n\n\t\tforeach ($aFiles as $aFile)\n\t\t{\n\t\t\t$this->checklist->addItem(\n\t\t\t\t'config_file_'.$aFile['basename'],\n\t\t\t\tcopy(\n\t\t\t\t\t$this->root().'/_install/'.$aFile['filename'],\n\t\t\t\t\tOKT_CONFIG_PATH.'/'.$aFile['filename']\n\t\t\t\t),\n\t\t\t\t'Copy config file '.$aFile['filename'],\n\t\t\t\t'Cannot copy config file '.$aFile['filename']\n\t\t\t);\n\t\t}\n\t}",
"private function createWordpressConfig(): void\n {\n try {\n $io = $this->getIO();\n foreach (self::$configurationFiles as $item) {\n if ($item['type'] !== 'wordpress') {\n continue;\n }\n if (file_exists($this->getProjectRoot() . '/' . $item['file'])) {\n $io->write('<comment>' . $item['file'] . ' configuration file is already exists, skipping</comment>');\n\n return;\n }\n }\n\n // Generate keys and salts\n $keysAndSalts = [\n 'AUTH_KEY',\n 'SECURE_AUTH_KEY',\n 'LOGGED_IN_KEY',\n 'NONCE_KEY',\n 'AUTH_SALT',\n 'SECURE_AUTH_SALT',\n 'LOGGED_IN_SALT',\n 'NONCE_SALT',\n 'COOKIEHASH',\n ];\n $this->configuredComponents['auth-keys'] = [];\n foreach ($keysAndSalts as $key) {\n $value = $this->generateSecureString(64, true);\n $this->variables[$key] = [\n 'type' => 'constant',\n 'value' => $value,\n ];\n $this->configuredComponents['auth-keys'][$key] = $value;\n }\n\n // Database tables prefix should be defined in any way\n $this->variables['table_prefix'] = [\n 'type' => 'variable',\n 'value' => 'wp_',\n ];\n if ($io->isInteractive()) {\n // Database connection configuration\n if ($io->askConfirmation('<info>Do you want to configure database connection parameters?</info> [<comment>Y,n</comment>]: ', true)) {\n $databaseParameters = [\n [\n 'name' => 'DB_HOST',\n 'type' => 'constant',\n 'question' => 'Database hostname',\n 'default' => 'localhost',\n 'validator' => static function ($value) {\n /** @noinspection BypassedUrlValidationInspection */\n if (filter_var(sprintf('https://%s/', $value), FILTER_VALIDATE_URL) === false) {\n throw new InvalidArgumentException('Invalid database host name');\n }\n\n return $value;\n },\n ],\n [\n 'name' => 'DB_NAME',\n 'type' => 'constant',\n 'question' => 'Database name',\n 'validator' => static function ($value) {\n $value = trim($value);\n /** @noinspection RegExpRedundantEscape */\n if ($value !== '' && (!preg_match('/^[^\\x00\\xff\\x5c\\/\\.\\:]+$/i', $value))) {\n throw new InvalidArgumentException('Database name can\\'t contain special characters');\n }\n\n return $value;\n },\n ],\n [\n 'name' => 'DB_USER',\n 'type' => 'constant',\n 'question' => 'Database user name',\n 'validator' => static function ($value) {\n if (strlen($value) > 32) {\n throw new InvalidArgumentException('Database user name can\\'t exceed 32 characters');\n }\n\n return $value;\n },\n ],\n [\n 'name' => 'DB_PASSWORD',\n 'type' => 'constant',\n 'question' => 'Database user password',\n ],\n [\n 'name' => 'DB_CHARSET',\n 'type' => 'constant',\n 'question' => 'Database charset',\n 'default' => 'utf8',\n ],\n [\n 'name' => 'DB_COLLATE',\n 'type' => 'constant',\n 'default' => '',\n ],\n [\n 'name' => 'table_prefix',\n 'type' => 'variable',\n 'question' => 'Database tables prefix',\n 'default' => 'wp_',\n 'validator' => static function ($value) {\n if ($value !== '' && !str_ends_with($value, '_')) {\n $value .= '_';\n }\n\n return $value;\n },\n ],\n ];\n foreach ($databaseParameters as $var) {\n $default = $var['default'] ?? null;\n if (array_key_exists('question', $var)) {\n $question = $var['question'] . ($default !== null ? ' [<comment>' . $default . '</comment>]' : '') . ': ';\n if (array_key_exists('validator', $var)) {\n $value = $io->askAndValidate($question, $var['validator'], null, $default);\n } else {\n $value = $io->ask($question, $default);\n }\n } else {\n $value = $default;\n }\n $result = [\n 'type' => $var['type'],\n 'value' => (string)$value,\n ];\n $this->variables[$var['name']] = $result;\n $this->configuredComponents['database'][$var['name']] = $var;\n }\n }\n\n // Site URL configuration\n if ($io->askConfirmation('<info>Do you want to configure site URL parameters?</info> [<comment>Y,n</comment>]: ')) {\n $siteUrl = $io->askAndValidate('Enter URL of home page of this WordPress site: ', [$this, 'validateUrl']);\n $this->configuredComponents['site-urls'] = [];\n $p = parse_url($siteUrl);\n $this->variables['WP_HOME'] = [\n 'type' => 'constant',\n 'value' => $p['scheme'] . '://' . $p['host'] . (array_key_exists('port', $p) ? ':' . $p['port'] : ''),\n ];\n $this->configuredComponents['site-urls']['WP_HOME'] = $this->variables['WP_HOME']['value'];\n }\n } else {\n $io->write('<comment>WordPress configuration file is created, but no details was configured because installation is running in non-interactive mode. You need to review and update it by yourself</comment>');\n }\n\n // Generate configuration files\n foreach (self::$configurationFiles as $configId => $configuration) {\n if ($configId === 'local' && !$io->isInteractive()) {\n // Local configuration is useless without interactive questionnaire\n continue;\n }\n $templatePath = __DIR__ . '/templates/' . $configuration['template'];\n $template = null;\n if (is_file($templatePath)) {\n $template = file_get_contents($templatePath);\n }\n if (!is_string($template) || $template === '') {\n $io->write(sprintf('<comment>No template are available for %s</comment>', $configuration['file']));\n continue;\n }\n $ldelim = $configuration['php'] ? '\\/\\*\\s*\\{\\s*' : '\\{\\{\\s*';\n $rdelim = $configuration['php'] ? '\\s*\\}\\s*\\*\\/' : '\\s*\\}\\}';\n foreach ($this->variables as $name => $var) {\n $value = $var['value'];\n if (is_string($value)) {\n $value = addslashes($var['value']);\n if ($var['type'] !== 'string') {\n $value = \"'\" . $value . \"'\";\n }\n } elseif ($value === null) {\n $value = 'null';\n } elseif ($value === true) {\n $value = 'true';\n } elseif ($value === false) {\n $value = 'false';\n }\n switch ($var['type']) {\n case 'constant':\n $code = sprintf(\"define('%s', %s);\", $name, $value);\n break;\n case 'variable':\n $code = sprintf('$%s = %s;', $name, $value);\n break;\n case 'string':\n default:\n $code = $value;\n break;\n }\n $template = preg_replace(sprintf('/%s%s%s/usi', $ldelim, $name, $rdelim), $code, $template);\n }\n $template = preg_replace(sprintf('/%s.+?%s/usi', $ldelim, $rdelim), '', $template);\n if ($configId === 'local') {\n // There may be missed entries into local configuration file\n $template = preg_replace('/(\\r?\\n){2,}/i', \"\\n\\n\", $template);\n }\n $configPath = $this->getProjectRoot() . '/' . $configuration['file'];\n file_put_contents($configPath, $template);\n if (!is_file($configPath)) {\n throw new RuntimeException('Failed to write ' . $configuration['file']);\n }\n $tmp = tempnam(sys_get_temp_dir(), 'wpskt');\n $exitcode = $this->getProcessExecutor()->execute(sprintf('%s -l %s > %s', PHP_BINARY, escapeshellarg($configPath), $tmp));\n unlink($tmp);\n if ($exitcode !== 0) {\n unlink($configPath);\n throw new RuntimeException('Failed to generate ' . $configuration['file']);\n }\n }\n $io->write('<info>WordPress configuration files are successfully created</info>');\n } catch (Throwable $e) {\n $this->getIO()->writeError(sprintf('<error>WordPress configuration files generation failed: %s</error>', $e->getMessage()));\n }\n }",
"function config_upgrade_40() {\n\tglobal $config;\n\n\t$a_share = &array_make_branch($config,'nfsd','share');\n\t$a_export = &array_make_branch($config,'nfsd','export','param');\n\t$a_root = &array_make_branch($config,'nfsd','root','param');\n\tforeach($a_share as $r_share):\n\t\t$r_param = [];\n\t\t$r_param['enable'] = true;\n\t\t$r_param['uuid'] = $r_share['uuid'] ?? uuid();\n\t\t$r_param['path'] = $r_share['path'] ?? '/';\n\t\t$r_param['network'] = $r_share['network'] ?? '';\n\t\t$r_param['description'] = $r_share['comment'] ?? '';\n\t\tif(array_key_exists('v4rootdir',$r_share)):\n\t\t\t$a_root[] = $r_param;\n\t\telse:\n\t\t\t$r_param['mapall'] = $r_share['mapall'] ?? 'nomap';\n\t\t\t$r_param['opt_alldirs'] = isset($r_share['options']['alldirs']);\n\t\t\t$r_param['opt_readonly'] = isset($r_share['options']['ro']);\n\t\t\t$r_param['opt_quiet'] = isset($r_share['options']['quiet']);\n\t\t\t$a_export[] = $r_param;\n\t\tendif;\n\tendforeach;\n\tunset($config['nfsd']['share']);\n}",
"public function makeConfigFile()\n\t{\n\t\t// Make sure we are called by an expected caller\n\t\tServerTechnology::checkCaller($this->allowedCallersForMake);\n\n\t\tJLoader::import('joomla.utilities.date');\n\n\t\t$date = new Date();\n\t\t$tz = new DateTimeZone($this->container->platform->getUser()->getParam('timezone', $this->container->platform->getConfig()->get('offset', 'UTC')));\n\t\t$date->setTimezone($tz);\n\t\t$d = $date->format('Y-m-d H:i:s T', true);\n\t\t$version = ADMINTOOLS_VERSION;\n\n\t\t$config = $this->loadConfiguration();\n\n\t\t// Load the fastcgi_pass setting\n\t\t$fastcgi_pass_block = $config->fastcgi_pass_block;\n\n\t\tif (empty($fastcgi_pass_block))\n\t\t{\n\t\t\t$fastcgi_pass_block = 'fastcgi_pass 127.0.0.1:9000;';\n\t\t}\n\n\t\t$fastcgi_pass_block = trim($fastcgi_pass_block);\n\n\t\t// Get the directory to the site's root\n\t\t$rewritebase = $config->rewritebase;\n\t\t$rewritebaseSlash = '/' . trim($rewritebase, '/ ');\n\t\t$rewritebaseSlash = ($rewritebaseSlash == '/') ? '' : $rewritebaseSlash;\n\t\t$rewritebase = '/' . trim($rewritebase, '/ ');\n\n\t\t$nginxConf = <<<END\n### ===========================================================================\n### Security Enhanced & Highly Optimized NginX Configuration File for Joomla!\n### automatically generated by Admin Tools $version on $d\n### ===========================================================================\n###\n### Admin Tools is Free Software, distributed under the terms of the GNU\n### General Public License version 3 or, at your option, any later version\n### published by the Free Software Foundation.\n###\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n### !! !!\n### !! If you get an Internal Server Error 500 or a blank page when trying !!\n### !! to access your site, remove this file and try tweaking its settings !!\n### !! in the back-end of the Admin Tools component. !!\n### !! !!\n### !! Remember to include this file in your site's configuration file. !!\n### !! Also remember to reload or restart NginX after making any change to !!\n### !! this file. !!\n### !! !!\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n###\n\n### Prevent access to this file\nlocation = $rewritebaseSlash/nginx.conf {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/nginx.conf.admintools {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\n\t\t// Protect against common file injection attacks?\n\t\tif ($config->fileinj == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< CONFDATA\n######################################################################\n## Protect against common file injection attacks\n######################################################################\nset \\$file_injection 0;\nif (\\$query_string ~ \"[a-zA-Z0-9_]=http://\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=(\\.\\.//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=/([a-z0-9_.]//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$file_injection = 1) {\n\treturn 403;\n\tbreak;\n}\n\nCONFDATA;\n\t\t}\n\n\t\tif ($config->phpeaster == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Disable PHP Easter Eggs\n######################################################################\nif (\\$query_string ~ \"\\=PHP[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\") {\n\treturn 403;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->leftovers == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Block access to configuration.php-dist and htaccess.txt\n######################################################################\nlocation = $rewritebaseSlash/configuration.php-dist {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/htaccess.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/configuration.php {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/CONTRIBUTING.md {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/joomla.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/LICENSE.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/phpunit.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/README.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->clickjacking == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Protect against clickjacking\nadd_header X-Frame-Options SAMEORIGIN;\n\nENDCONF;\n\t\t}\n\n\t\tif (!empty($config->hoggeragents) && ($config->nohoggers == 1))\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n######################################################################\n## Block access from specific user agents\n######################################################################\nset \\$bad_ua 0;\n\nENDCONF;\n\n\t\t\tforeach ($config->hoggeragents as $agent)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$http_user_agent ~ \"$agent\") {\n\tset \\$bad_ua 1;\n}\n\nENDCONF;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$bad_ua = 1) {\n\treturn 403;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif (($config->fileorder == 1) || ($config->nodirlists == 1))\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Directory indices and no automatic directory listings\n## Forces index.php to be read before the index.htm(l) files\n## Also disables showing files in a directory automatically\n######################################################################\nindex index.php index.html index.htm;\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->symlinks != 0)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Disable following symlinks\n######################################################################\n\nENDCONF;\n\t\t\tswitch ($config->symlinks)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks on;\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks if_not_owner;\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->exptime == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Set default expiration time\n######################################################################\n # CSS and JavaScript : 1 week\nlocation ~* \\.(css|js)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1w;\n}\n\n# Image files : 1 month\nlocation ~* \\.(bmp|gif|jpg|jpeg|jp2|png|svg|tif|tiff|ico|wbmp|wbxml|smil|webp)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Font files : 1 week\nlocation ~* \\.(woff|woff2|ttf|otf|eot)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Document files : 1 month\nlocation ~* \\.(pdf|txt|xml)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Audio files : 1 month\nlocation ~* \\.(mid|midi|mp3|m4a|m4r|aif|aiff|ra|wav|voc|ogg)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Video files : 1 month\nlocation ~* \\.(swf|vrml|avi|mkv|mpg|mpeg|mp4|m4v|mov|asf)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->autocompress == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Automatic compression of static resources\n## Compress text, html, javascript, css, xml and other static resources\n## May kill access to your site for old versions of Internet Explorer\n######################################################################\n# The following is the actual automatic compression setup\ngzip on;\ngzip_vary\t\ton;\ngzip_comp_level 6;\ngzip_proxied\texpired no-cache no-store private auth;\ngzip_min_length 1000;\ngzip_http_version 1.1;\ngzip_types text/plain text/css application/xhtml+xml application/xml+rss application/rss+xml application/x-javascript application/javascript text/javascript application/json text/xml application/xml image/svg+xml;\ngzip_buffers 16 8k;\ngzip_disable \"MSIE [1-6]\\.(?!.*SV1)\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->etagtype != -1)\n\t\t{\n\t\t\t$etagValue = ($config->etagtype == 1) ? 'on' : 'off';\n\t\t\t$nginxConf .= <<< CONF\n## Send ETag (you have set it to '$etagValue')\netag $etagValue;\n\nCONF;\n\n\t\t}\n\n\t\t$host = strtolower($config->httphost);\n\n\t\tif (substr($host, 0, 4) == 'www.')\n\t\t{\n\t\t\t$wwwHost = $host;\n\t\t\t$noWwwHost = substr($host, 4);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$noWwwHost = $host;\n\t\t\t$wwwHost = 'www.' . $host;\n\t\t}\n\n\t\t$subfolder = trim($config->rewritebase, '/') ? trim($config->rewritebase, '/').'/' : '';\n\n\t\tswitch ($config->wwwredir)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t// non-www to www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect non-www to www\n######################################################################\nif (\\$host = '$noWwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$wwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t// www to non-www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect www to non-www\n######################################################################\nif (\\$host = '$wwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$noWwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!empty($config->olddomain))\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect old to new domains\n######################################################################\n\nEND;\n\t\t\t$domains = trim($config->olddomain);\n\t\t\t$domains = explode(',', $domains);\n\t\t\t$newdomain = $config->httphost;\n\n\t\t\tforeach ($domains as $olddomain)\n\t\t\t{\n\t\t\t\t$olddomain = trim($olddomain);\n\n\t\t\t\tif (empty($olddomain))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$olddomain = $this->escape_string_for_regex($olddomain);\n\n\t\t\t\t$nginxConf .= <<<END\nif (\\$host ~ \"$olddomain$\" ) {\n\trewrite ^/(.*)$ \\$scheme://$newdomain/$1 permanent;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->hstsheader == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## HSTS Header - See http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security\nadd_header Strict-Transport-Security max-age=31536000;\n\nEND;\n\t\t}\n\n\t\tif ($config->cors == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Cross-Origin Resource Sharing (CORS)\nadd_header Access-Control-Allow-Origin \"*\";\nadd_header Timing-Allow-Origin \"*\";\n\nEND;\n\t\t}\n\n\t\tif ($config->referrerpolicy !== '-1')\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Referrer-policy\nadd_header Referrer-Policy \"{$config->referrerpolicy}\";\n\nEND;\n\t\t}\n\n\t\tif ($config->notracetrack == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Disable HTTP methods TRACE and TRACK (protect against XST)\nif (\\$request_method ~ ^(TRACE|TRACK)$ ) {\n\treturn 405;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->reducemimetyperisks == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reduce MIME type security risks\nadd_header X-Content-Type-Options \"nosniff\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->reflectedxss == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reflected XSS prevention\nadd_header X-XSS-Protection \"1; mode=block\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->notransform == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Prevent content transformation\nadd_header Cache-Control \"no-transform\";\n\nENDCONF;\n\t\t}\n\n\n\t\tif ($config->cfipfwd == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## CloudFlare support - see https://support.cloudflare.com/hc/en-us/articles/200170706-Does-CloudFlare-have-an-IP-module-for-Nginx-\n######################################################################\nset_real_ip_from 199.27.128.0/21;\nset_real_ip_from 173.245.48.0/20;\nset_real_ip_from 103.21.244.0/22;\nset_real_ip_from 103.22.200.0/22;\nset_real_ip_from 103.31.4.0/22;\nset_real_ip_from 141.101.64.0/18;\nset_real_ip_from 108.162.192.0/18;\nset_real_ip_from 190.93.240.0/20;\nset_real_ip_from 188.114.96.0/20;\nset_real_ip_from 197.234.240.0/22;\nset_real_ip_from 198.41.128.0/17;\nset_real_ip_from 162.158.0.0/15;\nset_real_ip_from 104.16.0.0/12;\nset_real_ip_from 2400:cb00::/32;\nset_real_ip_from 2606:4700::/32;\nset_real_ip_from 2803:f800::/32;\nset_real_ip_from 2405:b500::/32;\nset_real_ip_from 2405:8100::/32;\nreal_ip_header X-Forwarded-For;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttimeout == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Timeout handling, see http://wiki.nginx.org/HttpCoreModule\nclient_header_timeout 10;\nclient_body_timeout 10;\nsend_timeout 30;\nkeepalive_timeout 30s;\n\nEND;\n\t\t}\n\n\t\tif ($config->optsockets == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Socket settings, see http://wiki.nginx.org/HttpCoreModule\nconnection_pool_size 8192;\nclient_header_buffer_size 4k;\nlarge_client_header_buffers 8 8k;\nrequest_pool_size 8k;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttcpperf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Performance, see http://wiki.nginx.org/HttpCoreModule\nsendfile on;\nsendfile_max_chunk 1m;\npostpone_output 0;\ntcp_nopush on;\ntcp_nodelay on;\n\nEND;\n\t\t}\n\n\t\tif ($config->optoutbuf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Output buffering, see http://wiki.nginx.org/HttpCoreModule\noutput_buffers 8 32k;\n\nEND;\n\t\t}\n\n\t\tif ($config->optfhndlcache == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Filehandle Cache, useful when serving a large number of static files (Joomla! sites do that)\nopen_file_cache max=2000 inactive=20s;\nopen_file_cache_valid 30s;\nopen_file_cache_min_uses 2;\nopen_file_cache_errors on;\n\nEND;\n\t\t}\n\n\t\tif ($config->encutf8 == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Character encoding, see http://wiki.nginx.org/HttpCharsetModule\ncharset utf-8;\nsource_charset utf-8;\n\nEND;\n\t\t}\n\n\t\tif ($config->nginxsecurity == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Security options, see http://wiki.nginx.org/HttpCoreModule\nserver_name_in_redirect off;\nserver_tokens off;\nignore_invalid_headers on;\n\nEND;\n\t\t}\n\n\t\tif ($config->maxclientbody == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Maximum client body size set to 1 Gigabyte\nclient_max_body_size 1G;\n\nEND;\n\t\t}\n\n\t\tif ($config->blockcommon == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\nset \\$common_exploit 0;\nif (\\$query_string ~ \"proc/self/environ\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"mosConfig_[a-zA-Z_]{1,21}(=|\\%3D)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"base64_(en|de)code\\(.*\\)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"(<|%3C).*script.*(>|%3E)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"GLOBALS(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"_REQUEST(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$common_exploit = 1) {\n\treturn 403;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->enablesef == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Enable SEF URLs\nlocation / {\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\nlocation ~* /index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection rules exceptions\n######################################################################\n\nEND;\n\n\t\tif (!empty($config->exceptionfiles))\n\t\t{\n\t\t\tforeach ($config->exceptionfiles as $file)\n\t\t\t{\n\t\t\t\tif (substr($file, -4) == '.php')\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->exceptiondirs))\n\t\t{\n\t\t\tforeach ($config->exceptiondirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*\\.php$\n{\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->fullaccessdirs))\n\t\t{\n\t\t\tforeach ($config->fullaccessdirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection\n######################################################################\n\nEND;\n\n\t\tif ($config->backendprot == 1)\n\t\t{\n\t\t\t$bedirs = implode('|', $config->bepexdirs);\n\t\t\t$betypes = implode('|', $config->bepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select back-end directories\nlocation ~* ^$rewritebaseSlash/administrator/($bedirs)/.*.($betypes)$ {\n\tbreak;\n}\n\n# Allow access to the back-end index.php file\nlocation = $rewritebaseSlash/administrator/index.php {\n\t$fastcgi_pass_block\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/administrator$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\nlocation ~* ^$rewritebaseSlash/administrator/$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* $rewritebaseSlash/administrator.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /administrator/index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->frontendprot == 1)\n\t\t{\n\t\t\t$fedirs = implode('|', $config->fepexdirs);\n\t\t\t$fetypes = implode('|', $config->fepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select front-end directories\nlocation ~* ^$rewritebaseSlash/($fedirs)/.*.($fetypes)$ {\n\tbreak;\n}\n\n## Disallow front-end access for certain Joomla! system directories (unless access to their files is allowed above)\nlocation ~* ^$rewritebaseSlash/includes/js/ {\n\treturn 403;\n}\nlocation ~* ^$rewritebaseSlash/(cache|includes|language|logs|log|tmp)/ {\n\treturn 403;\n}\n\nEND;\n\t\t\tif ($config->enablesef != 1)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<<END\n# Allow access to the front-end index.php file\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\nlocation ^$rewritebaseSlash/index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<<END\n# Allow access to /\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* ^$rewritebaseSlash/.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= \"##### Advanced server protection -- END\\n\\n\";\n\n\t\treturn $nginxConf;\n\t}",
"function create_new_settings_file($dbuser_name, $dbpassword_name, $dbname_name, $dbprefix_name, $dbhost_name, $baseurl_name) {\r\n\r\n ob_start();\r\n\r\n ?>\r\n\r\n /* Configuration file for Hotaru CMS. */\r\n\r\n// Paths\r\ndefine(\"BASEURL\", '<?php echo $baseurl_name; ?>'); // e.g. http://www.mysite.com/ Needs trailing slash (/)\r\n\r\n// Database details\r\ndefine(\"DB_USER\", '<?php echo $dbuser_name; ?>'); \t\t// Add your own database details\r\ndefine(\"DB_PASSWORD\", '<?php echo $dbpassword_name; ?>');\r\ndefine(\"DB_NAME\", '<?php echo $dbname_name; ?>');\r\ndefine(\"DB_HOST\", '<?php echo $dbhost_name; ?>'); \t\t\t// You probably won't need to change this\r\n\r\n// You probably don't need to change these\r\ndefine(\"DB_PREFIX\", '<?php echo $dbprefix_name; ?>'); \t\t// Database prefix, e.g. \"hotaru_\"\r\ndefine(\"DB_LANG\", 'en'); \t\t\t// Database language, e.g. \"en\"\r\ndefine(\"DB_ENGINE\", 'MyISAM');\t\t\t\t// Database Engine, e.g. \"MyISAM\"\r\ndefine('DB_CHARSET', 'utf8');\t\t\t\t// Database Character Set (UTF8 is Recommended), e.g. \"utf8\"\r\ndefine(\"DB_COLLATE\", 'utf8_unicode_ci');\t\t// Database Collation (UTF8 is Recommended), e.g. \"utf8_unicode_ci\"\r\n\r\n?><?php // leave this line squashed up here as we dont want any blank lines at the end of the settings file\r\n $page = \"<?php\" . ob_get_contents();\r\n ob_end_clean();\r\n //$page = str_replace(\"\\n\", \"\", $page);\r\n $cwd = getcwd();\r\n $file = $cwd . \"/../config/settings.php\";\r\n @chmod($file,0777);\r\n $fw = fopen($file, \"w\");\r\n $fputs = fputs($fw,$page, strlen($page));\r\n @chmod($file,0644);\r\n fclose($fw);\r\n\r\n return $fputs;\r\n\r\n}",
"public function createFtpUser(iMSCP_Api_Modules_Ftp_Model_User $user)\n\t{\n\t\t$this->_getConfStorageImpl()->createConfigEntry($user);\n\t\tparent::createUser($user);\n\t}"
] | [
"0.61032844",
"0.59173256",
"0.5714069",
"0.56312484",
"0.55128384",
"0.5420417",
"0.5393821",
"0.5353945",
"0.5315315",
"0.5313698",
"0.5285489",
"0.526042",
"0.52125126",
"0.52033526",
"0.5168537",
"0.5166732",
"0.5151868",
"0.5145606",
"0.51029706",
"0.5096243",
"0.50951093",
"0.5091975",
"0.506769",
"0.5055431",
"0.50388247",
"0.5037093",
"0.50278836",
"0.50271845",
"0.501638",
"0.5004938"
] | 0.73935217 | 0 |
Create the Apache configuration files for the specificed flexshare. | protected function _generate_web_flexshares()
{
clearos_profile(__METHOD__, __LINE__);
if (!clearos_library_installed('web_server/Httpd'))
return;
$httpd = new Httpd();
// Create a unique file identifier
$backup_key = time();
// Get file listing in Apache vhost dir
$folder = new Folder(self::WEB_VIRTUAL_HOST_PATH);
$vhosts = $folder->get_listing();
$index = 0;
foreach ($vhosts as $vhost) {
// Flexshares are prefixed with 'flexshare-'. Find these files
if (preg_match("/flex-443.conf|^" . self::PREFIX . ".*vhost$|^" . self::PREFIX . ".*conf$/i", $vhost)) {
$vhost_file = new File(self::WEB_VIRTUAL_HOST_PATH . "/" . $vhost);
// Backup existing file
$vhost_file->move_to(self::PATH_TEMP . "/" . "$vhost.$backup_key.bak");
} else {
unset($vhosts[$index]);
}
$index++;
}
// Re-order shared to make sure default web site is first virtual host
//--------------------------------------------------------------------
$raw_shares = $this->_get_shares(self::TYPE_ALL);
$shares = array();
foreach ($raw_shares as $name => $share) {
if (empty($share['WebDefaultSite']))
$shares[] = $share;
else
array_unshift($shares, $share);
}
// Grab the list of ports from the PHP Engine app
//-----------------------------------------------
if (clearos_load_library('php_engines/PHP_Engines')) {
$php_engine = new \clearos\apps\php_engines\PHP_Engines();
$php_engine_ports = $php_engine->get_ports();
// TODO: remove method check in ClearOS 8.0
if (method_exists($php_engine, 'get_version_codes')) {
$php_version_codes = $php_engine->get_version_codes();
} else {
$php_version_codes['rh-php56-php-fpm'] = 56;
$php_version_codes['rh-php70-php-fpm'] = 70;
}
} else {
$php_engine_ports = [];
}
// Recreate all virtual configs
//-----------------------------
$lans = NULL;
$newlines = array();
$flexshare_certs = array();
$flexshare_php_engines = array();
$website_certs = array();
$website_php_engines = array();
foreach ($shares as $share) {
$name = $share['Name'];
$newlines = array();
$config_doc_comment = array();
$config_aliases = array();
$config_directory = array();
// Bail if not enabled, continue through loop - we're re-creating lines here
//--------------------------------------------------------------------------
if (! isset($share['ShareEnabled']) || ! $share['ShareEnabled'])
continue;
if (! isset($share['WebEnabled']) || ! $share['WebEnabled'])
continue;
if (isset($share['WebCustomConfiguration']) && $share['WebCustomConfiguration'])
continue;
// Certs
//------
if (!empty($share['WebSslCertificate'])) {
if (($share['ShareInternal'] == 1) || ($share['ShareInternal'] == 2))
$website_certs[$name] = $share['WebSslCertificate'];
else
$flexshare_certs[$name] = $share['WebSslCertificate'];
}
// PHP Engines
//------------
// Handle upgrade - if WebPhpEngine is not set, but PHP is running, it's using mod_php
if (!isset($share['WebPhpEngine']) && $share['WebPhp'])
$share['WebPhpEngine'] = 'httpd';
if (!empty($share['WebPhpEngine'])) {
if (($share['ShareInternal'] == 1) || ($share['ShareInternal'] == 2))
$website_php_engines[$name] = $share['WebPhpEngine'];
else
$flexshare_php_engines[$name] = $share['WebPhpEngine'];
}
// Get LAN info, but only if it is necessary (expensive call)
//-----------------------------------------------------------
if (($share['WebAccess'] == self::ACCESS_LAN) && ($lans === NULL)) {
$iface_manager = new Iface_Manager();
$lans = $iface_manager->get_most_trusted_networks();
}
// Configuration doc comments
//---------------------------
if ($share['ShareInternal'] == 1)
$doc_comment = 'Web Site';
else if ($share['ShareInternal'] == 2)
$doc_comment = 'Web App';
else
$doc_comment = 'File Share';
$config_doc_comment[] = "";
$config_doc_comment[] = "# -----------------------------------------------#";
$config_doc_comment[] = "# $doc_comment";
$config_doc_comment[] = "# -----------------------------------------------#";
$config_doc_comment[] = "";
// cgi-bin handling
//-----------------
if ($share['WebCgi']) {
// Create cgi-bin directory if it does not exist.
$cgifolder = new Folder(self::SHARE_PATH . "/$name/cgi-bin", TRUE);
if (!$cgifolder->exists())
$cgifolder->create(self::CONSTANT_WEB_SITE_USERNAME, self::CONSTANT_FILES_USERNAME, "0777");
// Build <Directory> block for for cgi-bin
$config_directory[] = "<Directory " . $share['ShareDir'] . "/cgi-bin>";
$config_directory[] = "\tOptions +ExecCGI";
if ($share["WebAccess"] == self::ACCESS_LAN) {
$config_directory[] = "\tRequire local";
if (count($lans) > 0) {
foreach ($lans as $lan)
$config_directory[] = "\tRequire ip " . $lan;
}
} else {
if (!$share['WebReqAuth'])
$config_directory[] = "\tRequire all granted";
}
$config_directory[] = "</Directory>\n";
}
// Sandbox subdir handling
//-------------------------
if (isset($share['WebFolderLayout']) && ($share['WebFolderLayout'] == self::FOLDER_LAYOUT_SANDBOX)) {
$log_folder = new Folder(self::SHARE_PATH . "/$name/" . self::SANDBOX_LOG_SUBDIR, TRUE);
if (!$log_folder->exists())
$log_folder->create(self::CONSTANT_WEB_SITE_USERNAME, $share['ShareGroup'], '0775');
$docroot_folder = new Folder(self::SHARE_PATH . "/$name/" . self::SANDBOX_DOCROOT_SUBDIR, TRUE);
if (!$docroot_folder->exists())
$docroot_folder->create(self::CONSTANT_WEB_SITE_USERNAME, $share['ShareGroup'], '0775');
$errors_folder = new Folder(self::SHARE_PATH . "/$name/" . self::SANDBOX_ERRORS_SUBDIR, TRUE);
if (!$errors_folder->exists())
$errors_folder->create(self::CONSTANT_WEB_SITE_USERNAME, $share['ShareGroup'], '0775');
}
// Build <Directory> block
//-------------------------
$config_directory[] = "<Directory " . $share['ShareDir'] . ">";
$options = '';
if ($share['WebShowIndex'])
$options .= ' +Indexes';
else
$options .= ' -Indexes';
if ($share['WebFollowSymLinks'] || $share['WebReqSsl'])
$options .= ' +FollowSymLinks';
else
$options .= ' -FollowSymLinks';
if ($share['WebAllowSSI'])
$options .= ' +' . self::DEFAULT_SSI_PARAM;
else
$options .= ' -' . self::DEFAULT_SSI_PARAM;
if (strlen($options) > 0)
$config_directory[] = "\tOptions" . $options;
if ($share['WebHtaccessOverride'])
$config_directory[] = "\tAllowOverride All";
$phpenv = new File(self::SHARE_PATH . "/$name/.phpenv", TRUE);
if ($phpenv->exists())
$phpenv->delete();
if ($share['WebPhpEngine'] && clearos_load_library('php_engines/PHP_Engines')) {
$port = $php_engine_ports[$share['WebPhpEngine']];
if (!empty($php_version_codes[$share['WebPhpEngine']])) {
$phpenv->create('root', 'root', '0644');
$phpenv->add_lines($php_version_codes[$share['WebPhpEngine']] . "\n");
}
if ($port) {
$config_directory[] = "\t<FilesMatch \.php$>";
$config_directory[] = "\t\tSetHandler \"proxy:fcgi://127.0.0.1:$port\"";
$config_directory[] = "\t</FilesMatch>";
}
}
if ($share['WebReqAuth']) {
$config_directory[] = "\tAuthName \"" . $share['WebRealm'] . "\"";
$config_directory[] = "\tAuthType Basic";
$config_directory[] = "\tAuthBasicProvider external";
$config_directory[] = "\tAuthExternal pwauth";
$config_directory[] = "\t<RequireAll>";
$config_directory[] = "\t\tRequire unix-group " . $share['ShareGroup'];
if ($share['WebAccess'] == self::ACCESS_LAN) {
$config_directory[] = "\t\t<RequireAny>";
$config_directory[] = "\t\t\tRequire local";
if (count($lans) > 0) {
foreach ($lans as $lan)
$config_directory[] = "\t\t\tRequire ip " . $lan;
}
$config_directory[] = "\t\t</RequireAny>";
}
$config_directory[] = "\t</RequireAll>";
} else {
if ($share['WebAccess'] == self::ACCESS_LAN) {
$config_directory[] = "\t<RequireAny>";
$config_directory[] = "\t\tRequire local";
if (count($lans) > 0) {
foreach ($lans as $lan)
$config_directory[] = "\t\tRequire ip " . $lan;
}
$config_directory[] = "\t</RequireAny>";
} else {
$config_directory[] = "\tRequire all granted";
}
}
// PHP support
//------------
if ($share['WebPhp']) {
// Anything required?
} else {
$config_directory[] = "\t<FilesMatch \.php$>";
$config_directory[] = "\t\tSetHandler None";
$config_directory[] = "\t\tForceType text/plain";
$config_directory[] = "\t\tSetHandler application/x-httpd-php-source";
$config_directory[] = "\t</FilesMatch>";
}
if ($share['WebReqSsl']) {
$config_directory[] = "\tRewriteEngine On";
$config_directory[] = "\tRewriteCond %{HTTPS} off";
$config_directory[] = "\tRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}";
}
// DAV (unsupported)
$davcheck = self::SHARE_PATH . "/$name/.DAV";
$davfile = new File($davcheck);
if ($davfile->exists())
$config_directory[] = "\tDav on";
$config_directory[] = "</Directory>\n\n\n";
// Ports
//
// For standard Flexshares:
// - SSL or non-SSL can be specified, but not both
// - End users can override the port number
//
// For web sites and web apps
// - SSL or both SSL + non-SSL can be specified
// - End usrs cannot override the prot number
//-------------------------------------------------
if (empty($share['ShareInternal'])) {
if ($share['WebOverridePort'])
$ports = array($share['WebPort']);
else
$ports = (isset($share['WebReqSsl']) && $share['WebReqSsl']) ? array(443) : array(80);
} else {
$ports = (isset($share['WebReqSsl']) && $share['WebReqSsl']) ? array(443) : array(80, 443);
}
// Create new configuration files in parallel
//-------------------------------------------
$config_one_time = array();
foreach ($ports as $port) {
// Need to know which file we'll be writing to.
// We determine this by port
// i.e. /etc/httpd/conf.d/flexshare-<port><ssl>.conf
$ssl = (empty($share['ShareInternal']) && $share['WebOverridePort'] && $share['WebReqSsl']) ? '-ssl' : '';
$filename = self::PREFIX . $port . $ssl . '.conf';
$file = new File(self::WEB_VIRTUAL_HOST_PATH . '/' . $filename);
// Create the configuration file
// Write out a common header
//-------------------------------
if (! $file->exists()) {
$vhosts[] = $filename;
$header_lines = array();
$header_lines[] = self::WRITE_WARNING;
// Only specify Listen directive for custom ports
if (($port != 80) && ($port != 443))
$header_lines[] = "Listen *:$port";
$header_lines[] = "";
$header_lines[] = "# Authentication mechanism";
$header_lines[] = "DefineExternalAuth pwauth pipe /usr/bin/pwauth";
$header_lines[] = "DefineExternalGroup pwauth pipe /usr/bin/unixgroup";
$header_lines[] = "";
$file->create('root', 'root', '0644');
$file->add_lines(implode("\n", $header_lines));
}
// Write out Aliases and Directory definitions. This is only
// required once per FlexShare, whereas VirtualHost blocks
// can appear multiple times.
$check_name = $share['Name'];
if (in_array($check_name, $config_one_time)) {
$config_aliases = array();
$config_directory = array();
} else {
$config_aliases = $this->_generate_web_aliases($share, $port);
$config_one_time[] = $check_name;
}
// Create new configuration files in parallel
$config_virtual_host = $this->_generate_web_virtual_hosts($share, $port);
$config_lines = array_merge(
$config_doc_comment,
$config_aliases,
$config_virtual_host,
$config_directory
);
$file->add_lines(implode("\n", $config_lines));
}
}
// Validate httpd configuration before restarting server
//------------------------------------------------------
$config_ok = TRUE;
try {
$shell = new Shell();
$shell_options['validate_exit_code'] = FALSE;
$exitcode = $shell->execute(self::CMD_VALIDATE_HTTPD, '-t', TRUE, $shell_options);
} catch (Exception $e) {
// Backup out of commits
$config_ok = FALSE;
}
if (($config_ok === FALSE) || ($exitcode != 0)) {
$config_ok = FALSE;
$output = $shell->get_output();
clearos_log(self::LOG_TAG, "Invalid httpd configuration!");
// Oops...we generated an invalid conf file
foreach ($output as $line)
clearos_log(self::LOG_TAG, $line);
}
foreach ($vhosts as $vhost) {
// Not a flexshare vhost file
if (!isset($vhost))
continue;
$file = new File(self::PATH_TEMP . "/$vhost.$backup_key.bak");
if (! $file->exists()) {
// Conf was newly created
$file = new File(self::WEB_VIRTUAL_HOST_PATH . "/$vhost");
if (! $config_ok)
$file->delete();
continue;
}
if ($config_ok) {
// Delete backups
$file->delete();
} else {
// Recover backups
$file->move_to(self::WEB_VIRTUAL_HOST_PATH . "/$vhost");
}
}
if ($config_ok) {
try {
$httpd = new Httpd();
$httpd->reset(TRUE);
} catch (Exception $e) {
// Keep going
}
} else {
throw new Engine_Exception(lang('flexshare_config_validation_failed'), CLEAROS_ERROR);
}
// Report state of certs to Certificate Manager
//---------------------------------------------
$certificate_manager = new Certificate_Manager();
$certificate_manager->register($flexshare_certs, 'flexshare', lang('flexshare_app_name'));
$certificate_manager->register($website_certs, 'web_server', lang('web_server_app_name'));
if (clearos_load_library('php_engines/PHP_Engines')) {
$php = new \clearos\apps\php_engines\PHP_Engines();
$php->register($website_php_engines, 'web_server', lang('web_server_app_name'));
$php->register($flexshare_php_engines, 'flexshare', lang('flexshare_app_name'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function generateSingleApacheVirtualHostFiles()\n {\n foreach ($this->settings['Apps'] as $app) {\n $outputFile = $app['Description'];\n $outputFile = 'vhost-' . $this->slugify($outputFile);\n\n $output = $this->twig->render(\n 'apache/' . $app['Template'] . '.template',\n array(\n 'app' => $app\n )\n );\n\n if ($this->readOnly === false) {\n file_put_contents($this->apacheSingleVirtualHostFolder . '/' . $outputFile, $output);\n echo 'Generated ' . $this->apacheSingleVirtualHostFolder . '/' . $outputFile . PHP_EOL;\n }\n }\n }",
"protected function _generate_ftp_flexshares()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('ftp/ProFTPd'))\n return;\n\n $confs = array();\n $proftpd = new ProFTPd();\n\n // Create a unique file identifier\n $backup_key = time();\n\n // Get file listing in FTP confs dir\n $folder = new Folder(self::FTP_VIRTUAL_HOST_PATH);\n\n if (!$folder->exists())\n return;\n\n $confs = $folder->get_listing();\n $index = 0;\n\n foreach ($confs as $conf) {\n if (preg_match(\"/^\" . self::PREFIX . \".*conf$/i\", $conf)) {\n $conf_file = new File(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $conf);\n // Backup existing file\n $conf_file->move_to(self::PATH_TEMP . \"/$conf.$backup_key.bak\");\n } else {\n unset($confs[$index]);\n }\n\n $index++;\n }\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n $ftps_filename = '';\n\n // Recreate all virtual configs\n foreach ($shares as $name => $share) {\n\n $newlines = array();\n $append = FALSE;\n\n // If not enabled, continue through loop - we're re-creating lines here\n if (!isset($share['ShareEnabled']) || !$share['ShareEnabled'])\n continue;\n\n if (!isset($share['FtpEnabled']) || !$share['FtpEnabled'])\n continue;\n\n // Add group greeting file\n try {\n // This isn't fatal. Log and continue on exception\n $file = new File(self::SHARE_PATH . \"/$name/.flexshare-group.txt\");\n if ($file->exists())\n $file->delete();\n\n if ($share['FtpGroupGreeting']) {\n $file->create(\"root\", \"root\", 644);\n $file->add_lines($share['FtpGroupGreeting'] . \"\\n\");\n }\n } catch (Exception $e) {\n //\n }\n\n // Need to know which file we'll be writing to.\n // We determine this by port\n // Ie. /etc/proftpd.d/flex-<port>.conf\n\n // Port\n if ($share['FtpOverridePort'])\n $port = $share['FtpPort'];\n else\n $port = self::DEFAULT_PORT_FTP;\n\n // Passive mode flag\n $pasv = '';\n if ($share['FtpAllowPassive'])\n $pasv = ' PASV';\n\n // Overwrite permission\n if ((int)$share['FtpGroupPermission'] == self::PERMISSION_WRITE_PLUS)\n $group_write = 'on';\n else if ((int)$share['FtpGroupPermission'] == self::PERMISSION_READ_WRITE_PLUS)\n $group_write = 'on';\n else\n $group_write = 'off';\n\n // Create new file in parallel\n $filename = self::PREFIX . $port . '.conf';\n $ftps_filename = self::PREFIX . '990' . '.conf';\n\n // Add to confs array in case of failure\n if (!in_array($filename, $confs))\n $confs[] = $filename;\n\n $file = new File(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $filename);\n $tempfile = new File(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $filename . '.cctmp');\n\n if ($tempfile->exists())\n $tempfile->delete();\n\n $tempfile->create('root', 'root', '0644');\n\n if ($file->exists()) {\n $oldlines = $file->get_contents_as_array();\n $found_start = FALSE;\n\n $linestoadd = \"\";\n foreach ($oldlines as $line) {\n if (preg_match(\"/^\\s*# DNR:Webconfig start - $name$/\", $line))\n $found_start = TRUE;\n\n if ($found_start && preg_match(\"/^\\s*# DNR:Webconfig end - $name$/\", $line)) {\n $found_start = FALSE;\n continue;\n }\n\n if ($found_start)\n continue;\n\n $linestoadd .= $line . \"\\n\";\n\n // We need to know if we are working on top of another define or not\n $append = TRUE;\n }\n\n $tempfile->add_lines($linestoadd);\n }\n\n try {\n $proftpd_conf = new File(ProFTPd::FILE_CONFIG);\n $proftpd_conf->lookup_line(\"/Include \\/etc\\/proftpd.d\\/\\*.conf/i\");\n } catch (File_No_Match_Exception $e) {\n // Need this line to include flexshare confs\n $proftpd_conf->add_lines(\"Include /etc/proftpd.d/*.conf\\n\");\n } catch (Exception $e) {\n throw new Engine_Exception(clearos_exception_message($e), CLEAROS_ERROR);\n }\n\n if (! $append) {\n $newlines[] = self::WRITE_WARNING;\n // Note: event system will automatically handle IP address changes.\n $iface_manager = new Iface_Manager();\n $external_ips = $iface_manager->get_external_ip_addresses();\n $trusted_ips = $iface_manager->get_most_trusted_ips();\n\n $ips = array_merge($external_ips, $trusted_ips);\n $ip_list = implode(' ', array_unique($ips));\n\n $newlines[] = \"<VirtualHost $ip_list>\";\n $newlines[] = \"\\tPort $port\";\n $newlines[] = \"\\tDefaultRoot \" . self::SHARE_PATH . \"/\";\n $newlines[] = \"\\tRequireValidShell off\";\n $newlines[] = \"\\tAuthPam on\";\n $newlines[] = \"\\tAuthPAMConfig proftpd\";\n\n if ($share[\"FtpPassivePortMin\"] && $share[\"FtpPassivePortMax\"])\n $newlines[] = \"\\tPassivePorts \" . $share[\"FtpPassivePortMin\"] . \" \" . $share[\"FtpPassivePortMax\"];\n\n $newlines[] = \"\\tCapabilitiesEngine on\";\n $newlines[] = \"\\tCapabilitiesSet +CAP_CHOWN\";\n\n $newlines[] = \"\";\n $newlines[] = \"\\t<Limit LOGIN CDUP PWD XPWD LIST PROT$pasv>\";\n $newlines[] = \"\\t\\tAllowAll\";\n $newlines[] = \"\\t</Limit>\";\n $newlines[] = \"\\t<Limit ALL>\";\n $newlines[] = \"\\t\\tDenyAll\";\n $newlines[] = \"\\t</Limit>\";\n $newlines[] = \"\";\n\n // FTPES (SSL)\n // if ($share['FtpEnableFtpes']) {\n $newlines[] = \"\\t<IfModule mod_tls.c>\";\n $newlines[] = \"\\t\\tTLSEngine on\";\n $newlines[] = \"\\t\\tTLSLog /var/log/tls.log\";\n $newlines[] = \"\\t\\tTLSOptions NoCertRequest\";\n $newlines[] = \"\\t\\tTLSRequired off\";\n $newlines[] = \"\\t\\tTLSRSACertificateFile /etc/pki/CA/bootstrap.crt\";\n $newlines[] = \"\\t\\tTLSRSACertificateKeyFile /etc/pki/CA/bootstrap.key\";\n $newlines[] = \"\\t\\tTLSVerifyClient off\";\n $newlines[] = \"\\t</IfModule>\";\n $newlines[] = \"\\n\";\n } else {\n if ($share['FtpAllowPassive']) {\n $tempfile->replace_lines(\n \"/\\sPassivePorts \\d+\\s+\\d+/\",\n \"\\tPassivePorts \" . $share['FtpPassivePortMin'] . \" \" . $share['FtpPassivePortMax'] . \"\\n\"\n );\n }\n }\n\n // Add flexshare specific directory directives\n $newlines[] = \"\\t# DNR:Webconfig start - $name\";\n $newlines[] = \"\\t<Directory \" . self::SHARE_PATH . \"/$name>\";\n $newlines[] = \"\\t\\tAllowOverwrite \" . $group_write;\n $newlines[] = \"\\t\\tAllowRetrieveRestart on\";\n $newlines[] = \"\\t\\tAllowStoreRestart on\";\n $newlines[] = \"\\t\\tDisplayChdir .flexshare-group.txt TRUE\";\n $newlines[] = \"\\t\\tHideNoAccess on\";\n $newlines[] = \"\\t\\tHideFiles (.flexshare)\";\n $newlines[] = \"\\t\\tGroupOwner \\\"\" . $share[\"ShareGroup\"] . \"\\\"\";\n $newlines[] = \"\\t\\tUmask 0113 0002\";\n $newlines[] = \"\\t\\t<Limit \" . $this->access[$share['FtpGroupPermission']] . \"$pasv>\";\n $newlines[] = \"\\t\\t AllowGroup \\\"\" . $share['ShareGroup'] . \"\\\"\";\n $newlines[] = \"\\t\\t IgnoreHidden on\";\n $newlines[] = \"\\t\\t</Limit>\";\n $newlines[] = \"\\t\\t<Limit ALL>\";\n $newlines[] = \"\\t\\t DenyAll\";\n $newlines[] = \"\\t\\t</Limit>\";\n\n $newlines[] = \"\\t</Directory>\";\n $newlines[] = \"\\t# DNR:Webconfig end - $name\";\n $newlines[] = \"\";\n\n if ($append) {\n $tempfile->delete_lines(\"/<\\/VirtualHost>/\");\n $tempfile->add_lines(implode(\"\\n\", $newlines) . \"\\n</VirtualHost>\\n\");\n } else {\n $tempfile->add_lines(implode(\"\\n\", $newlines) . \"\\n</VirtualHost>\\n\");\n }\n\n $tempfile->move_to(self::FTP_VIRTUAL_HOST_PATH . \"/\" . $filename);\n }\n\n // Validate proftpd configuration before restarting server\n $config_ok = TRUE;\n\n try {\n $options['validate_exit_code'] = FALSE;\n $shell = new Shell();\n // TODO: this fails on DNS lookup issues\n //$exitcode = $shell->execute(self::CMD_VALIDATE_PROFTPD, '-t', TRUE, $options);\n $exitcode = 0;\n } catch (Exception $e) {\n $config_ok = FALSE;\n }\n\n if ($exitcode !== 0) {\n $config_ok = FALSE;\n $output = $shell->get_output();\n clearos_log(self::LOG_TAG, \"Invalid ProFTP configuration!\");\n\n foreach ($output as $line)\n clearos_log(self::LOG_TAG, $line);\n }\n\n foreach ($confs as $conf) {\n // Not a flexshare conf file\n if (!isset($conf))\n continue;\n\n $file = new File(self::PATH_TEMP . \"/$conf.$backup_key.bak\");\n\n if (! $file->exists()) {\n // Conf was newly created\n $file = new File(self::FTP_VIRTUAL_HOST_PATH . \"/$conf\");\n\n if (! $config_ok)\n $file->delete();\n\n continue;\n }\n\n if ($config_ok) {\n // Delete backups\n $file->delete();\n } else {\n // Recover backups\n $file->move_to(self::FTP_VIRTUAL_HOST_PATH . \"/$conf\");\n }\n }\n\n if (!$config_ok)\n throw new Engine_Exception(lang('flexshare_config_validation_failed'));\n\n // Copy to FTPS configuration\n if (!empty($ftps_filename)) {\n $base_config = new File(self::FTP_VIRTUAL_HOST_PATH . '/' . $filename);\n $lines = $base_config->get_contents_as_array();\n $newlines = array();\n\n foreach ($lines as $line) {\n if (preg_match(\"/^\\s*Port\\s+[\\d]+$/\", $line))\n $newlines[] = \"\\tPort 990\";\n else if (preg_match(\"/^\\s*TLSOptions\\s+/\", $line))\n $newlines[] = \"\\t\\tTLSOptions NoCertRequest UseImplicitSSL\";\n else\n $newlines[] = $line;\n }\n\n $file = new File(self::FTP_VIRTUAL_HOST_PATH . '/' . $ftps_filename);\n if ($file->exists())\n $file->delete();\n\n $file->create('root', 'root', '0644');\n $file->dump_contents_from_array($newlines);\n }\n\n if ($config_ok) {\n try {\n $proftpd = new ProFTPd();\n $proftpd->reset(TRUE);\n } catch (Exception $e) {\n // Keep going\n }\n }\n }",
"protected function _generate_file_flexshares()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_library_installed('samba_common/Samba'))\n return;\n\n $samba = new Samba();\n\n if (! $samba->is_file_server())\n return;\n\n // Create a unique file identifier\n $backup_key = time();\n\n // Backup original file\n $backup = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);\n if ($backup->exists()) {\n $backup->move_to(self::PATH_TEMP . \"/$backup_key.bak\");\n $backup_exists = TRUE;\n } else {\n $backup_exists = FALSE;\n }\n\n // Samba is slightly different. We dump all flexshare-related 'stuff' in one file\n $file = new File(self::SMB_VIRTUAL_HOST_PATH . '/' . self::FILE_SMB_VIRTUAL);\n if ($file->exists())\n $file->delete();\n\n $file->create('root', 'root', '0644');\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n $linestoadd = '';\n\n // Recreate samba flexshare.conf\n\n foreach ($shares as $name => $share) {\n // If not enabled, continue through loop - we're re-creating lines here\n if (! isset($share['ShareEnabled']) || ! $share['ShareEnabled'])\n continue;\n\n if (! isset($share['FileEnabled']) || ! $share['FileEnabled'])\n continue;\n\n $linestoadd .= \"[\" . $name . \"]\\n\";\n $linestoadd .= \"\\tpath = \" . $share[\"ShareDir\"] . \"\\n\";\n $linestoadd .= \"\\tcomment = \" . $share[\"FileComment\"] . \"\\n\";\n $linestoadd .= \"\\tbrowseable = Yes\\n\";\n\n if ((int)$share[\"FilePermission\"] == self::PERMISSION_READ_WRITE)\n $linestoadd .= \"\\tread only = No\\n\";\n\n if (isset($share[\"FilePublicAccess\"]) && $share[\"FilePublicAccess\"]) {\n $linestoadd .= \"\\tguest ok = Yes\\n\";\n } else {\n $linestoadd .= \"\\tguest ok = No\\n\";\n $linestoadd .= \"\\tdirectory mask = 0775\\n\";\n $linestoadd .= \"\\tcreate mask = 0664\\n\";\n $linestoadd .= \"\\tvalid users = @\\\"%D\" . '\\\\' . trim($share[\"ShareGroup\"]) . \"\\\", @\" .\n trim($share[\"ShareGroup\"]) . \"\\n\";\n }\n\n $linestoadd .= \"\\tveto files = /.flexshare*/\\n\";\n\n $vfsobject = \"\";\n\n if (isset($share[\"FileRecycleBin\"]) && $share[\"FileRecycleBin\"]) {\n $vfsobject .= \" recycle:recycle\";\n $linestoadd .= \"\\trecycle:repository = .trash/%U\\n\";\n $linestoadd .= \"\\trecycle:maxsize = 0\\n\";\n $linestoadd .= \"\\trecycle:versions = Yes\\n\";\n $linestoadd .= \"\\trecycle:keeptree = Yes\\n\";\n $linestoadd .= \"\\trecycle:touch = No\\n\";\n $linestoadd .= \"\\trecycle:directory_mode = 0775\\n\";\n }\n\n if (isset($share[\"FileAuditLog\"]) && $share[\"FileAuditLog\"]) {\n $vfsobject .= \" full_audit:audit\";\n $linestoadd .= \"\\taudit:prefix = %u\\n\";\n $linestoadd .= \"\\taudit:success = open opendir\\n\";\n $linestoadd .= \"\\taudit:failure = all\\n\";\n $linestoadd .= \"\\taudit:facility = LOCAL5\\n\";\n $linestoadd .= \"\\taudit:priority = NOTICE\\n\";\n }\n\n if ($vfsobject)\n $linestoadd .= \"\\tvfs object =$vfsobject\\n\";\n\n $linestoadd .= \"\\n\";\n }\n\n $file->add_lines($linestoadd);\n\n // Make sure Samba has flexshare include\n //--------------------------------------\n\n $samba->add_include('/etc/samba/flexshare.conf');\n\n // Validate smbd configuration\n //----------------------------\n\n $config_ok = TRUE;\n\n try {\n $shell = new Shell();\n $options['validate_exit_code'] = FALSE;\n $exitcode = $shell->execute(self::CMD_VALIDATE_SMBD, '-s', FALSE, $options);\n } catch (Exception $e) {\n $config_ok = FALSE;\n clearos_log(self::LOG_TAG, \"Invalid Samba config: \" . clearos_exception_message($e));\n }\n\n if ($config_ok) {\n // Delete backups\n if ($backup_exists)\n $backup->delete();\n } else {\n // Recover backups\n if ($backup_exists) {\n try {\n $backup->move_to(self::SMB_VIRTUAL_HOST_PATH . \"/\" . self::FILE_SMB_VIRTUAL);\n } catch (Exception $e) {\n // Supresss error here...could be same file\n }\n }\n\n throw new Engine_Exception(lang('flexshare_config_validation_failed'));\n }\n }",
"public function createAdmConfig($servarray) {\n //check for the directory structure\n if (! file_exists ( $this->objConfig->getcontentBasePath () . 'adm/' )) {\n mkdir ( $this->objConfig->getcontentBasePath () . 'adm/', 0777 );\n }\n // write the server list file\n $cfile = $this->objConfig->getcontentBasePath () . 'adm/adm.xml';\n if (! file_exists ( $cfile )) {\n $conf = new Config_Container ( 'section', 'adm' ); //$servarray['name']);\n $conf_serv = & $conf->createSection ( $servarray ['name'] );\n $conf_serv->createDirective ( 'servername', $servarray ['name'] );\n $conf_serv->createDirective ( 'serverapiurl', $servarray ['url'] );\n $conf_serv->createDirective ( 'serveremail', $servarray ['email'] );\n $conf_serv->createDirective ( 'regtime', date ( 'r' ) );\n\n $config = new Config ( );\n $config->setRoot ( $conf );\n // write the container to an XML document\n $config->writeConfig ( $cfile, 'XML' );\n } else {\n // update the xml with the new server\n $root = & $config->parseConfig ( $cfile, 'XML', array ('name' => 'adm' ) );\n log_debug ( $root );\n $conf_serv = & $root->createSection ( $servarray ['name'] );\n $conf_serv->createDirective ( 'servername', $servarray ['name'] );\n $conf_serv->createDirective ( 'serverapiurl', $servarray ['url'] );\n $conf_serv->createDirective ( 'serveremail', $servarray ['email'] );\n $conf_serv->createDirective ( 'regtime', date ( 'r' ) );\n\n $config = new Config ( );\n $config->setRoot ( $root );\n // write the container to an XML document\n $config->writeConfig ( $cfile, 'XML' );\n }\n\n }",
"public function createDefaultHtaccessFile()\n {\n $htaccessFile = GeneralUtility::getFileAbsFileName('.htaccess');\n if (file_exists($htaccessFile)) {\n /**\n * Add Flashmessage that there is already an .htaccess file and we are not going to override this.\n */\n $flashMessage = GeneralUtility::makeInstance(\n 'TYPO3\\\\CMS\\\\Core\\\\Messaging\\\\FlashMessage',\n 'There is already an Apache .htaccess file in the root directory, please make sure that the url rewritings are set properly.'\n . 'An example configuration is located at: \"typo3conf/ext/bootstrap_package/Configuration/Apache/.htaccess\"',\n 'Apache .htaccess file already exists',\n FlashMessage::NOTICE,\n true\n );\n $this->addFlashMessage($flashMessage);\n return;\n }\n $htaccessContent = GeneralUtility::getUrl(ExtensionManagementUtility::extPath($this->extKey) . '/Configuration/Apache/.htaccess');\n GeneralUtility::writeFile($htaccessFile, $htaccessContent, true);\n\n /**\n * Add Flashmessage that the example htaccess file was placed in the root directory\n */\n $flashMessage = GeneralUtility::makeInstance(\n 'TYPO3\\\\CMS\\\\Core\\\\Messaging\\\\FlashMessage',\n 'For RealURL and optimization purposes an example .htaccess file was placed in your root directory.'\n . ' Please check if the RewriteBase correctly set for your environment. ',\n 'Apache example .htaccess was placed in the root directory.',\n FlashMessage::OK,\n true\n );\n $this->addFlashMessage($flashMessage);\n }",
"protected function _generate_web_aliases($share)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $name = $share['Name'];\n $config_aliases = array();\n\n // cgi-bin Alias must come first\n\n if ($share['WebCgi']) \n $config_aliases[] = \"ScriptAlias /flexshare/$name/cgi-bin/ \" . self::SHARE_PATH . \"/$name/cgi-bin/\";\n\n if (empty($share['ShareInternal'])) {\n $server_names[] = $name . '.' . trim($share['WebServerName']);\n $share_aliases[] = \"/flexshare/$name\";\n $document_roots[] = self::SHARE_PATH . \"/$name\";\n } else if ($share['ShareInternal'] == 2) {\n $server_names[] = $name . '.' . trim($share['WebServerName']);\n $share_aliases[] = \"/flexshare/$name\";\n $document_roots[] = self::SHARE_PATH . \"/$name\";\n } else {\n $server_names[] = trim($share['WebServerName']);\n $share_aliases[] = \"/flexshare/$name\";\n $document_roots[] = $share['ShareDir'];\n }\n\n // Build aliases\n //--------------\n\n $inx = 0;\n\n foreach ($server_names as $server_name) {\n if (empty($share['ShareInternal'])) {\n $config_aliases[] = \"Alias \" . $share_aliases[$inx] . \" \" . self::SHARE_PATH . \"/$name\\n\";\n } else if ($share['ShareInternal'] == 2) {\n if (!empty($share_aliases[$inx]))\n $config_aliases[] = \"Alias \" . $share_aliases[$inx] . \" \" . $document_roots[$inx] . \"\\n\";\n }\n\n $inx++;\n }\n\n return $config_aliases;\n }",
"function gen_astmanproxy_conf()\n{\n\tglobal $__BRD_SUM__;\n\tglobal $__BRD_HEAD__;\n\t$cfg_path = '/etc/asterisk/gw/astmanproxy.conf';\t\n\t$usr_path = '/etc/asterisk/gw/astmanproxy.users';\n\t$default_ast_username = 'internalspecifyuser';\n\t$default_ast_password = '2rujzdndyznbg7u6xju';\n\t$default_amp_username = 'internalspecifyuser';\n\t$default_amp_password = 'xn60qvh9dqx1j6ekcj1';\n\n\tif(!file_exists($cfg_path)){\n\t\ttouch($cfg_path);\n\t}\n\n\t$cluster_info = get_cluster_info();\n\n\t$lock = lock_file($cfg_path);\n\t$contents = \"host = 127.0.0.1, 5038, $default_ast_username, $default_ast_password, off, off\\n\";\n\tif($cluster_info['mode'] == 'master') {\n\t\tfor($b=2; $b<=$__BRD_SUM__; $b++) {\n\t\t\tif(isset($cluster_info[$__BRD_HEAD__.$b.'_ip']) && $cluster_info[$__BRD_HEAD__.$b.'_ip'] != '') {\n\t\t\t\t$ip = $cluster_info[$__BRD_HEAD__.$b.'_ip'];\n\t\t\t\t$contents .= \"host = $ip, 5038, $default_ast_username, $default_ast_password, off, off\\n\";\n\t\t\t} \n\t\t} \n\t} \n\n\t$contents .= \"listenaddress = *\\n\";\n\t$contents .= \"listenport = 1234\\n\";\n\t$contents .= \"inputformat = standard\\n\";\n\t$contents .= \"outputformat = standard\\n\";\n\t$contents .= \"autofilter = off\\n\";\n\t$contents .= \"authrequired = yes\\n\";\n\t$contents .= \"retryinterval = 2\\n\";\n\t$contents .= \"maxretries = 0\\n\";\n\t$contents .= \"sslclienthellotimeout = 200\\n\";\n\t$contents .= \"acceptencryptedconnection = yes\\n\";\n\t$contents .= \"acceptunencryptedconnection = yes\\n\";\n\t$contents .= \"asteriskwritetimeout=100\\n\";\n\t$contents .= \"clientwritetimeout=200\\n\";\n\n\tfile_put_contents($cfg_path, $contents);\n\tunlock_file($lock);\n\n\t/* generate astmanproxy.users */\n\t$lock = lock_file($usr_path);\n\tfile_put_contents($usr_path, \"$default_amp_username=$default_amp_password\\n\");\n\tunlock_file($lock);\n}",
"private function generateApacheVirtualHostsFile()\n {\n $output = $this->twig->render(\n 'apache/virtual_hosts.template',\n array(\n 'server' => $this->settings['Server'],\n 'apps' => $this->settings['Apps']\n )\n );\n\n if ($this->readOnly === false) {\n file_put_contents($this->apacheVirtualHostsFile, $output);\n echo 'Generated ' . $this->apacheVirtualHostsFile . PHP_EOL;\n } else {\n echo $output . PHP_EOL;\n }\n }",
"private function createHtaccessFiles()\n {\n $dir = $this->getGalleryDir();\n $this->fileHandler->createFileProtection($dir, Image::OBJECT_TYPE);\n }",
"public function makeConfigFile()\n\t{\n\t\t// Make sure we are called by an expected caller\n\t\tServerTechnology::checkCaller($this->allowedCallersForMake);\n\n\t\tJLoader::import('joomla.utilities.date');\n\n\t\t$date = new Date();\n\t\t$tz = new DateTimeZone($this->container->platform->getUser()->getParam('timezone', $this->container->platform->getConfig()->get('offset', 'UTC')));\n\t\t$date->setTimezone($tz);\n\t\t$d = $date->format('Y-m-d H:i:s T', true);\n\t\t$version = ADMINTOOLS_VERSION;\n\n\t\t$config = $this->loadConfiguration();\n\n\t\t// Load the fastcgi_pass setting\n\t\t$fastcgi_pass_block = $config->fastcgi_pass_block;\n\n\t\tif (empty($fastcgi_pass_block))\n\t\t{\n\t\t\t$fastcgi_pass_block = 'fastcgi_pass 127.0.0.1:9000;';\n\t\t}\n\n\t\t$fastcgi_pass_block = trim($fastcgi_pass_block);\n\n\t\t// Get the directory to the site's root\n\t\t$rewritebase = $config->rewritebase;\n\t\t$rewritebaseSlash = '/' . trim($rewritebase, '/ ');\n\t\t$rewritebaseSlash = ($rewritebaseSlash == '/') ? '' : $rewritebaseSlash;\n\t\t$rewritebase = '/' . trim($rewritebase, '/ ');\n\n\t\t$nginxConf = <<<END\n### ===========================================================================\n### Security Enhanced & Highly Optimized NginX Configuration File for Joomla!\n### automatically generated by Admin Tools $version on $d\n### ===========================================================================\n###\n### Admin Tools is Free Software, distributed under the terms of the GNU\n### General Public License version 3 or, at your option, any later version\n### published by the Free Software Foundation.\n###\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n### !! !!\n### !! If you get an Internal Server Error 500 or a blank page when trying !!\n### !! to access your site, remove this file and try tweaking its settings !!\n### !! in the back-end of the Admin Tools component. !!\n### !! !!\n### !! Remember to include this file in your site's configuration file. !!\n### !! Also remember to reload or restart NginX after making any change to !!\n### !! this file. !!\n### !! !!\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n###\n\n### Prevent access to this file\nlocation = $rewritebaseSlash/nginx.conf {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/nginx.conf.admintools {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\n\t\t// Protect against common file injection attacks?\n\t\tif ($config->fileinj == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< CONFDATA\n######################################################################\n## Protect against common file injection attacks\n######################################################################\nset \\$file_injection 0;\nif (\\$query_string ~ \"[a-zA-Z0-9_]=http://\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=(\\.\\.//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=/([a-z0-9_.]//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$file_injection = 1) {\n\treturn 403;\n\tbreak;\n}\n\nCONFDATA;\n\t\t}\n\n\t\tif ($config->phpeaster == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Disable PHP Easter Eggs\n######################################################################\nif (\\$query_string ~ \"\\=PHP[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\") {\n\treturn 403;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->leftovers == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Block access to configuration.php-dist and htaccess.txt\n######################################################################\nlocation = $rewritebaseSlash/configuration.php-dist {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/htaccess.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/configuration.php {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/CONTRIBUTING.md {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/joomla.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/LICENSE.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/phpunit.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/README.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->clickjacking == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Protect against clickjacking\nadd_header X-Frame-Options SAMEORIGIN;\n\nENDCONF;\n\t\t}\n\n\t\tif (!empty($config->hoggeragents) && ($config->nohoggers == 1))\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n######################################################################\n## Block access from specific user agents\n######################################################################\nset \\$bad_ua 0;\n\nENDCONF;\n\n\t\t\tforeach ($config->hoggeragents as $agent)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$http_user_agent ~ \"$agent\") {\n\tset \\$bad_ua 1;\n}\n\nENDCONF;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$bad_ua = 1) {\n\treturn 403;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif (($config->fileorder == 1) || ($config->nodirlists == 1))\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Directory indices and no automatic directory listings\n## Forces index.php to be read before the index.htm(l) files\n## Also disables showing files in a directory automatically\n######################################################################\nindex index.php index.html index.htm;\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->symlinks != 0)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Disable following symlinks\n######################################################################\n\nENDCONF;\n\t\t\tswitch ($config->symlinks)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks on;\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks if_not_owner;\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->exptime == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Set default expiration time\n######################################################################\n # CSS and JavaScript : 1 week\nlocation ~* \\.(css|js)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1w;\n}\n\n# Image files : 1 month\nlocation ~* \\.(bmp|gif|jpg|jpeg|jp2|png|svg|tif|tiff|ico|wbmp|wbxml|smil|webp)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Font files : 1 week\nlocation ~* \\.(woff|woff2|ttf|otf|eot)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Document files : 1 month\nlocation ~* \\.(pdf|txt|xml)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Audio files : 1 month\nlocation ~* \\.(mid|midi|mp3|m4a|m4r|aif|aiff|ra|wav|voc|ogg)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Video files : 1 month\nlocation ~* \\.(swf|vrml|avi|mkv|mpg|mpeg|mp4|m4v|mov|asf)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->autocompress == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Automatic compression of static resources\n## Compress text, html, javascript, css, xml and other static resources\n## May kill access to your site for old versions of Internet Explorer\n######################################################################\n# The following is the actual automatic compression setup\ngzip on;\ngzip_vary\t\ton;\ngzip_comp_level 6;\ngzip_proxied\texpired no-cache no-store private auth;\ngzip_min_length 1000;\ngzip_http_version 1.1;\ngzip_types text/plain text/css application/xhtml+xml application/xml+rss application/rss+xml application/x-javascript application/javascript text/javascript application/json text/xml application/xml image/svg+xml;\ngzip_buffers 16 8k;\ngzip_disable \"MSIE [1-6]\\.(?!.*SV1)\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->etagtype != -1)\n\t\t{\n\t\t\t$etagValue = ($config->etagtype == 1) ? 'on' : 'off';\n\t\t\t$nginxConf .= <<< CONF\n## Send ETag (you have set it to '$etagValue')\netag $etagValue;\n\nCONF;\n\n\t\t}\n\n\t\t$host = strtolower($config->httphost);\n\n\t\tif (substr($host, 0, 4) == 'www.')\n\t\t{\n\t\t\t$wwwHost = $host;\n\t\t\t$noWwwHost = substr($host, 4);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$noWwwHost = $host;\n\t\t\t$wwwHost = 'www.' . $host;\n\t\t}\n\n\t\t$subfolder = trim($config->rewritebase, '/') ? trim($config->rewritebase, '/').'/' : '';\n\n\t\tswitch ($config->wwwredir)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t// non-www to www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect non-www to www\n######################################################################\nif (\\$host = '$noWwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$wwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t// www to non-www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect www to non-www\n######################################################################\nif (\\$host = '$wwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$noWwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!empty($config->olddomain))\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect old to new domains\n######################################################################\n\nEND;\n\t\t\t$domains = trim($config->olddomain);\n\t\t\t$domains = explode(',', $domains);\n\t\t\t$newdomain = $config->httphost;\n\n\t\t\tforeach ($domains as $olddomain)\n\t\t\t{\n\t\t\t\t$olddomain = trim($olddomain);\n\n\t\t\t\tif (empty($olddomain))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$olddomain = $this->escape_string_for_regex($olddomain);\n\n\t\t\t\t$nginxConf .= <<<END\nif (\\$host ~ \"$olddomain$\" ) {\n\trewrite ^/(.*)$ \\$scheme://$newdomain/$1 permanent;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->hstsheader == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## HSTS Header - See http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security\nadd_header Strict-Transport-Security max-age=31536000;\n\nEND;\n\t\t}\n\n\t\tif ($config->cors == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Cross-Origin Resource Sharing (CORS)\nadd_header Access-Control-Allow-Origin \"*\";\nadd_header Timing-Allow-Origin \"*\";\n\nEND;\n\t\t}\n\n\t\tif ($config->referrerpolicy !== '-1')\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Referrer-policy\nadd_header Referrer-Policy \"{$config->referrerpolicy}\";\n\nEND;\n\t\t}\n\n\t\tif ($config->notracetrack == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Disable HTTP methods TRACE and TRACK (protect against XST)\nif (\\$request_method ~ ^(TRACE|TRACK)$ ) {\n\treturn 405;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->reducemimetyperisks == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reduce MIME type security risks\nadd_header X-Content-Type-Options \"nosniff\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->reflectedxss == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reflected XSS prevention\nadd_header X-XSS-Protection \"1; mode=block\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->notransform == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Prevent content transformation\nadd_header Cache-Control \"no-transform\";\n\nENDCONF;\n\t\t}\n\n\n\t\tif ($config->cfipfwd == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## CloudFlare support - see https://support.cloudflare.com/hc/en-us/articles/200170706-Does-CloudFlare-have-an-IP-module-for-Nginx-\n######################################################################\nset_real_ip_from 199.27.128.0/21;\nset_real_ip_from 173.245.48.0/20;\nset_real_ip_from 103.21.244.0/22;\nset_real_ip_from 103.22.200.0/22;\nset_real_ip_from 103.31.4.0/22;\nset_real_ip_from 141.101.64.0/18;\nset_real_ip_from 108.162.192.0/18;\nset_real_ip_from 190.93.240.0/20;\nset_real_ip_from 188.114.96.0/20;\nset_real_ip_from 197.234.240.0/22;\nset_real_ip_from 198.41.128.0/17;\nset_real_ip_from 162.158.0.0/15;\nset_real_ip_from 104.16.0.0/12;\nset_real_ip_from 2400:cb00::/32;\nset_real_ip_from 2606:4700::/32;\nset_real_ip_from 2803:f800::/32;\nset_real_ip_from 2405:b500::/32;\nset_real_ip_from 2405:8100::/32;\nreal_ip_header X-Forwarded-For;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttimeout == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Timeout handling, see http://wiki.nginx.org/HttpCoreModule\nclient_header_timeout 10;\nclient_body_timeout 10;\nsend_timeout 30;\nkeepalive_timeout 30s;\n\nEND;\n\t\t}\n\n\t\tif ($config->optsockets == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Socket settings, see http://wiki.nginx.org/HttpCoreModule\nconnection_pool_size 8192;\nclient_header_buffer_size 4k;\nlarge_client_header_buffers 8 8k;\nrequest_pool_size 8k;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttcpperf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Performance, see http://wiki.nginx.org/HttpCoreModule\nsendfile on;\nsendfile_max_chunk 1m;\npostpone_output 0;\ntcp_nopush on;\ntcp_nodelay on;\n\nEND;\n\t\t}\n\n\t\tif ($config->optoutbuf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Output buffering, see http://wiki.nginx.org/HttpCoreModule\noutput_buffers 8 32k;\n\nEND;\n\t\t}\n\n\t\tif ($config->optfhndlcache == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Filehandle Cache, useful when serving a large number of static files (Joomla! sites do that)\nopen_file_cache max=2000 inactive=20s;\nopen_file_cache_valid 30s;\nopen_file_cache_min_uses 2;\nopen_file_cache_errors on;\n\nEND;\n\t\t}\n\n\t\tif ($config->encutf8 == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Character encoding, see http://wiki.nginx.org/HttpCharsetModule\ncharset utf-8;\nsource_charset utf-8;\n\nEND;\n\t\t}\n\n\t\tif ($config->nginxsecurity == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Security options, see http://wiki.nginx.org/HttpCoreModule\nserver_name_in_redirect off;\nserver_tokens off;\nignore_invalid_headers on;\n\nEND;\n\t\t}\n\n\t\tif ($config->maxclientbody == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Maximum client body size set to 1 Gigabyte\nclient_max_body_size 1G;\n\nEND;\n\t\t}\n\n\t\tif ($config->blockcommon == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\nset \\$common_exploit 0;\nif (\\$query_string ~ \"proc/self/environ\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"mosConfig_[a-zA-Z_]{1,21}(=|\\%3D)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"base64_(en|de)code\\(.*\\)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"(<|%3C).*script.*(>|%3E)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"GLOBALS(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"_REQUEST(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$common_exploit = 1) {\n\treturn 403;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->enablesef == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Enable SEF URLs\nlocation / {\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\nlocation ~* /index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection rules exceptions\n######################################################################\n\nEND;\n\n\t\tif (!empty($config->exceptionfiles))\n\t\t{\n\t\t\tforeach ($config->exceptionfiles as $file)\n\t\t\t{\n\t\t\t\tif (substr($file, -4) == '.php')\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->exceptiondirs))\n\t\t{\n\t\t\tforeach ($config->exceptiondirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*\\.php$\n{\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->fullaccessdirs))\n\t\t{\n\t\t\tforeach ($config->fullaccessdirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection\n######################################################################\n\nEND;\n\n\t\tif ($config->backendprot == 1)\n\t\t{\n\t\t\t$bedirs = implode('|', $config->bepexdirs);\n\t\t\t$betypes = implode('|', $config->bepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select back-end directories\nlocation ~* ^$rewritebaseSlash/administrator/($bedirs)/.*.($betypes)$ {\n\tbreak;\n}\n\n# Allow access to the back-end index.php file\nlocation = $rewritebaseSlash/administrator/index.php {\n\t$fastcgi_pass_block\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/administrator$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\nlocation ~* ^$rewritebaseSlash/administrator/$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* $rewritebaseSlash/administrator.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /administrator/index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->frontendprot == 1)\n\t\t{\n\t\t\t$fedirs = implode('|', $config->fepexdirs);\n\t\t\t$fetypes = implode('|', $config->fepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select front-end directories\nlocation ~* ^$rewritebaseSlash/($fedirs)/.*.($fetypes)$ {\n\tbreak;\n}\n\n## Disallow front-end access for certain Joomla! system directories (unless access to their files is allowed above)\nlocation ~* ^$rewritebaseSlash/includes/js/ {\n\treturn 403;\n}\nlocation ~* ^$rewritebaseSlash/(cache|includes|language|logs|log|tmp)/ {\n\treturn 403;\n}\n\nEND;\n\t\t\tif ($config->enablesef != 1)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<<END\n# Allow access to the front-end index.php file\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\nlocation ^$rewritebaseSlash/index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<<END\n# Allow access to /\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* ^$rewritebaseSlash/.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= \"##### Advanced server protection -- END\\n\\n\";\n\n\t\treturn $nginxConf;\n\t}",
"private function createConfig()\n\t{\n\t\t$configFilename = __DIR__ . '/app/config/config.local.neon';\n\n\t\tcopy(__DIR__ . '/app/config/config.local.example.neon', $configFilename);\n\n\t\t$lines = file($configFilename);\n\n\t\tforeach ($lines as $key => $line)\n\t\t{\n\t\t\tforeach (array('username', 'password', 'database') as $subject)\n\t\t\t{\n\t\t\t\tif (strpos($line, \"\\t\" . $subject))\n\t\t\t\t{\n\t\t\t\t\t$lines[$key] = $this->deleteNewline($line, \"\\n\") . ' ' . $this->config['db'][$subject] . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (file_put_contents($configFilename, $lines))\n\t\t{\n\t\t\t$this->success('Local config file created ...');\n\t\t}\n\t}",
"private function createConfigFile(): void\n {\n if (!file_exists($this->getModulePath() . '/config.php')) {\n $configFile = fopen($this->getModulePath() . '/config.php', 'a+');\n $content = require __DIR__ . '/templates/config.php';\n fputs($configFile, $content);\n fclose($configFile);\n }\n }",
"function Create_Directories() {\n global $CONF;\n $Dirs = [['int/ArchiveImages',1], // dir name, access control\n ['int/Contracts',1],\n ['int/Insurance',1],\n ['int/Invoices',1],\n ['int/LogFiles',1],\n ['int/OldStore',1],\n ['int/PAspecs',1],\n ['int/Store',1],\n ['int/Temp',0],\n ];\n $LinkedDirs = ['js','files','cache','images','festfiles'];\n foreach($Dirs as $D) {\n if (!file_exists(\"../\" . $D[0])) {\n \n mkdir(\"../\" . $D[0],0777,true);\n chmod(\"../\" . $D[0],0777);\n echo \"Creating \" . $D[0] . \"<br>\";\n }\n if ($D[1] && !file_exists(\"../\" . $D[0] . \"/.htaccess\")) file_put_contents(\"../\" . $D[0] . \"/.htaccess\",\"order deny,allow\\ndeny from all\");\n }\n foreach($LinkedDirs as $D) {\n if (!file_exists(\"../\" . $D)) mkdir(\"../\" . $D,0777,true);\n if (!file_exists($D)) symlink (\"../\" . $D, $D);\n }\n echo \"Directories Created<p>\";\n}",
"function htaccess( $_, $assoc ) {\n\n\t\t//Check Network\n\t\t$network = Core::is_multisite();\n\n\t\t//Check Custom directory\n\t\t$dirs = array();\n\t\tforeach ( array( 'wp_content', 'plugins', 'uploads', 'themes' ) as $dir ) {\n\t\t\tif ( isset( $assoc[ $dir ] ) ) {\n\t\t\t\t$dirs[ $dir ] = $assoc[ $dir ];\n\t\t\t}\n\t\t}\n\n\t\t//Create file\n\t\tPermalink::create_permalink_file( $network['network'], $network['subdomain'], $dirs );\n\n\t\t//Success\n\t\tCLI::success( CLI::_e( 'package', 'created_file', array( \"[file]\" => $network['mod_rewrite_file'] ) ) );\n\t}",
"private function create_wp_config()\n\t{\n\t\tcopy('assets/wp-config-start.php', $this->site_path.'wp-config.php');\n\n\t\t// read wp-config and salts into arrays\n\t\t$wp_config = file($this->site_path.'wp-config.php');\n\t\t$salts = file(\"https://api.wordpress.org/secret-key/1.1/salt/\");\n\n\t\t// define values for DB_NAME, DB_PASSWORD and all salts\n\t\t$wp_config[18] = \"define('DB_NAME', '\".$this->project_slug.\"');\\r\\n\";\n\t\t$wp_config[21] = \"define('DB_USER', '\".get_config('db_user').\"');\\r\\n\";\n\t\t$wp_config[24] = \"define('DB_PASSWORD', '\".get_config('db_pass').\"');\\r\\n\";\n\n\t\tfor($i=44, $j=0; $i<52; $i++, $j++) {\n\t\t\t$wp_config[$i] = $salts[$j];\n\t\t}\n\n\t\t// update wp-config file\n\t\tfile_put_contents($this->site_path.'wp-config.php', $wp_config);\n\t}",
"function http_basic_auth_provision_apache_vhost_config($uri, $data) {\n $lines = array();\n $user = d()->http_basic_auth_username;\n $pass = d()->http_basic_auth_password;\n\n if (!empty($user) && !empty($pass)) {\n // Create the password file.\n $path = _http_basic_auth_create_file($uri, $data, $user, $pass);\n\n // Now add the file to the vhost:\n $root = d()->root;\n $message = !empty(d()->http_basic_auth_message) ? d()->http_basic_auth_message : dt('Restricted access');\n $lines[] = \" <Directory \\\"$root\\\">\";\n $lines[] = \" # HTTP Basic Authentication added by Aegir\";\n $lines[] = \" AuthType Basic\";\n $lines[] = \" AuthName \\\"$message\\\"\";\n\n $lines[] = \" AuthUserFile $path\";\n $lines[] = \" Require valid-user\";\n $lines[] = \" </Directory>\";\n }\n\n return implode(\"\\n\", $lines);\n}",
"public function createStructure() {\n\t\t$output = $this->sshCommand('rm -rf ' . $this->directory . '*');\n\t\t$output = $this->sshCommand('mkdir -p ' . $this->directory . 'shared/Configuration/Production');\n\t\t$this->sshCommand('cp ' . $this->directory . '../Settings.yaml ' . $this->directory . '/shared/Configuration/Production/Settings.yaml ');\n\t\t$output = $this->sshCommand('cd ' . $this->directory . ' && ln -s releases/current/Web Web');\n\t}",
"function createConfigFile()\n{\n\t$path = dirname(WP_CONTENT_DIR);\n\t$serverPath = $_SERVER['DOCUMENT_ROOT'];\n\t$content = '<?php define(\"projectPath\",\\''.$path.'\\'); define(\"serverPath\", \\''.$serverPath.'\\'); ?>';\n\t\n\tfile_put_contents(WP_PLUGIN_DIR.\"\\\\vanarts-project-crawler\\\\config.php\",$content,LOCK_EX);\n}",
"public function checkhtaccess()\n {\n $appPath = \"application/.htaccess\";\n $modPath = \"modules/.htaccess\";\n \n if(!file_exists($appPath)){\n print \"<strong>htaccess file missing from application path - creating now</strong> \";\n $fh = fopen($appPath, 'w') or print(\"can't create file\");\n $accessText = \"order allow,deny\\nallow from 127.0.0.1\\ndeny from all\\n\";\n fwrite($fh, $accessText);\n fclose($fh);\n print \"<br/>Written\";\n }\n else{\n print \"htaccess application file exists<br/>\";\n }\n if(!file_exists($modPath)){\n print \"<strong>htaccess file missing from module path - creating now</strong> \";\n $fh = fopen($modPath, 'w') or print(\"can't create file\");\n $accessText = \"order allow,deny\\nallow from 127.0.0.1\\ndeny from all\\n\";\n fwrite($fh, $accessText);\n fclose($fh);\n print \"<br/>Written\";\n }\n else{\n print \"htaccess module file exists<br/>\";\n }\n return;\n }",
"function auto_configure()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n if (clearos_library_installed('ftp/ProFTPd')) {\n $this->_generate_ftp_flexshares();\n\n $proftpd = new ProFTPd();\n $proftpd->reset(TRUE);\n }\n } catch (Exception $e) {\n // Not fatal\n }\n\n try {\n if (clearos_library_installed('web_server/Httpd')) {\n $this->_generate_web_flexshares();\n\n $httpd = new Httpd();\n $httpd->reset(TRUE);\n }\n } catch (Exception $e) {\n // Not fatal\n }\n }",
"function do_htaccess()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$name = '.htaccess';\n\t\t$msg = array();\n\t\t$dirs = array( ROOT_PATH . 'cache',\n\t\t\t\t\t ROOT_PATH . 'skin_acp',\n\t\t\t\t\t ROOT_PATH . 'style_avatars',\n\t\t\t\t\t ROOT_PATH . 'style_emoticons',\n\t\t\t\t\t ROOT_PATH . 'style_images',\n\t\t\t\t\t ROOT_PATH . 'style_captcha',\n\t\t\t\t\t ROOT_PATH . 'uploads' );\n\n\t\t$towrite = <<<EOF\n\n#<ipb-protection>\n<Files ~ \"^.*\\.(php|cgi|pl|php3|php4|php5|php6|phtml|shtml)\">\n Order allow,deny\n Deny from all\n</Files>\n#</ipb-protection>\nEOF;\n\n\t\t//-----------------------------------------\n\t\t// Do it!\n\t\t//-----------------------------------------\n\t\n\t\tforeach( $dirs as $directory )\n\t\t{\n\t\t\tif ( $FH = @fopen( $directory . '/'. $name, 'a+' ) )\n\t\t\t{\n\t\t\t\tfwrite( $FH, $towrite );\n\t\t\t\tfclose( $FH );\n\t\t\t\n\t\t\t\t$msg[] = \"Written .htaccess to $directory...\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$msg[] = \"Skipped $directory, could not write into it...\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Done...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->main_msg = implode( \"<br />\", $msg );\n\t\t$this->security_overview();\n\t}",
"function orgright_client_config_print() {\n // need to give apache write permission in the dompdf library \"lib/fonts\" directory\n $path = drupal_get_path('module', 'print') . '/lib/dompdf/lib/fonts';\n if (file_exists($path) && chgrp($path, 'apache')) {\n $files = scandir($path);\n foreach ($files as $file) {\n chgrp($path, 'apache');\n }\n }\n}",
"function Init() { global $ConfigVars; $ConfigVars=Array(\n\n//*** START OF CONFIGURATION ***\n\n//Paths’ manipulation\n'ApacheConfPath' =>'/etc/httpd/conf/httpd.conf',\n'LetsEncryptCommand' =>'letsencrypt ?Params?',\n'LetsEncryptParams' =>'certonly --webroot -t --renew-by-default --agree-tos --duplicate', //--expand is broken for me atm\n'SSLInstallCommand' =>'whmapi1 --output=json installssl domain=%s crt=%s key=%s cab=%s',\n'CertPathOverride' =>'',\n\n//Allow overwriting the above path manipulation variables\n//If the user is not completely trusted, this needs to be set to false, as otherwise, they can read any file or run any system command as the current user\n//Will be directly evalutated to a boolean below\n'AllowConfigOverride'=>true,\n\n//Other variables\n'TimestampType' =>'DailyDate,Time',\n'ColoringType' =>'UseInterfaceType',\n'DistributionType' =>'SeparateVHosts',\n'URLEncodeParams' =>'true',\n'InstallAnyways' =>'true',\n\n//*** END OF CONFIGURATION ***\n\n\t);\n\n\t//Variable sanitization\n\t$ConfigVars['AllowConfigOverride']=(bool)$ConfigVars['AllowConfigOverride'];\n}",
"private static function setupBaseConfiguration() {\n\n\t\t// server data\n\t\tself::set('host', $_SERVER['SERVER_NAME']);\n\t\tself::set('domain', 'http://' . $_SERVER['SERVER_NAME']);\n\t\tself::set('current_file', basename($_SERVER['PHP_SELF']));\n\t\tself::set('webroot', '/');\n\t\tself::set('web_address', self::get('domain') . self::get('webroot'));\n\t\tself::set('web_address_no_slash', substr(self::get('domain') . self::get('webroot'), 0, -1));\n\t\tself::set('root', $_SERVER['DOCUMENT_ROOT'] . self::get('webroot'));\n\t\t\n\t\t// folder locations\n\t\tself::set('modules', self::get('root') . 'modules/');\n\t\tself::set('config', self::get('root') . 'app/config/');\n self::set('temp', self::get('root') . 'runtime/');\n self::set('app', self::get('root') . 'app/');\n\t\t\n\t\t// errors\n\t\tself::set('error_log', self::get('temp') . 'errors/php.txt');\n\n\t\tself::parseIniConfig('system');\n self::parseIniConfig('source');\n self::parseIniConfig('custom');\n \n }",
"function do_htaccess()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$name = '.htaccess';\n\t\t$msg = array();\n\t\t$dirs = array( ROOT_PATH . 'cache',\n\t\t\t\t\t ROOT_PATH . 'skin_acp',\n\t\t\t\t\t ROOT_PATH . 'style_avatars',\n\t\t\t\t\t ROOT_PATH . 'style_emoticons',\n\t\t\t\t\t ROOT_PATH . 'style_images',\n\t\t\t\t\t ROOT_PATH . 'style_captcha',\n\t\t\t\t\t ROOT_PATH . 'uploads' );\n\n\t\t$towrite = <<<EOF\n#<ipb-protection>\n<Files ~ \"^.*\\.(php|cgi|pl|php3|php4|php5|php6|phtml|shtml)\">\n Order allow,deny\n Deny from all\n</Files>\n#</ipb-protection>\nEOF;\n\n\t\t//-----------------------------------------\n\t\t// Do it!\n\t\t//-----------------------------------------\n\n\t\tforeach( $dirs as $directory )\n\t\t{\n\t\t\tif ( $FH = @fopen( $directory . '/'. $name, 'w' ) )\n\t\t\t{\n\t\t\t\tfwrite( $FH, $towrite );\n\t\t\t\tfclose( $FH );\n\n\t\t\t\t$msg[] = \"Запись «.htaccess» в директорию $directory...\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$msg[] = \"Невозможно произвести запись в $directory...\";\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Done...\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->main_msg = implode( \"<br />\", $msg );\n\t\t$this->security_overview();\n\t}",
"function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\nif (!defined('PDNSADMIN')) {\n header('HTTP/1.0 403 Forbidden');\n die;\n}\n\n\\$set = array();\n\n\";\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}",
"function install_create_config($web_path,$username,$password,$hostname,$database) { \n\n $data['database_username'] = $username;\n $data['database_password'] = $password;\n $data['database_hostname'] = $hostname;\n $data['database_name'] = $database;\n\t$data['web_path']\t = $web_path; \n\n Config::set_by_array($data,'1');\n\n /* Attempt to make DB connection */\n $dbh = Dba::dbh();\n\n\t/* \n\t First Test The Variables they've given us to make\n\t sure that they actually work!\n\t*/\n\t// Connect to the DB\n\tif(!is_resource($dbh)) { \n\t\tError::add('general',\"Database Connection Failed Check Hostname, Username and Password\");\n\t\treturn false;\n\t}\n\tif (!$db_selected = @mysql_select_db($database, $dbh)) { \n\t\tError::add('general',\"Database Selection Failure Check Existance of $database\");\n\t\treturn false;\n\t}\n\n\t$final = generate_config($data); \n\n\t$browser = new Browser(); \n\t$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize('config/ampache.cfg.php.dist')); \n\techo $final; \n\texit();\n\n\treturn true;\n\n}",
"private function CreateConfigFile()\n {\n $f = @fopen(dirname(__FILE__) . '/' . $this->configFile, 'wb');\n fclose($f);\n }",
"protected function _generate_web_virtual_hosts($share, $port)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // The <VirtualHost> blocks for each type of share (normal, web site, web app)\n // slightly different (legacy reasons). The differences are captured in the\n // the if statement below.\n //-----------------------------------------------------------------------------\n\n $name = $share['Name'];\n\n $server_names = array();\n $server_aliases = array();\n $document_roots = array();\n\n $share['WebServerName'] = trim($share['WebServerName']);\n $share['WebServerAlias'] = empty($share['WebServerAlias']) ? '' : trim($share['WebServerAlias']);\n\n if (empty($share['WebFolderLayout'])) {\n $log_subdir = '';\n $docroot_subdir = '';\n $error_subdir = '';\n } else {\n $log_subdir = 'logs';\n $docroot_subdir = 'html';\n $error_subdir = 'error';\n }\n\n if (empty($share['ShareInternal'])) {\n $server_names[] = $name . '.' . $share['WebServerName'];\n $server_aliases[] = empty($share['WebServerAlias']) ? '' : $share['WebServerAlias'];\n $document_roots[] = self::SHARE_PATH . \"/$name\";\n $access_log = self::HTTPD_LOG_PATH . '/' . $share['WebServerName'] . '_access_log common';\n $error_log = self::HTTPD_LOG_PATH . '/' . $share['WebServerName'] . '_error_log';\n } else {\n $server_names[] = $share['WebServerName'];\n $server_aliases[] = $share['WebServerAlias'];\n\n if (empty($share['WebDefaultSite'])) {\n if (!empty($share['WebFolderLayout']) && ($share['WebFolderLayout'] == self::FOLDER_LAYOUT_SANDBOX)) {\n $document_roots[] = $share['ShareDir'] . '/' . self::SANDBOX_DOCROOT_SUBDIR;\n $access_log = $share['ShareDir'] . '/' . self::SANDBOX_LOG_SUBDIR . '/' . $share['WebServerName'] . '_access_log combined';\n $error_log = $share['ShareDir'] . '/' . self::SANDBOX_LOG_SUBDIR . '/' . $share['WebServerName'] . '_error_log';\n } else {\n $document_roots[] = $share['ShareDir'];\n $access_log = self::HTTPD_LOG_PATH . '/' . $share['WebServerName'] . '_access_log combined';\n $error_log = self::HTTPD_LOG_PATH . '/' . $share['WebServerName'] . '_error_log';\n }\n } else {\n $document_roots[] = $share['ShareDir'];\n $access_log = self::HTTPD_LOG_PATH . '/' . 'access_log combined';\n $error_log = self::HTTPD_LOG_PATH . '/' . 'error_log';\n }\n }\n\n // Certificates\n //-------------\n\n $cert = empty($share['WebSslCertificate']) ? Certificate_Manager::DEFAULT_CERT : $share['WebSslCertificate'];\n\n $certificate_manager = new Certificate_Manager();\n $certs = $certificate_manager->get_certificates();\n\n // Use default if specified certificate no longer exists\n if (!array_key_exists($cert, $certs))\n $cert = Certificate_Manager::DEFAULT_CERT;\n\n $cert_files = $certs[$cert];\n\n // Build VirtualHost block\n //------------------------\n\n $inx = 0;\n $config_virtual_host = array();\n\n foreach ($server_names as $server_name) {\n $config_virtual_host[] = \"<VirtualHost *:$port>\";\n $config_virtual_host[] = \"\\tServerName \" . $server_name;\n\n if (!empty($share['WebServerAlias']))\n $config_virtual_host[] = \"\\tServerAlias \" . $server_aliases[$inx];\n\n $config_virtual_host[] = \"\\tDocumentRoot \" . $document_roots[$inx];\n\n if ($share['WebCgi'])\n $config_virtual_host[] = \"\\tScriptAlias /cgi-bin/ \" . self::SHARE_PATH . \"/$name/cgi-bin/\";\n\n $config_virtual_host[] = \"\\tErrorLog \" . $error_log;\n $config_virtual_host[] = \"\\tCustomLog \" . $access_log;\n\n if (($port === 443) || $share['WebReqSsl']) {\n $config_virtual_host[] = \"\\tSSLEngine on\";\n\n $config_virtual_host[] = \"\\tSSLCertificateFile \" . $cert_files['certificate-filename'];\n $config_virtual_host[] = \"\\tSSLCertificateKeyFile \" . $cert_files['key-filename'];\n\n if (array_key_exists('intermediate-filename', $cert_files))\n $config_virtual_host[] = \"\\tSSLCertificateChainFile \" . $cert_files['intermediate-filename'];\n\n if (array_key_exists('ca-filename', $cert_files))\n $config_virtual_host[] = \"\\tSSLCACertificateFile \" . $cert_files['ca-filename'];\n\n $config_virtual_host[] =\n \"\\t# No weak export crypto allowed\\n\" .\n \"\\tSSLHonorCipherOrder on\\n\" .\n \"\\tSSLProtocol all -SSLv2 -SSLv3 -TLSv1\\n\" .\n \"\\tSSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!3DES:!aNULL:!MD5\\n\" .\n \"\\tSetEnvIf User-Agent \\\".*MSIE.*\\\" \" .\n \"nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0\";\n }\n\n if ($share['WebReqAuth']) {\n $config_virtual_host[] = \"\\tDefineExternalAuth pwauth pipe /usr/bin/pwauth\";\n $config_virtual_host[] = \"\\tDefineExternalGroup pwauth pipe /usr/bin/unixgroup\";\n }\n\n $config_virtual_host[] = \"</VirtualHost>\\n\";\n\n $inx++;\n }\n\n return $config_virtual_host;\n }",
"function init_config() {\n\t\n\t/**\n\t*\tCONFIGURATION FILE FOR THE APPLICATION\n\t*\n\t*\t\n\t*/\n\t$configuration = array (\n\t\n\t/**\n\t*\tLog file directory\n\t*\n\t*/\n\t\t\"LOGGER_CONFIG\"\t\t=> array (\n\t\t\t\t\"LOG_DIR\" \t\t=> \"bin\\logs\\\\\", # Default Value = \"bin\\logs\\\\\"\n\t\t\t\t\"LOG_FILE\"\t\t=> \"app_log.log\" # Default Value = \"app_log.log\"\n\t\t),\n\t\t\n\t\t\n\t/**\n\t*\tEncoding type\n\t*\n\t*/\n\t\t\"ENCODING_TYPE\"\t\t=> array (\n\t\t\t\t\"CHARSET\" \t\t=> \"UTF-8\"\n\t\t),\n\t\t\n\t\t\n\t/**\t\n\t*\tto configure server:\n\t*\t\t\"DB_SERVER_\"=> array (\n\t*\t\t\t\"_HOST\" \t=> \"host_ip/host_name\",\n\t*\t\t\t\"_DATABASE\" => \"Database_name\",\n\t*\t\t\t\"_USER\"\t\t=> \"Database_username\",\n\t*\t\t\t\"_PASS\"\t\t=> \"Database_password\",\n\t*\t\t\t\"_PORT\"\t\t=> \"Database_host_port\" \n\t*\t\t),\n\t*/\n\t\t\"DB_SERVER_\"\t\t=> array (\n\t\t\t\t\"HOST\" \t\t\t=> \"\",\n\t\t\t\t\"DATABASE\" \t\t=> \"\",\n\t\t\t\t\"USER\"\t\t\t=> \"\",\n\t\t\t\t\"PASS\"\t\t\t=> \"\",\n\t\t\t\t\"PORT\"\t\t\t=> \"\" #,\n\t\t\t)\n\t/**\n\t*\tto add another database server add \n\t*\n\t*\t\t\"DB_SERVER_01\"\t=> array (\n\t*\t\t\t\"_HOST_1\" \t\t=> \"host_ip/host_name\",\n\t*\t\t\t\"_DATABASE_1\" => \"Database_name\",\n\t*\t\t\t\"_USER_1\"\t\t=> \"Database_username\",\n\t*\t\t\t\"_PASS_1\"\t\t=> \"Database_password\",\n\t*\t\t\t\"_PORT_1\"\t\t=> \"Database_host_port\" \n\t*\t\t),\n\t*/\n\t);\n\n\n\t/*\n\t*\tinitialize the configurations to a global constant\n\t*\n\t*/\n\tforeach($configuration as $category) {\n\t\tforeach($category as $key => $value) { define($key,$value); }\n\t}\n}"
] | [
"0.6356314",
"0.6275717",
"0.61098266",
"0.59630734",
"0.5907761",
"0.5831545",
"0.56754297",
"0.561551",
"0.5583916",
"0.54488975",
"0.54091114",
"0.54071194",
"0.540448",
"0.52767676",
"0.525236",
"0.5248043",
"0.5186974",
"0.5157305",
"0.5156003",
"0.50782794",
"0.5053878",
"0.50515336",
"0.5016122",
"0.5004302",
"0.4972442",
"0.49556866",
"0.49296308",
"0.49208608",
"0.49113348",
"0.49095866"
] | 0.63791156 | 0 |
Generic get share parameter routine. | protected function _get_parameter($name, $key)
{
clearos_profile(__METHOD__, __LINE__);
$shares = $this->_get_shares(self::TYPE_ALL);
if (isset($shares[$name][$key]))
return $shares[$name][$key];
else
throw new Flexshare_Parameter_Not_Found_Exception($key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGetParameter($key = null);",
"public function __get($param);",
"public function __get($parameter);",
"public function getParameter()/*# : Parameter */;",
"protected abstract function getParam($param, $default = false);",
"public function getShare();",
"public abstract function get_parameter($name);",
"abstract public function getParam($name);",
"function getParams ();",
"public function getParam($key);",
"public function get_params();",
"public function get_params();",
"public function getParam(string $key);",
"function get_par($var) {\n\t// try to read the settings from session\n if (isset($_SESSION['settings'][$var])) {\n\t\treturn $_SESSION['settings'][$var];\n } \n\telse {\n read_par();\n if (isset($_SESSION['settings'][$var])) {\n\t\t\treturn $_SESSION['settings'][$var];\n } \n\t\telse {\n \t print (\"<h2>ERROR SETTING NOT FOUND in function get_par(): \".$var.\"</h2>\");\n return false;\n }\n }\n}",
"abstract protected function getFetchParameters();",
"public function getParam(string $param);",
"public function get_param($key){\r\n\t\treturn $this->params[$key];\r\n\t}",
"function getGetParameter($name)\n{\n\treturn isset($_GET[$name]) ? $_GET[$name] : false;\n}",
"function getParameter($name);",
"public function get($param) {\n return $this->params[$param];\n }",
"function getParam ($name);",
"public function get(BaseParameterBag $params);",
"function getGetOrPostParameter($name){\n\tif($value = getGetParameter($name)){\n\t\treturn $value;\n\t}else{\n\t\treturn getPostParameter($name);\n\t}\n}",
"abstract protected function _get();",
"public function getShareWith();",
"public function get_param($name){\n if(isset($_POST[$name])){\n $value=$_POST[$name];\n }elseif(isset($_GET[$name])){\n $value=$_GET[$name]; \n }else{\n return null;\n }\n return $this->check_param($value);\n }",
"function _getParam( $name, $default='' )\n {\n \t$return = $this->params->get($name, $default); \n return $return;\n }",
"function getParameters();",
"function get_param($param_name) {\n global $_POST;\n global $_GET;\n\n $param_value = \"\";\n if(isset($_POST[$param_name])) {\n $param_value = $_POST[$param_name];\n } else if(isset($_GET[$param_name])) {\n $param_value = $_GET[$param_name];\n }\n return $param_value;\n}",
"function get($type = '', $parameter_name = '', $allow_null = '')\n\t{\n\t\t$ci = & get_instance();\n\n\t\tif (!in_array($type, array('single', 'object', 'array')))\n\t\t{\n\t\t\tshow_response(500, 'type is incorrect');\n\t\t\texit();\n\t\t}\n\n\t\tif ($type == 'single' && $parameter_name == '')\n\t\t{\n\t\t\tshow_response(500, 'parameter is empty');\n\t\t\texit();\n\t\t}\n\n\t\t//get input data \n\t\t$get_variable = $ci->input->get(NULL, TRUE);\n\t\t$post_variable = $ci->input->post(NULL, TRUE);\n\n\t\tif ($type == 'single' && $allow_null === TRUE && !$ci->variable->check_paging_allow_with_null($get_variable, $post_variable))\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\n\t\t$ci->all_variable_array = array_merge($get_variable, $post_variable);\n\n\t\t//set input data to input_variable\n\t\t$input = array();\n\t\tforeach ($get_variable as $name => $value)\n\t\t{\n\t\t\t$input[$name] = $value;\n\t\t}\n\t\tforeach ($post_variable as $name => $value)\n\t\t{\n\t\t\t$input[$name] = $value;\n\t\t}\n\n\t\t//call library with parameter input_variable\n\t\t$default_value = $ci->variable->set_default_value($input);\n\t\t$ci->variable->validate($input, $default_value);\n\t\t$output = '';\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase 'single':\n\t\t\t\tif (!isset($input[$parameter_name]))\n\t\t\t\t{\n\t\t\t\t\tshow_response(406, \"$parameter_name not set\");\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\t$output = $input[$parameter_name];\n\t\t\t\tbreak;\n\t\t\tcase 'object':\n\t\t\t\t$output = new stdClass();\n\t\t\t\tforeach ($input as $name => $value)\n\t\t\t\t{\n\t\t\t\t\t$output->$name = $value;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'array':\n\t\t\t\t$output = $input;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t}\n\t\treturn $output;\n\t}"
] | [
"0.6043414",
"0.6029798",
"0.6003518",
"0.59866023",
"0.5982625",
"0.5925414",
"0.5826452",
"0.5795329",
"0.57837486",
"0.57742465",
"0.5756299",
"0.5756299",
"0.57081485",
"0.56931645",
"0.56929135",
"0.5673415",
"0.56548506",
"0.5652477",
"0.5651643",
"0.5615256",
"0.560331",
"0.5595856",
"0.5591297",
"0.55850667",
"0.55793047",
"0.55638814",
"0.5538974",
"0.55252266",
"0.5520438",
"0.5504661"
] | 0.6456318 | 0 |
Tests evaluating the condition. | public function testConditionEvaluation() {
$entity = $this->prophesizeEntity(EntityInterface::class);
$entity->getEntityTypeId()->willReturn('node')->shouldBeCalledTimes(2);
// Add the test node to our context as the evaluated entity, along with an
// explicit entity type string.
// First, test with a value that should evaluate TRUE.
$this->condition->setContextValue('entity', $entity->reveal())
->setContextValue('type', 'node');
$this->assertTrue($this->condition->evaluate());
// Then test with values that should evaluate FALSE.
$this->condition->setContextValue('type', 'taxonomy_term');
$this->assertFalse($this->condition->evaluate());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function evaluate()\n {\n $this->_opcodes->context('exists', array($this->_exp));\n $this->_exp = '';\n }",
"public function comparisonTest() {\n\t\tif ($actual = $this->getActual()) {\n\t\t\techo $actual;\n\t\t}\n\t\t// Next line should report no condition assignment without comparison\n\t\tif (\n\t\t\t$actual = $this->getActual()\n\t\t) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() == true) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() > 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() < 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() <= 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() >= 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() === 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() != 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() !== 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif (true == $actual = $this->getActual()) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual) {\n\t\t\treturn 'yo';\n\t\t}\n\t}",
"protected function condition() {\n\t\treturn true;\n\t}",
"public function testAssertTapIf()\n {\n $condition = rand(0, 1) === 1;\n\n $value = rand(0, 10);\n $exponential = rand(0, 10);\n\n /** @var \\Ianrizky\\LaravelTweak\\Tests\\DummyClass $dummy */\n $dummy = tap_if($condition, new DummyClass($value), function (DummyClass $dummy) use ($exponential) {\n $dummy->exponential($exponential);\n });\n\n $this->assertInstanceOf(DummyClass::class, $dummy);\n\n if ($condition) {\n return $this->assertEquals(pow($value, $exponential), $dummy->getValue());\n }\n\n $this->assertEquals($value, $dummy->getValue());\n }",
"function evaluate(){\t\t//This function will be placed in the second argument of the if statement to test short circuit evaluation\n\t\techo \"ARG 2 evaluated!!\\n\";\n\t\treturn true;\t\t//note that we are returning boolean value true\n\t}",
"protected function _execTest() {\n\n if ($this->_current_value == $this->_recommended_value) {\n return self::RESULT_OK;\n }\n\n return self::RESULT_NOTICE;\n }",
"public function apply(string $value, string $conditionValue): bool;",
"abstract public function assertTrue($condition, $message = '');",
"public static function conditional();",
"public function pass() { return $this->assertTrue(1 == 1); }",
"public function condition()\n {\n return is_string($this->value);\n }",
"public function evaluateCondition($value)\r\n {\r\n return is_object($value) ||\r\n !(is_null($value) || (is_string($value) && strlen($value) == 0));\r\n }",
"private function doCond($cond) {\n\t\t// if so, add them to the action queue and return status\n\n\t\t$match_cond = 0;\n\t\t//$debug = 1;\n\n\t\t// test if condition matches\n\t\tforeach ($cond['if'] as $if) {\n\t\t\t$match_tests = 1;\n\t\t\techo $debug ? \"testing $if: \" : \"\";\n\t\t\tforeach (explode(',', $if) as $test) {\n\n\t\t\t\tif ($test == '*') {\n\t\t\t\t\t$match_tests = 1;\n\n\t\t\t\t} elseif ($test == 'start') {\n\t\t\t\t\t$match_tests = ($this->state->getTurnNumber() === 0) ? 1 : 0;\n\n\t\t\t\t} else {\n\t\t\t\t\t$neg = 0;\n\t\t\t\t\tif (substr($test, 0, 1) == '!') {\n\t\t\t\t\t\t$neg = 1;\n\t\t\t\t\t\t$test = substr($test, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\t$words = explode(' ', $test);\n\n\t\t\t\t\t$testname = array_shift($words);\n\t\t\t\t\t$result = call_user_func_array(array($this, \"t_$testname\"), $words);\n\t\t\t\t\t$result = $neg ? ($result + 1) % 2 : $result;\n\t\t\t\t\techo $debug ? \"$result \" : \"\";\n\n\t\t\t\t\t$match_tests = $result ? $match_tests : 0; // AND\n\t\t\t\t}\n\n\t\t\t}\n\t\t\techo $debug ? \"= $match_tests\\n\" : \"\";\n\t\t\t$match_cond = $match_tests ? 1 : $match_cond; // OR\n\t\t}\n\n\t\treturn $match_cond ? $this->doThen($cond['then']) : 'ok';\n\t}",
"public function testIsTrueWithNoExpression()\n\t{\n\t\t$this->assertTrue($this->sut->isTrue());\n\t}",
"function testc($cond,$pargs=Array()) {\r\n$cond = $this->execLine($cond,$pargs);\r\n\r\n\r\n$operatorArray = Array(\r\n\"isin\" => \"isinfunc\",\r\n\"isincs\" => \"isincsfunc\",\r\n\"iswm\" => \"iswmfunc\",\r\n\"iswmcs\" => \"iswmcsfunc\",\r\n\"isnum\" => \"isnumfunc\",\r\n\"isletter\" => \"isletterfunc\",\r\n\"isalphanum\" => \"isalphanumfunc\",\r\n\"isalpha\" => \"isalphafunc\",\r\n\"islower\" => \"islowerfunc\",\r\n\"isupper\" => \"isupperfunc\",\r\n\r\n\"=\" => \"equalfunc\",\r\n\"==\" => \"equalfunc\",\r\n\"===\" => \"equalcsfunc\",\r\n\"!=\" => \"notequalfunc\",\r\n\"//\" => \"multiplefunc\",\r\n\"\\\\\\\\\" => \"notmultiplefunc\",\r\n\"&\" => \"bitwisefunc\",\r\n\">\" => \"graterthanfunc\",\r\n\"<\" => \"lessthanfunc\",\r\n\">=\" => \"graterthanequalfunc\",\r\n\"<=\" => \"lessthanequalfunc\");\r\n \r\n\r\n\r\n\t$t = explode(\" \",$cond);\r\n\tif (count($t)==1) {\r\n\t\tif ($t[0][0] == \"!\") { \r\n\t\t\t$n = true;\r\n\t\t\t$t[0] = $this->execScript(substr($t[0],1));\r\n\t\t} \r\n\t\t$this->_scope['defined']['v1'] = $cond;\r\n\t\t$this->_scope['defined']['ifmatch'] = $cond;\r\n\t\t\r\n\t\t$r = (($t[0] != \"\") && ($t[0] !== \"0\"));\r\n\t\tif ($n) { return !$r; }\r\n\t\telse { return $r; }\r\n\t}\r\n\t$func = null;\r\n\tfor ($i=0;$i<count($t);$i++) { \r\n\t\tif (array_key_exists($t[$i],$operatorArray)) { \r\n\t\t\t$func = $operatorArray[$t[$i]];\r\n\t\t\t$v1 = implode(\" \",array_slice($t,0,$i));\r\n\t\t\t$v2 = implode(\" \",array_slice($t,$i+1));\r\n\t\t\t\r\n\t\t\tif (method_exists($this,$func)) { \r\n\t\t\t\t$r = call_user_func_array(Array($this,$func),Array($v1,$v2));\r\n\t\t\t\t$this->_scope['defined']['v1'] = $v1;\r\n\t\t\t\t$this->_scope['defined']['v2'] = $v2;\r\n\t\t\t\t$this->_scope['defined']['ifmatch'] = ($r)?'$true':'$false';\r\n\t\t\t\treturn $r;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new Exception(\"IF_OPERATOR_NOT_IMPLIMENTED {$t[$i]}\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}",
"public function testMidConditionsMustBeTrue()\n {\n // exception when they are passed the value of TRUE\n $this->assertTrue(Contract::Asserts(true));\n $this->assertTrue(Contract::AssertsValue(0, true));\n\n // prove that the condition checks do throw an exception\n // when they are passed the value of FALSE\n $caughtException = false;\n try\n {\n Contract::Asserts(false);\n }\n catch (E5xx_ContractFailedException $e)\n {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n\n // repeat the test with another of the condition check\n // methods\n $caughtException = false;\n try\n {\n Contract::AssertsValue(10, false);\n }\n catch (E5xx_ContractFailedException $e)\n {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n }",
"public function getConditionEvaluation()\n {\n return $this->condition_evaluation;\n }",
"protected function _execTest() {\n if ($this->_current_value == $this->_recommended_value) {\n return self::RESULT_OK;\n }\n\n return self::RESULT_WARN;\n }",
"public function customCondition()\n {\n // no action\n }",
"private function conditional() {\n\t\treturn true;\n\t}",
"public function inTest() : bool\n {\n return $this->test == 1;\n }",
"function valid()\n {\n return !($c < 0 xor $this->evaluate() < 0);\n }",
"abstract protected function doCheck();",
"public function testAssertTapUnless()\n {\n $condition = rand(0, 1) === 1;\n\n $value = rand(0, 10);\n $exponential = rand(0, 10);\n\n /** @var \\Ianrizky\\LaravelTweak\\Tests\\DummyClass $dummy */\n $dummy = tap_unless($condition, new DummyClass($value), function (DummyClass $dummy) use ($exponential) {\n $dummy->exponential($exponential);\n });\n\n $this->assertInstanceOf(DummyClass::class, $dummy);\n\n if (!$condition) {\n return $this->assertEquals(pow($value, $exponential), $dummy->getValue());\n }\n\n $this->assertEquals($value, $dummy->getValue());\n }",
"public function evaluate();",
"public function getCondition();",
"public function testIco4()\n{\n\n // Traversed conditions\n // if ($mod === 0 || $mod === 10) == false (line 112)\n // if ($mod === 1) == true (line 114)\n\n $actual = $this->company->ico();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testIco1()\n{\n\n // Traversed conditions\n // if ($mod === 0 || $mod === 10) == false (line 112)\n // if ($mod === 1) == true (line 114)\n\n $actual = $this->company->ico();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testIco5()\n{\n\n // Traversed conditions\n // if ($mod === 0 || $mod === 10) == true (line 112)\n\n $actual = $this->company->ico();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testCheck_capabilities3()\n{\n\n // Traversed conditions\n // if (!empty($this->capability) && !\\current_user_can($this->capability)) == false (line 350)\n // if (!$setting || !$setting->check_capabilities()) == false (line 355)\n // if (isset($section) && !$section->check_capabilities()) == true (line 361)\n\n $actual = $this->wP_Customize_Control->check_capabilities();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}"
] | [
"0.67265725",
"0.6574326",
"0.6365345",
"0.63393307",
"0.61204123",
"0.6063995",
"0.59595925",
"0.59487325",
"0.5897895",
"0.5890011",
"0.5877367",
"0.58679605",
"0.58357465",
"0.57964146",
"0.579567",
"0.5795293",
"0.57888514",
"0.57560444",
"0.57442373",
"0.57179636",
"0.5712684",
"0.5712013",
"0.5690881",
"0.5665624",
"0.56381464",
"0.5600845",
"0.5587624",
"0.55826294",
"0.55668664",
"0.5539996"
] | 0.68217325 | 0 |
Fonction revision_grappe Permet notamment de crayonner les grappes | function revision_grappe($id_grappe, $c=false) {
modifier_contenu('grappe', $id_grappe,
array(
'champs' => array('titre', 'descriptif', 'liaisons','options'),
'nonvide' => array('titre' => _T('info_sans_titre'))
),
$c);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function Imprime_lista_revision()\n\t{\n\t\t$id_nota_de_ingreso_productos = $this -> input -> get('id_nota_de_ingreso_productos');\n\t\t$data['nota_de_ingreso'] = $this -> Modelo_ingreso_productos -> Recupera_nota($id_nota_de_ingreso_productos);\n\t\t$data['productos_de_la_nota'] = $this -> Modelo_ingreso_productos -> Busca_productos_de_la_nota($id_nota_de_ingreso_productos);\n\t\t$this -> load -> view('nota_ingreso/revision',$data);\n\t}",
"function gog_rc($rapport)\r\n{\r\n global $db, $table_prefix, $user_data, $config;\r\n $xtense_version=\"2.3.0\";\r\n //$raw = stripslashes($rapport[\"content\"]);\r\n //$raw = str_replace(\"\\'\",\"'\",$raw);\r\n //Compatibilité UNIX/Windows\r\n //$raw = str_replace(\"\\r\\n\",\"\\n\",$raw);\r\n //$raw = str_replace(\" \\n\",\"\\n\",$raw);\r\n //Compatibilité IE/Firefox\r\n //$raw = str_replace(\"\\t\",' ',$raw);\r\n // Mise en forme du rapport, nettoyage des codes html et autres \r\n //$rapport = remo_htm($raw);\r\n /*$handle=fopen(\"gog.txt\",\"w\");\r\n fwrite($handle,$raw);\r\n fwrite($handle,\"--------\\n\");\r\n\tfwrite($handle,$rapport);\r\n //fwrite($handle,\"\\r\\n\");\r\n //fwrite($handle,$config[defenseur]);\r\n //fwrite($handle,\"\\r\\n\"); */\r\n \r\n//\tforeach($rapport['n'] as $n){\r\n//\t\tif ($n['type'] == \"A\"){\r\n//\t\t\t$query = $db->sql_query(\"SELECT count(planet_id) FROM \".TABLE_USER_BUILDING.\" WHERE user_id = '\".$user_data['user_id'].\"' AND coordinates = '\".$n['coords'].\"'\");\r\n//\t\t\tlist($check) = $db->sql_fetch_row($query);\r\n//\t\t\tif($check != 0){\r\n//\t\t\t\t$attaquant = $n['player'];\r\n//\t\t\t\t$coord_att = $n['coords'];\r\n//\t\t\t\tbreak;\r\n//\t\t\t}\r\n//\t\t}\r\n//\t}\r\n//\t\r\n//\tforeach($rapport['n'] as $n){\r\n//\t\tif ($n['type'] == \"D\"){\r\n//\t\t\t$defenseur = $n['player'];\r\n//\t\t\t$coord_def = $n['coords'];\r\n//\t\t\tbreak;\r\n//\t\t}\r\n//\t}\r\n //Definition des tables de gOg\r\n define('TABLE_GAME',$table_prefix.'game');\r\n //récupération des paramètres de config\r\n\t$query = \"SELECT value FROM `\".TABLE_MOD_CFG.\"` WHERE `mod`='gameOgame' and `config`='config'\";\r\n\t$result = $db->sql_query($query);\r\n\t$config = mysql_fetch_row($result);\r\n\t$gog_config = unserialize($config[0]);\r\n\t\r\n // Vérifie que c'est bien un RC valide\r\n if (!$rapport['date'])\r\n {\r\n echo 'Rapport de combat invalide';\r\n return FALSE;\r\n }\r\n else\r\n {\r\n //récupère le pseudo de l'attaquant\r\n $attaquant = $rapport['n']['0']['player'];\r\n //preg_match('#Attaquant\\s(.{3,50})\\s\\(#',$rapport,$attaquant);\r\n //récupère les coordonnées de l'attaquant\r\n $coord_att = $rapport['n']['0']['coords'];\r\n //preg_match('#Attaquant\\s.{3,110}\\[(.{5,8})]#',$rapport,$coord_att);\r\n //On regarde dans les coordonnées de l'espace personnel du joueur qui insère les données via le plugin si les coordonnées de l'attaquant correspondent à une de ses planètes\r\n \t$query = \"SELECT coordinates FROM \".TABLE_USER_BUILDING.\" WHERE user_id='\".$user_data['user_id'].\"'\";\r\n \t$result = $db->sql_query($query);\r\n\t\t$attaqu = 0;\r\n \twhile(list($coordinates) = mysql_fetch_row($result))\r\n\t\t{\r\n\t\t\tif($coordinates == $coord_att) $attaqu = 1;\r\n\t\t}\r\n \tif ($attaqu == 0)\r\n \t{\r\n \t\t// Vous n'êtes pas l'attaquant, je sors !!\r\n \t\treturn FALSE;\r\n \t} \r\n \t//récupère le pseudo du défenseur\r\n \t$defenseur = $rapport['n']['1']['player'];\r\n //preg_match('#Défenseur\\s(.{3,50})\\s\\(#',$rapport,$defenseur);\r\n //récupère les coordonnées du défenseur\r\n $coord_def = $rapport['n']['1']['coords'];\r\n //preg_match('#Défenseur\\s.{3,110}\\[(.{5,8})]#',$rapport,$coord_def);\r\n // Récupère les pertes de l'attaquant et du défenseur\r\n $pertesA = $rapport['result']['a_lost'];\r\n $pertesD = $rapport['result']['d_lost'];\r\n //preg_match('#attaquant\\sa\\sperdu\\sau\\stotal\\s(\\d*)\\sunités#',$rapport,$pertesA);\r\n //preg_match('#Le\\sdéfenseur\\sa\\sperdu\\sau\\stotal\\s(\\d*)\\sunités#',$rapport,$pertesD);\r\n //preg_match('#(\\d*)\\sunités\\sde\\smétal,\\s(\\d*)\\sunités\\sde\\scristal\\set\\s(\\d*)\\sunités\\sde\\sdeutérium#',$rapport,$ressources);\r\n \t$ressources=Array(0,0,0,0);\r\n if ($rapport['win'] == 'A') {\r\n\t\t\t$winmetal=isset($rapport['result']['win_metal']) ? $rapport['result']['win_metal'] : 0;\r\n\t\t\t$wincristal=isset($rapport['result']['win_cristal']) ? $rapport['result']['win_cristal'] : 0;\r\n\t\t\t$windeut=isset($rapport['result']['win_deut']) ? $rapport['result']['win_deut'] : 0;\r\n\t\t\t$ressources=Array(0,$winmetal,$wincristal,$windeut);\r\n\t\t}\r\n\r\n //if (!preg_match('#(\\d*)\\sunités\\sde\\smétal,\\s(\\d*)\\sunités\\sde\\scristal\\set\\s(\\d*)\\sunités\\sde\\sdeutérium#',$rapport,$ressources)) $ressources=Array(0,0,0,0);\r\n // Debris\r\n $debmetal=isset($rapport['result']['deb_metal']) ? $rapport['result']['deb_metal'] : 0;\r\n $debcristal=isset($rapport['result']['deb_cristal']) ? $rapport['result']['deb_cristal'] : 0;\r\n $recyclage = Array(0,$debmetal,$debcristal);\r\n //if (!preg_match('#Un\\schamp\\sde\\sdébris\\scontenant\\s(\\d*)\\sunités\\sde\\smétal\\set\\s(\\d*)\\sunités\\sde\\scristal\\sse\\sforme\\sdans\\sl\\'orbite\\sde\\scette\\splanète#',$rapport,$recyclage)) $recyclage[1]=$recyclage[2]=0;\r\n // Probabilite de lune\r\n $plune[1] = isset($rapport['moonprob']) ? $rapport['moonprob'] : 0;\r\n $lune = isset($rapport['moon']) ? $rapport['moon'] : 0;\r\n // calcul la date et l'heure du rapport\r\n $date = $rapport['date'];//mktime($date[3],$date[4],$date[5],$date[1],$date[2],date('Y'));\r\n //Calcul des points en fonction des coeficients\r\n $points = ceil(($ressources[1]+$ressources[2]+$ressources[3])/100000*$gog_config['pillage'] + $pertesA/100000*$gog_config['pertes'] + $pertesD/100000*$gog_config['degats'] + $lune*$gog_config['clune']);\r\n //On vérifie que cette attaque n'a pas déja été enregistrée\r\n $query = \"SELECT id FROM \".TABLE_GAME.\" WHERE sender='\".$user_data['user_id'].\"' AND date='\".$date.\"' AND attaquant='\".$attaquant.\"' \";\r\n $result = $db->sql_query($query);\r\n $nb = mysql_num_rows($result);\r\n // Si le RC existe déjà on sort\r\n if ($nb != 0) return FALSE;\r\n //Insert dans la base de données\r\n $query = 'INSERT INTO '.TABLE_GAME.' (id,sender,date,attaquant,coord_att,defenseur,coord_def,pertesA,pertesD,lune,`%lune`,pillageM,pillageC,pillageD,recyclageM,recyclageC,recycleM,recycleC,points,rawdata) VALUES (\\'\\',\\''.$user_data['user_id'].'\\',\\''.$date.'\\',\\''.mysql_real_escape_string($attaquant).'\\',\\''.mysql_real_escape_string($coord_att).'\\',\\''.mysql_real_escape_string($defenseur).'\\',\\''.mysql_real_escape_string($coord_def).'\\',\\''.$pertesA.'\\',\\''.$pertesD.'\\',\\''.$lune.'\\',\\''.$plune[1].'\\',\\''.$ressources[1].'\\',\\''.$ressources[2].'\\',\\''.$ressources[3].'\\',\\''.$recyclage[1].'\\',\\''.$recyclage[2].'\\',\\'0\\',\\'0\\',\\''.$points.'\\',\\''.mysql_real_escape_string($rapport['rawdata']).'\\')';//'.mysql_real_escape_string($rapport).'\r\n $db->sql_query($query);\r\n \r\n \r\n /////////////////////////////////////////////\r\n // Test enregistrement des rounds du combats\r\n /////////////////////////////////////////////\r\n// \t\t$exist = $db->sql_fetch_row($db->sql_query(\"SELECT id_rc FROM \".TABLE_GAME_PARSEDRC.\" WHERE dateRC = '\".$pub_date.\"'\"));\r\n//\t\t\tif(!$exist[0]){\r\n//\t\t\t\t$db->sql_query(\"INSERT INTO \".TABLE_GAME_PARSEDRC.\" (\r\n//\t\t\t\t\t\t`dateRC`, `nb_rounds`, `victoire`, `pertes_A`, `pertes_D`, `gain_M`, `gain_C`, `gain_D`, `debris_M`, `debris_C`, `lune`\r\n//\t\t\t\t\t) VALUES (\r\n//\t\t\t\t\t '{$rapport['date']}', '{$rapport['count']}', '{$rapport['win']}', '\".$rapport['result']['a_lost'].\"', '\".$rapport['result']['d_lost'].\"', '\".$rapport['result']['win_metal'].\"', '\".$rapport['result']['win_cristal'].\"', '\".$rapport['result']['win_deut'].\"', '\".$rapport['result']['deb_metal'].\"', '\".$rapport['result']['deb_cristal'].\"', '{$rapport['moon']}'\r\n//\t\t\t\t\t)\"\r\n//\t\t\t\t);\r\n//\t\t\t\t$id_rc = $db->sql_insertid();\r\n//\t\t\t\t\r\n//\t\t\t\tforeach($rapport['rounds'] as $i => $round){\r\n//\t\t\t\t\t$db->sql_query(\"INSERT INTO \".TABLE_GAME_PARSEDRCROUND.\" (\r\n//\t\t\t\t\t\t\t`id_rc`, `numround`, `attaque_tir`, `attaque_puissance`, `defense_bouclier`, `attaque_bouclier`, `defense_tir`, `defense_puissance`\r\n//\t\t\t\t\t\t) VALUE (\r\n//\t\t\t\t\t\t\t'{$id_rc}', '{$i}', '\".$round['a_nb'].\"', '\".$round['a_shoot'].\"', '\".$round['d_bcl'].\"', '\".$round['a_bcl'].\"', '\".$round['d_nb'].\"', '\".$round['d_shoot'].\"'\r\n//\t\t\t\t\t\t)\"\r\n//\t\t\t\t\t);\r\n//\t\t\t\t\t$id_rcround[$i] = $db->sql_insertid();\r\n//\t\t\t\t}\r\n//\t\t\t\t\r\n//\t\t\t\tforeach ($rapport['n'] as $i => $n){\r\n//\t\t\t\t\t$fields = '';\r\n//\t\t\t\t\t$values = '';\r\n//\t\t\t\t\t$j = 1;\r\n//\t\t\t\t\t\r\n//\t\t\t\t\tforeach ($n['content'] as $field => $value){\r\n//\t\t\t\t\t\t$fields .= \", `{$field}`\";\r\n//\t\t\t\t\t\t$values .= \", '{$value}'\";\r\n//\t\t\t\t\t}\r\n//\t\t\t\t\t\r\n//\t\t\t\t\t$db->sql_query(\"INSERT INTO \".(($n['type'] == \"D\") ? TABLE_GAME_ROUND_DEFENSE : TABLE_GAME_ROUND_ATTACK).\" (\r\n//\t\t\t\t\t\t\t`id_rcround`, `player`, `coordinates`, `Armes`, `Bouclier`, `Protection`\".$fields.\"\r\n//\t\t\t\t\t\t) VALUE (\r\n//\t\t\t\t\t\t\t'\".$id_rcround[$j].\"', '\".$n['player'].\"', '\".$n['coords'].\"', '\".$n['weapons']['arm'].\"', '\".$n['weapons']['bcl'].\"', '\".$n['weapons']['coq'].\"'\".$values.\"\r\n//\t\t\t\t\t\t)\"\r\n//\t\t\t\t\t);\r\n//\t\t\t\t\t\r\n//\t\t\t\t\tif($n['type'] == \"D\"){\r\n//\t\t\t\t\t\tif(!isset($update))\r\n//\t\t\t\t\t\t\t$update = $db->sql_query(\"UPDATE \".TABLE_GAME_PARSEDRC.\" SET coordinates = '\".$n['coords'].\"' WHERE id_rc = '{$id_rc}'\");\r\n//\t\t\t\t\t\t$j++;\r\n//\t\t\t\t\t}\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n }\r\n return TRUE;\r\n}",
"function produits_vendus_post_edition($flux){\n \n \n // Apres COMMANDE :\n // quand la commande passe du statut=attente a statut=paye\n if (\n $flux['args']['action'] == 'instituer'\n AND $flux['args']['table'] == 'spip_commandes'\n AND ($id_commande = intval($flux['args']['id_objet'])) > 0\n AND ($statut_nouveau = $flux['data']['statut']) == 'paye'\n AND ($statut_ancien = $flux['args']['statut_ancien']) == 'attente'\n ){\n // Informations concernant la commande\n $id_auteur= sql_getfetsel('id_auteur', 'spip_commandes', 'id_commande='.intval($id_commande));\n \n // retrouver les objets correspondants a la commande dans spip_commandes_details\n if (\n $objets = sql_allfetsel('objet,id_objet', 'spip_commandes_details', 'id_commande='.intval($id_commande))\n AND is_array($objets)\n AND count($objets)\n ){\n \n include_spip('action/editer_objet');\n \n foreach($objets as $v) {\n // Si un objet produit\n // fait partit des details la commande\n if($v['objet']=='produit'){\n \n $objet = $v['objet'];\n $id_objet = intval($v['id_objet']);\n \n \n \n objet_modifier($objet, $id_objet, array('statut'=>'vendu'));\n spip_log(' Objet: '.$objet.' ('.$id_objet.') - Commande : '.$id_commande,'produits');\n\n } \n }\n }\n }\n \n return $flux;\n}",
"public function Ingresa_revision()\n\t{\n\t\t$id_producto_venta = $this -> input -> post('id_producto_venta');\n\t\t$data=array(\n\t\t'no_de_lote' => trim($this -> input -> post('no_de_lote')),\n\t\t'registro_sanitario' => trim($this -> input -> post('registro_sanitario')),\n\t\t\n\t\t'fecha_de_vencimiento' => trim($this -> input -> post('fecha_de_vencimiento')),\n\t\t'fecha_de_revision' => date(\"Y-m-d\"),\n\t\t\n\t\t'unidades_optimas' => $this -> input -> post('unidades_optimas'),\n\t\t'unidades_defectuosas' => trim($this -> input -> post('unidades_defectuosas')),\n\t\t'cantidad_a_la_venta' =>$this -> input -> post('unidades_optimas'),\n\t\t\n\t\t'precio_instituciones' => $this -> input -> post('precio_instituciones'),\n\t\t'precio_distribuidora' => $this -> input -> post('precio_distribuidora'),\n\t\t'precio_farmacia' => $this -> input -> post('precio_farmacia'),\n\t\t'revisado_por' => $this->session->userdata('id_usuario'),\n\t\t'estado' => \"EN INVENTARIO\"\n\t\t\n\t\t);\n\t\t$ingresa_revision_producto = $this -> Modelo_ingreso_productos -> Ingresa_revision_producto($id_producto_venta,$data);\n\t\t\n\t\t\n\t\t//-> ENVIA A NOTA DE INGRESO\n\t\t$id_nota_de_ingreso_productos = $this -> input ->post('id_nota_de_ingreso_productos');\n\t\t$data['recupera_nota'] = $this -> Modelo_ingreso_productos -> Recupera_nota($id_nota_de_ingreso_productos);\n\t\t$data['titulo'] = \"INGRESO DE PRODUCTOS DE LA NOTA\";\t\t\n\t\t$this -> load -> view('header',$data);\n\t\t$this -> load -> view('nota_ingreso/producto/nuevo',$data);\n\t\t$this -> load ->view($this->session->userdata('tipo_de_usuario'));\n\t\t//-> FIN NOTA DE INGRESO\n\t\n\t}",
"function vignette_revision($id, $data, $type, $ref) {\n\tif (!$s = sql_fetsel('id_document,id_vignette', 'spip_documents', 'id_document = '.intval($id))) {\n\t\treturn false;\n\t}\n\n\tinclude_spip('inc/modifier');\n\tinclude_spip('inc/documents');\n\tinclude_spip('action/editer_document');//pour revision_document\n\t// Chargement d'un nouveau doc ?\n\tif ($data['vignette']) {\n\t\tdefine('FILE_UPLOAD', true);\n\t\tif (is_numeric($s['id_vignette']) and ($s['id_vignette'] > 0)) {\n\t\t\tspip_log('suppression de la vignette');\n\t\t\t// Suppression du document\n\t\t\t$vignette = sql_getfetsel('fichier', 'spip_documents', 'id_document='.intval($s['id_vignette']));\n\t\t\tif (@file_exists($f = get_spip_doc($vignette))) {\n\t\t\t\tspip_log(\"efface $f\");\n\t\t\t\tsupprimer_fichier($f);\n\t\t\t}\n\t\t\tsql_delete('spip_documents', 'id_document='.intval($s['id_vignette']));\n\t\t\tsql_delete('spip_documents_liens', 'id_document='.intval($s['id_vignette']));\n\n\t\t\tpipeline(\n\t\t\t\t'post_edition',\n\t\t\t\tarray(\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'operation' => 'supprimer_document',\n\t\t\t\t\t\t'table' => 'spip_documents',\n\t\t\t\t\t\t'id_objet' => $s['id_vignette']\n\t\t\t\t\t),\n\t\t\t\t\t'data' => null\n\t\t\t\t)\n\t\t\t);\n\t\t\t$id_vignette = 0;\n\t\t}\n\n\t\t$arg = $data['vignette'];\n\t\tcheck_upload_error($arg['error']);\n\n\t\t// Ajout du document comme vignette\n\t\t$ajouter_documents = charger_fonction('ajouter_documents', 'action');\n\t\t$x = $ajouter_documents(null,array($arg),'', 0, 'vignette');\n\t\t$vignette = reset($x);\n\t\tif (intval($vignette)) {\n\t\t\tdocument_modifier($id, array('id_vignette'=>$vignette));\n\t\t} elseif ($id_vignette) {\n\t\t\tdocument_modifier($id, array('id_vignette'=>$id_vignette));\n\t\t}\n\t} elseif ($wid = array_pop($ref)\n\t\tand $_POST['content_'.$wid.'_vignette_supprimer'] == 'on') {\n\t\tif (is_numeric($s['id_vignette']) and ($s['id_vignette']>0)) {\n\t\t\t// Suppression du document\n\t\t\t$vignette = sql_getfetsel('fichier', 'spip_documents', 'id_document='.intval($s['id_vignette']));\n\t\t\tif (@file_exists($f = get_spip_doc($vignette))) {\n\t\t\t\tspip_log(\"efface $f\");\n\t\t\t\tsupprimer_fichier($f);\n\t\t\t}\n\t\t\tsql_delete('spip_documents', 'id_document='.intval($s['id_vignette']));\n\t\t\tsql_delete('spip_documents_liens', 'id_document = ' . intval($s['id_vignette']));\n\n\t\t\tpipeline(\n\t\t\t\t'post_edition',\n\t\t\t\tarray(\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'operation' => 'supprimer_document',\n\t\t\t\t\t\t'table' => 'spip_documents',\n\t\t\t\t\t\t'id_objet' => $s['id_vignette']\n\t\t\t\t\t),\n\t\t\t\t\t'data' => null\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// On remet l'id_vignette a 0\n\t\t\tdocument_modifier($s['id_document'], array('id_vignette'=>0));\n\t\t}\n\t}\n\treturn true;\n}",
"public function enableRevisioning();",
"function logo_revision($id, $file, $type, $ref) {\n\t$chercher_logo = charger_fonction('chercher_logo', 'inc');\n\t$_id_objet = id_table_objet($type);\n\n\t// Chargement d'un nouveau logo ?\n\tif ($file['logo']) {\n\t\tdefine('FILE_UPLOAD', true); // message pour crayons_json_export :(\n\n\t\tinclude_spip('action/editer_logo');\n\t\tlogo_modifier($type, $id, 'on', $file['logo']);\n\t} else {\n\t\t// Suppression du logo ?\n\t\tif ($wid = array_pop($ref)\n\t\t\tand $_POST['content_'.$wid.'_logo_supprimer'] == 'on') {\n\t\t\tinclude_spip('action/editer_logo');\n\t\t\tlogo_supprimer($type, $id, 'on');\n\t\t}\n\t}\n\n\t// Reduire le logo ?\n\tif (is_array($cfg = @unserialize($GLOBALS['meta']['crayons']))\n\t\tand $max = intval($cfg['reduire_logo'])) {\n\t\t$on = $chercher_logo($id, $_id_objet, 'on');\n\t\tinclude_spip('inc/filtres');\n\t\t@copy($on[0], $temp = _DIR_VAR . 'tmp' . rand(0, 999) . '.' . $on[3]);\n\t\t$img1 = filtrer('image_reduire', $temp, $max);\n\t\t$img2 = preg_replace(',[?].*,', '', extraire_attribut($img1, 'src'));\n\t\tif (@file_exists($img2)\n\t\t\tand $img2 != $temp) {\n\t\t\tinclude_spip('action/editer_logo');\n\t\t\tlogo_modifier($type, $id, 'on', $img2);\n\t\t}\n\t\t@unlink($temp);\n\t}\n\n\treturn true;\n}",
"private function _drawRepertoire() {\n\t\t//on fragmente notre information dans le tableau $urlParts (séparateur '/')\n\t\t$urlParts = explode('/', $this->_url);\n\n\t\t//shéma des url\n\t\t$urlParts[$this->_indicePage] = '[xx]';\n\t\t$shemaUrl = implode('/', $urlParts);\n\n\t\t//Affichage\n\t\treturn $this->_affichage($shemaUrl);\n\t}",
"function zotspip_porte_plume_barre_pre_charger($barres) {\n $barre = &$barres['edition'];\n\n $barre->ajouterApres('notes', array(\n \"id\" => 'inserer_ref',\n \"name\" => _T('zotspip:outil_inserer_ref'),\n \"className\" => 'outil_inserer_ref',\n \"selectionType\" => '',\n \"closeWith\" => \"[ref=[![\" . _T('zotspip:outil_explication_inserer_ref') . ' ' . _T('zotspip:outil_explication_inserer_ref_exemple') . \"]!]]\",\n \"display\" => true\n ));\n\n return $barres;\n}",
"Public function afficher_rendu()\n\t\t{\n if(file_exists(Entrer::$rep_modules.$this->var_page.\".page.php\"))\n\t\t\t{\n\t\t\t\t//on insere les elements dynamique de la sous-page\n //en creant a la volé les variables \n\t\t\t\tif(!empty($this->var_contenu) && is_array($this->var_contenu))\n\t\t\t\t{\n\t\t\t\t\tforeach($this->var_contenu as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t${$k} = $v;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n \n\t\t\t\t}\n\n //on insere les elements dynamique de la sous-page\n //en creant a la volé les variables\n\t\t\t\tif(!empty(self::$supplement) && is_array(self::$supplement))\n\t\t\t\t{\n\t\t\t\t\tforeach(self::$supplement as $k => $v)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t${$k} .= $v.\"<br/>\";\n \n\t\t\t\t\t}\n \n\n\t\t\t\t}\n \n //on insere les elements script de la sous-page\n //en creant a la volé les variables\n\t\t\t\tif(!empty(self::$script) && is_array(self::$script))\n\t\t\t\t{\n\t\t\t\t\tforeach(self::$script as $k => $v)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$javascriptPhp .= \"<script type='text/javascript' src='\".$v.\"'></script>\\n\";\n \n\t\t\t\t\t}\n \n\n\t\t\t\t}\n \n\n //on indique le fichier de la page pour le contenu\n\t\t\t\t$conteneur = Entrer::$rep_modules.$this->var_page.\".page.php\";\n\t\t\t\t\t\t\t\n\t\t\t\t//on insert le titre de la page\n\t\t\t\t$titre = $this->var_titre;\n\t\t\t\t\n\t\t\t\n\t\t\t\t//on affiche les css\n\t\t\t\t\n\t\t\t\tif(!empty($this->var_css) && !is_array($this->var_css) && isset($this->var_css))\n\t\t\t\t{\n\t\t\t\t\t$css .= \"<link rel='stylesheet' type='text/css' href='\".REP_CSS.$this->var_css.\"' />\";\t\n\t\t\t\t}\n\t\t\t\telseif(is_array($this->var_css))\n\t\t\t\t{\n\t\t\t\t\tforeach($this->var_css as $k => $v )\n\t\t\t\t\t{\n\t\t\t\t\t\t$css .= \"<link rel='stylesheet' type='text/css' href='\".REP_CSS.\"$v' />\";\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n if(is_array(self::$style))\n\t\t\t\t{\n\t\t\t\t\tforeach(self::$style as $k => $v )\n\t\t\t\t\t{\n\t\t\t\t\t\t$style_css .= $v.\" \";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n \n\t\t\t\tif(is_array(self::$css))\n\t\t\t\t{\n\t\t\t\t\tforeach(self::$css as $k => $v )\n\t\t\t\t\t{\n\t\t\t\t\t\t$css .= \"<link rel='stylesheet' type='text/css' href='\".$v.\"' />\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n /*if(is_array(Entrer::$erreur))\n {\n \tforeach(Entrer::$erreur as $k => $v )\n\t\t\t\t\t{\n\t\t\t\t\t\t$erreur_framework .= \"<strong style='color:red;'>$v</strong><br/>\";\n\t\t\t\t\t}\n\n }*/\n\n\t\t\t\t//on integre le menu\n\t\t\t\t$menu = $this->var_menu;\n\n \n\t\t\t\t//on affectue le rendu de la page\n \n \n\t\t\t\tinclude_once(REP_DESIGN.DESIGN.\".php\");\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t}\n else\n {\n\n Erreur::declarer_dev(4, \"Page = \".Entrer::$rep_modules.$this->var_page.\".page.php objet : Afficher ; args : var_page\");\n \n\n }\n\t\t}",
"public function revisionOverview() {\n $entityTypeId = $this->entityTypeId;\n $entity = $this->currentRoute->getParameter($entityTypeId);\n $account = $this->currentUser();\n $langcode = $entity->language()->getId();\n $langname = $entity->language()->getName();\n $languages = $entity->getTranslationLanguages();\n $hasTranslations = (count($languages) > 1);\n /* @var \\Drupal\\custom_entity_tools\\EntityBaseStorage $entityStorage */\n $entityStorage = $this->entityTypeManager()->getStorage($this->entityTypeId);\n\n $build['#title'] = $hasTranslations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $entity->label()]) : $this->t('Revisions for %title', ['%title' => $entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n $revertPermission = (($account->hasPermission(\"revert $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n $deletePermission = (($account->hasPermission(\"delete $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n\n $rows = [];\n\n $vids = $entityStorage->revisionIds($entity);\n\n $latestRevision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\custom_entity_tools\\Entity\\EntityBaseInterface $revision */\n $revision = $entityStorage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = \\Drupal::service('date.formatter')->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $entity->getRevisionId()) {\n $link = $this->l($date, new Url(\"entity.$entityTypeId.revision\", [$entityTypeId => $entity->id(), 'revision' => $vid]));\n }\n else {\n $link = $entity->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => \\Drupal::service('renderer')->renderPlain($username),\n 'message' => ['#markup' => $revision->getRevisionLogMessage(), '#allowed_tags' => Xss::getHtmlTagList()],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latestRevision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latestRevision = FALSE;\n }\n else {\n $links = [];\n if ($revertPermission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_revert_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n if ($deletePermission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_delete_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }",
"function cambiarRevisionCat(){\n $this->procedimiento='conta.ft_comisionistas_ime';\n $this->transaccion='CONTA_RECA_IME';\n $this->tipo_procedimiento='IME';\n\n //Define los parametros para la funcion\n $this->setParametro('id_comisionista_rev','id_comisionista_rev','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"function actualites_editer_contenu_objet($flux){\r\n\t// Concernant le formulaire CVT 'editer_groupe_mot', on veut faire apparaitre les nouveaux objets\r\n\tif ($flux['args']['type']=='groupe_mot') {\r\n\t\t// Si le formulaire concerne les groupes de mots-cles, alors recupere le resultat\r\n\t\t// de la compilation du squelette 'inc-groupe-mot-actualites.html' qui contient les lignes\r\n\t\t// a ajouter au formulaire CVT,\r\n\t\t$actualites_gp_objets = recuperer_fond('formulaires/inc-groupe-mot-actualites', $flux['args']['contexte']);\r\n\t\t// que l'on insere ensuite a l'endroit approprie, a savoir avant le texte <!--choix_tables--> du formulaire\r\n\t\t$flux['data'] = preg_replace('%(<!--choix_tables-->)%is', $actualites_gp_objets.\"\\n\".'$1', $flux['data']);\r\n\t}\r\n\treturn $flux;\r\n}",
"function souhaits_post_edition($flux){\n\t// Si on est bien dans l'institution d'un souhait\n\tif ($flux['args']['action'] == 'instituer' and $flux['args']['table'] == 'spip_souhaits'){\n\t\t// Liste des statuts considérés comme publiés\n\t\t$statuts_publies = array('libre', 'cagnotte', 'propose', 'achete');\n\t\t\n\t\t// On calcule si l'ancien statut est considéré comme publié ou pas\n\t\t$statut_ancien = in_array($flux['args']['statut_ancien'], $statuts_publies) ? 'publie' : 'new';\n\t\t\n\t\t// S'il y a changements de statut\n\t\t$champs = $flux['data'];\n\t\tif (isset($champs['statut'])){\n\t\t\t// Si un admin a repassé manuellement un souhait en libre ou cagnotte, on vide les propositions\n\t\t\tif (in_array($champs['statut'], array('libre', 'cagnotte')) and $champs['statut'] != $flux['args']['statut_ancien']){\n\t\t\t\tinclude_spip('action/editer_objet');\n\t\t\t\tobjet_modifier('souhait', $flux['args']['id_objet'], array('propositions'=>''));\n\t\t\t}\n\t\t\t\n\t\t\t// On calcule si le nouveau statut est considéré comme publié ou pas pour une rubrique\n\t\t\t$champs['statut'] = in_array($champs['statut'], $statuts_publies) ? 'publie' : 'new';\n\t\t\t\n\t\t\t// Si les statuts sont les mêmes on ne fait rien\n\t\t\tif ($statut_ancien == $champs['statut']){\n\t\t\t\tunset($champs['statut']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// On modifie le statut des rubriques parentes\n\t\tinclude_spip('inc/rubriques');\n\t\tcalculer_rubriques_if($flux['args']['id_parent_ancien'], $champs, $statut_ancien, false);\n\t}\n\t\n\treturn $flux;\n}",
"function genguiaremi() {\n if (count($_REQUEST) == 6) {\n $this->view->show('/facturacion/generacionguiaremision.phtml');\n } else {\n $documento = new Documento();\n $ordenVenta = new OrdenVenta();\n $dataGuiaRemision = $_REQUEST['GuiaRemision'];\n $dataGuiaRemision['nombredoc'] = 4;\n $modelpdf = $this->AutoLoadModel('pdf');\n $exitofactura = $modelpdf->listaGuiasEmitidasNoAnuladas($dataGuiaRemision['idordenventa']);\n if (count($exitofactura) == 0) {\n //si usamos esto debemos grabar en la orden de venta\n //$dataOrdenVenta['guiaremision']=1;\n $idordenventa = $dataGuiaRemision['idordenventa'];\n $dataOrdenVenta = $_REQUEST['ordenVenta'];\n $dataOrdenVenta['guiaremision'] = 1;\n $exito = $ordenVenta->actualizaOrdenVenta($dataOrdenVenta, $idordenventa);\n if ($exito) {\n $id = $documento->grabaDocumento($dataGuiaRemision);\n $movimiento = new Movimiento();\n $filtro = \" idtipooperacion='1' and idordenventa='\" . $idordenventa . \"'\";\n $dataMovimiento = $movimiento->buscaMovimientoxfiltro($filtro);\n if (!empty($dataMovimiento) and $dataMovimiento[0]['iddocumentotipo'] != 1 and $dataMovimiento[0]['iddocumentotipo'] != 2) {\n $dataM['iddocumentotipo'] = 4;\n $dataM['serie'] = $dataGuiaRemision['serie'];\n $dataM['ndocumento'] = $dataGuiaRemision['numdoc'];\n $dataM['essunat'] = 1;\n\n $exito = $movimiento->actualizaMovimiento($dataM, $filtro);\n }\n $this->view->show('/facturacion/generacionguiaremision.phtml');\n }\n } else {\n $this->view->show('/facturacion/generacionguiaremision.phtml');\n }\n }\n }",
"function pdf_version_boite_infos($flux) {\r\n\tif ($objet = $flux['args']['type']\r\n\t and $id_objet = $flux['args']['id']) {\r\n\t\tif (trouver_fond('pdf_version/'.$objet)\r\n\t\t and objet_test_si_publie($objet, $id_objet)) {\r\n\t\t\tif (autoriser('voirpdfversion', $objet, $id_objet)){\r\n\t\t\t\tinclude_spip('inc/presentation');\r\n\t\t\t\t$url = generer_url_pdf_version($id_objet, $objet);\r\n\t\t\t\t$url = parametre_url($url, 'var_mode', 'recalcul'); // forcer la mise a jour\r\n\t\t\t\t$flux['data'] .= icone_horizontale(_T('pdf_version:icone_voir_pdf_version'), $url, 'pdf_version', $fonction=\"\", $dummy=\"\", $javascript=\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn $flux;\r\n}",
"function exec_veille_tous_dist(){\n\n\t// -- Si pas autorise : message d'erreur\n\tif (!autoriser('voir', 'veille_tous')) {\n\t\tinclude_spip('inc/minipres');\n\t\techo minipres();\n\t\texit;\n\t}\n\n\n\tpipeline('exec_init', array('args'=>array('exec'=>'veille_tous'),'data'=>'')); \t// pipeline d'initialisation\n\t$commencer_page = charger_fonction('commencer_page', 'inc'); \t\t\t// entetes de la page\n\techo $commencer_page(_T('vu:html_title'), \"editer\", \"editer\");\t\t\t\n\t\n\n//\n// Colonne de gauche\n//\n\n\techo debut_gauche('', true);\n\techo pipeline('affiche_gauche', array('args'=>array('exec'=>'veille_tous'),'data'=>''));\n\n\t\t// Affichage du bloc d'information 'Navigation' (fonction definie au-dessus)\n\t\techo cadre_veille_tous_infos();\n\n\t\t// D'abord un 'bloc des raccourcis' pour les boutons de creation de nouveaux objets\n\t\techo bloc_des_raccourcis(icone_horizontale(_T('vu:raccourcis_annonce'), generer_url_ecrire(\"veille_edit\",\"type=annonce&new=oui\"), _DIR_VU_IMG_PACK.\"annonce-24.gif\", \"creer.gif\", false)\n\t\t\t. icone_horizontale(_T('vu:raccourcis_evenement'), generer_url_ecrire(\"veille_edit\",\"type=evenement&new=oui\"), _DIR_VU_IMG_PACK.\"evenement-24.gif\", \"creer.gif\", false)\n\t\t\t. icone_horizontale(_T('vu:raccourcis_publication'), generer_url_ecrire(\"veille_edit\",\"type=publication&new=oui\"), _DIR_VU_IMG_PACK.\"publication-24.gif\", \"creer.gif\", false)\n\t\t);\n\n\t\n//\t\n// Contenu central\n//\n\n\techo debut_droite('', true);\n\techo pipeline('affiche_milieu', array('args'=>array('exec'=>'veille_tous'),'data'=>''));\n\n\t// Liste des annonces\n\techo afficher_objets('annonce',_T('vu:liste_annonces'), array(\"SELECT\" => 'id_annonce, date, titre, statut', \"FROM\" => 'spip_vu_annonces AS annonces', 'WHERE' => \"statut='publie' OR statut='refuse' OR statut='prop'\", 'ORDER BY' => \"date DESC\"),'',true);\n\t// Liste des evenements\n\techo afficher_objets('evenement',_T('vu:liste_evenements'), array(\"SELECT\" => 'id_evenement, date, titre, statut', \"FROM\" => 'spip_vu_evenements AS evenements', 'WHERE' => \"statut='publie' OR statut='refuse' OR statut='prop'\", 'ORDER BY' => \"date DESC\"),'',true);\n\t// Liste des publications\n\techo afficher_objets('publication',_T('vu:liste_publications'),\tarray(\"SELECT\" => 'id_publication, date, titre, statut', \"FROM\" => 'spip_vu_publications AS publications', 'WHERE' => \"statut='publie' OR statut='refuse' OR statut='prop'\", 'ORDER BY' => \"date DESC\"),'',true);\n\n\t\n\n\n\techo fin_gauche(), fin_page();\n}",
"function gVerfolgung_pntables()\r\n{\r\n // Initialise table array \r\n $pntables = array();\r\n $prefix = pnConfigGetVar('prefix');\r\n\r\n $table = $prefix . '_gVerfolgung_Verfolgungsliste';\r\n $pntables['gVerfolgung_Verfolgungsliste'] = $table;\r\n $columns = array (\r\n \t 'id'\t=>\t'verf_id',\r\n\t\t 'lfdnr'\t=>\t'verf_lfdnr',\r\n\t\t 'qnr'\t=>\t'verf_qnr',\r\n\t\t 'idnr'\t=>\t'verf_idnr',\r\n\t\t 'reklamTeile'\t=>\t'verf_reklamTeile',\r\n\t\t 'kunde'\t=>\t'verf_kunde',\r\n\t\t 'produkt'\t=>\t'verf_produkt',\r\n\t\t 'bestDatum'\t=>\t'verf_bestDatum',\r\n\t\t 'wareEing'\t=>\t'verf_wareEing',\r\n\t\t 'gewEnd'\t=>\t'verf_gewEnd',\r\n\t\t 'rueckl'\t=>\t'verf_rueckl',\r\n\t\t 'fehlerArt'\t=>\t'verf_fehlerArt',\r\n\t\t 'fehler'\t=>\t'verf_fehler',\r\n\t\t 'ursache'\t=>\t'verf_ursache',\r\n\t\t 'massnahme'\t=>\t'verf_massnahme',\r\n\t\t 'massnahme8D'\t=>\t'verf_massnahme8D',\r\n\t\t 'verantRep'\t=>\t'verf_verantRep',\r\n\t\t 'verantOQ'\t=>\t'verf_verantOQ',\r\n\t\t 'verantOF'\t=>\t'verf_verantOF',\r\n\t\t 'bereich'\t=>\t'verf_bereich',\r\n\t\t 'fehlerWieder'\t=>\t'verf_fehlerWieder',\r\n\t\t 'ende'\t=>\t'verf_ende',\r\n\t\t 'dauer'\t=>\t'verf_dauer',\r\n\t\t 'verantOV'\t=>\t'verf_verantOV',\r\n\t\t 'status'\t=>\t'verf_status',\r\n \t\t'version' => 'verf_version',\r\n\t );\r\n ObjectUtil::addStandardFieldsToTableDefinition ($columns, 'verf_');\r\n $pntables['gVerfolgung_Verfolgungsliste_column'] = $columns;\r\n\r\n \r\n\r\n\r\n return $pntables;\r\n}",
"private function chargeLesGenres()\n\t\t{\n\t\t$resultat=$this->maBD->chargement('genre');\n\t\t$nb=0;\n\n\t\twhile ($nb<sizeof($resultat))\n\t\t\t{\n\t\t\t\t$this->tousLesGenres->ajouteUnGenre($resultat[$nb][0],$resultat[$nb][1]);\n\n\t\t\t$nb++;\n\t\t\t}\n\n\t\t}",
"function bbp_admin_setting_callback_revisions()\n{\n}",
"public function refreshEtatEvolution() {\r\n // Recupere la position donnee\r\n $position = $this->_route->get('position');\r\n\r\n // Recuperation du personnage en session\r\n $personnage = Session::get('personnage');\r\n\r\n // Tentative de changement d'etat d'evolution\r\n $this->_service->updateEtatEvolution($position, $personnage);\r\n\r\n // Gestion des erreurs\r\n if ($this->_service->getValidator()->hasErrors()) {\r\n // Log\r\n foreach ($this->_service->getValidator()->getErrors() as $error) {\r\n $this->_logger->notice($error, array('user' => Session::get('user')));\r\n }\r\n }\r\n\r\n // Mise a jour de la map en session\r\n $map = Session::get('map');\r\n $map->setDomaineAndRefresh($personnage->getDomaine());\r\n Session::set('map', $map);\r\n\r\n // Mise à jour du personnage en session\r\n Session::set(\"personnage\", $personnage);\r\n\r\n // Recupere le batiment de la position indiquee\r\n $batiment = $personnage->getDomaine()->getBatimentAtPosition($position);\r\n\r\n // Récupération du bandeau pour refresh\r\n $content['bandeau'] = $this->createZone('bandeauPersonnage')->execute()->render();\r\n\r\n // Recupere la case du batiment a la position donnee\r\n $caseBatiment = $map->getCaseByPosition($batiment->getPosition());\r\n\r\n // Case du batiment\r\n $returnCaseBatiment = new stdClass();\r\n $returnCaseBatiment->x = $caseBatiment->getX();\r\n $returnCaseBatiment->y = $caseBatiment->getY();\r\n $returnCaseBatiment->image = $this->getApp()->getAppConfiguration()->getWebroot().'/images/domaine/map/' . $batiment->getStatefulImage();\r\n\r\n $content['caseBatiment'] = $returnCaseBatiment;\r\n\r\n // Si le batiment est de type commercial\r\n if ($batiment instanceof BatimentCommercial) {\r\n // Recolte\r\n $returnRecolte = new stdClass();\r\n $returnRecolte->dureeRestante = $batiment->getDureeRecolte();\r\n\r\n $content['recolteToStart'] = $returnRecolte;\r\n }\r\n\r\n return $this->json($content);\r\n }",
"public function hasRevisions();",
"function owm_flux2previsions($flux, $lieu) {\n\t// Identifier le format d'échange des données\n\tinclude_spip('inc/config');\n\t$format = lire_config('rainette/owm/format', 'xml');\n\n\t// Identification des suffixes d'unite pour choisir le bon champ\n\t$unite = lire_config('rainette/owm/unite', 'm');\n\n\t// Construire le tableau standard des prévisions météorologiques propres au service\n\t$tableau = ($format == 'xml') ? xml2previsions_owm($flux, $unite) : json2previsions_owm($flux, $unite);\n\n\t// Compléter le tableau standard avec les états météorologiques calculés pour chaque jour\n\tif ($tableau) {\n\t\t$condition = lire_config('rainette/owm/condition', 'owm');\n\t\tforeach ($tableau as $_index => $_prevision) {\n\t\t\tif ($_prevision[0]['code_meteo']\n\t\t\tAND $_prevision[0]['icon_meteo']\n\t\t\tAND isset($_prevision[0]['desc_meteo'])) {\n\t\t\t\t// Le mode jour/nuit n'est pas supporté par ce service.\n\t\t\t\t$tableau[$_index]['periode'] = 0; // jour\n\n\t\t\t\t// Determination, suivant le mode choisi, du code, de l'icone et du resume qui seront affiches\n\t\t\t\tif ($condition == 'owm') {\n\t\t\t\t\t// On affiche les prévisions natives fournies par le service.\n\t\t\t\t\t// Celles-ci etant deja traduites dans la bonne langue on stocke le texte exact retourne par l'API\n\t\t\t\t\t$tableau[$_index][0]['icone']['code'] = $_prevision[0]['code_meteo'];\n\t\t\t\t\t$url = _RAINETTE_OWM_URL_BASE_ICONE . '/' . $_prevision[0]['icon_meteo'] . '.png';\n\t\t\t\t\t$tableau[$_index][0]['icone']['url'] = copie_locale($url);\n\t\t\t\t\t$tableau[$_index][0]['resume'] = ucfirst($_prevision[0]['desc_meteo']);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// On affiche les conditions traduites dans le systeme weather.com\n\t\t\t\t\t$meteo = meteo_owm2weather($_prevision[0]['code_meteo'], $tableau[$_index]['periode']);\n\t\t\t\t\t$tableau[$_index][0]['icone'] = $meteo;\n\t\t\t\t\t$tableau[$_index][0]['resume'] = $meteo;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Traitement des erreurs de flux\n\t$index = count($tableau);\n\t$tableau[$index]['erreur'] = (!$tableau) ? 'chargement' : '';\n\n\t// Ajout des informations communes dans l'index adéquat\n\t$tableau[$index]['max_jours'] = _RAINETTE_OWM_JOURS_PREVISIONS;\n\n\treturn $tableau;\n}",
"function mosaique_affiche_gauche($flux){\r\n\tif ($en_cours = trouver_objet_exec($flux['args']['exec'])\r\n\t\tAND $en_cours['edition']!==false // page edition uniquement\r\n\t\tAND $type = $en_cours['type']\r\n\t\tAND $id_table_objet = $en_cours['id_table_objet']\r\n\t\t// id non defini sur les formulaires de nouveaux objets\r\n\t\tAND (isset($flux['args'][$id_table_objet]) and $id = intval($flux['args'][$id_table_objet])\r\n\t\t\t// et justement dans ce cas, on met un identifiant negatif\r\n\t\t\tOR $id = 0-$GLOBALS['visiteur_session']['id_auteur'])\r\n\t\tAND autoriser('joindredocument',$type,$id)\r\n\t\tAND $type == 'article') // Articles seulement pour l'instant\r\n\t{\r\n\t\t$flux['data'] = recuperer_fond('prive/objets/editer/mosaique_colonne', array('objet'=>$type,'id_objet'=>$id)) . $flux['data'];\r\n\t}\r\n\r\n\treturn $flux;\r\n}",
"function gisgeom_upgrade($nom_meta_base_version, $version_cible) {\n\t$maj = array();\n\n\t$maj['create'] = array(\n\t\t// ajout des champs geo et type à la table gis (procéder en 2 temps, dans le cas où la table n'est pas vide)\n\t\tarray('sql_alter', 'TABLE spip_gis ADD geo GEOMETRY AFTER lon'),\n\t\t// renseigner spip_gis.geo avec spip_gis.lat et spip_gis.lon pour les objets existants\n\t\tarray('sql_update', 'spip_gis', array('geo' => \"GeomFromText(CONCAT('POINT(',lon,' ',lat,')'))\")),\n\t\t// NOT NULL pour pouvoir avec index !\n\t\tarray('sql_alter', 'TABLE spip_gis CHANGE COLUMN geo geo GEOMETRY NOT NULL'),\n\t\tarray('sql_alter', \"TABLE spip_gis ADD type VARCHAR (25) DEFAULT '' NOT NULL AFTER zoom\"),\n\t\t// renseigner spip_gis.type = point pour les objets existants\n\t\tarray('sql_updateq', 'spip_gis', array('type' => 'Point')),\n\t\t// ajouter un index sur le champ geo\n\t\tarray('sql_alter', 'TABLE spip_gis ADD SPATIAL INDEX (geo)'),\n\t\t// purger le cache js\n\t\tarray('gisgeom_purger_cache_js'),\n\t);\n\n\tinclude_spip('base/upgrade');\n\tmaj_plugin($nom_meta_base_version, $version_cible, $maj);\n}",
"function formulaires_editer_produit_verifier($id_produit='new', $id_rubrique=0, $retour=''){\r\n\tset_request('id_parent', _request('parent'));\r\n\r\n\t$erreurs = array();\r\n\t$erreurs = formulaires_editer_objet_verifier('produit', $id_produit);\r\n\t\r\n\t$config = lire_config('produits') ;\r\n\t// Vérifier que la rubrique choisie se trouve dans les secteurs autorisés\r\n\tif($config['limiter_ajout']) {\r\n\t\t$id_secteur = sql_getfetsel(\"id_secteur\", \"spip_rubriques\", \"id_rubrique=\" . intval(produits_id_parent()));\r\n\t\tif(is_array($config['limiter_ident_secteur']) && !in_array($id_secteur,$config['limiter_ident_secteur'])) {\r\n\t\t\t$titres = \"\" ;\r\n\t\t\tforeach($config['limiter_ident_secteur'] as $id_secteur) {\r\n\t\t\t\t$titres .= sql_getfetsel(\"titre\", \"spip_rubriques\", \"id_rubrique=\" . intval($id_secteur)).\" / \" ;\r\n\t\t\t}\r\n\t\t\t$erreurs['id_parent'] .= _T(\"produits:secteurs_autorises\", array('secteurs' => $titres));\r\n\t\t}\r\n\t}\r\n\r\n\treturn $erreurs ;\r\n}",
"public function revisionOverview() {\n // Get entity type id.\n $entity_type_id = $this->entityType;\n\n // Get storage.\n $storage = $this\n ->entityTypeManager()\n ->getStorage($this->entityType);\n\n // Load the entity.\n $entity = $storage->load($this->entityId);\n\n // Get the current user.\n $account = $this->currentUser();\n\n // Build the renderable array.\n $build['#title'] = $this->t('Revisions for %title', ['%title' => $entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n // Get the entity type admin permission.\n $admin_permission = $entity\n ->getEntityType()\n ->getAdminPermission();\n\n // Check if currect user has the admin permission.\n $user_is_admin = $account->hasPermission($admin_permission);\n\n $rows = [];\n\n // Get the revision ids.\n $vids = $storage->revisionIds($entity);\n\n $latest_revision = TRUE;\n\n // Iterate the revisions.\n foreach (array_reverse($vids) as $vid) {\n $revision = $storage->loadRevision($vid);\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $entity->getRevisionId()) {\n $link = Link::fromTextAndUrl($date, new Url(\"entity.{$entity_type_id}.revision\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]))->toString();\n }\n else {\n $link = $entity->toLink($date)->toString();\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => $this->renderer->renderPlain($username),\n 'message' => [\n '#markup' => $revision->getRevisionLogMessage(),\n '#allowed_tags' => Xss::getHtmlTagList(),\n ],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($user_is_admin) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute(\"entity.{$entity_type_id}.revision_revert\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]),\n ];\n\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute(\"entity.{$entity_type_id}.revision_delete\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n\n $build['revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }",
"function bbp_allow_revisions($default = 1)\n{\n}",
"function gabarits_upgrade($nom_meta_base_version,$version_cible){\n\t$current_version = '0.0';\n\tif ((!isset($GLOBALS['meta'][$nom_meta_base_version]))\n\t\t\t|| (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){\n\t\t// installation\n\t\tif (version_compare($current_version, '0.0','<=')){\n\t\t\tinclude_spip('base/gabarits');\n\t\t\tinclude_spip('base/create');\n\t\t\t// creer les tables\n\t\t\tcreer_base();\n\t\t\tecrire_meta($nom_meta_base_version,$current_version=$version_cible,'non');\n\t\t}\n\t\tif (version_compare($current_version, '0.2','<')){\n\t\t\tinclude_spip('base/gabarits');\n\t\t\tinclude_spip('base/create');\n\t\t\tcreer_base();\n\t\t\tinclude_spip('base/abstract_sql');\n\t\t\t// lier les gabarits existants aux articles\n\t\t\tsql_updateq('spip_gabarits', array('objet' => 'article'));\n\t\t\tecrire_meta($nom_meta_base_version,$current_version=\"0.2\",'non');\n\t\t}\n\t}\n}",
"public function modifier() {\n $id = $this->requete->getParametreId('id');\n $produit = $this->produit->getProduit($id);\n $this->genererVue(['produit' => $produit]);\n }"
] | [
"0.6212178",
"0.5982883",
"0.5954931",
"0.59075594",
"0.5728005",
"0.5525552",
"0.54698366",
"0.5468699",
"0.54067147",
"0.5377027",
"0.5328951",
"0.5278562",
"0.5253423",
"0.5240804",
"0.5238032",
"0.52144796",
"0.52126104",
"0.5195282",
"0.5190649",
"0.5182188",
"0.5171607",
"0.51678544",
"0.5149267",
"0.5145735",
"0.5143613",
"0.5135106",
"0.5128792",
"0.51280767",
"0.5115095",
"0.5108188"
] | 0.78139925 | 0 |
Returns sample post array | public function getSamplePost()
{
return array(
'nom' => 'Aubin',
'prenom' => 'Andre',
'age' => 20,
'email' => '[email protected]'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSampleDuplicatePost()\n {\n return array(\n 'nom' => 'Aubin',\n 'conf_nom' => 'Aubinn',\n 'prenom' => 'Andre',\n 'conf_prenom' => 'Andre',\n 'age' => 20,\n 'email' => '[email protected]'\n );\n }",
"public function postArray(): array\n {\n return $this->post;\n }",
"function getPosts()\r\n{\r\n $posts = array();\r\n $posts[0] = $_POST['id'];\r\n $posts[1] = $_POST['flavor'];\r\n $posts[2] = $_POST['brand'];\r\n $posts[3] = $_POST['upc'];\r\n return $posts;\r\n}",
"public static function getall_post() { return is_array(self::$post) ? self::$post : array(); }",
"public function ltiRawPostArray() {\n $lti_post = $this->launch->ltiRawPostArray();\n return $lti_post;\n }",
"public function getPostData(): array\n {\n return $this->postData;\n }",
"function getPosts()\r\n{\r\n $posts = array();\r\n $posts[0] = $_POST['Id'];\r\n $posts[1] = $_POST['Class'];\r\n $posts[2] = $_POST['Number'];\r\n $posts[3] = $_POST['Owner'];\r\n $posts[4] = $_POST['Availability'];\r\n $posts[5] = $_POST['Receiveddate'];\r\n $posts[6] = $_POST['Returndate'];\r\n $posts[7] = $_POST['Image'];\r\n return $posts;\r\n}",
"public function samples() : array\n {\n return $this->samples;\n }",
"private function getPostData() : array\n {\n\n return $this->sanitize(array_merge(\n\n $this->gateway->getAdditionalPostData(\n $this->getConfig()\n ),\n\n /**\n * Gets The callbacks\n */\n $this->parseCallback([\n $this->gateway->callbackKey => config('payment.callback_url')\n ]),\n $this->parseCallback([\n $this->gateway->notifyCallbackKey => config('payment.notify_callback_url')\n ]),\n\n /**\n * Gets The Unique Service ID\n */\n array(\n $this->gateway->serviceIdKey => $this->getConfig('service_id')\n ),\n\n /**\n * Gets the Transaction unique ID\n */\n array(\n $this->gateway->uniqueIdentifierKey => $this->transaction->getAttribute('unique_no')\n ),\n\n /**\n * Prepare the price to be sent to the gateway API\n */\n array(\n $this->gateway->priceKey => $this->gateway->getPrice(\n $this->transaction->getAttribute('amount'), config('payment.base')\n )\n )\n ));\n }",
"public function &getPost(): array\n {\n return $this->post;\n }",
"public function get_post()\n {\n if (count($_POST)) {\n $post = array();\n foreach ($_POST as $key => $value) {\n $post[$key] = $this->CI->input->post($key);\n }\n\n return $post;\n } else {\n return false;\n }\n }",
"public function getTestResultsData()\n {\n $out = [];\n\n // Case #0 empty request.\n $out[] = [new Request(), [1, 2, 3], false];\n\n // Case #1 foo request.\n $out[] = [new Request(['q' => 'foo']), [1, 2], false];\n\n // Case #2 cool request.\n $out[] = [new Request(['q' => 'cool']), [2, 3], false];\n\n return $out;\n }",
"public function getPostData()\n {\n if (empty($this->_postData) || (!is_array($this->_postData) && !is_object($this->_postData))) {\n return array();\n }\n\n $post = array();\n\n $this->_flattenArray($this->_postData, $post);\n\n return $post;\n }",
"public function getPost()\n {\n foreach ($_POST as $key => $value) {\n $this->allPost[$key] = $value; \n }\n return $this->allPost;\n }",
"private function process_data_method_POST()\n\t{\n\t\t$length = count($_POST);\n\t\t$keys = array_keys($_POST);\n\t\t$values = array_values($_POST);\n\t\t$items = array();\n\t\tfor($i = 0; $i < $length; $i++)\n\t\t{\n\t\t\t$items[$keys[$i]] = $this->sterilize($values[$i]);\n\t\t}\n\t\treturn $items;\n\n\t}",
"public function createPost() : array {\n\t\t\n\t\t$model = new Posts();\n\t\t\n\t\t\n\t\t\n\t\tif($model -> create($this->_data, array('validate_options' => array('display' => false, 'event' => 'create')))) {\n\t\t\t$this -> _jsonResponse($model -> getIterator() -> getData());\n\t\t} else {\n\t\t\t$this -> _errorResponse($model);\n\t\t}\n\t\t\n\t\texit();\n\t}",
"public static function post() {\n $faker = Factory::create();\n // Generate a consistent title\n $title = $faker->words(rand(3, 8), true);\n\n return [\n 'id' => $faker->uuid,\n 'slug' => str_replace(' ', '-', strtolower($title)),\n 'title' => ucwords($title),\n 'summary' => ucfirst($faker->paragraph),\n 'authors' => [\n static::author(),\n static::author()\n ]\n ];\n }",
"public function sample()\n\t{\n\t\treturn [\n\t\t\t'a' => 'b'\n\t\t];\n\t}",
"function get(){\n \n // For now let's return a static array\n return array(\n array(\n 'id' => 1,\n 'name' => 'Hello World!'\n ),\n array(\n 'id' => 2,\n 'name' => 'My 2nd post...'\n )\n );\n }",
"public function executePost()\n {\n return $this->toArray();\n }",
"public function getPosts(){\n\t\t\t$json = file_get_contents($this->assetpath . 'json/feed.json');\n\n\t\t\t// Get the initial array\n\t\t\t$json_arr = json_decode($json, true);\n\n\t\t\t// Cut out the excess information\n\t\t\t$this->post_array = $json_arr['data'];\n\n\t\t}",
"public function toGetPostPublishData() {\r\n $lmt = $this->input->get('lmt');\r\n $ofSet = $this->input->get('ofSet');\r\n $banner_type = $this->input->get('banner_type');\r\n $tablename = 'posts';\r\n $AllPostsData = $this->Global_model->toGetPostPublishData($tablename, $lmt, $ofSet, 1, $banner_type);\r\n if (isset($AllPostsData) && !empty($AllPostsData)) {\r\n echo json_encode($AllPostsData);\r\n exit;\r\n } else {\r\n echo 'fail';\r\n exit;\r\n }\r\n }",
"public static function post()\n\t{\n\t\t$post = Request::initial()->post();\n\t\tksort($post);\n\t\t\n\t\treturn $post;\n\t}",
"function as_post_fields_curl_array(){\n\t\n\t\t$post_array = array();\n\t\t$i=1;\n\t\t\n\t\tforeach($this->as_array(1) as $image){\n\t\t\t$post_array['file'.$i] = '@'.$image;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $post_array;\t\n\t}",
"private function noPostData() {\n $data = array();\n $data['errorCode'] = \"3\";\n $data['errorMessage'] = \"No Post Data\";\n $data['result'] = \"\";\n\n $mainData = array();\n $mainData['data'] = $data;\n return $mainData;\n }",
"public static function post() : array\n {\n return $_POST;\n }",
"public function ParsePostData() {}",
"public function getPostData()\n {\n return $this->post;\n }",
"function get_questions_from_post()\n{\n $questions = array();\n array_push($questions, $_POST['question1']);\n array_push($questions, $_POST['question2']);\n array_push($questions, $_POST['question3']);\n array_push($questions, $_POST['question4']);\n array_push($questions, $_POST['question5']);\n return $questions;\n}",
"function getPosts()\n{\n $posts = array();\n $posts[0] = $_POST['id_topic'];\n $posts[1] = $_POST['titre'];\n $posts[2] = $_POST['id_utilisateur'];\n $posts[3] = $_POST['date_crea'];\n return $posts;\n}"
] | [
"0.7223016",
"0.666701",
"0.6200214",
"0.61756796",
"0.6111895",
"0.609758",
"0.60751235",
"0.6008352",
"0.6001055",
"0.5983104",
"0.5970438",
"0.5962669",
"0.5956712",
"0.5929122",
"0.59287417",
"0.5928228",
"0.5921402",
"0.58833885",
"0.5872089",
"0.5861229",
"0.58418995",
"0.58320445",
"0.58214945",
"0.58075136",
"0.5806891",
"0.5797395",
"0.5796467",
"0.5718885",
"0.5696049",
"0.56448346"
] | 0.8000613 | 0 |
Returns sample post (with duplicates) array | public function getSampleDuplicatePost()
{
return array(
'nom' => 'Aubin',
'conf_nom' => 'Aubinn',
'prenom' => 'Andre',
'conf_prenom' => 'Andre',
'age' => 20,
'email' => '[email protected]'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSamplePost()\n {\n return array(\n 'nom' => 'Aubin',\n 'prenom' => 'Andre',\n 'age' => 20,\n 'email' => '[email protected]'\n );\n }",
"function the_posts_filter( $posts ) {\n\t\t$posts[] = clone $posts[0];\n\n\t\t// Add some custom data to each post.\n\t\tforeach ( $posts as $key => $post )\n\t\t\t$posts[ $key ]->custom_data = array( $post->ID, 'custom data' );\n\n\t\treturn $posts;\n\t}",
"public static function post() {\n $faker = Factory::create();\n // Generate a consistent title\n $title = $faker->words(rand(3, 8), true);\n\n return [\n 'id' => $faker->uuid,\n 'slug' => str_replace(' ', '-', strtolower($title)),\n 'title' => ucwords($title),\n 'summary' => ucfirst($faker->paragraph),\n 'authors' => [\n static::author(),\n static::author()\n ]\n ];\n }",
"public function sample()\n\t{\n\t\treturn [\n\t\t\t'a' => 'b'\n\t\t];\n\t}",
"function getShuffleArrays(){\r\n\r\n\t$filterData1=array();\r\n\t$forherallimages=$this->getAllGeneralItemsWithJoins($filterData1,\"library_for_her\");\r\n\t//die('111');\r\n $filterData2=array();\r\n\t$forhimallimages=$this->getAllGeneralItemsWithJoins($filterData2,\"library_for_him\");\r\n\t\r\n\t$arrayall = array_merge($forherallimages,$forhimallimages);\r\n\tshuffle($arrayall);\r\n\t\r\n $ComplementaryArray=array_splice($arrayall, 0, 10);\r\n\treturn $ComplementaryArray;\r\n\t}",
"private function createPosts()\n {\n $posts = [];\n\n $posts[] = Post::create([\n 'title' => 'Test 1',\n 'content' => 'Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.',\n 'slug' => 'test-1',\n ]);\n $posts[] = Post::create([\n 'title' => 'Test 2',\n 'content' => 'Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.',\n 'slug' => 'test-2',\n ]);\n $posts[] = Post::create([\n 'title' => 'Test 3',\n 'content' => 'Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.',\n 'slug' => 'test-3',\n ]);\n\n return $posts;\n }",
"public function samples() : array\n {\n return $this->samples;\n }",
"public function postArray(): array\n {\n return $this->post;\n }",
"public static function getall_post() { return is_array(self::$post) ? self::$post : array(); }",
"public static function rand() {\n list($ageFrom, $ageTo, $rows) = PostTag::getRandom();\n\n $tags = array();\n\n if (!empty($rows))\n {\n foreach ($rows as $row)\n {\n $tags[] = $row->toJsonArray();\n }\n }\n\n $response = array('af'=>$ageFrom, 'at'=>$ageTo, 'ta'=>$tags);\n return static::toJson($response, 200);\n }",
"public function posts() {\n $posts = [];\n if ($this->property('cacheLifetime')) {\n $posts = Cache::get('blogarchive_random_posts');\n }\n\n if (empty($posts)) {\n $posts = $this->getPosts();\n }\n return $posts;\n }",
"public static function getPosts()\n {\n $posts = array();\n $posts[] = Model_Post::create('Title 1', 'this is a really long piece of text about a whole bunch of stuff that doesn\\'t matter. I could keep writing and writing and writing!');\n $posts[] = Model_Post::create('Title 2', 'A shorter piece of content lives here');\n return $posts;\n }",
"function randSubset() {\n $n = rand(1, pow(2, count($this->contents)) - 1);\n return $this->getSubset($n);\n }",
"public function run(Faker $faker)\n {\n\n $categoryList=[\n 'thriller',\n 'Comico',\n 'horror',\n 'avventura'\n ];\n\n $listOfCategoryID =[];\n\n foreach($categoryList as $category){\n $categoryObject= new Category();\n $categoryObject->name = $category;\n $categoryObject->save();\n $listOfCategoryID[] = $categoryObject->id;\n }\n \n for ($i = 0; $i <50; $i++){\n \n $postDetail = new PostDetail();\n $postDetail->form_factor = $faker->words(1, true);\n $postDetail->publisher = $faker->words(1, true);\n $postDetail->publication_year = $faker->date('Y');\n $postDetail->save();\n\n $postObject = new Post();\n $postObject->title= $faker->sentence(10);\n $postObject->imagen= $faker->imageUrl(640,480,'posts',true);\n $postObject->data= $faker->dateTime();\n \n $randCategoryKey = array_rand($listOfCategoryID, 1);\n $categoryID= $listOfCategoryID[$randCategoryKey];\n $post->category_id=$categoryID;\n $postObject->price= $faker->randomFloat(2,5,100);\n \n $post->post_detail_id = $PostDetail->id;\n \n $postObject->save();\n }\n\n\n// $posts=[\n// 'title'=>'Notte stellata',\n// 'imagen'=> 'http://lh6.ggpht.com/HlgucZ0ylJAfZgusynnUwxNIgIp5htNhShF559x3dRXiuy_UdP3UQVLYW6c=w454-h300-n-l64',\n// 'data' => '1889-06-01',\n// 'price'=> '5.000',\n// ];\n \n// [\n// 'title'=>'Il bacio',\n// 'imagen'=> 'http://lh4.ggpht.com/UuYCUnqvo2EIZhyFHYFVLbkmma_cubVk7SwxOF3lklT6aor5647BXVhEaFB7jg=w298-h300-n-l64',\n// 'data' => '1907-06-01',\n// 'price'=> '6.000',\n// ];\n\n// [\n// 'title'=>'La persistenza della memoria',\n// 'imagen'=> 'https://m.media-amazon.com/images/I/5152BzKdYTL._AC_.jpg',\n// 'data' => '1934-01-01',\n// 'price'=> '7.000',\n// ];\n\n// foreach($posts as $post){\n// $postObject= new Post();\n// $postObject->title = $post['title'];\n// $postObject->imagen= $post['imagen'];\n// $postObject->data= $post['data'];\n// $postObject->price= $post['price'];\n// $postObject->save();\n// }\n\n }",
"function getPosts()\r\n{\r\n $posts = array();\r\n $posts[0] = $_POST['id'];\r\n $posts[1] = $_POST['flavor'];\r\n $posts[2] = $_POST['brand'];\r\n $posts[3] = $_POST['upc'];\r\n return $posts;\r\n}",
"public function getPosts()\n {\n $req = $this->queryDB('SELECT posts.id_post,posts.title, posts.short_content, posts.create_date, posts.modification_date, users.pseudo FROM posts INNER JOIN users ON user_id = id_user ORDER BY posts.modification_date DESC');\n $posts= [];\n foreach ($req as $data) {\n $postId = $data['id_post'];\n $posts[$postId] = $this->postObject($data);\n }\n return $posts;\n }",
"public function posts()\n {\n $posts = get_posts([\n 'post_type' => 'Post',\n 'posts_per_page'=> get_option( 'posts_per_page' )\n ]);\n\n return array_map(function ($post) {\n $post->excerpt = get_the_excerpt($post->ID);\n $post->thumbnail = get_the_post_thumbnail($post->ID, 'wide_s');\n $post->link = get_the_permalink($post->ID);\n $post->category = get_the_terms($post->ID, 'category')[0];\n $post->date = get_the_date(null, $post->ID);\n\n $post->author = get_userdata($post->post_author);\n $post->author_image = wp_get_attachment_image( get_field('image', 'user_' . $post->post_author), 'thumbnail');\n\n return $post;\n }, $posts);\n\n }",
"public function getFullyDisplayedPosts(): array\n\t{\n\t\treturn iterator_to_array($this->generatePostList());\n\t}",
"function get_questions_from_post()\n{\n $questions = array();\n array_push($questions, $_POST['question1']);\n array_push($questions, $_POST['question2']);\n array_push($questions, $_POST['question3']);\n array_push($questions, $_POST['question4']);\n array_push($questions, $_POST['question5']);\n return $questions;\n}",
"protected function getPosts() {\n $count = $this->property('postsCount');\n\n // use rand from different db drivers\n if (DB::connection()->getDriverName() == 'mysql') {\n $posts = Post::orderBy(DB::raw('RAND()'));\n } else if (DB::connection()->getDriverName() == 'sqlite') {\n $posts = Post::orderBy(DB::raw('RANDOM()'));\n } else {\n $posts = Post::orderBy('id');\n }\n $posts = $posts->isPublished()->take($count)->get();\n\n foreach ($posts as $post) {\n $post->url = $post->setUrl($this->property('postPage'), $this->controller);\n }\n\n $this->cachePosts($posts);\n\n return $posts;\n }",
"public function get_random_question_summaries_test_cases() {\n return [\n 'empty category' => [\n 'categoryindex' => 'emptycat',\n 'includesubcategories' => false,\n 'usetagnames' => [],\n 'expectedquestionindexes' => []\n ],\n 'single category' => [\n 'categoryindex' => 'cat1',\n 'includesubcategories' => false,\n 'usetagnames' => [],\n 'expectedquestionindexes' => ['cat1q1', 'cat1q2']\n ],\n 'include sub category' => [\n 'categoryindex' => 'cat1',\n 'includesubcategories' => true,\n 'usetagnames' => [],\n 'expectedquestionindexes' => ['cat1q1', 'cat1q2', 'subcatq1', 'subcatq2']\n ],\n 'single category with tags' => [\n 'categoryindex' => 'cat1',\n 'includesubcategories' => false,\n 'usetagnames' => ['cat1'],\n 'expectedquestionindexes' => ['cat1q1']\n ],\n 'include sub category with tag on parent' => [\n 'categoryindex' => 'cat1',\n 'includesubcategories' => true,\n 'usetagnames' => ['cat1'],\n 'expectedquestionindexes' => ['cat1q1']\n ],\n 'include sub category with tag on sub' => [\n 'categoryindex' => 'cat1',\n 'includesubcategories' => true,\n 'usetagnames' => ['subcat'],\n 'expectedquestionindexes' => ['subcatq1']\n ],\n 'include sub category with same tag on parent and sub' => [\n 'categoryindex' => 'cat1',\n 'includesubcategories' => true,\n 'usetagnames' => ['foo'],\n 'expectedquestionindexes' => ['cat1q1', 'subcatq1']\n ],\n 'include sub category with tag not matching' => [\n 'categoryindex' => 'cat1',\n 'includesubcategories' => true,\n 'usetagnames' => ['cat1', 'cat2'],\n 'expectedquestionindexes' => []\n ]\n ];\n }",
"public function findAllDuplicates(): array\n {\n return $this->findDuplicates(false);\n }",
"function getFinalMultiItemArr_repeat() {\n $ret=array();\n for($i=0;$i<count($this->map_data);$i++) {\n if(!$this->isBGImg($this->map_data[$i])) {\n $imgid=$this->map_data[$i];\n $imgid = preg_replace('/(\\\")/', \"\", $imgid);\n\n $iid_arr = explode(\"|\",$imgid);\n\n while($iid_arr) {\n $imgid = array_shift($iid_arr);\n $imgid_arr=explode(\"_\",$imgid);\n if(count($imgid_arr)>1)\n {\n $first_item_pos = $i;\n $first_item_id = $imgid_arr[0];\n $second_item_id = $imgid_arr[1];\n $end_item=$i;\n\n if(array_key_exists( $first_item_id , $ret)) {\n //if($ret[$first_item_id]!=\"\") {\n if(($second_item_id)==$this->getImgBottomSeqID($first_item_id))\n $ret[$first_item_id]=$ret[$first_item_id].\",\".$end_item;\n }\n else {\n if(($second_item_id)==$this->getImgBottomSeqID($first_item_id))\n $ret[$first_item_id]=$end_item;\n }\n }\n }\n\n\n }\n }\n return $ret;\n}",
"function ub_get_popular_dataset() {\n\n\t// Get posts that match tags and categories, but are not part of the dataset.\n\t$PopularPostsArgs = array(\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => 'ub_post_engagement',\n\t\t\t\t'value' => 0,\n\t\t\t\t'compare' => '>',\n\t\t\t)\n\t\t),\n\t);\n\n\t$popular_posts = [];\n\t$PopularPosts = new WP_Query( $PopularPostsArgs );\n\twhile ( $PopularPosts->have_posts() ) : $PopularPosts->the_post();\n\n\t\t$currentPostEngagement = get_post_meta( get_the_id(), 'ub_post_engagement', true )[ 'total' ];\n\n\t\t// Add post to reccomended posts array with id and engagement value\n\t\t$popular_posts[] = array( 'id' => get_the_ID(), 'total' => $currentPostEngagement, 'name' => get_the_title(), );\n\n\tendwhile;\n\twp_reset_query();\n\n\t// Sort $popular_posts from most total engagement to lowest\n\tusort( $popular_posts, function ( $a, $b ) {\n\t\treturn $b[ 'total' ] <=> $a[ 'total' ];\n\t});\n\n\t// Limit popular posts to $limit\n\t$popular = [];\n\tfor( $i = 0; $i < 10; $i++ ) {\n\t\t$popular[ $i ] = $popular_posts[ $i ];\n\t}\n\n\t// Return array\n\treturn $popular;\n\n}",
"function distribution($array)\r\n{\r\n $noDups = removeDups($array);\r\n sort($noDups);\r\n $distArray = array();\r\n foreach ($noDups as $noDupVal)\r\n {\r\n $dupCount = 0;\r\n foreach ($array as $arrayVal)\r\n {\r\n if($arrayVal == $noDupVal)\r\n {\r\n $dupCount ++;\r\n }\r\n }\r\n $distArray[$noDupVal] = $dupCount;\r\n }\r\n return $distArray;\r\n}",
"public function data_first() {\n\t\t\t$data = array(\n\t\t\t\tarray(array(array(1)), array(1)),\n\t\t\t\tarray(array(array(1, 2)), array(1)),\n\t\t\t\tarray(array(array(1, 2, 3)), array(1)),\n\t\t\t);\n\t\t\treturn $data;\n\t\t}",
"function get(){\n \n // For now let's return a static array\n return array(\n array(\n 'id' => 1,\n 'name' => 'Hello World!'\n ),\n array(\n 'id' => 2,\n 'name' => 'My 2nd post...'\n )\n );\n }",
"protected function getCustomPosts()\n {\n $posts = (array) $this->posts;\n\n foreach ($posts as $key => $post)\n {\n if (isset($post['metas']))\n {\n unset($posts[$key]['metas']);\n }\n }\n\n return $posts;\n }",
"private function generateNormalArray() {\n $params = $this->params;\n\n // size:N sets the size of generated array to the value N.\n // size:N-M sets the size of generated array to a random value from range.\n // If the parameter is not set it defaults to 3 elements.\n $size = 3;\n if (preg_match('/size:(\\d+)-(\\d+)/', $params, $matches)) {\n $size = mt_rand((int) $matches[1], (int) $matches[2]);\n } elseif (preg_match('/size:(\\d+)/', $params, $matches)) {\n $size = (int) $matches[1];\n }\n\n // [types]\n // Specifies what types of variables will be placed in the array.\n // Types have the following format:\n // type params\n //\n // Example:\n // [string words:5]\n $hasTypes = preg_match('/\\[(.+)\\s+(.+)\\]/', $params, $matches);\n if (!$hasTypes) {\n return [];\n }\n\n $values = [];\n for ($i = 0; $i < $size; $i++) {\n $values[] = Generator::generateValue($matches[1], $matches[2]);\n }\n\n return $values;\n }",
"public function getOneRandomPost()\n\t{\n\t\t$result = $this->JDBlogPostData->getOneRandomPost();\n\n\t\treturn $this->_View->element('requestAction/getOneRandomPost', $result, [ 'plugin' => 'JDWordpress' ]);\n\t}"
] | [
"0.6293605",
"0.5497544",
"0.5399429",
"0.5395058",
"0.53577626",
"0.5349376",
"0.5179939",
"0.51734614",
"0.5172623",
"0.51635885",
"0.51466304",
"0.5143078",
"0.5054555",
"0.5036335",
"0.50219625",
"0.5021302",
"0.5015104",
"0.49926525",
"0.49284205",
"0.49231607",
"0.48977706",
"0.48720503",
"0.4853195",
"0.48453152",
"0.4835403",
"0.48339045",
"0.48183498",
"0.48178285",
"0.48158583",
"0.48132446"
] | 0.7260157 | 0 |
tests the HappyRules sameThat() | public function testSameThat() {
$this->hfield->showErrors(false);
$this->assertTrue(
$this->hfield->setFields($this->getSampleDuplicatePost()),
'unable to add sample (duplicates) fields to validation.'
);
$this->assertTrue(
$this->hfield->addRule('prenom','alpha','surname'),
'The supplied rule (alpha) is false !'
);
$this->assertTrue(
$this->hfield->check(),
'The HappyField is not correct (prenom is not a alpha ?!)'
);
$this->assertTrue(
$this->hfield->addRule('conf_prenom','sameThat prenom','surname confirmation'),
'The supplied rule (alpha) is false !'
);
$this->assertTrue(
$this->hfield->check(),
'The HappyField is not correct (prenom is not a alpha ?!)'
);
$this->assertTrue(
$this->hfield->addRule(
'conf_nom',
'sameThat nom',
'surname confirmation'),
'The supplied rule (sameThat) is false !'
);
$this->assertFalse(
$this->hfield->check(),
'The HappyField is not correct (sameThat nom) '
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSameAs(): void\n {\n $validator = new Validator();\n $this->assertProxyMethod($validator, 'sameAs', 'other', ['other', Validation::COMPARE_SAME], 'compareFields');\n $this->assertNotEmpty($validator->validate(['username' => 'foo']));\n $this->assertNotEmpty($validator->validate(['username' => 1, 'other' => '1']));\n\n $fieldName = 'field_name';\n $rule = 'sameAs';\n $expectedMessage = 'The provided value must be same as `other`';\n $otherField = 'other';\n $this->assertValidationMessage($fieldName, $rule, $expectedMessage, $otherField);\n }",
"public function myTestRule2() {\n\t\treturn true;\n\t}",
"abstract public function match(&$actual);",
"#[@test]\n public function equalInput() {\n $this->assertEquals(\n array(\n new Copy('Hello'),\n new Copy('World')\n ), \n $this->differenceBetween(\n array('Hello', 'World'),\n array('Hello', 'World')\n )\n );\n }",
"public function pass() { return $this->assertTrue(1 == 1); }",
"public function test_equal_sensitive() {\r\n $t->test_with_english(true, true, 'those sequences are equal', 'those sequences are equal');\r\n $q = new qtype_correctwriting_question();\r\n $t = new qtype_correctwriting_are_lexeme_sequence_equal_test_utils($this);\r\n $q->usecase = false;\r\n }",
"public function testCreateDuplicate()\n {\n\n }",
"final public function identicalTo($expected): self\n {\n return $this->constraint($this->constraintFactory()->identical($expected));\n }",
"function asrt( $a, $b ) {\n\tif ($a === $b) {\n\t\tglobal $tests;\n\t\t$tests++;\n\t\tprint( \"[\".$tests.\"]\" );\n\t}\n\telse {\n\t\tprinttext(\"FAILED TEST: EXPECTED $b BUT GOT: $a \");\n\t\tfail();\n\t}\n}",
"function assertSame($expected, $actual) : void {}",
"function assertSame($expected, $actual) : void {}",
"function assertSame($expected, $actual) : void {}",
"function assertSame($expected, $actual) : void {}",
"function test_countRepeats_sameWord()\n {\n $test_RepeatCounter = new RepeatCounter();\n $input1 = \"cat\";\n $input2 = \"cat\";\n\n $result = $test_RepeatCounter->countRepeats($input1, $input2);\n\n $this->assertEquals(1, $result);\n }",
"public function testCompoundRules()\n\t{\n\t\t$pass = Rules::validate(['name' => \"mr cool\"], ['name' => 'notempty|alpha']);\n\t\t$fail = Rules::validate(['name' => \"\"], ['name' => 'notempty|alpha']);\n\n\t\t$this->assertTrue($pass, 'Rule (notempty|alpha) should have validated with a name of \"mr cool\"');\n\t\t$this->assertCount(2, $fail, 'Rules (notempty|alpha) should have returned two errors for a name of \"\"');\n\t}",
"function test_countRepeats_twoLettersSame()\n {\n $test_RepeatCounter = new RepeatCounter();\n $input1 = \"c\";\n $input2 = \"c c\";\n\n $result = $test_RepeatCounter->countRepeats($input1, $input2);\n\n $this->assertEquals(2, $result);\n }",
"function testIdenticalFieldValue() {\r\n\t\t\r\n\t\t$this->User->validate = array(\r\n\t\t\t\t\t\t'originalField' => array(\r\n\t\t\r\n\t\t\t\t\t\t\t'compare' => array(\r\n\t\t\t\t\t\t\t\t'rule' => array('identicalFieldValues', 'compareField' ), \r\n\t\t\t\t\t\t\t\t'message' => 'error message',\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t),\r\n\t\t\r\n\t\t\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t);\r\n\t\t\r\n\t\t$this->User->set(array('originalField' => 'abc', 'compareField' => 'abc'));\r\n\t\t$this->assertTrue($this->User->validates());\r\n\t\t\r\n\t\t$this->User->set(array('originalField' => 'abc', 'compareField' => 'axc'));\r\n\t\t$this->assertFalse($this->User->validates());\r\n\t\t\r\n\r\n\t}",
"function test_countRepeats_twoWordsOneMatch()\n {\n $test_RepeatCounter = new RepeatCounter();\n $input1 = \"dog\";\n $input2 = \"cat dog\";\n\n $result = $test_RepeatCounter->countRepeats($input1, $input2);\n\n $this->assertEquals(1, $result);\n }",
"public function testSuppressDuplicate()\n {\n\n }",
"public function myTestRule() {\n\t\treturn false;\n\t}",
"public function testBowlingAllOnes()\n {\n $this->bowling->rollMany(20, 1);\n $this->assertEquals(20, $this->bowling->getScore());\n }",
"function same($a, $b) {\r\n\t\treturn ($this->arc->expandPName ( $a ) == $this->arc->expandPName ( $b ));\r\n\t}",
"public static function identicalTo($value)\n {\n return Hamcrest_Core_IsIdentical::identicalTo($value);\n }",
"public static function sameInstance($object)\n {\n return Hamcrest_Core_IsSame::sameInstance($object);\n }",
"function areEquals($x, $y){\n\n }",
"public function true_is_true()\n{\n return $this->assertTrue(true);\n}",
"public function testEquals(): void\n {\n $validator = new Validator();\n $this->assertProxyMethod($validator, 'equals', 5, [Validation::COMPARE_EQUAL, 5], 'comparison');\n $this->assertEmpty($validator->validate(['username' => 5]));\n $this->assertNotEmpty($validator->validate(['username' => 6]));\n\n $fieldName = 'field_name';\n $rule = 'equals';\n $expectedMessage = 'The provided value must be equal to `5`';\n $equalTo = 5;\n $this->assertValidationMessage($fieldName, $rule, $expectedMessage, $equalTo);\n }",
"function test_countRepeats_twoWordMatch()\n {\n $test_RepeatCounter = new RepeatCounter();\n $input1 = \"frog\";\n $input2 = \"The frog in the hat was a bothersome frog\";\n\n $result = $test_RepeatCounter->countRepeats($input1, $input2);\n\n $this->assertEquals(2, $result);\n }",
"function test_makeGame_userScissorsWins()\n {\n //Arrange\n $test_Game = new Game;\n $user = \"scissors\";\n $comp = \"paper\";\n $is_random = false;\n\n //Act\n $result = $test_Game->makeGame($user, $comp, $is_random);\n\n //Assert\n $this->assertEquals(\"You win!\", $result);\n\n\n }",
"public function allowSingleTest();"
] | [
"0.5981313",
"0.5684505",
"0.5647389",
"0.56089854",
"0.55554295",
"0.5389149",
"0.5380168",
"0.5270968",
"0.52534676",
"0.5221736",
"0.5221736",
"0.5221736",
"0.5221736",
"0.520222",
"0.5138378",
"0.5102563",
"0.50758386",
"0.5073277",
"0.5064205",
"0.50514066",
"0.50449336",
"0.50361377",
"0.5030385",
"0.5014329",
"0.4981703",
"0.4976831",
"0.4968099",
"0.49520582",
"0.49395555",
"0.49341244"
] | 0.7397737 | 0 |
Test that file path generation doesn't continuously append paths. | function testFilePathGeneration() {
$file = TESTS . 'cases' . DS . 'models' . DS . 'my_class.test.php';
$this->Task->Dispatch->expectNever('stderr');
$this->Task->Dispatch->expectNever('_stop');
$this->Task->setReturnValue('in', 'y');
$this->Task->expectAt(0, 'createFile', array($file, '*'));
$this->Task->bake('Model', 'MyClass');
$this->Task->expectAt(1, 'createFile', array($file, '*'));
$this->Task->bake('Model', 'MyClass');
$file = TESTS . 'cases' . DS . 'controllers' . DS . 'comments_controller.test.php';
$this->Task->expectAt(2, 'createFile', array($file, '*'));
$this->Task->bake('Controller', 'Comments');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function makeUnique()\n\t{\n\t\tif(file_exists($this->path))\n\t\t{\n // First get path info\n $info = pathinfo($this->path);\n\n // Use the directory and file name to form the full path without the extension\n $name = $info['dirname'] . '\\\\' . $info['filename'];\n\n // Get the extension\n $ext = $info['extension'];\n\n // If file exsists then prepend a random number.\n while(file_exists($name . '.' . $ext))\n {\n $name .= rand(0, 10);\n }\n\n $this->path = $name . '.' . $ext;\n\t\t}\n\t}",
"public function testIfPathEndsWithSlash() {\n\t\t$images = Tx_CzSimpleCal_Utility_FileArrayBuilder::build('baz.jpg', 'foo/bar/');\n\t\t$image = current($images);\n\t\t$this->assertEquals('foo/bar/', $image->getPath(), 'ok if already finished with slash');\n\t\t\n\t\t$images = Tx_CzSimpleCal_Utility_FileArrayBuilder::build('baz.jpg', 'foo/bar');\n\t\t$image = current($images);\n\t\t$this->assertEquals('foo/bar/', $image->getPath(), 'ok if not finished with slash');\n\t\t\n\t\t$images = Tx_CzSimpleCal_Utility_FileArrayBuilder::build('baz.jpg', '/foo/bar/');\n\t\t$image = current($images);\n\t\t$this->assertEquals('/foo/bar/', $image->getPath(), 'leading slash is not removed');\n\t\t\n\t}",
"public function testProperCreation() : void\n {\n\n $path = new Path('config/');\n\n $this->assertTrue($path->isExisting());\n $this->assertFalse($path->isNotExisting());\n $this->assertTrue($path->isDir());\n $this->assertFalse($path->isNotDir());\n $this->assertFalse($path->isFile());\n $this->assertTrue($path->isNotFile());\n $this->assertEquals('config/', $path->getPath());\n }",
"public function testPath() {\n\t\t$this->assertEquals(APP_TEMP . 'io/file', $this->object->path());\n\t\t$this->assertEquals(APP_TEMP . 'io/temp', $this->temp->path());\n\t}",
"public function testIfCreationOfDirectPathWorks() : void\n {\n\n // Lvd.\n $pathString = '/config';\n\n // Create Path.\n $path = new Path($pathString);\n\n // Check if deletion was ignored.\n $this->assertEquals($pathString, $path->getPath());\n }",
"public function testIfCreationAndDeletionWorks() : void\n {\n\n // Lvd.\n $pathString1 = 'config/creationTest/deep/deeper/target/' . rand(1000, 9999);\n $pathString2 = 'config/creationTest';\n $pathString3 = 'config';\n\n // Create Path.\n $path = new Path($pathString1);\n $path->createDirs(true);\n\n // Check if exists.\n $this->assertTrue(file_exists($pathString1));\n\n // Call to delete everything below config/ and leave config intact.\n $path->deleteEmptyDirs(1);\n\n // Check if deletion was proper.\n $this->assertFalse(file_exists($pathString1));\n $this->assertFalse(file_exists($pathString2));\n $this->assertTrue(file_exists($pathString3));\n\n // Call again to delete - nothing should be changed but it should work.\n $path->deleteEmptyDirs(1);\n\n // Check if worked.\n $this->assertFalse(file_exists($pathString1));\n $this->assertFalse(file_exists($pathString2));\n $this->assertTrue(file_exists($pathString3));\n }",
"public function testManyWritesButInAppendMode()\n {\n $testString = 'XXX';\n $testFileName = $this->getTempFileName('FileTesting.txt');\n $testfile = File::create($testFileName)->appendMode();\n $testfile->write($testString)->save();\n $testfile->write('iii')->save();\n $testfile->write('ABCDEFG')->save();\n $this->assertFileExists($testFileName, 'Unable to create or save file');\n $this->assertEquals('XXXiiiABCDEFG', file_get_contents($testFileName), 'Unable to write successfully');\n }",
"protected function generateFilePaths()\n {\n $this->validateStoragePath();\n\n $path = $this->storagePath . DIRECTORY_SEPARATOR;\n\n if (! isset($this->prefix) || is_null($this->prefix)) {\n $this->prefix = '';\n }\n\n if (! isset($this->uniqid) || is_null($this->uniqid)) {\n $this->uniqid = uniqid($this->prefix, true);\n }\n\n $this->headerPath = $path . 'header-' . $this->uniqid . '.html';\n\n $this->footerPath = $path . 'footer-' . $this->uniqid . '.html';\n\n $this->contentPath = $path . 'content-' . $this->uniqid . '.html';\n\n $this->pdfPath = $path . 'pdf-' . $this->uniqid . '.pdf';\n }",
"public function testValidPath2() {\n $path = DATA_DIR.'templates';\n AbstractTemplate::setPath($path);\n $this->assertNotSame($path, AbstractTemplate::getPath());\n $this->assertSame(\"$path/\", AbstractTemplate::getPath());\n }",
"public function testLongWayToCreateFile()\n {\n $testString = 'This is just a string';\n $testFileName = $this->getTempFileName('GAAnotherFileToTest.txt');\n $file = new File;\n $file->setFileName($testFileName);\n $file->write($testString);\n $file->save();\n $this->assertFileExists($testFileName, 'Unable to create file');\n $this->assertEquals($testString, file_get_contents($testFileName), 'Contents of file is not correct');\n }",
"public function testRaiseExceptionWhenTheFileAlreadyExists()\n {\n $testString = 'nananananana';\n $testFileName = $this->getTempFileName('nanana.txt');\n File::create($testFileName)->write($testString)->save();\n $this->setExpectedException(\n 'Asar\\FileSystem\\FileAlreadyExistsException',\n \"File::create failed. The file '$testFileName' already exists.\"\n );\n File::create($testFileName);\n }",
"public function testIfCreationOfDirBelowFileThrows() : void\n {\n\n // Prepare.\n $this->expectException(ClassFopException::class);\n\n // Lvd.\n $dir = dirname(__DIR__);\n $dir = str_replace('\\\\', '/', $dir);\n $dir = $dir . '/src/Dir.php/hello';\n\n // Create Path.\n $path = new Path($dir);\n }",
"public function test_fixRelativeCssPaths() {\r\n\t\t$folder = t3lib_extMgm::siteRelPath ( 'js_css_optimizer' ) . 'tests/hooks/fixtures/';\r\n\t\t$jsLibs = array ();\r\n\t\t$jsFiles = array ();\r\n\t\t$jsFooterFiles = array ();\r\n\t\t$cssFiles = array (\t$folder . 'testpath1.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath2.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath3.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath4.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath5.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath6.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath7.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath8.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath9.css' => array (),\r\n\t\t\t\t\t\t\t$folder . 'testpath10.css' => array ());\r\n\t\t$args = array ('jsLibs' => &$jsLibs, 'jsFiles' => &$jsFiles, 'jsFooterFiles' => &$jsFooterFiles, 'cssFiles' => &$cssFiles );\r\n\t\t$this->concatenateHandler->process ( $args );\r\n\t\t$this->assertEquals ( 1, count ( $cssFiles ) );\r\n\t\tforeach ( array_keys ( $cssFiles ) as $cssFile ) {\r\n\t\t\t$path = PATH_site . $cssFile;\r\n\t\t\t$this->assertTrue ( file_exists ( $path ) );\r\n\t\t\t$content = file_get_contents ( $path );\r\n\r\n\t\t\t$this->assertContains ( '/fixtures/../images/test1.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/images/test2.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/test3.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/test5.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/../../images/test4.gif', $content );\r\n\t\t\t$this->assertContains ( \"'/typo3conf/ext/js_css_optimizer/tests/hooks/fixtures/../img/indicator.gif'\", $content, $content );\r\n\t\t\t$this->assertContains ( \"/typo3conf/ext/js_css_optimizer/tests/hooks/fixtures/../img/indicator7.gif\", $content, $content );\r\n\t\t\t$this->assertContains ( \"/typo3conf/ext/js_css_optimizer/tests/hooks/fixtures/indicator8.htc\", $content, $content );\r\n\t\t\t$this->assertContains ( \"/typo3conf/ext/js_css_optimizer/tests/hooks/fixtures/../img/indicator9.gif\", $content, $content );\r\n\t\t\t$this->assertContains ( \"url(\\\"/typo3conf/ext/js_css_optimizer/tests/hooks/fixtures/images/footer-notes-arrow.gif\\\")\", $content, $content );\r\n\t\t}\r\n\t}",
"protected function ensureTestFilePath()\n {\n $path = $this->getTestFilePath();\n $this->getFileSystem()->makeDirectory($path);\n\n return $path;\n }",
"function test_disk_create_delete_files($base) {\n $iters = $base * 10;\n test_start(__FUNCTION__);\n\n do {\n $tmp_filename = tempnam('/tmp', 'phpbench');\n create_delete_temp_file($tmp_filename);\n } while (--$iters !== 0);\n\n return test_end(__FUNCTION__);\n}",
"public function test_EXT_paths() {\r\n\t\t$folder = 'EXT:js_css_optimizer/tests/hooks/fixtures/';\r\n\t\t$jsLibs = array ();\r\n\t\t$jsFiles = array ();\r\n\t\t$jsFooterFiles = array ();\r\n\t\t$cssFiles = array ($folder . 'testpath1.css' => array (), $folder . 'testpath2.css' => array (), $folder . 'testpath3.css' => array (), $folder . 'testpath4.css' => array () );\r\n\t\t$args = array ('jsLibs' => &$jsLibs, 'jsFiles' => &$jsFiles, 'jsFooterFiles' => &$jsFooterFiles, 'cssFiles' => &$cssFiles );\r\n\t\t$this->concatenateHandler->process ( $args );\r\n\t\t$this->assertEquals ( 1, count ( $cssFiles ) );\r\n\t\tforeach ( array_keys ( $cssFiles ) as $cssFile ) {\r\n\t\t\t$path = PATH_site . $cssFile;\r\n\t\t\t$this->assertTrue ( file_exists ( $path ) );\r\n\t\t\t$content = file_get_contents ( $path );\r\n\t\t\t$this->assertContains ( '/fixtures/../images/test1.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/images/test2.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/test3.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/../../images/test4.gif', $content );\r\n\t\t}\r\n\t}",
"public function testGenerateLocalFilePath()\n {\n $localPath = $this->imageCachingManager->generateLocalFilePath(self::IMAGE_URL, self::RECORD_ID);\n\n $this->assertEquals('/var/www/project/public/cache/1/funny-games-1997-1S-KA-to-KP4.jpg', $localPath);\n }",
"public function testPathInRestricted() {\n $cur_path = $this->current_path;\n $paths = [\n '/test',\n '/test2',\n $cur_path,\n '/test3',\n ];\n $this->rule->set('paths', $paths);\n\n $this->matcher->expects($this->exactly(3))\n ->method('matchPath')\n ->withConsecutive(...array_map(function($p) use ($cur_path) { return [$cur_path, $p]; }, $paths))\n ->willReturnOnConsecutiveCalls(FALSE, FALSE, TRUE, FALSE);\n\n $this->rule->expects($this->once())->method('getMatcher')->willReturn($this->matcher);\n $this->rule->expects($this->never())->method('getRule');\n\n $this->assertTrue($this->rule->assert());\n }",
"public function testEqualsFilePath()\n {\n $this->assertEquals($this->getTestFilePath(), $this->file->getPath());\n }",
"public function testValidPath1() {\n $path = DATA_DIR.'templates/';\n AbstractTemplate::setPath($path);\n $this->assertSame($path, AbstractTemplate::getPath());\n }",
"public function test_performing() {\n $this->file->update('Write to file');\n $this->assert_equal($this->file->load(), 'Write to file');\n\n $this->file->append(\"\\nAppend text\");\n $this->assert_equal($this->file->load(), \"Write to file\\nAppend text\");\n }",
"#[@test]\n public function composingFromFolderAndString() {\n $fn= $this->fileKnownToExist();\n $this->assertEquals($fn, create(new File(new Folder(dirname($fn)), basename($fn)))->getURI());\n }",
"public function testInvalidPath() {\n AbstractTemplate::setPath(DATA_DIR.'no-templates');\n }",
"public function testManyWritesOverwritesPreviousContent()\n {\n $testString = 'XXX';\n $testFileName = $this->getTempFileName('FileTesting.txt');\n $testfile = File::create($testFileName);\n $testfile->write($testString)->save();\n $testfile->write('iii')->save();\n $testfile->write('ABCDEFG')->save();\n $this->assertFileExists($testFileName, 'Unable to create or save file');\n $this->assertEquals('ABCDEFG', file_get_contents($testFileName), 'Unable to write successfully');\n }",
"public function testFoldersInsertDocnumbers()\n {\n }",
"public function testCanSetPath()\n {\n $reader= new GitHashReader(new Filesystem(), __DIR__ . '/stubs', 'git-mock');\n\n $this->assertSame(__DIR__ . '/stubs/git-mock', $reader->getPath());\n }",
"function create_unique_filename($target_dir,$filename)\n {\n $now = time();\n while ( file_exists($result = $target_dir . $now.'-'.$filename))\n {\n $now++;\n }\n return $result;\n }",
"public function testRecursiveDirectoryDelete() {\n $unt = new UnitTestSupport();\n $this->assertInstanceOf(UnitTestSupport::class,$unt);\n $this->lastUnit = $unt;\n $exp1 = '../../test/tmp';\n $tmpdir1 = $unt->getTmpDirRoot();\n $this->assertStringEndsWith($exp1,$tmpdir1);\n $tmpdir2 = __DIR__ . '/tmp';\n $unt->setTmpDirRoot($tmpdir2);\n $this->assertEquals($tmpdir2,$unt->getTmpDirRoot());\n $tmproot = $unt->createTmpRootDir();\n $this->assertGreaterThan(0,strlen($tmproot));\n $dircnt1 = count($unt->getTmpDirsCreated());\n # make a specific tmp subdir\n $subdir1 = $unt->createTmpSubDir(\"bork\");\n $this->assertStringEndsWith(\"bork\",$subdir1);\n $expcnt2 = $dircnt1 + 1;\n $cDirs = $unt->getTmpDirsCreated();\n $this->assertEquals($expcnt2,count($cDirs));\n $tst = in_array($subdir1,$cDirs);\n # make a random tmp subdir\n $subdir2 = $unt->createTmpSubDir();\n $expcnt3 = $expcnt2 + 1;\n $cDirs = $unt->getTmpDirsCreated();\n $this->assertEquals($expcnt3,count($cDirs));\n $tst = in_array($subdir2,$cDirs);\n # create a temp dummy file\n $file1 = \"$subdir2/borkbork.bork\";\n $dummy = \"bork\\n\";\n $file1a = $unt->createTmpDummyFile($file1,$dummy,100);\n $this->assertEquals($file1,$file1a);\n # create a rogue file\n $fh = fopen($file1a,\"r\");\n $line1 = fgets($fh);\n fclose($fh);\n $this->assertEquals($dummy,$line1);\n # create a rogue subdir\n $rogueDir = \"$subdir2/rogue\";\n mkdir($rogueDir);\n # test cleanup\n $saveFiles = $unt->getTmpFilesCreated();\n $saveDirs = $unt->getTmpDirsCreated();\n $xtraFile = \"$subdir2/xtra.tmp\";\n $fh = fopen($xtraFile,\"w\");\n fclose($fh);\n $unt->cleanupTmp();\n foreach($saveFiles as $file) {\n $this->assertFileNotExists($file);\n }\n foreach($saveDirs as $dir) {\n $this->assertFileNotExists($dir);\n }\n $this->lastUnit = null;\n }",
"public function testHashDir1()\n {\n $dir = FileSystem::getHashDir(1);\n $expected = '1-10000';\n PHPUnit_Framework_Assert::assertEquals($expected, $dir);\n\n }",
"public function testMakeDirFailsIfAlreadyExists ()\n {\n $hdfs = $this->getMock('\\\\Hdfs\\\\Web', array('stat'));\n $hdfs->expects($this->once())\n ->method('stat')\n ->with(self::REMOTE_DIR);\n\n $hdfs->makeDir(self::REMOTE_DIR);\n }"
] | [
"0.62682474",
"0.61222255",
"0.6101571",
"0.6098786",
"0.60449517",
"0.59649646",
"0.578117",
"0.57565403",
"0.56758916",
"0.56725466",
"0.5645219",
"0.5613808",
"0.5597894",
"0.5591385",
"0.55862176",
"0.5546121",
"0.5541253",
"0.5533644",
"0.55228597",
"0.54872745",
"0.54247314",
"0.5417873",
"0.5398179",
"0.53931373",
"0.53876066",
"0.53864765",
"0.5384615",
"0.53754383",
"0.53733766",
"0.53691024"
] | 0.6710272 | 0 |
Test that method introspection pulls all relevant non parent class methods into the test case. | function testMethodIntrospection() {
$result = $this->Task->getTestableMethods('TestTaskArticle');
$expected = array('dosomething', 'dosomethingelse');
$this->assertEqual(array_map('strtolower', $result), $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCoverAllMethods()\n\t{\n\t\t$testTarget = preg_replace('/Test$/', '', get_class($this));\n\t\t$cover = new CoverAllMethod();\n\t\t$uncoveredMethods = $cover->getUncoveredMethods($this, $testTarget);\n\n\t\tif ( count($uncoveredMethods) > 0 )\n\t\t{\n\t\t\t$this->markTestIncomplete(sprintf(\"This test case is missing tests for class: %s\\n * %s()\", $testTarget, implode(\"()\\n * \", $uncoveredMethods)));\n\t\t}\n\t}",
"public function test_instance_methods() {\n\n\t\t$this->assertFileUsesMethod(\n\t\t\tarray(\n\t\t\t\t'name' => 'update',\n\t\t\t\t'line' => 5,\n\t\t\t\t'end_line' => 5,\n\t\t\t\t'class' => '$wpdb',\n\t\t\t\t'static' => false,\n\t\t\t)\n\t\t);\n\n\t\t$this->assertFunctionUsesMethod(\n\t\t\t'test'\n\t\t\t, array(\n\t\t\t\t'name' => 'call_method',\n\t\t\t\t'line' => 10,\n\t\t\t\t'end_line' => 10,\n\t\t\t\t'class' => 'get_class()',\n\t\t\t\t'static' => false,\n\t\t\t)\n\t\t);\n\n\t\t$this->assertMethodUsesMethod(\n\t\t\t'My_Class'\n\t\t\t, 'static_method'\n\t\t\t, array(\n\t\t\t\t'name' => 'go',\n\t\t\t\t'line' => 18,\n\t\t\t\t'end_line' => 18,\n\t\t\t\t'class' => '\\My_Class',\n\t\t\t\t'static' => false,\n\t\t\t)\n\t\t);\n\t}",
"public function setUp() {\n $this->php_fctM1 = new ReflectionMethod( 'TestMethods', 'm1' );\n $this->php_fctM2 = new ReflectionMethod( 'TestMethods', 'm2' );\n $this->php_fctM3 = new ReflectionMethod( 'TestMethods', 'm3' );\n $this->php_fctM4 = new ReflectionMethod( 'TestMethods', 'm4' );\n $this->php_fct_method_exists = new ReflectionMethod( 'ReflectionClass', 'hasMethod' );\n\n $this->setUpFixtures();\n }",
"public function testGetMethods()\n {\n $this->assertEquals([self::VALID_METHOD], $this->testConstruct()->getMethods());\n }",
"public function testMethodDoesNotExist() {\n $reflectionClass = new \\ReflectionClass($this->form);\n $this->assertFalse($reflectionClass->hasMethod(self::METHOD));\n }",
"public function testLookupAspects()\n {\n }",
"private function determineMethods() {\n include_once($this->makeFilePath);\n $parent = get_parent_class(ucfirst($this->curClass));\n\n // only secured classes\n if ($parent != 'MM_Controller') {\n unset($this->classMethods[$this->curClass]);\n return;\n }\n\n // get methods\n $class_methods = get_class_methods(ucfirst($this->curClass));\n \n if (!count($class_methods)) return;\n\n foreach ($class_methods as $m) {\n if ($m == '__construct' || $m == 'index' || $m == 'get_instance' || strpos($m,'_') === 0) continue;\n\n $this->classMethods[$this->curClass][] = $m;\n }\n\n }",
"public function test_TraitBuilder_hasMethod_getMethods() {\n $this->assertTrue(method_exists($this->obj, 'getMethods'));\n }",
"public function testNestedInMethod()\n {\n $token = $this->getTargetToken('/* testNestedInMethod */', T_FN);\n $this->backfillHelper($token);\n $this->scopePositionTestHelper($token, 5, 17);\n\n }",
"public function getCoveredMethods()\n {\n return $this->getMethodCoverageIterator()->getCoveredMethods();\n }",
"public function testReflection() {\n $this->assertInstanceOf('ReflectionClass', $this->object->reflection());\n }",
"public function test_TraitBuilder_hasMethod_getProperties() {\n $this->assertTrue(method_exists($this->obj, 'getProperties'));\n }",
"public function getUnCoveredMethods()\n {\n return $this->getMethodCoverageIterator()->getUnCoveredMethods();\n }",
"public function testLookupPointcuts()\n {\n }",
"public function getMethods() {}",
"protected function extractMethods()\n {\n foreach ($this->refClass->getMethodsByMatcher(self::$methodAndPropertyMatcher) as $method) {\n $this->methods[$method->getName()] = $this->createSerializerDelegate($method, $method->getName());\n }\n }",
"public function testGetAdvicesForDoesNotReturnAdvicesThatAreNotRegisteredForTheProvidedMethod()\n {\n $this->manager->register($this->createAspect());\n $advices = $this->manager->getAdvicesFor('User::save');\n $this->assertInstanceOf('AspectPHP_Advisor_Container', $advices);\n // The beforeLogMethodsAdvice() should not match the method.\n $this->assertEquals(0, count($advices->before()));\n }",
"public function testGetClasses()\r\n\t{\r\n\t}",
"abstract public function getNumTestedMethods(): int;",
"public function testMethods() {\n $methods = [\n 'publicMethod', 'protectedMethod', 'privateMethod', 'staticPublicMethod', 'staticProtectedMethod', 'staticPrivateMethod',\n 'serialize', 'unserialize', 'jsonSerialize', 'initialize', 'noop', 'toString', '__toString', '__construct', 'allCache',\n 'getCache', 'setCache', 'toggleCache', 'removeCache', 'hasCache', 'createCacheKey', 'flushCache', 'cache',\n 'addConfig', 'allConfig', 'applyConfig', 'setConfig', 'getConfig', 'getConfigAugment', 'removeConfig', 'hasConfig',\n 'inform', 'loadInfo', 'getInfoAugment'\n ];\n\n $this->assertArraysEqual($methods, $this->object->methods);\n $this->assertArraysEqual($methods, $this->object->methods());\n }",
"abstract protected function methods();",
"abstract protected function methods();",
"public function test_likePrototypeGetReview() {\n\n }",
"public function readMethodMetaData()\n {\n /** @var Inspector\\AnnotationsList|Inspector\\AnnotationInterface[] $tags */\n $tags = $this->_inspector->getMethodAnnotations('start');\n $this->assertEquals('\\Exception', $tags->getAnnotation('@throws')->getValue());\n $this->assertEquals('boolean The car state', $tags['return']->getValue());\n $this->assertEquals(0, count($this->_inspector->getMethodAnnotations('stop')));\n $this->_inspector->getMethodAnnotations('_unknown');\n }",
"public function canManipulateMethods () {\n $spy = $this->spy( 'Sliver\\Tests\\Spy\\Bomb' );\n $spy->summon()->stub( '__construct', function () { echo 'DEFUSED'; } );\n $this->shouldOutput( 'DEFUSED' );\n $spy->summon()->construct();\n \n // Can replace then call a private function\n $spy = $this->spy( 'Sliver\\Tests\\Spy\\Secret', array( 200 ) );\n $spy->summon()->stub( 'inc', function () { $this->x *= 2; return $this; } );\n $spy->inc();\n $this->assert( $spy->x )->eq( 400 );\n }",
"public function testWithoutHookTrait()\n {\n $m = new DynamicMethodWithoutHookMock();\n $this->assertEquals(false, $m->hasMethod('sum'));\n\n $this->assertEquals($m, $m->removeMethod('sum'));\n }",
"public function test_case_method_frames()\n {\n $class = $this->getReflector()->reflectClassLike(ClassName::fromString(TestCase::class));\n\n /** @var $method ReflectionMethod */\n foreach ($class->methods() as $method) {\n $method->frame();\n }\n }",
"public function testIfGetFilesMethodIsAccessible(): void\n {\n $method = new \\ReflectionMethod($this->orphanage, 'getFiles');\n $this->assertTrue($method->isPublic());\n }",
"public function getMethodCalls();",
"public function testNoSettersForKeyFields() {\n $this->assertTrue(method_exists(\"Comment\", \"getTripId\"),\n \"getTripId() exists\");\n $this->assertFalse(method_exists(\"Comment\", \"setTripId\"),\n \"setTripId() does not exist\");\n $this->assertTrue(method_exists(\"Comment\", \"getCommentId\"),\n \"getCommentId exists\");\n $this->assertFalse(method_exists(\"Comment\", \"setCommentId\"),\n \"setCommentId does not exist\");\n }"
] | [
"0.6447127",
"0.618555",
"0.61754835",
"0.6093251",
"0.5818132",
"0.58112884",
"0.58098245",
"0.5798111",
"0.5792547",
"0.57392794",
"0.5718913",
"0.57141095",
"0.5687391",
"0.5671714",
"0.5655093",
"0.56415105",
"0.5623196",
"0.56206566",
"0.56153995",
"0.5590632",
"0.5567609",
"0.5567609",
"0.5555727",
"0.555289",
"0.55518395",
"0.5541058",
"0.55316234",
"0.54706997",
"0.5468391",
"0.5452105"
] | 0.7078879 | 0 |
creating test subjects should clear the registry so the registry is always fresh | function testRegistryClearWhenBuildingTestObjects() {
ClassRegistry::flush();
$model = ClassRegistry::init('TestTaskComment');
$model->bindModel(array(
'belongsTo' => array(
'Random' => array(
'className' => 'TestTaskArticle',
'foreignKey' => 'article_id',
)
)
));
$keys = ClassRegistry::keys();
$this->assertTrue(in_array('random', $keys));
$object =& $this->Task->buildTestSubject('Model', 'TestTaskComment');
$keys = ClassRegistry::keys();
$this->assertFalse(in_array('random', $keys));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(self::TEST_SUBJECT_CLASSNAME, $subject, 'A valid instance of the test subject could not be created.');\n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(static::TEST_SUBJECT_CLASSNAME, $subject, 'Could not create a valid instance');\n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(static::TEST_SUBJECT_CLASSNAME, $subject, 'A valid instance of the test subject could not be created');\n $this->assertInstanceOf('Psr\\Container\\ContainerInterface', $subject, 'Subject does not implement required interface');\n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Output\\TemplateInterface',\n $subject,\n 'Test subject does not implement expected parent interface.'\n );\n }",
"public function testGetRegistrationInstances()\n {\n }",
"public function testReRegister()\r\n {\r\n $correctData = $this->getCorrectData();\r\n $result = $this->Engines->register($correctData['hostname'], $correctData['pid'], $correctData['host_session_key'], $correctData['port']);\r\n $this->assertTrue($result);\r\n $result = $this->Engines->register($correctData['hostname'], $correctData['pid'], $correctData['host_session_key'], $correctData['port']);\r\n $this->assertFalse($result);\r\n }",
"public function clearTests()\n {\n $this->tests->clear();\n }",
"protected function tearDown() {\n\t\t$this->_clearRegistry();\n\t}",
"public function testDeleteRegistrationGlobalData()\n {\n }",
"public function testCreateNewRegistrationInstance()\n {\n }",
"public function testNonExistanceOfMessageSubject()\n {\n\n $senderuser = User::storeUser([\n 'username' => 'testo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n $token = auth()->login($senderuser);\n $headers = [$token];\n\n $receiveruser = User::storeUser([\n 'username' => 'testoo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n \n\n $message= Message::createDummyMessage($senderuser->username, $receiveruser->username, 'test_hii', 'test_subject');\n\n $this->json('POST', 'api/v1/auth/sendMessage', ['rec_username'=> $receiveruser->username,\n 'msg_content'=> 'test_hii'], $headers)\n ->assertStatus(403)\n ->assertJson([\n \"success\" => \"false\",\n \"error\" => \"message must have a subject\"\n ]);\n\n $this->json('POST', 'api/v1/auth/sendMessage', ['rec_username'=> $receiveruser->username,\n 'msg_content'=> 'test_hii',\n 'msg_subject'=> ''], $headers)\n ->assertStatus(403)\n ->assertJson([\n \"success\" => \"false\",\n \"error\" => \"message must have a subject\"\n ]); \n \n \n\n $senderuser->delete();\n $receiveruser->delete();\n \n }",
"public function testGetStoresAssignedToChannel()\n {\n }",
"protected function tearDown()\n {\n $this->subject = null;\n\n parent::tearDown();\n }",
"protected function tearDown()\n {\n unset(\n $this->subject,\n $this->messageHelperProphecy\n );\n parent::tearDown();\n }",
"public function testGetSetMonitoringSubject()\n {\n $fake_monitoring = new Monitoring;\n $fake_subject = \"UED Lab. MOCAP\";\n $fake_monitoring->setMonitoringSubject($fake_subject);\n $this->assertEquals($fake_subject, $fake_monitoring\n ->getMonitoringSubject());\n }",
"protected function tearDown(): void\n\t{\n\t\t// remove temporary test data\n\t\trequire_once(SUBSDIR . '/Topic.subs.php');\n\t\tremoveTopics($this->id_topic); // it'll remove the poll too, if any\n\t}",
"protected function tearDown()\n {\n\t\tCAS_TestHarness_DummyRequest::clearResponses();\n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType('object', $subject, 'A valid instance of the test subject could not be created');\n }",
"protected function setUp()\n {\n $this->mcugId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:catalog/MCUG');\n $this->miisId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:catalog/MIIS');\n $this->unknownId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:unknown_id');\n \n $this->manager = $this->sharedFixture['CourseManager'];\n $this->session = $this->manager->getCourseSearchSessionForCatalog($this->mcugId);\n \n $this->wildcardStringMatchType = new phpkit_type_URNInetType(\"urn:inet:middlebury.edu:search:wildcard\");\n \n $this->query = $this->session->getCourseQuery();\n $this->query->matchNumber('*0*', $this->wildcardStringMatchType, true);\n \n $this->search = $this->session->getCourseSearch();\n \n $this->object = $this->session->getCourseSearchOrder();\n \n $this->physId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:course/PHYS0201');\n $this->geolId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:course/GEOL0250');\n $this->unknownId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:course/XXXX0101');\n \n $this->deptTopicId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:topic/department/PHYS');\n $this->subjTopicId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:topic/subject/CHEM');\n $this->divTopicId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:topic/division/NSCI');\n \n $this->unknownType = new phpkit_type_URNInetType(\"urn:inet:osid.org:unknown_type\");\n \t\n $this->generaNoneType = new phpkit_type_URNInetType(\"urn:inet:osid.org:genera:none\");\n $this->secondaryType = new phpkit_type_URNInetType(\"urn:inet:osid.org:genera:secondary\");\n $this->undergraduateType = new phpkit_type_URNInetType(\"urn:inet:osid.org:genera:undergraduate\");\n \n $this->instructorsType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:instructors');\n\t\t$this->otherType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:other');\n \n \n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }",
"public function testSubject()\n {\n $settingsDir = TEST_ROOT .'/settings/';\n include $settingsDir.'settings1.php';\n\n $settings = new OneLogin_Saml2_Settings($settingsInfo);\n $authnRequest = new OneLogin_Saml2_AuthnRequest($settings);\n $encodedRequest = $authnRequest->getRequest();\n $decoded = base64_decode($encodedRequest);\n $request = gzinflate($decoded);\n $this->assertNotContains('<saml:Subject', $request);\n\n $authnRequest2 = new OneLogin_Saml2_AuthnRequest($settings, false, false, true, \"[email protected]\");\n $encodedRequest2 = $authnRequest2->getRequest();\n $decoded2 = base64_decode($encodedRequest2);\n $request2 = gzinflate($decoded2);\n $this->assertContains('<saml:Subject', $request2);\n $this->assertContains('Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified\">[email protected]</saml:NameID>', $request2);\n $this->assertContains('<saml:SubjectConfirmation Method=\"urn:oasis:names:tc:SAML:2.0:cm:bearer\">', $request2);\n\n $settingsInfo['sp']['NameIDFormat'] = \"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\";\n $settings = new OneLogin_Saml2_Settings($settingsInfo);\n $authnRequest3 = new OneLogin_Saml2_AuthnRequest($settings, false, false, true, \"[email protected]\");\n $encodedRequest3 = $authnRequest3->getRequest();\n $decoded3 = base64_decode($encodedRequest3);\n $request3 = gzinflate($decoded3);\n $this->assertContains('<saml:Subject', $request3);\n $this->assertContains('Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\">[email protected]</saml:NameID>', $request3);\n $this->assertContains('<saml:SubjectConfirmation Method=\"urn:oasis:names:tc:SAML:2.0:cm:bearer\">', $request3);\n }",
"public function run()\n {\n $subjects = factory(Subject::class)\n ->times(10)\n ->make();\n\n Subject::insert($subjects->toArray());\n }",
"protected function tearDown()\n {\n unset($this->extConf, $this->googleRequestService, $this->subject);\n parent::tearDown();\n }",
"public function testGetRegistrations()\n {\n }",
"protected function setUp()\n {\n $this->mcugId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:catalog/MCUG');\n $this->miisId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:catalog/MIIS');\n $this->unknownId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:unknown_id');\n \n $this->manager = $this->sharedFixture['CourseManager'];\n $this->session = $this->manager->getCourseSearchSessionForCatalog($this->mcugId);\n \n $this->physId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:course/PHYS0201');\n $this->geolId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:course/GEOL0250');\n $this->unknownId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:course/XXXX0101');\n \n $this->deptTopicId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:topic/department/PHYS');\n $this->subjTopicId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:topic/subject/CHEM');\n $this->divTopicId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:topic/division/NSCI');\n \n $this->unknownType = new phpkit_type_URNInetType(\"urn:inet:osid.org:unknown_type\");\n \t\n $this->generaNoneType = new phpkit_type_URNInetType(\"urn:inet:osid.org:genera:none\");\n $this->secondaryType = new phpkit_type_URNInetType(\"urn:inet:osid.org:genera:secondary\");\n $this->undergraduateType = new phpkit_type_URNInetType(\"urn:inet:osid.org:genera:undergraduate\");\n \n $this->wildcardStringMatchType = new phpkit_type_URNInetType(\"urn:inet:middlebury.edu:search:wildcard\");\n }",
"public function testRegisterNewDomain()\n {\n }",
"public function testRegisterPeriodiekeSchenking()\n {\n }",
"public static function test(){\n\t\t\n\t\n\t\t\n\t\tQCodes::updatePluginDB(\"KnowledgeItem/test_subjectcode-en.xml\");\n\t\tQCodes::updatePluginDB(\"KnowledgeItem/test_mediatopic.xml\");\n\t\t//QCodes::update(\"http://cv.iptc.org/newscodes/subjectcode?format=g2ki&lang=en-GB\"); // Max 10/hour (IPTC Controlled Vocabulary)\n\t\t\n\t\n\t}",
"public function testGetAssignedChannels()\n {\n }",
"public function testGetRegistry()\n {\n $this->assertArrayHasKey('IoCRegistryMockTestObject', \\Tinker\\Di\\IoCRegistry::registry());\n $this->assertArrayNotHasKey('IoCRegistryMockTestObjectXXXXXXXXXX', \\Tinker\\Di\\IoCRegistry::registry());\n }"
] | [
"0.59521526",
"0.58506376",
"0.5687376",
"0.56081617",
"0.5587418",
"0.55849105",
"0.55840445",
"0.55773914",
"0.555679",
"0.5486211",
"0.54518193",
"0.54316896",
"0.5424642",
"0.5376835",
"0.53722644",
"0.53683084",
"0.536707",
"0.5354957",
"0.532973",
"0.5329496",
"0.53032744",
"0.5294726",
"0.5292426",
"0.52885425",
"0.52739036",
"0.5271746",
"0.5269517",
"0.52560896",
"0.5251869",
"0.5251719"
] | 0.6252152 | 0 |
test that getClassName returns the user choice as a classname. | function testGetClassName() {
$objects = App::objects('model');
$skip = $this->skipIf(empty($objects), 'No models in app, this test will fail. %s');
if ($skip) {
return;
}
$this->Task->setReturnValueAt(0, 'in', 'MyCustomClass');
$result = $this->Task->getClassName('Model');
$this->assertEqual($result, 'MyCustomClass');
$this->Task->setReturnValueAt(1, 'in', 1);
$result = $this->Task->getClassName('Model');
$options = App::objects('model');
$this->assertEqual($result, $options[0]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testGetRealClassname() {\n\t\t$result = $this->Task->getRealClassname('Model', 'Post');\n\t\t$this->assertEqual($result, 'Post');\n\n\t\t$result = $this->Task->getRealClassname('Controller', 'Posts');\n\t\t$this->assertEqual($result, 'PostsController');\n\n\t\t$result = $this->Task->getRealClassname('Helper', 'Form');\n\t\t$this->assertEqual($result, 'FormHelper');\n\n\t\t$result = $this->Task->getRealClassname('Behavior', 'Containable');\n\t\t$this->assertEqual($result, 'ContainableBehavior');\n\n\t\t$result = $this->Task->getRealClassname('Component', 'Auth');\n\t\t$this->assertEqual($result, 'AuthComponent');\n\t}",
"public function testReturnClassName()\n {\n $this->assertEquals(Fixtures\\Foo::className(), 'foo');\n $this->assertEquals(Fixtures\\FooTest::className(), 'footest');\n }",
"abstract public static function getClassName();",
"public abstract function getClassName();",
"public function getClassName();",
"public function getClassName();",
"public function getClassName();",
"public function getClassName();",
"abstract public static function getClassName() : string;",
"function get_class_name();",
"public abstract function className();",
"public function getClassName()\n {\n }",
"public function testClassName() {\n $this->assertEquals('Titon\\Test\\Stub\\AugmentStub', $this->object->className);\n $this->assertEquals('Titon\\Test\\Stub\\AugmentStub', $this->object->className());\n }",
"public function getClassName(){\n \n $ret_str = '';\n \n if($type = $this->findType()){\n \n $ret_str = $this->findClassName($type);\n \n }//if\n \n return $ret_str;\n \n }",
"abstract protected function getClassUnderTest(): string;",
"public function testGetProviderClassName()\n {\n $reviews = new Reviews($this->config);\n $actualClassName = $reviews->getProviderClassName('reviews_io');\n $expectedClassName = 'PodPoint\\\\Reviews\\\\Providers\\\\ReviewsIo\\\\Provider';\n\n $this->assertEquals($expectedClassName, $actualClassName);\n }",
"protected function findClassName($type){\n \n // canary, a valid class name has to be the only thing in the type...\n if(mb_strpos($type,'|') !== false){ return ''; }//if\n \n $class_name = '';\n \n // only check non-builtin types...\n $regex = sprintf('#^(%s)$#i',join('|',$this->types));\n \n // make sure the var type is a class name...\n if((mb_strpos($type,'\\\\') !== false) || !preg_match($regex,$type)){\n \n $class_name = $type;\n \n }//if\n \n return $class_name;\n \n }",
"public function className(): string;",
"private static function getClassName() {\n $className = self::getCompleteClassName();\n $path = explode('\\\\', $className);\n\n return strtolower(array_pop($path));\n }",
"public function getClassName()\n {\n return $this->testimonialClass;\n }",
"protected function getClassName()\n {\n return ucfirst(Str::camel(basename($this->package)));\n }",
"public static function className( $class ) {\n if ( $postfix = strrchr( $class, \"\\\\\" ) )\n $class = substr( $postfix, 1 );\n if ( substr( $class, 0, strlen( \"SAM\" ) ) == \"SAM\" )\n $class = substr( $class, strlen( \"SAM\" ) );\n $class = str_replace( \"_\", \"\", $class );\n $name = urlencode( $class );\n $name = strtolower( $name );\n return $name;\n }",
"public static function className()\n {\n $className = get_called_class();\n // For namespaces: DaftSearch\\Query etc.\n if ($postfixName = strrchr($className, '\\\\')) {\n $className = substr($postfixName, 1);\n }\n // convert Camel case to underscore lowercase: SearchSale -> search_sale\n $name = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $className));\n return $name;\n }",
"public function getClass( $name );",
"public function getClassname(): string\n {\n return $this->classname;\n }",
"public function testActiveName()\n {\n $diceGame = new DiceGame();\n $this->assertInstanceOf(\"\\Chai17\\Dice\\DiceGame\", $diceGame);\n $diceGame->setPlayerName(\"Claes\");\n $res = $diceGame->getActiveName();\n $exp = \"string\";\n $this->assertInternalType($exp, $res);\n }",
"public function calledClassName();",
"public static function pick(string $class): string {\n return self::$names[$class];\n }",
"public function getClassname() {\n\t\t\treturn $this->$classname;\n\t\t}",
"protected function qualifyClass($name)\n {\n return $this->input->getArgument('name');\n }"
] | [
"0.75189495",
"0.73655313",
"0.7268759",
"0.71731657",
"0.69655406",
"0.69655406",
"0.69655406",
"0.69655406",
"0.6931955",
"0.67307734",
"0.66142106",
"0.6565938",
"0.649294",
"0.64329296",
"0.64223164",
"0.63996786",
"0.63460463",
"0.63134664",
"0.63063735",
"0.6273908",
"0.6141238",
"0.61221445",
"0.61049557",
"0.6002513",
"0.5993203",
"0.598429",
"0.59694415",
"0.5953108",
"0.5937411",
"0.5920392"
] | 0.76781255 | 0 |
Test the user interaction for defining additional fixtures. | function testGetUserFixtures() {
$this->Task->setReturnValueAt(0, 'in', 'y');
$this->Task->setReturnValueAt(1, 'in', 'app.pizza, app.topping, app.side_dish');
$result = $this->Task->getUserFixtures();
$expected = array('app.pizza', 'app.topping', 'app.side_dish');
$this->assertEqual($result, $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract function fixture();",
"public function testFixture()\n { \n //en la variable $this->ejemplos tenemos el contenido de nuetro fixture\n // y lo podemos usar en todos nuestros test, en este caso es un array de \n // de una posición\n $arrEjemploList = $this->ejemplos; \n //para acceder a la posición específica de un set de datos del fixture \n //retorna un array\n $arrFirstExample = $this->ejemplos['test1']; \n //si queremos obtener una instancia de ActiveRecord\n //obtiene un objeto AR\n $objFirstExample = $this->ejemplos('test1'); \n }",
"abstract protected function getFixtures();",
"protected function setUp ()\n {\n parent::setUp();\n $this->fixture = <<<EOF\n{\n \"tags\":[\"MLR\"],\n \"errorResponses\":[\n {\n \"code\":\"403\",\n \"reason\":\"User Not Authorized\"\n }\n ], \"parameters\":[],\n \"httpMethod\":\"GET\",\n \"responseClass\":\"List[leadresonder_route]\",\n \"summary\":\"Fetches the leadresponder corresponding the the provided ID\",\n \"responseTypeInternal\":\"Model_LeadResponder_RouteCollection\"\n}\nEOF;\n\n\n }",
"public function setUp()\n {\n $entityManager = $this->getEntityManager();\n $query = new Query($entityManager);\n $this->fixtureLoader = new FixtureLoader($query);\n $this->fixtureLoader->setDefaultFixtures(array(\n \"System\\Fixture\\Settings\",\n \"Users\\Fixture\\Acl\",\n \"Users\\Fixture\\Role\"\n ));\n\n\n parent::setUp();\n }",
"public function setup()\n {\n parent::setup();\n\n $fixtures = [\n new LoadUserData(),\n ];\n\n // Load the fixtures we needs\n $fixtureAware = new FixtureAwareTestCase();\n $fixtureAware->setup();\n foreach ($fixtures as $fixture) {\n $fixtureAware->addFixture($fixture);\n }\n $fixtureAware->executeFixtures();\n\n }",
"protected abstract function newFixture();",
"public function setUp() {\n $this->fixture= $this->fixture();\n }",
"public function testCreateFixtures() {\r\n global $menuLoadResult, $watchDogMessage, $menuSavedCalled, $menuGiven;\r\n\r\n $menu = array();\r\n $menu['test1'] = array(\r\n 'title' => 'testtitle1',\r\n 'description' => 'description1',\r\n 'items' => array(\r\n 'exits' => TRUE,\r\n 'link' => 'testlink'\r\n )\r\n );\r\n\r\n $menuLoadResult = FALSE;\r\n\r\n $this->subjectToTest\r\n ->expects($this->once())\r\n ->method('fixturesCreateMenuItem');\r\n\r\n $this->subjectToTest->createFixtures($menu);\r\n\r\n $this->assertTrue($menuSavedCalled);\r\n $this->assertEquals($menu['test1']['title'], $menuGiven['title']);\r\n $this->assertTrue($menuGiven['menu_name'] == 'test1');\r\n $this->assertEquals('Created menu test1. info', $watchDogMessage);\r\n }",
"protected function setUp(): void\n {\n $this->fixture = new UsesDescriptor('name');\n }",
"public function setupFixtures()\n {\n /** @var \\Doctrine\\ORM\\EntityManager $em */\n $em = $this->get('doctrine')->getManager();\n /** @var \\Symfony\\Component\\HttpKernel\\KernelInterface $kernel */\n $kernel = $this->getKernel();\n\n if (!$kernel) {\n return;\n }\n\n $paths = [];\n foreach ($kernel->getBundles() as $bundle) {\n $paths[] = $bundle->getPath().'/DataFixtures/ORM';\n }\n\n $loader = new DataFixturesLoader($kernel->getContainer());\n foreach ($paths as $path) {\n if (is_dir($path)) {\n $loader->loadFromDirectory($path);\n }\n }\n $fixtures = $loader->getFixtures();\n\n if (!$fixtures) {\n return;\n }\n\n $purger = new ORMPurger($em);\n $purger->setPurgeMode(ORMPurger::PURGE_MODE_DELETE);\n\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($fixtures);\n\n $em->flush();\n //exit('hello');\n }",
"public function _fixtures(){\n return [\n 'user' => [\n 'class' => UserFixture::class,\n 'dataFile' => codecept_data_dir() . 'user.php'\n ]\n ];\n }",
"function fixtures($fixture)\n {\n $fixtures = func_get_args();\n \n if (!empty($fixtures))\n {\n Fixtures::insert($fixtures);\n $this->fixtures = array_merge($this->fixtures, $fixtures);\n }\n }",
"public function setUp()\n {\n parent::setUp();\n// $user = User::where('username', 'admin')->first();\n// $this->be($user);\n }",
"public function _fixtures()\n {\n return ArrayHelper::merge(\n parent::_fixtures(),\n [\n 'user' => [\n 'class' => UserFixture::class,\n 'dataFile' => codecept_data_dir() . 'user.php',\n ],\n ]\n );\n }",
"public function _fixtures()\n {\n return ArrayHelper::merge(\n parent::_fixtures(),\n [\n 'user' => [\n 'class' => UserFixture::class,\n 'dataFile' => codecept_data_dir() . 'user.php',\n ],\n ]\n );\n }",
"public function setUp()\n {\n parent::setUp();\n $user = User::where('username', 'admin')->first();\n $this->be($user);\n }",
"protected function setUp ()\n {\n parent::setUp();\n\n $this->fixture = <<<'EOF'\n{\n \"id\":\"leadresonder_route\",\n \"description\":\"some long description of the model\",\n \"properties\":{\n \"usr_mlr_route_id\":{\n \"type\":\"integer\",\n \"description\":\"some long winded description.\"\n },\n \"route\":{\n \"type\":\"string\",\n \"description\":\"some long description of the model.\"\n },\n \"createdDate\":{\n \"type\":\"string\",\n \"description\":\"\"\n },\n \"tags\":{\n \"type\":\"array\",\n \"description\":\"this is a reference to `tag`\",\n \"items\" : {\n \"$ref\": \"tag\"\n }\n },\n \"arrayItem\":{\n \"type\":\"array\",\n \"description\":\"This is an array of strings\",\n \"items\" : {\n \"type\": \"string\"\n }\n },\n \"refArr\":{\n \"type\":\"array\",\n \"description\":\"This is an array of integers.\",\n \"items\" : {\n \"type\": \"integer\"\n }\n },\n \"enumVal\":{\n \"type\":\"string\",\n \"description\":\"This is an enum value.\",\n \"enum\": [\"Two Pigs\",\"Duck\",\"And 1 Cow\"]\n },\n \"integerParam\":{\n \"description\":\"This is an integer Param\",\n \"type\":\"integer\"\n }\n }\n}\nEOF;\n\n\n }",
"protected function setup()\n {\n parent::setup();\n\n $db_assignment = $this->get_record();\n\n //TODO throw an exception if no particpant id is set\n\n // set the view's items\n $db_participant = $db_assignment->get_participant();\n $this->set_item( 'uid', $db_participant->uid, true );\n $this->set_item( 'cohort', $db_participant->get_cohort()->name, true );\n $this->set_item( 'user', $db_assignment->get_user()->name, true );\n\n //TODO if the user is a typist, consider not showing the order of tests to process\n try\n {\n $this->test_entry_list->process();\n $this->set_variable( 'test_entry_list', $this->test_entry_list->get_variables() );\n }\n catch( \\cenozo\\exception\\permission $e ) {}\n }",
"public function _fixtures()\n\t{\n\t\treturn [\n\t\t\t'user' => [\n\t\t\t\t'class' => UserFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'login_data.php'\n\t\t\t],\n\t\t\t'theme' => [\n\t\t\t\t'class' => ThemeMessageFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'theme.php'\n\t\t\t]\n\t\t];\n\t}",
"private function getFixtures()\n {\n $fixtures = [\n 'AppBundle\\DataFixtures\\ORM\\LoadCountryData',\n 'AppBundle\\DataFixtures\\ORM\\LoadLocalityData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightTypeData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightData',\n 'AppBundle\\DataFixtures\\ORM\\LoadUserData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightReviewData',\n ];\n\n $this->loadFixtures($fixtures);\n }",
"abstract protected function createFixture(): FixtureInterface;",
"public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => CategoryFixture::className(),\n 'dataFile' => codecept_data_dir() . 'category_data.php'\n ],\n 'product' => [\n 'class' => ProductFixture::className(),\n 'dataFile' => codecept_data_dir() . 'product_data.php'\n ]\n ];\n }",
"protected function setUp(): void\n\t{\n\t\tglobal $txt;\n\t\t$lang = new Loader('english', $txt, database());\n\t\t$lang->load('Admin');\n\n\t\t// Elevate the user.\n\t\tUser::$info = new UserInfo([\n\t\t\t'permissions' => ['manage_permissions']\n\t\t]);\n\n\t\t// Make sure they can't do certain things,\n\t\t// unless they have the right permissions.\n\t\t$this->permissionsObject = new Permissions;\n\t\t$this->illegal_permissions = $this->permissionsObject->getIllegalPermissions();\n\n\t\t$this->config_vars = array(\n\t\t\tarray('permissions', 'my_dummy_permission1'),\n\t\t\tarray('permissions', 'my_dummy_permission2', 'excluded_groups' => array(-1, 0, 2)),\n\t\t\tarray('permissions', 'my_dummy_permission3', 'excluded_groups' => array(-1, 0)),\n\t\t\tarray('permissions', 'my_dummy_permission4', 'excluded_groups' => array(-1)),\n\t\t\tarray('permissions', 'admin_forum'), // Illegal permission\n\t\t\tarray('permissions', 'send_mail'), // Illegal guest permission\n\t\t);\n\t\t$this->results = array(\n\t\t\t-1 => array(\n\t\t\t\t'id' => -1,\n\t\t\t\t'name' => 'Guests',\n\t\t\t\t'is_postgroup' => false,\n\t\t\t\t'status' => 'off',\n\t\t\t),\n\t\t\t0 => array(\n\t\t\t\t'id' => 0,\n\t\t\t\t'name' => 'Regular Members',\n\t\t\t\t'is_postgroup' => false,\n\t\t\t\t'status' => 'off',\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t'id' => '2',\n\t\t\t\t'name' => 'Global Moderator',\n\t\t\t\t'is_postgroup' => false,\n\t\t\t\t'status' => 'off',\n\t\t\t),\n\t\t);\n\n\t\t$this->permissionsForm = new InlinePermissions;\n\t\t$this->permissionsForm->setPermissions($this->config_vars);\n\n\t\t// Load the permission settings that guests cannot have\n\t\t$this->illegal_guest_permissions = array_intersect(\n\t\t\tarray_map(\n\t\t\t\tfunction ($permission)\n\t\t\t\t{\n\t\t\t\t\treturn str_replace(array('_any', '_own'), '', $permission[1]);\n\t\t\t\t}, $this->config_vars\n\t\t\t), $this->permissionsObject->getIllegalGuestPermissions()\n\t\t);\n\t}",
"public function loadFixtures()\n\t{\n\t\t// implement Zend\\Config to load a configuration file with fixtures\n\t\t$fixtures = new \\Zend\\Config\\Config(include __DIR__.\"/../Fixtures/AccountLoad.php\");\n\t\t\n\t\tforeach($fixtures->data as $dd) {\n\t\t\t\n\t\t\t$this->addAccount($dd);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function testUsersIdExerciseDiaryPost()\n {\n\n }",
"public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::class,\n 'dataFile' => codecept_data_dir() . 'login.php'\n ]\n ];\n }",
"public function setUp() {\n\t\tparent::setUp();\n\n\t\t// Create client and load database fixtures\n\t\t$this->client = static::createClient();\n\t\t$this\n\t\t\t\t->loadFixtures(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'Monubit\\TagBundle\\Tests\\Fixtures\\LoadTagData'));\n\n\t}",
"public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::className(),\n 'dataFile' => codecept_data_dir() . 'user.php',\n ],\n 'profile' => [\n 'class' => ProfileFixture::className(),\n 'dataFile' => codecept_data_dir() . 'profile.php',\n ],\n ];\n }",
"public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::class,\n 'dataFile' => codecept_data_dir() . 'user.php',\n ],\n ];\n }"
] | [
"0.7402201",
"0.671319",
"0.66065574",
"0.6490327",
"0.6481705",
"0.6414262",
"0.6386006",
"0.6367363",
"0.6353211",
"0.6210213",
"0.616231",
"0.61615425",
"0.6150198",
"0.61052155",
"0.60831815",
"0.60831815",
"0.6044894",
"0.60381716",
"0.60286933",
"0.6016833",
"0.600598",
"0.59832793",
"0.59828216",
"0.5980595",
"0.59739",
"0.59570384",
"0.59448373",
"0.59409565",
"0.5922662",
"0.5915704"
] | 0.6730515 | 1 |
test that resolving classnames works | function testGetRealClassname() {
$result = $this->Task->getRealClassname('Model', 'Post');
$this->assertEqual($result, 'Post');
$result = $this->Task->getRealClassname('Controller', 'Posts');
$this->assertEqual($result, 'PostsController');
$result = $this->Task->getRealClassname('Helper', 'Form');
$this->assertEqual($result, 'FormHelper');
$result = $this->Task->getRealClassname('Behavior', 'Containable');
$this->assertEqual($result, 'ContainableBehavior');
$result = $this->Task->getRealClassname('Component', 'Auth');
$this->assertEqual($result, 'AuthComponent');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testClassResolution()\n {\n $this->assertEquals('\\Slab\\Tests\\Bundle\\Mocks\\NamespaceTwo\\Sample', $this->stack->findClassName('Sample'));\n $this->assertInstanceOf('\\Slab\\Tests\\Bundle\\Mocks\\BaseNamespace\\OnlyBase', $this->stack->findClass('OnlyBase'));\n $this->assertInstanceOf('\\Slab\\Tests\\Bundle\\Mocks\\NamespaceCharlie\\OnlyCharlie', $this->stack->findClass('OnlyCharlie'));\n $this->assertEquals('\\Slab\\Tests\\Bundle\\Mocks\\NamespaceCharlie\\Configuration', $this->stack->findClassName('Configuration'));\n }",
"public function testClassAccess()\n\t{\n\t\tforeach ($this->classes as $key => $name)\n\t\t{\n\t\t\t$this->assertSame( $name, $this->definition->classname( $key ) );\n\t\t}\n\t}",
"public static function resolverClassName();",
"public function testClassExists()\n {\n $this->assertTrue(class_exists(\"Fig\\\\Fig\", true), \"Class does not exist\");\n }",
"public function testFindClassSuccess(): void\n {\n $class = TypeMap::FindClass('Payment');\n $this->assertEquals(Payment::class, $class);\n }",
"public function testThatClassAliasesAreBootedCorrectly(): void\n {\n $this->createApplication('dev');\n\n $this->assertArrayHasKey('Bar', AliasLoader::getInstance()->getAliases());\n }",
"public function testShouldReturnClassUrl()\n {\n $this->assertEquals(Fixtures\\Foo::classPath(), '/foos');\n $this->assertEquals(Fixtures\\FooTest::classPath(), '/footests');\n $this->assertEquals(Fixtures\\FooPerson::classPath(), '/foopeople');\n $this->assertEquals(Fixtures\\FooCurrency::classPath(), '/foocurrencies');\n }",
"public function testStringsCanBeClassified()\n {\n $app = $this->getApplication();\n $str = new String($app);\n $this->assertEquals('Something_Else', $str->classify('something.else'));\n $this->assertEquals('Something_Else', $str->classify('something_else'));\n }",
"public function getResolvedClass(): Name;",
"public function testClassName() {\n $this->assertEquals('Titon\\Test\\Stub\\AugmentStub', $this->object->className);\n $this->assertEquals('Titon\\Test\\Stub\\AugmentStub', $this->object->className());\n }",
"public function testReturnClassName()\n {\n $this->assertEquals(Fixtures\\Foo::className(), 'foo');\n $this->assertEquals(Fixtures\\FooTest::className(), 'footest');\n }",
"public function testClassExists()\n {\n $this->assertTrue(class_exists($this->classTested), 'Entidade User nao existe');\n }",
"public function testPhpUnitTestClassesLoading() {\n $this->assertTrue(class_exists('\\Drupal\\phpunit_test\\PhpUnitTestDummyClass'), 'Class provided by test module was not autoloaded.');\n }",
"public function loadClass(string $className): bool\n {\n $className = ltrim($className, '\\\\');\n $namespaceParts = explode('\\\\', $className);\n // Workaround for Doctrine's annotation parser which does a class_exists() for annotations like \"@param\" and so on:\n if (isset($this->ignoredClassNames[$className]) || isset($this->ignoredClassNames[end($namespaceParts)]) || isset($this->nonExistentClasses[$className])) {\n return false;\n }\n\n $classNamePart = array_pop($namespaceParts);\n $classNameParts = explode('_', $classNamePart);\n $namespaceParts = array_merge($namespaceParts, $classNameParts);\n $namespacePartCount = count($namespaceParts);\n\n $currentPackageArray = $this->packageNamespaces;\n $packagenamespacePartCount = 0;\n\n // This will contain all possible class mappings for the given class name. We start with the fallback paths and prepend mappings with growing specificy.\n $collectedPossibleNamespaceMappings = [\n ['p' => $this->fallbackClassPaths, 'c' => 0]\n ];\n\n if ($namespacePartCount > 1) {\n while (($packagenamespacePartCount + 1) < $namespacePartCount) {\n $possiblePackageNamespacePart = $namespaceParts[$packagenamespacePartCount];\n if (!isset($currentPackageArray[$possiblePackageNamespacePart])) {\n break;\n }\n\n $packagenamespacePartCount++;\n $currentPackageArray = $currentPackageArray[$possiblePackageNamespacePart];\n if (isset($currentPackageArray['_pathData'])) {\n array_unshift($collectedPossibleNamespaceMappings, ['p' => $currentPackageArray['_pathData'], 'c' => $packagenamespacePartCount]);\n }\n }\n }\n\n foreach ($collectedPossibleNamespaceMappings as $nameSpaceMapping) {\n if ($this->loadClassFromPossiblePaths($nameSpaceMapping['p'], $namespaceParts, $nameSpaceMapping['c'])) {\n return true;\n }\n }\n\n $this->nonExistentClasses[$className] = true;\n return false;\n }",
"function testGetClassName() {\n\t\t$objects = App::objects('model');\n\t\t$skip = $this->skipIf(empty($objects), 'No models in app, this test will fail. %s');\n\t\tif ($skip) {\n\t\t\treturn;\n\t\t}\n\t\t$this->Task->setReturnValueAt(0, 'in', 'MyCustomClass');\n\t\t$result = $this->Task->getClassName('Model');\n\t\t$this->assertEqual($result, 'MyCustomClass');\n\n\t\t$this->Task->setReturnValueAt(1, 'in', 1);\n\t\t$result = $this->Task->getClassName('Model');\n\t\t$options = App::objects('model');\n\t\t$this->assertEqual($result, $options[0]);\n\t}",
"public function testLoaderClassSearchDirs()\n {\n $dirs = array();\n foreach (array('_testDir1', '_testDir2') as $dir) {\n $dirs[] = implode(array(__DIR__, '_files', $dir), DIRECTORY_SEPARATOR);\n }\n\n // throws exception on failure\n Loader::loadClass('Class1', $dirs);\n Loader::loadClass('Class2', $dirs);\n }",
"function testint_autoload_classes() {\n\tnew ThemeDev\\FooBar;\n\n\tnew ThemeDev\\SubfolderSubfolder\\Bar;\n}",
"function classLoaderTest($class)\n{\n $nsPrefix = 'Tos/';\n $path = str_replace('\\\\', DIRECTORY_SEPARATOR, $class);\n if (strpos($path, $nsPrefix) === 0) {\n $path = substr($path, strlen($nsPrefix));\n $file = __DIR__ . DIRECTORY_SEPARATOR . $path . '.php';\n if (file_exists($file)) {\n require_once $file;\n }\n }\n}",
"abstract protected function getClassUnderTest(): string;",
"public function resolveInstanceOf($class);",
"public function resolveInstanceOf($class);",
"function loadClass($name);",
"public function testValidateClassSuccess()\n {\n $this->validateClass('Henk', 'henk');\n }",
"public function testGetClass()\n {\n // check for the correct class name\n $this->assertEquals('AppserverIo\\Lang\\Boolean', Boolean::__getClass());\n }",
"public function testGetClassReturnsCorrectValue()\n {\n $this->assertEquals(__CLASS__, $this->joinPoint->getClass());\n }",
"public function testReflectionClassTypeFailedThrowsExceptionWithTypeMismatch() {\n\t\tthrow ReflectorException::withTypeMismatch(\"\\\\Namespaced\\\\Classname\", \"\\\\Expected\\\\Namespaced\\\\Classname\");\n\t}",
"public function testGetClasses()\r\n\t{\r\n\t}",
"public function test_it_does_not_make_classname_replacement_inside_namespaced_file()\n {\n\n $this->markTestSkipped('Not respecting the pinned commit.');\n\n $composerJsonString = <<<'EOD'\n{\n\t\"name\": \"brianhenryie/mozart-issue-93\",\n\t\"repositories\": [{\n\t\t\"url\": \"https://github.com/BrianHenryIE/bh-wp-logger\",\n\t\t\"type\": \"git\"\n\t}],\n\t\"require\": {\n\t\t\"brianhenryie/wp-logger\": \"dev-master#dd2bb0665e01e11b282178e76a2334198d3860c5\"\n\t},\n\t\"extra\": {\n\t\t\"strauss\": {\n\t\t\t\"namespace_prefix\": \"BrianHenryIE\\\\Strauss\\\\\",\n\t\t\t\"classmap_prefix\": \"BrianHenryIE_Strauss_\"\n\t\t}\n\t},\n\t\"minimum-stability\": \"dev\"\n}\nEOD;\n\n file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString);\n\n chdir($this->testsWorkingDir);\n\n exec('composer install');\n\n $inputInterfaceMock = $this->createMock(InputInterface::class);\n $outputInterfaceMock = $this->createMock(OutputInterface::class);\n\n $mozartCompose = new Compose();\n\n $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock);\n\n $php_string = file_get_contents($this->testsWorkingDir .'strauss/brianhenryie/wp-logger/src/class-logger.php');\n\n // Confirm problem is gone.\n $this->assertStringNotContainsString('class BrianHenryIE_Strauss_Logger extends', $php_string);\n\n // Confirm solution is correct.\n $this->assertStringContainsString('class Logger extends', $php_string);\n }",
"public function testGetProviderClassName()\n {\n $reviews = new Reviews($this->config);\n $actualClassName = $reviews->getProviderClassName('reviews_io');\n $expectedClassName = 'PodPoint\\\\Reviews\\\\Providers\\\\ReviewsIo\\\\Provider';\n\n $this->assertEquals($expectedClassName, $actualClassName);\n }",
"public static function \t\tclassname_resolver($_path) {\n\t\treturn \"\\\\\".str_replace(self::resolver_separator, \"\\\\\", $_path);\n\t}"
] | [
"0.7782986",
"0.7276586",
"0.68887043",
"0.66366404",
"0.6555982",
"0.65120703",
"0.65087074",
"0.64465296",
"0.63971394",
"0.6377987",
"0.6344296",
"0.6333256",
"0.6292959",
"0.6254007",
"0.62254685",
"0.61865634",
"0.6149824",
"0.6142253",
"0.6123478",
"0.61114407",
"0.61114407",
"0.6111276",
"0.61082894",
"0.6087776",
"0.6077799",
"0.6072541",
"0.60575616",
"0.60445935",
"0.6016051",
"0.6010594"
] | 0.74667394 | 1 |
test Constructor generation ensure that constructClasses is called for controllers | function testGenerateConstructor() {
$result = $this->Task->generateConstructor('controller', 'PostsController');
$expected = "new TestPostsController();\n\t\t\$this->Posts->constructClasses();\n";
$this->assertEqual($result, $expected);
$result = $this->Task->generateConstructor('model', 'Post');
$expected = "ClassRegistry::init('Post');\n";
$this->assertEqual($result, $expected);
$result = $this->Task->generateConstructor('helper', 'FormHelper');
$expected = "new FormHelper();\n";
$this->assertEqual($result, $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUp()\n {\n $this->class_object = $this->newController('Website_Controller');\n }",
"public function test___construct() {\n\t\t}",
"function __construct() {\n parent::MY_TestController(__FILE__);\n $this->load->model('Creation');\n }",
"public function testGetControllerClass()\n {\n $this->assertEquals(self::VALID_CONTROLLER, $this->testConstruct()->getControllerClass());\n }",
"private function autoInjectConstructor () {\n\n\t\t$reflectionClass = new \\ReflectionClass($this->controller);\n\t\t$parameters = $reflectionClass->getConstructor()->getParameters();\n\t\t$countParams = $reflectionClass->getConstructor()->getNumberOfParameters();\n\t\t$arguments = $this->getDataArguments('constructor', $parameters, $countParams);\n\n\t\tif ($countParams === 0) {\n\t\t\t$this->controller = new $this->controller;\n\t\t}\n\n\t\tif ($countParams > 0) {\n\t\t\t$class = new \\ReflectionClass($this->controller);\n\t\t\t$this->controller = $class->newInstanceArgs( $arguments);\n\t\t}\n\n\t}",
"public function test___construct()\r\n\t{\r\n }",
"public function testConstructor() {\n $controller = new FoursquarePluginConfigurationController(null);\n // Check the controller was created\n $this->assertNotNull($controller);\n // Check the controller is of type foursquare\n $this->assertIsA($controller, 'FoursquarePluginConfigurationController');\n }",
"protected function setUp() {\n $this->object = new Controller;\n }",
"public function testGetClasses()\r\n\t{\r\n\t}",
"public function before_construct() {}",
"protected function setUp()\n {\n $this->object = new TestController;\n }",
"public static function setup_classes() {\r\n\r\n }",
"public function testConstructor()\n {\n /** @var \\Rcm\\Service\\PageManager $mockPageManager */\n $mockPageManager = $this\n ->getMockBuilder('\\Rcm\\Service\\PageManager')\n ->disableOriginalConstructor()\n ->getMock();\n\n /** @var \\Rcm\\Service\\LayoutManager $mockLayoutManager */\n $mockLayoutManager = $this\n ->getMockBuilder('\\Rcm\\Service\\LayoutManager')\n ->disableOriginalConstructor()\n ->getMock();\n\n $controller = new IndexController($mockPageManager, $mockLayoutManager);\n\n $this->assertTrue($controller instanceof IndexController);\n }",
"public function setUp()\n {\n $request = new Request();\n $response = new Response();\n\n $this->controller = $this->getMockBuilder('Cake\\Controller\\Controller')\n ->setMethods(null)\n ->setConstructorArgs([$request, $response])\n ->getMock();\n $this->registry = new ComponentRegistry($this->controller);\n }",
"protected function setUp()\n {\n $this->object = new Constructor_Parameter(10);\n }",
"protected function setUp() {\n $this->object = new Car_Controller;\n }",
"protected function setUp() {\n\t\t$this->route = new ControllerRoute;\n\t}",
"public function testConstruct()\n\t{\n\t\t$this->assertInstanceOf('JComponentRouterRulesStandard', $this->object);\n\t\t$this->assertInstanceOf('JComponentRouterView', TestReflection::getValue($this->object, 'router'));\n\t}",
"public function __construct(){\n\n $url = $this->getUrlParams();\n \n // Checking for controller\n if(isset($url[0]) && file_exists(APPROOT . \"/controllers/\" . ucfirst($url[0]) . \".php\")){\n $this->controller = ucfirst($url[0]);\n unset($url[0]);\n }else{\n return handleResponse(404,\"Controller not found. It may occurs if you haven't passed the controller or the controller does not exist.\");\n }\n\n // Requring the controller\n require_once APPROOT . \"/controllers/\" . $this->controller . \".php\";\n // Initializing the controller\n $this->controller = new $this->controller();\n\n // Checking for method\n if(isset($url[1]) && method_exists($this->controller, $url[1])){\n // If method is passed and exists\n $this->method = $url[1];\n unset($url[1]);\n } else if(isset($url[1])){\n // If method is passed but doesn't exist\n return handleResponse(404, \"Method $url[1] does not exist.\");\n }\n\n // Checking for parameters\n $this->parameters = $url ? array_values($url) : [];\n\n // Call the method inside the controller with the array of parameters\n call_user_func_array([$this->controller, $this->method], $this->parameters);\n\n }",
"public function __construct()\n {\n parent::__construct();\n parent::controller();\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->controller(Factories::class);\n }",
"public function testConstructor()\n {\n $this->assertConstructor(\n [\n 'same:manager' => $this->createMock(DocumentManager::class),\n 'documentName' => \\stdClass::class,\n 'identifierField' => 'id',\n 'requestBag' => Loader::REQUEST_ATTRIBUTE,\n 'requestBagKey' => 'attrName',\n 'same:logger' => $this->createMock(LoggerInterface::class)\n ]\n );\n }",
"protected function setUp() {\n $this->object = new Enlace();\n $this->object->setMode(Enlace::$MODE_TESTING);\n $this->object->set(\"src\", array(\n \"src\" => __DIR__ . \"/../src\",\n \"log\" => __DIR__ . \"/../log\"\n ));\n $this->object->set(\"scanneableControllers\", array(\"enlace\" => __DIR__ . \"/../src\"));\n $this->object->set(\"defaultController\", \"\\\\flowcode\\\\enlace\\\\controller\\\\DefaultController\");\n $this->object->set(\"defaultMethod\", \"defaultMethod\");\n $this->object->set(\"errorMethod\", \"errorMethod\");\n }",
"public function testControllerRun()\n {\n }",
"protected function setUp()\n {\n global $backyardConf;\n $backyard = new \\GodsDev\\Backyard\\Backyard($backyardConf);\n $mycmsOptions = array(\n 'TRANSLATIONS' => array(\n 'en' => 'English',\n 'cn' => '中文'\n ),\n 'logger' => $backyard->BackyardError,\n );\n $this->myCms = new MyCMS($mycmsOptions);\n //$this->object = new MyController;\n }",
"function testMockClassGeneration() {\n\t\t$result = $this->Task->hasMockClass('controller');\n\t\t$this->assertTrue($result);\n\t}",
"public function test__constructDependancyInjection()\n\t{\n\t\tif (PHP_VERSION == '5.4.29' || PHP_VERSION == '5.5.13' || PHP_MINOR_VERSION == '6')\n\t\t{\n\t\t\t$this->markTestSkipped('Test is skipped due to a PHP bug in versions 5.4.29 and 5.5.13 and a change in behavior in the 5.6 branch');\n\t\t}\n\n\t\t$mockInput = $this->getMock('JInputCli', array('test'), array(), '', false);\n\t\t$mockInput->expects($this->any())\n\t\t\t->method('test')\n\t\t\t->willReturn('ok');\n\n\t\t$mockConfig = $this->getMock('\\\\Joomla\\\\Registry\\\\Registry', array('test'), array(null), '', true);\n\t\t$mockConfig\n\t\t\t->expects($this->any())\n\t\t\t->method('test')\n\t\t\t->willReturn('ok');\n\n\t\t$mockDispatcher = $this->getMockDispatcher();\n\t\t$mockDispatcher->expects($this->any())\n\t\t\t->method('test')\n\t\t\t->willReturn('ok');\n\n\t\t$class = $this->getMock('JApplicationCli', array(), array($mockInput, $mockConfig, $mockDispatcher));\n\n\t\t$this->assertEquals('ok', $class->input->test(), 'Tests input injection.');\n\t\t$this->assertEquals('ok', TestReflection::getValue($class, 'config')->test(), 'Tests config injection.');\n\t}",
"public function testConstruct()\n {\n $router = new \\Slim\\Router();\n\n $this->assertAttributeEquals(array(), 'routes', $router);\n }",
"public function __construct(array $parameters)\n {\n $this->app = new ControllerTestCase();\n $this->app->setUp();\n }",
"public function __construct(){\n\n // Begin\n\n //Default initialization\n $this->controller['class'] = '';\n $this->controller['method'] = '';\n $this->controller['parameters'] = '';\n $this->controller['flag'] = '';\n\n $this->parse();\n\n switch ($this->routing()){\n\n case 'index':\n require 'controllers/Index.php';\n $app_controller = new Index();\n $app_controller->index();\n break;\n case 'class':\n //require 'controllers/' . $this->controller['class'] .'.php';\n $app_controller = new $this->controller['class'];\n $app_controller->index();\n break;\n case 'class/method':\n //require 'controllers/' . $this->controller['class'] .'.php';\n $app_controller = new $this->controller['class'];\n $method = $this->controller['method'];\n $app_controller->$method($this->controller['parameters']);\n break;\n case 'error':\n require 'controllers/Error_404.php';\n $app_controller = new Error_404();\n\n break;\n\n }\n\n // End\n }"
] | [
"0.72920954",
"0.72369725",
"0.7142281",
"0.698285",
"0.6981732",
"0.69284236",
"0.6827961",
"0.6742551",
"0.66869545",
"0.6653236",
"0.6646036",
"0.66281563",
"0.6604705",
"0.6579971",
"0.6520699",
"0.65069294",
"0.65037495",
"0.64240336",
"0.64183664",
"0.6414379",
"0.64112216",
"0.63641614",
"0.63582945",
"0.6355725",
"0.6337812",
"0.6333465",
"0.63256246",
"0.6322634",
"0.63226205",
"0.63041806"
] | 0.80577785 | 0 |
Test that mock class generation works for the appropriate classes | function testMockClassGeneration() {
$result = $this->Task->hasMockClass('controller');
$this->assertTrue($result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testShouldCreateStubInheritingClassTypeFromOriginal()\n {\n $mock = mockery('MockeryTest_SimpleClass', array('get' => 'foo'));\n $this->assertEquals('foo', $mock->get());\n }",
"function mock_class_autoloader($class)\n{\n \tinclude MOCK_PATH . $class . '.php';\n}",
"public function testShouldCreateMockInheritingClassTypeFromOriginal()\n {\n $mock = mockery('MockeryTest_EmptyClass');\n $this->assertTrue($mock instanceof MockeryTest_EmptyClass);\n }",
"public function testGetClass()\n {\n $this->todo('stub');\n }",
"abstract protected function getClassUnderTest(): string;",
"function testGenerateConstructor() {\n\t\t$result = $this->Task->generateConstructor('controller', 'PostsController');\n\t\t$expected = \"new TestPostsController();\\n\\t\\t\\$this->Posts->constructClasses();\\n\";\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$result = $this->Task->generateConstructor('model', 'Post');\n\t\t$expected = \"ClassRegistry::init('Post');\\n\";\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$result = $this->Task->generateConstructor('helper', 'FormHelper');\n\t\t$expected = \"new FormHelper();\\n\";\n\t\t$this->assertEqual($result, $expected);\n\t}",
"public function testGetModelByClass()\n {\n $this->todo('stub');\n }",
"protected function makeFakeClasses() {\n\t\tif (class_exists('testFakeClass')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make a fake class that has a private and a static variable\n\t\t$fake = 'class testFakeClass { private static $PS = \"Private Static\"; protected static $S = \"Static\"; private $P = \"Private\"; }';\n\t\teval($fake);\n\n\t\t// Extend another class that Dump handles to verify chaining works\n\t\t$extended = 'class testExtendedObject extends ArrayObject {}';\n\t\teval($extended);\n\t}",
"public function testShouldCreateNewClassWithGivenNameIfNotYetExisting()\n {\n $mock = mockery('MockeryTest_DoesntExist');\n $this->assertTrue($mock instanceof MockeryTest_DoesntExist);\n }",
"protected static function getMockableClass()\n {\n return get_class(static::getFacadeRoot());\n }",
"public function generateCode()\n {\n $refClass = new ReflectionClass($this->className);\n $this->finalClassesCanNotBeMocked($refClass);\n\n $this->methods = array();\n $this->makeAllAbstractMethodsThrowException($refClass);\n if (!$this->niceMock || $refClass->isInterface()) {\n $this->makeAllMethodsThrowException($refClass);\n }\n $this->renderRules();\n $this->renderConstructor();\n $this->renderClone();\n $this->exposeMethods();\n $this->setUpGetCallsForMethod();\n\n $code = $this->getNamespaceCode();\n $methods = implode(\"\\n\", $this->methods);\n $superWord = $this->getSuperWord($refClass);\n\n $class = \"class {$this->getMockName()} $superWord \\\\{$this->className}\";\n if ('implements' === $superWord) {\n $class .= ', ';\n } else {\n $class .= ' implements ';\n }\n $class .= '\\Concise\\Mock\\MockInterface';\n\n return $code .\n \"$class { public static \\$_methodCalls = array(); $methods }\";\n }",
"protected function verifyMockObjects() {\n }",
"public function testGetClasses()\r\n\t{\r\n\t}",
"public function testClassAccess()\n\t{\n\t\tforeach ($this->classes as $key => $name)\n\t\t{\n\t\t\t$this->assertSame( $name, $this->definition->classname( $key ) );\n\t\t}\n\t}",
"public function testClassResolution()\n {\n $this->assertEquals('\\Slab\\Tests\\Bundle\\Mocks\\NamespaceTwo\\Sample', $this->stack->findClassName('Sample'));\n $this->assertInstanceOf('\\Slab\\Tests\\Bundle\\Mocks\\BaseNamespace\\OnlyBase', $this->stack->findClass('OnlyBase'));\n $this->assertInstanceOf('\\Slab\\Tests\\Bundle\\Mocks\\NamespaceCharlie\\OnlyCharlie', $this->stack->findClass('OnlyCharlie'));\n $this->assertEquals('\\Slab\\Tests\\Bundle\\Mocks\\NamespaceCharlie\\Configuration', $this->stack->findClassName('Configuration'));\n }",
"protected function makeClass()\r\n {\r\n $args = func_get_args();\r\n if (count($args) < 1) {\r\n throw new \\PHPUnit_Framework_ExpectationFailedException(\r\n sprintf('Class name is required')\r\n );\r\n }\r\n\r\n $class = array_shift($args);\r\n\r\n if (!class_exists($class)) {\r\n throw new \\PHPUnit_Framework_ExpectationFailedException(\r\n sprintf('Unable to find %s class', $class)\r\n );\r\n }\r\n\r\n if (count($args) == 0) {\r\n $object = new $class;\r\n } else {\r\n $reflection = new \\ReflectionClass($class);\r\n $object = $reflection->newInstanceArgs($args);\r\n }\r\n\r\n return $object;\r\n }",
"public function testMockOfBaseMock()\n {\n $mock = $this->getMock(DummyClass::class);\n }",
"public function testGetObjectTemplates()\n {\n }",
"public function test_getBuiltMock ($expected, $className, $methods = array())\n {\n $builder = $this->getMockBuilder('PHPUnit_Framework_MockObject_MockBuilder')\n ->setMethods(array('setMethods', 'disableOriginalConstructor', 'getMock'))\n ->disableOriginalConstructor()\n ->getMock();\n\n $subject = $this->getMockBuilder('Rx_PHPUnit_TestCase')\n ->setMethods(array(\n 'getMockBuilder',\n ))\n ->disableOriginalConstructor()\n ->getMock();\n\n $builder->expects($this->once())\n ->method('getMock')\n ->will($this->returnValue($expected));\n\n $builder->expects($this->once())\n ->method('disableOriginalConstructor')\n ->will($this->returnSelf());\n\n $builder->expects($this->once())\n ->method('setMethods')\n ->with($this->equalTo($methods))\n ->will($this->returnSelf());\n\n $subject->expects($this->once())\n ->method('getMockBuilder')\n ->with($this->equalTo($className))\n ->will($this->returnValue($builder));\n\n $result = $subject->getBuiltMock($className, $methods);\n\n $this->assertEquals($expected, $result);\n\n\n }",
"function testClassDecorators()\n {\n $this->manager->add('Sirius\\Decorators\\DecoratorA', 'Sirius\\Decorators\\TestableDecoratableObject');\n $this->manager->add('Sirius\\Decorators\\DecoratorB', 'Sirius\\Decorators\\TestableDecoratableObject');\n \n $testableObj = new TestableDecoratableObject();\n \n $this->assertEquals('***barbar', $testableObj->foo());\n $this->assertEquals('baz', $testableObj->bar());\n }",
"public function testNetworkBase () {\n // assertion to check if the file exists\n // $this->assertFileExists('../drupal8/modules/social_api/src/Plugin/NetworkBase.php');\n // array $configuration, $plugin_id, array $plugin_definition,\n\n\n $this->entity_type_manager = $this->createMock(EntityTypeManagerInterface::class);\n $this->config_factory = $this->createMock(ConfigFactoryInterface::class);\n $this->container = $this->createMock(ContainerInterface::class);\n $this->configuration = array();\n $this->plugin_definition = array();\n\n $collection = $this->getMockBuilder('Drupal\\social_api\\Plugin\\NetworkBase')\n ->setConstructorArgs(array($this->configuration, '1234', $this->plugin_definition, $this->entity_type_manager, $this->config_factory ))\n ->setMethods(['getSdk', 'create'])\n ->getMockForAbstractClass();\n\n $this->assertTrue(\n method_exists($collection, 'init'),\n 'NetworkBase does not have init function/method'\n );\n $this->assertTrue(\n method_exists($collection, 'create'),\n 'NetworkBase does not have create function/method'\n );\n $this->assertTrue(\n method_exists($collection, 'authenticate'),\n 'NetworkBase does not have authenticate function/method'\n );\n $this->assertTrue(\n method_exists($collection, 'getSdk'),\n 'NetworkBase does not have getSdk function/method'\n );\n $collection->method('getSdk')\n ->willReturn($this->sdk);\n $this->assertSame($this->sdk, $collection->getSdk());\n\n $collection->method('create')\n ->willReturn($this->sdk);\n\n $result = array($this->configuration,\n $this->plugin_id,\n $this->plugin_definition,\n $this->entity_type_manager,\n $this->config_factory);\n\n // $collection::staticExpects($this->any())\n // ->method('create')\n // ->with(array($this->container, $this->configuration, $this->plugin_id, $this->plugin_definition))\n // ->will($this->returnValue($result));\n //\n // $this->assertSame($result, $collection->create($this->container, $this->configuration, $this->plugin_id, $this->plugin_definition));\n }",
"protected function createMocks()\n {\n $scenario = $this->test->getScenario();\n\n $steps = $scenario->getSteps();\n if (!isset($steps[$scenario->getCurrentStep()])) throw new \\Exception(\"New steps were added to scenario in realtime. Can't proceed.\\nRemove loops from your unit test to fix it\");\n\n for ($i = $scenario->getCurrentStep()+1; $i < count($steps); $i++) {\n $step = $steps[$i];\n if (strpos($action = $step->getAction(), 'seeMethod') === 0) {\n $arguments = $step->getArguments(false);\n $mock = array_shift($arguments);\n $function = array_shift($arguments);\n $params = array_shift($arguments);\n\n foreach ($this->stubs as $stub) {\n if (get_class($stub) == get_class($mock)) {\n $mock = $stub;\n }\n }\n\n $invoke = false;\n\n switch ($action) {\n case 'seeMethodInvoked':\n case 'seeMethodInvokedAtLeastOnce':\n if (!$mock) throw new \\InvalidArgumentException(\"Stub class not defined\");\n $invoke = new \\PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce();\n break;\n case 'seeMethodInvokedOnce':\n if (!$mock) throw new \\InvalidArgumentException(\"Stub class not defined\");\n $invoke = new \\PHPUnit_Framework_MockObject_Matcher_InvokedCount(1);\n break;\n case 'seeMethodNotInvoked':\n if (!$mock) throw new \\InvalidArgumentException(\"Stub class not defined\");\n $invoke = new \\PHPUnit_Framework_MockObject_Matcher_InvokedCount(0);\n break;\n case 'seeMethodInvokedMultipleTimes':\n if (!$mock) throw new \\InvalidArgumentException(\"Stub class not defined\");\n $times = $params;\n if (!is_int($times)) throw new \\InvalidArgumentException(\"Invoked times count should be an integer\");\n $params = $arguments;\n $invoke = new \\PHPUnit_Framework_MockObject_Matcher_InvokedCount($times);\n break;\n default:\n }\n\n if ($invoke) {\n $mockMethod = $mock->expects($invoke)->method($function);\n $this->debug(get_class($invoke) . ' attached');\n if ($params) {\n call_user_func_array(array($mockMethod, 'with'), $params);\n $this->debug('with ' . json_encode($params));\n }\n }\n }\n\n if ($step->getAction() == 'executeTestedMethod') break;\n if ($step->getAction() == 'execute') break;\n if ($step->getAction() == 'executeTestedMethodOn') break;\n if ($step->getAction() == 'executeTestedMethodWith') break;\n }\n }",
"public function testCustomGeneratorAsClass()\n {\n $model = new \\Vouchers\\Voucher\\Model([\n 'code' => [\n 'generator' => TestGenerator::class,\n ],\n ]);\n\n $voucher = new \\Vouchers\\Voucher([], $model);\n $this->assertSame((string) $voucher, TestGenerator::TEST_CODE);\n }",
"function testGetClassName() {\n\t\t$objects = App::objects('model');\n\t\t$skip = $this->skipIf(empty($objects), 'No models in app, this test will fail. %s');\n\t\tif ($skip) {\n\t\t\treturn;\n\t\t}\n\t\t$this->Task->setReturnValueAt(0, 'in', 'MyCustomClass');\n\t\t$result = $this->Task->getClassName('Model');\n\t\t$this->assertEqual($result, 'MyCustomClass');\n\n\t\t$this->Task->setReturnValueAt(1, 'in', 1);\n\t\t$result = $this->Task->getClassName('Model');\n\t\t$options = App::objects('model');\n\t\t$this->assertEqual($result, $options[0]);\n\t}",
"public function testBuffaloGeneratorCanGenerateABuffalo()\n {\n $count = 0;\n foreach ($this->buffaloGenerator->generateBuffalo(1) as $buffalo)\n {\n $this->assertInstanceOf($this->buffaloClass, $buffalo);\n $count++;\n }\n return $this->assertEquals(1, $count);\n }",
"public function testFindClassSuccess(): void\n {\n $class = TypeMap::FindClass('Payment');\n $this->assertEquals(Payment::class, $class);\n }",
"function testGetRealClassname() {\n\t\t$result = $this->Task->getRealClassname('Model', 'Post');\n\t\t$this->assertEqual($result, 'Post');\n\n\t\t$result = $this->Task->getRealClassname('Controller', 'Posts');\n\t\t$this->assertEqual($result, 'PostsController');\n\n\t\t$result = $this->Task->getRealClassname('Helper', 'Form');\n\t\t$this->assertEqual($result, 'FormHelper');\n\n\t\t$result = $this->Task->getRealClassname('Behavior', 'Containable');\n\t\t$this->assertEqual($result, 'ContainableBehavior');\n\n\t\t$result = $this->Task->getRealClassname('Component', 'Auth');\n\t\t$this->assertEqual($result, 'AuthComponent');\n\t}",
"abstract protected function buildClass();",
"public function testOAuth2Manager () {\n // assertion to check if the file exists\n // $this->assertFileExists('../drupal8/modules/social_api/src/AuthManager/OAuth2Manager.php');\n\n $abstractClass = 'Drupal\\social_api\\AuthManager\\OAuth2Manager';\n\n //\n // checking for correct getClient and setClient methods\n //\n $mockAbstractClass = $this->getMockBuilder($abstractClass)\n // ->setMethods(array('setClient','getClient'))\n ->getMockForAbstractClass();\n // $mock->expects($this->once())\n // ->method('setClient')\n // ->with($this->equalTo('something'));\n\n $mockAbstractClass->setClient('12345');\n // var_dump($mockAbstractClass->getClient());\n $this->assertEquals('12345', $mockAbstractClass->getClient());\n\n //\n // checking for correct getAccessToken and getAccessToken methods\n //\n $mockAbstractClass = $this->getMockBuilder($abstractClass)\n // ->setMethods(array('setAccessToken','getAccessToken'))\n ->getMockForAbstractClass();\n // $mock->expects($this->once())\n // ->method('setClient')\n // ->with($this->equalTo('something'));\n\n $mockAbstractClass->setAccessToken('12345');\n // var_dump($mockAbstractClass->getAccessToken());\n $this->assertEquals('12345', $mockAbstractClass->getAccessToken());\n\n\n\n //check for functions if present\n $this->assertTrue(\n method_exists($mockAbstractClass, 'setClient'),\n 'OAuth2Manager does not have setClient function/method'\n );\n $this->assertTrue(\n method_exists($mockAbstractClass, 'getClient'),\n 'OAuth2Manager does not have getClient function/method'\n );\n $this->assertTrue(\n method_exists($mockAbstractClass, 'getAccessToken'),\n 'OAuth2Manager does not have getAccessToken function/method'\n );\n $this->assertTrue(\n method_exists($mockAbstractClass, 'setAccessToken'),\n 'OAuth2Manager does not have setAccessToken function/method'\n );\n }",
"public function testClassInstantiation()\n {\n $mockParser = $this->createMock(Parser::class);\n $object = new CachedParser(RoboFile::SOURCE_ROOT, self::CACHE_ROOT, $mockParser);\n $this->assertInstanceOf(\n 'WPCoreBootstrap\\DocumentationParser\\Parser',\n $object\n );\n }"
] | [
"0.70177656",
"0.6814339",
"0.6758835",
"0.6389257",
"0.6232759",
"0.62279284",
"0.6197914",
"0.6193288",
"0.6122772",
"0.60851204",
"0.60639495",
"0.60523385",
"0.60380554",
"0.6035866",
"0.6029828",
"0.60237074",
"0.60152787",
"0.6013679",
"0.6005713",
"0.5989852",
"0.5984979",
"0.5971",
"0.59285206",
"0.5926901",
"0.5910109",
"0.58821076",
"0.5877081",
"0.5871885",
"0.58373135",
"0.5822263"
] | 0.78495795 | 0 |
test bake() with a plugin param | function testBakeWithPlugin() {
$this->Task->plugin = 'TestTest';
$path = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'helpers' . DS . 'form.test.php';
$this->Task->expectAt(0, 'createFile', array($path, '*'));
$this->Task->bake('Helper', 'Form');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testBakeWithPlugin()\n {\n $this->_loadTestPlugin('BakeTest');\n $path = Plugin::path('BakeTest');\n\n $this->generatedFile = $path . 'src/Controller/BakeArticlesController.php';\n $this->exec('bake controller --connection test --no-test BakeTest.BakeArticles');\n\n $result = file_get_contents($this->generatedFile);\n $this->assertSameAsFile(__FUNCTION__ . '.php', $result);\n }",
"public function testMainWithPluginOption()\n {\n $this->_loadTestPlugin('Company/Pastry');\n $path = Plugin::path('Company/Pastry');\n\n $this->generatedFile = $path . 'src/Controller/BakeArticlesController.php';\n\n $this->exec('bake controller --connection test --no-test --plugin Company/Pastry bake_articles');\n $this->assertExitCode(Shell::CODE_SUCCESS);\n\n $this->assertFileExists($this->generatedFile);\n $this->assertFileContains('namespace Company\\Pastry\\Controller;', $this->generatedFile);\n $this->assertFileContains('BakeArticlesController extends AppController', $this->generatedFile);\n }",
"function testInteractiveWithPlugin() {\n\t\t$testApp = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS;\n\t\tApp::build(array(\n\t\t\t'plugins' => array($testApp)\n\t\t), true);\n\n\t\t$this->Task->plugin = 'TestPlugin';\n\t\t$path = $testApp . 'test_plugin' . DS . 'tests' . DS . 'cases' . DS . 'helpers' . DS . 'other_helper.test.php';\n\t\t$this->Task->setReturnValueAt(0, 'in', 5); //helper\n\t\t$this->Task->setReturnValueAt(1, 'in', 1); //OtherHelper\n\t\t$this->Task->expectAt(0, 'createFile', array($path, '*'));\n\t\t$this->Task->expectAt(9, 'out', array('1. OtherHelper'));\n\t\t$this->Task->execute();\n\t}",
"public function testMainWithPluginDot()\n {\n $this->_loadTestPlugin('Company/Pastry');\n $path = Plugin::path('Company/Pastry');\n\n $this->generatedFile = $path . 'src/Controller/BakeArticlesController.php';\n\n $this->exec('bake controller --connection test --no-test Company/Pastry.BakeArticles');\n $this->assertExitCode(Shell::CODE_SUCCESS);\n\n $this->assertFileExists($this->generatedFile);\n $this->assertFileContains('namespace Company\\Pastry\\Controller;', $this->generatedFile);\n $this->assertFileContains('BakeArticlesController extends AppController', $this->generatedFile);\n }",
"public function testBakeActions()\n {\n $this->generatedFile = APP . 'Controller/BakeArticlesController.php';\n $this->exec(\n 'bake controller --connection test --no-test ' .\n '--helpers Html,Time --components \"Csrf, Auth\" BakeArticles'\n );\n\n $this->assertExitCode(Shell::CODE_SUCCESS);\n $result = file_get_contents($this->generatedFile);\n $this->assertSameAsFile(__FUNCTION__ . '.php', $result);\n }",
"function testExecuteWithOneArg() {\n\t\t$this->Task->args[0] = 'Model';\n\t\t$this->Task->setReturnValueAt(0, 'in', 'TestTaskTag');\n\t\t$this->Task->setReturnValue('isLoadableClass', true);\n\t\t$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));\n\t\t$this->Task->execute();\n\t}",
"function testBakeModelTest() {\n\t\t$this->Task->setReturnValue('createFile', true);\n\t\t$this->Task->setReturnValue('isLoadableClass', true);\n\n\t\t$result = $this->Task->bake('Model', 'TestTaskArticle');\n\n\t\t$this->assertPattern('/App::import\\(\\'Model\\', \\'TestTaskArticle\\'\\)/', $result);\n\t\t$this->assertPattern('/class TestTaskArticleTestCase extends CakeTestCase/', $result);\n\n\t\t$this->assertPattern('/function startTest\\(\\)/', $result);\n\t\t$this->assertPattern(\"/\\\\\\$this->TestTaskArticle \\=\\& ClassRegistry::init\\('TestTaskArticle'\\)/\", $result);\n\n\t\t$this->assertPattern('/function endTest\\(\\)/', $result);\n\t\t$this->assertPattern('/unset\\(\\$this->TestTaskArticle\\)/', $result);\n\n\t\t$this->assertPattern('/function testDoSomething\\(\\)/i', $result);\n\t\t$this->assertPattern('/function testDoSomethingElse\\(\\)/i', $result);\n\n\t\t$this->assertPattern(\"/'app\\.test_task_article'/\", $result);\n\t\tif (PHP5) {\n\t\t\t$this->assertPattern(\"/'plugin\\.test_task\\.test_task_comment'/\", $result);\n\t\t}\n\t\t$this->assertPattern(\"/'app\\.test_task_tag'/\", $result);\n\t\t$this->assertPattern(\"/'app\\.articles_tag'/\", $result);\n\t}",
"public function testBakeTest()\n {\n $this->generatedFiles = [\n APP . 'Controller/BakeArticlesController.php',\n ROOT . 'tests/TestCase/Controller/BakeArticlesControllerTest.php',\n ];\n $this->exec('bake controller --connection test BakeArticles');\n\n $this->assertExitCode(Shell::CODE_SUCCESS);\n $this->assertFilesExist($this->generatedFiles);\n $this->assertFileContains(\n 'class BakeArticlesControllerTest extends TestCase',\n $this->generatedFiles[1]\n );\n $this->assertFileContains(\n 'use IntegrationTestTrait',\n $this->generatedFiles[1]\n );\n }",
"function testBakeControllerTest() {\n\t\t$this->Task->setReturnValue('createFile', true);\n\t\t$this->Task->setReturnValue('isLoadableClass', true);\n\n\t\t$result = $this->Task->bake('Controller', 'TestTaskComments');\n\n\t\t$this->assertPattern('/App::import\\(\\'Controller\\', \\'TestTaskComments\\'\\)/', $result);\n\t\t$this->assertPattern('/class TestTaskCommentsControllerTestCase extends CakeTestCase/', $result);\n\n\t\t$this->assertPattern('/class TestTestTaskCommentsController extends TestTaskCommentsController/', $result);\n\t\t$this->assertPattern('/var \\$autoRender = false/', $result);\n\t\t$this->assertPattern('/function redirect\\(\\$url, \\$status = null, \\$exit = true\\)/', $result);\n\n\t\t$this->assertPattern('/function startTest\\(\\)/', $result);\n\t\t$this->assertPattern(\"/\\\\\\$this->TestTaskComments \\=\\& new TestTestTaskCommentsController\\(\\)/\", $result);\n\t\t$this->assertPattern(\"/\\\\\\$this->TestTaskComments->constructClasses\\(\\)/\", $result);\n\n\t\t$this->assertPattern('/function endTest\\(\\)/', $result);\n\t\t$this->assertPattern('/unset\\(\\$this->TestTaskComments\\)/', $result);\n\n\t\t$this->assertPattern(\"/'app\\.test_task_article'/\", $result);\n\t\tif (PHP5) {\n\t\t\t$this->assertPattern(\"/'plugin\\.test_task\\.test_task_comment'/\", $result);\n\t\t}\n\t\t$this->assertPattern(\"/'app\\.test_task_tag'/\", $result);\n\t\t$this->assertPattern(\"/'app\\.articles_tag'/\", $result);\n\t}",
"public function bake(): void\n {\n }",
"public function testBakeComponents()\n {\n $this->generatedFile = APP . 'Controller/BakeArticlesController.php';\n $this->exec(\n 'bake controller --connection test --no-test --no-actions ' .\n '--components \"Csrf, Auth, Company/TestBakeThree.Something, TestBake.Other, Apple, NonExistent\" ' .\n 'BakeArticles'\n );\n\n $this->assertExitCode(Shell::CODE_SUCCESS);\n $result = file_get_contents($this->generatedFile);\n $this->assertSameAsFile(__FUNCTION__ . '.php', $result);\n }",
"public function bake()\n\t{\n\n\n\t}",
"public function testBakeActionsOption()\n {\n $this->generatedFile = APP . 'Controller/BakeArticlesController.php';\n $this->exec(\n 'bake controller --connection test --no-test ' .\n '--helpers Html,Time --components Csrf,Auth ' .\n '--actions login,logout BakeArticles'\n );\n\n $this->assertExitCode(Shell::CODE_SUCCESS);\n $result = file_get_contents($this->generatedFile);\n $this->assertSameAsFile(__FUNCTION__ . '.php', $result);\n }",
"function testExecuteWithTwoArgs() {\n\t\t$this->Task->args = array('Model', 'TestTaskTag');\n\t\t$this->Task->setReturnValueAt(0, 'in', 'TestTaskTag');\n\t\t$this->Task->setReturnValue('isLoadableClass', true);\n\t\t$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));\n\t\t$this->Task->execute();\n\t}",
"function activate_test_plugin() {\n\tInc\\Base\\Activate::activate();\n}",
"function run_default()\n{\n pake_echo ( \"eZ Extension Builder ver.\" . eZExtBuilder::$version . \"\\nSyntax: php pakefile.php [--\\$general-options] \\$task [\\$extension] [--\\$task-options].\\n If no extension name is provided, a default configuration file will be searched for.\\n Run: php pakefile.php --tasks to learn more about available tasks.\" );\n}",
"public function testMainNoArgs()\n {\n $this->exec('bake controller');\n\n $this->assertExitCode(Shell::CODE_SUCCESS);\n $this->assertOutputContains('Possible controllers based on your current database');\n $this->assertOutputContains('- BakeArticles');\n }",
"public function testPrepare()\n {\n $this->todo('stub');\n }",
"public function testRunFront(): void {\n\t\texpect( 'is_admin' )\n\t\t\t->once()\n\t\t\t->withNoArgs()\n\t\t\t->andReturn( false );\n\t\t$front = \\Mockery::mock( Front::class );\n\t\t$front\n\t\t\t->shouldReceive( 'hooks' )\n\t\t\t->once()\n\t\t\t->withNoArgs();\n\t\t$injector = \\Mockery::mock( Injector::class );\n\t\t$injector\n\t\t\t->shouldReceive( 'make' )\n\t\t\t->once()\n\t\t\t->with( Front::class )\n\t\t\t->andReturn( $front );\n\t\t$plugin = new Plugin( $injector );\n\n\t\t$plugin->run();\n\t}",
"public function testRequiresCommandPlugin()\n {\n $this->setConfig('weather.partner_id', '1111');\n $this->setConfig('weather.license_key', '1111');\n\n $this->assertRequiresPlugin(array('Command', 'Http', 'Temperature'));\n $this->plugin->onLoad();\n }",
"function run_convert_configuration( $task=null, $args=array(), $cliopts=array() )\n{\n $extname = @$args[0];\n if ( $extname == '' )\n {\n $extname = dirname( __FILE__ );\n }\n while ( !is_file( \"ant/$extname.properties\" ) )\n {\n $extname = pake_input( 'What is the name of the current extension?' );\n if ( !is_file( \"ant/$extname.properties\" ) )\n {\n pake_echo( \"File ant/$extname.properties not found\" );\n }\n }\n\n eZExtBuilder::convertPropertyFileToYamlFile(\n \"ant/$extname.properties\",\n \"pake/options-$extname.yaml\",\n array( $extname => '', 'external' => 'dependencies', 'dependency' => 'extensions', 'repository' => array( 'svn', 'url' ) ),\n \"extension:\\n name: $extname\\n\\n\" );\n\n foreach( array( 'files.to.parse.txt' => 'to_parse', 'files.to.exclude.txt' => 'to_exclude' ) as $file => $option )\n {\n $src = \"ant/$file\";\n //$dst = \"pake/$file\";\n if ( file_exists( $src ) )\n {\n //$ok = !file_exists( $dst ) || ( pake_input( \"Destionation file $dst exists. Overwrite? [y/n]\", 'n' ) == 'y' );\n //$ok && pake_copy( $src, $dst, array( 'override' => true ) );\n if ( count( $in = file( $src, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES ) ) )\n {\n $in = \"\\n\\nfiles:\\n $option: [\" . implode( ', ', $in ) . \"]\\n\";\n file_put_contents( \"pake/options-$extname.yaml\", $in, FILE_APPEND );\n }\n }\n }\n}",
"function run_default()\n{\n pake_echo ( \"eZ Publish Community Project Builder ver.\" . eZPCPBuilder::$version . \"\\nSyntax: php pakefile.php [--\\$general-options] \\$task [--\\$task-options].\\n Run: php pakefile.php --tasks to learn more about available tasks.\" );\n}",
"public function testMainIntoAll()\n {\n if ($this->Task->listAll()[0] != 'bake_articles') {\n $this->markTestSkipped('Additional tables detected.');\n }\n\n $this->Task->connection = 'test';\n $this->Task->params = ['helpers' => 'Time,Text'];\n\n $this->Task->Test->expects($this->atLeastOnce())\n ->method('bake');\n\n $filename = $this->_normalizePath(APP . 'Controller/BakeArticlesController.php');\n $this->Task->expects($this->at(1))\n ->method('createFile')\n ->with($filename, $this->logicalAnd(\n $this->stringContains('class BakeArticlesController'),\n $this->stringContains(\"\\$helpers = ['Time', 'Text']\")\n ))\n ->will($this->returnValue(true));\n\n $this->Task->all();\n }",
"public function testBakeNoActions()\n {\n $this->generatedFile = APP . 'Controller/BakeArticlesController.php';\n $this->exec(\n 'bake controller --connection test --no-test ' .\n '--helpers Html,Time --components Csrf,Auth --no-actions BakeArticles'\n );\n\n $this->assertExitCode(Shell::CODE_SUCCESS);\n $result = file_get_contents($this->generatedFile);\n $this->assertSameAsFile(__FUNCTION__ . '.php', $result);\n }",
"function run_build( $task=null, $args=array(), $cliopts=array() )\n{\n}",
"function run_tool_upgrade( $task=null, $args=array(), $cliopts=array() )\n{\n $latest = eZExtBuilder::latestVersion( true );\n if ( $latest == false )\n {\n pake_echo ( \"Cannot download latest version available. Please check that you can connect to the internet\" );\n }\n else\n {\n // 1st get the whole 'pake' dir contents, making a backup copy\n $tmpzipfile = tempnam( \"tmp\", \"zip\" );\n $zipfile = dirname( __FILE__ ) . '/pake/pakedir-' . eZExtBuilder::$version . '.zip';\n eZExtBuilder::archiveDir( dirname( __FILE__ ) . '/pake', $tmpzipfile, ezcArchive::ZIP );\n @unlink( $zipfile ); // otherwise pake_rename might complain\n pake_rename( $tmpzipfile, $zipfile );\n eZExtBuilder::bootstrap();\n\n // then update the pakefile itself, making a backup copy\n pake_copy( __FILE__, dirname( __FILE__ ) . '/pake/pakefile-' . eZExtBuilder::$version . '.php', array( 'override' => true ) );\n /// @todo test: does this work on windows?\n file_put_contents( __FILE__, $latest );\n }\n}",
"function run_fflguard_dropbox() {\n\n $plugin = new Fflguard_Dropbox();\n\n}",
"function framework() {\n $this->_runTest(implode('/', func_get_args()), 'framework');\n }",
"function run_PLUGIN_NAME_c48ce1f2cbe65268365d7b3499ceeb6c() {\n\t// Plugin dependencies via composer\n\trequire_once __DIR__ . '/vendor/autoload.php';\n\n\t// WRITE THINGS BELOW...\n\n}",
"public function testbinAutoloaderWorks()\n {\n $test = Proto\\ProtoConfig::test();\n $this->assertTrue($test);\n }"
] | [
"0.7562904",
"0.6925482",
"0.6364247",
"0.6262748",
"0.60608286",
"0.59246963",
"0.59009814",
"0.5894062",
"0.57549816",
"0.5678259",
"0.56422526",
"0.5639985",
"0.5616747",
"0.55837417",
"0.5561962",
"0.5513563",
"0.5436617",
"0.54121727",
"0.5398213",
"0.5387761",
"0.5382603",
"0.53478307",
"0.5310365",
"0.53041655",
"0.5270866",
"0.5264078",
"0.5243132",
"0.5231663",
"0.5224747",
"0.5210263"
] | 0.723617 | 1 |
test interactive with plugins lists from the plugin | function testInteractiveWithPlugin() {
$testApp = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS;
App::build(array(
'plugins' => array($testApp)
), true);
$this->Task->plugin = 'TestPlugin';
$path = $testApp . 'test_plugin' . DS . 'tests' . DS . 'cases' . DS . 'helpers' . DS . 'other_helper.test.php';
$this->Task->setReturnValueAt(0, 'in', 5); //helper
$this->Task->setReturnValueAt(1, 'in', 1); //OtherHelper
$this->Task->expectAt(0, 'createFile', array($path, '*'));
$this->Task->expectAt(9, 'out', array('1. OtherHelper'));
$this->Task->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mg_test_all_plugins_individually( $plugin_list ) {\n\n\t$current_url = mg_get_current_url();\n\n\tforeach ( $plugin_list as $plugin ):\n\n\t\t// Make a new call\n\t\t$http_result = get_http_code_from_curl_call( mg_get_current_url() . '?' . MGWPC_GET_PARAMETER . '=test', $plugin );\n\n\t\tmg_print_result( $http_result, $plugin );\n\n\tendforeach;\n\n}",
"private function _plugin_list() {\n\t\t$plugins = $this->get_plugins( $_GET );\n\n\t\techo format_table( $plugins, $_GET['host'], 'plugins' );\n\t}",
"abstract protected function plugins();",
"public function test_get_all_plugin_info() {\n\t\t$plugin = $this->plugin;\n\n\t\t$plugin = $plugin->get( '*', 'extensions-for-grifus' );\n\n\t\t$this->assertContains( 'extensions-for-grifus', $plugin['slug'] );\n\t}",
"function execPluginsByHook($hook, $args = array()) {\n global $plugins;\n foreach ($plugins[$hook] as $plugin) {\n echo call_user_func_array(array($plugin, $hook), $args);\n }\n}",
"public function getPlugins();",
"function plugins($url = null, $proxy = false) {\n while (empty($url)) {\n $url = $this->_select();\n }\n $this->_show($url, $proxy);\n }",
"function mg_whitescreen_plugin_checker( $plugin_list ) {\n\n\t// Check for the defiend GET parameter.\n\tif( ! empty( $_GET[ MGWPC_GET_PARAMETER ] ) ):\n\n\t\tprint_r( '<p>Starting the plugins analysis.</p>' );\n\n\t\t// Select the type of Testing.\n\t\tswitch ( $_GET[ MGWPC_GET_PARAMETER ] ):\n\t\t\tcase 'complete': // Checks all possible combinations.\n\t\t\t\tmg_test_all_plugins_combinations( $plugin_list );\n\t\t\t\tbreak;\n\t\t\tcase 'individually': // Checks every plugin individually.\n\t\t\t\tmg_test_all_plugins_individually( $plugin_list );\n\t\t\t\tbreak;\n\t\t\tcase 'test': // Modify the current $plugin_list parameter to check the HTTP Code.\n\t\t\t\t$plugin_list = empty( $_POST ) ? [] : explode( ',', $_POST['plugins'] );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\tendswitch;\n\n\t\t// Show final test message.\n\t\tswitch ( $_GET[ MGWPC_GET_PARAMETER ] ):\n\t\t\tcase 'complete':\n\t\t\tcase 'individually':\n\t\t\t\tprint_r( '<p>Test completed.</p>' );\n\t\t\t\texit;\n\t\tendswitch;\n\n\tendif;\n\n\t// Otherwise it continues the normal flow of the filter.\n\treturn $plugin_list;\n}",
"function activate_test_plugin() {\n\tInc\\Base\\Activate::activate();\n}",
"public function getSubPlugins();",
"public function testListObjectsInPlugin() {\n\t\tApp::build(array(\n\t\t\t'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),\n\t\t\t'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)\n\t\t), App::RESET);\n\t\tCakePlugin::load(array('TestPlugin', 'TestPluginTwo'));\n\n\t\t$result = App::objects('TestPlugin.model');\n\t\t$this->assertTrue(in_array('TestPluginPost', $result));\n\t\t$result = App::objects('TestPlugin.Model');\n\t\t$this->assertTrue(in_array('TestPluginPost', $result));\n\n\t\t$result = App::objects('TestPlugin.behavior');\n\t\t$this->assertTrue(in_array('TestPluginPersisterOneBehavior', $result));\n\t\t$result = App::objects('TestPlugin.Model/Behavior');\n\t\t$this->assertTrue(in_array('TestPluginPersisterOneBehavior', $result));\n\n\t\t$result = App::objects('TestPlugin.helper');\n\t\t$expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper');\n\t\t$this->assertEquals($expected, $result);\n\t\t$result = App::objects('TestPlugin.View/Helper');\n\t\t$expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$result = App::objects('TestPlugin.component');\n\t\t$this->assertTrue(in_array('OtherComponent', $result));\n\t\t$result = App::objects('TestPlugin.Controller/Component');\n\t\t$this->assertTrue(in_array('OtherComponent', $result));\n\n\t\t$result = App::objects('TestPluginTwo.behavior');\n\t\t$this->assertSame(array(), $result);\n\t\t$result = App::objects('TestPluginTwo.Model/Behavior');\n\t\t$this->assertSame(array(), $result);\n\n\t\t$result = App::objects('model', null, false);\n\t\t$this->assertTrue(in_array('Comment', $result));\n\t\t$this->assertTrue(in_array('Post', $result));\n\n\t\t$result = App::objects('Model', null, false);\n\t\t$this->assertTrue(in_array('Comment', $result));\n\t\t$this->assertTrue(in_array('Post', $result));\n\n\t\tApp::build();\n\t}",
"public function getAvailablePlugins();",
"function mg_test_all_plugins_combinations( $plugin_list ) {\n\n\t// Get all the possible combinations.\n\t$plugins_combinations = mg_create_array_combinations( $plugin_list );\n\n\tforeach ( $plugins_combinations as $plugins_combination ):\n\n\t\t// Make a new call\n\t\t$http_result = get_http_code_from_curl_call( mg_get_current_url() . '?' . MGWPC_GET_PARAMETER . '=test', $plugins_combination );\n\n\t\tmg_print_result( $http_result, $plugins_combination );\n\n\tendforeach;\n\n}",
"function amc_run_plugin() {\n\n\tamc_define_constants();\n\n\t$plugin = new Admin_Menu_Control();\n\n}",
"public function tablist()\n {\n $this->beforeAction();\n $view = Piwik_View::factory('tablist');\n $plugins = $this->manager->setRelease($this->release)\n ->getCurrentPlugins();\n $view->pluginsName = $plugins;\n $view->debug = print_r($plugins, true);\n $this->render($view);\n }",
"function load_plugins()\n{\n global $conf, $pwg_loaded_plugins;\n $pwg_loaded_plugins = array();\n if ($conf['enable_plugins'])\n {\n $plugins = get_db_plugins('active');\n foreach( $plugins as $plugin)\n {// include main from a function to avoid using same function context\n load_plugin($plugin);\n }\n trigger_notify('plugins_loaded');\n }\n}",
"public function getSystemPlugins();",
"public function plugins ()\n {\n }",
"function listPlugins( ){\n global $lang, $config;\n\n if( !isset( $_SESSION['sPluginsList'] ) ){\n $sPlugins = getContentFromUrl( 'http://opensolution.org/plugins.html' );\n if( !empty( $sPlugins ) )\n $_SESSION['sPluginsList'] = $sPlugins;\n }\n\n if( isset( $_SESSION['sPluginsList'] ) ){\n $sInstalledPlugins = null;\n if( isset( $config['plugins_installed'] ) && !empty( $config['plugins_installed'] ) ){\n $aPluginsInstalled = unserialize( $config['plugins_installed'] );\n $sInstalledPlugins = null;\n foreach( $aPluginsInstalled as $sPluginName => $bValue ){\n $sInstalledPlugins .= '\"'.$sPluginName.'\", ';\n } // end foreach\n $sInstalledPlugins = '<script>var aPluginsInstalled = [ '.$sInstalledPlugins.' ];</script>';\n }\n return Array( $sInstalledPlugins, $_SESSION['sPluginsList'] );\n }\n}",
"public function pluginMain();",
"public function testGetOptionParser() {\n\t\t$this->Shell->name = 'test';\n\t\t$this->Shell->plugin = 'plugin';\n\t\t$parser = $this->Shell->getOptionParser ();\n\t\t\n\t\t$this->assertEquals ( 'plugin.test', $parser->command () );\n\t}",
"public static function onPluginsLoadedCallPlugins(){\r\n\t\t\r\n\t\tdo_action(\"addon_library_register_plugins\");\r\n\t\t\r\n\t\tUniteProviderFunctionsUC::doAction(UniteCreatorFilters::ACTION_EDIT_GLOBALS);\r\n\t\t\r\n\t}",
"public function test_with_inactive_plugins()\n {\n $this->constants = new TestConstants([\n 'ABSPATH' => codecept_root_dir($this->env('WORDPRESS_ROOT_DIR') . '/'),\n 'WP_HOME' => $this->env('WORDPRESS_URL'),\n 'WP_SITEURL' => $this->env('WORDPRESS_URL'),\n 'DB_HOST' => $this->env('WORDPRESS_DB_HOST'),\n 'DB_NAME' => $this->env('WORDPRESS_DB_NAME'),\n 'DB_PASSWORD' => $this->env('WORDPRESS_DB_PASSWORD'),\n 'DB_USER' => $this->env('WORDPRESS_DB_USER'),\n 'WP_PLUGIN_DIR' => codecept_data_dir('plugins')\n ]);\n $GLOBALS['table_prefix'] = 'wp_';\n $database = $this->stubProphecy(WordPressDatabase::class);\n $database->getTablePrefix(Arg::type('string'))->willReturn('wp_');\n $database->checkDbConnection(Arg::cetera())->willReturn(true);\n $database->query('SHOW TABLES')->willReturn(Tables::blogTables('wp_'));\n $database->getOption('siteurl', false)->willReturn('http://wp.localhost');\n $database->getOption('template', false)->willReturn('twentytwenty');\n $database->getOption('stylesheet', false)->willReturn('twentytwenty');\n $database->getOption('active_plugins', false)->willReturn(serialize([]));\n $this->database = $database->reveal();\n $sut = $this->make_instance();\n\n $this->assertMatchesJsonSnapshot(json_encode($sut->run(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));\n }",
"public function testInteractiveHelp(): void\n {\n $this->exec('i18n', ['h', 'q']);\n $this->assertExitSuccess();\n $this->assertOutputContains('cake i18n');\n }",
"function testCaseList() {\n\n\t}",
"public function testPluginInstance()\n {\n $this->assertInstanceOf(\n <%= pluginHandle %>::class,\n <%= pluginHandle %>::$plugin\n );\n }",
"public function importpluginprovider() {\n global $CFG;\n\n $runs = array(\n array('import', 'rlipimport_version1', ''),\n array('import', 'rlipimport_version1', RLIP_DEFAULT_LOG_PATH),\n array('export', 'rlipexport_version1', ''),\n array('export', 'rlipexport_version1', RLIP_DEFAULT_LOG_PATH),\n );\n\n if (file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n // Add the PM plugins if applicable.\n $pmruns = array(\n array('import', 'rlipimport_version1elis', ''),\n array('import', 'rlipimport_version1elis', RLIP_DEFAULT_LOG_PATH),\n array('export', 'rlipexport_version1elis', ''),\n array('export', 'rlipexport_version1elis', RLIP_DEFAULT_LOG_PATH),\n );\n\n $runs = array_merge($runs, $pmruns);\n }\n\n return $runs;\n }",
"private function load_plugins() {\n\t\t$file = file_get_contents( CAF_DIR . 'addons.json' );\n\t\t$this->plugins = json_decode( $file );\n\t}",
"function test_template_plugin() {\n $this->demo_plugin->set_current_page('signin');\n $this->assertContains('templates/wpuc-signin.php', $this->demo_plugin->load_template_id('signin'));\n }",
"public function getInstalledPlugins();"
] | [
"0.6724515",
"0.61676955",
"0.6121601",
"0.5949399",
"0.58380055",
"0.5832735",
"0.5810866",
"0.57854146",
"0.57846844",
"0.5768904",
"0.5746376",
"0.57367927",
"0.56757015",
"0.56480473",
"0.5639009",
"0.562478",
"0.5619669",
"0.5597087",
"0.5541624",
"0.54996914",
"0.5453378",
"0.54012334",
"0.5400952",
"0.53962255",
"0.5393451",
"0.539215",
"0.5376478",
"0.5372092",
"0.5364149",
"0.53283495"
] | 0.67000204 | 1 |
Test filename generation for each type + plugins | function testTestCaseFileName() {
$this->Task->path = '/my/path/tests/';
$result = $this->Task->testCaseFileName('Model', 'Post');
$expected = $this->Task->path . 'cases' . DS . 'models' . DS . 'post.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Helper', 'Form');
$expected = $this->Task->path . 'cases' . DS . 'helpers' . DS . 'form.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Controller', 'Posts');
$expected = $this->Task->path . 'cases' . DS . 'controllers' . DS . 'posts_controller.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Behavior', 'Containable');
$expected = $this->Task->path . 'cases' . DS . 'behaviors' . DS . 'containable.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Component', 'Auth');
$expected = $this->Task->path . 'cases' . DS . 'components' . DS . 'auth.test.php';
$this->assertEqual($result, $expected);
$this->Task->plugin = 'TestTest';
$result = $this->Task->testCaseFileName('Model', 'Post');
$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php';
$this->assertEqual($result, $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetExtFromType() {\n\t\t$this->assertEquals(array('jpe', 'jpeg', 'jpg'), MimeType::getExtFromType('image/jpeg'));\n\t\t$this->assertEquals('jpg', MimeType::getExtFromType('image/jpeg', true));\n\t\t$this->assertEquals(array('png'), MimeType::getExtFromType('image/png'));\n\t\t$this->assertEquals(array(), MimeType::getExtFromType('foo/bar'));\n\t\t$this->assertEquals('txt', MimeType::getExtFromType('text/plain', true));\n\t}",
"public function testFilename(): void\n {\n $this->BackupExport->filename('backup.sql.bz2');\n $this->assertSame(Configure::read('DatabaseBackup.target') . 'backup.sql.bz2', $this->BackupExport->filename);\n $this->assertSame('bzip2', $this->BackupExport->compression);\n $this->assertSame('sql.bz2', $this->BackupExport->extension);\n\n //Compression is ignored, because there's a filename\n $this->BackupExport->compression('gzip')->filename('backup.sql.bz2');\n $this->assertSame('backup.sql.bz2', basename($this->BackupExport->filename));\n $this->assertSame('bzip2', $this->BackupExport->compression);\n $this->assertSame('sql.bz2', $this->BackupExport->extension);\n\n //Filename with `{$DATABASE}` pattern\n $this->BackupExport->filename('{$DATABASE}.sql');\n $this->assertSame('test.sql', basename($this->BackupExport->filename));\n\n //Filename with `{$DATETIME}` pattern\n $this->BackupExport->filename('{$DATETIME}.sql');\n $this->assertMatchesRegularExpression('/^\\d{14}\\.sql$/', basename($this->BackupExport->filename));\n\n //Filename with `{$HOSTNAME}` pattern\n $this->BackupExport->filename('{$HOSTNAME}.sql');\n $this->assertSame('localhost.sql', basename($this->BackupExport->filename));\n\n //Filename with `{$TIMESTAMP}` pattern\n $this->BackupExport->filename('{$TIMESTAMP}.sql');\n $this->assertMatchesRegularExpression('/^\\d{10}\\.sql$/', basename($this->BackupExport->filename));\n\n //With invalid extension\n $this->expectExceptionMessage('Invalid `txt` file extension');\n $this->BackupExport->filename('backup.txt');\n }",
"public function testFormatterFileExtension() {\n $entity_display = EntityViewDisplay::create([\n 'targetEntityType' => 'file',\n 'bundle' => 'file',\n ]);\n $entity_display->setComponent('filename', ['type' => 'file_extension']);\n\n $expected = ['png', 'tar', 'gz', ''];\n foreach (array_values($this->files) as $i => $file) {\n $build = $entity_display->build($file);\n $this->assertEquals($expected[$i], $build['filename'][0]['#markup']);\n }\n\n $entity_display->setComponent('filename', ['type' => 'file_extension', 'settings' => ['extension_detect_tar' => TRUE]]);\n\n $expected = ['png', 'tar', 'tar.gz', ''];\n foreach (array_values($this->files) as $i => $file) {\n $build = $entity_display->build($file);\n $this->assertEquals($expected[$i], $build['filename'][0]['#markup']);\n }\n }",
"private function writeFileNames($itemType=NULL){\n\t\t\n\t\t//target file\n\t\t$fileName = '';\n\t\t\n\t\t//galon grand\n\t\tif('GALON_GRANDS' == $itemType){\t\t\t\n\t\t\t$fileName = $this::GALON_FILE_GENERATED;\t\t\t\n\t\t//galon petits\n\t\t}elseif('GALON_PETITS'== $itemType){\t\t\t\n\t\t\t$fileName = $this::GALON_P_FILE_GENERATED;\n\t\t//bordure exterieure\n\t\t}elseif('BORDURE'== $itemType){\t\t\t\n\t\t\t$fileName = $this::BORDURE_FILE_GENERATED;\n\t\t//strass\n\t\t}elseif('STRASS'== $itemType){\t\t\t\n\t\t\t$fileName = $this::STRASS_FILE_GENERATED;\t\t\n\t\t//basebordure\n\t\t}elseif('BASEBORDURE'== $itemType){\t\t\t\n\t\t\t$fileName = $this::BASEBORDURE_FILE_GENERATED;\n\t\t//colors\t\t\t\n\t\t}elseif('COLOR'== $itemType){\t\t\t\n\t\t\t$fileName = $this::COLOR_FILE_GENERATED;\t\t\t\n\t\t}\n\t\t\n\t\t//empty the file\n\t\tfile_put_contents($fileName , '');\n\t\t\n\t\t//fill the file\n\t\tforeach($this->_fileNames AS $value){\n\t\t\t$value .= \"\\n\";\n\t\t\tfile_put_contents($fileName , $value, FILE_APPEND);\n\t\t}\n\t}",
"protected function generateFiles()\n {\n $mode = $this->option('extended') ? 'extended' : 'default';\n\n $pluginFiles = $this->pluginFiles[$mode];\n\n foreach ($pluginFiles as $key => $file) {\n $file = $this->formatContent($file);\n\n $this->files->put($this->getDestinationFile($file), $this->getStubContent($key, $mode));\n }\n\n // Generate the Language files\n $slug = $this->data['slug'];\n\n $pluginPath = $this->getPluginPath($slug);\n\n $content ='<?php\n\nreturn array (\n);';\n\n $languageFolders = $this->getLanguagePaths($slug);\n\n foreach ($languageFolders as $folder) {\n $path = $pluginPath .$folder .DS .'messages.php';\n\n $this->files->put($path, $content);\n }\n }",
"public function fileNameProvider() {\n return array(\n array('drupal-123-node-123.xlf', 'drupal-123', array('type' => 'node', 'identifier' => 123)),\n array('drupal-123-taxonomy_term-999999.xlf', 'drupal-123', array('type' => 'taxonomy_term', 'identifier' => 999999)),\n array('Not-real-111.xlf', 'drupal-123', array()),\n array('drupal-123-12345-node.xlf', 'drupal-123', array()),\n array('Another file', 'drupal-123', array()),\n );\n }",
"public function testGetImageType()\n {\n $oGen = $this->getMock( \"oxDynImgGenerator\", array( \"_getImageName\" ) );\n $oGen->expects( $this->at( 0 ) )->method( '_getImageName' )->will( $this->returnValue( \"test.jpg\" ) );\n $oGen->expects( $this->at( 1 ) )->method( '_getImageName' )->will( $this->returnValue( \"test.jpeg\" ) );\n $oGen->expects( $this->at( 2 ) )->method( '_getImageName' )->will( $this->returnValue( \"test.png\" ) );\n $oGen->expects( $this->at( 3 ) )->method( '_getImageName' )->will( $this->returnValue( \"test.gif\" ) );\n $oGen->expects( $this->at( 4 ) )->method( '_getImageName' )->will( $this->returnValue( \"test\" ) );\n $oGen->expects( $this->at( 5 ) )->method( '_getImageName' )->will( $this->returnValue( \"test.php\" ) );\n $oGen->expects( $this->at( 6 ) )->method( '_getImageName' )->will( $this->returnValue( \"test.exe\" ) );\n\n $this->assertEquals( \"jpeg\", $oGen->UNITgetImageType() );\n $this->assertEquals( \"jpeg\", $oGen->UNITgetImageType() );\n $this->assertEquals( \"png\", $oGen->UNITgetImageType() );\n $this->assertEquals( \"gif\", $oGen->UNITgetImageType() );\n $this->assertFalse( $oGen->UNITgetImageType() );\n $this->assertFalse( $oGen->UNITgetImageType() );\n $this->assertFalse( $oGen->UNITgetImageType() );\n }",
"function filetype ($filename) {}",
"function addPluginType($suffix, $objectName) {\n\tglobal $_zp_extra_filetypes;\n\t$_zp_extra_filetypes[strtolower($suffix)] = $objectName;\n}",
"public function testGetFileName() {\n \tself::assertEquals('methods.php', basename($this->fctM1->getFileName()));\n }",
"public function testName() {\n\t\t$this->assertEquals('file', $this->object->name());\n\t\t$this->assertEquals('temp', $this->temp->name());\n\t}",
"public function testGetFilename() {\n $sut = $this->entityTypeManager->getHandler('commerce_order', 'entity_print');\n assert($sut instanceof OrderRenderer);\n $order = Order::create([\n 'id' => '123',\n 'type' => 'default',\n ]);\n $filename = $sut->getFilename([$order]);\n $this->assertEquals('Order document receipt', (string) $filename);\n\n $second_order = Order::create([\n 'id' => '789',\n 'type' => 'default',\n ]);\n $filename = $sut->getFilename([$order, $second_order]);\n $this->assertEquals('Order document receipts', (string) $filename);\n }",
"private static function _createFileName($type = self::FILE_MISCELLANEOUS)\n {\n global $current_user;\n $importdir = self::getImportDir();\n // ensure dir exists and writable\n UploadStream::ensureDir($importdir, true);\n\n return \"$importdir/{$type}_{$current_user->id}.csv\";\n }",
"function custom_wp_check_filetype_and_ext($filetype_and_ext, $file, $filename) {\n if(!$filetype_and_ext['ext'] || !$filetype_and_ext['type'] || !$filetype_and_ext['proper_filename']) {\n $extension = pathinfo($filename)['extension'];\n $mime_type = mime_content_type($file);\n $allowed_ext = array(\n 'dwg' => array('image/vnd.dwg', 'application/octet-stream'),\n 'DWG' => array('image/vnd.dwg', 'application/octet-stream'),\n 'ai' => array('application/postscript'),\n );\n if($allowed_ext[$extension]) {\n if(in_array($mime_type, $allowed_ext[$extension])) {\n $filetype_and_ext['ext'] = $extension;\n $filetype_and_ext['type'] = $mime_type;\n $filetype_and_ext['proper_filename'] = $filename;\n }\n }\n }\n return $filetype_and_ext;\n}",
"public function testAddFileExtension() {\n\t\t\t$oOutput = new \\inviqa\\Output\\Csv();\n\t\t\t\n\t\t\t// Assert that an extension is added when doesn't exist\n\t\t\t$sFilename = \"no-extension\";\n\t\t\t$sFilenameResult = $oOutput->addFileExtension($sFilename);\n\t\t\t$this->assertEquals($sFilename . \".csv\", $sFilenameResult);\n\t\t\t\n\t\t\t// Assert that an extension isn't added when one exist\n\t\t\t$sFilename = \"extension.csv\";\n\t\t\t$sFilenameResult = $oOutput->addFileExtension($sFilename);\n\t\t\t$this->assertEquals($sFilename, $sFilenameResult);\n\t\t}",
"function testFilePathGeneration() {\n\t\t$file = TESTS . 'cases' . DS . 'models' . DS . 'my_class.test.php';\n\n\t\t$this->Task->Dispatch->expectNever('stderr');\n\t\t$this->Task->Dispatch->expectNever('_stop');\n\n\t\t$this->Task->setReturnValue('in', 'y');\n\t\t$this->Task->expectAt(0, 'createFile', array($file, '*'));\n\t\t$this->Task->bake('Model', 'MyClass');\n\n\t\t$this->Task->expectAt(1, 'createFile', array($file, '*'));\n\t\t$this->Task->bake('Model', 'MyClass');\n\n\t\t$file = TESTS . 'cases' . DS . 'controllers' . DS . 'comments_controller.test.php';\n\t\t$this->Task->expectAt(2, 'createFile', array($file, '*'));\n\t\t$this->Task->bake('Controller', 'Comments');\n\t}",
"function get_file_substitution_values($handle, $type, $author, $override) {\n $subs = array();\n $subs['dir'] = handle_to_path($handle, $type);\n\n if(0 == strcmp(\"controller\", $type)) {\n $subs['class'] = handle_to_controller($handle);\n } else {\n $subs['class'] = handle_to_class($handle, $type);\n }\n\n list($plugin, $class) = explode(\"/\", $handle);\n list($codepool, $company, $plugin_dir) = explode(\"/\", module_path($plugin));\n\n $subs['filename'] = handle_to_file( $handle, $type );\n $subs['output_file'] = \"{$subs['dir']}/{$subs['filename']}\";\n $subs['package'] = $company;\n\n $subs['description'] = cmd_switch(\"description\");\n if(!$subs['description']) {\n $subs['description'] = user_text(\"Enter a description for the file\");\n }\n\n $subs['plugin'] = $plugin_dir;\n\n $subs['author'] = cmd_switch(\"author\");\n if(!$subs['author']) {\n $subs['author'] = user_text(\"Who is the author of the plugin\", $author);\n }\n $subs['copyright'] = date(\"Y\").\" \".$subs['author'];\n\n if(file_exists($subs['output_file'])) { throw new Exception(\"Class already exists, so I can't create it again, amirite?\"); }\n\n // FIXME\n $subs['extends'] = \"\";\n if($override) { $subs['extends'] = \" extends $override\"; }\n\n return $subs;\n}",
"protected function getFilename($type) {\n\n\t\t// File Name\n\t\tif (!empty($type)) {\n\t\t\treturn $type . \".\" . $this->logExtension;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public function generateFiles()\n {\n $bundles = $this->bundles;\n\n //parse the bundles\n foreach ($bundles as $bundleName) {\n $this->logger->info('Bundle analysed: '. $bundleName);\n\n //the path of the files\n $allMetadata = $this->doctrineHelper->getMetadata($bundleName);\n\n /** @var ClassMetadata $meta */\n foreach ($allMetadata as $meta) {\n $customRepositoryClassName = $meta->customRepositoryClassName;\n if ($meta->customRepositoryClassName === null) {\n $this->logger->info('SKIPPING entity: '. $meta->name);\n continue;\n }\n\n $this->logger->info('Entity: '. $meta->name);\n $renderedTemplate = $this->generateRepository($allMetadata, $bundleName, $meta);\n\n //store the generated content\n $reflector = new \\ReflectionClass($customRepositoryClassName);\n $originalRepostoryPath = $reflector->getFileName();\n $fullPath = str_replace('.php', 'Base.php', $originalRepostoryPath);\n\n $this->persister->persistClass($fullPath, $renderedTemplate);\n }\n }\n }",
"protected function filename($type)\n {\n // get filename\n if (!($filename = $this->options[$type])) {\n return false;\n }\n\n // check for directory\n if (!file_exists($this->basepath)) {\n $oldUmask = umask(0);\n mkdir($this->basepath, $this->options['umask_directory'], true);\n umask($oldUmask);\n }\n\n // create full logfile name (incl. name passing through strftime\n $fullFilename = $this->basepath.strftime($filename);\n\n // create the logfile of not existing\n if (!file_exists($fullFilename)) {\n file_put_contents($fullFilename, '');\n chmod($fullFilename, $this->options['umask']);\n }\n\n return $fullFilename;\n }",
"public function testFileExtension(): void\n {\n $formatter = new Xml($this->serializer->reveal());\n $this->assertEquals('.xml', $formatter->getExtension());\n }",
"public function test_EXT_paths() {\r\n\t\t$folder = 'EXT:js_css_optimizer/tests/hooks/fixtures/';\r\n\t\t$jsLibs = array ();\r\n\t\t$jsFiles = array ();\r\n\t\t$jsFooterFiles = array ();\r\n\t\t$cssFiles = array ($folder . 'testpath1.css' => array (), $folder . 'testpath2.css' => array (), $folder . 'testpath3.css' => array (), $folder . 'testpath4.css' => array () );\r\n\t\t$args = array ('jsLibs' => &$jsLibs, 'jsFiles' => &$jsFiles, 'jsFooterFiles' => &$jsFooterFiles, 'cssFiles' => &$cssFiles );\r\n\t\t$this->concatenateHandler->process ( $args );\r\n\t\t$this->assertEquals ( 1, count ( $cssFiles ) );\r\n\t\tforeach ( array_keys ( $cssFiles ) as $cssFile ) {\r\n\t\t\t$path = PATH_site . $cssFile;\r\n\t\t\t$this->assertTrue ( file_exists ( $path ) );\r\n\t\t\t$content = file_get_contents ( $path );\r\n\t\t\t$this->assertContains ( '/fixtures/../images/test1.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/images/test2.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/test3.gif', $content );\r\n\t\t\t$this->assertContains ( '/fixtures/../../images/test4.gif', $content );\r\n\t\t}\r\n\t}",
"protected function filename()\n {\n return 'TagtypeManager_' . date('YmdHis');\n }",
"public function testNameReturnsName()\n {\n file_put_contents(self::$temp . DS . 'foobar.txt', 'foo');\n\n $this->assertSame('foobar', Storage::name(self::$temp . DS . 'foobar.txt'));\n }",
"function resourceFilesAreSetUp() {\n\t$dir = __DIR__ . '/external-resources';\n\t$files = [ '/i18n/trx_en.json', '/i18n/trx_es.json', '/scripts/surveys.js', '/version' ];\n\tforeach( $files as $file ) {\n\t\tif ( !file_exists(\"{$dir}{$file}\") ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}",
"abstract function get_plugin_name();",
"public function test_post_wrong_file_types(){\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('GET', \"/manage/\" . $videoquanda->cmid);\n\n // Todo: Mock videofile?\n }",
"function generateFilename(&$paperFile, $type, $originalName) {\n\t\t$extension = $this->parseFileExtension($originalName);\t\t\t\n\t\t$newFileName = $paperFile->getPaperId().'-'.$paperFile->getFileId().'-'.$paperFile->getRevision().'-'.$type.'.'.$extension;\n\t\t$paperFile->setFileName($newFileName);\n\t\treturn $newFileName;\n\t}",
"#[@test]\n public function composingFromStringAndString() {\n $fn= $this->fileKnownToExist();\n $this->assertEquals($fn, create(new File(dirname($fn), basename($fn)))->getURI());\n }",
"protected function findFiles() {\n $files = [];\n foreach ($this->moduleHandler->getModuleDirectories() as $provider => $directory) {\n $file = $directory . '/' . $provider . '.plugin_type.yml';\n if (file_exists($file)) {\n $files[$provider] = $file;\n }\n }\n return $files;\n }"
] | [
"0.5990528",
"0.5987047",
"0.5972103",
"0.5942482",
"0.5938007",
"0.58881795",
"0.58824366",
"0.5821271",
"0.57590705",
"0.57262117",
"0.571537",
"0.5679555",
"0.5659504",
"0.56385815",
"0.56196076",
"0.5610544",
"0.5579716",
"0.55392265",
"0.5428646",
"0.5424699",
"0.53914624",
"0.5341607",
"0.53402936",
"0.53170824",
"0.5314317",
"0.53054464",
"0.53026986",
"0.5290438",
"0.5282672",
"0.52801424"
] | 0.62975293 | 0 |
test execute with a type defined | function testExecuteWithOneArg() {
$this->Task->args[0] = 'Model';
$this->Task->setReturnValueAt(0, 'in', 'TestTaskTag');
$this->Task->setReturnValue('isLoadableClass', true);
$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));
$this->Task->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testExecute()\n {\n $result = $this->executeTest(['class' => DataObject::class, 'property' => 'fixed_fields'])->getDisplay();\n $this->assertContains('ClassName', $result);\n }",
"public function testExecute()\n {\n }",
"function testGetObjectType() {\n\t\t$this->Task->expectOnce('_stop');\n\t\t$this->Task->setReturnValueAt(0, 'in', 'q');\n\t\t$this->Task->getObjectType();\n\n\t\t$this->Task->setReturnValueAt(1, 'in', 2);\n\t\t$result = $this->Task->getObjectType();\n\t\t$this->assertEqual($result, $this->Task->classTypes[1]);\n\t}",
"#[@test]\n public function getArgumentTypeForObject() {\n $params= XPClass::forName('net.xp_framework.unittest.rest.server.mock.MockArgs')\n ->newInstance()->getClass()->getMethod('methodWithAnotherArgument')->getParameters();\n $this->args->addArgument('another', $params[0]);\n \n $this->assertEquals(XPClass::forName('lang.Object'), $this->args->getArgumentType('another'));\n }",
"private function _run_test($subject,$test,$type,$compare='==') {\r\n\t\tswitch ($type) {\r\n\t\t\tcase 'regx': return $this->_run_test_regx($test,$subject);\r\n\t\t\tcase 'string': case 'boolean': return ($test === $subject);\r\n\t\t\tcase 'date': $value = $this->_get_epoc_value($value);\r\n\t\t\tcase 'int': return $this->_run_test_compare($test,$subject,$compare);\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"public function testConsoleCommandWithTypes(string $type): void\n {\n $name = 'Test'.(ucfirst($type)).'Observer';\n $modelName = 'ModelForObserver';\n\n $this->artisan('make:observer', [\n 'name' => $name,\n '--container' => $this->containerName,\n '--'.$type => $type === 'model' ? $modelName : true\n ])\n ->expectsOutputToContain('Observer ['.$this->portoPath.'/Containers/'.$this->containerName.'/Observers/'.$name.'.php] created successfully.')\n ->assertSuccessful();\n\n $file = base_path($this->portoPath).'/Containers/'.$this->containerName.'/Observers/'.$name.'.php';\n\n $this->assertFileExists($file);\n\n if($type === 'model'){\n $this->assertEquals($this->getObserverModelContent($name, $modelName), file_get_contents($file));\n } else {\n $this->assertEquals($this->getObserverContent($name), file_get_contents($file));\n }\n }",
"public function testConsoleCommandWithTypes(string $type): void\n {\n $name = 'Test2'.(ucfirst($type)).'Component';\n\n if($type === 'view'){\n $output = 'Component created successfully.';\n } else {\n $output = 'Component ['.$this->portoPath.'/Containers/'.$this->containerName.'/Data/Views/Components/'.$name.'.php] created successfully.';\n }\n\n $this->artisan('make:component', [\n 'name' => $name,\n '--container' => $this->containerName,\n '--'.$type => true\n ])\n ->expectsOutputToContain($output)\n ->assertSuccessful();\n\n $file = base_path($this->portoPath).'/Containers/'.$this->containerName.'/Data/Views/Components/'.$name.'.php';\n\n if($type === 'force'){\n $fileView = base_path($this->portoPath).'/Containers/'.$this->containerName.'/UI/WEB/Views/components/test2-force-component.blade.php';\n\n $this->assertFileExists($file);\n $this->assertFileExists($fileView);\n $this->assertEquals($this->getComponentContent($name, 'components.test2-force-component'), file_get_contents($file));\n }\n\n if($type === 'inline'){\n $this->assertFileExists($file);\n }\n\n if($type === 'view'){\n $fileView = base_path($this->portoPath).'/Containers/'.$this->containerName.'/UI/WEB/Views/components/test2-view-component.blade.php';\n $this->assertFileExists($fileView);\n }\n }",
"function testExecuteWithTwoArgs() {\n\t\t$this->Task->args = array('Model', 'TestTaskTag');\n\t\t$this->Task->setReturnValueAt(0, 'in', 'TestTaskTag');\n\t\t$this->Task->setReturnValue('isLoadableClass', true);\n\t\t$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));\n\t\t$this->Task->execute();\n\t}",
"protected function runCommand(string $file, string $key, string $value, $type): CommandTester\n {\n $command = $this->getCommand();\n $commandTester = new CommandTester($command);\n $params = [\n 'command' => $command->getName(),\n 'filename' => $file,\n 'key' => $key,\n 'value' => $value,\n ];\n if ($type) {\n $params['--type'] = $type;\n }\n $commandTester->execute($params);\n\n return $commandTester;\n }",
"public function testType(){\n\n $type = 0;\n\n // Fetch all transactions list from redis to test\n $all_transactions = Redis::command('keys', ['transaction:test:*']);\n\n $transaction = Redis::command('keys', ['transaction:test:*']);\n\n // Calculate the type of transactions\n foreach( $all_transactions as $transaction_id ){\n\n foreach( $transaction as $value ){\n\n $keys = json_decode(Redis::get($value));\n\n if ( $keys->type == $transaction_id ) {\n\n $type++;\n\n }\n\n }\n\n /*\n * Request to API to calculate the type\n * GET /transactionservice/type/$transaction_id\n */\n $this->get('transactionservice/types/test:' . $transaction_id )\n ->assertStatus(200)\n ->assertJsonCount(1)\n ->assertJson([\n 'types' => $type\n ]);\n\n }\n\n }",
"public function execute() {\n\t\t// Check if type already exists : throw an exception\n\t\t$test = $this->_client->call($this->path(), 'GET') ;\n\t\tif (!empty($test[$this->_options['type']])) {\n\t\t\tthrow new Exception('Type \"' . $this->_options['type'] . '\" already exists') ;\n\t\t}\n\n\t\treturn parent::execute() ;\n\t}",
"function test($object,$type = \"dump\", $qTest = false)\n\t\t{\n\t\t\t//By default this is false, because once it runs we dont need it to log itself anymore.\n\t\t\t$this->testQ = $qTest;\n\t\t\t//Switch based on the type of testing we need \n\t\t\tswitch ($type) {\n\t\t\t\t//\"dump\" allows us to get deep detail of an object\n\t\t\t\tcase 'dump':\n\t\t\t\t\tob_start();\n\t\t\t\t\tvar_dump($object);\n\t\t\t\t\t$output = ob_get_clean();\n\t\t\t\t\tbreak;\n\t\t\t\t//\"print\" allows us to get a full view of an array and its subarrays\n\t\t\t\tcase 'print':\n\t\t\t\t\t$output = print_r($object, true);\n\t\t\t\t\tbreak;\n\t\t\t\t//Sometimes we simply need to output the object itself\n\t\t\t\tdefault:\n\t\t\t\t\t$output = $object;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//Lets prepare this for an insert by passing the setter and params through an array of time which sets the time this log was made and the log which shows our output\n\t\t\t$this->prepareFromArray(\"test_logs\", array(\"time\" => $this->dateTimeStamp(), \"log\" => $output));\n\t\t}",
"public function testGetType() {\n\t\t$expected = 'test_models';\n\t\t$result = $this->Es->getType($this->Model);\n\t\t\n\t\t$this->assertEquals($expected, $result);\n\t\t\n\t\t$expected = 'custom_type';\n\t\t$this->Model->useType = 'custom_type';\n\t\t\n\t\t$result = $this->Es->getType($this->Model);\n\t\t\n\t\t$this->assertEquals($expected, $result);\n\t}",
"abstract function test();",
"public function testExecute(): void\n {\n $this->assertTrue($this->Form->execute($this->example));\n }",
"public function testRunLook()\n {\n }",
"public function testValidateValidType($type)\n {\n BuiltinRecordUtil::validateType($type);\n }",
"public function testGetExecutor() {\r\n $executorTest = $this->_instance->getExecutor('test');\r\n\r\n $this->assertInstanceOf('PM\\Main\\Commander\\Executor', $executorTest);\r\n\r\n $executor = $this->_instance->getExecutor('executor');\r\n\r\n $this->assertInstanceOf('PM\\Main\\Commander\\Executor', $executor);\r\n }",
"public function testExecute()\n {\n $query = '{user(id: \"1\") { username }}';\n $action = new QueryAction();\n $result = $action(compact('query'));\n\n $expected = [\n 'data' => [\n 'user' => [\n 'username' => 'first user',\n ]\n ]\n ];\n\n static::assertArrayHasKey('data', $result);\n static::assertArrayNotHasKey('errors', $result);\n static::assertEquals($expected, $result);\n\n $query = '{role(id: \"1\") { name }}';\n $action = new QueryAction();\n $result = $action(compact('query'));\n\n $expected = [\n 'data' => [\n 'role' => [\n 'name' => 'first role',\n ]\n ]\n ];\n\n static::assertArrayHasKey('data', $result);\n static::assertArrayNotHasKey('errors', $result);\n static::assertEquals($expected, $result);\n }",
"public function seeResultIs($type) {\r\n $this->scenario->assertion('seeResultIs', func_get_args());\r\n if ($this->scenario->running()) {\r\n $result = $this->scenario->runStep();\r\n return new Maybe($result);\r\n }\r\n return new Maybe();\r\n }",
"function testTypeHintedParameter() {\n\n $interfaceName = 'Example\\Implement\\ExpensiveInterface';\n \n $cacheMethodBinding = new MethodBinding(\n '__extend',\n new MethodNameMatcher(['executeQuery', 'anotherFunction'])\n );\n\n $cacheWeaveInfo = new ImplementWeaveInfo(\n 'Weaver\\Weave\\CachePrototypeDecorator',\n $interfaceName,\n [$cacheMethodBinding]\n );\n\n $result = Weaver::weave('Example\\Implement\\TestClassWithTypeHintedParameter', $cacheWeaveInfo);\n $className = $result->writeFile($this->outputDir, 'Example\\Coverage\\TypeHintedParam');\n\n $injector = createProvider([], []);\n $injector->defineParam('queryString', 'testQueryString');\n $decoratedClass = $injector->make($className);\n\n $decoratedClass->executeQuery('foo');\n //TODO add mock checking\n //check Dependency is set\n\n $this->assertInstanceOf($interfaceName, $decoratedClass);\n }",
"function setResultType($type, $args=\"\")\r\n\t{\r\n\t\t$this->resultType = $type;\r\n\t\t$this->resultTypeArgs = $args;\r\n\t}",
"#[@test]\n public function getArgumentTypeDefault() {\n $this->assertEquals(Primitive::$STRING, $this->args->getArgumentType('id'));\n }",
"public function run()\n {\n factory(App\\Type::class)->create([\n \t'name' => 'Freehold Property'\n\t\t]);\n factory(App\\Type::class)->create([\n \t'name' => 'Leasehold Property'\n\t\t]);\n factory(App\\Type::class)->create([\n \t'name' => 'Assets Under Construction'\n\t\t]);\n factory(App\\Type::class)->create([\n \t'name' => 'Motorvehicles'\n\t\t]);\n factory(App\\Type::class)->create([\n \t'name' => 'Fixtures Fittings and Equipment'\n\t\t]);\n factory(App\\Type::class)->create([\n \t'name' => 'IT Equipment'\n\t\t]);\n }",
"public function testSalesOpportunitiesTypesPost()\n {\n\n }",
"public function test_ps_test()\n {\n\n\n\n $this->assert_ps_type('[email protected]', 5, 'e');\n $this->assert_ps_type('http://www.yahoo.com', 5, 'u');\n $this->assert_ps_type(2, 0, 'f');\n $this->assert_ps_type(31, 0, 'i');\n $this->assert_ps_type('your text here ', 10, 'd');\n }",
"public function testGetType0()\n{\n\n $actual = $this->declareDeclare->getType();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testInstance() { }",
"public function testGetType0()\n{\n\n $actual = $this->closure->getType();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testGetData_Types()\n {\n $this->assertInstanceOf('CPC\\ServerMonitor\\Resource\\Php', $this->Php);\n $this->assertInternalType('array', $this->Php->getData());\n }"
] | [
"0.63021684",
"0.6151733",
"0.6138161",
"0.6131627",
"0.6070141",
"0.6036134",
"0.59788793",
"0.5960161",
"0.59505284",
"0.5844811",
"0.5797036",
"0.57909375",
"0.5768492",
"0.5575333",
"0.5575266",
"0.5560992",
"0.554339",
"0.5524988",
"0.5517839",
"0.5505921",
"0.5504525",
"0.5446807",
"0.5428428",
"0.5420129",
"0.54051644",
"0.539129",
"0.53544074",
"0.5340753",
"0.53292656",
"0.5325033"
] | 0.6275036 | 1 |
Returns the staff comments. If there are no staff comments, returns an empty string. | function pullStaffComments() {
if(isset($_POST['staff_comments'])) {
return trim(sanitize_text_field($_POST['staff_comments']));
}
return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getComments()\n {\n // only populate if comments are unset.\n if (!array_key_exists('comments', $this->data)) {\n $this->populate();\n }\n\n return $this->data['comments'];\n }",
"public function getComments()\n {\n return $this->session->get(\"comments\", []);\n }",
"public function getComments() \n {\n return $this->comments;\n }",
"public function listComments()\n {\n $sql = $sql = \"SELECT * FROM comment JOIN user USING (idUser) JOIN activity USING (idActivity);\";\n return $this->query($sql);\n }",
"public function getComments() {\n if(!isset($this->comments))\n {\n $mapper = new Application_Model_CommentsMapper();\n $this->comments = $mapper->findAllByFieldsAndValues(array(\"id\"=>$this->id));\n }\n return $this->comments;\n }",
"public static function getComments($s='')\n\t{\n\t\treturn self::getTokens(array(T_COMMENT,T_DOC_COMMENT),$s);\n\t}",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments() {\n return $this->comments;\n }",
"public function getStaff()\n {\n return $this->staff;\n }",
"public function getStaff()\n {\n return $this->staff;\n }",
"public function fetchComments(): string\n {\n return parent::fetchPersonComments(self::TABLE_NAME);\n }",
"function getCommentsMade()\n {\n if (empty($this->user_id)) {\n // an anonymous user. return nothing\n return null;\n }\n $vars['uop'] = 'cm_history';\n $vars['uid'] = $this->user_id;\n return PHPWS_Text::moduleLink($this->comments_made, 'comments', $vars);\n }",
"public function getComments() {\n return $this->comments;\n }",
"public function getComments() {\r\n\t\treturn CN_Comment::getFromPost( $this->id );\r\n\t}",
"public function getComments() \n {\n $query = \"SELECT * \n FROM comments\";\n\n $this->db->query($query);\n \n $comments = $this->db->resultset();\n\n return $comments;\n }",
"public function getComments() { return $this->comments; }",
"protected function getComments() {\n\t\treturn $this->getTableHeader() . $this->getCommentList() . '</table>';\n\t}",
"public function getComments()\n {\n return Comment::whereIdFor(Auth()->user()->id)->get();\n }",
"function getCustomerComment();",
"public function show_comments()\n {\n $query = \"Select forum_id from Forum\";\n $posts = $this->db->query($query)->result_array();\n foreach ($posts as $p) {\n $query = \"Select * from comment where forum_id=?\";\n $res = $this->db->query($query, $p['forum_id'])->result_array();\n for ($i=0; $i<sizeof($res);$i++)\n {\n $res[$i]['name'] = $this->brain_model->get_username($res[$i]['user_id']);\n }\n $comms[$p['forum_id']] = $res;\n }\n \n return $comms;\n }",
"public function getComments() /*: Vector<string>*/ {\n if ($this->comments === null) {\n $this->comments = Vector {};\n }\n return $this->comments;\n }",
"public function getComments() {\n\n $comments = $this->commentController->index();\n return $comments;\n\n }",
"public function FetchComments()\n {\n $comments = array();\n $stmt = Bugdar::$db->Prepare(\"\n SELECT comments.*, users.alias as post_alias\n FROM \" . TABLE_PREFIX . \"comments comments\n LEFT JOIN \" . TABLE_PREFIX . \"users users\n ON (comments.post_user_id = users.user_id)\n WHERE comments.bug_id = ?\n ORDER BY comments.post_date\n \");\n $stmt->Execute(array($this->bug_id));\n while ($comment = $stmt->FetchObject())\n $comments[] = $comment;\n return $comments;\n }",
"public function getComments() {\n $approvalId = $this->coreRegistry->registry('address_approval_id');\n try{\n $approvalAddress = $this->addressApprovalFactory->create()->load($approvalId);\n $commenstData = $approvalAddress->getComments();\n if($commenstData) {\n $comments = $this->serialize->unserialize($commenstData);\n return $comments;\n }else {\n return false;\n }\n }catch(\\Exception $e){\n $this->redingtonHelper->logMessage('could not get comments');\n return false;\n }\n \n }",
"function staffDetails()\n\t{\n\t\t\n\t\t$userdetails = get_user($_SESSION['loginid']);\n\n\t\t$staffdetails = get_user($staffid);\n\t\t$staffid = implode(',',array_map(function($el){return $el['idno']; }, $userdetails));\n\t}"
] | [
"0.6112153",
"0.5968401",
"0.5860268",
"0.5852025",
"0.5845855",
"0.5838801",
"0.5829627",
"0.5829627",
"0.5829627",
"0.5829627",
"0.5829627",
"0.5829627",
"0.5814215",
"0.5791793",
"0.5791793",
"0.578456",
"0.577407",
"0.5767528",
"0.5752773",
"0.5750447",
"0.5748248",
"0.5735738",
"0.5730068",
"0.5703137",
"0.56961435",
"0.56682354",
"0.5650892",
"0.56444085",
"0.5644385",
"0.56259096"
] | 0.6460488 | 0 |
Returns true if the inquiries list button was clicked. | function recordsListButtonClicked() {
return isset($_POST['records_list']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canSeeStatusButton()\r\n {\r\n if (self::isCompleted())\r\n return false;\r\n elseif ($this->review && self::isPendingReview())\r\n return self::canReviewTask();\r\n return self::canChangeStatus();\r\n }",
"abstract protected function isButtonPressed($button, $data = []);",
"public function hasClickCallback()\n {\n return $this->getUrl() == '#';\n }",
"function isListed() {\n\t\treturn false;\n\t}",
"public function isClickable();",
"public function isListed(): bool\n {\n return $this->num() !== null;\n }",
"public function isListed() {\n\t\treturn false;\n\t}",
"private function in_list($list) {\n\t\treturn $list[$this->_name] === true || (is_array($list[$this->_name]) && in_array($this->_action, $list[$this->_name]));\n\t}",
"protected function isListCommand(): bool\n {\n return method_exists($this, 'listResponseItemsKey');\n }",
"protected function isListCommand(): bool\n {\n return false;\n }",
"public function is_applied_to_user_lists() {\n // display of user lists for activities.\n return true;\n }",
"public function isClickNextAvailable()\n {\n return !$this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->isDisabled();\n }",
"function isListed() {\n\t\treturn (bool)$this->getUser()->isLoggedIn();\n\t}",
"public function hasMenuButton() {\n return $this->menuBtn;\n }",
"function z_click_all()\n\t{\n\t\tif ($this->call(\"$this->prefix.ClickAll\")==\"true\")\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"function filterButtonClicked() {\n return isset($_POST['filter_button']);\n}",
"public function isSubmitted(): bool\n {\n return array_key_exists(self::getSubmitAction(), $this->data['buttons']);\n }",
"public function list() :bool\n {\n return true;\n }",
"public function userIsOnThePaperListPage()\n {\n $driver = new \\Behat\\Mink\\Driver\\Selenium2Driver('firefox');\n $session = new \\Behat\\Mink\\Session($driver); \n $session->start();\n $session->visit('http://localhost');\n $page = $session->getPage();\n $searchButton = $page->find('css', \"#search-button\");\n $searchBar = $page->find('css', '#search-box');\n $searchBar->focus();\n $searchBar->setValue(\"circuit\");\n $searchButton->click();\n while(!$page->find('css', '#current-cloud-button')){\n };\n $wordCloudButton = $page->find('css', '#current-cloud-button');\n $wordCloudButton->click();\n while(!$page->find('css','#search_info')){\n };\n $abstractButton = $page->find('css', '.abstract-button');\n $abstractButton->click();\n $session->stop();\n }",
"function buttonPressed($varName) {\n\n // sanity\n if (!isset($this->entityList[$varName])) {\n $this->debugLog(\"buttonPressed: variable not found: $varName\");\n return false;\n }\n\n return ($this->getVar($varName) == $this->entityList[$varName]->inputEntity->directive['value']);\n\n }",
"public function hasAddlist(){\n return $this->_has(3);\n }",
"public function isEnabled(): bool\n {\n return userHasPermission(Permission\\Users\\Browse::class);\n }",
"public function isBookable();",
"public function isEnabled()\n {\n return Mage::helper('facebook')->isActiveWishlist();\n }",
"public function getEditClickable() {\n\t\tif (!Controller::isAdmin())\n\t\t\treturn false;\n\t\t\t\n\t\tif ($this->userID == Yii::app()->user->getId())\n\t\t\treturn true;\n\t\t\n\t\tif ($this->role == self::ROLE_ADMINISTRATOR)\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}",
"public function isAllow()\n {\n return $this->_wishlistHelper->isAllow();\n }",
"function checkin()\n\t{\n\t\tif ($this->_id)\n\t\t{\n\t\t\t$helloworld_detail = & $this->getTable();\n\t\t\tif(! $helloworld_detail->checkin($this->_id)) {\n\t\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public static function isSelectable(): bool;",
"public function shouldShowModalOnClickingRow(): bool\n {\n return $this->shouldShowModalOnClickingRow;\n }",
"private function inquiries(){\n $this->filter = array('table');\n $this->namespace = 'students';\n $this->pageTitle = 'Student Information';\n $this->bodyClass = 'lists-students';\n $this->pageClass = 'lists-students'; \n $this->page = 'templates/contents/back/'.$this->namespace;\n $this->jsCustom = 1; \n $this->template_display(); \n }"
] | [
"0.5862455",
"0.56060797",
"0.55803525",
"0.5539954",
"0.5536866",
"0.5510622",
"0.550204",
"0.54480296",
"0.5370889",
"0.5334293",
"0.5333648",
"0.5326553",
"0.5318307",
"0.52622104",
"0.5254645",
"0.5230643",
"0.52228624",
"0.52042776",
"0.5152652",
"0.5126682",
"0.5114825",
"0.5101313",
"0.50641805",
"0.5063472",
"0.5062629",
"0.5047781",
"0.5044244",
"0.5032979",
"0.5022988",
"0.5002325"
] | 0.65300715 | 0 |
Returns true if the update button was clicked. | function updateButtonClicked() {
return isset($_POST['application_form']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final function isUpdate() { return ($this->getItemId() > 0); }",
"function bbp_is_update()\n{\n}",
"public function getIsUpdate()\n {\n return $this->type === self::TYPE_UPDATE;\n }",
"protected function isUpdate(): bool { return false; }",
"public function update()\n {\n return true;\n }",
"public function update() :bool\n {\n return true;\n }",
"public function isUpdated(){\n return $this->_dataArray['updateFlag'] == 'TRUE';\n }",
"public function needsUpdate()\n {\n return !$this->hasScript(ScriptEvents::POST_UPDATE_CMD, ScriptHandler::class . '::updateProject');\n }",
"public function update(): bool\n {\n return $this->execute('update');\n }",
"public function update()\n\t{\n\t\treturn true;\n\t}",
"function checkUpdate()\n {\n\n return false;\n }",
"public function hasUpdate(){\n return $this->_has(3);\n }",
"public function multiUpdateSelected()\n {\n return $this->MultiUpdate == 1;\n }",
"function update()\n\t{\n\t\treturn true;\n\t}",
"public function update()\n {\n return false;\n }",
"public function update()\n {\n return false;\n }",
"function updateButton() {\r\n\t\t\r\n\t\techo \"<a href='update.php' class='btn btn-success'></a><br />\"; \r\n\t}",
"public function isSubmitted(): bool\n {\n return array_key_exists(self::getSubmitAction(), $this->data['buttons']);\n }",
"final protected function has_run_update_option() {\n\n\t\tstatic $run = false;\n\n\t\treturn \\TSF_Extension_Manager\\is_done( $run );\n\t}",
"public function isUpdatable(): bool\n {\n return !empty($this->update);\n }",
"public function isUpdating()\n {\n $db_version = Db::getInstance()->getValue('SELECT `version` FROM `'\n . _DB_PREFIX_ . 'module` WHERE `name` = \\'' . pSQL($this->name) . '\\'');\n\n return version_compare($this->version, $db_version, '>');\n }",
"function onUpdate()\n\t{\n\t\treturn true;\n\t}",
"public function checkChangeShippingButton()\n {\n return $this->_rootElement->find($this->changeShipping)->isVisible();\n }",
"public function see_update_buttons (User $user){\n if ($this->manage_reports($user) || (is_null(WorkshopReport::where('owner_user_id',$user->id)->first())?false:true)){\n return true;\n }\n }",
"public function _on_updating() : bool\n {\n $this->timestamp = time();\n return true;\n }",
"public function updateButton()\n {\n return __('Update', 'acf');\n }",
"public function canSeeStatusButton()\r\n {\r\n if (self::isCompleted())\r\n return false;\r\n elseif ($this->review && self::isPendingReview())\r\n return self::canReviewTask();\r\n return self::canChangeStatus();\r\n }",
"protected function isUpdateAllowed()\n\t{\n\t\treturn $this->editable;\n\t}",
"protected function isUpdate()\n {\n $needle = ['put', 'patch'];\n\n return in_array(strtolower($this->input('_method')), $needle)\n or in_array(strtolower($this->header('x-http-method-override')), $needle)\n or in_array(strtolower($this->method()), $needle);\n }",
"protected function isUpdateRemoval()\n {\n return $this->versionManager->isPreviewVersion();\n }"
] | [
"0.72867364",
"0.6811761",
"0.68089",
"0.676895",
"0.67625576",
"0.6736191",
"0.67146355",
"0.66490096",
"0.6618454",
"0.66163015",
"0.6519205",
"0.64992607",
"0.6451197",
"0.64389676",
"0.6388512",
"0.6388512",
"0.6379494",
"0.63352436",
"0.63316643",
"0.62734467",
"0.6264336",
"0.62570345",
"0.62503976",
"0.6211318",
"0.61968714",
"0.6154103",
"0.6151344",
"0.6017999",
"0.6003918",
"0.5990447"
] | 0.71157646 | 1 |
Returns true if the filter button was clicked. | function filterButtonClicked() {
return isset($_POST['filter_button']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canFilter() {\n return true;\n }",
"public function has_actions() {\n\t\treturn $this->has_filters();\n }",
"public function hasFilters(){\n return $this->_has(1);\n }",
"public function hasFilters(){\n return $this->_has(1);\n }",
"public function shouldShowFilterForm(?string $filterName): bool\n {\n return true;\n }",
"public function accept()\n {\n if ($this->current()->getComponent() !== $this->component) {\n return false;\n }\n return $this->acceptFilters();\n }",
"public function hasClickCallback()\n {\n return $this->getUrl() == '#';\n }",
"public function hasTrueFilter(){\n return $this->_has(2);\n }",
"public function should_display_sitewide_filters() {\n\t\t$filter_widgets = get_option( 'widget_jetpack-search-filters' );\n\n\t\t// This shouldn't be empty, but just for sanity\n\t\tif ( empty( $filter_widgets ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If any widget has any filters, return false\n\t\tforeach ( $filter_widgets as $number => $widget ) {\n\t\t\t$widget_id = sprintf( '%s-%d', $this->id_base, $number );\n\t\t\tif ( ! empty( $widget['filters'] ) && is_active_widget( false, $widget_id, $this->id_base ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function hasFilters()\n {\n return $this->delegate->hasFilters();\n }",
"public function enableFEFilterWidget()\n\t{\n\t\treturn true;\n\t}",
"public function enableFEFilterWidget()\n\t{\n\t\treturn true;\n\t}",
"public function filtersPass(): bool;",
"function has_filters() {\n return false;\n }",
"function CheckFilter() {\n\n\t// Check date popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_date\"], $GLOBALS[\"sel_date\"]))\n\t\treturn TRUE;\n\n\t// Check unit popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_unit\"], $GLOBALS[\"sel_unit\"]))\n\t\treturn TRUE;\n\n\t// Check fromtype popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_fromtype\"], $GLOBALS[\"sel_fromtype\"]))\n\t\treturn TRUE;\n\n\t// Check category popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_category\"], $GLOBALS[\"sel_category\"]))\n\t\treturn TRUE;\n\n\t// Check tocode popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_tocode\"], $GLOBALS[\"sel_tocode\"]))\n\t\treturn TRUE;\n\n\t// Check todescription popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_todescription\"], $GLOBALS[\"sel_todescription\"]))\n\t\treturn TRUE;\n\treturn FALSE;\n}",
"public function checkChangeShippingButton()\n {\n return $this->_rootElement->find($this->changeShipping)->isVisible();\n }",
"public function isFilterable(): bool\n {\n return $this->filterable;\n }",
"public function hasFilters()\n {\n return session()->has($this->getSessionKey(static::TYPE_FILTERS));\n }",
"public function hasFilter() \r\n\t{\r\n\t\treturn (true === (count($this->_filters) > 0));\r\n\t}",
"public function isFilter($key)\n {\n return false;\n }",
"public function hasCustomFilterLabel(): bool\n {\n return ! is_null($this->filterCustomLabel);\n }",
"public function isSubmitted(): bool\n {\n return array_key_exists(self::getSubmitAction(), $this->data['buttons']);\n }",
"function buttonPressed($varName) {\n\n // sanity\n if (!isset($this->entityList[$varName])) {\n $this->debugLog(\"buttonPressed: variable not found: $varName\");\n return false;\n }\n\n return ($this->getVar($varName) == $this->entityList[$varName]->inputEntity->directive['value']);\n\n }",
"public function hasFilters()\n {\n return $this->has_filters;\n }",
"public function canSeeStatusButton()\r\n {\r\n if (self::isCompleted())\r\n return false;\r\n elseif ($this->review && self::isPendingReview())\r\n return self::canReviewTask();\r\n return self::canChangeStatus();\r\n }",
"function recordsListButtonClicked() {\n return isset($_POST['records_list']);\n}",
"public function hasCustomFilters()\n {\n return $this->has_custom_filter;\n }",
"public function hasButtonAttribute()\n {\n return true;\n }",
"public function isFiltered()\n\t{\n\t\treturn ( isset($_GET['category']) && $_GET['category'] !== \"all\" ) ? true : false;\n\t}",
"abstract protected function isButtonPressed($button, $data = []);"
] | [
"0.5995486",
"0.5983363",
"0.5974005",
"0.5974005",
"0.590266",
"0.5874864",
"0.5855737",
"0.57181257",
"0.566421",
"0.5633684",
"0.5629843",
"0.5629843",
"0.5606186",
"0.5576018",
"0.55666447",
"0.5557957",
"0.5546688",
"0.55466664",
"0.55289257",
"0.55242753",
"0.55145544",
"0.5504388",
"0.5504125",
"0.5495904",
"0.5480186",
"0.5467407",
"0.5446974",
"0.5389585",
"0.53792745",
"0.5351879"
] | 0.78475827 | 0 |
Bind a route to multiple verbs | public static function bind($verbs, $route, $controller){
foreach($verbs as $verb){
static::addRoute($route, $controller, $verb);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function method(...$methods) : Route;",
"public function testMatchWithMultipleMethods()\n {\n $this->router->map('GET|POST', '/methods', 'multiple_methods');\n $expected = array(\n 'target' => 'multiple_methods',\n 'params' => array(),\n 'name' => null,\n );\n $this->assertEquals($expected, $this->router->match('/methods', 'GET'));\n $this->assertEquals($expected, $this->router->match('/methods', 'POST'));\n $this->assertFalse($this->router->match('/methods', 'PUT'));\n }",
"public function register_routes() {\n\n\t\t\t$collection_params = $this->get_collection_params();\n\t\t\t$schema = $this->get_item_schema();\n\n\t\t\t$get_item_args = array(\n\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t);\n\t\t}",
"protected function initRoutes()\n {\n foreach ($this->routes as $name => $data) {\n $this->application\n ->match($data['match'], array($this, $data['method']))\n ->bind($name);\n }\n }",
"public function register_routes() {\n\t\t$namespace = $this->api_namespace . $this->api_version;\n\t\t\n register_rest_route( $namespace, 'user/', array(\n 'methods' => 'POST',\n 'callback' => array( $this, 'create_or_update_user' ),\n 'permission_callback' => array( $this, 'set_permission' )\n\n ) );\n register_rest_route( $namespace, 'user/delete/', array(\n 'methods' => \"DELETE\",\n 'callback' => array( $this, 'delete_user' ),\n 'permission_callback' => array( $this, 'set_permission' )\n ) );\n register_rest_route( $namespace, 'test/', array(\n 'methods' => \"get\",\n 'callback' => array( $this, 'send_subscription_emails_function' ),\n 'permission_callback' => ''\n ) );\n\n }",
"public function register_routes()\n {\n $namespace = $this->namespace();\n $routes = $this->routes();\n\n foreach ($routes as [\n 'route' => $route,\n 'args' => $args\n ]) {\n register_rest_route(\n $namespace,\n $route,\n $args\n );\n }\n }",
"public function register_routes()\n {\n // ping\n register_rest_route(static::$namespace, '/ping', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'ping'),\n 'permission_callback' => '__return_true',\n ));\n\n // Right now we only have a survey disconnect endpoint.\n register_rest_route(static::$namespace, \"/survey/disconnect\", array(\n 'methods' => 'POST',\n 'callback' => array($this, 'post_disconnect_survey'),\n 'permission_callback' => array($this, 'permission_callback'),\n ));\n\n // Sync Stats\n register_rest_route(static::$namespace, '/sync/stats', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'get_sync_stats'),\n 'permission_callback' => array($this, 'permission_callback'),\n ));\n\n // remove review banner\n register_rest_route(static::$namespace, \"/review-banner\", array(\n 'methods' => 'GET',\n 'callback' => array($this, 'dismiss_review_banner'),\n 'permission_callback' => array($this, 'permission_callback'),\n ));\n }",
"abstract public function register_routes();",
"public function route($method, $path, $handler)\n\t{\n\t\tif ($method != SPEC) {\n\t\t\tif (!is_array($path)) {\n\t\t\t\t$this->routes[$method][DIRECT][$path] = $handler;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->routes[$method][PATTERN][] = [$path, $handler];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->routes[$method][$path] = $handler;\n\t\t}\n\t}",
"protected function bootRouteBindings()\n {\n Route::bind('dock', function ($value) {\n return Docks::get($value);\n });\n }",
"public function register_routes() {\n register_rest_route( 'brj-templates/v1', '/collections', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'create_item' )\n\t\t\t)\n\t\t));\n register_rest_route( 'brj-templates/v1', '/collections/(?P<handle>[\\w-]+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' )\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_item' )\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => array( $this, 'delete_item' )\n\t\t\t),\n\t\t));\n }",
"public abstract function routes();",
"public function register_routes() {\n\t\t$version = \"1\";\n\t\t$namespace = \"grammadach-na-gaeilge/v\" . $version;\n\t\t$base = \"noun\";\n\t\tregister_rest_route($namespace, \"/\" . $base, array(\n\t\t\tarray(\n\t\t\t\t\"methods\" => WP_REST_Server::READABLE,\n\t\t\t\t\"callback\" => array($this, \"get_noun_random\"),\n\t\t\t\t\"permission_callback\" => array($this, \"get_noun_permissions_check\"),\n\t\t\t\t\"args\" => array(),\n\t\t\t)\n\t\t));\n\t}",
"public function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/status',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/item-status',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}",
"public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_rooms' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<number>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_room' ),\n\t\t\t)\n\t\t) );\n\n\t}",
"function _route()\n\t{\n\t\t$this->get()->ALL();\n\t\t$this->post('delete')->ALL();\n\t}",
"public function map($uri, $handler, array $methods = ['GET'])\n\t{\n\t\t$this->container->router->addRoute($uri, $handler, $methods);\n\t}",
"function route($pattern,$handler,$ttl=0,$kbps=0) {\n\t\t$types=array('sync','ajax');\n\t\tif (is_array($pattern)) {\n\t\t\tforeach ($pattern as $item)\n\t\t\t\t$this->route($item,$handler,$ttl,$kbps);\n\t\t\treturn;\n\t\t}\n\t\tpreg_match('/([\\|\\w]+)\\h+(?:(?:@(\\w+)\\h*:\\h*)?([^\\h]+)|@(\\w+))'.\n\t\t\t'(?:\\h+\\[('.implode('|',$types).')\\])?/',$pattern,$parts);\n\t\tif ($parts[2])\n\t\t\t$this->hive['ALIASES'][$parts[2]]=$parts[3];\n\t\telseif (!empty($parts[4])) {\n\t\t\tif (empty($this->hive['ALIASES'][$parts[4]]))\n\t\t\t\tuser_error(sprintf(self::E_Named,$parts[4]));\n\t\t\t$parts[3]=$this->hive['ALIASES'][$parts[4]];\n\t\t}\n\t\tif (empty($parts[3]))\n\t\t\tuser_error(sprintf(self::E_Pattern,$pattern));\n\t\t$type=empty($parts[5])?\n\t\t\tself::REQ_SYNC|self::REQ_AJAX:\n\t\t\tconstant('self::REQ_'.strtoupper($parts[5]));\n\t\tforeach ($this->split($parts[1]) as $verb) {\n\t\t\tif (!preg_match('/'.self::VERBS.'/',$verb))\n\t\t\t\t$this->error(501,$verb.' '.$this->hive['URI']);\n\t\t\t$this->hive['ROUTES'][str_replace('@',\"\\x00\".'@',$parts[3])]\n\t\t\t\t[$type][strtoupper($verb)]=array($handler,$ttl,$kbps);\n\t\t}\n\t}",
"public function any($uri, $handler = null)\n\t{\n\t\treturn $this->addRoute(static::$verbs, $uri, $handler);\n\t}",
"public function match($methods, $uri, $action = null)\n {\n $this->addRoute(array_map('strtoupper', (array)$methods), $uri, $action);\n }",
"protected function bindIndividual()\n {\n Route::bind('individual', function ($value, $route) {\n if (! $route->hasParameter('directory')) {\n abort(404);\n }\n\n return DirectoryIndividual::whereHas('directory', function ($directory) use ($route) {\n return $directory->where('slug', $route->parameter('directory'));\n })->where('slug', $value)->firstOrFail();\n });\n }",
"public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => array(),\n\t\t\t)\n\t\t) );\n }",
"public function verbProvider(): array\n {\n return [\n ['GET'],\n ['PUT'],\n ['PATCH'],\n ['DELETE'],\n ['HEAD'],\n ['CONNECT'],\n ['TRACE'],\n ];\n }",
"public function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/update-check',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/info',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}",
"protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }",
"public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_codes' ),\n\t\t\t), array(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'post_code' ),\n\t\t\t), array(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'patch_code' ),\n\t\t\t), array(\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => array( $this, 'delete_code' ),\n\t\t\t)\n\t\t) );\n\n\t}",
"protected function verbs() {\n return [\n 'index'=> ['GET','POST'],\n 'create' => ['POST'],\n 'update' => ['PUT', 'PATCH','POST'],\n 'delete' => ['DELETE'],\n \n // 'driver-car' => ['GET','POST'],\n ];\n }",
"function register(RouteCollector $routeCollector)\n {\n// $routeCollector->get('/',function (Request $request ,Response $response){\n// $response->write('this router index');\n// });\n// $routeCollector->get('/test',function (Request $request ,Response $response){\n// $response->write('this router test');\n// $response->end();\n// });\n// $routeCollector->get( '/user/{id:\\d+}',function (Request $request ,Response $response,$id){\n// $response->write(\"this is router user ,your id is {$id}\");\n// $response->end();\n// });\n// $routeCollector->get( '/user2/{id:\\d+}','/Api/test2');\n $routeCollector->get( '/','/api/test/test');\n }",
"public function routes();",
"public function routeModelBindings()\n {\n Route::bind('ticket', function ($id) {\n return \\Motor\\Revision\\Models\\Ticket::findOrFail($id);\n });\n Route::bind('airport', function ($id) {\n return \\Motor\\Revision\\Models\\Airport::findOrFail($id);\n });\n Route::bind('traveler', function ($id) {\n return \\Motor\\Revision\\Models\\Traveler::findOrFail($id);\n });\n Route::bind('shuttle', function ($id) {\n return \\Motor\\Revision\\Models\\Shuttle::findOrFail($id);\n });\n Route::bind('ride', function ($id) {\n return \\Motor\\Revision\\Models\\Ride::findOrFail($id);\n });\n Route::bind('sponsor', function ($id) {\n return \\Motor\\Revision\\Models\\Sponsor::findOrFail($id);\n });\n Route::bind('hotel', function ($id) {\n return \\Motor\\Revision\\Models\\Hotel::findOrFail($id);\n });\n Route::bind('component_ticket', function ($id) {\n return \\Motor\\Revision\\Models\\Component\\ComponentTicket::findOrFail($id);\n });\n }"
] | [
"0.64367366",
"0.63873005",
"0.6243646",
"0.61410105",
"0.60437155",
"0.6043285",
"0.60365635",
"0.59939873",
"0.59929353",
"0.5967579",
"0.59578174",
"0.5948083",
"0.59467924",
"0.58998746",
"0.5873333",
"0.58577377",
"0.5811341",
"0.5808212",
"0.5777514",
"0.57704556",
"0.57681316",
"0.5757694",
"0.5757185",
"0.57536787",
"0.5752957",
"0.57522345",
"0.57512546",
"0.57512367",
"0.5750564",
"0.5748986"
] | 0.6766936 | 0 |
helpers Always accept JavaScript popup. Workaround to `$I>acceptPopup();` Because this method doesn't work with PhantomJS Source: | protected function alwaysAcceptPopup(AcceptanceTester $I)
{
// Accept Popup
$I->executeJS("window.alert = function(msg){};");//JS
// Confirm Popup
$I->executeJS("window.confirm = function(msg){return true;};");//JS
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testPopupMethod() {\n $document = $this->createDocument(TRUE, TRUE, [\n 'existing_users' => [\n 'require_method' => 'popup',\n ],\n ]);\n $this->createDocumentVersion($document, TRUE);\n\n $account = $this->createUserWithAcceptancePermissions($document);\n $this->drupalLogin($account);\n\n // Check for the presence of the legal document in the js settings array.\n $js_settings = $this->getDrupalSettings();\n $this->assertTrue(isset($js_settings['entityLegalPopup']), 'Popup javascript settings found');\n $this->assertEqual($document->getPublishedVersion()\n ->label(), $js_settings['entityLegalPopup'][0]['popupTitle'], 'Popup title is correct');\n\n // Visit the document to agree as SimpleTest cannot properly submit using\n // the unprocessed markup from within the JS array.\n /** @var \\Drupal\\Core\\Url $document_url */\n $document_url = $document->toUrl();\n $document_path = $document_url->toString();\n $this->drupalPostForm($document_path, ['agree' => TRUE], 'Submit');\n\n // Ensure the popup is no longer present.\n $js_settings = $this->getDrupalSettings();\n $this->assertFalse(isset($js_settings['entityLegalPopup']), 'Popup javascript settings not found');\n\n // Create a new version.\n $this->createDocumentVersion($document, TRUE);\n\n // Visit the home page and ensure that the user must re-accept.\n $this->drupalGet('');\n $js_settings = $this->getDrupalSettings();\n $this->assertTrue(isset($js_settings['entityLegalPopup']), 'Popup javascript settings found');\n $this->assertEqual($document->getPublishedVersion()\n ->label(), $js_settings['entityLegalPopup'][0]['popupTitle'], 'Popup title is correct');\n }",
"public function canSeeDialog()\n {\n $I = $this->tester;\n $I->switchToIFrame();\n $I->waitForElement(self::$openedModalSelector);\n // I will wait two seconds to prevent failing tests\n $I->wait(2);\n }",
"public function i_close_the_popup_in_the_app() {\n $this->spin(function($context, $args) {\n $result = $this->getSession()->evaluateScript('return window.behat.closePopup();');\n if ($result !== 'OK') {\n throw new DriverException('Error closing popup - ' . $result);\n }\n return true;\n });\n $this->wait_for_pending_js();\n }",
"public function testSecureMungeIgnoreUnknownSchemes()\r\n {\r\n if (!$this->setSecureMunge()) return;\r\n $this->assertFiltering('javascript:', true);\r\n }",
"public function popupAction()\n {\n $this->container->get('contao.framework')->initialize();\n\n $controller = new BackendPopup();\n\n return $controller->run();\n }",
"function isEnabledJavaScript()\n\t{\n\t\tglobal $ilias;\n\t\t\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorGUI.php\");\n\n\t\tif (self::_doJSEditing())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"final protected function _getPopupmode(){return $this->_popupBox;}",
"public function testGetChecJsIgnoresIfFalsy()\n {\n ChecShortcode::config()->set('javascript_url', '');\n $result = $this->page->getChecJavaScript();\n $this->assertNotContains('<script type=\"text/javascript', $result);\n }",
"public function should_see_popup() {\n $windowames = $this->getSession()->getWindowNames();\n if (count($windowames) < 2) {\n throw new ElementNotFoundException();\n }\n }",
"public function isPopupEnabled()\n {\n return (int) Mage::getStoreConfig('newsletterpopup/popup/enabled') > 0;\n }",
"function odiogo_listen_now_js ()\r\n{\r\n\tif (! odiogo_get_option ('odiogo_safe_include'))\r\n\t{\r\n\t\techo odiogo_listen_now_js_code ();\r\n\t}\r\n}",
"function getJavascript()\n {\n $javascript = <<<END\n<script language=\"JavaScript\" type=\"text/JavaScript\">\nfunction openWindow(theURL,winName,features) {\n galleryPopup = window.open(theURL,\"gallery\",features);\n galleryPopup.focus();\n}\n</script>\nEND;\n return $javascript;\n }",
"public static function loginDialog() {\n $js = \"\n <script>\n window.location.href='/expired';\n </script>\n \";\n\n print$js;\n }",
"public function forceSignIn()\n {\n $this->_rootElement->find($this->forceSignIn)->click();\n $element = $this->browser->find($this->confirmModal);\n /** @var \\Magento\\Ui\\Test\\Block\\Adminhtml\\Modal $modal */\n $modal = $this->blockFactory->create('Magento\\Ui\\Test\\Block\\Adminhtml\\Modal', ['element' => $element]);\n $modal->acceptAlert();\n }",
"function trigger_identity_verification_popup( $order_id ){\n $user_id = wp_get_current_user()->id;\n $dob = get_user_meta( $user_id, 'uform_datebirth', true );\n if ( !$dob ) {\n echo '<a href=\"#\" id=\"show-id-verification-popup\"> </a>';\n echo '<script> window.onload=function(){\n setTimeout(function(){ document.getElementById(\"show-id-verification-popup\").click(); }, 500)\n };\n </script>';\n }\n}",
"public function setPopup($popup){\n\t\treturn $this->setParam(\"popup\", $popup);\n\t}",
"public function showChrome() { return true; }",
"public function getPopupText()\r\n {\r\n return $this->getWebDriverSession()->alert_text();\r\n }",
"public function testGetChecJs()\n {\n $result = $this->page->getChecJavaScript();\n $this->assertNotNull($result);\n $this->assertContains('<script type=\"text/javascript', $result);\n }",
"public function supportsJavaScript()\n\t{\n\t\treturn true;\n\t}",
"public function head_script()\n\t{\n\t\tqa_html_theme_base::head_script();\n\n\t\tif (!$this->shouldShowPopup()) {\n\t\t\treturn;\n\t\t}\n\t\t$library_src = qa_opt('site_url').$this->plugin_url.'/vender/popup.js';\n\t\t$this->output('<script type=\"text/javascript\" src=\"'.$library_src.'\"></script>');\n\t\t$js = file_get_contents(POPAD_DIR . '/ad.js');\n\t\t$html = file_get_contents(POPAD_DIR . '/ad.html');\n\t\t$html = str_replace(PHP_EOL, '', $html);\n\t\t$params = array(\n\t\t\t'^html' => $html,\n\t\t\t'^box_width' => '700',\n\t\t\t'^box_height' => '430',\n\t\t\t'^percentage' => 0\n\t\t);\n\t\t$js = strtr($js, $params);\n\t\t$this->output($js);\n\t}",
"protected function get_promo_js(){\r\n\t\t$content = new SubstitutionTemplate();\r\n\t\t$content\r\n\t\t\t->set_tpl('FB.CrossCom.consume(\"%url%\", \"%divedest%\");')\r\n\t\t\t->set_markup('url', $this->get_iframe_src())\r\n\t\t\t->set_markup('divedest', $this->get_param('divdest'));\r\n\t\treturn \r\n\t\t\tHtmlHelper::script(\r\n\t\t\t\t$content->replace_markup(), \r\n\t\t\t\tarray(\r\n\t\t\t\t\t'id'=>'iframe_'.$this->get_param('divdest')\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}",
"public function usePopupForSubscribe()\n {\n return (int)$this->xnotifHelper->getModuleConfig('stock/with_popup');\n }",
"function brettwysocki_javascript_detection() {\n\techo \"<script>(function(html){html.className = html.className.replace(/\\bno-js\\b/,'js')})(document.documentElement);</script>\\n\";\n}",
"protected function isPopupEnabled()\n {\n return $this->is_popup_enabled;\n }",
"public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser = $browser->visit('https://www.lootboy.de')\n ->waitFor('#onesignal-popover-cancel-button', 10)\n ->click('#onesignal-popover-cancel-button')\n ->pause(mt_rand(1000, 2000))\n ->press('#root > div > div.mainBody > div > div.navbar > div.left > div.menuIcons > a:nth-child(1)')\n ->pause(mt_rand(200, 300))\n ->click('#root > div > div.Dialog.MenuView.big > div > div > div.modalContent > div > div.top > div > div.lootboy-button-container.white > div')\n ->pause(10000)\n ->click('#root > div > div:nth-child(6) > div.Dialog.gdpr-dialog.big > div > div > div > div.footer > div.lootboy-button-container.green > div')\n ->pause(50000);\n });\n }",
"public function ajaxGbShowMozillaOpenBadges() {\n $data = self::getUserInfoPost();\n\n $getBadgeTemp = GetBadgeTemp::getInstance();\n echo $getBadgeTemp->showMozillaOpenBadges(DbBadge::isGot($data));\n\n wp_die();\n }",
"function prefix_do_wampum_popups() {\n\tif ( is_singular('post') ) {\n\t\t$content = '<p>My Pop Up</p>';\n\t\t$args\t = array(\n\t\t\t'cookieName' => 'prefix_posts_popup_viewed',\n\t\t\t'type'\t\t => 'exit',\n\t\t\t'style'\t\t => 'modal',\n\t\t);\n\t\twampum_popup( $content, $args );\n\t}\n\n\t// Show this popup on pages\n\tif ( is_singular('page') ) {\n\t\t$content = '<p>My Pop Up</p>';\n\t\t$args\t = array(\n\t\t\t'cookieName' => 'prefix_pages_popup_viewed',\n\t\t\t'type'\t\t => 'timed',\n\t\t\t'style'\t\t => 'slideup',\n\t\t);\n\t\twampum_popup( $content, $args );\n\t}\n\n}",
"public function executeJavascriptCheck(sfWebRequest $request)\n \t{\n \t\t\n \t}",
"function popmake_pa_activation() {\n @PopMake_Popup_Analytics()->admin->install_check();\n}"
] | [
"0.67493427",
"0.55405426",
"0.54680157",
"0.5441793",
"0.5327589",
"0.53146917",
"0.5301931",
"0.5291583",
"0.52726936",
"0.5215891",
"0.51723725",
"0.5161305",
"0.51584285",
"0.5129077",
"0.51220137",
"0.5108509",
"0.50898796",
"0.50716794",
"0.50576776",
"0.5049195",
"0.5010946",
"0.49968877",
"0.49732107",
"0.49584052",
"0.4942206",
"0.49081025",
"0.48773926",
"0.48764837",
"0.4864438",
"0.48577347"
] | 0.7287091 | 0 |
Returns the redirect uri | public function getRedirectUri(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getRedirectUri()\n {\n return self::$redirectUri;\n }",
"public function getRedirectUri()\n {\n return $this->redirect_uri;\n }",
"public function getRedirectUri()\n {\n return $this->helper->getRedirectUri();\n }",
"public function getRedirectUri()\n {\n return $this->redirectUri;\n }",
"public function getRedirectUri()\n {\n return $this->redirectUri;\n }",
"public function getRedirectUri()\n {\n return $this->redirectUri;\n }",
"public function getRedirectUrl();",
"public function getRedirectUrl()\n {\n return $this->getRepBody('redirect_url') ?? '';\n }",
"public function getRedirectUrl() {\n }",
"public function getRedirectUrl()\n {\n // TODO: Implement getRedirectUrl() method.\n }",
"private function get_redirect_uri() {\r\n\t\treturn self::OAUTH2_CALLBACK_URI;\r\n\t}",
"public function getRedirectUrl(): string\n {\n return $this->data['REDIRECT'] ?? '';\n }",
"public function getRedirectUrl() {\n \n return $this->_url;\n }",
"public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->_redirectUrl;\n }",
"public function getRedirectUrl() {\r\n // Get the default configurations.\r\n $env_config = YAML::parse(file_get_contents(__DIR__ . \"/../../config/environment.yaml\"));\r\n $datacash_config = YAML::parse(file_get_contents(__DIR__ . \"/../../config/datacash.yaml\"));\r\n $datacash_config = $datacash_config[$env_config['environment']]['parameters'];\r\n return $datacash_config['redirect_url'] . $this->HpsTxn->session_id->getValue();\r\n }",
"public function getRedirectUrl()\n {\n return $this->getEndpoint();\n }",
"public function getRedirectUrl(){\n return $this->redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->request->getEndpoint();\n }",
"protected function getRedirectUrl() : string\n\t{\n\t\t$redirect_url = $this->app->session->get('admin_referrer');\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = $this->request->post('referrer_url', 'url');\n\t\t}\n\n\t\tif ($redirect_url) {\n\t\t\tif (!$this->app->validator->isUrl($redirect_url)) {\n\t\t\t\t$redirect_url = $this->app->admin_index;\n\t\t\t}\n\t\t\tif (!$this->app->uri->isLocal($redirect_url)) {\n\t\t\t\t$redirect_url = $this->app->admin_index;\n\t\t\t}\n\t\t} else {\n\t\t\t$redirect_url = $this->app->admin_index;\n\t\t}\n\n\t\tif ($redirect_url == $this->app->uri->getAdminBlock('login')) {\n\t\t\t$redirect_url = $this->app->admin_index;\n\t\t}\n\n\t\t$this->app->session->set('admin_referrer', '');\n\n\t\t$redirect_url = $this->plugins->filter($this->prefix . 'get_redirect_url', $redirect_url);\n\n\t\treturn $redirect_url;\n\t}",
"public function getRedirectEndpoint() {\n\t\treturn $this->client->getRedirectEndpoint();\n\t}",
"public function getRedirect();",
"public function getRedirectUrl()\n\t{\n\t\treturn '#';\n\t}",
"protected function redirectUrl() {\n return url('salesforce/oauth_callback', array(\n 'absolute' => TRUE,\n 'https' => TRUE,\n ));\n }",
"protected function getRedirectUrl(): string\n {\n return url('/auth/powerschool/oidc');\n }",
"public function external_url()\n\t{\n\t\tif ($this->_is_internal_redirect())\n\t\t\treturn substr($this->_internal_redirect_location(), 1);\n\t\treturn $this->env['requested_uri'];\n\t}",
"public function getRedirectURL(): string\n {\n return $this->redirectsTo;\n }",
"public function getRedirectUrl()\n {\n return $this->urlBuilder->getUrl(self::ROUTER_NAME . '/checkout/success');\n }",
"public function getRedirectUrl()\n {\n return $this->_scopeConfig->getValue('payment/pagseguro/redirect');\n }",
"private function getUrlToRedirect()\n {\n $url = '/' . Yii::$app->request->getPathInfo();\n $queryString = Yii::$app->request->getQueryString();\n\n if (!empty($queryString)) {\n $params = array();\n\n parse_str($queryString, $params);\n\n if (isset($params[self::GET_PNAME])) {\n unset($params[self::GET_PNAME]);\n }\n\n $anchor = '';\n if (isset($params[self::GET_ANCHOR]) && !empty($params[self::GET_ANCHOR])) {\n $anchor = '#' . $params[self::GET_ANCHOR];\n unset($params[self::GET_ANCHOR]);\n }\n\n $queryString = http_build_query($params);\n\n if (!empty($queryString)) {\n $url .= '?' . $queryString . $anchor;\n }\n\n }\n\n return $url;\n }"
] | [
"0.85934085",
"0.85804224",
"0.85502046",
"0.85009724",
"0.85009724",
"0.85009724",
"0.8469477",
"0.83730394",
"0.826039",
"0.81604123",
"0.7998584",
"0.7993918",
"0.7971153",
"0.7957914",
"0.7933997",
"0.78836656",
"0.7879434",
"0.78781843",
"0.78354764",
"0.76821935",
"0.76728785",
"0.7662557",
"0.7642023",
"0.75791675",
"0.7546481",
"0.753922",
"0.74950075",
"0.74660313",
"0.73682296",
"0.73153406"
] | 0.89462394 | 1 |
Sets the redirect uri | public function setRedirectUri($redirectUri); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setRedirectUri($uri) {\n $this->redirectUri= $uri;\n }",
"public function set_redirect_uri($uri) {\n $this->redirect_uri = $uri;\n }",
"function set_redirect_uri( $uri ) {\r\n\r\n\t\t\tif ( ! empty( $_REQUEST['s'] ) )\r\n\t\t\t\t$uri = add_query_arg( 's', $_REQUEST['s'], $uri );\r\n\r\n\t\t\tif ( ! empty( $_REQUEST['status'] ) )\r\n\t\t\t\t$uri = add_query_arg( 'status', $_REQUEST['status'], $uri );\r\n\r\n\t\t\treturn $uri;\r\n\r\n\t\t}",
"public static function setRedirectUri($redirectUri)\n {\n self::$redirectUri = $redirectUri;\n }",
"public function redirectUri(?string $value): self\n {\n $this->instance->setRedirectUri($value);\n return $this;\n }",
"public function getRedirectUri()\n {\n return $this->redirect_uri;\n }",
"public function setRedirect($uri)\n\t{\n\t\t$this->setHeader('Location', $uri);\n\t}",
"public function redirectUri()\n {\n if (func_num_args() == 0) {\n return $this->getRedirectUri();\n }\n\n $this->setRedirectUri(func_get_arg(0));\n\n return $this;\n }",
"public function setRedirect($redirect)\n {\n $this->redirect = $redirect;\n }",
"public function getRedirectUri()\n {\n return $this->redirectUri;\n }",
"public function getRedirectUri()\n {\n return $this->redirectUri;\n }",
"public function getRedirectUri()\n {\n return $this->redirectUri;\n }",
"public static function getRedirectUri()\n {\n return self::$redirectUri;\n }",
"function setUri($requestUri);",
"public function redirect(string $uri) {\n $this->data['redirect'] = $uri;\n return $this;\n }",
"public function setRedirectUriGenerator($redirectUri)\n {\n $this->redirectUriGenerator = $redirectUri;\n }",
"public function setInviteRedirectUrl($value)\n {\n $this->setProperty(\"InviteRedirectUrl\", $value, true);\n }",
"public function setYouTubeRedirectUri($yt_redirect_uri)\n {\n # Check if the passed value is empty.\n if (!empty($yt_redirect_uri)) {\n # Clean it up.\n $yt_redirect_uri = trim($yt_redirect_uri);\n\n # Set the data member.\n $this->yt_redirect_uri = $yt_redirect_uri;\n } else {\n # Explicitly set the data member to NULL.\n $this->yt_redirect_uri = null;\n }\n }",
"public function getRedirectUri();",
"public function getRedirectUri();",
"public function set_redirect($arch){\n\t\t$this->client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/'.$arch);\n\n\t}",
"final protected static function setURL()\n {\n if(isset($_SERVER['REDIRECT_URL']))\n {\n self::$rURL = htmlentities(rawurldecode($_SERVER['REDIRECT_URL']));\n }\n else\n {\n preg_match('/^[^\\\\?\\\\#]+/i', $_SERVER['REQUEST_URI'], $match);\n self::$rURL = htmlentities(rawurldecode($match[0]));\n }\n }",
"protected function setURI()\n {\n $this->uri = $this->protocol . $this->host . '/' . $this->prefix . $this->path;\n }",
"function setUri($uri);",
"function set_uri($uri) {\n $this->uri = $uri;\n }",
"public function set_redirect( $location ) {\n\t\t$this->redirect = $location;\n\t}",
"public function setUri()\n {\n\n $RURI=$this->realURI();\n $this->uri = explode('/', $RURI);\n }",
"private function get_redirect_uri() {\r\n\t\treturn self::OAUTH2_CALLBACK_URI;\r\n\t}",
"function setCurrentUri($uri);",
"public function setRedirectUri($redirectUri)\n {\n $this->redirectUri = $redirectUri;\n return $this;\n }"
] | [
"0.79811305",
"0.7521837",
"0.75167507",
"0.7044771",
"0.6767079",
"0.67568046",
"0.67335254",
"0.67158085",
"0.65902776",
"0.65816015",
"0.65816015",
"0.65816015",
"0.6529791",
"0.6528532",
"0.6521904",
"0.64357346",
"0.6395189",
"0.6393752",
"0.6367377",
"0.6367377",
"0.63655883",
"0.6345663",
"0.63027817",
"0.624426",
"0.62412596",
"0.6232713",
"0.62204957",
"0.6153542",
"0.61259925",
"0.60881513"
] | 0.7890136 | 1 |
create a new share of a team in a company | public function create(Request $request) {
$this->validate($request, ['company_id'=>'requried',
'team_id'=>'required',
'amount'=>'requried']);
$share = Share::new();
$share->team_id = $request->input('team_id');
$share->company_id = $request->input('company_id');
$share->amount = $request->input('amount');
$share->save();
return back()->with('success','Share created successfully');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create(Share $share)\n {\n $share_detail = $share->orderBy('id', 'DESC')->pluck('name_of_company', 'id');\n return view('transaction.create')\n ->with('share_data', $share_detail);\n }",
"public function newShare()\n {\n $time = time();\n// $data = array_values($data);\n//\n// $mock = false;\n // 如果最近一次用户分享距离现在大于2小时\n// if ((isset($data[1]) && $time - $data[1]['createTime'] > 7200) || empty($data)) {\n $data = $this->modelDaoReward->randByUserTag(2);\n $mock = true;\n// }\n\n $ret = [];\n foreach ($data as $k => $v) {\n $item = [\n 'workName' => $v['workName'],\n 'money' => $v['money'],\n 'type' => $v['type'],\n ];\n\n $lag = $mock == false ? round(($time - $v['createTime']) / 60) : rand(1, 90);\n $con = $lag >= 60 ? round($lag / 60) . '小时前分享' : ($lag == 0 ? '刚刚分享' : $lag . '分钟前分享');\n $seed = rand(1, 10);\n $con = $seed < 5 ? rand(1, 24) . '小时前分享' : rand(1, 4) . '天前分享';\n\n $item['time'] = $con;\n// $timeKey = $lag >= 60 ? round($lag / 60) : $lag;\n $ret[] = $item;\n }\n// ksort($ret);\n\n return array_values($ret);\n }",
"function share($share_type = \"FB_POST_TO_WALL\", \n $provider_id, \n $provider_response = \"200\", \n $extra_app_details = \"\", \n $url = \"\")\n {\n // Assemble Resource URI\n $target_url = \"http://\" . $this->client_id . \".vsocial.com/api/v1/me/share/\";\n\n // Preparing POST data\n $post_fields = array(\n \"vsoc_access_token\" => $this->session->userdata('vsoc_access_token'),\n \"providerId\" => $provider_id,\n \"providerResponse\" => $provider_response,\n \"extraAppDetails\" => $extra_app_details,\n \"shareType\" => $share_type,\n \"url\" => $url\n );\n\n // URL Encode all POST fields\n foreach ($post_fields as $key => $value) {$post_string .= $key . '=' . urlencode($value) . '&';}\n rtrim($post_string, '&');\n\n // Initiate cURL\n $ch = curl_init($target_url);\n\n curl_setopt($ch, CURLOPT_POST, count($post_fields));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //Execute cURL\n $return_json = curl_exec($ch);\n\n\n }",
"public function actionShare() {\n\t\t$form = new ShareForm;\n\t\tif(isset($_POST['ShareForm'])) {\n\t\t\t$form->attributes = $_POST['ShareForm'];\n\t\t\tif($form->validate() && $form->save()) {\n\t\t\t\tYii::app()->user->setFlash('notify', array('type' => 'success', 'message' => Yii::t('cams', 'Cam successfully shared')));\n\t\t\t\t$this->redirect(array('manage'));\n\t\t\t\tYii::app()->end();\n\t\t\t}\n\t\t}\n\t\tif(Yii::app()->user->hasFlash('share')) {\n\t\t\t$cams = Yii::app()->user->getFlash('share');\n\t\t\t$cams = array_keys(array_filter($cams));\n\t\t\t$form->cams = join(', ', array_map(array($this, 'compileCams'), $cams));\n\t\t\t$form->hcams = join(',', array_map(array($this, 'compileHCams'), $cams));\n\t\t}\n\t\t$this->render('share', array('model' => $form));\n\t}",
"public function create_share($hostname, $client_api_id, $client_secret, $new_username, $new_password, $sharefile_folder_id, $sharefile_user_id){\n\t\t\n\t\t$user_id = '584f98ca-be03-49bd-8cf9-047d359cc7c2';\n\t\t$username = '[email protected]';\n\t\t\n\t\t/*$client = array(\"ShareType\"=>\"Send\", \"Title\"=>\"Sample Send Share\",\n\t\t\t\t\"ExpirationDate\"=>\"9999-12-31\",\"RequireLogin\"=>FALSE,\"RequireUserInfo\"=>FALSE,\"MaxDownloads\"=>\"-1\",\"UsesStreamIDs\"=>FALSE,\n\t\t\t\t\"Items\"=>array(\"Id\"=>$sharefile_folder_id),\"Recipients\"=>array(\"User\"=>array(\"Id\"=>$user_id),\"User\"=>array(\"Email\"=>$username)));\n\t\t$data = json_encode($client);\n\t\treturn $data;*/\n\t\t$data = '{ \n\t\t\t\t \"ShareType\":\"Send\", \n\t\t\t\t \"Title\":\"Sample Send Share\", \n\t\t\t\t \"Items\": [ { \"Id\":\"'.$sharefile_folder_id.'\" } ], \n\t\t\t\t \"Recipients\":[ { \"User\": { \"Id\":\"'.$user_id.'\" } }, { \"User\": { \"Email\": \"'.$username.'\" } } ], \n\t\t\t\t \"ExpirationDate\": \"9999-12-31\", \n\t\t\t\t \"RequireLogin\": false, \n\t\t\t\t \"RequireUserInfo\": false, \n\t\t\t\t \"MaxDownloads\": -1, \n\t\t\t\t \"UsesStreamIDs\": false\n\t\t\t\t} ';\n\t\t//return $data;\t\t\n\t\t$token = $this->authenticate($hostname, $client_api_id, $client_secret, $new_username, $new_password);\n\t\n\t\tif ($token) {\n\t\t\t$this->get_root($token, TRUE);\n\t\t}\n\t\t\t\n\t\t$uri = \"https://\".$this->get_hostname($token).\"/sf/v3/Shares?notify=false\";\t\n\t\t\n\t\t$headers = $this->get_authorization_header($token);\t\n\t\t$headers[] = \"Content-Type: application/json\";\n\t\t//print_r($headers);\n\t\t \n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 300);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t \n\t\t$curl_response = curl_exec ($ch);\n\t \n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$curl_error_number = curl_errno($ch);\n\t\t$curl_error = curl_error($ch);\n\t \n\t\t//echo $curl_response.\"\\n\"; // output entire response\n\t\t//return $http_code.\"\\n\"; // output http status code\n\t\t \n\t\tcurl_close ($ch);\n\t \n\t\tif ($http_code == 200) {\n\t\t\t$item = json_decode($curl_response);\n\t\t\treturn ($item); // print entire new item object\n\t\t\t//echo \"Created Folder: \".$item->Id.\"\\n\";\t\t\t\n\t\t}\t\t\n\t\t\t\t\n\t}",
"public function share() {\n\t\t// Page data\n\t\t$page_title = \"OptinDev - Share with Your Audience\";\n \t$step_number = 4;\n\n\t\t// Get user\n \t$user = $this->get_user();\n \t$user_id = $user->id;\n\n\t\t// Get landing page\n\t\t$landing_page = LandingPage::where('user_id', $user_id)->first();\n\n\t\t// Get path to landing page\n\t\t$url = \"http://optindev.com/lp/\" . $user_id . \"/\" . $landing_page->id;\n\n\t\t// Let's update analytics\n\t\t$user_analytics = UserAnalytics::where('user_id', $user_id)->first();\n\t\t$user_analytics->onboard = 2;\n\t\t$user_analytics->save();\n\n\t\t// Return view\n\t\treturn view('onboarding.pages.share')->with('page_title', $page_title)->with('step_number', $step_number)->with('url', $url);\n\t}",
"static public function createShare($share_name, $params)\n {\n if (isset($params['name'])) {\n $name = $params['name'];\n unset($params['name']);\n } else {\n /* Sensible default for empty display names */\n $name = sprintf(_(\"Address book of %s\"), $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create()->getName());\n }\n\n /* Generate the new share. */\n try {\n $turba_shares = $GLOBALS['injector']->getInstance('Turba_Shares');\n\n $share = $turba_shares->newShare($GLOBALS['registry']->getAuth(), $share_name, $name);\n\n /* Now any other params. */\n foreach ($params as $key => $value) {\n if (!is_scalar($value)) {\n $value = serialize($value);\n }\n $share->set($key, $value);\n }\n $turba_shares->addShare($share);\n $share->save();\n } catch (Horde_Share_Exception $e) {\n Horde::log($e, 'ERR');\n throw new Turba_Exception($e);\n }\n\n return $share;\n }",
"function share($owner_email, $groups, $id, $connection) {\n\t$query = \"INSERT INTO share VALUES (?, ?, ?)\";\n\n\t//prepare insert statement\n\tif ($statement = $connection->prepare($query)) {\n\t\t//bind variables to the prepared statement as param\n\t\t$statement->bind_param(\"ssi\", $param_email, $param_fg, $param_id);\n\n\t\t//set parameters\n\t\t$param_email = $owner_email;\n\t\t$param_id = $id;\n\n\t\t//loop over every friendgroup they have selected\n\t\tforeach($groups as $v) {\n\t\t\t//bind fgname\n\t\t\t$param_fg = $v;\n\n\t\t\t//attempt execution\n\t\t\tif ($statement->execute()) {\n\t\t\t\techo \"Shared to $v, \";\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo \"Failed to share to $v, \";\n\t\t\t}\n\t\t}\n\t}\n\t$statement->close();\n}",
"public function _addShareToGroup()\r\n {\r\n if(empty($_POST)){$_POST = json_decode(file_get_contents(\"php://input\"),true);}\r\n\t\tif(!empty($_POST['group_ids']) && intval($_POST['share_id'])){\r\n\t\t\t// Try to assign POST values to attributes\r\n\t\t\t$share_arr = array();\r\n\t\t\t$share_arr['share_id'] = intval($_POST['share_id']);\r\n\t\t\t$share_arr['create_date'] = intval($_POST['create_date']);\r\n\t\t\t$group_ids = trim($_POST['group_ids']);\r\n\t\t\t$group_arr = explode(',',rtrim($group_ids,','));\r\n\t\t\t$i = 0;\r\n\t\t\tforeach($group_arr as $k=>$v){\r\n\t\t\t\t$model = new ShareToGroup;\r\n\t\t\t\t$share_arr['group_id'] = intval($v);\r\n\t\t\t\t// Find the item by group_id and share_id\r\n\t\t\t\t$share_info = ShareToGroup::model()->find('group_id=:group_id AND share_id=:share_id', array(':group_id'=>$share_arr['group_id'], ':share_id'=>$share_arr['share_id']));\r\n\t\t\t\tif(empty($share_info)){\r\n\t\t\t\t\tforeach($share_arr as $var=>$value) {\r\n\t\t\t\t\t\t// Does the model have this attribute?\r\n\t\t\t\t\t\tif($model->hasAttribute($var)) {\r\n\t\t\t\t\t\t\t$model->$var = $value;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// No, raise an error\r\n\t\t\t\t\t\t\t$this->_sendResponse(500, sprintf('Parameter [%s] is not allowed for model [%s]', $var, $_GET['model']) );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Try to save the model\r\n\t\t\t\tif($model->save()){\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->_sendResponse(200, sprintf('There are [%s] new items has been pushed.', $i) );\r\n\t\t}else{\r\n\t\t\t$this->_sendResponse(501, sprintf('Error: Parameter share_id and group_ids is required') );\r\n\t\t\treturn;\r\n\t\t}\r\n }",
"function uri_teams_create_team( $term_id, $tt_id ) {\n\n\t$newly_created_term = get_term( $term_id );\n\t\n\tif ( ! is_object( $newly_created_term ) && ! $newly_created_term->taxonomy ) {\n\t\treturn FALSE;\n\t}\n\t\n $new_taxonomy = ( 'teams_users' == $newly_created_term->taxonomy ) ? 'teams_content' : 'teams_users';\n\t$accompanying_term = get_term_by( 'name', $newly_created_term->name, $new_taxonomy );\n\n\t\n\t// if we already have the accompanying term, no need to proceed.\n\tif ( $accompanying_term ) {\n\t\treturn;\n\t} else {\n\t\t// create the accompanying term\n\t\twp_insert_term( $newly_created_term->name, $new_taxonomy, array(\n\t\t\t'description' => $newly_created_term->description,\n\t\t\t'slug' => $newly_created_term->slug,\n\t\t));\n\t}\n\n \n}",
"function create_team_host($oauth_uid, $teams_fan_page_id, $manager_oauth_uid){\n\t\t\n\t\t//check to see if a record already exists\n\t\t$query = $this->db->get_where('teams_hosts', array('users_oauth_uid' => $oauth_uid, 'teams_fan_page_id' => $teams_fan_page_id));\n\t\tif($result = $query->row()){\n\t\t\t//update existing\n\t\t\t\n\t\t\t$this->db->where('id', $result->id);\n\t\t\t$this->db->update('teams_hosts', array('banned' => 0, 'quit' => 0, 'time_added' => time()));\n\t\t\t\n\t\t}else{\n\t\t\t//create new\n\t\t\t$data = array(\n\t\t\t\t'teams_fan_page_id' => $teams_fan_page_id,\n\t\t\t\t'users_oauth_uid' \t=> $oauth_uid, \n\t\t\t\t'manager_oauth_uid' => $manager_oauth_uid,\n\t\t\t\t'time_added' \t\t=> time()\n\t\t\t);\n\t\t\t\n\t\t\t$this->db->insert('teams_hosts', $data);\n\t\t\t\n\t\t}\n\t\t\n\t\t//update user record\n\t\t$this->db->where('oauth_uid', $oauth_uid);\n\t\t$this->db->update('users', array('host' => 1));\n\t\t\n\t\t//quit all other teams\n\t\t$this->db->update('teams_hosts', array('quit' => 1, 'quit_time' => time()), 'teams_fan_page_id != ' . $teams_fan_page_id);\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"public function newTeam($data){\n global $conn;\n $email = $data['name'].Ente::getDomain($this->city); // TODO: Gestire email\n $pass = MD5($data['pass']);\n $member = (int)$data['member'];\n $nameTypeReport = $data['type'];\n $type = 'Team';\n\n $listTypeReport = [];\n\n // Lista tipi report per ottenere gli id\n $stmt = $conn->prepare(QUERY_LIST_TYPE_REPORT);\n $stmt->bind_param(\"s\",$this->city);\n $stmt->execute();\n $result = $stmt->get_result();\n while($row = $result->fetch_assoc()){\n $listTypeReport[$row['id']] = $row['name'];\n }\n\n $idTypeReport = array_search($nameTypeReport, $listTypeReport);\n\n // var_dump($pass);\n // die();\n\n // Registra nuovo utente come team\n $stmt = $conn->prepare(QUERY_USER_SIGN_UP);\n $stmt->bind_param('ssss', $email, $type, $pass, $this->city);\n $stmt->execute();\n $idUser = $conn->insert_id;\n \n $stmt = $conn->prepare(QUERY_ADD_TEAM);\n $stmt->bind_param('siii', $data['name'], $idTypeReport, $member, $idUser);\n $stmt->execute();\n \n\n if($stmt->affected_rows > 0){\n $this->fetchTeams();\n return true;\n }\n else{\n return false;\n }\n\n \n }",
"public function share_link_is_working()\n {\n $response = $this->post('/babyshowers', [\n 'name_mama' => 'Mothers name',\n 'name_papa' => 'Fathers name',\n 'email' => '[email protected]',\n 'name_bebe' => 'Babys name',\n 'birth_date' => Carbon::now()->addMonths('2'),\n 'event_date' => Carbon::now()->addDays('10'),\n ]);\n\n $response->assertOk();\n $this->assertCount(1, Babyshower::all());\n\n $response = $this->get(\"share/\" . $response->getOriginalContent()->getData()['linkShare']);\n\n $response->assertStatus(200);\n\n }",
"public function createKontoShare($besitzer)\n {\n if (isset($_GET['newShare'])) {\n\n //$j\n $getusers = $this->sqlselect(\"SELECT * FROM benutzer ORDER BY Name\");\n //$i\n $getkonten = $this->sqlselect(\"SELECT * FROM finanzen_konten WHERE besitzer=$besitzer ORDER BY konto\");\n\n echo \"<div class='newFahrt'>\";\n echo \"<h2>Share erstellen</h2>\";\n echo \"<p class='hinweis'>Beachte: Der Nutzer bekommt nach Freigabe Leserechte auf das Konto. Shares können jederzeit wieder gelöscht werden.</p>\";\n echo \"<form method=post>\";\n echo \"<select name=konto>\";\n echo \"<option>Konto auswählen ...</option>\";\n\n for ($i = 0; $i < sizeof($getkonten); $i++) {\n echo \"<option value='\" . $getkonten[$i]->id . \"'>\";\n echo $getkonten[$i]->konto;\n echo \"</option>\";\n }\n\n echo \"</select>\";\n echo \"<select name=user>\";\n echo \"<option>Benutzer auswählen ...</option>\";\n\n for ($j = 0; $j < sizeof($getusers); $j++) {\n if ($getusers[$j]->id != $besitzer) {\n echo \"<option value='\" . $getusers[$j]->id . \"'>\";\n echo $getusers[$j]->Name;\n echo \"</option>\";\n }\n }\n\n echo \"</select>\";\n echo \"<br><input type=submit name=absenden value=Absenden>\";\n echo \"</form>\";\n\n //Speichern der Inhalte\n if (isset($_POST['absenden'])) {\n if (isset($_POST['konto']) and isset($_POST['user'])) {\n $konto = $_POST['konto'];\n $user = $_POST['user'];\n\n if ($konto > 0 and $user > 0) {\n if ($this->sqlInsertUpdateDelete(\"INSERT INTO finanzen_shares (besitzer, konto_id, target_user) VALUES ($besitzer, $konto, $user) \")) {\n echo \"<p class='erfolg'>Share wurde gespeichert.</p>\";\n } else {\n echo \"<p class='meldung'>Share konnte nicht gespeichert werden, möglicherweise existiert der Share bereits!</p>\";\n }\n }\n }\n }\n echo \"</div>\";\n }\n }",
"public function newteam()\n\t\t{\n JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n \n // Initialise variables.\n //$app = JFactory::getApplication();\n $model = $this->getModel('teamdetail');\n\t\t\t\t$jinput = JFactory::getApplication()->input;\n\t\t\t\t$msg =\"\";\n\t\t\t\t$failure=FALSE;\n\t\t\t\t\n // Get the data from the form POST\n $data = $jinput->getVar('jform', array(), 'post', 'array');\n\t\t\t\t\n\t\t\t\tif (JFactory::getUser()->guest==1 || JFactory::getUser()->id!=$data['submitter_id']) return false;\n\t\t\t\t\n\t\t\t\tif ($data['race']>0 && !empty($data['name']) && $data['startval']>500000)\n\t\t\t\t{\n\t\t\t\t\t$upditem = $model->newTeam($data['race'], $data['name'], $data['startval'], $data['submitter_id']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($upditem>0)\n\t\t\t\t{\n\t\t\t\t\t$this->setRedirect( JRoute::_( 'index.php?option=com_bloodbowl&view=teamdetail&show='. $upditem .'&toggleedit=1') );\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$this->setRedirect( JRoute::_( 'index.php?option=com_bloodbowl&view=teamslist&show='. $data['submitter_id'] ) );\n\t\t\t\treturn false;\n\t\t}",
"private function manageTeamOwner()\n {\n if( !$this->isNewRecord ) {\n return;\n }\n\n $this->link('players', Yii::$app->user->getIdentity(false), array('is_capitan' => 1));\n }",
"public function store(Request $request)\n {\n $checkrights = \\App\\Models\\Admin::checkPermission(\\App\\Models\\Admin::$ADD_PROJECT_CREDENTIAL);\n \n if($checkrights) \n {\n return $checkrights;\n }\n $data = array();\n $status = 1;\n $msg = $this->addMsg;\n $goto = $this->list_url;\n\n $i = 0;\n foreach($request->get(\"group-a\") as $r)\n {\n\t\t\t$auth_id = \\Auth::guard('admins')->user()->id;\n $obj = new Credential();\n $obj->protocol = isset($r['protocol']) ? $r['protocol']:'';\n $obj->project_id = isset($r['project_id']) ? $r['project_id']:'';\n $obj->hostname = isset($r['hostname']) ? $r['hostname']:'';\n $obj->username = isset($r['username']) ? $r['username']:'';\n $obj->password = isset($r['password']) ? $r['password']:'';\n $obj->port = isset($r['port']) ? $r['port']:'';\n $obj->url = isset($r['url']) ? $r['url']:'';\n $obj->description = isset($r['description']) ? $r['description']:'';\n\t\t\t$obj->title = isset($r['title']) ? $r['title']:'';\n $obj->environment = isset($r['environment']) ? $r['environment']:'';\n\t\t\t$obj->key_file_password = isset($r['key_file_password']) ? $r['key_file_password']:'';\n\t\t\t$obj->mode = isset($r['mode']) ? $r['mode']:'';\n $obj->created_by = $auth_id;\n $obj->save();\n\t\t\t$credential_id = $obj->id;\n\t\t\t$project_id = $obj->project_id;\n $project = Project::find($project_id);\n\t\t\t\n\t\t\tif(isset($r['share_users'])){\n $users =$r['share_users'];\n if(is_array($users))\n {\n foreach($users as $user)\n { \n $share = new ShareWithUser();\n $share->credential_id=$credential_id;\n $share->user_id=$user;\n $share->save();\n }\n\t\t\t\t\tforeach ($users as $user)\n {\n $detail = User::find($user);\n\n $subject = \"Reports PHPDots: Shared Project Credential\";\n $description = $project->title.\" Project Credentials has been shared with you. please find below link, for it.\";\n $Path = url('/').\"/credentials?popup_id=\".$credential_id;\n\n $message = array();\n $message['name'] = $detail->name;\n $message['description'] = $description;\n $message['link'] = $Path;\n \n $returnHTML = view('emails.credential_temp',$message)->render();\n $auth_id = \\Auth::guard('admins')->user();\n $empName = ucfirst($auth_id->firstname).\" \".ucfirst($auth_id->lastname);\n\n $params[\"to\"]=$detail->email;\n $params[\"subject\"] = $subject;\n $params[\"from\"] = $auth_id->email;\n $params[\"from_name\"] = $empName; \n $params[\"body\"] = $returnHTML;\n sendHtmlMail($params);\n }\n } \n }\n\t\t\t\n $id = $obj->id;\n $arry = $request->file(\"group-a\"); \n if(!empty($request->file(\"group-a\")) && isset($arry[$i]['key_file']))\n { \n \n $key_file = $arry[$i]['key_file'];\n $destinationPath = public_path().DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'project_credentials'.DIRECTORY_SEPARATOR.$id; \n \n $doc_name =$key_file->getClientOriginalName();\n \n // echo $destinationPath.' -> '.$doc_name;\n\n $key_files =$key_file->move($destinationPath,$doc_name);\n \n $obj->key_file = $doc_name;\n $obj->save();\n }\n\n //store logs detail\n $params=array();\n $params['adminuserid'] = \\Auth::guard('admins')->id();\n $params['actionid'] = $this->adminAction->ADD_PROJECT_CREDENTIAL;\n $params['actionvalue'] = $id;\n $params['remark'] = \"Add Credential::\".$id;\n $logs= \\App\\Models\\AdminLog::writeadminlog($params); \n $i++;\n }\n session()->flash('success_message', $msg);\n\n return ['status' => $status, 'msg' => $msg, 'data' => $data, 'goto' => $goto]; \n }",
"public function actionCreate()\n {\n $model = new WorksystemAssignTeam();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'teams' => $this->getAssignTeams(),\n 'users' => $this->getAssignUsers(),\n ]);\n }\n }",
"public function setShareType($shareType);",
"function ajs_spb_do_social_share() {\n\techo ajs_spb_get_social_share();\n}",
"function home_team()\n\t{\n\t\t$team = new Team();\n\t\t$team->where('name', get_setting('fs_gen_default_team'))->get();\n\t\tredirect('/admin/members/teams/' . $team->stub);\n\t}",
"function _horde_addShare($shareRoot, $shareName, $shareTitle, $userName)\n{\n if (!Auth::isAdmin()) {\n return PEAR::raiseError(_(\"You are not allowed to add shares.\"));\n }\n\n require_once 'Horde/Share.php';\n $shares = &Horde_Share::singleton($shareRoot);\n\n if (is_a($share = &$shares->newShare($shareName), 'PEAR_Error')) {\n return $share;\n }\n $share->set('owner', $userName);\n $share->set('name', $shareTitle);\n\n if (is_a($result = $shares->addShare($share), 'PEAR_Error')) {\n return $result;\n }\n\n return true;\n}",
"public function run()\n {\n $team = Team::create([\n 'name' => 'Walter White',\n 'position' => 'Chief Executive Officer',\n 'photo' => 'team-1.jpg',\n 'status' => 1,\n ]);\n\n $team->teamSocials()->createMany([\n [\n 'name' => 'twitter',\n 'icon' => 'icofont-twitter',\n 'link' => 'https://twitter.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'facebook',\n 'icon' => 'icofont-facebook',\n 'link' => 'https://www.facebook.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'instagram',\n 'icon' => 'icofont-instagram',\n 'link' => 'https://www.instagram.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'linkedin',\n 'icon' => 'icofont-linkedin',\n 'link' => 'https://www.linkedin.com/',\n 'status' => 1,\n ]\n ]);\n\n $team = Team::create([\n 'name' => 'Sarah Jhonson',\n 'position' => 'Product Manager',\n 'photo' => 'team-2.jpg',\n 'status' => 1,\n ]);\n\n $team->teamSocials()->createMany([\n [\n 'name' => 'twitter',\n 'icon' => 'icofont-twitter',\n 'link' => 'https://twitter.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'facebook',\n 'icon' => 'icofont-facebook',\n 'link' => 'https://www.facebook.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'instagram',\n 'icon' => 'icofont-instagram',\n 'link' => 'https://www.instagram.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'linkedin',\n 'icon' => 'icofont-linkedin',\n 'link' => 'https://www.linkedin.com/',\n 'status' => 1,\n ]\n ]);\n\n $team = Team::create([\n 'name' => 'William Anderson',\n 'position' => 'CTO',\n 'photo' => 'team-3.jpg',\n 'status' => 1,\n ]);\n\n $team->teamSocials()->createMany([\n [\n 'name' => 'twitter',\n 'icon' => 'icofont-twitter',\n 'link' => 'https://twitter.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'facebook',\n 'icon' => 'icofont-facebook',\n 'link' => 'https://www.facebook.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'instagram',\n 'icon' => 'icofont-instagram',\n 'link' => 'https://www.instagram.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'linkedin',\n 'icon' => 'icofont-linkedin',\n 'link' => 'https://www.linkedin.com/',\n 'status' => 1,\n ]\n ]);\n\n $team = Team::create([\n 'name' => 'Amanda Jepson',\n 'position' => 'Accountant',\n 'photo' => 'team-4.jpg',\n 'status' => 1,\n ]);\n\n $team->teamSocials()->createMany([\n [\n 'name' => 'twitter',\n 'icon' => 'icofont-twitter',\n 'link' => 'https://twitter.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'facebook',\n 'icon' => 'icofont-facebook',\n 'link' => 'https://www.facebook.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'instagram',\n 'icon' => 'icofont-instagram',\n 'link' => 'https://www.instagram.com/',\n 'status' => 1,\n ],\n [\n 'name' => 'linkedin',\n 'icon' => 'icofont-linkedin',\n 'link' => 'https://www.linkedin.com/',\n 'status' => 1,\n ]\n ]);\n }",
"public function create(Request $request)\n {\n $this->validate($request,[\n 'name' =>'required',\n 'type'=>'required'\n ]);\n $team = new Team;\n $team->name =$request->input('name');\n $team->type=$request->input('type');\n if($request->hasFile('avatar')!=NULL)\n {\n $avatar=$request->file('avatar');\n $filename=time().'.'.$avatar->getClientOriginalExtension();\n Image::make($avatar)->resize(300,300)->save(public_path('media/teamavatars/'.$filename));\n $team->logo=$filename;\n }\n $team->save();\n $user = Auth::user();\n $user->teams()->attach($team,['status'=>\"Leader\"]);\n return redirect('dashboard')->with('success','Team created');\n }",
"private function save_sharing_data()\n\t{\n\t\t// Remove all existing records\n\t\tDB::delete(self::SHARING_TABLE)->where('report_id', '=', $this->id)->execute();\n\n\t\t// Add new records\n\t\tif (count($this->shared_with_groups) > 0)\n\t\t{\n\t\t\t$q = DB::insert(self::SHARING_TABLE)->columns(array('report_id', 'group_id'));\n\t\t\tforeach ($this->shared_with_groups as $group_id)\n\t\t\t{\n\t\t\t\t$q->values(array($this->id, $group_id));\n\t\t\t}\n\t\t\t$q->execute();\n\t\t}\n\t}",
"public function create()\n {\n $create = HomeTeam::all(); \n return view('backend.homeTeamB', compact('create'));\n }",
"public function setShare($val)\n {\n $this->_propDict[\"share\"] = $val;\n return $this;\n }",
"public function _addShareToUser()\r\n {\r\n if(empty($_POST)){$_POST = json_decode(file_get_contents(\"php://input\"),true);}\r\n\t\tif(!empty($_POST['user_ids']) && intval($_POST['share_id'])){\r\n\t\t\t// Try to assign POST values to attributes\r\n\t\t\t$share_arr = array();\r\n\t\t\t$share_arr['share_id'] = intval($_POST['share_id']);\r\n\t\t\t$share_arr['create_date'] = intval($_POST['create_date']);\r\n\t\t\t$user_ids = trim($_POST['user_ids']);\r\n\t\t\t$user_arr = explode(',',rtrim($user_ids,','));\r\n\t\t\t$i = 0;\r\n\t\t\tforeach($user_arr as $k=>$v){\r\n\t\t\t\t$model = new ShareToUser;\r\n\t\t\t\t$share_arr['user_id'] = intval($v);\r\n\t\t\t\t// Find the item by user_id and share_id\r\n\t\t\t\t$share_info = ShareToUser::model()->find('user_id=:user_id AND share_id=:share_id', array(':user_id'=>$share_arr['user_id'], ':share_id'=>$share_arr['share_id']));\r\n\t\t\t\tif(empty($share_info)){\r\n\t\t\t\t\tforeach($share_arr as $var=>$value) {\r\n\t\t\t\t\t\t// Does the model have this attribute?\r\n\t\t\t\t\t\tif($model->hasAttribute($var)) {\r\n\t\t\t\t\t\t\t$model->$var = $value;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// No, raise an error\r\n\t\t\t\t\t\t\t$this->_sendResponse(500, sprintf('Parameter [%s] is not allowed for model [%s]', $var, $_GET['model']) );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Try to save the model\r\n\t\t\t\tif($model->save()){\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->_sendResponse(200, sprintf('There are [%s] new items has been pushed.', $i) );\r\n\t\t}else{\r\n\t\t\t$this->_sendResponse(501, sprintf('Error: Parameter share_id and user_ids is required') );\r\n\t\t\treturn;\r\n\t\t}\r\n }",
"public function create()\n {\n $teams = Team::all();\n $countTeams=Team::orderBy('id')->count();\n $checkUser = Team::where('team_id', Auth::user()->id)->first();\n\n\n if($checkUser) {\n\n return redirect('/teams')->with('error', 'Jūs jau dalyvaujate turnyre');\n }\n if(Auth::user()->ban > 1) {\n return redirect('/teams')->with('error', 'Šiuo metu registracija negalima, pamėginkite vėliau arba susisiekite su administracija');\n }\n if($countTeams == 20) {\n return redirect('/teams')->with('info', 'Labai atsiprašome, tačiau visos komandos šiame turnyre užimtos. Galbūt vėliau atsilaisvins vieta.');\n }\n if(Auth::user()->provider_user_id < 1){\n return redirect('/teams')->with('info', 'Dalyvauti gali tik facebook prisijungę vartotojai.');\n }\n\n //\n // if($teams > 1){\n // return redirect('/teams')->with('error', 'Visos komandos jau užimtos');\n // }\n return view('teams.create', compact('teams'));\n\n\n\n }",
"function newTeam($name)\r\n\t{\r\n\t\tglobal $connect;\r\n\t\tif(strlen($name) > 30)\r\n\t\t{\r\n\t\t\techo \"Error: team name too long.\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$insert_sql = \"INSERT INTO fantasyteams(team_name) VALUES ('$name')\";\r\n\t\t//echo $insert_sql;\r\n\t\tif (mysqli_query($connect, $insert_sql))\r\n\t\t{\r\n\t\t\t//echo \"New record created successfully\";\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo \"Error: \" . $insert_sql . \"<br>\" . mysqli_error($connect);\r\n\t\t}\r\n\t}"
] | [
"0.60217535",
"0.5871875",
"0.5860166",
"0.58061177",
"0.5798658",
"0.5662356",
"0.5650267",
"0.5643178",
"0.5622335",
"0.5556138",
"0.5468651",
"0.53761315",
"0.5358639",
"0.5344869",
"0.5321704",
"0.5308327",
"0.5300105",
"0.5294096",
"0.528792",
"0.5223646",
"0.52207166",
"0.52136075",
"0.5205268",
"0.51878005",
"0.5179959",
"0.5150718",
"0.5129062",
"0.5122157",
"0.5104642",
"0.5099347"
] | 0.61546284 | 0 |
show shares of a given team | public function show($team_id) {
$shares = Share::where('team_id','=',$team_id)->get();
return view('shares')->with('shares',$shares);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Share $share)\n {\n //\n }",
"public function show(Team $team)\n {\n //\n }",
"public function show(Team $team)\n {\n //\n }",
"public static function display_team_finder() {\n global $post;\n $arg = array(\n 'post_type' => 'teams',\n 'post_status' => 'any',\n 'numberposts' => -1,\n 'orderby' => 'date',\n\t 'order' => 'DESC',\n );\n $teams = get_posts($arg);\n\n $all_team_type = get_terms(array(\n 'taxonomy' => 'teams-type',\n 'hide_empty' => false\n ));\n\n $all_region = get_terms(array(\n 'taxonomy' => 'valorant-server',\n 'hide_empty' => false\n ));\n\n $all_ranks = get_terms(array(\n 'taxonomy' => 'rank-requirement',\n 'hide_empty' => false\n ));\n \n $ages = WP_STREAMERS_TEAMS::$age_requirement_list;\n $agents = WP_STREAMERS_TEAMS::$streamer_preferred_agent;\n $current_team = self::get_current_streamer_team();\n $is_draft = get_post_meta('is_draft', $post->ID, true);\n ob_start();\n require_once plugin_dir_path(__DIR__).'templates/team-finder.php';\n wp_reset_postdata();\n return ob_get_clean();\n }",
"public function show(Sharing $sharing)\n {\n //\n }",
"public function showAllShares($besitzer)\n {\n\n $shares = $this->sqlselect(\"SELECT * FROM finanzen_shares WHERE besitzer=$besitzer\");\n $sharesAmount = $this->getAmount(\"SELECT * FROM finanzen_shares WHERE besitzer=$besitzer\") + 0;\n\n echo \"<table class='kontoTable'>\";\n echo \"<thead><td>Konto</td><td>Freigegeben für</td><td></td></thead>\";\n\n //Wenn kein Share vorhanden ist:\n if ($sharesAmount == 0) {\n echo \"<tbody><td colspan=3>Du hast keine Shares erstellt, zum erstellen eines Shares, klicke auf <strong><a href='?newShare'>Share erstellen</a></strong></td></tbody>\";\n echo \"<tbody><td colspan=3></td></tbody>\";\n }\n\n for ($i = 0; $i < sizeof($shares); $i++) {\n $id = $shares[$i]->target_user;\n $username = $this->sqlselect(\"SELECT id, Name FROM benutzer WHERE id=$id LIMIT 1\");\n $kontoid = $shares[$i]->konto_id;\n $kontoname = $this->sqlselect(\"SELECT id, konto FROM finanzen_konten WHERE id=$kontoid LIMIT 1\");\n echo \"<tbody>\";\n echo \"<td>\" . $kontoname[0]->konto . \"</td>\";\n echo \"<td>\" . $username[0]->Name . \"</td>\";\n echo \"<td>\" . \"<a class='rightRedLink' href='?del&konto=\" . $kontoid . \"&user=\" . $id . \"'>X</a>\" . \"</td>\";\n echo \"</tbody>\";\n }\n echo \"</table>\";\n }",
"public function showSportsMatches($ptr) {\n $_matches = Match::sportsMatches()->mainMatches()->whereNotIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->offset($ptr)->limit(10)->get()->load('league','teamA', 'teamB', 'teamC');\n $currList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $index => $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n \n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n\n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n }\n $_m->teamawin_percentage = number_format($team_a_percentage, 2);\n $_m->teambwin_percentage = number_format($team_b_percentage, 2);\n $_m->teamcwin_percentage = number_format($team_c_percentage, 2);\n\n // $_matches[$index]->team_a_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamA->id), 2);\n // $_matches[$index]->team_b_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamB->id), 2);\n $_matches[$index]->match_sched = $_m->schedule->diffForHumans();\n unset($_matches[$index]->fee);\n \n switch($_m->status) {\n case 'open':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = '';\n case 'ongoing':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px\"> LIVE</span>';\n break;\n case 'settled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> SETTLED</span>';\n $_matches[$index]->team_a_winner = ($_m->teamA->id == $_m->team_winner);\n $_matches[$index]->team_b_winner = ($_m->teamB->id == $_m->team_winner);\n $_matches[$index]->team_c_winner = !empty($_m->team_c) && ($_m->teamC->id == $_m->team_winner);\n break;\n case 'draw':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> DRAW - CREDITS RETURNED</span>';\n break;\n case 'cancelled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> CANCELLED</span>';\n break; \n default:\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = '';\n break;\n }\n \n $oldList->push($_m);\n }\n return [\n 'matches' => $oldList,\n 'pointer' => $ptr += 10\n ];\n }",
"public function get_network_shares()\n {\n $obj = new View();\n\n if (! $this->authorized()) {\n $obj->view('json', array('msg' => array('error' => 'Not authenticated')));\n return;\n }\n \n $network_shares = new Network_shares_model;\n $obj->view('json', array('msg' => $network_shares->get_network_shares()));\n }",
"public function getAllShares()\n {\n # TODO [GH12] Add apisensorloggercontroller::getallshares\n }",
"function ajs_spb_do_social_share() {\n\techo ajs_spb_get_social_share();\n}",
"public function sportsindex($ptr)\n {\n $_matches = Match::sportsMatches()->mainMatches()->whereIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->get()->load('league','teamA', 'teamB', 'teamC');\n $liveList = collect();\n $openList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n\n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n }\n $_m->teama_percentage = number_format($team_a_percentage, 2);\n $_m->teamb_percentage = number_format($team_b_percentage, 2);\n $_m->teamc_percentage = number_format($team_c_percentage, 2);\n\n if ($_m->schedule->isFuture()) {\n if($_m->status == 'ongoing')\n $liveList->push($_m);\n else if($_m->status == 'open')\n $openList->push($_m);\n else\n $oldList->push($_m);\n } else {\n if ($_m->status == 'ongoing')\n $liveList->push($_m);\n else if($_m->status == 'open')\n $openList->push($_m);\n else\n $oldList->push($_m);\n }\n }\n $_liveList = $liveList->sortBy('schedule');\n $sportsmatches = $_liveList->merge($openList->sortBy('schedule'));\n\n return [\n 'matches' => $sportsmatches,\n 'pointer' => $ptr\n ];//view('sports', compact('teams', 'sportsmatches', 'leagues'));\n }",
"public function showNbaPlayoffsMatches($ptr) {\n $_matches = Match::scopeNbaPlayoffsMatches()->mainMatches()->whereNotIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->offset($ptr)->limit(10)->get()->load('league','teamA', 'teamB', 'teamC');\n $currList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $index => $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n \n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n }\n\n $_m->teamawin_percentage = number_format($team_a_percentage, 2);\n $_m->teambwin_percentage = number_format($team_b_percentage, 2);\n $_m->teamcwin_percentage = number_format($team_c_percentage, 2);\n // $_matches[$index]->team_a_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamA->id), 2);\n // $_matches[$index]->team_b_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamB->id), 2);\n $_matches[$index]->match_sched = $_m->schedule->diffForHumans();\n unset($_matches[$index]->fee);\n \n switch($_m->status) {\n case 'open':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = '';\n case 'ongoing':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px\"> LIVE</span>';\n break;\n case 'settled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> SETTLED</span>';\n $_matches[$index]->team_a_winner = ($_m->teamA->id == $_m->team_winner);\n $_matches[$index]->team_b_winner = ($_m->teamB->id == $_m->team_winner);\n $_matches[$index]->team_c_winner = !empty($_m->team_c) && ($_m->teamC->id == $_m->team_winner);\n break;\n case 'draw':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> DRAW - CREDITS RETURNED</span>';\n break;\n case 'cancelled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> CANCELLED</span>';\n break; \n default:\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = '';\n break;\n }\n \n $oldList->push($_m);\n }\n return [\n 'matches' => $oldList,\n 'pointer' => $ptr += 10\n ];\n }",
"public function show(Team $team, Game $game)\n {\n\n $member = Member::where(['user_id' => auth()->id(), 'team_id' => $team->id])\n ->first();\n if($member == null){\n $member = [];\n }\n $user = User::where('id','=',$team->user_id)->first();\n\n $approves = Member::join('users','users.id', '=', 'members.user_id')\n ->where(['members.approved'=>'0', 'members.team_id' => $team->id])\n ->select('members.*','users.name')\n ->get();\n\n $games = Game::where('games.team_id',$team->id)\n ->whereDate('games.game_time','>=', Carbon::today()->toDateString())\n ->orderBy('games.game_time', 'ASC')\n ->get();\n\n $players = Player::where(['team_id'=>$team->id])\n ->get();\n\n // dd($games);\n\n return view('teams.show', compact('team','user','member','approves','games','players'));\n\n }",
"public function index()\n {\n $shares = Share::all();\n\n return view('shares.index', compact('shares'));\n }",
"public function show(HomeTeam $homeTeam)\n {\n //\n }",
"public function coins_value_social_share() {\n\t\t $sql= mysqli_query($this->_con,\"select coins_by_social_share from coins_reward_method\")or die(mysqli_error());\n\t\t\t\t$result=mysqli_fetch_array($sql);\n\t\t\t\t$gift_coins =$result['coins_by_social_share'];\n\t\t\t\treturn $gift_coins;\n\t\t\t\t\n\t}",
"public function showCsgoMatches($ptr) {\n $_matches = Match::csgoMatches()->mainMatches()->whereNotIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->offset($ptr)->limit(10)->get()->load('league','teamA', 'teamB', 'teamC');\n $currList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $index => $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n\n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n\n }\n $_m->teamawin_percentage = number_format($team_a_percentage, 2);\n $_m->teambwin_percentage = number_format($team_b_percentage, 2);\n $_m->teamcwin_percentage = number_format($team_c_percentage, 2);\n\n // $_matches[$index]->team_a_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamA->id), 2);\n // $_matches[$index]->team_b_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamB->id), 2);\n $_matches[$index]->match_sched = $_m->schedule->diffForHumans();\n unset($_matches[$index]->fee);\n \n switch($_m->status) {\n case 'open':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = '';\n case 'ongoing':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px\"> LIVE</span>';\n break;\n case 'settled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> SETTLED</span>';\n $_matches[$index]->team_a_winner = ($_m->teamA->id == $_m->team_winner);\n $_matches[$index]->team_b_winner = ($_m->teamB->id == $_m->team_winner);\n $_matches[$index]->team_c_winner = !empty($_m->team_c) && ($_m->teamC->id == $_m->team_winner);\n break;\n case 'draw':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> DRAW - CREDITS RETURNED</span>';\n break;\n case 'cancelled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> CANCELLED</span>';\n break;\n default:\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = '';\n break;\n }\n \n $oldList->push($_m);\n }\n return [\n 'matches' => $oldList,\n 'pointer' => $ptr += 10\n ];\n }",
"public function index()\n {\n $user = Auth::user();\n $sport = Sport::all();\n $team = User::find($user->id)->teams;\n return view('teamdash')->with(['teams'=>$team,'sports'=>$sport]);\n }",
"private function format_team($team){\n\t\tif (count($team) > 0) {\n\t\t\t# Creates string according to how many team members there are for this piece of content\n\t\t\tif (count($team) == 1) {\n\t\t\t\t$userVerbage = \\WDDSocial\\NaturalLanguage::view_profile($team[0]->id,\"{$team[0]->firstName} {$team[0]->lastName}\");\n\t\t\t\t$teamString .= \"<a href=\\\"/user/{$team[0]->vanityURL}\\\" title=\\\"$userVerbage\\\">{$team[0]->firstName} {$team[0]->lastName}</a>\";\n\t\t\t}\n\t\t\t\n\t\t\t# if 2 team members\n\t\t\telse if (count($team) == 2) {\n\t\t\t\t$teamString = array();\n\t\t\t\tforeach ($team as $member) {\n\t\t\t\t\t$userVerbage = \\WDDSocial\\NaturalLanguage::view_profile($member->id,\"{$member->firstName} {$member->lastName}\");\n\t\t\t\t\tarray_push($teamString, \"<a href=\\\"/user/{$member->vanityURL}\\\" title=\\\"$userVerbage\\\">{$member->firstName} {$member->lastName}</a>\");\n\t\t\t\t}\n\t\t\t\t$teamString = implode(\" {$this->lang->text('and')} \", $teamString);\n\t\t\t}\n\t\t\t\n\t\t\t# more than 2 team members\n\t\t\telse {\n\t\t\t\tfor ($i = 0; $i < count($team); $i++) {\n\t\t\t\t\t$userVerbage = \\WDDSocial\\NaturalLanguage::view_profile($team[$i]->id,\"{$team[$i]->firstName} {$team[$i]->lastName}\");\n\t\t\t\t\tif ($i == count($team)-1) {\n\t\t\t\t\t\t$teamString .= \"{$this->lang->text('and')} <a href=\\\"/user/{$team[$i]->vanityURL}\\\" title=\\\"$userVerbage\\\">{$team[$i]->firstName} {$team[$i]->lastName}</a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse {\n\t\t\t\t\t\t$teamString .= \"<a href=\\\"/user/{$team[$i]->vanityURL}\\\" title=\\\"$userVerbage\\\">{$team[$i]->firstName} {$team[$i]->lastName}</a>, \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t# no team members\n\t\telse {\n\t\t\t$teamString = \"\";\n\t\t}\n\t\t\n\t\treturn $teamString;\n\t}",
"public function index()\n {\n //\n $teams = Team::sortable(['points' => 'desc'])->paginate(10);\n \n return view('rank', compact('teams'));\n }",
"public function coins_by_social_share($uid) {\n\t\t @$id =$uid;\n\t\t\t\t$sel= mysqli_query($this->_con,\"select coins_by_social_share from coins_reward_method\")or die(mysqli_error());\n\t\t\t\t$res=mysqli_fetch_array($sel,MYSQLI_ASSOC); //echo '<pre>';print_r($data1); die();\n\t\t\t\t$gift_coins = $res['coins_by_social_share'];\n\t\t\t\t$remarks ='By Social Share';\n\t\t\t\t/*Insert coins into user wallet*/\n\t\t $insert_users_coins_in_wallet = $this->inser_user_coins_in_wallet($id,$gift_coins,$remarks);\n\t\t\t\t/*Update users default balance*/\n\t\t\t\t$update_users_coins = $this->update_user_coins_final_balance($id,$gift_coins);\n\t}",
"public function index(TeamRequest $request)\n {\n $teams = $this->repository\n ->setPresenter('\\\\Litepie\\\\User\\\\Repositories\\\\Presenter\\\\TeamListPresenter')\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->all();\n $teams['code'] = 2000;\n return response()->json($teams) \n ->setStatusCode(200, 'INDEX_SUCCESS');\n\n }",
"public function index() {\n $teamsQuery = Team::select(['teams.*', DB::raw('count(user_profiles.profile_id) as profiles')]);\n \n $teamsQuery->join('user_profiles', 'teams.team_id', '=', 'user_profiles.team_id', 'LEFT');\n $teamsQuery->groupBy('teams.team_id');\n \n if (Input::has('name')) {\n $teamsQuery->where('team_name', 'LIKE', '%'.Input::get('name').'%');\n }\n \n if (Input::has('sort')) {\n switch (Input::get('sort')) {\n case 'name':\n $sort_field = 'teams.team_name'; break;\n case 'captain':\n $sort_field = 'teams.captain_user_id'; break;\n case 'members':\n $sort_field = 'profiles'; break;\n default:\n $sort_field = 'team_id'; break;\n }\n if (Input::has('type') && Input::get('type') == 'desc') $type = 'DESC';\n else $type = 'ASC';\n $teamsQuery->orderBy($sort_field, $type);\n }\n \n $page = Paginator::resolveCurrentPage();\n $count = count($teamsQuery->get());\n $team_models = $teamsQuery->take(10)->offset(10*($page-1))->get();\n \n $years = Season::lists('year', 'year');\n $teams = new LengthAwarePaginator($team_models, $count, 10, $page, [\n 'path' => Paginator::resolveCurrentPath(),\n ]);\n\n // dd($teams->first()->captain);\n return view('teams.index', compact('teams', 'years'));\n }",
"public function nbaplayoffsindex($ptr){\n $_matches = Match::nbaPlayoffsMatches()->mainMatches()->whereIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->get()->load('league','teamA', 'teamB', 'teamC');\n $liveList = collect();\n $openList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n \n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n }\n $_m->teama_percentage = number_format($team_a_percentage, 2);\n $_m->teamb_percentage = number_format($team_b_percentage, 2);\n $_m->teamc_percentage = number_format($team_c_percentage, 2);\n\n if ($_m->schedule->isFuture()) {\n if($_m->status == 'ongoing')\n $liveList->push($_m);\n else if($_m->status == 'open')\n $openList->push($_m);\n else\n $oldList->push($_m);\n } else {\n if ($_m->status == 'ongoing')\n $liveList->push($_m);\n else if($_m->status == 'open')\n $openList->push($_m);\n else\n $oldList->push($_m);\n }\n }\n $_liveList = $liveList->sortBy('schedule');\n $sportsmatches = $_liveList->merge($openList->sortBy('schedule'));\n \n return [\n 'matches' => $sportsmatches,\n 'pointer' => $ptr\n ];//view('sports', compact('teams', 'sportsmatches', 'leagues'));\n }",
"public function getShare();",
"function teams() {\n\t\tglobal $db;\n\n\t\t$sql = \"\n\t\tSELECT\n\t\t\tuser.username as username,\n\t\t\tuser.id as user_id,\n\t\t\tstl_players.team_id as team_id,\n\t\t\tstl_positions.*\n\t\tFROM stl_players\n\t\t\tLEFT JOIN user\n\t\t\t\tON\n\t\t\t\tuser.id = stl_players.user_id\n\t\t\tINNER JOIN stl_positions\n\t\t\t\tON\n\t\t\t\tstl_players.user_id = stl_positions.ship_user_id\n\t\tWHERE\n\t\t\tstl_players.game_id = '$_GET[game_id]'\n\t\t\tAND\n\t\t\tstl_positions.game_id = '$_GET[game_id]'\n\n\n\t\t\";\n\t\t$result = $db->query($sql,__FILE__,__LINE__);\n\t\t$add1 = \"<b>\";\n\t\twhile($rs = $db->fetch($result)) {\n\t\t\t$add1 = ($rs['hit_user_id']) ? \"<b style='text-decoration: line-through'>\" : \"<b>\";\n\t\t\tif($rs['team_id'] == 0) {\n\t\t\t\t$this->data['team_gelb'] .= $add1.$rs['username'].\"</b><br>\";\n\t\t\t} else {\n\t\t\t\t$this->data['team_gruen'] .= $add1.$rs['username'].\"</b><br>\";\n\t\t\t}\n\t\t}\n\n\t}",
"function teamDisplay($team_count, $per_div) {\nglobal $connection;\n$query = \"SELECT * FROM teams LIMIT $team_count, $per_div\";\n$select_teams_query = mysqli_query($connection, $query);\n\nwhile ($row = mysqli_fetch_assoc($select_teams_query)) {\n $team_id = $row['team_id'];\n $team_city = $row['team_city'];\n $team_name = $row['team_name'];\n\n if ($team_name == \"FortyNiners\") {\n $team_name = \"49ers\";\n }\n\necho \"<div class='team'><a href='team.php?tm_id=$team_id'>{$team_city} {$team_name}</a></div>\";\n}\n\n}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $teams = $em->getRepository('DondrekielAppBundle:Team')->findAll();\n\n return $this->render('DondrekielAdminBundle::admin/team/index.html.twig', array(\n 'teams' => $teams,\n ));\n }",
"public function actionList()\n {\n $searchModel = Yii::createObject($this->di('TeamSearch'));\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('list', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function csgoindex($ptr)\n {\n $_matches = Match::csgoMatches()->mainMatches()->whereIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->get()->load('league','teamA', 'teamB', 'teamC');\n $liveList = collect();\n $openList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n\n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0;\n\n }\n $_m->teama_percentage = number_format($team_a_percentage, 2);\n $_m->teamb_percentage = number_format($team_b_percentage, 2);\n $_m->teamc_percentage = number_format($team_c_percentage, 2);\n\n if ($_m->schedule->isFuture()) {\n if($_m->status == 'ongoing')\n $liveList->push($_m);\n else if($_m->status == 'open')\n $openList->push($_m);\n else\n $oldList->push($_m);\n } else {\n if ($_m->status == 'ongoing')\n $liveList->push($_m);\n else if($_m->status == 'open')\n $openList->push($_m);\n else\n $oldList->push($_m);\n }\n }\n $_liveList = $liveList->sortBy('schedule');\n $csgomatches = $_liveList->merge($openList->sortBy('schedule'));\n return [\n 'matches' => $csgomatches,\n 'pointer' => $ptr\n ];//view('csgo', compact('teams', 'csgomatches', 'leagues'));\n }"
] | [
"0.6307198",
"0.6154211",
"0.6154211",
"0.5806502",
"0.57680655",
"0.5732149",
"0.5719804",
"0.570431",
"0.5587535",
"0.55794656",
"0.55774456",
"0.5502636",
"0.54932344",
"0.5482396",
"0.5482209",
"0.5467538",
"0.5464849",
"0.5426652",
"0.54182035",
"0.53794914",
"0.5363732",
"0.536323",
"0.53546184",
"0.53534067",
"0.5339404",
"0.53356373",
"0.53133386",
"0.5303752",
"0.52719885",
"0.5270251"
] | 0.6915824 | 0 |
Print admin tabs. Used to output the custom layouts on basis of their types. Fired by `views_editastraadvancedhook` filter. | public function admin_print_tabs( $views ) {
$current_type = '';
$active_class = ' nav-tab-active';
$current_tab = $this->get_active_tab();
if ( ! empty( $_REQUEST['layout_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$current_type = $_REQUEST['layout_type']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$active_class = '';
}
$url_args = array(
'post_type' => ASTRA_ADVANCED_HOOKS_POST_TYPE,
'layout_type' => $current_tab,
);
$custom_layout_types = array(
'header' => __( 'Header', 'astra-addon' ),
'footer' => __( 'Footer', 'astra-addon' ),
'hooks' => __( 'Hooks', 'astra-addon' ),
'404-page' => __( '404 Page', 'astra-addon' ),
'content' => __( 'Page Content', 'astra-addon' ),
);
$baseurl = add_query_arg( $url_args, admin_url( 'edit.php' ) );
?>
<div class="nav-tab-wrapper ast-custom-layout-tabs-wrapper">
<a class="nav-tab<?php echo esc_attr( $active_class ); ?>" href="<?php echo esc_url( admin_url( 'edit.php?post_type=' . ASTRA_ADVANCED_HOOKS_POST_TYPE ) ); ?>">
<?php
echo esc_html__( 'All', 'astra-addon' );
?>
</a>
<?php
foreach ( $custom_layout_types as $type => $title ) {
$type_url = esc_url( add_query_arg( 'layout_type', $type, $baseurl ) );
$active_class = ( $current_type === $type ) ? ' nav-tab-active' : '';
?>
<a class="nav-tab<?php echo esc_attr( $active_class ); ?>" href="<?php echo esc_url( $type_url ); ?>">
<?php
echo esc_attr( $title );
?>
</a>
<?php
}
?>
</div>
<?php
return $views;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function render_tabs()\n {\n // Get current page and current tab\n $current_page = $this->get_current_page_slug();\n $current_tab = $this->get_current_tab();\n\n // Output admin page tab navigation\n echo '<h2 class=\"woochimp-tabs-container nav-tab-wrapper\">';\n echo '<div id=\"icon-woochimp\" class=\"icon32 icon32-woochimp\"><br></div>';\n foreach ($this->settings as $page => $page_value) {\n if ($page != $current_page) {\n continue;\n }\n\n foreach ($page_value['children'] as $subpage => $subpage_value) {\n $class = ($subpage == $current_tab) ? ' nav-tab-active' : '';\n echo '<a class=\"nav-tab'.$class.'\" href=\"?page='.preg_replace('/_/', '-', $page).'&tab='.$subpage.'\">'.((isset($subpage_value['icon']) && !empty($subpage_value['icon'])) ? $subpage_value['icon'] . ' ' : '').$subpage_value['title'].'</a>';\n }\n }\n echo '</h2>';\n }",
"function printAdminPage() {\n\t\t\tglobal $wpdb;\n\n\t\t\t$email_st_options = $this->get_admin_options();\n\t\t\tif (function_exists('current_user_can') && !current_user_can('manage_emailst_support_tickets')) {\n\t\t\t\tdie(__('Unable to Authenticate', 'email-support-tickets' ));\n\t\t\t}\n\n\t\t\techo '\n <script type=\"text/javascript\">\n jQuery(function() {\n jQuery( \"#wst_tabs\" ).tabs();\n });\n </script> \n <div class=\"wrap\">';\n\n $this->adminHeader();\n\n echo '\n <div id=\"wst_tabs\" style=\"padding:5px 5px 0px 5px;font-size:1.1em;border-color:#DDD;border-radius:6px;\">\n <ul>\n <li><a href=\"#wst_tabs-1\">' . __('Open', 'email-support-tickets' ) . '</a></li>\n <li><a href=\"#wst_tabs-2\">' . __('Closed', 'email-support-tickets' ) . '</a></li>';\n\n emailst_extra_tabs_index();\n echo '\n </ul> \n\n ';\n\n $resolution = 'Open';\n\t\t$output = '';\n $output .= '<div id=\"wst_tabs-1\">';\n $table_name = $wpdb->prefix . \"emailst_tickets\";\n $sql = \"SELECT * FROM `{$table_name}` WHERE `resolution`='{$resolution}' ORDER BY `last_updated` DESC;\";\n $results = $wpdb->get_results($sql, ARRAY_A);\n if (isset($results) && isset($results[0]['primkey'])) {\n if ($resolution == 'Open') {\n $output .= '<h3>' . __('View Open Tickets:', 'email-support-tickets' ) . '</h3>';\n } elseif ($resolution == 'Closed') {\n $output .= '<h3>' . __('View Closed Tickets:', 'email-support-tickets' ) . '</h3>';\n }\n $output .= '<table class=\"widefat\" style=\"width:100%\"><thead><tr><th>' . __('Ticket', 'email-support-tickets' ) . '</th><th>' . __('Status', 'email-support-tickets' ) . '</th><th>' . __('User', 'email-support-tickets' ) . '</th><th>' . __('Last Reply', 'email-support-tickets' ) . '</th></tr></thead><tbody>';\n foreach ($results as $result) {\n if ($result['user_id'] != 0) {\n @$user = get_userdata($result['user_id']);\n $theusersname = $user->user_nicename;\n } else {\n $user = false; // Guest\n $theusersname = __('Guest', 'email-support-tickets' );\n }\n if (trim($result['last_staff_reply']) == '') {\n $last_staff_reply = __('ticket creator', 'email-support-tickets' );\n } else {\n if ($result['last_updated'] > $result['last_staff_reply']) {\n $last_staff_reply = __('ticket creator', 'email-support-tickets' );\n } else {\n $last_staff_reply = '<strong>' . __('Staff Member', 'email-support-tickets' ) . '</strong>';\n }\n }\n $output .= '<tr><td><a href=\"admin.php?page=email-support-tickets-edit&primkey=' . $result['primkey'] . '\" style=\"border:none;text-decoration:none;\"><img style=\"float:left;border:none;margin-right:5px;\" src=\"' . plugins_url('/images/page_edit.png', __FILE__) . '\" alt=\"' . __('View', 'email-support-tickets' ) . '\" /> ' . stripslashes( base64_decode($result['title']) ) . '</a></td><td>' . $result['resolution'] . '</td><td><a href=\"' . get_admin_url() . 'user-edit.php?user_id=' . $result['user_id'] . '&wp_http_referer=' . urlencode(get_admin_url() . 'admin.php?page=email-support-tickets-admin') . '\">' . $theusersname . '</a></td><td>' . date('Y-m-d g:i A', $result['last_updated']) . ' ' . __('by', 'email-support-tickets' ) . ' ' . $last_staff_reply . '</td></tr>';\n }\n $output .= '</tbody></table>';\n }\n $output .= '</div>';\n echo $output;\n\n $resolution = 'Closed';\n $output = '<div id=\"wst_tabs-2\">';\n $table_name = $wpdb->prefix . \"emailst_tickets\";\n $sql = \"SELECT * FROM `{$table_name}` WHERE `resolution`='{$resolution}' ORDER BY `last_updated` DESC;\";\n $results = $wpdb->get_results($sql, ARRAY_A);\n if (isset($results) && isset($results[0]['primkey'])) {\n if ($resolution == 'Open') {\n $output .= '<h3>' . __('View Open Tickets:', 'email-support-tickets' ) . '</h3>';\n } elseif ($resolution == 'Closed') {\n $output .= '<h3>' . __('View Closed Tickets:', 'email-support-tickets' ) . '</h3>';\n }\n $output .= '<table class=\"widefat\" style=\"width:100%\"><thead><tr><th>' . __('Ticket', 'email-support-tickets' ) . '</th><th>' . __('Status', 'email-support-tickets' ) . '</th><th>' . __('User', 'email-support-tickets' ) . '</th><th>' . __('Last Reply', 'email-support-tickets' ) . '</th></tr></thead><tbody>';\n foreach ($results as $result) {\n if ($result['user_id'] != 0) {\n @$user = get_userdata($result['user_id']);\n $theusersname = $user->user_nicename;\n } else {\n $user = false; // Guest\n $theusersname = __('Guest', 'email-support-tickets' );\n }\n if (trim($result['last_staff_reply']) == '') {\n $last_staff_reply = __('ticket creator', 'email-support-tickets' );\n } else {\n if ($result['last_updated'] > $result['last_staff_reply']) {\n $last_staff_reply = __('ticket creator', 'email-support-tickets' );\n } else {\n $last_staff_reply = '<strong>' . __('Staff Member', 'email-support-tickets' ) . '</strong>';\n }\n }\n $output .= '<tr><td><a href=\"admin.php?page=email-support-tickets-edit&primkey=' . $result['primkey'] . '\" style=\"border:none;text-decoration:none;\"><img style=\"float:left;border:none;margin-right:5px;\" src=\"' . plugins_url('/images/page_edit.png', __FILE__) . '\" alt=\"' . __('View', 'email-support-tickets' ) . '\" /> ' . stripslashes( base64_decode($result['title']) ) . '</a></td><td>' . $result['resolution'] . '</td><td><a href=\"' . get_admin_url() . 'user-edit.php?user_id=' . $result['user_id'] . '&wp_http_referer=' . urlencode(get_admin_url() . 'admin.php?page=email-support-tickets-admin') . '\">' . $theusersname . '</a></td><td>' . date('Y-m-d g:i A', $result['last_updated']) . ' ' . __('by', 'email-support-tickets' ) . ' ' . $last_staff_reply . '</td></tr>';\n }\n $output .= '</tbody></table>';\n }\n $output .= '</div>';\n echo $output;\n\n\n\n email_support_tickets_extra_tabs_content();\n\n echo '\n\t\t\t</div></div>';\n }",
"public function admin_page_display() {\n\n\t\t// get active tab\n\t\t$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : array_keys( $this->metabox_ids )[0];\n\n\t\techo '<div class=\"wrap cmb2-options-page ' . $this->key . '\">';\n\t\t\techo '<h2>' . esc_html( get_admin_page_title() ) . '</h2>';\n\n\t\t\t// navigation tabs\n\t\t\techo '<h2 class=\"nav-tab-wrapper\">';\n\t\t\t\tforeach( $this->metabox_ids as $key => $val) {\n\t\t\t\t\techo '<a href=\"?page=rb&tab=' . $key . '\" class=\"nav-tab' . ($key === $active_tab ? ' nav-tab-active' : '') . '\">' . __( $val[$key], 'restaurant-bookings') . '</a>';\n\t\t\t\t}\n\t\t\techo '</h2>';\n\n\t\t\t// form\n\t\t\tcmb2_metabox_form(\n\t\t\t\t$this->metabox_ids[$active_tab]['metabox_id'],\n\t\t\t\t$this->key,\n\t\t\t\tisset( $this->metabox_ids[$active_tab]['metabox_form_args'] ) ? $this->metabox_ids[$active_tab]['metabox_form_args'] : array()\n\t\t\t);\n\n\t\techo '</div>';\n\t}",
"public function putLayoutTypeTabs(){\r\n\t\t\r\n\t\t\r\n\t\tdmp(\"get all template types\");\r\n\t\texit();\r\n\t\t\r\n\t\t?>\r\n\t\t<div class=\"uc-layout-type-tabs-wrapper\">\r\n\t\t\t\r\n\t\t\t<?php foreach($arrLayoutTypes as $type => $arrType):\r\n\r\n\t\t\t\t$tabTitle = UniteFunctionsUC::getVal($arrType, \"plural\");\r\n\t\t\t\t\r\n\t\t\t\t$urlView = HelperUC::getViewUrl_TemplatesList(null, $type);\r\n\t\t\t\t\r\n\t\t\t\t$addClass = \"\";\r\n\t\t\t\tif($type == $this->layoutType){\r\n\t\t\t\t\t$addClass = \" uc-tab-selected\";\r\n\t\t\t\t\t$urlView = \"javascript:void(0)\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t?>\r\n\t\t\t<a href=\"<?php echo esc_attr($urlView)?>\" class=\"uc-tab-layouttype<?php echo esc_attr($addClass)?>\"><?php echo esc_html($tabTitle)?></a>\r\n\t\t\t\r\n\t\t\t<?php endforeach?>\r\n\t\t\t\t\t\t\r\n\t\t</div>\r\n\t\t<?php \r\n\t\t\r\n\t}",
"function affwp_tools_admin() {\n\n\t$active_tab = isset( $_GET[ 'tab' ] ) && array_key_exists( $_GET['tab'], affwp_get_tools_tabs() ) ? $_GET[ 'tab' ] : 'general';\n\n\tob_start();\n\t?>\n\t<div class=\"wrap\">\n\t\t<h2 class=\"nav-tab-wrapper\">\n\t\t\t<?php\n\t\t\tforeach( affwp_get_tools_tabs() as $tab_id => $tab_name ) {\n\n\t\t\t\t$tab_url = add_query_arg( array(\n\t\t\t\t\t'settings-updated' => false,\n\t\t\t\t\t'tab' => $tab_id,\n\t\t\t\t\t'affwp_notice' => false\n\t\t\t\t) );\n\n\t\t\t\t$active = $active_tab == $tab_id ? ' nav-tab-active' : '';\n\n\t\t\t\techo '<a href=\"' . esc_url( $tab_url ) . '\" title=\"' . esc_attr( $tab_name ) . '\" class=\"nav-tab' . $active . '\">';\n\t\t\t\t\techo esc_html( $tab_name );\n\t\t\t\techo '</a>';\n\t\t\t}\n\t\t\t?>\n\t\t</h2>\n\t\t<div id=\"tab_container\">\n\t\t\t<?php do_action( 'affwp_tools_tab_' . $active_tab ); ?>\n\t\t</div><!-- #tab_container-->\n\t</div><!-- .wrap -->\n\t<?php\n\techo ob_get_clean();\n}",
"public function admin_tabs_info( $tabs ) {\n\t\t\t$post_type = filter_input( INPUT_GET, 'post_type' );\n\t\t\t$action = filter_input( INPUT_GET, 'action' );\n\t\t\t$post = filter_input( INPUT_GET, 'post' );\n\t\t\tif ( LP_COURSE_CPT == $post_type || $action == 'edit' && LP_COURSE_CPT == get_post_type($post)) {\n\t\t\t\t$tabs[11] = array(\n\t\t\t\t\t\"link\" => \"edit.php?post_type=lp_collection\",\n\t\t\t\t\t\"name\" => __( \"Collections\", \"learnpress-collections\" ),\n\t\t\t\t\t\"id\" => \"edit-lp_collection\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $tabs;\n\t\t}",
"public function printAdminPage()\n {\n if (isset($_GET['page'])) {\n $curAdminPage = $_GET['page'];\n }\n \n if ($curAdminPage == 'uam_settings') {\n include UAM_REALPATH.\"tpl/adminSettings.php\";\n } elseif ($curAdminPage == 'uam_usergroup') {\n include UAM_REALPATH.\"tpl/adminGroup.php\";\n } elseif ($curAdminPage == 'uam_setup') {\n include UAM_REALPATH.\"tpl/adminSetup.php\";\n } elseif ($curAdminPage == 'uam_about') {\n include UAM_REALPATH.\"tpl/about.php\";\n }\n }",
"public function get_admin_slide_tabs_html() {\n\n return $this->get_admin_slide_tab_titles_html() . $this->get_admin_slide_tab_contents_html();\n\n }",
"function HtmlTabPlugin_admin_actions()\n{\t \n\tadd_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');//Add to Setting as sub item\n\t//add_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');\n\t//add_object_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show bottom comment as new Item\n\t//add_utility_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n\t//add_menu_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n}",
"function bb_child_custom_admin_styles() {\n\techo '<style type=\"text/css\">\n\t\t\t.ia-tabs.ia-tabs {padding-top: 0; }\n\t\t\t.ia-tabs.ia-tabs li {margin: 10px 7px; border-bottom: 1px solid #f9f9f9; border-radius: 5px;}\n\t\t\t.ia-tabs.ia-tabs li.current {border-color: #666;}\n\t\t\t.ia-tabs.ia-tabs li a {text-decoration: none;}\n\n\t\t\t@media screen and (max-width: 1024px) {\n\t\t\t div.cs.cs p { padding-right: 0; }\n\t\t\t}\n\n\t\t\t@media screen and (max-width: 640px) {\n\t\t\t div.cs-explain.cs-explain { clear:both; padding-left: 0; }\n\t\t\t}\n </style>';\n}",
"function houzez_listing_layout_metabox_tab( $metabox_tabs ) {\n\tif ( is_array( $metabox_tabs ) ) {\n\n\t\t$metabox_tabs['listing_layout'] = array(\n\t\t\t'label' => houzez_option('cls_layout', 'Layout'),\n 'icon' => 'dashicons-laptop',\n\t\t);\n\n\t}\n\treturn $metabox_tabs;\n}",
"public function adminTabs($tabs, $default, $page){\n \n if ( isset ( $_GET['tab'] ) ) $current = $_GET['tab']; else $current = $default;\n \n echo '<div id=\"icon-themes\" class=\"icon32\"><br></div>';\n echo '<h2 class=\"nav-tab-wrapper\">';\n \n foreach( $tabs as $tab => $name ){\n $class = ( $tab == $current ) ? ' nav-tab-active' : '';\n echo \"<a class='nav-tab$class' href='?page=$page&tab=$tab'>$name</a>\";\n \n }\n \n echo '</h2>';\n }",
"public function layouts() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layouts.php';\n\t}",
"private function pages_tab() {\n\t\t$this->pages_settings_appearance();\n\t}",
"public function print_plugin_options_page() {\n\t\tglobal $cpt_onomies_manager;\n\n\t\tif ( current_user_can( $this->manage_options_capability ) ) {\n\n\t\t\t/*\n\t\t\t * Detects page variables, i.e. if we're creating a new CPT,\n\t\t\t * or editing a CPT, and whether or not it's an 'other' CPT.\n\t\t\t *\n\t\t\t * Will create $new, $edit, and $other.\n\t\t\t */\n\t\t\textract( $this->detect_settings_page_variables() );\n\n\t\t\t// Create the tabs.\n\t\t\t$tabs = array();\n\n\t\t\tif ( $new || $edit ) {\n\n\t\t\t\t// Create the properties tab.\n\t\t\t\t$tabs['properties'] = (object) array(\n\t\t\t\t\t'title'\t\t=> __( 'Custom Post Type Properties', 'cpt-onomies' ),\n\t\t\t\t\t'link'\t\t=> esc_url( add_query_arg( array( 'page' => CPT_ONOMIES_OPTIONS_PAGE, 'edit' => ( $new ? 'new' : $edit ), 'other' => ( $other ? '1' : null ) ), $this->admin_url ) ),\n\t\t\t\t\t'active'\t=> true,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t?>\n\t\t\t<div id=\"custom-post-type-onomies\" class=\"wrap\">\n\t\t\t\t<h2>\n\t\t\t\t\t<?php\n\n\t\t\t\t\tprintf( __( '%s: Using Custom Post Types as Taxonomies', 'cpt-onomies' ), 'CPT-onomies' );\n\n\t\t\t\t\tif ( ! $new ) :\n\t\t\t\t\t\t?> <a href=\"<?php echo esc_url( add_query_arg( array( 'page' => CPT_ONOMIES_OPTIONS_PAGE, 'edit' => 'new' ), $this->admin_url ) ); ?>\" class=\"add-new-h2\">Add New CPT</a><?php\n\t\t\t\t\tendif;\n\n\t\t\t\t\t?>\n\t\t\t\t</h2>\n\t\t\t\t<?php\n\n\t\t\t\t/*\n * Print settings errors.\n *\n * Regular site settings pages take care of this for us,\n * so only needed on network admin\n */\n\t\t\t\tif ( $this->is_network_admin ) {\n\t settings_errors();\n\t\t\t\t}\n\n\t\t\t\tif ( $new || $edit ) :\n\n\t\t\t\t\t// Define the label\n\t\t\t\t\t$label = null;\n\n\t\t\t\t\tif ( $new ) {\n\t\t\t\t\t\t$label = __( 'Creating a New Custom Post Type', 'cpt-onomies' );\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$cpt_key_to_check = $edit;\n\n\t\t\t\t\t\tif ( $this->is_network_admin ) {\n\n\t\t\t\t\t\t\tif ( isset( $cpt_onomies_manager->user_settings['network_custom_post_types'] ) && isset( $cpt_onomies_manager->user_settings['network_custom_post_types'][ $cpt_key_to_check ] ) && isset( $cpt_onomies_manager->user_settings['network_custom_post_types'][ $cpt_key_to_check ]['label'] ) ) {\n\t\t\t\t\t\t\t\t$label = $cpt_onomies_manager->user_settings['network_custom_post_types'][ $cpt_key_to_check ]['label'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( $other && ( $post_type_object_label = get_post_type_object( $cpt_key_to_check )->label ) ) {\n\t\t\t\t\t\t\t\t$label = $post_type_object_label;\n\t\t\t\t\t\t\t} elseif ( isset( $cpt_onomies_manager->user_settings['custom_post_types'] ) && isset( $cpt_onomies_manager->user_settings['custom_post_types'][ $cpt_key_to_check ] ) && isset( $cpt_onomies_manager->user_settings['custom_post_types'][ $cpt_key_to_check ]['label'] ) ) {\n\t\t\t\t\t\t\t\t$label = $cpt_onomies_manager->user_settings['custom_post_types'][ $cpt_key_to_check ]['label'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $label ) {\n\t\t\t\t\t\t\t$label = sprintf( __( 'Editing \"%s\"', 'cpt-onomies' ), $label );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t\t<h3 class=\"nav-tab-wrapper\">\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\tif ( $label ) :\n\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<span class=\"label\"><?php echo $label . ' '; ?></span>\n\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t// Don't include tab name in URL, for now, considering there's only one tab.\n\t\t\t\t\t\tforeach ( $tabs as $tab_key => $this_tab ) :\n\t\t\t\t\t\t\t?><a href=\"<?php echo $this_tab->link; ?>\" class=\"nav-tab<?php echo ( $this_tab->active ) ? ' nav-tab-active' : ''; ?>\"><?php echo $this_tab->title; ?></a><?php\n\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"etc\">\n\t\t\t\t\t\t\t<a class=\"return\" href=\"<?php echo esc_url( add_query_arg( array( 'page' => CPT_ONOMIES_OPTIONS_PAGE ), $this->admin_url ) ); ?>\">« <?php printf( __( 'Back to %s', 'cpt-onomies' ), 'CPT-onomies' ); ?></a>\n\t\t\t\t\t\t\t<a class=\"new\" href=\"<?php echo esc_url( add_query_arg( array( 'page' => CPT_ONOMIES_OPTIONS_PAGE, 'edit' => 'new' ), $this->admin_url ) ); ?>\" title=\"<?php _e( 'Add a new custom post type', 'cpt-onomies' ); ?>\"><?php _e( 'Add a new custom post type', 'cpt-onomies' ); ?></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h3>\n\t\t\t\t\t<?php\n\n\t\t\t\tendif;\n\n\t\t\t\t// Setup message to display.\n\t\t\t\t$message = null;\n\n\t\t\t\t// What's the message class? - updated by default\n\t\t\t\t$message_class = 'updated';\n\n\t\t\t\t// Add deleted message.\n\t\t\t\tif ( isset( $_REQUEST['cptdeleted'] ) ) {\n\n\t\t\t\t\t$message = __( 'The custom post type was deleted.', 'cpt-onomies' );\n\n\t\t\t\t} elseif ( isset( $_REQUEST['cptactivated'] ) ) {\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Add activated message.\n\t\t\t\t\t */\n\n\t\t\t\t\t$activated_cpt = strtolower( $_REQUEST['cptactivated'] );\n\t\t\t\t\t$label = null;\n\t\t\t\t\tif ( $this->is_network_admin ) {\n\n\t\t\t\t\t\tif ( isset( $cpt_onomies_manager->user_settings['network_custom_post_types'] ) && array_key_exists( $activated_cpt, $cpt_onomies_manager->user_settings['network_custom_post_types'] ) && isset( $cpt_onomies_manager->user_settings['network_custom_post_types'][ $activated_cpt ]['label'] ) ) {\n\t\t\t\t\t\t\t$label = $cpt_onomies_manager->user_settings['network_custom_post_types'][ $activated_cpt ]['label'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $cpt_onomies_manager->user_settings['custom_post_types'] ) && array_key_exists( $activated_cpt, $cpt_onomies_manager->user_settings['custom_post_types'] ) && isset( $cpt_onomies_manager->user_settings['custom_post_types'][ $activated_cpt ]['label'] ) ) {\n\t\t\t\t\t\t\t$label = $cpt_onomies_manager->user_settings['custom_post_types'][ $activated_cpt ]['label'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $label ) {\n\t\t\t\t\t\t$message = sprintf( __( 'The custom post type \\'%s\\' is now active.', 'cpt-onomies' ), $label );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$message = __( 'The custom post type is now active.', 'cpt-onomies' );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( isset( $_REQUEST['delete_conflicting_terms_error'] ) ) {\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Add \"delete conflicting terms\" error message.\n\t\t\t\t\t */\n\n\t\t\t\t\t// Build the refresh URL\n\t\t\t\t\t$refresh_url = add_query_arg( array( 'page' => CPT_ONOMIES_OPTIONS_PAGE, 'edit' => $edit, 'other' => ( $other ? '1' : null ) ), $this->admin_url );\n\n\t\t\t\t\t// Build the message\n\t\t\t\t\t$message = sprintf( __( 'There seems to have been an error deleting the conflicting taxonomy terms. Please %1$srefresh the page%2$s and try again. If the problem persists, %3$sthe %4$s documentation%5$s might help.', 'cpt-onomies' ), '<a href=\"' . $refresh_url . '\">', '</a>', '<a href=\"http://wpdreamer.com/plugins/cpt-onomies/documentation/incorrect-query-results/#remove-conflicting-taxonomy-terms\" target=\"_blank\">', 'CPT-onomies', '</a>' );\n\n\t\t\t\t\t// This is an error message\n\t\t\t\t\t$message_class = 'error';\n\n\t\t\t\t} elseif ( isset( $_REQUEST['deleted_conflicting_terms'] ) ) {\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Add \"deleted conflicting terms\" message.\n\t\t\t\t\t */\n\t\t\t\t\t$message = __( 'The conflicting taxonomy terms have been deleted!', 'cpt-onomies' );\n\n\t\t\t\t}\n\n\t\t\t\t// Display message.\n\t\t\t\tif ( $message ) :\n\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"message\" class=\"<?php echo $message_class; ?>\">\n\t\t\t\t\t\t<p><?php echo $message; ?></p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\n\t\t\t\tendif;\n\n\t\t\t\t// Output form, nonce, action, and option_page fields.\n\t\t\t\t$print_form = ( $new || $edit ) ? true : false;\n\n\t\t\t\t// Are we printing a form?\n\t\t\t\tif ( $print_form ) :\n\n\t\t\t\t\t// Create the form ID.\n\t\t\t\t\t$form_id = 'custom-post-type-onomies';\n\n\t\t\t\t\t// If we're creating a new CPT or editing a CPT, then add on to the ID.\n\t\t\t\t\tif ( $new || $edit ) {\n\t\t\t\t\t\t$form_id .= '-edit-cpt';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Print the form.\n\t\t\t\t\t?>\n\t\t\t\t\t<form id=\"<?php echo $form_id; ?>\" method=\"post\" action=\"<?php echo ( $this->is_network_admin ) ? 'settings.php' : 'options.php'; ?>\">\n\t\t\t\t\t<?php\n\n\t\t\t\t\t/*\n * Handle network settings.\n *\n * Otherwise, handle regular settings.\n */\n\t\t\t\t\tif ( $this->is_network_admin ) {\n\t\t\t wp_nonce_field( 'siteoptions' );\n\t\t } else {\n\n\t\t\t\t\t\tif ( $other ) {\n\t\t\t\t settings_fields( CPT_ONOMIES_OPTIONS_PAGE . '-other-custom-post-types' );\n\t\t\t } else {\n\t\t\t\t settings_fields( CPT_ONOMIES_OPTIONS_PAGE . '-custom-post-types' );\n\t\t\t }\n\t\t\t\t\t}\n\n\t\t\t\t\t// Need those for both.\n\t\t\t\t\twp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );\n\t\t\t\t\twp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );\n\n\t\t\t\tendif;\n\n\t\t\t\t?>\n\t\t\t\t<div id=\"poststuff\">\n\t\t\t\t\t<div id=\"post-body\" class=\"metabox-holder columns-2\">\n\n\t\t\t\t\t\t<div id=\"postbox-container-1\" class=\"postbox-container\">\n\t\t\t\t\t\t\t<div id=\"side-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t\t\t\t\t<?php do_meta_boxes( $this->options_page, 'side', array() ); ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div id=\"postbox-container-2\" class=\"postbox-container\">\n\t\t <div id=\"normal-sortables\" class=\"meta-box-sortables\">\n\t\t\t <?php do_meta_boxes( $this->options_page, 'normal', array() ); ?>\n\t\t </div>\n\t\t <div id=\"advanced-sortables\" class=\"meta-box-sortables\">\n\t\t\t <?php do_meta_boxes( $this->options_page, 'advanced', array() ); ?>\n\t\t </div>\n\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\tif ( $print_form ) {\n\t\t\t submit_button( __( 'Save Your Changes', 'cpt-onomies' ), 'primary', 'save_cpt_onomies_changes', false, array( 'id' => 'custom-post-type-onomies-save-changes-bottom' ) );\n\t\t }\n\n\t\t ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t <br class=\"clear\" />\n\t\t\t\t</div>\n\t\t\t\t<?php\n\n\t\t\t\tif ( $print_form ) :\n\t\t\t\t\t?></form><?php\n\t\t\t\tendif;\n\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\n\t }\n\t}",
"public function plugin_options_tabs() {\n\t\t$current_tab = isset ( $_GET ['tab'] ) ? $_GET ['tab'] : $this->general_settings_key;\n\t\tif ( version_compare( $GLOBALS['wp_version'], '3.8.0', '<' ) ) {\n\t\t\tscreen_icon();\n\t\t}\t\n\t\techo '<h2 class=\"nav-tab-wrapper\">';\n\t\tforeach ( $this->plugin_settings_tabs as $tab_key => $tab_caption ) {\n\t\t\t$active = $current_tab == $tab_key ? 'nav-tab-active' : '';\n\t\t\techo '<a class=\"nav-tab ' . $active . '\" href=\"?page=' . $this->plugin_options_key . '&tab=' . $tab_key . '\">' . $tab_caption . '</a>';\n\t\t}\n\t\techo '</h2>';\n\t}",
"function onView () {\r\n\r\n switch (parent::getAction()) {\r\n case \"newForm\":\r\n $this->printNewFormTabs();\r\n break;\r\n case \"editForm\":\r\n $this->printEditTableView(parent::get(\"table\"));\r\n break;\r\n default:\r\n $this->printListTablesTabs();\r\n break;\r\n }\r\n }",
"function sfa_adminadminspage()\r\n{\r\n sfa_render_admins_index();\r\n\r\n return;\r\n}",
"public function showTabs() {\n $html = '<h1>' . $this->settingsMenu['title'] . '</h1>' . PHP_EOL;\n\n if (count($this->settingsSections) < 2) {\n return;\n }\n\n $html .= '<h2 class=\"nav-tab-wrapper wp-clearfix\">';\n\n foreach ($this->settingsSections as $section) {\n $class = $section['id'] == $this->currentTab ? 'nav-tab-active' : $this->defaultTab;\n $html .= sprintf(\n '<a href=\"?page=%4$s¤t-tab=%1$s\" class=\"nav-tab %3$s\" id=\"%1$s-tab\">%2$s</a>',\n esc_attr($section['id']),\n $section['title'],\n esc_attr($class),\n $this->settingsMenu['menu_slug']\n );\n }\n\n $html .= '</h2>' . PHP_EOL;\n\n echo $html;\n }",
"public function get_admin_slide_tab_contents_html() {\n\n $tabs = $this->get_admin_tabs();\n\n $return = \"<div class='tabs-content'>\";\n\n foreach ( $tabs as $id => $tab ) {\n\n $pos = array_search( $id, array_keys( $tabs ) );\n\n $hidden = $pos != 0 ? \"style='display: none;'\" : \"\";\n\n $return .= \"<div class='tab tab-{$pos}' {$hidden}>{$tab['content']}</div>\";\n\n }\n\n $return .= \"</div>\";\n\n return $return;\n }",
"function add_admin_user_types() {\n $this->data['mainTab'] = 'users';\n $this->data['activeTab'] = 'user_types';\n $this->data['dynamicView'] = 'pages/admin/user_type/entry';\n $this->_commonPageLayout('frontend_viewer');\n }",
"function print_admin_page() {\n\t\t\tglobal $wpdb;\n\t\t\t$wpjf3_mr_options = $this->get_admin_options();\n\t\t\t\n\t\t\t// process update\n\t\t\tif ( trim($_POST['update_wp_maintenance_redirect_settings']) != '' ) {\n\t\t\t\t// prepare options\n\t\t\t\t$wpjf3_mr_options['enable_redirect'] = trim( $_POST['wpjf3_mr_enable_redirect'] );\n\t\t\t\t$wpjf3_mr_options['method'] = trim( $_POST['wpjf3_mr_method'] );\n\t\t\t\t$wpjf3_mr_options['static_page'] = trim( $_POST['wpjf3_mr_static_page'] );\n\t\t\t\t$wpjf3_mr_options['maintenance_html'] = trim( $_POST['wpjf3_mr_maintenance_html'] );\n\t\t\t\t\n\t\t\t\t// update options\n\t\t\t\tupdate_option($this->admin_options_name, $wpjf3_mr_options);\n\t\t\t\t?>\n\t\t\t\t<div class=\"updated\"><p><strong><?php _e(\"Settings Updated.\", \"wpjf3_maintenance_redirect\");?></strong></p></div>\n\t\t\t\t<?php\n\t\t\t} ?>\n\t\t\t\n\t\t\t<script type=\"text/javascript\" charset=\"utf-8\">\n\t\t\t\t// bind actions\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t// enable disable toggle\n\t\t\t\t\tjQuery( '#wpjf3_mr_enable_redirect' ).change( function(){ wpjf3_mr_toggle_main_options(); });\n\t\t\t\t\t// method mode toggle\n\t\t\t\t\tjQuery( '#wpjf3_mr_method' ).change( function(){ wpjf3_mr_toggle_method_options(); });\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// (js) update form layout based on main option\n\t\t\t\tfunction wpjf3_mr_toggle_main_options () {\n\t\t\t\t\tif( jQuery('#wpjf3_mr_enable_redirect').val() == 'YES' ){\n\t\t\t\t\t\tjQuery('#wpjf3_main_options').slideDown('fast');\n\t\t\t\t\t}else{\n\t\t\t\t\t\tjQuery('#wpjf3_main_options').slideUp('fast');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// (js) update form layout based on method option\n\t\t\t\tfunction wpjf3_mr_toggle_method_options () {\n\t\t\t\t\tif( jQuery('#wpjf3_mr_method').val() == 'redirect' ){\n\t\t\t\t\t\tjQuery('#wpjf3_method_message' ).hide();\n\t\t\t\t\t\tjQuery('#wpjf3_method_redirect').show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tjQuery('#wpjf3_method_redirect').hide();\n\t\t\t\t\t\tjQuery('#wpjf3_method_message' ).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// (js) undim field\n\t\t\t\tfunction wpjf3_mr_undim_field( field_id, default_text ) {\n\t\t\t\t\tif( jQuery('#'+field_id).val() == default_text ) jQuery('#'+field_id).val('');\n\t\t\t\t\tjQuery('#'+field_id).css('color','#000');\n\t\t\t\t}\n\t\t\t\t// (js) dim field\n\t\t\t\tfunction wpjf3_mr_dim_field( field_id, default_text ) {\n\t\t\t\t\tif( jQuery('#'+field_id).val() == '' ) {\n\t\t\t\t\t\tjQuery('#'+field_id).val(default_text);\n\t\t\t\t\t\tjQuery('#'+field_id).css('color','#888');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// (js) add new IP\n\t\t\t\tfunction wpjf3_mr_add_new_ip () {\n\t\t\t\t\t// validate entries before posting ajax call\n\t\t\t\t\tvar error_msg = '';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ip_name').val() == '' ) error_msg += 'You must enter a Name.\\n';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ip_name').val() == 'Enter Name:' ) error_msg += 'You must enter an Name.\\n';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ip_ip' ).val() == '' ) error_msg += 'You must enter an IP.\\n';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ip_ip' ).val() == 'Enter IP:' ) error_msg += 'You must enter an IP.\\n';\n\t\t\t\t\tif( error_msg != '' ){\n\t\t\t\t\t\talert( 'There are problems with the information you have entered.\\n\\n' + error_msg );\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// prepare ajax data\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\taction: 'wpjf3_mr_add_ip',\n\t\t\t\t\t\t\twpjf3_mr_ip_name: jQuery('#wpjf3_mr_new_ip_name').val(),\n\t\t\t\t\t\t\twpjf3_mr_ip_ip: jQuery('#wpjf3_mr_new_ip_ip').val() \n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set section to loading img\n\t\t\t\t\t\tvar img_url = '<?php echo plugins_url( 'images/ajax_loader_16x16.gif', __FILE__ ); ?>';\n\t\t\t\t\t\tjQuery( '#wpjf3_mr_ip_tbl_container' ).html('<img src=\"' + img_url + '\">');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// send ajax request\n\t\t\t\t\t\tjQuery.post( ajaxurl, data, function(response) {\n\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ip_tbl_container').html( response );\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// (js) toggle IP status\n\t\t\t\tfunction wpjf3_mr_toggle_ip ( status, ip_id ) {\n\t\t\t\t\t// prepare ajax data\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\taction: 'wpjf3_mr_toggle_ip',\n\t\t\t\t\t\twpjf3_mr_ip_active: status,\n\t\t\t\t\t\twpjf3_mr_ip_id: ip_id \n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t// (js) set status to loading img\n\t\t\t\t\tvar img_url = '<?php echo plugins_url( 'images/ajax_loader_16x16.gif', __FILE__ ); ?>';\n\t\t\t\t\tjQuery( '#wpjf3_mr_ip_status_' + ip_id ).html('<img src=\"' + img_url + '\">');\n\t\t\t\t\t\n\t\t\t\t\t// send ajax request\n\t\t\t\t\tjQuery.post( ajaxurl, data, function(response) {\n\t\t\t\t\t\tvar split_response = response.split('|');\n\t\t\t\t\t\tif( split_response[0] == 'SUCCESS' ){\n\t\t\t\t\t\t\tvar ip_id = split_response[1];\n\t\t\t\t\t\t\tvar ip_active = split_response[1];\n\t\t\t\t\t\t\t// update divs / 1 = id / 2 = status\n\t\t\t\t\t\t\tif( split_response[2] == '1' ){\n\t\t\t\t\t\t\t\t// active\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ip_status_' + split_response[1] ).html( 'Yes' );\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ip_status_' + split_response[1] + '_action' ).html( '<a href=\"javascript:wpjf3_mr_toggle_ip( 0, ' + split_response[1] + ' );\">Disable</a> | ' );\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t// disabled\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ip_status_' + split_response[1] ).html( 'No' );\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ip_status_' + split_response[1] + '_action' ).html( '<a href=\"javascript:wpjf3_mr_toggle_ip( 1, ' + split_response[1] + ' );\">Enable</a> | ' );\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert( 'There was a database error. Please reload this page' );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// (js) delete IP\n\t\t\t\tfunction wpjf3_mr_delete_ip ( ip_id, ip_addr ) {\n\t\t\t\t\tif ( confirm('You are about to delete the IP \\n\\n\\'' + ip_addr + '\\'\\n\\n') ) {\n\t\t\t\t\t\t// prepare ajax data\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\taction: 'wpjf3_mr_delete_ip',\n\t\t\t\t\t\t\twpjf3_mr_ip_id: ip_id\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set section to loading img\n\t\t\t\t\t\tvar img_url = '<?php echo plugins_url( 'images/ajax_loader_16x16.gif', __FILE__ ); ?>';\n\t\t\t\t\t\tjQuery( '#wpjf3_mr_ip_tbl_container' ).html('<img src=\"' + img_url + '\">');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// send ajax request\n\t\t\t\t\t\tjQuery.post( ajaxurl, data, function(response) {\n\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ip_tbl_container').html( response );\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// (js) add new Access Key\n\t\t\t\tfunction wpjf3_mr_add_new_ak () {\n\t\t\t\t\t// validate entries before posting ajax call\n\t\t\t\t\tvar error_msg = '';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ak_name' ).val() == '' ) error_msg += 'You must enter a Name.\\n';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ak_name' ).val() == 'Enter Name:' ) error_msg += 'You must enter an Name.\\n';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ak_email').val() == '' ) error_msg += 'You must enter an Email.\\n';\n\t\t\t\t\tif( jQuery('#wpjf3_mr_new_ak_email').val() == 'Enter Email:') error_msg += 'You must enter an Email.\\n';\n\t\t\t\t\tif( error_msg != '' ){\n\t\t\t\t\t\talert( 'There are problems with the information you have entered.\\n\\n' + error_msg );\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// prepare ajax data\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\taction: 'wpjf3_mr_add_ak',\n\t\t\t\t\t\t\twpjf3_mr_ak_name: jQuery('#wpjf3_mr_new_ak_name').val(),\n\t\t\t\t\t\t\twpjf3_mr_ak_email: jQuery('#wpjf3_mr_new_ak_email').val() \n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// set section to loading img\n\t\t\t\t\t\tvar img_url = '<?php echo plugins_url( 'images/ajax_loader_16x16.gif', __FILE__ ); ?>';\n\t\t\t\t\t\tjQuery( '#wpjf3_mr_ak_tbl_container' ).html('<img src=\"' + img_url + '\">');\n\n\t\t\t\t\t\t// send ajax request\n\t\t\t\t\t\tjQuery.post( ajaxurl, data, function(response) {\n\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ak_tbl_container').html( response );\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// (js) toggle Access Key status\n\t\t\t\tfunction wpjf3_mr_toggle_ak ( status, ak_id ) {\n\t\t\t\t\t// prepare ajax data\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\taction: 'wpjf3_mr_toggle_ak',\n\t\t\t\t\t\twpjf3_mr_ak_active: status,\n\t\t\t\t\t\twpjf3_mr_ak_id: ak_id \n\t\t\t\t\t};\n\n\t\t\t\t\t// set status to loading img\n\t\t\t\t\tvar img_url = '<?php echo plugins_url( 'images/ajax_loader_16x16.gif', __FILE__ ); ?>';\n\t\t\t\t\tjQuery( '#wpjf3_mr_ak_status_' + ak_id ).html('<img src=\"' + img_url + '\">');\n\n\t\t\t\t\t// send ajax request\n\t\t\t\t\tjQuery.post( ajaxurl, data, function(response) {\n\t\t\t\t\t\tvar split_response = response.split('|');\n\t\t\t\t\t\tif( split_response[0] == 'SUCCESS' ){\n\t\t\t\t\t\t\tvar ak_id = split_response[1];\n\t\t\t\t\t\t\tvar ak_active = split_response[1];\n\t\t\t\t\t\t\t// update divs / 1 = id / 2 = status\n\t\t\t\t\t\t\tif( split_response[2] == '1' ){\n\t\t\t\t\t\t\t\t// active\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ak_status_' + split_response[1] ).html( 'Yes' );\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ak_status_' + split_response[1] + '_action' ).html( '<a href=\"javascript:wpjf3_mr_toggle_ak( 0, ' + split_response[1] + ' );\">Disable</a> | ' );\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t// disabled\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ak_status_' + split_response[1] ).html( 'No' );\n\t\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ak_status_' + split_response[1] + '_action' ).html( '<a href=\"javascript:wpjf3_mr_toggle_ak( 1, ' + split_response[1] + ' );\">Enable</a> | ' );\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert( 'There was a database error. Please reload this page' );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// (js) delete Access Key\n\t\t\t\tfunction wpjf3_mr_delete_ak ( ak_id, ak_name ) {\n\t\t\t\t\tif ( confirm('You are about to delete the Access Key \\n\\n\\'' + ak_name + '\\'\\n\\n') ) {\n\t\t\t\t\t\t// prepare ajax data\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\taction: 'wpjf3_mr_delete_ak',\n\t\t\t\t\t\t\twpjf3_mr_ak_id: ak_id\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// set section to loading img\n\t\t\t\t\t\tvar img_url = '<?php echo plugins_url( 'images/ajax_loader_16x16.gif', __FILE__ ); ?>';\n\t\t\t\t\t\tjQuery( '#wpjf3_mr_ak_tbl_container' ).html('<img src=\"' + img_url + '\">');\n\n\t\t\t\t\t\t// send ajax request\n\t\t\t\t\t\tjQuery.post( ajaxurl, data, function(response) {\n\t\t\t\t\t\t\tjQuery('#wpjf3_mr_ak_tbl_container').html( response );\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// (js) re-send Access Key\n\t\t\t\tfunction wpjf3_mr_resend_ak ( ak_id, ak_name, ak_email ) {\n\t\t\t\t\tif ( confirm('You are about to email an Access Key link for \\n\\n\\'' + ak_name + '\\'\\n\\nto \\n\\n\\'' + ak_email + '\\'\\n\\n') ) {\n\t\t\t\t\t\t// prepare ajax data\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\taction: 'wpjf3_mr_resend_ak',\n\t\t\t\t\t\t\twpjf3_mr_ak_id: ak_id\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\t// send ajax request\n\t\t\t\t\t\tjQuery.post( ajaxurl, data, function(response) {\n\t\t\t\t\t\t\tif( response == 'SEND_SUCCESS' ){\n\t\t\t\t\t\t\t\talert( 'Notification Sent' );\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\talert( 'Notification Failure. Please check your server settings.' );\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\t</script>\n\t\t\t\n\t\t\t<style type=\"text/css\" media=\"screen\">\n\t\t\t\t.wpjf3_mr_admin_section { border: 1px solid #ddd; padding: 10px; padding-top: 0px; }\n\t\t\t\t.wpjf3_mr_disabled_field { color: #888;\t}\n\t\t\t\t.wpjf3_mr_small_dim { font-size: 11px; font-weight: normal; color: #444; }\n\t\t\t</style>\n\t\t\t\n\t\t\t<div class=wrap>\n\t\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER[\"REQUEST_URI\"]; ?>\" onsubmit=\"return wpjf3_mr_validate_form();\">\n\t\t\t\t\t<h2>JF3 Maintenance Redirect</h2>\n\t\t\t\t\t\n\t\t\t\t\t<p>This plugin is intended primarily for designers / developers that need to allow clients to preview sites before being available to the general public. \n\t\t\t\t\t\t\n\t\t\t\t\t\tAny logged in user with WordPress administrator privileges will be allowed to view the site regardless of the settings below.</p>\n\t\t\t\t\t\n\t\t\t\t\t<h3>Enable Maintenance Mode:</h3>\n\t\t\t\t\t<select name=\"wpjf3_mr_enable_redirect\" id=\"wpjf3_mr_enable_redirect\" style=\"width:30%\" >\n\t\t\t\t\t\t<option value=\"NO\" >No - Do not use maintenance mode </option>\n\t\t\t\t\t\t<option value=\"YES\" <?php if( $wpjf3_mr_options['enable_redirect'] == \"YES\" ) echo \"selected\"; ?>>Yes - Use maintenance mode </option>\n\t\t\t\t\t</select>\n\t\t\t\t\t\n\t\t\t\t\t<div id=\"wpjf3_main_options\" <?php if( $wpjf3_mr_options['enable_redirect'] == \"NO\" ) echo 'style=\"display:none;\"'; ?> >\n\t\t\t\t\t\t\n\t\t\t\t\t\t<p><div class=\"wpjf3_mr_admin_section\" >\n\t\t\t\t\t\t\t<h3>Unrestricted IPs: <span class=\"wpjf3_mr_small_dim\">( Your IP address is: <?php echo $this->get_user_ip(); ?> - Your Class C is: <?php echo $this->get_user_class_c(); ?> )</span></h3>\n\t\t\t\t\t\t\t<p>Users with unrestricted IP addresses will bypass maintenance mode entirely. Using this option is useful to an entire office of clients to view the site without needing to jump through any extra hoops.</p> \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div id=\"wpjf3_mr_ip_tbl_container\">\n\t\t\t\t\t\t\t\t<?php $this->print_unrestricted_ips(); ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div></p>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<p><div class=\"wpjf3_mr_admin_section\">\n\t\t\t\t\t\t\t<h3>Access Keys:</h3>\n\t\t\t\t\t\t\t<p>You can allow users temporary access by sending them the access key. When a new key is created, a link to create the access key cookie will be emailed to the email address provided. Access can then be revoked either by disabling or deleting the key.</p>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div id=\"wpjf3_mr_ak_tbl_container\">\n\t\t\t\t\t\t\t\t<?php $this->print_access_keys(); ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div></p>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<p><div class=\"wpjf3_mr_admin_section\">\t\n\t\t\t\t\t\t\t<h3>Maintenance Message:</h3>\n\t\t\t\t\t\t\t<p>You have two options for how to specify what you want to show users when your site is in maintenance mode. You can display a message or redirect to a static page.</p>\n\t\t\t\t\t\t\t<p><select name=\"wpjf3_mr_method\" id=\"wpjf3_mr_method\" style=\"width:30%\" >\n\t\t\t\t\t\t\t\t<option value=\"message\" >Message Only - The easy way </option>\n\t\t\t\t\t\t\t\t<option value=\"html\" <?php if( $wpjf3_mr_options['method'] == \"html\" ) echo \"selected\"; ?> >HTML Entered Here - A little harder </option>\n\t\t\t\t\t\t\t\t<option value=\"redirect\" <?php if( $wpjf3_mr_options['method'] == \"redirect\" ) echo \"selected\"; ?> >Redirect - A little harder </option>\n\t\t\t\t\t\t\t</select></p>\n\n\t\t\t\t\t\t\t<div id=\"wpjf3_method_message\" style=\"<?php if( $wpjf3_mr_options['method'] == \"redirect\" ) echo \"display:none;\"; ?>\" >\n\t\t\t\t\t\t\t\t<strong>Maintenance Mode Message:</strong>\n\t\t\t\t\t\t\t\t<p>This is the message that will be displayed while your site is in maintenance mode.</p>\n\t\t\t\t\t\t\t\t<p style=\"margin-bottom: 0;\"><textarea name=\"wpjf3_mr_maintenance_html\" rows=\"3\" style=\"width:60%\"><?php echo stripslashes( $wpjf3_mr_options['maintenance_html'] ); ?></textarea></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div id=\"wpjf3_method_redirect\" style=\"<?php if( $wpjf3_mr_options['method'] == \"message\" || $wpjf3_mr_options['method'] == \"html\" ) echo \"display:none;\"; ?>\" >\n\t\t\t\t\t\t\t\t<strong>Static Maintenance Page:</strong>\n\t\t\t\t\t\t\t\t<p>To use this method you need to upload a static HTML page to your site and enter it's URL below.</p>\n\t\t\t\t\t\t\t\t<p><input type=\"text\" name=\"wpjf3_mr_static_page\" value=\"<?php echo $wpjf3_mr_options['static_page']; ?>\" id=\"wpjf3_mr_static_page\" style=\"width:60%\"></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div></p>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div class=\"submit\">\n\t\t\t\t\t\t<input type=\"submit\" name=\"update_wp_maintenance_redirect_settings\" value=\"<?php _e('Update Settings', 'wp_maintenance_redirect') ?>\" />\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t\t\n\t\t\t<?php\n\t\t}",
"public function admin_page() {\n \n echo $this->_view('admin', array('options' => get_option('WPInsertCode_options')));\n }",
"private function createTabs()\n {\n $this->getTabs()->extend(new OutputFormat())->extend(new DashboardAction());\n }",
"public function tabexpert()\n {\n $this->beforeAction();\n $view = Piwik_View::factory('tabexpert');\n $plugins = $this->manager->setRelease($this->release)\n ->getCurrentPlugins();\n $view->pluginsName = $plugins;\n $view->debug = print_r($plugins, true);\n $this->render($view);\n }",
"public function adminHelpTab() {\n $screen = get_current_screen();\n\n if (!method_exists($screen, 'add_help_tab') || $screen->id != $this->optionsPage) {\n return;\n }\n\n $helpTab = getHelpTab();\n\n if (empty($helpTab)) {\n return;\n }\n\n foreach ($helpTab as $help) {\n $screen->add_help_tab(\n [\n 'id' => $help['id'],\n 'title' => $help['title'],\n 'content' => implode(PHP_EOL, $help['content'])\n ]\n );\n $screen->set_help_sidebar($help['sidebar']);\n }\n }",
"public function admin_menus() {\n\t\t// About\n\t\tadd_dashboard_page(\n\t\t\t__( 'Theme Details', 'wpex' ),\n\t\t\t__( 'Theme Details', 'wpex' ),\n\t\t\t$this->minimum_capability,\n\t\t\t'wpex-about',\n\t\t\tarray( $this, 'about_screen' )\n\t\t);\n\n\t\t// Recommended\n\t\tadd_dashboard_page(\n\t\t\t__( 'Recommendations | Elegant Theme', 'wpex' ),\n\t\t\t__( 'Recommendations', 'wpex' ),\n\t\t\t$this->minimum_capability,\n\t\t\t'wpex-recommended',\n\t\t\tarray( $this, 'recommended_screen' )\n\t\t);\n\n\t}",
"public function admin_page_display() {\n\t\t?>\n\t\t<div class=\"wrap cmb2-options-page <?php echo $this->key; ?>\">\n\t\t\t<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>\n\t\t\t<?php cmb2_metabox_form( $this->metabox_id, $this->key ); ?>\n <hr />\n\t\t\t<h2><?php echo $this->ads_title; ?></h2>\n\t\t\t<?php cmb2_metabox_form( $this->ads_metabox_id, $this->key ); ?>\n\t\t</div>\n\t\t<?php\n\t}",
"function pagemenu_print_tabs($cm, $currenttab) {\n global $CFG;\n\n if (has_capability('mod/pagemenu:manage', context_module::instance($cm->id))) {\n $tabs = $row = $inactive = array();\n\n $row[] = new tabobject('view', \"$CFG->wwwroot/mod/pagemenu/view.php?id=$cm->id\", get_string('view', 'pagemenu'));\n $row[] = new tabobject('edit', \"$CFG->wwwroot/mod/pagemenu/edit.php?id=$cm->id\", get_string('edit', 'pagemenu'));\n\n $tabs[] = $row;\n\n print_tabs($tabs, $currenttab, $inactive);\n }\n}",
"function admin_menu() {\n\t\t\t$this->page = add_options_page( __( 'EDD Promo settings', 'edd-promo' ), __( 'EDD Promo', 'edd-promo' ), 'administrator', 'edd_promo_options', array( $this, 'admin_page' ) );\n\t\t\t\n\t\t\tadd_action( 'admin_print_styles-' . $this->page, array( $this, 'admin_print_style' ) );\n\t\t}"
] | [
"0.68744564",
"0.65403014",
"0.6511609",
"0.6357587",
"0.6198893",
"0.6181715",
"0.6143013",
"0.6092806",
"0.6045701",
"0.6035683",
"0.60324776",
"0.59354645",
"0.59269655",
"0.5924065",
"0.59229106",
"0.58910114",
"0.58404744",
"0.58309925",
"0.5823337",
"0.5818566",
"0.57892954",
"0.57868755",
"0.5785704",
"0.5784148",
"0.57774395",
"0.57709074",
"0.57697237",
"0.57463986",
"0.5708898",
"0.57016855"
] | 0.7483057 | 0 |
Get default/active tab for custom layout admin tables. | public function get_active_tab( $default = '' ) {
$current_tab = $default;
if ( ! empty( $_REQUEST['layout_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$current_tab = $_REQUEST['layout_type']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
}
return $current_tab;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function medigroup_mikado_get_admin_tab() {\n\t\treturn isset($_GET['page']) ? medigroup_mikado_strafter($_GET['page'], 'tab') : null;\n\t}",
"public function get_tab() {\n if (isset ($_POST['tab'])) $tab = $_POST['tab']; else if (isset ($_GET['tab'])) $tab = $_GET['tab']; else $tab = $this->default_tab;\n return $tab;\n }",
"public function getTab() {\n $t = $this->get('Tab');\n if($t) {\n\t if(substr($t, 0, 5) == \"Root.\") {\n\t \treturn $t;\n\t }\n\t return \"Root.{$t}\";\n \t}\n \treturn \"Root.Main\";\n }",
"function bbp_get_tools_admin_tabs($active_tab = '')\n{\n}",
"private function get_current_tab() {\n\t\t$tab = '';\n\n\t\tif ( !isset( $_GET['vfb-tab'] ) || isset( $_GET['vfb-tab'] ) && 'addons-list' == $_GET['vfb-tab'] )\n\t\t\t$tab = 'addons-list';\n\t\telseif ( isset( $_GET['vfb-tab'] ) )\n\t\t\t$tab = esc_html( $_GET['vfb-tab'] );\n\n\t\treturn $tab;\n\t}",
"public function getDefaultTabGroup()\n\t{\n\t\treturn $this->getKeyValue('default_tab_group'); \n\n\t}",
"function bbp_tools_admin_tabs($active_tab = '')\n{\n}",
"public function getTab()\n {\n return 'Todo';\n }",
"public static function tableName(): string\n {\n return '{{%cpnav_layout}}';\n }",
"public static function getActiveLayout();",
"public function getBaseTab($name)\n {\n return isset($this->baseTabs[$name]) ? $this->baseTabs[$name] : null;\n }",
"public function get_current_tab($is_dash = false)\n {\n $tab = (isset($_GET['tab']) && $this->page_has_tab($_GET['tab'])) ? preg_replace('/-/', '_', $_GET['tab']) : $this->get_default_tab();\n\n return (!$is_dash) ? $tab : preg_replace('/_/', '-', $tab);\n }",
"public static function getActiveLayout()\n\t{\n\t\tif (Session::has('layout')) {\n\t\t\treturn Session::get('layout');\n\t\t}\n\n\t\treturn \\AppConfig::main('defaultLayout');\n\t}",
"public function getTab(): string {\n\t\tob_start();\n\t\trequire __DIR__ . '/templates/doctrine.tab.phtml';\n\t\treturn ob_get_clean();\n\t}",
"public function getTabId() {\n return $this->get(self::TAB_ID);\n }",
"public function getTab()\n {\n return 'HTML';\n }",
"public function getTab()\n\t{\n\t\t$this->compute();\n\n\t\tob_start();\n\t\trequire __DIR__ . '/LoadPanel.tab.phtml';\n\n\t\treturn ob_get_clean();\n\t}",
"public function getWizardTab()\n {\n return $this->wizardTab;\n }",
"function tab_class($tab) {\r\n\tif ( basename($_SERVER['PHP_SELF'], '.php') == $tab || strstr($_SERVER[\"REQUEST_URI\"], $tab) ) {\r\n\t\treturn 'active';\r\n\t}\r\n\telse {\r\n\t\treturn '';\r\n\t}\r\n}",
"public function getTable()\n\t{\n\t\treturn $this->getModule()->baseTable;\n\t}",
"public function getBaseTabs()\n {\n return $this->baseTabs;\n }",
"function tab_name() {\n \treturn 'Simple Overview';\n }",
"public function getTab()\n {\n $this->_branchName = $this->_getBranchName();\n if ($this->_branchName == '') {\n return 'Git';\n }\n return \"Git ({$this->_branchName})\";\n }",
"public function getDefaultTabName()\n {\n return array(\n 'tab_name_id' => '', /* END 'tab_name_id' */\n );\n }",
"public function get_default_template_path() {\n\t\treturn Tribe__Main::instance()->plugin_path . '/src/admin-views/tabbed-view/tab.php';\n\t}",
"public function activeTable()\n {\n return $this->at;\n }",
"public function getSelectedTabId()\n {\n return addslashes(htmlspecialchars($this->getRequest()->getParam('tab')));\n }",
"public function activePlugin ()\n\t{\n\t\t$navigation = $this->navigation;\n\t\t$configuration = $this->configuration;\n\n\t\tif (! empty($configuration['m']) && ! empty($navigation->navigation[$configuration['m']]['plugin'])) {\n\t\t\treturn $navigation->navigation[$this->configuration['m']]['plugin'];\n\t\t} else {\n\t\t\treturn 'AdminTools';\n\t\t}\n\t}",
"public function getTabs() {\n if ($this->aTabs === null) {\n $aTabs = array();\n $iDeep = substr_count($this->getIdent(), '_')+1;\n $sRequest = '';\n foreach (explode('_', $this->getRequest('controller')) as $iRequestPart => $sRequestPart) {\n if ($iRequestPart > $iDeep) {\n break;\n } else {\n $sRequest .= '_'.$sRequestPart;\n }\n }\n $sRequest = substr($sRequest, 1);\n $blActiveFound = false;\n foreach ($this->getChildControllersNames(true) as $sChildClass) {\n try {\n $blShow = MLFilesystem::gi()->callStatic($sChildClass, 'getTabVisibility');\n } catch (ReflectionException $oEx) {// method dont exists\n $blShow = true;\n }\n if (!$blShow) {\n continue;\n }\n $aControllers = explode('_', $sChildClass);\n array_shift($aControllers);// remove 'controller'\n $sChild = implode('_', $aControllers);\n try {//add mp-id\n $aControllers[0] .= ':'.MLModul::gi()->getMarketPlaceId();\n } catch (Exception $oEx) {\n\n }\n try {\n $sTitle = MLFilesystem::gi()->callStatic($sChildClass, 'getTabTitle');\n } catch (ReflectionException $oEx) {// method dont exists\n $sTitle = ucfirst($aControllers[count($aControllers)-1]);\n }\n try {\n $sLabel = MLFilesystem::gi()->callStatic($sChildClass, 'getTabLabel');\n } catch (ReflectionException $oEx) {// method dont exists\n $sLabel = '';\n }\n\n $aTabs[$sChild] = array(\n 'title' => $sTitle,\n 'subtitle' => $sTitle,\n 'label' => $sLabel,\n 'class' => '',\n 'url' => $this->getUrl(array('controller' => implode('_', $aControllers))),\n 'controller' => $aControllers,\n 'controllerClass' => $sChildClass,\n );\n }\n $this->aTabs = $aTabs;\n }\n return $this->aTabs;\n }",
"public function get_default_tabs()\n {\n $tabs = array();\n\n // Iterate over settings array and extract values\n foreach ($this->settings as $page => $page_value) {\n reset($page_value['children']);\n $tabs[$page] = key($page_value['children']);\n }\n\n return $tabs;\n }"
] | [
"0.71783763",
"0.674218",
"0.651046",
"0.6460438",
"0.6438148",
"0.6314149",
"0.6269082",
"0.60941243",
"0.60840106",
"0.6049663",
"0.59329045",
"0.5915549",
"0.5912739",
"0.5905675",
"0.58912706",
"0.584521",
"0.5797597",
"0.5772421",
"0.57661873",
"0.5761394",
"0.57587516",
"0.5744216",
"0.57378745",
"0.5711815",
"0.56937057",
"0.56891423",
"0.5685967",
"0.5665229",
"0.56614244",
"0.56148314"
] | 0.74178743 | 0 |
Filter custom layouts in admin query. Update the custom layouts in the main admin query. Fired by `parse_query` action. | public function admin_query_filter_types( WP_Query $query ) {
global $pagenow, $typenow;
if ( ! ( 'edit.php' === $pagenow && ASTRA_ADVANCED_HOOKS_POST_TYPE === $typenow ) || ! empty( $query->query_vars['meta_key'] ) ) {
return;
}
$current_tab = $this->get_active_tab();
if ( isset( $query->query_vars['layout_type'] ) && '-1' === $query->query_vars['layout_type'] ) {
unset( $query->query_vars['layout_type'] );
}
if ( empty( $current_tab ) ) {
return;
}
$query->query_vars['meta_key'] = 'ast-advanced-hook-layout';
$query->query_vars['meta_value'] = $current_tab;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enable_custom_layout(){\n\n\t\t//First examine the query\n\t\t$query_object = BeanFactory::getBean('CustomQueries', $this->query_id);\n\t\t$query_object->get_custom_results(false, true);\n\n\t\tif(!empty($query_object->column_array)){\n\t\t\tforeach($query_object->column_array as $key => $value){\n\t\t\t\tif(empty($value)) $column_name[$key] = \" \";\n\t\t\t\t$layout_object = new DataSet_Layout();\n\t\t\t\t$layout_object->construct($this->id, \"Column\", $key, \"Normal\", $value);\n\t\t\t}\n\t\t//if empty column_array\n\t\t}\n\n\t//end function enable_custom_layout\n\t}",
"function themify_adjust_page_settings_for_layouts( $args ) {\n\tif( 'custom' === $args['layout_group'] )\n\t\treturn;\n\t$post_id = $args['current_builder_id'];\n\t$post = get_post( $post_id );\n\tupdate_post_meta( $post_id, 'content_width', 'full_width' );\n\tif( $post->post_type === 'page' ) {\n\t\tupdate_post_meta( $post_id, 'page_layout', 'sidebar-none' );\n\t\tupdate_post_meta( $post_id, 'hide_page_title', 'yes' );\n\t} else {\n\t\tupdate_post_meta( $post_id, 'layout', 'sidebar-none' );\n\t\tupdate_post_meta( $post_id, 'hide_post_title', 'yes' );\n\t}\n}",
"function ot_modify_layouts() {\n if ( isset( $_POST['option_tree_modify_layouts_nonce'] ) && wp_verify_nonce( $_POST['option_tree_modify_layouts_nonce'], 'option_tree_modify_layouts_form' ) ) {\n \n /* previous layouts value */\n $option_tree_layouts = get_option( ot_layouts_id() );\n \n /* new layouts value */\n $layouts = isset( $_POST[ot_layouts_id()] ) ? $_POST[ot_layouts_id()] : '';\n \n /* rebuild layout array */\n $rebuild = array();\n \n /* validate layouts */\n if ( is_array( $layouts ) && ! empty( $layouts ) ) {\n \n /* setup active layout */\n if ( isset( $layouts['active_layout'] ) && ! empty( $layouts['active_layout'] ) ) {\n $rebuild['active_layout'] = $layouts['active_layout'];\n }\n \n /* add new and overwrite active layout */\n if ( isset( $layouts['_add_new_layout_'] ) && ! empty( $layouts['_add_new_layout_'] ) ) {\n $rebuild['active_layout'] = ot_sanitize_layout_id( $layouts['_add_new_layout_'] );\n $rebuild[$rebuild['active_layout']] = ot_encode( serialize( get_option( ot_options_id() ) ) );\n }\n \n $first_layout = '';\n \n /* loop through layouts */\n foreach( $layouts as $key => $layout ) {\n \n /* skip over active layout key */\n if ( $key == 'active_layout' )\n continue;\n \n /* check if the key exists then set value */\n if ( isset( $option_tree_layouts[$key] ) && ! empty( $option_tree_layouts[$key] ) ) {\n $rebuild[$key] = $option_tree_layouts[$key];\n if ( '' == $first_layout ) {\n $first_layout = $key;\n }\n }\n \n }\n \n if ( isset( $rebuild['active_layout'] ) && ! isset( $rebuild[$rebuild['active_layout']] ) && ! empty( $first_layout ) ) {\n $rebuild['active_layout'] = $first_layout;\n }\n \n }\n \n /* default message */\n $message = 'failed';\n \n /* is array: save & show success message */\n if ( count( $rebuild ) > 1 ) {\n\n /* rebuild the theme options */\n $rebuild_option_tree = unserialize( ot_decode( $rebuild[$rebuild['active_layout']] ) );\n if ( is_array( $rebuild_option_tree ) ) {\n \n /* execute the action hook and pass the theme options to it */\n do_action( 'ot_before_theme_options_save', $rebuild_option_tree );\n \n update_option( ot_options_id(), $rebuild_option_tree );\n \n }\n \n /* rebuild the layouts */\n update_option( ot_layouts_id(), $rebuild );\n \n /* change message */\n $message = 'success';\n \n } else if ( count( $rebuild ) <= 1 ) {\n\n /* delete layouts option */\n delete_option( ot_layouts_id() );\n \n /* change message */\n $message = 'deleted';\n \n }\n \n /* redirect */\n if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] == apply_filters( 'ot_theme_options_menu_slug', 'ot-theme-options' ) ) {\n $query_args = esc_url_raw( add_query_arg( array( 'settings-updated' => 'layout' ), remove_query_arg( array( 'action', 'message' ), $_POST['_wp_http_referer'] ) ) );\n } else {\n $query_args = esc_url_raw( add_query_arg( array( 'action' => 'save-layouts', 'message' => $message ), $_POST['_wp_http_referer'] ) );\n }\n wp_redirect( $query_args );\n exit;\n \n }\n \n return false;\n\n }",
"function beforeFilter(){\n parent::beforeFilter();\n $this->layout = 'layout';\n }",
"public function prepare_layout($layout_script = NULL)\n {\n $layout = parent::prepare_layout($layout_script);\n\n $layout->add_style(Modules::uri('catalog') . '/public/css/backend/catalog.css');\n\n // Add catalog js scripts\n if ($this->request->action == 'index')\n {\n $layout->add_script(Modules::uri('catalog') . '/public/js/backend/catalog.js');\n $layout->add_script(\n \"var branch_toggle_url = '\"\n . URL::to('backend/catalog/sections', array(\n 'action' => 'toggle', 'id' => '{{id}}', 'toggle' => '{{toggle}}')\n )\n . '?context=' . $this->request->uri\n . \"';\"\n , TRUE);\n }\n\n if ($this->request->action == 'product_select')\n {\n // Add product select js scripts\n $layout->add_script(Modules::uri('catalog') . '/public/js/backend/product_select.js');\n $layout->add_script(\n \"var product_selected_url = '\" . URL::to('backend/catalog', array('action' => 'product_selected', 'product_id' => '{{id}}')) . \"';\"\n , TRUE);\n }\n\n if ($this->request->action == 'sections_select')\n {\n // Add sections select js scripts\n $layout->add_script(Modules::uri('catalog') . '/public/js/backend/sections_select.js');\n }\n\n return $layout;\n }",
"function beforeFilter() {\r\n parent::beforeFilter();\r\n $this->layout = \"board\";\r\n }",
"protected function add_layouts_support() {\n\n\t\tparent::add_layouts_support();\n\n\t\t/** @noinspection PhpUndefinedClassInspection */\n\t\tWPDDL_Integration_Theme_Template_Router::get_instance();\n\n\t\tif( version_compare( WPDDL_VERSION, '1.9-b3' ) !== -1 ) {\n\t\t\t// Add custom help link on edit layout screen\n\t\t\t$this->init_specific_help_link();\n\t\t}\n\n\t\t// Return list of forbidden cells for Content Layouts\n\t\tadd_filter( 'ddl-disabled_cells_on_content_layout', array( &$this, 'disabled_cells_on_content_layout_function' ), 10, 1 );\n\t}",
"function setLayout($layout)\n {\n // override me\n }",
"function ssep_force_layout() {\n\tglobal $post, $ss_layout;\n\n\t$layout = (is_object($post)) ? apply_filters( 'shoestrap_forced_layout', get_post_meta( $post->ID, '_ss_assign_layout', true ) ) : 'd';\n\n\t// No need to continue if we've selected the default option.\n\tif ( 'd' == $layout ) {\n\t\treturn;\n\t}\n\n\tif ( 'f' == $layout ) { // Full-width\n\n\t\t$ss_layout->set_layout( 0 );\n\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_false', 999 );\n\t\tadd_filter( 'shoestrap_display_secondary_sidebar', '__return_false', 999 );\n\n\t} elseif ( 'r' == $layout ) { // Right Sidebar\n\n\t\t$ss_layout->set_layout( 1 );\n\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_true', 999 );\n\t\tadd_filter( 'shoestrap_display_secondary_sidebar', '__return_false', 999 );\n\n\t} elseif ( 'l' == $layout ) { // Left Sidebar\n\n\t\t$ss_layout->set_layout( 2 );\n\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_true', 999 );\n\t\tadd_filter( 'shoestrap_display_secondary_sidebar', '__return_false', 999 );\n\n\t} elseif ( 'll' == $layout ) { // 2 Left Sidebars\n\n\t\t$ss_layout->set_layout( 3 );\n\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_true', 999 );\n\t\tadd_filter( 'shoestrap_display_secondary_sidebar', '__return_true', 999 );\n\n\t} elseif ( 'rr' == $layout ) { // 2 Right Sidebars\n\n\t\t$ss_layout->set_layout( 4 );\n\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_true', 999 );\n\t\tadd_filter( 'shoestrap_display_secondary_sidebar', '__return_true', 999 );\n\n\t} elseif ( 'lr' == $layout ) { // 1 Left & 1 Right Sidebars\n\n\t\t$ss_layout->set_layout( 5 );\n\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_true', 999 );\n\t\tadd_filter( 'shoestrap_display_secondary_sidebar', '__return_true', 999 );\n\n\t}\n}",
"protected function registerLayoutAfter() {}",
"public function layouts() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layouts.php';\n\t}",
"function boss_filter_layout( $value, $id, $param ) {\n\tif ( $id == 'boss_layout_style' ) {\n\t\t$value = 'boxed';\n\t}\n\treturn $value;\n}",
"function my_theme_adjust_querys($query) {\n\n if(!is_admin() AND is_post_type_archive( 'event' ) AND $query->is_main_query())\n {\n $query->set('meta_key', 'event_date');\n $query->set('orderby', 'meta_value_num');\n $query->set('order', 'ASC');\n $query->set('meta_query', array(\n array(\n 'key' => 'event_date',\n 'compare' => '>=',\n 'value' => date('Ymd'),\n 'type' => 'numeric'\n )\n ));\n } \n\n if(!is_admin() AND is_post_type_archive( 'program' ) AND $query->is_main_query())\n {\n $query->set('orderby', 'title');\n $query->set('order', 'ASC');\n $query->set('post_per_page', -1);\n } \n\n }",
"public function prepare_layout($layout_script = NULL)\n { \n return $this->request->get_controller('acl')->prepare_layout($layout_script);\n }",
"function university_adjust_queries($query){\n // If not in admin for archive-campus.php\n if(!is_admin() AND is_post_type_archive('campuses') AND is_main_query()){\n $query -> set('posts_per_page', -1); // Show all pins on map\n }\n \n // If statement for archive-program.php\n if(!is_admin() AND is_post_type_archive('program') AND is_main_query()){\n $query -> set('orderby', 'title');\n $query -> set('order', 'ASC');\n $query -> set('posts_per_page', -1);\n }\n // Archieve.php, before wordpress sends the queries it will run this function to adjust the query\n if (!is_admin() AND is_post_type_archive('event') AND $query -> is_main_query) {\n $today = date('Ymd');\n\n $query -> set('meta_key', 'event_date'); // grab queries from front-page.php\n $query -> set('order_by', 'meta-value-num');\n $query -> set('order', 'ASC');\n $query -> set('meta_query', array( // Creating meta_query to take out the events whose days have already passed\n array( // Return event if it is greater or equal to today's date\n 'key' => 'event_date',\n 'compare' => '>=',\n 'value' => $today,\n 'type' => 'numeric',\n ), \n ));\n }\n }",
"protected function registerLayoutBefore() {}",
"function beforeFilter() {\n parent::beforeFilter();\n\n // set the layout\n $this->layoutOpt['left_nav'] = \"inventory_lookup-left-nav\";\n $this->layoutOpt['left_nav_selected'] = \"view_inventory_lookup\";\n }",
"public function prepare_layout($layout_script = NULL)\n {\n return $this->request->get_controller('orders')->prepare_layout($layout_script);\n }",
"public function requestLayout() {}",
"public function setLayout($layout);",
"function meta_layout(){\n\n\tglobal $cs_xmlObject;\n\n\tif ( empty($cs_xmlObject->sidebar_layout->cs_layout) ) $cs_layout = \"\"; else $cs_layout = $cs_xmlObject->sidebar_layout->cs_layout;\n\n\tif ( empty($cs_xmlObject->sidebar_layout->cs_sidebar_left) ) $cs_sidebar_left = \"\"; else $cs_sidebar_left = $cs_xmlObject->sidebar_layout->cs_sidebar_left;\n\n\tif ( empty($cs_xmlObject->sidebar_layout->cs_sidebar_right) ) $cs_sidebar_right = \"\"; else $cs_sidebar_right = $cs_xmlObject->sidebar_layout->cs_sidebar_right;\n\n ?>\n\n\t<div class=\"elementhidden\">\n\n <div class=\"clear\"></div>\n\n \t<div class=\"opt-head\">\n\n <h4>Layout Options</h4>\n\n <div class=\"clear\"></div>\n\n </div>\n\n <ul class=\"form-elements\">\n\n <li class=\"to-label\">\n\n <label>Select Layout</label>\n\n </li>\n\n <li class=\"to-field\">\n\n <div class=\"meta-input\">\n\n <div class='radio-image-wrapper'>\n\n <input <?php if($cs_layout==\"none\")echo \"checked\"?> onclick=\"show_sidebar('none')\" type=\"radio\" name=\"cs_layout\" class=\"radio\" value=\"none\" id=\"radio_1\" />\n\n <label for=\"radio_1\">\n\n <span class=\"ss\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/1.gif\" alt=\"\" /></span>\n\n <span <?php if($cs_layout==\"none\")echo \"class='check-list'\"?> id=\"check-list\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/1-hover.gif\" alt=\"\" /></span>\n\n </label>\n\n </div>\n\n <div class='radio-image-wrapper'>\n\n <input <?php if($cs_layout==\"right\")echo \"checked\"?> onclick=\"show_sidebar('right')\" type=\"radio\" name=\"cs_layout\" class=\"radio\" value=\"right\" id=\"radio_2\" />\n\n <label for=\"radio_2\">\n\n <span class=\"ss\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/2.gif\" alt=\"\" /></span>\n\n <span <?php if($cs_layout==\"right\")echo \"class='check-list'\"?> id=\"check-list\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/2-hover.gif\" alt=\"\" /></span>\n\n </label>\n\n </div>\n\n <div class='radio-image-wrapper'>\n\n <input <?php if($cs_layout==\"left\")echo \"checked\"?> onclick=\"show_sidebar('left')\" type=\"radio\" name=\"cs_layout\" class=\"radio\" value=\"left\" id=\"radio_3\" />\n\n <label for=\"radio_3\">\n\n <span class=\"ss\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/3.gif\" alt=\"\" /></span>\n\n <span <?php if($cs_layout==\"left\")echo \"class='check-list'\"?> id=\"check-list\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/3-hover.gif\" alt=\"\" /></span>\n\n </label>\n\n </div>\n\n </div>\n\n </li>\n\n </ul>\n\n <ul class=\"form-elements meta-body\" style=\" <?php if($cs_sidebar_left == \"\"){echo \"display:none\";}else echo \"display:block\";?>\" id=\"sidebar_left\" >\n\n <li class=\"to-label\">\n\n <label>Select Left Sidebar</label>\n\n </li>\n\n <li class=\"to-field\">\n\n <select name=\"cs_sidebar_left\" class=\"select_dropdown\" id=\"page-option-choose-left-sidebar\">\n\n <?php\n\n $cs_theme_option = get_option('cs_theme_option');\n\n if ( isset($cs_theme_option['sidebar']) and count($cs_theme_option['sidebar']) > 0 ) {\n\n foreach ( $cs_theme_option['sidebar'] as $sidebar ){\n\n ?>\n\n <option <?php if ($cs_sidebar_left==$sidebar)echo \"selected\";?> ><?php echo $sidebar;?></option>\n\n <?php\n\n }\n\n }\n\n ?>\n\n </select>\n\n </li>\n\n </ul>\n\n <ul class=\"form-elements meta-body\" style=\" <?php if($cs_sidebar_right == \"\"){echo \"display:none\";}else echo \"display:block\";?>\" id=\"sidebar_right\" >\n\n <li class=\"to-label\">\n\n <label>Select Right Sidebar</label>\n\n </li>\n\n <li class=\"to-field\">\n\n <select name=\"cs_sidebar_right\" class=\"select_dropdown\" id=\"page-option-choose-right-sidebar\">\n\n <?php\n\n if ( isset($cs_theme_option['sidebar']) and count($cs_theme_option['sidebar']) > 0 ) {\n\n foreach ( $cs_theme_option['sidebar'] as $sidebar ){\n\n ?>\n\n <option <?php if ($cs_sidebar_right==$sidebar)echo \"selected\";?> ><?php echo $sidebar;?></option>\n\n <?php\n\n }\n\n }\n\n ?>\n\n </select>\n\n <input type=\"hidden\" name=\"cs_orderby[]\" value=\"meta_layout\" />\n\n </li>\n\n </ul>\n\n\t</div>\n\n\t<div class=\"clear\"></div>\n\n<?php\t\n\n}",
"public function addParseFilters($query)\n {\n global $pagenow, $post_type;\n if ($post_type != static::POST_TYPE) {\n return;\n }\n\n if (!$query->is_main_query())\n {\n return;\n }\n\n if (!is_admin())\n {\n return;\n }\n\n if ($pagenow != 'edit.php') {\n return;\n }\n\n $input = PratsRoomtypes::getInput();\n\n if (in_array('users', static::$filters))\n {\n $filter_customer_id = $input->get('filter_customer_id', 0, 'integer');\n if ($filter_customer_id)\n {\n $query->query_vars ['author'] = intval($filter_customer_id);\n }\n }\n\n if (in_array('status', static::$filters))\n {\n $filter_status = $input->get('filter_status', 0, 'string');\n if ($filter_status) {\n $query->set('meta_key', 'status');\n $query->set('meta_value', $filter_status);\n }\n }\n\n // Call the child function\n static::addParseFiltersSub($query);\n }",
"function beforeFilter()\n\t{\n\t\t$this->layout = 'modal';\n\t}",
"function unregister_layouts() {\n\tunregister_sidebar( 'sidebar-alt' );\n\tunregister_sidebar( 'header-right' );\n\n\tgenesis_unregister_layout( 'content-sidebar-sidebar' );\n\tgenesis_unregister_layout( 'sidebar-content-sidebar' );\n\tgenesis_unregister_layout( 'sidebar-sidebar-content' );\n}",
"public function mmcp_sort_column_layout() {\n check_ajax_referer('mmcp_check_ajax_sort_column_layout', 'mmcp_sort_column_noce');\n $menu_id = $this->mmcp_get_request('menu_id');\n $menu_item_id = $this->mmcp_get_request('menu_item_id');\n $row_id = $this->mmcp_get_request('row_id');\n $column_id = $this->mmcp_get_request('column_id');\n $column_index = $this->mmcp_get_request('column_index');\n if ($menu_item_id) {\n $sub_layout = get_post_meta($menu_item_id, 'mmcp_sub_layout', true);\n } else {\n wp_send_json_error(array('message' => __('Could\\'t sort column in the layout', 'mmcp')));\n }\n\n if (!$row_id || !$column_id) {\n wp_send_json_error(array('message' => __('Could\\'t sort column in the layout', 'mmcp')));\n }\n if (is_array($sub_layout)) {\n if (isset($sub_layout['sub_layout'])) {\n $layout = $sub_layout['sub_layout'];\n if(count($layout)) {\n $index_row = null;\n $index_column = null;\n $this->get_data_item_column($layout, $index_row, $index_column, $row_id, $column_id);\n $row_data = $layout[$index_row];\n $column_data = $row_data['data'][$index_column];\n $column_data['order'] = $column_index;\n $new_column_data = array();\n $data_item = array();\n $data_element_diff = array();\n $order = 0;\n $has_update = false;\n $item_continue = false;\n $order_status = false;\n foreach ($row_data['data'] as $key => $value) {\n if ($value['id'] == $column_id) {\n $item_continue = true;\n continue;\n }\n if ($value['type'] == self::DEFAULT_TYPE_COLUMN) {\n if ($value['order'] == $column_index && !$has_update) {\n array_push($data_item, $column_data);\n $has_update = true;\n }\n $value['order'] = $order;\n if ($has_update && !$order_status) {\n $order +=1;\n if (!$item_continue) {\n $value['order'] = $order;\n }\n $order_status = true;\n }\n array_push($data_item, $value);\n $order++;\n } else {\n array_push($data_element_diff, $value);\n }\n }\n usort($data_item, array($this, 'mmcp_sort_array'));\n $new_column_data = array_merge($data_item, $data_element_diff);\n $sub_layout['sub_layout'][$index_row]['data'] = $new_column_data;\n update_post_meta($menu_item_id, 'mmcp_sub_layout', $sub_layout);\n wp_send_json_success(array('message' => __('Sort column in the layout success!', 'mmcp')));\n } else {\n wp_send_json_error(array('message' => __('Could\\'t sort column in the layout', 'mmcp')));\n }\n } else {\n wp_send_json_error(array('message' => __('Could\\'t sort column in the layout', 'mmcp')));\n }\n } else {\n wp_send_json_error(array('message' => __('Could\\'t sort column in the layout', 'mmcp')));\n }\n }",
"protected function setLayout($layout)\n {\n }",
"function create_prebuilt_layouts($layouts){\n $layouts['home-agency'] = array(\n 'name' => __('Home: Agency', 'create'), \n 'description' => __('Layout for demo Home: Agency page.', 'create'),\n 'widgets' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'text' => '[rev_slider alias=\"home-slider-agency\"]',\n\t\t 'filter' => false,\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Text',\n\t\t 'raw' => false,\n\t\t 'grid' => 0,\n\t\t 'cell' => 0,\n\t\t 'id' => 0,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h1 style=\"text-align: center;\"><span style=\"color: #bb9f7c;\">Create</span> is a multi-purpose WordPress theme that gives you the power to create many different styles of websites. </h1>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 1,\n\t\t 'cell' => 1,\n\t\t 'id' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'widget_css' => 'line-height: 3.8em !important;',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'show_filter' => 'no',\n\t\t 'filter_alignment' => 'center',\n\t\t 'count' => '4',\n\t\t 'thumb_proportions' => 'landscape',\n\t\t 'layout' => 'masonry without gutter',\n\t\t 'columns' => '4',\n\t\t 'skills' => \n\t\t array (\n\t\t 'illustration' => '',\n\t\t 'mobile' => '',\n\t\t 'motion' => '',\n\t\t 'photography' => '',\n\t\t 'web' => '',\n\t\t ),\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'hover_effect' => 'effect-1',\n\t\t 'hover_color' => '#1aafaf',\n\t\t 'hover_text_color' => '',\n\t\t 'show_skills' => 'yes',\n\t\t 'show_load_more' => 'no',\n\t\t 'enable_lightbox' => 'no',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Portfolio',\n\t\t 'raw' => false,\n\t\t 'grid' => 2,\n\t\t 'cell' => 0,\n\t\t 'id' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'features' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-list-alt',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Page Builder',\n\t\t 'text' => 'Create comes with a page builder that allows you to create pages exactly how you want. ',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-tablet',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Responsive Layout',\n\t\t 'text' => 'Create is a responsive theme. Its layout adjusts to look great on any screen size or device.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-eye',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Retina Ready',\n\t\t 'text' => 'Built with the latest technology in mind, rest assured that your site will look crisp on retina displays.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-tasks',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Multiple Headers',\n\t\t 'text' => 'Packed with 5 different header layouts, you can use this theme to create many different styles of websites.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-cog',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Powerful Options',\n\t\t 'text' => 'Create comes with tons of options built right into the WordPress Customizer. So you can give your site a unique look.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-th-list',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Built-in Mega Menu',\n\t\t 'text' => 'There is a mega menu built in for those sites that have a lot of pages. You can easily add icons to menu items.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t ),\n\t\t 'container_shape' => 'round',\n\t\t 'container_size' => 25,\n\t\t 'icon_size' => 25,\n\t\t 'per_row' => 3,\n\t\t 'responsive' => true,\n\t\t 'title_link' => false,\n\t\t 'icon_link' => false,\n\t\t 'new_window' => false,\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 3,\n\t\t 'cell' => 0,\n\t\t 'id' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h1>Our <span style=\"color: #ffffff;\">customers\\'</span> happiness is what matters to us.</h1>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 4,\n\t\t 'cell' => 0,\n\t\t 'id' => 4,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'padding' => '50px',\n\t\t 'background' => '#232323',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#9e9e9e',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '4',\n\t\t 'layout' => 'carousel',\n\t\t 'columns' => '1',\n\t\t 'alignment' => 'center',\n\t\t 'order' => 'rand',\n\t\t 'carousel-nav-color' => '#ffffff',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Testimonials',\n\t\t 'raw' => false,\n\t\t 'grid' => 4,\n\t\t 'cell' => 1,\n\t\t 'id' => 5,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '50px',\n\t\t 'background' => '#1aafaf',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h1 style=\"text-align: center;\">We\\'ve been known to <span style=\"color: #000000;\">share</span> our thoughts.</h1>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 5,\n\t\t 'cell' => 0,\n\t\t 'id' => 6,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'padding' => '0px',\n\t\t 'background' => '#ffffff',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#878787',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '9',\n\t\t 'layout' => 'carousel',\n\t\t 'columns' => '3',\n\t\t 'alignment' => 'left',\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'show_excerpt' => 'no',\n\t\t 'carousel-nav-color' => '#1aafaf',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Blog',\n\t\t 'raw' => false,\n\t\t 'grid' => 6,\n\t\t 'cell' => 0,\n\t\t 'id' => 7,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'type' => 'html',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\">Unlimited Parallax Sections</h3>\n\t\t<p style=\"text-align: center;\">Create unlimited parallax sections for your pages. It\\'s as easy as adding a new page builder row, uploading an image, and choosing \"parallax from the drop down.</p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 7,\n\t\t 'cell' => 1,\n\t\t 'id' => 8,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '0px',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'text' => 'LEARN MORE',\n\t\t 'url' => '#',\n\t\t 'new_window' => false,\n\t\t 'button_icon' => \n\t\t array (\n\t\t 'icon_selected' => '',\n\t\t 'icon_color' => '',\n\t\t 'icon' => '0',\n\t\t ),\n\t\t 'design' => \n\t\t array (\n\t\t 'align' => 'center',\n\t\t 'theme' => 'flat',\n\t\t 'button_color' => '#bb9f7c',\n\t\t 'text_color' => '#ffffff',\n\t\t 'hover' => true,\n\t\t 'font_size' => '1',\n\t\t 'rounding' => '0.25',\n\t\t 'padding' => '1',\n\t\t ),\n\t\t 'attributes' => \n\t\t array (\n\t\t 'id' => '',\n\t\t 'title' => '',\n\t\t 'onclick' => '',\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Button_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 7,\n\t\t 'cell' => 1,\n\t\t 'id' => 9,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 10 => \n\t\t array (\n\t\t 'title' => 'Use Create to build your next site.',\n\t\t 'sub_title' => false,\n\t\t 'design' => \n\t\t array (\n\t\t 'background_color' => '#1aafaf',\n\t\t 'border_color' => '',\n\t\t 'button_align' => 'right',\n\t\t ),\n\t\t 'button' => \n\t\t array (\n\t\t 'text' => 'BUY CREATE NOW',\n\t\t 'url' => 'http://themetrust.com/themes/create',\n\t\t 'button_icon' => \n\t\t array (\n\t\t 'icon_selected' => '',\n\t\t 'icon_color' => '',\n\t\t 'icon' => '0',\n\t\t ),\n\t\t 'design' => \n\t\t array (\n\t\t 'theme' => 'wire',\n\t\t 'button_color' => '#ffffff',\n\t\t 'text_color' => '#1aafaf',\n\t\t 'hover' => true,\n\t\t 'font_size' => '1',\n\t\t 'rounding' => '0.25',\n\t\t 'padding' => '1',\n\t\t ),\n\t\t 'attributes' => \n\t\t array (\n\t\t 'id' => '',\n\t\t 'title' => '',\n\t\t 'onclick' => '',\n\t\t ),\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Cta_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 8,\n\t\t 'cell' => 0,\n\t\t 'id' => 10,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grids' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'cells' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '70px',\n\t\t 'padding_bottom' => '70px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'background' => '#f9f8f4',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '0px',\n\t\t 'padding_bottom' => '0px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '70px',\n\t\t 'padding_bottom' => '60px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'cells' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'yes',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '50px',\n\t\t 'padding_bottom' => '50px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '0px',\n\t\t 'padding_bottom' => '50px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'cells' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '140px',\n\t\t 'padding_bottom' => '140px',\n\t\t 'background_image' => 957,\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'parallax',\n\t\t ),\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'background' => '#1aafaf',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grid_cells' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'grid' => 0,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.10471092077087999772100346262959646992385387420654296875,\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.7745182012847899866159195880754850804805755615234375,\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.120770877944330001785289141480461694300174713134765625,\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'grid' => 2,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'grid' => 3,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'grid' => 4,\n\t\t 'weight' => 0.58580182951797998835985481491661630570888519287109375,\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'grid' => 4,\n\t\t 'weight' => 0.41419817048202001164014518508338369429111480712890625,\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'grid' => 5,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 10 => \n\t\t array (\n\t\t 'grid' => 7,\n\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t ),\n\t\t 11 => \n\t\t array (\n\t\t 'grid' => 7,\n\t\t 'weight' => 0.59162717219589999739781660537119023501873016357421875,\n\t\t ),\n\t\t 12 => \n\t\t array (\n\t\t 'grid' => 7,\n\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t ),\n\t\t 13 => \n\t\t array (\n\t\t 'grid' => 8,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t ),\n );\n\n\t$layouts['home-pro'] = array(\n\t\t'name' => __('Home: Professional', 'create'),\n\t\t'description' => __('Layout for demo Home: Professional page.', 'create'),\n 'widgets' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'text' => '[rev_slider alias=\"home_slider_pro\"]',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Text',\n\t\t 'grid' => 0,\n\t\t 'cell' => 0,\n\t\t 'id' => 0,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_image_attachment' => false,\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t 'filter' => false,\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">THE ONLY THEME YOU NEED</span></h3><p style=\"text-align: center;\">Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 1,\n\t\t 'cell' => 0,\n\t\t 'id' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'widget_css' => '\t',\n\t\t 'padding' => '70px',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<p><img class=\"alignright size-full wp-image-520\" src=\"http://create.themetrust.com/wp-content/uploads/2015/07/macbook-pro-cropped-right.jpg\" alt=\"macbook-pro-cropped-right\" width=\"1293\" height=\"951\" /></p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 1,\n\t\t 'cell' => 1,\n\t\t 'id' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'features' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-layers',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Page Builder',\n\t\t 'text' => 'Create comes with a page builder that allows you to create pages exactly how you want. ',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-mobile',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Responsive Layout',\n\t\t 'text' => 'Create is a responsive theme. Its layout adjusts to look great on any screen size or device.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-laptop',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Retina Ready',\n\t\t 'text' => 'Built with the latest technology in mind, rest assured that your site will look crisp on retina displays.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-browser',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Multiple Headers',\n\t\t 'text' => 'Packed with 5 different header layouts, you can use this theme to create many different styles of websites.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-gears',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Powerful Options',\n\t\t 'text' => 'Create comes with tons of options built right into the WordPress Customizer. So you can give your site a unique look.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-genius',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Built-in Mega Menu',\n\t\t 'text' => 'There is a mega menu built in for those sites that have a lot of pages. You can easily add icons to menu items.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t ),\n\t\t 'container_shape' => 'round',\n\t\t 'container_size' => 25,\n\t\t 'icon_size' => 25,\n\t\t 'per_row' => 3,\n\t\t 'responsive' => true,\n\t\t 'title_link' => false,\n\t\t 'icon_link' => false,\n\t\t 'new_window' => false,\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 2,\n\t\t 'cell' => 0,\n\t\t 'id' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'left',\n\t\t 'widget_css' => 'p{opacity: .5}',\n\t\t 'padding' => '50px',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'title' => 'Some of our latest work.',\n\t\t 'sub_title' => '',\n\t\t 'design' => \n\t\t array (\n\t\t 'background_color' => '#ba9e78',\n\t\t 'border_color' => false,\n\t\t 'button_align' => 'right',\n\t\t ),\n\t\t 'button' => \n\t\t array (\n\t\t 'text' => 'View More',\n\t\t 'url' => '',\n\t\t 'button_icon' => \n\t\t array (\n\t\t 'icon_selected' => '',\n\t\t 'icon_color' => false,\n\t\t 'icon' => 0,\n\t\t ),\n\t\t 'design' => \n\t\t array (\n\t\t 'theme' => 'flat',\n\t\t 'button_color' => '#ffffff',\n\t\t 'text_color' => '#ba9e78',\n\t\t 'hover' => true,\n\t\t 'font_size' => '1',\n\t\t 'rounding' => '0.25',\n\t\t 'padding' => '1',\n\t\t 'align' => 'center',\n\t\t ),\n\t\t 'attributes' => \n\t\t array (\n\t\t 'id' => '',\n\t\t 'title' => '',\n\t\t 'onclick' => '',\n\t\t ),\n\t\t 'new_window' => false,\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Cta_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 3,\n\t\t 'cell' => 0,\n\t\t 'id' => 4,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'show_filter' => 'no',\n\t\t 'filter_alignment' => 'center',\n\t\t 'count' => '3',\n\t\t 'thumb_proportions' => 'landscape',\n\t\t 'layout' => 'rows without gutter',\n\t\t 'columns' => '3',\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'hover_effect' => 'effect-1',\n\t\t 'hover_color' => '',\n\t\t 'hover_text_color' => '',\n\t\t 'show_skills' => 'yes',\n\t\t 'show_load_more' => 'no',\n\t\t 'enable_lightbox' => 'no',\n\t\t 'skills' => \n\t\t array (\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Portfolio',\n\t\t 'raw' => false,\n\t\t 'grid' => 4,\n\t\t 'cell' => 0,\n\t\t 'id' => 5,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">FROM THE BLOG</span></h3><p style=\"text-align: center;\">This is a blog widget that you can add anywhere. Display recent posts as a grid or carousel.</p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 5,\n\t\t 'cell' => 0,\n\t\t 'id' => 6,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '50px',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '3',\n\t\t 'layout' => 'grid',\n\t\t 'columns' => '3',\n\t\t 'alignment' => 'left',\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'show_excerpt' => 'yes',\n\t\t 'carousel-nav-color' => '',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Blog',\n\t\t 'raw' => false,\n\t\t 'grid' => 5,\n\t\t 'cell' => 0,\n\t\t 'id' => 7,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\">OUR CUSTOMERS <span style=\"color: #ba9e78;\"><strong>LOVE</strong></span> US</h3>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 6,\n\t\t 'cell' => 1,\n\t\t 'id' => 8,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '3',\n\t\t 'layout' => 'carousel',\n\t\t 'columns' => '1',\n\t\t 'alignment' => 'center',\n\t\t 'order' => 'menu_order',\n\t\t 'carousel-nav-color' => '#ba9e78',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Testimonials',\n\t\t 'raw' => false,\n\t\t 'grid' => 6,\n\t\t 'cell' => 1,\n\t\t 'id' => 9,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '30pxpx',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grids' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'cells' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'yes',\n\t\t 'padding_top' => '60px',\n\t\t 'padding_bottom' => '60px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '140px',\n\t\t 'padding_bottom' => '140px',\n\t\t 'background_image' => 544,\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'parallax',\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'background' => '#ba9e78',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'background' => '#f9f8f4',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '0px',\n\t\t 'padding_bottom' => '0px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '40px',\n\t\t 'padding_bottom' => '40px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'cells' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full',\n\t\t 'background' => '#f4f4f4',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '100px',\n\t\t 'padding_bottom' => '100px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'parallax',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grid_cells' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'grid' => 0,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.5,\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.5,\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'grid' => 2,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'grid' => 3,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'grid' => 4,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'grid' => 5,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 0.278206541712607224869913125075981952250003814697265625,\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 0.44358691657478555026017374984803609549999237060546875,\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 0.278206541712607224869913125075981952250003814697265625,\n\t\t ),\n\t\t ),\n\t\t);\n\t\t\n\t\t$layouts['home-full'] = array(\n\t\t\t'name' => __('Home: Fullscreen Slider', 'create'),\n\t\t\t'description' => __('Layout for demo Home: Fullscreen Slider page.', 'create'),\n\t 'widgets' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'text' => '[rev_slider alias=\"full-screen\"]',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t 'grid' => 0,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 0,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_image_attachment' => false,\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'filter' => false,\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-layers',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Page Builder',\n\t\t\t 'text' => 'Create comes with a page builder that allows you to create pages exactly how you want. ',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-mobile',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Responsive Layout',\n\t\t\t 'text' => 'Create is a responsive theme. Its layout adjusts to look great on any screen size or device.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-laptop',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Retina Ready',\n\t\t\t 'text' => 'Built with the latest technology in mind, rest assured that your site will look crisp on retina displays.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 1,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'right v-center',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'image_fallback' => '',\n\t\t\t 'image' => 159,\n\t\t\t 'size' => 'full',\n\t\t\t 'title' => '',\n\t\t\t 'alt' => '',\n\t\t\t 'url' => '',\n\t\t\t 'bound' => true,\n\t\t\t 'new_window' => false,\n\t\t\t 'full_width' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 1,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 2,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'v-center',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 3 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-browser',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Multiple Headers',\n\t\t\t 'text' => 'Packed with 5 different header layouts, you can use this theme to create many different styles of websites.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-gears',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Powerful Options',\n\t\t\t 'text' => 'Create comes with tons of options built right into the WordPress Customizer. So you can give your site a unique look.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-genius',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Built-in Mega Menu',\n\t\t\t 'text' => 'There is a mega menu built in for those sites that have a lot of pages. You can easily add icons to menu items.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 1,\n\t\t\t 'cell' => 2,\n\t\t\t 'id' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left v-center',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 4 => \n\t\t\t array (\n\t\t\t 'type' => 'visual',\n\t\t\t 'title' => '',\n\t\t\t 'text' => '<h3 style=\"text-align: center;\">Our Latest Work</h3><p style=\"text-align: center;\"><span style=\"color: #999999;\">Create unlimited parallax sections for your pages. It\\'s as easy as adding a new page build row, uploading and image, and choosing \"parallax from the drop down.</span></p>',\n\t\t\t 'filter' => '1',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 2,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 4,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'padding' => '0px',\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 5 => \n\t\t\t array (\n\t\t\t 'text' => 'VIEW MORE',\n\t\t\t 'url' => '#',\n\t\t\t 'new_window' => false,\n\t\t\t 'button_icon' => \n\t\t\t array (\n\t\t\t 'icon_selected' => '',\n\t\t\t 'icon_color' => '',\n\t\t\t 'icon' => '0',\n\t\t\t ),\n\t\t\t 'design' => \n\t\t\t array (\n\t\t\t 'align' => 'center',\n\t\t\t 'theme' => 'flat',\n\t\t\t 'button_color' => '#bb9f7c',\n\t\t\t 'text_color' => '#ffffff',\n\t\t\t 'hover' => true,\n\t\t\t 'font_size' => '1',\n\t\t\t 'rounding' => '0.25',\n\t\t\t 'padding' => '1',\n\t\t\t ),\n\t\t\t 'attributes' => \n\t\t\t array (\n\t\t\t 'id' => '',\n\t\t\t 'title' => '',\n\t\t\t 'onclick' => '',\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Button_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 2,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 5,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 6 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'show_filter' => 'no',\n\t\t\t 'filter_alignment' => 'center',\n\t\t\t 'count' => '3',\n\t\t\t 'thumb_proportions' => 'square',\n\t\t\t 'layout' => 'rows without gutter',\n\t\t\t 'columns' => '3',\n\t\t\t 'orderby' => 'date',\n\t\t\t 'order' => 'DESC',\n\t\t\t 'hover_effect' => 'effect-1',\n\t\t\t 'hover_color' => '',\n\t\t\t 'hover_text_color' => '',\n\t\t\t 'show_skills' => 'no',\n\t\t\t 'show_load_more' => 'no',\n\t\t\t 'enable_lightbox' => 'no',\n\t\t\t 'skills' => \n\t\t\t array (\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'TTrust_Portfolio',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 3,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 6,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 7 => \n\t\t\t array (\n\t\t\t 'headline' => \n\t\t\t array (\n\t\t\t 'text' => 'What People Are Saying',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#000000',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'sub_headline' => \n\t\t\t array (\n\t\t\t 'text' => 'Display testimonials as a slider or grid.',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#aaaaaa',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'divider' => \n\t\t\t array (\n\t\t\t 'style' => 'solid',\n\t\t\t 'weight' => 'thin',\n\t\t\t 'color' => '#bc9f7a',\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Headline_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 4,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 7,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'padding' => '20px',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 8 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'count' => '3',\n\t\t\t 'layout' => 'grid',\n\t\t\t 'columns' => '3',\n\t\t\t 'alignment' => 'center',\n\t\t\t 'order' => 'rand',\n\t\t\t 'carousel-nav-color' => '',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'TTrust_Testimonials',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 4,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 8,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 9 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-list-alt',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Multiple Site Layouts',\n\t\t\t 'text' => 'Choose from full-width, boxed, side header, top header, and more.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-desktop',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'One-page Option',\n\t\t\t 'text' => 'Create a navigation that scrolls to different sections on a single page.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 5,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 9,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left',\n\t\t\t 'padding' => '20%',\n\t\t\t 'background' => '#ba9e78',\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 10 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-th',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Portfolio Options',\n\t\t\t 'text' => 'Packed with tons of portfolio options: masonry or grid layout, load more button, and more.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-star-o',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Top-notch Support',\n\t\t\t 'text' => 'Read the documentation, but still have questions? We\\'re here to help.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 5,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 10,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left',\n\t\t\t 'padding' => '20%',\n\t\t\t 'background' => '#232323',\n\t\t\t 'background_image_attachment' => 200,\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 11 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-hand-o-up',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'One-click Demo Install',\n\t\t\t 'text' => 'We make it easy for you to get started with all of the layouts you see here in the demo.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-file-text',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Detailed Documentation',\n\t\t\t 'text' => 'Create has a lot features. We\\'ve taken the time to explain how to use them.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 5,\n\t\t\t 'cell' => 2,\n\t\t\t 'id' => 11,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left',\n\t\t\t 'padding' => '20%',\n\t\t\t 'background' => '#232323',\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 12 => \n\t\t\t array (\n\t\t\t 'headline' => \n\t\t\t array (\n\t\t\t 'text' => 'Recent News',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#000000',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'sub_headline' => \n\t\t\t array (\n\t\t\t 'text' => 'Display recent posts as a carousel or grid.',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#aaaaaa',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'divider' => \n\t\t\t array (\n\t\t\t 'style' => 'solid',\n\t\t\t 'weight' => 'thin',\n\t\t\t 'color' => '#bc9f7a',\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Headline_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 6,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 12,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'padding' => '20px',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 13 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'count' => '7',\n\t\t\t 'layout' => 'carousel',\n\t\t\t 'columns' => '3',\n\t\t\t 'alignment' => 'left',\n\t\t\t 'orderby' => 'date',\n\t\t\t 'order' => 'DESC',\n\t\t\t 'show_excerpt' => 'yes',\n\t\t\t 'carousel-nav-color' => '',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'TTrust_Blog',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 6,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 13,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'grids' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'cells' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'equal_column_height' => 'yes',\n\t\t\t 'padding_top' => '60px',\n\t\t\t 'padding_bottom' => '50px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'cells' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'row_stretch' => 'full',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'padding_top' => '100px',\n\t\t\t 'padding_bottom' => '100px',\n\t\t\t 'background_image' => 118,\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'parallax',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 3 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 4 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'padding_top' => '50px',\n\t\t\t 'padding_bottom' => '50px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 5 => \n\t\t\t array (\n\t\t\t 'cells' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t 'background' => '#eaeaea',\n\t\t\t 'equal_column_height' => 'yes',\n\t\t\t 'padding_top' => '0px',\n\t\t\t 'padding_bottom' => '0px',\n\t\t\t 'padding_left' => '0px',\n\t\t\t 'padding_right' => '0px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 6 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'padding_top' => '50px',\n\t\t\t 'padding_bottom' => '50px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'grid_cells' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'grid' => 0,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'grid' => 1,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'grid' => 1,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 3 => \n\t\t\t array (\n\t\t\t 'grid' => 1,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 4 => \n\t\t\t array (\n\t\t\t 'grid' => 2,\n\t\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t\t ),\n\t\t\t 5 => \n\t\t\t array (\n\t\t\t 'grid' => 2,\n\t\t\t 'weight' => 0.59162717219589999739781660537119023501873016357421875,\n\t\t\t ),\n\t\t\t 6 => \n\t\t\t array (\n\t\t\t 'grid' => 2,\n\t\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t\t ),\n\t\t\t 7 => \n\t\t\t array (\n\t\t\t 'grid' => 3,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t 8 => \n\t\t\t array (\n\t\t\t 'grid' => 4,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t 9 => \n\t\t\t array (\n\t\t\t 'grid' => 5,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 10 => \n\t\t\t array (\n\t\t\t 'grid' => 5,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 11 => \n\t\t\t array (\n\t\t\t 'grid' => 5,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 12 => \n\t\t\t array (\n\t\t\t 'grid' => 6,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t ),\n\t\t\t);\n\t\t\t\n\t\t\t$layouts['home-one-page'] = array(\n\t\t\t\t'name' => __('Home: One Page', 'create'),\n\t\t\t\t'description' => __('Layout for demo Home: One Page page.', 'create'),\n\t\t 'widgets' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '[rev_slider alias=\"one-page-slider\"]',\n\t\t\t\t 'filter' => false,\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 0,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 0,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2 style=\"text-align: center;\">MY <span style=\"color: #bb9f7c;\">WORK</span></h2>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 1,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'title' => '',\n\t\t\t\t 'show_filter' => 'yes',\n\t\t\t\t 'filter_alignment' => 'center',\n\t\t\t\t 'count' => '8',\n\t\t\t\t 'thumb_proportions' => 'square',\n\t\t\t\t 'layout' => 'rows with gutter',\n\t\t\t\t 'columns' => '4',\n\t\t\t\t 'skills' => \n\t\t\t\t array (\n\t\t\t\t 'illustration' => 'illustration',\n\t\t\t\t 'mobile' => 'mobile',\n\t\t\t\t 'motion' => '',\n\t\t\t\t 'photography' => 'photography',\n\t\t\t\t 'web' => 'web',\n\t\t\t\t ),\n\t\t\t\t 'orderby' => 'date',\n\t\t\t\t 'order' => 'DESC',\n\t\t\t\t 'hover_effect' => 'effect-1',\n\t\t\t\t 'hover_color' => '#bb9f7c',\n\t\t\t\t 'hover_text_color' => '',\n\t\t\t\t 'show_skills' => 'no',\n\t\t\t\t 'show_load_more' => 'no',\n\t\t\t\t 'enable_lightbox' => 'yes',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'TTrust_Portfolio',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 1,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 2,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 3 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2><span style=\"color: #1f1f1f;\">ABOUT <span style=\"color: #bb9f7c;\">ME</span></span></h2><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc malesuada lectus libero, ac sagittis nisi dapibus ac. Nunc dictum imperdiet lorem. Quisque vehicula nec arcu nec rutrum. Duis sit amet mattis magna. In felis dui, elementum in tortor dictum, eleifend commodo purus. Nulla eget turpis purus. In ultrices est a pellentesque rutrum. Suspendisse egestas pharetra eros a commodo. Aenean ac ante id odio cursus tempor. Vivamus sit amet ante massa.</p>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 3,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'padding' => '0px',\n\t\t\t\t 'background_display' => 'center',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 4 => \n\t\t\t\t array (\n\t\t\t\t 'networks' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'name' => 'twitter',\n\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'name' => 'dribbble',\n\t\t\t\t 'url' => 'https://dribbble.com/',\n\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t 'button_color' => '#f26798',\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'name' => 'envelope',\n\t\t\t\t 'url' => 'mailto:[email protected]',\n\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 'design' => \n\t\t\t\t array (\n\t\t\t\t 'new_window' => true,\n\t\t\t\t 'theme' => 'wire',\n\t\t\t\t 'hover' => true,\n\t\t\t\t 'icon_size' => '1',\n\t\t\t\t 'rounding' => '0.5',\n\t\t\t\t 'padding' => '1',\n\t\t\t\t 'align' => 'left',\n\t\t\t\t 'margin' => '0.1',\n\t\t\t\t ),\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 4,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 5 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2 style=\"text-align: center;\"><span style=\"color: #1f1f1f;\">MY <span style=\"color: #bb9f7c;\">CLIENTS</span></span></h2><p> </p>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 3,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 5,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 6 => \n\t\t\t\t array (\n\t\t\t\t 'title' => '',\n\t\t\t\t 'count' => '3',\n\t\t\t\t 'layout' => 'grid',\n\t\t\t\t 'columns' => '3',\n\t\t\t\t 'alignment' => 'center',\n\t\t\t\t 'order' => 'rand',\n\t\t\t\t 'carousel-nav-color' => '',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'TTrust_Testimonials',\n\t\t\t\t 'grid' => 3,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 6,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 7 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<p><img class=\"aligncenter size-full wp-image-998\" src=\"http://create.themetrust.com/wp-content/uploads/2015/08/company_logos.png\" alt=\"company_logos\" width=\"3000\" height=\"300\" /></p>',\n\t\t\t\t 'filter' => '',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 4,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 7,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 8 => \n\t\t\t\t array (\n\t\t\t\t 'map_center' => '350 5th Ave, New York, NY 10118',\n\t\t\t\t 'settings' => \n\t\t\t\t array (\n\t\t\t\t 'map_type' => 'interactive',\n\t\t\t\t 'width' => '640',\n\t\t\t\t 'height' => '680',\n\t\t\t\t 'zoom' => 12,\n\t\t\t\t 'scroll_zoom' => true,\n\t\t\t\t 'draggable' => true,\n\t\t\t\t ),\n\t\t\t\t 'markers' => \n\t\t\t\t array (\n\t\t\t\t 'marker_at_center' => true,\n\t\t\t\t 'marker_icon' => 1063,\n\t\t\t\t ),\n\t\t\t\t 'styles' => \n\t\t\t\t array (\n\t\t\t\t 'style_method' => 'raw_json',\n\t\t\t\t 'styled_map_name' => '',\n\t\t\t\t 'raw_json_map_styles' => '[{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#ededed\"},{\"saturation\":-100},{\"lightness\":36},{\"visibility\":\"on\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"administrative\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":0},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":0},{\"lightness\":-100},{\"visibility\":\"on\"}]},{\"featureType\":\"transit\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":0},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#ffffff\"},{\"saturation\":-100},{\"lightness\":100},{\"visibility\":\"on\"}]},{\"featureType\":\"landscape.natural\",\"elementType\":\"all\",\"stylers\":[{\"hue\":\"#e0e0e0\"},{\"saturation\":-100},{\"lightness\":-8},{\"visibility\":\"off\"}]}]',\n\t\t\t\t ),\n\t\t\t\t 'directions' => \n\t\t\t\t array (\n\t\t\t\t 'origin' => '',\n\t\t\t\t 'destination' => '',\n\t\t\t\t 'travel_mode' => 'driving',\n\t\t\t\t ),\n\t\t\t\t 'api_key_section' => \n\t\t\t\t array (\n\t\t\t\t 'api_key' => '',\n\t\t\t\t ),\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'SiteOrigin_Widget_GoogleMap_Widget',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 8,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 9 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2><span style=\"color: #ffffff;\">CONTACT</span><span style=\"color: #1f1f1f;\"> <span style=\"color: #bb9f7c;\">ME</span></span></h2><p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum viverra, eros nec luctus facilisis, nisi nisl tempus purus, vitae congue enim mi pulvinar orci. Quisque diam ex, faucibus sed tortor a, dignissim consequat risus.</p><p>1234 Main St.<br /> New York, NY 10021</p><p>T: 555-456-7892 <em>New York Office<br /> E: [email protected]</em></p>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'cell' => 1,\n\t\t\t\t 'id' => 9,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'padding' => '60px',\n\t\t\t\t 'background' => '#282828',\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t 'font_color' => '#bababa',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 'grids' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t 'custom_row_id' => 'hello',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'background' => '#282828',\n\t\t\t\t 'custom_row_id' => 'my-work',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '70px',\n\t\t\t\t 'padding_bottom' => '70px',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 2,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'custom_row_id' => 'about-me',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '150px',\n\t\t\t\t 'padding_bottom' => '150px',\n\t\t\t\t 'background_image' => 996,\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 3 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'custom_row_id' => 'testimonials',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '60px',\n\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 4 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'background' => '#bb9f7c',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '40px',\n\t\t\t\t 'padding_bottom' => '10px',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 5 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 2,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'gutter' => '0px',\n\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t 'custom_row_id' => 'contact-me',\n\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t 'background_image_position' => 'center bottom',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 'grid_cells' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 0,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 1,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'weight' => 0.49622299651568002598622797449934296309947967529296875,\n\t\t\t\t ),\n\t\t\t\t 3 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'weight' => 0.50377700348431997401377202550065703690052032470703125,\n\t\t\t\t ),\n\t\t\t\t 4 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 3,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 5 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 4,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 6 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'weight' => 0.5,\n\t\t\t\t ),\n\t\t\t\t 7 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'weight' => 0.5,\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$layouts['home-portfolio'] = array(\n\t\t\t\t\t'name' => __('Home: Portfolio', 'create'),\n\t\t\t\t\t'description' => __('Layout for demo Home: Portfolio page.', 'create'),\n\t\t\t 'widgets' => \n\t\t\t\t\t array (\n\t\t\t\t\t 0 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'title' => '',\n\t\t\t\t\t 'text' => '[rev_slider alias=\"home-portfolio\"]',\n\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t 'filter' => false,\n\t\t\t\t\t ),\n\t\t\t\t\t 1 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'title' => '',\n\t\t\t\t\t 'show_filter' => 'yes',\n\t\t\t\t\t 'filter_alignment' => 'center',\n\t\t\t\t\t 'count' => '9',\n\t\t\t\t\t 'thumb_proportions' => 'square',\n\t\t\t\t\t 'layout' => 'rows with gutter',\n\t\t\t\t\t 'columns' => '3',\n\t\t\t\t\t 'skills' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'illustration' => '',\n\t\t\t\t\t 'mobile' => '',\n\t\t\t\t\t 'motion' => '',\n\t\t\t\t\t 'photography' => '',\n\t\t\t\t\t 'web' => '',\n\t\t\t\t\t ),\n\t\t\t\t\t 'orderby' => 'menu_order',\n\t\t\t\t\t 'order' => 'DESC',\n\t\t\t\t\t 'hover_effect' => 'effect-1',\n\t\t\t\t\t 'hover_color' => '',\n\t\t\t\t\t 'hover_text_color' => '',\n\t\t\t\t\t 'show_skills' => 'yes',\n\t\t\t\t\t 'show_load_more' => 'yes',\n\t\t\t\t\t 'enable_lightbox' => 'no',\n\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'class' => 'TTrust_Portfolio',\n\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t 'grids' => \n\t\t\t\t\t array (\n\t\t\t\t\t 0 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t 1 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t 'padding_top' => '30px',\n\t\t\t\t\t 'padding_bottom' => '40px',\n\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t array (\n\t\t\t\t\t 0 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t ),\n\t\t\t\t\t 1 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$layouts['home-shop'] = array(\n\t\t\t\t\t\t'name' => __('Home: Shop', 'create'),\n\t\t\t\t\t\t'description' => __('Layout for demo Home: Shop page.', 'create'),\n\t\t\t\t 'widgets' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '[rev_slider alias=\"shop-slider\"]',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'filter' => false,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'type' => 'html',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '<span style=\"font-size: 36px;\"><strong>Watches</strong></span>\n\n\t\t\t\t\t\t<span style=\"color: #cccccc;\">Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet.</span>\n\n\t\t\t\t\t\t<a href=\\'http://create.themetrust.com/product-category/watches/\\' class=\\'tt-button\\' style=\"background: #bb9f7c;\">SHOP WATCHES</a>',\n\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t 'background' => '#a0a0a0',\n\t\t\t\t\t\t 'background_image_attachment' => 844,\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'type' => 'html',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '<span style=\"font-size: 36px;\"><strong>Bags</strong></span>\n\n\t\t\t\t\t\t<span style=\"color: #cccccc;\">Lorem ipsum dolor sit amet. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. </span>\n\n\t\t\t\t\t\t<a href=\\'http://create.themetrust.com/product-category/bags/\\' class=\\'tt-button\\' style=\"background: #bb9f7c;\">SHOP BAGS</a>',\n\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t 'background' => '#444444',\n\t\t\t\t\t\t 'background_image_attachment' => 842,\n\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '<p><span style=\"font-size: 36px;\"><strong>Shoes</strong></span></p><p><span style=\"color: #999999;\">Imperdiet doming id quod mazim placerat facer am liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. </span></p><p><a class=\"tt-button\" style=\"background: #bb9f7c;\" href=\"http://create.themetrust.com/product-category/shoes/\">SHOP SHOES</a></p>',\n\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t 'id' => 3,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t 'background' => '#515151',\n\t\t\t\t\t\t 'background_image_attachment' => 840,\n\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'headline' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'text' => 'Featured Items from Our Shop',\n\t\t\t\t\t\t 'font' => 'default',\n\t\t\t\t\t\t 'color' => '#000000',\n\t\t\t\t\t\t 'align' => 'center',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'sub_headline' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'text' => 'Lorem ipsum dolor sit amet, consec tetuer adipis elit, aliquam eget nibh etlibura. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.',\n\t\t\t\t\t\t 'font' => 'default',\n\t\t\t\t\t\t 'color' => '#7c7c7c',\n\t\t\t\t\t\t 'align' => 'center',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'divider' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'style' => 'solid',\n\t\t\t\t\t\t 'weight' => 'thin',\n\t\t\t\t\t\t 'color' => '#bb9f7c',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Headline_Widget',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t 'id' => 4,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'count' => '4',\n\t\t\t\t\t\t 'layout' => 'grid',\n\t\t\t\t\t\t 'columns' => '4',\n\t\t\t\t\t\t 'orderby' => 'date',\n\t\t\t\t\t\t 'order' => 'DESC',\n\t\t\t\t\t\t 'categories' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bags' => '',\n\t\t\t\t\t\t 'jewelry' => '',\n\t\t\t\t\t\t 'notebooks' => '',\n\t\t\t\t\t\t 'shoes' => '',\n\t\t\t\t\t\t 'watches' => '',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'show_featured' => 'no',\n\t\t\t\t\t\t 'alignment' => 'left',\n\t\t\t\t\t\t 'carousel-nav-color' => '',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'TTrust_Products',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 5,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'title' => 'Newsletter',\n\t\t\t\t\t\t 'sub_title' => 'Lorem ipsum dolor sit amet, consec tetuer adipis elit, aliquam eget nibh etlibura.',\n\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_color' => '#bb9f7c',\n\t\t\t\t\t\t 'border_color' => '',\n\t\t\t\t\t\t 'button_align' => 'right',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'button' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'text' => 'SIGN UP',\n\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t 'new_window' => '',\n\t\t\t\t\t\t 'button_icon' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'icon_selected' => 'fontawesome-envelope-o',\n\t\t\t\t\t\t 'icon_color' => '#bb9f7c',\n\t\t\t\t\t\t 'icon' => '',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t 'button_color' => '#ffffff',\n\t\t\t\t\t\t 'text_color' => '#bb9f7c',\n\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t 'font_size' => '1',\n\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t 'padding' => '1',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'attributes' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'id' => '',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'onclick' => '',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Cta_Widget',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 6,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t 'gutter' => '30px',\n\t\t\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t\t\t 'padding_top' => '30px',\n\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '60px',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '80px',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'padding_bottom' => '80px',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'weight' => 0.25020678246485006379629112416296266019344329833984375,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'weight' => 0.50020678246484007178906949775409884750843048095703125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'weight' => 0.249586435070310030948093071856419555842876434326171875,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\t\t$layouts['about-us'] = array(\n\t\t\t\t\t\t\t'name' => __('About Us', 'create'),\n\t\t\t\t\t\t\t'description' => __('Layout for demo About Us page.', 'create'),\n\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<h2 style=\"text-align: right;\">WE <span style=\"color: #ba9e78;\">CREATE</span> AMAZING THINGS</h2><p style=\"text-align: right;\"><span style=\"font-size: 21px; color: #737373;\">The Create WordPress theme will change the way you build websites.</span></p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">ABOUT</span></h3>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat. Suspendisse in dolor vitae risus maximus feugiat quis nec nisi. Phasellus ut auctor ante, scelerisque scelerisque eros. Fusce vitae orci eu nisl pellentesque faucibus lacinia sed erat. Nunc consequat erat sit amet felis gravida venenatis. Duis in neque in mi consequat aliquet in id eros. Aliquam vel lorem ut tellus eleifend luctus.</p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'container_color' => '#ffffff',\n\t\t\t\t\t\t\t 'icon' => 'fontawesome-desktop',\n\t\t\t\t\t\t\t 'icon_color' => '#a58c6a',\n\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t 'title' => 'Web Design',\n\t\t\t\t\t\t\t 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.',\n\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'container_color' => '#ffffff',\n\t\t\t\t\t\t\t 'icon' => 'fontawesome-tablet',\n\t\t\t\t\t\t\t 'icon_color' => '#a58c6a',\n\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t 'title' => 'Mobile',\n\t\t\t\t\t\t\t 'text' => 'Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus. ',\n\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'container_color' => '#ffffff',\n\t\t\t\t\t\t\t 'icon' => 'fontawesome-camera',\n\t\t\t\t\t\t\t 'icon_color' => '#a58c6a',\n\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t 'title' => 'Photography',\n\t\t\t\t\t\t\t 'text' => 'Nam sit amet faucibus sapien. Vivamus quis mollis orci, eu sollicitudin urna. Donec turpis justo, iaculis sit amet lorem eu, rhoncus cursus ipsum. Ut laoreet accumsan arcu consequat consectetur.',\n\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'container_shape' => 'rounded-hex',\n\t\t\t\t\t\t\t 'container_size' => 84,\n\t\t\t\t\t\t\t 'icon_size' => 24,\n\t\t\t\t\t\t\t 'per_row' => 3,\n\t\t\t\t\t\t\t 'responsive' => true,\n\t\t\t\t\t\t\t 'title_link' => false,\n\t\t\t\t\t\t\t 'icon_link' => false,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">OUR TEAM</span></h3><p style=\"text-align: center;\">Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat. Suspendisse in dolor vitae risus maximus feugiat quis nec nisi.</p><p style=\"text-align: center;\"> </p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 4,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t 'image' => 261,\n\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 5,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Frank Thompson</strong></span><br />CEO</p><p class=\"member-role\">Suspendisse lobortis pulvinar mauris eget placerat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. </p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 6,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#0177b4',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#dd4b39',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 7,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t 'image' => 246,\n\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 8,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Abby Smith</strong></span><br />Lead Designer</p><p class=\"member-role\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 9,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#0177b4',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#dd4b39',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 10,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t 'image' => 262,\n\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t 'id' => 11,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 12 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Brian Carson</strong></span><br />Lead Developer</p><p class=\"member-role\">Suspendisse in dolor vitae risus maximus feugiat quis nec nisi. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t 'id' => 12,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 13 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#0177b4',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#dd4b39',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t 'id' => 13,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 14 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'map_center' => '350 5th Avenue, New York, NY 10118',\n\t\t\t\t\t\t\t 'settings' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'map_type' => 'interactive',\n\t\t\t\t\t\t\t 'width' => '640',\n\t\t\t\t\t\t\t 'height' => '480',\n\t\t\t\t\t\t\t 'zoom' => 12,\n\t\t\t\t\t\t\t 'scroll_zoom' => true,\n\t\t\t\t\t\t\t 'draggable' => true,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'markers' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'marker_at_center' => true,\n\t\t\t\t\t\t\t 'marker_icon' => 1063,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'styles' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'style_method' => 'raw_json',\n\t\t\t\t\t\t\t 'styled_map_name' => '',\n\t\t\t\t\t\t\t 'raw_json_map_styles' => '[{\"featureType\":\"all\",\"elementType\":\"all\",\"stylers\":[{\"hue\":\"#ffaa00\"},{\"saturation\":\"-33\"},{\"lightness\":\"10\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"on\"}]}]',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'directions' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'origin' => '',\n\t\t\t\t\t\t\t 'destination' => '',\n\t\t\t\t\t\t\t 'travel_mode' => 'driving',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'api_key_section' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'api_key' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_GoogleMap_Widget',\n\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 14,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '250px',\n\t\t\t\t\t\t\t 'padding_bottom' => '250px',\n\t\t\t\t\t\t\t 'background_image' => 264,\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'background' => '#f4f4f4',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '60px',\n\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '70px',\n\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t 'background_image' => 302,\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t\t 'gutter' => '30px',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$layouts['about-us-blocks'] = array(\n\t\t\t\t\t\t\t\t'name' => __('About Us Blocks', 'create'),\n\t\t\t\t\t\t\t\t'description' => __('Layout for demo About Us: Blocks page.', 'create'),\n\t\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h1 style=\"text-align: center;\">ABOUT US</h1><p style=\"text-align: center;\"><span style=\"font-size: 21px; color: #737373;\">The Create WordPress theme will change the way you build websites.</span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#0a0a0a',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3>HOW WE WORK</h3><p><span style=\"color: #808080;\">Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus.</span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t 'background' => '#262626',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'min_height' => '250',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'TTrust_Spacer',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_image_attachment' => 343,\n\t\t\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3>OUR PROCESS</h3><p><span style=\"color: #808080;\">Vivamus sodales justo id sapien aliquam tempus. Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. </span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t 'background' => '#262626',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'min_height' => '250',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'TTrust_Spacer',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 4,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_image_attachment' => 351,\n\t\t\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3>WHAT WE DO</h3><p><span style=\"color: #e5b89c;\">Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus.</span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 5,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t 'background' => '#e56934',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'min_height' => '250',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'TTrust_Spacer',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 6,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_image_attachment' => 359,\n\t\t\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">OUR SERVICES</span></h3><p style=\"text-align: center;\">Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar. </p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 7,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'container_color' => false,\n\t\t\t\t\t\t\t\t 'icon' => 'fontawesome-desktop',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ea6035',\n\t\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t\t 'title' => 'Web Design',\n\t\t\t\t\t\t\t\t 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.',\n\t\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'container_color' => false,\n\t\t\t\t\t\t\t\t 'icon' => 'fontawesome-tablet',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ea6035',\n\t\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t\t 'title' => 'Mobile',\n\t\t\t\t\t\t\t\t 'text' => 'Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus. ',\n\t\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'container_color' => false,\n\t\t\t\t\t\t\t\t 'icon' => 'fontawesome-camera',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ea6035',\n\t\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t\t 'title' => 'Photography',\n\t\t\t\t\t\t\t\t 'text' => 'Nam sit amet faucibus sapien. Vivamus quis mollis orci, eu sollicitudin urna. Donec turpis justo, iaculis sit amet lorem eu, rhoncus cursus ipsum. Ut laoreet accumsan arcu consequat consectetur.',\n\t\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'container_shape' => 'round',\n\t\t\t\t\t\t\t\t 'container_size' => 30,\n\t\t\t\t\t\t\t\t 'icon_size' => 30,\n\t\t\t\t\t\t\t\t 'per_row' => 3,\n\t\t\t\t\t\t\t\t 'responsive' => true,\n\t\t\t\t\t\t\t\t 'title_link' => false,\n\t\t\t\t\t\t\t\t 'icon_link' => false,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 8,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#242424',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">OUR TEAM</span></h3><p style=\"text-align: center;\">Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat. Suspendisse in dolor vitae risus maximus feugiat quis nec nisi.</p><p style=\"text-align: center;\"> </p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 9,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t\t 'image' => 261,\n\t\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 10,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Frank Thompson</strong></span><br />CEO</p><p class=\"member-role\">Suspendisse lobortis pulvinar mauris eget placerat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. </p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 11,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 12 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 12,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 13 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t\t 'image' => 246,\n\t\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 13,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 14 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Abby Smith</strong></span><br />Lead Designer</p><p class=\"member-role\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 14,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 15 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 15,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 16 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t\t 'image' => 262,\n\t\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 16,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 17 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Brian Carson</strong></span><br />Lead Developer</p><p class=\"member-role\">Suspendisse in dolor vitae risus maximus feugiat quis nec nisi. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 17,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 18 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 18,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '180px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '180px',\n\t\t\t\t\t\t\t\t 'background_image' => 340,\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'padding_left' => '0px',\n\t\t\t\t\t\t\t\t 'padding_right' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'padding_left' => '0px',\n\t\t\t\t\t\t\t\t 'padding_right' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'background' => '#f2f2f2',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t\t\t 'gutter' => '30px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'background' => '#f2f2f2',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 12 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 13 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 14 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 15 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 16 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$layouts['contact-us'] = array(\n\t\t\t\t\t\t\t\t\t'name' => __('Contact Us', 'create'),\n\t\t\t\t\t\t\t\t\t'description' => __('Layout for demo Contact Us page.', 'create'),\n\t\t\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'map_center' => '350 5th Ave, New York, NY 10118',\n\t\t\t\t\t\t\t\t\t 'settings' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'map_type' => 'interactive',\n\t\t\t\t\t\t\t\t\t 'width' => '640',\n\t\t\t\t\t\t\t\t\t 'height' => '480',\n\t\t\t\t\t\t\t\t\t 'zoom' => 12,\n\t\t\t\t\t\t\t\t\t 'scroll_zoom' => true,\n\t\t\t\t\t\t\t\t\t 'draggable' => true,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'markers' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'marker_at_center' => true,\n\t\t\t\t\t\t\t\t\t 'marker_icon' => 1065,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'styles' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'style_method' => 'raw_json',\n\t\t\t\t\t\t\t\t\t 'styled_map_name' => '',\n\t\t\t\t\t\t\t\t\t 'raw_json_map_styles' => '[{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#000000\"},{\"lightness\":40}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":21}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]}]',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'directions' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'origin' => '',\n\t\t\t\t\t\t\t\t\t 'destination' => '',\n\t\t\t\t\t\t\t\t\t 'travel_mode' => 'driving',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'api_key_section' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'api_key' => '',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_GoogleMap_Widget',\n\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t 'text' => '<h3><span style=\"color: #242424;\">Contact Us</span></h3><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus posuere interdum diam eget semper. Pellentesque purus turpis, vehicula et posuere ultrices, dictum vitae turpis. Cras porta enim justo, a tempus arcu ullamcorper in.</p><p>[contact-form-7 id=\"732\" title=\"Contact form 1\"]</p>',\n\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t 'text' => '<h4><span style=\"color: #242424;\">Address</span></h4><p>1234 Main St.<br />New York, NY 10021</p><h4><span style=\"color: #242424;\">Phone</span></h4><p>555-456-7892 <em>New York Office<br /></em>555-376-4532 Los Angeles<em> Office</em></p><h4><span style=\"color: #242424;\">Email</span></h4><p>[email protected]</p>',\n\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t\t 'background' => '#f7f7f7',\n\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'bottom_margin' => '60px',\n\t\t\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'cells' => 2,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'bottom_margin' => '60px',\n\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t 'padding_bottom' => '60px',\n\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'weight' => 0.63971539456661996592146124385180883109569549560546875,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'weight' => 0.360284605433379978567387524890364147722721099853515625,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$layouts['pricing'] = array(\n\t\t\t\t\t\t\t\t\t\t'name' => __('Pricing', 'create'),\n\t\t\t\t\t\t\t\t\t\t'description' => __('Layout for demo Pricing page.', 'create'),\n\t\t\t\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t\t 'text' => '<h2 style=\"text-align: center;\"><span style=\"color: #333333;\">We Give You the <span style=\"color: #bb9f7c;\">Best</span> Value</span></h2><p style=\"text-align: center;\"><span style=\"font-size: 21px;\">This is an example pricing page. It\\'s super easy to create beautiful pricing tables. You have options to set colors, features, icons and more.</span></p>',\n\t\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'title' => false,\n\t\t\t\t\t\t\t\t\t\t 'columns' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'featured' => '',\n\t\t\t\t\t\t\t\t\t\t 'title' => 'Silver',\n\t\t\t\t\t\t\t\t\t\t 'subtitle' => 'Budget Plan',\n\t\t\t\t\t\t\t\t\t\t 'image' => '',\n\t\t\t\t\t\t\t\t\t\t 'price' => '$59',\n\t\t\t\t\t\t\t\t\t\t 'per' => 'per month',\n\t\t\t\t\t\t\t\t\t\t 'button' => 'BUY NOW',\n\t\t\t\t\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '1 GB Storage',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-database',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '2 Domain Names',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-globe',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '3 FTP Users',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-user',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '100 GB Bandwidth',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-exchange',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'featured' => 'on',\n\t\t\t\t\t\t\t\t\t\t 'title' => 'Gold',\n\t\t\t\t\t\t\t\t\t\t 'subtitle' => 'Best Value',\n\t\t\t\t\t\t\t\t\t\t 'image' => '',\n\t\t\t\t\t\t\t\t\t\t 'price' => '$99',\n\t\t\t\t\t\t\t\t\t\t 'per' => 'per month',\n\t\t\t\t\t\t\t\t\t\t 'button' => 'BUY NOW',\n\t\t\t\t\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '3 GB Storage',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-database',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '5 Domain Names',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-globe',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '5 FTP Users',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-user',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '1000 GB Bandwidth',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-exchange',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'featured' => '',\n\t\t\t\t\t\t\t\t\t\t 'title' => 'Platinum',\n\t\t\t\t\t\t\t\t\t\t 'subtitle' => 'Business & Enterpise',\n\t\t\t\t\t\t\t\t\t\t 'image' => '',\n\t\t\t\t\t\t\t\t\t\t 'price' => '$129',\n\t\t\t\t\t\t\t\t\t\t 'per' => 'per month',\n\t\t\t\t\t\t\t\t\t\t 'button' => 'BUY NOW',\n\t\t\t\t\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '10 GB Storage',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-database',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '10 Domain Names',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-globe',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '10 FTP Users',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-user',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '50000 GB Bandwidth',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-exchange',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t\t\t\t 'header_color' => '#5e5e5e',\n\t\t\t\t\t\t\t\t\t\t 'featured_header_color' => '#bb9f7c',\n\t\t\t\t\t\t\t\t\t\t 'button_color' => '#bb9f7c',\n\t\t\t\t\t\t\t\t\t\t 'featured_button_color' => '#bb9f7c',\n\t\t\t\t\t\t\t\t\t\t 'button_new_window' => false,\n\t\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_PriceTable_Widget',\n\t\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t 'padding_top' => '70px',\n\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t 'padding_top' => '20px',\n\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '60px',\n\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 0.14912461852642000526003585036960430443286895751953125,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 0.69952473554990002302389484611921943724155426025390625,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 0.1513506459236799994716449191400897689163684844970703125,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$layouts['testimonials'] = array(\n\t\t\t\t\t\t\t\t\t\t\t'name' => __('Testimonials', 'create'),\n\t\t\t\t\t\t\t\t\t\t\t'description' => __('Layout for demo Testimonials page.', 'create'),\n\t\t\t\t\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'text' => '<h2 style=\"text-align: center;\">TESTIMONIALS</h2><p style=\"text-align: center;\"><span style=\"color: #82acb8;\"><span style=\"font-size: 21px; line-height: 31.5px;\">Read what our customers have to say about us.</span></span></p>',\n\t\t\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'count' => '9',\n\t\t\t\t\t\t\t\t\t\t\t 'layout' => 'grid',\n\t\t\t\t\t\t\t\t\t\t\t 'columns' => '3',\n\t\t\t\t\t\t\t\t\t\t\t 'alignment' => 'center',\n\t\t\t\t\t\t\t\t\t\t\t 'order' => 'rand',\n\t\t\t\t\t\t\t\t\t\t\t 'carousel-nav-color' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'class' => 'TTrust_Testimonials',\n\t\t\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_top' => '250px',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '250px',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image' => 1098,\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_top' => '60px',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '60px',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\n return $layouts;\n\n}",
"public function layout_builder() {\n\t\tinclude FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layout-builder/layouts.php';\n\t\tinclude FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layout-builder/layout.php';\n\t\tinclude FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layout-builder/layout-options.php';\n\t\tinclude FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layout-builder/layout-child-option.php';\n\n\t\twp_enqueue_script( 'fusion_builder_app_util_js', FUSION_LIBRARY_URL . '/inc/fusion-app/util.js', [ 'jquery', 'jquery-ui-core', 'underscore', 'backbone' ], FUSION_BUILDER_VERSION, true );\n\t\twp_enqueue_script( 'fusion_layouts', FUSION_BUILDER_PLUGIN_URL . 'inc/admin-screens/layout-builder/layouts.js', [ 'fusion_builder_app_util_js' ], FUSION_BUILDER_VERSION, false );\n\t\twp_enqueue_script( 'fusion_layout', FUSION_BUILDER_PLUGIN_URL . 'inc/admin-screens/layout-builder/layout.js', [ 'fusion_builder_app_util_js' ], FUSION_BUILDER_VERSION, false );\n\t\twp_enqueue_script( 'fusion_layout_options', FUSION_BUILDER_PLUGIN_URL . 'inc/admin-screens/layout-builder/layout-options.js', [ 'fusion_builder_app_util_js' ], FUSION_BUILDER_VERSION, false );\n\t}",
"function baxel_apply_layout() {\n\t\t$baxel_layout_style = get_theme_mod( 'baxel_layout_style', '1col_sidebar' );\n\t\t$baxel_layout_style_archive = get_theme_mod( 'baxel_layout_style_archive', '1col_sidebar' );\n\t\t/* */\n\n\t\t$meta_sidebar = get_post_meta( get_the_ID(), 'baxel-sidebar-meta-box-checkbox', true );\n\t\t$layout = '';\n\n\t\tif ( is_single() ) {\n\n\t\t\tif ( !is_attachment() ) {\n\n\t\t\t\tif ( ( get_post_format() == '' || get_post_format() == 'aside' ) && get_theme_mod( 'baxel_show_sidebar_standard', 1 ) && !$meta_sidebar ) {\n\n\t\t\t\t\t// Show sidebar at standard posts\n\t\t\t\t\t$layout = '-sidebar';\n\n\t\t\t\t} else if ( get_post_format() == 'gallery' && get_theme_mod( 'baxel_show_sidebar_gallery', 1 ) && !$meta_sidebar ) {\n\n\t\t\t\t\t// Show sidebar at gallery posts\n\t\t\t\t\t$layout = '-sidebar';\n\n\t\t\t\t} else if ( get_post_format() == 'video' && get_theme_mod( 'baxel_show_sidebar_video', 1 ) && !$meta_sidebar ) {\n\n\t\t\t\t\t// Show sidebar at video posts\n\t\t\t\t\t$layout = '-sidebar';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( is_category() || is_author() || is_tag() || is_archive() || is_search() ) {\n\n\t\t\tif ( $baxel_layout_style_archive == '1col' ) {\n\n\t\t\t\t// No sidebar\n\t\t\t\t$layout = '';\n\n\t\t\t} else if ( $baxel_layout_style_archive == '2col' ) {\n\n\t\t\t\t// 2 columns //-c(olumn)c(ount)2\n\t\t\t\t$layout = '-cc2';\n\n\t\t\t} else if ( $baxel_layout_style_archive == '3col' || $baxel_layout_style_archive == '2_3col' ) {\n\n\t\t\t\t// 3 columns //-c(olumn)c(ount)3\n\t\t\t\t$layout = '-cc3';\n\n\t\t\t} else if ( $baxel_layout_style_archive == '1col_sidebar' ) {\n\n\t\t\t\t// Columns + Sidebar\n\t\t\t\t$layout = '-sidebar';\n\n\t\t\t} else if ( $baxel_layout_style_archive == '2col_sidebar' || $baxel_layout_style_archive == '1_2col_sidebar' ) {\n\n\t\t\t\t// Columns + Sidebar\n\t\t\t\t$layout = '-sidebar-cc2';\n\n\t\t\t}\n\n\t\t} else if ( is_page() ) {\n\n\t\t\tif ( is_front_page() ) {\n\n\t\t\t\tif ( get_theme_mod( 'baxel_show_sidebar_static', 1 ) && !$meta_sidebar ) {\n\n\t\t\t\t\t// Show sidebar on inner pages\n\t\t\t\t\t$layout = '-sidebar';\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( get_theme_mod( 'baxel_show_sidebar_page', 1 ) && !$meta_sidebar ) {\n\n\t\t\t\t\t// Show sidebar on inner pages\n\t\t\t\t\t$layout = '-sidebar';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( function_exists( 'WC' ) && ( is_cart() || is_checkout() || is_account_page() ) ) {\n\t\t\t\t\t// Hide sidebar on inner pages\n\t\t\t\t\t$layout = '';\n\t\t\t}\n\n\t\t} else if ( is_404() ) {\n\n\t\t\t$layout = '';\n\n\t\t} else {\n\n\t\t\tif ( $baxel_layout_style == '1col' ) {\n\n\t\t\t\t// No sidebar\n\t\t\t\t$layout = '';\n\n\t\t\t} else if ( $baxel_layout_style == '2col' ) {\n\n\t\t\t\t// 2 columns //-c(olumn)c(ount)2\n\t\t\t\t$layout = '-cc2';\n\n\t\t\t} else if ( $baxel_layout_style == '3col' || $baxel_layout_style == '2_3col' ) {\n\n\t\t\t\t// 3 columns //-c(olumn)c(ount)3\n\t\t\t\t$layout = '-cc3';\n\n\t\t\t} else if ( $baxel_layout_style == '1col_sidebar' ) {\n\n\t\t\t\t// Columns + Sidebar\n\t\t\t\t$layout = '-sidebar';\n\n\t\t\t} else if ( $baxel_layout_style == '2col_sidebar' || $baxel_layout_style == '1_2col_sidebar' ) {\n\n\t\t\t\t// Columns + Sidebar\n\t\t\t\t$layout = '-sidebar-cc2';\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $layout;\n\n\t}",
"public function get_layout_options() {\n\t\tcheck_ajax_referer( 'fusion_tb_new_layout', 'security' );\n\n\t\t$parent = isset( $_POST['parent'] ) ? sanitize_text_field( wp_unslash( $_POST['parent'] ) ) : '';\n\t\t$search = isset( $_POST['search'] ) ? sanitize_text_field( wp_unslash( $_POST['search'] ) ) : '';\n\t\t$page = isset( $_POST['page'] ) ? (int) $_POST['page'] : 1;\n\n\t\t$conditions = Fusion_Template_Builder()->get_layout_child_conditions( $parent, $page, $search );\n\n\t\twp_send_json_success( array_values( $conditions ) );\n\t}"
] | [
"0.5812786",
"0.5483368",
"0.54004323",
"0.53664523",
"0.5320972",
"0.5183462",
"0.51776475",
"0.51534945",
"0.513684",
"0.5122701",
"0.51125026",
"0.5104801",
"0.5098081",
"0.505538",
"0.5050706",
"0.5046389",
"0.5044353",
"0.504432",
"0.5037089",
"0.50326765",
"0.5024437",
"0.4990006",
"0.49583536",
"0.49545035",
"0.49509686",
"0.49500018",
"0.49473265",
"0.49436373",
"0.49290428",
"0.4925051"
] | 0.5778153 | 1 |
Get Markup of Location rules for Display rule column. | public function column_display_location_rules( $locations ) {
$location_label = array();
$index = array_search( 'specifics', $locations['rule'] );
if ( false !== $index && ! empty( $index ) ) {
unset( $locations['rule'][ $index ] );
}
if ( isset( $locations['rule'] ) && is_array( $locations['rule'] ) ) {
foreach ( $locations['rule'] as $location ) {
$location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location );
}
}
if ( isset( $locations['specific'] ) && is_array( $locations['specific'] ) ) {
foreach ( $locations['specific'] as $location ) {
$location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location );
}
}
$location_label = array_diff( $location_label, array( 'clflag', '' ) );
if ( empty( $location_label ) ) {
return;
}
$ruleset_markup = '<ul class="ast-layout-visibility-list">';
foreach ( $location_label as $key => $rule ) {
$ruleset_markup .= '<li class="layout-list-item">' . esc_attr( $rule ) . '</li>';
}
$ruleset_markup .= '</ul>';
return $ruleset_markup;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function display()\n {\n $return = array();\n\n // set name of column\n $return[] = $this->indentation(2) . $this->config['name'] . ':';\n\n // set datatype of column\n $return[] = $this->indentation(3) . 'type: ' . \\MwbExporter\\Core\\Registry::get('formatter')->useDatatypeConverter((isset($this->link['simpleType']) ? $this->link['simpleType'] : $this->link['userType']), $this);\n\n // check if the column is a primary key\n if($this->isPrimary){\n $return[] = $this->indentation(3) . 'primary: true';\n }\n\n // check for not null column\n if(isset($this->config['isNotNull']) && $this->config['isNotNull'] == 1){\n $return[] = $this->indentation(3) . 'notnull: true';\n }\n\n // check for auto increment column\n if(isset($this->config['autoIncrement']) && $this->config['autoIncrement'] == 1){\n $return[] = $this->indentation(3) . 'generator:';\n $return[] = $this->indentation(4) . 'strategy: AUTO';\n }\n\n // set default value\n if(isset($this->config['defaultValue']) && $this->config['defaultValue'] != '' && $this->config['defaultValue'] != 'NULL'){\n $return[] = $this->indentation(3) . 'default: ' . $this->config['defaultValue'];\n }\n\n // iterate on column flags\n foreach($this->data->xpath(\"value[@key='flags']/value\") as $flag){\n $return[] = $this->indentation(3) . strtolower($flag) . ': true';\n }\n\n // return yaml representation of column\n return implode(\"\\n\", $return);\n }",
"protected function getShowRules()\n\t{\n\t\treturn $this->showRules;\n\t}",
"public function displayRules() {\n $file = 'rules.txt';\n $str = '';\n $str .= str_repeat('-', self::HORIZ_SEP_LEN) . PHP_EOL;\n $str .= sprintf(' %5s %23s %9s %27s %9s' . PHP_EOL, 'No.', 'Set', 'Support', 'Rule', 'Confidence');\n $str .= str_repeat('-', self::HORIZ_SEP_LEN) . PHP_EOL;\n self::saveDisplay($file, $str);\n\n $num = 0;\n foreach ($this->rules as $X => &$rules) {\n $str = '';\n foreach ($rules as $r) {\n $r['rule'] = $X . self::SET_IMPL . $r['Y'];\n /* lowing memory usage by gluing rules here*/\n $r['set'] = $X . self::ITEM_SEP . $r['Y'];\n $r['set'] = self::_explode($r['set']);\n natcasesort($r['set']);\n $r['set'] = self::_join($r['set']);\n\n $str .= sprintf(' %5d %23s %8.2f%% %27s %8.2f%%' . PHP_EOL, $num++, $r['set'], $r['supp'], $r['rule'], $r['conf']);\n }\n self::saveDisplay($file, $str, true);\n }\n $str = str_repeat('-', self::HORIZ_SEP_LEN) . PHP_EOL;\n self::saveDisplay($file, $str, true);\n\n return $this;\n }",
"public function toString()\n {\n return 'Gift Code Patterns Grid display match columns and message';\n }",
"public function formatTrailLocationsInfo() {\n $allTrailObjectsInfo = $this -> getAllTrailLocationInfo();\n $formattedTrailLocationInfo = \"\";\n\n foreach ($allTrailObjectsInfo as $trailObjectInfo) {\n $formattedTrailLocationInfo .= '<div style=\"margin-top: 4%;\" class=\"locationContainer col-xs-12 col-sm-6 col-md-6 col-lg-6\"><div id=\"\"><div class=\"locationInfo\"><p class=\"locationDescription\">'\n . $trailObjectInfo -> getLineColor() . '</p><p style=\"text-align: left;\" class=\"locationName\">'\n . $trailObjectInfo -> getName()\n . '</p><img src=\"' . $trailObjectInfo -> getImageLocation() . '\" alt=\"' . $trailObjectInfo -> getImageDescription() . '\">'\n . '</p><p style=\"text-align: left;\" class=\"locationDescription\">Address: '\n . $trailObjectInfo -> getAddress() . \",\"\n . $trailObjectInfo -> getCity() . \" \"\n . $trailObjectInfo -> getState() . \" \"\n . $trailObjectInfo -> getZipcode() . '</p><p style=\"text-align: left;\" class=\"locationDescription\">'\n . $trailObjectInfo -> getDescription() . '</p><a href=\"'\n . $trailObjectInfo -> getUrl() . '\" class=\"btn locationURL\" role=\"button\">Visit Site</a><hr class=\"style17\"></div></div></div>';\n };\n\n\n return $formattedTrailLocationInfo;\n }",
"public function getDestinationDisplay()\n {\n return $this->destinationDisplay;\n }",
"public function getDestinationDisplay()\n {\n return $this->destinationDisplay;\n }",
"public function toString()\n {\n return 'Gift code grid field display match target';\n }",
"public function getDisplayValue();",
"public function renderLdap()\n {\n return '(' . $this->column . $this->operator . $this->value . ')';\n }",
"public function getPathDisplay()\n {\n return $this->path_display;\n }",
"public function getAdminColumns()\n {\n return $this->displayConfiguration;\n }",
"public function toString()\n {\n return 'Location is mapped respect warehouse';\n }",
"public function getDisplay() {\n if ($this->display_in_shop) return \"Ja\";\n return \"Nei\";\n }",
"public function getDisplayPatterns() : array\n {\n return $this->displayPatterns;\n }",
"public function getDisplay()\n {\n return $this->display;\n }",
"public function getDisplay()\n {\n return $this->display;\n }",
"public function getDisplay()\n {\n return $this->display;\n }",
"function rules_table_header() {\n global $color, $displaymodes;\n $out = '\n <table id=\"avelsieve_rules_table\" cellpadding=\"3\" cellspacing=\"2\" border=\"0\" align=\"center\" width=\"97%\" frame=\"box\">\n <tr bgcolor=\"'.$color[0].'\">\n <td style=\"white-space:nowrap\" valign=\"middle\">';\n \n $out .= _(\"No\") . '</td><td></td><td class=\"avelsieve_controls\" valign=\"middle\">'. _(\"Options\").'</td>'.\n '<td>'. _(\"Description of Rule\").\n ' <small>(' . _(\"Display as:\");\n \n foreach($displaymodes as $id=>$info) {\n if($this->mode == $id) {\n $out .= ' <strong><span title=\"'.$info[1].'\">'.$info[0].'</span></strong>';\n } else {\n $out .= ' <a href=\"'.$_SERVER['SCRIPT_NAME'].'?mode='.$id.'\" title=\"'.$info[1].'\">'.$info[0].'</a>';\n }\n }\n $out .= ')</small>'.\n '</td><td style=\"white-space:nowrap;\">'. _(\"Position\") .'</td>'.\n \"</td></tr>\\n\";\n return $out;\n }",
"public function getDisplay()\r\n\t{\r\n\t\treturn $this->display;\r\n\t}",
"public function getDisplayLogicClasses() {\n return $this->display_logic_classes;\n }",
"function makeLocationList() {\n\t\n\t\t$res = $this->query(\n\t\t\t\"SELECT \n\t\t\t\t$this->table_locations_field_id as id,\n\t\t\t\t$this->table_locations_field_caption as caption\n\t\t\tFROM \n\t\t\t\t$this->table_locations\"\n\t\t);\n\t\t\n\t\t$r = \"<ul id='location_list_ul'>\\n\";\n\t\twhile ($row = $res->fetch_assoc()) {\n\t\t\t$id = $row['id'];\t\t\t\n\t\t\t$r .= \"\n\t\t\t<li>\n\t\t\t\t<div id='location_$id'>\n\t\t\t\t\t\".$this->makeLocation($row).\"\n\t\t\t\t</div>\n\t\t\t</li>\\n\";\n\t\t\t\n\t\t}\n\t\t$r .= \"</ul>\\n\";\n\t\treturn $r;\n\t}",
"public function getHtml()\n {\n\n $this->_processUrl();\n switch($this->csType)\n {\n case CONST_POSITION_TYPE_PLACEMENT:\n\n switch($this->csAction)\n {\n case CONST_ACTION_LIST:\n return $this->_getPlacementList();\n break;\n\n case CONST_ACTION_ADD:\n $asData = $this->addPlacement($this->cnPk);\n return $asData['data'];\n break;\n\n case CONST_ACTION_DOWNLOAD:\n return $this->export_placements();\n break;\n }\n break;\n\n default:\n switch($this->csAction)\n {\n case CONST_ACTION_LIST:\n return $this->_getPositionList();\n break;\n\n case CONST_ACTION_VIEW:\n $asData = $this->_viewPosition($this->cnPk);\n return $asData['data'];\n break;\n }\n }\n return '';\n }",
"function acfe_render_field_group_locations_html($field_group){\n \n foreach($field_group['location'] as $groups){\n \n $html = acfe_get_locations_array($groups);\n \n if($html){\n \n $array = array();\n \n foreach($html as $location){\n \n $array[] = $location['html'];\n \n }\n \n echo implode(' ', $array);\n \n }\n \n }\n \n}",
"public function getDisplayValues()\n {\n return $this->displayValues;\n }",
"function cfs_column_content( $column_name, $post_id ) {\n if ( 'placement' == $column_name ) {\n global $wpdb;\n\n $labels = array(\n 'post_types' => __( 'Post Types', 'cfs' ),\n 'user_roles' => __( 'User Roles', 'cfs' ),\n 'post_ids' => __( 'Posts', 'cfs' ),\n 'term_ids' => __( 'Term IDs', 'cfs' ),\n 'page_templates' => __( 'Page Templates', 'cfs' ),\n 'post_formats' => __( 'Post Formats', 'cfs' )\n );\n\n $field_groups = CFS()->field_group->load_field_groups();\n\n // Make sure the field group exists\n $rules = array();\n if ( isset( $field_groups[ $post_id ] ) ) {\n $rules = $field_groups[ $post_id ]['rules'];\n }\n\n foreach ( $rules as $criteria => $data ) {\n $label = $labels[ $criteria ];\n $values = $data['values'];\n $operator = ( '==' == $data['operator'] ) ? '=' : '!=';\n\n // Get post titles\n if ( 'post_ids' == $criteria ) {\n $temp = array();\n foreach ( $values as $val ) {\n $temp[] = get_the_title( (int) $val );\n }\n $values = $temp;\n }\n\n echo \"<div><strong>$label</strong> \" . $operator . ' ' . implode( ', ', $values ) . '</div>';\n }\n }\n }",
"public function toString() {\r\n\t\t$output = '';\r\n\t\tforeach ($this->_rulesets as $ruleset) {\r\n\t\t\t//$output .= implode(', ', $ruleset->selectors()) . \" { \" . $ruleset->rules() . \" }\\n\";\r\n\t\t\t$output .= $ruleset->declaration();\r\n\t\t\tif ($ruleset->rules()) {\r\n\t\t\t\t$output .= \" { \" . $ruleset->rules() . \" }\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $output;\r\n\t}",
"public function getDisplayNameAttribute(): string\n {\n $cleaned = strtolower(Str::replace('_', ' ', $this->name));\n\n preg_match(\n '/((left|right|tail|top|bottom|front|mid_|lower|upper|back|rear)_?)+/',\n strtolower($this->name),\n $matches\n );\n\n if (isset($matches[0]) && $matches[0] !== strtolower($this->name)) {\n $name = trim(str_replace('_', ' ', str_replace($matches[0], '', strtolower($this->name))));\n $position = trim(str_replace('_', ' ', $matches[0]));\n\n return Str::ucfirst(sprintf('%s (%s)', $name, $position));\n }\n\n return Str::ucfirst($cleaned);\n }",
"public static function default_display_format() {\n\n\t\treturn '{{line_1}}\n{{line_2}}\n{{postal_code}} {{city}}\n{{region}}\n{{country}}';\n\t}",
"protected function _getLocations()\n {\n $filter = new P4Cms_Record_Filter;\n $filter->add('showInContentForm', '1');\n \n return P4Cms_Menu::fetchMixed(array('filter' => $filter));\n }"
] | [
"0.53343964",
"0.5298934",
"0.52551913",
"0.5184411",
"0.51455635",
"0.51289266",
"0.51289266",
"0.51019466",
"0.5071749",
"0.5070745",
"0.5037369",
"0.50365865",
"0.50300324",
"0.5028386",
"0.5004919",
"0.498214",
"0.498214",
"0.498214",
"0.49234495",
"0.48898742",
"0.48786962",
"0.48412028",
"0.47967437",
"0.47958",
"0.47923732",
"0.47780433",
"0.47593865",
"0.47465396",
"0.4744327",
"0.4716754"
] | 0.6922305 | 0 |
Remove astra setting meta box | public function remove_astra_meta_box() {
remove_meta_box( 'astra_settings_meta_box', ASTRA_ADVANCED_HOOKS_POST_TYPE, 'side' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show_remove_metaboxes( $_genesis_admin_settings ) {\n\n\tremove_meta_box( 'genesis-theme-settings-header', $_genesis_admin_settings, 'main' );\n\n}",
"function make_makerspaces_remove_metaboxes( $_genesis_admin_settings ) {\n\n\tremove_meta_box( 'genesis-theme-settings-header', $_genesis_admin_settings, 'main' );\n\tremove_meta_box( 'genesis-theme-settings-nav', $_genesis_admin_settings, 'main' );\n\n}",
"function ws_default_meta_boxes() {\r\n\tremove_meta_box( 'slugdiv', 'block', 'normal' );\r\n}",
"function my_remove_meta_box_page() {\n // Custom Fields\n remove_meta_box('postcustom', 'page', 'normal');\n // Discussion\n remove_meta_box('commentsdiv' , 'page', 'normal');\n // Comments\n remove_meta_box('commentstatusdiv', 'page', 'normal');\n // Revisions\n remove_meta_box('revisionsdiv', 'page', 'normal');\n // Author\n remove_meta_box('authordiv', 'page', 'normal');\n // Page Attributes\n //remove_meta_box( pageparentdiv ,'page', 'normal');\n // Publish\n //remove_meta_box( submitdiv ,'page', 'normal'); \n remove_meta_box('slugdiv', 'page', 'normal'); // Slug Metabox\n}",
"public function remove_meta_boxes()\n {\n if ( wp_get_theme() == 'Thesis' ) :\n remove_meta_box( 'thesis_meta_keywords', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_meta_robots', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_canonical_link', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_html_body', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_meta_description', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_post_content', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_post_image', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_post_thumbnail', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_redirect', 'mtp_ad', 'normal' );\n remove_meta_box( 'thesis_title_tag', 'mtp_ad', 'normal' );\n endif;\n }",
"public static function remove_publish_meta_box() {\n\t\tremove_meta_box( 'submitdiv', self::POST_TYPE_SLUG, 'side' );\n\t}",
"function rfztd_remove_dashboard_widget() {\r\n\tremove_meta_box('dashboard_primary', 'dashboard','post_container_1');\r\n\t//do sth\r\n}",
"function remove_dashboard_meta() {\n remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); //Removes the 'incoming links' widget\n remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); //Removes the 'plugins' widget\n remove_meta_box('dashboard_primary', 'dashboard', 'normal'); //Removes the 'WordPress News' widget\n remove_meta_box('dashboard_secondary', 'dashboard', 'normal'); //Removes the secondary widget\n remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); //Removes the 'Quick Draft' widget\n remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); //Removes the 'Recent Drafts' widget\n remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); //Removes the 'Activity' widget\n remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); //Removes the 'At a Glance' widget\n remove_meta_box('dashboard_activity', 'dashboard', 'normal'); //Removes the 'Activity' widget (since 3.8)\n remove_meta_box('rg_forms_dashboard', 'dashboard', 'normal'); //Removes the 'Activity' widget (since 3.8)\n\tremove_meta_box('e-dashboard-overview', 'dashboard', 'normal'); // Removes the Elementor widget\n\tremove_meta_box('dce-dashboard-overview', 'dashboard', 'normal'); // Removes the Dynamic Content OOO widget\n remove_action('admin_notices', 'update_nag');\n}",
"function unamuno_remove_dashboard_meta() {\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // quick press\n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); // links\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); // right now\n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); // plugins\n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); // recent drafts\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); // recent comments\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // wordpress blog\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' ); // other news since 3.8\n remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal' ); // Site Health\n remove_meta_box( 'gf_forms_dashboard', 'dashboard', 'normal');\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');\n }",
"function my_remove_meta_box_post() {\n remove_meta_box('slugdiv', 'post', 'normal');\n remove_meta_box('sqpt-meta-tags', 'post', 'normal');\n // Custom Fields\n remove_meta_box('postcustom', 'post', 'normal');\n // Excerpt\n //remove_meta_box('postexcerpt' , 'post' , 'normal' );\n // Trackbacks\n remove_meta_box('trackbacksdiv', 'post', 'normal');\n // Discussion\n remove_meta_box('commentstatusdiv', 'post', 'normal');\n remove_meta_box('commentsdiv', 'post', 'normal');\n // Revisions\n //remove_meta_box('revisionsdiv' , 'post' , 'normal' );\n // Author\n remove_meta_box('authordiv', 'post', 'normal');\n // Categories\n //remove_meta_box('categorydiv' , 'post' , 'normal' );\n // Tags\n remove_meta_box('tagsdiv-post_tag', 'post', 'normal');\n // Publish\n //remove_meta_box('submitdiv', 'post', 'normal' ); \n remove_meta_box('content-permissions-meta-box', 'page', 'advanced' ); \n \n}",
"function dp_remove_genesis_metaboxes( $_genesis_theme_settings_pagehook ) {\n\t//remove_meta_box( 'genesis-theme-settings-version', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-style-selector', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-feeds', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-layout', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-header', $_genesis_theme_settings_pagehook, 'main' );\n\tremove_meta_box( 'genesis-theme-settings-nav', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-breadcrumb', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-comments', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-posts', $_genesis_theme_settings_pagehook, 'main' );\n\tremove_meta_box( 'genesis-theme-settings-blogpage', $_genesis_theme_settings_pagehook, 'main' );\n\t//remove_meta_box( 'genesis-theme-settings-scripts', $_genesis_theme_settings_pagehook, 'main' );\n}",
"function remove_dashboard_meta()\n{\n\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); //Removes the 'incoming links' widget\n\tremove_meta_box('dashboard_plugins', 'dashboard', 'normal'); //Removes the 'plugins' widget\n\tremove_meta_box('dashboard_primary', 'dashboard', 'normal'); //Removes the 'WordPress News' widget\n\tremove_meta_box('dashboard_secondary', 'dashboard', 'normal'); //Removes the secondary widget\n\tremove_meta_box('dashboard_quick_press', 'dashboard', 'side'); //Removes the 'Quick Draft' widget\n\tremove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); //Removes the 'Recent Drafts' widget\n\tremove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); //Removes the 'Activity' widget\n\tremove_meta_box('dashboard_right_now', 'dashboard', 'normal'); //Removes the 'At a Glance' widget\n\tremove_meta_box('dashboard_activity', 'dashboard', 'normal'); //Removes the 'Activity' widget (since 3.8)\n\tremove_meta_box('rg_forms_dashboard', 'dashboard', 'normal'); //Removes the 'Activity' widget (since 3.8)\n\tremove_meta_box('dashboard_site_health', 'dashboard', 'normal'); //Removes the 'Activity' widget (since 3.8)\n\tremove_action('admin_notices', 'update_nag');\n}",
"function remove_radio_category_boxes() {\n remove_meta_box( 'example_radio_category'.'div' , 'example_post' , 'normal' ); \n}",
"function flei_remove_meta_boxes()\n{\n // remove taxonomy meta box for my_expertise b/c for attachment this has to be done through ACF\n remove_meta_box('custom-post-type-onomies-my_expertise', 'attachment', 'normal');\n}",
"function customize_meta_boxes() {\r\n /* Removes meta boxes from pages */\r\n remove_meta_box('postcustom','page','normal'); // custom fields metabox\r\n remove_meta_box('trackbacksdiv','page','normal'); // trackbacks metabox\r\n}",
"function bsg_remove_genesis_theme_metaboxes( $hook ) {\r\n /** Theme Settings metaboxes */\r\n //remove_meta_box( 'genesis-theme-settings-version', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-feeds', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-layout', $hook, 'main' );\r\n remove_meta_box( 'genesis-theme-settings-header', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-nav', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-breadcrumb', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-comments', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-posts', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-blogpage', $hook, 'main' );\r\n //remove_meta_box( 'genesis-theme-settings-scripts', $hook, 'main' );\r\n\r\n /** SEO Settings metaboxes */\r\n //remove_meta_box( 'genesis-seo-settings-doctitle', $hook, 'main' );\r\n //remove_meta_box( 'genesis-seo-settings-homepage', $hook, 'main' );\r\n //remove_meta_box( 'genesis-seo-settings-dochead', $hook, 'main' );\r\n //remove_meta_box( 'genesis-seo-settings-robots', $hook, 'main' );\r\n //remove_meta_box( 'genesis-seo-settings-archives', $hook, 'main' );\r\n}",
"function remove_dashboard_widgets() {\r\n\tremove_meta_box( 'arve_dashboard_widget', 'dashboard', 'normal' );\r\n}",
"function beautiful_remove_entry_meta() {\n\tif ( ! is_single() ) {\n\t\tremove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );\n\t\tremove_action( 'genesis_entry_footer', 'genesis_post_meta' );\n\t\tremove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );\n\t}\n\n}",
"function una_remove_post_dash_boxes() {\n remove_meta_box( 'postcustom' , 'post' , 'normal');\n remove_meta_box( 'commentstatusdiv', 'post', 'normal' );\n remove_meta_box( 'commentsdiv', 'post', 'normal' );\n remove_meta_box( 'authordiv' , 'post' , 'normal' );\n remove_meta_box( 'trackbacksdiv' , 'post' , 'normal' );\n }",
"public function delete_meta() {\n\t\t\tdelete_metadata( 'user', null, 'tgmpa_dismissed_notice_wpex_theme', null, true );\n\t\t}",
"function remove_ad_unit_group_meta_box() {\n remove_meta_box('lw_ad_unit_groupdiv', 'lw_ad_unit', 'normal');\n }",
"function dwwp_remove_dashboard() {\n\t//id, page, context\n\tremove_meta_box('dashboard_primary','dashboard','side');\n}",
"function cfcpt_clear_meta_boxes() {\n\t\tglobal $wp_meta_boxes;\t\t\n\t\t$allowed_boxes = apply_filters('cfcpt_allowed_meta_boxes',array(\n\t\t\t'submitdiv',\n\t\t\t'tagsdiv',\n\t\t\t'postexcerpt',\n\t\t\t'revisionsdiv'\n\t\t));\n\n\t\tforeach($wp_meta_boxes['post-welcome'] as $group_id => $group) {\n\t\t\tforeach($group as $priority_id => $priority) {\t\t\t\t\n\t\t\t\tforeach($priority as $id => $box) {\n\t\t\t\t\tif(!in_array($id, $allowed_boxes)) {\n\t\t\t\t\t\tunset($wp_meta_boxes['post-welcome'][$group_id][$priority_id][$id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($wp_meta_boxes['post-learn-more'] as $group_id => $group) {\n\t\t\tforeach($group as $priority_id => $priority) {\t\t\t\t\n\t\t\t\tforeach($priority as $id => $box) {\n\t\t\t\t\tif(!in_array($id, $allowed_boxes)) {\n\t\t\t\t\t\tunset($wp_meta_boxes['post-learn-more'][$group_id][$priority_id][$id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function tts_remove_dashboard_widget() {\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n}",
"function eas_remove() {\r\ndelete_option('eas_data');\r\n}",
"function remove_dashboard_widgets(){\r\n\r\n //remove_meta_box('dashboard_right_now','dashboard','core'); // right now overview box\r\n remove_meta_box('dashboard_incoming_links','dashboard','core'); // incoming links box\r\n remove_meta_box('dashboard_quick_press','dashboard','core'); // quick press box\r\n remove_meta_box('dashboard_plugins','dashboard','core'); // new plugins box\r\n remove_meta_box('dashboard_recent_drafts','dashboard','core'); // recent drafts box\r\n remove_meta_box('dashboard_primary','dashboard','core'); // wordpress development blog box\r\n remove_meta_box('dashboard_secondary','dashboard','core'); // other wordpress news box\r\n\r\n\r\n}",
"function snippet_metaboxes() {\n remove_meta_box('relevanssi_hidebox', $this->post_type_name, 'advanced' );\n // Remove category metabox (temporarily)\n remove_meta_box( 'snippet_categoriesdiv', $this->post_type_name, 'side' );\n // Add shortcode metabox\n add_meta_box( 'dw_snippet_shortcode', \"Snippet Shortcode\", array($this, 'snippet_shortcode_metabox_callback'), $this->post_type_name, 'side','core');\n // Add back category metabox\n add_meta_box ('snippet_categoriesdiv',\"Snippet Categories\",'post_categories_meta_box',$this->post_type_name,'side','default',array('taxonomy' => 'snippet_categories'));\n }",
"function tend_remove_dashboard_meta_boxes() {\n\tglobal $wp_meta_boxes;\n\t// Dashboard core widgets :: Left Column\n\tunset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] );\n\tunset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] );\n\tunset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] );\n\tunset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );\n\tunset( $wp_meta_boxes['dashboard']['normal']['core']['pb_backupbuddy_stats'] );\n\tunset( $wp_meta_boxes['dashboard']['normal']['core']['bruteprotect_dashboard_widget'] );\n\n\t// Additional dashboard core widgets :: Right Column\n\tunset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts'] );\n\tunset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] );\n\tunset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] );\n\tunset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] );\n\t// Remove the welcome panel\n\tupdate_user_meta( get_current_user_id(), 'show_welcome_panel', false );\n}",
"function front_meta_settings() {\n global $post;\n $frontpage_id = get_option('page_on_front');\n if($post->ID == $frontpage_id):\n remove_post_type_support(\n 'page',\n 'editor'\n );\n remove_meta_box(\n 'pageparentdiv',\n 'page',\n 'side'\n );\n add_meta_box(\n 'Warning',\n 'Front Page Warning:',\n 'warning_meta_callback',\n 'page',\n 'normal',\n 'core'\n );\n endif;\n}",
"function una_remove_page_dash_boxes() {\n \tremove_meta_box( 'commentstatusdiv' , 'page' , 'normal' );\n remove_meta_box( 'postcustom' , 'page' , 'normal');\n \tremove_meta_box( 'commentsdiv' , 'page' , 'normal' );\n \tremove_meta_box( 'authordiv' , 'page' , 'normal' );\n }"
] | [
"0.77073795",
"0.7521233",
"0.7492601",
"0.71835154",
"0.7169586",
"0.71333134",
"0.7074117",
"0.7055504",
"0.7044032",
"0.70212007",
"0.6964498",
"0.68788445",
"0.68678594",
"0.68548244",
"0.68298846",
"0.671719",
"0.6697792",
"0.66967094",
"0.66667634",
"0.66652036",
"0.6662983",
"0.6662812",
"0.6634802",
"0.6606301",
"0.65814656",
"0.6575342",
"0.65380263",
"0.6507676",
"0.6501146",
"0.64880764"
] | 0.8437249 | 0 |
Create Astra Advanced Hooks custom post type | public function advanced_hooks_post_type() {
$labels = array(
'name' => esc_html_x( 'Custom Layouts', 'advanced-hooks general name', 'astra-addon' ),
'singular_name' => esc_html_x( 'Custom Layout', 'advanced-hooks singular name', 'astra-addon' ),
'search_items' => esc_html__( 'Search Custom Layouts', 'astra-addon' ),
'all_items' => esc_html__( 'All Custom Layouts', 'astra-addon' ),
'edit_item' => esc_html__( 'Edit Custom Layout', 'astra-addon' ),
'view_item' => esc_html__( 'View Custom Layout', 'astra-addon' ),
'add_new' => esc_html__( 'Add New', 'astra-addon' ),
'update_item' => esc_html__( 'Update Custom Layout', 'astra-addon' ),
'add_new_item' => esc_html__( 'Add New', 'astra-addon' ),
'new_item_name' => esc_html__( 'New Custom Layout Name', 'astra-addon' ),
);
$rest_support = true;
// Rest support false if it is a old post with post meta code_editor set.
if ( isset( $_GET['code_editor'] ) || ( isset( $_GET['post'] ) && 'code_editor' === get_post_meta( $_GET['post'], 'editor_type', true ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$rest_support = false;
}
// Rest support true if it is a WordPress editor.
if ( isset( $_GET['wordpress_editor'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$rest_support = true;
}
$args = array(
'labels' => $labels,
'show_in_menu' => false,
'public' => true,
'show_ui' => true,
'query_var' => true,
'can_export' => true,
'show_in_admin_bar' => true,
'exclude_from_search' => true,
'show_in_rest' => $rest_support,
'supports' => apply_filters( 'astra_advanced_hooks_supports', array( 'title', 'editor', 'elementor', 'custom-fields' ) ),
'rewrite' => array( 'slug' => apply_filters( 'astra_advanced_hooks_rewrite_slug', 'astra-advanced-hook' ) ),
);
register_post_type( ASTRA_ADVANCED_HOOKS_POST_TYPE, apply_filters( 'astra_advanced_hooks_post_type_args', $args ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_thoughtmesh_essay() {\n register_post_type( 'thoughtmesh_essays',\n array(\n 'labels' => array(\n 'name' => 'Thoughtmesh Essays',\n 'singular_name' => 'Thoughtmesh Essay',\n 'add_new' => 'Add Essay',\n 'add_new_item' => 'Add New Thoughtmesh Essay',\n 'edit' => 'Edit',\n 'edit_item' => 'Edit Thoughtmesh Essay',\n 'new_item' => 'New Thoughtmesh Essay',\n 'view' => 'View',\n 'view_item' => 'View Thoughtmesh Essay',\n 'search_items' => 'Search Thoughtmesh Essays',\n 'not_found' => 'No Thoughtmesh Essays found',\n 'not_found_in_trash' => 'No Thoughtmesh Essays found in Trash',\n 'parent' => 'Parent Thoughtmesh Essay'\n ),\n \n 'public' => true,\n 'menu_position' => 15,\n 'show_in_menu' => true,\n 'show_in_admin_bar' => true,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'revisions', 'comments', 'thumbnail', 'tags' ),\n 'taxonomies' => array( 'thoughtmesh_tag' ),\n 'menu_icon' => plugins_url( 'images/image.png', __FILE__ ),\n 'has_archive' => true\n )\n );\n}",
"private function hooks(){\n $popups = $this->arg( 'post_type' );\n $audience = $this->arg( 'post_type_audience' );\n add_action( 'init', array( $this, 'create_post_types' ) );\n add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );\n add_action( 'wp_loaded', array( $this, 'register_popups' ) );\n add_shortcode( 'mpp_popup', array( $this, 'trigger_popup' ) );\n add_shortcode( 'mpp_inline', array( $this, 'inline_popup' ) );\n add_action( 'admin_notices', array( $this, 'create_top_bar' ), 1 );\n add_action( 'admin_notices', array( $this, 'show_message_to_activate_plugin' ) );\n add_action( 'admin_notices', array( $this, 'check_version' ) );\n\n add_filter( \"manage_edit-{$popups}_columns\", array( $this, 'set_columns_popups' ) );\n add_action( \"manage_{$popups}_posts_custom_column\", array( $this, 'set_content_columns_popups' ), 10, 2 );\n add_action( \"post_row_actions\", array( $this, 'add_duplicate_popup_link' ), 10, 2 );\n\n add_filter( \"manage_edit-{$audience}_columns\", array( $this, 'set_columns_audience' ) );\n add_action( \"manage_{$audience}_posts_custom_column\", array( $this, 'set_content_columns_audience' ), 10, 2 );\n\n }",
"function ahead_post_types(){\n\n\n// register aotw post types\n register_post_type('ahead_post_type',\n array('labels' => array(\n 'name' => 'Ahead Post Type',\n 'menu_name' => 'Ahead Posts'),\n 'singular_label' => 'Ahead Post Type',\n 'public' => true,\n 'show_ui' =>true,\n 'capability_type' => 'post',\n 'has_archive' => true,\n 'hierarchical' => false,\n 'show_in_menu' => true,\n 'supports'=>\n array('title','thumbnail')\n )\n );\n}",
"function gt_lead_post_type(){\r\n register_post_type('Lead Generation',\r\n array(\r\n 'rewrite' => array('slug' => 'lead_generation'),\r\n 'labels' => array(\r\n 'name' => 'Lead Generation',\r\n 'singular_name' => 'Lead Generation',\r\n 'add_new_item' => 'Add New Lead Generation',\r\n 'edit_item' => 'Edit Lead Generation'\r\n ),\r\n 'menu-icon' => 'dashicons-admin-customizer',\r\n 'public' => true,\r\n 'has_archive' => true,\r\n 'supports' => array(\r\n 'title', 'thumbnail', 'editor', 'excerpt', 'comments'\r\n )\r\n )\r\n );\r\n}",
"function custom_cta_init() {\n $args = array(\n 'label' => 'Custom CTAs',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'page',\n 'hierarchical' => false,\n 'rewrite' => array('slug'=>'custom_cta'),\n 'query_var' => true,\n 'menu_icon' => 'dashicons-megaphone',\n 'supports' => array(\n 'title',\n 'editor'\n )\n );\n register_post_type( 'custom_cta', $args );\n}",
"public function register_meta_settings() {\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-layout',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => true,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Register Meta for Header Hook.\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-header',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'default' => array( 'sticky-header-on-devices' => 'desktop' ),\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'sticky' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'shrink' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'sticky-header-on-devices' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t\t// Register Meta for Footer Hook.\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-footer',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'default' => array( 'sticky-footer-on-devices' => 'desktop' ),\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'sticky' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'sticky-footer-on-devices' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t\t// Register Meta for 404-page.\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-404-page',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'disable_header' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'disable_footer' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t\t// Register Meta for Time Duration.\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-time-duration',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'start-dt' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'end-dt' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t\t// Register Meta for content position.\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-content',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'default' => array( 'location' => 'after_blocks' ),\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'location' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'after_block_number' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'before_heading_number' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-action',\n\t\t\t\tarray(\n\t\t\t\t\t'show_in_rest' => true,\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-priority',\n\t\t\t\tarray(\n\t\t\t\t\t'show_in_rest' => true,\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-custom-hook',\n\t\t\t\tarray(\n\t\t\t\t\t'show_in_rest' => true,\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Register Meta for Action Hook padding.\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-padding',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'top' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'bottom' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-location',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t'rule' => array(),\n\t\t\t\t\t\t'specific' => array(),\n\t\t\t\t\t\t'specificText' => array(),\n\t\t\t\t\t),\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'rule' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'specific' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'specificText' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'array',\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\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-exclusion',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t'rule' => array(),\n\t\t\t\t\t\t'specific' => array(),\n\t\t\t\t\t\t'specificText' => array(),\n\t\t\t\t\t),\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t'rule' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'specific' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'specificText' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'array',\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\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-hook-users',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t\t// Register Meta for responsive visibility.\n\t\t\tregister_post_meta(\n\t\t\t\tASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'ast-advanced-display-device',\n\t\t\t\tarray(\n\t\t\t\t\t'single' => true,\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'auth_callback' => '__return_true',\n\t\t\t\t\t'default' => array( 'desktop', 'mobile', 'tablet' ),\n\t\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\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\n\t\t}",
"public static function add_hooks() {\n\t\tadd_action( 'init', array( __CLASS__, 'register_legacy_post_type' ) );\n\t\tadd_action( 'admin_init', array( __CLASS__, 'do_migration' ) );\n\n\t\tinclude_once( dirname( __FILE__ ) . '/custom-css.php' );\n\t\tif ( ! is_admin() ) {\n\t\t\tadd_action( 'init', array( 'Jetpack_Custom_CSS', 'init' ) );\n\t\t}\n\t}",
"function codex_historia_init() {\n $labels = array(\n 'name' => _x('Historia', 'post type general name'),\n 'singular_name' => _x('Historia', 'post type singular name'),\n 'add_new' => _x('Add New', 'historia'),\n 'add_new_item' => __('Add New Historia'),\n 'edit_item' => __('Edit Historia'),\n 'new_item' => __('New Historia'),\n 'all_items' => __('All Historia'),\n 'view_item' => __('View Historia'),\n 'search_items' => __('Search Historia'),\n 'not_found' => __('No historia found'),\n 'not_found_in_trash' => __('No historia found in Trash'), \n 'parent_item_colon' => '',\n 'menu_name' => __('Historia')\n\n );\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true, \n 'show_in_menu' => true, \n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'has_archive' => true, \n 'hierarchical' => false,\n 'menu_position' => null,\n 'supports' => array( 'title', 'editor', 'thumbnail' )\n ); \n register_post_type('historia',$args);\n}",
"public function set_hooks()\n\t{\n\t\tadd_action('init', 'register_tlc_post_types');\n\t\tadd_action('generate_rewrite_rules', 'register_tlc_rewrite_rules');\n\t\tadd_filter(\"rest_prepare_services\", 'tlc_rest_prepare_post', 10, 3);\n\t\tadd_filter(\"rest_prepare_events\", 'tlc_rest_prepare_post', 10, 3);\n\t\tadd_filter(\"rest_prepare_page\", 'tlc_rest_prepare_post', 10, 3);\n\t}",
"function wf_register_extra_option_post_type() {\n $labels = array(\n 'name' => esc_html_x( 'Extra Options', 'Post type general name', 'woofood-pugin' ),\n 'singular_name' => esc_html_x( 'Extra Option', 'Post type singular name', 'woofood-plugin' ),\n 'menu_name' => esc_html_x( 'Extra Options', 'Admin Menu text', 'woofood-plugin' ),\n 'name_admin_bar' => esc_html_x( 'Extra Option', 'Add New on Toolbar', 'woofood-plugin' ),\n 'add_new' => esc_html__( 'Add Extra Option', 'woofood-plugin' ),\n 'add_new_item' => esc_html__( 'Add New Extra Option', 'woofood-plugin' ),\n 'new_item' => esc_html__( 'New Extra Option', 'woofood-plugin' ),\n 'edit_item' => esc_html__( 'Edit Extra Option', 'woofood-plugin' ),\n 'view_item' => esc_html__( 'View Extra Option', 'woofood-plugin' ),\n 'all_items' => esc_html__( 'All Extra Options', 'woofood-plugin' ),\n 'search_items' => esc_html__( 'Search Extra Options', 'woofood-plugin' ),\n 'parent_item_colon' => esc_html__( 'Parent Extra Options:', 'woofood-plugin' ),\n 'not_found' => esc_html__( 'No Extra Options found.', 'woofood-plugin' ),\n 'not_found_in_trash' => esc_html__( 'No Extra Options found in Trash.', 'woofood-plugin' ),\n 'featured_image' => esc_html_x( 'Extra Option Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'woofood-plugin' ),\n 'set_featured_image' => esc_html_x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'woofood-plugin' ),\n 'remove_featured_image' => esc_html_x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'woofood-plugin' ),\n 'use_featured_image' => esc_html_x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'woofood-plugin' ),\n 'archives' => esc_html_x( 'Extra Option archives', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'woofood-plugin' ),\n 'insert_into_item' => esc_html_x( 'Insert into Extra Option', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'woofood-plugin' ),\n 'uploaded_to_this_item' => esc_html_x( 'Uploaded to this Extra Option', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'woofood-plugin' ),\n 'filter_items_list' => esc_html_x( 'Filter books list', 'Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. Added in 4.4', 'woofood-plugin' ),\n 'items_list_navigation' => esc_html_x( 'Extra Options list navigation', 'Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. Added in 4.4', 'woofood-plugin' ),\n 'items_list' => esc_html_x( 'Extra Options list', 'Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. Added in 4.4', 'woofood-plugin' ),\n );\n \n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => false,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'extra_option' ),\n 'capability_type' => array('extra_option','extra_options' ),\n \n 'map_meta_cap' => true,\n\n 'has_archive' => true,\n 'hierarchical' => true,\n 'menu_position' => null,\n //'menu_icon' => get_template_directory_uri().'/icons/woofood_logo_black/res/mipmap-mdpi/woofood_logo_black.png',\n 'taxonomies' => array('product_cat', 'extra_option_categories'),\n 'supports' => array( 'title' ),\n //'show_in_menu' =>'edit.php?post_type=extra_option',\n );\n \n register_post_type( 'extra_option', $args );\n}",
"function dx_custom_post_types() {\r\n\t\tadd_action('init', array( &$this, 'dx_custom_post_types_callback' ));\r\n\t}",
"function web_post_type(){\r\n register_post_type('Web Development',\r\n array(\r\n 'rewrite' => array('slug' => 'Web Development'),\r\n 'labels' => array(\r\n 'name' => 'Web Development',\r\n 'singular_name' => 'Web Development',\r\n 'add_new_item' => 'Add New Web Development',\r\n 'edit_item' => 'Edit Web Development'\r\n ),\r\n 'menu-icon' => 'dashicons-editor-removeformatting',\r\n 'public' => true,\r\n 'has_archive' => true,\r\n 'supports' => array(\r\n 'title', 'thumbnail', 'editor', 'excerpt', 'comments'\r\n )\r\n )\r\n );\r\n}",
"private function hooks() {\r\n\r\n \tglobal $wpr_woo_giftcard_settings;\r\n\t\t$wpr_woo_giftcard_settings = get_option( 'wpr_wg_options' );\r\n\r\n\t\tadd_action( 'init', array( $this, 'rpgc_create_post_type' ) );\r\n\t\tadd_filter( 'woocommerce_get_settings_pages', array( $this, 'rpgc_add_settings_page'), 10, 1);\r\n\t\tadd_action( 'enqueue_scripts', array( $this, 'load_styes' ) );\r\n\r\n\t\tif ( ! class_exists( 'WooCommerce' ) )\r\n\t\t\tadd_action( 'admin_notices', array( $this, 'no_woo_nag' ) );\r\n\r\n\t\tif( is_admin() ) {\r\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'load_custom_scripts' ), 99 );\r\n\t\t\t\t\r\n\t\t}\r\n\r\n\r\n }",
"public function ewp_post_type_fields_creation()\n {\n return apply_filters(\n 'ewp_post_type_fields_creation_filter',\n array(\n 'post_name' => array(\n 'label' => __('Post label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'class' => array('awm-lowercase'),\n 'attributes' => array('title' => 'English only!', 'pattern' => '[\\x00-\\x7F]+'),\n 'label_class' => array('awm-needed'),\n ),\n 'plural' => array(\n 'label' => __('Name plural', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'singular' => array(\n 'label' => __('Name singular', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'prefix' => array(\n 'label' => __('Registration prefix', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text'\n ),\n 'gallery' => array(\n 'label' => __('Has gallery', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox'\n ),\n 'custom_template' => array(\n 'label' => __('Is public', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n 'admin_list' => true\n ),\n 'disable_gutenburg' => array(\n 'label' => __('Disable gutenburg', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n 'admin_list' => true\n ),\n 'args' => array(\n 'label' => __('Args', 'extend-wp'),\n 'case' => 'select',\n 'options' => array(\n 'title' => array('label' => __('title', 'extend-wp')),\n 'editor' => array('label' => __('editor', 'extend-wp')),\n 'author' => array('label' => __('author', 'extend-wp')),\n 'thumbnail' => array('label' => __('thumbnail', 'extend-wp')),\n 'excerpt' => array('label' => __('excerpt', 'extend-wp')),\n 'trackbacks' => array('label' => __('trackbacks', 'extend-wp')),\n 'custom-fields' => array('label' => __('custom-fields', 'extend-wp')),\n 'comments' => array('label' => __('comments', 'extend-wp')),\n 'revisions' => array('label' => __('revisions', 'extend-wp')),\n 'page-attributes' => array('label' => __('page-attributes', 'extend-wp')),\n 'post-formats' => array('label' => __('post-formats', 'extend-wp')),\n ),\n 'attributes' => array('multiple' => true),\n ),\n 'taxonomies' => array(\n 'case' => 'taxonomies',\n 'label' => __('Attach taxonomies', 'extend-wp'),\n 'attributes' => array('multiple' => 1)\n ),\n 'extra_slug' => array(\n 'label' => __('With front (taxonomy_label)', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'description' => array(\n 'label' => __('Desription', 'extend-wp'),\n 'case' => 'textarea',\n ),\n )\n );\n }",
"function rep_create_post_type() {\n\t/*$name = 'name';\n\n\tregister_post_type(\n\t\t$name,\n\t\tarray(\n\t\t\t'labels' => Rep\\Helpers\\post_type_labels( $name ),\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => false,\n\t\t\t'hierarchical' => false,\n\t\t\t'menu_position' => 99,\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'custom-fields',\n\t\t\t\t'page-attributes',\n\t\t\t)\n\t\t)\n\t);*/\n}",
"function gk_speakers_create_post_type() {\n\t$options = get_option( 'speakers_options' );\n\t$taxonomy = $options[ 'speakers_tax' ];\n\t$post_name = strtolower($options[ 'name' ]);\n\t$slug = $options[ 'speakers_slug' ];\n\t\n \t// Custom Post Type Labels\n $labels = array(\n 'name'\t\t\t=> $options[ 'cpt_name' ],\n 'singular_name' => $options[ 'name_singular' ],\n 'add_new_item' => $options[ 'add_new' ]\n );\t\n \t\n \t// Custom Post Type Supports\n $args = array(\n 'labels'\t\t=> $labels,\n 'taxonomies' \t=> array($taxonomy),\n\t\t'menu_position' => intval($options['speakers_position']),\n 'public' \t\t=> true,\n 'rewrite' \t\t=> array('slug' => $slug),\n 'has_archive' \t=> true,\n\t\t'supports' \t\t=> array('title', 'editor', 'thumbnail', 'custom-fields', 'comments')\n );\n \n //register the \"Speakers\" custom post type\n register_post_type($post_name, $args);\n}",
"function buildPlayScriptPost()\n {\n $labels = array(\n 'name' => __('Play Scripts'),\n 'singular_name' => __('Play Script'),\n 'add_new' => ('Add New Script'),\n 'add_new_item' => ('Add New Play Script'),\n 'edit_item' => ('Edit Script'),\n 'new_item' => ('New Script'),\n 'view_item' => ('View Play Script'),\n 'not_found' => ('No Play Scripts found'),\n 'not_found_in_trash' => ('No Play Scripts found in Trash'),\n 'parent_item_colon' => ('Parent Play Script:'),\n 'menu_name' => ('Play Scripts'),\n );\n\n $customPostArgs = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'description' => 'Play Scripts',\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'revisions', 'page-attributes'),\n 'taxonomies' => array('genres'),\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 1,\n 'menu_icon' => 'dashicons-format-aside',\n 'show_in_nav_menus' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => false,\n 'has_archive' => true,\n 'query_var' => true,\n 'can_export' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'rewrite' => array('slug' => 'playscripts'),\n 'show_in_rest' => true\n );\n\n register_post_type('playscripts', $customPostArgs);\n }",
"private function create_hooks()\n\t{\n\t\tglobal $DB;\n\n\t\t$hook_template = array(\n\t\t\t'class' => __CLASS__,\n\t\t\t'settings' => FALSE,\n\t\t\t'version' => $this->version,\n\t\t);\n\n\t\tforeach($this->hooks as $key => $value)\n\t\t{\n\t\t\tif(is_array($value))\n\t\t\t{\n\t\t\t\t$hook[\"hook\"] = $key;\n\t\t\t\t$hook[\"method\"] = (isset($value[\"method\"]) === TRUE) ? $value[\"method\"] : $key;\n\t\t\t\t$hook = array_merge($hook, $value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$hook[\"hook\"] = $hook[\"method\"] = $value;\n\t\t\t}\n\t\t\t$hook = array_merge($hook_template, $hook);\n\t\t\t$DB->query($DB->insert_string('exp_extensions', $hook));\n\t\t}\n\t}",
"function codex_evento_init() {\n $labels = array(\n 'name' => _x('Eventos', 'post type general name'),\n 'singular_name' => _x('Eventos', 'post type singular name'),\n 'add_new' => _x('Add New', 'Evento'),\n 'add_new_item' => __('Add New Evento'),\n 'edit_item' => __('Edit Evento'),\n 'new_item' => __('New Evento'),\n 'all_items' => __('All Evento'),\n 'view_item' => __('View Evento'),\n 'search_items' => __('Search Evento'),\n 'not_found' => __('No Evento found'),\n 'not_found_in_trash' => __('No Evento found in Trash'), \n 'parent_item_colon' => '',\n 'menu_name' => __('Eventos')\n\n );\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true, \n 'show_in_menu' => true, \n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'has_archive' => true, \n 'hierarchical' => false,\n 'menu_position' => null,\n 'supports' => array( 'title', 'editor', 'thumbnail' )\n ); \n register_post_type('eventos',$args);\n}",
"function dp_cpt_register() {\n $args = array(\n 'public' => true,\n 'label' => 'Da Popup',\n 'show_in_nav_menus' => false,\n 'menu_position' => 80,\n 'menu_icon' => 'dashicons-welcome-comments',\n 'supports' => array('title', 'thumbnail'),\n 'rewrite' => array('slug' => 'da-popup', 'with_front' => false),\n );\n register_post_type( 'da-popup', $args );\n}",
"function setup() {\n\tadd_action( 'init', __NAMESPACE__ . '\\\\create_taxonomy' );\n\tadd_action( 'add_meta_boxes', __NAMESPACE__ . '\\\\register_meta_boxes', 100 );\n\tadd_action( 'save_post', __NAMESPACE__ . '\\\\save' );\n\tadd_filter( 'ami_utag_data', __NAMESPACE__ . '\\\\data_layer' );\n\tadd_action( 'tealium_tag_placement', __NAMESPACE__ . '\\\\place_tag' );\n}",
"function abi_ArabiSliderPost() {\n // Set Labels Of The costum Post\n $labels = array(\n 'add_new' => __( 'اضف سلايدر', 'abi_arabislider' ),\n 'not_found' => __( 'لا يوجد اي سلايدر', 'abi_arabislider' ),\n 'add_new_item' => __( 'اضف سلايدر جديد', 'abi_arabislider' ) ,\n );\n // Set the Slider itmes\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'label' => 'سلايدر العربي',\n 'supports' => array( 'title', 'editor','thumbnail')\n );\n // Register The post type Named : abi_sliderPost\n register_post_type( 'abi_sliderPost', $args );\n }",
"private function register_hooks() {\n\t\t\tadd_action( 'plugins_loaded', array( &$this, 'load_textdomain' ), 10, 0 );\n\n\t\t\tadd_action( 'init', array( '\\Ekko\\Core\\CoursePostType', 'singleton' ), 0, 0 );\n\t\t\tadd_action( 'init', array( &$this, 'add_ekko_image_sizes' ), 2, 0 );\n\n\t\t\tadd_action( 'set_user_role', array( &$this, 'user_role_changed' ), 5, 2 );\n\t\t\tadd_action( 'remove_user_from_blog', array( &$this, 'user_removed_from_blog' ), 10, 2 );\n\t\t}",
"private function _add_hooks() {\n\t\tadd_action( 'restrict_manage_posts', array( $this, '_restrict_posts_by_taxonomy' ) );\n\t\tadd_filter( 'parse_query', array( $this, '_convert_taxonomy_id_to_term_in_query' ) );\n\t\tadd_action( 'admin_head', array( $this, '_admin_css' ) );\n\t\tadd_action( 'save_post', array( $this, '_default_terms' ), 100, 2 );\n\t}",
"function shariff3uu_add_shariff_custom_hooks() {\n\t// Get options.\n\t$shariff3uu = $GLOBALS['shariff3uu'];\n\n\tif ( isset( $shariff3uu['custom_hooks_shortcode'] ) && ! empty( $shariff3uu['custom_hooks_shortcode'] ) ) {\n\t\t// Replaces shariff with shariffmeta.\n\t\t$shariff3uu_custom_hooks_shortcode = str_replace( '[shariff ', '[shariffmeta ', $shariff3uu['custom_hooks_shortcode'] );\n\n\t\t// Extracts attributes.\n\t\tif ( '[shariffmeta]' !== $shariff3uu_custom_hooks_shortcode ) {\n\t\t\tdo_shortcode( $shariff3uu_custom_hooks_shortcode );\n\t\t}\n\n\t\tif ( isset( $GLOBALS['shariff3uu']['metabox'] ) && ! empty( $GLOBALS['shariff3uu']['metabox'] ) ) {\n\t\t\t$shariff3uu_custom_hooks_shortcode = $GLOBALS['shariff3uu']['metabox'];\n\t\t} else {\n\t\t\t$shariff3uu_custom_hooks_shortcode = array();\n\t\t}\n\n\t\t// Clears the metabox global.\n\t\t$GLOBALS['shariff3uu']['metabox'] = '';\n\n\t\t// phpcs:ignore\n\t\techo shariff3uu_render( $shariff3uu_custom_hooks_shortcode );\n\t} else {\n\t\t// phpcs:ignore\n\t\techo shariff3uu_render( array() );\n\t}\n}",
"function una_custom_post_factsheet() {\n register_post_type( 'unafactsheet',\n array(\n 'labels' => array(\n 'name' => __( 'Policy', 'Policies' ),\n 'singular_name' => __( 'Policy' ),\n 'add_new' => __( 'Add New', 'Policy' ),\n 'add_new_item' => __( 'Add Policy' ),\n 'edit_item' => __( 'Edit Policy' ),\n 'new_item' => __( 'New Policy' ),\n 'view_item' => __( 'View Policy' ),\n 'all_items' => __( 'All Policies' ),\n 'search_items' => __('Search Policies'),\n 'not_found' => __('No Policy found.'),\n 'featured_image' => __( 'Policy Image' ),\n 'set_featured_image' => __( 'Set image' ),\n 'remove_featured_image' => __( 'Remove image'),\n ),\n 'description' => __('Description to describe'),\n 'public' => true,\n 'show_ui' => true,\n 'hierarchical' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'rewrite' => array('slug' => 'policy','with_front' => false),\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'thumbnail',\n 'revisions',\n ),\n 'menu_position' => 4,\n 'show_in_rest' => false, // set to false to disable GB\n 'menu_icon' => get_stylesheet_directory_uri() . '/img/logos/icon-unafactsheet.svg',\n 'query_var' => true,\n 'taxonomies' => array(\n 'post_tag',\n )\n )\n );\n register_taxonomy_for_object_type( 'post_tag', 'unafactsheet' );\n }",
"function ew_slider() {\n register_post_type( 'Slaidid',\n array(\n 'labels' => array(\n 'name' => __( 'Slaidid' ),\n 'singular_name' => __( 'slaid' )\n ),\n 'public' => true,\n 'taxonomies' => array('post_tag'),\n 'menu_position' => 5,\n 'rewrite' => array('slug' => 'slaid'),\n 'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' )\n )\n );\n}",
"public function add_post_type_ads () {\n\t\t$args = array(\n\t\t 'labels' => $this->create_post_type_labels( 'popups', $this->labels['popups']['singular'], $this->labels['popups']['plural'], $this->labels['popups']['menu'] ),\n\t\t 'public' => false,\n\t\t 'publicly_queryable' => true,\n\t\t 'show_ui' => true, \n\t\t 'show_in_menu' => true, \n\t\t 'query_var' => true,\n\t\t 'rewrite' => array( 'slug' => 'popups', 'with_front' => false, 'feeds' => false, 'pages' => false ),\n\t\t 'capability_type' => 'post',\n\t\t 'has_archive' => false, \n\t\t 'hierarchical' => false,\n\t\t 'menu_position' => 100, // Below \"Pages\"\n\t\t 'menu_icon' => esc_url( self::$plugin_url . 'images/icon_popups.png' ), \n\t\t 'supports' => array( 'title' )\n\t\t);\n\n\t\tregister_post_type( 'popups', $args );\n\t}",
"function custom_post_type() {\n\t\tregister_post_type('homepopup', \n\t\tarray( 'labels' => array( \n\t\t\t'name' => 'Pop Up Home', 'singular_name' => 'Pop Up Home', 'add_new' => 'Agregar nuevo Pop Up', 'edit_item' => 'Editar Pop Up', 'new_item' => 'Nueva Pop Up', 'view_item' => 'Ver Pop Up', 'search_items' => 'Buscar Pop Up', 'not_found' => 'No se encuentran Pop Up', 'not_found_in_trash' => 'No hay Pop Up en la papelera'), 'public' => true, \n\t\t\t'rewrite' => array('slug' => 'homepopup'), 'menu_position' => 4, 'show_ui' => true, 'supports' => array('title', 'custom-fields')\n\t\t));\n\t}",
"function _add_cf7bdb_post_type()\n{\n register_post_type( 'cf7bdb_entries', array(\n 'label' => 'CF7 Better Database Plugin Entries',\n 'labels' => array(\n 'singular_name' => 'CF7BDB Entry',\n 'all_items' => 'View Entries',\n 'edit_item' => 'Edit Entry',\n 'new_item' => 'New Entry',\n 'view_item' => 'View Entry',\n 'search_items' => 'Search Form Submissions',\n 'not_found' => 'No matching entries were found',\n 'menu_name' => 'CF7 Entries',\n ),\n 'description' => 'Submitted form entries for Contact Form 7.',\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'hierarchical' => true, // Allows specifying a parent, which will be the Form ID\n 'supports' => array('title', 'editor', 'author', 'custom-fields', 'revisions'),\n ) );\n}"
] | [
"0.6874537",
"0.6720631",
"0.6712511",
"0.6701174",
"0.66957986",
"0.6609666",
"0.6603706",
"0.65901166",
"0.6579919",
"0.6541318",
"0.65400666",
"0.65240455",
"0.6499417",
"0.6470236",
"0.64693964",
"0.6462801",
"0.64601535",
"0.6451029",
"0.6446092",
"0.6440052",
"0.6436598",
"0.6414808",
"0.6411722",
"0.6380997",
"0.6379974",
"0.6359486",
"0.6358773",
"0.6347131",
"0.6345679",
"0.6337089"
] | 0.7752583 | 0 |
Register the admin menu for Custom Layouts | public function register_admin_menu() {
$custom_layouts_capability = apply_filters( 'astra_custom_layouts_capability', 'edit_theme_options' );
add_submenu_page(
'themes.php',
__( 'Custom Layouts', 'astra-addon' ),
__( 'Custom Layouts', 'astra-addon' ),
$custom_layouts_capability,
'edit.php?post_type=' . ASTRA_ADVANCED_HOOKS_POST_TYPE
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddAdminMenu() {\n add_menu_page($this->plugin->displayName, $this->plugin->displayName, 'switch_themes', $this->plugin->name, array(&$this, 'AdminPanel'), $this->plugin->url.'images/icons/small.png');\n }",
"public function admin_menus() {\n\t\t// About\n\t\tadd_dashboard_page(\n\t\t\t__( 'Theme Details', 'wpex' ),\n\t\t\t__( 'Theme Details', 'wpex' ),\n\t\t\t$this->minimum_capability,\n\t\t\t'wpex-about',\n\t\t\tarray( $this, 'about_screen' )\n\t\t);\n\n\t\t// Recommended\n\t\tadd_dashboard_page(\n\t\t\t__( 'Recommendations | Elegant Theme', 'wpex' ),\n\t\t\t__( 'Recommendations', 'wpex' ),\n\t\t\t$this->minimum_capability,\n\t\t\t'wpex-recommended',\n\t\t\tarray( $this, 'recommended_screen' )\n\t\t);\n\n\t}",
"public function registerAdminMenu()\n\t{\n\t\tadd_menu_page('Hírlevél', 'Hírlevél', 'moderate_comments', 'hirlevel', [$this, 'getAdminListPage'], 'dashicons-email-alt', '55.8');\n\t\tadd_submenu_page( 'hirlevel', 'Hírlevél lista', 'Hírlevél lista', 'moderate_comments', 'hirlevel', [$this, 'getAdminListPage'] );\n\t\tadd_submenu_page( 'hirlevel', 'Új hírlevél', 'Új hírlevél', 'moderate_comments', 'hirlevel-add', [$this, 'getAdminCreatePage'] );\n\t}",
"public function addAdminMenu()\n {\n add_menu_page(\n __('Sendflow', 'sendflow'),\n __('Sendflow', 'sendflow'),\n 'manage_options',\n 'sendflow',\n array(__CLASS__, 'adminLayout'),\n 'dashicons-testimonial'\n );\n }",
"public function register_menu()\r\n {\r\n global $wiloke;\r\n\r\n add_theme_page( $wiloke->aConfigs['themeoptions']['menu_name'], $wiloke->aConfigs['themeoptions']['menu_name'], 'edit_theme_options', $wiloke->aConfigs['themeoptions']['menu_slug'], array($this, 'render') );\r\n }",
"public static function adminMenu(){\n\t\t$hook = add_submenu_page(\n\t\t\t\"ait-theme-options\",\n\t\t\t__(\"Migration\", \"ait-directory-migrations\"),\n\t\t\t__(\"Migration\", \"ait-directory-migrations\"),\n\t\t\t\"edit_theme_options\",\n\t\t\t'ait_migration_options',\n\t\t\tarray(__CLASS__, 'adminPage')\n\t\t);\n\t}",
"public function addAdminMenu()\n {\n add_menu_page(\n $this->title,\n $this->title,\n 'edit_theme_options',\n $this->slug,\n array($this, 'adminMenuPageHtml'),\n $this->customIcon ?: 'dashicons-' . sanitize_html_class($this->optionKey)\n );\n }",
"function cl_register_custom_menu_pages() {\n\n add_menu_page(\n\n 'website options',\n\n 'cleaning Options',\n\n 'manage_options',\n\n 'content-area',\n\n 'main_content_area_callback',\n\n cl_URL.'assets/img/favicon.webp',\n\n 2\n\n ); \n\n add_submenu_page(\n\n 'content-area',\n\n 'Home options',\n\n 'Home Page Options',\n\n 'manage_options',\n\n 'home-page-content',\n\n 'home_page_content_callback'\n\n ); \n add_submenu_page(\n\n 'content-area',\n\n 'About options',\n\n 'About Page Options',\n\n 'manage_options',\n\n 'about-page-content',\n\n 'about_page_content_callback'\n\n ); \n add_submenu_page(\n\n 'content-area',\n\n 'Contact options',\n\n 'Contact Page Options',\n\n 'manage_options',\n\n 'contact-page-content',\n\n 'contact_page_content_callback'\n\n );\n}",
"protected function registerSidebarMenu()\n {\n $menu = $this->app['menu_manager']->get('admin_sidebar')->createItem(\n 'user-manager',\n [\n 'icon' => 'users',\n 'label' => 'User and Group',\n 'url' => '#',\n 'permission' => ['usermanager', 'usermanager.user.read', 'usermanager.group.read', 'usermanager.permission.read']\n ]\n );\n\n $menu->addChildren(\n 'manage-user',\n [\n 'icon' => 'user',\n 'label' => 'Users',\n 'title' => 'Manage Users',\n 'url' => Url::to('usermanager.user.index'),\n 'permission' => ['usermanager.user.read']\n ]\n );\n\n $menu->addChildren(\n 'manage-group',\n [\n 'icon' => 'users',\n 'label' => 'Groups',\n 'title' => 'Manage Groups',\n 'url' => Url::to('usermanager.group.index'),\n 'permission' => ['usermanager.group.read']\n ]\n );\n\n $menu->addChildren(\n 'manage-permission',\n [\n 'icon' => 'th-list',\n 'label' => 'Permissions',\n 'title' => 'Manage Permissions',\n 'url' => Url::to('usermanager.permission.index'),\n 'permission' => ['usermanager.permission.read']\n ]\n );\n }",
"public function register_admin_menu() {\n\t\t\tadd_action( 'admin_menu', array( $this, 'wordpress_hook_admin_menu' ) );\n\t\t}",
"protected function registerMenu()\n {\n add_filter('admin_menu', function () {\n $menu = $this->config->get('menu');\n\n if ($menu->isEmpty()) {\n return;\n }\n\n $GLOBALS['menu'] = collect($GLOBALS['menu'])->map(function ($item) use ($menu) {\n if (! $menu->contains(Str::afterLast($item[2], '='))) {\n return $item;\n }\n\n if ($menu->get($item[2]) === false) {\n return;\n }\n\n array_push(\n $GLOBALS['submenu']['tools.php'],\n collect($item)->slice(0, 2)->push(\n admin_url(\n (is_string($menu->get($item[2])) ? $item[2] : Str::contains($item[2], '.php'))\n ? $item[2] : Str::start($item[2], 'admin.php?page=')\n )\n )->all()\n );\n })->filter()->all();\n }, 20);\n }",
"private function register_menu() {\n add_action( 'admin_menu', array(&$this,'flo_add_launch_options') );\n add_action( 'admin_bar_menu', array(&$this,'flo_add_top_bar_menu'), 999 );\n }",
"static function createAdminMenu(){\n\t\tadd_menu_page('Gladiolus web studio popup plugin options', 'GL Popup', 'manage_options', 'gl-popup', ['Popup', 'renderMenuPage'], '', 6);\n\t}",
"public function admin_menu() {\n\t\t\t// NEEDS: menu_page()\n\t\t\t// NEEDS: options_page()\n\t\t\t\n\t\t\tif ( ! function_exists('submit_button') ) return;\n\t\t\t\n\t\t\tif ( current_user_can('upload_files') )\n\t\t\t\tadd_media_page( \n\t\t\t\t\t__('Dropbox Sideload', 'dropbox-sideload'),\t// Page title\n\t\t\t\t\t__('Dropbox Sideload', 'dropbox-sideload'),\t// Menu title\n\t\t\t\t\t'read', \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Capability\n\t\t\t\t\t'dropbox-sideload', \t\t\t\t\t\t\t\t\t\t\t\t// Menu slug\n\t\t\t\t\tarray( &$this, 'menu_page' ) \t\t\t\t\t\t\t\t// Function callback\n\t\t\t\t);\n\t\t\t\n\t\t\tif ( current_user_can('manage_options') )\n\t\t\t\tadd_options_page( \n\t\t\t\t\t__('Dropbox Sideload Options', 'dropbox-sideload'),\t// Page title\n\t\t\t\t\t__('Dropbox Sideload Options', 'dropbox-sideload'),\t// Menu title\n\t\t\t\t\t'read', \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Capability\n\t\t\t\t\t'dropbox-sideload', \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Menu slug\n\t\t\t\t\tarray( &$this, 'options_page' )\t \t\t\t\t\t\t\t\t\t\t// Function callback\n\t\t\t\t);\n\t\t}",
"function adminForMenu() {\r\n add_menu_page(__('View Reviews', 'menu-test'), __('View Reviews', 'menu-test'), 'manage_options', 'sub-page', 'new_plugin');\r\n }",
"function foucs_create_admin_menu_page() {\n //Genneration Of Our Admin Settings Page\n}",
"public function adminMenu()\n {\n \\add_menu_page('PTP Media', 'PTP Media', 'manage_options', 'ptp_media', $this->adminController, 'dashicons-format-gallery', 110);\n }",
"function registerAdminActions()\n {\n\n add_menu_page('Vzaar media', 'vzaarAPI', 'manage_options', 'vzaarAPI/dialogs/vzaarAPISettings.php', '', plugins_url('vzaarAPI/images/icon.png'), 99);\n add_submenu_page('vzaarAPI/dialogs/vzaarAPISettings.php', 'vzaarAPI - Settings', 'Settings', 'manage_options', 'vzaarAPI/dialogs/vzaarAPISettings.php');\n add_submenu_page('vzaarAPI/dialogs/vzaarAPISettings.php', 'vzaarAPI - Media', 'Videos', 'manage_options', 'vzaarAPI/media.php');\n add_submenu_page('vzaarAPI/dialogs/vzaarAPISettings.php', 'vzaarAPI - Upload', 'Upload', 'manage_options', 'vzaarAPI/upload.php');\n\n }",
"public function adminMenu() {\n add_options_page (__( \"Lyyti Settings\", 'lyyti' ), __( \"Lyyti Settings\", 'lyyti' ), 'manage_options', 'lyyti', [$this, 'settingsPage']);\n }",
"protected function setupAdminPanel()\n {\n $self = $this;\n add_action('admin_menu', function () use ($self) {\n $core = Core::getInstance();\n $name = $core->getName();\n $slug = $core->getPrefix() . 'plugin_root_menu';\n add_menu_page($name, $name, 'edit_posts', $slug, function () use ($self) {\n $self->rootAdminPage();\n }, \"dashicons-admin-site\", 070);\n });\n\n add_action('admin_enqueue_scripts', function () use ($self) {\n wp_enqueue_media();\n });\n }",
"public static function admin_menu()\n\t{\n\t}",
"public function adminMenu()\n {\n $this->Pages['main_page'] = add_menu_page(__('Grand Gallery', GDGALLERY_TEXT_DOMAIN), __('Grand Gallery', GDGALLERY_TEXT_DOMAIN), 'manage_options', 'gdgallery', array(\n $this,\n 'mainPage'\n ), \\GDGallery()->pluginUrl() . '/resources/assets/images/icons/logo_small.png');\n\n $this->Pages['main_page'] = add_submenu_page('gdgallery', __('Galleries', GDGALLERY_TEXT_DOMAIN), __('Galleries', GDGALLERY_TEXT_DOMAIN), 'manage_options', 'gdgallery', array(\n $this,\n 'mainPage'\n ));\n\n $this->Pages['styles'] = add_submenu_page('gdgallery', __('Views / Styles', GDGALLERY_TEXT_DOMAIN), __('Views / Styles', GDGALLERY_TEXT_DOMAIN), 'manage_options', 'gdgallery_styles', array(\n $this,\n 'stylesPage'\n ));\n\n $this->Pages['settings'] = add_submenu_page('gdgallery', __('Settings', GDGALLERY_TEXT_DOMAIN), __('Settings', GDGALLERY_TEXT_DOMAIN), 'manage_options', 'gdgallery_settings', array(\n $this,\n 'settingsPage'\n ));\n }",
"private function register_menu_pages() {\n\t\tadd_options_page(\n\t\t\t__( 'HelpScout Docs API', 'helpscout-docs-api' ),\n\t\t\t__( 'HelpScout API', 'helpscout-docs-api' ),\n\t\t\t'manage_options',\n\t\t\t$this->hook,\n\t\t\tarray( new Admin_Page(), 'config_page' )\n\t\t);\n\n\t}",
"function lunar_add_admin_page() {\n\n // Generate Admin page and show it in menu\n add_menu_page('Lunar', 'Lunar-blog', 'manage_options', 'lunar_blog_general', 'lunar_theme_create_page',\n get_template_directory_uri() . '/images/l-icon.png', 110);\n\n // Generate Admin sub pages and show it in menu\n add_submenu_page( 'lunar_blog_general', 'Lunar Theme Options', 'General', 'manage_options', 'lunar_blog_general',\n 'lunar_theme_create_page' );\n add_submenu_page( 'lunar_blog_general', 'Lunar Theme Options', 'Theme Options', 'manage_options', 'my_lunar_theme',\n 'lunar_theme_support_page');\n add_submenu_page( 'lunar_blog_general', 'Lunar Contact Form', 'Contact Form', 'manage_options', 'lunar_theme_contact',\n 'lunar_contact_form_page');\n add_submenu_page( 'lunar_blog_general', 'Lunar CSS Options', 'Custom CSS', 'manage_options', 'lunar_blog_css',\n 'lunar_theme_settings_page');\n}",
"function adding_admin_bar(){\n\n\tadd_menu_page(\n\t\t'i-learn_wp',\n\t\t'learning_plugin',\n\t\t'manage_options',\n\t\t'clicked',\n\t\t'wp_plugin_used',\n\t\t'',\n\t\t2\n\t\t\n\t\t\n\t\t);\n}",
"function appal_admin_meu()\n{\n add_menu_page('Appal', 'Appal', 'administrator', 'appal-admin-menu', 'appal_welcome_page', 'dashicons-smiley', 2);\n add_submenu_page('appal-admin-menu', esc_html__('Demo Importer', 'appal'), esc_html__('Demo Importer', 'appal'), 'administrator', 'appal-demo-importer', 'appal_demo_importer_function');\n add_submenu_page('appal-admin-menu', esc_html__('Theme Options', 'appal'), esc_html__('Theme Options', 'appal'), 'administrator', 'Appal', 'appal_theme_options_function');\n}",
"public function bamobile_create_menu_in_admin(){\r\n add_submenu_page(\r\n 'mobiconnector-settings',\r\n __('Extentions'),\r\n __('Extentions'),\r\n 'manage_options',\r\n 'mobiconnector-extensions',\r\n array($this,'bamobile_action_create_menu')\r\n );\r\n }",
"public function admin_menus()\n {\n }",
"static function admin_menu() {\r\n add_management_page('Security Ninja', 'Security Ninja', 'manage_options', 'wf-sn', array(__CLASS__, 'options_page'));\r\n }",
"function WBU_adminMenu()\n{\n add_menu_page( 'Booking Request', 'Booking Request', 'edit_theme_options', 'render_admin_page', 'render_admin_page');\n // add_submenu_page( 'render_admin_page', 'Import Album', 'Import Albums', 'manage_options', 'import_albums_plugin');\n // add_submenu_page( 'render_admin_page', 'Import Album', 'Import Albums', 'manage_options', 'import-album_page', 'import_albums_plugin');\n\n}"
] | [
"0.75134814",
"0.7408411",
"0.7393061",
"0.73647124",
"0.730744",
"0.73021793",
"0.7245276",
"0.72110444",
"0.7142519",
"0.70879334",
"0.7087119",
"0.7082655",
"0.70396817",
"0.70362306",
"0.7030819",
"0.6998647",
"0.6993244",
"0.69889766",
"0.6980395",
"0.6941001",
"0.6927686",
"0.6927205",
"0.6921948",
"0.69187444",
"0.69172674",
"0.6906735",
"0.68935925",
"0.68848306",
"0.68805915",
"0.68654716"
] | 0.8000519 | 0 |
Add Update messages for any custom post type | public function custom_post_type_post_update_messages( $messages ) {
$custom_post_type = get_post_type( get_the_ID() );
if ( ASTRA_ADVANCED_HOOKS_POST_TYPE == $custom_post_type ) {
$obj = get_post_type_object( $custom_post_type );
$singular_name = $obj->labels->singular_name;
$messages[ $custom_post_type ] = array(
0 => '', // Unused. Messages start at index 1.
/* translators: %s: singular custom post type name */
1 => sprintf( __( '%s updated.', 'astra-addon' ), $singular_name ),
/* translators: %s: singular custom post type name */
2 => sprintf( __( 'Custom %s updated.', 'astra-addon' ), $singular_name ),
/* translators: %s: singular custom post type name */
3 => sprintf( __( 'Custom %s deleted.', 'astra-addon' ), $singular_name ),
/* translators: %s: singular custom post type name */
4 => sprintf( __( '%s updated.', 'astra-addon' ), $singular_name ),
/* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'astra-addon' ), $singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, // phpcs:ignore WordPress.Security.NonceVerification.Recommended
/* translators: %s: singular custom post type name */
6 => sprintf( __( '%s published.', 'astra-addon' ), $singular_name ),
/* translators: %s: singular custom post type name */
7 => sprintf( __( '%s saved.', 'astra-addon' ), $singular_name ),
/* translators: %s: singular custom post type name */
8 => sprintf( __( '%s submitted.', 'astra-addon' ), $singular_name ),
/* translators: %s: singular custom post type name */
9 => sprintf( __( '%s scheduled for.', 'astra-addon' ), $singular_name ),
/* translators: %s: singular custom post type name */
10 => sprintf( __( '%s draft updated.', 'astra-addon' ), $singular_name ),
);
}
return $messages;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setup_updated_messages( $messages ) {\n\n\t\tglobal $post, $post_ID;\n\n\t\t$post_types = PodsMeta::$post_types;\n\t\t$existing_post_types = get_post_types();\n\n\t\t$pods_cpt_ct = pods_transient_get( 'pods_wp_cpt_ct' );\n\n\t\tif ( empty( $pods_cpt_ct ) || empty( $post_types ) ) {\n\t\t\treturn $messages;\n\t\t}\n\n\t\t/**\n\t\t * Use get_preview_post_link function added in 4.4, which eventually applies preview_post_link filter\n\t\t * Before 4.4, this filter is defined in wp-admin/includes/meta-boxes.php, $post parameter added in 4.0\n\t\t * there wasn't post parameter back in 3.8\n\t\t * Let's add $post in the filter as it won't hurt anyway.\n\t\t *\n\t\t * @since 2.6.8.1\n\t\t */\n\t\t$preview_post_link = function_exists( 'get_preview_post_link' ) ? get_preview_post_link( $post ) : apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ), $post );\n\n\t\tforeach ( $post_types as $post_type ) {\n\t\t\tif ( ! isset( $pods_cpt_ct['post_types'][ $post_type['name'] ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$labels = self::object_label_fix( $pods_cpt_ct['post_types'][ $post_type['name'] ], 'post_type' );\n\t\t\t$labels = $labels['labels'];\n\n\t\t\t$messages[ $post_type['name'] ] = array(\n\t\t\t\t1 => sprintf( __( '%1$s updated. <a href=\"%2$s\">%3$s</a>', 'pods' ), $labels['singular_name'], esc_url( get_permalink( $post_ID ) ), $labels['view_item'] ),\n\t\t\t\t2 => __( 'Custom field updated.', 'pods' ),\n\t\t\t\t3 => __( 'Custom field deleted.', 'pods' ),\n\t\t\t\t4 => sprintf( __( '%s updated.', 'pods' ), $labels['singular_name'] ),\n\t\t\t\t/* translators: %s: date and time of the revision */\n\t\t\t\t5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'pods' ), $labels['singular_name'], wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t\t\t\t6 => sprintf( __( '%1$s published. <a href=\"%2$s\">%3$s</a>', 'pods' ), $labels['singular_name'], esc_url( get_permalink( $post_ID ) ), $labels['view_item'] ),\n\t\t\t\t7 => sprintf( __( '%s saved.', 'pods' ), $labels['singular_name'] ),\n\t\t\t\t8 => sprintf( __( '%1$s submitted. <a target=\"_blank\" href=\"%2$s\">Preview %3$s</a>', 'pods' ), $labels['singular_name'], esc_url( $preview_post_link ), $labels['singular_name'] ),\n\t\t\t\t9 => sprintf(\n\t\t\t\t\t__( '%1$s scheduled for: <strong>%2$s</strong>. <a target=\"_blank\" href=\"%3$s\">Preview %4$s</a>', 'pods' ), $labels['singular_name'],\n\t\t\t\t\t// translators: Publish box date format, see http://php.net/date\n\t\t\t\t\tdate_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post_ID ) ), $labels['singular_name']\n\t\t\t\t),\n\t\t\t\t10 => sprintf( __( '%1$s draft updated. <a target=\"_blank\" href=\"%2$s\">Preview %3$s</a>', 'pods' ), $labels['singular_name'], esc_url( $preview_post_link ), $labels['singular_name'] ),\n\t\t\t);\n\n\t\t\tif ( false === (boolean) $pods_cpt_ct['post_types'][ $post_type['name'] ]['public'] ) {\n\t\t\t\t$messages[ $post_type['name'] ][1] = sprintf( __( '%s updated.', 'pods' ), $labels['singular_name'] );\n\t\t\t\t$messages[ $post_type['name'] ][6] = sprintf( __( '%s published.', 'pods' ), $labels['singular_name'] );\n\t\t\t\t$messages[ $post_type['name'] ][8] = sprintf( __( '%s submitted.', 'pods' ), $labels['singular_name'] );\n\t\t\t\t$messages[ $post_type['name'] ][9] = sprintf(\n\t\t\t\t\t__( '%1$s scheduled for: <strong>%2$s</strong>.', 'pods' ), $labels['singular_name'],\n\t\t\t\t\t// translators: Publish box date format, see http://php.net/date\n\t\t\t\t\tdate_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) )\n\t\t\t\t);\n\t\t\t\t$messages[ $post_type['name'] ][10] = sprintf( __( '%s draft updated.', 'pods' ), $labels['singular_name'] );\n\t\t\t}\n\t\t}//end foreach\n\n\t\treturn $messages;\n\t}",
"function types_marketing_message_custom_post_type_saved($message, $data, $update) {\n if( isset( $data['labels']['name'] ) ) {\n $title = $data['labels']['name'];\n $type = 'post_type';\n ob_start();\n include WPCF_ABSPATH . '/marketing/congrats-post-types/index.php';\n $message = ob_get_contents();\n ob_end_clean();\n\n return $message;\n }\n return '';\n}",
"public function post_updated_messages( $messages ) {\n\t\tglobal $post, $post_ID;\n\n\t\t$messages[ ActionScheduler_wpPostStore::POST_TYPE ] = array(\n\t\t\t0 => '', // Unused. Messages start at index 1.\n\t\t\t1 => __( 'Action updated.', 'action-scheduler' ),\n\t\t\t2 => __( 'Custom field updated.', 'action-scheduler' ),\n\t\t\t3 => __( 'Custom field deleted.', 'action-scheduler' ),\n\t\t\t4 => __( 'Action updated.', 'action-scheduler' ),\n\t\t\t5 => isset( $_GET['revision'] ) ? sprintf( __( 'Action restored to revision from %s', 'action-scheduler' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t\t\t6 => __( 'Action scheduled.', 'action-scheduler' ),\n\t\t\t7 => __( 'Action saved.', 'action-scheduler' ),\n\t\t\t8 => __( 'Action submitted.', 'action-scheduler' ),\n\t\t\t9 => sprintf( __( 'Action scheduled for: <strong>%1$s</strong>', 'action-scheduler' ), date_i18n( __( 'M j, Y @ G:i', 'action-scheduler' ), strtotime( $post->post_date ) ) ),\n\t\t\t10 => __( 'Action draft updated.', 'action-scheduler' ),\n\t\t);\n\n\t\treturn $messages;\n\t}",
"function iwacontact_updated_messages( $messages ) {\n\t\n\tglobal $post, $post_ID;\n\n\t$messages['iwacontactform'] = array(\n\t\t0 => '',\n\t\t1 => __( 'Form saved.', 'iwacontact' ),\n\t\t2 => __( 'Custom field saved.', 'iwacontact' ),\n\t\t3 => __( 'Custom field deleted.', 'iwacontact' ),\n\t\t4 => __( 'Form saved.', 'iwacontact' ),\n\t\t5 => false,\n\t\t6 => __( 'Form saved.', 'iwacontact' ),\n\t\t7 => __( 'Form saved.', 'iwacontact' ),\n\t\t8 => __( 'Form saved.', 'iwacontact' ),\n\t\t9 => __( 'Form saved.', 'iwacontact' ),\n\t\t10 => __( 'Form saved.', 'iwacontact' )\n\t);\n\n\treturn $messages;\n\n}",
"public function testUpdateNotificationType()\n {\n }",
"function property_updated_messages( $messages ) {\n global $post_id, $post;\n\n $messages[ 'property' ] = array(\n 0 => '', // Unused. Messages start at index 1.\n 1 => sprintf( __( '%2$s updated. <a href=\"%s\">View %2$s</a>', ud_get_wp_property()->domain ), esc_url( get_permalink( $post_id ) ), WPP_F::property_label() ),\n 2 => __( 'Custom field updated.', ud_get_wp_property()->domain ),\n 3 => __( 'Custom field deleted.', ud_get_wp_property()->domain ),\n 4 => sprintf( __( '%s updated.', ud_get_wp_property()->domain ), WPP_F::property_label() ),\n /* translators: %s: date and time of the revision */\n 5 => isset( $_GET[ 'revision' ] ) ? sprintf( __( '%2$s restored to revision from %s', ud_get_wp_property()->domain ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ), WPP_F::property_label() ) : false,\n 6 => sprintf( __( '%2$s published. <a href=\"%s\">View %2$s</a>', ud_get_wp_property()->domain ), esc_url( get_permalink( $post_id ) ), WPP_F::property_label() ),\n 7 => sprintf( __( '%s saved.', ud_get_wp_property()->domain ), WPP_F::property_label() ),\n 8 => sprintf( __( '%2$s submitted. <a target=\"_blank\" href=\"%s\">Preview %2$s</a>', ud_get_wp_property()->domain ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_id ) ) ), WPP_F::property_label() ),\n 9 => sprintf( __( '%2$s scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview %2$s</a>', ud_get_wp_property()->domain ),\n // translators: Publish box date format, see http://php.net/date\n date_i18n( __( 'M j, Y @ G:i', ud_get_wp_property()->domain ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post_id ) ), WPP_F::property_label()),\n 10 => sprintf( __( '%2$s draft updated. <a target=\"_blank\" href=\"%s\">Preview %2$s</a>', ud_get_wp_property()->domain ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_id ) ) ), WPP_F::property_label() ),\n );\n\n $messages = apply_filters( 'wpp_updated_messages', $messages );\n\n return $messages;\n }",
"static function add_update_nature(): void {\n self::add_acf_inner_field(self::updates, self::update_nature, [\n 'label' => 'Update',\n 'type' => 'wysiwyg',\n 'instructions' => '',\n 'required' => 1,\n 'conditional_logic' => 0,\n 'wrapper' => [\n 'width' => 85,\n 'class' => '',\n 'id' => '',\n ],\n 'default_value' => '',\n 'tabs' => 'all',\n 'toolbar' => 'basic',\n 'media_upload' => 0,\n 'delay' => 0,\n ]);\n }",
"function cfcpt_update_post($post_id,$post_type) {\n\t\tglobal $wpdb;\n\t\t$query = \"UPDATE {$wpdb->posts} SET post_type = '{$post_type}' WHERE ID = '{$post_id}'\";\n\t\treturn $wpdb->query($query);\n\t}",
"function after_update_info($post, $data){\r\n\techo \"<span style='color: #FF0000; font-weight: bold;'>ran after_update_info hook</span>\";\r\n}",
"public function feedMeUpdated(array $updatedFields = []) {\n\t\t// no post update actions\n\n\t}",
"function cma_get_post_actions() {\n return array('update', 'add');\n}",
"function updated_messages( $messages ) {\n\t\tglobal $post;\n\n\t\t$messages['jetpack-testimonial'] = array(\n\t\t\t0 => '', // Unused. Messages start at index 1.\n\t\t\t1 => sprintf( __( 'Testimonial updated. <a href=\"%s\">View testimonial</a>', 'jetpack'), esc_url( get_permalink( $post->ID ) ) ),\n\t\t\t2 => esc_html__( 'Custom field updated.', 'jetpack' ),\n\t\t\t3 => esc_html__( 'Custom field deleted.', 'jetpack' ),\n\t\t\t4 => esc_html__( 'Testimonial updated.', 'jetpack' ),\n\t\t\t/* translators: %s: date and time of the revision */\n\t\t\t5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Testimonial restored to revision from %s', 'jetpack'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t\t\t6 => sprintf( __( 'Testimonial published. <a href=\"%s\">View testimonial</a>', 'jetpack' ), esc_url( get_permalink( $post->ID ) ) ),\n\t\t\t7 => esc_html__( 'Testimonial saved.', 'jetpack' ),\n\t\t\t8 => sprintf( __( 'Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>', 'jetpack'), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),\n\t\t\t9 => sprintf( __( 'Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview testimonial</a>', 'jetpack' ),\n\t\t\t// translators: Publish box date format, see http://php.net/date\n\t\t\tdate_i18n( __( 'M j, Y @ G:i', 'jetpack' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ),\n\t\t\t10 => sprintf( __( 'Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>', 'jetpack' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),\n\t\t);\n\n\t\treturn $messages;\n\t}",
"public function onUpdate(int $type) {\n }",
"function hs_updated_messages( $messages ) {\n\t global $post, $post_ID;\n\t\n\t $messages['hs-action'] = array(\n\t\t0 => '', // Unused. Messages start at index 1.\n\t\t1 => __('Action updated. Now use it in your sidebar or in one of your posts/pages.'),\n\t\t2 => __('Custom field updated.'),\n\t\t3 => __('Custom field deleted.'),\n\t\t4 => __('Action updated.'),\n\t\t/* translators: %s: date and time of the revision */\n\t\t5 => isset($_GET['revision']) ? sprintf( __('Action restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t\t6 => __('Action created. Now use it in your sidebar or in one of your posts/pages.' ),\n\t\t7 => __('Action saved.'),\n\t\t8 => __('Action submitted.'),\n\t\t9 => sprintf( __('Action scheduled for: <strong>%1$s</strong>.'),\n\t\t // translators: Publish box date format, see http://php.net/date\n\t\t date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ) ),\n\t\t10 => __('Action draft updated.'),\n\t );\n\t\n\t return $messages;\n\t}",
"function construction_type_updated_messages($messages)\n{\n\n $messages['construction-type'] = array(\n 0 => '', // Unused. Messages start at index 1.\n 1 => __('Construction type added.', 'YOUR-TEXTDOMAIN'),\n 2 => __('Construction type deleted.', 'YOUR-TEXTDOMAIN'),\n 3 => __('Construction type updated.', 'YOUR-TEXTDOMAIN'),\n 4 => __('Construction type not added.', 'YOUR-TEXTDOMAIN'),\n 5 => __('Construction type not updated.', 'YOUR-TEXTDOMAIN'),\n 6 => __('Construction types deleted.', 'YOUR-TEXTDOMAIN'),\n );\n\n return $messages;\n}",
"public function admin_notices(){\n\t\tif( !isset( $_GET['post_type'] ) || ( parent::get_type_slider() != $_GET['post_type'] && parent::get_type_slide() != $_GET['post_type'] ) ){\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * Action that allows hooking to it to display admin notices only on plugin pages.\n\t\t * @param null\n\t\t */\n\t\tdo_action( 'fa_admin_notices' );\n\t}",
"function learndash_notifications_post_updated_messages( $messages ) {\n\t$messages['ld-notification'] = array(\n\t\t0 => '', // Unused. Messages start at index 1.\n\t\t1 => __( 'Notification updated.' ),\n\t\t2 => __( 'Custom field updated.' ),\n\t\t3 => __( 'Custom field deleted.' ),\n\t\t4 => __( 'Notification updated.' ),\n\t\t/* translators: %s: date and time of the revision */\n\t\t5 => isset($_GET['revision']) ? sprintf( __( 'Notification restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t\t6 => __( 'Notification published.' ),\n\t\t7 => __( 'Notification saved.' ),\n\t\t8 => __( 'Notification submitted.' ),\n\t\t9 => '',\n\t\t10 => __( 'Notification draft updated.' ),\n\t);\n\n\treturn $messages;\n}",
"public function postUpdate()\n {\n }",
"function register_post_meta() {\n\t\t$args = array(\n\t\t\t'type' => 'string',\n\t\t\t'description' => __( 'The message to use instead of the title when sharing to Publicize Services', 'jetpack' ),\n\t\t\t'single' => true,\n\t\t\t'default' => '',\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'name' => 'jetpack_publicize_message'\n\t\t\t),\n\t\t\t'auth_callback' => array( $this, 'message_meta_auth_callback' ),\n\t\t);\n\n\t\tforeach ( get_post_types() as $post_type ) {\n\t\t\tif ( ! $this->post_type_is_publicizeable( $post_type ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$args['object_subtype'] = $post_type;\n\n\t\t\tregister_meta( 'post', $this->POST_MESS, $args );\n\t\t}\n\t}",
"public function editPostAction() {\n\t\t$msgBody = $this->getPost(array(\n\t\t\t\t'id',\n\t\t\t\t'toptype',\n\t\t\t\t'type',\n\t\t\t\t'contentId',\n\t\t\t\t'sendInput',\n\t\t\t\t'totype',\n\t\t\t\t'title',\n\t\t\t\t'msg',\n\t\t\t\t'start_time',\n\t\t\t\t'end_time',\n\t\t\t\t'operate_status',\n\t\t\t\t'install_attention',\n\t\t 'other'));\t\n\t\t$msgBody = $this->_cookData($msgBody);\n\t\t\n\t\tif(empty($msgBody['id'])) {\n\t\t\tif($msgBody['totype'] == Game_Service_Msg::TARGET_ALL_ACOUNT ||\n\t\t\t\t$msgBody['totype'] == Game_Service_Msg::TARGET_SPECIFIED_ACCOUNT) {\n\t\t\t\t$ret = Game_Service_Msg::addMsg($msgBody);\n\t\t\t} else if ($msgBody['totype'] == Game_Service_Msg::TARGET_ALL_USER ||\n\t\t\t\t$msgBody['totype'] == Game_Service_Msg::TARGET_OTHER) { //通知栏消息\n\t\t\t\t$currTime = floor(Common::getTime()/60)*60;\n\t\t\t\t$pushData = array(\n\t\t\t\t\t'id'=>'',\n\t\t\t\t\t'type'=>$msgBody['type'],\n\t\t\t\t\t'reciver_type'=>$this->checkReciverType($msgBody['install_attention']),\n\t\t\t\t\t'game_id'=>$this->getGameId($msgBody),\n\t\t\t\t\t'title'=>$msgBody['title'],\n\t\t\t\t\t'msg'=>$msgBody['msg'],\n\t\t\t\t\t'contentId'=>$msgBody['contentId'],\n\t\t\t\t\t'status'=>$msgBody['operate_status'],\n\t\t\t\t\t'last_author'=>$this->userInfo['username'],\n\t\t\t\t\t'start_time'=>$msgBody['start_time'],\n\t\t\t\t\t'end_time'=>$msgBody['end_time'],\n\t\t\t\t\t'create_time'=>$currTime,\n\t\t\t\t\t'update_time'=>$currTime,\n\t\t\t\t);\n\t\t\t\t$ret = Client_Service_PushMsg::add($pushData);\n\t\t\t\tif(!$pushData['reciver_type']){ //已经安装和以关注不发送金立push消息\n\t\t\t\t Common::getQueue()->push('game_client_temporary_msg',$ret);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t$ret = Game_Service_Msg::updateMsgInfo($msgBody, intval($msgBody['id']));\n\t\t}\n\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功.'); \t\t\n\t}",
"static public function post_update_messages( $messages, $counts ) {\n\t\t$messages[IncPopupItem::POST_TYPE] = array(\n\t\t\t'updated' => _n( 'One PopUp updated.', '%s PopUps updated.', $counts['updated'] ),\n\t\t\t'locked' => _n( 'One PopUp not updated, somebody is editing it.', '%s PopUps not updated, somebody is editing them.', $counts['locked'] ),\n\t\t\t'deleted' => _n( 'One PopUp permanently deleted.', '%s PopUps permanently deleted.', $counts['deleted'] ),\n\t\t\t'trashed' => _n( 'One PopUp moved to the Trash.', '%s PopUps moved to the Trash.', $counts['trashed'] ),\n\t\t\t'untrashed' => _n( 'One PopUp restored from the Trash.', '%s PopUps restored from the Trash.', $counts['untrashed'] ),\n\t\t);\n\t\treturn $messages;\n\t}",
"protected function onPostUpdate($object)\n {\n // Implements logic for post-update actions here\n }",
"public function update_published_message( $messages ) {\n\t\tglobal $post_type, $post_type_object, $post;\n\t\tif ( ! $this->post_type_is_publicizeable( $post_type ) ) {\n\t\t\treturn $messages;\n\t\t}\n\n\t\t// Bail early if the post is private.\n\t\tif ( 'publish' !== $post->post_status ) {\n\t\t\treturn $messages;\n\t\t}\n\n\t\t$view_post_link_html = '';\n\t\t$viewable = is_post_type_viewable( $post_type_object );\n\t\tif ( $viewable ) {\n\t\t\t$view_text = esc_html__( 'View post' ); // intentionally omitted domain\n\n\t\t\tif ( 'jetpack-portfolio' == $post_type ) {\n\t\t\t\t$view_text = esc_html__( 'View project', 'jetpack' );\n\t\t\t}\n\n\t\t\t$view_post_link_html = sprintf( ' <a href=\"%1$s\">%2$s</a>',\n\t\t\t\tesc_url( get_permalink( $post ) ),\n\t\t\t\t$view_text\n\t\t\t);\n\t\t}\n\n\t\t$services = $this->get_publicizing_services( $post->ID );\n\t\tif ( empty( $services ) ) {\n\t\t\treturn $messages;\n\t\t}\n\n\t\t$labels = array();\n\t\tforeach ( $services as $service_name => $display_names ) {\n\t\t\t$labels[] = sprintf(\n\t\t\t\t/* translators: Service name is %1$s, and account name is %2$s. */\n\t\t\t\tesc_html__( '%1$s (%2$s)', 'jetpack' ),\n\t\t\t\tesc_html( $service_name ),\n\t\t\t\tesc_html( implode( ', ', $display_names ) )\n\t\t\t);\n\t\t}\n\n\t\t$messages['post'][6] = sprintf(\n\t\t\t/* translators: %1$s is a comma-separated list of services and accounts. Ex. Facebook (@jetpack), Twitter (@jetpack) */\n\t\t\tesc_html__( 'Post published and sharing on %1$s.', 'jetpack' ),\n\t\t\timplode( ', ', $labels )\n\t\t) . $view_post_link_html;\n\n\t\tif ( $post_type == 'post' && class_exists('Jetpack_Subscriptions' ) ) {\n\t\t\t$subscription = Jetpack_Subscriptions::init();\n\t\t\tif ( $subscription->should_email_post_to_subscribers( $post ) ) {\n\t\t\t\t$messages['post'][6] = sprintf(\n\t\t\t\t\t/* translators: %1$s is a comma-separated list of services and accounts. Ex. Facebook (@jetpack), Twitter (@jetpack) */\n\t\t\t\t\tesc_html__( 'Post published, sending emails to subscribers and sharing post on %1$s.', 'jetpack' ),\n\t\t\t\t\timplode( ', ', $labels )\n\t\t\t\t) . $view_post_link_html;\n\t\t\t}\n\t\t}\n\n\t\t$messages['jetpack-portfolio'][6] = sprintf(\n\t\t\t/* translators: %1$s is a comma-separated list of services and accounts. Ex. Facebook (@jetpack), Twitter (@jetpack) */\n\t\t\tesc_html__( 'Project published and sharing project on %1$s.', 'jetpack' ),\n\t\t\timplode( ', ', $labels )\n\t\t) . $view_post_link_html;\n\n\t\treturn $messages;\n\t}",
"public function update(PostType $post_type,Requests\\postTypeRequest $request)\n\t{\n $post_type->update($request->all());\n Session()->flash('flash_message','Post has been Updated !');\n return redirect('post_type');\n\t}",
"public function updated_messages( $messages ) {\n\t\t\tglobal $post, $post_ID;\n\t\t\t$messages[\"art\"] = $messages[\"employment\"] = array(\n\t\t\t\t0 => '', // Unused. Messages start at index 1.\n\t\t\t\t1 => sprintf( 'Page updated. <a href=\"%s\">View page</a>', esc_url( get_permalink($post_ID) ) ),\n\t\t\t\t2 => 'Custom field updated.',\n\t\t\t\t3 => 'Custom field deleted.',\n\t\t\t\t4 => 'Page updated.',\n\t\t\t\t5 => isset($_GET['revision']) ? sprintf( 'Page restored to revision from %s', wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t\t\t\t6 => sprintf( 'Page published. <a href=\"%s\">View page</a>', esc_url( get_permalink($post_ID) ) ),\n\t\t\t\t7 => 'Page saved.',\n\t\t\t\t8 => sprintf( 'Page submitted. <a target=\"_blank\" href=\"%s\">Preview page</a>', esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),\n\t\t\t\t9 => sprintf( 'Page scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview page</a>', date_i18n( 'M j, Y @ G:i', strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),\n\t\t\t\t10 => sprintf( 'Draft updated. <a target=\"_blank\" href=\"%s\">Preview page</a>', esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),\n\t\t\t);\n\t\t\treturn $messages;\n\t\t}",
"public function post_type_register() {\n /*\n * REGISTER POST TYPE FOR MESSAGES\n */\n $labels = array(\n 'all_items' => __( 'Messages', 'yith-woocommerce-membership' ),\n 'name' => __( 'Messages', 'yith-woocommerce-membership' ),\n 'singular_name' => __( 'Message', 'yith-woocommerce-membership' ),\n 'add_new' => __( 'Add Message', 'yith-woocommerce-membership' ),\n 'add_new_item' => __( 'New Message', 'yith-woocommerce-membership' ),\n 'edit_item' => __( 'Message', 'yith-woocommerce-membership' ),\n 'view_item' => __( 'View Message', 'yith-woocommerce-membership' ),\n 'not_found' => __( 'Message not found', 'yith-woocommerce-membership' ),\n 'not_found_in_trash' => __( 'Message not found in trash', 'yith-woocommerce-membership' )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n 'menu_position' => 10,\n 'exclude_from_search' => true,\n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'rewrite' => true,\n 'has_archive' => false,\n 'hierarchical' => false,\n 'show_in_nav_menus' => false,\n 'show_in_menu' => 'edit.php?post_type=yith-wcmbs-plan',\n 'menu_icon' => 'dashicons-groups',\n 'supports' => false,\n 'register_meta_box_cb' => array( $this, 'register_metaboxes' )\n );\n\n register_post_type( 'yith-wcmbs-thread', $args );\n }",
"public static function postUpdateCmd()\r\n\t{\r\n\r\n\t}",
"public static function register_admin_notices() {\n\n\t\tif ( ! function_exists( 'bf_add_notice' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$watched = get_option( 'aoculus-messages-watched', array() );\n\t\t$message = get_option( 'oculus-messages', array() );\n\n\t\tif ( ! $message ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$need_update = false;\n\n\t\tif ( ! empty( $message['notices'] ) ) {\n\n\t\t\tforeach ( (array) $message['notices'] as $index => $notice ) {\n\n\t\t\t\tif ( empty( $notice->id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$notice = get_object_vars( $notice );\n\n\t\t\t\tbf_add_notice( $notice );\n\n\t\t\t\t$need_update = true;\n\t\t\t\tunset( $message['notices'][ $index ] );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $need_update ) {\n\t\t\tupdate_option( 'oculus-messages', $message, 'no' );\n\t\t}\n\t}",
"public function meta_box_update( $post ) {\n\t\twp_nonce_field( 'pronamic_payment_update', 'pronamic_payment_update_nonce' );\n\n\t\tinclude Pronamic_WP_Pay_Plugin::$dirname . '/admin/meta-box-payment-update.php';\n\t}",
"function cfcpt_save_custom_post_type($post_id,$post) {\n\t\tglobal $wpdb;\n\t\tif($post->post_type == 'revision') { return; }\n\t\t// if(isset($_POST['cfcpt'])) {\n\t\t// \t$post_type = get_post_meta($post_id,'_post_type',true);\n\t\t// \tcfcpt_update_post($post_id,$post_type);\n\t\t// }\n\t}"
] | [
"0.7317888",
"0.64147925",
"0.6378192",
"0.61892325",
"0.61741954",
"0.6170294",
"0.6149463",
"0.6060885",
"0.60377073",
"0.60174024",
"0.5965259",
"0.59580255",
"0.59170747",
"0.5896836",
"0.5861731",
"0.5850475",
"0.58317804",
"0.5818846",
"0.5803279",
"0.5794757",
"0.5778848",
"0.5752317",
"0.5745981",
"0.5740708",
"0.573549",
"0.57226163",
"0.5700903",
"0.56899756",
"0.56446904",
"0.56402564"
] | 0.7740243 | 0 |
Get all layout types. | public function get_layout_type() {
return array(
'0' => __( '— Select —', 'astra-addon' ),
'header' => __( 'Header', 'astra-addon' ),
'footer' => __( 'Footer', 'astra-addon' ),
'404-page' => __( '404 Page', 'astra-addon' ),
'hooks' => __( 'Hooks', 'astra-addon' ),
'content' => __( 'Inside Post/Page Content', 'astra-addon' ),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getLayoutBoxTypes()\n {\n $types = [];\n foreach ($this->configurators as $id => $configurator) {\n $types[$id] = sprintf('%s - %s', $id, $this->trans($configurator->getName()));\n }\n\n return $types;\n }",
"public function getTypes();",
"public static function getLayouts(): array;",
"public static function getAllLayouts()\n\t{\n\t\t$all = (new \\App\\Db\\Query())->select(['name', 'label'])->from('vtiger_layout')->all();\n\t\t$folders = [\n\t\t\t'basic' => Language::translate('LBL_DEFAULT'),\n\t\t];\n\t\tforeach ($all as $row) {\n\t\t\t$folders[$row['name']] = Language::translate($row['label']);\n\t\t}\n\n\t\treturn $folders;\n\t}",
"public static function getLayouts() {\n static $layouts = FALSE;\n\n if (!$layouts) {\n // This can be called before ds_update_8003() has run. If that is the case\n // return an empty array and don't static cache anything.\n if (!\\Drupal::hasService('plugin.manager.core.layout')) {\n return [];\n }\n $layouts = \\Drupal::service('plugin.manager.core.layout')->getDefinitions();\n }\n\n return $layouts;\n }",
"public function getAllTypes() {\n if (empty($this->_data)) {\n $this->_load();\n }\n\n return $this->_data;\n }",
"public static function getViewTypes() {\n return array_keys(self::$view_types);\n }",
"private function getLayoutType() {\n $detector = new MobileDetect();\n $isMobile = $detector->isMobile();\n $isTablet = $detector->isTablet();\n unset($detector);\n\n return array('isMobile' => $isMobile, 'isTablet' => $isTablet, 'isDesktop' => (!$isMobile && !$isTablet));\n }",
"abstract public function getTypes();",
"public static function getTypes();",
"public function getSchemaCollections()\n {\n return $this->types;\n }",
"public function allTypes()\n {\n return array_keys($this->_typeIndex);\n }",
"static public function get_viewtypes() {\n return array(\n self::ALL,\n self::PAID,\n );\n }",
"public function getViewtypes() {\n\t\treturn array_keys($this->getViewsData()['locations']);\n\t}",
"public function getLayoutList()\n {\n // get a list of all the layouts\n $layouts = File::files(base_path(config('pilot.plugins.pages.pathToPageLayouts', 'vendor/flex360/pilot/resources/views/layouts')));\n\n // clean up paths\n foreach ($layouts as $index => $layout) {\n // manipulate the path into a blade friendly form\n $layout = str_replace(base_path(config('pilot.plugins.pages.pathToLayoutCleanup', 'vendor/flex360/pilot/resources/views/')), '', $layout);\n\n $layout = str_replace('.blade.php', '', $layout);\n\n $layout = str_replace('.php', '', $layout);\n\n $layout = str_replace('/', '.', $layout);\n\n // remove the old layout\n unset($layouts[$index]);\n\n // add the layout in a select list friendly format\n $layouts[$layout] = ucfirst(substr($layout, strrpos($layout, '.') + 1));\n\n // remove any ignored layouts\n $ignoredLayouts = config('pilot.plugins.pages.ignoredLayouts');\n\n // ignore home layout when not the root page\n if (!$this->isRoot()) {\n $ignoredLayouts[] = 'layouts.home';\n }\n\n if (in_array($layout, $ignoredLayouts)) {\n unset($layouts[$layout]);\n }\n }\n\n return $layouts;\n }",
"function getLayouts(): array\n {\n return array_keys($this->options['layouts']);\n }",
"public function index()\n {\n return $this->type->getAll();\n }",
"public function types()\n {\n $directories = $this->file->directories($this->themePath);\n $types = [];\n\n foreach($directories as $directory) {\n $types[] = $this->findDirectoryName($directory);\n }\n\n return $types;\n }",
"public function getTypes() {\n\t\treturn $this->types;\n\t}",
"public function getTypes()\n {\n return $this->types;\n }",
"public function getTypes()\n {\n return $this->types;\n }",
"public static function get_types() {\n\t return self::$types;\n\t}",
"public function types() {\n\t\treturn $this->getEntity($this->invokeGet(\"_types\"));\n\t}",
"public function getTypes()\n {\n return array_values($this->resourceTypes);\n }",
"public function layoutType(): string;",
"protected function get_types() {\r\n\t\treturn $this->types;\r\n\t}",
"public function getAllType() {\n try {\n $this->openDb();\n $res = $this->contactsGateway->selectAllType();\n $this->closeDb();\n return $res;\n } catch (Exception $e) {\n $this->closeDb();\n throw $e;\n }\n }",
"function getDatatypes(){\n return $this->getTypes();\n }",
"public function getContentTypesFlat()\n {\n $content = Config::get('content_types');\n $types = array();\n foreach ($content as $k => $v) {\n foreach ($v as $o) {\n $types[] = $o;\n }\n }\n return $types;\n }",
"public function getAllTypes () : array\n {\n return $this->typeRegistry->getAll();\n }"
] | [
"0.64542824",
"0.6443282",
"0.64232886",
"0.6398737",
"0.6386583",
"0.6363148",
"0.63147646",
"0.6305305",
"0.6283621",
"0.6264543",
"0.6246304",
"0.62154716",
"0.6150236",
"0.6120259",
"0.6116505",
"0.6113688",
"0.607513",
"0.6029961",
"0.5994215",
"0.59891653",
"0.59891653",
"0.5976343",
"0.5975008",
"0.59618855",
"0.595611",
"0.5933048",
"0.5919679",
"0.5918476",
"0.59045494",
"0.58981407"
] | 0.6465627 | 0 |
Ajax request to toggle the display advanced hook. | public function ast_advanced_hook_display_toggle() {
check_ajax_referer( 'astra-addon-enable-tgl-nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
wp_send_json_error();
}
if ( ! isset( $_REQUEST['post_id'] ) ) {
wp_send_json_error();
}
if ( ! isset( $_REQUEST['enable'] ) ) {
wp_send_json_error();
}
$post_id = sanitize_text_field( intval( $_REQUEST['post_id'] ) );
$enabled = sanitize_text_field( $_REQUEST['enable'] );
if ( 'yes' !== $enabled && 'no' !== $enabled ) {
wp_send_json_error();
}
if ( ! $post_id ) {
wp_send_json_error();
}
update_post_meta( $post_id, 'ast-advanced-hook-enabled', $enabled );
wp_send_json_success( array() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function displayAjax()\n\t{\n\t}",
"public function ajax_render_conditional_logic_advanced_value() {\n\n\t\t\t// Validate\n\t\t\tif ( ! acf_verify_ajax() ) {\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t// call function\n\t\t\t$this->render_conditional_logic_advanced_value( $_POST );\n\n\t\t\t// die\n\t\t\tdie();\n\t\t}",
"public function displayAjax()\n\t{\n\t\t// ----------------------\n\t\t$preview = '';\n\t\t$parameters = array(\n\t\t\t'account_id' => $this->session_api->account_id,\n\t\t\t'campaign_id' => $this->campaign_infos['campaign_api_message_id']\n\t\t);\n\n\t\tif ($this->session_api->call('email', 'campaign', 'get_preview', $parameters, $preview))\n\t\t\tdie($preview);\n\t\telse\n\t\t\tdie(sprintf($this->module->l('Error during communication with Express-Mailing API : %s', 'adminmarketingestep8'),\n\t\t\t\t\t\t\t$this->session_api->getError()));\n\n\t}",
"function moments_qodef_is_ajax_enabled() {\n\t\treturn false;\n\t}",
"public function ajaxGbShowConclusion() {\n $mob = $_POST['MOB'];\n\n $where = self::getUserInfoPost();\n $res = DbBadge::setBadgeGot($where, $mob);\n\n if($res) {\n $getBadgeTemp = GetBadgeTemp::getInstance();\n echo $getBadgeTemp->showConclusionsStep();\n } else {\n // Error\n echo $res;\n }\n\n wp_die();\n }",
"public function toggleautosubscription()\n {\n if (dzk_available(false) == false) {\n \treturn new Zikula_Response_Ajax_Unavailable(array(), strip_tags($this->getVar('forum_disabled_info')));\n }\n \t\n SessionUtil::setVar('zk_ajax_call', 'ajax');\n \n /*if (!SecurityUtil::confirmAuthKey()) {\n LogUtil::registerAuthidError();\n return AjaxUtil::error(null, array(), true, true);\n }*/\n \n\n $newmode = ((int)ModUtil::apiFunc('Dizkus', 'user', 'togglenewtopicsubscription') == 1) ? 'autosubscription' : 'noautosubscription';\n return new Zikula_Response_Ajax(array('data' => $newmode));\n }",
"function bbp_is_ajax()\n{\n}",
"function setDisplay($bool);",
"function overlay_ajax() {\n\t\t$url = $this->action_url( $_GET['url'] );\n\t\t$source_url = esc_url( urldecode( $_GET['url'] ) );\n\t\t$remove = isset($_GET['remove']) ? esc_attr( urldecode( $_GET['remove'] ) ) : '';\n\t\t$title = isset($_GET['title']) ? esc_html( urldecode( $_GET['title'] ) ) : '';\n\t\t$plain_html = isset( $_GET['plain_html'] );\n\t\t$source_url = $this->remove_action_render( $source_url );\n\t\t$has_source = $this->options['default']['source'];\t//seems to be a depricated parameter. Need to spend a bit more time to confirm later maybe.\n\n\t\t// constuct\n\t\t$wiki_page_id = isset($_GET['wikiembed-url']) ? esc_url( $_GET['wikiembed-url'] ).\",\" : '';\n\n\t\tif ( $this->options['default']['tabs'] == 2 ) $wiki_page_id .= \"accordion,\";\n\t\tif ( $this->options['default']['tabs'] == 1 ) $wiki_page_id .= \"tabs,\";\n\t\tif ( $this->options['default']['no-contents'] ) $wiki_page_id .= \"no-contents,\";\n\t\tif ( $this->options['default']['no-infobox'] ) $wiki_page_id .= \"no-infobox,\";\n\t\tif ( $this->options['default']['no-edit'] ) $wiki_page_id .= \"no-edit,\";\n\n\t\t$wiki_page_id = substr( $wiki_page_id, 0, -1 );\n\n\t\t$content = $this->get_wiki_content(\n\t\t\t$url,\n\t\t\t$this->options['default']['tabs']=='2',\n\t\t\t$this->options['default']['tabs']=='1',\n\t\t\t$this->options['default']['no-contents'],\n\t\t\t$this->options['default']['no-edit'],\n\t\t\t$this->options['default']['no-infobox'],\n\t\t\t$this->options['wiki-links'],\n\t\t\t$has_source,\n\t\t\t$remove\n\t\t);\n\n\t\tif ( $plain_html ):\n\t\t\techo $content;\n\t\telse:\n\t\t\t?>\n\t\t\t<!doctype html>\n\n\t\t\t<!--[if lt IE 7 ]> <html class=\"ie6\" <?php language_attributes(); ?>> <![endif]-->\n\t\t\t<!--[if IE 7 ]> <html class=\"ie7\" <?php language_attributes(); ?>> <![endif]-->\n\t\t\t<!--[if IE 8 ]> <html class=\"ie8\" <?php language_attributes(); ?>> <![endif]-->\n\t\t\t<!--[if (gte IE 9)|!(IE)]><!--> <html <?php language_attributes(); ?>> <!--<![endif]-->\n\t\t\t\t<head>\n\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>\" />\n\t\t\t\t\t<title><?php echo urldecode(esc_attr($_GET['title'])); ?></title>\n\n\t\t\t\t\t<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js\"></script>\n\t\t\t\t\t<link media=\"screen\" href=\"<?php bloginfo('stylesheet_url')?>\" type=\"text/css\" rel=\"stylesheet\" >\n\t\t\t\t\t<link media=\"screen\" href=\"<?php echo WIKI_EMBED_URL ; ?>resources/css/wiki-embed.css\" type=\"text/css\" rel=\"stylesheet\" >\n\t\t\t\t\t<link media=\"screen\" href=\"<?php echo WIKI_EMBED_URL ; ?>resources/css/wiki-overlay.css\" type=\"text/css\" rel=\"stylesheet\" >\n\t\t\t\t\t<script src=\"<?php echo WIKI_EMBED_URL ; ?>resources/js/wiki-embed-overlay.js\" ></script>\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t\t<div id=\"wiki-embed-iframe\">\n\t\t\t\t\t\t<div class=\"wiki-embed-content\">\n\t\t\t\t\t\t\t<h1 class=\"wiki-embed-title\" ><?php echo $title; ?></h1>\n\t\t\t\t\t\t\t<?php echo $content; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t\t<?php\n\t\tendif;\n\t\tdie(); // don't need any more help\n\t}",
"public function toggleShowLastSurveyAndQuestion()\n {\n if ( Permission::model()->hasGlobalPermission('settings', 'update') )\n {\n $bNewShowLastSurveyAndQuestion = (getGlobalSetting('show_last_survey_and_question')==\"show\")?\"hide\":\"show\";\n setGlobalSetting('show_last_survey_and_question', $bNewShowLastSurveyAndQuestion);\n echo $bNewShowLastSurveyAndQuestion;\n }\n }",
"public function adminAjax()\r\n\t{\r\n\t\treturn;\r\n\t}",
"public function isAjaxEnabled()\n {\n if (!$this->isEnabled()) {\n return false;\n }\n return Mage::getStoreConfigFlag('advancedproductfilters/catalog/ajax_enabled');\n }",
"public function advanced()\n\t{ \n // Initialise variables.\n $app = JFactory::getApplication();\n $app->input->set('mode', 'advanced');\n $this->processForm();\n\t}",
"public function setAjax($settings = array()){\n return lee_set_ajax_submit($settings);\n}",
"public function is_ajax();",
"public function is_ajax();",
"function show_graduate_details() {\n // make sure it is an ajax call\n if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {\n \n if (isset($_GET['nid']) && $_GET['nid'] != '') {\n $graduate = node_load($_GET['nid']);\n \n $data = array(\n 'nid' => $graduate->nid,\n 'firstName' => get_obj_field_value($graduate, 'field_graduate_firstname'),\n 'lastName' => get_obj_field_value($graduate, 'field_graduate_lastname'),\n 'occupation' => get_obj_field_value($graduate, 'field_graduate_occupation'),\n 'company' => get_obj_field_value($graduate, 'field_graduate_company'),\n 'motto' => get_obj_field_value($graduate, 'field_graduate_motto'),\n 'graduateSchool' => get_obj_field_value($graduate, 'field_graduate_school'),\n 'coverImageDesktop' => get_obj_field_img_info($graduate, 'field_graduate_cover_image'),\n 'coverImageMobile' => get_obj_field_img_info($graduate, 'field_graduate_cover_img_mobile'),\n 'workList' => array(),\n 'biographyList' => array(),\n );\n \n $imageInfo = get_obj_field_img_info($graduate, 'field_graduate_profile_image');\n $data['profileImageUrl'] = $imageInfo['url'];\n $data['profileImageAlt'] = $imageInfo['alt'];\n $data['profileImageTitle'] = $imageInfo['title'];\n \n // Get work list\n if (isset($graduate->field_graduate_work_list['und']) && $graduate->field_graduate_work_list['und']) {\n foreach ($graduate->field_graduate_work_list['und'] as $item) {\n $fc = entity_load('field_collection_item', array($item['value']));\n $fc = $fc[$item['value']];\n $imageInfo = get_obj_field_img_info($fc, 'field_graduate_work_image');\n \n $data['workList'][] = array(\n 'imageUrl' => $imageInfo['url'],\n 'imageAlt' => $imageInfo['alt'],\n 'imageTitle' => $imageInfo['title'],\n 'caption' => get_obj_field_value($fc, 'field_graduate_work_caption'),\n );\n }\n }\n \n // Get biography list\n if (isset($graduate->field_graduate_biography_list['und']) && $graduate->field_graduate_biography_list['und']) {\n $ctr = 0;\n foreach ($graduate->field_graduate_biography_list['und'] as $item) {\n $fc = entity_load('field_collection_item', array($item['value']));\n $fc = $fc[$item['value']];\n \n $data['biographyList'][$ctr] = array(\n 'title' => get_obj_field_value($fc, 'field_graduate_biography_title'),\n 'content' => get_obj_field_value($fc, 'field_graduate_biography_content'),\n );\n \n $ctr++;\n }\n }\n \n // Get header title\n $pageNode = get_graduate_page_info();\n if ($pageNode) {\n $data['headerTitle'] = get_obj_field_value($pageNode, 'field_glp_detail_header_title');\n }\n \n print theme('graduate_detail_template', $data);\n } else {\n print '';\n }\n }\n}",
"function pyis_dpd_helpscout_do_field_toggle( $args = array() ) {\n\tpyis_dpd_helpscout_fieldhelpers()->fields->do_field_toggle( $args['name'], $args );\n}",
"public function advanced_settings_callback() {\n if (isset($_REQUEST['settings-updated'])) {\n //This status message need to be in the callback function to prevent header sent warning\n echo '<div id=\"message\" class=\"updated fade\"><p>' . SwpmUtils::_('Settings updated!') . '</p></div>';\n }\n \n SwpmUtils::e('This page allows you to configure some advanced features of the plugin.');\n }",
"private function fetchOptions()\n {\n if($this->option('off'))\n $this->toggle = 'off';\n\n if($this->option('on'))\n $this->toggle = 'on';\n }",
"function printZDSearchToggleJS() { ?>\r\n\t<script type=\"text/javascript\">\r\n\tfunction toggleExtraElements(category, show) {\r\n\t\tif (show) {\r\n\t\t\tjQuery('.'+category+'_showless').show();\r\n\t\t\tjQuery('.'+category+'_showmore').hide();\r\n\t\t\tjQuery('.'+category+'_extrashow').show();\r\n\t\t} else {\r\n\t\t\tjQuery('.'+category+'_showless').hide();\r\n\t\t\tjQuery('.'+category+'_showmore').show();\r\n\t\t\tjQuery('.'+category+'_extrashow').hide();\r\n\t\t}\r\n\t}\r\n\t</script>\r\n<?php\r\n}",
"function os_sv_list_query_details_ajax($form, &$form_state) {\n return $form['options']['query_details'];\n}",
"function wpcf_admin_usermeta_get_ajax_link($status, $group_id)\n{\n /**\n * sanitize status\n */\n if ( !preg_match('/^(de)?activate$/', $status ) ) {\n return '#wrong-status';\n }\n /**\n * sanitize group_id\n */\n if ( !is_numeric($group_id) ) {\n return '#wrong-group_id';\n }\n /**\n * build link\n */\n return esc_url(\n add_query_arg(\n array(\n 'action' => 'wpcf_ajax',\n 'wpcf_action' => $status.'_user_group',\n 'group_id' => $group_id,\n 'wpcf_ajax_update' => 'wpcf_list_ajax_response_' . $group_id,\n '_wpnonce' => '' . wp_create_nonce($status.'_user_group'),\n ),\n admin_url('admin-ajax.php')\n )\n );\n}",
"function invit0r_display_ajax()\r\n{\r\n\tinvit0r_display($_SESSION['invit0r_display']);\r\n\tdie();\r\n}",
"public function plugin_toggle_cb() {\n\t\tprintf( '<input name=\"rda_toggle_plugin_off\" type=\"checkbox\" value=\"1\" class=\"code\" %1$s/>%2$s',\n\t\t\tchecked( esc_attr( $this->settings['toggle_plugin_off'] ), true, false ),\n\t\t\tesc_html__( ' Disable access controls and redirection', 'remove_dashboard_access' )\n\t\t);\n\t}",
"public static function pageAjax() {\n if ( isset($_POST['get_started']) ) {\n // check for required privileges to perform action\n if ( function_exists('current_user_can') && !current_user_can('manage_options') ) {\n echo Zend_Json::encode(array('success' => false));\n die;\n }\n\n if ( function_exists('check_admin_referer') ) {\n check_admin_referer('laterpay_form');\n }\n\n // save initial settings\n update_option('laterpay_sandbox_api_key', $_POST['get_started']['laterpay_sandbox_api_key']);\n update_option('laterpay_sandbox_merchant_id', $_POST['get_started']['laterpay_sandbox_merchant_id']);\n update_option('laterpay_global_price', $_POST['get_started']['laterpay_global_price']);\n update_option('laterpay_currency', $_POST['get_started']['laterpay_currency']);\n update_option('laterpay_plugin_is_activated', '1');\n\n // automatically dismiss pointer to LaterPay plugin after saving the initial settings\n $current_user_id = get_current_user_id();\n $dismissed_pointers = explode(',', (string)get_user_meta($current_user_id, 'dismissed_wp_pointers', true));\n\n if ( !in_array(AdminController::ADMIN_MENU_POINTER, $dismissed_pointers) ) {\n update_user_meta($current_user_id, 'dismissed_wp_pointers', AdminController::ADMIN_MENU_POINTER);\n }\n\n echo Zend_Json::encode(array('success' => true));\n die;\n }\n }",
"public function ajax_handle(){\n\t check_admin_referer( 'fpbt_five_star_wp_rate_action_nonce', '_n' );\n\t $data = get_option(\"filter_page_by_template_data\", array() );\n\t $data['wp_rate_notice_clicked'] = 1;\n\t update_option(\"filter_page_by_template_data\", $data );\n\t echo 1 ;\n\t exit;\n\t}",
"public function toggleShowLogoStatus()\n {\n if ( Permission::model()->hasGlobalPermission('settings', 'update') )\n {\n $bNewShowLogo = (getGlobalSetting('show_logo')==\"show\")?\"hide\":\"show\";\n setGlobalSetting('show_logo', $bNewShowLogo);\n echo $bNewShowLogo;\n }\n }",
"public function ajaxChangeProduct()\n {\n $showcase_id = Input::get('showcase_id');\n $card_id = Input::get('card_id');\n \n $card = Card::find($card_id);\n \n return $this->view('catalog.showcase.options', compact('showcase_id', 'card'));\n \n exit;\n }",
"public function toggle_status() {\n\t\t\tself::ajax_headers();\n\n\t\t\t$error = false;\n\n\t\t\tif ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['nonce'] ), 'ibx_wpfomo_toggle_status' ) ) {\n\t\t\t\t$error = true;\n\t\t\t}\n\n\t\t\tif ( ! isset( $_POST['post_id'] ) || empty( $_POST['post_id'] ) || ! absint( $_POST['post_id'] ) ) {\n\t\t\t\t$error = true;\n\t\t\t}\n\n\t\t\tif ( $error ) {\n\t\t\t\t_e( 'There is an error updating status.', 'ibx-wpfomo' );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t$post_id = absint( $_POST['post_id'] );\n\t\t\t$status = 'active' == sanitize_text_field( $_POST['status'] ) ? '1' : '0';\n\n\t\t\tupdate_post_meta( $post_id, 'ibx_wpfomo_active_check', $status );\n\n\t\t\techo 'success';\n\t\t\tdie();\n\t\t}"
] | [
"0.6117878",
"0.6107194",
"0.58013636",
"0.5711453",
"0.5690275",
"0.56526303",
"0.55547845",
"0.5505647",
"0.5493773",
"0.5493472",
"0.5487382",
"0.54789895",
"0.5415322",
"0.540867",
"0.54071724",
"0.54071724",
"0.5405126",
"0.53803104",
"0.5373898",
"0.53653336",
"0.53520805",
"0.53288895",
"0.53200763",
"0.53089905",
"0.5291675",
"0.5284506",
"0.5276713",
"0.5257723",
"0.52499455",
"0.524378"
] | 0.75385064 | 0 |
HTML Template for custom layout preview. | public function layout_preview_template() {
?>
<div class="ast-custom-layout-preview-wrapper"></div>
<script type="text/template" id="tmpl-ast-modal-view-layout-details">
<div class="ast-layout-modal ast-data-preview">
<div class="ast-layout-modal-content">
<section class="ast-layout-modal-main" role="main">
<header class="ast-layout-modal-header">
<mark class="layout-status"><span>{{ data.layout_type }}</span></mark>
<h1> {{ data.title }} </h1>
<button id="modal-close-link" class="modal-close modal-close-link dashicons dashicons-no-alt">
<span class="screen-reader-text"><?php esc_html_e( 'Close modal panel', 'astra-addon' ); ?></span>
</button>
</header>
<article>
<?php do_action( 'astra_addon_custom_layout_preview_start' ); ?>
<div class="ast-layout-preview-row">
<div class="ast-layout-preview-col">
<h3><?php esc_html_e( 'Display On:', 'astra-addon' ); ?></h3>
</div>
<div class="ast-layout-preview-col right">
{{{ data.display_rules }}}
</div>
<div class="ast-layout-preview-col">
<h3><?php esc_html_e( 'Do Not Display On:', 'astra-addon' ); ?></h3>
</div>
<div class="ast-layout-preview-col right">
{{{ data.exclusion_rules }}}
</div>
<div class="ast-layout-preview-col">
<h3><?php esc_html_e( 'Display for Users:', 'astra-addon' ); ?></h3>
</div>
<div class="ast-layout-preview-col right">
{{{ data.user_rules }}}
</div>
<div class="ast-layout-preview-col">
<h3><?php esc_html_e( 'Display on Devices:', 'astra-addon' ); ?></h3>
</div>
<div class="ast-layout-preview-col right">
{{{ data.display_devices_rules }}}
</div>
<div class="ast-layout-preview-col">
<h3><?php esc_html_e( 'Time Rule:', 'astra-addon' ); ?></h3>
</div>
<div class="ast-layout-preview-col right">
{{{ data.time_duration_rule }}}
</div>
</div>
<?php do_action( 'astra_addon_custom_layout_preview_end' ); ?>
</article>
<footer>
<div class="inner">
<div class="ast-layout-action-button-group">
<label> <strong> <?php esc_html_e( 'Status: ', 'astra-addon' ); ?> </strong> {{ data.status }} </label> |
<label> <strong> <?php esc_html_e( 'Published date: ', 'astra-addon' ); ?> </strong> {{ data.post_date }} </label>
</div>
<a class="button button-primary button-large" aria-label="<?php esc_attr_e( 'Edit this layout', 'astra-addon' ); ?>" href="{{ data.edit_link }}"><?php esc_html_e( 'Edit Layout', 'astra-addon' ); ?></a>
</div>
</footer>
</section>
</div>
</div>
<div class="ast-layout-modal-backdrop modal-close"></div>
</script>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function renderTemplateWithLayout();",
"public function forTemplate()\n {\n $template = $this->element->config()->get('controller_template');\n\n $viewer = SSViewer::create(\n [\n 'type' => 'Layout',\n 'Syntro\\\\SilverstripeElementalBootstrap\\\\' . $template\n ]\n );\n $html = $this->renderWith($viewer->setRewriteHashLinks(false));\n return $html;\n }",
"public function layout();",
"public function layout() {}",
"public function template() {\n\t\t?>\n <div class=\"input-with-button\">\n <input id=\"{{ id }}\" type=\"hidden\" name=\"{{ name }}\" value=\"{{ value }}\"\n class=\"carbon-image-gallery-field\"/>\n\n <span id=\"c2_open_media{{ id.replace('-', '_') }}\" class=\"button c2_open_media\">\n\t\t\t\t{{{ button_label }}}\n\t\t\t</span>\n </div>\n\n {{{ description }}}\n\t\t<?php\n\t}",
"public function renderLayout(): void;",
"public function render()\n {\n\t$folderId = $this->getFolderId();\n $parentFolderId = NULL;\n\n if ($folderId !== NULL) {\n $parentFolderId = $this->presenter->mediaManagerService->getParentFolderId($folderId);\n }\n\n $templateFile = $this->view ?: 'default';\n $template = parent::initTemplate(__DIR__ . '/templates/'.$templateFile.'.latte');\n $template->cid = $this->presenter->getParam('cid');\n\n $template->folderId = $folderId;\n switch ($templateFile) {\n case 'fileDetail':\n $template->fileId = $this->getFileId();\n break;\n default:\n $template->sortImagesLink = $this->link('sortImages!');\n }\n\n $template->folderContent = $this->getFolderContent();\n $template->parentFolderId = $parentFolderId;\n\n $template->loadLink = $this->link('loadContent!');\n $template->pasteBin = $this['pasteBin'];\n $template->currentSection = $this->getCurrentSection();\n\n $template->render();\n }",
"public function view()\n {\n /* put stuff in main content section of the template*/\n \n\n }",
"public function actionFieldLayout()\n {\n $this->provideTemplate('field_layout');\n }",
"public function layout()\n {\n // making temlate and send data to view.\n $this->template['header'] = $this->load->view('layout/header', $this->data, true);\n $this->template['left'] = $this->load->view('layout/left', $this->data, true);\n $this->template['middle'] = $this->load->view($this->middle, $this->data, true);\n $this->template['footer'] = $this->load->view('layout/footer', $this->data, true);\n\n $this->load->view('layout/index', $this->template);\n }",
"protected function layoutStart() {\r\n $api = Api::getInstance();\r\n if($api->getInput() != null)\r\n $path = $api->getInput()->getPath();\r\n $title = sprintf($this->getConfig('head_title', '%s v%s - Node %s'), $api->getConfig(\"name\"), $api->getConfig(\"version\"), $path);\r\n echo '<!DOCTYPE html>\r\n <html>\r\n <head>\r\n <title>' . $title . '</title>\r\n <meta http-equiv=\"Content-Type\" content=\"' . $this->getConfig(\"content_type\", \"text/html\") . '; charset=UTF-8\" />\r\n <style>\r\n body {font-family: Helvetica, Arial, sans-serif;font-size: 14px;color: #333;padding: 0;margin: 0;}\r\n body > header { width: 900px; padding: 1em; margin: 0 auto 1em auto }\r\n body > article {box-shadow: 5px 5px 10px rgba(0,0,0,0.8); padding: 0 0 .5em 0; border-radius: 5px; width: 900px; margin: 2em auto 0 auto }\r\n body > footer { width: 900px; padding: 0em 0 1em 1em; margin: 1.1em auto 1em auto; color: white; font-size: .75em }\r\n h1 { margin: 0; font-size: 3em; line-height: .8em }\r\n h2 { text-shadow: 1px 1px 1px rgba(0,0,0,0.25); font-size: 2.2em;margin: .2em; }\r\n h3 { text-shadow: 1px 1px 0px rgba(255,255,255,1); font-size: 1.5em;margin: .2em; }\r\n h4 { font-size: 1.2em; margin: .2em; }\r\n p { font-size: 1em; margin: .5em .2em; }\r\n ul {\r\n padding-bottom: 1em;\r\n padding-left: 2em;\r\n }\r\n a {\r\n color: white;\r\n text-decoration: none;\r\n }\r\n body > header h1 { color: #000e44; text-shadow: 0 0 3px rgb(255,255,255), 0 0 10px rgba(255,255,255,1), 0 0 20px rgba(255,255,255,0.6); float: left }\r\n body > header h1 span { color: #0c6f5e }\r\n body > header h2 { color: white; font-size: .7em; font-weight: normal; margin: 2.2em 0 0 1em; float: left }\r\n body > header h3 { color: #0c6f5e; margin: 0; font-size: 2em; float: right }\r\n article header { margin: 0;padding: .3em; box-shadow: 0 0 5px rgba(0,0,0,0.9); border-radius: 5px 5px 0 0; width: 892px; }\r\n article h3 { display: inline; }\r\n article > details { margin: 1em; }\r\n\r\n\r\n body#error { background-color : #533;}\r\n #error article { color : darkred; background-color : rgba(255,255,255,0.9); clear: both }\r\n #error article h2 { color : white; text-shadow: 0 0 2px white, 0 0 15px #600, 3px 3px 8px rgba(50,0,0,0.9); }\r\n #error article header { background-color : rgba(85,51,51,0.6); }\r\n #error h3, #error article a { color : #744; }\r\n #error article a:hover { color : #533; }\r\n #error pre.xdebug-var-dump {font-size:0.8em}\r\n\r\n body#answer { background-color : #353 }\r\n #answer article { color : #575;background-color : rgba(255,255,255,0.9); clear: both }\r\n #answer article h2 { color : white; text-shadow: 0 0 2px rgba(11,45,11,0.9), 0 0 10px rgba(11,45,11,0.8); }\r\n #answer article header { background-color : rgba(51,85,51,0.6); }\r\n #answer h3, #answer article a { color : #686; }\r\n #answer article a:hover { color : #353; }\r\n </style>\r\n </head>';\r\n }",
"private function makeViewLayout()\n {\n new MakeLayout($this, $this->files);\n }",
"public function renderLayout()\r\n\t{\r\n\t\t$this->view->renderLayout();\r\n\t}",
"public function __invoke()\n {\n return view('holonews::layout', [\n 'winkScriptVariables' => Holonews::scriptVariables(),\n ]);\n }",
"protected function getViewOutput() {\n \t\t$output = $this->view->render();\n $htmlParse = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\n \\TYPO3\\CMS\\Core\\Service\\MarkerBasedTemplateService::class\n );\n $output = $htmlParse->getSubpart($output, '###LAYOUT###');\n $output = str_replace('</body>', '', $output);\n\t\treturn $output;\n\t}",
"function preview()\n\t{\n\t\t$this->tpl->addBlockFile(\"ADM_CONTENT\", \"adm_content\", \"tpl.il_svy_qpl_preview.html\", \"Modules/SurveyQuestionPool\");\n\t\t$question_output = $this->getWorkingForm();\n\t\t\n\t\tif ($this->object->getObligatory())\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"required\");\n\t\t\t$this->tpl->setVariable(\"TEXT_REQUIRED\", $this->lng->txt(\"required_field\"));\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t}\n\t\t\n\t\t$this->tpl->setVariable(\"QUESTION_OUTPUT\", $question_output);\n\t}",
"public function create()\n {\n return view('master::layout', ['element' => 'create']);\n }",
"protected function content_template() {}",
"public function content_template() {\n\t\t?>\n\t\t<div class=\"nv-upsell\">\n\t\t\t<# if ( data.options ) { #>\n\t\t\t<ul class=\"nv-upsell-features\">\n\t\t\t\t<# for (option in data.options) { #>\n\t\t\t\t<li>\n\t\t\t\t\t<# if( data.show_pro_label === true ) { #>\n\t\t\t\t\t<span class=\"upsell-pro-label\">{{ data.pro_label }}</span>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t{{ data.options[option] }}\n\t\t\t\t</li>\n\t\t\t\t<# } #>\n\t\t\t</ul>\n\t\t\t<# } #>\n\n\t\t\t<# if ( data.button_text && data.button_url ) { #>\n\t\t\t<a target=\"_blank\" href=\"{{{ data.button_url }}}\" class=\"button button-primary\" target=\"_blank\">{{\n\t\t\t\tdata.button_text }}</a>\n\t\t\t<# } #>\n\n\t\t\t<# if ( data.explained_features.length > 0 ) { #>\n\t\t\t<hr>\n\t\t\t<ul class=\"nv-upsell-feature-list\">\n\t\t\t\t<# for (requirement in data.explained_features) { #>\n\t\t\t\t<li>* {{ data.explained_features[requirement] }}</li>\n\t\t\t\t<# } #>\n\t\t\t</ul>\n\t\t\t<# } #>\n\t\t</div>\n\t\t<?php\n\t}",
"public function render()\n {\n return view('lunarphp-virtual-product::livewire.pages.code-pool.schemas.create')\n ->layout('adminhub::layouts.app', [\n 'title' => __('lunarphp-virtual-product::code-pool.pages.schemas.create.title'),\n ]);\n }",
"protected function render()\n {\n $settings = $this->get_settings_for_display();\n require dirname(__FILE__) . '/' . $settings['layout'] . '.php';\n }",
"public function builder_module_template() {\n echo '<script type=\"text/html\" id=\"tmpl-cv-builder-' . $this->config['handle'] . '\">' . $this->builder_module_callback( $this->get_default_attributes(), $this->config['default_content'] ) . '</script>';\n }",
"public function content_template()\n {\n }",
"public function print_editor_template() {\n\t\tinclude ELEMENTOR_PATH . 'includes/editor-templates/editor-wrapper.php';\n\t}",
"function area2()\n\t{\n\t\t$styleid = util::getData(\"styleid\");\n\t\tframework::useTemplateIndents(false);\n\t\t$this->set(\"styleid\", $styleid);\n\t\techo($this->fetch(\"/remote/preview.tmpl.php\"));\n\t\tdie();\n\t}",
"public function layout()\n {\n //$this->template['header'] = $this->load->view('templates/header', $this->data, true);\n //$this->template['footer'] = $this->load->view('templates/footer', $this->data, true);\n $this->template['page'] = $this->load->view($this->page, $this->data, true);\n $this->load->view('templates/main', $this->template);\n }",
"public function preview(){\n $body = App::request()->getBody();\n $content = $body['content'];\n\n $page = View::makeFromString($content);\n return NoSidebarTab::make(array(\n 'page' => $page,\n 'tabTitle' => Lang::get($this->_plugin . '.page-preview-title', array('page' => $body['name'])),\n 'title' => '',\n 'icon' => 'eye'\n ));\n }",
"function getOverviewTemplate();",
"public function __invoke()\n {\n return view('compass::layout', [\n 'compassScriptVariables' => Compass::scriptVariables(),\n 'assetsAreCurrent' => Compass::assetsAreCurrent(),\n ]);\n }",
"public function content_template()\n {\n ?>\n <button\n type=\"button\"\n class=\"button <?= StaticLayout::NAME ?>-edit-widget-button\"\n >{{{ data.l10n.edit }}}</button><button\n type=\"button\"\n class=\"button dashicons dashicons-admin-page <?= StaticLayout::NAME ?>-duplicate-widget-button\"\n title=\"{{ data.l10n.duplicate }}\"\n ></button><button\n type=\"button\"\n class=\"button dashicons dashicons-trash <?= StaticLayout::NAME ?>-remove-widget-button\"\n title=\"{{ data.l10n.remove }}\"\n ></button><button\n type=\"button\"\n class=\"button dashicons dashicons-sort <?= StaticLayout::NAME ?>-sort-widget-button\"\n title=\"{{ data.l10n.sort }}\"\n ></button>\n <?php\n }"
] | [
"0.69718057",
"0.67536944",
"0.6701519",
"0.6683419",
"0.6507358",
"0.64855385",
"0.6341292",
"0.6273905",
"0.618501",
"0.61833346",
"0.6113274",
"0.61021197",
"0.6094467",
"0.6045408",
"0.60349727",
"0.60284686",
"0.60006833",
"0.6000175",
"0.5992137",
"0.5977704",
"0.59743136",
"0.5964551",
"0.59530175",
"0.5944514",
"0.5935389",
"0.59343976",
"0.5891259",
"0.58870935",
"0.5882434",
"0.5879248"
] | 0.78455585 | 0 |
Return the type of node. Must be one of self::NT_ | abstract public function getNodeType(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNodeType()\n\t{\n\t\treturn $this->nodeType;\n\t}",
"public function getNodeKind() {}",
"public function getType() {\n\t\t\n\t\treturn $this->_type;\n\t}",
"public function node() {\n return \\lang\\XPClass::forName('xp.compiler.ast.TypeDeclarationNode');\n }",
"protected function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function type()\n\t{\n\t\treturn $this->_type;\n\t}",
"public function getType () {\r\n\t\treturn $this->type;\r\n\t}",
"public function getType()\n\t\t{\n\t\t\treturn $this->type;\n\t\t}",
"public function getType()\n\t{\n\t\treturn $this->_type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->_type;\n\t}",
"public function getType() {\n\t\treturn $this->_type;\n\t}",
"public function getType() {\n\t\treturn $this->_type;\n\t}",
"public function getType() {\n\t\treturn $this->_type;\n\t}",
"public function getType() {\n\t\treturn $this->_type;\n\t}",
"public function getType()\n {\n $type = null;\n if (($parent = $this->getParent()) instanceof ElementHandler && $parent->hasAttribute(self::ATTRIBUTE_TYPE)) {\n $type = $parent->getAttribute(self::ATTRIBUTE_TYPE)->getValue(false, false);\n }\n return $type;\n }",
"public function getType()\n\t{\n\t\treturn ($this->type);\n\t}",
"public function type()\n\t{\n\t\treturn $this->type;\n\t}",
"public function type()\n {\n if ($this->_uri) {\n $res = $this->get($this->_uri);\n return $res->type();\n } else {\n return null;\n }\n }",
"public function getType() {\n\t\t\treturn $this->type;\n\t\t}",
"public function getType() {\n\t\t\treturn $this->type;\n\t\t}",
"public function getType() \n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"final public function getType(){\n\t\treturn $this->_type;\n\t}",
"public function getType() {\r\n\r\n\t\treturn $this->type;\r\n\t}",
"public function getType()\n\t {\n\t return $this->_type;\n\t }",
"function getType() {\n\t\treturn $this->_type;\n\t}",
"public function getType() {\n\t\treturn $this->type;\n\t}",
"public function getType() {\n\t\treturn $this->type;\n\t}",
"public function getType() {\n\t\treturn $this->type;\n\t}"
] | [
"0.75364614",
"0.7086198",
"0.6500557",
"0.6500334",
"0.64888215",
"0.6485565",
"0.6467549",
"0.6466796",
"0.6444143",
"0.6444143",
"0.64415497",
"0.64415497",
"0.64415497",
"0.64415497",
"0.64296436",
"0.6429189",
"0.6426144",
"0.6417028",
"0.64069784",
"0.64069784",
"0.6402606",
"0.63918763",
"0.63918763",
"0.6387609",
"0.63742274",
"0.6373096",
"0.6372098",
"0.635957",
"0.635957",
"0.635957"
] | 0.741012 | 1 |
Return the cardinality map for this node. e.g. array( self::NT_JOIN_CONDITION => array(1, 1), // require exactly 1 join condition self::NT_SOURCE => array(2, 2), // exactly 2 sources ); or: array( self::NT_PROPERTY => array(1, null), // require one to many Columns ); or: array( self::NT_PROPERTY => array(null, 1), // require none to 1 properties ); | abstract public function getCardinalityMap(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCardinality() {}",
"public function getMapType()\n {\n if ($this->isRouteMapped())\n {\n return $this::C_ROUTE_FOUND;\n }\n else\n {\n return $this::C_ROUTE_NOT_FOUND;\n }\n }",
"public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t),\n\t\t\t'PARENT_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t),\n\t\t\t'PATH_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t),\n\t\t\t'DEPTH_LEVEL' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'default_value' => 0,\n\t\t\t),\n\t\t\t'PATH' => array(\n\t\t\t\t'data_type' => '\\Bitrix\\Translate\\Index\\Internals\\PathIndexTable',\n\t\t\t\t'reference' => array(\n\t\t\t\t\t'=this.PATH_ID' => 'ref.ID',\n\t\t\t\t),\n\t\t\t\t'join_type' => 'INNER',\n\t\t\t),\n\t\t);\n\t}",
"protected function getMap() : array\n {\n return [\n 'bank' => [0, 0],\n 'branch' => [0, 0, 0, 0],\n 'account' => [0, 7, 6, 5, 4, 3, 2, 1],\n 'suffix' => [0, 0, 0, 0],\n 'modulo' => 11,\n ];\n }",
"public static function getMap(): array\n\t{\n\t\treturn [\n\n\t\t\t'GROUP_ID' => [\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t],\n\t\t\t'MEMBER_TYPE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'primary' => true,\n\t\t\t),\n\t\t\t'USER_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t),\n\t\t\t'TYPE_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t),\n\t\t\t'VIEWED_DATE' => [\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t\t'required' => true,\n\t\t\t]\n\t\t];\n\t}",
"public static function getMap()\n\t{\n\t\treturn [\n\t\t\t'ID' => [\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t],\n\t\t\t'TRACE_ID' => [\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'required' => true,\n\t\t\t],\n\t\t\t'CODE' => [\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'required' => true,\n\t\t\t],\n\t\t\t'VALUE' => [\n\t\t\t\t'data_type' => 'string',\n\t\t\t],\n\t\t\t'TRACE' => [\n\t\t\t\t'data_type' => TraceTable::class,\n\t\t\t\t'reference' => ['=this.TRACE_ID' => 'ref.ID'],\n\t\t\t],\n\t\t];\n\t}",
"public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t),\n\t\t\t'DATE_CREATE' => array(\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t\t'default_value' => new Type\\DateTime(),\n\t\t\t),\n\t\t\t'FEED_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t),\n\t\t\t'ELEMENT_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t),\n\t\t\t'IBLOCK_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t),\n\t\t\t'LINK' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'type_field' => 'lid',\n\t\t\t),\n\t\t\t'DELETE_MARK' => array(\n\t\t\t\t'data_type' => 'boolean',\n\t\t\t\t'default' => self::RIGHT_TO_LEFT, \n\t\t\t\t'values' => array(self::RIGHT_TO_LEFT, self::LEFT_TO_RIGHT),\n\t\t\t\t'editable' => true,\n\t\t\t),\t\n 'ITEM' => array(\n 'data_type' => 'string',\n 'serialized' => true,\n ),\n\t\t);\n\t}",
"public function constraints_types()\n {\n return array_keys($this->_constraints);\n }",
"public function countCaches(): array\n {\n return [\n 'discuss_post_count' => [User::class, 'user_id', 'id'],\n 'post_count' => [DiscussConversation::class, 'conversation_id', 'id']\n ];\n }",
"public static function GetKeyMaps()\n\t{\n\t\tstatic $km = null;\n\t\tif ($km == null)\n\t\t{\n\t\t\t$km = Array();\n\t\t\t$km[\"m_FK_source\"] = new KeyMap(\"m_FK_source\", \"SourceUserId\", \"User\", \"Id\", KM_TYPE_MANYTOONE, KM_LOAD_LAZY); // you change to KM_LOAD_EAGER here or (preferrably) make the change in _config.php\n\t\t\t$km[\"m_FK_target\"] = new KeyMap(\"m_FK_target\", \"SourceTargetId\", \"User\", \"Id\", KM_TYPE_MANYTOONE, KM_LOAD_LAZY); // you change to KM_LOAD_EAGER here or (preferrably) make the change in _config.php\n\t\t}\n\t\treturn $km;\n\t}",
"public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t),\n\t\t\t'USER_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'required' => true,\n\t\t\t),\n\t\t\t'TASK_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'required' => true,\n\t\t\t),\n\t\t\t'REMIND_DATE' => array(\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t\t'required' => true,\n\t\t\t),\n\t\t\t'TYPE' => array(\n\t\t\t\t'data_type' => 'enum',\n\t\t\t\t'values' => array(\n\t\t\t\t\tself::TYPE_DEADLINE,\n\t\t\t\t\tself::TYPE_COMMON,\n\t\t\t\t),\n\t\t\t),\n\t\t\t'TRANSPORT' => array(\n\t\t\t\t'data_type' => 'enum',\n\t\t\t\t'values' => array(\n\t\t\t\t\tself::TRANSPORT_JABBER,\n\t\t\t\t\tself::TRANSPORT_EMAIL,\n\t\t\t\t),\n\t\t\t),\n\t\t\t'RECEPIENT_TYPE' => array(\n\t\t\t\t'data_type' => 'enum',\n\t\t\t\t'values' => array(\n\t\t\t\t\tself::RECEPIENT_TYPE_SELF,\n\t\t\t\t\tself::RECEPIENT_TYPE_RESPONSIBLE,\n\t\t\t\t\tself::RECEPIENT_TYPE_ORIGINATOR,\n\t\t\t\t),\n\t\t\t),\n\t\t\t'USER' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Main\\UserTable',\n\t\t\t\t'reference' => array('=this.USER_ID' => 'ref.ID')\n\t\t\t),\n\t\t\t'TASK' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Tasks\\Internals\\TaskTable',\n\t\t\t\t'reference' => array('=this.TASK_ID' => 'ref.ID')\n\t\t\t),\n\t\t);\n\t}",
"public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew Entity\\IntegerField('ID', ['primary' => true, 'autocomplete' => true]),\n\t\t\tnew Entity\\IntegerField('USER_ID'),\n\t\t\tnew Entity\\IntegerField('FORUM_ID'),\n\t\t\tnew Entity\\IntegerField('TOPIC_ID'),\n\t\t\tnew Entity\\DatetimeField('START_DATE'),\n\t\t\tnew Entity\\IntegerField('LAST_SEND'),\n\t\t\tnew Entity\\EnumField('NEW_TOPIC_ONLY', ['values' => ['Y', 'N'], 'default_value' => 'N']),\n\t\t\tnew Entity\\StringField('SITE_ID', ['size' => 2, 'default_value' => 'ru']),\n\t\t\tnew Entity\\IntegerField('SOCNET_GROUP_ID'),\n\t\t\tnew Reference(\"USER\", \\Bitrix\\Main\\UserTable::class, Join::on(\"this.USER_ID\", \"ref.ID\")),\n\t\t\tnew Reference(\"FORUM_USER\", \\Bitrix\\Forum\\UserTable::class, Join::on(\"this.USER_ID\", \"ref.USER_ID\")),\n\t\t];\n\t}",
"public function cellMap()\n {\n $board = $this->newBoard();\n $map = array();\n $i = 0; foreach ($board as $cell_id=>$score) { $i++;\n $map[$cell_id] = $i;\n }\n return $map;\n }",
"public function getConceptMap()\r\n\t{\r\n\t\treturn $this->ConceptMap;\r\n\t}",
"public function getMltCount() {}",
"public function columnMap()\n {\n return array(\n 'cd_conn' => 'cd_conn',\n 'cd_nfe' => 'cd_nfe'\n );\n }",
"public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => new Main\\Entity\\IntegerField('ID', array(\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t\t'title' => Loc::getMessage('MEASURE_ENTITY_ID_FIELD')\n\t\t\t)),\n\t\t\t'CODE' => new Main\\Entity\\IntegerField('CODE', array(\n\t\t\t\t'required' => true,\n\t\t\t\t'title' => Loc::getMessage('MEASURE_ENTITY_CODE_FIELD')\n\t\t\t)),\n\t\t\t'MEASURE_TITLE' => new Main\\Entity\\StringField('MEASURE_TITLE', array(\n\t\t\t\t'validation' => array(__CLASS__, 'validateMeasureTitle'),\n\t\t\t\t'title' => Loc::getMessage('MEASURE_ENTITY_MEASURE_TITLE_FIELD')\n\t\t\t)),\n\t\t\t'SYMBOL' => new Main\\Entity\\StringField('SYMBOL', array(\n\t\t\t\t'column_name' => 'SYMBOL_RUS',\n\t\t\t\t'validation' => array(__CLASS__, 'validateSymbol'),\n\t\t\t\t'title' => Loc::getMessage('MEASURE_ENTITY_SYMBOL_FIELD')\n\t\t\t)),\n\t\t\t'SYMBOL_INTL' => new Main\\Entity\\StringField('SYMBOL_INTL', array(\n\t\t\t\t'validation' => array(__CLASS__, 'validateSymbolIntl'),\n\t\t\t\t'title' => Loc::getMessage('MEASURE_ENTITY_SYMBOL_INTL_FIELD')\n\t\t\t)),\n\t\t\t'SYMBOL_LETTER_INTL' => new Main\\Entity\\StringField('SYMBOL_LETTER_INTL', array(\n\t\t\t\t'validation' => array(__CLASS__, 'validateSymbolLetterIntl'),\n\t\t\t\t'title' => Loc::getMessage('MEASURE_ENTITY_SYMBOL_LETTER_INTL_FIELD')\n\t\t\t)),\n\t\t\t'IS_DEFAULT' => new Main\\Entity\\BooleanField('IS_DEFAULT', array(\n\t\t\t\t'values' => array('N', 'Y'),\n\t\t\t\t'default_value' => 'N',\n\t\t\t\t'title' => Loc::getMessage('MEASURE_ENTITY_IS_DEFAULT_FIELD')\n\t\t\t))\n\t\t);\n\t}",
"protected function defineRelationMap()\n {\n return [];\n }",
"function cardinality()\n\t{\n\t\tif( $this->cached_cardinality != 0 )\n\t\t\treturn $this->cached_cardinality;\n\n\t\t$c = 0;\n\t\tfor( $i = count($this->bits) - 1; $i >= 0; $i-- )\n\t\t\t$c += Integers::bitCount( $this->bits[$i] );\n\t\t$this->cached_cardinality = $c;\n\t\treturn $c;\n\t}",
"public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'IBLOCK_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'title' => Loc::getMessage('IBLOCK_GROUP_ENTITY_IBLOCK_ID_FIELD'),\n\t\t\t),\n\t\t\t'GROUP_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'title' => Loc::getMessage('IBLOCK_GROUP_ENTITY_GROUP_ID_FIELD'),\n\t\t\t),\n\t\t\t'PERMISSION' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'required' => true,\n\t\t\t\t'validation' => array(__CLASS__, 'validatePermission'),\n\t\t\t\t'title' => Loc::getMessage('IBLOCK_GROUP_ENTITY_PERMISSION_FIELD'),\n\t\t\t),\n\t\t\t'GROUP' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Main\\Group',\n\t\t\t\t'reference' => array('=this.GROUP_ID' => 'ref.ID'),\n\t\t\t),\n\t\t\t'IBLOCK' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Iblock\\Iblock',\n\t\t\t\t'reference' => array('=this.IBLOCK_ID' => 'ref.ID'),\n\t\t\t),\n\t\t);\n\t}",
"function getSupportedCardinalities() {\n\t\tstatic $_supportedCardinalities = array(\n\t\t\tMETADATA_PROPERTY_CARDINALITY_ONE,\n\t\t\tMETADATA_PROPERTY_CARDINALITY_MANY\n\t\t);\n\t\treturn $_supportedCardinalities;\n\t}",
"function keyDimensions(){\n \treturn array(\"ga:VisitLength\");\n }",
"public static function getMap()\n {\n return array(\n 'IBLOCK_ELEMENT_ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'title' => Loc::getMessage('ELEMENT_PROP_S42_ENTITY_IBLOCK_ELEMENT_ID_FIELD'),\n ),\n 'PROPERTY_331' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('ELEMENT_PROP_S42_ENTITY_PROPERTY_331_FIELD'),\n ),\n 'PROPERTY_332' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('ELEMENT_PROP_S42_ENTITY_PROPERTY_332_FIELD'),\n ),\n 'PROPERTY_402' => array(\n 'data_type' => 'float',\n 'title' => Loc::getMessage('ELEMENT_PROP_S42_ENTITY_PROPERTY_402_FIELD'),\n ),\n 'PROPERTY_403' => array(\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('ELEMENT_PROP_S42_ENTITY_PROPERTY_403_FIELD'),\n ),\n 'PROPERTY_404' => array(\n 'data_type' => 'float',\n 'title' => Loc::getMessage('ELEMENT_PROP_S42_ENTITY_PROPERTY_404_FIELD'),\n ),\n 'PROPERTY_405' => array(\n 'data_type' => 'float',\n 'title' => Loc::getMessage('ELEMENT_PROP_S42_ENTITY_PROPERTY_405_FIELD'),\n ),\n );\n }",
"protected function getMap()\n {\n return [\n 'S' => [\n 'RECORD_IDENTITY' => 'DISS',\n 'DATA_MAP' => [\n 'RECORD_TYPE' => 1,\n 'STATUS_CODE' => 3,\n 'END_DATE' => 8,\n 'START_DATE' => 8,\n 'ATB_DESC' => 5,\n 'CC_DESC' => 5,\n 'UTS_CODE' => 1,\n 'FIRST_SINGLE_MAX_FLAT' => 8,\n 'FIRST_RETURN_MAX_FLAT' => 8,\n 'STD_SINGLE_MAX_FLAT' => 8,\n 'STD_RETURN_MAX_FLAT' => 8,\n 'FIRST_LOWER_MIN' => 8,\n 'FIRST_HIGHER_MIN' => 8,\n 'STD_LOWER_MIN' => 8,\n 'STD_HIGHER_MIN' => 8,\n 'FS_MKR' => 1,\n 'FR_MKR' => 1,\n 'SS_MKR' => 1,\n 'SR_MKR' => 1\n ]\n ],\n 'D' => [\n 'RECORD_IDENTITY' => 'DISD',\n 'DATA_MAP' => [\n 'RECORD_TYPE' => 1,\n 'STATUS_CODE' => 3,\n 'END_DATE' => 8,\n 'DISCOUNT_CATEGORY' => 2,\n 'DISCOUNT_INDICATOR' => 1,\n 'DISCOUNT_PERCENTAGE' => 3\n ]\n ],\n ];\n }",
"private function getCriteraIDsOfCollection() {\n // fetch the hierarchy filter view which returns rows with the following key value pairs:\n // [<filter_criterion>, <filter_value>] -> document id\n $cacheFileName = $this->projName.\"hierarchy_counts\";\n \tif ($this->cache->exists($cacheFileName)) {\n \t\treturn $this->cache->retrieve($cacheFileName);\n \t}\n \t\n $res = $this->db->fetchView(self::$HIERARCHY_FILTER_VIEW);\n\n // now count the documents in each <filter_criterion> – <filter_value> pair\n $counts = array();\n foreach ($res->body->rows as $row) {\n list($crit, $val) = $row->key;\n if (!isset($counts[$crit])) {\n $counts[$crit] = array();\n }\n if (!isset($counts[$crit][$val])) {\n $counts[$crit][$val] = [];\n }\n\n array_push($counts[$crit][$val], $row->value);\n }\n\n // remove duplicates from the lists\n foreach ($counts as $crit => $values){\n $test = array($values);\n foreach (array_keys($values) as $key){\n $ids = $counts[$crit][$key];\n $counts[$crit][$key] = array_values(array_unique($ids));\n }\n }\n\n $this->cache->save($cacheFileName, $counts);\n return $counts;\n }",
"public function getFieldsMap() {\n return [\n 0 => self::$map['ID'],\n 1 => self::$map['PARENT_CAT_ID'],\n 2 => self::$map['IS_SECTION'],\n 3 => self::$map['POSITION'],\n 4 => self::$map['NUM_DATA'],\n 5 => self::$map['TITLE'],\n 6 => self::$map['DESCRIPTION'],\n // access rules\n 7 => self::$map['WHO_CAN_READ'],\n 8 => self::$map['WHO_CAN_LOAD'],\n 9 => self::$map['WHO_CAN_ADD'],\n 10 => self::$map['URL_ALIAS'],\n ];\n }",
"function calculateAreas($map) {\n $map_count = [];\n foreach ($map as $x => $rows) {\n foreach ($rows as $y => $col) {\n if (!isset($map_count[$map[$x][$y]['value']])) {\n $map_count[$map[$x][$y]['value']] = 0;\n }\n $map_count[$map[$x][$y]['value']]++;\n }\n }\n\n return $map_count;\n}",
"public function ctr()\n\t{\n\t\t$dim_met = array('adTargetingType', 'CTR', '-CTR', null);\n\t\treturn $dim_met;\n\t}",
"public static function getMap(): array\n\t{\n\t\treturn [\n\t\t\t'USER_ID' => (new IntegerField('USER_ID', [\n\t\t\t\t'primary' => true,\n\t\t\t])),\n\t\t\t'NOTIFY_GROUP_ID' => (new IntegerField('NOTIFY_GROUP_ID', [])),\n\t\t\t'GENERAL_GROUP_ID' => (new IntegerField('GENERAL_GROUP_ID', [])),\n\t\t];\n\t}",
"public function getRelationshipPermissionMap()\n {\n return [\n 'creator' => 'users',\n 'template' => 'notification-templates',\n 'recipients' => 'recruiting-campaign-recipients',\n ];\n }"
] | [
"0.6411405",
"0.53142977",
"0.5249698",
"0.5123471",
"0.50652254",
"0.5063445",
"0.5061016",
"0.50190175",
"0.49837255",
"0.49449033",
"0.48828104",
"0.4868928",
"0.48610315",
"0.48328024",
"0.48276258",
"0.48227867",
"0.48108372",
"0.47914007",
"0.47743866",
"0.47686344",
"0.4766008",
"0.4719574",
"0.4716041",
"0.4700125",
"0.46999922",
"0.46816957",
"0.46666744",
"0.46622455",
"0.46617875",
"0.46452922"
] | 0.78251266 | 0 |
Return all child nodes. Note that this will returned a flattened version of the classes type => children map. | public function getChildren()
{
$children = [];
foreach ($this->children as $type) {
foreach ($type as $child) {
$children[] = $child;
}
}
return $children;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_children() {\n\n\t\treturn $this->children;\n\n\t}",
"public function getChildren(): array\n {\n return $this->children;\n }",
"public function getChildren(): array\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->_nodes;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"function GetChildren()\n\t{\n\t\t$children = array();\n\t\t$p = $this->child;\n\t\tif ($p)\n\t\t{\n\t\t\tarray_push($children, $p);\n\t\t\t$p = $p->sibling;\n\t\t\twhile ($p)\n\t\t\t{\n\t\t\t\tarray_push($children, $p);\n\t\t\t\t$p = $p->sibling;\n\t\t\t}\n\t\t}\n\t\treturn $children;\n\t}",
"public function getChildren()\n {\n return self::$cacheStore->getNodeChildren($this);\n }",
"public function getChildren() {\n\t\treturn $this->children;\n\t}",
"public function getChildren() {\n\t\treturn $this->children;\n\t}",
"public function get_children()\n {\n // {\n // if (! isset($this->children))\n // {\n //\n // }\n // }\n // else\n // {\n // $this->children = array();\n // }\n return $this->children;\n }",
"public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}",
"public function getChildren()\n {\n $children = $this->children;\n if (null === $children) {\n $children = new ArrayCollection();\n $this->children = $children;\n }\n\n return $children;\n }",
"protected function __get_children()\n\t{\n\t\treturn $this->parse_children($this->element->childNodes);\n\t}",
"public function getChildren(){\n\t\treturn $this->children;\n\t}",
"public function getChildren()\n {\n $children = [];\n foreach ($this->children as $child) {\n if (!$child instanceof NodeInterface) {\n continue;\n }\n $children[] = $child;\n }\n\n return $children;\n }",
"public function children() {\n\t\treturn $this->children; \n\t}",
"public function ReturnChildren() {\n return $this->_children;\n }",
"public function getChildren() {\r\n return $this->getChildrenAL();\r\n }",
"public function getChildren()\n {\n if (!isset($this->_children)) {\n $this->setChildren($this->_sitemap->root);\n }\n return $this->_children;\n }",
"final public function getChildren() {\n\t\treturn array();\n\t}",
"protected function getChildren() {\n $children = \"\";\n foreach($this->children as $key=>$val) {\n $children .= $val->getXML();\n }\n return $children;\n\n }",
"function children() {\n\t\treturn $this->_children;\n\t}"
] | [
"0.7300485",
"0.7296601",
"0.7296601",
"0.72956586",
"0.7267711",
"0.7267711",
"0.7267711",
"0.7267711",
"0.7267711",
"0.7267711",
"0.7267711",
"0.7267711",
"0.7267711",
"0.725632",
"0.7250394",
"0.72425336",
"0.72425336",
"0.7199447",
"0.7181133",
"0.7165445",
"0.71642536",
"0.71382236",
"0.7086912",
"0.7084043",
"0.7074716",
"0.70594233",
"0.7013594",
"0.70006084",
"0.696539",
"0.69449204"
] | 0.75973827 | 0 |
Return children of specified type. | public function getChildrenOfType($type)
{
return $this->children[$type] ?? [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChildren()\n {\n $children = [];\n foreach ($this->children as $type) {\n foreach ($type as $child) {\n $children[] = $child;\n }\n }\n\n return $children;\n }",
"function getTypeChildren($typeId = null, $options = array ()) {\n\t\t// TODO: Refactor Type Entries Caching\n\t\t$varmap = $options;\n\t\tif ($typeId) {\n\t\t\t$myURL = $this->getTypeLink($typeId, \"down\");\n\t\t $myURL.= $this->GenURLQueryString($options);\n\t\t} else {\n\t\t\t//TODO: Need right URL\n\t\t\t$myURL = $this->processTemplate($this->workspace->collections['types'], $varmap);\n\t\t}\n\t\t$ret = $this->doGet($myURL);\n\t\t$typs = $this->extractTypeFeed($ret->body);\n\t\t$this->cacheTypeFeedInfo($typs);\n\t\treturn $typs;\n\t}",
"public function children();",
"public function children();",
"public function children();",
"public function ReturnChildren() {\n return $this->_children;\n }",
"function fetch_children()\n\t{\n\t\t$data = $this->get_data();\n\t\t$children = array();\n\n\t\tif ( ! array_key_exists('children', $this->data))\n\t\t{\n\t\t\treturn $this->get_content();\n\t\t}\n\n\t\tfor ($i=0;$i<count($data['children']);$i++)\n\t\t{\n\t\t\t/* Recursively fetch children of children page\n\t\t\t */\n\t\t\t$page_child_obj = new Page($data['children'][$i]->path);\n\t\t\t$page_child['content'] = $page_child_obj->fetch_children();\n\n\t\t\t$page_child['grid'] = $data['children'][$i]->grid;\n\t\t\t$order = $data['children'][$i]->order;\n\n\t\t\t$children[$order] = $page_child;\n\n\t\t}\n\t\t/* Key is the order, so sort by key\n\t\t */\n\t\tksort($children);\n\t\treturn $children;\n\t}",
"public function getChildCategoryByType($type) {\n $where = array();\n if ($type == 1){\n $sql = \"SELECT\n p.`name`,\n c.`name` AS child_name,\n c.id ,\n c.level \n FROM\n d_category c\n INNER JOIN d_category AS p ON c.parent = p.id\n where c.del_flg = 0 and p.del_flg = 0\n \";\n } else {\n $sql = \"SELECT\n c.`name`,\n c.id ,\n c.level\n FROM\n d_category c\n where c.type = ? and c.del_flg = 0 \n \";\n $where[] = $type;\n } \n \n if ( !empty($sql)){\n $query= $this->db->query($sql, $where);\n if ($query->num_rows() > 0){\n return $query->result_array();\n }\n }\n \n return FALSE;\n }",
"public function get_children() {\n\n\t\treturn $this->children;\n\n\t}",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren() {\n\t\treturn $this->children;\n\t}",
"public function getChildren() {\n\t\treturn $this->children;\n\t}",
"protected function children()\n {\n if (($item = $this->getModel()) && method_exists($item, $this->name)) {\n return $item->{$this->name};\n }\n }",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function children() {\n\t\treturn $this->children; \n\t}"
] | [
"0.7722711",
"0.67568445",
"0.6703663",
"0.6703663",
"0.6703663",
"0.65144306",
"0.6511857",
"0.6504615",
"0.6432528",
"0.6430966",
"0.6430966",
"0.6430966",
"0.6430966",
"0.6430966",
"0.6430966",
"0.6430966",
"0.6430966",
"0.6430966",
"0.6429554",
"0.6429554",
"0.640322",
"0.63917184",
"0.63917184",
"0.63917184",
"0.63917184",
"0.63917184",
"0.63917184",
"0.63917184",
"0.63917184",
"0.6384625"
] | 0.85157853 | 0 |
Validate the current node. Validation is performed both when the query is being built and when the dev explicitly calls "end()". This method simply checks the minimum boundries are satisfied, the addChild() method already validates maximum boundries and types. | public function validate()
{
$cardinalityMap = $this->getCardinalityMap();
$typeCount = [];
foreach (array_keys($cardinalityMap) as $type) {
$typeCount[$type] = 0;
}
foreach ($this->children as $type => $children) {
$typeCount[$type] += count($children);
}
foreach ($typeCount as $type => $count) {
[$min, $max] = $cardinalityMap[$type];
if (null !== $min && $count < $min) {
throw new OutOfBoundsException(sprintf(
'QueryBuilder node "%s" must have at least "%s" '.
'child nodes of type "%s". "%s" given.',
$this->getName(),
$min,
$type,
$count
));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function validateBounds() {\n $connection = $this->node->getConnection();\n $grammar = $connection->getQueryGrammar();\n\n $tableName = $this->node->getTable();\n $primaryKeyName = $this->node->getKeyName();\n $parentColumn = $this->node->getQualifiedParentColumnName();\n\n $lftCol = $grammar->wrap($this->node->getLeftColumnName());\n $rgtCol = $grammar->wrap($this->node->getRightColumnName());\n\n $qualifiedLftCol = $grammar->wrap($this->node->getQualifiedLeftColumnName());\n $qualifiedRgtCol = $grammar->wrap($this->node->getQualifiedRightColumnName());\n $qualifiedParentCol = $grammar->wrap($this->node->getQualifiedParentColumnName());\n\n $whereStm = \"($qualifiedLftCol IS NULL OR\n $qualifiedRgtCol IS NULL OR\n $qualifiedLftCol >= $qualifiedRgtCol OR\n ($qualifiedParentCol IS NOT NULL AND\n ($qualifiedLftCol <= parent.$lftCol OR\n $qualifiedRgtCol >= parent.$rgtCol)))\";\n\n $query = $this->node->newQuery()\n ->join($connection->raw($grammar->wrapTable($tableName).' AS parent'),\n $parentColumn, '=', $connection->raw('parent.'.$grammar->wrap($primaryKeyName)),\n 'left outer')\n ->whereRaw($whereStm);\n\n return ($query->count() == 0);\n }",
"private function validate()\n {\n if ($this->hasValidated) {\n return;\n }\n\n $this->checkDepth();\n\n foreach ($this->schema as $rule => $parameter) {\n $errors = $this->validateRule($rule, $parameter);\n $this->mergeErrors($errors);\n }\n\n $this->hasValidated = true;\n }",
"public function validate()\n {\n $this->validateDuplicateCoordinates();\n $this->validateWrongBorder();\n $this->validate_coordinate_order();\n $this->validate_number_of_descendants();\n }",
"protected function _childValidation() { }",
"public function valid()\n\t{\n\t\t$this->inner->valid();\n\t}",
"public function validate()\r\n {\r\n if (empty($this->value)) {\r\n if ($this->isRequired()) {\r\n $this->addError(\"Please complete this field\");\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n if (is_string($this->value)) {\r\n $min = $this->getMetadata('@length', 'min');\r\n $max = $this->getMetadata('@length', 'max');\r\n\r\n if ($min !== null && strlen($this->value) < $min) {\r\n $this->addError(\"Minimum length is {$min} characters\");\r\n } else {\r\n if ($max !== null && strlen($this->value) > $max) {\r\n $this->addError(\"Maximum length is {$max} characters\");\r\n }\r\n }\r\n }\r\n\r\n if (is_int($this->value)) {\r\n $min = $this->getMetadata('@range', 'min');\r\n $max = $this->getMetadata('@range', 'max');\r\n\r\n if (($min !== null && $this->value < $min) || ($max !== null && $this->value > $max)) {\r\n $this->addError(\"Please enter a value in the range {$min} to {$max}\");\r\n }\r\n }\r\n }",
"protected function _childValidation()\r\r\n {\r\r\n }",
"public function passes() {\n return $this->validateBounds() && $this->validateDuplicates() &&\n $this->validateRoots();\n }",
"public function valid()\n {\n if ($this->isIteratingOverChildren) {\n return $this->childIndex->valid();\n } else {\n $isValid = $this->violationIndex < count($this->violations);\n\n if (!$isValid) {\n $this->isIteratingOverChildren = true;\n $this->childIndex = new \\ArrayIterator($this->children);\n\n return $this->valid();\n } else {\n return true;\n }\n }\n }",
"public function validate() {\r\n\t\tforeach ($this->fields as $field) {\r\n\t\t\t$field->validate();\r\n\t\t}\r\n\t}",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"public function validate() {\n $this->validator->run();\n }",
"public function validate()\n {\n Validator::validate($this->parameters(), $this->rules());\n }",
"public function valid() {\r\n // echo \"valid\\n\";\r\n return $this->validate($this->current);\r\n }",
"public function valid(): bool\n {\n if (in_array($this->_position, range(0, $this->_nodeList->length - 1)) && $this->_nodeList->length > 0) {\n return true;\n }\n return false;\n }",
"public function valid()\n {\n $rules = call_user_func(\n array($this->_schema, $this->_schema->getMethod())\n );\n $this->_checkRules($rules);\n return count($this->_failed) === 0;\n }",
"public abstract function validate();",
"protected function validateRoots() {\n $roots = forward_static_call(array(get_class($this->node), 'roots'))->get();\n\n // If a scope is defined in the model we should check that the roots are\n // valid *for each* value in the scope columns.\n if ( $this->node->isScoped() )\n return $this->validateRootsByScope($roots);\n\n return $this->isEachRootValid($roots);\n }",
"public function isValid() {\r\n if (isset($this->_nodeName) && isset($this->_parentNodeId) && isset($this->_domainId)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public function validate(array $options = [])\n {\n $options = array_replace(\n [\n 'validateMinChildren' => true,\n 'validateMaxChildren' => true,\n 'validateParentMandatory' => true,\n 'validateParentMustNotBeSet' => true\n ],\n $options\n );\n\n $countChildren = $this->countChildren();\n\n if ($options['validateMinChildren']\n && ($min = $this->getValidationConfig('minChildren')) !== null\n && $min > $countChildren\n ) {\n throw ValidationException::create(\n 'Children must be, at least, ' . $min . '. Currently, node \"' . $this->getId() . '\" has ' .\n $countChildren . ' children.'\n );\n }\n\n if ($options['validateMaxChildren']\n && ($max = $this->getValidationConfig('maxChildren')) !== null\n && $max < $countChildren\n ) {\n throw ValidationException::create(\n 'Children cannot exceed a maximum of ' . $max . '. Currently, node \"' . $this->getId() . '\" has ' .\n $countChildren . ' children.'\n );\n }\n\n if ($options['validateParentMandatory']\n && $this->getValidationConfig('parentMandatory')\n && $this->getParent() === null\n ) {\n throw ValidationException::create(\n 'Node \"' . $this->getId() . '\" must have a Parent!'\n );\n }\n\n if ($options['validateParentMustNotBeSet']\n && $this->getValidationConfig('parentMustNotBeSet')\n && $this->getParent() !== null\n ) {\n throw ValidationException::create(\n 'Node \"' . $this->getId() . '\" must NOT have a Parent!'\n );\n }\n }",
"public function validate()\n {\n // TODO - Develop this\n }",
"public function validate()\n {\n $this->prepareForValidation();\n\n $instance = $this->getValidatorInstance();\n $this->addCustomValidationRules($instance);\n\n if (! $this->passesAuthorization()) {\n $this->failedAuthorization();\n } elseif (! $instance->passes()) {\n $this->failedValidation($instance);\n }\n }",
"public function valid()\n {\n $children = $this->children->getValues();\n return isset($children[$this->childrenPosition]);\n }",
"public function validate() {\n\t\t// process modifier\n\t\t\tif($this->value !== NULL) {\n\t\t\t\tforeach($this->modifier as $modifier) {\n\t\t\t\t\t$this->value = call_user_func($this->form->modifier[$modifier], $this->value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t// check validator\n\t\t\tforeach($this->validator as $validator => $calls) {\n\t\t\t\tforeach($calls as $arguments) {\n\t\t\t\t\tarray_unshift($arguments, $this->value);\n\n\t\t\t\t\tif(call_user_func_array($this->form->validator[$validator], $arguments) !== true) {\n\t\t\t\t\t\tif(!isset($this->errors)) {\n\t\t\t\t\t\t\t$this->errors = array();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->errors[] = $validator;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// set validation status\n\t\t\tif($this->errors !== NULL) {\n\t\t\t\t$this->valid = false;\n\t\t\t} else {\n\t\t\t\t$this->valid = true;\n\t\t\t}\n\t}",
"public function validate(ActNodeInterface $actNode, EnvironmentNode $environmentNode);",
"public function valid() : bool {\n\t\treturn isset($this->children[$this->pointer]);\n\t}",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();",
"abstract public function validate();"
] | [
"0.6983875",
"0.62785316",
"0.6117974",
"0.5986606",
"0.58686507",
"0.57775646",
"0.5764033",
"0.5546421",
"0.547723",
"0.5475532",
"0.5439795",
"0.5415088",
"0.5404943",
"0.5381399",
"0.5356239",
"0.53284556",
"0.5325541",
"0.5317513",
"0.53164506",
"0.5308209",
"0.5299921",
"0.5285006",
"0.5268644",
"0.52447253",
"0.5233316",
"0.52183527",
"0.5191768",
"0.5191768",
"0.5191768",
"0.5191768"
] | 0.709749 | 0 |
Test Pipeline execution on pipelines that should be successful and result in a visualization. | public function testExecuteSuccessful($query, $pipeline){
$ps = $pipeline->execute($query);
//cannot easily test specific URL because they are random
$this->assertTrue($ps->getResultURL() != null);
$this->assertEquals(count($pipeline->getServices()), $ps->getLastServiceIndex());
$this->assertTrue($ps->completedNormally());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetStages()\n {\n $pipeline_id = '521f26eccce8b4310e00006b';\n\n $client = new ClinchPadClient('api-key');\n $resource = new ClinchPadStages($client);\n $resource->getStages($pipeline_id);\n\n $this->assertEquals('GET', $client->getClient()->method);\n $this->assertEquals($client->getEndpoint() . '/pipelines/'.$pipeline_id.'/stages', $client->getClient()->uri);\n }",
"public function pipeline() {}",
"public function test()\n {\n $this->executeScenario();\n }",
"public function test()\n {\n $this->executeScenario();\n }",
"public function test()\n {\n $this->executeScenario();\n }",
"public function test()\n {\n $this->executeScenario();\n }",
"public function test()\n {\n $this->executeScenario();\n }",
"public function test()\n {\n $this->executeScenario();\n }",
"public function testGetStage()\n {\n $pipeline_id = '521f26eccce8b4310e00006b';\n $stage_id = '52219a33cce8b46dd400006a';\n\n $client = new ClinchPadClient('api-key');\n $resource = new ClinchPadStages($client);\n $resource->getStage($pipeline_id, $stage_id);\n\n $this->assertEquals('GET', $client->getClient()->method);\n $this->assertEquals($client->getEndpoint() . '/pipelines/'.$pipeline_id.'/stages/' . $stage_id, $client->getClient()->uri);\n }",
"public function testExecuteContainsTests()\n {\n $this->actingAs(self::$user)\n ->visit('/sets_runs/run/execution/1/overview')\n ->see(self::$testSuite[0]->testCases()->where('TestCaseOverview_id', 1)->first()->Name);\n }",
"public function testSuccess() {\r\n $scenario = $this->getTestBehatScenario(0);\r\n $result = $this->executeTestBehatScenario($scenario);\r\n $this->assertTestPassed($result);\r\n $this->assertTestBehatScenario($scenario);\r\n }",
"public function submit_to_visual_functions()\n {\n $testData = [\n 'anosim' => [\n 'function' => 'anosim',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv',\n 'box2' => 'softLagoonFactors.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'method_select' => 'euclidean',\n 'column_select' => 'Country',\n 'permutations' => '999'\n ]\n ],\n 'cca' => [\n 'function' => 'cca',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv',\n 'box2' => 'softLagoonFactors.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'Factor_select1' => 'Country',\n 'Factor_select2' => 'Location',\n 'Factor_select3' => ''\n ]\n ],\n 'cca_visual' => [\n 'function' => 'cca_visual',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv',\n 'box2' => 'softLagoonEnv.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'Factor_select1' => 'maximumDepthInMeters',\n 'Factor_select2' => 'Temp',\n 'Factor_select3' => '',\n 'top_species' => '21'\n ]\n ],\n 'pca' => [\n 'function' => 'pca',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv',\n 'box2' => 'softLagoonFactors.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'column_select' => 'Country'\n ]\n ],\n 'anova' => [\n 'function' => 'anova',\n 'inputs' => [\n 'box' => 'softLagoonEnv.csv'\n ],\n 'parameters' => [\n 'one_or_two_way' => 'one',\n 'Factor_select1' => 'maximumDepthInMeters',\n 'Factor_select2' => 'Temp',\n 'Factor_select3' => 'fieldNumber'\n ]\n ],\n 'hclust' => [\n 'function' => 'hclust',\n 'inputs' => [\n 'box' => 'vegdist_job12.csv'\n ],\n 'parameters' => [\n 'method_select' => 'ward.D',\n 'column_select' => 'Station'\n ]\n ],\n 'heatcloud' => [\n 'function' => 'heatcloud',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'top_species' => '21'\n ]\n ],\n 'taxondive' => [\n 'function' => 'taxondive',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv',\n 'box2' => 'taxadis_job1.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'column_select' => 'Station',\n 'match_force' => 'FALSE',\n 'deltalamda' => 'Delta'\n ]\n ],\n 'regression' => [\n 'function' => 'regression',\n 'inputs' => [\n 'box' => 'softLagoonEnv.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'single_or_multi' => 'single',\n 'Factor_select1' => 'maximumDepthInMeters',\n 'Factor_select2' => 'Temp',\n 'Factor_select3' => 'fieldNumber'\n ]\n ],\n 'metamds' => [\n 'function' => 'metamds',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv',\n 'box2' => 'softLagoonFactors.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'method_select' => 'euclidean',\n 'column_select' => 'Country',\n 'k_select' => '12',\n 'trymax' => '20',\n 'autotransform_select' => 'TRUE',\n 'noshare' => '0.1',\n 'wascores_select' => 'TRUE',\n 'expand' => 'TRUE',\n 'trace' => '1'\n ]\n ],\n 'phylobar' => [\n 'function' => 'phylobar',\n 'inputs' => [\n 'box' => 'table.nwk',\n 'box2' => 'table.csv'\n ],\n 'parameters' => [\n 'top_nodes' => '21'\n ]\n ],\n 'second_metamds' => [\n 'function' => 'second_metamds',\n 'inputs' => [\n 'box' => [\n 'Macrobenthos-Classes-Adundance.csv',\n 'Macrobenthos-Crustacea-Adundance.csv',\n 'Macrobenthos-Femilies-Adundance.csv'\n ]\n ],\n 'parameters' => [\n 'transpose' => '',\n 'transf_method_select' => 'none',\n 'method_select' => 'euclidean',\n 'cor_method_select' => 'spearman',\n 'k_select' => '2',\n 'trymax' => '20',\n 'autotransform_select' => 'TRUE',\n 'noshare' => '0.1',\n 'wascores_select' => 'TRUE',\n 'expand' => 'TRUE',\n 'trace' => '1'\n ]\n ],\n 'metamds_visual' => [\n 'function' => 'metamds_visual',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'top_species' => '21',\n 'method_select_viz' => 'euclidean',\n 'k_select_viz' => '12',\n 'trymax_viz' => '20'\n ]\n ],\n 'mapping_tools_visual' => [\n 'function' => 'mapping_tools_visual',\n 'inputs' => [\n 'box' => 'softLagoonAbundance.csv',\n 'box2' => 'softLagoonCoordinatesTransposedLong-Lat.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'top_species' => '21'\n ]\n ],\n 'mapping_tools_div_visual' => [\n 'function' => 'mapping_tools_div_visual',\n 'inputs' => [\n 'box' => 'osd2014-16s-formated.csv',\n 'box2' => '16S-ODV-input-corrected-dec15-formatted-coords.csv',\n 'box3' => '16S-ODV-input-corrected-dec15-formatted.csv'\n ],\n 'parameters' => [\n 'transf_method_select' => 'none',\n 'transpose' => 'transpose',\n 'top_species' => '21',\n 'indices_column' => 'Shannon.Index..ln...H.'\n ]\n ]\n ];\n\n foreach ($testData as $data) {\n // Ignore functions with no guidance\n if (empty($data)) {\n continue;\n }\n\n // Submit the job\n $post_data = array_merge($data['parameters'], $data['inputs'], [\n 'function' => $data['function'],\n '_token' => csrf_token()\n ]);\n\n $response = $this->call('POST', url('job'), $post_data, [], [], []);\n $this->assertEquals(302, $response->getStatusCode());\n\n // Check the toastr message\n if (Session::has('toastr')) {\n $toastr = session('toastr');\n $this->assertEquals('success', $toastr[0]);\n }\n\n // Retrieve the new job id\n $job = Job::where('user_email', $this->demoUser)->orderBy('id', 'desc')->first();\n $this->assertTrue(!empty($job));\n\n $jobf = 'job' . $job->id;\n\n // Check the job folder is there\n $this->assertTrue(file_exists($this->demoUserJobsPath . \"/$jobf\"));\n\n // Check the appropriate files are in the job folder\n $actualJobDir = $this->demoUserJobsPath.\"/$jobf\";\n $expectedJobDir = __DIR__.\"/submitted/\".$data['function'];\n foreach(glob($expectedJobDir.\"/*\") as $expectedFilePath) {\n\n $actualFilePath = $actualJobDir.\"/\".basename($expectedFilePath);\n\n if (($data['function'] == 'phylobar')&&(strpos($expectedFilePath, '.jobstatus'))) {\n continue;\n }\n\n // The file should exist in the actual job directory\n $this->assertTrue(file_exists($actualFilePath));\n\n // The file contents should be the same\n $this->assertEquals(file_get_contents($expectedFilePath), file_get_contents($actualFilePath));\n }\n\n // Check the database record is correct\n $this->assertEquals($this->demoUser, $job->user_email);\n $this->assertEquals($data['function'], $job->function);\n $this->assertEquals('submitted', $job->status);\n\n $inputs_string = '';\n foreach ($data['inputs'] as $input) {\n // In 2nd stage metamds an input can be array of filenames, so...\n if (is_array($input)) {\n foreach ($input as $filename) {\n $input = WorkspaceFile::where('user_email', $this->demoUser)->where('filename', $filename)->first();\n $inputs_string .= ';' . $input->id . ':' . $input->filename;\n }\n } else {\n $input = WorkspaceFile::where('user_email', $this->demoUser)->where('filename', $input)->first();\n $inputs_string .= ';' . $input->id . ':' . $input->filename;\n }\n }\n $inputs_string = trim($inputs_string, ';');\n $this->assertEquals($inputs_string, $job->inputs);\n\n // We want to compare the parameters stored in database to the ones\n // that were passed but we don't want to be depended on the order\n // that parameters were passed or stored in the database string.\n $expected_params = $data['parameters'];\n\n $given_params = [];\n $paramsPairs = explode(';', $job->parameters);\n foreach ($paramsPairs as $pair) {\n $paramInfo = explode(':', $pair);\n // Trim the value since empty values are sometimes stored as\n // a \" \" string by the getInputParams() method.\n $given_params[$paramInfo[0]] = trim($paramInfo[1]);\n }\n\n sort($expected_params);\n sort($given_params);\n\n $this->assertEquals(implode('-', $expected_params), implode('-', $given_params));\n\n // Clear the database table to keep the Job ID equal to 1\n Job::query()->truncate();\n\n // Clear the jobs directory\n delTree($actualJobDir);\n }\n }",
"public function testRunSuccess()\n {\n $composeFiles = new ComposeFileCollection(['/var/www/docker-compose-test.yml']);\n $composeFiles->setProjectName('unittest');\n\n $this->assertEquals($this->manager->run('test', 'echo test', $composeFiles), \"test\");\n }",
"public function test()\n {\n $exitCode = \\Artisan::call('house:scrape', [\n 'estate' => $this->estate->id,\n '--no-save' => true,\n '--no-mail' => true\n ]);\n\n if ($exitCode !== 1) {\n $this->emit('alert', 'Command successful.');\n return;\n }\n\n $this->emit('alert', 'Command did not run successfully.');\n }",
"function runCheckTool($stepsContentJson) {\n foreach ($stepsContentJson as $stepContent) {\n \n echo \"<h2>\".$stepContent->stepName.\"</h2><h3>\\\"\".$stepContent->title.\"\\\"</h3>\";\n \n echo \"<table><tr><th>URL</th><th>Status</th></tr>\";\n foreach ($stepContent->contentList as $content) {\n if ($content->isLink) {\n echo \"<tr><td class='url'>\";\n echo $content->contentData[0];\n echo \"</td>\";\n if (urlExists($content->contentData[0])) {\n echo \"<td style='background-color:#c9f9c0' class='status'>PASS</td>\";\n } else {\n echo \"<td style='background-color:#ff8787' class='status'>BROKEN</td>\";\n }\n echo \"</tr>\";\n }\n }\n echo \"</table><hr />\";\n }\n }",
"public function testScenarioAnalysis()\n {\n }",
"function testVisualReferences() {\n $this->taskExec('npm run test -- --configPath=' . self::BASE_DIR . '/tests/visual/testProduction.json')\n ->dir(self::BASE_DIR . '/node_modules/backstopjs/')\n ->run();\n }",
"public function testOutput($verbosity, $showOutput, $showSummary, array $processStates, array $outputs)\n {\n $this->bufferOutput->setVerbosity($verbosity);\n $this->table->setShowOutput($showOutput);\n $this->table->setShowSummary($showSummary);\n\n $oneFails = false;\n\n for ($i = 0; $i < count($processStates); $i++) {\n $process = Mockery::mock(Process::class);\n $process->shouldReceive('stop');\n $process->shouldReceive('start')->with(Mockery::on(function ($closure) {\n call_user_func($closure, Process::OUT, 'some text');\n return true;\n }))->once();\n if ($showSummary) {\n $process->shouldReceive('isStarted')\n ->andReturn(false, false, false, false, true); // add, add2, summary, start, run\n } else {\n $process->shouldReceive('isStarted')->andReturn(false, false, false, true); // add, add2, start, run\n }\n $process->shouldReceive('isRunning')->andReturn(false, false, true, false); // add, add2, check, check\n $process->shouldReceive('isSuccessful')->atLeast()->once()->andReturn($processStates[$i]);\n $process->shouldReceive('getOutput')->andReturn('some text');\n\n if (!$processStates[$i]) {\n $process->shouldReceive('getCommandLine')->andReturn('test');\n $process->shouldReceive('getExitCode')->andReturn(1);\n $process->shouldReceive('getExitCodeText')->andReturn('failed');\n $process->shouldReceive('getWorkingDirectory')->andReturn('/tmp');\n $process->shouldReceive('isOutputDisabled')->andReturn(false);\n $process->shouldReceive('getErrorOutput')->andReturn('some error text');\n $oneFails = true;\n }\n\n $this->pool->add($process, ['key' => 'value', 'run' => $i]);\n }\n\n try {\n $this->table->run(0);\n } catch (\\Exception $e) {\n if (!$oneFails || !$e instanceof ProcessFailedException) {\n throw $e;\n }\n }\n\n $this->compareOutputs($outputs, $this->bufferOutput->getWritten());\n }",
"function renderCli(){\n \n global $requirementsBag;\n global $uniqueRequirementsBag;\n echo PHP_EOL;\n echo PHP_EOL.\"=============REQUIREMENTS============\";\n echo PHP_EOL;\n echo PHP_EOL;\n echo \"|------------------------------------\".PHP_EOL;\n $errors=0;\n ksort($uniqueRequirementsBag);\n $requirements= array_merge($uniqueRequirementsBag,$requirementsBag);\n foreach($requirements as $r){\n if(true === $r[\"works\"]){\n echo \"|\".$r[\"name\"].PHP_EOL;\n echo \"|====>\";\n echo \"\\033[32m OK \\033[0m\".PHP_EOL.\n \"|------------------------------------\".PHP_EOL;\n \n \n \n }else{\n echo \"|\".$r[\"name\"].PHP_EOL;\n echo \"|====>\";\n echo \"\\033[1;31m ERROR \\033[0m\".PHP_EOL.\n \"|------------------------------------\".PHP_EOL;\n $errors++;\n\n }\n }\n \n echo PHP_EOL;\n echo \"REQUIREMENTS SUCCESSFULLY CHECKED \".PHP_EOL;\n if($errors>0)\n echo \"\\033[1;31m$errors errors found !\\033[0m\".PHP_EOL.\"See above\";\n else\n echo \"All requirement are ok\";\n echo PHP_EOL;\n echo PHP_EOL;\n \n}",
"public function testProcessValidators(): void\n {\n $annotationDriver = AnnotationDriver::create(__DIR__ . '/../../../../../../../../Documents/Ecommerce');\n $this->dm->getConfiguration()->setMetadataDriverImpl($annotationDriver);\n $this->commandTester->execute([]);\n $output = $this->commandTester->getDisplay();\n self::assertStringContainsString('Updated validation for all classes', $output);\n }",
"public function testLtiBasicOutcomes()\n {\n }",
"public function testSuccessExecute()\n {\n $this->execution(\n array(\n 'bundle' => 'TestBundle',\n ),\n \"\\033[37;42m Translations from TestBundle imported successfully! \\033[0m\"\n );\n }",
"public function eComparison($pipeline_id)\n {\n $insures_details = [];\n $pipeline_details = PipelineItems::find($pipeline_id);\n if ($pipeline_details['status']['status'] == 'Worktype Created' || $pipeline_details['status']['status'] == 'E-questionnaire' || $pipeline_details['status']['status'] == 'E-slip' || $pipeline_details['status']['status'] == 'E-quotation') {\n return view('error');\n }\n if ($pipeline_details->pipelineStatus != \"true\") {\n return view('error');\n }\n if ($pipeline_details) {\n $insurerReplay = $pipeline_details['insurerReplay'];\n foreach ($insurerReplay as $insures_rep) {\n if ($insures_rep['quoteStatus'] == 'active') {\n $insures_details[] = $insures_rep;\n }\n }\n $alreadySelected = $pipeline_details->selected_insurers;\n foreach ($alreadySelected as $selected) {\n if ($selected['active_insurer'] == 'active') {\n $selectedId[] = $selected['insurer'];\n }\n }\n\n return view('pipelines.workmans_compensation.e_comparison')->with(compact('pipeline_details', 'selectedId', 'insures_details'));\n } else {\n return view('error');\n }\n }",
"function execute_tests($tests) {\n $result = true;\n\n foreach ($tests as $testName => $testData) {\n echo \"\\n------\\n\", _brown(\"[executing \\\"{$testName}\\\"]\"), \"\\n\";\n\n // tested function\n $functionName = $testData['function_name'];\n\n if (!function_exists($functionName)) {\n echo \"function {$functionName} is not defined\\n\";\n $result = false;\n continue;\n }\n\n $functionActualResult = $functionName($testData['content']);\n if (!actualResultIsExpected($functionActualResult, $testData['expected'])) {\n echo \"Expected: \", (is_callable($testData['expected']) ? '<function>' : var_export($testData['expected'], true)), \"\\n\";\n echo \"Actual: \", var_export($functionActualResult, true), \"\\n\";\n echo _red(\"Failed\"), \"\\n\";\n $result = false;\n continue;\t\n }\n\n echo _green(\"Passed!\"), \"\\n\";\n }\n\n\n echo \"\\n\";\n echo ($result ? _green('SUCCESS') : _red('OVERALL FAIL')), \"\\n\";\n\n return $result;\n}",
"public function testRenderSuccess()\n {\n $context = new stdClass();\n $rendered = uniqid('rendered');\n $subject = $this->createInstance(['_render']);\n $_subject = $this->reflect($subject);\n\n $subject->expects($this->exactly(1))\n ->method('_render')\n ->with($context)\n ->will($this->returnValue($rendered));\n\n $result = $subject->render($context);\n $this->assertEquals($rendered, $result, 'Wrong rendering result');\n }",
"function main()\n\t{\n\t\t$group = new GroupTest();\n\t\t\n\t\t$filenames = $this->getFilenames();\n\t\t\n\t\tforeach ($filenames as $testfile)\n\t\t{\n\t\t\t$group->addTestFile($testfile);\n\t\t}\n\t\t\n\t\tif ($this->printsummary)\n\t\t{\n\t\t\t$fe = new SimpleTestFormatterElement();\n\t\t\t$fe->setType('summary');\n\t\t\t$fe->setUseFile(false);\n\t\t\t$this->formatters[] = $fe;\n\t\t}\n\t\t\n\t\tforeach ($this->formatters as $fe)\n\t\t{\n\t\t\t$formatter = $fe->getFormatter();\n\t\t\t$formatter->setProject($this->getProject());\n\n\t\t\tif ($fe->getUseFile())\n\t\t\t{\n\t\t\t\t$destFile = new PhingFile($fe->getToDir(), $fe->getOutfile());\n\t\t\t\t\n\t\t\t\t$writer = new FileWriter($destFile->getAbsolutePath());\n\n\t\t\t\t$formatter->setOutput($writer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$formatter->setOutput($this->getDefaultOutput());\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->execute($group);\n\t\t\n\t\tif ($this->testfailed)\n\t\t{\n\t\t\tthrow new BuildException(\"One or more tests failed\");\n\t\t}\n\t}",
"public function testCommandProgress()\n {\n $document1 = $this->getMockForAbstractClass('ONGR\\ElasticsearchBundle\\Document\\DocumentInterface');\n\n $source = $this->getMockForAbstractClass('ONGR\\ConnectionsBundle\\EventListener\\AbstractCrawlerSource');\n\n $modifier = $this->getMockForAbstractClass('ONGR\\ConnectionsBundle\\EventListener\\AbstractCrawlerModifier');\n\n $container = new ContainerBuilder();\n\n $command = new RepositoryCrawlerCommand();\n $command->setContainer($container);\n\n $input = $this->getMock('Symfony\\Component\\Console\\Input\\InputInterface');\n $input->expects($this->any())->method('getOption')->with('action-name')->will(\n $this->returnValue('default')\n );\n\n $writes = 0;\n $callback = function () use (&$writes) {\n $writes++;\n };\n\n $output = $this->getMock('Symfony\\Component\\Console\\Output\\OutputInterface');\n $outputFormatter = $this->getMock('Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface');\n $output->expects($this->any())->method('write')->will($this->returnCallback($callback));\n $output->expects($this->any())->method('isDecorated')->will($this->returnValue(true));\n $output->expects($this->any())->method('getFormatter')->will($this->returnValue($outputFormatter));\n\n $itemEvent = new ItemPipelineEvent($document1);\n\n $dispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');\n $dispatcher\n ->expects($this->exactly(3))\n ->method('dispatch')\n ->withConsecutive(\n ['ongr.pipeline.repository_crawler.default.source', $this->anything()],\n ['ongr.pipeline.repository_crawler.default.start', $this->anything()],\n ['ongr.pipeline.repository_crawler.default.finish', $this->anything()],\n ['ongr.pipeline.repository_crawler.default.modify', $this->anything()]\n )\n ->willReturnOnConsecutiveCalls(\n ($this->returnValue($source->onSource(new SourcePipelineEvent()))),\n ($this->returnValue(null)),\n ($this->returnValue(null)),\n ($this->returnValue($modifier->onModify($itemEvent)))\n );\n\n $pipelineFactory = new PipelineFactory();\n\n $pipelineFactory->setClassName('\\ONGR\\ConnectionsBundle\\Pipeline\\Pipeline');\n $pipelineFactory->setDispatcher($dispatcher);\n\n $crawler = new PipelineStarter();\n $crawler->setPipelineFactory($pipelineFactory);\n\n $container->set('ongr_connections.repository_crawler_service', $crawler);\n\n $command->run($input, $output);\n\n if ($writes < 2) {\n $this->fail(\n \"Console output was expected to be written at least 2 times, actually written {$writes} times.\"\n );\n }\n }",
"public function results()\n {\n $out = [''];\n\n $total = $this->runner->totalCount;\n $passed = count($this->runner->passed);\n $failures = count($this->runner->failures);\n $errors = count($this->runner->errors);\n $skipped = count($this->runner->skipped);\n\n $results = [];\n $results[] = $this->green(self::INDICATOR).' Passes '.$passed;\n $results[] = $this->red(self::INDICATOR).' Failures '.$failures;\n $results[] = $this->yellow(self::INDICATOR).' Errors '.$errors;\n $results[] = $this->magenta(self::INDICATOR).' Skipped '.$skipped;\n\n $box = new Box($results, [\n 'borderColor' => self::YELLOW,\n 'paddingX' => 1,\n ]);\n $box->setTitle('Results');\n $out[] = $box;\n\n foreach ($this->runner->failures as $test) {\n $out[] = '';\n $out[] = $this->red('FAILED - '.$test->name);\n $out[] = $test->getFailureMessage();\n }\n\n foreach ($this->runner->errors as $test) {\n $out[] = '';\n $out[] = $this->yellow('ERROR - '.$test->name);\n $out[] = $test->getErrorMessage();\n }\n\n $count = $this->green(\"$passed / $total\");\n if ($passed !== $total) {\n $count = $this->red(\"$passed / $total\");\n }\n $out[] = '';\n $out[] = \"$count tests passed successfully.\";\n\n echo $this->render(implode(\"\\n\", $out));\n\n if ($this->runner->options->coverage->enable === true) {\n echo \"\\n\";\n echo $this->gray->render('Calculating Coverage...');\n echo \"\\n\";\n\n $this->runner->coverage->calculate();\n echo $this->runner->coverage->output();\n }\n\n exit((int) ($passed !== $total));\n }",
"public function testGetRuns()\n {\n $this->assertEquals($this->command->getRuns(), array('t' => 'testCommand', 'test-report' => 'testCommand'));\n }",
"public static function report()\n {\n $passed_count = count(self::$passed);\n $failed_count = count(self::$failed);\n echo self::format_line('');\n echo self::format_line(\"$passed_count tests passed. $failed_count tests failed.\");\n\n if ($failed_count != 0) {\n echo self::format_line(\"Failed tests: \" . join(\", \", self::$failed));\n }\n }"
] | [
"0.6038762",
"0.5693934",
"0.56875473",
"0.56875473",
"0.56875473",
"0.56875473",
"0.56875473",
"0.56875473",
"0.5580801",
"0.5518165",
"0.5501734",
"0.5475701",
"0.54556787",
"0.5427767",
"0.5424673",
"0.53106505",
"0.5277314",
"0.52666754",
"0.5213559",
"0.5156577",
"0.512756",
"0.5103635",
"0.5098035",
"0.5090852",
"0.50899106",
"0.5069528",
"0.50581336",
"0.5044599",
"0.50355256",
"0.5032897"
] | 0.60617983 | 0 |
Get the first Pipeline from the pipelineset genereated by QueryOne which should be executable with a result. | private function getPipelineOne($qid, $id){
$services = [
"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gmt.owl#surface",
"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gmt.owl#grdcontour",
"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gs.owl#ps2pdf"
];
$viewerSets = [
"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_webbrowser.owl#web-browser"
];
$viewURI = "http://openvisko.org/rdf/ontology/visko-view.owl#2D_ContourMap";
$viewerURI = "http://visko.cybershare.utep.edu:5080/visko-web/registry/module_webbrowser.owl#web-browser-pdf-viewer";
$toolkit = "http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gmt.owl#gmt";
$outputFormat = "http://openvisko.org/rdf/pml2/formats/PDF.owl#PDF";
$requiresInputURL = true;
$p = new Pipeline(
$qid,
$viewURI,
$viewerURI,
$toolkit,
$requiresInputURL,
$outputFormat,
$services,
$viewerSets
);
$p->setID($id);
return $p;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function first()\n {\n return $this->firstOrIgnoreBuilder(__FUNCTION__);\n }",
"private function getFirstStage(){\n \t$query = (new Stage)->newQuery();\n \t$query = $query->where('position',0);\n \treturn $query->first();\n }",
"public function executeOne() {\n return head($this->execute());\n }",
"public function first(){\n\t\treturn $this->results()[0];\n\t}",
"public function first() {\n return $this->_results[0];\n }",
"public function getFirstResult()\n {\n return $this->firstResult;\n }",
"public function getFirstResult()\n {\n return $this->firstResult;\n }",
"public function first()\n {\n $this->query();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }",
"public function first()\n {\n $results = $this->fetch('object', true);\n return empty($results) ? null : $results;\n }",
"public function first()\n {\n $this->limit(1);\n $results = call_user_func_array(array($this, 'get'), func_get_args());\n if($results)\n return array_shift($results);\n return false;\n }",
"public function loadFirst()\n {\n return $this->limit(1)->load()->getFirst();\n }",
"public function first()\n {\n $this->rewind();\n $document = $this->getCursor()->current();\n\n if (! $document) {\n return null;\n }\n\n return $this->getAssembler()->assemble($document, $this->entitySchema);\n }",
"public function first() {\n\t\treturn $this->count() ? $this->get()[0] : NULL;\n\t}",
"public function first()\n {\n if (empty($this->objects)) {\n return null;\n }\n\n return reset($this->objects);\n }",
"public function first(){\n return $this->result()[0];\n}",
"public function getFirst() {\n\t\treturn $this->createPage(1);\n\t}",
"function getPipeline()\n {\n\t\t$args = new safe_args();\n\t\t$args->set('hmpartner_id', \tNOTSET, 'sqlsafe');\n\t\t$args->set('refresh', \t\t'N', 'sqlsafe');\n\t\t$args = $args->get(func_get_args());\n\t\t\t\t\n\t\tinclude_once('class.pipeline.php');\n\t\t$pipe = new pipeline;\n \t\t\n# \tif( $GLOBALS['appshore_data']['current_user']['type_id'] == 'Partner' && $GLOBALS['appshore_data']['current_user']['hmpartner_id'] )\n#\t\t\t$args['hmpartner_id'] = $GLOBALS['appshore_data']['current_user']['hmpartner_id'];\n\n\t\t$pipe->generate($args['hmpartner_id'], $args['refresh']);\n\n\t\tif ( $pipeline = $pipe->get($args['hmpartner_id']) )\n\t\t{\n\t\t\t$count = count($pipeline);\n\t\t\treset($pipeline);\n\t\t\tfor( $i = 0; $i < $count; $i++ )\n\t\t\t{\n\t\t\t\t$val = current($pipeline);\n\t\t\t\t$key = key($pipeline);\n\t\t\t\tif( preg_match('/(pct|pbg)/', $key) ) // percentage\n\t\t\t\t\t$result['pipeline'][$key] = number_format($val,2).'%';\n\t\t\t\telse if( preg_match('/(com|fat|ifa|pft|funding)/', $key) ) // currency\n\t\t\t\t\t$result['pipeline'][$key] = '$'.number_format((int)$val);\n\t\t\t\telse\n\t\t\t\t\t$result['pipeline'][$key] = $val;\n\t\t\t\tnext($pipeline);\n\t\t\t}\n\t\t}\n\t\t\t\n \t\t$_SESSION[$this->appName]['hmpartner_id'] = $args['hmpartner_id']; \t\t\n\t\t$GLOBALS['appshore_data']['server']['xml_render'] = true;\n \t\treturn $result;\n\t}",
"public function first()\n {\n $result = $this->limit(1)->execute();\n return ($result !== false) ? $result->first() : false;\n }",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first(): mixed;",
"public function first(){\r\n return reset($this->_results);\r\n }"
] | [
"0.60891044",
"0.6011174",
"0.60063624",
"0.5977868",
"0.5912102",
"0.5877402",
"0.5877402",
"0.586158",
"0.5853164",
"0.58246696",
"0.582368",
"0.5799254",
"0.5764044",
"0.5738207",
"0.57075536",
"0.56858015",
"0.5671373",
"0.56664205",
"0.56634706",
"0.56634706",
"0.56634706",
"0.56634706",
"0.56634706",
"0.56634706",
"0.56634706",
"0.56634706",
"0.56634706",
"0.56634706",
"0.5659748",
"0.56580234"
] | 0.6347043 | 0 |
Tests list of Child | public function testList()
{
//Tests list
$this->clientAuthenticated->request('GET', '/child/list');
$response = $this->clientAuthenticated->getResponse();
$content = $this->assertJsonResponse($response, 200);
$this->assertInternalType('array', $content);
$first = $content[0];
$this->assertArrayHasKey('childId', $first);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testListSecondaryChildren()\n {\n }",
"public function makeChildCollectionMocksIterable(): void\n {\n $childrenArray = [$this->child];\n $this->mockIterator($this->root->getChildren(), $childrenArray);\n $this->root->getChildren()->method('getElements')->willReturn([$this->child]);\n\n $grandChildrenArray = [$this->grandChild];\n $this->mockIterator($this->child->getChildren(), $grandChildrenArray);\n $this->child->getChildren()->method('getElements')->willReturn([$this->grandChild]);\n\n $greatGrandChildrenArray = [];\n $this->mockIterator($this->grandChild->getChildren(), $greatGrandChildrenArray);\n $this->grandChild->getChildren()->method('getElements')->willReturn([]);\n }",
"public function it_can_have_child()\n {\n $category = factory(Category::class)->create();\n $name = \"dummy;\";\n $child = $category->children()->create([\"name\"=> $name,\"slug\"=>Str::slug($name)]);\n\n $children = $category->ancestors()->get();\n\n foreach($children as $c){\n $this->assertEquals($child->name,$c->name);\n }\n }",
"public function testListNodeChildren()\n {\n }",
"public function testListParents()\n {\n }",
"public function hasChildren();",
"public function hasChildren();",
"public function hasChildren();",
"function hasChildren();",
"public function testChildren()\n {\n $page = $this->createPage('Parent Page');\n $child1 = $this->createPage('Child 1', $page);\n $child2 = $this->createPage('Child 2', $page);\n\n // TODO: hydrate after persist/flush\n $this->getEntityManager()->refresh($page);\n\n $children = $page->getChildren();\n $this->assertCount(2, $children);\n\n $this->assertSame($child1, $children[0]);\n $this->assertSame($child2, $children[1]);\n\n $this->getEntityManager()->clear();\n\n $page = $this->getEntityManager()->find(null, '/Parent Page');\n\n $children = $page->getChildren();\n $this->assertCount(2, $children);\n\n $this->assertNotSame($child1, $children[0]);\n\n $this->assertEquals('Child 1', $children[0]->getTitle());\n $this->assertEquals('Child 2', $children[1]->getTitle());\n }",
"public function isChild();",
"public function isChild();",
"public function isChild();",
"function staticprops_menus_dna_test(&$parents, $child)\n{\n foreach ($parents as $key => $item) {\n if ($child->menu_item_parent == $item->ID) {\n if (!$item->child_items) {\n $item->child_items = [];\n }\n array_push($item->child_items, $child);\n return true;\n }\n\n if ($item->child_items) {\n if (staticprops_menus_dna_test($item->child_items, $child)) {\n return true;\n }\n }\n }\n\n return false;\n}",
"protected function _childValidation() { }",
"public function children();",
"public function children();",
"public function children();",
"protected function _childValidation()\r\r\n {\r\r\n }",
"public function testSetChild(): void\n {\n // setup\n $objects = [\n [\n 'id' => 1\n ],\n [\n 'id' => 3\n ]\n ];\n $records = [\n [\n 'f' => 1\n ],\n [\n 'f' => 3\n ],\n [\n 'f' => 2\n ]\n ];\n\n // test body\n Functional::setChild('nested', $objects, 'id', $records, 'f');\n\n // assertions\n /** @var array<array-key, array{nested: array}> $objects */\n $this->assertEquals(1, $objects[0]['nested']['f'], 'Record was not nested');\n $this->assertEquals(3, $objects[1]['nested']['f'], 'Record was not nested');\n }",
"public function hasItemChild($itemName, $childName);",
"public function hasChild($name);",
"function hasChildren()\n\t{\n\t\treturn false;\n\t}",
"function testCanBuildANestedList() {\n //atleast we know that the recursion is working\n $this->assertPattern(\"/T1.*T2.*T3.*T4/\", $this->strip($this->output)); \n }",
"public function testFindComplex()\n {\n $root = new Node('<div id=\"wrapper\"><ul class=\"list\"><li>Item 1</li><li>Item 2</li></ul></div>');\n $elements = $root->find('#wrapper ul.list>li');\n $this->assertCount(2, $elements);\n $this->assertContainsOnlyInstancesOf(NodeContract::class, $elements);\n }",
"function pagetest($child) {\n return true;\n}",
"public function testAddGetSetRemoveChild(): void\n {\n $child = new Page();\n $this->assertEmpty($this->object->getChildren());\n $this->object->addChild($child);\n $this->object->addChild($child);\n $this->assertCount(\n 1,\n $this->object->getChildren()\n );\n $this->object->removeChild($child);\n $this->object->removeChild($child);\n $this->assertEmpty($this->object->getChildren());\n\n $collection = new ArrayCollection(\n [\n $child\n ]\n );\n $this->object->setChildren($collection);\n $this->assertEquals(\n $collection,\n $this->object->getChildren()\n );\n }",
"public function hasActiveChildren();",
"public function testGetSubTypeList() {\n\t\t$this->assertEquals(12, count(MimeType::getSubTypeList('archive')));\n\t\t$this->assertEquals(14, count(MimeType::getSubTypeList('spreadsheet')));\n\t\t$this->assertEquals(9, count(MimeType::getSubTypeList('document')));\n\n\t\ttry {\n\t\t\tMimeType::getSubTypeList('foobar');\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\t}",
"public function hasChildren()\n {\n return is_array($this->data[$this->position]);\n }"
] | [
"0.6925704",
"0.66637874",
"0.6537233",
"0.6505797",
"0.6504247",
"0.60903203",
"0.60903203",
"0.60903203",
"0.6051729",
"0.6022108",
"0.60204244",
"0.60204244",
"0.60204244",
"0.5862497",
"0.58263713",
"0.58031774",
"0.58031774",
"0.58031774",
"0.57814354",
"0.57493615",
"0.57398987",
"0.56962675",
"0.56933516",
"0.5670078",
"0.5660963",
"0.55702555",
"0.55697435",
"0.55353576",
"0.5501855",
"0.5473648"
] | 0.7230661 | 0 |
Tests search of Child | public function testSearch()
{
$this->clientAuthenticated->request('GET', '/child/search/melvin');
$response = $this->clientAuthenticated->getResponse();
$content = $this->assertJsonResponse($response, 200);
$this->assertInternalType('array', $content);
$first = $content[0];
$this->assertArrayHasKey('childId', $first);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testFindComplex()\n {\n $root = new Node('<div id=\"wrapper\"><ul class=\"list\"><li>Item 1</li><li>Item 2</li></ul></div>');\n $elements = $root->find('#wrapper ul.list>li');\n $this->assertCount(2, $elements);\n $this->assertContainsOnlyInstancesOf(NodeContract::class, $elements);\n }",
"public function hasChild($name);",
"function findChild($childname){\r\n $retVal=null;\r\n for ($i=0;$i<$this->getNumberOfChilds();$i++){\r\n $tmp=$this->getChild($i);\r\n if (strtolower($tmp->TagName)==strtolower($childname)){\r\n $retVal=$tmp;\r\n break;\r\n }\r\n }\r\n return $retVal;\r\n }",
"public function testFindByClass()\n {\n $root = new Node('<div class=\"test\"><div class=\"test\">Test<span class=\"test\">Test 1</span></div></div>');\n $elements = $root->find('.test');\n $this->assertCount(3, $elements);\n $this->assertContainsOnlyInstancesOf(NodeContract::class, $elements);\n }",
"function doSearch(){\n if($this->find != ''){\n if((is_array($this->files) AND count($this->files) > 0) OR $this->files != '') $this->doFiles($this->search_function);\n if($this->directories != '') $this->doDirectories($this->search_function);\n }\n }",
"public function testSetSearch() {\n\n $obj = new DataTablesColumn();\n\n $arg = new DataTablesSearch();\n\n $obj->setSearch($arg);\n $this->assertSame($arg, $obj->getSearch());\n }",
"public function isChild();",
"public function isChild();",
"public function isChild();",
"public function hasItemChild($itemName, $childName);",
"public function testFind()\n {\n $this->markTestIncomplete('このテストは、まだ実装されていません。');\n }",
"public function testSearchingCallback(): void\n {\n $this->createDirStructure();\n $this->searchResults = [];\n Tools::search(\n $this->tempPath,\n 0,\n [\"*\"],\n [\"*\"],\n \"CONT\",\n [$this, \"storeSearchResults\"]\n );\n Tools::search(\n $this->tempPath,\n 0,\n [\"*\"],\n [\"*\"],\n \"/cont/i\",\n [$this, \"storeSearchResults\"]\n );\n Tools::search(\n $this->tempPath,\n 0,\n [\"*\"],\n [\"*\"],\n \"notFound\",\n [$this, \"storeSearchResults\"]\n );\n $expected = [\n [\n \"path\" => \"file\",\n \"needle\" => \"CONT\",\n ],\n [\n \"path\" => \"file\",\n \"needle\" => \"/cont/i\",\n ],\n [\n \"path\" => implode(DIRECTORY_SEPARATOR, [\"dir1\", \"dir11\", \"dir111\", \"deepFile\"]),\n \"needle\" => \"/cont/i\",\n ],\n ];\n $this->assertEquals($expected, $this->searchResults);\n }",
"public function testSearchOnType()\r\n {\r\n // create a new Repository to be used later\r\n $repo = $this->em->getRepository(Communication::class);\r\n\r\n // create an array with values to search with\r\n $cleanQuery = array();\r\n $cleanQuery[] = 'Phone';\r\n\r\n // query the database\r\n $results = $repo->CommunicationSearch($cleanQuery);\r\n\r\n // Assert that size of the query returns the expected number of results\r\n $this->assertEquals(3, sizeof($results));\r\n }",
"public function testFindById()\n {\n $root = new Node('<div id=\"wrapper\"><b>Test</b></div>');\n $elements = $root->find('#wrapper');\n $this->assertCount(1, $elements);\n $this->assertContainsOnlyInstancesOf(NodeContract::class, $elements);\n }",
"function tree_find($tree, $key='', $options=NULL) {\n $child_field = $options['child_field'] ?: 'children'; \n $search = $options['search'];\n if(is_array($options['search'])) list($search_key, $val) = $search; \n foreach($tree as $path => $node) {\n if($path == $key) return $node;\n else if($search_key && $node->$search_key == $val) return $node;\n if($node->$child_field && is_array($node->$child_field) && count($node->$child_field)) {\n if($node = tree_find($node->$child_field, $key, $options)) return $node; \n }\n }\n return NULL;\n}",
"function matchesSearch($object, $search_value) {}",
"public function hasChild($code);",
"public function testHasChild()\n {\n $node = new Node('<div><a href=\"#\">Test</a></div>');\n $this->assertTrue($node->hasChild());\n }",
"function pagetest($child) {\n return true;\n}",
"public function it_can_have_child()\n {\n $category = factory(Category::class)->create();\n $name = \"dummy;\";\n $child = $category->children()->create([\"name\"=> $name,\"slug\"=>Str::slug($name)]);\n\n $children = $category->ancestors()->get();\n\n foreach($children as $c){\n $this->assertEquals($child->name,$c->name);\n }\n }",
"public function found();",
"public function testListSecondaryChildren()\n {\n }",
"public function find();",
"public function testSingleLevelSearch()\n {\n $bdn = 'cn=admin,dc=demo,dc=squiz,dc=net';\n $pass = 'squiz';\n $conn = LDAP::connectToLDAP('localhost', 389, $bdn, $pass);\n\n // Should only get the 'Staff' group.\n $start = 'c=au,dc=demo,dc=squiz,dc=net';\n $filter = '(objectClass=*)';\n $multiLevel = FALSE;\n $sr = LDAP::search($conn, $start, $filter, $multiLevel);\n $count = LDAP::getNumEntries($conn, $sr);\n PHPUnit_Framework_Assert::assertEquals(1, $count);\n\n $entries = LDAP::getEntries($conn, $sr);\n $data = LDAP::getData($entries);\n $expected = 'o=Squiz,c=au,dc=demo,dc=squiz,dc=net';\n PHPUnit_Framework_Assert::assertEquals($expected, $data[0]['dn']);\n\n }",
"public function hasChild() {\n\n $this->getNodeById();\n\n $sql = \"SELECT asset_id FROM \" . $this->db->escape_str($this->table) . \" \n\t\tWHERE parent_id = \" . $this->db->escape($this->asset_id) . \"\n\t\tAND root_id = \" . $this->root_id . \"\n\t\tAND table_name = \" . $this->db->escape($this->table_name) . \";\";\n //echo $sql;\n $result = $this->db->query($sql);\n if ($result->num_rows > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function testSearchOnProperty()\r\n {\r\n // create a new Repository to be used later\r\n $repo = $this->em->getRepository(Communication::class);\r\n\r\n // create an array with values to search with\r\n $cleanQuery = array();\r\n $cleanQuery[] = 'Cosmo';\r\n\r\n // query the database\r\n $results = $repo->CommunicationSearch($cleanQuery);\r\n\r\n // Assert that size of the query returns the expected number of results\r\n $this->assertEquals(3, sizeof($results));\r\n }",
"public function searchProductChild()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\n\t\t$criteria=new CDbCriteria;\n\t\n\t\t$criteria->compare('Id_product_parent',$this->Id_product_parent);\n\t\t$criteria->compare('Id_product_child',$this->Id_product_child);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t\t\n\t\t$criteria->with[]='productChild';\n\t\t$criteria->addSearchCondition(\"productChild.code\",$this->product_code);\n\t\t$criteria->addSearchCondition(\"productChild.description_customer\",$this->product_description_customer);\n\t\t$criteria->addSearchCondition(\"productChild.description_supplier\",$this->product_description_supplier);\n\t\t$criteria->addSearchCondition(\"productChild.model\",$this->product_model);\n\t\t$criteria->addSearchCondition(\"productChild.part_number\",$this->product_part_number);\n\t\t$criteria->addSearchCondition(\"productChild.short_description\",$this->product_short_description);\n\t\t\n\t\t$criteria->join =\t\"LEFT OUTER JOIN product p ON p.Id=t.Id_product_child\n\t\t\t\t\t\t\t\t LEFT OUTER JOIN brand b ON p.Id_brand=b.Id\n\t\t\t\t\t\t\t\t LEFT OUTER JOIN supplier s ON p.Id_supplier=s.Id\";\n\t\t$criteria->addSearchCondition(\"b.description\",$this->product_brand_description);\n\t\t$criteria->addSearchCondition(\"s.business_name\",$this->product_supplier_business_name);\n\t\t// Create a custom sort\n\t\t$sort=new CSort;\n\t\t$sort->attributes=array(\n\t\t\t\t\t\t\t 'quantity',\n\t\t\t\t\t\t\t 'product_code' => array(\n\t\t\t\t\t\t\t 'asc' => 'productChild.code',\n\t\t\t\t\t\t\t 'desc' => 'productChild.code DESC',\n\t\t),\n\t\t'product_model' => array(\n\t\t\t\t\t\t\t\t\t 'asc' => 'productChild.model',\n\t\t\t\t\t\t\t\t\t 'desc' => 'productChild.model DESC',\n\t\t),\n\t\t'product_part_number' => array(\n\t\t\t\t\t\t\t\t\t\t\t 'asc' => 'productChild.part_number',\n\t\t\t\t\t\t\t\t\t\t\t 'desc' => 'productChild.part_number DESC',\n\t\t),\n\t\t'product_short_description' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'asc' => 'productChild.short_description',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'desc' => 'productChild.short_description DESC',\n\t\t),\n\t\t\t\t\t\t\t\t\t'product_description_customer' => array(\n\t\t\t\t\t\t\t 'asc' => 'productChild.description_customer',\n\t\t\t\t\t\t\t 'desc' => 'productChild.description_customer DESC',\n\t\t),\n\t\t\t\t\t\t\t 'product_description_supplier' => array(\n\t\t\t\t\t\t\t 'asc' => 'productChild.description_supplier',\n\t\t\t\t\t\t\t 'desc' => 'productChild.description_supplier DESC',\n\t\t),\n\t\t\t\t\t\t\t\t\t'product_brand_description'=> array(\n\t\t\t\t\t\t\t\t\t'asc'=>'b.description',\n\t\t\t\t\t\t\t\t\t'desc'=>'b.description DESC'\n\t\t),\n\t\t\t\t\t\t\t\t\t'product_supplier_business_name'=> array(\n\t\t\t\t\t\t\t\t\t'asc'=>'s.business_name',\n\t\t\t\t\t\t\t\t\t'desc'=>'s.business_name DESC'\n\t\t),\n\t\t\t'*',\n\t\t);\n\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t\t\t\t\t'criteria'=>$criteria,\n\t\t\t\t\t\t\t\t\t'sort'=>$sort,\n\t\t));\n\t}",
"public function testFindByTagName()\n {\n $root = new Node('<div id=\"wrapper\"><b>Test 1</b><b>Test 2</b><b>Test 3</b></div>');\n $elements = $root->find('b');\n $this->assertCount(3, $elements);\n $this->assertContainsOnlyInstancesOf(NodeContract::class, $elements);\n }",
"function hasChildren();",
"function testNotSeeCategoriaChild()\n {\n $this->tester->dontSeeRecord('common\\models\\CategoriaChild',['childNome' => 'DIY Components', 'childDescricao' => 'Components for doing it yourself', 'childEstado' => 0]);\n }"
] | [
"0.61802864",
"0.6063395",
"0.5850445",
"0.5845705",
"0.5809156",
"0.5688698",
"0.56792426",
"0.56792426",
"0.56792426",
"0.5671013",
"0.56632847",
"0.562521",
"0.5581889",
"0.558017",
"0.5554358",
"0.5532753",
"0.55326176",
"0.5520474",
"0.55201185",
"0.5503016",
"0.54929465",
"0.5492369",
"0.5482808",
"0.54606783",
"0.544828",
"0.5436943",
"0.5399949",
"0.5398174",
"0.5379427",
"0.5370898"
] | 0.6885052 | 0 |
Tests delete Child AND physically deletes it | public function testDelete()
{
$this->clientAuthenticated->request('DELETE', '/child/delete/' . self::$objectId);
$response = $this->clientAuthenticated->getResponse();
$this->assertJsonResponse($response, 200);
//Deletes physically the entity created by test
$this->deleteEntity('Child', 'childId', self::$objectId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDeleteSecondaryChildAssocation()\n {\n }",
"public function testDeleteNode()\n {\n }",
"public function beforeDelete()\n {\n $children = $this->children;\n if ($children && $children->count()) {\n $children->each(function($child) {\n $child->delete();\n });\n }\n }",
"public static function deleteChild($childId) {\n global $db;\n\n //$query = \"UPDATE daycaredb.child_profiles SET reference=NULL;\";\n //$result = $db->query($query);\n //if($result){\n $query = \"DELETE FROM daycaredb.child_profiles WHERE id = $childId\";\n $row_count = $db->exec($query); //after drop the child maybe need to delete related info table\n return $row_count;\n //}else{\n // return 10;\n //}\n }",
"public function testDeleteItemWithChildren()\n {\n $itemData = [\n 'field' => 'value'\n ];\n $storeResponse = $this->postJson('/api/items', $itemData);\n $itemId = $storeResponse->json('id');\n $itemsData = [\n [\n 'field' => 'value'\n ]\n ];\n $this->postJson(sprintf('/api/items/%d/items', $itemId), $itemsData);\n $deleteResponse = $this->delete('/api/items/' . $itemId);\n\n $deleteResponse->assertStatus(Response::HTTP_NO_CONTENT);\n }",
"private function deleteTestNode() {\n $this->testNode->delete();\n }",
"protected abstract function delete();",
"public function testDelete() {\n $entity = new SimpleEntity();\n $entity->setName('Entity');\n $entity->setValue('EntityValue');\n $id = $this->persister->create($entity);\n $this->assertNotNull($id);\n\n $this->persister->delete($entity);\n $retrieved = $this->persister->getById($id);\n $this->assertNull($retrieved);\n\n // Use a new persister to ensure that the delete was actually done in the\n // database\n $this->persister->clearCache();\n\n $retrieved = $this->persister->getById($id);\n $this->assertNull($retrieved);\n }",
"public function testDeleteLook()\n {\n }",
"public function testDeleteExistingParentNavWithoutChildNav_()\n {\n $response = $this->injectId($this->nav->id)->makeCall();\n\n // assert response status is correct\n $response->assertStatus(200);\n\n // assert the returned message is correct\n $this->assertResponseContainKeyValue([\n 'status' => true,\n 'msg' => \"操作成功\",\n ]);\n }",
"public function testDeleteEntity()\n {\n }",
"public function test_existing_local_parent_with_inserted_children_that_gets_deleted_can_cascade_delete_and_upload()\n {\n $companyno = $this->remote->companyno;\n\n //setup World\n $remote = Remote::insert(RemoteWorkorder::class,[\n \"companyno\" => $companyno,\n \"UserName\" => \"Javascript\"\n ]);\n $LocalWorkorder = $remote->cloneTo(LocalWorkorder::class);\n $lastSync = Carbon::now();\n\n $this->timePasses();\n\n //insert Local child\n $tempLocalMeters = LocalCollection::insert(LocalTempMeter::class,2,[\n \"local_workorderno\" => $LocalWorkorder->record()->local_WorkOrderNo,\n 'companyno' => $companyno\n ]);\n\n $LocalWorkorder->delete();\n //Casacde\n $tempLocalMeters->deleteAll();\n\n $this->timePasses();\n\n //Send to remote (Assume Success)\n // $returnedWorkorder = ApiWrite::insertOnly(RemoteWorkorder::class,$tempLocalWorkorder);\n $returned = ApiWrite::delete(RemoteWorkorder::class,$LocalWorkorder->record()->WorkOrderID);\n $LocalWorkorder->forceDelete();\n $deleted_at = Carbon::now();\n\n $returnedMeters = ApiWrite::insertOnlyBulk(RemoteMeter::class,$tempLocalMeters);\n\n //Select Inserted from Remote\n $workorder = Api::select(RemoteWorkorder::class,$companyno,$lastSync);\n $meters = Api::selectAll(RemoteMeter::class,$companyno,$lastSync);\n\n //Update Local\n $local = new Local($workorder);\n $local->download(LocalWorkorder::class);\n\n $localMeterPull = new LocalCollection($meters);\n $localMeterPull->download(LocalMeter::class);\n\n //Test\n $record = $LocalWorkorder->record();\n $this->assertDatabaseDeleteBoth('workorders',[\n 'WorkOrderID' => $record->WorkOrderID,\n ],$deleted_at);\n\n $this->assertCountBoth(0,RemoteWorkorder::all(),LocalWorkorder::all());\n\n $this->assertCount(0,LocalTempMeter::all());\n\n $this->assertCountBoth(0,RemoteMeter::all(),LocalMeter::all());\n }",
"public function testIntegrityControlBeforeDelete()\n {\n $integrityError = $this->entityClassService->integrityControlBeforeDelete($this->simpleEntityClass);\n \t$this->assertNull($integrityError);\n\n \t/**\n * #2\n * Linked to other entity class\n */\n $integrityError = $this->entityClassService->integrityControlBeforeDelete($this->targetEntityClass);\n \t\n $expectedIntegrityError = array(\n 'title' => $this->translator->trans('delete.error.title'),\n 'message' => $this->translator->trans('entity_class.delete.reference.error.message')\n );\n\n \t$this->assertEquals($expectedIntegrityError, $integrityError);\n }",
"public function testPingTreeTargetDeleteTarget()\n {\n }",
"public function testDeletes(): void\n {\n\n $this->expectNotToPerformAssertions();\n $con = $this->_em->getConnection();\n\n // The \"c\" entity\n $con->insert('gh10532_x', ['id' => 1, 'discr' => 'C']);\n $con->insert('gh10532_c', ['id' => 1]);\n $c = $this->_em->find(GH10532C::class, 1);\n\n // The \"a2\" entity\n $con->insert('gh10532_a', ['id' => 2, 'gh10532x_id' => 1]);\n $a2 = $this->_em->find(GH10532A::class, 2);\n\n // The \"b\" entity\n $con->insert('gh10532_x', ['id' => 3, 'discr' => 'B']);\n $con->insert('gh10532_b', ['id' => 3, 'gh10532a_id' => 2]);\n $b = $this->_em->find(GH10532B::class, 3);\n\n // The \"a1\" entity\n $con->insert('gh10532_a', ['id' => 4, 'gh10532x_id' => 3]);\n $a1 = $this->_em->find(GH10532A::class, 4);\n\n /*\n * The following would make the deletions happen in an order\n * where the not-nullable foreign key constraints would not be\n * violated. But, we want the ORM to be able to sort this out\n * internally.\n *\n * $this->_em->remove($a1);\n * $this->_em->flush();\n * $this->_em->remove($b);\n * $this->_em->flush();\n * $this->_em->remove($a2);\n * $this->_em->remove($c);\n * $this->_em->flush();\n */\n\n $this->_em->remove($a1);\n $this->_em->remove($a2);\n $this->_em->remove($b);\n $this->_em->remove($c);\n\n $this->_em->flush();\n }",
"public function testRemove()\n {\n $page1 = $this->createPage('Foobar');\n $page2 = $this->createPage('Barfoo', $page1);\n $page3 = $this->createPage('BarBar');\n\n $this->getEntityManager()->remove($page1);\n $this->getEntityManager()->flush();\n\n try {\n $this->getStorage()->getByUuid($page1->getUuid());\n $this->fail('UUID still exists after remove');\n } catch (NotFoundException $e) {\n }\n\n try {\n $this->getStorage()->getByUuid($page2->getUuid());\n $this->fail('UUID of sub-node still exists after remove');\n } catch (NotFoundException $e) {\n }\n }",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"public function testRmdirRoot() {\n\t\t$this->assertFalse($this->instance->rmdir(''));\n\t}",
"public function deleteChildren()\n {\n \tstatic::deleteAll(['parent' => $this->id]);\n }",
"public function testIfCreationAndDeletionWorks() : void\n {\n\n // Lvd.\n $pathString1 = 'config/creationTest/deep/deeper/target/' . rand(1000, 9999);\n $pathString2 = 'config/creationTest';\n $pathString3 = 'config';\n\n // Create Path.\n $path = new Path($pathString1);\n $path->createDirs(true);\n\n // Check if exists.\n $this->assertTrue(file_exists($pathString1));\n\n // Call to delete everything below config/ and leave config intact.\n $path->deleteEmptyDirs(1);\n\n // Check if deletion was proper.\n $this->assertFalse(file_exists($pathString1));\n $this->assertFalse(file_exists($pathString2));\n $this->assertTrue(file_exists($pathString3));\n\n // Call again to delete - nothing should be changed but it should work.\n $path->deleteEmptyDirs(1);\n\n // Check if worked.\n $this->assertFalse(file_exists($pathString1));\n $this->assertFalse(file_exists($pathString2));\n $this->assertTrue(file_exists($pathString3));\n }",
"protected function _before_delete(): void\n {\n //object the transaction and add a on commit event\n //it is better to do it this way insted of deleting the images in _after_delete but without taking into account the transaction.\n //there is no way to obtain the current transaction (this is intentional)\n //instead a nested one is started\n $Transaction = self::new_transaction($TR);\n $Transaction->begin();\n $Transaction->add_callback('_after_commit', function(): void\n {\n //if there is an exception here will hit a bug in CompositeTransaction nesting\n if (file_exists($this->image_path) && is_writable($this->image_path)) {\n unlink($this->image_path);\n }\n });\n $Transaction->commit();\n }",
"public function testDeleteOrderItemUsingDELETE()\n {\n }",
"protected function _beforeDelete()\r\n\t{}",
"public function testDeleteSub() {\n $sub = $this->createEntity('commerce_sub', [\n 'title' => $this->randomMachineName(),\n 'type' => 'default',\n ]);\n $this->drupalGet($sub->toUrl('delete-form'));\n $this->assertSession()->pageTextContains(t(\"Are you sure you want to delete the sub @sub?\", ['@sub' => $sub->getTitle()]));\n $this->assertSession()->pageTextContains(t('This action cannot be undone.'));\n $this->submitForm([], 'Delete');\n\n \\Drupal::service('entity_type.manager')->getStorage('commerce_sub')->resetCache();\n $sub_exists = (bool) Sub::load($sub->id());\n $this->assertFalse($sub_exists, 'The new sub has been deleted from the database.');\n }",
"public function testDelete()\n {\n $loader = $this->account->getServiceManager()->get(\"EntityLoader\");\n $entity = $loader->create(\"note\");\n $entity->setValue(\"name\", \"Test\");\n $dm = $this->account->getServiceManager()->get(\"Entity_DataMapper\");\n $dm->save($entity);\n $entityId = $entity->getId();\n\n // Set params in the request\n $req = $this->controller->getRequest();\n $req->setParam(\"obj_type\", \"note\");\n $req->setParam(\"id\", $entityId);\n\n // Try to delete\n $ret = $this->controller->postRemoveAction();\n $this->assertEquals($entityId, $ret[0]);\n }",
"public function testDelete()\n {\n $this->portrait->delete();\n foreach ($this->portrait->get_images() as $image) {\n $this->assertFileNotExists($image);\n }\n $this->assertFileNotExists($this->portrait->get_alt_file());\n\n $this->totalcms->delete();\n foreach ($this->totalcms->get_images() as $image) {\n $this->assertFileNotExists($image);\n }\n $this->assertFileNotExists($this->totalcms->get_alt_file());\n\n $this->landscape->delete();\n foreach ($this->landscape->get_images() as $image) {\n $this->assertFileNotExists($image);\n }\n $this->assertFileNotExists($this->landscape->get_alt_file());\n\n $this->big->delete();\n foreach ($this->big->get_images() as $image) {\n $this->assertFileNotExists($image);\n }\n $this->assertFileNotExists($this->big->get_alt_file());\n }"
] | [
"0.7489051",
"0.674596",
"0.66121507",
"0.6410129",
"0.63685864",
"0.63416374",
"0.63195795",
"0.63008046",
"0.6278595",
"0.6266853",
"0.6226864",
"0.6213621",
"0.6186405",
"0.61669964",
"0.6164839",
"0.6162165",
"0.6138652",
"0.6138652",
"0.6138652",
"0.6138652",
"0.6138652",
"0.61285967",
"0.6125971",
"0.61199504",
"0.60908043",
"0.60848063",
"0.6078408",
"0.6074042",
"0.6071441",
"0.60679716"
] | 0.7830829 | 0 |
The custom function to register a Comic Strip post type | function hbc_comic(){
// Set the labels, this variable is used in the $args array
$labels = array(
'name' => __( 'Comic Strips' ),
'singular_name' => __( 'Comic Strip' ),
'add_new' => __( 'Add New Comic Strip' ),
'add_new_item' => __( 'Add New Comic Strip' ),
'edit_item' => __( 'Edit Comic Strip' ),
'new_item' => __( 'New Comic Strip' ),
'all_items' => __( 'All Comic Strips' ),
'view_item' => __( 'View Comic Strip' ),
'search_items' => __( 'Search Comic Strip' ),
'featured_image' => 'Poster',
'set_featured_image' => 'Add Poster'
);
// The arguments for our post type, to be entered as parameter 2 of register_post_type()
$args = array(
'labels' => $labels,
'description' => 'Holds our Comic Strip specific data',
'public' => true,
'menu_position' => 5,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'custom-fields' ),
'has_archive' => false,
'show_in_admin_bar' => true,
'show_in_nav_menus' => false,
'query_var' => true,
);
// Call the actual WordPress function
// Parameter 1 is a name for the post type
// Parameter 2 is the $args array
register_post_type( 'comic', $args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function register_post_type() {\r\n\t}",
"function opubco_register_post_types()\n{\n //Register post types here (using register_post_type)\n}",
"public function register_custom_post_types() {\n\n\t\t/* Get custom post types from db */\n\t\t$custom_post_types = get_option( self::$plugin_prefix . '_cpts' );\n\t\t$cpts_hash = get_option( self::$plugin_prefix . '_cpts_hash' );\n\t\t$new_cpts_hash = '';\n\t\n\t\t/* Register cpts & custom taxonomy if enabled */\n\t\tif ( function_exists( 'register_post_type' ) && function_exists( 'register_taxonomy' ) ) { \n\t\t\tif ( isset( $custom_post_types ) && !empty( $custom_post_types ) ) {\n\t\t\t\tforeach ( $custom_post_types as $custom_post_type ) {\n\t\n\t\t\t\t\t$cpt_labels = array(\n\t\t\t\t\t\t'name' => $custom_post_type['name'],\n\t\t\t\t\t\t'singular_name' => $custom_post_type['singular_name'],\n\t\t\t\t\t\t'add_new' => __( 'Add New', 'go_portfolio_textdomain' ),\n\t\t\t\t\t\t'add_new_item' => sprintf( __( 'Add New %s', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'edit_item' => sprintf( __( 'Edit %s', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'new_item' => sprintf( __( 'New %s', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'all_items' => sprintf( __( 'All %s', 'go_portfolio_textdomain' ), $custom_post_type['name'] ),\n\t\t\t\t\t\t'view_item' => sprintf( __( 'View %s', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'search_items' => sprintf( __( 'Search %s', 'go_portfolio_textdomain' ), $custom_post_type['name'] ),\n\t\t\t\t\t\t'not_found' => sprintf( __( 'No %s found', 'go_portfolio_textdomain' ), $custom_post_type['name'] ),\n\t\t\t\t\t\t'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'go_portfolio_textdomain' ), $custom_post_type['name'] ), \n\t\t\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t\t\t'menu_name' => $custom_post_type['name']\n\t\t\t\t\t );\n\t\t\t\t\t\n\t\t\t\t\t$cpt_args = array(\n\t\t\t\t\t\t'labels' \t\t\t=> $cpt_labels,\n\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t'public' \t\t\t=> true,\n\t\t\t\t\t\t'has_archive' \t\t=> isset ( $custom_post_type['has-archive'] ) ? true : false,\n\t\t\t\t\t\t'exclude_from_search' => isset ( $custom_post_type['search-exclude'] ) ? true : false,\n\t\t\t\t\t\t'supports' \t\t\t=> array( 'title', 'editor', 'thumbnail', 'custom-fields','comments','page-attributes', 'excerpt', 'revisions' ),\n\t\t\t\t\t\t'menu_icon'\t\t\t=> GW_GO_PORTFOLIO_URI . 'admin/images/icon_wp_nav.png'\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\t$ctax_cat_labels = array(\n\t\t\t\t\t\t'name' => sprintf( __( '%s Categories', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'singular_name' \t=> sprintf( __( '%s Category', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'search_items' => sprintf( __( 'Search %s Categories', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'all_items' => sprintf( __( 'All %s Categories', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'parent_item' => sprintf( __( 'Parent %s Category', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'parent_item_colon' => sprintf( __( 'Parent %s Category:', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'edit_item' => sprintf( __( 'Edit %s Category', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'update_item' => sprintf( __( 'Update %s Category', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'add_new_item' => sprintf( __( 'Add New %s Category', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'new_item_name' => sprintf( __( 'New %s Category Name', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'menu_name' => sprintf( __( '%s Category', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] )\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$ctax_cat_args = array(\n\t\t\t\t\t\t'labels' \t\t\t=> $ctax_cat_labels,\n\t\t\t\t\t\t'hierarchical' => true,\n\t\t\t\t\t\t'public' \t\t\t=> true,\n\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t'update_count_callback' => '_update_post_term_count'\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$ctax_tag_labels = array(\n\t\t\t\t\t\t'name' => sprintf( __( '%s Tags', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'singular_name' \t=> sprintf( __( '%s Tag', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'search_items' => sprintf( __( 'Search %s Tags', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'all_items' => sprintf( __( 'All %s Tags', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'parent_item' => sprintf( __( 'Parent %s Tag', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'parent_item_colon' => sprintf( __( 'Parent %s Tag:', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'edit_item' => sprintf( __( 'Edit %s Tag', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'update_item' => sprintf( __( 'Update %s Tag', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'add_new_item' => sprintf( __( 'Add New %s Tag', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'new_item_name' => sprintf( __( 'New %s Tag Name', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] ),\n\t\t\t\t\t\t'menu_name' => sprintf( __( '%s Tag', 'go_portfolio_textdomain' ), $custom_post_type['singular_name'] )\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$ctax_tag_args = array(\n\t\t\t\t\t\t'labels' \t\t\t=> $ctax_tag_labels,\n\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t'public' \t\t\t=> true,\n\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t'update_count_callback' => '_update_post_term_count'\n\t\t\t\t\t);\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif ( isset( $custom_post_type['enabled'] ) ) { \n\t\t\t\t\t\tregister_post_type( $custom_post_type['slug'], $cpt_args );\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Register taxonomies */\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( isset( $custom_post_type['custom-tax-cat'] ) || isset( $custom_post_type['custom-tax-tag'] ) ) { \n\n\t\t\t\t\t\t\t$all_tax = get_taxonomies(); \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Check if taxonomy is already registered */\n\t\t\t\t\t\t\tif ( isset( $all_tax ) && is_array( $all_tax ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Register category */\n\t\t\t\t\t\t\t\tif ( isset( $custom_post_type['custom-tax-cat'] ) && !in_array( $custom_post_type['slug'] . '-cat', $all_tax ) ) {\n\t\t\t\t\t\t\t\t\tregister_taxonomy( $custom_post_type['slug'] . '-cat', array( $custom_post_type['slug'] ), $ctax_cat_args );\n\t\t\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\t\t/* Register tag */\n\t\t\t\t\t\t\t\tif ( isset( $custom_post_type['custom-tax-tag'] ) && !in_array( $custom_post_type['slug'] . '-tag', $all_tax ) ) {\n\t\t\t\t\t\t\t\t\tregister_taxonomy( $custom_post_type['slug'] . '-tag', array( $custom_post_type['slug'] ), $ctax_tag_args );\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Register additional taxnomy for the cpt */\n\t\t\t\t\t\tif ( isset( $custom_post_type['tax'] ) && !empty( $custom_post_type['tax'] ) ) {\n\t\t\t\t\t\t\tforeach( $custom_post_type['tax'] as $add_tax ) {\n\t\t\t\t\t\t\t\tregister_taxonomy_for_object_type( $add_tax, $custom_post_type['slug'] );\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\tapply_filters( 'manage_edit-'.$custom_post_type['slug'].'_columns', array ( $this, 'cpt_edit_columns' ), '' );\n\t\t\t\t\t\tadd_filter( 'manage_edit-'.$custom_post_type['slug'].'_columns', array ( $this, 'cpt_edit_columns' ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\tadd_action( 'manage_'.$custom_post_type['slug'].'_posts_custom_column', array ( $this, 'cpt_custom_columns' ) );\n\t\t\t\t\t}\n\t\n\t\t\t\t\t/* Create hash from slugs */\n\t\t\t\t\t$new_cpts_hash .= $custom_post_type['slug'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Do flush rewrite if cpts has benn changed */\n\t\t\t\t$new_cpts_hash = md5( $new_cpts_hash );\n\t\t\t\t\n\t\t\t\tif ( !$cpts_hash || $cpts_hash != $new_cpts_hash ) {\n\t\t\t\t\tupdate_option( self::$plugin_prefix . '_cpts_hash', $new_cpts_hash );\n\t\t\t\t\tglobal $wp_rewrite;\n\t\t\t\t\t$wp_rewrite->flush_rules();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}",
"function install_posttypefor_cpt_commodities(){\r\n $labels = array(\r\n 'name' => _x( 'Commodities', 'Post Type General Name', 'cpt-commodities' ),\r\n 'singular_name' => _x( 'Commodities', 'Post Type Singular Name', 'cpt-commodities' ),\r\n 'menu_name' => __( 'Commodities', 'cpt-commodities' ),\r\n 'parent_item_colon' => __( 'Parent Commodities', 'cpt-commodities' ),\r\n 'all_items' => __( 'Commodities', 'cpt-commodities' ),\r\n 'view_item' => __( 'View Commodities', 'cpt-commodities' ),\r\n 'add_new_item' => __( 'Add New', 'cpt-commodities' ),\r\n 'add_new' => __( 'Add New', 'cpt-commodities' ),\r\n 'edit_item' => __( 'Edit Commodities', 'cpt-commodities' ),\r\n 'update_item' => __( 'Update Commodities', 'cpt-commodities' ),\r\n 'search_items' => __( 'Search Commodities', 'cpt-commodities' ),\r\n 'not_found' => __( 'Not Found', 'cpt-commodities' ),\r\n 'not_found_in_trash' => __( 'Not found in Trash', 'cpt-commodities' ),\r\n );\r\n \r\n // Set other options for Custom Post Type\r\n \r\n $args = array(\r\n 'label' => __( 'Commodities', 'cpt-commodities' ),\r\n 'description' => __( 'adds a Commodities section to the admin panel', 'cpt-commodities' ),\r\n 'labels' => $labels,\r\n 'menu_icon' => 'dashicons-visibility',\r\n // Features this CPT supports in Post Editor\r\n 'rewrite' => array('slug' => 'ship'),\r\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'custom-fields', 'revisions', 'page-attributes' ),\r\n // You can associate this CPT with a taxonomy or custom taxonomy. \r\n //'taxonomies' => array( 'category' ),\r\n /* A hierarchical CPT is like Pages and can have\r\n * Parent and child items. A non-hierarchical CPT\r\n * is like Posts.\r\n */ \r\n 'hierarchical' => true,\r\n 'public' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'show_in_nav_menus' => true,\r\n 'show_in_admin_bar' => true,\r\n 'menu_position' => 5,\r\n 'can_export' => true,\r\n 'has_archive' => true,\r\n 'exclude_from_search' => false,\r\n 'publicly_queryable' => true,\r\n 'capability_type' => 'page',\r\n );\r\n \r\n // Registering your Custom Post Type\r\n register_post_type( 'commodities', $args );\r\n }",
"public function register_custom_post_type() {\n\n\t\t$singular_label = empty( $this->config['args']['labels']['singular'] ) ? $this->post_type : (string) $this->config['args']['labels']['singular'];\n\t\t$plural_label = empty( $this->config['args']['labels']['plural'] ) ? $this->post_type : (string) $this->config['args']['labels']['plural'];\n\n\t\t$this->args['labels'] = $this->get_post_type_labels( $singular_label, $plural_label );\n\n\t\tregister_post_type( $this->post_type, $this->args );\n\t}",
"function ctmeta_register_post_type() {\n\n\t\t// Get plugin object\n\t\tglobal $ctmeta_plugin;\n\n\t\t// Args\n\t\t$args = array(\n\t\t\t'labels' => array( 'name' => __( 'CTmeta post type', $ctmeta_plugin->textdomain ) ),\n\t\t\t'public' => false,\n\t\t\t'supports' => array( 'title', 'custom-fields' )\n\t\t);\n\n\t\t// Register post type\n\t\tregister_post_type( ctmeta_settings( 'post_type_name' ), $args );\n\t}",
"function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}",
"public function register_post_type(){\n\n\t\t$post_type_name = self::uglify($this->set_post_type_name());\n\t\t$post_type_args = $this->set_post_type_args() ?? array() ;\n\t\t$post_type_labels = $this->set_post_type_labels() ?? array();\n\n\t\t//Capitilize the words and make it plural\n\t\t$name = self::beautify( $post_type_name );//ucwords( str_replace( '_', ' ', $this->post_type_name ) );\n\t\t$plural = self::pluralize( $name );\n\t\t// We set the default labels based on the post type name and plural. We overwrite them with the given labels.\n\t\t$defaults_labels = array(\n\t\t\t// 'name' => _x( $plural, 'post type general name' ),\n\t\t\t'name' => _x( $plural, 'post type general name' ),\n\t\t\t'singular_name' => _x( $name, 'post type singular name' ),\n\t\t\t'add_new' => _x( 'Add New', strtolower( $name ) ),\n\t\t\t'add_new_item' => __( 'Add New ' . $name ),\n\t\t\t'edit_item' => __( 'Edit ' . $name ),\n\t\t\t'new_item' => __( 'New ' . $name ),\n\t\t\t'all_items' => __( 'All ' . $plural ),\n\t\t\t'view_item' => __( 'View ' . $name ),\n\t\t\t'search_items' => __( 'Search ' . $plural ),\n\t\t\t'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\n\t\t\t'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\n\t\t\t'parent_item_colon' => '',\n\t\t\t'menu_name' => $plural\n\t\t);\n\n\t\t$labels = wp_parse_args( $post_type_labels , $defaults_labels );\n\t\t// $labels = wp_parse_args( $this->set_post_type_labels( ), $defaults_labels );\n\t\t// Same principle as the labels. We set some defaults and overwrite them with the given arguments.\n\t\t$defaults_args = array(\n\t\t\t\t// 'label' => $plural,\n\t\t\t\t// 'labels' => $labels,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'supports' => array( 'title', 'editor' ),\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'has_archive' \t=> true,\n\t\t\t);\n\t\t$args = wp_parse_args( $post_type_args , $defaults_args );\n\t\t$args['labels']= $labels;\n\t\t// Register the post type\n\t\tregister_post_type( $post_type_name , $args );\n\t}",
"function rep_create_post_type() {\n\t/*$name = 'name';\n\n\tregister_post_type(\n\t\t$name,\n\t\tarray(\n\t\t\t'labels' => Rep\\Helpers\\post_type_labels( $name ),\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => false,\n\t\t\t'hierarchical' => false,\n\t\t\t'menu_position' => 99,\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'custom-fields',\n\t\t\t\t'page-attributes',\n\t\t\t)\n\t\t)\n\t);*/\n}",
"function cptui_register_my_cpts_id_hack() {\n\n\t$labels = [\n\t\t\"name\" => __( \"ID Hack\", \"apress\" ),\n\t\t\"singular_name\" => __( \"Hack\", \"apress\" ),\n\t];\n\n\t$args = [\n\t\t\"label\" => __( \"ID Hack\", \"apress\" ),\n\t\t\"labels\" => $labels,\n\t\t\"description\" => \"\",\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"show_ui\" => true,\n\t\t\"show_in_rest\" => true,\n\t\t\"rest_base\" => \"\",\n\t\t\"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n\t\t\"has_archive\" => false,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"delete_with_user\" => false,\n\t\t\"exclude_from_search\" => false,\n\t\t\"capability_type\" => \"post\",\n\t\t\"map_meta_cap\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"rewrite\" => [ \"slug\" => \"id_hack\", \"with_front\" => true ],\n\t\t\"query_var\" => true,\n\t\t\"supports\" => false,\n\t];\n\n\tregister_post_type( \"id_hack\", $args );\n}",
"function create_post_type_covers() {\r\n\tregister_post_type('scg-covers',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __('SCG Covers'),\r\n\t\t\t\t'singular_name' => __('Cover'),\r\n\t\t\t\t'all_items' => __('Show all covers'),\r\n\t\t\t\t'add_new' => __('Add new cover'),\r\n\t\t\t\t'edit' => __( 'Edit cover' ),\r\n\t\t\t\t'edit_item' => __( 'Edit cover' ),\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'publicly_queryable' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'covers'),\r\n\t\t\t'taxonomies' => array('scg-cats'),\r\n\t\t\t'supports' => array('title', 'editor', 'thumbnail'),\r\n\t\t\t'register_meta_box_cb' => 'add_covers_metaboxes' \r\n\t\t\t\r\n\t\t)\r\n\t);\r\n}",
"protected function type_portfolio_register()\n {\n\n// $portfolio_slug = function_exists('abtheme_get_opt') ? abtheme_get_opt('portfolio_slug', 'portfolio') : 'portfolio';\n// $args = apply_filters('cmssuperheroes_portfolio_post_type_args', array(\n// 'labels' => array(\n// 'name' => __('Portfolio', CMS_TEXT_DOMAIN),\n// 'singular_name' => __('Portfolio Entry', CMS_TEXT_DOMAIN),\n// 'add_new' => _x('Add New', 'add new on admin panel', CMS_TEXT_DOMAIN),\n// 'add_new_item' => __('Add New Portfolio Entry', CMS_TEXT_DOMAIN),\n// 'edit_item' => __('Edit Portfolio Entry', CMS_TEXT_DOMAIN),\n// 'new_item' => __('New Portfolio Entry', CMS_TEXT_DOMAIN),\n// 'view_item' => __('View Portfolio Entry', CMS_TEXT_DOMAIN),\n// 'view_items' => __('View Portfolio Entries', CMS_TEXT_DOMAIN),\n// 'search_items' => __('Search Portfolio Entries', CMS_TEXT_DOMAIN),\n// 'not_found' => __('No Portfolio Entries Found', CMS_TEXT_DOMAIN),\n// 'not_found_in_trash' => __('No Portfolio Entries Found in Trash', CMS_TEXT_DOMAIN),\n// 'parent_item_colon' => __('Parent Portfolio Entry:', CMS_TEXT_DOMAIN),\n// 'all_items' => __('All Entries', CMS_TEXT_DOMAIN),\n// 'archives' => __('Portfolio Archives', CMS_TEXT_DOMAIN),\n// 'attributes' => __('Portfolio Entry Attributes', CMS_TEXT_DOMAIN),\n// 'insert_into_item' => __('Insert into Portfolio Entry', CMS_TEXT_DOMAIN),\n// 'uploaded_to_this_item' => __('Uploaded to this Portfolio Entry', CMS_TEXT_DOMAIN),\n// 'menu_name' => __('Portfolio', CMS_TEXT_DOMAIN),\n// 'filter_items_list' => __('Filter portfolio list', CMS_TEXT_DOMAIN),\n// 'items_list_navigation' => __('Portfolio list navigation', CMS_TEXT_DOMAIN),\n// 'items_list' => __('Portfolio list', CMS_TEXT_DOMAIN),\n// 'name_admin_bar' => _x('Portfolio', 'add new on admin bar', CMS_TEXT_DOMAIN)\n// ),\n// 'hierarchical' => false,\n// 'description' => '',\n// 'taxonomies' => array('portfolio_category'),\n// 'public' => true,\n// 'show_ui' => true,\n// 'show_in_menu' => true,\n// 'show_in_admin_bar' => true,\n// 'menu_position' => null,\n// 'menu_icon' => 'dashicons-feedback',\n// 'show_in_nav_menus' => true,\n// 'publicly_queryable' => true,\n// 'exclude_from_search' => false,\n// 'has_archive' => true,\n// 'query_var' => true,\n// 'can_export' => true,\n// 'rewrite' => array(\n// 'slug' => $portfolio_slug,\n// 'with_front' => false,\n// 'pages' => true\n// ),\n// 'capability_type' => 'post',\n// 'supports' => array(\n// 'title',\n// 'editor',\n// 'thumbnail',\n// 'excerpt',\n// 'revisions'\n// )\n// ));\n }",
"public static function registerPostType()\n {\n // industry post type\n register_post_type(\n self::$postType,\n array(\n 'labels' => array(\n 'name' => __(self::$postTypeName),\n 'singular_name' => __(self::$postTypeSingularName)\n ),\n 'menu_icon' => self::$postTypeMenuIcon,\n 'public' => true,\n 'has_archive' => true,\n 'capability_type' => 'page',\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'revisions',\n ),\n 'rewrite' => array(\n 'slug' => self::$postTypeSlug,\n ),\n )\n );\n }",
"function registerCustomCPT()\r\n{\r\n $labels = array(\r\n 'name' => _x('Custom Post List', 'post type general name'),\r\n 'singular_name' => _x('Custom Post', 'post type singular name'),\r\n 'add_new' => _x('Add A Custom Post', 'review item'),\r\n 'add_new_item' => __('Add New Custom Post'),\r\n 'edit_item' => __('Edit Custom Post'),\r\n 'new_item' => __('New Custom Post'),\r\n 'view_item' => __('View Custom Post'),\r\n 'search_items' => __('Search Custom Post'),\r\n 'not_found' => __('Nothing found'),\r\n 'not_found_in_trash' => __('Nothing found in Trash')\r\n );\r\n\r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'query_var' => true,\r\n //'menu_icon' => get_template_directory_uri() . '/img/review-icon.png',\r\n 'rewrite' => true,\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'menu_position' => 5,\r\n 'supports' => array('title','thumbnail','editor'),\r\n 'taxonomies' => array('category','post_tag')\r\n );\r\n\r\n register_post_type('my_custom_post', $args);\r\n\r\n}",
"function register() {\n\tregister_custom_post_type();\n\tregister_custom_post_status();\n}",
"function create_companies_posttype() {\n \n register_post_type( 'companies',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Companies' ),\n 'singular_name' => __( 'Company' )\n ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'companies'),\n 'menu_icon' => 'dashicons-building',\n 'supports' => array( 'title', 'editor', 'thumbnail' )\n )\n );\n}",
"function cp_custom_cpt() {\n\t/*\n\t * generators can't be added manually, but only from the addons\n\t */\n\t$capabilities = array(\n 'create_posts' => 'create_boilerplate',\n 'edit_post' => 'edit_post',\n 'edit_posts' => 'edit_posts',\n 'edit_other_posts' => 'edit_other_posts',\n 'delete_post' => 'delete_post',\n 'delete_posts' => 'delete_posts',\n 'read' => 'read',\n );\n\n $args = array(\n 'public' => true,\n 'show_in_rest' => true,\n\t\t'menu_icon' => 'dashicons-editor-code',\n 'rewrite' => array( 'feeds' => true ),\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions' ),\n 'label' => 'Generators',\n\t\t// 'capabilities' => $capabilities,\n );\n\n register_post_type( 'generators', $args );\n\n\n\t/**\n\t * CodePress homepage & documentation\n\t *\n\t */\n $args = array(\n 'label' => __( 'CodePress Tags', 'my-textdomain' ),\n 'public' => true,\n 'query_var' => false,\n 'rewrite' => false,\n\t\t\t'hierarchical' => true,\n );\n\n register_taxonomy( 'codepress', 'codepress', $args );\n\n $args = array(\n 'public' => true,\n 'show_in_rest' => true,\n\t\t\t'taxonomies' => array( 'codepress' ),\n 'label' => 'CodePress',\n\t\t\t'menu_icon' => 'dashicons-format-aside',\n\t\t\t'supports' => array( 'title', 'editor', 'page-attributes' ),\n );\n\n register_post_type( 'codepress', $args );\n\n\t/**\n\t * For each generator item I'm gonna create a custom post type.\n\t */\n\t $active = get_option( 'codepress_addons', array() );\n\n\t foreach( $active as $cp ) {\n\t\t// register a custom taxonomy for each of them\n\t\tregister_taxonomy(\n\t\t\t$cp['slug'] . '-category',\n\t\t\t$cp['slug'],\n\t\t\tarray(\n\t\t\t\t'label' => 'Categories',\n\t\t\t\t'rewrite' => array( 'slug' => $cp['slug'] ),\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'show_in_rest' => true,\n\t\t\t)\n\t\t);\n\n\t\t$args = array(\n\t\t 'public' => true,\n\t\t 'hierarchical' => true,\n\t\t 'show_in_rest' => true,\n\t\t 'rewrite' => array( 'feeds' => true ),\n\t\t 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions', 'custom-fields' ),\n\t\t 'label' => $cp['name'],\n\t\t /*\n\t\t * Use the description field as endpoint \"parent\".\n\t\t\t* So the \"addon\" endpoint will be: /generators/[slug]\n\t\t\t*/\n\t\t 'description' => 'generators',\n\t\t);\n\n\t\tregister_post_type( $cp['name'], $args );\n\n\t\t//Custom taxonomy icon\n\t\tadd_action( $cp['slug'] . '-category_add_form_fields', 'codepress_taxonomy_add_icon_field' );\n\t\tadd_action( $cp['slug'] . '-category_edit_form_fields', 'codepress_taxonomy_edit_icon_field', 10, 2 );\n\n\t\tadd_action( 'edited_' . $cp['slug'] . '-category', 'codepress_save_taxonomy_custom_meta', 10, 2 );\n\t\tadd_action( 'create_' . $cp['slug'] . '-category', 'codepress_save_taxonomy_custom_meta', 10, 2 );\n\n\t}\n}",
"public function register() {\n\t\tadd_action( 'init', function () {\n\t\t\tregister_post_type( $this->get_slug(), $this->get_arguments() );\n\t\t} );\n\t}",
"public function register_cpt() {\n\n\t\t$args = array(\n\t\t\t'public' \t\t=> true,\n \t\t'label' \t\t=> __( 'Food', 'mobile-order' ),\n \t\t'menu_icon' \t=> 'dashicons-carrot',\n\t\t\t'hierarchical'\t=> true,\n\t\t\t'supports'\t\t=> array( 'title', 'editor', 'page-attributes' )\n \t);\n\n \tregister_post_type( 'food', $args );\n\n\t}",
"function register_post_types(){\n\t\t}",
"function initcustomtypes()\n{\n\n // Create poduit post type\n $labels = array(\n 'name' => __('Produits', 'caproduct'),\n 'singular_name' => __('Advanced Custom Fields', 'caproduct'),\n 'add_new' => __('Ajouter', 'caproduct'),\n 'add_new_item' => __('Ajouter Produit', 'caproduct'),\n 'edit_item' => __('Modifier Produit', 'caproduct'),\n 'new_item' => __('Nouveau Produit', 'caproduct'),\n 'view_item' => __('Voir Produit', 'caproduct'),\n 'search_items' => __('Rechercher Produit', 'caproduct'),\n 'not_found' => __('Pas de Produit', 'caproduct'),\n 'not_found_in_trash' => __('Pas de Produit', 'caproduct'),\n );\n\n register_post_type('caproduits', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"caproduits\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n\n// Create deliverymethod post type\n $labels = array(\n 'name' => __('Livraisons', 'calivraison'),\n 'singular_name' => __('Advanced Custom Fields', 'calivraison'),\n 'add_new' => __('Ajouter', 'calivraison'),\n 'add_new_item' => __('Ajouter livraison', 'calivraison'),\n 'edit_item' => __('Modifier livraison', 'calivraison'),\n 'new_item' => __('Nouveau livraison', 'calivraison'),\n 'view_item' => __('Voir livraison', 'calivraison'),\n 'search_items' => __('Rechercher livraison', 'calivraison'),\n 'not_found' => __('Pas de livraison', 'calivraison'),\n 'not_found_in_trash' => __('Pas de livraison', 'calivraison'),\n );\n\n register_post_type('calivraisons', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"calivraisons\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n// Create Categories post type\n $labels = array(\n 'name' => __('Catégories', 'cacategory'),\n 'singular_name' => __('Advanced Custom Fields', 'cacategory'),\n 'add_new' => __('Ajouter', 'cacategory'),\n 'add_new_item' => __('Ajouter Catégorie', 'cacategory'),\n 'edit_item' => __('Modifier Catégorie', 'cacategory'),\n 'new_item' => __('Nouvelle Catégorie', 'cacategory'),\n 'view_item' => __('Voir Catégorie', 'cacategory'),\n 'search_items' => __('Rechercher Catégorie', 'cacategory'),\n 'not_found' => __('Pas de Catégorie', 'cacategory'),\n 'not_found_in_trash' => __('Pas de Catégorie', 'cacategory'),\n );\n\n register_post_type('cacategory', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"cacategory\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n\n// Create paiementmode post type\n $labels = array(\n 'name' => __('Paiements', 'calpaiement'),\n 'singular_name' => __('Advanced Custom Fields', 'calpaiement'),\n 'add_new' => __('Ajouter', 'calpaiement'),\n 'add_new_item' => __('Ajouter paiement', 'calpaiement'),\n 'edit_item' => __('Modifier paiement', 'calpaiement'),\n 'new_item' => __('Nouveau paiement', 'calpaiement'),\n 'view_item' => __('Voir paiement', 'calpaiement'),\n 'search_items' => __('Rechercher paiement', 'calpaiement'),\n 'not_found' => __('Pas de paiement', 'calpaiement'),\n 'not_found_in_trash' => __('Pas de paiement', 'calpaiement'),\n );\n\n register_post_type('capaiements', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"capaiements\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n \n // Create card post type\n $labels = array(\n 'name' => __('Carte', 'cacarte'),\n 'singular_name' => __('Advanced Custom Fields', 'cacarte'),\n 'add_new' => __('Ajouter', 'cacarte'),\n 'add_new_item' => __('Ajouter Carte', 'cacarte'),\n 'edit_item' => __('Modifier Carte', 'cacarte'),\n 'new_item' => __('Nouvelle Carte', 'cacarte'),\n 'view_item' => __('Voir Carte', 'cacarte'),\n 'search_items' => __('Rechercher Carte', 'cacarte'),\n 'not_found' => __('Pas de Carte', 'cacarte'),\n 'not_found_in_trash' => __('Pas de Carte', 'cacarte'),\n );\n\n register_post_type('cacartes', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"cacartes\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n\n // Create gifts post type\n $labels = array(\n 'name' => __('Cadeaux', 'cagift'),\n 'singular_name' => __('Advanced Custom Fields', 'cagift'),\n 'add_new' => __('Ajouter', 'cagift'),\n 'add_new_item' => __('Ajouter Cadeau', 'cagift'),\n 'edit_item' => __('Modifier Cadeau', 'cagift'),\n 'new_item' => __('Nouveau Cadeau', 'cagift'),\n 'view_item' => __('Voir Cadeau', 'cagift'),\n 'search_items' => __('Rechercher Cadeau', 'cagift'),\n 'not_found' => __('Pas de Cadeau', 'cagift'),\n 'not_found_in_trash' => __('Pas de Cadeau', 'cagift'),\n );\n\n register_post_type('cagifts', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"cagifts\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n\n // Create Projet post type\n $labels = array(\n 'name' => __('Projets', 'caproject'),\n 'singular_name' => __('Advanced Custom Fields', 'caproject'),\n 'add_new' => __('Ajouter', 'caproject'),\n 'add_new_item' => __('Ajouter Projet', 'caproject'),\n 'edit_item' => __('Modifier Projet', 'caproject'),\n 'new_item' => __('Nouveau Projet', 'caproject'),\n 'view_item' => __('Voir Projet', 'caproject'),\n 'search_items' => __('Rechercher Projet', 'caproject'),\n 'not_found' => __('Pas de Projet', 'caproject'),\n 'not_found_in_trash' => __('Pas de Projet', 'caproject'),\n );\n\n register_post_type('caprojects', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"caprojects\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n\n // Create Partenaires post type\n $labels = array(\n 'name' => __('Partenaires', 'capartenaire'),\n 'singular_name' => __('Advanced Custom Fields', 'capartenaire'),\n 'add_new' => __('Ajouter', 'capartenaire'),\n 'add_new_item' => __('Ajouter Partenaire', 'capartenaire'),\n 'edit_item' => __('Modifier Partenaire', 'capartenaire'),\n 'new_item' => __('Nouveau Partenaire', 'capartenaire'),\n 'view_item' => __('Voir Partenaire', 'capartenaire'),\n 'search_items' => __('Rechercher Partenaire', 'capartenaire'),\n 'not_found' => __('Pas de Partenaire', 'capartenaire'),\n 'not_found_in_trash' => __('Pas de Partenaire', 'capartenaire'),\n );\n\n register_post_type('capartenaires', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"capartenaires\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n\n $labels = array(\n 'name' => __('notifications', 'camessagenotif'),\n 'singular_name' => __('Advanced Custom Fields', 'camessagenotif'),\n 'add_new' => __('Ajouter', 'camessagenotif'),\n 'add_new_item' => __('Ajouter notification', 'camessagenotif'),\n 'edit_item' => __('Modifier notification', 'camessagenotif'),\n 'new_item' => __('Nouvelle notification', 'camessagenotif'),\n 'view_item' => __('Voir notification', 'camessagenotif'),\n 'search_items' => __('Rechercher notifications', 'camessagenotif'),\n 'not_found' => __('Pas de notification', 'camessagenotif'),\n 'not_found_in_trash' => __('Pas de notification', 'camessagenotif'),\n );\n\n register_post_type('camessagenotifs', array(\n 'labels' => $labels,\n 'public' => false,\n 'show_ui' => true,\n '_builtin' => false,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'rewrite' => false,\n 'query_var' => \"camessagenotifs\",\n 'supports' => array(\n 'title',\n ),\n 'show_in_menu' => false,\n ));\n\n}",
"function register_cpt() {\n}",
"function clinic() {\n\n $labels = array(\n 'name' => 'Clinics',\n 'singular_name' => 'Clinic',\n 'add_new' => 'Add New Clinic',\n 'add_new_item' => 'Add New Clinic',\n 'edit_item' => 'Edit Clinic',\n 'new_item' => 'Add New Clinic',\n 'view_item' => 'View Clinic',\n 'search_items' => 'Search Clinics',\n 'not_found' => 'No Clinics found',\n 'not_found_in_trash' => 'No clinics found in trash'\n );\n\n $args = array(\n 'labels' => $labels, \n 'public' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions' ),\n 'capability_type' => 'post',\n 'rewrite' => array(\n 'slug'=>'artist',\n 'with_front'=> false,\n 'feed'=> false,\n 'pages'=> false\n ),\n 'menu_position' => 5,\n 'has_archive' => true,\n 'hierarchical' => false,\n 'taxonomies' => array('post_tag')\n );\n\n register_post_type('clinic', $args);\n\n}",
"private static function register_cpt() {\n\t\t\tif ( !class_exists( 'CPT' ) ) {\n\t\t\t\tinclude THEMIFY_BUILDER_LIBRARIES_DIR . '/CPT.php';\n\t\t\t}\n\n\t\t\t// create a template custom post type\n\t\t\t$cpt = new CPT( array(\n\t\t\t\t'post_type_name' =>self::$slug,\n\t\t\t\t'singular' => __( 'Custom Font', 'themify' ),\n\t\t\t\t'plural' => __( 'Custom Fonts', 'themify' )\n\t\t\t), array(\n\t\t\t\t'supports' => array( 'title' ),\n\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t'show_in_menu' => false,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'public' => false,\n\t\t\t\t'has_archive' => false\n\t\t\t) );\n\n\t\t\t// define the columns to appear on the admin edit screen\n\t\t\t$cpt->columns( array(\n\t\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t\t'title' => __( 'Title', 'themify' ),\n\t\t\t\t'font_preview' => __( 'Preview', 'themify' )\n\t\t\t) );\n\t\t}",
"public function register_post_types() {\n\n\t}",
"public function register_post_types() {\n\n\t}",
"public function register_post_types() {\n\n\t}",
"function register_post_type() {\n\t\tglobal $et_theme_opt;\n\n\t\t$portfolio_slug = ( strlen( get_theme_mod( 'portfolio_permalink', 'portfolio' ) ) > 0 ) ? get_theme_mod( 'portfolio_permalink', 'portfolio' ) : _x( 'portfolio', 'portfolio permalink slug', 'goya' );\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Portfolio', 'post type general name', 'goya' ),\n\t\t\t'singular_name' => esc_html__( 'Portfolio Item','goya' ),\n\t\t\t'rewrite' => array('slug' => esc_html__( 'portfolios','goya' )),\n\t\t\t'add_new' => _x('Add New', 'portfolio item', 'goya'),\n\t\t\t'add_new_item' => esc_html__('Add New Portfolio Item','goya'),\n\t\t\t'edit_item' => esc_html__('Edit Portfolio Item','goya'),\n\t\t\t'new_item' => esc_html__('New Portfolio Item','goya'),\n\t\t\t'view_item' => esc_html__('View Portfolio Item','goya'),\n\t\t\t'all_items' => esc_html__('All Portfolio','goya'),\n\t\t\t'search_items' => esc_html__('Search Portfolio','goya'),\n\t\t\t'not_found' => esc_html__('No Portfolio items found','goya'),\n\t\t\t'not_found_in_trash' => esc_html__('Nothing found in Trash','goya'),\n\t\t\t'parent_item_colon' => ''\n\t );\n\t \n\t $args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'hierarchical' => false,\n\t\t\t'menu_icon' => 'dashicons-schedule',\n\t\t\t'menu_position' => null,\n\t\t\t'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'custom-fields'),\n\t\t\t'show_in_rest' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'query_var' => true,\n\t\t\t'taxonomies' => array( 'portfolio-category' ),\n\t\t\t'has_archive' => ( get_theme_mod( 'portfolio_main_page', 'automatic' ) == 'automatic' ) ? true : false,\n\t\t\t'rewrite' => array(\n\t\t\t'slug' => untrailingslashit( $portfolio_slug ),\n\t\t\t'with_front' => false\n\t\t\t),\n\t\t\t'capability_type' => 'post',\n\t ); \n\t \n\t register_post_type('portfolio',$args);\n\t flush_rewrite_rules();\n\n\t}",
"public function post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Ordenes de compra'),\n\t\t\t'singular_name' => __( 'Orden de compra' ),\n\t\t\t'add_new' => __('Añadir nueva', 'composition'),\n\t\t\t'add_new_item' => __('Añadir nueva Orden de compra'),\n\t\t\t'edit_item' => __('Edit Orden de compra'),\n\t\t\t'new_item' => __('New Orden de compra'),\n\t\t\t'view_item' => __('View Orden de compra'),\n\t\t\t'search_items' => __('Search Orden de compra Items'),\n\t\t\t'not_found' => __('No se encontraron Ordenes de compra'),\n\t\t\t'not_found_in_trash' => __('No se encontraron Ordenes de compra en la Papelera'),\n\t\t\t'parent_item_colon' => ''\n\t\t );\n\n\t\t $args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t 'has_archive' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t 'show_ui' => true,\n\t\t // 'show_in_menu' => 'edit.php?post_type=shop_order',\n\t\t\t'menu_position' => 56,\n\t\t\t'menu_icon' => 'dashicons-clipboard',\n\t\t\t'rewrite' => array('slug' => __( $this->post_type )),\n\t\t\t'supports' => array('title', 'thumbnail', 'comments', 'revisions') //,'editor'\n\t\t );\n\n\t\t register_post_type(__( $this->post_type ), $args);\n\t}",
"public function register()\n {\n register_post_type( $this->getName(), $this->getArgs() );\n }"
] | [
"0.69124717",
"0.68533945",
"0.6680165",
"0.6584726",
"0.65077996",
"0.6495965",
"0.6484478",
"0.64755785",
"0.64665824",
"0.64599526",
"0.6428615",
"0.64161015",
"0.6411755",
"0.64027226",
"0.6385282",
"0.6382173",
"0.63691676",
"0.6366262",
"0.6363864",
"0.6357849",
"0.6356819",
"0.6355119",
"0.63544655",
"0.6328858",
"0.63173676",
"0.63173676",
"0.63173676",
"0.63162726",
"0.63139576",
"0.6307604"
] | 0.7591857 | 0 |
Checks number of years in multiarray | function checkNumberOfYears($multiarray)
{
$yearsnum = array();
foreach ($multiarray as $usage_item)
{
if(in_array($usage_item['year'],$yearsnum,TRUE) == FALSE)
{
array_push($yearsnum,$usage_item['year']);
}
}
return $yearsnum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasMultipleYears()\n {\n $hasMultipleYears = false;\n if ( $this->getEarliestDate()->format('Y') \n !== $this->getLatestDate()->format('Y') \n ) {\n $hasMultipleYears = true;\n }\n return $hasMultipleYears;\n }",
"function isAtypicalCommonYear($year)\r\n{\r\n\treturn $year % 100 == 0 and !($year % 400 == 0);\r\n}",
"public function hasYear()\n {\n return $this->year !== null;\n }",
"function is_valid_year( $value, $key = '', array $data = array() ) {\n\treturn $value >= date( 'Y' );\n}",
"private function getYears() {\n $startyear = 2014;\n $currentyear = (new DateTime())->format('Y');\n \n for ($year = $startyear; $year < $currentyear+3; $year ++ ) {\n $years[$year] = $year;\n }\n return $years;\n }",
"function getMenCountByYear2(array $users)\n{\n $menfolk = array_filter($users, function ($user) {\n return $user['gender'] === 'male';\n });\n\n $years = array_map(function ($user) {\n return date('Y', strtotime($user['birthday']));\n }, $menfolk);\n\n return array_reduce($years, function ($acc, $year) {\n if (!array_key_exists($year, $acc)) {\n $acc[$year] = 1;\n } else {\n $acc[$year] += 1;\n }\n\n return $acc;\n }, []);\n}",
"public function years() {\n\t\t\t$rows = array();\n\t\t\tforeach ($this->events as $event) {\n\t\t\t\t$ts = new timestamp($event);\n\t\t\t\tif (!in_array($ts->year,$rows)) { $rows[] = $ts->year; }\n\t\t\t}\n\t\t\treturn array_reverse($rows);\n\t\t}",
"function validYearBuilt($yearBuilt)\n {\n return ctype_digit($yearBuilt) && $yearBuilt >= 1600 && $yearBuilt <= 2020;\n }",
"public function supportsYears()\n {\n return false;\n }",
"public function isThisYear();",
"function countAllYears($mysqli)\n{\n // SELECT All\n $years = array(\"2015\",\"2016\",\"2017\",\"2018\");\n for ($i=0; $i < count($years); $i++) {\n $query = \"SELECT COUNT(id) FROM data WHERE month LIKE '$years[$i]%'\";\n $result = mysqli_query($mysqli, $query);\n $rows[$years[$i]][] = mysqli_fetch_row($result);\n }\n\n // If Error\n if (!$result) {\n die('<p class=\"SQLError\">Could not run query: ' . mysqli_error($mysqli) . '</p>');\n }\n\n // Free Query\n mysqli_free_result($result);\n\n // Return Value.\n return $rows;\n}",
"function get_years()\n{\n $yearRange = range(2014, date('Y'));\n foreach ($yearRange as $year) {\n $years[$year] = $year;\n }\n\n return $years;\n}",
"public function altSeries()\n {\n return ($this->altYear != NULL) && (intval($this->altYear)>2000);\n }",
"function count_occurences($array){\n\t$i = 0;\n\t$vett=[];\n\tforeach($array as $el){\n\t\t$year = $el[\"date\"][4];\n\t\t$month = convertMonthToNumbers($el[\"date\"][1]);\n\t\tif(array_key_exists($year, $vett)){\n\t\t\tif(array_key_exists($month, $vett[$year])){\n\t\t\t\t$vett[$year][$month][\"number\"] = $vett[$year][$month][\"number\"]+1;\n\t\t\t\t$vett[$year][$month][\"minutes\"] = $vett[$year][$month][\"minutes\"]+intval($el[\"movie_runtime\"]);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$vett[$year][$month][\"number\"] = 1;\n\t\t\t\t$vett[$year][$month][\"minutes\"] = intval($el[\"movie_runtime\"]);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$vett[$year][$month][\"number\"] = 1;\n\t\t\t$vett[$year][$month][\"minutes\"] = intval($el[\"movie_runtime\"]);\n\t\t}\n\t}\n\treturn $vett;\n}",
"public function newYear($i){\n if ($this->yearFormat($this->getOne($i)[\"unix_timestamp\"]) != $this->yearFormat($this->getOne($i + 1)[\"unix_timestamp\"]))\n return true;\n else\n return false;\n }",
"function is_kabise($year)\r\n {\r\n\r\n if ($year % 4 == 0 && $year % 100 != 0)\r\n return true;\r\n\r\n return false;\r\n\r\n }",
"protected function testCount()\n {\n $array_minimum = $this->getOption('array_minimum', 0);\n $array_maximum = $this->getOption('array_maximum', 9999999999);\n\n if (count($this->field_value) < $array_minimum\n || count($this->field_value) > $array_maximum\n ) {\n return false;\n }\n\n return true;\n }",
"protected function _premieredyear() {\n\n\t\tif ( !isset( static::$data[ 'premiered' ] ) ) $this->premiered();\n\n\t\treturn ( isset( static::$data[ 'premiered' ][ 'year' ] ) ) ? static::$data[ 'premiered' ][ 'year' ] : FALSE;\n\t}",
"public static function getNumberOfYears() {\n $dropouts = DB::table('studentdropouts')->lists('studentid');\n\n return Studentterm::join('programs', 'programs.programid', '=', 'studentterms.programid')->select(DB::raw('COUNT(*)/3 as numYears'))->where('programs.degreelevel', 'U')->whereNotIn('programs.programid', array(62, 66, 38, 22))->whereNotIn('studentid', $dropouts)->groupBy('studentid')->where('studentterms.studentid', '>=', 200000000)->where('studentterms.studentid', '<', 201000000)->get();\n }",
"function getYears();",
"public function testArrayData()\n {\n $groups = new AgeGroups;\n $this->assertTrue(count($groups->all()) === 10, 'Should have 10 groups' );\n }",
"function get_calendar_years(){\n\t\t$this_year = date(\"Y\") + 10;\n\t\t\n\t\t$return = array();\n\t\tfor( $i = $this_year; $i > 1997; --$i ){\n\t\t\t$return[ $i ] = $i;\n\t\t}\n\t\treturn $return;\n\t}",
"function meetups_list_years() : array\n{\n // Fetch the meetup years\n $qmeetups = query(\" SELECT YEAR(meetups.event_date) AS 'm_year'\n FROM meetups\n GROUP BY YEAR(meetups.event_date)\n ORDER BY YEAR(meetups.event_date) DESC \");\n\n // Prepare the data\n for($i = 0; $row = mysqli_fetch_array($qmeetups); $i++)\n $data[$i]['year'] = sanitize_output($row['m_year']);\n\n // Add the number of rows to the data\n $data['rows'] = $i;\n\n // Return the prepared data\n return $data;\n}",
"private function is_multi_array ( $array ) {\n if ( count( $array ) == count( $array, COUNT_RECURSIVE ) )\n return FALSE;\n else\n return TRUE;\n }",
"public function wordsOverTime($year = null)\n\t{\n\t\t$words['data'] = array();\n\n\t\tfor ($i = 1; $i <= 12; $i++)\n\t\t{\n\t\t\t$dt = Carbon::create($year, $i, 1, 1, 0, 0);\n\n\t\t\t$label = $dt->format(\"M\");\n\t\t\t$year = $dt->format(\"Y\");\n\n\t\t\t$count_current = $this->generateWords($dt->startOfMonth()->toDateTimeString(), $dt->endOfMonth()->toDateTimeString());\n\n\t\t\t$count_past = $this->generateWords($dt->startOfMonth()->subYear()->toDateTimeString(), $dt->endOfMonth()->toDateTimeString());\n\n\t\t\t$words['data'][] = ['label' => $label, 'a' => $count_current, 'b' => $count_past];\n\t\t\t$words['labels'] = [$year, $dt->format(\"Y\")];\n\t\t}\n\n\t\treturn $words;\n\t}",
"public function Check_BuildRecord_IsOldStyle($array)\r {\r \r if (is_array(reset($array))) {\r $dimensions = $this->Check_BuildRecord_IsOldStyle(reset($array)) + 1;\r } else {\r $dimensions = 1;\r }\r \r $oldversion = ($dimensions == 1) ? 1 : 0;\r return $oldversion;\r }",
"function validate_year(){\n if( isset($_POST['years']) && (strlen($_POST['years']) == 0) ){ \n echo \"Please select a year!\";\n }\n }",
"public function getYears() {\n $q = dibi::query(\"\n SELECT DISTINCT year\n FROM subjects\n ORDER BY year\n \");\n return $q->fetchPairs('year', 'year');\n }",
"static function valid_slide_fields($array)\n {\n return isset($array['caption']) && isset($array['index']) \n && (count($array) === 2) && isset($_FILES['img']);\n }",
"function Years($dateStart=\"\",$dateStop=\"\")\r\n\t{\r\n\t\tif ($dateStart || $dateStop || $this->_years==0) $this->Span(\"years\",$dateStart,$dateStop);\r\n\t\treturn $this->_years;\r\n\t}"
] | [
"0.66487885",
"0.58949816",
"0.58621925",
"0.5714154",
"0.5651791",
"0.5643954",
"0.56219614",
"0.5615822",
"0.5526872",
"0.54999435",
"0.5485218",
"0.5419553",
"0.54139984",
"0.54136026",
"0.53980374",
"0.5393171",
"0.53836566",
"0.5339684",
"0.53315234",
"0.52880174",
"0.52145076",
"0.5188913",
"0.51725316",
"0.5164543",
"0.51212394",
"0.50963235",
"0.5095359",
"0.50937074",
"0.5058524",
"0.5042883"
] | 0.82451606 | 0 |
Test that the expected tag specs exist for the body. | public function test_expected_meta_tags(): void {
$named_specs = array_filter(
(array) AMP_Allowed_Tags_Generated::get_allowed_tag( 'meta' ),
static fn( $spec ) => isset( $spec['tag_spec']['spec_name'] ) && \Google\Web_Stories\AMP\Meta_Sanitizer::BODY_ANCESTOR_META_TAG_SPEC_NAME === $spec['tag_spec']['spec_name']
);
$this->assertCount( 1, $named_specs );
$body_ok_specs = array_filter(
(array) AMP_Allowed_Tags_Generated::get_allowed_tag( 'meta' ),
static function ( $spec ) {
$head_required = (
( isset( $spec['tag_spec']['mandatory_parent'] ) && 'head' === $spec['tag_spec']['mandatory_parent'] )
||
( isset( $spec['tag_spec']['mandatory_ancestor'] ) && 'head' === $spec['tag_spec']['mandatory_ancestor'] )
);
return ! $head_required;
}
);
$this->assertEquals( $named_specs, $body_ok_specs );
$spec = current( $named_specs );
$this->assertArrayHasKey( 'name', $spec['attr_spec_list'] );
$this->assertEquals( [ 'disallowed_value_regex' ], array_keys( $spec['attr_spec_list']['name'] ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testThereMayNotBeAnyContentBeforeTheOpeningTag(): void\n {\n }",
"public function testPassingInvalidAtrributeThrowsException()\r\n {\r\n \t$this->_helper->bodyTag('notvalid');\r\n }",
"public function testCanOpenTagUsingToStringMethodAndRetrieveExpectedData()\r\n {\r\n $this->_helper->bodyTag('class', 'top')\r\n ->bodyTag('class', 'bottom', false, ';');\r\n $this->assertSame(\r\n '<body class=\"top; bottom\">', $this->_helper->toString()\r\n ); \t\r\n }",
"public function testCanSetValidAttributeValue()\r\n {\r\n \t$this->_helper->bodyTag('class', 'top');\r\n \t$this->assertSame('<body class=\"top\">', (string) $this->_helper);\r\n }",
"public function testTags(): void\n {\n $app = $this->porter->importOne(new Import(new ScrapeAppFixture('tags.html')));\n\n self::assertArrayHasKey('tags', $app);\n self::assertCount(5, $tags = $app['tags']);\n\n foreach ($tags as $tag) {\n self::assertArrayHasKey('tagid', $tag);\n self::assertArrayHasKey('name', $tag);\n self::assertArrayHasKey('count', $tag);\n }\n\n self::assertSame(493, $tags[0]['tagid']);\n self::assertSame('Early Access', $tags[0]['name']);\n self::assertSame(24, $tags[0]['count']);\n self::assertArrayNotHasKey('browseable', $tags[0]);\n\n self::assertArrayHasKey('browseable', $tags[1]);\n self::assertTrue($tags[1]['browseable']);\n }",
"public function test_phpdoc_tags_tests() {\n global $PAGE;\n $output = $PAGE->get_renderer('local_moodlecheck');\n $path = new local_moodlecheck_path('local/moodlecheck/tests/fixtures/phpdoc_tags_test.php ', null);\n $result = $output->display_path($path, 'xml');\n\n // Convert results to XML Objext.\n $xmlresult = new DOMDocument();\n $xmlresult->loadXML($result);\n\n // Let's verify we have received a xml with file top element and 5 children.\n $xpath = new DOMXpath($xmlresult);\n $found = $xpath->query(\"//file/error\");\n // TODO: Change to DOMNodeList::count() when php71 support is gone.\n $this->assertSame(5, $found->length);\n\n // Also verify various bits by content.\n $this->assertStringContainsString('packagevalid', $result);\n $this->assertStringContainsString('Invalid phpdocs tag @small', $result);\n $this->assertStringContainsString('Invalid phpdocs tag @zzzing', $result);\n $this->assertStringContainsString('Invalid phpdocs tag @inheritdoc', $result);\n $this->assertStringNotContainsString('Incorrect path for phpdocs tag @covers', $result);\n $this->assertStringNotContainsString('Incorrect path for phpdocs tag @dataProvider', $result);\n $this->assertStringNotContainsString('Incorrect path for phpdocs tag @group', $result);\n $this->assertStringNotContainsString('@deprecated', $result);\n }",
"public function testCanSetTwoAttributes()\r\n {\r\n \t$this->_helper->bodyTag('class', 'top')->bodyTag('style', 'left');\r\n \t$this->assertSame(\r\n \t '<body class=\"top\" style=\"left\">', (string) $this->_helper\r\n \t);\r\n }",
"public function testTagAction()\n {\n $res = $this->controller->tagActionGet(\"tokyo\");\n $this->assertInstanceOf(\"\\Anax\\Response\\Response\", $res);\n\n $body = $res->getBody();\n $exp = \"<title>Show questions with tag | Travelers' i</title>\";\n $this->assertContains($exp, $body);\n }",
"function test_special_tags()\n\t{\n\t\t$this->assertEqual( \"<p>foo</p><!--more--><p>bar</p>\",\n\t\t\t$this->render( 'foo<!--more-->bar' ) );\n\n\t\t$this->assertEqual( \"<p>foo</p><!--more--><!--noteaser--><p>bar</p>\",\n\t\t\t$this->render( 'foo<!--more--><!--noteaser-->bar' ) );\n\n\t\t$this->assertEqual( \"<p>foo</p><!--nextpage--><p>bar</p>\",\n\t\t\t$this->render( 'foo<!--nextpage-->bar' ) );\n\n\t\t$this->assertEqual( \"<p>foo</p><!--noteaser--><p>bar</p>\",\n\t\t\t$this->render( 'foo<!--noteaser-->bar' ) );\n\t}",
"public function testCreateTag()\n {\n }",
"public function testPassingSimilarAttributeValueIsNotConsideredDuplicateSurrounded()\r\n {\r\n $this->_helper->bodyTag('class', 'top')->bodyTag('class', 'stops');\r\n $this->assertSame(\r\n '<body class=\"top stops\">', (string) $this->_helper\r\n );\r\n }",
"public function testPassingSimilarAttributeValueIsNotConsideredDuplicatePrepended()\r\n {\r\n $this->_helper->bodyTag('class', 'top')->bodyTag('class', 'stop');\r\n $this->assertSame(\r\n '<body class=\"top stop\">', (string) $this->_helper\r\n );\r\n }",
"public function verifyHomepageAttributeTag ()\n {\n $OneWeb = new OneWeb();\n \\PHPUnit_Framework_Assert::assertEquals(self::ATTR_HOME_BODY_TAG,$OneWeb->getAttributeBodyPage2());\n }",
"public function testPassingSimilarAttributeValueIsNotConsideredDuplicateAppended()\r\n {\r\n $this->_helper->bodyTag('class', 'top')->bodyTag('class', 'tops');\r\n $this->assertSame(\r\n '<body class=\"top tops\">', (string) $this->_helper\r\n );\r\n }",
"public function test_bug_186()\n\t{\n\t\t$doc = \"<html><body><p></p><p></p></body><p></p></html>\";\n\t\t$this->html->load($doc);\n\t\t$this->assertCount(2, $this->html->find('body p'));\n\t}",
"public function testTheShortOpenTagMayNotBeUsed(): void\n {\n }",
"public function testCanSetTwoValuesToAnAttribute()\r\n {\r\n \t$this->_helper->bodyTag('class', 'top')->bodyTag('class', 'bottom');\r\n \t$this->assertSame(\r\n \t '<body class=\"top bottom\">', (string) $this->_helper\r\n \t);\r\n }",
"public function testTagExists() {\r\n\t\r\n\t\t// Perform request\r\n\t\t$request = $this->client->request('GET', '/newtag/17/bar');\r\n\t\r\n\t\t// Get the content and convert to array\r\n\t\t$content = $this->client->getResponse()->getContent();\r\n\t\t$array_of_contents = json_decode($content,true);\r\n\t\r\n\t\t$this->assertEquals(412, $array_of_contents[\"error\"][\"code\"]);\r\n\t\t$this->assertEquals(\"Tag bestaat al in dit monument\", $array_of_contents[\"error\"][\"message\"]);\r\n\t}",
"public function testCanOverwriteAnAttributesValue()\r\n {\r\n $this->_helper->bodyTag('class', 'top')\r\n ->bodyTag('class', 'bottom', true);\r\n $this->assertSame(\r\n '<body class=\"bottom\">', (string) $this->_helper\r\n );\r\n }",
"public function testFixture() : void {\n $message = $this->getFixture(\"html_only.eml\");\n\n self::assertEquals(\"Nuu\", $message->subject);\n self::assertEquals(\"<html><body>Hi</body></html>\", $message->getHTMLBody());\n self::assertFalse($message->hasTextBody());\n self::assertEquals(\"2017-09-13 11:05:45\", $message->date->first()->setTimezone('UTC')->format(\"Y-m-d H:i:s\"));\n self::assertEquals(\"[email protected]\", $message->from->first()->mail);\n self::assertEquals(\"[email protected]\", $message->to->first()->mail);\n }",
"public function testPassingSameAttributeValueTwiceDoesNotResultInDuplication()\r\n {\r\n \t$this->_helper->bodyTag('class', 'top')->bodyTag('class', 'top');\r\n $this->assertSame(\r\n '<body class=\"top\">', (string) $this->_helper\r\n );\r\n }",
"public function testBodyMethod()\n {\n\n $body = [\n \"query\" => [\n \"bool\" => [\n \"must\" => [\n [\"match\" => [\"address\" => \"mill\"]],\n ]\n ]\n ]\n ];\n\n $this->assertEquals(\n $this->getExpected($body),\n $this->getActual($body)\n );\n\n\n }",
"public function testFindByTag()\n {\n $client = static::createClient();\n $em = $client->getContainer()->get('doctrine.orm.entity_manager');\n\n $articleRepository = $em->getRepository('pebBlogBundle:Article');\n $articles = $articleRepository->findByTag('CSS');\n\n $this->assertEquals(5, sizeof($articles));\n\n function is_in_tags($tagLabel,$tags){\n foreach($tags as $tag){\n if($tagLabel == $tag->getLabel())\n return true;\n }\n return false;\n }\n\n foreach($articles as $article){\n $this->assertTrue(is_in_tags('CSS',$article->getTags()));\n }\n }",
"public function testTagClosesAsExpected()\r\n {\r\n \t// Can use abstract class to gather open/close constant\r\n $this->assertSame(\r\n '</body>', \r\n $this->_helper->toString(Pro_View_Helper_AbstractTag::CLOSE)\r\n );\r\n }",
"public function testGetInboxTags()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testPassingSameAttributeValueTwiceSeparatedDoesNotResultInDuplication()\r\n {\r\n $this->_helper->bodyTag('class', 'top')\r\n ->bodyTag('class', 'bottom')\r\n ->bodyTag('class', 'top');\r\n $this->assertSame(\r\n '<body class=\"top bottom\">', (string) $this->_helper\r\n );\r\n }",
"public function hasAnyTag();",
"public function testGetElementsByTagNameNotExists()\n {\n $root = new Node('<div class=\"container\"><ul><li>Item 1</li><li id=\"item-2\">Item 2</li></ul></div>');\n $elements = $root->getElementsByTagName('a');\n $this->assertCount(0, $elements);\n }",
"public function hasBody()\n {\n return $this->annotations->exists(Body::NAME) || $this->annotations->exists(Part::NAME);\n }",
"public function testGoodRequestReturnsContentBody()\n {\n $obj = new Curl();\n $res = $obj->request('http://example.org');\n $this->assertTrue(strpos($res, \"<body>\") != false, \"The response should include a <body> tag, since it is a HTML document\");\n }"
] | [
"0.65444934",
"0.6425049",
"0.623087",
"0.6222895",
"0.6199688",
"0.61893594",
"0.614643",
"0.6066166",
"0.6048693",
"0.6046094",
"0.60346144",
"0.59733814",
"0.5951655",
"0.5913811",
"0.59048986",
"0.583012",
"0.57783735",
"0.57573295",
"0.5701906",
"0.5680528",
"0.56563896",
"0.5648558",
"0.5645688",
"0.5633754",
"0.56256044",
"0.55379295",
"0.55210423",
"0.5520431",
"0.5503464",
"0.54994386"
] | 0.7625655 | 0 |
Automatically invite a visitor into chat. | public function inviteVisitor($args)
{
// Get a visitor
$visitor = $args['visitor'];
$visitor_id = $visitor['visitorid'];
// Is a visitor invited at the moment?
$invitation_state = invitation_state($visitor_id);
// Was a visitor invited before?
$was_invited = $visitor['invitations'] > 0;
// How long a visitor is on the site?
$spent_on_site = (time() - $visitor['firsttime']);
// Are there any operators available?
$anybody_online = has_online_operators($this->group);
// Check whether the visitor should be invited into chat
$send_invitation = !$invitation_state['invited']
&& !$was_invited
&& ($spent_on_site > $this->wait_time)
&& $anybody_online;
if ($send_invitation) {
// Determine operator to send the invitation
$operators = get_online_operators($this->group);
if ($this->strategy == 'first') {
// Invite on behalf of the first available operator
$operator = $operators[0];
}
else {
// Invite on behalf of a random available operator
$operator = $operators[array_rand($operators)];
}
// Invite into chat
$thread = invitation_invite($visitor_id, $operator);
// Store ID of the thread in the database for future use
Database::getInstance()->query(
'INSERT INTO {mibew_autoinvite} (threadid) VALUES (:threadid)',
array(':threadid' => $thread->id)
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function botInviteToChat($id, $members) {\n global $t;\n $cont = $t->chatSession[$id];\n $t->bl(\"Inviting $cont to chat session...\");\n $t->InviteToChat($id, $cont);\n}",
"function invitefriend()\r\n\t{\r\n\t\t$this->autoRender = false;\r\n\t\t\r\n\t\tif (!empty($this->data))\r\n\t\t{\r\n\t\t\t$sentEmails = $this->Mail->inviteFriends ( $this->data,$this );\r\n\t\t\t\r\n\t\t\t$inviteData['FriendInvitaion']['user_id'] = $this->Session->read(\"Auth.Member.id\");\r\n\t\t\t$inviteData['FriendInvitaion']['emails'] = implode(\",\", $sentEmails['emails']);\r\n\t\t\t$inviteData['FriendInvitaion']['message'] = $sentEmails['message'];\r\n\t\t\t$inviteData['FriendInvitaion']['code'] = $sentEmails['code'];\r\n\t\t\t\r\n\t\t\t$this->FriendInvitaion->create();\r\n\t\t\t$this->FriendInvitaion->save($inviteData);\r\n\t\t}\r\n\t}",
"public static function inviteFriend() {\n\t\t\t// Add Classes\n\t\t\t$RepQuestion\t= new RepQuestion();\t\n\t\t\t$ModAlert\t\t= new ModAlert();\n\t\t\t// Initialize variables\n\t\t\t$email\t\t\t= (isset($_POST['email'])) ? trim($_POST['email']) : false;\n\t\t\t$user\t\t\t= Session::getVar('user');\n\t\t\t// If values were sent\n\t\t\tif (($user) && ($email)) {\n\t\t\t\t// Fetch content\n\t\t\t\t$email_content\t= $ModAlert->inviteFriendEmail($user['vc_user'], $user['vc_email'], $email);\n\t\t\t\t// If email was sent\n\t\t\t\tif (mail($email, 'You were invited to play Knowledge Question Adventure', $email_content, \"From:\".$user['vc_email'])) {\n\t\t\t\t\t// Register it on database\n\t\t\t\t\t$return\t\t= ($RepQuestion->logInviteFriend($user['id'], $email)) ? 'ok' : 'Most likely you have invited that person already.';\n\t\t\t\t\t// Prepare return\n\t\t\t\t// If email was not sent\n\t\t\t\t} else {\n\t\t\t\t\t// Prepare return\n\t\t\t\t\t$return\t\t= 'mail object error: email not sent';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Print return on screen\n\t\t\techo $return;\n\t\t}",
"public function inviteToConnectAction()\n {\n\t\t$params=$this->getRequest()->getParams();\n\t\t$link_request_type = \\Extended\\link_requests::LINK_REQUEST_TYPE_VIA_ILOOK;\n\t\t$request_user=Auth_UserAdapter::getIdentity()->getId();\n\t\t\n\t\t$request_arr = array();\n\t\t$request_arr['link_request_type'] = $link_request_type;\n\t\t$request_arr['request_user_id'] = $request_user;\n\t\t$request_arr['accept_user_id'] = $params[\"accept_user\"];\n\t\t$send_link_request = \\Extended\\link_requests::sendRequest($request_arr);\n\t\t\n\t\tif($send_link_request[\"request-status\"]==\"already sent\")\n\t\t{\n\t\t\t$userObj = \\Extended\\ilook_user::getRowObject($params[\"accept_user\"]);\n\t\t\t$userName = ucwords($userObj->getFirstname().\" \".$userObj->getLastname());\n\t\t\t$request = array(\"requestID\"=>$send_link_request,\"requestStatus\"=>\"already sent invitation\",\"uname\"=>$userName);\n\t\t\techo Zend_Json::encode($request);\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo Zend_Json::encode($send_link_request);\n\t\t}\n\t\tdie;\n }",
"function onInvite($sNickname, $sChannel, $sOther)\r\n\t{\r\n\t\t$this->Log($sNickname.\" has been invited to \".$sChannel.\". And to prove it to you, \".$sOther.\" is the other!\");\r\n\t\t// Will output: 'Username has been invited to #channel. And to prove it to you, Westie is the other!'\r\n\t}",
"protected function sendInvitation()\n {\n Mail::sendTo($this, 'rainlab.user::mail.invite', $this->getNotificationVars());\n }",
"public function sendInvitations()\n {\n }",
"public function invite()\n {\n $email = Input::get(\"email\");\n $app_id = Input::get(\"app_id\");\n $action = (int)Input::get(\"action\");\n $from_id = $this->getCurrentUserID();\n\n if ($action !== UserMessage::ACTION_REMOVE && $action !== UserMessage::ACTION_INVITE) {\n //not support action\n $this->ajaxResponse(BaseController::$_FAILED_TEMPLATE);\n }\n if ($action === UserMessage::ACTION_REMOVE && $user_id = Input::get('user_id')) {\n //todo notification not support ,so no need create message\n ATURelationModel::where('user_id', $user_id)->where('app_id', $app_id)->delete();\n $result = true;\n } else {\n //invite\n if (empty($email)) {\n $this->ajaxResponse(BaseController::$_FAILED_TEMPLATE);\n }\n $result = UserMessage::processMessageByMail($from_id, $app_id, $email, $action);\n }\n if ($result !== true) {\n $this->ajaxResponse(BaseController::$FAILED, $result);\n }\n $this->ajaxResponse(BaseController::$SUCCESS, BaseController::$MESSAGE_DO_SUCCESS, '', URL::action('DashBoardController@index'));\n }",
"public function sendInvitation()\n {\n $data = [\n 'name' => $this->full_name,\n 'login' => $this->login,\n 'password' => $this->getOriginalHashValue('password'),\n 'link' => Backend::url('backend'),\n ];\n\n Mail::send('backend::mail.invite', $data, function ($message) {\n $message->to($this->email, $this->full_name);\n });\n }",
"public function sendNewFriendNotification()\n {\n }",
"function invite()\n\t{\n\t\tif (!empty($this->data['SuiUser']))\n\t\t{\n\t\t\t$error = $saved = false;\n\t\t\t\n\t\t\tunset($this->data['SuiUser']['id']);\n\t\t\t$this->data['SuiUser']['user_status'] = 'invited';\n\t\t\t\n\t\t\t$this->SuiUser->create($this->data);\n\t\t\tif ($this->SuiUser->validates())\n\t\t\t{\n\t\t\t\tif ($this->SuiUser->save())\n\t\t\t\t{\n\t\t\t\t\t$saved = true;\n\t\t\t\t\t$this->set('data', $this->data);\n\t\t\t\t\t$this->MexcMail->send($this->data['SuiUser']['email'], 'MEXC', 'Convite', 'third_user_confirmation');\n\t\t\t\t\t$email = $this->data['SuiUser']['email'];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$validationErrors = $this->SuiUser->validationErrors;\n\t\t\t}\n\t\t\t\n\t\t\t$this->view = 'JjUtils.Json';\n\t\t\t$this->set('jsonVars', compact('error', 'saved', 'validationErrors', 'email'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['SuiUser']['email'] = $this->data['email'];\n\t\t\n\t\t}\n\t\t$this->setFormData();\n\t}",
"public function invite()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t// Set the language to Dutch (TODO: set to language of participant?)\n\t\treset_language(L::DUTCH);\n\n\t\t// Get all age-based testsurveys (definitions of when tests should be sent)\n\t\t$testsurveys = $this->testSurveyModel->get_testsurveys_by_when(TestWhenSent::MONTHS);\n\t\tforeach ($testsurveys as $testsurvey)\n\t\t{\n\t\t\t// Find all participants of the correct age\n\t\t\t$participants = $this->participantModel->get_participants_of_age($testsurvey->whennr);\n\t\t\t$participants += $this->participantModel->get_participants_of_age($testsurvey->whennr - 1);\n\t\t\tforeach ($participants as $participant)\n\t\t\t{\n\t\t\t\t// Check if the participant has a participation, if not, continue\n\t\t\t\t$participations = $this->participationModel->get_participations_by_participant($participant->id, TRUE);\n\t\t\t\tif (empty($participations))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Check if invitation already exists\n\t\t\t\t$testinvite = $this->testInviteModel->get_testinvite_by_testsurvey_participant($testsurvey->id, $participant->id);\n\t\t\t\t\t\n\t\t\t\t// If not, create the invitation with a certain chance (to help spread participant's age)\n\t\t\t\tif (empty($testinvite))\n\t\t\t\t{\n\t\t\t\t\t$rand = mt_rand(1, 100);\n\t\t\t\t\t$probability = $this->probability($participant, $testsurvey->whennr);\n\t\t\t\t\tif ($rand <= $probability)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->send_testinvite($testsurvey, $participant);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function invite() {\r\n $mainframe = JFactory::getApplication();\r\n $jinput = $mainframe->input;\r\n\r\n $jConfig = JFactory::getConfig();\r\n\r\n /**\r\n * Opengraph\r\n */\r\n CHeadHelper::setType('website', JText::sprintf('COM_COMMUNITY_FRIENDS_INVITE_FRIENDS_TITLE', $jConfig->get('sitename')));\r\n\r\n $my = CFactory::getUser();\r\n\r\n //$this->showSubmenu();\r\n\r\n $post = ($jinput->post->get('action', '', 'STRING') == 'invite') ? $jinput->post->getArray() : array('message' => '', 'emails' => '');\r\n\r\n $pathway = $mainframe->getPathway();\r\n $this->addPathway(JText::_('COM_COMMUNITY_FRIENDS'), CRoute::_('index.php?option=com_community&view=groupschedule'));\r\n $this->addPathway(JText::_('COM_COMMUNITY_INVITE_FRIENDS'), '');\r\n\r\n // Process the Suggest Friends\r\n // Load required filterbar library that will be used to display the filtering and sorting.\r\n\r\n $id = $jinput->getInt('userid', $my->id);\r\n $user = CFactory::getUser($id);\r\n $sorted = $jinput->get->get('sort', 'suggestion', 'STRING');\r\n $filter = $jinput->get->get('filter', 'suggestion', 'STRING');\r\n $friends = CFactory::getModel('friends');\r\n\r\n $rows = $friends->getFriends($id, $sorted, true, $filter);\r\n $resultRows = array();\r\n\r\n foreach ($rows as $row) {\r\n $user = CFactory::getUser($row->id);\r\n\r\n $obj = clone($row);\r\n $obj->friendsCount = $user->getFriendCount();\r\n $obj->profileLink = CUrlHelper::userLink($row->id);\r\n $obj->isFriend = true;\r\n $resultRows[] = $obj;\r\n }\r\n\r\n unset($rows);\r\n\r\n $app = CAppPlugins::getInstance();\r\n $appFields = $app->triggerEvent('onFormDisplay', array('jsform-friends-invite'));\r\n $beforeFormDisplay = CFormElement::renderElements($appFields, 'before');\r\n $afterFormDisplay = CFormElement::renderElements($appFields, 'after');\r\n\r\n $tmpl = new CTemplate();\r\n $config = CFactory::getConfig();\r\n $isLimit = $config->get('invite_only', 0) && (intval( $config->get('invite_registation_limit', 0) ) > 0) && !COwnerHelper::isCommunityAdmin();\r\n $limit = intval( $config->get('invite_registation_limit') );\r\n\r\n // substract limit with invitation sent\r\n $invitationTable = JTable::getInstance('invitation', 'CTable');\r\n $invitationTable->load($my->id);\r\n $invited = $invitationTable->getTotalInvitedUsers();\r\n $limit = max(0, $limit - $invited);\r\n\r\n echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)\r\n ->set('afterFormDisplay', $afterFormDisplay)\r\n ->set('my', $my)\r\n ->set('post', $post)\r\n ->setRef('friends', $resultRows)\r\n ->set('config', CFactory::getConfig())\r\n ->set('submenu', $this->showSubmenu(false))\r\n ->set('isLimit', $isLimit)\r\n ->set('limit', $limit)\r\n ->set('isAdmin', COwnerHelper::isCommunityAdmin())\r\n ->fetch('friends.invite');\r\n }",
"function chat_on() {\n \n }",
"function invite_member($message) {\n\t\t$to = get_user_id($message['recipient']);\n\t\t$from = get_user_id($message['sender']);\n\t\t$subject = $message['subject'];\n\t\t$content = $message['message'];\n\t\t$member_request = $message['request'];\n\t\t\t\n\t\t$conn = db_conn();\n\t\t$compose = \"insert into messages (sender_id, recipient_id, subject, content, sender_sent, member_invite) values ('$from', '$to', '$subject', '$content', 1, 1);\";\n\t\t$result = $conn->query($compose);\t\n\t\tif ( !$result ) {\n\t\t\t$conn->close();\n\t\t\tthrow new Exception(\"Problem sending request. Please try again later.\");\t\n\t\t}\n\t\t$conn->close();\n\t\treturn true;\n\t}",
"public function chat() {\n $this->session->preference = 'chat';\n if($this->agent->referrer()) {\n redirect($this->agent->referrer());\n } else {\n $data = [\n 'v' => 'home',\n 'title' => 'Venture Australia',\n 'sub' => 'Startup Centre'\n ];\n $this->load->view('/startup/index',$data);\n }\n }",
"public function broadcastOn()\n {\n $data['user_id'] = $this->user_id;\n $data['user_name'] = $this->user_name;\n $data['message'] = $this->message;\n $data['created_at'] = $this->created_at;\n $query = \"insert into messages (user_id,user_name,message, created_at) values (:user_id,:user_name,:message, :created_at)\";\n DB::insert($query, $data);\n return new Channel('chat');\n }",
"public function sendInvite(Request $request){\n $rules = [\n 'email_fns' => 'required|string|email|max:255',\n ];\n\n $this->validateDingo($request,$rules);\n\n $user = $this->guard()->user();\n\n $activation = Activation::create($user,'corp-invite');\n\n event(new CorpInviteGenerate($request->input('email'), $activation->getCode()));\n\n return $this->response()->created();\n }",
"public function sendInvite(Request $request)\n {\n if( !Auth::check() )\n return response()->json( 'noauth' );\n \n $debate = Debate::where('id', $request['roomId'])->first();\n if( $debate != NULL )\n {\n if( $request['who'] == 'debator_one' )\n {\n $debate->debator_one = $request['email'];\n $debate->one_timelimit = 0;\n }\n else if( $request['who'] == 'debator_two' )\n {\n $debate->debator_two = $request['email'];\n $debate->one_timelimit = 0;\n }\n $debate->save();\n\n // Create new invite\n // $invite = Invites::create([\n // 'debateid' => $request['roomId'],\n // 'email' => $request['email']\n // ]);\n\n $email = $request['email'];\n\n Mail::send('emails.invitation', ['debate' => $debate], function ($m) use ($email) {\n\n $m->to($email)->subject('You got an invitation!');\n });\n \n // $invite->save();\n\n return response()->json( 'success' );\n } \n else\n return response()->json( 'fail' );\n }",
"public function broadcastOn()\n {\n //if this is the acceptance from the consultant to user for their call\n if($this->toId!==\"\"){\n return new PrivateChannel('acceptCall-toId-'.$this->toId);\n }\n //this is for initiating call from user\n if($this->user_type===\"user\"){\n return new PrivateChannel('CallFrom-'.$this->user_type.\"-toId-\".$this->user->consultant_id); \n }\n }",
"public function newInvitedUser() {\n\t\t\t// Inicialize variables\n\t\t\t$email\t\t\t= (isset($GLOBALS['params'][1])) ? trim(($GLOBALS['params'][1])) : false;\n\t\t\t// If values were sent\n\t\t\tif ($email) {\n\t\t\t\t// Prepare reuturn\n\t\t\t\tView::set('email', $email);\n\t\t\t\t// Return\n\t\t\t\tView::render('newInvitedUser');\n\t\t\t}\n\t\t}",
"function testInvite() {\n\t}",
"function yh_invite($username, $invite_id)\n\t{\n\t\tif ($this->ci->user_dal->is_yh_username_available($username))\n\t\t{\n\t\t\t$this->ci->user_dal->create_yh_invite($username, $invite_id);\n\t\t\t\n\t\t\t$this->confirmation = array('invite' => \"Invitation sent. Please let us know if you don't get one.\");\n\t\t\t\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error = array('invite' => 'An invitation has already been sent to that username');\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"function botStart() {\n global $t;\n $t->bl('botStart()',1);\n $t->bl('Running Tinker 2.8',6);\n // start timing script\n $t->time_start = $t->microtime_float();\n $t->bl('Starting event listeners... done.');\n // start event listeners\n $t->onChatJoin = \"botSendMessages\"; // send messages once contact joins chat\n $t->onStatusChange = \"botCheckOnline\"; // monitors if a contact comes online\n $t->onRock = \"botRock\"; // check rocker status on each loop\n $t->rockEvery = 15; // how many loop revolutions before the rock function should run\n // set account in use\n $t->setAcctInUse(1);\n // invite all online friends to chat sessions\n while(count($t->friendsToSend)) {\n $cont = array_pop($t->friendsToSend);\n $t->startNewChat($cont);\n }\n // invite maximum amount of contacts\n $t->batchInvite('max');\n // now just wait for more contacts to sign on or accept invitation\n}",
"function terminus_api_site_team_member_invite($site_uuid, $email, $invited_by) {\n $realm = 'site';\n $uuid = $site_uuid;\n $path = 'team/' . rawurlencode($email);\n $method = 'POST';\n $data = array('invited_by' => $invited_by);\n return terminus_request($realm, $uuid, $path, $method, $data);\n}",
"function bp_send_invites() {\n\t\trewind_posts();\n\t\twp_enqueue_script( 'ep-add-invites', EP_REL_URL . '/themes/bp/assets/js/invites' . kb_ext() . '.js' );\n\t\tadd_filter( 'bpcp_ep_event_single_home_template', Array( &$this, '_invite_template' ) );\n\t\tbp_core_load_template( 'type/single/home' );\n\t}",
"function acceptInvitation($model) {\n AuthenticationController::authenticate(); // IMPORTANT\n\n $valid = ($_SESSION['user']->EMAIL == $model->INVITEE_EMAIL);\n\n // x. If not valid\n if (!$valid) {\n MessageHelper::setAppMessage(_t(\"You need to sign in as\").\" \".$model->INVITEE_EMAIL.\" \"._t(\"to accept the invitation\"));\n\n Framework::redirect(APPLICATION_URL);\n }\n\n // x. The current user is a valid invitee. Now, add it to the inviter domain (~ the invitation domain)\n $extra = new UserExtraDomainModel();\n\n $extra->ID_USER = $_SESSION['user']->ID;\n $extra->EXTRA_UDID = (int)$model->UDID.\"\";\n $extra->VALID_FROM = $model->VALID_FROM;\n $extra->VALID_UNTIL = $model->VALID_UNTIL;\n\n $extra->insert(false);\n\n // x. Add user group and user role\n\t $umc = new UserMembershipController();\n\t $umc->addUserToGroup($_SESSION['user'], $model->ID_USER_GROUP, $model->ID_USER_ROLE, $model->VALID_FROM, $model->VALID_UNTIL);\n\n // x. Update the invitation\n $model->ID_USER_INVITATION_STATUS = 'accepted';\n $model->DATE_ACCEPTED = date('Y-m-d H:i:s');\n\n $model->update();\n\n // x. Redirect\n Framework::redirect(APPLICATION_URL);\n }",
"public function send(Request $request)\n {\n $user = User::find(\\Auth::id());\n $this->saveToSession($request);\n event(new ChatEvent($request->message, $user));\n }",
"public function inviteAction()\r\n\t{\r\n\t\tglobal $HOSTNAME;\r\n\t\tif($this->getRequest()->isPost()){\r\n\t\t\t//save the emai and invite key into the user table\r\n\t\t\t$emailAddr=$this->params()->fromPost('email');\r\n\t\t\t$membershipTable=$membershipTable=$this->getServiceLocator()->get('Team\\Model\\MembershipTable');\r\n\t\t\t$invitekey=$membershipTable->addMember($emailAddr);\r\n\t\t\t$session=new Container('user');\r\n\t\t\t$userTable=$this->getServiceLocator()->get('User\\Model\\UserTable');\r\n\t\t\t$sender=$userTable->getOne(array('userid'=>$session->userId));\r\n\t\t\t$teamTable=$this->getServiceLocator()->get('Team\\Model\\TeamTable');\r\n\t\t\t$teamInfo =$teamTable->getTeamInfo();\r\n\t\t\t$teamname=$teamInfo->teamname;\r\n\t\t\t$config=$this->getServiceLocator()->get('config');\r\n\t\t\t$body=$this->params()->fromPost('content');\r\n\t\t\t$sender=$sender->current();\r\n\t\t\t$format=array(\r\n\t\t\t\t'en_US'=>\"<img src='http://%s/img/renwu.jpg'>Invite you to join the team %s ,<br>Click here <a href=http://%s/user/index/confirm?team=%d&key=%s> http://%s/user/index/confirm?team=%d&key=%s</a><br>You can communicate with %s\",\r\n\t\t\t\t'zh_CN'=>\"<img src='http://%s/img/renwu.jpg'>邀请您加入团队%s ,<br>点击这里 <a href=http://%s/user/index/confirm?team=%d&key=%s>http://%s/user/index/confirm?team=%d&key=%s</a><br>您可以通过该邮箱联系 %s\",\r\n\t\t\t\t'ja_JP'=>\"<img src='http://%s/img/renwu.jpg'>チームに加わろうとあなたを誘い %s ,<br>ここをクリックしてください <a href=http://%s/user/index/confirm?team=%d&key=%s> http://%s/user/index/confirm?team=%d&key=%s</a><br>あなたが通信することができる %s\"\r\n\t\t\t);\r\n\t\t\t$subject=array(\r\n\t\t\t\t'en_US'=>'Invite to Join Our Team',\r\n\t\t\t\t'zh_CN'=>'团队加入邀请函',\r\n\t\t\t\t'ja_JP'=>'チームに参加のご案内'\r\n\t\t\t);\r\n\t\t\t$lang=\\Locale::getDefault();\r\n\t\t\t$body.=sprintf($format[$lang],$HOSTNAME,$teamname,$HOSTNAME,$session->teamid,$invitekey,$HOSTNAME,$session->teamid,$invitekey,$sender->email);\r\n\t\t\t\r\n\t\t\t$html\t=new Part($body);\r\n\t\t\t$html->type='text/html';\r\n\t\t\t$body\t=new MimeMessage();\r\n\t\t\t$body->setParts(array($html));\r\n\t\t\t$message=new Message();\r\n\t\t\t$message->setBody($body);\r\n\t\t\t$message->setEncoding(\"UTF-8\");\r\n\t\t\t$message->setFrom($config['email']['connection_config']['username'],'xiaopang');\r\n\t\t\t$message->addTo($emailAddr);\r\n\t\t\t$message->setSubject('Invite to Join Our Team');\r\n\t\t\t$transport\t=new Smtp();\r\n\t\t\t$options\t=new SmtpOptions($config['email']);\r\n\t\t\t$transport->setOptions($options);\r\n\t\t\t$transport->send($message);\r\n\t\t\treturn new JsonModel();\r\n\t\t}\r\n\t\treturn new JsonModel();\r\n\t}",
"public function befriend(int $id) {\n \n $user = Users::find($_SESSION['id']);\n if($user->befriend($id)) {\n $this->addFlashMessage('info', \"Votre liste d'amis a été mise à jour\");\n // If chat exists do nothing\n //If not, create chat\n if(!$user->findChatWithSingleUser($id)) {\n $chat = new Chats();\n $chat->save(); \n $chat->addUsersToChat($id);\n }\n \n } else {\n $this->addFlashMessage('error', \"Il y a eu une erreur, veuillez réessayer\");\n }\n \n $this->redirect('main-home');\n }"
] | [
"0.6761724",
"0.64839876",
"0.620148",
"0.6062688",
"0.5976316",
"0.5947967",
"0.5934751",
"0.5926529",
"0.58873665",
"0.5872318",
"0.5869933",
"0.58374643",
"0.578989",
"0.57303804",
"0.5625004",
"0.5610595",
"0.5566481",
"0.5561939",
"0.5543925",
"0.55330133",
"0.5521273",
"0.5501969",
"0.5501952",
"0.54911876",
"0.5483599",
"0.54489195",
"0.54458237",
"0.5432715",
"0.5378265",
"0.5368432"
] | 0.6871718 | 0 |
Mark the thread tied to invitation as orphaned (i.e. 'waiting for operator'). | public function markThreadAsOrphaned($args)
{
// Get the thread related to invitation
$thread = $args['invitation'];
// Check whether the thread is related to automatically sent invitation
$result = Database::getInstance()->query(
"SELECT COUNT(*) AS autoinvited FROM {mibew_autoinvite} WHERE threadid = :threadid",
array(':threadid' => $thread->id),
array('return_rows' => Database::RETURN_ONE_ROW)
);
if ($result && isset($result['autoinvited']) && ($result['autoinvited'] > 0)) {
// A visitor was invited automatically, change thread state
$thread->state = Thread::STATE_WAITING;
$thread->nextAgent = 0;
$thread->save(true);
// Forget about the thread
$this->forgetThread($args);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trashThread() {\n\t\t$this->getThread();\n\t\tforeach ($this->replies as $x=>$v) {\n\t\t\t$v->trash();\n\t\t}\n\t\t//the post itself is included in the replies array\n\t\t//get thread is the entire thread\n\t}",
"public function queueBroadcastRemovalToHotwire()\n {\n // using the model instance's relationships before the entity is \"gone\".\n\n app()->terminating(function () {\n $this->hotwireBroadcastUsing()\n ->exceptForSocket(TurboFacade::shouldBroadcastToOthers() ? Broadcast::socket() : null)\n ->remove($this);\n });\n }",
"public function notByInvitationOnly()\n {\n $this->byInvitationOnly = false;\n }",
"public function forgetThread($args)\n {\n $thread = $args['invitation'];\n Database::getInstance()->query(\n 'DELETE FROM {mibew_autoinvite} WHERE threadid = :threadid',\n array(':threadid' => $thread->id)\n );\n }",
"public function disapprove()\n {\n $this->unsetApprovedFlag()->save();\n\n // :TODO: Fire an event here\n }",
"public static function deleteRequest(\\Elgg\\Event $event): void {\n\t\t$relationship = $event->getObject();\n\t\tif (!$relationship instanceof \\ElggRelationship || $relationship->relationship !== 'membership_request') {\n\t\t\t// not a membership request\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$group = get_entity($relationship->guid_two);\n\t\t$user = get_user($relationship->guid_one);\n\t\tif (empty($user) || !$group instanceof \\ElggGroup) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$logged_in_user = elgg_get_logged_in_user_entity();\n\t\tif (!$logged_in_user instanceof \\ElggUser) {\n\t\t\t// some background process is cleaning this\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// remove join motivations\n\t\telgg_delete_annotations([\n\t\t\t'guid' => $group->guid,\n\t\t\t'annotation_owner_guid' => $user->guid,\n\t\t\t'annotation_name' => 'join_motivation',\n\t\t\t'limit' => false,\n\t\t]);\n\t\t\n\t\t// notify requesting user about declined request\n\t\t$action_pattern = '/action\\/groups\\/killrequest/i';\n\t\tif (!preg_match($action_pattern, elgg_get_current_url())) {\n\t\t\t// not in the action, so do nothing\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($user->guid === $logged_in_user->guid) {\n\t\t\t// user kills own request\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$reason = get_input('reason');\n\t\tif (empty($reason)) {\n\t\t\t$body = elgg_echo('group_tools:notify:membership:declined:message', [\n\t\t\t\t$group->getDisplayName(),\n\t\t\t\t$group->getURL(),\n\t\t\t], $user->getLanguage());\n\t\t} else {\n\t\t\t$body = elgg_echo('group_tools:notify:membership:declined:message:reason', [\n\t\t\t\t$group->getDisplayName(),\n\t\t\t\t$reason,\n\t\t\t\t$group->getURL(),\n\t\t\t], $user->getLanguage());\n\t\t}\n\t\t\n\t\t$subject = elgg_echo('group_tools:notify:membership:declined:subject', [\n\t\t\t$group->getDisplayName(),\n\t\t], $user->getLanguage());\n\t\t\n\t\t$params = [\n\t\t\t'object' => $group,\n\t\t\t'action' => 'delete',\n\t\t];\n\t\tnotify_user($user->guid, $logged_in_user->guid, $subject, $body, $params);\n\t}",
"public function moveToPending()\n {\n $now = Carbon::now();\n\n Observation::whereIn('id', $this->getObservationIds())->update([\n 'approved_at' => null,\n 'updated_at' => $now,\n ]);\n\n FieldObservation::whereIn('id', $this->getIds())->update([\n 'unidentifiable' => false,\n 'updated_at' => $now,\n ]);\n }",
"function reset_unasked () {\n\t\tforeach ( $this->entries as $entry )\n\t\t\t$entry->set_has_been_asked( FALSE );\n\t}",
"public function removePawn(){\n $this->player = Null;\n $this->blocked = false;\n }",
"public function markPending()\n {\n $new = (new static)->newQueryWithoutScope(new ActivationScope())->pend($this->id);\n return $this->setRawAttributes($new->attributesToArray());\n }",
"public function markAsUnidentifiable()\n {\n $now = Carbon::now();\n\n Observation::whereIn('id', $this->getObservationIds())->update([\n 'approved_at' => null,\n 'updated_at' => $now,\n ]);\n\n FieldObservation::whereIn('id', $this->getIds())->update([\n 'unidentifiable' => true,\n 'updated_at' => $now,\n ]);\n }",
"public function leave(): ExtendedPromiseInterface\n {\n return $this->http->delete(Endpoint::bind(Endpoint::THREAD_MEMBER_ME, $this->id));\n }",
"public function needsToBeUnowned(string $ownedElement=null);",
"public function respawn() : void{\n $this->despawnFromAll();\n $this->spawnToAll();\n }",
"public function test_a_thread_can_be_locked()\n {\n $thread = create(Thread::class);\n\n // So long as the thread is not locked, new replies can be added\n $reply = create(Reply::class, ['thread_id' => $thread->id]);\n\n // We should have one thread\n $this->assertEquals(1, $thread->replies->count());\n\n // When we lock the thread\n $thread->lock();\n\n // The thread should not be \"open\"\n $this->assertFalse($thread->open);\n }",
"function wakeup()\n {\n $this->atomic->wakeup();\n }",
"public function wakeup()\n {\n $this->receiver = new \\Accounts();\n }",
"function denial_email_creation() {\n \n // Do not create if it already exists and is not in the trash\n $post_exists = post_exists( '{{denier.name}} denied your Friendship request.' );\n \n if ( $post_exists != 0 && get_post_status( $post_exists ) == 'publish' )\n return;\n \n // Create post object\n $my_post = array(\n 'post_title' => __( '{{denier.name}} denied your friendship request.', 'buddypress' ),\n 'post_content' => __( '<p>At this time, {{denier.name}} is unable to accept your friendship request. Rest of email content...</p>', 'buddypress' ), // HTML email content.\n 'post_excerpt' => __( '<p>At this time, {{denier.name}} is unable to accept your friendship request. Rest of email content...</p>', 'buddypress' ), // Plain text email content.\n 'post_status' => 'publish',\n 'post_type' => bp_get_email_post_type() // this is the post type for emails\n );\n \n // Insert the email post into the database\n $post_id = wp_insert_post( $my_post );\n \n if ( $post_id ) {\n // add our email to the taxonomy term 'match_denied'\n // Email is a custom post type, therefore use wp_set_object_terms\n \n $tt_ids = wp_set_object_terms( $post_id, 'friendship_denied', bp_get_email_tax_type() );\n foreach ( $tt_ids as $tt_id ) {\n $term = get_term_by( 'term_taxonomy_id', (int) $tt_id, bp_get_email_tax_type() );\n wp_update_term( (int) $term->term_id, bp_get_email_tax_type(), array(\n 'description' => 'Recipients Friendship Denied',\n ) );\n }\n }\n \n}",
"public function toggleIt($caller)\n {\n if ($this->exists) {\n $this->delete();\n $caller->setUnvotedMessage();\n\n } else {\n $this->save();\n }\n\n }",
"function unTrashThread() {\n\t\t$this->getTrashThread();\n\t\t$oldThreadId = $this->getThreadId();\n\t\t//take off the topic starter, which is included in the list of replies\n\t\t$oldTopic = array_shift($this->replies);\n\t\t$newThreadId = $oldTopic->unTrash();\n\t\tforeach ($this->replies as $x=>$v) {\n\t\t\t$v->unTrash();\n\t\t}\n\t\t//the post itself is included in the replies array\n\t\t//get thread is the entire thread\n\n\t\t//update all the old posts to the new thread id\n\t\t//fix reply_id where it is not null\n\t\t//then match the thread_id to the new pkey\n\t\t$db = DB::getHandle();\n\t\t$db->query(\n\t\t\tClassForum_Queries::getQuery('updateReplyId',\n\t\t\t\tarray($newThreadId,$oldThreadId)\n\t\t\t));\n\t\t$db->query(\n\t\t\tClassForum_Queries::getQuery('updateThreadId',\n\t\t\t\tarray($newThreadId,$oldThreadId)\n\t\t\t));\n\t}",
"public function testLikesDoesNotSendEmailNotification() {\n\t\t$this->markTestIncomplete(\"Requires manual testing for now\");\n\t}",
"function iwBookingDeactive() {\n $timestamp = wp_next_scheduled('clear_invalid_booking_order_cronjob');\n // unschedule previous event if any\n wp_unschedule_event($timestamp, 'clear_invalid_booking_order_cronjob');\n }",
"public function doNothing(): void\n {\n $this->setActivityStatus(self::STATUS_DO_NOTHING);\n }",
"private function makePrivateThread(): Thread\n {\n try {\n $this->database->transaction(function () {\n $thread = Thread::create(Thread::DefaultSettings);\n\n $thread->participants()->create(array_merge(Participant::DefaultPermissions, [\n 'owner_id' => $this->messenger->getProvider()->getKey(),\n 'owner_type' => $this->messenger->getProvider()->getMorphClass(),\n ]));\n\n $thread->participants()->create(array_merge(Participant::DefaultPermissions, [\n 'owner_id' => $this->to->getKey(),\n 'owner_type' => $this->to->getMorphClass(),\n ]));\n\n $this->to = $thread;\n });\n } catch (Throwable $e) {\n throw new MessengerComposerException('Storing new private failed with the message: '.$e->getMessage());\n }\n\n return $this->to;\n }",
"public function notifyReset()\r\n {\r\n // remove all old notifications\r\n $this->deleteOldNotifications();\r\n\r\n if ($this->hasTaskAssigned())\r\n NotifyStatusReset::instance()->from(Yii::$app->user->getIdentity())->about($this)->sendBulk(self::filterResponsibleAssigned());\r\n\r\n if ($this->hasTaskResponsible())\r\n NotifyStatusReset::instance()->from(Yii::$app->user->getIdentity())->about($this)->sendBulk($this->taskResponsibleUsers);\r\n\r\n // Create Activity\r\n $activity = new TaskReset();\r\n $activity->source = $this;\r\n $activity->originator = Yii::$app->user->getIdentity();\r\n $activity->create();\r\n }",
"public function aThreadRequiresABody()\n {\n $this->publishThread(['body' => null])\n ->assertSessionHasErrors('body');\n }",
"public function byInvitationOnly()\n {\n $this->byInvitationOnly = true;\n }",
"public function preRemove()\n {\n if ($this->origin !== null) {\n $this->origin->setActive(false);\n $this->origin->setMailbox(null);\n }\n }",
"public static function resetToOutOfTheBoxState()\n {\n self::$_instance = null;\n }",
"public function delete()\r\r\n {\r\r\n parent::delete();\r\r\n $this->queueInstance->deleteReserved($this->queue, $this->job);\r\r\n }"
] | [
"0.5382884",
"0.51760894",
"0.5145047",
"0.5102515",
"0.49978858",
"0.48992032",
"0.48512197",
"0.4823221",
"0.47573474",
"0.47472027",
"0.4719354",
"0.47011453",
"0.46726018",
"0.46524262",
"0.46431157",
"0.46392757",
"0.46373752",
"0.4607129",
"0.45919186",
"0.4558921",
"0.4539083",
"0.4534319",
"0.45036724",
"0.4486048",
"0.44801205",
"0.44741255",
"0.44734213",
"0.4464565",
"0.44639",
"0.44415352"
] | 0.7227681 | 0 |
Remove ID of the thread tied to invitation from the database. | public function forgetThread($args)
{
$thread = $args['invitation'];
Database::getInstance()->query(
'DELETE FROM {mibew_autoinvite} WHERE threadid = :threadid',
array(':threadid' => $thread->id)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function removeParticipant()\n {\n global $wpdb;\n\n if (! current_user_can('manage_options')) {\n print json_encode([\n 'error' => 'You are not the coordinator of this challenge (access denied)'\n ]);\n wp_die();\n }\n \n if (! check_ajax_referer('pt-delete-participant', 'security', false)) {\n print json_encode([\n 'error' => 'We were unable to verify the nonce'\n ]);\n wp_die();\n }\n\n $chal_id = filter_input(INPUT_POST, 'chal-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE);\n $user_id = filter_input(INPUT_POST, 'user-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE);\n $email = $wpdb->get_var($wpdb->prepare(\n \"SELECT email FROM {$wpdb->prefix}pt_participants \n WHERE user_id = %d AND challenge_id = %d\",\n $user_id,\n $chal_id\n ));\n\n $query = $wpdb->prepare(\"DELETE al.*\nFROM {$wpdb->prefix}pt_log al\nJOIN {$wpdb->prefix}pt_participants cp ON cp.user_id = al.user_id\nWHERE\n cp.challenge_id = %d AND\n cp.user_id = %d\", $chal_id, $user_id);\n $wpdb->query($query);\n\n $res = $wpdb->delete(\"{$wpdb->prefix}pt_participants\", [\n 'challenge_id' => $chal_id,\n 'user_id' => $user_id\n ]);\n\n if ($res) {\n if ($email) {\n wp_mail($email, 'Removed from Team Challenge', PT_USER_DENIED);\n }\n\n print json_encode([\n 'success' => 'User was removed from the challenge'\n ]);\n } else {\n print json_encode([\n 'error' => $wpdb->last_error\n ]);\n }\n\n wp_die();\n }",
"function unTrashThread() {\n\t\t$this->getTrashThread();\n\t\t$oldThreadId = $this->getThreadId();\n\t\t//take off the topic starter, which is included in the list of replies\n\t\t$oldTopic = array_shift($this->replies);\n\t\t$newThreadId = $oldTopic->unTrash();\n\t\tforeach ($this->replies as $x=>$v) {\n\t\t\t$v->unTrash();\n\t\t}\n\t\t//the post itself is included in the replies array\n\t\t//get thread is the entire thread\n\n\t\t//update all the old posts to the new thread id\n\t\t//fix reply_id where it is not null\n\t\t//then match the thread_id to the new pkey\n\t\t$db = DB::getHandle();\n\t\t$db->query(\n\t\t\tClassForum_Queries::getQuery('updateReplyId',\n\t\t\t\tarray($newThreadId,$oldThreadId)\n\t\t\t));\n\t\t$db->query(\n\t\t\tClassForum_Queries::getQuery('updateThreadId',\n\t\t\t\tarray($newThreadId,$oldThreadId)\n\t\t\t));\n\t}",
"function trashThread() {\n\t\t$this->getThread();\n\t\tforeach ($this->replies as $x=>$v) {\n\t\t\t$v->trash();\n\t\t}\n\t\t//the post itself is included in the replies array\n\t\t//get thread is the entire thread\n\t}",
"public function unfriend($recipient_id = NULL) {\n\t\t# Delete this relationship. This requires first deleting rows from other tables\n\t\t# where there is a foreign key constraint.\n\t\t\n\t\t$q = \"SELECT user_recipient_id FROM users_recipients\n\t\tWHERE user_id = \".$this->user->user_id.\" AND\n\t\trecipient_id = \".$recipient_id;\n\t\t\n\t\t$user_recipient = DB::instance(DB_NAME)->select_field($q);\n\t\t\n\t\t$q2 = \"SELECT recipient_occasion_id FROM recipients_occasions\n\t\tWHERE user_recipient_id = \".$user_recipient;\n\t\t\n\t\t$recipient_occasion = DB::instance(DB_NAME)->select_field($q);\n\t\t\n\t\t# Delete related rows from gifts table.\n\t\t$where_condition = 'WHERE recipient_occasion_id = '.$recipient_occasion;\n\t\tDB::instance(DB_NAME)->delete('gifts', $where_condition);\n\t\t\n\t\t# Delete related rows from recipients_occasions table\n\t\t$where_condition = 'WHERE user_recipient_id = '.$user_recipient;\n\t\tDB::instance(DB_NAME)->delete('recipients_occasions', $where_condition);\n\t\t\n\t\t# Delete user-giftee relationship\n\t\tDB::instance(DB_NAME)->delete('users_recipients', $where_condition);\n\t\n\t\tRouter::redirect(\"/gifts/find_friends\");\n\t\t\n\t}",
"function wp_email_capture_deleteid( $id, $table = WP_EMAIL_CAPTURE_REGISTERED_MEMBERS_TABLE ) {\n\tglobal $wpdb;\n\n\t$delete_member_sql = \"DELETE FROM $table WHERE id = '%d'\";\n\n\t$delete_member = $wpdb->query( $wpdb->prepare( $delete_member_sql, $id ) );\n\n\t/**\n\t * Action to add on extra things on deleted ID.\n\t */\n\tdo_action( 'wp_email_capture_after_delete_email_address', $id );\n\n}",
"public function removeTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken();\n\n\t\t$ids = Request::getArray('id', array());\n\t\t$ids = (!is_array($ids) ? array($ids) : $ids);\n\n\t\t// Make sure we have an ID\n\t\tif (empty($ids))\n\t\t{\n\t\t\tNotify::warning(Lang::txt('COM_GROUPS_ERROR_NO_ITEMS_SELECTED'));\n\t\t\treturn $this->cancelTask();\n\t\t}\n\n\t\t$i = 0;\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t// Remove the entry\n\t\t\t$model = Role::oneOrFail(intval($id));\n\n\t\t\tif (!$model->destroy())\n\t\t\t{\n\t\t\t\tNotify::error($model->getError());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\n\n\t\tif ($i)\n\t\t{\n\t\t\tNotify::success(Lang::txt('COM_GROUPS_ROLE_REMOVED'));\n\t\t}\n\n\t\t$this->cancelTask();\n\t}",
"public function unassignTask()\n\t{\n\t\tRequest::setVar('hidemainmenu', 1);\n\n\t\t$ids = Request::getArray('id', array());\n\t\t$ids = (!is_array($ids) ? array($ids) : $ids);\n\t\t$gid = Request::getString('gid', '');\n\t\t$roleid = Request::getInt('roleid', 0);\n\n\t\tif (!$gid)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option, false),\n\t\t\t\tLang::txt('COM_GROUPS_MISSING_ID'),\n\t\t\t\t'error'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$model = \\Components\\Groups\\Models\\Member\\Role::oneByUserAndRole((int)$id, $roleid);\n\n\t\t\tif ($model->get('id'))\n\t\t\t{\n\t\t\t\t$model->destroy();\n\t\t\t}\n\t\t}\n\n\t\tif ($rtrn = Request::getString('return'))\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $rtrn . '&gid=' . $gid, false)\n\t\t\t);\n\t\t}\n\n\t\t// Output the HTML\n\t\t$this->cancelTask();\n\t}",
"public function decline($id){\n\t\treturn $this->friends->remove(array('_id' => $id));\n\t}",
"function removeContactRequest(int $id) {\n return delete('contact_requests', ['ContactRequestID' => $id]);\n}",
"public function delete(){\n\n $data = $this->show();\n $files = 'images/blog/'.$data->image;\n if (file_exists($files))\n unlink($files);\n\n $sql = \"DELETE FROM `thread_table` WHERE `thread_table`.`id` = $this->id \";\n $query = $this->DBH->prepare($sql);\n $result = $query->execute();\n\n if ($result){\n $objComment = new Comment();\n $comments = $objComment->index($this->id, 'obj');\n foreach ($comments as $key => $comment ){\n $objComment->id = $comment->thread_id;\n $objComment->delete();\n }\n Message::message(\"Thread Deleted Successfully !\");\n }else{\n Message::message(\"Thread Delete Fail !\");\n }\n Utility::redirect(\"index.php\");\n }",
"public function cancelTeamInvitation($invitationId)\n {\n if (! empty($invitationId)) {\n $model = Jetstream::teamInvitationModel();\n\n $model::whereKey($invitationId)->delete();\n }\n\n $this->team = $this->team->fresh();\n }",
"function remove_from_schedule($id) {\n $id = mysqli_real_escape_string($this->connection, $id); \n return $this->query(\"UPDATE class SET room_id=0 WHERE class.id='$id'\");\n }",
"public function destroy($id)\n\t{\n\t\t$requester = Requester::findOrFail($id);\n\t\t$requester->delete();\n\t\treturn $id;\n\t}",
"public function remove($iTeamMemberId)\n {\n $this->database()->delete($this->_sTable, 'managersteam_id = ' . (int) $iTeamMemberId);\n }",
"function project_manage_persons_participant_remove_callback($path, $id){\n $project = prepare_project_manage_page($path);\n \n //check if there is user id\n $check = 'SELECT user FROM {research_projects_participants_cards} WHERE id=%d AND project=%d';\n $uid = db_result(db_query($check, $id, $project->id));\n if($uid){\n //remove person from person list\n $remove = \"DELETE FROM {research_projects_persons_list} WHERE user=%d AND project=%d AND role='participant' \";\n db_query($remove, $uid, $project->id);\n }\n \n $remove = \"DELETE FROM {research_projects_participants_cards} WHERE id=%d AND project=%d\";\n db_query($remove, $id, $project->id);\n drupal_goto(\"project/$path/manage/persons\");\n \n}",
"function livewebteaching_delete_instance($id) {\n global $CFG;\n\n if (! $livewebteaching = get_record('livewebteaching', 'id', $id)) {\n return false;\n }\n\n $result = true;\n\n //\n\t// End the session associated with this instance (if it's running)\n\t//\n\t$meetingID = $livewebteaching->meetingid;\n\t$modPW = $livewebteaching->moderatorpass;\n\t$url = trim(trim($CFG->lwt_server),'/').'/';\n\t$salt = trim($CFG->lwt_apikey);\n\n\t$getArray = BigBlueButton::endMeeting( $meetingID, $modPW, $url, $salt, $CFG->lwt_username );\n\t\n if (! delete_records('livewebteaching', 'id', $livewebteaching->id)) {\n \t//echo $endURL = '<a href='.BBBMeeting::endMeeting( $mToken, \"mp\", getBBBServerIP(), $salt ).'>'.\"End Meeting\".'</a>';\n#switch to remove the meetingname\n# \t BBBMeeting::endMeeting( $livewebteaching->, \"mp\", getBBBServerIP(), $livewebteaching->salt );\n $result = false;\n }\n\n return $result;\n}",
"public function putRemove($id){\n $invite = Invite::find($id); \n $invite->show_to_sender = 0;\n $invite->save();\n\n Session::flash('success', 'Invite has been deleted!');\n return redirect()->route('invite.sent'); \n }",
"function removeTeamMember($a_team_id, $a_user_id, $a_exc_ref_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$sql = \"DELETE FROM il_exc_team\".\n\t\t\t\" WHERE ass_id = \".$ilDB->quote($this->getId(), \"integer\").\n\t\t\t\" AND id = \".$ilDB->quote($a_team_id, \"integer\").\n\t\t\t\" AND user_id = \".$ilDB->quote($a_user_id, \"integer\");\t\t\t\n\t\t$ilDB->manipulate($sql);\t\t\n\t\n\t\t$this->sendNotification($a_exc_ref_id, $a_user_id, \"rmv\");\n\t\t\n\t\tself::writeTeamLog($a_team_id, self::TEAM_LOG_REMOVE_MEMBER, \n\t\t\tilObjUser::_lookupFullname($a_user_id));\n\t}",
"public function remove($id) {\n\t\tif (!$this->Behaviors->attached('Aacl')) {\n\t\t\t// Get the list of all behaviors the model has attached\n\t\t\t$this->Behaviors->attach('Aacl');\n\t\t}\n\n\t\t$this->id = $id;\n\t\t$this->deleteAll(array('WallPost.reply_parent_id' => $id));\n\t\t$this->delete($id);\n\t}",
"public function remove($id);",
"public function remove($id);",
"public function remove($id);",
"public function remove($id);",
"public function remove($id);",
"public function remove($id);",
"public function remove($id);",
"public function remove($id);",
"function supprimerConversation($idConv)\n{\n\t// Utiliser pour cela des mises à jour en cascade en appliquant l'intégrité référentielle\n\t$SQL = \"DELETE FROM conversations WHERE id=\".$idConv;\n\treturn SQLDelete($SQL);\n}",
"public function actionRemove()\n {\n $requestBody = Yii::$app->request->get();\n $id = $requestBody['id'];\n $user = $requestBody['user'];\n $secret = $requestBody['secret'];\n\n if (empty($id) || empty($user) || empty($secret)) {\n return $this->throwError('missing parameter');\n }\n\n if ($secret != $this->verifySecret($id, $user)) {\n return $this->throwError('access denied');\n }\n\n $settings = $this->getSettings();\n $url = 'https://api.twitter.com/1.1/lists/members/destroy.json';\n $requestMethod = 'POST';\n $postfields = array(\n 'screen_name' => $user\n );\n $twitter = new \\TwitterAPIExchange($settings);\n if ($twitter) {\n $twitter->buildOauth($url, $requestMethod)\n ->setPostfields($postfields)\n ->performRequest();\n } else {\n return $this->throwError('internal error');\n }\n\n }",
"public function messagedestroy($id)\n {\n //\n $data = User::find($id);\n $data->delete();\n }"
] | [
"0.5931748",
"0.5809702",
"0.57368755",
"0.5712369",
"0.568316",
"0.56827384",
"0.56240255",
"0.5588804",
"0.55708003",
"0.5551553",
"0.5549955",
"0.5480712",
"0.5468893",
"0.5462303",
"0.5446212",
"0.5426798",
"0.5423008",
"0.5408158",
"0.54050094",
"0.539798",
"0.539798",
"0.539798",
"0.539798",
"0.539798",
"0.539798",
"0.539798",
"0.539798",
"0.53925234",
"0.5391691",
"0.53779167"
] | 0.65965134 | 0 |
/ MISCELLANEOUS 1. Get a fresh Dialogflow access token 2. Convert the Dialogflow merge fields to the final values 3. Activate a context in the active conversation 4. Return the details of a Dialogflow agent 5. Chinese language sanatization 6. Unknow email notification for agents | function sb_dialogflow_get_token() {
$token = sb_get_setting('dialogflow-token');
if (empty($token)) {
return new SBError('dialogflow-refresh-token-not-found', 'sb_dialogflow_get_token');
}
$response = sb_download('https://board.support/synch/dialogflow.php?refresh-roken=' . $token);
if ($response != 'api-dialogflow-error' && $response != false) {
$token = json_decode($response, true);
if (isset($token['access_token'])) {
return $token['access_token'];
}
}
return new SBError('dialogflow-refresh-token-error', 'sb_dialogflow_get_token', $response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sb_dialogflow_create_intent($training_phrases, $bot_response, $language = '', $conversation_id = false) {\n $training_phrases_api = [];\n for ($i = 0; $i < count($training_phrases); $i++) {\n array_push($training_phrases_api, [ 'type' => 'TYPE_UNSPECIFIED', 'parts' => [ 'text' => $training_phrases[$i]], 'repeatCount' => 1]);\n }\n $response = sb_dialogflow_curl('/agent/intents', ['displayName' => sb_string_slug(strlen($training_phrases[0]) > 100 ? substr($training_phrases[0], 0, 99) : $training_phrases[0]), 'priority' => 500000, 'webhookState' => 'WEBHOOK_STATE_UNSPECIFIED', 'trainingPhrases' => $training_phrases_api, 'messages' => [['text' => ['text' => $bot_response]]]], $language);\n if (sb_get_setting('dialogflow-edition') == 'cx') {\n $flow_name = '00000000-0000-0000-0000-000000000000';\n if ($conversation_id) {\n $messages = sb_db_get('SELECT payload FROM sb_messages WHERE conversation_id = ' . sb_db_escape($conversation_id) . ' AND payload <> \"\" ORDER BY id DESC');\n for ($i = 0; $i < count($messages); $i++) {\n \t$payload = json_decode($messages['payload'], true);\n if (isset($payload['queryResult']) && isset($payload['queryResult']['currentPage'])) {\n $flow_name = $payload['queryResult']['currentPage'];\n $flow_name = substr($flow_name, strpos($flow_name, '/flows/') + 7);\n if (strpos($flow_name, '/')) $flow_name = substr($flow_name, 0, strpos($flow_name, '/'));\n break;\n }\n }\n }\n $flow = sb_dialogflow_curl('/flows/' . $flow_name, '', $language, 'GET');\n array_push($flow['transitionRoutes'], ['intent' => $response['name'], 'triggerFulfillment' => ['messages' => [['text' => ['text' => [$bot_response]]]]]]);\n $response = sb_dialogflow_curl('/flows/' . $flow_name . '?updateMask=transitionRoutes', $flow, $language, 'PATCH');\n }\n if (isset($response['displayName'])) {\n return true;\n }\n return $response;\n}",
"function sb_dialogflow_curl($url_part, $query = '', $language = false, $type = 'POST', $token = false) {\n\n // Project ID\n $project_id = trim(sb_get_setting('dialogflow-project-id'));\n if (empty($project_id)) {\n return new SBError('project-id-not-found', 'sb_dialogflow_curl');\n }\n\n // Retrive token\n $token = empty($token) || $token == -1 ? sb_dialogflow_get_token() : $token;\n if (sb_is_error($token)) {\n return new SBError('token-error', 'sb_dialogflow_curl');\n }\n\n // Language\n if (!empty($language)) {\n $language = (strpos($url_part, '?') ? '&' : '?') . 'languageCode=' . $language;\n }\n\n // Query\n if (!is_string($query)) {\n $query = json_encode($query);\n }\n\n // Edition and version\n $edition = sb_get_setting('dialogflow-edition', 'es');\n $version = 'v2beta1/projects/';\n if ($edition == 'cx') {\n $version = 'v3beta1/';\n $url_part = str_replace('/agent/', '/', $url_part);\n }\n\n // Send\n $url = 'https://' . sb_get_setting('dialogflow-location', '') . 'dialogflow.googleapis.com/' . $version . $project_id . $url_part . $language;\n $response = sb_curl($url, $query, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $token, 'Content-Length: ' . strlen($query) ], $type);\n return $type == 'GET' ? json_decode($response, true) : $response;\n}",
"public function process_oauth() {\n $config = $this->config('sumup.registered_app_settings');\n $encryption_service = $this->encryption_service;\n $sumup = $this->sumup_auth_service;\n // set field before processing authentication request.\n $access_flow = $config->get('sumup_client_credentials_flow');\n\n if(!$access_flow) {\n $payload = $sumup->requestScopeAccess(); \n } else {\n $payload = $sumup->clientCredentialsFlow();\n }\n\n $messenger = \\Drupal::messenger();\n $messenger->addMessage($payload);\n \n return;\n }",
"public function prepare_send_context()\n\t{\n\t\tglobal $context;\n\n\t\t// Verification control needed for this PM?\n\t\t$context['require_verification'] = true;\n\n\t\t$verificationOptions = array(\n\t\t\t'id' => 'pm',\n\t\t);\n\t\t$context['require_verification'] = VerificationControlsIntegrate::create($verificationOptions);\n\t\t$context['visual_verification_id'] = $verificationOptions['id'];\n\t}",
"function get_accessToken() {\n $clientID = \"\";\n //Client Secret key of the application.\n $clientSecret = \"\";\n //OAuth Url.\n //$authUrl = \"https://datamarket.accesscontrol.windows.net/v2/OAuth2-13/\";\n $authUrl = \"https://login.microsoftonline.com/common/oauth2/v2.0/token\";\n //Application Scope Url\n //$scopeUrl = \"https://graph.microsoft.com/.default\";\n $scopeUrl = \"https://api.botframework.com/.default\"; // 2017-11-22 change\n //Application grant type\n $grantType = \"client_credentials\";\n //Create the AccessTokenAuthentication object.\n $authObj = new AccessTokenAuthentication();\n //Get the Access token.\n $accessToken = $authObj->getTokens($grantType, $scopeUrl, $clientID, $clientSecret, $authUrl);\n return $accessToken;\n}",
"function agent_callback( $atts = [], $content = null, $tag = '' ) {\n //$PikePayload = new PikePayload();\n $KeyValueEntry = new KeyValueEntry();\n $KeyValueEntry->setKey('email');\n $KeyValueEntry->setValue('[email protected]');\n\n $CreateAgentAction = new CreateAgentAction();\n $CreateAgentAction->setOrgId('001');\n $CreateAgentAction->setPublicKey('DFcP5QFjbYtfgzWoqGedhxecCrRe41G3RD');\n $CreateAgentAction->setActive(true);\n $CreateAgentAction->setRoles(['003','004']);\n $CreateAgentAction->setMetadata([$KeyValueEntry]);\n $send_data = $CreateAgentAction->serializeToString();\n\n $AgentList = new AgentList();\n $Agent = new Agent();\n try {\n $Agent->mergeFromString($send_data);\n $agents = $AgentList->getAgents();\n $agents[] = $Agent;\n $AgentList->setAgents($agents);\n $send_data = $AgentList->serializeToString();\n } catch (Exception $e) {\n // Handle parsing error from invalid data.\n // ...\n }\n $agents = $AgentList->getAgents();\n \n $send_address = 'DFcP5QFjbYtfgzWoqGedhxecCrRe41G3RD';\n $private_key = 'L44NzghbN6UD737kG6ukfdCq6BXyyTY2W15UkNhHnBff6acYWtsZ';\n $send_amount = 0.001;\n/*\n\t$result = OP_RETURN_send($send_address, $send_amount, $send_data);\n\t\n\tif (isset($result['error']))\n\t\t$result_output = 'Error: '.$result['error'].\"\\n\";\n\telse\n $result_output = 'TxID: '.$result['txid'].\"\\nWait a few seconds then check on: http://coinsecrets.org/\\n\";\n*/\n/*\n $data = $from->serializeToString();\n try {\n $to->mergeFromString($data);\n } catch (Exception $e) {\n // Handle parsing error from invalid data.\n // ...\n }\n*/ \n $output = '<figure class=\"wp-block-table\"><table><tbody>';\n foreach ($atts as $key => $value)\n $output .= '<tr><td>'.$key.'</td><td><input type=\"text\" value=\"'.$value.'\"></td></tr>';\n/*\n foreach ($atts as $index => $att) {\n $KeyValueEntries = $atts[$index]->getMetadata();\n foreach ($KeyValueEntries as $i => $KeyValueEntry)\n if ($KeyValueEntry->getKey()=='email') \n $metadata = $KeyValueEntry->getValue();\n $output .= '<tr><td>'.$metadata.'</td><td>'.$agents[$index]->getPublicKey().'</td></tr>';\n }\n $output .= '<tr><td>PublicKey</td><td><input type=\"text\"></td></tr>';\n $output .= '<tr><td>Name</td><td><input type=\"text\"></td></tr>';\n*/ \n/*\n $metadata = '';\n\n //$output .= '<tr><td> </td><td>'.$result_output.'</td></tr>';\n $output .= '<tr><td>send_data</td><td>'.$send_data.'</td></tr>';\n*/\n $output .= '</tbody></table></figure>';\n\n $output .= '<div class=\"wp-block-buttons\">';\n $output .= '<div class=\"wp-block-button\">';\n $output .= '<a class=\"wp-block-button__link\" href=\"/agents/\">Ok</a>';\n $output .= '</div>';\n $output .= '<div class=\"wp-block-button\">';\n $output .= '<a class=\"wp-block-button__link\" href=\"/agents/\">Cancel</a>';\n $output .= '</div>';\n $output .= '</div>';\n\n return $output; \n}",
"function sb_dialogflow_intent($training_phrases, $bot_response, $language = '') {\n return sb_dialogflow_create_intent($training_phrases, $bot_response, $language = '');\n}",
"public function run()\n {\n\n $messages = [\n \"invalid_UID\" => \"User ID & does not exist in the system\",\n \"incorrect_pass\" => \"Incorrect password for User ID &\",\n \"UID_locked\" => \"User ID & is locked in the system. Reset here.\",\n \"invalid_pass\" => \"Password contains not allowed pattern &\",\n \"passes_not_matching\" => \"Passwords do not match\",\n \"invalid_ref_code\" => \"Reference code & does not exist\",\n \"email_exists\" => \"E-mail is already existing in our system\",\n \"invalid_email\" => \"Invalid e-mail address\",\n \"phone_exists\" => \"Phone number already exists in our system\",\n \"invalid_phone\" => \"Invalid Phone number\",\n \"empty_fname\" => \"First Name has to be filled\",\n \"empty_lname\" => \"Last Name has to be filled\",\n \"fill_email_or_phone\" => \"Fill either e-mail or phone number\",\n \"accept_single_user_agr\" => \"First and Last name should be the one on your ID or passport. Accept Single User Agreement.\",\n \"not_activated\" => \"Not activated (use e-mail to activate)\",\n \"are_you_sure\" => \"Are you sure? Y/N\",\n \"no_&\" => \"Should not contain &\",\n \"no_first_last_name\" => \"Should not contain first or lastname\",\n \"different_banks\" => \"this only makes sense if the banks are different\",\n \"upload_to_MyID\" => \"Upload to MyID account\",\n \"eg_upload_invoice\" => \"e.g. You upload an invoice in the monitor and pay\",\n \"upload_first_to_virtual\" => \"you have to upload first to your virtual account\",\n \"currency_match\" => \"Not \\\"yet\\\" to your own accounts (currency match)\",\n \"pay_invoice\" => \"Pay an invoice with your virtual account\",\n \"pay_CID\" => \"Pay a CID (connected)\",\n \"account_not_in_personal1\" => \"If an account is not in your Personal accounts you can not pay from it\",\n \"account_not_in_personal2\" => \"If an account is not in your Personal accounts you can not pay from it\",\n \"account_not_in_personal3\" => \"If an account is not in your Personal accounts you can not pay from it\",\n \"account_not_in_personal4\" => \"If an account is not in your Personal accounts you can not pay from it\",\n \"only_through_CID1\" => \"Can only be done through CID profile access\",\n \"only_through_CID2\" => \"Can only be done through CID profile access\",\n \"only_through_CID3\" => \"Can only be done through CID profile access\",\n \"only_through_CID4\" => \"Can only be done through CID profile access\"\n ];\n\t\t\n DB::table('messages')->truncate();\n\n foreach($messages as $key => $message) {\n\n DB::table('messages')->insert(\n [\n \"lang\" => \"EN\",\n\t\t\t\t\t\"key\" => $key,\n \"msg_txt\" => $message,\n \"context\" => \"\",\n \n ]\n );\n }\n\t\t\n\n\t\t$errors = [\n\t\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Validation Language Lines\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t\t| The following language lines contain the default error messages used by\n\t\t\t| the validator class. Some of these rules have multiple versions such\n\t\t\t| as the size rules. Feel free to tweak each of these messages here.\n\t\t\t|\n\t\t\t*/\n\n\t\t\t'accepted' => 'The :attribute must be accepted.',\n\t\t\t'active_url' => 'The :attribute is not a valid URL.',\n\t\t\t'after' => 'The :attribute must be a date after :date.',\n\t\t\t'alpha' => 'The :attribute may only contain letters.',\n\t\t\t'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',\n\t\t\t'alpha_num' => 'The :attribute may only contain letters and numbers.',\n\t\t\t'array' => 'The :attribute must be an array.',\n\t\t\t'before' => 'The :attribute must be a date before :date.',\n\t\t\t'between' => [\n\t\t\t\t'numeric' => 'The :attribute must be between :min and :max.',\n\t\t\t\t'file' => 'The :attribute must be between :min and :max kilobytes.',\n\t\t\t\t'string' => 'The :attribute must be between :min and :max characters.',\n\t\t\t\t'array' => 'The :attribute must have between :min and :max items.',\n\t\t\t],\n\t\t\t'boolean' => 'The :attribute field must be true or false.',\n\t\t\t'confirmed' => 'The :attribute confirmation does not match.',\n\t\t\t'date' => 'The :attribute is not a valid date.',\n\t\t\t'date_format' => 'The :attribute does not match the format :format.',\n\t\t\t'different' => 'The :attribute and :other must be different.',\n\t\t\t'digits' => 'The :attribute must be :digits digits.',\n\t\t\t'digits_between' => 'The :attribute must be between :min and :max digits.',\n\t\t\t'dimensions' => 'The :attribute has invalid image dimensions.',\n\t\t\t'distinct' => 'The :attribute field has a duplicate value.',\n\t\t\t'email' => 'The :attribute must be a valid email address.',\n\t\t\t'exists' => 'The selected :attribute is invalid.',\n\t\t\t'file' => 'The :attribute must be a file.',\n\t\t\t'filled' => 'The :attribute field is required.',\n\t\t\t'image' => 'The :attribute must be an image.',\n\t\t\t'in' => 'The selected :attribute is invalid.',\n\t\t\t'in_array' => 'The :attribute field does not exist in :other.',\n\t\t\t'integer' => 'The :attribute must be an integer.',\n\t\t\t'ip' => 'The :attribute must be a valid IP address.',\n\t\t\t'json' => 'The :attribute must be a valid JSON string.',\n\t\t\t'max' => [\n\t\t\t\t'numeric' => 'The :attribute may not be greater than :max.',\n\t\t\t\t'file' => 'The :attribute may not be greater than :max kilobytes.',\n\t\t\t\t'string' => 'The :attribute may not be greater than :max characters.',\n\t\t\t\t'array' => 'The :attribute may not have more than :max items.',\n\t\t\t],\n\t\t\t'mimes' => 'The :attribute must be a file of type: :values.',\n\t\t\t'mimetypes' => 'The :attribute must be a file of type: :values.',\n\t\t\t'min' => [\n\t\t\t\t'numeric' => 'The :attribute must be at least :min.',\n\t\t\t\t'file' => 'The :attribute must be at least :min kilobytes.',\n\t\t\t\t'string' => 'The :attribute must be at least :min characters.',\n\t\t\t\t'array' => 'The :attribute must have at least :min items.',\n\t\t\t],\n\t\t\t'not_in' => 'The selected :attribute is invalid.',\n\t\t\t'numeric' => 'The :attribute must be a number.',\n\t\t\t'present' => 'The :attribute field must be present.',\n\t\t\t'regex' => 'The :attribute format is invalid.',\n\t\t\t'required' => 'The :attribute field is required.',\n\t\t\t'required_if' => 'The :attribute field is required when :other is :value.',\n\t\t\t'required_unless' => 'The :attribute field is required unless :other is in :values.',\n\t\t\t'required_with' => 'The :attribute field is required when :values is present.',\n\t\t\t'required_with_all' => 'The :attribute field is required when :values is present.',\n\t\t\t'required_without' => 'The :attribute field is required when :values is not present.',\n\t\t\t'required_without_all' => 'The :attribute field is required when none of :values are present.',\n\t\t\t'same' => 'The :attribute and :other must match.',\n\t\t\t'size' => [\n\t\t\t\t'numeric' => 'The :attribute must be :size.',\n\t\t\t\t'file' => 'The :attribute must be :size kilobytes.',\n\t\t\t\t'string' => 'The :attribute must be :size characters.',\n\t\t\t\t'array' => 'The :attribute must contain :size items.',\n\t\t\t],\n\t\t\t'string' => 'The :attribute must be a string.',\n\t\t\t'timezone' => 'The :attribute must be a valid zone.',\n\t\t\t'unique' => 'The :attribute has already been taken.',\n\t\t\t'uploaded' => 'The :attribute failed to upload.',\n\t\t\t'url' => 'The :attribute format is invalid.',\n\n\t\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Custom Validation Language Lines\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t\t| Here you may specify custom validation messages for attributes using the\n\t\t\t| convention \"attribute.rule\" to name the lines. This makes it quick to\n\t\t\t| specify a specific custom language line for a given attribute rule.\n\t\t\t|\n\t\t\t*/\n\n\t\t\t'custom' => [\n\t\t\t\t'attribute-name' => [\n\t\t\t\t\t'rule-name' => 'custom-message',\n\t\t\t\t],\n\t\t\t],\n\n\t\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Custom Validation Attributes\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t\t| The following language lines are used to swap attribute place-holders\n\t\t\t| with something more reader friendly such as E-Mail Address instead\n\t\t\t| of \"email\". This simply helps us make messages a little cleaner.\n\t\t\t|\n\t\t\t*/\n\n\t\t\t'attributes' => [],\n\n\t\t];\n\n\t\t// build 1D array\n\t\t$errorsM = [];\n\t\t$r = new RecursiveIteratorIterator(new RecursiveArrayIterator($errors));\n\t\tforeach ($r as $val) {\n\t\t\t$keys = [];\n\t\t\tforeach (range(0, $r->getDepth()) as $depth) {\n\t\t\t\t$keys[] = $r->getSubIterator($depth)->key();\n\t\t\t}\n\t\t\t$errorsM[ join('.', $keys) ] = $val;\n\t\t}\n\t\t\n\t\tforeach($errorsM as $key => $message) {\n\n DB::table('messages')->insert(\n [\n \"lang\" => \"EN\",\n\t\t\t\t\t\"key\" => $key,\n \"msg_txt\" => $message,\n \"context\" => \"laravel\",\n \n ]\n );\n }\n }",
"public function setupConversation()\n {\n $cm = new ConversationManager(self::CONVERSATION, Conversation::SAVED, 0);\n\n $condition1 = new Condition(\n EquivalenceOperation::$name,\n [ self::REGISTERED_USER_STATUS ],\n [ 'value' => true ],\n self::CONDITION1\n );\n\n $condition2 = new Condition(\n GreaterThanOrEqualOperation::$name,\n [ self::TIME_SINCE_LAST_COMMENT ],\n [ 'value' => 10000 ],\n self::CONDITION2\n );\n\n $cm->createScene(self::OPENING_SCENE, true)\n ->createScene(self::LATEST_NEWS_SCENE, false)\n ->createScene(self::CONTINUE_WITH_AUDIT_SCENE, false);\n\n // Add conditions to scene\n $cm->addConditionToScene(self::OPENING_SCENE, $condition1)\n ->addConditionToScene(self::OPENING_SCENE, $condition2);\n\n // Add an intent from one participant to the other\n $intent1 = new Intent(self::INTENT_USER_TO_BOT_1);\n $intent2 = new Intent(self::INTENT_BOT_TO_USER_2);\n $intent3 = new Intent(self::INTENT_USER_TO_BOT_3);\n $intent4 = new Intent(self::INTENT_BOT_TO_USER_4, true);\n $intent4->addAction(new Action('action.core.getNews'));\n $intent5 = new Intent(self::INTENT_USER_TO_BOT_5);\n $intent6 = new Intent(self::INTENT_BOT_TO_USER_6, true);\n\n $cm->userSaysToBot(self::OPENING_SCENE, $intent1, 1)\n ->botSaysToUser(self::OPENING_SCENE, $intent2, 2)\n ->userSaysToBotAcrossScenes(self::OPENING_SCENE, self::LATEST_NEWS_SCENE, $intent3, 3)\n ->botSaysToUser(self::LATEST_NEWS_SCENE, $intent4, 4)\n ->userSaysToBotAcrossScenes(self::OPENING_SCENE, self::CONTINUE_WITH_AUDIT_SCENE, $intent5, 5)\n ->botSaysToUser(self::CONTINUE_WITH_AUDIT_SCENE, $intent6, 6);\n\n try {\n $cm->setValidated();\n } catch (InvalidConversationStatusTransitionException $e) {\n $this->fail($e->getMessage());\n }\n\n return $cm;\n }",
"public function _agentAuthenticate($data) {\r\n\r\n if (!isset($data['token'])) {\r\n return ['status' => 'error', 'msg' => 'Token not found'];\r\n }\r\n if (!isset($data['agent_id'])) {\r\n return ['status' => 'error', 'msg' => 'Agent Id no found'];\r\n }\r\n if (!isset($data['username'])) {\r\n return ['status' => 'error', 'msg' => 'Username not found'];\r\n }\r\n if (!isset($data['password'])) {\r\n return ['status' => 'error', 'msg' => 'Password not found'];\r\n }\r\n if (!isset($data['surl'])) {\r\n return ['status' => 'error', 'msg' => 'Success URL not found'];\r\n }\r\n if (!isset($data['furl'])) {\r\n return ['status' => 'error', 'msg' => 'Failure URL not found.'];\r\n }\r\n if (!isset($data['rurl'])) {\r\n return ['status' => 'error', 'msg' => 'Return URL not found'];\r\n }\r\n\r\n $token = filter_var($data['token'], FILTER_SANITIZE_STRING);\r\n $agentId = filter_var($data['agent_id'], FILTER_SANITIZE_NUMBER_INT);\r\n $username = filter_var($data['username'], FILTER_SANITIZE_STRING);\r\n $password = trim($data['password']);\r\n\r\n $successUrl = filter_var($data['surl'], FILTER_SANITIZE_URL);\r\n $failureUrl = filter_var($data['furl'], FILTER_SANITIZE_URL);\r\n $returnUrl = filter_var($data['rurl'], FILTER_SANITIZE_URL);\r\n\r\n if (empty($token)) {\r\n return ['status' => 'error', 'msg' => 'Token is empty'];\r\n }\r\n if (empty($agentId)) {\r\n return ['status' => 'error', 'msg' => 'Agent is empty'];\r\n }\r\n if (empty($username)) {\r\n return ['status' => 'error', 'msg' => 'Username is empty'];\r\n }\r\n if (empty($password)) {\r\n return ['status' => 'error', 'msg' => 'Password is empty'];\r\n }\r\n if (empty($successUrl)) {\r\n return ['status' => 'error', 'msg' => 'Success URL not found'];\r\n }\r\n\r\n if (filter_var($successUrl, FILTER_VALIDATE_URL) === false) {\r\n return ['status' => 'error', 'msg' => 'Success URL is invalid.'];\r\n }\r\n if (empty($failureUrl)) {\r\n return ['status' => 'error', 'msg' => 'Failure URL not found.'];\r\n }\r\n if (filter_var($failureUrl, FILTER_VALIDATE_URL) === false) {\r\n return ['status' => 'error', 'msg' => 'Failure URL is invalid.'];\r\n }\r\n if (empty($returnUrl)) {\r\n return ['status' => 'error', 'msg' => 'Return URL not found.'];\r\n }\r\n if (filter_var($returnUrl, FILTER_VALIDATE_URL) === false) {\r\n return ['status' => 'error', 'msg' => 'Return URL is invalid.'];\r\n }\r\n\r\n $query = $this->Airlines->find()->where(['username' => $username, 'password' => md5($password)]);\r\n\r\n if ($query->count() <= 0) {\r\n return ['status' => 'error', 'msg' => 'Invalid Username or Password.'];\r\n } else {\r\n return ['status' => 'success', 'airline' => $query->first()];\r\n }\r\n }",
"function campaign_summary($context) {\n $configs = campaign_get_from_context($context);\n campaign_load_defaults($configs);\n $languages = language_list();\n $langcode = $configs['config']['langcode'];\n $language = $languages[$langcode];\n\n $canvas_page = 'http://apps.facebook.com/' . $context->name;\n $gateway = campaign_get_gateway_path($context->name, $language);\n $paths = isset($context->conditions['path']) ? htmlspecialchars(implode(', ', $context->conditions['path']['values'])) : t('No path conditions');\n $app_id = $configs['fb']['appid'];\n $redirect_url = url('fb/' . $context->name, array('absolute' => TRUE, 'language' => $language));\n\n $summary = array(\n array('Path', $paths),\n array('Language', $language->name),\n array('Active', $configs['active'] ? t('Yes') : t('No')),\n array('Application ID', $app_id),\n array('Application Secret', $configs['fb']['secret'] ? $configs['fb']['secret'] : t('Not configured')),\n array('Facebook Tab URL', $configs['fb']['tab'] ? l($configs['fb']['tab'], $configs['fb']['tab']) : t('Not configured')),\n array('Canvas Page', l($canvas_page, $canvas_page)),\n array('Redirect URL', l($redirect_url, $redirect_url)),\n );\n\n if (!empty($configs['config']['prelike'])) {\n $prelike = $configs['config']['prelike'];\n $edit = l(t('edit'), drupal_get_normal_path($prelike) . '/edit');\n $summary[] = array('Before like', l($prelike, $prelike, array('language' => $language)) . ' (' . $edit . ')');\n }\n if (!empty($configs['config']['postlike'])) {\n $postlike = $configs['config']['postlike'];\n $edit = l(t('edit'), drupal_get_normal_path($postlike) . '/edit');\n $summary[] = array('After like', l($postlike, $postlike, array('language' => $language)) . ' (' . $edit . ')');\n }\n\n $summary[] = array('App / Canvas', l($gateway, $gateway, array('language' => $language)));\n $summary[] = array('Page Tab', l($gateway, $gateway, array('language' => $language)));\n // Mobile Web uses post like page.\n if (isset($postlike)) {\n // Path needs to be suffixed with an '/' to be accepted on Facebook.\n $postlike = url($postlike, array('absolute' => TRUE, 'language' => $language)) . '/';\n $summary[] = array('Mobile Web', l($postlike, $postlike));\n }\n else {\n $summary[] = array('Mobile Web', t('Missing after like page'));\n }\n $inactive_page = $configs['config']['inactive'];\n $summary[] = array('Inactive page', $inactive_page ? l($inactive_page, $inactive_page, array('language' => $language)) : t('Not configured'));\n\n $rules = array();\n foreach (campaign_get_related_rules($context->name) as $id => $entity) {\n $rules[] = l($entity->label, RulesPluginUI::path($id));\n }\n if (!empty($rules)) {\n $summary[] = array('Related rules', implode(', ', $rules));\n }\n\n $views = array();\n foreach (campaign_get_related_views($context->name) as $view) {\n $views[] = l($view->get_human_name(), 'admin/structure/views/view/' . $view->name . '/edit');\n }\n if (!empty($views)) {\n $summary[] = array('Related views', implode(', ', $views));\n }\n\n drupal_alter('campaign_summary', $summary, $context);\n\n $active_class = $configs['active'] ? 'campaign-config-active' : 'campaign-config-inactive';\n return theme('table', array(\n 'rows' => $summary,\n 'attributes' => array('class' => array('campaign-config-summary', $active_class)),\n ));\n}",
"public abstract function createRecipientContext( $blIncludeTrackingPermissions = false );",
"public function actionVerify()\n {\n if(isset($_GET['trackingid']) && ctype_alnum($_GET['trackingid'])\n && isset($_GET['aid']) && is_numeric($_GET['aid'])\n && isset($_GET['source']) && is_numeric($_GET['source']))\n { \n $trackingid = $_GET['trackingid'];\n $AID = $_GET['aid'];\n $source = $_GET['source'];\n \n if($source == self::SOURCE_EGM)\n {\n if(isset($_GET['token']) && ctype_alnum($_GET['token']))\n {\n $token = $_GET['token'];\n \n //Check if token is valid\n if($this->validateToken($token)) //true\n {\n $model = new VoucherAPI();\n $result = $model->verifyTrackingID($AID,$trackingid,$source);\n\n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>$result)));\n }\n else\n {\n //Log to audit trail\n $details = 'Invalid token '.$token;\n AuditLog::logAPITransactions(1, $source, $details, $token, $trackingid, 2);\n\n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>array(\"VoucherCode\"=>\"\",\n \"VoucherTypeID\"=>\"\",\n \"Amount\"=>floatval(0),\n \"DateCreated\"=>\"\",\n \"TransMsg\"=>\"Invalid Token\",\n \"ErrorCode\"=>intval(10)\n )\n )\n ));\n }\n }\n else\n {\n \n \n //Log to audit trail\n $details = 'Token required';\n AuditLog::logAPITransactions(1, $source, $details, $AID, $trackingid, 2);\n \n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>array(\"VoucherCode\"=>\"\",\n \"VoucherTypeID\"=>\"\",\n \"Amount\"=>floatval(0),\n \"DateCreated\"=>\"\",\n \"TransMsg\"=>\"Token required\",\n \"ErrorCode\"=>intval(11)\n )\n )\n ));\n }\n \n }\n else\n {\n $model = new VoucherAPI();\n $result = $model->verifyTrackingID($AID,$trackingid,$source);\n\n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>$result)));\n }\n \n \n }\n /**\n * This is another verify method called during the DEPOSIT or RELOAD process.\n * API will check the Ticket/Voucher/Coupon status if still valid.\n */\n elseif(isset($_GET['vouchercode']) && is_numeric($_GET['vouchercode'])\n && isset($_GET['aid']) && is_numeric($_GET['aid'])\n && isset($_GET['source']) && is_numeric($_GET['source']))\n //&& isset($_GET['trackingid']) && ctype_alnum($_GET['trackingid']))\n {\n $vouchercode = $_GET['vouchercode'];\n $AID = $_GET['aid'];\n $source = $_GET['source'];\n \n $model = new VoucherAPI();\n \n $info = $model->getVoucherInfo($vouchercode);\n $trackingid = $info['TrackingID'];\n \n if($source == self::SOURCE_EGM)\n {\n if(isset($_GET['token']) && ctype_alnum($_GET['token']))\n {\n $token = $_GET['token'];\n \n //Check if token is valid\n if($this->validateToken($token)) //true\n {\n //Log to audit trail\n $model = new VoucherAPI();\n $result = $model->verifyVoucher($AID,$vouchercode,$source,$trackingid);\n\n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>$result)));\n }\n else\n {\n //Log to audit trail\n $details = 'Invalid token '.$token;\n AuditLog::logAPITransactions(1, $source, $details, $token, $trackingid, 2);\n\n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>array(\"VoucherCode\"=>\"\",\n \"VoucherTypeID\"=>\"\",\n \"Amount\"=>floatval(0),\n \"DateCreated\"=>\"\",\n \"LoyaltyCreditable\"=>\"\",\n \"TransMsg\"=>\"Invalid Token\",\n \"ErrorCode\"=>intval(10)\n )\n )\n ));\n }\n \n }\n else\n {\n //Log to audit trail\n $details = 'Token required ';\n AuditLog::logAPITransactions(1, $source, $details, $AID, $trackingid, 2);\n\n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>array(\"VoucherCode\"=>\"\",\n \"VoucherTypeID\"=>\"\",\n \"Amount\"=>floatval(0),\n \"DateCreated\"=>\"\",\n \"LoyaltyCreditable\"=>\"\",\n \"TransMsg\"=>\"Token required\",\n \"ErrorCode\"=>intval(11)\n )\n )\n )); \n }\n \n }\n else\n {\n //Log to audit trail\n $details = 'Verifying voucher '.$vouchercode;\n AuditLog::logAPITransactions(1, $source, $details, $vouchercode, $trackingid, 1);\n \n $model = new VoucherAPI();\n $result = $model->verifyVoucher($AID,$vouchercode,$source,$trackingid);\n\n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>$result)));\n }\n \n \n }\n else\n {\n //Log to audit trail\n $token = isset($_GET['token']) ? $_GET['token'] : NULL;\n $trackingid = isset($_GET['trackingid']) ? $_GET['trackingid'] : NULL;\n \n $source = isset($_GET['source']) ? $_GET['source'] : NULL;\n \n $details = 'Parameter error';\n \n AuditLog::logAPITransactions(1, $source, $details, $token, $trackingid, 2);\n \n $this->_sendResponse(200, CJSON::encode(array(\"VerifyVoucher\"=>array(\"VoucherCode\"=>\"\",\n \"VoucherTypeID\"=>\"\",\n \"Amount\"=>floatval(0),\n \"DateCreated\"=>\"\",\n \"TransMsg\"=>\"Voucher is invalid\",\n \"ErrorCode\"=>intval(12)\n )\n )\n ));\n }\n \n \n }",
"public function submit($formValues): void {\n $this->saveMessageTemplate($formValues);\n $from = $formValues['from_email_address'];\n // dev/core#357 User Emails are keyed by their id so that the Signature is able to be added\n // If we have had a contact email used here the value returned from the line above will be the\n // numerical key where as $from for use in the sendEmail in Activity needs to be of format of \"To Name\" <toemailaddress>\n $from = CRM_Utils_Mail::formatFromAddress($from);\n\n $cc = $this->getCc();\n $additionalDetails = empty($cc) ? '' : \"\\ncc : \" . $this->getEmailUrlString($this->getCcArray());\n\n $bcc = $this->getBcc();\n $additionalDetails .= empty($bcc) ? '' : \"\\nbcc : \" . $this->getEmailUrlString($this->getBccArray());\n\n // send the mail\n [$sent, $activityIds] = $this->sendEmail(\n $this->getSubmittedValue('text_message'),\n $this->getSubmittedValue('html_message'),\n $from,\n $this->getAttachments($formValues),\n $cc,\n $bcc,\n $additionalDetails,\n CRM_Utils_Array::value('campaign_id', $formValues),\n $this->getCaseID()\n );\n //NYSS 7362 store activityId so it's available to postProcess hook\n $this->_activityId = $activityIds;\n\n if ($sent) {\n // Only use the first activity id if there's multiple.\n // If there's multiple recipients the idea behind multiple activities\n // is to record the token value replacements separately, but that\n // has no meaning for followup activities, and this doesn't prevent\n // creating more manually if desired.\n $followupStatus = $this->createFollowUpActivities($formValues, $activityIds[0]);\n\n CRM_Core_Session::setStatus(ts('One message was sent successfully. ', [\n 'plural' => '%count messages were sent successfully. ',\n 'count' => $sent,\n ]) . $followupStatus, ts('Message Sent', ['plural' => 'Messages Sent', 'count' => $sent]), 'success');\n }\n\n if (!empty($this->suppressedEmails)) {\n $status = '(' . ts('because no email address on file or communication preferences specify DO NOT EMAIL or Contact is deceased or Primary email address is On Hold') . ')<ul><li>' . implode('</li><li>', $this->suppressedEmails) . '</li></ul>';\n CRM_Core_Session::setStatus($status, ts('One Message Not Sent', [\n 'count' => count($this->suppressedEmails),\n 'plural' => '%count Messages Not Sent',\n ]), 'info');\n }\n }",
"private function processAnswer() {\n\n $text_back = '';\n\n $parameters = array();\n\n //Set scope\n $parameters['scope'] = array('statusOne');\n\n //Order by\n $parameters['orderBy'][] = array('updated_at' => 'asc');\n\n //Select session\n $session_model = $this->callController(\\Util::buildNamespace('surveys', 'session', 1), 'getModelByField', array('channel_chat_id', $this->input['message']['chat']['id'], $parameters));\n\n if ($session_model) {\n\n $session_model->updated_at = Carbon::now();\n\n $session_model->save();\n } else {\n $names = $this->input['message']['from']['first_name'];\n\n if (array_key_exists('last_name', $this->input['message']['from'])) {\n $names .= $this->input['message']['from']['last_name'];\n }//E# if statement\n\n $session_array = array(\n 'organization_id' => 1,\n 'channel_chat_id' => $this->input['message']['chat']['id'],\n 'full_name' => $names,\n 'status'=>1,\n 'created_by'=>1,\n 'updated_by'=>1,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n );\n\n //Create session\n $session_model = $this->callController(\\Util::buildNamespace('surveys', 'session', 1), 'createIfValid', array($session_array, true));\n }//E# if else statement\n //Get text\n $text = $this->input['message']['text'];\n\n $message_array = array(\n 'type' => 'in',\n 'organization_id' => 1,\n 'session_id' => $session_model->id,\n 'text' => $text,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n 'status' => 1,\n 'created_by' => 1,\n 'updated_by' => 1,\n );\n\n //Create message\n $message_model = $this->callController(\\Util::buildNamespace('surveys', 'message', 1), 'createIfValid', array($message_array, true));\n\n $query_array = array(\n 'query' => $text,\n 'confidence' => 1,\n 'sessionId' => $session_model->id,\n );\n //Call apiai\n $apiai_response = $this->callController(\\Util::buildNamespace('surveys', 'apiai', 1), 'query', array($query_array));\n\n if ($apiai_response['status']) {\n // dd($apiai_response['message']['result']['parameters']);\n if ($apiai_response['message']['result']['parameters']) {\n $table = 'Facets';\n\n $criteria = array(\n //'maxRecords' => 1,\n 'filterByFormula' => '({Name} = \\'' . $apiai_response['message']['result']['parameters']['challenge'] . '\\')',\n );\n //Call air table\n $solution = $this->callController(\\Util::buildNamespace('surveys', 'airtable', 1), 'getSolutions', array($table, $criteria));\n\n $text_back = $solution;\n /*\n if ($airtable_response['status']) {\n $fields = $airtable_response['message'][0]->getFields();\n $text_back = $fields['Description'];\n }//E# if statement\n * \n */\n } else {\n $text_back = $apiai_response['message']['result']['fulfillment']['speech'];\n }//E# if else statement\n } else {\n $text_back = 'Ooops! Something went wrong. Kindly try after afew minutes';\n }//E# if else statement\n\n $message_array = array(\n 'type' => 'out',\n 'organization_id' => 1,\n 'session_id' => $session_model->id,\n 'text' => $text_back,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n 'status' => 1,\n 'created_by' => 1,\n 'updated_by' => 1,\n );\n\n //Create message\n $message_model = $this->callController(\\Util::buildNamespace('surveys', 'message', 1), 'createIfValid', array($message_array, true));\n\n $parameters = array(\n 'type' => 'text',\n 'chat_id' => $this->input['message']['chat']['id'],\n 'text' => $text_back\n );\n\n $this->sendMessage($parameters);\n }",
"function sb_dialogflow_intent_box() { ?>\n<div class=\"sb-lightbox sb-dialogflow-intent-box\">\n <div class=\"sb-info\"></div>\n <div class=\"sb-top-bar\">\n <div>Dialogflow Intent</div>\n <div>\n <a class=\"sb-send sb-btn sb-icon\">\n <i class=\"sb-icon-check\"></i><?php sb_e('Send') ?> Intent\n </a>\n <a class=\"sb-close sb-btn-icon\">\n <i class=\"sb-icon-close\"></i>\n </a>\n </div>\n </div>\n <div class=\"sb-main sb-scroll-area\">\n <div class=\"sb-title sb-intent-add\">\n <?php sb_e('Add user expressions') ?>\n <i data-value=\"add\" data-sb-tooltip=\"<?php sb_e('Add expression') ?>\" class=\"sb-btn-icon sb-icon-plus\"></i>\n <i data-value=\"previous\" class=\"sb-btn-icon sb-icon-arrow-up\"></i>\n <i data-value=\"next\" class=\"sb-btn-icon sb-icon-arrow-down\"></i>\n </div>\n <div class=\"sb-input-setting sb-type-text sb-first\">\n <input type=\"text\" />\n </div>\n <div class=\"sb-title\">\n <?php sb_e('Response from the bot') ?>\n </div>\n <div class=\"sb-input-setting sb-type-textarea\">\n <textarea></textarea>\n </div>\n <div class=\"sb-title\">\n <?php sb_e('Language') ?>\n </div>\n <?php echo sb_dialogflow_languages_list() ?>\n <div class=\"sb-title sb-title-search\">\n <?php sb_e('Intent') ?>\n <i id=\"sb-intent-preview\" data-sb-tooltip=\"<?php sb_e('Preview') ?>\" class=\"sb-icon-help\"></i>\n <div class=\"sb-search-btn\">\n <i class=\"sb-icon sb-icon-search\"></i>\n <input type=\"text\" autocomplete=\"false\" placeholder=\"<?php sb_e('Search for Intents...') ?>\">\n </div>\n </div>\n <div class=\"sb-input-setting sb-type-select\">\n <select id=\"sb-intents-select\">\n <option value=\"\"><?php sb_e('New Intent') ?></option>\n </select>\n </div>\n </div>\n</div>\n<?php }",
"function message_integration_token_info() {\n $type = [\n 'name' => t('Message Integration'),\n 'description' => t('Tokens for the Custom Message Integration module.'),\n 'needs-data' => 'message',\n ];\n\n // Node related tokens.\n $message['render-node'] = [\n 'name' => t(\"Rendered node\"),\n 'description' => t(\"The node rendered to HTML in a view mode, i.e. [render-node:teaser].\"),\n ];\n\n $message['node-diff'] = [\n 'name' => t('Node diff'),\n 'description' => t('A diff of node changes from previous version.'),\n ];\n\n // Comment related tokens.\n $message['render-comment'] = [\n 'name' => t(\"Rendered comment\"),\n 'description' => t(\"A single comment rendered to HTML.\"),\n ];\n\n return [\n 'types' => ['message' => $type],\n 'tokens' => [\n 'message' => $message,\n ],\n ];\n}",
"public function getToken() {\nglobal $_LW;\nif ($this->token=$_LW->getVariable('ems-client-token')) { // get cached token if possible\n\tif ($_LW->getVariable('ems-client-token-check')==1) { // and reuse until next check\n\t\treturn true;\n\t};\n\t$_LW->setVariable('ems-client-token-check', 1, 300);\n\tif ($response=$this->getResponse('/statuses')) { // check if the token is still valid by requesting statuses\n\t\tif (!empty($response['results'])) { // if statuses received\n\t\t\treturn true; // reuse until next check\n\t\t};\n\t};\n};\n$response=@shell_exec('curl --data \"{\\\"clientid\\\":\\\"'.preg_replace('~[^a-zA-Z0-9_\\-]~', '', $_LW->REGISTERED_APPS['ems']['custom']['username']).'\\\",\\\"secret\\\":\\\"'.preg_replace('~[^a-zA-Z0-9_\\-]~', '', $_LW->REGISTERED_APPS['ems']['custom']['password']).'\\\"}\" -H \"Content-Type: application/json\" '.escapeshellarg($_LW->REGISTERED_APPS['ems']['custom']['rest'].'/clientauthentication')); // get token from server and cache it\nif (@$response=@json_decode($response, true)) {\n\tif (!empty($response['clientToken'])) {\n\t\t$this->token=$response['clientToken'];\n\t\t$_LW->setVariable('ems-client-token', $this->token, 86400);\n\t\treturn true;\n\t};\n};\n$_LW->logError('EMS: Could not fetch token.', false, true);\nreturn false;\n}",
"public function webhook()\n {\n // return \\Messenger::startConversation();\n\n\n $access_token = env('token');\n $verify_token = env('verify_token');\n $hub_verify_token = null;\n \n if(isset($_REQUEST['hub_challenge'])) {\n $challenge = $_REQUEST['hub_challenge'];\n $hub_verify_token = $_REQUEST['hub_verify_token'];\n }\n \n \n if ($hub_verify_token === $verify_token) {\n echo $challenge;\n }\n\n\n\n $input = json_decode(file_get_contents('php://input'), true);\n\n $sender = $input['entry'][0]['messaging'][0]['sender']['id'];\n $message = $input['entry'][0]['messaging'][0]['message']['text'];\n\n $demo = new Answer();\n $demo->answer = $message;\n $demo->save();\n\n\n /**\n * Some Basic rules to validate incoming messages\n */\n $message_to_reply = 'Huh! what do you mean?';\n if(preg_match('[time|current time|now]', strtolower($message))) {\n\n // Make request to Time API\n ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0)');\n $result = file_get_contents(\"http://www.timeapi.org/utc/now?format=%25a%20%25b%20%25d%20%25I:%25M:%25S%20%25Y\");\n if($result != '') {\n $message_to_reply = $result;\n }\n } else {\n $message_to_reply = 'Huh! what do you mean?';\n }\n // print $message_to_reply;\n\n //API Url\n $url = 'https://graph.facebook.com/v2.6/me/messages?access_token='.$access_token;\n\n\n //Initiate cURL.\n $ch = curl_init($url);\n\n //The JSON data.\n $jsonData = '{\n \"recipient\":{\n \"id\":\"'.$sender.'\"\n },\n \"message\":{\n \"text\":\"'.$message_to_reply.'\"\n }\n }';\n\n \n\n //Encode the array into JSON.\n $jsonDataEncoded = $jsonData;\n\n //Tell cURL that we want to send a POST request.\n curl_setopt($ch, CURLOPT_POST, 1);\n\n //Attach our encoded JSON string to the POST fields.\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);\n\n //Set the content type to application/json\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n //Execute the request\n if (!empty($message)) {\n $result = curl_exec($ch); // user will get the message\n }\n\n curl_close($ch);\n\n \n\n\n\n\n }",
"public function getApprovalFlowDetails($flowType, $currentStatusID, $userID, $yourTableID=\"\"){\n\n // start the flow here\n $finalFlowData = array();\n $responseBody = array();\n\n\t\tif( $flowType=='' || $currentStatusID=='' || $userID==''){\n\t\t\t$finalFlowData['status'] = \"0\";\n $finalFlowData['message'] = \"Invalid input\";\n\n // insert the call details into the table\n $tableID = DB::table('appr_workflow_call_details')->insert(\n ['appr_call_for' => $flowType, 'appr_current_status_id' => $currentStatusID, 'appr_call_user_id'=> $userID, 'appr_call_made_at' => date('Y-m-d h:i:s'), 'appr_call_response' => json_encode($finalFlowData)]\n );\n\n\t\t\treturn $finalFlowData;\n\t\t}else{\n\n // get LegalEntiry ID\n $legalEntiryID = $this->getUserLegalEntity($userID);\n if($legalEntiryID==0 || $legalEntiryID==''){\n\n $finalFlowData['status'] = \"0\";\n $finalFlowData['message'] = \"Invalid UserID or legalEntityID\";\n\n // insert the call details into the table\n $tableID = DB::table('appr_workflow_call_details')->insert(\n ['appr_call_for' => $flowType, 'appr_current_status_id' => $currentStatusID, 'appr_call_user_id'=> $userID, 'appr_call_made_at' => date('Y-m-d h:i:s'), 'appr_call_response' => json_encode($finalFlowData)]\n );\n\n return $finalFlowData; \n }\n\n\t\t\t$flow_for_id = $this->getFlowForID($flowType);\n\n // Take the currentStat if it is Drafted\n if($currentStatusID=='drafted'){\n $sqlQuery = \"select * \n FROM master_lookup AS ml \n WHERE ml.`parent_lookup_id`= (SELECT ml.`master_lookup_id` parent_lookup_id FROM master_lookup AS ml WHERE ml.`value`=\".$flow_for_id.\" LIMIT 0,1)\n AND ml.`master_lookup_name`='drafted'\";\n\n $allData = DB::select(DB::raw($sqlQuery));\n if( isset($allData[0]->value) ){\n $currentStatusID = $allData[0]->value;\n }else{\n $currentStatusID =0;\n }\n }\n\n \n\t\t\t// check for the valid status\n\t $checkStatusExist = DB::table('appr_workflow_status_new AS aws')\n ->join(\"appr_workflow_status_details AS det\", \"det.awf_id\", \"=\", \"aws.awf_id\")\n ->where(\"aws.awf_for_id\", \"=\", $flow_for_id)\n ->where(\"aws.legal_entity_id\", \"=\", $legalEntiryID)\n ->where('det.awf_status_id', '=', $currentStatusID)\n ->get();\n\n $checkStatusToGoExist = DB::table('appr_workflow_status_new AS aws')\n ->join(\"appr_workflow_status_details AS det\", \"det.awf_id\", \"=\", \"aws.awf_id\")\n ->where(\"aws.awf_for_id\", \"=\", $flow_for_id)\n ->where(\"aws.legal_entity_id\", \"=\", $legalEntiryID)\n ->where('det.awf_status_to_go_id', '=', $currentStatusID)\n ->count();\n\n // if status not exit send response\n if($checkStatusExist==0 && $checkStatusToGoExist==0){\n \t$finalFlowData['status'] = \"0\";\n \t$finalFlowData['message'] = \"Invalid Status Sent or wrong legalEntityID\";\n // insert the call details into the table\n $tableID = DB::table('appr_workflow_call_details')->insert(\n ['appr_call_for' => $flowType, 'appr_current_status_id' => $currentStatusID, 'appr_call_user_id'=> $userID, 'appr_call_made_at' => date('Y-m-d h:i:s'), 'appr_call_response' => json_encode($finalFlowData)]\n );\n \treturn $finalFlowData;\n }elseif($checkStatusExist==0 && $checkStatusToGoExist==1){\n \t$finalFlowData['status'] = \"1\";\n \t$finalFlowData['message'] = \"No next lavel found\";\n \t$finalFlowData['data'] = array(\n \t\t\t'0' => 'Done'\n \t\t);\n // insert the call details into the table\n $tableID = DB::table('appr_workflow_call_details')->insert(\n ['appr_call_for' => $flowType, 'appr_current_status_id' => $currentStatusID, 'appr_call_user_id'=> $userID, 'appr_call_made_at' => date('Y-m-d h:i:s'), 'appr_call_response' => json_encode($finalFlowData)]\n );\n \treturn $finalFlowData;\n }\n\n\t // get all the flow as per current status\n\t $nextFlowData = DB::table('appr_workflow_status_new AS aws')\n ->select('aws.awf_id', 'det.awf_status_id', 'aws.awf_name', 'aws.awf_for_id', 'det.awf_condition_id', 'det.awf_status_to_go_id', 'det.applied_role_id', 'det.is_final')\n ->join(\"appr_workflow_status_details AS det\", \"det.awf_id\", \"=\", \"aws.awf_id\")\n ->where(\"aws.awf_for_id\", \"=\", $flow_for_id)\n ->where(\"aws.legal_entity_id\", \"=\", $legalEntiryID)\n ->where('det.awf_status_id', '=', $currentStatusID)\n ->get();\n\n if(count($nextFlowData)>0){\n \t$loopCounter = 0;\n \tforeach($nextFlowData as $data){\n\n $getdataDet = DB::table(\"master_lookup\")\n ->where(\"value\",\"=\",$data->awf_condition_id)\n ->where(\"mas_cat_id\",\"=\",58)\n ->first();\n\n $isFinal = $data->is_final;\n if($getdataDet->master_lookup_name == \"Rejected\" && $data->is_final==\"1\"){\n $isFinal = 0;\n }\n\n // Check if the rolese assigned to Immidiate repoter\n $roleName = \"\";\n $roleName = DB::table(\"roles\")->select(\"name\")->where(\"role_id\",\"=\",$data->applied_role_id)->first();\n if($roleName){\n $roleName=$roleName->name;\n }\n\n $countUserRole = 0;\n if($roleName=='ImmediateReporter'){\n\n // get Record Submitted by ID\n $submittedByID = DB::table(\"appr_workflow_history AS hist\")\n ->where(\"hist.awf_for_type\", \"=\", $flowType)\n ->where(\"hist.awf_for_id\", \"=\", $yourTableID)\n ->first();\n\n\n if($submittedByID){\n\n $countUserRole = DB::table(\"users\")\n ->select(\"reporting_manager_id\")\n ->where(\"user_id\",\"=\", $submittedByID->ticket_created_by)\n ->where(\"reporting_manager_id\",\"=\", $submittedByID->created_by_manager)\n ->count();\n }\n\n }elseif($roleName=='Initiator'){\n\n // get Record Submitted by ID\n $submittedByID = DB::table(\"appr_workflow_history AS hist\")\n ->where(\"hist.awf_for_type\", \"=\", $flowType)\n ->where(\"hist.awf_for_id\", \"=\", $yourTableID)\n ->first();\n\n if($submittedByID->ticket_created_by == $userID){\n $countUserRole = 1;\n }\n\n }else{\n\n // checks for the user access to the flow\n $countUserRole = DB::table('user_roles AS rls')\n ->where('rls.user_id', '=', $userID)\n ->where('rls.role_id', '=', $data->applied_role_id)\n ->count();\n }\n\n\t\t \tif($countUserRole>0){\n\n\t\t \t\t$conditionName = DB::table('master_lookup')\n\t\t \t\t\t\t\t\t->where('value','=',$data->awf_condition_id)\n\t\t \t\t\t\t\t\t->first();\n\t\t \t\t$conditionName = $conditionName->master_lookup_name;\n\t\t \t\t$statusToGoName = DB::table('master_lookup')\n\t\t \t\t\t\t\t\t->where('value','=',$data->awf_status_to_go_id)\n\t\t \t\t\t\t\t\t->first();\n\t\t \t\t$statusToGoName = $statusToGoName->master_lookup_name;\n\n\t\t \t$responseBody[$loopCounter]['conditionId'] = $data->awf_condition_id;\n\t\t \t$responseBody[$loopCounter]['condition'] = $conditionName;\n\t\t\t\t\t\t$responseBody[$loopCounter]['nextStatusId'] = $data->awf_status_to_go_id;\n\t\t\t\t\t\t$responseBody[$loopCounter]['nextStatus'] = $statusToGoName;\n\t\t\t\t\t\t$responseBody[$loopCounter]['isFinalStep'] = $isFinal;\n\t\t\t\t\t\t$loopCounter++;\n\t\t \t}\n\t \t}\n }\n\n if(count($responseBody)==0){\n\n $addedMsg = $yourTableID==\"\" ? \" or table ID could be blanck!\" : \"\";\n\n \t$finalFlowData['status'] = \"0\";\n \t$finalFlowData['message'] = \"User does not have role\".$addedMsg;\n\n\n }else{\n\n \t$currentStatusName = DB::table('master_lookup')\n \t\t\t\t\t\t->where('value','=',$data->awf_status_id)\n \t\t\t\t\t\t->first();\n \t\t$currentStatusName = $currentStatusName->master_lookup_name;\n\n\n \t$finalFlowData['status'] = \"1\";\n \t$finalFlowData['message'] = \"Flow found\";\n \t$finalFlowData['currentStatusName']=$currentStatusName;\n \t$finalFlowData['currentStatusId']=$data->awf_status_id;\n \t$finalFlowData['data'] = $responseBody;\n } \n // insert the call details into the table\n $tableID = DB::table('appr_workflow_call_details')->insert(\n ['appr_call_for' => $flowType, 'appr_current_status_id' => $currentStatusID, 'appr_call_user_id'=> $userID, 'appr_call_made_at' => date('Y-m-d h:i:s'), 'appr_call_response' => json_encode($finalFlowData)]\n );\n \treturn $finalFlowData;\n \t}\n }",
"function basicAuthFlow(){\n \n if(isset($_COOKIE[\"access_token\"])){\n return $_COOKIE[\"access_token\"];\n\n }else{\n try{\n\n $client = new Client(\n ['base_uri' => \"https://sandbox.momodeveloper.mtn.com/\"]); \n $response = $client->request(\n \"POST\",\n \"collection/token/\",\n [\"headers\"=>[\"Ocp-Apim-Subscription-Key\"=>\"3e5495b8aefb49459addcfa9466e7147\",\n 'Content-Type' => 'application/json',\n \"Authorization\"=> \"Basic NzFiNGRiOGUtNGYwNS00ZGNjLTlhZTMtMjJlMjFiM2Q5MGI3OjBmY2RiNjhiMmZmYzQwYzY4NzEwMGUwYTY2OTg0YTUw\"]] \n );\n $json_to_obj = json_decode($response->getBody());\n setcookie(\"access_token\", $json_to_obj->access_token, time() + 3600);\n return $json_to_obj->access_token;\n }\n catch(Exception $err){\n print_r($err);\n return \"error\";\n\n }\n }\n}",
"public function exec(AContext $ctx): AContext {\n if ($ctx->state == AContext::DEF_STATE_ACTIVE) {\n\n /* get step's local data from the context */\n $customerId = $ctx->getCustomerId();\n\n /* step's activity */\n /* TODO: add authorization */\n $request = new \\Praxigento\\Core\\Api\\App\\Web\\Request();\n $dev = new \\Praxigento\\Core\\Api\\App\\Web\\Request\\Dev();\n $dev->setCustId($customerId);\n $request->setDev($dev);\n $customerId = $this->authenticator->getCurrentUserId($request);\n\n /* put step's result data back into the context */\n $ctx->setCustomerId($customerId);\n }\n return $ctx;\n }",
"public function __construct ($channelSecret, $access_token) {\n\t\t\n $this->httpClient = new CurlHTTPClient($access_token);\n $this->channelSecret = $channelSecret;\n $this->endpointBase = LINEBot::DEFAULT_ENDPOINT_BASE;\n\t\t\n $this->content = file_get_contents('php://input');\n $events = json_decode($this->content, true); \n // $events = json_decode(preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $this->content), true); \n \n\t\t\n if (!empty($events['events'])) {\n\t\t\t\n $this->isEvents = true;\n $this->events = $events['events'];\n\t\t\t\n foreach ($events['events'] as $event) {\n\t\t\t\t\n $this->replyToken = $event['replyToken'];\n $this->source = (object) $event['source'];\n $this->message = (object) $event['message'];\n $this->timestamp = $event['timestamp'];\n\t\t\t\t\n if ($event['type'] == 'message' && $event['message']['type'] == 'text' && $event['message']['text'] == \"Location\") {\n \n $this->isLocation = true;\n\n } else if($event['type'] == 'message' && $event['message']['type'] == 'text' && $event['message']['text'] == \"Map\"){\n $this->isMap = true;\n\n } else if($event['type'] == 'message' && $event['message']['type'] == 'text') {\n $this->isText = true;\n $this->text = ($event['message']['text']);\n //$this->text = \"ว่าไงครับ\";\n }\n\n if ($event['type'] == 'message' && $event['message']['type'] == 'image') {\n $this->isImage = true;\n }\n\t\t\t\t\n if ($event['type'] == 'message' && $event['message']['type'] == 'sticker') {\n $this->isSticker = true;\n $this->stickerId = $event['message']['stickerId'];\n $this->packageId = $event['message']['packageId'];\n\n //$ans = $this->replySticker($event['replyToken'],$event['message']['packageId'],$event['message']['stickerId']);\n\n }\n\n // if ($event['type'] == 'follow') {\n // $this->isfollow = true;\n // $this->text = 'Hi Follow';\n // }\n\n // if ($event['type'] == 'unfollow') {\n // $this->unfollow = true;\n // $this->text = 'Unfollow';\n // }\n\n // if ($event['type'] == 'join') {\n // $this->join = true;\n // $this->text = 'join';\n // }\n\n // if ($event['type'] == 'leave') {\n // $this->leave = true;\n // $this->text = 'leave';\n // }\n\n\t\t\t\t\n }\n\n }\n\t\t\n parent::__construct($this->httpClient, [ 'channelSecret' => $channelSecret ]);\n\t\t\n }",
"function _response_with_TransactionEMV($serv,$fd,$request) {\n $response = _create_response($request);\n _fill_response_with_card_info($response,KIPLE_ACCOUNT_DEMO,KIPLE_TICKET_DEMO);\n _fill_response_with_status($response,'AUTHORIZED',SB_STATUS_APPROVAL);\n $response['ApprovalCode'] = '11112345678901234567';\n $response['TransactionDate'] = date(\"ymd\");\n $response['TransactionTime'] = date(\"His\");\n $response['TransactionIdentifier'] = \"12345678901234567890\";\n $response['BatchID'] = '123456';\n $response['CustomerReceipt'] = 'N/A';\n $response['MerchantReceipt'] = 'N/A';\n return _send_response($serv,$fd,'TransactionEMV',$response);\n}",
"public function preProcess() {\n $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);\n //FIXME: make sure act id has a type which is among the mtypes\n\n if ($this->_id) {\n // if we know id, initialize all required vars so each step of mobilisation could execute on its own.\n if (!$this->get('mtype')) {\n // set what step:type does on its completion\n $activityTypeID = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $this->_id, 'activity_type_id');\n $activityTypes = CRM_Core_PseudoConstant::activityType();\n $this->set('mtype', $activityTypes[$activityTypeID]);\n $this->set('activity_type_id', $activityTypeID);\n }\n if (!$this->get('event_id')) {\n // set what step:event does on its completion\n $eventID = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $this->_id, 'source_record_id');\n $this->set('event_id', $eventID);\n }\n if (!$this->get('mtype')) {\n CRM_Core_Error::fatal(ts(\"Couldn't determine the mobilisation type. Something wrong with configurations.\"));\n }\n }\n $this->_mtype = $this->get('mtype');\n\n // logged in user\n $session = CRM_Core_Session::singleton();\n $this->_currentUserId = $session->get('userID');\n if (!$this->_id) {\n //FIXME: report instance id is hardcoded\n $session->pushUserContext(CRM_Utils_System::url('civicrm/report/instance/41', 'force=1'));\n }\n\n // school contact\n require_once 'CRM/Futurefirst/veda_FF_utils.php';\n $this->_schoolId = CRM_Futurefirst_veda_FF_utils::get_teacher_school_ID();\n if (!$this->_schoolId) {\n CRM_Core_Error::fatal(ts(\"Can't find the school contact.\"));\n }\n $this->assign('schoolId', $this->_schoolId);\n\n // build contact list\n $cids = CRM_Utils_Array::value('cids', $_REQUEST);\n if (empty($cids)) {\n $cids = $this->get('cids');\n } else {\n $contactIds = array();\n foreach ($cids as $cid) {\n // sanitize & validate input\n if (CRM_Utils_Type::validate($cid, 'Integer')) {\n $contactIds[] = $cid;\n }\n }\n $cids = $contactIds;\n if (!empty($cids)) {\n // fill cache if empty\n CRM_Contact_BAO_Contact_Permission::cache($this->_currentUserId);\n // check permission\n $query = \"\n SELECT count(*)\n FROM civicrm_acl_contact_cache\n WHERE user_id = %1\n AND contact_id IN (\" .implode(\",\", $cids). \")\";\n $count = CRM_Core_DAO::singleValueQuery($query, array(1 => array($this->_currentUserId, 'Integer')));\n if ($count <> count($cids)) {\n CRM_Core_Error::statusBounce(ts(\"Permission Error: Non permissioned contact(s) / alumni selected.\"));\n }\n $this->set('cids', $cids);\n }\n }\n if (!$this->_id && empty($cids)) {\n CRM_Core_Error::statusBounce(ts(\"Could not find valid contact ids\"));\n }\n }",
"function proceed()\n\t{\n\t\tif(gm_get_conf('GM_ANALYTICS_CODE_USE') == '1') {\n\t\t\t$this->v_output_buffer['GOOGLE_ANALYTICS_CODE'] = gm_get_conf('GM_ANALYTICS_CODE');\n\t\t}\t\t\n\t\t\n\t\tparent::proceed();\n\t}",
"public function beforeTokenEmail()\r\n\t{\r\n\t\t//Import Plugin configs\r\n\t\t$config_path = (string)$this->getDir() . '\\pluginConfig.php';\r\n\t\t$plugin_configs = include($config_path);\r\n\t\t\r\n\t\t$oEvent = $this->getEvent();\r\n\t\t$surveyId = (string)$oEvent->get('survey');\r\n\t\t$typeOfEmail = $oEvent->get(\"type\");\r\n\r\n\t\t// Before changing any settings we need to check that:\r\n\t\t\t// 1. the sendSMSService is enabled by the admin for this specific survey\r\n\t\t$pluginEnabled = strcmp($this->get('EnableSendSMS','survey',$surveyId),'1')==0;\r\n\t\t\t// 2. Check the type of email, invitaiton or reminder => send, confirmation just ignore (not included in my plans :/).\r\n\t\t$vaildEmailType = (((strcmp($typeOfEmail,'invitation')==0) or (strcmp($typeOfEmail,'reminder')==0)) or (strcmp($typeOfEmail,'confirm')==0));\r\n\t\t$ourTokenData = $oEvent->get(\"token\");\r\n\t\tif($pluginEnabled and $vaildEmailType){\r\n\t\t\t// Then we need to check if the admin added an extra attribute\r\n\t\t\tif(isset($ourTokenData['attribute_1'])){\r\n\t\t\t\t// 3. This invite should be send via SMS and not to the Email account\r\n\t\t\t\t$mobile = (string)$ourTokenData['token'];\r\n\t\t\t\t$client = (string)$ourTokenData['attribute_1'];\r\n\t\t\t\tif(strcmp($client,'NA')!=0 and !empty($client)){\r\n\t\t\t\t\t// disable sending email for this token and send SMS\r\n\t\t\t\t\t$this->event->set(\"send\",false);\r\n\r\n\t\t\t\t\t// we get the token data and prepare the survey link \r\n\t\t\t\t\t$SMS_message = $this->get('MessageBody','survey',$surveyId);\t// The MessageBody entered by the admin\r\n\t\t\t\t\t$participantToken = $ourTokenData['token'];\r\n\t\t\t\t\t$participantFirstName = (string)$ourTokenData['firstname'];\r\n\t\t\t\t\t$participantLastName = (string)$ourTokenData['lastname'];\r\n\t\t\t\t\t$surveyLink = 'http://'. $_SERVER['SERVER_NAME'] . '/index.php/survey/index/sid/' . $surveyId . '/token/' . $participantToken;\t\t\r\n\r\n\t\t\t\t\t// Setting up the default SMS message in case the admin left it empty.\r\n\t\t\t\t\tif(empty($SMS_message)){\r\n\t\t\t\t\t\t$SMS_message = \"Dear {FIRSTNAME} {LASTNAME}, \\n We invite you to participate in the survey: \\n {SURVEYURL} \\n Survey Team\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Replacing the placeholders in the Admin message, so as to have the participant's data.\r\n\t\t\t\t\t$SMS_message_with_Replacement = str_replace(\"{FIRSTNAME}\",$participantFirstName,$SMS_message);\r\n\t\t\t\t\t$SMS_message_with_Replacement = str_replace(\"{LASTNAME}\",$participantLastName,$SMS_message_with_Replacement);\r\n\t\t\t\t\t$SMS_message_ready_to_be_sent = str_replace(\"{SURVEYURL}\",$surveyLink,$SMS_message_with_Replacement);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Since I don't want to send confirmation SMS, only for reminder and confirmation\r\n\t\t\t\t\tif((strcmp($typeOfEmail,'invitation')==0) or (strcmp($typeOfEmail,'reminder')==0)){\r\n\t\t\t\t\t\t// setting up the connection with SMS Service Provider then sending SMS msg\r\n\t\t\t\t\t\t$twilio_sid => $plugin_configs[$client].['Twilio_Account_SID'];\r\n\t\t\t\t\t\t$twilio_token => $plugin_configs[$client].['Twilio_Auth_Token'];\r\n\t\t\t\t\t\t$twilio_from => $plugin_configs[$client].['Twilio_Number'];\r\n\t\t\t\t\t\t$mobile;\r\n\t\t\t\t\t\t$SMS_message_ready_to_be_sent;\r\n\t\t\t\t\t\t$result_of_post = $this->callTwilio($twilio_sid,$twilio_token,$twilio_from,$mobile,$SMS_message_ready_to_be_sent);\r\n\t\t\t\t\t\tif($result_of_post === FALSE){\r\n\t\t\t\t\t\t\techo(\"SMS not sent. Please contact the administrator at [email protected]\");\r\n\t\t\t\t\t\t\texit;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{}\t// Confirmation don't want to send --> change this if you want to enter message and send confirmation SMS\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\techo(\"sendTwilioInvites Plugin is enabled. If you do not wish to send SMS invitations, disable it. If you intend to use it, the SMS was not sent. Please add an extra attribute with the mobile number or NA for emails.\");\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t}else{} // The SendSMSPlugin is not enabled. Don't change anything!\t\r\n\t}",
"public function maybe_update_auth_tokens() {\n\t\t// If access token is provided, save it.\n\t\tif ( rgpost( 'auth_payload' ) && ! $this->is_save_postback() ) {\n\n\t\t\t// Verify state.\n\t\t\tif ( ! wp_verify_nonce( rgpost( 'state' ), $this->get_authentication_state_action() ) ) {\n\t\t\t\tGFCommon::add_error_message( esc_html__( 'Unable to connect to Zoho CRM due to mismatched state.', 'gravityformszohocrm' ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$old_authMode = $this->get_setting( 'authMode' );\n\n\t\t\t$settings = array();\n\t\t\t$auth_payload = json_decode( base64_decode( rgpost( 'auth_payload' ) ), true );\n\n\t\t\t// Add API info to plugin settings.\n\t\t\t$settings['authMode'] = 'oauth';\n\t\t\t$settings['auth_token'] = array(\n\t\t\t\t'access_token' => $auth_payload['access_token'],\n\t\t\t\t'refresh_token' => $auth_payload['refresh_token'],\n\t\t\t\t'location' => $auth_payload['location'],\n\t\t\t\t'date_created' => time(),\n\t\t\t);\n\n\t\t\t// Save plugin settings.\n\t\t\t$this->update_plugin_settings( $settings );\n\n\t\t\tif ( $old_authMode !== 'oauth' ) {\n\t\t\t\t// Update cached fields.\n\t\t\t\tdelete_transient( $this->fields_transient_name );\n\t\t\t\t// Migrate feed settings.\n\t\t\t\t$this->run_api_name_fix();\n\t\t\t}\n\n\t\t\tGFCommon::add_message( esc_html__( 'Zoho CRM settings have been updated.', 'gravityformszohocrm' ) );\n\t\t}\n\n\t\t// If error is provided, display message.\n\t\tif ( rgpost( 'auth_error' ) ) {\n\t\t\t// Add error message.\n\t\t\tGFCommon::add_error_message( esc_html__( 'Unable to connect to Zoho CRM.', 'gravityformszohocrm' ) );\n\t\t}\n\t}",
"private static function obtain_token() {\n\t\tglobal $CFG;\n\n\t\t$url = \"https://api.hipchat.com/v2/oauth/token\";\n\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $CFG->oauth_id . \":\" . $CFG->oauth_secret);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials&scope=admin_room\");\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n\t\t$body = curl_exec($ch);\n\t\t$data = json_decode($body);\n\n\t\tif (isset($data->access_token)) {\n\t\t\treturn $data->access_token;\n\t\t}\n\t}",
"function get_response_message($msg_code){\n \n $message_arr = array(\n \n 100 => \"Invalid API key\",\n 101 => \"Invalid token\",\n 102 => \"Invalid Email or Password\",\n 103 => \"User authentication successfully done\",\n 104 => \"User not found\",\n 105 => \"User registration successfully done\",\n 106 => \"No record found\",\n 107 => \"Something went wrong. Please try again\", //something went wrong\n 108 => \"You are currently not authorised to login\",\n 109 => \"Invalid request\",\n 110 => \"Invalid parameter value\",\n 111 => \"Inactive user\",\n 112 => \"Invalid Email\",\n 113 => \"Invalid header value\",\n 113 => \"Invalid password\",\n 114 => \"Social registered users are not allow to access forgot password.\",\n 115 => \"Social ID is required.\",\n 116 => \"Social type is required.\",\n 117 => \"Device token is required.\",\n 118 => \"User type is required.\",\n 119 => \"You already have an account as seller with this Email, Please try with another Email.\",\n\n 120 => \"A new password has been sent on your registered Email\",\n 121 => \"Logged in successfully\",\n 122 => \"Added successfully\",\n 123 => \"Updated successfully\",\n 124 => \"Deleted successfully\",\n 125 => \"Logged out successfully\",\n 126 => \"You are not authorised for this action\",\n 127 => \"This Email address is already exist, Please try again with another Email.\",\n 128 => \"Your account is already registered with Social Account. Please try logging in using Social account.\",\n 129 => \"Your account is already registered and is not associated with Social Account. Please try logging in without using Social account.\",\n 130 => \"Your password has been sent to your Email.\",\n 131 => \"Business name is required.\",\n 132 => \"Business name should be between of 5 and 100 characters.\",\n 133 => \"Business information has been added successfully.\",\n 134 => \"Business ID should not be empty.\",\n 135 => \"Business information has been updated successfully.\",\n 136 => \"Email is required.\",\n 137 => \"Please input valid price.\",\n 138 => \"Product has been added successfully.\",\n 139 => \"Product featured image is required.\",\n 140 => \"Full Name is required.\",\n 141 => \"Full name should be between of 2 and 50 characters.\",\n 142 => \"Profile has been updated successfully.\",\n 143 => \"Latitude and longitude are required.\",\n 144 => \"Profile image has been updated successfully.\",\n 145 => \"You signup as a buyer account, so you are not able to add business information.\",\n 146 => \"Business information is already added.\",\n 147 => \"Please select profile picture.\",\n 148 => \"This account is associated with Social , So you can't be update password.\",\n 149 => \"Current password and New Password are same.\",\n 150 => \"Your password has been updated successfully.\",\n 151 => \"Your password does not matched with old password.\",\n 152 => \"Gallery Image is required.\",\n 153 => \"Gallery Image has been uploaded successfully.\",\n 154 => \"Gallery Image has been deleted successfully.\",\n 155 => \"Feedback has been send successfully.\",\n 156 => \"You are not authorized to do anything with this product.\",\n 157 => \"Product has been deleted successfully.\",\n 158 => \"ID is required.\",\n 159 => \"Product not exist.\",\n 160 => \"Product has been updated successfully.\",\n 161 => \"Address has been added successfully.\",\n 162 => \"Address not exist.\",\n 163 => \"Address has been deleted successfully.\",\n 164 => \"Address has been updated successfully.\",\n 165 => \"Social ID already exist.\",\n 166 => \"Product successfully added in your wishlist\",\n 167 => \"Product successfully removed from your wishlist\",\n 168 => \"Product successfully added in your cart\",\n 169 => \"Quantity is required.\",\n 170 => \"Card has been successfully saved.\",\n 171 => \"Card ID is exist.\",\n 172 => \"Card successfully updated as default.\",\n 173 => \"Default card will not be delete.\",\n 174 => \"Card has been deleted successfully.\",\n 175 => \"Order placed successfully.\",\n 178 => \"Order rejected successfully.\",\n 179 => \"Order accepted successfully.\",\n 180 => \"You already have an account with this Email, Please try with another Email.\",\n 181 => \"Rating is submitted successfully.\",\n\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => '(Unused)',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n 506 => 'Session expired'\n );\n \n $no_msg = '';\n if(!array_key_exists($msg_code,$message_arr)){\n return $no_msg; //code does not exist, return empty string\n }\n \n return $message_arr[$msg_code]; //return message corresponding to code\n}"
] | [
"0.5948379",
"0.552615",
"0.54176444",
"0.5404089",
"0.52534556",
"0.5047222",
"0.49976882",
"0.4978712",
"0.4945197",
"0.49176726",
"0.4769797",
"0.4767783",
"0.47583458",
"0.47469",
"0.47441328",
"0.47325864",
"0.47308958",
"0.47225672",
"0.47219756",
"0.47009",
"0.46971276",
"0.46830347",
"0.4682011",
"0.46688315",
"0.4668269",
"0.4667328",
"0.46181977",
"0.46119094",
"0.46069872",
"0.46054354"
] | 0.5817347 | 1 |
/ SMART REPLY 1. Return the suggestions 2. Update a smart reply conversation with a new message 3. Generate the conversation transcript data for a dataset | function sb_dialogflow_smart_reply($message, $smart_reply_data = false, $language = false, $token = false, $language_detection = false) {
$suggestions = [];
$smart_reply_response = false;
$token = empty($token) ? sb_dialogflow_get_token() : $token;
$smart_reply = sb_get_multi_setting('dialogflow-smart-reply', 'dialogflow-smart-reply-profile');
$messages = sb_dialogflow_message(false, $message, $token, $language);
if (sb_is_error($messages)) return $messages;
$query_result = sb_isset($messages['response'], 'queryResult', []);
$detected_language_response = false;
// Bot
if (!empty($messages['messages']) && sb_isset($query_result, 'action') != 'input.unknown' && (!isset($query_result['match']) || $query_result['match']['matchType'] != 'NO_MATCH')) {
for ($i = 0; $i < count($messages['messages']); $i++) {
array_push($suggestions, $messages['messages'][$i]['message']);
}
} else if ($language_detection) {
$detected_language = sb_google_language_detection($message, $token);
if ($detected_language != $language[0] && !empty($detected_language)) {
$supported_language_codes = sb_isset(sb_dialogflow_curl('', '', false, 'GET'), 'supportedLanguageCodes', []);
if (in_array($detected_language, $supported_language_codes)) {
$detected_language_response = $detected_language;
if (isset($_POST['user_id'])) sb_update_user_value($_POST['user_id'], 'language', $detected_language);
return sb_dialogflow_smart_reply($message, $smart_reply_data, [$detected_language], $token);
}
}
}
// Smart Reply
if (!count($suggestions) && $smart_reply) {
$query = '{ "textInput": { "text": "' . str_replace('"', '\"', $message) . '", "languageCode": "' . $language[0] . '" }}';
$exernal_setting = [];
if ($smart_reply_data && empty($smart_reply_data['user'])) {
$exernal_setting = sb_get_external_setting('smart-reply', []);
$smart_reply_response = sb_isset($exernal_setting, $smart_reply_data['conversation_id']);
} else {
$smart_reply_response = $smart_reply_data;
}
if (!$smart_reply_response) {
$query_2 = '{ "conversationProfile": "' . $smart_reply . '" }';
$project_id = substr($smart_reply, 0, strpos($smart_reply, '/conversationProfiles'));
$response = sb_curl('https://dialogflow.googleapis.com/v2/' . $project_id . '/conversations', $query_2, [ 'Content-Type: text/plain', 'Authorization: Bearer ' . $token, 'Content-Length: ' . strlen($query_2) ], 'POST');
if (isset($response['name'])) {
$smart_reply_response = ['conversation' => $response['name']];
for ($i = 0; $i < 2; $i++) {
$query_2 = '{ "role": "' . ($i ? 'HUMAN_AGENT' : 'END_USER') . '" }';
$smart_reply_response[$i ? 'agent' : 'user'] = sb_isset(sb_curl('https://dialogflow.googleapis.com/v2/' . $response['name'] . '/participants', $query_2, [ 'Content-Type: text/plain', 'Authorization: Bearer ' . $token, 'Content-Length: ' . strlen($query_2) ], 'POST'), 'name');
}
if (isset($smart_reply_data['conversation_id'])) {
$exernal_setting[$smart_reply_data['conversation_id']] = $smart_reply_response;
sb_save_external_setting('smart-reply', $exernal_setting);
}
}
}
if (!empty($smart_reply_response['user'])) {
$response = sb_curl('https://dialogflow.googleapis.com/v2/' . $smart_reply_response['user'] . ':analyzeContent', $query, [ 'Content-Type: text/plain', 'Authorization: Bearer ' . $token, 'Content-Length: ' . strlen($query) ], 'POST');
}
if (isset($response['humanAgentSuggestionResults'])) {
$results = $response['humanAgentSuggestionResults'];
$keys = [['suggestSmartRepliesResponse', 'smartReplyAnswers', 'reply'], ['suggestFaqAnswersResponse', 'faqAnswers', 'answer'], ['suggestArticlesResponse', 'articleAnswers', 'uri']];
for ($i = 0; $i < count($results); $i++) {
for ($y = 0; $y < 3; $y++) {
if (isset($results[$i][$keys[$y][0]])) {
$answers = sb_isset($results[$i][$keys[$y][0]], $keys[$y][1], []);
for ($j = 0; $j < count($answers); $j++) {
array_push($suggestions, $answers[$j][$keys[$y][2]]);
}
}
}
}
}
}
return ['suggestions' => $suggestions, 'token' => sb_isset($messages, 'token'), 'detected_language' => $detected_language_response, 'smart_reply' => $smart_reply_response];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function updateFulltextData($messages)\n\t{\n\t\tif (!is_array(reset($messages)))\n\t\t\t$messages = array($messages);\n\n\t\t$query = new Query('kv_admin');\n\t\tforeach ($messages as $m)\n\t\t{\n\t\t\t// get texts of the message and of all its replies\n\t\t\t$query->clearParams();\n\t\t\t$query->setQuery('select * from message where id = $1');\n\t\t\t$query->appendParam($m['id']);\n\t\t\t$message = $query->execute();\n\t\t\t$message = $message[0];\n\t\t\t$query->setQuery('select * from replies_to_message($1)');\n\t\t\t$replies = $query->execute();\n\n\t\t\t// normalize texts for fulltext search (remove accents and convert to lowercase)\n\t\t\t$message_subject = strtolower(Utils::unaccent($message['subject']));\n\t\t\t$message_body = strtolower(Utils::unaccent($message['body']));\n\t\t\t$replies_text = '';\n\t\t\tforeach ((array)$replies as $reply)\n\t\t\t\t$replies_text .= strtolower(Utils::unaccent($reply['subject'] . ' ' . $reply['body'] . ' '));\n\t\t\t$sender_name = strtolower(Utils::unaccent($message['sender_name']));\n\t\t\t$sender_address = strtolower(Utils::unaccent($message['sender_address']));\n\n\t\t\t// set columns with search data to weighted concatenation of the normalized texts\n\t\t\t$query->setQuery(\n\t\t\t\t\"update message set\\n\" .\n\t\t\t\t\"\ttext_data =\\n\" .\n\t\t\t\t\"\t\tsetweight(to_tsvector('simple', $2), 'A') ||\\n\" .\n\t\t\t\t\"\t\tsetweight(to_tsvector('simple', $3), 'B') ||\\n\" .\n\t\t\t\t\"\t\tsetweight(to_tsvector('simple', $4), 'C'),\\n\" .\n\t\t\t\t\"\tsender_data =\\n\" .\n\t\t\t\t\"\t\tsetweight(to_tsvector('simple', $5), 'A') ||\\n\" .\n\t\t\t\t\"\t\tsetweight(to_tsvector('simple', $6), 'B')\\n\" .\n\t\t\t\t\"where id = $1\\n\" .\n\t\t\t\t\"returning id\");\n\t\t\t$query->appendParam($message_subject);\n\t\t\t$query->appendParam($message_body);\n\t\t\t$query->appendParam($replies_text);\n\t\t\t$query->appendParam($sender_name);\n\t\t\t$query->appendParam($sender_address);\n\t\t\t$query->execute();\n\t\t}\n\t}",
"function sendNotifcation ($results_ha, $first_name, $fb_sender_id, $sexual_orientation, $locale, $gender, $inte1, $inte2, $inte3, $studied_at, $lives_in)\n\t{\n if($locale == \"es_LA\" || $locale == \"es_ES\")\n {\n include_once '../files/langES.php';\n }else{\n include_once '../files/langEN.php';\n }\n\n\t do {\n\t\t\t//This will be the number of the option to choose\n\t\t\t$num_option = rand(1,5);\n\t\t\tswitch ($num_option)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$sent = matchWithInterviews($results_ha, $first_name, $fb_sender_id, $sexual_orientation, $gender, $inte1, $inte2, $inte3, $lang['CRON_MATCHINTERVIEWS']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$sent = proposeNewChannel($first_name, $fb_sender_id, $lives_in, $studied_at, $lang['CRON_NEWCHANNEL'], $lang['CHANGE_CHANNEL']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$sent = newPeopleMessage($first_name, $fb_sender_id, $sexual_orientation, $gender, $lang['CRON_NEWPEOPLE']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$sent = checkScoreMessage($first_name, $fb_sender_id, $sexual_orientation, $gender, $lang['CRON_SCOREMSG']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$sent = recommendContact($first_name, $fb_sender_id, $lang['CRON_RECOMMENDCONTACT']);\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}while ($sent == false);\n\n\t}",
"function sb_dialogflow_create_intent($training_phrases, $bot_response, $language = '', $conversation_id = false) {\n $training_phrases_api = [];\n for ($i = 0; $i < count($training_phrases); $i++) {\n array_push($training_phrases_api, [ 'type' => 'TYPE_UNSPECIFIED', 'parts' => [ 'text' => $training_phrases[$i]], 'repeatCount' => 1]);\n }\n $response = sb_dialogflow_curl('/agent/intents', ['displayName' => sb_string_slug(strlen($training_phrases[0]) > 100 ? substr($training_phrases[0], 0, 99) : $training_phrases[0]), 'priority' => 500000, 'webhookState' => 'WEBHOOK_STATE_UNSPECIFIED', 'trainingPhrases' => $training_phrases_api, 'messages' => [['text' => ['text' => $bot_response]]]], $language);\n if (sb_get_setting('dialogflow-edition') == 'cx') {\n $flow_name = '00000000-0000-0000-0000-000000000000';\n if ($conversation_id) {\n $messages = sb_db_get('SELECT payload FROM sb_messages WHERE conversation_id = ' . sb_db_escape($conversation_id) . ' AND payload <> \"\" ORDER BY id DESC');\n for ($i = 0; $i < count($messages); $i++) {\n \t$payload = json_decode($messages['payload'], true);\n if (isset($payload['queryResult']) && isset($payload['queryResult']['currentPage'])) {\n $flow_name = $payload['queryResult']['currentPage'];\n $flow_name = substr($flow_name, strpos($flow_name, '/flows/') + 7);\n if (strpos($flow_name, '/')) $flow_name = substr($flow_name, 0, strpos($flow_name, '/'));\n break;\n }\n }\n }\n $flow = sb_dialogflow_curl('/flows/' . $flow_name, '', $language, 'GET');\n array_push($flow['transitionRoutes'], ['intent' => $response['name'], 'triggerFulfillment' => ['messages' => [['text' => ['text' => [$bot_response]]]]]]);\n $response = sb_dialogflow_curl('/flows/' . $flow_name . '?updateMask=transitionRoutes', $flow, $language, 'PATCH');\n }\n if (isset($response['displayName'])) {\n return true;\n }\n return $response;\n}",
"public function talk()\n {\n \t// $data = $talk->selectTalk();\n \t$data = \\DB::table('reply')->get();\n \treturn view('admin.suggest.talk')->with('data',$data);\n }",
"public function voice_function(){\n\n $send_sms = new Communication();\n \n if ($_POST['isActive'] == 1) {\n\n $currentCallState = 'None';\n \n //read the first qn in this survey\n $survey = Survey::all()->last();\n $all_question = $survey->questions()->get();\n\n start_survey:\n\n foreach ($all_question as $question_value) {\n if ($currentCallState == 'None') { \n $options = '';\n foreach ($question_value->responses as $response) {\n $options .= $response->answer.\", or, \";\n }\n \n $question = $question_value->description .\"Answer options are, {$options}\";\n $response = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $response .= '<Response voice=\"man\" timeOut=\"60\">';\n $response .= '<GetDigits finishOnKey=\"#\">';\n $response .= '<Say>'.$question.'</Say>';\n $response .= '</GetDigits>';\n $response .= '</Response>';\n header('Content-type: text/plain');\n \n echo $response;\n // extract($_POST); \n $currentCallState = 'PromptSent'\n\n $answer = $_POST['dtmfDigits'];\n\n $outbox_id = NULL;\n\n if(isset($answer)) { \n $this->store_user_response($answer,$_POST['callerNumber'],$outbox_id,$question_value->id);\n }\n else{\n $currentCallState = 'None';\n goto start_survey;//if user does not answer, repaet the survey\n\n }\n } \n $currentCallState = 'None'; \n } \n }\n\n $response = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $response .= '<Response voice=\"man\" timeOut=\"60\">'; \n $response .= '<Say>Thank you for conduting this survey with us.</Say>'; \n $response .= '</Response>';\n header('Content-type: text/plain'); \n echo $response;\n\n $recipients = array(array(\"phoneNumber\" => $_POST['callerNumber'], \"amount\" => \"UGX 100\"));\n\n $send_sms->plain_SMS($_POST['callerNumber'], \"Thank you for conducting a survey with us\"); \n $recipientStringFormat = json_encode($recipients);\n $gateway = new AfricasTalkingGateway(env(\"API_USERNAME\"), env(\"API_KEY\"));\n $results = $gateway->sendAirtime($recipientStringFormat);\n foreach($results as $result) {\n $save_reward = new Reward();\n $save_reward->phone_number = $result->phoneNumber;\n $save_reward->survey_id = $survey->id;\n $save_reward->amount = $result->amount;\n $save_reward->error_message = $result->errorMessage;\n $save_reward->requestId = $result->requestId;\n $save_reward->save(); \n }\n $currentCallState = 'Done';\n }",
"private function processAnswer() {\n\n $text_back = '';\n\n $parameters = array();\n\n //Set scope\n $parameters['scope'] = array('statusOne');\n\n //Order by\n $parameters['orderBy'][] = array('updated_at' => 'asc');\n\n //Select session\n $session_model = $this->callController(\\Util::buildNamespace('surveys', 'session', 1), 'getModelByField', array('channel_chat_id', $this->input['message']['chat']['id'], $parameters));\n\n if ($session_model) {\n\n $session_model->updated_at = Carbon::now();\n\n $session_model->save();\n } else {\n $names = $this->input['message']['from']['first_name'];\n\n if (array_key_exists('last_name', $this->input['message']['from'])) {\n $names .= $this->input['message']['from']['last_name'];\n }//E# if statement\n\n $session_array = array(\n 'organization_id' => 1,\n 'channel_chat_id' => $this->input['message']['chat']['id'],\n 'full_name' => $names,\n 'status'=>1,\n 'created_by'=>1,\n 'updated_by'=>1,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n );\n\n //Create session\n $session_model = $this->callController(\\Util::buildNamespace('surveys', 'session', 1), 'createIfValid', array($session_array, true));\n }//E# if else statement\n //Get text\n $text = $this->input['message']['text'];\n\n $message_array = array(\n 'type' => 'in',\n 'organization_id' => 1,\n 'session_id' => $session_model->id,\n 'text' => $text,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n 'status' => 1,\n 'created_by' => 1,\n 'updated_by' => 1,\n );\n\n //Create message\n $message_model = $this->callController(\\Util::buildNamespace('surveys', 'message', 1), 'createIfValid', array($message_array, true));\n\n $query_array = array(\n 'query' => $text,\n 'confidence' => 1,\n 'sessionId' => $session_model->id,\n );\n //Call apiai\n $apiai_response = $this->callController(\\Util::buildNamespace('surveys', 'apiai', 1), 'query', array($query_array));\n\n if ($apiai_response['status']) {\n // dd($apiai_response['message']['result']['parameters']);\n if ($apiai_response['message']['result']['parameters']) {\n $table = 'Facets';\n\n $criteria = array(\n //'maxRecords' => 1,\n 'filterByFormula' => '({Name} = \\'' . $apiai_response['message']['result']['parameters']['challenge'] . '\\')',\n );\n //Call air table\n $solution = $this->callController(\\Util::buildNamespace('surveys', 'airtable', 1), 'getSolutions', array($table, $criteria));\n\n $text_back = $solution;\n /*\n if ($airtable_response['status']) {\n $fields = $airtable_response['message'][0]->getFields();\n $text_back = $fields['Description'];\n }//E# if statement\n * \n */\n } else {\n $text_back = $apiai_response['message']['result']['fulfillment']['speech'];\n }//E# if else statement\n } else {\n $text_back = 'Ooops! Something went wrong. Kindly try after afew minutes';\n }//E# if else statement\n\n $message_array = array(\n 'type' => 'out',\n 'organization_id' => 1,\n 'session_id' => $session_model->id,\n 'text' => $text_back,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n 'status' => 1,\n 'created_by' => 1,\n 'updated_by' => 1,\n );\n\n //Create message\n $message_model = $this->callController(\\Util::buildNamespace('surveys', 'message', 1), 'createIfValid', array($message_array, true));\n\n $parameters = array(\n 'type' => 'text',\n 'chat_id' => $this->input['message']['chat']['id'],\n 'text' => $text_back\n );\n\n $this->sendMessage($parameters);\n }",
"function get_correction($q){\n global $es_end_point;\n $has_fix = false;\n $url = $es_end_point.'/_suggest';\n $data = array(\n \"suggestions\" => array(\n \"text\" => \"\",\n \"term\" => array(\n \"analyzer\" => \"standard\",\n \"field\" => \"Dataset.description\"\n )\n )\n );\n if (!preg_match('/(AND|OR|NOT|\\[|\\])/', $q)){\n $data['suggestions']['text'] = html_entity_decode($q,$flags=ENT_QUOTES);\n }\n $data = json_encode($data);\n $ch = curl_init( $url );\n curl_setopt( $ch, CURLOPT_POST, 1);\n curl_setopt( $ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt( $ch, CURLOPT_HEADER, 0);\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);\n\n $response = curl_exec( $ch );\n $response = json_decode($response);\n $response = $response->suggestions;\n $fixed_ver = [];\n /*echo '<pre>';\n print_r($response);\n echo '</pre>';*/\n foreach($response as $sugg) {\n if(count($sugg->options) > 0) {\n $has_fix = true;\n $fixed_ver[] = $sugg->options[0]->text ;\n }\n else {\n $fixed_ver[] = $sugg->text ;\n }\n }\n $correction = implode($fixed_ver, ' ');\n return [$has_fix,$correction];\n}",
"public function finish()\n {\n $participant_class_name = lib::get_class_name( 'database\\participant' );\n $mailout_type = $this->get_argument( 'restrict_mailout' );\n $restrict_site_id = $this->get_argument( 'restrict_site_id', 0 );\n $db_site = lib::create( 'database\\site', $restrict_site_id );\n $participant_list = $restrict_site_id\n ? $participant_class_name::select_for_site( $db_site )\n : $participant_class_name::select();\n $db_qnaire = lib::create( 'database\\qnaire', $this->get_argument( 'restrict_qnaire_id' ) );\n\n // TODO: Change this to the title/code of the limesurvey question to check\n // (this should be the new information package required question)\n\n if( $mailout_type == 'Participant information package' )\n {\n $question_code = 'A';\n $title = 'Participant Information Package Required Report';\n }\n else\n {\n $question_code = 'B';\n $title = 'Proxy Information Package Required Report';\n }\n\n $this->add_title( \n sprintf( 'Listing of those who requested a new information package during '.\n 'the %s interview', $db_qnaire->name ) ) ;\n \n // modifiers common to each iteration of the following loops\n $consent_mod = lib::create( 'database\\modifier' );\n $consent_mod->where( 'event', '=', 'verbal accept' );\n $consent_mod->or_where( 'event', '=', 'written accept' );\n\n $contents = array();\n $tokens_class_name = lib::get_class_name( 'database\\limesurvey\\tokens' );\n $survey_class_name = lib::get_class_name( 'database\\limesurvey\\survey' );\n foreach( $participant_list as $db_participant )\n {\n $done = false;\n\n if( !is_null( $db_participant->status ) ) continue; \n\n if( count( $db_participant->get_consent_list( $consent_mod ) ) )\n {\n $interview_mod = lib::create( 'database\\modifier' );\n $interview_mod->where( 'qnaire_id', '=', $db_qnaire->id );\n $db_participant->get_interview_list( $interview_mod );\n $db_interview = current( $db_participant->get_interview_list( $interview_mod ) );\n if( $db_interview && $db_interview->completed )\n {\n foreach( $db_interview->get_qnaire()->get_phase_list() as $db_phase )\n {\n // figure out the token\n $token = $tokens_class_name::determine_token_string( $db_interview );\n\n // determine if the participant answered yes to the consent question\n $survey_mod = lib::create( 'database\\modifier' );\n if( $db_phase->repeated )\n {\n // replace the token's 0 with a database % wildcard\n $token = substr( $token, 0, -1 ).'%';\n $survey_mod->where( 'token', 'LIKE', $token );\n }\n else $survey_mod->where( 'token', '=', $token );\n\n $survey_class_name::set_sid( $db_phase->sid );\n foreach( $survey_class_name::select( $survey_mod ) as $db_survey )\n {\n if( $db_survey && 'Y' == $db_survey->get_response( $question_code ) )\n {\n $db_address = $db_participant->get_first_address();\n if( is_null( $db_address ) ) continue;\n $db_region = $db_address->get_region();\n $db_last_phone_call = $db_participant->get_last_contacted_phone_call();\n $date_completed = 'NA';\n if( !is_null( $db_last_phone_call ) )\n {\n $date_completed = substr( $db_last_phone_call->start_datetime, 0, \n strpos( $db_last_phone_call->start_datetime, ' ' ) );\n }\n\n $contents[] = array(\n $db_participant->uid,\n $db_participant->first_name,\n $db_participant->last_name,\n $db_address->address1,\n $db_address->city,\n $db_region->abbreviation,\n $db_region->country,\n $db_address->postcode,\n $date_completed );\n\n $done = true;\n }\n if( $done ) break; // stop searching if we're done\n } // end loop on survey\n if( $done ) break; // stop searching if we're done\n } // end loop on qnaire phases\n if( $done ) break; // stop searching if we're done\n } // end if completed interview\n } // end if verbal or written consent obtained\n }// end participant loop \n \n $header = array(\n \"UID\",\n \"First Name\",\n \"Last Name\",\n \"Address\",\n \"City\",\n \"Prov/State\",\n \"Country\",\n \"Postcode\",\n \"Date Completed\" );\n \n $this->add_table( NULL, $header, $contents, NULL );\n\n return parent::finish();\n }",
"public function actionTwilioTextReply()\n\t{\n\t\t\t\n\t\t$phone = $_REQUEST['From'];\t// Incoming Phone Number\n\t\t$message = $_REQUEST['Body'];\t// Incoming Text Message\n\t\t$stopBool = stripos($message , 'stop');\n\t\tif(!$stopBool === false)\n\t\t\t{\n\t\t\t\t// Trim the Phone Number\n\t\t\t\t$phone = substr($phone,2,10);\n\t\t\t\t\n\t\t\t\t// Find a contact record with the matching Phone Number\n\t\t\t\t$stopTruantAlerts = Contact::model()->resetScope()->find('data=:phone', array(':phone'=>$phone));\n\t\t\t\t\n\t\t\t\t// Stop Messages\n\t\t\t\tif(!$stopTruantAlerts->stopTruantAlert == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$stopTruantAlerts->stopTruantAlert = 1;\n\t\t\t\t\t\t$stopTruantAlerts->save();\n\t\t\t\t\t\t//print \"Truant Alerts Stopped<br />\";\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$startInt = stripos($message , 'start');\n\t\t\tif(!$startInt === false)\n\t\t\t\t{\n\t\t\t\t\t// Trim the Phone Number\n\t\t\t\t\t$phone = substr($phone,2,10);\n\t\t\t\t\t\n\t\t\t\t\t// Find a contact record with the matching Phone Number\n\t\t\t\t\t$startTruantAlerts = Contact::model()->resetScope()->find('data=:phone', array(':phone'=>$phone));\n\t\t\t\t\t\n\t\t\t\t\tif(!$startTruantAlerts->stopTruantAlert == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$startTruantAlerts->stopTruantAlert = 0;\n\t\t\t\t\t\t\t$startTruantAlerts->save();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * $log = new Log;\n\t\t\t * $log->action_description = \"Phone Number: \" . $phone . \"\\nMessage: \" . $message . \"\\nThe End.\";\n\t\t\t * $log->save();\n\t\t\t * print \"New Log Entry!<br />\";\n\t\t\t */\t\t\t\n\t}",
"function l10n_feedback_add_suggestion($sguid, $lng, $values, $umail =NULL) {\n\n if ($umail == NULL) {\n global $user;\n $umail = $user->init;\n }\n\n $translation = l10n_feedback_pack_string($values);\n $translation = str_replace(t('<New translation>'), '', $translation);\n\n // Don't add empty translations.\n if (trim($translation) == '') return false;\n\n // Check access permissions.\n if (!user_access('btranslator-suggest')) {\n global $l10n_feedback_save_status;\n $l10n_feedback_save_status['cannot_suggest']++;\n return false;\n }\n\n // Load the string and adjust translation whitespace based on source.\n $db = $GLOBALS['l10n_feedback_db'];\n $query = 'SELECT string FROM {l10n_feedback_strings} WHERE sguid = :sguid';\n $source_string = $db->query($query, array(':sguid' => $sguid))->fetchField();\n $translation = l10n_feedback_trim($translation, $source_string);\n\n // Look for an existing translation, if any.\n $tguid = sha1($translation . $lng . $sguid);\n $query = 'SELECT translation FROM {l10n_feedback_translations} WHERE tguid = :tguid';\n $existing = $db->query($query, array(':tguid' => $tguid))->fetchField();\n\n // If this translation already exists, there is nothing to be added.\n if (!empty($existing)) return false;\n\n // Insert the new suggestion.\n $db->insert('l10n_feedback_translations')\n ->fields(array(\n 'sguid' => $sguid,\n 'lng' => $lng,\n 'translation' => $translation,\n\t'tguid' => $tguid,\n 'count' => 1,\n\t'umail' => $umail,\n 'ulng' => $lng,\n 'time' => date('Y-m-d H:i:s', REQUEST_TIME),\n ))\n ->execute();\n\n // Add also a vote for the new suggestion.\n $vid = l10n_feedback_add_vote($tguid, $umail);\n\n //TODO: Notify previous voters of this string that a new suggestion\n // has been submitted. Maybe they would like to review it and\n // change their vote.\n\n // Increment the number of the saved suggestions.\n global $l10n_feedback_save_status;\n $l10n_feedback_save_status['nr_suggestions']++;\n\n return $tguid;\n}",
"function bbp_insert_reply($reply_data = array(), $reply_meta = array())\n{\n}",
"function invite_answer_message($data)\n\t{\n\t\t$uId_arr = array_unique(explode(',',$data['f_uId_str']));\n\t\t$username = $this->User_data->get_username(array('uId'=>$data['uId']));\n\t\t\n\t\t$send_data = array('uId'=>$data['uId'],'username'=>$username,'f_uId_arr'=>$uId_arr,'nId'=>$data['nId'],'q_text'=>$data['q_text']);\n\t\t$this->invite_answer_message_send($send_data);\n\t}",
"public function testUpdateReply()\n {\n }",
"function fillSentences($sDatabase, $iId, $sMode, $sWordForm, $iWordFormId,\n\t\t $sSelectedSentences, $iUserId,\n\t\t $iNrOfSentencesPerWordform, $iStartAtSentence,\n\t\t $iAmountOfContext, $sSortSentencesBy,\n\t\t $sSortSentencesMode) {\n $iNrOfPrintedSentences = 0;\n $iNrOfNeglectedSentences = 0;\n\n // First, set the last view date/user of the word\n setLastView($iWordFormId, $iUserId);\n\n $aRows = ( $sSortSentencesBy && ($sSortSentencesBy != 'doc')) ? array() : -1;\n // Here we make\n // 'documentId1,startPos1,endPos1|documentId2,startPos2,endPos2|etc...'\n // into a hash so we can look up the combination more easily\n $aSelectedSentences = array_unique(explode('|', $sSelectedSentences));\n\n // getDocumentIdsAndTitles also gives you the start- and end_pos's of the\n // token attestations that have been verified.\n $iSentenceNr = 0;\n $oResult = getDocumentIdsAndTitles($iId, $sMode, $iWordFormId);\n if( $oResult ) {\n // First go through the results once to get all the document id's\n // This is quicker presumably than doing the entire (intricate) query\n // again\n // Also, while we are at it, we calculate the total amount of sentences.\n // This is used when printing the scrollbar of clickable links to\n // next/previous sentences\n $sDocIds = $sSeparator = $sDocIdsForGroupMembers = $sDocIdFGMSep = '';\n $iTotalNrOfSentences = 0;\n while( ($aRow = mysql_fetch_assoc($oResult)) ) {\n // Optimization, only works when not sorting\n if( ($sSortSentencesBy == 'doc') &&\n\t ($iTotalNrOfSentences <= $iStartAtSentence) &&\n\t ( ($iTotalNrOfSentences + $aRow['frequency']) >= $iStartAtSentence)) {\n\t$sDocIdsForGroupMembers .= $sDocIdFGMSep . $aRow['document_id'];\n\t$sDocIdFGMSep = \", \";\n }\n $sDocIds .= $sSeparator . $aRow['document_id'];\n $sSeparator = \", \";\n $iTotalNrOfSentences += $aRow['frequency'];\n }\n\n # In case an error occurred somehow, quit rightaway\n if( ! strlen($sDocIds) ) {\n print \"No documents for '$sWordForm'<br>\\n\";\n return;\n }\n\n mysql_data_seek($oResult, 0); // Put the pointer back\n printLog(\"Doc ids: $sDocIds.\\n\" .\n\t \"Doc ids for group: $sDocIdsForGroupMembers\\n\");\n\n if( $sSortSentencesBy != 'doc') // Set to normal value if we can't optimize\n $sDocIdsForGroupMembers = $sDocIds;\n $aGroupMemberOnsetsPerDocId =\n getGroupMemberOnsetsPerDocId(\n\t\t\t\t $sDocIdsForGroupMembers, $iWordFormId);\n\n while( ($aRow = mysql_fetch_assoc($oResult)) ) {\n if( ($sSortSentencesBy == 'doc') ) {\n\tif( ($iNrOfSentencesPerWordform != 'all') &&\n\t ($iNrOfPrintedSentences == $iNrOfSentencesPerWordform) )\n\t break;\n\tif(($sSortSentencesBy == 'doc') &&\n\t ($iNrOfNeglectedSentences+ $aRow['frequency'])<= $iStartAtSentence){\n\t $iNrOfNeglectedSentences += $aRow['frequency'];\n\t continue;\n\t}\n }\n\n $sDocumentHeader = \"<div class=document>\\n<div class=docTitle>\" .\n\t\"<table width=100% cellpadding=0 cellspacing=0 border=0><tr>\" .\n\t\"<td class=leftCorner> </td>\";\n if( $aRow['image_location'] ) {\n\t// Image location\n\t$sDocumentHeader .= \"<td width=12px align=center>\" .\n\t \"<a href='./php/displayImage.php?sImage=\" .\n\t rawurlencode($aRow['image_location']) . \"&sSize=small' \" .\n\t \"target='_blank'><img src='./img/pic.png' border=0\" .\n\t \" title='Click to see the picture of the page'></a></td>\";\n }\n $sDocumentHeader .=\n\t// Document title/link\n\t\"<td><span class=docTitleCol \" .\n\t\"onMouseOver=\\\"javascript: this.style.cursor = 'pointer'; \" .\n\t\"this.className='docTitleCol_';\\\" \" .\n\t\"onMouseOut=\\\"javascript: this.className='docTitleCol';\\\" \" .\n\t// NOTE that in the next bit we mix up global Javascript variables\n\t// with the ones we have access to in this function.\n\t// This isn't really being consequent of course, but also it doesn't\n\t// matter whatsoever.\n\t\"onClick=\\\"javascript: location.href='./lexiconTool.php?sDatabase=' \"\n\t. \"+ sDatabase + '&iUserId=$iUserId&sUserName=' + sUserName + \" .\n\t\"'&iFileId=\" . $aRow['document_id'] .\n\t\"&sFileName=' + encodeURIComponent('\" . $aRow['title'] . \"') + \" .\n\t\"'&sFilter=' + encodeURIComponent(sFilter) + \" .\n\t\"'&bCaseInsensitivity=' + bCaseInsensitivity + \" .\n\t\"'&sLemmaFilter=' + encodeURIComponent(sLemmaFilter) + \" .\n\t\"'&iNrOfWordFormsPerPage=' + iNrOfWordFormsPerPage + \" .\n\t\"'&iAmountOfContext=' + iAmountOfContext + \" .\n\t\"'&bDoShowAll=' + bDoShowAll + '&bDoShowCorpus=' + bDoShowCorpus + \".\n\t\"'&bDoShowDocument=' + bDoShowDocument;\\\">\" .\n\t// We chop off the document root as it is always the same\n\tsubstr($aRow['title'], strlen($GLOBALS['sDocumentRoot'])+1) .\n\t\"</span></td>\" .\n\t// End of document table and div\n\t\"<td class=rightCorner> </td></tr></table></div>\\n\";\n if( $sSortSentencesBy == 'doc')\n\tprint $sDocumentHeader;\n\n fillSentencesForDoc($sDatabase, $aRow['document_id'], $aRow['title'],\n\t\t\t $aRow['verifiedTokenAtts'],\n\t\t\t $aRow['containsTokenAtts'],\n\t\t\t $sWordForm, $iWordFormId,\n\t\t\t $iUserId, $iSentenceNr, $aSelectedSentences,\n\t\t\t $iNrOfSentencesPerWordform, $iStartAtSentence,\n\t\t\t $iNrOfPrintedSentences, $iNrOfNeglectedSentences,\n\t\t\t $iAmountOfContext,\n\t\t\t $sSortSentencesMode, $sSortSentencesBy, $aRows,\n\t\t\t $sDocumentHeader, $aRow['document_id'],\n\t\t\t $aGroupMemberOnsetsPerDocId,\n\t\t\t rawurlencode($aRow['image_location']) );\n if( $sSortSentencesBy == 'doc')\n\tprint \"</div>\\n\";\n }\n mysql_free_result($oResult);\n }\n\n // Here comes the sorting which is done by some index that we maintained\n // above\n if( $sSortSentencesBy && ($sSortSentencesBy != 'doc') ) {\n if( $sSortSentencesMode == 'asc')\n usort($aRows, 'sortSentences');\n else\n usort($aRows, 'sortSentences_reverse');\n\n $iPreviousDocId = -1;\n $sSentenceClassPostfix = '';\n $iNewSentenceNr = 0;\n $iNrOfNeglectedSentences = $iNrOfPrintedSentences = 0;\n while (list($key, $value) = each($aRows)) {\n // Check if we actually have to print\n if( $iNrOfNeglectedSentences < $iStartAtSentence ) {\n\t$iNrOfNeglectedSentences++;\n\tcontinue;\n }\n if( ($iNrOfPrintedSentences != 'all') &&\n\t ($iNrOfPrintedSentences == $iNrOfSentencesPerWordform) ) {\n\tif( $iPreviousDocId != -1)\n\t print \"</table>\\n</div>\\n\";\n\tbreak;\n }\n\n // Find out if we have to print the document header\n if( $iPreviousDocId != $value['documentId']) {\n\tif( $iPreviousDocId != -1 ) // Close the previous table and div\n\t print \"</table>\\n</div>\\n\"; // but not the very first time\n\n\tprint $value['documentHeader'] .\n\t \"<table width=100% cellspacing=0px border=0>\\n\";\n\t$sSentenceClassPostfix = '';\n }\n\n // Print the row itself.\n // NOTE that re-assign the sentence numbers here, so selecting rows, etc.\n // still works as it should.\n // Also NOTE that we do the sentence classes again (so we keep the nice\n // alternating pattern)\n\n print preg_replace(\"/(id=sentence_|\" .\n\t\t\t \"startSelection\\(|\" .\n\t\t\t \"showTokenAttSuggestions\\(this\\, [0-9]+\\,|\" .\n\t\t\t \"removeTokenAttestation\\(|\" .\n\t\t\t \"toggleGroup\\(this\\, [0-9]+\\, |\" .\n\t\t\t \"addToSelection\\()[0-9]+/\",\n\t\t\t \"$01$iNewSentenceNr\",\n\t\t\t preg_replace(\"/class=sentence_?/\",\n\t\t\t\t \"class=sentence$sSentenceClassPostfix\",\n\t\t\t\t $value['html']));\n $sSentenceClassPostfix = (strlen($sSentenceClassPostfix)) ? '' : '_';\n $iPreviousDocId = $value['documentId'];\n $iNewSentenceNr++;\n $iNrOfPrintedSentences++;\n }\n if( $iPreviousDocId != -1)\n print \"</table>\\n</div>\\n\";\n }\n \n // Now that we are done, print a hidden div that says so, so the javascript\n // can check this\n // NOTE that we give the total nr of sentences as title (so we can use it in\n // javascript to print the scrollbar of clickable links to next/previous\n // sentences)\n print \"<div id=done_$iWordFormId style='visibility: hidden' \".\n \"title=$iTotalNrOfSentences></div>\";\n}",
"public function webhookTelegram() {\n \\Log::info('Chat id ' . json_encode($this->input));\n\n /*\n $keyboard = $parameters = array();\n $keyboard[] = [['category1' => 2, 'category2' => 4]];\n $keyboards[] = $keyboard;\n $parameters['chat_id'] = '283329263';\n $parameters['text'] = 'Cal';\n\n $parameters['reply_markup'] = new ReplyKeyboardMarkup([\n 'keyboard' => $keyboards[0],\n 'resize_keyboard' => true,\n 'one_time_keyboard' => true,\n 'selective' => false\n ]);\n return Request::sendMessage($parameters);\n */\n\n\n //Update array\n $update_array = array(\n 'organization_id' => 1,\n 'channel' => 'telegram',\n 'type' => 'incoming',\n 'update_id' => $this->input['update_id'],\n 'message' => json_encode($this->input['message']),\n 'status' => 1,\n 'created_by' => 1,\n 'updated_by' => 1\n );\n\n //Fields to select\n $fields = array('*');\n\n //Set where clause\n $where_clause = array(\n array(\n 'where' => 'where',\n 'column' => 'update_id',\n 'operator' => '=',\n 'operand' => $this->input['update_id']\n ),\n array(\n 'where' => 'where',\n 'column' => 'channel',\n 'operator' => '=',\n 'operand' => 'telegram'\n )\n );\n\n //Set scope\n $parameters['scope'] = array('statusOne');\n\n //Select update\n $update_model = $this->callController(\\Util::buildNamespace('surveys', 'update', 1), 'select', array($fields, $where_clause, 1, $parameters));\n\n if (!$update_model) {\n //Create update\n $update_model = $this->callController(\\Util::buildNamespace('surveys', 'update', 1), 'createIfValid', array($update_array, true));\n }//E# if statement\n\n if (array_key_exists('entities', $this->input['message']) && $this->input['message']['entities'][0]['type'] == 'bot_command') {\n $this->processCommands();\n } else {\n $this->processAnswer();\n }//E# if statement\n\n return array('chat_id' => $this->input['message']['chat']['id'], 'text' => 'What is your name?');\n }",
"function invite_answer_message_send($data)\n\t{\n\t\t$message_data = $this->invite_answer_message_data();\n\t\t$base = $this->config->item('base_url');\n\t\t$q_link = $base.'question/'.$data['nId'];\n\t\tforeach($data['f_uId_arr'] as $f_uId)\n\t\t{\n\t\t\t$send_data = array('subject'=>$message_data['subject']);\n\t\t\t$f_username = $this->User_data->get_username(array('uId'=>$f_uId));\n\t\t\t$send_data['message_content'] = sprintf($message_data['content'],$f_username,$data['username'],$q_link,$data['q_text']);\n\t\t\t$send_data['from_user_id'] = 0;// system admin\n\t\t\t$send_data['to_user_id'] = $f_uId;\n\t\t\t$send_data['sendType'] = ONLINE;\n\t\t\t$send_data['message_type'] = USER_MESSAGE;\n\t\t\t$this->message_insert($send_data);\n\t\t}\n\t}",
"function hook_user_message_create_answer($m, $answer) {\r\n $answer->subject = 'Reply to: ' . $m->subject;\r\n}",
"function __sendNewReply($data) \n {\n $model_url = \"http://{$_SERVER['HTTP_HOST']}\".$data['url'];\n $modelIfo = $this->Comment->$data['model']->find('first', array('contain'=>array('User'),'conditions'=>array($data['model'].'.id'=>$data['model_id'])));\n $authorInfo = $modelIfo['User'];\n $modelIfo = $modelIfo[$data['model']];\n $respondent = $this->Comment->User->find('first', array('contain'=>array(),'conditions'=>array('User.id'=>$data['user_id'])));\n $respondent = $respondent['User'];\n $comment = $this->Comment->find('first', array('contain'=>array('User'),'conditions'=>array('Comment.id'=>$data['parent_id'])));\n \n if (!empty($modelIfo['title'])) {\n $title = $modelIfo['title'];\n } elseif (!empty($modelIfo['name'])) {\n $title = $modelIfo['name']; \n } else {\n $title = $data['model'];\n }\n \n $result = $this->sendMailMessage(\n 'NewCommentReply', array(\n '{MODEL}' => $data['model']\n ,'{MODEL_ID}' => $data['model_id']\n ,'{MODEL_URL}' => $model_url\n ,'{RESPONDENT_LGN}' => $respondent['lgn']\n ,'{RESPONDENT_USER_LINK}' => \"<a href='http://\".$_SERVER['HTTP_HOST'].\"/users/view/\".$respondent['lgn'].\"'>\".$respondent['lgn'].\"</a>\"\n ,'{COMMENT}' => html_entity_decode($this->convert_bbcode($comment['Comment']['comment']), ENT_QUOTES, 'UTF-8')\n ,'{REPLY}' => html_entity_decode($this->convert_bbcode($data['comment']), ENT_QUOTES, 'UTF-8')\n ,'{MODEL_LINK}' => \"<a href='\".$model_url.\"'>\".$title.\"</a>\"\n ,'{REPLY_LINK}' => \"<a href='\".$model_url.\"?reply_to=\".$data['id'].\"#comment_\".$data['id'].\"'>Reply on this comment</a>\"\n ,'{COMMENT_URL}' => \"{$model_url}#comment_\".$data['parent_id']\n ,'{COMMENT_LINK}'=> \"<a href='\".$model_url.\"#comment_\".$data['parent_id'].\"'>Comment</a>\"\n ),\n $comment['User']['email']\n );\n \n }",
"function bbp_replies()\n{\n}",
"public function createReply();",
"public function generateAnswer(): TelegramMethods;",
"function createConv($data)\n{\n if ($data['type'] == 2) {\n $conv['type'] = 2;\n $conv['name'] = $data['groupname'];\n } else {\n $conv['type'] = 1; //if not 2 the type is equal to 1 (because no other values than 1 or 2 are accepted\n }\n $conv['startdate'] = date(\"Y-m-d H:i:s\", time());\n $idInserted = createOneConversation($conv);\n\n //Add members to the conversation (table \"interact\"):\n $interact1['conversation_id'] = $idInserted;\n $interact2['conversation_id'] = $idInserted;\n\n $interact1['user_id'] = $_SESSION['user']['id'];\n $interact2['user_id'] = $data['user'];\n\n createOneInteract($interact1);\n createOneInteract($interact2);\n\n //Prepare and return the new conversation informations:\n $newConv = getOneConversation($_SESSION['user']['id'], $idInserted);\n $newConv['simpledatetime'] = date(\"d.m.Y H:i\", strtotime($conv['startdate']));\n\n if (empty($newConv)) {\n $error = [\n \"error\" => [\n \"text\" => \"Problème de création ou de lecture de la nouvelle conversation...\"\n ]\n ];\n echo json_encode($error);\n } else {\n echo json_encode($newConv);\n }\n}",
"public static function fetch_grammar_correction($token,$region,$ttslanguage,$passage) {\n global $USER;\n\n //The REST API we are calling\n $functionname = 'local_cpapi_call_ai';\n\n $params = array();\n $params['wstoken'] = $token;\n $params['wsfunction'] = $functionname;\n $params['moodlewsrestformat'] = 'json';\n $params['action'] = 'request_grammar_correction';\n $params['appid'] = constants::M_COMPONENT;\n $params['prompt'] = $passage;\n $params['language'] = $ttslanguage;\n $params['subject'] = 'none';\n $params['region'] = $region;\n $params['owner'] = hash('md5',$USER->username);\n\n //log.debug(params);\n\n $serverurl = self::CLOUDPOODLL . '/webservice/rest/server.php';\n $response = self::curl_fetch($serverurl, $params);\n if (!self::is_json($response)) {\n return false;\n }\n $payloadobject = json_decode($response);\n\n //returnCode > 0 indicates an error\n if (!isset($payloadobject->returnCode) || $payloadobject->returnCode > 0) {\n return false;\n //if all good, then lets do the embed\n } else if ($payloadobject->returnCode === 0) {\n $correction = $payloadobject->returnMessage;\n //clean up the correction a little\n if(\\core_text::strlen($correction) > 0){\n $correction = \\core_text::trim_utf8_bom($correction);\n $charone = substr($correction,0,1);\n if(preg_match('/^[.,:!?;-]/',$charone)){\n $correction = substr($correction,1);\n }\n }\n\n return $correction;\n } else {\n return false;\n }\n }",
"function autoreply($data,$autoreply,$old=null)\n\t{\n\t\tif (is_integer($autoreply['reply_to'])) // Mail from a known user\n\t\t{\n\t\t\tif ($this->notify_current_user)\n\t\t\t{\n\t\t\t\treturn; // Already notified while saving\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->notify_current_user = true; // Ensure send_notification() doesn't fail this check\n\t\t\t}\n\t\t\t$email = $GLOBALS['egw']->accounts->id2name($this->user,'account_email');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->notify_current_user = true; // Ensure send_notification() doesn't fail this check\n\t\t\t$email = $autoreply['reply_to']; // mail from an unknown user (set here, so we need to send a notification)\n\t\t}\n\t\t//error_log(__METHOD__.__LINE__.array2string($autoreply));\n\t\tif ($autoreply['reply_text'])\n\t\t{\n\t\t\t$data['reply_text'] = $autoreply['reply_text'];\n\t\t\t$this->ClearBodyCache();\n\t\t}\n\t\t// Send notification to the creator only; assignee, CC etc have been notified already\n\t\t$this->send_notification($data,$old,$email,(is_integer($autoreply['reply_to'])?$data[$this->creator_field]:$this->get_config('lang',$data)));\n\t}",
"public function run()\n {\n if (DB::table('chatbot_hints')->count() === 0) {\n DB::table('chatbot_hints')->insert([\n ['question' => 'help', 'reply' => $this->getHelpOptions()],\n ['question' => 'help exchange', 'reply' => $this->getHelpExchangeOption()],\n ['question' => 'help login', 'reply' => $this->getHelpLoginOption()],\n ['question' => 'HI||Hello||Hola', 'reply' => 'Hello, how are you.'],\n ['question' => 'How are you', 'reply' => 'Good to see you again!'],\n ['question' => 'what is your name||whats your name', 'reply' => 'My name is MyExchangeBot'],\n ['question' => 'what should I call you', 'reply' => 'You can call me MyExchangeBot'],\n ['question' => 'Where are you from?', 'reply' => 'I am from Brazil'],\n ['question' => 'Bye||See you later||Have a Good Day', 'reply' => 'Sad to see you are going. Have a nice day'],\n ]);\n }\n }",
"function message_replydata_save($data)\n\t {\n\t //print_r($data);\n\t\t$time = date(\"Y-m-d H:i:s\", time());\n\t\t$text = $data['reply_text'];\n\t\t$send_place = $this->session->userdata('location_city');\n\t\t$lang_code = $this->language_translate->check($text);\n\n\t $node_data = array('to_nId'=>$data['node_id'], 'ntId'=>MESSAGE_REPLY, 'time'=>$time, 'text'=>$text, 'stId'=>$data['sendType'], 'sendPlace'=>$send_place, 'langCode'=>$lang_code, 'uId'=>$data['user_id']);\n\t\t$node_id = $this->Content_process->content_insert($node_data);\n\t\treturn $node_id;\n\t }",
"public function insert_comment_reply_like_lookup()\n\t{\t\n\t\t$count = $this->comment_model->insert_comment_reply_like();\n\t}",
"public function run()\n {\n \t$arrQ = array(\n \t\t'Saang lugar ka dapat hindi lumusot(overtake)?',\n \t\t'Ang lisensya ay maaaring ipagamit sa iba?',\n \t\t'Ang sasakyan ay nakaparada(parked) kung?',\n \t\t'Saang lugar hindi maaaraing pumarada?',\n \t\t'Ano ang kahulugan ng kulay pulang ilaw trapiko?',\n \t\t'Ang pagkakaroon ng isang lisensya ay isang?',\n \t\t'Ang dalawang dilaw na linya na tuloy-tuloy ay palatandaan na?'\n \t\t);\n \t$arrC = array(\n \t\tarray(\n \t\t\t'Tama lahat ang sagot',\n \t\t\t'Sa paanan ng tulay',\n \t\t\t'Sa mga sangandaan o interseksyon'\n \t\t\t),\n \t\tarray(\n \t\t\t'Kung may gustong mag aral magmaneho',\n \t\t\t'Kung may biglaang pangyayari o pangangailangan',\n \t\t\t'Hindi pinapayagan kailanman'\n \t\t\t),\n \t\tarray(\n \t\t\t'Nakatigil ng matagal at nagsasakay ng pasahero',\n \t\t\t'Nakatigil ng matagal at nagbababa ng pasahero',\n \t\t\t'nakatigil ng matagal at patay ang makina'\n \t\t\t),\n \t\tarray(\n \t\t\t'Sa nakatakdang paradahan',\n \t\t\t'Sa lugar na tawiran ng tao',\n \t\t\t'Sa isang patunguhang lugar'\n \t\t\t),\n \t\tarray(\n \t\t\t'Huminto at hintayin ang berdeng ilaw',\n \t\t\t'Magpatuloy ang takbo',\n \t\t\t'Magpatakbo ng marahan at magpatuloy kung ligtas'\n \t\t\t),\n \t\tarray(\n \t\t\t'Pribilehiyo',\n \t\t\t'Karapatan',\n \t\t\t'Karangalan'\n \t\t\t),\n \t\tarray(\n \t\t\t'Bawal lumusot kailanman',\n \t\t\t'Maaaring lumusot ng pakanan',\n \t\t\t'Maaaring lumusot ng pakaliwa'\n \t\t\t),\n \t\t);\n\n \tfor($ctr = 0; $ctr < count($arrQ) ;$ctr++){\n DB::table('questions')->insert([\n 'question' => $arrQ[$ctr],\n 'severity' => 0\n ]);\n }\n\n \tfor($ctr = 0; $ctr < count($arrQ) ;$ctr++){\n for($ctr1 = 0; $ctr1 < count($arrC[$ctr]); $ctr1++){\n DB::table('choices')->insert([\n 'question_id' => $ctr+1,\n 'choice' => $arrC[$ctr][$ctr1],\n 'is_correct' => 0\n ]);\n }\n }\n }",
"function feedback() {\n\n }\n\n \n\nfunctionpush_messages() {\n if ($total_messages = db_result(db_query(\"SELECT COUNT(mid) FROM {apple_tools_message}\"))) {\n // There are some messages to send so update queued count.\n apple_tools_set_stats(APPLE_TOOLS_MESSAGE_QUEUED, $total_messages);\n }\n else {\n // No messages to send may as well return.\n return;\n }\n $apps = apple_tools_retrieve_app();\n $message_limit = variable_get('apple_tools_send_message_limit', APPLE_TOOLS_SEND_MESSAGE_LIMIT);\n foreach ($apps as $app) {\n // Get the messages for this application.\n $messages = apple_tools_retrieve_message($app['aid'], APPLE_TOOLS_DEVICE_APP_VALID, $message_limit);\n $status = FALSE;\n // If there are messages to send.\n if (!empty($messages) && apple_tools_check_certificate(apple_tools_get_certificate($app['status'], $app['certificate']))) {\n $opts = array('ssl' => array('local_cert' => apple_tools_get_certificate($app['status'], $app['certificate'])));\n $ctx = stream_context_create($opts);\n // Open the socket.\n if (!$fp = stream_socket_client(apple_tools_get_gateway($app['status']), $error, $error_string, APPLE_TOOLS_SOCKET_TIMEOUT, STREAM_CLIENT_CONNECT, $ctx)) {\n // Delete any messages associated with this app, as the certificate is bad.\n db_query(\"DELETE FROM {apple_tools_message} WHERE aid = %d\", APPLE_TOOLS_MESSAGE_ERROR, $app['aid']);\n watchdog(APPLE_TOOLS_WATCHDOG, 'Failed to connect to APNS server @server using @cert: @error @error_string.', array('@error' => $error, '@error_string' => $error_string, '@server' => apple_tools_get_gateway($app['status']), '@cert' => apple_tools_get_certificate($app['status'], $app['certificate'])));\n return NULL;\n }\n else {\n // Whilst we have messages for this app send them across in packets.\n // Limit the number of times this can run, to ensure it does not runaway.\n $loops_left = variable_get('apple_tools_send_message_loop_limit', APPLE_TOOLS_SEND_MESSAGE_LOOP_LIMIT);\n do {\n $payload = '';\n foreach ($messages as $message) {\n $payload .= chr(0) . pack(\"n\", 32) . pack('H*', $message['token']) . pack(\"n\", drupal_strlen($message['message'])) . $message['message'];\n }\n // Send the messages we have.\n if (!empty($payload)) {\n $fwrite = fwrite($fp, $payload);\n if (!$fwrite) {\n watchdog(APPLE_TOOLS_WATCHDOG, 'Failed to write to stream');\n apple_tools_push_message_failed($messages);\n }\n else {\n watchdog(APPLE_TOOLS_WATCHDOG, 'Wrote to apple with status: @status', array('@status' => $fwrite));\n apple_tools_push_message_success($messages);\n }\n }\n }\n // Perform this loop whilst we are under the loop limit and\n // the flag that lets us do this is true (apple_tools_flush_messages) and\n // we retrieve new messages for this app_id that have not yet been sent.\n while (\n --$loops_left > 0 &&\n variable_get('apple_tools_flush_messages', FALSE) == FALSE &&\n $messages = apple_tools_retrieve_message($app['aid'], APPLE_TOOLS_DEVICE_APP_VALID, $message_limit)\n );\n }\n // Close the connection for this app.\n fclose($fp);\n }\n else {\n if (empty($messages)) {\n watchdog(APPLE_TOOLS_WATCHDOG, 'No messages ready in the queue to be sent to apple for app [@aid]', array('@aid' => $app['aid']));\n }\n else {\n watchdog(APPLE_TOOLS_WATCHDOG, 'Sending messages for app [@aid] failed due to certificate check [@certificate] failure', array('@aid' => $app['aid'], '@certificate' => $app['certificate']));\n }\n }\n }\n}",
"public function run()\n {\n \n $r1 = [\n \t'user_id' => 1,\n \t'discussions_id' => 1,\n \t'content' => 'Nisl cras mi accumsan ac praesent tempor nec egestas magnis hac elit nisi tempus vestibulum non ultricies in blandit neque taciti euismod condimentum consectetur venenatis morbi condimentum morbi dictum.'\n ];\n\n $r2 = [\n \t'user_id' => 1,\n \t'discussions_id' => 2,\n \t'content' => 'Nisl cras mi accumsan ac praesent tempor nec egestas magnis hac elit nisi tempus vestibulum non ultricies in blandit neque taciti euismod condimentum consectetur venenatis morbi condimentum morbi dictum.'\n ];\n\n $r3 = [\n \t'user_id' => 2,\n \t'discussions_id' => 3,\n \t'content' => 'Nisl cras mi accumsan ac praesent tempor nec egestas magnis hac elit nisi tempus vestibulum non ultricies in blandit neque taciti euismod condimentum consectetur venenatis morbi condimentum morbi dictum.'\n ];\n\n $r4 = [\n \t'user_id' => 1,\n \t'discussions_id' => 4,\n \t'content' => 'Nisl cras mi accumsan ac praesent tempor nec egestas magnis hac elit nisi tempus vestibulum non ultricies in blandit neque taciti euismod condimentum consectetur venenatis morbi condimentum morbi dictum.'\n ];\n\n Reply::create($r1);\n Reply::create($r2);\n Reply::create($r3);\n Reply::create($r4);\n\n }"
] | [
"0.563265",
"0.55951583",
"0.5578207",
"0.555514",
"0.5521992",
"0.53715026",
"0.5360271",
"0.5350233",
"0.53258055",
"0.5269138",
"0.5198404",
"0.5196205",
"0.5195982",
"0.5162655",
"0.5129011",
"0.51132286",
"0.50876373",
"0.50652933",
"0.5043965",
"0.49827355",
"0.49731398",
"0.496916",
"0.49682078",
"0.49612603",
"0.49351242",
"0.49332464",
"0.49325395",
"0.49223253",
"0.49205863",
"0.49173707"
] | 0.5953065 | 0 |
/ GOOGLE 1. Detect the language of a string 2. Retrieve the full language name in the desired language 4. Text translation 5. Analyze Entities | function sb_google_language_detection($string, $token = false) {
if (!strpos(trim($string), ' ')) return false;
$token = $token ? $token : sb_dialogflow_get_token();
$query = json_encode(['q' => $string]);
$response = sb_curl('https://translation.googleapis.com/language/translate/v2/detect', $query, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $token, 'Content-Length: ' . strlen($query)]);
return isset($response['data']) ? $response['data']['detections'][0][0]['language'] : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTransLang();",
"function __t($key = null, $replace = [], $locale = null)\n{\n $segments = explode('.', $key);\n\n if (is_null($key) || count($segments) != 2) {\n\n return $key;\n }\n\n $group = $segments[0];\n $sourceText = $segments[1];\n\n $trans = __($key, $replace, $locale);\n\n //set the Langs \n\n $sourceLang = 'en'; // auto \n\n $targetLang = $locale ?? app()->getLocale() ?? 'ar';\n $locale = $targetLang;\n\n\n $langPath = app()->langPath();\n $localeFileCheck = $langPath . '/' . $locale . '/' . $group . '.php';\n \n try {\n $transfilecheck = include($localeFileCheck);\n $TransCheckExist = array_key_exists($sourceText, $transfilecheck); \n } catch (\\Throwable $th) {\n $TransCheckExist = false;\n }\n\n\n if ($trans != $key && $TransCheckExist) {\n return $trans;\n }\n \n\n\n try {\n\n //call the google tranlate to get trans word with curl call\n $client = new GuzzleHttp\\Client();\n\n $url = \"https://translate.googleapis.com/translate_a/single?client=gtx&sl=\"\n . $sourceLang . \"&tl=\" . $targetLang . \"&dt=t&q=\" . $sourceText;\n\n\n $res = $client->request('GET', $url);\n $status = $res->getStatusCode();\n // \"200\"\n $header = $res->getHeader('content-type')[0];\n // 'application/json; charset=utf8'\n $body = $res->getBody();\n\n if ($status != 200) {\n throw new Exception(\"Error in google translate api call\");\n }\n\n $body = json_decode($body, true);\n $translatedText = $body[0][0][0];\n\n\n //write result tranlation to the language file in laravel\n $langPath = app()->langPath();\n\n $EnFile['Path'] = $langPath . '/en/' . $group . '.php';\n $localeFile['Path'] = $langPath . '/' . $locale . '/' . $group . '.php';\n $EnFile['Msg'] = \"'\" . $sourceText . \"'\" . \"=>\" . \"'\" . $sourceText . \"'\" . \",\";\n $localeFile['Msg'] = \"'\" . $sourceText . \"'\" . \"=>\" . \"'\" . $translatedText . \"'\" . \",\";\n\n\n\n $transFiles = [$localeFile];\n if ($locale != \"en\") {\n $transFiles[] = $EnFile;\n }\n\n\n foreach ($transFiles as $file) {\n\n $path = $file['Path'];\n $msg = $file['Msg'];\n\n $parts = explode('/', $path);\n $file = array_pop($parts);\n\n $dir = '';\n foreach ($parts as $part) {\n if (!is_dir($dir .= \"/$part\")) mkdir($dir);\n }\n\n $path = \"$dir/$file\";\n if (!file_exists($path)) {\n $dummyContent = \"<?php return [ ];\"; // Some simple example content.\n file_put_contents($path, $dummyContent); // Save our content to the file.\n }\n\n //wite to the en file\n $FileContent = file_get_contents($path);\n\n //find \"];\"\n $startpos = strpos($FileContent, \"[\");\n $endpos = strpos($FileContent, \"];\") ;\n\n \n\n $NewFileContent = \"<?php return [\" . \" \" .PHP_EOL;\n $NewFileContent .= substr($FileContent, $startpos +1 , $endpos - ($startpos + 1));\n $NewFileContent .= PHP_EOL . \" \" . $msg . \" \" . PHP_EOL;\n $NewFileContent .= PHP_EOL . \" \" . \"];\";\n\n\n file_put_contents($path, $NewFileContent);\n\n }\n\n return $translatedText; \n\n } catch (Exception $e) {\n Log::error(\"Error in translate the word : \" . $key . \" \", ['Message' => $e->getMessage()]);\n return $trans;\n }\n}",
"public function translate()\n {\n $content = \\request('content') . \\request('lastHit');\n return $this->translator->translate(\\request('language'), $content);\n }",
"function ah_get_language_string(){\n\tglobal $request;\n\t\n\theader(\"Content-Type: text/plain\");\n\t\n\tif(isset($request[\"str\"])){\n\t\t$str=$request[\"str\"];\n\t\tif(is_array($str)){\n\t\t\tforeach($str as $s){\n\t\t\t\tah_get_language_string2($s);\n\t\t\t\t}\n\t\t\t}\n\t\telse{\n\t\t\t$strs=explode(\",\",$str);\n\t\t\tforeach($strs as $s){\n\t\t\t\tah_get_language_string2($s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\telse\n\t\techo \"?\\n\";\n\t}",
"function get($string) {\n\t\t\thelper::debugPrint(\"Get: $string in \".self::$instance->getLanguageCode(),\"language\");\n\t\t\tif(is_null($string))\n\t\t\t\treturn NULL;\n\t\t\tif($string==\"\")\n\t\t\t\treturn \"\";\n\t\t\tif($string==' ' || self::$instance->getLanguageCode()=='en') {\n\t\t\t\thelper::debugPrint('Empty or english',\"language\");\n\t\t\t\treturn str_replace('_',' ',$string);\n\t\t\t}\n\t\t\tif(isset(self::$instance->strings[$string])) {\n\t\t\t\thelper::debugPrint('Found',\"language\");\n\t\t\t\treturn str_replace('_',' ',self::$instance->strings[$string]);\n\t\t\t}\n\t\t\telseif(isset(self::$instance->strings[str_replace(' ','_',$string)])) {\n\t\t\t\thelper::debugPrint('Found with _',\"language\");\n\t\t\t\treturn str_replace('_',' ',self::$instance->strings[str_replace(' ','_',$string)]);\t\n\t\t\t}\t\t\t\n\t\t\telse {\n\t\t\t\thelper::debugPrint('Word for word',\"language\");\n\t\t\t\t$words=explode(' ',$string);\n\t\t\t\t$trans=array();\n\t\t\t\t$allwords=true;\n\t\t\t\tforeach($words as $word) {\n\t\t\t\t\tif(isset(self::$instance->strings[$word])) {\n\t\t\t\t\t\t$trans[]=self::$instance->strings[$word];\n\t\t\t\t\t} elseif(isset(self::$instance->strings[ucfirst($word)])) {\t\t\t\t//Look for word with uppercased first letter\n\t\t\t\t\t\t$trans[]=strtolower(self::$instance->strings[ucfirst($word)]);\t\n\t\t\t\t\t} elseif(substr($word,strlen($word)-1,1)==',') {\t\t\t\t//Attempt to strip commas in the end of the word and translate it\n\t\t\t\t\t\t$trans[]=self::$instance->get(substr($word,0,strlen($word)-1)) . ',';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$allwords=false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($allwords) {\n\t\t\t\t\treturn implode(' ',$trans);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn self::$instance->googleTranslate(str_replace('_',' ',$string));\n\t\t\t}\n\t\t}",
"function analyze_entities($text,$id) {\n\n$language = new LanguageClient([\n 'projectId' => $projectId\n]);\n\n\n$annotation = $language->analyzeEntities($text);\n$entities = $annotation->entities();\n\nforeach ($entities as $entity) {\n printf($entity['name']);\n printf(\",\");\n $temp = $temp. \",\" . $entity['name'];\n\n }\n printf(\"\\n\");\n $temp = substr($temp,1);\n return $temp;\n \n\n}",
"function old_translateText_2($sourceText, $fromLanguage, $toLanguage) {\n\t\t$upload_dir = wp_upload_dir ();\n\t\t$tmpFileUri = $upload_dir ['basedir'] . '/wp_automatic_tmp.txt';\n\t\t$tmpHandle = fopen ( $tmpFileUri, \"w+\" );\n\t\tfwrite ( $tmpHandle, $sourceText );\n\t\t\n\t\t$translation_file_url = $upload_dir ['baseurl'] . '/wp_automatic_tmp.txt';\n\t\t\n\t\techo '<br>Translation file URL' . $translation_file_url;\n\t\t\n\t\t// test on localhost\n\t\t// $translation_file_url = 'https://deandev.com/files/wp_automatic_tmp.txt';\n\t\t\n\t\t$url = \"https://translate.google.com/translate?hl=en&ie=UTF8&prev=_t&sl=$fromLanguage&tl=$toLanguage&u=\" . urlencode ( $translation_file_url );\n\t\t\n\t\t// Translate a url\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $url ) );\n\t\t\n\t\t$exec = curl_exec ( $this->ch );\n\t\t$x = curl_error ( $this->ch );\n\t\t\n\t\t// Extract iframe url _p\n\t\tpreg_match ( '{(https://translate.googleusercontent.com.*?)\"}', $exec, $translateUrls );\n\t\t$translateUrl = $translateUrls [1];\n\t\t\n\t\t// Validate _p url\n\t\tif (! stristr ( $translateUrl, '_p' )) {\n\t\t\tthrow new Exception ( '_p url can not be extracted' );\n\t\t}\n\t\t\n\t\t// process _p url\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $translateUrl ) );\n\t\t\n\t\t$exec = curl_exec ( $this->ch );\n\t\t$x = curl_error ( $this->ch );\n\t\t\n\t\t// Extract _c url\n\t\tpreg_match ( '{URL=(.*?)\"}', $exec, $translateUrls2 );\n\t\t$translateUrl2 = html_entity_decode ( $translateUrls2 [1] );\n\t\t\n\t\t// Validate _c url\n\t\tif (! stristr ( $translateUrl2, '_c' )) {\n\t\t\tthrow new Exception ( '_c url can not be extracted' );\n\t\t}\n\t\t\n\t\t// process _c url\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $translateUrl2 ) );\n\t\t$exec = curl_exec ( $this->ch );\n\t\t\n\t\t// validate final content\n\t\tif (trim ( $exec ) == '') {\n\t\t\tthrow new Exception ( '_c url returned empty response' );\n\t\t}\n\t\t\n\t\t// clean content\n\t\t$exec = preg_replace ( '{<span class=\"google-src-text.*?>.*?</span>}', \"\", $exec );\n\t\t$exec = preg_replace ( '{<span class=\"notranslate.*?>(.*?)</span>}', \"$1\", $exec );\n\t\t$exec = str_replace ( ' style=\";text-align:left;direction:ltr\"', '', $exec );\n\t\t\n\t\t// Return result\n\t\treturn $exec;\n\t}",
"public function getTranslationLanguage();",
"function GetDesc($lang){\ndebug(\"$lang:\".strstr($lang,\"_\"));\nif(strstr($lang,\"_\") !== false )\n $exlang=explode('_',$lang);\nelse\n $exlang=explode('-',$lang);\ndebug(print_r($exlang,true));\n$desc=\"\";\nforeach($exlang as $key => $langtag){\n global $iana_languages,$iana_regions,$iana_variants;\n #first is language, or error\n if($key==0 && array_key_exists(strtolower($langtag),$iana_languages)){\n $langname=$iana_languages[strtolower($langtag)]['Description'];\n debug(\"language name found: $langname\");\n $desc=$langname;\n continue;\n }\n\n debug(\"$key => $langtag\");\n if(array_key_exists(strtoupper($langtag),$iana_regions)){\n $langregion=$iana_regions[strtoupper($langtag)]['Description'];\n debug(\"REGION name found: $langregion\");\n $desc.=\" from \".$langregion;\n continue;\n }\n\n if(array_key_exists(strtolower($langtag),$iana_variants)){\n $langvariant=$iana_variants[strtolower($langtag)]['Description'];\n debug(\"variant name found: $langvariant\");\n $desc.=\" \".$langvariant;\n continue;\n }\n\n}\nreturn $desc;\n}",
"static function translate($text,$from,$to) {\n\t\t$result=json_decode(\n\t\t\tNet::http(\n\t\t\t\t'GET http://ajax.googleapis.com/'.\n\t\t\t\t\t'ajax/services/language/translate',\n\t\t\t\thttp_build_query(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'v'=>'1.0',\n\t\t\t\t\t\t'q'=>$text,\n\t\t\t\t\t\t'langpair'=>$from.'|'.$to\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\tTRUE\n\t\t);\n\t\tif (is_null($result['responseData'])) {\n\t\t\ttrigger_error($result['responseDetails']);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn $result['responseData']['translatedText'];\n\t}",
"public function translate() {\n\n\t\t$rest = \"http://translate.google.com/translate_t?text=\" . urlencode($this->text) . \"&langpair=$this->from|$this->to\";\n\n $f = file($rest);\n\n foreach($f as $v) {\n\n if(strstr($v,'<textarea')) {\n\n $x = strstr($v,'<textarea');\n }\n }\n\n $arr = explode(\"</textarea>\",$x);\n\n $arr = explode('id=suggestion>',$arr[1]);\n\n return $arr[1];\n\n }",
"public function getLanguage ();",
"function ut_main()\n{\n $res_str = '';\n\n $locales = array(\n\t\t\"de_DE@currency=EUR;collation=PHONEBOOK\",\n 'uk-ua_CALIFORNIA@currency=GRN'\n\t);\n\n $locales = array(\n\t'de_DE@currency=EUR;collation=PHONEBOOK',\n 'root',\n 'uk@currency=EURO',\n 'Hindi',\n//Simple language subtag\n 'de',\n 'fr',\n 'ja',\n 'i-enochian', //(example of a grandfathered tag)\n//Language subtag plus Script subtag:\n 'zh-Hant',\n 'zh-Hans',\n 'sr-Cyrl',\n 'sr-Latn',\n//Language-Script-Region\n 'zh-Hans-CN',\n 'sr-Latn-CS',\n//Language-Variant\n 'sl-rozaj',\n 'sl-nedis',\n//Language-Region-Variant\n 'de-CH-1901',\n 'sl-IT-nedis',\n//Language-Script-Region-Variant\n 'sl-Latn-IT-nedis',\n//Language-Region:\n 'de-DE',\n 'en-US',\n 'es-419',\n//Private use subtags:\n 'de-CH-x-phonebk',\n 'az-Arab-x-AZE-derbend',\n//Extended language subtags\n 'zh-min',\n 'zh-min-nan-Hant-CN',\n//Private use registry values\n 'x-whatever',\n 'qaa-Qaaa-QM-x-southern',\n 'sr-Latn-QM',\n 'sr-Qaaa-CS',\n/*Tags that use extensions (examples ONLY: extensions MUST be defined\n by revision or update to this document or by RFC): */\n 'en-US-u-islamCal',\n 'zh-CN-a-myExt-x-private',\n 'en-a-myExt-b-another',\n//Some Invalid Tags:\n 'de-419-DE',\n 'a-DE',\n 'ar-a-aaa-b-bbb-a-ccc'\n );\n\n $res_str = '';\n\n foreach( $locales as $locale )\n {\n $keywords_arr = ut_loc_get_keywords( $locale);\n $res_str .= \"$locale: \";\n\t\tif( $keywords_arr){\n\t\t\tforeach( $keywords_arr as $key => $value){\n \t\t\t$res_str .= \"Key is $key and Value is $value \\n\";\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$res_str .= \"No keywords found.\";\n\t\t}\n $res_str .= \"\\n\";\n }\n\n $res_str .= \"\\n\";\n return $res_str;\n\n}",
"function translate() {}",
"public function getTargetLanguage(): string;",
"public function ldv_boilerplate_translations( $lang = 'en_US'){\r\n \r\n $availableLanguages = array(\r\n 'en_US' => array(\r\n 'title' => 'Write your review',\r\n 'post_content' => 'We love hearing from our customers and we\\'d love to hear from you too. Please enter your review below',\r\n 'display_credit' => 'Powered by <a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice Reviews</a> and <a href=\"http://www.louderyou.com/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'en_GB' => array(\r\n 'title' => 'Write your review',\r\n 'post_content' => 'We love hearing from our customers and we\\'d love to hear from you too. Please enter your review below',\r\n 'display_credit' => 'Powered by <a href=\"http://loudervoice.co.uk/\" target=\"_blank\">LouderVoice UK Reviews</a>'\r\n ),\r\n 'en_IE' => array(\r\n 'title' => 'Write your review',\r\n 'post_content' => 'We love hearing from our customers and we\\'d love to hear from you too. Please enter your review below',\r\n 'display_credit' => 'Powered by <a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice Reviews</a> and <a href=\"http://www.louderyou.ie/\" target=\"_blank\">LouderYou Ireland</a>'\r\n ),\r\n 'fr_FR' => array(\r\n 'title' => 'Écrire votre avis',\r\n 'post_content' => 'Votre opinion en tant que client nous intéresse énormément. S\\'il vous plait, écrivez votre avis ci-dessous',\r\n 'display_credit' => '<a href=\"http://fr.loudervoice.com/\" target=\"_blank\">LouderVoice France</a>'\r\n ),\r\n 'fr_CH' => array(\r\n 'title' => 'Écrire votre avis',\r\n 'post_content' => 'Votre opinion en tant que client nous intéresse énormément. S\\'il vous plait, écrivez votre avis ci-dessous',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> et <a href=\"http://www.louderyou.ch/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'fr_CA' => array(\r\n 'title' => 'Écrire votre avis',\r\n 'post_content' => 'Votre opinion en tant que client nous intéresse énormément. S\\'il vous plait, écrivez votre avis ci-dessous',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> et <a href=\"http://www.louderyou.com/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'es_ES' => array(\r\n 'title' => 'Escribe tu opinión',\r\n 'post_content' => 'Nos encanta escuchar a nuestros clientes y nos encantaría saber de usted también. Por favor, introduzca sus comentarios a continuación',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> y <a href=\"http://www.louderyou.es/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'es_MX' => array(\r\n 'title' => 'Escribe tu opinión',\r\n 'post_content' => 'Nos encanta escuchar a nuestros clientes y nos encantaría saber de usted también. Por favor, introduzca sus comentarios a continuación',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> y <a href=\"http://www.louderyou.com/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'it_IT' => array(\r\n 'title' => 'Scrivi tua recensione',\r\n 'post_content' => 'Ci piace sentire dai nostri clienti e ci piacerebbe sentire anche da te. Inserisci il tuo recensioni qui sotto',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> e <a href=\"http://www.louderyou.it/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'de_DE' => array(\r\n 'title' => 'Eine meinung schreiben',\r\n 'post_content' => 'Wir hören gerne von unseren Kunden und wir würden uns freuen von Ihnen zu hören auch. Bitte geben Sie Ihren Beitrag unten',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> und <a href=\"http://www.louderyou.de/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'de_CH' => array(\r\n 'title' => 'Eine meinung schreiben',\r\n 'post_content' => 'Wir hören gerne von unseren Kunden und wir würden uns freuen von Ihnen zu hören auch. Bitte geben Sie Ihren Beitrag unten',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> und <a href=\"http://www.louderyou.ch/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'ru_RU' => array(\r\n 'title' => 'Напишите ваш отзыв',\r\n 'post_content' => 'Мы любим слышать от наших клиентов, и мы хотели бы услышать от вас. Пожалуйста, введите свой отзыв',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> and <a href=\"http://www.louderyou.com/\" target=\"_blank\">LouderYou</a>'\r\n ),\r\n 'pt_PT' => array(\r\n 'title' => 'Escreva seu comentário',\r\n 'post_content' => 'Nós adoramos ouvir de nossos clientes e nós adoraríamos ouvir de você também. Digite seu comentário abaixo',\r\n 'display_credit' => '<a href=\"http://www.loudervoice.com/\" target=\"_blank\">LouderVoice</a> and <a href=\"http://www.louderyou.com/\" target=\"_blank\">LouderYou</a>'\r\n ) \r\n );\r\n \r\n if( !empty( $lang) && array_key_exists( $lang, $availableLanguages)){\r\n return $availableLanguages[ $lang ];\r\n }\r\n \r\n return $availableLanguages['en_US'];\r\n }",
"function InitializeLanguages() {\r\n // Languages as a string separated by ',' while the different translations are separated as follows: English|Bulgarian\r\n\r\n $languages = \"Afrikaans|африкански,Albanian|албански,Arabic|арабски,Azerbaijani|азерски,Basque|баски,Belarusian|беларуски,Bengali|бенгалски,Bosnian|босненски,Bulgarian|български,Cantonese|кантонски,Catalan|каталонски,Chinese|китайски,Croatian|хърватски,Czech|чешки,Danish|датски,Dutch|холандски,English|английски,Estonian|естонски,Filipino|филипински,Finnish|фински,French|френски,Georgian|грузински,German|немски,Greek|гръцки,Gujarati|гуджаратски,Hebrew|иврит,Hindi|хинди,Hungarian|унгарски,Icelandic|исландски,Indonesian|индонезийски,Irish|ирландски,Italian|италиански,Japanese|японски,Kazakh|казахски,Cambodian|камбоджански,Korean|корейски,Lao|лаоски,Latin|латински,Latvian|латвийски,Lithuanian|литовски,Malay|малайски,Marathi|маратхи,Mongolian|монголски,Nepali|непалски,Norwegian|норвежки,Pashto|пущунски,Persian|персийски,Polish|полски,Portuguese|португалски,Punjabi|панджаби,Romanian|румънски,Russian|руски,Scottish|шотландски,Serbian|сръбски,Slovak|словашки,Slovenian|словенски,Somali|сомалийски,Spanish|испански,Swahili|суахили,Swedish|шведски,Tagalog|тагалски,Tamil|тамилски,Telugu|телугу,Thai|тайвански,Turkish|турски,Ukrainian|украински,Urdu|урду,Uzbek|узбекски,Vietnamese|виетнамски,Welsh|уелски,Zulu|зулу\";\r\n\r\n $arr = explode(',', $languages);\r\n\r\n // Loop through the capture groups and add them to the DB\r\n $i = 0;\r\n foreach ($arr as $value) {\r\n $row['type_id'] = 3;\r\n $row['item_id'] = $i;\r\n $language = explode('|', $value);\r\n $row['en'] = $language[0];\r\n $row['bg'] = $language[1];\r\n AddTranslation($row);\r\n $i++;\r\n }\r\n\r\n}",
"function old_translateText_1($sourceText, $fromLanguage, $toLanguage) {\n\t\t\n\t\t// saving the content to a temp file\n\t\tif (trim ( ini_get ( 'open_basedir' ) ) != '') {\n\t\t\t\n\t\t\techo '<br>open_basedir exists';\n\t\t\t$upload_dir = wp_upload_dir ();\n\t\t\t$tmpFileUri = $upload_dir ['basedir'] . '/wp_automatic_tmp';\n\t\t\t$tmpHandle = fopen ( $tmpFileUri, \"w+\" );\n\t\t\tfwrite ( $tmpHandle, $sourceText );\n\t\t} else {\n\t\t\t\n\t\t\t$tmpHandle = tmpfile ();\n\t\t\t$metaDatas = stream_get_meta_data ( $tmpHandle );\n\t\t\t$tmpFileUri = $metaDatas ['uri'];\n\t\t\t\n\t\t\tfwrite ( $tmpHandle, $sourceText );\n\t\t}\n\t\t\n\t\t// translate file url\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, \"https://translate.googleusercontent.com/translate_f\" );\n\t\tcurl_setopt ( $this->ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_POST, true );\n\t\t\n\t\tif (class_exists ( 'CurlFile' )) {\n\t\t\t$curlFile = new \\CurlFile ( $tmpFileUri, 'text/plain', 'test.txt' );\n\t\t} else {\n\t\t\t$curlFile = '@' . $tmpFileUri . ';type=text/plain;filename=test.txt';\n\t\t}\n\t\t\n\t\t$post = [ \n\t\t\t\t'file' => $curlFile,\n\t\t\t\t'sl' => $fromLanguage,\n\t\t\t\t'tl' => $toLanguage,\n\t\t\t\t'js' => 'y',\n\t\t\t\t'prev' => '_t',\n\t\t\t\t'hl' => 'en',\n\t\t\t\t'ie' => 'UTF-8' \n\t\t\n\t\t];\n\t\t\n\t\tcurl_setopt ( $this->ch, CURLOPT_POSTFIELDS, $post );\n\t\t\n\t\t$headers = array ();\n\t\t$headers [] = \"User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0\";\n\t\t$headers [] = \"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.2878.95 Safari/537.36\";\n\t\t\n\t\t$headers [] = \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\";\n\t\t$headers [] = \"Accept-Language: en-US,en;q=0.5\";\n\t\t$headers [] = \"Referer: https://translate.google.com/?tr=f&hl=en\";\n\t\t$headers [] = \"Connection: keep-alive\";\n\t\t$headers [] = \"Upgrade-Insecure-Requests: 1\";\n\t\t\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPHEADER, $headers );\n\t\t\n\t\t$exec = curl_exec ( $this->ch );\n\t\t\n\t\t$x = curl_error ( $this->ch );\n\t\t\n\t\t// close and delete temp file\n\t\tfclose ( $tmpHandle );\n\t\t\n\t\t// Empty response check\n\t\tif (trim ( $exec ) == '') {\n\t\t\tthrow new Exception ( 'Empty translator reply with possible curl error ' . $x );\n\t\t}\n\t\t\n\t\t// Validate response result box\n\t\tif (stristr ( $exec, 'Error 403' )) {\n\t\t\techo $exec;\n\t\t\tthrow new Exception ( 'Error 403 from Google' );\n\t\t}\n\t\t\n\t\t// extra <pre removal fix\n\t\t$exec = str_replace ( '<pre>', '', $exec );\n\t\t$exec = str_replace ( '</pre>', '', $exec );\n\t\t\n\t\treturn $exec;\n\t}",
"function _translate($text) {\n\t\t$this->_loadLocalLang();\n\t\t$pattern = $this->translationPattern . 'e';\n\t\treturn preg_replace($pattern, '$this->_getLocalLang(\\'$1\\')', $text);\n\t}",
"function analyze_entities($text)\r\n{\r\n // Create the Natural Language client\r\n $language = new LanguageClient([\r\n 'projectId' => $google_project_id,\r\n ]);\r\n\r\n // Call the analyzeEntities function\r\n $annotation = $language->analyzeEntities($text);\r\n\r\n // Print out information about each entity\r\n $entities = $annotation->entities();\r\n\t$names = array();\r\n\t\r\n foreach ($entities as $entity) {\r\n $names[] = $entity['name'];\r\n }\r\n\t\r\n\treturn $names;\r\n}",
"public function getInLanguage(): ?string;",
"function translateMessage($source,$target,$msg){\n require_once ('../googleTranslate/vendor/autoload.php');\n $trans = new GoogleTranslate();\n\n $source = htmlspecialchars($source);\n $target = htmlspecialchars($target);\n $text = htmlspecialchars($msg);\n\n $result = $trans->translate($source, $target, $text);\n\n\n\n if (isset($text)) {\n return ucfirst($result);\n }else{\n return \"Hata kodu TRANSLATE01\";\n }\n\n \n}",
"public function getTranslator();",
"public function getTranslator();",
"public function translate($text);",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"function detect_language($text)\n{\n\tglobal $DOCROOT;\n\t$script = dirname($DOCROOT) . '/cgi-bin/cld.exe \"' . $text . '\"';\n\texec($script, $resp);\n\t\n\t$lang = $resp[0];\n\t\n\treturn $lang;\n}"
] | [
"0.65962684",
"0.65452397",
"0.6504916",
"0.64976156",
"0.64414734",
"0.6378704",
"0.6366772",
"0.63517934",
"0.6321185",
"0.6303593",
"0.61992323",
"0.6197027",
"0.61945605",
"0.6178382",
"0.61614656",
"0.61585635",
"0.614223",
"0.61383766",
"0.6122098",
"0.61092407",
"0.6106828",
"0.6093249",
"0.60887915",
"0.60887915",
"0.60853964",
"0.6078887",
"0.6078887",
"0.6078887",
"0.6078887",
"0.6070667"
] | 0.6926022 | 0 |
/ DIALOGFLOW INTENT BOX Display the form to create a new intent for Dialogflow | function sb_dialogflow_intent_box() { ?>
<div class="sb-lightbox sb-dialogflow-intent-box">
<div class="sb-info"></div>
<div class="sb-top-bar">
<div>Dialogflow Intent</div>
<div>
<a class="sb-send sb-btn sb-icon">
<i class="sb-icon-check"></i><?php sb_e('Send') ?> Intent
</a>
<a class="sb-close sb-btn-icon">
<i class="sb-icon-close"></i>
</a>
</div>
</div>
<div class="sb-main sb-scroll-area">
<div class="sb-title sb-intent-add">
<?php sb_e('Add user expressions') ?>
<i data-value="add" data-sb-tooltip="<?php sb_e('Add expression') ?>" class="sb-btn-icon sb-icon-plus"></i>
<i data-value="previous" class="sb-btn-icon sb-icon-arrow-up"></i>
<i data-value="next" class="sb-btn-icon sb-icon-arrow-down"></i>
</div>
<div class="sb-input-setting sb-type-text sb-first">
<input type="text" />
</div>
<div class="sb-title">
<?php sb_e('Response from the bot') ?>
</div>
<div class="sb-input-setting sb-type-textarea">
<textarea></textarea>
</div>
<div class="sb-title">
<?php sb_e('Language') ?>
</div>
<?php echo sb_dialogflow_languages_list() ?>
<div class="sb-title sb-title-search">
<?php sb_e('Intent') ?>
<i id="sb-intent-preview" data-sb-tooltip="<?php sb_e('Preview') ?>" class="sb-icon-help"></i>
<div class="sb-search-btn">
<i class="sb-icon sb-icon-search"></i>
<input type="text" autocomplete="false" placeholder="<?php sb_e('Search for Intents...') ?>">
</div>
</div>
<div class="sb-input-setting sb-type-select">
<select id="sb-intents-select">
<option value=""><?php sb_e('New Intent') ?></option>
</select>
</div>
</div>
</div>
<?php } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sb_dialogflow_create_intent($training_phrases, $bot_response, $language = '', $conversation_id = false) {\n $training_phrases_api = [];\n for ($i = 0; $i < count($training_phrases); $i++) {\n array_push($training_phrases_api, [ 'type' => 'TYPE_UNSPECIFIED', 'parts' => [ 'text' => $training_phrases[$i]], 'repeatCount' => 1]);\n }\n $response = sb_dialogflow_curl('/agent/intents', ['displayName' => sb_string_slug(strlen($training_phrases[0]) > 100 ? substr($training_phrases[0], 0, 99) : $training_phrases[0]), 'priority' => 500000, 'webhookState' => 'WEBHOOK_STATE_UNSPECIFIED', 'trainingPhrases' => $training_phrases_api, 'messages' => [['text' => ['text' => $bot_response]]]], $language);\n if (sb_get_setting('dialogflow-edition') == 'cx') {\n $flow_name = '00000000-0000-0000-0000-000000000000';\n if ($conversation_id) {\n $messages = sb_db_get('SELECT payload FROM sb_messages WHERE conversation_id = ' . sb_db_escape($conversation_id) . ' AND payload <> \"\" ORDER BY id DESC');\n for ($i = 0; $i < count($messages); $i++) {\n \t$payload = json_decode($messages['payload'], true);\n if (isset($payload['queryResult']) && isset($payload['queryResult']['currentPage'])) {\n $flow_name = $payload['queryResult']['currentPage'];\n $flow_name = substr($flow_name, strpos($flow_name, '/flows/') + 7);\n if (strpos($flow_name, '/')) $flow_name = substr($flow_name, 0, strpos($flow_name, '/'));\n break;\n }\n }\n }\n $flow = sb_dialogflow_curl('/flows/' . $flow_name, '', $language, 'GET');\n array_push($flow['transitionRoutes'], ['intent' => $response['name'], 'triggerFulfillment' => ['messages' => [['text' => ['text' => [$bot_response]]]]]]);\n $response = sb_dialogflow_curl('/flows/' . $flow_name . '?updateMask=transitionRoutes', $flow, $language, 'PATCH');\n }\n if (isset($response['displayName'])) {\n return true;\n }\n return $response;\n}",
"function sb_dialogflow_intent($training_phrases, $bot_response, $language = '') {\n return sb_dialogflow_create_intent($training_phrases, $bot_response, $language = '');\n}",
"public function definition() {\r\n global $CFG;\r\n require_once($CFG->dirroot.'/local/workflow/lib/dialogs.php');\r\n\r\n $mform =& $this->_form;\r\n\r\n $mform->addElement('hidden', 'id');\r\n $mform->setType('id', PARAM_INT);\r\n $mform->setDefault('id', $this->_customdata['id']);\r\n $mform->addElement('hidden', 'contextid');\r\n $mform->setType('contextid', PARAM_INT);\r\n $mform->setDefault('contextid', $this->_customdata['contextid']);\r\n\r\n $required_fields = array();\r\n if (isset($this->_customdata['notification_indexation_badges'])){\r\n $required_fields = $this->_customdata['notification_indexation_badges'];\r\n }\r\n $context = context::instance_by_id($this->_customdata['contextid']);\r\n\r\n // Collapse actions\r\n $mform->addElement('header', 'actionsessionheader',\r\n get_string('label_actions_session', 'local_workflow'));\r\n $link = new moodle_url('/enrol/users.php', array('id' => $this->_customdata['id']));\r\n $mform->addElement('html',\r\n wf_secondary_generate_action_links($this->_customdata['main_category'],$this->_customdata['id'],\r\n $this->_customdata['status']));\r\n\r\n // Collapse formateur\r\n if(has_capability('local/workflow:addformateur', $context)){\r\n $formateur_notification = '';\r\n if(array_key_exists('no_formateurs', $required_fields)){\r\n $formateur_notification = generate_help_icon_HTML('label_inscription_formateur',\r\n 'local_workflow', 'formateur');\r\n }\r\n $mform->addElement('header', 'inscriptionformateurheader',\r\n get_string('label_inscription_formateur', 'local_workflow', WKF_ROLE_NAME_FORMATEUR)\r\n .$formateur_notification);\r\n if(has_capability('local/workflow:addformateurmanual', $context)){\r\n $link = new moodle_url('/user/index.php', array('id' => $this->_customdata['id']));\r\n $mform->addElement('html', '<a class=\"enrol-link\" href=\"'.$link.'\">'\r\n .get_string('inscription_manuelle', 'local_workflow')\r\n .' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>');\r\n $mform->addElement('html','<hr> </hr>');\r\n }\r\n if(has_capability('local/workflow:addformateurcsv', $context)){\r\n $csvform = new WFEnrolCSV($this->_customdata['id'], WKF_ROLE_FORMATEUR);\r\n $datacsv = $csvform->getFrameElement($mform);\r\n $this->set_data($datacsv); // Mapping de l'id filemanager pour l'historique\r\n $mform->addElement('html','<hr> </hr>');\r\n }\r\n\r\n $enroluserform = new WFEnrolManual($this->_customdata['id'], WKF_ROLE_FORMATEUR);\r\n $enroluserform->getFrameElement($mform);\r\n }\r\n\r\n // Collapse tuteur\r\n if(has_capability('local/workflow:addtuteur', $context)){\r\n $mform->addElement('header', 'inscriptiontuteurheader',\r\n get_string('label_inscription_tuteur', 'local_workflow', WKF_ROLE_NAME_TUTEUR));\r\n if(has_capability('local/workflow:addformateurmanual', $context)){\r\n $link = new moodle_url('/user/index.php', array('id' => $this->_customdata['id']));\r\n $mform->addElement('html', '<a class=\"enrol-link\" href=\"'.$link.'\">'\r\n .get_string('inscription_manuelle', 'local_workflow')\r\n .' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>');\r\n $mform->addElement('html','<hr> </hr>');\r\n }\r\n\r\n if(has_capability('local/workflow:addformateurcsv', $context)){\r\n $csvform = new WFEnrolCSV($this->_customdata['id'], WKF_ROLE_TUTEUR);\r\n $datacsv = $csvform->getFrameElement($mform);\r\n $this->set_data($datacsv); // Mapping de l'id filemanager pour l'historique\r\n $mform->addElement('html','<hr> </hr>');\r\n }\r\n\r\n $enroluserform = new WFEnrolManual($this->_customdata['id'], WKF_ROLE_TUTEUR);\r\n $enroluserform->getFrameElement($mform);\r\n }\r\n\r\n // Collapse participant\r\n if(has_capability('local/workflow:addparticipant', $context)){\r\n $participant_notification = '';\r\n if(array_key_exists('no_participants', $required_fields)){\r\n $participant_notification = generate_help_icon_HTML('label_inscription_participant',\r\n 'local_workflow', 'participant');\r\n }\r\n $mform->addElement('header', 'inscriptionparticipantheader',\r\n get_string('label_inscription_participant', 'local_workflow', WKF_ROLE_NAME_PARTICIPANT)\r\n .$participant_notification);\r\n if(has_capability('local/workflow:addparticipantmanual', $context)){\r\n $link = new moodle_url('/user/index.php', array('id' => $this->_customdata['id']));\r\n $mform->addElement('html', '<a class=\"enrol-link\" href=\"'.$link.'\">'\r\n .get_string('inscription_manuelle', 'local_workflow')\r\n .' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>');\r\n $mform->addElement('html','<hr> </hr>');\r\n }\r\n\r\n if(has_capability('local/workflow:addparticipantcsv', $context)){\r\n $csvform = new WFEnrolCSV($this->_customdata['id'], WKF_ROLE_PARTICIPANT);\r\n $datacsv = $csvform->getFrameElement($mform);\r\n $this->set_data($datacsv); // Mapping de l'id filemanager pour l'historique\r\n $mform->addElement('html','<hr> </hr>');\r\n }\r\n\r\n $enroluserform = new WFEnrolManual($this->_customdata['id'], WKF_ROLE_PARTICIPANT);\r\n $enroluserform->getFrameElement($mform);\r\n }\r\n\r\n // Collapse gaia\r\n require_once($CFG->dirroot.'/local/workflow/lib/Gaia.php');\r\n if (Gaia::isAvailable()){\r\n if(has_capability('local/workflow:setgaiasession', $context)){\r\n $mform->addElement('header', 'gaiaheader', get_string('label_gaia', 'local_workflow'));\r\n $mform->addElement('html', Gaia::getContent($this->_customdata['id']));\r\n }\r\n }\r\n\r\n // Collapse dates\r\n if(has_capability('local/workflow:setcoursedates', $context)){\r\n $start_date_notification = '';\r\n $count_notification_date = 0;\r\n if(array_key_exists('startdate', $required_fields)){\r\n $start_date_notification = generate_help_icon_HTML('field_date_debut', 'local_workflow', 1);\r\n $count_notification_date += 1 ;\r\n }\r\n $end_date_notification = '';\r\n if(array_key_exists('enddate', $required_fields)){\r\n $end_date_notification = generate_help_icon_HTML('field_date_fin', 'local_workflow', 1);\r\n $count_notification_date += 1 ;\r\n }\r\n $header_notification = '';\r\n if($count_notification_date != 0 ){\r\n $header_notification = generate_notification_HTML($count_notification_date);\r\n }\r\n $mform->addElement('header', 'dateheader', get_string('label_date', 'local_workflow')\r\n .$header_notification);\r\n $mform->addElement('date_selector', 'startdate', get_string('field_date_debut', 'local_workflow')\r\n .$start_date_notification, ['optional' => true]);\r\n $mform->setType('startdate', PARAM_TEXT);\r\n\r\n $mform->addElement('date_selector', 'enddate', get_string('field_date_fin', 'local_workflow')\r\n .$end_date_notification, ['optional' => true]);\r\n $mform->setType('enddate', PARAM_TEXT);\r\n }\r\n\r\n // Collapse duree\r\n if(isIndexationAvailable() && has_capability('local/workflow:setcourseduration', $context)){\r\n $count_notification_duree = 0;\r\n $tps_en_presence_notification = '';\r\n if(array_key_exists('tps_en_presence', $required_fields)){\r\n $tps_en_presence_notification = generate_help_icon_HTML('field_temps_en_presence', 'local_workflow', 1);\r\n $count_notification_duree += 1 ;\r\n }\r\n $tps_a_distance_notification = '';\r\n if(array_key_exists('tps_a_distance', $required_fields)){\r\n $tps_a_distance_notification = generate_help_icon_HTML('field_temps_a_distance', 'local_workflow', 1);\r\n $count_notification_duree += 1 ;\r\n }\r\n $header_notification = '';\r\n if($count_notification_duree != 0 ){\r\n $header_notification = generate_notification_HTML($count_notification_duree);\r\n }\r\n $mform->addElement('header', 'dureeheader',\r\n get_string('label_duree', 'local_workflow')\r\n .$header_notification);\r\n $tempspresence = array();\r\n $tempspresence[] =& $mform->createElement('text', 'tempspresence_h');\r\n $tempspresence[] =& $mform->createElement('text', 'tempspresence_min');\r\n $mform->addGroup($tempspresence, 'tempspresence_group',\r\n get_string('field_temps_en_presence', 'local_workflow')\r\n .$tps_en_presence_notification, array(' h '), false);\r\n $mform->setType('tempspresence_h', PARAM_ALPHANUM);\r\n $mform->setType('tempspresence_min', PARAM_ALPHANUM);\r\n\r\n $tempsdist = array();\r\n $tempsdist[] = $mform->createElement('text', 'tempsdistance_h');\r\n $tempsdist[] = $mform->createElement('text', 'tempsdistance_min');\r\n $mform->addGroup($tempsdist, 'tempsdistance_group',\r\n get_string('field_temps_a_distance', 'local_workflow')\r\n .$tps_a_distance_notification, array(' h '), false);\r\n $mform->setType('tempsdistance_h', PARAM_ALPHANUM);\r\n $mform->setType('tempsdistance_min', PARAM_ALPHANUM);\r\n }\r\n\r\n // Collapse collection\r\n \r\n if(isIndexationAvailable() && has_capability('local/workflow:setcoursecollection', $context)){\r\n $notification = '';\r\n if(array_key_exists('collectionid', $required_fields)){\r\n $notification = generate_notification_HTML(1);\r\n }\r\n $mform->addElement('header', 'collectionheader',\r\n get_string('label_collection', 'local_workflow')\r\n .$notification);\r\n $collections = get_centralized_db_connection()->get_records('local_indexation_collections');\r\n $collectionsOptions = array(get_string('label_collection', 'local_workflow'));\r\n foreach($collections as $id => $data){\r\n $collectionsOptions[$id] = $data->name;\r\n }\r\n\r\n $mform->addElement('select', 'collection',\r\n get_string('field_collection', 'local_workflow'),\r\n $collectionsOptions);\r\n }\r\n\r\n // Collapse indexation\r\n if(isIndexationAvailable() && has_capability('local/workflow:index', $context)){\r\n $notification_html = '';\r\n if(isset($this->_customdata['notification_indexation_badges_html'])){\r\n $notification_html = $this->_customdata['notification_indexation_badges_html'];\r\n }\r\n $mform->addElement('header', 'indexationheader',\r\n get_string('label_indexation', 'local_workflow')\r\n .$notification_html);\r\n $link = new moodle_url('/local/indexation/', array('id' => $this->_customdata['id']));\r\n $mform->addElement('html', '<a class=\"indexation-link\" href=\"'.$link.'\">'\r\n . get_string('link_indexation', 'local_workflow')\r\n . ' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>');\r\n }\r\n\r\n // Collapse publication\r\n if(isCourseHubAvailable() && (has_capability('local/coursehub:publish', $context)\r\n || has_capability('local/coursehub:share', $context))){\r\n \r\n require_once($CFG->dirroot.'/local/coursehub/CourseHub.php');\r\n \r\n $isPublished = courseIsPublished($this->_customdata['id'], CourseHub::PUBLISH_PUBLISHED);\r\n $isShared = courseIsPublished($this->_customdata['id'], CourseHub::PUBLISH_SHARED);\r\n $isReadyToShare = is_ready_to_share($this->_customdata['id']);\r\n $isReadyToPublish = is_ready_to_publish($this->_customdata['id']);\r\n $isReadyToPublishLocal = is_ready_to_publish($this->_customdata['id'],1);\r\n \r\n $header_publication= '';\r\n $mform->addElement('header', 'publicationheader',\r\n get_string('label_publication', 'local_workflow')\r\n .$header_publication);\r\n\r\n $status = get_string('status_course_not_published', 'local_workflow');\r\n $btn_share_title = get_string('link_share', 'local_workflow');\r\n $btn_publish_title = get_string('link_publish', 'local_workflow');\r\n $btn_local_publish_title = get_string('link_local_publish', 'local_workflow');\r\n\r\n if($isShared){\r\n $status = get_string('status_share_course', 'local_workflow');\r\n $btn_share_title = get_string('link_share_update', 'local_workflow');\r\n }\r\n\r\n if($isPublished){\r\n if(wf_get_main_category() == WKF_CAT_SLAF){\r\n $status = get_string('status_local_publish', 'local_workflow');\r\n } else {\r\n $status = get_string('status_publish_course', 'local_workflow');\r\n }\r\n $btn_publish_title = $btn_local_publish_title = get_string('link_publish_update', 'local_workflow');\r\n }\r\n\r\n $mform->addElement('html', '<div class=\"fitem\"><div class=\"fitemtitle\"></div><div class=\"felement\"><span>'.$status.'</span></div>');\r\n\r\n if (isIndexationAvailable()){\r\n require_once($CFG->dirroot.'/local/magisterelib/magistereLib.php');\r\n $indexupdated = MagistereLib::hasIndexBeenUpdated($this->_customdata['id']);\r\n \r\n if ($indexupdated){\r\n $mform->addElement('html','\r\n<div class=\"fitem\">\r\n <div class=\"fitemtitle\"></div>\r\n <div class=\"felement\">\r\n <br/>\r\n <i alt=\"L\\'indexation liée à votre session est différente de celle publiée. Vous pouvez la mettre à jour en cliquant ci-dessous.\" class=\"infoicon fa fa-2x fa-info-circle\"></i>\r\n <span class=\"infolabel\"> L\\'indexation liée à votre session est différente de celle publiée. Vous pouvez la mettre à jour en cliquant ci-dessous.</span>\r\n </div>\r\n</div>');\r\n }\r\n }\r\n \r\n \r\n // Gestion des boutons dans le cas d'un parcours\r\n if(has_capability('local/coursehub:share', $context)) {\r\n if ($isReadyToShare || $isShared) {\r\n $html_share_content = '';\r\n if (is_ready_to_share($this->_customdata['id'])) {\r\n $html_share_content .= '<a class=\"share-link btn\" id=\"wf_link_publish\" href=\"#\">'\r\n . $btn_share_title . '</a>';\r\n } else {\r\n $html_share_content .= '<span class=\"secondary-link disable\">'\r\n . get_string('link_share_disable', 'local_workflow')\r\n . ' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></span>'\r\n . generate_help_icon_HTML('link_share_disable','local_workflow');\r\n }\r\n if ($isShared && has_capability('local/coursehub:unpublish', $context)) {\r\n $html_share_content .= '<a class=\"share-link cancel btn\" id=\"wf_link_unpublish\" href=\"#\">'\r\n . get_string('link_share_cancel', 'local_workflow') . '</a>';\r\n }\r\n } else {\r\n $html_share_content = '<span class=\"secondary-link disable\">'\r\n . get_string('link_share_disable', 'local_workflow')\r\n . ' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></span>'\r\n . generate_help_icon_HTML('link_share_disable','local_workflow');\r\n }\r\n $mform->addElement('html', ' \r\n <div class=\"fitemtitle\"></div>\r\n <div class=\"felement\">\r\n ' . $html_share_content . '\r\n </div>');\r\n }\r\n\r\n // Gestion des boutons dans le cas d'une session de formation\r\n if(has_capability('local/coursehub:publish', $context)) {\r\n if ($isReadyToPublish || $isPublished) {\r\n $html_publish_content = '';\r\n\r\n if ($isReadyToPublish) {\r\n if ($isShared) {\r\n $html_share_content .= '';\r\n } else {\r\n $html_publish_content .= '<a class=\"publish-link btn\" id=\"wf_link_publish\" href=\"#\">'\r\n . $btn_publish_title . '</a>';\r\n }\r\n } else {\r\n $html_publish_content .= '<span class=\"secondary-link disable\">'\r\n . get_string('link_publish_disable', 'local_workflow')\r\n . ' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></span>'\r\n . generate_help_icon_HTML('link_publish_disable','local_workflow');\r\n }\r\n if ($isPublished\r\n && wf_get_main_category() == WKF_CAT_SDF\r\n && has_capability('local/coursehub:unpublish', $context)) {\r\n $html_publish_content .= '<a class=\"publish-link cancel btn\" id=\"wf_link_unpublish\" href=\"#\">'\r\n . get_string('link_publish_cancel', 'local_workflow') . '</a>';\r\n }\r\n } else {\r\n $html_publish_content = '<span class=\"secondary-link disable\">'\r\n . get_string('link_publish_disable', 'local_workflow')\r\n . ' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></span>'\r\n . generate_help_icon_HTML('link_publish_disable','local_workflow');\r\n }\r\n }\r\n $mform->addElement('html', ' \r\n <div class=\"fitemtitle\"></div>\r\n <div class=\"felement\">\r\n '.$html_publish_content.'\r\n </div>');\r\n\r\n // Gestion des boutons dans le cas d'une session locale\r\n if(has_capability('local/coursehub:publish', $context)) {\r\n if ($isReadyToPublishLocal || $isPublished) {\r\n $html_publish_content = '';\r\n\r\n if ($isReadyToPublishLocal) {\r\n if ($isShared) {\r\n $html_share_content .= '';\r\n } else {\r\n $html_publish_content .= '<a class=\"publish-link btn\" id=\"wf_link_publish\" href=\"#\">'\r\n . $btn_local_publish_title . '</a>';\r\n }\r\n } else {\r\n $html_publish_content .= '<span class=\"secondary-link disable\">'\r\n . get_string('link_local_publish_disable', 'local_workflow')\r\n . ' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></span>'\r\n . generate_help_icon_HTML('link_local_publish_disable','local_workflow');\r\n }\r\n if ($isPublished\r\n && wf_get_main_category() == WKF_CAT_SLAF\r\n && has_capability('local/coursehub:unpublish', $context)) {\r\n $html_publish_content .= '<a class=\"publish-link cancel btn\" id=\"wf_link_unpublish\" href=\"#\">'\r\n . get_string('link_publish_cancel', 'local_workflow') . '</a>';\r\n }\r\n } else {\r\n $html_publish_content = '<span class=\"secondary-link disable\">'\r\n . get_string('link_local_publish_disable', 'local_workflow')\r\n . ' <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></span>'\r\n . generate_help_icon_HTML('link_local_publish_disable','local_workflow');\r\n }\r\n }\r\n $mform->addElement('html', ' \r\n <div class=\"fitemtitle\"></div>\r\n <div class=\"felement\">\r\n '.$html_publish_content.'\r\n </div>\r\n </div>');\r\n }\r\n\r\n $buttonarray = array();\r\n $buttonarray[] = $mform->createElement('cancel', 'cancelgeneral');\r\n $buttonarray[] = $mform->createElement('button', 'submitgeneral', get_string('savechanges'));\r\n $mform->addGroup($buttonarray, 'buttonar', '', ' ', false);\r\n $mform->closeHeaderBefore('buttonar');\r\n $mform->disable_form_change_checker();\r\n }",
"public function newAction()\n {\n $entity = new InteractionQCM($this->container->get('security.context')->getToken()->getUser());\n $form = $this->createForm(\n new InteractionQCMType(\n $this->container->get('security.context')->getToken()->getUser()\n ), $entity\n );\n\n return $this->render(\n 'UJMExoBundle:InteractionQCM:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }",
"function campaign_context_add_form($form, &$form_state) {\n // Include the name as a hidden value, this will be filled out\n // programmatically by fetching the namespace from Facebook Graph API.\n $form['name'] = array(\n '#title' => 'Name',\n '#type' => 'hidden',\n '#default_value' => '',\n );\n\n $form['campaign']['fb']['appid'] = array(\n '#type' => 'textfield',\n '#title' => t('Facebook Application ID'),\n '#description' => t('The application ID this campaign will use.'),\n '#required' => 1,\n '#maxlength' => 15,\n '#default_value' => '',\n '#element_validate' => array('campaign_context_app_validate'),\n );\n $form['actions']['#type'] = 'actions';\n $form['actions']['save'] = array(\n '#type' => 'submit',\n '#value' => t('Add'),\n );\n $form['actions']['cancel'] = array(\n '#type' => 'link',\n '#title' => t('Cancel'),\n '#href' => isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/campaigns',\n );\n\n return $form;\n}",
"function campaign_context_add_form_submit($form, &$form_state) {\n $context = campaign_load_default_context();\n $context->name = $form_state['values']['name'];\n // Preset the app id.\n $context->reactions['campaign_context_reaction']['campaign']['fb']['appid'] = $form_state['values']['appid'];\n context_save($context);\n $form_state['redirect'] = 'admin/config/campaigns/' . $context->name;\n}",
"public function answerAction()\n {\n $this->append([\n 'action' => 'talk',\n 'text' => 'Thanks for calling Nexmo order status hotline for demo\n the Basic Interactive Voice Response (IVR) use case.'\n ]);\n\n $this->promptSearch();\n }",
"public function executeIntent()\n {\n $user = $this->getUser();\n $defaultStation = $user->getDefaultStationName();\n\n\t\t$helpText = \"Du kannst mich fragen, wann die Bahnen an Deiner Haltestelle ankommen.\"\n\t\t\t\t . \"Sage dazu etwa: <emphasis>Frage Haltestelle, wann die Bahn kommt.</emphasis>\"\n\t\t\t\t . \"Ich sage Dir dann die Bahnen, die von der Haltestelle {$defaultStation} abfahren.\"\n\t\t\t\t . \"\";\n\n // Send Feedback to Echo\n $this->response->setSsmlResponseText($helpText);\n }",
"function new_participant_info_card_form($form_state, $project){\n $form['project'] = array(\n '#type' => 'hidden',\n '#value' => $project->id,\n );\n $form['name'] = array(\n '#title' => t('Participant name'),\n '#type' => 'textfield',\n '#size' => 20,\n '#required' => TRUE,\n );\n $form['email'] = array(\n '#title' => t('Email'),\n '#type' => 'textfield',\n '#size' => 20,\n '#required' => TRUE,\n );\n $form['send-invitation'] = array(\n '#title' => t('Send invitation email. '.l('[Edit the invitation]', generate_project_url($project->path).'/manage/settings/templates')),\n '#type' => 'checkbox',\n '#description' => t(\"Participant's data can be viewed after s(he) has accepted the invitation to the project.\"),\n '#default_value'=> TRUE,\n );\n $form['phone'] = array(\n '#title' => t('Phone'),\n '#type' => 'textfield',\n '#size' => 20,\n );\n $form['notes'] = array(\n '#title' => t('Notes'),\n '#type' => 'textarea',\n '#cols' => 5,\n '#rows' => 3,\n '#description' => t('Additional infomation of this participant.'),\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Add'),\n );\n return $form;\n}",
"function leaveregistration_civicrm_buildForm( $formName, &$form ) \r\n{\r\n //echo('$formName: ' . $formName . ' $form->getAction(): ' . $form->getAction() . ' $form->getVar(\\'_id\\'): ' . $form->getVar('_id'));\r\n \r\n switch($formName){\r\n case 'CRM_Activity_Form_ActivityLinks':\r\n \r\n switch($form->getAction()){\r\n \r\n default:\r\n //print_r($form);\r\n }\r\n \r\n break;\r\n }\r\n}",
"public function newAction()\n {\n $entity = new Inquiry();\n \t$entity->setTraveller($this->getUser());\n $form = $this->createForm($this->get('form.type.inquiry'), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function newAction()\n {\n $activity = new Activity();\n $form = $this->createForm(new ActivityType(), $activity);\n\n return array(\n 'activity' => $activity,\n 'form' => $form->createView(),\n );\n }",
"function initializeQuestionEditForm() {\n if (!(isset($this->dialogQuestion) && is_object($this->dialogQuestion))) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n if (@$this->params['cmd'] != 'add_question') {\n $data = $this->question;\n $hidden = array(\n 'cmd' => 'edit_question',\n 'save' => 1,\n 'group_id' => $this->params['group_id'],\n 'question_id' => $this->params['question_id']\n );\n $btnCaption = 'Edit';\n } else {\n $data = array();\n $hidden = array(\n 'cmd' => 'create_question',\n 'save' => 1,\n 'group_id' => $this->params['group_id']\n );\n $btnCaption = 'Save';\n }\n $fields = array(\n 'question_title' => array('Title', 'isNoHTML', TRUE, 'input', 250),\n 'question_text' => array('Text', 'isSomeText', FALSE, 'simplerichtext', 12),\n 'question_link' => array('Link', 'isSomeText', FALSE, 'simplerichtext', 4)\n );\n $this->dialogQuestion = new base_dialog(\n $this, $this->paramName, $fields, $data, $hidden\n );\n $this->dialogQuestion->msgs = &$this->msgs;\n $this->dialogQuestion->loadParams();\n $this->dialogQuestion->baseLink = $this->baseLink;\n $this->dialogQuestion->dialogTitle =\n papaya_strings::escapeHtmlChars($this->_gt('Properties'));\n $this->dialogQuestion->buttonTitle = $btnCaption;\n $this->dialogQuestion->dialogDoubleButtons = FALSE;\n }\n }",
"function wha_dialog_form(&$out, &$err, $text, $height, $width, $formheight, \n &$items, $common_options=array())\n{ \n $form_options = array('--form', $text, $height, $width, $formheight);\n $form_items = array();\n foreach($items as $key => $tuple) {\n $form_items[] = $tuple[0]; // label\n $form_items[] = $tuple[1]; // x\n $form_items[] = $tuple[2]; // y\n $form_items[] = $tuple[3]; // item\n $form_items[] = $tuple[4]; // x \n $form_items[] = $tuple[5]; // y\n $form_items[] = $tuple[6]; // flen\n $form_items[] = $tuple[7]; // ilen\n }\n $args = array_merge($common_options, $form_options, $form_items);\n $result = wha_dialog($args, $out, $err);\n if($result == 0) {\n if(is_string($out)) {\n $lines = explode(\"\\n\", $out);\n $i = 0;\n foreach($items as $key => $tuple) {\n $items[$key][3] = $lines[$i];\n $i++;\n }\n }\n }\n return $result;\n}",
"function open()\n\t{\n\t\t$this->open_count++;\n\t\tif( $this->open_count > 1 )\n\t\t\tthrow new RuntimeException(\"multiple open() in the same form\");\n\t\techo \"<form enctype='multipart/form-data' method=post \",\n\t\t\t$this->_add_attributes, \">\";\n\t\t$this->_add_attributes = NULL;\n\t\t\n\t\t// Capture the \"implicit submission mechanism\":\n\t\t$this->addAttributes(\"id=phplint_defaultButton style='display: none'\");\n\t\t$this->button(\"\", \"defaultButton\");\n\t}",
"function expert_cv_additional_details_form($form, &$form_state) {\n civicrm_initialize();\n\n $contact = pum_expert_mycv_get_civi_contact();\n $values = array();\n if (isset($form_state['values'])) {\n $values = $form_state['values'];\n }\n\n $form['other']['#type'] = 'fieldset';\n $form['other']['#title'] = t('Other information');\n\n $form['other']['side_activities'] = array(\n '#type' => 'textarea',\n '#title' => t('Professional affiliation and side activities '),\n '#field_suffix' => '<code class=\"help\">In case it could be relevant for PUM projects</code>',\n '#default_value' => pum_expert_mycv_value($values, $contact, 'side_activities', 'expert_data::side_activities'),\n );\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n $form['actions']['cancel'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('pum_expert_cv_cancel'),\n '#limit_validation_errors' => array(),\n );\n\n $path = drupal_get_path('module', 'pum_portal_webform_help');\n drupal_add_js($path . '/ppwh.js');\n drupal_add_css($path . '/ppwh.css');\n\n return $form;\n}",
"public function form() {}",
"public function form() {}",
"protected function askAddInfo(){\n \t $this->ask('Additional information/requirements', function($answer) {\n \t \t//Get the user input\n \t\t$value2 = $answer->getText();\n \t\t//check if message at least 5 characters long\n \t\tif(strlen($value2) < 4){\n \t\t\t//ask user to try again\n \t\t\treturn $this->repeat('Your message is too short. Please try again.');\n \t\t}\n \t\t//Allocate the message\n \t\t$this->info = $value2;\n \t\t//Check if user wants to attach a file\n \t$this->sendMail();\n });\n }",
"public function create()\n { $this->resetInputFields();\n $this->openModal();\n }",
"public function create()\n { $this->resetInputFields();\n $this->openModal();\n }",
"function sb_dialogflow_curl($url_part, $query = '', $language = false, $type = 'POST', $token = false) {\n\n // Project ID\n $project_id = trim(sb_get_setting('dialogflow-project-id'));\n if (empty($project_id)) {\n return new SBError('project-id-not-found', 'sb_dialogflow_curl');\n }\n\n // Retrive token\n $token = empty($token) || $token == -1 ? sb_dialogflow_get_token() : $token;\n if (sb_is_error($token)) {\n return new SBError('token-error', 'sb_dialogflow_curl');\n }\n\n // Language\n if (!empty($language)) {\n $language = (strpos($url_part, '?') ? '&' : '?') . 'languageCode=' . $language;\n }\n\n // Query\n if (!is_string($query)) {\n $query = json_encode($query);\n }\n\n // Edition and version\n $edition = sb_get_setting('dialogflow-edition', 'es');\n $version = 'v2beta1/projects/';\n if ($edition == 'cx') {\n $version = 'v3beta1/';\n $url_part = str_replace('/agent/', '/', $url_part);\n }\n\n // Send\n $url = 'https://' . sb_get_setting('dialogflow-location', '') . 'dialogflow.googleapis.com/' . $version . $project_id . $url_part . $language;\n $response = sb_curl($url, $query, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $token, 'Content-Length: ' . strlen($query) ], $type);\n return $type == 'GET' ? json_decode($response, true) : $response;\n}",
"public function add_ui() {\n add_meta_box('stt_button', 'Send To Top', array($this, 'render_form'), 'post');\n add_meta_box('stt_button', 'Send To Top', array($this, 'render_form'), 'slide');\n }",
"function c4m_user_contact_action_form(array $context) {\n $form['subject'] = array(\n '#type' => 'textfield',\n '#title' => t('Subject'),\n '#default_value' => isset($context['subject']) ? $context['subject'] : '',\n '#maxlength' => '254',\n '#description' => t('The subject of the message.'),\n );\n $form['message'] = array(\n '#type' => 'textarea',\n '#title' => t('Message'),\n '#default_value' => isset($context['message']) ? $context['message'] : '',\n '#cols' => '80',\n '#rows' => '20',\n '#description' => t('The message that should be sent. You may include placeholders like [node:title], [user:name], and [comment:body] to represent data that will be different each time message is sent. Not all placeholders will be available in all contexts.'),\n );\n return $form;\n}",
"public function show(Dialog $dialog)\n {\n //\n }",
"private function createAskMdpForm()\r\n {\n \t$form = $this->createForm(new LoginAskNewMdpType(), array(\r\n \t\t\t'action' => $this->generateUrl('sendnewmdp',array('email'=>' ')),\r\n \t\t\t'method' => 'PUT',\r\n \t));\r\n\n \t$form->add('submit', 'submit', array('label' => 'Update'));\r\n \t \r\n \treturn $form;\r\n }",
"public function action() {\n\n $html_allowed = array();\n foreach ($_REQUEST as $key => $value) {\n if (!in_array($key, $html_allowed)) {\n $_REQUEST[$key] = $this->xssPrevent($value);\n }\n }\n\n isset($_REQUEST[self::REQUEST_ACTION]) ? $action = $_REQUEST[self::REQUEST_ACTION] : $action = self::ACTION_DEFAULT;\n\n switch ($action):\n case self::ACTION_ABOUT:\n $result = $this->show(self::ACTION_ABOUT, $this->dlgAbout());\n break;\n default :\n $result = $this->show(self::ACTION_PROTOCOL, $this->dlgProtocolList());\n break;\n endswitch;\n\n echo $result;\n }",
"public function dialog_view()\n {\n // resolve message reference\n if ($msgref = rcube_utils::get_input_value('_msg', rcube_utils::INPUT_GPC, true)) {\n $storage = $this->rc->get_storage();\n list($uid, $folder) = explode('-', $msgref, 2);\n if ($message = $storage->get_message_headers($msgref)) {\n $this->rc->output->set_env('kolab_notes_template', array(\n '_from_mail' => true,\n 'title' => $message->get('subject'),\n 'links' => array(kolab_storage_config::get_message_reference(\n kolab_storage_config::get_message_uri($message, $folder),\n 'note'\n )),\n ));\n }\n }\n\n $this->ui->init_templates();\n $this->rc->output->send('kolab_notes.dialogview');\n }",
"function bbp_format_activity_action_new_reply($action, $activity)\n{\n}",
"public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }"
] | [
"0.62722516",
"0.6062508",
"0.5758956",
"0.54566246",
"0.5348672",
"0.5250325",
"0.5213102",
"0.5164716",
"0.5109015",
"0.51042765",
"0.5086471",
"0.5078396",
"0.50548464",
"0.5052557",
"0.5020709",
"0.5011516",
"0.5004696",
"0.5004696",
"0.49989006",
"0.4987485",
"0.4987485",
"0.49805722",
"0.49771932",
"0.49540418",
"0.4953713",
"0.49264047",
"0.49087194",
"0.49038818",
"0.49037188",
"0.49026006"
] | 0.6650957 | 0 |
/Ajaxaction For Get Latitude and Draw Radius | public function ajaxaction() {
if($this->request->getData('action') == 'getCircle') {
$resid = $this->request->getData('resid');
$address = $this->request->getData('address');
$resname = $this->request->getData('resname');
$position = $this->request->getData('circleCount');
$color = $this->Googlemap->getCircleColors($position);
$miles = $this->request->getData('miles') * 1000;
$radius = $this->request->getData('radius_count');
$map_id = 'map_canvas';
$uniqueid = 'Circle'.$position;
$map['id'] = 1;
$mapDetails = $this->Googlemap->getLatitudeLongitude($address);
$latitude = $mapDetails['lat'];
$longitude = $mapDetails['long'];
if ($radius != $position && !empty($resid)) {
echo "<script>
{$uniqueid}Circle.setMap(null);
</script>";
}
$action = $this->request->getData('action');
$this->set(compact('position', 'color', 'latitude', 'longitude', 'miles', 'resname','action','address', 'map'));
}
#--------------------------------------------------------------
if($this->request->getData('action') == 'showMapAdd') {
$Address = $this->request->getData('address');
$mapDetails = $this->Googlemap->getLatitudeLongitude($Address);
$latitude = $mapDetails['lat'];
$longitude = $mapDetails['long'];
$action = $this->request->getData('action');
$this->set(compact('ResName', 'latitude', 'longitude', 'distance','action'));
}
#--------------------------------------------------------------
if($this->request->getData('action') == 'showMapEdit') {
$Address = $this->request->getData('address');
$StoreId = $this->request->getData('resId');
$mapDetails = $this->Googlemap->getLatitudeLongitude($Address);
$latitude = $mapDetails['lat'];
$longitude = $mapDetails['long'];
$restDetails = $this->DeliverySettings->find('all', [
'conditions' => [
'restaurant_id' => $this->request->getData('resId')
]
])->hydrate(false)->toArray();
$action = $this->request->getData('action');
$this->set(compact('ResName', 'latitude', 'longitude', 'distance','restDetails','action'));
}
#--------------------------------------------------------------
if($this->request->getData('action') == 'showPolygonmap') {
$address = $this->request->getData('address');
$restaurant = $this->Googlemap->getLatitudeLongitude($address);
$latitude = $restaurant['lat'];
$longitude = $restaurant['long'];
echo $latitude.'###'.$longitude;die();
}
#--------------------------------------------------------------
if($this->request->getData('action') == 'removeCircle') {
$this->autoRender = false;
$radius = 'Circle'.$this->request->getData('id');
echo "<script>
{$radius}Circle.setMap(null);
</script>";
die();
}
#--------------------------------------------------------------
if($this->request->getData('action') == 'deleteStoreMap') {
$id = $this->request->getData('id');
$entity = $this->Areamaps->get($id);
if ($this->Areamaps->delete($entity)) {
echo "success";
}
die();
}
#--------------------------------------------------------------
if ($this->request->getData('action') == 'getCity') {
$citylist = $this->Cities->find('list', [
'keyField' => 'id',
'valueField' => 'city_name',
'conditions' => [
'status' => '1',
'state_id' => $this->request->getData('state_id')
],
])->hydrate(false)->toArray();
$this->set('action', $this->request->getData('action'));
$this->set('citylist', $citylist);
}
#--------------------------------------------------------------
if ($this->request->getData('action') == 'getLocation') {
if(SEARCHBY == 'area'){
$locationlist = $this->Locations->find('list', [
'keyField' => 'id',
'valueField' => 'area_name',
'conditions' => [
'status' => '1',
'city_id' => $this->request->getData('city_id')
],
])->hydrate(false)->toArray();
}
if(SEARCHBY == 'zip') {
$locationlist = $this->Locations->find('list', [
'keyField' => 'id',
'valueField' => 'zip_code',
'conditions' => [
'status' => '1',
'city_id' => $this->request->getData('city_id')
],
])->hydrate(false)->toArray();
}
$this->set('action', $this->request->getData('action'));
$this->set('locationlist', $locationlist);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_circle()\n\t{\n\t\t//set return var\n\t\t$js_array = array();\n\n\t\t//get the data\n\t\t$map_id = ee()->gmaps->get_from_tagdata('map:id');\n\t\t$address = ee()->gmaps->get_from_tagdata('address');\n\t\t$latlng = ee()->gmaps->get_from_tagdata('latlng');\n\t\t$stoke_color = ee()->gmaps->get_from_tagdata('stoke_color', '#000000');\n\t\t$stroke_opacity = ee()->gmaps->get_from_tagdata('stroke_opacity', '1');\n\t\t$stroke_weight = ee()->gmaps->get_from_tagdata('stroke_weight', '1');\n\t\t$fill_color = ee()->gmaps->get_from_tagdata('fill_color', '#000000');\n\t\t$fill_opacity = ee()->gmaps->get_from_tagdata('fill_opacity', '0.4');\n\t\t$radius = ee()->gmaps->get_from_tagdata('radius', '1000');\n\n\t\t//if address empty return a error.\n\t\tif($address == '' && $latlng == '') \n\t\t{\n\t\t\tee()->gmaps->errors[] = 'You forgot to fill in an address or latlng.';\n\t\t\treturn ee()->gmaps->parse_errors();\t\n\t\t}\n\n\t\t//gecode data\n\t\tif($address != '')\n\t\t{\n\t\t\t$geocode_result = ee()->gmaps->geocode_address(array($address));\n\t\t\t//$geocode_object = ee()->gmaps->geocode_address(explode('|', $address), 'array', 'all');\n\t\t\t$address = $geocode_result['address'];\n\t\t\t$latlng = $geocode_result['latlng'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$latlng = ($latlng);\n\t\t\t$address = \"\";\n\t\t}\n\n\t\t//convert to array\n\t\t$address = gmaps_helper::remove_empty_values(explode('|', $address));\n\t\t$latlng = gmaps_helper::remove_empty_values(explode('|', $latlng));\n\n\t\t//loop over the values\n\t\tif(!empty($latlng))\n\t\t{\n\t\t\t$_latlng = explode(',', $latlng[0]);\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->gmaps->errors[] = 'No result founded';\n\t\t\treturn ee()->gmaps->parse_errors();\t\n\t\t}\n\n\t\t//set the js\n\t\t$js = '\n\t\t\tEE_GMAPS.ready(function(){\n\t\t\t\tEE_GMAPS.triggerEvent(\"addCircle\", {\n\t\t\t\t mapID : \"ee_gmap_'.$map_id.'\",\n\t\t\t\t lat : '.$_latlng[0].',\n\t\t\t\t lng : '.$_latlng[1].',\n\t\t\t\t stokeColor : \"'.$stoke_color.'\",\n\t\t\t\t strokeOpacity : \"'.$stroke_opacity.'\",\n\t\t\t\t strokeWeight : \"'.$stroke_weight.'\",\n\t\t\t\t fillColor : \"'.$fill_color.'\",\n\t\t\t\t fillOpacity : \"'.$fill_opacity.'\",\n\t\t\t\t radius : '.$radius.'\n\t\t\t\t});\n\t\t\t});\n\t\t';\n\n\t\treturn '<script>'.$js.'</script>';\n\t}",
"function getRadius(){\r\n return $this->radius;\r\n }",
"public function mapsAjaxAction()\n {\n $citySql = <<<SQL\nSELECT city.name AS cityName, state.name AS stateName, coordinatesNorth, coordinatesWest, walkScore, transitScore, avgTemp, population, landAreaSquareMiles\nFROM city\nINNER JOIN state ON state.id = city.state_id\nSQL;\n //select the company location fields and use a join to get the company location's company's name\n $companyLocationSql = <<<SQL\nSELECT company.name AS companyName, coordinatesNorth, coordinatesWest\nFROM companyLocation\nINNER JOIN company ON company.id = companyLocation.company_id\nSQL;\n return $this->getAndPrepareData(array($citySql, $companyLocationSql));\n }",
"public function actionGetCoord() {\n $userId = UserController::checkUser();\n \n $result = Dashboard::getCoord($userId);\n \n if (!$result) {\n http_response_code(500);\n } else {\n echo $result;\n }\n \n return true;\n }",
"public function actionGetAnotherPoints(){\n if (Yii::app()->request->isAjaxRequest) {\n\n $geos = array();\n $team = Team::getTeam();\n $usersIds = $team->getUsersInMap();\n if($usersIds){\n foreach ($usersIds as $userId) {\n if($team->user_host_id !=$userId){\n $geoLocal = GeoUnique::getByUserId($userId);\n $geos[$userId]['updated'] = 'Updated ' . (time() - $geoLocal->time) . ' secs ago!';\n $geos[$userId]['cores'] = array($geoLocal->latitude, $geoLocal->longitude);\n $geos[$userId]['title'] = User::getUserIdentityById($userId);\n $geos[$userId]['icocolor']=$this->getColor($geoLocal->time);\n $geos[$userId]['corecolor']=$this->getCoreColor($geoLocal->time);\n }\n }\n }\n echo json_encode($geos, 1);\n }\n }",
"public function getLocationLatitude();",
"public function getLatitude();",
"public function getLatitude();",
"public function getLatitude();",
"public function getLatitude();",
"public function radius() : float;",
"abstract public function latitude();",
"public function radius(): int;",
"function tubersGetByLocation($latitude, $longitude, $radius){//need to be changed\n \n\n\n global $dbConn;\n $params = array(); \n// $query = \"SELECT * FROM cms_tubers WHERE LocationDiff(latitude,longitude,$latitude,$longitude) < $radius \";\n// $ret = db_query($query);\n// if( !$ret || db_num_rows($ret) == 0 ) return array();\n//\n// $ret_arr = array();\n// while($row = db_fetch_array($ret)){\n// $ret_arr[] = $row;\n// }\n// return $ret_arr;\n $query = \"SELECT * FROM cms_tubers WHERE LocationDiff(latitude,longitude,:Latitude,:Longitude) < :Radius \";\n $params[] = array( \"key\" => \":Latitude\",\n \"value\" =>$latitude);\n $params[] = array( \"key\" => \":Longitude\",\n \"value\" =>$longitude);\n $params[] = array( \"key\" => \":Radius\",\n \"value\" =>$radius);\n \n $select = $dbConn->prepare($query);\n PDO_BIND_PARAM($select,$params);\n $select->execute();\n\n $ret = $select->rowCount();\n \n \n if( !$select || $ret == 0 ) return array();\n\n $ret_arr = $select->fetchAll(PDO::FETCH_ASSOC);\n return $ret_arr;\n\n\n\t}",
"private static function calcRadius( $point = array( 0, 0 ), $r )\n {\n $lat1 = $point[0];\n $lon1 = $point[1];\n\n $d = 0.00015; //Umkreis\n $r = 6.371; //Erdradius in km\n\n $latN = rad2deg(asin(sin(deg2rad($lat1)) * cos($d / $r) + cos(deg2rad($lat1)) * sin($d / $r) * cos(deg2rad(0))));\n $latS = rad2deg(asin(sin(deg2rad($lat1)) * cos($d / $r) + cos(deg2rad($lat1)) * sin($d / $r) * cos(deg2rad(180))));\n $lonE = rad2deg(deg2rad($lon1) + atan2(sin(deg2rad(90)) * sin($d / $r) * cos(deg2rad($lat1)), cos($d / $r) - sin(deg2rad($lat1)) * sin(deg2rad($latN))));\n $lonW = rad2deg(deg2rad($lon1) + atan2(sin(deg2rad(270)) * sin($d / $r) * cos(deg2rad($lat1)), cos($d / $r) - sin(deg2rad($lat1)) * sin(deg2rad($latN))));\n\n return array( 'lat_north' => $latN, 'lat_south' => $latS, 'lng_east' => $lonE, 'lng_west' => $lonW );\n }",
"public function actionGetGeoLocatedClients(){\n $app = Yii::$app;\n $req = $app->request;\n $res = $app->response;\n $session = $app->session;\n if($req->isAjax){\n $clientsList = [];\n $clients = SpyClient::find()\n ->select(['client_id', 'name', 'coordinates'])\n ->where(['commercial_id' => $app->user->id])\n ->andWhere(['!=', 'coordinates', ''])\n ->all();\n foreach($clients as $client){\n if($client instanceof SpyClient){\n $item = [\n 'client_id' => $client->client_id,\n 'name' => $client->name,\n 'coordinates' => $client->coordinates,\n ];\n in_array($client->client_id, $session->get('routes')) ? $item['route'] = true : $item['route'] = false ;\n array_push($clientsList, $item);\n }\n }\n $res->format = Response::FORMAT_JSON;\n return $clientsList;\n }\n return null;\n }",
"public function neighborhoodDeals($center_lat,$center_lng,$radius){\r\n\t\t\t\t\t/*$query = sprintf(\"SELECT d.id,d.user_id, d.lat, d.long, ( 3959 * acos( cos( radians('%s') ) * cos( radians( d.lat ) ) * cos( radians( d.long ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( d.lat ) ) ) ) AS distance FROM deals as d HAVING distance < '%s' ORDER BY distance LIMIT 0 , 1000\",\r\n\t\t\t\t\t mysql_real_escape_string($center_lat),\r\n\t\t\t\t\t mysql_real_escape_string($center_lng),\r\n\t\t\t\t\t mysql_real_escape_string($center_lat),\r\n\t\t\t\t\t mysql_real_escape_string($radius));\r\n\t\t\t\t\t//$result = mysql_query($query);\r\n\t\t\t\t\t$r = $this->db->query($query);\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<pre>\"; print_r($r->result()); exit;*/\r\n\t\t\t\t\t\r\n\t\t\t\tif(isset($_COOKIE['current_location'])){\r\n\t\t\t\t\t$loc_area = $_COOKIE['current_location'];\r\n\t\t\t\t\t$loc_area = explode(',',$loc_area); \r\n\t\t\t\t\t$loc_area = $loc_area[0];\r\n\t\t \t\t $r = $this->Common_model->fetchLatLong(trim($loc_area));\r\n\r\n\t\t\t\t\tif(!empty($r)){\r\n\t\t\t\t\t\t$center_lat = \t$r['lat'];\r\n\t\t\t\t\t\t$center_lng = $r['long'];\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\tif($center_lat != null && $center_lng != null){\r\n \r\n\t\t\t\t \t $cur_date = strtotime(date('y-m-d h:m:s',time()));\r\n\t\t\t\t\t $this->db->select(\"deals.*,user.user_type, ( 3959 * acos( cos( radians(\".$center_lat.\") ) * cos( radians( deals.lat ) ) * cos( radians( deals.long ) - radians(\".$center_lng.\") ) + sin( radians(\".$center_lat.\") ) * sin( radians( deals.lat ) ) ) ) AS distance\");\r\n\t\t\t\t\t $this->db->from('deals deals');\r\n\t\t\t\t\t $this->db->join('category cat', 'deals.category_id = cat.category_id','left');\r\n\t\t\t\t\t $this->db->join('user user', 'user.id = deals.user_id','left');\r\n\t\t\t\t\t $this->db->where('deals.status','1');\r\n\t\t\t\t\t $this->db->where('deals.campaign_type','basic');\r\n\t\t\t\t\t $this->db->or_where('deals.campaign_under','2');\r\n\t\t\t\t\t $this->db->where('deals.campaign_type','pro');\r\n\t\t\t\t\t $this->db->order_by(\"distance\", \"asc\"); \r\n\t\t\t\t\t $this->db->having(\"distance < \",$radius+1);\r\n\t\t\t\t\t $qry = $this->db->get();\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t \r\n\t\t\t\t\t if($qry->num_rows > 0)\r\n\t\t\t\t\t \t{\r\n\t\t\t\t\t \t\t$neighborhoodData = array();\r\n\t\t\t\t\t \t\t$data = $qry->result();\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tfor($i=0;$i<count($data);$i++){\r\n\t\t\t\t\t \t\t\t\t$end_date = strtotime($data[$i]->duration_to.\" 23:59:59\");\r\n\t\t\t\t\t\t \t\t\tif($end_date >= $cur_date){\r\n\t\t\t\t\t\t\t \t\t\t\t$data[$i]->end_time = $end_date - $cur_date;\r\n\t\t\t\t\t\t\t \t\t\t\t$neighborhoodData[] = $data[$i];\r\n\t\t\t\t\t\t\t \t\t\t\t}\r\n\t\t\t\t\t \t\t\t}\r\n\t\t\t\t\t \t\t\t//echo \"<pre>\"; print_r($neighborhoodData); exit;\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t \treturn $neighborhoodData;\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t \telse {\r\n\t\t\t\t\t \t\t //echo \"hi\"; exit;\r\n\t\t\t\t\t \t\t\treturn false;\r\n\t\t\t\t\t \t\t\t} \r\n\t }else {\r\n\t \t\t return false;\r\n\t \t\t }\t\t\t\r\n\t \t\r\n \t\t}",
"public function actionPoint()\n {\n $answer=array();\n try {\n //Yii::$app->request->isAjax &&\n if($id=Yii::$app->request->post('id')){\n\n $point = Point::autor_layer($_POST['id']);\n\n if($point){\n $answer['result'] = '1';\n $answer['data']['point']= $point;}\n else\n throw new ErrorException('Точка не найдена',0);\n\n }else\n throw new ErrorException('Только POST',0);\n\n\n } catch (ErrorException $e) {\n $answer['msg'] = $e->getMessage();\n $answer['result'] = '0';\n }\n\n echo json_encode($answer);\n }",
"public function getWindValue()\n {\n if (isset($_POST['lat']) && isset($_POST['lon'])) {\n $lat = $this->getPostValue('lat');\n $lon = $this->getPostValue('lon');\n $result = $this->callWindApi($lat, $lon);\n $wind = $this->generateWindResponse($result);\n return $this->json($wind);\n } else {\n return $this->json($this->generateErrorWind());\n }\n }",
"public function showArrivalPoint ()\n\t{\n\t\t$departurepoint = $this->input->post('berangkat');\n\t\t$data['results'] = $this->ModelSystem->showArrivalPoint($departurepoint);\n\t\techo json_encode($data);\n\t}",
"public function getRadius()\r\n {\r\n return $this->radius;\r\n }",
"protected function set_coordinates() \n {\n $response = $this->post_form('geocode/get', $this->base_query);\n\n $this->base_query['lat'] = $response->location->lat;\n $this->base_query['lon'] = $response->location->lon;\n }",
"public function getRadius()\r\n\t\t{\r\n\t\t\t\treturn $this->radius;\r\n\t\t}",
"public function getPolygonList() {\r\n\r\n $resId = $this->request->getData('resid');\r\n $this->autoRender = false;\r\n $this->request->getData('resid');\r\n $coordQuery = $this->Areamaps->find('all', [\r\n 'fields' => [\r\n 'id',\r\n 'mapcoords',\r\n 'colorcode'\r\n ],\r\n 'conditions' => [\r\n 'res_id' => $resId\r\n ],\r\n 'order' => [\r\n 'id' => 'asc'\r\n ]\r\n ])->hydrate(false)->toArray();\r\n $coords = '';\r\n foreach ($coordQuery as $key => $value) {\r\n $coords[] = $value;\r\n }\r\n\r\n echo '{\"rows\":'.json_encode($coords) .'}';\r\n exit();\r\n }",
"private function _radiusSearch($aArgs)\n\t{\n\t\t$aRequired = array('geocoordinates','realestatetype');\n\t\t$oToken = null;\n\t\t$sSecret = null;\n\t\tif(isset($aArgs['username']))\n\t\t{\n\t\t\tlist($oToken, $sSecret) = $this->getApplicationTokenAndSecret($aArgs['username']);\n\t\t\tif($oToken === NULL || $sSecret === NULL)\n\t\t\t{\n\t\t\t\treturn IMMOCASTER_SDK_LANG_APPLICATION_NOT_CERTIFIED;\n\t\t\t}\n\t\t}\n\t\t$req = $this->doRequest('search/v1.0/search/radius',$aArgs,$aRequired,__FUNCTION__,$oToken);\n\t\treturn parent::getContent($req,$sSecret);\n\t}",
"function getlocationcoords($lat, $lon, $width, $height)\n{\n\t$x = (($lon + 180) * ($width / 360));\n\t$y = ((($lat * -1) + 90) * ($height / 180));\n\treturn array(\"x\"=>round($x),\"y\"=>round($y));\n}",
"public function getShowRadius()\n {\n return $this->config()->get('show_radius');\n }",
"public function get_userinfo() {\n $type=substr($this->input->post('title'), strpos($this->input->post('title'), \",\") + 1);\n $id=$this->input->post('userid');\n if($type=='parking') {\n $data['result']=$this->login_model->get_user_name($id);\n } else {\n $data['result']=$this->login_model->get_rider_name($id);\n }\n $data['status'] = '1';\n $data['message'] = 'Latitude and Longitude update';\n $data = array('response' => $data);\n $this->load->view('webservices/json', $data);\n }",
"public function consultar_noticia_lat($id)\n\t{\t\n $respuesta = $this->Panel_lateral_model->get_aviso($id); \n echo json_encode($respuesta);\n // echo '{\"contenido\":\"'.$respuesta['contenido'].'\",\"id\":\"'.$respuesta['id'].'\"}'; \n\t}",
"public function index() {\n\t\tif(is_logged_in() === FALSE) {\n\t\t\t// Redirect to the home page\n\t\t\tredirect( base_url() );\n\t\t}\n\n\t\t// Load required libraries\n\t\t$this->load->library('form_validation');\n\n\t\t// Run form validation\n\t\tif($this->form_validation->run('locator') !== FALSE) {\n\t\t\t// Get submitted coordinates and round them to proper length\n\t\t\t$this->latitude = round($this->input->post('latitude'), 8);\n\t\t\t$this->longitude = round($this->input->post('longitude'), 8);\n\n\t\t\t// Store latituse and longitude in the session data\n\t\t\tif( ($this->session->latitude = $this->latitude) && ($this->session->longitude = $this->longitude) ) {\n\t\t\t\t// If the operation completed successfully\n\t\t\t\techo 'success';\n\t\t\t} else {\n\t\t\t\t// If the operation has failed\n\t\t\t\techo 'error';\n\t\t\t}\n\t\t} else {\n\t\t\t// Show validation errors\n\t\t\techo validation_errors();\n\t\t}\n\t}"
] | [
"0.6047766",
"0.5781768",
"0.57061845",
"0.56576836",
"0.56378007",
"0.56296",
"0.55879027",
"0.55879027",
"0.55879027",
"0.55879027",
"0.55602497",
"0.5552739",
"0.55518985",
"0.5478032",
"0.5472231",
"0.53854",
"0.53821117",
"0.53749883",
"0.5306048",
"0.5288179",
"0.527706",
"0.52712494",
"0.5256611",
"0.52506226",
"0.5242871",
"0.5242516",
"0.5229277",
"0.5225344",
"0.52037865",
"0.5193548"
] | 0.65470046 | 0 |
/Get Polygon list From Database | public function getPolygonList() {
$resId = $this->request->getData('resid');
$this->autoRender = false;
$this->request->getData('resid');
$coordQuery = $this->Areamaps->find('all', [
'fields' => [
'id',
'mapcoords',
'colorcode'
],
'conditions' => [
'res_id' => $resId
],
'order' => [
'id' => 'asc'
]
])->hydrate(false)->toArray();
$coords = '';
foreach ($coordQuery as $key => $value) {
$coords[] = $value;
}
echo '{"rows":'.json_encode($coords) .'}';
exit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_polygon()\n\t{\n\t\t//set return var\n\t\t$js_array = array();\n\n\t\t//get the data\n\t\t$map_id = ee()->gmaps->get_from_tagdata('map:id');\n\t\t$address = ee()->gmaps->get_from_tagdata('address');\n\t\t$latlng = ee()->gmaps->get_from_tagdata('latlng');\n\t\t$stoke_color = ee()->gmaps->get_from_tagdata('stoke_color', '#000000');\n\t\t$stroke_opacity = ee()->gmaps->get_from_tagdata('stroke_opacity', '1');\n\t\t$stroke_weight = ee()->gmaps->get_from_tagdata('stroke_weight', '1');\n\t\t$fill_color = ee()->gmaps->get_from_tagdata('fill_color', '#000000');\n\t\t$fill_opacity = ee()->gmaps->get_from_tagdata('fill_opacity', '0.4');\n\n\t\t//if address empty return a error.\n\t\tif($address == '' && $latlng == '') \n\t\t{\n\t\t\tee()->gmaps->errors[] = 'You forgot to fill in an address or latlng.';\n\t\t\treturn ee()->gmaps->parse_errors();\t\n\t\t}\n\n\t\t//gecode data\n\t\tif($address != '')\n\t\t{\n\t\t\t$geocode_result = ee()->gmaps->geocode_address(explode('|', $address));\n\t\t\t//$geocode_object = ee()->gmaps->geocode_address(explode('|', $address), 'array', 'all');\n\t\t\t$address = $geocode_result['address'];\n\t\t\t$latlng = $geocode_result['latlng'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$latlng = ($latlng);\n\t\t\t$address = \"\";\n\t\t}\n\n\t\t//convert to array\n\t\t$address = gmaps_helper::remove_empty_values(explode('|', $address));\n\t\t$latlng = gmaps_helper::remove_empty_values(explode('|', $latlng));\n\n\t\t//loop over the values\n\t\tif(!empty($latlng))\n\t\t{\n\t\t\tforeach($latlng as $key=>$val)\n\t\t\t{\n\t\t\t\t$js_array['paths'][] = explode(',', $latlng[$key]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->gmaps->errors[] = 'No result founded';\n\t\t\treturn ee()->gmaps->parse_errors();\t\n\t\t}\n\n\t\t//set the js\n\t\t$js = '\n\t\t\tEE_GMAPS.ready(function(){\n\t\t\t\tEE_GMAPS.triggerEvent(\"addPolygon\", {\n\t\t\t\t mapID : \"ee_gmap_'.$map_id.'\",\n\t\t\t\t paths : EE_GMAPS.reParseLatLngArray('.json_encode($js_array['paths']).'),\n\t\t\t\t stokeColor : \"'.$stoke_color.'\",\n\t\t\t\t strokeOpacity : \"'.$stroke_opacity.'\",\n\t\t\t\t strokeWeight : \"'.$stroke_weight.'\",\n\t\t\t\t fillColor : \"'.$fill_color.'\",\n\t\t\t\t fillOpacity : \"'.$fill_opacity.'\"\n\t\t\t\t});\n\t\t\t});\n\t\t';\n\n\t\treturn '<script>'.$js.'</script>';\n\t}",
"public function getLayersData() {\n try {\n $sql=\"SELECT * FROM PROFILE.CA_LAYER_DISPLAY_DATA\";\n $prep=$this->db->prepare($sql);\n $prep->execute();\n while ($result = $prep->fetch(PDO::FETCH_ASSOC)) {\n $records[] = $result;\n }\n return $records;\n } \n catch (PDOException $e) {\n throw new jsException($e);\n } \n }",
"public function getList()\n\t{\n\t\t$st = $this->_getBoundStmt();\n\t\t\n\t\t$r = array();\n\t\twhile( $row = $st->fetch( PDO::FETCH_BOUND ) ) {\n\t\t\t$r[ $this->_d['id'] ] = array(\n\t\t\t\t'id'=>$this->_d['id'],\n\t\t\t\t'x'=>$this->_d['point']['x'],\n\t\t\t\t'y'=>$this->_d['point']['y'],\n\t\t\t\t't'=>$this->_d['time'],\n\t\t\t\t'unit'=>$this->_d['unit'] );\n\t\t}\n\t\t\n\t\treturn $r;\n\t}",
"protected function get_polygons($areaName)\n {\n $r = array();\n \n if (!in_array($areaName, $this->validAreas)) return $r;\n \n if (strstr($areaName, 'left'))\n {\n if ($areaName == 'left_arm')\n {\n $r[] = '77,104,77,97,58,97,58,106,59,107,58,117,58,117,58,118,74,118';\n $r[] = '264,110,264,91,267,85,280,85,281,92,281,106,284,112,284,116,270,116,269,115,268,112';\n }\n elseif ($areaName == 'left_buttock')\n {\n $r[] = '103,178,100,181,91,181,82,178,74,170,74,156,75,146,91,146,97,149,103,149';\n }\n elseif ($areaName == 'left_elbow')\n {\n $r[] = '74,118,58,118,56,124,50,141,69,141,71,137,72,123';\n $r[] = '271,125,270,116,284,116,290,131,291,136,274,136,273,134';\n }\n elseif ($areaName == 'left_hand')\n {\n $r[] = '56,173,44,173,35,185,34,198,36,201,39,202,43,202,47,198,50,192,53,188';\n $r[] = '300,167,290,167,291,180,292,187,296,194,302,198,307,197,308,194,308,185,311,183,311,179';\n }\n elseif ($areaName == 'left_inner_leg')\n {\n $r[] = '102,287,104,276,104,255,93,255,95,294,102,294';\n $r[] = '250,292,248,273,247,251,256,251,256,300,256,301,251,301';\n }\n elseif ($areaName == 'left_foot')\n {\n $r[] = '97,340,104,339,106,335,103,327,103,321,106,314,104,307,102,304,102,294,89,294,91,302,92,305,92,315,90,319,89,329,88,335,89,337';\n $r[] = '255,332,264,331,267,328,265,321,262,314,261,301,251,301,251,307,250,309,250,330';\n }\n elseif ($areaName == 'left_forearm')\n {\n $r[] = '69,141,50,141,50,154,48,163,44,173,56,173,58,166,63,156,66,151,68,147';\n $r[] = '274,136,292,136,294,144,296,153,299,165,299,166,290,166,287,158';\n }\n elseif ($areaName == 'left_knee')\n {\n $r[] = '85,243,83,255,104,255,103,233,84,233';\n $r[] = '244,228,247,251,265,251,266,251,266,245,264,240,264,228';\n }\n elseif ($areaName == 'left_inner_thigh')\n {\n $r[] = '91,181,93,233,103,233,103,183,100,181';\n $r[] = '243,224,242,221,243,173,252,173,252,227,244,227';\n }\n elseif ($areaName == 'left_leg')\n {\n $r[] = '82,267,83,255,93,255,95,294,89,294,87,290,84,283,83,279';\n $r[] = '262,290,260,298,260,301,256,301,256,251,266,251,267,257,266,268,265,276';\n }\n elseif ($areaName == 'left_shoulder')\n {\n $r[] = '63,74,61,82,60,83,59,85,58,97,78,97,84,87,84,66,70,66';\n $r[] = '256,61,267,62,273,67,277,76,280,85,267,85,266,81';\n }\n elseif ($areaName == 'left_temple')\n {\n $r[] = '252,17,254,22,254,24,248,24,247,21,248,13';\n }\n elseif ($areaName == 'left_thigh')\n {\n $r[] = '74,170,75,192,77,199,77,208,83,233,93,233,91,181,82,178';\n $r[] = '252,173,267,156,269,164,270,167,268,199,264,228,252,228';\n }\n elseif ($areaName == 'left_trapezius')\n {\n $r[] = '98,66,70,66,85,59,89,54,98,54';\n }\n }\n elseif (strstr($areaName, 'right'))\n {\n if ($areaName == 'right_arm')\n {\n $r[] = '142,105,141,95,122,95,126,117,144,117';\n $r[] = '197,101,196,116,214,116,215,114,215,84,197,84';\n }\n elseif ($areaName == 'right_buttock')\n {\n $r[] = '106,179,104,177,104,149,107,149,112,145,128,145,129,145,131,167,123,180,114,181,107,181';\n }\n elseif ($areaName == 'right_elbow')\n {\n $r[] = '131,129,126,117,144,117,145,123,151,139,133,139,132,136';\n $r[] = '196,127,195,131,191,138,210,138,211,132,212,131,214,116,196,116';\n }\n elseif ($areaName == 'right_foot')\n {\n $r[] = '116,340,122,340,124,338,125,337,125,331,123,325,122,320,121,315,120,312,120,299,122,293,108,293,109,296,110,319,110,332,109,334,108,338,110,340';\n $r[] = '236,333,234,331,227,331,227,327,228,322,230,316,231,314,231,301,241,301,242,306,243,311,245,317,246,322,247,324,247,332,244,333';\n }\n elseif ($areaName == 'right_forearm')\n {\n $r[] = '151,139,133,139,135,144,140,152,145,161,149,167,159,167,157,164,156,158,155,150';\n $r[] = '202,156,207,147,209,138,191,138,190,155,188,164,197,164';\n }\n elseif ($areaName == 'right_hand')\n {\n $r[] = '189,201,160,197,154,186,152,181,152,174,150,168,159,168,165,175,167,179,179,179,181,175,185,171,188,164,198,164,193,173,193,188,192,191,192,196,190,200';\n }\n elseif ($areaName == 'right_inner_thigh')\n {\n $r[] = '105,183,104,232,114,232,115,181,107,181';\n $r[] = '240,227,230,227,231,173,242,173';\n }\n elseif ($areaName == 'right_inner_leg')\n {\n $r[] = '106,285,105,277,105,256,115,256,114,293,108,293';\n $r[] = '242,278,243,273,243,254,241,251,235,251,235,301,241,301,242,301,242,293';\n }\n elseif ($areaName == 'right_knee')\n {\n $r[] = '122,233,123,244,125,255,125,256,105,256,104,232,122,232';\n $r[] = '241,233,242,235,242,250,241,251,222,251,221,238,221,227,241,227,241,232';\n }\n elseif ($areaName == 'right_leg')\n {\n $r[] = '125,266,122,293,114,293,115,256,125,256,126,260';\n $r[] = '229,293,225,277,223,269,222,268,222,251,235,251,235,301,231,301,231,297';\n }\n elseif ($areaName == 'right_shoulder')\n {\n $r[] = '135,72,139,80,141,89,142,89,142,95,120,95,116,87,116,66,129,66';\n $r[] = '201,71,210,63,214,62,220,62,214,84,196,84,197,81,198,80,199,75';\n }\n elseif ($areaName == 'right_temple')\n {\n $r[] = '223,18,228,13,231,21,230,24,223,24';\n }\n elseif ($areaName == 'right_thigh')\n {\n $r[] = '131,167,132,194,128,207,126,216,125,217,123,232,114,232,115,181,123,180';\n $r[] = '215,197,217,206,219,214,221,218,221,227,230,227,231,174,214,158';\n }\n elseif ($areaName == 'right_trapezius')\n {\n $r[] = '99,54,99,66,129,66,113,59,109,54';\n }\n }\n elseif (strstr($areaName, 'upper_back'))\n {\n $r[] = '98,66,84,67,84,86,85,87,115,87,116,86,116,66';\n }\n elseif (strstr($areaName, 'middle_back'))\n {\n $r[] = '85,87,77,98,79,119,87,121,113,121,121,120,121,100,120,95,115,87';\n }\n elseif (strstr($areaName, 'lower_back'))\n {\n $r[] = '77,124,87,121,113,121,123,123,128,145,112,145,109,138,95,138,91,146,75,146,77,137';\n }\n elseif (strstr($areaName, 'neck'))\n {\n $r[] = '256,61,224,61,230,51,232,53,241,53,248,49';\n $r[] = '108,47,110,41,88,41,89,48,88,54,109,54';\n } \n elseif (strstr($areaName, 'stomach'))\n {\n $r[] = '218,136,215,144,214,158,231,173,251,173,269,154,266,144,265,136,264,125,257,123,251,118,229,118,217,122';\n }\n elseif (strstr($areaName, 'chest'))\n {\n $r[] = '230,118,251,118,256,122,264,125,264,90,266,84,255,61,221,61,214,84,215,84,217,122,229,118';\n } \n elseif (strstr($areaName, 'sacrum'))\n {\n $r[] = '97,149,107,149,112,145,109,138,95,138,91,146'; \n }\n elseif (strstr($areaName, 'forehead'))\n {\n $r[] = '228,13,234,10,243,10,248,13,247,21,231,21';\n } \n elseif (strstr($areaName, 'head'))\n {\n $r[] = '88,41,85,38,83,34,83,27,83,18,87,13,92,10,101,10,107,12,109,14,112,20,113,23,113,35,110,41';\n $r[] = '240,52,233,52,228,47,225,39,224,36,223,27,223,24,230,24,231,21,247,21,248,24,254,24,254,37,251,44,247,49';\n }\n \n return $r;\n }",
"private function process_polygon() {\n\t\tif (empty($this->polygon[0])) {\n\t\t\t$this->errors[$this->file_prefix][$this->poly_id] = [\n\t\t\t\t\"error\" => \"Bad Polygon\",\n\t\t\t\t\"polygon\" => $this->polygon,\n\t\t\t];\n\t\t} else {\n\t\t\t// convert to SQL insertable polygon string\n\t\t\t$poly_sql = $this->Geometry->convert_array_to_poly($this->polygon);\n\t\t\t// encode polygon\n\t\t\t$polyencoded = $this->Encoder->encode_polygon($this->polygon);\n\t\t\t//Format centroid point for mysql insert\n\t\t\t$zip_center = \"(PointFromText('POINT(\".$this->poly_center[1].' '.$this->poly_center[0].\")'))\";\n\n\t\t\t// Validate that this is a valid polygon using MySQL GIS tools\n\t\t\t// XXX: Without the DB lib, consider this psuedo-code to be replaced with whatever DB/ORM tools you're using\n\t\t\t$sql = \"SELECT \" . $poly_sql;\n\t\t\t$result = $db->query($sql);\n\n\t\t\tif (empty($result)) {\n\t\t\t\t$this->poly_count['bad']++;\n\t\t\t\t$this->errors[$this->file_prefix][$this->poly_id] = [\n\t\t\t\t\t\"error\" => $result,\n\t\t\t\t\t\"polygon\" => $this->polygon,\n\t\t\t\t];\n\t\t\t} else {\n\t\t\t\t// XXX: Insert into DB?\n\t\t\t\t$this->poly_count['good']++;\n\t\t\t}\n\t\t}\n\t}",
"public function polygon (array $coordinates) {}",
"public function obtenerAreas();",
"function polygon() {\r\n if (self::$verbose)\r\n echo \"TiledPolygon::polygon()\\n\";\r\n return new Polygon($this->lineStrings());\r\n }",
"public function getGeodata(){\n $all = new UniversityCollection();\n $all->fillFeatures(University::all());\n return json_encode($all);\n }",
"public function getList()\n {\n return $this->createQueryBuilder('Shape')\n ->select('Shape.name, Shape.id')\n ->getQuery()\n ->getArrayResult();\n }",
"function de_get_by_geometry($dbconn, $geometry){\n\t\t$query_by_geometry = 'SELECT * FROM materiales WHERE geometríaDominante = \"'.$geometry.'\" ';\n\n\t\tif(!$result = mysqli_query($dbconn, $query_by_geometry) ){\n\t\t\tdie(mysqli_error($dbconn));\n\t\t}else{\n\t\t\t$result = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function getSpatialExtendDictionary(){\n $sql = \"SELECT Raumgliederung_HTML as name, NAME_EN as name_en, DB_KENNUNG as id, Sortierung as order_id from v_raumgliederung Group By NAME order by Sortierung\";\n return $this->query($sql);\n }",
"public function jsonSerialize(): \\GeoJson\\Geometry\\Polygon\n {\n $linearrings = [];\n foreach ($this->linestrings as $linestring) {\n $linearrings[] = new LinearRing($linestring->jsonSerialize()->getCoordinates());\n }\n\n return new \\GeoJson\\Geometry\\Polygon($linearrings);\n }",
"public function getAllPoints() {\n $txt = new ComplexData(array());\n $res = $this->db->query(\"SELECT poi_id, poi_name FROM t_point_poi WHERE poi_removed = '0' ORDER BY poi_name ASC;\");\n\t\tif ($this->db->affectedRows() >= 1) {\n\t\t\twhile ($don = $this->db->fetchArray($res)) {\n\t\t\t\t$txt->addLine(array($don['poi_id'], $don['poi_name']));\n\t\t\t}\n\t\t\treturn $txt->csvArrays();\n\t\t} else {\n\t\t\treturn 400;\n\t\t}\n }",
"public function getLesPegis() {\n \t\t$requete = 'SELECT idPegi as identifiant, ageLimite as libelle, descPegi as description \n\t\t\t\t\t\tFROM pegi \n\t\t\t\t\t\tORDER BY idPegi';\n\t\ttry\t{\t \n\t\t\t$resultat = PdoJeux::$monPdo->query($requete);\n\t\t\t$tbPegis = $resultat->fetchAll();\t\n\t\t\treturn $tbPegis;\t\t\n\t\t}\n\t\tcatch (PDOException $e)\t{ \n\t\t\tdie('<div class = \"erreur\">Erreur dans la requête !<p>'\n\t\t\t\t.$e->getmessage().'</p></div>');\n\t\t}\n }",
"public function testPolygonRing()\n {\n $rings = [\n new LineString([\n new Point(0, 0),\n new Point(10, 0),\n new Point(10, 10),\n new Point(0, 10),\n new Point(0, 0),\n ]),\n new LineString([\n new Point(5, 5),\n new Point(7, 5),\n new Point(7, 7),\n new Point(5, 7),\n new Point(5, 5),\n ]),\n ];\n $entity = new GeoPolygonEntity();\n\n $entity->setPolygon(new Polygon($rings));\n static::assertIsRetrievableById($this->getEntityManager(), $entity);\n }",
"function getEstacionamientosInternos(){\n\t\t$this->resultado = pg_query($this->con,\"SELECT ST_AsText(estacionamientos.geom) AS pos FROM estacionamientos,calle WHERE ST_DISTANCE_SPHERE(estacionamientos.geom,calle.geom) <= 5 AND calle.id = 1\");\n\t}",
"public function testFindByPolygon()\n {\n $rings = [\n new LineString([\n new Point(0, 0),\n new Point(10, 0),\n new Point(10, 10),\n new Point(0, 10),\n new Point(0, 0),\n ]),\n ];\n $entity = new GeoPolygonEntity();\n\n $entity->setPolygon(new Polygon($rings));\n $this->getEntityManager()->persist($entity);\n $this->getEntityManager()->flush();\n $this->getEntityManager()->clear();\n\n $result = $this->getEntityManager()\n ->getRepository(get_class($entity))\n ->findByPolygon(new Polygon($rings))\n ;\n\n static::assertEquals($entity, $result[0]);\n }",
"public function getRings()\n {\n return $this->getGeometries();\n }",
"function getTileNumbers($polygon, $zoom){\n\tglobal $database;\n\t# BBox des Polygons bestimmen\n\t$sql = \"\n\t\tSELECT \n\t\t\tst_xmin(geom) minx, \n\t\t\tst_xmax(geom) maxx,\n\t\t\tst_ymin(geom) miny,\n\t\t\tst_ymax(geom) maxy\n\t\tFROM (\n\t\t\tSELECT st_geomfromtext('\".$polygon.\"') as geom\n\t\t) as foo\n\t\t\";\n\t$ret = pg_query($database->dbConn, $sql);\n\t$rs=pg_fetch_assoc($ret);\n\t$minx=$rs['minx'];\n\t$miny=$rs['miny'];\n\t$maxx=$rs['maxx'];\n\t$maxy=$rs['maxy'];\n\t\n\t# Kachelnummern aus BBox bestimmen\n\t$upper_left = deg2num($maxy, $minx, $zoom);\t\t// links oben\n\t$lower_right = deg2num($miny, $maxx, $zoom);\t// rechts unten\n\t$lower_right[0]++;\n\t$lower_right[1]++;\n\t$x_count = $lower_right[0] - $upper_left[0];\t// Kachelanzahl in x-Richting\n\t$y_count = $lower_right[1] - $upper_left[1];\t// Kachelanzahl in y-Richting\n\n\t# BBox der Kacheln bestimmen\n\t$upper_left_tiles = num2deg($upper_left[0], $upper_left[1], $zoom);\n\t$lower_right_tiles = num2deg($lower_right[0], $lower_right[1], $zoom);\n\t\t\n\t# Kachel-BBox nach 900913 transformieren\n\t$sql = \"\n\t\tSELECT \n\t\t\tst_x(min) AS minx, \n\t\t\tst_y(min) AS miny,\n\t\t\tst_x(max) AS maxx, \n\t\t\tst_y(max) AS maxy\n FROM (\n\t\t\tSELECT\n\t\t\t\tst_transform(st_geomfromtext('POINT(\".$upper_left_tiles[1].\" \".$lower_right_tiles[0].\")', 4326), 900913) AS min,\n\t\t\t\tst_transform(st_geomfromtext('POINT(\".$lower_right_tiles[1].\" \".$upper_left_tiles[0].\")', 4326), 900913) AS max\n ) AS foo\n\t\";\n\t$ret = pg_query($database->dbConn, $sql);\n\t$rs=pg_fetch_assoc($ret);\n\t$minx=$rs['minx'];\n\t$miny=$rs['miny'];\n\t$maxx=$rs['maxx'];\n\t$maxy=$rs['maxy'];\n\t$tile_width = ($maxy - $miny) / $y_count;\t\t// Kachelbreite in 900913\n\t\n\t# Grid-Tabelle erzeugen\n\techo 'Erzeuge Grid-Tabelle ... ';\n\t$sql = \"\n\t\tCREATE TABLE tile_grid_table as\n\t\t\tSELECT \n\t\t\t\tround((st_xmin(geom) - \".$minx.\")/\".$tile_width.\") + \".$upper_left[0].\" as x,\n\t\t\t\tround((\".$maxy.\" - st_ymax(geom))/\".$tile_width.\") + \".$upper_left[1].\" as y,\n\t\t\t\tgeom \n\t\t\tFROM (\n\t\t\t\tSELECT ST_SetSRID((ST_PixelAsPolygons(ST_AddBand(ST_MakeEmptyRaster(\n\t\t\t\t\t\".$x_count.\", \n\t\t\t\t\t\".$y_count.\", \n\t\t\t\t\t\".$minx.\", \n\t\t\t\t\t\".$maxy.\", \n\t\t\t\t\t\".$tile_width.\"\n\t\t\t\t), '8BSI'::text, 1, 0), 1, false)).geom, 900913) as geom\n\t\t\t) as foo;\n\t\t\t\n\t\tCREATE INDEX tile_grid_table_gist\n\t\tON tile_grid_table\n\t\tUSING gist\n\t\t(geom);\n\t\";\n\t#echo $sql;\n\t$ret = pg_query($database->dbConn, $sql);\n\t\n\t# Kachelnummern durch Verschneidung des Polygons mit Grid-Tabelle bestimmen\n\t$sql = \"\n\t\tSELECT \n\t\t\tx, y, st_intersects(geom, st_transform(st_geomfromtext('\".$polygon.\"', 4326), 900913)) as intersects\n\t\tFROM\n\t\t\ttile_grid_table\n\t\";\n\t$ret = pg_query($database->dbConn, $sql);\n\twhile($rs=pg_fetch_assoc($ret)){\n\t\t$tiles[] = $rs;\n\t}\n\t\n\t# Grid-Tabelle wieder löschen\n\t$sql = \"\n\t\tDROP TABLE tile_grid_table;\n\t\";\n\t$ret = pg_query($database->dbConn, $sql);\n\t\n\treturn $tiles;\n}",
"public function testFunctionInSelect()\n {\n $bigPolygon = $this->persistBigPolygon();\n $smallPolygon = $this->persistSmallPolygon();\n $this->getEntityManager()->flush();\n $this->getEntityManager()->clear();\n\n $query = $this->getEntityManager()->createQuery(\n // phpcs:disable Generic.Files.LineLength.MaxExceeded\n 'SELECT p, ST_AsText(PgSql_Translate(p.polygon, :x, :y)) FROM LongitudeOne\\Spatial\\Tests\\Fixtures\\PolygonEntity p'\n // phpccs: enable\n );\n $query->setParameter('x', 4.0);\n $query->setParameter('y', -4.5);\n $result = $query->getResult();\n\n static::assertCount(2, $result);\n static::assertEquals($bigPolygon, $result[0][0]);\n static::assertSame('POLYGON((4 -4.5,14 -4.5,14 5.5,4 5.5,4 -4.5))', $result[0][1]);\n static::assertEquals($smallPolygon, $result[1][0]);\n static::assertSame('POLYGON((9 0.5,11 0.5,11 2.5,9 2.5,9 0.5))', $result[1][1]);\n }",
"public function getProjectionList(){\n return $this->_get(3);\n }",
"public function getGeoPoints() {\n if (!isset($this->data['georss'])) {\n $this->populateData();\n }\n return $this->data['georss'];\n }",
"function create_polyline()\n\t{\n\t\t//set return var\n\t\t$js_array = array();\n\n\t\t//get the data\n\t\t$map_id = ee()->gmaps->get_from_tagdata('map:id');\n\t\t$address = ee()->gmaps->get_from_tagdata('address');\n\t\t$latlng = ee()->gmaps->get_from_tagdata('latlng');\n\t\t$stoke_color = ee()->gmaps->get_from_tagdata('stoke_color', '#000000');\n\t\t$stroke_opacity = ee()->gmaps->get_from_tagdata('stroke_opacity', '1');\n\t\t$stroke_weight = ee()->gmaps->get_from_tagdata('stroke_weight', '1');\n\n\t\t//if address empty return a error.\n\t\tif($address == '' && $latlng == '') \n\t\t{\n\t\t\tee()->gmaps->errors[] = 'You forgot to fill in an address or latlng.';\n\t\t\treturn ee()->gmaps->parse_errors();\t\n\t\t}\n\n\t\t//gecode data\n\t\tif($address != '')\n\t\t{\n\t\t\t$geocode_result = ee()->gmaps->geocode_address(explode('|', $address));\n\t\t\t//$geocode_object = ee()->gmaps->geocode_address(explode('|', $address), 'array', 'all');\n\t\t\t$address = $geocode_result['address'];\n\t\t\t$latlng = $geocode_result['latlng'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$latlng = ($latlng);\n\t\t\t$address = \"\";\n\t\t}\n\n\t\t//convert to array\n\t\t$address = gmaps_helper::remove_empty_values(explode('|', $address));\n\t\t$latlng = gmaps_helper::remove_empty_values(explode('|', $latlng));\n\n\t\t//loop over the values\n\t\tif(!empty($latlng))\n\t\t{\n\t\t\tforeach($latlng as $key=>$val)\n\t\t\t{\n\t\t\t\t$js_array['path'][] = explode(',', $latlng[$key]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->gmaps->errors[] = 'No result founded';\n\t\t\treturn ee()->gmaps->parse_errors();\t\n\t\t}\n\n\t\t//set the js\n\t\t$js = '\n\t\t\tEE_GMAPS.ready(function(){\n\t\t\t\tEE_GMAPS.triggerEvent(\"addPolyline\", {\n\t\t\t\t mapID : \"ee_gmap_'.$map_id.'\",\n\t\t\t\t path : EE_GMAPS.reParseLatLngArray('.json_encode($js_array['path']).'),\n\t\t\t\t stokeColor : \"'.$stoke_color.'\",\n\t\t\t\t strokeOpacity : \"'.$stroke_opacity.'\",\n\t\t\t\t strokeWeight : \"'.$stroke_weight.'\"\n\t\t\t\t});\n\t\t\t});\n\t\t';\n\n\t\treturn '<script>'.$js.'</script>';\n\t}",
"function get_layer_attributes(){\n\t\t$sql_str = \"SELECT \"\n\t\t\t\t\t. \"tng_spatial_layer.layer_name, \"\n\t\t\t\t\t. \"tng_spatial_attribute_table.view_name, \"\n\t\t\t\t\t. \"tng_spatial_data.pk_col_name, \"\n\t\t\t\t\t. \"tng_spatial_data.geometry_type, \"\n\t\t\t\t\t. \"tng_spatial_layer.proj_string, \"\n\t\t\t\t\t. \"tng_spatial_attribute.attr_name \"\n\t\t\t\t. \"FROM \"\n\t\t\t\t\t. \"tng_spatial_layer \"\n\t\t\t\t\t. \"INNER JOIN tng_spatial_attribute_table \" \n\t\t\t\t\t\t\t\t\t. \"ON tng_spatial_layer.attr_table_id = tng_spatial_attribute_table.attr_table_id \"\n\t\t\t\t\t. \"INNER JOIN tng_spatial_data \" \n\t\t\t\t\t\t\t\t\t. \"ON tng_spatial_attribute_table.spatial_table_id = tng_spatial_data.spatial_table_id \"\n\t\t\t\t\t// note last clause is left join\n\t\t\t\t\t// because not all schema may need\n\t\t\t\t\t// CLASSITEMs\n\t\t\t\t\t. \"LEFT JOIN tng_spatial_attribute \"\n\t\t\t\t\t\t\t\t\t. \"ON tng_spatial_attribute_table.ms_classitem_attr_id = tng_spatial_attribute.attr_id \" \n\t\t\t\t. \"WHERE \"\n\t\t\t\t\t. \"tng_spatial_layer.layer_id = \" . $this->layer_id;\n\t\t\n\t\t$this->dbconn->connect();\n\t\t\t\t\n\t\t$result = pg_query($this->dbconn->conn, $sql_str);\n\t\t\n\t\tif(!$result){\n\t\t\techo \"An error occurred while executing the query - \" . $sql_str .\" - \" . pg_last_error($this->dbconn->conn);\n\t\t\t$this->dbconn->disconnect();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// successfuly ran the query\n\t\t// store layer attributes\n\t\t$this->layer_name = pg_fetch_result($result, 0, 0);\n\t\t$this->view_name = pg_fetch_result($result, 0, 1);\n\t\t$this->geom_pk_col_name = pg_fetch_result($result, 0, 2);\n\t\t$this->geom_type = pg_fetch_result($result, 0, 3);\n\t\t$this->layer_proj= pg_fetch_result($result, 0, 4);\n\t\t$this->layer_ms_classitem = strtolower(pg_fetch_result($result, 0, 'attr_name'));\n\t\t\n\t\t$this->dbconn->disconnect();\n\t\t\n\t\treturn true;\n\t}",
"public function getZones(){\n $resultat = $this->db->select()\n ->from($this->table)\n ->get()\n ->result();\n \n $zoneCollection = new ZoneCollection();\n \n foreach($resultat as $element){\n $dto = $this->hydrateFromDatabase($element);\n $zoneCollection->append($dto);\n }\n \n return $zoneCollection;\n }",
"public function combo(){\n $rows=null;\n $modelo = new Conexion();\n $conexion=$modelo->get_conexion();\n $sql=\"select * from ubicacion_geografica \";\n $statement=$conexion->prepare($sql);\n $statement->execute();\n while ($result=$statement->fetch()) {\n \n $rows[]=$result;\n }\n\n return $rows;\n }",
"public function findLayers()\n {\n $query = <<<SQL\nSELECT l.*, c.mode as controlMode\nFROM tl_leaflet_layer l\nLEFT JOIN tl_leaflet_control_layer c ON l.id = c.lid\nWHERE c.cid=?\nORDER BY c.sorting\nSQL;\n\n $result = Database::getInstance()\n ->prepare($query)\n ->execute($this->id);\n\n if ($result->numRows < 1) {\n return null;\n }\n\n return Collection::createFromDbResult($result, 'tl_leaflet_layer');\n }",
"public static function getAllZones() {\n global $lC_Database;\n\n $Qgroups = $lC_Database->query('select SQL_CALC_FOUND_ROWS * from :table_geo_zones order by geo_zone_name');\n $Qgroups->bindTable(':table_geo_zones', TABLE_GEO_ZONES);\n $Qgroups->execute();\n\n while ( $Qgroups->next() ) {\n $result['zonesArray'][] = $Qgroups->toArray();\n }\n \n $Qgroups->freeResult();\n\n return $result;\n }",
"public function typePolygon(Fluent $column)\n {\n return 'GEOGRAPHY(POLYGON, 4326)';\n }"
] | [
"0.6665438",
"0.6122356",
"0.60433805",
"0.5892634",
"0.5881644",
"0.5841655",
"0.5795955",
"0.57627463",
"0.57600814",
"0.57574743",
"0.5735577",
"0.57337004",
"0.57257277",
"0.5696986",
"0.5688838",
"0.562526",
"0.5619024",
"0.56133115",
"0.55917084",
"0.5557925",
"0.5531902",
"0.5530175",
"0.55117124",
"0.5499807",
"0.54904747",
"0.54759467",
"0.5469936",
"0.54399514",
"0.5437068",
"0.5421645"
] | 0.7990068 | 0 |
Lists all Crop entities | public function listAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$crops = $em->getRepository('AppBundle:Crop')->findAll();
return $this->render('@App/crop/list.html.twig', array(
'crops' => $crops,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllCarousselPicture()\n\t{\n\t\t$qb = $this->createQueryBuilder('c');\n\t\t$qb->select('c.content', 'c.fontColor', 'c.rout', 'c.title')\n\t\t\t->join('c.images', 'i')\n\t\t\t->addSelect('i.url as image_url', 'i.alt as image_alt');\n\t\treturn $qb->getQuery()->getResult();\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('XmCovoiturageBundle:Covoiturage')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function list()\n {\n return \\App\\Compromisso::all();\n }",
"function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Cabos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }",
"public function index()\n {\n $crops = Crop::all();\n\n return view('crops.index', compact('crops'));\n }",
"public function getEntityList();",
"public function show_table()\n {\n //\n $crops = Crop::all();\n return [\n 'crops' => $crops\n ];\n }",
"public function index()\n {\n //\n $crops = Crop::paginate(10);\n $varieties = Variety::with('crop')->orderBy('crop_id')->where('del_flg', 0)->paginate(10);\n return [\n 'varieties' => $varieties,\n 'crops' => $crops\n ];\n }",
"public function getAll(){\n\n return $this->getRep()->findAll();\n }",
"public function entities(){\n }",
"public function catOwnerList(){\n\n $em = $this->getDoctrine()->getManager();\n\n $ownerList = $em->getRepository('AppBundle:Owner')->findAllOrderedByLastName();\n\n return $this->render('cat/ownerlist.html.twig', array(\n 'ownerList' => $ownerList\n ));\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getEntityManager();\n $entities = $em->getRepository('EphpGestoriBundle:Gestore')->findAll();\n\n return array('entities' => $entities);\n }",
"public function getAll()\n {\n return $this->entity->all();\n }",
"public function entities();",
"public function getAll()\n {\n return $this->getRep()->findAll();\n }",
"public function list(): Response\n {\n $covoiturages = $this->getDoctrine()->getRepository(Covoiturage::class)->findAll();\n return $this->render('covoiturage/list.html.twig', [\n 'covoiturages' => $covoiturages,\n ]);\n }",
"public function getEntities();",
"public function getEntities();",
"public function list()\r\n {\r\n return Deck::find([\r\n 'fields' => [\r\n 'name' => true,\r\n 'slug' => true\r\n ]\r\n ]);\r\n }",
"public function getAll()\n {\n $db = new DatabaseManager();\n $connection = $db->getDbh();\n\n $statement = $connection->prepare('SELECT * from cv');\n\n $statement->setFetchMode(\\PDO::FETCH_CLASS, '\\\\Itb\\\\Cv');\n $statement->execute();\n\n $cv = $statement->fetchAll();\n\n return $cv;\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('LibraryBundle:BookCopy')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function getList()\n {\n return $this->createQueryBuilder('Shape')\n ->select('Shape.name, Shape.id')\n ->getQuery()\n ->getArrayResult();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('svplocationAdminBundle:Entrepot')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CatalogoBundle:Catalogo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('FTCCodeBundle:Snippet')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ICantGoConcertBundle:Concert')->findAll();\n\n return $this->render('ICantGoConcertBundle:Concert:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function action_findAll() {\n // Get all the informations from the repository.\n $repo = new Repository_SupplierProduct();\n $suppliersProducts = $repo->getAll();\n \n // Transfert the information to the view.\n $view = View::factory('supplierProduct/suppliersProducts')\n ->set('suppliersProducts', $suppliersProducts);\n \n $this->template->title = __('Suppliers\\' Products');\n $this->template->content = $view;\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4ContableBundle:Egreso')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DistrifilCuentaBundle:Cheque')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('SimpleCatalogBundle:BaseEntity')->findAll();\n\n return $this->render('SimpleCatalogBundle:BaseEntity:index.html.twig', array(\n 'entities' => $entities\n ));\n }"
] | [
"0.63079685",
"0.59980994",
"0.59814554",
"0.5957635",
"0.59404624",
"0.59086347",
"0.58841187",
"0.5856968",
"0.5852278",
"0.58502257",
"0.58061695",
"0.5782524",
"0.5770189",
"0.5757127",
"0.57507396",
"0.57479715",
"0.57244843",
"0.57244843",
"0.5698074",
"0.5685481",
"0.56632817",
"0.56546736",
"0.56395704",
"0.5618403",
"0.5591709",
"0.55715126",
"0.5565478",
"0.55569214",
"0.5555407",
"0.5549714"
] | 0.66081244 | 0 |
Creates a form to delete a Crop entity. | private function createDeleteForm(Crop $crop)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('crop_delete', array('id' => $crop->getId())))
->setMethod('DELETE')
->getForm();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('turnossede_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->factory->createBuilder()\n ->setMethod('DELETE')\n ->getForm();\n }",
"public function createDeleteForm(Opinion $opinion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('opinion_delete', array('idOp' => $opinion->getIdop())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Picture $picture)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('_delete', array('id' => $picture->getId(), 'comment' => $picture->getComment())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"function DeleteImageForm() {\n\t\tif($this->Image()->ID) {\n\t\t\t$isImage = $this->IsImage();\n\t\t\t$type = $isImage ? _t('Controller.IMAGE') : _t('Controller.FILE');\n\t\t\t$title = sprintf(\n\t\t\t\t_t('ImageUploader.DELETE', 'Delete %s', PR_MEDIUM, 'Delete file/image'), \n\t\t\t\t$type\n\t\t\t);\n\t\t\t$form = new Form(\n\t\t\t\t$this,\n\t\t\t\t'DeleteImageForm', \n\t\t\t\tnew FieldSet(\n\t\t\t\t\tnew HiddenField(\"Class\", null, $this->urlParams['Class']),\n\t\t\t\t\tnew HiddenField(\"ID\", null, $this->urlParams['ID']),\n\t\t\t\t\tnew HiddenField(\"Field\", null, $this->urlParams['Field'])\n\t\t\t\t),\n\t\t\t\tnew FieldSet(\n\t\t\t\t\t$deleteAction = new ConfirmedFormAction(\n\t\t\t\t\t\t\"delete\",\n\t\t\t\t\t\t$title, \n\t\t\t\t\t\tsprintf(_t('ImageUploader.REALLYDELETE', \"Do you really want to remove this %s?\"), $type)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$deleteAction->addExtraClass('delete');\n\t\t\t\n\t\t\treturn $form;\n\t\t}\n\t}",
"private function createDeleteForm(Concurso $concurso)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('concurso_delete', array('id' => $concurso->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(RefCategorieBoeth $refCategorieBoeth)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('refcategorieboeth_delete', array('idCategorieboeth' => $refCategorieBoeth->getIdcategorieboeth())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Secteur $secteur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('secteur_delete', array('id' => $secteur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function delete( Entity $form ) {\n\t}",
"private function createDeleteForm(Caract $caract)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caract_delete', array('id' => $caract->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Conversation $conversation)\n {\n $user = $this->container->get('security.token_storage')->getToken()->getUser();\n $em1=$this->getDoctrine()->getManager();\n $commandes = $em1->getRepository('ShopBundle:Commande')->findBy(array('idClient'=>$user));\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('conversation_delete', array('id' => $conversation->getId(),'commandes'=>$commandes)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Paquet_Colis $paquet_Coli)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('colis_delete', array('id' => $paquet_Coli->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"protected function createComponentDeleteForm() {\r\n $form = new Form;\r\n $form->addSubmit('cancel', 'Zrušit');\r\n $form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n $form->onSubmit[] = callback($this, 'deleteFormSubmitted');\r\n $form->addProtection('Odešlete prosím formulář znovu (bezpečnostní token vypršel).');\r\n return $form;\r\n }",
"private function createDeleteForm(CrmOperationsUsers $crmOperationsUser)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('crmoperationsusers_delete', array('id' => $crmOperationsUser->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(LicenciaConduccion $licenciaConduccion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('licenciaconduccion_delete', array('id' => $licenciaConduccion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Comunicado $comunicado)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('comunicado_delete', array('id' => $comunicado->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\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 static function createDeleteForm(Controller $controller, Competence $competence)\n {\n return $controller->createFormBuilder()\n ->setAction($controller->generateUrl('competence_delete', ['id' => $competence->getId()]))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(ConfigSociete $configSociete)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configSociete_delete', ['id' => $configSociete->getId()]))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(RhPuestoPerfil $rhPuestoPerfil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rhpuestoperfil_delete', array('id' => $rhPuestoPerfil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(CvCdoCfgDescuento $cvCdoCfgDescuento)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cvcdocfgdescuento_delete', array('id' => $cvCdoCfgDescuento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(SvCfgTipoGeometria $svCfgTipoGeometria)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('svCfgTipoGeometria_delete', array('id' => $svCfgTipoGeometria->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Constancia $constancium) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('constancia_delete', array('id' => $constancium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(VhloCfgPlaca $vhloCfgPlaca)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('vhlocfgplaca_delete', array('id' => $vhloCfgPlaca->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Attraction $attraction)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('attraction_delete', array('id' => $attraction->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(BpCdp $bpCdp)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bpcdp_delete', array('id' => $bpCdp->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Entreprises $entreprise)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('entreprises_delete', array('id' => $entreprise->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Policeofficer $policeofficer)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('policeofficer_delete', array('id' => $policeofficer->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Receta $recetum) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('receta_delete', array('id' => $recetum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Constat $constat)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('constat_delete', array('codeRec' => $constat->getCodeRec())))\n ->setMethod('DELETE')\n ->getForm();\n }"
] | [
"0.7003263",
"0.6715524",
"0.6527935",
"0.6482312",
"0.6346871",
"0.6291225",
"0.623999",
"0.61962616",
"0.613881",
"0.6122749",
"0.609874",
"0.60803",
"0.6078758",
"0.6071005",
"0.606376",
"0.60605186",
"0.60587436",
"0.60579437",
"0.60507387",
"0.60366744",
"0.6021217",
"0.60207003",
"0.6015574",
"0.6009649",
"0.59848577",
"0.59806126",
"0.5974972",
"0.5973175",
"0.59720695",
"0.5970607"
] | 0.7497352 | 0 |
The prefixRetrieval() method is used to read in the prefixes used in the Globic ontology model and store them in an array for further use | public function prefixRetrieval(){
$filepath = $_SERVER['DOCUMENT_ROOT']."/globicLog/service/ontology_model/Globic_ontology_model.ttl";
$file_contents = "";
$lineskip = 0;
$file = fopen($filepath, "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file)){
$file_contents = $file_contents . fgets($file). "<br>";
}
fclose($file);
$prefix_array1 = explode('<br>' , $file_contents);
$count1 = count($prefix_array1);
for($i = 0; $i < $count1; $i++){
if ($prefix_array1[$i][0] == "@"){
$prefix_array2[$i] = $prefix_array1[$i];
}
else
$lineskip++;
if ($lineskip > 10 )
break;
}
// Now lines beginning with '@prefix' are seperated from rest of file
$count2 = count($prefix_array2);
for($i = 0; $i < $count2; $i++){
$prefix_array3[$i] = explode(' ' , $prefix_array2[$i] , 3); // Explode to get the namespace and the uri
$this->_prefix_list[$i][1] = $prefix_array3[$i][1]; // Namespace stored
//Now get uri on its own
$trimmed1 = trim($prefix_array3[$i][2]); // Remove white space
$trimmed2 = trim($trimmed1, "<"); // Remove "<"
$trimmed3 = trim($trimmed2, "."); // Remove "."
$trimmed4 = trim($trimmed3); // Remove whitespace again
$trimmed5 = trim($trimmed4, ">"); // Remove ">"
$this->_prefix_list[$i][0] = $trimmed5; // URI stored
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPrefix();",
"public function getCurrentPrefixList();",
"public function getPrefix();",
"public function getPrefix();",
"public function getPrefixes()\r\n {\r\n return $this->prefixes;\r\n }",
"public static function GetPrefixes()\n {\n return self::$prefixes;\n }",
"public function getPrefix()\n {\n }",
"public function get_prefix_name() {\n $this->db->select('prefix, id');\n $this->db->from('main_prefix');\n $query = $this->db->get();\n return $query->result_array();\n }",
"public function getPrefix() : string;",
"public function findPrefix();",
"public function getPrefix():string;",
"public function getPrefix(): string;",
"public function getTermsPrefix() {}",
"function getPrefix()\n {\n $prefix = $this->row['prefix'];\n $prefixes = explode(',', $prefix);\n if (count($prefixes) > 1)\n return $prefixes;\n else\n return $prefix;\n }",
"function prefixes() {\n\t\t$self =& Router::getInstance();\n\t\treturn $self->__prefixes;\n\t}",
"public function prefixKeys($prefix);",
"protected function getPrefixes()\n {\n $prefixes = $this->options['prefixes'];\n if ($prefixes) {\n return $prefixes;\n }\n\n return self::$standardizedPrefixes[$this->getMode()];\n }",
"public function getPrefixes($ignore = array('.*'));",
"public function prefix( $prefix );",
"function prefixList()\n {\n static $prefixList = array(\n 'course' => 'course_',\n 'group' => 'group_',\n 'other' => 'other_'\n );\n \n return $prefixList;\n }",
"private function getNamespacePrefixes(): array\n {\n return array_keys($this->getNamespaces());\n }",
"public function getPrefixDirs(): array;",
"public function listKeys($prefix = '');",
"protected function getPrefixKeys()\n {\n $options = $this->pubsub->getClient()->getOptions();\n\n if (isset($options->prefix)) {\n return $options->prefix->getPrefix();\n }\n\n return '';\n }",
"public function setPrefix($prefix)\r\n {\r\n $this->_prefix = $prefix;\r\n return $this->load();\r\n }",
"public function get_prefix() {\n\t \treturn $this->_prefix;\n\t }",
"function __setPrefixes() {\n\t\t$routing = Configure::read('Routing');\n\t\tif (!empty($routing['admin'])) {\n\t\t\t$this->__prefixes[] = $routing['admin'];\n\t\t}\n\t\tif (!empty($routing['prefixes'])) {\n\t\t\t$this->__prefixes = array_merge($this->__prefixes, (array)$routing['prefixes']);\n\t\t}\n\t}",
"public function getPrefix()\r\n {\r\n return $this->_prefix;\r\n }",
"public function getPrefix(){\r\n\t\treturn $this->prefix;\r\n\t}",
"public function getKeysByPrefix($prefix)\n {\n if (empty($prefix)) throw new \\Exception(\"Cannot get the included keys without prefix string!\", 1);\n $prefix = $this->driver_prefix . ':' . $prefix;\n if ($this->driver != 'redis') throw new \\Exception(\"暂时只支持获取 Redis 缓存\", 1);\n\n $method_name = 'getKeysBy'.ucfirst(camel_case($this->driver)).'Prefix';\n return call_user_func(array($this, $method_name), $prefix);\n }"
] | [
"0.7196801",
"0.701141",
"0.69559705",
"0.69559705",
"0.6826709",
"0.6701199",
"0.66085875",
"0.65376604",
"0.65203243",
"0.6465433",
"0.6453932",
"0.6433902",
"0.63751525",
"0.63569146",
"0.6316314",
"0.63043696",
"0.6296319",
"0.6276298",
"0.62189496",
"0.6008208",
"0.5961891",
"0.5923146",
"0.5921283",
"0.5897431",
"0.58966684",
"0.587943",
"0.5876128",
"0.5846843",
"0.5839656",
"0.58142126"
] | 0.7926224 | 0 |
Subsets and Splits