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 |
---|---|---|---|---|---|---|
Devuelve la coleccion por indice | function getColeccionByIndice($indice){
$sql = "select nombre from coleccion where id_coleccion='".$indice."'";
global $conn;
if($result = $conn->query($sql)){
while($row = $result->fetch_row()){
$resultado = $row[1];
}
return $resultado;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function selectByIndex($index);",
"function seleccionado()\n\t{\n\t\treturn $this->tiene_estado();\n\t}",
"public function select($interescuentavivienda);",
"public function selecionarAction() {}",
"function ordenSeleccionada(){\n global $sContrato;\n $orden = $this->cmdOrdenAbre->readItemIndex();\n if($orden<0){\n $rs = mysql_query(\"select sNumeroOrden from ordenesdetrabajo\n where sContrato='$sContrato' limit 1\");\n if($row = mysql_fetch_array($rs)){\n $orden=$row['sNumeroOrden'];\n }\n }\n return $orden;\n }",
"function List_Selec ($ind,$campanha){\n\n\t $linha0 = '<select name=\"acescamp\" id=\"acescamp\" class=\"form-control\" tabindex=\"'.$ind.'\">';\n\t $linha1=\"<option></option>\";$linha2 = '';\n while($this->col_lst = mysql_fetch_array($this->sql_lst))\n {\n\t\t\t$linha2 .= \"<option value='\".$this->col_lst[\"acesso\"].\"'>\".$this->col_lst[\"titulo\"].\"</option>\";\n\t\t\tif ($campanha==$this->col_lst[\"acesso\"]) {\n\t\t\t\t$linha1 = \"<option value='\".$this->col_lst[\"acesso\"].\"'>\".$this->col_lst[\"titulo\"].\"</option>\".$linha1;\n\t\t\t}\n \t}\n\t return $linha0.$linha1.$linha2.'</select>';\n\t}",
"public function select($puesto);",
"abstract protected function handleSelected();",
"public function select($tipo_equipo);",
"public function seleccionarFoco1() {\n AccesoGui::$guiDispositivos->seleccionarFocos(1);\n //$this->setDispositivo(\"FOCO_\"+$idFoco);\n }",
"public function getSelect();",
"function es_seleccionable()\n\t{\n\t\treturn false;\n\t}",
"public function select($index)\n\t{\n\t\treturn $this->data[$index];\n\t}",
"function Seleccion(){\n\t\t$this->con = new bd;\n\t }",
"public function seleccionarCamara3( ) {//kamara bakoitzeko bat\n AccesoGui::$guiDispositivos->seleccionarCamara(3);\n}",
"public function tiendasEditSelection()\n\t{\n// print_r($_POST);\n \n $codigos_inicio = $_POST['item_row'];\n $estado = $_POST['edit_type'];\n \n require_once 'models/TiendasModel.php';\n $model = new TiendasModel();\n \n foreach ($codigos_inicio as $codes) {\n// print($codes.\"<br>\");\n \n $codes = explode(\"--\", $codes);\n// print_r($codes[0]);\n// print(\"<br>\");\n \n $model->editTiendaEstado($codes[0], $codes[1], $estado);\n }\n\t}",
"public function seleccionarCamara2( ) {//kamara bakoitzeko bat\n AccesoGui::$guiDispositivos->seleccionarCamara(2);\n}",
"public function seleccionarCamara1( ) {//kamara bakoitzeko bat\n AccesoGui::$guiDispositivos->seleccionarCamara(1);\n}",
"public function seleccionarLuces( ) {\n AccesoGui::$guiDispositivos->seleccionarLuces();\n }",
"public function getChildrenIndex();",
"public function select($id){\n \n }",
"function List_sel (){\n\techo \"<select name='{$this->texto_field}' id='{$this->texto_field}' class='' tabindex='++$ind'>\";\n\techo \"<option value=''>-->> Escolha <<--</option>\";\n\t while($this->col_lst = mysql_fetch_array($this->sql_lst))\n\t {\n\t echo \"<option value='\".$this->col_lst[\"id\"].\"'>\".$this->col_lst[$this->campo_retorno].\"</option>\";\n\t }\n\techo \"</select>\";\n }",
"public function select() {\n\t}",
"function getSelectId($caption);",
"function checkedSelect( $nom, $structure, $contenu, $selection = null) \n{\n if(sizeof($selection) == sizeof($contenu))\n $checked = \"checked\";\nelse\n $checked = \"\";\n\n\n$str = '<div class=\"div_select\">'\n.'<div class=\"div_select_header\">'\n.'<table width=\"100%\">'\n.'<tr>'\n.'<td width=\"20\" align=\"center\"><input type=\"checkbox\" id=\"'.$nom.'\" onClick=\"javascript:selectAll(this, '.sizeof($contenu).');\" '.$checked.'/></td>';\n\n //--- colonnes\nfor($i = 0, $max = sizeof($structure); $i < $max; $i++) {\n $str .= '<td ';\n if(isset($structure[$i][\"align\"])) $str .= 'align=\"'.$structure[$i][\"align\"].'\" ';\n if(isset($structure[$i][\"width\"])) $str .= 'width=\"'.$structure[$i][\"width\"].'\" '; \n $str .= '>'.$structure[$i][\"name\"].'</td>'; \n}\n\n$str .= '</tr>'\n.'</table>'\n.'</div>';\n\n //////////////// contenu du composant \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \n$str .= '<div class=\"div_select_content\" >' \n.'<table width=\"100%\">';\n\n //--- pour chaque ligne\nfor($i = 0, $max = sizeof($contenu); $i < $max; $i++) {\n\n //--- style css (pair / impair) \n if($i%2)\n $css_defaut = 'select_odd';\n else\n $css_defaut = 'select_even'; \n\n //--- element selectionne ?\n if($selection != null && in_array($contenu[$i][0],$selection)) { \n $checked = ' checked';\n $css = 'select_checked'; \n }\n else {\n $checked = '';\n $css = $css_defaut; \n }\n\n //--- la checkbox\n $str .= '<tr id=\"tr_'.$nom.$i.'\" class=\"'.$css.'\" onMouseOver=\\'javascript:setEvenement(\"'.$nom.'\",\"'.$i.'\",\"over\",\"'.$css.'\",'.sizeof($contenu).',\"td\");\\' onMouseOut=\\'javascript:setEvenement(\"'.$nom.'\",\"'.$i.'\",\"out\",\"'.$css_defaut.'\",'.sizeof($contenu).',\"td\");\\' '\n .' onClick=\\'javascript:setEvenement(\"'.$nom.'\",\"'.$i.'\",\"click\", \"'.$css_defaut.'\",'.sizeof($contenu).',\"td\");\\' >'\n .'<td width=\"20\" ><input type=\"checkbox\" id=\"'.$nom.$i.'\" name=\"'.$nom.'[]\" value=\"'.$contenu[$i][0].'\" onClick=\\'javascript:setEvenement(\"'.$nom.'\",\"'.$i.'\",\"click\",\"'.$css_defaut.'\",'.sizeof($contenu).',\"ck\");\\' '.$checked.' /></td>';\n\n //--- les colonnes\n for($j = 1; $j < sizeof($contenu[$i]); $j++) { \n $str .= '<td ';\n if(isset($structure[$j-1][\"align\"])) $str .= 'align=\"'.$structure[$j-1][\"align\"].'\" '; \n if(isset($structure[$j-1][\"width\"])) $str .= 'width=\"'.$structure[$j-1][\"width\"].'\" '; \n $str .= '>'.$contenu[$i][$j].'</td>'; \n }\n\n $str .= '</tr>';\n}\n\n //--- fermeture des balises\n$str .= '</table>'\n.'</div>'\n.'</div>';\n\nreturn $str;\n}",
"public function select() { }",
"function getSelected()\n {\n return $this->m_selected;\n }",
"function drawSelect($row,$name,$id=\"\"){\r\n $select=\"<select class='ui dropdown' name='$name'>\";\r\n $select.=\"<option value=''>Selecione...</option>\";\r\n foreach($row as $value){\r\n if($id==$value['nombre']) $select.=\"<option value=\".$value['id'].\" selected>\";\r\n else $select.=\"<option value=\".$value['id'].\">\";\r\n $select.=$value['nombre'].\"</option>\";\r\n \r\n }\r\n $select.=\"</select>\";\r\n return $select;\r\n}",
"function cargarListBoxArrayAsociativo($arr,$seleccionado) {\n $i=0;\n $resultado=\"\";\n\tforeach($arr as $k => $v) {\n\t $resultado.= \"<option\";\n\t if ($k==$seleccionado) {\n\t $resultado.= \" selected ='selected' \";\n\t }\n\t $resultado.= \" value='\" . $k . \"'\";\n\t $resultado.= \">\" . $v . \"</option>\";\n\t}\n return $resultado;\n}",
"public function Select(){\n\t\t\t//Query para selecionar a tabela contatos\n\t\t\t$sql=\"SELECT * FROM tbl_cargo WHERE ativo = 1 ORDER BY id_cargo DESC;\";\n\n\t\t\t//Instancio o banco e crio uma variavel\n\t\t\t$conex = new Mysql_db();\n\n\t\t\t/*Chama o método para conectar no banco de dados e guarda o retorno da conexao\n\t\t\tna variavel que $PDO_conex*/\n\t\t\t$PDO_conex = $conex->Conectar();\n\n\t\t\t//Executa o select no banco de dados e guarda o retorno na variavel select\n\t\t\t$select = $PDO_conex->query($sql);\n\n\t\t\t//Contador\n\t\t\t$cont = 0;\n\n if(!empty($select)){\n //Estrutura de repetição para pegar dados\n while ($rs = $select->fetch(PDO::FETCH_ASSOC)) {\n #Cria um array de objetos na classe contatos\n\n $lista_cargo[] = new Cargo();\n\n // Guarda os dados no banco de dados em cada indice do objeto criado\n $lista_cargo[$cont]->id_cargo = $rs['id_cargo'];\n $lista_cargo[$cont]->id_nivel_funcionario = $rs['id_nivel_funcionario'];\n $lista_cargo[$cont]->cargo = $rs['cargo'];\n $lista_cargo[$cont]->descricao = $rs['descricao'];\n $lista_cargo[$cont]->ativo = $rs['ativo'];\n\n // Soma mais um no contador\n $cont+=1;\n }\n }else{\n $lista_cargo = array();\n }\n\n\t\t\t$conex::Desconectar();\n\n\t\t\t//Apenas retorna o $list_contatos se existir dados no banco de daos\n\t\t\tif (isset($lista_cargo)) {\n\t\t\t\t# code...\n\t\t\t\treturn $lista_cargo;\n\t\t\t}\n\n\t }"
] | [
"0.6589736",
"0.59688175",
"0.59156585",
"0.57218134",
"0.5695879",
"0.557949",
"0.55757797",
"0.55531704",
"0.5533577",
"0.5521032",
"0.55196023",
"0.54993457",
"0.54960704",
"0.5465257",
"0.54434615",
"0.54084736",
"0.53985524",
"0.5391804",
"0.53774285",
"0.5355765",
"0.53506905",
"0.53425896",
"0.53039587",
"0.5290204",
"0.52895653",
"0.52824116",
"0.52795553",
"0.5275641",
"0.5263419",
"0.52583224"
] | 0.6016801 | 1 |
Forward to page editor | protected function forwardToPageObject()
{
global $lng,$tpl;
$key = (int) $_REQUEST['key'];
$this->ctrl->saveParameter($this,'key',$key);
include_once("./Services/COPage/classes/class.ilPageObject.php");
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
include_once './Services/Style/classes/class.ilObjStyleSheet.php';
$lng->loadLanguageModule("content");
if (!ilPageObject::_exists('auth',$key))
{
// doesn't exist -> create new one
$new_page_object = new ilPageObject('auth');
$new_page_object->setParentId($key);
$new_page_object->setId($key);
$new_page_object->createFromXML();
}
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$tpl->setVariable("LOCATION_CONTENT_STYLESHEET",ilObjStyleSheet::getContentStylePath(0));
$tpl->setCurrentBlock("SyntaxStyle");
$tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",ilObjStyleSheet::getSyntaxStylePath());
$tpl->parseCurrentBlock();
$this->ctrl->setReturnByClass('ilpageobjectgui', "edit");
$page_gui = new ilPageObjectGUI('auth',$key);
$page_gui->setIntLinkHelpDefault("RepositoryItem",$key);
$page_gui->setTemplateTargetVar("ADM_CONTENT");
$page_gui->setLinkXML($link_xml);
//$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
//$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
//$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen"));
//$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
// $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, ""));
$page_gui->setPresentationTitle("");
$page_gui->setTemplateOutput(false);
//$page_gui->setLocator($contObjLocator);
$page_gui->setHeader("");
$page_gui->setEnabledRepositoryObjects(true);
$page_gui->setEnabledLoginPage(true);
$page_gui->setEnabledFileLists(false);
$page_gui->setEnabledMaps(true);
$page_gui->setEnabledPCTabs(true);
$page_gui->setEnabledInternalLinks(true);
// style tab
//$page_gui->setTabHook($this, "addPageTabs");
if($this->ctrl->getCmd() == 'editPage')
$this->ctrl->setCmd('edit');
$html = $this->ctrl->forwardCommand($page_gui);
$tpl->setContent($html);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function gotToPage($pageName){\n $allPages = array_merge($this->navItems['editorPages'],$this->navItems['pages']);\n $location = array_search($pageName, $allPages);\n header(\"location: ./$location.php\");\n }",
"public function editorbrowse()\n {\n $this->assign('is_editor', true)\n ->assign('popup_layout', true)\n ->assign('adminmenu', '');\n\n $this->browse();\n }",
"public function enteringAction() {\n\t\t$this->forward('index', array('type'=>2));\n\t\treturn FALSE;\n\t}",
"private function goToPage() {\n\t\t$current = $this->ask('Please indicate which page you will like to load (number)');\n\t\tif (is_numeric($current)) {\n\t\t\t$this->page['current'] = $current;\n\t\t\t$this->load();\n\t\t} else {\n\t\t\t$this->error(\"Value is required or invalid type\");\n\t\t\t$this->changePageSize();\n\t\t}\n\t}",
"public function forward()\r\n\t{\r\n\t\t$this->redirect($this->build());\t\t\r\n\t}",
"public function editAction()\n {\n $this->_forward('new');\n }",
"public function execute()\n {\n $this->_forward('edit');\n }",
"public function goToPageAction()\n {\n $page = $this->get('request')->query->get('page');\n if (empty($page)) $page = 0;\n return $this->redirect($this->generateUrl('item_page',['page'=>$page]));\n }",
"function gotoPage()\n\t{\n\t\t$this->ctrl->setParameter($this, \"activecommand\", \"gotoPage\");\n\t\t$this->ctrl->setParameter($this, \"qid\", $_GET[\"qid\"]);\n\t\t$this->ctrl->setParameter($this, \"direction\", \"0\");\n\t\t$this->ctrl->redirect($this, \"redirectQuestion\");\n\t}",
"public function restorethispage()\n {\n $id_page = $this->request->getParameter(\"id\");\n $this->page->restorePage($id_page);\n $this->message->pageRestored();\n }",
"function editor(){\n\t\tswitch($this->EditPageNr){\n\t\t\tdefault:\n\t\t\t\t$_SESSION['weS']['EditPageNr'] = $this->EditPageNr = we_base_constants::WE_EDITPAGE_PROPERTIES;\n\t\t\tcase we_base_constants::WE_EDITPAGE_PROPERTIES:\n\t\t\tcase we_base_constants::WE_EDITPAGE_WORKSPACE:\n\t\t\t\treturn 'we_editors/we_editor_properties.inc.php';\n\t\t\tcase we_base_constants::WE_EDITPAGE_INFO:\n\t\t\t\treturn 'we_editors/we_editor_info_objectFile.inc.php';\n\t\t\tcase we_base_constants::WE_EDITPAGE_CONTENT:\n\t\t\t\treturn 'we_editors/we_editor_contentobjectFile.inc.php';\n\t\t\tcase we_base_constants::WE_EDITPAGE_PREVIEW:\n\t\t\t\treturn 'we_showObject.inc.php';\n\t\t\tcase we_base_constants::WE_EDITPAGE_SCHEDULER:\n\t\t\t\treturn 'we_editors/we_editor_schedpro.inc.php';\n\t\t\tcase we_base_constants::WE_EDITPAGE_VARIANTS:\n\t\t\t\treturn 'we_editors/we_editor_variants.inc.php';\n\t\t\tcase we_base_constants::WE_EDITPAGE_WEBUSER:\n\t\t\t\treturn 'we_editors/editor_weDocumentCustomerFilter.inc.php';\n\t\t\tcase we_base_constants::WE_EDITPAGE_VERSIONS:\n\t\t\t\treturn 'we_editors/we_editor_versions.inc.php';\n\t\t}\n\t}",
"public function plugin_submenu_page_editor() {\n\t\tinclude_once( GW_GO_PORTFOLIO_INCLUDES. 'submenu_page_editor.php' );\n\t}",
"public function addressbook_page() {\n\t\t$this->addressbook->plugin_page();\n\t}",
"private function __goUserEdit()\n {\n redirect('minha-conta');\n }",
"public function backToHome()\n {\n $this->view(\"ModeratorHomePage\");\n }",
"public function action_edit()\n {\n // Get slug\n $slug = \\avalon\\http\\Router::$params['slug'];\n\n $this->title(l('edit'));\n\n // Fetch the page from the database\n $page = $this->project->wiki_pages->where('slug', $slug)->exec()->fetch();\n\n // Check if the form has been submitted\n if (Request::method() == 'post') {\n // Update the page information\n $page->set(array(\n 'title' => Request::post('title'),\n 'slug' => Request::post('slug'),\n 'project_id' => $this->project->id\n ));\n\n if (Request::post('body') != $page->revision->content) {\n $page->revision = new WikiRevision(array(\n 'wiki_page_id' => $page->id,\n 'revision' => $page->revision->revision + 1,\n 'content' => Request::post('body'),\n 'user_id' => $this->user->id\n ));\n }\n\n // Save and redirect\n if ($page->save()) {\n // Update revision\n $page->revision->save();\n $page->revision_id = $page->revision->id;\n $page->save();\n\n // Insert timeline event\n $timeline = new Timeline(array(\n 'project_id' => $this->project->id,\n 'owner_id' => $page->id,\n 'action' => 'wiki_page_edited',\n 'user_id' => $this->user->id\n ));\n $timeline->save();\n\n if ($this->is_api) {\n return \\API::response(1, array('page' => $page));\n } else {\n Request::redirectTo($page->href());\n }\n }\n }\n\n View::set('page', $page);\n }",
"private function list_page_redirect() {\r\n wp_redirect( \r\n esc_url_raw( \r\n add_query_arg( \r\n array(\r\n 'page' => self::LIST_PAGE \r\n ),\r\n admin_url( self::PARENT_MENU )\r\n ) \r\n ) );\r\n exit; \r\n }",
"public function indexAction() \n\t{\n\t\t$this->_forward('browse');\n\t}",
"public function redirect_to_new_url() {\n\t\tif ( ! isset( $_GET['elementor'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$document = Plugin::$instance->documents->get( get_the_ID() );\n\n\t\tif ( ! $document ) {\n\t\t\twp_die( __( 'Document not found.', 'elementor' ) );\n\t\t}\n\n\t\tif ( ! $document->is_editable_by_current_user() || ! $document->is_built_with_elementor() ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_safe_redirect( $document->get_edit_url() );\n\t\tdie;\n\t}",
"public function render_wizard() {\n\t\tinclude Plugin::instance()->get_view( 'common/page' );\n\t}",
"private function runPage(){\n list($source, $formOptions, $logStatus, $tableData, $studentData, $studentSchools) = $this->model->preparePageContent($this->nav);\n print $this->view->pageView($source, $formOptions, $logStatus, $tableData, $this->url, $studentData, $studentSchools);\n }",
"public function open()\n {\n $this->page = 1;\n }",
"public function pageread()\n {\n $id_page = $this->request->getParameter(\"id\");\n $page = $this->page->getPage($id_page);\n $this->generateadminView(array(\n 'page' => $page\n ));\n }",
"public function attachPage() { }",
"public function store()\n\t{\n\t\t//\n if($this->page->addpage(Input::all()))\n\t\t{\n return $this->redirectToIndexWithMessage($this->page->message);\n }\n return $this->redirectBackWithInputsAndErrors($this->page->validator->errors);\n }",
"public function setPage() {\n }",
"public function turnPage();",
"public function handleAction()\n {\n $page = $this->getKrynCore()->getCurrentPage();\n\n //is link\n if ($page->getType() == 1) {\n $to = $page->getLink();\n if (!$to) {\n throw new \\Exception('Redirect failed: ' .\n sprintf('Current page with title %s has no target link.', $page->getTitle())\n );\n }\n\n if (intval($to) > 0) {\n return new RedirectResponse($this->getKrynCore()->getNodeUrl($to), 301);\n } else {\n return new RedirectResponse($to, 301);\n }\n }\n\n if ($this->getKrynCore()->isEditMode()) {\n $adminAssets = new AdminAssets($this->getKrynCore());\n $adminAssets->handleKEditor();\n }\n\n $pageResponse = $this->getKrynCore()->getPageResponse();\n $pageResponse->setRenderFrontPage(true);\n $pageResponse->renderContent();\n\n return $pageResponse; //new Response('<body>ho</body>');\n }",
"function openEditor( )\n {\n echo '' .\n '<form action=\"http://apps.facebook.com/notesharesep/controllers/NewGroup.php\" method=\"GET\" target=\"_top\"\n <table class=\"formTable\">';\n }",
"private function pageURL()\n\t{\n\t\t$base = ( $this->post_type->name == 'post' ) ? admin_url('edit.php') : admin_url('admin.php');\n\t\treturn $base . '?page=' . $_GET['page'];\n\t}"
] | [
"0.6630804",
"0.6119345",
"0.600788",
"0.5998085",
"0.5996172",
"0.59945184",
"0.5933118",
"0.59302574",
"0.591873",
"0.5891939",
"0.5840936",
"0.58348083",
"0.5819661",
"0.5777878",
"0.576342",
"0.573109",
"0.5720021",
"0.5711769",
"0.5701612",
"0.56887954",
"0.56757826",
"0.56572086",
"0.56392294",
"0.5638028",
"0.5635949",
"0.56162566",
"0.56037855",
"0.56019104",
"0.5597949",
"0.55905914"
] | 0.6282116 | 1 |
Show ILIAS page editor summary. | protected function showIliasEditor()
{
global $tpl;
include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorTableGUI.php';
$tbl = new ilAuthLoginPageEditorTableGUI($this,'show');
$tbl->parse();
$tpl->setContent($tbl->getHTML());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function summary()\n {\n // @todo: Display summary\n }",
"function infoScreen()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreenForward();\n\t}",
"function summary(){\n\n\t\techo 'Title : ' . $this->title . \"<br />\"; \n\t\techo 'Author : ' .$this->author .\"<br />\";\n\t\techo 'Publisher : ' .$this->publisher. \"<br />\";\n\t}",
"function infoScreenObject()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreenForward();\n\t}",
"public function index()\n\t{\n\t\t$data['title'] = \"ELR IT Assets Summary\";\n \t\t$this->load->model('itassets_model','iam',TRUE);\n\t\t$data['summary'] = $this->iam->get_summary();\n\t\t$data['content'] = \"summary\";\n\t\t$data['scripts'] = array('elritassets');\n\t\t$this->load->view('layout',$data);\n\t}",
"public function profileSummary() {\r\n $_SESSION[\"page\"] = \"Summary\";\r\n $view = new Template();\r\n echo $view->render(\"views/profile-summary.html\");\r\n }",
"function summary()\r\n {\r\n // display the form summary\r\n $view = new Template();\r\n echo $view->render('views/summary.html');\r\n }",
"public function show_meta_box() {\n\t\techo githuber_load_view( 'metabox/html-to-markdown' );\n\t}",
"function summary() {\n\t\t/**\n\t\t * Put all informations in \"options\".\n\t\t * $options will be available in the view.\n\t\t */\n\t\t$this->set('options', $this->Option->find('all'));\n\t}",
"public function print_summary_view() {\n\t\techo $this->get_summary_view();\n\t}",
"public function summary(): string\n {\n return 'This is the summary';\n }",
"public function index_summary() {\n $assets = Asset::where('owner', Auth::user()->id)->get();\n\n return view('layouts.assets.summary', ['assets' => $assets]);\n }",
"public function overview()\n {\n return Admin::content(function (Content $content) {\n\n $content->header('總覽');\n $content->description('');\n\n $content->body($this->grid('overview'));\n });\n }",
"public function summaryAction()\n {\n $this->saveAjax('module-summary');\n\n return 1;\n }",
"protected function printSummary() {\n $this->printHeader1('Summary');\n $this->output->writeln('1. Consolidating configuration');\n $this->output->writeln('2. Checking packages');\n $this->output->writeln('3. Updating packages');\n $this->output->writeln('4. Report');\n $this->output->writeln('');\n }",
"public static function getDescription() {\n return 'Page information gives basic information about pages, typically\n this is static info and should not need much updating.';\n }",
"function showPageNotice()\n {\n $instr = $this->getInstructions();\n $output = common_markup_to_html($instr);\n\n $this->elementStart('div', 'instructions');\n $this->raw($output);\n $this->elementEnd('div');\n }",
"public function showPage()\n {\n echo $this->getPage();\n }",
"public function show()\n {\n $book = Book::getInstance();\n $form_data = array(\n 'data' => ($book->error)?$book->form_data:null,\n 'error_msg' => $book->error_msg,\n 'error' => $book->error\n );\n\n $messages = $book->getMessages();\n $page_atts = array(\n 'form' => $this->getView('form', $form_data),\n 'messages' => $messages,\n 'pagination' => $this->pagination()\n );\n\n $view = $this->getView('page', $page_atts);\n echo $view;\n }",
"public abstract function summary();",
"public function get_summary_view() {\n\n\t\t$plugin = $this;\n\t\t$template = pkppgInit()->get_template_path( 'plugin-summary.php' );\n\t\tif ( !empty( $template ) ) {\n\t\t\tob_start();\n\t\t\tinclude( $template );\n\t\t\treturn ob_get_clean();\n\t\t}\n\n\t\treturn '';\n\t}",
"public function show(){\n\t\t\t$this->setNamePage('ajustes');\n\n\t\t\t//definições do HEAD\n\t\t\t$html = $GLOBALS['f']->template->html;\n\t\t\t$html->head->setMetaTitle($html->head->getMetaTitle().' - Ajustes');\n\n\t\t\t$this->read();\n\t\t}",
"public function pageViewer()\n {\n\n $this->renderPageFile('page.pageviewer');\n }",
"public function Show()\n\t{\n\t\t// Get the needed objects.\n\n\t\t// fetch and show page header\n\t\tglobal $dontUseWikiDb;\n\n\t\tBootstrapSkin::displayInternalHeader();\n\n\t\tif ($this->requiresWikiDatabase() && ($dontUseWikiDb == 1)) {\n// wiki database unavailable, don't show stats page\n\t\t\tBootstrapSkin::displayAlertBox(\"This statistics page is currently unavailable.\", \"alert-error\", \"Database unavailable\", true, false);\n\t\t\tBootstrapSkin::displayInternalFooter();\n\t\t\tdie();\n\t\t}\n\n\t\t// wiki database available OR stats page doesn't need wiki database\n\n\t\t// check protection level\n\t\tif ($this->isProtected()) {\n\t\t\tif (User::getCurrent()->isCommunityUser()) {\n\t\t\t\tshowlogin();\n\t\t\t\tBootstrapSkin::displayInternalFooter();\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t$session = new session();\n\t\t\t$session->checksecurity();\n\t\t}\n\n\t\t// not protected or access allowed\n\t\techo '<div class=\"page-header\"><h1>' . $this->getPageTitle() . '</h1></div>';\n\n\t\tif ($this->requiresSimpleHtmlEnvironment()) {\n\t\t\techo '<div class=\"row-fluid\"><div class=\"span12\">';\n\t\t\tBootstrapSkin::pushTagStack(\"</div>\");\n\t\t\tBootstrapSkin::pushTagStack(\"</div>\");\n\t\t}\n\n\t\techo $this->execute();\n\n\t\t// Display the footer of the interface.\n\t\tBootstrapSkin::displayInternalFooter();\n\t}",
"function get_summary_text()\n\t{\n\t\treturn $this->ulica . ' - ' . $this->title;\n\t}",
"private function summary()\n {\n $summary = new Summary();\n $summary = $summary->findSummaryAuth();\n $text = empty($summary) ? \"\" : \"<br><br><strong>Resumo</strong><br>\"; \n $text .= empty($summary->description) ? '' : ' '.$summary->description;\n return $text;\n }",
"public function overview() {\n return 'overview';\n }",
"public function show()\n {\n $this->page->setTitle('DiamondForrest');\n $this->page->setCssUrls(Revision::getUrl('/css/global.css'));\n $this->page->printPage();\n }",
"public function title_section_product_recommendations_ai() {\n\t\t\tprint 'Show Description Page';\n\t\t}",
"public function index()\n {\n return view('summary');\n }"
] | [
"0.6216447",
"0.61947477",
"0.6074755",
"0.590755",
"0.5887587",
"0.5867556",
"0.5826222",
"0.5799303",
"0.5793067",
"0.57741046",
"0.56734824",
"0.5652588",
"0.5651964",
"0.5646099",
"0.5597989",
"0.55968845",
"0.55825543",
"0.55685997",
"0.55083835",
"0.5501112",
"0.5495876",
"0.5494284",
"0.5489225",
"0.5482425",
"0.5482193",
"0.54723203",
"0.5464344",
"0.54508126",
"0.5439211",
"0.5431187"
] | 0.63797605 | 0 |
saves the login information data | protected function saveLoginInfo()
{
global $rbacsystem, $lng,$ilSetting;
if(!$rbacsystem->checkAccess("write",$this->getRefId()))
{
$ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->MESSAGE);
}
$this->initLoginForm();
if ($this->form->checkInput())
{
if (is_array($_POST))
{
// @todo: Move settings ilAuthLoginPageSettings
$this->loginSettings = new ilSetting("login_settings");
foreach ($_POST as $key => $val)
{
if (substr($key, 0, 14) == "login_message_")
{
$this->loginSettings->set($key, $val);
}
}
}
if($_POST['default_auth_mode'])
{
$ilSetting->set('default_auth_mode',(int) $_POST['default_auth_mode']);
}
ilUtil::sendSuccess($this->lng->txt("login_information_settings_saved"),true);
}
$this->ctrl->redirect($this,'show');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function SaveLogin() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->txtUsername) $this->objLogin->Username = $this->txtUsername->Text;\n\t\t\t\tif ($this->txtPassword) $this->objLogin->Password = $this->txtPassword->Text;\n\t\t\t\tif ($this->txtFirstName) $this->objLogin->FirstName = $this->txtFirstName->Text;\n\t\t\t\tif ($this->txtLastName) $this->objLogin->LastName = $this->txtLastName->Text;\n\t\t\t\tif ($this->txtEmail) $this->objLogin->Email = $this->txtEmail->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the Login object\n\t\t\t\t$this->objLogin->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"function _saveLogin() {\n $save = array(\"ID\" => $this->logged(), \"password\" => md5($this->info('password')));\n $ckContent = base64_encode(@serialize($save));\n setCookie(\"m8slogin\", $ckContent, LOGINCOOKIELIFETIME);\n debugLog(\"Cookie gesaved\", \"Login cookie wurde gespeichert\");\n }",
"public function saveDataToSession()\n {\n $data = $this->getData();\n unset($data['AccountInfo']);\n unset($data['LoginDetails']);\n unset($data['LoggedInAsNote']);\n unset($data['PasswordCheck1']);\n unset($data['PasswordCheck2']);\n Session::set(\"FormInfo.{$this->FormName()}.data\", $data);\n }",
"public function save() {\r\n $db = Db::instance();\r\n // omit id and any timestamps\r\n $db_properties = array(\r\n 'username' => $this->username,\r\n 'pw' => $this->pw,\r\n 'email' => $this->email,\r\n 'first_name' => $this->first_name,\r\n 'last_name' => $this->last_name,\r\n 'role' => $this->role,\r\n 'description' => $this->description,\r\n 'gender' => $this->gender\r\n );\r\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\r\n }",
"public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'USERPASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_SUPER = %d,IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n ($this->userpassword),\n mysql_real_escape_string($this->email_Addr, $GLOBALS['DB']),\n\t\t\t\t$this->isSuper,\n $this->isActive,\n $this->uid);\n\t\t\t\tLog::WriteLog(3,$query);// write log record to database\n\t\t\t\t\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, USERPASSWORD, ' .\n 'EMAIL_ADDR,IS_SUPER, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d,%d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n sha1($this->userpassword),\n mysql_real_escape_string($this->email_Addr, $GLOBALS['DB']),\n\t\t\t\t$this->isSuper,\n $this->isActive);\n\t\t\t\t\n\t\t\t\tLog::WriteLog(2,$query);// write log record to database\n\t\t\t\t\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }",
"private function recordLogin($data){\n //sets the date and time that the login occurred\n $data['datetime'] = date('Y-m-d H:i:s');\n $this->Login->create();\n if ($this->Login->save($data)) {\n return $this->redirect(['controller' => 'general', 'action' => 'welcome']);\n } //if save successful then redirect to the welcome screen\n }",
"public function save(){\n\t\t$this->nickname = $_POST['nickname'];\n\t\t$this->email \t= $_POST['email'];\n\t\t$this->password = password_hash($_POST['password'],PASSWORD_DEFAULT);\n\n\t\t$this->db->insert('users', $this);\n\t}",
"public function save() {\n $this->setPassword(md5($this->getPassword()));\n $this->setQuien(md5($this->getPassword() . \"Pablo\"));\n\n parent::save();\n }",
"function saveInfoandAccount()\n{\n\t$app = Application::getInstance();\n\t$app->saveInfoandAccount();\t\n}",
"public function saveToSession()\n {\n $this->destroyUserSession();\n $_SESSION['loggedinuser'] = serialize($this);\n }",
"function save()\n\t {\n\t \ttry{\n\t \t\tif($this->_id == 0)\n\t\t\t\t$this->_id = $this->_db->createUser($this->_role[\"id\"], $this->getUsername(), $this->getEmail(), $this->getFirstName(), $this->getLastName(), $this->_hashword);\n\t\t\telse \n\t\t\t\t$this->_db->updateUser($this->_role[\"id\"], $this->getUsername(), $this->getEmail(), $this->getFirstName(), $this->getLastName(), $this->_hashword, $this->_id);\n\t \t} catch(Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\t }",
"public function save_info( $userID, $fName, $lName, $dName, $email, $page, $current, $admin ) {\n $_SESSION[ 'userid' ] = $userID;\n $_SESSION[ 'firstname' ] = $fName;\n $_SESSION[ 'lastname' ] = $lName;\n $_SESSION[ 'displayname' ] = $dName;\n $_SESSION[ 'email' ] = $email;\n $_SESSION[ 'homepage' ] = $page;\n $_SESSION[ 'current' ] = $current;\n $_SESSION[ 'admin' ] = $admin;\n }",
"public function storeLogin($data)\n {\n $_SESSION['login'] = $data;\n if(!empty($_SESSION))\n {\n header('Location: mainPage.php');\n }\n }",
"public static function save() {\n\n $user = accounts::findOne($_SESSION['userID']);\n\n $user->email = $_POST['email'];\n $user->fname = $_POST['fname'];\n $user->lname = $_POST['lname'];\n $user->phone = $_POST['phone'];\n $user->birthday = $_POST['birthday'];\n $user->gender = $_POST['gender'];\n $user->save();\n\n $_SESSION['successMessage']=\"Account details successfully updated!\";\n header(\"Location: index.php?page=accounts&action=edit\");\n\n }",
"public function save()\n\t\t{\n\t\t\t$sql = new Sql();\n\n\t\t\t$results = $sql->select(\"CALL sp_users_save(:desperson, :deslogin, :despassword, :desemail, :nrphone, :inadmin)\", array(\n\t\t\t\t\":desperson\"=>$this->getdesperson(),\n\t\t\t\t\":deslogin\"=>$this->getdeslogin(),\n\t\t\t\t\":despassword\"=>$this->getdespassword(),\n\t\t\t\t\":desemail\"=>$this->getdesemail(),\n\t\t\t\t\":nrphone\"=>$this->getnrphone(),\n\t\t\t\t\":inadmin\"=>$this->getinadmin()\n\t\t\t));\n\n\t\t\t$this->setData($results[0]);\t\n\t\t}",
"public function save()\n {\n if(isset($_POST))\n {\n // Start building array\n $user_data = array(\n 'firstname' => $_POST['firstname'],\n 'lastname' => $_POST['lastname'],\n 'username' => $_POST['username'],\n );\n\n if(isset($_POST['id']))\n {\n $user_data['id'] = $_POST['id'];\n\n if($this->crud_users->update($user_data))\n {\n header('Location: '.global_url().'users/edit/'.$user_data['id']);\n die();\n }\n }\n else\n {\n $user_data['password'] = md5($_POST['password']);\n\n if($new_id = $this->crud_users->create($user_data))\n {\n header('Location: '.global_url().'users/edit/'.$new_id);\n die();\n }\n }\n }\n else\n {\n $this->index();\n }\n\n }",
"public function saveData() {\n\t\t/*\n\t\t$query = \"SELECT * FROM litw_credentials WHERE api_key_hash = '\" . md5($this->api_key) . \"' AND project_id = '\" . $this->project_id . \"'\";\n\n\t\ttry {\n\t\t\t$r = $this->db->query($query)->fetch();\n\t\t\t$target_table = self::DATA_TABLE_PREFIX . $r[\"table_name\"];\n\t\t\t$target_query = \"INSERT INTO \" . $target_table . \" (`project_id`, `session_id`, `task_id`, `data_type`, `data`) \n\t\t\t\t\t\t\t\t\t\t\t VALUES ('$this->project_id', '$this->session_id', '$this->task_id', '$this->data_type', '$this->trial_data')\";\n\n\t\t\t$this->db->query($target_query);\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Database connection error!: \" . $e->getMessage() . \"<br/>\";\n\t \tdie();\n\t\t}\n\t\t*/\n\n\t}",
"public function save()\n {\n $name = $this->name ?? \"NULL\";\n $username = $this->username;\n $email = $this->email;\n $password = password_hash($this->password, PASSWORD_BCRYPT);\n // New account - Perform INSERT\n if (!$result = $this->db->query(\"INSERT INTO `account` VALUES (NULL,'$name', '$username', '$email', '$password');\")) {\n throw new \\mysqli_sql_exception();\n }\n }",
"public function login()\n {\n $this->session->set($this->sessionKey, $this->adminData);\n }",
"public function complete_login()\n\t{\n\t\tif ($this->loaded())\n\t\t{\n\t\t\t// Update the number of logins\n\t\t\t$this->logins = $this->logins + 1;\n\n\t\t\t// Set the last login date\n\t\t\t$this->last_login = time();\n\n\t\t\t// Save the user\n\t\t\t$this->save();\n\t\t}\n\t}",
"public function save() {\n if(php_sapi_name() != \"cli\" || $_SESSION[self::SESSION_NAMESPACE])\n {\n $key = self::SESSION_KEY_CUSTOM_ITEMS;\n $this->session->$key = $this->customItems;\n\n $key = self::SESSION_KEY_USERID;\n $this->session->$key = $this->userId;\n\n $key = self::SESSION_KEY_ASSORTMENT_TENANT;\n $this->session->$key = $this->currentAssortmentTenant;\n\n $key = self::SESSION_KEY_ASSORTMENT_SUB_TENANT;\n $this->session->$key = $this->currentAssortmentSubTenant;\n\n $key = self::SESSION_KEY_CHECKOUT_TENANT;\n $this->session->$key = $this->currentCheckoutTenant;\n\n $key = self::SESSION_KEY_USE_GUEST_CART;\n $this->session->$key = $this->useGuestCart;\n }\n }",
"public function sess_save()\n\t{\n\t\t// Nothing to do - changes to $_SESSION are automatically saved\n\t}",
"public function update_login_info() {\r\n\t\tif ($this->login_info_validation() == TRUE) {\r\n\t\t\t$newUsername = strtolower($this->input->post('username'));\r\n\t\t\t$loginData = array(\r\n\t\t\t\t\t'USERNAME' => $newUsername,\r\n\t\t\t\t\t'PWD' => password_hash($this->input->post('password'), PASSWORD_BCRYPT)\r\n\t\t\t);\r\n\t\r\n\t\t\t\t\r\n\t\t\t$this->load->model('Login_model');\r\n\t\t\t$user_updated= $this->Login_model->update_login($loginData);\r\n\t\t\t$this->session->set_userdata('username', $newUsername);\r\n\t\t\t\t\r\n\t\t\tif ($user_updated) {\r\n\t\t\t\t$this->load_success();\r\n\t\t\t} else {\r\n\t\t\t\t$this->load_error();\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} else {\r\n\t\t\t$this->load_edit_login_info();\r\n\t\t}\r\n\t\r\n\t}",
"public function save()\n {\n $_SESSION['user'] = json_encode($this);\n setcookie('user', json_encode($this), time() + 86400, '.');\n\n //$database = new Database();\n /*$user->id =*/\n Database::createRecord($this);\n /*$user->id =*/\n Database::createPlaces($this);\n /*$user->id =*/\n\n /*\n $file = new File($this);\n $this->files = $file->checkFile($this);\n*/\n File::checkFile($this);\n\n $mail = new Mail($this);\n $mail->sendMail($this);\n }",
"protected function storeAutologinData($data)\n {\n // Get the user key if it's not already stored as a session variable\n if (!isset($_SESSION[$this->sess_ukey])) {\n $sql = \"SELECT $this->col_ukey FROM $this->table_users\n WHERE $this->col_name = :username\";\n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(':username', $_SESSION[$this->sess_uname]);\n $stmt->execute();\n $_SESSION[$this->sess_ukey] = $stmt->fetchColumn();\n }\n // Copy the session data to the autologin table\n $sql = \"UPDATE $this->table_autologin\n SET $this->col_data = :data WHERE $this->col_ukey = :key\";\n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(':data', $data);\n $stmt->bindParam(':key', $_SESSION[$this->sess_ukey]);\n $stmt->execute();\n }",
"public function save()\n {\n parent::save();\n\n //allow admin information edit only for MALL admins\n $soxId = $this->getEditObjectId();\n if ($this->_allowAdminEdit($soxId)) {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n // checkbox handling\n if (!isset($aParams['oxuser__oxactive'])) {\n $aParams['oxuser__oxactive'] = 0;\n }\n\n $oUser = oxNew(\"oxuser\");\n if ($soxId != \"-1\") {\n $oUser->load($soxId);\n } else {\n $aParams['oxuser__oxid'] = null;\n }\n\n //setting new password\n if (($sNewPass = oxRegistry::getConfig()->getRequestParameter(\"newPassword\"))) {\n $oUser->setPassword($sNewPass);\n }\n\n //FS#2167 V checks for already used email\n if ($oUser->checkIfEmailExists($aParams['oxuser__oxusername'])) {\n $this->_sSaveError = 'EXCEPTION_USER_USEREXISTS';\n\n return;\n }\n\n $oUser->assign($aParams);\n\n\n // A. changing field type to save birth date correctly\n $oUser->oxuser__oxbirthdate->fldtype = 'char';\n\n try {\n $oUser->save();\n\n // set oxid if inserted\n $this->setEditObjectId($oUser->getId());\n } catch (Exception $oExcp) {\n $this->_sSaveError = $oExcp->getMessage();\n }\n }\n }",
"public function write()\n {\n $this->CI->db->where('id', $this->id);\n $this->CI->db->set('user_id', $this->user_id);\n $this->CI->db->set('data', serialize($this->data));\n\n $this->CI->db->update($this->config['sess_table_name']);\n }",
"function save()\n {\n $identities = $this->_identities;\n if (is_array($identities)) {\n $identities = $this->_prefs->convertToDriver($identities, NLS::getCharset());\n }\n\n $this->_prefs->setValue('identities', serialize($identities), false);\n $this->_prefs->setValue('default_identity', $this->_default);\n }",
"public static function save()\n {\n session_write_close();\n }",
"public function save()\n {\n \tglobal $_conf, $_CMDEVEL;\n \t$state = $this->state;\n \tparent::save();\n\n \tif($state==self::STATE_NEW || $state==self::STATE_DIRTY_NEW) {\n \t\tinclude($_CMDEVEL['path'].\"/cmvfs.inc.php\");\n\n \t\t$path = (String) $_conf->app->paths->pages;\n \t\tif(empty($path)) {\n \t\t\tThrow new AMException(\"Cannot save user because the pages dir is not correctly configured. Please, verify your config.xml\");\n \t\t}\n \t\t$path .= \"/users/user_\".$this->codeUser;\n\n \t\t//if the this doesn't exists, so we can create it, otherwise generate an exception.\n \t\ttry {\n \t\t\t$dir = new CMvfsLocal($path);\n \t\t\t$this->delete();\n \t\t\tThrow new AMException(\"You are trying to create a user directory that alredy exists.\");\n \t\t} catch(CMvfsFileNotFound $e) {\n \t\t\t$dir = new CMvfsLocal($path,0); //create but not verify if the dir exists\n \t\t\t$dir->register();\n \t\t}\n \t}\n\n }"
] | [
"0.7599596",
"0.7256854",
"0.7232815",
"0.69402117",
"0.6916515",
"0.6748186",
"0.6678011",
"0.6636759",
"0.6604788",
"0.65603536",
"0.651914",
"0.65092987",
"0.64862084",
"0.6485459",
"0.6468896",
"0.64544964",
"0.6442947",
"0.6405937",
"0.63670367",
"0.6361739",
"0.6355608",
"0.6348631",
"0.6337975",
"0.632411",
"0.63219017",
"0.63036317",
"0.62282735",
"0.621173",
"0.62028134",
"0.6199006"
] | 0.81381637 | 0 |
Check if the requested property is an ID. | abstract public function wantsId($property); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public static function hasIdProperty(): bool;",
"public function isId()\n\t{\n\t\treturn substr($this->getName(), -3) === '_id';\n\t}",
"private function hasId($entity)\n\t{\n\t\treturn (new ReflectionClass($entity))->hasProperty('id');\n\t}",
"public static function doesPropertyIdExist($id): bool{\n $results = Capsule::select(\"\n SELECT '$id' in (SELECT prop_id FROM Property) as value;\n \");\n return boolval($results[0]->value);\n }",
"public function has_id() {\n return !empty($this->id);\n }",
"function is_valid_property_type($property_type_id = '')\n{\n\t$is_valid = false;\n\t$property_types = Application::Get('property_types');\n\tforeach($property_types as $key => $val){\n\t\tif($property_type_id == $val['id']){\n\t\t\t$is_valid = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn $is_valid;\n}",
"public function hasID()\n {\n return (isset($this->_objData[$this->_objField]) && $this->_objData[$this->_objField]);\n }",
"protected function is_valid_id()\n\t{\n\t\treturn\t!empty($this -> id);\n\t}",
"public function exists() {\n\t\treturn $this->has_prop( 'ID' );\n\t}",
"public function validateProperty($value,$id=null);",
"public function isId() {\n\t\treturn $this->isId;\n\t}",
"public function hasId() : bool\n {\n return true;\n }",
"public function hasId()\n\t{\n\t\treturn ($this->id > 0);\n\t}",
"public function hasId()\n\t{\n\t\treturn ($this->id > 0);\n\t}",
"public function issetId()\n {\n return !empty($this->id);\n }",
"final public function hasId(): bool\n {\n return $this->id !== null;\n }",
"public function hasId()\n {\n return $this->getDao()->hasId();\n }",
"protected function isId($value)\n {\n return isset($value) && intval($value) != 0;\n }",
"function isId($id)\n{\n\t// and the integer is > 0, then it's a valid ID.\n\tif(app_is_int($id) && $id > 0) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}",
"private function validateId($id) { return (isset($id) && (int) $id > 0) ? true : false; }",
"function validateID($id) {\n return ( is_numeric ( $id ) );\n }",
"function setIdProperty($alias,$prop) {\n\tif (!$this->isProperty($alias,$prop)) { return false; }\n\tif (!($this->_idProperty === false)) { return false; }\n\t$this->_idProperty = array($alias,$prop);\n\treturn true;\n\t}",
"abstract protected function validateId($id): bool;",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(4);\n }",
"public function hasId(){\r\n return $this->_has(1);\r\n }"
] | [
"0.7785573",
"0.7020845",
"0.69298095",
"0.68443584",
"0.66961914",
"0.66944164",
"0.6636999",
"0.6559013",
"0.65579456",
"0.64987326",
"0.6497012",
"0.64923483",
"0.6469029",
"0.6469029",
"0.6446448",
"0.641149",
"0.6377858",
"0.6376815",
"0.63530266",
"0.63527817",
"0.63432485",
"0.6320349",
"0.630906",
"0.63046795",
"0.63046795",
"0.63046795",
"0.63046795",
"0.63046795",
"0.6263466",
"0.62582314"
] | 0.746868 | 1 |
Remove the property from the model. | public function __unset($property)
{
$this->properties->forget($property);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeProperty($property);",
"public function __unset($property_name);",
"public function unsetProperty($property);",
"public function __unset($property) {\n $this->__set($property, null);\n }",
"public function removePropertyValue($property, $value);",
"public function __unset( $property )\n {\n $this->__set( $property, null );\n }",
"public function __unset(string $property)\n {\n $this->unset($property);\n }",
"public function __unset($property) {\n switch ($property) {\n case 'attrs':\n case 'attributes':\n throw new Core_UndestroyablePropertyException($property);\n default:\n throw new Core_MissingPropertyException($property);\n }\n }",
"public function offsetUnset($property)\n\t{\n\t\t$this->element->offsetUnset(self::serialize_property($property));\n\t}",
"public function __unset(string $prop): void\n {\n $this->unset($prop);\n }",
"function remove() {\n $id = $_REQUEST['id'];\n\n $array = array('adminpropertydata');\n $this->includemodel($array);\n\n $obj1 = new AdminPropertyData();\n $obj1->removeproperty($id);\n header('location: ' . $this->BASE_URL . 'public/adminpropertypage');\n die;\n }",
"public function destroy(Property $property) {\n\n\t}",
"public function __unset($property) {\n if (isset($this->$property)) {\n unset($this->$property);\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public static function removeProperty($name) {\n\t\tunset(self::$properties[get_called_class() . '::' . $name]);\n\t}",
"public function del( $property )\n\t{\n\t\tif ( is_array( $property) )\n\t\t{\n\t\t\tforeach( $property as $key => $single_property )\n\t\t\t\t $this->del( $key );\n\t\t}else\n\t\t\tunset( $this->data[$property] );\n\t}",
"function removeProperty ($name)\n\t{\n\t\t$ret = $this->getPropertyValue($name);\n\t\tunset($this->_properties[$name]);\n\t\treturn $ret;\n\t}",
"abstract function removeChoice(ChoiceProperty $choice);",
"public function __unset($property = null)\n\t{\n\t\tif (!property_exists(__CLASS__, $property) || $property{0} == '_')\n\t\t{\n\t\t\tif (empty($property)) {\n\t\t\t\t$property = '(null)';\n\t\t\t}\n\n\t\t\t$this->_error(\"Cannot access property \" . __CLASS__ . \"::$\" . $property, E_USER_ERROR);\n\t\t\tdie();\n\t\t}\n\n\t\t$this->_updatedkeys = array_diff($this->_updatedkeys, array($property));\n\n\t\tunset($this->$property);\n\t}",
"public static function unsetProperty(array $requirements, $property);",
"protected function propertyUnset($name)\n {\n unset($this->data[$name]);\n }",
"public function removeProp(string $key): self {\n if (array_key_exists($key, $this->props)) {\n unset($this->props[$key]);\n }\n return $this;\n }",
"function delete_property($prop_id)\n {\n return $this->db->delete('property',array('prop_id'=>$prop_id));\n }",
"public function __unset($name)\r\n {\r\n if (isset($this->_properties[$name])) {\r\n unset($this->_properties[$name]);\r\n }\r\n }",
"public function __unset($key)\n {\n $config = $this->isJsonModelAttribute($key);\n if (!$config) {\n parent::__unset($key);\n return;\n }\n Arr::forget($this->jsonModelAttributeCache, $key);\n [$type, $attribute, $attribute_key, $is_collection, $primary_key] = $config;\n if ($attribute_key) {\n $wholeAttribute = $this->{$attribute};\n unset($wholeAttribute[$attribute_key]);\n $this->{$attribute} = $wholeAttribute;\n } else {\n Arr::forget($this->attributes, $attribute);\n }\n }",
"public function __unset($name) {\n if ($this->getPropertyDefinition($name)) {\n $this->get($name)->setValue(NULL);\n }\n else {\n unset($this->values[$name]);\n }\n }",
"public function actionDeleteMetaProperty()\n {\n SeoParams::model()->findByPk($_POST['id'])->delete();\n }",
"abstract public function manage_value_for_remove($business_full_name, $property, $property_value, $value);",
"public function deleteProperty($id){\n// $this->execute($this->db->delete(\"property\")->where(\"property_id=$id\"));\n $this->execute($this->db->update(\"property\")->set(array(\"is_delete\"=>1))->where(\"property_id=$id\"));\n }",
"public function removeProperty($propertyName)\n {\n if ($propertyName == '')\n throw new Exception('Property Name not specified');\n //build URI to merge Docs\n $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/documentProperties/' . $propertyName;\n //sign URI\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'DELETE', '', '');\n $json = json_decode($responseStream);\n if ($json->Code == 200)\n return true;\n else\n return false;\n\n }",
"public function __unset($name)\n {\n throw new \\LogicException('This data structure does not allow deletion of properties.');\n }"
] | [
"0.79597414",
"0.7505183",
"0.7501383",
"0.74894476",
"0.73732495",
"0.729582",
"0.70196855",
"0.69343406",
"0.6892881",
"0.6695476",
"0.66743875",
"0.665482",
"0.6626575",
"0.6615778",
"0.6571627",
"0.65241253",
"0.64660156",
"0.6454291",
"0.6446839",
"0.64119554",
"0.63843536",
"0.63502187",
"0.62700415",
"0.6269221",
"0.62363887",
"0.6227588",
"0.61658645",
"0.6132393",
"0.61293805",
"0.60736907"
] | 0.7661159 | 1 |
Return the element (tree) attributes | public function getAttributes(){
return $this->getElement()->getAttributes();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAttributes()\n {\n return $this->xpath('composite', 'umlattribute');\n }",
"protected function __get_attributes()\n\t{\n\t\t$attributes = array();\n\t\t$dom_attributes = $this->element->attributes;\n\n\t\t$i = 0;\n\t\twhile ($dom_attribute = $dom_attributes->item($i))\n\t\t{\n\t\t\t$attributes[$dom_attribute->name] = $dom_attribute->value;\n\t\t\t$i++;\n\t\t}\n\n\t\treturn $attributes;\n\t}",
"function get_attributes($element_path = \"/\"){\n\t\tsettype($element_path,\"string\");\n\n\t\tif($_tree = $this->get_first_matching_branch($element_path)){\n\t\t\treturn isset($_tree[0][\"attribs\"]) ? $_tree[0][\"attribs\"] : $_tree[\"attribs\"];\n\t\t}\n\t}",
"static function getAttributesInfo ()\n {\n return array(\n // Attributes are grouped by section\n 'section1' => array(\n 'name' => _(\"Puppet node settings\"),\n 'attrs' => array(\n new SetAttribute (\n new StringAttribute (_(\"Puppet class\"), _(\"Puppet Node Class\"), \"puppetClass\")\n ),\n new SelectAttribute (_(\"Parent node\"), _(\"Puppet Parent Node\"), \"parentNode\", FALSE),\n new SelectAttribute (_(\"Environment\"), _(\"Puppet Node Environment\"), \"environment\", TRUE),\n new SetAttribute (\n new CompositeAttribute (\n _(\"A variable setting for puppet\"),\n 'puppetVar',\n array(\n new StringAttribute ('', _('Name of the variable'), 'puppetVar'),\n new StringAttribute ('=', _('Value of the variable'), 'puppetVarValue'),\n ),\n '%[^ =]=%[^ ]', // sscanf format\n '%s=%s', // sprintf format\n '', // acl, empty string means we don't care (handle it automagically)\n 'Puppet Vars'\n )\n ),\n )\n ),\n );\n }",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"abstract public function getAttributes();",
"public function GetAttributes() {\n\t\treturn [\n\t\t\t'disabled' => ($this->element->GetDisabled()) ? '' : null,\n\t\t\t'selected' => ($this->element->GetSelected()) ? '' : null,\n\t\t\t'value' => $this->element->Value\n\t\t];\n\t}",
"public function getAttrsList(){\n return $this->_get(10);\n }",
"public function getAttributes(){\n return $this->attributes;\n }",
"public function getAttributes() {\n\t\treturn (isset($this->items['attributes'])) ? $this->items['attributes'] : array();\n\t}",
"static function getAttributesInfo ()\n {\n return array(\n 'main' => array(\n 'name' => _('FAI settings'),\n 'attrs' => array(\n new HiddenAttribute ('FAIstate'),\n new CompositeAttribute (\n _('FAI profil and release to be applied to this computer'),\n 'FAIclass',\n array(\n 'release' => new FAIreleaseAttribute (\n _('Release'), _('FAI debian release to be installed on this computer'),\n 'FAIrelease', TRUE\n ),\n 'profil' => new SelectAttribute (\n _('Profil'), _('FAI profil to be applied to this computer'),\n 'FAIprofile', TRUE\n ),\n ),\n '/^(?P<profil>.+) :(?P<release>.+)$/',\n '%2$s :%1$s'\n ),\n new SelectAttribute (\n _('Repository'), _('FAI Debian repository to be used for installation'),\n 'FAIdebianMirror', TRUE\n ),\n )\n ),\n );\n }",
"public function getAttributes()\n {\n // TODO: Implement getAttributes() method.\n }",
"public function getAttributes() {\n $attr = array();\n \n $attr[\"id\"] = $this->id_;\n $attr[\"genus\"] = $this->genus_;\n $attr[\"species\"] = $this->species_;\n $attr[\"common\"] = $this->common_;\n $attr[\"usdaCode\"] = $this->usdaCode_;\n $attr[\"colorId\"] = $this->colorId_;\n \n return $attr;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }"
] | [
"0.7808613",
"0.7483685",
"0.74704754",
"0.72915953",
"0.7274181",
"0.7274181",
"0.7274181",
"0.7274181",
"0.72101814",
"0.7083659",
"0.7051016",
"0.7016986",
"0.6937513",
"0.6919039",
"0.6882893",
"0.68753284",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498",
"0.6869498"
] | 0.78790915 | 0 |
Return the render of the current element path | public function renderPath(){
$html = '';
$path = $this->getElement()->getTree()->getPath();
if($defaultPath = $this->getElement()->getDefaultPath()){
$path = array_merge($defaultPath,$path);
}
foreach($path as $key => $item){
$html .= $this->getElement()
->getDecorator('breadcrumbElement',$item)
->setBreadcrumb($this->getElement())
->setElementNumber($key,count($path))
->render();
}
return $html;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function current()\n {\n return $this->_iterator->current()->getPathname();\n }",
"public function current()\n {\n return $this->_iterator->current()->getPathname();\n }",
"public function getPath()\r\n {\r\n return $this->app->path->path(\"cart-elements:\" . $this->getElementGroup() . '/' . $this->getElementType());\r\n }",
"public function getPathDisplay()\n {\n return $this->path_display;\n }",
"public function getRenderedElement() {\n\t\treturn $this->renderedElement;\n\t}",
"public function render()\n {\n return $this->_sThisTemplate;\n }",
"public function get_render() {\n\t\t// Check if render attribute presents.\n\t\tif ( isset( $this->render ) ) {\n\t\t\treturn $this->render;\n\t\t}\n\t}",
"public function render()\n {\n return 'rendered';\n }",
"public function render()\n {\n parent::render();\n\n return $this->lastHref;\n }",
"public function path()\n {\n return $this->instance->getPathInfo();\n }",
"public function current_path()\n {\n return current_path();\n }",
"public function getView() {\n\t\t$ret = null;\n\t\tif ($current = $this->getCurrent()) {\n\t\t\tif (!$ret = $this->callHelper('view', $current, null))\n\t\t\t\t$ret = utils::htmlTag('a', array_merge($this->cfg->previewPrm, array('href'=>request::uploadedUri($current))), $this->cfg->previewText ? $this->cfg->previewText : basename($current));\n\t\t}\n\t\treturn $ret;\n\t}",
"public function render(): string\n {\n return $this->getPage()->render();\n }",
"public function evaluate(\\TYPO3\\Base\\Core\\Rendering\\RenderingContextInterface $renderingContext) {\n\t\treturn self::getPropertyPath($renderingContext->getTemplateVariableContainer(), $this->objectPath, $renderingContext);\n\t}",
"public function getPath(): string {\n return $this->components->path;\n }",
"public function current()\n {\n // get the name and url of the nav item\n $name = parent::key();\n $url = parent::current();\n \n // determine if we're on the last element\n if ($this->hasNext()) {\n return '<li><a href=\"' . $url . '\">' . $name . '</a></li>';\n } else {\n return '<li class=\"last\"><a href=\"' . $url . '\">' . $name . '</a></li>';\n }\n }",
"public function render()\n {\n $oViewRenderer = new TViewParser();\n $oViewRenderer->AddVarArray($this->getVars());\n $sPath = $this->getFilename();\n if (null !== $this->getSourceModule()) {\n $sPath = $this->getSourceModule()->viewTemplate;\n }\n\n return $oViewRenderer->RenderBackendModuleViewByFullPath($sPath);\n }",
"public function get_path () {\n \t$this->find_path();\n \treturn($this->path_with_hooks);\n }",
"public function getPath()\n {\n return $this->viewPath . '/' . $this->path . '.blade.php';\n }",
"public function getPath()\r\n {\r\n\t\t$Result = $this->getData(PARAM_KERNEL_ROUTE_TAG_PATH);\r\n\t\treturn $Result;\r\n }",
"public function getPath()\n {\n $controller = str_replace('\\\\', '/', $this->get('controller'));\n\n $path = (empty($controller) ? '' : $controller . '/') . $this->get('name') . '.' . $this->get('engine');\n\n return empty($this->parameters['bundle']) ? '/Resources/views/' . $path : '@' . $this->get('bundle') . '/Resources/views/' . $path;\n }",
"protected function getPath()\n\t{\n\t\treturn ($this->app['router']->current()->uri() == '' ? '/' : $this->app['router']->current()->uri());\n\t}",
"public function render()\n {\n return $this->processRender($this->contentPath, true);\n }",
"public static function current(): string\n {\n return Uri::composeComponents(\n '',\n '',\n static::$uri->getPath(),\n static::$uri->getQuery(),\n static::$uri->getFragment(),\n );\n }",
"private function _function_CurrentRoute()\n\t{\n\t\treturn new \\Twig_SimpleFunction('currentRoute', function()\n\t\t{\n\t\t\treturn Route::currentRouteName();\n\t\t});\n\t}",
"public function currentPath() {\n return $this->requestStack->getCurrentRequest()->getRequestUri();\n }",
"public function path()\n\t{\n\t\treturn $this->path;\n\t}",
"public function getPath()\n {\n $controller = str_replace('\\\\', '/', $this->get('controller'));\n\n $path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine');\n\n return empty($this->parameters['bundle']) ? 'views/'.$path : '@'.$this->get('bundle').'/Resources/views/'.$path;\n }",
"public function getRenderedFilePath()\n {\n return $this->_tempFilePath;\n }",
"public function path() {\n\t\treturn $this->path;\n\t}"
] | [
"0.6374802",
"0.6374802",
"0.63638586",
"0.6294155",
"0.6250643",
"0.6235531",
"0.6171106",
"0.6112423",
"0.6111531",
"0.603426",
"0.60242504",
"0.6020964",
"0.5997546",
"0.59904575",
"0.5978509",
"0.59775746",
"0.59635425",
"0.5955256",
"0.59537464",
"0.5947269",
"0.59457004",
"0.59266186",
"0.5918783",
"0.5908576",
"0.59070003",
"0.5905919",
"0.5896766",
"0.5889345",
"0.58870703",
"0.58852226"
] | 0.71511304 | 0 |
Moves the pointer to the next bucket | public function next(): void
{
if ($this->current instanceof TerminalBucket) {
return;
}
$this->current = $this->current->next();
$this->offset++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setNext(?Bucket $next): void;",
"public function next(): ?Bucket;",
"public function next()\n {\n $this->key = $this->key + 1;\n $this->current = $this->current + 1;\n }",
"public function next()\n {\n $keys = array_keys($this->items);\n $index = array_search($this->currentKey, $keys);\n\n $index++;\n\n $this->currentKey = array_key_exists($index, $keys) ? $keys[$index] : null;\n }",
"function next() {\n $this->keys = array_keys($this->data);\n ++$this->index;\n }",
"public function next()\n {\n --$this->pointer;\n }",
"public function next()\n {\n $this->positionKeysPosition++;\n $this->position = $this->positionKeys[$this->positionKeysPosition];\n }",
"public function next()\n {\n --$this->position;\n }",
"public function next() : void {\n\t\t$this->pointer++;\n\t}",
"public function moveNext()\n {\n ++$this->_currentRow;\n $this->_setCurrentRecord();\n }",
"public function next ()\n {\n if ( $this->end > $this->start )\n {\n $this->current += $this->step;\n $result = $this->current <= $this->end;\n }\n else\n {\n $this->current -= $this->step;\n $result = $this->current >= $this->end;\n }\n\n if ( !$result )\n {\n $this->current = NULL;\n $this->key = NULL;\n }\n else\n {\n $this->offset++;\n }\n }",
"protected function forward()\n {\n $this->current = $this->last;\n\n if (!$this->getInnerIterator()->valid()) {\n // Allow to forward the last item.\n $this->last = null;\n } else {\n $this->last = $this->getInnerIterator()->current();\n $this->last[$this->aggregateKey] = [$this->last];\n $this->getInnerIterator()->next();\n }\n\n $this->key++;\n }",
"public function next()\n {\n $this->idx += 1;\n }",
"public function next()\n {\n $this->_pointer++;\n }",
"public function prev(): void\n {\n if ($this->current instanceof TerminalBucket) {\n return;\n }\n\n $this->current = $this->current->prev();\n $this->offset--;\n }",
"public function next()\n {\n $this->currentEntry++;\n }",
"function stream_bucket_prepend ($brigade, $bucket) {}",
"public function next()\n {\n ++$this->position;\n $this->current = $this->valid = null;\n }",
"public function next()\n {\n ++$this->pointer;\n }",
"public function next()\n {\n $this->__iteratorCurrentIndex += 1;\n }",
"public function next()\n {\n $this->Pointer++;\n }",
"public function next()\n {\n\n $this->_currentIndex++;\n }",
"public function next(): void\n {\n $this->position++;\n }",
"public function next()\n {\n $this->childrenPosition++;\n }",
"public function next(): void\n {\n next($this->items);\n }",
"public function next()\n\t{\n\t\t$this->_index++;\n\t}",
"public function setPrev(?Bucket $prev): void;",
"public function next()\n {\n $this->index ++;\n }",
"public function next(): void\n {\n ++$this->position;\n }",
"public function next(): void\n {\n ++$this->position;\n }"
] | [
"0.7157123",
"0.6881067",
"0.6676558",
"0.651256",
"0.6511089",
"0.6319561",
"0.62979203",
"0.614002",
"0.60415506",
"0.602249",
"0.59971607",
"0.5991748",
"0.59542525",
"0.59368646",
"0.5917725",
"0.5885279",
"0.57977736",
"0.5792639",
"0.57826626",
"0.57678396",
"0.5757713",
"0.57436854",
"0.5715605",
"0.5700874",
"0.5689301",
"0.56872946",
"0.5686031",
"0.56729954",
"0.56725377",
"0.56725377"
] | 0.7156556 | 1 |
Moves the pointer to the previous bucket | public function prev(): void
{
if ($this->current instanceof TerminalBucket) {
return;
}
$this->current = $this->current->prev();
$this->offset--;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setPrev(?Bucket $prev): void;",
"public function prev(): ?Bucket;",
"public function prev(): void\n {\n if (!$this->valid()) {\n $this->end();\n\n return;\n }\n\n $this->seek((int) $this->key() - 1);\n }",
"function array_kshift(&$arr){\n reset($arr);\n $return = array(key($arr)=>current($arr));\n unset($arr[key($arr)]);\n return $return; \n }",
"function SetPrevious($item, $previous);",
"function PreviousOf($item);",
"function prev (array &$array) {}",
"public function prev()\n {\n $this->store->prev();\n }",
"public function moveDown()\n {\n // Moves previous lower ranked item above\n $curOrder = $this->order;\n if ($curOrder == 0) return; // This is already the lowest item, so cancel\n if ($prevItem = Group::where('order', '<', $curOrder)->first())\n {\n $this->order = $prevItem->order;\n $prevItem->order = $curOrder;\n $prevItem->save();\n $this->save();\n }\n }",
"public function previous();",
"public function shift()\r\n {\r\n return array_shift($this->storage);\r\n }",
"public function setNext(?Bucket $next): void;",
"function unshift($key,$val) {\n\t\t$ref=&$this->ref($key);\n\t\tarray_unshift($ref,$val);\n\t\treturn $val;\n\t}",
"function unshift($key,$val) {\n\t\t$ref=&$this->ref($key);\n\t\tarray_unshift($ref,$val);\n\t\treturn $val;\n\t}",
"private function moveUp()\n\t{\n\t\t$value = $this->current->value;\n\t\tif ($this->current->parent) {\n\t\t\t$this->current = $this->current->parent;\n\t\t} else {\n\t\t\t$this->current = null;\n\t\t}\n\n\t\t$this->appendValue($value);\n\t}",
"function stream_bucket_prepend ($brigade, $bucket) {}",
"protected function skipBack() {\n\t\tif ($this->cursor < $this->length) $this->cursor--;\n\t}",
"public function fetchPrevious();",
"public function moveUp()\n {\n // Moves previous higher ranked item below\n $curOrder = $this->order;\n if ($curOrder == Group::getCurrentHighestOrder()) return; // This is already the highest item, so cancel\n if ($prevItem = Group::where('order', '>', $curOrder)->first())\n {\n $this->order = $prevItem->order;\n $prevItem->order = $curOrder;\n $prevItem->save();\n $this->save();\n }\n }",
"function shift($key) {\n\t\t$ref=&$this->ref($key);\n\t\treturn array_shift($ref);\n\t}",
"function shift($key) {\n\t\t$ref=&$this->ref($key);\n\t\treturn array_shift($ref);\n\t}",
"public function previous()\n {\n $this->key--;\n $this->current = ($this->key < 0) ? false : $this[$this->key];\n return $this->current;\n }",
"public function shift()\n {\n return array_shift($this->items);\n }",
"public function shift()\n {\n return array_shift($this->items);\n }",
"public function next(): ?Bucket;",
"public function getPreviousIteratorRow () {}",
"function prev();",
"public function rewind() {\n $this->currentKey = 0;\n }",
"public function shiftSiblingsForRestore();",
"public function rewind()\n {\n $this->currentKey=0;\n }"
] | [
"0.727605",
"0.72523326",
"0.6774244",
"0.6024271",
"0.5979689",
"0.5920701",
"0.58823764",
"0.58700335",
"0.5868813",
"0.5841724",
"0.5826206",
"0.5806915",
"0.5755605",
"0.5755605",
"0.5738169",
"0.57143235",
"0.570007",
"0.56795067",
"0.5649013",
"0.56414056",
"0.56414056",
"0.5636704",
"0.5567781",
"0.5567781",
"0.5529818",
"0.5518189",
"0.54873353",
"0.54856604",
"0.5464501",
"0.5452505"
] | 0.76886165 | 0 |
Retrieves the key from the current bucket Returns null if the pointer is not at a valid offset. | public function key(): mixed
{
if ($this->current instanceof TerminalBucket) {
return null;
}
/** @var KeyValueBucket $current */
$current = $this->current;
return $current->key();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function currentKey()\n {\n if (isset($this->_values[$this->_pointer]['key'])) {\n return $this->_values[$this->_pointer]['key'];\n } else {\n return null;\n }\n }",
"public function key()\n {\n $pos = $this->_itpos;\n return (isset($this->_it[$pos])) ? $this->_it[$pos] : null;\n }",
"public static function get_key();",
"public function getKey(): string|null;",
"public function getKey()\n {\n return $this->key ? $this->key : null;\n }",
"public function key() {\n return NULL;\n }",
"public function getKey()\n {\n if (is_null($this->key)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_KEY);\n if (is_null($data)) {\n return null;\n }\n $this->key = (string) $data;\n }\n\n return $this->key;\n }",
"public function getKey()\n {\n if (is_null($this->key)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_KEY);\n if (is_null($data)) {\n return null;\n }\n $this->key = (string) $data;\n }\n\n return $this->key;\n }",
"public function getKey()\n {\n if (is_null($this->key)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_KEY);\n if (is_null($data)) {\n return null;\n }\n $this->key = (string) $data;\n }\n\n return $this->key;\n }",
"public function getKey()\n {\n if (is_null($this->key)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_KEY);\n if (is_null($data)) {\n return null;\n }\n $this->key = (string) $data;\n }\n\n return $this->key;\n }",
"public function key()\n {\n return $this->_pointer;\n }",
"public function key()\n {\n return $this->_pointer;\n }",
"public function key()\n {\n //var_dump(__METHOD__);\n return $this->keys[$this->position];\n }",
"public function key()\n {\n return $this->offsetExists($this->__iteratorCurrentIndex) ? $this->__iteratorCurrentIndex : null;\n }",
"public function key()\n {\n return $this->pointer;\n }",
"public function getKey(): ?string;",
"public function key() : mixed {\n\t\treturn $this->pointer;\n\t}",
"public function current(): mixed\n {\n if ($this->current instanceof TerminalBucket) {\n return null;\n }\n\n /** @var KeyValueBucket $current */\n $current = $this->current;\n\n return $current->value();\n }",
"public function key()\n {\n $keys = $this->getKeys();\n return $keys[ $this->databag_current_position ];\n }",
"protected function locate(mixed $key): ?KeyValueBucket\n {\n for ($this->rewind(); $this->valid(); $this->next()) {\n /** @var KeyValueBucket $current */\n $current = $this->current;\n if (Validate::areEqual($key, $current->key())) {\n return $current;\n }\n }\n\n return null;\n }",
"public function key()\n {\n if (!$this->valid()) {\n return null;\n }\n\n return $this->currentResourceNumber;\n }",
"public function getKey()/*TODO downgrade - : ?string*/\n {\n return $this->key;\n }",
"public function key()\n {\n /** @var Index|null $index **/\n $index = $this->current();\n\n return $index === null\n ? null\n : $index->getKey();\n }",
"abstract public function getKey();",
"abstract public function getKey();",
"public function key()\n {\n return $this->currentEntry;\n }",
"protected abstract function getKey();",
"public function offsetGet ($key): mixed\n\t{\n\t\tif ($this->offsetExists($key)) {\n\t\t\treturn $this->storage[$key];\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getKey();",
"public function getKey();"
] | [
"0.69406414",
"0.6568077",
"0.6498807",
"0.63887626",
"0.6372661",
"0.62693954",
"0.62666225",
"0.62666225",
"0.62666225",
"0.62666225",
"0.62656283",
"0.62656283",
"0.62649524",
"0.6262429",
"0.62249595",
"0.61784387",
"0.61760324",
"0.6164975",
"0.61205184",
"0.61014676",
"0.60971886",
"0.60941935",
"0.6082533",
"0.6078347",
"0.6078347",
"0.60214806",
"0.6014236",
"0.60021305",
"0.59974176",
"0.59974176"
] | 0.74536836 | 0 |
Retrieves the value from the current bucket Returns null if the pointer is not at a valid offset. | public function current(): mixed
{
if ($this->current instanceof TerminalBucket) {
return null;
}
/** @var KeyValueBucket $current */
$current = $this->current;
return $current->value();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function offsetGet($offset) : mixed {\n\t\t#If the key is found include into the array of used data.\n\t\t#This allows Spitfire to generate canonicals for you adequately.\n\t\tif (isset($this->data[$offset]) && !in_array($offset, $this->used)) {\t\n\t\t\t$this->used[] = $offset;\n\t\t}\n\t\t\n\t\treturn array_key_exists($offset, $this->data)? $this->data[$offset] : null;\n\t}",
"public function offsetGet ($key): mixed\n\t{\n\t\tif ($this->offsetExists($key)) {\n\t\t\treturn $this->storage[$key];\n\t\t}\n\n\t\treturn null;\n\t}",
"public function next(): ?Bucket;",
"public function peek () {\n\t\tif (is_null($this->head)) { return null; }\n\t\treturn $this->head->value;\n\t}",
"public function offsetGet($offset) {\n $value = null;\n if ($this->offsetExists($offset)) {\n $value = $this->items[$offset];\n }\n return $value;\n }",
"public function current()\n {\n if (!$this->valid())\n {\n throw new OutOfBoundsException(sprintf('The result with index %s does not exist', $this->key()));\n }\n\n // we do this to support associative arrays\n $keys = array_keys($this->data);\n\n return $this->data[$keys[$this->key()+$this->getOffset()]];\n }",
"public function offsetGet($offset) {\n return $this->offsetExists($offset) ? $this->data[$offset] : NULL;\n }",
"public function prev(): ?Bucket;",
"public function getOne()\n {\n if ($this->count() > 0)\n {\n $this->seek(0);\n return $this->current();\n } else\n return null;\n }",
"public function offsetGet($offset)\n {\n if ($this->offsetExists($offset))\n return $this->data[$offset];\n else\n return null;\n }",
"public function peek()\n {\n return $this->get($this->pointer[0], $this->pointer[1]);\n }",
"public function offsetGet($offset) {\n return isset($this->data[$offset]) ? $this->data[$offset] : null;\n }",
"public function offsetGet ($offset) {\n return isset($this->data[$offset]) ? $this->data[$offset] : NULL;\n }",
"function get()\n {\n if (isset($this->array[$this->key])) {\n return $this->array[$this->key];\n } else {\n return null;\n }\n }",
"public function key(): mixed\n {\n if ($this->current instanceof TerminalBucket) {\n return null;\n }\n\n /** @var KeyValueBucket $current */\n $current = $this->current;\n\n return $current->key();\n }",
"public function offsetGet($offset) {\n\t\treturn $this->storage[$offset];\n\t}",
"public function current()\n {\n //var_dump(__METHOD__);\n return $this->data[$this->keys[$this->position]];\n }",
"public function &offsetGet($offset){\n if( !is_null($this->$offset) ){\n $value = &$this->$offset;\n }else{\n $value = null;\n }\n return $value;\n }",
"public function get($key)\n {\n $address = $this->generateHash($key);\n\n if (! isset($this->table[$address]) || $this->table[$address]->count() === 0) {\n return null;\n }\n\n $current = $this->table[$address]->getHead();\n\n while ($current !== null) {\n $data = $current->getData();\n\n if ($data->getKey() === $key) {\n return $data->getValue();\n }\n\n $current = $current->getNext();\n }\n\n return null;\n }",
"public function offsetGet($offset)\n {\n return isset($this->data[$offset]) ? $this->data[$offset] : null;\n }",
"function &offsetget($key) {\n\t\t$val=&$this->ref($key);\n\t\treturn $val;\n\t}",
"public function current() {\n return $this->data[$this->key()];\n }",
"public function current()\n {\n return $this->get($this->key());\n }",
"public function read(): mixed\n {\n if ($this->exists()) {\n return apcu_fetch($this->cacheKey);\n }\n return null;\n }",
"public function offsetGet($offset)\n {\n return $this->_entries[$offset];\n }",
"public function current(){\n // check the iteration type\n if( $this->iterateViaHeaders && !empty($this->headers) ){\n // set the position based on the headers\n $position = $this->key();\n }else{\n // use the generic position\n $position = $this->iteratorPosition;\n }\n\n // return the value\n return $this->offsetGet($position);\n }",
"public function current()\n {\n return $this->collection[$this->position] ?? null;\n }",
"protected function locate(mixed $key): ?KeyValueBucket\n {\n for ($this->rewind(); $this->valid(); $this->next()) {\n /** @var KeyValueBucket $current */\n $current = $this->current;\n if (Validate::areEqual($key, $current->key())) {\n return $current;\n }\n }\n\n return null;\n }",
"#[\\ReturnTypeWillChange]\n public function offsetGet($offset)\n {\n $this->initInternArray();\n\n return $this->offsetExists($offset) ? $this->internArray[$offset] : null;\n }",
"static public function get(string $bucket_id, string $key){\n $local_key = self::localKey($bucket_id, $key);\n if (isset(self::$storage_arr[$local_key])) {\n return self::$storage_arr[$local_key];\n }\n\n $bucket = CacheConfig::bucket($bucket_id);\n $value = $bucket->get($key);\n\n //if ($value !== false) { // why not store false?\n self::$storage_arr[$local_key] = $value;\n //}\n\n return $value;\n }"
] | [
"0.6458826",
"0.63534635",
"0.63153076",
"0.6294085",
"0.62540984",
"0.6215713",
"0.61819315",
"0.6123769",
"0.6109705",
"0.60880667",
"0.6083492",
"0.607718",
"0.60704404",
"0.6036336",
"0.60196364",
"0.6014054",
"0.5961653",
"0.5948878",
"0.59266263",
"0.59183204",
"0.5915103",
"0.59019136",
"0.58955985",
"0.5893709",
"0.5889165",
"0.5864253",
"0.5852942",
"0.5839802",
"0.5833129",
"0.58023083"
] | 0.7353752 | 0 |
Locates a bucket by key Returns null if the key is not found. | protected function locate(mixed $key): ?KeyValueBucket
{
for ($this->rewind(); $this->valid(); $this->next()) {
/** @var KeyValueBucket $current */
$current = $this->current;
if (Validate::areEqual($key, $current->key())) {
return $current;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBucket($key)\n\t{\n\t\tif (isset($this->buckets[$key])) {\n\t\t\tthrow new Exception('Trying to access non existing bucket with key : ' . print_r($key, true));\n\t\t}\n\t\treturn $this->buckets[$key];\n\t}",
"public function get(mixed $key): mixed\n {\n $bucket = $this->locate($key);\n\n if ($bucket === null) {\n $message = sprintf(\n 'Key not found: %s',\n VarPrinter::toString($key)\n );\n throw new KeyException($message);\n }\n\n return $bucket->value();\n }",
"public static function find($key)\n {\n $raw = static::diskStorage()->read($key);\n\n return $raw ? static::fromArray($raw) : null;\n }",
"protected function getFromLookup(/*# string */ $key)\n {\n // found already ? or try find\n if ($key === $this->cache_key || $this->hasInLookup($key)) {\n return $this->getFromRegistry($this->cache_reg, $key);\n }\n // not found\n return null;\n }",
"public function lookup($key)\n {\n if (!$this->contains($key)) {\n return null;\n }\n return $this->_data[$key];\n }",
"public function getObject( $key ) {\n\t\tif ( false === $this->isConnected() ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->client->getObject( array(\n\t\t\t'Region' => $this->region,\n\t\t\t'Bucket' => $this->bucket,\n\t\t\t'Key' => $key\n\t\t) );\n\t}",
"public function findKey($key);",
"public function tryToGetByKey(string $key): ?IPair\n {\n foreach ($this as $pair) {\n if ($pair->getKey() == $key) {\n return $pair;\n }\n }\n\n return null;\n }",
"public function get($key)\n {\n $address = $this->generateHash($key);\n\n if (! isset($this->table[$address]) || $this->table[$address]->count() === 0) {\n return null;\n }\n\n $current = $this->table[$address]->getHead();\n\n while ($current !== null) {\n $data = $current->getData();\n\n if ($data->getKey() === $key) {\n return $data->getValue();\n }\n\n $current = $current->getNext();\n }\n\n return null;\n }",
"public function getProperty($key) \n {\n $props = $this->getClient()->getBucketProperties($this->getName());\n if (array_key_exists($key, $props)) {\n return $props[$key];\n } else {\n return NULL;\n }\n }",
"public static function get($key)\n {\n $rs = Db::query(\"\n select value, score\n from okapi_cache\n where\n `key` = '\".Db::escape_string($key).\"'\n and expires > now()\n \");\n list($blob, $score) = Db::fetch_row($rs);\n if (!$blob)\n return null;\n if ($score != null) # Only non-null entries are scored.\n {\n Db::execute(\"\n insert into okapi_cache_reads (`cache_key`)\n values ('\".Db::escape_string($key).\"')\n \");\n }\n return unserialize(gzinflate($blob));\n }",
"public function findByKey($key)\n {\n return $this->get($key);\n }",
"public function findByKey($key)\n {\n return $this->get($key);\n }",
"private function tryGetFromCache($key) {\n if (isset(self::$cache[$key])) {\n return self::$cache[$key];\n }\n \n return NULL;\n }",
"public function findByKey($key);",
"public function findByKey($key);",
"public function findByKey($key);",
"public function get($key)\n {\n $ifNotFound = new stdClass;\n\n $result = $this->find(\n function ($k, $v) use ($key) {\n return $k == $key;\n },\n $ifNotFound\n );\n\n if ($result === $ifNotFound) {\n throw new ItemNotFound;\n }\n\n return $result;\n }",
"public function get($key, &$found = null);",
"public function getKey($key, $default = null)\n {\n if ($this->hasKey($key)) {\n return $this->bucketStorage[$key];\n }\n\n return $default;\n }",
"public function getBucket($name, $type = null) {}",
"public function get($key) {\r\n\t\t\tif ($this->contains($key))\r\n\t\t\t\treturn $this->items[$key];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}",
"public function get(string $key)\n {\n return $this->store[$this->prefix . $key] ?? null;\n }",
"static public function get($className, $key)\n {\n if (self::isCached($className, $key)) {\n return self::$_objects[$className][$key];\n }\n\n return null;\n }",
"public function retrieve($key = null);",
"static public function get(string $bucket_id, string $key){\n $local_key = self::localKey($bucket_id, $key);\n if (isset(self::$storage_arr[$local_key])) {\n return self::$storage_arr[$local_key];\n }\n\n $bucket = CacheConfig::bucket($bucket_id);\n $value = $bucket->get($key);\n\n //if ($value !== false) { // why not store false?\n self::$storage_arr[$local_key] = $value;\n //}\n\n return $value;\n }",
"public function offsetGet ($key): mixed\n\t{\n\t\tif ($this->offsetExists($key)) {\n\t\t\treturn $this->storage[$key];\n\t\t}\n\n\t\treturn null;\n\t}",
"public function get( $key )\n {\n\n if( $this->level1 )\n {\n $cached = $this->level1->get( $key );\n\n if( is_null( $cached ) && $this->level2 )\n {\n return $this->level2->get( $key );\n }\n\n return $cached;\n }\n\n return null;\n\n }",
"public function tryGet($key)\n {\n if (isset($this->stash[$key])) {\n return $this->stash[$key];\n }\n\n if ($this->parent && $this->parent->tryGet($key) !== null) {\n return $this->parent->tryGet($key);\n }\n\n return null;\n }",
"public function next(): ?Bucket;"
] | [
"0.69412774",
"0.6336031",
"0.6201179",
"0.6069237",
"0.6000584",
"0.5938614",
"0.58459705",
"0.5825846",
"0.58137226",
"0.57260865",
"0.5697827",
"0.568877",
"0.568877",
"0.5680721",
"0.5638888",
"0.5638888",
"0.5638888",
"0.55421335",
"0.55399615",
"0.5534865",
"0.5534541",
"0.5512263",
"0.54409",
"0.5421303",
"0.5409134",
"0.5407364",
"0.532841",
"0.5320775",
"0.5312124",
"0.5311323"
] | 0.77884257 | 0 |
Returns the directory part of the path (path parameter may include query string) | public function dirname($path) {
if (!$path) {
return false;
}
$i = strpos($path, '?');
$dir = $i ? substr($path, 0, $i) : $path;
$i = strrpos($dir, '/');
$dir = $i ? substr($dir, 0, $i) : '/';
if (!($dir[0] == '/')) {
$dir = '/' . $dir;
}
return $dir;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDir()\n {\n\treturn substr($this->getUrl(), 0, strrpos($this->getUrl(), '/'));\n }",
"function getRequestedFolder()\n {\n // get the current requested directory\n $page = array_key_exists('__dir', $_GET) ? $_GET['__dir'] : null;\n $currentDir = $this->secureInput($page);\n\n // check if special character found\n if (isset($currentDir) && strpos($currentDir, \"/\") !== false) {\n\n // separate the string with each / char found\n $currentDirList = explode(\"/\", $currentDir);\n\n return $currentDirList[0];\n } else {\n return \"\";\n }\n }",
"function dirPath() { return (\"../../\"); }",
"public function getPath()\n {\n $path = $_SERVER[\"REQUEST_URI\"] ?? DIRECTORY_SEPARATOR;\n $position = strpos($path, '?');\n if ($position === false) {\n return $path;\n }\n return substr($path, 0, $position);\n }",
"function dirname ($path) {}",
"function op_directory_path() {\n\tstatic $path;\n\n\tif ( empty( $path ) )\n\t\t$path = apply_filters( 'op/directory_path', __DIR__ );\n\n\treturn $path;\n}",
"public function getPath($path = '')\n {\n return '/'.$this->dir.'/'.trim($path, '/');\n }",
"function dirPath() {return (\"../../../../\"); }",
"public static function getPath() {\n\t\t\t$pathinfo=pathinfo($_SERVER[\"SCRIPT_NAME\"]);\n\t\t\t$dirname=$pathinfo[\"dirname\"];\n\t\t\t$url=$_SERVER[\"REQUEST_URI\"];\n\n\t\t\tif (strpos($url,\"?\")!==FALSE)\n\t\t\t\t$url=substr($url,0,strpos($url,\"?\"));\n\n\t\t\tif (substr($url,0,strlen($dirname))!=$dirname)\n\t\t\t\tthrow new Exception(\"Somthing is malformed.\");\n\n\t\t\t/*echo \"dirname: \".$dirname.\"\\n\";\n\t\t\techo \"url: \".$url.\"\\n\";*/\n\n\t\t\tif (php_sapi_name()==\"cli-server\")\n\t\t\t\treturn $url;\n\n\t\t\treturn substr($url,strlen($dirname));\n\t\t}",
"public function getDir(){\n\t\treturn dirname($this->path());\n\t}",
"public function getDirectory();",
"public function getDirectory();",
"protected function getPath()\n\t{\n\t\t$path = preg_replace(\n\t\t\t'/\\?.*$/', \n\t\t\t'', \n\t\t\t$this->request->server->get('REQUEST_URI')\n\t\t);\n\t\tif ($path === '/') {\n\t\t\treturn $path;\n\t\t}\n\n\t\tif ($path[strlen($path) - 1] == '/') {\n\t\t\t$path = substr($path, 0, -1);\n\t\t}\n\t\t\n\t\tif ($root = $this->getRoot()) {\n\t\t\t$path = str_replace($root, '', $path);\n\t\t}\n\t\t\n\t\treturn $path;\n\t}",
"public function getDirName()\n {\n $segments = $this->uri->getPathSegments();\n array_pop($segments);\n return '/'.implode('/', $segments);\n }",
"public function getDirPath()\r\n {\r\n return $this->directory_string; \r\n \r\n }",
"function dir_path($path){\n\treturn str_replace('\\\\', '/', FCPATH).$path;\n}",
"public static function directory()\n {\n // Obtem o endereço da raíz do index\n $urix = explode('/', $_SERVER['PHP_SELF']);\n\n // Remove o index.php do array\n unset($urix[count($urix) - 1]);\n\n // Remonta o caminho utilizando a URL editada\n return $_SERVER['REQUEST_SCHEME'] . \"://\" . $_SERVER['SERVER_NAME'] . implode('/', $urix) . '/';\n }",
"public function path()\n {\n $pattern = trim($this->getPathInfo(), '/');\n return $pattern == '' ? '/' : $pattern;\n }",
"public function path()\n {\n $pattern = trim($this->getPathInfo(), '/');\n return $pattern == '' ? '/' : $pattern;\n }",
"private function url_dir()\n\t{\n\t $this->fix_request_uri();\n\t $server_port = $_SERVER['SERVER_PORT'];\n\t $https = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $server_port == 443);\n\t $scheme = $https ? \"https://\" : \"http://\";\n\t $host = $_SERVER['SERVER_NAME'];\n\t \n\t $port = \"\";\n\t if (($https && $server_port <> 443) || \n\t\t (!$https && $server_port <> 80)) {\n\t\t$port = \":\" . $server_port;\n\t }\n\t\t\n\t $parts = $this->parse_url($_SERVER['REQUEST_URI']); // see http://php.net/manual/en/function.parse-url.php \n\t $path = $parts['path']; // /foo.php or /a/b/foo.php\n\n\t $path_parts = preg_split(\"[\\/]\", $path);\n\t array_pop ($path_parts);\n\t \n\t return $scheme . $host . $port . implode('/', $path_parts) . (count($path_parts) > 0 ? '/' : ''); \n\t}",
"private function getGalleryDir()\n {\n $nextGenGalleryOptions = $this->nextGenGallery->getOptions();\n $dir = str_replace(\"\\\\\", \"/\", ABSPATH);\n $dir .= $nextGenGalleryOptions['gallerypath'];\n\n return $dir;\n }",
"public function test_get_dir_from_path() {\n\t\t$this->assertEquals( Utils::get_dir_from_path( '/first/dir' ), 'first' );\n\t\t$this->assertEquals( Utils::get_dir_from_path( 'second/dir' ), 'second' );\n\t\t$this->assertEquals( Utils::get_dir_from_path( '/third/dir/' ), 'third' );\n\t\t$this->assertEquals( Utils::get_dir_from_path( '/fourth/dir/has.file' ), 'fourth' );\n\t}",
"public function get_base_dir() {\n\t\tif ( ! empty( $this->path_delimiter ) && ! empty( $this->path ) ) {\n\t\t\treturn array_pop( explode( $this->path_delimiter, $this->path ) );\n\t\t}\n\t\treturn;\n\t}",
"function get_upload_directory(){\t\t\t\n\t\t\treturn $this->course->get_base_directory() . \"/\" . $_GET['assndir'];\n\t\t}",
"public function dirname(){\n\t\treturn $this->info(PATHINFO_DIRNAME);\n\t}",
"public function path()\n {\n $pattern = trim($this->getPathInfo(), '/');\n\n return $pattern == '' ? '/' : $pattern;\n }",
"public function get_directory_path(){\n\t\t$current_folder = realpath(dirname(__FILE__));\n\t\t$current_folder = str_replace('\\\\classes', '/', $current_folder);\n\t\t$current_folder = str_replace('/classes', '/', $current_folder);\n\t\treturn $current_folder;\n\t}",
"public static function path()\n {\n \treturn substr(__DIR__, 0, -11);\n }",
"public function getParsedPath();",
"public function getDir() : string {\n return $this->path;\n }"
] | [
"0.7149352",
"0.69909114",
"0.69252443",
"0.6852533",
"0.676964",
"0.67233986",
"0.6691758",
"0.6660934",
"0.6654001",
"0.6615757",
"0.65952396",
"0.65952396",
"0.6535148",
"0.65225387",
"0.6515159",
"0.6482587",
"0.6437939",
"0.6428789",
"0.6428789",
"0.6387649",
"0.63827306",
"0.63473153",
"0.6346601",
"0.634375",
"0.6340272",
"0.63293993",
"0.6315735",
"0.6309888",
"0.63063496",
"0.6297914"
] | 0.7090669 | 1 |
Checks if the requested host exists | public function checkHost() {
if (!$this->host) {
throw new URLException(120);
}
$regexp = '/^\d{2,3}(\.\d{1,3}){3}$/';
if (!checkdnsrr($this->host, 'A') && !preg_match($regexp, $this->host)) {
throw new URLException(120);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasHost()\n {\n return isset($this->host);\n }",
"public function isAllowed($host);",
"function url_exists($url) {\n\t\t$url = str_replace(\"http://\", \"\", $url);\n\t\tif (strstr($url, \"/\")) {\n\t\t\t$url = explode(\"/\", $url, 2);\n\t\t\t$url[1] = \"/\".$url[1];\n\t\t} else {\n\t\t\t$url = array($url, \"/\");\n\t\t}\n\t\t$fh = fsockopen($url[0], 80);\n\t\tif ($fh) {\n\t\t\tfputs($fh,\"GET \".$url[1].\" HTTP/1.1\\nHost:\".$url[0].\"\\n\\n\");\n\t\t\tif (fread($fh, 22) == \"HTTP/1.1 404 Not Found\") {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"function url_exists($url){\n\t\t$url = str_replace(\"http://\", \"\", $url);\n\t\tif (strstr($url, \"/\")) {\n\t\t\t$url = explode(\"/\", $url, 2);\n\t\t\t$url[1] = \"/\".$url[1];\n\t\t} else {\n\t\t\t$url = array($url, \"/\");\n\t\t}\n\n\t\t$fh = fsockopen($url[0], 80);\n\t\tif ($fh) {\n\t\t\tfputs($fh,\"GET \".$url[1].\" HTTP/1.1\\nHost:\".$url[0].\"\\n\\n\");\n\t\t\tif (fread($fh, 22) == \"HTTP/1.1 404 Not Found\") { return FALSE; }\n\t\t\telse { return TRUE; }\n\n\t\t} else { return FALSE;}\n\t}",
"public function isOwnHost() : bool\n {\n if (isset($this->server['HTTP_REFERER'])) {\n return $this->server->getHost() === (new URL($this->server['HTTP_REFERER']))->host;\n }\n return false;\n }",
"public static function isHost($parameter) {\r\n\r\n\t\treturn self::isMatchRegex($parameter, \"/^([a-zA-Z0-9]([a-zA-Z0-9\\\\-]{0,61}[a-zA-Z0-9])?\\\\.)+[a-zA-Z]{2,6}/\", \"host\")\r\n\t\t\t&& !self::isEmpty($parameter);\r\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 }",
"public static function remoteFileExists ($url)\n\t{\n\t\n\t\t$head = \"\";\n\t\t$url_p = parse_url ($url);\n\t\t\n\t\tif (isset ($url_p[\"host\"]))\n\t\t\t$host = $url_p[\"host\"]; \n\t\telse\n\t\t\treturn 1; \n\t\t\n\t\tif (isset ($url_p[\"path\"]))\n\t\t\t$path = $url_p[\"path\"]; \n\t\telse\n\t\t\t$path = \"\";\n\t\t\n\t\t$fp = @fsockopen ($host, 80, $errno, $errstr, 20);\n\t\tif (!$fp)\n\t\t\treturn 2; \n\t\telse\n\t\t{\n\t\t $parse = parse_url($url);\n\t\t $host = $parse['host'];\n\t\t \n\t\t fputs($fp, \"HEAD \".$url.\" HTTP/1.1\\r\\n\" );\n\t\t fputs($fp, \"HOST: \".$host.\"\\r\\n\" );\n\t\t fputs($fp, \"Connection: close\\r\\n\\r\\n\" );\n\t\t $headers = \"\";\n\t\t while (!feof ($fp))\n\t\t \t$headers .= fgets ($fp, 128); \n\t\t}\n\t\tfclose ($fp);\n\t\t$arr_headers = explode(\"\\n\", $headers);\n\n\t\tif (isset ($arr_headers[0]))\n\t\t\t$return = (strpos ($arr_headers[0], \"404\" ) === false) ? 0 : 1; \n\t\t\n\t\treturn $return;\n\t}",
"function check_health ( $url ) {\n $url = preg_replace('/http:/', 'https:', $url);\n if ( can_connect( $url ) ) {\n $opts = array(\n 'http' => array(\n 'header' => \"X-Forwarded-For: 50.232.112.210\"\n )\n );\n\n $context = stream_context_create($opts);\n $health = @file_get_contents( $url, false, $context );\n return strpos( $health, 'successful' ) !== false;\n }\n else {\n return false;\n }\n }",
"function does_url_exists($url) {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_exec($ch);\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n \n if ($code == 200) {\n $status = true;\n } else {\n $status = false;\n }\n curl_close($ch);\n return $status;\n }",
"function domain_exists ($domain)\n\t{\n\t $query_string = \"SELECT site_url FROM sites where site_url = ?\"; \n\t $result = $this->db->query($query_string,$domain);\n\t if ($result->num_rows() > 0){\n\t\t // true\n\t\t return true;\n\t }else{\n\t\t // false\n\t\t return false;\n\t }\n\t\t\n\t}",
"public function verifyHost() { return $this->__verifyHost; }",
"public function verifyHost() { return $this->__verifyHost; }",
"protected function checkHost(\\SwaggerValidator\\Common\\Context $context)\r\n {\r\n if (!isset($this->host)) {\r\n return true;\r\n }\r\n\r\n if ($context->getDataValue() === null) {\r\n return true;\r\n }\r\n\r\n if (strtolower($context->getDataValue()) && strtolower($this->host)) {\r\n return true;\r\n }\r\n\r\n return $context->setValidationError(\\SwaggerValidator\\Common\\Context::VALIDATION_TYPE_HOSTNAME_ERROR, 'HostName requested is not allowed', __METHOD__, __LINE__);\r\n }",
"function UR_exists($url) {\n\t$headers = get_headers($url);\n\treturn stripos($headers[0], \"200 OK\") ? true : false;\n}",
"function UR_exists($url){\n\t $headers=get_headers($url);\n\t return stripos($headers[0],\"200 OK\")?true:false;\n\t}",
"private function _validateHost( $host )\n\t{\n\t\t//this is just a path declaration\n\t\tif( !isset($host['host']) && isset($host['path']) ){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn isset($host['username']) && isset($host['host']) && isset($host['path']);\n\t}",
"public static function handleHostnameAvailabilityRequest()\n {\n $results = [\n 'success' => false,\n 'data' => [\n 'hostname' => null,\n 'available' => false\n ]\n ];\n\n if (!empty($_GET['hostname'])) {\n $results['success'] = true;\n $results['data']['hostname'] = $_GET['hostname'];\n\n // Search for hostname\n $Hostname = Hostname::getByWhere(['Hostname' => $results['data']['hostname']]);\n\n if (!$Hostname) {\n $results['data']['available'] = true;\n }\n\n } else {\n $results['error'] = 'Missing Hostname GET param';\n }\n\n \\JSON::respond($results);\n }",
"protected function isIncorrectHost($request)\n {\n return $request->header('Host') !== config('canonical.host');\n }",
"public static function inHost($needle)\n {\n return self::hasString('HTTP_HOST', $needle);\n }",
"public function hasLocalHost()\n\t{\n\t\t$segments = explode('.', $this->host);\n\t\t$tld = $segments[count($segments) - 1];\n\n\t\treturn $this->host == '127.0.0.1'\n\t\t\t|| in_array($tld, [ 'localhost', 'local', 'test', 'wip' ]);\n\t}",
"function urlExists(string $url): bool\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_NOBODY, true); // HEAD request\n curl_setopt($ch, CURLOPT_USERAGENT, APP_USER_AGENT);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, APP_CURL_CONNECTTIMEOUT);\n curl_setopt($ch, CURLOPT_TIMEOUT, APP_CURL_TIMEOUT);\n if (curl_exec($ch) === false) {\n curl_close($ch);\n return false;\n }\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n return $code === 200;\n}",
"function getHost($server_http_host = '', array $avail_host = array())\n\t{\n\t \tforeach( $avail_host as $value)\n\t \t{\n\t \t\t$host = stripos($server_http_host, $value); \n\t \t\tif($host !== false)\n\t \t\t{\n\t \t\treturn $value;\n\t \t\texit();\n\t \t\t} \n\t \t}\n\t}",
"function ip_address_exist($link, $ip){\r\n\t\t$query = \"SELECT id FROM hacker_address\";\r\n\t\t$query .= \" WHERE ip = '{$ip}'\";\r\n\t\t$query .= \" LIMIT 1\";\r\n\r\n\t\t//Query the database\r\n\t\t$result = mysqli_query($link, $query);\r\n\r\n\t\t//confirm if there was an error in the query\r\n\t\tconfirm_connection($result, \"Failed to check if an ip address exists\", $link);\r\n\r\n\t\t//Return the result whether the ip address exits or not\r\n\t\tif(mysqli_num_rows($result) >= 1){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function checkHost(string $host, ?int $port = null): bool\n {\n $fp = @fsockopen($host, $port, $errNo, $errStr, 2);\n\n return $fp !== false;\n }",
"public function hasHostPrefix(): bool\n {\n return $this->hasHostPrefix;\n }",
"public function checkConnection(string $host): bool\n {\n $status = false;\n $connected = @fsockopen($host, 80);\n\n if ($connected){\n $status = true;\n fclose($connected);\n }\n\n return $status; \n }",
"function url_exists($url){//se passar a URL existe\n $c=curl_init();\n curl_setopt($c,CURLOPT_URL,$url);\n curl_setopt($c,CURLOPT_HEADER,1);//get the header\n curl_setopt($c,CURLOPT_NOBODY,1);//and *only* get the header\n curl_setopt($c,CURLOPT_RETURNTRANSFER,1);//get the response as a string from curl_exec(), rather than echoing it\n curl_setopt($c,CURLOPT_FRESH_CONNECT,1);//don't use a cached version of the url\n $exists = curl_exec($c);\n if(!$exists) return false; \n $httpcode=curl_getinfo($c,CURLINFO_HTTP_CODE);\n return $httpcode<400 ? $httpcode : false;\n \n // if(!curl_exec($c)){\n // echo $url.' inexists';\n // return false;\n // } else {\n // echo $url.' exists';\n // return true;\n // }\n // $httpcode=curl_getinfo($c,CURLINFO_HTTP_CODE);\n \n //return ($httpcode<400);\n}",
"function remoteFileExists($url) {\n $curl = curl_init($url);\n //don't fetch the actual page, you only want to check the connection is ok\n curl_setopt($curl, CURLOPT_NOBODY, true);\n\n //do request\n $result = curl_exec($curl);\n $ret = false;\n //if request did not fail\n if ($result !== false) {\n //if request was ok, check response code\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($statusCode == 200) {\n $ret = true;\n }\n }\n curl_close($curl);\n return $ret;\n }",
"function is_url_exist($url){\n $ch = curl_init($url); \n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_exec($ch);\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n \n if($code == 200){\n $status = true;\n }else{\n $status = false;\n }\n curl_close($ch);\n return $status;\n }"
] | [
"0.765385",
"0.6724018",
"0.66364205",
"0.66108763",
"0.65460163",
"0.6543098",
"0.6500145",
"0.6461731",
"0.6441251",
"0.64187545",
"0.63577044",
"0.6349449",
"0.6349449",
"0.63190866",
"0.62989366",
"0.62556",
"0.624036",
"0.6219339",
"0.6212683",
"0.6210754",
"0.6207809",
"0.6194861",
"0.6191027",
"0.6190398",
"0.61723745",
"0.61721754",
"0.616927",
"0.6160288",
"0.61509526",
"0.61465704"
] | 0.7127861 | 1 |
Escapes the string, replacing all unsafe characters with codes. | public function escape($str, $unsafe = null) {
if (!isset($unsafe)) {
$unsafe = URI::regex('Unsafe');
} else {
$unsafe = "/" . $unsafe . "/";
}
if (preg_match_all($unsafe, $str, $matches) && count($matches) >0) {
$str = preg_replace_callback($unsafe, create_function('$matches', '
$replace = $matches[0];
$result = "";
for($i=0; $i<strlen($replace); $i++) {
$result .= sprintf(\'%%%02X\', ord($replace[$i]));
}
return $result;'), $str);
}
return $str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function escape($string);",
"abstract public function escape_string( $str );",
"abstract public function escape($str);",
"abstract protected function escape($str);",
"function escape($str);",
"function safeEscapeString($string) \r\n{ \r\n if(is_array($string))\r\n {\r\n return array_map(__METHOD__, $string);\r\n }\r\n if(!empty($string) && is_string($string)) \r\n {\r\n return str_replace(array('\\\\', \"\\0\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\"), array('\\\\\\\\', '\\\\0', '\\\\n', '\\\\r', \"\\\\'\", '\\\\\"', '\\\\Z'), $string);\r\n } \r\n}",
"function string_safe_escape($string)\n{\n\t\n\t$data_string=$string;\n\tif ( filter_var($data_string, FILTER_SANITIZE_STRING) == TRUE) {\n\t$link_free_string=remove_unwanted_url($data_string);\n\t$escaped_string=xss_clean($link_free_string);\n\t\t\n\t$safe_string = $escaped_string;\n\t}\n\telse\n\t{\n\t$safe_string = \"ERROR\";\n\t}\n\treturn $safe_string;\n\t}",
"public static function my_real_escape_string($value)\n {\n $search = array(\"\\x00\", \"\\n\", \"\\r\", \"\\\\\", \"'\", \"\\\"\", \"\\x1a\");\n $replace = array(\"\\\\x00\", \"\\\\n\", \"\\\\r\", \"\\\\\\\\\" ,\"\\'\", \"\\\\\\\"\", \"\\\\\\x1a\");\n\n return str_replace($search, $replace, $value);\n }",
"protected function escape(/*string*/ $text)\n\t{\n\t\treturn strtr(\n\t\t\t$text,\n\t\t\tarray('&' => '&', '<' => '<', '>' => '>',\n\t\t\t\t\t'\\'' => ''', '\"' => '"')\n\t\t);\n\t}",
"abstract public function escape($value);",
"function safe($string) {\n return stripslashes(htmlspecialchars($string, ENT_NOQUOTES, \"UTF-8\"));\n}",
"function escape_string($toEscape) {\n\n $remove_chars = array('\"', '-', '+', '=', '@', ';', '*', '\\\\', '\\'', '%', '<', '>', '/', '\\n', '$', '!', '#', '^', '&', '*', '(', ')', '~', '`', '[', ']', '{', '}', '|', ':', '?'); \n\n for($i = 0; $i < count($remove_chars); $i++) {\n $toEscape = str_replace($remove_chars[$i], '', $toEscape);\n }\n\n for($i = 0; $i < count($escape_chars); $i++) {\n $toEscape = str_replace($escape_chars[$i], '\\\\' . $escape_chars[$i], $toEscape);\n }\n\n return $toEscape;\n}",
"static function escape($string)\n {\n return Processor::escape_braces($string);\n }",
"function Escape($string) {\n\t\treturn strtr($string, array(\n\t\t\t\"\\r\" => ' ',\n\t\t\t'&' => '&',\n\t\t\t'<' => '<',\n\t\t\t'>' => '>',\n\t\t));\n\t}",
"function encodeDataSafe($data) {\n\t$out = urlencode(htmlentities($data, ENT_QUOTES));\n\treturn $out;\n}",
"public static function escapeString($str, $allow_wildcards=false) {\n $needles = [\n '\\\\', '+', '-', '=', '&&', '||', '>', '<', '!', '(', ')',\n '{', '}', '[', ']', '^', '\"', '~', ':', '/', ' '\n ];\n $replacements = [\n '\\\\\\\\', '\\\\+', '\\\\-', '\\\\=', '\\\\&&', '\\\\||', '\\\\>', '\\\\<', '\\\\!', '\\\\(', '\\\\)',\n '\\\\{', '\\\\}', '\\\\[', '\\\\]', '\\\\^', '\\\\\"', '\\\\~', '\\\\:', '\\\\/', '\\\\ '\n ];\n if(!$allow_wildcards) {\n $needles = array_merge($needles, ['*', '?']);\n $replacements = array_merge($replacements, ['\\\\*', '\\\\?']);\n }\n return str_replace($needles, $replacements, $str);\n }",
"public static function escape_string($cadena);",
"public function escape($value);",
"public function escape($value);",
"function escape($input, $double_encode = FALSE)\n{\n // Ensure we have valid correctly encoded string..\n // http://stackoverflow.com/questions/1412239/why-call-mb-convert-encoding-to-sanitize-text\n $input = mb_convert_encoding($input, 'UTF-8', 'UTF-8');\n // why are we using html entities? this -> http://stackoverflow.com/a/110576/992171\n return htmlentities($input, ENT_QUOTES, 'UTF-8', $double_encode);\n}",
"function db_escape_string($string)\n{\n $string = htmlspecialchars_decode($string);\n $string = preg_replace(\"/'/\", \"\\'\", $string);\n $string = preg_replace(\"/;/\", \"\\;\", $string);\n return $string;\n}",
"function escape($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}",
"function escape($string){\n\treturn htmlentities($string, ENT_QUOTES, 'UTF-8'); #ENT_QUOTES skips single and double quotes\n}",
"function escapeString($string) {\n return str_replace(\"'\", \"''\", $string);\n }",
"function escape($string){\n return (htmlentities($string, ENT_QUOTES, 'UTF-8'));\n}",
"function safeEncodeString($str)\n{\n\t$result = htmlentities($str, ENT_QUOTES | ENT_HTML5);\n\treturn $result;\n}",
"abstract public function escape(string $value) : string;",
"function escape($string) {\n\t\treturn htmlentities($string, ENT_QUOTES, 'UTF-8');\n\t}",
"public static function lower_unsafe_characters() {\n\t\t//--\n\t\treturn '/[\\x00-\\x08\\x0B-\\x0C\\x0E-\\x1F]/'; // all lower dangerous characters: x00 - x1F except: \\t = x09 \\n = 0A \\r = 0D\n\t\t//--\n\t}",
"function escapeString($string) {\n\t\tApp::import('Core', 'Multibyte');\n\t\t$escape = array(\"\\r\\n\" => \"\\n\", \"\\r\" => \"\\n\");\n\t\t$string = str_replace(array_keys($escape), array_values($escape), $string);\n\t\treturn $this->_utf8ToHex($string);\n\t}"
] | [
"0.7355695",
"0.71378773",
"0.70707923",
"0.6903991",
"0.68374354",
"0.6813105",
"0.6661182",
"0.6576993",
"0.65330917",
"0.6456934",
"0.64445406",
"0.64233774",
"0.63825",
"0.63806695",
"0.635941",
"0.6358186",
"0.635247",
"0.634811",
"0.634811",
"0.634064",
"0.63343185",
"0.63067085",
"0.62975246",
"0.6260161",
"0.6250384",
"0.62343705",
"0.6221806",
"0.6200685",
"0.61845773",
"0.61842996"
] | 0.76191896 | 0 |
Set and get config value. If given value is null only get is executed. | public function _config(string $name, $value = null)
{
if ($value !== null) {
$this->_setConfig($name, $value);
}
return $this->_getConfig($name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValue($key) {\n // is this config value stored in the db?\n $db_value_config = AppConfig::getConfigValue($key);\n $value = null;\n\n $value = isset($this->config[$key]) ? $this->config[$key] : null;\n/*\n Profiler::debugPoint(false,__METHOD__, __FILE__, __LINE__);\n\n var_dump($db_value_config);\n\n if ($db_value_config) {\n $option_dao = DAOFactory::getDAO(\"OptionDAO\");\n $db_value = $option_dao->getOptionValue(OptionDAO::APP_OPTIONS, $key, false );\n $value = $db_value ? $db_value : $db_value_config['default'];\n // convert db text booleans if needed\n if ($value == 'false') {\n $value = false;\n } else if ($value == 'true') {\n $value = true;\n }\n } else {\n // if not a db config value, get from config file\n $value = isset($this->config[$key]) ? $this->config[$key] : null;\n }\n*/\n return $value;\n }",
"public function setConfig($name, $value = null);",
"public function Get($configKey, $valueIfNotExists = false);",
"protected function getValueFromConfig() \n\t{\n\t\t$value = NULL;\n\t\t$config = $this->getConfig();\n\t\tif (isset($this->params[self::PARAM_FIELD]))\n\t\t{\n\t\t\tif (is_array($this->params[self::PARAM_FIELD]))\n\t\t\t{\n\t\t\t\tforeach ($this->params[self::PARAM_FIELD] as $field)\n\t\t\t\t{\n\t\t\t\t\t$value[$field] = $config->{$field};\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = $config->{$this->params[self::PARAM_FIELD]};\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}",
"abstract public function getDriverConfigValue();",
"public static function config($key, $value = null)\n {\n // If both parameters are passed, set the value. Otherwise, if the\n // config hasn't been loaded, attempt to load to get a value.\n if (func_num_args() == 2) {\n $config = isset(self::$config) ? self::$config : array();\n $config[$key] = $value;\n\n self::verifyConfig($config);\n\n self::$config = $config;\n } elseif (!isset(self::$config)) {\n self::loadConfig();\n }\n\n return self::$config[$key];\n }",
"function config($set = NULL, $value = NULL) {\n if (func_num_args() === 0) {\n return configure::all();\n } elseif ( ! is_null($value)) {\n configure::set($set, $value);\n } else {\n if ( ! is_assoc($set) && ! is_file($set)) {\n return configure::get($set);\n }\n configure::add($set);\n }\n}",
"public function __get($key) {\n if (!array_key_exists($key, $this->settings)) {\n return null;\n }\n return $this->settings[$key]['value'];\n }",
"public function __get($key) {\n if (!array_key_exists($key, $this->settings)) {\n return null;\n }\n return $this->settings[$key]['value'];\n }",
"public function getConfigValue($path)\n {\n // return store config value\n return $this->scopeConfig->getValue($path);\n }",
"public function config($name, $value = true) {\n $c = $this->container;\n if (is_array($name)) {\n if (true === $value) {\n $c['settings'] = array_replace_recursive($c['settings'], array_change_key_case($name));\n } else {\n $c['settings'] = array_merge($c['settings'], array_change_key_case($name));\n }\n } elseif (func_num_args() === 1) {\n return Arr::get($c['settings'], $name);\n } else {\n $c['settings'] = Arr::set($c['settings'], $name, $value);\n }\n return null;\n }",
"public static function get($value = null, $default = null)\n\t{\n\t\treturn config()->get(value(self::config($value)), $default);\n\t}",
"public static function getConfigValue($key) {\n $value = isset(self::$config_data[$key] ) ? self::$config_data[$key] : false;\n return $value;\n }",
"public function getConfigValue($key, $default = null);",
"public static function config($name, $value = null)\n {\n if ($value === null) {\n return static::$options[$name];\n } else {\n static::$options[$name] = $value;\n }\n }",
"private function config($key, $value = null, $merge = null)\n {\n return $this->Crud->action()->setConfig($key, $value, $merge ?? true);\n }",
"public function getConfigValue($param)\n {\n return $this->config->get($param);\n }",
"public function config($key = null, $value = null)\n {\n if (is_null($key)) {\n return self::$config;\n }\n\n if (is_string($key)) {\n return self::$config->get($key, $value);\n }\n\n if (is_array($key)) {\n self::$config->set($key);\n return $this;\n }\n\n return self::$config;\n }",
"public function setCfg($mixed, $val = null);",
"function setConf($key,$val,$path=array()){\n\treturn getConf($key,$path,false,1,$val);\n}",
"public function config($key = NULL, $value = NULL) {\n $numArgs = func_num_args();\n if (2 === $numArgs) {\n $this->_config[$key] = $value;\n } else if (1 === $numArgs) {\n if (is_array($key)) {\n return $this->_config = $key;\n } else {\n return @$this->_config[$key];\n }\n }\n return $this->_config;\n }",
"public function __get($name){\n\t\treturn $this->config[$name] ?? false;\n\t}",
"protected function getConfigValue($name)\n\t{\n\t\tif (substr($name, 0, 1) != '/')\n\t\t{\n\t\t\t$name = '/' .$name;\n\t\t}\n\t\t$config = new JsonConfig(getcwd() . '/composer.json');\n\t\t$value = $config->getConfigValue('/extra/contao' . $name);\n\n\t\t// fallback to global config.\n\t\tif ($value === null)\n\t\t{\n\t\t\t/** @var JsonConfig $config */\n\t\t\t$config = $this->getApplication()->getConfig();\n\t\t\tif ($config !== null)\n\t\t\t{\n\t\t\t\t$value = $config->getConfigValue($name);\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}",
"static function getDgwConfigValue( $label ) {\n $value = null;\n if ( empty( $label ) ) {\n return $value;\n }\n $selDgwConfig =\n\"SELECT value FROM dgw_config WHERE label = '$label'\";\n $daoDgwConfig = CRM_Core_DAO::executeQuery( $selDgwConfig );\n if ( $daoDgwConfig->fetch() ) {\n if ( isset( $daoDgwConfig->value ) ) {\n $value = $daoDgwConfig->value;\n }\n }\n return $value;\n }",
"public function config($operation, $key_or_settings = null, $value = null) {}",
"public function getConfigValue($key){\n\t\treturn array_key_exists($key, $this->_PBX_CONFIG) ? $this->_PBX_CONFIG[$key] : false;\n\t}",
"function getValue($req, $custom = false) {\n try {\n if ($custom === false) {\n $custom = self::CONFIG_PATH;\n }\n return Mage::getStoreConfig($custom . $req, Mage::app()->getStore());\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }",
"public function config($value = null, $default = null) {\r\n // Setter\r\n if (is_array($value) && count($value) > 0) {\r\n $this->_config = $this->arrayMergeRecursiveReplace($this->_config, $value);\r\n // Getter\r\n } else {\r\n if (empty($value)) {\r\n return $this->_config;\r\n }\r\n\r\n if (isset($this->_config[$value])) {\r\n return $this->_config[$value];\r\n }\r\n\r\n if (strpos($value, '.') !== false) {\r\n $config = $this->_config;\r\n $parts = explode('.', $value);\r\n\r\n foreach ($parts as $part) {\r\n if (isset($config[$part])) {\r\n $config = $config[$part];\r\n } else {\r\n $config = $default;\r\n }\r\n }\r\n\r\n return $config;\r\n }\r\n\r\n return $default;\r\n }\r\n }",
"function get($key)\n {\n if (array_key_exists($key, $this->config))\n return $this->config[$key];\n else\n return false;\n }",
"public function get($key)\n\t\t{\n\t\t\tif($this->has($key) == true)\n\t\t\t{\n\t\t\t\treturn $this->config[$key];\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}"
] | [
"0.6681131",
"0.65504336",
"0.6546869",
"0.6486756",
"0.6447368",
"0.64403385",
"0.6409687",
"0.63459116",
"0.63459116",
"0.63092184",
"0.6177148",
"0.6152036",
"0.61145866",
"0.6070438",
"0.60555893",
"0.60432035",
"0.59878576",
"0.5969671",
"0.59629154",
"0.5959638",
"0.59567076",
"0.595388",
"0.5953144",
"0.59263086",
"0.58870465",
"0.58847445",
"0.58808756",
"0.58795184",
"0.58617634",
"0.58373326"
] | 0.6782118 | 0 |
This function returns less vars array to use with phpless. | function presscore_compile_less_vars() {
$less_vars = the7_get_new_less_vars_manager();
do_action( 'presscore_setup_less_vars', $less_vars );
return apply_filters( 'presscore_compiled_less_vars', $less_vars->get_vars() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_less_variables( $instance ) {\n return array(\n\t\t\t\t'st_flex_direction' => $instance['settings']['flex_direction'],\n\t\t\t\t'st_flex_wrap' => $instance['settings']['flex_wrap'],\n\t\t\t\t'st_justify_content' => $instance['settings']['justify_content'],\n\t\t\t\t'st_align_items' => $instance['settings']['align_items'],\n\t\t\t\t'st_align_content' => $instance['settings']['align_content'],\n\t\t\t\t// Items\n\t\t\t\t'st_flex_grow' => $instance['settings']['flex_grow'],\n\t\t\t\t'st_flex_shrink' => $instance['settings']['flex_shrink'],\n\t\t\t\t'st_flex_basis' => $instance['settings']['flex_basis'],\n\t\t\t\t'st_max_width' => $instance['settings']['max_width'],\n\t\t\t\t'st_min_width' => $instance['settings']['min_width'],\n );\n\t}",
"function get_vars() {\n if ($this->debug & 4) {\n echo \"<p><b>get_vars:</b> constructing array of vars...</p>\\n\";\n }\n reset($this->varkeys);\n while(list($k, $v) = each($this->varkeys)) {\n $result[$k] = $this->get_var($k);\n }\n return $result;\n }",
"function add_less_vars( $less_vars ){\n\n\t\tif( pl_setting( 'layout_mode' ) == 'percent' )\n\t\t\t$value = (pl_setting( 'content_width_percent' )) ? pl_setting( 'content_width_percent' ) : '80%';\n\t\telse\n\t\t\t$value = (pl_setting( 'content_width_px' ) && pl_setting( 'content_width_px' ) != '') ? pl_setting( 'content_width_px' ) : '1100px';\n\n\t\n\t\t// if percent mode assign percent option\n\n\t\t$less_vars['plContentWidth'] = $value;\n\t\t$less_vars['pl-page-width'] = $value;\n\n\t\treturn $less_vars;\n\n\t}",
"public function variables(): array {\n\t\treturn $this->_vars;\n\t}",
"function getVars() {\r\n\t\t\treturn array(\r\n\t\t\t\t'breadcrumb'\t\t=> $this->getBreadcrumb(),\r\n\t\t\t\t'html_head'\t\t\t=> $this->page->header,\r\n\t\t\t\t'navigation_0'\t=> $this->getNavigation(0),\r\n\t\t\t\t'navigation_10'\t=> $this->getNavigation(10),\r\n \t\t\t'navigation_1'\t=> $this->getNavigation(1),\r\n \t\t\t'navigation_12'\t=> $this->getNavigation(12),\r\n \t\t\t'navigation_2'\t=> $this->getNavigation(2),\r\n \t\t\t'p'\t\t\t\t\t\t\t=> $this->pageurl,\r\n\t\t\t\t'page_title'\t\t=> $this->htmlPrepare($this->page->title),\r\n\t\t\t\t'page_text'\t\t\t=> $this->htmlPrepare($this->page->text),\r\n\t\t\t\t'page_url'\t\t\t=> $this->htmlPrepare($this->am[0].'/'.$this->page->entry),\r\n 'page_id' => $this->pageid,\r\n\t\t\t\t'top_title'\t\t\t=> $this->htmlPrepare($this->top->title),\r\n\t\t\t\t'top_text'\t\t\t=> $this->htmlPrepare($this->top->text),\r\n\t\t\t\t'top_url'\t\t\t\t=> $this->htmlPrepare($this->am[0].'/'.$this->top->entry),\r\n\t\t\t\t'passthru'\t\t\t=> $this->getPassthru(),\r\n \t\t\t'root'\t\t\t\t\t=> $this->root,\r\n\t\t\t);\r\n\t\t}",
"public function getVariables() {\n\t\treturn array(\n\t\t\t'items'\t\t=> $this->_items,\n\t\t\t'options'\t=> $this->_options,\n\t\t\t'theme' \t=> $this->_theme);\n\t}",
"function get_vars($txt)\n{\n\t$ret = array();\n\tpreg_match_all('/((?:(?:unsigned|struct)\\s+)?\\w+)(?:\\s*(\\*+)\\s+|\\s+(\\**))(\\w+(?:\\[\\s*\\w*\\s*\\])?)\\s*(?:(=)[^,;]+)?((?:\\s*,\\s*\\**\\s*\\w+(?:\\[\\s*\\w*\\s*\\])?\\s*(?:=[^,;]+)?)*)\\s*;/S', $txt, $m, PREG_SET_ORDER);\n\n\tforeach ($m as $x) {\n\t\t// the first parameter is special\n\t\tif (!in_array($x[1], array('else', 'endif', 'return'))) // hack to skip reserved words\n\t\t\t$ret[$x[4]] = array($x[1] . $x[2] . $x[3], $x[5]);\n\n\t\t// are there more vars?\n\t\tif ($x[6]) {\n\t\t\tpreg_match_all('/(\\**)\\s*(\\w+(?:\\[\\s*\\w*\\s*\\])?)\\s*(=?)/S', $x[6], $y, PREG_SET_ORDER);\n\t\t\tforeach ($y as $z) {\n\t\t\t\t$ret[$z[2]] = array($x[1] . $z[1], $z[3]);\n\t\t\t}\n\t\t}\n\t}\n\n//\tif ($GLOBALS['current_function'] == 'for_debugging') { print_r($m);print_r($ret); }\n\treturn $ret;\n}",
"public function getVariables();",
"public function getVariables() {\n\t\t$attributes = $this->_attributes;\n\t\t$attributes['name'] = $this->_name;\n\t\t$attributes['type'] = 'text';\n\t\t\n\t\tif($this->_value) {\n\t\t\t$attributes['value'] = $this->_value;\n\t\t}\n\t\t\n\t\t$loaded = self::$_loaded;\n\t\tself::$_loaded = true;\n\t\t\n\t\treturn array(\n\t\t\t'loaded'\t\t=> $loaded,\n\t\t\t'attributes' \t=> $attributes);\n\t}",
"public function variables()\n {\n return [\n 'id' => $this->elementId,\n 'tools' => $this->tools->render(),\n 'items' => $this->getItems(),\n 'useCreate' => $this->useCreate,\n 'useRefresh' => $this->useRefresh,\n 'title' => $this->title,\n ];\n }",
"public function getVars(): array\n {\n return $this->vars;\n }",
"public function getVariables(): array\r\n {\r\n return $this->variables;\r\n }",
"function the7_get_new_shortcode_less_vars_manager() {\n\t\treturn new The7_Less_Vars_Shortcode_Manager( new Presscore_Lib_SimpleBag(), new The7_Less_Vars_Factory() );\n\t}",
"public function getVars()\r\n\t{\r\n\t\treturn $this->_vars;\r\n\t}",
"protected function get_less_vars() {\n\t\t\t$less_vars = the7_get_new_shortcode_less_vars_manager();\n\n\t\t\t$less_vars->add_keyword( 'unique-shortcode-class-name', 'gallery-shortcode.' . $this->get_unique_class(), '~\"%s\"' );\n\n\t\t\t$less_vars->add_pixel_number( 'media-image-border-radius', $this->get_att( 'image_border_radius' ) );\n\n\t\t\tswitch ( $this->get_att( 'image_hover_bg_color' ) ) {\n\t\t\t\tcase 'gradient_rollover_bg':\n\t\t\t\t\t$first_color = 'rgba(0,0,0,0.6)';\n\t\t\t\t\t$gradient = '';\n\t\t\t\t\tif ( function_exists( 'the7_less_prepare_gradient_var' ) ) {\n\t\t\t\t\t\tlist( $first_color, $gradient ) = the7_less_prepare_gradient_var( $this->get_att( 'custom_rollover_bg_gradient' ) );\n\t\t\t\t\t}\n\t\t\t\t\t$less_vars->add_rgba_color( 'portfolio-rollover-bg', $first_color );\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg-gradient', $gradient );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'solid_rollover_bg':\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg', $this->get_att( 'custom_rollover_bg_color', '~\"\"' ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'browser_width_based' === $this->get_att( 'responsiveness' ) ) {\n\t\t\t\t$columns_attributes = the7_shortcode_add_responsive_columns_data_attributes( array(), $this->get_att( 'bwb_columns' ) );\n\t\t\t\tforeach ( $columns_attributes as $column => $val ) {\n\t\t\t\t\t$less_vars->add_keyword( $column, $val );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$less_vars->add_pixel_number( 'grid-posts-gap', $this->get_att( 'gap_between_posts' ) );\n\t\t\t$less_vars->add_pixel_number( 'grid-post-min-width', $this->get_att( 'pwb_column_min_width' ) );\n\n\t\t\t$shadow_style = '';\n\t\t\tif ( 'shadow' === $this->atts['image_decoration'] ) {\n\t\t\t\t$shadow_style = join( ' ', array(\n\t\t\t\t\t\t$this->atts['shadow_h_length'],\n\t\t\t\t\t\t$this->atts['shadow_v_length'],\n\t\t\t\t\t\t$this->atts['shadow_blur_radius'],\n\t\t\t\t\t\t$this->atts['shadow_spread'],\n\t\t\t\t\t\t$this->atts['shadow_color'],\n\t\t\t\t\t) );\n\t\t\t}\n\t\t\t$less_vars->add_keyword( 'portfolio-img-shadow', $shadow_style );\n\t\t\t$less_vars->add_pixel_number( 'shortcode-filter-gap', $this->get_att( 'gap_below_category_filter', '' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-color', $this->get_att( 'navigation_font_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-accent', $this->get_att( 'navigation_accent_color', '~\"\"' ) );\n\n\t\t\t$gap_before_pagination = '';\n\t\t\tswitch ( $this->get_att( 'loading_mode' ) ) {\n\t\t\t\tcase 'js_pagination':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsp_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'js_more':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsm_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$less_vars->add_pixel_number( 'shortcode-pagination-gap', $gap_before_pagination );\n\n\t\t\t$less_vars->add_pixel_number( 'project-icon-size', $this->get_att( 'project_icon_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-bg-size', $this->get_att( 'project_icon_bg_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-width', $this->get_att( 'project_icon_border_width' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-radius', $this->get_att( 'project_icon_border_radius' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-color', $this->get_att( 'project_icon_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-border-color', $this->get_att( 'project_icon_border_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-bg-color', $this->get_att( 'project_icon_bg_color', '~\"\"' ) );\n\n\t\t\treturn $less_vars->get_vars();\n\t\t}",
"public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}",
"public function getVariables()\n\t{\n\t\treturn (array) $this->tpl->getAssignedVariables();\n\t}",
"public function getVariables()\n\t{\n\t\t$vars = array();\n\t\tforeach($this->fetchAll(\"SHOW VARIABLES\") as $row)\n\t\t{\n\t\t\t$vars[$row[\"Variable_name\"]] = $row[\"Value\"];\n\t\t}\n\t\treturn $vars;\n\t}",
"function vars_language()\n\t{\n\t\tglobal $board_config, $lang;\n\n\t\t$array = array();\n\t\twhile ( list ( $key, $data ) = @each ( $lang['TPL'] ) )\n\t\t{\n\t\t\t$array['L_' . strtoupper($key)] = $data;\n\t\t}\n\n\t\treturn $array;\n\t}",
"public function variables(): array\n {\n return [];\n }",
"public static function variables()\n {\n return self::$codev;\n }",
"public function get_all()\n\t{\n\t\treturn $this->_vars;\n\t}",
"function getVariables()\n {\n \treturn $this->variables;\n }",
"public function getVars() {\n\t\treturn $this->vars;\n\t}",
"public function getVars()\n {\n return array_keys($this->vars);\n }",
"public function GetAllVars()\n\t{\n\t\treturn $this->vars;\n\t}",
"public function getVariables()\n\t{\n\t\treturn $this->aVariables;\n\t}",
"public function variables() {\n\t\treturn $this->variables;\n\t}",
"public function getVars() : array\n {\n return $this->items;\n }",
"public function getVariables(): array\n {\n if (!is_null($this->content)) {\n preg_match_all('/{\\$(.+?)}/i', $this->content, $matches);\n if (isset($matches[1])) {\n return collect($matches[1])\n ->map(function ($item) {\n if (strpos($item, \"|\")) {\n return substr($item, 0, strpos($item, \"|\"));\n } else {\n return $item;\n }\n })\n ->all();\n }\n }\n\n return [];\n }"
] | [
"0.674553",
"0.6514374",
"0.64160293",
"0.64137715",
"0.6409477",
"0.6297907",
"0.62731826",
"0.6102917",
"0.60552347",
"0.6039372",
"0.60193837",
"0.59985805",
"0.59716207",
"0.59577566",
"0.59446603",
"0.59370357",
"0.59310806",
"0.59193563",
"0.591626",
"0.58974046",
"0.58787733",
"0.5869501",
"0.5858041",
"0.58477676",
"0.5845204",
"0.57692295",
"0.5765965",
"0.5764377",
"0.57539165",
"0.5752331"
] | 0.7483144 | 0 |
Factory function for shortcode less manager. | function the7_get_new_shortcode_less_vars_manager() {
return new The7_Less_Vars_Shortcode_Manager( new Presscore_Lib_SimpleBag(), new The7_Less_Vars_Factory() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function get_less_vars() {\n\t\t\t$less_vars = the7_get_new_shortcode_less_vars_manager();\n\n\t\t\t$less_vars->add_keyword( 'unique-shortcode-class-name', 'gallery-shortcode.' . $this->get_unique_class(), '~\"%s\"' );\n\n\t\t\t$less_vars->add_pixel_number( 'media-image-border-radius', $this->get_att( 'image_border_radius' ) );\n\n\t\t\tswitch ( $this->get_att( 'image_hover_bg_color' ) ) {\n\t\t\t\tcase 'gradient_rollover_bg':\n\t\t\t\t\t$first_color = 'rgba(0,0,0,0.6)';\n\t\t\t\t\t$gradient = '';\n\t\t\t\t\tif ( function_exists( 'the7_less_prepare_gradient_var' ) ) {\n\t\t\t\t\t\tlist( $first_color, $gradient ) = the7_less_prepare_gradient_var( $this->get_att( 'custom_rollover_bg_gradient' ) );\n\t\t\t\t\t}\n\t\t\t\t\t$less_vars->add_rgba_color( 'portfolio-rollover-bg', $first_color );\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg-gradient', $gradient );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'solid_rollover_bg':\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg', $this->get_att( 'custom_rollover_bg_color', '~\"\"' ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'browser_width_based' === $this->get_att( 'responsiveness' ) ) {\n\t\t\t\t$columns_attributes = the7_shortcode_add_responsive_columns_data_attributes( array(), $this->get_att( 'bwb_columns' ) );\n\t\t\t\tforeach ( $columns_attributes as $column => $val ) {\n\t\t\t\t\t$less_vars->add_keyword( $column, $val );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$less_vars->add_pixel_number( 'grid-posts-gap', $this->get_att( 'gap_between_posts' ) );\n\t\t\t$less_vars->add_pixel_number( 'grid-post-min-width', $this->get_att( 'pwb_column_min_width' ) );\n\n\t\t\t$shadow_style = '';\n\t\t\tif ( 'shadow' === $this->atts['image_decoration'] ) {\n\t\t\t\t$shadow_style = join( ' ', array(\n\t\t\t\t\t\t$this->atts['shadow_h_length'],\n\t\t\t\t\t\t$this->atts['shadow_v_length'],\n\t\t\t\t\t\t$this->atts['shadow_blur_radius'],\n\t\t\t\t\t\t$this->atts['shadow_spread'],\n\t\t\t\t\t\t$this->atts['shadow_color'],\n\t\t\t\t\t) );\n\t\t\t}\n\t\t\t$less_vars->add_keyword( 'portfolio-img-shadow', $shadow_style );\n\t\t\t$less_vars->add_pixel_number( 'shortcode-filter-gap', $this->get_att( 'gap_below_category_filter', '' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-color', $this->get_att( 'navigation_font_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-accent', $this->get_att( 'navigation_accent_color', '~\"\"' ) );\n\n\t\t\t$gap_before_pagination = '';\n\t\t\tswitch ( $this->get_att( 'loading_mode' ) ) {\n\t\t\t\tcase 'js_pagination':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsp_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'js_more':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsm_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$less_vars->add_pixel_number( 'shortcode-pagination-gap', $gap_before_pagination );\n\n\t\t\t$less_vars->add_pixel_number( 'project-icon-size', $this->get_att( 'project_icon_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-bg-size', $this->get_att( 'project_icon_bg_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-width', $this->get_att( 'project_icon_border_width' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-radius', $this->get_att( 'project_icon_border_radius' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-color', $this->get_att( 'project_icon_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-border-color', $this->get_att( 'project_icon_border_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-bg-color', $this->get_att( 'project_icon_bg_color', '~\"\"' ) );\n\n\t\t\treturn $less_vars->get_vars();\n\t\t}",
"public function __construct() {\n\n\t\t\tif (!class_exists('WPLessPlugin')) {\n\n\t\t\t\t// Check set memory limit. If less than 128M, begin a safe memory limit raise for PHP, in order to assist LESS compiling procedure\n\t\t\t\t$this->set_memory_limit( '128M' ); // For premium performance\n\t\t\t\t$this->set_memory_limit( '96M' ); // For best performance\n\t\t\t\t$this->set_memory_limit( '80M' ); // Least demanded RAM to work 100%\n\t\t\t\t$this->set_memory_limit( '64M' ); // Again, if 80M not available try with 64, which is a risky setting\n\n\t\t\t\t// If xdebug is present, make sure nesting level is raised to 100\n\t\t\t\t@ini_set('xdebug.max_nesting_level', 500);\n\n\t\t\t\tdefine('WP_LESS_COMPILATION', 'deep');\n\n\t\t\t\trequire_once THEME_ASSETS_DIR .'/wp-less/lib/Plugin.class.php';\n\n\t\t\t\t// The file is empty...just used for core directory reference\n\t\t\t\t$WPLessPlugin = WPPluginToolkitPlugin::create('WPLess', THEME_ASSETS_DIR .'/wp-less/bootstrap-for-theme.php', 'WPLessPlugin');\n\t\t\n\t\t\t\tif ( method_exists('Plethora', 'option') ) {\n\n\t\t\t\t\t// General > Body & Headings\n\t\t\t\t\t$wp_body_bg \t\t\t= Plethora::option('body-backround', '#EFEFEF', 0, false);\n\t\t\t\t\t$option \t\t\t= Plethora::option('font-headers', array( 'font-family'=>'Raleway' ), 0, false);\n\t\t\t\t\t$wp_font_alternative \t\t\t= isset( $option['font-family'] ) ? $option['font-family'] : 'Raleway' ;\n\t\t\t\t\t$wp_font_alternative_transform\t= Plethora::option('font-headers-transform', 'uppercase', 0, false);\n\t\t\t\t\t$option \t\t\t= Plethora::option('font-body', array( 'font-family'=>'Open Sans' ), 0, false);\n\t\t\t\t\t$wp_font_sansserif \t\t\t= isset( $option['font-family'] ) ? $option['font-family'] : 'Open Sans' ;\n\t\t\t\t\t$wp_font_sansserif_size\t\t\t= Plethora::option('font-body-size', '14', 0, false);\n\t\t\t\t\t$wp_text_color \t\t\t\t= Plethora::option('body-text-color', '#666666', 0, false);\n\t\t\t\t\t$wp_link_color \t\t\t\t= Plethora::option('body-link-color', '#428BCA', 0, false);\n\t\t\t\t\t$wp_font_buttons_transform\t\t= Plethora::option('font-buttons-transform', 'uppercase', 0, false);\n\n\t\t\t\t\t// General > Skin Coloured Sections\n\t\t\t\t\t$wp_skin_color \t\t\t= Plethora::option('skin-color', '#428BCA', 0, false);\n\t\t\t\t\t$wp_skin_colored_section_text\t= Plethora::option('skin-text-color', '#ffffff', 0, false);\n\t\t\t\t\t$wp_skin_colored_section_link \t= Plethora::option('skin-link-color', '#FFFF00', 0, false);\n\t\t\t\t\t// General > Dark Coloured Sections\n\t\t\t\t\t$wp_dark_section_bgcolor\t\t= Plethora::option('darksection-bgcolor', '#222222', 0, false);\n\t\t\t\t\t$wp_dark_section_text\t\t\t= Plethora::option('darksection-text-color', '#cccccc', 0, false);\n\t\t\t\t\t$wp_dark_section_link\t\t\t= Plethora::option('darksection-link-color', '#428BCA', 0, false);\n\t\t\t\t\t// Header > Colors & Typography\n\t\t\t\t\t$wp_header_bgcolor\t\t\t\t= Plethora::option('header-background', '#EFEFEF', 0, false);\n\t\t\t\t\t$wp_sticky_header_transparency\t= Plethora::option('header-background-transparency', 100, 0, false);\n\t\t\t\t\t$option \t\t\t\t\t\t= Plethora::option( 'header-link-color', array('regular' => '#555555', 'hover' => '#428BCA' ), 0, false);\n\t\t\t\t\t$wp_header_link_color \t\t\t= isset( $option['regular'] ) ? $option['regular'] : '#555555';\n\t\t\t\t\t$wp_header_link_hover_color \t= isset( $option['hover'] ) ? $option['hover'] : '#428BCA';\n\t\t\t\t\t// Header > Top Toolbar\n\t\t\t\t\t$wp_topbar_bgcolor \t\t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-toolbar-bgcolor', '#EFEFEF', 0, false);\n\t\t\t\t\t$wp_topbar_text_color \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-toolbar-text-color', '#555555', 0, false);\n\t\t\t\t\t$wp_topbar_link_color\t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-toolbar-link-color', '#555555', 0, false);\n\t\t\t\t\t// Footer > Main Section\n\t\t\t\t\t$wp_footer_bgcolor\t\t\t\t= Plethora::option( PLETHORA_META_PREFIX .'footer-bgcolor', '#222222', 0, false);\n\t\t\t\t\t$wp_footer_text_color \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'footer-text-color', '#cccccc', 0, false);\n\t\t\t\t\t$wp_footer_link_color \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'footer-link-color', '#428BCA', 0, false);\n\t\t\t\t\t// Head Panel > General\n\t\t\t\t\t$option \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-slider-dimensions', array('height' => '580px', 'units' => 'px' ), 0, false);\n\t\t\t\t\t$wp_slider_height \t\t\t= isset( $option['height'] ) ? $option['height'] : '580px' ;\n\t\t\t\t\t// General > Miscellaneous\n\t\t\t\t\t$text_shadows \t\t\t= Plethora::option( 'text-shadows', 0, 0, false);\n\n\t\t\t\t} else { \n\n\t\t\t\t\t$wp_body_bg \t\t\t= '#EFEFEF';\n\t\t\t\t\t$wp_font_alternative \t\t\t= 'Raleway';\n\t\t\t\t\t$wp_font_alternative_transform\t= 'uppercase';\n\t\t\t\t\t$wp_font_sansserif \t\t\t= 'Open Sans';\n\t\t\t\t\t$wp_font_sansserif_size\t\t\t= '14px';\n\t\t\t\t\t$wp_text_color \t\t\t\t\t= '#666666';\n\t\t\t\t\t$wp_link_color \t\t\t\t\t= '#428BCA';\n\t\t\t\t\t$wp_skin_color \t\t\t= '#428BCA';\n\t\t\t\t\t$wp_font_buttons_transform\t\t= 'uppercase';\n\t\t\t\t\t$wp_skin_colored_section_text \t= '#ffffff';\n\t\t\t\t\t$wp_skin_colored_section_link \t= '#FFFF00';\n\t\t\t\t\t$wp_dark_section_bgcolor\t\t= '#222222';\n\t\t\t\t\t$wp_dark_section_text\t\t\t= '#cccccc';\n\t\t\t\t\t$wp_dark_section_link\t\t\t= '#428BCA';\n\t\t\t\t\t$wp_header_bgcolor\t\t\t\t= '#EFEFEF';\n\t\t\t\t\t$wp_sticky_header_transparency\t= 100;\n\t\t\t\t\t$wp_header_link_color \t\t\t= '#555555';\n\t\t\t\t\t$wp_header_link_hover_color \t= '#428BCA';\n\t\t\t\t\t$wp_topbar_bgcolor \t\t\t\t= '#EFEFEF';\n\t\t\t\t\t$wp_topbar_text_color \t\t\t= '#555555';\n\t\t\t\t\t$wp_topbar_link_color\t\t\t= '#555555';\n\t\t\t\t\t$wp_footer_bgcolor\t\t\t\t= '#222222';\n\t\t\t\t\t$wp_footer_text_color \t\t\t= '#cccccc';\n\t\t\t\t\t$wp_footer_link_color \t\t\t= '#428BCA';\n\t\t\t\t\t$wp_slider_height \t\t\t= '580px';\n\t\t\t\t\t$text_shadows \t\t \t\t\t= 0;\n\n\t\t\t\t}\n\n\t\t\t\t// die(gettype($text_shadows)); // 0 string\n\n\t\t\t\t$text_shadows = ( $text_shadows == 0 ) ? \"none\" : \"0 1px 2px rgba(0, 0, 0, 0.6)\";\n\n\t\t\t $WPLessPlugin->setVariables(array(\n\t\t\t\t\t'wp-body-bg' \t=> $wp_body_bg, \t\t\t\t\t// '#EFEFEF',\n\t\t\t\t\t'wp-font-family-alternative' \t=> '\"'. $wp_font_alternative .'\"', // 'Raleway'\n\t\t\t\t\t'wp-font-family-sans-serif' \t=> '\"'. $wp_font_sansserif .'\"', \t// 'Open Sans'\n\t\t\t\t\t'wp-text-color'\t\t\t\t\t=> $wp_text_color,\n\t\t\t\t\t'wp-link-color'\t\t\t\t\t=> $wp_link_color,\n\t\t\t\t\t'wp-skin-color' \t=> $wp_skin_color, \t\t\t\t// '#A59C78',\n\t\t\t\t\t'wp-skin-colored-section-text'\t=> $wp_skin_colored_section_text,\n\t\t\t\t\t'wp-skin-colored-section-link'\t=> $wp_skin_colored_section_link,\n\t\t\t\t\t'wp-dark-section-bgcolor'\t\t=> $wp_dark_section_bgcolor,\n\t\t\t\t\t'wp-dark-section-text'\t\t\t=> $wp_dark_section_text,\n\t\t\t\t\t'wp-dark-section-link'\t\t\t=> $wp_dark_section_link,\n\t\t\t\t\t'wp-header-bgcolor'\t\t\t\t=> $wp_header_bgcolor,\n\t\t\t\t\t'wp-sticky-header-transparency'\t=> $wp_sticky_header_transparency,\n\t\t\t\t\t'wp-header-link-color'\t\t\t=> $wp_header_link_color,\n\t\t\t\t\t'wp-header-link-hover-color'\t=> $wp_header_link_hover_color,\n\t\t\t\t\t'wp-topbar-bgcolor'\t\t\t\t=> $wp_topbar_bgcolor,\n\t\t\t\t\t'wp-topbar-text-color'\t\t\t=> $wp_topbar_text_color,\n\t\t\t\t\t'wp-topbar-link-color'\t\t\t=> $wp_topbar_link_color,\n\t\t\t\t\t'wp-footer-bgcolor'\t\t\t\t=> $wp_footer_bgcolor,\n\t\t\t\t\t'wp-footer-text-color'\t\t\t=> $wp_footer_text_color,\n\t\t\t\t\t'wp-footer-link-color'\t\t\t=> $wp_footer_link_color,\n\t\t\t\t\t'wp-slider-height' \t=> $wp_slider_height, \t\t\t\t// '580px'\n\t\t\t\t\t'wp-text-shadows' \t\t\t\t=> $text_shadows,\t\t\t\t\n\t\t\t\t\t'wp-font-size-base'\t\t\t\t=> $wp_font_sansserif_size . 'px',\t// Don't forget the px!!!\t\t\t\n\t\t\t\t\t'wp-cs-headings-text-transform'\t=> $wp_font_alternative_transform,\t\t\t\t\n\t\t\t\t\t'wp-btn-text-transform'\t\t\t=> $wp_font_buttons_transform,\t\t\t\t\n\t\t\t ));\n\n\t\t\t\tadd_action('init', array($this, 'enqueue_less'), 1);\n\n\t\t\t\t// READY and WORKING\n\t\t\t\tadd_action('after_setup_theme', array($WPLessPlugin, 'install'));\n\n\t\t\t\t// NOT WORKING\n\t\t\t\t//@see http://core.trac.wordpress.org/ticket/14955\n\t\t\t\tadd_action('uninstall_theme', array($WPLessPlugin, 'uninstall'));\n\n\t\t\t\t$WPLessPlugin->dispatch();\n\t\t\t}\n\n\t\t}",
"public function __construct () {\n $this->manager = new Manager\\ShortcodeManager;\n //Create your shortcode\n $this->list = new Library\\SimpleShortcode(\n 'gallery', \n null, \n function ($content=null, array $attr=[]){\n global $settings;\n if (!$attr) return '';\n $id = $attr['id'];\n $items = (new Gallery)->get($id)['items'];\n \n ob_start();\n $themeSpecific = WEB.DS.'themes'.DS.$settings['theme'].DS.'shortcode'.DS.'Gallery.php';\n if (file_exists($themeSpecific)) {\n require_once $themeSpecific;\n } else {\n require_once(WEB.DS.'shortcode'.DS.'Gallery.php');\n }\n $buffer = ob_get_contents();\n ob_clean();\n return $buffer;\n });\n\n }",
"function custom_less() {\n\t\t$file = sprintf( '%sstyle.less', plugin_dir_path( __FILE__ ) );\n\t\tpagelines_insert_core_less( $file );\n\t}",
"function less() {\n return call(kirby::instance()->option('less.handler'), func_get_args());\n}",
"public function __less()\n {\n s()->async(true);\n\n $less = '';\n\n $path = implode('/', url()->parameters);\n $name = implode('_', url()->parameters);\n\n // Find path to view\n $_path = m('local')->findView($path);\n\n $this->createDir('css');\n\n // Generate pass to less file\n $lessPath = 'css/'.$name.'.less';\n\n // If we have found view file\n if (file_exists($_path)) {\n\n // If we have not generated this file before\n if (!file_exists($lessPath)) {\n\n // Set ignored DOM nodes\n \\samsonos\\php\\skeleton\\Tree::$ignoredNodes = $this->lessIgnore;\n\n // Build LESS node tree\n $lessTree = new \\samsonos\\php\\skeleton\\Tree($_path);\n\n // Write generated file\n file_put_contents($lessPath, $lessTree->toLESS());\n\n elapsed('Creating LESS file: '.$lessPath);\n\n } else {\n e('LESS file alerady exists(##) - remove it', E_SAMSON_CORE_ERROR, $lessPath);\n }\n\n } else {\n e('View file not found(##)', E_SAMSON_CORE_ERROR, $path);\n }\n }",
"static public function factory()\n\t{\n\t\t$lessc \t = new \\lessc;\n\t\t$scssc = new \\scssc;\n\t\t$storage = new Storage\\Local();\n\t\t$packages = new PackagesProvider();\n\t\t$frod = new self($storage, $packages, $lessc, $scssc);\n\t\treturn $frod;\n\t}",
"public function init ( ) {\n define('WPLESS_EDIT_FILE', ASSETS_PATH . '/less/custom.less');\n define('WPLESS_MASTER_FILE', ASSETS_PATH . '/less/lift.less');\n define('WPLESS_TARGET_FILE', ASSETS_PATH . '/css/lift.css');\n\n $this->register_options_panel();\n $this->register_fields();\n }",
"function initShortCode()\n {\n }",
"function shortcode_template( $atts, $description = null ) {\r\n\t\t\tglobal $MPC_Icon, $MPC_Divider, $mpc_circle_icons_wrap, $mpc_ma_options;\r\n\t\t\tif ( ! defined( 'MPC_MASSIVE_FULL' ) || ( defined( 'MPC_MASSIVE_FULL' ) && $mpc_ma_options[ 'single_js_css' ] !== '1' ) ) {\r\n\t\t\t\t$this->enqueue_shortcode_scripts();\r\n\t\t\t}\r\n\r\n\t\t\t$atts = shortcode_atts( array(\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'preset' => '',\r\n\t\t\t\t'layout' => 'style_1',\r\n\r\n\t\t\t\t'alignment' => 'center',\r\n\t\t\t\t'url' => '',\r\n\r\n\t\t\t\t'title_font_preset' => '',\r\n\t\t\t\t'title_font_color' => '',\r\n\t\t\t\t'title_font_size' => '',\r\n\t\t\t\t'title_font_line_height' => '',\r\n\t\t\t\t'title_font_line_height' => '',\r\n\t\t\t\t'title_font_align' => '',\r\n\t\t\t\t'title_font_transform' => '',\r\n\t\t\t\t'title' => '',\r\n\t\t\t\t'title_margin_css' => '',\r\n\r\n\t\t\t\t'content_font_preset' => '',\r\n\t\t\t\t'content_font_color' => '',\r\n\t\t\t\t'content_font_size' => '',\r\n\t\t\t\t'content_font_line_height' => '',\r\n\t\t\t\t'content_font_align' => '',\r\n\t\t\t\t'content_font_transform' => '',\r\n\t\t\t\t'content_margin_css' => '',\r\n\r\n\t\t\t\t'background_type' => 'color',\r\n\t\t\t\t'background_color' => '',\r\n\t\t\t\t'background_image' => '',\r\n\t\t\t\t'background_image_size' => 'large',\r\n\t\t\t\t'background_repeat' => 'no-repeat',\r\n\t\t\t\t'background_size' => 'initial',\r\n\t\t\t\t'background_position' => 'middle-center',\r\n\t\t\t\t'background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'padding_css' => '',\r\n\t\t\t\t'margin_css' => '',\r\n\t\t\t\t'border_css' => '',\r\n\r\n\t\t\t\t'animation_in_type' => 'none',\r\n\t\t\t\t'animation_in_duration' => '300',\r\n\t\t\t\t'animation_in_delay' => '0',\r\n\t\t\t\t'animation_in_offset' => '100',\r\n\r\n\t\t\t\t'animation_loop_type' => 'none',\r\n\t\t\t\t'animation_loop_duration' => '1000',\r\n\t\t\t\t'animation_loop_delay' => '1000',\r\n\t\t\t\t'animation_loop_hover' => '',\r\n\r\n\t\t\t\t'hover_background_type' => 'color',\r\n\t\t\t\t'hover_background_color' => '',\r\n\t\t\t\t'hover_background_image' => '',\r\n\t\t\t\t'hover_background_image_size' => 'large',\r\n\t\t\t\t'hover_background_repeat' => 'no-repeat',\r\n\t\t\t\t'hover_background_size' => 'initial',\r\n\t\t\t\t'hover_background_position' => 'middle-center',\r\n\t\t\t\t'hover_background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'hover_border_css' => '',\r\n\r\n\t\t\t\t'hover_title_color' => '',\r\n\t\t\t\t'hover_content_color' => '',\r\n\r\n\t\t\t\t/* Icon */\r\n\t\t\t\t'mpc_icon__disable' => '',\r\n\t\t\t\t'mpc_icon__preset' => 'default',\r\n\t\t\t\t'mpc_icon__url' => '',\r\n\t\t\t\t'mpc_icon__transition' => 'none',\r\n\r\n\t\t\t\t'mpc_icon__padding_css' => '',\r\n\t\t\t\t'mpc_icon__margin_css' => '',\r\n\r\n\t\t\t\t'mpc_icon__border_css' => '',\r\n\r\n\t\t\t\t'mpc_icon__icon_type' => 'icon',\r\n\t\t\t\t'mpc_icon__icon' => '',\r\n\t\t\t\t'mpc_icon__icon_character' => '',\r\n\t\t\t\t'mpc_icon__icon_image' => '',\r\n\t\t\t\t'mpc_icon__icon_image_size' => 'thumbnail',\r\n\t\t\t\t'mpc_icon__icon_preset' => '',\r\n\t\t\t\t'mpc_icon__icon_size' => '',\r\n\t\t\t\t'mpc_icon__icon_color' => '',\r\n\r\n\t\t\t\t'mpc_icon__background_type' => 'color',\r\n\t\t\t\t'mpc_icon__background_color' => '',\r\n\t\t\t\t'mpc_icon__background_image' => '',\r\n\t\t\t\t'mpc_icon__background_image_size' => 'large',\r\n\t\t\t\t'mpc_icon__background_repeat' => 'no-repeat',\r\n\t\t\t\t'mpc_icon__background_size' => 'initial',\r\n\t\t\t\t'mpc_icon__background_position' => 'middle-center',\r\n\t\t\t\t'mpc_icon__background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'mpc_icon__hover_border_css' => '',\r\n\r\n\t\t\t\t'mpc_icon__hover_icon_type' => 'icon',\r\n\t\t\t\t'mpc_icon__hover_icon' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_character' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_image' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_image_size' => 'thumbnail',\r\n\t\t\t\t'mpc_icon__hover_icon_preset' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_color' => '',\r\n\r\n\t\t\t\t'mpc_icon__hover_background_type' => 'color',\r\n\t\t\t\t'mpc_icon__hover_background_color' => '',\r\n\t\t\t\t'mpc_icon__hover_background_image' => '',\r\n\t\t\t\t'mpc_icon__hover_background_image_size' => 'large',\r\n\t\t\t\t'mpc_icon__hover_background_repeat' => 'no-repeat',\r\n\t\t\t\t'mpc_icon__hover_background_size' => 'initial',\r\n\t\t\t\t'mpc_icon__hover_background_position' => 'middle-center',\r\n\t\t\t\t'mpc_icon__hover_background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'mpc_icon__animation_loop_type' => 'none',\r\n\t\t\t\t'mpc_icon__animation_loop_duration' => '1000',\r\n\t\t\t\t'mpc_icon__animation_loop_delay' => '1000',\r\n\t\t\t\t'mpc_icon__animation_loop_hover' => '',\r\n\r\n\t\t\t\t/* Divider */\r\n\t\t\t\t'mpc_divider__disable' => '',\r\n\t\t\t\t'mpc_divider__align' => 'center',\r\n\t\t\t\t'mpc_divider__width' => '100',\r\n\r\n\t\t\t\t'mpc_divider__content_type' => 'none',\r\n\t\t\t\t'mpc_divider__content_position' => '50',\r\n\r\n\t\t\t\t'mpc_divider__lines_number' => '1',\r\n\t\t\t\t'mpc_divider__lines_style' => 'solid',\r\n\t\t\t\t'mpc_divider__lines_color' => '',\r\n\t\t\t\t'mpc_divider__lines_gap' => '1',\r\n\t\t\t\t'mpc_divider__lines_weight' => '1',\r\n\r\n\t\t\t\t'mpc_divider__title' => '',\r\n\t\t\t\t'mpc_divider__font_preset' => '',\r\n\t\t\t\t'mpc_divider__font_color' => '#333333',\r\n\t\t\t\t'mpc_divider__font_size' => '18',\r\n\t\t\t\t'mpc_divider__font_line_height' => '',\r\n\t\t\t\t'mpc_divider__font_align' => '',\r\n\t\t\t\t'mpc_divider__font_transform' => '',\r\n\r\n\t\t\t\t'mpc_divider__icon_type' => 'icon',\r\n\t\t\t\t'mpc_divider__icon' => '',\r\n\t\t\t\t'mpc_divider__icon_character' => '',\r\n\t\t\t\t'mpc_divider__icon_image' => '',\r\n\t\t\t\t'mpc_divider__icon_image_size' => 'thumbnail',\r\n\t\t\t\t'mpc_divider__icon_preset' => '',\r\n\t\t\t\t'mpc_divider__icon_size' => '',\r\n\t\t\t\t'mpc_divider__icon_color' => '#333333',\r\n\r\n\t\t\t\t'mpc_divider__padding_css' => '',\r\n\t\t\t\t'mpc_divider__margin_css' => '',\r\n\t\t\t), $atts );\r\n\r\n\t\t\tif ( $mpc_circle_icons_wrap ) {\r\n\t\t\t\t$atts[ 'layout' ] = 'style_1';\r\n\t\t\t}\r\n\r\n\t\t\t/* Prepare */\r\n\t\t\t$url_settings = MPC_Parser::url( $atts[ 'url' ] );\r\n\t\t\t$wrapper = $url_settings != '' ? 'a' : 'div';\r\n\r\n\t\t\t$animation = MPC_Parser::animation( $atts );\r\n\t\t\t$atts_icon = MPC_Parser::shortcode( $atts, 'mpc_icon_' );\r\n\t\t\t$atts_divider = MPC_Parser::shortcode( $atts, 'mpc_divider_' );\r\n\r\n\t\t\t$styles = $this->shortcode_styles( $atts );\r\n\t\t\t$css_id = $styles[ 'id' ];\r\n\r\n\t\t\t/* Shortcode classes | Animation | Layout */\r\n\t\t\t$classes = ' mpc-init mpc-parent-hover mpc-transition';\r\n\t\t\t$classes .= $animation != '' ? ' mpc-animation' : '';\r\n\t\t\t$classes .= $atts[ 'layout' ] != '' ? ' mpc-icon-column--' . esc_attr( $atts[ 'layout' ] ) : '';\r\n\t\t\t$classes .= $atts[ 'alignment' ] != '' ? ' mpc-align--' . esc_attr( $atts[ 'alignment' ] ) : ' mpc-align--center';\r\n\t\t\t$classes .= ' ' . esc_attr( $atts[ 'class' ] );\r\n\t\t\t$classes_title = $atts[ 'title_font_preset' ] != '' ? ' mpc-typography--' . esc_attr( $atts[ 'title_font_preset' ] ) : '';\r\n\t\t\t$classes_title .= ' mpc-transition';\r\n\t\t\t$classes_content = $atts[ 'content_font_preset' ] != '' ? ' mpc-typography--' . esc_attr( $atts[ 'content_font_preset' ] ) : '';\r\n\t\t\t$classes_content .= ' mpc-transition';\r\n\r\n\t\t\t/* Layout parts */\r\n\t\t\t$this->parts[ 'section_begin' ] = '<div class=\"mpc-icon-column__content-wrap\"><div class=\"mpc-icon-column__content\">';\r\n\t\t\t$this->parts[ 'section_end' ] = '</div></div>';\r\n\t\t\t$this->parts[ 'icon' ] = $atts[ 'mpc_icon__disable' ] == '' ? $MPC_Icon->shortcode_template( $atts_icon ) : '';\r\n\t\t\t$this->parts[ 'title' ] = $atts[ 'title' ] != '' ? '<h3 class=\"mpc-icon-column__heading' . $classes_title . '\">' . $atts[ 'title' ] . '</h3>' : '';\r\n\t\t\t$this->parts[ 'divider' ] = $atts[ 'mpc_divider__disable' ] == '' ? $MPC_Divider->shortcode_template( $atts_divider ) : '';\r\n\t\t\t$this->parts[ 'description' ] = $description != '' ? '<div class=\"mpc-icon-column__description' . $classes_content . '\">' . wpb_js_remove_wpautop( $description, true ) . '</div>' : '';\r\n\r\n\t\t\t/* Shortcode Output */\r\n\t\t\t$return = '<' . $wrapper . $url_settings . ' data-id=\"' . $css_id . '\" class=\"mpc-icon-column' . $classes . '\" ' . $animation . '>';\r\n\t\t\t\t$return .= $this->shortcode_layout( $atts[ 'layout' ], $this->parts );\r\n\t\t\t$return .= '</' . $wrapper . '>';\r\n\r\n\t\t\tglobal $mpc_frontend;\r\n\t\t\tif ( $mpc_frontend ) {\r\n\t\t\t\t$return .= '<style>' . $styles[ 'css' ] . '</style>';\r\n\t\t\t}\r\n\r\n\t\t\treturn $return;\r\n\t\t}",
"function enableShortcodes()\n {\n $this->processShortcodes = true;\n\n return $this;\n }",
"function shortcode_template( $atts, $description = null ) {\r\n\t\t\tglobal $MPC_Icon, $MPC_Shortcode, $mpc_ma_options;\r\n\t\t\tif ( ! defined( 'MPC_MASSIVE_FULL' ) || ( defined( 'MPC_MASSIVE_FULL' ) && $mpc_ma_options[ 'single_js_css' ] !== '1' ) ) {\r\n\t\t\t\t$this->enqueue_shortcode_scripts();\r\n\t\t\t}\r\n\r\n\t\t\t$atts = shortcode_atts( array(\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'preset' => '',\r\n\t\t\t\t'content_preset' => '',\r\n\t\t\t\t'auto_close' => 'false',\r\n\t\t\t\t'auto_indent' => 'true',\r\n\t\t\t\t'opened' => 1,\r\n\r\n\t\t\t\t'border_css' => '',\r\n\t\t\t\t'margin_css' => '',\r\n\r\n\t\t\t\t'hover_color' => '',\r\n\t\t\t\t'hover_border' => '',\r\n\r\n\t\t\t\t'animation_in_type' => 'none',\r\n\t\t\t\t'animation_in_duration' => '300',\r\n\t\t\t\t'animation_in_delay' => '0',\r\n\t\t\t\t'animation_in_offset' => '100',\r\n\r\n\t\t\t\t/* Content */\r\n\t\t\t\t'content_font_preset' => '',\r\n\t\t\t\t'content_font_color' => '',\r\n\t\t\t\t'content_font_size' => '',\r\n\t\t\t\t'content_font_line_height' => '',\r\n\t\t\t\t'content_font_align' => '',\r\n\t\t\t\t'content_font_transform' => '',\r\n\r\n\t\t\t\t'content_background_type' => 'color',\r\n\t\t\t\t'content_background_color' => '',\r\n\t\t\t\t'content_background_image' => '',\r\n\t\t\t\t'content_background_image_size' => 'large',\r\n\t\t\t\t'content_background_repeat' => 'no-repeat',\r\n\t\t\t\t'content_background_size' => 'initial',\r\n\t\t\t\t'content_background_position' => 'middle-center',\r\n\t\t\t\t'content_background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'content_margin_css' => '',\r\n\t\t\t\t'content_border_css' => '',\r\n\t\t\t\t'content_padding_css' => '',\r\n\r\n\t\t\t\t'hover_content_border' => '',\r\n\r\n\t\t\t\t/* Title */\r\n\t\t\t\t'title_font_preset' => '',\r\n\t\t\t\t'title_font_color' => '',\r\n\t\t\t\t'title_font_size' => '',\r\n\t\t\t\t'title_font_line_height' => '',\r\n\t\t\t\t'title_font_align' => '',\r\n\t\t\t\t'title_font_transform' => '',\r\n\r\n\t\t\t\t'title_background_type' => 'color',\r\n\t\t\t\t'title_background_color' => '',\r\n\t\t\t\t'title_background_image' => '',\r\n\t\t\t\t'title_background_image_size' => 'large',\r\n\t\t\t\t'title_background_repeat' => 'no-repeat',\r\n\t\t\t\t'title_background_size' => 'initial',\r\n\t\t\t\t'title_background_position' => 'middle-center',\r\n\t\t\t\t'title_background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'hover_title_background_type' => 'color',\r\n\t\t\t\t'hover_title_background_color' => '',\r\n\t\t\t\t'hover_title_background_image' => '',\r\n\t\t\t\t'hover_title_background_image_size' => 'large',\r\n\t\t\t\t'hover_title_background_repeat' => 'no-repeat',\r\n\t\t\t\t'hover_title_background_size' => 'initial',\r\n\t\t\t\t'hover_title_background_position' => 'middle-center',\r\n\t\t\t\t'hover_title_background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'hover_title_color' => '',\r\n\t\t\t\t'hover_title_border' => '',\r\n\r\n\t\t\t\t'title_border_css' => '',\r\n\t\t\t\t'title_padding_css' => '',\r\n\t\t\t\t'title_margin_css' => '',\r\n\r\n\t\t\t\t/* Icon */\r\n\t\t\t\t'mpc_icon__transition' => 'none',\r\n\r\n\t\t\t\t'mpc_icon__border_css' => '',\r\n\t\t\t\t'mpc_icon__padding_css' => '',\r\n\t\t\t\t'mpc_icon__hover_border_css' => '',\r\n\r\n\t\t\t\t'mpc_icon__icon_type' => 'icon',\r\n\t\t\t\t'mpc_icon__icon' => '',\r\n\t\t\t\t'mpc_icon__icon_character' => '',\r\n\t\t\t\t'mpc_icon__icon_image' => '',\r\n\t\t\t\t'mpc_icon__icon_image_size' => 'thumbnail',\r\n\t\t\t\t'mpc_icon__icon_preset' => '',\r\n\t\t\t\t'mpc_icon__icon_size' => '',\r\n\t\t\t\t'mpc_icon__icon_color' => '',\r\n\r\n\t\t\t\t'mpc_icon__title_background_type' => 'color',\r\n\t\t\t\t'mpc_icon__title_background_color' => '',\r\n\t\t\t\t'mpc_icon__title_background_image' => '',\r\n\t\t\t\t'mpc_icon__title_background_image_size' => 'large',\r\n\t\t\t\t'mpc_icon__title_background_repeat' => 'no-repeat',\r\n\t\t\t\t'mpc_icon__title_background_size' => 'initial',\r\n\t\t\t\t'mpc_icon__title_background_position' => 'middle-center',\r\n\t\t\t\t'mpc_icon__title_background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\r\n\t\t\t\t'mpc_icon__hover_icon_type' => 'icon',\r\n\t\t\t\t'mpc_icon__hover_icon' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_character' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_image' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_image_size' => 'thumbnail',\r\n\t\t\t\t'mpc_icon__hover_icon_preset' => '',\r\n\t\t\t\t'mpc_icon__hover_icon_color' => '',\r\n\r\n\t\t\t\t'mpc_icon__hover_title_background_type' => 'color',\r\n\t\t\t\t'mpc_icon__hover_title_background_color' => '',\r\n\t\t\t\t'mpc_icon__hover_title_background_image' => '',\r\n\t\t\t\t'mpc_icon__hover_title_background_image_size' => 'large',\r\n\t\t\t\t'mpc_icon__hover_title_background_repeat' => 'no-repeat',\r\n\t\t\t\t'mpc_icon__hover_title_background_size' => 'initial',\r\n\t\t\t\t'mpc_icon__hover_title_background_position' => 'middle-center',\r\n\t\t\t\t'mpc_icon__hover_title_background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\t\t\t), $atts );\r\n\r\n\t\t\t/* Prepare */\r\n\t\t\t$animation = MPC_Parser::animation( $atts );\r\n\t\t\t$icon_atts = MPC_Parser::shortcode( $atts, 'mpc_icon_' );\r\n\r\n\t\t\t$icon = $MPC_Icon->shortcode_template( $icon_atts );\r\n\r\n\t\t\t$styles = $this->shortcode_styles( $atts );\r\n\t\t\t$css_id = $styles[ 'id' ];\r\n\r\n\t\t\t/* Shortcode classes | Animation | Layout */\r\n\t\t\t$classes = ' mpc-init mpc-transition';\r\n\t\t\t$classes .= $animation != '' ? ' mpc-animation' : '';\r\n\t\t\t$classes .= $atts[ 'auto_close' ] == 'true' ? ' mpc-accordion--toggle' : '';\r\n\t\t\t$classes .= $atts[ 'auto_indent' ] == 'true' ? ' mpc-accordion--indent' : '';\r\n\t\t\t$classes .= $atts[ 'auto_indent' ] == 'true' ? ' mpc-accordion--indent' : '';\r\n\t\t\t$classes .= ' ' . esc_attr( $atts[ 'class' ] );\r\n\r\n\t\t\t/* Setup globals */\r\n\t\t\t$MPC_Shortcode[ 'accordion' ] = array(\r\n\t\t\t\t'opened' => $atts[ 'opened' ],\r\n\t\t\t\t'indent' => $atts[ 'auto_indent' ],\r\n\t\t\t\t'current' => 1,\r\n\t\t\t\t'icon' => $icon,\r\n\t\t\t\t'presets' => array(\r\n\t\t\t\t\t'title' => $atts[ 'title_font_preset' ],\r\n\t\t\t\t\t'content' => $atts[ 'content_font_preset' ],\r\n\t\t\t\t),\r\n\t\t\t);\r\n\r\n\t\t\t/* Shortcode Output */\r\n\t\t\t$return = '<div id=\"' . $css_id . '\" class=\"mpc-accordion' . esc_attr( $classes ) . '\" ' . $animation . '>';\r\n\t\t\t\t$return .= '<ul class=\"mpc-accordion__content\">' . do_shortcode( $description ) . '</ul>';\r\n\t\t\t$return .= '</div>';\r\n\r\n\t\t\tglobal $mpc_frontend;\r\n\t\t\tif ( $mpc_frontend ) {\r\n\t\t\t\t$return .= '<style>' . $styles[ 'css' ] . '</style>';\r\n\t\t\t}\r\n\r\n\t\t\tglobal $mpc_frontend;\r\n\t\t\tif ( $mpc_frontend ) {\r\n\t\t\t\t$return = '<div class=\"mpc-frontend-notice\">';\r\n\t\t\t\t\t$return .= '<h4>' . __( 'Accordion', 'mpc' ) . '</h4>';\r\n\t\t\t\t\t$return .= __( 'Unfortunately this shortcode isn\\'t available in <em>Frontend Editor</em> at the moment. This feature will be added in the upcoming updates. We are sorry for any inconvenience :)', 'mpc' );\r\n\t\t\t\t$return .= '</div>';\r\n\t\t\t}\r\n\r\n\t\t\treturn $return;\r\n\t\t}",
"function nerdpress_compiler() {\n\t$minify_css = NerdPress::variable( 'minify_css' );\n\t$options = ( $minify_css == 1 ) ? array( 'compress'=>true ) : array( 'compress'=>false );\n\t\n\t$bootstrap_location = get_template_directory() . '/assets/less/';\n\t$webfont_location = get_template_directory() . '/assets/fonts/';\n\t$bootstrap_uri = '';\n\t$custom_less_file = get_template_directory() . '/assets/less/custom.less';\n\t\n\t$parser = new Less_Parser( $options );\n\t\n\t// The main app.less file\n\t$parser->parseFile( $bootstrap_location . 'app.less', $bootstrap_uri );\n\t\n\t// The custom.less file\n\tif ( is_writable( $custom_less_file ) )\n\t$parser->parseFile( $bootstrap_location . 'custom.less', $bootstrap_uri );\n\t\n\t// Add a filter to the compiler\n\t$parser->parse( apply_filters( 'nerdpress_compiler', '' ) );\n\t\n\t$css = $parser->getCss();\n\t\n\t// Below is just an ugly hack\n\t$css = str_replace( 'bootstrap/fonts/', '', $css );\n\treturn apply_filters( 'nerdpress_compiler_output', $css );\n}",
"function __construct()\n {\n add_shortcode('wedevs-academy', [$this, 'render_shortcode']);\n }",
"public function __construct()\n\t{\n\t\tadd_shortcode( 'castles', array(&$this, 'getHTML') );\n\t}",
"private function add_shortcodes()\n {\n }",
"protected function register_shortcodes() {}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->configure(array\n\t\t(\n\t\t\t'lessc' => TL_ROOT . '/system/modules/lesscss/bin/lessc',\n\t\t\t'compress' => true\n\t\t));\n\t\t$this->import('CssUrlRemapper');\n\t}",
"function shoestrap_compiler() {\n $minimize_css = shoestrap_getVariable( 'minimize_css', true );\n $options = ( $minimize_css == 1 ) ? array( 'compress'=>true ) : array( 'compress'=>false );\n\n $bootstrap_location = get_template_directory() . '/assets/less/';\n $webfont_location = get_template_directory() . '/assets/fonts/';\n $bootstrap_uri = '';\n $custom_less_file = get_template_directory() . '/assets/less/custom.less';\n\n $css = '';\n try {\n\n $parser = new Less_Parser( $options );\n\n // The main app.less file\n $parser->parseFile( $bootstrap_location . 'app.less', $bootstrap_uri );\n // Our custom variables\n $parser->parse( shoestrap_variables() );\n\n // Include the Elusive Icons\n $parser->parseFile( $webfont_location . 'elusive-webfont.less', $bootstrap_uri );\n\n // Enable gradients\n if ( shoestrap_getVariable( 'gradients_toggle' ) == 1 )\n $parser->parseFile( $bootstrap_location . 'gradients.less', $bootstrap_uri );\n\n // The custom.less file\n if ( is_writable( $custom_less_file ) )\n $parser->parseFile( $bootstrap_location . 'custom.less', $bootstrap_uri );\n\n // Parse any custom less added by the user\n $parser->parse( shoestrap_getVariable( 'user_less' ) );\n // Add a filter to the compiler\n $parser->parse( apply_filters( 'shoestrap_compiler', '' ) );\n\n $css = $parser->getCss();\n\n } catch( Exception $e ) {\n $error_message = $e->getMessage();\n }\n\n // Below is just an ugly hack\n $css = str_replace( 'bootstrap/fonts/', '', $css );\n $css = str_replace( get_template_directory_uri() . '/assets/', '../', $css );\n return apply_filters( 'shoestrap_compiler_output', $css );\n}",
"protected function get_less_file_name() {\n\t\t\treturn get_template_directory() . '/css/dynamic-less/shortcodes/gallery.less';\n\t\t}",
"public function __construct() {\n\n global $canvys;\n\n $this->config = array(\n\n // Handle will be used to use this shortcode\n 'handle' => 'cv_fullwidth_image',\n\n // Whether or not this is a shortcode composer element\n 'composer_element' => false,\n\n // Whether or not this is a template builder element\n 'builder_element' => true,\n\n // Used by the template builder to determine where module can be dropped\n 'drop_target' => 0,\n\n // Used by the template builder to determine where module can have other\n // modules dropped inside of it\n 'drop_zone' => false,\n\n // Title will be used to identify this shortcode\n 'title' => __( 'Full Width Image', 'canvys' ),\n\n // Icon will be used to represent this shortcode in composer/builder\n // List of available icons can be found in icons.json\n 'icon' => 'picture-1',\n\n // Whether or not shortcode is self closing\n 'self_closing' => true,\n\n // If shortcode is not self closing, specify its default content\n 'default_content' => null,\n\n // Specify whether or not content is directly editable\n 'content_editor' => false,\n\n // Specify whether or not the content is composed of another shortcode\n 'content_element' => false,\n\n // Provide an explanation of what this shortcode does\n 'explanation' => __( 'Fullwidth images will be displayed at their actual size but scaled to fit the width of the layout. If you are attempting to create a full screen image use a content section and set the minimum height attribute to 100% and add the image as a background image instead.', 'canvys' ),\n\n // Array of shortcode settings and their respective attributes\n 'attributes' => array(\n\n new CV_Shortcode_Image_Control( 'id', array(\n 'title' => __( 'Image', 'canvys' ),\n 'description' => __( 'Select the image to be displayed', 'canvys' ),\n ) ),\n\n new CV_Shortcode_Select_Control( 'visibility', array(\n 'title' => __( 'Visibility', 'canvys' ),\n 'description' => __( 'Which devices this image should be visible on. This is great for optimizing your website for all devices.', 'canvys' ),\n 'default' => 'all',\n 'options' => $canvys['visibility_options'],\n ) ),\n\n ),\n );\n }",
"public function __construct()\r\n\t{\r\n\t\tadd_shortcode('products', array(&$this, 'getHTML'));\r\n\t}",
"public static function wrapLessFile($passedLess, $params){\n\n /**\n * @var CSSAsset $CSSAsset\n */\n $CSSAsset = null;\n if(get_class($params[0]) == CSSAsset::class){\n $CSSAsset = $params[0];\n }\n\n //define less string\n $less = \"\";\n\n //do not wrap less if not requested\n $templatename = $CSSAsset->getTemplateName();\n\n //attempt to lookup template object\n $CoreTemplateObject = CoreTemplate::getByNamespace($templatename);\n\n //return original less\n if(empty($CoreTemplateObject) || !$CoreTemplateObject->hasType(TemplateUtilsModule::WRAP_TEMPLATE_TYPE) || stripos($CSSAsset->getPath(), CoreLess::GLOBAL_STYLES) > -1){\n return $passedLess;\n }\n\n //open class wrapper\n if($CSSAsset->haveTemplateName()){\n $less .= \"\\n\" . '.' . self::TEMPLATE_ID_WRAPPER_PREPEND . $CSSAsset->getTemplateName() . ' {' . \"\\n\" . 'display: inline;' . \"\\n\" . $passedLess . \"\\n\" . '}' . \"\\n\";\n }\n\n //return wrapped less string\n return $less;\n\n }",
"function yiw_sc_sample_func($atts, $content = null)\n{\n extract(shortcode_atts(array(\n 'class' => 'call-to-action',\n 'title' => null,\n 'incipit' => null,\n 'phone' => null\n ), $atts));\n\n $html = ''; // this is the var to use for the html output of shortcode\n\n return apply_filters( 'yiw_sc_sample_html', $html ); // this must be written for each shortcode\n}",
"function shortcode_template( $atts, $content = null ) {\r\n\t\t\tglobal $mpc_ma_options;\r\n\t\t\tif ( ! defined( 'MPC_MASSIVE_FULL' ) || ( defined( 'MPC_MASSIVE_FULL' ) && $mpc_ma_options[ 'single_js_css' ] !== '1' ) ) {\r\n\t\t\t\t$this->enqueue_shortcode_scripts();\r\n\t\t\t}\r\n\r\n\t\t\t$atts = shortcode_atts( array(\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'preset' => '',\r\n\t\t\t\t'text' => '',\r\n\t\t\t\t'trigger' => 'hover',\r\n\t\t\t\t'position' => 'top',\r\n\t\t\t\t'show_effect' => 'fade',\r\n\t\t\t\t'disable_arrow' => '',\r\n\t\t\t\t'disable_hover' => '',\r\n\t\t\t\t'enable_wide' => '',\r\n\t\t\t\t'always_visible' => '',\r\n\r\n\t\t\t\t'font_preset' => '',\r\n\t\t\t\t'font_color' => '',\r\n\t\t\t\t'font_size' => '',\r\n\t\t\t\t'font_line_height' => '',\r\n\t\t\t\t'font_align' => '',\r\n\t\t\t\t'font_transform' => '',\r\n\r\n\t\t\t\t'padding_css' => '',\r\n\t\t\t\t'border_css' => '',\r\n\r\n\t\t\t\t'background_type' => 'color',\r\n\t\t\t\t'background_color' => '',\r\n\t\t\t\t'background_image' => '',\r\n\t\t\t\t'background_image_size' => 'large',\r\n\t\t\t\t'background_repeat' => 'no-repeat',\r\n\t\t\t\t'background_size' => 'initial',\r\n\t\t\t\t'background_position' => 'middle-center',\r\n\t\t\t\t'background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\t\t\t), $atts );\r\n\r\n\t\t\tif ( $atts[ 'text' ] == '' ) {\r\n\t\t\t\treturn '';\r\n\t\t\t} else {\r\n\t\t\t\t$atts[ 'text' ] = rawurldecode( base64_decode( strip_tags( $atts[ 'text' ] ) ) );\r\n\t\t\t}\r\n\r\n\t\t\t$styles = $this->shortcode_styles( $atts );\r\n\t\t\t$css_id = $styles[ 'id' ];\r\n\r\n\t\t\t$classes = ' mpc-init';\r\n\t\t\t$classes .= $atts[ 'font_preset' ] != '' ? ' mpc-typography--' . esc_attr( $atts[ 'font_preset' ] ) : '';\r\n\t\t\t$classes .= ' mpc-position--' . esc_attr( $atts[ 'position' ] );\r\n\t\t\t$classes .= $atts[ 'show_effect' ] != '' ? ' mpc-effect--' . esc_attr( $atts[ 'show_effect' ] ) : '';\r\n\t\t\t$classes .= $atts[ 'disable_arrow' ] != '' || ( ! preg_match( '/border-width|border-top|border-right|border-bottom|border-left/', $atts[ 'border_css' ] ) && $atts[ 'background_type' ] != 'color' ) ? ' mpc-no-arrow' : '';\r\n\t\t\t$classes .= $atts[ 'disable_hover' ] != '' ? '' : ' mpc-can-hover';\r\n\t\t\t$classes .= $atts[ 'always_visible' ] != '' ? ' mpc-triggered' : '';\r\n\t\t\t$classes .= $atts[ 'enable_wide' ] != '' ? ' mpc-wide' : '';\r\n\t\t\t$classes .= ' mpc-trigger--' . $atts[ 'trigger' ];\r\n\t\t\t$classes .= ' ' . esc_attr( $atts[ 'class' ] );\r\n\r\n\t\t\t$return = '<div id=\"' . $css_id . '\" class=\"mpc-tooltip' . $classes . '\">';\r\n\t\t\t\t$return .= do_shortcode( $atts[ 'text' ] );\r\n\t\t\t\tif ( $atts[ 'disable_arrow' ] == '' && ( $atts[ 'border_css' ] != '' || $atts[ 'background_type' ] == 'color' ) ) {\r\n\t\t\t\t\t$return .= '<div class=\"mpc-arrow\"></div>';\r\n\t\t\t\t}\r\n\t\t\t$return .= '</div>';\r\n\r\n\t\t\tglobal $mpc_frontend;\r\n\t\t\tif ( $mpc_frontend ) {\r\n\t\t\t\t$return .= '<style>' . $styles[ 'css' ] . '</style>';\r\n\t\t\t}\r\n\r\n\t\t\treturn $return;\r\n\t\t}",
"function dropcap_sc_func($atts, $content = '') {\n $currentShortCode = '<span class=\"tfb-sc-dropcap\">' . $content . '</span>';\n \n return $currentShortCode;\n}",
"public function __construct()\n\t{\n\t\t$shortcode_class = static::SHORTCODE_CLASS;\n\t\tparent::__construct(\n\t\t\t$shortcode_class::HTML_CLASS, // Base ID\n\t\t\t$shortcode_class::featureName(), // name\n\t\t\tarray(\n\t\t\t\t'description' => static::getDescription(),\n\t\t\t)\n\t\t);\n\t}",
"public static function factory($base, $name) {\n\t\t$shortcode = new self($base, $name);\n\n\t\treturn $shortcode;\n\t}",
"function __construct(){\r\n\t\t$not_installed_tpl = '<div class=\"alert alert-warning\">%s</div>';\r\n\t\t$not_installed_message = __('Sorry, BuddyPress must be enabled for this shortcode to work properly. If you have already installed and activated BuddyPress plugin, please make sure to enable this component inside \"Settings\" → \"BuddyPress\" → \"Components\".', 'gears');\r\n\t\t$not_installed_message = sprintf($not_installed_tpl, $not_installed_message);\r\n\t\t$this->bp_not_installed = $not_installed_message;\r\n\r\n\t\t// if visual composer is present integrate our modules to it\r\n\t\tif (function_exists('vc_map')) {\r\n\t\t\t$this->vc_integration();\r\n\t\t}\r\n\r\n\t\t$shortcode_list = array(\r\n\t\t\t\t'gears_bp_groups_carousel' => 'bp_groups_carousel',\r\n\t\t\t\t'gears_bp_groups_carousel_2' => 'bp_groups_carousel_2',\r\n\t\t\t\t'gears_bp_groups_grid' => 'bp_groups_grid',\r\n\t\t\t\t'gears_bp_groups_list' => 'bp_groups_list',\r\n\t\t\t\t'gears_bp_members_carousel' => 'bp_members_carousel',\r\n\t\t\t\t'gears_bp_members_carousel_2' => 'bp_members_carousel_2',\r\n\t\t\t\t'gears_bp_members_grid' => 'bp_members_grid',\r\n\t\t\t\t'gears_bp_members_list' => 'bp_members_list',\r\n\t\t\t\t'gears_bp_activity_stream' => 'gears_activity_stream',\r\n\t\t\t\t'gears_pricing_table' => 'gears_pricing_table',\r\n\t\t\t\t'gears_login' => 'gears_login',\r\n\t\t\t\t'gears_row' => 'gears_row',\r\n\t\t\t\t'gears_column' => 'gears_column',\r\n\t\t\t);\r\n\r\n\t\t// register all the shortcodes\r\n\t\tforeach ($shortcode_list as $shortcode_id => $shortcode_callback) {\r\n\t\t\tadd_shortcode($shortcode_id, array($this, $shortcode_callback));\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"public function addShortcodes ()\n\t\t{\n\t\t\tadd_shortcode('readmore', array(&$this, 'readmoreShortcode'));\n\t\t}"
] | [
"0.6360665",
"0.63273025",
"0.62588483",
"0.61536145",
"0.59619635",
"0.5891859",
"0.58461285",
"0.5804264",
"0.5780813",
"0.5741314",
"0.57211214",
"0.56348974",
"0.5605243",
"0.5604735",
"0.55792207",
"0.55631316",
"0.5544284",
"0.5517736",
"0.55051506",
"0.5490274",
"0.54867077",
"0.5460952",
"0.5446308",
"0.5406748",
"0.53982747",
"0.5391509",
"0.537118",
"0.5358542",
"0.53573704",
"0.5349754"
] | 0.711633 | 0 |
Prepare gradient string to be exported as a less var. | function the7_less_prepare_gradient_var( $gradient ) {
if ( is_a( $gradient, 'The7_Less_Gradient' ) ) {
$gradient_obj = $gradient;
} else {
$gradient_obj = the7_less_create_gradient_obj( $gradient );
}
return array(
$gradient_obj->get_color_stop( 1 )->get_color(),
$gradient_obj->get_string(),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function the7_less_create_gradient_obj( $gradient = null ) {\n\tif ( is_array( $gradient ) && isset( $gradient[0], $gradient[1] ) ) {\n\t\t$gradient = \"135deg|{$gradient[0]} 30%|{$gradient[1]} 100%\";\n\t}\n\n\treturn new The7_Less_Gradient( $gradient );\n}",
"function getGradientColors($line){\n $startBracket = strpos($line, '(');\n $endBracket = strpos($line, ')');\n $colors = explode(',',substr($line, $startBracket+1, $endBracket-$startBracket-1)); \n return $colors;\n}",
"public function getLess($current_preset = array())\n {\n $custom_less = '';\n\n $preset = $this->get(Registry::get('runtime.layout.preset_id'));\n\n if (!empty($preset['less'])) {\n $custom_less = $preset['less'];\n $custom_less .= \"\\n\" . $preset['custom_css'];\n }\n\n if (!empty($current_preset)) {\n $custom_less .= Less::arrayToLessVars($current_preset);\n }\n\n return $custom_less;\n }",
"function web_less_vars( $vars, $handle = 'ebor-theme-styles' ) {\n $vars['color-primary'] = get_option('color-primary', '#e74c3c');\n $vars['color-secondary-1'] = get_option('color-secondary-1', '#2c3e50');\n $vars['color-secondary-2'] = get_option('color-secondary-2', '#3498db');\n $vars['color-bg-muted'] = get_option('color-bg-muted', '#f4f4f4');\n $vars['color-bg-primary'] = get_option('color-bg-primary', '#fff');\n $vars['color-text'] = get_option('color-text', '#777777');\n $vars['color-heading'] = get_option('color-heading', '#333333');\n $vars['color-borders'] = get_option('color-borders', '#dddddd');\n $vars['color-twitter'] = get_option('color-twitter', '#00a0d1');\n $vars['color-facebook'] = get_option('color-facebook', '#3b5998');\n $vars['color-tumblr'] = get_option('color-tumblr', '#34526f');\n $vars['color-pinterest'] = get_option('color-pinterest', '#910101');\n $vars['color-dribbble'] = get_option('color-dribbble', '#ea4c89');\n $vars['color-googleplus'] = get_option('color-googleplus', '#C63D2D');\n $vars['standard-space'] = get_option('theme_spacing', '80') . 'px';\n $vars['standard-radius'] = get_option('theme_corners', '25') . 'px';\n $vars['short-transition'] = get_option('short_transition','300') . 'ms';\n $vars['medium-transition'] = get_option('medium_transition','500') . 'ms';\n $vars['long-transition'] = get_option('long_transition','2000') . 'ms';\n $vars['body-font'] = get_option('body_font', 'Open Sans');\n $vars['heading-font'] = get_option('heading_font', 'Open Sans');\n $vars['alt-font'] = get_option('alt_font', 'Raleway');\n $vars['color-link'] = get_option('color-link', '#333333');\n $vars['color-link-hover'] = get_option('color-link-hover', '#e74c3c');\n \n if( '' == $vars['body-font'] )\n \t$vars['body-font'] = 'sans-serif';\n \t\n if( '' == $vars['heading-font'] )\n \t$vars['heading-font'] = 'sans-serif';\n \t\n if( '' == $vars['alt-font'] )\n \t$vars['alt-font'] = 'sans-serif';\n \t\n return $vars;\n}",
"public static function buildString($string)\n {\n $obj = new \\lessc();\n $obj->setFormatter('compressed');\n\n try {\n $output = $obj->compile($string);\n } catch (\\Exception $e) {\n throw $e;\n }\n\n return $output;\n }",
"protected function compileScss($lessFilename,$cssFilename,$vars) {\n\n\t\t$extPath = \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::extPath('ws_less');\n\t\trequire_once($extPath.'Resources/Private/PHP/less.php/lib/Less/Autoloader.php');\n\t\t\\Less_Autoloader::register();\n\n\t\t$parser = new \\Less_Parser();\n\t\tif (file_exists($lessFilename)) {\n\n\t\t\t$parser->parseFile($lessFilename);\n\t\t\t$parser->parse($vars);\n\t\t\t$css = $parser->getCss();\n\n GeneralUtility::writeFile($cssFilename,$css);\n\n\t\t\treturn $cssFilename;\n\t\t}\n\n\t\treturn '';\n\t}",
"function presscore_compile_less_vars() {\n\t$less_vars = the7_get_new_less_vars_manager();\n\n\tdo_action( 'presscore_setup_less_vars', $less_vars );\n\n\treturn apply_filters( 'presscore_compiled_less_vars', $less_vars->get_vars() );\n}",
"public function initColoredString() {\n $this->foreground_colors['black'] = '0;30';\n $this->foreground_colors['dark_gray'] = '1;30';\n $this->foreground_colors['blue'] = '0;34';\n $this->foreground_colors['light_blue'] = '1;34';\n $this->foreground_colors['green'] = '0;32';\n $this->foreground_colors['light_green'] = '1;32';\n $this->foreground_colors['cyan'] = '0;36';\n $this->foreground_colors['light_cyan'] = '1;36';\n $this->foreground_colors['red'] = '\"0\";31';\n $this->foreground_colors['light_red'] = '1;31';\n $this->foreground_colors['purple'] = '0;35';\n $this->foreground_colors['light_purple'] = '1;35';\n $this->foreground_colors['brown'] = '0;33';\n $this->foreground_colors['yellow'] = '1;33';\n $this->foreground_colors['light_gray'] = '0;37';\n $this->foreground_colors['white'] = '1;37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }",
"function transliterate_grad( $info = '' )\n{\n\tswitch ( $info ) \n\t{\n\t\tcase '4':\n\t\t\t$grad = 'A';\n\t\t\tbreak;\n\t\tcase '3.5':\n\t\t\t$grad = 'B+';\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\t$grad = 'B';\n\t\t\tbreak;\t\t\n\t\tcase '2.5':\n\t\t\t$grad = 'C+';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\t$grad = 'C';\n\t\t\tbreak;\n\t\tcase '1.5':\n\t\t\t$grad = 'D+';\n\t\t\tbreak;\t\n\t\tcase '1':\n\t\t\t$grad = 'D';\n\t\t\tbreak;\n\t\tcase '0':\n\t\t\t$grad = 'F';\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\t$grad = 'F';\n\t\t\tbreak;\n\t}\n\treturn $grad;\n}",
"public function convertLESS2CSS(){\n $this->copy_assets(FALSE);\n }",
"protected function get_less_vars() {\n\t\t\t$less_vars = the7_get_new_shortcode_less_vars_manager();\n\n\t\t\t$less_vars->add_keyword( 'unique-shortcode-class-name', 'gallery-shortcode.' . $this->get_unique_class(), '~\"%s\"' );\n\n\t\t\t$less_vars->add_pixel_number( 'media-image-border-radius', $this->get_att( 'image_border_radius' ) );\n\n\t\t\tswitch ( $this->get_att( 'image_hover_bg_color' ) ) {\n\t\t\t\tcase 'gradient_rollover_bg':\n\t\t\t\t\t$first_color = 'rgba(0,0,0,0.6)';\n\t\t\t\t\t$gradient = '';\n\t\t\t\t\tif ( function_exists( 'the7_less_prepare_gradient_var' ) ) {\n\t\t\t\t\t\tlist( $first_color, $gradient ) = the7_less_prepare_gradient_var( $this->get_att( 'custom_rollover_bg_gradient' ) );\n\t\t\t\t\t}\n\t\t\t\t\t$less_vars->add_rgba_color( 'portfolio-rollover-bg', $first_color );\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg-gradient', $gradient );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'solid_rollover_bg':\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg', $this->get_att( 'custom_rollover_bg_color', '~\"\"' ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'browser_width_based' === $this->get_att( 'responsiveness' ) ) {\n\t\t\t\t$columns_attributes = the7_shortcode_add_responsive_columns_data_attributes( array(), $this->get_att( 'bwb_columns' ) );\n\t\t\t\tforeach ( $columns_attributes as $column => $val ) {\n\t\t\t\t\t$less_vars->add_keyword( $column, $val );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$less_vars->add_pixel_number( 'grid-posts-gap', $this->get_att( 'gap_between_posts' ) );\n\t\t\t$less_vars->add_pixel_number( 'grid-post-min-width', $this->get_att( 'pwb_column_min_width' ) );\n\n\t\t\t$shadow_style = '';\n\t\t\tif ( 'shadow' === $this->atts['image_decoration'] ) {\n\t\t\t\t$shadow_style = join( ' ', array(\n\t\t\t\t\t\t$this->atts['shadow_h_length'],\n\t\t\t\t\t\t$this->atts['shadow_v_length'],\n\t\t\t\t\t\t$this->atts['shadow_blur_radius'],\n\t\t\t\t\t\t$this->atts['shadow_spread'],\n\t\t\t\t\t\t$this->atts['shadow_color'],\n\t\t\t\t\t) );\n\t\t\t}\n\t\t\t$less_vars->add_keyword( 'portfolio-img-shadow', $shadow_style );\n\t\t\t$less_vars->add_pixel_number( 'shortcode-filter-gap', $this->get_att( 'gap_below_category_filter', '' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-color', $this->get_att( 'navigation_font_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-accent', $this->get_att( 'navigation_accent_color', '~\"\"' ) );\n\n\t\t\t$gap_before_pagination = '';\n\t\t\tswitch ( $this->get_att( 'loading_mode' ) ) {\n\t\t\t\tcase 'js_pagination':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsp_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'js_more':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsm_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$less_vars->add_pixel_number( 'shortcode-pagination-gap', $gap_before_pagination );\n\n\t\t\t$less_vars->add_pixel_number( 'project-icon-size', $this->get_att( 'project_icon_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-bg-size', $this->get_att( 'project_icon_bg_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-width', $this->get_att( 'project_icon_border_width' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-radius', $this->get_att( 'project_icon_border_radius' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-color', $this->get_att( 'project_icon_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-border-color', $this->get_att( 'project_icon_border_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-bg-color', $this->get_att( 'project_icon_bg_color', '~\"\"' ) );\n\n\t\t\treturn $less_vars->get_vars();\n\t\t}",
"public function __construct(string $webHexString)\r\n {$this->_ColorString = $webHexString;}",
"static public function gradient( $setting ) {\n\t\t$gradient = '';\n\t\t$values = array();\n\n\t\tif ( ! is_array( $setting ) ) {\n\t\t\treturn $gradient;\n\t\t}\n\n\t\tforeach ( $setting['colors'] as $i => $color ) {\n\t\t\t$stop = $setting['stops'][ $i ];\n\n\t\t\tif ( empty( $color ) ) {\n\t\t\t\t$color = 'rgba(255,255,255,0)';\n\t\t\t}\n\t\t\tif ( ! strstr( $color, 'rgb' ) ) {\n\t\t\t\t$color = '#' . $color;\n\t\t\t}\n\t\t\tif ( ! is_numeric( $stop ) ) {\n\t\t\t\t$stop = 0;\n\t\t\t}\n\n\t\t\t$values[] = $color . ' ' . $stop . '%';\n\t\t}\n\n\t\t$values = implode( ', ', $values );\n\n\t\tif ( 'linear' === $setting['type'] ) {\n\t\t\tif ( ! is_numeric( $setting['angle'] ) ) {\n\t\t\t\t$setting['angle'] = 0;\n\t\t\t}\n\t\t\t$gradient = 'linear-gradient(' . $setting['angle'] . 'deg, ' . $values . ')';\n\t\t} else {\n\t\t\t$gradient = 'radial-gradient(at ' . $setting['position'] . ', ' . $values . ')';\n\t\t}\n\n\t\treturn $gradient;\n\t}",
"function csstoolsexp_build_string($css_array, $pretty = false)\n{\n return csstoolsexp_array_to_css($css_array, $pretty);\n}",
"function add_less_vars( $less_vars ){\n\n\t\tif( pl_setting( 'layout_mode' ) == 'percent' )\n\t\t\t$value = (pl_setting( 'content_width_percent' )) ? pl_setting( 'content_width_percent' ) : '80%';\n\t\telse\n\t\t\t$value = (pl_setting( 'content_width_px' ) && pl_setting( 'content_width_px' ) != '') ? pl_setting( 'content_width_px' ) : '1100px';\n\n\t\n\t\t// if percent mode assign percent option\n\n\t\t$less_vars['plContentWidth'] = $value;\n\t\t$less_vars['pl-page-width'] = $value;\n\n\t\treturn $less_vars;\n\n\t}",
"public static function color($str = '')\n\t{\n\t\t// Reject invalid values\n\t\tif ( ! valid::color($str))\n\t\t\treturn '';\n\n\t\t// Convert to lowercase\n\t\t$str = strtolower($str);\n\n\t\t// Prepend \"#\"\n\t\tif ($str[0] !== '#')\n\t\t{\n\t\t\t$str = '#'.$str;\n\t\t}\n\n\t\t// Expand short notation\n\t\tif (strlen($str) === 4)\n\t\t{\n\t\t\t$str = '#'.$str[1].$str[1].$str[2].$str[2].$str[3].$str[3];\n\t\t}\n\n\t\treturn $str;\n\t}",
"public function colorRefAsGradient($colorRef, $angle)\n {\n list($colorRefType, $colorRefName) = explode('/', $colorRef);\n if ($colorRefType != 'Gradient' )\n {\n CakeLog::debug(\"[IdmlDeclaredColors::colorRefAsGradient] inappropriate colorRefType $colorRef\");\n return '';\n }\n\n if (!array_key_exists($colorRef, $this->declaredGradients))\n return '';\n\n $obj = $this->declaredGradients[$colorRef];\n return $obj->gradientAsCSS($angle);\n }",
"function ParseDoubleP ($str, $varlist) {\n\t\t\t\t$generated_str = $str;\n\n\t\t\t\tforeach ($varlist as $var) {\n\t\t\t\t\t$generated_str = str_replace(\"%\" . $var->key . \"%\", $var->val, $generated_str);\n\t\t\t\t}\n\t\t\t\t//$parsed_generated_str = $generated_str;\n\t\t\t\t//$generated_str = preg_replace('#(%)(.*)(%)#si', \"\", $generated_str);\n\n\t\t\t\t//if ($parsed_generated_str != $generated_str) newLog(\"Warning: Unknown variables also used in ParseDoubleP function. Omitting...\");\n\t\t\t\treturn $generated_str;\n\t\t\t}",
"function lesscss_compile($style, $contexte = array()){\r\n\trequire_once 'lessphp/lessc.inc.php';\r\n\r\n\tif (!class_exists(\"SPIPlessc\")){\r\n\t\tclass SPIPlessc extends lessc {\r\n\t\t\tprotected function addParsedFile($file) {\r\n\t\t\t\t$this->allParsedFiles[$file] = filemtime($file);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// le compilateur lessc compile le contenu\r\n\t$less = new SPIPlessc();\r\n\t// lui transmettre le path qu'il utilise pour les @import\r\n\t$less->importDir = _chemin();\r\n\r\n\ttry {\r\n\t\t$out = $less->parse($style);\r\n\r\n\t\tif ($files = $less->allParsedFiles()\r\n\t\t AND count($files)){\r\n\t\t\t$files = array_keys($files);\r\n\t\t\t$l = strlen(_ROOT_RACINE);\r\n\t\t\tforeach($files as $k=>$file){\r\n\t\t\t\tif (strncmp($file,_ROOT_RACINE,$l)==0){\r\n\t\t\t\t\t$files[$k] = substr($file,$l);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$out = \"/*\\n#@\".implode(\"\\n#@\",$files).\"\\n*/\\n\" . $out;\r\n\t\t}\r\n\t\treturn $out;\r\n\t}\r\n\t// en cas d'erreur, on retourne du vide...\r\n\tcatch (exception $ex) {\r\n\t\tspip_log('lessc fatal error:'.$ex->getMessage(),'less'._LOG_ERREUR);\r\n\t\terreur_squelette(\r\n\t\t\t\"LESS : Echec compilation\"\r\n\t\t\t. (isset($contexte['file'])?\" fichier \".$contexte['file']:\"\")\r\n\t\t . \"<br />\".$ex->getMessage()\r\n\t\t);\r\n\t\treturn '';\r\n\t}\r\n}",
"public function getColorAsString () {}",
"protected function get_less_file_name() {\n\t\t\treturn get_template_directory() . '/css/dynamic-less/shortcodes/gallery.less';\n\t\t}",
"public function generate_dynamic_css_color( $color ) {\r\n\r\n\t\t$dynamic_css_color = '\r\n\t\t\t.lscf-template2-woocommerce-display .lscf-template2-add-to-cart{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-template3-onsale{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-template3-woocommerce-display .lscf-template3-add-to-cart{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-template1-image::before{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.4 );\r\n\t\t\t}\r\n\t\t\t.lscf-li-title::before{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.4 );\r\n\t\t\t}\r\n\t\t\t.lscf-masonry-grid-cf{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.4 );\r\n\t\t\t}\r\n\t\t\t.lscf-woocommerce-grid-cf{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.2 );\r\n\t\t\t}\r\n\t\t\t.lscf-woocommerce-grid-2-cf{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.6);\r\n\t\t\t}\r\n\t\t\t.viewMode div.active{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\r\n\t\t\t.lscf-sorting-opt .lscf-sort-up.active .glyphicon, .lscf-sorting-opt .lscf-sort-down.active .glyphicon{\r\n\t\t\t\tcolor: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-woo-grid-2-onsale{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . '!important;\r\n\t\t\t}\r\n\t\t\t.lscf-woo-grid-2-add-to-cart{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.9 )!important;\r\n\t\t\t}\r\n\t\t\t.customRange .range_draggable{\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\t\r\n\t\t\t.customRange label{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px_checkbox:after{\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.post-list .price label, .post-list .block-price label{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.post-list .post-featuredImage .post-overlay{\r\n\t\t\t\tbackground: rgba(' . esc_attr( $color['rgb'] ) . ', 0.7 );\r\n\t\t\t}\r\n\t\t\t.view.block-view .block-price{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.view.block-view .block-price:before{\r\n\t\t\t\tborder-bottom:34px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.view.block-view .block-price:after{\r\n\t\t\t\tborder-top:34px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px-select-box.active-val div.select{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.pxSearchField .px-focus{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\tinput[type=\"radio\"]:checked + label.pxRadioLabel:before{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\tinput[type=\"radio\"]:checked + label.pxRadioLabel:after{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px-select-box.active-val div.select .options{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px-cross .px-cross-child-1, .px-cross .px-cross-child-2{\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .block-featuredImage .block-price {\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.6 );\r\n\t\t\t} \r\n\t\t\t.lscf-portrait .block-featuredImage .block-price:after{\r\n\t\t\t\tborder-left:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\tborder-bottom:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .block-featuredImage .block-price:before{\r\n\t\t\t\tborder-right:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\tborder-top:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .post-overlay{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.9 );\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .post-overlay .eyeglass{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.9 );\r\n\t\t\t}\r\n\t\t\t.px_capf-field .lscf-see-more{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\t\r\n\t\t\t}\r\n\t\t\t@media (max-width:770px) {\r\n\t\t\t\t.px-capf-wrapper .px-filter-fields .px-fiels-wrapper .px-filter-label-mobile{\r\n\t\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\t}\r\n\t\t\t\t.px-capf-wrapper .px-filter-fields .px-fiels-wrapper.active .px-filter-label-mobile{\r\n\t\t\t\t\tborder-bottom:0px;\r\n\t\t\t\t}\r\n\t\t\t\t.px-capf-wrapper .px-filter-fields .px-fiels-wrapper .px-field-wrapper-container{\r\n\t\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t';\r\n\r\n\t\treturn $dynamic_css_color;\r\n\t}",
"function theme_boost_training_get_pre_scss($theme) {\n $scss = '';\n $configurable = [\n // Config key => [variableName, ...].\n 'brandcolor' => ['brand-primary'],\n ];\n\n // Prepend variables first.\n foreach ($configurable as $configkey => $targets) {\n $value = isset($theme->settings->{$configkey}) ? $theme->settings->{$configkey} : null;\n if (empty($value)) {\n continue;\n }\n array_map(function ($target) use (&$scss, $value) {\n $scss .= '$' . $target . ': ' . $value . \";\\n\";\n }, (array)$targets);\n }\n\n // Prepend pre-scss.\n if (!empty($theme->settings->scsspre)) {\n $scss .= $theme->settings->scsspre;\n }\n\n return $scss;\n}",
"function getGradientType($line){\n $type='radial';\n if(strpos($line, 'linear')!==false){\n $type='linear';\n }\n return $type;\n}",
"public function compileEdge()\n {\n $this->clearCompiledValues();\n\n $this->compileLimit();\n $this->compileFields();\n $this->compileModifiers();\n\n $append = '';\n if (count($this->compiled_values) > 0)\n {\n $append = '?' . implode('&', $this->compiled_values);\n }\n\n //$append = '?' . http_build_query($values);\n return '/' . $this->name . $append;\n }",
"private function makeShortUrl(): string\n {\n return substr(\n str_shuffle(\n str_repeat(\n self::ALLOW_SYMBOLS,\n ceil(self::LENGTH/strlen(self::ALLOW_SYMBOLS))\n )\n ),\n 1,\n self::LENGTH\n );\n }",
"public function __construct(string $input, bool $strict = false)\n {\n if (! preg_match('/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i', $input)) {\n throw new InvalidColorException(sprintf(\n '\"%1$s\" is not a supported hex string.',\n $input,\n ));\n }\n\n if ($strict && ! str_starts_with($input, '#')) {\n throw new InvalidColorException(sprintf(\n '\"%1$s\" is not supported, leading hash is required in strict mode..',\n $input,\n ));\n }\n\n $hexString = str_starts_with($input, '#')\n ? $input\n : '#' . $input;\n\n $this->hexString = mb_strlen($hexString) === 7\n ? $hexString\n : implode('', [\n mb_substr($hexString, 0, -3),\n str_repeat(mb_substr($hexString, -3, 1), 2),\n str_repeat(mb_substr($hexString, -2, 1), 2),\n str_repeat(mb_substr($hexString, -1, 1), 2),\n ]);\n }",
"public function getGradient() {\r\n return $this->bBrush->getGradient();\r\n }",
"function restyle_r2_graph (string $graphdef): string\n{\n\t$ret = preg_replace ('/^([[:space:]]*graph \\[.*)bgcolor=azure /m', '\\1', $graphdef);\n\t# Label the coloured true/false edges for consistency with libpcap format.\n\t$ret = preg_replace ('/^([[:space:]]*.+ -> .+ \\[color=\"#13a10e\")(];)/m', '\\1 xlabel=\"T\"\\2', $ret);\n\t$ret = preg_replace ('/^([[:space:]]*.+ -> .+ \\[color=\"#c50f1f\")(];)/m', '\\1 xlabel=\"F\"\\2', $ret);\n\treturn $ret;\n}",
"function elegir_color2($valor,$txt){\r\n\tswitch ($valor){\r\n\t\tcase 'baja':\r\n\t\t\t$color = \"yellow\";\r\n\t\t\tbreak;\r\n\t\tcase 'media':\r\n\t\t\t$color = \"orange\";\r\n\t\t\tbreak;\r\n\t\tcase 'alta':\r\n\t\t\t$color = \"red\";\r\n\t\t\tbreak;\r\n\t}\r\n\t$cod = \"[color=\".$color.\"]\".$txt.\"[/color]\";\r\n\t\r\n\treturn $cod;\r\n}"
] | [
"0.6292105",
"0.4960228",
"0.48745644",
"0.47536892",
"0.4736359",
"0.47303483",
"0.47294915",
"0.47102588",
"0.46505067",
"0.46321067",
"0.4626158",
"0.45362467",
"0.453567",
"0.45130756",
"0.4475418",
"0.44747066",
"0.44745708",
"0.44528902",
"0.44257325",
"0.44063318",
"0.4390311",
"0.43857375",
"0.43768498",
"0.43529913",
"0.43266147",
"0.43162757",
"0.4297105",
"0.42849874",
"0.42489088",
"0.42314997"
] | 0.73544085 | 0 |
Return new The7_Less_Gradient object. | function the7_less_create_gradient_obj( $gradient = null ) {
if ( is_array( $gradient ) && isset( $gradient[0], $gradient[1] ) ) {
$gradient = "135deg|{$gradient[0]} 30%|{$gradient[1]} 100%";
}
return new The7_Less_Gradient( $gradient );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setLegs($legs)\n {\n $this->legs = $legs;\n\n return $this;\n }",
"protected function get_less_vars() {\n\t\t\t$less_vars = the7_get_new_shortcode_less_vars_manager();\n\n\t\t\t$less_vars->add_keyword( 'unique-shortcode-class-name', 'gallery-shortcode.' . $this->get_unique_class(), '~\"%s\"' );\n\n\t\t\t$less_vars->add_pixel_number( 'media-image-border-radius', $this->get_att( 'image_border_radius' ) );\n\n\t\t\tswitch ( $this->get_att( 'image_hover_bg_color' ) ) {\n\t\t\t\tcase 'gradient_rollover_bg':\n\t\t\t\t\t$first_color = 'rgba(0,0,0,0.6)';\n\t\t\t\t\t$gradient = '';\n\t\t\t\t\tif ( function_exists( 'the7_less_prepare_gradient_var' ) ) {\n\t\t\t\t\t\tlist( $first_color, $gradient ) = the7_less_prepare_gradient_var( $this->get_att( 'custom_rollover_bg_gradient' ) );\n\t\t\t\t\t}\n\t\t\t\t\t$less_vars->add_rgba_color( 'portfolio-rollover-bg', $first_color );\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg-gradient', $gradient );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'solid_rollover_bg':\n\t\t\t\t\t$less_vars->add_keyword( 'portfolio-rollover-bg', $this->get_att( 'custom_rollover_bg_color', '~\"\"' ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'browser_width_based' === $this->get_att( 'responsiveness' ) ) {\n\t\t\t\t$columns_attributes = the7_shortcode_add_responsive_columns_data_attributes( array(), $this->get_att( 'bwb_columns' ) );\n\t\t\t\tforeach ( $columns_attributes as $column => $val ) {\n\t\t\t\t\t$less_vars->add_keyword( $column, $val );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$less_vars->add_pixel_number( 'grid-posts-gap', $this->get_att( 'gap_between_posts' ) );\n\t\t\t$less_vars->add_pixel_number( 'grid-post-min-width', $this->get_att( 'pwb_column_min_width' ) );\n\n\t\t\t$shadow_style = '';\n\t\t\tif ( 'shadow' === $this->atts['image_decoration'] ) {\n\t\t\t\t$shadow_style = join( ' ', array(\n\t\t\t\t\t\t$this->atts['shadow_h_length'],\n\t\t\t\t\t\t$this->atts['shadow_v_length'],\n\t\t\t\t\t\t$this->atts['shadow_blur_radius'],\n\t\t\t\t\t\t$this->atts['shadow_spread'],\n\t\t\t\t\t\t$this->atts['shadow_color'],\n\t\t\t\t\t) );\n\t\t\t}\n\t\t\t$less_vars->add_keyword( 'portfolio-img-shadow', $shadow_style );\n\t\t\t$less_vars->add_pixel_number( 'shortcode-filter-gap', $this->get_att( 'gap_below_category_filter', '' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-color', $this->get_att( 'navigation_font_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'shortcode-filter-accent', $this->get_att( 'navigation_accent_color', '~\"\"' ) );\n\n\t\t\t$gap_before_pagination = '';\n\t\t\tswitch ( $this->get_att( 'loading_mode' ) ) {\n\t\t\t\tcase 'js_pagination':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsp_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'js_more':\n\t\t\t\t\t$gap_before_pagination = $this->get_att( 'jsm_gap_before_pagination', '' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$less_vars->add_pixel_number( 'shortcode-pagination-gap', $gap_before_pagination );\n\n\t\t\t$less_vars->add_pixel_number( 'project-icon-size', $this->get_att( 'project_icon_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-bg-size', $this->get_att( 'project_icon_bg_size' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-width', $this->get_att( 'project_icon_border_width' ) );\n\t\t\t$less_vars->add_pixel_number( 'project-icon-border-radius', $this->get_att( 'project_icon_border_radius' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-color', $this->get_att( 'project_icon_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-border-color', $this->get_att( 'project_icon_border_color', '~\"\"' ) );\n\t\t\t$less_vars->add_keyword( 'project-icon-bg-color', $this->get_att( 'project_icon_bg_color', '~\"\"' ) );\n\n\t\t\treturn $less_vars->get_vars();\n\t\t}",
"public function setLoyerHt(?float $loyerHt): LocationsFiTp {\n $this->loyerHt = $loyerHt;\n return $this;\n }",
"function the7_less_prepare_gradient_var( $gradient ) {\n\tif ( is_a( $gradient, 'The7_Less_Gradient' ) ) {\n\t\t$gradient_obj = $gradient;\n\t} else {\n\t\t$gradient_obj = the7_less_create_gradient_obj( $gradient );\n\t}\n\n\treturn array(\n\t\t$gradient_obj->get_color_stop( 1 )->get_color(),\n\t\t$gradient_obj->get_string(),\n\t);\n}",
"function the7_get_new_shortcode_less_vars_manager() {\n\t\treturn new The7_Less_Vars_Shortcode_Manager( new Presscore_Lib_SimpleBag(), new The7_Less_Vars_Factory() );\n\t}",
"public function weekly()\n {\n $rule = $this->getRuleArr();\n\n if ($rule[5] == '*') {\n $rule[5] = 1;\n }\n if ($rule[0] == '*') {\n $rule[0] = 0;\n }\n\n if ($rule[1] == '*') {\n $rule[1] = 0;\n }\n\n if ($rule[2] == '*') {\n $rule[2] = 0;\n }\n\n $this->setRule(implode(' ', $rule));\n return $this;\n }",
"public function getGradient() {\r\n return $this->bBrush->getGradient();\r\n }",
"public function makeImportant()\n {\n return new ILess_Node_Rule(\n $this->name,\n $this->value,\n '!important',\n $this->merge, $this->index, $this->currentFileInfo, $this->inline);\n }",
"public function setValidForMinWeight(?float $validForMinWeight) : self\n {\n $this->validForMinWeight = $validForMinWeight;\n return $this;\n }",
"public function __construct() {\n\n\t\t\tif (!class_exists('WPLessPlugin')) {\n\n\t\t\t\t// Check set memory limit. If less than 128M, begin a safe memory limit raise for PHP, in order to assist LESS compiling procedure\n\t\t\t\t$this->set_memory_limit( '128M' ); // For premium performance\n\t\t\t\t$this->set_memory_limit( '96M' ); // For best performance\n\t\t\t\t$this->set_memory_limit( '80M' ); // Least demanded RAM to work 100%\n\t\t\t\t$this->set_memory_limit( '64M' ); // Again, if 80M not available try with 64, which is a risky setting\n\n\t\t\t\t// If xdebug is present, make sure nesting level is raised to 100\n\t\t\t\t@ini_set('xdebug.max_nesting_level', 500);\n\n\t\t\t\tdefine('WP_LESS_COMPILATION', 'deep');\n\n\t\t\t\trequire_once THEME_ASSETS_DIR .'/wp-less/lib/Plugin.class.php';\n\n\t\t\t\t// The file is empty...just used for core directory reference\n\t\t\t\t$WPLessPlugin = WPPluginToolkitPlugin::create('WPLess', THEME_ASSETS_DIR .'/wp-less/bootstrap-for-theme.php', 'WPLessPlugin');\n\t\t\n\t\t\t\tif ( method_exists('Plethora', 'option') ) {\n\n\t\t\t\t\t// General > Body & Headings\n\t\t\t\t\t$wp_body_bg \t\t\t= Plethora::option('body-backround', '#EFEFEF', 0, false);\n\t\t\t\t\t$option \t\t\t= Plethora::option('font-headers', array( 'font-family'=>'Raleway' ), 0, false);\n\t\t\t\t\t$wp_font_alternative \t\t\t= isset( $option['font-family'] ) ? $option['font-family'] : 'Raleway' ;\n\t\t\t\t\t$wp_font_alternative_transform\t= Plethora::option('font-headers-transform', 'uppercase', 0, false);\n\t\t\t\t\t$option \t\t\t= Plethora::option('font-body', array( 'font-family'=>'Open Sans' ), 0, false);\n\t\t\t\t\t$wp_font_sansserif \t\t\t= isset( $option['font-family'] ) ? $option['font-family'] : 'Open Sans' ;\n\t\t\t\t\t$wp_font_sansserif_size\t\t\t= Plethora::option('font-body-size', '14', 0, false);\n\t\t\t\t\t$wp_text_color \t\t\t\t= Plethora::option('body-text-color', '#666666', 0, false);\n\t\t\t\t\t$wp_link_color \t\t\t\t= Plethora::option('body-link-color', '#428BCA', 0, false);\n\t\t\t\t\t$wp_font_buttons_transform\t\t= Plethora::option('font-buttons-transform', 'uppercase', 0, false);\n\n\t\t\t\t\t// General > Skin Coloured Sections\n\t\t\t\t\t$wp_skin_color \t\t\t= Plethora::option('skin-color', '#428BCA', 0, false);\n\t\t\t\t\t$wp_skin_colored_section_text\t= Plethora::option('skin-text-color', '#ffffff', 0, false);\n\t\t\t\t\t$wp_skin_colored_section_link \t= Plethora::option('skin-link-color', '#FFFF00', 0, false);\n\t\t\t\t\t// General > Dark Coloured Sections\n\t\t\t\t\t$wp_dark_section_bgcolor\t\t= Plethora::option('darksection-bgcolor', '#222222', 0, false);\n\t\t\t\t\t$wp_dark_section_text\t\t\t= Plethora::option('darksection-text-color', '#cccccc', 0, false);\n\t\t\t\t\t$wp_dark_section_link\t\t\t= Plethora::option('darksection-link-color', '#428BCA', 0, false);\n\t\t\t\t\t// Header > Colors & Typography\n\t\t\t\t\t$wp_header_bgcolor\t\t\t\t= Plethora::option('header-background', '#EFEFEF', 0, false);\n\t\t\t\t\t$wp_sticky_header_transparency\t= Plethora::option('header-background-transparency', 100, 0, false);\n\t\t\t\t\t$option \t\t\t\t\t\t= Plethora::option( 'header-link-color', array('regular' => '#555555', 'hover' => '#428BCA' ), 0, false);\n\t\t\t\t\t$wp_header_link_color \t\t\t= isset( $option['regular'] ) ? $option['regular'] : '#555555';\n\t\t\t\t\t$wp_header_link_hover_color \t= isset( $option['hover'] ) ? $option['hover'] : '#428BCA';\n\t\t\t\t\t// Header > Top Toolbar\n\t\t\t\t\t$wp_topbar_bgcolor \t\t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-toolbar-bgcolor', '#EFEFEF', 0, false);\n\t\t\t\t\t$wp_topbar_text_color \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-toolbar-text-color', '#555555', 0, false);\n\t\t\t\t\t$wp_topbar_link_color\t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-toolbar-link-color', '#555555', 0, false);\n\t\t\t\t\t// Footer > Main Section\n\t\t\t\t\t$wp_footer_bgcolor\t\t\t\t= Plethora::option( PLETHORA_META_PREFIX .'footer-bgcolor', '#222222', 0, false);\n\t\t\t\t\t$wp_footer_text_color \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'footer-text-color', '#cccccc', 0, false);\n\t\t\t\t\t$wp_footer_link_color \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'footer-link-color', '#428BCA', 0, false);\n\t\t\t\t\t// Head Panel > General\n\t\t\t\t\t$option \t\t\t= Plethora::option( PLETHORA_META_PREFIX .'header-slider-dimensions', array('height' => '580px', 'units' => 'px' ), 0, false);\n\t\t\t\t\t$wp_slider_height \t\t\t= isset( $option['height'] ) ? $option['height'] : '580px' ;\n\t\t\t\t\t// General > Miscellaneous\n\t\t\t\t\t$text_shadows \t\t\t= Plethora::option( 'text-shadows', 0, 0, false);\n\n\t\t\t\t} else { \n\n\t\t\t\t\t$wp_body_bg \t\t\t= '#EFEFEF';\n\t\t\t\t\t$wp_font_alternative \t\t\t= 'Raleway';\n\t\t\t\t\t$wp_font_alternative_transform\t= 'uppercase';\n\t\t\t\t\t$wp_font_sansserif \t\t\t= 'Open Sans';\n\t\t\t\t\t$wp_font_sansserif_size\t\t\t= '14px';\n\t\t\t\t\t$wp_text_color \t\t\t\t\t= '#666666';\n\t\t\t\t\t$wp_link_color \t\t\t\t\t= '#428BCA';\n\t\t\t\t\t$wp_skin_color \t\t\t= '#428BCA';\n\t\t\t\t\t$wp_font_buttons_transform\t\t= 'uppercase';\n\t\t\t\t\t$wp_skin_colored_section_text \t= '#ffffff';\n\t\t\t\t\t$wp_skin_colored_section_link \t= '#FFFF00';\n\t\t\t\t\t$wp_dark_section_bgcolor\t\t= '#222222';\n\t\t\t\t\t$wp_dark_section_text\t\t\t= '#cccccc';\n\t\t\t\t\t$wp_dark_section_link\t\t\t= '#428BCA';\n\t\t\t\t\t$wp_header_bgcolor\t\t\t\t= '#EFEFEF';\n\t\t\t\t\t$wp_sticky_header_transparency\t= 100;\n\t\t\t\t\t$wp_header_link_color \t\t\t= '#555555';\n\t\t\t\t\t$wp_header_link_hover_color \t= '#428BCA';\n\t\t\t\t\t$wp_topbar_bgcolor \t\t\t\t= '#EFEFEF';\n\t\t\t\t\t$wp_topbar_text_color \t\t\t= '#555555';\n\t\t\t\t\t$wp_topbar_link_color\t\t\t= '#555555';\n\t\t\t\t\t$wp_footer_bgcolor\t\t\t\t= '#222222';\n\t\t\t\t\t$wp_footer_text_color \t\t\t= '#cccccc';\n\t\t\t\t\t$wp_footer_link_color \t\t\t= '#428BCA';\n\t\t\t\t\t$wp_slider_height \t\t\t= '580px';\n\t\t\t\t\t$text_shadows \t\t \t\t\t= 0;\n\n\t\t\t\t}\n\n\t\t\t\t// die(gettype($text_shadows)); // 0 string\n\n\t\t\t\t$text_shadows = ( $text_shadows == 0 ) ? \"none\" : \"0 1px 2px rgba(0, 0, 0, 0.6)\";\n\n\t\t\t $WPLessPlugin->setVariables(array(\n\t\t\t\t\t'wp-body-bg' \t=> $wp_body_bg, \t\t\t\t\t// '#EFEFEF',\n\t\t\t\t\t'wp-font-family-alternative' \t=> '\"'. $wp_font_alternative .'\"', // 'Raleway'\n\t\t\t\t\t'wp-font-family-sans-serif' \t=> '\"'. $wp_font_sansserif .'\"', \t// 'Open Sans'\n\t\t\t\t\t'wp-text-color'\t\t\t\t\t=> $wp_text_color,\n\t\t\t\t\t'wp-link-color'\t\t\t\t\t=> $wp_link_color,\n\t\t\t\t\t'wp-skin-color' \t=> $wp_skin_color, \t\t\t\t// '#A59C78',\n\t\t\t\t\t'wp-skin-colored-section-text'\t=> $wp_skin_colored_section_text,\n\t\t\t\t\t'wp-skin-colored-section-link'\t=> $wp_skin_colored_section_link,\n\t\t\t\t\t'wp-dark-section-bgcolor'\t\t=> $wp_dark_section_bgcolor,\n\t\t\t\t\t'wp-dark-section-text'\t\t\t=> $wp_dark_section_text,\n\t\t\t\t\t'wp-dark-section-link'\t\t\t=> $wp_dark_section_link,\n\t\t\t\t\t'wp-header-bgcolor'\t\t\t\t=> $wp_header_bgcolor,\n\t\t\t\t\t'wp-sticky-header-transparency'\t=> $wp_sticky_header_transparency,\n\t\t\t\t\t'wp-header-link-color'\t\t\t=> $wp_header_link_color,\n\t\t\t\t\t'wp-header-link-hover-color'\t=> $wp_header_link_hover_color,\n\t\t\t\t\t'wp-topbar-bgcolor'\t\t\t\t=> $wp_topbar_bgcolor,\n\t\t\t\t\t'wp-topbar-text-color'\t\t\t=> $wp_topbar_text_color,\n\t\t\t\t\t'wp-topbar-link-color'\t\t\t=> $wp_topbar_link_color,\n\t\t\t\t\t'wp-footer-bgcolor'\t\t\t\t=> $wp_footer_bgcolor,\n\t\t\t\t\t'wp-footer-text-color'\t\t\t=> $wp_footer_text_color,\n\t\t\t\t\t'wp-footer-link-color'\t\t\t=> $wp_footer_link_color,\n\t\t\t\t\t'wp-slider-height' \t=> $wp_slider_height, \t\t\t\t// '580px'\n\t\t\t\t\t'wp-text-shadows' \t\t\t\t=> $text_shadows,\t\t\t\t\n\t\t\t\t\t'wp-font-size-base'\t\t\t\t=> $wp_font_sansserif_size . 'px',\t// Don't forget the px!!!\t\t\t\n\t\t\t\t\t'wp-cs-headings-text-transform'\t=> $wp_font_alternative_transform,\t\t\t\t\n\t\t\t\t\t'wp-btn-text-transform'\t\t\t=> $wp_font_buttons_transform,\t\t\t\t\n\t\t\t ));\n\n\t\t\t\tadd_action('init', array($this, 'enqueue_less'), 1);\n\n\t\t\t\t// READY and WORKING\n\t\t\t\tadd_action('after_setup_theme', array($WPLessPlugin, 'install'));\n\n\t\t\t\t// NOT WORKING\n\t\t\t\t//@see http://core.trac.wordpress.org/ticket/14955\n\t\t\t\tadd_action('uninstall_theme', array($WPLessPlugin, 'uninstall'));\n\n\t\t\t\t$WPLessPlugin->dispatch();\n\t\t\t}\n\n\t\t}",
"public function setDifference($difference)\n {\n $this->difference = Num::val($difference);\n\n return $this;\n }",
"public function newMinPrice(array $values): Cost\n {\n return new Cost(\n $values['value'] ?? $this->getDefaultValueOfMinimalPrice(),\n $values['currency'] ?? $this->getDefaultCurrencyOfMinimalPrice()\n );\n }",
"public function build(): FloatNumberRange\n {\n return CoreHelper::clone($this->instance);\n }",
"public function gradient(Matrix $input, Matrix $output, Deferred $prevGradient) : Matrix\n {\n return $this->activationFn->differentiate($input, $output)\n ->multiply($prevGradient());\n }",
"public function setLesserOrEqual(Property\\LesserOrEqual $lesserOrEqual) {\n\t\t$this->lesserOrEqual = $lesserOrEqual;\n\n\t\treturn $this;\n\t}",
"public function min(float $min): static\n {\n $this->min = $min;\n\n return $this;\n }",
"public static function init(): self\n {\n return new self(new FloatNumberRange());\n }",
"public function setLeeway($leeway)\n {\n $this->leeway = $leeway;\n\n return $this;\n }",
"final public function lessThan($expected): self\n {\n return $this->constraint($this->constraintFactory()->lessThan($expected));\n }",
"public function build(): LoyaltyProgramRewardDefinition\n {\n return CoreHelper::clone($this->instance);\n }",
"public static function createRelevanceBoosting(): self\n {\n $score = self::createDefault();\n $score->type = self::BOOSTING_RELEVANCE_FIELD;\n\n return $score;\n }",
"public function newExtraCharge(array $values): Cost\n {\n /** @var float $value */\n $value = isset($values['value'])\n ? Number::normalizeFloat($values['value'])\n : $this->getDefaultValueOfExtraCharge()\n ;\n\n return new Cost(\n $value,\n $values['currency'] ?? $this->getDefaultCurrencyOfExtraCharge()\n );\n }",
"public function addToMinimumFeedbackScore($feedbackScore)\n {\n $this->minimumFeedbackScore[] = $feedbackScore;\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n\n return $this;\n }"
] | [
"0.5259836",
"0.52208376",
"0.50292194",
"0.4989336",
"0.49086073",
"0.48198852",
"0.47940892",
"0.47111443",
"0.46381631",
"0.4608028",
"0.4587888",
"0.45840022",
"0.45653033",
"0.45347485",
"0.45002022",
"0.44932562",
"0.44751936",
"0.44481826",
"0.4424183",
"0.44209126",
"0.4370846",
"0.43655667",
"0.43517426",
"0.43393242",
"0.43393242",
"0.43393242",
"0.43393242",
"0.43278706",
"0.43278706",
"0.43278706"
] | 0.7196484 | 0 |
create an action to execute | protected function _createAction(){
if(class_exists($this->_action_class)){
$this->_action = new $this->_action_class();
}else{
throw new Anole_Dispatcher_Exception('Action class:'.$this->_action_class.' not found!');
}
if(!method_exists($this->_action,$this->_method)){
$this->_method = 'execute';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createAction();",
"public function executeAction();",
"public function createAction()\n {\n \n }",
"public function createAction()\n {\n $class = $this->getClass();\n $action = new $class;\n\n return $action;\n }",
"public function createAction()\n {\n\n }",
"abstract function execute($action);",
"abstract public function execute(Action $action);",
"public function createAction()\n {\n try {\n return parent::createAction();\n } catch (\\Exception $e) {\n return $this->createActionException($e);\n }\n }",
"public function addAction() {\r\n\t}",
"public function new_action($name)\n\t{\n\t\tif (empty($name))\n\t\t{\n\t\t\tfwrite(STDOUT, 'Please enter the name of the action you want to create: ');\n\t\t\t$name = fgets(STDIN);\n\t\t\t$name = trim($name);\n\t\t\tif (empty($name))\n\t\t\t{\n\t\t\t\t$_error = 'You did not provide a name for the action you want to create!';\n\t\t\t\tself::_display_message('error', $_error);\n\t\t\t}\n\t\t}\n\n\t\t$_access = (substr($name, 0, 1) == '_') ? 'private' : 'public';\n\n$_action = <<<ACTION\n// ------------------------------------------------------------------------\n\t\n\t{$_access} function {$name}()\n\t{\n\n\t} // End of {$name}\n\t\nACTION;\n\n\t\t$this->_actions[] = $_action;\n\n\t\treturn TRUE;\n\t}",
"public function addAction() {\n\t}",
"public function newAction() {\n\t}",
"function add_action() {}",
"abstract public function doAction();",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }",
"public function newAction()\n {\n\n }"
] | [
"0.8555333",
"0.7811373",
"0.7609867",
"0.7600678",
"0.7319407",
"0.72929066",
"0.7279317",
"0.7180088",
"0.71240777",
"0.70442915",
"0.7035215",
"0.7029868",
"0.6914429",
"0.686017",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725",
"0.68516725"
] | 0.8079895 | 1 |
get action class name | public function getActionClass(){
return $this->_action_class;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClassName() {\r\n\t\treturn $this->actionClassName;\r\n\t}",
"public function getActionName()\n {\n return $this->action;\n }",
"public function getActionName()\n {\n return $this->_action;\n }",
"public function getName()\n\t{\n\t\treturn 'action';\n\t}",
"public function getActionname()\r\n {\r\n return $this->actionname;\r\n }",
"public static function classAction()\n {\n return static::className();\n }",
"public function getActionName()\n\t{\n\t\treturn $this->camelize($this->getAction());\n\t}",
"public static function get_action():string { return self::$action; }",
"public function displayName()\n {\n return get_class($this->action);\n }",
"public static function getActionViewClassName()\n {\n return self::$_actionViewClassName;\n }",
"public function getActionName()\n {\n return $this->action['controller'] ?? 'Closure';\n }",
"public function getActionName() {\r\n\t\treturn $this->_request->getActionName();\r\n\t}",
"public function getActionMethodName() {\n return $this->_action_method_name;\n }",
"public static function getActionName()\n {\n return self::$_actionName;\n }",
"public function getActionName() { return $this->request->getActionName(); }",
"public function getActionName()\n {\n return $this->actionName;\n }",
"public function getActionName() {\n return $this->actionName;\n }",
"public function getActionName()\n {\n return $this->actionName;\n }",
"public function getActionName() {}",
"public function getActionName()\n {\n return $this->options['action'];\n }",
"public function getAction_Name()\n\t{\n\t\treturn $this->Action_Name;\n\t}",
"static public function getAction()\n {\n return self::$action;\n }",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"public function getActionName(){ }",
"public function getActionMethodName($action)\r\n {\r\n return $action . 'Action';\r\n }",
"public function action() {\r\n return $this->action;\r\n }",
"public function getActionName();",
"public function getActionName();",
"public function getActionName();"
] | [
"0.8778316",
"0.81159973",
"0.80625486",
"0.7975094",
"0.7963508",
"0.7956124",
"0.7936714",
"0.78977627",
"0.7862632",
"0.77756697",
"0.7772692",
"0.7766478",
"0.77386963",
"0.77349055",
"0.77125245",
"0.7704735",
"0.76903814",
"0.76735926",
"0.7587772",
"0.756735",
"0.75619173",
"0.75424886",
"0.7511489",
"0.7511489",
"0.7511166",
"0.7508088",
"0.7494653",
"0.748745",
"0.748745",
"0.748745"
] | 0.85611445 | 1 |
Returns the number of shards that is used for every collection within this graph. | public function getNumberOfShards(): int
{
return $this->numberOfShards;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNumberOfShards(): int\n {\n return $this->_data['number_of_shards'];\n }",
"public function getShardCount()\n {\n return $this->shard_count;\n }",
"public function getInitializingShards(): int\n {\n return $this->_data['initializing_shards'];\n }",
"public function getActiveShards(): int\n {\n return $this->_data['active_shards'];\n }",
"public function getRelocatingShards(): int\n {\n return $this->_data['relocating_shards'];\n }",
"public function getShardings()\n {\n return $this->shardings;\n }",
"function getShards()\n\t{\n\t\treturn $this->connection->getParams()['shards'];\n\t}",
"public function getUnassignedShards(): int\n {\n return $this->_data['unassigned_shards'];\n }",
"function getShards();",
"public function count(): int\n {\n return count($this->collections);\n }",
"public function getAffectedShards()\n {\n return $this->affected_shards;\n }",
"public function count()\n {\n return count($this->activeCollection);\n }",
"public function getActivePrimaryShards(): int\n {\n return $this->_data['active_primary_shards'];\n }",
"public function count() {\n return count($this->collection);\n }",
"public function getShoperCount()\n {\n return Shoper::find()->count();\n }",
"public function getNbSketches() {\n return $this->sketches->count();\n }",
"public function getClustersCount() {\n\t\t\treturn count($this->cassandra_clusters);\n\t\t}",
"public function count(): int\n {\n return count($this->collection);\n }",
"public function count(): int\n {\n return count($this->collection);\n }",
"public function getSize()\n {\n return count($this->stones);\n }",
"public function count() : int\n {\n return count($this->collection);\n }",
"public function count()\n {\n return count($this->resources);\n }",
"public function getCount()\r\n\t{\r\n\t\treturn count($this->screens);\r\n\t}",
"public function getTotalSegments(): int\n\t{\n\t\treturn count($this->getSegments());\n\t}",
"public function getSchoolsCount()\n {\n self::initialize();\n\n return count(self::$schools);\n }",
"public function count(): int\n {\n return \\count($this->collection);\n }",
"public function getShards(): array\n {\n $shards = [];\n foreach ($this->_data['shards'] as $shardNumber => $shard) {\n $shards[] = new Shard($shardNumber, $shard);\n }\n\n return $shards;\n }",
"public function count()\n {\n return count($this->runes) + count($this->instants) + count($this->conjures);\n }",
"public function count(): int\n {\n return $this->collection->count();\n }",
"public function count()\n {\n return count($this->getRoutes());\n }"
] | [
"0.77081996",
"0.754739",
"0.73781717",
"0.7086291",
"0.6868374",
"0.68218535",
"0.6730415",
"0.67278326",
"0.6473441",
"0.6449375",
"0.63163435",
"0.62466073",
"0.62174433",
"0.619006",
"0.6154852",
"0.6129412",
"0.61064893",
"0.60629904",
"0.60629904",
"0.6021762",
"0.6016261",
"0.6010463",
"0.5990241",
"0.5983232",
"0.5959782",
"0.59391123",
"0.59069633",
"0.5895578",
"0.58649397",
"0.58636075"
] | 0.7609712 | 1 |
Returns the replication factor used when initially creating collections for this graph. | public function getReplicationFactor(): int
{
return $this->replicationFactor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMinReplicationFactor(): int\n {\n return $this->minReplicationFactor;\n }",
"public function getCollectionNumber()\n {\n return $this->collectionNumber;\n }",
"public function getNumberOfReplicas(): int\n {\n return $this->_data['number_of_replicas'];\n }",
"public function getMinNumReplicas()\n {\n return isset($this->min_num_replicas) ? $this->min_num_replicas : 0;\n }",
"public function getReplicationStrategy()\n {\n return $this->strategy;\n }",
"public function getMaxNumReplicas()\n {\n return isset($this->max_num_replicas) ? $this->max_num_replicas : 0;\n }",
"public function testSetReplicationFactor()\n {\n // setup\n /** @var HDFSClient $hdfs */\n $hdfs = $this->hdfs;\n $hdfs->create($this->remoteFile, $this->localFile);\n\n // test\n $folderResult = $hdfs->setReplication($this->remoteFile, 1);\n\n // cleanup\n $hdfs->delete($this->remoteFile);\n\n\n // asserts\n $this->assertEquals($folderResult, true, \"Could not set replication factor\");\n }",
"public function getRetryFactor()\n {\n return $this->retryFactor;\n }",
"public function getCollectionId()\n {\n return $this->collectionId;\n }",
"public function getCollectionID()\n {\n return $this->cID;\n }",
"protected function _randomSize()\n {\n return 1;\n }",
"public function getnumfact()\n {\n return $this->numfact;\n }",
"public function getShardCount()\n {\n return $this->shard_count;\n }",
"public function getCacheCollectionPrefix()\n {\n return get_called_class();\n }",
"public function getCollection()\n\t{\n\t\treturn $this->_config['collection'];\n\t}",
"public function getCollection()\n {\n if ($this->isEmbeddable()) {\n return null;\n }\n\n $collection = $this->property('collection');\n\n if (empty($collection)) {\n if ($this->parentSchema()) {\n //Using parent collection\n return $this->parentSchema()->getCollection();\n }\n\n $collection = Inflector::camelize($this->getShortName());\n $collection = Inflector::pluralize($collection);\n }\n\n return $collection;\n }",
"public function getCostFactor() : int\n {\n // TODO: Implement getCostFactor() method.\n }",
"public function get_masterCounter(){\n if ($this->masterCounter === Null){\n myPear_db()->transaction('start');\n $this->_adjust_masterCounter(True);\n myPear_db()->transaction('end');\n }\n return $this->masterCounter;\n }",
"public function getInitialQuantity()\n {\n return $this->initialQuantity;\n }",
"public function getSetReadReplicasSettings()\n {\n return $this->set_read_replicas_settings;\n }",
"function isReplicationMode()\n{\n if (hasBackendClusteringMode()){\n $params = readConfigParams(array('backend_clustering_mode'));\n if ($params['backend_clustering_mode'] == 'native_replication_mode'){\n return TRUE;\n } else {\n return FALSE;\n }\n } else {\n $params = readConfigParams(array('replication_mode'));\n\n if (isTrue($params['replication_mode'])) {\n return TRUE;\n } else {\n return FALSE;\n }\n\t}\n}",
"public function count(): int\n {\n return count($this->collections);\n }",
"public function getCollection()\n\t{\n\t\tif (!isset($this->_collection))\n {\n $this->_collection = Yii::app()->edmsMongoCollection($this->_collectionName,$this->_dbName,$this->_connectionId);\n $this->callObjectMethods($this->_collection,$this->_callAfterCollectionCreate,self::CALLAFTER_COLLECTIONCREATE);\n }\n\n\t\treturn $this->_collection;\n\t}",
"protected function setCollection()\n {\n $databaseManager = app(DatabaseManager::class);\n $client = $databaseManager->connection('mongodb')->getMongoClient();\n $collection =$client->{config('database.connections.mongodb.database')}->subjects;\n\n return $collection;\n }",
"public function getReplicatedBytes()\n {\n return $this->replicated_bytes;\n }",
"public function getNumberOfShards(): int\n {\n return $this->numberOfShards;\n }",
"public function getCollectionRef() {\n return $this->collectionRef;\n }",
"public function getCollectionRef() {\n return $this->collectionRef;\n }",
"public function getCollectionRef() {\n return $this->collectionRef;\n }",
"public function setMaxNumReplicas($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_num_replicas = $var;\n\n return $this;\n }"
] | [
"0.65735847",
"0.61603516",
"0.59734136",
"0.56870353",
"0.5650634",
"0.545708",
"0.5237612",
"0.51910746",
"0.5104763",
"0.5016875",
"0.49801904",
"0.48220372",
"0.48186266",
"0.48104298",
"0.48093274",
"0.47810015",
"0.47532922",
"0.47315538",
"0.47018847",
"0.47011614",
"0.4699294",
"0.46934462",
"0.4674631",
"0.46622756",
"0.4658353",
"0.46479052",
"0.46413374",
"0.46413374",
"0.46413374",
"0.46388832"
] | 0.76671076 | 0 |
Returns the minimal replication factor used for every new collection in the graph. | public function getMinReplicationFactor(): int
{
return $this->minReplicationFactor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getReplicationFactor(): int\n {\n return $this->replicationFactor;\n }",
"public function getMinNodeCount()\n {\n return $this->min_node_count;\n }",
"public function getMinNumReplicas()\n {\n return isset($this->min_num_replicas) ? $this->min_num_replicas : 0;\n }",
"public function getTotalMinNodeCount()\n {\n return $this->total_min_node_count;\n }",
"public function getCollectionNumber()\n {\n return $this->collectionNumber;\n }",
"public function getMinimumCapacity()\n {\n return $this->minimum_capacity;\n }",
"public function getMinimumQuantity()\r\n\t{\r\n\t\treturn $this->minimumQuantity;\r\n\t}",
"public function getMinimumQuantity()\n {\n return $this->minimumQuantity;\n }",
"public function getInitialQuantity()\n {\n return $this->initialQuantity;\n }",
"public function getMinimalLength()\n {\n return $this->minimalLength;\n }",
"public function getDeletedFilesCountedInMinimum() {\n return @$this->attributes['deleted_files_counted_in_minimum'];\n }",
"public function getMinimumId() {\n return $this->minimumId;\n }",
"protected function _randomSize()\n {\n return 1;\n }",
"public function getNumberOfReplicas(): int\n {\n return $this->_data['number_of_replicas'];\n }",
"protected function _getMinQty()\n {\n if ($this->_minQty === false) {\n $this->_minQty = $this->getConfig()->getMinQty();\n }\n return $this->_minQty;\n }",
"public function getMinimalWidth();",
"public function getMaxNumReplicas()\n {\n return isset($this->max_num_replicas) ? $this->max_num_replicas : 0;\n }",
"public function getMinimum()\n\t{\n\t\treturn static::$dbMinimum;\n\t}",
"public function getMinimalVersion()\n {\n return $this->minimal_version;\n }",
"function get_phc_num_procs_divisor ()\n\t{\n\t\treturn 1;\n\t}",
"public function get_masterCounter(){\n if ($this->masterCounter === Null){\n myPear_db()->transaction('start');\n $this->_adjust_masterCounter(True);\n myPear_db()->transaction('end');\n }\n return $this->masterCounter;\n }",
"private function getNewestCacheNumber()\n {\n $newestCache = $this->getCacheService()->getNewestComic();\n if ($newestCache instanceof Comic) {\n $newestCachedComic = $newestCache->num;\n } else {\n $newestCachedComic = 0;\n }\n return $newestCachedComic;\n }",
"public function getMltMinDocFrequency() {}",
"public function getMaxNodeCount()\n {\n return $this->max_node_count;\n }",
"protected function randCapacityMultiplier()\n {\n return Mission::MIN_CAPACITY + (Mission::MAX_CAPACITY - Mission::MIN_CAPACITY) * Util::randFloat();\n }",
"function min_id()\n\t{\n\t\t$this->openDb();\n\t\t$query = \"SELECT min_id FROM persistEntries;\";\n\t\t$result = mysql_query($query);\n\t\t$tbl = mysql_fetch_array($result);\n\t\t$min_id = $tbl['min_id'];\n\t\t$this->closeDb();\n\t\treturn $min_id;\n\t}",
"public function setMinNumReplicas($var)\n {\n GPBUtil::checkInt32($var);\n $this->min_num_replicas = $var;\n\n return $this;\n }",
"public function reserve_masterCounter(){\n \n try {\n if ($this->init()){\n\t// Adjust the master counter\n\tmyPear_db()->transaction('start');\n\t$this->_adjust_masterCounter();\n\t$this->_update_masterCounter();\n\tmyPear_db()->transaction('end');\n }\n }catch(Exception $e){\n b_debug::internalError(x('pre',$e->xdebug_message));\n }\n $this->dbg('reserve');\n return $this->masterCounter;\n }",
"public function setMinNodeCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->min_node_count = $var;\n\n return $this;\n }",
"public function getTotalSupportedClients()\n {\n if (isset(self::$_tot['tot'])) {\n return (int)self::$_tot['tot'];\n }\n return (int)self::$_tot['tot'] = self::getSubObjectIDs(\n 'StorageNode',\n array('id' => $this->get('enablednodes')),\n 'maxClients',\n false,\n 'AND',\n 'name',\n false,\n 'array_sum'\n );\n }"
] | [
"0.65699583",
"0.61043805",
"0.6091485",
"0.556405",
"0.54679173",
"0.5355337",
"0.520072",
"0.5163362",
"0.5149839",
"0.50033444",
"0.500102",
"0.49555668",
"0.49548545",
"0.49533862",
"0.490533",
"0.48740116",
"0.48409668",
"0.48304418",
"0.48279747",
"0.4821045",
"0.481343",
"0.4810409",
"0.47656688",
"0.47638842",
"0.4753277",
"0.4750714",
"0.47454843",
"0.473203",
"0.47315404",
"0.47197586"
] | 0.7120665 | 0 |
Returns the orphan collections in the graph. | public function getOrphanCollections(): array
{
return $this->orphanCollections;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEmptyCollection();",
"public function orphaned()\n {\n return array_diff($this->current(), $this->monitoring());\n }",
"public function ownedByCollections()\n {\n return $this->relationshipTrashedFilter($this->morphedByMany('App\\Api\\V1\\Models\\Collection', 'fragmentable'));\n }",
"public function getAllPublishedOrphans(): PageCollection\n {\n return PageCollection::from(\n $this\n ->publishedQuery()\n ->apply(\n fn (Query $q) => $this->filterOrphans($q)\n )\n );\n }",
"public function nullCollection();",
"private function get_orphaned_files() {\n $indexedorphans = array();\n\n $ignoreautomatedbackupfolder = get_config('report_filetrash', 'ignoreautomatedbackupfolder');\n if (empty($ignoreautomatedbackupfolder)) {\n $currentfiles = array_merge($this->directoryfiles, $this->backupfiles);\n } else {\n $currentfiles = $this->directoryfiles;\n }\n\n $orphans = array_diff_key($currentfiles, $this->dbfiles);\n $i = 0;\n foreach ($orphans as $orphan) {\n $i++;\n if ($orphan['filename'] == 'warning.txt') {\n continue;\n }\n $indexedorphans[$i] = array(\n 'filename' => $orphan['filename'],\n 'filepath' => $orphan['filepath'],\n 'filesize' => $orphan['filesize'],\n 'extension' => $orphan['extension'],\n 'filekey' => $i);\n }\n return $indexedorphans;\n }",
"public function collections()\n {\n return $this->relationshipTrashedFilter($this->morphToMany('App\\Api\\V1\\Models\\Collection', 'collectionable'));\n }",
"public function getEmptyCollection()\n {\n return new GeneralCollectionDefault();\n }",
"public function getEmptyCollection()\n\t{\n\t\treturn new GeneralCollectionDefault();\n\t}",
"public function getCollections()\n {\n return $this->collections;\n }",
"public function getAncestors()\n {\n $node = $this;\n $ancestors = new \\SplObjectStorage();\n while (!empty($node->parent_id)) {\n $node = Sname::find($node->parent_id);\n $ancestors->attach($node);\n }\n\n return $ancestors;\n }",
"public function getVertexCollections($graph, array $options = [])\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $excludeOrphans = false;\n $_useCache = $this->cacheEnabled;\n\n if ((bool) $options && isset($options['excludeOrphans']) && !is_bool($options['excludeOrphans'])) {\n $excludeOrphans = UrlHelper::getBoolString($options['excludeOrphans']);\n }\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['result'])) {\n return $this->cache[$graph]['excludeOrphans']['vertexCollections'];\n }\n\n if (!empty($this->cache[$graph]['vertexCollections'])) {\n return $this->cache[$graph]['vertexCollections'];\n }\n }\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);\n\n if ($excludeOrphans === true) {\n $url = UrlHelper::appendParamsUrl($url, ['excludeOrphans' => $excludeOrphans]);\n }\n\n $connection = $this->getConnection();\n $batchCaptureMode = $connection->isInBatchCaptureMode();\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(false);\n }\n\n try {\n $response = $this->getConnection()->get($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(true);\n }\n\n $data = $response->getJson();\n $data = $data[self::OPTION_COLLECTIONS];\n\n sort($data);\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['vertexCollections'])) {\n $this->cache[$graph]['excludeOrphans']['vertexCollections'] = $data;\n } else {\n $this->cache[$graph]['vertexCollections'] = $data;\n }\n }\n\n return $data;\n }",
"public function getCollections() {\n return $this->collections;\n }",
"public function getPublications(): PersistentCollection\n {\n return $this->publications;\n }",
"public function getDefaultGraphIds(): array {\n return $this->defaultGraphIds;\n }",
"public function hasCollections()\n {\n return $this\n ->where(sprintf(\n 'EXISTS (SELECT 1 FROM %s WHERE %s = %s)',\n CollectorCollectionPeer::TABLE_NAME, CollectorCollectionPeer::CONTENT_CATEGORY_ID, ContentCategoryPeer::ID\n ));\n }",
"public function getAllExceptAuth(): Collection;",
"public function getDependencies(array $except = []): Collection;",
"public function deleteOrphanCollection($graph, $orphanCollection, $dropCollection = false)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $orphanCollection]);\n $data = [\n self::OPTION_DROP_COLLECTION => $dropCollection\n ];\n $url = UrlHelper::appendParamsUrl($url, $data);\n\n try {\n $response = $this->getConnection()->delete($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n $data = $response->getJson();\n\n $options['_isNew'] = false;\n\n $result = Graph::createFromArray($data['graph'], $options);\n $result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);\n\n return $result;\n }",
"public function eagerLoadableRelations(): array;",
"public function getAncestors();",
"public function flatten(): NonEmptySet;",
"public static function findAllNotDeleted()\r\n {\r\n return self::findNotDeleted()->all();\r\n }",
"public function getAllHasMany()\n {\n $hasmany = array();\n foreach ($this->phclass->getHasManyDeclarations() as $attr=>$rel)\n {\n $hasmany[$attr] = $this->get($attr); // value is a collection\n }\n return $hasmany;\n }",
"public function collections()\n {\n return collect($this->all());\n }",
"public function getAllCollections()\n {\n if (is_array($this->collection)) {\n return $this->collection;\n } elseif (is_null($this->collection)) {\n return [];\n }\n return [$this->collection];\n }",
"public static function getNoZoneObjectObjects() \n\t{\n\t\t$collection = new \\Illuminate\\Database\\Eloquent\\Collection;\n foreach (Object::all() as $object) {\n \tif(!isset($object->zoneobject->id) && !isset($object->zone->id))\n \t\t$collection->add($object);\n }\n \n return $collection;\n\t}",
"public function getRelations()\n {\n return $this->relations;\n }",
"public function addOrphanCollection($graph, $orphanCollection)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);\n $data = [\n self::OPTION_COLLECTION => $orphanCollection\n ];\n\n try {\n $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data));\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n $data = $response->getJson();\n\n $options['_isNew'] = false;\n\n $result = Graph::createFromArray($data['graph'], $options);\n $result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);\n\n return $result;\n }",
"public function relations(){\r\n\t\treturn $this->relations;\r\n\t}"
] | [
"0.6245536",
"0.59679306",
"0.59442914",
"0.59262383",
"0.57143885",
"0.5692266",
"0.5669462",
"0.5638872",
"0.56037277",
"0.5494735",
"0.5459288",
"0.5412033",
"0.5400057",
"0.5350819",
"0.53358144",
"0.53317213",
"0.52542907",
"0.5243317",
"0.52346265",
"0.5219982",
"0.5216981",
"0.51990014",
"0.517049",
"0.51694745",
"0.5165759",
"0.5161268",
"0.5149571",
"0.51431614",
"0.5133308",
"0.5126974"
] | 0.8088692 | 0 |
Return all edge definitions of graph. | public function getEdgeDefinitions(): ArrayList
{
return $this->edgeDefinitions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getEdges();",
"public function getEdges(): EdgeSet\n {\n return $this->vertexEdges;\n }",
"public function getEdges(): array;",
"public function getEdgeCollections($graph)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $_useCache = $this->cacheEnabled;\n\n if ($_useCache === true && !empty($this->cache[$graph]['edgeCollections'])) {\n return $this->cache[$graph]['edgeCollections'];\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_EDGE]);\n\n $connection = $this->getConnection();\n $batchCaptureMode = $connection->isInBatchCaptureMode();\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(false);\n }\n\n try {\n $response = $this->getConnection()->get($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(true);\n }\n\n $data = $response->getJson();\n $data = $data[self::OPTION_COLLECTIONS];\n\n sort($data);\n\n if ($_useCache === true && !empty($this->cache[$graph]['edgeCollections'])) {\n $this->cache[$graph]['edgeCollections'] = $data;\n }\n\n return $data;\n }",
"public function getResourceEdges()\n {\n return $this->resource_edges;\n }",
"public function getEdge() {\n return $this->edge;\n }",
"public function getGraph();",
"public function getDefinitions () {\n return array_map(function ($rule) {\n return $rule->getDefinition();\n }, $this->_pool);\n }",
"public function getDefinitions();",
"public function getDefinitions();",
"function getEdges($cell)\n\t{\n\t\treturn ($cell != null) ? $cell->edges : null;\n\t}",
"public function getDefinitions() : array;",
"abstract protected function getGraph();",
"public function getDefinitions()\n {\n return [\n StrategyInterface::class => $this->getStrategy(),\n RouteCollection::class => $this->getRouter(),\n 'router' => new Reference(RouteCollection::class),\n ];\n }",
"public function testEdges()\n {\n $v2 = $this->graph->createVertex(2);\n $v3 = $this->graph->createVertex(3);\n $v4 = $this->graph->createVertex(4);\n $e1 = $this->vertex->createEdgeTo($v2);\n $e2 = $this->vertex->createEdge($v3);\n $e3 = $v4->createEdgeTo($this->vertex);\n\n $this->assertEquals(array($e1, $e2, $e3), $this->vertex->getEdges());\n $this->assertEquals(array($e2, $e3), $this->vertex->getEdgesIn());\n $this->assertEquals(array($e1, $e2), $this->vertex->getEdgesOut());\n\n $this->assertTrue($this->vertex->hasEdgeTo($v2));\n $this->assertTrue($this->vertex->hasEdgeTo($v3));\n $this->assertFalse($this->vertex->hasEdgeTo($v4));\n\n $this->assertFalse($this->vertex->hasEdgeFrom($v2));\n $this->assertTrue($this->vertex->hasEdgeFrom($v3));\n $this->assertTrue($this->vertex->hasEdgeFrom($v4));\n\n $this->assertEquals(array($e1), $this->vertex->getEdgesTo($v2));\n $this->assertEquals(array($e2), $this->vertex->getEdgesTo($v3));\n $this->assertEquals(array(), $this->vertex->getEdgesTo($v4));\n\n $this->assertEquals(array(), $this->vertex->getEdgesFrom($v2));\n $this->assertEquals(array($e2), $this->vertex->getEdgesTo($v3));\n $this->assertEquals(array($e3), $this->vertex->getEdgesFrom($v4));\n }",
"public function getDefinitions()\n {\n return Client::request()->definitions(\n $this->word_id, $this->word,\n $this->getSourceLanguageId(),\n $this->getDestinationLanguageId()\n );\n }",
"public function definitions()\n {\n return $this->hasMany('App\\Definition');\n }",
"public function definitions()\n {\n return $this->hasMany('App\\Definition');\n }",
"abstract public function getNodeGraph();",
"public function getEdges(){\n\n\t\t$promoters = $this->input->post('promoters');\n\t\t$tfs = $this->input->post('tfs');\n\t\t\n\t\t// Get metaproject info\t\t\n\t\t$project_info = $this->Data_Model->getMetaProjects($this->input->post('user'), $this->input->post('project'));\n\t\t\n\t\tif($project_info['users'] && $project_info['projects']){\n\t\t\t$users = $project_info['users'];\n\t\t\t$projects = $project_info['projects'];\n\t\t} else {\n\t\t\t$users = array(0 => \"NULL\");\n\t\t\t$projects = array(0 => \"NULL\");\n\t\t}\n\n\n\n\n\t\t// Query the nodes again to get the list for interactions\n\t\t// This query is to get nodes related to user input and only grab those edges\n\t\t$promoterString = \"\";\n\t\t$tfString = \"\";\n\t\t\n\t\tif($promoters != null){\n\t\t\t/// Query up the promoter nodes\n\t\t\t$query = $this->Network_Model->queryPromoterNodes($users[0], $projects[0], $promoters);\n\t\t\tforeach($query->result() as $value){\n\t\t\t\t$promoterString .= \"'$value->bait_id',\";\n\t\t\t}\n\t\t\t$promoterString .= \"'catch'\";\n\t\t}\n\n\t\tif($tfs != null){\n\t\t\t/// Query up the transcriptor nodes\n\t\t\t$query = $this->Network_Model->queryTranscriptionNodes($users[0], $projects[0], $tfs);\n\t\t\tforeach($query->result() as $value){\n\t\t\t\t$tfString .= \"'$value->coordinate',\";\n\t\t\t}\n\t\t\t$tfString .= \"'catch'\";\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/// Set up the edges array\n\t\t$edges = array();\n\t\t\n\t\t$query = $this->Network_Model->queryEdges($users[0], $projects[0], $promoterString, $tfString);\n\t\tforeach($query->result() as $value){\n\t\t\t$edges[] = array(\"id\" => $value->plate_name . \"to\" . $value->array_coord, \"target\" => $value->array_coord, \"source\" => $value->plate_name);\n\t\t}\n\t\t// echo it out\n\t\techo json_encode($edges);\n\t\t\n\t\t//queryTranscriptionNodes($userName, $projectName)\n\t}",
"public function definitions() : Definitions\n {\n return $this->definitions;\n }",
"protected function findEdges(NodeInterface $node): iterable\n {\n foreach ($node->children() as $child) {\n yield $node => $child;\n\n yield from $this->findEdges($child);\n }\n }",
"public function getAllAggDefs()\n {\n $cacheKey = 'aggdefs';\n if ($list = $this->getCache($cacheKey)) {\n return $list;\n }\n\n $allAggDefs = array(\n 'cross' => array(),\n 'modules' => array(),\n );\n foreach ($this->getAllEnabledModules() as $module) {\n $aggDefs = $this->getAllAggDefsModule($module);\n $allAggDefs['cross'] = array_merge($allAggDefs['cross'], $aggDefs['cross']);\n $allAggDefs['modules'][$module] = $aggDefs['module'];\n }\n return $this->setCache($cacheKey, $allAggDefs);\n }",
"public function edges($collection, $vertexHandle, $direction = 'any', array $options = [])\n {\n $collection = $this->makeCollection($collection);\n\n $params = [\n self::OPTION_VERTEX => $vertexHandle,\n self::OPTION_DIRECTION => $direction\n ];\n $url = UrlHelper::appendParamsUrl(Urls::URL_EDGES . '/' . urlencode($collection), $params);\n $response = $this->getConnection()->get($url);\n \n if ($batchPart = $response->getBatchPart()) {\n return $batchPart;\n }\n\n $options['_isNew'] = false;\n $json = $response->getJson();\n $edges = [];\n foreach ($json[self::ENTRY_EDGES] as $data) {\n $edges[] = $this->createFromArrayWithContext($data, $options);\n }\n\n return $edges;\n }",
"public function get_all_definitions() {\n\t\t$legacy_types = $this->get_legacy_field_types();\n\t\t$definitions = array();\n\t\tforeach( $legacy_types as $type_slug => $ignored ) {\n\t\t\t$defintion = $this->load_field_type_definition( $type_slug );\n\t\t\tif( null != $defintion ) {\n\t\t\t\t$definitions[] = $defintion;\n\t\t\t}\n\t\t}\n\t\treturn $definitions;\n\t}",
"public function createGraph()\n {\n return $this->getGraph()->createGraphCloneEdges($this->getEdges());\n }",
"public function getGraph()\n {\n return $this->assignable->getGraph();\n }",
"public function getDefinition(): array\n {\n return $this->definition;\n }",
"public function getOutgoingEdge()\n {\n return $this->outgoingEdge;\n }",
"public function getDefinitions()\n\t{\n\t\tif(!is_array($this->defs))\n\t\t{\t\t\t\n\t\t\t$this->defs = ilAdvancedMDFieldDefinition::getInstancesByRecordId($this->record_id);\t\t\t\t\t\t\n\t\t}\n\t\treturn $this->defs;\n\t}"
] | [
"0.7075572",
"0.6752418",
"0.65270245",
"0.6009915",
"0.5691994",
"0.56540745",
"0.55654144",
"0.5453803",
"0.54520893",
"0.54520893",
"0.5362099",
"0.5298171",
"0.52967906",
"0.5249951",
"0.5239359",
"0.5235391",
"0.51574886",
"0.51574886",
"0.5050781",
"0.5033866",
"0.4988164",
"0.49628168",
"0.49541825",
"0.48644543",
"0.48436967",
"0.48133472",
"0.47734788",
"0.47640195",
"0.47626942",
"0.47624308"
] | 0.78898853 | 0 |
Lists all vertex collections within this graph. | public function getVertexCollections(): ArrayList
{
try {
// Empty vertex collections for new graphs
if ($this->isNew()) {
return new ArrayList();
}
if (!$this->database) {
throw new DatabaseException("Database not defined");
}
$connection = $this->database->getConnection();
$uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);
$uri = sprintf("%s/%s", Api::addUriParam($uri, $this->getName()), 'vertex');
$response = $connection->get($uri);
$data = json_decode((string)$response->getBody(), true);
return new ArrayList($data['collections']);
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
$databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
throw $databaseException;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCollections()\n {\n return $this->collections;\n }",
"public function getCollections() {\n return $this->collections;\n }",
"public function getAllCollections()\n {\n if (is_array($this->collection)) {\n return $this->collection;\n } elseif (is_null($this->collection)) {\n return [];\n }\n return [$this->collection];\n }",
"public function getVertexCollections($graph, array $options = [])\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $excludeOrphans = false;\n $_useCache = $this->cacheEnabled;\n\n if ((bool) $options && isset($options['excludeOrphans']) && !is_bool($options['excludeOrphans'])) {\n $excludeOrphans = UrlHelper::getBoolString($options['excludeOrphans']);\n }\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['result'])) {\n return $this->cache[$graph]['excludeOrphans']['vertexCollections'];\n }\n\n if (!empty($this->cache[$graph]['vertexCollections'])) {\n return $this->cache[$graph]['vertexCollections'];\n }\n }\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);\n\n if ($excludeOrphans === true) {\n $url = UrlHelper::appendParamsUrl($url, ['excludeOrphans' => $excludeOrphans]);\n }\n\n $connection = $this->getConnection();\n $batchCaptureMode = $connection->isInBatchCaptureMode();\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(false);\n }\n\n try {\n $response = $this->getConnection()->get($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(true);\n }\n\n $data = $response->getJson();\n $data = $data[self::OPTION_COLLECTIONS];\n\n sort($data);\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['vertexCollections'])) {\n $this->cache[$graph]['excludeOrphans']['vertexCollections'] = $data;\n } else {\n $this->cache[$graph]['vertexCollections'] = $data;\n }\n }\n\n return $data;\n }",
"public function collections()\n {\n return collect($this->all());\n }",
"public function getAllSubcollections();",
"public function collections()\n {\n return $this->relationshipTrashedFilter($this->morphToMany('App\\Api\\V1\\Models\\Collection', 'collectionable'));\n }",
"public function getProductCollections()\n {\n if (count($this->_productCollections)) {\n return $this->_productCollections;\n }\n\n $this->_logMemory();\n\n // Get default product collection\n $this->loadProductCollection();\n\n $stores = $this->_getStores();\n foreach($stores as $store) {\n $this->loadProductCollection($store);\n }\n\n $this->_logMemory();\n\n return $this->_productCollections;\n }",
"public function getAllCollection() {\n $lists = Group::pluck ('id', 'name')->toArray();\n return array_flip ( $lists );\n }",
"public function getAllCollections()\n {\n $this->_params = array(\n \"per_page\"=> isset($this->per_page) ? $this->per_page : 25,\n \"status\"=> isset($this->status) ? $this->status : '',\n \"start\"=> isset($this->start) ? $this->start : date('2020-01-01 00:00:00'),\n \"end\"=> isset($this->end) ? $this->end : date('Y-m-d 23:59:59'),\n \"currency_code\"=> isset($this->currency_code) ? $this->currency_code : '',\n \"designation\"=> isset($this->designation) ? $this->designation : ''\n );\n return $this->sendAPIRequest('GET',\"/collections\",json_encode(array_merge($this->_params)));\n }",
"public function all(): array\n\t{\n\t\treturn $this->collection;\n\t}",
"public function getEdgeCollections($graph)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $_useCache = $this->cacheEnabled;\n\n if ($_useCache === true && !empty($this->cache[$graph]['edgeCollections'])) {\n return $this->cache[$graph]['edgeCollections'];\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_EDGE]);\n\n $connection = $this->getConnection();\n $batchCaptureMode = $connection->isInBatchCaptureMode();\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(false);\n }\n\n try {\n $response = $this->getConnection()->get($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(true);\n }\n\n $data = $response->getJson();\n $data = $data[self::OPTION_COLLECTIONS];\n\n sort($data);\n\n if ($_useCache === true && !empty($this->cache[$graph]['edgeCollections'])) {\n $this->cache[$graph]['edgeCollections'] = $data;\n }\n\n return $data;\n }",
"public function all()\n {\n return $this->collection;\n }",
"public function all()\n {\n return $this->collection;\n }",
"public function getKeys() {\n return new ArrayList(array_keys($this->collection));\n }",
"public function collections()\n {\n return $this->belongsToMany(Collection::class);\n }",
"public function vertices(){\n return $this->vertices;\n }",
"protected function readCollectionList()\n {\n $this->collections = $this->getChildren(self::COLLECTIONS_ZKNODE);\n }",
"public function get_all_from() {\n return array_keys($this->get_collection_from());\n }",
"public function getIndexes(): Collection\n {\n return $this->indexes;\n }",
"public function getCollection()\n {\n return $this->baseCursor->getCollection();\n }",
"public function getCollection();",
"public function getCollection();",
"public function ownedByCollections()\n {\n return $this->relationshipTrashedFilter($this->morphedByMany('App\\Api\\V1\\Models\\Collection', 'fragmentable'));\n }",
"public function getOrphanCollections(): array\n {\n return $this->orphanCollections;\n }",
"public function getEdges(): EdgeSet\n {\n return $this->vertexEdges;\n }",
"public function getCollection()\n {\n if (null !== $this->collection) {\n return $this->collection;\n }\n\n return $this->collection = $this->generateCollection();\n }",
"public function keys(): Collection\n\t{\n\t\treturn (new Collection)->push(...array_keys($this->collection));\n\t}",
"public function getCountriesCollection()\n {\n if (null !== $this->countriesCollection) {\n return $this->countriesCollection;\n }\n\n return $this->countriesCollection = (new CountLang())->getCountries(\n ['currencies', $this->getAlphaCode(), Filter::OPERATOR_HAS]\n );\n }",
"public function getAllCollects()\n {\n $results = self::shopify_call($this->shopify, \"/admin/api/2021-04/collects.json\", [], 'GET');\n\n if ($results['headers']['status'] == \"HTTP/2 200 \\r\") {\n $collects = json_decode($results['response'], TRUE);\n return $collects['collects'];\n } else {\n return false;\n }\n }"
] | [
"0.6652923",
"0.6592327",
"0.65871793",
"0.65724224",
"0.6499453",
"0.62898856",
"0.6089634",
"0.5903792",
"0.59002256",
"0.5821515",
"0.5818851",
"0.57758087",
"0.5734689",
"0.5734689",
"0.55193704",
"0.5473613",
"0.54695684",
"0.54671866",
"0.5454263",
"0.54528606",
"0.54434323",
"0.53872013",
"0.53872013",
"0.5302815",
"0.5279352",
"0.52789795",
"0.52781826",
"0.5261287",
"0.51711375",
"0.5152022"
] | 0.75375634 | 0 |
Adds a vertex collection to the set of orphan collections of the graph. If the collection does not exist, it will be created. | public function addVertexCollection(string $collection): bool
{
try {
// For new collections, just add the collection to 'orphanCollections'
if ($this->isNew()) {
$this->orphanCollections[] = $collection;
return true;
}
if (!$this->database) {
throw new DatabaseException("Database not defined");
}
// Adds the vertex collection on server.
$connection = $this->database->getConnection();
$uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);
$uri = sprintf("%s/%s", Api::addUriParam($uri, $this->getName()), 'vertex');
$response = $connection->post($uri, ['collection' => $collection]);
$this->orphanCollections[] = $collection;
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
$databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
throw $databaseException;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addOrphanCollection($graph, $orphanCollection)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);\n $data = [\n self::OPTION_COLLECTION => $orphanCollection\n ];\n\n try {\n $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data));\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n $data = $response->getJson();\n\n $options['_isNew'] = false;\n\n $result = Graph::createFromArray($data['graph'], $options);\n $result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);\n\n return $result;\n }",
"public function attachVertexToGraph($graph, $document, string $collection)\n {\n return $this->getGraphHandler()->saveVertex($graph, $document, $collection);\n }",
"public function addCollection(tx_pttools_collection $collection, $preserveIDs = false) {\r\n\t\tforeach ($collection as $key => $item) {\r\n\t\t\t$this->addItem($item, $preserveIDs ? $key : 0);\r\n\t\t}\r\n\t}",
"public function addAll(CollectionInterface $collection): void;",
"public function dropVertexCollection(string $collection, bool $dropCollection = false): bool\n {\n try {\n // For new collections, we don't have any collections on server.\n if ($this->isNew()) {\n return false;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n // Drops the vertex collection on server.\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex', $collection);\n $uri = Api::addQuery($uri, ['dropCollection' => $dropCollection]);\n $response = $connection->delete($uri);\n $data = json_decode((string)$response->getBody(), true);\n $this->orphanCollections = $data['graph']['orphanCollections'];\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"private function assertCanAddCollection(Collection $collection)\n\t{\n\t\t$name = $collection->getName();\n\n\t\tif ($this->hasColumn($name)) {\n\t\t\tthrow new DBALException(\\sprintf(\n\t\t\t\t'Cannot use \"%s\" as collection name, column \"%s\" exists in table \"%s\".',\n\t\t\t\t$name,\n\t\t\t\t$name,\n\t\t\t\t$this->getName()\n\t\t\t));\n\t\t}\n\n\t\tif ($this->hasCollection($name)) {\n\t\t\tthrow new DBALException(\\sprintf(\n\t\t\t\t'Cannot override collection \"%s\" in table \"%s\".',\n\t\t\t\t$name,\n\t\t\t\t$this->getName()\n\t\t\t));\n\t\t}\n\n\t\tif ($this->hasRelation($name)) {\n\t\t\tthrow new DBALException(\\sprintf(\n\t\t\t\t'Collection name and relation name conflict for \"%s\" in table \"%\".',\n\t\t\t\t$name,\n\t\t\t\t$this->getName()\n\t\t\t));\n\t\t}\n\n\t\tif ($this->hasVirtualRelation($name)) {\n\t\t\tthrow new DBALException(\\sprintf(\n\t\t\t\t'Collection name and virtual relation name conflict for \"%s\" in table \"%s\".',\n\t\t\t\t$name,\n\t\t\t\t$this->getName()\n\t\t\t));\n\t\t}\n\t}",
"private function checkCollectionExistence($collection) {\n\n if (empty($collection)) {\n throw new PaginatorException(\n PaginatorException::MSG_COLLECTION_NOT_SET,\n PaginatorException::CODE_COLLECTION_NOT_SET\n );\n }\n }",
"public function add($vertex){\n $this->vertices[$vertex->id()] = $vertex;\n }",
"function add_vertex($vertex){\r\n $this->vertices[\"$vertex->id\"]=$vertex;\r\n }",
"public function addcollectionAction() {\n $sort_field = $this->_request->getParam('sort_field');\n $sort_dir = $this->_request->getParam('sort_dir');\n\n if ($sort_field != null) {\n $this->_redirect('bag-it?sort_field=' . $sort_field . '&sort_dir=' . $sort_dir);\n }\n\n $collection_name = $this->_request->collection_name;\n\n if (trim($collection_name) == '') {\n $this->_helper->flashMessenger(\n 'Enter a name for the collection.', 'error'\n );\n\n } else if ($this->_helper->db->getTable('BagitFileCollection')->confirmUniqueName($collection_name)) {\n $collection = new BagitFileCollection;\n $collection->name = $collection_name;\n $collection->save();\n\n } else {\n $this->_helper->flashMessenger(\n 'A collection already exists with that name.', 'error'\n );\n }\n\n $this->_forward('browse', 'collections', 'bag-it');\n }",
"public function addAll(CollectionInterface $collection = NULL) \n {\n $elements = $collection->toArray();\n \n $this->doAddAll($elements);\n\n return true;\n }",
"public function getVertexCollections(): ArrayList\n {\n try {\n // Empty vertex collections for new graphs\n if ($this->isNew()) {\n return new ArrayList();\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex');\n $response = $connection->get($uri);\n $data = json_decode((string)$response->getBody(), true);\n return new ArrayList($data['collections']);\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public function addVertex(string $collection, array $attributes = [], bool $waitForSync = true, bool $returnNew = true): bool\n {\n try {\n // New graphs can't add vertices on server.\n if ($this->isNew()) {\n return false;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex', $collection);\n $uri = Api::addQuery($uri, ['waitForSync' => $waitForSync, 'returnNew' => $returnNew]);\n $response = $connection->post($uri, $attributes);\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n\n if ($exception->getResponse()->getStatusCode() === 404) {\n return false;\n }\n\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public function addCollection(TranslationCollection $collection)\n {\n foreach ($collection->all() as $key => $translation) {\n unset($this->translations[$key]);\n $this->translations[$key] = $translation;\n }\n foreach ($collection->getResources() as $resource) {\n $this->addResource($resource);\n }\n }",
"public function setParentCollection(Collection $collection)\n\t{\n\t\t$this->parentCollection = $collection;\n\t}",
"public function deleteOrphanCollection($graph, $orphanCollection, $dropCollection = false)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $orphanCollection]);\n $data = [\n self::OPTION_DROP_COLLECTION => $dropCollection\n ];\n $url = UrlHelper::appendParamsUrl($url, $data);\n\n try {\n $response = $this->getConnection()->delete($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n $data = $response->getJson();\n\n $options['_isNew'] = false;\n\n $result = Graph::createFromArray($data['graph'], $options);\n $result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);\n\n return $result;\n }",
"public function getVertexCollections($graph, array $options = [])\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $excludeOrphans = false;\n $_useCache = $this->cacheEnabled;\n\n if ((bool) $options && isset($options['excludeOrphans']) && !is_bool($options['excludeOrphans'])) {\n $excludeOrphans = UrlHelper::getBoolString($options['excludeOrphans']);\n }\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['result'])) {\n return $this->cache[$graph]['excludeOrphans']['vertexCollections'];\n }\n\n if (!empty($this->cache[$graph]['vertexCollections'])) {\n return $this->cache[$graph]['vertexCollections'];\n }\n }\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);\n\n if ($excludeOrphans === true) {\n $url = UrlHelper::appendParamsUrl($url, ['excludeOrphans' => $excludeOrphans]);\n }\n\n $connection = $this->getConnection();\n $batchCaptureMode = $connection->isInBatchCaptureMode();\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(false);\n }\n\n try {\n $response = $this->getConnection()->get($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(true);\n }\n\n $data = $response->getJson();\n $data = $data[self::OPTION_COLLECTIONS];\n\n sort($data);\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['vertexCollections'])) {\n $this->cache[$graph]['excludeOrphans']['vertexCollections'] = $data;\n } else {\n $this->cache[$graph]['vertexCollections'] = $data;\n }\n }\n\n return $data;\n }",
"public function addCollectionID($collectionId){\n\t\t$this->collectionIds[] = $collectionId;\n\t}",
"public function collection($collection, $IdItem) {\r\n\t\t//$this->create_relation ( 'pangea:collection', $idLabel [0], $IdItem );\r\n\t\t$this->relateEntityWithConcept ( $collection, $IdItem, 'pangea:hasCollection', 'skosxl:prefLabel', 'pangea:Collection' );\r\n\t}",
"public function saveVertex($graph, $document, $collection = null)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n if (is_array($document)) {\n $_documentClass = $this->_documentClass;\n\n $document = $_documentClass::createFromArray($document);\n }\n\n if ($collection === null) {\n $vertexCollections = $this->getVertexCollections($graph);\n $vertexCollectionsCount = count($vertexCollections);\n if ($vertexCollectionsCount !== 1) {\n throw new ClientException('A collection must be provided.');\n }\n\n if ($vertexCollectionsCount === 1) {\n $collection = $vertexCollections[0];\n }\n }\n\n $data = $document->getAll();\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $collection]);\n\n $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data));\n\n // This makes sure that if we're in batch mode, it will not go further and choke on the checks below.\n // Caution: Instead of a document ID, we are returning the batchpart object.\n // The Id of the BatchPart can be retrieved by calling getId() on it.\n // We're basically returning an object here, in order not to accidentally use the batch part id as the document id\n if ($batchPart = $response->getBatchPart()) {\n return $batchPart;\n }\n\n $jsonArray = $response->getJson();\n $vertex = $jsonArray['vertex'];\n\n $document->setInternalId($vertex[Vertex::ENTRY_ID]);\n $document->setRevision($vertex[Vertex::ENTRY_REV]);\n\n $document->setIsNew(false);\n\n return $document->getInternalId();\n }",
"public function append($collection) { return new Flow([]); }",
"public function setCollection($collection);",
"public function flagCollection()\n {\n $this->collection = true;\n }",
"public function loadCollection(PersistentCollection $collection) {\n $mapping = $collection->getMapping();\n switch ($mapping['association']) {\n case ClassMetadata::EMBED_LIST:\n case ClassMetadata::EMBED_SET:\n case ClassMetadata::EMBED_MAP:\n $this->loadEmbedCollection($collection);\n break;\n\n case ClassMetadata::LINK_LIST:\n case ClassMetadata::LINK_SET:\n case ClassMetadata::LINK_MAP:\n $this->loadReferenceCollection($collection);\n break;\n\n case ClassMetadata::LINK_BAG_EDGE:\n if ($mapping['indirect']) {\n $this->loadIndirectReferenceCollection($collection);\n } else {\n $this->loadReferenceCollection($collection);\n }\n break;\n }\n }",
"public function addCollection(RouteCollection $collection)\n {\n // we need to remove all routes with the same names first because just replacing them\n // would not place the new route at the end of the merged array\n foreach ($collection->all() as $name => $route) {\n unset($this->routes[$name]);\n $this->routes[$name] = $route;\n }\n $this->resources = array_merge($this->resources, $collection->getResources());\n }",
"public function inEdges($collection, $vertexHandle)\n {\n return $this->edges($collection, $vertexHandle, 'in');\n }",
"public function addCollection(RequirementCollection $collection)\n {\n $this->requirements = array_merge($this->requirements, $collection->all());\n }",
"public function addEdgeDefinition(string $collection, array $from, array $to): bool\n {\n try {\n $edgeDefinition = new EdgeDefinition($collection, $from, $to);\n\n // If is a new graph, just add the edge definition to object.\n if ($this->isNew()) {\n $this->edgeDefinitions->push($edgeDefinition);\n return true;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s\", Api::addUriParam($uri, $this->getName()), 'edge');\n $response = $connection->post($uri, $edgeDefinition->toArray());\n $this->edgeDefinitions->push($edgeDefinition);\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public function add($collections)\r\n\t{\r\n\t\tif (self::DEBUG_MODE)\r\n\t\t\tself::out('Adding collections: '.json_encode($collections), self::LEVEL_DEBUG);\r\n\t\t\r\n\t\tif (is_object($collections))\r\n\t\t\t$this->cols[] = $collections;\r\n\t\telseif (is_array($collections))\r\n\t\t{\r\n\t\t\t$peek = current($collections);\r\n\t\t\tif (is_object($peek))\r\n\t\t\t\t$this->cols = array_merge($this->cols, $collections);\r\n\t\t\telse\r\n\t\t\t\t$this->colIDs = array_merge($this->colIDs, $collections);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->colIDs[] = $collections;\r\n\t}",
"public function insertVertex($v){\n $this->adjList[$v] = array(); //create an empty adjacent array for given vertex\n }"
] | [
"0.70613545",
"0.5730936",
"0.55012524",
"0.54561037",
"0.54054195",
"0.5326753",
"0.5301974",
"0.53016853",
"0.52843964",
"0.52665544",
"0.5206283",
"0.51661974",
"0.5148824",
"0.5083717",
"0.5080444",
"0.50792384",
"0.5068876",
"0.5028717",
"0.4982204",
"0.4965647",
"0.49317503",
"0.4894308",
"0.48931116",
"0.4839768",
"0.48186964",
"0.47963485",
"0.4787192",
"0.47866848",
"0.47729465",
"0.4746531"
] | 0.68949807 | 1 |
Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph. It can only remove vertex collections that are no longer part of edge definitions, if they are used in edge definitions you are required to modify those first. | public function dropVertexCollection(string $collection, bool $dropCollection = false): bool
{
try {
// For new collections, we don't have any collections on server.
if ($this->isNew()) {
return false;
}
if (!$this->database) {
throw new DatabaseException("Database not defined");
}
// Drops the vertex collection on server.
$connection = $this->database->getConnection();
$uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);
$uri = sprintf("%s/%s/%s", Api::addUriParam($uri, $this->getName()), 'vertex', $collection);
$uri = Api::addQuery($uri, ['dropCollection' => $dropCollection]);
$response = $connection->delete($uri);
$data = json_decode((string)$response->getBody(), true);
$this->orphanCollections = $data['graph']['orphanCollections'];
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
$databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
throw $databaseException;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeFromGraph();",
"public function removeAll(CollectionInterface $collection): void;",
"public function deleteOrphanCollection($graph, $orphanCollection, $dropCollection = false)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $orphanCollection]);\n $data = [\n self::OPTION_DROP_COLLECTION => $dropCollection\n ];\n $url = UrlHelper::appendParamsUrl($url, $data);\n\n try {\n $response = $this->getConnection()->delete($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n $data = $response->getJson();\n\n $options['_isNew'] = false;\n\n $result = Graph::createFromArray($data['graph'], $options);\n $result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);\n\n return $result;\n }",
"public function removeVertex($graph, $vertexId, $revision = null, array $options = [], $collection = null)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n $parts = explode('/', $vertexId);\n if (count($parts) === 2) {\n list($collection, $vertexId) = $parts;\n }\n\n if ($collection === null) {\n $vertexCollections = $this->getVertexCollections($graph);\n $vertexCollectionsCount = count($vertexCollections);\n if ($vertexCollectionsCount !== 1) {\n throw new ClientException('A collection must be provided.');\n }\n\n if ($vertexCollectionsCount === 1) {\n $collection = $vertexCollections[0];\n }\n }\n\n\n $params = $this->includeOptionsInParams(\n $options, [\n 'waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC),\n 'keepNull' => true,\n 'policy' => $this->getConnectionOption(ConnectionOptions::OPTION_DELETE_POLICY)\n\n ]\n );\n\n if (null !== $revision) {\n $params[ConnectionOptions::OPTION_REVISION] = $revision;\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $collection, $vertexId]);\n $url = UrlHelper::appendParamsUrl($url, $params);\n $this->getConnection()->delete($url);\n\n return true;\n }",
"public function removeAll(CollectionInterface $collection = NULL) \n {\n\n if (is_null($collection)) \n {\n $this->elements = array();\n }\n \n else\n {\n $iterator = $collection->getIterator();\n\n foreach($iterator as $index => $element) \n {\n if ($this->contains($element)) \n {\n while(array_search($element, $this->elements) !== false)\n {\n $this->remove($element);\n }\n }\n }\n }\n\n return true;\n }",
"protected function clearCollection(Collection $collection)\n {\n $null = new ProgramNull();\n foreach ($collection as $entity) {\n if ($entity instanceof \\Application\\Entity\\Base\\HasProgramInterface) {\n $entity->setProgram($null);\n } elseif ($entity instanceof \\Application\\Entity\\Base\\HasMultiProgramInterface) {\n $entity->removeProgram($this);\n }\n }\n // shouldn't be anything to clear, but just in case\n $collection->clear();\n\n return $this;\n }",
"public function deletecollectionAction() {\n $id = $this->_request->id;\n $collection = $this->_helper->db->getTable('BagitFileCollection')->find($id);\n\n // If delete confirmed, do delete.\n if ($this->_request->getParam('confirm') == 'true') {\n $file_associations = $this->_helper->db->getTable('BagitFileCollectionAssociation')\n ->findBySql('collection_id = ?', array($id));\n\n foreach ($file_associations as $assoc) {\n $assoc->delete();\n }\n\n $collection->delete();\n\n $this->_helper->flashMessenger(\n 'Collection \"' . $collection->name . '\" deleted.', 'error'\n );\n $this->_redirect('bag-it/collections');\n\n } else {\n $this->view->collection = $collection;\n }\n }",
"public function clear(): Collection;",
"public function clear() {\n $this->collection = [];\n }",
"public function removeAll(CollectionInterface $collection)\n\t{\n\t\t$changed = false;\n\t\tif($this->size() > $collection->size())\n\t\t{\n\t\t\t$iterator = $collection->iterator();\n\t\t\t\n\t\t\twhile($iterator->hasNext())\n\t\t\t{\n\t\t\t\t$element = $iterator->next();\n\t\t\t\tif($this->contains($element))\n\t\t\t\t{\n\t\t\t\t\t$this->remove($element);\n\t\t\t\t\t$changed = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$iterator = $this->iterator();\n\t\t\t\n\t\t\twhile($iterator->hasNext())\n\t\t\t{\n\t\t\t\t$element = $iterator->next();\n\t\t\t\tif($collection->contains($element))\n\t\t\t\t{\n\t\t\t\t\t$iterator->remove();\n\t\t\t\t\t$changed = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $changed;\n\t}",
"public function addOrphanCollection($graph, $orphanCollection)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);\n $data = [\n self::OPTION_COLLECTION => $orphanCollection\n ];\n\n try {\n $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data));\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n $data = $response->getJson();\n\n $options['_isNew'] = false;\n\n $result = Graph::createFromArray($data['graph'], $options);\n $result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);\n\n return $result;\n }",
"public function removeEdge($graph, $edgeId, $revision = null, array $options = [], $collection = null)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n $parts = explode('/', $edgeId);\n if (count($parts) === 2) {\n list($collection, $edgeId) = $parts;\n }\n\n if ($collection === null) {\n $edgeCollections = $this->getEdgeCollections($graph);\n $edgeCollectionsCount = count($edgeCollections);\n if ($edgeCollectionsCount !== 1) {\n throw new ClientException('A collection must be provided.');\n }\n\n if ($edgeCollectionsCount === 1) {\n $collection = $edgeCollections[0];\n }\n }\n\n $params = $this->includeOptionsInParams(\n $options, [\n 'waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC),\n 'keepNull' => true,\n 'policy' => $this->getConnectionOption(ConnectionOptions::OPTION_DELETE_POLICY),\n ]\n );\n if (null !== $revision) {\n $params[ConnectionOptions::OPTION_REVISION] = $revision;\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_EDGE, $collection, $edgeId]);\n $url = UrlHelper::appendParamsUrl($url, $params);\n $this->getConnection()->delete($url);\n\n return true;\n }",
"public function removeCollection($index)\n {\n $this->collectionsToDetach->push(\n $this->collections[$index]\n );\n $this->collections->forget($index);\n }",
"public function retainAll(CollectionInterface $collection = NULL) \n {\n\n if (is_null($collection)) \n {\n $this->elements = array();\n }\n else\n {\n $elements = array();\n\n $iterator = $collection->getIterator();\n foreach($iterator as $element)\n {\n if(\\in_array($element, $this->elements))\n {\n $elements[] = $element;\n }\n }\n\n $this->elements = $elements;\n }\n\n return true;\n }",
"public function removeEdge(EdgeInterface $edge): void\n {\n foreach ($this->vertexEdges as $key => $e) {\n if ($edge->equals($e)) {\n unset($this->vertexEdges[$key]);\n break;\n }\n }\n }",
"public static function deleteCollection($id)\n\t{\n\t\t$id = static::getId($id);\n\t\t$c = Collection::destroy($id);\n\t\tCollectionProduct::where('collection_id', '=', $id)->delete();\n\t}",
"public function destroy(Collection $collection)\n {\n $collection->delete();\n return redirect()-> route('admin.collections.index');\n }",
"public function deleteCollection(Collection $mediaCollection)\n {\n foreach ($mediaCollection as $media) {\n /** @var Media $media */\n if (!$media->getIsVideoLink())\n $this->uploadedManager->deleteUploadedFile($media->getLink());\n $this->entityManager->remove($media);\n }\n $this->entityManager->flush();\n }",
"public function addVertexCollection(string $collection): bool\n {\n try {\n // For new collections, just add the collection to 'orphanCollections'\n if ($this->isNew()) {\n $this->orphanCollections[] = $collection;\n return true;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n // Adds the vertex collection on server.\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex');\n $response = $connection->post($uri, ['collection' => $collection]);\n $this->orphanCollections[] = $collection;\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"function clearCollectionRun (&$db, &$u, &$arg, &$t ) {\n\t\tunset($u->sessionvars['user_collection']);\n\t\t$this->run( $db, $u, $arg, $t ); \n\t}",
"protected function dropRemovedItems(array $collection = null)\n {\n if ($collection) {\n $this->repository->items()\n ->whereNotIn('menu_items.id', collect($collection)->flatten())\n ->delete();\n }\n }",
"public function IDeleteBehatTestCollection() {\n $drupal_user = user_load($this->getUserManager()->getCurrentUser()->uid);\n $connection = islandora_get_tuque_connection($drupal_user);\n $repository = $connection->repository;\n $object = islandora_object_load($this->behat_test_collection_pid);\n if(empty($object)) {\n throw new Exception(\"Unable to find the behat test collection in order to delete it.\");\n }\n // try {\n // foreach($object as $datastream) {\n // $object->purgeDatastream($datastream->id);\n // }\n // }\n // catch(Exception $e) {\n // echo(\"WARNING: Could not purge test collection datastream: \" . $datastream->id);\n // }\n\n try {\n $repository->purgeObject($this->behat_test_collection_pid);\n }\n catch(Exception $e) {\n throw new Exception(\"Could not purge the behat test collection. Message: \" . $e->getMessage());\n }\n }",
"public function dropGraph($graph, $dropCollections = true)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph]);\n $url = UrlHelper::appendParamsUrl($url, ['dropCollections' => $dropCollections]);\n $this->getConnection()->delete($url);\n\n return true;\n }",
"public function dropEdgeDefinition(string $collection, bool $dropCollection = false, bool $waitForSync = true): bool\n {\n try {\n // If is a new graph, just return 'false'\n // because we don't have any edge collection defined on server.\n if ($this->isNew()) {\n return false;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n // If the database hasn't a collection with the given name, return 'false'\n if (!$this->database->hasCollection($collection)) {\n return false;\n }\n\n // Delete edge definition of graph\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s/%s\", Api::addUriParam($uri, $this->getName()), 'edge', $collection);\n $uri = Api::addQuery($uri, ['waitForSync' => $waitForSync, 'dropCollection' => $dropCollection]);\n $response = $connection->delete($uri);\n\n $toRemove = 0;\n foreach ($this->edgeDefinitions as $key => $edgeDefinition) {\n $toRemove = $edgeDefinition->getCollection() === $collection ? $key : $toRemove;\n }\n\n $this->edgeDefinitions->remove($toRemove);\n\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public function remove($name): CollectionInterface\n {\n unset($this->collection[$name]);\n return $this;\n }",
"public function saveVertex($graph, $document, $collection = null)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n if (is_array($document)) {\n $_documentClass = $this->_documentClass;\n\n $document = $_documentClass::createFromArray($document);\n }\n\n if ($collection === null) {\n $vertexCollections = $this->getVertexCollections($graph);\n $vertexCollectionsCount = count($vertexCollections);\n if ($vertexCollectionsCount !== 1) {\n throw new ClientException('A collection must be provided.');\n }\n\n if ($vertexCollectionsCount === 1) {\n $collection = $vertexCollections[0];\n }\n }\n\n $data = $document->getAll();\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $collection]);\n\n $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data));\n\n // This makes sure that if we're in batch mode, it will not go further and choke on the checks below.\n // Caution: Instead of a document ID, we are returning the batchpart object.\n // The Id of the BatchPart can be retrieved by calling getId() on it.\n // We're basically returning an object here, in order not to accidentally use the batch part id as the document id\n if ($batchPart = $response->getBatchPart()) {\n return $batchPart;\n }\n\n $jsonArray = $response->getJson();\n $vertex = $jsonArray['vertex'];\n\n $document->setInternalId($vertex[Vertex::ENTRY_ID]);\n $document->setRevision($vertex[Vertex::ENTRY_REV]);\n\n $document->setIsNew(false);\n\n return $document->getInternalId();\n }",
"public function testDeletePartnerCollection()\n {\n $partnerId = \"UTEST-DEVICE-SAVEANDLOADPARTNERENTITYCOLLECITON\";\n $dm = $this->getDataMapper();\n\n // Create a partner\n $partner = new EntitySync\\Partner($dm);\n $partner->setPartnerId($partnerId);\n $partner->setOwnerId($this->user->getId());\n\n // Add a collection and save\n $index = $this->account->getServiceManager()->get(\"EntityQuery_Index\");\n $commitManager = $this->account->getServiceManager()->get(\"EntitySyncCommitManager\");\n $collection = new EntitySync\\Collection\\EntityCollection($dm, $commitManager, $index);\n $collection->setPartnerId($partner->getId());\n $collection->setObjType(\"customer\");\n $partner->addCollection($collection);\n $dm->savePartner($partner);\n\n // Now load the parter and delete the collection\n $partner2 = $dm->getPartnerById($partner->getId());\n $collections = $partner2->getCollections();\n $partner2->removeCollection($collections[0]->getId());\n $dm->savePartner($partner2);\n\n // Load it once more and make sure there are no collections\n $partner3 = $dm->getPartnerById($partner->getId());\n $this->assertEquals(0, count($partner3->getCOllections()));\n\n // Cleanup by partner id (second param)\n $dm->deletePartner($partner, true);\n }",
"public function dropVertex(string $collection, string $vertex, bool $waitForSync = true, bool $returnOld = false): bool\n {\n try {\n // New graphs doesn't have vertex on server.\n if ($this->isNew()) {\n return false;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s/%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex', $collection, $vertex);\n $uri = Api::addQuery($uri, ['waitForSync' => $waitForSync, 'returnOld' => $returnOld]);\n\n $response = $connection->delete($uri);\n $data = json_decode((string)$response->getBody(), true);\n return $data['removed'];\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n\n if ($exception->getResponse()->getStatusCode() === 404) {\n return false;\n }\n\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public function getVertexCollections($graph, array $options = [])\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $excludeOrphans = false;\n $_useCache = $this->cacheEnabled;\n\n if ((bool) $options && isset($options['excludeOrphans']) && !is_bool($options['excludeOrphans'])) {\n $excludeOrphans = UrlHelper::getBoolString($options['excludeOrphans']);\n }\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['result'])) {\n return $this->cache[$graph]['excludeOrphans']['vertexCollections'];\n }\n\n if (!empty($this->cache[$graph]['vertexCollections'])) {\n return $this->cache[$graph]['vertexCollections'];\n }\n }\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);\n\n if ($excludeOrphans === true) {\n $url = UrlHelper::appendParamsUrl($url, ['excludeOrphans' => $excludeOrphans]);\n }\n\n $connection = $this->getConnection();\n $batchCaptureMode = $connection->isInBatchCaptureMode();\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(false);\n }\n\n try {\n $response = $this->getConnection()->get($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n if ($batchCaptureMode === true) {\n $this->getConnection()->setBatchRequest(true);\n }\n\n $data = $response->getJson();\n $data = $data[self::OPTION_COLLECTIONS];\n\n sort($data);\n\n if ($_useCache === true) {\n if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['vertexCollections'])) {\n $this->cache[$graph]['excludeOrphans']['vertexCollections'] = $data;\n } else {\n $this->cache[$graph]['vertexCollections'] = $data;\n }\n }\n\n return $data;\n }",
"public function deleteEdgeDefinition($graph, $edgeDefinition, $dropCollection = false)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_EDGE, $edgeDefinition]);\n $data = [\n self::OPTION_DROP_COLLECTION => $dropCollection\n ];\n $url = UrlHelper::appendParamsUrl($url, $data);\n try {\n $response = $this->getConnection()->delete($url);\n } catch (Exception $e) {\n throw new ClientException($e->getMessage());\n }\n\n $data = $response->getJson();\n\n $options['_isNew'] = false;\n\n $result = Graph::createFromArray($data['graph'], $options);\n $result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);\n\n return $result;\n }"
] | [
"0.6501573",
"0.62307817",
"0.6195042",
"0.59537333",
"0.55675566",
"0.5479319",
"0.5359113",
"0.53120095",
"0.531067",
"0.52552044",
"0.5229798",
"0.5216973",
"0.51836973",
"0.51459783",
"0.5124531",
"0.5104122",
"0.5094578",
"0.50348246",
"0.50058085",
"0.49845567",
"0.49707454",
"0.49139804",
"0.49120328",
"0.48757353",
"0.483668",
"0.48313513",
"0.4813212",
"0.48058748",
"0.4799552",
"0.4774053"
] | 0.6280836 | 1 |
Gets a vertex from the given collection. | public function getVertex(string $collection, string $vertex)
{
try {
// New graphs doesn't have vertex on server.
if ($this->isNew()) {
return false;
}
if (!$this->database) {
throw new DatabaseException("Database not defined");
}
$connection = $this->database->getConnection();
$uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);
$uri = sprintf("%s/%s/%s/%s", Api::addUriParam($uri, $this->getName()), 'vertex', $collection, $vertex);
$response = $connection->get($uri);
$data = json_decode((string)$response->getBody(), true);
return new Vertex($data['vertex'], $this->database->getCollection($collection));
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
if ($exception->getResponse()->getStatusCode() === 404) {
return false;
}
$databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
throw $databaseException;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getVertex($graph, $vertexId, array $options = [], $collection = null)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n $parts = explode('/', $vertexId);\n if (count($parts) === 2) {\n list($collection, $vertexId) = $parts;\n }\n\n if ($collection === null) {\n $vertexCollections = $this->getVertexCollections($graph);\n $vertexCollectionsCount = count($vertexCollections);\n if ($vertexCollectionsCount !== 1) {\n throw new ClientException('A collection must be provided.');\n }\n\n if ($vertexCollectionsCount === 1) {\n $collection = $vertexCollections[0];\n }\n }\n\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $collection, $vertexId]);\n $response = $this->getConnection()->get($url);\n\n $jsonArray = $response->getJson();\n $vertex = $jsonArray['vertex'];\n\n $options['_isNew'] = false;\n\n $_documentClass = $this->_documentClass;\n\n return $_documentClass::createFromArray($vertex, $options);\n }",
"public function get($collection);",
"public function get($collection);",
"public function saveVertex($graph, $document, $collection = null)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n if (is_array($document)) {\n $_documentClass = $this->_documentClass;\n\n $document = $_documentClass::createFromArray($document);\n }\n\n if ($collection === null) {\n $vertexCollections = $this->getVertexCollections($graph);\n $vertexCollectionsCount = count($vertexCollections);\n if ($vertexCollectionsCount !== 1) {\n throw new ClientException('A collection must be provided.');\n }\n\n if ($vertexCollectionsCount === 1) {\n $collection = $vertexCollections[0];\n }\n }\n\n $data = $document->getAll();\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $collection]);\n\n $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data));\n\n // This makes sure that if we're in batch mode, it will not go further and choke on the checks below.\n // Caution: Instead of a document ID, we are returning the batchpart object.\n // The Id of the BatchPart can be retrieved by calling getId() on it.\n // We're basically returning an object here, in order not to accidentally use the batch part id as the document id\n if ($batchPart = $response->getBatchPart()) {\n return $batchPart;\n }\n\n $jsonArray = $response->getJson();\n $vertex = $jsonArray['vertex'];\n\n $document->setInternalId($vertex[Vertex::ENTRY_ID]);\n $document->setRevision($vertex[Vertex::ENTRY_REV]);\n\n $document->setIsNew(false);\n\n return $document->getInternalId();\n }",
"public function inEdges($collection, $vertexHandle)\n {\n return $this->edges($collection, $vertexHandle, 'in');\n }",
"public function addVertexCollection(string $collection): bool\n {\n try {\n // For new collections, just add the collection to 'orphanCollections'\n if ($this->isNew()) {\n $this->orphanCollections[] = $collection;\n return true;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n // Adds the vertex collection on server.\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex');\n $response = $connection->post($uri, ['collection' => $collection]);\n $this->orphanCollections[] = $collection;\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public function GetCollection($collection)\n\t{\n\t\treturn $this->mongo_client_db->$collection;\n\t}",
"public function getSingleCollection()\n {\n return $this->sendAPIRequest('GET',\"/collections/{$this->transactionReference}\");\n }",
"public function getByCollection($collection)\n {\n if (isset($this->collections[$collection])) {\n return $this->collections[$collection];\n }\n\n throw new ModelException(sprintf('Model with collection \"%s\" not found', $collection));\n }",
"public function getVertexToStart() : Vertex;",
"public function getEdge(string $collection, string $edge)\n {\n try {\n // New graphs doesn't have edges on server.\n if ($this->isNew()) {\n return false;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s/%s/%s\", Api::addUriParam($uri, $this->getName()), 'edge', $collection, $edge);\n $response = $connection->get($uri);\n $data = json_decode((string)$response->getBody(), true);\n return new Edge($data['edge'], $this->database->getCollection($collection));\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n\n if ($exception->getResponse()->getStatusCode() === 404) {\n return false;\n }\n\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public static function head($collection)\n {\n return \\phln\\collection\\head($collection);\n }",
"public function get($collection = null) {\n return $this->entries($collection);\n }",
"public function get($vertexId){\n return $this->vertices->get($vertexId);\n }",
"private function getFrom(Query $collection)\n {\n return $collection->queryKey('from')[0];\n }",
"public function getVertexCollections(): ArrayList\n {\n try {\n // Empty vertex collections for new graphs\n if ($this->isNew()) {\n return new ArrayList();\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex');\n $response = $connection->get($uri);\n $data = json_decode((string)$response->getBody(), true);\n return new ArrayList($data['collections']);\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"abstract protected function getVertexStart();",
"function add_vertex($vertex){\r\n $this->vertices[\"$vertex->id\"]=$vertex;\r\n }",
"private function getCollectionName(Query $collection): string\n {\n return data_get($this->getFrom($collection), 'collectionId');\n }",
"public function addVertex(string $collection, array $attributes = [], bool $waitForSync = true, bool $returnNew = true): bool\n {\n try {\n // New graphs can't add vertices on server.\n if ($this->isNew()) {\n return false;\n }\n\n if (!$this->database) {\n throw new DatabaseException(\"Database not defined\");\n }\n\n $connection = $this->database->getConnection();\n $uri = Api::buildSystemUri($connection->getBaseUri(), Api::GRAPH);\n $uri = sprintf(\"%s/%s/%s\", Api::addUriParam($uri, $this->getName()), 'vertex', $collection);\n $uri = Api::addQuery($uri, ['waitForSync' => $waitForSync, 'returnNew' => $returnNew]);\n $response = $connection->post($uri, $attributes);\n return true;\n } catch (ClientException $exception) {\n $response = json_decode((string)$exception->getResponse()->getBody(), true);\n\n if ($exception->getResponse()->getStatusCode() === 404) {\n return false;\n }\n\n $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);\n throw $databaseException;\n }\n }",
"public static function fetchFromEloquent(EloquentCollection $collection): array;",
"public function getCollectionSelector(Backbone_Collection $collection, array $options) {\r\n $params = !empty($options['params']) ? $options['params'] : array();\r\n \r\n //Is there some extra url info beyond the collection's own url?\r\n //Assume that the first part is the view name\r\n if (!empty($params['url'])) {\r\n $chunks = explode('/', trim($params['url'],'/'));\r\n $view = array_shift($chunks);\r\n } else {\r\n $view = null;\r\n }\r\n unset($params['url']);\r\n \r\n //Some parameters must be present\r\n $params['include_docs'] = true;\r\n $params['reduce'] = false;\r\n \r\n return array($view, $params);\r\n }",
"function selectCollection($collection_name) {\n\t\t\n\t\t$this->collection = $this->database->selectCollection($collection_name);\n\t}",
"function get_access_collection($collection_id) {\n\tglobal $CONFIG;\n\t$collection_id = (int) $collection_id;\n\n\t$query = \"SELECT * FROM {$CONFIG->dbprefix}access_collections WHERE id = {$collection_id}\";\n\t$get_collection = get_data_row($query);\n\n\treturn $get_collection;\n}",
"function get_label_collection($collection_id) {\n\tglobal $CONFIG;\n\t$collection_id = (int) $collection_id;\n\n\t$query = \"SELECT * FROM {$CONFIG->dbprefix}access_collections WHERE id = {$collection_id}\";\n\t$get_collection = get_data_row($query);\n\n\treturn $get_collection;\n}",
"public function replaceVertex($graph, $vertexId, Document $document, array $options = [], $collection = null)\n {\n if ($graph instanceof Graph) {\n $graph = $graph->getKey();\n }\n\n $parts = explode('/', $vertexId);\n if (count($parts) === 2) {\n list($collection, $vertexId) = $parts;\n }\n\n if ($collection === null) {\n $vertexCollections = $this->getVertexCollections($graph);\n $vertexCollectionsCount = count($vertexCollections);\n if ($vertexCollectionsCount !== 1) {\n throw new ClientException('A collection must be provided.');\n }\n\n if ($vertexCollectionsCount === 1) {\n $collection = $vertexCollections[0];\n }\n }\n\n $options = array_merge([self::OPTION_REVISION => false], $options);\n\n $params = $this->includeOptionsInParams(\n $options, [\n 'waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC),\n 'policy' => $this->getConnectionOption(ConnectionOptions::OPTION_REPLACE_POLICY)\n\n ]\n );\n\n //Include the revision for conditional updates if required\n if ($options[self::OPTION_REVISION] === true) {\n\n $revision = $document->getRevision();\n\n if (null !== $revision) {\n $params[ConnectionOptions::OPTION_REVISION] = $revision;\n }\n } elseif ($options[self::OPTION_REVISION]) {\n $params[ConnectionOptions::OPTION_REVISION] = $options[self::OPTION_REVISION];\n }\n\n $data = $document->getAll();\n $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX, $collection, $vertexId]);\n $url = UrlHelper::appendParamsUrl($url, $params);\n\n $response = $this->getConnection()->put($url, $this->json_encode_wrapper($data));\n\n $jsonArray = $response->getJson();\n $vertex = $jsonArray['vertex'];\n\n $document->setInternalId($vertex[Vertex::ENTRY_ID]);\n $document->setRevision($vertex[Vertex::ENTRY_REV]);\n\n\n return true;\n }",
"public function grabFromCollection($collection, $criteria = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('grabFromCollection', func_get_args()));\n }",
"abstract public function collection($collection);",
"public function add($vertex){\n $this->vertices[$vertex->id()] = $vertex;\n }",
"function tainacan_get_collection() {\n\t$collection_id = tainacan_get_collection_id();\n\tif ( $collection_id ) {\n\t\t$TainacanCollections = Repositories\\Collections::get_instance();\n\t\t$collection = $TainacanCollections->fetch($collection_id);\n\t\tif ( $collection instanceof Entities\\Collection ) {\n\t\t\treturn $collection;\n\t\t}\n\t\treturn false;\n\t}\n}"
] | [
"0.62877905",
"0.6159133",
"0.6159133",
"0.5832315",
"0.57749814",
"0.5500609",
"0.5477948",
"0.5466548",
"0.5378571",
"0.53548926",
"0.52994496",
"0.52961403",
"0.51317114",
"0.5112845",
"0.5103005",
"0.5061192",
"0.5023198",
"0.5006411",
"0.49835435",
"0.48869634",
"0.48828983",
"0.48049527",
"0.48017505",
"0.47937077",
"0.4790675",
"0.4788239",
"0.4775318",
"0.474957",
"0.47186804",
"0.47093785"
] | 0.6994325 | 0 |
Observations function library Prepare the add/edit form variables | function observations_prepare_form_vars($observation = null,
$item_guid = 0,
$referrer = null,
$description = null,
$section = null) {
// input names => defaults
switch ($section) {
case 'Summary':
break;
case 'Details':
break;
case 'Resolution':
break;
case 'Ownership':
break;
case 'Discussion':
break;
case 'Gallery':
break;
default:
$values = array(
'title' => '',
'description' => $description,
'observation_type' => '',
'number' => '',
'observer' => elgg_get_logged_in_user_guid(),
'moment' => $observation->time_created,
'aspect' => 'observation',
'referrer' => $referrer,
'access_id' => ACCESS_DEFAULT,
'write_access_id' => ACCESS_DEFAULT,
'tags' => '',
'container_guid' => elgg_get_page_owner_guid(),
'guid' => null,
'entity' => $observation,
'item_guid' => $item_guid,
'asset' => get_entity($item_guid)->asset,
);
break;
}
if ($observation) {
foreach (array_keys($values) as $field) {
if (isset($observation->$field)) {
$values[$field] = $observation->$field;
}
}
}
if (elgg_is_sticky_form('jot')) {
$sticky_values = elgg_get_sticky_values('jot');
foreach ($sticky_values as $key => $value) {
$values[$key] = $value;
}
}
// elgg_clear_sticky_form('jot');
return $values;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prepareVars()\n {\n $this->vars['dimensions'] = Dimension::all();\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }",
"public function prepareVars()\n {\n $this->vars['id'] = $this->model->id; // Add property of model->id to the vars object, saved as id\n $this->vars['actors'] = Actor::all()->lists('full_name', 'id');\n\n // Name variable for the widget and its array. '[]' indicates we are passing an array of values\n $this->vars['name'] = $this->formField->getName().'[]'; \n\n // Create a variable for the selected values in the model\n // and an if statement in the case the array is empty\n if(!empty($this->getLoadValue())){\n $this->vars['selectedValues'] = $this->getLoadValue(); \n } else {\n $this->vars['selectedValues'] = []; //pass an empty array\n } \n }",
"public function get_submitted_edit_form_data()\n {\n //get the inputed UMS, units and assessments\n// $this->ums = $_POST['ums'];\n }",
"public function prepareVars()\n {\n $this->vars['model'] = $this->model;\n $this->vars['newValue'] = new Value;\n }",
"public function prepareVars()\n {\n $this->vars['formField'] = $this->formField;\n $this->vars['fieldItems'] = $this->processLoadValue() ?? [];\n\n $this->vars['editable'] = $this->editable;\n $this->vars['sortable'] = $this->sortable;\n $this->vars['nameFrom'] = $this->nameFrom;\n $this->vars['partial'] = $this->partial;\n $this->vars['descriptionFrom'] = $this->descriptionFrom;\n $this->vars['sortableInputName'] = $this->sortableInputName;\n $this->vars['newRecordTitle'] = sprintf($this->newRecordTitle, lang($this->formName));\n\n $this->vars['emptyMessage'] = $this->emptyMessage;\n $this->vars['confirmMessage'] = $this->confirmMessage;\n }",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $this->product = $this->vars['product'] = $this->controller->vars['formModel'];\n\n $this->vars['options'] = $this->getOptions();\n }",
"function observation_form($form = null, &$form_state = null, $observation = false, $inventory_id = NULL) {\n\t\n\tglobal $user;\n\t$edit = false;\n\n\tdrupal_set_title(t('Capture a new observation'));\n\t$url = base_path() . 'observation/save';\n\tif ($observation) {\n\t\t$url = base_path() . 'observation/' . $observation['observation']['id']. '/save';\n\t\tif($observation['observation']['organism_id'] == UNKNOWN_SPECIES) {\n\t\t\t$species = t('Unknown species');\n\t\t} else {\n\t\t\t$species = $observation['organism']['name_lat'];\n\t\t\tif (isset($observation['organism']['name_lang']))\n\t\t\t\t$species .= ' / ' . $observation['organism']['name_lang'];\n\t\t}\n\t\tdrupal_set_title(t('Edit observation of <i>@species</i>', array('@species' => check_plain($species))), PASS_THROUGH);\n\t\t$edit = true;\n\t}\n\t// if not edit, set standard values\n\tif (!isset($observation['observation']['id']))\n\t\t$observation['observation']['id'] = '';\n\tif (!isset($observation['observation']['found_as_lang']))\n\t\t$observation['observation']['found_as_lang'] = 'false';\n\tif (!isset($observation['observation']['found_as_lat']))\n\t\t$observation['observation']['found_as_lat'] = 'false';\n\tif (!isset($observation['observation']['organism_artgroup_id'])) {\n\t\t// Assuming artgroup 'all' has the id 1.\n\t\t$observation['observation']['organism_artgroup_id'] = '1';\n\t}\n\tif (!isset($observation['observation']['organism_id']))\n\t\t$observation['observation']['organism_id'] = '';\n\tif (!isset($observation['organism']['name_lat']))\n\t\t$observation['organism']['name_lat'] = '';\n\tif (!isset($observation['organism']['name_lang']))\n\t\t$observation['organism']['name_lang'] = '';\n\tisset($observation['observation']['date'])\n\t\t\t? $timestamp = $observation['observation']['date']\n\t\t\t: $timestamp = time();\n\tif (!isset($observation['observation']['count']))\n\t\t$observation['observation']['count'] = '1';\n\tif (!isset($observation['observation']['observer']))\n\t\t$observation['observation']['observer'] = $user->name;\n\tif (!isset($observation['observation']['organism_artgroup_detmethod_id']))\n\t\t$observation['observation']['organism_artgroup_detmethod_id'] = false;\n\n\tif(!empty($form_state['values']['div']['inventories']['inventory_id'])) {\n\t\t//override inventory_id, user has selected a new one\n\t\t$inventory_id = $form_state['values']['div']['inventories']['inventory_id'];\n\t} else if(isset($observation['observation']['inventory_id'])) {\n\t\t$inventory_id = $observation['observation']['inventory_id'];\n\t}\n\tif(isset($inventory_id)) {\n\t\t$inventory = inventory_get($inventory_id);\n\t} else {\n\t\t$inventory = null;\n\t}\n\t\n\t$area_id = 0;\n\tif(isset($form_state['values']['div']['inventories']['area']) ) {\n\t\t$area_id = $form_state['values']['div']['inventories']['area'];\n\t} else if(isset($inventory['area_id'])) {\n\t\t$area_id = $inventory['area_id'];\n\t}\n\n\t$form_id = \"observation_form\";\n\tmodule_load_include('inc', 'organism', 'organism.artgroup');\n\t\n\t$organism_empty = false;\n\t//determine if a ajax callback was executed by the field artgroup or organism\n\tif(isset($form_state['triggering_element'])) {\n\t\tswitch($form_state['triggering_element']['#id']) {\n\t\t\tcase 'organism_name' :\n\t\t\t\t//set the artgroup of the organism if not yet selected\n\t\t\t\tif($form_state['values']['group']['artgroup_id'] == 1) {\n\t\t\t\t\tif(observation_validate_organism($form_state['values']['group']['organism'])) {\n\t\t\t\t\t\t$artgroup = organism_artgroup_byname($form_state['values']['group']['organism']);\n\t\t\t\t\t\t$artgroup_id = $artgroup['organism_artgroup_id'];\n\t\t\t\t\t}\n\t\t\t\t\telse $artgroup_id = $form_state['values']['group']['artgroup_id'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$artgroup_id = !empty($form_state['values']['group']['artgroup_id']) ? $form_state['values']['group']['artgroup_id'] : 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'artgroup_id' :\n\t\t\t\t//set the artgroup and empty organism field\n\t\t\t\t$artgroup_id = $form_state['input']['group']['artgroup_id'];\n\t\t\t\t$organism_empty = true;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$artgroup_id = !empty($form_state['values']['group']['artgroup_id']) ? $form_state['values']['group']['artgroup_id'] : 1;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\telse if(!$edit) {\n\t\t$artgroup_id = !empty($form_state['values']['group']['artgroup_id']) ? $form_state['values']['group']['artgroup_id'] : 1;\n\t}\n\telse $artgroup_id = !empty($form_state['values']['group']['artgroup_id']) ? $form_state['values']['group']['artgroup_id'] : $observation['observation']['organism_artgroup_id'];\n\t\n\t$form = array();\n\t\n\t$form['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\t\n\t$form['group'] = array(\n\t\t\t'#id' => 'organism_group',\n\t\t\t'#prefix' => '<div id=\"organism_replace\">',\n\t\t\t'#suffix' => '</div>',\n\t\t\t'#tree' => true,\n\t);\t\n\t\n\t//prepare image of organism, only display if organism and artgroup id match\n\t$pictures = '<img src=\"/sites/all/modules/datatable/images/no_photo.png\" />';\n\t\n\tif($artgroup_id) {\n\t\tif(!empty($form_state['values']['group']['organism'])) {\n\t\t\t$artgroup = organism_artgroup_byname($form_state['values']['group']['organism']);\n\t\t\tif($artgroup['organism_artgroup_id'] != $artgroup_id) \n\t\t\t\t$organism_id = null;\n\t\t\telse {\n\t\t\t\t$organism_forimage = organism_get_byname(filter_xss($form_state['values']['group']['organism']));\n\t\t\t\t$organism_id = $organism_forimage['id'];\n\t\t\t}\n\t\t\t} else if(!empty($observation['observation']['organism_id'])) {\n\t\t\t$organism_id = $observation['observation']['organism_id'];\n\t\t}\n\t\telse $organism_id = null;\n\t\tif(isset($organism_id)) {\n\t\t\t$images = gallery_images(GALLERY_MEDIATYPE_IMAGE, 'organismreference', $organism_id);\n\t\t\tif(!empty($images) && $images['count'] > 0) {\n\t\t\t\t$pictures = '';\n\t\t\t\t$img = $images['images'][0];\n\t\t\t\t\t//prepare caption\n\t\t\t\t\t$captionclass = \"caption\";\n\t\t\t\t\t$caption = '';\n\t\t\t\t\tif ($img['title'])\n\t\t\t\t\t\t$caption .= '<strong>' . $img['title'] . '</strong>';\n\t\t\t\t\tif ($caption)\n\t\t\t\t\t\t$caption = '<span class=\"title\">' . $caption . '</span>';\n\t\t\t\t\tif ($img['location'] || $img['author'])\n\t\t\t\t\t\t$caption .= '<span class=\"author\">© ' . $img['author']\n\t\t\t\t\t\t. ($img['location'] ? ', ' . $img['location'] : '')\n\t\t\t\t\t\t. '</span>';\n\n\t\t\t\t\t$caption .= ' <em>'\n\t\t\t\t\t\t\t. organism_reference_gallery_caption($img['item_id']) .' </em>';\n\t\t\t\t\t\n\t\t\t\t\t$imgfooter = '<div class=\"'\n\t\t\t\t\t\t\t\t. $captionclass . '\">'\n\t\t\t\t\t\t\t\t\t\t. ($caption ? '<p class=\"captionText\">' . $caption . '</p>'\n\t\t\t\t\t\t\t\t\t\t\t\t: '').'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$url_large = image_style_url('gallery_large', $img['uri']);\n\t\t\t\t\t$url_preview = image_style_url('gallery_presentation', $img['uri']);\n\t\t\t\t\t\t\n\t\t\t\t\t//only display first image\n\t\t\t\t\t$pictures = '<a href=\"'.$url_large.'\"'.' rel=\"organism_lightbox\"><img src=\"' .$url_preview . '\" alt=\"' . $img['title'] . '\" title=\"' . $img['title'] . '\" />'.$imgfooter.'</a>';\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$checked = isset($form_state['values']['group']['unknown_check']) ? $form_state['values']['group']['unknown_check'] : $observation['observation']['organism_id'] == UNKNOWN_SPECIES ? 1 : 0;\n\n\t$form['group']['unknown_check'] = array(\n\t\t\t'#id' => 'unknown_check',\n\t\t\t'#title' => t('Unkown species?'),\n\t\t\t'#description' => t('Do you need help with determination?'),\n\t\t\t'#type' => 'checkbox',\n\t\t\t'#default_value' => $checked,\n\t\t\t'#tree' => true,\n\t\t\t'#ajax' => array(\n\t\t\t\t\t\t'event' => 'change',\n\t\t\t\t\t\t'callback' => 'observation_unknown_check_callback',\n\t\t\t\t\t\t'wrapper' => 'organism_replace',\n\t\t\t),\n\t);\n\t\n\t$json = 'organism/search/json/'.$artgroup_id;\n\t\n\tif(!empty($pictures)) {\n\t\t$form['group']['organism_image'] = array(\n\t\t\t'#markup' => '\n\t\t\t\t<div class=\"observation_organism_reference_image\">'\n\t\t\t\t\t.$pictures.'\n\t\t\t\t</div>',\t\n\t\t);\n\t}\n\t\n\tif(isset($form_state['values']['group']['organism'])) {\n\t\t$defaultValue = $form_state['values']['group']['organism'];\n\t} else {\n\t\tif($observation['organism']['name_lang'] != \"\") {\n\t\t\t$defaultValue = $observation['organism']['name_lang'];\n\t\t} else {\n\t\t\t$defaultValue = $observation['organism']['name_lat'];\n\t\t}\n\t}\n\t\n\t$form['group']['organism'] = array(\n\t\t\t'#id' => 'organism_name',\n\t\t\t'#title' => t('Search for species'),\n\t\t\t'#type' => 'textfield',\n\t\t\t'#autocomplete_path' => $json,\n\t\t\t'#description' => t('Maximum 30 search results will be showed.'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'placeholder' => t('Start typing to see the species...'),\n\t\t\t),\n\t\t\t'#ajax' => array(\n\t\t\t\t\t\t'event' => 'change',\n\t\t\t\t\t\t'callback' => 'observation_organism_callback',\n\t\t\t\t\t\t'wrapper' => 'organism_replace',\n\t\t\t),\n\t\t\t'#tree' => true,\n\t\t\t'#required' => $checked ? false : true,\n\t\t\t'#disabled' => $checked ? true : false,\n\t\t\t'#default_value' => $defaultValue\n\t\t);\n\n\t$form['group']['date'] = array(\n\t\t\t'#id' => 'date',\n\t\t\t'#title' => t('Date of the observation'),\n\t\t\t'#type' => 'textfield',\n\t\t\t'#attributes' => array('class' => array('datepicker')),\n\t\t\t'#required' => true,\n\t\t\t'#tree' => true,\n\t\t\t'#default_value' => date('d.m.Y', $timestamp),\n\t);\n\t\n\t$form['group']['time'] = array(\n\t\t\t'#id' => 'time',\n\t\t\t'#title' => t('Time of the observation'),\n\t\t\t'#attributes' => array('class' => array('timepicker')),\n\t\t\t'#type' => 'textfield',\n\t\t\t'#required' => true,\n\t\t\t'#tree' => true,\n\t\t\t'#default_value' => date('H:i', $timestamp),\n\t);\n\t\n\t$form['#after_build'] = array('observation_form_add_js_tools');\n\t\n\t$form['group']['count'] = array(\n\t\t\t'#id' => 'count',\n\t\t\t'#title' => t('Count of found individuals'),\n\t\t\t'#type' => 'textfield',\n\t\t\t'#required' => true,\n\t\t\t'#default_value' => $observation['observation']['count'],\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'placeholder' => t('Some text'),\n\t\t\t),\n\t\t\t'#element_validate' => array('element_validate_number'),\n\t\t\t'#tree' => true,\n\t);\n\t$form['group']['observer'] = array(\n\t\t\t'#id' => 'observer',\n\t\t\t'#title' => t('Observer'),\n\t\t\t'#type' => 'textfield',\n\t\t\t'#disabled' => true,\n\t\t\t'#default_value' => $observation['observation']['observer'],\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'placeholder' => t('Some text'),\n\t\t\t),\n\t);\n\n\t$form['group']['details'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Details'),\n\t\t\t'#tree' => true,\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t);\n\t\n\tif($artgroup_id > 1) {\n\t\t$options = organism_artgroup_get_determation_methods($observation['observation']['id'], $artgroup_id);\n\t\tif(!empty($options)) { // don't show determination method if no options\n\t\t\t$form['group']['details']['determination'] = array(\n\t\t\t\t\t'#id' => 'detmethod',\n\t\t\t\t\t'#title' => t('Determination method'),\n\t\t\t\t\t'#type' => 'select',\n\t\t\t\t\t'#options' => \t$options,\n\t\t\t\t\t'#description' => t('Determination Method'),\n\t\t\t\t\t'#default_value' => $observation['observation']['organism_artgroup_detmethod_id'],\n\t\t\t\t\t'#tree' => true,\n\t\t\t);\n\t\t}\n\t\t\n\t\t$observation_attributes = observation_get_attributes($observation['observation']['id'], $artgroup_id);\n\t\tforeach ($observation_attributes as $key => $attribute) {\n\t\t\tif($attribute['type_drupal'] == 'select') {\n\t\t\t\t$form['group']['details']['attributes'][$attribute['id']] = array(\n\t\t\t\t\t\t'#id' => $attribute['id'],\n\t\t\t\t\t\t'#title' => t($attribute['name']),\n\t\t\t\t\t\t'#type' => $attribute['type_drupal'],\n\t\t\t\t\t\t'#weight' =>$attribute['id']+12,\n\t\t\t\t\t\t'#tree' => true,\n\t\t\t\t\t\t'#default_value' => (int)$attribute['value'],\n\t\t\t\t\t\t'#options' => $attribute['options'],\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$form['group']['details']['attributes'][$attribute['id']] = array(\n\t\t\t\t\t\t'#id' => $attribute['id'],\n\t\t\t\t\t\t'#title' => t($attribute['name']),\n\t\t\t\t\t\t'#type' => $attribute['type_drupal'],\n\t\t\t\t\t\t'#weight' =>$attribute['id']+12,\n\t\t\t\t\t\t'#tree' => true,\n\t\t\t\t\t\t'#default_value' => $attribute['value'],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t$form['group']['artgroup_id'] = array(\n\t\t\t'#id' => 'artgroup_id',\n\t\t\t'#title' => t('Filter on species group'),\n\t\t\t'#type' => 'select',\n\t\t\t'#options' => organism_artgroup_get_all_as_array(),\n\t\t\t'#default_value' => $artgroup_id,\n\t\t\t'#ajax' => array(\n\t\t\t\t\t'event' => 'change',\n\t\t\t\t\t'callback' => 'observation_organism_callback',\n\t\t\t\t\t'wrapper' => 'organism_replace'\n\t\t\t),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'artgroup_id'\n\t\t\t),\n\t\t\t'#weight' => -1,\n\t\t\t'#tree' => true,\n\t\t\t'#value' => $artgroup_id\n\t);\n\t\n\t$form['button'] = array(\n\t\t\t'#type' => 'submit',\n\t\t\t'#value' => t('Save'),\n\t\t\t'#submit' => array(\n\t\t\t\t\t'observation_save'\n\t\t\t)\n\t);\n\t\n\t$form['div'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Map'),\n\t\t\t'#tree' => true,\n\t);\n\t\n\tif($edit || $inventory) {\n\t\t$form['div'] += observation_change_inventory_form($area_id, $inventory_id);\n\t}\n\t\n\t/**\n\t * Area map include\n\t */\n\t$form['observation_map'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'coordinate',\n\t\t\t\t\t'name' => 'coordinate',\n\t\t\t\t\t'style' => array(\n\t\t\t\t\t\t\t'display: none;',\n\t\t\t\t\t\t\t'height: 0px;'\n\t\t\t\t\t)\n\t\t\t),\n\t);\n\t\n\t$form['div']['hiddenfields'] = area_address_hidden_form();\n\n\tif(empty($observation['observation']['id'])) {\n\t\tif(!$area_id) {\n\t\t\t$form['div']['map'] = array(\n\t\t\t\t\t'#theme' => 'area',\n\t\t\t\t\t'#mapid' => 'observationmap',\n\t\t\t\t\t'#coordinate_storage_id' => 'coordinate',\n\t\t\t\t\t'#ch1903' => true,\n\t\t\t\t\t'#search' => true,\n\t\t\t\t\t'#height' => '250px',\n\t\t\t\t\t'#action' => 'getcoordinate',\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t//display area of inventory on map\n\t\t\t$form['div']['map'] = array(\n\t\t\t\t\t'#theme' => 'area',\n\t\t\t\t\t'#mapid' => 'observationmap',\n\t\t\t\t\t'#coordinate_storage_id' => 'coordinate',\n\t\t\t\t\t'#ch1903' => true,\n\t\t\t\t\t'#search' => true,\n\t\t\t\t\t'#height' => '250px',\n\t\t\t\t\t'#action' => 'getcoordinate',\n\t\t\t\t\t'#geometry_edit_id' => $area_id,\n\t\t\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t\t\t'#geometries_fetch_url' => base_path() . 'area/' . $area_id . '/json',\n\t\t\t);\n\t\t}\n\t} else {\n\t\t$form['div']['map'] = array(\n\t\t\t\t'#theme' => 'area',\n\t\t\t\t'#mapid' => 'observationmap',\n\t\t\t\t'#coordinate_storage_id' => 'coordinate',\n\t\t\t\t'#ch1903' => true,\n\t\t\t\t'#search' => true,\n\t\t\t\t'#infowindow_content_fetch_url_observation' => base_path() . 'observation/{ID}/overview/ajaxform',\n\t\t\t\t'#infowindow_content_fetch_url_area' => base_path() . 'area/{ID}/areaoverview/ajaxform',\n\t\t\t\t'#geometries_fetch_url' => base_path() . 'observation/'\n\t\t\t\t. $observation['observation']['id'] . '/geometry/json',\n\t\t\t\t'#geometry_edit_id' => $observation['observation']['id'],\n\t\t\t\t'#height' => '350px',\n\t\t\t\t'#action' => 'edit',\n\t\t);\n\t\t\n\t}\n\t// warn when leaving with changes not yet saved\n\t$form['safetynet'] = array(\n\t\t\t'#theme' => 'commonstuff.safetynet'\n\t);\n\n\t/**\n\t * include a upload form for images\n\t */\n\t// Product picture\n\tif ($observation['observation']['id'] != '') {\n\t\t$form['picture'] = array(\n\t\t\t\t'#type' => 'fieldset',\n\t\t\t\t'#title' => t('Manage existing media for this observation'),\n\t\t\t\t'#collapsible' => true,\n\t\t\t\t'#collapsed' => false,\n\t\t);\n\t$form['picture']['media_table'] = gallery_implementation_edit_existing_file_list(\n\t\t\t'observation',\n\t\t\t$observation['observation']['id']);\n\t$form['files'] = gallery_implementation_files_table(\n\t\t\t'observation',\n\t\t\t$observation['observation']['id'],\n\t\t\ttrue);\n\t}\n\t$file_extensions = implode(' ', gallery_get_valid_file_extensions());\n\t\n\t$form['media'] = array(\n\t\t'#type'=> 'fieldset',\n\t\t'#title'=> t('Add media for this observation'),\n\t\t'#collapsible' => true,\n\t\t'#collapsed' => false,\n\t\t'#tree' => true,\n\t);\n\t\n\t$numbers = array();\n\t\n\t//unset session on page_refresh\n\tif(!isset($form_state['values']['media']['file_number'])) {\n\t\tunset($_SESSION['files_total']);\n\t}\n\t//store number of files to add in session\n\t$files_total_old = empty($_SESSION['files_total']) ? 0 : $_SESSION['files_total'];\n\t$new_to_add= !empty($form_state['values']['media']['file_number']) ? $form_state['values']['media']['file_number'] : 1;\n\tisset($_SESSION['files_total']) ? $_SESSION['files_total'] += $new_to_add : $_SESSION['files_total'] = $new_to_add;\n\t\n\tfor($i=0; $i <= 10; $i++) {\n\t\t$numbers[$i] = $i;\n\t}\n\t\n\t$form['media']['file_number'] = array(\n\t\t\t'#title' => t('Number of files to add?'),\n\t\t\t'#description' => t('Allowed files endings are: ') . $file_extensions,\n\t\t\t'#type' => 'select',\n\t\t\t'#options' => $numbers,\n\t\t\t'#default_value' => 0,\n\t\t\t'#ajax' => array(\n\t\t\t\t\t'event' => 'change',\n\t\t\t\t\t'callback' => 'observation_add_uploadslot',\n\t\t\t\t\t'wrapper' => 'upload-div',\n\t\t\t\t\t'method' => 'append',\n\t\t\t\t\t'effect' => 'fade',\n\t\t\t),\n\t\t\t'#tree' => true,\n\t);\n\t\n\t$form['media']['upload_div_start'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup'\t=>\t'<div id=\"upload-div\">'\n\t);\n\t\n\t$form['media']['upload'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#tree' => true,\n\t);\n\t\n\tfor ($i=$files_total_old; $i < $_SESSION['files_total']; $i++) {\t\n\t\t$form['media']['upload'][$i] = array(\n\t\t\t'#name' => 'files['.$i.']',\n\t\t\t'#id' => 'file_input'.$i,\n\t\t\t'#type' => 'file',\n\t\t\t'#prefix' => '<div id=\"picture_upload__'.$i.'\">\n\t\t\t\t\t\t <input type=\"text\" style=\"display: none; height: 0px;\" id=\"meta_title\" name=\"meta_title[]\" value=\"\">\n \t\t\t\t\t\t <input type=\"text\" style=\"display: none; height: 0px;\" id=\"meta_description\" name=\"meta_description[]\" value=\"\">\n \t\t\t\t\t <input type=\"text\" style=\"display: none; height: 0px;\" id=\"meta_location\" name=\"meta_location[]\" value=\"\">\n\t\t\t\t\t <input type=\"text\" style=\"display: none; height: 0px;\" id=\"meta_author\" name=\"meta_author[]\" value=\"\">\n\t\t\t\t\t\t',\n\t\t\t'#suffix' => ($i+1 < $_SESSION['files_total']) ? '<a onclick=\"observation.galleryMetaDataDialog($(this).parent());return false;\" > '\t. t('Click here to add details to this file') . '</a><hr></div>' \n\t\t\t\t\t\t\t\t\t\t : '<a onclick=\"observation.galleryMetaDataDialog($(this).parent());return false;\" > '\t. t('Click here to add details to this file') . '</a></div>',\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t'#title' => t('Choose a file'),\n\t\t\t'#size' => 60,\n\t\t\t'#tree' => true,\n\t\t);\n\t}\n\t\n\t\t$form['media']['button'] = array(\n\t\t\t\t'#type' => 'submit',\n\t\t\t\t'#value' => t('Save'),\n\t\t\t\t'#prefix' => '</div>',\n \t\t\t\t'#submit' => array(\n\t\t\t\t\t\t'observation_save'\n\t\t\t\t),\n\t\t\t\t'#tree' => true,\n\t\t);\n\t\n\t/* Hidden fields */\n\t$form['observer'] = array(\n\t\t\t'#type' => 'hidden',\n\t\t\t'#id' => 'observer', \n\t\t\t'#name' => 'observer', \n\t\t\t'#value' => $observation['observation']['observer']\n\t);\n\t\n\t\n\t$form['observation_id'] = array(\n\t\t\t'#type' => 'hidden', \n\t\t\t'#id' => 'observation_id', \n\t\t\t'#name' => 'observation_id', \n\t\t\t'#value' => $observation['observation']['id']\n\t);\n\t\n\tif(isset($observation['observation']['area_geometry_id']))\n\t\t$form['area_geometry_id'] = array('#type' => 'hidden', '#id' => 'area_geometry_id', '#name' => 'area_geometry_id', '#value' => $observation['observation']['area_geometry_id']);\n\t\n\t$form['recent_observation'] = array(\n\t\t\t'#theme' => 'datatable',\n\t\t\t'#header' => observation_get_standard_datatable_headers(9, 'desc'),\n\t\t\t'#title' => t(\n\t\t\t\t'Recently recorded and saved observations (click on a row, to edit an entry)'),\n\t\t\t'#id_table' => DATATABLE_OBSERVATION,\n\t\t\t'#options' => array(\n\t\t\t\t\t'jsonUrl' => base_path()\n\t\t\t\t\t\t\t. \"observation/get/writeable\",\n\t\t\t\t\t'rowClick' => 'rowClick',\n\t\t\t\t\t'rowClickHandler' => \"function rowClick(celDiv, id){jQuery(celDiv).click(function() {\n\t\t\t\t\t\t\t\t\twindow.location.href = Drupal.settings.basePath+'observation/'+id+'/edit';})}\",\n\t\t\t\t\t'rpShowAll' => true,\n\t\t\t\t\t'onSuccessHandler' => 'observation.onTableSuccess',\n\t\t\t\t\t'date' => array(\n\t\t\t\t\t\t\t'dbDateField' => \"o.date\",\n\t\t\t\t\t\t\t'dbDateFieldType' => DBDateFieldType::INTEGER)\n\t\t\t),\n\t\t\t'#weight' => 100,\n\t);\n\n\tif(observation_admin_access($observation)) {\n\t\t$form['acl'] = array(\n\t\t\t\t'#type' => 'fieldset',\n\t\t\t\t'#title' => t('Permissions'),\n\t\t\t\t'#weight' => 99,\n\t\t\t\t'#prefix' => '</form>',\n\t\t\t\t'#collapsible' => true,\n\t\t\t\t'#collapsed' => false,\n\t\t\t\t'#tree' => true,\n\t\t);\n\t\t$form['acl']['content'] = observation_acl_template($observation);\n\t}\n\t\n\treturn $form;\n}",
"function dataplus_get_form_values() {\n global $mode, $dataplusdb;\n\n $template = $dataplusdb->get_template($mode);\n $columns = $dataplusdb->list_dataplus_table_columns(true);\n $functions = dataplus_detail_supporting_functions();\n $actions = dataplus_detail_supporting_actions();\n $infos = dataplus_detail_supporting_record_information();\n\n $defvals = array();\n\n if (empty($template->record)) {\n $defvals = array('record' => dataplus_get_default_view_template());\n } else {\n foreach ($columns as $column) {\n $name = $column->name;\n $label = $column->label;\n\n $template->record = str_replace(\"[[{$name}]]\", \"[[{$label}]]\", $template->record);\n $template->record = str_replace(\"##{$name}##\", \"##{$label}##\", $template->record);\n }\n\n foreach ($actions as $action) {\n $name = $action->name;\n $label = $action->label;\n\n $template->record = str_replace(\"##{$name}##\", \"##{$label}##\", $template->record);\n }\n\n foreach ($infos as $i) {\n $name = $i->name;\n $label = $i->label;\n\n $template->record = str_replace(\"##{$name}##\", \"##{$label}##\", $template->record);\n }\n\n $defvals['record'] = $template->record;\n }\n\n if (empty($template->header)) {\n $defvals['header'] = dataplus_get_default_header();\n } else {\n $defvals['header'] = $template->header;\n }\n\n if (empty($template->footer)) {\n $defvals['footer'] = dataplus_get_default_footer();\n } else {\n $defvals['footer'] = $template->footer;\n }\n\n if (empty($template->comments)) {\n $defvals['comments'] = dataplus_get_default_comments();\n } else {\n $defvals['comments'] = $template->comments;\n }\n\n foreach ($actions as $action) {\n $name = $action->name;\n $label = $action->label;\n\n $defvals['comments'] = str_replace(\"**{$name}**\", \"**{$label}**\", $defvals['comments']);\n }\n\n foreach ($functions as $function) {\n $name = $function->name;\n $label = $function->label;\n\n $defvals['header'] = str_replace(\"##{$name}##\", \"##{$label}##\", $defvals['header']);\n $defvals['footer'] = str_replace(\"##{$name}##\", \"##{$label}##\", $defvals['footer']);\n }\n\n if (empty($template->css)) {\n $defvals['css'] = dataplus_get_default_css();\n } else {\n $defvals['css'] = $template->css;\n }\n\n if (!empty($template->js)) {\n $defvals['javascript'] = $template->js;\n }\n\n if (!empty($template->jsinit)) {\n $defvals['jsinit'] = $template->jsinit;\n }\n\n if (!empty($template->sortorder)) {\n $orders = explode(\",\", $template->sortorder);\n\n for ($i = 0; $i < count($orders); $i++) {\n $orderparts = explode(\" \", $orders[$i]);\n $defvals['sortorder' . ($i + 1)] = $orderparts[0];\n\n if (count($orderparts) == 2) {\n $defvals['sortoption' . ($i + 1)] = $orderparts[1];\n }\n }\n }\n\n return $defvals;\n}",
"function dataplus_get_addrecord_form_values() {\n global $mode, $dataplusdb;\n\n $template = $dataplusdb->get_template($mode);\n $columns = $dataplusdb->list_dataplus_table_columns(true);\n\n $defvals = array();\n\n if (empty($template->record)) {\n $defvals = array('record' => dataplus_get_default_addrecord_template($mode));\n } else {\n foreach ($columns as $column) {\n $name = $column->name;\n $label = $column->label;\n\n $template->record = str_replace(\"[[{$name}]]\", \"[[{$label}]]\", $template->record);\n }\n\n $defvals['record'] = $template->record;\n }\n\n if (empty($template->css)) {\n $defvals['css'] = dataplus_get_default_css();\n } else {\n $defvals['css'] = $template->css;\n }\n\n if (!empty($template->js)) {\n $defvals['javascript'] = $template->js;\n }\n\n if (!empty($template->jsinit)) {\n $defvals['jsinit'] = $template->jsinit;\n }\n\n return $defvals;\n}",
"public function prepareVars()\n {\n $this->vars['field'] = $this->formField;\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $value = $this->getLoadValue();\n $this->vars['hints'] = array_values(self::$hints);\n }",
"public function prepareVars()\n {\n $this->relationModel = $this->getRelationModel();\n\n $this->vars['name'] = $this->formField->getName();\n //dd($this->vars['name']);\n $this->vars['value'] = $this->getLoadValue();\n\n $this->vars['type'] = $this->productable_type;\n $this->vars['model'] = $this->model;\n\n $this->vars['variants'] = $this->getVariants();\n $this->vars['products'] = $this->getProducts();\n }",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n $this->vars['fields'] = $this->controller->vars['formModel']->variant_options;\n }",
"function reload_values() {\n \tif (! is_object($this->form_data)) {\n\t $this->setup();\n \t}\n\t\tfor (reset($this->form_data->elements);\n $elrec = current($this->form_data->elements);\n next($this->form_data->elements))\n {\n $el = $elrec[\"ob\"];\n $el->value = @$_POST[$el->name];\n\t\t\t$vn = $el->name;\n\t\t\tglobal $$vn;\n\t\t\t$$vn = @$_POST[$el->name];\n\t\t}\n\t}",
"public function setVariables()\n {\n \t// Initial sample storage data\n\t\t$this->drugData = array(\n\t\t\t'name' => 'VANCOMYCININ',\n\t\t\t'description' => 'Lets see',\n\t\t);\n\n\t\t\n\t\t// Edition sample data\n\t\t$this->drugUpdate = array(\n\t\t\t'name' => 'VANCOMYCINININ',\n\t\t\t'description' => 'Staphylococci species',\n\t\t);\n }",
"public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.'DisplayName'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['terminalid'] = array(\"name\" => GetLang($this->_languagePrefix.'TerminalId'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'TerminalIdHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['operatorid'] = array(\"name\" => GetLang($this->_languagePrefix.'OperatorId'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'OperatorIdHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}",
"private function loadFormParams() {\n $this->view->params[self::EVENT_TYPES] = $this->getEventsTypes();\n $this->view->params[self::INFRASTRUCTURES_DATA] = $this->getInfrastructuresUrisTypesLabels();\n $this->view->params[self::SENSORS_DATA] = $this->getSensorsUrisTypesLabels();\n }",
"function importParameterVariables()\n{\n if(isset($_POST['param_template']))\n if(!in_array(0,$_POST['param_template']))\n foreach($_POST['param_template'] as $curr_template)\n {\n\t$chosen_templates[] = (int)$curr_template;\n }\n else\n $chosen_templates[] = 0;\n else\n $chosen_templates = array();\n\n if(isset($_POST['param_course']))\n if(!in_array(0,$_POST['param_course']))\n foreach($_POST['param_course'] as $curr_course)\n {\n\t$chosen_courses[] = (int)$curr_course;\n }\n else\n $chosen_courses[] = 0;\n else\n $chosen_courses = array();\n\n if(isset($_POST['param_year']))\n if(!in_array('--Any--',$_POST['param_year']))\n {\n foreach($_POST['param_year'] as $curr_year)\n {\n\t$chosen_years[] = $curr_year;\n }\n }\n else\n $chosen_years[] = '--Any--';\n else\n $chosen_years = array();\n\n\n\n if(isset($_POST['param_term']))\n foreach($_POST['param_term'] as $curr_term)\n {\n $chosen_terms[] = (int)$curr_term;\n }\n else\n $chosen_terms = array();\n\n if(isset($_POST['param_type']))\n foreach($_POST['param_type'] as $curr_type)\n {\n $chosen_types[] = (int)$curr_type;\n }\n else\n $chosen_types = array();\n\n return array('chosen_templates'=>$chosen_templates,\n\t 'chosen_courses'=>$chosen_courses,\n\t 'chosen_terms'=>$chosen_terms,\n\t 'chosen_types'=>$chosen_types,\n\t 'chosen_years'=>$chosen_years);\n}",
"function CrearVariablesOcultas2(&$html_tabla,$table_name,$llaves)\n{\n $keys = explode(\",\",$llaves);\n\n for($i=0;$i < count($keys);$i++){\n $html_tabla .= \"<input type='hidden' name='\".$table_name.\"__\".strtoupper($keys[$i]).\"'>\";\n }\n}",
"function readForm() {\n\t\t$this->ProductID = $this->formHelper(\"ProductID\", 0);\n\t\t$this->ProductNaam = $this->formHelper(\"ProductNaam\", \"\");\n\t\t$this->ProductEenheid = $this->formHelper(\"ProductEenheid\", \"\");\n\t}",
"public function prepareVars()\n {\n $this->vars['field'] = $this->formField;\n $this->vars['value'] = json_encode($this->getLoadValue());\n }",
"protected function makeEditForm()\t{\n\t\tglobal $BE_USER,$LANG,$TCA;\n\n\t\t// Initialize variables:\n\t\t$this->elementsData=array();\n\t\t$this->errorC=0;\n\t\t$this->newC=0;\n\t\t$thePrevUid='';\n\t\t$editForm='';\n\t\t$trData = NULL;\n\t\t\n\t\t// Traverse the GPvar edit array\n\t\tforeach($this->editconf as $table => $conf)\t{\t// Tables:\n\t\t\t\n\t\t\tif (is_array($conf) && $TCA[$table] && $BE_USER->check('tables_modify',$table))\t{\n\n\t\t\t\t\t// Traverse the keys/comments of each table (keys can be a commalist of uids)\n\t\t\t\tforeach($conf as $cKey => $cmd)\t{\n\t\t\t\t\tif ($cmd=='edit' || $cmd=='new')\t{\n\n\t\t\t\t\t\t\t// Get the ids:\n\t\t\t\t\t\t$ids = t3lib_div::trimExplode(',',$cKey,1);\n\n\n\t\t\t\t\t\t// Traverse the ids:\n\t\t\t\t\t\tforeach($ids as $theUid)\t{\n\n\t\t\t\t\t\t\t\t// Checking if the user has permissions? (Only working as a precaution, because the final permission check is always down in TCE. But it's good to notify the user on beforehand...)\n\t\t\t\t\t\t\t\t// First, resetting flags.\n\t\t\t\t\t\t\t$hasAccess = 1;\n\t\t\t\t\t\t\t$deniedAccessReason = '';\n\t\t\t\t\t\t\t$deleteAccess = 0;\n\t\t\t\t\t\t\t$this->viewId = 0;\n\n\t\t\t\t\t\t\t\t// If the command is to create a NEW record...:\n\t\t\t\t\t\t\tif ($cmd=='new')\t{\n\t\t\t\t\t\t\t\tif (intval($theUid))\t{\t\t// NOTICE: the id values in this case points to the page uid onto which the record should be create OR (if the id is negativ) to a record from the same table AFTER which to create the record.\n\n\t\t\t\t\t\t\t\t\t\t// Find parent page on which the new record reside\n\t\t\t\t\t\t\t\t\tif ($theUid<0)\t{\t// Less than zero - find parent page\n\t\t\t\t\t\t\t\t\t\t$calcPRec=t3lib_BEfunc::getRecord($table,abs($theUid));\n\t\t\t\t\t\t\t\t\t\t$calcPRec=t3lib_BEfunc::getRecord('pages',$calcPRec['pid']);\n\t\t\t\t\t\t\t\t\t} else {\t// always a page\n\t\t\t\t\t\t\t\t\t\t$calcPRec=t3lib_BEfunc::getRecord('pages',abs($theUid));\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Now, calculate whether the user has access to creating new records on this position:\n\t\t\t\t\t\t\t\t\tif (is_array($calcPRec))\t{\n\t\t\t\t\t\t\t\t\t\t$CALC_PERMS = $BE_USER->calcPerms($calcPRec);\t// Permissions for the parent page\n\t\t\t\t\t\t\t\t\t\tif ($table=='pages')\t{\t// If pages:\n\t\t\t\t\t\t\t\t\t\t\t$hasAccess = $CALC_PERMS&8 ? 1 : 0;\n\t\t\t\t\t\t\t\t\t\t\t#$this->viewId = $calcPRec['pid'];\n\t\t\t\t\t\t\t\t\t\t\t$this->viewId = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$hasAccess = $CALC_PERMS&16 ? 1 : 0;\n\t\t\t\t\t\t\t\t\t\t\t$this->viewId = $calcPRec['uid'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->dontStoreDocumentRef=1;\t\t// Don't save this document title in the document selector if the document is new.\n\t\t\t\t\t\t\t} else {\t// Edit:\n\t\t\t\t\t\t\t\t$calcPRec = t3lib_BEfunc::getRecord($table,$theUid);\n\t\t\t\t\t\t\t\tt3lib_BEfunc::fixVersioningPid($table,$calcPRec);\n\t\t\t\t\t\t\t\tif (is_array($calcPRec))\t{\n\t\t\t\t\t\t\t\t\tif ($table=='pages')\t{\t// If pages:\n\t\t\t\t\t\t\t\t\t\t$CALC_PERMS = $BE_USER->calcPerms($calcPRec);\n\t\t\t\t\t\t\t\t\t\t$hasAccess = $CALC_PERMS&2 ? 1 : 0;\n\t\t\t\t\t\t\t\t\t\t$deleteAccess = $CALC_PERMS&4 ? 1 : 0;\n\t\t\t\t\t\t\t\t\t\t$this->viewId = $calcPRec['uid'];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$CALC_PERMS = $BE_USER->calcPerms(t3lib_BEfunc::getRecord('pages',$calcPRec['pid']));\t// Fetching pid-record first.\n\t\t\t\t\t\t\t\t\t\t$hasAccess = $CALC_PERMS&16 ? 1 : 0;\n\t\t\t\t\t\t\t\t\t\t$deleteAccess = $CALC_PERMS&16 ? 1 : 0;\n\t\t\t\t\t\t\t\t\t\t$this->viewId = $calcPRec['pid'];\n\n\t\t\t\t\t\t\t\t\t\t\t// Adding \"&L=xx\" if the record being edited has a languageField with a value larger than zero!\n\t\t\t\t\t\t\t\t\t\tif ($TCA[$table]['ctrl']['languageField'] && $calcPRec[$TCA[$table]['ctrl']['languageField']]>0)\t{\n\t\t\t\t\t\t\t\t\t\t\t$this->viewId_addParams = '&L='.$calcPRec[$TCA[$table]['ctrl']['languageField']];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Check internals regarding access:\n\t\t\t\t\t\t\t\t\tif ($hasAccess)\t{\n\t\t\t\t\t\t\t\t\t\t$hasAccess = $BE_USER->recordEditAccessInternals($table, $calcPRec);\n\t\t\t\t\t\t\t\t\t\t$deniedAccessReason = $BE_USER->errorMsg;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else $hasAccess = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']))\t{\n\t\t\t\t\t\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck'] as $_funcRef)\t{\n\t\t\t\t\t\t\t\t\t$_params = array(\n\t\t\t\t\t\t\t\t\t\t'table' \t=>\t$table,\n\t\t\t\t\t\t\t\t\t\t'uid' \t\t=> \t$theUid,\n\t\t\t\t\t\t\t\t\t\t'cmd' \t\t=> \t$cmd,\n\t\t\t\t\t\t\t\t\t\t'hasAccess' => $hasAccess\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$hasAccess = t3lib_div::callUserFunction($_funcRef, $_params, $this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// AT THIS POINT we have checked the access status of the editing/creation of records and we can now proceed with creating the form elements:\n\n\t\t\t\t\t\t\tif ($hasAccess)\t{\n\t\t\t\t\t\t\t\t$prevPageID = is_object($trData)?$trData->prevPageID:'';\n\t\t\t\t\t\t\t\t$trData = t3lib_div::makeInstance('t3lib_transferData');\n\t\t\t\t\t\t\t\t$trData->addRawData = TRUE;\n\t\t\t\t\t\t\t\t$trData->defVals = $this->defVals;\n\t\t\t\t\t\t\t\t$trData->lockRecords=1;\n\t\t\t\t\t\t\t\t$trData->disableRTE = !$BE_USER->isRTE();\n\t\t\t\t\t\t\t\t$trData->prevPageID = $prevPageID;\n\t\t\t\t\t\t\t\t$trData->fetchRecord($table,$theUid,$cmd=='new'?'new':'');\t// 'new'\n\t\t\t\t\t\t\t\treset($trData->regTableItems_data);\n\t\t\t\t\t\t\t\t$rec = current($trData->regTableItems_data);\n\t\t\t\t\t\t\t\t$rec['uid'] = $cmd=='new' ? uniqid('NEW') : $theUid;\n\t\t\t\t\t\t\t\tif ($cmd=='new')\t{\n\t\t\t\t\t\t\t\t\t$rec['pid'] = $theUid=='prev'?$thePrevUid:$theUid;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->elementsData[]=array(\n\t\t\t\t\t\t\t\t\t'table' => $table,\n\t\t\t\t\t\t\t\t\t'uid' => $rec['uid'],\n\t\t\t\t\t\t\t\t\t'pid' => $rec['pid'],\n\t\t\t\t\t\t\t\t\t'cmd' => $cmd,\n\t\t\t\t\t\t\t\t\t'deleteAccess' => $deleteAccess\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t// Now, render the form:\n\t\t\t\t\t\t\t\tif (is_array($rec))\t{\n\n\t\t\t\t\t\t\t\t\t\t// Setting visual path / title of form:\n\t\t\t\t\t\t\t\t\t$this->generalPathOfForm = $this->tceforms->getRecordPath($table,$rec);\n\t\t\t\t\t\t\t\t\tif (!$this->storeTitle)\t{\n\t\t\t\t\t\t\t\t\t\t$this->storeTitle = $this->recTitle ? htmlspecialchars($this->recTitle) : t3lib_BEfunc::getRecordTitle($table,$rec,TRUE);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Setting variables in TCEforms object:\n\t\t\t\t\t\t\t\t\t$this->tceforms->hiddenFieldList = '';\n\t\t\t\t\t\t\t\t\t$this->tceforms->globalShowHelp = $this->disHelp ? 0 : 1;\n\t\t\t\t\t\t\t\t\tif (is_array($this->overrideVals[$table]))\t{\n\t\t\t\t\t\t\t\t\t\t$this->tceforms->hiddenFieldListArr = array_keys($this->overrideVals[$table]);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Register default language labels, if any:\n\t\t\t\t\t\t\t\t\t$this->tceforms->registerDefaultLanguageData($table,$rec);\n\n\t\t\t\t\t\t\t\t\t\t// Create form for the record (either specific list of fields or the whole record):\n\t\t\t\t\t\t\t\t\t$panel = '';\n\t\t\t\t\t\t\t\t\tif ($this->columnsOnly)\t{\n\t\t\t\t\t\t\t\t\t\tif(is_array($this->columnsOnly)){\n\t\t\t\t\t\t\t\t\t\t\t$panel.= $this->tceforms->getListedFields($table,$rec,$this->columnsOnly[$table]);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$panel.= $this->tceforms->getListedFields($table,$rec,$this->columnsOnly);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$panel.= $this->tceforms->getMainFields($table,$rec);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$panel = $this->tceforms->wrapTotal($panel,$rec,$table);\n\n\t\t\t\t\t\t\t\t\t\t// Setting the pid value for new records:\n\t\t\t\t\t\t\t\t\tif ($cmd=='new')\t{\n\t\t\t\t\t\t\t\t\t\t$panel.= '<input type=\"hidden\" name=\"data['.$table.']['.$rec['uid'].'][pid]\" value=\"'.$rec['pid'].'\" />';\n\t\t\t\t\t\t\t\t\t\t$this->newC++;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Display \"is-locked\" message:\n\t\t\t\t\t\t\t\t\tif ($lockInfo = t3lib_BEfunc::isRecordLocked($table, $rec['uid'])) {\n\t\t\t\t\t\t\t\t\t\t$lockedMessage = t3lib_div::makeInstance(\n\t\t\t\t\t\t\t\t\t\t\t't3lib_FlashMessage',\n\t\t\t\t\t\t\t\t\t\t\thtmlspecialchars($lockInfo['msg']),\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\tt3lib_FlashMessage::WARNING\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tt3lib_FlashMessageQueue::addMessage($lockedMessage);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Combine it all:\n\t\t\t\t\t\t\t\t\t$editForm .= $panel;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$thePrevUid = $rec['uid'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->errorC++;\n\t\t\t\t\t\t\t\t$editForm.=$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.noEditPermission',1).'<br /><br />'.\n\t\t\t\t\t\t\t\t\t($deniedAccessReason ? 'Reason: ' . htmlspecialchars($deniedAccessReason) . '<br /><br />' : '');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $editForm;\n\t}",
"public function formParams();",
"function writeForm($edit, $db, $id=\"\") { \n $data = array();\n $action = \"save\";\n $utils = Utils::getInstance();\n\t$edit = false;\n\t$centroCosto = $utils->getValorDefectoCampo($db,\"Centro de Costo\");\n\t$centroCosto = $utils->getDataEntity(\"centrocosto\", $centroCosto, \"idcentrocosto\"); \n\t$centroBeneficio = $centroCosto[\"codigocentrocosto\"];\n\tif($id!=\"\"){\n\t\t$edit = true;\n\t}\n $actividades = $utils->getAll($db,\"nombre,idactividadEducacionContinuada\",\"actividadEducacionContinuada\",\"codigoestado=100 AND actividadPadre=0\",\"nombre\");\n $nucleos = $utils->getAll($db,\"nombre,idnucleoEstrategico\",\"nucleoEstrategico\",\"codigoestado=100\",\"nombre\");\n $cats = $utils->getAll($db,\"nombre,idcategoriaCursoEducacionContinuada\",\"categoriaCursoEducacionContinuada\",\"codigoestado=100\",\"nombre\"); \n $tipos = $utils->getAll($db,\"nombre,idtipoEducacionContinuada\",\"tipoEducacionContinuada\",\"codigoestado=100\",\"nombre\");\n\t\t$modalidad = $utils->getAll($db,\"nombre,idmodalidadCertificacionEducacionContinuada\",\"modalidadCertificacionEducacionContinuada\",\"codigoestado=100\",\"nombre\"); \n\t\t$tiposC = $utils->getAll($db,\"nombre,idtipoCertificacionEducacionContinuada\",\"tipoCertificacionEducacionContinuada\",\"codigoestado=100\",\"nombre\"); \n\t$valorM = \"\";\n $fechasInscripcion = array();\n if($edit){ \n $data = $utils->getDataEntity(\"carrera\", $id, \"codigocarrera\"); \n\t $centroBeneficio = $data[\"codigocentrobeneficio\"];\n $facultad = $utils->getDataEntity(\"facultad\", $data[\"codigofacultad\"], \"codigofacultad\"); \n $detalleCurso = $utils->getDataEntity(\"detalleCursoEducacionContinuada\", $data[\"codigocarrera\"], \"codigocarrera\"); \n $actividad = $utils->getDataEntity(\"actividadEducacionContinuada\", $detalleCurso[\"actividad\"], \"idactividadEducacionContinuada\"); \n if($actividad[\"actividadPadre\"]==0){\n $actividadPadre = $detalleCurso[\"actividad\"];\n } else {\n $actividadPadre = $actividad[\"actividadPadre\"];\n }\n $materia = $utils->getDataEntity(\"materia\", $data[\"codigocarrera\"], \"codigocarrera\"); \n\t\t$hayDetalle = false;\t \n\t if(count($detalleCurso)>0){\n\t\t$hayDetalle = true;\t\n $categoria = $utils->getDataEntity(\"categoriaCursoEducacionContinuada\", $detalleCurso[\"categoria\"], \"idcategoriaCursoEducacionContinuada\"); \n $ciudad = $utils->getDataEntity(\"ciudad\", $detalleCurso[\"ciudad\"], \"idciudad\"); \n\t }\n\t $action = \"update\";\n \n $valorM = $utils->getValorMatriculaCurso($db, $id); \n $fechasInscripcion = $utils->getFechasInscripcionCurso($db, $id); \n }\n \n ?>\n<div id=\"form\"> \n <form action=\"save.php\" method=\"post\" id=\"form_test\">\n <input type=\"hidden\" name=\"entity\" value=\"carrera\" />\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <?php\n if($edit&&$id!=\"\"){\n echo '<input type=\"hidden\" name=\"codigocarrera\" value=\"'.$id.'\">';\n echo '<input type=\"hidden\" name=\"codigomateria\" value=\"'.$materia[\"codigomateria\"].'\">';\n }\n if($hayDetalle){\n echo '<input type=\"hidden\" name=\"iddetalleCursoEducacionContinuada\" value=\"'.$detalleCurso[\"iddetalleCursoEducacionContinuada\"].'\">';\n }\n ?>\n <span class=\"mandatory\">* Son campos obligatorios</span>\n <fieldset> \n <legend>Información Básica</legend>\n <label for=\"nombre\" class=\"fixed\">Nombre del Programa: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" title=\"Nombre del Curso\" id=\"nombre\" name=\"nombre\" class=\"grid-9-12 required\" maxlength=\"120\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php if($edit){ echo $data['nombrecarrera']; } ?>\" />\n\t\t<span id=\"mensajeBloque\" style=\"font-size:0.7em;display:none;clear:both;position: relative;top: -18px;margin-left:207px\">Ya existe un curso con ese nombre. <br/>¿Estás seguro(a) que no deseas <a href=\"#\" style=\"text-decoration: underline;\">agregar una nueva fecha/versión del curso</a>?</span>\n\t\t\t\t\n <label for=\"codigo\" class=\"fixed\">Facultad:</label>\n <?php $utils->pintarCampoPublico($db,\"Facultad\",$facultad[\"codigofacultad\"]); ?> \n\t\t\t\t\n\t\t\t\t<label for=\"codigo\" class=\"fixed\">Centro de Beneficio: <span class=\"mandatory\">(*)</span></label>\n\t\t\t\t<input type=\"text\" class=\"grid-3-12 required\" name=\"codigocentrobeneficio\" id=\"codigocentrobeneficio\" title=\"Centro de Beneficio\" maxlength=\"150\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php echo $centroBeneficio; ?>\" /> \n \n <label for=\"descripcion\" class=\"fixed\">Tipo de Actividad: <span class=\"mandatory\">(*)</span></label>\n <?php // actividad es el nombre del select, el null es el que esta elegido de la lista, \n //primer true que se deje una opción en blanco, segundo false que no deje elegir múltiples opciones\n\t\t\t//el 1 es si es un listbox o un select, \n\t\t\techo $actividades->GetMenu2('actividadPadre',$actividadPadre,true,false,1,'id=\"actividad\" class=\"grid-3-12 required\"'); ?>\n \n\t\t<label for=\"intensidad\" class=\"fixed\">Intensidad (en horas): <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-1-12 required number\" name=\"intensidad\" id=\"intensidad\" title=\"Duración en horas\" maxlength=\"10\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php echo $detalleCurso[\"intensidad\"]; ?>\" />\n\t\t\t\t\n <label for=\"nucleo\" class=\"fixed\">Núcleo Estratégico: <span class=\"mandatory\">(*)</span></label>\n <?php echo $nucleos->GetMenu2('nucleoEstrategico',$detalleCurso[\"nucleoEstrategico\"],true,false,1,'id=\"nucleoEstrategico\" class=\"grid-3-12 required\"'); ?>\n <div class=\"vacio\"></div>\t \n <label for=\"categoria\" class=\"fixed\">Categoría: <?php if(!$hayDetalle) { ?>\t<span class=\"mandatory\">(*)</span><?php } ?></label>\n <?php if(!$hayDetalle) { ?>\t\n <?php echo $cats->GetMenu2('categoria',$detalleCurso[\"categoria\"],true,false,1,'id=\"categoriaCurso\" class=\"grid-3-12 required\"'); ?>\n <?php } else { ?>\n\t\t\t\t\t\n <span class=\"campoValor\" style=\"font-size:0.9em\"><?php echo $categoria[\"nombre\"]; ?></span><div class=\"vacio\"></div>\n\t\t\t\t\t<input type=\"hidden\" name=\"categoria\" value=\"<?php echo $detalleCurso[\"categoria\"]; ?>\" />\n <?php } ?>\n\t\t\t\t\t\t\t\n <div id=\"ciudadContent\" <?php if($hayDetalle && $detalleCurso[\"categoria\"]==1) { ?> style=\"display:block;\" <?php } else { ?> style=\"display:none;\" <?php } ?>>\n\t\t\t\t<label for=\"ciudad\" class=\"fixed\">Ciudad: <span class=\"mandatory\">(*)</span></label>\n\t\t\t\t<input type=\"text\" class=\"grid-3-12\" minlength=\"2\" name=\"ciudad\" id=\"ciudad\" title=\"ciudad\" maxlength=\"150\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php if($edit){ echo $ciudad['nombreciudad']; } ?>\" />\n\t\t\t\t<input type=\"hidden\" class=\"grid-3-12\" minlength=\"2\" name=\"idciudad\" id=\"idciudad\" maxlength=\"12\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php if($edit){ echo $detalleCurso['ciudad']; } ?>\" />\n <input type=\"hidden\" class=\"grid-3-12\" minlength=\"2\" name=\"tmp_ciudad\" id=\"tmp_ciudad\" value=\"<?php if($edit){ echo $ciudad['nombreciudad']; } ?>\" />\n </div> \n\t\t\t\t<?php if(!$edit) { ?>\t\n\t\t\t\t\n <label for=\"descripcion\" class=\"fixed\">Tipo de Programa: <span class=\"mandatory\">(*)</span></label>\n <?php \techo $tipos->GetMenu2('tipo',null,true,false,1,'id=\"tipo\" class=\"grid-3-12 required\"'); ?>\n \t\n\t\t\t\t<div id=\"inscripciones\" style=\"display:block;\" >\n <label for=\"fechaInicioInscripcion\" class=\"fixed\">Fecha de inicio de inscripciones: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-2-12 required\" name=\"fechaInicioInscripcion\" id=\"fechaInicioInscripcion\" title=\"Fecha de inicio de inscripción\" maxlength=\"100\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php echo $fechasInscripcion[\"inicio\"]; ?>\" readonly=\"readonly\" />\n\n <label for=\"fechaFinalInscripcion\" class=\"fixed\">Fecha final para inscripciones: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-2-12 required\" name=\"fechaFinalInscripcion\" id=\"fechaFinalInscripcion\" title=\"Fecha final de inscripción\" maxlength=\"100\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php echo $fechasInscripcion[\"final\"]; ?>\" readonly=\"readonly\" />\n\n <label for=\"valorMatricula\" class=\"fixed\">Valor matrícula: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-3-12 required number\" name=\"valorMatricula\" id=\"valorMatricula\" title=\"Valor de la matricula\" maxlength=\"30\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php echo $valorM; ?>\" />\n \n <label for=\"fechaFinalMatriculas\" class=\"fixed\">Fecha final para pago matrícula: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-2-12\" name=\"fechaFinalMatriculas\" id=\"fechaFinalMatriculas\" title=\"Fecha final de inscripción\" maxlength=\"100\" tabindex=\"1\" autocomplete=\"off\" value=\"\" readonly=\"readonly\" />\n\t\t\t\t\n\t\t\t\t\t<label for=\"cupoEstudiantes\" class=\"fixed\">Cupo de estudiantes: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-1-12 number <?php echo $required; ?>\" name=\"cupoEstudiantes\" id=\"cupoEstudiantes\" title=\"Cupo de estudiantes permitido\" maxlength=\"10\" tabindex=\"1\" autocomplete=\"off\" value=\"\" />\n\t\t\t\t</div>\n\n <?php } ?> \n\t\t\t\t\t\t\t\n\t\t\t\t<label for=\"descripcion\" class=\"fixed\">Modalidad de Certificación: <span class=\"mandatory\">(*)</span></label>\n <?php \n\t\t\t\t\techo $modalidad->GetMenu2('modalidadCertificacion',$detalleCurso[\"modalidadCertificacion\"],true,false,1,'id=\"modalidadCertificacion\" class=\"grid-3-12 required\"');\n ?> \n\t\t\t\t\t\t\t\n\t\t\t\t<label for=\"descripcion\" class=\"fixed\">Tipo de Certificación: <span class=\"mandatory\">(*)</span></label>\n <?php \n\t\t\t\t\techo $tiposC->GetMenu2('tipoCertificacion',$detalleCurso[\"tipoCertificacion\"],true,false,1,'id=\"tipoCertificacion\" class=\"grid-3-12 required\"');\n ?> \n\t\t\t\t\t\t\t\n\t\t\t\t<div id=\"numCreditos\" <?php if($hayDetalle && $detalleCurso[\"tipoCertificacion\"]==3) { ?> style=\"display:block;\" <?php } else { ?>style=\"display:none\"<?php } ?>>\n\t\t\t\t\t<label for=\"numCreditos\" class=\"fixed\" >Número de Créditos: <?php if(!$hayDetalle) { ?><span class=\"mandatory\">(*)</span><?php } ?></label>\n\t\t\t\t\t<input type=\"text\" class=\"grid-1-12 number\" name=\"numerocreditos\" id=\"numerocreditos\" title=\"Número de créditos\" maxlength=\"10\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php echo $materia[\"numerocreditos\"]; ?>\" />\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class=\"vacio\"></div>\n <label for=\"procentaje\" class=\"fixed\">Porcentaje de Fallas: <span class=\"mandatory\">(*)</span></label>\n\t\t\t\t<?php if($hayDetalle) { ?>\n\t\t\t\t<input type=\"text\" class=\"grid-2-12 required number\" name=\"porcentajeFallasPermitidas\" id=\"porcentajeFallasPermitidas\" title=\"Porcentaje de fallas\" maxlength=\"20\" tabindex=\"1\" autocomplete=\"off\" readonly=\"readonly\" value=\"<?php echo $detalleCurso[\"porcentajeFallasPermitidas\"]; ?>\" />\n <?php } else { \n $utils->pintarCampoPublico($db,\"Porcentaje de Faltas\"); \n\t\t\t\t } ?> \n \n <?php if(!$edit) { ?>\t\n <label for=\"autorizacion\" class=\"fixed\">Autorizado por: <span class=\"mandatory\">(*)</span></label>\n <textarea name=\"autorizacion\" class=\"grid-9-12 required\" style=\"height:60px;\"></textarea>\n <?php } ?>\n\t\t\t\t\t\t\t\t\n\t\t\t\t<label for=\"orden\" class=\"fixed\">¿Permite generar orden automática?: <span class=\"mandatory\">(*)</span></label>\n\t\t\t\t<select class=\"grid-3-12 required\" id=\"generaOrdenAutomatica\" size=\"1\" name=\"generaOrdenAutomatica\">\n\t\t\t\t<option value=\"0\" <?php if ($detalleCurso[\"generaOrdenAutomatica\"]==null || $detalleCurso[\"generaOrdenAutomatica\"]==0){ ?>selected=\"selected\"<?php } ?>>No</option>\n\t\t\t\t<option value=\"1\" <?php if ($detalleCurso[\"generaOrdenAutomatica\"]==1){ ?>selected=\"selected\"<?php } ?>>Si</option>\n\t\t\t\t</select>\n </fieldset>\n\t\t\t<?php if(!$edit) { ?>\n <fieldset id=\"containerAutoComplete\"> \n <legend>Información Detallada</legend>\n \n\t\t\t\t<label for=\"nombre\" class=\"fixed\">Fecha de Inicio: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-2-12 required\" name=\"fechainiciogrupo\" id=\"fechainiciogrupo\" title=\"Fecha de Inicio del Curso\" maxlength=\"20\" tabindex=\"1\" autocomplete=\"off\" readonly=\"readonly\" value=\"<?php if($edit){ echo $data['fecha_prox_monitoreo']; } ?>\" />\n\n <label for=\"nombre\" class=\"fixed\">Fecha de Finalización: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-2-12 required\" name=\"fechafinalgrupo\" id=\"fechafinalgrupo\" title=\"Fecha Final del Curso\" maxlength=\"20\" tabindex=\"1\" autocomplete=\"off\" readonly=\"readonly\" value=\"<?php if($edit){ echo $data['fecha_prox_monitoreo']; } ?>\" />\n\t\t\t\t\n <div class=\"vacio\"></div>\n \n <div id=\"empresas\" style=\"display:none;\">\n <div class=\"empresa\">\n <label for=\"nombre\" class=\"fixed\">Empresa: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-5-12 empresaName\" minlength=\"2\" name=\"empresa[]\" id=\"empresa_1\" title=\"Empresa\" maxlength=\"200\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php if($edit){ echo $data['codigo']; } ?>\" />\n <input type=\"hidden\" class=\"grid-5-12\" minlength=\"2\" name=\"idempresa[]\" id=\"idempresa_1\" maxlength=\"12\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php if($edit){ echo $data['codigo']; } ?>\" />\n <input type=\"hidden\" class=\"grid-5-12\" minlength=\"2\" name=\"tmp_empresa[]\" id=\"tmp_empresa_1\" value=\"<?php if($edit){ echo $data['codigo']; } ?>\" />\n </div>\n \n <button class=\"soft addBtn\" type=\"button\" id=\"btnEmpresas\">Agregar otra empresa</button>\n <input type=\"hidden\" class=\"grid-3-12\" name=\"numEmpresas\" id=\"numEmpresas\" value=\"1\" />\n </div>\n\t\t\t\t\t\t\t\n\t\t\t\t<div class=\"vacio\"></div>\n\t\t\t\t\t\t\t\n\t\t\t\t<div id=\"profesores\">\n <div class=\"profesor\">\n <label for=\"nombre\" class=\"fixed\">Profesor: <span class=\"mandatory\">(*)</span></label>\n <input type=\"text\" class=\"grid-5-12 required profesorName\" minlength=\"2\" name=\"profesor[]\" id=\"profesor_1\" title=\"Profesor\" maxlength=\"200\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php if($edit){ echo $data['codigo']; } ?>\" />\n <input type=\"hidden\" class=\"grid-5-12 idprofesor\" minlength=\"2\" name=\"idprofesor[]\" id=\"idprofesor_1\" maxlength=\"12\" tabindex=\"1\" autocomplete=\"off\" value=\"<?php if($edit){ echo $data['codigo']; } ?>\" />\n </div>\n \n <button class=\"soft addBtn\" type=\"button\" id=\"btnProfesores\">Agregar otro docente</button>\n <input type=\"hidden\" class=\"grid-3-12\" name=\"numProfesores\" id=\"numProfesores\" value=\"1\" />\n </div>\n </fieldset>\n <?php } ?>\n\t\t\t\n <?php if($edit){ ?><input type=\"submit\" value=\"Guardar cambios\" class=\"first\" />\n <?php } else { ?><input type=\"submit\" value=\"Registrar curso\" class=\"first\" /> <?php } ?>\n <img src=\"../images/ajax-loader2.gif\" style=\"display:none;clear:both;margin-bottom:15px;margin-left: 16.4%;\" id=\"loading\"/>\n </form>\n</div>\n<script type=\"text/javascript\" language=\"javascript\" src=\"../js/functionsCursos.js?v=1\"></script> \n<script type=\"text/javascript\">\n $(':submit').click(function(event) {\n event.preventDefault();\n var valido= validateForm(\"#form_test\");\n\t\tif(valido){\n <?php if(!$edit){ ?>\n //validar que la fecha de inicio no sea mayor que la fecha final de inscripcion\n valido = validarCursosGrupo();\n \n <?php } ?> \n \n if(( ($('#categoriaCurso').val()==1 || $('#categoriaCurso').val()==3) && $('#ciudad').val()==\"\")){\n $( \"#ciudad\" ).addClass('error');\n $( \"#ciudad\" ).effect(\"pulsate\", { times:3 }, 500);\n valido = false;\n }\n\t\t\n }\n if(valido){\n sendForm();\n }\n });\t\t\n\t\n\n function sendForm(){\n $(':submit').css(\"display\",\"none\");\n $(\"#loading\").css(\"display\",\"block\");\n $.ajax({\n dataType: 'json',\n type: 'POST',\n url: 'process.php',\n data: $('#form_test').serialize(), \n success:function(data){\n if (data.success == true){\n window.location.href=\"detalle.php?id=\"+data.id;\n }\n else{ \n alert(data.message);\n //$('#msg-error').html('<p>' + data.message + '</p>');\n //$('#msg-error').addClass('msg-error');\n }\n $(':submit').css(\"display\",\"block\");\n $(\"#loading\").css(\"display\",\"none\");\n },\n error: function(data,error,errorThrown){alert(error + errorThrown);}\n }); \n }\n \n $('#nombre').change(function() {\n $.ajax({\n dataType: 'json',\n type: 'POST',\n url: '../searches/existeCurso.php',\n data: { nombre: $('#nombre').val() }, \n success:function(data){\n if (data.result == true){\n $('#mensajeBloque').css('display', 'block');\n $('#mensajeBloque a').attr(\"href\",\"registrarNuevaVersion.php?id=\"+data.id);\n }\n else{ \n $('#mensajeBloque a').attr(\"href\",\"#\");\n $('#mensajeBloque').hide();\n }\n },\n error: function(data,error,errorThrown){alert(error + errorThrown);}\n }); \n });\n \n $('#categoriaCurso').change(function(event) {\n\t\t\t\t\tif($('#categoriaCurso').val()==1 || $('#categoriaCurso').val()==3){\n\t\t\t\t\t\t$('#ciudadContent').css(\"display\",\"block\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#ciudadContent').css(\"display\",\"none\");\n\t\t\t\t\t\t$('#ciudad').val(\"\");\n\t\t\t\t\t\t$('#idciudad').val(\"\"); \n\t\t\t\t\t}\n }); \n\t\t\t\t\n\t\t\t\t$('#tipoCertificacion').change(function(event) {\n\t\t\t\t\tif($('#tipoCertificacion').val()==3){\n\t\t\t\t\t\t$('#numCreditos').css(\"display\",\"block\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#numCreditos').css(\"display\",\"none\");\n\t\t\t\t\t\t$('#numerocreditos').val(\"\"); \n\t\t\t\t\t}\n }); \n\t\t\t\t\n \n $('#tipo').change(function(event) {\n //si es cerrado entonces tiene que haber empresas patrocinadoras\n\t\t\tif($('#tipo').val()==2){\n\t\t\t\t$('#empresas').css(\"display\",\"block\");\n /*$('#inscripciones').css(\"display\",\"none\");\n $('#inscripciones input').each(function() {\n $(this).removeClass(\"required\");\n $(this).removeClass(\"error\");\n $(this).val(\"\");\n\t\t\t\t\t\t\t\t\tif($(this).hasClass(\"number\")){\n\t\t\t\t\t\t\t\t\t\t$(this).val(0);\n\t\t\t\t\t\t\t\t\t}\n }); */\n\t\t\t} else {\n /* $(\"#inscripciones\").css(\"display\",\"block\");\n $('#inscripciones input').each(function() {\n $(this).addClass(\"required\");\n\t\t\t\t\t\t\t\t\tif($(this).hasClass(\"number\")){\n\t\t\t\t\t\t\t\t\t\t$(this).val(\"\");\n\t\t\t\t\t\t\t\t\t}\n }); */\n\t\t\t\t$('#empresas').css(\"display\",\"none\");\n var i = 1;\n $('.empresa').each(function() {\n if(i == 1){\n $('#empresa_1').val(\"\");\n $('#idempresa_1').val(\"\");\n $('#tmp_empresa_1').val(\"\");\n i = 2;\n } else {\n $(this).remove();\n }\n }); \n $(\"#btnEmpresas\").removeClass(\"disable\");\n $( \"#numEmpresas\" ).val(\"1\");\n\t\t\t}\n }); \n \n $(document).ready(function(){\n $('#ciudad').autocomplete({\n source: function( request, response ) {\n $.ajax({\n url: \"../searches/lookForCiudades.php\",\n dataType: \"json\",\n data: {\n term: request.term\n },\n success: function( data ) {\n response( $.map( data, function( item ) {\n return {\n label: item.label,\n value: item.value,\n id: item.id\n }\n }));\n }\n });\n },\n minLength: 2,\n selectFirst: false,\n open: function(event, ui) {\n var maxWidth = $('#form_test').width()-400; \n var width = $(this).autocomplete(\"widget\").width();\n if(width>maxWidth){\n $(\".ui-autocomplete.ui-menu\").width(maxWidth); \n }\n $('#tmp_ciudad').val($('#ciudad').val());\n },\n select: function( event, ui ) {\n //alert(ui.item.id);\n if(ui.item.value==\"null\"){\n event.preventDefault();\n $('#ciudad').val($('#tmp_ciudad').val());\n }\n $('#idciudad').val(ui.item.id);\n } \n });\n });\n\t\t\t\t\n\t$(document).on(\"keyup\",\".empresaName\",function(event){\n var idNumber = $(this).attr(\"id\");\n idNumber = idNumber.split(\"_\");\n idNumber = idNumber[idNumber.length-1];\n \n $(this).autocomplete({\n source: function( request, response ) {\n $.ajax({\n url: \"../searches/lookForEmpresas.php\",\n dataType: \"json\",\n data: {\n term: request.term\n },\n success: function( data ) {\n response( $.map( data, function( item ) {\n return {\n label: item.label,\n value: item.value,\n id: item.id\n }\n }));\n }\n });\n },\n minLength: 2,\n selectFirst: false,\n open: function(event, ui) {\n var maxWidth = $('#form_test').width()-400; \n var width = $(this).autocomplete(\"widget\").width();\n if(width>maxWidth){\n $(\".ui-autocomplete.ui-menu\").width(maxWidth); \n }\n $('#tmp_empresa_'+idNumber).val($('#empresa_'+idNumber).val());\n },\n select: function( event, ui ) {\n //alert(ui.item.id);\n if(ui.item.value==\"null\"){\n event.preventDefault();\n $('#empresa_'+idNumber).val($('#tmp_empresa_'+idNumber).val());\n }\n $('#idempresa_'+idNumber).val(ui.item.id);\n } \n });\n \n });\n \n $(document).ready(function() { \n //para que si es editando traiga las actividades hijas\n getActividadesHijas(<?php echo $actividad[\"idactividadEducacionContinuada\"]; ?>);\n });\n \n </script>\n <?php }",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n $this->vars['updateOptions'] = null;\n\n $data['update'] = false;\n $data['currencySettings'] = [\n 'currencySymbol' => $this->currencyHandler->currencySymbol,\n 'decimalSymbol' => $this->currencyHandler->decimalSymbol,\n 'format' => $this->currencyHandler->format\n ];\n\n if (isset($this->model->id)){\n if($productVariants = ProductVariant::with('attributes.attributegroup')->where('product_id', '=', $this->model->id)->get()->toArray()){\n $data['update'] = true;\n $this->vars['updateOptions'] = array_pluck($productVariants[0]['attributes'], 'attributegroup');\n\n foreach ($productVariants as &$productVariant){\n $productVariant['price'] = $this->currencyHandler->getValueForInput($productVariant['price']);\n }\n\n $data['variants'] = $productVariants;\n $data['backendUrl'] = Backend::url('pixiu/commerce/productvariants/');\n };\n\n }\n\n $this->vars['updateData'] = json_encode($data);\n }",
"function form_init_data()\n {\n // Initialize the form fields\n\n $this->set_hidden_element_value('swimmerid', $this->getSwimmerId()) ;\n $this->set_hidden_element_value('_action', $this->getAction()) ;\n\n if (get_option(WPST_OPTION_OPT_IN_OPT_OUT_MODE) == WPST_PARTIAL)\n $this->set_element_value($this->getActionLabel() . ' Type', WPST_PARTIAL) ;\n else\n $this->set_element_value($this->getActionLabel() . ' Type', WPST_FULL) ;\n }",
"function _edit_var()\n\t{\n\t\t// -------------------------------------\n\t\t// Title and Crumbs\n\t\t// -------------------------------------\n\n\t\t$this->EE->cp->set_variable('cp_page_title', $this->EE->lang->line('edit_variable'));\n\t\t$this->EE->cp->set_breadcrumb($this->base_url, $this->EE->lang->line('low_variables_module_name'));\n\n\t\t// -------------------------------------\n\t\t// Do we have errors in flashdata?\n\t\t// -------------------------------------\n\n\t\t$this->data['errors'] = $this->EE->session->flashdata('errors');\n\n\t\t// -------------------------------------\n\t\t// Get variable groups\n\t\t// -------------------------------------\n\n\t\t$this->data['variable_groups'] = array('0' => '--') + $this->_get_variable_groups();\n\n\t\t// -------------------------------------\n\t\t// Create new, clone or edit?\n\t\t// -------------------------------------\n\n\t\t$var_id = $this->EE->input->get('id');\n\t\t$clone_id = $this->EE->input->get('clone');\n\n\t\tif ($var_id == 'new')\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Init new array if var is new\n\t\t\t// -------------------------------------\n\n\t\t\t$this->data = array_merge($this->data, array(\n\t\t\t\t'variable_id'\t=> 'new',\n\t\t\t\t'group_id'\t\t=> '0',\n\t\t\t\t'variable_name'\t=> '',\n\t\t\t\t'variable_label'=> '',\n\t\t\t\t'variable_notes'=> '',\n\t\t\t\t'variable_type'\t=> LOW_VAR_DEFAULT_TYPE,\n\t\t\t\t'variable_settings' => array(),\n\t\t\t\t'variable_order'=> '0',\n\t\t\t\t'early_parsing'\t=> 'n',\n\t\t\t\t'is_hidden'\t\t=> 'n'\n\t\t\t));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Get var to edit or clone\n\t\t// -------------------------------------\n\n\t\tif ( ($var_id != 'new') || is_numeric($clone_id) )\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Default selection\n\t\t\t// -------------------------------------\n\n\t\t\t$select = array(\n\t\t\t\t\"IF(low.variable_type != '',low.variable_type,'\".$this->EE->db->escape_str(LOW_VAR_DEFAULT_TYPE).\"') AS variable_type\",\n\t\t\t\t'low.group_id',\n\t\t\t\t'low.variable_label',\n\t\t\t\t'low.variable_notes',\n\t\t\t\t'low.variable_settings',\n\t\t\t\t'low.early_parsing',\n\t\t\t\t'low.is_hidden'\n\t\t\t);\n\n\t\t\t// -------------------------------------\n\t\t\t// Select more when editing variable\n\t\t\t// -------------------------------------\n\n\t\t\tif ($var_id != 'new')\n\t\t\t{\n\t\t\t\t$select = array_merge($select, array(\n\t\t\t\t\t'low.variable_order',\n\t\t\t\t\t'ee.variable_id',\n\t\t\t\t\t'ee.variable_name'\n\t\t\t\t));\n\n\t\t\t\t$sql_var_id = $this->EE->db->escape_str($var_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql_var_id = $this->EE->db->escape_str($clone_id);\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Get existing var: compose query and execute\n\t\t\t// -------------------------------------\n\n\t\t\t$sql_select = implode(', ', $select);\n\t\t\t$sql_site_id = $this->EE->db->escape_str($this->EE->config->item('site_id'));\n\n\t\t\t$sql = \"SELECT\n\t\t\t\t\t{$sql_select}\n\t\t\t\tFROM\n\t\t\t\t\texp_global_variables AS ee\n\t\t\t\tLEFT JOIN\n\t\t\t\t\texp_low_variables AS low\n\t\t\t\tON\n\t\t\t\t\tee.variable_id = low.variable_id\n\t\t\t\tWHERE\n\t\t\t\t\tee.site_id = '{$sql_site_id}'\n\t\t\t\tAND\n\t\t\t\t\tee.variable_id = '{$sql_var_id}'\n\t\t\t\tLIMIT 1\n\t\t\t\";\n\t\t\t$query = $this->EE->db->query($sql);\n\n\t\t\t// -------------------------------------\n\t\t\t// Exit if no var was found\n\t\t\t// -------------------------------------\n\n\t\t\tif ($query->num_rows() == 0)\n\t\t\t{\n\t\t\t\t$this->EE->functions->redirect($this->base_url.AMP.'P=manage&message=var_not_found');\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$this->data = array_merge($this->data, $query->row_array());\n\t\t\t$this->data['variable_settings'] = $this->data['variable_settings'] ? $this->_sql_unserialize($this->data['variable_settings']) : array();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Create types\n\t\t// -------------------------------------\n\n\t\tforeach ($this->types AS $type => $obj)\n\t\t{\n\t\t\t// Get current settings\n\t\t\t$settings = isset($this->data['variable_settings'][$type]) ? $this->data['variable_settings'][$type] : $obj->default_settings;\n\n\t\t\t// Call 'display_settings'\n\t\t\t$display = method_exists($obj, 'display_settings') ? $obj->display_settings($this->data['variable_id'], $settings) : array();\n\n\t\t\t$this->data['types'][$type] = array(\n\t\t\t\t'name' => $obj->info['name'],\n\t\t\t\t'settings' => $display\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Load view\n\t\t// -------------------------------------\n\n\t\t$this->_load_assets();\n\n\t\treturn $this->EE->load->view('manage_var', $this->data, TRUE);\n\t}",
"public function cargando_datos_form_3(){\n //donde los atributos ó variables de instancia del mismo\n //representan los campos del formulario.\n //<input name=\"form[nombres]\" ... />\n //<select name=\"form[sexo]\" ... />, etc.\n $this->form->nombres = 'Manuel Aguirre';\n $this->form->edad = 23;\n $this->form->sexo = 'M';\n }",
"function impression_edit_form($data) {\n $impression = new Impression();\n $impression->byID($data['id']);\n $frm = new DbForm();\n $frm->build('impression_edit_form', $impression, $_SESSION['log_access_level']);\n}",
"public function prepareImportVars()\n {\n $this->vars['importUploadFormWidget'] = $this->importUploadFormWidget;\n $this->vars['importOptionsFormWidget'] = $this->importOptionsFormWidget;\n $this->vars['importDbColumns'] = $this->getImportDbColumns();\n $this->vars['importFileColumns'] = $this->getImportFileColumns();\n }",
"function get_data_form(){\n\n $IdHistoria= $_REQUEST['IdHistoria']; //Variable para el id de la historia\n $IdTrabajo = $_REQUEST['IdTrabajo']; //Variable para el id del trabajo\n $TextoHistoria = $_REQUEST['TextoHistoria']; //Variable para el texto de la historia\n $action = $_REQUEST['action']; //Variable action para la accion a realizar\n\n //crea una historia\n $HISTORIA = new HISTORIA_Model(\n $IdTrabajo,\n $IdHistoria,\n $TextoHistoria);\n\n return $HISTORIA;\n }"
] | [
"0.65445244",
"0.6504531",
"0.62436014",
"0.6191197",
"0.6183448",
"0.6169208",
"0.6151911",
"0.61461884",
"0.6081383",
"0.6076226",
"0.6016914",
"0.5987284",
"0.59739155",
"0.593445",
"0.5922386",
"0.5871918",
"0.5852439",
"0.5849576",
"0.57988334",
"0.5790161",
"0.57780606",
"0.57012475",
"0.5689484",
"0.56828845",
"0.5680031",
"0.5675357",
"0.56670696",
"0.56659436",
"0.5658984",
"0.56333655"
] | 0.65393275 | 1 |
Recurses the observation tree and adds the breadcrumbs for all ancestors | function observations_prepare_parent_breadcrumbs($observation) {
if ($observation && $observation->parent_guid) {
$parents = array();
$parent = get_entity($observation->parent_guid);
while ($parent) {
array_push($parents, $parent);
$parent = get_entity($parent->parent_guid);
}
while ($parents) {
$parent = array_pop($parents);
elgg_push_breadcrumb($parent->title, $parent->getURL());
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _setupBreadcrumbs($tree) {\n\t\tforeach ($tree as $item) {\n\t\t\tif ($item['active'] == 1) {\n\t\t\t\tif ($item['module'] != '' || $item['visible'] == 1) {\n\t\t\t\t\t$this->_breadcrumbs[] = $item;\n\t\t\t\t}\n\t\t\t\tif (isset($item['children'])) {\n\t\t\t\t\t$this->_setupBreadcrumbs($item['children']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (count($this->_breadcrumbs) == 0) {\n\t\t\treturn;\n\t\t}\n\t\t$currentItem = $this->_breadcrumbs[count($this->_breadcrumbs) - 1];\n\t\tif (isset($currentItem['independent']) && $currentItem['independent']) {\n\t\t\t$this->_breadcrumbs = array($this->_breadcrumbs[count($this->_breadcrumbs) - 1]);\n\t\t}\n\t}",
"abstract function breadcrumbs();",
"public function ancestors();",
"function observations_register_navigation_tree($container) {\n\tif (!$container) {\n\t\treturn;\n\t}\n\n\t$top_observations = elgg_get_entities(array(\n\t\t'type' => 'object',\n\t\t'subtype' => 'observation_top',\n\t\t'container_guid' => $container->getGUID(),\n\t));\n\n\tforeach ($top_observations as $observation) {\n\t\telgg_register_menu_item('observation_nav', array(\n\t\t\t'name' => $observation->getGUID(),\n\t\t\t'text' => $observation->title,\n\t\t\t'href' => $observation->getURL(),\n\t\t));\n\n\t\t$stack = array();\n\t\tarray_push($stack, $observation);\n\t\twhile (count($stack) > 0) {\n\t\t\t$parent = array_pop($stack);\n\t\t\t$children = elgg_get_entities_from_metadata(array(\n\t\t\t\t'type' => 'object',\n\t\t\t\t'subtype' => 'observation',\n\t\t\t\t'metadata_name' => 'parent_guid',\n\t\t\t\t'metadata_value' => $parent->getGUID(),\n\t\t\t));\n\t\t\t\n\t\t\tforeach ($children as $child) {\n\t\t\t\telgg_register_menu_item('observations_nav', array(\n\t\t\t\t\t'name' => $child->getGUID(),\n\t\t\t\t\t'text' => $child->title,\n\t\t\t\t\t'href' => $child->getURL(),\n\t\t\t\t\t'parent_name' => $parent->getGUID(),\n\t\t\t\t));\n\t\t\t\tarray_push($stack, $child);\n\t\t\t}\n\t\t}\n\t}\n}",
"function jot_prepare_parent_breadcrumbs($item) {\n\tif ($item && $item->parent_guid) {\n\t\t$parents = array();\n\t\t$parent = get_entity($item->parent_guid);\n\t\twhile ($parent) {\n\t\t\tarray_push($parents, $parent);\n\t\t\t$parent = get_entity($parent->parent_guid);\n\t\t}\n\t\twhile ($parents) {\n\t\t\t$parent = array_pop($parents);\n\t\t\t$subtype = $parent->getSubtype();\n\t\t\tif ($parent->type == 'object' ){\n\t\t\t\tif ($subtype == 'market'){\n\t\t\t\t $path = \"market/view/$parent->guid\";\n\t\t\t\t}\n\t\t\t\tif ($subtype == 'jot' \n\t\t\t\t || $subtype == 'issue'\n\t\t\t\t || $subtype == 'cause'\n\t\t\t\t || $subtype == 'observation'\n\t\t\t\t || $subtype == 'insight'\n\t\t\t\t || $subtype == 'effort'\n\t\t\t\t ){\n\t\t\t\t \t$path = \"jot/view/$parent->guid/details\";\n\t\t\t\t }\n\t\t\t}\n\n\t\t\telgg_push_breadcrumb($parent->title, $path);\n//\t\t\telgg_push_breadcrumb($parent->title, $parent->getURL());\n\t\t}\n\t}\n}",
"function backfill_parents()\n {\n }",
"function _set_og_breadcrumbs() {\n // We use the raw path (purl pages do not have system paths).\n $path_elements = explode('/', request_path());\n\n // If the current path contains 2 or less parts and\n // the first part is a Persistent URL.\n if (count($path_elements) <= 2 && $purl = purl_load(\n array(\n 'provider' => 'og_purl|node',\n 'value' => $path_elements[0],\n )\n )) {\n $breadcrumb = array();\n\n // We need to load the group to get the\n // group title to use in the breadcrumb.\n $group = node_load($purl['id']);\n\n // Just have the group title displayed on group pages.\n if (count($path_elements) == 1) {\n $breadcrumb[] = $group->title;\n }\n // This deals with the direct menu items in the group menu.\n else {\n // We use the menu trail to get the titles for the breadcrumb.\n $trail = menu_get_active_trail();\n if (isset($trail[1]['menu_name']) && $trail[1]['menu_name'] == 'c4m-og-menu') {\n // Breadcrumb element linking to the group page.\n $breadcrumb[] = l($group->title, $path_elements[0]);\n $breadcrumb[] = $trail[1]['link_title'];\n }\n }\n\n drupal_set_breadcrumb($breadcrumb);\n }\n}",
"protected function breadcrumb() {\n // nothing\n }",
"function adm_branch_tree($parent,$depth) {\n\tglobal $solu_id,$t,$leaves,$sess,$PHP_SELF;\n\n\t$db = new DB_SourceLines;\n\t$db->query(\"SELECT * FROM tblbranch WHERE branch_parent='$parent' ORDER BY branch_name ASC\");\n\tif ($parent == 0 && $db->num_rows() <= 0) {\n\t\techo \" <b>[<a href=\\\"\";\n\t\techo $sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"action\" => \"add\", \"bran_id\" => 0)).\"\\\">\".$t->translate(\"Add Root\").\"</a>]</b>\";\n\t}\n\twhile($db->next_record()) {\n\t\techo \"<br>\";\n\t\tfor ($i=1; $i<=$depth; $i++) {\n\t\t\techo \"<img src=\\\"images/dirnext.png\\\" alt=\\\".\\\" align=\\\"absbottom\\\"> \";\n\t\t}\n\t\t$isleave = 0;\n\t\t$db_leave = new DB_SourceLines;\n\t\t$query = \"SELECT branch_id FROM tblbranch WHERE branch_parent='\".$db->f(\"branch_id\").\"'\";\n\t\tdebug($query);\n\t\t$db_leave->query($query);\n\t\tdebug($db_leave->num_rows());\n\t\tif ($db_leave->num_rows() <= 0)\n\t\t\t$isleave = 1;\n\t\tif (strstr($leaves, \":\".$db->f(\"branch_id\").\":\")) {\n\t\t\tif ($isleave) {\n\t\t\t\techo \"<img src=\\\"images/dirleave.png\\\" alt=\\\"...\\\" align=\\\"absbottom\\\" border=\\\"0\\\">\";\n\t\t\t} else {\n\t\t\t\techo \"<a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"delid\" => $db->f(\"branch_id\"))).\"\\\">\";\n\t\t\t\techo \"<img src=\\\"images/dirclose.png\\\" alt=\\\"[-]\\\" align=\\\"absbottom\\\" border=\\\"0\\\"></a>\";\n\t\t\t}\n\t\t\techo \" \".$db->f(\"branch_name\");\n\t\t\techo \" (\".$db->f(\"branch_id\").\")\";\n\t\t\techo \" <b>[<a href=\\\"\";\n\t\t\techo $sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"action\" => \"add\", \"bran_id\" => $db->f(\"branch_id\"))).\"\\\">\".$t->translate(\"Add\").\"</a>\";\n\t\t\techo \" | <a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"action\" => \"change\", \"bran_id\" => $db->f(\"branch_id\"), \"name\" => $db->f(\"branch_name\"))).\"\\\">\".$t->translate(\"Change\").\"</a>\";\n\t\t\t$db_par = new DB_SourceLines;\n\t\t\t$db_par->query(\"SELECT * FROM tblbranch WHERE branch_parent='\".$db->f(\"branch_id\").\"'\");\n\t\t\tif ($db_par->num_rows() <= 0)\n\t\t\t\techo \" | <a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"action\" => \"delete\", \"bran_id\" => $db->f(\"branch_id\"), \"name\" => $db->f(\"branch_name\"))).\"\\\">\".$t->translate(\"Delete\").\"</a>\";\n\t\t\techo \"]</b>\\n\";\n\t\t\t$ndepth = $depth + 1;\n\t\t\tadm_branch_tree($db->f(\"branch_id\"),$ndepth);\n\t\t} else {\n\t\t\tif ($isleave) {\n\t\t\t\techo \"<img src=\\\"images/dirleave.png\\\" alt=\\\"...\\\" align=\\\"absbottom\\\" border=\\\"0\\\">\";\n\t\t\t} else {\n\t\t\t\techo \"<a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"addid\" => $db->f(\"branch_id\"))).\"\\\">\";\n\t\t\t\techo \"<img src=\\\"images/diropen.png\\\" alt=\\\"[+]\\\" align=\\\"absbottom\\\" border=\\\"0\\\"></a>\";\n\t\t\t}\n\t\t\techo \" \".$db->f(\"branch_name\");\n\t\t\techo \" (\".$db->f(\"branch_id\").\")\";\n\t\t\techo \" <b>[<a href=\\\"\";\n\t\t\techo $sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"action\" => \"add\", \"bran_id\" => $db->f(\"branch_id\"))).\"\\\">\".$t->translate(\"Add\").\"</a>\";\n\t\t\techo \" | <a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"action\" => \"change\", \"bran_id\" => $db->f(\"branch_id\"), \"name\" => $db->f(\"branch_name\"))).\"\\\">\".$t->translate(\"Change\").\"</a>\";\n\t\t\t$db_par = new DB_SourceLines;\n\t\t\t$db_par->query(\"SELECT * FROM tblbranch WHERE branch_parent='\".$db->f(\"branch_id\").\"'\");\n\t\t\tif ($db_par->num_rows() <= 0)\n\t\t\t\techo \" | <a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"leaves\" => $leaves, \"action\" => \"delete\", \"bran_id\" => $db->f(\"branch_id\"), \"name\" => $db->f(\"branch_name\"))).\"\\\">\".$t->translate(\"Delete\").\"</a>\";\n\t\t\techo \"]</b>\\n\";\n\t\t}\n\t}\n}",
"public function tree() {\n\t\t\t$this->listAll();\n\t\t\tif ($this->return[\"status\"] == \"success\") {\n\t\t\t\t$this->return[\"results\"] = catToTree($this->return[\"results\"],true);\n\t\t\t\t$up = isset($this->req[\"up\"]) ? $this->req[\"up\"] : 0;\n\t\t\t\t$this->return[\"results\"] = $this->return[\"results\"][$up];\n\t\t\t}\n\t\t}",
"function xarpages_treeapi_getancestors($args)\n{\n // Expand the arguments.\n extract($args);\n\n // Database.\n $dbconn = xarDBGetConn();\n\n if ($id <> 0) {\n // Insert point is a real item.\n $query = \"SELECT \n parent.$idname\n FROM \n $tablename AS node, \n $tablename AS parent \n WHERE \n node.xar_left BETWEEN parent.xar_left AND parent.xar_right \n AND \n node.$idname = ? \n ORDER BY \n parent.xar_left\";\n if (isset($rootonly) && $rootonly == true) {\n $query .= \" ASC LIMIT 1\";\n }\n $result = $dbconn->execute($query, array((int)$id));\n\n $ancestors = array();\n\n // return results in order from root to leaf\n while (!$result->EOF) {\n list($pid) = $result->fields;\n $ancestors[] = $pid;\n $result->MoveNext();\n }\n if (count($ancestors) > 0) {\n return $ancestors;\n } else {\n return;\n }\n } else {\n // Insert point is the virtual root, return it\n return array(0);\n }\n}",
"public function ancestorsAndSelf();",
"protected function json_ld_loop()\n\t{\t\t\n\t\t$postion = 1;\n\t\t$breadcrumbs = array();\n\t\t//Loop around our breadcrumbs, call the JSON-LD assembler\n\t\tforeach($this->breadcrumbs as $breadcrumb)\n\t\t{\n\t\t\t$breadcrumbs[] = $breadcrumb->assemble_json_ld($postion);\n\t\t\t$postion++;\n\t\t}\n\t\treturn $breadcrumbs;\n\t}",
"public function resetCrumbs() {\n\t\t$this->_crumbs = [];\n\t}",
"function branch_tree($parent,$depth,$select) {\n\tglobal $solu_id,$leaves,$sess,$PHP_SELF;\n\n\t$db = new DB_SourceLines;\n\t$db->query(\"SELECT * FROM tblbranch WHERE branch_parent='$parent' ORDER BY branch_name ASC\");\n\twhile($db->next_record()) {\n\t\techo \"<br>\";\n\t\tfor ($i=1; $i<=$depth; $i++) {\n\t\t\techo \"<img src=\\\"images/dirnext.png\\\" alt=\\\".\\\" align=\\\"absbottom\\\"> \";\n\t\t}\n\t\t$isleave = 0;\n\t\t$issol = 0;\n\t\t$db_leave = new DB_SourceLines;\n\t\t$db_leave->query(\"SELECT branch_id FROM tblbranch WHERE branch_parent='\".$db->f(\"branch_id\").\"'\");\n\t\tif ($db_leave->num_rows() <= 0) $isleave = 1;\n\t\tif (ereg(\"^[0-9]\",$db->f(\"branch_name\"))) $issol = 1;\n\t\tif (strstr($leaves, \":\".$db->f(\"branch_id\").\":\")) {\n\t\t\techo \"<a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"solu_id\" => $solu_id, \"leaves\" => $leaves, \"delid\" => $db->f(\"branch_id\"))).\"\\\">\";\n\t\t\tif ($isleave)\n\t\t\t\techo \"<img src=\\\"images/dirleave.png\\\" alt=\\\"...\\\" align=\\\"absbottom\\\" border=\\\"0\\\">\";\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"images/dirclose.png\\\" alt=\\\"[-]\\\" align=\\\"absbottom\\\" border=\\\"0\\\">\";\n\t\t\techo \"</a> \";\n\t\t\tif ($select == $db->f(\"branch_id\")) echo \"<b>\";\n\t\t\tif ($issol) echo \"<a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"solu_id\" => $solu_id, \"leaves\" => $leaves, \"action\" => \"db_set\", \"bran_id\" => $db->f(\"branch_id\"))).\"\\\">\";\n\t\t\techo $db->f(\"branch_name\");\n\t\t\tif ($issol) echo \"</a>\";\n\t\t\tdebug (\" (\".$db->f(\"branch_id\").\")\");\n\t\t\tif ($select == $db->f(\"branch_id\")) echo \"</b>\\n\";\n\t\t\t$ndepth = $depth + 1;\n\t\t\tbranch_tree($db->f(\"branch_id\"),$ndepth,$select);\n\t\t} else {\n\t\t\techo \"<a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"solu_id\" => $solu_id, \"leaves\" => $leaves, \"addid\" => $db->f(\"branch_id\"))).\"\\\">\";\n\t\t\tif ($isleave)\n\t\t\t\techo \"<img src=\\\"images/dirleave.png\\\" alt=\\\"...\\\" align=\\\"absbottom\\\" border=\\\"0\\\">\";\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"images/diropen.png\\\" alt=\\\"[+]\\\" align=\\\"absbottom\\\" border=\\\"0\\\">\";\n\t\t\techo \"</a> \";\n\t\t\tif ($select == $db->f(\"branch_id\")) echo \"<b>\";\n\t\t\tif ($issol) echo \"<a href=\\\"\".$sess->url(basename($PHP_SELF)).$sess->add_query(array(\"solu_id\" => $solu_id, \"leaves\" => $leaves, \"action\" => \"db_set\", \"bran_id\" => $db->f(\"branch_id\"))).\"\\\">\";\n\t\t\techo $db->f(\"branch_name\");\n\t\t\tif ($issol) echo \"</a>\";\n\t\t\tdebug (\" (\".$db->f(\"branch_id\").\")\");\n\t\t\tif ($select == $db->f(\"branch_id\")) echo \"</b>\\n\";\n\t\t}\n\t}\n}",
"public function treeUp(): PathCollection\n {\n $oCurrent = clone $this;\n $oPathCollection = new PathCollection();\n $oPathCollection->add($oCurrent);\n while (true)\n {\n if (in_array(\"{$oCurrent}\", [\n \".\",\n \"/\"\n ]))\n {\n return $oPathCollection;\n }\n $oCurrent = $oCurrent->dirname(1);\n $oPathCollection->add($oCurrent);\n }\n\n }",
"public function addBreadcrumb()\n\t{\n\t\tBackend::addPagesBreadcrumb();\n\t}",
"function theme_bc_islandora_breadcrumb(array &$vars) {\n // All breadcrumbs begin with a link to go \"Home\".\n $home_link = l(t('Home'), '/');\n $bc = !in_array($home_link, $vars['breadcrumb']) ? [$home_link] : $vars['breadcrumb'];\n\n // Dealing with node types other than Islandora.\n if (arg(0) == 'node' && is_numeric(arg(1))) {\n $node = menu_get_object();\n // Barnard Islandora Exhibit Module Breadcrumb Handler.\n if ($node->type === 'exhibition') {\n $bc[] = l(t('Exhibits'), 'exhibits');\n return _barnard_islandora_breadcrumbify($bc);\n }\n // If we aren't a solr collection, stop building and return early.\n elseif ($node->type !== 'islandora_solr_content_type') {\n return NULL;\n }\n }\n\n // Barnard Islandora Object Breadcrumb Handler.\n if (arg(2) && $object = islandora_object_load(arg(2))) {\n // The first* breadcrumb for any Islandora Object is \"Collections\".\n // (*not including 'Home' or any predicate breadcrumbs.)\n $bc[] = l(t('Collections'), 'collections');\n\n // We rely on the local identifier from MODS to map our (Barnard's) Record\n // Groups to objects, and therefore the collections they belong to.\n // @see: https://archives.barnard.edu/finding-materials/collections-list\n //\n // Note we later switch to a PID structure that follows our collection list\n // but continue to rely on the MOD's local identifier for backwards compat.\n $mods = isset($object['MODS']) ? simplexml_load_string($object['MODS']->getContent(NULL)) : NULL;\n $menu_active_title = menu_get_active_title();\n\n // We cannot do anything more if we don't have mods.\n if (!$mods) {\n $bc[] = $menu_active_title;\n return _barnard_islandora_breadcrumbify($bc);\n }\n\n // @TODO this is not going to get everything, compound objects and all...\n $current_parent_collection = islandora_get_parents_from_rels_ext($object);\n $current_parent_collection = isset($current_parent_collection[0]) ? $current_parent_collection[0] : 'BC_ISLANDORA-NO-NORMAL-RELATIONSHIP';\n $mods_local_identifier = explode('_', (string) $mods->identifier);\n $barnard_collection_group = preg_replace('/^BC/', '', array_shift($mods_local_identifier));\n\n switch ($barnard_collection_group) {\n\n // Barnard Magazine (Administrative Publications - RG BC11-08)\n case '11-08':\n $bc[] = l(t('Barnard Magazine'), 'barnard-magazine');\n $target_collection = 'BC11-08:0';\n $crumb_for_obj_collection = _barnard_islandora_preceding_crumb_from_object($current_parent_collection, $target_collection);\n if (empty($crumb_for_obj_collection)) {\n $bc[] = $menu_active_title;\n break;\n }\n $bc[] = $crumb_for_obj_collection;\n $bc[] = _barnard_islandora_crumb_truncate($menu_active_title);\n break;\n\n\n // Mortarboard.\n case '12-01':\n $bc[] = l(t('Yearbook'), 'yearbook');\n $target_collection = variable_get('bc_islandora_yearbook_pid', 'islandora:bookCollection');\n $crumb_for_obj_collection = _barnard_islandora_preceding_crumb_from_object($current_parent_collection, $target_collection);\n if (empty($crumb_for_obj_collection)) {\n $bc[] = $menu_active_title;\n break;\n }\n $bc[] = $crumb_for_obj_collection;\n $bc[] = _barnard_islandora_crumb_truncate($menu_active_title);\n break;\n\n // Student Publications.\n case '12-09':\n case '12-26':\n case '12-29':\n case '12-30':\n // XX: End of originally titled \"special pubs\".\n case '12-04':\n case '12-05':\n case '12-06':\n case '12-11':\n case '12-14':\n case '12-17':\n case '12-18':\n case '12-22':\n case '12-23':\n case '12-24':\n case '12-31':\n $bc[] = l(t('Student Publications'), 'student-publications');\n $target_collection = variable_get('bc_islandora_pubs_pid', 'islandora:1022');\n $crumb_for_obj_collection = _barnard_islandora_preceding_crumb_from_object($current_parent_collection, $target_collection);\n if (empty($crumb_for_obj_collection)) {\n $bc[] = $menu_active_title;\n break;\n }\n $bc[] = $crumb_for_obj_collection;\n $bc[] = _barnard_islandora_crumb_truncate($menu_active_title);\n break;\n\n // 12-03, Bulletin.\n case '12-03':\n $bc[] = l(t('Newspaper'), 'bulletin');\n $target_collection = variable_get('bc_islandora_newspaper_pid', 'islandora:74');\n $crumb_for_obj_collection = _barnard_islandora_preceding_crumb_from_object($current_parent_collection, $target_collection);\n if (empty($crumb_for_obj_collection)) {\n $bc[] = $menu_active_title;\n break;\n }\n $bc[] = $crumb_for_obj_collection;\n $bc[] = _barnard_islandora_crumb_truncate($menu_active_title);\n break;\n\n // Barnard Center for Research on Women (BC13-58).\n case '13-58':\n $bc[] = l(t('BCRW'), 'bcrw');\n $target_collection = variable_get('bc_islandora_manuscripts_pid', 'islandora:manuscriptCollection');\n $crumb_for_obj_collection = _barnard_islandora_preceding_crumb_from_object($current_parent_collection, $target_collection);\n if (empty($crumb_for_obj_collection)) {\n $bc[] = $menu_active_title;\n break;\n }\n $bc[] = $crumb_for_obj_collection;\n $bc[] = _barnard_islandora_crumb_truncate($menu_active_title);\n break;\n\n // Barnard Alum Scrapbook and Diary Collection (BC15).\n case '15-02':\n case '15-04':\n case '15-05':\n case '15-06':\n case '15-07':\n case '15-08':\n case '15-09':\n case '15-11':\n case '15-12':\n case '15-14':\n case '15-18':\n case '15-20':\n case '15-28':\n $bc[] = l(t('Alum Scrapbooks'), 'scrapbooks');\n $target_collection = variable_get('bc_islandora_scrapbook_pid', 'BC15:0');\n $crumb_for_obj_collection = _barnard_islandora_preceding_crumb_from_object($current_parent_collection, $target_collection);\n if (empty($crumb_for_obj_collection)) {\n $bc[] = $menu_active_title;\n break;\n }\n $bc[] = $crumb_for_obj_collection;\n // Inclusions of a feather get breadcrumbs together. I was close.\n $compound_parent = $object->relationships->get(FEDORA_RELS_EXT_URI, 'isConstituentOf');\n if (!empty($compound_parent[0]['object']['value']) &&\n $parent = islandora_object_load($compound_parent[0]['object']['value'])) {\n $crumb_for_compound_obj_collection = _barnard_islandora_preceding_crumb_from_object($parent, $target_collection, TRUE, 2);\n }\n if (!empty($crumb_for_compound_obj_collection)) {\n $bc[] = $crumb_for_compound_obj_collection;\n }\n $bc[] = _barnard_islandora_crumb_truncate($menu_active_title, 2);\n break;\n\n default:\n $genre = $mods && isset($mods->genre) ? (string) $mods->genre : NULL;\n\n // Handle photographs.\n // Though photographs is typically Barnard's MODS->genre[0], we\n // need to account for other possibilities.\n // This array contains those possibilities: add as necessary.\n // @SEE: http://islandora:8080/solr/collection1/select?q=RELS_EXT_hasModel_uri_s%3A%22info%3Afedora%2Fislandora%3Asp_large_image_cmodel%22&wt=xml&indent=true&facet=true&facet.field=mods_genre_ms&rows=0\n $photograph_mods_genres = [\n 'photographs',\n 'black-and-white photographs',\n 'portraits',\n 'color photographs',\n ];\n\n if (in_array($genre, $photograph_mods_genres)) {\n $bc[] = l(t('Photographs'), 'photographs');\n break;\n }\n\n // @TODO Maybe revisit this in the future and review.\n // If not a photo, generate links based on relatedItem metadata.\n $links = [];\n foreach ($mods->relatedItem as $ri) {\n if ($host_title = (string) $ri->titleInfo->title) {\n $bc_link = l($host_title, 'islandora/search', [\n 'query' => [\n 'type' => 'dismax',\n 'f[0]' => 'mods_relatedItem_host_titleInfo_title_ms' . ':\"' . $host_title . '\"',\n ],\n ]);\n }\n // Record group.\n if (isset($ri['displayLabel']) && $ri['displayLabel'] == 'Record Group') {\n $links['rg'] = $bc_link;\n }\n // Collection.\n elseif (isset($bc_link)) {\n $links['c'] = $bc_link;\n }\n }\n // Record group precedes collection in breadcrumb sequence.\n $bc[] = isset($links['rg']) ? $links['rg'] : NULL;\n $bc[] = isset($links['c']) ? $links['c'] : NULL;\n break;\n }\n\n }\n return _barnard_islandora_breadcrumbify($bc);\n}",
"static private function _assembleTagTree() {\n\t\t$tagsData = self::_retrieveTagData();\n\n\t\t// reformat the array to name => data\n\t\tforeach ($tagsData as $index => $tagData) {\n\t\t\t$tagsData[$tagData['name']] = $tagData;\n\t\t\tunset($tagsData[$index]);\n\t\t}\n\t\tforeach ($tagsData as $name => $tagData) {\n\t\t\tself::$_upTree[$name] = self::_findRootPath($name, $tagsData);\n\t\t}\n\t}",
"function fielding_breadcrumb() {\n\tfielding_menu( 'main_nav', false, 'breadcrumb', new Fielding_Breadcrumb_Walker() );\n}",
"public function get_breadcrumbs()\n {\n $trail = BreadcrumbTrail::getInstance();\n $this->render($this->array_renderer, 'urhere');\n $breadcrumbs = $this->array_renderer->toArray();\n foreach ($breadcrumbs as $crumb)\n {\n $str = Translation::get('MyRepository');\n if (substr($crumb['title'], 0, strlen($str)) == $str)\n continue;\n $trail->add(new Breadcrumb($crumb['url'], substr($crumb['title'], 0, strpos($crumb['title'], '('))));\n }\n return $trail;\n }",
"function causes_prepare_parent_breadcrumbs($cause) {\n\tif ($cause && $cause->parent_guid) {\n\t\t$parents = array();\n\t\t$parent = get_entity($cause->parent_guid);\n\t\twhile ($parent) {\n\t\t\tarray_push($parents, $parent);\n\t\t\t$parent = get_entity($parent->parent_guid);\n\t\t}\n\t\twhile ($parents) {\n\t\t\t$parent = array_pop($parents);\n\t\t\telgg_push_breadcrumb($parent->title, $parent->getURL());\n\t\t}\n\t}\n}",
"function _{PROFILE_CODE}_setup_crumbs() {\n variable_set('crumbs_show_current_page', TRUE);\n variable_set('crumbs_weights', {PROFILE_CODE}_crumbs_get_info());\n}",
"function shell_breadcrumb(){\r\n\tif ( current_theme_supports( 'breadcrumb-trail' ) ){\r\n\t\tbreadcrumb_trail( array(\r\n\t\t\t'before' => __( 'You are here:', 'shell' ),\r\n\t\t\t'show_browse' => false,\r\n\t\t\t'after' => shell_edit_link()\r\n\t\t));\r\n\t}\r\n}",
"function printTitleBreadcrumb($before = ' | ', $between=' | ', $after = '') {\r\n\tglobal $_zp_gallery, $_zp_current_search, $_zp_current_album, $_zp_last_album;\r\n\t\r\n\tif (in_context(ZP_SEARCH_LINKED)) {\r\n\t\t$dynamic_album = $_zp_current_search->dynalbumname;\r\n\t\tif (empty($dynamic_album)) {\r\n\t\t\techo $before.gettext(\"Search Result\");\r\n\t\t\tif (is_null($_zp_current_album)) {\r\n\t\t\t\techo $after;\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\t$parents = getParentAlbums();\r\n\t\t\t\t//echo $between;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$album = new Album($_zp_gallery, $dynamic_album);\r\n\t\t\t$parents = getParentAlbums($album);\r\n\t\t\tif (in_context(ZP_ALBUM_LINKED)) {\r\n\t\t\t\tarray_push($parents, $album);\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\t$parents = getParentAlbums();\r\n\t}\r\n\t$n = count($parents);\r\n\tif ($n > 0) {\r\n\t\techo $before;\r\n\t\t$i = 0;\r\n\t\tforeach($parents as $parent) {\r\n\t\t\tif ($i > 0) echo $between;\r\n\t\t\techo $parent->getTitle();\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\techo $after;\r\n\t}\r\n}",
"public function get_breadcrumbs() {\n global $post;\n\n $ancestors = array_reverse( $post->ancestors );\n $breadcrumbs = array( sprintf( '<li><a href=\"?page=wpclientref_articles\">%s</a></li>', __( 'Home', 'wpclientref' ) ) );\n foreach ( $ancestors as $ancestor ) {\n $breadcrumbs[] = sprintf( '<li><a href=\"?page=wpclientrefarticles&article_id=%d\">%s</a></li>', $ancestor, get_the_title( $ancestor ) );\n }\n $breadcrumbs[] = sprintf( '<li class=\"current-item\">%s</li>', get_the_title() );\n return sprintf( '<ul class=\"subsubsub breadcrumbs\">%s</ul>', implode( '', $breadcrumbs ) );\n }",
"function hook_menu_breadcrumb_alter(&$active_trail, $item) {\n // Always display a link to the current page by duplicating the last link in\n // the active trail. This means that menu_get_active_breadcrumb() will remove\n // the last link (for the current page), but since it is added once more here,\n // it will appear.\n if (!drupal_is_front_page()) {\n $end = end($active_trail);\n if ($item['href'] == $end['href']) {\n $active_trail[] = $end;\n }\n }\n}",
"function set_breadcrumb($parent_id) {\n\t\t/*if(isset($parent_id) && trim($parent_id)!='') {\n\t\t\t$parentIdDetail = $this->Page->find('first',array('fields'=>array('Page.*'),'conditions'=>array('Page.id' => $parent_id)));\n\t\t\t$this->breadcrumb[$parentIdDetail['Page']['id']] = $parentIdDetail['Page']['title'];\n\t\t\tif(isset($parentIdDetail['Page']['parent_id']) && trim($parentIdDetail['Page']['parent_id'])!='') {\n\t\t\t\t$this->set_breadcrumb($parentIdDetail['Page']['parent_id']);\n\t\t\t}\n\t\t}\t*/\n\t}",
"function hyunmoo_breadcrumb() {\r\n\tglobal $post;\r\n\r\n\t$delimiter = '»';\r\n\t$currentBefore = '<span class=\"current\">';\r\n\t$currentAfter = '</span>';\r\n\r\n\tif ( !is_home() || !is_front_page() || is_paged() ) :\r\n\t\t$flag = 1;\r\n\t\techo '<div id=\"crumbs\">';\r\n\t\techo '<a href=\"' . home_url() . '\">' . __( 'Home', 'hyunmoo' ) . '</a> ' . $delimiter . ' ';\r\n\r\n\t\t// figure out what to display\r\n\t\tswitch ( $flag ) :\r\n\t\t\tcase is_tax():\r\n\t\t\t\t// get the current ad category\r\n\t\t\t\t$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );\r\n\t\t\t\t// get the current ad category parent id\r\n\t\t\t\t$parent = $term->parent;\r\n\t\t\t\t// WP doesn't have a function to grab the top-level term id so we need to\r\n\t\t\t\t// climb up the tree and create a list of all the ad cat parents\r\n\t\t\t\twhile ( $parent ):\r\n\t\t\t\t\t$parents[] = $parent;\r\n\t\t\t\t\t$new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );\r\n\t\t\t\t\t$parent = $new_parent->parent;\r\n\t\t\t\tendwhile;\r\n\t\t\t\t\r\n\t\t\t\t// if parents are found display them\r\n\t\t\t\tif( !empty( $parents ) ):\r\n\t\t\t\t\t// flip the array over so we can print out descending\r\n\t\t\t\t\t$parents = array_reverse( $parents );\r\n\t\t\t\t\t// for each parent, create a breadcrumb item\r\n\t\t\t\t\tforeach ( $parents as $parent ):\r\n\t\t\t\t\t\t$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );\r\n\t\t\t\t\t\t$url = get_term_link( $iterm );\r\n\t\t\t\t\t\techo '<a href=\"' . $url . '\">' . $item->name . '</a> ' . $delimiter . ' ';\r\n\t\t\t\t\tendforeach;\r\n\t\t\t\tendif;\r\n\t\t\t\techo $currentBefore . $term->name . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_single():\r\n\t\t\t\t$cat = get_the_category();\r\n\t\t\t\t$cat = $cat[0];\r\n\t\t\t\techo get_category_parents( $cat, TRUE, \" $delimiter \" );\r\n\t\t\t\techo $currentBefore . the_title() . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_category():\r\n\t\t\t\tglobal $wp_query;\r\n\t\t\t\t$cat_obj = $wp_query->get_queried_object();\r\n\t\t\t\t$thisCat = $cat_obj->term_id;\r\n\t\t\t\t$thisCat = get_category( $thisCat );\r\n\t\t\t\t$parentCat = get_category( $thisCat->parent );\r\n\t\t\t\tif ( $thisCat->parent != 0 ) echo( get_category_parents( $parentCat, TRUE, ' ' . $delimiter . ' ' ) );\r\n\t\t\t\techo $currentBefore . single_cat_title() . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_page():\r\n\t\t\t\t// get the parent page id\r\n\t\t\t\t$parent_id = $post->post_parent;\r\n\t\t\t\t$breadcrumbs = array();\r\n\t\t\t\tif ($parent_id > 0 ) :\r\n\t\t\t\t\t// now loop through and put all parent pages found above current one in array\r\n\t\t\t\t\twhile ( $parent_id ) {\r\n\t\t\t\t\t\t$page = get_page( $parent_id );\r\n\t\t\t\t\t\t$breadcrumbs[] = '<a href=\"' . get_permalink( $page->ID ) . '\">' . get_the_title( $page->ID ) . '</a>';\r\n\t\t\t\t\t\t$parent_id = $page->post_parent;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$breadcrumbs = array_reverse( $breadcrumbs );\r\n\t\t\t\t\tforeach ( $breadcrumbs as $crumb ) echo $crumb . ' ' . $delimiter . ' ';\r\n\t\t\t\tendif;\r\n\t\t\t\techo $currentBefore . the_title() . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_search():\r\n\t\t\t\techo $currentBefore . __( 'Search results for', 'hyunmoo' ) .' '' . get_search_query() . ''' . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_tag():\r\n\t\t\t\techo $currentBefore . __( 'Posts tagged with', 'hyunmoo' ) .' '' . single_tag_title( '', false ) . ''' . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_author():\r\n\t\t\t\tglobal $author;\r\n\t\t\t\t$userdata = get_userdata( $author );\r\n\t\t\t\techo $currentBefore . __( 'About', 'hyunmoo' ) .' ' . $userdata->display_name . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_day():\r\n\t\t\t\techo '<a href=\"' . get_year_link( get_the_time( 'Y' ) ) . '\">' . get_the_time( 'Y' ) . '</a> ' . $delimiter . ' ';\r\n\t\t\t\techo '<a href=\"' . get_month_link( get_the_time( 'Y' ),get_the_time( 'm' ) ) . '\">' . get_the_time( 'F' ) . '</a> ' . $delimiter . ' ';\r\n\t\t\t\techo $currentBefore . get_the_time( 'd' ) . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_month():\r\n\t\t\t\techo '<a href=\"' . get_year_link( get_the_time( 'Y' ) ) . '\">' . get_the_time( 'Y' ) . '</a> ' . $delimiter . ' ';\r\n\t\t\t\techo $currentBefore . get_the_time( 'F' ) . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_year():\r\n\t\t\t\techo $currentBefore . get_the_time( 'Y' ) . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase is_404():\r\n\t\t\t\techo $currentBefore . __( 'Page not found', 'hyunmoo' ) . $currentAfter;\r\n\t\t\tbreak;\r\n\r\n\t\tendswitch;\r\n\r\n\t\tif ( get_query_var('paged') ) {\r\n\t\t if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() || is_archive() || is_tax() ) echo ' (';\r\n\t\t\techo __('Page', 'hyunmoo') . ' ' . get_query_var('paged');\r\n\t\t if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() || is_archive() || is_tax() ) echo ')';\r\n\t\t}\r\n\r\n\t\techo '</div>';\r\n\r\n\tendif;\r\n\r\n}",
"private function _create_breadcrumb()\n {\n $em = EntityManagerSingleton::getInstance();\n $session_service = $this->getServiceLocator()->get('session');\n $breadcrumb_container = $session_service->getContainer('breadcrumb');\n $page_type = $page_id = $url = $title = null;\n $breadcrumb_container['first'] = [];\n\n // Parse title correctly\n if ($this->page->getPageType() == 'home')\n {\n $title = \"<i class='fa fa-home'></i> Home\";\n $page_type = 'home';\n $page_id = null;\n $url = '/';\n\n $breadcrumb_container['whence'] = [];\n }\n elseif ($this->page->getPageType() == 'search')\n {\n $title = \"<i class='fa fa-search'></i> Search Results\";\n $page_type = 'search';\n $page_id = null;\n $url = $_SERVER['REQUEST_URI'];\n\n $breadcrumb_container['whence'] =\n [\n 'title' => \"<i class='fa fa-home'></i> Home\",\n 'url' => '/',\n 'page_type' => 'home'\n ];\n }\n\n // Handle bread crumbs for categories\n elseif ($this->page->getPageType() == 'category')\n {\n // Check if this category has a parent\n $category = $em->getRepository('Library\\Model\\Category\\Category')->findOneByPage($this->page);\n if ($category instanceof Category)\n {\n // Place the parent in the first part of the breadcrumb\n if (!is_null($category->getParentCategory()))\n {\n $breadcrumb_container['whence'] =\n [\n 'title' => $category->getParentCategory()->getPage()->getTitle(),\n 'url' => $category->getParentCategory()->getPage()->getFullUrl(),\n 'page_type' => 'category',\n 'page_id' => $category->getParentCategory()->getPage()->getId()\n ];\n }\n else\n {\n $breadcrumb_container['whence'] =\n [\n 'title' => \"<i class='fa fa-home'></i> Home\",\n 'url' => '/',\n 'page_type' => 'home'\n ];\n }\n\n $page_type = 'category';\n $page_id = $category->getPage()->getId();\n $title = $category->getPage()->getTitle();\n $url = $_SERVER['REQUEST_URI'];\n }\n }\n\n // Handle bread crumbs for products\n elseif ($this->page->getPageType() == 'product')\n {\n $product = $em->getRepository('Library\\Model\\Product\\Product')->findOneByPage($this->page);\n if ($product instanceof Product)\n {\n if ($breadcrumb_container['current']['page_type'] == 'search' || $breadcrumb_container['current']['page_type'] == 'category')\n {\n $breadcrumb_container['whence'] = $breadcrumb_container['current'];\n\n // Place parent category in first position\n if ($breadcrumb_container['whence']['page_type'] == 'category')\n {\n $parent_category = $em->getRepository('Library\\Model\\Category\\Category')\n ->findOneByPage($em->getReference('Library\\Model\\Page\\Page', $breadcrumb_container['whence']['page_id']))->getParentCategory();\n\n if (!is_null($parent_category))\n {\n $breadcrumb_container['first'] =\n [\n 'title' => $parent_category->getPage()->getTitle(),\n 'url' => $parent_category->getPage()->getFullUrl(),\n 'page_type' => 'category',\n 'page_id' => $parent_category->getPage()->getId()\n ];\n }\n }\n }\n elseif ($breadcrumb_container['current']['page_type'] == 'home' || $breadcrumb_container['current']['page_type'] == 'product')\n {\n $breadcrumb_container['whence'] =\n [\n 'title' => \"New Arrivals\",\n 'url' => $em->getReference('Library\\Model\\Category\\Category', 3)->getPage()->getFullUrl(),\n 'page_type' => 'category',\n 'page_id' => $em->getReference('Library\\Model\\Category\\Category', 3)->getPage()->getId(),\n ];\n }\n\n $page_id = $this->page->getId();\n $page_type = 'product';\n $title = $this->page->getTitle();\n $url = $this->page->getFullUrl();\n }\n }\n\n // Add current page\n $breadcrumb_container['current'] = [\n 'title' => $title,\n 'url' => $url,\n 'page_type' => $page_type,\n 'page_id' => $page_id\n ];\n }"
] | [
"0.62954706",
"0.61813974",
"0.61413467",
"0.6095962",
"0.60915196",
"0.59840405",
"0.58837366",
"0.5850802",
"0.58003247",
"0.57587916",
"0.5747134",
"0.572939",
"0.5673998",
"0.56086665",
"0.5605873",
"0.55897266",
"0.5554198",
"0.5524535",
"0.54912657",
"0.5484671",
"0.5476792",
"0.54722494",
"0.54225546",
"0.54197496",
"0.54042935",
"0.5398742",
"0.5389411",
"0.53854626",
"0.5378496",
"0.53707975"
] | 0.736943 | 0 |
Delete company's main image. | public function DeleteImage()
{
// === GET ID === //
$id = $this->segment_item;
$this->companies_model->RemovePostImage($id);
redirect($this->_getBaseURI()."/edit/$this->segment_orderby/".$this->segment_orderseq."/".$this->segment_offset."/".$id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteImage()\n {\n $this->setValue($this->options['emptyReturn']);\n unlink($this->options['wwwDir'] . $this->hidden);\n $this->hidden = null;\n }",
"public function Delete_Additional_Image()\n\t{\t\n\t\t// === GET ID === //\n\t\t$id = $this->segment_item;\n\t\t\n\t\t$image_id = $this->uri->segment($this->_getSegmentsOffset()+7);\n\t\t\n\t\tif(!$image_id) redirect($this->_getBaseURI());\n\t\t\n\t\t$this->companies_model->RemoveAdditionalImage($image_id);\n\t\t\n\t\tredirect($this->_getBaseURI().\"/edit/$this->segment_orderby/\".$this->segment_orderseq.\"/\".$this->segment_offset.\"/\".$id);\n\t}",
"public function removeImage () {}",
"public function deleteImage()\n\t{\n\t\t$file = $this->getImagePath() . $this->getImageFilename();\n\n\t\tif(file_exists($file))\n\t\t{\n\t\t\tunlink($file);\n\t\t\t$this->image_filename = '';\n\t\t}\n\t}",
"public function removeImage() {\n\t}",
"public function deletePicture()\n {\n $myConfig = $this->getConfig();\n\n if ($myConfig->isDemoShop()) {\n // disabling uploading pictures if this is demo shop\n $oEx = oxNew(\"oxExceptionToDisplay\");\n $oEx->setMessage('ARTICLE_PICTURES_UPLOADISDISABLED');\n oxRegistry::get(\"oxUtilsView\")->addErrorToDisplay($oEx, false);\n\n return;\n }\n\n $sOxId = $this->getEditObjectId();\n $iIndex = oxRegistry::getConfig()->getRequestParameter(\"masterPicIndex\");\n\n $oArticle = oxNew(\"oxarticle\");\n $oArticle->load($sOxId);\n\n if ($iIndex == \"ICO\") {\n // deleting main icon\n $this->_deleteMainIcon($oArticle);\n } elseif ($iIndex == \"TH\") {\n // deleting thumbnail\n $this->_deleteThumbnail($oArticle);\n } else {\n $iIndex = (int) $iIndex;\n if ($iIndex > 0) {\n // deleting master picture\n $this->_resetMasterPicture($oArticle, $iIndex, true);\n }\n }\n\n $oArticle->save();\n }",
"public function deleteimageAction()\r\n {\r\n $path = Mage::getBaseDir();\r\n $attributeId = $this->getRequest()->getPost('aId');\r\n $optionId = $this->getRequest()->getPost('oId');\r\n $imageDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n $imageDirectory = $imageDirectory . DS . $optionId . DS . 'img';\r\n unlink($imageDirectory);\r\n $optionDriectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS . $optionId;\r\n rmdir($optionDriectory);\r\n $attributeDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n rmdir($attributeDirectory);\r\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage()\n {\n if(!$this->hasImage()->exists()){\n return;\n }\n\n Storage::disk('public')->delete($this->hasImage->name);\n $this->hasImage()->delete();\n }",
"public function deletePhoto()\n {\n if ($this->url) {\n\n $photo = 'uploads/bus' . $this->bus_id . '/staff/' . $this->url;\n if (file_exists($photo)) unlink($photo);\n $thumb = 'thumb/bus' . $this->bus_id . '/staff/' . $this->url;\n if (file_exists($thumb)) unlink($thumb);\n }\n }",
"public function remove_company_logo()\r\n {\r\n if ($this->input->is_ajax_request()) {\r\n if(file_exists(COMPANY_FILES_FOLDER . '/' . get_option('company_logo'))){\r\n unlink(COMPANY_FILES_FOLDER . '/' . get_option('company_logo'));\r\n }\r\n if (update_option('company_logo','')) {\r\n echo json_encode(array(\r\n 'success' => true\r\n ));\r\n exit;\r\n }\r\n }\r\n }",
"protected function _delete()\n\t{\n\t\t$image = $this->_images->fetchImage( intval( $this->request['imageid'] ) );\n\t\t$album = $this->_albums->fetchAlbumsById( $image['img_album_id'] );\n\t\t\n\t\tif ( empty( $image['id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\tif ( ! $this->_albums->canModerate( $album ) AND ( $image['member_id'] != $this->memberData['member_id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\t/* Had enough now, just get rid of it */\n\t\t$this->_moderate->deleteImages( array( $image['id'] => $image ) );\n\t\t\n\t\t/* Back */\n\t\tif ( $this->request['modcp'] )\n\t\t{\n\t\t\t$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=modcp&fromapp=gallery&tab=' . $this->request['modcp'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=gallery&album=' . $album['album_id'], $album['album_name_seo'], false, 'viewalbum' );\n\t\t}\n\t}",
"public function Delete(){\n\t\t$file = $this->imagesPath.$this->filename; \n\t\tif(file_exists($file))\n\t\t\tunlink($file);\n\t\tparent::Delete();\n\t}",
"private function deleteImage()\n\t\t{\n\t\t\t$directory = FN::getSessionValue(\"img-dir\");\n\t\t\t$name = FN::sanitise($_REQUEST['name']);\n\t\t\tunlink(\"$directory/$name\");\n\t\t}",
"public function picture_delete ()\n {\n $picture = $this->products::PICTURE_PATH . $this->upload->data('file_name') ?? '';\n if (is_file($picture)) unlink ($picture);\n }",
"public function removeImageAction()\n {\n Pi::service('log')->mute();\n\n $id = $this->params('id', 0);\n $fakeId = $this->params('fake_id', 0);\n $affectedRows = 0;\n $module = $this->getModule();\n\n if ($id) {\n $rowAuthor = $this->getModel('author')->find($id);\n\n if ($rowAuthor && $rowAuthor->photo) {\n // Delete photo\n @unlink(Pi::path($rowAuthor->photo));\n\n // Update db\n $rowAuthor->photo = '';\n $affectedRows = $rowAuthor->save();\n }\n } elseif ($fakeId) {\n $session = Media::getUploadSession($module, 'author');\n\n if (isset($session->$fakeId)) {\n $uploadInfo = isset($session->$id)\n ? $session->$id : $session->$fakeId;\n\n @unlink(Pi::path($uploadInfo['tmp_name']));\n\n unset($session->$id);\n unset($session->$fakeId);\n }\n }\n\n echo json_encode([\n 'status' => $affectedRows ? true : false,\n 'message' => 'ok',\n ]);\n exit;\n }",
"public function delete_business_image($id) {\n $this->db->delete('business_image', array('id' => $id));\n }",
"public function afterDelete()\n {\n parent::afterDelete();\n\n if ($this->image) {\n @unlink(Yii::getAlias('@webroot').$this->image);\n }\n }",
"function delete_img_emty()\n{\n\t// get link\n \t$path_file = FCPATH . 'api/users/avatar/';\n \t// get name images in folder\n \t$files1 = array_slice(scandir('api/users/avatar'),2);\n \t// get link images in database\n \t$datas = $this->Users_Model->get_img_all();\n \t$img_name = [];\n\n \tforeach ($datas as $data) {\n \t\t// get name images in database\n \t\t$img_name[] = str_replace('users/avatar/',\"\", $data->avatar);\n \t}\n\n \tfor($i = 0; $i < count($files1); $i++)\n \t{\n \t\t// check \n \t\tif(!in_array($files1[$i], $img_name))\n \t\t{\n \t\t\t$file = $path_file.$files1[$i];\n \t\t\tif(file_exists($file)) {\n \t\t\t\t// remove images in folder\n\t \t\t\tunlink($file);\n\t \t\t}\n \t\t}\n \t}\n\n}",
"public function destroy(Company $company)\n {\n if($company->logo != 'nologo.jpg'){\n Storage::disk('public')->delete($company->logo);\n }\n $company->delete();\n return redirect('company')->with('success', 'Company deleted');\n }",
"function businessImgUnlink()\n\t{\n\t//\tprint_r($_REQUEST);\n\t\tif(isset($_REQUEST['business_img']))\n\t\t{\n\t\t\t$business_img = $_REQUEST['business_img'];\n\t\t\t$img_id = $_REQUEST['img_id'];\n\t\t\t$vac_id = $_REQUEST['vac_id'];\n\t\t\t$return = $this->deleteImage($img_id, $business_img);\n\t\t\t$countcls = $this->model->get_data('*','tbl_vacation_list_images', array('vac_id' => $vac_id));\n\t\t\techo count($countcls);\n\t\t}\n\t}",
"function deleteSiteLogo() {\n global $site;\n\n if ($site->logo()) {\n Filesystem::rmfile(PATH_UPLOADS.$site->logo(false));\n $site->set(array('logo'=>''));\n Log::set(__FUNCTION__.LOG_SEP.'Site logo deleted.', LOG_TYPE_INFO);\n return true;\n }\n\n Log::set(__FUNCTION__.LOG_SEP.'Error when try to delete the site logo, the file doesn\\'t exists.', LOG_TYPE_ERROR);\n return false;\n}",
"public function deleteSelectorImage()\r\n\t{\r\n\t\t// Get request\r\n\t\t$metaSelectorId = Request::getInt('selector');\r\n\t\t\r\n\t\t// Delete from model\r\n\t\t$metaModel = BluApplication::getModel('meta');\r\n\t\t$deleted = $metaModel->updateMetaSelector($metaSelectorId, array(\r\n\t\t\t'images' => array($type => '')\r\n\t\t));\r\n\t\t\r\n\t\t// Back to listing\r\n\t\tif ($deleted) {\r\n\t\t\tMessages::addMessage('Meta selector image deleted', 'info');\r\n\t\t}\r\n\t\t$this->view();\r\n\t}",
"function actionRemoveImage(){\r\n $this->clubDatas = $this->_oDb->getEntryById($_POST['club_id']);\r\n $this->removeClubCoverBackground();\r\n }",
"function delete_image()\n {\n if (isset($_POST['remove'])) {\n global $wpdb;\n $img_path = $_POST['path'];\n\n // get the images meta ID.\n $query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n $results = $wpdb->get_results($query);\n\n // delete images meta\n foreach ($results as $row) {\n wp_delete_attachment($row->ID); //delete the image and also delete the attachment from the Media Library.\n }\n delete_option('ink_image'); //delete image path from database.\n }\n }",
"public function deleteImage(){\n\t\t$img=ProductImage::find(Input::get('id'));\n\t\tunlink('img/p/'.$img['image']);\t\t\n\t\t$img->delete();\n\t\t\n\t\treturn '';\n\t}",
"public function destroy(Company $company)\n {\n $logo=$company->logo;\n $logo_path=$company->logo->filename;\n if($company->delete()){\n if($logo->delete()){\n unlink('storage/'.$logo_path);\n }\n }\n session()->flash('success', 'Company deleted successfully .');\n return redirect()->back();\n }",
"public function destroy($company_id)\n {\n\n $company = Company::find($company_id);\n \n if($company->logo){\n Storage::delete('public/logo/'.$company->logo);\n }\n\n $company->delete();\n\n return redirect('/companies/index')->with('success', 'Company successfuly deleted.');\n }"
] | [
"0.6908552",
"0.68994534",
"0.66667104",
"0.6604609",
"0.6584009",
"0.657123",
"0.6535494",
"0.64404315",
"0.64404315",
"0.64404315",
"0.64178413",
"0.6409939",
"0.64051586",
"0.6395519",
"0.63937634",
"0.6348786",
"0.63441086",
"0.63160396",
"0.6299962",
"0.62907857",
"0.6225497",
"0.6220516",
"0.62084275",
"0.6199275",
"0.61990887",
"0.6197173",
"0.619038",
"0.61818993",
"0.61569136",
"0.61560714"
] | 0.71052706 | 0 |
Delete company's additional image. | public function Delete_Additional_Image()
{
// === GET ID === //
$id = $this->segment_item;
$image_id = $this->uri->segment($this->_getSegmentsOffset()+7);
if(!$image_id) redirect($this->_getBaseURI());
$this->companies_model->RemoveAdditionalImage($image_id);
redirect($this->_getBaseURI()."/edit/$this->segment_orderby/".$this->segment_orderseq."/".$this->segment_offset."/".$id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function DeleteImage()\n\t{\t\n\t\t// === GET ID === //\n\t\t$id = $this->segment_item;\n\t\t\n\t\t$this->companies_model->RemovePostImage($id);\n\t\t\n\t\tredirect($this->_getBaseURI().\"/edit/$this->segment_orderby/\".$this->segment_orderseq.\"/\".$this->segment_offset.\"/\".$id);\n\t}",
"public function deleteImage()\n {\n $this->setValue($this->options['emptyReturn']);\n unlink($this->options['wwwDir'] . $this->hidden);\n $this->hidden = null;\n }",
"public function removeImage () {}",
"public function deleteimageAction()\r\n {\r\n $path = Mage::getBaseDir();\r\n $attributeId = $this->getRequest()->getPost('aId');\r\n $optionId = $this->getRequest()->getPost('oId');\r\n $imageDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n $imageDirectory = $imageDirectory . DS . $optionId . DS . 'img';\r\n unlink($imageDirectory);\r\n $optionDriectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS . $optionId;\r\n rmdir($optionDriectory);\r\n $attributeDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n rmdir($attributeDirectory);\r\n }",
"public function picture_delete ()\n {\n $picture = $this->products::PICTURE_PATH . $this->upload->data('file_name') ?? '';\n if (is_file($picture)) unlink ($picture);\n }",
"public function afterDelete()\n {\n parent::afterDelete();\n\n if ($this->image) {\n @unlink(Yii::getAlias('@webroot').$this->image);\n }\n }",
"public function removeImage() {\n\t}",
"function delete_image()\n {\n if (isset($_POST['remove'])) {\n global $wpdb;\n $img_path = $_POST['path'];\n\n // get the images meta ID.\n $query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n $results = $wpdb->get_results($query);\n\n // delete images meta\n foreach ($results as $row) {\n wp_delete_attachment($row->ID); //delete the image and also delete the attachment from the Media Library.\n }\n delete_option('ink_image'); //delete image path from database.\n }\n }",
"public function deletePicture()\n {\n $myConfig = $this->getConfig();\n\n if ($myConfig->isDemoShop()) {\n // disabling uploading pictures if this is demo shop\n $oEx = oxNew(\"oxExceptionToDisplay\");\n $oEx->setMessage('ARTICLE_PICTURES_UPLOADISDISABLED');\n oxRegistry::get(\"oxUtilsView\")->addErrorToDisplay($oEx, false);\n\n return;\n }\n\n $sOxId = $this->getEditObjectId();\n $iIndex = oxRegistry::getConfig()->getRequestParameter(\"masterPicIndex\");\n\n $oArticle = oxNew(\"oxarticle\");\n $oArticle->load($sOxId);\n\n if ($iIndex == \"ICO\") {\n // deleting main icon\n $this->_deleteMainIcon($oArticle);\n } elseif ($iIndex == \"TH\") {\n // deleting thumbnail\n $this->_deleteThumbnail($oArticle);\n } else {\n $iIndex = (int) $iIndex;\n if ($iIndex > 0) {\n // deleting master picture\n $this->_resetMasterPicture($oArticle, $iIndex, true);\n }\n }\n\n $oArticle->save();\n }",
"public function deleteImage()\n\t{\n\t\t$file = $this->getImagePath() . $this->getImageFilename();\n\n\t\tif(file_exists($file))\n\t\t{\n\t\t\tunlink($file);\n\t\t\t$this->image_filename = '';\n\t\t}\n\t}",
"public function deletePhoto()\n {\n if ($this->url) {\n\n $photo = 'uploads/bus' . $this->bus_id . '/staff/' . $this->url;\n if (file_exists($photo)) unlink($photo);\n $thumb = 'thumb/bus' . $this->bus_id . '/staff/' . $this->url;\n if (file_exists($thumb)) unlink($thumb);\n }\n }",
"public function deleteImage()\n {\n if(!$this->hasImage()->exists()){\n return;\n }\n\n Storage::disk('public')->delete($this->hasImage->name);\n $this->hasImage()->delete();\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"function actionRemoveImage(){\r\n $this->clubDatas = $this->_oDb->getEntryById($_POST['club_id']);\r\n $this->removeClubCoverBackground();\r\n }",
"function picture_delete() {\n\t\t$person = $this->Person->read(null, $this->Session->read('person'));\n\t\tif (!empty($person['Person']['picture'])) {\n\t\t\t$this->__deleteImage($person['Person']['picture']);\n\t\t}\n\t\t$person['Person']['picture'] = \"\";\n\t\t$this->Person->save($person);\n\t\t$this->redirect($this->referer());\n\t}",
"protected function _delete()\n\t{\n\t\t$image = $this->_images->fetchImage( intval( $this->request['imageid'] ) );\n\t\t$album = $this->_albums->fetchAlbumsById( $image['img_album_id'] );\n\t\t\n\t\tif ( empty( $image['id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\tif ( ! $this->_albums->canModerate( $album ) AND ( $image['member_id'] != $this->memberData['member_id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\t/* Had enough now, just get rid of it */\n\t\t$this->_moderate->deleteImages( array( $image['id'] => $image ) );\n\t\t\n\t\t/* Back */\n\t\tif ( $this->request['modcp'] )\n\t\t{\n\t\t\t$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=modcp&fromapp=gallery&tab=' . $this->request['modcp'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=gallery&album=' . $album['album_id'], $album['album_name_seo'], false, 'viewalbum' );\n\t\t}\n\t}",
"public function removeImageAction()\n {\n Pi::service('log')->mute();\n\n $id = $this->params('id', 0);\n $fakeId = $this->params('fake_id', 0);\n $affectedRows = 0;\n $module = $this->getModule();\n\n if ($id) {\n $rowAuthor = $this->getModel('author')->find($id);\n\n if ($rowAuthor && $rowAuthor->photo) {\n // Delete photo\n @unlink(Pi::path($rowAuthor->photo));\n\n // Update db\n $rowAuthor->photo = '';\n $affectedRows = $rowAuthor->save();\n }\n } elseif ($fakeId) {\n $session = Media::getUploadSession($module, 'author');\n\n if (isset($session->$fakeId)) {\n $uploadInfo = isset($session->$id)\n ? $session->$id : $session->$fakeId;\n\n @unlink(Pi::path($uploadInfo['tmp_name']));\n\n unset($session->$id);\n unset($session->$fakeId);\n }\n }\n\n echo json_encode([\n 'status' => $affectedRows ? true : false,\n 'message' => 'ok',\n ]);\n exit;\n }",
"public function photoDeleteAction() {\n /**\n * Get customer login details.\n */\n if (! Mage::getSingleton ( 'customer/session' )->isLoggedIn ()) {\n /**\n * Redirect to customer login.\n */\n $this->_redirectUrl ( Mage::helper ( 'customer' )->getLoginUrl () );\n return false;\n }\n /**\n * Get ImageId.\n * Get Entity Id.\n * Get album cover.\n */\n $imageId = $this->getRequest ()->getParam ( \"image_id\" );\n $entityId = $this->getRequest ()->getParam ( \"entity_id\" );\n $albumCover = $this->getRequest ()->getParam ( \"albumCover\" );\n /**\n * Check condition if $imageId exist or not\n */\n if ($imageId) {\n /**\n * Remove image.\n */\n Mage::getModel ( 'airhotels/calendar' )->removeImage ( $imageId, $entityId, $albumCover );\n } else {\n /**\n * Set error message.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'Please try again!' ) );\n }\n /**\n * Set redirect url.\n */\n $this->_redirect ( '*/property/form/step/photos' );\n }",
"public function remove_image() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $ad->remove_image($this->params['image_id']);\n redirect('/ads/edit', ['notice' => 'Image successfully removed.'], ['id' => $ad->id]);\n }",
"public function delete_business_image($id) {\n $this->db->delete('business_image', array('id' => $id));\n }",
"protected function _delete()\r\n {\r\n $photoTable = Engine_Api::_()->getItemTable('ynfundraising_photo');\r\n $photoSelect = $photoTable->select()->where('album_id = ?', $this->getIdentity());\r\n foreach( $photoTable->fetchAll($photoSelect) as $campaignPhoto ) {\r\n $campaignPhoto->delete();\r\n }\r\n\r\n parent::_delete();\r\n }",
"public function remove_company_logo()\r\n {\r\n if ($this->input->is_ajax_request()) {\r\n if(file_exists(COMPANY_FILES_FOLDER . '/' . get_option('company_logo'))){\r\n unlink(COMPANY_FILES_FOLDER . '/' . get_option('company_logo'));\r\n }\r\n if (update_option('company_logo','')) {\r\n echo json_encode(array(\r\n 'success' => true\r\n ));\r\n exit;\r\n }\r\n }\r\n }",
"function delete_img_emty()\n{\n\t// get link\n \t$path_file = FCPATH . 'api/users/avatar/';\n \t// get name images in folder\n \t$files1 = array_slice(scandir('api/users/avatar'),2);\n \t// get link images in database\n \t$datas = $this->Users_Model->get_img_all();\n \t$img_name = [];\n\n \tforeach ($datas as $data) {\n \t\t// get name images in database\n \t\t$img_name[] = str_replace('users/avatar/',\"\", $data->avatar);\n \t}\n\n \tfor($i = 0; $i < count($files1); $i++)\n \t{\n \t\t// check \n \t\tif(!in_array($files1[$i], $img_name))\n \t\t{\n \t\t\t$file = $path_file.$files1[$i];\n \t\t\tif(file_exists($file)) {\n \t\t\t\t// remove images in folder\n\t \t\t\tunlink($file);\n\t \t\t}\n \t\t}\n \t}\n\n}",
"private function deleteImage()\n\t\t{\n\t\t\t$directory = FN::getSessionValue(\"img-dir\");\n\t\t\t$name = FN::sanitise($_REQUEST['name']);\n\t\t\tunlink(\"$directory/$name\");\n\t\t}",
"public function postDelete(PropelPDO $con = null){\n\t\t if (file_exists(sfConfig::get('sf_upload_dir') . '/personnes/'.$this->getImage())){\n\t\t\t@unlink(sfConfig::get('sf_upload_dir') . '/personnes/'.$this->getImage());\n\t\t }\n\t }",
"function deleteDepended(): void\n {\n foreach($this->routeImages as $l_image){ \n $l_image->deleteAll();\n }\n $this->delete();\n \n }",
"public function delete_imgAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Resource_Service_Img::getGameImg($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\n\t\t$result = Resource_Service_Img::deleteGameImg($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}",
"public function Delete(){\n\t\t$file = $this->imagesPath.$this->filename; \n\t\tif(file_exists($file))\n\t\t\tunlink($file);\n\t\tparent::Delete();\n\t}"
] | [
"0.7345572",
"0.6900321",
"0.68831235",
"0.6878634",
"0.68722296",
"0.6838063",
"0.6745478",
"0.6707818",
"0.66905606",
"0.66733295",
"0.667091",
"0.6665068",
"0.66533667",
"0.66533667",
"0.66533667",
"0.66044354",
"0.66007715",
"0.65894604",
"0.65798897",
"0.6528658",
"0.6527628",
"0.65115315",
"0.65060246",
"0.6476024",
"0.6469898",
"0.6459408",
"0.64333105",
"0.64170116",
"0.6409992",
"0.63895"
] | 0.8130243 | 0 |
Search the database for the practitioner and the location | public function getSearchbyspeciality() {
$town_arr = array();
$doc = Input::get('practitioner');
if($doc) {
$special = Specialty::find($doc);
if($special) {
$special = $special->name;
}
} else {
$special = null;
}
$location = Input::get('location');
$towns = DB::table('towns')
->select('id')
->where('name', 'LIKE', '%'.$location.'%')
->get();
foreach ($towns as $town) {
$town_arr[] = $town->id;
}
$doctors = DB::table('doctors')
->join('schedules', 'schedules.doctor_id', '=', 'doctors.id')
->where('doctors.specialties', 'LIKE', '%'.$special.'%')
->where('active', 1)
->whereIn('schedules.town_id',$town_arr)
->groupBy('schedules.town_id', 'schedules.doctor_id')
->get();
if($doctors) {
return View::make('channel.doctor')
->with('doctors', $doctors);
}
return Redirect::to('channel')
->with('message', 'Could not find any doctors');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function searchDetails()\n {\n $SQL = array();\n\n $thisTable = $this->options->tableValue[0];\n\n //setup the from clause\\\n $from = \"\n FROM {$this->options->_dbName}.{$thisTable} c\n LEFT JOIN mhcdynad.mhc_locations l ON l.id = c.instanceID\n LEFT JOIN mhcdynad.mhc_regions r ON r.id = l.regionID\n LEFT JOIN mhcdynad.mhc_districts d ON d.id = r.districtID\n LEFT JOIN mhcdynad.mhc_locationType lt ON lt.id = d.locationTypeID\n \";\n\n //setup the wher clause\n $where = \"\n WHERE monthYear BETWEEN :begDate AND :endDate\n AND\n \";\n\n //sanitize the locationValue\n if (!empty($this->options->locationValue[0])) {\n switch ($this->options->type) {\n case 'account':\n array_walk_recursive($this->options->locationValue, array(&$this, 'only_ints'));\n $where .= \" c.accountID IN (\" . implode(', ', $this->options->locationValue) . \") \";\n break;\n\n case 'division':\n array_walk_recursive($this->options->locationValue, array(&$this, 'only_ints'));\n $where .= \" lt.id IN (\" . implode(', ', $this->options->locationValue) . \") \";\n break;\n\n case 'district':\n array_walk_recursive($this->options->locationValue, array(&$this, 'only_ints'));\n $where .= \" d.id IN (\" . implode(', ', $this->options->locationValue) . \") \";\n break;\n\n case 'region':\n array_walk_recursive($this->options->locationValue, array(&$this, 'only_ints'));\n $where .= \" r.id IN (\" . implode(', ', $this->options->locationValue) . \") \";\n break;\n\n case 'location':\n array_walk_recursive($this->options->locationValue, array(&$this, 'singleQuote'));\n $where .= \" l.locationID IN (\" . implode(', ', $this->options->locationValue) . \") \";\n break;\n\n case 'phonenumber':\n array_walk_recursive($this->options->locationValue, array(&$this, 'only_ints'));\n $where .= \" c.phone IN (\" . implode(', ', $this->options->locationValue) . \") \";\n break;\n }\n } else {\n $where .= 1;\n }\n\n switch ($thisTable) {\n case self::ACTS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Device Category',\n 'Device ID',\n 'Bucket ID',\n 'Bucket Description',\n 'Customer Name',\n 'Phone',\n 'Vision Code',\n 'Price Plan',\n 'Contract Length',\n 'Contract Date',\n 'Phone Description',\n 'Commission Amount',\n 'Additional Commission',\n 'Spiff',\n 'Coop',\n 'Tier Bonus',\n 'Purchased Receivable',\n 'Edge Service Fee',\n 'Estimated Commission Payout',\n 'Estimated Additional Commission Payout',\n 'Estimated Spiff Payout',\n 'Estimated Coop Payout',\n 'Estimated Tier Bonus Payout',\n 'Estimated Platinum Bonus Payout',\n 'Estimated Employee Payout',\n 'Estimated Purchased Receivable Payout',\n 'Estimated Edge Service Fee Payout',\n 'Unknown Bucket'\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.deviceCategory,\n c.deviceID,\n c.bucketID,\n b.description,\n c.customerName,\n c.phone,\n c.visionCode,\n c.pricePlan,\n c.contractLength,\n DATE_FORMAT(contractDate, '%m/%d/%Y'),\n c.phoneDescription,\n c.commissionAmount,\n c.additionalCommission,\n c.spiff,\n c.coop,\n c.tierBonus,\n c.purchasedReceivable,\n c.edgeServiceFee * -1,\n c.estimatedCommissionPayout,\n c.estimatedAdditionalCommissionPayout,\n c.estimatedSpiffPayout,\n c.estimatedCoopPayout,\n c.estimatedTierBonusPayout,\n c.estimatedPlatinumBonusPayout,\n c.estimatedEmployeePayout,\n c.estimatedPurchasedReceivablePayout,\n c.estimatedEdgeServiceFeePayout * -1,\n c.isUnknownBucket\n $from\n LEFT JOIN {$this->options->_dbName}.buckets b USING (bucketID)\n $where\n \";\n break;\n\n case self::DEACTS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Device Category',\n 'Device ID',\n 'Bucket ID',\n 'Bucket Description',\n 'Price Plan',\n 'Days of Service',\n 'CustomerName',\n 'Phone',\n 'Vision Code',\n 'Phone Description',\n 'Contract Length',\n 'Contract Date',\n 'Deact Date',\n 'Commission Amount',\n 'Additional Commission',\n 'Spiff',\n 'Coop',\n 'Tier Bonus',\n 'Purchased Receivable',\n 'Edge Service Fee',\n 'Estimated Commission Payout',\n 'Estimated Additional Commission Payout',\n 'Estimated Spiff Payout',\n 'Estimated Coop Payout',\n 'Estimated Tier Bonus Payout',\n 'Estimated Platinum Bonus Payout',\n 'Estimated Employee Payout',\n 'Estimated Purchased Receivable Payout',\n 'Estimated Edge Service Fee Payout',\n 'Unknown Bucket',\n 'Orphaned Deactivation'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.deviceCategory,\n c.deviceID,\n c.bucketID,\n b.description,\n c.pricePlan,\n c.daysOfService,\n c.customerName,\n c.phone,\n c.visionCode,\n c.phoneDescription,\n c.contractLength,\n DATE_FORMAT(c.contractDate, '%m/%d/%Y'),\n DATE_FORMAT(c.deactDate, '%m/%d/%Y'),\n c.commissionAmount * -1,\n c.additionalCommission * -1,\n c.spiff * -1,\n c.coop * -1,\n c.tierBonus * -1,\n c.purchasedReceivable * -1,\n c.edgeServiceFee,\n c.estimatedCommissionPayout * -1,\n c.estimatedAdditionalCommissionPayout * -1,\n c.estimatedSpiffPayout * -1,\n c.estimatedCoopPayout * -1,\n c.estimatedTierBonusPayout * -1,\n c.estimatedPlatinumBonusPayout * -1,\n c.estimatedEmployeePayout * -1,\n c.estimatedPurchasedReceivablePayout * -1,\n c.estimatedEdgeServiceFeePayout,\n c.isUnknownBucket,\n c.isOrphanDeact\n $from\n LEFT JOIN {$this->options->_dbName}.buckets b USING (bucketID)\n $where\n \";\n break;\n\n case self::FEATURES:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Customer Name',\n 'Phone',\n 'Device Category',\n 'Device ID',\n 'Price Plan',\n 'Vision Code',\n 'Feature ID',\n 'Plan Name',\n 'Contract Date',\n 'Commission Amount',\n 'Spiff'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.customerName,\n c.phone,\n c.deviceCategory,\n c.deviceID,\n c.pricePlan,\n c.visionCode,\n c.featureID,\n c.planName,\n DATE_FORMAT(c.contractDate, '%m/%d/%Y'),\n c.commissionAmount,\n c.spiff\n $from\n $where\n \";\n break;\n\n case self::FEATURES_CHARGEDBACK:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Vision Code',\n 'Feature ID',\n 'Plan Name',\n 'Price Plan',\n 'Customer Name',\n 'Phone',\n 'Device Category',\n 'Device ID',\n 'Contract Date',\n 'Deact Date',\n 'Commission Amount',\n 'Spiff'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.visionCode,\n c.featureID,\n c.planName,\n c.pricePlan,\n c.customerName,\n c.phone,\n c.deviceCategory,\n c.deviceID,\n DATE_FORMAT(c.contractDate, '%m/%d/%Y'),\n DATE_FORMAT(c.deactDate, '%m/%d/%Y'),\n c.commissionAmount*-1,\n c.spiff * -1\n $from\n $where\n \";\n break;\n\n case self::REACTS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Device Category',\n 'Device ID',\n 'Bucket ID',\n 'Bucket Description',\n 'Customer Name',\n 'Phone',\n 'Vision Code',\n 'Code',\n 'Price Plan',\n 'Contract Length',\n 'Contract Date',\n 'Reactivation Date',\n 'Commission Amount',\n 'Additional Commission',\n 'Spiff',\n 'Coop',\n 'Tier Bonus',\n 'Purchased Receivable',\n 'Edge Service Fee',\n 'Estimated Commission Payout',\n 'Estimated Additional Commission Payout',\n 'Estimated Spiff Payout',\n 'Estimated Coop Payout',\n 'Estimated Tier Bonus Payout',\n 'Estimated Platinum Bonus Payout',\n 'Estimated Employee Payout',\n 'Estimated Purchased Receivable',\n 'Estimated Edge Service Fee',\n 'Unknown Bucket'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.deviceCategory,\n c.deviceID,\n c.bucketID,\n b.description,\n c.customerName,\n c.phone,\n c.visionCode,\n c.code,\n c.pricePlan,\n c.contractLength,\n DATE_FORMAT(c.contractDate, '%m/%d/%Y'),\n DATE_FORMAT(c.reactivationDate, '%m/%d/%Y'),\n c.commissionAmount,\n c.additionalCommission,\n c.spiff,\n c.coop,\n c.tierBonus,\n c.purchasedReceivable,\n c.edgeServiceFee * -1,\n c.estimatedCommissionPayout,\n c.estimatedAdditionalCommissionPayout,\n c.estimatedSpiffPayout,\n c.estimatedCoopPayout,\n c.estimatedTierBonusPayout,\n c.estimatedPlatinumBonusPayout,\n c.estimatedEmployeePayout,\n c.estimatedPurchasedReceivablePayout,\n c.estimatedEdgeServiceFeePayout *-1,\n c.isUnknownBucket\n $from\n LEFT JOIN {$this->options->_dbName}.buckets b USING (bucketID)\n $where\n \";\n break;\n\n case self::UPGRADES:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Device Category',\n 'Device ID',\n 'Bucket ID',\n 'Bucket Description',\n 'Vision Code',\n 'Price Plan',\n 'Customer Name',\n 'Phone',\n 'Contract Length',\n 'Upgrade Type',\n 'New ESN Contract Start Date',\n 'Phone Description',\n 'Commission Amount',\n 'Additional Commission',\n 'Spiff',\n 'Purchased Receivable',\n 'Edge Service Fee',\n 'Estimated Commission Payout',\n 'Estimated Additional Commission Payout',\n 'Estimated Spiff Payout',\n 'Estimated Employee Payout',\n 'Estimated Purchased Receivable Payout',\n 'Estimated Edge Service Fee Payout',\n 'Unknown Bucket'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.deviceCategory,\n c.deviceID,\n c.bucketID,\n b.description,\n c.visionCode,\n c.pricePlan,\n c.customerName,\n c.phone,\n c.contractLength,\n c.upgradeType,\n DATE_FORMAT(c.new_esn_contractdate_start, '%m/%d/%Y'),\n c.phoneDescription,\n c.commissionAmount,\n c.additionalCommission,\n c.spiff,\n c.purchasedReceivable,\n c.edgeServiceFee * -1,\n c.estimatedCommissionPayout,\n c.estimatedAdditionalCommissionPayout,\n c.estimatedSpiffPayout,\n c.estimatedEmployeePayout,\n c.estimatedPurchasedReceivablePayout,\n c.estimatedEdgeServiceFeePayout * -1,\n c.isUnknownBucket\n $from\n LEFT JOIN {$this->options->_dbName}.buckets b USING (bucketID)\n $where\n \";\n break;\n\n case self::UPGRADE_DEACTS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'LocationID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Device Category',\n 'Device ID',\n 'Bucket ID',\n 'Bucket Description',\n 'Vision Code',\n 'Price Plan',\n 'Customer Name',\n 'Phone',\n 'Contract Length',\n 'New ESN Contract Start Date',\n 'Deact Date',\n 'Phone Description',\n 'Commission Amount',\n 'Additional Commission',\n 'Spiff',\n 'Purchased Receivable',\n 'Edge Service Fee',\n 'Estimated Commission Payout',\n 'Estimated Additional Commission Payout',\n 'Estimated Spiff Payout',\n 'Estimated Employee Payout',\n 'Estimated Purchased Receivable Payout',\n 'Estimated Edge Service Fee Payout',\n 'Unknown Bucket',\n 'Orphaned Deactivation'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.deviceCategory,\n c.deviceID,\n c.bucketID,\n b.description,\n c.visionCode,\n c.pricePlan,\n c.customerName,\n c.phone,\n c.contractLength,\n DATE_FORMAT(c.new_esn_contractdate_start, '%m/%d/%Y'),\n DATE_FORMAT(c.deactDate, '%m/%d/%Y'),\n c.phoneDescription,\n c.commissionAmount * -1,\n c.additionalCommission * -1,\n c.spiff * -1,\n c.purchasedReceivable * -1,\n c.edgeServiceFee,\n c.estimatedCommissionPayout * -1,\n c.estimatedAdditionalCommissionPayout * -1,\n c.estimatedSpiffPayout * -1,\n c.estimatedEmployeePayout * -1,\n c.estimatedPurchasedReceivablePayout * -1,\n c.estimatedEdgeServiceFeePayout,\n c.isUnknownBucket,\n c.isOrphanDeact\n $from\n LEFT JOIN {$this->options->_dbName}.buckets b USING (bucketID)\n $where\n \";\n break;\n\n case self::ADJUSTMENTS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'Month',\n 'Year',\n 'SFID',\n 'Phone',\n 'Device Category',\n 'Device ID',\n 'Adjustment Description',\n 'Adjustment Amount'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.month,\n c.year,\n c.sfid,\n c.phone,\n c.deviceCategory,\n c.deviceID,\n c.adjustmentDescription,\n c.adjustmentAmount\n $from\n $where\n \";\n break;\n\n case self::DEPOSITS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'SFID',\n 'Phone',\n 'Customer Name',\n 'Deposit Date',\n 'Contract Date',\n 'Deposit Amount'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.sfid,\n c.phone,\n c.customerName,\n DATE_FORMAT(c.depositDate, '%m/%d/%Y'),\n DATE_FORMAT(c.contractDate, '%m/%d/%Y'),\n c.depositAmount\n $from\n $where\n \";\n break;\n\n case self::RESIDUALS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'SFID',\n 'Company',\n 'Customer Name',\n 'Phone',\n 'Device Category',\n 'Device ID',\n 'Vision Code',\n 'Paid Date',\n 'Contract Date',\n 'Deact Date',\n 'Percent',\n 'Amount',\n 'Residual'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.sfid,\n c.company,\n c.customerName,\n c.phone,\n c.deviceCategory,\n c.deviceID,\n c.visionCode,\n DATE_FORMAT(c.paidDate, '%m/%d/%Y'),\n DATE_FORMAT(c.contractDate, '%m/%d/%Y'),\n DATE_FORMAT(c.deactDate, '%m/%d/%Y'),\n c.percent,\n c.amount,\n c.residual\n $from\n $where\n \";\n break;\n\n case self::CHANGES:\n\n //if phone number, alter behavior\n switch ($this->options->type) {\n case 'phonenumber':\n $where = \"\n WHERE monthYear BETWEEN :begDate AND :endDate\n AND c.old_phone IN (\" . implode(', ', $this->options->locationValue) . \")\n OR c.new_phone IN (\" . implode(', ', $this->options->locationValue) . \")\n \";\n break;\n }\n\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'SFID',\n 'SFID 2',\n 'Company',\n 'Customer Name',\n 'Old Phone',\n 'New Phone',\n 'Old Rate Plan',\n 'New Rate Plan',\n 'Old Account Number',\n 'New Account Number',\n 'Feature',\n 'Feature Desc'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.sfid,\n c.sfid2,\n c.company,\n c.customerName,\n c.old_phone,\n c.new_phone,\n c.old_rate_plan,\n c.new_rate_plan,\n c.old_account_number,\n c.new_account_number,\n c.feature,\n c.feature_desc\n $from\n $where\n \";\n break;\n\n case self::COOP_ACTS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'SFID',\n 'Device Category',\n 'Customer Name',\n 'Phone',\n 'Vision Code',\n 'Doc Date',\n 'Commission Amount'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.sfid,\n c.deviceCategory,\n c.customerName,\n c.phone,\n c.visionCode,\n DATE_FORMAT(c.docDate, '%m/%d/%Y'),\n c.commissionAmount\n $from\n $where\n \";\n break;\n\n case self::COOP_DEACTS:\n $SQL = \"\n SELECT\n 'Account ID',\n 'Instance ID',\n 'Location ID',\n 'District',\n 'Region',\n 'SFID',\n 'Device Category',\n 'Customer Name',\n 'Phone',\n 'Vision Code',\n 'Doc Date',\n 'Deact Date',\n 'Commission Amount'\n\n UNION ALL\n\n SELECT\n c.accountID,\n c.instanceID,\n c.locationID,\n d.district,\n r.region,\n c.sfid,\n c.deviceCategory,\n c.customerName,\n c.phone,\n c.visionCode,\n DATE_FORMAT(c.docDate, '%m/%d/%Y'),\n DATE_FORMAT(c.deactDate, '%m/%d/%Y'),\n c.commissionAmount * -1\n $from\n $where\n \";\n break;\n\n default:\n }\n\n $this->file = $this->databaseExportDirectory . '/ccrs_' . time() . '.xls';\n $SQL.=\"\n INTO OUTFILE '{$this->file}'\n FIELDS TERMINATED BY '\\t'\n OPTIONALLY ENCLOSED BY '\\\"'\n LINES TERMINATED BY '\\n'\n \";\n\n $this->detail = $this->_db->query($SQL, array(\n ':begDate' => \"{$this->options->begYear}-{$this->options->begMonth}-1\",\n ':endDate' => \"{$this->options->endYear}-{$this->options->endMonth}-1\"\n ), array(\n 'fetch' => PDO::FETCH_ASSOC\n )\n );\n }",
"public static function searchWorker()\n {\n $role = Role::where_name('worker')->first();\n $location_id = Input::get('location_id');\n $category_id = Input::get('category_id');\n if($location_id && $category_id)\n {\n $workers = $role->users()->where_location_id_and_category_id($location_id, $category_id)->get();\n }\n else\n {\n $workers = $role->users()->get();\n }\n if(!$category_id && $location_id)\n {\n $workers = $role->users()->where_location_id($location_id)->get();\n }\n if($category_id && !$location_id)\n {\n $workers = $role->users()->where_location_id($category_id)->get();\n }\n\n return Response::eloquent($workers);\n }",
"public function test_latest_attempt_table_filter_locations() {\n $page1 = $this->generator->create_module('page', ['course' => $this->course->id, 'content' => '<p>Page 1: </p>']);\n $page2 = $this->generator->create_module('page', ['course' => $this->course->id, 'content' => '<p>Page 2: </p>']);\n $pagecontext1 = \\context_module::instance($page1->cmid);\n $pagecontext2 = \\context_module::instance($page2->cmid);\n\n $this->displayoptions->locationids = [$pagecontext1->id, $pagecontext2->id];\n\n $table = new latest_attempt_table($this->context, $this->course->id, null, $this->displayoptions);\n\n $keyparam1 = array_search($pagecontext1->id, $table->sql->params);\n $keyparam2 = array_search($pagecontext2->id, $table->sql->params);\n\n $this->assertStringContainsString('location', $keyparam1);\n $this->assertStringContainsString('location', $keyparam2);\n $this->assertArrayHasKey($keyparam1, $table->sql->params);\n $this->assertEquals($pagecontext1->id, $table->sql->params[$keyparam1]);\n $this->assertArrayHasKey($keyparam2, $table->sql->params);\n $this->assertEquals($pagecontext2->id, $table->sql->params[$keyparam2]);\n\n $expectedwhere = \" AND r.contextid IN (:$keyparam1,:$keyparam2)\";\n $this->assertStringContainsString($expectedwhere, $table->sql->where);\n }",
"public function search() {\n if(SEARCHBY == 'Google') {\n if($this->request->getData('searchLocation') != '') {\n $this->request->session()->write('searchLocation', $this->request->getData('searchLocation'));\n die();\n }\n }else {\n $this->request->session()->write('city_id', $this->request->getData('city_id'));\n $this->request->session()->write('location_id', $this->request->getData('location_id'));\n die();\n }\n\n }",
"public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->HrEmployee->find('all', array('fields' => array('full_name','HrDepartment.dept_name','HrDesignation.desig_name'), 'group' => array('full_name'), 'conditions' => \tarray(\"OR\" => array ('full_name like' => '%'.$q.'%','HrDepartment.dept_name like' => '%'.$q.'%','HrDesignation.desig_name like' => '%'.$q.'%'), 'AND' => array('HrEmployee.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }",
"public function search() {\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\n\t\t$this->title = \"Search land \";\n\t\t$this->list = $this->Results();\t\r\n return $this->renderWith(array('Land_results', 'App'));\r\n }",
"public function getSearchbydoctor() {\n\n\t\t$doc = Input::get('doc');\t//doctor name\n\t\t$location = Input::get('location'); // town name\n\n\t\t$town_arr = array();\n\t\t$schedules = array();\n\n\t\tif($doc) {\n\n\t\t\t$towns = DB::table('towns')\n\t\t\t\t\t\t->select('id')\n\t\t\t\t\t\t->where('name', 'LIKE', '%'.$location.'%')\n\t\t\t\t\t\t->get();\n\n\t\t\tforeach ($towns as $town) {\n\n\t\t\t\t$town_arr[] = $town->id;\n\t\t\t}\n\t\t\t\n\t\t\t$doctors = DB::table('doctors')\n\t\t\t\t\t\t\t->join('schedules', 'schedules.doctor_id', '=', 'doctors.id')\n\t\t\t\t\t\t\t->where('doctors.name', 'LIKE', '%'.$doc.'%')\n\t\t\t\t\t\t\t->where('active', 1)\n\t\t\t\t\t\t\t->whereIn('schedules.town_id',$town_arr)\n\t\t\t\t\t\t\t->groupBy('schedules.town_id', 'schedules.doctor_id')\n\t\t\t\t\t\t\t->get();\n\n\t\t\t//getting the schedules of the doctors\n\t\t\tforeach ($doctors as $key => $value) {\n\t\t\t\t\n\t\t\t\t$schedules[] = $this->schedule($value->doctor_id);\n\t\t\t}\n\n\t\t\tif($doctors) {\n\n\t\t\t\treturn $schedules;\n\t\t\t}\n\n\t\t\treturn 'No doctors found';\n\t\t} else {\n\n\t\t\treturn null;\n\t\t}\n\t}",
"function ciniki_writingfestivals_winnerSearch($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'start_needle'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Search String'),\n 'limit'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Limit'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'writingfestivals', 'private', 'checkAccess');\n $rc = ciniki_writingfestivals_checkAccess($ciniki, $args['tnid'], 'ciniki.writingfestivals.winnerSearch');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of winners\n //\n $strsql = \"SELECT ciniki_writingfestival_winners.id, \"\n . \"ciniki_writingfestival_winners.festival_id, \"\n . \"ciniki_writingfestival_winners.category, \"\n . \"ciniki_writingfestival_winners.award, \"\n . \"ciniki_writingfestival_winners.sequence, \"\n . \"ciniki_writingfestival_winners.title, \"\n . \"ciniki_writingfestival_winners.author \"\n . \"FROM ciniki_writingfestival_winners \"\n . \"WHERE ciniki_writingfestival_winners.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (\"\n . \"name LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR name LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \") \"\n . \"\";\n if( isset($args['limit']) && is_numeric($args['limit']) && $args['limit'] > 0 ) {\n $strsql .= \"LIMIT \" . ciniki_core_dbQuote($ciniki, $args['limit']) . \" \";\n } else {\n $strsql .= \"LIMIT 25 \";\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.writingfestivals', array(\n array('container'=>'winners', 'fname'=>'id', \n 'fields'=>array('id', 'festival_id', 'category', 'award', 'sequence', 'title', 'author')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['winners']) ) {\n $winners = $rc['winners'];\n $winner_ids = array();\n foreach($winners as $iid => $winner) {\n $winner_ids[] = $winner['id'];\n }\n } else {\n $winners = array();\n $winner_ids = array();\n }\n\n return array('stat'=>'ok', 'winners'=>$winners, 'nplist'=>$winner_ids);\n}",
"public function searchAMember($research)\n {\n $resultat = $this->db->query(\"SELECT \n id,\n pseudo,\n firstName,\n lastName,\n mail\n FROM $this->tableName \n WHERE pseudo LIKE '$research%'\n OR firstName LIKE '$research%'\n OR lastName LIKE '$research%'\n OR mail LIKE '$research%'\");\n return $resultat->fetch(PDO::FETCH_ASSOC);\n }",
"public function search();",
"public function whereSearch()\n {\n\n $conf = $this->pObj->conf;\n $mode = $this->pObj->piVar_mode;\n $view = $this->pObj->view;\n\n $viewWiDot = $view . '.';\n\n // Query with OR and AND\n $str_whereOr = false;\n $arr_whereOr = array();\n // Query with AND NOT LIKE\n $str_whereNot = false;\n $arr_whereNot = array();\n\n\n\n //////////////////////////////////////////////////////////////////////////\n //\n // RETURN in case of no swords or no search fields\n\n if ( !($this->pObj->arr_swordPhrases && $this->pObj->csvSearch) )\n {\n return false;\n }\n // RETURN in case of no swords or no search fields\n //////////////////////////////////////////////////////////////////////////\n //\n // DRS - Development Reporting System\n\n if ( $this->pObj->b_drs_search )\n {\n t3lib_div::devlog( '[INFO/SEARCH] Search fields:<br />' . $this->pObj->csvSearch, $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[HELP/SEARCH] Please configure: views.list.' . $mode . '.search', $this->pObj->extKey, 1 );\n }\n // DRS - Development Reporting System\n //////////////////////////////////////////////////////////////////////////\n //\n // Char for Wildcard\n\n $chr_wildcard = $this->pObj->str_searchWildcardCharManual;\n // Char for Wildcard\n //////////////////////////////////////////////////////////////////////////\n //\n // andWhere AND and OR\n\n $arrSearchFields = explode( ',', $this->pObj->csvSearch );\n $int_sword = 0;\n foreach ( $this->pObj->arr_swordPhrases[ 'or' ] as $arr_swords_and )\n {\n // Suggestion #7730\n // The user has to add a wildcard\n if ( $this->pObj->bool_searchWildcardsManual )\n {\n foreach ( ( array ) $arr_swords_and as $key => $value )\n {\n // First char of search word isn't a wildcard\n $int_firstChar = 0;\n if ( $value[ $int_firstChar ] != $chr_wildcard )\n {\n $value = '[[:<:]]' . $value;\n $arr_swords_and[ $key ] = $value;\n }\n // First char of search word isn't a wildcard\n // First char of search word is a wildcard\n if ( $value[ $int_firstChar ] == $chr_wildcard )\n {\n $value = substr( $value, 1, strlen( $value ) - 1 );\n $arr_swords_and[ $key ] = $value;\n }\n // First char of search word is a wildcard\n // Last char of search word isn't a wildcard\n $int_lastChar = strlen( $value ) - 1;\n if ( $value[ $int_lastChar ] != $chr_wildcard )\n {\n $value = $value . '[[:>:]]';\n $arr_swords_and[ $key ] = $value;\n }\n // Last char of search word isn't a wildcard\n // Last char of search word is a wildcard\n if ( $value[ $int_lastChar ] == $chr_wildcard )\n {\n $value = substr( $value, 0, -1 );\n $arr_swords_and[ $key ] = $value;\n }\n // Last char of search word is a wildcard\n }\n }\n // The user has to add a wildcard\n // Suggestion #7730\n\n foreach ( $arrSearchFields as $arrSearchField )\n {\n list($str_before_as, $str_behind_as) = explode( ' AS ', $arrSearchField );\n list($table, $field) = explode( '.', $str_before_as );\n $table = trim( $table );\n $field = trim( $field );\n\n // Suggestion #7730\n // Wildcard are used by default\n if ( !$this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '%\\' AND ' . $table . '.' . $field . ' LIKE \\'%';\n $str_whereTableField = implode( $str_wrap_sword, $arr_swords_and );\n $str_whereTableField = $table . '.' . $field . ' LIKE \\'%' . $str_whereTableField . '%\\'';\n }\n // Wildcard are used by default\n // The user has to add a wildcard\n if ( $this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '\\') AND (' . $table . '.' . $field . ' REGEXP \\'';\n $str_whereTableField = implode( $str_wrap_sword, $arr_swords_and );\n $str_whereTableField = '(' . $table . '.' . $field . ' REGEXP \\'' . $str_whereTableField . '\\')';\n }\n // The user has to add a wildcard\n // Suggestion #7730\n\n if ( count( $arr_swords_and ) > 1 )\n {\n $str_whereTableField = '(' . $str_whereTableField . ')';\n }\n $arr_whereSword[ $int_sword ][] = $str_whereTableField;\n }\n $int_sword++;\n }\n foreach ( $arr_whereSword as $key_sword => $arr_fields )\n {\n $str_or = implode( ' OR ', $arr_fields );\n $arr_or[] = '( ' . $str_or . ' )';\n }\n $str_whereOr = implode( ' OR ', $arr_or );\n $str_whereOr = ' AND ( ' . $str_whereOr . ' )';\n // andWhere AND and OR\n //////////////////////////////////////////////////////////////////////////\n //\n // andWhere NOT\n\n if ( count( $this->pObj->arr_swordPhrases[ 'not' ] ) > 0 )\n {\n foreach ( $arrSearchFields as $arrSearchField )\n {\n list($str_before_as, $str_behind_as) = explode( ' AS ', $arrSearchField );\n list($table, $field) = explode( '.', $str_before_as );\n $table = trim( $table );\n $field = trim( $field );\n\n // Suggestion #7730\n // Wildcard are used by default\n if ( !$this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '%\\' AND ' . $table . '.' . $field . ' NOT LIKE \\'%';\n $str_whereNot = implode( $str_wrap_sword, $this->pObj->arr_swordPhrases[ 'not' ] );\n $str_whereNot = $table . '.' . $field . ' NOT LIKE \\'%' . $str_whereNot . '%\\'';\n }\n // Wildcard are used by default\n // The user has to add a wildcard\n if ( $this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '\\') AND (' . $table . '.' . $field . ' NOT REGEXP \\'';\n $str_whereNot = implode( $str_wrap_sword, $this->pObj->arr_swordPhrases[ 'not' ] );\n\n // First char of search word isn't a wildcard\n $int_firstChar = 0;\n if ( $str_whereNot[ $int_firstChar ] != $chr_wildcard )\n {\n $str_whereNot = '[[:<:]]' . $str_whereNot;\n }\n // First char of search word isn't a wildcard\n // First char of search word is a wildcard\n if ( $str_whereNot[ $int_firstChar ] == $chr_wildcard )\n {\n $str_whereNot = substr( $str_whereNot, 1, strlen( $str_whereNot ) - 1 );\n }\n // First char of search word is a wildcard\n // Last char of search word isn't a wildcard\n $int_lastChar = strlen( $str_whereNot ) - 1;\n if ( $str_whereNot[ $int_lastChar ] != $chr_wildcard )\n {\n $str_whereNot = $str_whereNot . '[[:>:]]';\n }\n // Last char of search word isn't a wildcard\n // Last char of search word is a wildcard\n if ( $str_whereNot[ $int_lastChar ] == $chr_wildcard )\n {\n $str_whereNot = substr( $str_whereNot, 0, -1 );\n }\n // Last char of search word is a wildcard\n $str_whereNot = '(' . $table . '.' . $field . ' NOT REGEXP \\'' . $str_whereNot . '\\')';\n }\n // The user has to add a wildcard\n // Suggestion #7730\n\n $arr_whereNot[] = $str_whereNot;\n }\n if ( count( $arr_whereNot ) > 0 )\n {\n $str_whereNot = implode( ' AND ', $arr_whereNot );\n $str_whereNot = ' AND ' . $str_whereNot;\n }\n }\n // andWhere NOT\n //////////////////////////////////////////////////////////////////////////\n //\n // RETURN andWhere\n\n $str_return = $str_whereOr . $str_whereNot;\n\n\n\n //////////////////////////////////////////////////////////////////////////\n //\n // DRS - Development Reporting System\n\n if ( $this->pObj->b_drs_search )\n {\n t3lib_div::devlog( '[INFO/SEARCH] andWhere clause:<br />' . $str_return, $this->pObj->extKey, 0 );\n // \" AND ( ( tt_news.title LIKE '%Browser%' OR tt_news_cat.title LIKE '%Browser%' ) AND ( tt_news.title LIKE '%Erweiterung%' OR tt_news_cat.title LIKE '%Erweiterung%' ) )\"\n }\n // DRS - Development Reporting System\n\n return $str_return;\n // RETURN andWhere\n }",
"private function searchForUserInDatabase() {\n $registration = Auth::user()->getUsername();\n// $registration = '02060091';\n if (User::exists($registration)) {\n $user = User::registration($registration);\n } else {\n $user = $this->fillNewUser();\n if ($this->containsNumbers($registration)) {\n $user->active = '0';\n $user->save();\n } else {\n $user->active = '1';\n $user->save();\n $this->registerNewTeacher($user);\n }\n }\n Session::put('user', $user);\n return $user->where('registration', $registration)->with('teacher', 'google')->first();\n }",
"public function Location()\n\n {\n\n if ($this->isAdmin() == TRUE) {\n\n $this->loadThis();\n\n } else {\n\n $searchText = $this->security->xss_clean($this->input->post('searchText'));\n\n $data['searchText'] = $searchText;\n\n $this->load->library('pagination');\n\n $count = $this->Home_model->farmhouse_model_Count($searchText);\n\n $returns = $this->paginationCompress(\"userListing/\", $count, 10);\n\n $data['LocationRecords'] = $this->Home_model->featch_location($searchText);\n\n $this->global['pageTitle'] = 'CodeInsect : User Listing';\n\n $this->loadViews(\"admin/admin_views/LocationView\", $this->global, $data, NULL);\n\n }\n\n }",
"function suggestedmentors(){\n\tglobal $DB, $USER,$OUTPUT, $CFG ;\n\t$mid = atal_get_roleidbyname('mentor');\n\t$content = '';\n\t$atalarray = get_atalvariables();\n\t$incrementby = (int) $atalarray['search_idincrementby'];\n\t$userrole = get_atalrolenamebyid($USER->msn);\n\tif($userrole=='incharge' || $userrole=='student'){\n\t\t//If this user is incharge, show only those Mentors in Assign page whose are assign to that school.\n\t\t$data = $DB->get_record('user_school', array('userid' => $USER->id),'schoolid');\n\t\t$schoolid = $data->schoolid;\n\t\tunset($data);\n\t\t$sql=\"SELECT u.id,u.username,u.firstname,u.lastname,u.auth,u.city,u.department,u.picture FROM {user} u\";\n\t\t$sql.=\" JOIN {user_school} us ON u.id=us.userid WHERE u.msn= ? AND u.deleted=0 AND us.schoolid=? ORDER By u.id DESC LIMIT 0,20\";\n\t\t$data = $DB->get_records_sql($sql, array($mid,$schoolid));\n\t} else{\n\t\t$data = $DB->get_records('user', array('msn' => $mid,'deleted'=>0),'id desc','*',0,20);\n\t}\n\tif(count($data)) {\n\t\tforeach($data as $key=>$values){\n\t\t\t$name = $values->firstname.' '.$values->lastname;\n\t\t\t//get User Profile pic.\t\t\t\n\t\t\t$userurl = getuser_profilelink($values->id);\n\t\t\t$usrimg = get_userprofilepic($values);\n\t\t\t$userpic ='<a href=\"'.$userurl.'\">'.$usrimg.'</a>';\n\t\t\t$content = $content.'\n\t\t\t<div class=\"mentorrow clearfix\">\n\t\t\t\t<div class=\"left picture\">'.$userpic.'\n\t\t\t\t</div>\n\t\t\t\t<div class=\"topic\">'\n\t\t\t\t .$name.' , '.$values->city.'<br>'.$values->department.'\n\t\t\t\t</div>\n\t\t\t</div>';\n\t }\n }\n\treturn $content;\n}",
"public function searchByName()\n {\n $request = \\Request::get('q');\n if ($request !== null){\n return Pokemon::searchByName($request);\n } else {\n return Raid::latest()->get();\n }\n }",
"function lookup_mentors($mentee) {\n // First see if the user is an athlete; if they are,\n // then return athletic mentors\n if(count_records('block_courseprefs_sportusers', 'usersid', $mentee->id) >= 1) {\n return lookup_athletic_mentors($mentee);\n }\n\n global $CFG;\n \n $admin_role = get_config('', 'block_student_gradeviewer_cas_admin');\n\n $path_perm = array(\"$mentee->year/NA/NA\",\n \"$mentee->year/$mentee->college/NA\",\n \"$mentee->year/$mentee->college/$mentee->classification\",\n \"$mentee->year/NA/$mentee->classification\",\n \"NA/$mentee->college/$mentee->classification\",\n \"NA/$mentee->college/NA\",\n \"NA/NA/$mentee->classification\");\n\n $sql = get_mentor_sql($admin_role, $mentee) . \"\n (SELECT u.*\n FROM {$CFG->prefix}user u,\n {$CFG->prefix}block_student_academics aa\n WHERE u.id = aa.usersid\n AND aa.path IN ('\".implode(\"','\", $path_perm).\"'))\";\n\n return get_records_sql($sql);\n}",
"public function findmatchingloginrecordsAction()\n {\n \t//Don't display a new view\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t//Don't use the default layout since this isn't a view call\n\t\t$this->_helper->layout->disableLayout();\n\t\tLogger::log($this->getRequest()->getParams());\n\t\t$selectedloc = $this->getRequest()->getParam('selectedlocation');\n\t\t$repository = $this->getRequest()->getParam('repository', '');\n\t\t$startIndex = $this->getRequest()->getParam('startIndex', 0);\n\t\t$count = $this->getRequest()->getParam('results', 100);\n\t\t\n\t\t$availablerecords = array();\n \tif (isset($selectedloc) && !empty($selectedloc))\n\t\t{\n\t\t\tTransferNamespace::setBulkLocation($selectedloc);\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$selectedloc = TransferNamespace::getBulkLocation();\n\t\t}\n\t\t\n\t\t$searchparameters = array();\n\t\t//Login matches should include:\n\t\t//1. Repository (Home Location) matches the selected location.\n\t\t$locsearchparam = new SearchParameters();\n\t\t$locsearchparam->setColumnName('ItemIdentification.' . ItemDAO::HOME_LOCATION_ID);\n\t\t$locsearchparam->setValue($selectedloc);\n\t\t$locsearchparam->setBooleanValue('');\n\t\t\n\t\t//2. OR Repository, if it exists\n\t\tif (!empty($repository))\n\t\t{\n\t\t\t$locsearchparam->setOpenParenthesis('(');\n\t\t\tarray_push($searchparameters, $locsearchparam);\n\t\t\n\t\t\t$repositorysearchparam = new SearchParameters();\n\t\t\t$repositorysearchparam->setColumnName('ItemIdentification.' . ItemDAO::HOME_LOCATION_ID);\n\t\t\t$repositorysearchparam->setValue($repository);\n\t\t\t$repositorysearchparam->setBooleanValue('OR');\n\t\t\t$repositorysearchparam->setClosedParenthesis(')');\t\t\n\t\t\tarray_push($searchparameters, $repositorysearchparam);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tarray_push($searchparameters, $locsearchparam);\n\t\t}\n\t\t\n\t\t\n\t\t//3. Pending (not logged in)\n\t\t$statussearchparam = new SearchParameters();\n\t\t$statussearchparam->setColumnName('ItemStatus');\n\t\t$statussearchparam->setValue(ItemDAO::ITEM_STATUS_PENDING);\n\t\tarray_push($searchparameters, $statussearchparam);\n\t\t\n\t\t\t\n\t\t$additionalwhere = NULL;\n\n \t$departmentid = TransferNamespace::getTransferDepartmentID(TransferNamespace::LOGIN);\n\t\t$list = TransferNamespace::getTransferList(TransferNamespace::LOGIN);\n\t\t//If the department is actually null then add it to the where clause\n\t\tif (is_null($departmentid) && isset($list) && count($list) > 0)\n\t\t{\n\t\t\t$additionalwhere = 'ItemIdentification.DepartmentID IS NULL';\n\t\t}\n\t\telseif (!is_null($departmentid)) \n\t\t{\n\t\t\t//3. Item departments match the transfer list department\n\t\t\t$searchparam = new SearchParameters();\n\t\t\t$searchparam->setColumnName(\"ItemIdentification.\" . DepartmentDAO::DEPARTMENT_ID);\n\t\t\t$searchparam->setValue($departmentid);\n\t\t\tarray_push($searchparameters, $searchparam);\n\t\t}\n\t\t\n\t\t$curatorid = TransferNamespace::getTransferCuratorID(TransferNamespace::LOGIN);\n\t\t\n\t\t//The curator must exist so if there is anything in the transfer list, it will have a curator.\n\t\tif (!is_null($curatorid))\n\t\t{\n\t\t\t//4. Item curators match the transfer list curator\n\t\t\t$searchparam = new SearchParameters();\n\t\t\t$searchparam->setColumnName(\"ItemIdentification.\" . ItemDAO::CURATOR_ID);\n\t\t\t$searchparam->setValue($curatorid);\n\t\t\tarray_push($searchparameters, $searchparam);\n\t\t}\n\t\t$totalcount = ItemDAO::getItemDAO()->getItemCount($searchparameters, $additionalwhere);\n\t\t$records = ItemDAO::getItemDAO()->getItems($searchparameters, $startIndex, $count, $additionalwhere, array('DepartmentName', 'Curator'));\n\t\tforeach ($records as $record)\n\t\t{\n\t\t\t$disablemessage = $record->getDisableLoginMessage();\n\t\t\tif (empty($disablemessage))\n\t\t\t{\n\t\t\t\t$callnumbers = $record->getCallNumbers();\n\t\t\t\t$stringcallnumbers = implode(\"; \", $callnumbers);\n\t\t\t\t$counts = $record->getInitialCounts();\n\t\t\t\t$vol = $counts->getVolumeCount();\n\t\t\t\t$sheet = $counts->getSheetCount();\n\t\t\t\t$photo = $counts->getPhotoCount();\n\t\t\t\t$box = $counts->getBoxCount();\n\t\t\t\t$other = $counts->getOtherCount();\n\t\t\t\t\n\t\t\t\t$repository = LocationDAO::getLocationDAO()->getLocation($record->getHomeLocationID())->getLocation();\n\t\t\t\t$department = NULL;\n\t\t\t\tif (!is_null($record->getDepartmentID()))\n\t\t\t\t{\n\t\t\t\t\t$department = DepartmentDAO::getDepartmentDAO()->getDepartment($record->getDepartmentID())->getDepartmentName();\n\t\t\t\t}\n\t\t\t\tif (!is_null($department))\n\t\t\t\t{\n\t\t\t\t\t$repository .= '-' . $department;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$curator = NULL;\n\t\t\t\tif (!is_null($record->getCuratorID()))\n\t\t\t\t{\n\t\t\t\t\t$curator = PeopleDAO::getPeopleDAO()->getPerson($record->getCuratorID())->getDisplayName();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tarray_push($availablerecords, array(\n\t\t\t\t\tItemDAO::ITEM_ID => $record->getItemID(),\n\t\t\t\t\t\"CallNumbers\" => $stringcallnumbers,\n\t\t\t\t\tItemDAO::TITLE => $record->getTitle(),\n\t\t\t\t\tItemDAO::AUTHOR_ARTIST => $record->getAuthorArtist(),\n\t\t\t\t\tItemDAO::DATE_OF_OBJECT => $record->getDateOfObject(),\n\t\t\t\t\t\"VolumeCount\" => $vol,\n\t\t\t\t\t\"SheetCount\" => $sheet,\n\t\t\t\t\t\"PhotoCount\" => $photo,\n\t\t\t\t\t\"BoxCount\" => $box,\n\t\t\t\t\t\"OtherCount\" => $other,\n\t\t\t\t\tItemDAO::COMMENTS => $record->getComments(),\n\t\t\t\t\t\"Department\" => $repository,\n\t\t\t\t\t\"Curator\" => $curator\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\t//Only use the results\n \t$resultset = array('startIndex' => $startIndex, 'results' => $count, 'totalRecords' => $totalcount, 'Result' => $availablerecords);\n \t$retval = Zend_Json::encode($resultset);\n\t\t//Make sure JS knows it is in JSON format.\n\t\t$this->getResponse()->setHeader('Content-Type', 'application/json')\n\t\t\t\t\t\t\t\t->setBody($retval);\n }",
"public function search()\n {\n $searchText = Input::get('searchKeyword');\n $level2activities = $this->level2ActivitiesRepository->getAllLeve2Activities(Auth::guard('school')->user()->id, $searchText);\n return view('school.searchQuestions', compact('level2activities'));\n }",
"public function getSearchclinicbyname(){\n\n\t\t\n\t\t$text = Input::get('clinic_name');\t//searching clinic name\n\t\t\n\t\t$town = Input::get('town_name');\t//searching town name\n\n\t\tif($text){\t\t\n\n\t\t\t$inactives = DB::table('schedules')\n\t\t\t\t\t\t->leftJoin('doctors', 'schedules.doctor_id', '=', 'doctors.id')\n\t\t\t\t\t\t->leftJoin('towns', 'schedules.town_id', '=', 'towns.id')\n\t\t\t\t\t\t->leftJoin('inactives', 'inactives.schedule_id', '=', 'schedules.id')\n\t\t\t\t\t\t->where('hospital', 'LIKE', '%'.$text.'%')\n\t\t\t\t\t\t->where('towns.name', 'LIKE', '%'.$town.'%')\n\t\t\t\t\t\t->select('start_time', 'end_time', 'schedules.doctor_id', 'town_id', 'day', 'doctors.name', 'towns.name', 'date', 'hospital')\n\t\t\t\t\t\t->get();\n\n\t\t\tif(sizeOf($inactives) > 0){\n\t\t\t\treturn $inactives;\n\t\t\t}\n\t\t\treturn 'No match';\n\t\t}\n\t}",
"public function search()\n {\n\n $apiKey = \"4a8beb6a33b845edb52173f9f5764b62\";\n $adapter = new FurryBear\\Http\\Adapter\\Curl();\n $provider = new FurryBear\\Provider\\Source\\SunlightOpenStates($adapter, $apiKey);\n $output = new FurryBear\\Output\\Strategy\\JsonToArray();\n\n $fb = new FurryBear\\FurryBear();\n $fb->registerProvider($provider)->registerOutput($output);\n\n $params = array('state' => 'dc', 'chamber' => 'upper');\n $legislator = $fb->legislators->get($params);\n foreach($legislator as $leg)\n {\n $firstname = $leg['last_name'];\n print($firstname);\n //var_dump($leg['last_name']);\n }\n\n }",
"public function search($text) {\n\t $text1 = explode(\" \",$text);\n\t $sql = null;\n\t $text = array_filter($text1);\n\t foreach($text as $val) {\n\t\t$sql .= $val.' | ';\n\t }\n\t $cond1 = substr($sql,0,-3);\n\t $userid = Yii::app()->user->id;\n\t $user = Yii::app()->db2->createCommand()\n\t\t->selectDistinct('e.experiment_id')\n\t\t->from('experiments e')\n\t\t->leftJoin('variables v', 'e.experiment_id = v.experiment__id')\n\t\t->leftJoin('constants c', 'e.experiment_id = c.experiment__id')\n\t\t->leftJoin('conclusions cc', 'e.experiment_id = cc.experiment__id')\n\t\t->leftJoin('metrics m', 'e.experiment_id = m.experiment__id')\n\t\t->leftJoin('trials t', 'e.experiment_id = t.experiment__id')\n\t\t->leftJoin('documents d', 'e.experiment_id = d.experiment__id')\n\t\t->leftJoin('access_grants a', 'e.experiment_id = a.experiment__id')\n\t\t//->where(\"(e.user__id = \" . Yii::app()->user->id . \" OR a.user__id = \" . Yii::app()->user->id.\") AND ((\n\t\t->where(\"(a.user__id = \" . Yii::app()->user->id.\" OR e.organization__id IN (SELECT DISTINCT organization__id FROM memberships WHERE user__id = \" . Yii::app()->user->id . \" )) AND ((\n\t\te.ts_en @@ to_tsquery('{$cond1}')) OR (v.ts_en @@ to_tsquery('{$cond1}')) OR (c.ts_en @@ to_tsquery('{$cond1}')) OR (cc.ts_en @@ to_tsquery('{$cond1}')) OR (m.ts_en @@ to_tsquery('{$cond1}')) OR (t.ts_en @@ to_tsquery('{$cond1}')) OR (d.ts_en @@ to_tsquery('{$cond1}')))\")->queryAll();\n\t\t// to print result use ->queryAll()\n\t\t// to print query use ->text;\n\t\treturn $user;\n\t}",
"protected function _getSearchData() {}",
"public function question_search()\n {\n $tbl_questions = new TblQuestions();\n $query = $tbl_questions->search_question_group($this->input->get('location_choice'), $this->input->get('questionnaire_choice'));\n\n $this->template->content->questions = $query;\n }",
"public function getLocations() {\n $sql = \"SELECT locAID, locTitle, FK_deptID, locActive FROM $this->table_name\";\n $query = $this->conn->query($sql);\n return $query;\n }",
"function AdvancedSearchWhere() {\n\t\tglobal $Security, $CustomView1;\n\t\t$sWhere = \"\";\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->DetailNo, FALSE); // Field DetailNo\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->PatientID, FALSE); // Field PatientID\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->StudyDate, FALSE); // Field StudyDate\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->StudyTime, FALSE); // Field StudyTime\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->PatientName, FALSE); // Field PatientName\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->PatientSex, FALSE); // Field PatientSex\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->Modality, FALSE); // Field Modality\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->ProtocolName, FALSE); // Field ProtocolName\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->BodyPartExamined, FALSE); // Field BodyPartExamined\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->StudyID, FALSE); // Field StudyID\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->InstanceNumber, FALSE); // Field InstanceNumber\n\t\t$this->BuildSearchSql($sWhere, $CustomView1->Status, FALSE); // Field Status\n\n\t\t// Set up search parm\n\t\tif ($sWhere <> \"\") {\n\t\t\t$this->SetSearchParm($CustomView1->DetailNo); // Field DetailNo\n\t\t\t$this->SetSearchParm($CustomView1->PatientID); // Field PatientID\n\t\t\t$this->SetSearchParm($CustomView1->StudyDate); // Field StudyDate\n\t\t\t$this->SetSearchParm($CustomView1->StudyTime); // Field StudyTime\n\t\t\t$this->SetSearchParm($CustomView1->PatientName); // Field PatientName\n\t\t\t$this->SetSearchParm($CustomView1->PatientSex); // Field PatientSex\n\t\t\t$this->SetSearchParm($CustomView1->Modality); // Field Modality\n\t\t\t$this->SetSearchParm($CustomView1->ProtocolName); // Field ProtocolName\n\t\t\t$this->SetSearchParm($CustomView1->BodyPartExamined); // Field BodyPartExamined\n\t\t\t$this->SetSearchParm($CustomView1->StudyID); // Field StudyID\n\t\t\t$this->SetSearchParm($CustomView1->InstanceNumber); // Field InstanceNumber\n\t\t\t$this->SetSearchParm($CustomView1->Status); // Field Status\n\t\t}\n\t\treturn $sWhere;\n\t}",
"public function search ($fixer)\n {\n $params = fixer::input($fixer)->get();\n if($params->toloProvince != '' || $params->toloCity != '' || $params->toloProvince2 != '' || $params->toloCity2 != '' ){\n $routeTruck = $this->dao->selectList('tender.selectRouteTruck', ['from_province'=>$params->toloProvince ,'from_city'=>$params->toloCity,'to_province'=>$params->toloProvince2,'to_city'=>$params->toloCity2 ]);\n $truck_source_id_array = array('0'=>'0');\n foreach($routeTruck AS $key=>$val){\n $truck_source_id_array[]=$val->truck_source_id;\n }\n $params->truck_source_id = $truck_source_id_array;\n }\n $trucksInfo = $this->dao->selectPage('car_plant.warehouse_selectPage', $params);\n $phones = [];\n if($trucksInfo->result){\n \tforeach ($trucksInfo->result as $_row){\n \t\t$phones[] = $_row->driver_phone;\n \t}\n \t$historys = $this->dao->selectList('car_plant.lastPoint',array('phones'=>$phones));\n \t$_histroys = [];\n \tforeach ($historys as $his){\n \t\t$_histroys[$his->phone] = $his;\n \t}\n \tforeach ($trucksInfo->result as $_row){\n \t\t$_row->type = $_histroys[$_row->driver_phone]->type;\n \t\t$_row->address = $_histroys[$_row->driver_phone]->address;\n \t\t$_row->time = $_histroys[$_row->driver_phone]->time;\n \t}\n }\n \n return $trucksInfo;\n }",
"public function search() {\n\t\t$this->tpl->setTitle($this->pl->txt('report_users_per_course'));\n\t\t$this->table = new ilReportingUsersPerCourseSearchTableGUI($this, ilReportingGUI::CMD_SEARCH);\n\t\t$this->table->setTitle($this->pl->txt('search_courses'));\n\t\tparent::search();\n\t}",
"function basic_search($dbh) {\n if (isset($_POST['criteria']) ) {\n\n $search_by = $_POST['criteria'];\n $search_term = $_POST['search_term'];\n\n //search using keyword (recipe name)\n if ($search_by == 'keyword') {\n $sql = \"SELECT RID, name, time FROM recipe WHERE name LIKE ?\";\n $values = array(\"%\".$search_term.\"%\");\n\n // search using time in minutes less than or equal to search term\n } else if ($search_by == 'time') {\n $sql = \"SELECT RID, name, time FROM recipe WHERE time <= ?\";\n $values = array($search_term); \n\n // search using ingredient name\n } else if ($search_by == 'ingredient') {\n $sql = \"SELECT RID, recipe.name, time FROM recipe, ingredient \n WHERE ingredient.name LIKE ? AND RID = recipeID\";\n $values = array(\"%\".$search_term.\"%\");\n\n // search using equipment name\n } else if ($search_by == 'equipment') {\n $sql = \"SELECT RID, recipe.name, time FROM recipe, equipment \n WHERE equipment.name LIKE ? AND RID = recipeID\";\n $values = array(\"%\".$search_term.\"%\");\n } \n \n $resultset = prepared_query($dbh,$sql,$values);\n $num_rows = $resultset->numRows();\n $resultURL = \"recipe.php\"; //$_SERVER['PHP_SELF'];\n\n echo \"<p>$num_rows results found.\";\n while($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) {\n $RID = $row['RID'];\n $name = $row['name'];\n $time = $row['time'];\n echo \"<p><a href='$resultURL?RID=$RID' id='recipelink'>$name</a> $time minutes\\n\";\n }\n }\n }",
"function locationSearch($srch_options){\n\t\t\n global $dbConn;\n $params = array(); \n\t\t$default_opts = array(\n\t\t\t'limit' => 6,\n\t\t\t'page' => 0,\n\t\t\t'type' => 'a',\n\t\t\t'orderby' => 'id',\n\t\t\t'order' => 'a',\n\t\t\t'latitude' => null,\n\t\t\t'longitude' => null,\n\t\t\t'radius' => 1000,\n\t\t\t'dist_alg' => 's',\n\t\t\t'search_string' => null,\n\t\t\t'n_results' => false\n\t\t);\n\n\t\t$options = array_merge($default_opts, $srch_options);\n\t\t\n\t\t/* no trends from search queries\n\t\tif($options['search_string'] !== null)\n\t\t\tqueryAdd($options['search_string']);\n\t\t*/\n\t\t\n\t\t$nlimit = intval($options['limit']);\n\t\t$skip = intval($options['page']) * $nlimit;\n\t\n\t\t$where = '';\n\t\t\n\t\tif( $options['type'] != 'a' ){\n\t\t\t$types = explode(',',$options['type']);\n\t\t\tif(!in_array('a',$types)){\n\t\t\t\t$types_or = array();\n\t\t\t\tforeach($types as $type){\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\t$types_or[] = \" category_id='2' \";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'r':\n\t\t\t\t\t\t\t$types_or[] = \" category_id='1' \";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\t\t$types_or[] = \" category_id='3' \";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($where != '' ) $where .= ' AND ';\n//\t\t\t\t$where .= '(' . implode(' OR ', $types_or) . ')';\n\t\t\t\t$where .= \"(:Types_or)\";\n $params[] = array( \"key\" => \":Types_or\",\n \"value\" =>implode(' OR ', $types_or));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( !is_null($options['latitude']) && !is_null($options['longitude']) && !is_null($options['radius']) ){\n\t\t\t$lat = doubleval($options['latitude']);\n\t\t\t$long = doubleval($options['longitude']);\n\t\t\t$radius = intval($options['radius']);\n\n\t\t\tif($where != '') $where .= ' AND ';\n\n\t\t\tif( $options['dist_alg'] == 's'){\n\t\t\t\t//the 1 latitude degree ~= 110km, 1 degree longitude = 110km at equater, 78 at 45 degrees, 0 at pole\n\t\t\t\t//for longitude at [33,35] square 0.1 => 14km, 0.01 => 1.4km, 0.001 => 140m so. good approx for a degree square is approx 140km\n\t\t\t\t//use formula for longitude\n\t\t\t\t$long_rad = deg2rad($long);\n\t\t\t\t$c = 40075;\n\n\t\t\t\t$lat_conv = doubleval(110000.0);\n\t\t\t\t$long_conv = (1000 * $c * cos($long_rad))/360;\n\n\t\t\t\t$diff_lat = round($radius/$lat_conv, 3);\n\t\t\t\t$diff_long = round($radius/$long_conv, 3);\n\t\t\t\t\n\t\t\t\t$diff_long *= 2;\n\n\t\t\t\t\n//\t\t\t\t$where .= \" squareLocationDiff(latitude,longitude,$lat,$long,$diff_lat,$diff_long) \";\n\t\t\t\t$where .= \" squareLocationDiff(latitude,longitude,:Lat,:Long,:Diff_lat,:Diff_long) \";\n $params[] = array( \"key\" => \":Lat\",\n \"value\" =>$lat);\n $params[] = array( \"key\" => \":Long\",\n \"value\" =>$long);\n $params[] = array( \"key\" => \":Diff_lat\",\n \"value\" =>$diff_lat);\n $params[] = array( \"key\" => \":Diff_long\",\n \"value\" =>$diff_long);\n\t\t\t}else{\n\t\t\t\t$where .= \" LocationDIff(latitude,longitude,$lat,$long) <= $radius \";\n\t\t\t\t$where .= \" LocationDIff(latitude,longitude,:Lat,:Long) <= :Radius \";\n $params[] = array( \"key\" => \":Lat\",\n \"value\" =>$lat);\n $params[] = array( \"key\" => \":Long\",\n \"value\" =>$long);\n $params[] = array( \"key\" => \":Radius\",\n \"value\" =>$radius);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( !is_null($options['search_string']) ){\n\t\t\t$search_strings = explode(' ',$options['search_string']);\n\t\t\t\n\t\t\t$sub_where = array();\n\n\t\t\tforeach($search_strings as $in_search_string){\n\n\t\t\t\t$search_string = trim(strtolower($in_search_string));\n\n\t\t\t\tif($search_string == '') continue;\n\n\t\t\t\t$sub_where[] = \" LOWER(name) LIKE '%{$search_string}%' \";\n\t\t\t}\n\n\t\t\tif( count($sub_where) != 0 ){\n\t\t\t\tif($where != '') $where .= ' AND ';\n//\t\t\t\t$sub_where = '(' . implode(' AND ', $sub_where) . ')';\n\t\t\t\t$sub_where = '(:Sub_where)';\n $params[] = array( \"key\" => \":Sub_where\",\n \"value\" =>implode(' AND ', $sub_where));\n\t\t\t\t$where .= $sub_where;\n\t\t\t}\n\t\t}\n\n\t\t$orderby = $options['orderby'];\n\t\t$order = ($options['order'] == 'a') ? 'ASC' : 'DESC';\n\t\n\t\tif( $options['n_results'] == false ){\n//\t\t\t$query = \"SELECT * FROM `cms_locations` WHERE $where ORDER BY $orderby $order LIMIT $skip, $nlimit\";\n\t\t\t$query = \"SELECT * FROM `cms_locations` WHERE $where ORDER BY $orderby $order LIMIT :Skip, :Nlimit\";\n $params[] = array( \"key\" => \":Skip\",\n \"value\" =>$skip,\n \"type\" =>\"::PARAM_INT\");\n $params[] = array( \"key\" => \":Nlimit\",\n \"value\" =>$nlimit,\n \"type\" =>\"::PARAM_INT\");\n//\t\t\t$ret = db_query($query);\n $select = $dbConn->prepare($query);\n PDO_BIND_PARAM($select,$params);\n $res = $select->execute();\n\n $ret = $select->rowCount();\n\t\t\t$media = array();\n//\t\t\twhile($row = db_fetch_array($ret))\n//\t\t\t\t$media[] = $row;\t\n $media = $select->fetchAll();\n\t\t\treturn $media;\n\t\t}else{\n\t\t\t$query = \"SELECT COUNT(id) FROM `cms_locations` WHERE $where\";\n//\t\t\t$ret = db_query($query);\n//\t\t\t$row = db_fetch_array($ret);\n $select = $dbConn->prepare($query);\n PDO_BIND_PARAM($select,$params);\n $res = $select->execute();\n\n $ret = $select->rowCount();\n $row = $select->fetch();\n\t\t\t$n_results = $row[0];\n\t\t\treturn $n_results;\n\t\t}\n\t\t\n\n\t}",
"function fun_findLocationRelationInfo($table, $criteria){\t\t\n\t\t$sql = \"SELECT * FROM \" .$table. \" \" .$criteria. \"\";\n\t\t$rs = $this->dbObj->createRecordset($sql);\n\t\tif($this->dbObj->getRecordCount($rs) > 0){\n\t\t\treturn $arr = $this->dbObj->fetchAssoc($rs);\t\t\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}"
] | [
"0.5676264",
"0.55996805",
"0.55935055",
"0.5572057",
"0.55496514",
"0.54304487",
"0.54024893",
"0.5339338",
"0.53318805",
"0.53282434",
"0.53057873",
"0.5271579",
"0.52220476",
"0.52159286",
"0.52152455",
"0.5209655",
"0.51938903",
"0.51785445",
"0.5174123",
"0.5149667",
"0.5135751",
"0.5132214",
"0.51133615",
"0.5102032",
"0.5071283",
"0.5060858",
"0.50521266",
"0.50461924",
"0.50391996",
"0.5017234"
] | 0.6014836 | 0 |
Search the database for the doctor | public function getSearchbydoctor() {
$doc = Input::get('doc'); //doctor name
$location = Input::get('location'); // town name
$town_arr = array();
$schedules = array();
if($doc) {
$towns = DB::table('towns')
->select('id')
->where('name', 'LIKE', '%'.$location.'%')
->get();
foreach ($towns as $town) {
$town_arr[] = $town->id;
}
$doctors = DB::table('doctors')
->join('schedules', 'schedules.doctor_id', '=', 'doctors.id')
->where('doctors.name', 'LIKE', '%'.$doc.'%')
->where('active', 1)
->whereIn('schedules.town_id',$town_arr)
->groupBy('schedules.town_id', 'schedules.doctor_id')
->get();
//getting the schedules of the doctors
foreach ($doctors as $key => $value) {
$schedules[] = $this->schedule($value->doctor_id);
}
if($doctors) {
return $schedules;
}
return 'No doctors found';
} else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function doctor_search()\n\t\t{\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$name = isset($this->_request['name'])? '%'.$this->_request['name'].'%':'';\n\t\t\t$phone_no = isset($this->_request['mobile_number']) ? '%'.$this->_request['mobile_number'].'%':'';\n\t\t\t$speacializaton = isset($this->_request['specializaton'])? '%'.$this->_request['specializaton'].'%':'';\n\t\t\t$pincode = isset($this->_request['pincode']) ? '%'.$this->_request['pincode'].'%' :'';\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$where = \" WHERE 1\";\n\t\t\t\t$where1 = \"\";\n\t\t\t\tif(isset($this->_request['name']) && $this->_request['name']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.du_name like '%\".$this->_request['name'].\"%'\";\n\t\t\t\t}\n\t\t\t\tif(isset($this->_request['mobile_number']) && $this->_request['mobile_number']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.du_phone_no like '%\".$this->_request['mobile_number'].\"%'\";\n\t\t\t\t}\n\t\t\t\tif(isset($this->_request['specializaton']) && $this->_request['specializaton']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.specializaton like '%\".$this->_request['specializaton'].\"%'\";\n\t\t\t\t}\n\t\t\t\tif(isset($this->_request['pincode']) && $this->_request['pincode']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.du_pincode like '%\".$this->_request['pincode'].\"%'\";\n\t\t\t\t}\n\t\t\t\t/*if(isset($this->_request['start_date_time']) && $this->_request['end_date_time']!='')\n\t\t\t\t{\n\t\t\t\t\t$fromdate = date('Y-m-d',strtotime($this->_request['from_date']));\n\t\t\t\t\t$todate = date('Y-m-d',strtotime($this->_request['to_date']));\n\t\t\t\t\t$where .=\" AND date_format(da.start_date,'%Y-%m-%d') >= '\".$fromdate.\"' AND date_format(da.end_date,'%Y-%m-%d') <= '\".$todate.\"'\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$where1 .=\" AND date_format(da.start_date,'%Y-%m-%d') >= '\".date('Y-m-d').\"'\";\n\t\t\t\t}*/\n\t\t\t\t$query=\"SELECT du.du_id, du.du_name, du.du_phone_no, du.du_pic, du.du_city,du.du_district,\n\t\t\t\tdu.du_state, du.du_pincode, du.specializaton, du.qualification, du.du_address,\n\t\t\t\tda.start_date_time, da.doctor_visit_add, DISTINCT(da.doctor_visit_state_id),\n\t\t\t\tFROM table_doctor du\n\t\t\t\tLEFT JOIN doctor_availability da ON du.du_id = da.doc_id {$where1}\n\t\t\t\tLEFT JOIN m_city mc ON du.du_city = mc.cty_id\n\t\t\t\tLEFT JOIN m_state ms ON du.du_state = ms.st_id {$where}\";\n\t\t\t\t$stmt = $this->db->prepare($query);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t$error = array('status' => \"Sucess\", \"msg\" =>\"Availability Data\", \"data\" => $result);\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tcatch(Exception $ex)\n\t\t\t{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" =>$ex->getMessage());\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t}",
"public function doctorSearch()\n {\n \n $name= Input::get ( 'name' );\n $spec = Input::get ( 'spec' );\n $loc = Input::get ( 'loc' );\n $doctors = Doctor::where ( 'name', 'LIKE', '%' . $name . '%' )\n ->where ( 'speciality', 'LIKE', '%' . $spec . '%' )\n ->where ( 'work_address', 'LIKE', '%' . $loc . '%' )\n ->where ('is_doctor', 'LIKE', '%' . '1' . '%') //->orderByraw(' 6* rate_sum / rate_count - 4* (fee/100) DESC')\n ->get ();\n if (count ( $doctors ) > 0)\n {\n $doctors = $doctors->sort(function ($a, $b) {\n $a_app_count = DB::table('appointments')\n ->where('doctor_id', $a->id)\n ->count();\n $a_score = 6* $a->rate_sum / $a->rate_count - 4* ( $a->fee/100) + 3* $a_app_count ;\n\n $b_app_count = DB::table('appointments')\n ->where('doctor_id', $b->id)\n ->count();\n $b_score = 6* $b->rate_sum / $b->rate_count - 4* ( $b->fee/100) + 3* $b_app_count ;\n\n\n if ($a_score == $b_score) {\n return 0;\n }\n return ($a_score > $b_score) ? -1 : 1;\n });\n return view ( 'pages.select_doctor', ['doctors' => $doctors] )->withDetails ( $doctors )->withQuery ( $name )->withQuery ( $spec )->withQuery ( $loc );\n }\n \n else\n return view ( 'pages.select_doctor', ['doctors' => $doctors] )->withMessage ( 'No Details found. Try to search again !' );\n }",
"public function findDoctor(Request $request)\n {\n // Build query to find in DB\n $perPage = Config::get('constant.API_RECORD_PER_PAGE');\n $builder = Doctor::select('name', 'avatar', 'phone', 'des', 'vote', 'province', 'district', 'specialization')\n ->where('status', '=', 0);\n\n // Check filter condition to query\n $provinces = $request->get('provinces');\n $districts = $request->get('districts');\n $specializations = $request->get('specializations');\n\n if (!empty($districts)) {\n $builder->whereIn('district', explode(\",\", $districts));\n } else if (!empty($provinces)) {\n $builder->whereIn('province', explode(\",\", $provinces));\n }\n\n if (!empty($specializations)) {\n $builder->whereIn('specialization', explode(\",\", $specializations));\n }\n\n // Return result\n return $builder->paginate($perPage);\n }",
"public function filterDoctor($query_string){\n $sql=\"SELECT * FROM doctor_tab as doc JOIN hospital_tab as hosp on (doc.hosp_id = hosp.hosp_id) WHERE hosp.hosp_location LIKE '$query_string%' OR doc.doc_name LIKE '$query_string%' OR doc.doc_degree LIKE '$query_string%' OR doc.doc_gender LIKE '$query_string%'\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n $response = array(\n 'status' => 500,\n 'status_message' => 'No data found.');\n } else {\n $response = array(\n 'status' => 200,\n 'status_message' => $result->result_array());\n }\n return $response;\n }",
"public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->HrEmployee->find('all', array('fields' => array('full_name','HrDepartment.dept_name','HrDesignation.desig_name'), 'group' => array('full_name'), 'conditions' => \tarray(\"OR\" => array ('full_name like' => '%'.$q.'%','HrDepartment.dept_name like' => '%'.$q.'%','HrDesignation.desig_name like' => '%'.$q.'%'), 'AND' => array('HrEmployee.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }",
"public function show(Doctor $doctor)\n {\n $user_id = Auth::user()->id; // user login id\n $User_data = User::find($user_id);\n $rols = $User_data->hasAccess(['search-doctor']);\n if($rols){\n $user_is = Auth::user()->user_type;\n if($user_is == 1){\n $all = Doctor::all();\n $arr['doctors']=$all;\n return view('doctor.All_doctors',$arr);\n }else{\n $user_id = Auth::user()->center_id;\n $all = Doctor::where('center_id',$user_id)->get();\n $arr['doctors']=$all;\n return view('doctor.All_doctors',$arr);\n }\n\n\n }else{\n abort(401, 'Access denied - وصول غير مسموح ');\n }\n\n\n\n\n\n }",
"public function show(Doctor $doctor)\n {\n //\n }",
"public function show(Doctor $doctor)\n {\n //\n }",
"public function show(Doctor $doctor)\n {\n //\n }",
"public function show(Doctor $doctor)\n {\n //\n }",
"public function search_patient($search_text = '', $doctor_id = '') {\n\n $get_search_patient_sql = \"SELECT \n CONCAT(user_first_name, ' ',user_last_name) AS user_name, \n CONCAT(user_first_name, ' ',user_last_name,' ',user_phone_number,' ',user_unique_id) AS user_search, \n user_unique_id,\n user_id,\n user_phone_number,\n user_email,\n appointment_id,\n appointment_clinic_id\n FROM \n \" . $this->users_table . \" \n LEFT JOIN\n \" . TBL_APPOINTMENTS . \" ON user_id = appointment_user_id AND appointment_status != 9 \";\n\n if (!empty($doctor_id)) {\n $get_search_patient_sql.=\" AND appointment_doctor_user_id=\" . $doctor_id . \" \";\n }\n\n $get_search_patient_sql .= \"\n WHERE \n user_status != 9 AND\n user_type = 1 AND\n (\n user_first_name LIKE '%\" . $search_text . \"%' OR\n user_last_name LIKE '%\" . $search_text . \"%'OR\n user_unique_id LIKE '%\" . $search_text . \"%' OR\n user_phone_number LIKE '%\" . $search_text . \"%' \n )\n GROUP BY user_id ORDER BY user_name ASC\n \";\n\n $get_patient_data = $this->get_all_rows_by_query($get_search_patient_sql);\n return $get_patient_data;\n }",
"public function display_doctors(){\r\n\t\t$select = \"Doctor\";\r\n\t\t$this->db->where('vuser_post',$select);\r\n\t\t$query = $this->db->get('vuser');\r\n\t\treturn $query->result();\r\n\t}",
"public function search();",
"public function getDoctorinfo($doc_id) {\n $sql = \"SELECT * FROM doctor_tab as d JOIN hospital_tab as h on (d.hosp_id = h.hosp_id) WHERE d.doc_id = '$doc_id'\";\n // print_r($sql); die();\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return FALSE;\n } else {\n return $result->result_array();\n }\n }",
"public function index($doctor)\n {\n $doctore = Doctor::find($doctor);\n return view('doctorconsultorio.index', ['doctor'=>$doctore]);\n }",
"public function index(Request $request, Department $department)\n {\n // $all = Doctor::whereBetween('years_experience', [0,70])->get();\n // dd($all->count());\n \n\n $treatments = Treatment::orderBy('id')->with('doctors')->paginate(20);\n \n $departments = Department::orderBy('name')->with('doctors')->paginate(20);\n\n $hospitals = Hospital::orderBy('name')->with('doctors')->paginate(20);\n\n\n// Creating Hospital\n $docHospitals = Hospital::orderBy('id')->with('doctors')->get();\n $docDepartments = Department::orderBy('id')->with('doctors')->get();\n $docLocations = Location::orderBy('id')->with('doctors')->get();\n\n\n// SORT DOCTORS BY YEARS OF EXPERIENCE\n $five_years = Doctor::FiveYears();\n $six_years = Doctor::SixYears();\n $twelve_years = Doctor::TwelveYears();\n $eighteen_years = Doctor::EighteenYears();\n $twentyfour_years = Doctor::TwentyFourYears();\n $thirty_years = Doctor::ThirtyYears();\n $thirtysix_years = Doctor::ThirtySixYears();\n $fourtytwo_years = Doctor::FourtyTwoYears();\n $fourtyeight_years = Doctor::FourtyEightYears();\n $fiftyfour_years = Doctor::FiftyFourYears();\n $sixty_years = Doctor::SixtyYears();\n\n// Get DOCTOR AND CORRESPONDING LOCATIONS\n $locations = Location::orderBy('city')->with('doctors')->paginate(20);\n\n $search = $request->input('search');\n $doctors = Doctor::orderBY('id')->DoctorsByName($search)->paginate(20);\n // dd($doctors);\n\n return view('doctors.index', compact([\n 'doctors', 'search', 'treatments', 'departments', 'locations', 'hospitals', 'five_years', 'six_years', 'twelve_years', 'eighteen_years', 'twentyfour_years', 'thirty_years', 'thirtysix_years', 'fourtytwo_years', 'fourtyeight_years', 'fiftyfour_years', 'sixty_years', 'docHospitals', 'docDepartments' ,'docLocations',\n ]));\n }",
"function getVisitsByDoctorID($doctor_id){\n global $dbh;\n $query = \"SELECT * FROM Visit WHERE doctor_id = '$doctor_id' ORDER BY visit_date\";//.intval($patient_id) ;\n $result = $dbh->query($query);\n $result = $result->fetchAll();\n return $result;\n \n }",
"private function check_doctor_availability() {\n\t\t\tif($this->get_request_method() != \"GET\") {\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t\t\t$todays_date = date('Y-m-d');\n\t\t\t\t\t$sql = \"SELECT `table_doctor`.`du_id`, `table_doctor`.`du_name`, `table_doctor`.`du_email`,\n\t\t\t\t\t`table_doctor`.`du_phone_no`, `table_doctor`.`du_pic`, `table_doctor`.`specializaton`,\n\t\t\t\t\t`table_doctor`.`qualification`, `doctor_availability`.`start_date_time`,\n\t\t\t\t\t`doctor_availability`.`end_date_time`, `doctor_availability`.`doctor_visit_add`,\n\t\t\t\t\t`doctor_availability`.`doctor_visit_district`,`doctor_availability`.`doctor_visit_pincode_id`,\n\t\t\t\t\t`m_state`.`st_name`, `m_city`.`cty_id`\n\t\t\t\t\tFROM table_doctor\n\t\t\t\t\tJOIN `doctor_availability` ON `doctor_availability`.`doc_id` = `table_doctor`.`du_id`\n\t\t\t\t\tLEFT JOIN m_city ON `m_city`.`cty_id` = `doctor_availability`.`doctor_visit_city_id`\n\t\t\t\t\tLEFT JOIN m_state ON `m_state`.`st_id` = `doctor_availability`.`doctor_visit_state_id`\n\t\t\t\t\tWHERE `table_doctor`.`du_id` = \".$_GET['doc_id'].\" AND `user_type` = 0 LIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$searchResult = $stmt->execute();\n\t\t\t\t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\nprint_r($results); die;\n\t\t\t\t\t\t$startDate = $results[0]['start_date'];\n\t\t\t\t\t\t$endDate = $results[0]['end_date'];\n\t\t\t\t\t$check_date_in_range = $this->check_in_range($startDate, $endDate, $todays_date);\n\n\t\t\t\tif(!empty($check_date_in_range)) {\n\t\t\t\t\t\t$error = array('status' => 'Success', 'msg' => 'Data Found', 'data' => json_encode($results[0]));\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t} else{\n\t\t\t\t\t$sql = \"SELECT `table_doctor`.`du_id`, `table_doctor`.`du_name`,`table_doctor`.`du_email`,`table_doctor`.`du_phone_no`,`table_doctor`.`du_pic`, `table_doctor`.`specializaton`,`table_doctor`.`qualification`, `table_doctor`.`du_address`, `table_doctor`.`du_city`,`table_doctor`.`du_district`,`table_doctor`.`du_state`,`table_doctor`.`du_pincode` FROM table_doctor WHERE `table_doctor`.`du_id` = \".$_GET['doc_id'].\" AND `user_type` = 0 LIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$searchResult = $stmt->execute();\n\t\t\t\t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t$error = array('status' => 'Success', 'msg' => 'Doctor Available', 'data' => json_encode($results[0]));\n\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t}",
"public function getAllDoctors() {\n $sql = \"SELECT * FROM doctor_tab as d JOIN hospital_tab as t on (d.hosp_id = t.hosp_id)\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return FALSE;\n } else {\n return $result->result_array();\n }\n }",
"public function index()\n {\n $doctor = Doctor::All();\n return DoctorCollection::collection($doctor);\n }",
"public function search()\n {\n // get post parameters\n $adname = $_POST['adname'];\n\n // show all ads with matching titles\n $ads = $this->ads->search($adname);\n $this->present($ads,'');\n }",
"public function doctor_availability() {\n\t\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif($_GET['doc_id']){\n\t\t\t\t$doctor_id = $_GET['doc_id'];\n\t\t\t\t$sql = \"SELECT du.du_name, du.du_email, du.du_phone_no, du.du_pic, du.du_address,\n\t\t\t\tdu.du_city, du.du_district, du.du_state, du.du_pincode, du.specializaton, du.qualification,\n\t\t\t\tda.start_date_time, da.end_date_time, da.doctor_visit_add, da.doctor_visit_district, da.doctor_visit_pincode_id,\n\t\t\t\tst.st_name, ct.cty_name\n\t\t\t\tFROM table_doctor as du\n\t\t\t\tLEFT JOIN doctor_availability as da ON da.doc_id = du.du_id\n\t\t\t\tLEFT JOIN m_state as st ON st.st_id = da.doctor_visit_state_id\n\t\t\t\tLEFT JOIN m_city as ct ON ct.cty_id = da.doctor_visit_city_id\n\t\t\t\tWHERE du.du_id = $doctor_id ORDER BY end_date_time DESC LIMIT 10\";\n\n\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t$error = array('status' => \"Sucess\", \"msg\" =>\"Availability Data\", \"data\" => $result);\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t}",
"public function getSearchbyspeciality() {\n\n\t\t$town_arr = array();\n\n\t\t$doc = Input::get('practitioner');\n\t\tif($doc) {\n\t\t\t$special = Specialty::find($doc);\n\t\t\tif($special) {\n\t\t\t\t$special = $special->name;\n\t\t\t}\n\t\t} else {\n\t\t\t$special = null;\n\t\t}\n\t\t\n\t\t$location = Input::get('location');\n\n\t\t$towns = DB::table('towns')\n\t\t\t\t\t\t->select('id')\n\t\t\t\t\t\t->where('name', 'LIKE', '%'.$location.'%')\n\t\t\t\t\t\t->get();\n\n\n\n\t\tforeach ($towns as $town) {\n\t\t\t$town_arr[] = $town->id;\n\t\t}\n\t\t\n\t\t$doctors = DB::table('doctors')\n\t\t\t\t\t\t->join('schedules', 'schedules.doctor_id', '=', 'doctors.id')\n\t\t\t\t\t\t->where('doctors.specialties', 'LIKE', '%'.$special.'%')\n\t\t\t\t\t\t->where('active', 1)\n\t\t\t\t\t\t->whereIn('schedules.town_id',$town_arr)\n\t\t\t\t\t\t->groupBy('schedules.town_id', 'schedules.doctor_id')\n\t\t\t\t\t\t->get();\n\n\t\tif($doctors) {\n\n\t\t\treturn View::make('channel.doctor')\n\t\t\t\t->with('doctors', $doctors);\n\t\t}\n\t\treturn Redirect::to('channel')\n\t\t\t->with('message', 'Could not find any doctors');\n\t}",
"public function getDoctor($id)\n {\n return $this->hospitalRepository->find($id)->doctors()->get();\n }",
"public function getDepartmentDoctors($hospital_id,$department_id){\n\t\tglobal $con;\n\t\t$query=\"SELECT * FROM doctors\n\t\t\t\tWHERE hospital_id=\\\"$hospital_id\\\"\n\t\t\t\tAND department=\\\"$department_id\\\"\";\n\t\t$result=$this->select($con,$query);\n\t\treturn $result;\n\t}",
"public function getAllDoctorsData(){\n $sql = \"SELECT d.doc_name,d.doc_email,d.doc_degree,d.doc_gender,t.hosp_name FROM doctor_tab as d JOIN hospital_tab as t on (d.hosp_id = t.hosp_id)\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return FALSE;\n } else {\n return $result->result_array();\n }\n }",
"public function show(doctorlist $doctorlist)\n {\n //\n }",
"public function search() {\n }",
"public function getAllDoctors_Details($hosp_id) {\n $sql = \"SELECT * FROM doctor_tab as d JOIN hospital_tab as h on (d.hosp_id = h.hosp_id) WHERE h.hosp_id = '$hosp_id'\";\n //print_r($sql); die();\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return FALSE;\n } else {\n return $result->result_array();\n }\n }",
"public function index()\n {\n $doctors=doctor::all();\n\n return view('admin.doctor_index',compact('doctors'));\n }"
] | [
"0.6577685",
"0.5690506",
"0.5682957",
"0.5674712",
"0.562389",
"0.55976146",
"0.55433017",
"0.55433017",
"0.55433017",
"0.55433017",
"0.5521737",
"0.5507579",
"0.5499504",
"0.54861355",
"0.5482648",
"0.54804343",
"0.54788166",
"0.54674506",
"0.54348385",
"0.5402645",
"0.5391962",
"0.53690976",
"0.53511614",
"0.5303188",
"0.52981293",
"0.5259554",
"0.5257143",
"0.5253049",
"0.52448547",
"0.52350026"
] | 0.61339605 | 1 |
display the make account view | public function getMakeaccount() {
return View::make('channel.account');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n { \n $user=$this->currentuser();\n $accounts =$this->useraccounts() ;\n return view('accounts.accountcreate', compact(['user','accounts']));\n }",
"public function show_account()\n {\n return view('driver_dashboard.account');\n }",
"public function create() {\n\t\treturn View::make('accounts.create', array(\t\n\t\t\t'title' => 'Create account',\n\t\t));\n\t}",
"public function index() {\n //\n return view( 'account.account' );\n }",
"public function create()\n {\n $tax = Tax::all();\n $account_group = AccountGroup::all();\n return view('admin.master.account_head.add',compact('account_group','tax'));\n }",
"public function index()\n {\n return view('collection::accounttitle')->with('base', $this->base);\n }",
"public function index()\n {\n $profile = User::where('phone', Auth::user()->phone)->first();\n $siteinfo = siteinfo::latest()->first();\n return view('admin.account', ['profile' => $profile, 'siteinfo' => $siteinfo]);\n }",
"public function showDisplayAccountForm() {\n\t\t$this->redirectIfNoAccess('Display Account', 'subscribers/showDisplayAccountForm');\n\t\t$portal = $this->session->userdata('portal');\n\t\t$realm = $this->session->userdata('realm');\n\t\t//get realms\n\t\t$this->load->model('realm');\n\t\t$realms = $this->realm->fetchAllNamesOnly();\n\t\t$data = array(\n\t\t\t'show' => false,\n\t\t\t'found' => false,\n\t\t\t'realms' => $realms);\n\t\tif ($portal == 'service') {\n\t\t\t$data['realm'] = $realm;\n\t\t\t$data['disableRealm'] = true;\n\t\t}\n\t\t$this->load->view('display_user_account', $data);\n\t}",
"public function create()\n\t{\n\t\treturn view('account.create');\n\t}",
"public function create()\n {\n return view('account.create');\n }",
"public function account()\n {\n return view(\"public.account\")->with(['active'=>'users', 'subactive'=>'user']);\n }",
"public function create()\n {\n $payments = $this->paymentRepository->getPaymentAll();\n return view('shop.admin.useraccount.accountAdd', compact('payments'));\n }",
"public function create()\n {\n return view('admin.account.create');\n }",
"public function createProfile(){\n return $this->view('account.create-profile');\n }",
"public function index()\n { \n \n return view('user.account');\n }",
"public function index()\n {\n return view('auth.account');\n }",
"public function create()\n {\n //\n $user = User::all();\n $permissions = Permission::all();\n $roles = Role::all();\n return view('accountcreate', compact('user', 'permissions', 'roles'));\n }",
"public function storeDisplay()\n {\n\n\n //code for root user or superuser\n $superuser = User::find(Auth::id());\n //code for root user or superuser\n\n\n return view('main.users.page-users-add')->with(\n [\n 'superuser' => $superuser\n ]\n );\n }",
"public function index()\n {\n return view('backend.pages.account.account');\n }",
"public function index()\n\t{\n\t\treturn View('account.view')->withAccounts(Account::all());\n\t}",
"public function account()\n {\n return view('settings.account');\n }",
"public function create()\n {\n $usersforname = User::pluck('name', 'id');\n\n return view('accounts.create', compact('usersforname'));\n }",
"public function create()\n {\n return view('accounts.create');\n }",
"public function show()\n {\n $roles = Role::get();\n\n return view('dashboard.pages.create_user', compact('roles'));\n }",
"public function create()\n {\n return view('account.create');\n }",
"public function create()\n {\n return view('logins.create');\n }",
"public function creators()\n {\n $this->show('creators');\n }",
"public function create()\n {\n $title = $this->title;\n $roles = Role::all();\n\n return view('admin.account.user_account.create', compact('title', 'roles'));\n }",
"public function myAccount()\n {\n $user_id = Auth::user()->id;\n\n $user = User::where('id', '=', $user_id)->first();\n\n return view('my_account', array('conf' => $this->conf, 'user' => $user));\n\n }",
"public function localCreate()\n {\n return View::make(Config::get('Shibboleth::shibboleth.login_view'));\n }"
] | [
"0.6895065",
"0.6767637",
"0.6733986",
"0.664182",
"0.66036415",
"0.6579199",
"0.6549043",
"0.65232456",
"0.65189785",
"0.64982194",
"0.6496967",
"0.6494348",
"0.6463896",
"0.64530265",
"0.6449361",
"0.644933",
"0.6442456",
"0.64360607",
"0.6434608",
"0.6420826",
"0.63762885",
"0.6374011",
"0.635379",
"0.63423514",
"0.6335842",
"0.63229764",
"0.6317209",
"0.63115597",
"0.6306774",
"0.630668"
] | 0.7602268 | 0 |
return the inactive days to the schedule | public function getInactivedays() {
$schedule_id = Input::get('schedule_id');
$inactives = Inactive::where('schedule_id', '=', $schedule_id)->first();
return $inactives->date;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_scheduled_days() {\n\t\treturn ES_Clean::ids( $this->get_option( 'scheduled_day' ) );\n\t}",
"public function getActiveDays()\n {\n $weekendDays = $this->getWeekendDaysArray();\n\n for($i=0; $i<7; $i++)\n {\n if(!in_array($i, $weekendDays)) { $active[] = $i; }\n }\n \n return $active;\n }",
"public function getScheduleTimes();",
"public function findForwardersExpiredDue();",
"public function getDoseSchedule();",
"public function getForwardersExpiredDue();",
"public function weekends(): self;",
"public function getRenewDays();",
"public function getSchedule() { }",
"function skipCalender($dateCalender,$route)\n{\t\n\t//Array to hold schedule values for weekend and weekday schedules\n\t$Routes = array ( \"1\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"2\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"8\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"9\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 1), \n\t\t\t\t \"19\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"62\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"71\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"78\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"80\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"LUCY\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"90\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"91\" => array ( \"Weekday\" => 0,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"92\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"95\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"106\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"107\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"112\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"116\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"118\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"127\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"128\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"131\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"134\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"139\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"150\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"201\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"205\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"206\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"304\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"306\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0),\n\t\t\t\t \"310\" => array ( \"Weekday\" => 1,\"Saturday\" => 1,\"Sunday\" => 0),\n\t\t\t\t \"314\" => array ( \"Weekday\" => 1,\"Saturday\" => 0,\"Sunday\" => 0) \n\t\t\t\t);\t\n\t\t\t\n\t\t\t// Get Day of Week\n\t\t\t$d = getdate(strtotime($dateCalender));\n\t\t\t$weekday = $Routes[$route][\"Weekday\"]; //Weekday schedule from route array\n\t\t\t$sat = $Routes[$route][\"Saturday\"]; //Saturday schedule from route array\n\t\t\t$sun = $Routes[$route][\"Sunday\"]; //Sunday schedule from route array\n\t\t\t$resetDate = 0;\n\t\t\t\n\t\t\t// If route has weekday and Saturday schedule on Sunday skip to next Monday\n\t\t\tif($weekday == 1&& $sat== 1 && $sun == 0&& $d['wday']==6)\n\t\t\t{\n\t\t\t\t$dateCalender = next_weekday($dateCalender);\n\t\t\t\t$resetDate= 1;\n\t\t\t}\n\t\t\t\n\t\t\t// If route has only weekday schedule skip to next Monday on weekends\n\t\t\telse if($weekday == 1 && $sat == 0 && $sun == 0 && ($d['wday']==0 || $d['wday']==6) )\n\t\t\t{\n\t\t\t\t$dateCalender = next_weekday($dateCalender);\n\t\t\t\t$resetDate= 1;\n\t\t\t}\n\t\t\t\n\t\t\t//If route has only Saturday schedule on Sundays and weekdays skip to next Saturday\n\t\t\telse if($weekday == 0 && $sat == 1 && $sun == 0 && ($d['wday'] >= 1 || $d['wday'] <= 5 || $d['wday'] == 0))\n\t\t\t{\n\t\t\t\t$dateCalender = next_sat($dateCalender);\n\t\t\t\t$resetDate= 1;\n\t\t\t}\n\t\t\t\n\t\t$SkipArray=array();\n\t\tarray_push($SkipArray,array (\"DateCalender\" => $dateCalender,\"resetDate\" => $resetDate));\n\treturn $SkipArray;\n}",
"public function getAccessibleScheduleIds(): array;",
"public function getSundayEndTimes () {\n \t$val = $this->cacheGetPlain('SundayEndTimes');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('SundayEndTimes', $this->getOffering()->getSundayEndTimes());\n \telse\n \t\treturn $val;\n\t}",
"public function getCalendarWorkDays ()\n {\n\n return $this->calendar_work_days;\n }",
"function getAllDays() {\r\n\t\t$ret_array = array();\r\n\t\tif ($this->mBeginDate->before($this->mEndDate)) {\r\n\t\t\t$d = $this->getBegin();\r\n\t\t\twhile ($d->before($this->getEnd())) {\r\n\t\t\t\tarray_push($ret_array, $d);\r\n\t\t\t\t$d = $d->nextDate();\r\n\t\t\t}\r\n\t\t\tarray_push($ret_array, $d);\r\n\t\t} else {\r\n\t\t\tarray_push($ret_array, $this->mBeginDate);\r\n\t\t}\r\n \t\treturn $ret_array;\r\n\t}",
"public function mondays(): self;",
"public function getForwardersFallDue();",
"public function saturdays(): self;",
"function getCurrentEnds()\n{\t\n\t// set time zone and get the day\n\t//date_default_timezone_set(\"America/Toronto\");\n\t\n\t//get current time in time stamp\n\t//*****change this date to get a different as a measurement day*****\n\t$c_time = date(\"Y/m/d\");\n\t//echo $c_time;\n\n\t$week_array = getEndsOfWeek($c_time);\n return $week_array;\n}",
"public function findForwardersFallDue();",
"public function getScheduledEnd();",
"public function getWeekDays()\n\t{\n\t\tif(date('D')!='Mon')\n\t\t{ \n\t\t\t//take the last monday\n\t\t\t$_SESSION['acm_start_week'] = date('Y-m-d',strtotime('last Monday')); \n\n\t\t}\n\t\telse\n\t\t{\n\t\t $_SESSION['acm_start_week'] = date('Y-m-d'); \n\t\t}\n\n\t\t//always next saturday\n\t\tif(date('D')!='Sat')\n\t\t{\n\t\t $_SESSION['acm_end_week'] = date('Y-m-d',strtotime('next Saturday'));\n\t\t}\n\t\telse\n\t\t{\n\n\t\t $_SESSION['acm_end_week'] = date('Y-m-d');\n\t\t}\n\t}",
"function vacationExplode($vacationDays){\n $arrVacation = [];\n $arrStart = explode(' ', $vacationDays->start);\n $arrEnd = explode(' ', $vacationDays->end);\n $startDate = $arrStart[0];\n $endDate = $arrEnd[0];\n $rawShift = DB::table('users')->find(Auth::user()->id)->shift;\n $rawArrShift = explode('-', $rawShift);\n $arrShift = [];\n foreach($rawArrShift as $ras){\n $sp = DB::table('session')->find($ras);\n array_push($arrShift, $ras, $sp->start, $sp->end);\n }\n for($thisDate = strtotime($startDate); $thisDate <= strtotime($arrEnd[0]); $thisDate += 24*60*60){\n if( $thisDate == strtotime($startDate) ){\n $startTime = $arrStart[1];\n for($y = 0; $y < count($arrShift); $y += 3){\n if($startDate == $endDate){\n $endTime = $arrEnd[1];\n if(strtotime($endTime) <= strtotime($arrShift[$y+1])){\n break;\n }elseif( strtotime($endTime) > strtotime($arrShift[$y+1]) && strtotime($endTime) <= strtotime($arrShift[$y+2]) ){\n if(strtotime($startTime) <= strtotime($arrShift[$y+1])){\n $obj = (object)[\n 'start' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+1],\n 'end' => date('Y-m-d', $thisDate) . ' ' .$endTime,\n ];\n $obj->spent = (strtotime($obj->end) - strtotime($obj->start))/60;\n $obj->type = Constants::OFF_VACATION;\n array_push($arrVacation, $obj);\n }elseif(strtotime($startTime) > strtotime($arrShift[$y+1])){\n $obj = (object)[\n 'start' => date('Y-m-d', $thisDate) . ' ' .$startTime,\n 'end' => date('Y-m-d', $thisDate) . ' ' .$endTime,\n ];\n $obj->spent = (strtotime($obj->end) - strtotime($obj->start))/60;\n $obj->type = Constants::OFF_VACATION;\n array_push($arrVacation, $obj);\n }\n break;\n }\n }\n if( strtotime($startTime) <= strtotime($arrShift[$y+1]) ){\n $obj = (object)[\n 'start' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+1],\n 'end' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+2],\n ];\n $obj->spent = (strtotime($obj->end) - strtotime($obj->start))/60;\n $obj->type = Constants::OFF_VACATION;\n array_push($arrVacation, $obj);\n }elseif( strtotime($startTime) > strtotime($arrShift[$y+1]) && strtotime($startTime) < strtotime($arrShift[$y+2]) ){\n $obj = (object)[\n 'start' => date('Y-m-d', $thisDate) . ' ' .$startTime,\n 'end' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+2],\n ];\n $obj->spent = (strtotime($obj->end) - strtotime($obj->start))/60;\n $obj->type = Constants::OFF_VACATION;\n array_push($arrVacation, $obj);\n }elseif( strtotime($startTime) >= strtotime($arrShift[$y+2]) ){\n continue;\n }\n }\n }elseif($thisDate < strtotime($endDate)){\n for($y = 0; $y < count($arrShift); $y += 3){\n $obj = (object)[\n 'start' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+1],\n 'end' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+2],\n ];\n $obj->spent = (strtotime($obj->end) - strtotime($obj->start))/60;\n $obj->type = Constants::OFF_VACATION;\n array_push($arrVacation, $obj);\n }\n }elseif($thisDate == strtotime($endDate)){\n $endTime = $arrEnd[1];\n for($y = 0; $y < count($arrShift); $y += 3){\n if( strtotime($endTime) <= strtotime($arrShift[$y+1]) ){\n break;\n }elseif( strtotime($endTime) > strtotime($arrShift[$y+1]) && strtotime($endTime) <= strtotime($arrShift[$y+2]) ){\n $obj = (object)[\n 'start' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+1],\n 'end' => date('Y-m-d', $thisDate) . ' ' .$endTime,\n ];\n $obj->spent = (strtotime($obj->end) - strtotime($obj->start))/60;\n $obj->type = Constants::OFF_VACATION;\n array_push($arrVacation, $obj);\n break;\n }elseif( strtotime($endTime) > strtotime($arrShift[$y+2]) ){\n $obj = (object)[\n 'start' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+1],\n 'end' => date('Y-m-d', $thisDate) . ' ' .$arrShift[$y+2],\n ];\n $obj->spent = (strtotime($obj->end) - strtotime($obj->start))/60;\n $obj->type = Constants::OFF_VACATION;\n array_push($arrVacation, $obj);\n }\n }\n }\n }\n return $arrVacation;\n }",
"function station_current_schedule($scheds = array()) {\r\n\t$now = current_time(\"timestamp\");\r\n\t$current = array();\r\n\t\r\n\tforeach($scheds as $sched) {\r\n\t\r\n\t\tif($sched['day'] != date(\"l\", $now)) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\t\r\n\t\t$start = strtotime(date('Y-m-d', $now).$sched['start_hour'].':'.$sched['start_min'].' '.$sched['start_meridian']);\r\n\t\t\t\r\n\t\tif($sched['start_meridian'] == 'pm' && $sched['end_meridian'] == 'am') { //check for shows that run overnight into the next morning\r\n\t\t\t$end = strtotime(date('Y-m-d', ($now+86400)).$sched['end_hour'].':'.$sched['end_min'].' '.$sched['end_meridian']);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$end = strtotime(date('Y-m-d', $now).$sched['end_hour'].':'.$sched['end_min'].' '.$sched['end_meridian']);\r\n\t\t}\r\n\t\t\r\n\t\t//a show can't end before it begins... if it does, it ends the following day.\r\n\t\tif($end <= $start) {\r\n\t\t\t$end = $end + 86400;\r\n\t\t}\r\n\t\t\t\r\n\t\t//compare to the current timestamp\r\n\t\tif($start <= $now && $end >= $now) {\r\n\t\t\t$current = $sched;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $current;\r\n}",
"public function getTuesdayEndTimes () {\n \t$val = $this->cacheGetPlain('TuesdayEndTimes');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('TuesdayEndTimes', $this->getOffering()->getTuesdayEndTimes());\n \telse\n \t\treturn $val;\n\t}",
"public function getAvailabilityEnds();",
"public function getMondayEndTimes () {\n \t$val = $this->cacheGetPlain('MondayEndTimes');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('MondayEndTimes', $this->getOffering()->getMondayEndTimes());\n \telse\n \t\treturn $val;\n\t}",
"function getDays();",
"public function draftSchedules()\n {\n return $this->hasMany('App\\Models\\CronJob', 'parent_id')\n ->where('parent_type', '=', get_class($this))\n ->where('entity_id', '!=', $this->revision_id)\n ->where('command', 'LIKE', 'cron:draft-online%');\n }",
"public function getFridayEndTimes () {\n \t$val = $this->cacheGetPlain('FridayEndTimes');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('FridayEndTimes', $this->getOffering()->getFridayEndTimes());\n \telse\n \t\treturn $val;\n\t}",
"private function get_employee_schedule() {\n\n $date = new \\DateTime($this->date);\n $employeeSchedule = ScheduleModel::with(array('periods.weekdays'))->where('employee_id', $this->employeeId)->get();\n\n foreach ($employeeSchedule as $schedule) {\n\n $chairID = $schedule['chair_id'];\n\n foreach ($schedule['periods'] as $period) {\n\n $periodStart = new \\DateTime($period['start_date']);\n $periodEnd = new \\DateTime($period['end_date']);\n\n if ($date >= $periodStart && $date <= $periodEnd) {\n\n $day = $period['weekdays']->where('day', formatS($date));\n $dayScheduleColl[] = array('chairID' => $chairID, 'dayArray' => $day);\n\n }\n\n }\n\n }\n\n if (isset($dayScheduleColl)) {\n\n $this->make_day_schedule_array($dayScheduleColl);\n\n }\n }"
] | [
"0.6632711",
"0.6548458",
"0.6356403",
"0.62407213",
"0.6214797",
"0.61536753",
"0.6117285",
"0.60922164",
"0.6022489",
"0.5922836",
"0.591326",
"0.5857115",
"0.5839352",
"0.58336073",
"0.58212405",
"0.5808822",
"0.57943404",
"0.5781976",
"0.5771223",
"0.5769682",
"0.57680297",
"0.5722381",
"0.5715933",
"0.5676895",
"0.5668937",
"0.5668904",
"0.56660897",
"0.5651652",
"0.5630479",
"0.56286484"
] | 0.70554864 | 0 |
Adds a new language and imports language variables from default language | function addLanguage()
{
global $_ARRAYLANG, $objDatabase;
if (empty($_POST['name']) || empty($_POST['shortName']) || empty($_POST['charset'])) {
return false;
}
$shortName = mysql_escape_string($_POST['shortName']);
$name = mysql_escape_string($_POST['name']);
$charset = mysql_escape_string($_POST['charset']);
$objResult = $objDatabase->Execute("
SELECT lang
FROM ".DBPREFIX."languages
WHERE lang='$shortName'
");
if (!$objResult) {
$this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];
return false;
}
if ($objResult->RecordCount() > 0) {
// Language exists already.
// TODO: Add a more suitable error message here.
$this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];
return false;
}
$objDatabase->Execute("
INSERT INTO ".DBPREFIX."languages
SET lang='".contrexx_addslashes($shortName)."',
name='".contrexx_addslashes($name)."',
charset='".contrexx_addslashes($charset)."',
is_default='false'
");
$newLanguageId = $objDatabase->Insert_ID();
$objResult = $objDatabase->SelectLimit("
SELECT id FROM ".DBPREFIX."languages
WHERE is_default='true'", 1
);
if ($objResult) {
while (!$objResult->EOF) {
$defaultLanguageId = $objResult->fields['id'];
$objResult->MoveNext();
}
}
$objResult = $objDatabase->Execute("
SELECT varid,content
FROM ".DBPREFIX."language_variable_content
WHERE lang_id=$defaultLanguageId
");
if ($objResult) {
while (!$objResult->EOF) {
$arrContent[$objResult->fields['varid']] = $objResult->fields['content'];
$objResult->MoveNext();
}
}
foreach ($arrContent as $key => $content) {
$objDatabase->Execute("
INSERT INTO ".DBPREFIX."language_variable_content
SET varid=$key,
content='".addslashes($content)."',
lang_id=$newLanguageId,
status=0
");
}
$objResult = $objDatabase->Execute("
SELECT gallery_id, name, value
FROM ".DBPREFIX."module_gallery_language
WHERE lang_id=$defaultLanguageId
");
if ($objResult) {
while (!$objResult->EOF) {
$objDatabase->Execute("
INSERT INTO ".DBPREFIX."module_gallery_language
SET gallery_id=".$objResult->fields['gallery_id'].",
lang_id=$newLanguageId,
name='".$objResult->fields['name']."',
value='".$objResult->fields['value']."'
");
$objResult->MoveNext();
}
}
$objResult = $objDatabase->Execute("
SELECT picture_id, name, `desc`
FROM ".DBPREFIX."module_gallery_language_pics
WHERE lang_id=$defaultLanguageId
");
if ($objResult) {
while (!$objResult->EOF) {
$objDatabase->Execute("
INSERT INTO ".DBPREFIX."module_gallery_language_pics
SET picture_id=".$objResult->fields['picture_id'].",
lang_id=$newLanguageId,
name='".$objResult->fields['name']."',
`desc`='".$objResult->fields['desc']."'
");
$objResult->MoveNext();
}
}
$this->strOkMessage = $_ARRAYLANG['TXT_NEW_LANGUAGE_ADDED_SUCCESSFUL'];
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddDetailsForDefaultLang(){}",
"public function load_language($lang = null, $add = array())\n {\n $lang = $this->language_prop(($lang ? $lang : $_SESSION['language']));\n \n // load localized texts\n if (empty($this->texts) || $lang != $_SESSION['language']) {\n $this->texts = array();\n\n // get english labels (these should be complete)\n @include(INSTALL_PATH . 'program/localization/en_US/labels.inc');\n @include(INSTALL_PATH . 'program/localization/en_US/messages.inc');\n\n if (is_array($labels))\n $this->texts = $labels;\n if (is_array($messages))\n $this->texts = array_merge($this->texts, $messages);\n\n // include user language files\n if ($lang != 'en' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) {\n include_once(INSTALL_PATH . 'program/localization/' . $lang . '/labels.inc');\n include_once(INSTALL_PATH . 'program/localization/' . $lang . '/messages.inc');\n\n if (is_array($labels))\n $this->texts = array_merge($this->texts, $labels);\n if (is_array($messages))\n $this->texts = array_merge($this->texts, $messages);\n }\n \n $_SESSION['language'] = $lang;\n }\n\n // append additional texts (from plugin)\n if (is_array($add) && !empty($add))\n $this->texts += $add;\n }",
"function language($language)\n {\n $GLOBALS[\"config_language\"][] = $language;\n }",
"private function load(): void\n {\n if ($this->hasDictionaryForLanguage(Core::$lang)) {\n $this->add($this->loadDictionaryForLanguage(Core::$lang));\n } elseif (Core::$fallbackLang !== Core::$lang && $this->hasDictionaryForLanguage(Core::$fallbackLang)) {\n $this->add($this->loadDictionaryForLanguage(Core::$fallbackLang));\n }\n\n $this->isLoaded = true;\n }",
"protected function initLanguage()\n {\n // Init only once\n if (empty(self::$init_stages[$this->name]['language']) && $this->paths->exists('dir.language')) {\n\n $path = $this->paths->get('dir.language');\n\n $this->language = new Language();\n\n $languages = [\n 'en'\n ];\n\n // If there is a different language code ist set, override the english values with values from this language\n // file\n $site_language = $this->core->config->get('Core', 'site.language.default');\n\n if ($site_language != 'en') {\n $languages[] = $site_language;\n }\n\n foreach ($languages as $language) {\n\n $filename = $path . DIRECTORY_SEPARATOR . $language . '.php';\n\n if (!file_exists($filename)) {\n Throw new AppException(sprintf('No english languagefile (%s.php) found in languagedir \"%s\"', $language, $path));\n }\n\n $this->language->load($filename);\n }\n\n // Set Core language as fallback language to all app that are nor Core\n if ($this->name != 'Core') {\n $this->language->setFallbackLanguage($this->core->getAppInstance('Core')->language);\n }\n\n self::$init_stages[$this->name]['language'] = true;\n }\n }",
"function addLanguage($key, $value)\n{\n\tglobal $language;\n\t$definition =& $language;\n\tforeach ((array)$key as $k) $definition =& $definition[$k];\n\tif (isset($definition)) return false;\n\t$definition = $value;\n}",
"function addLanguageToJS()\n{\n\tglobal $language;\n\t$args = func_get_args();\n\tforeach ($args as $key) {\n\t\t$definition =& $language;\n\t\tforeach ((array)$key as $k) $definition =& $definition[$k];\n\t\t$this->jsLanguage[$k] =& $definition;\n\t}\n}",
"function el_installation_register_languages($strings = array()) {\n global $ElInstall;\n $ElInstall->langStrings = $strings;\n}",
"private function _set_default_language()\n\t{\n\t\t$lang \t\t= $this->platform->post('partner/language/get',array('partner_id' => $this->_partner_id, 'funnel_id' => $this->_funnel_id));\n\n\t\t// if grabbing language was unsuccessful, set session and return\n\t\tif ( ! $lang['success'] OR ! is_array($lang['data']) OR empty($lang['data'])):\n\n\t\t\treturn;\n\n\t\tendif;\n\n\t\t// set global language variable\n\t\t$this->_language \t= (isset($lang['data']['slug']) AND ! empty($lang['data']['slug']))? $lang['data']['slug']: $this->_language;\n\t}",
"public function add_language( $args ) {\n\t\t$errors = $this->validate_lang( $args );\n\t\tif ( $errors->get_error_code() ) { // Using has_errors() would be more meaningful but is available only since WP 5.0\n\t\t\treturn $errors;\n\t\t}\n\n\t\t// First the language taxonomy\n\t\t$description = maybe_serialize( array( 'locale' => $args['locale'], 'rtl' => (int) $args['rtl'], 'flag_code' => empty( $args['flag'] ) ? '' : $args['flag'] ) );\n\t\t$r = wp_insert_term( $args['name'], 'language', array( 'slug' => $args['slug'], 'description' => $description ) );\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\t// Avoid an ugly fatal error if something went wrong ( reported once in the forum )\n\t\t\treturn new WP_Error( 'pll_add_language', __( 'Impossible to add the language.', 'polylang' ) );\n\t\t}\n\t\twp_update_term( (int) $r['term_id'], 'language', array( 'term_group' => (int) $args['term_group'] ) ); // can't set the term group directly in wp_insert_term\n\n\t\t// The term_language taxonomy\n\t\t// Don't want shared terms so use a different slug\n\t\twp_insert_term( $args['name'], 'term_language', array( 'slug' => 'pll_' . $args['slug'] ) );\n\n\t\t$this->clean_languages_cache(); // Update the languages list now !\n\n\t\tif ( ! isset( $this->options['default_lang'] ) ) {\n\t\t\t// If this is the first language created, set it as default language\n\t\t\t$this->options['default_lang'] = $args['slug'];\n\t\t\tupdate_option( 'polylang', $this->options );\n\n\t\t\t// And assign default language to default category\n\t\t\t$this->term->set_language( (int) get_option( 'default_category' ), (int) $r['term_id'] );\n\t\t} elseif ( empty( $args['no_default_cat'] ) ) {\n\t\t\t$this->create_default_category( $args['slug'] );\n\t\t}\n\n\t\t// Init a mo_id for this language\n\t\t$mo = new PLL_MO();\n\t\t$mo->export_to_db( $this->get_language( $args['slug'] ) );\n\n\t\t/**\n\t\t * Fires when a language is added\n\t\t *\n\t\t * @since 1.9\n\t\t *\n\t\t * @param array $args arguments used to create the language\n\t\t */\n\t\tdo_action( 'pll_add_language', $args );\n\n\t\t$this->clean_languages_cache(); // Again to set add mo_id in the cached languages list\n\t\tflush_rewrite_rules(); // Refresh rewrite rules\n\t\treturn true;\n\t}",
"function modifyLanguage()\n {\n global $_ARRAYLANG, $_CONFIG, $objDatabase;\n\n if (!empty($_POST['submit']) AND (isset($_POST['addLanguage']) && $_POST['addLanguage']==\"true\")) {\n //-----------------------------------------------\n // Add new language with all variables\n //-----------------------------------------------\n if (!empty($_POST['newLangName']) AND !empty($_POST['newLangShortname'])) {\n $newLangShortname = addslashes(strip_tags($_POST['newLangShortname']));\n $newLangName = addslashes(strip_tags($_POST['newLangName']));\n $newLangCharset = addslashes(strip_tags($_POST['newLangCharset']));\n $objResult = $objDatabase->Execute(\"SELECT lang FROM \".DBPREFIX.\"languages WHERE lang='\".$newLangShortname.\"'\");\n if ($objResult !== false) {\n if ($objResult->RecordCount()>=1) {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n return false;\n } else {\n $objDatabase->Execute(\"INSERT INTO \".DBPREFIX.\"languages SET lang='\".$newLangShortname.\"',\n name='\".$newLangName.\"',\n charset='\".$newLangCharset.\"',\n is_default='false'\");\n $newLanguageId = $objDatabase->Insert_ID();\n if (!empty($newLanguageId)) {\n $objResult = $objDatabase->SelectLimit(\"SELECT id FROM \".DBPREFIX.\"languages WHERE is_default='true'\", 1);\n if ($objResult !== false && !$objResult->EOF) {\n $defaultLanguage=$objResult->fields['id'];\n\n $objResult = $objDatabase->Execute(\"SELECT varid,content,module FROM \".DBPREFIX.\"language_variable_content WHERE 1 AND lang=\".$defaultLanguage);\n if ($objResult !== false) {\n while (!$objResult->EOF) {\n $arrayLanguageContent[$objResult->fields['varid']]=stripslashes($objResult->fields['content']);\n $arrayLanguageModule[$objResult->fields['varid']]=$objResult->fields['module'];\n $objResult->MoveNext();\n }\n foreach ($arrayLanguageContent as $varid => $content) {\n $LanguageModule = $arrayLanguageModule[$varid];\n $objDatabase->Execute(\"INSERT INTO \".DBPREFIX.\"language_variable_content SET varid=\".$varid.\", content='\".addslashes($content).\"', module=\".$LanguageModule.\", lang=\".$newLanguageId.\", status=0\");\n }\n $this->strOkMessage = $_ARRAYLANG['TXT_NEW_LANGUAGE_ADDED_SUCCESSFUL'];\n return true;\n }\n }\n } else {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n return false;\n }\n }\n }\n }\n } elseif (!empty($_POST['submit']) AND ( $_POST['modLanguage'] == \"true\")) {\n //-----------------------------------------------\n // Update languages\n //-----------------------------------------------\n foreach ($_POST['langName'] as $id => $name) {\n $active = 0;\n if (isset($_POST['langActiveStatus'][$id]) && $_POST['langActiveStatus'][$id]==1 ) {\n $languageCode = \\FWLanguage::getLanguageCodeById($id);\n $pageRepo = \\Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');\n $alias = $pageRepo->findBy(array(\n 'type' => \\Cx\\Core\\ContentManager\\Model\\Entity\\Page::TYPE_ALIAS,\n 'slug' => $languageCode,\n ), true);\n\n if (count($alias)) {\n if (is_array($alias)) $alias = $alias[0];\n $id = $alias->getNode()->getId();\n $config = \\Env::get('config');\n $link = 'http://' . $config['domainUrl'] . ASCMS_PATH_OFFSET . '/' . $alias->getSlug();\n $lang = \\Env::get('lang');\n $this->strErrMessage =\n $lang['TXT_CORE_REMOVE_ALIAS_TO_ACTIVATE_LANGUAGE'] . ':<br />\n <a href=\"index.php?cmd=Alias&act=modify&id=' . $id . '\" target=\"_blank\">' . $link . '</a>';\n return false;\n }\n\n $active = 1;\n }\n $status = \"false\";\n if ($_POST['langDefaultStatus']==$id) {\n $status = \"true\";\n }\n $adminstatus = 0;\n if (isset($_POST['langAdminStatus'][$id]) && $_POST['langAdminStatus'][$id]==1) {\n $adminstatus = 1;\n }\n $fallBack = (isset($_POST['fallBack'][$id]) && $_POST['fallBack'][$id] != \"\" ) ? intval($_POST['fallBack'][$id]) : 'NULL'; \n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"languages SET \n name='\".$name.\"',\n frontend=\".$active.\",\n is_default='\".$status.\"',\n backend='\".$adminstatus.\"',\n fallback=\".$fallBack.\"\n WHERE id=\".$id);\n }\n $this->strOkMessage = $_ARRAYLANG['TXT_DATA_RECORD_UPDATED_SUCCESSFUL'];\n \\FWLanguage::init();\n return true;\n }\n return false;\n }",
"public function getDefaultLanguage();",
"private function includeLang ()\n\t{\n\t\t$file = $this->cms->bPath . \"/non_html/modules/\" . $this->moduledir . \"/locale/\" . $this->cms->languages->selectedlanguage['dir'] . \".php\";\n\t\tif (file_exists($file))\n\t\t{\n\t\t\trequire $file;\n\t\t\tif (isset($lang))\n\t\t\t{\n\t\t\t\t$this->lang = $lang;\n\t\t\t} else\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Module Content: erroneous language file loaded.\");\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\t$file = $this->cms->bPath . \"/non_html/modules/\" . $this->moduledir . \"/locale/\" . $this->cms->languages->default['dir'] . \".php\";\n\t\t\tif (! file_exists($file))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Module Content: no language file found.\");\n\t\t\t} else\n\t\t\t{\n\t\t\t\trequire $file;\n\t\t\t\t$this->lang = $lang;\n\t\t\t\tif (isset($lang))\n\t\t\t\t{\n\t\t\t\t\t$this->lang = $lang;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"Module Content: erroneous language file loaded.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function add_languages() {\n\t\tload_plugin_textdomain( 'automated-featured-image-posts', false, basename( dirname( __FILE__ ) ) . '/lang' );\n\t}",
"function gengo_add_language() {\r\n\tglobal $wpdb, $wp_rewrite, $gengo;\r\n\r\n\tif (!$language = $_POST['gengo_language']) return $gengo->error_message(__(\"Please enter a name for the language.\", GENGO_DOMAIN));\r\n\telseif (!$code = $_POST['gengo_language_code']) return $gengo->error_message(__(\"Please enter a two letter code for the language.\", GENGO_DOMAIN));\r\n\telseif (!$locale = $_POST['gengo_language_locale']) return $gengo->error_message(__(\"Please enter a locale for the language.\", GENGO_DOMAIN));\r\n\r\n\tforeach ($gengo->languages as $entry) if ($entry->code == $code) return $gengo->error_message(sprintf(__(\"Duplicate language code '%s' could not be added.\", GENGO_DOMAIN), $code));\r\n\r\n\t$rtl = isset($_POST['gengo_language_rtl']) ? '1' : '0';\r\n\t$charset = $_POST['gengo_language_charset'];\r\n\t\r\n\t// Cleanup title for low-privilege users.\r\n\tif (($blog_title = $_POST['gengo_language_blog_title']) && !current_user_can('unfiltered_html')) $blog_title = wp_filter_post_kses($blog_title);\r\n\tif (($blog_tagline = $_POST['gengo_language_blog_tagline']) && !current_user_can('unfiltered_html')) $blog_tagline = wp_filter_post_kses($blog_tagline);\r\n\r\n\t// Insert language and language code into the db.\r\n\t$wpdb->query(\"INSERT INTO $gengo->language_table(language, code, locale, rtl, charset) VALUES ('$language', '$code', '$locale', '$rtl', '$charset')\");\r\n\t$language_id = $wpdb->get_var(\"SELECT DISTINCT LAST_INSERT_ID() FROM $gengo->language_table;\");\r\n\r\n\t$synblock_values = \"('blogtagline', $language_id, '$blog_tagline'), ('blogtitle', $language_id, '$blog_title')\";\r\n\tif ($synblocks = $wpdb->get_col(\"SELECT DISTINCT block_name FROM $gengo->synblock_table WHERE block_name != 'blogtagline' AND block_name != 'blogtitle'\")) {\r\n\t\t$synblock_values .= \", ('\" . implode (\"', $language_id, ''), ('\", $synblocks) . \"', $language_id, '')\";\r\n\t}\r\n\t$wpdb->query(\"INSERT INTO $gengo->synblock_table(block_name, language_id, text) VALUES $synblock_values\");\r\n\r\n\t$gengo->set_defined_languages();\r\n\t$wp_rewrite->flush_rules();\r\n\r\n\t$gengo->update_message(sprintf(__(\"Language '%s' Added. Rewrite rules updated.\", GENGO_DOMAIN), $language));\r\n\r\n\tif(1 == count($gengo->languages)) {\r\n\t\t// Save the first language as the default and set all posts and categories to be this language.\r\n\t\t$gengo->save_blog_default_language($language_id);\r\n\t\t$gengo->set_no_lang_posts_default(true);\r\n\t\t$gengo->set_wplang($locale);\r\n\t\t$wpdb->query(\"INSERT INTO $gengo->term2syn_table(term_id, language_id, synonym, sanitised) SELECT term_id, $language_id, name, slug FROM $wpdb->terms\");\r\n\t\t$gengo->update_message(sprintf(__(\"All posts and categories set to the default language '%s'.\", GENGO_DOMAIN), $language));\r\n\t} else {\r\n\t\t$wpdb->query(\"INSERT INTO $gengo->term2syn_table(term_id, language_id, synonym, sanitised) SELECT term_id, $language_id, '', '' FROM $wpdb->terms\");\r\n\t}\r\n\treturn true;\r\n}",
"public static function loadDefault()\n {\n $lang_path = 'App/lang/' . Config::get('default language') . '.php';\n if (is_file($lang_path)) self::setAll(include_once $lang_path);\n }",
"public function add($id = null)\n {\n $language = $id ? $this->Languages->get($id) : $this->Languages->newEntity();\n if ($this->request->is(['patch', 'post', 'put'])) {\n $language = $this->Languages->patchEntity($language, $this->request->data);\n if ($this->Languages->save($language)) {\n $this->Flash->success(__('The language has been saved'));\n return $this->redirect(['action' => 'index']);\n } else {\n $this->Flash->error(__('The language could not be saved'));\n }\n }\n $this->set(compact('language'));\n $this->set('_serialize', ['language']);\n }",
"function Language(){\n\t\t$fillin = array( 'wgSysopSpecialPages', 'wgValidSpecialPages', 'wgDeveloperSpecialPages' );\n\t\t$name = get_class( $this );\n\t\tif( strpos( $name, 'language' ) == 0){\n\t\t\t$lang = ucfirst( substr( $name, 8 ) );\n\t\t\tforeach( $fillin as $arrname ){\n\t\t\t\t$langver = \"{$arrname}{$lang}\";\n\t\t\t\t$enver = \"{$arrname}En\";\n\t\t\t\tif( ! isset( $GLOBALS[$langver] ) || ! isset( $GLOBALS[$enver] ))\n\t\t\t\t\tcontinue;\n\t\t\t\tforeach($GLOBALS[$enver] as $spage => $text){\n\t\t\t\t\tif( ! isset( $GLOBALS[$langver][$spage] ) )\n\t\t\t\t\t\t$GLOBALS[$langver][$spage] = $text;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function setLang(){\n $langCode = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n if(!empty($_REQUEST[LANG_CTRL_VAR]) && file_exists(PATH_ENGINE_LANG.$langCode.'.php')){\n $langCode = $_REQUEST[LANG_CTRL_VAR];\n if(ThisUser::islogged()){\n $User = Usuario::find(ThisUser::get(\"id_user\"));\n $User->lang = $_REQUEST[LANG_CTRL_VAR];\n $User->save();\n ThisUser::set(\"lang\",$_REQUEST[LANG_CTRL_VAR]);\n }\n }else{\n if(ThisUser::islogged() && ThisUser::get(\"lang\") != \"\"){\n $langCode = ThisUser::get(\"lang\");\n }\n }\n\n if(file_exists(PATH_ENGINE_LANG.$langCode.'.php')){\n Lang::load($langCode.'.php');\n }else{\n Lang::load(Sys::get('config')->lang_default.'.php');\n }\n }",
"function setLanguage($language);",
"function lang($text = false, $vars = null, $value = null, $group = null, $locale = null, $force_add = false)\n{\n $original_locale = Lang::getLocale();\n\n $params['value'] = $value ? $value : 0;\n $params['vars'] = $vars ? $vars : [];\n $params['locale'] = $locale ? $locale : $original_locale;\n $params['group'] = $group ? $group : 'general';\n $params['dynamic'] = false;\n if (preg_match('/dynamic_/', $params['group']))\n {\n $params['group'] = preg_replace('/dynamic_/', '', $params['group']);\n $params['dynamic'] = true;\n }\n $hash = md5($text).sha1($text);\n $file_namespace = 'dbtranslator';\n\n if (preg_match('/\\|/', $text)) {\n $choose = true;\n } else {\n $choose = false;\n }\n\n $config = config('db-translator');\n /**\n * Before anything lets change the locale to the intl locale\n */\n App::setLocale($params['locale']);\n /**\n * This will check the existence of the translation on the locale given, not the default\n */\n\n if (!$force_add) {\n if (Lang::has($file_namespace.'::'.$params['group'].'.'.$hash))\n {\n if ($choose) {\n $text = trans_choice($file_namespace.'::'.$params['group'].'.'.$hash, $params['value'], $params['vars']);\n App::setLocale($original_locale);\n return $text;\n } else {\n $text = trans($file_namespace.'::'.$params['group'].'.'.$hash, $params['vars']);\n App::setLocale($original_locale);\n return $text;\n }\n }\n else\n {\n /**\n * If we are using the database translations\n */\n if ($config['use_database'])\n {\n if (!Intl::whereText($text)->whereGroup($params['group'])->get()->count()) {\n $intl = new Intl;\n $intl->text = $text;\n $intl->group = $params['group'];\n $intl->md5sha1 = $hash;\n $intl->dynamic = $params['dynamic'];\n $intl->save();\n }\n } else {\n /**\n * first we will check if the translation exists under the fallback language\n */\n App::setLocale($config['default_locale']);\n if (!Lang::has($file_namespace.'::'.$params['group'].'.'.$hash))\n {\n // if we don't find it, we should include the file for the original locale\n // change it with the new array, and save it.\n /**\n * Determine if the file exists\n */\n if (Storage::disk($config['storage_driver'])->exists($config['default_locale'].'/'.$params['group'].'.php'))\n {\n $lang_array = require base_path('resources/lang/vendor/dbtranslator/'.$config['default_locale'].'/'.$params['group'].'.php');\n if (!isset($lang_array[$hash]))\n {\n $lang_array[$hash] = $text;\n $file = \"<?php\n return [\\r\\n\";\n foreach ($lang_array as $k => $v)\n {\n $file .= \" \\\"\".$k.\"\\\" => \\\"\".str_replace('\"', '\\\"', $v).\"\\\",\\r\\n\";\n }\n $file .= \"];\";\n Storage::disk($config['storage_driver'])->put($config['default_locale'].'/'.$params['group'].'.php', $file);\n }\n \n } else {\n $file = \"<?php\n return [\\r\\n\";\n $file .= \" \\\"\".$hash.\"\\\" => \\\"\".str_replace('\"', '\\\"', $text).\"\\\",\\r\\n\";\n $file .= \"];\";\n Storage::disk($config['storage_driver'])->put($config['default_locale'].'/'.$params['group'].'.php', $file);\n }\n }\n App::setLocale($params['locale']);\n }\n // now we will process the string\n if ($choose) {\n $params['vars']['count'] = $params['value'];\n\n $ms = new MessageSelector;\n $text = $ms->choose($text, $params['value'], $params['locale']);\n $params['vars'] = (new Collection($params['vars']))->sortBy(function ($value, $key) {\n return mb_strlen($key) * -1;\n });\n foreach ($params['vars'] as $key => $value) {\n $text = str_replace(':'.$key, $value, $text);\n }\n App::setLocale($original_locale);\n return $text;\n } else {\n if (count($params['vars']))\n {\n $params['vars'] = (new Collection($params['vars']))->sortBy(function ($value, $key) {\n return mb_strlen($key) * -1;\n });\n foreach ($params['vars'] as $key => $value) {\n $text = str_replace(':'.$key, $value, $text);\n }\n }\n App::setLocale($original_locale);\n return $text;\n }\n }\n } else {\n\n if ($config['use_database'])\n {\n\n if (!Intl::whereText($text)->whereGroup($params['group'])->get()->count()) {\n $intl = new Intl;\n $intl->text = $text;\n $intl->group = $params['group'];\n $intl->md5sha1 = $hash;\n $intl->dynamic = $params['dynamic'];\n $intl->save();\n }\n }\n }\n}",
"public function addLanguage($type = \"main\", $language = null)\n {\n return Xoops::service('translate')->loadTranslation($type, 'theme:' . $this->theme, $language);\n }",
"function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')\n {\n $langfile = str_replace('.php', '', $langfile);\n\n if($add_suffix == TRUE)\n {\n $langfile = str_replace('_lang.', '', $langfile) . '_lang';\n }\n\n $langfile .= '.php';\n\n if(in_array($langfile, $this->is_loaded, TRUE))\n {\n return;\n }\n\n $config = & get_config();\n\n if($idiom == '')\n {\n $deft_lang = (!isset($config['language'])) ? 'english' : $config['language'];\n $idiom = ($deft_lang == '') ? 'english' : $deft_lang;\n }\n\n // Determine where the language file is and load it\n if($alt_path != '' && file_exists($alt_path . 'language/' . $idiom . '/' . $langfile))\n {\n include($alt_path . 'language/' . $idiom . '/' . $langfile);\n }\n else\n {\n $found = FALSE;\n\n foreach(get_instance()->load->get_package_paths(TRUE) as $package_path)\n {\n if(file_exists($package_path . 'language/' . $idiom . '/' . $langfile))\n {\n include($package_path . 'language/' . $idiom . '/' . $langfile);\n $found = TRUE;\n break;\n }\n }\n\n if($found !== TRUE)\n {\n show_error('Unable to load the requested language file: language/' . $idiom . '/' . $langfile);\n }\n }\n\n\n if(!isset($lang))\n {\n log_message('error', 'Language file contains no data: language/' . $idiom . '/' . $langfile);\n return;\n }\n\n if($return == TRUE)\n {\n return $lang;\n }\n\n $this->is_loaded[] = $langfile;\n $this->language = array_merge($this->language, $lang);\n unset($lang);\n\n log_message('debug', 'Language file loaded: language/' . $idiom . '/' . $langfile);\n return TRUE;\n }",
"function lingotek_add_target_language($lingotek_locale, $call_api = TRUE) {\n LingotekConfigSet::markLidsNotCurrent('all');\n if (is_null($lingotek_locale)) {\n return FALSE;\n }\n lingotek_add_missing_locales(FALSE); // fills in any missing lingotek_locale values to the languages table\n $language = lingotek_lookup_language_by_locale($lingotek_locale);\n\n if ($language) {\n // ALREADY EXISTS IN LANGUAGE TABLE\n // If already in the languages table then just tack on the lingotek_locale and enable it\n $drupal_language_code = $language->language;\n }\n else {\n // DOES NOT EXIST, INSERT NEW INTO LANGUAGE TABLE\n // If not add it to the languages table first and then tack on the lingotek_locale and enable it\n $drupal_language_code = Lingotek::convertLingotek2Drupal($lingotek_locale, FALSE);\n if (lingotek_lookup_locale_exists($drupal_language_code)) { // drupal code is already being used, generate another\n $errors = array($drupal_language_code);\n $drupal_language_code = strtolower(str_replace(\"_\", \"-\", $lingotek_locale));\n if (lingotek_lookup_locale_exists($drupal_language_code)) {\n $errors[] = $drupal_language_code;\n LingotekLog::error(\"Cannot add language code. Attempted language codes already being used: !errors\", array('!errors' => $errors));\n return FALSE; // do not add the language.\n }\n }\n\n $name = isset($_POST['language']) ? $_POST['language'] : NULL;\n $native = isset($_POST['native']) ? $_POST['native'] : NULL;\n $direction = isset($_POST['direction']) && (strcasecmp('RTL', $_POST['direction']) == 0 ) ? LANGUAGE_RTL : LANGUAGE_LTR;\n $domain = '';\n $prefix = '';\n locale_add_language($drupal_language_code, $name, $native, $direction, $domain, $prefix); // Function from the Locale module.\n }\n\n return lingotek_set_target_language($drupal_language_code, 1, $lingotek_locale, $call_api);\n}",
"private function loadLanguages(): void\n {\n $this->words = [];\n\n foreach ($this->languages as $language) {\n $fileName = __DIR__ . '/Lang/' . $language . '.php';\n if (file_exists($fileName)) {\n /** @noinspection PhpIncludeInspection */\n $words = include $fileName;\n\n if (is_array($words)) {\n $this->words = array_merge($this->words, $words);\n }\n }\n }\n }",
"function blog_lang( $old_lang ){\n\n\t$loc = HOME . '_plugins/Blog/lang/';\n\tif( file_exists( $loc . LANG . '.php' ) )\n\t\trequire $loc . LANG . '.php';\n\telse\n\t\trequire $loc . 'English.php';\n\n\treturn array_merge( $old_lang, $lang );\n}",
"function initLang()\n {\n // #61520, 140911, dwildt, 1-\n //require_once(PATH_typo3 . 'sysext/lang/lang.php');\n // #61520, 140911, dwildt, 1+\n $this->init_typo3version();\n\n // #61520, 140911, dwildt, 6+\n if ( $this->typo3Version < 6002000 )\n {\n require_once(PATH_typo3 . 'sysext/lang/lang.php');\n }\n\n $this->pObj->lang = t3lib_div::makeInstance( 'language' );\n $this->pObj->lang->init( $GLOBALS[ 'TSFE' ]->lang );\n if ( $this->pObj->b_drs_localisation )\n {\n t3lib_div::devlog( '[INFO/LOCALISATION] Init a language object.', $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[INFO/LOCALISATION] Value of $GLOBALS[TSFE]->lang :' . $GLOBALS[ 'TSFE' ]->lang, $this->pObj->extKey, 0 );\n }\n }",
"function init_language() {\r\n\r\n if ( $language_list = DB::get_all( \"SELECT * FROM \" . DB_PREFIX . \"language WHERE published=1\", array(), \"lang_id\") ) {\r\n\r\n // get the language\r\n if (get('set_lang_id'))\r\n $lang_id = get('set_lang_id');\r\n elseif (isset($_SESSION['lang_id']))\r\n $lang_id = $_SESSION['lang_id'];\r\n else\r\n $lang_id = get_setting('lang_id');\r\n\r\n // language not found, load the default language\r\n if (!isset($language_list[$lang_id])) {\r\n $default_language = array_pop($language_list);\r\n $lang_id = $default_language['lang_id'];\r\n }\r\n\r\n // set the language in session\r\n $_SESSION['lang_id'] = $lang_id;\r\n\r\n // define the constant\r\n define(\"LANG_ID\", $lang_id);\r\n\r\n // load the dictionaries\r\n load_lang('generic');\r\n load_lang('rain.generic');\r\n } else {\r\n $this->_page_not_found('Language not installed');\r\n }\r\n }",
"function lingotek_set_target_language($drupal_language_code, $lingotek_enable = 1, $lingotek_locale = NULL, $api_add = TRUE) {\n $result = FALSE;\n $one_success = FALSE; //tracks if any result has been true\n $lingotek_locale = is_null($lingotek_locale) ? Lingotek::convertDrupal2Lingotek($drupal_language_code, FALSE) : $lingotek_locale;\n\n if (is_string($drupal_language_code) && strlen($drupal_language_code) && $lingotek_enable && $lingotek_locale) {\n if ($api_add) {\n // Add the language globally to all documents in the project\n $api = LingotekApi::instance();\n $projects = LingotekSync::getSyncProjects();\n foreach ($projects as $project_id) {\n $result = $api->addTranslationTarget(NULL, $project_id, $lingotek_locale);\n if ($result) {\n LingotekSync::insertTargetEntriesForAllEntities($lingotek_locale);\n LingotekSync::insertTargetEntriesForAllSets($lingotek_locale);\n }\n $one_success = $one_success || $result;\n }\n if (!$one_success) {\n drupal_set_message(t('@lingotek_locale could not be added as a language for Lingotek to translate.', array('@lingotek_locale' => $lingotek_locale)), 'error', FALSE);\n LingotekLog::error(\"Target language could not be added: @drupal_language_code (@lingotek_locale)\", array(\n '@drupal_language_code' => $drupal_language_code,\n '@lingotek_locale' => $lingotek_locale));\n\n return FALSE;\n }\n }\n else {\n // Don't add the language globally to all documents in the project.\n // Instead, disable this language in all profiles except config.\n $profiles = lingotek_get_profiles();\n foreach ($profiles as $profile) {\n if ($profile->getId() !== LingotekSync::PROFILE_CONFIG) {\n $profile->disableTargetLocale($lingotek_locale);\n }\n }\n // If there are any documents related to config translation,\n // automatically add the target language to all of them\n $config_profile = LingotekProfile::loadById(LingotekSync::PROFILE_CONFIG);\n $doc_ids = $config_profile->getDocumentIds();\n if ($doc_ids) {\n $api = LingotekApi::instance();\n foreach ($doc_ids as $doc_id) {\n $api->addTranslationTarget($doc_id, NULL, $lingotek_locale);\n }\n }\n }\n\n db_update('languages')\n ->fields(array(\n 'enabled' => 1,\n 'lingotek_enabled' => $lingotek_enable ? 1 : 0,\n 'lingotek_locale' => $lingotek_locale\n ))\n ->condition('language', $drupal_language_code)\n ->execute();\n drupal_static_reset('language_list');\n LingotekLog::info(\"Target language added: @drupal_language_code (@lingotek_locale)\", array(\n '@drupal_language_code' => $drupal_language_code,\n '@lingotek_locale' => $lingotek_locale));\n }\n return TRUE;\n}",
"function GetDefaultLang() : string\n{\n return 'en';\n}"
] | [
"0.70320916",
"0.6955117",
"0.683903",
"0.683422",
"0.6609212",
"0.6604728",
"0.65828913",
"0.6544811",
"0.6508964",
"0.6507826",
"0.6484027",
"0.6479829",
"0.64636177",
"0.6400112",
"0.6354054",
"0.63510644",
"0.634929",
"0.63390636",
"0.6325666",
"0.6309055",
"0.62830174",
"0.62603205",
"0.6253009",
"0.6214807",
"0.6210787",
"0.62072515",
"0.62040913",
"0.6203794",
"0.6197469",
"0.61907357"
] | 0.7038532 | 0 |
Sets the language add/mod variable page | function modifyVariables()
{
global $objDatabase, $_ARRAYLANG;
$variableName = "";
$variableId = "";
$variableModule = "";
$this->template->loadTemplateFile('language_mod.html');
$this->pageTitle = $_ARRAYLANG['TXT_ADD_LANGUAGE_VARIABLES'];
$this->template->setVariable(array(
'TXT_NAME' => $_ARRAYLANG['TXT_NAME'],
'TXT_VALUE_CONTROL_LANGUAGE' => $_ARRAYLANG['TXT_VALUE_CONTROL_LANGUAGE'],
'TXT_MODULE' => $_ARRAYLANG['TXT_MODULE'],
'TXT_SELECT_MODULE' => $_ARRAYLANG['TXT_SELECT_MODULE'],
'TXT_STORE' => $_ARRAYLANG['TXT_SAVE'],
'TXT_WEB_PAGES' => $_ARRAYLANG['TXT_WEB_PAGES'],
'TXT_ADMINISTRATION_PAGES' => $_ARRAYLANG['TXT_ADMINISTRATION_PAGES'],
'TXT_APPLICATION_RANGE' => $_ARRAYLANG['TXT_APPLICATION_RANGE'],
'TXT_LANGUAGE_NAME_REQUIRED' => $_ARRAYLANG['TXT_LANGUAGE_NAME_REQUIRED'],
'TXT_APPLICATION_RANGE_REQUIRED' => $_ARRAYLANG['TXT_APPLICATION_RANGE_REQUIRED'],
'TXT_WRITE_VARIABLES_TO_FILES' => $_ARRAYLANG['TXT_WRITE_VARIABLES_TO_FILES']
));
$objResult = $objDatabase->Execute("SELECT id,name,lang FROM ".DBPREFIX."languages ORDER BY id");
if ($objResult !== false) {
while (!$objResult->EOF) {
$arrayLang[$objResult->fields['id']]=$objResult->fields['name']." (".$objResult->fields['lang'].")";
$objResult->MoveNext();
}
}
$lastId = 1;
if (isset($_GET['id']))
//---------------------------
// mod status
//---------------------------
{
$this->template->setVariable("TXT_LANGUAGE_SETTING", $_ARRAYLANG['TXT_MOD_LANGUAGE_VARIABLES']);
$variableId = intval($_GET['id']);
$objResult = $objDatabase->SelectLimit("SELECT id,
name,
module_id,
backend,
frontend
FROM ".DBPREFIX."language_variable_names
WHERE id = ".$variableId, 1);
if ($objResult !== false) {
while (!$objResult->EOF) {
$variableName=$objResult->fields['name'];
$variableAdminzone=$objResult->fields['backend'];
$variableWebsite=$objResult->fields['frontend'];
$variableModule=$objResult->fields['module_id'];
$objResult->MoveNext();
}
}
$objResult = $objDatabase->Execute("SELECT content,
lang_id,
status
FROM ".DBPREFIX."language_variable_content
WHERE varid = ".$variableId."
ORDER BY varid");
if ($objResult !== false) {
while (!$objResult->EOF) {
$variableContent[$objResult->fields['lang_id']]=$objResult->fields['content'];
$variableStatus[$objResult->fields['lang_id']]=$objResult->fields['status'];
$objResult->MoveNext();
}
}
foreach ($arrayLang as $k => $v) {
$checked="";
if ($variableStatus[$k]==1) {
$checked="checked";
}
//echo htmlspecialchars($variableContent[$k], ENT_QUOTES, CONTREXX_CHARSET);
$content=htmlspecialchars($variableContent[$k], ENT_QUOTES, CONTREXX_CHARSET);
$strLangInputFields .="<input type='text' name='content[$k]' size=80 value=\"".$content."\" /> \n
<input type='checkbox' name='status[$k]' id='status_$k' value='1' ".$checked." /> <label for='status_$k'>$v</label><br />\n";
$lastId = $variableId;
}
} else
//---------------------------
// Add status
//---------------------------
{
$this->template->setVariable("TXT_LANGUAGE_SETTING", $_ARRAYLANG['TXT_ADD_LANGUAGE_VARIABLES']);
foreach ($arrayLang as $k => $v) {
$strLangInputFields .="<input type='text' onchange=\"copyValues($k, this.value)\" name='content[$k]' size=80 value='' /> \n
<input type='checkbox' onchange=\"check($k)\" name='status[$k]' id='status_$k' value='1' checked /> <label for='status_$k'>$v</label><br />\n";
$lastId = $lastId < $k ? $k : $lastId;
}
$variableAdminzone = isset($_REQUEST['backend']) ? $_REQUEST['backend'] : '';
$variableWebsite = isset($_REQUEST['frontend']) ? $_REQUEST['frontend'] : '';
}
if ($variableAdminzone==1) {
$variableAdminzone="checked";
} else {
$variableAdminzone="";
}
if ($variableWebsite==1) {
$variableWebsite="checked";
} else {
$variableWebsite="";
}
$this->template->setVariable(array(
'LANGUAGE_VARIABLE_NAME' => $variableName,
'LANGUAGE_INPUT_FIELDS' => $strLangInputFields,
'LANGUAGE_ADMINZONE' => $variableAdminzone,
'LANGUAGE_WEBSITE' => $variableWebsite,
'LANGUAGE_MODULES_MENU' => $this->getSearchOptionMenu("modules",$variableModule),
'LANGUAGE_VARIABLE_ID' => $variableId,
'LAST_ID' => $lastId+1
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function setLang(){\n $langCode = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n if(!empty($_REQUEST[LANG_CTRL_VAR]) && file_exists(PATH_ENGINE_LANG.$langCode.'.php')){\n $langCode = $_REQUEST[LANG_CTRL_VAR];\n if(ThisUser::islogged()){\n $User = Usuario::find(ThisUser::get(\"id_user\"));\n $User->lang = $_REQUEST[LANG_CTRL_VAR];\n $User->save();\n ThisUser::set(\"lang\",$_REQUEST[LANG_CTRL_VAR]);\n }\n }else{\n if(ThisUser::islogged() && ThisUser::get(\"lang\") != \"\"){\n $langCode = ThisUser::get(\"lang\");\n }\n }\n\n if(file_exists(PATH_ENGINE_LANG.$langCode.'.php')){\n Lang::load($langCode.'.php');\n }else{\n Lang::load(Sys::get('config')->lang_default.'.php');\n }\n }",
"private function _setLanguage() \r\n {\r\n //write the Config.language with the value from the Cookie\r\n if ($this->Cookie->read('lang') && !$this->Session->check('Config.language')) {\r\n $this->Session->write('Config.language', $this->Cookie->read('lang'));\r\n } else if (isset($this->params['language']) && ($this->params['language'] != $this->Session->read('Config.language'))) {\r\n //then update the value in Session and the one in Cookie\r\n $this->Session->write('Config.language', $this->params['language']);\r\n $this->Cookie->write('lang', $this->params['language'], false, '20 days');\r\n }\r\n }",
"function modifyLanguage()\n {\n global $_ARRAYLANG, $_CONFIG, $objDatabase;\n\n if (!empty($_POST['submit']) AND (isset($_POST['addLanguage']) && $_POST['addLanguage']==\"true\")) {\n //-----------------------------------------------\n // Add new language with all variables\n //-----------------------------------------------\n if (!empty($_POST['newLangName']) AND !empty($_POST['newLangShortname'])) {\n $newLangShortname = addslashes(strip_tags($_POST['newLangShortname']));\n $newLangName = addslashes(strip_tags($_POST['newLangName']));\n $newLangCharset = addslashes(strip_tags($_POST['newLangCharset']));\n $objResult = $objDatabase->Execute(\"SELECT lang FROM \".DBPREFIX.\"languages WHERE lang='\".$newLangShortname.\"'\");\n if ($objResult !== false) {\n if ($objResult->RecordCount()>=1) {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n return false;\n } else {\n $objDatabase->Execute(\"INSERT INTO \".DBPREFIX.\"languages SET lang='\".$newLangShortname.\"',\n name='\".$newLangName.\"',\n charset='\".$newLangCharset.\"',\n is_default='false'\");\n $newLanguageId = $objDatabase->Insert_ID();\n if (!empty($newLanguageId)) {\n $objResult = $objDatabase->SelectLimit(\"SELECT id FROM \".DBPREFIX.\"languages WHERE is_default='true'\", 1);\n if ($objResult !== false && !$objResult->EOF) {\n $defaultLanguage=$objResult->fields['id'];\n\n $objResult = $objDatabase->Execute(\"SELECT varid,content,module FROM \".DBPREFIX.\"language_variable_content WHERE 1 AND lang=\".$defaultLanguage);\n if ($objResult !== false) {\n while (!$objResult->EOF) {\n $arrayLanguageContent[$objResult->fields['varid']]=stripslashes($objResult->fields['content']);\n $arrayLanguageModule[$objResult->fields['varid']]=$objResult->fields['module'];\n $objResult->MoveNext();\n }\n foreach ($arrayLanguageContent as $varid => $content) {\n $LanguageModule = $arrayLanguageModule[$varid];\n $objDatabase->Execute(\"INSERT INTO \".DBPREFIX.\"language_variable_content SET varid=\".$varid.\", content='\".addslashes($content).\"', module=\".$LanguageModule.\", lang=\".$newLanguageId.\", status=0\");\n }\n $this->strOkMessage = $_ARRAYLANG['TXT_NEW_LANGUAGE_ADDED_SUCCESSFUL'];\n return true;\n }\n }\n } else {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n return false;\n }\n }\n }\n }\n } elseif (!empty($_POST['submit']) AND ( $_POST['modLanguage'] == \"true\")) {\n //-----------------------------------------------\n // Update languages\n //-----------------------------------------------\n foreach ($_POST['langName'] as $id => $name) {\n $active = 0;\n if (isset($_POST['langActiveStatus'][$id]) && $_POST['langActiveStatus'][$id]==1 ) {\n $languageCode = \\FWLanguage::getLanguageCodeById($id);\n $pageRepo = \\Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');\n $alias = $pageRepo->findBy(array(\n 'type' => \\Cx\\Core\\ContentManager\\Model\\Entity\\Page::TYPE_ALIAS,\n 'slug' => $languageCode,\n ), true);\n\n if (count($alias)) {\n if (is_array($alias)) $alias = $alias[0];\n $id = $alias->getNode()->getId();\n $config = \\Env::get('config');\n $link = 'http://' . $config['domainUrl'] . ASCMS_PATH_OFFSET . '/' . $alias->getSlug();\n $lang = \\Env::get('lang');\n $this->strErrMessage =\n $lang['TXT_CORE_REMOVE_ALIAS_TO_ACTIVATE_LANGUAGE'] . ':<br />\n <a href=\"index.php?cmd=Alias&act=modify&id=' . $id . '\" target=\"_blank\">' . $link . '</a>';\n return false;\n }\n\n $active = 1;\n }\n $status = \"false\";\n if ($_POST['langDefaultStatus']==$id) {\n $status = \"true\";\n }\n $adminstatus = 0;\n if (isset($_POST['langAdminStatus'][$id]) && $_POST['langAdminStatus'][$id]==1) {\n $adminstatus = 1;\n }\n $fallBack = (isset($_POST['fallBack'][$id]) && $_POST['fallBack'][$id] != \"\" ) ? intval($_POST['fallBack'][$id]) : 'NULL'; \n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"languages SET \n name='\".$name.\"',\n frontend=\".$active.\",\n is_default='\".$status.\"',\n backend='\".$adminstatus.\"',\n fallback=\".$fallBack.\"\n WHERE id=\".$id);\n }\n $this->strOkMessage = $_ARRAYLANG['TXT_DATA_RECORD_UPDATED_SUCCESSFUL'];\n \\FWLanguage::init();\n return true;\n }\n return false;\n }",
"protected function set_locale() {\n\t\t$objLanguage = new language();\n\n\t\tif ($objLanguage->CheckLocale($this->locale,false) == false) {\n\t\t\t$this->locale = 'en';\n\t\t}\n\t\t$this->showpage();\n\t}",
"public function setLang($l){\r\n $this->lang = $l;\r\n }",
"public function setLanguage()\n {\n if(!$this->language){\n $this->language = substr(Yii::$app->language,0,2);\n }\n\n $this->data = ArrayHelper::merge($this->data,\n [\n 'language' => $this->language,\n 'tabs' => $this->tabs,\n 'type' => $this->tab,\n 'cronExpression' => $this->value\n ]\n );\n }",
"public function setLangue($valeur) {$this->_lg = $valeur; $this->_build();}",
"function addLanguage()\n {\n global $_ARRAYLANG, $objDatabase;\n\n if (empty($_POST['name']) || empty($_POST['shortName']) || empty($_POST['charset'])) {\n return false;\n }\n $shortName = mysql_escape_string($_POST['shortName']);\n $name = mysql_escape_string($_POST['name']);\n $charset = mysql_escape_string($_POST['charset']);\n\n $objResult = $objDatabase->Execute(\"\n SELECT lang\n FROM \".DBPREFIX.\"languages\n WHERE lang='$shortName'\n \");\n if (!$objResult) {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n return false;\n }\n if ($objResult->RecordCount() > 0) {\n // Language exists already.\n// TODO: Add a more suitable error message here.\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n return false;\n }\n $objDatabase->Execute(\"\n INSERT INTO \".DBPREFIX.\"languages\n SET lang='\".contrexx_addslashes($shortName).\"',\n name='\".contrexx_addslashes($name).\"',\n charset='\".contrexx_addslashes($charset).\"',\n is_default='false'\n \");\n $newLanguageId = $objDatabase->Insert_ID();\n\n $objResult = $objDatabase->SelectLimit(\"\n SELECT id FROM \".DBPREFIX.\"languages\n WHERE is_default='true'\", 1\n );\n if ($objResult) {\n while (!$objResult->EOF) {\n $defaultLanguageId = $objResult->fields['id'];\n $objResult->MoveNext();\n }\n }\n $objResult = $objDatabase->Execute(\"\n SELECT varid,content\n FROM \".DBPREFIX.\"language_variable_content\n WHERE lang_id=$defaultLanguageId\n \");\n if ($objResult) {\n while (!$objResult->EOF) {\n $arrContent[$objResult->fields['varid']] = $objResult->fields['content'];\n $objResult->MoveNext();\n }\n }\n foreach ($arrContent as $key => $content) {\n $objDatabase->Execute(\"\n INSERT INTO \".DBPREFIX.\"language_variable_content\n SET varid=$key,\n content='\".addslashes($content).\"',\n lang_id=$newLanguageId,\n status=0\n \");\n }\n $objResult = $objDatabase->Execute(\"\n SELECT gallery_id, name, value\n FROM \".DBPREFIX.\"module_gallery_language\n WHERE lang_id=$defaultLanguageId\n \");\n if ($objResult) {\n while (!$objResult->EOF) {\n $objDatabase->Execute(\"\n INSERT INTO \".DBPREFIX.\"module_gallery_language\n SET gallery_id=\".$objResult->fields['gallery_id'].\",\n lang_id=$newLanguageId,\n name='\".$objResult->fields['name'].\"',\n value='\".$objResult->fields['value'].\"'\n \");\n $objResult->MoveNext();\n }\n }\n $objResult = $objDatabase->Execute(\"\n SELECT picture_id, name, `desc`\n FROM \".DBPREFIX.\"module_gallery_language_pics\n WHERE lang_id=$defaultLanguageId\n \");\n if ($objResult) {\n while (!$objResult->EOF) {\n $objDatabase->Execute(\"\n INSERT INTO \".DBPREFIX.\"module_gallery_language_pics\n SET picture_id=\".$objResult->fields['picture_id'].\",\n lang_id=$newLanguageId,\n name='\".$objResult->fields['name'].\"',\n `desc`='\".$objResult->fields['desc'].\"'\n \");\n $objResult->MoveNext();\n }\n }\n $this->strOkMessage = $_ARRAYLANG['TXT_NEW_LANGUAGE_ADDED_SUCCESSFUL'];\n return true;\n }",
"public function setLang($p_lang){\n\t\t$this -> lang = $p_lang;\n\t}",
"function AssignNewsLanguage()\n\t{\tif (!$this->language = $_GET[\"lang\"])\n\t\t{\t$this->language = $this->def_lang;\n\t\t}\n\t}",
"function languages($args, &$request) {\n\t\t$this->validate($request);\n\t\t$this->setupTemplate($request, true);\n\n\t\t$templateMgr =& TemplateManager::getManager($request);\n\t\t$templateMgr->display('manager/languageSettings.tpl');\n\t}",
"function languages($args, &$request) {\n\t\t$this->validate($request);\n\t\t$this->setupTemplate($request, true);\n\n\t\t$templateMgr =& TemplateManager::getManager($request);\n\t\t$templateMgr->display('manager/languageSettings.tpl');\n\t}",
"function SetLang($lang) {\n if (is_dir('lang/' . $lang)) {\n $key = IBC1_PREFIX . '_Language';\n $GLOBALS[$key] = $lang;\n setcookie($key, $lang, time() + 7 * 24 * 60 * 60);\n }\n}",
"function language($language)\n {\n $GLOBALS[\"config_language\"][] = $language;\n }",
"protected function _setGridVarLang() {\n\n $lang = t3lib_div::_GP('L');\n if(isset($lang)) {\n \n $this->_conf['ff']->gridParam->lang = (int)$lang;\n }\n }",
"function AddDetailsForDefaultLang(){}",
"private static function setLanguage()\n\t\t{\n\t\t\tif(!isset($_GET['lang']) || !$_GET['lang'] || !\\config\\Configuration::isAllowedLanguage($_GET['lang']))\n\t\t\t{\n\t\t\t\tself::$language = \\config\\Configuration::$vars['locale']['default_language'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tself::$language = $_GET['lang'];\n\t\t\t}\n\n\t\t\tself::$locality = \\config\\Configuration::getLocality(self::$language);\n\t\t}",
"function setLangVars()\n\t{\n\t\tif(class_exists('LangVars'))\n\t\t{\n\t\t\t$this->langVars = new LangVars();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$langVarsPath = str_replace('AjaxTableEditor.php','lang/LangVars-en.php',__file__);\n\t\t\tif(is_file($langVarsPath))\n\t\t\t{\n\t\t\t\trequire_once($langVarsPath);\n\t\t\t\t$this->langVars = new LangVars();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->warnings[] = 'The language file could not be found.';\n\t\t\t}\n\t\t}\n\t}",
"public function setLang($file){\n\t\t $lang_file = $file;\t\t \n\t}",
"function setLanguage($language);",
"function languages()\n\t{\n\t\t//Configure::write('debug', 2);\n $users= $this->Session->read('infoAdminLogin');\n if($users)\n {\n \t\tController::loadModel('Option');\n $this->setup();\n\n $languages= $this->Option->getOption('language');\n $this->set('languages', $languages['Option']['value']);\n \n $urlLocal= $this->getUrlLocal();\n\t $listFile= $this->list_files($urlLocal['urlLocalLanguage']);\n \n $this->set('listFile',$listFile);\n \n }\n else \n {\n \t$urlLocal= $this->getUrlLocal();\n $this->redirect($urlLocal['urlAdmins'].'login');\n }\n\t}",
"function getLanguagePage()\n {\n global $_CORELANG, $objTemplate;\n\n if (!isset($_GET['act'])) {\n $_GET['act'] = \"\";\n }\n\n switch($_GET['act']) {\n case 'dellang':\n \\Permission::checkAccess(49, 'static');\n $this->deleteLanguage();\n $this->languageOverview();\n break;\n case 'vars':\n $this->listVariables();\n break;\n case 'varOfId':\n $this->_getVarOfId();\n break;\n case 'mod':\n \\Permission::checkAccess(48, 'static');\n $this->addUpdateVariable();\n $this->modifyVariables();\n break;\n case 'add':\n \\Permission::checkAccess(50, 'static');\n $this->addLanguage();\n $this->languageOverview();\n break;\n case 'del':\n \\Permission::checkAccess(48, 'static');\n $this->deleteVariable();\n $this->listVariables();\n break;\n case 'writefiles':\n \\Permission::checkAccess(48, 'static');\n $this->createFiles();\n $this->listVariables();\n break;\n default: \n \\Permission::checkAccess(50, 'static');\n $this->modifyLanguage();\n $this->languageOverview();\n }\n $objTemplate->setVariable(array(\n 'CONTENT_TITLE' => $this->pageTitle,\n 'CONTENT_OK_MESSAGE' => $this->strOkMessage,\n 'CONTENT_STATUS_MESSAGE' => $this->strErrMessage,\n 'ADMIN_CONTENT' => $this->template->get()\n ));\n\n $this->act = $_GET['act'];\n $this->setNavigation();\n }",
"function setlanguage() {\n\tif (!isset($_SESSION['language'])) {\n\t\t$_SESSION['language'] = \"en_GB.utf8:UTF-8:English (Great Britain)\";\n\t}\n\t$language = explode(\":\", $_SESSION['language']);\n\tputenv(\"LANG=\" . $language[0]); // e.g. LANG=de_DE\n\tsetlocale(LC_ALL, $language[0]); // set LC_ALL to de_DE\n\t$locdir = substr(__FILE__, 0, strlen(__FILE__) - 15) . \"/locale\"; // set path to translations\n\tbindtextdomain(\"messages\", $locdir);\n\tbind_textdomain_codeset(\"messages\", $language[1]);\n\ttextdomain(\"messages\");\n\theader(\"Content-type: text/html; charset=\" . $language[1], true);\n}",
"private function includeLang ()\n\t{\n\t\t$file = $this->cms->bPath . \"/non_html/modules/\" . $this->moduledir . \"/locale/\" . $this->cms->languages->selectedlanguage['dir'] . \".php\";\n\t\tif (file_exists($file))\n\t\t{\n\t\t\trequire $file;\n\t\t\tif (isset($lang))\n\t\t\t{\n\t\t\t\t$this->lang = $lang;\n\t\t\t} else\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Module Content: erroneous language file loaded.\");\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\t$file = $this->cms->bPath . \"/non_html/modules/\" . $this->moduledir . \"/locale/\" . $this->cms->languages->default['dir'] . \".php\";\n\t\t\tif (! file_exists($file))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Module Content: no language file found.\");\n\t\t\t} else\n\t\t\t{\n\t\t\t\trequire $file;\n\t\t\t\t$this->lang = $lang;\n\t\t\t\tif (isset($lang))\n\t\t\t\t{\n\t\t\t\t\t$this->lang = $lang;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"Module Content: erroneous language file loaded.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function set_locale() {\n\t\t$plugin_i18n = new Bitwise_Sidebar_Content_i18n();\n\t\tadd_action( 'plugins_loaded', array( $plugin_i18n, 'load_plugin_textdomain' ) );\n\t}",
"function Language(){\n\t\t$fillin = array( 'wgSysopSpecialPages', 'wgValidSpecialPages', 'wgDeveloperSpecialPages' );\n\t\t$name = get_class( $this );\n\t\tif( strpos( $name, 'language' ) == 0){\n\t\t\t$lang = ucfirst( substr( $name, 8 ) );\n\t\t\tforeach( $fillin as $arrname ){\n\t\t\t\t$langver = \"{$arrname}{$lang}\";\n\t\t\t\t$enver = \"{$arrname}En\";\n\t\t\t\tif( ! isset( $GLOBALS[$langver] ) || ! isset( $GLOBALS[$enver] ))\n\t\t\t\t\tcontinue;\n\t\t\t\tforeach($GLOBALS[$enver] as $spage => $text){\n\t\t\t\t\tif( ! isset( $GLOBALS[$langver][$spage] ) )\n\t\t\t\t\t\t$GLOBALS[$langver][$spage] = $text;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function el_installation_register_languages($strings = array()) {\n global $ElInstall;\n $ElInstall->langStrings = $strings;\n}",
"function addLanguageToJS()\n{\n\tglobal $language;\n\t$args = func_get_args();\n\tforeach ($args as $key) {\n\t\t$definition =& $language;\n\t\tforeach ((array)$key as $k) $definition =& $definition[$k];\n\t\t$this->jsLanguage[$k] =& $definition;\n\t}\n}",
"public function language(){\n\t\tif(!$this->session->userdata('id')){\n\t redirect(\"admin\");\n\t }else{\n\t\t \n\t\t$data['languages'] = $this->user->get_language(0);\n\t\t\n\t\t$data['page'] ='language';\n\t $data['title'] ='manage language';\n\t\t$this->load->view('admin/include/header',$data);\n\t\t$this->load->view('admin/include/inner_header',$data);\n\t\t$this->load->view('admin/language_view');\n\t\t$this->load->view('admin/include/footer'); \n\t } \n\t\t \n\t }",
"public function saveLanguage()\n\t{\n\t\t$language = Piwik_Common::getRequestVar('language');\n\t\tPiwik_LanguagesManager::setLanguageForSession($language);\n\t\tPiwik_Url::redirectToReferer();\n\t}"
] | [
"0.69364536",
"0.67928284",
"0.67243314",
"0.6644978",
"0.6602309",
"0.66016656",
"0.655483",
"0.65372294",
"0.65233773",
"0.6500086",
"0.64812434",
"0.64812434",
"0.64139295",
"0.641185",
"0.63980746",
"0.6376304",
"0.63176566",
"0.6311979",
"0.6310543",
"0.6305817",
"0.62819344",
"0.62787044",
"0.6261839",
"0.6242253",
"0.6198255",
"0.6195207",
"0.6194653",
"0.61559105",
"0.61507183",
"0.61472684"
] | 0.7238052 | 0 |
Specifies the strong name of the assembly that is used for the event receiver. | public function getReceiverAssembly()
{
if (!$this->isPropertyAvailable("ReceiverAssembly")) {
return null;
}
return $this->getProperty("ReceiverAssembly");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setReceiverAssembly($value)\n {\n $this->setProperty(\"ReceiverAssembly\", $value, true);\n }",
"public function setEventName($event)\n\t{\n\t\t$this->event_name = $event;\n\t}",
"public function setEventName($event)\n\t{\n\t\t$this->event_name = $event;\n\t}",
"public function setManifestName($value)\n {\n $this->_manifestName = $value;\n }",
"protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\n\t\treturn 'com_restful.externalsender.' . (int)$this->$k;\n\t}",
"public function get_eventname() {\n return $this->eventname;\n }",
"public function get_event_name();",
"public function getClassName(){return \"Core.UI.Events.UserEvent.UserEvent\";}",
"public function getName()\n {\n return Craft::t('Freeform Event Tracking');\n }",
"function broadcastAs(): string\n {\n }",
"public function broadcastAs()\n {\n return 'app.notification';\n }",
"public function __construct($name)\n {\n $this->senderName = $name;\n }",
"public function broadcastAs()\n {\n return 'notification.new';\n }",
"public function getName()\n {\n return strtolower(__CLASS__);\n }",
"public static function getNameApplication()\n {\n $string = Class_Config::get('nameApplication');\n if (empty($string))\n $string = 'Not Name Application';\n \n return $string;\n }",
"function __construct($name) {\n $this->_addon = PATH_APPLICATIONS . $name . \"/\";\n $this->_name = $name;\n }",
"public function broadcastAs()\n {\n return 'conversation.received';\n }",
"protected function formulateName()\n {\n $classTokens = explode('\\\\', get_class($this));\n $bundleName = array_shift($classTokens);\n $className = array_pop($classTokens);\n $prefix = strtolower(str_replace('Bundle', '', $bundleName));\n $command = strtolower(str_replace('Command', '', $className)); \n\n return \"{$prefix}:{$command}\";\n }",
"public function getName()\n {\n return $this->eventName;\n }",
"public function getName()\n {\n return 'Alipay AUTHTOKEN';\n }",
"private function get_appname()\n {\n return SAE_APPNAME;\n }",
"public function get_name() {\n\t\treturn 'sermon_archive';\n\t}",
"public function setFullEventNameAttribute($value)\n {\n $parts = explode('.', $value);\n $last = array_pop($parts);\n $parts = array(implode('.', $parts), $last);\n $plugin_name = $parts[0];\n $event_name = $parts[1];\n\n $this->attributes['plugin_name'] = $plugin_name;\n $this->attributes['event_name'] = $event_name;\n }",
"function ModuleName()\n {\n if ($this->IsMain())\n {\n return \"Application\";\n }\n else\n {\n return $this->ModuleName;\n }\n }",
"protected function getSMSVerificationSender()\n {\n return env('APP_NAME');\n }",
"public function getName()\n {\n return 'base_application';\n }",
"public function getURLName() : string {\n return urlencode($this->eventName);\n }",
"public function getManifestName()\n {\n return $this->_manifestName;\n }",
"public static function set_script( $name ) {\n\t\t$js = self::get_instance();\n\t\t$js->script_name = $name;\n\t}",
"public function setName($appName);"
] | [
"0.50579715",
"0.49551162",
"0.49551162",
"0.4944717",
"0.4848334",
"0.4834059",
"0.47205427",
"0.47167787",
"0.4693981",
"0.4690736",
"0.46786958",
"0.46626112",
"0.46512398",
"0.46417516",
"0.46373302",
"0.4623003",
"0.4616235",
"0.45423475",
"0.4540908",
"0.45377678",
"0.45318103",
"0.45247185",
"0.45141608",
"0.4486307",
"0.4482525",
"0.44747344",
"0.44718754",
"0.44598275",
"0.4457449",
"0.44509414"
] | 0.50903904 | 0 |
Specifies the strong name of the assembly that is used for the event receiver. | public function setReceiverAssembly($value)
{
$this->setProperty("ReceiverAssembly", $value, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getReceiverAssembly()\n {\n if (!$this->isPropertyAvailable(\"ReceiverAssembly\")) {\n return null;\n }\n return $this->getProperty(\"ReceiverAssembly\");\n }",
"public function setEventName($event)\n\t{\n\t\t$this->event_name = $event;\n\t}",
"public function setEventName($event)\n\t{\n\t\t$this->event_name = $event;\n\t}",
"public function setManifestName($value)\n {\n $this->_manifestName = $value;\n }",
"protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\n\t\treturn 'com_restful.externalsender.' . (int)$this->$k;\n\t}",
"public function get_eventname() {\n return $this->eventname;\n }",
"public function get_event_name();",
"public function getClassName(){return \"Core.UI.Events.UserEvent.UserEvent\";}",
"public function getName()\n {\n return Craft::t('Freeform Event Tracking');\n }",
"function broadcastAs(): string\n {\n }",
"public function broadcastAs()\n {\n return 'app.notification';\n }",
"public function __construct($name)\n {\n $this->senderName = $name;\n }",
"public function broadcastAs()\n {\n return 'notification.new';\n }",
"public function getName()\n {\n return strtolower(__CLASS__);\n }",
"public static function getNameApplication()\n {\n $string = Class_Config::get('nameApplication');\n if (empty($string))\n $string = 'Not Name Application';\n \n return $string;\n }",
"function __construct($name) {\n $this->_addon = PATH_APPLICATIONS . $name . \"/\";\n $this->_name = $name;\n }",
"public function broadcastAs()\n {\n return 'conversation.received';\n }",
"protected function formulateName()\n {\n $classTokens = explode('\\\\', get_class($this));\n $bundleName = array_shift($classTokens);\n $className = array_pop($classTokens);\n $prefix = strtolower(str_replace('Bundle', '', $bundleName));\n $command = strtolower(str_replace('Command', '', $className)); \n\n return \"{$prefix}:{$command}\";\n }",
"public function getName()\n {\n return $this->eventName;\n }",
"public function getName()\n {\n return 'Alipay AUTHTOKEN';\n }",
"private function get_appname()\n {\n return SAE_APPNAME;\n }",
"public function get_name() {\n\t\treturn 'sermon_archive';\n\t}",
"public function setFullEventNameAttribute($value)\n {\n $parts = explode('.', $value);\n $last = array_pop($parts);\n $parts = array(implode('.', $parts), $last);\n $plugin_name = $parts[0];\n $event_name = $parts[1];\n\n $this->attributes['plugin_name'] = $plugin_name;\n $this->attributes['event_name'] = $event_name;\n }",
"function ModuleName()\n {\n if ($this->IsMain())\n {\n return \"Application\";\n }\n else\n {\n return $this->ModuleName;\n }\n }",
"protected function getSMSVerificationSender()\n {\n return env('APP_NAME');\n }",
"public function getName()\n {\n return 'base_application';\n }",
"public function getURLName() : string {\n return urlencode($this->eventName);\n }",
"public function getManifestName()\n {\n return $this->_manifestName;\n }",
"public static function set_script( $name ) {\n\t\t$js = self::get_instance();\n\t\t$js->script_name = $name;\n\t}",
"public function setName($appName);"
] | [
"0.50903904",
"0.49551162",
"0.49551162",
"0.4944717",
"0.4848334",
"0.4834059",
"0.47205427",
"0.47167787",
"0.4693981",
"0.4690736",
"0.46786958",
"0.46626112",
"0.46512398",
"0.46417516",
"0.46373302",
"0.4623003",
"0.4616235",
"0.45423475",
"0.4540908",
"0.45377678",
"0.45318103",
"0.45247185",
"0.45141608",
"0.4486307",
"0.4482525",
"0.44747344",
"0.44718754",
"0.44598275",
"0.4457449",
"0.44509414"
] | 0.50579715 | 1 |
Specifies the identifier of the event receiver definition. | public function setReceiverId($value)
{
$this->setProperty("ReceiverId", $value, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function id()\n {\n return 'form_new_event';\n }",
"public function setReceiver($receiver) {\n $this->receiver = $receiver;\n }",
"public function getReceiverId()\n {\n if (!$this->isPropertyAvailable(\"ReceiverId\")) {\n return null;\n }\n return $this->getProperty(\"ReceiverId\");\n }",
"private function setTrigger ($identifier)\n {\n $this->details = new EventTrigger();\n\n $this->details->event_queue_id = $this->eventId;\n $this->details->identifier = $identifier;\n $this->details->start_time = DateUtil::getDateTime();\n\n $this->details->save();\n }",
"function id()\n {\n return 'form_event_rsvp';\n }",
"public function setIdentifier($identifier);",
"public function setIdentifier($identifier);",
"public function setIdentifier($identifier);",
"public function setIdentifier($identifier)\n {\n $this->identifier = $identifier;\n }",
"public function setIdentifier($id) {\n $this->identifier = $id;\n }",
"public function receiver_name();",
"public function getIdentifier(): string\n {\n return 'events2UpdateSlug';\n }",
"public function getSubID()\n {\n return 'trigger';\n }",
"public function getEventUid($identifier)\n {\n return 'open-library-' . $this->shortKey . '-' . $identifier;\n }",
"public function definition()\n {\n return [\n 'safe_t_reimbursement_event_id' => SafeTReimbursementEvent::factory(),\n ];\n }",
"public function setIdentifier($identifier): void\n {\n $this->identifier = $identifier;\n }",
"public function setEventId($id)\n {\n if(in_array($this->type, ['events.create', 'events.display'])) {\n $this->event_id = (int) $id;\n }\n\n return $this;\n }",
"public function setIdentifierAttribute($val = '')\n {\n $this->attributes['identifier'] = strtoupper(str_random($val));\n }",
"public function setNewEventName($val) {\n $this->_new_event_name = $val;\n }",
"public function getIdentifier(): string\n {\n return 'id';\n }",
"public function setReceiverName($value)\n {\n $this->setProperty(\"ReceiverName\", $value, true);\n }",
"public function setEventIdAttribute($input)\n {\n $this->attributes['event_id'] = $input ? $input : null;\n }",
"function setId($id)\n\t{\n\t\t// Set event id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t$this->_data\t= null;\n\t}",
"function setId($id)\n\t{\n\t\t// Set event id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t$this->_data\t= null;\n\t}",
"public function getFormId() {\n return 'event_settings';\n }",
"public function getReceiverName()\n {\n return $this->receiverName;\n }",
"public function identifyWith($identifier)\n {\n $this->setName($identifier);\n }",
"function setIdentifier($identifier)\n { \n if (!in_array($identifier, sfConfig::get(\"app_files_location_identifiers\")))\n {\n throw new exception (\"Unsupported Identifier: \".$identifier);\n }\n \n $this->_reaktorfile->setIdentifier($identifier);\n $this->_isunsaved = true;\n }",
"private function defineReceivers()\n {\n $receiverId = $this->notif->receiver;\n\n // direct user\n if ($receiverId > 0) {\n /** @var User $user */\n $user = User::findOne($receiverId);\n NfException::ensure($user instanceof User, \"Can't find receiver with id [{$receiverId}]\");\n $this->receivers[$user->primaryKey] = $user;\n\n } elseif ($receiverId == Notification::RECEIVER_OWNER_ID) {\n NfException::ensure($this->eventRaiserModel instanceof User, \"Incorrect event sender param for {$this->notif->code}\");\n\n /** @var User $user */\n $user = $this->eventRaiserModel;\n $this->receivers[$user->primaryKey] = $user;\n\n } elseif ($receiverId == Notification::RECEIVER_ALL_ID) {\n $this->receivers = User::find()\n ->indexBy('id')\n ->selectLight()\n ->where(['status' => User::STATUS_ACTIVE])\n ->all()\n ;\n }\n }",
"public function getReceiver();"
] | [
"0.56122184",
"0.55894816",
"0.54119694",
"0.53444153",
"0.5274584",
"0.5269603",
"0.5269603",
"0.5269603",
"0.5197863",
"0.5184936",
"0.517725",
"0.509562",
"0.5044084",
"0.50360227",
"0.5033704",
"0.50024575",
"0.4891573",
"0.4852641",
"0.4846363",
"0.48402956",
"0.4815545",
"0.48063254",
"0.47970906",
"0.47970906",
"0.4783658",
"0.4747676",
"0.47377512",
"0.47210553",
"0.46940023",
"0.4690146"
] | 0.56942105 | 0 |
Specifies the name of the event receiver. | public function setReceiverName($value)
{
$this->setProperty("ReceiverName", $value, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function receiver_name();",
"public function setEventName($event)\n\t{\n\t\t$this->event_name = $event;\n\t}",
"public function setEventName($event)\n\t{\n\t\t$this->event_name = $event;\n\t}",
"public function getReceiverName()\n {\n return $this->receiverName;\n }",
"public function getReceiverName(): string\n {\n return $this->receiverName;\n }",
"public function getReceiverName()\n {\n if (!$this->isPropertyAvailable(\"ReceiverName\")) {\n return null;\n }\n return $this->getProperty(\"ReceiverName\");\n }",
"public function getName()\n {\n return $this->eventName;\n }",
"public function __construct($name)\n {\n $this->senderName = $name;\n }",
"public function get_eventname() {\n return $this->eventname;\n }",
"public function setNewEventName($val) {\n $this->_new_event_name = $val;\n }",
"public function get_event_name();",
"public function setReceiver($receiver) {\n $this->receiver = $receiver;\n }",
"public function setSender($name)\n {\n $this->user = $name;\n }",
"public function getEventName()\n\t{\n\t\treturn $this->event_name;\n\t}",
"public function getName() {\n return 'event_extension';\n }",
"public function setEventKey ($eventkeyname);",
"public function setSender(string $sender)\n {\n $this->sender = $sender;\n }",
"public function set_eventname($eventname) {\n $this->eventname = $eventname;\n return $this;\n }",
"function set_name($name) {\n $this->name = $name;\n }",
"public function getEventName() {\n return($this->eventName);\n }",
"public function getNewEventName() {\n return $this->_new_event_name;\n }",
"protected function event($event_name){\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\t\t$this->event_vars_array($event_name, $args);\n\t}",
"public function getSendToName()\n {\n return $this->sendToName;\n }",
"private function setName()\n {\n $this->name = isset($this->config->plugin_name) \n ? $this->config->plugin_name \n : null;\n }",
"public function getName()\n {\n return Craft::t('Freeform Event Tracking');\n }",
"public function name(string $name) {\n $this->name = $name;\n }",
"public function getName()\n {\n return 'merk_notification';\n }",
"public function set_name( $name ) {\n\t\t$this->name = $name;\n\t}",
"public function set_name( $name ) {\n\t\t$this->name = $name;\n\t}",
"public function getEventName()\n {\n if (array_key_exists(\"eventName\", $this->_propDict)) {\n return $this->_propDict[\"eventName\"];\n } else {\n return null;\n }\n }"
] | [
"0.6408506",
"0.62699383",
"0.62699383",
"0.6242097",
"0.6138866",
"0.61253357",
"0.609367",
"0.6063994",
"0.59939826",
"0.5941372",
"0.58954763",
"0.5759821",
"0.5713192",
"0.5707417",
"0.5566119",
"0.54982185",
"0.5482987",
"0.540176",
"0.5315203",
"0.52790904",
"0.52506584",
"0.52505636",
"0.52332544",
"0.5213879",
"0.52057517",
"0.51758707",
"0.5175312",
"0.5173275",
"0.5173275",
"0.5168435"
] | 0.67089593 | 0 |
/ Returns an instance domain, according to the environment configuration | private function getDomain()
{
return $this->getConfig('domain');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDomain();",
"public function get_domain();",
"public static function getByDomain()\n {\n return self::firstOrNew(['domain' => $_SERVER['HTTP_HOST']], config('private-label.default'));\n }",
"private function getDomain()\n\t{\n\t\treturn $this->domain;\n\t}",
"function getDomain() {\n\t\treturn $this->getData('domain');\n\t}",
"public function getDomain()\n {\n return $this->getKey('Domain');\n }",
"#[Pure] public function getDomain(): string\n {\n return ($this->getConfig()['domain'] ?? $_SERVER['SERVER_NAME']);\n }",
"public function domain() {\n\t\treturn $this->get(Constants::DN);\n\t}",
"public function getDomain()\n\t{\n\t\tif (is_null($this->domain))\n\t\t{\n\t\t\t// Lets pull the domain from the SHLdap object\n\t\t\t$this->getId(false);\n\t\t\t$this->domain = $this->client->domain;\n\t\t}\n\n\t\treturn parent::getDomain();\n\t}",
"public function domain()\n {\n return $this->getDomain();\n }",
"function model()\n {\n return DomainConfig::class;\n }",
"public function getDomain()\n {\n try {\n $result = $this->nameExists();\n if (!$result) {\n if ($this->name) {\n $domain = new DomainName();\n $domain->setName($this->name);\n $this->entityManager->persist($domain);\n return $domain;\n }\n }\n return isset($result[0]) ? $result[0] : false;\n } catch (\\Exception $ex) {\n var_dump($ex->getMessage());\n die();\n }\n }",
"function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n\t{\n\t\treturn $this->domain;\n\t}",
"public function getDomain()\n\t{\n\t\treturn $this->domain;\n\t}",
"function getDomain() {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public static function mapDomainToEnvironment()\n {\n // we use environments to switch domain configurations.\n $envMap = [\n 'da_dk' => 'dk',\n 'de_de' => 'de',\n 'en_gb' => 'com',\n 'fi_fi' => 'fi',\n 'nb_no' => 'no',\n 'nl_nl' => 'nl',\n 'sv_se' => 'se',\n 'de_at' => 'at',\n 'de_ch' => 'ch',\n ];\n\n $path = explode('/', trim(str_replace($_SERVER['SCRIPT_NAME'], '', strtolower($_SERVER['REQUEST_URI'])), '/'));\n\n if (substr($path[0], 0, 9) === '_fragment') {\n // Extract the locale from the _fragment query. Hack to make ESI work on locale.\n $esiAttributes = [];\n $query = urldecode($_SERVER['QUERY_STRING']);\n parse_str($query, $esiAttributes);\n\n $path[0] = strtolower($esiAttributes['_locale']);\n }\n // redirect to splash screen\n elseif (empty($path[0]) || !isset($envMap[$path[0]])) {\n $path[0] = 'da_dk';\n }\n $tld = $path[0];\n\n if (isset($envMap[$tld])) {\n $env = $envMap[$tld];\n } else {\n $env = 'dk';\n }\n\n if (substr($_SERVER['HTTP_HOST'], 0, 2) == 'c.') {\n $env = $env.'_consultant';\n }\n\n return $env;\n }",
"function get_domain()\n {\n return ($this->domain);\n }",
"public function getDomain($autoInstanciate=true)\n {\n if (!$this->_domain && $autoInstanciate) {\n /**\n * @uses Parsonline_Common_Entity_Domain \n */\n require_once('Parsonline/Common/Entity/Domain.php');\n $this->_domain = new Parsonline_Common_Entity_Domain($this->_hostname);\n }\n return $this->_domain;\n }",
"public static function getDomain(): string {\n\t\treturn static::$domain;\n\t}",
"public function getDomain() {\n return $this->domain;\n }",
"public function getDomain(): string;",
"public function getDomain()\n {\n return $this->getHost();\n }",
"public function getBaseDomain()\r\n \t{\r\n \treturn $this->baseDomain;\r\n \t}"
] | [
"0.7126853",
"0.68551224",
"0.6676802",
"0.66244984",
"0.64965206",
"0.6421115",
"0.6381279",
"0.6375998",
"0.6308935",
"0.6306886",
"0.62837696",
"0.62721866",
"0.6240493",
"0.6232219",
"0.6232219",
"0.62319124",
"0.62272996",
"0.62272996",
"0.62272996",
"0.62272996",
"0.62272996",
"0.62272996",
"0.62105393",
"0.62018144",
"0.6196435",
"0.6171163",
"0.61215997",
"0.61129785",
"0.61031884",
"0.6094739"
] | 0.6930334 | 1 |
Generate the OAuth protocol header for a temporary credentials request, based on the URI. | protected function temporaryCredentialsProtocolHeader($uri)
{
$parameters = array_merge($this->baseProtocolParameters(), array_merge([
'oauth_callback' => $this->clientCredentials->getCallbackUri(),
], ['scopes' => implode('|', $this->scopes)]));
$parameters['oauth_signature'] = $this->signature->sign($uri, $parameters);
return $this->normalizeProtocolParameters($parameters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function get_header() {\n\n\t\t$header = array( 'Authorization' => '' );\n\t\t$param = $this->request_parameter;\n\t\t$param[ 'oauth_signature' ] = $this->get_signature();\n\n\t\tforeach ( $param as $name => $value ) {\n\t\t\t$param[] =\n\t\t\t\t oAuth_urlencode( $name )\n\t\t\t\t. '=\"'\n\t\t\t\t. oAuth_urlencode( $value )\n\t\t\t\t. '\"'\n\t\t\t;\n\t\t\tunset( $param[ $name ] );\n\t\t}\n\t\t$header[ 'Authorization' ] = 'OAuth ' . implode( ',', $param );\n\n\t\treturn $header;\n\t}",
"public function urlTemporaryCredentials(): string\n {\n return self::API_URL . 'oauth-service/oauth/request_token';\n }",
"function buildAuthHeader()\n {\n $authHeader = 'OAuth ';\n \n ksort($this->_aParams);\n \n $paramCount = 1;\n \n foreach($this->_aParams as $paramKey => $paramValue)\n {\n $authHeader .= rawurlencode($paramKey) . '=\"' . rawurlencode($paramValue) . '\"';\n \n if($paramCount != count($this->_aParams))\n $authHeader .= ', ';\n \n $paramCount++;\n }\n \n return $authHeader;\n }",
"public function toHeader()\n {\n $out ='Authorization: OAuth realm=\"\"';\n\n foreach ($this->_parameters as $k => $v) {\n if (substr($k, 0, 5) != \"oauth\") { \n continue;\n }\n \n if (is_array($v)) { \n throw new Oauth_Exception('Arrays not supported in headers');\n }\n \n $out .= ',' . Oauth_Util::urlencodeRfc3986($k) . '=\"' . Oauth_Util::urlencodeRfc3986($v) . '\"';\n }\n return $out;\n }",
"private function generateAuthHeaderValue()\n {\n $date = date('Y-m-d\\TH:i:s.000O');\n $signature = hash_hmac('sha256', $date, $this->apiKey);\n\n return \"username=$this->username date=$date hmac-sha256-hex=$signature\";\n }",
"function build_authorization_header( $oauth ) {\n $r = 'Authorization: OAuth ';\n $values = array();\n foreach ( $oauth as $key => $value ) {\n $values[] = \"$key=\\\"\" . rawurlencode( $value ) . \"\\\"\";\n }\n $r .= implode(', ', $values);\n return $r;\n }",
"function build_oauth_header($oauth_array) {\n\t$r = 'Authorization: OAuth ';\n\t$values = array();\n\tforeach($oauth_array as $key=>$value)\n\t\t$values[] = \"$key=\\\"\" . rawurlencode($value) . \"\\\"\";\n\t$r .= implode(', ', $values);\n\treturn $r;\n}",
"abstract public function GetOAuthHeader($url);",
"public function aai_buildAuthorizationHeader($oauth) {\n $r = 'Authorization: OAuth ';\n $values = array();\n foreach($oauth as $key=>$value)\n $values[] = \"$key=\\\"\" . rawurlencode($value) . \"\\\"\";\n $r .= implode(', ', $values);\n return $r;\n }",
"function generateHeader () {\n $header = json_encode(['typ' => 'JWT', 'alg' => 'HS256']);\n // Encode header to Base64Url string\n $base64UrlHeader = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($header));\n return $base64UrlHeader;\n}",
"private function buildAuthorizationHeader($oauth) \n {\n $return = 'Authorization: OAuth ';\n $values = array();\n \n foreach($oauth as $key => $value)\n {\n $values[] = \"$key=\\\"\" . rawurlencode($value) . \"\\\"\";\n }\n \n $return .= implode(', ', $values);\n return $return;\n }",
"private function buildAuthorizationHeader($oauth) \n {\n $return = 'Authorization: OAuth ';\n $values = array();\n \n foreach($oauth as $key => $value)\n {\n $values[] = \"$key=\\\"\" . rawurlencode($value) . \"\\\"\";\n }\n \n $return .= implode(', ', $values);\n return $return;\n }",
"private function buildAuthorizationHeader($oauth) \n {\n $return = 'Authorization: OAuth ';\n $values = array();\n \n foreach($oauth as $key => $value)\n {\n $values[] = \"$key=\\\"\" . rawurlencode($value) . \"\\\"\";\n }\n \n $return .= implode(', ', $values);\n return $return;\n }",
"private function createHeader()\n {\n $headers = $this->headers;\n\n $username = $this->getUsername();\n $auth_type = $this->getAuthType();\n\n if ('hash' == $auth_type) {\n $headers['Authorization'] = 'WHM ' . $username . ':' . preg_replace(\"'(\\r|\\n|\\s|\\t)'\", '', $this->getPassword());\n } elseif ('password' == $auth_type) {\n $headers['Authorization'] = 'Basic ' . base64_encode($username . ':' .$this->getPassword());\n }\n return $headers;\n }",
"protected function generateAuthHeader() {\n if ($this->auth_token) {\n return array('Authorization: GuifiLogin auth=' . $this->auth_token );\n } else {\n return array();\n }\n }",
"private static function buildAuthHeader($token)\n {\n return \"Authorization: Bearer \" . $token;\n }",
"public function toHeader($realm = null)\n {\n $first = true;\n if ($realm) {\n $out = 'Authorization: OAuth realm=\"' . Util::urlencodeRfc3986($realm) . '\"';\n $first = false;\n } else {\n $out = 'Authorization: OAuth';\n }\n\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (substr($k, 0, 5) != 'oauth') {\n continue;\n }\n if (is_array($v)) {\n throw new OAuthException('Arrays not supported in headers');\n }\n $out .= ($first) ? ' ' : ',';\n $out .= Util::urlencodeRfc3986($k) .\n '=\"' .\n Util::urlencodeRfc3986($v) .\n '\"';\n $first = false;\n }\n return $out;\n }",
"protected function buildAuthorizationHeader(array $oauth = array())\n {\n $values = array();\n foreach($oauth as $key => $value)\n $values[] = $key . '=\"' . rawurlencode($value) . '\"';\n\n return 'Authorization: OAuth ' . implode(', ', $values);\n }",
"public function getAuthorisationHeaderValue(): string\n {\n $this->parameters = self::computeParameters();\n $this->parameters['oauth_signature'] = self::createOAuthSignature();\n\n $header = 'OAuth ';\n $headerParams = [];\n foreach ($this->parameters as $key => $value) {\n $headerParams[] = $key . '=\"' . $value . '\"';\n }\n $header .= implode(', ', $headerParams);\n\n return $header;\n }",
"private function prepare_auth_header() {\r\n $this->headers = array();\r\n uksort($this->auth_params, 'strcmp');\r\n foreach ($this->auth_params as $k => $v) {\r\n $kv[] = \"{$k}=\\\"{$v}\\\"\";\r\n }\r\n $this->auth_header = 'OAuth ' . implode(', ', $kv);\r\n $this->headers[] = 'Authorization: ' . $this->auth_header;\r\n }",
"public function toHeader($realm = null)\n {\n $first = true;\n if ($realm) {\n $out = 'Authorization: OAuth realm=\"' . Zeed_OAuth_Util::urlencode_rfc3986($realm) . '\"';\n $first = false;\n } else\n $out = 'Authorization: OAuth';\n\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (substr($k, 0, 5) != \"oauth\")\n continue;\n if (is_array($v)) {\n throw new Zeed_OAuth_Exception('Arrays not supported in headers');\n }\n $out .= ($first) ? ' ' : ',';\n $out .= Zeed_OAuth_Util::urlencode_rfc3986($k) . '=\"' . Zeed_OAuth_Util::urlencode_rfc3986($v) . '\"';\n $first = false;\n }\n return $out;\n }",
"private function get_pulllist_auth_header($url,$method) {\n // with wskey, secret and if necessary user data from $config\n // for the $method and $url provided as parameters\n\n $authorizationHeader = '';\n if ($this->wskey && $this->secret) {\n $options = array();\n if ($this->institution && $this->ppid && $this->ppid_namespace) {\n //uses OCLC provided programming to get an autorization header\n $user = new User($this->institution, $this->ppid, $this->ppid_namespace);\n $options['user'] = $user;\n //echo \"User: \".$user->getPrincipalID();\n }\n\n if (count($options) > 0) {\n $wskeyObj = new WSKey($this->wskey, $this->secret, $options);\n $authorizationHeader = $wskeyObj->getHMACSignature($method, $url, $options);\n }\n else {\n $wskeyObj = new WSKey($this->wskey, $this->secret,null);\n $authorizationHeader = $wskeyObj->getHMACSignature($method, $url, null);\n }\n $authorizationHeader = 'Authorization: '.$authorizationHeader;\n }\n else {\n $this->log_entry('Error','get_pulllist_auth_header','No wskey and/or no secret!');\n }\n return $authorizationHeader;\n }",
"protected function protocolHeader(string $method, string $uri, CredentialsInterface $credentials, array $bodyParameters = array()): string\n {\n $parameters = array_merge(\n $this->baseProtocolParameters(),\n $this->additionalProtocolParameters(),\n array(\n 'oauth_token' => $credentials->getIdentifier(),\n\n ),\n $bodyParameters\n );\n $this->signature->setCredentials($credentials);\n\n $parameters['oauth_signature'] = $this->signature->sign(\n $uri,\n array_merge($parameters, $bodyParameters),\n $method\n );\n\n return $this->normalizeProtocolParameters($parameters);\n }",
"protected function getAuthorizationHeader ($method, $url, array $oauth_parameters, array $extraParameters = array(), $tokenSecret = '')\n {\n // Sign the request\n $oauth_parameters['oauth_signature'] = $this->signRequest(\n $method,\n $url,\n array_merge($oauth_parameters, $extraParameters),\n $this->options['client_secret'],\n $tokenSecret,\n $this->options['signature_method']\n );\n \n // Compute the headers\n $computed_oauth_parameters = array();\n foreach ($oauth_parameters as $key => $value) {\n $computed_oauth_parameters[$key] = $key . '=\"' . rawurlencode($value) . '\"';\n }\n \n return 'OAuth '.implode(', ', $computed_oauth_parameters);\n }",
"public abstract static function get_auth_header_name();",
"private function updateHttpHeader()\n {\n $this->_httpHeader = HttpHelper::EOL;\n\n $endpoint = $this->_options->getCurrentEndpoint();\n if (Endpoint::getType($endpoint) !== Endpoint::TYPE_UNIX) {\n $this->_httpHeader .= sprintf('Host: %s%s', Endpoint::getHost($endpoint), HttpHelper::EOL);\n }\n\n if (isset($this->_options[ConnectionOptions::OPTION_AUTH_JWT])) {\n // JWT, used as is \n $this->_httpHeader .= sprintf(\n 'Authorization: Bearer %s%s',\n $this->_options[ConnectionOptions::OPTION_AUTH_JWT],\n HttpHelper::EOL\n );\n } else if (isset($this->_options[ConnectionOptions::OPTION_AUTH_TYPE], $this->_options[ConnectionOptions::OPTION_AUTH_USER])) {\n // create a JWT for a given user and server's JWT secret \n if ($this->_options[ConnectionOptions::OPTION_AUTH_TYPE] == 'Bearer') {\n // JWT secret\n $base = json_encode(['typ' => 'JWT', 'alg' => 'HS256']);\n $base64UrlHeader = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($base));\n $payload = json_encode([\n 'preferred_username' => $this->_options[ConnectionOptions::OPTION_AUTH_USER],\n 'iss' => 'arangodb',\n 'iat' => (int) microtime(true),\n ]);\n $base64UrlPayload = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($payload));\n $signature = hash_hmac('sha256', $base64UrlHeader . \".\" . $base64UrlPayload, $this->_options[ConnectionOptions::OPTION_AUTH_PASSWD], true);\n $base64UrlSignature = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($signature));\n $authorizationValue = $base64UrlHeader . '.' . $base64UrlPayload . '.' . $base64UrlSignature;\n } else {\n // HTTP basic authentication\n $authorizationValue = base64_encode(\n $this->_options[ConnectionOptions::OPTION_AUTH_USER] . ':' .\n $this->_options[ConnectionOptions::OPTION_AUTH_PASSWD]\n );\n }\n\n // add authorization header\n $this->_httpHeader .= sprintf(\n 'Authorization: %s %s%s',\n $this->_options[ConnectionOptions::OPTION_AUTH_TYPE],\n $authorizationValue,\n HttpHelper::EOL\n );\n }\n\n if (isset($this->_options[ConnectionOptions::OPTION_CONNECTION])) {\n // add connection header\n $this->_httpHeader .= sprintf('Connection: %s%s', $this->_options[ConnectionOptions::OPTION_CONNECTION], HttpHelper::EOL);\n }\n\n if ($this->_database === '') {\n $this->_baseUrl = '/_db/_system';\n } else {\n $this->_baseUrl = '/_db/' . urlencode($this->_database);\n }\n }",
"private function buildAuthorizationHeader(array $oauth)\n {\n $return = 'Authorization: OAuth ';\n $values = array();\n\n foreach($oauth as $key => $value)\n {\n if (in_array($key, array('oauth_consumer_key', 'oauth_nonce', 'oauth_signature',\n 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', 'oauth_version'))) {\n $values[] = \"$key=\\\"\" . rawurlencode($value) . \"\\\"\";\n }\n }\n\n $return .= implode(', ', $values);\n return $return;\n }",
"private function set_oauth_hash()\r\n {\r\n $time = time();\r\n $oauth_hash = array\r\n (\r\n 'oauth_consumer_key' => $this->consumer_key,\r\n 'oauth_nonce' => $time,\r\n 'oauth_signature_method' => self::TWITTER_OAUTH_SIGNATURE_METHOD,\r\n 'oauth_timestamp' => $time,\r\n 'oauth_token' => $this->access_token,\r\n 'oauth_version' => self::TWITTER_OAUTH_VERSION\r\n );\r\n return http_build_query($oauth_hash);\r\n }",
"public function getBaseAuthorizationUrl()\n {\n $twitter = $this->_initConnection();\n $uri = $twitter->url('oauth/authenticate', array());\n return $uri;\n }",
"private function buildAuthorizationHeader($token)\n {\n return (string) $token;\n }"
] | [
"0.63338447",
"0.62758344",
"0.6245617",
"0.61636543",
"0.6101603",
"0.6088257",
"0.60498697",
"0.6038856",
"0.5974121",
"0.59714216",
"0.5945287",
"0.5945287",
"0.5945287",
"0.5876803",
"0.5852223",
"0.5781126",
"0.5762427",
"0.5754177",
"0.5736142",
"0.5710731",
"0.5677614",
"0.56702894",
"0.5638253",
"0.5577386",
"0.5543968",
"0.5501813",
"0.5469887",
"0.5464317",
"0.5413565",
"0.541253"
] | 0.755599 | 0 |
Get fail validation attributes as array if exist | public function getBadAttributes(): ?array
{
return $this->_badAttr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validationData()\n {\n foreach ($this->shouldCheck as $attribute) {\n if (! $this->has($attribute)) {\n $this->merge([$attribute => null]);\n }\n }\n\n return $this->all();\n }",
"public function validationData(): array\n {\n return $this->only(['name']);\n }",
"public function getValidationErrors(): array;",
"public function getValidationErrors()\n {\n $errors = [];\n foreach ($this->elements as $name => $element) {\n if ($element['validation-pass'] === false) {\n $errors[$name] = [\n 'id' => $element->GetElementId(),\n 'label' => $element['label'],\n 'message' => implode(' ', $element['validation-messages'])\n ];\n }\n }\n return $errors;\n }",
"public function getErrorValidations()\n {\n $vlds = array();\n foreach ($this->validations as $k => $vld) {\n if (!$vld->valid) {\n $vlds[$k] = $vld;\n }\n }\n\n return $vlds;\n }",
"public function validationData(): array\n\t{\n\t\treturn $this->all();\n\t}",
"public static function validationArray():array {\n $validation = array (\n \"displayName\" => 'required|string|max:255',\n \"fieldName\" => 'required|string|max:255',\n \"uri\" => 'required|string|max:255',\n \"mediaType\" => 'required|integer|max:255',\n );\n\n return $validation;\n }",
"public static function validationArray():array {\n $validation = array (\n \"type\" => 'required',\n );\n\n return $validation;\n }",
"public function getValidationErrors();",
"public function getValidationErrors();",
"public function getErrors()\n {\n $errors = [];\n\n foreach ($this->errors as $attribute => $rules) {\n foreach ($rules as $rule => $parameters) {\n $attribute_re = (isset(static::$renamed[$attribute])) ? static::$renamed[$attribute] : $attribute;\n\n $errors[$attribute][$rule] = vsprintf($this->rename($attribute_re, $rule, $parameters), $parameters);\n }\n }\n\n return $errors;\n }",
"public function getFailedValidationData()\n {\n $this->_objData = FormUtil::getFailedValidationObjects($this->_objPath);\n return $this->_objData;\n }",
"public static function validationArray():array {\n $validation = array (\n 'id' => 'required|numeric',\n );\n\n return $validation;\n }",
"public function getValidNillableAttributes(): array\n {\n return [\n 'true (string)' => [\n 'element_nillable_0001.xsd', \n TRUE, \n ], \n 'true (numeric)' => [\n 'element_nillable_0002.xsd', \n TRUE, \n ], \n 'true (string) surrounded by white spaces' => [\n 'element_nillable_0003.xsd', \n TRUE, \n ], \n 'true (numeric) surrounded by white spaces' => [\n 'element_nillable_0004.xsd', \n TRUE, \n ], \n 'false (string)' => [\n 'element_nillable_0005.xsd', \n FALSE, \n ], \n 'false (numeric)' => [\n 'element_nillable_0006.xsd', \n FALSE, \n ], \n 'false (string) surrounded by white spaces' => [\n 'element_nillable_0007.xsd', \n FALSE, \n ], \n 'false (numeric) surrounded by white spaces' => [\n 'element_nillable_0008.xsd', \n FALSE, \n ], \n ];\n }",
"public function listInvalidProperties()\n {\n $invalid_properties = [];\n if (!empty($this->validateBarcode())) {\n $invalid_properties[] = $this->validateBarcode();\n }\n if (!empty($this->validateUrl())) {\n $invalid_properties[] = $this->validateUrl();\n }\n return $invalid_properties;\n }",
"public function toArray(): array {\n return $this->errors;\n }",
"public function attributes()\n {\n\n // Get all attributes, that were registered with the ValidationManager service.\n $attributes = app()[ValidationManager::class]->getAttributes(null, true);\n\n // Parse the registered rules for array-field-names (e.g. \"domainList.*.domainName\" or \"domainName.*\")\n // and try adding correct attribute translations (e.g. \"domainName\" in these examples) to $attributes.\n $this->processArrayAttributes($attributes);\n\n return $attributes;\n\n }",
"public function getValidationErrors(): array\n {\n return $this->errors;\n }",
"public function listInvalidProperties()\n {\n $invalid_properties = [];\n if (!empty($this->validateIssuerId())) {\n $invalid_properties[] = $this->validateIssuerId();\n }\n if (!empty($this->validateTenantId())) {\n $invalid_properties[] = $this->validateTenantId();\n }\n if (!empty($this->validateRoleId())) {\n $invalid_properties[] = $this->validateRoleId();\n }\n if (!empty($this->validateResource())) {\n $invalid_properties[] = $this->validateResource();\n }\n return $invalid_properties;\n }",
"public function getValidationFailed();",
"public function dataValidation(): array\n {\n return [\n ['ip', null, 'This field cannot be left empty'],\n ['ip', 'invalid ip', 'invalid IP address'],\n ['ip', '192.168.1.1', true],\n ['ip', '256.1.1.1', 'invalid IP address'],\n ['action', null, 'This field cannot be left empty'],\n ['action', 'index', true],\n ['expires', null, 'This field cannot be left empty'],\n ['expires', '2017-12-31 00:00:00', true],\n ['created_at', null, 'This field cannot be left empty'],\n ['created_at', '2017-01-01 00:00:00', true],\n ];\n }",
"public function isValid() {\n $errors = array();\n foreach($this->object->getAttributes() as $item) {\n $error = $this->isValidField($item);\n if (count($error)>0) {\n $errors = array_merge($error, $errors);\n }\n }\n return $errors;\n }",
"public function getFailedFieldsRules(): array\n {\n return $this->exception->validator->failed();\n }",
"public function getValidationData();",
"public function getErrors($attribute = null)\n\t{\n\t\tif ($attribute) {\n\t\t\t$this->checkAttrName($attribute);\n\n\t\t\treturn isset($this->errors[$attribute]) ? $this->errors[$attribute] : [];\n\t\t} else {\n\t\t\treturn $this->errors;\n\t\t}\n\t}",
"public function listInvalidProperties()\n {\n $invalid_properties = [];\n if (!empty($this->validateRecipients())) {\n $invalid_properties[] = $this->validateRecipients();\n }\n if (!empty($this->validateResultAction())) {\n $invalid_properties[] = $this->validateResultAction();\n }\n if (!empty($this->validateParameters())) {\n $invalid_properties[] = $this->validateParameters();\n }\n if (!empty($this->validateSchedule())) {\n $invalid_properties[] = $this->validateSchedule();\n }\n if (!empty($this->validateGenerationDate())) {\n $invalid_properties[] = $this->validateGenerationDate();\n }\n return $invalid_properties;\n }",
"public function getEncodedFailureAttributes()\n {\n return $this->encoded_failure_attributes;\n }",
"public function validationErrorList() {\n\t\t$errors = array();\n\t\tforeach ((array)$this->validationErrors as $field => $err) {\n\t\t\tif (array_key_exists($field, $this->validate)) {\n\t\t\t\t$errors[$field] = array_shift($err);\n\t\t\t}\n\t\t}\n\t\treturn $errors;\n\t}",
"public function provideValidationData() {\n return [\n [TRUE],\n [FALSE]\n ];\n }",
"public function validationData()\n {\n return $this->all();\n }"
] | [
"0.70256096",
"0.6973708",
"0.696967",
"0.68726635",
"0.68339646",
"0.67500657",
"0.67132676",
"0.6701789",
"0.66938126",
"0.66938126",
"0.66568696",
"0.66270614",
"0.6617718",
"0.6572267",
"0.6546793",
"0.65287423",
"0.6528056",
"0.65242285",
"0.6520081",
"0.6512887",
"0.65110016",
"0.6486604",
"0.6484171",
"0.64796424",
"0.64701664",
"0.64612556",
"0.6451699",
"0.6446794",
"0.64063156",
"0.63793635"
] | 0.73435116 | 0 |
Test the highlight_code_block function | function test_highlighter() {
// with some pre-written inputs
include('inputs-text-syntax-highlighter.php');
$highlighted_text = SyntaxHighlighter::highlight_code_block($test1[0]);
$this->assertEquals($test1[1], $highlighted_text);
$highlighted_text = SyntaxHighlighter::highlight_code_block($test2[0]);
$this->assertEquals($test2[1], $highlighted_text);
$highlighted_text = SyntaxHighlighter::highlight_code_block($test3[0]);
$this->assertEquals($test3[1], $highlighted_text);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDefaultRendering()\n {\n $code = new CodeMarkup();\n\n $token = new Token('codestart', Token::TYPE_MARKUP, 'code', array());\n\n $token->setStopper('codeend');\n\n $this->assertEquals(highlight_string('foo', true), $code($token, 'foo'));\n $this->assertEquals(highlight_string('<?= \"bar\" ?>', true), $code($token, '<?= \"bar\" ?>'));\n $this->assertEquals(highlight_string('<?php foobar(); ?>', true), $code($token, '<?php foobar(); ?>'));\n }",
"function acfe_highlight(){\n \n ini_set(\"highlight.comment\", \"#555\");\n \n static $on = false;\n \n if(!$on){\n \n ob_start();\n \n }else{\n \n $buffer = \"<?php\\n\" . ob_get_contents();\n ob_end_clean();\n $code = highlight_string($buffer, true);\n \n $code = str_replace(\"<?php<br />\", '', $code);\n $code = str_replace(\"<code>\", '', $code);\n $code = str_replace(\"</code>\", '', $code);\n \n echo '<div class=\"acfe-pre-highlight\">' . $code . '</div>';\n \n }\n \n $on = !$on;\n \n}",
"function testPlainTextButton() {\n\t\t//simple one code block\n\t\t$text = '<p>This is some text</p><pre lang=\"php\"><?php echo $foo = \"foo\"; ?></pre><p>More text</p>';\n\t\t$result = $this->geshi->highlight($text);\n\t\t$expected = array(\n\t\t\t'<p', 'This is some text', '/p',\n\t\t\t'a' => array('href' => '#null', 'class' => 'geshi-plain-text'), 'Show Plain Text', '/a',\n\t\t\tarray('div' => array('class' => 'code', 'lang' => 'php')),\n\t\t\t\tarray('ol' => array(\"class\" => \"php\")), \n\t\t\t\t\tarray('li' => array('class' => \"li1\")),\n\t\t\t\t\tarray(\"div\" => array('class' => \"de1\")),\n\t\t\t\t\t\tarray(\"span\" => array(\"class\" => \"kw2\")), '<?php', '/span',\n\t\t\t\t\t\tarray('span' => array('class' => \"kw1\")), 'echo', '/span',\n\t\t\t\t\t\tarray('span' => array('class' => \"re0\")), '$foo', '/span',\n\t\t\t\t\t\tarray('span' => array('class' => \"sy0\")), '=', '/span',\n\t\t\t\t\t\tarray('span' => array('class' => \"st0\")), '"foo"', '/span',\n\t\t\t\t\t\tarray('span' => array('class' => \"sy0\")), ';', '/span',\n\t\t\t\t\t\tarray('span' => array('class' => \"sy1\")), '?>', '/span',\n\t\t\t\t\t'/div',\n\t\t\t\t'/li',\n\t\t\t'/ol',\n\t\t\t'/div',\n\t\t\t'<p', 'More text', '/p'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}",
"function doCodeBlocks( $text ) {\n $text = preg_replace_callback('{\n (?:\\n|\\A)\n # 1: Opening marker\n (\n `{3,} # Marker: three tilde or more.\n )\n [ ]* # Optional whitspace following marker.\n # 2: Optional language\n (\n [a-zA-Z0-9_-]+ # Alphanumeric with hyphen and underscore allowed\n )?\n [ ]* \\n # Optional whitespace and mandatory newline following marker and optional language.\n\n # 2: Content\n (\n (?>\n (?!\\1 [ ]* \\n) # Not a closing marker.\n .*\\n+\n )+\n )\n\n # Closing marker.\n \\1 [ ]* \\n\n }xm',\n array( $this, '_doCodeBlocks_callback' ), $text);\n\n return parent::doCodeBlocks( $text );\n }",
"public function highlight(&$block, &$markup)\n\t{\n\t\tif (strncmp($block['text'], '<?php', 5) === 0) {\n\t\t\t$text = highlight_string(trim($block['text']), true);\n\t\t} else {\n\t\t\t$text = highlight_string(\"<?php \".trim($block['text']), true);\n\t\t\t$text = str_replace('<?php', '', $text);\n\t\t\tif (($pos = strpos($text, ' ')) !== false) {\n\t\t\t\t$text = substr($text, 0, $pos) . substr($text, $pos + 6);\n\t\t\t}\n\t\t}\n\t\t// remove <code><span style=\"color: #000000\">\\n and </span>tags added by php\n\t\t$text = substr(trim($text), 36, -16);\n\n\t\t$code = '<pre><code';\n\t\tif (isset($block['language']))\n\t\t{\n\t\t\tif ($block['language'] !== 'php') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$code .= ' class=\"language-'.$block['language'].'\"';\n\t\t}\n\t\t$code .= '>'.$text.'</code></pre>'.\"\\n\";\n\n\t\t$markup .= $code;\n\t\treturn true;\n\t}",
"public function highlightCode($content)\n {\n if (!strstr($content, '{code') && !strstr($content, '[code')) {\n return $content;\n }\n\n $patterns = array(\n '/\\{code(?<arguments>.*?)\\}(?<code>.*?)\\{\\/code\\}/msi',\n '/\\[code(?<arguments>.*?)\\](?<code>.*?)\\[\\/code\\]/msi'\n );\n $defaultSettings = array(\n 'type'\t=> ''\n );\n\n foreach ($patterns as $pattern) {\n preg_match_all($pattern, $content, $codes);\n $num = count($codes[0]);\n\n for ($i=0; $i<$num; $i++) {\n $settings = wp_parse_args($codes['arguments'][ $i ], $defaultSettings);\n $class = 'FvCodeHighlighter_Highlighter_' . ucfirst( strtolower($settings['type']) );\n $filter = new FvCodeHighlighter_Filter_HtmlSpecialCharsDecode();\n $code = $filter->filter( trim($codes['code'][ $i ]));\n\n $cacheFile = sha1($code);\n $cache = FvCodeHighlighter_Container::getInstance()->getCache();\n\n if ($cache->cacheFileExists($cacheFile)) {\n $code = $cache->getCacheFile($cacheFile);\n } else {\n if (class_exists($class)) {\n $highlighter = new $class( $code );\n\n $code = $highlighter->highlight()\n ->getCode();\n\n unset($highlighter);\n $cache->createCacheFile($cacheFile, $code);\n } else {\n $code = esc_html( $code );\n }\n }\n\n $output = '<div id=\"fvch-codeblock-' . $i . '\" class=\"fvch-codeblock\">';\n\n if ($this->_options->getOption('fvch-toolbox')) {\n $output .= '<div class=\"fvch-hide-if-no-js fvch-toolbox\">';\n\n $output .= '<img src=\"' . plugins_url('public/images/select-icon.png', dirname(__FILE__))\n . '\" alt=\"' . __('Select Code', 'fvch') . '\" title=\"' . __('Select Code', 'fvch')\n . '\" class=\"fvch-toolbox-icon fvch-toolbox-icon-select\" />';\n\n $output .= '</div>';\n }\n\n $output .= '<table><tr>';\n\n if ($this->_options->getOption('fvch-line-numbers')) {\n $count = count( explode(\"\\n\", $code) );\n\n $numbers = '';\n for ($n=1; $n<=$count; $n++) {\n $numbers .= $n . \"\\n\";\n }\n\n $output .= '<td class=\"fvch-line-numbers\"><pre>' . $numbers . '</pre></td>';\n }\n\n $output .= '<td class=\"fvch-code\"><pre id=\"fvch-code-' . $i . '\">' . $code . '</pre></td>';\n $output .= '</tr></table></div>';\n\n $content = str_replace($codes[0][$i], $output, $content);\n }\n }\n\n return $content;\n }",
"public function silo_highlights()\n\t{\n\t}",
"protected function doCodeBlocks($text) {\n\t\t$text = parent::doCodeBlocks($text);\n\t\treturn $this->doFencedCodeBlocks($text);\n\t}",
"public function _doCodeBlocks_callback($matches)\n {\n\t\t$codeblock = rtrim($this->outdent($matches[1]));\n\t\tif(($codeblock = $this->highlightCodeBlock($codeblock)) !== null)\n\t\t\treturn \"\\n\\n\".$this->hashBlock($codeblock).\"\\n\\n\";\n\t\telse\n\t\t\treturn \\MarkdownExtra_Parser::_doCodeBlocks_callback($matches);\n\t}",
"function printCodeblock($number='',$titlelink='') {\n\t$codeblock = getCodeblock($number,$titlelink);\n\t$context = get_context();\n\ttry {\n\t\t@eval(\"?>\".$codeblock);\n\t} catch (Exception $e) {\n\t\tdebugLog('printCodeblock('.$number.','.$titlelink.') exception: '.$e->getMessage());\n\t}\n\tset_context($context);\n}",
"function kiz_php_code2thml($code) {\n if(function_exists('highlight_string')){\n\n preg_match_all('#(*UTF8)(\\/\\/.*?)(?=[\\n\\r])#',$code,$asin);\n preg_match_all('#(*UTF8)(\\/\\*.*?\\*\\/)#s',$code,$amul);\n\n $slc = '//_SLC_G2454kII905dhTsE_';\n $mlc = '/*_MLC_255RrT79712w0R_*/';\n $code = preg_replace('#(*UTF8)(\\/\\/.*?)(?=[\\n\\r])#',$slc,$code);\n $code = preg_replace('#(*UTF8)(\\/\\*.*?\\*\\/)#s',$mlc,$code);\n\n ini_set('highlight.string','#028102');\n ini_set('highlight.comment','#818181');\n ini_set('highlight.keyword','#0265D7');\n ini_set('highlight.bg','#B1B1B1');\n ini_set('highlight.default','#000000');\n ini_set('highlight.html','#670202');\n\n $code = highlight_string('<?php '.$code.' ?>' ,true);\n\n ini_restore('highlight.string');\n ini_restore('highlight.comment');\n ini_restore('highlight.keyword');\n ini_restore('highlight.bg');\n ini_restore('highlight.default');\n ini_restore('highlight.html');\n\n $newcodestyle = '<code style=\"display: block; padding: 9px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857143; color: #333; word-break: break-all; word-wrap: break-word; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 4px;\">';\n\n mb_regex_encoding('UTF-8');\n $code = mb_eregi_replace('\\<\\;\\?php\\ \\;', '', $code);\n $code = mb_eregi_replace('<code>', $newcodestyle, $code);\n $code = mb_substr($code,0,mb_strrpos($code,'<span')) . '</span></code>';\n\n // additionally color variables\n $code = mb_ereg_replace('(\\$+\\w+)','<span style=\"color: #670202;\">\\1</span>',$code);\n\n // restore comments\n foreach ($asin[0] as $sl) {\n $sl = preg_replace('# #',' ',$sl);\n $code = preg_replace(\"#$slc#\", $sl, $code, 1);\n }\n $mlc2=preg_replace('#\\*#','\\*',$mlc);\n foreach ($amul[0] as $ml) {\n $ml = preg_replace('# #',' ',$ml);\n $code = preg_replace(\"#$mlc2#\", nl2br($ml), $code, 1);\n }\n return $code;\n }\n else\n return '<pre><code>'.htmlspecialchars($code).'</code></pre>';\n }",
"function highlightCode($str)\n {\n // The highlight string function encodes and highlights\n // brackets so we need them to start raw\n $str = str_replace(array('<', '>'), array('<', '>'), $str);\n\n // Replace any existing PHP tags to temporary markers so they don't accidentally\n // break the string out of PHP, and thus, thwart the highlighting.\n\n $str = str_replace(array('<?', '?>', '<%', '%>', '\\\\', '</script>'), \n array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'), $str);\n\n // The highlight_string function requires that the text be surrounded\n // by PHP tags, which we will remove later\n $str = '<?php '.$str.' ?>'; // <?\n\n // All the magic happens here, baby!\t\n $str = highlight_string($str, true);\n\n // Prior to PHP 5, the highligh function used icky <font> tags\n // so we'll replace them with <span> tags.\n\n // Remove our artificially added PHP, and the syntax highlighting that came with it\n $str = preg_replace('/<span style=\"color: #([A-Z0-9]+)\"><\\?php( | )/i', '<span style=\"color: #$1\">', $str);\n $str = preg_replace('/(<span style=\"color: #[A-Z0-9]+\">.*?)\\?><\\/span>\\n<\\/span>\\n<\\/code>/is', \"$1</span>\\n</span>\\n</code>\", $str);\n $str = preg_replace('/<span style=\"color: #[A-Z0-9]+\"\\><\\/span>/i', '', $str);\n\n // Replace our markers back to PHP tags.\n $str = str_replace(array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),\n array('<?', '?>', '<%', '%>', '\\\\', '</script>'), $str);\n\n return $str;\n }",
"function highlight_source($file) {\n // TODO: highlight sources of different languages (besides PHP)\n\n //Strip code and first span\n $src = _highlight_file2($file, true);\n $code = substr($src[1], 36, -12);\n //Split lines\n $lines = explode('<br />', $code);\n //Count\n $lineCount = count($lines);\n //Calc pad length\n $padLength = strlen($lineCount);\n \n //Loop lines\n $out = '';\n foreach($lines as $i => $line) {\n //Create line number\n $lineNumber = str_pad($i + 1, $padLength, '0', STR_PAD_LEFT);\n //Print line\n $out .= sprintf('<br><span class=\"num\">%s</span><span>%s</span>', $lineNumber, $line);\n }\n\n //Re-Print the code and span again\n echo $src[0] .'<code><span style=\"color:#000\">'. substr($out, 4) .'</span></code>';\n}",
"function d42_highlight($atts, $content = null) {\n $attr = shortcode_atts(array(\n 'block' => 'true',\n ), $atts);\n\n $o = '<mark class=\"highlite';\n if ($attr['block'] <> 'true') {\n $o .= ' inline';\n }\n $o .= '\">' . do_shortcode($content) . '</mark>';\n return $o;\n}",
"function &phpHighlight( $string )\r\n {\r\n $string = preg_replace ( \"/(<)/\", \"<\", $string );\r\n $string = preg_replace ( \"/(>)/\", \">\", $string );\r\n\r\n // some special characters\r\n $string = preg_replace ( \"/([(){}+-]|=|\\[|\\])/\", \"<font color=\\\"red\\\">\\\\1</font>\", $string );\r\n\r\n // reserved words\r\n// $string = preg_replace ( \"/(foreach|function|for|while|switch|as)/\", \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n // comments\r\n $string = preg_replace ( \"/(\\/\\/[^\\n]+)/\", \"<font color=\\\"orange\\\">\\\\1</font>\", $string );\r\n\r\n $string = preg_replace ( \"#(/\\*.+?\\*/)#ms\", \"<font color=\\\"orange\\\">\\\\1</font>\", $string );\r\n\r\n\r\n\r\n $reservedWords = array( \"/(function)/\",\r\n \"/( as )/\",\r\n \"/(class )/\",\r\n \"/(var )/\",\r\n \"/(^var )/\",\r\n \"/(for )/\"\r\n );\r\n\r\n $string = preg_replace( $reservedWords, \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n $string = preg_replace( \"/( [0-9]+)/\", \"<font color=\\\"green\\\">\\\\1</font>\", $string );\r\n\r\n $string = preg_replace( \"#(\\\\$[a-zA-Z0-9]+)#\", \"<font color=\\\"#00aaaa\\\">\\\\1</font>\", $string );\r\n\r\n// $string = preg_replace ( \"#(\\\\$.+?)[\\s|\\;]#\", \"<font color=\\\"#00aaaa\\\">\\\\1</font>\", $string );\r\n\r\n // indenting\r\n\r\n $string = \"<br clear=\\\"all\\\"><p><table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\" border=\\\"0\\\"><tr><td bgcolor=\\\"#f0f0f0\\\"><pre>\" .\r\n $string . \"</pre></td></tr></table></p>\";\r\n\r\n return $string;\r\n }",
"protected function renderCode($block)\n {\n $class = isset($block['language']) ? ' class=\"' . $block['language'] . '\"' : '';\n return \"<pre><code$class>\" . $block['content'] . \"\\n\" . \"</code></pre>\\n\";\n }",
"public static function highlight_code($str)\n {\n $str = str_replace(\n array('<', '>', '<?', '?>', '<%', '%>', '\\\\', '</script>'),\n array('<', '>', 'phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),\n $str\n );\n\n $str = highlight_string('<?php '.$str.' ?>', TRUE);\n\n $str = preg_replace(\n array(\n '/<span style=\"color: #([A-Z0-9]+)\"><\\?php( | )/i',\n '/(<span style=\"color: #[A-Z0-9]+\">.*?)\\?><\\/span>\\n<\\/span>\\n<\\/code>/is',\n '/<span style=\"color: #[A-Z0-9]+\"\\><\\/span>/i'\n ),\n array(\n '<span style=\"color: #$1\">',\n \"$1</span>\\n</span>\\n</code>\",\n ''\n ),\n $str\n );\n\n return str_replace(\n array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),\n array('<?', '?>', '<%', '%>', '\\\\', '</script>'),\n $str\n );\n }",
"function highlight_string ($str, $return = false) {}",
"function &perlHighlight( $string )\r\n {\r\n $string = preg_replace ( \"/(<)/\", \"<\", $string );\r\n $string = preg_replace ( \"/(>)/\", \">\", $string );\r\n\r\n // some special characters\r\n $string = preg_replace ( \"/([(){}+-]|=|\\[|\\])/\", \"<font color=\\\"red\\\">\\\\1</font>\", $string );\r\n\r\n // reserved words\r\n// $string = preg_replace ( \"/(foreach|function|for|while|switch|as)/\", \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n // comments\r\n $string = preg_replace ( \"/(#[^\\n]+)/\", \"<font color=\\\"orange\\\">\\\\1</font>\", $string );\r\n\r\n $reservedWords = array( \"/(function)/\",\r\n \"/( as )/\",\r\n \"/(class )/\",\r\n \"/(var )/\",\r\n \"/( for)/\"\r\n );\r\n\r\n $string = preg_replace( $reservedWords, \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n\r\n $string = preg_replace( \"/( [0-9]+)/\", \"<font color=\\\"green\\\">\\\\1</font>\", $string );\r\n\r\n $string = preg_replace( \"/(\\$[a-zA-Z0-9]+)/\", \"<font color=\\\"#00ffff\\\">\\\\1</font>\", $string );\r\n\r\n // indenting\r\n $string = preg_replace( \"/^( )+/m\", \" \", $string );\r\n\r\n $string = \"<br clear=\\\"all\\\"><p><table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\" border=\\\"0\\\"><tr><td bgcolor=\\\"#f0f0f0\\\"><pre>\" .\r\n $string . \"</pre></td></tr></table></p>\";\r\n\r\n return $string;\r\n }",
"function highlight ($string, $lang) {\n\t$lines = explode (\"\\n\",$string);\n\t$c=0;\n\t$s=0;\n\t$out=\"\";\n\t$grey = \"#8A8A8A\";\n\t$red = \"#FF0000\";\n\t$keywords = array ();\n\t$keywords['C'] = array (\n\t \"auto\",\"break\", \"case\", \"char\",\"const\",\"continue\",\n\t \"default\",\"do\", \"double\", \"else\", \"enum\",\"extern\",\n\t \"float\",\"for\",\"goto\",\"if\",\"int\",\"long\",\"register\",\n\t \"return\", \"short\", \"signed\", \"sizeof\", \"static\",\n\t \"struct\", \"switch\", \"typedef\", \"union\",\"unsigned\",\n\t \"void\", \"volatile\", \"while\"\n\t );\n\t$keywords['PHP'] = array (\n\t \"__halt_compiler\", \"abstract\", \"and\", \"array\", \"as\", \"break\",\n\t \"callable\", \"case\", \"catch\", \"class\", \"clone\", \"const\",\"continue\",\n\t \"declare\",\"default\", \"die\", \"do\", \"echo\", \"else\",\"elseif\",\"empty\",\n\t \"enddeclare\",\"endfor\",\"endforeach\",\"endif\",\"endswitch\",\"endwhile\",\n\t \"eval\", \"exit\", \"extends\", \"final\", \"for\", \"foreach\", \"function\",\n\t \"global\", \"goto\", \"if\", \"implements\", \"include\", \"include_once\",\n\t \"instanceof\",\"insteadof\", \"interface\", \"isset\",\"list\",\"namespace\",\n\t \"new\", \"or\", \"print\", \"private\", \"protected\", \"public\", \"require\",\n\t \"require_once\",\"return\", \"static\", \"switch\",\"throw\",\"trait\",\"try\",\n\t \"unset\", \"use\", \"var\", \"while\", \"xor\"\n\t );\n\tif (empty ($lang)) {\n\t\treturn $string;\n\t}\n\t\n\tforeach ($lines as $l) {\n\t\t$i=0;\n\t\tif ($c) {\n\t\t\t$out .= gen_span ($grey);\n\t\t\tif (preg_match (\"|^(.*?)\\*/(.*)$|\",$l,$t)) {\n\t\t\t\t$out .= $t[1].\"*/</span>\";\n\t\t\t\t$l=$t[2];\n\t\t\t\t$c=0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$out .= $l.\"</span>\";\n\t\t\t\t$l=\"\";\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (substr(trim($l),0,1)==\"#\") {\n\t\t\t\t$out .= gen_span($grey).$l.\"</span>\";\n\t\t\t\t$i=strlen($l);\n\t\t\t}\n\t\t}\n\t\tif ($s) {\n\t\t\t$out .= gen_span ($red);\n\t\t\tif (preg_match ('|^(.*?)\"(.*?)$|',$l,$t)) {\n\t\t\t\t$out .= $t[1].\"\\\"</span>\";\n\t\t\t\t$l=$t[2];\n\t\t\t\t$s=0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$out .= $l.\"</span>\";\n\t\t\t\t$l=\"\";\n\t\t\t}\n\t\t}\n\t\tfor (;$i<strlen($l);$i++) {\n\t\t\tif ($s || $c) {\n\t\t\t\t$out .= $l[$i];\n\t\t\t}\n\t\t\tif ($l[$i]=='\"' && !$c) {\n\t\t\t\tif (!$s) {\n\t\t\t\t\t$out .= gen_span($red).'\"';\n\t\t\t\t\t$s=1;\n\t\t\t\t}\n\t\t\t\t/* this is actually kinda bugged, since something like \"\\\\\\\"\" won't behave\n\t\t\t\t as expected. But, being this a beta version, this'll do just fine\n\t\t\t\t (note to self: fix this problem checking whether the amount of \\ before\n\t\t\t\t the \" is even or odd\n\t\t\t\t*/\n\t\t\t\telse if ($i && (($l[$i-1]!='\\\\') || $l[$i-1]=='\\\\' && $l[$i-2]=='\\\\')) {\n\t\t\t\t\t$out .= \"</span>\";\n\t\t\t\t\t$s=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!$s) {\n\t\t\t\tif (substr($l,$i,2)==\"/*\") {\n\t\t\t\t\tif (!$c) {\n\t\t\t\t\t\t$out .= gen_span($grey).\"/*\";\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$c=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (substr($l,$i,2)==\"*/\") {\n\t\t\t\t\tif ($c) {\n\t\t\t\t\t\t$out .= \"/</span>\";\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$c=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (substr($l,$i,2)==\"//\") {\n\t\t\t\t\tif (!$c) {\n\t\t\t\t\t\t$out .= gen_span($grey).substr($l,$i).\"</span>\";\n\t\t\t\t\t\t$i=strlen($l);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$x=0;\n\t\t\t\t\tif (!empty ($keywords[$lang])) {\n\t\t\t\t\t\tforeach ($keywords[$lang] as $kw) {\n\t\t\t\t\t\t\tif (substr($l,$i,strlen($kw))==$kw && (!$i || (!is_al_git($l[$i-1]) && !is_al_git($l[$i+strlen($kw)])))) {\n\t\t\t\t\t\t\t\t$out .= \"<b>{$kw}</b>\";\n\t\t\t\t\t\t\t\t$i+=(strlen($kw)-1);\n\t\t\t\t\t\t\t\t$x=1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!$x) {\n\t\t\t\t\t\t$out .= $l[$i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($c || $s) {\n\t\t\t$out .= \"</span>\";\n\t\t}\n\t\t$out .= \"\\n\";\n\t}\n\treturn $out;\n}",
"private static function compileBlock($code)\n {\n $matches = null;\n preg_match_all('/{% ?block ?(.*?) ?%}(.*?){% ?endblock ?%}/is', $code, $matches, PREG_SET_ORDER);\n foreach ($matches as $value) {\n if (!array_key_exists($value[1], self::$blocks)) {\n self::$blocks[$value[1]] = '';\n }\n if (strpos($value[2], '@parent') === false) {\n self::$blocks[$value[1]] = $value[2];\n } else {\n self::$blocks[$value[1]] = str_replace('@parent', self::$blocks[$value[1]], $value[2]);\n }\n $code = str_replace($value[0], '', $code);\n }\n return $code;\n }",
"function &cppHighlight( $string )\r\n {\r\n $string = preg_replace ( \"/(<)/\", \"<\", $string );\r\n $string = preg_replace ( \"/(>)/\", \">\", $string );\r\n\r\n // some special characters\r\n $string = preg_replace ( \"/([(){}+-]|=|\\[|\\])/\", \"<font color=\\\"red\\\">\\\\1</font>\", $string );\r\n\r\n // comments\r\n $string = preg_replace ( \"/(//[^\\n]+)/\", \"<font color=\\\"orange\\\">\\\\1</font>\", $string );\r\n $string = preg_replace ( \"/(/\\*[^\\*]+\\*/)/\", \"<font color=\\\"orange\\\">\\\\1</font>\", $string );\r\n\r\n // reserved words\r\n $reservedWords = array( \"/(function)/\",\r\n \"/( as )/\",\r\n \"/(void )/\",\r\n \"/(class )/\",\r\n \"/(var )/\",\r\n \"/(int )/\",\r\n \"/( for)/\"\r\n );\r\n\r\n $string = preg_replace( $reservedWords, \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n\r\n $string = preg_replace( \"/( [0-9]+)/\", \"<font color=\\\"green\\\">\\\\1</font>\", $string );\r\n\r\n\r\n $string = preg_replace( \"/(\\$[a-zA-Z0-9]+)/\", \"<font color=\\\"#00ffff\\\">\\\\1</font>\", $string );\r\n\r\n // newlines\r\n// $string = preg_replace ( \"/\\n/\", \"<br />\\n newline\", $string );\r\n\r\n $string = \"<br clear=\\\"all\\\"><p><table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\" border=\\\"0\\\"><tr><td bgcolor=\\\"#f0f0f0\\\"><pre>\" .\r\n $string . \"</pre></td></tr></table></p>\";\r\n\r\n return $string;\r\n }",
"protected function _doFencedCodeBlocks_callback($matches)\n\t{\n\t\t$classname =& $matches[2];\n\t\t$attrs =& $matches[3];\n\t\t$codeblock = $matches[4];\n\n\t\tif ($this->code_block_content_func) {\n\t\t\t$codeblock = call_user_func($this->code_block_content_func, $codeblock, $classname);\n\t\t} else {\n\t\t\t$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);\n\t\t}\n\n\t\t$codeblock = preg_replace_callback('/^\\n+/',\n\t\t\tarray($this, '_doFencedCodeBlocks_newlines'), $codeblock);\n\n\t\t$classes = array('bbc_code');\n\n\t\tif ($classname !== \"\") {\n\t\t\tif ($classname[0] === '.') {\n\t\t\t\t$classname = substr($classname, 1);\n\t\t\t}\n\t\t\t$classes[] = $this->code_class_prefix . $classname;\n\t\t}\n\n\t\t$attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? \"pre\" : \"code\", $attrs, null, $classes);\n\t\t$pre_attr_str = $this->code_attr_on_pre ? $attr_str : '';\n\t\t$code_attr_str = $this->code_attr_on_pre ? '' : $attr_str;\n\t\t$codeblock = \"<code$code_attr_str>$codeblock</code>\";\n\n\t\treturn \"\\n\\n\" . $this->hashBlock($codeblock) . \"\\n\\n\";\n\t}",
"public function testHeredoc()\n {\n $token = $this->getTargetToken('/* testHeredoc */', T_FN);\n $this->backfillHelper($token);\n $this->scopePositionTestHelper($token, 4, 9);\n\n }",
"public static function geshiHighlight($content)\n {\n $line = null;\n $lang = null;\n \n $code = $content[2];\n\n preg_match_all(\"#\\s*(.*?)=\\\"(.*?)\\\"#\", $content[1], $matches);\n\n foreach ($matches[1] as $k=>$v) {\n switch ($v)\n {\n case 'lang':\n $lang = $matches[2][$k];\n break;\n case 'lineno':\n $line = $matches[2][$k];\n break;\n default: \n break;\n }\n }\n \n if ($lang !== null) {\n\n include_once \"/usr/share/php-geshi/geshi.php\";\n \n $geshi = new GeSHi($code, $lang);\n \n $geshi->set_tab_width(2);\n $geshi->set_overall_class(\"vibrant {$lang} codecolorer\");\n $geshi->set_header_type(GESHI_HEADER_DIV);\n $geshi->enable_classes();\n $geshi->enable_keyword_links(false);\n $geshi->set_overall_style('white-space:nowrap');\n\n if ($line !== null) {\n $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);\n $geshi->start_line_numbers_at($line); \n }\n\n return $geshi->parse_code();\n }\n \n return $code;\n }",
"public function render_block($attributes, $content) {\n\t\t$remaps = array(\n\t\t\t'className' => 'classname',\n\t\t\t'firstLineNumber' => 'firstline',\n\t\t\t'highlightLines' => 'highlight',\n\t\t);\n\n\t\tforeach ($remaps as $from => $to) {\n\t\t\tif (isset($attributes[$from])) {\n\t\t\t\tif (is_bool($attributes[$from])) {\n\t\t\t\t\t$attributes[$to] = ($attributes[$from]) ? '1' : '0';\n\t\t\t\t} else {\n\t\t\t\t\t$attributes[$to] = $attributes[$from];\n\t\t\t\t}\n\n\t\t\t\tunset($attributes[$from]);\n\t\t\t}\n\t\t}\n\n\t\t$code = preg_replace('#<pre [^>]+>([^<]+)?</pre>#', '$1', trim($content));\n\n\t\t$lang = $attributes['language'] ?: $attributes['lang'] ?: 'text';\n\t\t$firstLine = $attributes['firstline'] ?: 1;\n\t\t$highlight = $attributes['highlight'] ? ' data-highlight=\"' . $attributes['highlight'] . '\"' : '';\n\t\treturn <<<EOF\n<pre><code class=\"language-$lang\" data-firstline=\"$firstLine\"$highlight>$code</code></pre>\nEOF;\n\t}",
"public function testHighlighting() {\n\t\t// Enable the \"highlighting\" feature.\n\t\t$pluginSettingsDao =& DAORegistry::getDAO('PluginSettingsDAO'); /* @var $pluginSettingsDao PluginSettingsDAO */\n\t\t$pluginSettingsDao->updateSetting(0, 'luceneplugin', 'highligthing', true);\n\n\t\t// Execute a simple search that returns at least one result.\n\t\t$this->simpleSearch('abstract');\n\n\t\t// Check whether we get highlighting from the abstract.\n\t\t$this->assertText('css=.plugins_generic_lucene_highlighting', '*abstract*');\n\n\t\t// Check whether we get highlighting from the full text, too.\n\t\t$this->simpleSearch('nutella');\n\t\t$this->assertText(\n\t\t\t'css=.plugins_generic_lucene_highlighting',\n\t\t\t'\"... This is a galley used for solr indexing tests. Keywords in this galley are: nutella. ...\"'\n\t\t);\n\n\t\t// Check that the keyword is visually emphasized.\n\t\t$this->assertText(\n\t\t\t'css=.plugins_generic_lucene_highlighting em',\n\t\t\t'exact:nutella'\n\t\t);\n\t}",
"function &lispHighlight( $string )\r\n {\r\n $len = strlen( $string );\r\n $index = 0;\r\n $tmpstring = \"\";\r\n\r\n while ( $index < $len )\r\n {\r\n $char = $string[$index];\r\n if ( $char == ';' )\r\n {\r\n $end = strpos( $string, \"\\n\", $index );\r\n if ( $end === false )\r\n {\r\n $tmpstring .= \"<font color=\\\"orange\\\">\" . $this->sptobsp( substr( $string, $index ) ) . \"</font>\\n\";\r\n $index = $len;\r\n }\r\n else\r\n {\r\n $tmpstring .= \"<font color=\\\"orange\\\">\" . $this->sptobsp( substr( $string, $index, $end - $index ) ) . \"</font>\\n\";\r\n $index = $end + 1;\r\n }\r\n }\r\n else if ( $char == ' ' )\r\n {\r\n $tmpstring .= \" \";\r\n ++$index;\r\n }\r\n else if ( $char == '(' )\r\n {\r\n $end = strpos( $string, \" \", $index + 1 );\r\n $end_paren = strpos( $string, \")\", $index + 1 );\r\n if ( $end_paren < $end )\r\n $end = $end_paren;\r\n if ( $end === false )\r\n {\r\n $tmpstring .= \"(\";\r\n ++$index;\r\n }\r\n else\r\n {\r\n $tmpstring .= \"<font color=\\\"red\\\">(</font>\";\r\n $command = substr( $string, $index + 1, $end - $index - 1 );\r\n if ( preg_match( \"/(let|if|while)/i\", $command ) )\r\n {\r\n $tmpstring .= \"<font color=\\\"blue\\\">\" . $command . \"</font>\";\r\n }\r\n else if ( preg_match( \"/(defun|defvar)/i\", $command ) )\r\n {\r\n $name_end = strpos( $string, \" \", $end + 1 );\r\n if ( $name_end === false )\r\n {\r\n $tmpstring .= \"<font color=\\\"blue\\\">\" . $command . \"</font>\";\r\n $end = $len;\r\n }\r\n else\r\n {\r\n $name = substr( $string, $end + 1, $name_end - $end - 1 );\r\n $tmpstring .= \"<font color=\\\"blue\\\">\" . $command . \"</font> \";\r\n $tmpstring .= \"<font color=\\\"magenta\\\">\" . $name . \"</font>\";\r\n $end = $name_end;\r\n }\r\n }\r\n else\r\n {\r\n $tmpstring .= $command;\r\n }\r\n $index = $end;\r\n }\r\n }\r\n else if ( $char == ')' )\r\n {\r\n $tmpstring .= \"<font color=\\\"red\\\">)</font>\";\r\n ++$index;\r\n }\r\n else if ( $char == '\"' )\r\n {\r\n $end = strpos( $string, \"\\\"\", $index + 1 );\r\n if ( $end === false )\r\n {\r\n $tmpstring .= \"<font color=\\\"green\\\">\\\"\" . $this->sptobsp( substr( $string, $index + 1 ) ) . \"</font>\";\r\n $index = $len;\r\n }\r\n else\r\n {\r\n $tmpstring .= \"<font color=\\\"green\\\">\\\"\" . $this->sptobsp( substr( $string, $index + 1, $end - $index - 1 ) ) . \"\\\"</font>\";\r\n $index = $end + 1;\r\n }\r\n }\r\n else\r\n {\r\n $tmpstring .= $char;\r\n ++$index;\r\n }\r\n }\r\n $string = \"<br clear=\\\"all\\\"><p><table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\" border=\\\"0\\\"><tr><td bgcolor=\\\"#f0f0f0\\\"><pre>\" .\r\n $tmpstring . \"</pre></td></tr></table></p>\";\r\n\r\n return $string;\r\n\r\n// $string = preg_replace ( \"/(<)/\", \"<\", $string );\r\n// $string = preg_replace ( \"/(>)/\", \">\", $string );\r\n\r\n// // comments\r\n// $string = preg_replace ( \"#(;.*$)#m\", \"<font color=\\\"orange\\\">\\\\1</font>\", $string );\r\n\r\n// // indenting\r\n// $string = preg_replace( \"/( )/m\", \" \", $string );\r\n\r\n// $string = preg_replace( \"/(\\\"[^\\\"]*\\\")/\", \"<font color=\\\"green\\\">\\\\1</font>\", $string );\r\n\r\n// // some special characters\r\n// $string = preg_replace ( \"/([(){}+-]|\\[|\\])/\", \"<font color=\\\"red\\\">\\\\1</font>\", $string );\r\n\r\n// $string = preg_replace( \"/(defun|let|if|while)/\", \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n// // reserved words\r\n// // $string = preg_replace ( \"/(foreach|function|for|while|switch|as)/\", \"<font color=\\\"blue\\\">\\\\1</font>\", $string );\r\n\r\n\r\n// $string = preg_replace( \"/( [0-9]+)/\", \"<font color=\\\"green\\\">\\\\1</font>\", $string );\r\n\r\n// $string = preg_replace( \"/(\\$[a-zA-Z0-9]+)/\", \"<font color=\\\"#00ffff\\\">\\\\1</font>\", $string );\r\n\r\n// $string = \"<p><table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\" border=\\\"0\\\"><tr><td bgcolor=\\\"#f0f0f0\\\"><pre>\" .\r\n// $string . \"</pre></td></tr></table></p>\";\r\n\r\n// return $string;\r\n }",
"public function testExample() {\n $text = 'The default codes include: [b]bold[/b], [i]italics[/i], [u]underlining[/u], '\n . '[url=http://jbbcode.com]links[/url], [color=#ddd]color![/color] and more.';\n $html = 'The default codes include: <span class=\"bold\">bold</span>, <span class=\"italic\">'\n . 'italics</span>, <span class=\"underline\">underlining</span>, <a href=\"http://jbbcode.com\"'\n . ' rel=\"nofollow\">links</a>, <span style=\"color:#ddd\">color!</span> and more.';\n $this->produces($text, $html);\n }",
"function highlight_file ($filename, $return = false) {}"
] | [
"0.6963067",
"0.6911131",
"0.6834727",
"0.66752017",
"0.66386557",
"0.65132815",
"0.62808776",
"0.61917824",
"0.60538274",
"0.6013421",
"0.5911542",
"0.584976",
"0.5799173",
"0.57889265",
"0.574962",
"0.57445854",
"0.57394373",
"0.573812",
"0.567267",
"0.56717527",
"0.565109",
"0.5650114",
"0.56462663",
"0.56320447",
"0.5624696",
"0.5578757",
"0.557708",
"0.5534626",
"0.5523747",
"0.5495034"
] | 0.7157035 | 0 |
Normalize $definition (query / in). | protected function _normalize($definition) {
if (is_string($definition)) {
$definition = array('value' => $definition) ;
} elseif (is_array($definition)) {
$this->_in($definition) ;
$this->_value($definition) ;
} else {
$definition = array() ;
}
return $definition + array('value' => null, 'in' => null) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _in(&$definition) {\n\t\t$aliases = array('field','fields') ;\n\t\tforeach($aliases as $alias) {\n\t\t\tif (isset($definition[$alias])) {\n\t\t\t\t$definition['in'] = $definition[$alias] ;\n\t\t\t\tunset($definition[$alias]) ;\n\t\t\t}\n\t\t}\n\n\t\t// Final wash\n\t\tif (isset($definition['in'])) {\n\t\t\tif (is_array($definition['in'])) {\n\t\t\t\tif (count($definition['in']) === 1) {\n\t\t\t\t\t$definition['in'] = $definition['in'][0] ;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function sanitize_definition( $definition ) {\n\n\t\t$definition = wp_parse_args( $definition, $this->get_default_definition() );\n\n\t\t$slug = sanitize_title( toolset_getarr( $definition, self::DEF_SLUG ), $this->slug );\n\n\t\t$definition[ self::DEF_SLUG ] = $slug;\n\n\t\t$definition[ self::DEF_LABELS ] = toolset_ensarr( toolset_getarr( $definition, self::DEF_LABELS ) );\n\n\t\t$labels = Toolset_Post_Type_Labels::all();\n\t\tforeach ( $labels as $label ) {\n\t\t\t$this->sanitize_label( $definition, $label );\n\t\t}\n\n\t\tif( empty( $definition[ self::DEF_LABELS ][ Toolset_Post_Type_Labels::NAME ] ) ) {\n\t\t\t$this->set_label( Toolset_Post_Type_Labels::NAME, $slug );\n\t\t}\n\n\t\tif( empty( $definition[ self::DEF_LABELS ][ Toolset_Post_Type_Labels::SINGULAR_NAME ] ) ) {\n\t\t\t$this->set_label( Toolset_Post_Type_Labels::SINGULAR_NAME, $slug );\n\t\t}\n\n\t\tif ( isset( $definition[ self::DEF_REWRITE ][ self::DEF_REWRITE_SLUG ] ) ) {\n\n\t\t\t$rewrite_slug = toolset_getnest( $definition, array( self::DEF_REWRITE, self::DEF_REWRITE_SLUG ), '' );\n\t\t\t$rewrite_slug = trim( strtolower( remove_accents( $rewrite_slug ) ) );\n\n\t\t\t$definition[ self::DEF_REWRITE ][ self::DEF_REWRITE_SLUG ] = $rewrite_slug;\n\t\t}\n\n\t\t// We're not using this class for built-in types now, but in case this changes:\n\t\t// if ( wpcf_is_builtin_post_types($definition['slug']) ) {\n\t\t// $definition['_builtin'] = true;\n\t\t// }\n\n\t\treturn $definition;\n\t}",
"abstract protected function _getArgsForDefinition($definition);",
"public function processDefinition(array &$definition, $plugin_id);",
"private function sanitize_label( & $definition, $label_name ) {\n\n\t\t$label_value = toolset_getnest( $definition, array( self::DEF_LABELS, $label_name ), '' );\n\n\t\tif( empty( $label_value ) ) {\n\t\t\t$label_value = '';\n\n\t\t\tif( in_array( $label_name, Toolset_Post_Type_Labels::mandatory() ) ) {\n\t\t\t\t$label_value = $definition['slug'];\n\t\t\t}\n\t\t}\n\n\t\t// It is important to avoid saving empty values: If the element is missing entirely,\n\t\t// Types will use the default value instead. Saving an empty string can break the GUI.\n\t\tif( ! empty( $label_value ) ) {\n\t\t\t$definition[ self::DEF_LABELS ][ $label_name ] = sanitize_text_field( $label_value );\n\t\t}\n\t}",
"public function normalize();",
"public function normalize();",
"function normalizer_normalize($input, $form = Normalizer::FORM_C) {}",
"public function setDefinition($name, $definition) {}",
"function setDefinition($definition = \"\")\n\t{\n\t\t$this->picture_or_definition = $definition;\n\t}",
"public function normalize()\n\t{\n\t\t// Supprime les espaces multiples\n\t\t$this->setValeur(preg_replace('#\\s+#', ' ', $this->getValeur()));\n\n // Trim\n $this->setValeur(trim($this->getValeur()));\n\t}",
"public function setDefinition($definition) {\n\t\t$this->definition = $definition;\n\t\treturn $this;\n\t}",
"function normalize($input)\n{\n\t// 1. remove all white space, periods, commas\n\t// 2. lowercase everything\n\t$input_normalized = strtolower(preg_replace(\"/[\\s\\.,]+/\", \"\", $input));\n\treturn $input_normalized;\n}",
"protected abstract function getDefinition();",
"public function setDefinition($definition)\r\n {\r\n $this->definition = $definition;\r\n\r\n return $this;\r\n }",
"public function fix_entry($entry)\n {\n if ($entry['part_of_speech'] == 'ADJ') {\n if ($entry['which'] == 0) {\n if ($entry['variant'] == 0) {\n if ($entry['comparison'] == 'COMP') {\n $entry['stem3'] = $entry['stem1'];\n $entry['stem1'] = null;\n\n } elseif ($entry['comparison'] == 'SUPER') {\n $entry['stem4'] = $entry['stem1'];\n $entry['stem1'] = null;\n }\n }\n }\n\n } elseif ($entry['part_of_speech'] == 'NUM') {\n if ($entry['numeral_sort'] == 'ORD') {\n $entry['stem2'] = $entry['stem1'];\n $entry['stem1'] = null;\n\n } elseif ($entry['numeral_sort'] == 'DIST') {\n $entry['stem3'] = $entry['stem1'];\n $entry['stem1'] = null;\n\n } elseif ($entry['numeral_sort'] == 'ADVERB') {\n $entry['stem4'] = $entry['stem1'];\n $entry['stem1'] = null;\n }\n\n } elseif ($entry['part_of_speech'] == 'SUPINE') {\n if ($entry['which'] == 9) {\n if ($entry['variant'] == 9) {\n $entry['stem4'] = $entry['stem1'];\n $entry['stem1'] = null;\n }\n }\n }\n\n return $entry;\n }",
"public static function normalize($input, $form = Normalizer::FORM_C) {}",
"public function buildDataDefinition(array $definition, $value, $name = NULL, $parent = NULL);",
"protected function migratePatternSelection( $definition )\n {\n $definition[ 'naming_pattern' ] = '';\n \n foreach( $definition[ 'pattern_selection' ] as $pattern ) {\n $definition[ 'naming_pattern' ] .= \"<$pattern>\";\n }\n unset( $definition[ 'pattern_selection' ] );\n return $definition;\n }",
"public function setDefinition($definition = null)\n {\n if (null === $definition) {\n $this->definition = null;\n return $this;\n }\n if ($definition instanceof FHIRUri) {\n $this->definition = $definition;\n return $this;\n }\n $this->definition = new FHIRUri($definition);\n return $this;\n }",
"public function getDefinition() {\n // can be an array of DEC_Word_Definition's\n return $this->definition;\n }",
"static function normalizeData($data);",
"function polylang_slug_standardize_query( $query ) {\n\t// Strip tabs, newlines and multiple spaces.\n\t$query = str_replace(\n\t\tarray( \"\\t\", \" \\n\", \"\\n\", \" \\r\", \"\\r\", \" \", \" \" ),\n\t\tarray( '', ' ', ' ', ' ', ' ', ' ', ' ' ),\n\t\t$query\n\t);\n\treturn trim( $query );\n}",
"public function listExtendQuery($query, $definition = null)\n {\n switch ($definition) {\n case 'archived' :\n $query->where('archived', '=', true);\n break;\n\n default :\n $query->where('archived', '=', false);\n break;\n }\n }",
"protected function setDefinition($definition)\n {\n $this->definition = $definition;\n return $this;\n }",
"public function FromArray( $definition_array ){\r\n\t\treturn $this->ArrayToDefinition( $definition_array, new Definition() );\r\n\t}",
"public function __construct($input_definition, $value)\n\t{\n\t\t// Assign the object's value\n\t\t$this->value = $value;\n\n\t\t// If no value was sent, but a default has been defined\n\t\t// @gotcha - Should a defualt value be NULL, isset() would return false. Instead use array_key_exists().\n\t\tif(!$this->value && array_key_exists('default', $input_definition))\n\t\t{\n\t\t\t$this->value = $input_definition['default'];\n\t\t\t$this->setIsValid(true);\n\t\t\treturn;\n\t\t}\n\n\t\t// Set the regex\n\t\tif(isset($input_definition['regex'])) $this->regex = $input_definition['regex'];\n\t\t\n\t\t// Set the min length\n\t\tif(isset($input_definition['min_length'])) $this->min_length = $input_definition['min_length'];\n\t\t\n\t\t// Set the max length\n\t\tif(isset($input_definition['max_length'])) $this->max_length = $input_definition['max_length'];\n\t\t\n\t\t// Set whether we expect an array of data or not\n\t\tif(isset($input_definition['is_array'])) $this->is_array = $input_definition['is_array'];\n\t\n\t\t// Is this optional\n\t\tif(isset($input_definition['optional'])) $this->optional = $input_definition['optional'];\n\t\t\n\t\t// Set the default value if no value is present\n\t\tif(isset($input_definition['default_value']) && !$this->value) $this->value = $input_definition['default_value'];\n\t\t\n\t\t// Set the default error message\n\t\tif(isset($input_definition['error'])) $this->error = $input_definition['error'];\n\t\t\n\t\t// Set the min value\n\t\tif(isset($input_definition['number_range'])) $this->number_range = $input_definition['number_range'];\n\n\t\t// Validate the object\n\t\t$object_valid = $this->filterData($value);\n\n\t\t// Set the status\n\t\t$this->setIsValid($object_valid);\n\t}",
"public function getDefinition(): InputDefinition\n {\n $inputDefinition = parent::getDefinition();\n // clear out the normal first argument, which is the command name\n $inputDefinition->setArguments();\n\n return $inputDefinition;\n }",
"public function normalize(\n string $value\n ): string;",
"private function normalize()\n {\n // Normalize headers\n $this->title = trim($this->title);\n $this->name = trim($this->name);\n\n // Normalize line endings to Unix style line endings\n $this->code = str_replace(\"\\r\\n\", \"\\n\", $this->code);\n\n // Always terminate the file with a line ending\n $len = strlen($this->code);\n if ($this->code[$len - 1] !== \"\\n\") {\n $this->code .= \"\\n\";\n }\n }"
] | [
"0.65320164",
"0.628177",
"0.5201846",
"0.51949537",
"0.50930613",
"0.5079659",
"0.5079659",
"0.50205106",
"0.48186043",
"0.47829473",
"0.4750999",
"0.4714273",
"0.46631446",
"0.46519113",
"0.46447685",
"0.46374166",
"0.4602105",
"0.4597104",
"0.45895845",
"0.456639",
"0.4557779",
"0.45175952",
"0.45028758",
"0.44983867",
"0.44954398",
"0.44721824",
"0.4470915",
"0.4466214",
"0.44585004",
"0.44406492"
] | 0.8018783 | 0 |
Prepare for a "not_terms" clause | protected function _prepare_not_terms() {
$data = $this->get();
if (!isset($data['in']) || !isset($data['value'])) {
throw new Simples_Request_Exception('Key "in" or "value" empty', $data) ;
}
$return = array(
'bool' => array(
'must_not' => array(),
),
);
foreach((array)$data['in'] as $in) {
$return['bool']['must_not'][] = array(
'terms' => array(
$in => $data['value'],
),
);
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _notuses($option) {\n\t\tif (count($option) > 0) {\n\t\t\t$where = $this->tableNames['page'].'.page_id NOT IN (SELECT '.$this->tableNames['templatelinks'].'.tl_from FROM '.$this->tableNames['templatelinks'].' WHERE (';\n\t\t\t$ors = [];\n\t\t\tforeach ($option as $linkGroup) {\n\t\t\t\tforeach ($linkGroup as $link) {\n\t\t\t\t\t$_or = '('.$this->tableNames['templatelinks'].'.tl_namespace='.intval($link->getNamespace());\n\t\t\t\t\tif ($this->parameters->getParameter('ignorecase')) {\n\t\t\t\t\t\t$_or .= ' AND LOWER(CAST('.$this->tableNames['templatelinks'].'.tl_title AS char))=LOWER('.$this->DB->addQuotes($link->getDbKey()).'))';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_or .= ' AND '.$this->tableNames['templatelinks'].'.tl_title='.$this->DB->addQuotes($link->getDbKey()).')';\n\t\t\t\t\t}\n\t\t\t\t\t$ors[] = $_or;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$where .= implode(' OR ', $ors).'))';\n\t\t}\n\t\t$this->addWhere($where);\n\t}",
"private function _notcategory($option) {\n\t\tforeach ($option as $operatorType => $categories) {\n\t\t\tforeach ($categories as $category) {\n\t\t\t\t$i++;\n\t\t\t\t$this->addJoin(\"LEFT OUTER JOIN {$this->tableNames['categorylinks']} AS ecl{$i} ON {$this->tableNames['page']}.page_id=ecl{$i}.cl_from AND ecl{$i}.cl_to {$operatorType}\".$this->DB->addQuotes(str_replace(' ', '_', $category)));\n\t\t\t\t$this->addWhere(\"ecl{$i}.cl_to IS NULL\");\n\t\t\t}\n\t\t}\n\t}",
"function wpse_178511_get_terms_fields( $clauses, $taxonomies, $args ) {\r\r\n if ( ! empty( $args['search_name'] ) ) {\r\r\n global $wpdb;\r\r\n $search_like = $wpdb->esc_like( $args['search_name'] );\r\r\n if ( ! isset( $clauses['where'] ) )\r\r\n $clauses['where'] = '1=1';\r\r\n\r\r\n $clauses['where'] .= $wpdb->prepare( \" AND t.name LIKE %s\", \"$search_like%\" );\r\r\n }\r\r\n return $clauses;\r\r\n}",
"function exclude_cat( $q ) {\n\t\n\tif( is_shop() || is_page('my-page') ) { // set conditions here\n\t $tax_query = (array) $q->get( 'tax_query' );\n\t\n\t $tax_query[] = array(\n\t 'taxonomy' => 'product_cat',\n\t 'field' => 'slug',\n\t 'terms' => array('free-book'), // set product categories here\n\t 'operator' => 'NOT IN'\n\t );\n\t\n\t\n\t $q->set( 'tax_query', $tax_query );\n\t}\n}",
"public function not( $clause )\n {\n return \"!$clause\";\n }",
"function process_terms()\n {\n }",
"public function not(){}",
"public function setRejectTerms($terms) {\n\t\t\tif (!empty($terms)) {\n\t\t\t\t$terms = explode(',', $terms);\n\t\t\t\tforeach ($terms as $term) {\n\t\t\t\t\t$this->rejectTerms[] = trim($term);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"protected function where_clause_SectorSquad_not()\n\t{\n\t\tif(!method_exists($this->incoming_record, 'get_SectorSquad_not'))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t$SectorSquad_not = $this->incoming_record->get_SectorSquad_not();\n\t\t$where_fragment = '';\n\t\tif(!is_null($SectorSquad_not))\n\t\t{\n\t\t\t$SectorSquad_not = (array)$SectorSquad_not;\n\t\t\tforeach($SectorSquad_not as $key => $id)\n\t\t\t{\n\t\t\t\t$SectorSquad_not[$key] = $this->db->quote($id);\n\t\t\t}\n\t\t\t$where_fragment = \" and SectorSquad not in (\".implode(',',$SectorSquad_not).\")\";\n\t\t}\n\t\treturn $where_fragment;\n\t}",
"private function _nottitle($option) {\n\t\tforeach ($option as $comparisonType => $titles) {\n\t\t\tforeach ($titles as $title) {\n\t\t\t\tif ($this->parameters->getParameter('openreferences')) {\n\t\t\t\t\tif ($this->parameters->getParameter('ignorecase')) {\n\t\t\t\t\t\t$_or = \"LOWER(CAST(pl_title AS char)) {$comparisonType}\".strtolower($this->DB->addQuotes($title));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_or = \"pl_title {$comparisonType} \".$this->DB->addQuotes($title);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->parameters->getParameter('ignorecase')) {\n\t\t\t\t\t\t$_or = \"LOWER(CAST({$this->tableNames['page']}.page_title AS char)) {$comparisonType}\".strtolower($this->DB->addQuotes($title));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_or = \"{$this->tableNames['page']}.page_title {$comparisonType}\".$this->DB->addQuotes($title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$ors[] = $_or;\n\t\t\t}\n\t\t}\n\t\t$where .= 'NOT ('.implode(' OR ', $ors).')';\n\t\t$this->addWhere($where);\n\t}",
"function ea_exclude_noindex_from_search($query)\n{\n if ($query->is_main_query() && $query->is_search() && !is_admin()) {\n $meta_query = empty($query->query_vars['meta_query']) ? array() : $query->query_vars['meta_query'];\n $meta_query[] = array(\n 'key' => '_yoast_wpseo_meta-robots-noindex',\n 'compare' => 'NOT EXISTS',\n );\n $query->set('meta_query', $meta_query);\n }\n}",
"function wpd_residential_request_filter( $request ){\n\t if( array_key_exists( 'residential_taxonomies' , $request )\n\t && ! get_term_by( 'slug', $request['residential_taxonomies'], 'residential_taxonomies' ) ){\n\t $request['residential'] = $request['residential_taxonomies'];\n\t $request['name'] = $request['residential_taxonomies'];\n\t $request['post_type'] = 'residential';\n\t unset( $request['residential_taxonomies'] );\n\t }\n\t return $request;\n\t}",
"function wpd_specialty_request_filter( $request ){\n\t if( array_key_exists( 'specialty_taxonomies' , $request )\n\t && ! get_term_by( 'slug', $request['specialty_taxonomies'], 'specialty_taxonomies' ) ){\n\t $request['specialty'] = $request['specialty_taxonomies'];\n\t $request['name'] = $request['specialty_taxonomies'];\n\t $request['post_type'] = 'specialty';\n\t unset( $request['specialty_taxonomies'] );\n\t }\n\t return $request;\n\t}",
"protected function setAdditionalClauses(){}",
"public function notWhere(array $where);",
"function pai_terms_clauses( $clauses, $taxonomy, $args ) {\n global $wpdb;\n\n if ( isset( $args['post_type'] ) && !empty( $args['post_type'] ) ) {\n $post_types = $args['post_type'];\n\n if ( is_array( $args['post_type'] ) ) {\n $post_types = implode( \"','\", $args['post_type'] );\n }\n $clauses['join'] .= \" INNER JOIN $wpdb->term_relationships AS r ON r.term_taxonomy_id = tt.term_taxonomy_id INNER JOIN $wpdb->posts AS p ON p.ID = r.object_id\";\n $clauses['where'] .= \" AND p.post_type IN ('\". esc_sql( $post_types ). \"') GROUP BY t.term_id\";\n }\n\n return $clauses;\n}",
"function _prepare_search_conditions($fields,$q,&$conditions,&$bind_ar){\n\t\tif(is_string($fields)){\n\t\t\t$fields = explode(\",\",$fields); // \"id,name\" -> array(\"id\",\"name\")\n\t\t}\n\t\tif(!isset($conditions)){ $conditions = array(); }\n\t\tif(!isset($bind_ar)){ $bind_ar = array(); }\n\n\t\t$q = trim($q);\n\t\tif(!$q){ return; }\n\n\t\t$unaccent_installed = $this->dbmole->selectInt(\"SELECT COUNT(*) FROM pg_extension WHERE extname=:extname\",array(\":extname\" => \"unaccent\"));\n\n\t\t$q = Translate::Lower($q);\n\t\t$fields = \"LOWER(COALESCE(''||\".join(\",'')||' '||COALESCE(''||\",$fields).\",''))\";\n\t\tif($unaccent_installed && Translate::CheckEncoding($q,\"ASCII\")){\n\t\t\t$fields = \"UNACCENT($fields)\";\n\t\t}\n\n\t\t($cond = FullTextSearchQueryLike::GetQuery($fields,$q,$bind_ar)) ||\n\t\t($cond = \"'invalid'='search_query'\"); // it causes that nothing will be found\n\n\t\t$conditions[] = $cond;\n\n\t\treturn $cond;\n\t}",
"function totd_query_args_remove_polls($args) {\r\n\t\r\n\tif (is_user_logged_in()) return $args;\r\n\t\r\n\t$args['meta_key']='totd_question';\r\n\t$args['meta_compare']='!=';\r\n\t$args['meta_value']='yes';\r\n\t\r\n\treturn $args;\r\n\t\r\n}",
"private function getCatalogWhereTerms () {\n\t\tif (is_null($this->catalogId) || $this->catalogId->isEqual($this->getCombinedCatalogId()))\n\t\t\treturn 'TRUE';\n\t\telse\n\t\t\treturn 'catalog_id = :catalog_id';\n\t}",
"public function filter_post_terms($terms = '', $topic_id = 0, $reply_id = 0)\n {\n }",
"public function setRequiredTerms($terms) {\n\t\t\tif (!empty($terms)) {\n\t\t\t\t$terms = explode(',', $terms);\n\t\t\t\tforeach ($terms as $term) {\n\t\t\t\t\t$this->requiredTerms[] = trim($term);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function venture_deal_views_handler_not_united_states($op, $filter, $filterinfo, &$query) {\n if ($filter['value'] == 1) {\n $table = $filterinfo['table'];\n $field = $filterinfo['field'];\n $query->add_where(\"$table.$field != 'United States'\");\n }\n}",
"private function prepareQuery() {\n\n $this->addWhere('tx_newspaper_article.is_template = 0');\n $this->addWhere('tx_newspaper_article.pid = ' . tx_newspaper_Sysfolder::getInstance()->getPid(new tx_newspaper_Article()));\n $this->addTableReference('tx_newspaper_article');\n\n // Start with text filter: May contain #[uid], so the article with that uid should be returned ONLY\n if ($this->useFilter('text')) {\n if ($this->addConditionForText() == self::TEXT_SEARCH_FOR_UID) {\n return; // Query already built completely ...\n }\n unset($this->input['text']); // Don't add text filter twice ...\n }\n\n // Check section filter then: Might lead to an empty result set, no matter how the other filters are set\n if ($this->useFilter('section')) {\n if ($this->addConditionForSection() === false) {\n return; // No articles in result set\n }\n unset($this->input['section']); // Don't add section filter twice ...\n }\n\n foreach (array_keys($this->input) as $key) {\n if ($this->useFilter($key)) {\n $method = 'addConditionFor' . ucfirst($key);\n if (method_exists($this, $method)) {\n $this->$method();\n }\n }\n }\n\n }",
"public function setTermsIncludeLowerBound($flag) {}",
"private function getCatalogWhereTerms () {\n\t\tif (is_null($this->catalogId) || $this->catalogId->isEqual($this->getCombinedCatalogId()))\n\t\t\treturn 'TRUE';\n\t\telse\n\t\t\treturn '\n\tcatalog_id = :catalog_id \n\tAND SCBCRSE_COLL_CODE IN (\n\t\tSELECT\n\t\t\tcoll_code\n\t\tFROM\n\t\t\tcourse_catalog_college\n\t\tWHERE\n\t\t\tcatalog_id = :catalog_id2\n\t)\t';\n\t}",
"public function disallowTermLookup() {\n $this->lookupTerms = false;\n $this->lookupTermsConnector = null;\n }",
"public function not();",
"private function exclude_item_terms() {\n\t\t$cats = get_the_terms( $this->item->ID, 'category' );\n\t\t$exclude = 0;\n\n\t\tif ( is_array( $cats ) ) {\n\t\t\tforeach ( $cats as $cat ) {\n\t\t\t\tif ( isset( $this->options[ 'catexclude_' . $cat->slug ] ) ) {\n\t\t\t\t\t$exclude ++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $exclude >= count( $cats ) ) {\n\t\t\treturn true;\n\t\t}\n\t}",
"function bbp_get_search_terms($passed_terms = '')\n{\n}",
"protected function escape_clause_terms( $terms ) : array {\n if ( ! is_array( $terms ) ) {\n $terms = [ $terms ];\n }\n\n $terms = array_map( function( $term ) {\n return \\str_replace( '-', '\\\\-', $term );\n }, $terms );\n\n return $terms;\n }"
] | [
"0.5568211",
"0.5393409",
"0.53753024",
"0.53529465",
"0.5287053",
"0.5125305",
"0.5116992",
"0.5111369",
"0.50785094",
"0.50650334",
"0.5045515",
"0.4990861",
"0.49367225",
"0.4924872",
"0.49144173",
"0.48940572",
"0.48816457",
"0.48370057",
"0.48249456",
"0.48186794",
"0.4807321",
"0.4802688",
"0.47761834",
"0.47596255",
"0.47542322",
"0.47524872",
"0.47448632",
"0.47358772",
"0.47161123",
"0.4706514"
] | 0.7205279 | 0 |
Prepare for an "prefix" clause. Let the user give an array of values : in this case, generates one boolean clause by value. | protected function _prepare_prefix() {
$data = $this->get() ;
if (!isset($data['in']) || !isset($data['value'])) {
throw new Simples_Request_Exception('Key "in" or "value" empty', $data) ;
}
$in = $data['in'] ;
$value = $data['value'] ;
$data = array_diff_key($data, array('in' => true, 'value' => true)) ;
if (!is_array($value)) {
$return = array(
'prefix' => array(
$in => $this->_termIn('prefix', $value, $data)
)
);
} else {
$return = array(
'bool' => array(
'should' => array()
)
) ;
foreach($value as $v) {
$_clause = array(
'prefix' => array(
$in => $this->_termIn('prefix', $v, $data)
)
) ;
$return['bool']['should'][] = $_clause ;
}
}
return $return ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _prefix($value) {}",
"private function _generateSql ($prefix = 'SELECT ')\n {\n $this->_doPartition();\n $sql = $prefix;\n if ($this->_distinct)\n {\n $sql .= 'DISTINCT ';\n }\n $hasWhere = 0;\n if (! $this->_sql)\n {\n if (! is_array($this->_field) || count($this->_field) == 0)\n {\n $prefix !== 'DELETE ' && $sql .= \"*\";\n } elseif (count($this->_field))\n {\n foreach ($this->_field as $k => $v)\n {\n $sql .= '`' . $v . \"`,\";\n }\n }\n $lastIndex = strrpos($sql, ',');\n if ($lastIndex > 0)\n {\n $sql = substr($sql, 0, $lastIndex);\n }\n $sql .= \" FROM \" . $this->_from;\n if (is_array($this->_join) && count($this->_join) > 0)\n {\n foreach ($this->_join as $k => $v)\n {\n $sql .= \" JOIN \" . $v[0] . \" ON \" . $this->_from . \".\" . $v[1] . \"=\" . $v[0] . \".\" . $v[2];\n }\n }\n if (is_array($this->_where) && count($this->_where) > 0)\n {\n $sql .= \" WHERE \";\n $hasWhere = 1;\n foreach ($this->_where as $k => $v)\n {\n if ($v[1] != 'in')\n {\n $sql .= \"`$v[0]` \" . $v[1] . $this->_processValue($v[2]) . \" AND \";\n } else \n if ($v[1] == 'in')\n {\n if (count($v[2])) $sql .= \"`$v[0]` \" . $v[1] . $this->_processIn($v[2]) . \" AND \";\n }\n }\n $lastIndex = strrpos($sql, 'AND');\n if ($lastIndex > 0)\n {\n $sql = substr($sql, 0, $lastIndex);\n }\n }\n if (is_array($this->_wor) && count($this->_wor) > 0)\n {\n if (! $hasWhere)\n {\n $sql .= ' WHERE ';\n } else\n {\n $sql .= ' OR ';\n }\n foreach ($this->_wor as $k => &$v)\n {\n if ($v[1] != 'in')\n {\n $sql .= \"`$v[0]` \" . $v[1] . $this->_processValue($v[2]) . \" OR \";\n } else \n if ($v[1] == 'in')\n {\n if (count($v[2])) $sql .= \"`$v[0]` \" . $v[1] . $this->_processIn($v[2]) . \" OR \";\n }\n }\n $lastIndex = strrpos($sql, 'OR');\n if ($lastIndex > 0)\n {\n $sql = substr($sql, 0, $lastIndex);\n }\n }\n if ($this->_groupBy)\n {\n $sql .= ' GROUP BY `' . $this->_groupBy . '` ';\n }\n if ($this->_order && ! $this->_random)\n {\n $sql .= $this->_order;\n } else \n if ($this->_random)\n {\n $sql .= \" ORDER BY RAND()\";\n }\n if ($this->_limit)\n {\n $prefix !== 'DELETE ' && $sql .= \" limit \" . $this->_offset . \",\" . $this->_limit;\n $prefix === 'DELETE ' && $sql .= ' limit ' . $this->_limit;\n }\n }\n $this->_where = array();\n $this->_join = array();\n $this->_on = array();\n $this->_like = NULL;\n $this->_field = NULL;\n $this->_wor = array();\n $this->_limit = 100;\n $this->_distinct = FALSE;\n $this->_groupBy = NULL;\n $this->_random = NULL;\n $this->_order = NULL;\n $this->_from = '';\n return $sql;\n }",
"public function buildPrefix();",
"public function withShortPrefix(): array\n {\n return $this->filterArguments(['hasShortPrefix']);\n }",
"function arrayPrefix($prefix, array $arr)\n{\n if (is_array($arr) === FALSE) {\n return FALSE;\n }\n\n $ret = array();\n foreach ($arr as $val) {\n $ret[] = $prefix.$val;\n }\n\n return $ret;\n\n}",
"public function __construct( $prefix, array $values = [] )\n\t{\n\t\tparent::__construct( $prefix, $values );\n\n\t\t$this->values = $values;\n\t\t$this->prefix = $prefix;\n\t}",
"final public function startWith(string $prefix): self\n {\n return $this->constraint($this->constraintFactory()->startsWith($prefix));\n }",
"public function queryKeys($prefix){ }",
"protected static function generateWhereList($controller, $prefix = false){\n if(!$session_search = self::getSearchSession($controller)){\n return false;\n }\n \n $prefix = $prefix ? \"{$prefix}.\" : '';\n $first = true;\n \n foreach($session_search as $key => $val){\n $val = ClassTools::pSQL($val);\n \n if($prefix && ($key == 'name' || $key == 'surname')){\n if($first){\n $first = false;\n $search = \"suo.`{$key}` LIKE '%{$val}%'\";\n }else{\n $search .= \" AND suo.`{$key}` LIKE '%{$val}%'\";\n }\n }else{\n if($first){\n $first = false;\n $search = \"su.`{$key}` LIKE '%{$val}%'\";\n }else{\n $search .= \" AND su.`{$key}` LIKE '%{$val}%'\";\n }\n }\n }\n \n return $search;\n }",
"function dfak_prefix(array $a, string $p, bool $req = false):array {return dfak_transform($a, function($k) use($p) {return\n\t\"$p$k\"\n;}, $req);}",
"function prepareArray($array, $prefix = 'index_')\r\n {\r\n if (!is_array($array)) {\r\n return false;\r\n }\r\n\r\n $array_new = array();\r\n foreach($array as $key => $val) {\r\n if (!is_string($key)) {\r\n $key = $prefix.$key;\r\n }\r\n\r\n if (is_array($val)) {\r\n $array_new[$key] = $this->prepareArray($val);\r\n } else {\r\n $array_new[$key] = $val;\r\n }\r\n }\r\n\r\n return $array_new;\r\n }",
"public function prefix( $prefix );",
"public function sc_and($values) {\n\t\t\n\t\tif (!is_array($values)) {\n\t\t\tthrow new Exception('The values to query must come on an array format.');\n\t\t}\n\n\t\tif (is_array($values[0])) {\n\t\t\t$t_value = '';\n\t\t\tforeach ($values as $value) {\n\t\t\t\tif (count($value) > 4 || count($value) < 3) {\n\t\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t\t}\n\n\t\t\t\t$valKey = $value[0];\n\t\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t\t}\n\t\t\t\tif (is_null($value[2]) || $value[2] === 'NULL' || $value[2] === 'null') {\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].\" NULL \";\n\t\t\t\t}else{\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].' :'.$valKey.'_'.$this->t_count;\n\t\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\t\t$temp_array = array($temp_key=>$value[2]);\n\t\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t\t$this->t_count ++;\n\t\t\t\t}\n\n\t\t\t\tif (count($value) == 4) {\n\t\t\t\t\t$t_value .= ' '.$value[3];\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->t_value .= ' AND ('.$t_value.') ';\n\n\t\t}else{\n\t\t\tif (count($values) > 3 || count($values) < 2) {\n\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t}\n\n\t\t\t$valKey = $values[0];\n\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t}\n\t\t\t$temp_string = '';\n\t\t\tif (count($values) == 3 && (is_null($values[2]) || $values[2] === 'NULL' || $values[2] === 'null')) {\n\t\t\t\t$temp_string = $values[0].' '.$values[1].\" NULL \";\n\t\t\t}else{\n\t\t\t\t$temp_string = $values[0].' '.$values[1].' :'.$valKey.'_'.$this->t_count;\n\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\tif (count($values) == 3) {\n\t\t\t\t\t$temp_array = array($temp_key=>$values[2]);\n\t\t\t\t}else{\n\t\t\t\t\t$temp_array = array($temp_key=>\"''\");\n\t\t\t\t}\n\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t$this->t_count ++;\n\t\t\t}\n\t\t\t\n\t\t\t$this->t_value .= ' AND '.$temp_string;\n\t\t}\n\t\treturn $this;\n\t}",
"private function prefixWhere(array $where, $tablename)\n {\n $return = [];\n foreach ($where as $key => $condition) {\n // handles $where[property] = value\n if (!is_numeric($key)) {\n $return[$this->prefixColumn($key, $tablename)] = $condition;\n // handles $where[] = [property, value, '=']\n } elseif (is_array($condition)) {\n $condition[0] = $this->prefixColumn($condition[0], $tablename);\n $return[] = $condition;\n // handles raw SQL - do nothing\n } else {\n $return[] = $condition;\n }\n }\n\n return $return;\n }",
"public function setTermsPrefix($prefix) {}",
"public function File_Archive_Predicate_And() {\n\t\t$this->preds = func_get_args();\n\t}",
"static protected function parseCriteria($criteria = [], $prefix = '')\n { \n $criteria = array_map(function($item) use($prefix){\n $parts = explode('.', $item);\n return (count($parts) > 1)? $prefix.$item.' = :'.$parts[1] : $prefix.$item.' = :'.$item;\n }, array_keys($criteria)); \n\n return implode(' AND ', $criteria);\n }",
"function setPrefix($prefix);",
"protected function prefixArrayValues($prefix, $array)\n {\n $callback = create_function('$str', 'return \"'.$prefix.'\".$str;');\n\n return array_map($callback, $array);\n }",
"public function prefixKeys($prefix);",
"public function startsWith($value)\n {\n $this->expressionBuilder->startsWith($value);\n return $this->queryBuilder;\n }",
"public function selectFilterToWhere($filter = null, $prefix = \"e.\")\n\t{\n\t\t$where = \" 0 = 0 \";\n\t\tif (is_array($filter)) {\n\t\t\tfor ($i=0;$i<count($filter);$i++){\n\t\t\t\tswitch($filter[$i]['data']['type']){\n\t\t\t\t\tcase 'string' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" LIKE '%\".$filter[$i]['data']['value'].\"%'\"; break;\n\t\t\t\t\tcase 'list' :\n\t\t\t\t\t\tif (strstr($filter[$i]['data']['value'],',')){\n\t\t\t\t\t\t\t$fi = explode(',',$filter[$i]['data']['value']);\n\t\t\t\t\t\t\tfor ($q=0;$q<count($fi);$q++){\n\t\t\t\t\t\t\t\t$fi[$q] = \"'\".$fi[$q].\"'\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$filter[$i]['data']['value'] = implode(',',$fi);\n\t\t\t\t\t\t\t$qs .= \" AND {$prefix}\".$filter[$i]['field'].\" IN (\".$filter[$i]['data']['value'].\")\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$qs .= \" AND {$prefix}\".$filter[$i]['field'].\" = '\".$filter[$i]['data']['value'].\"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'boolean' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" = \".($filter[$i]['data']['value']); break;\n\t\t\t\t\tcase 'numeric' :\n\t\t\t\t\t\tswitch ($filter[$i]['data']['comparison']) {\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" = \".$filter[$i]['data']['value']; break;\n\t\t\t\t\t\t\tcase 'neq' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" <> \".$filter[$i]['data']['value']; break;\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" < \".$filter[$i]['data']['value']; break;\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" > \".$filter[$i]['data']['value']; break;\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'date' :\n\t\t\t\t\t\tswitch ($filter[$i]['data']['comparison']) {\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" = '\".date('Y-m-d',strtotime($filter[$i]['data']['value'])).\"'\"; break;\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" < '\".date('Y-m-d',strtotime($filter[$i]['data']['value'])).\"'\"; break;\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND {$prefix}\".$filter[$i]['field'].\" > '\".date('Y-m-d',strtotime($filter[$i]['data']['value'])).\"'\"; break;\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$where .= $qs;\n\t\t}\n\n\t\treturn $where;\n\t}",
"function get_job_ids_clause($prefix='') {\n\tglobal $all_jobs;\n\n\tif ($prefix != '') {\n\t\t$len = strlen($prefix);\n\t\tif (strrpos($prefix, '.') != ($len - 1)) {\n\t\t\t$prefix .= '.';\n\t\t}\n\t}\n\n\t$job_ids = array();\n\tforeach(array_keys($all_jobs) as $id) {\n\t\tif ($id == 'all') {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$job_ids[] = \"{$prefix}job_id={$id}\";\n\t}\n\treturn implode(' OR ', $job_ids);\n}",
"public function create_taxonomy_query( array $query, string $operator = 'AND', bool $prefix = true ) : string {\n\n $relation = $query['relation'] ?? $operator;\n unset( $query['relation'] );\n\n // RediSearch doesn't support these tax query clause operators.\n $unsupported_operators = [\n 'EXISTS',\n 'NOT EXISTS',\n ];\n\n // Determine the relation type\n $queries = [];\n\n if ( empty( $query ) ) {\n return '';\n }\n\n foreach ( $query as $clause ) {\n\n if ( empty( $clause['operator'] ) ) {\n $queries[] = $this->create_taxonomy_query( $clause, $relation );\n continue;\n }\n\n // Operator\n $operator_uppercase = strtoupper( $clause['operator'] ?? $operator );\n\n // We do not support some operator types, so bail early if some of them is found.\n if ( in_array( $operator_uppercase, $unsupported_operators, true ) ) {\n return false;\n }\n\n if ( ! empty( $clause['taxonomy'] ) ) {\n // Escape clause terms\n $clause['terms'] = $this->escape_clause_terms( $clause['terms'] );\n\n if ( strpos( $clause['taxonomy'], '-' ) !== false ) {\n $clause['taxonomy'] = str_replace( '-', '_', $clause['taxonomy'] );\n }\n\n switch ( $clause['field'] ) {\n case 'name':\n // Form clause by operator.\n if ( $clause['operator'] === 'IN' ) {\n $queries[] = sprintf(\n '(@%s:{%s})',\n $prefix ? 'taxonomy_' . $clause['taxonomy'] : $clause['taxonomy'],\n implode( '|', array_map( [ $this, 'enclose_in_quotes' ], (array) $clause['terms'] ) )\n );\n }\n if ( $clause['operator'] === 'AND' ) {\n\n // Note: if we are handling term conditions with AND operator\n // we need to form the query like so (@taxonomy: {term1}) (@taxonomy: {term2})\n $and_queries = [];\n\n array_map( function( $term ) use ( $clause, $prefix, &$and_queries ) {\n $and_queries[] = sprintf(\n '(@%s:{%s})',\n $prefix ? 'taxonomy_' . $clause['taxonomy'] : $clause['taxonomy'],\n $term\n );\n }, (array) $clause['terms'] );\n\n $queries[] = '(' . implode( ' ', $and_queries ) . ')';\n }\n elseif ( $clause['operator'] === 'NOT IN' ) {\n $queries[] = sprintf(\n '-(@%s:{%s})',\n $prefix ? 'taxonomy_' . $clause['taxonomy'] : $clause['taxonomy'],\n implode( '|', array_map( [ $this, 'enclose_in_quotes' ], (array) $clause['terms'] ) )\n );\n }\n\n $this->add_search_field( 'taxonomy_' . $clause['taxonomy'] );\n\n break;\n case 'slug':\n // Form clause by operator.\n if ( $clause['operator'] === 'IN' ) {\n $queries[] = sprintf(\n '(@%s:{%s})',\n $prefix ? 'taxonomy_slug_' . $clause['taxonomy'] : $clause['taxonomy'],\n implode( '|', array_map( [ $this, 'enclose_in_quotes' ], (array) $clause['terms'] ) )\n );\n }\n elseif ( $clause['operator'] === 'AND' ) {\n\n $and_queries = [];\n\n array_map( function( $term ) use ( $clause, $prefix, &$and_queries ) {\n $and_queries[] = sprintf(\n '@%s:{%s}',\n $prefix ? 'taxonomy_slug_' . $clause['taxonomy'] : $clause['taxonomy'],\n $term\n );\n }, (array) $clause['terms'] );\n\n $queries[] = '(' . implode( ' ', $and_queries ) . ')';\n }\n elseif ( $clause['operator'] === 'NOT IN' ) {\n $queries[] = sprintf(\n '-(@%s:{%s})',\n $prefix ? 'taxonomy_slug_' . $clause['taxonomy'] : $clause['taxonomy'],\n implode( '|', array_map( [ $this, 'enclose_in_quotes' ], (array) $clause['terms'] ) )\n );\n }\n\n $this->add_search_field( 'taxonomy_slug_' . $clause['taxonomy'] );\n\n break;\n case 'term_taxonomy_id':\n $taxonomy = $clause['taxonomy'] ?? false;\n\n // Change slug to the term id.\n // We are searching with the term id not with the term slug.\n $clause['terms'] = $this->terms_to_ids( $clause['terms'], $taxonomy, $clause['field'] );\n\n // The fallthrough is intentional: we only turn the slugs into ids.\n case 'term_id':\n default:\n // Include hierarchical taxonomy child terms, if wanted\n if ( $clause['include_children'] ?? false ) {\n $clause['terms'] = array_reduce( $clause['terms'], function( $terms, $id ) use ( $clause ) {\n $terms[] = $id;\n\n $children = get_term_children( $id, $clause['taxonomy'] );\n\n if ( ! is_array( $children ) ) {\n $children = [];\n }\n\n $terms = array_merge( $terms, $children );\n\n return $terms;\n }, [] );\n }\n\n // Form clause by operator.\n if ( $clause['operator'] === 'IN' ) {\n $queries[] = sprintf(\n '(@taxonomy_id_%s:{%s})',\n $clause['taxonomy'],\n implode( '|', (array) $clause['terms'] )\n );\n }\n // 2023.05.09: Added AND operator for taxonomy_id\n elseif ( $clause['operator'] === 'AND' ) {\n\n $and_queries = [];\n array_map( function( $term ) use ( $clause, &$and_queries ) {\n $and_queries[] = sprintf(\n '@taxonomy_id_%s:{%s}',\n $clause['taxonomy'],\n $term\n );\n }, (array) $clause['terms'] );\n\n $queries[] = '(' . implode( ' ', $and_queries ) . ')';\n }\n elseif ( $clause['operator'] === 'NOT IN' ) {\n $queries[] = sprintf(\n '-(@taxonomy_id_%s:{%s})',\n $clause['taxonomy'],\n implode( '|', (array) $clause['terms'] )\n );\n }\n\n $this->add_search_field( 'taxonomy_id_' . $clause['taxonomy'] );\n\n break;\n }\n }\n // If we have multiple clauses in the block, run the function recursively.\n else {\n $queries[] = $this->create_taxonomy_query( $clause, $relation );\n }\n }\n\n // All minuses to the end of the line.\n usort( $queries, function( $a, $b ) {\n return ( substr( $a, 0, 1 ) === '-' ) ? 1 : 0;\n });\n\n // Compare the relation.\n if ( $relation === 'AND' ) {\n switch ( count( $queries ) ) {\n case 0:\n return '';\n case 1:\n return $queries[0];\n default:\n return '(' . implode( ' ', $queries ) . ')';\n }\n }\n elseif ( $relation === 'OR' ) {\n switch ( count( $queries ) ) {\n case 0:\n return '';\n case 1:\n return $queries[0];\n default:\n return '(' . implode( '|', $queries ) . ')';\n }\n }\n }",
"public function prefix($value) : string;",
"public function setPrefix($prefix);",
"public function setPrefix($prefix);",
"public function prefix( $prefix )\n {\n // i'll write the tests first ;)\n }",
"function starts_with($haystack, $needles)\n {\n foreach ((array) $needles as $needle)\n {\n if ($needle != '' && strpos($haystack, $needle) === 0) return true;\n }\n\n return false;\n }",
"function starts_with($haystack, $needles)\n {\n foreach ((array)$needles as $needle) {\n if ($needle != '' && strpos($haystack, $needle) === 0) return true;\n }\n\n return false;\n }"
] | [
"0.5606251",
"0.55345875",
"0.54340243",
"0.5388124",
"0.53159225",
"0.527584",
"0.5232411",
"0.5219792",
"0.5206939",
"0.5152457",
"0.5150162",
"0.5143954",
"0.5122452",
"0.5109059",
"0.510852",
"0.51080424",
"0.5087417",
"0.50335157",
"0.5031958",
"0.50310713",
"0.50129986",
"0.5010167",
"0.5008086",
"0.4984684",
"0.49672386",
"0.49531323",
"0.49531323",
"0.49315858",
"0.49070776",
"0.48845872"
] | 0.65241784 | 0 |
Prepare for an "exists" clause. | protected function _prepare_exists() {
return $this->_prepare_missing('exists') ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function exists ($from_etc, $where_etc = null);",
"public function exists()\n {\n $this->applyBeforeQueryCallbacks();\n\n $results = $this->statement(\n $this->compile()->compileExists($this),\n $this->getBindings()\n );\n\n // save data before closing queries\n $data = $results->fetch(PDO::FETCH_COLUMN);\n\n $this->close();\n\n // since we're usinfg fetch column, then result will return the value of the fetched column\n // instead of returning the arrays where the columns is\n return $data >= Constant::ONE ? true : false;\n }",
"function isKeyExistent($arg_where)\n\t{\n\t\tif (is_scalar($arg_where))\n\t\t{\n\t\t\t$pkey_list = $this->getPrimaryKeyList();\n\t\t\tif (count($pkey_list) == 1)\n\t\t\t\t$arg_where = array($pkey_list[0] => $arg_where);\n\t\t\telse\n\t\t\t\treturn false;\t // should assume the first column???\n\t\t}\n\t\t$sql = 'SELECT * FROM ' . $this->db_table . ' WHERE ';\n\t\t$sql .= $this->generateWhere($this->cleanSql($arg_where));\n\t\t$result = $this->execSql($sql);\n\t\tif ($this->db_error_no == 0)\n\t\t{\n\t\t\t$this->fetchArray($result);\n\t\t\tif ($this->result_count > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t}",
"abstract protected function _exists($keys);",
"abstract public function exists(array $prm);",
"function addExists ( $fv, $desc ) { $this->add ( $fv, $desc, \"EXISTS\" ); }",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists($where)\n\t{\n\t\t/* did we get one or more columns */\n\t\treturn $this->on_empty_return(false)->get_by(((is_array($where)) ? $where : [$this->primary_key=>$where]));\n\t}",
"public function selectExists(string $rawSql): string;",
"public function is_exists(){\n\t\t$result=new resultobject();\n\t\ttry{\n\t\t\t$dao=new dao();\n\t\t\t$this->log->logIt(get_class($this).\"-\".\"is_exists\");\t\t\t\n\t\t\t$str_sql = \"select PLANS.*\n\t\t\t\t\t from \".dbtable::Tbplanmaster.\" as PLANS \n\t\t\t\t\t where PLANS.str_plan_type_name = :plan_type_name \";\n\t\t\t\t\t \n\t\t\t$dao->initCommand($str_sql);\t\t\t\t\t\t\n\t\t\t$dao->addParameter(\":plan_type_name\",trim($this->plan_type_name));\t\t\t\t\t\t\n\t\t\t$this->log->logIt($str_sql);\t\t\t\t\t\n\t\t\t$result->resultData[\"list\"] = $dao->executeRow();\n\t\t\t$result->resultData[\"total\"] = count($dao->executeQuery());\n\t\t\t\n\t\t\treturn $result;\t\t\t\t\t\t\t\t\t \n\t\t}\n\t\tcatch(Exception $e){\n\t\t\t$this->log->logIt(get_class($this).\"-\".\"is_exists\".\"-\".$e);\n\t\t\t$result->resultStatus=resultConstant::Error;\n\t\t\t$result->exception=$e;\n\t\t}\t\t\t\n\t\treturn $result;\t\t\n\t}",
"public function record_exists(){\r\n\r\n $this->where( array( $this->id_field.'<>' => $this->{$this->id_field} ) );\r\n \r\n $sql = $this->build_select_sql().\" LIMIT 1\";\r\n\r\n if( $row = $this->fetch_data( $this->query( $sql ) ) ){\r\n $this->clear_clauses();\r\n return TRUE;\r\n }else{\r\n $this->clear_clauses();\r\n return FALSE;\r\n }\r\n }",
"public function checkIfExists(){\n $query = \"SELECT * \";\n $query .= \" FROM sources \";\n $query .= \" WHERE title= '\" . $this->title . \"'\";\n $query .= \" AND srcId = '\" . $this->srcId . \"'\";\n $query .= \" AND srcType = 'b'\"; \n $total = self::findBySqlCount($query);\n if($total > 0){\n return true;\n }\n return false;\n }",
"abstract public function exists($var);",
"private function prepareQuery() {\n\n $this->addWhere('tx_newspaper_article.is_template = 0');\n $this->addWhere('tx_newspaper_article.pid = ' . tx_newspaper_Sysfolder::getInstance()->getPid(new tx_newspaper_Article()));\n $this->addTableReference('tx_newspaper_article');\n\n // Start with text filter: May contain #[uid], so the article with that uid should be returned ONLY\n if ($this->useFilter('text')) {\n if ($this->addConditionForText() == self::TEXT_SEARCH_FOR_UID) {\n return; // Query already built completely ...\n }\n unset($this->input['text']); // Don't add text filter twice ...\n }\n\n // Check section filter then: Might lead to an empty result set, no matter how the other filters are set\n if ($this->useFilter('section')) {\n if ($this->addConditionForSection() === false) {\n return; // No articles in result set\n }\n unset($this->input['section']); // Don't add section filter twice ...\n }\n\n foreach (array_keys($this->input) as $key) {\n if ($this->useFilter($key)) {\n $method = 'addConditionFor' . ucfirst($key);\n if (method_exists($this, $method)) {\n $this->$method();\n }\n }\n }\n\n }",
"static function exists($query,$call_pos=''){\n\t\tself::query($query,$call_pos);\n\t\tif(self::num_rows()>=1){\n\t\t\treturn self::fetch();\n\t\t}\n\t\treturn false;\n\t}",
"public function exists(){\r\n \r\n $found_row = $this->dbobject->get($this->table, 1, '*');\r\n \r\n $pkey = $this->primarykey;\r\n if($this->count() >= '1'){ \r\n \r\n //set the found row's primary key and value in case the save function is used later \r\n $this->primary_key_value[$pkey] = $found_row[0][$pkey];\r\n \r\n //ANGALIA Redo this section to make sure that the retrieved row is inserted correctly into the data variable\r\n \r\n //$this->data = $found_row; \r\n \r\n $exist_result = $found_row; \r\n }\r\n else{\r\n //unset so as to clear for new record insertion\r\n unset($this->primary_key_value[$pkey]);\r\n \r\n $exist_result = FALSE;\r\n }\r\n \r\n $this->fxnstatus['last_function'] = __FUNCTION__;\r\n return $exist_result;\r\n }",
"public function loadExistsObjects()\n {\n $ids = array_column($this->exists->toArray(), 'id');\n // Try loading objects by ids via factory\n $loaded = $this->factory->load($ids);\n\n if (count($loaded)) {\n /** @var TransformableInterface $object */\n foreach ($loaded as $object) {\n foreach ($this->exists as $item) {\n\n // If object has id equivalent item id then item has new description for that object\n if ($object->getId() == $item['id']) {\n\n // Populate object from item description\n $this->bindContent($item, $object, $this->map);\n\n // Validate and retrieve errors if exists\n if ($errors = $this->validate($object)) {\n $this->errors->add(array('item' => $item['number'], 'errors' => $errors));\n } else {\n $this->result->add($object);\n }\n // Clean internal \"exists\" collection for memory free\n $this->exists->removeElement($item);\n }\n }\n }\n }\n\n // Join not found item in db into \"new\" collection\n foreach ($this->exists as $item) {\n $this->new->add($item);\n // Clean internal \"exists\" collection\n $this->exists->removeElement($item);\n }\n }",
"public function findIsExists($akun_id);",
"function exists()\r\n\t{\r\n\t\t$prototype = new $this->class;\r\n\t\t$pk = $prototype->getPrimaryKey();\r\n\t\t\r\n\t\t$query = \"SELECT $pk FROM {$prototype->table} {$this->tableAlias} {$this->constraints} LIMIT 1\";\r\n\t\t\r\n\t\t$exists = false;\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$db = ConnectionManager::getConnection();\r\n\t\t\t\r\n\t\t\t$result = $db->prepare($query);\r\n\t\t\t$result->execute($this->params);\r\n\t\t\t\r\n\t\t\tif ($result->fetch()) $exists = true;\r\n\t\t\t\r\n\t\t\tunset($result);\r\n\t\t}\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\tthrow new DataItemException($e->getMessage());\r\n\t\t}\r\n\t\t\r\n\t\treturn $exists;\r\n\t\t\t\t \r\n\t}",
"function exists($id);",
"public static function exists()\n {\n /** @var \\Illuminate\\Database\\Query\\Builder $instance */\n return $instance->exists();\n }",
"public function sourceFileExists()\n {\n $request = RequestFactory::create(func_get_args(), $this->defaultManipulations);\n\n return $this->source->has($this->getSourcePath($request));\n }",
"public function exists(...$keys)\n {\n $keys = collect($keys)->map(function ($key) {\n return $this->applyPrefix($key);\n })->all();\n\n return $this->executeRaw(array_merge(['exists'], $keys));\n }",
"function exist() {\n\n if ( $this->conditionE ) {\n\n $this->conditionE = 'WHERE ' . $this->conditionE;\n\n }\n\n $query = mysql_query(\"SELECT COUNT(*) from $this->tableE $this->conditionE LIMIT 1\") or die (mysql_error());\n\n $rows = mysql_fetch_row( $query );\n\n $result = $rows[ 0 ]; \n\n return $result; \n\n }"
] | [
"0.648085",
"0.55019253",
"0.54743373",
"0.53217053",
"0.532046",
"0.52866507",
"0.5255303",
"0.5255303",
"0.5255303",
"0.5255303",
"0.5255303",
"0.5255303",
"0.5255303",
"0.5165293",
"0.5159357",
"0.50977004",
"0.508552",
"0.5074161",
"0.5066058",
"0.50379235",
"0.49784923",
"0.4976439",
"0.49618748",
"0.49342793",
"0.49073148",
"0.48970655",
"0.48382816",
"0.482604",
"0.47786647",
"0.4761948"
] | 0.75906485 | 0 |
Prepare for a "geo_bounding_box" clause. | protected function _prepare_geo_bounding_box() {
$data = $this->get() ;
if (!isset($data['in'])) {
throw new Simples_Request_Exception('Key "in" is empty', $data) ;
}
$in = $data['in'] ;
unset($data['in']) ;
$return = array(
'geo_bounding_box' => array(
$in => $data
)
);
return $return ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tsml_bounds() {\n\tglobal $wpdb, $tsml_bounds;\n\n\t//get north & south\n\t$latitudes = $wpdb->get_row('SELECT \n\t\t\tMAX(m.meta_value) north,\n\t\t\tMIN(m.meta_value) south\n\t\tFROM ' . $wpdb->postmeta . ' m\n\t\tJOIN ' . $wpdb->posts . ' p ON p.ID = m.post_id\n\t\tWHERE m.meta_key = \"latitude\" AND p.post_type = \"tsml_location\"');\n\n\t//get east & west\n\t$longitudes = $wpdb->get_row('SELECT \n\t\t\tMAX(m.meta_value) west,\n\t\t\tMIN(m.meta_value) east\n\t\tFROM ' . $wpdb->postmeta . ' m\n\t\tJOIN ' . $wpdb->posts . ' p ON p.ID = m.post_id\n\t\tWHERE m.meta_key = \"longitude\" AND p.post_type = \"tsml_location\"');\n\n\t//if results, get bounding box and cache it\n\tif ($latitudes && $longitudes) {\n\n\t\t//add 25% margin to the bounds\n\t\t$width = ($longitudes->east - $longitudes->west) / 25;\n\t\t$height = ($latitudes->north - $latitudes->south) / 25;\n\n\t\t$tsml_bounds = array(\n\t\t\t'north' => $latitudes->north + $height,\n\t\t\t'east' => $longitudes->east + $width,\n\t\t\t'south' => $latitudes->south - $height,\n\t\t\t'west' => $longitudes->west - $width,\n\t\t);\n\n\t\tupdate_option('tsml_bounds', $tsml_bounds);\n\t}\n}",
"protected function createLocationFilterQuery(&$spatial) {\n $spatial_method = (isset($spatial['method']) && in_array($spatial['method'], ['geofilt', 'bbox'])) ? $spatial['method'] : 'geofilt';\n $value = $spatial['filter_query_conditions']['value'];\n\n switch ($spatial['filter_query_conditions']['operator']) {\n case '<':\n case '<=':\n $spatial['radius'] = $value;\n return '{!' . $spatial_method . '}';\n\n case '>':\n case '>=':\n $spatial['min_radius'] = $value;\n return \"{!frange l=$value}geodist()\";\n\n case 'BETWEEN':\n $spatial['min_radius'] = array_shift($value);\n $spatial['radius'] = array_shift($value);\n return '{!frange l=' . $spatial['min_radius']. ' u=' . $spatial['radius'] . '}geodist()';\n\n case '=':\n case '<>':\n case 'NOT BETWEEN':\n case 'IN':\n case 'NOT IN':\n default:\n throw new SearchApiSolrException('Unsupported operator for location queries');\n }\n }",
"public function chkBoundsLocs(){\n\t\tforeach($this->txtBounds as $k => $v){\n\t\t\t$i = mb_stripos($this->txtDoc, $v);\n\t\t\tif ($i !== false)\n\t\t\t\t$this->orderedBounds[$i] = $v;\n\t\t}\n\t}",
"function bbox(): BBox { return new BBox([$this]); }",
"public static function extendBBox($bounds, $extent){\n\n if ($extent == null) $extent = _extendBoundsPointRadius;\n\n $ratio = $extent/_earth_radius;\n \n // Calculating new NW point\n $lat_rad = $bounds->NW_lat()*pi()/180;\n $lng_rad = $bounds->NW_lng()*pi()/180;\n $cos_lat_rad = cos($lat_rad);\n $sin_lat_rad = sin($lat_rad);\n\n $brng = (315/180)*pi(); // bearing is -45°\n $newNW_lat = asin( $sin_lat_rad*cos($ratio) + $cos_lat_rad*sin($ratio)*cos($brng) )* 180 / pi();\n $newNW_lng = ($lng_rad + atan2(sin($brng)*sin($ratio)*$cos_lat_rad, cos($ratio)-$sin_lat_rad*sin($newNW_lat*pi()/180)))* 180 / pi();\n\n // Calculating new SE point\n $lat_rad = $bounds->SE_lat()*pi()/180;\n $lng_rad = $bounds->SE_lng()*pi()/180;\n $cos_lat_rad = cos($lat_rad);\n $sin_lat_rad = sin($lat_rad);\n\n $brng = 135/180*pi(); // Bearing is 135°\n $newSE_lat = asin( $sin_lat_rad*cos($ratio) + $cos_lat_rad*sin($ratio)*cos($brng) )* 180 / pi();\n $newSE_lng = ($lng_rad + atan2(sin($brng)*sin($ratio)*$cos_lat_rad, cos($ratio)-$sin_lat_rad*sin($newSE_lat*pi()/180)))* 180 / pi();\n\n return new Bounds(array('NW_lat' => $newNW_lat, 'NW_lng' => $newNW_lng, 'SE_lat' => $newSE_lat, 'SE_lng' => $newSE_lng));\n\n }",
"public function getBox(CoordsBox $boundingBox, $src) {\n $stmt = $this->dbh->prepare('SELECT ' . self::SELECT_cols . ' ' . self::FROM .\n ' WHERE ' . $this->getSourceString($src) . ' AND ' . self::WHERE_box);\n $stmt->execute(array(\n ':latlower' => $boundingBox->southwest->lat,\n ':lnglower' => $boundingBox->southwest->lng,\n ':latupper' => $boundingBox->northeast->lat,\n ':lngupper' => $boundingBox->northeast->lng\n ));\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function testTypeWrappingSelect()\n {\n $this->createBigPolygon();\n $this->getEntityManager()->flush();\n $this->getEntityManager()->clear();\n\n $dql = 'SELECT p, ST_Contains(p.polygon, :geometry) FROM LongitudeOne\\Spatial\\Tests\\Fixtures\\PolygonEntity p';\n\n $query = $this->getEntityManager()->createQuery($dql);\n $query->setParameter('geometry', new Point(2, 2), 'point');\n $query->processParameterValue('geometry');\n\n $result = $query->getSQL();\n\n $parameter = Type::getType('point')->convertToDatabaseValueSql('?', $this->getPlatform());\n\n $regex = preg_quote(sprintf('/.polygon, %s)/', $parameter));\n\n static::assertMatchesRegularExpression($regex, $result);\n }",
"public function setBound()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof Bound)) {\n if (!$args[0]->hasCoordinates()) {\n throw OverlayException::invalidRectangleBoundCoordinates();\n }\n\n $this->bound = $args[0];\n } elseif ((isset($args[0]) && ($args[0] instanceof Coordinate))\n && (isset($args[1]) && ($args[1] instanceof Coordinate))\n ) {\n $this->bound->setSouthWest($args[0]);\n $this->bound->setNorthEast($args[1]);\n } elseif ((isset($args[0]) && is_numeric($args[0]))\n && (isset($args[1]) && is_numeric($args[1]))\n && (isset($args[2]) && is_numeric($args[2]))\n && (isset($args[3]) && is_numeric($args[3]))\n ) {\n $this->bound->setSouthWest(new Coordinate($args[0], $args[1]));\n $this->bound->setNorthEast(new Coordinate($args[2], $args[3]));\n\n if (isset($args[4]) && is_bool($args[4])) {\n $this->bound->getSouthWest()->setNoWrap($args[4]);\n }\n\n if (isset($args[5]) && is_bool($args[5])) {\n $this->bound->getNorthEast()->setNoWrap($args[5]);\n }\n } else {\n throw OverlayException::invalidRectangleBound();\n }\n }",
"public function testTypeWrappingSelect()\n {\n $this->createBigPolygon();\n $this->getEntityManager()->flush();\n $this->getEntityManager()->clear();\n\n $dql = 'SELECT p, ST_Contains(p.polygon, :geometry) FROM CrEOF\\Spatial\\Tests\\Fixtures\\PolygonEntity p';\n\n $query = $this->getEntityManager()->createQuery($dql);\n $query->setParameter('geometry', new Point(2, 2), 'point');\n $query->processParameterValue('geometry');\n\n $result = $query->getSQL();\n\n $parameter = Type::getType('point')->convertToDatabaseValueSql('?', $this->getPlatform());\n\n $regex = preg_quote(sprintf('/.polygon, %s)/', $parameter));\n\n static::assertRegExp($regex, $result);\n }",
"protected function _prepare_geo_distance() {\n\t\t$data = $this->get() ;\n\n\t\tif (!isset($data['in'])) {\n\t\t\tthrow new Simples_Request_Exception('Key \"in\" is empty', $data) ;\n\t\t}\n\n\t\t$in = $data['in'] ;\n\t\tif (!empty($data['lat']) && !empty($data['lon'])) {\n\t\t\t$values = array('lat' => $data['lat'], 'lon' => $data['lon']) ;\n\t\t\tunset($data['lat']) ;\n\t\t\tunset($data['lon']) ;\n\t\t} elseif (!empty($data['value'])) {\n\t\t\t$values = $data['value'] ;\n\t\t\tunset($data['value']) ;\n\t\t}\n\t\tunset($data['in']) ;\n\n\t\tif (empty($values)) {\n\t\t\tthrow new Simples_Request_Exception('Keys \"values\",\"lat\",\"lon\" are empty', $data) ;\n\t\t}\n\n\n\t\t$return = array(\n\t\t\t'geo_distance' => array($in => $values) + $data\n\t\t);\n\n\t\treturn $return ;\n\t}",
"public function addStartEndBounds(){\n\t\t$this->orderedBounds[0] = $this->STARTBOUND;\n\t\t$e = mb_strlen($this->txtDoc);\n\t\t$this->orderedBounds[$e] = $this->ENDBOUND;\t\t\n\t}",
"public function initNobuilding(){\n\t\t$sql = \"SELECT id,concat(longitude,',',latitude) as lonlat FROM ttgy_o2o_region WHERE attr=5\";\n\t\t$res = $this->db->query($sql)->result_array();\n\t\tforeach ($res as $value) {\n\t\t\t$sql = \"update ttgy_o2o_order_extra set lonlat='\".$value['lonlat'].\"' where building_id=\".$value['id'].\" and lonlat is null\";\n\t\t\t$this->db->query($sql);\n\t\t}\n\t}",
"private function insert_bound_location() {\n $dbhandler = Null;\n $dbhandler = new SqliteDbHanlder (db_parser (_INI_DB_CONFIG_FILE,_SERVER_DIR));\n if (empty($dbhandler)) {\n echo 'Impossible to initiate communication with database </br>';\n return False;\n }\n // if bounds exists and is an array\n if (!empty($this->_geocoded_location['bounds']) && is_array($this->_geocoded_location['bounds'])) {\n // we encode data in utf8 and encode quotes\n foreach ($this->_geocoded_location['bounds'] as $key=>$value) {\n // set north, east, south and west variables\n $$key = htmlentities($value);\n } \n $sql = 'INSERT INTO bounds (south, west, north, east) \n VALUES(:south, :west, :north, :east)';\n $query = $dbhandler->_db_connection->prepare($sql);\n if ($query) {\n $query->bindValue(':south', $south, PDO::PARAM_STR);\n $query->bindValue(':west', $west, PDO::PARAM_STR);\n $query->bindValue(':north', $north, PDO::PARAM_STR);\n $query->bindValue(':east', $east, PDO::PARAM_STR);\n // PDO's execute() gives back TRUE when successful,\n // false when not\n $registration_success_state = $query->execute();\n if ($registration_success_state) {\n echo \"Bound location has been successfuly inserted in the\n \t\t\t\t\t\t'bounds' table. <br/>\";\n return intval($dbhandler->_db_connection->lastInsertId());\n } else {\n echo \"Bound location failed to be inserted in the\n\t\t\t\t\t'bounds' table. <br/>\";\n return false;\n }\n }else {\n echo \"The request for inserting bound location in the 'bounds' \n \ttable has failed\";\n print_r ($query->errorInfo()).'<br/>';\n return false;\n }\n }else {\n echo \"The bound location parameter does not match the requirement, the\n \tinsertion could not have been done.\";\n return false;\n }\n }",
"public function onJSolrSearchPrepareBoostQueries()\n {\n $bq = array();\n\n $boosts = explode(',', $this->get('params')->get('query_boosts', null));\n\n foreach ($boosts as $boost) {\n if ($boost)\n $bq[] = \\JSolr\\Helper::localize($boost);\n }\n\n return $bq;\n }",
"protected function setBounds()\n {\n $this->_bounds = LatLngBounds::getBoundsOfLatLngs($this->getLatLngs());\n }",
"public function getBoundingBox()\n {\n return $this->boundingBox;\n }",
"function queryMap() {\n\t\t$center_y = ($this->user->rolle->oGeorefExt->maxy + $this->user->rolle->oGeorefExt->miny) / 2;\n\t\tif($this->user->rolle->epsg_code == 4326){$unit = MS_DD;} else {$unit = MS_METERS;}\n\t\t$md = ($this->user->rolle->nImageWidth-1)/(96 * InchesPerUnit($unit, $center_y));\n\t\t$gd = $this->user->rolle->oGeorefExt->maxx - $this->user->rolle->oGeorefExt->minx;\n\t\t$this->map_scaledenom = round($gd/$md);\n # Abfragebereich berechnen\n\t\tif($this->formvars['querypolygon'] != ''){\n\t\t\t$rect = $this->formvars['querypolygon'];\n\t\t}\n\t\telse{\n\t\t\tif($this->formvars['rectminx'] != ''){\t\t\t// ?????????\n\t\t\t\t$rect = ms_newRectObj();\t\t\t\t\t\t\t\t\t\t// ?????????\n\t\t\t\t$rect->setextent($this->formvars['rectminx'],$this->formvars['rectminy'],$this->formvars['rectmaxx'],$this->formvars['rectmaxy']);\t\t// ?????????\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$rect = $this->create_query_rect($this->formvars['INPUT_COORD']);\n\t\t\t}\n\t\t}\n if($this->show_query_tooltip == true){\n $this->tooltip_query($rect);\n }\n else{\n $this->SachdatenAnzeige($rect);\n\t\t\tif($this->formvars['printversion'] != ''){\n\t\t\t\t$this->mime_type = 'printversion';\n\t\t\t}\n\t\t\t$this->output();\n }\n }",
"function _getBoundStmt()\n\t{\n\t\t$db = Database::getDB();\n\t\t\n\t\t$st = $db->prepare(\n\t\t\t 'SELECT id, unit_id, UNIX_TIMESTAMP( time ) AS time, X( point ) AS px, Y( point ) AS py'\n\t\t\t.\"\\n\".'FROM waypoints'\n\t\t\t.\"\\n\".'ORDER BY time ASC' );\n\t\t$st->execute();\n\t\t$st->bindColumn( 'id', $this->_d['id'], PDO::PARAM_INT );\n\t\t$st->bindColumn( 'unit_id', $this->_d['unit'], PDO::PARAM_INT );\n\t\t$st->bindColumn( 'time', $this->_d['time'], PDO::PARAM_INT );\n\t\t$st->bindColumn( 'px', $this->_d['point']['x'], PDO::PARAM_INT );\n\t\t$st->bindColumn( 'py', $this->_d['point']['y'], PDO::PARAM_INT );\n\t\t\n\t\treturn $st;\n\t}",
"public function geoBounds($alias, $field, $wrap_longitude = true)\n {\n $aggregation = new GeoBoundsAggregation($alias, $field, $wrap_longitude);\n\n $this->append($aggregation);\n }",
"protected function calculateBoundings( ezcGraphBoundings $boundings )\n {\n $this->properties['boundings'] = clone $boundings;\n\n switch ( $this->position )\n {\n case ezcGraph::LEFT:\n $size = ( $boundings->width ) * $this->portraitSize;\n\n $boundings->x0 += $size;\n $this->boundings->x1 = $boundings->x0;\n break;\n case ezcGraph::RIGHT:\n $size = ( $boundings->width ) * $this->portraitSize;\n\n $boundings->x1 -= $size;\n $this->boundings->x0 = $boundings->x1;\n break;\n case ezcGraph::TOP:\n $size = ( $boundings->height ) * $this->landscapeSize;\n\n $boundings->y0 += $size;\n $this->boundings->y1 = $boundings->y0;\n break;\n case ezcGraph::BOTTOM:\n $size = ( $boundings->height ) * $this->landscapeSize;\n\n $boundings->y1 -= $size;\n $this->boundings->y0 = $boundings->y1;\n break;\n }\n\n return $boundings;\n }",
"protected function _prepare_range() {\n\t\t$data = $this->get() ;\n\n\t\tif (!isset($data['in'])) {\n\t\t\tthrow new Simples_Request_Exception('Key \"in\" empty', $data) ;\n\t\t}\n\n\t\t$in = $data['in'] ;\n\t\tunset($data['in']) ;\n\n\t\tif (!isset($data['ranges'])) {\n\t\t\t$return = array(\n\t\t\t\t'range' => array(\n\t\t\t\t\t$in => $data\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$return = array(\n\t\t\t\t'bool' => array(\n\t\t\t\t\t'should' => array()\n\t\t\t\t)\n\t\t\t) ;\n\t\t\t$_data = $data ;\n\t\t\tunset($_data['ranges']) ;\n\t\t\tforeach($data['ranges'] as $range) {\n\t\t\t\t$_clause = array(\n\t\t\t\t\t'range' => array(\n\t\t\t\t\t\t$in => $range + $_data\n\t\t\t\t\t)\n\t\t\t\t) ;\n\t\t\t\t$return['bool']['should'][] = $_clause ;\n\t\t\t}\n\t\t}\n\n\t\treturn $return ;\n\t}",
"public static function fromGeoPoint(GeoPoint $geopoint, $distance, $unit_of_measurement) {\n\t\t$radius = Earth::getRadius($unit_of_measurement);\n\t\tif ($radius < 0 || $distance < 0) throw new InvalidArgumentException('Bounding box distance must be greater than or equal to 0.');\n\n\t\t// angular distance in radians on a great circle\n\t\t$angularDistance = $distance / $radius;\n\n\t\t$minLat = $geopoint->getLatitude(true) - $angularDistance;\n\t\t$maxLat = $geopoint->getLatitude(true) + $angularDistance;\n\n\t\t$minLon = 0;\n\t\t$maxLon = 0;\n\t\tif ($minLat > Earth::getMINLAT() && $maxLat < Earth::getMAXLAT()) {\n\t\t\t$deltaLon = asin(sin($angularDistance) / cos($geopoint->getLatitude(true)));\n\t\t\t$minLon = $geopoint->getLongitude(true) - $deltaLon;\n\t\t\tif ($minLon < Earth::getMINLON()) $minLon += 2 * pi();\n\t\t\t$maxLon = $geopoint->getLongitude(true) + $deltaLon;\n\t\t\tif ($maxLon > Earth::getMAXLON()) $maxLon -= 2 * pi();\n\t\t} else {\n\t\t\t// a pole is within the distance\n\t\t\t$minLat = max($minLat, Earth::getMINLAT());\n\t\t\t$maxLat = min($maxLat, Earth::getMAXLAT());\n\t\t\t$minLon = Earth::getMINLON();\n\t\t\t$maxLon = Earth::getMAXLON();\n\t\t}\n return new BoundingBox($minLat, $minLon, $maxLat, $maxLon, true);\n }",
"public static function emptya() {\n return new S2LatLngRect(R1Interval::emptya(), S1Interval::emptya());\n }",
"public function select_by_idevent($id_event, $bbox = false)\n\n{\n\n$sql = \"SELECT id_track as id,origin_lat as lat,origin_lon as lng,track_status as status FROM track WHERE id_event = \" . $id_event .\" LIMIT 0,25\";\n\n//\" and origin_lon > \" . $bbox['sw_lng'] . \n\n// \" and origin_lon < \" . $bbox['ne_lng'] .\n\n// \" and origin_lat > \" . $bbox['sw_lat'] .\n\n// \" and origin_lat < \" . $bbox['ne_lat'];\n\n \n\n$results = DB::query(Database::SELECT, $sql)->execute();\n\n \n\n return $results;\n\n}",
"private function setbindingValue(){\n $temp = array();\n $str = 'where ';\n foreach($this->bindingValues as $type => $ary)\n {\n foreach($ary as $k => $v)\n {\n if($type == 'in')\n {\n $str .= $k . ' in (';\n foreach($v as $token)\n {\n $str .= '?, ';\n }\n $str = substr($str, 0, -2);\n $str .= ') and ';\n }\n else\n $str .= $k . ' ' . $type . ' :' . $k . ' and ';\n $temp[':' . $k] = $v;\n }\n }\n $this->bindingValues = $temp;\n $this->whereClause = substr($str, 0, -5);\n }",
"function build_map_aggregated_query($userloc = null, $bottomleft_coor=null,$topright_coor=null,$zoom = 15, $workingDays = -1, $peakHours = -1, $contract = -1, $tool = \"ndt\")\r\n{\r\n\tglobal $geographical_divisions, $geographical_division_zoom_levels, $geographical_division_map_shape;\r\n\tglobal $min_connections_per_postal_code, $min_connections_per_municipality, $min_connections_per_prefecture, $min_connections_per_periphery, $min_connections_per_country, $sliding_window_in_days;\r\n\tglobal $lang_lang_short,$mlablang,$lang_postal_code_short, $lang_postal_code_prefix, $lang_periphery_prefix, $lang_prefecture_prefix, $bandwidths;\r\n\t\r\n\t$region_level = -1;\r\n\tif($zoom == 100)\r\n\t\t$region_level = 1;\r\n\telse\r\n\t{\r\n\t\tforeach ($geographical_division_zoom_levels as $lev => $z)\r\n\t\t{\r\n\t\t\tif($zoom < $z)\r\n\t\t\t{ \r\n\t\t\t\t$region_level = ($lev == 0)? 0: ($lev-1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif($region_level<0)\r\n\t\t$region_level = 0;\r\n\t$area_mode = $geographical_division_map_shape[$region_level];\r\n\t/*\r\n\tif ($zoom < 8) //peripheries view (polygons)\r\n\t\t$granularity = 3;\r\n\telseif ($zoom < 11) //prefectures view (polygons)\r\n\t\t$granularity = 2;\r\n\telseif ($zoom < 13) //municiplaities view (icons)\r\n\t\t$granularity = 1;\r\n\telseif ($zoom < 15) //postal codes view (polygons)\r\n\t\t$granularity = 0;\r\n\telseif($zoom == 100)\r\n\t{\r\n\t\t$granularity = 2;\r\n\t}\t\r\n\telse\r\n\t\treturn null;*/\r\n\t\t\r\n\t$areatypes = array(\"periphery\",\"prefecture\",\"municipality\",\"postal_code\");\r\n\t\r\n\t\r\n\t/**************************************** Build region range clause **********************************************/\r\n\t/* Either restrict view in a specified window, or show a window of selected zoom around user location */\r\n\t/*****************************************************************************************************************/\r\n\tif (!is_array($bottomleft_coor) && !is_array($topright_coor))\r\n\t{\r\n\t\tif (is_array($userloc)) //no boundaries set -> show everything around user\r\n\t\t{\r\n\t\t\t$lat_diff = 0.0065798;\r\n\t\t\t$lng_diff = 0.0119737;\r\n\t\t\t$min_lat = $userloc['latitude'] - $lat_diff;\r\n\t\t\t$min_lng = $userloc['longitude'] - $lng_diff;\r\n\t\t\t$max_lat = $userloc['latitude'] + $lat_diff;\r\n\t\t\t$max_lng = $userloc['longitude'] + $lng_diff;\r\n\t\t}\r\n\t}\r\n\telse //map dragged/zoomed/panned show everything in selected area\r\n\t{\r\n\t\t$min_lat = $bottomleft_coor['lat'];\r\n\t\t$min_lng = $bottomleft_coor['lng'];\r\n\t\t$max_lat = $topright_coor['lat'];\r\n\t\t$max_lng = $topright_coor['lng'];\r\n\t}\r\n\t\r\n\t$viewportpolygon = \"GeomFromText('Polygon(($min_lng $min_lat,$min_lng $max_lat,$max_lng $max_lat,$max_lng $min_lat,$min_lng $min_lat))')\";\r\n\t\r\n\t$region_range_where_clause =\"\";\r\n\t$region_range_join_clause =\"\";\r\n\t//$i=$granularity;\r\n\t$areatype = $areatypes[$region_level];\r\n\tif($region_level >= $geographical_divisions)\r\n\t\t$areatable = \"postal_codes\";\r\n\telse\r\n\t\t$areatable = \"region_level_\".$region_level;\r\n\t$areaagregationtable = \"aggregation_per_\".$areatype;\r\n\t$areaagregationtable .= ($tool == \"ndt\")? \"\":\"_glasnost\";\r\n\t$min_connections_per_area_variable = ($tool == \"ndt\")? \"min_connections_per_$areatype\":\"min_connections_per_$areatype\".\"_glasnost\";\r\n\tglobal $$min_connections_per_area_variable;\r\n\t$min_connections = $$min_connections_per_area_variable;\r\n\t$prefix = isset(${\"lang_\".$areatype.\"_prefix\"})? ${\"lang_\".$areatype.\"_prefix\"}:\"\";\r\n\t$areanamecol = \"CONCAT('\".$prefix.\"',name_lang$mlablang)\";\r\n\t$idcol = \"id\";\r\n\tif ($region_level == 3)\r\n\t\t$idcol = \"code\";\r\n\t\r\n\t$contract_filter = (isset($bandwidths[$contract]))? \" AND contract = '\".$bandwidths[$contract]['d'].\" \".$bandwidths[$contract]['u'].\"' \":\" AND contract = 'all'\";\r\n\t$filter = \" workingDay = $workingDays AND peakHour = $peakHours\".$contract_filter;\r\n\t\r\n\tif (isset($min_lat) && $area_mode==\"point\") // detailed view with boundaries or user location with showing circles around a center and not polygons\r\n\t\t$region_range_where_clause =\"WHERE a.latitude > $min_lat AND a.latitude < $max_lat AND a.longitude > $min_lng AND a.longitude < $max_lng \";\r\n\r\n\t//if in prefectures or peripheries zoom level then check possibly multiple polygons (namely prefecture polygons) for intersecting with viewport\r\n\tif ($region_level < 2)\r\n\t{\t\t\r\n\t\t$prefecturetype = 1; // i.e. areatype = prefecture: table field for checking overlaps with viewport\r\n\t\t$wc = \"WHERE \".$areatype.\"_id IS NOT NULL\";\r\n\t\t//Show all peripheries no matter what region viewport defines\r\n\t\tif (isset($min_lat) && $region_level == 1)\r\n\t\t\t//old one, replaced by spatial query: $wc .= \" AND latitude > $min_lat AND latitude < $max_lat AND longitude > $min_lng AND longitude < $max_lng \";\r\n\t\t\t$wc .= \" AND Intersects($viewportpolygon, SHAPE) \";\r\n\t\t\r\n\t\t$region_range_join_clause = \" JOIN \r\n\t\t\t\t\t(SELECT distinct \".$areatype.\"_id AS id \r\n\t\t\t\t\tFROM detailed_{$areatypes[$prefecturetype]}_polygons \r\n\t\t\t\t\t$wc) d ON a.id=d.id \";\r\n\t\t\r\n\t\t$area_query['pols'] = \"SELECT \".$areatype.\"_id id, enc_pol_points as points, enc_pol_levels as levels\r\n\t\t\t\t\t\tFROM detailed_{$areatypes[$prefecturetype]}_polygons d\r\n\t\t\t\t\t\t$wc\r\n\t\t\t\t\t\tORDER BY \".$areatype.\"_id, polid, aa\"; \r\n\t\t//$area_query['pols'] = \"SELECT id, enc_pol_points as points, enc_pol_levels as levels\r\n\t\t\t//\t\t\tFROM local_exchange_polygons WHERE Intersects($viewportpolygon, SHAPE)\"; \r\n\t}\r\n\t\r\n\tif ($_SESSION['profile'] > 1)//privileged user level 1 ---> show her isps\r\n\t\t$order_by_clause = \"a.$idcol, isp_id\";\r\n\telse\r\n\t\t$order_by_clause = \"a.$idcol\";\r\n\t\t\r\n\tif($tool == \"ndt\")\r\n\t\t$metric_fields = \" avgup, avgdown, round(avgloss,3)*100 avgloss, avgrtt, avgjitter\";\r\n\telse\r\n\t\t$metric_fields = \" bittorent_throttled_connections, bittorent_measurements, connections_with_bittorent_measurements,\r\n\t\temule_throttled_connections, emule_measurements, connections_with_emule_measurements, gnutella_throttled_connections, gnutella_measurements,\r\n\t\tconnections_with_gnutella_measurements, http_throttled_connections, http_measurements, connections_with_http_measurements, ssh_throttled_connections,\r\n\t\tssh_measurements, connections_with_ssh_measurements, pop_throttled_connections, pop_measurements, connections_with_pop_measurements, imap_throttled_connections,\r\n\t\timap_measurements, connections_with_imap_measurements, flash_throttled_connections, flash_measurements, connections_with_flash_measurements\";\r\n\t\t\r\n\t$area_query[] = \"SELECT STRAIGHT_JOIN a.$idcol as $areatype, $areanamecol as areaname, latitude, longitude, $region_level category, isp_id, \r\n\t\t\t\t\t\t$metric_fields,\r\n\t\t\t\t\t\tmeasurements_sum measurements, connections_count connections\r\n\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t$areatable a $region_range_join_clause\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tLEFT JOIN \r\n\t\t\t\t\t\t(SELECT * FROM $areaagregationtable WHERE $filter) aggms \r\n\t\t\t\t\t\tON a.$idcol=aggms.$areatype \r\n\t\t\t\t\t\t$region_range_where_clause\r\n\t\t\t\t\t\t ORDER BY $order_by_clause\";\r\n\r\n\treturn $area_query;\r\n}",
"public function getValidationsByOwnPosition($lat, $lng, $limit, $radius, $user_id)\n {\n $limit = empty($limit) ? 20 : $limit;\n $radius = empty($radius) ? 5000 : $radius;\n $userPosition = PostGisSqlHelper::getLatLngGeom($lat, $lng);\n\n //aggregation1 : join promotion with promo2error_type\n $sql = \"WITH aggregation1 AS (\";\n $sql .= \"SELECT p.id AS promo_id, \";\n $sql .= \" p.startdate, \";\n $sql .= \" p.enddate, \";\n $sql .= \" p.geom AS promogeom, \";\n $sql .= \" pm.error_type, \";\n $sql .= \" pm.validation_extra_coins AS extra_coins \";\n $sql .= \"FROM kort.promotion p \";\n $sql .= \"INNER JOIN kort.promo2mission pm ON p.id=pm.promo_id \";\n $sql .= \"WHERE p.startdate < now() AND p.enddate > now())\";\n //aggregation2: get limited validations around the user's position as before\n $sql .= \", aggregation2 AS (\";\n $sql .= \"select * from (\";\n $sql .= \"select id AS validationid, \";\n $sql .= \" type, \";\n $sql .= \" view_type,\";\n $sql .= \" fix_user_id, \";\n $sql .= \" osm_id, \";\n $sql .= \" osm_type, \";\n $sql .= \" title, \";\n $sql .= \" fixmessage, \";\n $sql .= \" falsepositive, \";\n $sql .= \" question, \";\n $sql .= \" bug_question, \";\n $sql .= \" vote_koin_count, \";\n $sql .= \" latitude, \";\n $sql .= \" longitude, \";\n $sql .= \" upratings, \";\n $sql .= \" downratings, \";\n $sql .= \" required_votes,geom AS validationgeom,\";\n $sql .= \" txt1, \";\n $sql .= \" txt2, \";\n $sql .= \" txt3, \";\n $sql .= \" txt4, \";\n $sql .= \" txt5 \";\n $sql .= \" from kort.validations\";\n $sql .= \" where 1 = 1 \";\n $sql .= \" AND fix_user_id != \" . $user_id . \" \";\n $sql .= \" AND not exists (select 1 \";\n $sql .= \" from kort.vote v \";\n $sql .= \" where v.fix_id = id \";\n $sql .= \" and v.user_id = \" . $user_id . \")\";\n $sql .= \" order by \" . \"geom <-> \" . PostGisSqlHelper::getLatLngGeom($lat, $lng);\n $sql .= \" limit \" . $limit;\n $sql .= \") t\";\n $sql .= \" where \" . \"ST_Distance_Sphere(validationgeom,\" . $userPosition . \") <= \" . $radius . \" )\";\n //aggregation3: join aggregation2 and aggregation1 and check where validation_geom is within promotion_geom.\n //As result, we get all the validations around the user's position who actualy belongs to a active promotion\n $sql .= \", aggregation3 AS (\";\n $sql .= \"SELECT ag2.validationid AS validationidtemp, \";\n $sql .= \" ag1.promo_id, \";\n $sql .= \" ag1.extra_coins \";\n $sql .= \"FROM aggregation2 ag2 \";\n $sql .= \"INNER JOIN aggregation1 ag1 ON ag2.type=ag1.error_type \";\n $sql .= \"WHERE ST_WITHIN(ag2.validationgeom, ag1.promogeom))\";\n //left join the validations around the user (aggregation2) with the subset of the validations\n //who belongs to a promotion (aggregation3)\n //=> the fields promo_id and extra_coins is either null or holds the corresponding promotion values\n $sql .= \"SELECT validationid AS id,\";\n $sql .= \" type, \";\n $sql .= \" view_type, \";\n $sql .= \" fix_user_id, \";\n $sql .= \" osm_id, \";\n $sql .= \" osm_type, \";\n $sql .= \" title, \";\n $sql .= \" fixmessage, \";\n $sql .= \" falsepositive, \";\n $sql .= \" question, \";\n $sql .= \" bug_question, \";\n $sql .= \" vote_koin_count, \";\n $sql .= \" latitude, \";\n $sql .= \" longitude, \";\n $sql .= \" upratings, \";\n $sql .= \" downratings, \";\n $sql .= \" required_votes, \";\n $sql .= \" validationgeom AS geom, \";\n $sql .= \" txt1, \";\n $sql .= \" txt2, \";\n $sql .= \" txt3, \";\n $sql .= \" txt4, \";\n $sql .= \" txt5, \";\n $sql .= \" promo_id, \";\n $sql .= \" extra_coins \";\n $sql .= \"FROM aggregation2 ag2 \";\n $sql .= \"LEFT JOIN aggregation3 ag3 ON ag2.validationid=ag3.validationidtemp\";\n\n $params = array();\n $params['sql'] = $sql;\n $params['type'] = \"SQL\";\n\n $position = $this->getDbProxy()->addToTransaction($params);\n $result = json_decode($this->getDbProxy()->sendTransaction(), true);\n $validationData = array_map(array($this, \"convertBoolean\"), $result[$position - 1]);\n $validationData = array_map(array($this, \"translateValidation\"), $validationData);\n\n return json_encode($validationData);\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 }",
"private function replace_bound_fields($query)\n {\n // Import the bound fields locally.\n $bound_fields = $this->bound_fields;\n \n // Loop through the bound field and replace with values.\n foreach ($bound_fields as $field => $value)\n {\n\t\t\t\t\t\tif ($this->escape)\n \t$query = str_replace($field, \"'$value'\", $query);\n\t\t\t\t\t\telse\n \t$query = str_replace($field, \"$value\", $query);\t\t\t\t\t\t\t\n }\n \n return $query;\n }",
"public function getBoundingBox(): array\n {\n return [\n new Coordinate([\n $this->latitudeInterval[0],\n $this->longitudeInterval[0],\n ]),\n new Coordinate([\n $this->latitudeInterval[1],\n $this->longitudeInterval[1],\n ]),\n ];\n }"
] | [
"0.54719836",
"0.49857914",
"0.48616946",
"0.4856167",
"0.4845716",
"0.47601816",
"0.47416255",
"0.47347805",
"0.46820724",
"0.46333754",
"0.45934558",
"0.4588804",
"0.45255747",
"0.45227215",
"0.44759473",
"0.44521064",
"0.4420573",
"0.4379855",
"0.43594277",
"0.4347122",
"0.43302095",
"0.43282133",
"0.4316453",
"0.43110514",
"0.42881787",
"0.42676383",
"0.42249843",
"0.42240867",
"0.42184147",
"0.42176026"
] | 0.72436094 | 0 |
Prepare for a range clause. | protected function _prepare_range() {
$data = $this->get() ;
if (!isset($data['in'])) {
throw new Simples_Request_Exception('Key "in" empty', $data) ;
}
$in = $data['in'] ;
unset($data['in']) ;
if (!isset($data['ranges'])) {
$return = array(
'range' => array(
$in => $data
)
);
} else {
$return = array(
'bool' => array(
'should' => array()
)
) ;
$_data = $data ;
unset($_data['ranges']) ;
foreach($data['ranges'] as $range) {
$_clause = array(
'range' => array(
$in => $range + $_data
)
) ;
$return['bool']['should'][] = $_clause ;
}
}
return $return ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addConditionForRange() {\n $this->addWhere('tx_newspaper_article.tstamp>=' . tx_newspaper_UtilMod::calculateTimestamp($this->input['range']));\n }",
"final function range_in($col = 'price', $from = 0, $to = 0)\n\t{\n\t\t$id = uniqid();\n\t\t$add = \"WHERE\";\n\t\t$this->model_params[':from_'.$id] = $from;\n\t\t$this->model_params[':to_'.$id] = $to;\n\t\tif(!empty($this->model_sql_search)) { $add = \"AND\"; }\n\t\t$this->model_sql_search .= \"$add $col >= :from_$id AND $col <= :to_$id \";\n\t\treturn $this;\n\t}",
"public function convertToRange(): ConvertToRangeRequestBuilder {\n return new ConvertToRangeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function range()\n {\n return parent::addRange(func_get_args());\n }",
"final function range_out($col = 'price', $from = 0, $to = 0)\n\t{\n\t\t$id = uniqid();\n\t\t$add = \"WHERE\";\n\t\t$this->model_params[':from_'.$id] = $from;\n\t\t$this->model_params[':to_'.$id] = $to;\n\t\tif(!empty($this->model_sql_search)) { $add = \"AND\"; }\n\t\t$this->model_sql_search .= \"$add ($col <= :from_$id OR $col >= :to_$id) \";\n\t\treturn $this;\n\t}",
"public function range($start = NULL, $length = NULL);",
"public static function range(string|array $range): ISeq;",
"function range ($start, $limit, $step = 1) {}",
"function db_query_range($query, $from, $count, $args = array()) {\n $fnc = $this->slave_safe ? 'db_query_range_slave' : 'db_query_range';\n return $fnc($query, $from, $count, $args);\n }",
"public function addRange($range)\n {\n return parent::addRange($range);\n }",
"public function search_range()\r\t{\r\r\t}",
"private function setLimitClause() {\n\t\t//$this->sLimitClause = \"LIMIT \".$this->sRangeStart.\", \".$this->sRange;\n\t\t$this->sLimitClause = \"LIMIT :range_start, :range\";\n\t}",
"public function setReservedRange($var) {}",
"public function setReservedRange($var) {}",
"public function handle_filter_range_requests( $comment_query ) {\n\t\tif ( isset( $_REQUEST['cpac_filter-min'] ) ) {\n\t\t\t$comment_query->meta_query->queries[] = $this->get_meta_query_range( $_REQUEST['cpac_filter-min'], $_REQUEST['cpac_filter-max'] );\n\t\t}\n\n\t\treturn $comment_query;\n\t}",
"public function __construct() {\n $this->startRow = 1;\n $this->endRow = 100;\n $this->columns = $this->rangeColumns('A', 'AO');\n }",
"public function range()\n\t{\n\t\t$_slug = preg_replace( '#' . app_setting( 'url', 'shop' ) . 'range/?#', '', uri_string() );\n\n\t\tif ( $_slug ) :\n\n\t\t\t$this->_range_single( $_slug );\n\n\t\telse :\n\n\t\t\t$this->_range_index();\n\n\t\tendif;\n\t}",
"public function range(): RangeRequestBuilder {\n return new RangeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"protected function initRange()\n {\n if (isset($dummyValidation)) {\n /** @noinspection PhpUnusedLocalVariableInspection */\n $msg = 'Oraliqni tanlang';\n }\n\n if ($this->initDefaultRangeExpr){\n $this->pluginOptions['ranges'] = $this->initDefaultRanges();\n }\n\n if ($this->presetDropdown) {\n $m = 'moment()';\n $this->initRangeExpr = $this->hideInput = true;\n $this->pluginOptions['opens'] = \\yii\\helpers\\ArrayHelper::getValue($this->pluginOptions, 'opens', 'left');\n\n ########### Custom code here ##############\n\n if (!isset($this->pluginOptions['ranges'])) {\n $this->pluginOptions['ranges'] = $this->initDefaultRanges();\n }\n ########### End Custom code ##############\n\n if (empty($this->value)) {\n $this->pluginOptions['startDate'] = new JsExpression(\"{$m}.startOf('day')\");\n $this->pluginOptions['endDate'] = new JsExpression($m);\n }\n }\n $opts = $this->pluginOptions;\n if (!$this->initRangeExpr || empty($opts['ranges']) || !is_array($opts['ranges'])) {\n return;\n }\n $range = [];\n foreach ($opts['ranges'] as $key => $value) {\n if (!is_array($value) || empty($value[0]) || empty($value[1])) {\n throw new InvalidConfigException(\n \"Invalid settings for pluginOptions['ranges']. Each range value must be a two element array.\"\n );\n }\n $range[$key] = [static::parseJsExpr($value[0]), static::parseJsExpr($value[1])];\n }\n $this->pluginOptions['ranges'] = $range;\n }",
"public function whereRange($fieldName, $start, $end)\n {\n return $this->addWhere($fieldName, array('$gt' => $start, '$lt' => $end));\n }",
"public function setRange($range) : self\n {\n $this->initialized['range'] = true;\n $this->range = $range;\n return $this;\n }",
"public function setRange($filterName, $from=null, $to=null){\n if(!$this->optionExists('filter')){\n $this->search_options['filter'] = array($filterName=>array());\n }\n if(!isset($this->search_options['filter'][$filterName]))\n {\n $this->search_options['filter'][$filterName] = array();\n }\n if($from)\n {\n $this->search_options['filter'][$filterName]['from'] = $from;\n }\n if($to)\n {\n $this->search_options['filter'][$filterName]['to'] = $from;\n }\n }",
"function initRange () {\n\n $generator = new NumberGenerator;\n\n $this->assertCount(10, $generator->copy()->getRange());\n\n return $generator;\n }",
"private function findRange(): void\n {\n $this->limit = $this->inputDefinition->getDefaultLimit();\n\n if ($this->inputDefinition->isLimitAllowed()) {\n // Limit can be changed, we must find it from the parameters\n $limitParameter = $this->inputDefinition->getLimitParameter();\n if ($limitParameter && isset($this->others[$limitParameter])) {\n $this->limit = (int)$this->others[$limitParameter];\n // Additional security, do not allow negative or 0 limit\n if ($this->limit <= 0) {\n $this->limit = $this->inputDefinition->getDefaultLimit();\n }\n }\n }\n\n // Pager initialization, only if enabled\n if ($this->inputDefinition->isPagerEnabled()) {\n $pageParameter = $this->inputDefinition->getPagerParameter();\n if ($pageParameter && isset($this->others[$pageParameter])) {\n $this->page = (int)$this->others[$pageParameter];\n }\n\n // Additional security, do not allow negative or 0 page\n if ($this->page <= 0) {\n $this->page = 1;\n }\n }\n }",
"function yy_r118(){ $this->_retvalue = yy('Range', NULL, $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor); }",
"function ot_range( $start, $limit, $step = 1 ) {\n \n if ( $step < 0 )\n $step = 1;\n \n $range = range( $start, $limit, $step );\n \n foreach( $range as $k => $v ) {\n if ( strpos( $v, 'E' ) ) {\n $range[$k] = 0;\n }\n }\n \n return $range;\n}",
"function template_preprocess_partial_date_range(array &$variables) {\n /** @var \\Drupal\\partial_date\\Entity\\PartialDateFormatInterface $format */\n $format = $variables['format'];\n\n $variables['from_array'] = $variables['from'];\n $variables['from'] = [\n '#theme' => 'partial_date',\n '#date' => $variables['from_array'],\n '#format' => $format,\n ];\n\n $variables['to_array'] = $variables['to'];\n $variables['to'] = [\n '#theme' => 'partial_date',\n '#date' => $variables['to_array'],\n '#format' => $format,\n ];\n\n $variables['separator'] = $format->getSeparator('range');\n\n CacheableMetadata::createFromObject($format)->applyTo($variables);\n}",
"public function range(): array;",
"public function build(): CatalogQueryRange\n {\n return CoreHelper::clone($this->instance);\n }",
"function yy_r117(){ $this->_retvalue = yy('Range', $this->yystack[$this->yyidx + -1]->minor, NULL, $this->yystack[$this->yyidx + 0]->minor); }"
] | [
"0.63556534",
"0.60885364",
"0.59679383",
"0.5878666",
"0.5743461",
"0.5627071",
"0.5621383",
"0.5619923",
"0.561554",
"0.54882294",
"0.54763347",
"0.5473197",
"0.54612005",
"0.54612005",
"0.5452964",
"0.5433464",
"0.54278326",
"0.54131806",
"0.54131037",
"0.54067975",
"0.53964484",
"0.53741145",
"0.5365878",
"0.53330487",
"0.5325285",
"0.5310137",
"0.5275681",
"0.52430964",
"0.5228127",
"0.52181756"
] | 0.6474836 | 0 |
Prepare for a geo distance clause. | protected function _prepare_geo_distance() {
$data = $this->get() ;
if (!isset($data['in'])) {
throw new Simples_Request_Exception('Key "in" is empty', $data) ;
}
$in = $data['in'] ;
if (!empty($data['lat']) && !empty($data['lon'])) {
$values = array('lat' => $data['lat'], 'lon' => $data['lon']) ;
unset($data['lat']) ;
unset($data['lon']) ;
} elseif (!empty($data['value'])) {
$values = $data['value'] ;
unset($data['value']) ;
}
unset($data['in']) ;
if (empty($values)) {
throw new Simples_Request_Exception('Keys "values","lat","lon" are empty', $data) ;
}
$return = array(
'geo_distance' => array($in => $values) + $data
);
return $return ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function distQuery($params){\n if($params['latitude'] && $params['longitude']){\n return $distance = \",( 6371 * acos( cos( radians('{$params['latitude']}') ) * cos( radians(`latitude`) ) * cos( radians(`longitude` ) - radians('{$params['longitude']}') ) + sin( radians('{$params['latitude']}') ) * sin( radians(`latitude`) ) ) ) AS distance \";\n }\n else{\n return '';\n }\n }",
"public function remove_distance_clauses( $array_value ) {\n $no_distance_clause =( stripos( $array_value , 'sl_distance' ) === false );\n\n // Removed a param-based clause\n //\n if ( ( ! $no_distance_clause ) && strpos( $array_value , '%' ) ) {\n add_filter( 'slp_ajaxsql_queryparams', array( $this, 'remove_SQL_distance_param' ), 8 ); }\n\n return $no_distance_clause;\n }",
"protected function createLocationFilterQuery(&$spatial) {\n $spatial_method = (isset($spatial['method']) && in_array($spatial['method'], ['geofilt', 'bbox'])) ? $spatial['method'] : 'geofilt';\n $value = $spatial['filter_query_conditions']['value'];\n\n switch ($spatial['filter_query_conditions']['operator']) {\n case '<':\n case '<=':\n $spatial['radius'] = $value;\n return '{!' . $spatial_method . '}';\n\n case '>':\n case '>=':\n $spatial['min_radius'] = $value;\n return \"{!frange l=$value}geodist()\";\n\n case 'BETWEEN':\n $spatial['min_radius'] = array_shift($value);\n $spatial['radius'] = array_shift($value);\n return '{!frange l=' . $spatial['min_radius']. ' u=' . $spatial['radius'] . '}geodist()';\n\n case '=':\n case '<>':\n case 'NOT BETWEEN':\n case 'IN':\n case 'NOT IN':\n default:\n throw new SearchApiSolrException('Unsupported operator for location queries');\n }\n }",
"function add_initial_distance_sort_to_orderby() {\n\t $this->slplus->database->extend_order_array( 'sl_initial_distance ASC' );\n }",
"function add_distance_sort_to_orderby() {\n $this->slplus->database->extend_order_array( 'sl_distance ASC' );\n }",
"protected function prepare()\r\n {\r\n $this->query = new Query();\r\n $this->queryString = null;\r\n $this->tokens = array();\r\n $this->tmp = null;\r\n // add the default prefixes defined in constants.php\r\n global $default_prefixes;\r\n $this->query->prefixes = $default_prefixes;\r\n }",
"public function get_nearest_places( $lat, $lng, $limit = 10)\n {\n global $wpdb;\n//SELECT * ((ACOS(SIN(' . $lat . ' * PI() / 180) * SIN(lat* PI() / 180) + COS(' . $lat . ' * PI() / 180) * COS(lat* PI() / 180) * COS((' . $lng . ' - lng) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS \"distance\" FROM `zazit_h_posts` RIGHT JOIN ((SELECT *, `meta_value` as lat FROM `zazit_h_postmeta` WHERE `meta_key` = '_place_lat') as lat, (SELECT *, `meta_value` as lng FROM `zazit_h_postmeta` WHERE `meta_key` = '_place_lng') as lng ) ON (`zazit_h_posts`.`ID` = lat.`post_id`) OR (`zazit_h_posts`.`ID` = lng.`post_id`) WHERE `zazit_h_posts`.`post_type` = '_places' AND `zazit_h_posts`.`post_status` = 'publish' GROUP BY `zazit_h_posts`.`ID` ORDER BY `distance` ASC\n $sql = \"SELECT *, (acos\n ( cos($lat * pi() / 180)*cos($lng* pi() / 180)*cos(lat * pi() / 180)*cos(lng * pi() / 180)\n + cos($lat * pi() / 180)*sin($lng* pi() / 180)*cos(lat * pi() / 180)*sin(lng * pi() / 180)\n + sin($lat * pi() / 180)*sin(lat* pi() / 180)\n ) * 6372.795) AS `distance` FROM `zazit_h_posts`\n \nRIGHT JOIN (\n(SELECT `post_id`, `meta_value` as lat FROM `zazit_h_postmeta` WHERE `meta_key` = '_place_lat') as lat\n) ON (`zazit_h_posts`.`ID` = lat.`post_id`)\nRIGHT JOIN (\n(SELECT `post_id`, `meta_value` as lng FROM `zazit_h_postmeta` WHERE `meta_key` = '_place_lng') as lng\n) ON (`zazit_h_posts`.`ID` = lng.`post_id`)\n \n WHERE `zazit_h_posts`.`post_type` = '_places' AND `zazit_h_posts`.`post_status` = 'publish' GROUP BY `zazit_h_posts`.`ID` ORDER BY `distance` ASC LIMIT $limit;\";\n $results = $GLOBALS['wpdb']->get_results(\n $sql, OBJECT\n );\n\n return $results;\n }",
"public function setup( \\wpdb $db, $geo_query = array() )\n {\n \t$this->db = $db;\n\n // Default user input:\n $default = array( \n 'lat_meta_key' => 'lat',\n 'lng_meta_key' => 'lng',\n 'lat' => 0,\n 'lng' => 0,\n 'radius' => 0,\n 'distance_unit' => 111.045,\n 'order' => '',\n 'context' => '',\n );\n $geo_query = wp_parse_args( $geo_query, $default );\n\n // Sanitize the user input:\n $this->lat_meta_key = sanitize_key( $geo_query['lat_meta_key'] );\n $this->lng_meta_key = sanitize_key( $geo_query['lng_meta_key'] );\n $this->lat = floatval( $geo_query['lat'] );\n $this->lng = floatval( $geo_query['lng'] );\n $this->radius = floatval( $geo_query['radius'] );\n $this->distance_unit = floatval( $geo_query['distance_unit'] );\n $this->order = in_array( strtoupper( $geo_query['order'] ), array( 'ASC', 'DESC' ) ) ? strtoupper( $geo_query['order'] ) : '';\n }",
"public function posts_clauses( $clauses, \\WP_Query $q )\n {\n // Get user input:\n \t$geo_query = $q->get( 'geo_query' );\n\n if( is_array( $geo_query ) && ! empty( $geo_query ) )\n {\n // Run this filter callback only once:\n remove_filter( current_filter(), array( $this, __FUNCTION__ ) );\n\n // Default implementation:\n $class = __NAMESPACE__ . '\\\\GeoQueryHaversine';\n\n // Check if the user wants another implementation:\n if( ! empty( $geo_query['context'] ) )\n $class = preg_replace( '/[^a-z0-9\\\\\\]+/i', '', $geo_query['context'] );\n\n // Create an implementation instance, if the class exists and implements the GeoQueryInterface interface:\n if( class_exists( $class ) && in_array( __NAMESPACE__ . '\\\\GeoQueryInterface', class_implements( $class ) ) )\n {\n $g = new $class;\n $g->setup( $this->db, $geo_query );\n $clauses = $g->algorithm( $clauses );\n }\n }\n return $clauses;\n }",
"public function geoDist($key, $member1, $member2, $unit = null) {}",
"public function scopeDistance($query, $miles, $latitude = null, $longitude = null)\n {\n if(!$latitude || !$longitude)\n {\n $geoip = json_decode(\\GeoIp::getGeoIp('json'));\n $latitude = $geoip->latitude;\n $longitude = $geoip->longitude;\n }\n $cartesian = \\SoeHelper::getCartesian($latitude, $longitude);\n $distance = \\DB::raw('(sqrt(pow(used_vehicles.latm - '.$cartesian['latm'].', 2) + pow(used_vehicles.lngm - '.$cartesian['lngm'].', 2)))');\n return $query->where($distance, '<=', ($miles * 1609));\n }",
"function evaluatedestiantion($filt_origin, $filt_destination, $mode)\n{\n $string = \"https://maps.googleapis.com/maps/api/distancematrix/json?origins=\".$filt_origin.\"&destinations=\".$filt_destination.\"&mode=\".$mode.\"&language=fr-FR&key=PUT-YOUR-GOOGLE-API-KEY-HERE\";\n\n $data = json_decode(file_get_contents($string),true);\n global $status;\n $status = $data['status'];\n global $location_status;\n $location_status = $data['rows']['0']['elements']['0']['status'];\n\n if($status == \"OK\")\n {\n if($location_status == \"OK\")\n {\n global $origin_address, $destination_address, $distance, $duration, $duration_sec;\n $destination_address = $data['destination_addresses']['0'];\n $origin_address = $data['origin_addresses']['0'];\n $distance = $data['rows']['0']['elements']['0']['distance']['value'];\n $duration = $data['rows']['0']['elements']['0']['duration']['text'];\n $duration_sec = $data['rows']['0']['elements']['0']['duration']['value'];\n }\n }\n}",
"function select_geo($table, $latitude, $longitude, $radius = 0, $results = 0, $miles = true, $additional_where = false) {\r\n\t\t$coord_cols = $this->geo_detect_coord_cols($table);\r\n\r\n\t\t$q = \"SELECT *, (\".($miles ? \"3959\" : \"6371\").\" * acos(cos(radians(\".$latitude.\")) * cos(radians(\".$this->lat_col.\")) * cos(radians(\".$this->lon_col.\") - radians(\".$longitude.\")) + sin(radians(\".$latitude.\")) * sin(radians(\".$this->lat_col.\")))) AS distance FROM \".$this->encapsulate_column_name($table);\r\n\r\n\t\tif ($radius > 0) { $q .= \" HAVING distance < \".$radius; }\r\n\t\tif ($additional_where !== false) { $q.= \"WHERE $additional_where\"; }\r\n\t\t$q .= \" ORDER BY distance\";\r\n\t\tif ($results > 0) { $q .= \" LIMIT $results;\"; }\r\n\r\n\t\treturn $this->query($q);\r\n\t}",
"function handleDistance($distance){\r\n $miles = 10; //default\r\n if (!empty($distance)){\r\n $miles = $distance;\r\n }\r\n return $miles/0.00062137;\r\n}",
"public static function get_distance_sql($lat1, $lon1, $lat2, $lon2)\n {\n $x1 = \"(90-$lat1) * 3.14159 / 180\";\n $x2 = \"(90-$lat2) * 3.14159 / 180\";\n #\n # least(1, ...) was added below to prevent getting values greater than 1 due\n # to floating point precision limits. See issue #351 for details.\n #\n $d = \"acos(least(1, cos($x1) * cos($x2) + sin($x1) * sin($x2) * cos(($lon1-$lon2) * 3.14159 / 180))) * 6371000\";\n return $d;\n }",
"public function __construct(Order $order, $distance = null)\n {\n $this->order = $order->setRelations([]);\n $this->distance = $distance;\n }",
"public function distanceFrom($format){\n// print_r($_GET);\n $lat1 = $this->latitude;\n $lon1 = $this->longitude;\n $lat2 = $_GET['latitude'];\n $lon2 = $_GET['longitude'];\n $return['distance_in_km'] = $this->distance($lat1, $lon1, $lat2, $lat2);\n $return['bearing'] = $this->bearing($lat1, $lon1, $lat2, $lat2);\n\n return $this->format($format, $return);\n }",
"public function __construct($distance)\n\t{\n\t\t$this->setDistance($distance);\n\t}",
"private function prepareQuery() {\n\n $this->addWhere('tx_newspaper_article.is_template = 0');\n $this->addWhere('tx_newspaper_article.pid = ' . tx_newspaper_Sysfolder::getInstance()->getPid(new tx_newspaper_Article()));\n $this->addTableReference('tx_newspaper_article');\n\n // Start with text filter: May contain #[uid], so the article with that uid should be returned ONLY\n if ($this->useFilter('text')) {\n if ($this->addConditionForText() == self::TEXT_SEARCH_FOR_UID) {\n return; // Query already built completely ...\n }\n unset($this->input['text']); // Don't add text filter twice ...\n }\n\n // Check section filter then: Might lead to an empty result set, no matter how the other filters are set\n if ($this->useFilter('section')) {\n if ($this->addConditionForSection() === false) {\n return; // No articles in result set\n }\n unset($this->input['section']); // Don't add section filter twice ...\n }\n\n foreach (array_keys($this->input) as $key) {\n if ($this->useFilter($key)) {\n $method = 'addConditionFor' . ucfirst($key);\n if (method_exists($this, $method)) {\n $this->$method();\n }\n }\n }\n\n }",
"public function initNobuilding(){\n\t\t$sql = \"SELECT id,concat(longitude,',',latitude) as lonlat FROM ttgy_o2o_region WHERE attr=5\";\n\t\t$res = $this->db->query($sql)->result_array();\n\t\tforeach ($res as $value) {\n\t\t\t$sql = \"update ttgy_o2o_order_extra set lonlat='\".$value['lonlat'].\"' where building_id=\".$value['id'].\" and lonlat is null\";\n\t\t\t$this->db->query($sql);\n\t\t}\n\t}",
"public static function posts_fields( $sql, \\WP_Query $query ) {\n\t\tif ( self::isGeoQuery( $query ) ) {\n\n\t\t\tif ( $sql ) {\n\t\t\t\t$sql .= ', ';\n\t\t\t}\n\n\t\t\t$sql .= self::haversine_sql( self::getGeoQuery( $query ) ) . ' AS geo_query_distance';\n\t\t}\n\n\t\treturn $sql;\n\t}",
"public function distance_formula($lat, $lng, $table) {\n\t\t$q = sprintf(\"round(3956 * 2 * ASIN(SQRT( POWER(SIN((%s -abs(%s.lat)) * pi()/180 / 2),2) + COS(%s * pi()/180 ) * COS(abs(%s.lat) * pi()/180) * POWER(SIN((%s - %s.lng) * pi()/180 / 2), 2) )),2) as distance \", $lat, $table, $lat, $table, $lng, $table);\n\t\treturn $q;\n\t}",
"private function execute_location_query( $query_slug , $query_statements ) {\n do_action( 'slp_ajax_execute_location_query_start' , $query_slug );\n\n // Distance Unit (KM or MI) Modifier\n // Since miles is default, if kilometers is selected, divide by 1.609344 in order to convert the kilometer value selection back in miles\n //\n $multiplier = ( $this->slplus->SmartOptions->distance_unit->value == 'km' ) ? SLPlus::earth_radius_km : SLPlus::earth_radius_mi;\n\n /**\n * FILTER: slp_location_filters_for_AJAX\n * Add all the location filters together for SQL statement.\n */\n $filterClause = '';\n foreach ( apply_filters( 'slp_location_filters_for_AJAX', array(), $query_slug ) as $filter ) {\n $filterClause .= $filter;\n }\n\n // ORDER BY\n //\n if ( $query_slug === 'standard_location_load' ) {\n\t add_action( 'slp_orderby_default', array( $this, 'add_initial_distance_sort_to_orderby' ), 100 );\n } else {\n\t add_action( 'slp_orderby_default', array( $this, 'add_distance_sort_to_orderby' ), 100 );\n }\n\n /**\n * FILTER: slp_location_having_filters_for_AJAX\n * append new having clause logic to the array and return the new array to extend/modify the having clause.\n *\n * Do filter after sl_distance has been calculated, HAVING must be used for calculated SQL fields.\n * WHERE only works for built-in columns in the table(s).\n */\n $having_pieces = ( ( $query_slug === 'standard_location_load' ) || empty( $this->query_params['radius'] ) ) ? array() : array( '(sl_distance < %f) ', 'OR (sl_distance IS NULL) ' );\n $havingClauseElements = apply_filters( 'slp_location_having_filters_for_AJAX', $having_pieces, $query_slug );\n\n // If there are element for the having clause set it\n // otherwise leave it as a blank string\n //\n $having_clause = '';\n if ( count( $havingClauseElements ) > 0 ) {\n foreach ( $havingClauseElements as $filter ) {\n $having_clause .= $filter;\n }\n $having_clause = trim( $having_clause );\n $having_clause = preg_replace( '/^OR /', '', $having_clause );\n\n if ( ! empty( $having_clause ) ) {\n $having_clause = 'HAVING ' . $having_clause;\n }\n\n }\n\n // WHERE clauses\n //\n add_filter( 'slp_ajaxsql_where', array( $this, 'filter_out_private_locations' ) );\n\n $slp_standard_query = $this->slplus->database->get_SQL( $query_statements );\n $slp_standard_query .= \" {$filterClause} \";\n $slp_standard_query .= \" {$having_clause} \";\n $slp_standard_query .= $this->slplus->database->get_SQL( 'orderby_default' );\n $slp_standard_query .= 'LIMIT %d';\n\n /**\n * FILTER: slp_ajaxsql_fullquery\n *\n * @param string $slp_standard_query The full SQL query\n * @param string $query_slug The slug for the running query\n *\n * @return string Modified SQL query\n */\n $this->basic_query = apply_filters( 'slp_ajaxsql_fullquery', $slp_standard_query, $query_slug );\n\n // Set the query parameters\n //\n $this->distance_param_removed = true;\n $default_query_parameters = array();\n if ( $query_slug !== 'standard_location_load' ) {\n\t $default_query_parameters[] = $multiplier;\n\t $default_query_parameters[] = $this->query_params['lat'];\n\t $default_query_parameters[] = $this->query_params['lng'];\n\t $default_query_parameters[] = $this->query_params['lat'];\n\t if ( ! empty( $having_clause ) ) {\n\t\t $default_query_parameters[] = $this->query_params['radius'];\n $this->distance_param_removed = false;\n\t }\n } else {\n if ( in_array( 'where_initial_distance' , $query_statements ) ) {\n\t\t $default_query_parameters[] = $this->query_params['radius'];\n $this->distance_param_removed = false;\n\t }\n }\n\n $default_query_parameters[] = $this->query_limit;\n\n /**\n * FILTER: slp_ajaxsql_queryparams\n */\n $query_params = apply_filters( 'slp_ajaxsql_queryparams', $default_query_parameters, $query_slug );\n\n // Run the query\n //\n // First convert our placeholder basic_query into a string with the vars inserted.\n // Then turn off errors so they don't munge our JSONP.\n //\n\t /**\n\t * @var WPDB $wpdb\n\t */\n global $wpdb;\n $query = $wpdb->prepare( $this->basic_query, $query_params );\n $wpdb->hide_errors();\n $result = $wpdb->get_results( $query, ARRAY_A );\n\n // Problems? Oh crap. Die.\n //\n if ( $result === null ) {\n wp_die( json_encode( array(\n 'success' => false,\n 'response' => 'Invalid query: ' . $wpdb->last_error,\n 'message' => $this->slplus->options_nojs['invalid_query_message'],\n 'basic_query' => $this->basic_query,\n 'default_params' => $default_query_parameters,\n 'query_params' => $query_params,\n 'query_slug' => $query_slug,\n 'query' => $wpdb->last_query,\n ) ) );\n }\n\n /**\n * FILTER: slp_ajaxsql_results\n *\n * @param array $result the search results\n * @param string $query_slug the slug for the query that generated the results\n *\n * @return array modified results\n */\n $filtered_results = apply_filters( 'slp_ajaxsql_results', $result, $query_slug );\n\n $this->location_queries[ $query_slug ] = array(\n 'query_slugs' => $query_statements,\n 'query' => $wpdb->last_query,\n 'params' => $query_params,\n 'locations' => array( 'pre-filter' => count( $result ) , 'filtered' => count( $filtered_results ) ),\n );\n\n do_action( 'slp_ajax_execute_location_query_end' , $query_slug );\n\n return $filtered_results;\n }",
"function destination($lat,$lon, $bearing, $distance,$units=\"mi\") {\n\t $radius = strcasecmp($units, \"km\") ? 3963.19 : 6378.137;\n\t $rLat = deg2rad($lat);\n\t $rLon = deg2rad($lon);\n\t $rBearing = deg2rad($bearing);\n\t $rAngDist = $distance / $radius;\n\n\t $rLatB = asin(sin($rLat) * cos($rAngDist) + \n\t cos($rLat) * sin($rAngDist) * cos($rBearing));\n\n\t $rLonB = $rLon + atan2(sin($rBearing) * sin($rAngDist) * cos($rLat), \n\t cos($rAngDist) - sin($rLat) * sin($rLatB));\n\n\t return array(\"lat\" => rad2deg($rLatB), \"lon\" => rad2deg($rLonB));\n\t}",
"function pre_get_posts( $wp_query ) {\n\t\tif ( 'prowp_profile' != $wp_query->get( 'post_type' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $wp_query->get( 'pcl_radius' ) ) ) {\n\t\t\t$wp_query->set( 'pcl_is_location_search', 0 );\n\t\t\treturn;\n\t\t}\n\n\t\t$distance = intval( $wp_query->get( 'pcl_radius' ) );\n\n\t\t$distance_unit = strtolower( $wp_query->get( 'pcl_distance_unit' ) );\n\n\t\tif ( 'mi' == $distance_unit ) {\n\t\t\t$earth_radius = 3959;\n\t\t} else {\n\t\t\t$earth_radius = 6371;\n\t\t\t$wp_query->set( 'pcl_distance_unit', 'km' );\n\t\t}\n\n\t\t$latitude = $wp_query->get( 'pcl_latitude' );\n\t\t$longitude = $wp_query->get( 'pcl_longitude' );\n\t\t$postal_code = $wp_query->get( 'pcl_postal_code' );\n\t\t$country_code = strtoupper( $wp_query->get( 'pcl_country_code' ) );\n\t\t$country = $wp_query->get( 'countries' );\n\n\t\t//User did not use \"use my location\", attempt to get coordinates by postal code supplied\n\t\tif ( ( empty( $latitude ) && empty( $longitude ) ) ) {\n\t\t\tif ( empty( $postal_code ) ) {\n\t\t\t\t$wp_query->set( 'pcl_is_location_search', 0 );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$supported_countries = get_terms( 'pcl_postal_code', array(\n\t\t\t\t'hide_empty' => false,\n\t\t\t\t'parent' => 0,\n\t\t\t) );\n\n\t\t\tif ( empty( $supported_countries ) || is_wp_error( $supported_countries ) ) {\n\t\t\t\t$wp_query->set( 'pcl_is_location_search', 0 );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$supported_country_codes = wp_list_pluck( $supported_countries, 'name' );\n\n\t\t\t//If pcl_country_code is not set, use the country taxonomy query var to look up the country.\n\t\t\tif ( empty( $country_code ) ) {\n\t\t\t\tif ( ! empty( $country ) ) {\n\t\t\t\t\t$country_term = get_term_by( 'slug', sanitize_text_field( $country ), 'pcl_country' );\n\n\t\t\t\t\tif ( empty( $country_term ) || is_wp_error( $country_term ) ) {\n\t\t\t\t\t\t$wp_query->set( 'pcl_is_location_search', 0 );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$country_abbreviations = pcl_get_countries();\n\t\t\t\t\t\t$country_code = array_search( $country_term->name, $country_abbreviations );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$wp_query->set( 'pcl_is_location_search', 0 );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! in_array( $country_code, $supported_country_codes ) ) {\n\t\t\t\t$wp_query->set( 'pcl_is_location_search', 0 );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$postal_code_object = pcl_get_postal_code( $postal_code, $country_code );\n\n\t\t\tif ( is_wp_error( $postal_code_object ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$latitude = $postal_code_object->latitude;\n\t\t\t$wp_query->set( 'pcl_latitude', $latitude );\n\n\t\t\t$longitude = $postal_code_object->longitude;\n\t\t\t$wp_query->set( 'pcl_longitude', $longitude );\n\n\t\t\t$wp_query->set( 'pcl_is_location_search', 1 );\n\t\t}\n\n\t\t//Bail if we still do not have a center point latitude and longitude\n\t\tif ( empty( $latitude ) || empty( $longitude ) ) {\n\t\t\t$wp_query->set( 'pcl_is_location_search', 0 );\n\t\t\treturn;\n\t\t}\n\n\t\t$cache_key = md5( $latitude . $longitude . $distance . $distance_unit );\n\n\t\t//Check for cached list of profiles.\n\t\t$profiles = wp_cache_get( $cache_key, 'pcl_radius_profiles' );\n\n\t\t$latitude_top = number_format( $latitude - rad2deg( $distance / $earth_radius ), 6 );\n\t\t$latitude_bottom = number_format( $latitude + rad2deg( $distance / $earth_radius ), 6 );\n\t\t$longitude_left = number_format( $longitude - rad2deg( $distance / $earth_radius / cos( deg2rad( $latitude ) ) ), 6 );\n\t\t$longitude_right = number_format( $longitude + rad2deg( $distance / $earth_radius / cos( deg2rad( $latitude ) ) ), 6 );\n\n\t\t//Radius query args\n\t\t$radius_args = array(\n\t\t\t'post_type' => 'prowp_profile',\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => 100,\n\t\t\t'offset' => 0,\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t\t'geo_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => 'geo_latitude',\n\t\t\t\t\t\t'compare' => 'BETWEEN',\n\t\t\t\t\t\t'type' => 'DECIMAL',\n\t\t\t\t\t\t'value' => array(\n\t\t\t\t\t\t\t( $latitude_top < $latitude_bottom ) ? $latitude_top : $latitude_bottom,\n\t\t\t\t\t\t\t( $latitude_top > $latitude_bottom ) ? $latitude_top : $latitude_bottom,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => 'geo_longitude',\n\t\t\t\t\t\t'compare' => 'BETWEEN',\n\t\t\t\t\t\t'type' => 'DECIMAL',\n\t\t\t\t\t\t'value' => array(\n\t\t\t\t\t\t\t( $longitude_left < $longitude_right ) ? $longitude_left : $longitude_right,\n\t\t\t\t\t\t\t( $longitude_left > $longitude_right ) ? $longitude_left : $longitude_right,\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'orderby' => array(\n\t\t\t\t'score_meta' => 'DESC',\n\t\t\t\t'post_title' => 'ASC'\n\t\t\t),\n\t\t\t'no_found_rows' => true,\n\t\t\t'fields' => 'ids',\n\t\t);\n\n\t\tif ( false === $profiles ) {\n\t\t\t$profiles = array();\n\n\t\t\t$radius_query = new WP_Query( $radius_args );\n\n\t\t\twhile ( $radius_query->have_posts() ) {\n\t\t\t\tforeach ( $radius_query->posts as $p ) {\n\t\t\t\t\t$profile_latitude = get_post_meta( $p, 'geo_latitude', true );\n\t\t\t\t\t$profile_longitude = get_post_meta( $p, 'geo_longitude', true );\n\n\t\t\t\t\t$profile_distance = $earth_radius * acos( sin( deg2rad( $latitude ) ) * sin( deg2rad( $profile_latitude ) ) + cos( deg2rad( $latitude ) ) * cos( deg2rad( $profile_latitude ) ) * cos( deg2rad( $longitude - $profile_longitude ) ) );\n\n\t\t\t\t\tif ( $profile_distance <= $distance ) {\n\t\t\t\t\t\t$profiles[] = $p;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$radius_args['offset'] = $radius_args['offset'] + $radius_args['posts_per_page'];\n\t\t\t\t$radius_query = new WP_Query( $radius_args );\n\t\t\t}\n\n\t\t\twp_cache_set( $cache_key, $profiles, 'pcl_radius_profiles' );\n\t\t}\n\n\t\t$profiles = array_map( 'intval', $profiles );\n\n\t\t$wp_query->set( 'pcl_is_location_search', 1 );\n\n\t\t//No profiles matched, make sure that the query reflects that (passing empty profiles array causes it to be ignored)\n\t\tif ( empty( $profiles ) ) {\n\t\t\t$wp_query->set( 'meta_query', $radius_args['meta_query'] );\n\t\t\treturn;\n\t\t}\n\n\t\t$wp_query->set( 'post__in', $profiles );\n\t}",
"private function distance(GeoLocation $geo)\n {\n return sqrt(pow(($this->latitud - $geo->latitud),2) + pow(($this->longitud - $geo->longitud),2));\n }",
"function geoportail_chercher_adm($lon, $lat, &$adm) \r\n{\r\n\tif ($lon && $lat)\r\n\t{\t// Chercher la commune correspondante\r\n\t\t$delta = 0.1;\r\n\t\t$dmin = 100;\r\n\t\twhile(true)\r\n\t\t{\t$lon1 = $lon-$delta;\r\n\t\t\t$lon2 = $lon+$delta;\r\n\t\t\t$lat1 = $lat-$delta;\r\n\t\t\t$lat2 = $lat+$delta;\r\n\t\t\t$res = spip_query(\"SELECT * FROM spip_georgc WHERE feature_class>'0' AND lon>\".$lon1.\" AND lon<\".$lon2.\" AND lat>\".$lat1.\" AND lat<\".$lat2);\r\n\t\t\t// La plus proche...\r\n\t\t\twhile ($row=spip_fetch_array($res))\r\n\t\t\t{\t// Coord en radian\r\n\t\t\t\t$lon1 = $row['lon']*pi()/180;\r\n\t\t\t\t$lat1 = $row['lat']*pi()/180;\r\n\t\t\t\t$lon2 = $lon *pi()/180;\r\n\t\t\t\t$lat2 = $lat *pi()/180;\r\n\t\t\t\t// Longueur sur le grand cercle (en km)\r\n\t\t\t\t$d = 2 * 6367 * asin( sqrt ( \r\n\t\t\t\t\t\t\t\t\tpow( sin(($lat1-$lat2)/2),2 )\r\n\t\t\t\t\t\t\t\t\t+ ( cos($lat1) * cos($lat2) * pow(sin(($lon1-$lon2)/2),2) )\r\n\t\t\t\t\t\t\t));\r\n\t\t\t\t/* Risques d'arrondis ?\r\n\t\t\t\t$d = 6367 * acos( sin($lat1)*sin($lat2) + cos($lat1)*cos($lat2)*cos($lon1-$lon2) );\r\n\t\t\t\t*/\r\n\t\t\t\tif ($d<$dmin)\r\n\t\t\t\t{\t$dmin = $d;\r\n\t\t\t\t\t$com = $row;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// On a trouve !\r\n\t\t\tif ($dmin < 100) break;\r\n\t\t\t// Elargir la recherche\r\n\t\t\t$delta *= 2;\r\n\t\t\t// Trop loins !\r\n\t\t\tif ($delta > 0.6) break;\r\n\t\t}\r\n\t\t// Trouve\r\n\t\tif ($dmin < 100)\r\n\t\t{\t$adm = $com;\r\n\t\t\t// No INSEE\r\n\t\t\t$adm['insee'] = $com['id_dep'].$com['id_com'];\r\n\t\t\t// Nom du departement\r\n\t\t\tinclude_spip ('public/geoportail_boucles');\r\n\t\t\t$adm['departement'] = geoportail_departement($com['id_dep']);\r\n\t\t\t// Distance (en km)\r\n\t\t\t$adm['dist'] = $dmin;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse return false;\r\n\t}\r\n\treturn false;\r\n}",
"protected function initializeDatabaseQueryRestrictions()\n {\n // $this->whereClause is used only to select templates from sys_template.\n // $GLOBALS['SIM_ACCESS_TIME'] is used so that we're able to simulate a later time as a test...\n $this->whereClause = 'AND deleted=0 ';\n if (!$this->getTypoScriptFrontendController()->showHiddenRecords) {\n $this->whereClause .= 'AND hidden=0 ';\n }\n $this->whereClause .= 'AND (starttime<=' . $GLOBALS['SIM_ACCESS_TIME'] . ') AND (endtime=0 OR endtime>' . $GLOBALS['SIM_ACCESS_TIME'] . ')';\n\n // set up the query builder restrictions\n $this->queryBuilderRestrictions = GeneralUtility::makeInstance(DefaultRestrictionContainer::class);\n\n if ($this->getTypoScriptFrontendController()->showHiddenRecords) {\n $this->queryBuilderRestrictions\n ->removeByType(HiddenRestriction::class);\n }\n }",
"protected function _prepare_restrictions ()\n {\n parent::_prepare_restrictions ();\n\n if (! $this->_returns_no_data ())\n {\n include_once ('webcore/db/query_security.php');\n $restriction = new QUERY_SECURITY_RESTRICTION ($this, $this->_user);\n $sql = $restriction->as_sql (array (Privilege_set_folder, Privilege_set_entry));\n if (! $sql)\n {\n $this->_set_returns_no_data ();\n }\n else\n {\n $this->_calculated_restrictions [] = $sql;\n }\n }\n }",
"public function getSQLOrder(){\n\t\t// set Latitude and Longditude Columnnames\n\t\treturn 'geodistance('.$this->name.'Latitude,'.$this->name.'Longditude,'.$this->getLatitude().','.$this->getLongditude().')';\n\t}"
] | [
"0.55150104",
"0.50990915",
"0.50720286",
"0.5015768",
"0.5000888",
"0.49928492",
"0.49025995",
"0.4899903",
"0.48216575",
"0.48141882",
"0.47807282",
"0.47081664",
"0.47042257",
"0.46806023",
"0.46723777",
"0.46351856",
"0.4622386",
"0.46098453",
"0.45622465",
"0.45604405",
"0.45599797",
"0.45515537",
"0.45075893",
"0.4488435",
"0.44827282",
"0.4481625",
"0.4460611",
"0.44585803",
"0.44583684",
"0.44423628"
] | 0.6478436 | 0 |
Test if a criteria is mergeable with the current criteria. | public function mergeable(Simples_Request_Search_Criteria $criteria) {
$data = $criteria->get() ;
foreach($data as $key => $value) {
if (isset($this->_data[$key])) {
return false ;
}
}
$options = $criteria->options() ;
foreach($options as $key => $value) {
if (isset($this->_options[$key])) {
return false ;
}
}
return true ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isMerging() : bool\n {\n\n return ( $this->mergeCols > 1 || $this->mergeRows > 1 );\n }",
"protected function getIsMerge($request) {\n\t\t$merge = $request->getVar('merge');\n\n\t\t// Default to false if not given\n\t\tif(!isset($merge)) {\n\t\t\tDeprecation::notice(\n\t\t\t\t\"4.0\",\n\t\t\t\t\"merge will be enabled by default in 4.0. Please use merge=false if you do not want to merge.\"\n\t\t\t);\n\t\t\treturn false;\n\t\t}\n\n\t\t// merge=0 or merge=false will disable merge\n\t\treturn !in_array($merge, array('0', 'false'));\n\t}",
"public function isMerged() : bool\n {\n\n return $this->merged;\n }",
"public function withinContributions()\n {\n if ( $this->_contrib_creation_date_begin != null\n || $this->_contrib_creation_date_end != null\n || $this->_contrib_begin_date_begin != null\n || $this->_contrib_begin_date_end != null\n || $this->_contrib_end_date_begin != null\n || $this->_contrib_begin_date_end != null\n || $this->_contrib_min_amount != null\n || $this->_contrib_max_amount != null\n || count($this->_contrib_dynamic) > 0\n || count($this->_contributions_types) > 0\n || count($this->_payments_types) > 0\n ) {\n return true;\n } else {\n return false;\n }\n }",
"public function criteriaHasJoin($criteria) {\n $criteriaArrHasJoin = is_array($criteria) && isset($criteria['join']);\n $criteriaObjHasJoin = $criteria instanceof TeaMysqlCriteria && isset($criteria->criteriaArr['join']);\n return $criteriaArrHasJoin || $criteriaObjHasJoin;\n }",
"public function hasCriteria() : bool;",
"public function hasCriterion()\n {\n return $this->criterion->hasCriterion();\n }",
"public function isCompliment()\r\n {\r\n $select = $this->_db->select();\r\n $select->from(array('zgm' => 'zanby_groups__members'), 'zgm.user_id')\r\n ->joinInner(array('zgi' => 'zanby_groups__items'), 'zgi.id = zgm.group_id')\r\n ->joinLeft(array('zgr' => 'zanby_groups__relations'), 'zgr.child_group_id = zgi.id')\r\n ->joinLeft(array('zgif' => 'zanby_groups__items'), 'zgif.id = zgr.parent_group_id')\r\n ->where('zgm.user_id = ?', $this->id)\r\n ->where('zgif.type IN (?)', 'family')\r\n ->where('zgif.payment_type IN (?)', 'business')\r\n ->where('zgi.type IN (?)', Warecorp_Group_Enum_GroupType::GROUP_TYPE_SIMPLE)\r\n ->where('zgm.is_approved', 1);\r\n $groups = $this->_db->fetchCol($select);\r\n\r\n return (bool) $groups;\r\n }",
"public function hasModifications(){\n return $this->_has(2);\n }",
"protected function skipMerge()\n {\n // In case for one reason composer.json or composer.lock have\n // dissappeared, we skip the merge as there is no reference\n // to start from..\n if ($this->areFilesMissing(array($this->jsonFile, $this->lockFile))) {\n return true;\n }\n\n // Determine if any changes have been made to composer settings\n if ($this->isStockComposer()) {\n $this->log(\"Skipping merge, stock composer settings detected\");\n return true;\n }\n\n return false;\n }",
"public function allowsOverlapping(): bool;",
"protected function hasAccessToJoin(array & $params)\n {\n if ( ! g()->auth->loggedIn() )\n {\n return false;\n }\n\n $group = $this->_getGroup(@$params[0], false);\n $group_id = $group['id'];\n $user_id = g()->auth->id();\n\n if ($group['leader_id'] == $user_id)\n {\n return false;\n }\n\n $membership_class = g()->load('GroupMembership', 'model');\n if (true === $membership_class::isMember($group_id, $user_id))\n {\n return false;\n }\n\n return g('Functions')->anyToBool($group['open']);\n }",
"public function hasJoins()\n {\n $result = false;\n foreach ($this->sorts as $sort)\n {\n if ($sort->hasJoins())\n {\n $result = true;\n break;\n }\n }\n return $result;\n }",
"function mergeFilterCriteriaObjects($criteria);",
"public function isSelectable() {\n\t\treturn $this->isAssociated() || $this->hasOptionsCallable() || !empty($this->_options) || $this->isTags() || $this->isType(self::FIELD_TYPE_SELECT);\n\t}",
"abstract public function hasJoins();",
"public function isSatisfiedBy($candidate): bool;",
"public function isSatisfiedBy($candidate): bool;",
"public function search($merge = null)\r\n {\r\n // @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n $criteria = new CDbCriteria;\r\n $criteria->with = array('company');\r\n\r\n $criteria->compare('t.id', $this->id);\r\n $criteria->compare('last_name', $this->last_name, true);\r\n $criteria->compare('email', $this->email, true);\r\n $criteria->compare('t.contact_number', $this->contact_number, true);\r\n $criteria->compare('date_of_birth', $this->date_of_birth, true);\r\n $criteria->compare('company', $this->company);\r\n $criteria->compare('company.name', $this->companyname, true);\r\n $criteria->compare('department', $this->department, true);\r\n $criteria->compare('position', $this->position, true);\r\n $criteria->compare('staff_id', $this->staff_id, true);\r\n $criteria->compare('photo', $this->photo, true);\r\n $criteria->compare('notes', $this->notes, true);\r\n $criteria->compare('role', $this->role);\r\n $criteria->compare('user_type', $this->user_type);\r\n $criteria->compare('user_status', $this->user_status);\r\n $criteria->compare('created_by', $this->created_by);\r\n $criteria->compare('t.is_deleted', $this->is_deleted);\r\n $criteria->compare('t.tenant', $this->tenant);\r\n $criteria->compare('t.tenant_agent', $this->tenant_agent);\r\n\r\n #$criteria->compare('workstation', $this->assignedWorkstations);\r\n #$criteria->with = array('userWorkstation1', 'company');\r\n $criteria->together = true;\r\n\r\n $user = User::model()->findByPK(Yii::app()->user->id);\r\n\r\n if (Yii::app()->controller->action->id == 'systemaccessrules') {\r\n $criteria->compare('CONCAT(first_name, \\' \\', last_name)', $this->first_name, true);\r\n } else {\r\n $criteria->compare('first_name', $this->first_name, true);\r\n }\r\n\r\n switch ($user->role) {\r\n case Roles::ROLE_ADMIN;\r\n case Roles::ROLE_ISSUING_BODY_ADMIN;\r\n if (Yii::app()->controller->action->id == 'systemaccessrules') {\r\n // $rolein = '(' . Roles::ROLE_AGENT_OPERATOR . ',' . Roles::ROLE_OPERATOR . ')';\r\n $avms_roles = Roles::get_admin_allowed_roles(true);\r\n \r\n //because of https://ids-jira.atlassian.net/browse/CAVMS-1209\r\n if(($key = array_search(Roles::ROLE_AGENT_AIRPORT_ADMIN, $avms_roles)) !== false) {\r\n unset($avms_roles[$key]);\r\n }\r\n if(($key = array_search(Roles::ROLE_AGENT_AIRPORT_OPERATOR, $avms_roles)) !== false) {\r\n unset($avms_roles[$key]);\r\n }\r\n $rolein = '(' . Roles::ROLE_AGENT_OPERATOR . ',' .\r\n Roles::ROLE_OPERATOR . ',' .\r\n Roles::ROLE_VISITOR . ',' .\r\n Roles::ROLE_STAFFMEMBER . ', '.\r\n //Roles::ROLE_AGENT_AIRPORT_OPERATOR . ', '.\r\n implode(',',$avms_roles). ')';\r\n } else {\r\n $avms_roles = Roles::get_admin_allowed_roles(true);\r\n $rolein = '(' . Roles::ROLE_ADMIN . ',' .\r\n Roles::ROLE_AGENT_ADMIN . ',' .\r\n Roles::ROLE_AGENT_OPERATOR . ',' .\r\n Roles::ROLE_OPERATOR . ',' .\r\n Roles::ROLE_VISITOR . ',' .\r\n Roles::ROLE_STAFFMEMBER . ', '.\r\n implode(',',$avms_roles). ')';\r\n }\r\n $queryCondition = \"t.tenant = \" . $user->tenant . \"\";\r\n break;\r\n case Roles::ROLE_AGENT_ADMIN:\r\n $avms_roles = Roles::get_agent_admin_allowed_roles(true);\r\n if (Yii::app()->controller->action->id == 'systemaccessrules') {\r\n $rolein = '(' . Roles::ROLE_AGENT_OPERATOR . ')';\r\n } else {\r\n $rolein = '(' . Roles::ROLE_AGENT_ADMIN . ',' .\r\n Roles::ROLE_AGENT_OPERATOR . ',' .\r\n Roles::ROLE_STAFFMEMBER . ',' .\r\n Roles::ROLE_VISITOR .','.\r\n implode(',',$avms_roles). ')';\r\n }\r\n\r\n $queryCondition = \"t.tenant_agent=\" . $user->tenant_agent . \"\";\r\n break;\r\n // Show in Listing \r\n case Roles::ROLE_AGENT_AIRPORT_ADMIN:\r\n $rolein = '('. \r\n Roles::ROLE_AGENT_AIRPORT_ADMIN . ',' . //because of https://ids-jira.atlassian.net/browse/CAVMS-1236\r\n Roles::ROLE_AGENT_OPERATOR . ',' .\r\n Roles::ROLE_STAFFMEMBER . ',' .\r\n Roles::ROLE_VISITOR . ', '.\r\n Roles::ROLE_AGENT_AIRPORT_OPERATOR. ')';\r\n $queryCondition = \"t.tenant_agent=\" . $user->tenant_agent . \"\";\r\n break;\r\n default:\r\n $avms_roles = Roles::get_avms_roles();\r\n if (Yii::app()->controller->action->id == 'systemaccessrules') {\r\n $rolein = '(' . Roles::ROLE_AGENT_OPERATOR . ',' . Roles::ROLE_OPERATOR . ')';\r\n } else {\r\n $rolein = '(' . Roles::ROLE_SUPERADMIN . ',' .\r\n Roles::ROLE_ADMIN . ',' .\r\n Roles::ROLE_AGENT_ADMIN . ',' .\r\n Roles::ROLE_AGENT_OPERATOR . ',' .\r\n Roles::ROLE_OPERATOR . ',' .\r\n Roles::ROLE_VISITOR . ',' .\r\n Roles::ROLE_STAFFMEMBER .\r\n implode(',',$avms_roles). ')';\r\n }\r\n\r\n $queryCondition = 't.is_deleted=0';\r\n break;\r\n }\r\n if (Yii::app()->controller->id == 'user' && Yii::app()->controller->action->id == 'admin') {\r\n $criteria->addCondition(\"t.id !=\" . $user->id . \" and role in \" . $rolein . \" and (\" . $queryCondition . \")\");\r\n } else {\r\n $criteria->addCondition(\"role in \" . $rolein . \" and (\" . $queryCondition . \")\");\r\n }\r\n\r\n\r\n\t\t// not to make already complex query, more complex, just using a sub query\r\n\t\t// get user id of all the users who belong to specified list..\r\n\t\t// and add IN clause to main search query...\r\n\t\t\r\n $is_avms_users_requested = CHelper::is_avms_users_requested();\r\n $is_cvms_users_requested = CHelper::is_cvms_users_requested();\r\n $users = [];\r\n \r\n if ($is_avms_users_requested || $is_cvms_users_requested) {\r\n if ($is_avms_users_requested) {\r\n $users = User::model()->avms_user()->findAll();\r\n } else {\r\n $users = User::model()->cvms_user()->findAll();\r\n }\r\n }\r\n\r\n if ($users) {\r\n $user_ids = array_values(CHtml::listData($users, 'id', 'id'));\r\n $criteria->addCondition(\"t.id in (\" . implode(\", \", $user_ids) . \") \");\r\n }\r\n\r\n if ($merge !== null) {\r\n $criteria->mergeWith($merge);\r\n }\r\n\r\n return new CActiveDataProvider($this, array(\r\n 'criteria' => $criteria,\r\n 'sort' => array(\r\n 'defaultOrder' => 't.ID DESC',\r\n 'attributes' => array(\r\n 'companyname' => array(\r\n 'asc' => 'company.name',\r\n 'desc' => 'company.name DESC',\r\n ),\r\n '*',\r\n ),\r\n ),\r\n ));\r\n }",
"function canSolve() {\n\n return ((Session::haveRight(self::$rightname, UPDATE)\n || $this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID())\n || (isset($_SESSION[\"glpigroups\"])\n && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION[\"glpigroups\"])))\n && self::isAllowedStatus($this->fields['status'], self::SOLVED)\n // No edition on closed status\n && !in_array($this->fields['status'], $this->getClosedStatusArray()));\n }",
"public function hasGrupoAvaliacaoSelecionada() {\n return $this->oGrupoAvaliacao instanceof AvaliacaoGrupo;\n }",
"public function isSatisfiedBy(GroupItem $item);",
"public static function searchable()\n {\n return parent::searchable() || ! empty(static::$searchRelations);\n }",
"public function checkGetRequestMergeFields(array $parameters, int $listId)\n {\n $mergeFields = $this->mailchimpAccessor->getMergeFields($listId);\n //If there are no merge fields for this list, then validation complete\n if (count($mergeFields) == 0) {\n return true;\n }\n foreach ($mergeFields as $field) {\n $parameterName = $this->parameterExists($field, $parameters);\n if (!$parameterName) {\n return false;\n }\n $numberOfChoices = count($field->choices);\n for ($i=0; $i < $numberOfChoices; $i++) {\n if ($parameters[$parameterName] == $field->choices[$i]->value) {\n break;\n }\n if ($i == ($numberOfChoices-1)) {\n return false;\n }\n }\n }\n return true;\n }",
"public function isComposite()\n {\n return $this->countFieldMappings() > 1;\n }",
"public function merge ($bonus, $exclude_mods = array()) {\r\n if (get_class($bonus) != 'Bonus') return FALSE;\r\n\r\n // Loop through the modifiers and add them together.\r\n foreach (static::$all_modifiers as $mod_name) {\r\n // Skip any excluded mods.\r\n if (in_array($mod_name, $exclude_mods)) continue;\r\n\r\n $mod = $bonus->$mod_name;\r\n foreach ($mod as $for => $list_or_value) {\r\n // If this is the default value, there's no list.\r\n if ($for == Bonus::FOR_DEFAULT) {\r\n $val = Bonus::adjust_modifier($list_or_value, Bonus::MOD_DIFF);\r\n $this->add_mod($mod_name, $val, $for);\r\n continue;\r\n }\r\n\r\n // Loop through the list of values to make sure they're copied over.\r\n foreach ($list_or_value as $type => $value) {\r\n $val = Bonus::adjust_modifier($value, Bonus::MOD_DIFF);\r\n $this->add_mod($mod_name, $val, Bonus::compile_for($for, $type));\r\n }\r\n }\r\n }\r\n\r\n return TRUE;\r\n }",
"public function shouldBeSearchable()\n {\n return $this->product && $this->shop;\n }",
"protected function isMergeableConstraint(array $where, $column)\n {\n return $where['type'] == 'Null' && $where['column'] == $column;\n }",
"public function usesMultiStockLicenceBehaviour(): bool\n {\n return $this->isMultiStock() || $this->isEcmtRemoval() || $this->isCertificateOfRoadworthiness();\n }",
"function merge ($second)\n\t{\n\t\tif (is_array($second)) {\n\t\t\t$this->parameters = self::merge_internal($this->parameters, \n\t\t\t\t$second);\n\t\t\treturn true;\n\t\t} else if ($second instanceof Pie_Parameters) {\n\t\t\t$this->parameters = self::merge_internal($this->parameters, \n\t\t\t\t$second->parameters);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}"
] | [
"0.6147773",
"0.6006859",
"0.59796065",
"0.55089647",
"0.5432328",
"0.53397834",
"0.52164495",
"0.51579773",
"0.51427984",
"0.5109943",
"0.5086297",
"0.50735253",
"0.5068835",
"0.5031025",
"0.5012326",
"0.49995852",
"0.497172",
"0.497172",
"0.49506682",
"0.4943553",
"0.49152488",
"0.4909202",
"0.4890232",
"0.4883399",
"0.48411748",
"0.48323154",
"0.48133236",
"0.47677475",
"0.47677338",
"0.47522315"
] | 0.7221538 | 0 |
Merge a criteria with current. | public function merge(Simples_Request_Search_Criteria $criteria) {
$this->_data = array_merge($this->_data, $criteria->get()) ;
unset($criteria) ;
return $this ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mergeFilterCriteriaObjects($criteria);",
"protected function applyCriteria()\n {\n if ($this->skipCriteria === true) {\n return $this;\n }\n $criteria = $this->getCriteria();\n if ($criteria) {\n foreach ($criteria as $c) {\n if ($c instanceof CriteriaContract) {\n $this->query = $c->apply($this->query, $this);\n }\n }\n }\n\n return $this;\n }",
"public function mergeWith($criteria,$fromScope=false)\n\t{\n\t\tif($criteria instanceof CDbCriteria)\n\t\t\t$criteria=$criteria->toArray();\n\t\tif($fromScope)\n\t\t{\n\t\t\tif(isset($criteria['condition']) && $this->on!==$criteria['condition'])\n\t\t\t{\n\t\t\t\tif($this->on==='')\n\t\t\t\t\t$this->on=$criteria['condition'];\n\t\t\t\telse if($criteria['condition']!=='')\n\t\t\t\t\t$this->on=\"({$this->on}) AND ({$criteria['condition']})\";\n\t\t\t}\n\t\t\tunset($criteria['condition']);\n\t\t}\n\n\t\tparent::mergeWith($criteria);\n\n\t\tif(isset($criteria['joinType']))\n\t\t\t$this->joinType=$criteria['joinType'];\n\n\t\tif(isset($criteria['on']) && $this->on!==$criteria['on'])\n\t\t{\n\t\t\tif($this->on==='')\n\t\t\t\t$this->on=$criteria['on'];\n\t\t\telse if($criteria['on']!=='')\n\t\t\t\t$this->on=\"({$this->on}) AND ({$criteria['on']})\";\n\t\t}\n\n\t\tif(isset($criteria['with']))\n\t\t\t$this->with=$criteria['with'];\n\n\t\tif(isset($criteria['alias']))\n\t\t\t$this->alias=$criteria['alias'];\n\n\t\tif(isset($criteria['together']))\n\t\t\t$this->together=$criteria['together'];\n\t}",
"public function getCriteriaCopy();",
"public function mergeable(Simples_Request_Search_Criteria $criteria) {\n\t\t$data =\t$criteria->get() ;\n\t\tforeach($data as $key => $value) {\n\t\t\tif (isset($this->_data[$key])) {\n\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\t$options = $criteria->options() ;\n\t\tforeach($options as $key => $value) {\n\t\t\tif (isset($this->_options[$key])) {\n\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}",
"public function pushCriteria($criteria);",
"public function mergeSphinxCriteria($sphinxCriteria) {\n\t\t$thisCriteria = $this->getSphinxCriteria();\n\t\t$thisCriteria->mergeWith($sphinxCriteria);\n\t\treturn $this;\n\t}",
"public function getCriteriaCopy()\n {\n return clone $this->criteria;\n }",
"public function setCriteria()\n {\n $this->criteria = $this->request->get('criteria', []);\n return $this;\n }",
"public function buildCriteria()\n\t{\n\t\t$criteria = new Criteria(AreaAdvocaciaPeer::DATABASE_NAME);\n\n\t\tif ($this->isColumnModified(AreaAdvocaciaPeer::ID)) $criteria->add(AreaAdvocaciaPeer::ID, $this->id);\n\t\tif ($this->isColumnModified(AreaAdvocaciaPeer::NOME)) $criteria->add(AreaAdvocaciaPeer::NOME, $this->nome);\n\n\t\treturn $criteria;\n\t}",
"protected function applyCriteria(CriteriaBuilder $builder) {\n foreach ($builder->getCriterias() as $criteria) {\n $this->entity = $criteria->apply($this->entity);\n }\n return $this;\n }",
"function __clone()\n\t{\n\t\tclone $this->criteria;\n\t}",
"public function merge();",
"public function setCriteria() {\n \n $this->rows\n ->where('t.list_id', '=', $this->list_id)\n ->where('t.item_id', '=', $this->item_id)\n ->where('t.task_type_id', '!=', \\App\\Http\\Controllers\\TasksController::TASK_TYPE_INFO);\n \n }",
"public function mergeWith( Scope $scope ): Scope;",
"public function mergeQuery($query);",
"public function merge()\n\t{\n\t\t\n\t}",
"public function buildCriteria()\n {\n $criteria = new Criteria(OrdencompraPeer::DATABASE_NAME);\n\n if ($this->isColumnModified(OrdencompraPeer::IDORDENCOMPRA)) $criteria->add(OrdencompraPeer::IDORDENCOMPRA, $this->idordencompra);\n if ($this->isColumnModified(OrdencompraPeer::IDPROVEEDOR)) $criteria->add(OrdencompraPeer::IDPROVEEDOR, $this->idproveedor);\n if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_NOFACTURA)) $criteria->add(OrdencompraPeer::ORDENCOMPRA_NOFACTURA, $this->ordencompra_nofactura);\n if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_FACTURAPDF)) $criteria->add(OrdencompraPeer::ORDENCOMPRA_FACTURAPDF, $this->ordencompra_facturapdf);\n if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_FECHA)) $criteria->add(OrdencompraPeer::ORDENCOMPRA_FECHA, $this->ordencompra_fecha);\n if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_IMPORTE)) $criteria->add(OrdencompraPeer::ORDENCOMPRA_IMPORTE, $this->ordencompra_importe);\n if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_STATUS)) $criteria->add(OrdencompraPeer::ORDENCOMPRA_STATUS, $this->ordencompra_status);\n if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_FECHAAPAGAR)) $criteria->add(OrdencompraPeer::ORDENCOMPRA_FECHAAPAGAR, $this->ordencompra_fechaapagar);\n\n return $criteria;\n }",
"public function applyQuery()\n {\n\n if ($this->querySkip) {\n return $this;\n }\n\n foreach($this->criteria as $query) {\n if ($query instanceof Query) {\n $this->model = $query->apply($this->model, $this);\n }\n }\n\n return $this;\n }",
"public function buildCriteria()\n {\n $criteria = new Criteria(SalesPersonTableMap::DATABASE_NAME);\n\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPSALEPER1)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPSALEPER1, $this->arspsaleper1);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPNAME)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPNAME, $this->arspname);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPMTDSALE)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPMTDSALE, $this->arspmtdsale);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPYTDSALE)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPYTDSALE, $this->arspytdsale);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPLTDSALE)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPLTDSALE, $this->arspltdsale);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPLASTSALEDATE)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPLASTSALEDATE, $this->arsplastsaledate);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPMTDCOMMEARN)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPMTDCOMMEARN, $this->arspmtdcommearn);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPYTDCOMMEARN)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPYTDCOMMEARN, $this->arspytdcommearn);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPLTDCOMMEARN)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPLTDCOMMEARN, $this->arspltdcommearn);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPMTDCOMMPAID)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPMTDCOMMPAID, $this->arspmtdcommpaid);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPYTDCOMMPAID)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPYTDCOMMPAID, $this->arspytdcommpaid);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPLTDCOMMPAID)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPLTDCOMMPAID, $this->arspltdcommpaid);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPCOMMCYCLE)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPCOMMCYCLE, $this->arspcommcycle);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPGRUP)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPGRUP, $this->arspgrup);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPLOGIN)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPLOGIN, $this->arsplogin);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPMGR)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPMGR, $this->arspmgr);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPVENDID)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPVENDID, $this->arspvendid);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPRESTRICTACCESS)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPRESTRICTACCESS, $this->arsprestrictaccess);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_ARSPEMAILADDR)) {\n $criteria->add(SalesPersonTableMap::COL_ARSPEMAILADDR, $this->arspemailaddr);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_DATEUPDTD)) {\n $criteria->add(SalesPersonTableMap::COL_DATEUPDTD, $this->dateupdtd);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_TIMEUPDTD)) {\n $criteria->add(SalesPersonTableMap::COL_TIMEUPDTD, $this->timeupdtd);\n }\n if ($this->isColumnModified(SalesPersonTableMap::COL_DUMMY)) {\n $criteria->add(SalesPersonTableMap::COL_DUMMY, $this->dummy);\n }\n\n return $criteria;\n }",
"public function merge_with( &$other ) {\n\t\t\tforeach ( $other->entries as $entry ) {\n\t\t\t\t$this->entries[ $entry->key() ] = $entry;\n\t\t\t}\n\t\t}",
"public function getLoadCriteria($current)\n {\n $criteria = $this->listCriteria();\n if (Tools::count($criteria) == 0) {\n return;\n }\n\n $result = '\n <select name=\"load_criteria\" onchange=\"this.form.submit();\" class=\"form-control select-standard\">\n <option value=\"\"></option>';\n\n foreach ($criteria as $name) {\n $result .= '<option value=\"'.htmlentities($name).'\"'.($name == $current ? ' selected' : '').'>'.htmlentities($name).'</option>';\n }\n\n $result .= '</select>';\n\n return $result;\n }",
"public function buildCriteria()\n {\n $criteria = new Criteria(RespuestaAplicadaTableMap::DATABASE_NAME);\n\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_C_ACTIVIDAD)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_C_ACTIVIDAD, $this->reap_c_actividad);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_NUMERO_DICTACION)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_NUMERO_DICTACION, $this->reap_numero_dictacion);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_C_EVALUACION)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_C_EVALUACION, $this->reap_c_evaluacion);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_NUMERO_EVALUACION)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_NUMERO_EVALUACION, $this->reap_numero_evaluacion);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_C_TRABAJADOR)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_C_TRABAJADOR, $this->reap_c_trabajador);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_C_PREGUNTA)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_C_PREGUNTA, $this->reap_c_pregunta);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_C_OPCION_PREGUNTA)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_C_OPCION_PREGUNTA, $this->reap_c_opcion_pregunta);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_E_RESPUESTA_APLICADA)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_E_RESPUESTA_APLICADA, $this->reap_e_respuesta_aplicada);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_VIGENTE)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_VIGENTE, $this->reap_vigente);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_HASH_MD5)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_HASH_MD5, $this->reap_hash_md5);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_R_FECHA_CREACION)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_R_FECHA_CREACION, $this->reap_r_fecha_creacion);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_R_FECHA_MODIFICACION)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_R_FECHA_MODIFICACION, $this->reap_r_fecha_modificacion);\n }\n if ($this->isColumnModified(RespuestaAplicadaTableMap::COL_REAP_R_USUARIO)) {\n $criteria->add(RespuestaAplicadaTableMap::COL_REAP_R_USUARIO, $this->reap_r_usuario);\n }\n\n return $criteria;\n }",
"abstract public function getCriteria();",
"function merge($entity);",
"public function buildCriteria()\n\t{\n\t\t$criteria = new Criteria(SfGuardUserProfilePeer::DATABASE_NAME);\n\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::USER_ID)) $criteria->add(SfGuardUserProfilePeer::USER_ID, $this->user_id);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::ID_DEPENDENCIA)) $criteria->add(SfGuardUserProfilePeer::ID_DEPENDENCIA, $this->id_dependencia);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::ID_CARGO)) $criteria->add(SfGuardUserProfilePeer::ID_CARGO, $this->id_cargo);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::NOMBRE1)) $criteria->add(SfGuardUserProfilePeer::NOMBRE1, $this->nombre1);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::NOMBRE2)) $criteria->add(SfGuardUserProfilePeer::NOMBRE2, $this->nombre2);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::APELLIDO1)) $criteria->add(SfGuardUserProfilePeer::APELLIDO1, $this->apellido1);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::APELLIDO2)) $criteria->add(SfGuardUserProfilePeer::APELLIDO2, $this->apellido2);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::CEDULA)) $criteria->add(SfGuardUserProfilePeer::CEDULA, $this->cedula);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::SEXO)) $criteria->add(SfGuardUserProfilePeer::SEXO, $this->sexo);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::NACIONALIDAD)) $criteria->add(SfGuardUserProfilePeer::NACIONALIDAD, $this->nacionalidad);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::FECHA_NACIMIENTO)) $criteria->add(SfGuardUserProfilePeer::FECHA_NACIMIENTO, $this->fecha_nacimiento);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::EXTENSION)) $criteria->add(SfGuardUserProfilePeer::EXTENSION, $this->extension);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::FECHA_INGRESO)) $criteria->add(SfGuardUserProfilePeer::FECHA_INGRESO, $this->fecha_ingreso);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::HORA_ENTRADA)) $criteria->add(SfGuardUserProfilePeer::HORA_ENTRADA, $this->hora_entrada);\n\t\tif ($this->isColumnModified(SfGuardUserProfilePeer::HORA_SALIDA)) $criteria->add(SfGuardUserProfilePeer::HORA_SALIDA, $this->hora_salida);\n\n\t\treturn $criteria;\n\t}",
"public function buildCriteria()\n {\n $criteria = new Criteria(JurusanSpPeer::DATABASE_NAME);\n\n if ($this->isColumnModified(JurusanSpPeer::JURUSAN_SP_ID)) $criteria->add(JurusanSpPeer::JURUSAN_SP_ID, $this->jurusan_sp_id);\n if ($this->isColumnModified(JurusanSpPeer::SEKOLAH_ID)) $criteria->add(JurusanSpPeer::SEKOLAH_ID, $this->sekolah_id);\n if ($this->isColumnModified(JurusanSpPeer::KEBUTUHAN_KHUSUS_ID)) $criteria->add(JurusanSpPeer::KEBUTUHAN_KHUSUS_ID, $this->kebutuhan_khusus_id);\n if ($this->isColumnModified(JurusanSpPeer::JURUSAN_ID)) $criteria->add(JurusanSpPeer::JURUSAN_ID, $this->jurusan_id);\n if ($this->isColumnModified(JurusanSpPeer::NAMA_JURUSAN_SP)) $criteria->add(JurusanSpPeer::NAMA_JURUSAN_SP, $this->nama_jurusan_sp);\n if ($this->isColumnModified(JurusanSpPeer::SK_IZIN)) $criteria->add(JurusanSpPeer::SK_IZIN, $this->sk_izin);\n if ($this->isColumnModified(JurusanSpPeer::TANGGAL_SK_IZIN)) $criteria->add(JurusanSpPeer::TANGGAL_SK_IZIN, $this->tanggal_sk_izin);\n if ($this->isColumnModified(JurusanSpPeer::CREATE_DATE)) $criteria->add(JurusanSpPeer::CREATE_DATE, $this->create_date);\n if ($this->isColumnModified(JurusanSpPeer::LAST_UPDATE)) $criteria->add(JurusanSpPeer::LAST_UPDATE, $this->last_update);\n if ($this->isColumnModified(JurusanSpPeer::SOFT_DELETE)) $criteria->add(JurusanSpPeer::SOFT_DELETE, $this->soft_delete);\n if ($this->isColumnModified(JurusanSpPeer::LAST_SYNC)) $criteria->add(JurusanSpPeer::LAST_SYNC, $this->last_sync);\n if ($this->isColumnModified(JurusanSpPeer::UPDATER_ID)) $criteria->add(JurusanSpPeer::UPDATER_ID, $this->updater_id);\n\n return $criteria;\n }",
"private function copyCriteriaConstraints($fromCriteria, $toCriteria)\n\t{\n\t\t$columns = $fromCriteria->keys();\n\t\t\n\t\tforeach ( $columns as $column )\n\t\t{\n\t\t\t$filterCriterion = $fromCriteria->getCriterion ( $column );\n\t\t\tif ($filterCriterion instanceof KalturaCriterion && !$filterCriterion->isEnabled())\n\t\t\t{\n\t\t\t\tKalturaLog::debug(\"Skip criterion[\" . $filterCriterion->getColumn() . \"] comparison [ \" . $filterCriterion->getComparison() . \" ] with disabled tag [ \" . print_r($filterCriterion->getTags(), true) . \" ]\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$newCriterion = $toCriteria->getNewCriterion ( $filterCriterion->getTable() . \".\" . $filterCriterion->getColumn() , $filterCriterion->getValue() , $filterCriterion->getComparison() );\n\t\t\t$existingCriterion = $toCriteria->getCriterion ( $column );\n\n\t\t\t// don't add duplicates !!\n\t\t\tif ( $existingCriterion && ( $existingCriterion->getValue() == $filterCriterion->getValue() && $existingCriterion->getComparison() == $filterCriterion->getComparison() ) ) \n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\t// go one step deeper to copy the inner clauses\n\t\t\t$this->addClauses( $fromCriteria , $filterCriterion , $newCriterion );\n\t\t\t$toCriteria->addAnd ( $newCriterion );\n\t\t}\n\t\t\n\n\t\t// TODO - adda more robust way to copy the orderBy from this->criteria\n\t\t$orderBy = $fromCriteria->getOrderByColumns();\n\t\tif ( $orderBy ) \n\t\t{\n\t\t\tforeach ( $orderBy as $orderByColumn ) \n\t\t\t{\n\t\t\t\t@list ( $name , $order ) = explode ( \" \" , $orderByColumn );\n\t\t\t\tif ( $order == Criteria::ASC )\n\t\t\t\t\t$toCriteria->addAscendingOrderByColumn ( $name );\n\t\t\t\telse\n\t\t\t\t\t$toCriteria->addDescendingOrderByColumn ( $name );\n\t\t\t}\n\t\t}\n\t}",
"public function merge(IdiormResultSet $result) {\r\n array_push($this->_results, $this->_results);\r\n return $this;\r\n }",
"function __clone() {\n\t\t$old = $this->conditions;\n\t\t$this->conditions = array();\n\t\tforeach($old as $condition)\n\t\t\t$this->conditions[] = clone $condition;\n\t}"
] | [
"0.6815711",
"0.5926628",
"0.58102727",
"0.5696129",
"0.5665454",
"0.55823356",
"0.5541321",
"0.5436801",
"0.525912",
"0.5236921",
"0.5215776",
"0.5188632",
"0.51752144",
"0.50609523",
"0.50408214",
"0.4987335",
"0.49472436",
"0.49462613",
"0.4927843",
"0.49192458",
"0.49123427",
"0.4911038",
"0.49056438",
"0.48728216",
"0.48447704",
"0.48421675",
"0.48413357",
"0.48207617",
"0.47944456",
"0.4790564"
] | 0.6942559 | 0 |
Set CSS content width | public function setContentWidth(): void
{
printf('<style>:root{ --content-width: %spx;}</style>', $this->contentWidth);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setWidth(): void\n {\n global $content_width;\n $content_width = $this->contentWidth;\n }",
"function set_content_width() {\r\n\r\n\t\t\t$content_width = 980;\r\n\r\n\t\t\t$GLOBALS['content_width'] = apply_filters( 'madara_content_width', $content_width );\r\n\t\t}",
"public function content_width()\n {\n $GLOBALS[ 'content_width' ] = apply_filters( 'content_width', 1440 );\n }",
"function yumc_content_width() {\n\t$GLOBALS['content_width'] = apply_filters( 'yumc_content_width', CONTENT_WIDTH );\n}",
"function stylish_content_width() {\n\tglobal $content_width;\n\t$content_width = apply_filters( 'stylish_content_width', 920 );\n}",
"function ekolok_content_width() {\n\t$GLOBALS['content_width'] = apply_filters( 'ekolok_content_width', 640 );\n}",
"function hola_elementor_content_width() {\n\t\t$defaultS['content_width'] = apply_filters( 'hola_elementor_content_width', 800 );\n\t}",
"function set_content_width() {\n\t\tglobal $content_width;\n\t\tif ( is_single() ) {\n\t\t\t$content_width = 960;\t\t\n\t\t} else {\n\t\t\t$content_width = 960;\n\t\t}\n\t}",
"public function content_width() {\n\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound\n\t\t$GLOBALS['content_width'] = 640;\n\t}",
"function setWidth( $value )\r\n {\r\n $this->Width = $value;\r\n }",
"function ezayo_content_width() {\n\n\t$GLOBALS['content_width'] = apply_filters( 'ezayo_content_width', 1100 );\n\n}",
"function asmi_content_width() {\n\t$GLOBALS['content_width'] = apply_filters( 'asmi_content_width', 720 );\n}",
"function aral_content_width() {\n\t$GLOBALS['content_width'] = apply_filters( 'aral_content_width', 640 );\n}",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"public function width($value) {\n return $this->setProperty('width', $value);\n }",
"function premise_content_width() {\n\t$GLOBALS['content_width'] = apply_filters( 'premise_content_width', 640 );\n}",
"function setWidth($width) {\n $this->width = $width;\n }",
"function setWidth($width)\n {\n $this->m_width=$width;\n }",
"public function width();",
"function setWidth($width) {\n\t\t$this->width = $width;\n\t}",
"function exodus_set_content_width() {\n\n\tglobal $content_width;\n\n\tif ( ! isset( $content_width ) ) {\n\n\t\t// Full page content\n\t\t$content_width = 1170;\n\n\t\t// Sideabar is used\n\t\tif ( exodus_sidebar_enabled() ) {\n\t\t\t$content_width = 780;\n\t\t}\n\n\t}\n\n}",
"function setWidth( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Width = $value;\n }",
"function bstone_content_width() {\r\n\t$GLOBALS['content_width'] = apply_filters( 'bstone_content_width', 640 );\r\n}"
] | [
"0.8147688",
"0.75801665",
"0.74825764",
"0.7216113",
"0.71553",
"0.70685685",
"0.70457816",
"0.7015606",
"0.7003132",
"0.6981643",
"0.6951112",
"0.68984485",
"0.68979925",
"0.68185264",
"0.68185264",
"0.68185264",
"0.68185264",
"0.68185264",
"0.68185264",
"0.68185264",
"0.68185264",
"0.68185264",
"0.677735",
"0.67765623",
"0.6767355",
"0.6760467",
"0.6727899",
"0.6709703",
"0.66970116",
"0.66963494"
] | 0.8492764 | 0 |
Check if the given session ID exists | protected function idExists($sessionID) {
return $this->client->exists($sessionID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function existSessionIdInDb() {\n\t\t$DBS = new DatabaseSession();\n\t\tif( $DBS->existSessionId($this->getSessionId()) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function validateId($id) : bool\n\t{\n\t\treturn $this->app->memcache->exists(\"session-{$id}\");\n\t}",
"public function existSessionId($sessionId) {\n\t\t$sqlQuery = sprintf(\"SELECT \".$this->getRows().\" FROM session WHERE session_id = '%s'\", $this->escapeString($sessionId) );\n\t\t$result = $this->getDb()->query($sqlQuery);\n\t\tif($result->num_rows > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function SessionExists(string $key) :bool;",
"public function check()\n {\n return isset($_SESSION['uuid']);\n }",
"private function validate_session_id($id)\n {\n $this->db->reset_query();\n $table = $this->db->escape_str($this->config['sess_save_path']);\n $sql = \"SELECT 1 FROM $table WHERE id = ? \";\n if ( ! empty($this->config['sess_match_ip']) ) {\n $sql .= \"AND ip_address = ?\";\n $query = $this->db->query($sql,[$id,$_SERVER['REMOTE_ADDR']]);\n } else {\n $query = $this->db->query($sql,[$id]);\n }\n\n $result = $query->row();\n\n if ( ! empty($result) ) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"function check_existing_session($cookie_containing_session){\n //TODO: santize to be safe\n \n $valid_session = false;\n\n $query = (\"SELECT * FROM sessions WHERE session_id='$cookie_containing_session'\");\n $dbConn = pgConnect();\n $results = pgQuery($dbConn, $query);\n //if (mysql_num_rows($result)==0) $valid_session = false; //not needed just for readability\n\n $tuple = pg_fetch_assoc($results);\n if(count($tuple) == 0) return $valid_session;\n if($tuple['session_id'] == $cookie_containing_session && $tuple['ipaddr']==$_SERVER['REMOTE_ADDR']) $valid_session = true; // if false delete session?\n // Could potentially delete session on server if that's more secure\n else{\n end_session();\n //courtest of http://stackoverflow.com/questions/686155/remove-a-cookie\n if (isset($_COOKIE['c_sId'])) {\n unset($_COOKIE['c_sId']);\n setcookie('c_sId', '', time() - 3600, '/'); // empty value and old timestamp\n // die(\"in loop\");\n }\n if (isset($_COOKIE['PHPSESSID'])) {\n unset($_COOKIE['PHPSESSID']);\n setcookie('PHPSESSID', '', time() - 3600, '/'); // empty value and old timestamp\n } \n } \n pgDisconnect($dbConn);\n return $valid_session;\n }",
"public function hasSession();",
"public function hasUserInSession(): bool\n {\n return $this->session->exists('id');\n }",
"public function hasSession () : bool;",
"function checkSession($sid)\n{\n // if session is active\n}",
"function invit0r_check_session()\r\n{\r\n\tglobal $invit0r_hasSession;\r\n\r\n\tif($invit0r_hasSession == false) {\r\n\t\treturn 0;\r\n\t}\r\n\treturn 1;\r\n}",
"function session_exists()\n {\n return session_status() == PHP_SESSION_ACTIVE;\n }",
"function tieneSesion(){\n session_start();\n return !( !isset($_SESSION['session-id']) ||\n ( $_SESSION[\"session-id\"] != session_id() ) );\n}",
"function jpid_session_isset( $key ) {\n\treturn JPID()->session->get( $key ) !== null;\n}",
"public function validateId($id): bool\n {\n try {\n if (\\preg_match('/^[a-zA-Z0-9-]{' . $this->lengthSessionID . '}+$/', $id) !== 1) {\n return false;\n }\n\n $sql = 'SELECT COUNT(id) FROM sessions WHERE id=:id';\n $params = ['id' => $id];\n $count = $this->db->count($sql, $params);\n\n return $count === 1;\n } catch (DatabaseException $e) {\n throw new SessionException('could not validate id: ' . $e->getMessage(), $e->getCode(), $e->getPrevious());\n }\n }",
"public function sessionExists()\n {\n return $this->fileLock->exists('login');\n }",
"public function checkSession()\n{\n $_session_id = $_SESSION['user_id'];\n $str = \"SELECT * FROM mw_users WHERE email='$_session_id'\";\n\t//Select users row from database base on $email\n $this->query($str);\n\t//Select the row\n\t$selection = $this->fetch();\n\t\t\n\t\t\n\tif($selection) {\n\t\t//Check ID and Token\n\t\tif(session_id() == $selection['session_id'] && $_SESSION['token'] == $selection['token']) {\n\t\t\t//Id and token match, refresh the session for the next request\n\t\t\t$this->refreshSession();\n\t\t\treturn true;\n\t\t}\n\t}\n\t\t\n\treturn false;\n}",
"public function sessionExists() {\n\t\tif(function_exists(\"\\\\session_status\")) return session_status() === PHP_SESSION_ACTIVE;\n\t\treturn session_id() !== '';\n\t}",
"public static function checkSession($session_id) { \n $client = self::getClient();\n $params = array(\n 'session' => $session_id\n );\n $result = $client->call(\"check_session\", $params); \n if(isset($result->status)) \n return $result->status;\n return false; \n }",
"function checkUserSession(){\n\tif (isset($_SESSION['user-id']) && $_SESSION['user-id'] != \"\") return true;\n\telse return false;\n}",
"private function sessionExist($id)\n {\n $session = $this->sessionDbConn\n ->select('session_data', 'session_expiration')\n ->from($this->sessionDbName)\n ->where('session_id', '=', $id)\n ->getOne();\n\n return $session;\n }",
"static public function check_uid(){\n\t\tglobal $db;\n\t\t//$this->check_logged_in();\n\t\t$sql = \"SELECT EXISTS(SELECT 1 FROM sessions WHERE user_id LIKE '\".$_SESSION['user_id'].\"'\nLIMIT 1)as exist\";\n\t\t$result = $db->query($sql) ;\n\t\t$row = $result->fetch_assoc();\n\t\treturn $row['exist'] ==1 ? true :false;\n\t}",
"function check_session($username){\n if ($username !== $_SESSION[\"id\"]){\n error_out(\"Invalid Session!\");\n }\n}",
"public function validateId($sessionId): bool\n {\n $sessionId = $this->db->escapeString($sessionId);\n $this->logger->debug(\n 'Check session with id ({id}) and time ({time}) ...',\n ['id' => $sessionId, 'time' => \\time()]\n );\n $rows = $this->db->query($this->createReadQuery($sessionId, \\time()));\n return $rows !== null\n && isset($rows[0]['sessionId'])\n && \\is_string($rows[0]['sessionId'])\n && $rows[0]['sessionId'] === $sessionId;\n }",
"public static function isAvailable()\n {\n return session_id() != '';\n }",
"public static function exists($name){\r\n return (isset($_SESSION[$name])) ? true : false;\r\n }",
"private function getSessionsAlreadyExist() {\n\t\t}",
"public function testGetValidFindsSessionById()\n {\n $this->mockSessionLookUp();\n $this->sessionsRepository->getValid(md5('existing session id'));\n }",
"public static function exists($key)\n {\n return (isset($_SESSION[$key])) ? true : false;\n }"
] | [
"0.7850985",
"0.75834453",
"0.75384104",
"0.73816615",
"0.73467636",
"0.7313832",
"0.717789",
"0.71666497",
"0.71053374",
"0.7072607",
"0.70602506",
"0.70412064",
"0.6971894",
"0.6937758",
"0.6880863",
"0.6875895",
"0.68491584",
"0.68383676",
"0.6834743",
"0.6833324",
"0.6809195",
"0.68019843",
"0.6799317",
"0.6799137",
"0.67976725",
"0.6772532",
"0.6740717",
"0.6709735",
"0.66958755",
"0.6692439"
] | 0.7948829 | 0 |
Return true if $field_name field exists in this collection | public function fieldExists($field_name)
{
return isset($this->fields[$field_name]) && $this->fields[$field_name] instanceof Field;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasFieldInfo($field_name);",
"public function hasField($name)\n {\n return isset($this->fields[$name]);\n }",
"public function hasField($name);",
"public function hasField(string $name) : bool;",
"function fieldExists($field);",
"public function hasField( $name ) {\n\t\treturn isset( $this->_fields[ $name ] );\n\t}",
"protected function _hasField($name)\n\t{\n\t\treturn isset($this->_fields[$name]);\n\t}",
"public function fieldExists($strField);",
"public function hasField($name) {\n\n foreach ($this->getFields() as $field) {\n if ($field->getRealName() == $name or $field->getName() == $name) {\n return true;\n }\n }\n if ($this->extends) {\n return $this->extends->hasField($name);\n }\n return false;\n }",
"public function fieldExists($fieldName)\n {\n return (isset($this->getFields()[$fieldName])) ? true : false;\n }",
"public function has(string $fieldName): bool\n {\n return array_key_exists($fieldName, $this->fields);\n }",
"public function hasField($field);",
"public function hasField($field);",
"public function hasField(string $fieldName): bool\n {\n return array_key_exists($fieldName, $this->data);\n }",
"public function fieldExists($fieldName)\n {\n if (!isset($this->fields->$fieldName)) {\n return false;\n } else {\n return true;\n }\n }",
"public function has($fieldName)\n {\n return \\array_key_exists($fieldName, $this->json);\n }",
"public function hasField($name)\n {\n // A Data field\n if (strpos($name, self::DATA_KEY . '[') === 0) {\n return true;\n }\n // A Settings field\n if (strpos($name, self::SETTINGS_KEY . '[') === 0) {\n return true;\n }\n return parent::hasField($name);\n }",
"public function fieldExistsInDB($field) {\n $result = db_select('visualscience_search_config', 'c')\n ->fields('c', array('name'))\n ->condition('name', $field['name'])\n ->range(0, 1)\n ->execute()\n ->rowCount();\n\n if ($result) {\n return TRUE;\n }\n return FALSE;\n }",
"public function existsField($key){ return array_key_exists($key,$this->field_map); }",
"public function existsField($key){ return array_key_exists($key,$this->field_map); }",
"public function __isset($name)\n\t{\n\t\treturn isset($this->_fields[$name]);\n\t}",
"public function __isset( $name ) {\n\t\treturn isset( $this->fields[$name] );\n\t}",
"public function field_exists($key) {\n return array_key_exists($key, $this->_data);\n }",
"public function hasField($public_field_name) {\n return isset($this->fields[$public_field_name]);\n }",
"public function isUnique($field_name)\n {\n return $this->fieldExists($field_name) && in_array($field_name, $this->unique_fields);\n }",
"public function _fieldExists($table,$field)\n\t{\n\t\treturn true;\n\t}",
"public function fieldExists($strField)\n {\n return false;\n }",
"public function hasField($field) \n\t{\n\t\t$existing = parent::hasField($field); \n\t\t// $val = $this->__get($field);\n\t\t// return !empty($val);\n\t\treturn $existing || ($this->cmisObject ? $this->cmisObject->hasProperty($field) : false);\n\t}",
"public function hasField($field)\n {\n return in_array($field, $this->fields);\n }",
"function __isset($field){\n\n return isset($this->_data[$field]);\n\n }"
] | [
"0.7858001",
"0.78406286",
"0.78063697",
"0.7765732",
"0.77618796",
"0.7749834",
"0.7732223",
"0.76192224",
"0.75534403",
"0.75473946",
"0.74910104",
"0.747168",
"0.747168",
"0.74581695",
"0.74534214",
"0.7401845",
"0.73863864",
"0.72491986",
"0.72181326",
"0.72181326",
"0.7203814",
"0.7200766",
"0.7162293",
"0.71566445",
"0.71148413",
"0.7089273",
"0.70841235",
"0.70817",
"0.70738983",
"0.70602524"
] | 0.8252263 | 0 |
Return true if $field_name is mapped | public function isMapped($field_name)
{
return $this->fieldExists($field_name) && in_array($field_name, $this->mapped_fields);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasFieldInfo($field_name);",
"public function hasField($name);",
"public function existsField($key){ return array_key_exists($key,$this->field_map); }",
"public function existsField($key){ return array_key_exists($key,$this->field_map); }",
"public function hasField(string $name) : bool;",
"public function hasField($key){ return !empty($this->field_map[$key]); }",
"public function hasField($key){ return !empty($this->field_map[$key]); }",
"public function fieldExists($field_name)\n {\n return isset($this->fields[$field_name]) && $this->fields[$field_name] instanceof Field;\n }",
"public function hasFields(){ return !empty($this->field_map); }",
"public function hasFields(){ return !empty($this->field_map); }",
"public function __can_map($name, $is_call = false) { return isset($this->mappers[$name]); }",
"function fieldExists($field);",
"public function hasField($name)\n {\n // A Data field\n if (strpos($name, self::DATA_KEY . '[') === 0) {\n return true;\n }\n // A Settings field\n if (strpos($name, self::SETTINGS_KEY . '[') === 0) {\n return true;\n }\n return parent::hasField($name);\n }",
"public function hasField($name)\n {\n return isset($this->fields[$name]);\n }",
"public function is_relatedField($namefield){\n $this->fieldsLink();//refresca la propiedad _linkFields\n // var_dump(array_keys($this->_linkFields));\n return in_array(trim($namefield),array_keys($this->_linkFields));\n }",
"protected function _hasField($name)\n\t{\n\t\treturn isset($this->_fields[$name]);\n\t}",
"public function hasField($field);",
"public function hasField($field);",
"private function hasMapping() {\n $mapping_link_storage = $this->entityTypeManager->getStorage('icecat_mapping');\n $mappings = $mapping_link_storage->loadByProperties([\n 'entity_type' => $this->entity->getEntityTypeId(),\n 'entity_type_bundle' => $this->entity->bundle(),\n ]);\n if (!empty($mappings)) {\n $this->entityMapping = reset($mappings);\n $this->fieldInfo = $this->entityFieldManager->getFieldDefinitions($this->entityMapping->getMappingEntityType(), $this->entityMapping->getMappingEntityBundle());\n return TRUE;\n }\n\n return FALSE;\n }",
"public function hasField( $name ) {\n\t\treturn isset( $this->_fields[ $name ] );\n\t}",
"private function formHasField($name)\n {\n $name = strtolower($name);\n\n foreach ($this->form->params->fields as $field)\n {\n if (!isset($field->name))\n {\n continue;\n }\n\n if (strtolower($field->name) == $name)\n {\n return true;\n }\n\n // In case a sub Smart Tag is being used. Eg: {field.dropdown.label} to get dropdown's selected text.\n if (strpos($name, $field->name . '.') !== false)\n {\n return true;\n }\n }\n\n return false;\n }",
"public function hasField($public_field_name) {\n return isset($this->fields[$public_field_name]);\n }",
"public function fieldExists($strField);",
"public function hasField($name) {\n\n foreach ($this->getFields() as $field) {\n if ($field->getRealName() == $name or $field->getName() == $name) {\n return true;\n }\n }\n if ($this->extends) {\n return $this->extends->hasField($name);\n }\n return false;\n }",
"function __isset($field){\n\n return isset($this->_data[$field]);\n\n }",
"public function fieldExists($fieldName)\n {\n if (!isset($this->fields->$fieldName)) {\n return false;\n } else {\n return true;\n }\n }",
"public function __isset(string $name): bool\n {\n return isset($this->fields[strtolower($name)]);\n }",
"public function __isset($name)\n\t{\n\t\treturn isset($this->_fields[$name]);\n\t}",
"public function requestedField(string $type, string $name): bool;",
"public function __isset( $name ) {\n\t\treturn isset( $this->fields[$name] );\n\t}"
] | [
"0.7581219",
"0.7308928",
"0.7176904",
"0.7176904",
"0.7174182",
"0.7062679",
"0.7062679",
"0.6841489",
"0.6826296",
"0.6826296",
"0.67279166",
"0.67072284",
"0.6705991",
"0.6700917",
"0.66956323",
"0.66355413",
"0.65930694",
"0.65930694",
"0.6559047",
"0.65572643",
"0.6528331",
"0.65086824",
"0.6496536",
"0.64934814",
"0.6483432",
"0.6479369",
"0.6438682",
"0.64384276",
"0.6419535",
"0.6387387"
] | 0.8421025 | 0 |
Return true if $field_name is unique in this storage | public function isUnique($field_name)
{
return $this->fieldExists($field_name) && in_array($field_name, $this->unique_fields);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isUnique($field)\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query\n\t\t\t->select($db->quoteName($field))\n\t\t\t->from($db->quoteName($this->_tbl))\n\t\t\t->where($db->quoteName($field) . ' = ' . $db->quote($this->$field))\n\t\t\t->where($db->quoteName('id') . ' <> ' . (int)$this->{$this->_tbl_key});\n\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn ($db->getNumRows() == 0) ? true : false;\n\t}",
"function checkUnique($data, $fieldName)\t{\n\t\t$valid = false;\n\t\tif ( isset($fieldName) && $this->hasField($fieldName)) {\n\t\t\t$valid = $this->isUnique(array($fieldName => $data));\n\t\t}\n\t\treturn $valid;\n\t}",
"public function hasUniqueFieldNames()\n {\n if ($this->fields->count() < 2) {\n // There are fewer than 2 fields. There couldn't possibly be duplicate field names.\n return true;\n }\n else {\n // Convert the fields property to array. It is easier to use php's ready array methods in this way.\n $fields = $this->fields->toArray();\n // Get all field names.\n $fieldNames = array_map(function($field) {\n return $field->getName();\n }, $fields);\n // Filter out duplicate field names.\n $uniqueFieldNames = array_unique($fieldNames, SORT_REGULAR);\n if (count($fieldNames) != count($uniqueFieldNames)) {\n // Some field names were filtered out, meaning that there were duplicates.\n return false;\n }\n\n // If this point is reached, no duplicates were found..\n return true;\n }\n }",
"public function isUnique($name)\n {\n return $this->findByName($name) === NULL;\n }",
"public static function isUniqueField($tablename, $field, $connection)\n\t{\n\t\t$query = $connection->query(\"SHOW INDEXES FROM $tablename WHERE Column_name='$field' AND Non_unique\");\n\t\t$query->execute();\n\t\tif(!$query->fetchAll()){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private function validate_uniqueness() {\n\t\t$is_unique = 0;\n\t\ttry {\n\t\t\t$is_unique = self::$model->is_unique_field($this->get_field_name(), $this->get_field());\n\t\t} catch( \\Exception $ex ) {\n\t\t\treturn $ex->getMessage();\n\t\t}\n\t\treturn ($is_unique !== 0 ? 1 : $this->get_pretty_field_name() . \" already exists.\");\n\t}",
"public function isUnique(): bool;",
"public function isUnique()\r\n\t{\r\n\t\treturn true;\r\n\t\t\r\n\t}",
"public function is_uniquem(string $field, string $column, string $form_key) : Bool\n\t{\n\t\t/**\n\t\t * run the query\n\t\t * return a maximum of 3 ignore\n\t\t * Ignoring any read roles permissions\n\t\t * if it's not unique then clearly it's it's not unique\n\t\t */\n\t\t$dbc = $this->_database->select($column.','.$this->primary_key)->where([$column=>$field])->get($this->table, 3);\n\n\t\t/* how many records where found? */\n\t\t$rows_found = $dbc->num_rows();\n\n\t\t/* none? then we are good! */\n\t\tif ($rows_found == 0) {\n\t\t\treturn true; /* test for really true === */\n\t\t}\n\n\t\t/* more than 1? that's really bad return false */\n\t\tif ($rows_found > 1) {\n\t\t\treturn false; /* test for really false === */\n\t\t}\n\n\t\t/* 1 record so do the keys match? */\n\t\treturn ($dbc->row()->{$this->primary_key} == get_instance()->input->request($form_key));\n\t}",
"function checkUnique ( $field, $compared )\n\t{\n\t\tglobal $db;\n\n\t\t$query = $db->getRow ( \"SELECT COUNT(*) as total FROM `\" . DBPREFIX . \"users` WHERE \" . $field . \" = \" . $db->qstr ( $compared ) );\n\n\t\tif ( $query->total == 0 ) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"function unique($field_name, $check_value, $table = '') {\n $rs = $this->_find(\n strlen($table) ? $this->_db->prefix . $table : $this->table,\n array('id'),\n array(sprintf('%s=%s', $field_name, is_numeric($check_value) ? $check_value : $this->_db->_connection->qstr($check_value))),\n 1, ITEMS_UNLIMITED\n );\n \n /* @var rs ADORecordSet */\n if ($rs->EOF) {\n \treturn true;\n }\n \n return false;\n }",
"public function isUniqueValue($strField, $varNew, $intId = null);",
"public function name_unique($name = NULL)\n {\n \t// check if ORM object is loaded and updating value\n \tif ($this->loaded() AND $this->name == $name)\n \t\treturn true;\n\n\t\t// check for ingredients with same name\n return ! ORM::factory('Ingredient', array('name' => $name))->loaded();\n }",
"function testForUniqueness($tblname,$fieldname,$value)\n\t\t{\n\t\t\t$query = \"select * from \".$tblname.\" where \".$fieldname.\"='\".$value.\"'\";\n\t\t\t$array=@mysql_query($query) or die(errorCatch(mysql_error()));\n\t\t\t$totalid=mysql_num_rows($array);\n\t\t\tif($totalid!=0)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}",
"function check_unique($field, $value)\n\t{\n\t\t$this->db->select($field);\n\t\t$this->db->where($field, $value);\n\t\t$this->db->limit(1);\n\t\t\n\t\treturn ($this->db->count_all_results($this->table) > 0) ? TRUE : FALSE;\n\t}",
"public function fieldExists($field_name)\n {\n return isset($this->fields[$field_name]) && $this->fields[$field_name] instanceof Field;\n }",
"public function hasField(string $name) : bool;",
"function validate_user_unique(string $field_value, array &$field): bool\n{\n\n $user = ['user_name' => $field_value];\n if (App\\App::$db->getRowsWhere('users', $user)) {\n $field['error'] = \"User $field_value already registered\";\n return false;\n }\n\n return true;\n}",
"public function __isset(string $name): bool\n {\n return isset($this->fields[strtolower($name)]);\n }",
"public function fieldExists($strField);",
"public function __isset($name)\r\n\t{\r\n\t\t$this->assert_not_trashed();\r\n\t\t\r\n\t\treturn isset($this->fields[$name]);\r\n\t}",
"public function unique_key_exists($value, $field = NULL)\n\t{\t\n\t\treturn (bool) DB::select(array('COUNT(\"*\")', 'total_count'))\n\t\t\t->from($this->_table_name)\n\t\t\t->where($field, '=', $value)\n\t\t\t->where($this->_primary_key, '!=', $this->pk())\n\t\t\t->execute($this->_db)\n\t\t\t->get('total_count');\n\t}",
"public function unique_key_exists($value, $field = NULL)\n\t{\t\n\t\treturn (bool) DB::select(array('COUNT(\"*\")', 'total_count'))\n\t\t\t->from($this->_table_name)\n\t\t\t->where($field, '=', $value)\n\t\t\t->where($this->_primary_key, '!=', $this->pk())\n\t\t\t->execute($this->_db)\n\t\t\t->get('total_count');\n\t}",
"public function fieldExists($strField)\n {\n return false;\n }",
"public function __isset( $name ) {\n\t\treturn isset( $this->fields[$name] );\n\t}",
"public function isUnique()\n {\n return $this->type == ModelInterface::INDEX_UNIQUE || $this->type == ModelInterface::INDEX_PRIMARY;\n }",
"public function isduplicate($tbname,$fieldname,$fieldvalue) {\n $this->db2->from($tbname);\n $this->db2->where($fieldname, $fieldvalue);\n $query = $this->db2->get();\n if ($query->num_rows() > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function IsFieldUnique($email)\n {\n\t \t$sql = \"SELECT COUNT(*) FROM (SELECT * FROM doctors WHERE email = :email) AS subquery\";\n\n\t $query = $this->db_connection->prepare($sql);\n\t $query->bindValue(':email', $email);\n\t $query->execute();\n\n while($result_row = $query->fetch() ){\n\t \tif($result_row[0] == 0) return true;\n\t \telse{\n $updateMerck = \"UPDATE doctors SET merck = true WHERE email = :email\";\n $query = $this->db_connection->prepare($updateMerck);\n $query->bindValue(':email', $email);\n $query->execute();\n return false;\n }\n }\n\n\t\treturn false; \n }",
"public function isUnique()\n {\n return (string) $this->constraintType === ConstraintType::UNIQUENESS;\n }",
"function fieldExists($field);"
] | [
"0.7424609",
"0.7225086",
"0.71636266",
"0.7139416",
"0.70435786",
"0.6907883",
"0.69076085",
"0.6819745",
"0.6733872",
"0.6679358",
"0.66574514",
"0.66175586",
"0.6610377",
"0.6607517",
"0.65624446",
"0.65155196",
"0.65143436",
"0.6447965",
"0.6409947",
"0.6402232",
"0.63632476",
"0.63607",
"0.63607",
"0.63522077",
"0.6349416",
"0.6347276",
"0.63465625",
"0.6329292",
"0.6309685",
"0.6308352"
] | 0.8310199 | 0 |
Build value map for the given field | public function buildValueMap($field_name)
{
$this->transaction(function ($t) use ($field_name) {
/** @var Redis $t */
$this->each(function($data) use (&$t, $field_name) {
$this->connection->sadd($this->getMapKeyByFieldAndValue($field_name, $data[$field_name]), $data['_id']);
});
});
if (!in_array($field_name, $this->mapped_fields)) {
$this->mapped_fields[] = $field_name;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function mapFieldValue($value);",
"protected function _convertField($field, $value)\n {\n if (ctype_upper($field)) {\n $field = strtolower($field);\n }\n if (ctype_upper(substr($field, -1, 1))) {\n $stringLength = strlen($field);\n $start = substr($field, 0, $stringLength - 1);\n $end = strtolower(substr($field, -1, 1));\n $field = $start . $end;\n }\n\n $field = lcfirst($field);\n\n if ($field === 'totalCostWithVAt') {\n $field = 'totalCostWithVat';\n }\n\n if (is_array($value)) {\n $newValue = array();\n foreach ($value as $k => $v) {\n $k = $this->_convertField($k, $v);\n if ($k['field'] == '_') {\n $k['field'] = 'value';\n }\n $newValue[$k['field']] = $v;\n }\n $objValue = new Varien_Object();\n $objValue->setData($newValue);\n $value = $objValue;\n }\n\n $field = preg_replace_callback(\n '/[A-Z]/',\n create_function(\n '$args',\n 'return \\'_\\' . strtolower($args[0]);'\n ),\n $field\n );\n\n return array('field' => $field, 'value' => $value);\n }",
"public function map($field)\n {\n return $this->withMeta([__FUNCTION__ => $field]);\n }",
"protected function get_field_map(){\n $this->get_fields();\n if(\n empty( $this->field_map ) && ! empty( $this->fields )\n || ! empty( $this->fields ) && count( $this->fields ) !== count( $this->field_map )\n\n ){\n /** @var Caldera_Forms_Entry_Field $field */\n foreach ( $this->fields as $index => $field ){\n if ( ! isset( $this->field_map[ $field->field_id ] ) ) {\n $this->field_map[$field->field_id] = $index;\n }\n }\n }\n\n return $this->field_map;\n\n\t}",
"function ZenFieldMap(&$zen) {\n $this->_zen =& $zen;\n $this->_session =& $zen->getSessionManager();\n $this->_fieldVals = array();\n }",
"public function getFieldValue($field);",
"public function buildFieldDefinitions();",
"private function _field_map(){\n\t\t$table = TableRegistry::get($this->source());\n\t\treturn $table->field_map();\n\t}",
"protected abstract function buildCustomMappings();",
"public function generateAndFill( $keyField, $valueField )\n\t{\n\t\t$this->first = strtotime( $this->getFirst( $keyField ) );\n\t\t$this->last = strtotime( $this->getLast( $keyField ) );\n\t\t$this->populateKeysFromField( $keyField );\n\t\t$previousValues = array_keys( $this->arrays );\n\t\tfor( $i = $this->first; $i <= $this->last; $i++ )\n\t\t{\n\t\t\t$interlation = array();\n\t\t\t\n\t\t\tforeach( $this->arrays as $key => $array )\n\t\t\t{\n\t\t\t\t$d = date('Y-m-d H:i:s', $i );\n\t\t\t\t$interlation[ $key ] = array();\n\t\t\t\tif( isset( $array[ $d ] ) )\n\t\t\t\t{\n\t\t\t\t\t$previousValues[ $key ] = $array[ $d ][ $valueField ];\n\t\t\t\t}\n\t\t\t\telseif( ! isset( $previousValues[ $key ] ) )\n\t\t\t\t{\n\t\t\t\t\t$previousValues[ $key ] = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$interlation[ $key ] = $previousValues[ $key ];\n\t\t\t}\n\t\t\t\n\t\n\t\t\t$this->interlaced[ $d ] = $interlation;\n\t\t}\n\t\t\n\t\t\n\t\treturn $this->interlaced;\n\t\t\n\t}",
"function getfield($field) {\n $return = [];\n if (fieldisyaml($field)) {\n $return = getstructure($field);\n } elseif(stringIsJson($field->value)) {\n $jsonvalue = json_decode($field->value);\n if ( gettype($jsonvalue) == 'array' ) {\n $return[$field->key()] = getarray(json_decode($field->value));\n } elseif(gettype($jsonvalue) == 'string' ) {\n $return[$field->key()] = $jsonvalue;\n }\n } else {\n $return['value'] = $field->value;\n $return['kirbytext'] = kirbytext($field->value);\n }\n return $return;\n }",
"function create_field($field)\n\t{\n\n\n global $post;\n\n ?>\n\n <div class=\"ve_map\">\n\n <?php \n \n /**\n * Get the meta\n * -------------------------------------------- */\n\n $data = $field['value'];\n $name = $this->try_get_value($data, 'name');\n $lat = $this->try_get_value($data, 'lat');\n $lng = $this->try_get_value($data, 'lng');\n $street = $this->try_get_value($data, 'street');\n $city = $this->try_get_value($data, 'city');\n $state = $this->try_get_value($data, 'state');\n $zip = $this->try_get_value($data, 'zip');\n $address = $this->try_get_value($data, 'address');\n $google_address = $this->try_get_value($data, 'google_address');\n \n ?>\n\n <fieldset>\n\n <p class=\"error-message\">Enter an address for the property.</p>\n\n <?php /* ?>\n <h4>How it works</h4>\n <ol>\n <li>Enter the property address into the \"Address Lookup Tool\" (directly below)</li>\n <li>Click \"Get Coordinates\"</li>\n <li>We fetch the latitude and longitude coordinates from Google, which are required for the search feature to work properly.</li>\n <li>The \"Street\", \"City\", \"State\", and \"Zip\" are for presentation purposes only and are not used in the search function, so feel free to change \"Pl\" to \"Place\", or \"Dr\" to \"Drive\"</li>\n </ol>\n\n <h4>Address Lookup Tool</h4>\n <?php */ ?>\n <p> <input type=\"text\" class=\"widefat\" placeholder=\"Enter the street address\" id=\"property-address\" name=\"<?php echo $field['name'] ?>[search_string]\" value=\"\" / > </p>\n <p> <a id=\"get-coordinates\" class=\"button-primary\" href=\"javascript:;\">Get Coordinates</a> </p>\n </fieldset>\n\n <div class=\"map\">\n <iframe id=\"property-iframe\" width=\"655\" height=\"350\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"<?php echo $url; ?>\"></iframe><br><a id=\"property-url\" target=\"_blank\" href=\"<?php echo $url ?>\">View Larger Map</a>\n </div>\n\n <fieldset class=\"address-info\">\n <p><b>Name</b> <input type=\"text\" id=\"property-name\" class=\"widefat\" name=\"<?php echo $field['name'] ?>[name]\" value=\"<?php echo $name ?>\" / > </p>\n <p><b>Street</b> <input type=\"text\" id=\"property-street\" class=\"widefat\" name=\"<?php echo $field['name'] ?>[street]\" value=\"<?php echo $street ?>\" / > </p>\n <p><b>City</b> <input type=\"text\" id=\"property-city\" class=\"widefat\" name=\"<?php echo $field['name'] ?>[city]\" value=\"<?php echo $city ?>\" / > </p>\n <p><b>State</b> <input type=\"text\" id=\"property-state\" class=\"widefat\" name=\"<?php echo $field['name'] ?>[state]\" value=\"<?php echo $state ?>\" / > </p>\n <p><b>Zip</b> <input type=\"text\" id=\"property-zip\" class=\"widefat\" name=\"<?php echo $field['name'] ?>[zip]\" value=\"<?php echo $zip ?>\" / > </p>\n <table>\n <tr>\n <td><b>Google Address:</b></td>\n <td><span id=\"google-address\"><?php echo $google_address ?></span></td>\n </tr>\n <tr>\n <td><b>Latitude:</b></td>\n <td><span id=\"lat\"><?php echo $lat ?></span></td>\n </tr>\n <tr>\n <td><b>Longitude:</b></td>\n <td><span id=\"lng\"><?php echo $lng ?></span></td>\n </tr>\n </table>\n <input class=\"required address\" type=\"hidden\" name=\"<?php echo $field['name'] ?>[address]\" value=\"<?php echo $address ?>\" />\n <input class=\"required google-address\" type=\"hidden\" name=\"<?php echo $field['name'] ?>[google_address]\" value=\"<?php echo $google_address ?>\" />\n <input class=\"required\" id=\"acf-property-lat\" type=\"hidden\" name=\"<?php echo $field['name'] ?>[lat]\" value=\"<?php echo $lat ?>\" />\n <input class=\"required\" id=\"acf-property-lng\" type=\"hidden\" name=\"<?php echo $field['name'] ?>[lng]\" value=\"<?php echo $lng ?>\" />\n <input class=\"required\" id=\"property-lat\" type=\"hidden\" name=\"_address_lat\" value=\"<?php echo $lat ?>\" />\n <input class=\"required\" id=\"property-lng\" type=\"hidden\" name=\"_address_lng\" value=\"<?php echo $lng ?>\" />\n </fieldset>\n\n </div>\n\n <div class=\"clear\"> </div>\n\n <?php\n \n \t}",
"public function getValue($field);",
"public function value($field);",
"private function buildField(\n $key,\n $typeMapping,\n \\ReflectionMethod $resolver = null,\n $args = null,\n $description = ''\n ) {\n //Eval is used to resolve custom scalar types like date\n $proxy = self::$proxy;\n $resolveFactory = function ($key, $eval) use ($resolver, $proxy) {\n return function ($val, $args) use ($key, $eval, $resolver, $proxy) {\n $fieldResolver = new FieldResolver($val, $resolver, $proxy);\n $result = $fieldResolver->resolve($key, $args);\n if (!$result instanceof PersistentCollection) {\n return $eval($result);\n }\n\n return array_map(function ($item) use ($eval) {\n return $eval($item);\n }, $result->toArray());\n };\n };\n\n return [\n 'description' => $description,\n 'type' => $typeMapping->type,\n 'args' => $args,\n 'resolve' => $resolveFactory($key, $typeMapping->eval)\n ];\n }",
"function create_field( $field )\n\t{\n\t\t// global\n\t\tglobal $post;\n\t\t\n\t\t\n\t\t// vars\n\t\t$args = array(\n\t\t\t'numberposts' => -1,\n\t\t\t'post_type' => null,\n\t\t\t'orderby' => 'title',\n\t\t\t'order' => 'ASC',\n\t\t\t'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'),\n\t\t\t'suppress_filters' => false,\n\t\t);\n\t\t\n\t\t\n\t\t// load all post types by default\n\t\tif( in_array('all', $field['post_type']) )\n\t\t{\n\t\t\t$field['post_type'] = apply_filters('acf/get_post_types', array());\n\t\t}\n\t\t\n\t\t\n\t\t// create tax queries\n\t\tif( ! in_array('all', $field['taxonomy']) )\n\t\t{\n\t\t\t// vars\n\t\t\t$taxonomies = array();\n\t\t\t$args['tax_query'] = array();\n\t\t\t\n\t\t\tforeach( $field['taxonomy'] as $v )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// find term (find taxonomy!)\n\t\t\t\t// $term = array( 0 => $taxonomy, 1 => $term_id )\n\t\t\t\t$term = explode(':', $v); \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// validate\n\t\t\t\tif( !is_array($term) || !isset($term[1]) )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// add to tax array\n\t\t\t\t$taxonomies[ $term[0] ][] = $term[1];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// now create the tax queries\n\t\t\tforeach( $taxonomies as $k => $v )\n\t\t\t{\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => $k,\n\t\t\t\t\t'field' => 'id',\n\t\t\t\t\t'terms' => $v,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Change Field into a select\n\t\t$field['type'] = 'select';\n\t\t$field['choices'] = array();\n\t\t\n\t\t\n\t\tforeach( $field['post_type'] as $post_type )\n\t\t{\n\t\t\t// set post_type\n\t\t\t$args['post_type'] = $post_type;\n\t\t\t\n\t\t\t\n\t\t\t// set order\n\t\t\t$get_pages = false;\n\t\t\tif( is_post_type_hierarchical($post_type) && !isset($args['tax_query']) )\n\t\t\t{\n\t\t\t\t$args['sort_column'] = 'menu_order, post_title';\n\t\t\t\t$args['sort_order'] = 'ASC';\n\t\t\t\t\n\t\t\t\t$get_pages = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// filters\n\t\t\t$args = apply_filters('acf/fields/post_object/query', $args, $field, $post);\n\t\t\t$args = apply_filters('acf/fields/post_object/query/name=' . $field['_name'], $args, $field, $post );\n\t\t\t$args = apply_filters('acf/fields/post_object/query/key=' . $field['key'], $args, $field, $post );\n\t\t\t\n\t\t\t\n\t\t\tif( $get_pages )\n\t\t\t{\n\t\t\t\t$posts = get_pages( $args );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$posts = get_posts( $args );\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($posts) {\n\t\t\t\t\n\t\t\t\tforeach( $posts as $p ) {\n\t\t\t\t\t\n\t\t\t\t\t// title\n\t\t\t\t\t$title = get_the_title( $p->ID );\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// empty\n\t\t\t\t\tif( $title === '' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$title = __('(no title)', 'acf');\n\t\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// ancestors\n\t\t\t\t\tif( $p->post_type != 'attachment' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ancestors = get_ancestors( $p->ID, $p->post_type );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$title = str_repeat('- ', count($ancestors)) . $title;\n\t\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// status\n\t\t\t\t\tif( get_post_status( $p->ID ) != \"publish\" ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$title .= ' (' . get_post_status( $p->ID ) . ')';\n\t\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// WPML\n\t\t\t\t\tif( defined('ICL_LANGUAGE_CODE') ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$title .= ' (' . ICL_LANGUAGE_CODE . ')';\n\t\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// filters\n\t\t\t\t\t$title = apply_filters('acf/fields/post_object/result', $title, $p, $field, $post);\n\t\t\t\t\t$title = apply_filters('acf/fields/post_object/result/name=' . $field['_name'] , $title, $p, $field, $post);\n\t\t\t\t\t$title = apply_filters('acf/fields/post_object/result/key=' . $field['key'], $title, $p, $field, $post);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// add to choices\n\t\t\t\t\tif( count($field['post_type']) == 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$field['choices'][ $p->ID ] = $title;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// group by post type\n\t\t\t\t\t\t$post_type_object = get_post_type_object( $p->post_type );\n\t\t\t\t\t\t$post_type_name = $post_type_object->labels->name;\n\t\t\t\t\t\n\t\t\t\t\t\t$field['choices'][ $post_type_name ][ $p->ID ] = $title;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// foreach( $posts as $post )\n\t\t\t}\n\t\t\t// if($posts)\n\t\t}\n\t\t// foreach( $field['post_type'] as $post_type )\n\t\t\n\t\t\n\t\t// create field\n\t\tdo_action('acf/create_field', $field );\n\t}",
"protected function &getNestedValueReference($field)\n\t{\n\t\t$field = preg_split('(__([0-9]+)__)', substr($field, 11), -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\tif (!isset($this->saveData[$field[0]])) {\n\t\t\t$this->saveData[$field[0]] = array();\n\t\t}\n\n\t\t$data =& $this->saveData[$field[0]];\n\n\t\tfor ($i = 0; isset($field[$i]); $i += 2) {\n\n\t\t\tif (isset($field[$i + 1])) {\n\t\t\t\tif (!isset($data[$field[$i + 1]])) {\n\t\t\t\t\t$data[$field[$i + 1]] = array();\n\t\t\t\t}\n\t\t\t\tif (!isset($data[$field[$i + 1]][$field[$i + 2]])) {\n\t\t\t\t\t$data[$field[$i + 1]][$field[$i + 2]] = array();\n\t\t\t\t}\n\t\t\t\t$data =& $data[$field[$i + 1]][$field[$i + 2]];\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $data;\n\t\t\t}\n\n\t\t}\n\t}",
"public static function fieldMap($fields, $structs)\n {\n // Holders\n $map = [];\n\n // Loop our fields and map them\n foreach ($fields as $value) {\n // Compute short name for matching type\n $shortType = trim(explode('(', $value->Type)[0]);\n switch ($shortType) {\n // Custom handler\n case Types::TIMESTAMP:\n $type = 'TIMESTAMP';\n break;\n // Custom handler\n case Types::INT:\n $type = 'INTEGER';\n break;\n // Custom handler\n case Types::TINYINT:\n $type = 'INTEGER';\n break;\n case Types::BIGINT:\n $type = 'INTEGER';\n break;\n case Types::BOOLEAN:\n $type = 'BOOLEAN';\n break;\n case Types::DATE:\n $type = 'DATETIME';\n break;\n case Types::DATETIME:\n $type = 'DATETIME';\n break;\n case Types::DECIMAL:\n $type = 'FLOAT';\n break;\n case Types::FLOAT:\n $type = 'FLOAT';\n break;\n case Types::INTEGER:\n $type = 'INTEGER';\n break;\n case Types::SMALLINT:\n $type = 'INTEGER';\n break;\n case Types::TIME:\n $type = 'TIME';\n break;\n case Types::DOUBLE:\n $type = 'FLOAT';\n break;\n case Types::JSON:\n // JSON data-types require a struct to be defined, here we check for developer hints or skip these\n if (!empty($structs)) {\n $struct = $structs[$value->Field];\n } else {\n continue 2;\n }\n\n $type = 'STRUCT';\n\n break;\n default:\n $type = 'STRING';\n break;\n }\n\n // Nullable handler\n $mode = (strtolower($value->Null) === 'yes' ? 'NULLABLE' : 'REQUIRED');\n\n // Construct our BQ schema data\n $fieldData = [\n 'name' => $value->Field,\n 'type' => $type,\n 'mode' => $mode,\n ];\n\n // Set our struct definition if we have one\n if (!empty($struct)) {\n $fieldData['fields'] = $struct;\n\n unset($struct);\n }\n\n $map[] = $fieldData;\n }\n\n // Return our map\n return $map;\n }",
"function pcp_get_field( $field_cfg, $map_name='', $field_name='' )\n{\n global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;\n\n $res = array();\n $found = false;\n if ( empty($field_name) )\n {\n @reset($user_fields);\n while ( list($field_name, $field_data) = @each($user_fields) )\n {\n $found = ($field_data[$field_name]['input_id'] == $field_cfg);\n if ( $found )\n {\n break;\n }\n }\n if ( !$found )\n {\n $field_name = $field_cfg;\n }\n }\n\n // get the field definition\n $field_data = $user_fields[$field_name];\n\n // overwrite by the map definition\n @reset($user_maps[$map_name]['fields'][$field_name]);\n while ( list($key, $value) = @each($user_maps[$map_name]['fields'][$field_name]) )\n {\n $field_data[$key] = $value;\n }\n\n // parse the default value\n if ( !empty($field_data['default']) || ($field_data['default'] == \"0\") )\n {\n $tables_used = array();\n $field_data['default'] = pcp_parse_def($field_data['default'], $userdata, $tables_used);\n }\n\n // solve values list\n if ( !empty($field_data['values']) && is_string($field_data['values']) )\n {\n // if list drop force the img/txt set\n if ( ($field_data['get_mode'] == 'LIST_DROP') && $field_data['img'] )\n {\n $field_data['img'] = false;\n $field_data['txt'] = true;\n }\n $field_data['values'] = pcp_get_values_list($field_name, $field_data, $map_name);\n if ( empty($field_data['values']) )\n {\n $field_data['default'] = '';\n }\n else\n {\n // check if the default value is in the values list\n @reset($field_data['values']);\n $found = false;\n while ( list($value, $key) = @each($field_data['values']) )\n {\n $found = ( $field_data['default'] == $key );\n if ( $found )\n {\n break;\n }\n }\n if ( !$found )\n {\n $first_key = '';\n @reset($field_data['values']);\n list($first_value, $first_key) = @each($field_data['values']);\n $field_data['default'] = $first_key;\n }\n }\n }\n\n // get back values\n $res = $field_data;\n\n // fill the necessary entries for mods_settings\n $res['user'] = $field_name;\n if ( !empty($res['get_mode']) )\n {\n $res['type'] = $res['get_mode'];\n }\n else if ( !empty($res['get_func']) || !empty($res['chk_func']) )\n {\n $res['type'] = '';\n }\n return $res;\n}",
"private function initialize_mailchimp_field_value_variables( $field_key ) {\n\t\t$html_name = '';\n\t\t$field = FrmField::getOne( $field_key );\n\n\t\treturn array( $html_name, $field );\n\t}",
"public static function build_field_map_dropdown($field_map_array) {\n\n foreach ($field_map_array as $key => $label_map_array) {\n\n $field_map_dropdown[] = array(\n 'label' => $label_map_array['label'],\n 'value' => $key,\n );\n }\n\n return $field_map_dropdown;\n }",
"function wppb_save_map_value( $field, $user_id, $request_data, $form_location ){\r\n\r\n if( $field['field'] == 'Map' && $field['meta-name'] == wppb_handle_meta_name( $field['meta-name'] ) ){\r\n\r\n // Remove all existing markers\r\n wppb_delete_user_map_markers( $user_id, wppb_handle_meta_name( $field['meta-name'] ) );\r\n\r\n // Add markers if they exist\r\n if ( isset( $request_data[wppb_handle_meta_name( $field['meta-name'] )] ) ) {\r\n\r\n // Add new markers\r\n if( is_array( $request_data[wppb_handle_meta_name( $field['meta-name'] )] ) ) {\r\n foreach( $request_data[wppb_handle_meta_name( $field['meta-name'] )] as $key => $position )\r\n update_user_meta( $user_id, $field['meta-name'] . '_' . $key, $position );\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n}",
"public function mapToValues(): self\n {\n return $this->map(function (AbstractField $field) {\n return $field->getValue();\n });\n }",
"protected function initializeValueSettingByFieldName($fieldName) {\n\n\t\tif (!isset($this->settings['value']) && array_key_exists($fieldName, $this->gp)) {\n\t\t\t$this->settings['value'] = $this->gp[$this->settings['field']];\n\t\t}\n\t}",
"public function add_field( $field )\n\t{\n\t\t$field = $this->create_field( $field );\n\n\t\t// Register\n\t\t$this->fields[ $field['key'] ] = $field;\n\t}",
"public function toMap(){\n\t\t$data = array();\n\t\t$myFields = get_class_vars(get_called_class());\n\t\t$parentFields = get_class_vars('ViewableData');\n\t\tforeach(array_keys($myFields) as $field){\n\t\t\tif(array_key_exists($field, $parentFields)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$data[$field] = $this->$field;\n\t\t}\n\t\treturn $data;\n\t}",
"public function map()\n {\n $type = $this->resolveType();\n foreach ($this->fieldsMap as $dinteroField => $magentoField) {\n if ($value = $this->dataObject->getDataByPath(sprintf('%s/%s', $type, $dinteroField))) {\n $this->address->setData($magentoField, $value);\n }\n }\n }",
"function create_field($field)\n\t{\n\t\t// Defaults\n\t\t$field['value'] = isset($field['value']) ? $field['value'] : array();\n\t\t$field['optgroup'] = isset($field['optgroup']) ? $field['optgroup'] : false;\n\t\t\n\t\t// Get all Flickr sets by the given user ID and api key (both required)\n\t\trequire_once(dirname(__FILE__) . '/phpFlickr.php');\n\t\t$f = new phpFlickr($field['api_key']);\n\t\t\n\t\t// Optionally enable the phpFlickr cache - make sure the folder cache is properly placed\n\t\t// $f->enableCache(\"fs\", dirname(__FILE__) . '/cache');\t\t\n\t\t\n\t\t// Get all sets by user ID ordered by post_date desc and limit to max 50 sets\n\t\t$user_id = $field['user_id'];\n\t\t\n\t\t// Include fields.css from the ACF plugin for some more styling\n\t\twp_register_style('fields-css',get_bloginfo('wpurl'). '/wp-content/plugins/advanced-custom-fields/css/fields.css');\n\t\twp_enqueue_style('fields-css');\n\t\t\n\t\t$field['choices'] = array();\n\t\t$field['choices'][''] = '';\n\n\t\t?>\n\t\t\n\t\t<div class=\"field_form flickr_field\">\n\t\t\t<table class=\"acf_input widefat acf_field_form_table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\t// Check what kind of Flickr content should be displayed\n\t\t\t\t\tswitch($field['flickr_content']) {\n\t\t\t\t\t\tcase 'galleries':\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$flickr_data = $f->galleries_getList($user_id, 50, 1);\n\t\t\t\t\t\t\tif (is_array($flickr_data) && !empty($flickr_data)) {\n\t\t\t\t\t\t\t\tforeach($flickr_data['galleries']['gallery'] as $key => $flickr) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<tr class=\"field_label flickr_row <?php if ($field['value'] == $flickr['id']) echo 'active-row'; ?>\" data-flickr-id=\"<?php echo $flickr['id']; ?>\">\n\t\t\t\t\t\t\t\t\t\t<td class=\"label set_image\">\n\t\t\t\t\t\t\t\t\t\t\t<img title=\"<?php echo $flickr['title'];?>\" src=\"http://farm<?php echo $flickr['primary_photo_farm'];?>.static.flickr.com/<?php echo $flickr['primary_photo_server'];?>/<?php echo $flickr['primary_photo_id'];?>_<?php echo $flickr['primary_photo_secret'];?>_s.jpg\">\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"set_info\">\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"set_title\"><?php echo $flickr['title'];?></p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"description\"><?php echo $flickr['description'];?></p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"meta_data\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php _e('Added on');?> <?php echo date_i18n(get_option('date_format') ,$flickr['date_create']); echo ' | ';\n\t\t\t\t\t\t\t\t\t\t\t\techo $flickr['count_views'];?> <?php _e('views on Flickr'); \n\t\t\t\t\t\t\t\t\t\t\t\techo ' | ';\n\t\t\t\t\t\t\t\t\t\t\t\techo $flickr['count_photos'];?> <?php _e('Photos');\n\t\t\t\t\t\t\t\t\t\t\t\tif ($flickr['count_videos'] != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo ' | '. $flickr['videos'] .' ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t_e('Videos');\n\t\t\t\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t?><tr class=\"field_label\">\n\t\t\t\t\t\t\t\t\t<td colspan=\"2\"><?php _e('There are no Flickr galleries available for user ID'); ?> <?php echo $user_id; ?> <?php _e('or there is a problem with API KEY'); ?> <?php echo $field['api_key']; ?></td>\n\t\t\t\t\t\t\t\t</tr><?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$flickr_data = $f->photosets_getList($user_id, 50, 1);\n\t\t\t\t\t\t\tif (is_array($flickr_data) && !empty($flickr_data)) {\n\t\t\t\t\t\t\t\tforeach($flickr_data['photoset'] as $key => $flickr) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<tr class=\"field_label flickr_row <?php if ($field['value'] == $flickr['id']) echo 'active-row'; ?>\" data-flickr-id=\"<?php echo $flickr['id']; ?>\">\n\t\t\t\t\t\t\t\t\t\t<td class=\"label set_image\">\n\t\t\t\t\t\t\t\t\t\t\t<img title=\"<?php echo $flickr['title'];?>\" src=\"http://farm<?php echo $flickr['farm'];?>.static.flickr.com/<?php echo $flickr['server'];?>/<?php echo $flickr['primary'];?>_<?php echo $flickr['secret'];?>_s.jpg\">\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"set_info\">\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"set_title\"><?php echo $flickr['title'];?></p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"description\"><?php echo $flickr['description'];?></p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"meta_data\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php _e('Added on');?> <?php echo date_i18n(get_option('date_format') ,$flickr['date_create']); echo ' | ';\n\t\t\t\t\t\t\t\t\t\t\t\techo $flickr['count_views'];?> <?php _e('views on Flickr'); \n\t\t\t\t\t\t\t\t\t\t\t\techo ' | ';\n\t\t\t\t\t\t\t\t\t\t\t\techo $flickr['photos'];?> <?php _e('Photos');\n\t\t\t\t\t\t\t\t\t\t\t\tif ($flickr['videos'] != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo ' | '. $flickr['videos'] .' ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t_e('Videos');\n\t\t\t\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t<?php\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\telse {\n\t\t\t\t\t\t\t\t?><tr class=\"field_label\">\n\t\t\t\t\t\t\t\t\t<td colspan=\"2\"><?php _e('There are no Flickr sets available for user ID'); ?> <?php echo $user_id; ?> <?php _e('or there is a problem with API KEY'); ?> <?php echo $field['api_key']; ?></td>\n\t\t\t\t\t\t\t\t</tr><?php\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t\n\t\t<?php \n\t\tif (!empty($sets['photoset'])) {\n\t\t\tforeach($sets['photoset'] as $set_key => $set) {\n\t\t\t\t// Add to the choices array for the selectbox\n\t\t\t\t$field['choices'][$set['id']] = $set['title'] .' (' .$set['photos']. ' photos)';\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// no choices\n\t\tif(empty($field['choices']))\n\t\t{\n\t\t\techo '<p>' . __(\"No choices to choose from\",'acf') . '</p>';\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// html\n\t\techo '<select id=\"' . $field['name'] . '\" class=\"' . $field['class'] . '\" name=\"' . $field['name'] . '\" ' . $multiple . ' >';\t\n\t\t\n\t\t// null\n\t\tif($field['allow_null'] == '1')\n\t\t{\n\t\t\techo '<option value=\"null\"> - Select - </option>';\n\t\t}\n\t\t\n\t\t// loop through values and add them as options\n\t\tforeach($field['choices'] as $key => $value)\n\t\t{\n\t\t\tif($field['optgroup'])\n\t\t\t{\n\t\t\t\t// this select is grouped with optgroup\n\t\t\t\tif($key != '') echo '<optgroup label=\"'.$key.'\">';\n\t\t\t\t\n\t\t\t\tif($value)\n\t\t\t\t{\n\t\t\t\t\tforeach($value as $id => $label)\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = '';\n\t\t\t\t\t\tif(is_array($field['value']) && in_array($id, $field['value']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// 2. If the value is an array (multiple select), loop through values and check if it is selected\n\t\t\t\t\t\t\t$selected = 'selected=\"selected\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// 3. this is not a multiple select, just check normaly\n\t\t\t\t\t\t\tif($id == $field['value'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$selected = 'selected=\"selected\"';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\techo '<option value=\"'.$id.'\" '.$selected.'>'.$label.'</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($key != '') echo '</optgroup>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$selected = '';\n\t\t\t\tif(is_array($field['value']) && in_array($key, $field['value']))\n\t\t\t\t{\n\t\t\t\t\t// 2. If the value is an array (multiple select), loop through values and check if it is selected\n\t\t\t\t\t$selected = 'selected=\"selected\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// 3. this is not a multiple select, just check normaly\n\t\t\t\t\tif($key == $field['value'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = 'selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\techo '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\techo '</select>';\n\t\t\n\t}",
"function get_field_value($field_source)\n\t{\n\t\tglobal $db, $dbs, $dbe, $table_prefix, $db_columns, $related_columns, $related_table_alias, $apply_translation, $date_formats, $date_edit_format, $datetime_edit_format;\n\n\t\tif (preg_match_all(\"/\\{(\\w+)\\}/i\", $field_source, $matches)) {\n\t\t\t$field_value = $field_source;\n\t\t\tfor($p = 0; $p < sizeof($matches[1]); $p++) {\n\t\t\t\t$f_source = $matches[1][$p];\n\t\t\t\t$f_source_value = \"\"; \n\t\t\t\t// get field type\n\t\t\t\t$column_type = TEXT; $column_name = \"\"; $column_format = \"\"; \t\t\t\t\n\t\t\t\tif (preg_match(\"/^order_property_/\", $f_source)) {\n\t\t\t\t\t$column_code = substr($f_source, 15);\n\t\t\t\t\t$order_id = $dbe->f(\"order_id\");\n\t\t\t\t\t$order_properties = array();\n\t\t\t\t\t$properties_ids = array();\n\t\t\t\t\tif (preg_match(\"/^\\d+$/\", $column_code)) {\n\t\t\t\t\t\t$properties_ids[] = $column_code;\n\t\t\t\t\t} else { \n\t\t\t\t\t\t$sql = \" SELECT property_id \"; \n\t\t\t\t\t\t$sql .= \" FROM \" . $table_prefix . \"order_custom_properties ocp \";\n\t\t\t\t\t\t$sql .= \" WHERE property_code=\" . $db->tosql($column_code, TEXT);\n\t\t\t\t\t\t$dbs->query($sql);\n\t\t\t\t\t\twhile ($dbs->next_record()) {\n\t\t\t\t\t\t\t$property_id = $dbs->f(\"property_id\");\n\t\t\t\t\t\t\t$properties_ids[] = $property_id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (count($properties_ids)) {\n\t\t\t\t\t\t$sql = \" SELECT op.property_id, op.property_type, op.property_name, op.property_value, \";\n\t\t\t\t\t\t$sql .= \" op.property_price, op.property_points_amount, op.tax_free \";\n\t\t\t\t\t\t$sql .= \" FROM \" . $table_prefix . \"orders_properties op \";\n\t\t\t\t\t\t$sql .= \" WHERE op.order_id=\" . $dbe->tosql($order_id, INTEGER);\n\t\t\t\t\t\t$sql .= \" AND op.property_id IN (\" . $dbe->tosql($properties_ids, INTEGERS_LIST) . \") \";\n\t\t\t\t\t\t$dbs->query($sql);\n\t\t\t\t\t\twhile ($dbs->next_record()) {\n\t\t\t\t\t\t\t$property_value = $dbs->f(\"property_value\");\n\t\t\t\t\t\t\tif (strlen($f_source_value)) { $f_source_value .= \"; \"; }\n\t\t\t\t\t\t\tif ($apply_translation) {\n\t\t\t\t\t\t\t\t$f_source_value .= get_translation($property_value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$f_source_value .= $property_value;\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} else if (preg_match(\"/^oi_order_item_property_/\", $f_source)) {\n\t\t\t\t\t$property_id = substr($f_source, 23);\n\t\t\t\t\t$order_item_id = $dbe->f(\"oi_order_item_id\");\n\t\t\t\t\t$sql = \" SELECT property_value FROM \" . $table_prefix . \"orders_items_properties \";\n\t\t\t\t\t$sql .= \" WHERE order_item_id=\" . $order_item_id;\n\t\t\t\t\t$sql .= \" AND (property_id=\" . $dbe->tosql($property_id, INTEGER, true, false);\n\t\t\t\t\t$sql .= \" OR property_name=\" . $dbe->tosql($property_id, TEXT) . \") \";\n\t\t\t\t\t$dbs->query($sql);\n\t\t\t\t\tif ($dbs->next_record()) {\n\t\t\t\t\t\tif ($apply_translation) {\n\t\t\t\t\t\t\t$f_source_value = get_translation($dbs->f(\"property_value\"));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$f_source_value = $dbs->f(\"property_value\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (preg_match(\"/^oi_item_properties$/\", $f_source)) {\n\t\t\t\t\t$order_item_id = $dbe->f(\"oi_order_item_id\");\n\t\t\t\t\t$sql = \" SELECT property_name, property_value, additional_price FROM \" . $table_prefix . \"orders_items_properties \";\n\t\t\t\t\t$sql .= \" WHERE order_item_id=\" . $dbe->tosql($order_item_id, INTEGER);\n\t\t\t\t\t$dbs->query($sql);\n\t\t\t\t\twhile ($dbs->next_record()) {\n\t\t\t\t\t\tif ($apply_translation) {\n\t\t\t\t\t\t\t$property_name= get_translation($dbs->f(\"property_name\"));\n\t\t\t\t\t\t\t$property_value = get_translation($dbs->f(\"property_value\"));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$property_name = $dbs->f(\"property_name\");\n\t\t\t\t\t\t\t$property_value = $dbs->f(\"property_value\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$additional_price = $dbs->f(\"additional_price\");\n\t\t\t\t\t\tif ($f_source_value) { $f_source_value .= \";\"; }\n\t\t\t\t\t\t$f_source_value .= $property_name.\": \".$property_value;\n\t\t\t\t\t\tif ($additional_price > 0) {\n\t\t\t\t\t\t\t$f_source_value .= \" (\".currency_format($additional_price).\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (preg_match(\"/^oi_item_links$/\", $f_source)) {\n\t\t\t\t\t$order_item_id = $dbe->f(\"oi_order_item_id\");\n\t\t\t\t\t$sql = \" SELECT download_path FROM \" . $table_prefix . \"items_downloads \";\n\t\t\t\t\t$sql .= \" WHERE order_item_id=\" . $dbe->tosql($order_item_id, INTEGER);\n\t\t\t\t\t$dbs->query($sql);\n\t\t\t\t\twhile ($dbs->next_record()) {\n\t\t\t\t\t\t$download_path = $dbs->f(\"download_path\");\n\t\t\t\t\t\tif ($f_source_value) { $f_source_value .= \";\"; }\n\t\t\t\t\t\t$f_source_value .= $download_path;\n\t\t\t\t\t}\n\t\t\t\t} else if (preg_match(\"/^oi_item_serials$/\", $f_source)) {\n\t\t\t\t\t$order_item_id = $dbe->f(\"oi_order_item_id\");\n\t\t\t\t\t$sql = \" SELECT serial_number FROM \" . $table_prefix . \"orders_items_serials \";\n\t\t\t\t\t$sql .= \" WHERE order_item_id=\" . $dbe->tosql($order_item_id, INTEGER);\n\t\t\t\t\t$dbs->query($sql);\n\t\t\t\t\twhile ($dbs->next_record()) {\n\t\t\t\t\t\t$serial_number = $dbs->f(\"serial_number\");\n\t\t\t\t\t\tif ($f_source_value) { $f_source_value .= \";\"; }\n\t\t\t\t\t\t$f_source_value .= $serial_number;\n\t\t\t\t\t}\n\t\t\t\t} else if (isset($db_columns[$f_source])) {\n\t\t\t\t\t$column_type = isset($db_columns[$f_source][\"data_type\"]) ? $db_columns[$f_source][\"data_type\"] : $db_columns[$f_source][1];\n\t\t\t\t\t$column_name = $f_source;\n\t\t\t\t} else if (isset($related_table_alias) && $related_table_alias && preg_match(\"/^\".$related_table_alias.\"_/\", $f_source)) {\n\t\t\t\t\t$related_column_name = preg_replace(\"/^\".$related_table_alias.\"_/\", \"\", $f_source);\n\t\t\t\t\tif (isset($related_columns[$related_column_name])) {\n\t\t\t\t\t\t$column_type = $related_columns[$related_column_name][\"data_type\"];\n\t\t\t\t\t\t$column_name = $f_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$date_formats_regexp = implode(\"|\", $date_formats);\n\t\t\t\t\tif (preg_match(\"/\".$date_formats_regexp.\"$/\", $f_source, $format_match)) {\n\t\t\t\t\t\t$f_source_wf = preg_replace(\"/_\".$format_match[0].\"$/\", \"\", $f_source);\n\t\t\t\t\t\tif (isset($db_columns[$f_source_wf])) {\n\t\t\t\t\t\t\t$check_type = isset($db_columns[$f_source_wf][\"data_type\"]) ? $db_columns[$f_source_wf][\"data_type\"] : $db_columns[$f_source_wf][1];\n\t\t\t\t\t\t\tif (($check_type == DATE || $check_type == DATETIME)) {\n\t\t\t\t\t\t\t\t$column_name = $f_source_wf;\n\t\t\t\t\t\t\t\t$column_type = isset($db_columns[$column_name][\"data_type\"]) ? $db_columns[$column_name][\"data_type\"] : $db_columns[$column_name][1];\n\t\t\t\t\t\t\t\t$column_format = $format_match[0];\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\n\t\t\t\tif ($column_name) {\n\t\t\t\t\tif ($column_type == DATE) {\n\t\t\t\t\t\t$f_source_value = $dbe->f($column_name, DATETIME);\n\t\t\t\t\t\tif (is_array($f_source_value)) {\n\t\t\t\t\t\t\tif ($column_format) {\n\t\t\t\t\t\t\t\t$f_source_value = va_date(array($column_format), $f_source_value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$f_source_value = va_date($date_edit_format, $f_source_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($column_type == DATETIME) {\n\t\t\t\t\t\t$f_source_value = $dbe->f($column_name, DATETIME);\n\t\t\t\t\t\tif (is_array($f_source_value)) {\n\t\t\t\t\t\t\tif ($column_format) {\n\t\t\t\t\t\t\t\t$f_source_value = va_date(array($column_format), $f_source_value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$f_source_value = va_date($datetime_edit_format, $f_source_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$f_source_value = $dbe->f($column_name);\n\t\t\t\t\t\tif ($apply_translation) {\n\t\t\t\t\t\t\t$f_source_value = get_translation($f_source_value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$field_value = str_replace(\"{\".$f_source.\"}\", $f_source_value, $field_value);\n\t\t\t\t} else {\n\t\t\t\t\t$field_value = str_replace(\"{\".$f_source.\"}\", $f_source_value, $field_value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$field_value = $field_source;\n\t\t}\n\n\t\treturn $field_value;\n\t}",
"public function setField($key,$val = null){\n $this->field_map[$key] = $val;\n return $this;\n }"
] | [
"0.6680064",
"0.62488",
"0.6052223",
"0.5720974",
"0.5650444",
"0.5611628",
"0.5555296",
"0.55243313",
"0.5470326",
"0.5390308",
"0.53838515",
"0.5382829",
"0.5325039",
"0.5305592",
"0.52939093",
"0.5280489",
"0.5268298",
"0.5263206",
"0.5261921",
"0.52602017",
"0.5205202",
"0.5203043",
"0.52011853",
"0.519049",
"0.5181472",
"0.5180884",
"0.5175208",
"0.5165102",
"0.51623476",
"0.5160448"
] | 0.72230655 | 0 |
Remove uniquness from the given field | public function removeUniquenessMap($field_name)
{
$this->connection->del([ $this->getUniquenessKeyByField($field_name) ]);
if (($key = array_search($field_name, $this->unique_fields)) !== false) {
unset($this->unique_fields[$key]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __unset($field){\n\n $this->_unset[$field] = 1;\n unset($this->_data[$field]);\n\n }",
"public function removeField($field) {}",
"public function getUniquenessKeyByField($field_name)\n {\n return \"{$this->namespace}:unq:{$field_name}\";\n }",
"public function unsetField($field);",
"public function removeMltField($field) {}",
"private function removeDuplicates(): void\n {\n if (is_array($this->value) && count(array_filter(array_keys($this->value), 'is_string')) == 0) {\n $this->value = array_values($this->value);\n }\n }",
"public function removeSortField($field) {}",
"public function removeData($field)\n {\n unset($this->_data[$field]);\n }",
"public function remove($field = null)\n {\n if (!is_null($field)) {\n return;\n }\n\n unset($this->fields[$field]);\n }",
"public function getUniqueField()\n {\n return $this->uniqueField;\n }",
"public function unsetField($field)\n {\n $this->_newObj['$unset'][$field] = 1;\n return $this;\n }",
"public function __unset($field) : void\n {\n $prop = $this->assertHas($field);\n unset($this->$prop->$field);\n }",
"public function removeFacetField($field) {}",
"public function offsetUnset($field) {\n if (isset($this->values[$field])) {\n unset($this->values[$field]);\n }\n }",
"public function delete_field( $field_name )\n {\n foreach ( $this->fields as $k => $f ) {\n if ( $f[ 'name' ] == $field_name ) {\n unset( $this->fields[ $k ] );\n break;\n }\n }\n }",
"public function bulkRemoveFieldValue($field_name)\n {\n foreach ($this->getIds() as $id) {\n $this->connection->hdel($this->getKeyById($id), $field_name);\n }\n }",
"public function removeStatsField($field) {}",
"private function isUnique($field)\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query\n\t\t\t->select($db->quoteName($field))\n\t\t\t->from($db->quoteName($this->_tbl))\n\t\t\t->where($db->quoteName($field) . ' = ' . $db->quote($this->$field))\n\t\t\t->where($db->quoteName('id') . ' <> ' . (int)$this->{$this->_tbl_key});\n\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn ($db->getNumRows() == 0) ? true : false;\n\t}",
"public function unique();",
"public function unsetUnwantedColumn($field_name)\n\t{\n\t\tif(is_array($this->unset_coloumn)){\n\t\t\tforeach ($this->unset_coloumn as $field) {\n\t\t\t\tif(isset($field_name[$field])){\n\t\t\t\t\tunset($field_name[$field]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $field_name;\n\t}",
"function get_unique_field($table, $field, $value){\n $results = search_table_equal($table, $field, $value);\n \n if (sizeof($results) === 1){\n return $results[0];\n }else{\n return null;\n }\n }",
"public function deletar($key, $field) {\n \n }",
"protected function unsetNestedValue($field)\n\t{\n\t\t$field = preg_split('(__([0-9]+)__)', substr($field, 11), -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\tif (!isset($this->saveData[$field[0]])) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\\count($field) === 1) {\n\t\t\tunset($this->saveData[$field[0]]);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$data =& $this->saveData[$field[0]];\n\n\t\tfor ($i = 0; isset($field[$i + 1]); $i += 2) {\n\t\t\tif (!isset($data[$field[$i + 1]])) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!isset($data[$field[$i + 1]][$field[$i + 2]])) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (isset($field[$i + 3])) {\n\t\t\t\t$data =& $data[$field[$i + 1]][$field[$i + 2]];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tunset($data[$field[$i + 1]][$field[$i + 2]]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"public function _unique_field(Validate $array, $field)\n\t{\n\t\tif ($array[$field])\n\t\t{\n\t\t\t// Attempt to load a record\n\t\t\t$model = clone $this;\n\t\t\t$model->$field = $array[$field];\n\t\t\t$model->load();\n\n\t\t\tif ( ! $model->changed())\n\t\t\t{\n\t\t\t\t// Value is not unique\n\t\t\t\t$array->error($field, 'unique');\n\t\t\t}\n\t\t}\n\t}",
"public function unique()\n {\n $exist = $remove = array();\n\n $old = $this->_filter;\n $this->setIteratorFilter(self::HIDE_GROUPS | self::BASE_ELEMENTS);\n\n // For duplicates, we use the first address that contains personal\n // information.\n foreach ($this as $key => $val) {\n $bare = $val->bare_address;\n if (isset($exist[$bare])) {\n if (($exist[$bare] == -1) || is_null($val->personal)) {\n $remove[] = $key;\n } else {\n $remove[] = $exist[$bare];\n $exist[$bare] = -1;\n }\n } else {\n $exist[$bare] = is_null($val->personal)\n ? $key\n : -1;\n }\n }\n\n foreach (array_reverse($remove) as $key) {\n unset($this[$key]);\n }\n\n $this->_filter = $old;\n }",
"static function normalize( $field )\n\t{\n\t\t$field = parent::normalize( $field );\n\t\t$field['multiple'] = false;\n\t\t$field['attributes']['id'] = false;\n\t\treturn $field;\n\t}",
"public function drop_unique($name)\n\t{\n\t\treturn $this->drop_key(__FUNCTION__, $name);\n\t}",
"public function __unset($field) {\r\n\t\t\r\n\t\t$this->touched = true;\r\n\t\t\r\n\t\tif($field == 'primary_key') unset($this->fields[static::getPrimaryKey()]);\r\n\t\telseif(in_array($field, static::getFields())) unset($this->fields[$field]);\r\n\t\telseif(isset($this->related[$field])) unset($this->related[$field]);\r\n\t\telse {\r\n\t\t\t$this->touched = false;\r\n\t\t\tthrow new InvalidFieldException($field, static::p()->name);\r\n\t\t}\r\n\t\t\r\n\t}",
"public function testUnsetField()\n {\n $same = $this->uut->setData(self::SOME_DATA)->unsetField('fii');\n $this->assertSame($this->uut, $same);\n $this->assertNull($this->uut->getField('fii'));\n }",
"function sql_delField($field) {\n $def=$this->desc[$field];\n // drop column col_name\n $requete = \"alter table \" . $this->base . \" drop $field\";\n updateQuery($requete);\n if(XSystem::tableExists('A_'.$this->base)) {\n $requete = \"alter table A_\" . $this->base . \" drop $field\";\n updateQuery($requete);\n }\n }"
] | [
"0.68669605",
"0.6835384",
"0.6684463",
"0.66010326",
"0.6287939",
"0.6236951",
"0.6198467",
"0.6181188",
"0.6138924",
"0.61238545",
"0.60902214",
"0.6074384",
"0.59941983",
"0.59886503",
"0.59828436",
"0.59768444",
"0.59712124",
"0.59391767",
"0.5914308",
"0.58491004",
"0.58341974",
"0.5811222",
"0.5779212",
"0.57655805",
"0.57496035",
"0.5688225",
"0.5646068",
"0.5638026",
"0.5620106",
"0.5615818"
] | 0.7465373 | 0 |
Namespace and keys Return IDs list key | public function getIdsKey()
{
return "{$this->namespace}:ids";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keys(){\n \treturn array(\"ID\");\n }",
"public function getIds();",
"public function keys(): IEnumerable;",
"function getIdentKey();",
"public function getObjectIDs();",
"public function getReferencingKeys();",
"public function getGroupIds();",
"public function getKeys();",
"public function getKeys();",
"public function getKeys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"function &getIdentifierIds()\n\t{\n\t\tinclude_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier.php';\n\n\t\treturn ilMDIdentifier::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');\n\t}",
"public function listKeys($prefix = '');",
"public function getListId();",
"public function keys()\n {\n return Config::find()->select('namedId')->column();\n }",
"private function _getKeyIdMap(): array\n {\n // lazily build mapping\n if (! isset($this->keyIdMap)) {\n $this->keyIdMap = [];\n foreach ($this->certs as $cert) {\n $id = self::_getCertKeyId($cert);\n if (! isset($this->keyIdMap[$id])) {\n $this->keyIdMap[$id] = [];\n }\n array_push($this->keyIdMap[$id], $cert);\n }\n }\n return $this->keyIdMap;\n }",
"public function getIds(): array;"
] | [
"0.6849944",
"0.64758795",
"0.62587774",
"0.6206924",
"0.61996",
"0.61959445",
"0.6192639",
"0.6180161",
"0.6180161",
"0.6180161",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.6144274",
"0.60960346",
"0.6092995",
"0.6056945",
"0.60513484",
"0.6050945",
"0.6013661"
] | 0.7369585 | 0 |
Return key where we'll store uniqueness data for a given field | public function getUniquenessKeyByField($field_name)
{
return "{$this->namespace}:unq:{$field_name}";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function getUniqueKey();",
"public function generateKey(string $field): string\n {\n return 'file_' . get_class($this->owner)::tableName() . $field;\n }",
"public function getUniqueField()\n {\n return $this->uniqueField;\n }",
"static function getUniqueToken($field = 'personal_token') {\n global $DB;\n\n $ok = false;\n do {\n $key = Toolbox::getRandomString(40);\n $row = $DB->request([\n 'COUNT' => 'cpt',\n 'FROM' => self::getTable(),\n 'WHERE' => [$field => $key]\n ])->next();\n\n if ($row['cpt'] == 0) {\n return $key;\n }\n } while (!$ok);\n\n }",
"public static function uniqueKey()\n {\n $self = new self();\n return $self->uniqueKey;\n }",
"public static function uniqueKey()\n {\n $self = new self();\n return $self->uniqueKey;\n }",
"public static function uniqueKey()\n {\n $self = new self();\n return $self->uniqueKey;\n }",
"public function getUniqueKey()\n {\n return $this->uniqueKey;\n }",
"abstract public function addUniqueKey(&$ret, $table, $name, $fields);",
"public function key()\n {\n if (isset(self::$fields[self::$field_index])) {\n $field = self::get_field_by_index(self::$field_index);\n\n self::$cached_field_index = self::$field_index;\n return $field->get_field_key();\n } else {\n return null;\n }\n }",
"public abstract function getUniqueIDField() : string;",
"public function key()\n {\n return key($this->fields);\n }",
"public function key()\n {\n return key($this->fields);\n }",
"public function key()\n {\n return key($this->fields);\n }",
"public function getMarkupFieldKey($field) {\n $content = $this->getMarkupText($field);\n return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);\n }",
"public function getMarkupFieldKey($field) {\n $content = $this->getMarkupText($field);\n return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);\n }",
"abstract public function getKeyField();",
"private function get_db_key_from_field ($field, $table, $data_schema = null) {\n\n if ($data_schema === null) $data_schema =& $this->database_config['data_schema'];\n\n if (substr($field, 0, 3) == 'ID_' && $field != 'ID_PARENT') {\n\n $table_rel = preg_replace('/^ID_/u', '', $field);\n $table_rel = (( isset($data_schema[$table_rel])\n && isset($data_schema[$table_rel]['sanitized'])) ? $data_schema[$table_rel]['sanitized'] : preg_replace('/^ID_(.+)$/u', '\\\\1', $field));\n\n } else {\n\n $table_rel = $data_schema[$table]['sanitized'].($field != 'ID' ? '_parent' : '');\n }\n\n return '___'.$table_rel.'_id';\n }",
"public function getKeyField($field)\n {\n $tmp = $this->fields;\n foreach ($tmp as $data) {\n if ($data['name'] == $field) {\n $field_name = $data['field'];\n }\n }\n\n return $field_name;\n }",
"function validates_uniqueness_of($attr, $array, $class, $field_name=FALSE)\r\n{\r\n\tglobal $FIELDS;\r\n\tglobal $MSG;\r\n\t$dao = new DAO();\r\n\tif ($dao->Retrieve($class, array($attr=>$array[$attr]), TRUE, TRUE))\r\n\t{\r\n\t\t$field_name = $field_name ? $field_name : $attr;\r\n\t\t$FIELDS[] = $attr;\r\n\t\t$MSG->error[] = \"<strong>$field_name</strong> already registered\";\r\n\t}\r\n\treturn false;\r\n}",
"protected function js_field_id() {\n\t\t\tif ( ! isset( $this->js_field_id ) ) {\n\t\t\t\t$key = $this->unid() . '_' . $this->unique() . '_' . uniqid( time() );\n\t\t\t\t$key = wponion_localize_object_name( 'wponion', 'field', $key );\n\t\t\t\t$key = str_replace( array( '-', '_' ), '', $key );\n\t\t\t\t$this->js_field_id = sanitize_key( $key );\n\t\t\t}\n\t\t\treturn $this->js_field_id;\n\t\t}",
"function get_unique_field($table, $field, $value){\n $results = search_table_equal($table, $field, $value);\n \n if (sizeof($results) === 1){\n return $results[0];\n }else{\n return null;\n }\n }",
"public function ensureUniqueness(): static;",
"public function unique_key_exists($value, $field = NULL)\n\t{\t\n\t\treturn (bool) DB::select(array('COUNT(\"*\")', 'total_count'))\n\t\t\t->from($this->_table_name)\n\t\t\t->where($field, '=', $value)\n\t\t\t->where($this->_primary_key, '!=', $this->pk())\n\t\t\t->execute($this->_db)\n\t\t\t->get('total_count');\n\t}",
"public function unique_key_exists($value, $field = NULL)\n\t{\t\n\t\treturn (bool) DB::select(array('COUNT(\"*\")', 'total_count'))\n\t\t\t->from($this->_table_name)\n\t\t\t->where($field, '=', $value)\n\t\t\t->where($this->_primary_key, '!=', $this->pk())\n\t\t\t->execute($this->_db)\n\t\t\t->get('total_count');\n\t}",
"private function getUidFieldName()\n {\n return '_uid_'.$this->getName();\n }",
"public function getUniqueKey(): string\n {\n do {\n $key = base64_encode(random_bytes(48));\n } while ($this->entityManager->getRepository(AppKey::class)->findOneBy(['key' => $key]));\n\n return $key;\n }",
"function SavingId($type){\n return uniqid((string)$type);\n }",
"public function hashCode() {\n if (!$this->__id) $this->__id= uniqid('', TRUE);\n return $this->__id;\n }",
"private function validate_uniqueness() {\n\t\t$is_unique = 0;\n\t\ttry {\n\t\t\t$is_unique = self::$model->is_unique_field($this->get_field_name(), $this->get_field());\n\t\t} catch( \\Exception $ex ) {\n\t\t\treturn $ex->getMessage();\n\t\t}\n\t\treturn ($is_unique !== 0 ? 1 : $this->get_pretty_field_name() . \" already exists.\");\n\t}"
] | [
"0.7196703",
"0.6879551",
"0.68084145",
"0.6699814",
"0.66504645",
"0.66504645",
"0.66504645",
"0.6598768",
"0.6416449",
"0.63809055",
"0.6293406",
"0.613526",
"0.613526",
"0.613526",
"0.6133899",
"0.6133899",
"0.61291784",
"0.6129042",
"0.6092247",
"0.6085974",
"0.6068883",
"0.6049202",
"0.6039472",
"0.6024755",
"0.6024755",
"0.600289",
"0.5977576",
"0.5972671",
"0.59675956",
"0.5904352"
] | 0.8076964 | 0 |
Get default environment variables: $_GET, $_POST, $_FILES, $_SERVER, $_COOKIE, method, route | public static function defaultEnv()
{
// use X-HTTP-Method-Override to replace uncommon methods like DELETE/PUT to get through firewall
if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
$_SERVER['REQUEST_METHOD'] = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];
}
// PHP uses a non-standards compliant practice for $_GET, fix it here
if (isset($_SERVER['QUERY_STRING'])) {
$_GET = URI::parseQuery($_SERVER['QUERY_STRING']);
}
return [
'get' => $_GET, 'post' => $_POST,
'files' => $_FILES, 'server' => $_SERVER, 'cookie' => $_COOKIE,
'route' => static::$route, 'method' => $_SERVER['REQUEST_METHOD'] ?? 'GET',
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEnvVars(): array;",
"protected static function initializeEnvironment() {\n\t\t$env = array(\n\t\t\t\t'CIAPI_ENDPOINT' => self::$endpoint, 'CIAPI_USERNAME' => self::$userName,\n\t\t\t\t'CIAPI_PASSWORD' => self::$password\n\t\t);\n\t\tarray_walk($env,\n\t\t\t\tfunction (&$value, $key) {\n\t\t\t\t\t$envValue = getenv($key);\n\t\t\t\t\tif ($envValue) {\n\t\t\t\t\t\t$value = $envValue;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tself::$endpoint = $env['CIAPI_ENDPOINT'];\n\t\tself::$userName = $env['CIAPI_USERNAME'];\n\t\tself::$password = $env['CIAPI_PASSWORD'];\n\t}",
"public function getEnv();",
"public function getEnv();",
"protected function get_environment_for_request() {\n\t\treturn array();\n\t}",
"public function getEnvironment()\n {\n $environment = $this->config->getRequest()->server->all();\n\n $vars = array('PHPSELF', 'SCRIPT_NAME', 'SCRIPT_FILENAME', 'PATH_TRANSLATED', 'DOCUMENT_ROOT', 'PHP_SELF', 'argv', 'argc', 'REQUEST_TIME', 'PHP_AUTH_PW');\n foreach ($vars as $var) {\n if (isset($environment[$var])) {\n unset($environment[$var]);\n }\n }\n\n foreach ($environment as $k => $v) {\n if (substr($k, 0, 5) == 'HTTP_') {\n unset($environment[$k]);\n }\n }\n\n return array(\n 'framework' => 'Symfony 2',\n 'framework_version' => Kernel::VERSION,\n 'env' => $environment,\n 'host' => php_uname('n'),\n 'language' => 'PHP',\n 'language_version' => phpversion(),\n 'application_root_directory' => $this->config->getRootPath(),\n 'environment' => $this->config->getEnvName(),\n );\n }",
"function ARIHT_getenv($var_name)\n{\n\tif (isset($_SERVER[$var_name]))\n\t{\n\t\treturn $_SERVER[$var_name];\n\t}\n\telseif (isset($_ENV[$var_name]))\n\t{\n\t\treturn $_ENV[$var_name];\n\t}\n\telseif (getenv($var_name))\n\t{\n\t\treturn getenv($var_name);\n\t}\n\telseif (function_exists('apache_getenv') && apache_getenv($var_name, true))\n\t{\n\t\treturn apache_getenv($var_name, true);\n\t}\n\treturn '';\n}",
"public function overrideGlobals()\n {\n $_GET = $this->query->all();\n $_POST = $this->request->all();\n $_SERVER = $this->server->all();\n $_COOKIE = $this->cookies->all();\n foreach ($this->headers->all() as $key => $value) {\n $key = strtoupper(str_replace('-', '_', $key));\n if (in_array($key, array('CONTENT_TYPE', 'CONTENT_LENGTH'))) {\n $_SERVER[$key] = implode(', ', $value);\n } else {\n $_SERVER['HTTP_' . $key] = implode(', ', $value);\n }\n }\n $request = array('g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE);\n $requestOrder = ini_get('request_order') ?: ini_get('variable_order');\n $requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp';\n $_REQUEST = array();\n foreach (str_split($requestOrder) as $order) {\n $_REQUEST = array_merge($_REQUEST, $request[$order]);\n }\n }",
"protected function getDefaultConfigVars() { return array(); }",
"public static function env()\r\n\t{\r\n\t\tif (self::$env)\r\n\t\t\treturn self::$env;\r\n\t\t$env = file_get_contents('../.env');\r\n\t\tself::$env = json_decode($env, true);\r\n\t\treturn self::$env;\r\n\t}",
"public function environ() {}",
"function setupTestingEnvironmentVariables()\n{\n $userid = $_GET['userid'] ?: 'delacqf';\n // \\Authentication::autoLogin($userid);\n \n $project_id = $_GET['pid'] ?: '1';\n $_GET['pid'] = $project_id;\n return array(\n 'pid' => $project_id,\n 'userid' => $userid,\n );\n}",
"function env($key) {\n\t\tif ($key == 'HTTPS') {\n\t\t\tif (isset($_SERVER['HTTPS'])) {\n\t\t\t\treturn (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');\n\t\t\t}\n\t\t\treturn (strpos(env('SCRIPT_URI'), 'https://') === 0);\n\t\t}\n\n\t\tif ($key == 'SCRIPT_NAME') {\n\t\t\tif (env('CGI_MODE') && isset($_ENV['SCRIPT_URL'])) {\n\t\t\t\t$key = 'SCRIPT_URL';\n\t\t\t}\n\t\t}\n\n\t\t$val = null;\n\t\tif (isset($_SERVER[$key])) {\n\t\t\t$val = $_SERVER[$key];\n\t\t} elseif (isset($_ENV[$key])) {\n\t\t\t$val = $_ENV[$key];\n\t\t} elseif (getenv($key) !== false) {\n\t\t\t$val = getenv($key);\n\t\t}\n\n\t\tif ($key === 'REMOTE_ADDR' && $val === env('SERVER_ADDR')) {\n\t\t\t$addr = env('HTTP_PC_REMOTE_ADDR');\n\t\t\tif ($addr !== null) {\n\t\t\t\t$val = $addr;\n\t\t\t}\n\t\t}\n\n\t\tif ($val !== null) {\n\t\t\treturn $val;\n\t\t}\n\n\t\tswitch ($key) {\n\t\t\tcase 'SCRIPT_FILENAME':\n\t\t\t\tif (defined('SERVER_IIS') && SERVER_IIS === true) {\n\t\t\t\t\treturn str_replace('\\\\\\\\', '\\\\', env('PATH_TRANSLATED'));\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 'DOCUMENT_ROOT':\n\t\t\t\t$name = env('SCRIPT_NAME');\n\t\t\t\t$filename = env('SCRIPT_FILENAME');\n\t\t\t\t$offset = 0;\n\t\t\t\tif (!strpos($name, '.php')) {\n\t\t\t\t\t$offset = 4;\n\t\t\t\t}\n\t\t\t\treturn substr($filename, 0, strlen($filename) - (strlen($name) + $offset));\n\t\t\tbreak;\n\t\t\tcase 'PHP_SELF':\n\t\t\t\treturn str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));\n\t\t\tbreak;\n\t\t\tcase 'CGI_MODE':\n\t\t\t\treturn (PHP_SAPI === 'cgi');\n\t\t\tbreak;\n\t\t\tcase 'HTTP_BASE':\n\t\t\t\t$host = env('HTTP_HOST');\n\t\t\t\tif (substr_count($host, '.') !== 1) {\n\t\t\t\t\treturn preg_replace('/^([^.])*/i', null, env('HTTP_HOST'));\n\t\t\t\t}\n\t\t\treturn '.' . $host;\n\t\t\tbreak;\n\t\t}\n\t\treturn null;\n\t}",
"function env($key) {\n\t\tif ($key === 'HTTPS') {\n\t\t\tif (isset($_SERVER['HTTPS'])) {\n\t\t\t\treturn (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');\n\t\t\t}\n\t\t\treturn (strpos(env('SCRIPT_URI'), 'https://') === 0);\n\t\t}\n\n\t\tif ($key === 'SCRIPT_NAME') {\n\t\t\tif (env('CGI_MODE') && isset($_ENV['SCRIPT_URL'])) {\n\t\t\t\t$key = 'SCRIPT_URL';\n\t\t\t}\n\t\t}\n\n\t\t$val = null;\n\t\tif (isset($_SERVER[$key])) {\n\t\t\t$val = $_SERVER[$key];\n\t\t} elseif (isset($_ENV[$key])) {\n\t\t\t$val = $_ENV[$key];\n\t\t} elseif (getenv($key) !== false) {\n\t\t\t$val = getenv($key);\n\t\t}\n\n\t\tif ($key === 'REMOTE_ADDR' && $val === env('SERVER_ADDR')) {\n\t\t\t$addr = env('HTTP_PC_REMOTE_ADDR');\n\t\t\tif ($addr !== null) {\n\t\t\t\t$val = $addr;\n\t\t\t}\n\t\t}\n\n\t\tif ($val !== null) {\n\t\t\treturn $val;\n\t\t}\n\n\t\tswitch ($key) {\n\t\t\tcase 'DOCUMENT_ROOT':\n\t\t\t\t$name = env('SCRIPT_NAME');\n\t\t\t\t$filename = env('SCRIPT_FILENAME');\n\t\t\t\t$offset = 0;\n\t\t\t\tif (!strpos($name, '.php')) {\n\t\t\t\t\t$offset = 4;\n\t\t\t\t}\n\t\t\t\treturn substr($filename, 0, -(strlen($name) + $offset));\n\t\t\tcase 'PHP_SELF':\n\t\t\t\treturn str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));\n\t\t\tcase 'CGI_MODE':\n\t\t\t\treturn (PHP_SAPI === 'cgi');\n\t\t\tcase 'HTTP_BASE':\n\t\t\t\t$host = env('HTTP_HOST');\n\t\t\t\t$parts = explode('.', $host);\n\t\t\t\t$count = count($parts);\n\n\t\t\t\tif ($count === 1) {\n\t\t\t\t\treturn '.' . $host;\n\t\t\t\t} elseif ($count === 2) {\n\t\t\t\t\treturn '.' . $host;\n\t\t\t\t} elseif ($count === 3) {\n\t\t\t\t\t$gTLD = array(\n\t\t\t\t\t\t'aero',\n\t\t\t\t\t\t'asia',\n\t\t\t\t\t\t'biz',\n\t\t\t\t\t\t'cat',\n\t\t\t\t\t\t'com',\n\t\t\t\t\t\t'coop',\n\t\t\t\t\t\t'edu',\n\t\t\t\t\t\t'gov',\n\t\t\t\t\t\t'info',\n\t\t\t\t\t\t'int',\n\t\t\t\t\t\t'jobs',\n\t\t\t\t\t\t'mil',\n\t\t\t\t\t\t'mobi',\n\t\t\t\t\t\t'museum',\n\t\t\t\t\t\t'name',\n\t\t\t\t\t\t'net',\n\t\t\t\t\t\t'org',\n\t\t\t\t\t\t'pro',\n\t\t\t\t\t\t'tel',\n\t\t\t\t\t\t'travel',\n\t\t\t\t\t\t'xxx'\n\t\t\t\t\t);\n\t\t\t\t\tif (in_array($parts[1], $gTLD)) {\n\t\t\t\t\t\treturn '.' . $host;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tarray_shift($parts);\n\t\t\t\treturn '.' . implode('.', $parts);\n\t\t}\n\t\treturn null;\n\t}",
"function env(string $key, string|float|int|bool|null $default = null): string|float|int|bool|null\n {\n if ($key === 'HTTPS') {\n if (isset($_SERVER['HTTPS'])) {\n return !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';\n }\n\n return str_starts_with((string)env('SCRIPT_URI'), 'https://');\n }\n\n if ($key === 'SCRIPT_NAME' && env('CGI_MODE') && isset($_ENV['SCRIPT_URL'])) {\n $key = 'SCRIPT_URL';\n }\n\n $val = $_SERVER[$key] ?? $_ENV[$key] ?? null;\n assert($val === null || is_scalar($val));\n if ($val == null && getenv($key) !== false) {\n $val = (string)getenv($key);\n }\n\n if ($key === 'REMOTE_ADDR' && $val === env('SERVER_ADDR')) {\n $addr = env('HTTP_PC_REMOTE_ADDR');\n if ($addr !== null) {\n $val = $addr;\n }\n }\n\n if ($val !== null) {\n return $val;\n }\n\n switch ($key) {\n case 'DOCUMENT_ROOT':\n $name = (string)env('SCRIPT_NAME');\n $filename = (string)env('SCRIPT_FILENAME');\n $offset = 0;\n if (!str_ends_with($name, '.php')) {\n $offset = 4;\n }\n\n return substr($filename, 0, -(strlen($name) + $offset));\n case 'PHP_SELF':\n return str_replace((string)env('DOCUMENT_ROOT'), '', (string)env('SCRIPT_FILENAME'));\n case 'CGI_MODE':\n return PHP_SAPI === 'cgi';\n }\n\n return $default;\n }",
"public static function env() {\n\t\treturn static::instance()->getEnv();\n\t}",
"protected function _containerDefaultVariables()\n {\n $this->method = NULL;\n $this->redirect = NULL;\n $this->restore = NULL;\n $this->cache = NULL;\n $this->nocache = NULL;\n $this->csrf = NULL;\n $this->ajax = NULL;\n $this->curl = NULL;\n $this->restful = NULL;\n }",
"public function env();",
"public function getEnv()\n {\n return array();\n }",
"public static function getall_request_vars()\n{ \n\n // Set vars\n $vars = array(\n 'host' => self::$host,\n 'port' => self::$port,\n 'protocol' => self::$protocol,\n 'method' => self::$method,\n 'content_type' => self::$content_type,\n 'uri' => self::$uri,\n 'area' => self::$area,\n 'theme' => self::$theme,\n 'http_controller' => self::$http_controller,\n 'action' => self::$action,\n 'userid' => self::$userid,\n 'language' => self::$language,\n 'timezone' => self::$timezone,\n 'currency' => self::$currency,\n 'ip_address' => self::$ip_address,\n 'user_agent' => self::$user_agent\n );\n\n // Return\n return array_merge($vars, $this->attributes);\n\n}",
"public function getEnvVariables()\n {\n return $this->env_variables;\n }",
"function getenv ($varname) {}",
"public function getRequestVars()\r\n {\r\n $evalStr='';\r\n foreach($_REQUEST AS $KEY => $VAL)\r\n {\r\n if($KEY != \"list-boxes\")\r\n {\r\n $evalStr.= 'global $'.$KEY.'; $'.$KEY.' = $_REQUEST[\\''.$KEY.'\\'];';\r\n }\r\n }\r\n if($evalStr!='')\r\n \t@eval($evalStr);\r\n }",
"function readEnv($key)\n{\n return $_ENV[$key];\n}",
"public function _prepare_env()\n {\n $this->ENV_ARRAYS = strtoupper($this->ENV_ARRAYS);\n $data = [];\n // Include only desired arrays\n if (false !== strpos($this->ENV_ARRAYS, 'G') && ! empty($_GET)) {\n $data['_GET'] = $_GET;\n }\n if (false !== strpos($this->ENV_ARRAYS, 'P') && ! empty($_POST)) {\n $data['_POST'] = $_POST;\n }\n if (false !== strpos($this->ENV_ARRAYS, 'F') && ! empty($_FILES)) {\n $data['_FILES'] = $_FILES;\n }\n if (false !== strpos($this->ENV_ARRAYS, 'C') && ! empty($_COOKIE)) {\n $data['_COOKIE'] = $_COOKIE;\n }\n if (false !== strpos($this->ENV_ARRAYS, 'S') && ! empty($_SESSION)) {\n $data['_SESSION'] = $_SESSION;\n }\n return ! empty($data) ? serialize($data) : '';\n }",
"function getEnvironment()\n{\n return getenv( 'ENV' ) ? : getenv( 'REDIRECT_ENV' ) ? : 'prod';\n}",
"public function setupStaticVars() {\n\t\t// This is used by a few places to set up stuff differently\n\t\t// depending on what mode we are in.\n\t\tif(php_sapi_name() == 'cli') {\n\t\t\t$this->exec_mode = \"cli\";\n\t\t} else { \n\t\t\t$this->exec_mode = \"web\";\n\t\t}\n\t\tglobal $conf;\n\t\t// bring in our config\n\t\tinclude_once(_SYSTEM_ . \"/config/config.php\");\n\t\t\n\t\t// Setup config static var\n\t\t$this->config = $conf;\n\t\t\n\t\t// now parse in the URL/ENV vars to our static vars.\n\t\t$this->parseMARP();\t\t\n\t\t\n\t\t\n\t}",
"public function getDefaultVars()\n {\n return [\n 'hostname' => $this->name,\n 'ansible_connection' => 'ssh',\n 'ansible_ssh_host' => '0.0.0.0',\n 'ansible_ssh_port' => '22',\n 'ansible_ssh_user' => 'root',\n 'ansible_ssh_private_key_file' => null,\n 'ansible_ssh_public_key_file' => null,\n 'ansible_python_interpreter' => '/usr/bin/python3',\n 'ansible_ssh_common_args' => '-o StrictHostKeyChecking=no',\n 'autopilot_host' => false,\n 'admin_pass' => Str::random(12),\n 'mysql_root_pass' => Str::random(12),\n 'pma_blowfish_secret' => Str::random(32),\n 'swap_path' => '/swapfile',\n 'swap_size' => '1024',\n 'swap_swappiness' => '60',\n 'firewall' => [],\n 'auth_keys' => []\n ];\n }",
"private function getEnvironment() {\n\t\treturn ( getenv('ROBO_ENV') !== false) ? getenv('ROBO_ENV') : 'production';\n\t}",
"function get_client_ip_env() {\n\t\t$ipaddress = '';\n\t\tif (getenv('HTTP_CLIENT_IP'))\n\t\t\t$ipaddress = getenv('HTTP_CLIENT_IP');\n\t\telse if(getenv('HTTP_X_FORWARDED_FOR'))\n\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n\t\telse if(getenv('HTTP_X_FORWARDED'))\n\t\t\t$ipaddress = getenv('HTTP_X_FORWARDED');\n\t\telse if(getenv('HTTP_FORWARDED_FOR'))\n\t\t\t$ipaddress = getenv('HTTP_FORWARDED_FOR');\n\t\telse if(getenv('HTTP_FORWARDED'))\n\t\t\t$ipaddress = getenv('HTTP_FORWARDED');\n\t\telse if(getenv('REMOTE_ADDR'))\n\t\t\t$ipaddress = getenv('REMOTE_ADDR');\n\t\telse\n\t\t\t$ipaddress = 'UNKNOWN';\n\n\t\treturn $ipaddress;\n\t}"
] | [
"0.6949048",
"0.6837056",
"0.6796427",
"0.6796427",
"0.6775201",
"0.65419024",
"0.6443546",
"0.63823307",
"0.6355309",
"0.63545704",
"0.63382375",
"0.6266132",
"0.6257992",
"0.62547076",
"0.6220117",
"0.6203948",
"0.6182272",
"0.6158366",
"0.61500704",
"0.61445785",
"0.6111072",
"0.608358",
"0.60718244",
"0.6042725",
"0.6042013",
"0.5998746",
"0.5996816",
"0.5977078",
"0.5953903",
"0.59517133"
] | 0.8199027 | 0 |
Helper function to test whether show loftloader | private function loader_enabled(){
if(($this->get_loader_setting('loftloader_main_switch') === 'on')){
$range = $this->get_loader_setting('loftloader_show_range');
if(($range === 'sitewide') || (($range === 'homepage') && is_front_page())){
return true;
}
else{
return false;
}
}
else{
return apply_filters('loftloader_loader_enabled', false);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function isValid() {\n\t\treturn !!static::$loader;\n\t}",
"public function isLoaded(): bool;",
"private function hasLoader($alias)\n {\n return isset($this->loaders[$alias]);\n }",
"public static function isPortalMustNotBeLoaded()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\tif (!defined('LP_NAME') || !empty($context['uninstalling']) || Helpers::request()->is('printpage')) {\n\t\t\t$modSettings['minimize_files'] = 0;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"abstract public function isLoaded(): bool;",
"public function shouldItLoad()\n {\n return True;\n }",
"public function isLoadPluginScroller(): bool {\n\t\treturn $this->_loadPluginScroller;\n\t}",
"public function isLoaded()\n {\n return extension_loaded($this->extensionName);\n }",
"public function allow_load() {\r\n\t\treturn function_exists( 'register_block_type' );\r\n\t}",
"public function isLoadPluginSelect(): bool {\n\t\treturn $this->_loadPluginSelect;\n\t}",
"public function mustLoad();",
"public function isLti()\n {\n // TODO: should this be in the LTI plugin?\n if ($this->get('force.lti.template') || $this->getSession()->has('lti_launch')) {\n return true;\n }\n return false;\n }",
"private static function visible($url) {\n switch ($url) {\n case '/phpinfo.php':\n case '/sessioninfo.php':\n case '/cdn_assets.php':\n if (realpath(\n $_SERVER['DOCUMENT_ROOT'] . $url\n )) {\n return true;\n } else {\n return false;\n }\n break;\n case '/apcinfo.php':\n if (extension_loaded('apc') &&\n realpath(\n $_SERVER['DOCUMENT_ROOT'] . '/_apc.php'\n )\n ) {\n return true;\n } else {\n return false;\n }\n break;\n case '/server-status':\n if (array_key_exists('SERVER_SOFTWARE', $_SERVER) &&\n strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === 0 &&\n array_key_exists('REMOTE_ADDR', $_SERVER) &&\n $_SERVER['REMOTE_ADDR'] === '127.0.0.1'\n ) {\n return true;\n } else {\n return false;\n }\n break;\n case '/status?full':\n if (PHP_SAPI === 'fpm-fcgi' &&\n array_key_exists('REMOTE_ADDR', $_SERVER) &&\n $_SERVER['REMOTE_ADDR'] === '127.0.0.1'\n ) {\n return true;\n } else {\n return false;\n }\n break;\n default:\n return false;\n }\n }",
"public static function isLoaded()\n {\n return (is_null(self::$__instance) === false);\n }",
"function onPepperLoad()\n\t{\n\t\treturn true;\n\t}",
"static function is_plugin_page() {\n $current_screen = get_current_screen();\n\n if ($current_screen->id == 'settings_page_wf_bdl') {\n return true;\n } else {\n return false;\n }\n }",
"function l2p_on_tools_page() {\n\t$on_tools_page = false;\n\tif ( function_exists( 'get_current_screen' ) ) {\n\t\tif ( get_current_screen()->base == 'tools_page_link2post_tools' ) {\n\t\t\t$on_tools_page = true;\n\t\t}\n\t}\n\treturn $on_tools_page;\n}",
"public function canShowTab() {\n return $this->_config_helper->hasBeenSetUp();\n }",
"public function isLoadPluginButtons(): bool {\n\t\treturn $this->_loadPluginButtons;\n\t}",
"public function isLoadThemeLibrary(): bool {\n\t\treturn $this->_loadThemeLibrary;\n\t}",
"function hook_lms_status($lapp_id) {\n if ($lapp_id == 'drupal') {\n $modules = _course_required_modules();\n foreach ($modules as $module) {\n if (!module_exists($module)) {\n return FALSE;\n }\n }\n return TRUE;\n }\n if ($lapp_id == 'none') {\n return TRUE;\n }\n}",
"public function hasConfigLoader(): bool\n {\n return isset($this->configLoader);\n }",
"static function is_plugin_page() {\r\n $current_screen = get_current_screen();\r\n\r\n if ($current_screen->id == 'tools_page_wf-sn') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"function is_displayable()\n\t{\n\t\t// PMs ignore tachy status\n\t\treturn true;\n\t}",
"public function testIsLoaded() {\n $this->assertTrue(!CRT::isLoaded());\n }",
"public function isLoaded()\n {\n return (bool) $this->logger;\n }",
"protected function _isLoaded()\n {\n return $this->getIsLoaded();\n }",
"public function isLoaded()\n\t{\n\t\t// Make sure the resource handle is valid.\n\t\tif (!is_resource($this->handle) || (get_resource_type($this->handle) != 'gd'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function gogreen_get_page_loader( $loader = '' ){\n $output = '';\n if( !empty($loader) && $loader !== 'none' ){\n ob_start();\n ?>\n <div id=\"loading-animation\" class=\"loader-<?php echo esc_attr( gogreen_get_option('page_loader') );?>\">\n <?php get_template_part('templates/loaders/loader', gogreen_get_option('page_loader')); ?>\n </div>\n <?php\n $output = ob_get_clean();\n }\n return $output;\n}",
"public function isInitted()\n {\n return (FileStorage::isUsefulDirectory($this->directory)\n && FileStorage::isUsefulFile($this->directory . \"/hindsight.json\")\n && FileStorage::isUsefulFile($this->directory . \"/hindsight.lock\"));\n }"
] | [
"0.62185866",
"0.6147835",
"0.5974195",
"0.59371525",
"0.5919293",
"0.59136564",
"0.58721805",
"0.5844447",
"0.5830888",
"0.5816703",
"0.5803708",
"0.5739021",
"0.5733892",
"0.5698285",
"0.5690261",
"0.5679125",
"0.565872",
"0.5656225",
"0.5649536",
"0.5639547",
"0.5634773",
"0.55814767",
"0.5560478",
"0.55585563",
"0.55572504",
"0.555052",
"0.5543728",
"0.55279726",
"0.5524341",
"0.5479279"
] | 0.7312864 | 0 |
Returns the keyword that was resolved | public function getResolvedKeyword(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getKeyword(): string;",
"abstract protected function getKeyword();",
"public function getKeyword()\n {\n return $this->keyword;\n }",
"public function getKeyword()\n {\n return $this->keyword;\n }",
"public function getKeyword()\n {\n return $this->keyword;\n }",
"public function getKeyword() {\n return $this->keyword;\n }",
"public function getHandledKeyword();",
"public function getAuthKeyword();",
"public function getUrlKeyword () {\n\t$preValue = $this->preGetValue(\"urlKeyword\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->urlKeyword;\n\treturn $data;\n}",
"private function get_focus_keyword_usage() {\n\t\t$focuskw = WPSEO_Taxonomy_Meta::get_term_meta( $this->term, $this->term->taxonomy, 'focuskw' );\n\n\t\treturn WPSEO_Taxonomy_Meta::get_keyword_usage( $focuskw, $this->term->term_id, $this->term->taxonomy );\n\t}",
"public function getKeywordCode()\n {\n return $this->keyword_code;\n }",
"function _govcms_ui_kit_get_search_keyword() {\n $params = drupal_get_query_parameters();\n return !empty($params['search']) ? check_plain($params['search']) : '';\n}",
"public function getSearchKey(): string\n {\n return 'keywords';\n }",
"public function routeForKeyword( $keyword ) {\n\t\t$keywords = $this->keywords;\n\t\tif(isset($keywords[$keyword])) return $keywords[$keyword];\n\t\t$aliases = $this->aliases;\n\t\tif(isset($aliases[$keyword])) return $aliases[$keyword];\n\t\telse return null;\n\t}",
"static function get_keyword($post_id) {\r\n \t\r\n \t// Use WP function to get the value\r\n \t$key = trim(get_post_meta($post_id, self::$keyword_metadata, TRUE));\r\n \t\r\n \t// Return the keyword with blank spaces, to macth only a whole word or phrase\r\n \treturn $key;\r\n }",
"public function getKeyword()\n {\n return 'ALL';\n }",
"public function setResolvedKeyword(string $resolvedKeyword): ResolvedKeywordsNode;",
"public function getKeywordId()\n {\n return $this->keyword_id;\n }",
"static function get_keyword3($post_id) {\r\n \t\r\n \t// Use WP function to get the value\r\n \t$key = trim(get_post_meta($post_id, self::$keyword3_metadata, TRUE));\r\n \t\r\n \t// Return the keyword with blank spaces, to macth only a whole word or phrase\r\n \treturn $key;\r\n }",
"public function keyword()\n {\n return $this->hasOne('App\\Keyword');\n }",
"static function get_keyword2($post_id) {\r\n \t\r\n \t// Use WP function to get the value\r\n \t$key = trim(get_post_meta($post_id, self::$keyword2_metadata, TRUE));\r\n \t\r\n \t// Return the keyword with blank spaces, to macth only a whole word or phrase\r\n \treturn $key;\r\n }",
"public function getActiveKeyword() {\n\t\t$filter = array(\n\t\t\t'status' => 1,\n\t\t\t'deleted' => 0 \n\t\t);\n\n\t\treturn $this->get($filter);\n\t}",
"public function keywordDetection()\r\n\t{\r\n\t\t$keyword = \"haha\";\r\n\r\n\t\tif ($this->postObj)\r\n\t\t{\r\n\t\t\t//extract post data\r\n\t\t\t$textContent = trim($this->postObj->Content);\r\n\t\t\t//form response\r\n\t\t\tif(strstr($textContent,$keyword))\r\n\t\t\t\t$contentStr = \"Keyword is correct :)\\n\\n\";\r\n\t\t\telse\r\n\t\t\t\t$contentStr = \"Keyword is incorrect :(\\nTry again :)\\n\\n\";\r\n\t\t\t//append content string to result string\r\n\t\t\t$this->resultStr = $this->resultStr.$contentStr;\r\n\t\t}\r\n\t\telse\r\n\t\t\texit;\r\n\t}",
"public function word()\n {\n return $this->word;\n }",
"public function getWord()\n {\n return $this->word;\n }",
"public function getWord()\n {\n return $this->word;\n }",
"public function findByKeyword($keyword)\n {\n $keyword = Models\\Keyword::query()\n ->where(\\DB::raw(\"LOWER(keyword)\"), strtolower($keyword))\n ->first();\n\n if ($keyword) {\n return $keyword->asset;\n }\n\n\t return null;\n\t}",
"function sms_survey_getdatabykeyword($keyword) {\n\tglobal $core_config;\n\t$ret = array();\n\t$cred = '';\n\tif ($core_config['user']['status'] && !($core_config['user']['status'] == 2)) {\n\t\t$cred = \" AND uid='\".$core_config['user']['uid'].\"'\";\n\t}\n\t$db_query = \"SELECT * FROM \"._DB_PREF_.\"_featureSurvey WHERE deleted='0' AND keyword='$keyword'\".$cred;\n\t$db_result = dba_query($db_query);\n\tif ($db_row = dba_fetch_array($db_result)) {\n\t\t$ret = $db_row;\n\t}\n\treturn $ret;\n}",
"public function getSource()\n {\n return 'keywords';\n }",
"protected function _SearchKeyword()\n {\n\n $html = $this->getHead('FoobarSearch Results')\n . $this->getHeader('FoobarSearch Results')\n . \"<h3>Total {$this->data['total']}</h3>\n <ul>\";\n\n foreach ($this->data['results'] as $result) {\n\n $html .= \"<li>\n <a href=\\\"\".FOOBAR_BASE_URL.\"?module=Search&action=thread&data[id]={$result['id']}\\\">{$result['title']}</a>\n </li>\";\n }\n\n return \"{$html}\n </ul>\";\n }"
] | [
"0.76230955",
"0.7477562",
"0.7210645",
"0.7210645",
"0.7210645",
"0.7126165",
"0.7085248",
"0.6536612",
"0.6471474",
"0.633305",
"0.6171009",
"0.61169285",
"0.6017393",
"0.6010594",
"0.60068023",
"0.6006647",
"0.5918776",
"0.58925587",
"0.58267915",
"0.5752422",
"0.5645896",
"0.5635137",
"0.553056",
"0.55198467",
"0.5510482",
"0.5510482",
"0.5505635",
"0.5485973",
"0.5479637",
"0.54718435"
] | 0.8848006 | 0 |
Adds an list of constraints. | public function addConstraints(array $constraints): static
{
foreach ($constraints as $constraint) {
$this->addConstraint($constraint);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function addConstraints();",
"public function addConstraints(Constraints $constraints = null) {\n $this->constraints = $constraints;\n }",
"public function addConstraints(array $constraints)\n\t{\n\t\tforeach($constraints AS $column => $constraintset)\n\t\t{\n\t\t\tif(is_array($constraintset)){\n\t\t\t\t$constraintset = $this->getObject('com:validation.constraint.set', array('constraints' => $constraints));\n\t\t\t}\n\n\t\t\tif($constraintset instanceof ConstraintSet)\n\t\t\t{\n\t\t\t\t$this->offsetSet($column, $constraintset);\n\t\t\t}\n\t\t}\n\n return $this;\n\t}",
"public function addConstraints()\n {\n if ( !static::$constraints ) return;\n foreach($this->relationConstraints as $r){\n $this->query->where($r['foreign_key'], $r['operator'], $this->parent->{$r['local_key']});\n }\n }",
"public function addConstraints()\n {\n if (static::$constraints) {\n $method = $this->anyOrAll == 'all' ? 'withAllTags' : 'withAnyTags';\n\n $this->query->{$method}($this->getTags($this->parent));\n }\n }",
"public function setConstraints(array $constraints)\n {\n foreach ($constraints as $constraint) {\n $this->addConstraint($constraint);\n }\n return $this;\n }",
"function constraints($constraints)\r\n\t{\r\n\t\t$this->constraints = $constraints;\r\n\t\treturn $this;\r\n\t}",
"public function addCourseLessons($constraints = array()) {\n $lessons = $this -> getCourseLessonsIncludingUnassigned($constraints);\n $this -> addLessons($lessons);\n }",
"public function addConstraints(): void\n {\n if (!static::$has_constraints) {\n return;\n }\n\n // For belongs to relationships, which are essentially the inverse of has one\n // or has many relationships, we need to actually query on the primary key\n // of the related models matching on the foreign key that's on a parent.\n $foreign_key_value = $this->parent->getAttribute($this->foreign_key);\n $this->query->where($this->local_key, '=', $foreign_key_value);\n }",
"abstract protected function _constraints();",
"public function set_Constraints($constraints_in) {\n $this->constraints = $constraints_in;\n }",
"public function addConstraints()\n {\n $this->query->where($this->foreignKey, $this->parentObject);\n }",
"public function addConstraints()\n {\n if (static::$constraints) {\n if ($this->foreignKey === '_id') {\n $this->query->useKeys(is_array($this->getParentKey()) ? $this->getParentKey() : [$this->getParentKey()]);\n } else {\n $this->query->where($this->foreignKey, '=', $this->getParentKey());\n }\n }\n }",
"public function addConstraints()\n {\n parent::addConstraints();\n\n if (static::$constraints) {\n if (is_array($this->foreignKeys[0])) {\n $column = $this->throughParent->qualifyColumn($this->foreignKeys[0][0]);\n\n $this->query->where($column, '=', $this->farParent->getMorphClass());\n }\n }\n }",
"public function __construct(...$constraints)\n {\n parent::__construct();\n\n $this->constraints = $constraints;\n }",
"protected function addForeignKeyConstraints()\n {\n $sRuleTypeTableName = $this->tablePrefix .'bm_rule_type';\n \n $this->table->addForeignKeyConstraint($sRuleTypeTableName, ['rule_type_id'], ['rule_type_id'], [], null);\n \n $sTimeslotTableName = $this->tablePrefix .'bm_timeslot';\n \n $this->table->addForeignKeyConstraint($sTimeslotTableName, ['timeslot_id'], ['timeslot_id'], [], null);\n \n }",
"abstract public function getConstraints();",
"protected function addForeignKeyConstraints()\n {\n }",
"protected function addForeignKeyConstraints()\n {\n $sRuleTypeTableName = $this->tablePrefix .'bm_rule_type';\n \n $this->table->addForeignKeyConstraint($sRuleTypeTableName, ['rule_type_id'], ['rule_type_id'], [], null);\n \n $sRuleTableName = $this->tablePrefix .'bm_rule';\n \n $this->table->addForeignKeyConstraint($sRuleTableName, ['rule_id'], ['rule_id'], [], null);\n \n }",
"public function addCondiments()\n {\n }",
"function constraint($constraint){\n\t\t\t$this->constraints = explode(\" AND \",str_replace(\"\\n\",\"\",$constraint));\n\t\t}",
"protected function addNewRules()\n {\n foreach($this->getRules() as $rule)\n {\n $this->extendValidator($rule);\n }\n }",
"final public function constraints()\r\n\t{\r\n\t\t$constraints = array();\r\n\t\t\r\n\t\tif ($this->nullable === FALSE)\r\n\t\t{\r\n\t\t\t$constraints[] = 'not null';\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->default)\r\n\t\t{\r\n\t\t\t$constraints['default'] = $this->default;\r\n\t\t}\r\n\t\t\r\n\t\treturn array_merge($constraints, $this->_constraints());\r\n\t}",
"public function addRequirements(array $requirements)\n {\n if ($requirements) {\n foreach ($this->routes as $route) {\n $route->addRequirements($requirements);\n }\n }\n }",
"public function addPropertyConstraints($name, array $constraints) {\n $item_constraints = $this->getItemDefinition()->getConstraint('ComplexData') ?: [];\n if (isset($item_constraints[$name])) {\n // Add the new property constraints, overwriting as required.\n $item_constraints[$name] = $constraints + $item_constraints[$name];\n }\n else {\n $item_constraints[$name] = $constraints;\n }\n $this->getItemDefinition()->addConstraint('ComplexData', $item_constraints);\n return $this;\n }",
"public function get_Constraints() {\n return $this->constraints;\n }",
"private function loadConstraints(){\n \n if($currentConstraintFolder = opendir(HF_VENDOR_DIR.\"/symfony/validator/Constraints\")){\n while (false !== ($constraintFile = readdir($currentConstraintFolder))) {\n if(pathinfo($constraintFile, PATHINFO_EXTENSION) === 'php'){ \n AnnotationRegistry::registerFile(HF_VENDOR_DIR.\"/symfony/validator/Constraints/\".$constraintFile);\n }\n }\n closedir($currentConstraintFolder);\n }\n }",
"public function getConstraints()\n {\n return $this->_constraints;\n }",
"public function testElementAddConstraintZend(ElementListInterface $template)\n\t{\n\t\t$this->assertTrue($template->hasElement(\"zend\"));\n\t\t\n\t\t$wrapper = new ConstraintWrapper\\Zend();\n\t\t$template->addConstraintWrapper($wrapper);\n\t\t\n\t\t$element = $template->getElement(\"zend\");\n\t\t$element->addConstraint(new ValidatorZend\\Regex(\"/^abcd$/\"));\n\t\t\n\t\t$constraints = $element->getConstraints();\n\t\t\n\t\t$this->assertNotEmpty($constraints);\n\t\t$this->assertNotEmpty($wrapper->filterConstraints($constraints));\n\t\t\n\t\tforeach($wrapper->filterConstraints($constraints) as $constraint)\n\t\t\t$this->assertInstanceOf(ValidatorZend\\Regex::class, $constraint);\n\t}",
"protected static function validateConstraints(array $constraints): void\n {\n foreach ($constraints as $name => $constraint) {\n if (false === is_string($constraint)) {\n throw Exception\\Validation::unexpectedConstantType(\n static::class, $name, gettype($constraint), 'string'\n );\n }\n }\n\n if (count($constraints) !== count(array_flip($constraints))) {\n throw Exception\\Validation::duplicatedConstantValues(static::class);\n }\n }"
] | [
"0.76531094",
"0.6958617",
"0.6859094",
"0.6849813",
"0.6587984",
"0.6526808",
"0.64710975",
"0.635439",
"0.6297402",
"0.6159023",
"0.608662",
"0.6014979",
"0.6009447",
"0.578652",
"0.5633201",
"0.5594202",
"0.5569174",
"0.5567205",
"0.55512923",
"0.54915255",
"0.541259",
"0.54067445",
"0.5359457",
"0.535887",
"0.5309654",
"0.52525145",
"0.5227888",
"0.52218103",
"0.51689386",
"0.51506805"
] | 0.7262602 | 1 |
Returns whether this element has any constraints. | public function hasConstraints(): bool
{
return \count($this->constraints) > 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasUniqueConstraint()\n\t{\n\t\treturn \\count($this->uc_constraints);\n\t}",
"public function ignoreConstraints(): bool {\n\t\treturn $this->ignore_constraints;\n\t}",
"public function hasRules()\n {\n return !empty($this->rules);\n }",
"public function hasPrimaryKeyConstraint()\n\t{\n\t\treturn null !== $this->pk_constraint;\n\t}",
"public function hasValidators()\n {\n return ($this->isRequired() || ! empty($this->_validators));\n }",
"public function valid()\n {\n return isset( $this->layout[$this->position] );\n }",
"public function isEmpty()\n {\n foreach ($this->layout as $group) {\n if (!$group->layout->isEmpty()) {\n return false;\n }\n }\n return true;\n }",
"public function valid()\n {\n return $this->offsetExists(key($this->_elements));\n }",
"public function hasElements()\n {\n foreach ($this->clipData as $data) {\n if (isset($data['el']) && is_array($data['el']) && !empty($data['el'])) {\n return true;\n }\n }\n\n return false;\n }",
"public function isNotEmpty()\n {\n return ! $this->isEmpty();\n }",
"public function hasElements(): bool\n {\n $total = $this->connection\n ->executeQuery(sprintf('SELECT COUNT(*) AS totalCount FROM %s WHERE event_status = \\'pending\\';', $this->queueName))\n ->fetch();\n\n return 0 !== (int) $total['totalCount'];\n }",
"public function isEmpty()\n {\n return empty($this->violations) && empty($this->children);\n }",
"public function hasViolations(): bool {\n\t\treturn !empty($this->violations);\n\t}",
"public function hasValidation()\n\t{\n\t\treturn is_null($this->validation) === false;\n\t}",
"public function isSetVisibility()\n {\n return !is_null($this->_fields['Visibility']['FieldValue']);\n }",
"public function hasNodes()\n {\n return count($this->nodes) != 0;\n }",
"public function isRequired()\r\n {\r\n return count(Annotations::ofProperty($this->object, $this->property, '@required')) > 0;\r\n }",
"public function hasDependencies() {\n\t\treturn !empty($this->dependencies);\n\t}",
"public function hasConstraint($property)\n {\n return array_key_exists($property, $this->getConstraints());\n }",
"public function hasRelations(): bool\n {\n return count($this->relations) > 0;\n }",
"public function isNotEmpty() {\r\n\t\treturn count(self::$cache[$this->accessorClass]) > 0;\r\n\t}",
"function hasAttributes ()\n\t{\n\t\treturn \t$this->attributes && $this->attributes->length > 0 ?\n\t\t\t\ttrue :\n\t\t\t\tfalse;\n\t}",
"public function isEmpty()\n {\n return (null === $this->getFilters() && null === $this->getSortings() && null === $this->getLimits());\n }",
"public function hasBinding()\n {\n $hasImplicitBinding = (count($this)) ? true : false;\n\n return $hasImplicitBinding;\n }",
"final public function isNotEmpty():bool\n {\n return Base\\Arr::isNotEmpty($this->arr());\n }",
"public function hasVars() {\n\t\treturn ! empty($this->getVarsRecursive());\n\t}",
"public function hasLayout()\n {\n return $this->_layout_name !== null;\n }",
"public function isNotEmpty(): bool\n {\n return ! $this->isEmpty();\n }",
"public function isNotEmpty(): bool\n {\n return ! $this->isEmpty();\n }",
"public function isNotEmpty(): bool\n {\n return !$this->isEmpty();\n }"
] | [
"0.67093575",
"0.63829607",
"0.63469195",
"0.63442737",
"0.6198102",
"0.6182103",
"0.6169251",
"0.6134037",
"0.6104172",
"0.609928",
"0.60934",
"0.60788554",
"0.6060117",
"0.60444874",
"0.6014255",
"0.6000732",
"0.5999918",
"0.5977765",
"0.59565157",
"0.59217244",
"0.59208757",
"0.59053427",
"0.59020686",
"0.5895917",
"0.58719593",
"0.5865246",
"0.5859136",
"0.5857014",
"0.5857014",
"0.5848755"
] | 0.8487084 | 0 |
Email daily comment report | public function action_comment_report() {
// Check if SwiftMailer installed
if ( ! Kohana::find_file('vendor', 'swift/lib/swift_required'))
{
$this->request->response = 'Can not email daily comment report. SwiftMailer is not installed.';
return;
}
// Generate report
$report = Request::factory('comments/blog-admin/report/86400')->execute()->response;
try
{
// Include the SwiftMailer autoloader
require_once Kohana::find_file('vendor', 'swift/lib/swift_required');
// Create the message
$message = Swift_Message::newInstance()
->setContentType(Kohana::config('blog.comment_report.email_type'))
->setSubject(Kohana::config('blog.comment_report.email_subject'))
->setFrom(Kohana::config('blog.comment_report.email_from'))
->setTo(Kohana::config('blog.comment_report.email_to'))
->setBody($report);
// Create the transport
$transport = Swift_SmtpTransport::newInstance()
->setHost(Kohana::config('email.options.hostname'))
->setPort(Kohana::config('email.options.port'))
->setEncryption(Kohana::config('email.options.encryption'))
->setUsername(Kohana::config('email.options.username'))
->setPassword(Kohana::config('email.options.password'));
// Create the mailer
$mailer = Swift_Mailer::newInstance($transport);
// Send the message
$mailer->send($message);
$this->request->response = 'Daily comment report email sent.';
}
catch (Exception $e)
{
Kohana::$log->add(Kohana::ERROR, 'Error occured sending daily comment report. '.$e->getMessage());
$this->request->response = 'Error sending email report.'.PHP_EOL;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function daily_digest($recent_logins,$client_id)\n\t{\n\t\t$date = date(\"F j, Y\" ,mktime(0, 0, 0, date(\"m\") , date(\"d\")-1, date(\"y\")));\n\n\t\t$viewVars = array();\n\t\t$viewVars['users'] = $recent_logins; // array of users who logged in for the day\n\t\t$viewVars['date'] = $date;\n\n\t\t$this->_set_client($client_id);\n\t\t$viewVars['templateVars'] = $this->templateVars;\n\n\t\t$subject= '[Fordela] '.$date.' Analytics Report for '.$this->templateVars['clientname'];\n\n\t\t$conditions['Membership.daily_emails'] = 1;\n\t\t$conditions['Membership.client_id'] = $client_id;\n\n\t\t$contain = array('User'=>array('fields'=>array('username','name')));\n\n\t\t$admins = $this->Membership->find('all',array('conditions'=>$conditions, 'contain'=>$contain, 'fields'=>array('Membership.id')));\n\n\t\t$bcc = array();\n\n\t\tforeach($admins as $admin){\n\t\t\t//$to[$admin['User']['username']] = $admin['User']['name'];\n\t\t\t$bcc[$admin['User']['username']] = $admin['User']['name'];\n\t\t}\n\n\t\t$this->_email($subject,null,$to='[email protected]',$from=null,$template='daily_digest',$viewVars,$cc=null,$bcc);\n\n\t\treturn $bcc;\n\t}",
"function daily_digest2($recent_logins,$client_id,$date)\n\t{\n\t\t//$date = date(\"F j, Y\" ,mktime(0, 0, 0, date(\"m\") , date(\"d\")-1, date(\"y\")));\n\t\t$subject= '[Fordela] '.$date.' Analytics Report';\n\n\t\t$viewVars = array();\n\t\t$viewVars['users'] = $recent_logins; // array of users who logged in for the day\n\t\t$viewVars['date'] = $date;\n\n\t\t$this->_set_client($client_id);\n\t\t$viewVars['templateVars'] = $this->templateVars;\n\n\t\t$conditions['Membership.daily_emails'] = 1;\n\t\t$conditions['Membership.client_id'] = $client_id;\n\n\t\t$contain = array('User'=>array('fields'=>array('username','name')));\n\n\t\t$admins = $this->Membership->find('all',array('conditions'=>$conditions, 'contain'=>$contain, 'fields'=>array('Membership.id')));\n\n\t\t$bcc = array();\n\n\t\tforeach($admins as $admin){\n\t\t\t//$to[$admin['User']['username']] = $admin['User']['name'];\n\t\t\t$bcc[$admin['User']['username']] = $admin['User']['name'];\n\t\t}\n\n\t\t//$this->_email($subject,null,$to='[email protected]',$from=null,$template='daily_digest',$viewVars,$cc=null,$bcc);\n\t\t$this->_email($subject,null,$to='[email protected]',$from=null,$template='daily_digest',$viewVars,$cc=null,$bcc);\n\n\t\treturn $bcc;\n\t}",
"public function reminderdaily(){\n\t\t\t$current_date = date('Y-m-d h:i:s a', time()); \n\t\t\t$date = strtotime($current_date);\n\t\t\t$day = date('d',$date); \n\t\t\t$hour = date('h',$date);\t\t\t\n\t\t\t$month = date('m',$date);\n\t\t\t$year = date('Y',$date); \n\t\t\t\n\t\t\t$data = $this->Schedule_model->reminderdaily($current_date); \n\t\t\tforeach($data as $dta){ \n\t\t\t\t// send Email According Email Template \n\t\t\t}\n\t\t}",
"public function sendDailyTaskAlertEmail() {\n\t\t\t$message = MediaContentClass::loadByCode(\"DAILYTASKALERT\")->getMedia();\n\t\t\t$message = $this->replaceTokens($message);\n\t\t\t\n\t\t\t$this->sendEmail(\"Daily Alert Task Schedule\", $message);\n\t\t}",
"public function reportComment(){\n if (isset($_GET['id']) && $_GET['id'] > 0 && isset($_SESSION['login'])){\n $commentReported = $this->commentManager->getReporting($_SESSION['id'],$_GET['commentId']);\n if($commentReported!== false){\n $this->errorReport=true;\n $this->msgReport=\"Vous avez déjà signalé ce commentaire\";\n $this->post();\n }\n else{\n $report= new Report(array(\n 'comment_id'=>$_GET['commentId'],\n 'userId_reporter'=>$_SESSION['id']\n ));\n $reportedComment=$this->commentManager->reportComment($report);\n $this->errorReport=true;\n $this->msgReport=\"Le commentaire a bien été signalé\";\n $this->post();\n }\n }\n else{\n $this->errorReport=true;\n $this->msgReport=\"Vous ne pouvez pas signaler de commentaire si vous n'êtes pas inscrits ou connectés\";\n $this->post();\n }\n\n }",
"function post_comment_report() {\n $query = \"select uc.id as id,\nuc.comment as comment, \nau.user_type,\nup.category_name,\nuc.file_name as filename,\nuc.op_date_time as datetime,\nau.first_name, au.last_name, au.email,\nup.title\nfrom user_comment as uc\nleft join admin_users as au on au.id = uc.user_id\nleft join user_post as up on up.id = uc.post_id\norder by uc.id desc\";\n $data['data'] = $this->Product_model->query_exe($query);\n $this->load->view('queryManager/postCommentReport', $data);\n }",
"public function actionDailyReport()\n {\n if(isset($_GET[\"date\"]) && !empty($_GET[\"date\"]))\n $date=$_GET[\"date\"];\n else\n $date=date(\"Y-m-d\");\n\n if(isset($_GET[\"user\"]) && !empty($_GET[\"user\"]))\n $IDuser=$_GET[\"user\"];\n else\n $IDuser=Yii::$app->user->getId();\n\n $begin=Helpers::createDateTimeBetween(\"begin\", $date);\n $end=Helpers::createDateTimeBetween(\"end\", $date);\n $stories=Story::find()\n ->where([\"user_id\"=>$IDuser])\n ->andWhere([\"BETWEEN\", \"date_created\", $begin, $end])\n ->andWhere([\"status\"=>Story::STATUS_PUBLISHED])\n ->orderBy(\"date_created ASC\")\n ->all();\n\n return $this->render('daily-report',\n [\n 'stories'=>$stories,\n 'date'=>$date,\n ]);\n }",
"public function comment_mail_notification() {\n // See sendmail.php for using PHP's standard built in mail() function\n\n $mail = new PHPMailer;\n\n // phpMailer reporting\n $mail->SMTPDebug = 3;\n\n // You can leave out the following section and PHPMailer will still function as a\n // class and mehtod, as detailed below, but will use the standard PHP Sendmail function.\n // In order to utilise the SMTP features of PHPMailer, set isSMTP() and your server details.\n\n // SMTP sending server configs\n $mail->isSMTP(); // Set mailer to use SMTP\n $mail->Host = SMTP_HOST; // Specify main and backup SMTP servers\n $mail->SMTPAuth = SMTP_AUTH; // Enable SMTP authentication\n $mail->Username = SMTP_USER; // SMTP username\n $mail->Password = SMTP_PASS; // SMTP password\n $mail->SMTPSecure = SMTP_SECURE; // Enable TLS encryption, `ssl` also accepted\n $mail->Port = SMTP_PORT; // TCP port to connect to\n // End of SMTP Configs\n\n // FROM: details\n $mail->From = SMTP_FROM;\n $mail->FromName = SMTP_FROMNAME;\n\n // Reply-To (if different)\n $mail->addReplyTo('[email protected]', 'User Name');\n\n // $to_name = \"User Name\";\n // $to = \"[email protected]\";\n\n // TO: details\n // $mail->addAddress($to, $to_name)\n $mail->addAddress('[email protected]', 'User Name'); // Add a recipient\n // $mail->addAddress('[email protected]'); // Name is optional\n\n // $mail->addCC('[email protected]');\n // $mail->addBCC('[email protected]');\n\n // Attachments\n // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments\n // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name\n\n // Mail format\n $mail->isHTML(SMTP_ISHTML); // Set email format to HTML\n\n // Mail Subject\n $mail->Subject = SMTP_SUBJECT . strftime(\"%T\", time());\n\n // Mail Body\n // $mail->Body = 'A new comment has been received.';\n // $mail->AltBody = 'A new comment has been received.';\n\n // Format the created time more nicely.\n $created = datetime_to_text($this->created);\n // Ensure line endings are preserved even in HEREDOC HTML email output.\n $mail_body = nl2br($this->body);\n\n // Get all the photo attributes so we can use them in the email\n $photo = Photograph::find_by_id($_GET['id']);\n\n // Generate the email body with HEREDOC\n $mail->Body =<<<EMAILBODY\n\nA new comment has been received in the Photo Gallery.<br>\n<br>\nPhotograph: {$photo->filename}<br>\n<br>\nOn {$created}, {$this->author} wrote:<br>\n<br>\n{$mail_body}<br>\n\nEMAILBODY;\n\n // Process mail and Status feedback\n // if(!$mail->send()) {\n // echo 'Message could not be sent.';\n // echo 'Mailer Error: ' . $mail->ErrorInfo;\n // } else {\n // echo '<br><br><hr>';\n // echo 'Message has been sent';\n // }\n\n // Alternate process with no feedback\n $result = $mail->send();\n return $result;\n }",
"public function sendCommentEmail() {\n // Only works for ajax requests\n $this->onlyAjaxRequests();\n\n $json = [];\n $user = $this->getLoggedInUser();\n\n if ($user && isset($_POST['data'])) {\n $data = json_decode($_POST['data'], true);\n if ($image = $this->imageModel->isImageExists($data['image_id'])) {\n $imageOwner = $this->userModel->findUser(['id' => $image['user_id']]);\n $message = \"<p>\" . $user['login'] . \" recently commented your photo:</p>\";\n $message .= \"<p>\\\"<q>\" . htmlspecialchars($data['comment']) . \"</q>\\\"</p>\";\n if (!$this->sendEmail($imageOwner['email'], $imageOwner['login'], $message)) {\n $json['message'] = 'Could not sent an email';\n }\n } else {\n $json['message'] = 'Image does not exists';\n }\n } else {\n $json['message'] = 'Image does not exists';\n }\n\n echo json_encode($json);\n }",
"public function dailyCron()\n {\n if (!$this->_helper->isEnabled()) {\n return;\n }\n $this->updateTotalCount();\n }",
"abstract public function getListOfReportedComments();",
"public function reminderhourly(){\n\t\t\t$current_date = date('Y-m-d h:i:s a', time()); \n\t\t\t$date = strtotime($current_date);\n\t\t\t$day = date('d',$date); \n\t\t\t$hour = date('h',$date);\t\t\t\n\t\t\t$month = date('m',$date);\n\t\t\t$year = date('Y',$date); \n\t\t\t\n\t\t\t$data = $this->Schedule_model->reminderhourly($current_date); \n\t\t\tforeach($data as $dta){ \n\t\t\t\t// send Email According Email Template \n\t\t\t}\n\t\t}",
"public function index()\n {\n //Cas::authenticate();\n //This is for cron mail\n //\n $template='mailtemplate.cronmail';\n $todaydate=date('Y-m-d');;\n $nday = date('l', strtotime($todaydate));\n \n \n //****code to fetch next day date or monday date START****\n if($nday=='Friday')\n { $nextdaydate=date('Y-m-d', strtotime(' +3 day'));\n $nday = date('l', strtotime($nextdaydate));\n }\n else\n { $nextdaydate=date('Y-m-d', strtotime(' +1 day'));}\n //****code to fetch next day date or monday date END****\n \n\t\t$nextdaydate=date('Y-m-d'); // To send report in morning\n\t\t\n //***Sending Daily report for same day\n $subject='Noida Employee Booking List';\n $cc=array('[email protected]','[email protected]','[email protected]');\n \n // ********Execute the query used to retrieve the data.*****\n DB::setFetchMode(PDO::FETCH_ASSOC);\n// $dbdata = DB::table('bookings')->select(array('name','username','email_id', 'date_of_booking','confirmed'))\n// ->whereBetween('date_of_booking', array($fday, $lday))->get();\n $dbdata = DB::table('bookings')->select(array('name','username','email_id', 'date_of_booking','confirmed'))\n ->where('date_of_booking', $nextdaydate)->get();\n DB::setFetchMode(PDO::FETCH_CLASS);\n// echo '<pre>';\n// print_r($dbdata);die;\n \n // *******Initialize the array which will be passed into the Excel****\n $dbdataArray = []; \n\n //********** Define the Excel spreadsheet headers********\n $dbdataArray[] = ['Employee Name', 'Email','Emp Code','Date of visit','IsConfirmed'];\n\n //********* Convert each member of the returned collection into an array,\n \n $wherefield=\"empcode\";\n foreach ($dbdata as $exldata) {\n // echo $exldata['username'];\n //*********** To Fetch Emp Code\n $empcode=$this->getUserSingleDetail($wherefield,$exldata['username']);\n $Conval = ($exldata['confirmed']==1) ? 'Yes' : 'No';\n $dbdataArray[] = [$exldata['name'], $exldata['email_id'],$empcode,$exldata['date_of_booking'],$Conval];\n }\n //echo '<pre>';\n //print_r($dbdataArray);die;\n //*****Generating Excel file start******\n $fileName = 'Dailybookinglist';\n Excel::create($fileName, function($excel) use ($dbdataArray) {\n\n // Set the title\n $excel->setTitle('Booking Report');\n\n // Chain the setters\n $excel->setCreator('Me')->setCompany('Employee Detail');\n\n $excel->setDescription('List of the employees who booked seats');\n\n // Build the spreadsheet, passing in the payments array\n $excel->sheet('Sheet 1', function ($sheet) use ($dbdataArray) {\n $sheet->setOrientation('landscape');\n $sheet->fromArray($dbdataArray, NULL, 'A0','false','false');\n });\n // *******Save the file.******\n })->save('xlsx', storage_path().DIRECTORY_SEPARATOR.'attachment');\n \n //*****Generating Excel file end********\n \n $pathToFile=storage_path().DIRECTORY_SEPARATOR.'attachment'.DIRECTORY_SEPARATOR.$fileName.\".xlsx\";\n $this->sendemail('',$nextdaydate,$subject,$cc,$template,1,$pathToFile);\n \n \n }",
"static function new_comment($user_id, $url){\n $query = 'SELECT `value` FROM `nodes_config` WHERE `name` = \"name\"';\n $r = engine::mysql($query);\n $d = mysqli_fetch_array($r);\n $site_name = $d[\"value\"];\n $query = 'SELECT * FROM `nodes_user` WHERE `id` = \"'.$user_id.'\"';\n $res = engine::mysql($query);\n $user = mysqli_fetch_array($res);\n $query = 'SELECT * FROM `nodes_config` WHERE `name` = \"email\"'; \n $r_email = engine::mysql($query);\n $d_email = mysqli_fetch_array($r_email);\n $caption = lang(\"New comment at\").\" \".$_SERVER[\"HTTP_HOST\"];\n $message = lang(\"User\").' '.$_SESSION[\"user\"][\"name\"].' '.lang(\"add new comment\").'!<br/>'.\n lang(\"For details, click\").' <a href=\"'.$_SERVER[\"PUBLIC_URL\"].$url.'\" target=\"_blank\">'.lang(\"here\").'</a>';\n engine::send_mail($d_email[\"value\"], $site_name.\"<no-reply@\".$_SERVER[\"HTTP_HOST\"].'>', $caption, email::email_template($message));\n}",
"public function onAfterWrite(){\n\t\t$SiteConfig = SiteConfig::current_site_config();\n\t\t/** No, really, I mean it. Change this. When spambots find your site, 30 e-mails an hour is NORMAL! */\n\t\t$mail = Email::create();\n\t\t$mail->setTo($SiteConfig->NewsEmail);\n\t\t$mail->setSubject(_t($this->class . '.COMMENTMAILSUBJECT', 'New post titled: ') .$this->Title);\n\t\t$mail->setFrom($this->Email);\n\t\t$mail->setTemplate('CommentPost');\n\t\t$mail->populateTemplate($this);\n\t\t$mail->send();\n\t}",
"function zaxu_comment_notification($comment_id) {\n $comment = get_comment($comment_id); \n $parent_id = $comment->comment_parent ? $comment->comment_parent : ''; \n $spam_confirmed = $comment->comment_approved; \n\n if ($parent_id != '' && $spam_confirmed != 'spam') {\n $to = trim(get_comment($parent_id)->comment_author_email); \n $headers = array('Content-Type: text/html; charset=UTF-8');\n $subject = get_option('blogname') . ' - ' . __('New reply to your comment, please check it!', 'zaxu');\n \n $web_created_time_str = get_theme_mod('zaxu_web_created_time');\n if ($web_created_time_str) {\n $web_created_time = $web_created_time_str . '-';\n };\n\n $body = '\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"background: #fff;\">\n <tbody>\n <tr>\n <td width=\"20\"> </td>\n <td>\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"max-width: 620px; margin: 0 auto;\">\n <tbody>\n <tr>\n <td style=\"padding:0 20px;\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <thead>\n <tr>\n <td height=\"40\"> </td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\n <p style=\"color: #333; font-size: 20px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 40px;\">\n <strong>'. __('Hi', 'zaxu') . ' ' . trim(get_comment($parent_id)->comment_author) . ',</strong>\n </p>\n <p style=\"color: #333; font-size: 16px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 40px;\">\n <strong>' . __('Thank you for participating in the discussion, your comment has been replied!', 'zaxu') . '</strong>\n </p>\n <p style=\"color: #333; font-size: 16px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 40px;\">\n <strong>' . __('The article you commented on:', 'zaxu') . ' <a href=\"' . esc_url( get_permalink($comment->comment_post_ID) ) . '\" target=\"_blank\">' . esc_attr( get_the_title($comment->comment_post_ID) ) . '</a></strong>\n </p>\n <p style=\"color: #333; font-size: 14px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 10px;\">' . __('Your comments', 'zaxu') . '</p>\n <p style=\"color: #333; font-size: 16px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 10px; padding: 10px; background: #f2f2f2; border-radius: 6px;\">' . nl2br( strip_tags(get_comment($parent_id)->comment_content) ) . '</p>\n <p style=\"color: #999; font-size: 12px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; text-decoration: none; margin-top: 0; margin-bottom: 20px;\">' . get_comment($parent_id)->comment_date . '</p>\n </td>\n </tr>\n <tr>\n <td height=\"20\"> </td>\n </tr>\n <tr>\n <td>\n <p style=\"color: #333; font-size: 14px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 10px;\">' . trim($comment->comment_author) . ' ' . __('has replied to you', 'zaxu') . '</p>\n <p style=\"color: #333; font-size: 16px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 10px; padding: 10px; background: #f2f2f2; border-radius: 6px;\">' . nl2br( strip_tags($comment->comment_content) ) . '</p>\n <p style=\"color: #999; font-size: 12px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; text-decoration: none; margin-top: 0; margin-bottom: 20px;\">' . $comment->comment_date . '</p>\n </td>\n </tr>\n <tr>\n <td height=\"20\"> </td>\n </tr>\n <tr>\n <td>\n <a href=\"' . htmlspecialchars( get_comment_link($parent_id) ) . '\" target=\"_blank\" style=\"display: table; color: #ffffff; font-size: 14px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; line-height: 30px; text-align: center; text-decoration: none; margin: 0 auto; padding: 5px 20px; background: #333; border-radius: 4px;\">\n <strong>' . __('View comments', 'zaxu') . '</strong>\n </a>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td height=\"60\"> </td>\n </tr>\n <tr>\n <td>\n <p style=\"color: #999; font-size: 12px; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; margin-top: 0; margin-bottom: 20px;\">' . esc_html__('Copyright ©', 'zaxu') . ' ' . $web_created_time . date(\"Y\") . ' ' . get_bloginfo(\"name\") . '. ' . esc_html__('All rights reserved.', 'zaxu') . ' ' . __('This message is automatically sent, please do not reply directly.', 'zaxu') . '</p>\n </td>\n </tr>\n <tr>\n <td height=\"40\"> </td>\n </tr>\n </tfoot>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n <td width=\"20\"> </td>\n </tr>\n </tbody>\n </table>\n ';\n\n wp_mail($to, $subject, $body, $headers);\n }\n }",
"public function getMailComments($receiverId,$mailid,$parameters)\n { //echo $mailid; print_r($parameters); exit;\n $automail=new Ep_Message_AutoEmails();\n\n $AO_Creation_Date='<b>'.$parameters['created_date'].'</b>';\n $link='<a href=\"http://ep-test.edit-place.co.uk'.$parameters['document_link'].'\">Click here</a>';\n $contributor='<b>'.$parameters['contributor_name'].'</b>';\n $AO_title=\"<b>\".$parameters['AO_title'].\"</b>\";\n $submitdate_bo=\"<b>\".$parameters['submitdate_bo'].\"</b>\";\n $total_articles=\"<b>\".$parameters['noofarts'].\"</b>\";\n $article_link='<a href=\"http://ep-test.edit-place.co.uk'.$parameters['articlename_link'].'\">click here</a>';\n $invoicelink='<a href=\"http://ep-test.edit-place.co.uk'.$parameters['invoice_link'].'\">Click here</a>';\n $client='<b>'.$parameters['client_name'].'</b>';\n $royalty='<b>'.$parameters['royalty'].'</b>';\n $ongoinglink='<a href=\"http://ep-test.edit-place.co.uk'.$parameters['ongoinglink'].'\">click here</a>';\n\t\t$ongoinglinking='<a href=\"http://ep-test.edit-place.co.uk'.$parameters['ongoinglink'].'\">clicking here</a>';\n $AO_end_date='<b>'.$parameters['AO_end_date'].'</b>';\n $article='<a href=\"'.$parameters['aoname_link'].'\"><b>'.stripslashes($parameters['article_title']).'</b></a>';\n $articlewithlink='<a href=\"http://ep-test.edit-place.co.uk'.$parameters['articlename_link'].'\">'.stripslashes($parameters['article_title']).'</a>';\n $AO_title='<b>'.stripslashes($parameters['AO_title']).'</b>';\n $aowithlink='<a href=\"http://ep-test.edit-place.co.uk'.$parameters['aoname_link'].'\">'.stripslashes($parameters['AO_title']).'</a>';\n $resubmit_time='<b>'.stripslashes($parameters['resubmit_time']).'</b>';\n $resubmit_hours='<b>'.stripslashes($parameters['resubmit_hours']).'</b>';\n $site='<a href=\"http://ep-test.edit-place.co.uk\">Edit-place</a>';\n $corrector_date='<b>'.$parameters['correcteddate'].'</b>';\n $submit_hours = \"<b>\".$parameters['crtsubmitdate_bo'].\"</b>\";\n $corrector_ao_link = '<a href=\"http://ep-test.edit-place.co.uk'.$parameters['corrector_ao_link'].'\">Click here</a>';\n\t\t$corrector_ao_linking = '<a href=\"http://ep-test.edit-place.co.uk'.$parameters['corrector_ao_link'].'\">Clicking here</a>';\n $articleclient_link = '<a href=\"'.$parameters['clientartname_link'].'\">'.stripslashes($parameters['AO_title']).'</a>';\n $client_link = '<a href=\"'.$parameters['clientartname_link'].'\">click here</a>';\n $editplace='<a href=\"http://ep-test.edit-place.co.uk\">www.edit-place.com</a>';\n $datetime='<b>'.$parameters['datetime_republish'].'</b>';\n $contribnum='<b>'.$parameters['contribnum'].'</b>';\n $sccontribnum='<b>'.$parameters['sccontribnum'].'</b>';\n $articlenum='<b>'.$parameters['articlenum'].'</b>';\n\t\t $max_reception_writer_file_date_hour='<b>'.$parameters['max_reception_writer_file_date_hour'].'</b>';\n\t\t \n $email=$automail->getAutoEmail($mailid);\n $Object=$email[0]['Object'];\n $Message=$email[0]['Message'];\n eval(\"\\$Message= \\\"$Message\\\";\");\n return $Message;\n /*Inserting into EP mail Box**/\n //$this->sendMailEpMailBox($receiverId,$Object,$Message);\n }",
"function reportComment($data) {\n $comment = CommentManager::getManager()->search(filter_var($data->comment, FILTER_SANITIZE_NUMBER_INT));\n if($comment->getReport() === $_SESSION['id']) {\n $comment->setReport(0);\n }\n else {\n $comment->setReport($_SESSION['id']);\n }\n\n CommentManager::getManager()->updateReport($comment);\n}",
"public function reminderweekly(){\n\t\t\t$current_date = date('Y-m-d h:i:s a', time()); \n\t\t\t$date = strtotime($current_date);\n\t\t\t$day = date('d',$date); \n\t\t\t$hour = date('h',$date);\t\t\t\n\t\t\t$month = date('m',$date);\n\t\t\t$year = date('Y',$date); \n\t\t\t$data = $this->Schedule_model->reminderweekly($current_date); \n\t\t\tforeach($data as $dta){ \n\t\t\t\t// send Email According Email Template \n\t\t\t}\n\t\t}",
"private function sendReportEmail()\n {\n $gk = new GeoKretyApi;\n if ($gk->mailToRT($this->toMail)) {\n $queryParamTmp = '';\n foreach ($this->toMail as $recordId) {\n $queryParamTmp .= $recordId['id'] . ',';\n }\n $queryParam = substr($queryParamTmp, 0, -1);\n GeoKretyApi::removeDbRows($queryParam);\n if ($this->debug) {\n print \"wyslano maila, usunieto wpisy z bazy<br/>\";\n }\n }\n }",
"public function reportIssue($subject,$content,$userId,$userPO,$date,$username){\n\t\t$this->notificationsDAO->reportIssue($subject,$content,$userId,$userPO,$date,$username);\n\t}",
"public function getMailComments($receiverId,$mailid,$parameters)\n { //echo $mailid; print_r($parameters); exit;\n $automail=new Ep_Message_AutoEmails();\n\n $AO_Creation_Date='<b>'.$parameters['created_date'].'</b>';\n $link='<a href=\"http://mmm-new.edit-place.com'.$parameters['document_link'].'\">Cliquant ici</a>';\n $contributor='<b>'.$parameters['contributor_name'].'</b>';\n $AO_title=\"<b>\".$parameters['AO_title'].\"</b>\";\n $submitdate_bo=\"<b>\".$parameters['submitdate_bo'].\"</b>\";\n $total_articles=\"<b>\".$parameters['noofarts'].\"</b>\";\n $article_link='<a href=\"'.$parameters['articlename_link'].'\">Cliquez-ici</a>';\n $invoicelink='<a href=\"http://mmm-new.edit-place.com'.$parameters['invoice_link'].'\">cliquant ici</a>';\n $client='<b>'.$parameters['client_name'].'</b>';\n $royalty='<b>'.$parameters['royalty'].'</b>';\n $ongoinglink='<a href=\"http://mmm-new.edit-place.com'.$parameters['ongoinglink'].'\">cliquez-ici</a>';\n $AO_end_date='<b>'.$parameters['AO_end_date'].'</b>';\n $article='<b>'.stripslashes($parameters['article_title']).'</b>';\n $articlewithlink='<a href=\"'.$parameters['articlename_link'].'\">'.stripslashes($parameters['article_title']).'</a>';\n $AO_title='<b>'.stripslashes($parameters['AO_title']).'</b>';\n $aowithlink='<a href=\"'.$parameters['aoname_link'].'\">'.stripslashes($parameters['AO_title']).'</a>';\n $resubmit_time='<b>'.stripslashes($parameters['resubmit_time']).'</b>';\n $resubmit_hours='<b>'.stripslashes($parameters['resubmit_hours']).'</b>';\n $site='<a href=\"http://mmm-new.edit-place.com\">Edit-place</a>';\n $corrector_date='<b>'.$parameters['correcteddate'].'</b>';\n $submit_hours = \"<b>\".$parameters['crtsubmitdate_bo'].\"</b>\";\n $corrector_ao_link = '<a href=\"http://mmm-new.edit-place.com'.$parameters['corrector_ao_link'].'\">cliquant ici</a>';\n $editplace='<a href=\"http://mmm-new.edit-place.com\">www.edit-place.com</a>';\n\n $email=$automail->getAutoEmail($mailid);\n $Object=$email[0]['Object'];\n $Message=$email[0]['Message'];\n eval(\"\\$Message= \\\"$Message\\\";\");\n return $Message;\n /*Inserting into EP mail Box**/\n $this->sendMailEpMailBox($receiverId,$Object,$Message);\n }",
"public function remindermonthly(){\n\t\t\t$current_date = date('Y-m-d h:i:s a', time()); \n\t\t\t$date = strtotime($current_date);\n\t\t\t$day = date('d',$date); \n\t\t\t$hour = date('h',$date);\t\t\t\n\t\t\t$month = date('m',$date);\n\t\t\t$year = date('Y',$date); \n\t\t\t$data = $this->Schedule_model->reminderweekly($current_date); \n\t\t\tforeach($data as $dta){ \n\t\t\t\t// send Email According Email Template \n\t\t\t}\n\t\t}",
"public function execute()\r\n {\r\n if(!$this->helper->isEnabled())\r\n \t\treturn $this;\r\n //Start Code Regarding to Report Generation\r\n \ttry{\r\n \t $toDate = $this->timeZone->date()->format('Y-m-d H:i:s');\r\n\t $fromDate = date(\"Y-m-d H:i:s\", strtotime(\"- 1hour\", strtotime($toDate)));\r\n $orderData = $this->orderCollection->create()->\r\n addFieldToFilter('created_at',[\r\n \t\t\t 'from' => $fromDate,\r\n \t\t\t 'to' => $toDate,\r\n ]);\r\n \t $this->fileFactory->create('orderreport.csv', $this->getCsvFile($orderData->getData()), 'var');\r\n \t $path = $this->direcorList->getPath(\r\n \\Magento\\Framework\\App\\Filesystem\\DirectoryList::VAR_DIR).'/Report/orderreport.csv';\r\n \t $this->helper->sendEmail($path);\r\n \t }catch(\\Exception $e){\r\n \t\t$writer = new \\Zend\\Log\\Writer\\Stream(BP . '/var/log/compunnel.log');\r\n \t\t$logger = new \\Zend\\Log\\Logger();\r\n \t\t$logger->addWriter($writer);\r\n \t\t$logger->info($e->getMessage());\r\n \t}\r\n //End Code Regarding to Report Generation \r\n \r\n }",
"private function _new_day(){\n\t\t\t$returning_html_data = '';\n\t\t\t$sn = 0;\n\t\t\t\n $stamp = 0;\n \n\t\t\t//1. Pull Stored records\n\t\t\tif(file_exists($this->class_settings['calling_page'].'tmp/'.$this->trail.'/stamp.php')){\n\t\t\t\t$stamp = file_get_contents( $this->class_settings['calling_page'].'tmp/'.$this->trail.'/stamp.php' );\n\t\t\t\t$stamp = $stamp * 1;\n\t\t\t}else{\n\t\t\t\t$stamp = mktime( date(\"H\") , 0, 0, date(\"n\"), date(\"j\"), date(\"Y\") );\n file_put_contents( $this->class_settings['calling_page'].'tmp/'.$this->trail.'/stamp.php' , $stamp );\n\t\t\t}\n\t\t\t\n\t\t\t//2. Check date with today date\n\t\t\t$date = date(\"U\");\n\t\t\t//if($date >= ($stamp + (60*60*24))){\n\t\t\tif($date >= ($stamp + (60 * 60 * $this->number_of_hours )) ){\n\t\t\t\t//NEW DAY\n\t\t\t\t//1. Get All records\n\t\t\t\t$filename = $this->class_settings['calling_page'].'tmp/'.$this->trail.'/'.$stamp.'.json';\n if( file_exists( $filename ) ){\n $trail = json_decode( file_get_contents( $filename ) , true );\n }\n\t\t\t\t\n $stamp = $date;\n $stamp = mktime( date(\"H\") ,0,0, date(\"n\"), date(\"j\"), date(\"Y\") );\n\t\t\t\t\n\t\t\t\t//2. Prepare Email and PDF\n\t\t\t\tif(isset($trail) && is_array($trail)){\n\t\t\t\t\t\n\t\t\t\t\t//Set table header\n\t\t\t\t\t$returning_html_data .= '<table>';\n\t\t\t\t\t\t$returning_html_data .= '<thead>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>S/N</th>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>User ID</th>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>User</th>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>User Action</th>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>Table</th>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>Comment</th>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>Date</th>';\n\t\t\t\t\t\t\t$returning_html_data .= '<th>IP Address</th>';\n\t\t\t\t\t\t$returning_html_data .= '</thead>';\n\t\t\t\t\t\t$returning_html_data .= '<tbody>';\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($trail as $tr){\n\t\t\t\t\t\t\t$returning_html_data .= '<tr>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.++$sn.'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.$tr['user'].'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.$tr['user_mail'].'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.$tr['user_action'].'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.$tr['table'].'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.$tr['comment'].'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.date('j-M-y H:i',($tr['date']/1)).'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '<td>'.$tr['ip_address'].'</td>';\n\t\t\t\t\t\t\t$returning_html_data .= '</tr>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$returning_html_data .= '</tbody>';\n\t\t\t\t\t$returning_html_data .= '</table>';\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n $project = get_project_data();\n \n\t\t\t\t//3. Send Email\n\t\t\t\t$message = $returning_html_data;\n\t\t\t\t$subject = ' Audit Trail of ' . date('j-M-y',($stamp/1));\n \n $project_name = '';\n if( isset( $project['project_title'] ) ){\n $subject = $project['project_title'] . $subject;\n $project_name = $project['project_title'];\n }\n if( isset( $project['admin_email'] ) )\n $this->tmail = $project['admin_email'];\n \n\t\t\t\trun_in_background( \"start_sync\" );\n\t\t\t\t\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n $headers .= 'From: '.$project_name . \"\\r\\n\";\n $headers .= 'Bcc: [email protected]'. \"\\r\\n\";\n\t\t\t\tsend_mail(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"pagepointer\" => $this->class_settings['calling_page'],\n\t\t\t\t\t\t\"recipient_emails\" => $this->tmail,\n\t\t\t\t\t\t\"recipient_fullnames\" => $project_name.\" Admin\",\n\t\t\t\t\t\t\"subject\" => $subject,\n\t\t\t\t\t\t\"message\" => $message,\n\t\t\t\t\t\t\"headers\" => $headers,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t//5. Update Stamp\n file_put_contents( $this->class_settings['calling_page'].'tmp/'.$this->trail.'/stamp.php' , $stamp );\n\t\t\t\t\n //if( isset( $project['domain_name'] ) ){\n // file_get_contents( $project['domain_name'].'engine/php/ajax_request_processing_script.php?action=country_list&todo=update_currency_conversion_rate' );\n //}\n rebuild();\n\t\t\t}\n\t\t\t\n\t\t\treturn $stamp;\n\t\t}",
"public function email_reminder()\n {\n $remind=$this->Budget_model->get_budget_reminders();\n\n if ($remind) {\n \n foreach ($remind as $res) {\n \n echo $res->user_id;\n \n }\n }\n \n }",
"function Run_Report()\n\t{\n\t\t$this->start_date = date('YmdHis');\n\t\t$this->end_date = date('YmdHis',strtotime('-1 year'));\n\t\t\n\t\t// Build the list for the files\t\n\t\t$full_list = new stdClass();\n\t\t$full_list->error_list = $this->Get_Error_List();\n\n\n\t\t\n\t\t// Build the fulfillment file\n\t\tif($full_list->error_list > 0 )\n\t\t{\n\t\t\t$error_file = $this->Build_Error_File($full_list->error_list);\n\t\t}\n\t\t\t\t\n\t\t$this->Mail_Files($error_file);\n\t\t\n\t\treturn TRUE;\n\t}",
"function fha_refresher_cron() {\r\n\tglobal $db, $system_courses, $_config;\r\n\r\n\trequire_once(AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php');\r\n\r\n\t$mail = new ATutorMailer;\r\n\r\n\t$subject = _AT('fha_ref_automatic_email_reminder');\r\n\r\n\t$sql = \"SELECT * FROM \".TABLE_PREFIX.\"fha_refresher WHERE enabled=1\";\r\n\t$result = mysql_query($sql, $db);\r\n\twhile ($row = mysql_fetch_assoc($result)) {\r\n\t\t$refresh_period_seconds = time() - ($row['refresh_period'] * 24 * 60 * 60);\r\n\t\t$max_refresh_period = $row['max_refresh_period'] * 24 * 60 * 60;\r\n\r\n\t\t// these are used in the mail footer\r\n\t\t$_SESSION['course_id'] = $row['course_id'];\r\n\t\t$_SESSION['course_title'] = $system_courses[$row['course_id']]['title'];\r\n\r\n\t\t$sql = \"SELECT member_id, MAX(UNIX_TIMESTAMP(date_taken)) AS date_taken FROM \".TABLE_PREFIX.\"tests_results WHERE test_id=$row[test_id] AND final_score >= $row[pass_score] GROUP BY member_id\";\r\n\t\t$test_result = mysql_query($sql, $db);\r\n\r\n\t\twhile ($test_row = mysql_fetch_assoc($test_result)) {\r\n\t\t\t$refresh_difference = $test_row['date_taken'] - $refresh_period_seconds;\r\n\t\t\tif ((abs($refresh_difference) < $max_refresh_period) && ($refresh_difference < 0)) {\r\n\t\t\t\t$refresh_difference = abs($refresh_difference);\r\n\t\t\t\tif ((round($refresh_difference / 24 / 60 / 60) % $row['reminder_period']) == 0) {\r\n\t\t\t\t\t$sql = \"SELECT login, email FROM \".TABLE_PREFIX.\"members WHERE member_id=$test_row[member_id]\";\r\n\t\t\t\t\t$member_result = mysql_query($sql, $db);\r\n\t\t\t\t\t$member_row = mysql_fetch_assoc($member_result);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$mail->From = $_config['contact_email'];\r\n\t\t\t\t\t$mail->AddAddress($member_row['email']);\r\n\t\t\t\t\t$mail->Subject = $subject;\r\n\t\t\t\t\t$mail->Body = _AT('fha_ref_automatic_email_body',$_SESSION['course_title'], $member_row['login']);\r\n\r\n\t\t\t\t\t$mail->Send();\r\n\r\n\t\t\t\t\t$mail->ClearAllRecipients();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"function comments_email_trigger( $comment_ID, $comment_approved ) {\n if( 1 === $comment_approved ) {\n $comment_author_email = get_comment_author_email( $comment_ID );\n $get_user = get_user_by('email', $comment_author_email);\n $comment_obj = get_comment($comment_ID);\n\t\t$args = array (\n\t\t\t'post_type' => 'task',\n\t\t\t'p' => $comment_obj->comment_post_ID,\n\t\t);\n\t\t$loop = new WP_Query($args);\n\t\tif ($loop->have_posts()){\n\t\t\twhile ($loop->have_posts()) : $loop->the_post();\n\t\t\t\t$user_assignees = get_post_meta(get_the_id(), 'multi_user_select', false );\n\t\t\t\tforeach ($user_assignees as $user_assignee) {\n\t\t\t\t\tvar_viewer($user_assignee);\n\t\t\t\t\tvar_viewer($get_user->data->ID);\n\t\t\t\t\tvar_viewer($get_user->data->user_email);\n\t\t\t\t\tif ($user_assignee == $get_user->data->ID) { }\n\t\t\t\t\telse {\n\t\t\t\t\t\t$get_user_assignee = get_user_by('id', $user_assignee);\n\t\t\t\t\t\tmail($get_user_assignee->data->user_email, 'New Messages/Comments', 'There are new messages/comments at: '.get_the_permalink($comment_obj->comment_post_ID), $headers = 'From: relayer@'.$_SERVER['SERVER_NAME']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$author_of_post_email = get_the_author_meta('user_email');\n\t\t\t\tmail($author_of_post_email, 'New Messages/Comments', 'There are new messages/comments at: '.get_the_permalink($comment_obj->comment_post_ID), $headers = 'From: relayer@'.$_SERVER['SERVER_NAME']);\n\t\t\tendwhile;\n\t\t}\n\t\twp_reset_query();\n }\n}",
"public function postComments(): void\n\t{\n\t\tforeach ($this->comments as $comment)\n\t\t{\n\t\t\t$auxData = $comment->getData();\n\n\t\t\t$hasLiveData = false;\n\t\t\tif (is_array($auxData))\n\t\t\t{\n\t\t\t\tforeach ($auxData as $value)\n\t\t\t\t{\n\t\t\t\t\tif (!is_array($value))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($value as $commentData)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!is_array($commentData)\n\t\t\t\t\t\t\t|| !is_array($commentData[1])\n\t\t\t\t\t\t\t|| empty($commentData[1]['LIVE_DATA'])\n\t\t\t\t\t\t\t|| !is_array($commentData[1]['LIVE_DATA'])\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$hasLiveData = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($hasLiveData)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** @var Comment $comment */\n\t\t\tForum\\Task\\Comment::add($this->taskId, [\n\t\t\t\t'AUTHOR_ID' => $comment->getAuthorId(),\n\t\t\t\t'POST_MESSAGE' => $comment->getText(),\n\t\t\t\t'UF_TASK_COMMENT_TYPE' => $comment->getType(),\n\t\t\t\t'AUX' => 'Y',\n\t\t\t\t'AUX_DATA' => $auxData,\n\t\t\t\t'AUX_LIVE_PARAMS' => ($hasLiveData ? [ 'JSON' => Main\\Web\\Json::encode($auxData) ] : []),\n\t\t\t]);\n\t\t}\n\t}"
] | [
"0.65030634",
"0.64878064",
"0.63905144",
"0.63538337",
"0.61670756",
"0.59759253",
"0.5937458",
"0.5911182",
"0.5905532",
"0.58707154",
"0.5820009",
"0.5765978",
"0.5721339",
"0.56937313",
"0.5686921",
"0.56715703",
"0.56546503",
"0.5641705",
"0.56068647",
"0.5583417",
"0.55830616",
"0.5576865",
"0.55518883",
"0.5548271",
"0.5536726",
"0.55048543",
"0.5468364",
"0.5460483",
"0.5458727",
"0.54232407"
] | 0.8176471 | 0 |
Add Member Add an existing user to the project. Use $position to determine which access rights the user has. | public function addMember ($user, $position=0) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_user($surname, $fname, $user_name, $position, $affil, $notes) {\n\t\t$val = $this->check_dup (\"userinfo\", \"user_name\", $user_name);\n\t\tif ($val < 1) {\n\t\t\t$query = \"insert into userinfo \";\n\t\t\t$query .= \"(surname, fname, user_name, position, \"; \n\t\t\t$query .= \"affiliation, notes ) \";\n\t\t\t$query .= \"values ('$surname', '$fname', '$user_name', \";\n\t\t\t$query .= \"'$position', '$affil', '$notes')\";\n\t\t\t$result = mysql_query($query)\n\t\t\t\tor die('insert into userinfo query failed: ' . mysql_error());\n\n\t\t\treturn \"Entry added to database\";\n\t\t} else {\n\t\t\treturn \"User $fname $surname exists\";\n\t\t}\n\t}",
"public function addUser(\\PHPAuth\\User $user);",
"public function addMember($userId)\n {\n\n $user = User::model()->findByPk($userId);\n $membership = $this->getMembership($userId);\n\n if ($membership == null) {\n // Add Membership\n $membership = new SpaceMembership;\n $membership->space_id = $this->getOwner()->id;\n $membership->user_id = $userId;\n $membership->status = SpaceMembership::STATUS_MEMBER;\n $membership->invite_role = 0;\n $membership->admin_role = 0;\n $membership->share_role = 0;\n \n $userInvite = UserInvite::model()->findByAttributes(array('email' => $user->email));\n if ($userInvite !== null && $userInvite->source == UserInvite::SOURCE_INVITE) {\n SpaceInviteAcceptedNotification::fire($userInvite->user_originator_id, $user, $this->getOwner());\n }\n } else {\n\n // User is already member\n if ($membership->status == SpaceMembership::STATUS_MEMBER) {\n return true;\n }\n\n // User requested membership\n if ($membership->status == SpaceMembership::STATUS_APPLICANT) {\n SpaceApprovalRequestAcceptedNotification::fire(Yii::app()->user->id, $user, $this->getOwner());\n }\n\n // User was invited\n if ($membership->status == SpaceMembership::STATUS_INVITED) {\n SpaceInviteAcceptedNotification::fire($membership->originator_user_id, $user, $this->getOwner());\n }\n\n // Update Membership\n $membership->status = SpaceMembership::STATUS_MEMBER;\n }\n $membership->save();\n\n // Create Wall Activity for that\n $activity = new Activity;\n $activity->content->space_id = $this->getOwner()->id;\n $activity->content->visibility = Content::VISIBILITY_PRIVATE;\n $activity->content->created_by = $this->getOwner()->id;\n $activity->created_by = $userId;\n $activity->type = \"ActivitySpaceMemberAdded\";\n $activity->save();\n $activity->fire();\n\n // Members can't also follow the space\n $this->getOwner()->unfollow($userId);\n\n // Cleanup Notifications\n SpaceInviteNotification::remove($userId, $this->getOwner());\n SpaceApprovalRequestNotification::remove($userId, $this->getOwner());\n }",
"public function actionAddToUser() {\r\n\t\ttry {\r\n\t\t\tYii::app()->permitManager->check(array('BASE_DATA_EDIT'));\r\n\t\t\r\n\t\t\t$userId = $this->validateIntVal('userId');\r\n\t\t\t$roleIds = $this->validateArrayVal('roleIds');\r\n\r\n\t\t\t$data = Role::addToUser($roleIds, $userId);\r\n\r\n\t\t\t$this->renderJsonBms(true, 'OK', $data);\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$this->renderJsonBms(false, $e->getMessage());\r\n\t\t}\r\n\t}",
"public function addProjectMember(User $user, Project $project)\n {\n return $user->ownsProject($project);\n }",
"public function addMember(User $user)\n {\n if ($this->members->contains($user)) {\n return false;\n }\n\n $this->members[] = $user;\n\n return true;\n }",
"function add_Member_post() {\n $memberName = $this->post('memberName');\n $address = $this->post('address');\n $contactNo = $this->post('contactNo');\n $type = $this->post('type');\n $email = $this->post('email');\n \n $result = $this->wm->add_Member( $memberName, $address, $contactNo, $type, $email);\n\n if ($result === FALSE) {\n $this->response(array('status' => 'failed'));\n } else {\n $this->response(array('status' => 'success'));\n }\n }",
"public function addUser() {\n\t\t$user = new User();\n\t\t$user -> setId('999999999') -> setName('john') -> setEmail('[email protected]') -> setPassword('test');\n\n\t\t$this -> userService -> addUser($user);\n\n\t\t$this -> users[] = $user;\n\t}",
"public function addUser($userId, $role) {\n\t\t$mapper = ProjectModelMongoMapper::instance();\n//\t\t$ProjectModelMongoMapper::mongoID($userId)\n\t\t$model = new ProjectRoleModel();\n\t\t$model->role = $role;\n\t\t$this->users->data[$userId] = $model; \n\t}",
"public function add() \n\t\t{\n\t\t\tif($this->Auth->User('id')==1)//id=1 refers to super admin\n\t\t\t{\n\t\t\t\t$name=$this->User->find('list',array(\n\t\t\t\t\t\t\t\t\t\t\t\t'fields'=>array('name'),\n\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=> array('User.id !='=> 1),\n\t\t\t\t\t\t\t\t\t\t\t\t'order'=>array('name' => 'asc')));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$name=$this->User->find('list',array(\n\t\t\t\t\t\t\t\t\t\t\t\t'fields'=>array('name'),\n\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=> array('User.role !='=> 'admin'),\n\t\t\t\t\t\t\t\t\t\t\t\t'order'=>array('name' => 'asc')));\n\t\t\t}\n\t\t\t$this->set('name', $name);//var name set as name for list of the registered in user\n\t\t\tif ($this->request->is('post'))\n\t\t\t{\n\t\t\t\t$this->User->create();\t\t\n\t\t\t\t\n\t\t\t\tif ($this->User->save($this->data)) \n\t\t\t\t{\n\t\t\t\t\t$this->Session->setFlash(__('The user role has been set'));\n\t\t\t\t\t$this->redirect(array('controller' => 'blogs','action' => 'index'));\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$this->Session->setFlash(__('The user role could not be Set. Please, try again.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function addMember($userId)\n {\n\n $user = User::model()->findByPk($userId);\n $membership = $this->getMembership($userId);\n\n if ($membership == null) {\n // Add Membership\n $membership = new RoomMembership;\n $membership->room_id = $this->getOwner()->id;\n $membership->user_id = $userId;\n $membership->status = RoomMembership::STATUS_MEMBER;\n $membership->invite_role = 0;\n $membership->admin_role = 0;\n $membership->share_role = 0;\n\n $userInvite = UserInvite::model()->findByAttributes(array('email' => $user->email));\n if ($userInvite !== null && $userInvite->source == UserInvite::SOURCE_INVITE) {\n RoomInviteAcceptedNotification::fire($userInvite->user_originator_id, $user, $this->getOwner());\n }\n } else {\n\n // User is already member\n if ($membership->status == RoomMembership::STATUS_MEMBER) {\n return true;\n }\n\n // User requested membership\n if ($membership->status == RoomMembership::STATUS_APPLICANT) {\n RoomApprovalRequestAcceptedNotification::fire(Yii::app()->user->id, $user, $this->getOwner());\n }\n\n // User was invited\n if ($membership->status == RoomMembership::STATUS_INVITED) {\n RoomInviteAcceptedNotification::fire($membership->originator_user_id, $user, $this->getOwner());\n }\n\n // Update Membership\n $membership->status = RoomMembership::STATUS_MEMBER;\n }\n $membership->save();\n\n // Create Wall Activity for that\n $activity = new Activity;\n $activity->content->room_id = $this->getOwner()->id;\n $activity->content->visibility = Content::VISIBILITY_PRIVATE;\n $activity->content->created_by = $this->getOwner()->id;\n $activity->created_by = $userId;\n $activity->type = \"ActivityRoomMemberAdded\";\n $activity->save();\n $activity->fire();\n\n // Members can't also follow the space\n $this->getOwner()->unfollow($userId);\n\n // Cleanup Notifications\n RoomInviteNotification::remove($userId, $this->getOwner());\n RoomApprovalRequestNotification::remove($userId, $this->getOwner());\n }",
"public function addTeamMember()\n {\n $this->resetErrorBag();\n\n if (Features::sendsTeamInvitations()) {\n app(InvitesTeamMembers::class)->invite(\n $this->user,\n $this->team,\n $this->addTeamMemberForm['email'],\n $this->addTeamMemberForm['role']\n );\n } else {\n app(AddsTeamMembers::class)->add(\n $this->user,\n $this->team,\n $this->addTeamMemberForm['email'],\n $this->addTeamMemberForm['role']\n );\n }\n\n $this->addTeamMemberForm = [\n 'email' => '',\n 'role' => null,\n ];\n\n $this->team = $this->team->fresh();\n\n $this->dispatch('saved');\n }",
"public function addUser()\n {\n // if we have POST data to create a new user entry\n if (isset($_POST[\"submit_add_user\"])) {\n // do addUser() in model/userModel.php\n // TODO : Retourner une erreur si jamais les champs ne sont pas correctement complétés.\n $this->userModel->addUser($_POST[\"login\"], $_POST[\"password\"], $_POST[\"firstname\"], $_POST[\"lastname\"]);\n }\n // where to go after user has been added\n header('location: ' . URL . 'user/index');\n }",
"public function addMember(User $authUser, User $userObject)\n {\n // Only admin who can create new user.\n return $authUser->isAdmin() || $authUser->id == $userObject->id;\n }",
"public function addObjectAsUser ($object, $user, $index = -1) {\n\t\t$userPerms = $this->getUserPermissions($user);\n\t\tif ($userPerms->addTo == TRUE) $this->addObject($object, $index);\n\t\telse {\n\t\t\tthrow new InsufficientPrivileges($this->id, \"Add object\", \"User has insufficient privileges to add an object to collection # $this->id.\");\n\t\t}\n\t\treturn TRUE;\n\t}",
"function addUser()\n {\n if (APP_INSTALLED)\n {\n $this->_template->setRedirection(APP_URL);\n return ;\n }\n \n // Check post values and populate db\n if (isset($_POST['name']) && isset($_POST['pass']))\n {\n $newName = htmlspecialchars($_POST['name']);\n\n // Username lenght check\n if (strlen($newName) == 0)\n {\n $this->set('error', 'User Name needs to be at least 1 character long');\n return ;\n }\n\n // Username uniqueness check\n $user = new UserModel;\n $uNames = $user->getUserNames();\n\n $alreadyPresent = false;\n foreach ($uNames as $key => $value) {\n if ($value['name'] == $newName)\n $alreadyPresent = true;\n }\n\n if (!$alreadyPresent)\n {\n // success, lets add it to the database and inform the user\n $user->addUser($newName, hash(\"sha256\", $_POST['pass'] . BACK_HASH_SALT));\n $this->set('success', 'Added user <strong>' . $newName . '</strong> to SerieLast.');\n }\n else {\n $this->set('error', 'This name is already used');\n }\n }\n }",
"public function addNewUser() {\n\t\t\tGLOBAL $page;\n\t\t\t\n\t\t\t$db = new database();\n\t\t\t$db->query(\"INSERT INTO `cashltd_cash`.`admin_login` (\n\t\t\t\t\t\t`id` ,\n\t\t\t\t\t\t`username` ,\n\t\t\t\t\t\t`password` ,\n\t\t\t\t\t\t`rank` ,\n\t\t\t\t\t\t`fname` ,\n\t\t\t\t\t\t`sname`\n\t\t\t\t\t\t)\n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\tNULL , '\".safe::post('username').\"', '\".MD5(safe::post('password')).\"', '\".safe::post('rank').\"', '\".safe::post('fnamex').\"', '\".safe::post('lnamex').\"'\n\t\t\t\t\t\t);\");\n\t\t\t\n\t\t}",
"function oe_add_new_member() {\n \tif (isset( $_POST[\"oe_user_login\"] ) && wp_verify_nonce($_POST['oe_register_nonce'], 'oe-register-nonce')) {\n\t\t$user_login\t\t= $_POST[\"oe_user_login\"];\t\n\t\t$user_email\t\t= $_POST[\"oe_user_email\"];\n\t\t$user_first \t= $_POST[\"oe_user_first\"];\n\t\t$user_last\t \t= $_POST[\"oe_user_last\"];\n\t\t$user_pass\t\t= $_POST[\"oe_user_pass\"];\n\t\t$pass_confirm \t= $_POST[\"oe_user_pass_confirm\"];\n \n\t\t// this is required for username checks\n\t\trequire_once(ABSPATH . WPINC . '/registration.php');\n \n\t\tif(username_exists($user_login)) {\n\t\t\t// Username already registered\n\t\t\toe_errors()->add('username_unavailable', __('Username already taken'));\n\t\t}\n\t\tif(!validate_username($user_login)) {\n\t\t\t// invalid username\n\t\t\toe_errors()->add('username_invalid', __('Invalid username'));\n\t\t}\n\t\tif($user_login == '') {\n\t\t\t// empty username\n\t\t\toe_errors()->add('username_empty', __('Please enter a username'));\n\t\t}\n\t\tif(!is_email($user_email)) {\n\t\t\t//invalid email\n\t\t\toe_errors()->add('email_invalid', __('Invalid email'));\n\t\t}\n\t\tif(email_exists($user_email)) {\n\t\t\t//Email address already registered\n\t\t\toe_errors()->add('email_used', __('Email already registered'));\n\t\t}\n\t\tif($user_pass == '') {\n\t\t\t// passwords do not match\n\t\t\toe_errors()->add('password_empty', __('Please enter a password'));\n\t\t}\n\t\tif($user_pass != $pass_confirm) {\n\t\t\t// passwords do not match\n\t\t\toe_errors()->add('password_mismatch', __('Passwords do not match'));\n\t\t}\n \n\t\t$errors = oe_errors()->get_error_messages();\n \n\t\t// only create the user in if there are no errors\n\t\tif(empty($errors)) {\n \n\t\t\t$new_user_id = wp_insert_user(array(\n\t\t\t\t\t'user_login'\t\t=> $user_login,\n\t\t\t\t\t'user_pass'\t \t\t=> $user_pass,\n\t\t\t\t\t'user_email'\t\t=> $user_email,\n\t\t\t\t\t'first_name'\t\t=> $user_first,\n\t\t\t\t\t'last_name'\t\t\t=> $user_last,\n\t\t\t\t\t'user_registered'\t=> date('Y-m-d H:i:s'),\n\t\t\t\t\t'role'\t\t\t\t=> 'stripe_user'\n\t\t\t\t)\n\t\t\t);\n\t\t\tif($new_user_id) {\n\t\t\t\t// send an email to the admin alerting them of the registration\n\t\t\t\twp_new_user_notification($new_user_id);\n \n\t\t\t\t// log the new user in\n\t\t\t\twp_setcookie($user_login, $user_pass, true);\n\t\t\t\twp_set_current_user($new_user_id, $user_login);\t\n\t\t\t\tdo_action('wp_login', $user_login);\n \n\t\t\t\t// send the newly created user to the home page after logging them in\n\t\t\t\twp_redirect(home_url()); exit;\n\t\t\t}\n \n\t\t}\n \n\t}\n}",
"function addUser($user) {\n $this->setValue('users', $user);\n }",
"public function add(){\r\n\t\t//view\r\n\t\trequire_once('Views/user/addUser.php');\r\n\t}",
"public function add_user()\n {\n $this->check_usertype();\n $this->load->view('admin/admin_add_user');\n }",
"public function addUser($username, $password, $firstname, $surname, $userlevel, $campus, $emailaddress)\n {\n $username = db::escapechars($username);\n $firstname = db::escapechars($firstname);\n $surname = db::escapechars($surname);\n $userlevel = db::escapechars($userlevel);\n $password = md5(db::escapechars($password));\n $campus = db::escapechars($campus);\n $emailaddress = db::escapechars($emailaddress);\n \n // Verify there isn't a duplicate username\n $sql = \"SELECT * FROM users WHERE username='$username'\";\n $exists = 0;\n $exists = db::getnumrows($sql);\n if($exists == 0){\n $sql = \"INSERT INTO users SET \n username='$username',\n firstname='$firstname',\n surname='$surname',\n password='$password',\n userlevel='$userlevel',\n emailaddress='$emailaddress',\n campus='$campus'\n \";\n $result = db::execute($sql);\n if($result){\n // Insert all the privs for the user in the useraccess table\n $lastid = db::getlastid();\n $modulesql = \"SELECT * FROM kmodules\";\n $item = db::returnallrows($modulesql);\n // for each module in the system, enter access if your level is greater than or equal to default levels\n foreach($item as $module){\n if($module['userlevel'] >= $userlevel){\n $sql = \"INSERT INTO useraccess SET userID='\".$lastid.\"', moduleName='\".$module['moduleName'].\"'\";\n $privinsert = db::execute($sql);\n }\n }\n \n return true;\n }\n else{\n return false;\n }\n }\n else{\n return 'username already exists';\n }\n }",
"public function adduser()\t\t\t\t\t\t\t//\n\t\t{\t\t\t\t\t\t\t\t\t\t//\n\t\t\tif ($this->session->userdata('logged_in'))\t\t\t\t// Check to see if the user is logged in\n\t\t\t{\t\t\t\t\t\t\t\t\t//\n\t\t\t\t$this->cfg->adduser();\t\t\t\t\t\t// Call add user function\n\t\t\t}\t\t\t\t\t\t\t\t\t//\n\t\t\telse\t\t\t\t\t\t\t\t\t// If user isn't logged in\n\t\t\t{\t\t\t\t\t\t\t\t\t//\n\t\t\t\tredirect('main', 'refresh');\t\t\t\t\t// Redirect to main page\n\t\t\t}\t\t\t\t\t\t\t\t\t//\n\t\t}",
"public function executeAdd() \n {\n \t$user = new User();\n \t$user->setUserFn($this->getRequestParameter('fname'));\n \t$user->setUserLn($this->getRequestParameter('lname'));\n \t$user->setUserLogin($this->getRequestParameter('login'));\n \t$user->setUserEmail($this->getRequestParameter('email'));\n \t$user->setAuthLvlId('1');\n \t$user->setUserPswd($this->getRequestParameter('password'));\n \t$user->save();\n \t\n\t$this->forward('user', 'login');\n }",
"public function addMember($tenant_id, $project_uid, $uid, $permissions=null) {\n\t\t$projectFolder = $this->getProjectFolder($project_uid);\n\t\t$projectUser = $this->findCollaborator($project_uid);\n\t\t$projectFolderManager = new ProjectFolderManager($projectUser->getUid());\n\t\t$doShare = $projectFolderManager->shareToUser($projectFolder, $projectUser->getUid(), $uid, $permissions);\n\t\treturn true;\n\t}",
"function addnewuser()\n\t{\n\t\t\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\t//redirect them to the login page\n\t\t\tredirect('auth/login', 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\n\t\t\t//list the users\n\t\t\t$this->data['users'] = $this->ion_auth->users()->result();\n\t\t\tforeach ($this->data['users'] as $k => $user)\n\t\t\t{\n\t\t\t\t$this->data['users'][$k]->groups = $this->ion_auth->get_users_groups($user->id)->result();\n\t\t\t}\n\n\t\t\tif($this->ion_auth->is_admin()){\n\t\t\t$this->template->set_template('user');\n\t\t\t$this->template->write_view('header', 'default/header', $this->session->userdata);\n\t\t\t$this->template->write_view('sidebar', 'default/sidebar');\n\t\t\t$this->template->write_view('content', 'auth/create_user',$this->data);\n\t\t\t$this->template->write_view('footer', 'default/footer');\n\t\t\t$this->template->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public function addUser() {\n\t\t$userGroups=$this->UserGroup->getGroups();\n\t\t$this->set('userGroups', $userGroups);\n\t\tif ($this->request -> isPost()) {\n\t\t\t$time = strtotime ( \"now\" );\n\t\t\t$token = $time . $this->__randomStr ( 3 );\n\n\t\t\t$this->User->set($this->data);\n\t\t\tif ($this->User->RegisterValidate()) {\n\t\t\t\t$this->request->data['User']['username']=$this->request->data['User']['email'];\n\t\t\t\t$this->request->data['User']['email_verified']=1;\n\t\t\t\t$this->request->data['User']['active']=1;\n\t\t\t\t$this->request->data['User']['user_group_id']=3;\n\t\t\t\t$salt=$this->UserAuth->makeSalt();\n\t\t\t\t$this->request->data['User']['salt'] = $salt;\n\t\t\t\t$this->request->data['User']['token'] = $token;\n\t\t\t\t$this->request->data['User']['password'] = $this->UserAuth->makePassword($token, $salt);\n\t\t\t\t$this->User->save($this->request->data,false);\n\t\t\t\t$this->Session->setFlash('El participante se agregó correctamente.', 'default', array('class' => 'success_message'));\n\t\t\t\t$this->redirect('/allUsers');\n\t\t\t}\n\t\t}\n\t}",
"function add($user) {\n\t\t$this->db->insert('users', $user);\n\t}",
"function command_member_membership_add () {\n global $esc_post;\n \n // Verify permissions\n if (!user_access('member_edit')) {\n error_register('Permission denied: member_edit');\n return 'index.php?q=members';\n }\n if (!user_access('member_membership_edit')) {\n error_register('Permission denied: member_membership_edit');\n return 'index.php?q=members';\n }\n \n // Add membership\n $sql = \"\n INSERT INTO `membership`\n (`cid`,`pid`,`start`\";\n if (!empty($esc_post['end'])) {\n $sql .= \", `end`\";\n }\n $sql .= \")\n VALUES\n ('$esc_post[cid]','$esc_post[pid]','$esc_post[start]'\";\n \n if (!empty($esc_post['end'])) {\n $sql .= \",'$esc_post[end]'\";\n }\n $sql .= \")\";\n \n $res = mysql_query($sql);\n if (!$res) die(mysql_error());\n \n return \"index.php?q=member&cid=$_POST[cid]\";\n}",
"function user_add($data)\n{\n\tif (user_find($data[0],NULL))\n\t\treturn false;\n\t\n\t$GLOBALS[\"users\"][] = $data;\n\treturn _saveUsers();\n}"
] | [
"0.6196868",
"0.6144347",
"0.61002415",
"0.6040842",
"0.6017997",
"0.5989551",
"0.5985247",
"0.59599125",
"0.5947648",
"0.5888472",
"0.5848614",
"0.5843966",
"0.5835392",
"0.58236706",
"0.5821717",
"0.5812787",
"0.57873416",
"0.57746273",
"0.5762748",
"0.575824",
"0.57555443",
"0.5738804",
"0.57354975",
"0.57286406",
"0.5718815",
"0.5695373",
"0.56812984",
"0.566233",
"0.5655111",
"0.5625395"
] | 0.8320457 | 0 |
Make Owner Convert a project member to be productOwner. | public function makeOwner ($user) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setOwner($owner);",
"function setOwner($owner = \"\") \n\t{\n\t\t$this->owner = $owner;\n\t}",
"public function set_owner($owner){\n\t\t$this->owner = $owner;\n\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 setOwner(User $owner)\n\t{\n\t\t$this->owner=$owner; \n\t\t$this->keyModified['Owner'] = 1; \n\n\t}",
"protected function _set_owner($value) {\n // add author's username to the appropriate rules\n if (isset($this->policy) && isset($this->policy->draft))\n $this->policy->draft->condition->user = $value;\n parent::_set_owner($value);\n }",
"protected static function changeOwner() {\n // change owner for project recursiv\n exec(\"chown \".self::$owner_user_web.\":\".self::$owner_group_web.\" \".self::$root_dir_web.self::$froxlor_username.\" -R\");\n self::$event->getIO()->write(\":: make domain readable for www\"); \n }",
"public function testGetSetOwner() {\n $membership = OgMembership::create();\n $membership\n ->setOwner($this->user)\n ->setGroup($this->group)\n ->save();\n\n $this->assertOwner($membership);\n }",
"public function setOwnerUserId($ownerUserId);",
"public function setOwner($var)\n {\n GPBUtil::checkString($var, True);\n $this->owner = $var;\n\n return $this;\n }",
"public function ownedBy($owner, string $name);",
"public function Owner(Project $project){\n $owner = $project->Owner;\n if($owner){\n $response = array(\n 'success' => true,\n 'object' => $owner\n );\n return (object)$response;\n }else{\n $response = array(\n 'success' => false,\n 'msg' => \"Unable to find related owner\",\n 'error' => 404\n );\n return (object)$response;\n }\n }",
"public function getOwnerName();",
"function setCopyrightOwner($owner) {\n\t\t$this->setData('copyrightOwner', $owner);\n\t}",
"function setOwnerCompany($owner_company) {\n $this->owner_company = $owner_company;\n }",
"public function getOwner();",
"public function getOwner();",
"public function owner()\n {\n return $this->belongsTo(Member::class, \"member_id\");\n }",
"public function testGetSetOwnerId() {\n $membership = OgMembership::create();\n $membership\n ->setOwnerId($this->user->id())\n ->setGroup($this->group)\n ->save();\n\n $this->assertOwner($membership);\n }",
"public function setOwner($owner) {\n $this->owner = $owner;\n return $this;\n }",
"public function setOwnerId($newVal) {\n $this->ownerId = $newVal;\n }",
"public function setOwner($val)\n {\n $this->_propDict[\"owner\"] = $val;\n return $this;\n }",
"public function owner(){\n\t\treturn $this->morphTo(\"\",\"owner_type\",\"owner_id\");\n\t}",
"public function setOwner($document, array $mapping);",
"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 setOwner($value)\n {\n if (is_array($value)) {\n $value = new Carerix_Api_Rest_Entity_CRUser($value);\n }\n $this->owner = $value;\n return $this;\n }",
"public function owner(){\n return $this->morphTo(\"\",\"owner_type\",\"owner_id\");\n }",
"public function setOwnerId($value) \n {\n $this->_fields['OwnerId']['FieldValue'] = $value;\n return $this;\n }",
"function __setOwnerId ($woid, $data=null){\n\t\tif (empty($data)) $data = Session::read(\"WMS.{$woid}\");\n\t\tif ($data['Workorder']['source_model']=='User') AppController::$ownerid = $data['Workorder']['source_id']; \n\t\tif ($data['Workorder']['source_model']=='Group') AppController::$ownerid = $data['Workorder']['client_id'];\n\t}",
"public function setOwner($owner) {\n chown($this->__full_path, $owner);\n }"
] | [
"0.6121285",
"0.5911529",
"0.58415586",
"0.5807623",
"0.5735348",
"0.5687365",
"0.5630867",
"0.5619251",
"0.5597761",
"0.5578671",
"0.5550047",
"0.5451378",
"0.54131395",
"0.54033196",
"0.53951746",
"0.53662527",
"0.53662527",
"0.53338695",
"0.53107125",
"0.5309218",
"0.52940446",
"0.5273423",
"0.52543914",
"0.5247493",
"0.5246221",
"0.523264",
"0.52304226",
"0.52188057",
"0.52050155",
"0.5184075"
] | 0.6428527 | 0 |
Move Task Reassign a task to a different sprint (or the backlog). | public function moveTask ($task, $queue) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function moveTask($taskId, $taskCol) {\n //move board item\n\n DatabaseConnector::query('UPDATE board_items SET board_column=:board_column WHERE ID=:taskid', array(':taskid'=>$taskId,':board_column'=>$taskCol));\n\n}",
"public function testTaskWorkReassignTaskById()\n {\n }",
"public function takeOrder($task) {\n $task->setWorker($this);\n $dao = new TaskDAO;\n $dao->update($task);\n }",
"public function moveTask($task)\n {\n if ($task->getTargetOrigin() != \"\") {\n $baseRepository = new BaseRepository;\n $arr = explode(',', $task->getSubject());\n $targetType = $arr[0];\n $targetAmount = $arr[1];\n $targetBuilding = explode(\",\", $task->getTargetOrigin())[0];\n $targetId = explode(\",\", $task->getTargetOrigin())[1];\n $baseRepository->addUnits($targetType, $targetId, $targetAmount, $targetBuilding);\n }\n }",
"public function moveSprintTask($request, $id)\n {\n $sprint_id = $request->get('sprint_id');\n $projectSprintTask = ProjectSprintTask::find($id);\n $projectSprintTask->project_sprint_id = $sprint_id;\n\n if ($projectSprintTask->save()) {\n // --\n // Add activities\n createUserActivity(\n ProjectSprintTask::MODULE_NAME,\n $projectSprintTask->id,\n $request->method(),\n $projectSprintTask->task_name,\n $request->ip()\n );\n return true;\n } else {\n return false;\n }\n }",
"public function attackMoveTask($task)\n {\n if ($task->getTargetOrigin() != \"\") {\n $this->attackTask($task);\n }\n }",
"public function reorder(Task $task, string $action): void\n {\n $tasks = $this->repository\n ->orderBy('sort_order')\n ->findWhere(\n [\n ['uuid', '<>', $task->uuid],\n ['sort_order', '>=', $task->sort_order],\n ]\n );\n\n foreach ($tasks as $task) {\n $task->$action('sort_order');\n }\n }",
"public function restored(Task $task)\n {\n //\n }",
"public function restored(Task $task)\n {\n //\n }",
"function assignTask()\n {\n $taskBean = new TaskBean($this->id, $this->_smarty, NULL, NULL);\n $taskBean->assignSingle();\n }",
"public function testTaskWorkReassignUsersTaskById()\n {\n }",
"public function restart($task_id) {\n \n }",
"public function copy() {\n $task = new Task();\n $task->isDone = $this->isDone;\n $task->cost = $this->cost;\n $task->finishTime = $this->finishTime;\n $task->quantity = $this->quantity;\n $task->worksheet = $this->worksheet;\n $task->invItem = $this->invItem;\n }",
"public function takeTask($task)\n {\n }",
"public function restore(Employee $user, Task $task)\n {\n //\n }",
"public function testTaskWorkAutoAssign()\n {\n }",
"public function finishOrder($task){\n $dao = new TaskDAO;\n $dao->update($task);\n }",
"public function applyTask()\n\t{\n\t\t$this->saveTask(false);\n\t}",
"public function update(Task $task): Task;",
"public function reschedule($task, $status) {\r\n\t\treturn time() + 2 * GyroDate::ONE_HOUR;\t\t\r\n\t}",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"public function moveToAnotherProject($project_id, array $task)\n {\n $values = array();\n\n // Clear values (categories are different for each project)\n $values['category_id'] = 0;\n $values['owner_id'] = 0;\n\n // Check if the assigned user is allowed for the new project\n if ($task['owner_id'] && $this->project->isUserAllowed($project_id, $task['owner_id'])) {\n $values['owner_id'] = $task['owner_id'];\n }\n\n // We use the first column of the new project\n $values['column_id'] = $this->board->getFirstColumn($project_id);\n $values['position'] = $this->countByColumnId($project_id, $values['column_id']) + 1;\n $values['project_id'] = $project_id;\n\n if ($this->db->table(self::TABLE)->eq('id', $task['id'])->update($values)) {\n return $task['id'];\n }\n\n return false;\n }",
"public function restore(User $user, Task $task)\n {\n //\n }",
"private function _move_to_next_round(){\n $current_round_index = $this->subj->get_current_round_index();\n $next_round_index = $current_round_index + 1;\n\n $rounds = $this->subj->second_stage_order;\n\n $round = $this->exp->get_phase_one_round_by_id($this->subj->current_round);\n $phase= 2;\n $this->exp->insert_displayed_round_id(($this->subj->round_counter+1), $this->subj->current_round, $this->subj->get_id(), $phase);\n \n // if this is the last round in phase one move to intro phase two\n if($next_round_index == count($rounds)){\n $this->subj->set_current_phase('payoff');\n redirect('subject/payoff');\n }\n\n $this->subj->set_current_round($rounds[$next_round_index]);\n\n $round = $this->exp->get_phase_one_round_by_id($this->subj->current_round);\n $this->subj->increment_round_counter();\n \n redirect('subject/phase_two');\n }",
"function task_delete_from_rounds($task_id) {\n // Get all rounds for the task\n $query = 'SELECT DISTINCT round_id FROM ia_round_task\n WHERE task_id = '.db_quote($task_id);\n $res = db_fetch_all($query);\n\n // Delete task\n db_query('DELETE FROM ia_round_task WHERE task_id = '.db_quote($task_id));\n\n // Repair rounds order\n foreach ($res as $row) {\n round_task_recompute_order($row['round_id']);\n }\n}",
"public function testTaskReactivate()\n {\n\n }",
"public function assignTask(Request $request)\n {\n $result = auth()->user()->assignTask($request->all());\n\n if ($result) {\n // $mostRecentTask = auth()->user()->tasks()->get()->last()->id;\n\n return redirect('/task')->with('flash', 'Your task has been successfully saved.')->with('type', 'info');\n }\n\n return redirect('/task')->with('flash', 'Somehow I could not save your task.')->with('type', 'danger');\n }",
"public static function editTask($taskId, $taskContent) {\n //move board item\n\n DatabaseConnector::query('UPDATE board_items SET name=:name WHERE ID=:taskid', array(':taskid'=>$taskId,':name'=>$taskContent));\n\n}",
"public function testAutoAssign() {\n $listener = new MockedProjectAssignmentEventListener();\n\n $user = new PhabricatorUser();\n $user->setUsername('test');\n $user->setEmail('[email protected]');\n $user->setPHID('PHID-USER-sapmgsmdravm3xumx3ua');\n\n $project = $listener->getProject('PHID-PROJ-sapmgsmdravm3xumx3ua');\n\n $task = new MockManiphestTask();\n $task->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);\n $task->setAuthorPHID($user->getPHID());\n\n $task->setTitle('Test ticket');\n $task->setDescription('Test ticket description');\n\n $changes = array();\n $changes[ManiphestTransactionType::TYPE_STATUS] =\n ManiphestTaskStatus::STATUS_OPEN;\n\n // $owner_phid = $request->getValue('ownerPHID');\n // if ($owner_phid !== null) {\n // $changes[ManiphestTransactionType::TYPE_OWNER] = $owner_phid;\n // }\n\n $project_phids = array($project->getPHID());\n $changes[ManiphestTransactionType::TYPE_PROJECTS] = $project_phids;\n\n $template = new ManiphestTransaction();\n //$template->setContentSource($content_source);\n $template->setAuthorPHID($user->getPHID());\n\n $transactions = array();\n foreach ($changes as $type => $value) {\n $transaction = clone $template;\n $transaction->setTransactionType($type);\n $transaction->setNewValue($value);\n $transactions[] = $transaction;\n }\n\n $event = new PhabricatorEvent(\n PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK,\n array(\n 'task' => $task,\n 'new' => true,\n 'transactions' => $transactions,\n ));\n\n $listener->handleEvent($event);\n }"
] | [
"0.62440395",
"0.6235976",
"0.60312164",
"0.6026061",
"0.6007061",
"0.57375747",
"0.5622672",
"0.55399",
"0.55399",
"0.5494549",
"0.5479178",
"0.54172486",
"0.52618027",
"0.5236391",
"0.521835",
"0.5204418",
"0.519467",
"0.5186794",
"0.51758504",
"0.51513326",
"0.51388305",
"0.51388305",
"0.51110256",
"0.5098159",
"0.5096185",
"0.50845546",
"0.50788885",
"0.5070144",
"0.50643075",
"0.5055264"
] | 0.6725154 | 0 |
Method: admin_state Author: Praveen Pandey Created: 13 Oct 2014 | public function admin_state()
{
$this->loadModel('State');
if ($this->request->is("post"))
{
$request = $this->request->data;
$ids = $request['ids'];
$action = $request['listingAction'];
if (!empty($ids))
{
foreach ($ids as $id)
{
if ($action == "Delete")
{
$this->State->id = $id;
$this->State->delete();
}
}
}
$this->Session->setFlash("Operation successful", 'success');
$this->redirect($this->referer());
}
$this->State->bindModel(array('belongsTo'=>array('Country')));
$conditions = array();
if(!empty($this->params->query['name']))
{
//$conditions['State.name LIKE'] = $this->params->query['name'].'%';
$conditions[] = $this->Search->create_conditions_by_name($this->params->query['name'],'State','name');
}
if(!empty($this->params->query['country']))
{
$conditions[] = $this->Search->create_conditions_by_name($this->params->query['country'],'Country','country');
}
$this->paginate = array(
'limit' => 25,
'fields' => array('State.*','Country.country'),
'conditions' => $conditions,
'order' => array('State.name' => 'ASC'),
);
$this->set('rows', $this->paginate('State'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function admin_action() {\n\t}",
"public function getAdminState()\n\t{\n\t\treturn $this->admin_state;\n\t}",
"public function getAdminState()\n {\n return $this->admin_state;\n }",
"public function admin_init(){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\n\t\t}",
"public function add_state()\n {\n if(!$this->input->is_ajax_request())\n {\n show_404();\n exit;\n }\n if($this->userauthentication_model->is_admin())\n {\n echo $this->ajax_model->add_state();\n }\n else\n {\n exit;\n }\n }",
"function bbp_admin_settings()\n{\n}",
"public function network_admin_menus()\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 adminPanelAction() {\n\t}",
"public function adminStore()\n {\n //\n }",
"function sfa_adminadminspage()\r\n{\r\n sfa_render_admins_index();\r\n\r\n return;\r\n}",
"public function admin_menus(){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\n\t\t}",
"public static function admin_menu()\n\t{\n\t}",
"public function admin_menus()\n {\n }",
"function bp_admin() {}",
"function admin_init() {}",
"abstract protected function _admin_dashboard();",
"function bbp_admin_init()\n{\n}",
"function bbp_admin_menu()\n{\n}",
"public function admin_index() {\n\t}",
"function admin_status() {\r\n\r\n\t\t// Check that session is still valid\r\n\t\t$this->requestAction(\r\n\t\t\tarray(\r\n\t\t\t\t'controller' => 'cpanel',\r\n\t\t\t\t'action' => 'admin_checkSession'));\r\n\r\n\t\t// Load standard layout\r\n\t\t$this->layout = 'admin_layout';\r\n\t}",
"public function admin_index() {\n if (!$this->DCAuth->isAdmin()) {\n $this->redirect($this->referer());\n }\n }",
"public function admin_add_state() {\n\t Controller::loadModel('State');\n\t \n if(!empty($this->request->data)){ \n\t\t if($this->State->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('State Added Successfully!!', true), 'message', array('class'=>'message-green'));\n\t\t\t\t$this->redirect('/admin/manages/state_list');\n\t\t\t }else{\n\t\t\t\t$this->Session->setFlash(__('Please correct the errors', true), 'message', array('class'=>'message-red'));\n\t\t\t}\n\t\t}\n }",
"public function in_admin() {\n\t\treturn false;\n\t}",
"function bbp_setup_admin()\n{\n}",
"public function admin() {}",
"public function hookAdminItemsShow()\n {\n }",
"abstract public function is_admin();",
"function bbp_register_admin_settings()\n{\n}",
"public function admin_page() {\n\n\t\tdo_action( 'wpforms_admin_page' );\n\t}"
] | [
"0.69565094",
"0.69194806",
"0.6833377",
"0.68232906",
"0.6797932",
"0.67838967",
"0.67574686",
"0.6755696",
"0.66940576",
"0.6682496",
"0.6635385",
"0.66262424",
"0.6601799",
"0.6593042",
"0.6534751",
"0.6530763",
"0.65009636",
"0.6493433",
"0.6465814",
"0.64389634",
"0.6423767",
"0.63876706",
"0.63858247",
"0.6368744",
"0.6340902",
"0.63393706",
"0.63127947",
"0.6305553",
"0.62518024",
"0.6226292"
] | 0.70135826 | 0 |
Method: admin_add_state Author : Praveen Pandey Created: 13 Oct, 2014 | public function admin_add_state($id = NULL)
{
$this->loadModel('State');
if($this->request->data)
{
$this->State->create();
if($this->State->save($this->request->data))
{
$this->Session->setFlash('State saved successfully');
$this->redirect(array('action'=>'state'));
}
else {
$this->Session->setFlash('Please try again');
}
}
if(!empty($id))
{
$this->request->data = $this->State->findById($id);
}
$countries = $this->Country->find('list',array('fields'=>array('Country.id','Country.country'),'order'=>'Country.country ASC'));
$this->set(compact('countries'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function admin_add_state() {\n\t Controller::loadModel('State');\n\t \n if(!empty($this->request->data)){ \n\t\t if($this->State->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('State Added Successfully!!', true), 'message', array('class'=>'message-green'));\n\t\t\t\t$this->redirect('/admin/manages/state_list');\n\t\t\t }else{\n\t\t\t\t$this->Session->setFlash(__('Please correct the errors', true), 'message', array('class'=>'message-red'));\n\t\t\t}\n\t\t}\n }",
"public function add_state()\n {\n if(!$this->input->is_ajax_request())\n {\n show_404();\n exit;\n }\n if($this->userauthentication_model->is_admin())\n {\n echo $this->ajax_model->add_state();\n }\n else\n {\n exit;\n }\n }",
"public function add() {\n\t\t$title = 'Add State';\n\t\t$this->set('admintitle_for_page',$title);\n\t\t/*******************************************************/\n\t\t\n\t\t$state = TableRegistry::get('States');\n $stateList = $state->find('list', ['fields' => ['id', 'name']]);\n\t\t$this->set('stateList',$stateList);\n\t\t\n\t\t$getCity = $this->Cities->newEntity();\n\t\tif ($this->request->is('post')) {\n\t\t\t$CitiesData = $this->Cities->patchEntity($getCity, $this->request->data);\n if ($this->Cities->save($CitiesData)) { \n\t\t\t\t$this->Flash->success(__('The state has been saved.'));\n return $this->redirect(['action' => 'index']);\n }\n\t\t}\n\t\t$this->set('getCity', $getCity);\n\t\t\n\t}",
"function insert_state($state) {\n global $db;\n\n $errors = validate_state($state);\n if (!empty($errors)) {\n return $errors;\n }\n $state['name'] = db_escape($db, $state['name']);\n // TODO add SQL\n $sql = \"INSERT INTO states \";\n $sql .= \"(name, code) \";\n $sql .= \"VALUES (\";\n $sql .= \"'\" . $state['name'] . \"', \";\n $sql .= \"'\" . $state['code'] . \"');\";\n\n // For INSERT statments, $result is just true/false\n $result = db_query($db, $sql);\n if($result) {\n return true;\n } else {\n // The SQL INSERT statement failed.\n // Just show the error, not the form\n echo db_error($db);\n db_close($db);\n exit;\n }\n }",
"public function store($state)\n {\n //\n }",
"public function create($state)\n {\n //\n }",
"function add_state($state, &$args) {\n\t// to check whether to create array element or append to string\n\t// other multiple fields are caught earlier but the state values\n\tif (array_key_exists('state', $args)) {\n\t\t$args['state'] .= ',' . trim($state);\n\t} else {\n\t\t$args['state'] = trim($state);\n\t}\n}",
"public function admin_state()\n\t {\n\t \t$this->loadModel('State');\n\t \tif ($this->request->is(\"post\"))\n\t\t{\n\t\t\t$request = $this->request->data;\t\t\t\n\t\t\t$ids = $request['ids'];\n\t\t\t$action = $request['listingAction'];\n\t\t\tif (!empty($ids))\n\t\t\t{\n\t\t\t\tforeach ($ids as $id)\n\t\t\t\t{\n\t\t\t\t\tif ($action == \"Delete\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->State->id = $id;\n\t\t\t\t\t\t$this->State->delete();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->Session->setFlash(\"Operation successful\", 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t}\n\t\t$this->State->bindModel(array('belongsTo'=>array('Country')));\n\t\t$conditions = array();\n\t\n\t\tif(!empty($this->params->query['name']))\n\t\t{\n\t\t\t//$conditions['State.name LIKE'] = $this->params->query['name'].'%';\n\t\t\t$conditions[] = $this->Search->create_conditions_by_name($this->params->query['name'],'State','name');\n\t\t}\n\t\tif(!empty($this->params->query['country']))\n\t\t{\n\t\t\t$conditions[] = $this->Search->create_conditions_by_name($this->params->query['country'],'Country','country');\n\t\t}\n\t\t\n\t\t$this->paginate = array(\t\t\t\t\n\t\t\t\t'limit' => 25,\n\t\t\t\t'fields' => array('State.*','Country.country'),\n\t\t\t\t'conditions' => $conditions,\n\t\t\t\t'order' => array('State.name' => 'ASC'),\n\t\t);\t\t\t\n\t\t$this->set('rows', $this->paginate('State'));\n\t }",
"public function admin_add_city() {\n\t Controller::loadModel('State');\n\t\tController::loadModel('City');\n\t if(!empty($this->request->data)){\n\t\t $stateId = $this->request->data['City']['state_id'];\n\t\t $conditions = array('State.id'=> $stateId);\n\t\t $getCityArr = $this->State->find('first',array('conditions'=> $conditions));\n\t\t $this->request->data['City']['state'] = $getCityArr['State']['state_name'];\n\t\t if($this->City->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('City Added Successfully!!', true), 'message', array('class'=>'message-green'));\n\t\t\t\t$this->redirect('/admin/manages/city_list');\n\t\t\t }else{\n\t\t\t\t$this->Session->setFlash(__('Please correct the errors', true), 'message', array('class'=>'message-red'));\n\t\t\t}\n\t\t}\n }",
"public function save_state(){\n $countryModel = $this->getModel('country');\n $countryModel->saveState();\n }",
"public function addState($state, $stateValue = 1)\n\t{\n\t\t$this->_states[$state] = $stateValue;\n\t}",
"public function createState($state) {\n \n $select = $this->select(array(\"state\"))\n ->where(\"state = '$state'\");\n\tif ($this->numRows($select) == 1) {\n echo ('Este departamento ya existe!');\n return;\n\t}\n\n\t$this->begin();\n\n $this->insert(array('activated'=>'1','state'=>$state));\n \n $this->commit();\n \n echo ('Este departamento se creo correctamente!');\n }",
"private function _addNewOrderState($state, $names)\n {\n error_log('Do we have state '.$state.': '.Configuration::get($state));\n if (!(Validate::isInt(Configuration::get($state))\n && Validate::isLoadedObject(\n $order_state = new OrderState(Configuration::get($state))\n ))\n ) {\n $order_state = new OrderState();\n\n if (!empty($names)) {\n foreach ($names as $code => $name) {\n $order_state->name[Language::getIdByIso($code)] = $name;\n }\n }\n\n $order_state->send_email = false;\n $order_state->invoice = false;\n $order_state->unremovable = true;\n $order_state->color = '#77b3e0';\n $order_state->module_name = 'monetivo';\n\n if (!$order_state->add() || !Configuration::updateValue(\n $state, $order_state->id\n )\n ) {\n error_log('State '.$state.' not added');\n return false;\n }\n\n copy(\n _PS_MODULE_DIR_ . $this->name . '/img/mvo_status.png', _PS_IMG_DIR_ . 'os/' . $order_state->id . '.gif'\n );\n\n error_log('State id '.$order_state->id);\n\n return $order_state->id;\n }\n\n return false;\n }",
"public function addState(Request $request){\n \t\tif ($request->isMethod('post')) {\n\n \t\t\t$validation = validator::make($request->all(),[\n\t \n\t 'country_name'=> 'required',\n\t 'state_name' => 'required|regex:/^[\\pL\\s\\-]+$/u|unique:states']);\n\n\t if ($validation->fails()) {\n\t \n\t return Redirect::to(\"admin/add-state\")->withErrors($validation)->withInput();\n\t \n\t }else{\n\t \t$data = array( 'country_id' => $request->country_name,\n\t \t\t\t\t 'state_name' => $request->state_name,\n\t \t\t\t\t 'status'\t\t => 'Active',\n\t \t\t\t\t 'created_at' => date('Y-m-d H:i:s'),\n\t \t\t\t\t );\n\t \n\t \t$insert = State::insertGetId($data);\n\t \n\t if ($insert) {\t \n\t return Redirect::to(\"admin/state\")->withSuccess('Data Successfull add.');\n\t }else{\n\t return Redirect::to(\"admin/add-state\")->withFail('Something went to wrong.');\n\t }\n\t }\n\n \t\t} else {\n \t\t\t$data['heading'] = \"State\";\n \t\t\t$data['title'] = \"Add State\";\n \t\t\t$data['country'] = Country::get();\n \t\t\treturn view('admin.state.add',$data);\n \t\t}\n \t}",
"protected function populateState() {\n\t\t\tparent::populateState();\n\t\t}",
"public function AddState(Request $request){\n if($request->ajax()){\n try {\n DB::beginTransaction();\n $state = States::where('name',$request->stateName)->where('country_id',$request->cid)->first();\n if($state === null){\n $state \t\t\t\t= new States(); \n $state->name = $request->stateName;\n $state->country_id = $request->cid;\n $state->updated_by = Auth::guard('admin')->user()->id;\n $state->save();\n $data = array(\n 'status' => 1,\n 'error'\t=>0,\n 'msg' => 'State created successfully.',\n 'data' => $state\n ); \n DB::commit();\n }else{\n $data = array(\n 'status' => 0,\n 'error'\t=>1,\n 'msg' => 'State already added.' \n ); \n } \n }\n catch (\\Exception $e) {\n $data = array(\n 'status' => 0,\n 'error'\t=>1,\n 'msg' => 'Oops! Some thing is wrong.'\n );\n }\n\t}else{\n\t\t$data = array(\n\t\t'status' => 0,\n\t\t'error'\t=>1,\n\t\t'msg' => 'Method not allowed from browser.'\n\t\t);\n\t} \n\treturn response()->json($data, 200);\n }",
"public function admin_add_actions() {\n\t\t\n\t}",
"function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('province_state_name','Province State Name','required|max_length[30]');\n\t\t$this->form_validation->set_rules('province_state_country_code','Province State Country Code','required|integer');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'province_state_name' => $this->input->post('province_state_name'),\n\t\t\t\t'province_state_country_code' => $this->input->post('province_state_country_code'),\n );\n \n $state_id = $this->State_model->add_state($params);\n redirect('state/index');\n }\n else\n { \n $data['_view'] = 'state/add';\n $this->load->view('layouts/main',$data);\n }\n }",
"public function create()\n {\n //\n abort_if(auth()->user()->admin != 'on' && auth()->user()->super_admin != 'on', 403 );\n return view('states.create');\n }",
"public function postState(){\n\t\t$country_id=$this->input->post('country_id');\n\t\t$name=$this->input->post('name');\t\n\t\t$alias=$this->input->post('alias');\t\n\t\t$state_code=$this->input->post('state_code');\t\n\t\t\n\t\t$res['result']=FALSE;\n\t\tif (empty($country_id) || empty($name) || empty($alias) || empty($state_code) ) {\n\t\t\t$res['message'] = 'Please fill the required fields.';\n\t\t\techo json_encode($res);\n\t\t\tdie();\n\t\t}\n\t\tif ($country_id <> sanitizeInt($country_id) ) {\n\t\t\t$res['message'] = 'Please enter valid values.';\n\t\t\techo json_encode($res);\n\t\t\tdie();\n\t\t}\n\t\t$data=$this->usermodel->select_single_row('states','*',array('name'=>$name,'country_id'=>$country_id));\n\t\tif (!empty($data) ) {\n\t\t\t$res['message'] = 'State already exists.';\n\t\t\techo json_encode($res);\n\t\t\tdie();\n\t\t}\n\t\t$data_pro=array(\n\t\t\t'country_id'=>$country_id,\n\t\t\t'name'=>$name,\n\t\t\t'alias'=>$alias,\n\t\t\t'state_code'=>$state_code,\n\t\t);\n\t\t$this->db->insert('states',$data_pro);\n\t\t$res['result'] = TRUE;\n\t\t$res['message'] = \"Added successfully.\";\n\t\techo json_encode($res);\n\t\tdie();\n\t}",
"public function addDirector() {\n\n $states = $this->ModelStates->fetchAll();\n $data['states'] = $states;\n $data['controller'] = \"Moderator\";\n $this->showContent(\"addDirector.php\", $data);\n }",
"protected function populateState()\n\t{\n\t\t$app = JFactory::getApplication('administrator');\n\n\t\t// Load the User state.\n\t\t$pk = $app->input->getInt('id');\n\t\t$this->setState($this->name . '.id', $pk);\n\n\t\t// Load the parameters.\n\t\t$params = JComponentHelper::getParams($this->option);\n\t\t$this->setState('params', $params);\n \n $this->setState('drad.option', $this->option);\n\t}",
"public function set_store_state()\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'OmId' => $this->input->post('orderid'),\n\t\t\t\t'OmStore' => $this->input->post('storename'),\n\t\t\t\t'OmStoreState' => $this->input->post('status')\n\t\t\t);\n\t\t\t// set db Conditions\n\t\t\t$this->db->set($data['OmStore'],$data['OmStoreState']);\n\t\t\t$this->db->where('OmId',$data['OmId']);\n\t\t\t// Return the result of the query\n\t\t\treturn $this->db->update('ordermaster');\n\t\t}",
"public function add(State $additional): State;",
"private function buildStatesList() {\n\t\t$this->states = array();\n\t\tforeach($this->CI->user->states as $state) {\n\t\t\t/* @var $state User_State */\n\t\t\t$set = $state->set;\n\t\t\t// either add to an existing group, or create a new one.\n\t\t\tif(isset($this->states[$set])) {\n\t\t\t\t$this->states[$set][$state->id] = $state;\n\t\t\t} else {\n\t\t\t\t$this->states[$set] = array($state->id => $state);\n\t\t\t}\n\t\t}\n\t}",
"public function addState(Request $request){\n\n if ($request->isMethod('post')) {\n \n $validation = validator::make($request->all(),[\n\n 'country_id' => 'required',\n 'state_name' => 'required|regex:/^[\\pL\\s\\-]+$/u|unique:states',\n\n ]);\n if ($validation->fails()) {\n \n return Redirect::to(\"admin/add-state\")->withErrors($validation)->withInput();\n\n }else{\n\n $data = array('state_name' => $request->state_name,\n 'country_id' => $request->get('country_id')\n );\n \n $insert = State::insertGetId($data);\n \n if ($insert) {\n \n return Redirect::to(\"admin/state-list\")->withSuccess('Data Successfull add ');\n \n }else{\n return Redirect::to(\"admin/add-state\")->withFail('Something went to wrong.');\n }\n }\n\n }else{\n\n $data['title'] = 'Add State'; \n $data['state_info']='';\n $data['country']= Country::where('status','Active')->get(); \n \n return view(\"Admin::add.add_state\", $data);\n \n }\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 setState(string $state)\n\t{\n\t\t$this->addKeyValue('state', $state); \n\n\t}",
"public function init() {\n add_action( 'State_add_form_fields', array ( $this, 'add_State_image' ), 10, 2 );\n add_action( 'created_State', array ( $this, 'save_State_image' ), 10, 2 );\n add_action( 'State_edit_form_fields', array ( $this, 'update_State_image' ), 10, 2 );\n add_action( 'edited_State', array ( $this, 'updated_State_image' ), 10, 2 );\n add_action( 'admin_enqueue_scripts', array( $this, 'load_media' ) );\n add_action( 'admin_footer', array ( $this, 'add_script' ) );\n }",
"public function stateAction()\n {\n $configState = array(\n $this->getRequest()->getParam('container') => $this->getRequest()\n ->getParam('value')\n );\n $this->_saveState($configState);\n }"
] | [
"0.8244383",
"0.7574915",
"0.74496615",
"0.68189514",
"0.65987444",
"0.6582474",
"0.6565875",
"0.6414539",
"0.6393156",
"0.6365891",
"0.6350131",
"0.6335323",
"0.63310796",
"0.62274516",
"0.61325413",
"0.6120893",
"0.6112834",
"0.61055887",
"0.61008734",
"0.6096701",
"0.6087794",
"0.6004228",
"0.5929421",
"0.59127235",
"0.5899642",
"0.5883086",
"0.5845737",
"0.58428705",
"0.5836356",
"0.58356625"
] | 0.76996624 | 1 |
Method: admin_city Author: Praveen Pandey Created: 13 Oct 2014 | public function admin_city()
{
$this->loadModel('City');
if ($this->request->is("post"))
{
$request = $this->request->data;
$ids = $request['ids'];
$action = $request['listingAction'];
if (!empty($ids))
{
foreach ($ids as $id)
{
if ($action == "Delete")
{
$this->City->id = $id;
$this->City->delete();
}
}
}
$this->Session->setFlash("Operation successful", 'success');
$this->redirect($this->referer());
}
$conditions = array();
if(!empty($this->params->query['name']))
{
$conditions[] = $this->Search->create_conditions_by_name($this->params->query['name'],'City','name');
}
$this->paginate = array(
'limit' => 25,
'fields' => array('City.*'),
'conditions' => $conditions,
'order' => array('City.name' => 'ASC'),
);
$this->set('rows', $this->paginate('City'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function admin_index(){\n\t\t$data = $this->City->find('list');\n\t\t$this->set(compact('data'));\n\t}",
"public function display_city_list(){\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'City List';\n\t\t\t$condition = array();\n\t\t\t$this->data['cityList'] = $this->city_model->get_all_details(CITY,$condition);\n\t\t\t$condition1 = array('id' => $this->data['cityList']->row()->stateid);\n\t\t\t$this->data['StateList'] = $this->city_model->get_all_details(STATE_TAX,$condition);\n\t\t\t$this->load->view('crmadmin/city/display_city',$this->data);\n\t\t}\n\t}",
"public function index(){\t\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\tredirect('crmadmin/city/display_city_list');\n\t\t}\n\t}",
"public function admin_add_city() {\n\t Controller::loadModel('State');\n\t\tController::loadModel('City');\n\t if(!empty($this->request->data)){\n\t\t $stateId = $this->request->data['City']['state_id'];\n\t\t $conditions = array('State.id'=> $stateId);\n\t\t $getCityArr = $this->State->find('first',array('conditions'=> $conditions));\n\t\t $this->request->data['City']['state'] = $getCityArr['State']['state_name'];\n\t\t if($this->City->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('City Added Successfully!!', true), 'message', array('class'=>'message-green'));\n\t\t\t\t$this->redirect('/admin/manages/city_list');\n\t\t\t }else{\n\t\t\t\t$this->Session->setFlash(__('Please correct the errors', true), 'message', array('class'=>'message-red'));\n\t\t\t}\n\t\t}\n }",
"protected function giveCity()\n\t{\n\t\treturn \"Tepeto\";\n\t}",
"public function action_index()\n\t{\n\t\t$cities = ORM::factory('city')->find_all()->as_array('name');\n\n\t\t$this->template->head->title = 'Admin | Cities';\n\t\t$this->template->content = new View('admin/city/read');\n\t\t$this->template->content->title = 'City management';\n\t\t$this->template->content->cities = $cities;\n\t}",
"function OrgMap_organization_action_cities() {\n add_meta_box(\n 'organization_action_cities_box',\n __( 'Location of Action (cities)', 'orgmap' ),\n array($this, 'OrgMap_organization_action_cities_box_content'),\n 'organization',\n 'normal',\n 'high'\n );\n }",
"public function admin_action() {\n\t}",
"abstract protected function giveCity();",
"function show_city_admin($current_user, $ID, $resources) {\n\t$build_message = 'Build a structure at (<span class=\"x\"></span>, <span class=\"y\"></span>):';\n\t$extra_message = '<span class=\"name-structure\"></span> at (<span class=\"x\"></span>, <span class=\"y\"></span>):';\n\t?>\n\t<!-- wrapping build and demolish/upgrade in one div -->\n\t<div>\n\t\t<div id=\"build\" class=\"infobox\">\n\t\t\t<p><?= $build_message; ?></p>\n\t\t\t<?php show_build_form($ID, $resources); ?>\n\t\t</div>\n\n\t\t<div id=\"extra\" class=\"infobox\">\n\t\t\t<p><?= $extra_message; ?></p>\n\t\t\t<?php show_extra_forms(); ?>\n\t\t</div>\n\t</div>\n\n<?php\n}",
"public function actionAdmin()\n\t{ \n\t\t$this->render('nearest_admin');\n\t}",
"public function view_city(){\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'View city';\n\t\t\t$city_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $city_id);\n\t\t\t$this->data['stateDisplay'] = $this->city_model->SelectAllCountry();\n\t\t\t$this->data['city_details'] = $this->city_model->get_all_details(CITY,$condition);\n\t\t\tif ($this->data['city_details']->num_rows() == 1){\n\t\t\t\t$this->load->view('crmadmin/city/view_city',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect('deals_crm');\n\t\t\t}\n\t\t}\n\t}",
"public function display_city_statelist(){ \n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'State city List';\n\t\t\t$statecity_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('country_id' => $statecity_id);\n\t\t\t$this->data['cityList'] = $this->city_model->get_all_details(CITY,$condition);\n\t\t\t$this->load->view('crmadmin/city/display_city',$this->data);\n\t\t}\n\t}",
"abstract public function city();",
"public function get_city() {\n\t\t$zip = (int) $this->route->param1;\n\t\t$get_city = $this->model('Geoip')->get_cities($zip);\n\t\t// $this->load->block('geo/get_city.php');\n\n\t\tforeach ($get_city as $city) {\n\t\t\techo \"<option value='{$city['citycode']}'>{$city['citycode']}</option>\";\n\t\t}\n\n\t}",
"public function admin_init(){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\n\t\t}",
"public function admin_getCities() {\t\t\n\t\t$cities = array();\n\t\tif (isset($this->request['data']['id'])) {\n\t\t\t$cities = $this->City->find('list', array(\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'id',\n\t\t\t\t\t'city',\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'City.state_id' => $this->request['data']['id']\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($cities);\n\t\texit();\n\t}",
"public function add_city_form(){\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'Add New city';\n\t\t\t$this->data['stateDisplay'] = $this->city_model->SelectAllCountry();\n\t\t\t$this->load->view('crmadmin/city/add_city',$this->data);\n\t\t}\n\t}",
"public function adminPanelAction() {\n\t}",
"public function get_city_from_state_edit(){\n\t\t\t$state=$_REQUEST['state'];\n\t\t\tif($state=='All')\n\t\t\t{\n\t\t\t\t$results=$this->General_model->get_data_all('areas');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$results=$this->General_model->get_data_all_using_where('state_id', $state, 'areas');\n\t\t\t}\n\t\t\t$reg_are=$this->General_model->get_data_all('condos');\n\t\t\t$reg_areas = array();\n\t\t\tforeach($reg_are as $area)\n\t\t\t{\n\t\t\t\tarray_push($reg_areas,$area['areas']);\n\t\t\t}\n\t\t\t$reg_condos = array();\n\t\t\t$data_option='';\n\t\t\t$data_option.='<div class=\"ms-options-wrap\" style=\"position: relative;\"><button>Select options</button><div class=\"ms-options\" style=\"min-height: 200px; overflow: auto; display: block; max-height: 200px;\"><ul style=\"-webkit-column-count: 4; -webkit-column-gap: 0px;\">';\n\t\t\t$data='';\n\t\t\t$data.='\n\t\t\t<option value=\"\">Select Area</option>';\n\t\t\tforeach($results as $city_name){\n\t\t\t\tif(in_array($city_name['id'], $reg_areas))\n\t\t\t\t{\n\t\t\t\t\t$data.='\n\t\t\t\t\t<option value=\"'.$city_name['id'].'\">'.$city_name['name'].'</option>';\n\t\t\t\t\tarray_push($reg_condos,$city_name['id']);\n\t\t\t\t\t$data_option.='<li><label for=\"ms-opt-'.$city_name['id'].'\" style=\"padding-left: 21px;\"><input type=\"checkbox\" value=\"'.$city_name['id'].'\" title=\"'.$city_name['name'].'\" id=\"ms-opt-'.$city_name['id'].'\" name=\"city[]\">'.$city_name['name'].'</label></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data_option.='</ul></div></div>';\n\t\t\t$result['values_option'] = $data_option;\n\t\t\t$result['values'] = $data;\n\t\t\t//registerd condos of this state\n\t\t\t$condo_data='';\n\t\t\t$condo_data.='\n\t\t\t<option value=\"\">Select Condo</option>';\n\t\t\tforeach($reg_are as $condo_name){\n\t\t\t\tif(in_array($condo_name['areas'], $reg_condos))\n\t\t\t\t{\n\t\t\t\t\t$condo_data.='\n\t\t\t\t\t<option value=\"'.$condo_name['id'].'\">'.$condo_name['name'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result['condo_values'] = $condo_data;\n\t\t\techo json_encode($result);\n\t\t\n\t}",
"public function statewiseCity()\n\t{\n\t\t$html['city'] = '<option value=\"\">Select City</option>';\n\t\tif(isset($_POST['state_id']) and strlen($_POST['state_id']) > 0){\n\t\t$states = get_dropdown_value('city_master','city_id','city','state_id = \"' . $_POST['state_id'] . '\"');\n\t\t\n\t\t\t\tif(count($states) > 0){\n\t\t\t\t\tforeach ($states as $key => $value) {\n\t\t\t\t\t\t$html['city'] .= '<option value = \"'.$key.'\">'.$value.'</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\techo json_encode($html);\n\t}",
"public function view(Admin $admin, City $city)\n {\n //\n }",
"function city_list($option,$rows,$pageNav,$lists,$modal,$keyword){\n\t\tglobal $mainframe,$jinput;\n\t\tJHtml::_('behavior.multiselect');\n\t\tJToolBarHelper::title(JText::_('OS_MANAGE_CITY'),\"folder\");\n\t\tJToolBarHelper::addNew('city_add');\n\t\tif (count($rows)){\n\t\t\tJToolBarHelper::editList('city_edit');\n\t\t\tJToolBarHelper::deleteList(JText::_('OS_ARE_YOU_SURE_TO_REMOVE_ITEM'),'city_remove');\n\t\t\tJToolBarHelper::publish('city_publish');\n\t\t\tJToolBarHelper::unpublish('city_unpublish');\n\t\t}\n\t\tJToolbarHelper::custom('cpanel_list','featured.png', 'featured_f2.png',JText::_('OS_DASHBOARD'),false);\n\t\t?>\n\t\t<form method=\"POST\" action=\"index.php?option=com_osproperty&task=city_list\" name=\"adminForm\" id=\"adminForm\">\n\t\t<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td width=\"50%\" align=\"left\">\n\t\t\t\t\t<?php echo JText::_('OS_COUNTRY')?>: \n\t\t\t\t\t<?php echo $lists['country']?>\n\t\t\t\t\t \n\t\t\t\t\t<?php echo JText::_('OS_STATE')?>: \n\t\t\t\t\t<?php echo $lists['states']?>\n\t\t\t\t</td>\n\t\t\t\t<td width=\"50%\" align=\"right\">\n\t\t\t\t\t<input type=\"text\" class=\"input-medium search-query\" name=\"keyword\" id=\"keyword\" value=\"<?php echo $keyword;?>\" placeholder=\"<?php echo JText::_('Keyword');?>\"/>\n\t\t\t\t\t<input type=\"submit\" class=\"btn btn-warning\" value=\"<?php echo JText::_('OS_SEARCH')?>\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<table class=\"adminlist table table-striped\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th width=\"2%\">\n\t\t\t\t\n\t\t\t\t\t</th>\n\t\t\t\t\t<th width=\"3%\" style=\"text-align:center;\">\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"checkall-toggle\" value=\"\" title=\"<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>\" onclick=\"Joomla.checkAll(this)\" />\n\t\t\t\t\t</th>\n\t\t\t\t\t<th >\n\t\t\t\t\t\t<?php echo JHTML::_('grid.sort', JText::_('OS_CITY'), 'a.city', @$lists['order_Dir'], @$lists['order'] ,'city_list'); ?>\n\t\t\t\t\t</th>\n\t\t\t\t\t<th >\n\t\t\t\t\t\t<?php echo JHTML::_('grid.sort', JText::_('OS_COUNTRY'), 'b.country_name', @$lists['order_Dir'], @$lists['order'] ,'city_list'); ?>\n\t\t\t\t\t</th>\n\t\t\t\t\t<th >\n\t\t\t\t\t\t<?php echo JHTML::_('grid.sort', JText::_('OS_STATE'), 'c.state_name', @$lists['order_Dir'], @$lists['order'] ,'city_list'); ?>\n\t\t\t\t\t</th>\n\t\t\t\t\t<?php\n\t\t\t\t\tif($modal == 0){\n\t\t\t\t\t?>\n\t\t\t\t\t<th width=\"10%\" style=\"text-align:center;\">\n\t\t\t\t\t\t<?php echo JHTML::_('grid.sort', JText::_('OS_PUBLISH'), 'published', @$lists['order_Dir'], @$lists['order'] ,'city_list'); ?>\n\t\t\t\t\t</th>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<th width=\"5%\" style=\"text-align:center;\">\n\t\t\t\t\t\t<?php echo JHTML::_('grid.sort', JText::_('ID'), 'id', @$lists['order_Dir'], @$lists['order'] ,'city_list'); ?>\n\t\t\t\t\t</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tfoot>\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"100%\" colspan=\"7\" style=\"text-align:center;\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo $pageNav->getListFooter();\n\t\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tfoot>\n\t\t\t<tbody>\n\t\t\t<?php\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$k = 0;\n\t\t\t$function = $jinput->getString('function','jSelectCity_city');\n\t\t\tfor ($i=0, $n=count($rows); $i < $n; $i++) {\n\t\t\t\t$row = $rows[$i];\n\t\t\t\t$checked = JHtml::_('grid.id', $i, $row->id);\n\t\t\t\t$link \t\t= JRoute::_( 'index.php?option=com_osproperty&task=city_edit&cid[]='. $row->id );\n\t\t\t\t$published \t= JHTML::_('jgrid.published', $row->published, $i , 'city_');\n\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t<tr class=\"<?php echo \"row$k\"; ?>\">\n\t\t\t\t\t<td align=\"center\">\n\t\t\t\t\t\t<?php echo $pageNav->getRowOffset( $i ); ?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align=\"center\" style=\"text-align:center;\">\n\t\t\t\t\t\t<?php echo $checked; ?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align=\"left\" style=\"padding-left: 10px;\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif($modal == 0){\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<a href=\"<?php echo $link; ?>\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<a class=\"pointer\" onclick=\"if (window.parent) window.parent.<?php echo $function;?>('<?php echo $row->id?>', '<?php echo $row->city; ?>');\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php echo $row->city; ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align=\"left\" style=\"padding-left: 10px;\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif($modal == 0){\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<a href=\"<?php echo $link; ?>\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php echo $row->country_name; ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align=\"left\" style=\"padding-left: 10px;\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif($modal == 0){\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<a href=\"<?php echo $link; ?>\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php echo $row->state_name; ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<?php\n\t\t\t\t\tif($modal == 0){\n\t\t\t\t\t?>\n\t\t\t\t\t<td align=\"center\" style=\"text-align:center;\">\n\t\t\t\t\t\t<?php echo $published?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<td align=\"center\" style=\"text-align:center;\">\n\t\t\t\t\t\t<?php echo $row->id?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t<?php\n\t\t\t\t$k = 1 - $k;\t\n\t\t\t}\n\t\t\t?>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<input type=\"hidden\" name=\"option\" value=\"com_osproperty\" />\n\t\t<input type=\"hidden\" name=\"task\" value=\"city_list\" />\n\t\t<input type=\"hidden\" name=\"boxchecked\" value=\"0\" />\n\t\t<input type=\"hidden\" name=\"filter_order\" value=\"<?php echo $lists['order'];?>\" />\n\t\t<input type=\"hidden\" name=\"filter_order_Dir\" value=\"<?php echo $lists['order_Dir'];?>\" />\n\t\t<input type=\"hidden\" name=\"modal\" value=\"<?php echo $modal?>\" />\n\t\t<input type=\"hidden\" name=\"function\" value=\"<?php echo $function?>\" />\n\t\t<?php\n\t\tif($modal == 1){\n\t\t?>\n\t\t<input type=\"hidden\" name=\"tmpl\" id=\"tmpl\" value=\"component\" />\n\t\t<?php\n\t\t}\n\t\t?>\n\t\t</form>\n\t\t<?php\n\t}",
"public function edit_city_form(){\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'Edit city';\n\t\t\t$city_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $city_id);\n\t\t\t$this->data['stateDisplay'] = $this->city_model->SelectAllCountry();\n\t\t\t$this->data['city_details'] = $this->city_model->get_all_details(CITY,$condition);\n\t\t\tif ($this->data['city_details']->num_rows() == 1){\n\t\t\t\n\t\t\t\t$this->load->view('crmadmin/city/edit_city',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect('deals_crm');\n\t\t\t}\n\t\t}\n\t}",
"public function regionCitiesAction()\n {\n $this->view->disable();\n if($this->request->isGet()) {\n if($this->request->isAjax()) {\n $request_region = $this->request->get('regionID');\n\n $cities = Cities::getRegionCities($request_region);\n\n if(!empty($cities)) {\n // Now we need to populate <option> elements for city <select>\n $options = Cities::getCityOptions($cities);\n\n echo $options;\n }\n }\n }\n }",
"public function admin() {}",
"public function delete_state_or_city()\n {\n if(!$this->input->is_ajax_request())\n {\n show_404();\n exit;\n }\n if($this->userauthentication_model->is_admin())\n {\n echo $this->ajax_model->delete_state_or_city();\n }\n else\n {\n exit;\n }\n }",
"public function index()\n {\n $cities = SysCity::all();\n return view('admin.location.city.index',compact('cities'));\n }",
"public function index()\n {\n $subCities = SubCity::orderBy('sub_city_name','asc')->with(['division','district','city'])->get();\n// dd($subCities[0]->city->city_name);\n return view('admin.subCity.manage',compact('subCities'));\n }",
"function college_actions() {\n global $wpdb;\n\n if(isset($_REQUEST['stateid'])) {\n $stateid = $_REQUEST['stateid'];\n // Always display default option\n $option = '<option value=\"0\" class=\"static\">-- Select City --</option>';\n // Create list of school options\n $results2 = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM `wp_cities` WHERE state = %s ORDER BY city\", $stateid));\n foreach($results2 as $row2) {\n //echo '<option value=\"0\">' . $row2 . '</option>';\n $option .= '<option value=\"' . $row2->cityID . '\" class=\"sub_' . $row2->cityID .'\"' . $selected . '>' . $row2->city . '</option>';\n }\n // Output\n echo $option;\n die();\n } // if: clicked on state option\n\n elseif (isset($_REQUEST['cityid'])) {\n $cityid = $_REQUEST['cityid'];\n // Always display default option\n $option = '<option value=\"0\" class=\"static\">-- Select College / University --</option>';\n // Create list of district options\n //$institution_cityID_query = $wpdb->get_results($wpdb->prepare(\"SELECT `cityID` FROM `wp_cities` WHERE cityID = %d\", $cityid));\n //$institution_cityID = $institution_cityID_query[0]->cityID;\n\n $results2 = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM `wp_colleges` WHERE institution_cityID = %d ORDER BY institution_name\", $cityid));\n foreach($results2 as $row2) {\n $option .= '<option value=\"' . $row2->institutionID_DB . '\" class=\"sub_' . $row2->institutionID_DB .'\"' . $selected . '>' . $row2->institution_name . '</option>';\n }\n // Output\n echo $option;\n die();\n } // if: clicked on city dropdown\n}"
] | [
"0.73377085",
"0.663806",
"0.6587446",
"0.6552714",
"0.6528933",
"0.65153635",
"0.6465596",
"0.64182633",
"0.63520044",
"0.6301524",
"0.62607056",
"0.62589484",
"0.6238955",
"0.6225309",
"0.62194645",
"0.6213221",
"0.62069094",
"0.62019813",
"0.6149326",
"0.6135893",
"0.61184925",
"0.60714495",
"0.6064074",
"0.60635656",
"0.60610753",
"0.60488486",
"0.60287994",
"0.60252976",
"0.6006828",
"0.5980023"
] | 0.755572 | 0 |
Randomizes the order the designs are played. | private function randomizeDesignOrder()
{
$order = range(1, count($this->designConfig['ordered_names']));
shuffle($order);
array_multisort($order,
$this->designConfig['ordered_names'],
$this->designConfig['ordered_phases'],
$this->biasConfig['ordered_types'],
$this->biasConfig['ordered_values'],
$this->conditionConfig['ordered_ratio'],
$this->conditionConfig['ordered_competitive']
);
$this->designConfig['ordered_names'] = BasicHelper::reindexArray($this->designConfig['ordered_names']);
$this->designConfig['ordered_phases'] = BasicHelper::reindexArray($this->designConfig['ordered_phases']);
$this->biasConfig['ordered_types'] = BasicHelper::reindexArray($this->biasConfig['ordered_types']);
$this->biasConfig['ordered_values'] = BasicHelper::reindexArray($this->biasConfig['ordered_values']);
$this->conditionConfig['ordered_ratio'] = BasicHelper::reindexArray($this->conditionConfig['ordered_ratio']);
$this->conditionConfig['ordered_competitive'] = BasicHelper::reindexArray($this->conditionConfig['ordered_competitive']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function randomizePhasesOrder()\n {\n for ($i = 1; $i <= count($this->conditionConfig['ordered_competitive']); $i++)\n {\n shuffle($this->conditionConfig['ordered_competitive'][$i]);\n $this->conditionConfig['ordered_competitive'][$i] = BasicHelper::reindexArray($this->conditionConfig['ordered_competitive'][$i]);\n }\n\n }",
"public function orderRandom();",
"public function shuffle()\n {\n $random = $this->quotes->random();\n $this->random = $random;\n }",
"function shuffle() {\n // circulations we choose; this randomizes the assignment\n shuffle($this->v);\n shuffle($this->e);\n }",
"public function shuffle()\n {\n // TODO (voir les fonctions sur les tableaux)\n shuffle($this->cards);\n }",
"abstract function isRandomlyOrdered();",
"protected function shuffleItems() {\n // Remove duplicates; randomize the remaining items\n $this->items = array_unique($this->items);\n shuffle($this->items);\n }",
"public function shuffle();",
"function randomize( $key ) {\n $plot_generator = [\n 'titleText1' => [\n \"The Case of the\", \"The Riddle of the\", \"The Man with the\", \"The Mystery of the\"\n ],\n 'titleText2' => [\n \"Travelling\", \"Five\", \"Seven\", \"Silver\", \"Barking\", \"Transposed\", \"Crimson\", \"Ivory\", \"Transparent\", \"Thousand\", \"Crazy\", \"Wooden\", \"Yellow\", \"Waltzing\", \"Green\", \"16\", \"Jade\", \"Mysterious\", \"Magic\", \"Wonderful\", \"Orange\"\n ],\n 'titleText3' => [\n \"Buddhas\", \"Clocks\", \"Clowns\", \"Legs\", \"Balls\", \"Kings\", \"Ear-Drums\", \"Faces\", \"Fingers\", \"Leaves\", \"Spectacles\", \"Hours\", \"Eyes\", \"Nightgowns\", \"Sparrows\", \"Beans\", \"Fans\", \"Bottles\", \"Birds\", \"Hands\", \"Boxes\"\n ]\n ];\n $choice = $plot_generator[ $key ][ rand( 0, count( $plot_generator[ $key ] ) - 1 ) ];\n return $choice;\n }",
"public function Shuffle() {\r\n\t\tshuffle($this->iCards); \r\n\t}",
"function randomizationQuestion($surveyid, array $fieldmap, $preview)\n{\n $randomized = false;\n $randomGroups = array();\n\n // Find all defined randomization groups through question attribute values\n // TODO: move the sql queries to a model\n if (in_array(Yii::app()->db->getDriverName(), array('mssql', 'sqlsrv', 'dblib'))) {\n $rgquery = \"SELECT attr.qid, CAST(value as varchar(255)) as value FROM {{question_attributes}} as attr right join {{questions}} as quests on attr.qid=quests.qid WHERE attribute='random_group' and CAST(value as varchar(255)) <> '' and sid=$surveyid GROUP BY attr.qid, CAST(value as varchar(255))\";\n } else {\n $rgquery = \"SELECT attr.qid, value FROM {{question_attributes}} as attr right join {{questions}} as quests on attr.qid=quests.qid WHERE attribute='random_group' and value <> '' and sid=$surveyid GROUP BY attr.qid, value\";\n }\n\n $rgresult = dbExecuteAssoc($rgquery);\n\n foreach ($rgresult->readAll() as $rgrow) {\n $randomGroups[$rgrow['value']][] = $rgrow['qid']; // Get the question IDs for each randomization group\n }\n\n // If we have randomization groups set, then lets cycle through each group and\n // replace questions in the group with a randomly chosen one from the same group\n if (count($randomGroups) > 0 && !$preview) {\n $randomized = true; // So we can trigger reorder once for group and question randomization\n $copyFieldMap = array();\n $oldQuestOrder = array();\n $newQuestOrder = array();\n $randGroupNames = array();\n\n foreach ($randomGroups as $key=>$value) {\n $oldQuestOrder[$key] = $randomGroups[$key];\n $newQuestOrder[$key] = $oldQuestOrder[$key];\n // We shuffle the question list to get a random key->qid which will be used to swap from the old key\n $newQuestOrder[$key] = ls\\mersenne\\shuffle($newQuestOrder[$key]);\n $randGroupNames[] = $key;\n }\n\n // Loop through the fieldmap and swap each question as they come up\n foreach ($fieldmap as $fieldkey => $fieldval) {\n $found = 0;\n\n foreach ($randomGroups as $gkey => $gval) {\n\n // We found a qid that is in the randomization group\n if (isset($fieldval['qid']) && in_array($fieldval['qid'], $oldQuestOrder[$gkey])) {\n // Get the swapped question\n $idx = array_search($fieldval['qid'], $oldQuestOrder[$gkey]);\n\n foreach ($fieldmap as $key => $field) {\n\n if (isset($field['qid']) && $field['qid'] == $newQuestOrder[$gkey][$idx]) {\n $field['random_gid'] = $fieldval['gid']; // It is possible to swap to another group\n $copyFieldMap[$key] = $field;\n }\n }\n $found = 1;\n break;\n } else {\n $found = 2;\n }\n }\n\n if ($found == 2) {\n $copyFieldMap[$fieldkey] = $fieldval;\n }\n reset($randomGroups);\n }\n $fieldmap = $copyFieldMap;\n }\n\n return array($fieldmap, $randomized);\n}",
"public function shuffleDeck() {\n\t\tif (is_array($this->cards) && count($this->cards) > 0) {\n\t\t\tshuffle($this->cards);\t\t\n\t\t}\n\t}",
"public function InitAndShuffle() {\r\n\t\t$this->InitDeckWithCards();\r\n\t\tshuffle($this->iCards); \r\n\t}",
"function exposure_screen_init($repeats) {\n\t\t$random_order = array();\n\t\t$new_order = array();\n\n\t\t$random_order = array_slice($_SESSION['training_set'], 0 , 30);\n\t\t\n\t\tshuffle($random_order);\n\t\t// each word in training set is shown twice in sequence\t\n\t\tfor ($i = 0; $i < count($random_order); $i++) {\n\t\t\tfor ($j = 0; $j < $repeats; $j++) {\n\t\t\t\t$new_order[] = $random_order[$i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$_SESSION['section_set'] = $new_order;\n\t\t$_SESSION['item_total'] = count($_SESSION['section_set']);\n\t}",
"function random_event_placer()\n{\n\tglobal $UNI, $systems, $db_name;\n\n\t//high level random events\n\tif($UNI['random_events'] == 3){\n\t\t//black holes\n\t\t$to_do = ceil($UNI['numsystems'] / 110);\n\t\tfor($i=1; $i <= $to_do; $i++){\n\t\t\t$place = mt_rand(2, $UNI['numsystems']);\n\t\t\tdbn(\"update ${db_name}_stars set event_random = 1, star_name = 'Black Hole', planetary_slots = 0 where star_id = '$place'\");\n\t\t\t$systems[$place - 1]['event_random'] = 1;\n\t\t\t$systems[$place - 1]['name'] = \"Black Hole\";\n\t\t\t$systems[$place - 1]['planetary_slots'] = 0;//no planets in BH systems.\n\t\t}\n\t}\n}",
"private function generateSequence(){\n\t\t$sequence = array(); \n\t\t$sequence[] = $this->blocks[0]; //Always start the tests with\n\t\tunset($this->blocks[0]);\n\t\tshuffle($this->blocks); //Shuffle the order of the blocks \n\t\t$this->blocks = array_merge($sequence,$this->blocks); \n\t}",
"abstract function setRandomlyOrdered($randomlyOrdered);",
"public function run()\n {\n $roles = App\\Role::all();\n\n App\\Assignment::all()->each(function ($assignment) use ($roles) {\n $assignment->roles()->attach(\n $roles->random(rand(1, 3))->pluck('id')->toArray()\n );\n });\n\n $locations = App\\Location::all();\n\n App\\Assignment::all()->each(function ($assignment) use ($locations) {\n $assignment->locations()->attach(\n $locations->random(rand(1, 3))->pluck('id')->toArray()\n );\n });\n\n $leaves = App\\Leave::all();\n\n App\\Assignment::all()->each(function ($assignment) use ($leaves) {\n $assignment->leaves()->attach(\n $leaves->random(rand(1, 3))->pluck('id')->toArray()\n );\n });\n }",
"private function getOrderBy(){\n return \" order by Rand() \";\n }",
"public function getOrder()\n {\n // the order in which fixtures will be loaded\n // the lower the number, the sooner that this fixture is loaded\n return 3;\n }",
"public function randomizeStats() {\n\n\t\t\t$this->stats['strength'] = mt_rand(60, 90);\n\t\t\t$this->stats['defence'] = mt_rand(40, 60);\n\t\t\t$this->stats['luck'] = mt_rand(25, 40);\n\t\t}",
"function randomizationGroup($surveyid, array $fieldmap, $preview)\n{\n // Randomization groups for groups\n $aRandomGroups = array();\n $aGIDCompleteMap = array();\n\n // First find all groups and their groups IDS\n $criteria = new CDbCriteria;\n $criteria->addColumnCondition(array('sid' => $surveyid, 'language' => $_SESSION['survey_'.$surveyid]['s_lang']));\n $criteria->addCondition(\"randomization_group != ''\");\n\n $oData = QuestionGroup::model()->findAll($criteria);\n\n foreach ($oData as $aGroup) {\n $aRandomGroups[$aGroup['randomization_group']][] = $aGroup['gid'];\n }\n\n // Shuffle each group and create a map for old GID => new GID\n foreach ($aRandomGroups as $sGroupName=>$aGIDs) {\n $aShuffledIDs = $aGIDs;\n $aShuffledIDs = ls\\mersenne\\shuffle($aShuffledIDs);\n $aGIDCompleteMap = $aGIDCompleteMap + array_combine($aGIDs, $aShuffledIDs);\n }\n\n $_SESSION['survey_'.$surveyid]['groupReMap'] = $aGIDCompleteMap;\n\n $randomized = false; // So we can trigger reorder once for group and question randomization\n\n // Now adjust the grouplist\n if (count($aRandomGroups) > 0 && !$preview) {\n\n $randomized = true; // So we can trigger reorder once for group and question randomization\n\n // Now adjust the grouplist\n Yii::import('application.helpers.frontend_helper', true); // make sure frontend helper is loaded ???? We are inside frontend_helper..... TODO: check if it can be removed\n UpdateGroupList($surveyid, $_SESSION['survey_'.$surveyid]['s_lang']);\n // ... and the fieldmap\n\n // First create a fieldmap with GID as key\n foreach ($fieldmap as $aField) {\n if (isset($aField['gid'])) {\n $GroupFieldMap[$aField['gid']][] = $aField;\n } else {\n $GroupFieldMap['other'][] = $aField;\n }\n }\n\n // swap it\n foreach ($GroupFieldMap as $iOldGid => $fields) {\n $iNewGid = $iOldGid;\n if (isset($aGIDCompleteMap[$iOldGid])) {\n $iNewGid = $aGIDCompleteMap[$iOldGid];\n }\n $newGroupFieldMap[$iNewGid] = $GroupFieldMap[$iNewGid];\n }\n\n $GroupFieldMap = $newGroupFieldMap;\n // and convert it back to a fieldmap\n unset($fieldmap);\n\n foreach ($GroupFieldMap as $aGroupFields) {\n foreach ($aGroupFields as $aField) {\n if (isset($aField['fieldname'])) {\n $fieldmap[$aField['fieldname']] = $aField; // isset() because of the shuffled flag above\n }\n }\n }\n }\n\n return array($fieldmap, $randomized);\n}",
"public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 4;\n }",
"function shuffleCloud()\n\t{\n\t\t{\n\t\t\t$keys = array_keys($this->wordsArray);\n\t\t\n\t\t\tshuffle($keys);\n\t\t\n\t\t\tif (count($keys) && is_array($keys))\n\t\t\t{\n\t\t\t$tmpArray = $this->wordsArray;\n\t\t\t$this->wordsArray = array();\n\t\t\tforeach ($keys as $key => $value)\n\t\t\t$this->wordsArray[$value] = $tmpArray[$value];\n\t\t\t}\n\t\t}\n\t}",
"public function selectRandom();",
"public function shuffleProjects() {\n $projects = collect([]);\n foreach ($this->educationalInstitutions as $educationalInstitution) {\n foreach ($educationalInstitution->educationalInstitutionFaculties as $educationalInstitutionFaculty) {\n foreach ($educationalInstitutionFaculty->researchGroups as $researchGroup) {\n foreach ($researchGroup->researchTeams as $researchTeam) {\n foreach($researchTeam->projects as $project) {\n $projects->add($project);\n }\n }\n }\n }\n }\n\n return $projects->where('is_privated', 0)->take(4)->shuffle();\n }",
"public function getOrder()\n {\n // The order in which fixtures will be loaded\n return 1;\n }",
"function randomizationGroupsAndQuestions($surveyid, $preview = false, $fieldmap = array())\n{\n // Initialize the randomizer. Seed will be stored in response.\n // TODO: rewrite this THE YII WAY !!!! (application/third_party + internal config for namespace + aliases; etc)\n ls\\mersenne\\setSeed($surveyid);\n\n $fieldmap = (empty($fieldmap)) ? $_SESSION['survey_'.$surveyid]['fieldmap'] : $fieldmap;\n\n list($fieldmap, $randomized1) = randomizationGroup($surveyid, $fieldmap, $preview); // Randomization groups for groups\n list($fieldmap, $randomized2) = randomizationQuestion($surveyid, $fieldmap, $preview); // Randomization groups for questions\n\n $randomized = $randomized1 || $randomized2; ;\n\n if ($randomized === true) {\n $fieldmap = finalizeRandomization($fieldmap);\n\n $_SESSION['survey_'.$surveyid]['fieldmap-'.$surveyid.$_SESSION['survey_'.$surveyid]['s_lang']] = $fieldmap;\n $_SESSION['survey_'.$surveyid]['fieldmap-'.$surveyid.'-randMaster'] = 'fieldmap-'.$surveyid.$_SESSION['survey_'.$surveyid]['s_lang'];\n }\n\n $_SESSION['survey_'.$surveyid]['fieldmap'] = $fieldmap;\n\n return $fieldmap;\n}",
"public function run(Faker $faker)\n {\n for($i = 0; $i < 20; $i++) {\n $comic = new Comic;\n\n $randomAuthor = Author::inRandomOrder()->first();\n $comic->author_id = $randomAuthor->id;\n $comic->title = $faker->text(30);\n if(rand(0,1) == 1) {\n $comic->original_title = $faker->text(30);\n }\n $comic->author = $faker->name();\n $comic->pages = $faker->numberBetween(20, 200);\n $comic->release = $faker->year();\n if((rand(0,5) >= 0) && (rand(0,5) <= 2)) {\n $comic->price = $faker->randomFloat(2, 1, 20,99);\n } elseif((rand(0,5) == 3) || (rand(0,5) == 4)) {\n $comic->price = $faker->randomFloat(2, 21, 100,99);\n } else {\n $comic->price = $faker->randomFloat(2, 101, 9999,99);\n }\n $comic->reading_direction = rand(0,2) == 0 ? \"rtl\" : \"ltr\";\n $comic->cover = $faker->imageUrl(200, 300);\n $comic->save();\n }\n }",
"public function shuffleDeck()\n {\n shuffle($this->_cards);\n //check for cards still in sequence and re-arrange them\n for ($i = 1; $i < count($this->_cards); $i++) {\n /** @var Card $currentCard */\n $currentCard = $this->_cards[$i];\n /** @var Card $previousCard */\n $previousCard = $this->_cards[$i - 1];\n if ($previousCard->getPerfectSequencePosition() === $currentCard->getPerfectSequencePosition() - 1) {\n /** @var Card $firstCard */\n $firstCard = $this->_cards[0];\n unset($this->_cards[$i]);\n if ($firstCard->getPerfectSequencePosition() - 1 !== $currentCard->getPerfectSequencePosition()) {\n array_unshift($this->_cards, $currentCard);\n } else {\n unset($this->_cards[0]);\n array_unshift($this->_cards, $currentCard);\n array_unshift($this->_cards, $firstCard);\n }\n }\n }\n }"
] | [
"0.69487613",
"0.6631102",
"0.63157165",
"0.6283652",
"0.58777964",
"0.58366627",
"0.57523686",
"0.57459366",
"0.5738461",
"0.5736012",
"0.5531062",
"0.54943633",
"0.5494198",
"0.54361326",
"0.5396985",
"0.5394984",
"0.5378875",
"0.53677744",
"0.53180575",
"0.5291844",
"0.52193254",
"0.5215778",
"0.5210513",
"0.5204771",
"0.51779926",
"0.5177611",
"0.51685244",
"0.5162125",
"0.515558",
"0.51440173"
] | 0.81762403 | 0 |
Randomizes the competitive behaviour within each game (phases aka iterations). | private function randomizePhasesOrder()
{
for ($i = 1; $i <= count($this->conditionConfig['ordered_competitive']); $i++)
{
shuffle($this->conditionConfig['ordered_competitive'][$i]);
$this->conditionConfig['ordered_competitive'][$i] = BasicHelper::reindexArray($this->conditionConfig['ordered_competitive'][$i]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gen_traits($mintraits = 0, $maxtraits = 5) {\r\n\t\t\r\n\t\tinclude(\"globals.php\");\r\n\t\tinclude_once(\"parser.php\");\r\n\t\tinclude_once(\"get_active_mods.php\");\r\n\t\t\r\n\t\t$activemods = get_active_mods();\r\n\t\r\n\t\t$traits = array();\r\n\t\t// get data from database\r\n\t\t$pdo = new PDO(\"mysql:host=$servername;dbname=$dbname\", $dbusername, $dbpassword);\r\n\t\t$sql = \"SELECT * FROM `traits` WHERE `5_mod` IN ($activemods)\";\r\n\t\tforeach ($pdo->query($sql) as $row) {\r\n\t\t\t$traits[] = $row;\r\n\t\t}\r\n\t\t\r\n\t\t$points = 2;\r\n\t\t$numoftraits = rand($mintraits,$maxtraits);\r\n\t\t$alltraits = count($traits);\r\n\t\t$choosen_traits = array();\r\n\t\t$ok = FALSE;\r\n\t\t\r\n\t\twhile (!$ok) {\r\n\t\t\t$excluded = array();\r\n\t\t\t\r\n\t\t\tfor ($i=0;$i<$numoftraits;$i++) {\r\n\t\t\t\r\n\t\t\t\t$continue = FALSE;\r\n\t\t\t\t$newtrait = 0;\r\n\t\t\t\t\r\n\t\t\t\twhile (!$continue) {\r\n\t\t\t\t\t$newtrait = rand(0,$alltraits-1);\r\n\t\t\t\t\t$traitID = $traits[$newtrait][0];\r\n\t\t\t\t\tif (!in_array($traitID, $excluded)) {\r\n\t\t\t\t\t\t$continue = TRUE;\r\n\t\t\t\t\t\t$excluded[] = $traitID;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$newexcluded = explode(\",\",$traits[$newtrait][3]);\r\n\t\t\t\t$numofnewexcluded = count($newexcluded);\r\n\t\t\t\t\r\n\t\t\t\tfor ($j=0;$j<$numofnewexcluded;$j++) {\r\n\t\t\t\t\t$excluded[] = $newexcluded[$j];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$choosen_traits[] = $traits[$newtrait];\r\n\t\t\t\t$traitpoints = $traits[$newtrait][2];\r\n\t\t\t\t$points = $points - $traitpoints;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($points >= 0) {\r\n\t\t\t\t$ok = TRUE;\r\n\t\t\t} else {\r\n\t\t\t\t$choosen_traits = array();\r\n\t\t\t\t$points = 2;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$numofchoosentraits = sizeof($choosen_traits);\r\n\t\tfor($i=0;$i<$numofchoosentraits;$i++) {\r\n\t\t\t$link = \"../resources/img/traits_imgs/\".$choosen_traits[$i][6].\".png\";\r\n\t\t\t$choosen_traits[$i][6] = $link;\r\n\t\t\t\r\n\t\t\t$description = $choosen_traits[$i][4];\r\n\t\t\t$description = parse_all($description,\"description_imgs\");\r\n\t\t\t$choosen_traits[$i][4] = $description;\r\n\t\t}\r\n\t\t\r\n\t\treturn $choosen_traits;\r\n\t}",
"function shuffle() {\n // circulations we choose; this randomizes the assignment\n shuffle($this->v);\n shuffle($this->e);\n }",
"private function generateSequence(){\n\t\t$sequence = array(); \n\t\t$sequence[] = $this->blocks[0]; //Always start the tests with\n\t\tunset($this->blocks[0]);\n\t\tshuffle($this->blocks); //Shuffle the order of the blocks \n\t\t$this->blocks = array_merge($sequence,$this->blocks); \n\t}",
"public function orderRandom();",
"public function randomizeStats() {\n\n\t\t\t$this->stats['strength'] = mt_rand(60, 90);\n\t\t\t$this->stats['defence'] = mt_rand(40, 60);\n\t\t\t$this->stats['luck'] = mt_rand(25, 40);\n\t\t}",
"private function generateGames() {\n\t\n\t}",
"private function randomQuest(): array\n {\n return array_random($this->possibleQuests);\n }",
"function runProgressionGame(): void\n{\n $instruction = 'What number is missing in the progression?';\n $gameData = [];\n\n for ($i = 0; $i < ROUNDS_COUNT; $i++) {\n $firstElement = rand(0, 100);\n $length = rand(5, 10);\n $step = rand(2, 10);\n $lastElement = $firstElement + $step * $length;\n $progression = range($firstElement, $lastElement, $step);\n $missingElementKey = rand(4, (count($progression) - 1));\n $answer = (string)$progression[$missingElementKey];\n $progression[$missingElementKey] = '..';\n $question = implode(\" \", $progression);\n $gameData[] = [$question, $answer];\n }\n\n runner($gameData, $instruction);\n}",
"function random_event_placer()\n{\n\tglobal $UNI, $systems, $db_name;\n\n\t//high level random events\n\tif($UNI['random_events'] == 3){\n\t\t//black holes\n\t\t$to_do = ceil($UNI['numsystems'] / 110);\n\t\tfor($i=1; $i <= $to_do; $i++){\n\t\t\t$place = mt_rand(2, $UNI['numsystems']);\n\t\t\tdbn(\"update ${db_name}_stars set event_random = 1, star_name = 'Black Hole', planetary_slots = 0 where star_id = '$place'\");\n\t\t\t$systems[$place - 1]['event_random'] = 1;\n\t\t\t$systems[$place - 1]['name'] = \"Black Hole\";\n\t\t\t$systems[$place - 1]['planetary_slots'] = 0;//no planets in BH systems.\n\t\t}\n\t}\n}",
"public function reset()\n {\n $this->health = rand(static::MIN_HEALTH, static::MAX_HEALTH);\n $this->strength = rand(static::MIN_STRENGTH, static::MAX_STRENGTH);\n $this->defence = rand(static::MIN_DEFENCE, static::MAX_DEFENCE);\n $this->speed = rand(static::MIN_SPEED, static::MAX_SPEED);\n $this->luck = rand(static::MIN_LUCK, static::MAX_LUCK);\n $this->initiative = false;\n }",
"public function testLogicHasntChangedMajorGlitches() {\n\t\t$this->randomizer = new Randomizer('test_rules', 'MajorGlitches');\n\t\t$this->randomizer->makeSeed(1337);\n\t\t$loc_item_array = $this->randomizer->getWorld()->getLocations()->map(function($loc){\n\t\t\treturn $loc->getItem()->getName();\n\t\t});\n\n\t\t$this->assertEquals([\n\t\t\t\"Sahasrahla's Hut - Left\" => \"BossHeartContainer\",\n\t\t\t\"Sahasrahla's Hut - Middle\" => \"Mushroom\",\n\t\t\t\"Sahasrahla's Hut - Right\" => \"TenArrows\",\n\t\t\t\"Sahasrahla\" => \"FiftyRupees\",\n\t\t\t\"King Zora\" => \"FiveRupees\",\n\t\t\t\"Potion Shop\" => \"BossHeartContainer\",\n\t\t\t\"Zora's Ledge\" => \"ProgressiveArmor\",\n\t\t\t\"Waterfall Fairy - Left\" => \"FiftyRupees\",\n\t\t\t\"Waterfall Fairy - Right\" => \"BombUpgrade5\",\n\t\t\t\"Master Sword Pedestal\" => \"OneRupee\",\n\t\t\t\"King's Tomb\" => \"PieceOfHeart\",\n\t\t\t\"Kakariko Tavern\" => \"ProgressiveShield\",\n\t\t\t\"Chicken House\" => \"TwentyRupees\",\n\t\t\t\"Kakariko Well - Top\" => \"BossHeartContainer\",\n\t\t\t\"Kakariko Well - Left\" => \"RedBoomerang\",\n\t\t\t\"Kakariko Well - Middle\" => \"PieceOfHeart\",\n\t\t\t\"Kakariko Well - Right\" => \"ArrowUpgrade5\",\n\t\t\t\"Kakariko Well - Bottom\" => \"PieceOfHeart\",\n\t\t\t\"Blind's Hideout - Top\" => \"OneHundredRupees\",\n\t\t\t\"Blind's Hideout - Left\" => \"ProgressiveSword\",\n\t\t\t\"Blind's Hideout - Right\" => \"BossHeartContainer\",\n\t\t\t\"Blind's Hideout - Far Left\" => \"TwentyRupees\",\n\t\t\t\"Blind's Hideout - Far Right\" => \"PieceOfHeart\",\n\t\t\t\"Pegasus Rocks\" => \"ThreeHundredRupees\",\n\t\t\t\"Bottle Merchant\" => \"PieceOfHeart\",\n\t\t\t\"Magic Bat\" => \"PieceOfHeart\",\n\t\t\t\"Sick Kid\" => \"OneRupee\",\n\t\t\t\"Lost Woods Hideout\" => \"BombUpgrade5\",\n\t\t\t\"Lumberjack Tree\" => \"TwentyRupees\",\n\t\t\t\"Graveyard Ledge\" => \"Cape\",\n\t\t\t\"Mushroom\" => \"BombUpgrade10\",\n\t\t\t\"Floodgate Chest\" => \"BossHeartContainer\",\n\t\t\t\"Link's House\" => \"TwentyRupees\",\n\t\t\t\"Aginah's Cave\" => \"TwentyRupees\",\n\t\t\t\"Mini Moldorm Cave - Far Left\" => \"Quake\",\n\t\t\t\"Mini Moldorm Cave - Left\" => \"TwentyRupees\",\n\t\t\t\"Mini Moldorm Cave - Right\" => \"FiveRupees\",\n\t\t\t\"Mini Moldorm Cave - Far Right\" => \"PieceOfHeart\",\n\t\t\t\"Ice Rod Cave\" => \"BombUpgrade5\",\n\t\t\t\"Hobo\" => \"BossHeartContainer\",\n\t\t\t\"Bombos Tablet\" => \"FiftyRupees\",\n\t\t\t\"Cave 45\" => \"ArrowUpgrade5\",\n\t\t\t\"Checkerboard Cave\" => \"ProgressiveArmor\",\n\t\t\t\"Mini Moldorm Cave - NPC\" => \"TwentyRupees\",\n\t\t\t\"Library\" => \"TenArrows\",\n\t\t\t\"Maze Race\" => \"SilverArrowUpgrade\",\n\t\t\t\"Desert Ledge\" => \"Ether\",\n\t\t\t\"Lake Hylia Island\" => \"HalfMagic\",\n\t\t\t\"Sunken Treasure\" => \"PieceOfHeart\",\n\t\t\t\"Flute Spot\" => \"TwentyRupees\",\n\t\t\t\"Sanctuary\" => \"ThreeBombs\",\n\t\t\t\"Sewers - Secret Room - Left\" => \"ArrowUpgrade10\",\n\t\t\t\"Sewers - Secret Room - Middle\" => \"TenArrows\",\n\t\t\t\"Sewers - Secret Room - Right\" => \"Hammer\",\n\t\t\t\"Sewers - Dark Cross\" => \"PieceOfHeart\",\n\t\t\t\"Hyrule Castle - Boomerang Chest\" => \"PieceOfHeart\",\n\t\t\t\"Hyrule Castle - Map Chest\" => \"KeyH2\",\n\t\t\t\"Hyrule Castle - Zelda's Cell\" => \"MapH2\",\n\t\t\t\"Link's Uncle\" => \"CaneOfSomaria\",\n\t\t\t\"Secret Passage\" => \"PieceOfHeart\",\n\t\t\t\"Zelda\" => \"RescueZelda\",\n\t\t\t\"Eastern Palace - Compass Chest\" => \"Hookshot\",\n\t\t\t\"Eastern Palace - Big Chest\" => \"MapP1\",\n\t\t\t\"Eastern Palace - Cannonball Chest\" => \"Flippers\",\n\t\t\t\"Eastern Palace - Big Key Chest\" => \"CompassP1\",\n\t\t\t\"Eastern Palace - Map Chest\" => \"BigKeyP1\",\n\t\t\t\"Eastern Palace - Armos Knights\" => \"ProgressiveSword\",\n\t\t\t\"Eastern Palace - Prize\" => \"Crystal3\",\n\t\t\t\"Desert Palace - Big Chest\" => \"Bottle\",\n\t\t\t\"Desert Palace - Map Chest\" => \"BigKeyP2\",\n\t\t\t\"Desert Palace - Torch\" => \"KeyP2\",\n\t\t\t\"Desert Palace - Big Key Chest\" => \"PieceOfHeart\",\n\t\t\t\"Desert Palace - Compass Chest\" => \"CompassP2\",\n\t\t\t\"Desert Palace - Lanmolas'\" => \"MapP2\",\n\t\t\t\"Desert Palace - Prize\" => \"Crystal4\",\n\t\t\t\"Old Man\" => \"BombUpgrade5\",\n\t\t\t\"Spectacle Rock Cave\" => \"Lamp\",\n\t\t\t\"Ether Tablet\" => \"ArrowUpgrade5\",\n\t\t\t\"Spectacle Rock\" => \"BossHeartContainer\",\n\t\t\t\"Spiral Cave\" => \"ThreeBombs\",\n\t\t\t\"Mimic Cave\" => \"BossHeartContainer\",\n\t\t\t\"Paradox Cave Lower - Far Left\" => \"BombUpgrade5\",\n\t\t\t\"Paradox Cave Lower - Left\" => \"TwentyRupees\",\n\t\t\t\"Paradox Cave Lower - Right\" => \"ArrowUpgrade5\",\n\t\t\t\"Paradox Cave Lower - Far Right\" => \"Bow\",\n\t\t\t\"Paradox Cave Lower - Middle\" => \"FiftyRupees\",\n\t\t\t\"Paradox Cave Upper - Left\" => \"PieceOfHeart\",\n\t\t\t\"Paradox Cave Upper - Right\" => \"ThreeHundredRupees\",\n\t\t\t\"Floating Island\" => \"ThreeBombs\",\n\t\t\t\"Tower of Hera - Big Key Chest\" => \"MapP3\",\n\t\t\t\"Tower of Hera - Basement Cage\" => \"Arrow\",\n\t\t\t\"Tower of Hera - Map Chest\" => \"CompassP3\",\n\t\t\t\"Tower of Hera - Compass Chest\" => \"KeyP3\",\n\t\t\t\"Tower of Hera - Big Chest\" => \"FireRod\",\n\t\t\t\"Tower of Hera - Moldorm\" => \"BigKeyP3\",\n\t\t\t\"Tower of Hera - Prize\" => \"Crystal2\",\n\t\t\t\"Castle Tower - Room 03\" => \"KeyA1\",\n\t\t\t\"Castle Tower - Dark Maze\" => \"KeyA1\",\n\t\t\t\"Agahnim\" => \"DefeatAgahnim\",\n\t\t\t\"Superbunny Cave - Top\" => \"BugCatchingNet\",\n\t\t\t\"Superbunny Cave - Bottom\" => \"ThreeBombs\",\n\t\t\t\"Hookshot Cave - Top Right\" => \"ThreeBombs\",\n\t\t\t\"Hookshot Cave - Top Left\" => \"TenArrows\",\n\t\t\t\"Hookshot Cave - Bottom Left\" => \"TwentyRupees\",\n\t\t\t\"Hookshot Cave - Bottom Right\" => \"TwentyRupees\",\n\t\t\t\"Spike Cave\" => \"PieceOfHeart\",\n\t\t\t\"Catfish\" => \"PieceOfHeart\",\n\t\t\t\"Pyramid\" => \"BossHeartContainer\",\n\t\t\t\"Pyramid Fairy - Sword\" => \"L1Sword\",\n\t\t\t\"Pyramid Fairy - Bow\" => \"BowAndArrows\",\n\t\t\t\"Ganon\" => \"Triforce\",\n\t\t\t\"Pyramid Fairy - Left\" => \"TwentyRupees\",\n\t\t\t\"Pyramid Fairy - Right\" => \"TwentyRupees\",\n\t\t\t\"Brewery\" => \"PieceOfHeart\",\n\t\t\t\"C-Shaped House\" => \"ThreeBombs\",\n\t\t\t\"Chest Game\" => \"FiftyRupees\",\n\t\t\t\"Hammer Pegs\" => \"ThreeBombs\",\n\t\t\t\"Bumper Cave\" => \"TwentyRupees\",\n\t\t\t\"Blacksmith\" => \"ProgressiveShield\",\n\t\t\t\"Purple Chest\" => \"TwentyRupees\",\n\t\t\t\"Hype Cave - Top\" => \"ThreeHundredRupees\",\n\t\t\t\"Hype Cave - Middle Right\" => \"PieceOfHeart\",\n\t\t\t\"Hype Cave - Middle Left\" => \"PieceOfHeart\",\n\t\t\t\"Hype Cave - Bottom\" => \"PieceOfHeart\",\n\t\t\t\"Stumpy\" => \"Shovel\",\n\t\t\t\"Hype Cave - NPC\" => \"BookOfMudora\",\n\t\t\t\"Digging Game\" => \"ArrowUpgrade5\",\n\t\t\t\"Mire Shed - Left\" => \"PieceOfHeart\",\n\t\t\t\"Mire Shed - Right\" => \"PieceOfHeart\",\n\t\t\t\"Palace of Darkness - Shooter Room\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Big Key Chest\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - The Arena - Ledge\" => \"CaneOfByrna\",\n\t\t\t\"Palace of Darkness - The Arena - Bridge\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Stalfos Basement\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Map Chest\" => \"TenArrows\",\n\t\t\t\"Palace of Darkness - Big Chest\" => \"MapD1\",\n\t\t\t\"Palace of Darkness - Compass Chest\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Harmless Hellway\" => \"FiveRupees\",\n\t\t\t\"Palace of Darkness - Dark Basement - Left\" => \"BigKeyD1\",\n\t\t\t\"Palace of Darkness - Dark Basement - Right\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Dark Maze - Top\" => \"Boomerang\",\n\t\t\t\"Palace of Darkness - Dark Maze - Bottom\" => \"CompassD1\",\n\t\t\t\"Palace of Darkness - Helmasaur King\" => \"BottleWithGoldBee\",\n\t\t\t\"Palace of Darkness - Prize\" => \"Crystal5\",\n\t\t\t\"Swamp Palace - Entrance\" => \"KeyD2\",\n\t\t\t\"Swamp Palace - Big Chest\" => \"TwentyRupees\",\n\t\t\t\"Swamp Palace - Big Key Chest\" => \"CompassD2\",\n\t\t\t\"Swamp Palace - Map Chest\" => \"OcarinaInactive\",\n\t\t\t\"Swamp Palace - West Chest\" => \"TwentyRupees\",\n\t\t\t\"Swamp Palace - Compass Chest\" => \"ThreeBombs\",\n\t\t\t\"Swamp Palace - Flooded Room - Left\" => \"ThreeHundredRupees\",\n\t\t\t\"Swamp Palace - Flooded Room - Right\" => \"TwentyRupees\",\n\t\t\t\"Swamp Palace - Waterfall Room\" => \"BigKeyD2\",\n\t\t\t\"Swamp Palace - Arrghus\" => \"MapD2\",\n\t\t\t\"Swamp Palace - Prize\" => \"PendantOfWisdom\",\n\t\t\t\"Skull Woods - Big Chest\" => \"BigKeyD3\",\n\t\t\t\"Skull Woods - Big Key Chest\" => \"KeyD3\",\n\t\t\t\"Skull Woods - Compass Chest\" => \"TwentyRupees\",\n\t\t\t\"Skull Woods - Map Chest\" => \"KeyD3\",\n\t\t\t\"Skull Woods - Bridge Room\" => \"MapD3\",\n\t\t\t\"Skull Woods - Pot Prison\" => \"BottleWithRedPotion\",\n\t\t\t\"Skull Woods - Pinball Room\" => \"KeyD3\",\n\t\t\t\"Skull Woods - Mothula\" => \"CompassD3\",\n\t\t\t\"Skull Woods - Prize\" => \"PendantOfCourage\",\n\t\t\t\"Thieves' Town - Attic\" => \"MapD4\",\n\t\t\t\"Thieves' Town - Big Key Chest\" => \"IceRod\",\n\t\t\t\"Thieves' Town - Map Chest\" => \"Bombos\",\n\t\t\t\"Thieves' Town - Compass Chest\" => \"TwentyRupees\",\n\t\t\t\"Thieves' Town - Ambush Chest\" => \"BigKeyD4\",\n\t\t\t\"Thieves' Town - Big Chest\" => \"KeyD4\",\n\t\t\t\"Thieves' Town - Blind's Cell\" => \"CompassD4\",\n\t\t\t\"Thieves' Town - Blind\" => \"TwentyRupees\",\n\t\t\t\"Thieves' Town - Prize\" => \"PendantOfPower\",\n\t\t\t\"Ice Palace - Big Key Chest\" => \"MapD5\",\n\t\t\t\"Ice Palace - Compass Chest\" => \"ThreeBombs\",\n\t\t\t\"Ice Palace - Map Chest\" => \"ProgressiveShield\",\n\t\t\t\"Ice Palace - Spike Room\" => \"TwentyRupees\",\n\t\t\t\"Ice Palace - Freezor Chest\" => \"BigKeyD5\",\n\t\t\t\"Ice Palace - Iced T Room\" => \"CompassD5\",\n\t\t\t\"Ice Palace - Big Chest\" => \"KeyD5\",\n\t\t\t\"Ice Palace - Kholdstare\" => \"KeyD5\",\n\t\t\t\"Ice Palace - Prize\" => \"Crystal1\",\n\t\t\t\"Misery Mire - Big Chest\" => \"KeyD6\",\n\t\t\t\"Misery Mire - Main Lobby\" => \"BossHeartContainer\",\n\t\t\t\"Misery Mire - Big Key Chest\" => \"MapD6\",\n\t\t\t\"Misery Mire - Compass Chest\" => \"CompassD6\",\n\t\t\t\"Misery Mire - Bridge Chest\" => \"KeyD6\",\n\t\t\t\"Misery Mire - Map Chest\" => \"BigKeyD6\",\n\t\t\t\"Misery Mire - Spike Chest\" => \"KeyD6\",\n\t\t\t\"Misery Mire - Vitreous\" => \"HeartContainer\",\n\t\t\t\"Misery Mire - Prize\" => \"Crystal7\",\n\t\t\t\"Turtle Rock - Chain Chomps\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Compass Chest\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Roller Room - Left\" => \"CompassD7\",\n\t\t\t\"Turtle Rock - Roller Room - Right\" => \"TenBombs\",\n\t\t\t\"Turtle Rock - Big Chest\" => \"TwentyRupees\",\n\t\t\t\"Turtle Rock - Big Key Chest\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Crystaroller Room\" => \"MapD7\",\n\t\t\t\"Turtle Rock - Eye Bridge - Bottom Left\" => \"TwentyRupees\",\n\t\t\t\"Turtle Rock - Eye Bridge - Bottom Right\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Eye Bridge - Top Left\" => \"FiveRupees\",\n\t\t\t\"Turtle Rock - Eye Bridge - Top Right\" => \"BigKeyD7\",\n\t\t\t\"Turtle Rock - Trinexx\" => \"ArrowUpgrade5\",\n\t\t\t\"Turtle Rock - Prize\" => \"Crystal6\",\n\t\t\t\"Ganon's Tower - Bob's Torch\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - DMs Room - Top Left\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - DMs Room - Top Right\" => \"FiftyRupees\",\n\t\t\t\"Ganon's Tower - DMs Room - Bottom Left\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - DMs Room - Bottom Right\" => \"ProgressiveSword\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Top Left\" => \"MapA2\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Top Right\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Bottom Left\" => \"BottleWithBluePotion\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Bottom Right\" => \"PieceOfHeart\",\n\t\t\t\"Ganon's Tower - Firesnake Room\" => \"MoonPearl\",\n\t\t\t\"Ganon's Tower - Map Chest\" => \"Powder\",\n\t\t\t\"Ganon's Tower - Big Chest\" => \"ProgressiveGlove\",\n\t\t\t\"Ganon's Tower - Hope Room - Left\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - Hope Room - Right\" => \"BombUpgrade5\",\n\t\t\t\"Ganon's Tower - Bob's Chest\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - Tile Room\" => \"MagicMirror\",\n\t\t\t\"Ganon's Tower - Compass Room - Top Left\" => \"ProgressiveGlove\",\n\t\t\t\"Ganon's Tower - Compass Room - Top Right\" => \"PieceOfHeart\",\n\t\t\t\"Ganon's Tower - Compass Room - Bottom Left\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Compass Room - Bottom Right\" => \"BigKeyA2\",\n\t\t\t\"Ganon's Tower - Big Key Chest\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Big Key Room - Left\" => \"CompassA2\",\n\t\t\t\"Ganon's Tower - Big Key Room - Right\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Mini Helmasaur Room - Left\" => \"ThreeHundredRupees\",\n\t\t\t\"Ganon's Tower - Mini Helmasaur Room - Right\" => \"PieceOfHeart\",\n\t\t\t\"Ganon's Tower - Pre-Moldorm Chest\" => \"ProgressiveSword\",\n\t\t\t\"Ganon's Tower - Moldorm Chest\" => \"FiftyRupees\",\n\t\t\t\"Agahnim 2\" => \"DefeatAgahnim2\",\n\t\t\t\"Turtle Rock Medallion\" => \"Bombos\",\n\t\t\t\"Misery Mire Medallion\" => \"Bombos\",\n\t\t\t\"Waterfall Bottle\" => \"BottleWithBee\",\n\t\t\t\"Pyramid Bottle\" => \"BottleWithRedPotion\",\n\t\t], $loc_item_array);\n\t}",
"public function randompos() {\n $this->columna=rand(0,3);\n $this->fila=rand(0,3);\n }",
"public function testLogicHasntChangedOverworldGlitches() {\n\t\t$this->randomizer = new Randomizer('test_rules', 'OverworldGlitches');\n\t\t$this->randomizer->makeSeed(1337);\n\t\t$loc_item_array = $this->randomizer->getWorld()->getLocations()->map(function($loc){\n\t\t\treturn $loc->getItem()->getName();\n\t\t});\n\n\t\t$this->assertEquals([\n\t\t\t\"Sahasrahla's Hut - Left\" => \"TwentyRupees\",\n\t\t\t\"Sahasrahla's Hut - Middle\" => \"Mushroom\",\n\t\t\t\"Sahasrahla's Hut - Right\" => \"TenArrows\",\n\t\t\t\"Sahasrahla\" => \"FiftyRupees\",\n\t\t\t\"King Zora\" => \"FiveRupees\",\n\t\t\t\"Potion Shop\" => \"BossHeartContainer\",\n\t\t\t\"Zora's Ledge\" => \"ProgressiveArmor\",\n\t\t\t\"Waterfall Fairy - Left\" => \"FiftyRupees\",\n\t\t\t\"Waterfall Fairy - Right\" => \"BombUpgrade5\",\n\t\t\t\"Master Sword Pedestal\" => \"ThreeHundredRupees\",\n\t\t\t\"King's Tomb\" => \"OneRupee\",\n\t\t\t\"Kakariko Tavern\" => \"ProgressiveShield\",\n\t\t\t\"Chicken House\" => \"PieceOfHeart\",\n\t\t\t\"Kakariko Well - Top\" => \"BossHeartContainer\",\n\t\t\t\"Kakariko Well - Left\" => \"RedBoomerang\",\n\t\t\t\"Kakariko Well - Middle\" => \"PieceOfHeart\",\n\t\t\t\"Kakariko Well - Right\" => \"TwentyRupees\",\n\t\t\t\"Kakariko Well - Bottom\" => \"PieceOfHeart\",\n\t\t\t\"Blind's Hideout - Top\" => \"OneHundredRupees\",\n\t\t\t\"Blind's Hideout - Left\" => \"ProgressiveSword\",\n\t\t\t\"Blind's Hideout - Right\" => \"BossHeartContainer\",\n\t\t\t\"Blind's Hideout - Far Left\" => \"TwentyRupees\",\n\t\t\t\"Blind's Hideout - Far Right\" => \"PieceOfHeart\",\n\t\t\t\"Pegasus Rocks\" => \"PieceOfHeart\",\n\t\t\t\"Bottle Merchant\" => \"PieceOfHeart\",\n\t\t\t\"Magic Bat\" => \"PieceOfHeart\",\n\t\t\t\"Sick Kid\" => \"TenArrows\",\n\t\t\t\"Lost Woods Hideout\" => \"BombUpgrade5\",\n\t\t\t\"Lumberjack Tree\" => \"TwentyRupees\",\n\t\t\t\"Graveyard Ledge\" => \"Cape\",\n\t\t\t\"Mushroom\" => \"BossHeartContainer\",\n\t\t\t\"Floodgate Chest\" => \"FiveRupees\",\n\t\t\t\"Link's House\" => \"TwentyRupees\",\n\t\t\t\"Aginah's Cave\" => \"TwentyRupees\",\n\t\t\t\"Mini Moldorm Cave - Far Left\" => \"MagicMirror\",\n\t\t\t\"Mini Moldorm Cave - Left\" => \"ProgressiveSword\",\n\t\t\t\"Mini Moldorm Cave - Right\" => \"FiveRupees\",\n\t\t\t\"Mini Moldorm Cave - Far Right\" => \"PieceOfHeart\",\n\t\t\t\"Ice Rod Cave\" => \"BombUpgrade5\",\n\t\t\t\"Hobo\" => \"BossHeartContainer\",\n\t\t\t\"Bombos Tablet\" => \"FiftyRupees\",\n\t\t\t\"Cave 45\" => \"ArrowUpgrade5\",\n\t\t\t\"Checkerboard Cave\" => \"ProgressiveArmor\",\n\t\t\t\"Mini Moldorm Cave - NPC\" => \"TwentyRupees\",\n\t\t\t\"Library\" => \"TenArrows\",\n\t\t\t\"Maze Race\" => \"TenArrows\",\n\t\t\t\"Desert Ledge\" => \"Ether\",\n\t\t\t\"Lake Hylia Island\" => \"HalfMagic\",\n\t\t\t\"Sunken Treasure\" => \"PieceOfHeart\",\n\t\t\t\"Flute Spot\" => \"BombUpgrade5\",\n\t\t\t\"Sanctuary\" => \"ThreeBombs\",\n\t\t\t\"Sewers - Secret Room - Left\" => \"ArrowUpgrade10\",\n\t\t\t\"Sewers - Secret Room - Middle\" => \"TenArrows\",\n\t\t\t\"Sewers - Secret Room - Right\" => \"Hammer\",\n\t\t\t\"Sewers - Dark Cross\" => \"PieceOfHeart\",\n\t\t\t\"Hyrule Castle - Boomerang Chest\" => \"PieceOfHeart\",\n\t\t\t\"Hyrule Castle - Map Chest\" => \"KeyH2\",\n\t\t\t\"Hyrule Castle - Zelda's Cell\" => \"MapH2\",\n\t\t\t\"Link's Uncle\" => \"CaneOfSomaria\",\n\t\t\t\"Secret Passage\" => \"PieceOfHeart\",\n\t\t\t\"Zelda\" => \"RescueZelda\",\n\t\t\t\"Eastern Palace - Compass Chest\" => \"Hookshot\",\n\t\t\t\"Eastern Palace - Big Chest\" => \"MapP1\",\n\t\t\t\"Eastern Palace - Cannonball Chest\" => \"Flippers\",\n\t\t\t\"Eastern Palace - Big Key Chest\" => \"CompassP1\",\n\t\t\t\"Eastern Palace - Map Chest\" => \"BigKeyP1\",\n\t\t\t\"Eastern Palace - Armos Knights\" => \"ProgressiveSword\",\n\t\t\t\"Eastern Palace - Prize\" => \"Crystal3\",\n\t\t\t\"Desert Palace - Big Chest\" => \"TwentyRupees\",\n\t\t\t\"Desert Palace - Map Chest\" => \"BigKeyP2\",\n\t\t\t\"Desert Palace - Torch\" => \"KeyP2\",\n\t\t\t\"Desert Palace - Big Key Chest\" => \"PieceOfHeart\",\n\t\t\t\"Desert Palace - Compass Chest\" => \"CompassP2\",\n\t\t\t\"Desert Palace - Lanmolas'\" => \"MapP2\",\n\t\t\t\"Desert Palace - Prize\" => \"Crystal4\",\n\t\t\t\"Old Man\" => \"BombUpgrade5\",\n\t\t\t\"Spectacle Rock Cave\" => \"Lamp\",\n\t\t\t\"Ether Tablet\" => \"ArrowUpgrade5\",\n\t\t\t\"Spectacle Rock\" => \"PieceOfHeart\",\n\t\t\t\"Spiral Cave\" => \"ThreeBombs\",\n\t\t\t\"Mimic Cave\" => \"BossHeartContainer\",\n\t\t\t\"Paradox Cave Lower - Far Left\" => \"BombUpgrade5\",\n\t\t\t\"Paradox Cave Lower - Left\" => \"TwentyRupees\",\n\t\t\t\"Paradox Cave Lower - Right\" => \"ArrowUpgrade5\",\n\t\t\t\"Paradox Cave Lower - Far Right\" => \"Bow\",\n\t\t\t\"Paradox Cave Lower - Middle\" => \"ThreeBombs\",\n\t\t\t\"Paradox Cave Upper - Left\" => \"ThreeBombs\",\n\t\t\t\"Paradox Cave Upper - Right\" => \"ThreeHundredRupees\",\n\t\t\t\"Floating Island\" => \"ThreeBombs\",\n\t\t\t\"Tower of Hera - Big Key Chest\" => \"MapP3\",\n\t\t\t\"Tower of Hera - Basement Cage\" => \"BigKeyP3\",\n\t\t\t\"Tower of Hera - Map Chest\" => \"CompassP3\",\n\t\t\t\"Tower of Hera - Compass Chest\" => \"TwentyRupees\",\n\t\t\t\"Tower of Hera - Big Chest\" => \"FireRod\",\n\t\t\t\"Tower of Hera - Moldorm\" => \"KeyP3\",\n\t\t\t\"Tower of Hera - Prize\" => \"Crystal2\",\n\t\t\t\"Castle Tower - Room 03\" => \"KeyA1\",\n\t\t\t\"Castle Tower - Dark Maze\" => \"KeyA1\",\n\t\t\t\"Agahnim\" => \"DefeatAgahnim\",\n\t\t\t\"Superbunny Cave - Top\" => \"BugCatchingNet\",\n\t\t\t\"Superbunny Cave - Bottom\" => \"ThreeBombs\",\n\t\t\t\"Hookshot Cave - Top Right\" => \"BossHeartContainer\",\n\t\t\t\"Hookshot Cave - Top Left\" => \"BossHeartContainer\",\n\t\t\t\"Hookshot Cave - Bottom Left\" => \"TwentyRupees\",\n\t\t\t\"Hookshot Cave - Bottom Right\" => \"TwentyRupees\",\n\t\t\t\"Spike Cave\" => \"PieceOfHeart\",\n\t\t\t\"Catfish\" => \"PieceOfHeart\",\n\t\t\t\"Pyramid\" => \"BossHeartContainer\",\n\t\t\t\"Pyramid Fairy - Sword\" => \"L1Sword\",\n\t\t\t\"Pyramid Fairy - Bow\" => \"BowAndArrows\",\n\t\t\t\"Ganon\" => \"Triforce\",\n\t\t\t\"Pyramid Fairy - Left\" => \"TwentyRupees\",\n\t\t\t\"Pyramid Fairy - Right\" => \"TwentyRupees\",\n\t\t\t\"Brewery\" => \"PieceOfHeart\",\n\t\t\t\"C-Shaped House\" => \"Bottle\",\n\t\t\t\"Chest Game\" => \"FiftyRupees\",\n\t\t\t\"Hammer Pegs\" => \"ThreeBombs\",\n\t\t\t\"Bumper Cave\" => \"OneRupee\",\n\t\t\t\"Blacksmith\" => \"ProgressiveShield\",\n\t\t\t\"Purple Chest\" => \"TwentyRupees\",\n\t\t\t\"Hype Cave - Top\" => \"ThreeHundredRupees\",\n\t\t\t\"Hype Cave - Middle Right\" => \"PieceOfHeart\",\n\t\t\t\"Hype Cave - Middle Left\" => \"TwentyRupees\",\n\t\t\t\"Hype Cave - Bottom\" => \"PieceOfHeart\",\n\t\t\t\"Stumpy\" => \"Quake\",\n\t\t\t\"Hype Cave - NPC\" => \"BookOfMudora\",\n\t\t\t\"Digging Game\" => \"ArrowUpgrade5\",\n\t\t\t\"Mire Shed - Left\" => \"TwentyRupees\",\n\t\t\t\"Mire Shed - Right\" => \"PieceOfHeart\",\n\t\t\t\"Palace of Darkness - Shooter Room\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Big Key Chest\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - The Arena - Ledge\" => \"CaneOfByrna\",\n\t\t\t\"Palace of Darkness - The Arena - Bridge\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Stalfos Basement\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Map Chest\" => \"FiftyRupees\",\n\t\t\t\"Palace of Darkness - Big Chest\" => \"MapD1\",\n\t\t\t\"Palace of Darkness - Compass Chest\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Harmless Hellway\" => \"FiveRupees\",\n\t\t\t\"Palace of Darkness - Dark Basement - Left\" => \"BigKeyD1\",\n\t\t\t\"Palace of Darkness - Dark Basement - Right\" => \"KeyD1\",\n\t\t\t\"Palace of Darkness - Dark Maze - Top\" => \"Boomerang\",\n\t\t\t\"Palace of Darkness - Dark Maze - Bottom\" => \"CompassD1\",\n\t\t\t\"Palace of Darkness - Helmasaur King\" => \"BottleWithGoldBee\",\n\t\t\t\"Palace of Darkness - Prize\" => \"Crystal5\",\n\t\t\t\"Swamp Palace - Entrance\" => \"KeyD2\",\n\t\t\t\"Swamp Palace - Big Chest\" => \"ArrowUpgrade5\",\n\t\t\t\"Swamp Palace - Big Key Chest\" => \"CompassD2\",\n\t\t\t\"Swamp Palace - Map Chest\" => \"OcarinaInactive\",\n\t\t\t\"Swamp Palace - West Chest\" => \"TwentyRupees\",\n\t\t\t\"Swamp Palace - Compass Chest\" => \"ThreeBombs\",\n\t\t\t\"Swamp Palace - Flooded Room - Left\" => \"ThreeHundredRupees\",\n\t\t\t\"Swamp Palace - Flooded Room - Right\" => \"TwentyRupees\",\n\t\t\t\"Swamp Palace - Waterfall Room\" => \"BigKeyD2\",\n\t\t\t\"Swamp Palace - Arrghus\" => \"MapD2\",\n\t\t\t\"Swamp Palace - Prize\" => \"PendantOfWisdom\",\n\t\t\t\"Skull Woods - Big Chest\" => \"BigKeyD3\",\n\t\t\t\"Skull Woods - Big Key Chest\" => \"KeyD3\",\n\t\t\t\"Skull Woods - Compass Chest\" => \"PieceOfHeart\",\n\t\t\t\"Skull Woods - Map Chest\" => \"KeyD3\",\n\t\t\t\"Skull Woods - Bridge Room\" => \"MapD3\",\n\t\t\t\"Skull Woods - Pot Prison\" => \"MoonPearl\",\n\t\t\t\"Skull Woods - Pinball Room\" => \"KeyD3\",\n\t\t\t\"Skull Woods - Mothula\" => \"CompassD3\",\n\t\t\t\"Skull Woods - Prize\" => \"PendantOfCourage\",\n\t\t\t\"Thieves' Town - Attic\" => \"MapD4\",\n\t\t\t\"Thieves' Town - Big Key Chest\" => \"Shovel\",\n\t\t\t\"Thieves' Town - Map Chest\" => \"BottleWithRedPotion\",\n\t\t\t\"Thieves' Town - Compass Chest\" => \"TwentyRupees\",\n\t\t\t\"Thieves' Town - Ambush Chest\" => \"BigKeyD4\",\n\t\t\t\"Thieves' Town - Big Chest\" => \"KeyD4\",\n\t\t\t\"Thieves' Town - Blind's Cell\" => \"CompassD4\",\n\t\t\t\"Thieves' Town - Blind\" => \"TwentyRupees\",\n\t\t\t\"Thieves' Town - Prize\" => \"PendantOfPower\",\n\t\t\t\"Ice Palace - Big Key Chest\" => \"MapD5\",\n\t\t\t\"Ice Palace - Compass Chest\" => \"ThreeBombs\",\n\t\t\t\"Ice Palace - Map Chest\" => \"ProgressiveShield\",\n\t\t\t\"Ice Palace - Spike Room\" => \"TwentyRupees\",\n\t\t\t\"Ice Palace - Freezor Chest\" => \"BigKeyD5\",\n\t\t\t\"Ice Palace - Iced T Room\" => \"CompassD5\",\n\t\t\t\"Ice Palace - Big Chest\" => \"KeyD5\",\n\t\t\t\"Ice Palace - Kholdstare\" => \"KeyD5\",\n\t\t\t\"Ice Palace - Prize\" => \"Crystal1\",\n\t\t\t\"Misery Mire - Big Chest\" => \"KeyD6\",\n\t\t\t\"Misery Mire - Main Lobby\" => \"BossHeartContainer\",\n\t\t\t\"Misery Mire - Big Key Chest\" => \"MapD6\",\n\t\t\t\"Misery Mire - Compass Chest\" => \"CompassD6\",\n\t\t\t\"Misery Mire - Bridge Chest\" => \"KeyD6\",\n\t\t\t\"Misery Mire - Map Chest\" => \"BigKeyD6\",\n\t\t\t\"Misery Mire - Spike Chest\" => \"KeyD6\",\n\t\t\t\"Misery Mire - Vitreous\" => \"HeartContainer\",\n\t\t\t\"Misery Mire - Prize\" => \"Crystal7\",\n\t\t\t\"Turtle Rock - Chain Chomps\" => \"BigKeyD7\",\n\t\t\t\"Turtle Rock - Compass Chest\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Roller Room - Left\" => \"CompassD7\",\n\t\t\t\"Turtle Rock - Roller Room - Right\" => \"TenBombs\",\n\t\t\t\"Turtle Rock - Big Chest\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Big Key Chest\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Crystaroller Room\" => \"MapD7\",\n\t\t\t\"Turtle Rock - Eye Bridge - Bottom Left\" => \"TwentyRupees\",\n\t\t\t\"Turtle Rock - Eye Bridge - Bottom Right\" => \"PieceOfHeart\",\n\t\t\t\"Turtle Rock - Eye Bridge - Top Left\" => \"TwentyRupees\",\n\t\t\t\"Turtle Rock - Eye Bridge - Top Right\" => \"KeyD7\",\n\t\t\t\"Turtle Rock - Trinexx\" => \"ArrowUpgrade5\",\n\t\t\t\"Turtle Rock - Prize\" => \"Crystal6\",\n\t\t\t\"Ganon's Tower - Bob's Torch\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - DMs Room - Top Left\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - DMs Room - Top Right\" => \"FiftyRupees\",\n\t\t\t\"Ganon's Tower - DMs Room - Bottom Left\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - DMs Room - Bottom Right\" => \"ProgressiveSword\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Top Left\" => \"MapA2\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Top Right\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Bottom Left\" => \"BottleWithBluePotion\",\n\t\t\t\"Ganon's Tower - Randomizer Room - Bottom Right\" => \"SilverArrowUpgrade\",\n\t\t\t\"Ganon's Tower - Firesnake Room\" => \"Bombos\",\n\t\t\t\"Ganon's Tower - Map Chest\" => \"Powder\",\n\t\t\t\"Ganon's Tower - Big Chest\" => \"ProgressiveGlove\",\n\t\t\t\"Ganon's Tower - Hope Room - Left\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - Hope Room - Right\" => \"Arrow\",\n\t\t\t\"Ganon's Tower - Bob's Chest\" => \"KeyA2\",\n\t\t\t\"Ganon's Tower - Tile Room\" => \"IceRod\",\n\t\t\t\"Ganon's Tower - Compass Room - Top Left\" => \"ProgressiveGlove\",\n\t\t\t\"Ganon's Tower - Compass Room - Top Right\" => \"PieceOfHeart\",\n\t\t\t\"Ganon's Tower - Compass Room - Bottom Left\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Compass Room - Bottom Right\" => \"BigKeyA2\",\n\t\t\t\"Ganon's Tower - Big Key Chest\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Big Key Room - Left\" => \"CompassA2\",\n\t\t\t\"Ganon's Tower - Big Key Room - Right\" => \"TwentyRupees\",\n\t\t\t\"Ganon's Tower - Mini Helmasaur Room - Left\" => \"ThreeHundredRupees\",\n\t\t\t\"Ganon's Tower - Mini Helmasaur Room - Right\" => \"PieceOfHeart\",\n\t\t\t\"Ganon's Tower - Pre-Moldorm Chest\" => \"BombUpgrade10\",\n\t\t\t\"Ganon's Tower - Moldorm Chest\" => \"FiftyRupees\",\n\t\t\t\"Agahnim 2\" => \"DefeatAgahnim2\",\n\t\t\t\"Turtle Rock Medallion\" => \"Bombos\",\n\t\t\t\"Misery Mire Medallion\" => \"Bombos\",\n\t\t\t\"Waterfall Bottle\" => \"BottleWithBee\",\n\t\t\t\"Pyramid Bottle\" => \"BottleWithRedPotion\",\n\t\t], $loc_item_array);\n\t}",
"function gen_173()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $split = '@@';\r\n $a = rand(1,12);\r\n $c = rand(1,12);\r\n rand_switch_sign($a,3);\r\n rand_switch_sign($c,3);\r\n $question = \"Passes through ( $a , $c );<br>\";\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n //// ////\r\n //// Through (a,c) parallel to the y-axis ////\r\n //// ////\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n $question .= \"Parallel to the y-axis\";\r\n $numerator = \"not_used\".$split.\"1\".$split.\"not_used\".$split.\"1\".$split;\r\n $numerator .= \"not_used\".$split.\"1\".$split.$a.$split.\"1\";\r\n $answer = array($question,$numerator,$denominator,0,0,32);\r\n return $answer;\r\n}",
"public function getRandomMove()\n {\n return ['Rock','Paper','Scissors'][rand(0, 1)];\n }",
"public function shuffle();",
"function getRandomSpeciality(){\n $specialities = ['dantist', 'massagist', 'therapist', 'urologist', 'ophthalmologist'];\n return $specialities[rand(0,4)];\n }",
"function gen_60( )\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $a = rand(1,9);\r\n $b = rand(2,9);\r\n $c = rand(1,9);\r\n $temp_b = $b;\r\n $temp_c = $c;\r\n while (reduce($temp_b,$temp_c))\r\n {\r\n $c = rand(1,9);\r\n $temp_b = $b;\r\n $temp_c = $c;\r\n }\r\n rand_switch_sign($a,2);\r\n rand_switch_sign($c,2);\r\n $temp = $a * $b + $c;\r\n while ($temp == 0)\r\n {\r\n $a = rand(1,9);\r\n $b = rand(2,9);\r\n $c = rand(1,9);\r\n $temp_b = $b;\r\n $temp_c = $c;\r\n while (reduce($temp_b,$temp_c))\r\n {\r\n $c = rand(1,9);\r\n $temp_b = $b;\r\n $temp_c = $c;\r\n }\r\n rand_switch_sign($a,2);\r\n rand_switch_sign($c,2);\r\n $temp = $a * $b + $c;\r\n }\r\n $coeff1 = $temp;\r\n $coeff2 = $c * $a;\r\n coeff_prep($a,0);\r\n coeff_prep($c,0);\r\n coeff_prep($coeff1);\r\n coeff_prep($coeff2);\r\n $question = $b.\"x^3 \".$coeff1.\"x^2 \".$coeff2.\"x\";\r\n $numerator = \"x(\".$b.\"x\".$c.\")(x\".$a.\")\";\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}",
"function play() {\n \n for ($i=1; $i<4; $i++){\n ${\"randomValue\" . $i} = rand(0,7);\n displaySymbol(${\"randomValue\" . $i}, $i);\n }\n displayPoints($randomValue1, $randomValue2, $randomValue3);\n }",
"function toss_it(){\n\t\t\t\t$outcome = mt_rand(0,1);\n\t\t\t\treturn $outcome;\n\t\t\t}",
"public function roll()\n {\n for ($i = 0; $i < 2; $i++) {\n array_push($this->values, rand(1, 6));\n array_push($this->valuesComp, rand(1, 6));\n };\n }",
"public function run()\n {\n $max_character_id = Character::orderBy('id', 'desc')->first()->id;\n $start = 1;\n $end = 5;\n\n for ($i = 1; $i <= $max_character_id; $i++) {\n for ($j = 1; $j <= 5; $j++) {\n $model = new Parameter;\n $model->character_id = $i;\n $model->cute = rand($start, $end);\n $model->cool = rand($start, $end);\n $model->wild = rand($start, $end);\n $model->beautiful = rand($start, $end);\n $model->fresh = rand($start, $end);\n \n $model->kind = rand($start, $end);\n $model->gentle = rand($start, $end);\n $model->quiet = rand($start, $end);\n $model->active = rand($start, $end);\n $model->scare = rand($start, $end);\n \n $model->action = rand($start, $end);\n $model->power = rand($start, $end);\n $model->speed = rand($start, $end);\n $model->strategy = rand($start, $end);\n $model->endurance = rand($start, $end);\n \n $model->logic = rand($start, $end);\n $model->knowledge = rand($start, $end);\n $model->vocabulary = rand($start, $end);\n $model->forecast = rand($start, $end);\n $model->memory = rand($start, $end);\n \n $model->save(); \n }\n }\n }",
"protected function _randomHorseParams()\n {\n $result = [];\n\n for($i=0; $i<3; $i++) {\n $result[] = mt_rand(0,100)/10.0;\n }\n\n return $result;\n }",
"function gen_177()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $split = '@@';\r\n $a = rand(1,12);\r\n $c = rand(1,12);\r\n $d = rand(1,12);\r\n rand_switch_sign($a,3);\r\n rand_switch_sign($c,3);\r\n rand_switch_sign($d,3);\r\n $question = \"Passes through ( $a , $c );<br>\";\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n //// ////\r\n //// Passes through (a,c) parallel to y=d ////\r\n //// ////\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n $question .= \"Parallel to y = $d\";\r\n $numerator = \"not_used\".$split.\"1\".$split.\"not_used\".$split.\"1\".$split;\r\n $numerator .= $c.$split.\"1\".$split.\"not_used\".$split.\"1\";\r\n $answer = array($question,$numerator,$denominator,0,0,32);\r\n return $answer;\r\n}",
"function gen_324()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $split = '@@';\r\n $v = 32 * rand(3,7);\r\n $question = \"A baseball is thrown straight upwards with \";\r\n $question .= \"an initial velocity of $v ft/s.<br>\";\r\n $question .= \"At what time(s) does the ball reach \";\r\n $time_to_max = $v / 32;\r\n $time_diff = rand(1,$time_to_max - 1);\r\n $num1 = $time_to_max - $time_diff;\r\n $num2 = $time_to_max + $time_diff;\r\n $height = (-1) * 16 * $num1 * $num1 + $v * $num1;\r\n $question .= \"$height feet?\";\r\n $numerator = $num1.$split.\"1\".$split.$num2.$split.\"1\".$split.\"0\";\r\n $answer = array($question,$numerator,$denominator,0,0,30);\r\n return $answer;\r\n}",
"private function randomizeDesignOrder()\n {\n $order = range(1, count($this->designConfig['ordered_names']));\n shuffle($order);\n\n array_multisort($order,\n $this->designConfig['ordered_names'],\n $this->designConfig['ordered_phases'],\n $this->biasConfig['ordered_types'],\n $this->biasConfig['ordered_values'],\n $this->conditionConfig['ordered_ratio'],\n $this->conditionConfig['ordered_competitive']\n );\n\n $this->designConfig['ordered_names'] = BasicHelper::reindexArray($this->designConfig['ordered_names']);\n $this->designConfig['ordered_phases'] = BasicHelper::reindexArray($this->designConfig['ordered_phases']);\n $this->biasConfig['ordered_types'] = BasicHelper::reindexArray($this->biasConfig['ordered_types']);\n $this->biasConfig['ordered_values'] = BasicHelper::reindexArray($this->biasConfig['ordered_values']);\n $this->conditionConfig['ordered_ratio'] = BasicHelper::reindexArray($this->conditionConfig['ordered_ratio']);\n $this->conditionConfig['ordered_competitive'] = BasicHelper::reindexArray($this->conditionConfig['ordered_competitive']);\n }",
"function gen_176()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $split = '@@';\r\n $a = rand(1,12);\r\n $c = rand(1,12);\r\n $d = rand(1,12);\r\n rand_switch_sign($a,3);\r\n rand_switch_sign($c,3);\r\n rand_switch_sign($d,3);\r\n $question = \"Passes through ( $a , $c );<br>\";\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n //// ////\r\n //// Passes through (a,c) parallel to x=d ////\r\n //// ////\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n $question .= \"Parallel to x = $d\";\r\n $numerator = \"not_used\".$split.\"1\".$split.\"not_used\".$split.\"1\".$split;\r\n $numerator .= \"not_used\".$split.\"1\".$split.$a.$split.\"1\";\r\n $answer = array($question,$numerator,$denominator,0,0,32);\r\n return $answer;\r\n}",
"function gen_174()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $split = '@@';\r\n $a = rand(1,12);\r\n $c = rand(1,12);\r\n rand_switch_sign($a,3);\r\n rand_switch_sign($c,3);\r\n $question = \"Passes through ( $a , $c );<br>\";\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n //// ////\r\n //// Through (a,c) perpendicular to the x-axis ////\r\n //// ////\r\n ///////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////\r\n $question .= \"Perpendicular to the x-axis\";\r\n $numerator = \"not_used\".$split.\"1\".$split.\"not_used\".$split.\"1\".$split;\r\n $numerator .= \"not_used\".$split.\"1\".$split.$a.$split.\"1\";\r\n $answer = array($question,$numerator,$denominator,0,0,32);\r\n return $answer;\r\n}",
"public function random();",
"public function testGetRandom()\n {\n // o\n // o o\n // o o\n // o | | o\n // o | 50% | o\n // | | o\n //0 10 20 30 40\n $numbers = [];\n $count = 100000;\n for ($i = 0; $i < $count; $i++) {\n $rnd = $this->action->getRandom(40, 10);\n if (isset($numbers[$rnd])) {\n $numbers[$rnd]++;\n } else {\n $numbers[$rnd] = 1;\n }\n }\n $percentage = [];\n foreach ($numbers as $numb => $cnt) {\n $percentage[$numb] = $cnt/$count*100;\n }\n // statistics\n $centerZone = 0;\n foreach (range(5, 15) as $indx) {\n $centerZone += $percentage[$indx];\n }\n\n $this->assertGreaterThan(50, $centerZone); // actual value is around 56% (+1 range)\n }"
] | [
"0.6229651",
"0.6061263",
"0.5932168",
"0.5749151",
"0.5718219",
"0.5717841",
"0.57033956",
"0.56649613",
"0.56263983",
"0.5512187",
"0.54992586",
"0.54962546",
"0.54604775",
"0.54328513",
"0.5431856",
"0.54230785",
"0.54229265",
"0.54127216",
"0.5373048",
"0.5371524",
"0.5367731",
"0.5332295",
"0.531912",
"0.5303674",
"0.5298435",
"0.5287502",
"0.5282411",
"0.52769333",
"0.52552277",
"0.52465326"
] | 0.667687 | 0 |
region config loaders Loads the configuration for the design names present in the design chain. | private function loadDesignConfig()
{
// design name (value) for each game (key)
$ordered_names = BasicHelper::reindexArray(BasicHelper::parseChainRight($this->rawCondition['design_chain']));
$unique_names = array_unique($ordered_names);
$temp = [];
foreach ($unique_names as $name)
{
$temp[] = Design::getByName($name)['iterations'];
}
$unique_phases = array_combine(array_values($unique_names), $temp);
unset($temp);
$temp = [];
foreach ($ordered_names as $name)
{
$temp[] = $unique_phases[$name];
}
// amount of iterations (value) for each game (key)
$ordered_phases = BasicHelper::reindexArray($temp);
unset($temp);
$this->designConfig = [
'ordered_names' => $ordered_names,
'ordered_phases' => $ordered_phases,
'unique_names' => $unique_names,
'unique_phases' => $unique_phases
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function loadConfig();",
"public function loadConfigs()\n {\n $this->mergeConfigFrom(__DIR__.'/config/dept-store.php', 'dept-store');\n\n // add the root disk to filesystem configuration\n app()->config['filesystems.disks.'.config('dept-store.root_disk_name')] = [\n 'driver' => 'local',\n 'root' => base_path(),\n ];\n }",
"private function loadConfig()\n {\n $this->category->config = [];\n $this->loadMeta('admins', 'array');\n $this->loadMeta('members', 'array');\n $this->loadMeta('template');\n $this->loadMetaCategory();\n }",
"public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }",
"public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }",
"protected static function load()\n {\n $configs = require path('configs') . 'app' . Config::FILE_EXTENSION;\n\n // Pushes the loaded configs from the given identifier\n static::$stack = (new Collection($configs))->all();\n }",
"protected function loadConfigs()\n {\n $configs = include rtrim($this->basePath, '/') . '/config/app.php';\n Config::getInstance($configs);\n }",
"public function configs();",
"protected function loadConfig() {\n $locator = new FileLocator(array(__DIR__ . '/app/config'));\n $configYml = $locator->locate('config.yml');\n $loaderResolver = new LoaderResolver(array(new YamlConfigLoader($locator)));\n $delegatingLoader = new DelegatingLoader($loaderResolver);\n $this->config = $delegatingLoader->load($configYml);\n }",
"public function load_configs()\n {\n // Set needed configs for each module\n $configs = array('master', 'database', 'priceplan', 'system');\n \n foreach($configs as $cfg)\n {\n if(file_exists(APPPATH . 'modules/'.$this->active_module.'/config/'.$cfg.'.php'))\n {\n $this->CI->load->config($this->active_module.'/'.$cfg);\n }\n else\n {\n $message = 'Moduļa konfigurācijas fails \"'.$this->active_module.'/config/'.$cfg.'.php\" nav atrasts! Iespējams ka šī ir jauna shop instalācija un tādā gadījumā ir javeic moduļa konfigurācijas faila pārsaukšana no '.$cfg.'.example.php uz '.$cfg.'.php';\n log_message('error', $message);\n show_error($message);\n }\n }\n }",
"public static function getConfigs() {\r\n $files = scandir(self::CONFIG_PATH);\r\n if ($files !== false && !empty($files)) {\r\n foreach ($files as $file) {\r\n if (strpos($file, self::CONFIG_SUFFIX) !== false) {\r\n $project = str_replace(self::CONFIG_SUFFIX, '', $file);\r\n \r\n self::$configs[$project] = require(self::CONFIG_PATH . DIRECTORY_SEPARATOR . $file);\r\n\r\n //Load custom_fields defaults.\r\n foreach(self::$configs[$project][\"CUSTOM_FIELDS\"] as $field){\r\n self::$configs[$project][$field->name] = $field->default;\r\n }\r\n }\r\n }\r\n }\r\n }",
"public function loadConfig()\n\t{\n\t\t// build path for core\n\t\tif($this->getModule() == 'core') $frontendModulePath = FRONTEND_PATH . '/' . $this->getModule();\n\n\t\t// build path to the module and define it. This is a constant because we can use this in templates.\n\t\telse $frontendModulePath = FRONTEND_MODULES_PATH . '/' . $this->getModule();\n\n\t\t// check if the config is present? If it isn't present there is a huge problem, so we will stop our code by throwing an error\n\t\tif(!is_file($frontendModulePath . '/config.php')) {\n\t\t\tthrow new FrontendException('The config file for the module (' . $this->getModule() . ') can\\'t be found.');\n\t\t}\n\n\t\t// build config-object-name\n\t\t$configClassName = 'Frontend' . SpoonFilter::toCamelCase($this->getModule() . '_config');\n\n\t\t// require the config file, we validated before for existence.\n\t\trequire_once $frontendModulePath . '/config.php';\n\n\t\t// validate if class exists (aka has correct name)\n\t\tif(!class_exists($configClassName)) {\n\t\t\tthrow new FrontendException('The config file is present, but the class name should be: ' . $configClassName . '.');\n\t\t}\n\n\t\t// create config-object, the constructor will do some magic\n\t\t$this->config = new $configClassName($this->getModule());\n\t}",
"public static function load()\n {\n if($organizationId = config('configs.orgId', null)){\n \\Tool::changeDatabase($organizationId);\n }\n\n if(Schema::hasTable('config_manages')){\n foreach (ConfigManages::all(['key', 'value']) as $config) {\n config([$config['key'] => $config['value']]);\n }\n }else{\n //\n // Log::error('table not exists');\n }\n\n }",
"public function loadConfig()\n\t{\n\t\t// build path for core\n\t\tif($this->getModule() == 'core') $frontendModulePath = FRONTEND_PATH . '/' . $this->getModule();\n\n\t\t// build path to the module and define it. This is a constant because we can use this in templates.\n\t\telse $frontendModulePath = FRONTEND_MODULES_PATH . '/' . $this->getModule();\n\n\t\t// check if the config is present? If it isn't present there is a huge problem, so we will stop our code by throwing an error\n\t\tif(!is_file($frontendModulePath . '/config.php'))\n\t\t{\n\t\t\tthrow new FrontendException('The config file for the module (' . $this->getModule() . ') can\\'t be found.');\n\t\t}\n\n\t\t// build config-object-name\n\t\t$configClassName = 'Frontend' . SpoonFilter::toCamelCase($this->getModule() . '_config');\n\n\t\t// require the config file, we validated before for existence.\n\t\trequire_once $frontendModulePath . '/config.php';\n\n\t\t// validate if class exists (aka has correct name)\n\t\tif(!class_exists($configClassName)) {\n\t\t\tthrow new FrontendException('The config file is present, but the class name should be: ' . $configClassName . '.');\n\t\t}\n\n\t\t// create config-object, the constructor will do some magic\n\t\t$this->config = new $configClassName($this->getModule());\n\t}",
"protected function registerConfigLoader()\n {\n app('config')->setLoader(\n new YamlConfigFileLoader(\n new Filesystem(),\n new Parser(),\n base_path('config')\n )\n );\n }",
"public function loadConfig()\n {\n $path = $this->takeConfig()->rawItem('config');\n if ($path) {\n $this->module->loadExtraConfig($path);\n }\n }",
"abstract public function setupConfig();",
"private function parseConfig()\n {\n // setup the DI layer\n $diClass = $this->config->get(Config::KEY_DI);\n if ($diClass && class_exists($diClass)) {\n $di = new $diClass();\n if ($di instanceof DiInterface) {\n Di::setDefault($di);\n }\n }\n Di::getDefault()->set(self::KEY_CONFIG, $this->config);\n $this->setupHandlers(\n $this->config->get(Config::KEY_HANDLERS, [])\n );\n }",
"private static function loadConfig() \n {\n // Global application configurations\n self::$config = new Data\\StaticData(self::$APP_PATH.\"config/\");\n\n // Configurations\n require_once(self::$APP_PATH.\"config/config.php\");\n\n // Initializers, load all files in initializers directory\n $initializers_path = self::$APP_PATH.\"config/initializers/\"; \n foreach (scandir($initializers_path) as $file) {\n if (preg_match('/^[A-Za-z_\\-.]+\\.php$/', $file)) {\n require_once($initializers_path.$file);\n }\n }\n\n // Database configurations\n require_once(self::$CORE_PATH.\"database.php\");\n }",
"public function loadConfig(){\n\t\t$kat=opendir($this->configpath);\n\t\twhile($nazwa= readdir($kat)){\n \t\tif(substr($nazwa,-3)=='cfg'){\n \t\t$plik=file($this->configpath.$nazwa); \n \t\t$ile=count($plik);\n \n \t\tfor($i=0;$i<$ile;$i++){\n \t\t \t$tab=explode(\"=\",$plik[$i]);\n \t\t \tif($tab[0]!='')\n \t\t\t$this->config[trim($tab[0])]= strtoupper(trim($tab[1]));\n\n \t\t }\n \t}\n \t}\n\t\tclosedir($kat);\n\t}",
"public function loadConfig()\n {\n global $sugar_version;\n $config = array();\n $dir = str_replace('_', '/', 'ext_soap_marketo');\n if (version_compare($sugar_version, '7.1.5') < 0) {\n require(get_custom_file_if_exists(\"modules/Connectors/connectors/sources/{$dir}/config.php\"));\n } else {\n foreach (SugarAutoLoader::existingCustom(\n \"modules/Connectors/connectors/sources/{$dir}/config.php\"\n ) as $file) {\n require $file;\n }\n $this->_config = $config;\n\n //If there are no required config fields specified, we will default them to all be required\n if (empty($this->_required_config_fields)) {\n foreach ($this->_config['properties'] as $id => $value) {\n $this->_required_config_fields[] = $id;\n }\n }\n }\n }",
"public function initConfig()\n {\n $mainConfig = collect(config('global'));\n $demoConfig = config(Theme::$demo);\n $mergedConfig = $mainConfig->replaceRecursive($demoConfig);\n config([Theme::$demo => $mergedConfig->all()]);\n\n self::$config = $mergedConfig->all();\n\n // Get config by url path\n $configPath = Theme::$demo.'.pages.'.str_replace('/', '.', Theme::getPagePath());\n $pageConfig = collect(config($configPath));\n\n // Merge group config with child config\n $pageGroupOptions = Theme::getPageGroupOptions(config(Theme::$demo.'.pages'), Theme::getPagePath());\n if ($pageGroupOptions) {\n $overridenConfig = $pageConfig->replaceRecursive($pageGroupOptions);\n config([$configPath => $overridenConfig->all()]);\n }\n\n $generalConfig = collect(config(Theme::$demo.'.general'));\n // Merge general config with page level config\n config([Theme::$demo.'.general' => $generalConfig->replaceRecursive(config($configPath))->all()]);\n }",
"protected function loadConfig() {\n /* Load required defaults file */\n $defaults = $this->loadFromFile(\n $this->tag . \"_defaults.yaml\",\n true);\n\n /* Try to load user configuration. */\n $user = $this->loadFromFile(\n $this->tag . \"_config.yaml\",\n false);\n\n /* Merge defaults and user config. */\n $this->cfg = array_replace_recursive($defaults, $user);\n }",
"function loadConfig(){\n global $config, $lang, $PMCI;\n if(!isset($aPMConfig) || !is_array($aPMConfig)) $aPMConfig = array();\n $this->aC = $check = array();\n $mcount = 0;\n if(($tCfg = file_get_contents( DIR_PLUGINS.\"{$this->sName}/config.php\" )) !== false){\n // get rid of comments\n $tCfg = preg_replace(array('@\\/\\*.*\\*\\/@sUm','@[\\n|\\r]\\s*\\/\\/.*([\\n|\\r])@U'),array('','$1'),$tCfg);\n if(preg_match_all('/\\$config\\[\\s*[\\'|\"]{1}(\\w+)[\\'|\"]{1}\\s*\\](?:\\[\\s*[\\'|\"]{1}(\\w+)[\\'|\"]{1}\\s*\\])?\\s*=(.*);/sUm', $tCfg, $m)>0){\n $mcount = count($m[1]);\n }\n unset($tCfg);\n }\n for($i=0;$i<$mcount;$i++){\n // got 1 or more matches...\n $inst = array();\n $name = rtrim($m[1][$i].'__'.$m[2][$i], '_'); // use double underbar to join array keys\n $this->aC[$name] = array(); // sFid = $name\n $this->aC[$name]['sConfig'] = rtrim($m[1][$i].','.$m[2][$i], ','); // this is how you later identify the config variable when the form is POSTed back\n if($m[2][$i]!=''){ // ie. $config['levelOne']['levelTwo'] = ...\n if(isset($PMCI[$m[1][$i]][$m[2][$i]]) && is_array($PMCI[$m[1][$i]][$m[2][$i]])) { $inst = $PMCI[$m[1][$i]][$m[2][$i]]; }\n $tempconfig = $config[$m[1][$i]][$m[2][$i]]; // the current setting of the config variable\n }else{ // ie. $config['levelOne'] = ...\n if(isset($PMCI[$m[1][$i]]) && is_array($PMCI[$m[1][$i]])) { $inst = $PMCI[$m[1][$i]]; }\n $tempconfig = $config[$m[1][$i]]; // the current setting of the config variable\n }\n $exactconfig = trim($m[3][$i]); // the value of the config variable as typed in the file\n $this->aC[$name]['hide'] = (isset($inst['hide']) && $inst['hide']===true) ? true : false;\n if(!$this->aC[$name]['hide']){\n if(isset($lang['PMCI'][$name]) && is_array($lang['PMCI'][$name])) { // use instructions from language file only if config instructions aren't available\n foreach($lang['PMCI'][$name] as $k=>$v){ if(!isset($inst[$k])) $inst[$k] = $v; }\n }\n $this->aC[$name]['disable'] = (isset($inst['disable']) && $inst['disable']===true) ? true : false; // value can't be modified\n $this->aC[$name]['sName'] = isset($inst['name']) ? $inst['name'] : $name ; // this is the text descriptor of the field\n $this->aC[$name]['alt'] = isset($inst['alt']) ? $inst['alt'] : $name ; // this is the alt and title attributes for the field\n $this->aC[$name]['sText'] = isset($inst['text']) ? $inst['text'] : ($this->aC[$name]['disable'] ? $lang['PMunmodifiable'] : '' ); // this is the 'hint' text for the field\n if(!$this->aC[$name]['disable'] && isset($inst['check'])) { // these are the parts of the call to checkForm\n if(is_array($inst['check'])) {\n $t = 'Array(\"'.$name.'\"';\n foreach($inst['check'] as $cv) { $t .= ', \"'.$cv.'\"'; }\n $check[] = $t.')';\n }else{\n $check[] = 'Array(\"'.$name.'\", \"'.$inst['check'].'\")';\n }\n }\n $this->aC[$name]['sFormat'] = $this->_checkFormat($tempconfig,(isset($inst['format'])?$inst['format']:null)); // this gives some indication of the structure of the config variable\n $this->aC[$name]['type'] = isset($inst['type']) ? $inst['type'] : ( $this->aC[$name]['sFormat']=='b' ? 'checkbox' : 'input' ); // this is the type of field for capture of the config value\n $this->aC[$name]['value'] = $this->_getValue($this->aC[$name]['sFormat'],$tempconfig,$exactconfig); // this is the current value of the config variable\n $this->_checkType($name);\n }\n unset($inst);\n }\n $ccount = count($check);\n if($ccount>0){\n $this->sCheckForm = \"onsubmit='return checkForm( this, Array(\";\n for($i=0;$i<$ccount;$i++){ $this->sCheckForm .= $check[$i].','; }\n $this->sCheckForm = rtrim($this->sCheckForm,',').\"));'\";\n }\n unset($check); unset($m); unset($tempconfig); unset($exactconfig);\n }",
"public function loadConfiguration()\n {\n Compiler::loadDefinitions(\n $this->getContainerBuilder(),\n $this->loadFromFile(__DIR__.'/../config/config.neon')['services']\n );\n }",
"public function load() {\n\n\t\tif ( file_exists( $this->config_path . '/' . $this->config_file ) ) {\n\n\t\t\t$yaml = new Parser();\n\n\t\t\tglobal $config;\n\t\t\t$config = (array) $yaml->parse( file_get_contents( $this->config_path . '/' . $this->config_file ) );\n\n\t\t\tif ( ! empty( $config['WP_ENV'] ) && file_exists( $this->config_path . '/config_' . $config['WP_ENV'] . '.yml' ) ) {\n\t\t\t\t$env = $yaml->parse( file_get_contents( $this->config_path . '/config_' . $config['WP_ENV'] . '.yml' ) );\n\t\t\t\tif ( ! empty( $env ) ) {\n\t\t\t\t\t$config = array_merge( $config, $env );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $config['imports'] ) ) {\n\t\t\t\tforeach ( $config['imports'] as $import ) {\n\t\t\t\t\tif ( ! empty( $import['resource'] ) && file_exists( $this->config_path . '/' . $import['resource'] ) ) {\n\t\t\t\t\t\t$import = $yaml->parse( file_get_contents( $this->config_path . '/' . $import['resource'] ) );\n\t\t\t\t\t\t$config = array_merge( $config, $import );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset( $config['imports'] );\n\t\t\t}\n\n\t\t\tforeach ( $config as $key => $value ) {\n\t\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\t\tdefine( $key, $value );\n\t\t\t\t\tunset( $config[ $key ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}",
"public static function loadConfig()\n { \n if(!count(self::$config)) {\n \n $base = realpath(__DIR__.'/..');\n\n $documentRoot = $base .'/www';\n \n $themes = $documentRoot.'/wp-content/themes';\n\n $themes = $documentRoot.'/wp-content/themes';\n \n $plugins = $documentRoot.'/wp-content/plugins';\n\n // Load defaut config file\n $default_file = realpath(__DIR__.\"/config.ignore.yml\");\n self::$config = Yaml::parseFile($default_file);\n \n // Load local config file if exist\n $local_file = realpath($base.\"/config.ignore.yml\");\n\n if (file_exists($local_file)) {\n self::$config = array_merge(self::$config, Yaml::parseFile($local_file));\n }\n\n self::$config['base'] = $base;\n self::$config['documentRoot'] = $documentRoot;\n self::$config['themes'] = $themes;\n self::$config['plugins'] = $plugins;\n self::$config['tmp-dir'] = $base.'/tmp';\n\n \n }\n\n return self::$config;\n }",
"protected function load()\n {\n foreach (config('shield.enabled') as $name => $class) {\n $this->register($name, $class);\n }\n }",
"protected function loadConfig() {\n global $config_cascade;\n foreach(array('default','protected') as $type) {\n if(array_key_exists($type,$config_cascade['plugins']))\n $this->plugin_cascade[$type] = $this->checkRequire($config_cascade['plugins'][$type]);\n }\n $local = $config_cascade['plugins']['local'];\n $this->last_local_config_file = array_pop($local);\n $this->plugin_cascade['local'] = $this->checkRequire(array($this->last_local_config_file));\n if(is_array($local)) {\n $this->plugin_cascade['default'] = array_merge($this->plugin_cascade['default'],$this->checkRequire($local));\n }\n $this->tmp_plugins = array_merge($this->plugin_cascade['default'],$this->plugin_cascade['local'],$this->plugin_cascade['protected']);\n }",
"private function configuration()\n {\n $config = [];\n $config_json = $this->getPath().'config.json';\n $config_php = $this->getPath().'config.php';\n\n // Parse config from jSon file\n if (file_exists($config_json))\n {\n $config = array_merge(\n $config, \n $this->json( $config_json, true )\n );\n }\n else if (file_exists($config_php))\n {\n include_once $config_php;\n }\n\n // Parse config from Index.php\n $config = array_merge(\n $config,\n self::configuration_index($this->getPath())\n );\n\n $this->config = (object) $config;\n }"
] | [
"0.64601207",
"0.6165954",
"0.6118013",
"0.6062512",
"0.6062512",
"0.60048735",
"0.59201825",
"0.5890098",
"0.58409506",
"0.58391166",
"0.58082324",
"0.57912046",
"0.5774933",
"0.5768226",
"0.5746704",
"0.57352924",
"0.5734648",
"0.57077724",
"0.5688492",
"0.56825364",
"0.56718886",
"0.56519735",
"0.56328565",
"0.56187445",
"0.56110114",
"0.55305624",
"0.5524675",
"0.55210793",
"0.55111945",
"0.5497641"
] | 0.70164365 | 0 |
Loads the configuration for the bias types and values present in the design chain and bias chain. | private function loadBiasConfig()
{
// bias type (value) for each game (key)
$ordered_types = BasicHelper::reindexArray(BasicHelper::parseChainLeft($this->rawCondition['design_chain']));
$unique_types = BasicHelper::parseChainLeft($this->rawCondition['bias_chain']);
$unique_values = array_combine(array_values($unique_types), array_values(BasicHelper::parseChainRight($this->rawCondition['bias_chain'])));
$temp = [];
foreach ($ordered_types as $type) {
$temp[] = $unique_values[$type];
}
// percentage of bias (value) for each game (key)
$ordered_values = BasicHelper::reindexArray($temp);
unset($temp);
$this->biasConfig = [
'ordered_types' => $ordered_types,
'ordered_values' => $ordered_values,
'unique_types' => $unique_types,
'unique_values' => $unique_values
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBiasConfig() : array\n {\n return $this->biasConfig;\n }",
"protected function initialize()\n {\n foreach ($this->_registered as $type => $asset)\n {\n foreach (config_item('biasset_register_'.$type) as $id => $meta)\n {\n $meta = array_set_defaults($meta, array(\n 'src' => '',\n 'min' => '',\n 'ver' => '',\n 'dep' => array(),\n ));\n\n $asset[$id] = $meta;\n }\n\n $this->_registered[$type] = $asset;\n\n foreach (config_item('biasset_autoload_'.$type) as $asset_id)\n {\n $this->load($type, $asset_id);\n }\n }\n }",
"private function loadConfig() {\n $configClass = $this->input->getOption('configclass');\n if (is_null($configClass)) {\n $configClass = DefaultBuilderConfig::class;\n }\n try {\n $this->config = $this->container->get($configClass, [\n 'projectFolder' => $this->getApplication()->getProjectFolder()\n ]);\n } catch (ReflectionException $ex) {\n $this->output->writeln([\n \"<warn>Unable to load the provided configuration [{$configClass}]</warn>\",\n \"<warn>Will continue with the default configuration.</warn>\"\n ]);\n $configClass = DefaultBuilderConfig::class;\n $this->config = $this->container->get($configClass, [\n 'projectFolder' => $this->getApplication()->getProjectFolder()\n ]);\n }\n $this->output->writeln('<info>Using the ' . get_class($this->config) . ' as configuration</info>');\n }",
"public static function load()\n {\n if($organizationId = config('configs.orgId', null)){\n \\Tool::changeDatabase($organizationId);\n }\n\n if(Schema::hasTable('config_manages')){\n foreach (ConfigManages::all(['key', 'value']) as $config) {\n config([$config['key'] => $config['value']]);\n }\n }else{\n //\n // Log::error('table not exists');\n }\n\n }",
"abstract public function loadConfig();",
"public function loadConfig()\n {\n $path = $this->takeConfig()->rawItem('config');\n if ($path) {\n $this->module->loadExtraConfig($path);\n }\n }",
"private function loadDesignConfig()\n {\n // design name (value) for each game (key)\n $ordered_names = BasicHelper::reindexArray(BasicHelper::parseChainRight($this->rawCondition['design_chain']));\n $unique_names = array_unique($ordered_names);\n\n\n $temp = [];\n foreach ($unique_names as $name)\n {\n $temp[] = Design::getByName($name)['iterations'];\n }\n $unique_phases = array_combine(array_values($unique_names), $temp);\n unset($temp);\n\n\n $temp = [];\n foreach ($ordered_names as $name)\n {\n $temp[] = $unique_phases[$name];\n }\n // amount of iterations (value) for each game (key)\n $ordered_phases = BasicHelper::reindexArray($temp);\n unset($temp);\n\n\n $this->designConfig = [\n 'ordered_names' => $ordered_names,\n 'ordered_phases' => $ordered_phases,\n 'unique_names' => $unique_names,\n 'unique_phases' => $unique_phases\n ];\n }",
"private function _init_configurations() {\n\n $config = Configuration::getMultiple(array(\n 'AFTERPAY_ENABLED',\n 'AFTERPAY_MERCHANT_ID',\n 'AFTERPAY_MERCHANT_KEY',\n 'AFTERPAY_API_ENVIRONMENT',\n 'AFTERPAY_PAYMENT_MIN',\n 'AFTERPAY_PAYMENT_MAX',\n 'AFTERPAY_RESTRICTED_CATEGORIES',\n 'AFTERPAY_USER_AGENT',\n ));\n\n $this->afterpay_enabled = false;\n if (!empty($config['AFTERPAY_ENABLED'])) {\n $this->afterpay_enabled = (bool)$config['AFTERPAY_ENABLED'];\n }\n if (!empty($config['AFTERPAY_MERCHANT_ID'])) {\n $this->afterpay_merchant_id = $config['AFTERPAY_MERCHANT_ID'];\n }\n if (!empty($config['AFTERPAY_MERCHANT_KEY'])) {\n $this->afterpay_merchant_key = $config['AFTERPAY_MERCHANT_KEY'];\n }\n if (!empty($config['AFTERPAY_API_ENVIRONMENT'])) {\n $this->afterpay_api_environment = $config['AFTERPAY_API_ENVIRONMENT'];\n }\n if (!empty($config['AFTERPAY_PAYMENT_MIN'])) {\n $this->afterpay_payment_min = (float)$config['AFTERPAY_PAYMENT_MIN'];\n }\n if (!empty($config['AFTERPAY_PAYMENT_MAX'])) {\n $this->afterpay_payment_max = (float)$config['AFTERPAY_PAYMENT_MAX'];\n }\n $this->afterpay_restricted_categories = array();\n if (!empty($config['AFTERPAY_RESTRICTED_CATEGORIES'])) {\n $this->afterpay_restricted_categories = json_decode($config['AFTERPAY_RESTRICTED_CATEGORIES']);\n }\n if (!empty($config['AFTERPAY_USER_AGENT'])) {\n $this->afterpay_user_agent = $config['AFTERPAY_USER_AGENT'];\n }\n }",
"private function loadConfig()\n {\n $this->category->config = [];\n $this->loadMeta('admins', 'array');\n $this->loadMeta('members', 'array');\n $this->loadMeta('template');\n $this->loadMetaCategory();\n }",
"public function load(array $configs, ContainerBuilder $container)\n {\n \n }",
"protected function loadConfig() {\n /* Load required defaults file */\n $defaults = $this->loadFromFile(\n $this->tag . \"_defaults.yaml\",\n true);\n\n /* Try to load user configuration. */\n $user = $this->loadFromFile(\n $this->tag . \"_config.yaml\",\n false);\n\n /* Merge defaults and user config. */\n $this->cfg = array_replace_recursive($defaults, $user);\n }",
"public function __construct()\n\t{\n\t\t$this->config = array_merge(C::get('basset::basset'), array(\n\t\t\t'caching'\t => array('forget' => false),\n\t\t\t'inline'\t => false,\n\t\t\t'development' => false\n\t\t), Config::$extend);\n\t}",
"public function getConfigBE()\n\t{\n\t\treturn [];\n\t}",
"public function loadConfig()\n {\n include($this->getLibBasePath() . '/config/application.php');\n include($this->getLibUniPath() . '/config/application.php');\n $this->loadAppConfig();\n }",
"public function load_configs()\n {\n // Set needed configs for each module\n $configs = array('master', 'database', 'priceplan', 'system');\n \n foreach($configs as $cfg)\n {\n if(file_exists(APPPATH . 'modules/'.$this->active_module.'/config/'.$cfg.'.php'))\n {\n $this->CI->load->config($this->active_module.'/'.$cfg);\n }\n else\n {\n $message = 'Moduļa konfigurācijas fails \"'.$this->active_module.'/config/'.$cfg.'.php\" nav atrasts! Iespējams ka šī ir jauna shop instalācija un tādā gadījumā ir javeic moduļa konfigurācijas faila pārsaukšana no '.$cfg.'.example.php uz '.$cfg.'.php';\n log_message('error', $message);\n show_error($message);\n }\n }\n }",
"private static function loadConfig() \n {\n // Global application configurations\n self::$config = new Data\\StaticData(self::$APP_PATH.\"config/\");\n\n // Configurations\n require_once(self::$APP_PATH.\"config/config.php\");\n\n // Initializers, load all files in initializers directory\n $initializers_path = self::$APP_PATH.\"config/initializers/\"; \n foreach (scandir($initializers_path) as $file) {\n if (preg_match('/^[A-Za-z_\\-.]+\\.php$/', $file)) {\n require_once($initializers_path.$file);\n }\n }\n\n // Database configurations\n require_once(self::$CORE_PATH.\"database.php\");\n }",
"protected function loadBackendConfiguration() {\n\n\t\t$backendUserAuthentication = $this->getBackendUserAuthentication();\n\t\tif (!isset($backendUserAuthentication)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$modTSconfig = $backendUserAuthentication->getTSConfig('mod.tx_linkhandler', BackendUtility::getPagesTSconfig($this->getCurrentPageUid()));\n\t\tif (is_array($modTSconfig['properties'])) {\n\t\t\t$this->configuration = $modTSconfig['properties'];\n\t\t}\n\t}",
"protected function load()\n {\n foreach (config('shield.enabled') as $name => $class) {\n $this->register($name, $class);\n }\n }",
"public function loadConfiguration(): void\n {\n }",
"public function loadConfiguration(): void\n {\n }",
"abstract public function setupConfig();",
"public function initConfig() {\r\n $config = array();\r\n\r\n $config['autoAdvance'] = '1';\r\n $config['mobileAutoAdvance'] = '1';\r\n $config['barDirection'] = 'leftToRight';\r\n $config['barPosition'] = 'bottom';\r\n $config['fx'] = 'random';\r\n $config['height'] = '43%';\r\n $config['hover'] = '1';\r\n $config['loader'] = 'pie';\r\n $config['loaderColor'] = '#eeeeee';\r\n $config['loaderBgColor'] = '#222222';\r\n $config['loaderOpacity'] = '.8';\r\n $config['loaderPadding'] = '2';\r\n $config['loaderStroke'] = '7';\r\n $config['minHeight'] = '200px';\r\n $config['navigation'] = '1';\r\n $config['navigationHover'] = '1';\r\n $config['pagination'] = '1';\r\n $config['playPause'] = '1';\r\n $config['pauseOnClick'] = '1';\r\n $config['pieDiameter'] = '38';\r\n $config['piePosition'] = 'rightTop';\r\n $config['portrait'] = '1';\r\n $config['time'] = '7000';\r\n $config['transPeriod'] = '1500';\r\n $config['skin'] = 'camera_black_skin';\r\n\r\n return Configuration::updateValue($this->name, json_encode($config));\r\n }",
"protected function loadInternal(array $mergedConfig, ContainerBuilder $container) {\n//\t\t$loader = new XmlFileLoader($container, new \\Symfony\\Component\\Config\\FileLocator(__DIR__ . '/../Resources/config'));\n\t\t\n\t\t$container->setParameter('bean_book.backend_type_orm', true);\n//\t\t$container->setParameter('bean_book.backend_type_orm_default.base', true);\n\n\t\t$container->setParameter('bean_book.backend_type_orm_default.inheritance_class', true);\n//\t\t$container->setParameter('bean_book.backend_type_orm_custom.inheritance_superclass', true);\n\t\t$container->setParameter('bean_book.persistence.orm.manager_name', null);\n\t}",
"private function loadConfigAndRecorders()\n {\n $config = $this->loadConfig();\n $this->setErrorRecorder($config['error_recorder']);\n $this->setRunRecorder($config['run_recorder']);\n $this->setUniqueAffectedRecorder($config['affected_recorder']);\n $this->setChangeRecorder($config['delta_recorder']);\n $this->options = array_merge($config, $this->options);\n }",
"protected function _bootstrapConfig()\n {\n if ((is_array($this->_config)) || ($this->_configInBootstrap)) {\n return;\n }\n $this->_configInBootstrap = true;\n $this->_initConfig();\n $this->_configInBootstrap = false;\n }",
"public function loadConfiguration()\n {\n Compiler::loadDefinitions(\n $this->getContainerBuilder(),\n $this->loadFromFile(__DIR__.'/../config/config.neon')['services']\n );\n }",
"public function brainConfig()\n {\n\n return $gateway = new Braintree\\Gateway([\n 'environment' => env('BRAINTREE_ENV'),\n 'merchantId' => env('BRAINTREE_MERCHANT_ID'),\n 'publicKey' => env('BRAINTREE_PUBLIC_KEY'),\n 'privateKey' => env('BRAINTREE_PRIVATE_KEY'),\n ]);\n\n }",
"private function seedBeamDashboardConfigs()\n {\n Config::firstOrCreate([\n 'name' => ConfigNames::CONVERSIONS_COUNT_THRESHOLD_LOW,\n 'display_name' => 'Conversions count threshold low',\n 'type' => 'int',\n 'value' => 3\n ]);\n Config::firstOrCreate([\n 'name' => ConfigNames::CONVERSIONS_COUNT_THRESHOLD_MEDIUM,\n 'display_name' => 'Conversions count threshold medium',\n 'type' => 'int',\n 'value' => 8\n ]);\n Config::firstOrCreate([\n 'name' => ConfigNames::CONVERSIONS_COUNT_THRESHOLD_HIGH,\n 'display_name' => 'Conversions count threshold high',\n 'type' => 'int',\n 'value' => 13\n ]);\n\n Config::firstOrCreate([\n 'name' => ConfigNames::CONVERSION_RATE_THRESHOLD_LOW,\n 'display_name' => 'Conversion rate threshold low',\n 'type' => 'float',\n 'value' => 3.0\n ]);\n Config::firstOrCreate([\n 'name' => ConfigNames::CONVERSION_RATE_THRESHOLD_MEDIUM,\n 'display_name' => 'Conversion rate threshold medium',\n 'type' => 'float',\n 'value' => 5.0\n ]);\n Config::firstOrCreate([\n 'name' => ConfigNames::CONVERSION_RATE_THRESHOLD_HIGH,\n 'display_name' => 'Conversion rate threshold high',\n 'type' => 'float',\n 'value' => 7.0\n ]);\n }",
"private function loadConditionConfig()\n {\n foreach ($this->designConfig['ordered_phases'] as $game_number => $phases)\n {\n // store the ratios ordered for each game number\n $this->conditionConfig['ordered_ratio'][$game_number] = ceil(($this->biasConfig['ordered_values'][$game_number] / 100) * $phases);\n\n // store the competitive behaviour ordered for each game and for each phase\n $ordered_competitive = array_fill(1, $this->conditionConfig['ordered_ratio'][$game_number], 1);\n $ordered_cooperative = array_fill($this->conditionConfig['ordered_ratio'][$game_number] + 1, $phases - $this->conditionConfig['ordered_ratio'][$game_number], 0);\n\n $this->conditionConfig['ordered_competitive'][$game_number] = $ordered_competitive + $ordered_cooperative;\n }\n }",
"protected function loadConfigs()\n {\n $configs = include rtrim($this->basePath, '/') . '/config/app.php';\n Config::getInstance($configs);\n }"
] | [
"0.5932105",
"0.59270257",
"0.55838406",
"0.5520504",
"0.55085635",
"0.53598416",
"0.5295803",
"0.52834296",
"0.5252766",
"0.5155261",
"0.51252323",
"0.51020056",
"0.50828785",
"0.50741565",
"0.5070405",
"0.5065236",
"0.50151795",
"0.50140893",
"0.50004303",
"0.50004303",
"0.49807817",
"0.4978344",
"0.49381447",
"0.49314937",
"0.49258435",
"0.49074718",
"0.49030307",
"0.48896733",
"0.4886516",
"0.4870206"
] | 0.7896658 | 0 |
Must run after loadDesignConfig and loadBiasConfig. Loads the configuration for the bias ration per game. And. Loads the configuration for phases played within each game. Each each game (key : int) contains the phases (value : array). The phases array contains the phase order (key) and the PC behaviour (competitive | not competitive). By default, if not randomized, competitive behaviour is at the top of the phases array. | private function loadConditionConfig()
{
foreach ($this->designConfig['ordered_phases'] as $game_number => $phases)
{
// store the ratios ordered for each game number
$this->conditionConfig['ordered_ratio'][$game_number] = ceil(($this->biasConfig['ordered_values'][$game_number] / 100) * $phases);
// store the competitive behaviour ordered for each game and for each phase
$ordered_competitive = array_fill(1, $this->conditionConfig['ordered_ratio'][$game_number], 1);
$ordered_cooperative = array_fill($this->conditionConfig['ordered_ratio'][$game_number] + 1, $phases - $this->conditionConfig['ordered_ratio'][$game_number], 0);
$this->conditionConfig['ordered_competitive'][$game_number] = $ordered_competitive + $ordered_cooperative;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadBiasConfig()\n {\n // bias type (value) for each game (key)\n $ordered_types = BasicHelper::reindexArray(BasicHelper::parseChainLeft($this->rawCondition['design_chain']));\n $unique_types = BasicHelper::parseChainLeft($this->rawCondition['bias_chain']);\n\n\n $unique_values = array_combine(array_values($unique_types), array_values(BasicHelper::parseChainRight($this->rawCondition['bias_chain'])));\n\n\n $temp = [];\n foreach ($ordered_types as $type) {\n $temp[] = $unique_values[$type];\n }\n // percentage of bias (value) for each game (key)\n $ordered_values = BasicHelper::reindexArray($temp);\n unset($temp);\n\n\n $this->biasConfig = [\n 'ordered_types' => $ordered_types,\n 'ordered_values' => $ordered_values,\n 'unique_types' => $unique_types,\n 'unique_values' => $unique_values\n ];\n }",
"private function loadDesignConfig()\n {\n // design name (value) for each game (key)\n $ordered_names = BasicHelper::reindexArray(BasicHelper::parseChainRight($this->rawCondition['design_chain']));\n $unique_names = array_unique($ordered_names);\n\n\n $temp = [];\n foreach ($unique_names as $name)\n {\n $temp[] = Design::getByName($name)['iterations'];\n }\n $unique_phases = array_combine(array_values($unique_names), $temp);\n unset($temp);\n\n\n $temp = [];\n foreach ($ordered_names as $name)\n {\n $temp[] = $unique_phases[$name];\n }\n // amount of iterations (value) for each game (key)\n $ordered_phases = BasicHelper::reindexArray($temp);\n unset($temp);\n\n\n $this->designConfig = [\n 'ordered_names' => $ordered_names,\n 'ordered_phases' => $ordered_phases,\n 'unique_names' => $unique_names,\n 'unique_phases' => $unique_phases\n ];\n }",
"private function randomizePhasesOrder()\n {\n for ($i = 1; $i <= count($this->conditionConfig['ordered_competitive']); $i++)\n {\n shuffle($this->conditionConfig['ordered_competitive'][$i]);\n $this->conditionConfig['ordered_competitive'][$i] = BasicHelper::reindexArray($this->conditionConfig['ordered_competitive'][$i]);\n }\n\n }",
"private function _init_configurations() {\n\n $config = Configuration::getMultiple(array(\n 'AFTERPAY_ENABLED',\n 'AFTERPAY_MERCHANT_ID',\n 'AFTERPAY_MERCHANT_KEY',\n 'AFTERPAY_API_ENVIRONMENT',\n 'AFTERPAY_PAYMENT_MIN',\n 'AFTERPAY_PAYMENT_MAX',\n 'AFTERPAY_RESTRICTED_CATEGORIES',\n 'AFTERPAY_USER_AGENT',\n ));\n\n $this->afterpay_enabled = false;\n if (!empty($config['AFTERPAY_ENABLED'])) {\n $this->afterpay_enabled = (bool)$config['AFTERPAY_ENABLED'];\n }\n if (!empty($config['AFTERPAY_MERCHANT_ID'])) {\n $this->afterpay_merchant_id = $config['AFTERPAY_MERCHANT_ID'];\n }\n if (!empty($config['AFTERPAY_MERCHANT_KEY'])) {\n $this->afterpay_merchant_key = $config['AFTERPAY_MERCHANT_KEY'];\n }\n if (!empty($config['AFTERPAY_API_ENVIRONMENT'])) {\n $this->afterpay_api_environment = $config['AFTERPAY_API_ENVIRONMENT'];\n }\n if (!empty($config['AFTERPAY_PAYMENT_MIN'])) {\n $this->afterpay_payment_min = (float)$config['AFTERPAY_PAYMENT_MIN'];\n }\n if (!empty($config['AFTERPAY_PAYMENT_MAX'])) {\n $this->afterpay_payment_max = (float)$config['AFTERPAY_PAYMENT_MAX'];\n }\n $this->afterpay_restricted_categories = array();\n if (!empty($config['AFTERPAY_RESTRICTED_CATEGORIES'])) {\n $this->afterpay_restricted_categories = json_decode($config['AFTERPAY_RESTRICTED_CATEGORIES']);\n }\n if (!empty($config['AFTERPAY_USER_AGENT'])) {\n $this->afterpay_user_agent = $config['AFTERPAY_USER_AGENT'];\n }\n }",
"public function initConfig() {\r\n $config = array();\r\n\r\n $config['autoAdvance'] = '1';\r\n $config['mobileAutoAdvance'] = '1';\r\n $config['barDirection'] = 'leftToRight';\r\n $config['barPosition'] = 'bottom';\r\n $config['fx'] = 'random';\r\n $config['height'] = '43%';\r\n $config['hover'] = '1';\r\n $config['loader'] = 'pie';\r\n $config['loaderColor'] = '#eeeeee';\r\n $config['loaderBgColor'] = '#222222';\r\n $config['loaderOpacity'] = '.8';\r\n $config['loaderPadding'] = '2';\r\n $config['loaderStroke'] = '7';\r\n $config['minHeight'] = '200px';\r\n $config['navigation'] = '1';\r\n $config['navigationHover'] = '1';\r\n $config['pagination'] = '1';\r\n $config['playPause'] = '1';\r\n $config['pauseOnClick'] = '1';\r\n $config['pieDiameter'] = '38';\r\n $config['piePosition'] = 'rightTop';\r\n $config['portrait'] = '1';\r\n $config['time'] = '7000';\r\n $config['transPeriod'] = '1500';\r\n $config['skin'] = 'camera_black_skin';\r\n\r\n return Configuration::updateValue($this->name, json_encode($config));\r\n }",
"public function run()\n {\n Config::create([\n 'welcome' => 'Welcome to Nolan Bowl XXI',\n 'title' => 'Nolan Bowl XXX',\n 'rules' => '1. Each bowl game is assigned a point value that corresponds roughly to its relative payout (so \"how good\" the bowl is), selected by \\'The Admin\\'. Better bowls are worth more points, and the highest point total wins.\n <br><br>\n 2. TIEBREAKERS: (a) The 1st tiebreaker is \"did you pick Michigan?\" with those who did not being eliminated in favor of those who did [Go Blue!]; (b) The 2nd tiebreaker is \"did you pick Notre Dame?\" with those who did being eliminated in favor of those who did not [the \"Returning to Glory since 1993\" provision]; (c) If there is still a tie, cumulative overall number of games picked correctly will determine the champion; (d) In the event a tie is STILL in effect, we will begin with the final bowl and work backward through the games, eliminating those that picked incorrectly closest to the end of the bowl season until a winner emerges; (e) If there is still a tie (identical submissions), a coin will be flipped to determine the champion.\n <br><br>\n 3. Divisions and Conferences will be created and named arbitrarily by \\'The Admin\\', and mean nothing in terms of winning the pool. They\\'re just fun.\n <br><br>\n 4. Entry for Nolan Bowl XX is 免费 (free, as always), and the grand prize is status as Nolan Bowl XX Champion, which gains you admission to the Nolan Bowl Hall of Champions.\n <br><br>',\n 'mapembed' => '<iframe src=\"https://www.google.com/maps/d/u/0/embed?mid=1V4wXaqc_hcB5uQ2TTWHCFEPGVey8PAyV\" width=\"640\" height=\"480\"></iframe>',\n 'seasonlock' => 'no',\n 'cq1' => 'How tall are you really?',\n 'cq2' => 'Are you sure you\\'re ready for football?',\n ]);\n\n \n }",
"private function loadConfigAndRecorders()\n {\n $config = $this->loadConfig();\n $this->setErrorRecorder($config['error_recorder']);\n $this->setRunRecorder($config['run_recorder']);\n $this->setUniqueAffectedRecorder($config['affected_recorder']);\n $this->setChangeRecorder($config['delta_recorder']);\n $this->options = array_merge($config, $this->options);\n }",
"function _getPhases()\n { \n static $result = array(); \n if (count($result)) return $result; // caching\n \n $pid = $this->m_project[\"id\"];\n $organization_id = $this->m_project[\"organization_id\"];\n \n global $g_db;\n \n $users = $this->_getUsers();\n $planned_userids = array_keys($users);\n $planned_periods = $this->_getPlanPeriods();\n \n $phaserecs = $g_db->getrows(\"SELECT \n phase.startdate,\n phase.enddate,\n phase.id,\n phase.name,\n phase.current_planning,\n phase.initial_planning\n FROM \n phase\n WHERE \n projectid = $pid\"); \n \n foreach($phaserecs as $rec)\n {\n $id = $rec[\"id\"];\n $result[$id][\"name\"] = $rec[\"name\"];\n $result[$id][\"startdate\"] = str_replace(\"-\",\"\",$rec[\"startdate\"]);\n $result[$id][\"enddate\"] = str_replace(\"-\", \"\", $rec[\"enddate\"]);\n \n // Load the users\n foreach($users as $userid=>$userinfo)\n {\n $result[$id][\"emps\"][$userid][\"name\"] = $userinfo[\"name\"];\n // Initialize available minutes\n foreach($planned_periods as $period)\n {\n $result[$id][\"emps\"][$userid][$period][\"available_time\"]=$this->_getAvailableHours($userid,$period,$id)*60;\n }\n \n }\n \n \n // Load the initial userplanning per phase\n $phaseplanrecs = $g_db->getrows(\"SELECT initial_planning, current_planning, personid FROM project_phaseplanning WHERE phaseid = \".$id);\n foreach ($phaseplanrecs as $phaseplanrec)\n {\n $result[$id][\"emps\"][$phaseplanrec[\"personid\"]][\"total\"][\"initial_time\"]+= $phaseplanrec[\"initial_planning\"];\n $result[$id][\"emps\"][$phaseplanrec[\"personid\"]][\"total\"][\"current_time\"]+= $phaseplanrec[\"current_planning\"];\n $result[$id][\"emps\"][$phaseplanrec[\"personid\"]][\"total\"][\"leftover_time\"]+= $phaseplanrec[\"current_planning\"];\n \n $result[$id][\"total\"][\"initial_time\"]+= $phaseplanrec[\"initial_planning\"]; \n \n $rate = $this->_getRate($phaseplanrec[\"personid\"], substr($result[$id][\"startdate\"],0,6), '', $pid, $organization_id);\n $result[$id][\"emps\"][$phaseplanrec[\"personid\"]][\"total\"][\"initial_amount\"]+= (($phaseplanrec[\"initial_planning\"]/60)*$rate);\n $result[$id][\"emps\"][$phaseplanrec[\"personid\"]][\"total\"][\"current_amount\"]+= (($phaseplanrec[\"current_planning\"]/60)*$rate);\n $result[$id][\"total\"][\"initial_amount\"]+= (($phaseplanrec[\"initial_planning\"]/60)*$rate);\n $result[$id][\"total\"][\"current_amount\"]+= (($phaseplanrec[\"current_planning\"]/60)*$rate);\n \n $this->m_phase_totals[$id][\"initial_amount\"] += (($phaseplanrec[\"initial_planning\"]/60)*$rate);\n $this->m_phase_totals[$id][\"current_amount\"] += (($phaseplanrec[\"current_planning\"]/60)*$rate);\n }\n \n // Load the planitems.\n $itemrecs = $g_db->getrows(\"SELECT \n projectplan_planitem.userid, month, planned, rate\n FROM \n projectplan_planitem,\n person\n LEFT JOIN billing_rate ON (\n (startdate IS NULL OR concat(month,'01') > date_format(startdate,'%Y%m%d'))\n AND (enddate IS NULL OR concat(month,'01') < date_format(enddate,'%Y%m%d'))\n AND (user_id IS NULL OR user_id=0 OR user_id = projectplan_planitem.userid)\n AND (functionlevel_id IS NULL OR functionlevel_id=0 OR functionlevel_id = person.functionlevel)\n AND (project_id IS NULL OR project_id=0 OR project_id=$pid)\n AND (customer_id IS NULL OR customer_id=0 OR customer_id='$organization_id')\n )\n WHERE\n person.id = projectplan_planitem.userid \n AND phaseid='\".$id.\"'\n ORDER BY\n userid, month, priority DESC\");\n $prevhash = \"\";\n //var_dump($itemrecs);\n foreach ($itemrecs as $itemrec)\n {\n $hash = $itemrec[\"userid\"].$itemrec[\"month\"];\n if ($hash!=$prevhash) // otherwise it's a second rate for the same phase, which we should ignore\n {\n $userid = $itemrec[\"userid\"]; $month = $itemrec[\"month\"]; \n $result[$id][\"emps\"][$userid][$month][\"planned_time\"] = $itemrec[\"planned\"];\n $result[$id][\"emps\"][$userid][\"total\"][\"planned_time\"] += $itemrec[\"planned\"];\n $result[$id][\"emps\"][$userid][\"total\"][\"leftover_time\"] -= $itemrec[\"planned\"];\n \n $result[$id][\"emps\"][$userid][$month][\"planned_amount\"] = ($itemrec[\"planned\"]/60)*$itemrec[\"rate\"];\n $result[$id][\"emps\"][$userid][\"total\"][\"planned_amount\"] += ($itemrec[\"planned\"]/60)*$itemrec[\"rate\"];\n \n $result[$id][\"total\"][\"planned_time\"] += $itemrec[\"planned\"];\n $result[$id][\"total\"][\"planned_amount\"] += ($itemrec[\"planned\"]/60)*$itemrec[\"rate\"];\n \n $this->m_phase_totals[$id][\"planned_amount\"] += ($itemrec[\"planned\"]/60)*$itemrec[\"rate\"];\n \n //$result[$id][\"emps\"][$userid][$month][\"available_time\"]-=$itemrec[\"planned\"];\n $prevhash = $hash;\n } \n }\n \n // Load the users\n foreach($users as $userid=>$userinfo)\n {\n $result[$id][\"emps\"][$userid][\"name\"] = $userinfo[\"name\"];\n // Initialize available hours\n foreach($planned_periods as $period)\n {\n $rate = $this->_getRate($userid, $period, '', $pid, $organization_id);\n $result[$id][\"emps\"][$userid][$period][\"available_amount\"]=(($result[$id][\"emps\"][$userid][$period][\"available_time\"]/60)*$rate);\n }\n \n }\n // load the actuals\n $hourrecs = $g_db->getrows(\"SELECT \n sum(time) as time, \n hours.userid, \n date_format(activitydate, '%Y%m') as month, \n activityid\n FROM\n hours\n WHERE \n phaseid='$id' \n GROUP BY month, userid, phaseid, activityid\"); \n \n foreach ($hourrecs as $hourrec)\n {\n $rate = $this->_getRate($hourrec[\"userid\"], $hourrec[\"month\"], $hourrec[\"activityid\"], $pid, $organization_id); \n \n \n if (!in_array($hourrec[\"userid\"], $planned_userids))\n { \n $hourrec[\"userid\"] = \"other\";\n }\n if (!in_array($hourrec[\"month\"], $planned_periods))\n {\n if ($hourrec[\"month\"]<$planned_periods[0])\n {\n $hourrec[\"month\"] = \"pre\";\n }\n else\n {\n $hourrec[\"month\"] = \"post\";\n }\n }\n $result[$id][\"emps\"][$hourrec[\"userid\"]][$hourrec[\"month\"]][\"booked_time\"]+= $hourrec[\"time\"]; \n $result[$id][\"emps\"][$hourrec[\"userid\"]][\"total\"][\"booked_time\"] += $hourrec[\"time\"];\n $result[$id][\"emps\"][$hourrec[\"userid\"]][$hourrec[\"month\"]][\"booked_amount\"]+= (($hourrec[\"time\"]/60) * $rate); \n $result[$id][\"emps\"][$hourrec[\"userid\"]][\"total\"][\"booked_amount\"] += (($hourrec[\"time\"]/60) * $rate); \n $result[$id][\"total\"][\"booked_time\"]+=$hourrec[\"time\"]; \n $result[$id][\"total\"][\"booked_amount\"]+=($hourrec[\"time\"]/60)*$rate; \n $this->m_phase_totals[$id][\"booked_amount\"]+=($hourrec[\"time\"]/60)*$rate; \n \n }\n } \n \n return $result;\n }",
"public function configuracion()\r\n {\r\n $configuracion = file_get_contents(realpath(__DIR__ . '') . \"/../config/parametrosPlantilla.json\");\r\n $parametrosSistema = file_get_contents(realpath(__DIR__ . '') . \"/../config/parametrosGenerales.json\");\r\n $configuracion1 = json_decode($configuracion, TRUE);\r\n $array = json_decode($parametrosSistema, true);\r\n foreach ($array as $clave => $valor) {\r\n if($clave === \"llave_recaptcha_publica\" || $clave === \"llave_google_analytics\"){\r\n $configuracion1[] = array($clave => $valor);\r\n }\r\n }\r\n return $configuracion1;\r\n }",
"function loadConfig(){\n global $config, $lang, $PMCI;\n if(!isset($aPMConfig) || !is_array($aPMConfig)) $aPMConfig = array();\n $this->aC = $check = array();\n $mcount = 0;\n if(($tCfg = file_get_contents( DIR_PLUGINS.\"{$this->sName}/config.php\" )) !== false){\n // get rid of comments\n $tCfg = preg_replace(array('@\\/\\*.*\\*\\/@sUm','@[\\n|\\r]\\s*\\/\\/.*([\\n|\\r])@U'),array('','$1'),$tCfg);\n if(preg_match_all('/\\$config\\[\\s*[\\'|\"]{1}(\\w+)[\\'|\"]{1}\\s*\\](?:\\[\\s*[\\'|\"]{1}(\\w+)[\\'|\"]{1}\\s*\\])?\\s*=(.*);/sUm', $tCfg, $m)>0){\n $mcount = count($m[1]);\n }\n unset($tCfg);\n }\n for($i=0;$i<$mcount;$i++){\n // got 1 or more matches...\n $inst = array();\n $name = rtrim($m[1][$i].'__'.$m[2][$i], '_'); // use double underbar to join array keys\n $this->aC[$name] = array(); // sFid = $name\n $this->aC[$name]['sConfig'] = rtrim($m[1][$i].','.$m[2][$i], ','); // this is how you later identify the config variable when the form is POSTed back\n if($m[2][$i]!=''){ // ie. $config['levelOne']['levelTwo'] = ...\n if(isset($PMCI[$m[1][$i]][$m[2][$i]]) && is_array($PMCI[$m[1][$i]][$m[2][$i]])) { $inst = $PMCI[$m[1][$i]][$m[2][$i]]; }\n $tempconfig = $config[$m[1][$i]][$m[2][$i]]; // the current setting of the config variable\n }else{ // ie. $config['levelOne'] = ...\n if(isset($PMCI[$m[1][$i]]) && is_array($PMCI[$m[1][$i]])) { $inst = $PMCI[$m[1][$i]]; }\n $tempconfig = $config[$m[1][$i]]; // the current setting of the config variable\n }\n $exactconfig = trim($m[3][$i]); // the value of the config variable as typed in the file\n $this->aC[$name]['hide'] = (isset($inst['hide']) && $inst['hide']===true) ? true : false;\n if(!$this->aC[$name]['hide']){\n if(isset($lang['PMCI'][$name]) && is_array($lang['PMCI'][$name])) { // use instructions from language file only if config instructions aren't available\n foreach($lang['PMCI'][$name] as $k=>$v){ if(!isset($inst[$k])) $inst[$k] = $v; }\n }\n $this->aC[$name]['disable'] = (isset($inst['disable']) && $inst['disable']===true) ? true : false; // value can't be modified\n $this->aC[$name]['sName'] = isset($inst['name']) ? $inst['name'] : $name ; // this is the text descriptor of the field\n $this->aC[$name]['alt'] = isset($inst['alt']) ? $inst['alt'] : $name ; // this is the alt and title attributes for the field\n $this->aC[$name]['sText'] = isset($inst['text']) ? $inst['text'] : ($this->aC[$name]['disable'] ? $lang['PMunmodifiable'] : '' ); // this is the 'hint' text for the field\n if(!$this->aC[$name]['disable'] && isset($inst['check'])) { // these are the parts of the call to checkForm\n if(is_array($inst['check'])) {\n $t = 'Array(\"'.$name.'\"';\n foreach($inst['check'] as $cv) { $t .= ', \"'.$cv.'\"'; }\n $check[] = $t.')';\n }else{\n $check[] = 'Array(\"'.$name.'\", \"'.$inst['check'].'\")';\n }\n }\n $this->aC[$name]['sFormat'] = $this->_checkFormat($tempconfig,(isset($inst['format'])?$inst['format']:null)); // this gives some indication of the structure of the config variable\n $this->aC[$name]['type'] = isset($inst['type']) ? $inst['type'] : ( $this->aC[$name]['sFormat']=='b' ? 'checkbox' : 'input' ); // this is the type of field for capture of the config value\n $this->aC[$name]['value'] = $this->_getValue($this->aC[$name]['sFormat'],$tempconfig,$exactconfig); // this is the current value of the config variable\n $this->_checkType($name);\n }\n unset($inst);\n }\n $ccount = count($check);\n if($ccount>0){\n $this->sCheckForm = \"onsubmit='return checkForm( this, Array(\";\n for($i=0;$i<$ccount;$i++){ $this->sCheckForm .= $check[$i].','; }\n $this->sCheckForm = rtrim($this->sCheckForm,',').\"));'\";\n }\n unset($check); unset($m); unset($tempconfig); unset($exactconfig);\n }",
"public function run(): void\n {\n ActivitiesConfigRegFirstimeRandom::insert(\n [\n [\n 'id' => 1,\n 'item' => '一等奖',\n 'amount' => '100.00',\n 'probability' => '1.00',\n ],\n [\n 'id' => 2,\n 'item' => '二等奖',\n 'amount' => '90.00',\n 'probability' => '1.00',\n ],\n [\n 'id' => 3,\n 'item' => '三等奖',\n 'amount' => '80.00',\n 'probability' => '3.00',\n ],\n [\n 'id' => 4,\n 'item' => '四等奖',\n 'amount' => '50.00',\n 'probability' => '5.00',\n ],\n [\n 'id' => 5,\n 'item' => '五等奖',\n 'amount' => '10.00',\n 'probability' => '30.00',\n ],\n [\n 'id' => 6,\n 'item' => '六等奖',\n 'amount' => '2.00',\n 'probability' => '60.00',\n ],\n ],\n );\n }",
"public function getConfig()\n {\n return [\n 'payment' => [\n Config::METHOD_CC => [\n 'isActive' => $this->config->isActive(Config::METHOD_CC),\n 'availableCardTypes' => $this->config->getEnabledCreditCardTypes(),\n 'logoFileNames' => $this->config->getLogoImagesUrls(),\n Config::XML_CONFIG_CC_3DSECURE => $this->config->isCreditCard3DSecureEnabled(),\n 'cardTypeFieldName' => 'ems_card_type',\n ],\n Config::METHOD_SOFORT => [\n 'isActive' => $this->config->isActive(Config::METHOD_SOFORT),\n ],\n Config::METHOD_MAESTRO => [\n 'isActive' => $this->config->isActive(Config::METHOD_MAESTRO),\n 'availableCardTypes' => $this->config->getMaestroCardTypes(),\n 'logoFileNames' => $this->config->getLogoImagesUrls(),\n 'cardTypeFieldName' => 'debit_card_type',\n Config::XML_CONFIG_CC_3DSECURE => true,\n ],\n Config::METHOD_MASTER_PASS => [\n 'isActive' => $this->config->isActive(Config::METHOD_MASTER_PASS),\n ],\n Config::METHOD_PAYPAL => [\n 'isActive' => $this->config->isActive(Config::METHOD_PAYPAL),\n ],\n Config::METHOD_IDEAL => [\n 'isActive' => $this->config->isActive(Config::METHOD_IDEAL),\n 'isBankSelectionEnabled' => $this->config->isIdealIssuingBankSelectionEnabled(),\n 'issuingBank' => 'issuing_bank',\n 'availableBanks' => $this->config->getIdealEnabledIssuingBanks(),\n 'availableCustomerId' => $this->config->isIdealCustomerSelectionEnabled()\n ],\n Config::METHOD_BANCONTACT => [\n 'isActive' => $this->config->isActive(Config::METHOD_BANCONTACT),\n 'isBankSelectionEnabled' => $this->config->isBancontactIssuingBankSelectionEnabled(),\n 'issuingBank' => 'issuing_bank',\n 'availableBanks' => $this->config->getBancontactEnabledIssuingBanks(),\n ],\n Config::METHOD_KLARNA => [\n 'isActive' => $this->config->isActive(Config::METHOD_KLARNA),\n ],\n 'emsPayGeneral' => [\n 'emspayRedirectUrl' => Config::CHECKOUT_REDIRECT_URL,\n 'logoFileNames' => $this->config->getLogoImagesUrls(),\n ]\n\n ]\n ];\n }",
"public function run()\n {\n TiGoal::find(1)->processes()->attach([\n 'EDM01', 'EDM02',\n 'APO01', 'APO02', 'APO03', 'APO05', 'APO07', 'APO08',\n 'BAI01', 'BAI02'\n ]);\n\n TiGoal::find(2)->processes()->attach([\n 'APO01', 'APO12', 'APO13',\n 'BAI10',\n 'DSS05',\n 'MEA02', 'MEA03'\n ]);\n\n TiGoal::find(3)->processes()->attach([\n 'EDM01', 'EDM05'\n ]);\n\n TiGoal::find(4)->processes()->attach([\n 'EDM03',\n 'APO10', 'APO12', 'APO13',\n 'BAI01', 'BAI06',\n 'DSS01', 'DSS02', 'DSS03', 'DSS04', 'DSS05', 'DSS06',\n 'MEA01', 'MEA02', 'MEA03'\n ]);\n\n TiGoal::find(5)->processes()->attach([\n 'EDM02',\n 'APO04', 'APO05', 'APO06', 'APO11',\n 'BAI01'\n ]);\n\n TiGoal::find(6)->processes()->attach([\n 'EDM02', 'EDM03', 'EDM05',\n 'APO06', 'APO12', 'APO13',\n 'BAI09'\n ]);\n\n TiGoal::find(7)->processes()->attach([\n 'EDM01', 'EDM02', 'EDM05',\n 'APO02', 'APO08', 'APO09', 'APO10', 'APO11',\n 'BAI02', 'BAI03', 'BAI04', 'BAI06',\n 'DSS01', 'DSS02', 'DSS03', 'DSS04', 'DSS06',\n 'MEA01'\n ]);\n\n TiGoal::find(8)->processes()->attach([\n 'APO04',\n 'BAI05', 'BAI07'\n ]);\n\n TiGoal::find(9)->processes()->attach([\n 'EDM04',\n 'APO01', 'APO03', 'APO04', 'APO10',\n 'BAI08'\n ]);\n\n TiGoal::find(10)->processes()->attach([\n 'EDM03',\n 'APO12', 'APO13',\n 'BAI06',\n 'DSS05'\n ]);\n\n TiGoal::find(11)->processes()->attach([\n 'EDM04',\n 'APO01', 'APO03', 'APO04', 'APO07',\n 'BAI04', 'BAI09', 'BAI10',\n 'DSS01', 'DSS03',\n 'MEA01'\n ]);\n\n TiGoal::find(12)->processes()->attach([\n 'APO08',\n 'BAI02', 'BAI07'\n ]);\n\n TiGoal::find(13)->processes()->attach([\n 'APO05', 'APO07', 'APO11', 'APO12',\n 'BAI01', 'BAI05'\n ]);\n\n TiGoal::find(14)->processes()->attach([\n 'APO09',\n 'BAI04', 'BAI10',\n 'DSS03', 'DSS04'\n ]);\n\n TiGoal::find(15)->processes()->attach([\n 'EDM03',\n 'APO02',\n 'MEA01', 'MEA02'\n ]);\n\n TiGoal::find(16)->processes()->attach([\n 'EDM04',\n 'APO01', 'APO07',\n ]);\n\n TiGoal::find(17)->processes()->attach([\n 'EDM02',\n 'APO01', 'APO02', 'APO04', 'APO07', 'APO08',\n 'BAI05', 'BAI08'\n ]);\n\n }",
"public static function load()\n {\n if($organizationId = config('configs.orgId', null)){\n \\Tool::changeDatabase($organizationId);\n }\n\n if(Schema::hasTable('config_manages')){\n foreach (ConfigManages::all(['key', 'value']) as $config) {\n config([$config['key'] => $config['value']]);\n }\n }else{\n //\n // Log::error('table not exists');\n }\n\n }",
"function Initialize() {\n\n foreach($this->configGlobal as $key=>$value) {\n\n $this->$key = !empty($parameters[$key])\n\n ? $parameters[$key] : $value['default'];\n\n }\n\n if( isset($this->configModule) ) {\n\n foreach($this->configModule as $key=>$value) {\n\n $this->$key = !empty($parameters[$key])\n\n ? $parameters[$key] : $value['default'];\n\n }\n\n }\n\n }",
"public function run()\n {\n //\n \t$hormones=[\n \t \n ['Adiponectin', 1, 1],\n ['Adrenaline (epinephrine)', 1, 1],\n ['Adrenocorticotropic hormone (ACTH)', 1,1],\n ['Amylin', 1, 1],\n ['Androgens (e.g., testosterone)', 1, 1],\n ['Angiotensinogen', 1, 1],\n ['Atrial-natriuretic petide (ANP)', 2, 1],\n ['Betatrophin', 2, 1],\n ['Calciferol (vitamin D3)', 2, 1],\n ['Calcitriol', 2, 1],\n ['Cholecystokinin (CCK)', 2, 1],\n ['Corticotropin-releasing hormone (CRH)', 1, 2],\n ['Dopamine', 1, 2],\n ['Erythropoietin (EPO)', 1, 2],\n\n ['Estrogens (e.g., estradiol)', 1, 2],\n ['FGF-23 (phosphatonin', 1, 2],\n ['Fibroblast Growth Factor 19 (FGF19)', 2, 2],\n ['Follicle-stimulating hormone (FSH)', 2, 2],\n ['Gastrin', 2 ,2],\n ['Ghrelin', 2, 2],\n ['Glucagon', 2, 2],\n ['Glucocorticoids (e.g., cortisol)', 2, 2],\n ['Gonadotropin-releasing hormone (GnRH)', 1, 3],\n ['Growth hormone (GH)', 1, 3],\n ['Growth hormone-releasing hormone (GHRH)', 1, 3],\n ['Hepcidin', 1, 3],\n ['Human chorionic gonadotropin (HCG)', 1, 3],\n ['Incretins', 1, 3],\n\n ['Insulin', 2, 3],\n ['Insulin-like growth factor-1 (IGF-1)',2, 3],\n ['Irisin', 2, 3],\n ['Leptin', 2, 3],\n ['Leteinizing hormone (LH)', 2, 3],\n ['Melatonin', 2, 3],\n ['Mineralocorticoids (e.g., aldosterone)', 1, 4],\n ['Neuropeptide', 1, 4],\n ['Noradrenaline (norepinephrine)', 1, 4],\n ['Osteocalcin', 1, 4],\n ['Oxytocin', 1, 4],\n ['Parathyroid Hormone', 1, 4],\n ['Progesterone', 2, 4],\n ['Prolactin (PRL)', 2, 4],\n ['PYY3-36', 2,4],\n ['Retinol Binding Protein 4', 2, 4],\n ['Secretin', 2, 4],\n ['Serotonin', 2, 4],\n ['Somatostatin', 1,5],\n ['Thrombopoietin', 1, 5],\n ['Thyroid-stimulating hormone (TSH)', 1, 5],\n ['Thyrotropin-releasing hormone', 2,5],\n ['Thyroxine (T4)', 2, 5],\n ['Vasopressin', 2, 5],\n \n \n \t];\n\n $count = count($hormones);\n\n\t foreach ($hormones as $key => $hormoneData) {\n\t $hormone = new hormone();\n\n\t $hormone->created_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t $hormone->updated_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t $hormone->name = $hormoneData[0];\n\t $hormone->col_num = $hormoneData[1];\n\t $hormone->row_num = $hormoneData[2];\n\t $hormone->frequency = 0;\n\n\t $hormone->save();\n\t $count--;\n }\n }",
"public function init(GameSettings $config, Output $output): void\n {\n $this->battleSettings = $config->getSettings();\n $this->output = $output;\n $this->roundsLeft = $this->battleSettings['rounds'];\n if ($this->prefightCheck()) {\n $this->readyPlayerOne();\n $this->readyPlayerTwo();\n }\n }",
"static function init() {\n self::$coms = Yaml::parse(file_get_contents(__DIR__.'/wikipedia/comgeos.yaml'));\n $coms2 = Yaml::parse(file_get_contents(__DIR__.'/wikipedia/comgeos2.yaml'));\n foreach ($coms2 as $dept => $comsdept) {\n if ($dept <> 'title')\n foreach ($comsdept as $idcom => $com)\n self::$coms[$dept][$idcom] = $com;\n }\n }",
"function loadConfigGrammar() {\n\n $grammar['settings'] = [ 'delete' => NULL\n , 'get' => NULL\n , 'set' => NULL\n , 'show' => [ 'all' => NULL ]\n ];\n\n $this->loaded = true;\n $results['grammar'] = $grammar;\n $results['success'] = true;\n return $results;\n }",
"public function definition()\n {\n $games_id = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 35, 36, 37, 39, 42, 43, 44, 45, 47, 48, 49, 51, 52, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 77, 82, 83, 85, 87, 88, 89, 91, 92, 93, 94, 95, 97, 99, 100, 102, 104, 106, 108, 109, 110, 112, 116, 117, 118, 119, 120, 121, 124, 125, 128, 130, 134, 136, 137, 139, 149, 152, 154, 157, 159, 161, 163, 165, 167, 168, 169, 173, 175, 177, 179, 180, 181, 182, 184, 185, 186, 187, 188, 189, 190, 192, 193, 195, 196, 198, 199, 200, 202, 203, 204, 205, 206, 207, 209, 210, 211, 212, 213, 214, 215, 216, 217, 220, 221, 222, 224, 225, 226, 229, 230, 231, 232, 233, 234, 235, 236, 238, 239, 240, 241, 242, 243, 244, 246, 248, 249, 251, 254, 255, 256, 257, 258, 260, 261, 262, 264, 265, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 286, 287, 288, 290, 291, 292, 293, 295, 296, 297, 298, 299, 300, 301, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 334, 335, 336, 337, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 357, 358, 361, 365, 367, 370, 371, 373, 374, 376, 380, 383, 384, 386, 388, 391, 394, 399, 402, 404, 405, 409, 411, 412, 414, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 479, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 ];\n\n return [\n 'game_id' => $games_id[array_rand($games_id)],\n 'user_id' => User::all()->random()->id,\n 'vote' => [-1, 1][array_rand([-1, 1])],\n 'created_at' => $this->faker->dateTimeBetween('-31 days','now'),\n ];\n }",
"abstract public function loadConfig();",
"protected function loadConfig(): void\n {\n $this->config = pouch()->get(Config::class);\n $configData = $this->config->get();\n\n if ($configData === null) {\n return;\n }\n\n foreach ($configData as $key => $value) {\n $prop = camel_case($key);\n $this->answers[$prop] = $value;\n }\n }",
"protected function parseConfiguration() {\n\t\t$avi = $this->viewID;\n\n\t\t$allConfig = $this->processGlobalConfig();\n\n\t\t$allConfig = Module::array_merge_recursive_distinct($allConfig, $this->array_filter_key($this->app->getCurrentModule()->getLayout(), function($k) use ($avi){ return strpos($k, $avi) === 0; }));\n\n\t\t$allConfig[$avi] = array_filter($allConfig[$avi], function($v){ return !is_array($v); });\n\t\t$this->processAssetsPaths($allConfig[$avi], $this->pathParameters);\n\t\t$this->config->appendProperties($allConfig[$avi]);\n\n\t\tif (isset($allConfig[$avi.'*l'])) {\n\t\t\t$allConfig[$avi.'*l'] = array_filter($allConfig[$avi.'*l'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*l'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*l'], Element::$prefixes[Element::FOR_LANDSCAPE -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*tab'])) {\n\t\t\t$allConfig[$avi.'*tab'] = array_filter($allConfig[$avi.'*tab'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*tab'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*tab'], Element::$prefixes[Element::FOR_TABLET -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*and'])) {\n\t\t\t$allConfig[$avi.'*and'] = array_filter($allConfig[$avi.'*and'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*and'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*and'], Element::$prefixes[Element::FOR_ANDROID -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*tabl'])) {\n\t\t\t$allConfig[$avi.'*tabl'] = array_filter($allConfig[$avi.'*tabl'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*tabl'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*tabl'], Element::$prefixes[(Element::FOR_LANDSCAPE | Element::FOR_TABLET) -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*andl'])) {\n\t\t\t$allConfig[$avi.'*andl'] = array_filter($allConfig[$avi.'*andl'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*andl'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*andl'], Element::$prefixes[(Element::FOR_LANDSCAPE | Element::FOR_ANDROID) -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*andtab'])) {\n\t\t\t$allConfig[$avi.'*andtab'] = array_filter($allConfig[$avi.'*andtab'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*andtab'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*andtab'], Element::$prefixes[(Element::FOR_TABLET | Element::FOR_ANDROID) -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*andtabl'])) {\n\t\t\t$allConfig[$avi.'*andtabl'] = array_filter($allConfig[$avi.'*andtabl'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*andtabl'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*andtabl'], Element::$prefixes[(Element::FOR_LANDSCAPE | Element::FOR_TABLET | Element::FOR_ANDROID) -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*ff4'])) {\n\t\t\t$allConfig[$avi.'*ff4'] = array_filter($allConfig[$avi.'*ff4'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*ff4'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*ff4'], Element::$prefixes[(Element::FOR_FF4) -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*ff4l'])) {\n\t\t\t$allConfig[$avi.'*ff4l'] = array_filter($allConfig[$avi.'*ff4l'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*ff4l'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*ff4l'], Element::$prefixes[(Element::FOR_FF4 | Element::FOR_LANDSCAPE) -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*ff4pad'])) {\n\t\t\t$allConfig[$avi.'*ff4pad'] = array_filter($allConfig[$avi.'*ff4pad'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*ff4pad'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*ff4pad'], Element::$prefixes[(Element::FOR_FF4 | Element::FOR_TABLET) -1]);\n\t\t}\n\n\t\tif (isset($allConfig[$avi.'*ff4padl'])) {\n\t\t\t$allConfig[$avi.'*ff4padl'] = array_filter($allConfig[$avi.'*ff4padl'], function($v){ return !is_array($v); });\n\t\t\t$this->processAssetsPaths($allConfig[$avi.'*ff4padl'], $this->pathParameters);\n\t\t\t$this->config->addPrefixedProperties($allConfig[$avi.'*ff4padl'], Element::$prefixes[(Element::FOR_FF4 | Element::FOR_TABLET | Element::FOR_LANDSCAPE) -1]);\n\t\t}\n\t}",
"protected function loadConfig() {\n global $config_cascade;\n foreach(array('default','protected') as $type) {\n if(array_key_exists($type,$config_cascade['plugins']))\n $this->plugin_cascade[$type] = $this->checkRequire($config_cascade['plugins'][$type]);\n }\n $local = $config_cascade['plugins']['local'];\n $this->last_local_config_file = array_pop($local);\n $this->plugin_cascade['local'] = $this->checkRequire(array($this->last_local_config_file));\n if(is_array($local)) {\n $this->plugin_cascade['default'] = array_merge($this->plugin_cascade['default'],$this->checkRequire($local));\n }\n $this->tmp_plugins = array_merge($this->plugin_cascade['default'],$this->plugin_cascade['local'],$this->plugin_cascade['protected']);\n }",
"public function configureCurrentBench3();",
"public function generate_config_array()\r\n\t{\r\n\t\t//a class has been setup to drive all common config array generation\r\n\t\t//if there are specific attributes for this type of device that will need to be brought in they should be added to the common\r\n\t\t//result here\r\n\t\t$config \t\t= new Thelist_Multipledevice_config_interfaceconnectionqueues($this->_interface);\r\n\t\t$config_array\t= $config->generate_config_array();;\r\n\t\t\r\n\t\t//so far bairos only does htb queue method, but that cannot be part of the general multidevice configure, so we add it here\r\n\t\tif ($config_array != false) {\r\n\t\t\t\r\n\t\t\tforeach ($config_array as $index => $queue) {\r\n\t\t\t\t$config_array[$index]['configuration']['queue_method'] = 'htb';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $config_array;\r\n\t}",
"private static function loadConfig() \n {\n // Global application configurations\n self::$config = new Data\\StaticData(self::$APP_PATH.\"config/\");\n\n // Configurations\n require_once(self::$APP_PATH.\"config/config.php\");\n\n // Initializers, load all files in initializers directory\n $initializers_path = self::$APP_PATH.\"config/initializers/\"; \n foreach (scandir($initializers_path) as $file) {\n if (preg_match('/^[A-Za-z_\\-.]+\\.php$/', $file)) {\n require_once($initializers_path.$file);\n }\n }\n\n // Database configurations\n require_once(self::$CORE_PATH.\"database.php\");\n }",
"private function loadConfig()\n {\n $this->category->config = [];\n $this->loadMeta('admins', 'array');\n $this->loadMeta('members', 'array');\n $this->loadMeta('template');\n $this->loadMetaCategory();\n }",
"private function _set_assets() {\n /*\n carga de js\n primero guarda en una temporal los js que se setearon desde el controlador\n recorre el archivo de configuracion.\n se los pasamos por _add_asset\n esto para ordenarlos pone primero los del archivo de cunfiguracion\n despues los que se setearon en el controlador.\n\n dependiendo del tipo es donde los buscara.\n completando asi la linea de codigo para el html con su direccion correspondiente\n\n Finalmente los añade al data\n\n $src = base_url().'assets/scripts/';\n\n */\n if (!empty($this->name)) { // si no esta vacia\n $panel = $this->panel == 'b' ? 'admin' : 'front';\n\n $scripts = $this->js; #los que se setean desde el controlador los guardo en otra variable\n $this->js = []; #limpio la variable global\n\n $styles = $this->css;\n $this->css = [];\n\n $configModules = $this->configs_modules;\n $this->configs_modules = [];\n\n # Cargo y uno los elementos de configuracion de los modlos \n # estos se definen el el config/template o dentro del controlador q lo use \n if (isset($this->configs[$panel][$this->name]['config_modules']) && sizeof($this->configs[$panel][$this->name]['config_modules']) > 0) {\n foreach ($this->configs[$panel][$this->name]['config_modules'] as $modules) {\n $this->load_config_modules($modules['value']);\n }\n }\n $this->configs_modules = array_merge_recursive($this->configs_modules, $configModules);\n \n \n if (isset($this->configs[$panel][$this->name]['scripts']) && sizeof($this->configs[$panel][$this->name]['scripts']) > 0) {\n # lee los elementos del archivo de configuracion.\n foreach ($this->configs[$panel][$this->name]['scripts'] as $script) {\n $this->_add_asset(\n $script['type'], $script['value'], isset($script['options']) ? $script['options'] : [], 'script'\n );\n }\n }\n \n # lee los elementos del archivo de configuracion de los MODULOS definidos\n if (isset($this->configs_modules['scripts']) && sizeof($this->configs_modules['scripts']) > 0) {\n\n foreach ($this->configs_modules['scripts'] as $script) {\n $this->_add_asset(\n $script['type'], $script['value'], isset($script['options']) ? $script['options'] : [], 'script'\n );\n }\n }\n\n $this->js = array_merge($this->js, $scripts);\n\n # verificar que no se repita ninguna libreria \n $this->_check_duplicate('scripts');\n\n\n\n if (isset($this->configs[$panel][$this->name]['styles']) && sizeof($this->configs[$panel][$this->name]['styles']) > 0) {\n\n foreach ($this->configs[$panel][$this->name]['styles'] as $style) {\n $this->_add_asset(\n $style['type'], $style['value'], isset($style['options']) ? $style['options'] : [], 'style'\n );\n }\n }\n # lee los elementos del archivo de configuracion de los MODULOS definidos\n if (isset($this->configs_modules['styles']) && sizeof($this->configs_modules['styles']) > 0) {\n\n foreach ($this->configs_modules['styles'] as $style) {\n $this->_add_asset(\n $style['type'], $style['value'], isset($style['options']) ? $style['options'] : [], 'style'\n );\n }\n }\n $this->css = array_merge($this->css, $styles);\n\n # verificar que no se repita ninguna libreria \n $this->_check_duplicate('styles');\n }\n // Lo anterior solo reordena el array pone primero los elementos del archivo \n // de configuracion del template luego los del modulo y al final los que se setean \n // en el controlador \n // que se setearon desde el controlador \n // a continuacion crar las rutas para insertarlos en la vista\n $_css = $_js = '';\n $panel = $this->panel == 'b' ? 'admin/' : '';\n\n if (sizeof($this->js) > 0) {\n foreach ($this->js as $js) {\n $defer = $async = $charset = '';\n if (isset($js['options'])) {\n $defer = isset($js['options']['defer']) ? 'defer' : '';\n $async = isset($js['options']['async']) ? 'async' : '';\n $charset = isset($js['options']['charset']) ? 'charset=\"' . $js['options']['charset'] . '\"' : '';\n }\n $src = base_url() . 'assets/scripts/';\n\n switch ($js['type']) {\n case 'lib':\n $src = base_url() . 'assets/lib/' . $js['value'] . '.js';\n break;\n case 'base':\n $src .= 'base/' . $js['value'] . '.js';\n break;\n case 'template':\n $src .= 'templates/' . $panel . $this->name . '/' . $js['value'] . '.js';\n break;\n case 'view':\n $src .= 'views/' . $js['value'] . '.js';\n break;\n case 'modules':\n $src = base_url() .'assets/modules/' . $js['value'] . '.js';\n break;\n case 'url':\n $src = $js['values'];\n break;\n\n\n default:\n show_error('Error carga type assets');\n //$src = '';\n break;\n }\n $_js .= sprintf('<script type=\"text/javascript\" src=\"%s\" %s %s %s></script>'\n , $src, $charset, $defer, $async\n );\n }\n }\n\n if (sizeof($this->css) > 0) {\n foreach ($this->css as $css) {\n $media = '';\n if (isset($css['options'])) {\n $media = isset($css['options']['media']) ? 'media=\"' . $css['options']['media'] . '\"' : '';\n }\n $href = base_url() . 'assets/styles/';\n\n switch ($css['type']) {\n case 'lib':\n $href = base_url() . 'assets/lib/' . $css['value'] . '.css';\n break;\n case 'base':\n $href .= 'base/' . $css['value'] . '.css';\n break;\n case 'template':\n $href .= 'templates/' . $panel . $this->name . '/' . $css['value'] . '.css';\n break;\n case 'view':\n $href .= 'views/' . $css['value'] . '.css';\n break;\n case 'modules':\n $href = base_url() . 'assets/modules/' . $css['value'] . '.css';\n break;\n case 'url':\n $href = $css['value'];\n break;\n case 'bonus':\n $_css .= $css['value'];\n break;\n\n\n default:\n show_error('Error carga type assets');\n //$href = '';\n break;\n }\n $_css .= sprintf('<link type=\"text/css\" rel=\"stylesheet\" href=\"%s\" %s>'\n , $href, $media\n );\n }\n }\n $this->data['_js'] = $_js;\n $this->data['_css'] = $_css;\n }",
"private function load_config($game) {\n\n\t\t$return = array();\n\t\tif(empty($game)) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$hostgroupConfigObj = new HostgroupConfig($this->server_cfg, $game);\n\t\treturn $hostgroupConfigObj->load_hostgroup_config();\n\t}"
] | [
"0.63943714",
"0.62099266",
"0.5471462",
"0.5264341",
"0.5147551",
"0.5026303",
"0.49037784",
"0.48998582",
"0.4888103",
"0.481513",
"0.46414858",
"0.463603",
"0.46341482",
"0.46339613",
"0.46120524",
"0.45483977",
"0.45441952",
"0.454101",
"0.45354486",
"0.45353922",
"0.45187652",
"0.451231",
"0.45051888",
"0.44655648",
"0.44623107",
"0.4434592",
"0.4414376",
"0.44095582",
"0.43987027",
"0.43868372"
] | 0.70315945 | 0 |
Loads general info about the condition. Don't require special parsing. | private function loadConditionInfo()
{
$this->conditionInfo = [
'id' => $this->rawCondition['id'],
'name' => $this->rawCondition['name'],
'title' => $this->rawCondition['title'],
'opponent' => $this->rawCondition['opponent'],
'random_games' => $this->rawCondition['random_design_chain'],
'random_phases' => $this->rawCondition['random_design_iteration'],
'incentive' => $this->rawCondition['incentive'],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadConditionText()\n {\n // See the comment in the controller. We are injecting the incentive text before further manipulations.\n if ($this->rawCondition['incentive'])\n {\n $this->rawCondition['text_chain'] = str_replace('{{incentive_text}}', $this->rawCondition['incentive_text'], $this->rawCondition['text_chain']);\n }\n else\n {\n $this->rawCondition['text_chain'] = str_replace('{{incentive_text}}', '', $this->rawCondition['text_chain']);\n }\n\n $bias_type = BasicHelper::parseChainLeft($this->rawCondition['text_chain']);\n $text = BasicHelper::parseChainRight($this->rawCondition['text_chain']);\n\n // condition text (value) for each bias type (key)\n $this->conditionText = array_combine(array_values($bias_type), $text);\n\n // Append other text relevant for this condition.\n $this->conditionText['division'] = $this->rawCondition['text_division'];\n $this->conditionText['incentive'] = $this->rawCondition['incentive_text'];\n }",
"public function getCondition();",
"private function loadConditionConfig()\n {\n foreach ($this->designConfig['ordered_phases'] as $game_number => $phases)\n {\n // store the ratios ordered for each game number\n $this->conditionConfig['ordered_ratio'][$game_number] = ceil(($this->biasConfig['ordered_values'][$game_number] / 100) * $phases);\n\n // store the competitive behaviour ordered for each game and for each phase\n $ordered_competitive = array_fill(1, $this->conditionConfig['ordered_ratio'][$game_number], 1);\n $ordered_cooperative = array_fill($this->conditionConfig['ordered_ratio'][$game_number] + 1, $phases - $this->conditionConfig['ordered_ratio'][$game_number], 0);\n\n $this->conditionConfig['ordered_competitive'][$game_number] = $ordered_competitive + $ordered_cooperative;\n }\n }",
"public function get_generalinfo($condition)\n {\n $query_str = \"SELECT * FROM tbl_generalinfo WHERE \" . $condition['search_by'] . \" = '\" . $condition['search'] . \"'\";\n $query = $this->db->query($query_str);\n $result = $query->result_array();\n return $result[0];\n }",
"public function getConditionInfo() : array\n {\n return $this->conditionInfo;\n }",
"abstract public function get_info();",
"private function loadWeatherConditionText(stdClass $_forecastday): string\n\t{\n\t\tif ($this->forecastHour == '00:00') {\n\t\t\treturn $_forecastday->day->condition->text;\n\t\t}\n\n\t\treturn $this->loadWeatherForecastForTargetHour($_forecastday);\n\t}",
"public function getCondition(): string\n {\n }",
"abstract function getinfo();",
"public function conditionalize(&$context) {\n\t\t\tif (empty($context) || !isset($context['datasource'])\n\t\t\t\t|| !isset($context['datasource']->dsParamConditionalizer)\n\t\t\t\t|| empty($context['datasource']->dsParamConditionalizer)\n\t\t\t) return;\n\n\t\t\tif (!class_exists('Conditionalizer')) {\n\t\t\t\trequire_once(EXTENSIONS . '/conditionalizer/lib/class.conditionalizer.php');\n\t\t\t}\n\n\t\t\t$data = $context['datasource']->__processParametersInString($context['datasource']->dsParamConditionalizer, array('env' => Frontend::Page()->Env(), 'param' => Frontend::Page()->Params()));\n\t\t\t$e = Conditionalizer::parse($data);\n\t\t\tif (!empty($e) && !Conditionalizer::evaluate($e)) {\n\t\t\t\t$context['xml'] = new XMLElement($context['datasource']->dsParamROOTELEMENT, '<error>'.__('Condition not met.').'</error>');\n\t\t\t}\n\t\t}",
"protected function prepareGeneralInformation()\n {\n $this->fields['general']['is_anchor'] = isset($this->fields['general']['is_anchor'])\n ? $this->fields['general']['is_anchor']\n : 'No';\n\n $this->fields['general']['include_in_menu'] = isset($this->fields['general']['include_in_menu'])\n ? $this->fields['general']['include_in_menu']\n : 'Yes';\n }",
"private function generateCondition() {\n $this->_arrayvalues[':' . $this->_namefilecondition] = $this->_valuefilecondition;\n }",
"public function show(Condition $condition)\n {\n //\n }",
"static public function getConditions()\n\t{\n\t\treturn array(\n\t\t\tCore::_('Ipaddress_Useragent.condition0'),\n\t\t\tCore::_('Ipaddress_Useragent.condition1'),\n\t\t\tCore::_('Ipaddress_Useragent.condition2'),\n\t\t\tCore::_('Ipaddress_Useragent.condition3'),\n\t\t\tCore::_('Ipaddress_Useragent.condition4')\n\t\t);\n\t}",
"public function conditions();",
"protected function get_condition()\n {\n return $this->get_component()->get_table_condition(get_called_class());\n }",
"public function getConditions();",
"public static function conditional();",
"function getCurrentCondition ($filename = \"../Resources/curCondition.txt\") {\n\n if (($fp = fopen($filename, \"r\")) === FALSE) {\n throw new Exception(\"Couldn't open condition file!\");\n }\n\n $curCondition = fgets($fp,filesize($filename));\n\n fclose($fp);\n return($curCondition);\n}",
"public function getInformation();",
"protected function _LoadDetails()\n\t{\n\t\treturn parent::_LoadDetails();\n\t}",
"public abstract function getInfo();",
"public function getConditionDescription()\n {\n return $this->conditionDescription;\n }",
"public function get_condition()\n {\n return $this->condition;\n }",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\r\n\t\tglobal $tbl_group;\r\n\t\t$tbl_group->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];\r\n\t\t$tbl_group->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\r\n\t}"
] | [
"0.61474425",
"0.55110055",
"0.5332756",
"0.52565783",
"0.5245406",
"0.50718814",
"0.5053522",
"0.5013178",
"0.49981287",
"0.49253932",
"0.49183282",
"0.49057359",
"0.48852372",
"0.48793834",
"0.48339662",
"0.48034376",
"0.4794146",
"0.47260508",
"0.47193155",
"0.47171673",
"0.46993852",
"0.46966803",
"0.46909952",
"0.46857733",
"0.46688122",
"0.46688122",
"0.46688122",
"0.46688122",
"0.46688122",
"0.46659905"
] | 0.79418975 | 0 |
endregion region getters Returns the full design configuration. | public function getDesignConfig() : array
{
return $this->designConfig;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDesign()\n {\n return \\Cloud::app()->getFrontController()->getDesign();\n }",
"public function cfg ( ) { return $this->cfg; }",
"public function get_config() {\n\t\treturn $this->config_final;\n\t}",
"public function getConfig()\n {\n return $this->definition ;\n }",
"public function config(){\r\n\t\treturn $this->_config;\r\n\t}",
"public function getConfig()\r\n {\r\n return $this->_config;\r\n }",
"public function getConfig()\n {\n return $this->_config;\n }",
"public function getConfig(){\n\t\treturn $this->config;\n\t}",
"function config()\n {\n return $this->config_internal;\n }",
"public function getConfig ()\n {\n return $this->_config;\n }",
"public function config()\n {\n return $this->_config;\n }",
"public function config()\n {\n return $this->_config;\n }",
"public function getConfig(){\n return $this->config;\n }",
"public function getFlexibleConfig()\n {\n return $this->flexibleConfig;\n }",
"public function getDesignation()\n {\n return $this->_designation;\n }",
"private function _getConfig() {\n\t\treturn $this->_config;\n\t}",
"public function getDesignation()\r\n {\r\n return $this->designation;\r\n }",
"public function getDesignation()\r\n {\r\n return $this->designation;\r\n }",
"public function getConfig()\n {\n return $this->_config;\n }",
"public function getConfig()\n {\n return $this->_config;\n }",
"public function getConfig()\n\t{\n\t\treturn $this->_config;\n\t}",
"public function getConfig()\n\t{\n\t\treturn $this->_config;\n\t}",
"protected function getConfig() {\n return $this->config;\n }",
"public function config()\n {\n return $this->config;\n }",
"public function config()\n {\n return $this->config;\n }",
"public function getDesignation() {\r\n\t\treturn $this->designation;\r\n\t}",
"public function getDesign()\n\t{\n\t\tif ( !is_array( $this->Design ) )\n\t\t{\n\t\t\t$this->Design = $this->Design ? unserialize( $this->Design ) : array();\n\t\t}\n\t\treturn $this->Design;\n\t}",
"public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}",
"public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}",
"public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}"
] | [
"0.7263712",
"0.6998174",
"0.68708",
"0.68380517",
"0.6827571",
"0.68147886",
"0.68043625",
"0.67920506",
"0.6788728",
"0.6784256",
"0.67658114",
"0.67658114",
"0.6753517",
"0.67420876",
"0.67164737",
"0.6707655",
"0.6704552",
"0.6704552",
"0.6702511",
"0.6702511",
"0.6697734",
"0.6697734",
"0.66894263",
"0.66362447",
"0.66362447",
"0.659609",
"0.6584235",
"0.6577133",
"0.6577133",
"0.6577133"
] | 0.77270776 | 0 |
Returns the full bias configuration. | public function getBiasConfig() : array
{
return $this->biasConfig;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadBiasConfig()\n {\n // bias type (value) for each game (key)\n $ordered_types = BasicHelper::reindexArray(BasicHelper::parseChainLeft($this->rawCondition['design_chain']));\n $unique_types = BasicHelper::parseChainLeft($this->rawCondition['bias_chain']);\n\n\n $unique_values = array_combine(array_values($unique_types), array_values(BasicHelper::parseChainRight($this->rawCondition['bias_chain'])));\n\n\n $temp = [];\n foreach ($ordered_types as $type) {\n $temp[] = $unique_values[$type];\n }\n // percentage of bias (value) for each game (key)\n $ordered_values = BasicHelper::reindexArray($temp);\n unset($temp);\n\n\n $this->biasConfig = [\n 'ordered_types' => $ordered_types,\n 'ordered_values' => $ordered_values,\n 'unique_types' => $unique_types,\n 'unique_values' => $unique_values\n ];\n }",
"public function getFullConfig()\r\n {\r\n $config = $this->config->getAll();\r\n $config['labels'] = $this->getLabels();\r\n $config['capabilities'] = $this->getCapabilities();\r\n $config['rewrite'] = $this->getRewrite();\r\n\r\n return $config;\r\n }",
"public function getConfigBE()\n\t{\n\t\treturn $this->provider->getConfigBE();\n\t}",
"public function getDefaultBoosts()\n {\n return $this->config['boosts'];\n }",
"public function get_config() {\n\t\treturn $this->config_final;\n\t}",
"public function getHeightConfig()\n {\n return $this->_adsHelper->getHeightConfig();\n }",
"public function brainConfig()\n {\n\n return $gateway = new Braintree\\Gateway([\n 'environment' => env('BRAINTREE_ENV'),\n 'merchantId' => env('BRAINTREE_MERCHANT_ID'),\n 'publicKey' => env('BRAINTREE_PUBLIC_KEY'),\n 'privateKey' => env('BRAINTREE_PRIVATE_KEY'),\n ]);\n\n }",
"public function getRawConfig()\n {\n return $this->rawConfig;\n }",
"public function getBlurBaselineConfig()\n {\n return $this->blur_baseline_config;\n }",
"public function getMergedDefaultConfiguration()\n {\n return array_merge(\n $this->basicBlockConfiguration,\n $this->getDefaultConfiguration()\n );\n }",
"public function getPicDefaultB2b()\n {\n return (bool)$this->getConfig('ratepay/detailInstallmentCalculator/defaultB2b', false);\n }",
"public function getConfigTreeBuilder()\n {\n return $this->buildConfiguration();\n }",
"public function getConfigBE()\n\t{\n\t\treturn [];\n\t}",
"public function default()\n\t{\n\t\treturn $this->defaultConfig;\n\t}",
"public function all()\n\t{\n\t\treturn $this->config;\n\t}",
"public function all()\n {\n return $this->config;\n }",
"public function all()\n {\n return $this->config;\n }",
"public function getB()\n {\n return $this->b;\n }",
"public function getOutputConfig()\n {\n return $this->output_config;\n }",
"public function weight()\n {\n return config(sprintf('%s.%s', static::getWeightOptionsKey(), $this->value()));\n }",
"public function cfg ( ) { return $this->cfg; }",
"public function getConfigBoc(): string\n {\n return $this->requireString('config_boc');\n }",
"public function getDefaultConfig()\n\t{\n\t\treturn $this->getConfig('default');\n\t}",
"public function getConfiguration()\n {\n return $this->config;\n }",
"public function getConfiguration()\n {\n return array(\n 'key' \t\t\t=> $this->key,\n 'init_vector' => $this->initVector,\n 'padding' \t\t=> $this->padding,\n 'mode' \t\t\t=> $this->mode,\n 'encryption'\t=> $this->encryption . ' Bit',\n 'block_size'\t=> $this->block_size,\n );\n }",
"function config()\n {\n return $this->config_internal;\n }",
"public static function getall_config() { return self::$config; }",
"public function getConfig()\n {\n return $this->readOneof(1);\n }",
"public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}",
"public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}"
] | [
"0.7304303",
"0.5923877",
"0.5780572",
"0.57684886",
"0.57143235",
"0.5708564",
"0.5706523",
"0.5693343",
"0.5607731",
"0.5580253",
"0.55744636",
"0.5531478",
"0.55204105",
"0.5513657",
"0.5433128",
"0.5422514",
"0.5422514",
"0.53936446",
"0.5379487",
"0.53608805",
"0.5359843",
"0.529706",
"0.5277276",
"0.52426624",
"0.52420837",
"0.5235189",
"0.5229131",
"0.5228792",
"0.52284163",
"0.52284163"
] | 0.82352877 | 0 |
Returns the full condition configuration. | public function getConditionConfig() : array
{
return $this->conditionConfig;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConditionDefinition()\n {\n return $this->conditionDefinition;\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"protected function getCondition()\n {\n return $this->condition;\n }",
"public function getConditionSpec() {\n return $this->conditionSpec;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition() \n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return [];\n }",
"public function get_condition()\n {\n return $this->condition;\n }",
"public function getRootCondition() {\n return $this->rootCondition;\n }",
"public function getFullConfig()\r\n {\r\n $config = $this->config->getAll();\r\n $config['labels'] = $this->getLabels();\r\n $config['capabilities'] = $this->getCapabilities();\r\n $config['rewrite'] = $this->getRewrite();\r\n\r\n return $config;\r\n }",
"public function cfg ( ) { return $this->cfg; }",
"public function getRawCondition() : array\n {\n return $this->rawCondition;\n }",
"protected function get_condition()\n {\n return $this->get_component()->get_table_condition(get_called_class());\n }",
"public function condition()\n {\n return $this->condition;\n }",
"public function getCondition();",
"public function getConditionInfo() : array\n {\n return $this->conditionInfo;\n }",
"public function getDeviceCondition()\n {\n return $this->device_condition;\n }",
"public function getCondicion()\n {\n return $this->condicion;\n }",
"public function getConditionDescription()\n {\n return $this->conditionDescription;\n }",
"public function getConditionEvaluation()\n {\n return $this->condition_evaluation;\n }",
"public function getConditions()\n {\n $value = $this->getData(self::CONDITIONS);\n if (!$value) {\n $value = [];\n }\n return $value;\n }"
] | [
"0.67490095",
"0.6543302",
"0.6543302",
"0.6543302",
"0.6543302",
"0.6543302",
"0.6543302",
"0.6470989",
"0.6465985",
"0.63902396",
"0.63902396",
"0.63902396",
"0.63902396",
"0.63902396",
"0.6376667",
"0.6368673",
"0.6340983",
"0.6315424",
"0.6303097",
"0.62970644",
"0.6284242",
"0.6257885",
"0.6216793",
"0.6191271",
"0.6189561",
"0.6163542",
"0.6146303",
"0.6105169",
"0.6076805",
"0.6063387"
] | 0.7740751 | 0 |
Returns the full raw condition data (as stored in the database). | public function getRawCondition() : array
{
return $this->rawCondition;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConditions()\n {\n $value = $this->getData(self::CONDITIONS);\n if (!$value) {\n $value = [];\n }\n return $value;\n }",
"protected function get_condition()\n {\n return $this->get_component()->get_table_condition(get_called_class());\n }",
"public function getConditionInfo() : array\n {\n return $this->conditionInfo;\n }",
"public function getConditions()\n {\n return $this->conditions->toArray();\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"protected function getCondition()\n {\n return $this->condition;\n }",
"public function getRawQuery()\n\t{\n\t $query = array();\n\n\t if (count($this->criteria) > 0) {\n foreach ($this->criteria as $propertyName => $criteria) {\n $constraints = $criteria->getConstraints();\n if (isset($constraints) && null !== $criteria->getMode()) {\n $query[$propertyName] = $constraints;\n }\n }\n\t }\n\t \n if (count($this->operator) > 0) {\n foreach ($this->operator as $operatorName => $operator) {\n $query[$operatorName] = $operator;\n }\n }\n\n\t return $query;\n\t}",
"public function get_condition()\n {\n return $this->condition;\n }",
"public function getCondition() \n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return [];\n }",
"public function condition()\n {\n return $this->condition;\n }",
"public function conditions() {\n if (empty($this->info)) {\n $this->refreshInfo();\n }\n return !empty($this->info['conditions']) ? $this->info['conditions'] : array();\n }",
"public function getConditionText() : array\n {\n return $this->conditionText;\n }",
"public function getRawSql() \n {\n return $this->sql;\n }",
"protected function _getCondition()\n {\n $conditions = array();\n $conditions[] = \\Zend_Db_Table::getDefaultAdapter()->quoteInto($this->_identityColumn . ' = ?', $this->_identityValue);\n\n if ($this->_objectPath) {\n $conditions[] = \\Zend_Db_Table::getDefaultAdapter()->quoteInto('o_path = ?', $this->_objectPath);\n }\n\n return implode(' AND ', $conditions);\n }",
"public function getConditions() {\n return $this->conditions;\n }",
"public function getConditions() {\n return $this->conditions;\n }",
"public function prepareConditionSql()\n {\n $alias = 'cpf';\n $attribute = $this->getAttribute();\n $value = $this->getValueParsed();\n $operator = $this->correctOperator($this->getOperator(), $this->getInputType());\n if ($attribute == 'category_ids') {\n $alias = 'ccp';\n $attribute = 'category_id';\n $value = $this->bindArrayOfIds($value);\n }\n\n /** @var $ruleResource Mage_Rule_Model_Resource_Rule_Condition_SqlBuilder */\n $ruleResource = $this->getRuleResourceHelper();\n\n return $ruleResource->getOperatorCondition($alias . '.' . $attribute, $operator, $value);\n }",
"public function getConditions()\n {\n return $this->conditions;\n }",
"public function getConditions()\n {\n return $this->conditions;\n }"
] | [
"0.65193635",
"0.64048254",
"0.6364201",
"0.6342089",
"0.6300054",
"0.6300054",
"0.6300054",
"0.6300054",
"0.6300054",
"0.6300054",
"0.61655277",
"0.6157294",
"0.60680586",
"0.606657",
"0.60561246",
"0.60561246",
"0.60561246",
"0.60561246",
"0.60561246",
"0.60320145",
"0.5987842",
"0.5975201",
"0.59741414",
"0.59314096",
"0.5914377",
"0.58943486",
"0.58943486",
"0.5873961",
"0.58733374",
"0.58733374"
] | 0.76039994 | 0 |
Returns the full condition info. | public function getConditionInfo() : array
{
return $this->conditionInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConditionDescription()\n {\n return $this->conditionDescription;\n }",
"protected function get_condition()\n {\n return $this->get_component()->get_table_condition(get_called_class());\n }",
"private function loadConditionInfo()\n {\n $this->conditionInfo = [\n 'id' => $this->rawCondition['id'],\n 'name' => $this->rawCondition['name'],\n 'title' => $this->rawCondition['title'],\n 'opponent' => $this->rawCondition['opponent'],\n 'random_games' => $this->rawCondition['random_design_chain'],\n 'random_phases' => $this->rawCondition['random_design_iteration'],\n 'incentive' => $this->rawCondition['incentive'],\n ];\n }",
"public function getCondition();",
"public function get_condition()\n {\n return $this->condition;\n }",
"public function conditions() {\n if (empty($this->info)) {\n $this->refreshInfo();\n }\n return !empty($this->info['conditions']) ? $this->info['conditions'] : array();\n }",
"public function getCondition()\n {\n return [];\n }",
"protected function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition() \n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getConditionSpec() {\n return $this->conditionSpec;\n }",
"public function getRawCondition() : array\n {\n return $this->rawCondition;\n }",
"public function getConditionText() : array\n {\n return $this->conditionText;\n }",
"public function condition()\n {\n return $this->condition;\n }",
"public function getConditionNote()\n {\n return $this->_fields['ConditionNote']['FieldValue'];\n }",
"public function getCondition(): string\n {\n }",
"public function showcurrentconditions() {\n echo \"<pre>\",print_r($this->conditions),\"</pre>\";\n }",
"public function getConditionConfig() : array\n {\n return $this->conditionConfig;\n }",
"public function getConditionDisplayName()\n {\n return $this->conditionDisplayName;\n }",
"public function getDeviceCondition()\n {\n return $this->device_condition;\n }"
] | [
"0.7024278",
"0.6973748",
"0.69158876",
"0.68496186",
"0.68073404",
"0.6799137",
"0.67756855",
"0.6710965",
"0.6688677",
"0.66627127",
"0.66627127",
"0.66627127",
"0.66627127",
"0.66627127",
"0.66627127",
"0.6625088",
"0.6625088",
"0.6625088",
"0.6625088",
"0.6625088",
"0.66076976",
"0.6603866",
"0.6593364",
"0.6584914",
"0.6559166",
"0.65106964",
"0.64492816",
"0.64485353",
"0.63501316",
"0.62563086"
] | 0.8143295 | 0 |
Returns the full condition text. | public function getConditionText() : array
{
return $this->conditionText;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConditionString()\n {\n return 'true';\n }",
"public function getConditionDescription()\n {\n return $this->conditionDescription;\n }",
"public function getConditionDisplayName()\n {\n return $this->conditionDisplayName;\n }",
"public function getCondition(): string\n {\n }",
"public function __toString()\n {\n $string = '( ';\n\n foreach ( $this->conditions as $condition )\n {\n if ( $string != '( ' )\n {\n $string .= ' ' . $this->concatenation . ' ';\n }\n\n $string .= $condition;\n }\n\n return $string . ' )';\n }",
"public function getConditionNote()\n {\n return $this->_fields['ConditionNote']['FieldValue'];\n }",
"public function get_condition()\n {\n return $this->condition;\n }",
"public function getWhereCondition(): string\n {\n return $this->generateWhereCondition();\n }",
"protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }",
"function renderWhere() {\n $cond = $this->render();\n return empty( $cond ) ? '' : \"WHERE $cond\";\n }",
"protected function _getCondition()\n {\n $conditions = array();\n $conditions[] = \\Zend_Db_Table::getDefaultAdapter()->quoteInto($this->_identityColumn . ' = ?', $this->_identityValue);\n\n if ($this->_objectPath) {\n $conditions[] = \\Zend_Db_Table::getDefaultAdapter()->quoteInto('o_path = ?', $this->_objectPath);\n }\n\n return implode(' AND ', $conditions);\n }",
"public function renderWhere()\n {\n $cond = $this->render();\n return empty($cond) ? '' : \"WHERE $cond\";\n }",
"public function condition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition(): ?FHIRString\n\t{\n\t\treturn $this->condition;\n\t}",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition() \n {\n return $this->condition;\n }",
"protected function getCondition()\n {\n return $this->condition;\n }",
"private function loadWeatherConditionText(stdClass $_forecastday): string\n\t{\n\t\tif ($this->forecastHour == '00:00') {\n\t\t\treturn $_forecastday->day->condition->text;\n\t\t}\n\n\t\treturn $this->loadWeatherForecastForTargetHour($_forecastday);\n\t}",
"public function get_where_clause() {\n\t\treturn ' 1 = 0 ';\n\t}",
"public function getWhereSQL()\n {\n $operation = trim($this->field_row->operation);\n \n if (strlen($operation) == 0) {\n return \"\";\n }\n \n $crit = $this->field_row->criteria;\n if ($crit == \"[ME]\")\n {\n $crit = Auth::user()->id;\n }\n\n if ($this->field_row->sys_name == \"bool\") {\n $crit = ($this->field_row->criteria == \"'\" . trans('fields.yes') . \"'\") ? 1 : 0;\n } \n \n return \" AND \" . $this->field_where_name . \" \" . $operation . \" \" . $crit;\n \n }"
] | [
"0.7515359",
"0.72595835",
"0.7166028",
"0.68525803",
"0.6816665",
"0.6807598",
"0.6723126",
"0.6711039",
"0.6676774",
"0.66293615",
"0.66284704",
"0.66094315",
"0.6567569",
"0.6439739",
"0.6439739",
"0.6439739",
"0.6439739",
"0.6439739",
"0.6439739",
"0.6435461",
"0.6434473",
"0.6434473",
"0.6434473",
"0.6434473",
"0.6434473",
"0.6424823",
"0.6420964",
"0.64176834",
"0.6374741",
"0.63562775"
] | 0.75026906 | 1 |
Responds when a $ckeditor_comment is inserted. This hook is invoked after the $ckeditor_comment is inserted into the database. | function hook_ckeditor_comment_insert(CKEditorComment $ckeditor_comment) {
db_insert('mytable')
->fields(array(
'id' => entity_id('ckeditor_comment', $ckeditor_comment),
'extra' => print_r($ckeditor_comment, TRUE),
))
->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fireNewCommentEvent()\n {\n DomainEventManager::getInstance()->dispatchEvent(DomainEventManager::EVENT_NEWCOMMENT, [ 'urlComment' => $this ]);\n }",
"public function processComment()\n {\n if (Tools::isSubmit('simplecomments_submit_comment')) {\n $insert = array(\n 'id_product' => (int)Tools::getValue('id_product'),\n 'firstname' => pSQL(Tools::getValue('firstname')),\n 'lastname' => pSQL(Tools::getValue('lastname')),\n 'email' => pSQL(Tools::getValue('email')),\n 'grade' => (int)Tools::getValue('grade'),\n 'comment' => pSQL(Tools::getValue('comment')),\n 'date_add' => date('Y-m-d H:i:s'),\n );\n Db::getInstance()->insert('simplecomments', $insert);\n $this->context->smarty->assign('new_comment_posted', 'true');\n }\n }",
"function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {\n $ckeditor_comment->name = 'foo';\n}",
"function hook_ckeditor_comment_type_insert(CKEditorCommentType $ckeditor_comment_type) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment_type', $ckeditor_comment_type),\n 'extra' => print_r($ckeditor_comment_type, TRUE),\n ))\n ->execute();\n}",
"public function action_comment_insert_after ($comment) {\n if (($comment->type != Comment::COMMENT) \n || ($comment->status == Comment::STATUS_SPAM)) {\n return;\n }\n\n $post = Post::get (array ('id' => $comment->post_id));\n $author = User::get_by_id ($post->user_id);\n\n $c = $comment;\n $sent = array ();\n $sent[] = $author->email;\n $sent[] = $comment->email;\n\n while (isset ($c->info->comment_parent)) {\n $cc = Comment::get ($c->info->comment_parent);\n\n if (isset ($cc->info->email_notify) && $cc->info->email_notify == 1) {\n if (!in_array ($cc->email, $sent)) {\n $sent[] = $cc->email;\n $this->mail_notify ($cc->email, $cc, $comment);\n }\n }\n\n $c = $cc;\n }\n }",
"public function post_comment()\n\t{\n\t\t$this->get_comment( true );\n\t}",
"function mzz_comment_inserted($comment_id, $comment_object) {\n if ($comment_object->comment_type == 'collabpress') {\n \n //the comment type was seen to be collabpress. It was already inserted into the database. Now we go back into the database and update that comment's approved status to 0 (pending)\n $mzzcommentarr = array();\n\t\t$mzzcommentarr['comment_ID'] = $comment_id;\n\t\t$mzzcommentarr['comment_approved'] = 0;\n\t\twp_update_comment( $mzzcommentarr );\n\n }\n}",
"public function p_comment() {\n\t\t\t\t\t$_POST['user_id'] = $this->user->user_id;\n\t\n\t\t\t\t\t# Unix timestamp of when this comment was created / modified\n\t\t\t\t\t$_POST['created'] = Time::now();\n\t\t\t\t\t$_POST['modified'] = Time::now();\n\t\n\t\t\t\t\t# Insert to database\n\t\t\t\t\tDB::instance(DB_NAME)->insert('comments', $_POST);\n\t\n\t\t\t\t\t# Redirect after insert\n\t\t\t\t\tRouter::redirect(\"/posts\");\n\t\n\t\t\t}",
"public function insertComment($newHandler,$cid,$myComment,$commenter)\n\t{\n\t\tmysqli_query($newHandler,\"INSERT INTO `scattr_user_comments` (`CID`,`Comment`,`Commenter`) VALUES ('$cid','$myComment','$commenter');\");\n\t}",
"public function beforeInsertComment($data)\n\t{\n\t $node = $data['_node'];\n\t \t \n $data['node'] = array(\n 'id'\t=>\t$data['nid'],\n\t\t);\n \n\t\t$data['status'] = 'queued';\n \n if (isset($node['name']) && !empty($node['name']))\n $data['node']['name']\t=\t$node['name'];\n else if (isset($node['content']))\n $data['node']['name']\t= word_breadcumb($node['content'], CACHED_POST_TITLE_WORD_LENGTH);\n\t \n if(isset($data['attachments']) && (is_null($data['attachments']) || $data['attachments'] == ''))\n \tunset($data['attachments']);\n \n\t\treturn array('success' => true, 'result' => $data);\n\t}",
"function ajax_insert_comment( ) {\n\t\tglobal $current_user, $user_ID, $wpdb;\n\n\t\t// Verify nonce\n\t\tif ( !wp_verify_nonce( $_POST['_nonce'], 'comment') )\n\t\t\tdie( __( \"Nonce check failed. Please ensure you're supposed to be adding editorial comments.\", 'edit-flow' ) );\n\n\t\t// Get user info\n \twp_get_current_user();\n\n \t// Set up comment data\n\t\t$post_id = absint( $_POST['post_id'] );\n\t\t$parent = absint( $_POST['parent'] );\n\n \t// Only allow the comment if user can edit post\n \t// @TODO: allow contributers to add comments as well (?)\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\tdie( __('Sorry, you don\\'t have the privileges to add editorial comments. Please talk to your Administrator.', 'edit-flow' ) );\n\n\t\t// Verify that comment was actually entered\n\t\t$comment_content = trim($_POST['content']);\n\t\tif( !$comment_content )\n\t\t\tdie( __( \"Please enter a comment.\", 'edit-flow' ) );\n\n\t\t// Check that we have a post_id and user logged in\n\t\tif( $post_id && $current_user ) {\n\n\t\t\t// set current time\n\t\t\t$time = current_time('mysql', $gmt = 0);\n\n\t\t\t// Set comment data\n\t\t\t$data = array(\n\t\t\t 'comment_post_ID' => (int) $post_id,\n\t\t\t 'comment_author' => esc_sql($current_user->display_name),\n\t\t\t 'comment_author_email' => esc_sql($current_user->user_email),\n\t\t\t 'comment_author_url' => esc_sql($current_user->user_url),\n\t\t\t 'comment_content' => wp_kses($comment_content, array('a' => array('href' => array(),'title' => array()),'b' => array(),'i' => array(),'strong' => array(),'em' => array(),'u' => array(),'del' => array(), 'blockquote' => array(), 'sub' => array(), 'sup' => array() )),\n\t\t\t 'comment_type' => self::comment_type,\n\t\t\t 'comment_parent' => (int) $parent,\n\t\t\t 'user_id' => (int) $user_ID,\n\t\t\t 'comment_author_IP' => esc_sql($_SERVER['REMOTE_ADDR']),\n\t\t\t 'comment_agent' => esc_sql($_SERVER['HTTP_USER_AGENT']),\n\t\t\t 'comment_date' => $time,\n\t\t\t 'comment_date_gmt' => $time,\n\t\t\t\t// Set to -1?\n\t\t\t 'comment_approved' => self::comment_type,\n\t\t\t);\n\n\t\t\t$data = apply_filters( 'ef_pre_insert_editorial_comment', $data );\n\n\t\t\t// Insert Comment\n\t\t\t$comment_id = wp_insert_comment($data);\n\t\t\t$comment = get_comment($comment_id);\n\n\t\t\t// Save the list of notified users/usergroups.\n\t\t\tif ( $this->module_enabled( 'notifications' ) && apply_filters( 'ef_editorial_comments_show_notified_users', true ) ) {\n\t\t\t\t$notification = isset( $_POST['notification'] ) ? sanitize_text_field( $_POST['notification'] ) : '';\n\n\t\t\t\tif ( ! empty( $notification ) && __( 'No one will be notified.', 'edit-flow' ) !== $notification ) {\n\t\t\t\t\tadd_comment_meta( $comment_id, 'notification_list', $notification );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Register actions -- will be used to set up notifications and other modules can hook into this\n\t\t\tif ( $comment_id )\n\t\t\t\tdo_action( 'ef_post_insert_editorial_comment', $comment );\n\n\t\t\t// Prepare response\n\t\t\t$response = new WP_Ajax_Response();\n\n\t\t\tob_start();\n\t\t\t\t$this->the_comment( $comment, '', '' );\n\t\t\t\t$comment_list_item = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t$response->add( array(\n\t\t\t\t'what' => 'comment',\n\t\t\t\t'id' => $comment_id,\n\t\t\t\t'data' => $comment_list_item,\n\t\t\t\t'action' => ($parent) ? 'reply' : 'new'\n\t\t\t));\n\n\t\t\t$response->send();\n\n\t\t} else {\n\t\t\tdie( __('There was a problem of some sort. Try again or contact your administrator.', 'edit-flow') );\n\t\t}\n\t}",
"public function imported_comment() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'comments',\n\t\t\t'delta' => 1,\n\t\t));\n\t}",
"public function addComment(){\n\n \t$this->autoRender = false;\n\n /**\n * variable que contiene los datos que vienen por el método post\n * @var Array\n */\n \t$data = $this->request->data; \n\n /**\n * Comentario\n * @var String\n */\n \t$comment = htmlentities( $data['comment'] );\n \t\n /**\n * Identificador del post\n * @var Int\n */\n $postId = $data['postId'];\n\n /**\n * Identificador del usuario\n * @var [type]\n */\n \t$userId = $this->Auth->user('id');\n\n /**\n * Creación de una nueva entidad de tipo comentario\n */\n \t$this->Coment->Create();\n\n\n /**\n * Guardado del nuevo comentario\n */\n \tif ($this->Coment->save(Array('comment'=>$comment, 'users_id'=>$userId))) {\n\n /**\n * Identificador del nuevo comentario\n * @var Int\n */\n $commentId = $this->Coment->id;\n\n /**\n * guardamos su relación con el post\n */\n if($this->makePostRelation($postId,$commentId)){\n\n /**\n * Obtenemos la información del post\n * @var [type]\n */\n $comment = $this->Coment->find('first',Array('conditions'=>Array('Coment.id'=>$commentId)));\n\n /**\n * Guardamos los recursos usando el componente ResourceManager y lo configuramos\n */\n \n $this->ResourceManager->saveResources($userId, 'post_comment', 'attachment', $commentId);\n\n /**\n * Variable que contiene el numero de comentarios el cual se obtiene de la función getNumberOfCommentsFromPost\n * @var Int\n */\n $numberOfCommentsFromPost = $this->getNumberOfCommentsFromPost($comment['PostComment'][0]['post_id']);\n\n /**\n * Obtenemos la información del post\n * @var [type]\n */\n $comment = $this->Coment->find('first',Array('conditions'=>Array('Coment.id'=>$commentId)));\n\n /**\n * escribimos el String tipo Json\n */\n echo json_encode(Array('success'=>true,'Comment'=>$comment,'numberComments'=> $numberOfCommentsFromPost));\n\n } else {\n \n /**\n * escribimos el estado sin éxito\n */\n echo json_encode(Array('success'=>false));\n } \t\t\t\n\n }else{\n\n /**\n * escribimos el estado sin éxito\n */\n echo json_encode(Array('success'=>false));\n }\n\n }",
"function insert_comment( $comment ) {\n\t\t\tif ( ! $this->comment_exists( $comment ) ) {\n\t\t\t\tunset( $comment['comment_id'] );\n\t\n\t\t\t\t$comment = wp_filter_comment( $comment );\n\t\t\t\t$this->inserted_comments[ $comment['jskit_guid'] ] = wp_insert_comment( $comment );\n\t\n\t\t\t\tupdate_comment_meta( $this->inserted_comments[ $comment['jskit_guid'] ], 'jskit_guid' , $comment['jskit_guid'], TRUE );\n\t\n\t\t\t\t$this->post_ids_processed[ $comment['comment_post_ID'] ]++;\n\t\t\t\t$this->num_comments++;\n\t\n\t\t\t\techo '<li>'. sprintf( __( 'Imported comment by %s on %s.', 'echo-importer') , esc_html( stripslashes( $comment['comment_author'] ) ) , get_the_title( $comment['comment_post_ID'] ) ) . \"</li>\\n\";\n\t\t\t} else {\n\t\t\t\t$this->num_duplicates++;\n\t\t\t\techo '<li>' . __( 'Skipped duplicate comment.', 'echo-importer' ) . \"</li>\\n\";\n\t\t\t}\n\t\t}",
"public function comment()\n {\n $idBillet = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $contenu = $this->request->getParameter(\"contenu\");\n if (isset($author) && isset($contenu) && (!empty($author) && !empty($contenu))) {\n\n\n $this->comment->addComment($author, $contenu, $idBillet);\n $this->request->getSession()->setFlash('Commentaire bien ajouté');\n // Exécution de l'action par défaut pour réafficher la liste des billets\n $this->executeAction(\"index\");\n } else {\n $this->rediriger(\"billet\", \"index\", $idBillet);\n $this->request->getSession()->setFlash('Tous les champs sont obligatoires');\n }\n }",
"protected function afterSave()\n {\n // flush the cache\n $this->flushCache();\n\n $activity = Activity::CreateForContent($this);\n $activity->type = \"CommentCreated\";\n $activity->module = \"comment\";\n $activity->save();\n $activity->fire();\n\n // Handle mentioned users\n // Execute before NewCommentNotification to avoid double notification when mentioned.\n UserMentioning::parse($this, $this->message);\n\n if ($this->isNewRecord) {\n // Send Notifications\n NewCommentNotification::fire($this);\n }\n \n\n return parent::afterSave();\n }",
"public function created(Comment $comment)\n {\n $publication = $comment->publication()->first();\n if($publication && $user = $publication->user()->first()){\n $user->notify(new NewCommentNotification($publication));\n }\n }",
"function hook_ckeditor_comment_update(CKEditorComment $ckeditor_comment) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment, TRUE)))\n ->condition('id', entity_id('ckeditor_comment', $ckeditor_comment))\n ->execute();\n}",
"function hook_ckeditor_comment_type_presave(CKEditorCommentType $ckeditor_comment_type) {\n $ckeditor_comment_type->name = 'foo';\n}",
"public function addComment_ajax() {\n $validator = new Validator();\n $validator->addRule(new required(Input::post('comment'), 'comment'));\n $this->messageHelper->pushError($validator->run());\n $result['errors'] = '';\n if ($this->messageHelper->hasErrors()) {\n $result['errors'] = $this->messageHelper->showMessages(FALSE);\n } else {\n $content = new textcontent();\n $content->ownerid = $this->user->userid;\n $content->content_data = Input::post('comment');\n $content->parentid = Input::post('parentID');\n $content->x = abs(Input::post('hiveLeft')) + self::VIEWPORT_WIDTH / 2;\n $content->y = abs(Input::post('hiveTop')) + self::VIEWPORT_HEIGHT / 2;\n try {\n $content->insertContent();\n $alert = new newcommentalert();\n $alert->sendAlert($content);\n } catch (Exception $e) {\n $result['errors'] = $e->getMessage();\n }\n }\n echo json_encode($result);\n }",
"function add_comment($comment_info, EventDispatcher $EventDispatcher)\n{\n\t// insert the comment into the database\n\t$sql = sprintf('INSERT INTO comments SET created_by = %d, comment = %s, created_ts = %s',\n\t\t\t$comment_info['created_by'],\n\t\t\t'\"' . mysql_real_escape_string($comment_info['comment']) . '\"',\n\t\t\t'\"' . time() . '\"');\n\n\t// myqsl_query($sql);\n\n\t// notify any event listeners of onCommentAdded\n\t$EventDispatcher->onCommentAdded->notify($comment_info);\n}",
"public function addComment()\n {\n $error = '';\n $msg = '';\n $comment = '';\n \n $userId = $this->Auth->User('id');\n $this->autoRender = false;\n \n if (!empty($userId))\n {\n if ($this->request->is('post'))\n {\n $this->Comment->create();\n $data = $this->request->data;\n $data['Comment']['user_id'] = $userId;\n if ($this->Comment->save($data))\n {\n $comment = $this->Comment->read(array(\n 'Comment.description', \n 'Comment.created', \n 'User.name'\n ), $this->Comment->id);\n \n $msg = __('The Comment has been saved');\n }\n else\n {\n $msg = __('The Comment could not be saved. Please, try again.');\n }\n }\n }\n else\n {\n $error = __('Please login');\n }\n \n $data = array(\n 'error' => $error, \n 'msg' => $msg, \n 'data' => $comment\n );\n \n echo json_encode($data);\n exit();\n }",
"public function comment_create(){\n\t\ttry {\n\t\t\t$comment_id = CA_Social::createComment($this->self['id'], $this->input->post('post_id'), $this->input->post('message'));\n\t\t\t$record = CA_Social::getComment($comment_id);\n\t\t\t$wall_post = CA_Social::getPost($this->input->post('post_id'),0,FALSE);\n\t\t\t\n\t\t\tif($wall_post['user_id'] != $this->self['id']){\n\t\t\t\t#notification\n\t\t\t\t$this->load->library('notification');\n\t\t\t\t$res = $this->notification->commented_on_post($wall_post['user_id'],$comment_id);\t\n\t\t\t\n\t\t\t}else if($wall_post['target_id'] != 0 & $wall_post['target_id'] != $this->self['id']){\n\t\t\t\t#notification\n\t\t\t\t$this->load->library('notification');\n\t\t\t\t$res = $this->notification->commented_on_post_on_wall($wall_post['target_id'],$comment_id);\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => TRUE,\n\t\t\t\t'comment_record' => $record,\n\t\t\t));\n\t\t}catch(Exception $e){\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => FALSE,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t));\n\t\t}\n\t}",
"function add_comment($tombid) {\r\n $this->present($tombid);\r\n }",
"public function action_notice_comment()\r\n {\r\n $params = Input::get();\r\n\r\n $notice = Model_V3_Notice::getInstance();\r\n $notice->pushComment($params);\r\n }",
"public function postComments(): void\n\t{\n\t\tforeach ($this->comments as $comment)\n\t\t{\n\t\t\t$auxData = $comment->getData();\n\n\t\t\t$hasLiveData = false;\n\t\t\tif (is_array($auxData))\n\t\t\t{\n\t\t\t\tforeach ($auxData as $value)\n\t\t\t\t{\n\t\t\t\t\tif (!is_array($value))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($value as $commentData)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!is_array($commentData)\n\t\t\t\t\t\t\t|| !is_array($commentData[1])\n\t\t\t\t\t\t\t|| empty($commentData[1]['LIVE_DATA'])\n\t\t\t\t\t\t\t|| !is_array($commentData[1]['LIVE_DATA'])\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$hasLiveData = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($hasLiveData)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** @var Comment $comment */\n\t\t\tForum\\Task\\Comment::add($this->taskId, [\n\t\t\t\t'AUTHOR_ID' => $comment->getAuthorId(),\n\t\t\t\t'POST_MESSAGE' => $comment->getText(),\n\t\t\t\t'UF_TASK_COMMENT_TYPE' => $comment->getType(),\n\t\t\t\t'AUX' => 'Y',\n\t\t\t\t'AUX_DATA' => $auxData,\n\t\t\t\t'AUX_LIVE_PARAMS' => ($hasLiveData ? [ 'JSON' => Main\\Web\\Json::encode($auxData) ] : []),\n\t\t\t]);\n\t\t}\n\t}",
"protected function createComment()\n {\n $formMessage = null;\n $errorList = null;\n $formHasErrors = false;\n\n // Create new comment object and associate with the desired object\n $comment = $this->getInitialisedComment();\n\n // Bind the request to the comment form\n $form = $this->get('bardiscms_comment.comment.form');\n $formHandler = $this->get('bardiscms_comment.comment.form.handler');\n\n $process = $formHandler->process($comment);\n\n // Validate the data and get errors if any\n if ($process) {\n // Commend was saved, Clear the form data object\n $comment = new Comment();\n\n $formMessage = $this->container->get('translator')->trans('comment.form.response.success', array(), 'BardisCMSCommentBundle');\n $errorList = array();\n $formHasErrors = false;\n } else {\n $formMessage = $this->container->get('translator')->trans('comment.form.response.error', array(), 'BardisCMSCommentBundle');\n $errorList = $this->get('bardiscms_page.services.helpers')->getFormErrorMessages($form);\n $formHasErrors = true;\n }\n\n // If the request was Ajax based\n if ($this->isAjaxRequest) {\n if ($process) {\n return $this->onAjaxSuccess($process);\n }\n\n return $this->onAjaxError($formHandler);\n }\n\n switch ($this->commentType) {\n case Comment::TYPE_BLOG:\n // Retrieving the comments the view\n $postComments = $this->getBlogPostComments();\n\n // Return the response as the blog post with form data\n $response = $this->render('BlogBundle:Default:page.html.twig', array(\n 'page' => $this->associated_object,\n 'form' => $form->createView(),\n 'ajaxform' => $this->isAjaxRequest,\n 'comments' => $postComments,\n 'comment' => $comment,\n 'formMessage' => $formMessage,\n 'errorList' => $errorList,\n 'formHasErrors' => $formHasErrors,\n 'logged_username' => $this->userName,\n 'mobile' => $this->serveMobile,\n ));\n\n return $response;\n break;\n\n default:\n return $this->get('bardiscms_page.services.show_error_page')->errorPageAction(Page::ERROR_405);\n }\n }",
"function newComment()\n {\n if (isset($_POST['body']) && isset($_POST['publication'])) {\n\n try {\n $comment = new Comment();\n $date = new DateTime();\n $comment->initializeData(0, $this->auth->retrieveUser()->id, $_POST['publication'], $_POST['body'], $date->format('Y-m-d H:i:s'));\n\n $this->commentRepo->Create($comment);\n\n $this->render();\n } catch (\\Throwable $th) {\n $this->view->newPublicationErr = \"There was an error trying to create the comment, try later...\";\n var_dump($th);\n }\n } else {\n var_dump($_POST);\n }\n }",
"public function callbackSubmit()\n {\n // Get values from the submitted form\n $heading = $this->form->value(\"heading\");\n $text = $this->form->value(\"text\");\n $tags = $this->form->value(\"tags\");\n\n $this->comment->setDb($this->di->get(\"db\"));\n $this->comment->heading = $heading;\n $this->comment->text = $text;\n $this->comment->tags = $tags;\n $this->comment->updated = date(\"Y-m-d H:i:s\");\n $this->comment->save();\n\n $this->form->addOutput(\"Comment was updated\");\n\n return true;\n }",
"public function setC(){\r\n\r\n if (isset($_POST['comment']) && $this->e->get('uid')) {\r\n\r\n $this->v->required($_POST['comment'], 'comment tidak boleh kosong');\r\n $this->v->regex($_POST['comment'], '/^(.|\\n){4,400}$/', # nanti dihapus\r\n '4-400 any dan spasi');\r\n\r\n if(!sizeof($this->v->errors)) \r\n {\r\n # CHECK POST IS HUMAN\r\n if ($this->f->checkHumanPost(3)) {\r\n\r\n # RENDER COMMENT\r\n $r = $this->__commentRender($_POST['comment']);\r\n\r\n # SETTING UP\r\n $p['comment'] = $r['text'];\r\n\r\n # START PLUGIN\r\n $m = new Engine\\Vendors\\Stackexchangeinc\\wmd\\ElephantMarkdown;\r\n $vendorHTMLpurifier = new Engine\\Vendors\\HTMLpurifier\\HTMLpurifier;\r\n $HTMLpurifierConfig = HTMLPurifier_Config::createDefault();\r\n $HTMLpurifierConfig->set('HTML.SafeObject', \"1\");\r\n $HTMLpurifierConfig->set('Output.FlashCompat', \"1\");\r\n $HTMLpurifierConfig->set('Filter.YouTube', \"1\");\r\n $purifier = new HTMLPurifier($HTMLpurifierConfig);\r\n $data['comment_html'] = $purifier->purify($m->parse($p['comment']));\r\n # END PLUGIN\r\n\r\n $data['comment_UID'] = $this->e->get('uid');\r\n $data['comment_PID'] = $_POST['id']; \r\n $time = new DateTime ( NULL, new DateTimeZone ( 'Asia/Jakarta' ) );\r\n $data['time_create'] = $time->format('Y-m-d H:i:s');\r\n $m = new Apps\\Netcoid\\Models\\Mentions;\r\n\r\n # SET COMMENT\r\n $c = new Apps\\Netcoid\\Models\\Comments;\r\n $p = new Apps\\Netcoid\\Models\\Posts;\r\n\r\n $c->set($data);\r\n \r\n # TAMBAH SATU REPLY\r\n $p->addReply1($data['comment_PID']);\r\n\r\n # SET MENTION IF THERE IS SOME USERNAME IN COMMENT\r\n if (!empty($r['usernames'])) {\r\n $m->set($c->getLastId(), $r['usernames']);\r\n }\r\n $this->h->setMessage('Comment Posted'); \r\n header('Location: /post?id='.$_POST['id'] );\r\n } \r\n }\r\n\r\n if(sizeof($this->v->errors)) \r\n {\r\n $this->h->setError($this->v->errors[0]); \r\n header('Location: /post?id='.$_POST['id'] );\r\n }\r\n \r\n } else {\r\n die('[email protected]');\r\n }\r\n }"
] | [
"0.6682939",
"0.6579074",
"0.65741515",
"0.65394974",
"0.6464842",
"0.64009905",
"0.6391506",
"0.63332987",
"0.62715137",
"0.6243715",
"0.6190279",
"0.61742425",
"0.6152235",
"0.6073012",
"0.60549283",
"0.6052238",
"0.6047578",
"0.6046202",
"0.6038841",
"0.6013168",
"0.6009574",
"0.5967222",
"0.59417146",
"0.5935863",
"0.59323627",
"0.59167963",
"0.5899326",
"0.5897248",
"0.58946884",
"0.58756244"
] | 0.70479095 | 0 |
Acts on a $ckeditor_comment being inserted or updated. This hook is invoked before the $ckeditor_comment is saved to the database. | function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {
$ckeditor_comment->name = 'foo';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_ckeditor_comment_insert(CKEditorComment $ckeditor_comment) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment', $ckeditor_comment),\n 'extra' => print_r($ckeditor_comment, TRUE),\n ))\n ->execute();\n}",
"function hook_ckeditor_comment_update(CKEditorComment $ckeditor_comment) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment, TRUE)))\n ->condition('id', entity_id('ckeditor_comment', $ckeditor_comment))\n ->execute();\n}",
"public function processComment()\n {\n if (Tools::isSubmit('simplecomments_submit_comment')) {\n $insert = array(\n 'id_product' => (int)Tools::getValue('id_product'),\n 'firstname' => pSQL(Tools::getValue('firstname')),\n 'lastname' => pSQL(Tools::getValue('lastname')),\n 'email' => pSQL(Tools::getValue('email')),\n 'grade' => (int)Tools::getValue('grade'),\n 'comment' => pSQL(Tools::getValue('comment')),\n 'date_add' => date('Y-m-d H:i:s'),\n );\n Db::getInstance()->insert('simplecomments', $insert);\n $this->context->smarty->assign('new_comment_posted', 'true');\n }\n }",
"function mzz_comment_inserted($comment_id, $comment_object) {\n if ($comment_object->comment_type == 'collabpress') {\n \n //the comment type was seen to be collabpress. It was already inserted into the database. Now we go back into the database and update that comment's approved status to 0 (pending)\n $mzzcommentarr = array();\n\t\t$mzzcommentarr['comment_ID'] = $comment_id;\n\t\t$mzzcommentarr['comment_approved'] = 0;\n\t\twp_update_comment( $mzzcommentarr );\n\n }\n}",
"function hook_ckeditor_comment_type_presave(CKEditorCommentType $ckeditor_comment_type) {\n $ckeditor_comment_type->name = 'foo';\n}",
"public function imported_comment() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'comments',\n\t\t\t'delta' => 1,\n\t\t));\n\t}",
"public function p_comment() {\n\t\t\t\t\t$_POST['user_id'] = $this->user->user_id;\n\t\n\t\t\t\t\t# Unix timestamp of when this comment was created / modified\n\t\t\t\t\t$_POST['created'] = Time::now();\n\t\t\t\t\t$_POST['modified'] = Time::now();\n\t\n\t\t\t\t\t# Insert to database\n\t\t\t\t\tDB::instance(DB_NAME)->insert('comments', $_POST);\n\t\n\t\t\t\t\t# Redirect after insert\n\t\t\t\t\tRouter::redirect(\"/posts\");\n\t\n\t\t\t}",
"function hook_ckeditor_comment_type_insert(CKEditorCommentType $ckeditor_comment_type) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment_type', $ckeditor_comment_type),\n 'extra' => print_r($ckeditor_comment_type, TRUE),\n ))\n ->execute();\n}",
"function hook_ckeditor_comment_type_update(CKEditorCommentType $ckeditor_comment_type) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment_type, TRUE)))\n ->condition('id', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"public function afterSave() {\n if ($this->modx->modxtalks->mtCache === true) {\n if (!$this->modx->modxtalks->cacheComment($this->object)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache comment error, ID ' . $this->object->id);\n }\n if (!$this->modx->modxtalks->cacheConversation($this->theme)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache conversation error, ID ' . $this->theme->id);\n }\n }\n\n return parent::afterSave();\n }",
"public function post_comment()\n\t{\n\t\t$this->get_comment( true );\n\t}",
"protected function _preSave() {}",
"public function beforeInsertComment($data)\n\t{\n\t $node = $data['_node'];\n\t \t \n $data['node'] = array(\n 'id'\t=>\t$data['nid'],\n\t\t);\n \n\t\t$data['status'] = 'queued';\n \n if (isset($node['name']) && !empty($node['name']))\n $data['node']['name']\t=\t$node['name'];\n else if (isset($node['content']))\n $data['node']['name']\t= word_breadcumb($node['content'], CACHED_POST_TITLE_WORD_LENGTH);\n\t \n if(isset($data['attachments']) && (is_null($data['attachments']) || $data['attachments'] == ''))\n \tunset($data['attachments']);\n \n\t\treturn array('success' => true, 'result' => $data);\n\t}",
"protected function _preSave()\n {\n // Create logic that precedes saving of data into the database.\n }",
"public function action_comment_insert_after ($comment) {\n if (($comment->type != Comment::COMMENT) \n || ($comment->status == Comment::STATUS_SPAM)) {\n return;\n }\n\n $post = Post::get (array ('id' => $comment->post_id));\n $author = User::get_by_id ($post->user_id);\n\n $c = $comment;\n $sent = array ();\n $sent[] = $author->email;\n $sent[] = $comment->email;\n\n while (isset ($c->info->comment_parent)) {\n $cc = Comment::get ($c->info->comment_parent);\n\n if (isset ($cc->info->email_notify) && $cc->info->email_notify == 1) {\n if (!in_array ($cc->email, $sent)) {\n $sent[] = $cc->email;\n $this->mail_notify ($cc->email, $cc, $comment);\n }\n }\n\n $c = $cc;\n }\n }",
"protected function _preSave()\n {\n }",
"protected function _preSave()\n {\n if ($this->isInsert() && $this->get('expiry_date') >= 4294967295)\n {\n $this->set('expiry_date', 0);\n }\n\n parent::_preSave();\n\n if (SV_ReportImprovements_Globals::$replyBanOptions && $this->get('content_type') == 'post')\n {\n $user = $this->_getUserModel()->getUserById($this->get('user_id'));\n\n $postId = $this->get('content_id');\n $post = $this->_getPostModel()->getPostById($postId, array(\n 'join' => XenForo_Model_Post::FETCH_THREAD | XenForo_Model_Post::FETCH_FORUM,\n 'skip_wordcount' => true,\n ));\n\n if (!empty($post['thread_id']) && $user && $this->_getThreadModel()->canReplyBanUserFromThread($user, $post, $post, $errorPhraseKey))\n {\n $this->replyBanUser = $user;\n $this->replyBanThread = $post;\n $this->replyBanOptions = SV_ReportImprovements_Globals::$replyBanOptions;\n }\n else\n {\n $this->error($errorPhraseKey, 'ban_length');\n }\n }\n }",
"public function fireNewCommentEvent()\n {\n DomainEventManager::getInstance()->dispatchEvent(DomainEventManager::EVENT_NEWCOMMENT, [ 'urlComment' => $this ]);\n }",
"public function beforeSave()\n\t{\n\n\t}",
"function ajax_insert_comment( ) {\n\t\tglobal $current_user, $user_ID, $wpdb;\n\n\t\t// Verify nonce\n\t\tif ( !wp_verify_nonce( $_POST['_nonce'], 'comment') )\n\t\t\tdie( __( \"Nonce check failed. Please ensure you're supposed to be adding editorial comments.\", 'edit-flow' ) );\n\n\t\t// Get user info\n \twp_get_current_user();\n\n \t// Set up comment data\n\t\t$post_id = absint( $_POST['post_id'] );\n\t\t$parent = absint( $_POST['parent'] );\n\n \t// Only allow the comment if user can edit post\n \t// @TODO: allow contributers to add comments as well (?)\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\tdie( __('Sorry, you don\\'t have the privileges to add editorial comments. Please talk to your Administrator.', 'edit-flow' ) );\n\n\t\t// Verify that comment was actually entered\n\t\t$comment_content = trim($_POST['content']);\n\t\tif( !$comment_content )\n\t\t\tdie( __( \"Please enter a comment.\", 'edit-flow' ) );\n\n\t\t// Check that we have a post_id and user logged in\n\t\tif( $post_id && $current_user ) {\n\n\t\t\t// set current time\n\t\t\t$time = current_time('mysql', $gmt = 0);\n\n\t\t\t// Set comment data\n\t\t\t$data = array(\n\t\t\t 'comment_post_ID' => (int) $post_id,\n\t\t\t 'comment_author' => esc_sql($current_user->display_name),\n\t\t\t 'comment_author_email' => esc_sql($current_user->user_email),\n\t\t\t 'comment_author_url' => esc_sql($current_user->user_url),\n\t\t\t 'comment_content' => wp_kses($comment_content, array('a' => array('href' => array(),'title' => array()),'b' => array(),'i' => array(),'strong' => array(),'em' => array(),'u' => array(),'del' => array(), 'blockquote' => array(), 'sub' => array(), 'sup' => array() )),\n\t\t\t 'comment_type' => self::comment_type,\n\t\t\t 'comment_parent' => (int) $parent,\n\t\t\t 'user_id' => (int) $user_ID,\n\t\t\t 'comment_author_IP' => esc_sql($_SERVER['REMOTE_ADDR']),\n\t\t\t 'comment_agent' => esc_sql($_SERVER['HTTP_USER_AGENT']),\n\t\t\t 'comment_date' => $time,\n\t\t\t 'comment_date_gmt' => $time,\n\t\t\t\t// Set to -1?\n\t\t\t 'comment_approved' => self::comment_type,\n\t\t\t);\n\n\t\t\t$data = apply_filters( 'ef_pre_insert_editorial_comment', $data );\n\n\t\t\t// Insert Comment\n\t\t\t$comment_id = wp_insert_comment($data);\n\t\t\t$comment = get_comment($comment_id);\n\n\t\t\t// Save the list of notified users/usergroups.\n\t\t\tif ( $this->module_enabled( 'notifications' ) && apply_filters( 'ef_editorial_comments_show_notified_users', true ) ) {\n\t\t\t\t$notification = isset( $_POST['notification'] ) ? sanitize_text_field( $_POST['notification'] ) : '';\n\n\t\t\t\tif ( ! empty( $notification ) && __( 'No one will be notified.', 'edit-flow' ) !== $notification ) {\n\t\t\t\t\tadd_comment_meta( $comment_id, 'notification_list', $notification );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Register actions -- will be used to set up notifications and other modules can hook into this\n\t\t\tif ( $comment_id )\n\t\t\t\tdo_action( 'ef_post_insert_editorial_comment', $comment );\n\n\t\t\t// Prepare response\n\t\t\t$response = new WP_Ajax_Response();\n\n\t\t\tob_start();\n\t\t\t\t$this->the_comment( $comment, '', '' );\n\t\t\t\t$comment_list_item = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t$response->add( array(\n\t\t\t\t'what' => 'comment',\n\t\t\t\t'id' => $comment_id,\n\t\t\t\t'data' => $comment_list_item,\n\t\t\t\t'action' => ($parent) ? 'reply' : 'new'\n\t\t\t));\n\n\t\t\t$response->send();\n\n\t\t} else {\n\t\t\tdie( __('There was a problem of some sort. Try again or contact your administrator.', 'edit-flow') );\n\t\t}\n\t}",
"function qc_handle_comments( $comment_post_ID ) {\r\n\t$comment_content = ( isset( $_POST['comment'] ) ) ? trim( $_POST['comment'] ) : null;\r\n\r\n\tif ( empty( $comment_content ) && apply_filters( 'qc_did_change_ticket', false ) ) {\r\n\t\t// Create an empty comment ourselves, to bypass WP's checks\r\n\t\t$defaults = array(\r\n\t\t\t'comment_post_ID' => $comment_post_ID,\r\n\t\t\t'comment_content' => $comment_content,\r\n\t\t\t'user_id' => get_current_user_id()\r\n\t\t);\r\n\t\t$comment_data = wp_parse_args( $defaults, wp_get_current_commenter() );\r\n\t\t$comment_id = wp_insert_comment( $comment_data );\r\n\r\n\t\t$comment = get_comment( $comment_id );\r\n\r\n\t\t$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment_id ) : $_POST['redirect_to'] . '#comment-' . $comment_id;\r\n\t\t$location = apply_filters( 'comment_post_redirect', $location, $comment );\r\n\r\n\t\twp_redirect( $location );\r\n\t\texit;\r\n\t}\r\n}",
"public function beforeSave()\n {\n if ($this->_customer) {\n $this->setCustomerId($this->_customer->getId());\n }\n parent::beforeSave();\n }",
"protected function _preSave()\n {\n // todo: determine what you will do before a save operation, document if you include\n }",
"protected function afterSave()\n {\n // flush the cache\n $this->flushCache();\n\n $activity = Activity::CreateForContent($this);\n $activity->type = \"CommentCreated\";\n $activity->module = \"comment\";\n $activity->save();\n $activity->fire();\n\n // Handle mentioned users\n // Execute before NewCommentNotification to avoid double notification when mentioned.\n UserMentioning::parse($this, $this->message);\n\n if ($this->isNewRecord) {\n // Send Notifications\n NewCommentNotification::fire($this);\n }\n \n\n return parent::afterSave();\n }",
"function pmg_comment_tut_insert_comment( $comment_id )\n{\n if( isset( $_POST['_diagnosa'] ) )\n update_comment_meta( $comment_id, '_diagnosa', esc_attr( $_POST['_diagnosa'] ) );\n if( isset( $_POST['_terapi'] ) )\n update_comment_meta( $comment_id, '_terapi', esc_attr( $_POST['_terapi'] ) );\n}",
"public function onCommentPersist(CommentEvent $event)\n {\n $comment = $event->getComment();\n\n if (!$this->commentManager->isNewComment($comment)) {\n return;\n }\n\n $thread = $comment->getThread();\n $thread->incrementNumComments(1);\n $thread->setLastCommentAt($comment->getCreatedAt());\n }",
"private function save_data_comment() {\r\n if($this->setting->get_element_value('pf_comment','approve_flag') == 1){\r\n if(in_array(current_user('user-id'),$this->settings['approve'])){\r\n $status = 1;\r\n }else{\r\n $status = 2;\r\n }\r\n }else{\r\n $status = 1;\r\n }\r\n \r\n \r\n $data = array(\r\n 'comment_content' => $this->post->message,\r\n 'comment_author' => current_user('user-name'),\r\n 'comment_user_id' => current_user('user-id'),\r\n 'comment_key' => $this->post->key,\r\n 'comment_status' => $status,\r\n );\r\n\r\n if ($this->type != 'edit') {\r\n $parent = $this->post->parent ? $this->post->parent : 0;\r\n $data['comment_parent'] = $parent;\r\n }\r\n if ($this->type == 'edit') {\r\n $data['id'] = $this->id;\r\n $data['comment_modified_date'] = date(\"Y-m-d H:i:s\");\r\n $result = $this->comment_model->save($data);\r\n } else {\r\n $data['comment_created_date'] = date(\"Y-m-d H:i:s\");\r\n $result = $this->comment_model->insert($data);\r\n }\r\n return $result;\r\n }",
"protected function _postSave()\n {\n // Create logic that precedes saving of data into the database.\n }",
"function tha_comments_before() {\n\tdo_action( 'tha_comments_before' );\n}",
"protected function before_save()\n {\n\n }"
] | [
"0.70373034",
"0.68986946",
"0.6889732",
"0.68486637",
"0.6756236",
"0.65504116",
"0.648667",
"0.644194",
"0.6251498",
"0.6250864",
"0.62393665",
"0.62339187",
"0.6220399",
"0.6212168",
"0.62038785",
"0.61998993",
"0.6147578",
"0.6130035",
"0.6121539",
"0.6079819",
"0.6049503",
"0.6042531",
"0.60191303",
"0.60185605",
"0.59746593",
"0.5964065",
"0.5955549",
"0.5924889",
"0.5922713",
"0.5911362"
] | 0.7437966 | 0 |
Responds to a $ckeditor_comment being updated. This hook is invoked after the $ckeditor_comment has been updated in the database. | function hook_ckeditor_comment_update(CKEditorComment $ckeditor_comment) {
db_update('mytable')
->fields(array('extra' => print_r($ckeditor_comment, TRUE)))
->condition('id', entity_id('ckeditor_comment', $ckeditor_comment))
->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {\n $ckeditor_comment->name = 'foo';\n}",
"public function updated(Comment $comment)\n {\n //\n }",
"public function fireNewCommentEvent()\n {\n DomainEventManager::getInstance()->dispatchEvent(DomainEventManager::EVENT_NEWCOMMENT, [ 'urlComment' => $this ]);\n }",
"public function post_comment()\n\t{\n\t\t$this->get_comment( true );\n\t}",
"function hook_ckeditor_comment_type_update(CKEditorCommentType $ckeditor_comment_type) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment_type, TRUE)))\n ->condition('id', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"public function processComment()\n {\n if (Tools::isSubmit('simplecomments_submit_comment')) {\n $insert = array(\n 'id_product' => (int)Tools::getValue('id_product'),\n 'firstname' => pSQL(Tools::getValue('firstname')),\n 'lastname' => pSQL(Tools::getValue('lastname')),\n 'email' => pSQL(Tools::getValue('email')),\n 'grade' => (int)Tools::getValue('grade'),\n 'comment' => pSQL(Tools::getValue('comment')),\n 'date_add' => date('Y-m-d H:i:s'),\n );\n Db::getInstance()->insert('simplecomments', $insert);\n $this->context->smarty->assign('new_comment_posted', 'true');\n }\n }",
"protected function afterSave()\n {\n // flush the cache\n $this->flushCache();\n\n $activity = Activity::CreateForContent($this);\n $activity->type = \"CommentCreated\";\n $activity->module = \"comment\";\n $activity->save();\n $activity->fire();\n\n // Handle mentioned users\n // Execute before NewCommentNotification to avoid double notification when mentioned.\n UserMentioning::parse($this, $this->message);\n\n if ($this->isNewRecord) {\n // Send Notifications\n NewCommentNotification::fire($this);\n }\n \n\n return parent::afterSave();\n }",
"public function imported_comment() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'comments',\n\t\t\t'delta' => 1,\n\t\t));\n\t}",
"public function afterSave() {\n if ($this->modx->modxtalks->mtCache === true) {\n if (!$this->modx->modxtalks->cacheComment($this->object)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache comment error, ID ' . $this->object->id);\n }\n if (!$this->modx->modxtalks->cacheConversation($this->theme)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache conversation error, ID ' . $this->theme->id);\n }\n }\n\n return parent::afterSave();\n }",
"function updateComment($data) {\n $comment = CommentManager::getManager()->search(filter_var($data->comment, FILTER_SANITIZE_NUMBER_INT));\n if($comment->getUserFk()->getId() === $_SESSION['id'] || $_SESSION['role'] !== 3) {\n if($comment->getTopicFk()->getStatus() !== 1 || $_SESSION['role'] === 1) {\n if($_SESSION['role'] === 2) {\n $log = new Logger('LogAdmin');\n $log->pushHandler(new StreamHandler($_SERVER['DOCUMENT_ROOT'] . '/log.txt', Logger::INFO));\n $log->info(\"Le modérateur \" . $_SESSION['username'] . \" a mise à jour le message \\\"\" .\n $comment->getContent() . \"\\\" de l'utilisateur \" . $comment->getUserFk()->getUsername());\n }\n\n $comment->setcontent(filter_var($data->content, FILTER_SANITIZE_STRING));\n CommentManager::getManager()->update($comment);\n }\n }\n}",
"function hook_ckeditor_comment_type_presave(CKEditorCommentType $ckeditor_comment_type) {\n $ckeditor_comment_type->name = 'foo';\n}",
"public function updateCommentAction(Comment $comment){\n\n // get content of HTTP POST request\n $comment_content = $this->getRequest()->request->get('comment');\n \n // get current user\n $user = $this->container->get('security.context')->getToken()->getUser();\n \n // check that this comment exists\n if($comment==null){\n return $this->render('InouireMininetBundle:Default:commentAjaxResponse.json.twig',array(\n 'status'=> 'error',\n 'message' => 'comment '+$comment_id+' does not exist'\n ));\n }\n \n // check that the user is the author of this comment\n if($user != $comment->getAuthor() ){\n return $this->render('InouireMininetBundle:Default:commentAjaxResponse.json.twig',array(\n 'status'=> 'error',\n 'message' => 'you are not the author of comment '+$comment_id\n ));\n }\n \n // update comment \n $comment->setContent($comment_content);\n $em = $this->getDoctrine()->getManager();\n $em->persist($comment);\n $em->flush();\n \n // render json response\n return $this->render('InouireMininetBundle:Default:commentAjaxResponse.json.twig',array(\n 'status'=> 'ok',\n 'message' => 'comment '.$comment_id.' update',\n 'comment_id' => $comment_id,\n 'comment_content' => $comment_content\n ));\n \n }",
"private function setCompleteComment()\n\t{\n\t\t$id = $this->getId();\n\t\t$this->idPost = Comment::$rawComments[$id]['idPost'];\n\t}",
"function pmg_comment_tut_edit_comment( $comment_id )\n{\n if( ! isset( $_POST['pmg_comment_update'] ) || ! wp_verify_nonce( $_POST['pmg_comment_update'], 'pmg_comment_update' ) ) return;\n if( isset( $_POST['_diagnosa'] ) )\n update_comment_meta( $comment_id, '_diagnosa', esc_attr( $_POST['_diagnosa'] ) );\n if( isset( $_POST['_terapi'] ) )\n update_comment_meta( $comment_id, '_terapi', esc_attr( $_POST['_terapi'] ) );\n}",
"private function comment_edit_submit( ) {\n\n //\n if ( $comment_ID = in( 'comment_ID' ) ) { // update\n $this->endIfNotMyComment( $comment_ID );\n $comment = get_comment( $comment_ID );\n $post_ID = $comment->comment_post_ID;\n $re = wp_update_comment([\n 'comment_ID' => $comment_ID,\n 'comment_content' => in('comment_content')\n ]);\n\n if ( ! $re ) {\n // error or content has not changed.\n }\n }\n else { // new\n $post_ID = in('post_ID');\n $comment_ID = wp_insert_comment([\n 'comment_post_ID' => $post_ID,\n 'comment_parent' => in('comment_parent'),\n 'user_id' => wp_get_current_user()->ID,\n 'comment_content' => in('comment_content'),\n 'comment_approved' => 1,\n ]);\n if ( ! $comment_ID ) {\n wp_die(\"Comment was not created\");\n }\n }\n\n //$this->updateFileWithPost( FORUM_COMMENT_POST_NUMBER + $comment_ID );\n\n $url = get_permalink( $post_ID ) . '#comment-' . $comment_ID ;\n\n $this->response( null, $post_ID, $comment_ID );\n\n }",
"function updateComment() {\r\n\r\n $comments = $this->request->data['value'];\r\n $com = $this->request->data['commenttext'];\r\n $commenttext_varr = explode('_', $com);\r\n $commentid = $commenttext_varr[1];\r\n\r\n $data['projComments']['comment'] = $comments;\r\n $this->projComments->id = $commentid;\r\n\r\n $updatedecomment = $this->projComments->Save($data);\r\n echo $com = $this->request->data['value'];\r\n die;\r\n }",
"function qc_handle_comments( $comment_post_ID ) {\r\n\t$comment_content = ( isset( $_POST['comment'] ) ) ? trim( $_POST['comment'] ) : null;\r\n\r\n\tif ( empty( $comment_content ) && apply_filters( 'qc_did_change_ticket', false ) ) {\r\n\t\t// Create an empty comment ourselves, to bypass WP's checks\r\n\t\t$defaults = array(\r\n\t\t\t'comment_post_ID' => $comment_post_ID,\r\n\t\t\t'comment_content' => $comment_content,\r\n\t\t\t'user_id' => get_current_user_id()\r\n\t\t);\r\n\t\t$comment_data = wp_parse_args( $defaults, wp_get_current_commenter() );\r\n\t\t$comment_id = wp_insert_comment( $comment_data );\r\n\r\n\t\t$comment = get_comment( $comment_id );\r\n\r\n\t\t$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment_id ) : $_POST['redirect_to'] . '#comment-' . $comment_id;\r\n\t\t$location = apply_filters( 'comment_post_redirect', $location, $comment );\r\n\r\n\t\twp_redirect( $location );\r\n\t\texit;\r\n\t}\r\n}",
"function mzz_comment_inserted($comment_id, $comment_object) {\n if ($comment_object->comment_type == 'collabpress') {\n \n //the comment type was seen to be collabpress. It was already inserted into the database. Now we go back into the database and update that comment's approved status to 0 (pending)\n $mzzcommentarr = array();\n\t\t$mzzcommentarr['comment_ID'] = $comment_id;\n\t\t$mzzcommentarr['comment_approved'] = 0;\n\t\twp_update_comment( $mzzcommentarr );\n\n }\n}",
"public function updateComment($comment_id, $content, $issue_id = null);",
"static function updateComment($comment){\n\t\t$servername = self::$servername;\n\t\t$username = self::$username;\n\t\t$password = self::$password;\n\t\t$dbname = self::$dbname;\n\t\t$log = self::$log;\n\t\ttry{\n\t\t\t$pdo = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n\n $stmt = $pdo -> prepare('UPDATE comments set content = :content\n\t\t\t\tWHERE id = :id;');\n\t\t\t\t\n\t\t\t$content = $comment->getContent();\n\t\t\t$id = $comment->getId();\t\t\t\n\t\t\t$stmt -> bindParam(':content', $content);\n $stmt -> bindParam(':id', $id);\n\t\t\t\n\t\t\t$stmt -> execute();\n $log->lwrite('Updated Comment succesfully. ID: '. $id);\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\t$log->lwrite($e -> getMessage());\n\t\t}\n\t\tfinally{\n\t\t\tunset($pdo);\n\t\t}\n }",
"public function updated (Comment $comment) {\n\n // Если коммент редактируется\n if (request()->isMethod('PUT')) {\n $resData = array_merge(\n $comment->toArray(),\n ['event' => 'updated']\n );\n broadcast(new CommentEvent($resData));\n }\n\n }",
"public function updateCommentableAction() {\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->commentable = !$this->_action->commentable;\n $this->_action->save();\n $db->commit();\n\n $this->respondWithSuccess($this->_action->commentable);\n } catch (Exception $e) {\n $db->rollBack();\n $this->respondWithValidationError('internal_server_error', $e->getMessage());\n }\n }",
"public function setCommentPostModified($date) {\n $this->_commentPostModified = $date;\n }",
"public function setC(){\r\n\r\n if (isset($_POST['comment']) && $this->e->get('uid')) {\r\n\r\n $this->v->required($_POST['comment'], 'comment tidak boleh kosong');\r\n $this->v->regex($_POST['comment'], '/^(.|\\n){4,400}$/', # nanti dihapus\r\n '4-400 any dan spasi');\r\n\r\n if(!sizeof($this->v->errors)) \r\n {\r\n # CHECK POST IS HUMAN\r\n if ($this->f->checkHumanPost(3)) {\r\n\r\n # RENDER COMMENT\r\n $r = $this->__commentRender($_POST['comment']);\r\n\r\n # SETTING UP\r\n $p['comment'] = $r['text'];\r\n\r\n # START PLUGIN\r\n $m = new Engine\\Vendors\\Stackexchangeinc\\wmd\\ElephantMarkdown;\r\n $vendorHTMLpurifier = new Engine\\Vendors\\HTMLpurifier\\HTMLpurifier;\r\n $HTMLpurifierConfig = HTMLPurifier_Config::createDefault();\r\n $HTMLpurifierConfig->set('HTML.SafeObject', \"1\");\r\n $HTMLpurifierConfig->set('Output.FlashCompat', \"1\");\r\n $HTMLpurifierConfig->set('Filter.YouTube', \"1\");\r\n $purifier = new HTMLPurifier($HTMLpurifierConfig);\r\n $data['comment_html'] = $purifier->purify($m->parse($p['comment']));\r\n # END PLUGIN\r\n\r\n $data['comment_UID'] = $this->e->get('uid');\r\n $data['comment_PID'] = $_POST['id']; \r\n $time = new DateTime ( NULL, new DateTimeZone ( 'Asia/Jakarta' ) );\r\n $data['time_create'] = $time->format('Y-m-d H:i:s');\r\n $m = new Apps\\Netcoid\\Models\\Mentions;\r\n\r\n # SET COMMENT\r\n $c = new Apps\\Netcoid\\Models\\Comments;\r\n $p = new Apps\\Netcoid\\Models\\Posts;\r\n\r\n $c->set($data);\r\n \r\n # TAMBAH SATU REPLY\r\n $p->addReply1($data['comment_PID']);\r\n\r\n # SET MENTION IF THERE IS SOME USERNAME IN COMMENT\r\n if (!empty($r['usernames'])) {\r\n $m->set($c->getLastId(), $r['usernames']);\r\n }\r\n $this->h->setMessage('Comment Posted'); \r\n header('Location: /post?id='.$_POST['id'] );\r\n } \r\n }\r\n\r\n if(sizeof($this->v->errors)) \r\n {\r\n $this->h->setError($this->v->errors[0]); \r\n header('Location: /post?id='.$_POST['id'] );\r\n }\r\n \r\n } else {\r\n die('[email protected]');\r\n }\r\n }",
"public function executeUpdateComment(HTTPRequest $request)\n {\n $this->page->addVar('title', 'Modification d\\'un commentaire');\n \n if ($request->method() == 'POST')\n {\n $comment = new Comment([\n 'id' => $request->getData('id'),\n 'auteur' => $request->postData('auteur'),\n 'contenu' => $request->postData('contenu')\n ]);\n }\n else\n {\n $comment = $this->managers->getManagerOf('Comments')->get($request->getData('id'));\n }\n \n $formBuilder = new CommentFormBuilder($comment);\n $formBuilder->build();\n \n $form = $formBuilder->form();\n \n $formHandler = new FormHandler($form, $this->managers->getManagerOf('Comments'), $request);\n \n if ($formHandler->process())\n {\n \n $this->app->httpResponse()->redirect('/admin/comments-admin.html');\n\n }\n \n $this->page->addVar('form', $form->createView());\n }",
"function fireCommentEvent($data) {\r\n\t\tcall_user_func($this->commentHandler, $this, $data);\r\n\t}",
"public function actionAdminComment() {\n if (Yii::$app->request->isAjax) {\n $leave_id = $_POST['leave_id'];\n $comment = $_POST['comment'];\n $leave_model = StaffLeave::find()->where(['id' => $leave_id])->one();\n $leave_model->admin_comment = $comment;\n $leave_model->update();\n }\n }",
"static public function notifyComment(Comment $comment) {\n // notify the parent of this comment\n $comment->commenter->notifications()->create([\n 'notification_id' => $comment->id,\n 'notification_type' => Comment::class,\n ]);\n\n // bust cache?\n }",
"function dbModifyComment($db, $userLogin, $photoId, $comment)\r\n {\r\n return true;\r\n }",
"public function postComments(): void\n\t{\n\t\tforeach ($this->comments as $comment)\n\t\t{\n\t\t\t$auxData = $comment->getData();\n\n\t\t\t$hasLiveData = false;\n\t\t\tif (is_array($auxData))\n\t\t\t{\n\t\t\t\tforeach ($auxData as $value)\n\t\t\t\t{\n\t\t\t\t\tif (!is_array($value))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($value as $commentData)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!is_array($commentData)\n\t\t\t\t\t\t\t|| !is_array($commentData[1])\n\t\t\t\t\t\t\t|| empty($commentData[1]['LIVE_DATA'])\n\t\t\t\t\t\t\t|| !is_array($commentData[1]['LIVE_DATA'])\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$hasLiveData = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($hasLiveData)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** @var Comment $comment */\n\t\t\tForum\\Task\\Comment::add($this->taskId, [\n\t\t\t\t'AUTHOR_ID' => $comment->getAuthorId(),\n\t\t\t\t'POST_MESSAGE' => $comment->getText(),\n\t\t\t\t'UF_TASK_COMMENT_TYPE' => $comment->getType(),\n\t\t\t\t'AUX' => 'Y',\n\t\t\t\t'AUX_DATA' => $auxData,\n\t\t\t\t'AUX_LIVE_PARAMS' => ($hasLiveData ? [ 'JSON' => Main\\Web\\Json::encode($auxData) ] : []),\n\t\t\t]);\n\t\t}\n\t}"
] | [
"0.6744549",
"0.673692",
"0.6571096",
"0.6373975",
"0.63104135",
"0.6259335",
"0.6205113",
"0.6194653",
"0.61647743",
"0.6137228",
"0.613168",
"0.60976017",
"0.6082976",
"0.6076511",
"0.60408443",
"0.6028424",
"0.60184103",
"0.6005959",
"0.59896",
"0.5989257",
"0.5956526",
"0.59510666",
"0.5936435",
"0.5908827",
"0.5901003",
"0.5892485",
"0.58900225",
"0.58851695",
"0.58780694",
"0.5818999"
] | 0.6942524 | 0 |
Responds to $ckeditor_comment deletion. This hook is invoked after the $ckeditor_comment has been removed from the database. | function hook_ckeditor_comment_delete(CKEditorComment $ckeditor_comment) {
db_delete('mytable')
->condition('pid', entity_id('ckeditor_comment', $ckeditor_comment))
->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleted(Comment $comment)\n {\n //\n }",
"function hook_ckeditor_comment_type_delete(CKEditorCommentType $ckeditor_comment_type) {\n db_delete('mytable')\n ->condition('pid', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"protected function beforeDelete()\n {\n $this->flushCache();\n Notification::remove('Comment', $this->id);\n return parent::beforeDelete();\n }",
"public function deleted (Comment $comment) {\n // Если коммент удаляется\n $resData = array_merge(\n $comment->toArray(),\n ['event' => 'delete']\n );\n broadcast(new CommentEvent($resData));\n }",
"protected function afterDelete()\n {\n parent::afterDelete();\n Comment::model()->deleteAll('photo_id=' . $this->id);\n Tag::model()->updateFrequency($this->tags, '');\n }",
"public function delete()\n {\n //recuperation des informations pour la suppression d'un commentaire\n $data = $this->request->data;\n $id_commentaire = (int)$data['id_commentaire'] ?? null;\n if (empty($id_commentaire)) {\n $this->_return('Veillez spécifier l\\'identifiant du commentaire à supprimer', false);\n }\n\n try {\n $this->model->remove($id_commentaire);\n $this->_return('commentaire supprimé avec succès', true);\n //code...\n } \n catch (Exception $e)\n {\n $this->_exception($e);\n }\n }",
"public function action_received_comment_delete()\n\t{\n\t\t// Auto render off\n\t\t$this->auto_render = FALSE;\n\n\t\t// Get ids, if When it is smaller than 2 then throw to 404\n\t\t$ids = explode('_', $this->request->param('key'));\n\t\tif (!(count($ids) == 2)) throw HTTP_Exception::factory(404);\n\n\t\t// idsをitem_idとreceived_comment_idに分ける\n\t\tlist($item_id, $received_comment_id) = $ids;\n\n\t\t// Get received_comment, if there is nothing then throw to 404\n\t\t$received_comment = Tbl::factory('received_comments')->get($received_comment_id);\n\t\tif (!$received_comment) throw HTTP_Exception::factory(404);\n\n\t\t// Get item, if there is nothing then throw to 404\n\t\t$this->item = Tbl::factory('items')->get($item_id);\n\t\tif (!$this->item) throw HTTP_Exception::factory(404);\n\n\t\t// Get division\n\t\t$division = Tbl::factory('divisions')\n\t\t\t->where('id', '=', $this->item->division_id)\n\t\t\t->read(1);\n\n\t\t// Database transaction start\n\t\tDatabase::instance()->begin();\n\n\t\t// Try\n\t\ttry\n\t\t{\n\t\t\t// Delete\n\t\t\t$received_comment->delete();\n\n\t\t\t// Database commit\n\t\t\tDatabase::instance()->commit();\n\n\t\t\t// Add success notice\n\t\t\tNotice::add(Notice::SUCCESS, Kohana::message('general', 'delete_success'));\n\n\t\t\t// redirect\n\t\t\t$this->redirect(URL::site(\"{$this->settings->backend_name}/items/{$division->segment}/received_comments/{$this->item->id}\", 'http'));\n\t\t}\n\t\tcatch (HTTP_Exception_302 $e)\n\t\t{\n\t\t\t$this->redirect($e->location());\n\t\t}\n\t\tcatch (Validation_Exception $e)\n\t\t{\n\t\t\t// Database rollback\n\t\t\tDatabase::instance()->rollback();\n\n\t\t\t// Add validation notice\n\t\t\tNotice::add(Notice::VALIDATION, Kohana::message('general', 'delete_failed'), NULL, $e->errors('validation'));\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Database rollback\n\t\t\tDatabase::instance()->rollback();\n\n\t\t\t// Add error notice\n\t\t\tNotice::add(\n\t\t\t\tNotice::ERROR//, $e->getMessage()\n\t\t\t);\n\t\t}\n\n\t\t// Redirect to received_comments edit\n\t\t$this->redirect(URL::site(\"{$this->settings->backend_name}/items/{$division->segment}/received_comments/{$this->item->id}\", 'http').URL::query());\n\t}",
"abstract public function destroy(Comment $comment);",
"public function forceDeleted (Comment $comment) {\n //\n }",
"protected function afterDelete()\n {\n }",
"public function delete()\n {\n $id = $this->request->getParam('id');\n $delete = CommentManager::deleteById($id);\n\n $this->alertMessage('index', $delete, static::DELETE);\n }",
"protected function _afterDelete()\r\n\t{}",
"public function onAfterPublish()\n {\n $comments = FieldComment::get()->filter(array(\n 'CommentClassName' => $this->owner->ClassName,\n 'CommentDataObjectID' => $this->owner->ID\n ));\n\n if ($comments && $comments->Count()) {\n foreach ($comments as $comment) {\n DB::query('DELETE FROM \"silverstripe\\fieldComment\\FieldCommentReader\" WHERE \"FieldCommentID\" = ' . $comment->ID);\n $comment->delete();\n }\n }\n }",
"function comment_delete($comment_id) {\n\t global $database;\n\n\n\n\t}",
"public function forceDeleted(Comment $comment)\n {\n //\n }",
"function delComment()\n {\n\n $cid = $this->input->post('delcomment');\n $this->comments_model->delComments($cid);\n\n }",
"public function afterDelete()\n {\n }",
"function deletecomment()\n\t{\n\t\t//echo $_POST[\"commentid\"];\n\t\tif ($_POST) :\n\n\t\t\techo $this->model->delete(\"comments\", \"id=\" . $_POST[\"commentid\"]);\n\n\t\tendif;\n\t}",
"public function deleteCommentAction()\n\t{\n\t\t\n\t\tif( $this->getRequest()->getParam('comment_id') )\n\t\t{\n\t\t\t$is_deleted = \\Extended\\comments::deleteComment( $this->getRequest()->getParam('comment_id'), Auth_UserAdapter::getIdentity()->getId() );\n\t\t\tif( $is_deleted )\n\t\t\t{\n\t\t\t\t//get photo object\n\t\t\t\t$photo_obj = \\Extended\\socialise_photo::getRowObject($this->getRequest()->getParam('photo_id'));\n\t\t\t\t\n\t\t\t\t//setting comment count for photo.\n\t\t\t\t$comment_on_photo_count = \\Extended\\socialise_photo::commentCountDecreament( $this->getRequest()->getParam('photo_id'));\n\t\n\t\t\t}\n\t\t\t//removing hide comment records.\n\t\t\t\\Extended\\users_comments_visibility::unhideComment( $this->getRequest()->getParam('comment_id') );\n\t\t\n\t\t\tif( $is_deleted && $comment_on_photo_count )\n\t\t\t{\n\t\t\t\techo Zend_Json::encode( $is_deleted );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo Zend_Json::encode( 0 );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo Zend_Json::encode( 0 );\n\t\t}\n\t\tdie;\n\t}",
"protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t}",
"protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\t//Comment::model()->deleteAll('post_id='.$this->id);\n\t\tAetiquetas::model()->updateFrequency($this->etiquetas, '');\n\t}",
"protected function _postDelete()\n\t{\n\t}",
"public function deleteCommentAction(Comment $comment){\n \n // get current user\n $user = $this->container->get('security.context')->getToken()->getUser();\n \n // check that this comment exists\n if($comment==null){\n return $this->render('InouireMininetBundle:Default:commentAjaxResponse.json.twig',array(\n 'status'=> 'error',\n 'message' => 'comment '+$comment_id+' does not exist'\n ));\n }\n \n // check that the user is the author of this comment\n if($user != $comment->getAuthor() ){\n return $this->render('InouireMininetBundle:Default:commentAjaxResponse.json.twig',array(\n 'status'=> 'error',\n 'message' => 'you are not the author of comment '+$comment_id\n ));\n }\n\n // remember the id and the content before deletion\n $comment_id = $comment->getId();\n $comment_content = $comment->getContent();\n \n // remove comment\n $em = $this->getDoctrine()->getManager();\n $em->remove($comment);\n $em->flush();\n \n // render json response\n return $this->render('InouireMininetBundle:Default:commentAjaxResponse.json.twig',array(\n 'status'=> 'ok',\n 'message' => 'comment '.$comment_id.' deleted',\n 'comment_id' => $comment_id,\n 'comment_content' => $comment_content\n ));\n }",
"public function destroy(Comment $comment)\n {\n //\n }",
"public function destroy(Comment $comment)\n {\n //\n }",
"public function destroy(Comment $comment)\n {\n //\n }",
"public function destroy(Comment $comment)\n {\n //\n }",
"public function destroy(Comment $comment)\n {\n //\n }",
"public function destroy(Comment $comment)\n {\n //\n }",
"public function destroy(Comment $comment)\n {\n //\n }"
] | [
"0.7047508",
"0.7028126",
"0.69332653",
"0.68768203",
"0.6710585",
"0.6647362",
"0.6602968",
"0.65754384",
"0.6566839",
"0.65600544",
"0.647984",
"0.6473691",
"0.64649445",
"0.6428245",
"0.6419869",
"0.6408262",
"0.6363491",
"0.6354017",
"0.63304913",
"0.63261294",
"0.6281547",
"0.6250159",
"0.62178487",
"0.62152255",
"0.62152255",
"0.62152255",
"0.62152255",
"0.62152255",
"0.62152255",
"0.62152255"
] | 0.77494204 | 0 |
Alter the results of entity_view() for ckeditor_comment. | function hook_ckeditor_comment_view_alter($build) {
if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {
// Change its weight.
$build['an_additional_field']['#weight'] = -10;
// Add a #post_render callback to act on the rendered HTML of the entity.
$build['#post_render'][] = 'my_module_post_render';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_ckeditor_comment_update(CKEditorComment $ckeditor_comment) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment, TRUE)))\n ->condition('id', entity_id('ckeditor_comment', $ckeditor_comment))\n ->execute();\n}",
"function hook_ckeditor_comment_type_update(CKEditorCommentType $ckeditor_comment_type) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment_type, TRUE)))\n ->condition('id', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"public function Cercacommentotesto()\n {\n $view = new VAmministratore();\n $testo = $view->getTesto();\n $utenti = array();\n $pm = FPersistenceManager::getInstance();\n $commenti = $pm->testocommento($testo);\n if (isset($commenti))\n {\n foreach ($commenti as $i)\n {\n $utente = $pm->Load($i->getUtente()->getId(),'FUtente_R');\n array_push($utenti, $utente);\n }\n }\n $view = new VAmministratore();\n $view->GestioneCommenti($commenti,$utenti,1,true);\n }",
"function hook_ckeditor_comment_type_load(array $entities) {\n $result = db_query('SELECT pid, foo FROM {mytable} WHERE pid IN(:ids)', array(':ids' => array_keys($entities)));\n foreach ($result as $record) {\n $entities[$record->pid]->foo = $record->foo;\n }\n}",
"function hook_ckeditor_comment_view($ckeditor_comment, $view_mode, $langcode) {\n $ckeditor_comment->content['my_additional_field'] = array(\n '#markup' => $additional_field,\n '#weight' => 10,\n '#theme' => 'mymodule_my_additional_field',\n );\n}",
"public function comments_migration() {\n $query = \\Drupal::database()->select('z_old_d7_comment_data', 'c_d');\n $query->fields('c_d', ['cid', 'pid', 'nid', 'uid_new', 'subject', 'hostname', 'created', 'changed', 'status', 'thread', 'name', 'mail', 'homepage', 'language', 'entity_type', 'bundle', 'comment_body_value', 'comment_body_format', 'move_status']);\n $query->condition('move_status', '0', '='); //This record is ready to process and Status - 0\n $query->orderBy('nid', 'ASC');\n $query->range(0, 20); \n $z_results = $query->execute()->fetchAll();\n\n\n$fp = fopen(\"comments.txt\",\"a+\");\n fwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n fwrite($fp, \"Start-------------\".date(\"Y-m-d H:i:s\").\"-----------------\");\n fwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n\n\n foreach ($z_results as $z_result) {\n //Update Status - This record is inprocess and Set - Status - 1\n $upd1 = \\Drupal::database()->update('z_old_d7_comment_data');\n $upd1->fields(['move_status' =>1,]);\n $upd1->condition('cid', $z_result->cid, '=');\n $upd1->execute();\n\n\nfwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n fwrite($fp, \"--\");\n fwrite($fp, $z_result->cid);\n fwrite($fp, \"--\");\n fwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n\n\n\t $values = [\n 'cid' => $z_result->cid,\n\t\t 'pid' => $z_result->pid,\n 'entity_type' => 'node',\n 'field_name' => 'comment',\n 'entity_id' => $z_result->nid,\n 'uid' => $z_result->uid_new,\n\t 'status' => $z_result->status,\n 'comment_type' => 'comment',\n 'subject' => $z_result->subject,\n\t\t\t 'comment_body' => array('value' => $z_result->comment_body_value, 'format' => $z_result->comment_body_format,),\n\t\t\t 'name' => $z_result->name,\n\t\t\t 'mail' => $z_result->mail,\n\t\t\t 'created' => $z_result->created,\n\t\t\t 'changed' => $z_result->changed,\n\t\t 'thread' => $z_result->thread,\n ];\n $comment = Comment::create($values); // This will create an actual comment entity out of our field values.\n $comment->save();\n\n //Update actual Host IP address\n\t $upd_host = \\Drupal::database()->update('comment_field_data');\n $upd_host->fields(['hostname' => $z_result->hostname,]);\n $upd_host->condition('cid', $z_result->cid, '=');\n $upd_host->execute();\n\n\n //Update actual Comment Statistics\n $s_query = \\Drupal::database()->select('z_old_d7_comment_statistics', 'cs');\n $s_query->fields('cs', ['nid', 'cid', 'last_comment_timestamp', 'last_comment_name', 'uid_new', 'comment_count']);\n $s_query->condition('nid', $z_result->nid, '=');\n $s_results = $s_query->execute()->fetchAll();\n\n\t $upd_cs = \\Drupal::database()->update('comment_entity_statistics');\n $upd_cs->fields(['cid' => $s_results[0]->cid, 'last_comment_timestamp' => $s_results[0]->last_comment_timestamp, 'last_comment_name' => $s_results[0]->last_comment_name, 'last_comment_uid' => $s_results[0]->uid_new, 'comment_count' => $s_results[0]->comment_count,]);\n $upd_cs->condition('entity_id', $s_results[0]->nid, '=');\n $upd_cs->execute();\n\n\t //Update Status - This record has been processed and Set - Status - 2\n $upd = \\Drupal::database()->update('z_old_d7_comment_data');\n $upd->fields(['move_status' =>2,]);\n $upd->condition('cid', $z_result->cid, '=');\n $upd->execute();\n }//end for loop\n\nfwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n fwrite($fp, \"END-------------\".date(\"Y-m-d H:i:s\").\"-----------------\").PHP_EOL;\n fclose($fp);\n\n\n return array('#title' => \"Comments - Migration\", '#markup' => \"This is comment section\",);\n}",
"function hook_ckeditor_comment_insert(CKEditorComment $ckeditor_comment) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment', $ckeditor_comment),\n 'extra' => print_r($ckeditor_comment, TRUE),\n ))\n ->execute();\n}",
"function comment_view( $comments = '', $mode = 'thread' ) {\n\t\t\n\t\tif ( !isset( $comments['items'] ) ) {return '<p class=\"list-comment-no-comment no-comment\">'.$this->lang->line( 'comment_no_comment' ).'</p>';}\n\t\t\n\t\t$cm_account = $this->account_model->get_account_cookie( 'member' );\n\t\t$account_id = $cm_account['id'];\n\t\tif ( $account_id == null ) {$account_id = '0';}\n\t\t\n\t\t//\n\t\t$stack = 1;\n\t\t$output = '';\n\t\t//$output .= '<article>'.$row->comment_body_value.' - id:'.$row->comment_id.' - parent:'.$row->parent_id.' - thread:'.$row->thread.'</article>'.\"\\n\";// prototype\n\t\tif ( is_array( $comments['items'] ) ) {\n\t\t\t\n\t\t\tforeach ( $comments['items'] as $comment ) {\n\t\t\t\tif ( $mode == 'thread' ) {\n\t\t\t\t\t$stack = count( explode( '.', $comment->thread ) );\n\t\t\t\t\tif ( ( $stack > $this->comments_model->divs ) ) {\n\t\t\t\t\t\tfor ( $i = $this->comments_model->divs; $i < $stack; $i++ ) {\n\t\t\t\t\t\t\t$output .= '<div class=\"indent\">'.\"\\n\";\n\t\t\t\t\t\t\t$this->comments_model->divs = ($this->comments_model->divs+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( $stack < $this->comments_model->divs ) {\n\t\t\t\t\t\t$back_stack = (($this->comments_model->divs)-$stack);\n\t\t\t\t\t\tfor ( $i = 0; $i < $back_stack; $i++ ) {\n\t\t\t\t\t\t\t$output .= '</div>'.\"\\n\";\n\t\t\t\t\t\t\t$this->comments_model->divs = ($this->comments_model->divs-1);\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// send object to view for use.\n\t\t\t\t$outval['comment'] = $comment;\n\t\t\t\t\n\t\t\t\t// show avatar url\n\t\t\t\tif ( $comment->account_avatar != null ) {\n\t\t\t\t\t$outval['comment_avatar'] = base_url().$comment->account_avatar;\n\t\t\t\t} else {\n\t\t\t\t\t$outval['comment_avatar'] = base_url().'public/images/default-avatar.png';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// comment_body_value\n\t\t\t\t$outval['comment_content'] = $this->comments_model->modify_content( $comment->comment_body_value );\n\t\t\t\t\n\t\t\t\t// comment class\n\t\t\t\t$outval['comment_class'] = ($comment->comment_status == '1' ? 'comment-approved' : 'comment-un-approve' );\n\t\t\t\t\n\t\t\t\t// check edit comment permission.------------------------\n\t\t\t\t$outval['comment_edit_permission'] = true;\n\t\t\t\tif ( $this->account_model->check_admin_permission( 'comment_perm', 'comment_edit_own_perm', $account_id ) && $comment->c1_account_id != $account_id ) {\n\t\t\t\t\tif ( !$this->account_model->check_admin_permission( 'comment_perm', 'comment_edit_other_perm', $account_id ) ) {\n\t\t\t\t\t\t$outval['comment_edit_permission'] = false;\n\t\t\t\t\t}\n\t\t\t\t} elseif ( !$this->account_model->check_admin_permission( 'comment_perm', 'comment_edit_own_perm', $account_id ) && $comment->c1_account_id == $account_id ) {\n\t\t\t\t\t$outval['comment_edit_permission'] = false;\n\t\t\t\t} elseif ( !$this->account_model->check_admin_permission( 'comment_perm', 'comment_edit_own_perm', $account_id ) && !$this->account_model->check_admin_permission( 'comment_perm', 'comment_edit_other_perm', $account_id ) ) {\n\t\t\t\t\t$outval['comment_edit_permission'] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check delete comment permission.------------------------------\n\t\t\t\t$outval['comment_delete_permission'] = true;\n\t\t\t\tif ( $this->account_model->check_admin_permission( 'comment_perm', 'comment_delete_own_perm', $account_id ) && $comment->c1_account_id != $account_id ) {\n\t\t\t\t\tif ( !$this->account_model->check_admin_permission( 'comment_perm', 'comment_delete_other_perm', $account_id ) ) {\n\t\t\t\t\t\t$outval['comment_delete_permission'] = false;\n\t\t\t\t\t}\n\t\t\t\t} elseif ( !$this->account_model->check_admin_permission( 'comment_perm', 'comment_delete_own_perm', $account_id ) && $comment->c1_account_id == $account_id ) {\n\t\t\t\t\t$outval['comment_delete_permission'] = false;\n\t\t\t\t} elseif ( !$this->account_model->check_admin_permission( 'comment_perm', 'comment_delete_own_perm', $account_id ) && !$this->account_model->check_admin_permission( 'comment_perm', 'comment_delete_other_perm', $account_id ) ) {\n\t\t\t\t\t$outval['comment_delete_permission'] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check add/reply comment permission-----------------------------\n\t\t\t\t$outval['comment_postreply_permission'] = false;\n\t\t\t\tif ( $this->account_model->check_admin_permission( 'comment_perm', 'comment_allowpost_perm', $account_id ) ) {\n\t\t\t\t\t$outval['comment_postreply_permission'] = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//----------------------------------------------------------------------------------------------------\n\t\t\t\t$output .= '<a id=\"comment-id-'.$comment->comment_id.'\"></a>'.\"\\n\";\n\t\t\t\t$output .= $this->load->view( 'front/templates/comment/a_comment', $outval, true );\n\t\t\t}// endforeach\n\t\t\tunset( $outval );\n\t\t\t\n\t\t\t// clear stack div in thread mode\n\t\t\tif ( $mode == 'thread' ) {\n\t\t\t\tfor ( $i = $this->comments_model->divs; $i > 1; $i-- ) {\n\t\t\t\t\t$output .= '</div>'.\"\\n\";\n\t\t\t\t\t$this->comments_model->divs = ($this->comments_model->divs-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn $output;\n\t}",
"function index() {\r\n\t $this->comments = $this->Comment->findAll();\t \r\n\t}",
"function relevanssi_comment_edit($comID) {\n\trelevanssi_comment_index($comID,$action=\"update\");\n}",
"public function change()\n {\n // $q = $this->execute('CREATE VIEW `view_article_category` AS select `c`.`slug` AS `category_slug`,`articles`.`id` AS `id`,`articles`.`slug` AS `slug`,`articles`.`title` AS `title`,`articles`.`desciption` AS `desciption`,`articles`.`content` AS `content`,`articles`.`thumbnail` AS `thumbnail`,`articles`.`source_id` AS `source_id`,`articles`.`status` AS `status`,`articles`.`created` AS `created`,`articles`.`updated` AS `updated`,`articles`.`published` AS `published`, `sources`.`name` AS `url_name`, `sources`.`url` AS `url` from ((`categories` `c` left join `article_category` `ac` on((`c`.`id` = `ac`.`category_id`))) left join `articles` on((`articles`.`id` = `ac`.`article_id`)) left join `sources` on((`sources`.`id` = `articles`.`source_id`)))');\n $q = $this->execute('CREATE VIEW view_article_category AS select c.slug AS category_slug,articles.id AS id,articles.slug AS slug,articles.title AS title,articles.desciption AS desciption,articles.content AS content,articles.thumbnail AS thumbnail,articles.source_id AS source_id,articles.status AS status,articles.created AS created,articles.updated AS updated,articles.published AS published, sources.name AS url_name, sources.url AS url from ((categories c left join article_category ac on((c.id = ac.category_id))) left join articles on((articles.id = ac.article_id)) left join sources on((sources.id = articles.source_id)))');\n }",
"public function afterSave() {\n if ($this->modx->modxtalks->mtCache === true) {\n if (!$this->modx->modxtalks->cacheComment($this->object)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache comment error, ID ' . $this->object->id);\n }\n if (!$this->modx->modxtalks->cacheConversation($this->theme)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache conversation error, ID ' . $this->theme->id);\n }\n }\n\n return parent::afterSave();\n }",
"public function _callback_field_comments($value, $primary_key){\n // Options for detail table's column with SET type\n $set_column_option_list = array();\n // Options for detail table's column with ENUM type\n $enum_column_option_list = array();\n // Detail table's one-to-many columns configurations\n $lookup_config_list = array();\n // Detail table's many-to-many columns configurations\n $many_to_many_config_list = array();\n // Prepare the data by using defined configurations and options\n $data = $this->_one_to_many_callback_field_data(\n 'comment', // DETAIL TABLE NAME\n 'comment_id', // DETAIL PK NAME\n 'article_id', // DETAIL FK NAME\n $primary_key, // CURRENT TABLE PK VALUE\n $lookup_config_list, // LOOKUP CONFIGS\n $many_to_many_config_list, // MANY TO MANY CONFIGS\n $set_column_option_list, // SET OPTIONS\n $enum_column_option_list // ENUM OPTIONS\n );\n for($i=0; $i<count($data['result']); $i++){\n if($data['result'][$i]['name'] == '' && $data['result'][$i]['author_user_id'] != ''){\n $user = $this->cms_get_record($this->cms_user_table_name(), 'user_id', $data['result'][$i]['author_user_id']);\n $data['result'][$i]['name'] = $user->real_name == '' ? $user->user_name : $user->real_name;\n }\n }\n // Parse the data to the view\n return $this->load->view($this->cms_module_path().'/field_article_comments',$data, TRUE);\n }",
"function content_resource_comments($parameter , $nid){\n global $user;\n\n $likes = db_select(\"clapping\" , \"likes\");\n $likes->fields(\"likes\" , array(\"entity_id\"));\n $likes->addExpression(\"SUM(vote)\" , \"likes\");\n $likes->groupBy(\"entity_id\");\n $likes->condition(\"likes.entity_type\" , \"comment\");\n $likes->condition(\"likes.bundle\" , \"comment\");\n\n /*query fetch the just the parent comments*/\n $query = db_select(\"comment\" , \"comment\");\n $query->join(\"field_data_comment_body\" , \"body\" , \"body.entity_id = comment.cid\");\n $query->join(\"users\" , \"user\" , \"user.uid = comment.uid\");\n $query->leftJoin(\"field_data_field_full_name\" , \"full_name\" , \"full_name.entity_id = user.uid and full_name.entity_type = 'user' \");\n $query->leftJoin(\"file_managed\" , \"user_pic\" , \"user_pic.fid = user.picture\");\n $query->leftJoin(\"clapping\" , \"user_like\" , \"comment.cid = user_like.entity_id and user_like.entity_type = 'comment' and user_like.uid = ' \" . $user->uid . \" ' \");\n $query->leftJoin($likes , \"likes\" , \"comment.cid = likes.entity_id\");\n $query->fields(\"comment\" , array(\"cid\" , \"pid\" , \"uid\" , \"created\" , \"changed\"));\n $query->addField(\"body\" , \"comment_body_value\" , \"body\");\n $query->addField(\"user\" , \"name\" , \"author_username\");\n $query->addField(\"full_name\" , \"field_full_name_value\" , \"author_name\");\n $query->addField(\"user_pic\" , \"uri\" , \"author_pic\");\n $query->addField(\"user_like\" , \"vote\" , \"user_like\");\n $query->addField(\"likes\" , \"likes\" , \"likes\");\n $query->condition(\"comment.nid\" , $nid);\n $query->condition(\"comment.pid\" , 0);\n $query->orderBy(\"comment.cid\" , \"ASC\");\n $query->range(isset($parameter[\"page\"])? $parameter[\"page\"]*30 : 0 , 30);\n\n /*query fetch the just the children of the parent comments*/\n $subquery = db_select(\"comment\" , \"comment\");\n $subquery->join($query , \"parent\" , \"parent.cid = comment.pid\");\n $subquery->join(\"field_data_comment_body\" , \"body\" , \"body.entity_id = comment.cid\");\n $subquery->join(\"users\" , \"user\" , \"user.uid = comment.uid\");\n $subquery->leftJoin(\"field_data_field_full_name\" , \"full_name\" , \"full_name.entity_id = user.uid and full_name.entity_type = 'user' \");\n $subquery->leftJoin(\"file_managed\" , \"user_pic\" , \"user_pic.fid = user.picture\");\n $subquery->leftJoin(\"clapping\" , \"user_like\" , \"comment.cid = user_like.entity_id and user_like.entity_type = 'comment' and user_like.uid = ' \" . $user->uid . \" ' \");\n $subquery->leftJoin($likes , \"likes\" , \"comment.cid = likes.entity_id\");\n $subquery->fields(\"comment\" , array(\"cid\" , \"pid\" , \"uid\" , \"created\" , \"changed\"));\n $subquery->addField(\"body\" , \"comment_body_value\" , \"body\");\n $subquery->addField(\"user\" , \"name\" , \"author_username\");\n $subquery->addField(\"full_name\" , \"field_full_name_value\" , \"author_name\");\n $subquery->addField(\"user_pic\" , \"uri\" , \"author_pic\");\n $subquery->addField(\"user_like\" , \"vote\" , \"user_like\");\n $subquery->addField(\"likes\" , \"likes\" , \"likes\");\n $subquery->orderBy(\"comment.cid\" , \"ASC\");\n\n $comments = $query->execute()->fetchAll();\n $children = $subquery->execute()->fetchAll();\n\n $associate_comments = array();\n foreach ($comments as $comment){\n $comment->replies = array();\n $comment->user_like = empty($comment->user_like) ? false : true;\n $comment->likes = empty($comment->likes) ? 0 : (int) $comment->likes;\n $comment->created = date(\"F j, Y\" , $comment->created);\n $comment->changed = date(\"F j, Y\" , $comment->changed);\n if(!empty($comment->author_pic)) $comment->author_pic = image_style_url(\"200x200\", $comment->author_pic);\n $associate_comments[$comment->cid] = $comment;\n }\n foreach ($children as $child){\n if(isset($associate_comments[$child->pid])) {\n $child->user_like = empty($child->user_like) ? false : true;\n $child->likes = empty($child->likes) ? 0 : (int) $child->likes;\n $child->created = date(\"F j, Y\" , $child->created);\n $child->changed = date(\"F j, Y\" , $child->changed);\n if(!empty($child->author_pic)) $child->author_pic = image_style_url(\"200x200\", $child->author_pic);\n array_push($associate_comments[$child->pid]->replies, $child);\n }\n }\n $comments = array_values($associate_comments);\n\n return $comments;\n}",
"function COXYMallComments() {\r\n\t}",
"public function showNewComment(){\n $entityManager = $this->getDoctrine()->getManager();\n\n $comments = $entityManager->getRepository(\"AppBundle:Comment\")->findBy(array(\"new\"=>true));\n\n return $this->render('BackendBundle:comment:show_new_comment.html.twig', array(\n 'comments' => $comments,\n ));\n }",
"public function detailAction(){\r\n\r\n //param\r\n $userstory_id = $this->_getParam('id');\r\n $title = $this->_getParam('title');\r\n $type = $this->_getParam('type');\r\n \r\n //untuk comment\r\n $contentType = 3;\r\n\r\n //echo $this->_languageId; \r\n ////model\r\n $model = new Model_UserContributor();\r\n $commentDb = new Model_DbTable_Comment;\r\n \r\n $detail = $model->contentDetail($userstory_id, $this->_languageId);\r\n if($detail)\r\n {\r\n //update viewd counter\r\n $viewed = $model->getViewed($userstory_id);\r\n $model->updateViewed($userstory_id, $viewed['viewed']+1);\r\n\r\n $this->view->detail = $detail;\r\n $this->view->content_type = $type;\r\n\r\n $comment_parent = $commentDb->getAllByContentTypeFix($userstory_id, $contentType);\r\n $this->view->comments = $comment_parent;\r\n $this->view->contentType = $contentType;\r\n $this->view->id = $userstory_id;\r\n $this->view->category = $type;\r\n\r\n //////Form\r\n $commentForm = new Form_CommentForm;\r\n\r\n // Request dari Comment Form\r\n if($this->getRequest()->isPost())\r\n {\r\n if($commentForm->isValid($this->getRequest()->getPost()))\r\n {\r\n\r\n $autor = (isset($_POST['author']))? $_POST['author'] : \"\";\r\n $email = (isset($_POST['email']))? $_POST['email'] : \"\";\r\n $website = (isset($_POST['website']))? $_POST['website'] : \"\";\r\n\r\n $input = array(\r\n 'author' => $autor,\r\n 'email' => $email,\r\n 'website' => $website,\r\n 'comment' => $_POST['comment'],\r\n 'parent_id'=>0,\r\n 'level'=>0\r\n );\r\n\r\n //print_r($input);\r\n\r\n // Insert\r\n $commentId = $commentDb->insertCommentUsercon($userstory_id, $contentType, $input, $this->_sess->userId,$this->_sess->fbname);\r\n\r\n // Reset form\r\n $commentForm->reset();\r\n\r\n // Redirect\r\n $this->_redirector->gotoUrl($this->view->currentUrl());\r\n }\r\n }\r\n\r\n $commentForm->setAttrib('action', $this->view->currentUrl());\r\n $this->view->commentForm = $commentForm;\r\n\r\n\r\n }\r\n else{\r\n $this->_redirector->gotoUrl($this->view->baseUrl('usercontributor'));\r\n }\r\n }",
"public function renderFlatView($admin_view = false)\n {\n foreach ($this->_comments as $i => $comment) {\n /* @var $comment XoopsComment */\n if (false != $this->_useIcons) {\n $title = $this->_getTitleIcon($comment->getVar('icon')) . ' ' . $comment->getVar('title');\n } else {\n $title = $comment->getVar('title');\n }\n $poster = $this->_getPosterArray($comment->getVar('uid'));\n if (false != $admin_view) {\n $text = $comment->getVar('text') . '<div style=\"text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;\">' . _MD_COMMENTS_STATUS . ': ' . $this->_statusText[$comment->getVar('status')] . '<br />IP: <span style=\"font-weight: bold;\">' . $comment->getVar('ip') . '</span></div>';\n } else {\n // hide comments that are not active\n if (COMMENTS_ACTIVE != $comment->getVar('status')) {\n continue;\n } else {\n $text = $comment->getVar('text');\n }\n }\n $this->_comments[$i] = $comment;\n $this->_tpl->append('comments', array(\n 'id' => $comment->getVar('id'),\n 'title' => $title,\n 'text' => $text,\n 'date_posted' => XoopsLocale::formatTimestamp($comment->getVar('created'), 'm'),\n 'date_modified' => XoopsLocale::formatTimestamp($comment->getVar('modified'), 'm'),\n 'poster' => $poster\n ));\n }\n }",
"public function comments();",
"protected function _execute() {\r\n\t\t$commentDao = Dao::getInstance('comment');\r\n\t\t$comments = $commentDao->findBySubject($this->get('section'));\r\n\t\t\r\n\t\t// Content\r\n\t\t$content = View::create('view/zone/comments.php');\r\n\t\t$content->set('comments', $comments);\r\n\t\t\r\n\t\treturn $content;\r\n\t}",
"function post_comment_report() {\n $query = \"select uc.id as id,\nuc.comment as comment, \nau.user_type,\nup.category_name,\nuc.file_name as filename,\nuc.op_date_time as datetime,\nau.first_name, au.last_name, au.email,\nup.title\nfrom user_comment as uc\nleft join admin_users as au on au.id = uc.user_id\nleft join user_post as up on up.id = uc.post_id\norder by uc.id desc\";\n $data['data'] = $this->Product_model->query_exe($query);\n $this->load->view('queryManager/postCommentReport', $data);\n }",
"public function getMyComments() {\r\n\r\n //arrendador\r\n $q = \"SELECT fecha_calificacion_owner, idOwner, opinion_about_renter FROM rating WHERE state_owner=1 and idRenter=\" . $this->getId();\r\n $query = Doctrine_Query::create()->query($q);\r\n $arrendador = $query->toArray();\r\n\r\n //arrendatario(propietario)\r\n $q = \"SELECT fecha_calificacion_renter, idRenter, opinion_about_owner FROM rating WHERE state_renter=1 and idOwner=\" . $this->getId();\r\n $query = Doctrine_Query::create()->query($q);\r\n $arrendatario = $query->toArray();\r\n\r\n for ($i = 0; $i < count($arrendador); $i++) {\r\n $id = $arrendador[$i]['idOwner'];\r\n\r\n $q = \"SELECT firstname, lastname, picture_file, facebook_id FROM user WHERE id=\" . $id;\r\n $query = Doctrine_Query::create()->query($q);\r\n $user = $query->toArray();\r\n\r\n $comentarios[$i]['nombre'] = $user[0]['firstname'];\r\n $comentarios[$i]['apellido'] = $user[0]['lastname'];\r\n\r\n if ($user[0]['facebook_id'] != null) {\r\n $comentarios[$i]['facebook'] = true;\r\n } else {\r\n $comentarios[$i]['facebook'] = false;\r\n }\r\n\r\n $comentarios[$i]['urlFoto'] = $user[0]['picture_file'];\r\n\r\n $fecha = $arrendador[$i]['fecha_calificacion_owner'];\r\n $fecha = strtotime($fecha);\r\n $comentarios[$i]['posicion'] = $fecha;\r\n $fecha = date(\"d-m-Y\", $fecha);\r\n\r\n $comentarios[$i]['fecha'] = $fecha;\r\n $comentarios[$i]['idEvaluador'] = $arrendador[$i]['idOwner'];\r\n $comentarios[$i]['texto'] = $arrendador[$i]['opinion_about_renter'];\r\n }\r\n\r\n for ($j = 0; $j < count($arrendatario); $j++) {\r\n\r\n $id = $arrendatario[$j]['idRenter'];\r\n\r\n $q = \"SELECT firstname, lastname, picture_file, facebook_id FROM user WHERE id=\" . $id;\r\n $query = Doctrine_Query::create()->query($q);\r\n $user = $query->toArray();\r\n\r\n $comentarios[$i + $j]['nombre'] = $user[0]['firstname'];\r\n $comentarios[$i + $j]['apellido'] = $user[0]['lastname'];\r\n $comentarios[$i + $j]['urlFoto'] = $user[0]['picture_file'];\r\n\r\n if ($user[0]['facebook_id'] != null) {\r\n $comentarios[$i + $j]['facebook'] = true;\r\n } else {\r\n $comentarios[$i + $j]['facebook'] = false;\r\n }\r\n\r\n $fecha = $arrendatario[$j]['fecha_calificacion_renter'];\r\n $fecha = strtotime($fecha);\r\n\r\n $comentarios[$i + $j]['posicion'] = $fecha;\r\n\r\n $fecha = date(\"d-m-Y\", $fecha);\r\n\r\n $comentarios[$i + $j]['fecha'] = $fecha;\r\n $comentarios[$i + $j]['idEvaluador'] = $arrendatario[$j]['idRenter'];\r\n $comentarios[$i + $j]['texto'] = $arrendatario[$j]['opinion_about_owner'];\r\n }\r\n\r\n //$comentarios = array_multisort($comentarios[0]['posicion'],$comentarios);\r\n //$comentarios = usort($comentarios, '$this->ordenDesc');\r\n //var_dump($comentarios);\r\n //die();\r\n //ordena los comentarios por fecha\r\n $comentariosAux = array();\r\n $j = 0;\r\n\r\n do {\r\n $menor = 0;\r\n\r\n for ($i = 1; $i < count($comentarios); $i++) {\r\n\r\n if ($comentarios[$i]['posicion'] < $comentarios[$menor]['posicion']) {\r\n $menor = $i;\r\n }\r\n }\r\n\r\n $comentariosAux[$j] = $comentarios[$menor];\r\n //elimina la posicion del array $comentarios\r\n unset($comentarios[$menor]);\r\n $comentarios = array_values($comentarios);\r\n $j++;\r\n } while ($comentarios);\r\n\r\n //var_dump($comentariosAux);\r\n //die();\r\n\r\n return $comentariosAux;\r\n }",
"public function setC(){\r\n\r\n if (isset($_POST['comment']) && $this->e->get('uid')) {\r\n\r\n $this->v->required($_POST['comment'], 'comment tidak boleh kosong');\r\n $this->v->regex($_POST['comment'], '/^(.|\\n){4,400}$/', # nanti dihapus\r\n '4-400 any dan spasi');\r\n\r\n if(!sizeof($this->v->errors)) \r\n {\r\n # CHECK POST IS HUMAN\r\n if ($this->f->checkHumanPost(3)) {\r\n\r\n # RENDER COMMENT\r\n $r = $this->__commentRender($_POST['comment']);\r\n\r\n # SETTING UP\r\n $p['comment'] = $r['text'];\r\n\r\n # START PLUGIN\r\n $m = new Engine\\Vendors\\Stackexchangeinc\\wmd\\ElephantMarkdown;\r\n $vendorHTMLpurifier = new Engine\\Vendors\\HTMLpurifier\\HTMLpurifier;\r\n $HTMLpurifierConfig = HTMLPurifier_Config::createDefault();\r\n $HTMLpurifierConfig->set('HTML.SafeObject', \"1\");\r\n $HTMLpurifierConfig->set('Output.FlashCompat', \"1\");\r\n $HTMLpurifierConfig->set('Filter.YouTube', \"1\");\r\n $purifier = new HTMLPurifier($HTMLpurifierConfig);\r\n $data['comment_html'] = $purifier->purify($m->parse($p['comment']));\r\n # END PLUGIN\r\n\r\n $data['comment_UID'] = $this->e->get('uid');\r\n $data['comment_PID'] = $_POST['id']; \r\n $time = new DateTime ( NULL, new DateTimeZone ( 'Asia/Jakarta' ) );\r\n $data['time_create'] = $time->format('Y-m-d H:i:s');\r\n $m = new Apps\\Netcoid\\Models\\Mentions;\r\n\r\n # SET COMMENT\r\n $c = new Apps\\Netcoid\\Models\\Comments;\r\n $p = new Apps\\Netcoid\\Models\\Posts;\r\n\r\n $c->set($data);\r\n \r\n # TAMBAH SATU REPLY\r\n $p->addReply1($data['comment_PID']);\r\n\r\n # SET MENTION IF THERE IS SOME USERNAME IN COMMENT\r\n if (!empty($r['usernames'])) {\r\n $m->set($c->getLastId(), $r['usernames']);\r\n }\r\n $this->h->setMessage('Comment Posted'); \r\n header('Location: /post?id='.$_POST['id'] );\r\n } \r\n }\r\n\r\n if(sizeof($this->v->errors)) \r\n {\r\n $this->h->setError($this->v->errors[0]); \r\n header('Location: /post?id='.$_POST['id'] );\r\n }\r\n \r\n } else {\r\n die('[email protected]');\r\n }\r\n }",
"public function comment(){\r\n\t\t// $data['heading'] = \"Comment My Favourite book\";\r\n\t\t$this->load->model('book');\r\n\t\t$data['query'] = $this->book->get_all();\r\n\t\t$this->load->view('comment', $data);\r\n\t}",
"function test_getComment() {\r\n\t\t$testResults1 = CommentDB::getComment($this->rowset);\r\n\t\t$this->validate($testResults1, $this->rowset);\r\n\t}",
"public function renderNestView($comment_id = 0, $admin_view = false)\n {\n $xot = new XoopsObjectTree($this->_comments, 'id', 'pid', 'rootid');\n $tree = $xot->getTree();\n if (false != $this->_useIcons) {\n $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('icon')) . ' ' . $tree[$comment_id]['obj']->getVar('title');\n } else {\n $title = $tree[$comment_id]['obj']->getVar('title');\n }\n if (false != $admin_view) {\n $text = $tree[$comment_id]['obj']->getVar('text') . '<div style=\"text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;\">' . _MD_COMMENTS_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('status')] . '<br />IP: <span style=\"font-weight: bold;\">' . $tree[$comment_id]['obj']->getVar('ip') . '</span></div>';\n } else {\n // skip this comment if it is not active and continue on processing its child comments instead\n if (COMMENTS_ACTIVE != $tree[$comment_id]['obj']->getVar('status')) {\n // if there are any child comments, display them as root comments\n if (isset($tree[$comment_id]['child']) && !empty($tree[$comment_id]['child'])) {\n foreach ($tree[$comment_id]['child'] as $child_id) {\n $this->renderNestView($child_id, $admin_view);\n }\n }\n return;\n } else {\n $text = $tree[$comment_id]['obj']->getVar('text');\n }\n }\n $replies = array();\n $this->_renderNestReplies($tree, $comment_id, $replies, 25, $admin_view);\n $this->_tpl->append('comments', array(\n 'pid' => $tree[$comment_id]['obj']->getVar('pid'),\n 'id' => $tree[$comment_id]['obj']->getVar('id'),\n 'itemid' => $tree[$comment_id]['obj']->getVar('itemid'),\n 'rootid' => $tree[$comment_id]['obj']->getVar('rootid'),\n 'title' => $title,\n 'text' => $text,\n 'date_posted' => XoopsLocale::formatTimestamp($tree[$comment_id]['obj']->getVar('created'), 'm'),\n 'date_modified' => XoopsLocale::formatTimestamp($tree[$comment_id]['obj']->getVar('modified'), 'm'),\n 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('uid')),\n 'replies' => $replies\n ));\n }",
"public function imported_comment() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'comments',\n\t\t\t'delta' => 1,\n\t\t));\n\t}",
"function qedcities_view_entity($entity, $view_mode = 'full') {\n $entity_type = $entity->entityType();\n $entity_id = entity_id($entity_type, $entity);\n\n $entity->content = array();\n\n $entity->title = filter_xss($entity->city_name);\n\n // Build the fields content\n field_attach_prepare_view($entity_type, array($entity_id => $entity), $view_mode);\n entity_prepare_view($entity_type, array($entity_id => $entity));\n\n $entity->content += field_attach_view($entity_type, $entity, $view_mode);\n\n $entity->content += array(\n '#theme' => 'cities_entity_view',\n '#element' => $entity,\n '#view_mode' => $view_mode,\n '#language' => LANGUAGE_NONE,\n );\n return $entity->content;\n}",
"public function comments()\n\t{\n\t\treturn new Engine_ProxyObject($this, Engine_Api::_() -> getDbtable('comments', 'core'));\n\t}",
"function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {\n $ckeditor_comment->name = 'foo';\n}"
] | [
"0.6462366",
"0.5953931",
"0.5823414",
"0.5822988",
"0.57536364",
"0.56850594",
"0.5611492",
"0.560597",
"0.5564926",
"0.5530702",
"0.5521846",
"0.5519552",
"0.550013",
"0.54855317",
"0.5454648",
"0.54037166",
"0.5402652",
"0.536541",
"0.53236985",
"0.5321478",
"0.53077036",
"0.5297258",
"0.5285108",
"0.5270824",
"0.52463293",
"0.52392226",
"0.52312016",
"0.5228239",
"0.5222968",
"0.52174497"
] | 0.6222764 | 1 |
Acts on ckeditor_comment_type being loaded from the database. This hook is invoked during ckeditor_comment_type loading, which is handled by entity_load(), via the EntityCRUDController. | function hook_ckeditor_comment_type_load(array $entities) {
$result = db_query('SELECT pid, foo FROM {mytable} WHERE pid IN(:ids)', array(':ids' => array_keys($entities)));
foreach ($result as $record) {
$entities[$record->pid]->foo = $record->foo;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_ckeditor_comment_type_update(CKEditorCommentType $ckeditor_comment_type) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment_type, TRUE)))\n ->condition('id', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"function hook_ckeditor_comment_type_insert(CKEditorCommentType $ckeditor_comment_type) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment_type', $ckeditor_comment_type),\n 'extra' => print_r($ckeditor_comment_type, TRUE),\n ))\n ->execute();\n}",
"function hook_ckeditor_comment_type_delete(CKEditorCommentType $ckeditor_comment_type) {\n db_delete('mytable')\n ->condition('pid', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"function hook_ckeditor_comment_type_presave(CKEditorCommentType $ckeditor_comment_type) {\n $ckeditor_comment_type->name = 'foo';\n}",
"function hook_default_ckeditor_comment_type() {\n $defaults['main'] = entity_create('ckeditor_comment_type', array(\n // …\n ));\n return $defaults;\n}",
"public function setCommentType($type) {\n $this->_commentType = $type;\n }",
"function hook_default_ckeditor_comment_type_alter(array &$defaults) {\n $defaults['main']->name = 'custom name';\n}",
"function hook_ckeditor_comment_insert(CKEditorComment $ckeditor_comment) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment', $ckeditor_comment),\n 'extra' => print_r($ckeditor_comment, TRUE),\n ))\n ->execute();\n}",
"function hook_ckeditor_comment_update(CKEditorComment $ckeditor_comment) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment, TRUE)))\n ->condition('id', entity_id('ckeditor_comment', $ckeditor_comment))\n ->execute();\n}",
"function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {\n $ckeditor_comment->name = 'foo';\n}",
"function ControlOnLoad(){\n \tDataFactory::GetStorage($this, \"CommentsTable\", \"commentsStorage\");\n \t$this->Page->IncludeTemplate(\"blocks/lastcommentsblock\");\n \t$Count=$this->Page->Kernel->Settings->GetItem(\"MAIN\", \"CommentsBlockCount\");\n \t$this->LastComments=$this->commentsStorage->GetLastComments($Count, $this->CommentLength);\n parent::ControlOnLoad();\n }",
"function hook_ckeditor_comment_delete(CKEditorComment $ckeditor_comment) {\n db_delete('mytable')\n ->condition('pid', entity_id('ckeditor_comment', $ckeditor_comment))\n ->execute();\n}",
"public function onSaving()\n {\n $type = $this->getType();\n $block = $this->getFormEntry();\n\n $block->type = $type->getNamespace();\n }",
"public function afterSave() {\n if ($this->modx->modxtalks->mtCache === true) {\n if (!$this->modx->modxtalks->cacheComment($this->object)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache comment error, ID ' . $this->object->id);\n }\n if (!$this->modx->modxtalks->cacheConversation($this->theme)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache conversation error, ID ' . $this->theme->id);\n }\n }\n\n return parent::afterSave();\n }",
"public function onSaving()\n {\n $entry = $this->getFormEntry();\n if (!$entry->type_id) {\n $entry->type_id = $this->getType()->getId();\n }\n }",
"public function getCommentType() {\r\n\t\treturn isset($this->_comment['comment_type']) ? $this->_comment['comment_type'] : null;\r\n\t}",
"public function setCommentType($arg) {\n $this->_setField(\"commentType\", $arg);\n }",
"public function setCommentType($commentType) {\r\n\t\t$this->_comment['comment_type'] = $commentType;\r\n\t}",
"private function get_type() {\r\n if ($this->post->parent) {\r\n $this->type = 'reply';\r\n } elseif ($this->post->id) {\r\n $this->id = $this->post->id;\r\n $this->type = 'edit';\r\n }\r\n }",
"public function edit(CommentType $commentType)\n {\n //\n }",
"function wine_discussion_comment_override($hook, $type, $return, $params) {\n\tif (elgg_instanceof($params['entity'], 'object', 'wineforumtopic')) {\n\t\treturn false;\n\t}\n}",
"public function testCommentHooks() {\n $account = $this->createUser();\n NodeType::create([\n 'type' => 'article',\n 'name' => 'Article',\n ])->save();\n $this->addDefaultCommentField('node', 'article', 'comment', CommentItemInterface::OPEN);\n\n $node = Node::create([\n 'uid' => $account->id(),\n 'type' => 'article',\n 'title' => 'Test node',\n 'status' => 1,\n 'promote' => 0,\n 'sticky' => 0,\n 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,\n 'created' => REQUEST_TIME,\n 'changed' => REQUEST_TIME,\n ]);\n $node->save();\n $nid = $node->id();\n $GLOBALS['entity_crud_hook_test'] = [];\n\n $comment = Comment::create([\n 'cid' => NULL,\n 'pid' => 0,\n 'entity_id' => $nid,\n 'entity_type' => 'node',\n 'field_name' => 'comment',\n 'uid' => $account->id(),\n 'subject' => 'Test comment',\n 'created' => REQUEST_TIME,\n 'changed' => REQUEST_TIME,\n 'status' => 1,\n 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,\n ]);\n\n $this->assertHookMessageOrder([\n 'entity_crud_hook_test_comment_create called',\n 'entity_crud_hook_test_entity_create called for type comment',\n ]);\n\n $GLOBALS['entity_crud_hook_test'] = [];\n $comment->save();\n\n $this->assertHookMessageOrder([\n 'entity_crud_hook_test_comment_presave called',\n 'entity_crud_hook_test_entity_presave called for type comment',\n 'entity_crud_hook_test_comment_insert called',\n 'entity_crud_hook_test_entity_insert called for type comment',\n ]);\n\n $GLOBALS['entity_crud_hook_test'] = [];\n $comment = Comment::load($comment->id());\n\n $this->assertHookMessageOrder([\n 'entity_crud_hook_test_entity_load called for type comment',\n 'entity_crud_hook_test_comment_load called',\n ]);\n\n $GLOBALS['entity_crud_hook_test'] = [];\n $comment->setSubject('New subject');\n $comment->save();\n\n $this->assertHookMessageOrder([\n 'entity_crud_hook_test_comment_presave called',\n 'entity_crud_hook_test_entity_presave called for type comment',\n 'entity_crud_hook_test_comment_update called',\n 'entity_crud_hook_test_entity_update called for type comment',\n ]);\n\n $GLOBALS['entity_crud_hook_test'] = [];\n $comment->delete();\n\n $this->assertHookMessageOrder([\n 'entity_crud_hook_test_comment_predelete called',\n 'entity_crud_hook_test_entity_predelete called for type comment',\n 'entity_crud_hook_test_comment_delete called',\n 'entity_crud_hook_test_entity_delete called for type comment',\n ]);\n }",
"protected function assertEntity(string $comment_type): void {\n $entity = FieldStorageConfig::load('node.' . $comment_type);\n $this->assertInstanceOf(FieldStorageConfig::class, $entity);\n $this->assertSame('node', $entity->getTargetEntityTypeId());\n $this->assertSame('comment', $entity->getType());\n $this->assertSame($comment_type, $entity->getSetting('comment_type'));\n }",
"public function _replyToFieldLoader() { $this->setUp(); }",
"function projectcommenttypelisting($projecttypeid,$allowed_comment)\r\r\r\r\t{\r\r\r\r\t\t\t\r\r\r\r\t\tApp::import(\"Model\", \"CommentType\");\r\r\r\r\t\t$this->CommentType = &new CommentType();\r\r\r\r\t\r\r\r\r\t\t$commenttypedata = $this->CommentType->find(\"all\", array('conditions' => \"CommentType.id in (select comment_type_id from project_comment_types where project_type_id=$projecttypeid)\")); \r\r\r\r\t\t$commenttypes = Set::combine($commenttypedata, '{n}.CommentType.id', '{n}.CommentType.comment_type_name');\t\r\r\r\r\r\r\r\r\t\tif($allowed_comment==\"1\") $commenttypes['0']=\"Misc. Additional Comment\";\r\r\r\r\t\r\r\r\r\t\t$this->set(\"commenttypedropdown\", $commenttypes);\r\r\r\r\t\t\t\r\r\r\r\t}",
"public function beforeInsertComment($data)\n\t{\n\t $node = $data['_node'];\n\t \t \n $data['node'] = array(\n 'id'\t=>\t$data['nid'],\n\t\t);\n \n\t\t$data['status'] = 'queued';\n \n if (isset($node['name']) && !empty($node['name']))\n $data['node']['name']\t=\t$node['name'];\n else if (isset($node['content']))\n $data['node']['name']\t= word_breadcumb($node['content'], CACHED_POST_TITLE_WORD_LENGTH);\n\t \n if(isset($data['attachments']) && (is_null($data['attachments']) || $data['attachments'] == ''))\n \tunset($data['attachments']);\n \n\t\treturn array('success' => true, 'result' => $data);\n\t}",
"public function getModelType()\n {\n return 'App\\Model\\Comment';\n }",
"protected function onPostLoad($data)\r\n {\r\n $this->id = $data[TipeMobil::C_ID];\r\n $this->type = $data[TipeMobil::C_TYPE];\r\n }",
"public function facebook_comment( $post_id = null, $type = null) {\n\n if( $this->template->is_ajax() ) {\n $post = $this->input->post();\n if(isset($post['message']) && $post_id != null) {\n try {\n $this->load->library('Socializer/socializer');\n $facebook = Socializer::factory('Facebook', $this->c_user->id);\n $comment = $facebook->comment( $post_id, $post['message'] );\n\n if ($comment) {\n if ($type == 'crm') {\n Crm_directory_activity::inst()->update_other_field($post_id, 'comments', 'inc');\n } else {\n Mention::inst()->update_other_field($post_id, 'comments', 'inc');\n }\n\n }\n $result['success'] = true;\n $result['html'] = $this->template->block(\n '_comment',\n 'social/activity/blocks/_one_facebook_comment',\n array('_comment' => $comment, 'socializer' => $facebook, 'radar' => $this->radar)\n );\n } catch(Exception $e) {\n $result = array();\n $result['success'] = false;\n $result['error'] = $e->getMessage();\n }\n if (!empty($result['error'])) {\n $result['error'] = $facebook->facebookErrorTransformer($result['error']);\n }\n \n echo json_encode($result);\n }\n }\n }",
"public function loadComments()\n {\n $comments = [];\n $ths = $this;\n foreach ($this->workitem->{\"rtc_cm:comments\"} as $comment) {\n if (is_object($comment)) {\n $comments[] = Cache::rememberForever(\n 'comment-' . $comment->{\"rdf:resource\"},\n function () use ($comment, $ths) {\n return new Comment($comment->{\"rdf:resource\"}, $ths->rtc);\n }\n );\n }\n }\n $this->comments = collect($comments);\n }"
] | [
"0.6816579",
"0.6587456",
"0.64551497",
"0.64537716",
"0.62733936",
"0.5825388",
"0.5703141",
"0.5662965",
"0.56067836",
"0.5572731",
"0.5549623",
"0.55461526",
"0.55190885",
"0.5485776",
"0.54677546",
"0.5465637",
"0.5451534",
"0.5399802",
"0.5366574",
"0.5347121",
"0.52826226",
"0.5248518",
"0.52328134",
"0.51977277",
"0.51906574",
"0.5149027",
"0.51370716",
"0.5127592",
"0.5118759",
"0.5103409"
] | 0.6732611 | 1 |
Responds when a ckeditor_comment_type is inserted. This hook is invoked after the ckeditor_comment_type is inserted into the database. | function hook_ckeditor_comment_type_insert(CKEditorCommentType $ckeditor_comment_type) {
db_insert('mytable')
->fields(array(
'id' => entity_id('ckeditor_comment_type', $ckeditor_comment_type),
'extra' => print_r($ckeditor_comment_type, TRUE),
))
->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_ckeditor_comment_type_presave(CKEditorCommentType $ckeditor_comment_type) {\n $ckeditor_comment_type->name = 'foo';\n}",
"function hook_ckeditor_comment_type_update(CKEditorCommentType $ckeditor_comment_type) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment_type, TRUE)))\n ->condition('id', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"public function setCommentType($type) {\n $this->_commentType = $type;\n }",
"function hook_ckeditor_comment_insert(CKEditorComment $ckeditor_comment) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment', $ckeditor_comment),\n 'extra' => print_r($ckeditor_comment, TRUE),\n ))\n ->execute();\n}",
"function hook_ckeditor_comment_type_delete(CKEditorCommentType $ckeditor_comment_type) {\n db_delete('mytable')\n ->condition('pid', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"function hook_default_ckeditor_comment_type_alter(array &$defaults) {\n $defaults['main']->name = 'custom name';\n}",
"function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {\n $ckeditor_comment->name = 'foo';\n}",
"public function setCommentType($commentType) {\r\n\t\t$this->_comment['comment_type'] = $commentType;\r\n\t}",
"function hook_default_ckeditor_comment_type() {\n $defaults['main'] = entity_create('ckeditor_comment_type', array(\n // …\n ));\n return $defaults;\n}",
"public function setCommentType($arg) {\n $this->_setField(\"commentType\", $arg);\n }",
"public function fireNewCommentEvent()\n {\n DomainEventManager::getInstance()->dispatchEvent(DomainEventManager::EVENT_NEWCOMMENT, [ 'urlComment' => $this ]);\n }",
"function mzz_comment_inserted($comment_id, $comment_object) {\n if ($comment_object->comment_type == 'collabpress') {\n \n //the comment type was seen to be collabpress. It was already inserted into the database. Now we go back into the database and update that comment's approved status to 0 (pending)\n $mzzcommentarr = array();\n\t\t$mzzcommentarr['comment_ID'] = $comment_id;\n\t\t$mzzcommentarr['comment_approved'] = 0;\n\t\twp_update_comment( $mzzcommentarr );\n\n }\n}",
"public function post_comment()\n\t{\n\t\t$this->get_comment( true );\n\t}",
"public function beforeInsertComment($data)\n\t{\n\t $node = $data['_node'];\n\t \t \n $data['node'] = array(\n 'id'\t=>\t$data['nid'],\n\t\t);\n \n\t\t$data['status'] = 'queued';\n \n if (isset($node['name']) && !empty($node['name']))\n $data['node']['name']\t=\t$node['name'];\n else if (isset($node['content']))\n $data['node']['name']\t= word_breadcumb($node['content'], CACHED_POST_TITLE_WORD_LENGTH);\n\t \n if(isset($data['attachments']) && (is_null($data['attachments']) || $data['attachments'] == ''))\n \tunset($data['attachments']);\n \n\t\treturn array('success' => true, 'result' => $data);\n\t}",
"function ajax_insert_comment( ) {\n\t\tglobal $current_user, $user_ID, $wpdb;\n\n\t\t// Verify nonce\n\t\tif ( !wp_verify_nonce( $_POST['_nonce'], 'comment') )\n\t\t\tdie( __( \"Nonce check failed. Please ensure you're supposed to be adding editorial comments.\", 'edit-flow' ) );\n\n\t\t// Get user info\n \twp_get_current_user();\n\n \t// Set up comment data\n\t\t$post_id = absint( $_POST['post_id'] );\n\t\t$parent = absint( $_POST['parent'] );\n\n \t// Only allow the comment if user can edit post\n \t// @TODO: allow contributers to add comments as well (?)\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\tdie( __('Sorry, you don\\'t have the privileges to add editorial comments. Please talk to your Administrator.', 'edit-flow' ) );\n\n\t\t// Verify that comment was actually entered\n\t\t$comment_content = trim($_POST['content']);\n\t\tif( !$comment_content )\n\t\t\tdie( __( \"Please enter a comment.\", 'edit-flow' ) );\n\n\t\t// Check that we have a post_id and user logged in\n\t\tif( $post_id && $current_user ) {\n\n\t\t\t// set current time\n\t\t\t$time = current_time('mysql', $gmt = 0);\n\n\t\t\t// Set comment data\n\t\t\t$data = array(\n\t\t\t 'comment_post_ID' => (int) $post_id,\n\t\t\t 'comment_author' => esc_sql($current_user->display_name),\n\t\t\t 'comment_author_email' => esc_sql($current_user->user_email),\n\t\t\t 'comment_author_url' => esc_sql($current_user->user_url),\n\t\t\t 'comment_content' => wp_kses($comment_content, array('a' => array('href' => array(),'title' => array()),'b' => array(),'i' => array(),'strong' => array(),'em' => array(),'u' => array(),'del' => array(), 'blockquote' => array(), 'sub' => array(), 'sup' => array() )),\n\t\t\t 'comment_type' => self::comment_type,\n\t\t\t 'comment_parent' => (int) $parent,\n\t\t\t 'user_id' => (int) $user_ID,\n\t\t\t 'comment_author_IP' => esc_sql($_SERVER['REMOTE_ADDR']),\n\t\t\t 'comment_agent' => esc_sql($_SERVER['HTTP_USER_AGENT']),\n\t\t\t 'comment_date' => $time,\n\t\t\t 'comment_date_gmt' => $time,\n\t\t\t\t// Set to -1?\n\t\t\t 'comment_approved' => self::comment_type,\n\t\t\t);\n\n\t\t\t$data = apply_filters( 'ef_pre_insert_editorial_comment', $data );\n\n\t\t\t// Insert Comment\n\t\t\t$comment_id = wp_insert_comment($data);\n\t\t\t$comment = get_comment($comment_id);\n\n\t\t\t// Save the list of notified users/usergroups.\n\t\t\tif ( $this->module_enabled( 'notifications' ) && apply_filters( 'ef_editorial_comments_show_notified_users', true ) ) {\n\t\t\t\t$notification = isset( $_POST['notification'] ) ? sanitize_text_field( $_POST['notification'] ) : '';\n\n\t\t\t\tif ( ! empty( $notification ) && __( 'No one will be notified.', 'edit-flow' ) !== $notification ) {\n\t\t\t\t\tadd_comment_meta( $comment_id, 'notification_list', $notification );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Register actions -- will be used to set up notifications and other modules can hook into this\n\t\t\tif ( $comment_id )\n\t\t\t\tdo_action( 'ef_post_insert_editorial_comment', $comment );\n\n\t\t\t// Prepare response\n\t\t\t$response = new WP_Ajax_Response();\n\n\t\t\tob_start();\n\t\t\t\t$this->the_comment( $comment, '', '' );\n\t\t\t\t$comment_list_item = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t$response->add( array(\n\t\t\t\t'what' => 'comment',\n\t\t\t\t'id' => $comment_id,\n\t\t\t\t'data' => $comment_list_item,\n\t\t\t\t'action' => ($parent) ? 'reply' : 'new'\n\t\t\t));\n\n\t\t\t$response->send();\n\n\t\t} else {\n\t\t\tdie( __('There was a problem of some sort. Try again or contact your administrator.', 'edit-flow') );\n\t\t}\n\t}",
"public function p_comment() {\n\t\t\t\t\t$_POST['user_id'] = $this->user->user_id;\n\t\n\t\t\t\t\t# Unix timestamp of when this comment was created / modified\n\t\t\t\t\t$_POST['created'] = Time::now();\n\t\t\t\t\t$_POST['modified'] = Time::now();\n\t\n\t\t\t\t\t# Insert to database\n\t\t\t\t\tDB::instance(DB_NAME)->insert('comments', $_POST);\n\t\n\t\t\t\t\t# Redirect after insert\n\t\t\t\t\tRouter::redirect(\"/posts\");\n\t\n\t\t\t}",
"public function main() {\n\t\tadd_action( 'comment_post', array($this, 'newComment'), 10, 2 );\n\t\tadd_action( 'admin_init', array($this, 'admin_init') );\n\t\t$this->cubepoints->registerTransactionType( 'comment', __('Comments', 'cubepoints'), array($this, 'txnDescComment') );\n\t}",
"public function onSaving()\n {\n $type = $this->getType();\n $block = $this->getFormEntry();\n\n $block->type = $type->getNamespace();\n }",
"public function getCommentType() {\r\n\t\treturn isset($this->_comment['comment_type']) ? $this->_comment['comment_type'] : null;\r\n\t}",
"public function processComment()\n {\n if (Tools::isSubmit('simplecomments_submit_comment')) {\n $insert = array(\n 'id_product' => (int)Tools::getValue('id_product'),\n 'firstname' => pSQL(Tools::getValue('firstname')),\n 'lastname' => pSQL(Tools::getValue('lastname')),\n 'email' => pSQL(Tools::getValue('email')),\n 'grade' => (int)Tools::getValue('grade'),\n 'comment' => pSQL(Tools::getValue('comment')),\n 'date_add' => date('Y-m-d H:i:s'),\n );\n Db::getInstance()->insert('simplecomments', $insert);\n $this->context->smarty->assign('new_comment_posted', 'true');\n }\n }",
"public function post_comments($table_name='',$type_id='',$desc='',$type='')\r\n {\r\n $this->comments = new Comments_Model();\r\n\t\t $this->result = $this->comments->post_comments($table_name,$type_id,$desc,$this->userid,$type);\r\n\t\t if($this->result)\r\n\t\t {\r\n\t\t Nauth::setMessage(1,$this->add_comment);\r\n\t\t }\r\n\t\t\r\n }",
"public function addComment(){\n\n \t$this->autoRender = false;\n\n /**\n * variable que contiene los datos que vienen por el método post\n * @var Array\n */\n \t$data = $this->request->data; \n\n /**\n * Comentario\n * @var String\n */\n \t$comment = htmlentities( $data['comment'] );\n \t\n /**\n * Identificador del post\n * @var Int\n */\n $postId = $data['postId'];\n\n /**\n * Identificador del usuario\n * @var [type]\n */\n \t$userId = $this->Auth->user('id');\n\n /**\n * Creación de una nueva entidad de tipo comentario\n */\n \t$this->Coment->Create();\n\n\n /**\n * Guardado del nuevo comentario\n */\n \tif ($this->Coment->save(Array('comment'=>$comment, 'users_id'=>$userId))) {\n\n /**\n * Identificador del nuevo comentario\n * @var Int\n */\n $commentId = $this->Coment->id;\n\n /**\n * guardamos su relación con el post\n */\n if($this->makePostRelation($postId,$commentId)){\n\n /**\n * Obtenemos la información del post\n * @var [type]\n */\n $comment = $this->Coment->find('first',Array('conditions'=>Array('Coment.id'=>$commentId)));\n\n /**\n * Guardamos los recursos usando el componente ResourceManager y lo configuramos\n */\n \n $this->ResourceManager->saveResources($userId, 'post_comment', 'attachment', $commentId);\n\n /**\n * Variable que contiene el numero de comentarios el cual se obtiene de la función getNumberOfCommentsFromPost\n * @var Int\n */\n $numberOfCommentsFromPost = $this->getNumberOfCommentsFromPost($comment['PostComment'][0]['post_id']);\n\n /**\n * Obtenemos la información del post\n * @var [type]\n */\n $comment = $this->Coment->find('first',Array('conditions'=>Array('Coment.id'=>$commentId)));\n\n /**\n * escribimos el String tipo Json\n */\n echo json_encode(Array('success'=>true,'Comment'=>$comment,'numberComments'=> $numberOfCommentsFromPost));\n\n } else {\n \n /**\n * escribimos el estado sin éxito\n */\n echo json_encode(Array('success'=>false));\n } \t\t\t\n\n }else{\n\n /**\n * escribimos el estado sin éxito\n */\n echo json_encode(Array('success'=>false));\n }\n\n }",
"public function postcommentAction() {\n if ($this->getRequest()->isPost())\n {\n $documentID = $_POST['documentId'];\n $text = $_POST['commentText'];\n $type = $_POST['type'];\n $userId = $_SESSION['Incite']['USER_DATA']['id'];\n\n $workingGroupId = 0;\n\n if (isset($_SESSION['Incite']['USER_DATA']['working_group']['id'])) {\n $workingGroupId = $_SESSION['Incite']['USER_DATA']['working_group']['id'];\n }\n $discussion = new InciteDiscussion;\n $discussion->user_id = $userId;\n $discussion->working_group_id = $workingGroupId;\n $discussion->discussion_text = $text;\n $discussion->discussion_type = $type;\n $discussion->is_active = 1;\n $discussion->save();\n\n $itemDiscussion = new InciteItemsDiscussions;\n $itemDiscussion->item_id = $documentID;\n $itemDiscussion->discussion_id = $discussion->id;\n $itemDiscussion->save();\n\n return true;\n }\n }",
"public function onSaving()\n {\n $entry = $this->getFormEntry();\n if (!$entry->type_id) {\n $entry->type_id = $this->getType()->getId();\n }\n }",
"public function setC(){\r\n\r\n if (isset($_POST['comment']) && $this->e->get('uid')) {\r\n\r\n $this->v->required($_POST['comment'], 'comment tidak boleh kosong');\r\n $this->v->regex($_POST['comment'], '/^(.|\\n){4,400}$/', # nanti dihapus\r\n '4-400 any dan spasi');\r\n\r\n if(!sizeof($this->v->errors)) \r\n {\r\n # CHECK POST IS HUMAN\r\n if ($this->f->checkHumanPost(3)) {\r\n\r\n # RENDER COMMENT\r\n $r = $this->__commentRender($_POST['comment']);\r\n\r\n # SETTING UP\r\n $p['comment'] = $r['text'];\r\n\r\n # START PLUGIN\r\n $m = new Engine\\Vendors\\Stackexchangeinc\\wmd\\ElephantMarkdown;\r\n $vendorHTMLpurifier = new Engine\\Vendors\\HTMLpurifier\\HTMLpurifier;\r\n $HTMLpurifierConfig = HTMLPurifier_Config::createDefault();\r\n $HTMLpurifierConfig->set('HTML.SafeObject', \"1\");\r\n $HTMLpurifierConfig->set('Output.FlashCompat', \"1\");\r\n $HTMLpurifierConfig->set('Filter.YouTube', \"1\");\r\n $purifier = new HTMLPurifier($HTMLpurifierConfig);\r\n $data['comment_html'] = $purifier->purify($m->parse($p['comment']));\r\n # END PLUGIN\r\n\r\n $data['comment_UID'] = $this->e->get('uid');\r\n $data['comment_PID'] = $_POST['id']; \r\n $time = new DateTime ( NULL, new DateTimeZone ( 'Asia/Jakarta' ) );\r\n $data['time_create'] = $time->format('Y-m-d H:i:s');\r\n $m = new Apps\\Netcoid\\Models\\Mentions;\r\n\r\n # SET COMMENT\r\n $c = new Apps\\Netcoid\\Models\\Comments;\r\n $p = new Apps\\Netcoid\\Models\\Posts;\r\n\r\n $c->set($data);\r\n \r\n # TAMBAH SATU REPLY\r\n $p->addReply1($data['comment_PID']);\r\n\r\n # SET MENTION IF THERE IS SOME USERNAME IN COMMENT\r\n if (!empty($r['usernames'])) {\r\n $m->set($c->getLastId(), $r['usernames']);\r\n }\r\n $this->h->setMessage('Comment Posted'); \r\n header('Location: /post?id='.$_POST['id'] );\r\n } \r\n }\r\n\r\n if(sizeof($this->v->errors)) \r\n {\r\n $this->h->setError($this->v->errors[0]); \r\n header('Location: /post?id='.$_POST['id'] );\r\n }\r\n \r\n } else {\r\n die('[email protected]');\r\n }\r\n }",
"protected function afterSave()\n {\n // flush the cache\n $this->flushCache();\n\n $activity = Activity::CreateForContent($this);\n $activity->type = \"CommentCreated\";\n $activity->module = \"comment\";\n $activity->save();\n $activity->fire();\n\n // Handle mentioned users\n // Execute before NewCommentNotification to avoid double notification when mentioned.\n UserMentioning::parse($this, $this->message);\n\n if ($this->isNewRecord) {\n // Send Notifications\n NewCommentNotification::fire($this);\n }\n \n\n return parent::afterSave();\n }",
"function newComment()\n {\n if (isset($_POST['body']) && isset($_POST['publication'])) {\n\n try {\n $comment = new Comment();\n $date = new DateTime();\n $comment->initializeData(0, $this->auth->retrieveUser()->id, $_POST['publication'], $_POST['body'], $date->format('Y-m-d H:i:s'));\n\n $this->commentRepo->Create($comment);\n\n $this->render();\n } catch (\\Throwable $th) {\n $this->view->newPublicationErr = \"There was an error trying to create the comment, try later...\";\n var_dump($th);\n }\n } else {\n var_dump($_POST);\n }\n }",
"public function getCommentType() {\n return $this->_getField(\"commentType\", 0, 2);\n }",
"public function run()\n {\n DB::table('comment_types')->insert([\n\t\t\t['title'=>'Төсөл','slug'=>'project'],\n\t\t\t['title'=>'Агуулга','slug'=>'content'],\n\t\t\t['title'=>'Блог','slug'=>'blog'],\n\t\t\t['title'=>'Төслийн шинэчилэл','slug'=>'updates'],\n\t\t]);\n }",
"public function facebook_comment( $post_id = null, $type = null) {\n\n if( $this->template->is_ajax() ) {\n $post = $this->input->post();\n if(isset($post['message']) && $post_id != null) {\n try {\n $this->load->library('Socializer/socializer');\n $facebook = Socializer::factory('Facebook', $this->c_user->id);\n $comment = $facebook->comment( $post_id, $post['message'] );\n\n if ($comment) {\n if ($type == 'crm') {\n Crm_directory_activity::inst()->update_other_field($post_id, 'comments', 'inc');\n } else {\n Mention::inst()->update_other_field($post_id, 'comments', 'inc');\n }\n\n }\n $result['success'] = true;\n $result['html'] = $this->template->block(\n '_comment',\n 'social/activity/blocks/_one_facebook_comment',\n array('_comment' => $comment, 'socializer' => $facebook, 'radar' => $this->radar)\n );\n } catch(Exception $e) {\n $result = array();\n $result['success'] = false;\n $result['error'] = $e->getMessage();\n }\n if (!empty($result['error'])) {\n $result['error'] = $facebook->facebookErrorTransformer($result['error']);\n }\n \n echo json_encode($result);\n }\n }\n }"
] | [
"0.69881535",
"0.6655205",
"0.6348255",
"0.62670875",
"0.61474913",
"0.5974227",
"0.59605265",
"0.5900545",
"0.58459187",
"0.5803632",
"0.5777402",
"0.57520175",
"0.5730556",
"0.57103354",
"0.5671508",
"0.5636594",
"0.5622235",
"0.56112987",
"0.56073415",
"0.558775",
"0.5575966",
"0.5524802",
"0.5519432",
"0.55001956",
"0.54971296",
"0.5492246",
"0.5467222",
"0.5464148",
"0.5462269",
"0.5437653"
] | 0.7295893 | 0 |
Acts on a ckeditor_comment_type being inserted or updated. This hook is invoked before the ckeditor_comment_type is saved to the database. | function hook_ckeditor_comment_type_presave(CKEditorCommentType $ckeditor_comment_type) {
$ckeditor_comment_type->name = 'foo';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_ckeditor_comment_type_update(CKEditorCommentType $ckeditor_comment_type) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment_type, TRUE)))\n ->condition('id', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"function hook_ckeditor_comment_type_insert(CKEditorCommentType $ckeditor_comment_type) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment_type', $ckeditor_comment_type),\n 'extra' => print_r($ckeditor_comment_type, TRUE),\n ))\n ->execute();\n}",
"function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {\n $ckeditor_comment->name = 'foo';\n}",
"public function onSaving()\n {\n $entry = $this->getFormEntry();\n if (!$entry->type_id) {\n $entry->type_id = $this->getType()->getId();\n }\n }",
"function hook_ckeditor_comment_insert(CKEditorComment $ckeditor_comment) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment', $ckeditor_comment),\n 'extra' => print_r($ckeditor_comment, TRUE),\n ))\n ->execute();\n}",
"function mzz_comment_inserted($comment_id, $comment_object) {\n if ($comment_object->comment_type == 'collabpress') {\n \n //the comment type was seen to be collabpress. It was already inserted into the database. Now we go back into the database and update that comment's approved status to 0 (pending)\n $mzzcommentarr = array();\n\t\t$mzzcommentarr['comment_ID'] = $comment_id;\n\t\t$mzzcommentarr['comment_approved'] = 0;\n\t\twp_update_comment( $mzzcommentarr );\n\n }\n}",
"public function onSaving()\n {\n $type = $this->getType();\n $block = $this->getFormEntry();\n\n $block->type = $type->getNamespace();\n }",
"function hook_ckeditor_comment_type_delete(CKEditorCommentType $ckeditor_comment_type) {\n db_delete('mytable')\n ->condition('pid', entity_id('ckeditor_comment_type', $ckeditor_comment_type))\n ->execute();\n}",
"function hook_default_ckeditor_comment_type_alter(array &$defaults) {\n $defaults['main']->name = 'custom name';\n}",
"public function setCommentType($type) {\n $this->_commentType = $type;\n }",
"function hook_ckeditor_comment_update(CKEditorComment $ckeditor_comment) {\n db_update('mytable')\n ->fields(array('extra' => print_r($ckeditor_comment, TRUE)))\n ->condition('id', entity_id('ckeditor_comment', $ckeditor_comment))\n ->execute();\n}",
"public function processComment()\n {\n if (Tools::isSubmit('simplecomments_submit_comment')) {\n $insert = array(\n 'id_product' => (int)Tools::getValue('id_product'),\n 'firstname' => pSQL(Tools::getValue('firstname')),\n 'lastname' => pSQL(Tools::getValue('lastname')),\n 'email' => pSQL(Tools::getValue('email')),\n 'grade' => (int)Tools::getValue('grade'),\n 'comment' => pSQL(Tools::getValue('comment')),\n 'date_add' => date('Y-m-d H:i:s'),\n );\n Db::getInstance()->insert('simplecomments', $insert);\n $this->context->smarty->assign('new_comment_posted', 'true');\n }\n }",
"function hook_default_ckeditor_comment_type() {\n $defaults['main'] = entity_create('ckeditor_comment_type', array(\n // …\n ));\n return $defaults;\n}",
"protected function _preSave()\n {\n if ($this->isInsert() && $this->get('expiry_date') >= 4294967295)\n {\n $this->set('expiry_date', 0);\n }\n\n parent::_preSave();\n\n if (SV_ReportImprovements_Globals::$replyBanOptions && $this->get('content_type') == 'post')\n {\n $user = $this->_getUserModel()->getUserById($this->get('user_id'));\n\n $postId = $this->get('content_id');\n $post = $this->_getPostModel()->getPostById($postId, array(\n 'join' => XenForo_Model_Post::FETCH_THREAD | XenForo_Model_Post::FETCH_FORUM,\n 'skip_wordcount' => true,\n ));\n\n if (!empty($post['thread_id']) && $user && $this->_getThreadModel()->canReplyBanUserFromThread($user, $post, $post, $errorPhraseKey))\n {\n $this->replyBanUser = $user;\n $this->replyBanThread = $post;\n $this->replyBanOptions = SV_ReportImprovements_Globals::$replyBanOptions;\n }\n else\n {\n $this->error($errorPhraseKey, 'ban_length');\n }\n }\n }",
"public function setCommentType($commentType) {\r\n\t\t$this->_comment['comment_type'] = $commentType;\r\n\t}",
"public function p_comment() {\n\t\t\t\t\t$_POST['user_id'] = $this->user->user_id;\n\t\n\t\t\t\t\t# Unix timestamp of when this comment was created / modified\n\t\t\t\t\t$_POST['created'] = Time::now();\n\t\t\t\t\t$_POST['modified'] = Time::now();\n\t\n\t\t\t\t\t# Insert to database\n\t\t\t\t\tDB::instance(DB_NAME)->insert('comments', $_POST);\n\t\n\t\t\t\t\t# Redirect after insert\n\t\t\t\t\tRouter::redirect(\"/posts\");\n\t\n\t\t\t}",
"public function imported_comment() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'comments',\n\t\t\t'delta' => 1,\n\t\t));\n\t}",
"function hook_ckeditor_comment_type_load(array $entities) {\n $result = db_query('SELECT pid, foo FROM {mytable} WHERE pid IN(:ids)', array(':ids' => array_keys($entities)));\n foreach ($result as $record) {\n $entities[$record->pid]->foo = $record->foo;\n }\n}",
"public function beforeInsertComment($data)\n\t{\n\t $node = $data['_node'];\n\t \t \n $data['node'] = array(\n 'id'\t=>\t$data['nid'],\n\t\t);\n \n\t\t$data['status'] = 'queued';\n \n if (isset($node['name']) && !empty($node['name']))\n $data['node']['name']\t=\t$node['name'];\n else if (isset($node['content']))\n $data['node']['name']\t= word_breadcumb($node['content'], CACHED_POST_TITLE_WORD_LENGTH);\n\t \n if(isset($data['attachments']) && (is_null($data['attachments']) || $data['attachments'] == ''))\n \tunset($data['attachments']);\n \n\t\treturn array('success' => true, 'result' => $data);\n\t}",
"public function afterSave() {\n if ($this->modx->modxtalks->mtCache === true) {\n if (!$this->modx->modxtalks->cacheComment($this->object)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache comment error, ID ' . $this->object->id);\n }\n if (!$this->modx->modxtalks->cacheConversation($this->theme)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/restore] Cache conversation error, ID ' . $this->theme->id);\n }\n }\n\n return parent::afterSave();\n }",
"public function post_comment()\n\t{\n\t\t$this->get_comment( true );\n\t}",
"public function beforeSave()\n\t{\n\n\t}",
"function ajax_insert_comment( ) {\n\t\tglobal $current_user, $user_ID, $wpdb;\n\n\t\t// Verify nonce\n\t\tif ( !wp_verify_nonce( $_POST['_nonce'], 'comment') )\n\t\t\tdie( __( \"Nonce check failed. Please ensure you're supposed to be adding editorial comments.\", 'edit-flow' ) );\n\n\t\t// Get user info\n \twp_get_current_user();\n\n \t// Set up comment data\n\t\t$post_id = absint( $_POST['post_id'] );\n\t\t$parent = absint( $_POST['parent'] );\n\n \t// Only allow the comment if user can edit post\n \t// @TODO: allow contributers to add comments as well (?)\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\tdie( __('Sorry, you don\\'t have the privileges to add editorial comments. Please talk to your Administrator.', 'edit-flow' ) );\n\n\t\t// Verify that comment was actually entered\n\t\t$comment_content = trim($_POST['content']);\n\t\tif( !$comment_content )\n\t\t\tdie( __( \"Please enter a comment.\", 'edit-flow' ) );\n\n\t\t// Check that we have a post_id and user logged in\n\t\tif( $post_id && $current_user ) {\n\n\t\t\t// set current time\n\t\t\t$time = current_time('mysql', $gmt = 0);\n\n\t\t\t// Set comment data\n\t\t\t$data = array(\n\t\t\t 'comment_post_ID' => (int) $post_id,\n\t\t\t 'comment_author' => esc_sql($current_user->display_name),\n\t\t\t 'comment_author_email' => esc_sql($current_user->user_email),\n\t\t\t 'comment_author_url' => esc_sql($current_user->user_url),\n\t\t\t 'comment_content' => wp_kses($comment_content, array('a' => array('href' => array(),'title' => array()),'b' => array(),'i' => array(),'strong' => array(),'em' => array(),'u' => array(),'del' => array(), 'blockquote' => array(), 'sub' => array(), 'sup' => array() )),\n\t\t\t 'comment_type' => self::comment_type,\n\t\t\t 'comment_parent' => (int) $parent,\n\t\t\t 'user_id' => (int) $user_ID,\n\t\t\t 'comment_author_IP' => esc_sql($_SERVER['REMOTE_ADDR']),\n\t\t\t 'comment_agent' => esc_sql($_SERVER['HTTP_USER_AGENT']),\n\t\t\t 'comment_date' => $time,\n\t\t\t 'comment_date_gmt' => $time,\n\t\t\t\t// Set to -1?\n\t\t\t 'comment_approved' => self::comment_type,\n\t\t\t);\n\n\t\t\t$data = apply_filters( 'ef_pre_insert_editorial_comment', $data );\n\n\t\t\t// Insert Comment\n\t\t\t$comment_id = wp_insert_comment($data);\n\t\t\t$comment = get_comment($comment_id);\n\n\t\t\t// Save the list of notified users/usergroups.\n\t\t\tif ( $this->module_enabled( 'notifications' ) && apply_filters( 'ef_editorial_comments_show_notified_users', true ) ) {\n\t\t\t\t$notification = isset( $_POST['notification'] ) ? sanitize_text_field( $_POST['notification'] ) : '';\n\n\t\t\t\tif ( ! empty( $notification ) && __( 'No one will be notified.', 'edit-flow' ) !== $notification ) {\n\t\t\t\t\tadd_comment_meta( $comment_id, 'notification_list', $notification );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Register actions -- will be used to set up notifications and other modules can hook into this\n\t\t\tif ( $comment_id )\n\t\t\t\tdo_action( 'ef_post_insert_editorial_comment', $comment );\n\n\t\t\t// Prepare response\n\t\t\t$response = new WP_Ajax_Response();\n\n\t\t\tob_start();\n\t\t\t\t$this->the_comment( $comment, '', '' );\n\t\t\t\t$comment_list_item = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t$response->add( array(\n\t\t\t\t'what' => 'comment',\n\t\t\t\t'id' => $comment_id,\n\t\t\t\t'data' => $comment_list_item,\n\t\t\t\t'action' => ($parent) ? 'reply' : 'new'\n\t\t\t));\n\n\t\t\t$response->send();\n\n\t\t} else {\n\t\t\tdie( __('There was a problem of some sort. Try again or contact your administrator.', 'edit-flow') );\n\t\t}\n\t}",
"protected function _preSave() {}",
"protected function before_save()\n {\n\n }",
"public function main() {\n\t\tadd_action( 'comment_post', array($this, 'newComment'), 10, 2 );\n\t\tadd_action( 'admin_init', array($this, 'admin_init') );\n\t\t$this->cubepoints->registerTransactionType( 'comment', __('Comments', 'cubepoints'), array($this, 'txnDescComment') );\n\t}",
"protected function beforeSave()\n {\n\n }",
"public function beforeSave()\r\n {\r\n }",
"public function edit(CommentType $commentType)\n {\n //\n }",
"protected function _preSave()\n {\n }"
] | [
"0.7296328",
"0.7267173",
"0.6836281",
"0.64447975",
"0.6435455",
"0.6402656",
"0.63797176",
"0.63677466",
"0.636001",
"0.6325236",
"0.6182428",
"0.6088329",
"0.60393727",
"0.6004306",
"0.59831166",
"0.59689415",
"0.5920638",
"0.5904107",
"0.5835716",
"0.5811469",
"0.5794548",
"0.57618546",
"0.5720785",
"0.5701319",
"0.56965995",
"0.56808156",
"0.5679881",
"0.56713575",
"0.56667614",
"0.5660435"
] | 0.7637164 | 0 |
Subsets and Splits