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
this behavior is used to perform some specific addon's actions on the database cursor the parameters are $eh, the eventHandler object instance, $post_id, $cur_post and $cur_event
public static function coreEventHandlerGetEventCursor($eh, $post_id, $cur_post, $cur_event) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function coreEventHandlerAfterEventAdd($eh, $post_id, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function coreEventHandlerBeforeEventUpdate($eh, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function adminAfterEventHandlerUpdate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "public static function coreEventHandlerBeforeEventAdd($eh, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function adminAfterEventHandlerCreate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "public static function adminBeforeEventHandlerUpdate($cur_post, $cur_event, $post_id) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "public static function coreEventHandlerBeforeGetEvents($eh, $args) {\n\t\t\tforeach ($args as $v => $k) {\n\t\t\t\t$$v = &$args[$v];\n\t\t\t} #Recreates the byref args.\n\t\t\t$col = (array) $params['columns'];\n\t\t\t$col[] = 'dummy';\n\t\t\t$params['columns'] = $col;\n\n\t\t\tif (!empty($params['dummy'])) {\n\t\t\t\t$params['sql'] .= \"AND EH.dummy = '\" . $eh->con->escape($params['dummy']) . \"' \";\n\t\t\t}\n\t\t}", "public static function adminEventHandlerTab($post) {\n\t\t\n\t}", "protected function post_eventos() {}", "public static function adminEventHandlerActionsManage(eventHandler $eh, $action) {\n\t\tif ($action != 'dummify' && $action != 'undummify')\n\t\t\treturn;\n\t\tglobal $p_url, $core;\n\t\ttry {\n\t\t\t$redir = $core->getPostAdminURL($from_post->post_type, $from_post->post_id);\n\t\t\tif (isset($_POST['redir']) && strpos($_POST['redir'], '://') === false) {\n\t\t\t\t$redir = $_POST['redir'];\n\t\t\t} elseif (!$redir) {\n\t\t\t\t$redir = $p_url . '&part=events';\n\t\t\t}\n\t\t\t$entries = $_POST['entries'];\n\n\t\t\t$cur_event = $core->con->openCursor($core->prefix . 'eventhandler');\n\t\t\t$cur_event->dummy = ($action == 'dummify') ? 1 : 0;\n\t\t\t$cur_event->update('WHERE post_id ' . $core->con->in($entries));\n\t\t\tdcPage::addSuccessNotice(sprintf(\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'%d entry has been successfully %sdummified', '%d entries have been successfully %sdummified', count($entries)\n\t\t\t\t\t\t\t), count($entries), ($action == 'dummify') ? '' : 'un'\n\t\t\t));\n\t\t\thttp::redirect($redir);\n\t\t} catch (Exception $e) {\n\t\t\t$core->error->add($e->getMessage());\n\t\t}\n\t}", "public static function coreEventHandlerEventDelete($eh, $post_id) {\n\t\t\t#do something before event deletion\n\t\t}", "public function execute(): void\n {\n $db = $this->db->prepare($this->action);\n $db->execute($this->bind[0]);\n\n $this->action = null;\n }", "public static function adminBeforeEventHandlerCreate($cur_post, $cur_event) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "abstract public function handlerEvent($constEvent, $dataContext = NULL);", "public function addHandler()\n {\n $adapter = $this->getMockedAdapter();\n $adapter->expects($this->once())\n ->method('execute')\n ->with($this->isInstanceOf(Update::class), [':id' => 2, ':user_id' => 2])\n ->willReturn(1);\n $this->hasMany->setAdapter($adapter);\n $person = new Person(['id' => '2', 'name' => 'test']);\n $post = new Post(['id' => 2, 'title' => 'test']);\n $collection = new EntityCollection(Person::class);\n $collection->setParentEntity($person);\n $event = new EntityAdded($post, ['collection' => $collection]);\n $this->hasMany->add($event);\n }", "protected function handle_out()\r\n {\r\n $events = EventManager::events();\r\n\r\n $reversed = new Stack();\r\n\r\n while ($events->length() != 0) {\r\n $reversed->push($events->pop());\r\n }\r\n\r\n while ($reversed->length() != 0) {\r\n $this->execute($reversed->pop());\r\n }\r\n }", "public function onFinish($e)\n {\n $serviceManager = $e->getApplication()->getServiceManager();\n\n $defaultManager = $serviceManager->get('doctrine.entitymanager.orm_default');\n\n $config = $serviceManager->get('MergedConfig');\n\n if ($config->get('debug', false)) {\n ob_start();\n echo '<h3>Queries</h3>';\n foreach($defaultManager->getConnection()->getConfiguration()->getSQLLogger()->queries as $keyQuery => $valQuery) {\n $queryNumber = $keyQuery;\n echo '<b>Query #' . $queryNumber . '</b><br>';\n $fontColor = 'black';\n if ($valQuery['executionMS'] > 1000) {\n echo '<h1>SLOW QUERY ALERT</h1>';\n $fontColor = 'red';\n echo '<script>alert(\"SLOW QUERY ALERT\");</script>';\n }\n echo \"<font color=\\\"$fontColor\\\">\";\n echo 'Time to Execute (ms): ' . $valQuery['executionMS'] . '<br>';\n echo $valQuery['sql'] . '<br>';\n echo '</font>';\n echo '<hr>';\n }\n echo '<hr><hr>';\n $queryLog = ob_get_contents();\n ob_end_clean();\n\n $e->getResponse()->setContent($e->getResponse()->getContent() . $queryLog);\n }\n\n $defaultManager->getConnection()->close();\n $defaultManager->close();\n\n $adminManager = $serviceManager->get('doctrine.entitymanager.orm_admin');\n\n $adminManager->getConnection()->close();\n $adminManager->close();\n\n /**\n * Only if this is a page call, temporary\n */\n if ( $serviceManager->has('currentPage') )\n {\n $currentPage = $serviceManager->get('currentPage');\n //$contentAppearanceService = $serviceManager->get('phoenix-contentappearance');\n //$contentAppearanceService->save($currentPage);\n }\n }", "function m_eventHandler()\n\t{\n\t\tif(!isset($this->request['action']))\n\t\t{\n\t\t\t$this->request['action']=\"\";\n\t\t}\n\t\t$action=explode(\".\",$this->request['action']);\n\t\tswitch($action[0])\n\t\t{\n\n\t\t\tcase \"user\":\n\t\t\t$obUserInterface=new c_userInterface();\n\t\t\t$obUserInterface->obTpl=$this->obTpl;\n\t\t\t$obUserInterface->obDb=$this->obDb;\n\t\t\t$obUserInterface->request=$this->request;\n\n\t\t\t$obUserDb=new c_userDb();\n\t\t\t$obUserDb->obDb=$this->obDb;\n\t\t\t$obUserDb->request=$this->request;\n\t\t\tif(!isset($action[1]))\n\t\t\t{\n\t\t\t\t$action[1]=\"\";\n\t\t\t}\n\t\t\tswitch($action[1])\n\t\t\t{\n\t\t\t\tcase \"home\":\n\t\t\t\t$obUserInterface->userTemplate=$this->templatePath.\"userDisplayHome.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obUserInterface->m_dspCustomers());\n\t\t\t\tbreak;\n\t\t\t\tcase \"dspForm\":\n\t\t\t\t$obUserInterface->userTemplate=$this->templatePath.\"userForm.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obUserInterface->m_dspUserForm());\n\t\t\t\tbreak;\n\t\t\t\tcase \"status\":\n\t\t\t\t$obUserInterface->userTemplate=$this->templatePath.\"status.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obUserInterface->m_userStatus());\n\t\t\t\tbreak;\n\t\t\t\tcase \"details\":\n\t\t\t\t$obUserInterface->userTemplate=$this->templatePath.\"userDetails.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obUserInterface->dspUserDetails());\n\t\t\t\tbreak;\n\t\t\t\tcase \"sendpass\":\n\t\t\t\t$obUserInterface->m_sendPassword();\n\t\t\t\tbreak;\n\t\t\t\tcase \"updateUser\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t\tif(isset($this->request['mode']) && $this->request['mode']==\"edit\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$checkValue=$obUserInterface->m_verifyEditUser();\n\t\t\t\t\t\tif($checkValue==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$obUserDb->m_updateUser();\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$obUserInterface->request['id']=$this->request['id'];\n\t\t\t\t\n\t\t\t\t\t\t\t$obUserInterface->userTemplate=$this->templatePath.\"userForm.tpl.htm\";\n\t\t\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obUserInterface->m_dspUserForm());\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$checkValue=$obUserInterface->m_verifyInsertUser();\n\t\t\t\t\t\tif($checkValue==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$obUserDb->m_insertUser();\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$obUserInterface->userTemplate=$this->templatePath.\"userForm.tpl.htm\";\n\t\t\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obUserInterface->m_dspUserForm());\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"changestatus\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t\t$obUserDb->m_changeStatus();\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t$obUserInterface->userTemplate=$this->templatePath.\"userDisplayHome.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obUserInterface->m_dspCustomers());\n\t\t\t\tbreak;\n\t\n\t\t\t}\n\t\t\tbreak;#END CUSTOMER\n\n\t\t\tcase \"enquiry\":\n\t\t\t$obEnquiryInterface=new c_enquiryInterface();\n\t\t\t$obEnquiryInterface->obTpl=$this->obTpl;\n\t\t\t$obEnquiryInterface->obDb=$this->obDb;\n\t\t\t$obEnquiryInterface->request=$this->request;\n\n\t\t\n\t\t\tswitch($action[1])\n\t\t\t{\n\t\t\t\tcase \"home\":\n\t\t\t\t$obEnquiryInterface->contactTemplate =$this->templatePath.\"enquiriesHome.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obEnquiryInterface->m_dspEnquiries());\n\t\t\t\tbreak;\n\t\t\t\tcase \"details\":\n\t\t\t\t$obEnquiryInterface->contactTemplate =$this->templatePath.\"enquiriesDetails.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obEnquiryInterface->dspEnquiryDetails());\n\t\t\t\tbreak;\n\t\t\t\tcase \"deleteEnq\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t$obEnquiryInterface->m_deleteEnquiries();\n\t\t\t\tbreak;\n\t\t\t\tcase \"delete\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t$obEnquiryInterface->m_deleteEnquiry();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"supplier\":\n\t\t\t$obSupplierInterface=new c_supplierInterface();\n\t\t\t$obSupplierInterface->obTpl=$this->obTpl;\n\t\t\t$obSupplierInterface->obDb=$this->obDb;\n\t\t\t$obSupplierInterface->request=$this->request;\n\t\t\t$obSupplierInterface->imagePath=SITE_PATH.\"images/\";\n\t\t\t$obSupplierInterface->imageUrl=SITE_URL.\"images/\";\n\n\t\t\t$obSupplierDb=new c_supplierDb();\n\t\t\t$obSupplierDb->obDb=$this->obDb;\n\t\t\t$obSupplierDb->request=$this->request;\n\t\t\t$obSupplierDb->imagePath=SITE_PATH.\"images/\";\n\n\t\t\tswitch($action[1])\n\t\t\t{\n\t\t\t\tcase \"home\":\n\t\t\t\t$obSupplierInterface->supplierTemplate=$this->templatePath.\"suppliersHome.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSupplierInterface->m_dspSuppliers());\n\t\t\t\tbreak;\n\t\t\t\tcase \"dspForm\":\n\t\t\t\t$obSupplierInterface->supplierTemplate=$this->templatePath.\"suppliersForm.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSupplierInterface->m_dspSupplierForm());\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"updateSupplier\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t\tif(isset($this->request['mode']) && $this->request['mode']==\"edit\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!$obSupplierInterface->m_verifyEditSupplier())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$obSupplierDb->m_updateSupplier();\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$obSupplierInterface->request['id']=$this->request['id'];\n\t\t\t\t\t\t\t$obSupplierInterface->supplierTemplate=$this->templatePath.\"suppliersForm.tpl.htm\";\n\t\t\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSupplierInterface->m_dspSupplierForm());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif(!$obSupplierInterface->m_verifyInsertSupplier())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$obSupplierDb->m_insertSupplier();\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$obSupplierInterface->supplierTemplate=$this->templatePath.\"suppliersForm.tpl.htm\";\n\t\t\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSupplierInterface->m_dspSupplierForm());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"uploadForm\":\n\t\t\t\t$obSupplierInterface->uploadTemplate=MODULES_PATH.\"default/templates/admin/upload.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSupplierInterface->m_uploadForm());\n\t\t\t\t break;\t\t\n\t\t\t\tcase \"upload\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\tif(!$obSupplierInterface->m_verifyImageUpload()){\n\t\t\t\t\t $obSupplierDb->m_uploadImage();\n\t\t\t\t}else{\n\t\t\t\t\t$obSupplierInterface->uploadTemplate=MODULES_PATH.\"default/templates/admin/upload.tpl.htm\";\n\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSupplierInterface->m_uploadForm());\n\t\t\t\t}\n\t\t\t\t break;\n\t\t\t\tcase \"delete\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t\t$obSupplierDb->m_deleteSupplier();\n\t\t\t\tbreak;\n\t\n\t\t\t}\n\t\t\tbreak;#END SUPPLIER\n\n\n\t\t\tcase \"security\":\n\t\t\t$obSecurityInterface=new c_securityInterface();\n\t\t\t$obSecurityInterface->obTpl=$this->obTpl;\n\t\t\t$obSecurityInterface->obDb=$this->obDb;\n\t\t\t$obSecurityInterface->request=$this->request;\n\n\t\t\t$obSecurityDb=new c_securityDb();\n\t\t\t$obSecurityDb->obDb=$this->obDb;\n\t\t\t$obSecurityDb->request=$this->request;\n\n\t\t\tswitch($action[1])\n\t\t\t{\n\t\t\t\tcase \"home\":\n $obSecurityInterface->adminTemplate=$this->templatePath.\"adminUsers.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSecurityInterface->m_dspAdminUsers());\n\t\t\t\tbreak;\n\t\t\t\tcase \"createAdmin\":\n\t\t\t\t$obSecurityInterface->adminTemplate=$this->templatePath.\"createAdminForm.tpl.htm\";\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSecurityInterface->m_createAdminForm());\n\t\t\t\tbreak;\n\t\t\t\tcase \"addAdmin\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t\tif(isset($this->request['mode']) && $this->request['mode']==\"edit\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($obSecurityInterface->m_verifyEditAdmin()==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$obSecurityDb->m_updateAdmin();\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\tif($obSecurityInterface->m_verifyEditAdmin()==2)\n\t\t\t\t\t\t\t\t$obSecurityInterface->request['msg']=1;\n\t\t\t\t\t\t\tif($obSecurityInterface->m_verifyEditAdmin()==3)\n\t\t\t\t\t\t\t\t$obSecurityInterface->request['msg']=2;\n\t\t\t\t\t\t\t$obSecurityInterface->request['adminid']=$this->request['adminid'];\n\t\t\t\t\t\t\t$obSecurityInterface->adminTemplate=$this->templatePath.\"createAdminForm.tpl.htm\";\n\t\t\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSecurityInterface->m_createAdminForm());\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($obSecurityInterface->m_verifyInsertAdmin()==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$obSecurityDb->m_insertAdmin();\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\tif($obSecurityInterface->m_verifyInsertAdmin()==2)\n\t\t\t\t\t\t\t\t$obSecurityInterface->request['msg']=1;\n\t\t\t\t\t\t\tif($obSecurityInterface->m_verifyInsertAdmin()==3)\n\t\t\t\t\t\t\t\t$obSecurityInterface->request['msg']=2;\t\n\t\t\t\t\t\t\t$obSecurityInterface->adminTemplate=$this->templatePath.\"createAdminForm.tpl.htm\";\n\t\t\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$obSecurityInterface->m_createAdminForm());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"deleteAdmin\":\n\t\t\t\t\t$this->libfunc->check_token();\n\t\t\t\t\t$obSecurityDb->m_deleteAdmin();\n\t\t\t\tbreak;\n\t\n\t\t\t}\n\t\t\tbreak;#END SECURITY\n\t\t\n\t\t#HANDLING HELP PAGES\n\t\tcase \"help\":\n\t\t\t$this->Template = MODULES_PATH.\"default/templates/admin/helpOuter.htm\";\n\t\t\t$this->obTpl->set_file(\"mainContent\",$this->Template);\n\t\t\n\t\t\tswitch($action[1])\n\t\t\t{\n\t\t\t\tcase \"security\":\n\t\t\t\t\t$this->Template = MODULES_PATH.\"default/templates/help/admin_security.htm\";\n\t\t\t\t\t$this->obTpl->set_file(\"innerContent\",$this->Template);\n\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_HELPBODY\",$this->obTpl->parse(\"return\",\"innerContent\"));\n\t\t\t\tbreak;\n\t\t\t\tcase \"users\":\n\t\t\t\t\t$this->Template = MODULES_PATH.\"default/templates/help/admin_users.htm\";\n\t\t\t\t\t$this->obTpl->set_file(\"innerContent\",$this->Template);\n\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_HELPBODY\",$this->obTpl->parse(\"return\",\"innerContent\"));\n\t\t\t\tbreak;\n\t\t\t\tcase \"customer\":\n\t\t\t\t\t$this->Template = MODULES_PATH.\"default/templates/help/customer.htm\";\n\t\t\t\t\t$this->obTpl->set_file(\"innerContent\",$this->Template);\n\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_HELPBODY\",$this->obTpl->parse(\"return\",\"innerContent\"));\n\t\t\t\tbreak;\n\t\t\t\tcase \"contact\":\n\t\t\t\t\t$this->Template = MODULES_PATH.\"default/templates/help/contact.htm\";\n\t\t\t\t\t$this->obTpl->set_file(\"innerContent\",$this->Template);\n\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_HELPBODY\",$this->obTpl->parse(\"return\",\"innerContent\"));\n\t\t\t\tbreak;\n\t\t\t\tcase \"supplier\":\n\t\t\t\t\t$this->Template = MODULES_PATH.\"default/templates/help/suppliers.htm\";\n\t\t\t\t\t$this->obTpl->set_file(\"innerContent\",$this->Template);\n\t\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_HELPBODY\",$this->obTpl->parse(\"return\",\"innerContent\"));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->obTpl->pparse(\"return\",\"mainContent\");\n\t\t\texit;\n\t\tbreak;\n\t\tcase \"logout\":\n\t\t\tsession_destroy();\n\t\t\theader(\"Location:\".SITE_URL.\"adminindex.php\");\n\t\tbreak;\n\t\tcase \"unauthorized\":\n\t\t$this->Template = MODULES_PATH.\"default/templates/admin/unAutherized.tpl.htm\";\n\t\t$this->obTpl->set_file(\"Content\",$this->Template);\n\t\t$this->obTpl->set_var(\"TPL_VAR_BODY\",$this->obTpl->parse(\"return\",\"Content\"));\n\t\tbreak;\n\n\t\tdefault:\n\t\t\tif(isset($_SESSION['uname']) && trim($_SESSION['uname'])!=\"\")\n\t\t\t{\n\t\t\t\theader(\"Location:\".SITE_URL.\"user/adminindex.php?action=user.home\");\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theader(\"Location:\".SITE_URL.\"adminindex.php\");\n\t\t\t\texit;\n\t\t\t}\n\t\t}#END SWITCH CASE\n\n\t}", "abstract protected function _execute();", "function hook_entity_query_alter($query) {\n $query->executeCallback = 'my_module_query_callback';\n}", "function _execute($request){\n\t\t\t$this->_execute($request);\n\t}", "public function queryEventFired()\n {\n // Get the arguments.\n $args = func_get_args();\n\n // Highlight SQL terms.\n $args[0] = $this->highlightQuery($args[0]);\n\n // Add the query to the buffer.\n $this->data['queries'][] = $args;\n }", "public function preCommandEvent() {\n\t\t\tif (isset($_POST['rolecmd'])) {\n\t\t\t\tif (isset($_POST['roles'])) {\n\t\t\t\t\t$counter = count($_POST['roles']);\n\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$counter = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$actionid = $_POST['actionid'];\n\t\t\t\t$qry = \"DELETE FROM {$_SESSION['DB_PREFIX']}applicationactionroles WHERE actionid = $actionid\";\n\t\t\t\t$result = mysql_query($qry);\n\t\t\t\t\n\t\t\t\tif (! $result) {\n\t\t\t\t\tlogError(mysql_error());\n\t\t\t\t}\n\t\t\n\t\t\t\tfor ($i = 0; $i < $counter; $i++) {\n\t\t\t\t\t$roleid = $_POST['roles'][$i];\n\t\t\t\t\t\n\t\t\t\t\t$qry = \"INSERT INTO {$_SESSION['DB_PREFIX']}applicationactionroles (actionid, roleid, metacreateddate, metacreateduserid, metamodifieddate, metamodifieduserid) VALUES ($actionid, '$roleid', NOW(), \" . getLoggedOnMemberID() . \", NOW(), \" . getLoggedOnMemberID() . \")\";\n\t\t\t\t\t$result = mysql_query($qry);\n\t\t\t\t};\n\t\t\t}\n\t\t}", "protected function execute()\n {\n $this->statement->execute();\n $this->dispatcher->now('db-query', ['statement' => $this->statement->queryString, 'bindings' => json_encode($this->bindings)]);\n }", "public function on_insert() {}", "protected function executeEpilog() {}", "public function execute_custom()\n {\n\n }", "public function execute()\n {\n $this->_forward('edit');\n }", "public function run($strAction,$objDC,$objActiveRecord,$objDbCC)\n\t{\n\t\t// @var object CustomCatalog\n\t\t$objCC = $objDbCC;\n\t\tif($objCC === null || !$objCC->customcatalog_edit_notification)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$objModule = $objCC;\n\t\t$objEntry = $objDC->activeRecord;\n\t\t$objSession = \\Session::getInstance();\n\t\t$strHelperSession = 'CC_ACTIVERECORD';\n\t\t\n\t\tif($strAction == 'onload' && $objSession->get($strHelperSession) === null)\n\t\t{\n\t\t\t$objSession->set($strHelperSession, array('id'=> $objEntry->id, 'table'=> $objDC->table) );\n\t\t\treturn;\n\t\t}\n\t\t\t\t\n\t\tif($strAction == 'onsubmit' || $strAction == 'oncreate')\n\t\t{\n\t\t\t$strAction = 'save';\n\t\t}\n\t\telse if($strAction == 'ondelete')\n\t\t{\n\t\t\t$strAction = 'delete';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$strAction = '';\n\t\t}\n\t\t\n\t\t\n\t\t// check if user triggers an action\n\t\tif (strlen($strAction) > 0)\n\t\t{\n\t\t\t$objNotification = \\NotificationCenter\\Model\\Notification::findByPk( $objModule->customcatalog_edit_notification );\n\t\t\t\n\t\t\t// oncreate notifications\n\t\t\tif($strAction == 'save' && $objEntry->tstamp < 1 && $objNotification->type == 'cc_feedit_oncreate')\n\t\t\t{\n\t\t\t\t// all good\n\t\t\t}\n\t\t\t// onsave, onchange notifications\n\t\t\telse if($strAction == 'save' && $objEntry->tstamp > 0 && in_array( $objNotification->type, array('cc_feedit_onsave','cc_feedit_onchange') ))\n\t\t\t{\n\t\t\t\t// all good\n\t\t\t}\n\t\t\t// ondelete notifications\n\t\t\telse if($strAction == 'delete' && $objNotification->type == 'cc_feedit_ondelete')\n\t\t\t{\n\t\t\t\t// all good\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// unknown notification or action does not fit\n\t\t\t\t$objNotification = null;\n\t\t\t}\n\t\t\t\n\t\t\tif($objNotification === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$blnDoNotSubmit = false;\n\t\t\t$arrTokens = array();\n\t\t\t$strLanguage = $GLOBALS['TL_LANGUAGE'];\n\t\t\n\t\t\t$arrTokens['admin_email'] = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t$arrTokens['domain'] = \\Environment::get('host');\n\t\t\t$arrTokens['link'] = \\Environment::get('base') . \\Environment::get('request');\n\t\t\t\n\t\t\t// cc tokens\n\t\t\t$arrTokens['table'] = $strTable;\n\t\t\t\n\t\t\t// backend link to table\n\t\t\t$arrTokens['backend_listview'] = ampersand(\\Environment::get('base') . 'contao/main.php?do='.\\Input::get('do'));\n\t\t\t\n\t\t\t// backend link to entry\n\t\t\t$arrTokens['backend_link'] = ampersand( \\Environment::get('base') . \\Environment::get('request') );\n\t\t\t\n\t\t\t// cc entry tokens \n\t\t\t$arrFormatted = array();\n\t\t\t\n\t\t\t// onchange notification\n\t\t\t$arrOnChange = array();\n\t\t\tif($objNotification->type == 'cc_feedit_onchange' && !empty($objModule->customcatalog_edit_notification_attributes))\n\t\t\t{\n\t\t\t\t$arrOnChange = deserialize($objModule->customcatalog_edit_notification_attributes);\n\t\t\t}\n\t\t\t\n\t\t\tif($objNotification->type == 'cc_feedit_onchange' && $objSession->get($strHelperSession) !== null)\n\t\t \t{\n\t\t\t \t$arr = $objSession->get($strHelperSession);\n\t\t\t \t$objEntry = \\Database::getInstance()->prepare(\"SELECT * FROM \".$arr['table'].\" WHERE id=?\")->limit(1)->execute($arr['id']);\n\t\t\t}\n\t\t\t\n\t\t\tforeach($objEntry->row() as $strFieldName => $strFieldValue) \n\t\t\t{\n\t\t\t\t$value = \\Haste\\Util\\Format::dcaValue('tl_'.$strTable, $strFieldName, $strFieldValue);\n\t\t\t \n\t\t\t // new value from POST\n\t\t\t if(isset($_POST[$strFieldName]))\n\t\t\t {\n\t\t\t\t $value = \\Input::post($strFieldName);\n\t\t\t }\n\t\t\t \n\t\t\t // onchange notification\n\t\t\t if($objNotification->type == 'cc_feedit_onchange' && in_array($strFieldName, $arrOnChange) && count($arrOnChange) > 0)\n\t\t\t {\n\t\t\t\t \t// did the value change?\n\t\t\t\t \t$_post = \\Input::postRaw($strFieldName);\n\t\t\t\t \t$_value = $objEntry->{$strFieldName};\n\t\t\t\t \t\t\n\t\t\t\t \t// binary image values\n\t\t\t\t \tif(\\Validator::isBinaryUuid($_value))\n\t\t\t\t \t{\n\t\t\t\t\t\t$_value = \\StringUtil::binToUuid( \\FilesModel::findByUuid($_value)->uuid );\n\t\t\t\t\t}\n\t\t\t\t\t// arrays\n\t\t\t\t\telse if(is_array(deserialize($_value)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_value = deserialize($_value);\n\t\t\t\t\t\tif(!is_array($_post))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_post = explode(',', $_post);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!array_diff($_value , $_post))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_value = $_post = 1; // make them equal\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// skip attributes that did not change\n\t\t\t\t \tif($_post == $_value)\n\t\t\t\t \t{\n\t\t\t\t\t \tunset($arrOnChange[ array_search($strFieldName,$arrOnChange) ]);\n\t\t\t\t\t \t\n\t\t\t\t\t \tif($GLOBALS['PCT_CUSTOMCATALOG_FRONTEDIT_NOTIFICATION_CENTER']['onChangeShowOnlyNewValues'] === true)\n\t\t\t\t\t \t{\n\t\t\t\t\t \t\tcontinue;\n\t\t\t\t\t \t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// skip unselected attributes\n\t\t\t\telse if($objNotification->type == 'cc_feedit_onchange' && !in_array($strFieldName, $arrOnChange) && count($arrOnChange) > 0 && $GLOBALS['PCT_CUSTOMCATALOG_FRONTEDIT_NOTIFICATION_CENTER']['onChangeShowOnlyNewValues'] === true)\n\t\t\t {\n\t\t\t\t continue;\n\t\t\t }\n\t\t\t \n\t\t\t // HOOK here to modify the output value\n\t\t\t if (is_array($GLOBALS['CUSTOMCATALOG_FRONTEDIT_HOOKS']['notificationValue']) && count($GLOBALS['CUSTOMCATALOG_FRONTEDIT_HOOKS']) > 0)\n\t\t\t {\n\t\t\t \tforeach($GLOBALS['CUSTOMCATALOG_FRONTEDIT_HOOKS']['notificationValue'] as $callback)\n\t\t\t \t{\n\t\t\t \t\t$value = \\System::importStatic($callback[0])->{$callback[1]}($varValue,$objEntry,$this);\n\t\t\t \t}\n\t\t\t }\n\t\t\t \n\t\t\t if($value !== null)\n\t\t\t {\n\t\t\t $arrTokens['customcatalog_entry_' . $strFieldName] = $value;\n\t\t\t\t $arrFormatted[] = $strFieldName.': '.$value;\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\t$arrTokens['customcatalog_entry'] = implode(\"\\n\",$arrFormatted);\n\t\t\t\n\t\t\t// member tokens\n\t\t\t$objUser = \\BackendUser::getInstance();\n\t\t\t$objMemberModel = \\MemberModel::findByPk($objUser->id);\n\t\t\tif($objMemberModel !== null)\n\t\t\t{\n\t\t\t\t$arrFormatted = array();\n\t\t\t\tforeach($objMemberModel->row() as $strFieldName => $strFieldValue) \n\t\t\t\t{\n\t\t\t\t\t$value = \\Haste\\Util\\Format::dcaValue('tl_member', $strFieldName, $strFieldValue);\n\t\t\t\t $arrTokens['member_' . $strFieldName] = $value;\n\t\t\t\t $arrFormatted[] = $strFieldName.': '.$value;\n\t\t\t\t}\n\t\t\t\t$arrTokens['member'] = implode(\"\\n\",$arrFormatted);\n\t\t\t}\n\t\t\t\n\t\t\t// do not submit if nothing has changed\n\t\t\tif($objNotification->type == 'cc_feedit_onchange' && count($arrOnChange) < 1)\n\t\t\t{\n\t\t\t\t$blnDoNotSubmit = true;\n\t\t\t}\n\t\t\t\n\t\t\t// remove the helper session\n\t\t\tif($objNotification->type == 'cc_feedit_onchange')\n\t\t\t{\n\t\t\t\t$objSession->remove($strHelperSession);\n\t\t\t}\n\t\t\t\n\t\t\t// send notification\n\t\t\tif($blnDoNotSubmit === false)\n\t\t\t{\n\t\t\t\t$objNotification->send($arrTokens,$strLanguage);\n\t\t\t}\n\t\t}\n\t}", "abstract protected function handleCommand();" ]
[ "0.6897038", "0.6483281", "0.6270711", "0.6165198", "0.5746487", "0.5505703", "0.53441197", "0.53336763", "0.5329862", "0.5312605", "0.5243433", "0.50592035", "0.5035314", "0.5031114", "0.5007371", "0.49907684", "0.49684906", "0.49662828", "0.49214995", "0.48911062", "0.4852939", "0.48197353", "0.48129347", "0.48064908", "0.47667348", "0.47460184", "0.47388187", "0.4731211", "0.47191182", "0.4711493" ]
0.741681
0
this behavior is set to do something before an event is created (set some addon's customs fields e.g.) the parameters are $eh, the eventHandler object instance, and array(&$cur_post, &cur_event)
public static function coreEventHandlerBeforeEventAdd($eh, $cur_post, $cur_event) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function coreEventHandlerBeforeEventUpdate($eh, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function adminBeforeEventHandlerCreate($cur_post, $cur_event) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "public static function coreEventHandlerAfterEventAdd($eh, $post_id, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function adminBeforeEventHandlerUpdate($cur_post, $cur_event, $post_id) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "public static function adminAfterEventHandlerCreate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "protected function init()\n {\n // here implement your own event logic\n }", "public static function coreEventHandlerBeforeGetEvents($eh, $args) {\n\t\t\tforeach ($args as $v => $k) {\n\t\t\t\t$$v = &$args[$v];\n\t\t\t} #Recreates the byref args.\n\t\t\t$col = (array) $params['columns'];\n\t\t\t$col[] = 'dummy';\n\t\t\t$params['columns'] = $col;\n\n\t\t\tif (!empty($params['dummy'])) {\n\t\t\t\t$params['sql'] .= \"AND EH.dummy = '\" . $eh->con->escape($params['dummy']) . \"' \";\n\t\t\t}\n\t\t}", "public function preInsert(Doctrine_Event $event)\n {\n // Set value for the creator field.\n if (! $this->_options['creator']['disabled'])\n {\n $creatorName = $event->getInvoker()->getTable()->getFieldName($this->_options['creator']['name']);\n $modified = $event->getInvoker()->getModified();\n\n if ( ! isset($modified[$creatorName]))\n {\n $event->getInvoker()->$creatorName = yaContext::getInstance()->getUser()->getId();\n }\n }\n\n // Set value for the updater field.\n if ( ! $this->_options['updater']['disabled'] && $this->_options['updater']['onInsert'])\n {\n $updaterName = $event->getInvoker()->getTable()->getFieldName($this->_options['updater']['name']);\n $modified = $event->getInvoker()->getModified();\n\n if ( ! isset($modified[$updaterName]))\n {\n $event->getInvoker()->$updaterName = yaContext::getInstance()->getUser()->getId();\n }\n }\n }", "protected function post_eventos() {}", "public function preInsert( $event )\n {\n parent::preInsert($event);\n $this->created_at = yiggTools::getDbDate();\n }", "protected function setUp()\n {\n $this->object = new Event('test', $this, ['invoker' => $this]);\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n\t}", "function elgg_trigger_before_event($event, $object_type, $object = null) {\n\treturn _elgg_services()->events->trigger(\"$event:before\", $object_type, $object);\n}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\n\t}", "public function init()\n {\n parent::init();\n //$this->on(self::EVENT_AFTER_SAVE, [$this, 'handlerName']);\n }", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n//\tonscreen events\n\n\t}", "function before($event = array())\n\t\t{\n\t\t\treturn true;\n\t\t}", "function pmpro_events_activation_hook() {\r\n\t// Create transient data.\r\n\tset_transient( 'pmpro-events-admin-notice', true, 5 );\r\n}", "abstract protected function pre_notificar($evento);", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeDelete\"]=true;\n\n\n\t}", "abstract protected function on_init();", "function __construct()\n\t{\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n\t\t$this->events[\"BeforeQueryPrint\"]=true;\n\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t}", "protected function setUp()\n {\n $this->object = new Event('test.event', array('test' => 'testValue'));\n }", "public function initEvents()\r\n\t{\r\n\t\t$this->on(\"afterCreate\", function($e) {\r\n\t\t\t$this->config('current.section', $this->event('section'));\r\n\r\n\t\t\t$value = Json::isJson($this->event('value')) ? Json::decode($this->event('value')) : $this->event('value');\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->set(Session::settings.'.'.$this->event('key'), $value);\r\n\r\n\t\t\t$this->config($this->uriOf($this->event('key'), true).'.value', $this->event('value'));\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on(\"afterUpdate\", function($e) {\r\n\r\n\t\t\t$value = Json::isJson($this->event('value')) ? Json::decode($this->event('value')) : $this->event('value');\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->set(Session::settings.'.'.$this->event('key'), $value);\r\n\r\n\t\t\t$this->config($this->uriOf($this->event('key'), true).'.value', $this->event('value'));\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on(\"afterDelete\", function($e) {\r\n\t\t\tswitch($this->event('action'))\r\n\t\t\t{\r\n\t\t\t\tcase 'delete':\r\n\t\t\t\t$value = $section;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$this->configRemove($this->uriOf($this->event('key'), true), true);\r\n\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->remove(Session::settings.'.'.$this->event('key'));\r\n\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on('logData', function ($e) {\r\n\t\t\t$data = array_merge($this->getEventData(), $this->_event->data);\r\n\t\t\t\\Yii::$app->getModule('nitm')->log($data, 4, null, $this);\r\n\t\t\t$this->_event->handled = true;\r\n\t\t});\r\n\t}", "public function preInsert($event) {\n\t\tself::fireCategoryAdded($this);\n\t}", "function _init(&$event)\n\t\t{\n\t\t\t// call base::_init()\n\t\t\tparent::_init($event);\n\t\t\t\n\t\t\tif($event instanceof event)\n\t\t\t{\n\t\t\t\t// get the template object\n\t\t\t\t$this->template\t\t=\t&$event->return_object('template');\n\t\t\t\t\n\t\t\t\t// set some useful vars\n\t\t\t\t$this->controller\t=\t$event->get('_controller');\n\t\t\t\t$this->action\t\t=\t$event->get('_action');\n\t\t\t\t$this->args\t\t\t=\t$event->get('_arguments');\n\t\t\t}\n\t\t}", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n\t}", "public static function adminBeforeEventHandlerDelete($post_id) {\n\t\tglobal $dummy;\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "protected function pre_init_hooks()\n\t{\n\t}", "public function setUp()\n {\n $this->event = new Phergie_Event_Command;\n }" ]
[ "0.7782693", "0.73809797", "0.66678506", "0.66037804", "0.6385105", "0.61673284", "0.6025295", "0.5929755", "0.5907716", "0.59056526", "0.5886002", "0.5839536", "0.58247155", "0.58013004", "0.57874686", "0.57741845", "0.57674336", "0.57592446", "0.5707052", "0.56639713", "0.5658552", "0.56487817", "0.5646959", "0.5637987", "0.56361294", "0.5630453", "0.5623787", "0.5620036", "0.56171376", "0.5607744" ]
0.80622566
0
this behavior is set to do something after an event is created the parameters are $eh, the eventHandler object instance, the new event $post_id, $cur_post and $cur_event
public static function coreEventHandlerAfterEventAdd($eh, $post_id, $cur_post, $cur_event) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function adminAfterEventHandlerCreate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "public static function coreEventHandlerBeforeEventAdd($eh, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function coreEventHandlerBeforeEventUpdate($eh, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function adminAfterEventHandlerUpdate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "public static function adminBeforeEventHandlerCreate($cur_post, $cur_event) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "protected function post_eventos() {}", "public function onPostCreated($event)\n {\n //\n }", "public static function coreEventHandlerGetEventCursor($eh, $post_id, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function coreEventHandlerEventDelete($eh, $post_id) {\n\t\t\t#do something before event deletion\n\t\t}", "public static function adminBeforeEventHandlerUpdate($cur_post, $cur_event, $post_id) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "function ua_webtide_events_add_after_event_description() {\n\tglobal $post;\n\t\n\t// Only for single events pages\n\tif ( ! is_singular( 'tribe_events' ) ) {\n\t\treturn;\n\t}\n\t\n\t// Get the event ID\n\tif ( ! ( $event_id = isset( $post ) && isset( $post->ID ) ? $post->ID : NULL ) ) {\n\t\treturn;\n\t}\n\t\n}", "protected abstract function createEvent();", "public function initEvents()\r\n\t{\r\n\t\t$this->on(\"afterCreate\", function($e) {\r\n\t\t\t$this->config('current.section', $this->event('section'));\r\n\r\n\t\t\t$value = Json::isJson($this->event('value')) ? Json::decode($this->event('value')) : $this->event('value');\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->set(Session::settings.'.'.$this->event('key'), $value);\r\n\r\n\t\t\t$this->config($this->uriOf($this->event('key'), true).'.value', $this->event('value'));\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on(\"afterUpdate\", function($e) {\r\n\r\n\t\t\t$value = Json::isJson($this->event('value')) ? Json::decode($this->event('value')) : $this->event('value');\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->set(Session::settings.'.'.$this->event('key'), $value);\r\n\r\n\t\t\t$this->config($this->uriOf($this->event('key'), true).'.value', $this->event('value'));\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on(\"afterDelete\", function($e) {\r\n\t\t\tswitch($this->event('action'))\r\n\t\t\t{\r\n\t\t\t\tcase 'delete':\r\n\t\t\t\t$value = $section;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$this->configRemove($this->uriOf($this->event('key'), true), true);\r\n\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->remove(Session::settings.'.'.$this->event('key'));\r\n\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on('logData', function ($e) {\r\n\t\t\t$data = array_merge($this->getEventData(), $this->_event->data);\r\n\t\t\t\\Yii::$app->getModule('nitm')->log($data, 4, null, $this);\r\n\t\t\t$this->_event->handled = true;\r\n\t\t});\r\n\t}", "function newEvent() {\n\t\t$this->event_id = '_new';\n\t\treturn $this->editEvent();\n\t}", "public function buildAndForwardEvent(Event $e);", "public function saveEvent($eventData)\n {\n // Deletes event from db\n if ($eventData->changeType === 'Deleted') {\n global $wpdb;\n $eventManagerUid = $this->getEventUid($eventData->id);\n // Check if the post exist in db\n $result = $wpdb->get_row(\"select post_id from $wpdb->postmeta where meta_value = '{$eventManagerUid}'\", ARRAY_N);\n // Delete the event if it exists\n if (isset($result[0]) && is_numeric($result[0])) {\n wp_trash_post((int)$result[0]);\n }\n\n return;\n }\n\n $data['uId'] = $eventData->id;\n $data['postTitle'] = !empty($eventData->title) ? strip_tags($eventData->title) : null;\n $data['postContent'] = !empty($eventData->contentZones) ? implode(\"\\n\", (array)$eventData->contentZones) : '';\n $data['postContent'] .= !empty($eventData->otherInformation) ? $eventData->otherInformation : '';\n $data['postContent'] = strip_tags($data['postContent']);\n $data['image'] = !empty($eventData->imageUrl) ? $eventData->imageUrl : null;\n $data['event_link'] = !empty($eventData->url) ? $eventData->url : null;\n $data['postStatus'] = get_field('ols_post_status', 'option') ? get_field('ols_post_status', 'option') : 'publish';\n $data['userGroups'] = (is_array($this->apiKeys['default_groups']) && !empty($this->apiKeys['default_groups'])) ?\n array_map(\n 'intval',\n $this->apiKeys['default_groups']\n ) : null;\n $data['categories'] = isset($eventData->tags) && is_array($eventData->tags) ? $this->sanitizeCategories($eventData->tags) : array();\n\n $data['occasions'] = array();\n if (!empty($eventData->occurrences)) {\n foreach ($eventData->occurrences as $occasion) {\n\n $locationId = !empty($occasion->library) ? $this->maybeCreateLocation($occasion->library, $data['userGroups'], $data['postStatus']) : null;\n\n $start = new \\DateTime($occasion->start);\n $start = $start->format('Y-m-d H:i:s');\n\n $end = new \\DateTime($occasion->stop);\n $end = $end->format('Y-m-d H:i:s');\n\n $data['occasions'][] = array(\n 'start_date' => $start,\n 'end_date' => $end,\n 'door_time' => $start,\n 'status' => $occasion->canceled ? 'cancelled' : 'scheduled',\n 'location_mode' => !empty($locationId) ? 'custom' : 'master',\n 'location' => !empty($locationId) ? $locationId : null,\n );\n }\n }\n\n $this->maybeCreateEvent($data);\n }", "public function addHandler()\n {\n $adapter = $this->getMockedAdapter();\n $adapter->expects($this->once())\n ->method('execute')\n ->with($this->isInstanceOf(Update::class), [':id' => 2, ':user_id' => 2])\n ->willReturn(1);\n $this->hasMany->setAdapter($adapter);\n $person = new Person(['id' => '2', 'name' => 'test']);\n $post = new Post(['id' => 2, 'title' => 'test']);\n $collection = new EntityCollection(Person::class);\n $collection->setParentEntity($person);\n $event = new EntityAdded($post, ['collection' => $collection]);\n $this->hasMany->add($event);\n }", "public static function createEvent($args) {\n\t\t\t$defaults = array(\n\t\t\t\t'post_type' => TribeEvents::POSTTYPE\n\t\t\t);\t\t\t\n\n\t\t\t$args = wp_parse_args( $args, $defaults);\n\t\t\t$eventId = wp_insert_post($args, true);\t\n\n\t\t\tif( !is_wp_error($eventId) ) {\n\t\t\t\tTribeEventsAPI::saveEventMeta($eventId, $args, get_post( $eventId ) );\n\t\t\t\treturn $eventId;\n\t\t\t}\t\t\n\t\t}", "public static function adminBeforeEventHandlerDelete($post_id) {\n\t\tglobal $dummy;\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "function save_event_callback() {\n\tglobal $wpdb;\n\n $id = $_POST['id'];\n $type = $_POST['type'];\n $name = $_POST['name'];\n $description = $_POST['description'];\n $days = $_POST['days'];\n $start_date = $_POST['startDate'];\n $end_date = $_POST['endDate'];\n $time = $_POST['time'];\n $units = $_POST['units'];\n $types = $_POST['types'];\n $organizer = $_POST['organizer'];\n $location = $_POST['location'];\n $imageUrl = $_POST['imageUrl'];\n $author = $_POST['author'];\n\n // Create event\n $event = \tarray ( 'EventID' => $id,\n 'Name' => $name,\n 'Description' => $description,\n 'Approved' => $approved,\n 'OrganizerID' => $organizer,\n 'Location' => $location,\n 'ExternalEventID' => $external_id );\n\n // Event types\n $event_types = explode(',', $types);\n\n // Administration units\n if ($units && !empty($units)){\n $administrations = explode(',', $units);\n foreach($administrations as $unit) {\n $administration_units[] = HelsingborgEventModel::get_administration_id_from_name($unit)->AdministrationUnitID;\n }\n }\n\n // Image\n if ($imageUrl)\n $image = array( 'ImagePath' => $imageUrl, 'Author' => $author);\n\n // Create time/times\n $event_times = array();\n if ($single_date) { // Single occurence\n $event_time = array('Date' => $single_date,\n 'Time' => $time,\n 'Price' => 0);\n array_push($event_times, $event_time);\n } else { // Must be start and end then\n $dates_array = create_date_range_array($start_date, $end_date);\n $filtered_days = filter_date_array_by_days($dates_array, $days_array);\n\n foreach($filtered_days as $date) {\n $event_time = array('Date' => $date,\n 'Time' => $time,\n 'Price' => 0);\n array_push($event_times, $event_time);\n }\n }\n\n $result = HelsingborgEventModel::update_event($event, $event_types, $administration_units, $image, $times);\n\n echo $result;\n\n\tdie();\n}", "function elgg_trigger_after_event($event, $object_type, $object = null) {\n\t$options = array(\n\t\t\\Elgg\\EventsService::OPTION_STOPPABLE => false,\n\t);\n\treturn _elgg_services()->events->trigger(\"$event:after\", $object_type, $object, $options);\n}", "function after($event = array())\n\t\t{\n\t\t}", "public function postUpdate (LifecycleEventArgs $args)\n {\n $this->handleDoctrineEvent($args);\n }", "public function postPersist (LifecycleEventArgs $args)\n {\n $this->handleDoctrineEvent($args);\n }", "static function _save_post( $post_id ) {\n\n\t\tdo {\n\n\t\t\tif ( self::EVENT_POST_TYPE !== get_post_type( $post_id ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! isset( $_POST['epr_event_nonce'] ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! wp_verify_nonce( $_POST['epr_event_nonce'], 'save_event' ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! isset( $_POST['epr_event'] ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! is_array( $_POST['epr_event'] ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$event = $_POST['epr_event'];\n\n\t\t\tif ( ! isset( $event['start'] ) ) {\n\t\t\t\t$event['start'] = '';\n\t\t\t}\n\t\t\tif ( ! isset( $event['end'] ) ) {\n\t\t\t\t$event['end'] = '';\n\t\t\t}\n\t\t\tif ( ! isset( $event['venue_id'] ) ) {\n\t\t\t\t$event['venue_id'] = 0;\n\t\t\t}\n\t\t\tupdate_post_meta( $post_id, '_epr_event[start]', $event['start'] );\n\t\t\tupdate_post_meta( $post_id, '_epr_event[end]', $event['end'] );\n\t\t\tupdate_post_meta( $post_id, '_epr_event[venue_id]', $event['venue_id'] );\n\n\t\t} while ( false );\n\n\t\treturn;\n\n\t}", "function eventAdded($cal_id, $event_id){\n\t\t// noop\n\t}", "public function postPersist(EventArgs $args)\n {\n $ea = $this->getEventAdapter($args);\n $om = $ea->getObjectManager();\n $object = $ea->getObject();\n $meta = $om->getClassMetadata(get_class($object));\n\n if ($this->getConfiguration($om, $meta->getName())) {\n $this->getStrategy($om, $meta->getName())->processPostPersist($om, $object, $ea);\n }\n }", "function mu_events_publish_event_hook( $event_id )\r\n{\r\n\tglobal $blog_id, $wpdb ;\r\n\t\r\n\tif( isset( $_POST['mu_event_is_global'] ) )\r\n\t{\r\n\t\t$is_global = $_POST['mu_event_is_global'] ;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$is_global = \"0\" ;\r\n\t}\r\n\tif(! update_post_meta( $event_id , MU_EVENTS_META_KEY_CREATE_AS_GLOBAL , $is_global ) )\r\n\t{\r\n\t\tadd_post_meta( $event_id , MU_EVENTS_META_KEY_CREATE_AS_GLOBAL , $is_global, true ) ;\r\n\t}\r\n\r\n\t$event \t\t\t\t= get_post( $event_id ) ;\r\n\t$mu_event_id \t\t= get_post_meta( $event_id , MU_EVENTS_META_KEY_ID , true ) ;\r\n\t$event_is_global \t= get_post_meta( $event_id , MU_EVENTS_META_KEY_CREATE_AS_GLOBAL , true ) ;\r\n\t$site_id \t\t\t= $blog_id ;\r\n\t$is_global \t\t\t= ( \"1\" == $event_is_global || 1 == $event_is_global || 1 == $site_id ) ? 1 : 0 ;\r\n\t\r\n\t\r\n\t$permalink = get_permalink( $event_id ) ;\r\n\t\r\n\tif( '' != trim( $mu_event_id ) )\r\n\t{\r\n\t\t$rows_affected = $wpdb->update( \r\n\t\t\t___TABLE , \r\n\t\t\tarray( \r\n\t\t\t\t\t'time' \t\t=> $event->post_date , \r\n\t\t\t\t\t'title' \t=> $event->post_title , \r\n\t\t\t\t\t'text' \t\t=> $event->post_excerpt , \r\n\t\t\t\t\t'url' \t\t=> $permalink , \r\n\t\t\t\t\t'site_id' \t=> $site_id , \r\n\t\t\t\t\t'event_id' \t=> $event_id, \r\n\t\t\t\t\t'is_active'\t=> 1,\r\n\t\t\t\t\t'is_global' => $is_global \r\n\t\t\t\t ) , \r\n\t\t\tarray( 'ID' => $mu_event_id ) , \r\n\t\t\tarray( \r\n\t\t\t\t\t'%s' ,\r\n\t\t\t\t\t'%s' ,\r\n\t\t\t\t\t'%s' ,\r\n\t\t\t\t\t'%s' ,\r\n\t\t\t\t\t'%d' ,\r\n\t\t\t\t\t'%d' ,\r\n\t\t\t\t\t'%d' ,\r\n\t\t\t\t\t'%d' \r\n\t\t\t\t) , \r\n\t\t\tarray( '%d' ) \r\n\t\t) ;\r\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\r\n# # # # # # # # # # # # # # BUGFIX 0.8.4 # # # # # # # # # # # # #\r\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\r\n# If the query returns 0 rows affected, we've triggered the 0.8.0 #\r\n# upgrade bug. Re-create the global event entry. #\r\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\r\n\t\tif( 0 == $rows_affected )\r\n\t\t{\r\n\t\t\t$rows_affected = $wpdb->insert( \r\n\t\t\t\t___TABLE,\r\n\t\t\t\tarray( \r\n\t\t\t\t\t\t'time' \t\t=> $event->post_date , \r\n\t\t\t\t\t\t'title' \t=> $event->post_title , \r\n\t\t\t\t\t\t'text' \t\t=> $event->post_excerpt , \r\n\t\t\t\t\t\t'url' \t\t=> $permalink , \r\n\t\t\t\t\t\t'site_id' \t=> $site_id , \r\n\t\t\t\t\t\t'event_id' \t=> $event_id, \r\n\t\t\t\t\t\t'is_active' => 1,\r\n\t\t\t\t\t\t'is_global' => $is_global\r\n\t\t\t\t\t ) \r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$mu_event_id = $wpdb->insert_id ;\r\n\t\t\tadd_post_meta( $event_id , MU_EVENTS_META_KEY_ID , $mu_event_id , true ) ;\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n///TODO: Rednudant code -- functionize this in future versions.\r\n\t\t$rows_affected = $wpdb->insert( \r\n\t\t\t___TABLE,\r\n\t\t\tarray( \r\n\t\t\t\t\t'time' \t\t=> $event->post_date , \r\n\t\t\t\t\t'title' \t=> $event->post_title , \r\n\t\t\t\t\t'text' \t\t=> $event->post_excerpt , \r\n\t\t\t\t\t'url' \t\t=> $permalink , \r\n\t\t\t\t\t'site_id' \t=> $site_id , \r\n\t\t\t\t\t'event_id' \t=> $event_id, \r\n\t\t\t\t\t'is_active' => 1,\r\n\t\t\t\t\t'is_global' => $is_global\r\n\t\t\t\t ) \r\n\t\t);\r\n\t\t\r\n\t\t$mu_event_id = $wpdb->insert_id ;\r\n\t\tadd_post_meta( $event_id , MU_EVENTS_META_KEY_ID , $mu_event_id , true ) ;\r\n\t}\r\n}", "public function __construct($post)\n {\n parent::__construct($post);\n // Fetch the event details\n $details = get_field('sd_event_details', $post->ID);\n $this->start_time = self::toDatetime($details['start_time']);\n $this->end_time = self::toDatetime($details['end_time']);\n\n $this->facebookId = get_field('sd_event_facebook_event', $post->ID);\n if ($this->facebookId) {\n // We have a facebook event\n $facebook_place_stored = get_post_meta($post->ID, EventsModule::FACEBOOK_PLACE_META_KEY, true);\n $this->facebook_place = maybe_unserialize($facebook_place_stored);\n } else {\n $this->google_place = $details['venue'];\n }\n }", "public function after($event = array()) {\n\t}" ]
[ "0.77311593", "0.74973935", "0.7131205", "0.6613237", "0.66091543", "0.62653434", "0.600525", "0.598519", "0.5972036", "0.5899413", "0.57253623", "0.5623184", "0.55338633", "0.54960823", "0.5477985", "0.5456935", "0.5387685", "0.53611714", "0.5342935", "0.52614456", "0.52593553", "0.52430516", "0.5194495", "0.51905316", "0.515858", "0.5133552", "0.51116395", "0.511144", "0.50999343", "0.5097578" ]
0.82162595
0
this behavior is set to do something before an event is updated (set some addon's customs fields e.g.) the parameters are $eh, the eventHandler object instance, $cur_post and $cur_event
public static function coreEventHandlerBeforeEventUpdate($eh, $cur_post, $cur_event) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function coreEventHandlerBeforeEventAdd($eh, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function adminBeforeEventHandlerUpdate($cur_post, $cur_event, $post_id) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "public static function adminBeforeEventHandlerCreate($cur_post, $cur_event) {\n\t\t$dummy = isset($_POST['dummy']) ? (integer) $_POST['dummy'] : null;\n\t\t$cur_event->dummy = $dummy;\n\t}", "public static function coreEventHandlerAfterEventAdd($eh, $post_id, $cur_post, $cur_event) {\n\t\t\t\n\t\t}", "public static function adminAfterEventHandlerUpdate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "public function preUpdate(EventArgs $args)\n {\n $ea = $this->getEventAdapter($args);\n $om = $ea->getObjectManager();\n $object = $ea->getObject();\n $meta = $om->getClassMetadata(get_class($object));\n\n if ($this->getConfiguration($om, $meta->getName())) {\n $this->getStrategy($om, $meta->getName())->processPreUpdate($om, $object);\n }\n }", "public function preUpdate(PreUpdateEventArgs $args) {\n $entity = $args->getEntity();\n $this->processFields($entity);\n }", "public static function coreEventHandlerBeforeGetEvents($eh, $args) {\n\t\t\tforeach ($args as $v => $k) {\n\t\t\t\t$$v = &$args[$v];\n\t\t\t} #Recreates the byref args.\n\t\t\t$col = (array) $params['columns'];\n\t\t\t$col[] = 'dummy';\n\t\t\t$params['columns'] = $col;\n\n\t\t\tif (!empty($params['dummy'])) {\n\t\t\t\t$params['sql'] .= \"AND EH.dummy = '\" . $eh->con->escape($params['dummy']) . \"' \";\n\t\t\t}\n\t\t}", "public function preUpdate(PreUpdateEventArgs $event)\n {\n }", "public function preUpdate(LifecycleEventArgs $args)\n {\n $this->trigger('entity.update.pre', $args);\n }", "public static function adminAfterEventHandlerCreate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "public function testPreUpdate(): void\n {\n $this->mockMethods();\n $args = new LifecycleEventArgs(\n $this->object,\n $this->entityManager\n );\n\n $this->listener->prePersist($args);\n }", "public function onPreUpdate()\n {\n parent::onPreUpdate();\n $this->upsertOperationData(true);\n }", "protected function onPreUpdate($object)\n {\n // Implements logic for pre-update actions here\n }", "public function preUpdate($event) {\n\t\t\n\t\tif($this->oldParentId != null) {\n\t\t\tself::fireCategoryMoved($this->oldParentId,$this->category_id,$this->website_count);\n\t\t}\n\t\tif($this->oldIsAdult != null) {\n\t\t\tself::fireCategoryIsAdultStateChanged($this);\n\t\t}\n\t}", "public function preUpdate(LifecycleEventArgs $eventArgs)\n {\n $this->object = $eventArgs->getObject();\n\n // Handle updating shop lists\n if ($this->object instanceof ShopList)\n {\n $this->shop_lists_to_update[spl_object_hash($this->object)] = $this->object;\n }\n\n // Handle updating shop list elements and their shop lists\n elseif ($this->object instanceof ShopListElement)\n {\n $this->shop_lists_to_update[spl_object_hash($this->object->getShopList())] = $this->object->getShopList();\n $this->object->calculateTotal();\n }\n }", "public function postUpdate(LifecycleEventArgs $args) {\n\n $entity = $args->getEntity();\n $this->processFields($entity, false);\n\n }", "public function beforeUpdate()\n {\n }", "public function preInsert(Doctrine_Event $event)\n {\n // Set value for the creator field.\n if (! $this->_options['creator']['disabled'])\n {\n $creatorName = $event->getInvoker()->getTable()->getFieldName($this->_options['creator']['name']);\n $modified = $event->getInvoker()->getModified();\n\n if ( ! isset($modified[$creatorName]))\n {\n $event->getInvoker()->$creatorName = yaContext::getInstance()->getUser()->getId();\n }\n }\n\n // Set value for the updater field.\n if ( ! $this->_options['updater']['disabled'] && $this->_options['updater']['onInsert'])\n {\n $updaterName = $event->getInvoker()->getTable()->getFieldName($this->_options['updater']['name']);\n $modified = $event->getInvoker()->getModified();\n\n if ( ! isset($modified[$updaterName]))\n {\n $event->getInvoker()->$updaterName = yaContext::getInstance()->getUser()->getId();\n }\n }\n }", "public function beforeUpdate() {\n }", "public function preUpdate(LifecycleEventArgs $event)\n {\n $this->callUpdate($event);\n }", "public function preUpdate(LifecycleEventArgs $eventArgs)\n {\n $em = $eventArgs->getEntityManager();\n $uow = $em->getUnitOfWork();\n\n /** @var DateTimeTrait $entity */\n $entity = $eventArgs->getEntity();\n\n if (($classMetadata = $em->getClassMetadata(get_class($entity))) instanceof ClassMetadata) {\n if ($this->isTimeStable($classMetadata)) {\n $entity->setUpdated($time = new DateTime());\n\n if ($this->addScheduled) {\n $uow->propertyChanged($entity, 'updated', null, $time);\n $uow->scheduleExtraUpdate($entity, [\n 'updated' => [null, $time],\n ]);\n }\n }\n }\n }", "protected function post_eventos() {}", "public function postUpdate (LifecycleEventArgs $args)\n {\n $this->handleDoctrineEvent($args);\n }", "public function on_update() {}", "public function preUpdate(PreUpdateEventArgs $args)\n {\n $entity = $args->getEntity();\n $this->uploadFile($entity);\n }", "public function preUpdate()\n {\n }", "public function initEvents()\r\n\t{\r\n\t\t$this->on(\"afterCreate\", function($e) {\r\n\t\t\t$this->config('current.section', $this->event('section'));\r\n\r\n\t\t\t$value = Json::isJson($this->event('value')) ? Json::decode($this->event('value')) : $this->event('value');\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->set(Session::settings.'.'.$this->event('key'), $value);\r\n\r\n\t\t\t$this->config($this->uriOf($this->event('key'), true).'.value', $this->event('value'));\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on(\"afterUpdate\", function($e) {\r\n\r\n\t\t\t$value = Json::isJson($this->event('value')) ? Json::decode($this->event('value')) : $this->event('value');\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->set(Session::settings.'.'.$this->event('key'), $value);\r\n\r\n\t\t\t$this->config($this->uriOf($this->event('key'), true).'.value', $this->event('value'));\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on(\"afterDelete\", function($e) {\r\n\t\t\tswitch($this->event('action'))\r\n\t\t\t{\r\n\t\t\t\tcase 'delete':\r\n\t\t\t\t$value = $section;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$this->configRemove($this->uriOf($this->event('key'), true), true);\r\n\r\n\t\t\tif($this->container == \\Yii::$app->getModule('nitm')->config->container)\r\n\t\t\t\t$this->remove(Session::settings.'.'.$this->event('key'));\r\n\r\n\t\t\t$this->trigger('logData');\r\n\t\t});\r\n\r\n\t\t$this->on('logData', function ($e) {\r\n\t\t\t$data = array_merge($this->getEventData(), $this->_event->data);\r\n\t\t\t\\Yii::$app->getModule('nitm')->log($data, 4, null, $this);\r\n\t\t\t$this->_event->handled = true;\r\n\t\t});\r\n\t}", "protected function _postUpdate()\n\t{\n\t}", "function pmpro_events_activation_hook() {\r\n\t// Create transient data.\r\n\tset_transient( 'pmpro-events-admin-notice', true, 5 );\r\n}" ]
[ "0.76108086", "0.7063732", "0.66417986", "0.65823245", "0.62261593", "0.6064001", "0.6031382", "0.59875536", "0.5981476", "0.5940768", "0.58185846", "0.57743776", "0.57517415", "0.5735919", "0.57325053", "0.5729442", "0.5719889", "0.5698842", "0.56832427", "0.5672813", "0.5655822", "0.56331944", "0.5614776", "0.56027514", "0.55967295", "0.55490226", "0.55383474", "0.5533728", "0.5531808", "0.5516066" ]
0.8292777
0
this behavior permits events list lines manipulation. the parameter is array('columns'=>&$colums) which is an array containing the html for the list header ( cells); You can insert or delete some but be careful to do the same in adminEventHandlerEventsListBody to get a coherent table. When called from Minilist, the parameter $ismini is true
public static function adminEventHandlerEventsListHeaders($args,$ismini=false) { $columns=&$args['columns']; $num = 3; //Insert a new column header @3rd position. if ($ismini) $num++;#Minilist adds a 'period' column so we increase $num $columns = array_merge(array_slice($columns, 0, $num), array('<th>' . __('Dummy') . '</th>'), array_slice($columns, $num)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function adminEventHandlerEventsListBody($rs,$args,$ismini=false) {\n\t\t\t$columns=&$args['columns'];\n\t\t\tforeach ($args as $v => $k) {\n\t\t\t\t$$v = &$args[$v];\n\t\t\t} #Recreates the byref args.\n\t\t\t$num = 3; //Insert a new column header @3rd position.\n\t\t\tif ($ismini)\n\t\t\t\t$num++;#Minilist adds a 'period' column so we increase $num\n\t\t\t$columns = array_merge(array_slice($columns, 0, $num), array(\"<td>\" . form::checkbox('dummy[' . $rs->post_id . ']', '1', (boolean) $rs->dummy, '', '', true) . \"</td>\"), array_slice($columns, $num));\n\t\t}", "private function showClientListExtraLine()\n\t{\n\t\tif (is_array($this->extraLine))\n\t\t\tcall_user_func_array('HTML_showTableRow', $this->extraLine);\n\t}", "public function aggregateListRow()\n {\n // Call Row Rendered event\n $this->rowRendered();\n }", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function setClientListExtraLine()\n\t{\n\t\tif ($this->outputColumns === null)\n\t\t\tdie('setClientListExtraLine: setOutputColumns must be called before');\n\n\t\t//Get the number of arguments of this function and the needed amount of arguments to match the columns of $this->outputColumns\n\t\t$argc = func_num_args();\n\t\t$colc = count($this->outputColumns);\n\n\t\tif ($argc != $colc)\n\t\t\tdie(\"setClientListExtraLine: $argc arguments got, $colc arguments expected.\");\n\n\t\t$this->extraLine = array();\n\t\tfor($i=0; $i < $argc; $i++)\n\t\t\t$this->extraLine[$i] = func_get_arg($i);\n\t}", "function AggregateListRow() {\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "protected function AdminLines() {\n\t$oPage = $this->Engine()->App()->Page();\n\t\n\t// set up the section menu\n\t$arMenu = array(\n\t new clsActionLink_option(array(),\n\t 'fig',\t\t// link key\n\t 'do',\t\t// group key\n\t 'figure',\t\t// display when off\n\t NULL,\t\t// display when on\n\t 'figure totals'\t// description (shows as hover-over text)\n\t ),\n\t );\n\t// render the section header\n\t$out = $oPage->ActionHeader('Contents',$arMenu);\n\t\n\t$rs = $this->LineRecords();\n\t$out .= $rs->AdminRows_forParent($this->GetKeyValue());\n\t\n\treturn $out;\n }", "protected function AdminPage_Lines() {\n\tif ($this->IsNew()) {\n\t $out = NULL;\n\t} else {\n\t $oPage = $this->PageObject();\n\t $oPath = $oPage->PathObj();\n\n\t $arPath = array();\t// not sure if anything is needed here\n\t $arActs = array(\n\t // (array $iarData,$iLinkKey,$iGroupKey=NULL,$iDispOff=NULL,$iDispOn=NULL,$iDescr=NULL)\n\t \n\t // 2016-09-19 multi-line editing currently doesn't work, so disabling the menu entry.\n\t //new clsActionLink_option($arPath,KS_ACTION_PKG_LINES_EDIT,NULL,'edit',NULL,'edit the package contents'),\n\t \n\t new clsActionLink_option($arPath,KS_ACTION_PKG_LINES_ADD,NULL,'add',NULL,'add package lines'),\t// TODO: should be admins only\n\t new clsAction_section('action'),\n\t new clsActionLink_option($arPath,'pack','do',NULL,NULL,'add items from stock'),\n\t );\n\n\t $hasItems = $this->ContainsItems();\n\t if ($hasItems) {\n\t\tif ($this->HasCharges()) {\n\t\t $arActs[] = new clsActionLink_option($arPath,\n\t\t 'uncharge','do',NULL,NULL,'remove charges for this package');\n\t\t} else {\n\t\t $arActs[] = new clsActionLink_option($arPath,\n\t\t 'charge','do',NULL,NULL,'add charges for this package');\n\t\t}\n\t\t$arActs[] = new clsActionLink_option($arPath,\n\t\t 'replace','do',NULL,NULL,'put items back in stock');\n\t }\n\n\t $out = $this->PageObject()->ActionHeader('Contents',$arActs);\n\n\t $tbl = $this->LineTable();\n\t $idPkg = $this->GetKeyValue();\n\t $out .= $tbl->AdminList_forPackage($idPkg);\n\t}\n\n\treturn $out;\n }", "protected function _prepareColumns() {\n $this->addColumn('history_id', array(\n 'header' => $this->getMonitoringHelper()->__('ID'),\n 'align' => 'right',\n 'index' => 'history_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => $this->getMonitoringHelper()->__('Date/Time'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('action', array(\n 'header' => $this->getMonitoringHelper()->__('Action'),\n 'index' => 'action',\n 'type' => 'options',\n 'options' => array(\n Wsu_Auditing_Helper_Data::ACTION_UPDATE => $this->__('Update'),\n Wsu_Auditing_Helper_Data::ACTION_INSERT => $this->__('Insert'),\n Wsu_Auditing_Helper_Data::ACTION_DELETE => $this->__('Delete'),\n )\n ));\n\n $this->addColumn('object_type', array(\n 'header' => $this->getMonitoringHelper()->__('Object Type'),\n 'index' => 'object_type',\n ));\n\n $this->addColumn('object_id', array(\n 'header' => $this->getMonitoringHelper()->__('Object ID'),\n 'index' => 'object_id',\n 'type' => 'number',\n ));\n\n $this->addColumn('content', array(\n 'header' => $this->getMonitoringHelper()->__('Content New'),\n 'index' => 'content',\n 'frame_callback' => array($this, 'showNewContent'),\n ));\n\n $this->addColumn('content_diff', array(\n 'header' => $this->getMonitoringHelper()->__('Diff to getOrigData()'),\n 'index' => 'content_diff',\n 'frame_callback' => array($this, 'showOldContent'),\n ));\n\n /* @var $adminUsers Mage_Admin_Model_Resource_User_Collection */\n $adminUsers = Mage::getResourceModel('admin/user_collection');\n $optionArray = array();\n foreach ($adminUsers as $adminUser) {\n $optionArray[$adminUser->getId()] = $this->entities($adminUser->getUsername());\n }\n\n $this->addColumn('user_id', array(\n 'header' => $this->getMonitoringHelper()->__('User'),\n 'index' => 'user_id',\n 'type' => 'options',\n 'options' => $optionArray,\n ));\n\n $this->addColumn('user_name', array(\n 'header' => $this->getMonitoringHelper()->__('User name logged'),\n 'index' => 'user_name',\n ));\n\n $this->addColumn('ip', array(\n 'header' => $this->getMonitoringHelper()->__('IP'),\n 'index' => 'ip',\n ));\n\n $this->addColumn('user_agent', array(\n 'header' => $this->getMonitoringHelper()->__('User Agent'),\n 'index' => 'user_agent',\n ));\n\n $this->addColumn('revert', array(\n 'header' => Mage::helper('customer')->__('Revert'),\n 'width' => 10,\n 'sortable' => false,\n 'filter' => false,\n 'renderer' => 'wsu_auditing/adminhtml_history_grid_revert',\n ));\n\n return parent::_prepareColumns();\n }", "public static function post_type_event_columns () : void\n {\n add_filter(\"manage_event_posts_columns\", function ($columns) {\n return [\n \"cb\" => $columns[\"cb\"],\n \"thumbnail\" => __(\"Thumbnail\", \"ahana\"),\n \"title\" => $columns[\"title\"],\n \"categories\" => __(\"Categories\", \"ahana\"),\n \"trainer\" => __(\"Trainer\", \"ahana\"),\n \"comments\" => $columns[\"comments\"],\n \"date\" => $columns[\"date\"]\n ];\n });\n\n add_filter(\"manage_event_posts_custom_column\", function ($column, $postId) {\n switch ($column) {\n case \"thumbnail\":\n the_post_thumbnail(\"admin_column_thumbnail\", $postId);\n break;\n case \"categories\":\n echo self::set_column(\"event\", $postId, \"category\");\n break;\n case \"trainer\":\n echo self::set_column(\"event\", $postId, \"trainer\");\n break;\n\n default:\n break;\n }\n }, 10, 2);\n }", "protected function setupListOperation()\n {\n CRUD::addButtonFromModelFunction('line', 'open_recipe', 'openRecipe', 'beginning');\n\n CRUD::column('image')\n ->type('closure')\n ->label('Image')\n ->function(function (Recipe $recipe) {\n if ($recipe->image) {\n return '<a href=\"'.url($this->crud->route.'/'.$recipe->getKey().'/edit').'\"><img src=\"/storage/'.$recipe->image.'\" width=\"80\"/></a>';\n }\n\n return '';\n });\n CRUD::column('title')->type('text')->label('Titre');\n CRUD::column('status')\n ->type('closure')\n ->label('Statut')\n ->function(function (Recipe $recipe) {\n $class = 'published' == $recipe->status ? 'badge-success' : 'badge-warning';\n $text = 'published' == $recipe->status ? 'Publiée' : 'Brouillon';\n\n return '<span class=\"badge '.$class.'\">'.$text.'</span>';\n });\n }", "protected function AdminRows_start() {\n\t$arBase = array(\n\t 'supp' => FALSE,\n\t 'year' => FALSE\n\t );\n\t$idReq = $this->GetRequestID();\n\tif (!is_null($idReq)) {\n\t $arBase[KS_ACTION_RESTOCK_REQUEST] = $idReq;\n\t}\n\t\n\t/*\n\t$arMenu = array(\n\t new clsActionLink_option(\n\t $arBase,\t// other stuff to always appear in URL, regardless of section's menu state\n\t KS_NEW_REC,\t// LinkKey: value that the group should be set to when this link is activated\n\t 'id',\t// GroupKey: group's identifier string in URL (.../iGroupKey:iLinkKey/...)\n\t\t\t // if NULL, presence of link key (.../iLinkKey/...) is a flag\n\t NULL,\t// DispOff: text to display when link is not activated - defaults to LinkKey\n\t NULL,\t// DispOn: text to display when link is activated - defaults to DispOff\n\t 'enter a new received restock from scratch'\t// description -- appears in hover-over popup\n\t ),\n\t );\n\t/*\n\t 2016-02-21 TODO: We need a generalized \"section header\" or \"section type\" that\n\t can also be a page header:\n\t When this fx is standalone, it should modify the page header -- but when\n\t it is a subsection (e.g. of a Restock Request page), it should just modify\n\t the current section. The object should receive a section object that could\n\t be either one (by default it would be the Page), and just modify that.\n\t*/\n\t/*\n\t//$this->PageObject()->PageHeaderWidgets($arMenu);\n\t$out = $this->PageObject()->ActionHeader('Restock Shipments Received',$arMenu)\n\t .\"\\n<table class=listing>\"\n\t ; */\n\t$oMenu = new fcHeaderMenu();\n\t\n\t // ($sGroupKey,$sKeyValue=TRUE,$sDispOff=NULL,$sDispOn=NULL,$sPopup=NULL)\n $oMenu->SetNode($ol = new fcMenuOptionLink(\n\t KS_PATHARG_NAME_INDEX,\t// 'id'\n\t KS_NEW_REC,\t\t\t// 'new'\n\t NULL,NULL,\n\t 'enter a new received restock from scratch'));\n\t $ol->AddLinkArray($arBase);\n\n\t$oHdr = new fcSectionHeader('Restock Shipments Received',$oMenu);\n\t\n\t$out = $oHdr->Render()\n\t .\"\\n<table class=listing>\"\n\t ;\n\treturn $out;\n }", "protected function _prepareColumns()\n {\n $this->addColumn('in_news', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_news',\n 'values' => $this->_getSelectedNews(),\n 'align' => 'center',\n 'index' => 'entity_id'\n ));\n $this->addColumn('name', array(\n 'header' => Mage::helper('oggetto_news')->__('Name'),\n 'align' => 'left',\n 'index' => 'name',\n 'renderer' => 'oggetto_news/adminhtml_helper_column_renderer_relation',\n 'params' => array(\n 'id' => 'getId'\n ),\n 'base_link' => 'adminhtml/news_news/edit',\n ));\n $this->addColumn('position', array(\n 'header' => Mage::helper('oggetto_news')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n ));\n }", "public static function adminEventHandlerMinilistCustomize($args) {\n\t\t\tforeach ($args as $v => $k)\n\t\t\t\t$$v = &$args[$v];\n\n\t\t\t#$params['dummy']=1; This would filter the events displayed on the dummy==1 criteria\n\t\t}", "protected function _prepareColumns()\n {\n $this->addColumn('event_id', array(\n 'header' => $this->_getHelper()->__('ID'),\n 'type' => 'number',\n 'index' => 'event_id',\n ));\n\n\n $this->addColumn('method', array(\n 'header' => $this->_getHelper()->__('Method'),\n 'type' => 'text',\n 'index' => 'method',\n 'column_css_class' => 'grid-column-width-100',\n ));\n\n $this->addColumn('request_url', array(\n 'header' => $this->_getHelper()->__('Request URL'),\n 'type' => 'text',\n 'index' => 'request_url',\n 'column_css_class' => 'grid-column-long-text-overflow',\n ));\n\n $this->addColumn('request', array(\n 'header' => $this->_getHelper()->__('Request'),\n 'type' => 'html',\n // 'width'=>'300px',\n 'column_css_class' => 'grid-column-long-text-overflow',\n 'index' => 'request',\n 'renderer' => 'Bluesnap_Payment_Block_Adminhtml_Widget_Grid_Column_Renderer_Xml',\n ));\n\n $this->addColumn('response', array(\n 'header' => $this->_getHelper()->__('Response'),\n 'type' => 'html',\n 'column_css_class' => 'grid-column-long-text-overflow',\n 'renderer' => 'Bluesnap_Payment_Block_Adminhtml_Widget_Grid_Column_Renderer_Xml',\n 'index' => 'response',\n ));\n\n\n $this->addColumn('ip', array(\n 'header' => $this->_getHelper()->__('IP'),\n 'type' => 'text',\n 'column_css_class' => 'grid-column-width-100',\n\n 'index' => 'ip',\n ));\n\n\n $this->addColumn('user_agent', array(\n 'header' => $this->_getHelper()->__('User Agent'),\n 'type' => 'text',\n 'column_css_class' => 'grid-column-long-text-overflow',\n\n 'index' => 'user_agent',\n ));\n\n\n $this->addColumn('message', array(\n 'header' => $this->_getHelper()->__('Message'),\n 'type' => 'text',\n 'column_css_class' => 'grid-column-width-100',\n // 'column_css'=>'width:200px',\n // 'css'=>'width:200px',\n // 'style'=>'width:200px',\n\n 'index' => 'message',\n ));\n\n\n $this->addColumn('increment_id', array(\n 'header' => $this->_getHelper()->__('Increment Id'),\n 'type' => 'number',\n 'index' => 'increment_id',\n ));\n\n // $this->addColumn('return_id', array(\n // 'header' => $this->_getHelper()->__('Return Id'),\n // 'type' => 'number',\n // 'index' => 'return_id',\n // ));\n\n\n $this->addColumn('created_at', array(\n 'header' => $this->_getHelper()->__('Created At'),\n 'type' => 'dateTime',\n 'index' => 'created_at',\n ));\n\n\n $this->addColumn('priority', array(\n 'header' => $this->_getHelper()->__('Log Level'),\n 'align' => 'left',\n 'index' => 'priority',\n 'type' => 'options',\n 'options' => $this->getSeverityOptions(),\n 'frame_callback' => array($this, 'decorateSeverity')\n ));\n\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return $this;\n //return parent::_prepareColumns();\n }", "public function renderList(){\r\n $this->addRowAction('edit');\r\n $this->addRowAction('delete');\r\n\r\n return parent::renderList();\r\n\r\n }", "function RenderListRow() {\n\t\tglobal $Security, $gsLanguage, $Language;\n\n\t\t// Call Row Rendering event\n\t\t$this->Row_Rendering();\n\n // Common render codes\n\t\t// tanggal\n\t\t// periode\n\t\t// id\n\t\t// nomor\n\t\t// transaksi\n\t\t// referensi\n\t\t// group\n\t\t// rekening\n\t\t// tipe\n\t\t// posisi\n\t\t// laporan\n\t\t// keterangan\n\t\t// debet1\n\t\t// credit1\n\t\t// saldo1\n\t\t// debet2\n\t\t// credit2\n\t\t// saldo2\n\t\t// debet3\n\t\t// credit3\n\t\t// saldo3\n\t\t// debet4\n\t\t// credit4\n\t\t// saldo4\n\t\t// debet5\n\t\t// credit5\n\t\t// saldo5\n\t\t// debet6\n\t\t// credit6\n\t\t// saldo6\n\t\t// debet7\n\t\t// credit7\n\t\t// saldo7\n\t\t// debet8\n\t\t// credit8\n\t\t// saldo8\n\t\t// debet9\n\t\t// credit9\n\t\t// saldo9\n\t\t// debet10\n\t\t// credit10\n\t\t// saldo10\n\t\t// debet11\n\t\t// credit11\n\t\t// saldo11\n\t\t// debet12\n\t\t// credit12\n\t\t// saldo12\n\t\t// tanggal\n\n\t\t$this->tanggal->ViewValue = $this->tanggal->CurrentValue;\n\t\t$this->tanggal->ViewValue = ew_FormatDateTime($this->tanggal->ViewValue, 0);\n\t\t$this->tanggal->ViewCustomAttributes = \"\";\n\n\t\t// periode\n\t\t$this->periode->ViewValue = $this->periode->CurrentValue;\n\t\t$this->periode->ViewCustomAttributes = \"\";\n\n\t\t// id\n\t\t$this->id->ViewValue = $this->id->CurrentValue;\n\t\t$this->id->ViewCustomAttributes = \"\";\n\n\t\t// nomor\n\t\t$this->nomor->ViewValue = $this->nomor->CurrentValue;\n\t\t$this->nomor->ViewCustomAttributes = \"\";\n\n\t\t// transaksi\n\t\t$this->transaksi->ViewValue = $this->transaksi->CurrentValue;\n\t\t$this->transaksi->ViewCustomAttributes = \"\";\n\n\t\t// referensi\n\t\t$this->referensi->ViewValue = $this->referensi->CurrentValue;\n\t\t$this->referensi->ViewCustomAttributes = \"\";\n\n\t\t// group\n\t\t$this->group->ViewValue = $this->group->CurrentValue;\n\t\t$this->group->ViewCustomAttributes = \"\";\n\n\t\t// rekening\n\t\t$this->rekening->ViewValue = $this->rekening->CurrentValue;\n\t\t$this->rekening->ViewCustomAttributes = \"\";\n\n\t\t// tipe\n\t\t$this->tipe->ViewValue = $this->tipe->CurrentValue;\n\t\t$this->tipe->ViewCustomAttributes = \"\";\n\n\t\t// posisi\n\t\t$this->posisi->ViewValue = $this->posisi->CurrentValue;\n\t\t$this->posisi->ViewCustomAttributes = \"\";\n\n\t\t// laporan\n\t\t$this->laporan->ViewValue = $this->laporan->CurrentValue;\n\t\t$this->laporan->ViewCustomAttributes = \"\";\n\n\t\t// keterangan\n\t\t$this->keterangan->ViewValue = $this->keterangan->CurrentValue;\n\t\t$this->keterangan->ViewCustomAttributes = \"\";\n\n\t\t// debet1\n\t\t$this->debet1->ViewValue = $this->debet1->CurrentValue;\n\t\t$this->debet1->ViewCustomAttributes = \"\";\n\n\t\t// credit1\n\t\t$this->credit1->ViewValue = $this->credit1->CurrentValue;\n\t\t$this->credit1->ViewCustomAttributes = \"\";\n\n\t\t// saldo1\n\t\t$this->saldo1->ViewValue = $this->saldo1->CurrentValue;\n\t\t$this->saldo1->ViewCustomAttributes = \"\";\n\n\t\t// debet2\n\t\t$this->debet2->ViewValue = $this->debet2->CurrentValue;\n\t\t$this->debet2->ViewCustomAttributes = \"\";\n\n\t\t// credit2\n\t\t$this->credit2->ViewValue = $this->credit2->CurrentValue;\n\t\t$this->credit2->ViewCustomAttributes = \"\";\n\n\t\t// saldo2\n\t\t$this->saldo2->ViewValue = $this->saldo2->CurrentValue;\n\t\t$this->saldo2->ViewCustomAttributes = \"\";\n\n\t\t// debet3\n\t\t$this->debet3->ViewValue = $this->debet3->CurrentValue;\n\t\t$this->debet3->ViewCustomAttributes = \"\";\n\n\t\t// credit3\n\t\t$this->credit3->ViewValue = $this->credit3->CurrentValue;\n\t\t$this->credit3->ViewCustomAttributes = \"\";\n\n\t\t// saldo3\n\t\t$this->saldo3->ViewValue = $this->saldo3->CurrentValue;\n\t\t$this->saldo3->ViewCustomAttributes = \"\";\n\n\t\t// debet4\n\t\t$this->debet4->ViewValue = $this->debet4->CurrentValue;\n\t\t$this->debet4->ViewCustomAttributes = \"\";\n\n\t\t// credit4\n\t\t$this->credit4->ViewValue = $this->credit4->CurrentValue;\n\t\t$this->credit4->ViewCustomAttributes = \"\";\n\n\t\t// saldo4\n\t\t$this->saldo4->ViewValue = $this->saldo4->CurrentValue;\n\t\t$this->saldo4->ViewCustomAttributes = \"\";\n\n\t\t// debet5\n\t\t$this->debet5->ViewValue = $this->debet5->CurrentValue;\n\t\t$this->debet5->ViewCustomAttributes = \"\";\n\n\t\t// credit5\n\t\t$this->credit5->ViewValue = $this->credit5->CurrentValue;\n\t\t$this->credit5->ViewCustomAttributes = \"\";\n\n\t\t// saldo5\n\t\t$this->saldo5->ViewValue = $this->saldo5->CurrentValue;\n\t\t$this->saldo5->ViewCustomAttributes = \"\";\n\n\t\t// debet6\n\t\t$this->debet6->ViewValue = $this->debet6->CurrentValue;\n\t\t$this->debet6->ViewCustomAttributes = \"\";\n\n\t\t// credit6\n\t\t$this->credit6->ViewValue = $this->credit6->CurrentValue;\n\t\t$this->credit6->ViewCustomAttributes = \"\";\n\n\t\t// saldo6\n\t\t$this->saldo6->ViewValue = $this->saldo6->CurrentValue;\n\t\t$this->saldo6->ViewCustomAttributes = \"\";\n\n\t\t// debet7\n\t\t$this->debet7->ViewValue = $this->debet7->CurrentValue;\n\t\t$this->debet7->ViewCustomAttributes = \"\";\n\n\t\t// credit7\n\t\t$this->credit7->ViewValue = $this->credit7->CurrentValue;\n\t\t$this->credit7->ViewCustomAttributes = \"\";\n\n\t\t// saldo7\n\t\t$this->saldo7->ViewValue = $this->saldo7->CurrentValue;\n\t\t$this->saldo7->ViewCustomAttributes = \"\";\n\n\t\t// debet8\n\t\t$this->debet8->ViewValue = $this->debet8->CurrentValue;\n\t\t$this->debet8->ViewCustomAttributes = \"\";\n\n\t\t// credit8\n\t\t$this->credit8->ViewValue = $this->credit8->CurrentValue;\n\t\t$this->credit8->ViewCustomAttributes = \"\";\n\n\t\t// saldo8\n\t\t$this->saldo8->ViewValue = $this->saldo8->CurrentValue;\n\t\t$this->saldo8->ViewCustomAttributes = \"\";\n\n\t\t// debet9\n\t\t$this->debet9->ViewValue = $this->debet9->CurrentValue;\n\t\t$this->debet9->ViewCustomAttributes = \"\";\n\n\t\t// credit9\n\t\t$this->credit9->ViewValue = $this->credit9->CurrentValue;\n\t\t$this->credit9->ViewCustomAttributes = \"\";\n\n\t\t// saldo9\n\t\t$this->saldo9->ViewValue = $this->saldo9->CurrentValue;\n\t\t$this->saldo9->ViewCustomAttributes = \"\";\n\n\t\t// debet10\n\t\t$this->debet10->ViewValue = $this->debet10->CurrentValue;\n\t\t$this->debet10->ViewCustomAttributes = \"\";\n\n\t\t// credit10\n\t\t$this->credit10->ViewValue = $this->credit10->CurrentValue;\n\t\t$this->credit10->ViewCustomAttributes = \"\";\n\n\t\t// saldo10\n\t\t$this->saldo10->ViewValue = $this->saldo10->CurrentValue;\n\t\t$this->saldo10->ViewCustomAttributes = \"\";\n\n\t\t// debet11\n\t\t$this->debet11->ViewValue = $this->debet11->CurrentValue;\n\t\t$this->debet11->ViewCustomAttributes = \"\";\n\n\t\t// credit11\n\t\t$this->credit11->ViewValue = $this->credit11->CurrentValue;\n\t\t$this->credit11->ViewCustomAttributes = \"\";\n\n\t\t// saldo11\n\t\t$this->saldo11->ViewValue = $this->saldo11->CurrentValue;\n\t\t$this->saldo11->ViewCustomAttributes = \"\";\n\n\t\t// debet12\n\t\t$this->debet12->ViewValue = $this->debet12->CurrentValue;\n\t\t$this->debet12->ViewCustomAttributes = \"\";\n\n\t\t// credit12\n\t\t$this->credit12->ViewValue = $this->credit12->CurrentValue;\n\t\t$this->credit12->ViewCustomAttributes = \"\";\n\n\t\t// saldo12\n\t\t$this->saldo12->ViewValue = $this->saldo12->CurrentValue;\n\t\t$this->saldo12->ViewCustomAttributes = \"\";\n\n\t\t// tanggal\n\t\t$this->tanggal->LinkCustomAttributes = \"\";\n\t\t$this->tanggal->HrefValue = \"\";\n\t\t$this->tanggal->TooltipValue = \"\";\n\n\t\t// periode\n\t\t$this->periode->LinkCustomAttributes = \"\";\n\t\t$this->periode->HrefValue = \"\";\n\t\t$this->periode->TooltipValue = \"\";\n\n\t\t// id\n\t\t$this->id->LinkCustomAttributes = \"\";\n\t\t$this->id->HrefValue = \"\";\n\t\t$this->id->TooltipValue = \"\";\n\n\t\t// nomor\n\t\t$this->nomor->LinkCustomAttributes = \"\";\n\t\t$this->nomor->HrefValue = \"\";\n\t\t$this->nomor->TooltipValue = \"\";\n\n\t\t// transaksi\n\t\t$this->transaksi->LinkCustomAttributes = \"\";\n\t\t$this->transaksi->HrefValue = \"\";\n\t\t$this->transaksi->TooltipValue = \"\";\n\n\t\t// referensi\n\t\t$this->referensi->LinkCustomAttributes = \"\";\n\t\t$this->referensi->HrefValue = \"\";\n\t\t$this->referensi->TooltipValue = \"\";\n\n\t\t// group\n\t\t$this->group->LinkCustomAttributes = \"\";\n\t\t$this->group->HrefValue = \"\";\n\t\t$this->group->TooltipValue = \"\";\n\n\t\t// rekening\n\t\t$this->rekening->LinkCustomAttributes = \"\";\n\t\t$this->rekening->HrefValue = \"\";\n\t\t$this->rekening->TooltipValue = \"\";\n\n\t\t// tipe\n\t\t$this->tipe->LinkCustomAttributes = \"\";\n\t\t$this->tipe->HrefValue = \"\";\n\t\t$this->tipe->TooltipValue = \"\";\n\n\t\t// posisi\n\t\t$this->posisi->LinkCustomAttributes = \"\";\n\t\t$this->posisi->HrefValue = \"\";\n\t\t$this->posisi->TooltipValue = \"\";\n\n\t\t// laporan\n\t\t$this->laporan->LinkCustomAttributes = \"\";\n\t\t$this->laporan->HrefValue = \"\";\n\t\t$this->laporan->TooltipValue = \"\";\n\n\t\t// keterangan\n\t\t$this->keterangan->LinkCustomAttributes = \"\";\n\t\t$this->keterangan->HrefValue = \"\";\n\t\t$this->keterangan->TooltipValue = \"\";\n\n\t\t// debet1\n\t\t$this->debet1->LinkCustomAttributes = \"\";\n\t\t$this->debet1->HrefValue = \"\";\n\t\t$this->debet1->TooltipValue = \"\";\n\n\t\t// credit1\n\t\t$this->credit1->LinkCustomAttributes = \"\";\n\t\t$this->credit1->HrefValue = \"\";\n\t\t$this->credit1->TooltipValue = \"\";\n\n\t\t// saldo1\n\t\t$this->saldo1->LinkCustomAttributes = \"\";\n\t\t$this->saldo1->HrefValue = \"\";\n\t\t$this->saldo1->TooltipValue = \"\";\n\n\t\t// debet2\n\t\t$this->debet2->LinkCustomAttributes = \"\";\n\t\t$this->debet2->HrefValue = \"\";\n\t\t$this->debet2->TooltipValue = \"\";\n\n\t\t// credit2\n\t\t$this->credit2->LinkCustomAttributes = \"\";\n\t\t$this->credit2->HrefValue = \"\";\n\t\t$this->credit2->TooltipValue = \"\";\n\n\t\t// saldo2\n\t\t$this->saldo2->LinkCustomAttributes = \"\";\n\t\t$this->saldo2->HrefValue = \"\";\n\t\t$this->saldo2->TooltipValue = \"\";\n\n\t\t// debet3\n\t\t$this->debet3->LinkCustomAttributes = \"\";\n\t\t$this->debet3->HrefValue = \"\";\n\t\t$this->debet3->TooltipValue = \"\";\n\n\t\t// credit3\n\t\t$this->credit3->LinkCustomAttributes = \"\";\n\t\t$this->credit3->HrefValue = \"\";\n\t\t$this->credit3->TooltipValue = \"\";\n\n\t\t// saldo3\n\t\t$this->saldo3->LinkCustomAttributes = \"\";\n\t\t$this->saldo3->HrefValue = \"\";\n\t\t$this->saldo3->TooltipValue = \"\";\n\n\t\t// debet4\n\t\t$this->debet4->LinkCustomAttributes = \"\";\n\t\t$this->debet4->HrefValue = \"\";\n\t\t$this->debet4->TooltipValue = \"\";\n\n\t\t// credit4\n\t\t$this->credit4->LinkCustomAttributes = \"\";\n\t\t$this->credit4->HrefValue = \"\";\n\t\t$this->credit4->TooltipValue = \"\";\n\n\t\t// saldo4\n\t\t$this->saldo4->LinkCustomAttributes = \"\";\n\t\t$this->saldo4->HrefValue = \"\";\n\t\t$this->saldo4->TooltipValue = \"\";\n\n\t\t// debet5\n\t\t$this->debet5->LinkCustomAttributes = \"\";\n\t\t$this->debet5->HrefValue = \"\";\n\t\t$this->debet5->TooltipValue = \"\";\n\n\t\t// credit5\n\t\t$this->credit5->LinkCustomAttributes = \"\";\n\t\t$this->credit5->HrefValue = \"\";\n\t\t$this->credit5->TooltipValue = \"\";\n\n\t\t// saldo5\n\t\t$this->saldo5->LinkCustomAttributes = \"\";\n\t\t$this->saldo5->HrefValue = \"\";\n\t\t$this->saldo5->TooltipValue = \"\";\n\n\t\t// debet6\n\t\t$this->debet6->LinkCustomAttributes = \"\";\n\t\t$this->debet6->HrefValue = \"\";\n\t\t$this->debet6->TooltipValue = \"\";\n\n\t\t// credit6\n\t\t$this->credit6->LinkCustomAttributes = \"\";\n\t\t$this->credit6->HrefValue = \"\";\n\t\t$this->credit6->TooltipValue = \"\";\n\n\t\t// saldo6\n\t\t$this->saldo6->LinkCustomAttributes = \"\";\n\t\t$this->saldo6->HrefValue = \"\";\n\t\t$this->saldo6->TooltipValue = \"\";\n\n\t\t// debet7\n\t\t$this->debet7->LinkCustomAttributes = \"\";\n\t\t$this->debet7->HrefValue = \"\";\n\t\t$this->debet7->TooltipValue = \"\";\n\n\t\t// credit7\n\t\t$this->credit7->LinkCustomAttributes = \"\";\n\t\t$this->credit7->HrefValue = \"\";\n\t\t$this->credit7->TooltipValue = \"\";\n\n\t\t// saldo7\n\t\t$this->saldo7->LinkCustomAttributes = \"\";\n\t\t$this->saldo7->HrefValue = \"\";\n\t\t$this->saldo7->TooltipValue = \"\";\n\n\t\t// debet8\n\t\t$this->debet8->LinkCustomAttributes = \"\";\n\t\t$this->debet8->HrefValue = \"\";\n\t\t$this->debet8->TooltipValue = \"\";\n\n\t\t// credit8\n\t\t$this->credit8->LinkCustomAttributes = \"\";\n\t\t$this->credit8->HrefValue = \"\";\n\t\t$this->credit8->TooltipValue = \"\";\n\n\t\t// saldo8\n\t\t$this->saldo8->LinkCustomAttributes = \"\";\n\t\t$this->saldo8->HrefValue = \"\";\n\t\t$this->saldo8->TooltipValue = \"\";\n\n\t\t// debet9\n\t\t$this->debet9->LinkCustomAttributes = \"\";\n\t\t$this->debet9->HrefValue = \"\";\n\t\t$this->debet9->TooltipValue = \"\";\n\n\t\t// credit9\n\t\t$this->credit9->LinkCustomAttributes = \"\";\n\t\t$this->credit9->HrefValue = \"\";\n\t\t$this->credit9->TooltipValue = \"\";\n\n\t\t// saldo9\n\t\t$this->saldo9->LinkCustomAttributes = \"\";\n\t\t$this->saldo9->HrefValue = \"\";\n\t\t$this->saldo9->TooltipValue = \"\";\n\n\t\t// debet10\n\t\t$this->debet10->LinkCustomAttributes = \"\";\n\t\t$this->debet10->HrefValue = \"\";\n\t\t$this->debet10->TooltipValue = \"\";\n\n\t\t// credit10\n\t\t$this->credit10->LinkCustomAttributes = \"\";\n\t\t$this->credit10->HrefValue = \"\";\n\t\t$this->credit10->TooltipValue = \"\";\n\n\t\t// saldo10\n\t\t$this->saldo10->LinkCustomAttributes = \"\";\n\t\t$this->saldo10->HrefValue = \"\";\n\t\t$this->saldo10->TooltipValue = \"\";\n\n\t\t// debet11\n\t\t$this->debet11->LinkCustomAttributes = \"\";\n\t\t$this->debet11->HrefValue = \"\";\n\t\t$this->debet11->TooltipValue = \"\";\n\n\t\t// credit11\n\t\t$this->credit11->LinkCustomAttributes = \"\";\n\t\t$this->credit11->HrefValue = \"\";\n\t\t$this->credit11->TooltipValue = \"\";\n\n\t\t// saldo11\n\t\t$this->saldo11->LinkCustomAttributes = \"\";\n\t\t$this->saldo11->HrefValue = \"\";\n\t\t$this->saldo11->TooltipValue = \"\";\n\n\t\t// debet12\n\t\t$this->debet12->LinkCustomAttributes = \"\";\n\t\t$this->debet12->HrefValue = \"\";\n\t\t$this->debet12->TooltipValue = \"\";\n\n\t\t// credit12\n\t\t$this->credit12->LinkCustomAttributes = \"\";\n\t\t$this->credit12->HrefValue = \"\";\n\t\t$this->credit12->TooltipValue = \"\";\n\n\t\t// saldo12\n\t\t$this->saldo12->LinkCustomAttributes = \"\";\n\t\t$this->saldo12->HrefValue = \"\";\n\t\t$this->saldo12->TooltipValue = \"\";\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "function events_listing_add_columns( $columns ) {\n\t$columns['events_listing_date'] = __( 'Event Date', 'events-listing-widget' );\n\tunset( $columns['date'] );\n\tunset( $columns['author'] );\n\n\treturn $columns;\n}", "protected function _prepareColumns() \n {\n\n $this->addColumn(\n 'in_devices', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_devices',\n 'values' => $this->_getSelectedDevices(),\n 'align' => 'center',\n 'index' => 'in_devices',\n 'use_index' => true,\n 'width' => '50px',\n 'renderer' => 'simipwa/adminhtml_notification_edit_renderer_devices'\n )\n );\n\n $this->addColumn(\n 'agent_id', array(\n 'header' => Mage::helper('simipwa')->__('ID'),\n 'align' => 'right',\n 'width' => '50px',\n 'index' => 'agent_id',\n )\n );\n\n $this->addColumn(\n 'user_agent', array(\n 'header' => Mage::helper('simipwa')->__('User Agent'),\n 'align' => 'right',\n 'width' => '400px',\n 'index' => 'user_agent',\n )\n );\n\n $this->addColumn(\n 'city', array(\n 'header' => Mage::helper('simipwa')->__('City'),\n 'width' => '100px',\n 'index' => 'city',\n )\n );\n\n $this->addColumn(\n 'country', array(\n 'header' => Mage::helper('simipwa')->__('Country'),\n 'width' => '100px',\n 'index' => 'country',\n )\n );\n\n return parent::_prepareColumns();\n }", "function createListFieldsFrontend()\n {\n $insertValues = \"\";\n $table = Doctrine_Core::getTable($this->tableName)->getColumns();\n \n $head = '';\n $td = '';\n $filters = '';\n foreach ($table as $fielnameKey => $info)\n {\n \t$fielname = ucwords(str_replace('_', ' ', $fielnameKey));\n if (strtolower($fielnameKey) != 'created_at' && strtolower($fielnameKey) != 'updated_at') {\n $head .= \"<th class=\\\"list\\\">\".ucwords(str_replace('_',' ', $fielname)).\"</th>\\r\\n\";\n $td .= \"<td><a href=\\\"<?php echo \\$this->url(array('module'=>'\".$this->moduleName.\"', 'action'=>'show', 'id'=>\\$\".strtolower($this->moduleName).\"->id));?>\\\"><?php echo \\$\".strtolower($this->moduleName).\"->\".$fielnameKey.\";?></a></td>\\r\\n\";\n $filters .= \"\n \".ucwords(str_replace('_', ' ', $fielnameKey)).\":\n <input type='text' id='filter-\".$fielnameKey.\"' name='filter[\".$fielnameKey.\"]' value='<?php echo \\$this->filter['\".$fielnameKey.\"'];?>'><br/>\n \";\n }\n }\n \n $this->list_th = $head;\n $this->list_td = $td;\n $this->filters = $filters;\n }", "protected function _prepareColumns() {\r\n $this->addColumn('event_id', array(\r\n 'header' => Mage::helper('events')->__('ID'),\r\n 'align' => 'right',\r\n 'width' => '50px',\r\n 'index' => 'event_id',\r\n ));\r\n\r\n $this->addColumn('title', array(\r\n 'header' => Mage::helper('events')->__('Event Title'),\r\n 'align' => 'left',\r\n 'index' => 'title',\r\n ));\r\n\r\n $this->addColumn('destination', array(\r\n 'header' => Mage::helper('events')->__('Destination Page'),\r\n 'align' => 'left',\r\n 'index' => 'destination',\r\n ));\r\n\r\n $this->addColumn('date', array(\r\n 'header' => Mage::helper('events')->__('Event Date'),\r\n 'align' => 'right',\r\n 'sortable' => true,\r\n 'index' => 'date',\r\n 'type' => 'date',\r\n ));\r\n\r\n $this->addColumn('enddate', array(\r\n 'header' => Mage::helper('events')->__('Event End Date'),\r\n 'align' => 'right',\r\n 'sortable' => true,\r\n 'index' => 'enddate',\r\n 'type' => 'date',\r\n ));\r\n\r\n\r\n $this->addColumn('action', array(\r\n 'header' => Mage::helper('events')->__('Action'),\r\n 'align' => 'center',\r\n 'width' => '70px',\r\n 'getter' => 'getEventId',\r\n 'actions' => array(\r\n array(\r\n 'caption' => Mage::helper('events')->__('Delete'),\r\n 'url' => array('base' => '*/*/delete'),\r\n 'field' => 'event_id',\r\n ),\r\n ),\r\n 'sortable' => false,\r\n 'filter' => false,\r\n 'type' => 'action',\r\n ));\r\n\r\n return parent::_prepareColumns();\r\n }", "function renderListHeader($table,$currentIdList)\t{\r\n\t\tglobal $TCA, $LANG;\r\n\r\n\t\t\t// Init:\r\n\t\t$theData = Array();\r\n\t\t\r\n\r\n\t\t\t// Traverse the fields:\r\n\t\tforeach($this->fieldArray as $fCol)\t{\r\n\r\n\t\t\t\t// Calculate users permissions to edit records in the table:\r\n\r\n\t\t\t\t//PROBLEM\r\n\t\t\t$permsEdit = $this->calcPerms & ($table=='pages'?2:16);\r\n\r\n\t\t\tswitch((string)$fCol)\t{\r\n\t\t\t\tcase '_PATH_':\t\t\t// Path\r\n\t\t\t\t\t$theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._PATH_',1).']</i>';\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_REF_':\t\t\t// References\r\n\t\t\t\t\t$theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_mod_file_list.xml:c__REF_',1).']</i>';\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_LOCALIZATION_':\t\t\t// Path\r\n\t\t\t\t\t$theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._LOCALIZATION_',1).']</i>';\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_LOCALIZATION_b':\t\t\t// Path\r\n\t\t\t\t\t$theData[$fCol] = $LANG->getLL('Localize',1);\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_CLIPBOARD_':\t\t// Clipboard:\r\n\t\t\t\t\t$cells=array();\r\n\r\n\t\t\t\t\t\t// If there are elements on the clipboard for this table, then display the \"paste into\" icon:\r\n\t\t\t\t\t$elFromTable = $this->clipObj->elFromTable($table);\r\n\t\t\t\t\tif (count($elFromTable))\t{\r\n\t\t\t\t\t\t$cells[]='<a href=\"'.htmlspecialchars($this->clipObj->pasteUrl($table,$this->id)).'\" onclick=\"'.htmlspecialchars('return '.$this->clipObj->confirmMsg('pages',$this->pageRow,'into',$elFromTable)).'\">'.\r\n\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath.PATH_txcategories_rel,'gfx/clip_pastesubref.gif','width=\"12\" height=\"12\"').' title=\"'.$LANG->getLL('insertrecordsintothiscategory',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// If the numeric clipboard pads are enabled, display the control icons for that:\r\n\t\t\t\t\tif ($this->clipObj->current!='normal')\t{\r\n\r\n\t\t\t\t\t\t\t// The \"select\" link:\r\n\t\t\t\t\t\t$cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_copy.gif','width=\"12\" height=\"12\"').' title=\"'.$LANG->getLL('clip_selectMarked',1).'\" alt=\"\" />',$table,'setCB');\r\n\r\n\t\t\t\t\t\t\t// The \"edit marked\" link:\r\n\t\t\t\t\t\t$editIdList = implode(',',$currentIdList);\r\n\t\t\t\t\t\t$editIdList = \"'+editList('\".$table.\"','\".$editIdList.\"')+'\";\r\n\t\t\t\t\t\t$params='&edit['.$table.']['.$editIdList.']=edit&disHelp=1';\r\n\t\t\t\t\t\t$cells[]='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('clip_editMarked',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t'</a>';\r\n\r\n\t\t\t\t\t\t\t// The \"Delete marked\" link:\r\n\t\t\t\t\t\t$cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('clip_deleteMarked',1).'\" alt=\"\" />',$table,'delete',sprintf($LANG->getLL('clip_deleteMarkedWarning'),$LANG->sL($TCA[$table]['ctrl']['title'])));\r\n\r\n\t\t\t\t\t\t\t// The \"Remove marked from category\" link:\r\n\t\t\t\t\t\t$cells[] = '<img'.t3lib_iconWorks::skinImg($this->backPath.PATH_txcategories_rel,'gfx/delref.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('removemarkedfromcategory',1).'\" alt=\"\" />';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// The \"Select all\" link:\r\n\t\t\t\t\t\t$cells[]='<a href=\"#\" onclick=\"'.htmlspecialchars('checkOffCB(\\''.implode(',',$this->CBnames).'\\'); return false;').'\">'.\r\n\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_select.gif','width=\"12\" height=\"12\"').' title=\"'.$LANG->getLL('clip_markRecords',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$cells[]='';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$theData[$fCol]=implode('',$cells);\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_CONTROL_':\t\t// Control panel:\r\n\t\t\t\t\tif (!$TCA[$table]['ctrl']['readOnly'])\t{\r\n\r\n\t\t\t\t\t\t\t// If new records can be created on this page, add links:\r\n\t\t\t\t\t\tif ($this->calcPerms&($table=='pages'?8:16) && $this->showNewRecLink($table))\t{\r\n\t\t\t\t\t\t\tif ($table==\"tt_content\" && $this->newWizards)\t{\r\n\t\t\t\t\t\t\t\t\t// If mod.web_list.newContentWiz.overrideWithExtension is set, use that extension's create new content wizard instead:\r\n\t\t\t\t\t\t\t\t$tmpTSc = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'],'mod.web_list');\r\n\t\t\t\t\t\t\t\t$tmpTSc = $tmpTSc ['properties']['newContentWiz.']['overrideWithExtension'];\r\n\t\t\t\t\t\t\t\t$newContentWizScriptPath = $this->backPath.t3lib_extMgm::isLoaded($tmpTSc) ? (t3lib_extMgm::extRelPath($tmpTSc).'mod1/db_new_content_el.php') : 'sysext/cms/layout/db_new_content_el.php';\r\n\r\n\t\t\t\t\t\t\t\t$theData[$fCol]='<a href=\"#\" onclick=\"'.htmlspecialchars('return jumpExt(\\''.$newContentWizScriptPath.'?id='.$this->id.'\\');').'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width=\"'.($table=='pages'?13:11).'\" height=\"12\"').' title=\"'.$LANG->getLL('new',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t\t} elseif ($table=='pages' && $this->newWizards)\t{\r\n\t\t\t\t\t\t\t\t$theData[$fCol]='<a href=\"'.htmlspecialchars($this->backPath.'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width=\"'.($table=='pages'?13:11).'\" height=\"12\"').' title=\"'.$LANG->getLL('new',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$params='&edit['.$table.']['.$this->id.']=new';\r\n\t\t\t\t\t\t\t\t$theData[$fCol]='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width=\"'.($table=='pages'?13:11).'\" height=\"12\"').' title=\"'.$LANG->getLL('new',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// If the table can be edited, add link for editing ALL SHOWN fields for all listed records:\r\n\t\t\t\t\t\tif ($permsEdit && $this->table && is_array($currentIdList))\t{\r\n\t\t\t\t\t\t\t$editIdList = implode(',',$currentIdList);\r\n\t\t\t\t\t\t\tif ($this->clipNumPane()) $editIdList = \"'+editList('\".$table.\"','\".$editIdList.\"')+'\";\r\n\t\t\t\t\t\t\t$params='&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.implode(',',$this->fieldArray).'&disHelp=1';\r\n\t\t\t\t\t\t\t$theData[$fCol].='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('editShownColumns',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\t\t\t// Regular fields header:\r\n\t\t\t\t\t$theData[$fCol]='';\r\n\t\t\t\t\tif ($this->table && is_array($currentIdList))\t{\r\n\r\n\t\t\t\t\t\t\t// If the numeric clipboard pads are selected, show duplicate sorting link:\r\n\t\t\t\t\t\tif ($this->clipNumPane()) {\r\n\t\t\t\t\t\t\t$theData[$fCol].='<a href=\"'.htmlspecialchars($this->listURL('',-1).'&duplicateField='.$fCol).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/select_duplicates.gif','width=\"11\" height=\"11\"').' title=\"'.$LANG->getLL('clip_duplicates',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// If the table can be edited, add link for editing THIS field for all listed records:\r\n\t\t\t\t\t\tif (!$TCA[$table]['ctrl']['readOnly'] && $permsEdit && $TCA[$table]['columns'][$fCol])\t{\r\n\t\t\t\t\t\t\t$editIdList = implode(',',$currentIdList);\r\n\t\t\t\t\t\t\tif ($this->clipNumPane()) $editIdList = \"'+editList('\".$table.\"','\".$editIdList.\"')+'\";\r\n\t\t\t\t\t\t\t$params='&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.$fCol.'&disHelp=1';\r\n\t\t\t\t\t\t\t$iTitle = sprintf($LANG->getLL('editThisColumn'),ereg_replace(':$','',trim($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol)))));\r\n\t\t\t\t\t\t\t$theData[$fCol].='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width=\"11\" height=\"12\"').' title=\"'.htmlspecialchars($iTitle).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$theData[$fCol].=$this->addSortLink($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol,'<i>[|]</i>')),$fCol,$table);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t\t// Create and return header table row:\r\n\t\treturn $this->addelement(1,'',$theData,' class=\"c-headLine\"','');\r\n\t}", "function sp_edit_events_columns() {\n\n\t$columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'thumbnail' => __( 'Thumbnail', 'sptheme' ),\n\t\t'title' => __( 'Name', 'sptheme' ),\n\t\t'events-categories' => __( 'Categories', 'sptheme' )\n\t);\n\n\treturn $columns;\n\n}", "public function renderListRow()\n\t{\n\t\tglobal $Security, $CurrentLanguage, $Language;\n\n\t\t// Call Row Rendering event\n\t\t$this->Row_Rendering();\n\n\t// Common render codes\n\t\t// RTLindex\n\t\t// imei\n\t\t// GPS_lat\n\t\t// GPS_lon\n\t\t// timezone\n\t\t// beb_mac\n\t\t// cali_id\n\t\t// sensor_id\n\t\t// sensor_value\n\t\t// sensor_unit\n\t\t// date_add\n\t\t// sensor_typename\n\t\t// blockn\n\t\t// BlockDetail\n\t\t// RTLindex\n\n\t\t$this->RTLindex->ViewValue = $this->RTLindex->CurrentValue;\n\t\t$this->RTLindex->ViewCustomAttributes = \"\";\n\n\t\t// imei\n\t\t$this->imei->ViewValue = $this->imei->CurrentValue;\n\t\t$this->imei->ViewCustomAttributes = \"\";\n\n\t\t// GPS_lat\n\t\t$this->GPS_lat->ViewValue = $this->GPS_lat->CurrentValue;\n\t\t$this->GPS_lat->ViewValue = FormatNumber($this->GPS_lat->ViewValue, 2, -2, -2, -2);\n\t\t$this->GPS_lat->ViewCustomAttributes = \"\";\n\n\t\t// GPS_lon\n\t\t$this->GPS_lon->ViewValue = $this->GPS_lon->CurrentValue;\n\t\t$this->GPS_lon->ViewValue = FormatNumber($this->GPS_lon->ViewValue, 2, -2, -2, -2);\n\t\t$this->GPS_lon->ViewCustomAttributes = \"\";\n\n\t\t// timezone\n\t\t$this->timezone->ViewValue = $this->timezone->CurrentValue;\n\t\t$this->timezone->ViewCustomAttributes = \"\";\n\n\t\t// beb_mac\n\t\t$this->beb_mac->ViewValue = $this->beb_mac->CurrentValue;\n\t\t$this->beb_mac->ViewCustomAttributes = \"\";\n\n\t\t// cali_id\n\t\t$this->cali_id->ViewValue = $this->cali_id->CurrentValue;\n\t\t$this->cali_id->ViewValue = FormatNumber($this->cali_id->ViewValue, 0, -2, -2, -2);\n\t\t$this->cali_id->ViewCustomAttributes = \"\";\n\n\t\t// sensor_id\n\t\t$this->sensor_id->ViewValue = $this->sensor_id->CurrentValue;\n\t\t$this->sensor_id->ViewCustomAttributes = \"\";\n\n\t\t// sensor_value\n\t\t$this->sensor_value->ViewValue = $this->sensor_value->CurrentValue;\n\t\t$this->sensor_value->ViewValue = FormatNumber($this->sensor_value->ViewValue, 2, -2, -2, -2);\n\t\t$this->sensor_value->ViewCustomAttributes = \"\";\n\n\t\t// sensor_unit\n\t\t$this->sensor_unit->ViewValue = $this->sensor_unit->CurrentValue;\n\t\t$this->sensor_unit->ViewCustomAttributes = \"\";\n\n\t\t// date_add\n\t\t$this->date_add->ViewValue = $this->date_add->CurrentValue;\n\t\t$this->date_add->ViewValue = FormatDateTime($this->date_add->ViewValue, 1);\n\t\t$this->date_add->ViewCustomAttributes = \"\";\n\n\t\t// sensor_typename\n\t\t$this->sensor_typename->ViewValue = $this->sensor_typename->CurrentValue;\n\t\t$this->sensor_typename->ViewCustomAttributes = \"\";\n\n\t\t// blockn\n\t\t$this->blockn->ViewValue = $this->blockn->CurrentValue;\n\t\t$this->blockn->ViewCustomAttributes = \"\";\n\n\t\t// BlockDetail\n\t\t$this->BlockDetail->ViewValue = $this->BlockDetail->CurrentValue;\n\t\t$this->BlockDetail->ViewCustomAttributes = \"\";\n\n\t\t// RTLindex\n\t\t$this->RTLindex->LinkCustomAttributes = \"\";\n\t\t$this->RTLindex->HrefValue = \"\";\n\t\t$this->RTLindex->TooltipValue = \"\";\n\n\t\t// imei\n\t\t$this->imei->LinkCustomAttributes = \"\";\n\t\t$this->imei->HrefValue = \"\";\n\t\t$this->imei->TooltipValue = \"\";\n\n\t\t// GPS_lat\n\t\t$this->GPS_lat->LinkCustomAttributes = \"\";\n\t\t$this->GPS_lat->HrefValue = \"\";\n\t\t$this->GPS_lat->TooltipValue = \"\";\n\n\t\t// GPS_lon\n\t\t$this->GPS_lon->LinkCustomAttributes = \"\";\n\t\t$this->GPS_lon->HrefValue = \"\";\n\t\t$this->GPS_lon->TooltipValue = \"\";\n\n\t\t// timezone\n\t\t$this->timezone->LinkCustomAttributes = \"\";\n\t\t$this->timezone->HrefValue = \"\";\n\t\t$this->timezone->TooltipValue = \"\";\n\n\t\t// beb_mac\n\t\t$this->beb_mac->LinkCustomAttributes = \"\";\n\t\t$this->beb_mac->HrefValue = \"\";\n\t\t$this->beb_mac->TooltipValue = \"\";\n\n\t\t// cali_id\n\t\t$this->cali_id->LinkCustomAttributes = \"\";\n\t\t$this->cali_id->HrefValue = \"\";\n\t\t$this->cali_id->TooltipValue = \"\";\n\n\t\t// sensor_id\n\t\t$this->sensor_id->LinkCustomAttributes = \"\";\n\t\t$this->sensor_id->HrefValue = \"\";\n\t\t$this->sensor_id->TooltipValue = \"\";\n\n\t\t// sensor_value\n\t\t$this->sensor_value->LinkCustomAttributes = \"\";\n\t\t$this->sensor_value->HrefValue = \"\";\n\t\t$this->sensor_value->TooltipValue = \"\";\n\n\t\t// sensor_unit\n\t\t$this->sensor_unit->LinkCustomAttributes = \"\";\n\t\t$this->sensor_unit->HrefValue = \"\";\n\t\t$this->sensor_unit->TooltipValue = \"\";\n\n\t\t// date_add\n\t\t$this->date_add->LinkCustomAttributes = \"\";\n\t\t$this->date_add->HrefValue = \"\";\n\t\t$this->date_add->TooltipValue = \"\";\n\n\t\t// sensor_typename\n\t\t$this->sensor_typename->LinkCustomAttributes = \"\";\n\t\t$this->sensor_typename->HrefValue = \"\";\n\t\t$this->sensor_typename->TooltipValue = \"\";\n\n\t\t// blockn\n\t\t$this->blockn->LinkCustomAttributes = \"\";\n\t\t$this->blockn->HrefValue = \"\";\n\t\t$this->blockn->TooltipValue = \"\";\n\n\t\t// BlockDetail\n\t\t$this->BlockDetail->LinkCustomAttributes = \"\";\n\t\t$this->BlockDetail->HrefValue = \"\";\n\t\t$this->BlockDetail->TooltipValue = \"\";\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\n\t\t// Save data for Custom Template\n\t\t$this->Rows[] = $this->customTemplateFieldValues();\n\t}", "private function tableShow($list){\r\n\r\n$html = '<table class=\"mwms_data_list contentmod_data_list\">\r\n\t<caption id=\"articles_browser\"><div id=\"browser_filter\">\r\n\t\t'.$this->setFilterForm().'\r\n\t\t<span class=\"label\">'.$this->lng['mwms_article_source'].'</span> '.$this->getArticleSourceFilter((int)Registry::get('mediamix_id_source_active')).'\r\n\t</div></caption>\r\n\t<thead>\r\n\t\t<tr>\r\n\t\t\t<th style=\"width:80px;\">'.$this->lng['mwms_article_id'].' ('.$this->result_count.') '.$this->setOrder('articles_order','id_article', 'articles_order_direction', $this->lng['mwms_article_id'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th>'.$this->lng['mwms_article_title'].' '.$this->setOrder('articles_order','title', 'articles_order_direction', $this->lng['mwms_article_title'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th>'.$this->lng['mwms_article_date_public'].' '.$this->setOrder('articles_order','date_public', 'articles_order_direction', $this->lng['mwms_article_date_public'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th style=\"width:100px;\">'.$this->lng['mwms_article_public'].' '.$this->setOrder('articles_order','id_public', 'articles_order_direction', $this->lng['mwms_article_public'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th style=\"width:140px;\">'.$this->lng['mwms_article_date_ins'].' '.$this->setOrder('articles_order','date_ins', 'articles_order_direction', $this->lng['mwms_article_date_ins'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th style=\"width:140px;\">'.$this->lng['mwms_article_date_upd'].' '.$this->setOrder('articles_order','date_upd', 'articles_order_direction', $this->lng['mwms_article_date_upd'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th class=\"toolbar\">\r\n\t\t\t\t<button class=\"mwms_article_new button\" title=\"'.$this->lng['mwms_article_new'].'\">'.$this->lng['mwms_article_new'].'</button>\r\n\t\t\t</th>\r\n\t\t</tr>\r\n\t</thead><tbody>\r\n\t';\r\n\r\n\tforeach($list as $d){\r\n\t\t\r\n\t\t$strI = '<br />SYSTEM';\r\n\t\t$strU = null;\r\n\t\t\r\n\t\tif($d['id_ins'] > 0 || $d['id_upd'] > 0){\r\n\t\t\t$uD = new UserBrowser;\r\n\t\t\t$userIData = $d['id_ins'] > 0 ? $uD->getUserData($d['id_ins']): null;\r\n\t\t\t$userUData = $d['id_upd'] > 0 ? $uD->getUserData($d['id_upd']): null;\r\n\t\t\t$strI = $d['id_ins'] > 0 ? '<br />'.$userIData['username']: $strI;\r\n\t\t\t$strU = $d['id_upd'] > 0 ? '<br />'.$userUData['username']: $strU;\r\n\t\t}\r\n\t\t\r\n\t\t$dateI = null;\r\n\t\t$dateU = null;\r\n\t\t\r\n\t\tif($d['date_ins'] > 0 || $d['id_upd'] > 0){\r\n\t\t\t$dateI = $d['date_ins'] > 0 ? date(Lng::get('system/date_time_format_precise'), $d['date_ins']): $dateI;\r\n\t\t\t$dateU = $d['date_upd'] > 0 ? date(Lng::get('system/date_time_format_precise'), $d['date_upd']): $dateU;\r\n\t\t}\r\n\t\t\r\n\t\t$_s = $this->getSourceData($d['id_source']);\r\n\t\t\r\n\t\t$title = $_s['template'] == 'autobazary' ? $this->autobazarAdminShow($d): $d['title'];\r\n\t\t\r\n\t\t$html .= '<tr id=\"content_cast_'.$d['id_article'].'\" class=\"content_cast\" title=\"'.$d['title'].'\">\r\n\t\t\t<td>'.$d['id_article'].' <input type=\"hidden\" name=\"id_article\" value=\"'.$d['id_article'].'\" /></td>\r\n\t\t\t<td>'.$title.'</td>\r\n\t\t\t<td>'.date(Lng::get('system/date_time_format_precise'), $d['date_public']).'</td>\r\n\t\t\t<td><span class=\"toggle-icon '.$this->toggleOnOff($d['id_public']).'\"></span></td>\r\n\t\t\t<td>'.$dateI.$strI.'</td>\r\n\t\t\t<td>'.$dateU.$strU.'</td>\r\n\t\t\t<td class=\"toolbar\"></td>\r\n\t\t</tr>';\r\n\t\r\n\t}\r\n\r\n\treturn $html.'</tbody></table>';\r\n}", "function BeforeMoveNextList(&$data, &$row, &$record, $recordId, &$pageObject)\n{\n\n\t\t\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\nif( $data[\"Estado\"]==\"Terminado\" ) {\n\t$record[\"edit_link\"] = false;\n}\nif( $data[\"Estado\"]==\"Pendiente\" ) {\n\tif( now() >= $data['FechaMaxima'] )\n\t\t$record[\"css\"]='background:#F5EE6C;';\n}\nif( $data[\"Estado\"]==\"En Proceso\" )\n\t$record[\"css\"]='background:#70F2FF;';\nif( $data[\"Estado\"]==\"Terminado\" )\n\t$record[\"css\"]='background:#AFD562;';\n\n;\t\t\n}" ]
[ "0.7344441", "0.6015198", "0.58190024", "0.57855904", "0.57855904", "0.57855904", "0.57855904", "0.57855904", "0.57418823", "0.56852347", "0.5672676", "0.5603", "0.55312395", "0.545324", "0.53839916", "0.52786094", "0.52605", "0.5254225", "0.5252146", "0.5247731", "0.52446485", "0.5206132", "0.51638216", "0.51602525", "0.5142473", "0.5124827", "0.5099903", "0.5096359", "0.5078827", "0.5073553" ]
0.708253
1
this behavior permits events list lines manipulation. the parameter is array('columns'=>&$colums) which is an array containing the html for the list header ( cells); You can insert or delete some but be careful to do the same in adminEventHandlerEventsListHeaders to get a coherent table. When called from Minilist, the parameter $ismini is true
public static function adminEventHandlerEventsListBody($rs,$args,$ismini=false) { $columns=&$args['columns']; foreach ($args as $v => $k) { $$v = &$args[$v]; } #Recreates the byref args. $num = 3; //Insert a new column header @3rd position. if ($ismini) $num++;#Minilist adds a 'period' column so we increase $num $columns = array_merge(array_slice($columns, 0, $num), array("<td>" . form::checkbox('dummy[' . $rs->post_id . ']', '1', (boolean) $rs->dummy, '', '', true) . "</td>"), array_slice($columns, $num)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function adminEventHandlerEventsListHeaders($args,$ismini=false) {\n\t\t\t$columns=&$args['columns'];\n\t\t\t$num = 3; //Insert a new column header @3rd position.\n\t\t\tif ($ismini)\n\t\t\t\t$num++;#Minilist adds a 'period' column so we increase $num\n\t\t\t$columns = array_merge(array_slice($columns, 0, $num), array('<th>' . __('Dummy') . '</th>'), array_slice($columns, $num));\n\t\t}", "private function showClientListExtraLine()\n\t{\n\t\tif (is_array($this->extraLine))\n\t\t\tcall_user_func_array('HTML_showTableRow', $this->extraLine);\n\t}", "public function setClientListExtraLine()\n\t{\n\t\tif ($this->outputColumns === null)\n\t\t\tdie('setClientListExtraLine: setOutputColumns must be called before');\n\n\t\t//Get the number of arguments of this function and the needed amount of arguments to match the columns of $this->outputColumns\n\t\t$argc = func_num_args();\n\t\t$colc = count($this->outputColumns);\n\n\t\tif ($argc != $colc)\n\t\t\tdie(\"setClientListExtraLine: $argc arguments got, $colc arguments expected.\");\n\n\t\t$this->extraLine = array();\n\t\tfor($i=0; $i < $argc; $i++)\n\t\t\t$this->extraLine[$i] = func_get_arg($i);\n\t}", "protected function AdminLines() {\n\t$oPage = $this->Engine()->App()->Page();\n\t\n\t// set up the section menu\n\t$arMenu = array(\n\t new clsActionLink_option(array(),\n\t 'fig',\t\t// link key\n\t 'do',\t\t// group key\n\t 'figure',\t\t// display when off\n\t NULL,\t\t// display when on\n\t 'figure totals'\t// description (shows as hover-over text)\n\t ),\n\t );\n\t// render the section header\n\t$out = $oPage->ActionHeader('Contents',$arMenu);\n\t\n\t$rs = $this->LineRecords();\n\t$out .= $rs->AdminRows_forParent($this->GetKeyValue());\n\t\n\treturn $out;\n }", "public function aggregateListRow()\n {\n // Call Row Rendered event\n $this->rowRendered();\n }", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "function AggregateListRow() {\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "protected function _prepareColumns() {\n $this->addColumn('history_id', array(\n 'header' => $this->getMonitoringHelper()->__('ID'),\n 'align' => 'right',\n 'index' => 'history_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => $this->getMonitoringHelper()->__('Date/Time'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('action', array(\n 'header' => $this->getMonitoringHelper()->__('Action'),\n 'index' => 'action',\n 'type' => 'options',\n 'options' => array(\n Wsu_Auditing_Helper_Data::ACTION_UPDATE => $this->__('Update'),\n Wsu_Auditing_Helper_Data::ACTION_INSERT => $this->__('Insert'),\n Wsu_Auditing_Helper_Data::ACTION_DELETE => $this->__('Delete'),\n )\n ));\n\n $this->addColumn('object_type', array(\n 'header' => $this->getMonitoringHelper()->__('Object Type'),\n 'index' => 'object_type',\n ));\n\n $this->addColumn('object_id', array(\n 'header' => $this->getMonitoringHelper()->__('Object ID'),\n 'index' => 'object_id',\n 'type' => 'number',\n ));\n\n $this->addColumn('content', array(\n 'header' => $this->getMonitoringHelper()->__('Content New'),\n 'index' => 'content',\n 'frame_callback' => array($this, 'showNewContent'),\n ));\n\n $this->addColumn('content_diff', array(\n 'header' => $this->getMonitoringHelper()->__('Diff to getOrigData()'),\n 'index' => 'content_diff',\n 'frame_callback' => array($this, 'showOldContent'),\n ));\n\n /* @var $adminUsers Mage_Admin_Model_Resource_User_Collection */\n $adminUsers = Mage::getResourceModel('admin/user_collection');\n $optionArray = array();\n foreach ($adminUsers as $adminUser) {\n $optionArray[$adminUser->getId()] = $this->entities($adminUser->getUsername());\n }\n\n $this->addColumn('user_id', array(\n 'header' => $this->getMonitoringHelper()->__('User'),\n 'index' => 'user_id',\n 'type' => 'options',\n 'options' => $optionArray,\n ));\n\n $this->addColumn('user_name', array(\n 'header' => $this->getMonitoringHelper()->__('User name logged'),\n 'index' => 'user_name',\n ));\n\n $this->addColumn('ip', array(\n 'header' => $this->getMonitoringHelper()->__('IP'),\n 'index' => 'ip',\n ));\n\n $this->addColumn('user_agent', array(\n 'header' => $this->getMonitoringHelper()->__('User Agent'),\n 'index' => 'user_agent',\n ));\n\n $this->addColumn('revert', array(\n 'header' => Mage::helper('customer')->__('Revert'),\n 'width' => 10,\n 'sortable' => false,\n 'filter' => false,\n 'renderer' => 'wsu_auditing/adminhtml_history_grid_revert',\n ));\n\n return parent::_prepareColumns();\n }", "protected function AdminPage_Lines() {\n\tif ($this->IsNew()) {\n\t $out = NULL;\n\t} else {\n\t $oPage = $this->PageObject();\n\t $oPath = $oPage->PathObj();\n\n\t $arPath = array();\t// not sure if anything is needed here\n\t $arActs = array(\n\t // (array $iarData,$iLinkKey,$iGroupKey=NULL,$iDispOff=NULL,$iDispOn=NULL,$iDescr=NULL)\n\t \n\t // 2016-09-19 multi-line editing currently doesn't work, so disabling the menu entry.\n\t //new clsActionLink_option($arPath,KS_ACTION_PKG_LINES_EDIT,NULL,'edit',NULL,'edit the package contents'),\n\t \n\t new clsActionLink_option($arPath,KS_ACTION_PKG_LINES_ADD,NULL,'add',NULL,'add package lines'),\t// TODO: should be admins only\n\t new clsAction_section('action'),\n\t new clsActionLink_option($arPath,'pack','do',NULL,NULL,'add items from stock'),\n\t );\n\n\t $hasItems = $this->ContainsItems();\n\t if ($hasItems) {\n\t\tif ($this->HasCharges()) {\n\t\t $arActs[] = new clsActionLink_option($arPath,\n\t\t 'uncharge','do',NULL,NULL,'remove charges for this package');\n\t\t} else {\n\t\t $arActs[] = new clsActionLink_option($arPath,\n\t\t 'charge','do',NULL,NULL,'add charges for this package');\n\t\t}\n\t\t$arActs[] = new clsActionLink_option($arPath,\n\t\t 'replace','do',NULL,NULL,'put items back in stock');\n\t }\n\n\t $out = $this->PageObject()->ActionHeader('Contents',$arActs);\n\n\t $tbl = $this->LineTable();\n\t $idPkg = $this->GetKeyValue();\n\t $out .= $tbl->AdminList_forPackage($idPkg);\n\t}\n\n\treturn $out;\n }", "public static function post_type_event_columns () : void\n {\n add_filter(\"manage_event_posts_columns\", function ($columns) {\n return [\n \"cb\" => $columns[\"cb\"],\n \"thumbnail\" => __(\"Thumbnail\", \"ahana\"),\n \"title\" => $columns[\"title\"],\n \"categories\" => __(\"Categories\", \"ahana\"),\n \"trainer\" => __(\"Trainer\", \"ahana\"),\n \"comments\" => $columns[\"comments\"],\n \"date\" => $columns[\"date\"]\n ];\n });\n\n add_filter(\"manage_event_posts_custom_column\", function ($column, $postId) {\n switch ($column) {\n case \"thumbnail\":\n the_post_thumbnail(\"admin_column_thumbnail\", $postId);\n break;\n case \"categories\":\n echo self::set_column(\"event\", $postId, \"category\");\n break;\n case \"trainer\":\n echo self::set_column(\"event\", $postId, \"trainer\");\n break;\n\n default:\n break;\n }\n }, 10, 2);\n }", "protected function setupListOperation()\n {\n CRUD::addButtonFromModelFunction('line', 'open_recipe', 'openRecipe', 'beginning');\n\n CRUD::column('image')\n ->type('closure')\n ->label('Image')\n ->function(function (Recipe $recipe) {\n if ($recipe->image) {\n return '<a href=\"'.url($this->crud->route.'/'.$recipe->getKey().'/edit').'\"><img src=\"/storage/'.$recipe->image.'\" width=\"80\"/></a>';\n }\n\n return '';\n });\n CRUD::column('title')->type('text')->label('Titre');\n CRUD::column('status')\n ->type('closure')\n ->label('Statut')\n ->function(function (Recipe $recipe) {\n $class = 'published' == $recipe->status ? 'badge-success' : 'badge-warning';\n $text = 'published' == $recipe->status ? 'Publiée' : 'Brouillon';\n\n return '<span class=\"badge '.$class.'\">'.$text.'</span>';\n });\n }", "protected function AdminRows_start() {\n\t$arBase = array(\n\t 'supp' => FALSE,\n\t 'year' => FALSE\n\t );\n\t$idReq = $this->GetRequestID();\n\tif (!is_null($idReq)) {\n\t $arBase[KS_ACTION_RESTOCK_REQUEST] = $idReq;\n\t}\n\t\n\t/*\n\t$arMenu = array(\n\t new clsActionLink_option(\n\t $arBase,\t// other stuff to always appear in URL, regardless of section's menu state\n\t KS_NEW_REC,\t// LinkKey: value that the group should be set to when this link is activated\n\t 'id',\t// GroupKey: group's identifier string in URL (.../iGroupKey:iLinkKey/...)\n\t\t\t // if NULL, presence of link key (.../iLinkKey/...) is a flag\n\t NULL,\t// DispOff: text to display when link is not activated - defaults to LinkKey\n\t NULL,\t// DispOn: text to display when link is activated - defaults to DispOff\n\t 'enter a new received restock from scratch'\t// description -- appears in hover-over popup\n\t ),\n\t );\n\t/*\n\t 2016-02-21 TODO: We need a generalized \"section header\" or \"section type\" that\n\t can also be a page header:\n\t When this fx is standalone, it should modify the page header -- but when\n\t it is a subsection (e.g. of a Restock Request page), it should just modify\n\t the current section. The object should receive a section object that could\n\t be either one (by default it would be the Page), and just modify that.\n\t*/\n\t/*\n\t//$this->PageObject()->PageHeaderWidgets($arMenu);\n\t$out = $this->PageObject()->ActionHeader('Restock Shipments Received',$arMenu)\n\t .\"\\n<table class=listing>\"\n\t ; */\n\t$oMenu = new fcHeaderMenu();\n\t\n\t // ($sGroupKey,$sKeyValue=TRUE,$sDispOff=NULL,$sDispOn=NULL,$sPopup=NULL)\n $oMenu->SetNode($ol = new fcMenuOptionLink(\n\t KS_PATHARG_NAME_INDEX,\t// 'id'\n\t KS_NEW_REC,\t\t\t// 'new'\n\t NULL,NULL,\n\t 'enter a new received restock from scratch'));\n\t $ol->AddLinkArray($arBase);\n\n\t$oHdr = new fcSectionHeader('Restock Shipments Received',$oMenu);\n\t\n\t$out = $oHdr->Render()\n\t .\"\\n<table class=listing>\"\n\t ;\n\treturn $out;\n }", "protected function _prepareColumns()\n {\n $this->addColumn('in_news', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_news',\n 'values' => $this->_getSelectedNews(),\n 'align' => 'center',\n 'index' => 'entity_id'\n ));\n $this->addColumn('name', array(\n 'header' => Mage::helper('oggetto_news')->__('Name'),\n 'align' => 'left',\n 'index' => 'name',\n 'renderer' => 'oggetto_news/adminhtml_helper_column_renderer_relation',\n 'params' => array(\n 'id' => 'getId'\n ),\n 'base_link' => 'adminhtml/news_news/edit',\n ));\n $this->addColumn('position', array(\n 'header' => Mage::helper('oggetto_news')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n ));\n }", "function events_listing_add_columns( $columns ) {\n\t$columns['events_listing_date'] = __( 'Event Date', 'events-listing-widget' );\n\tunset( $columns['date'] );\n\tunset( $columns['author'] );\n\n\treturn $columns;\n}", "protected function _prepareColumns() \n {\n\n $this->addColumn(\n 'in_devices', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_devices',\n 'values' => $this->_getSelectedDevices(),\n 'align' => 'center',\n 'index' => 'in_devices',\n 'use_index' => true,\n 'width' => '50px',\n 'renderer' => 'simipwa/adminhtml_notification_edit_renderer_devices'\n )\n );\n\n $this->addColumn(\n 'agent_id', array(\n 'header' => Mage::helper('simipwa')->__('ID'),\n 'align' => 'right',\n 'width' => '50px',\n 'index' => 'agent_id',\n )\n );\n\n $this->addColumn(\n 'user_agent', array(\n 'header' => Mage::helper('simipwa')->__('User Agent'),\n 'align' => 'right',\n 'width' => '400px',\n 'index' => 'user_agent',\n )\n );\n\n $this->addColumn(\n 'city', array(\n 'header' => Mage::helper('simipwa')->__('City'),\n 'width' => '100px',\n 'index' => 'city',\n )\n );\n\n $this->addColumn(\n 'country', array(\n 'header' => Mage::helper('simipwa')->__('Country'),\n 'width' => '100px',\n 'index' => 'country',\n )\n );\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('event_id', array(\n 'header' => $this->_getHelper()->__('ID'),\n 'type' => 'number',\n 'index' => 'event_id',\n ));\n\n\n $this->addColumn('method', array(\n 'header' => $this->_getHelper()->__('Method'),\n 'type' => 'text',\n 'index' => 'method',\n 'column_css_class' => 'grid-column-width-100',\n ));\n\n $this->addColumn('request_url', array(\n 'header' => $this->_getHelper()->__('Request URL'),\n 'type' => 'text',\n 'index' => 'request_url',\n 'column_css_class' => 'grid-column-long-text-overflow',\n ));\n\n $this->addColumn('request', array(\n 'header' => $this->_getHelper()->__('Request'),\n 'type' => 'html',\n // 'width'=>'300px',\n 'column_css_class' => 'grid-column-long-text-overflow',\n 'index' => 'request',\n 'renderer' => 'Bluesnap_Payment_Block_Adminhtml_Widget_Grid_Column_Renderer_Xml',\n ));\n\n $this->addColumn('response', array(\n 'header' => $this->_getHelper()->__('Response'),\n 'type' => 'html',\n 'column_css_class' => 'grid-column-long-text-overflow',\n 'renderer' => 'Bluesnap_Payment_Block_Adminhtml_Widget_Grid_Column_Renderer_Xml',\n 'index' => 'response',\n ));\n\n\n $this->addColumn('ip', array(\n 'header' => $this->_getHelper()->__('IP'),\n 'type' => 'text',\n 'column_css_class' => 'grid-column-width-100',\n\n 'index' => 'ip',\n ));\n\n\n $this->addColumn('user_agent', array(\n 'header' => $this->_getHelper()->__('User Agent'),\n 'type' => 'text',\n 'column_css_class' => 'grid-column-long-text-overflow',\n\n 'index' => 'user_agent',\n ));\n\n\n $this->addColumn('message', array(\n 'header' => $this->_getHelper()->__('Message'),\n 'type' => 'text',\n 'column_css_class' => 'grid-column-width-100',\n // 'column_css'=>'width:200px',\n // 'css'=>'width:200px',\n // 'style'=>'width:200px',\n\n 'index' => 'message',\n ));\n\n\n $this->addColumn('increment_id', array(\n 'header' => $this->_getHelper()->__('Increment Id'),\n 'type' => 'number',\n 'index' => 'increment_id',\n ));\n\n // $this->addColumn('return_id', array(\n // 'header' => $this->_getHelper()->__('Return Id'),\n // 'type' => 'number',\n // 'index' => 'return_id',\n // ));\n\n\n $this->addColumn('created_at', array(\n 'header' => $this->_getHelper()->__('Created At'),\n 'type' => 'dateTime',\n 'index' => 'created_at',\n ));\n\n\n $this->addColumn('priority', array(\n 'header' => $this->_getHelper()->__('Log Level'),\n 'align' => 'left',\n 'index' => 'priority',\n 'type' => 'options',\n 'options' => $this->getSeverityOptions(),\n 'frame_callback' => array($this, 'decorateSeverity')\n ));\n\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return $this;\n //return parent::_prepareColumns();\n }", "function renderListHeader($table,$currentIdList)\t{\r\n\t\tglobal $TCA, $LANG;\r\n\r\n\t\t\t// Init:\r\n\t\t$theData = Array();\r\n\t\t\r\n\r\n\t\t\t// Traverse the fields:\r\n\t\tforeach($this->fieldArray as $fCol)\t{\r\n\r\n\t\t\t\t// Calculate users permissions to edit records in the table:\r\n\r\n\t\t\t\t//PROBLEM\r\n\t\t\t$permsEdit = $this->calcPerms & ($table=='pages'?2:16);\r\n\r\n\t\t\tswitch((string)$fCol)\t{\r\n\t\t\t\tcase '_PATH_':\t\t\t// Path\r\n\t\t\t\t\t$theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._PATH_',1).']</i>';\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_REF_':\t\t\t// References\r\n\t\t\t\t\t$theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_mod_file_list.xml:c__REF_',1).']</i>';\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_LOCALIZATION_':\t\t\t// Path\r\n\t\t\t\t\t$theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._LOCALIZATION_',1).']</i>';\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_LOCALIZATION_b':\t\t\t// Path\r\n\t\t\t\t\t$theData[$fCol] = $LANG->getLL('Localize',1);\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_CLIPBOARD_':\t\t// Clipboard:\r\n\t\t\t\t\t$cells=array();\r\n\r\n\t\t\t\t\t\t// If there are elements on the clipboard for this table, then display the \"paste into\" icon:\r\n\t\t\t\t\t$elFromTable = $this->clipObj->elFromTable($table);\r\n\t\t\t\t\tif (count($elFromTable))\t{\r\n\t\t\t\t\t\t$cells[]='<a href=\"'.htmlspecialchars($this->clipObj->pasteUrl($table,$this->id)).'\" onclick=\"'.htmlspecialchars('return '.$this->clipObj->confirmMsg('pages',$this->pageRow,'into',$elFromTable)).'\">'.\r\n\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath.PATH_txcategories_rel,'gfx/clip_pastesubref.gif','width=\"12\" height=\"12\"').' title=\"'.$LANG->getLL('insertrecordsintothiscategory',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// If the numeric clipboard pads are enabled, display the control icons for that:\r\n\t\t\t\t\tif ($this->clipObj->current!='normal')\t{\r\n\r\n\t\t\t\t\t\t\t// The \"select\" link:\r\n\t\t\t\t\t\t$cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_copy.gif','width=\"12\" height=\"12\"').' title=\"'.$LANG->getLL('clip_selectMarked',1).'\" alt=\"\" />',$table,'setCB');\r\n\r\n\t\t\t\t\t\t\t// The \"edit marked\" link:\r\n\t\t\t\t\t\t$editIdList = implode(',',$currentIdList);\r\n\t\t\t\t\t\t$editIdList = \"'+editList('\".$table.\"','\".$editIdList.\"')+'\";\r\n\t\t\t\t\t\t$params='&edit['.$table.']['.$editIdList.']=edit&disHelp=1';\r\n\t\t\t\t\t\t$cells[]='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('clip_editMarked',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t'</a>';\r\n\r\n\t\t\t\t\t\t\t// The \"Delete marked\" link:\r\n\t\t\t\t\t\t$cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('clip_deleteMarked',1).'\" alt=\"\" />',$table,'delete',sprintf($LANG->getLL('clip_deleteMarkedWarning'),$LANG->sL($TCA[$table]['ctrl']['title'])));\r\n\r\n\t\t\t\t\t\t\t// The \"Remove marked from category\" link:\r\n\t\t\t\t\t\t$cells[] = '<img'.t3lib_iconWorks::skinImg($this->backPath.PATH_txcategories_rel,'gfx/delref.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('removemarkedfromcategory',1).'\" alt=\"\" />';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// The \"Select all\" link:\r\n\t\t\t\t\t\t$cells[]='<a href=\"#\" onclick=\"'.htmlspecialchars('checkOffCB(\\''.implode(',',$this->CBnames).'\\'); return false;').'\">'.\r\n\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_select.gif','width=\"12\" height=\"12\"').' title=\"'.$LANG->getLL('clip_markRecords',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$cells[]='';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$theData[$fCol]=implode('',$cells);\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '_CONTROL_':\t\t// Control panel:\r\n\t\t\t\t\tif (!$TCA[$table]['ctrl']['readOnly'])\t{\r\n\r\n\t\t\t\t\t\t\t// If new records can be created on this page, add links:\r\n\t\t\t\t\t\tif ($this->calcPerms&($table=='pages'?8:16) && $this->showNewRecLink($table))\t{\r\n\t\t\t\t\t\t\tif ($table==\"tt_content\" && $this->newWizards)\t{\r\n\t\t\t\t\t\t\t\t\t// If mod.web_list.newContentWiz.overrideWithExtension is set, use that extension's create new content wizard instead:\r\n\t\t\t\t\t\t\t\t$tmpTSc = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'],'mod.web_list');\r\n\t\t\t\t\t\t\t\t$tmpTSc = $tmpTSc ['properties']['newContentWiz.']['overrideWithExtension'];\r\n\t\t\t\t\t\t\t\t$newContentWizScriptPath = $this->backPath.t3lib_extMgm::isLoaded($tmpTSc) ? (t3lib_extMgm::extRelPath($tmpTSc).'mod1/db_new_content_el.php') : 'sysext/cms/layout/db_new_content_el.php';\r\n\r\n\t\t\t\t\t\t\t\t$theData[$fCol]='<a href=\"#\" onclick=\"'.htmlspecialchars('return jumpExt(\\''.$newContentWizScriptPath.'?id='.$this->id.'\\');').'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width=\"'.($table=='pages'?13:11).'\" height=\"12\"').' title=\"'.$LANG->getLL('new',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t\t} elseif ($table=='pages' && $this->newWizards)\t{\r\n\t\t\t\t\t\t\t\t$theData[$fCol]='<a href=\"'.htmlspecialchars($this->backPath.'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width=\"'.($table=='pages'?13:11).'\" height=\"12\"').' title=\"'.$LANG->getLL('new',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$params='&edit['.$table.']['.$this->id.']=new';\r\n\t\t\t\t\t\t\t\t$theData[$fCol]='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width=\"'.($table=='pages'?13:11).'\" height=\"12\"').' title=\"'.$LANG->getLL('new',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// If the table can be edited, add link for editing ALL SHOWN fields for all listed records:\r\n\t\t\t\t\t\tif ($permsEdit && $this->table && is_array($currentIdList))\t{\r\n\t\t\t\t\t\t\t$editIdList = implode(',',$currentIdList);\r\n\t\t\t\t\t\t\tif ($this->clipNumPane()) $editIdList = \"'+editList('\".$table.\"','\".$editIdList.\"')+'\";\r\n\t\t\t\t\t\t\t$params='&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.implode(',',$this->fieldArray).'&disHelp=1';\r\n\t\t\t\t\t\t\t$theData[$fCol].='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width=\"11\" height=\"12\"').' title=\"'.$LANG->getLL('editShownColumns',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\t\t\t// Regular fields header:\r\n\t\t\t\t\t$theData[$fCol]='';\r\n\t\t\t\t\tif ($this->table && is_array($currentIdList))\t{\r\n\r\n\t\t\t\t\t\t\t// If the numeric clipboard pads are selected, show duplicate sorting link:\r\n\t\t\t\t\t\tif ($this->clipNumPane()) {\r\n\t\t\t\t\t\t\t$theData[$fCol].='<a href=\"'.htmlspecialchars($this->listURL('',-1).'&duplicateField='.$fCol).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/select_duplicates.gif','width=\"11\" height=\"11\"').' title=\"'.$LANG->getLL('clip_duplicates',1).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// If the table can be edited, add link for editing THIS field for all listed records:\r\n\t\t\t\t\t\tif (!$TCA[$table]['ctrl']['readOnly'] && $permsEdit && $TCA[$table]['columns'][$fCol])\t{\r\n\t\t\t\t\t\t\t$editIdList = implode(',',$currentIdList);\r\n\t\t\t\t\t\t\tif ($this->clipNumPane()) $editIdList = \"'+editList('\".$table.\"','\".$editIdList.\"')+'\";\r\n\t\t\t\t\t\t\t$params='&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.$fCol.'&disHelp=1';\r\n\t\t\t\t\t\t\t$iTitle = sprintf($LANG->getLL('editThisColumn'),ereg_replace(':$','',trim($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol)))));\r\n\t\t\t\t\t\t\t$theData[$fCol].='<a href=\"#\" onclick=\"'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'\">'.\r\n\t\t\t\t\t\t\t\t\t\t\t'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width=\"11\" height=\"12\"').' title=\"'.htmlspecialchars($iTitle).'\" alt=\"\" />'.\r\n\t\t\t\t\t\t\t\t\t\t\t'</a>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$theData[$fCol].=$this->addSortLink($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol,'<i>[|]</i>')),$fCol,$table);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t\t// Create and return header table row:\r\n\t\treturn $this->addelement(1,'',$theData,' class=\"c-headLine\"','');\r\n\t}", "public function addHeadersAdmin(Event $event)\n {\n // Hacked, because the admin layout doesn't use a partial or a trigger\n // for the search engine.\n $view = $event->getTarget();\n // TODO How to attach all admin events only before 1.3?\n if (!$view->params()->fromRoute('__ADMIN__')) {\n return;\n }\n $view->headLink()\n ->appendStylesheet($view->assetUrl('css/generateur-admin.css', 'Generateur'));\n $searchUrl = sprintf('var searchGenerationsUrl = %s;', json_encode($view->url('admin/generation/default', ['action' => 'browse'], true), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));\n $view->headScript()\n ->appendScript($searchUrl)\n ->appendFile($view->assetUrl('js/generateur-admin.js', 'Generateur'), 'text/javascript', ['defer' => 'defer']);\n }", "public static function adminEventHandlerMinilistCustomize($args) {\n\t\t\tforeach ($args as $v => $k)\n\t\t\t\t$$v = &$args[$v];\n\n\t\t\t#$params['dummy']=1; This would filter the events displayed on the dummy==1 criteria\n\t\t}", "protected function _prepareColumns() {\r\n $this->addColumn('event_id', array(\r\n 'header' => Mage::helper('events')->__('ID'),\r\n 'align' => 'right',\r\n 'width' => '50px',\r\n 'index' => 'event_id',\r\n ));\r\n\r\n $this->addColumn('title', array(\r\n 'header' => Mage::helper('events')->__('Event Title'),\r\n 'align' => 'left',\r\n 'index' => 'title',\r\n ));\r\n\r\n $this->addColumn('destination', array(\r\n 'header' => Mage::helper('events')->__('Destination Page'),\r\n 'align' => 'left',\r\n 'index' => 'destination',\r\n ));\r\n\r\n $this->addColumn('date', array(\r\n 'header' => Mage::helper('events')->__('Event Date'),\r\n 'align' => 'right',\r\n 'sortable' => true,\r\n 'index' => 'date',\r\n 'type' => 'date',\r\n ));\r\n\r\n $this->addColumn('enddate', array(\r\n 'header' => Mage::helper('events')->__('Event End Date'),\r\n 'align' => 'right',\r\n 'sortable' => true,\r\n 'index' => 'enddate',\r\n 'type' => 'date',\r\n ));\r\n\r\n\r\n $this->addColumn('action', array(\r\n 'header' => Mage::helper('events')->__('Action'),\r\n 'align' => 'center',\r\n 'width' => '70px',\r\n 'getter' => 'getEventId',\r\n 'actions' => array(\r\n array(\r\n 'caption' => Mage::helper('events')->__('Delete'),\r\n 'url' => array('base' => '*/*/delete'),\r\n 'field' => 'event_id',\r\n ),\r\n ),\r\n 'sortable' => false,\r\n 'filter' => false,\r\n 'type' => 'action',\r\n ));\r\n\r\n return parent::_prepareColumns();\r\n }", "function edit_entries_additional_tableheader()\n\t{\n\n\t\tif($this->debug === TRUE) print(\"<br />edit_entries_additional_tableheader\");\n\n\t\tglobal $DSP, $LANG, $EXT, $SESS;\n\n\t\t$extra = ($EXT->last_call !== FALSE) ? $EXT->last_call : '';\n\n\t\t$SESS->cache['lg'][LG_LL_addon_id]['show_links'] = FALSE;\n\t\tforeach ($this->settings['weblogs'] as $weblog_id => $weblog_settings)\n\t\t{\n\t\t\tif($weblog_settings['display_link'] == TRUE)\n\t\t\t{\n\t\t\t\t$SESS->cache['lg'][LG_LL_addon_id]['show_links'] = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(\n\t\t\t// enabled?\n\t\t\t$this->settings['enabled'] == TRUE\n\t\t\t&& $SESS->cache['lg'][LG_LL_addon_id]['show_links']\n\t\t\t// allowed member group?\n\t\t\t&& in_array($SESS->userdata['group_id'], $this->settings['allowed_member_groups'])\n\t\t)\n\t\t{\n\t\t\t$extra .= $DSP->table_qcell('tableHeadingAlt', \"Live Look\");\n\t\t} \n\t\treturn $extra;\n\t}", "public function renderList(){\r\n $this->addRowAction('edit');\r\n $this->addRowAction('delete');\r\n\r\n return parent::renderList();\r\n\r\n }", "function RenderListRow() {\n\t\tglobal $Security, $gsLanguage, $Language;\n\n\t\t// Call Row Rendering event\n\t\t$this->Row_Rendering();\n\n // Common render codes\n\t\t// tanggal\n\t\t// periode\n\t\t// id\n\t\t// nomor\n\t\t// transaksi\n\t\t// referensi\n\t\t// group\n\t\t// rekening\n\t\t// tipe\n\t\t// posisi\n\t\t// laporan\n\t\t// keterangan\n\t\t// debet1\n\t\t// credit1\n\t\t// saldo1\n\t\t// debet2\n\t\t// credit2\n\t\t// saldo2\n\t\t// debet3\n\t\t// credit3\n\t\t// saldo3\n\t\t// debet4\n\t\t// credit4\n\t\t// saldo4\n\t\t// debet5\n\t\t// credit5\n\t\t// saldo5\n\t\t// debet6\n\t\t// credit6\n\t\t// saldo6\n\t\t// debet7\n\t\t// credit7\n\t\t// saldo7\n\t\t// debet8\n\t\t// credit8\n\t\t// saldo8\n\t\t// debet9\n\t\t// credit9\n\t\t// saldo9\n\t\t// debet10\n\t\t// credit10\n\t\t// saldo10\n\t\t// debet11\n\t\t// credit11\n\t\t// saldo11\n\t\t// debet12\n\t\t// credit12\n\t\t// saldo12\n\t\t// tanggal\n\n\t\t$this->tanggal->ViewValue = $this->tanggal->CurrentValue;\n\t\t$this->tanggal->ViewValue = ew_FormatDateTime($this->tanggal->ViewValue, 0);\n\t\t$this->tanggal->ViewCustomAttributes = \"\";\n\n\t\t// periode\n\t\t$this->periode->ViewValue = $this->periode->CurrentValue;\n\t\t$this->periode->ViewCustomAttributes = \"\";\n\n\t\t// id\n\t\t$this->id->ViewValue = $this->id->CurrentValue;\n\t\t$this->id->ViewCustomAttributes = \"\";\n\n\t\t// nomor\n\t\t$this->nomor->ViewValue = $this->nomor->CurrentValue;\n\t\t$this->nomor->ViewCustomAttributes = \"\";\n\n\t\t// transaksi\n\t\t$this->transaksi->ViewValue = $this->transaksi->CurrentValue;\n\t\t$this->transaksi->ViewCustomAttributes = \"\";\n\n\t\t// referensi\n\t\t$this->referensi->ViewValue = $this->referensi->CurrentValue;\n\t\t$this->referensi->ViewCustomAttributes = \"\";\n\n\t\t// group\n\t\t$this->group->ViewValue = $this->group->CurrentValue;\n\t\t$this->group->ViewCustomAttributes = \"\";\n\n\t\t// rekening\n\t\t$this->rekening->ViewValue = $this->rekening->CurrentValue;\n\t\t$this->rekening->ViewCustomAttributes = \"\";\n\n\t\t// tipe\n\t\t$this->tipe->ViewValue = $this->tipe->CurrentValue;\n\t\t$this->tipe->ViewCustomAttributes = \"\";\n\n\t\t// posisi\n\t\t$this->posisi->ViewValue = $this->posisi->CurrentValue;\n\t\t$this->posisi->ViewCustomAttributes = \"\";\n\n\t\t// laporan\n\t\t$this->laporan->ViewValue = $this->laporan->CurrentValue;\n\t\t$this->laporan->ViewCustomAttributes = \"\";\n\n\t\t// keterangan\n\t\t$this->keterangan->ViewValue = $this->keterangan->CurrentValue;\n\t\t$this->keterangan->ViewCustomAttributes = \"\";\n\n\t\t// debet1\n\t\t$this->debet1->ViewValue = $this->debet1->CurrentValue;\n\t\t$this->debet1->ViewCustomAttributes = \"\";\n\n\t\t// credit1\n\t\t$this->credit1->ViewValue = $this->credit1->CurrentValue;\n\t\t$this->credit1->ViewCustomAttributes = \"\";\n\n\t\t// saldo1\n\t\t$this->saldo1->ViewValue = $this->saldo1->CurrentValue;\n\t\t$this->saldo1->ViewCustomAttributes = \"\";\n\n\t\t// debet2\n\t\t$this->debet2->ViewValue = $this->debet2->CurrentValue;\n\t\t$this->debet2->ViewCustomAttributes = \"\";\n\n\t\t// credit2\n\t\t$this->credit2->ViewValue = $this->credit2->CurrentValue;\n\t\t$this->credit2->ViewCustomAttributes = \"\";\n\n\t\t// saldo2\n\t\t$this->saldo2->ViewValue = $this->saldo2->CurrentValue;\n\t\t$this->saldo2->ViewCustomAttributes = \"\";\n\n\t\t// debet3\n\t\t$this->debet3->ViewValue = $this->debet3->CurrentValue;\n\t\t$this->debet3->ViewCustomAttributes = \"\";\n\n\t\t// credit3\n\t\t$this->credit3->ViewValue = $this->credit3->CurrentValue;\n\t\t$this->credit3->ViewCustomAttributes = \"\";\n\n\t\t// saldo3\n\t\t$this->saldo3->ViewValue = $this->saldo3->CurrentValue;\n\t\t$this->saldo3->ViewCustomAttributes = \"\";\n\n\t\t// debet4\n\t\t$this->debet4->ViewValue = $this->debet4->CurrentValue;\n\t\t$this->debet4->ViewCustomAttributes = \"\";\n\n\t\t// credit4\n\t\t$this->credit4->ViewValue = $this->credit4->CurrentValue;\n\t\t$this->credit4->ViewCustomAttributes = \"\";\n\n\t\t// saldo4\n\t\t$this->saldo4->ViewValue = $this->saldo4->CurrentValue;\n\t\t$this->saldo4->ViewCustomAttributes = \"\";\n\n\t\t// debet5\n\t\t$this->debet5->ViewValue = $this->debet5->CurrentValue;\n\t\t$this->debet5->ViewCustomAttributes = \"\";\n\n\t\t// credit5\n\t\t$this->credit5->ViewValue = $this->credit5->CurrentValue;\n\t\t$this->credit5->ViewCustomAttributes = \"\";\n\n\t\t// saldo5\n\t\t$this->saldo5->ViewValue = $this->saldo5->CurrentValue;\n\t\t$this->saldo5->ViewCustomAttributes = \"\";\n\n\t\t// debet6\n\t\t$this->debet6->ViewValue = $this->debet6->CurrentValue;\n\t\t$this->debet6->ViewCustomAttributes = \"\";\n\n\t\t// credit6\n\t\t$this->credit6->ViewValue = $this->credit6->CurrentValue;\n\t\t$this->credit6->ViewCustomAttributes = \"\";\n\n\t\t// saldo6\n\t\t$this->saldo6->ViewValue = $this->saldo6->CurrentValue;\n\t\t$this->saldo6->ViewCustomAttributes = \"\";\n\n\t\t// debet7\n\t\t$this->debet7->ViewValue = $this->debet7->CurrentValue;\n\t\t$this->debet7->ViewCustomAttributes = \"\";\n\n\t\t// credit7\n\t\t$this->credit7->ViewValue = $this->credit7->CurrentValue;\n\t\t$this->credit7->ViewCustomAttributes = \"\";\n\n\t\t// saldo7\n\t\t$this->saldo7->ViewValue = $this->saldo7->CurrentValue;\n\t\t$this->saldo7->ViewCustomAttributes = \"\";\n\n\t\t// debet8\n\t\t$this->debet8->ViewValue = $this->debet8->CurrentValue;\n\t\t$this->debet8->ViewCustomAttributes = \"\";\n\n\t\t// credit8\n\t\t$this->credit8->ViewValue = $this->credit8->CurrentValue;\n\t\t$this->credit8->ViewCustomAttributes = \"\";\n\n\t\t// saldo8\n\t\t$this->saldo8->ViewValue = $this->saldo8->CurrentValue;\n\t\t$this->saldo8->ViewCustomAttributes = \"\";\n\n\t\t// debet9\n\t\t$this->debet9->ViewValue = $this->debet9->CurrentValue;\n\t\t$this->debet9->ViewCustomAttributes = \"\";\n\n\t\t// credit9\n\t\t$this->credit9->ViewValue = $this->credit9->CurrentValue;\n\t\t$this->credit9->ViewCustomAttributes = \"\";\n\n\t\t// saldo9\n\t\t$this->saldo9->ViewValue = $this->saldo9->CurrentValue;\n\t\t$this->saldo9->ViewCustomAttributes = \"\";\n\n\t\t// debet10\n\t\t$this->debet10->ViewValue = $this->debet10->CurrentValue;\n\t\t$this->debet10->ViewCustomAttributes = \"\";\n\n\t\t// credit10\n\t\t$this->credit10->ViewValue = $this->credit10->CurrentValue;\n\t\t$this->credit10->ViewCustomAttributes = \"\";\n\n\t\t// saldo10\n\t\t$this->saldo10->ViewValue = $this->saldo10->CurrentValue;\n\t\t$this->saldo10->ViewCustomAttributes = \"\";\n\n\t\t// debet11\n\t\t$this->debet11->ViewValue = $this->debet11->CurrentValue;\n\t\t$this->debet11->ViewCustomAttributes = \"\";\n\n\t\t// credit11\n\t\t$this->credit11->ViewValue = $this->credit11->CurrentValue;\n\t\t$this->credit11->ViewCustomAttributes = \"\";\n\n\t\t// saldo11\n\t\t$this->saldo11->ViewValue = $this->saldo11->CurrentValue;\n\t\t$this->saldo11->ViewCustomAttributes = \"\";\n\n\t\t// debet12\n\t\t$this->debet12->ViewValue = $this->debet12->CurrentValue;\n\t\t$this->debet12->ViewCustomAttributes = \"\";\n\n\t\t// credit12\n\t\t$this->credit12->ViewValue = $this->credit12->CurrentValue;\n\t\t$this->credit12->ViewCustomAttributes = \"\";\n\n\t\t// saldo12\n\t\t$this->saldo12->ViewValue = $this->saldo12->CurrentValue;\n\t\t$this->saldo12->ViewCustomAttributes = \"\";\n\n\t\t// tanggal\n\t\t$this->tanggal->LinkCustomAttributes = \"\";\n\t\t$this->tanggal->HrefValue = \"\";\n\t\t$this->tanggal->TooltipValue = \"\";\n\n\t\t// periode\n\t\t$this->periode->LinkCustomAttributes = \"\";\n\t\t$this->periode->HrefValue = \"\";\n\t\t$this->periode->TooltipValue = \"\";\n\n\t\t// id\n\t\t$this->id->LinkCustomAttributes = \"\";\n\t\t$this->id->HrefValue = \"\";\n\t\t$this->id->TooltipValue = \"\";\n\n\t\t// nomor\n\t\t$this->nomor->LinkCustomAttributes = \"\";\n\t\t$this->nomor->HrefValue = \"\";\n\t\t$this->nomor->TooltipValue = \"\";\n\n\t\t// transaksi\n\t\t$this->transaksi->LinkCustomAttributes = \"\";\n\t\t$this->transaksi->HrefValue = \"\";\n\t\t$this->transaksi->TooltipValue = \"\";\n\n\t\t// referensi\n\t\t$this->referensi->LinkCustomAttributes = \"\";\n\t\t$this->referensi->HrefValue = \"\";\n\t\t$this->referensi->TooltipValue = \"\";\n\n\t\t// group\n\t\t$this->group->LinkCustomAttributes = \"\";\n\t\t$this->group->HrefValue = \"\";\n\t\t$this->group->TooltipValue = \"\";\n\n\t\t// rekening\n\t\t$this->rekening->LinkCustomAttributes = \"\";\n\t\t$this->rekening->HrefValue = \"\";\n\t\t$this->rekening->TooltipValue = \"\";\n\n\t\t// tipe\n\t\t$this->tipe->LinkCustomAttributes = \"\";\n\t\t$this->tipe->HrefValue = \"\";\n\t\t$this->tipe->TooltipValue = \"\";\n\n\t\t// posisi\n\t\t$this->posisi->LinkCustomAttributes = \"\";\n\t\t$this->posisi->HrefValue = \"\";\n\t\t$this->posisi->TooltipValue = \"\";\n\n\t\t// laporan\n\t\t$this->laporan->LinkCustomAttributes = \"\";\n\t\t$this->laporan->HrefValue = \"\";\n\t\t$this->laporan->TooltipValue = \"\";\n\n\t\t// keterangan\n\t\t$this->keterangan->LinkCustomAttributes = \"\";\n\t\t$this->keterangan->HrefValue = \"\";\n\t\t$this->keterangan->TooltipValue = \"\";\n\n\t\t// debet1\n\t\t$this->debet1->LinkCustomAttributes = \"\";\n\t\t$this->debet1->HrefValue = \"\";\n\t\t$this->debet1->TooltipValue = \"\";\n\n\t\t// credit1\n\t\t$this->credit1->LinkCustomAttributes = \"\";\n\t\t$this->credit1->HrefValue = \"\";\n\t\t$this->credit1->TooltipValue = \"\";\n\n\t\t// saldo1\n\t\t$this->saldo1->LinkCustomAttributes = \"\";\n\t\t$this->saldo1->HrefValue = \"\";\n\t\t$this->saldo1->TooltipValue = \"\";\n\n\t\t// debet2\n\t\t$this->debet2->LinkCustomAttributes = \"\";\n\t\t$this->debet2->HrefValue = \"\";\n\t\t$this->debet2->TooltipValue = \"\";\n\n\t\t// credit2\n\t\t$this->credit2->LinkCustomAttributes = \"\";\n\t\t$this->credit2->HrefValue = \"\";\n\t\t$this->credit2->TooltipValue = \"\";\n\n\t\t// saldo2\n\t\t$this->saldo2->LinkCustomAttributes = \"\";\n\t\t$this->saldo2->HrefValue = \"\";\n\t\t$this->saldo2->TooltipValue = \"\";\n\n\t\t// debet3\n\t\t$this->debet3->LinkCustomAttributes = \"\";\n\t\t$this->debet3->HrefValue = \"\";\n\t\t$this->debet3->TooltipValue = \"\";\n\n\t\t// credit3\n\t\t$this->credit3->LinkCustomAttributes = \"\";\n\t\t$this->credit3->HrefValue = \"\";\n\t\t$this->credit3->TooltipValue = \"\";\n\n\t\t// saldo3\n\t\t$this->saldo3->LinkCustomAttributes = \"\";\n\t\t$this->saldo3->HrefValue = \"\";\n\t\t$this->saldo3->TooltipValue = \"\";\n\n\t\t// debet4\n\t\t$this->debet4->LinkCustomAttributes = \"\";\n\t\t$this->debet4->HrefValue = \"\";\n\t\t$this->debet4->TooltipValue = \"\";\n\n\t\t// credit4\n\t\t$this->credit4->LinkCustomAttributes = \"\";\n\t\t$this->credit4->HrefValue = \"\";\n\t\t$this->credit4->TooltipValue = \"\";\n\n\t\t// saldo4\n\t\t$this->saldo4->LinkCustomAttributes = \"\";\n\t\t$this->saldo4->HrefValue = \"\";\n\t\t$this->saldo4->TooltipValue = \"\";\n\n\t\t// debet5\n\t\t$this->debet5->LinkCustomAttributes = \"\";\n\t\t$this->debet5->HrefValue = \"\";\n\t\t$this->debet5->TooltipValue = \"\";\n\n\t\t// credit5\n\t\t$this->credit5->LinkCustomAttributes = \"\";\n\t\t$this->credit5->HrefValue = \"\";\n\t\t$this->credit5->TooltipValue = \"\";\n\n\t\t// saldo5\n\t\t$this->saldo5->LinkCustomAttributes = \"\";\n\t\t$this->saldo5->HrefValue = \"\";\n\t\t$this->saldo5->TooltipValue = \"\";\n\n\t\t// debet6\n\t\t$this->debet6->LinkCustomAttributes = \"\";\n\t\t$this->debet6->HrefValue = \"\";\n\t\t$this->debet6->TooltipValue = \"\";\n\n\t\t// credit6\n\t\t$this->credit6->LinkCustomAttributes = \"\";\n\t\t$this->credit6->HrefValue = \"\";\n\t\t$this->credit6->TooltipValue = \"\";\n\n\t\t// saldo6\n\t\t$this->saldo6->LinkCustomAttributes = \"\";\n\t\t$this->saldo6->HrefValue = \"\";\n\t\t$this->saldo6->TooltipValue = \"\";\n\n\t\t// debet7\n\t\t$this->debet7->LinkCustomAttributes = \"\";\n\t\t$this->debet7->HrefValue = \"\";\n\t\t$this->debet7->TooltipValue = \"\";\n\n\t\t// credit7\n\t\t$this->credit7->LinkCustomAttributes = \"\";\n\t\t$this->credit7->HrefValue = \"\";\n\t\t$this->credit7->TooltipValue = \"\";\n\n\t\t// saldo7\n\t\t$this->saldo7->LinkCustomAttributes = \"\";\n\t\t$this->saldo7->HrefValue = \"\";\n\t\t$this->saldo7->TooltipValue = \"\";\n\n\t\t// debet8\n\t\t$this->debet8->LinkCustomAttributes = \"\";\n\t\t$this->debet8->HrefValue = \"\";\n\t\t$this->debet8->TooltipValue = \"\";\n\n\t\t// credit8\n\t\t$this->credit8->LinkCustomAttributes = \"\";\n\t\t$this->credit8->HrefValue = \"\";\n\t\t$this->credit8->TooltipValue = \"\";\n\n\t\t// saldo8\n\t\t$this->saldo8->LinkCustomAttributes = \"\";\n\t\t$this->saldo8->HrefValue = \"\";\n\t\t$this->saldo8->TooltipValue = \"\";\n\n\t\t// debet9\n\t\t$this->debet9->LinkCustomAttributes = \"\";\n\t\t$this->debet9->HrefValue = \"\";\n\t\t$this->debet9->TooltipValue = \"\";\n\n\t\t// credit9\n\t\t$this->credit9->LinkCustomAttributes = \"\";\n\t\t$this->credit9->HrefValue = \"\";\n\t\t$this->credit9->TooltipValue = \"\";\n\n\t\t// saldo9\n\t\t$this->saldo9->LinkCustomAttributes = \"\";\n\t\t$this->saldo9->HrefValue = \"\";\n\t\t$this->saldo9->TooltipValue = \"\";\n\n\t\t// debet10\n\t\t$this->debet10->LinkCustomAttributes = \"\";\n\t\t$this->debet10->HrefValue = \"\";\n\t\t$this->debet10->TooltipValue = \"\";\n\n\t\t// credit10\n\t\t$this->credit10->LinkCustomAttributes = \"\";\n\t\t$this->credit10->HrefValue = \"\";\n\t\t$this->credit10->TooltipValue = \"\";\n\n\t\t// saldo10\n\t\t$this->saldo10->LinkCustomAttributes = \"\";\n\t\t$this->saldo10->HrefValue = \"\";\n\t\t$this->saldo10->TooltipValue = \"\";\n\n\t\t// debet11\n\t\t$this->debet11->LinkCustomAttributes = \"\";\n\t\t$this->debet11->HrefValue = \"\";\n\t\t$this->debet11->TooltipValue = \"\";\n\n\t\t// credit11\n\t\t$this->credit11->LinkCustomAttributes = \"\";\n\t\t$this->credit11->HrefValue = \"\";\n\t\t$this->credit11->TooltipValue = \"\";\n\n\t\t// saldo11\n\t\t$this->saldo11->LinkCustomAttributes = \"\";\n\t\t$this->saldo11->HrefValue = \"\";\n\t\t$this->saldo11->TooltipValue = \"\";\n\n\t\t// debet12\n\t\t$this->debet12->LinkCustomAttributes = \"\";\n\t\t$this->debet12->HrefValue = \"\";\n\t\t$this->debet12->TooltipValue = \"\";\n\n\t\t// credit12\n\t\t$this->credit12->LinkCustomAttributes = \"\";\n\t\t$this->credit12->HrefValue = \"\";\n\t\t$this->credit12->TooltipValue = \"\";\n\n\t\t// saldo12\n\t\t$this->saldo12->LinkCustomAttributes = \"\";\n\t\t$this->saldo12->HrefValue = \"\";\n\t\t$this->saldo12->TooltipValue = \"\";\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "function createListFieldsFrontend()\n {\n $insertValues = \"\";\n $table = Doctrine_Core::getTable($this->tableName)->getColumns();\n \n $head = '';\n $td = '';\n $filters = '';\n foreach ($table as $fielnameKey => $info)\n {\n \t$fielname = ucwords(str_replace('_', ' ', $fielnameKey));\n if (strtolower($fielnameKey) != 'created_at' && strtolower($fielnameKey) != 'updated_at') {\n $head .= \"<th class=\\\"list\\\">\".ucwords(str_replace('_',' ', $fielname)).\"</th>\\r\\n\";\n $td .= \"<td><a href=\\\"<?php echo \\$this->url(array('module'=>'\".$this->moduleName.\"', 'action'=>'show', 'id'=>\\$\".strtolower($this->moduleName).\"->id));?>\\\"><?php echo \\$\".strtolower($this->moduleName).\"->\".$fielnameKey.\";?></a></td>\\r\\n\";\n $filters .= \"\n \".ucwords(str_replace('_', ' ', $fielnameKey)).\":\n <input type='text' id='filter-\".$fielnameKey.\"' name='filter[\".$fielnameKey.\"]' value='<?php echo \\$this->filter['\".$fielnameKey.\"'];?>'><br/>\n \";\n }\n }\n \n $this->list_th = $head;\n $this->list_td = $td;\n $this->filters = $filters;\n }", "private function tableShow($list){\r\n\r\n$html = '<table class=\"mwms_data_list contentmod_data_list\">\r\n\t<caption id=\"articles_browser\"><div id=\"browser_filter\">\r\n\t\t'.$this->setFilterForm().'\r\n\t\t<span class=\"label\">'.$this->lng['mwms_article_source'].'</span> '.$this->getArticleSourceFilter((int)Registry::get('mediamix_id_source_active')).'\r\n\t</div></caption>\r\n\t<thead>\r\n\t\t<tr>\r\n\t\t\t<th style=\"width:80px;\">'.$this->lng['mwms_article_id'].' ('.$this->result_count.') '.$this->setOrder('articles_order','id_article', 'articles_order_direction', $this->lng['mwms_article_id'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th>'.$this->lng['mwms_article_title'].' '.$this->setOrder('articles_order','title', 'articles_order_direction', $this->lng['mwms_article_title'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th>'.$this->lng['mwms_article_date_public'].' '.$this->setOrder('articles_order','date_public', 'articles_order_direction', $this->lng['mwms_article_date_public'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th style=\"width:100px;\">'.$this->lng['mwms_article_public'].' '.$this->setOrder('articles_order','id_public', 'articles_order_direction', $this->lng['mwms_article_public'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th style=\"width:140px;\">'.$this->lng['mwms_article_date_ins'].' '.$this->setOrder('articles_order','date_ins', 'articles_order_direction', $this->lng['mwms_article_date_ins'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th style=\"width:140px;\">'.$this->lng['mwms_article_date_upd'].' '.$this->setOrder('articles_order','date_upd', 'articles_order_direction', $this->lng['mwms_article_date_upd'],'articles.browser.inner.php', true).'</th>\r\n\t\t\t<th class=\"toolbar\">\r\n\t\t\t\t<button class=\"mwms_article_new button\" title=\"'.$this->lng['mwms_article_new'].'\">'.$this->lng['mwms_article_new'].'</button>\r\n\t\t\t</th>\r\n\t\t</tr>\r\n\t</thead><tbody>\r\n\t';\r\n\r\n\tforeach($list as $d){\r\n\t\t\r\n\t\t$strI = '<br />SYSTEM';\r\n\t\t$strU = null;\r\n\t\t\r\n\t\tif($d['id_ins'] > 0 || $d['id_upd'] > 0){\r\n\t\t\t$uD = new UserBrowser;\r\n\t\t\t$userIData = $d['id_ins'] > 0 ? $uD->getUserData($d['id_ins']): null;\r\n\t\t\t$userUData = $d['id_upd'] > 0 ? $uD->getUserData($d['id_upd']): null;\r\n\t\t\t$strI = $d['id_ins'] > 0 ? '<br />'.$userIData['username']: $strI;\r\n\t\t\t$strU = $d['id_upd'] > 0 ? '<br />'.$userUData['username']: $strU;\r\n\t\t}\r\n\t\t\r\n\t\t$dateI = null;\r\n\t\t$dateU = null;\r\n\t\t\r\n\t\tif($d['date_ins'] > 0 || $d['id_upd'] > 0){\r\n\t\t\t$dateI = $d['date_ins'] > 0 ? date(Lng::get('system/date_time_format_precise'), $d['date_ins']): $dateI;\r\n\t\t\t$dateU = $d['date_upd'] > 0 ? date(Lng::get('system/date_time_format_precise'), $d['date_upd']): $dateU;\r\n\t\t}\r\n\t\t\r\n\t\t$_s = $this->getSourceData($d['id_source']);\r\n\t\t\r\n\t\t$title = $_s['template'] == 'autobazary' ? $this->autobazarAdminShow($d): $d['title'];\r\n\t\t\r\n\t\t$html .= '<tr id=\"content_cast_'.$d['id_article'].'\" class=\"content_cast\" title=\"'.$d['title'].'\">\r\n\t\t\t<td>'.$d['id_article'].' <input type=\"hidden\" name=\"id_article\" value=\"'.$d['id_article'].'\" /></td>\r\n\t\t\t<td>'.$title.'</td>\r\n\t\t\t<td>'.date(Lng::get('system/date_time_format_precise'), $d['date_public']).'</td>\r\n\t\t\t<td><span class=\"toggle-icon '.$this->toggleOnOff($d['id_public']).'\"></span></td>\r\n\t\t\t<td>'.$dateI.$strI.'</td>\r\n\t\t\t<td>'.$dateU.$strU.'</td>\r\n\t\t\t<td class=\"toolbar\"></td>\r\n\t\t</tr>';\r\n\t\r\n\t}\r\n\r\n\treturn $html.'</tbody></table>';\r\n}", "protected function AdminRows_row() {\n\t$sDate = $this->BestDate();\n\tif (is_null($sDate)) {\n\t $yrSort = NULL;\n\t $yrShow = 'no date';\n\t $htWhen = $this->DatesAvailable();\n\t} else {\n\t $dtSort = strtotime($sDate);\n\t $yrSort = date('Y',$dtSort);\n\t $yrShow = $yrSort;\n\t $htWhen = $this->DatesAvailable($yrSort);\n\t}\n\tif ($this->nYearLast != $yrSort) {\n\t $this->nYearLast = $yrSort;\n\t $yrHdr = '<tr><td colspan=5 class=\"table-section-header\">'.$yrShow.'</td></tr>';\n\t} else {\n\t $yrHdr = NULL;\n\t}\n \n\t$cssClass = $this->AdminRow_CSSclass();\n\t$htID = $this->SelfLink();\n\t$htReq = $this->RequestLink();\n\t$htSupp = $this->SupplierCatKey();\n\t$htWhse = $this->WarehouseName();\n\t$htInvc = $this->InvoiceNumber();\n\t$htCarr = $this->CarrierText();\n\t$htTotMerch = $this->InvoiceTotal_Merch();\n\t$htTotFinal = $this->InvoiceTotal_Final();\n\t$htCond = $this->InvoiceCondition_short();\n\t$htPay = $this->PaymentMethod_text();\n\t$htNotes = '<span class=line-notes>'.$this->NotesText().'</span>';\n\t\n\treturn <<<__END__\n $yrHdr\n <tr class=\"$cssClass\">\n <td>$htID</td>\n <td>$htReq</td>\n <td align=center>$htSupp</td>\n <td align=center>$htWhse</td>\n <td>$htInvc</td>\n <td>$htCarr</td>\n <td align=right>$htWhen</td>\n <td align=right>$htTotMerch</td>\n <td align=right>$htTotFinal</td>\n <td align=center>$htCond</td>\n <td>$htPay</td>\n <td>$htNotes</td>\n </tr>\n__END__;\n }" ]
[ "0.74065137", "0.61238444", "0.5889576", "0.57344335", "0.57226825", "0.5684675", "0.5684675", "0.5684675", "0.5684675", "0.5684675", "0.561048", "0.5608304", "0.54965234", "0.5412308", "0.5386662", "0.5354837", "0.5329861", "0.5289985", "0.52898264", "0.52828306", "0.52777666", "0.5231254", "0.5228301", "0.52052027", "0.5199846", "0.51995087", "0.51869434", "0.51783264", "0.5157559", "0.5127568" ]
0.7141884
1
/ This behavior inserts a new tab on event creation/edition page $post parameter is not null when on an edition page
public static function adminEventHandlerTab($post) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function university_page_on_theme_activation()\n{\n\n // Set the title, template, etc\n $new_page_title = __('Past Events', 'university');\n // Page's title\n $new_page_content = ''; // Content goes here\n $new_page_template = 'page-past-events.php'; // The template to use for the page\n $page_check = get_page_by_title($new_page_title); // Check if the page already exists\n // Store the above data in an array\n $new_page = array(\n 'post_type' => 'page',\n 'post_title' => $new_page_title,\n 'post_content' => $new_page_content,\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_name' => 'past-events'\n );\n // If the page doesn't already exist, create it\n if (!isset($page_check->ID)) {\n $new_page_id = wp_insert_post($new_page);\n if (!empty($new_page_template)) {\n update_post_meta($new_page_id, '_wp_page_template', $new_page_template);\n }\n }\n}", "function publish_form_new_tabs($publish_tabs, $weblog_id, $entry_id, $hidden)\n\t{\n\t\tglobal $EXT, $PREFS, $SESS;\n\n\t\t$this->get_last_call($publish_tabs);\n\n\t\tif($this->show_tab($weblog_id))\n\t\t\t$publish_tabs['nsm_ct'] = 'Custom Tab';\n\n\t\treturn $publish_tabs;\n\t}", "function sinan_before_content_import( $selected_import ) {\n\n $homepage = array(\n 'post_title' => 'Homepage',\n 'post_type' => 'page', \n 'post_content' => '',\n 'post_status' => 'publish',\n );\n \n wp_insert_post( $homepage );\n $front_page = get_page_by_title( 'Homepage' );\n update_post_meta( $front_page -> ID, '_wp_page_template', 'page-templates/page_widgetized.php' );\n}", "public function postCreateContent()\n {\n return false;\n }", "public function NewPost() {\n\t\tif(isset($_SESSION['admin'])) {\n\t\t\trequire \"../view/BackOffice/NewPost.php\";\n\t\t}\n\t\telse {\n\t\t\techo \"Vous ne pouvez pas accéder à cette rubrique !\";\n\t\t}\n\t\t\n\t}", "function newPost($title, $content)\n{\n $adminManager = new AdminManager();\n\n $adminManager->addPost($title, $content);\n\n header(\"Location: index.php?action=adminLog&name=chapters\");\n}", "function apptivo_ecommerce_create_page( $slug, $option, $page_title = '', $page_content = '', $post_parent = 0 ) {\n\tglobal $wpdb;\n\t \n\t$option_value = get_option($option); \n\t \n\tif ($option_value>0) :\n\t\tif (get_post( $option_value )) :\n\t\t\t// Page exists\n\t\t\treturn;\n\t\tendif;\n\tendif;\n\t\n\t$page_found = $wpdb->get_var(\"SELECT ID FROM \" . $wpdb->posts . \" WHERE post_name = '$slug' LIMIT 1;\");\n\tif ($page_found) :\n\t\t// Page exists\n\t\treturn;\n\tendif;\n\t\t\n\t$page_data = array(\n 'post_status' => 'publish',\n 'post_type' => 'page',\n 'post_author' => 1,\n 'post_name' => $slug,\n 'post_title' => $page_title,\n 'post_content' => $page_content,\n 'post_parent' => $post_parent,\n 'comment_status' => 'closed'\n );\n $page_id = wp_insert_post($page_data); \n update_option($option, $page_id);\n}", "function making_page($post_name, $dummy_content) {\n\t$post_data = array(\n 'post_title' => $post_name,\n 'post_name' => $post_name,\n 'post_content' => $dummy_content,\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_type' => 'page'\n );\n\t$post_id = wp_insert_post( wp_slash($post_data) );\t\n\techo $post_name.' page was created<br/>';\n}", "public function insert_page() {\n\n $current_user = wp_get_current_user();\n $page = [\n 'post_title' => __( \"GitHub Job List\", 'wp-member-manager' ),\n 'post_content' => \"[my_github]\",\n 'post_status' => 'publish',\n 'post_author' => $current_user->ID,\n 'post_type' => 'page',\n ];\n // insert the post into the database\n wp_insert_post( $page );\n }", "public function postInsert($event)\n {\n // Create a virtual page for this item\n $page = new aPage();\n $page['slug'] = $this->getVirtualPageSlug();\n // Search is good, let it happen\n $page['view_is_secure'] = false;\n // ... But not if we're unpublished\n $page->archived = !($this->status === 'published');\n $page->save();\n $this->Page = $page;\n\n // Create a slot for the title and add to the virtual page\n $title = $page->createSlot('aText');\n $title->value = 'Untitled';\n $title->save();\n $page->newAreaVersion('title', 'add',\n array(\n 'permid' => 1,\n 'slot' => $title));\n\n // Create a slot to index the tags and categories in search.\n $catTag = $page->createSlot('aText');\n $catTag->value = '';\n $catTag->save();\n $page->newAreaVersion('catTag', 'add',\n array(\n 'permid' => 1,\n 'slot' => $catTag));\n\n // Make default values for this item\n $this['slug'] = 'untitled-'.$this['id'];\n $this['title'] = 'untitled';\n $this['slug_saved'] = false;\n\n // This prevents post preupdate from running after the next save\n $this->update = false;\n $this->save();\n }", "public function rendercreatetab_event()\n\t{\n\t\t$mentor_link = $this->CFG->wwwroot.'/create';\n\t\t$school_link=$this->CFG->wwwroot.'/create/listschool.php';\n\t\t$event_link = $this->CFG->wwwroot.'/create/listevent.php';\n\t\t$content = '<div class=\"card-text content\">\n\t\t<div id=\"block-createtab\" class=\"block-createtab\" data-region=\"createtab\">\n\t\t\t<ul id=\"block-createtab-view-choices\" class=\"nav nav-tabs\" role=\"tablist\">\n\t\t\t\t<li class=\"nav-item\">\n\t\t\t\t<a id=\"v1\" class=\"nav-link \" href=\"'.$mentor_link.'\" data-tabname=\"mentors\" aria-expanded=\"false\">Mentors </a>\n\t\t\t\t</li>\n\t\t\t\t<li class=\"nav-item\">\n\t\t\t\t<a id=\"v2\" class=\"nav-link\" href=\"'.$school_link.'\" data-tabname=\"events\" aria-expanded=\"false\">Schools</a>\n\t\t\t\t</li>\n\t\t\t\t<li class=\"nav-item\">\n\t\t\t\t<a id=\"v2\" class=\"nav-link active\" href=\"'.$event_link.'\" data-tabname=\"events\" aria-expanded=\"true\">Events</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t<div class=\"tab-content content-centred tabcontentatal\">';\n\t\t$content.=$this->render_event_content();\n\t\t$content.='</div></div></div>'; //Close tabcotent,block-createab,card-text\n\treturn $content;\n\t}", "function evo_belowsingleinsert() {\r\n\t\tdo_action('evo_belowsingleinsert');\r\n\t}", "public function onPostCreated($event)\n {\n //\n }", "function weild_deal_forum( $post_id ) {\n // Only do it for \"custom_post\" post type\n if( get_post_type($post_id) != 'deal' ){\n return;\n } \n // Only do it on the front end\n if( is_admin() ){\n return;\n }\n $post_title = get_the_title($post_id);\n $forum_id = wp_insert_post( array(\n 'post_status' => 'pending',\n 'post_type' => 'forum',\n 'post_title' => 'Forum '.$post_title,\n 'post_content' => $post_title\n ) );\n update_post_meta($post_id,'forumn_id',$forum_id);\n}", "function lag_ovelse($tittel, $slug)\n{\n $author_id = 1;\n\n // If the page doesn't already exist, then create it\n if (null == get_page_by_slug($slug, OBJECT, 'tribe_events')) {\n\n // Set the post ID so that we know the post was created successfully\n $post_id = wp_insert_post(\n array(\n 'comment_status' => 'closed',\n 'ping_status' => 'closed',\n 'post_author' => $author_id,\n 'post_name' => $slug,\n 'post_title' => $tittel,\n 'post_status' => 'private',\n 'post_type' => 'tribe_events',\n 'post_content' => 'Vanlig øvelse',\n )\n );\n\n // Otherwise, we'll stop\n } else {\n\n // Arbitrarily use -2 to indicate that the page with the title already exists\n $post_id = -2;\n\n } // end if\n return $post_id;\n}", "function create_draft() {\n\n\t\t$author_id = 1;\n\t\t$post_title = $this->message;\n\t\t$status = 'draft';\n\n\t\t$post_data = array(\n\t\t\t'post_type'\t\t\t=> 'piwaka',\n\t\t\t'post_author'\t\t=> $author_id,\n\t\t\t'post_title'\t\t=> $post_title,\n\t\t\t'post_status'\t\t=> $status,\n\t\t\t'post_content'\t\t=> '[piwaka-featured]'\n\t\t);\n\n\t\t$post_id = wp_insert_post($post_data);\n\n\t\t$this->post_id = $post_id;\n\t\t$this->post_title = $post_title;\n\t\t$this->permalink = get_permalink( $post_id );\n\n\t}", "function new_page() {\n $this->data['menu_highlight'] = \"Pages\";\n $id = null;\n\n if (isset($_POST['content']))\n $id = $this->_save(null);\n\n $page = new page_model();\n if ($id) \n $page = $page->get_from_id($id);\n\n $this->_edit_pages($page, $id, \"New Page\");\n }", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"Fieldthemes\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n\t// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldOneCateProductSlider\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configure one categories\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "public function forcePreviewBeforePublish() {\n\t\t\tglobal $pagenow;\n\t\t\t\n\t\t\t$postTypes = ['post','video']; // FIXME: make configurable\n\t\t\t\n\t\t\t$postType = null;\n\t\t\tif ( 'post.php' === $pagenow && isset($_GET['post'])) {\n\t\t\t\t$postType = get_post_type( $_GET['post'] );\n\t\t\t} else if ('post-new.php' == $pagenow) {\n\t\t\t\t$postType = 'post';\n\t\t\t\tif (isset($_GET['post_type'])) {\n\t\t\t\t\t$postType = $_GET['post_type'];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (in_array($postType,$postTypes)) {\n\t\t\t\t$this->insertHidePreview();\n\t\t\t}\n\t\t\t\n\t\t}", "function publish_form_new_tabs_block( $weblog_id )\n\t{\n\t\tif($this->debug === TRUE) print(\"<br />publish_form_new_tabs_block\");\n\n\t\tglobal $DB, $EXT, $PREFS, $SESS, $LANG, $REGX, $IN, $DSP;\n\n\t\t$LANG->fetch_language_file('lg_live_look_ext');\n\n\t\t$ret = ($EXT->last_call !== FALSE) ? $EXT->last_call : '';\n\n\t\tif($SESS->cache['lg'][LG_LL_addon_id]['display_tab'] === TRUE)\n\t\t{\n\t\t\t$entry_id = $SESS->cache['lg'][LG_LL_addon_id]['publish_form_entry_id'];\n\t\t\t$preview_url = $this->_parse_url(urlencode($entry_id));\n\t\t\t$ret .= '<script type=\"text/javascript\" charset=\"utf-8\">var lg_live_look_url = \"'.$preview_url.'\";</script>';\n\t\t\tob_start(); include(PATH_LIB.'lg_live_look/views/lg_live_look_ext/tab_live_look.php'); $ret .= ob_get_clean();\n\t\t}\n\t\treturn $ret;\n\t}", "function zaxu_new_tab_to_visit_site($wp_admin_bar) {\n $all_toolbar_nodes = $wp_admin_bar->get_nodes();\n foreach ($all_toolbar_nodes as $node) {\n if ($node->id == 'site-name' || $node->id == 'view-site') {\n $args = $node;\n $args->meta = array('target' => '_blank');\n $wp_admin_bar->add_node( $args );\n }\n }\n }", "function publish_form_new_tabs( $publish_tabs, $weblog_id, $entry_id, $hidden )\n\t{\n\t\tif($this->debug === TRUE) print(\"<br />publish_form_new_tabs\");\n\n\t\tglobal $EXT, $PREFS, $SESS;\n\t\t$SESS->cache['lg'][LG_LL_addon_id]['display_tab'] = FALSE;\n\t\tif($EXT->last_call !== FALSE)\n\t\t{\n\t\t\t$publish_tabs = $EXT->last_call;\n\t\t}\n\t\tif(\n\t\t\t// enabled?\n\t\t\t$this->settings['enabled'] == TRUE &&\n\t\t\t// allowed member group?\n\t\t\tin_array($SESS->userdata['group_id'], $this->settings['allowed_member_groups']) &&\n\t\t\t// show tab for this weblog\n\t\t\t( isset($this->settings['weblogs'][$weblog_id]) && $this->settings['weblogs'][$weblog_id]['display_tab'] == TRUE )\n\t\t)\n\t\t{\n\t\t\t$publish_tabs['llp'] = 'Live Look';\n\t\t\t$SESS->cache['lg'][LG_LL_addon_id]['display_tab'] = TRUE;\n\t\t}\n\n\t\treturn $publish_tabs;\n\n\t}", "public static function adminAfterEventHandlerCreate($cur_post, $cur_event, $post_id) {\n\t\t\n\t}", "function muiteer_new_tab_to_visit_site($wp_admin_bar) {\n $all_toolbar_nodes = $wp_admin_bar->get_nodes();\n foreach ($all_toolbar_nodes as $node) {\n if ($node->id == 'site-name' || $node->id == 'view-site') {\n $args = $node;\n $args->meta = array('target' => '_blank');\n $wp_admin_bar->add_node( $args );\n }\n }\n }", "function learndash_new_step_insert( $post_id, $post, $update ) {\n\t$post_id = absint( $post_id );\n\tif ( ( ! empty( $post_id ) ) && ( ! $update ) && ( $post ) && ( is_a( $post, 'WP_Post' ) ) && ( in_array( $post->post_type, learndash_get_post_types( 'course_steps' ), true ) ) ) {\n\t\t$learndash_course_dirty = get_option( 'learndash_course_dirty', array() );\n\t\tif ( ! is_array( $learndash_course_dirty ) ) {\n\t\t\t$learndash_course_dirty = array();\n\t\t}\n\t\t$learndash_course_dirty[] = $post_id;\n\t\tupdate_option( 'learndash_course_dirty', $learndash_course_dirty );\n\t}\n}", "function createDraft($templateHtml, $itemId, $ptvType, $postTitle) {\n $posts = get_posts([\n 'post_type'=> 'page',\n 'meta_key'=> 'ptv_id',\n 'meta_value'=> $itemId,\n 'post_status' => 'any'\n ]);\n\n $postCount = count($posts);\n\n if ($postCount == 0) {\n $regExp = '/\"id\":\"[a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-(8|9|a|b)[a-f0-9]{3}\\-[a-f0-9]{12}/';\n $draftHtml = preg_replace($regExp, '\"id\":\"' . $itemId, $templateHtml);\n $draftData = [\n 'post_content' => $draftHtml,\n 'post_type' => 'page',\n 'post_title' => $postTitle\n ];\n\n $result = wp_insert_post($draftData);\n if ($result != 0) {\n add_post_meta($result, 'ptv_id', $itemId);\n add_post_meta($result, 'ptv_type', $ptvType);\n }\n }\n }", "function dashboard_widget_blorm_newpost() {\n require_once PLUGIN_BLORM_PLUGIN_DIR . '/templates/blorm_newpost.php';\n}", "public function postCreate()\n\t{\n\t}", "function bookreview_tab () {\n\tadd_action( 'bp_template_title', 'bookreview_tab_title' );\n\tadd_action( 'bp_template_content', 'bookreview_tab_content' );\n\tbp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n}", "public function add_new_admin_page(){//Takes page title as ref (parent is assumed as post above.\n\n $post_type_name = $this->post_type_name;\n $parent_page = 'edit.php?post_type='.$post_type_name;\n $page_title = 'Upload Zip';\n $page_slug = strtolower( str_replace( ' ', '_', $page_title ) );\n\n add_submenu_page( $parent_page, $page_title, $page_title, 'manage_options', $page_slug, array( &$this,'upload_zip_form') );\n }" ]
[ "0.6053136", "0.5958856", "0.58780336", "0.58718336", "0.58707863", "0.5862686", "0.58602846", "0.5818485", "0.5767648", "0.5762898", "0.57384336", "0.5716293", "0.5695637", "0.56889707", "0.56536263", "0.559766", "0.5593567", "0.55873436", "0.5572521", "0.5563497", "0.55612373", "0.5555453", "0.5553903", "0.55423826", "0.55421996", "0.55174154", "0.5516037", "0.5510837", "0.5496098", "0.5482386" ]
0.6116701
0
Is this a route to a collection or a resource? Determined by looking at the last part of the route's path, and seeing if it's a matchstring ([:variable]). If the last part is a matchstring, then this is for a resource
public function isResourceRoute($route) { $last = array_pop(explode('/',$route)); return preg_match('#^\[.?:[\w_]+]$/?#',$last) === 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isCollectionRoute($route) {\n $last = array_pop(explode('/',$route));\n\n return preg_match('#^[\\w_]+$#',$last) === 1;\n }", "private function _routeExiste()\n {\n if ($this->_validObject === true) {\n \n if (isset($this->_routes[$this->_pathInfo])) {\n \n $this->_discoveredHandler = $this->_routes[$this->_pathInfo];\n return true;\n } elseif ($this->_routes) {\n \n $tokens = array(\n ':string' => '([a-zA-Z]+)',\n ':number' => '([0-9]+)',\n ':alpha' => '([a-zA-Z0-9-_]+)'\n );\n \n foreach ($this->_routes as $pattern => $handlerName) {\n \n $pattern = strtr($pattern, $tokens);\n \n if (preg_match_all('#^/?' . $pattern . '/?$#', $this->_pathInfo, $matches)) {\n \n $this->_discoveredHandler = $handlerName;\n $this->_regexMatches = $matches;\n return true;\n }\n }\n }\n }\n \n return false;\n }", "public function matchRouteAndUrl(){\n\t\t\tif(empty($this->allRoutes)){return false;}\n\n\t\t\tforeach($this->allRoutes as $route){\n\t\t\t\n\t\t\t\t//Parts prevents buggy behavior if argument is requested (/params/name) and preceeded with another route (/params).\n\t\t\t\t$firstPart = ($route->hasParam) ? $this->url->getEverythingButLastPartOfUrl() : \"\";\n\t\t\t\t$lastPart = $this->url->getLastPartOfUrl();\n\t\t\t\t\n\t\t\t\t//Runs if no argument has been declared\n\t\t\t\tif($route->url == $this->url->stripURLRequest() && $route->requestMethod == $_SERVER['REQUEST_METHOD'] && !($route->hasParam)){\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\t\t\t\t//Runs if argument has been declared\n\t\t\t\tif($route->url == $firstPart && $route->requestMethod == $_SERVER['REQUEST_METHOD'] && !empty($firstPart)){\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function match( \\Symfony\\Component\\HttpFoundation\\Request $request ) {\n\n //print '[ASC3] &gt; RouteCollection::match() Test: Method is: ' . $request->getMethod() . '<br>';\n //print '[ASC3] &gt; RouteCollection::match() Test: All routes in collection: <br>';\n\n //print_r2_button('Routes'); print_r2( $this->routes);\n\n //print 'RouteCollection::match() Test: Request object: <br>';\n //print_r2_button('Rq'); print_r2( $request );\n //print 'Method: ' . $request->getMethod() . '<br>';\n\n $routes = $this->get( $request->getMethod() ); //array, vrni vse route dane metode\n\n $route = $this->check( $request, $routes );\n\n\n return $route;\n\n }", "public function hasRoute($name);", "function route_equal($uri)\n{\n $uri = trim($uri, '/');\n\n return $uri == _rr() || $uri == route_name();\n}", "protected function routePathMatch() : bool\n {\n $requestRoute = $this->response->get_matched_route();\n\n if ( ( is_array($this->routeInput) && in_array( $requestRoute, $this->routeInput ))\n || $this->routeInput == $requestRoute ) {\n return true;\n }\n \n return false;\n }", "function route_contain($uri, array $except = array())\n{\n if (call_user_func_array('route_except', $except) === false) {\n return false;\n }\n\n $args = is_array($uri) ? $uri : array($uri);\n foreach ($args as $uri) {\n if ($uri) {\n $uri = trim($uri, '/');\n }\n\n if (stristr(_rr(), $uri)) {\n return true;\n }\n }\n\n return false;\n}", "protected function pathinfo(){\n foreach (array_merge(self::$route[$this->request->request_mothod()],self::$route[\"ANY\"]) as $route){\n if (strrpos($route[\"url\"], \"{\") !== false) {\n if($this->vertify_pathinfo($route)){\n return true;\n }\n else{\n continue;\n }\n }\n else{\n if('/'.$route[\"url\"]==$this->request->get_url()){\n $this->value=$route;\n return true;\n }\n }\n }\n return false;\n }", "abstract protected function getRoutePattern();", "public function url_is_route() {\n\t\t$group = $this->routes_by_method( $_SERVER[ 'REQUEST_METHOD' ] );\n\n\t\t// Basic filtering of routes\n\t\tif ( $group ) {\n\t\t\tforeach ( $group as $i => $route ) {\n\t\t\t\tif ( $_matched = $route->is_matched() ) {\n\t\t\t\t\treturn $_matched;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function current_route_is( $name ) {\n\t$route = request()->getLoadedRoute();\n\n\tif ( $route ) {\n\t\treturn $route->hasName( $name );\n\t}\n\n\treturn false;\n\n}", "function current_route_is( $name ) {\n\t$route = request()->getLoadedRoute();\n\n\tif ( $route ) {\n\t\treturn $route->hasName( $name );\n\t}\n\n\treturn false;\n\n}", "function route_name()\n{\n return Router::getMatchedName();\n}", "public function hasCurrentRoute();", "function is_route_path( $name )\n {\n if(preg_match('/('. strtolower($name) .')/i' , current_route() , $m) === 1)\n {\n return true;\n }\n\n return false;\n }", "public function getResourceType()\n {\n return $this->route->getResourceType();\n }", "public function matchesResource($resource)\n {\n $resource = is_object($resource) ? get_class($resource) : $resource;\n\n return $this->resource === $resource || $this->resource === 'all';\n }", "function roles_path_match($rule, $path) {\r\n\treturn roles()->matchPath($rule, $path);\r\n}", "function routeExists($name)\n{\n $router = $this->container->get('router');\n return (null === $router->getRouteCollection()->get($name)) ? false : true;\n}", "abstract public function routeName();", "private function matchRoute($route)\n {\n if (is_array($route)) {\n return $this->request->routeIs($route[0]);\n }\n return $this->request->routeIs($route);\n }", "public function validateDocPath($path) {\n // TODO: sync up w/ routeCollections.\n $schema = new Schema();\n $collections = $schema->getActiveCollections();\n $items = explode('/', $path);\n // This is a set part of the API.\n if ($items[0] == 'collections') {\n $collection = $items[1];\n // Check if the top level collection is part of the route.\n if (in_array($collection, $collections)) {\n $d = explode('.', $items[2]);\n $doc = $d[0];\n if (TRUE && $d[1] == 'json') {\n return $doc;\n }\n else {\n }\n }\n }\n return FALSE;\n }", "function _route( $resource = null ) {\n\n\n epl_log( \"init\", \"<pre>\" . print_r( $resource, true ) . \"</pre>\" );\n\n if ( self::$routed )\n return;\n epl_log( \"init\", \"<pre>\" . print_r( $resource, true ) . \"</pre>\" );\n\n\n global $valid_controllers, $post; //When the shortcode is processed, the page id is ready\n\n\n if ( !array_key_exists( $resource, $valid_controllers ) )\n return false;\n\n $epl = & EPL_Base::get_instance();\n $controller_location = $valid_controllers[$resource]['location'];\n\n $controller = $epl->load_controller( $controller_location );\n\n self::$routed = true;\n\n if ( !EPL_IS_ADMIN && !isset( $_REQUEST['epl_action'] ) ) {\n return $controller->run(); //doing this for the shortcode\n }\n }", "public static function isRouteAble()\n {\n return true;\n }", "abstract protected function getRouteName();", "public function routeMatch()\n {\n if (!$this->routeMatch) {\n $this->routeMatch = Pi::engine()->application()->getRouteMatch();\n }\n\n return $this->routeMatch;\n }", "public function match($path) {\n\t\t$vars = new MutableCollection();\n\n\t\t$path = trim($path, FS);\n\t\t$path = empty($path) ? array() : explode(FS, $path);\n\n\t\tif (isset($path[0]))\n\t\t\t$vars->resource = $path[0];\n\n\t\tif (isset($path[1])) {\n\t\t\tif (is_numeric($path[1])) {\n\t\t\t\t$vars['id'] = intval($path[1]);\n\t\t\t\t$vars['layout'] = isset($path[2]) ? $path[2] : 'item';\n\t\t\t} else {\n\t\t\t\t$vars['layout'] = $path[1];\n\t\t\t}\n\t\t} else {\n\t\t\t$vars['layout'] = 'default';\n\t\t}\n\n\t\treturn $vars;\n\t}", "protected function getRouteMatch() {\n if (!$this->routeMatch) {\n $this->routeMatch = \\Drupal::routeMatch();\n }\n return $this->routeMatch;\n }", "private function route_match ($request, string $method, string $endpoint): bool \n {\n $mw_method = $request->get_method();\n $mw_route = $request->get_route();\n $mw_params = $request->get_url_params();\n $param_matches = array();\n\n preg_match_all('/:[a-z|A-Z]+/', $endpoint, $matches, PREG_UNMATCHED_AS_NULL);\n\n if(is_array($matches) && count($matches) > 0) {\n foreach ($matches[0] as $match) {\n $param_matches[] = str_replace(\":\", \"\", $match);\n }\n }\n\n // If http verbs doesn't match\n if ($mw_method != $method) {\n return false;\n }\n\n // If amount of url params doesn't match\n if (count($mw_params) != count($param_matches)) {\n return false;\n }\n \n // If directory deepness doesn't match\n if (count(explode(\"/\", $endpoint)) != count(explode(\"/\", $mw_route))) {\n return false;\n }\n\n // If param names and position are different\n if (array_keys($mw_params) != $param_matches) {\n return false;\n }\n\n $diffs = array_diff(explode(\"/\", $endpoint), explode(\"/\", $mw_route));\n $url_matches = true;\n \n foreach ($diffs as $diff) {\n if (strpos($diff, ':') !== false && !in_array($diff, $matches[0])) {\n $url_matches = false;\n break;\n }\n if (strpos($diff, ':') === false) {\n $url_matches = false;\n break;\n }\n }\n \n return $url_matches;\n }" ]
[ "0.6181549", "0.57694596", "0.5701203", "0.5657641", "0.56189823", "0.5603995", "0.5503344", "0.5501381", "0.545158", "0.54345024", "0.54323584", "0.5418704", "0.5418704", "0.5391404", "0.538909", "0.53610367", "0.5358967", "0.534968", "0.53227246", "0.5315712", "0.5311694", "0.53079814", "0.5290794", "0.5262715", "0.5248383", "0.5216399", "0.51969224", "0.5189593", "0.5189046", "0.51838106" ]
0.63965136
0
Is this a route to a collection or a resource? Determined by looking at the last part of the route's path, and seeing if it's a 'word' (alpanum + _) aka valid php variable name. If the last part is a word, then this is for a collection
public function isCollectionRoute($route) { $last = array_pop(explode('/',$route)); return preg_match('#^[\w_]+$#',$last) === 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isResourceRoute($route) {\n $last = array_pop(explode('/',$route));\n\n return preg_match('#^\\[.?:[\\w_]+]$/?#',$last) === 1;\n }", "protected function collection()\n {\n return $this->option('collection') ||\n Str::endsWith($this->argument('name'), 'Collection');\n }", "function is_route_path( $name )\n {\n if(preg_match('/('. strtolower($name) .')/i' , current_route() , $m) === 1)\n {\n return true;\n }\n\n return false;\n }", "function current_route_is( $name ) {\n\t$route = request()->getLoadedRoute();\n\n\tif ( $route ) {\n\t\treturn $route->hasName( $name );\n\t}\n\n\treturn false;\n\n}", "function current_route_is( $name ) {\n\t$route = request()->getLoadedRoute();\n\n\tif ( $route ) {\n\t\treturn $route->hasName( $name );\n\t}\n\n\treturn false;\n\n}", "public function validateDocPath($path) {\n // TODO: sync up w/ routeCollections.\n $schema = new Schema();\n $collections = $schema->getActiveCollections();\n $items = explode('/', $path);\n // This is a set part of the API.\n if ($items[0] == 'collections') {\n $collection = $items[1];\n // Check if the top level collection is part of the route.\n if (in_array($collection, $collections)) {\n $d = explode('.', $items[2]);\n $doc = $d[0];\n if (TRUE && $d[1] == 'json') {\n return $doc;\n }\n else {\n }\n }\n }\n return FALSE;\n }", "public function validateCollectionPath($path) {\n $schema = new Schema();\n $collections = $schema->getActiveCollections();\n $items = explode('/', $path);\n if ($items[0] == 'collections') {\n $col = explode('.', $items[1]);\n $collection = $col[0];\n if (in_array($collection, $collections) && $col[1] == 'json') {\n return $collection;\n }\n }\n return FALSE;\n }", "abstract public function routeName();", "public function hasRoute($name);", "abstract protected function getRouteName();", "function is_route( $name )\n {\n if( current_route() == strtolower($name))\n {\n return true;\n }\n\n return false;\n }", "private function _routeExiste()\n {\n if ($this->_validObject === true) {\n \n if (isset($this->_routes[$this->_pathInfo])) {\n \n $this->_discoveredHandler = $this->_routes[$this->_pathInfo];\n return true;\n } elseif ($this->_routes) {\n \n $tokens = array(\n ':string' => '([a-zA-Z]+)',\n ':number' => '([0-9]+)',\n ':alpha' => '([a-zA-Z0-9-_]+)'\n );\n \n foreach ($this->_routes as $pattern => $handlerName) {\n \n $pattern = strtr($pattern, $tokens);\n \n if (preg_match_all('#^/?' . $pattern . '/?$#', $this->_pathInfo, $matches)) {\n \n $this->_discoveredHandler = $handlerName;\n $this->_regexMatches = $matches;\n return true;\n }\n }\n }\n }\n \n return false;\n }", "function route_equal($uri)\n{\n $uri = trim($uri, '/');\n\n return $uri == _rr() || $uri == route_name();\n}", "function route_name()\n{\n return Router::getMatchedName();\n}", "public function is_route()\n {\n if (!array_key_exists($this->route, $this->routes)) {\n return false;\n } else {\n return true;\n }\n }", "function routeExists($name)\n{\n $router = $this->container->get('router');\n return (null === $router->getRouteCollection()->get($name)) ? false : true;\n}", "protected function pathinfo(){\n foreach (array_merge(self::$route[$this->request->request_mothod()],self::$route[\"ANY\"]) as $route){\n if (strrpos($route[\"url\"], \"{\") !== false) {\n if($this->vertify_pathinfo($route)){\n return true;\n }\n else{\n continue;\n }\n }\n else{\n if('/'.$route[\"url\"]==$this->request->get_url()){\n $this->value=$route;\n return true;\n }\n }\n }\n return false;\n }", "public function hasCurrentRoute();", "abstract public function getRouteName(): string;", "public function getRouteName();", "public function getRouteName();", "public function getRouteName();", "function route_class()\n{\n return str_replace('.', '-', Route::currentRouteName());\n}", "public function url_is_route() {\n\t\t$group = $this->routes_by_method( $_SERVER[ 'REQUEST_METHOD' ] );\n\n\t\t// Basic filtering of routes\n\t\tif ( $group ) {\n\t\t\tforeach ( $group as $i => $route ) {\n\t\t\t\tif ( $_matched = $route->is_matched() ) {\n\t\t\t\t\treturn $_matched;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function currentRouteName()\n {\n //if this function is called in dynapart contoller,\n //_route returns \"_internal\", so it need to look at\n //_frontendRoute for real front end route.\n //_frontendRoute is the variable that has been injected by\n //dynapart twig template\n //$route = $this->request()->attributes->get('_route');\n $route = $this->request()->get('_route');\n\n if ($route && $route !== \"_internal\") {\n return $route;\n }\n\n return $this->request()->get('_frontendRoute');\n }", "public function getRouteName(): string;", "abstract protected function getCollectionName();", "function router_check($route = null) {\n\t\tif ($route === null) { return; }\n\t\t\n\t\t$routes = array();\n\t\tif ( is_array( $route ) ) {\n\t\t\t$routes = $route;\n\t\t} else {\n\t\t\t\n\t\t\t$routes = array();\n\t\t\t$routes[] = $route;\n\t\t}\n\n\t\t$route = reset($routes);\n\t\tdo {\n\t\t\t$result = str_starts(strtolower(trim($route)).'/', ROUTE.'/') ? true : false;\n\t\t\t$route = next($routes);\n\t\t} while ($result === false && $route !== false );\n\t\t\t\n\t\treturn $result;\n\t\t\n\t}", "public static function isRouteAble()\n {\n return true;\n }", "function route($path)\n{\n $route = '';\n if (!empty(MightyCore\\Routing\\RouteStore::$namedRoutes[$path])) {\n $route = MightyCore\\Routing\\RouteStore::$namedRoutes[$path];\n }\n return $route;\n}" ]
[ "0.61238396", "0.6071935", "0.5975326", "0.5921845", "0.5921845", "0.5848199", "0.58116376", "0.58080196", "0.57500935", "0.56925553", "0.56282014", "0.5488981", "0.5436065", "0.54275626", "0.54242027", "0.53250194", "0.52906054", "0.5279455", "0.52535105", "0.5243424", "0.5243424", "0.5243424", "0.5204859", "0.51935434", "0.51764756", "0.51699793", "0.51674956", "0.51561636", "0.513879", "0.5137523" ]
0.70360535
0
Actually map the route to the controller and it's action. $route the route to match $httpMethod the http method to respond to $path the namespace contollers live in $controller the relative path/name of controller to load $action the method to call on the controller
public function makeRoute($route, $httpMethod, $controller, $action) { $router = $this; $mappedRoute = $this->klein->respond($httpMethod, $route, function ($request, $response) use ($router, $controller, $action) { $controller->invokeWithRequest($action,$request, $response); }); return $mappedRoute; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function route()\n\t{\n\t\t$rest\t\t\t\t\t= array('PUT', 'DELETE', 'POST', 'GET');\n\t\t$url \t\t\t\t\t= $this->set_url();\n\t\t$this->request_type\t\t= in_array($_SERVER['REQUEST_METHOD'], $rest) ? $_SERVER['REQUEST_METHOD'] : FALSE;\n\t\t\n\t\t$this->break_url();\n\t\t$namespace\t= $this->config->get_item('default_namespace');\n\t\t$controller\t= \"\\\\\" . $namespace . \"\\\\Controllers\\\\\" . $this->controller;\n\t\t\n\t\tif(class_exists($controller)){\n\t\t\t$object\t\t= new $controller($this);\n\t\t\t\n\t\t\t// Does this class implement the REST interface?\n\t\t\tif($this->request_type && $object instanceof \\SmallMVC\\Restfull){\n\t\t\t\t\n\t\t\t\t// If so, call the REST method\n\t\t\t\tcall_user_func(array($object, strtolower($this->request_type)), $this->parameters);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// The usual method call\n\t\t\t\tcall_user_func(array($object, strtolower($this->method)), $this->parameters);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t// Load 404 view\n\t\t\theader('HTTP/1.0 404 Not Found');\n\t\t\tdie(\"The resource isn't here!\");\n\t\t}\n\t}", "public function route() {\n \n //check the route can make sure we can find one\n $this->routeCheck();\n \n //call the resource by name and pass the args.\n $this->response = call_user_func_array(array($this, $this->controller), array(\"args\"=>$this->params)); \n }", "function route () {\n\t\tif (!method_exists($this->controller, $this->method)) {\n\t\t\t$this->controller = 'AppController';\n\t\t\t$this->method = 'four_zero_four';\n\t\t}\n\n\t\t// set controller object\n\t\t$controller_object = new $this->controller();\n\n\t\tif (!empty($this->params)) {\n\t\t\t// params not empty, call method with them\n\t\t\t@call_user_func_array([$controller_object, $this->method], $this->params);\n\t\t}\n\t\telse {\n\t\t\t// call method with no params\n\t\t\t@call_user_func([$controller_object, $this->method]);\n\t\t}\n\t}", "public function dispatch(string $httpMethod, string $uri): RouteInfo;", "public function route()\n\t{\n try {\n // We prepare the requested controller path\n $controller_name = ucfirst($this->controller) . 'Controller';\n $controller_path = $this->getControllerFilePath();\n\n // Validate that the controller file exist\n if ( !file_exists($controller_path) ) {\n $error = $controller_name . '.php' . ' - Controller file doesn\\'t exist.';\n throw new Exception($error);\n }\n\n // We include the controller\n require_once( $controller_path );\n\n // Instantiate the controller\n $controller = new $controller_name($this->args);\n\n // Validate that the method for the action is defined\n if ( !method_exists ($controller, $this->action) ) {\n throw new Exception('Action \"' . $this->action . '\" is not available');\n }\n\n // Call the action\n $controller->callAction($this->action);\n\n } catch( Exception $e ) {\n // Here we will capture any problem found on the routing\n $view = new Presenter();\n $view->renderError($e->getMessage());\n }\n\n\t}", "public static function route() {\n $request = self::parseUrl();\n return self::executeAction($request['controller'], $request['action']);\n }", "private function route()\n {\n // Initialize the router\n $router = new AltoRouter();\n $router->setBasePath(BASEPATH);\n\n // Load plugin/theme routes first\n // TODO: Update router.map in modules to App::addRoute();\n $GLOBALS[\"_ROUTER_\"] = $router;\n \\Event::trigger(\"router.map\", \"_ROUTER_\");\n $router = $GLOBALS[\"_ROUTER_\"];\n\n // Load internal routes\n $this->addInternalRoutes();\n\n // Load global routes\n include APPPATH.\"/inc/routes.inc.php\";\n \n // Map the routes\n $router->addRoutes(App::getRoutes());\n\n // Match the route\n $route = $router->match();\n $route = json_decode(json_encode($route));\n\n if ($route) {\n if (is_array($route->target)) {\n require_once $route->target[0];\n $controller = $route->target[1];\n } else {\n $controller = $route->target.\"Controller\";\n }\n } else {\n header(\"HTTP/1.0 404 Not Found\");\n $controller = \"IndexController\";\n }\n\n $this->controller = new $controller;\n $this->controller->setVariable(\"Route\", $route);\n }", "public static function dispatch(){\n $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $method = $_SERVER['REQUEST_METHOD'];\n $searches = array_keys(static::$patterns);\n $replaces = array_values(static::$patterns);\n $found_route = false;\n self::$routes = preg_replace('/\\/+/', '/', self::$routes);\n // Check if route is defined without regex\n if (in_array($uri, self::$routes)) {\n $route_pos = array_keys(self::$routes, $uri);\n foreach ($route_pos as $route) {\n // Using an ANY option to match both GET and POST requests\n if (self::$methods[$route] == $method || self::$methods[$route] == 'ANY' || (!empty(self::$maps[$route]) && in_array($method, self::$maps[$route]))) {\n $found_route = true;\n // If route is not an object\n if (!is_object(self::$callbacks[$route])) {\n // Grab all parts based on a / separator\n $parts = explode('/',self::$callbacks[$route]);\n // Collect the last index of the array\n $last = end($parts);\n // Grab the controller name and method call\n $segments = explode('@',$last);\n // Instanitate controller\n $controller = new $segments[0]();\n // Call method\n return $controller->{$segments[1]}();\n if (self::$halts) return;\n } else {\n // Call closure\n call_user_func(self::$callbacks[$route]);\n if (self::$halts) return;\n }\n }\n }\n } else {\n // Check if defined with regex\n $pos = 0;\n foreach (self::$routes as $route) {\n if (strpos($route, ':') !== false) {\n $route = str_replace($searches, $replaces, $route);\n }\n if (preg_match('#^' . $route . '$#', $uri, $matched)) {\n if (self::$methods[$pos] == $method || self::$methods[$pos] == 'ANY' || (!empty(self::$maps[$pos]) && in_array($method, self::$maps[$pos]))) {\n $found_route = true;\n // Remove $matched[0] as [1] is the first parameter.\n array_shift($matched);\n if (!is_object(self::$callbacks[$pos])) {\n // Grab all parts based on a / separator\n $parts = explode('/',self::$callbacks[$pos]);\n // Collect the last index of the array\n $last = end($parts);\n // Grab the controller name and method call\n $segments = explode('@',$last);\n // Instanitate controller\n $controller = new $segments[0]();\n // Fix multi parameters\n if (!method_exists($controller, $segments[1])) {\n echo \"controller and action not found\";\n } else {\n return call_user_func_array(array($controller, $segments[1]), $matched);\n }\n if (self::$halts) return;\n } else {\n call_user_func_array(self::$callbacks[$pos], $matched);\n if (self::$halts) return;\n }\n }\n }\n $pos++;\n }\n }\n // Run the error callback if the route was not found\n if ($found_route == false) {\n if (!self::$error_callback) {\n self::$error_callback = function() {\n header($_SERVER['SERVER_PROTOCOL'].\" 404 Not Found\");\n echo '404';\n };\n } else {\n if (is_string(self::$error_callback)) {\n self::get($_SERVER['REQUEST_URI'], self::$error_callback);\n self::$error_callback = null;\n self::dispatch();\n return ;\n }\n }\n call_user_func(self::$error_callback);\n }\n }", "public function route() {\n\n\t\t\tif (!isset($_POST[$this->slug . '_controller']) || !isset($_POST[$this->slug . '_method']))\n\t\t\t\treturn;\n\t\t\t$controller = $_POST[$this->slug . '_controller']; //controller name\n\t\t\t$action = $_POST[$this->slug . '_method'];\t\t\t\n\t\t\tif (key_exists($controller,$this->pages)) {\t\n\t\t\t\tif (method_exists($this->pages[$controller], $action) === false) {\n\t\t\t\t\tdie('Action doesn\\'t exists');\n\t\t\t\t}\t\t\t\n\t\t\t\t$this->pages[$controller]->$action();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdie('Controller doesn\\'t exists');\n\t\t\t}\n\t\t}", "public function addRoute($httpMethod, string $path, $handler): RouteInterface;", "public function setRoutes()\n {\n $routes = [];\n $controllerFQCNs = [];\n $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->appControllerDirectory));\n if (count($files)) {\n foreach ($files as $file) {\n if ('php' === strtolower(pathinfo($file, PATHINFO_EXTENSION))) {\n $controllerFQCNs[] =\n $this->appControllerNamespace .\n str_replace(\n [$this->appControllerDirectory, '/'],\n ['', '\\\\'],\n pathinfo($file, PATHINFO_DIRNAME)\n ) .\n '\\\\' .\n pathinfo($file, PATHINFO_FILENAME)\n ;\n }\n }\n }\n\n foreach ($controllerFQCNs as $FQCN) {\n// echo $FQCN . \"<br />\";\n try {\n $rc = new ReflectionClass($FQCN);\n if ($docComment = $rc->getDocComment()) {\n $lines = explode(\"\\n\", $docComment);\n $routeAnnotation = null;\n $requireLoginAnnotation = null;\n foreach ($lines as $line) {\n if (strstr($line, '* @Route')) {\n $routeAnnotation = $line;\n } elseif (strstr($line, '* @RequireLogin')) {\n $requireLoginAnnotation = $line;\n }\n }\n if ($routeAnnotation) {\n// echo 'hello';\n $path = trim(ltrim($routeAnnotation, '* @Route'));\n $path = '/' . trim($path, '/') . '/';\n $path = ($path === '//') ? '/' : $path;\n $route = new Route($FQCN, $path);\n foreach ($this->controllerActions as $methodName) {\n if ($rc->hasMethod($methodName)) {\n $action = new Action($methodName);\n $route->setAction($methodName, $action);\n $rm = new ReflectionMethod($FQCN, $methodName);\n if ($params = $rm->getParameters()) {\n foreach ($params as $param) {\n $action->addParam(new Param(\n $param->getName(),\n ($param->getClass()) ? $param->getClass()->name : '',\n !$param->isOptional()\n ));\n }\n }\n }\n }\n if ($requireLoginAnnotation) {\n $route->setRequireLogin(true);\n }\n $routes[$path] = $route;\n// print_r($route);\n// echo '<br /><br />';\n }\n }\n } catch (ReflectionException $e) {\n // @Todo log exception\n }\n }\n // order routes from longest to shortest\n $keys = array_map('strlen', array_keys($routes));\n array_multisort($keys, SORT_DESC, $routes);\n $this->config->setRoutes($routes);\n }", "private static function route()\n {\n $ctrl_ns = '\\\\' . self::$conf['app_namespace'] . '\\\\Ctrl';\n $ctrl_name = $ctrl_ns . '\\\\' . ucfirst(self::$ctrl) . 'Ctrl';\n $act_name = self::$act . 'Act';\n\n // check auth if enabled\n if (in_array('Auth', self::$mods_enabled) && isset($ctrl_name::$perm)) {\n if (!is_array($ctrl_name::$perm)) {\n $ctrl_name::$perm = array($ctrl_name::$perm);\n }\n\n if (\n !count(array_intersect($ctrl_name::$perm, Auth::getUserPerms()))\n ) {\n Auth::authError(\n $ctrl_name::$perm,\n Auth::getUserPerms(),\n self::$ctrl,\n self::$act,\n self::$params\n );\n }\n }\n \n // pass control to relevant action\n $ctrl_name::$act_name(self::$params);\n }", "public function addRoute($httpMethod, string $route, $handler = null) {}", "private function route()\n\t{\n\t\t$this->route_controller = (isset($this->route[0]) ? ucfirst( $this->route[0] ) : null);\n\t\t$this->route_action = (isset($this->route[1]) ? $this->route[1] : null);\n\n\t\t// Get the rest of the parameters from the route\n\t\tif( isset( $this->route[2] ) )\n\t\t{\n\t\t\t// Add all the parameters to the array\n\t\t\t$this->route_parameters = $this->route;\n\n\t\t\t// Unset the first 2 parameters as they are used for the controller and action\n\t\t\tarray_shift($this->route_parameters);\n\t\t\tarray_shift($this->route_parameters);\n\t\t}\n\t}", "public function mapRoute($args) {\n $app = $this;\n \n $numArgs = count($args);\n \n // Let's see what we're dealing with : \n switch ($numArgs) {\n // Route args incl route + callable func.\n case 2:\n $callable = array_pop($args);\n break;\n // Route args incl route + callable func + middlewares.\n case 3:\n $middlewares = array_pop($args);\n $callable = array_pop($args);\n break;\n // Huh ? that's not right !\n default:\n // Let Slim deal with this...\n return parent::mapRoute($args);\n }\n \n // Were middlewares provided in the args ?\n if (isset($middlewares) && is_array($middlewares)) {\n // If so, create a callable func for each middleware.\n foreach ($middlewares as $middleware) {\n // Is the middleware a callable func ? \n if (is_callable($middleware)) {\n // If so, simply add it.\n $args[] = $middleware;\n continue;\n }\n\n // Otherwise, it's most likely a string representing the middleware name. \n $args[] = function() use($app, $middleware) {\n // Init the middleware and execute.\n $m = new $middleware();\n $m->setApplication($app);\n $m->call();\n };\n }\n } \n \n // Is the callable arg a string representing the controller & action ? \n if (is_string($callable) && substr_count($callable, ':', 1) == 1) {\n // If so, create a callable func that will init the controller & execute the action.\n list($controllerName, $actionName) = explode(':', $callable);\n \n $callable = function () use ($app, $controllerName, $actionName) {\n // Try to fetch the controller instance from Slim's container.\n if ($app->container->has($controllerName)) {\n $controller = $app->container->get($controllerName);\n } else {\n // not in container, assume it can be directly instantiated\n $controller = new $controllerName($app);\n }\n\n return call_user_func_array(array($controller, $actionName), func_get_args());\n };\n }\n\n $args[] = $callable;\n\n return parent::mapRoute($args);\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapAdminRoutes();\n\n $this->mapBrokerRoutes();\n\n $this->mapImportAgencyRoutes();\n\n $this->mapExportAgencyRoutes();\n\n $this->mapSponsorRoutes();\n\n //\n }", "public static function route($url) {\n\t\t$url_array = array();\n \t\t$url_array = explode(\"/\",$url);\n\t\tif(file_exists(ROOT . DS .'static' . DS . $url_array[0] . '.php') and sizeof($url_array)==1 ) {\n\t\t \tinclude (ROOT . DS .'static' . DS . $url_array[0] . '.php');\n\t\t \texit();\n\t\t}\n\t\trequire_once(ROOT.DS.'config'.DS.'routes.php');\n\t\t$url=$_SERVER['REQUEST_METHOD'].'/'.$url;\n\t\tforeach ($routes as $route => $destination) {\n\t\t\tif (preg_match($route, $url)) {\n\t\t\t\t$controller=$destination['controller'];\n\t\t\t\t$action=$destination['action'];\n\t\t\t\t$query_string=[];\n\t\t\t\tforeach ($destination['vars'] as $varpos) {\n\t\t\t\t\t$vars=explode(\"/\", $url);\n\t\t\t\t\t$query_string[]=$vars[$varpos];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!isset($controller)) {\n\t\t\t$controller='404';\n\t\t}\n\t\t$controller_name = $controller;\n\t\t$controller = ucwords($controller);\n\t\tif (DEBUG) {\n\t\t\t$action=(isset($action))?$action:'';\n\t\t\terror_log($url.'=>'.$controller_name.'/'.$action); \n\t\t}\t\n\t\tif (class_exists($controller) and method_exists($controller, $action)) {\n\t\t\t$dispatch = new $controller($controller_name,$action);\n\t\t \tcall_user_func_array([$dispatch,$action],$query_string);\n\t\t}else{\n\t\t \theader('Location: '.PATH.'/404');\t\n\t\t}\t \n\t}", "public function map() {\n\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->ModuleRoutes();\n\n $this->pluginRoutes();\n }", "function map_resources(){\n static $routes = array();\n $arg_num = func_num_args();\n if(0 == $arg_num)\n {\n return $routes;\n }\n elseif(1 == $arg_num)\n {\n // map_resources($controller_name) --> return all routes\n $controller = func_get_arg(0);\n\n // Generate RESTful url match patterns\n $routes['GET'][\"{$controller}\"] = \"{$controller}/index\";\n $routes['GET'][\"{$controller}/new\"] = \"{$controller}/new_form\";\n $routes['GET'][\"{$controller}/(:id)\"] = \"{$controller}/show/$1\";\n $routes['GET'][\"{$controller}/(:id)/edit\"] = \"{$controller}/edit/$1\";\n $routes['POST'][\"{$controller}\"] = \"{$controller}/create\";\n $routes['PUT' ][\"{$controller}/(:id)\"] = \"{$controller}/update/$1\";\n $routes['DELETE'][\"{$controller}/(:id)\"] = \"{$controller}/delete/$1\";\n }\n elseif(2 == $arg_num)\n {\n // Custom url routing\n $args = func_get_args();\n $pattern = $args[0];\n $replace = $args[1];\n $routes['GET'][$pattern] = $replace;\n $routes['POST'][$pattern] = $replace;\n $routes['PUT'][$pattern] = $replace;\n $routes['POST'][$pattern] = $replace;\n }\n elseif(3 == $arg_num)\n {\n // Custom url routing\n $args = func_get_args();\n $method = $args[0];\n $pattern = $args[1];\n $replace = $args[2];\n $routes[$method][$pattern] = $replace;\n }\n}", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapBackEndAdminRoutes();\n $this->mapBackEndCategoryRoutes();\n $this->mapBackEndProductRoutes();\n $this->mapFrontEndProductRoutes();\n $this->mapWebRoutes();\n\n\n //\n }", "public static function route()\n\t{\n\t\t$prefix = '/' . Config::getBaseFolder();\n\n\t\t$requesturi = $_SERVER['REQUEST_URI'];\n\n\t\tif (substr($requesturi, 0, strlen($prefix)) == $prefix) {\n\t\t\t$requesturi = substr($requesturi, strlen($prefix));\n\t\t}\n\n\t\t$requesturi = trim($requesturi, '/');\n\n\t\t$requestSegments = explode('?', $requesturi);\n\n\t\t$segments = explode('/', $requestSegments[0]);\n\n\t\tif ($segments[0] !== 'index.php') {\n\t\t\tLib::load('router');\n\n\t\t\tforeach (Router::getRouters() as $router) {\n\t\t\t\tif (is_string($router->allowedRoute) && $segments[0] !== $router->allowedRoute) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (is_array($router->allowedRoute) && !in_array($segments[0], $router->allowedRoute)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$router->decode($segments);\n\t\t\t}\n\t\t}\n\n\t\t// Check for API call\n\t\tif (Req::hasget('api')) {\n\t\t\t$apiName = preg_replace('/[-\\.]/u', '', Req::get('api'));\n\t\t\t$action = preg_replace('/[-\\.]/u', '', Req::get('action'));\n\n\t\t\t$api = Lib::api($apiName);\n\n\t\t\tif (!is_callable(array($api, $action))) {\n\t\t\t\treturn Lib::api()->fail();\n\t\t\t}\n\n\t\t\treturn $api->$action();\n\t\t}\n\n\t\t// Check for controller\n\t\tif (Req::hasget('controller')) {\n\t\t\t$controllerName = preg_replace('/[-\\.]/u', '', Req::get('controller'));\n\t\t\t$action = preg_replace('/[-\\.]/u', '', Req::get('action'));\n\n\t\t\t$controller = Lib::controller($controllerName);\n\n\t\t\tif (!is_callable(array($controller, $action))) {\n\t\t\t\treturn $controller->execute();\n\t\t\t}\n\n\t\t\treturn $controller->$action();\n\t\t}\n\n\t\t$viewname = preg_replace('/[-\\.]/u', '', Req::get('view'));\n\n\t\tif (empty($viewname)) {\n\t\t\t$viewname = 'index';\n\t\t}\n\n\t\treturn Lib::view($viewname)->display();\n\t}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }" ]
[ "0.6970814", "0.689423", "0.6706154", "0.65941083", "0.6590373", "0.6525534", "0.6478416", "0.64370024", "0.6422592", "0.6389386", "0.6376908", "0.6369121", "0.63583916", "0.63559175", "0.63208014", "0.6317337", "0.6315724", "0.6306565", "0.6299144", "0.6282082", "0.6266962", "0.6266654", "0.6266654", "0.6266654", "0.6266654", "0.6266654", "0.6266654", "0.6266654", "0.6266654", "0.6266654" ]
0.7097234
0
Store a newly created Keyword in storage.
public function store(Request $request) { $keywords = $request->input('keywords'); $topicId = $request->input('topicId'); if (!empty($keywords)){ foreach ($keywords as $word){ $keyword = new Keyword; $keyword->word = $word; $keyword->save(); $keyword->topics()->attach($topicId); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n ]);\n\n $hashtag = new HashTag();\n $hashtag->hashtag = $request->get('name');\n $hashtag->rating = $request->get('rating') ?? 8;\n $hashtag->platforms_id = $this->platformsId;\n $hashtag->save();\n\n return redirect()->back()->with('message', 'Keyword created successfully!');\n }", "private function _saveKeyword($product_id, $keyword) {\n\t\t$similarity_query = $this->db->query(\"SELECT * FROM \". DB_PREFIX . \"url_alias WHERE keyword LIKE '\" . $this->db->escape($keyword) . \"%'\");\n\t\t$number = $similarity_query->num_rows;\n\n\t\tif ($number > 0) {\n\t\t\t$keyword = $keyword . \"-\" . $number;\n\t\t}\n\t\t$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"url_alias SET query = 'product_id=\" . (int)$product_id . \"', keyword = '\" . $this->db->escape($keyword) . \"'\");\n\t}", "public function store()\n {\n $this->authorize('store', Lyric::class);\n\n $this->validate($this->request, [\n 'text' => 'required|string',\n 'track_id' => 'required|integer|exists:tracks,id',\n ]);\n\n return $this->lyric->create([\n 'track_id' => $this->request->get('track_id'),\n 'text' => $this->request->get('text')\n ]);\n }", "public function setKeyword($v)\n\t{\n\t\t//call the regular setKeyword to save the keyword\n\t\tparent::setKeyword($v);\n\n\t\t//save the keyword as normalzied\n\t\t$this->setNormalizedKeyword(myKeyword::normalize($v));\n }", "public function store(Request $request)\n {\n $user = $request->user();\n\n $inputs = $request->only([\n 'keyword',\n 'category',\n 'defined_keyword',\n 'option_link',\n ]);\n\n $dictionary = new Dictionary();\n $dictionary->user_id = $user->id;\n $dictionary->keyword = $inputs['keyword'];\n $dictionary->category = $inputs['category'];\n $dictionary->defined_keyword = $inputs['defined_keyword'];\n $dictionary->option_link = $inputs['option_link'];\n $dictionary->save();\n\n return redirect( route('detail', $dictionary) );\n }", "public function store(TermRequest $request)\n {\n // create new term\n $terms = Term::create([\n 'name' => $request->input('name'),\n 'slug' => $request->input('slug'),\n 'template' => $request->input('template')\n ]);\n\n // create taxonomy for term\n $terms->taxonomy()->create([\n 'parent_id' => $request->input('parent'),\n 'taxonomy' => $request->input('taxonomy'),\n 'description' => $request->input('description'),\n 'language_id' => language()\n ]);\n\n $notification = array(\n 'message' => 'Category is successfully created!',\n 'type' => 'success'\n );\n\n return redirect()->back()->with($notification);\n }", "public function store()\n {\n $this->storage->set($this);\n\n }", "public function store(Request $request)\n {\n // Form validation\n $request->validate([\n 'language_id' => 'required|unique:language_keywords',\n ]);\n\n // Get All Request\n $input = $request->all();\n\n // Record to database\n LanguageKeyword::firstOrCreate([\n 'language_id' => $input['language_id'],\n 'home' => $input['home'],\n 'about' => $input['about'],\n 'portfolio' => $input['portfolio'],\n 'contact' => $input['contact'],\n 'hire_me' => $input['hire_me'],\n 'testimonial' => $input['testimonial'],\n 'by_admin' => $input['by_admin'],\n 'read_more' => $input['read_more'],\n 'search_results' => $input['search_results'],\n 'nothing_found' => $input['nothing_found'],\n 'search_here' => $input['search_here'],\n 'search' => $input['search'],\n 'blog_details' => $input['blog_details'],\n 'reply' => $input['reply'],\n 'leave_a_comment' => $input['leave_a_comment'],\n 'your_name' => $input['your_name'],\n 'your_job' => $input['your_job'],\n 'select_rating' => $input['select_rating'],\n 'your_feedback' => $input['your_feedback'],\n 'your_comment' => $input['your_comment'],\n 'your_email' => $input['your_email'],\n 'your_message' => $input['your_message'],\n 'subject_here' => $input['subject_here'],\n 'send_message' => $input['send_message'],\n 'all' => $input['all'],\n 'recent_posts' => $input['recent_posts'],\n 'do_you_need_a_project' => $input['do_you_need_a_project'],\n 'view_all' => $input['view_all'],\n 'portfolio_details' => $input['portfolio_details'],\n 'project_detail' => $input['project_detail'],\n 'we_are_coming_soon' => $input['we_are_coming_soon'],\n 'project_share' => $input['project_share'],\n 'blog_share' => $input['blog_share'],\n 'send_review' => $input['send_review'],\n 'your_review_is_pending_approval' => $input['your_review_is_pending_approval'],\n 'please_try_again' => $input['please_try_again'],\n 'your_message_has_been_delivered' => $input['your_message_has_been_delivered'],\n 'your_comment_is_pending_approval' => $input['your_comment_is_pending_approval'],\n 'select' => $input['select'],\n 'services' => $input['services'],\n 'blog' => $input['blog'],\n 'client' => $input['client'],\n 'project_name' => $input['project_name'],\n 'category' => $input['category'],\n 'value' => $input['value'],\n 'author' => $input['author'],\n 'start_date' => $input['start_date'],\n 'end_date' => $input['end_date'],\n 'pages' => $input['pages'],\n 'page_share' => $input['page_share'],\n 'gallery' => $input['gallery'],\n 'comments' => $input['comments'],\n 'download_cv' => $input['download_cv'],\n 'image' => $input['image'],\n 'size' => $input['size'],\n 'add' => $input['add'],\n 'blogs' => $input['blogs'],\n 'new' => $input['new'],\n 'feedback' => $input['feedback'],\n 'no_records_created_yet' => $input['no_records_created_yet'],\n\n ]);\n\n return redirect()->route('language-section.create')\n ->with('success','Created successfully.');\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function addKeyword(string $keyword) : void\n {\n $this->Keywords[] = $keyword;\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'english' => 'required',\n 'cantonese' => 'required',\n 'jyutping' => 'required'\n ]);\n\n // Create WordResource\n $word = new Word;\n $word->english = $request->input('english');\n $word->cantonese = $request->input('cantonese');\n $word->jyutping = $request->input('jyutping');\n $word->soundAddress = 'no-soundaddress';\n $word->user_id = auth()->user()->id;\n $word->save();\n\n return redirect('/vue-dictionary')->with('success', 'WordResource Created');\n }", "public function setKeyword($keyword);", "public function store()\n\t{\n\n\t\t$tag = Request::all(); \n\t\t\n\t\t$entryValidator = Validator::make(Input::all(), Tag::$store_rules); \n\n\t\tif ($entryValidator->fails())\n\t\t{\n\t\t return Redirect::back()->with('error_message', Lang::get('core.msg_error_validating_entry'))->withErrors($entryValidator)->withInput();\n\t\t} \n\n\t\tTag::create($tag); \n\t\t\n\t\treturn Redirect::route('admin.tags.index')->with('success_message', Lang::get('core.msg_success_entry_added'));\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.6513011", "0.6078587", "0.60688186", "0.60010046", "0.5853314", "0.5800158", "0.57931376", "0.56976765", "0.565897", "0.5655954", "0.5638725", "0.5632602", "0.5612508", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387", "0.55973387" ]
0.6651088
0
Remove the specified Keyword from storage.
public function destroy($id) { $keyword = Keyword::find($id); $keyword->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Public Function removeKeyword($ID)\n\t{\n\t\t$sql = \"DELETE FROM bevomedia_ppc_keywords WHERE id = $ID\";\n\t\t$this->_db->exec($sql);\n\t}", "public function removeKeyword($recipe, $keyword)\n {\n //check to see if the ADMIN asked to remove the keyword and if it was remove that keyword for all users from the recipe\n if ($this->getIsAdministrator($this->getAuthLvlId()))\n {\n $c = new Criteria();\n $c->add(RecipeKeywordPeer::RECIPE_ID, $recipe->getRecipeId());\n $c->add(RecipeKeywordPeer::NORMALIZED_KEYWORD, $keyword);\n RecipeKeywordPeer::doDelete($c);\n } \n else\n {\n \n //retrive the keyword do delete by user id recipe id and normalized keyword\n \t$c = new Criteria();\n $c->add(RecipeKeywordPeer::RECIPE_ID, $recipe->getRecipeId());\n $c->add(RecipeKeywordPeer::USER_ID, $this->getUserId());\n $c->add(RecipeKeywordPeer::NORMALIZED_KEYWORD, $keyword);\n RecipeKeywordPeer::doDelete($c);\n }\n }", "public function deleteTag($tag);", "public function del(string $key);", "public static function remove($key){\n unset(self::$storage[$key]);\n }", "public function destroy($id)\n {\n if (is_numeric($id)) {\n $hash = HashTag::findOrFail($id);\n $hash->delete();\n } else {\n HashTag::where('hashtag', $id)->delete();\n }\n\n\n return redirect()->back()->with('message', 'Keyword has been deleted successfuly!');\n }", "public function del(string $key): StoreInterface;", "public function remove_word($word)\n {\n $this->load_dict();\n\n if (($key = array_search($word, $this->dict)) !== false) {\n unset($this->dict[$key]);\n $this->update_dict();\n }\n }", "public function delete(string $key);", "public function remove(string $key);", "public function remove(string $key);", "public function del($key);", "public function deleteKeyword($id)\n {\n $appStage = app_config('AppStage');\n if ($appStage == 'Demo') {\n return redirect('keywords/all')->with([\n 'message' => language_data('This Option is Disable In Demo Mode'),\n 'message_important' => true\n ]);\n }\n $keyword = Keywords::find($id);\n\n if ($keyword) {\n $keyword->delete();\n return redirect('keywords/all')->with([\n 'message' => 'Keyword deleted successfully'\n ]);\n }\n\n return redirect('keywords/all')->with([\n 'message' => 'Keyword information not found',\n 'message_important' => true\n ]);\n }", "public function remove(string $key) {\n $this->storage->remove($key);\n }", "public function deleteByTag($tag)\n {\n if($tagMetaData = $this->getTagMetaData($tag)) {\n foreach($tagMetaData['keys'] as $key) {\n $this->delete($key);\n }\n }\n }", "public function delete_tag($tag)\n\t{\n\t\t// Not implemented yet\n\t}", "function remove($key) {\n\t\t\t$this->db->querySQL(\"DELETE $this->table WHERE keyLang = '$key'\");\t\n\t\t}", "public function del($key){ }", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);" ]
[ "0.64955294", "0.61313343", "0.59803367", "0.58327377", "0.57909334", "0.5783401", "0.575096", "0.57392836", "0.5722684", "0.57004803", "0.57004803", "0.56556493", "0.56486386", "0.560256", "0.5568788", "0.5547937", "0.55474764", "0.5531239", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284", "0.55265284" ]
0.6341147
1
endregion region Check dependencies and notify Initiate the plugin when dependencies are met
public function check_dependencies() { if ( ! class_exists( 'PrisnaWPTranslateCommon' ) ) { add_action( 'admin_notices', [ $this, 'prisna_required_error' ] ); } else if ( ! class_exists( 'Algolia_Plugin' ) ) { add_action( 'admin_notices', [ $this, 'algolia_required_error' ] ); } else { $this->init(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkDependencies(){\n\n }", "private function checkDependencies(){\n\n }", "static function check_deps() {\n\t\t\tif ( !in_array( 'the-events-calendar/the-events-calendar.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {\n\t\t\t\t\n\t\t\t\t// Deactivate the plugin\n\t\t\t\tdeactivate_plugins(__FILE__);\n\t\t\t\t\n\t\t\t\t// Throw an error in the wordpress admin console\n\t\t\t\t$error_message = __('This plugin requires <a href=\"https://wordpress.org/plugins/the-events-calendar/\">The Events Calendar</a> plugin to be active!', 'the-events-calendar');\n\t\t\t\tdie($error_message);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function dependencies()\n\t\t{\n\t\t\trequire_once( NYPIZZA_MODULES . \"/{$this->folder}/install.php\" );\n\t\t\trequire_once( NYPIZZA_MODULES . \"/{$this->folder}/admin/pin.php\" );\n\t\t}", "protected function load_dependencies() {}", "private function check_dependencies() {\n\n\t\t$this->EE->db->where('module_name','Ip_to_nation');\n\t\t$query = $this->EE->db->get('modules');\n\n\t\tif(!$query->num_rows()) {\n\t\t\t$this->EE->output->fatal_error('Shortee requires the IP to Nation module to be installed');\n\t\t}\n\t}", "function checking_dependencies() {\n\n /**\n * @todo If mf or wpml are not installed kill this process\n */\n if(! method_exists('PanelFields','PanelFields') || ! defined('ICL_SITEPRESS_VERSION')) {\n add_action('admin_notices','mf_wpml_notices');\n }\n}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-onyx-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-onyx-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin.php';\n\t\t/**\n\t\t * The class responsible for defining all actions related to setting pages.\n\t\t */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-setting-pages.php';\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-onyx-public.php';\n\n\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-sync.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-terms-sync.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-product-sync.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-wpml-product-sync.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-onyx-admin-api-orders-sync.php';\n\n\n\t\t$this->loader = new Onyx_Loader();\n\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-sepa-traderiq-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-sepa-traderiq-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-sepa-traderiq-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-sepa-traderiq-public.php';\n\n\t\t$this->loader = new Sepa_Traderiq_Loader();\n\n\t}", "public static function ensure_requirements_are_met() {\n if (!self::are_requirements_met()) {\n deactivate_plugins(__FILE__);\n wp_die( \"<p>Some of the plugin dependencies aren't met and the plugin can't be enabled. This plugin requires the followind dependencies:</p><ul><li>Minimum WP version: \".self::$min_wp_version.\"</li><li>Minimum PHP version: \".self::$min_php_version.\"</li><li>Classes / plugins: \".implode (\", \", self::$class_dependencies).\"</li><li>PHP extensions: \".implode (\", \", self::$required_php_extensions).\"</li></ul>\" );\n }\n }", "private function load_dependencies(): void\n {\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-product-documentation-plugin-loader.php';\n require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-product-documentation-plugin-admin.php';\n\n $this->loader = new Product_Documentation_Plugin_Loader();\n }", "private function load_dependencies()\n {\n\n /**\n * The class responsible for orchestrating the actions and filters of the\n * core plugin.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-flo-launch-loader.php';\n\n /**\n * The class responsible for defining internationalization functionality\n * of the plugin.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-flo-launch-i18n.php';\n\n /**\n * The class responsible for defining all actions that occur in the admin area.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-flo-launch-admin.php';\n\n /**\n * The class responsible for defining all actions that occur in the public-facing\n * side of the site.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'public/class-flo-launch-public.php';\n\n $this->loader = new Flo_Launch_Loader();\n\n }", "private function load_dependencies() {\n\t\t\trequire_once(PAS_GLOBAL_DIR . 'inc/class-pas-attachments.php');\n\n\t\t\tif(is_admin())\n\t\t\t\trequire_once(PAS_GLOBAL_DIR . 'inc/admin/class-pas-admin.php');\n\n\t\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-akamai-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-akamai-admin.php';\n\n\t\t$this->loader = new Akamai_Loader();\n\n\t}", "public function dependencies()\n\t\t{\n\t\t\t\n\t\t\trequire_once( NYPIZZA_MODULES . \"/{$this->folder}/install.php\" );\t\t\t\t\t\t\n\t\t\trequire_once( NYPIZZA_MODULES . \"/{$this->folder}/admin/shipping.php\" );\t\t\t\t\t\t\n\t\t\t\n\t\t}", "private function load_dependencies() {\n\n\t\trequire_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-h4mpy-npm-loader.php';\n\t\trequire_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-h4mpy-npm-i18n.php';\n\t\trequire_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-h4mpy-npm-admin.php';\n\t\trequire_once plugin_dir_path(dirname(__FILE__)) . 'public/class-h4mpy-npm-public.php';\n\n\t\t$this->loader = new H4mpy_Npm_Loader();\n\n\t}", "private function load_dependencies() {\n\n /**\n * The class responsible for orchestrating the actions and filters of the core plugin.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-junglehunter-loader.php';\n\n /**\n * The class responsible for defining all actions that occur in the admin area.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-junglehunter-admin.php';\n\n /**\n * The class responsible for defining all actions that occur in the rest endpoint.\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'rest/class-junglehunter-rest.php';\n\n /**\n * The class responsible for defining all actions that occur in the database\n */\n require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-junglehunter-database.php';\n\n $this->loader = new Junglehunter_Loader();\n }", "private static function load_dependencies() {\n $plugin_dir = plugin_dir_path(dirname(__FILE__));\n\n /**\n * The class responsible for defining internationalization functionality\n * of the plugin.\n */\n require_once $plugin_dir . 'includes/class-ptb-extra-i18n.php';\n\n // The classes of metaboxes\n require_once $plugin_dir . 'includes/class-ptb-cmb-map.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-video.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-audio.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-slider.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-gallery.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-file.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-event-date.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-rating.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-progress-bar.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-icon.php';\n require_once $plugin_dir . 'includes/class-ptb-cmb-telephone.php';\n do_action('ptb_extra_loaded');\n }", "private function load_dependencies() {\n // Admin Panel\n if (is_admin()) {\n require_once ZGPBLD_DIR . '/classes/zgpbld-base-module.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-helper.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-bootstrap.php';\n require_once ZGPBLD_DIR . '/classes/zigapage-notice.php';\n }\n\n // Front-End Site\n if (!is_admin()) {\n require_once ZGPBLD_DIR . '/classes/zgpbld-base-module.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-helper.php';\n require_once ZGPBLD_DIR . '/classes/zgpbld-bootstrap.php';\n }\n }", "private function pluginInit()\n\t{\n\t}", "protected static function init_plugin() {\n\t\t// Plugin updates.\n\t\tif (\\BLOBCOMMON_MUST_USE) {\n\t\t\t// Must-Use doesn't have normal version management, but we\n\t\t\t// can add filters for Musty in case someone's using that.\n\t\t\t\\add_filter(\n\t\t\t\t'musty_download_version_blob-common/index.php',\n\t\t\t\tarray(static::class, 'musty_download_version')\n\t\t\t);\n\t\t\t\\add_filter(\n\t\t\t\t'musty_download_uri_blob-common/index.php',\n\t\t\t\tarray(static::class, 'musty_download_uri')\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t// Normal plugins are... more normal.\n\t\t\t\\add_filter(\n\t\t\t\t'transient_update_plugins',\n\t\t\t\tarray(static::class, 'update_plugins')\n\t\t\t);\n\t\t\t\\add_filter(\n\t\t\t\t'site_transient_update_plugins',\n\t\t\t\tarray(static::class, 'update_plugins')\n\t\t\t);\n\t\t}\n\t}", "protected function setup_plugins()\n\t{\n $this->plugin('Lock\\\\File');\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for enqueuing all the assets.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-assets.php';\n\n\t\t/**\n\t\t * The class responsible for implementing the UI to change the primary category\n\t\t * in the categories metabox.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-primary-category-admin.php';\n\n\t\t$this->loader = new WP_Primary_Category_Loader();\n\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-mp-books-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-mp-books-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-mp-books-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-mp-books-public.php';\n\n\t\t$this->loader = new MP_Books_Loader();\n\n\t}", "abstract protected function dependencyCheck(DependencyResultEvent $event);", "private function load_dependencies() {\n require_once PRESSCOUNT_INC . 'functions/helper.php';\n require_once PRESSCOUNT_INC . 'classes/class-cache.php';\n require_once PRESSCOUNT_INC . 'classes/class-requests.php';\n require_once PRESSCOUNT_INC . 'classes/class-ajax.php';\n require_once PRESSCOUNT_INC . 'classes/class-shortcodes.php';\n\n if( is_admin() ) {\n require_once PRESSCOUNT_INC . 'admin/classes/class-init.php';\n }\n }", "private function load_dependencies() {\n\n /**\n * The class responsible for orchestrating actions that occur in the public-facing\n * side of the site.\n */\n require_once LAST_WORD_PLUGIN_DIR . 'PublicController.php';\n\n /**\n * The abstract superclass responsible for my last word slur.\n */\n require_once self::WPLW_MY_LAST_WORD_DIR . '/MyLastWord.php';\n\n /**\n * The concrete subclasses responsible for my last word post and shortcode views\n */\n require_once self::WPLW_MY_LAST_WORD_DIR . '/MyLastWordPostContent.php';\n require_once self::WPLW_MY_LAST_WORD_DIR . '/MyLastWordShortcode.php';\n\n\n }", "private function load_dependencies() {\r\n\r\n\t\t/**\r\n\t\t * The class responsible for orchestrating the actions and filters of the\r\n\t\t * core plugin.\r\n\t\t */\r\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-loader.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for defining internationalization functionality\r\n\t\t * of the plugin.\r\n\t\t */\r\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-i18n.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for defining all actions that occur in the admin area.\r\n\t\t */\r\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-blossomthemes-email-newsletter-admin.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for defining all actions that occur in the public-facing\r\n\t\t * side of the site.\r\n\t\t */\r\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-blossomthemes-email-newsletter-public.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for defining all actions that occur in the public-facing\r\n\t\t * side of the site.\r\n\t\t */\r\n\t\trequire plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-settings.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for general functions.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-functions.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for meta for subscription form.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-form-meta.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for mailerlite libraries.\r\n\t\t * \r\n\t\t */\r\n\t\tif (!class_exists('ML_Lists')) {\r\n\t\t\trequire_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/mailerlite_rest/ML_Lists.php';\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * The class responsible for mailchimp libraries.\r\n\t\t * \r\n\t\t */\r\n\t\tif(!class_exists('MC_Lists')) {\t\r\n\t\t\trequire_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/mailchimp/MC_Lists.php';\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * The class responsible for convertkit libraries.\r\n\t\t * \r\n\t\t */\r\n\t\tif (!class_exists('Convertkit')) {\r\n\t\t\trequire_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/convertkit/convertkit.php';\r\n\t\t}\r\n\t\t\t\r\n\t\t/**\r\n\t\t * The class responsible for doing mailerlite libraries.\r\n\t\t * \r\n\t\t */\r\n\t\tif (!class_exists('ML_Webforms')) {\r\n\t\t\trequire_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/mailerlite_rest/ML_Webforms.php';\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * The class responsible for doing mailerlite actions.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-mailerlite.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for doing mailchimp actions.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-mailchimp.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for doing convertkit actions.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-convertkit.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for generating shortcode.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-shortcodes.php';\r\n\r\n\t\t/**\r\n\t\t * The class responsible for generating widget.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/widgets/widget-blossomthemes-newsletter.php';\r\n\r\n\t\t/**\r\n\t\t * Privacy content and sections.\r\n\t\t * \r\n\t\t */\r\n\t\trequire BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/privacy-sections.php';\r\n\r\n\r\n\t\t$this->loader = new Blossomthemes_Email_Newsletter_Loader();\r\n\r\n\t}", "private function load_dependencies() {\n\t\t$this->loader = new WP_Carousel_Pro_Loader();\n\n\t}", "private function load_dependencies() {\n\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-single-post-meta-manager-admin.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-single-post-meta-manager-public.php';\n\n\t\trequire_once plugin_dir_path( __FILE__ ) . 'class-single-post-meta-manager-loader.php';\n\t\t$this->loader = new Single_Post_Meta_Manager_Loader();\n\n\t}" ]
[ "0.76312864", "0.76312864", "0.7307285", "0.70145917", "0.6921355", "0.6906919", "0.6859751", "0.67398304", "0.6712443", "0.6700026", "0.66861427", "0.6671501", "0.66528046", "0.6648145", "0.6603828", "0.65127885", "0.6509408", "0.65008295", "0.64206505", "0.6419754", "0.6411268", "0.64080876", "0.6402378", "0.6350895", "0.63258916", "0.6302456", "0.6284653", "0.62263286", "0.61993706", "0.61973464" ]
0.78630316
0
Adds language reindex buttons
public function reindex_buttons() { $languages = PrisnaWPTranslateConfig::getSettingValue( 'languages' ); foreach ( $languages as $language ) { ?> <button class="algolia-reindex-button button button-primary" data-index="posts_product_<?php echo $language ?>"> <?php printf( __( 'Re-index %s products', 'algolia-woocommerce' ), strtoupper( $language ) ); ?></button> <?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addTranslationsToIndexable() {\n\t\t$languages = Module::instance()->localization->getAcceptLanguages();\n\t\t$original_language = Module::instance()->localization->getFromLanguage();\n\t\tunset( $languages[ array_search( $original_language, $languages ) ] );\n\t\tforeach ( $languages as $language ) {\n\t\t\t$indexable_post = new Post( $language );\n\t\t\tIndexables::factory()->register( $indexable_post );\n\t\t}\n\t}", "function sexy_admin_index(&$lang)\n\t{\n\t\tglobal $phpbb_root_path, $phpEx, $board_config;\n\t\t$this->init();\n\t}", "function template_modify_language_list()\n{\n\tglobal $context, $txt;\n\n\techo '\n\t\t<we:cat>\n\t\t\t', sprintf($txt['edit_languages_specific'], $context['languages'][$context['lang_id']]['name']), '\n\t\t</we:cat>\n\t\t<div class=\"two-columns\">\n\t\t\t<we:block class=\"windowbg2\" header=\"', $txt['language_edit_default'], '\">';\n\n\tforeach ($context['language_files']['default'] as $block)\n\t{\n\t\techo '\n\t\t\t\t<h6>', $block['name'], '</h6>\n\t\t\t\t<ul>';\n\t\tforeach ($block['files'] as $id => $name)\n\t\t\techo '\n\t\t\t\t\t<li>', template_lang_file_link('<URL>?action=admin;area=languages;sa=editlang;lid=' . $context['lang_id'] . ';tfid=' . urlencode($id), $name), '</li>';\n\t\techo '\n\t\t\t\t</ul>';\n\t}\n\n\techo '\n\t\t\t</we:block>\n\t\t</div>\n\t\t<div class=\"two-columns\">\n\t\t\t<we:block class=\"windowbg\" header=\"', $txt['language_edit_search'], '\">\n\t\t\t\t<form action=\"<URL>?action=admin;area=languages;sa=editlang;lid=', $context['lang_id'], '\" method=\"post\" accept-charset=\"UTF-8\">\n\t\t\t\t\t<input type=\"search\" name=\"search\" value=\"\" class=\"search\">';\n\n\tif (!empty($context['language_files']['plugins']))\n\t\techo '\n\t\t\t\t\t<label style=\"height: 25px; vertical-align: middle\"><input type=\"checkbox\" name=\"include_plugins\" value=\"1\" checked> ', $txt['language_edit_search_plugins'], '</input></label>';\n\n\techo '\n\t\t\t\t\t<div style=\"margin: 6px\"></div>\n\t\t\t\t\t<select name=\"search_type\">';\n\n\tforeach (array('both', 'keys', 'values') as $item)\n\t\techo '\n\t\t\t\t\t\t<option value=\"', $item, '\">', $txt['language_edit_search_' . $item], '</option>';\n\techo '\n\t\t\t\t\t</select>\n\t\t\t\t\t<input type=\"submit\" value=\"', $txt['search'], '\">\n\t\t\t\t</form>\n\t\t\t</we:block>\n\t\t\t<we:block class=\"windowbg\" header=\"', $txt['language_edit_other'], '\">';\n\n\tif (!empty($context['other_files']))\n\t{\n\t\techo '\n\t\t\t\t<h6>', $txt['language_edit_elsewhere'], '</h6>\n\t\t\t\t<ul>';\n\n\t\tforeach ($context['other_files'] as $url => $desc)\n\t\t\techo '\n\t\t\t\t\t<li><a href=\"', $url, '\">', $desc, '</a></li>';\n\n\t\techo '\n\t\t\t\t</ul>';\n\t}\n\n\tif (empty($context['language_files']['plugins']))\n\t{\n\t\techo '\n\t\t\t\t<h6>', $txt['language_edit_no_plugins'], '</h6>\n\t\t\t\t<p>', $txt['language_edit_no_plugins_desc'], '</p>';\n\t}\n\telse\n\t{\n\t\tforeach ($context['language_files']['plugins'] as $iid => $block)\n\t\t{\n\t\t\techo '\n\t\t\t\t<h6>', sprintf($txt['language_edit_plugins_title'], $block['name']), '</h6>\n\t\t\t\t<ul>';\n\n\t\t\tforeach ($block['files'] as $id => $name)\n\t\t\t\techo '\n\t\t\t\t\t<li>', template_lang_file_link('<URL>?action=admin;area=languages;sa=editlang;lid=' . $context['lang_id'] . ';tfid=' . urlencode($iid . '|' . $id), $name), '</li>';\n\n\t\t\techo '\n\t\t\t\t</ul>';\n\t\t}\n\t}\n\n\techo '\n\t\t\t</we:block>\n\t\t</div>\n\t\t<br class=\"clear\">';\n}", "public function index(){\n $filters = $this->getFilters();\n\n $this->addKeysToJavaScript(\"language.confirm-delete-lang\", \"language.confirm-delete-key\");\n\n $this->addJavaScript(Plugin::current()->getJsUrl('languages.js'));\n\n return LeftSidebarTab::make(array(\n 'icon' => 'flag',\n 'title' => Lang::get('language.lang-page-name'),\n 'page' => array(\n 'content' => $this->editKeys()\n ),\n 'sidebar' => array(\n 'widgets' => array(LanguageFilterWidget::getInstance($filters), NewLanguageKeyWidget::getInstance())\n ),\n 'tabId' => 'language-manage-page'\n ));\n }", "function GetProcessLanguageAddEditAction()\n {\n return \"ProcessLanguageAddEdit\";\n }", "public function executeReindex(sfWebRequest $request){\n //Zbozi::luceneReindex();\n }", "public function actionIndex() {\n// $lang_code = 'ar';\n// $lang='Arabic';\n// $session = Yii::$app->session;\n// if ($session->has('lang_code')) {\n//\n// $lang_code = $session->get('lang_code');\n// $lang= $session->get('lang');\n// $session->remove('lang');\n// $session->remove('lang_code');\n// }\n// \n // Passing the language variable to the layout at transmain.php\n// $this->view->params['lang'] =$lang;\n\n \n \n $model = new \\app\\models\\Dictionary();\n\n \n \n \n \n ///cacheing word of the day\n\n $word_of_the_day = $model->get_word_of_the_day();\n \n\n\n $word_text = $word_of_the_day->word;\n $model->setInput($word_text);\n\n $transword= $model->translations($model->input,'en','ar');\n \n if(!is_string($transword))\n $transword=''; \n /// cacheing text_pronoucetion\n $text_pronun= $model->ink_get_getTextPronunciations();\n $audio = $model->ink_get_audio();\n $image = $model->Fliker_search($word_text);\n $related_words = $model->ink_get_synonym();\n $model->meta_data_index();\n \n \n \n\n return $this->render('index', ['model' => $model,\n 'word_of_the_day' => $word_of_the_day,\n 'text_pronun' => $text_pronun,\n 'audio' => $audio,\n 'image' => $image,\n 'related_words' => $related_words,\n 'translation'=>$transword,\n \n\n ]);\n }", "function GetLanguageEditAction()\n {\n return \"LanguageEdit\";\n }", "public static function refreshLanguages()\n {\n TagDependency::invalidate(Yii::$app->commonCache, self::getCacheTag());\n }", "function GetLanguageAddAction()\n {\n return \"LanguageAdd\";\n }", "public function updateIndexes()\n\t{\n\t\tif(session_id()!==\"\")\n\t\t{\n\t\t\tsession_write_close();\n\t\t}\n\t\t$magdir=Magmi_Config::getInstance()->get(\"MAGENTO\",\"basedir\");\n\t\t$cl=$this->getParam(\"REINDEX:phpcli\").\" $magdir/shell/indexer.php\";\n\t\t$idxlstr=$this->getParam(\"REINDEX:indexes\",\"\");\n\t\t$idxlist=explode(\",\",$idxlstr);\n\t\tif(count($idxlist)==0)\n\t\t{\n\t\t\t$this->log(\"No indexes selected , skipping reindexing...\",\"warning\");\n\t\t\treturn true;\n\t\t}\n\t\tforeach($idxlist as $idx)\n\t\t{\n\t\t\t$tstart=microtime(true);\n\t\t\t$this->log(\"Reindexing $idx....\",\"info\");\n\t\t\t$out = shell_exec(\"$cl --reindex $idx\");\n\t\t\t$this->log($out,\"info\");\n\t\t\t$tend=microtime(true);\n\t\t\t$this->log(\"done in \".round($tend-$tstart,2). \" secs\",\"info\");\n\t\t\tif(Magmi_StateManager::getState()==\"canceled\")\n\t\t\t{\n\t\t\t\texit();\n\t\t\t}\t\t\t\n\t\t\tflush();\n\t\t}\n\t}", "public function index($lang) {\n\n\t\t// We save our path to use it with the new language redirection\n\t\t$args = func_get_args();\n\t\tunset($args[0]); // We unset the first arg ($lang) - this function is to replace in redirection\n\t\t$new_uri = implode(\"/\", $args);\n\n\t\tif ($this->language->change_language($lang)) redirect(base_url($new_uri)); // We redirect to the correct URI with the new language\n\t\telse redirect(base_url()); // There's a problem with the lang change\n\n\t}", "public function actionIndex() {\n $languageForm = Yii::createObject([\n 'class' => Language::className(),\n 'scenario' => 'create'\n ]);\n $filterModel = Yii::createObject([\n 'class' => Language::className(),\n 'scenario' => 'search'\n ]);\n Yii::$app->view->title = Yii::t('multilang', 'Languages');\n return $this->render('index', [\n 'filterModel' => $filterModel,\n 'dataProvider' => $filterModel->search(Yii::$app->request->get()),\n 'languageForm' => $languageForm\n ]);\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 }", "function languageOverview()\n {\n global $_ARRAYLANG, $objDatabase;\n // init vars\n $i=0;\n\n \\JS::activate('cx');\n $cxjs = \\ContrexxJavascript::getInstance();\n $cxjs->setVariable('copyTitle', $_ARRAYLANG['TXT_LANGUAGE_COPY_TITLE'], 'language/lang');\n $cxjs->setVariable('copyText', $_ARRAYLANG['TXT_LANGUAGE_COPY_TEXT'], 'language/lang');\n $cxjs->setVariable('copySuccess', $_ARRAYLANG['TXT_LANGUAGE_COPY_SUCCESS'], 'language/lang');\n $cxjs->setVariable('linkTitle', $_ARRAYLANG['TXT_LANGUAGE_LINK_TITLE'], 'language/lang');\n $cxjs->setVariable('linkText', $_ARRAYLANG['TXT_LANGUAGE_LINK_TEXT'], 'language/lang');\n $cxjs->setVariable('linkSuccess', $_ARRAYLANG['TXT_LANGUAGE_LINK_SUCCESS'], 'language/lang');\n $cxjs->setVariable('warningTitle', $_ARRAYLANG['TXT_LANGUAGE_WARNING_TITLE'], 'language/lang');\n $cxjs->setVariable('warningText', $_ARRAYLANG['TXT_LANGUAGE_WARNING_TEXT'], 'language/lang');\n $cxjs->setVariable('waitTitle', $_ARRAYLANG['TXT_LANGUAGE_WAIT_TITLE'], 'language/lang');\n $cxjs->setVariable('waitText', $_ARRAYLANG['TXT_LANGUAGE_WAIT_TEXT'], 'language/lang');\n $cxjs->setVariable('yesOption', $_ARRAYLANG['TXT_YES'], 'language/lang');\n $cxjs->setVariable('noOption', $_ARRAYLANG['TXT_NO'], 'language/lang');\n \n $this->template->loadTemplateFile('language_langlist.html');\n $this->pageTitle = $_ARRAYLANG['TXT_LANGUAGE_LIST'];\n \n if (!$this->isInFullMode()) {\n $this->hideVariables = true;\n $this->template->hideBlock('extendedTitles');\n $this->template->hideBlock('extendedHeaders');\n } else {\n $this->template->touchBlock('extendedTitles');\n }\n \n //begin language variables\n $this->template->setVariable(array(\n 'TXT_ADD_NEW_LANGUAGE' => $_ARRAYLANG['TXT_ADD_NEW_LANGUAGE'],\n 'TXT_NAME' => $_ARRAYLANG['TXT_NAME'],\n 'TXT_SHORT_NAME' => $_ARRAYLANG['TXT_SHORT_NAME'],\n 'TXT_CHARSET' => $_ARRAYLANG['TXT_CHARSET'],\n 'TXT_ADD' => $_ARRAYLANG['TXT_ADD'],\n 'TXT_LANGUAGE_LIST' => $_ARRAYLANG['TXT_LANGUAGE_LIST'],\n 'TXT_ID' => $_ARRAYLANG['TXT_ID'],\n 'TXT_SHORT_FORM' => $_ARRAYLANG['TXT_SHORT_FORM'],\n 'TXT_STANDARD_LANGUAGE' => $_ARRAYLANG['TXT_STANDARD_LANGUAGE'],\n 'TXT_ACTION' => $_ARRAYLANG['TXT_ACTION'],\n 'TXT_ACCEPT_CHANGES' => $_ARRAYLANG['TXT_ACCEPT_CHANGES'],\n 'TXT_REMARK' => $_ARRAYLANG['TXT_REMARK'],\n 'TXT_ADD_DELETE_LANGUAGE_REMARK' => $_ARRAYLANG['TXT_ADD_DELETE_LANGUAGE_REMARK'],\n 'TXT_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CONFIRM_DELETE_DATA'],\n 'TXT_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'],\n 'TXT_VALUE' => $_ARRAYLANG['TXT_VALUE'],\n 'TXT_MODULE' => $_ARRAYLANG['TXT_MODULE'],\n 'TXT_LANGUAGE' => $_ARRAYLANG['TXT_LANGUAGE'],\n 'TXT_STATUS' => $_ARRAYLANG['TXT_STATUS'],\n 'TXT_VIEW' => $_ARRAYLANG['TXT_VIEW'],\n 'TXT_CONTROLLED' => $_ARRAYLANG['TXT_CONTROLLED'],\n 'TXT_OPEN_ISSUE' => $_ARRAYLANG['TXT_OPEN_ISSUE'],\n 'TXT_SHORT_NAME' => $_ARRAYLANG['TXT_SHORT_NAME'],\n 'TXT_LANGUAGE_DEPENDANT_SYSTEM_VARIABLES'=> $_ARRAYLANG['TXT_LANGUAGE_DEPENDANT_SYSTEM_VARIABLES'],\n 'TXT_ADMINISTRATION_PAGES' => $_ARRAYLANG['TXT_ADMINISTRATION_PAGES'],\n 'TXT_WEB_PAGES' => $_ARRAYLANG['TXT_WEB_PAGES'],\n 'TXT_SECTION' => $_ARRAYLANG['TXT_SECTION'], \n 'TXT_CORE_FALLBACK' => $_ARRAYLANG['TXT_CORE_FALLBACK'],\n ));\n $this->template->setGlobalVariable(array(\n 'TXT_DEFAULT_LANGUAGE' => $_ARRAYLANG['TXT_STANDARD_LANGUAGE'],\n 'TXT_CORE_NONE' => $_ARRAYLANG['TXT_CORE_NONE'],\n 'CMD' => contrexx_input2xhtml($_GET['cmd']),\n 'TXT_LANGUAGE_ACTION_COPY' => $_ARRAYLANG['TXT_LANGUAGE_ACTION_COPY'],\n 'TXT_LANGUAGE_ACTION_LINK' => $_ARRAYLANG['TXT_LANGUAGE_ACTION_LINK'],\n )); \n //end language variables\n if ($this->hideVariables == true) {\n $this->template->setGlobalVariable(array('LANGUAGE_ADMIN_STYLE' => 'display: none'));\n } else {\n $this->template->setGlobalVariable(array('LANGUAGE_ADMIN_STYLE' => 'display: block'));\n }\n \n $arrLanguages = \\FWLanguage::getActiveFrontendLanguages();\n $objResult = $objDatabase->Execute(\"SELECT * FROM \".DBPREFIX.\"languages ORDER BY id\");\n if ($objResult !== false) {\n while (!$objResult->EOF) {\n $checked = \"\";\n if ($objResult->fields['is_default']==\"true\") {\n $checked = \"checked\";\n }\n $status =\"<input type='radio' name='langDefaultStatus' onchange='updateCurrent();' value='\".$objResult->fields['id'].\"' $checked />\";\n\n $checked = \"\";\n if ($objResult->fields['frontend']==1) {\n $checked = \"checked\";\n }\n $activeStatus =\"<input type='checkbox' name='langActiveStatus[\".$objResult->fields['id'].\"]' onchange='updateCurrent();' value='1' $checked />\";\n $checked = \"\";\n if ($objResult->fields['backend']==1) {\n $checked = \"checked\";\n }\n \n $selectedLang = ''; \n switch ($objResult->fields['fallback']) {\n case '':\n $this->template->setVariable('NONE_SELECTED', 'selected=\"selected\"');\n break;\n case '0':\n $this->template->setVariable('LANGUAGE_DEFAULT_SELECTED', 'selected=\"selected\"');\n break; \n default:\n $selectedLang = $objResult->fields['fallback']; \n }\n // set fallback language drop down \n foreach ($arrLanguages as $langId => $arrLanguage) { \n $selected = ($langId == $selectedLang) ? 'selected=\"selected\"' : '';\n $this->template->setVariable(array(\n 'LANGUAGE_LANG_ID' => $langId,\n 'LANGUAGE_LANG_OPTION' => contrexx_raw2xhtml($arrLanguage['name']),\n 'LANGUAGE_OPTION_SELECTED' => $selected\n ));\n $this->template->parse('fallbackLanguages');\n } \n \n $adminStatus =\"<input type='checkbox' name='langAdminStatus[\".$objResult->fields['id'].\"]' value='1' $checked />\";\n $this->template->setVariable(array(\n 'LANGUAGE_ROWCLASS' => 'row'.(($i++ % 2)+1),\n 'LANGUAGE_LANG_ID' => $objResult->fields['id'],\n 'LANGUAGE_LANG_NAME' => $objResult->fields['name'],\n 'LANGUAGE_LANG_SHORTNAME' => $objResult->fields['lang'],\n 'LANGUAGE_LANG_CHARSET' => $objResult->fields['charset'],\n 'LANGUAGE_LANG_STATUS' => $status,\n 'LANGUAGE_ACTIVE_STATUS' => $activeStatus,\n 'LANGUAGE_ADMIN_STATUS' => $adminStatus\n ));\n \n if (!$this->isInFullMode()) {\n $this->template->hideBlock('extendedOptions');\n }\n $this->template->parse('languageRow');\n $objResult->MoveNext();\n }\n } \n }", "function GetManageLanguagesAction()\n {\n return \"ManageLanguages\";\n }", "public function index()\n\t{\n\t\tredirect('en','refresh');\n\t}", "function sample_items_search_delete_index() {\n // Delete the index if i18n search is enabled\n if (function_exists('delete_i18n_search_index')) {\n delete_i18n_search_index();\n }\n}", "function index()\n\t{\n\t\t$this->display_language_list();\n\t}", "function edit_language()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\n\t\t\t$file_name_prefix = 'file';\n\t\t\t$file_number = $this->uri->segment(5);\n\n\t\t\t$selectedLanguage = $this->uri->segment('4');\n\t\t\t$languagDirectory = APPPATH . 'language/' . $selectedLanguage;\n\t\t\t\n\t\t\t$get_english_lang_count = directory_map(APPPATH . \"language/en/\");\n\t\t\t\n\t\t\t$filePath = APPPATH . \"language/\" . $selectedLanguage . \"/\" . $file_name_prefix . $file_number . \"_lang.php\";\n\n\t\t\tif (!is_dir($languagDirectory)) {\n\n\t\t\t\tmkdir($languagDirectory, 0777);\n\n\t\t\t\tif (!is_file($filePath)) {\n\n\t\t\t\t\tmkdir($languagDirectory, 0777);\n\t\t\t\t\tfile_put_contents($filePath, '');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_file($filePath)) {\n\t\t\t\t$this->lang->load($file_name_prefix . $file_number, $selectedLanguage);\n\t\t\t}\n\n\t\t\t$filePath = APPPATH . \"language/en/\" . $file_name_prefix . $file_number . \"_lang.php\";\n\t\t\t$fileValues = file_get_contents($filePath);\n\t\t\t\n\t\t\t/** Key value explode start**/\n\t\t\t$fileKeyValues_explode1 = explode(\"\\$lang['\", $fileValues);\n\t\t\t$language_file_keys = array();\n\n\t\t\tforeach ($fileKeyValues_explode1 as $fileKeyValues2) {\n\t\t\t\t$fileKeyValues_explode2 = explode(\"']\", $fileKeyValues2);\n\t\t\t\t$language_file_keys[] = $fileKeyValues_explode2[0];\n\t\t\t}\n\n\t\t\t/** value explode start **/\n\t\t\t$fileValues_explode1 = explode(\"']='\", $fileValues);\n\t\t\t$language_file_values = array();\n\n\t\t\tforeach ($fileValues_explode1 as $fileValues2) {\n\t\t\t\t$fileValues_explode2 = explode(\"';\", $fileValues2);\n\t\t\t\t$language_file_values[] = $fileValues_explode2[0];\n\t\t\t}\n\n\t\t\t$this->data['file_key_values'] = $language_file_keys;\n\t\t\t$this->data['file_lang_values'] = $language_file_values;\n\t\t\t$this->data['selectedLanguage'] = $selectedLanguage;\n\t\t\t$this->data['heading'] = 'Edit Language';\n\t\t\t$this->data['file_name_prefix'] = $file_name_prefix;\n\t\t\t$this->data['get_total_files'] = count($get_english_lang_count);\n\t\t\t$this->data['current_file_no'] = $file_number;\n\t\t\t$this->data['admin_settings'] = $result = $this->admin_model->getAdminSettings();\n\t\t\t$this->load->view('admin/multilanguage/language_edit', $this->data);\n\n\t\t}\n\t}", "public static function output_language_buttons() {\n//\t\t\t. BASE_URL . 'images/swe32.png\"></a>';\n//\t\techo '<a onClick=\"set_language(\\'en\\')\" class=\"lang-flag\"><img title=\"English\" src=\"' . BASE_URL \n//\t\t\t. 'images/eng32.png\"></a>';\n\t}", "public function recycle_bin(){\n $languages = Language::where('status','=',0)->get();\n\t\treturn View::make('admin/language/recycle_bin')->with('languages',$languages)->with('help',$this->__construct());\n }", "public function saveinnlang()\n {\n $soxId = $this->getEditObjectId();\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n // checkbox handling\n if (!isset($aParams['oxlinks__oxactive'])) {\n $aParams['oxlinks__oxactive'] = 0;\n }\n\n // shopid\n $sShopID = oxRegistry::getSession()->getVariable(\"actshop\");\n $aParams['oxlinks__oxshopid'] = $sShopID;\n $oLinks = oxNew(\"oxlinks\", getViewName('oxlinks'));\n $iEditLanguage = oxRegistry::getConfig()->getRequestParameter(\"editlanguage\");\n\n if ($soxId != \"-1\") {\n $oLinks->loadInLang($iEditLanguage, $soxId);\n } else {\n $aParams['oxlinks__oxid'] = null;\n //$aParams = $oLinks->ConvertNameArray2Idx( $aParams);\n }\n\n\n\n $oLinks->setLanguage(0);\n $oLinks->assign($aParams);\n\n // apply new language\n $oLinks->setLanguage(oxRegistry::getConfig()->getRequestParameter(\"new_lang\"));\n $oLinks->save();\n\n // set oxid if inserted\n $this->setEditObjectId($oLinks->getId());\n }", "function gengo_edit_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\t$id = $_POST['gengo_language_id'];\r\n\t$rtl = isset($_POST['gengo_language_rtl']) ? '1' : '0';\r\n\t$charset = $_POST['gengo_language_charset'];\r\n\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\t\r\n\tforeach ($gengo->languages as $language_id => $entry) {\r\n\t\tif ($entry->code == $code) {\r\n\t\t\tif ($language_id != $id) return $gengo->error_message(sprintf(__(\"Language code '%s' already exists, please choose another.\", GENGO_DOMAIN), $code));\r\n\t\t\t$existing_code_id = $language_id;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t$wpdb->query(\"UPDATE $gengo->language_table SET language = '$language', code = '$code', locale = '$locale', rtl = '$rtl', charset = '$charset' WHERE language_id = $id\");\r\n\t$wpdb->query(\"UPDATE $gengo->synblock_table SET text = '$blog_title' WHERE block_name = 'blogtitle' AND language_id = $id\");\r\n\t$wpdb->query(\"UPDATE $gengo->synblock_table SET text = '$blog_tagline' WHERE block_name = 'blogtagline' AND language_id = $id\");\r\n\t$gengo->set_defined_languages();\r\n\tif ($existing_code_id != $id) {\r\n\t\t$wp_rewrite->flush_rules();\r\n\t\t$rewrite_message = __(' Rewrite rules updated.', GENGO_DOMAIN);\r\n\t}\r\n\treturn $gengo->update_message(sprintf(__(\"Language updated: '%s' with code '%s' and locale '%s'.%s\", GENGO_DOMAIN), $language, $code, $locale, $rewrite_message));\r\n}", "public function indexAction() \n {\n $this->_includeMainMenuJS();\n\n // вывести ленту новостей\n /*\n $this->_helper->actionStack('maintape',\n 'content',\n 'default',\n array('key' => 'content_addons'));\n */\n }", "function index() {\r\n\t\t\r\n\t\t$this->translations();\r\n\t}", "public function add_translations() {}", "function odiogo_init_l10n() {\r\n\tload_plugin_textdomain('odiogolistenbutton', 'wp-content/plugins/'.plugin_basename(dirname(__FILE__)).'/translations');\r\n}", "public function actionManage()\n\t{\n $searchModel = new CoreLanguagesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $gridColumn = Yii::$app->request->get('GridColumn', null);\n $cols = [];\n if ($gridColumn != null && count($gridColumn) > 0) {\n foreach ($gridColumn as $key => $val) {\n if ($gridColumn[$key] == 1) {\n $cols[] = $key;\n }\n }\n }\n $columns = $searchModel->getGridColumn($cols);\n\n\t\t$this->view->title = Yii::t('app', 'Languages');\n\t\t$this->view->description = '';\n\t\t$this->view->keywords = '';\n\t\treturn $this->render('admin_manage', [\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'columns' => $columns,\n\t\t]);\n\t}", "function icl_post_languages(){\n\n $languages = icl_get_languages('skip_missing=0');\n $langs = array();\n \n foreach($languages as $l){\n if(!$l['active']) {\n $langs[$l['translated_name']] = $l['url'];\n }\n }\n // Sort languages alphabetically by name\n ksort($langs);\n\n if(1 < count($languages)){\n echo '<button class=\"button\" type=\"button\" data-toggle=\"example-dropdown-1\"><i class=\"fa fa-globe\" aria-hidden=\"true\"></i>&nbsp;&nbsp;<span class=\"choose\">'. __('Choose Language','protectionpro') .'</span>&nbsp;&nbsp;<i class=\"fa fa-caret-down\" aria-hidden=\"true\"></i></button>';\n echo '<ul class=\"dropdown-pane lang-switcher\" id=\"example-dropdown-1\" data-dropdown data-hover=\"true\" data-hover-pane=\"true\">';\n \n foreach ($langs as $key => $value) {\n echo '<li><a href=\"'.$value.'\">'.$key.'</a></li>';\n }\n echo '</ul>';\n }\n}" ]
[ "0.5951028", "0.59443384", "0.568013", "0.56756943", "0.5602884", "0.5565888", "0.5559672", "0.5557478", "0.55087495", "0.546396", "0.54356575", "0.54251885", "0.5414606", "0.5405933", "0.5339651", "0.5331149", "0.53074634", "0.52812576", "0.5276836", "0.5256014", "0.5244694", "0.5216527", "0.5213838", "0.52046824", "0.52044386", "0.5185136", "0.5160083", "0.5159432", "0.515349", "0.51434696" ]
0.80480325
0
Find all models sorted by $sort with $dir
function findAllSorted($sort = 'id', $dir = 'asc');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAllBySorted(array $attributes, $sort = 'id', $dir = 'asc');", "public function sortquery( $p_dir ) {}", "function findAllPaginatedSorted($perPage = 20, $sort = 'id', $dir = 'asc');", "function findAllByPaginatedSorted(array $attributes, $perPage = 20, $sort = 'id', $dir = 'asc');", "public function getAllSortedByName()\n {\n return $this->model->orderBy('name')->get();\n }", "public function getModelFiles() {\n $models = array();\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->__modelsDir), 2) as $path) {\n if (!$path->isDir() && $path && substr($path=(string)$path, -1) !== '.') {\n $path = (string)$path;\n $part = pathinfo($path);\n if (isset($part['extension']) && isset($part['filename']) && strtolower($part['extension']) === 'php') {\n $models[$model=$part['filename']] = $path;\n if (isset($this->__modify[$model])) {\n $this->__modify[$model][1] = filemtime($path);\n } else {\n $this->__modify[$model] = array(-2, filemtime($path));\n }\n }\n }\n }\n /* add models to autoload */\n Arta::$autoload[] = $this->__modelsDir;\n foreach ($models as $path) {\n Arta::$autoload[] = pathinfo($path, PATHINFO_DIRNAME);\n }\n Arta::$autoload = array_unique(Arta::$autoload);\n /* filter model classes */\n $realModels = array();\n foreach ($models as $name => $path) {\n if (!class_exists($name)) {\n continue;\n }\n\n $class = new ReflectionClass($name);\n if ($class->isAbstract()) {\n continue;\n }\n\n $mObj = new $name();\n if (!($mObj instanceof Model) || !isset($mObj->__instanceId__)) {\n continue;\n }\n\n $realModels[$name] = $path;\n }\n /* * */\n return $realModels;\n }", "public function getSorts();", "public function sort()\n {\n $this->repository->sort(Input::all());\n }", "function getNamesFromDir($dir)\n {\n $models = File::allFiles(app_path($dir));\n\n $final_array =[];\n \n foreach ( $models as $model )\n {\n $name = basename(strtolower($model),'.php');\n\n array_push($final_array,$name);\n }\n\n return $final_array;\n }", "public function default_sorting_based_on_model_fields(): void\n {\n $request = $this->makeRequestWithSort(\n [\n ['field' => 'title'],\n ]\n );\n\n $postA = factory(Post::class)->create(['title' => 'post A']);\n $postB = factory(Post::class)->create(['title' => 'post B']);\n $postC = factory(Post::class)->create(['title' => 'post C']);\n\n $query = Post::query();\n\n $queryBuilder = new QueryBuilder(\n Post::class,\n new ParamsValidator([], [], ['title']),\n new RelationsResolver([], []),\n new SearchBuilder([])\n );\n $queryBuilder->applySortingToQuery($query, $request);\n\n $posts = $query->get();\n\n $this->assertEquals($postA->id, $posts[0]->id);\n $this->assertEquals($postB->id, $posts[1]->id);\n $this->assertEquals($postC->id, $posts[2]->id);\n }", "function listDirStructure($dir=\".\", $recurse=true, $sort=\"asc\", $strip_root=NULL, $exclude=array(), $ignore_hidden=true){\n\n\t\t $filter_pattern_match = false;\n\n\t\t if(isset($filters) && !is_array($filters)) $filter_pattern_match = true;\n\n\t\t $files = array();\n\n\t\t\tif(!$handle = @opendir($dir)) return array();\n\n\t\t\twhile(($file = @readdir($handle)) != false){\n\t\t\t\tif($file != '.' && $file != '..' && (!$ignore_hidden || ($ignore_hidden && $file{0} != '.'))){\n\n\t\t\t\t\tif(@is_dir(\"$dir/$file\")){\n\t\t\t\t\t\tif($recurse){\n\t\t\t\t\t\t\t$files[] = str_replace($strip_root, \"\", $dir) .\"/$file/\";\n\n\t\t\t\t\t\t\t$files = @array_merge($files, General::listDirStructure(\"$dir/$file\", $recurse, $sort, $strip_root, $exclude, $ignore_hidden));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@closedir($handle);\n\t\t\treturn $files;\n\t\t}", "private function findModels()\n {\n $this->models = array();\n foreach ($this->methods as $func) {\n $matches = array();\n for ($i = $func['start']; $i <= $func['end']; $i++) {\n // A model is assigned and not ignored with tag @checkForgetMe\n if (preg_match_all('/\\$([a-zA-Z_]+)\\s*=\\s*ORM::factory\\([\\'\"]([a-zA-Z_]+)[\\'\"]/',\n $this->content[$i], $matches) > 0\n && strpos($this->content[$i], \"@checkForgetMe\") === FALSE) {\n for ($j = 0; $j < sizeof($matches[0]); $j++) {\n $orm = ORM::factory($matches[2][$j]);\n \n // Create data structure\n $this->models[] = array(\n \"var\" => $matches[1][$j],\n \"model\" => $matches[2][$j],\n \"start\" => $i,\n \"end\" => $func['end'],\n \"columns\" => array_keys($orm->table_columns()),\n \"relationships\" => array_merge(array_keys($orm->belongs_to()),\n array_keys($orm->has_many()),\n array_keys($orm->has_one())),\n \"update\" => false,\n \"insert\" => false\n );\n }\n }\n }\n }\n }", "function includeModels() {\n $directory = opendir(MODELS);\n while($file = readdir($directory)) {\n if(!is_dir($file)) {\n require_once MODELS . $file;\n }\n }\n }", "function listStructure($dir=\".\", $filters=array(), $recurse=true, $sort=\"asc\", $strip_root=NULL, $exclude=array(), $ignore_hidden=true){\n\n\t\t $filter_pattern_match = false;\n\n\t\t if(isset($filters) && !is_array($filters)) $filter_pattern_match = true;\n\n\t\t $files = array();\n\n\t\t\tif(!$handle = @opendir($dir)) return array();\n\n\t\t\twhile(($file = @readdir($handle)) != false){\n\t\t\t\tif($file != '.' && $file != '..' && (!$ignore_hidden || ($ignore_hidden && $file{0} != '.'))){\n\n\t\t\t\t\tif(@is_dir(\"$dir/$file\")){\n\t\t\t\t\t\tif($recurse)\n\t\t\t\t\t\t\t$files[str_replace($strip_root, \"\", $dir) . \"/$file/\"] = General::listStructure(\"$dir/$file\", $filters, $recurse, $sort, $strip_root, $exclude, $ignore_hidden);\n\n\t\t\t\t\t\t$files[\"dirlist\"][] = $file;\n\n\t\t\t\t\t}elseif($filter_pattern_match || (!empty($filters) && is_array($filters))){\n\n\t\t\t\t\t\tif($filter_pattern_match){\n\t\t\t\t\t\t\tif(preg_match($filters, $file)){\n\t\t\t\t\t\t\t\t$files[\"filelist\"][] = $file;\n\n\t\t\t\t\t\t\t\tif($sort == 'desc') rsort($files[\"filelist\"]);\n\t\t\t\t\t\t\t\telse sort($files[\"filelist\"]);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}elseif(in_array(General::getExtension($file), $filters)){\n\t\t\t\t\t\t\t$files[\"filelist\"][] = $file;\n\n\t\t\t\t\t\t\tif($sort == 'desc') rsort($files[\"filelist\"]);\n\t\t\t\t\t\t\telse sort($files[\"filelist\"]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}elseif(empty($filters)){\n\t\t\t\t\t\t$files[\"filelist\"][] = $file;\n\n\t\t\t\t\t\tif($sort == 'desc') rsort($files[\"filelist\"]);\n\t\t\t\t\t\telse sort($files[\"filelist\"]);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t@closedir($handle);\n\t\t\treturn $files;\n\t\t}", "public function enumModels()\n\t{\n\t\tif ($this->_venumModels == null) {\n\t\t\t$this->_venumModels = array();\n\t\t\t$p = $this->getModelPath();\n\t\t\tforeach (scandir($p) as $f) {\n\t\t\t\tif ($f == '.' || $f == '..') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (strlen($f)) {\n\t\t\t\t\tif ($f[0] == '.') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->_venumModels[] = substr($f,0,strpos($f,'.php'));\n\n\t\t\t}\n\t\t\treturn $this->_venumModels;\n\t\t} else {\n\t\t\treturn $this->_venumModels ;\n\t\t}\n\t}", "function listStructureFlat($dir=\".\", $filters=array(), $recurse=true, $sort=\"asc\", $strip_root=NULL, $exclude=array(), $ignore_hidden=true){\n\n\t\t $files = array();\n\n\t\t\tif(!$handle = @opendir($dir)) return array();\n\n\t\t\twhile(($file = @readdir($handle)) != false){\n\t\t\t\tif($file != '.' && $file != '..' && (!$ignore_hidden || ($ignore_hidden && $file{0} != '.'))){\n\t\t\t\t\tif(@is_dir(\"$dir/$file\")){\n\t\t\t\t\t\tif($recurse)\n\t\t\t\t\t\t\t$files = array_merge($files, General::listStructureFlat(\"$dir/$file\", $filters, $recurse, $sort, $strip_root, $exclude, $ignore_hidden));\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t$can_include = true;\n\n\t\t\t\t\t\tif(!empty($filters)){\n\t\t\t\t\t\t\t$can_include = in_array(General::getExtension($file), $filters);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!empty($exclude)){\n\t\t\t\t\t\t\t$can_include = !in_array(General::getExtension($file), $exclude);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($can_include){\n\t\t\t\t\t\t\t$files[] = array(\"name\" => $file, \"path\" => $dir);\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@closedir($handle);\n\n\t\t\tif($sort == 'desc') usort($files, array('General', 'fileSortR'));\n\t\t\telseif($sort == 'mtime') usort($files, array('General', 'filemtimeSort'));\n\t\t\telse usort($files, array('General', 'fileSort'));\n\n\t\t\tif($strip_root){\n\t\t\t\tfor($ii = 0; $ii < count($files); $ii++)\n\t\t\t\t\t$files[$ii]['path'] = str_replace($strip_root, \"\", $files[$ii]['path']);\n\t\t\t}\n\n\t\t\treturn $files;\n\n\t\t}", "function GetAllModels()\n\t{\n\t}", "public function testFindSort() {\n\t\t$data = [\n\t\t\t'fk_id' => 1,\n\t\t\t'fk_model' => 'Muffins',\n\t\t\t'tag' => [\n\t\t\t\t'label' => 'Awesome',\n\t\t\t\t'slug' => 'awesome',\n\t\t\t],\n\t\t];\n\t\t$tagged = $this->Tagged->newEntity($data);\n\t\t$this->Tagged->save($tagged);\n\n\t\t$result = $this->Tagged->find()\n\t\t\t->contain('Tags')\n\t\t\t->where(['fk_id' => 1, 'fk_model' => 'Muffins'])\n\t\t\t->all()\n\t\t\t->toArray();\n\n\t\t$tags = Hash::extract($result, '{n}.tag.label');\n\t\t$ids = Hash::extract($result, '{n}.tag_id');\n\n\t\t$this->assertSame(['Awesome', 'Color', 'Dark Color'], $tags);\n\t\t$this->assertSame([3, 1, 2], $ids);\n\t}", "function scandir ($directory, $sorting_order = 'SCANDIR_SORT_ASCENDING', $context = null) {}", "public function getSort();", "public function organize()\n\t{\n\t\t$this->applyFilters();\n\t\t$this->totFilesCount = $this->getFilesCount();\n\t\t$this->sort();\n\t}", "private static function resort_objects() {\n\n\t\t// There are two ways to do this.. the easy way...\n\t\t// and the vollmer way, hopefully we don't have to\n\t\t// do it the vollmer way\n\t\tif (self::$simple_browse) {\n\t\t\t$sql = self::get_base_sql();\n\t\t}\n\t\telse {\n\t\t\t// First pull the objects\n\t\t\t$objects = self::get_saved();\n\n\t\t\t// If there's nothing there don't do anything\n\t\t\tif (!count($objects)) { return false; }\n\t\t\t$type = $_SESSION['browse']['type'];\n\t\t\t$where_sql .= \"`$type`.`id` IN (\";\n\n\t\t\tforeach ($objects as $object_id) {\n\t\t\t\t$object_id = Dba::escape($object_id);\n\t\t\t\t$where_sql .= \"'$object_id',\";\n\t\t\t}\n\t\t\t$where_sql = rtrim($where_sql,',');\n\n\t\t\t$where_sql .= \")\";\n\n\t\t\t$sql = self::get_base_sql();\n\t\t\t$sql .= $where_sql;\n\t\t}\n\n\n\t\t$order_sql = \"ORDER BY \";\n\n foreach ($_SESSION['browse']['sort'] as $key=>$value) {\n $order_sql .= self::sql_sort($key,$value);\n }\n // Clean her up\n $order_sql = rtrim($order_sql,\"ORDER BY \");\n $order_sql = rtrim($order_sql,\",\");\n $sql = $sql . $order_sql;\n\n\t\t$db_results = Dba::query($sql);\n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) {\n\t\t\t$results[] = $row['id'];\n\t\t}\n\n\t\tself::save_objects($results);\n\n\t\treturn true;\n\n\t}", "public function doSort();", "public function getItems($model, $id)\n {\n $sort_type = request('sort_type');\n $type = request('type');\n $workingDir = request('working_dir', '/');\n\n if ($type !== 'Images') {\n $workingDir = '/uploaded';\n }\n\n $model = $this->getModelByModelName($model, $id);\n\n $files = parent::sortFilesAndDirectories(\n $this->getFilesWithInfo($model->getFilemanagerFiles($workingDir), $type),\n $sort_type\n );\n\n $directories = parent::sortFilesAndDirectories(\n $this->getFilesWithInfo($model->getFilemanagerDirectories($workingDir), $type),\n $sort_type\n );\n\n return [\n 'items' => array_merge($directories, $files)\n ];\n }", "protected function sortFileObjects() {\n\t\t$sortingProperty = '';\n\t\tif ($this->typoScriptConfiguration['sorting'] || $this->typoScriptConfiguration['sorting.']) {\n\t\t\t$sortingProperty = $this->contentObject->stdWrap(\n\t\t\t\t$this->typoScriptConfiguration['sorting'],\n\t\t\t\t$this->typoScriptConfiguration['sorting.']\n\t\t\t);\n\t\t}\n\t\tif ($sortingProperty !== '' && count($this->fileObjects) > 1) {\n\t\t\tusort(\n\t\t\t\t$this->fileObjects,\n\t\t\t\tfunction(\n\t\t\t\t\t\\TYPO3\\CMS\\Core\\Resource\\FileInterface $a,\n\t\t\t\t\t\\TYPO3\\CMS\\Core\\Resource\\FileInterface $b\n\t\t\t\t) use($sortingProperty) {\n\t\t\t\t\tif ($a->hasProperty($sortingProperty) && $b->hasProperty($sortingProperty)) {\n\t\t\t\t\t\treturn strnatcasecmp($a->getProperty($sortingProperty), $b->getProperty($sortingProperty));\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "public function beforeFind()\n\t{\n\t\t$this->setDefaultSort( 't.create_date desc' );\n\t\treturn parent::beforeFind();\n\t}", "protected function order_by () {\n if ($this->_fmFindCommand === NULL) {\n $this->_fmFindCommand = $this->_FM->newFindAllCommand($this->_layout);\n }\n\n $sortFieldName = $this->_token->value;\n $this->expect(SQLToken::TOK_STR);\n\n $sortOrder = NULL;\n if ($this->_token->isType(SQLToken::TOK_ASC)) {\n $this->nextToken();\n $sortOrder = FILEMAKER_SORT_ASCEND;\n } elseif ($this->_token->isType(SQLToken::TOK_DESC)) {\n $this->nextToken();\n $sortOrder = FILEMAKER_SORT_DESCEND;\n }\n\n $this->_fmFindCommand->addSortRule($sortFieldName, $this->_sortPrecedence, $sortOrder);\n if ($this->_debug) {\n echo \"order_by: addSortRule($sortFieldName, $this->_sortPrecedence, $sortOrder)\\n\";\n }\n $this->_sortPrecedence++;\n\n while ($this->accept(SQLToken::TOK_COMMA)) {\n $sortFieldName = $this->_token->value;\n $this->expect(SQLToken::TOK_STR);\n\n $sortOrder = NULL;\n if ($this->_token->isType(SQLToken::TOK_ASC)) {\n $this->nextToken();\n $sortOrder = FILEMAKER_SORT_ASCEND;\n } elseif ($this->_token->isType(SQLToken::TOK_DESC)) {\n $this->nextToken();\n $sortOrder = FILEMAKER_SORT_DESCEND;\n }\n\n $this->_fmFindCommand->addSortRule($sortFieldName, $this->_sortPrecedence, $sortOrder);\n if ($this->_debug) {\n echo \"order_by: addSortRule($sortFieldName, $this->_sortPrecedence, $sortOrder)\\n\";\n }\n $this->_sortPrecedence++;\n }\n }", "private function _load_models()\n {\n foreach ($this->models as $model)\n {\n $this->load->model($this->_model_name($model), $model);\n }\n }", "public function search()\n {\n $definedModels = $this->classFinder->findClasses();\n $this->cacheManager->store(\n static::STORE_KEY,\n $this->formatClassReferences($definedModels)\n );\n }", "public function all($model)\n\t\t{\n\t\t\t$properties = implode(',', array_keys($model->getProperties()));\n\t\t\t$sql = \"\";\n\t\t\t$page = isset($_GET[\"page\"])&&is_numeric($_GET[\"page\"])&&$_GET[\"page\"]>0 ? ($_GET[\"page\"]-1) : 0;\n\t\t\tif($page >= 0 && $this->table==\"dat\" ){\n\t\t\t\t$page = $page * $this->data ;\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc limit $page, $this->data \";\n\t\t\t}\n\t\t\telse $sql = \"SELECT {$properties} FROM {$this->table}\";\n\t\t\tif($this->data==''){\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc\";\n\t\t\t}\n\t\t\t$req = Database::getBdd()->prepare($sql);\n\t\t\t$req->execute();\n\t\t\treturn $req->fetchAll(PDO::FETCH_OBJ);\n\t\t}" ]
[ "0.6569332", "0.6105189", "0.5992085", "0.593496", "0.58293873", "0.5821245", "0.56693035", "0.56236255", "0.5588976", "0.55238485", "0.5485567", "0.5429602", "0.5414721", "0.53987795", "0.53899777", "0.5375547", "0.53694904", "0.53296757", "0.5316147", "0.5306063", "0.52986795", "0.52757156", "0.52596766", "0.5212677", "0.5210863", "0.5148812", "0.5134985", "0.51251847", "0.5123347", "0.51205593" ]
0.7018934
0
Find all models paginated and sorted by $sort with $dir
function findAllPaginatedSorted($perPage = 20, $sort = 'id', $dir = 'asc');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAllByPaginatedSorted(array $attributes, $perPage = 20, $sort = 'id', $dir = 'asc');", "function findAllSorted($sort = 'id', $dir = 'asc');", "function findAllBySorted(array $attributes, $sort = 'id', $dir = 'asc');", "public function getAll($paginate, $orderBy);", "public function sortquery( $p_dir ) {}", "public function getAllPaginated()\n {\n }", "public function all($model)\n\t\t{\n\t\t\t$properties = implode(',', array_keys($model->getProperties()));\n\t\t\t$sql = \"\";\n\t\t\t$page = isset($_GET[\"page\"])&&is_numeric($_GET[\"page\"])&&$_GET[\"page\"]>0 ? ($_GET[\"page\"]-1) : 0;\n\t\t\tif($page >= 0 && $this->table==\"dat\" ){\n\t\t\t\t$page = $page * $this->data ;\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc limit $page, $this->data \";\n\t\t\t}\n\t\t\telse $sql = \"SELECT {$properties} FROM {$this->table}\";\n\t\t\tif($this->data==''){\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc\";\n\t\t\t}\n\t\t\t$req = Database::getBdd()->prepare($sql);\n\t\t\t$req->execute();\n\t\t\treturn $req->fetchAll(PDO::FETCH_OBJ);\n\t\t}", "function findAllPaginated($perPage = 20);", "public static function paginate ($model)\n {\n $params = Util::getParams(func_get_args());\n $page_number = isset($params['page']) ? (int) $params['page'] : 1;\n $per_page = isset($params['per_page']) ? (int) $params['per_page'] : 20;\n //Si la pagina o por pagina es menor de 1 (0 o negativo)\n if ($page_number < 1 && $per_page < 1) {\n throw new KumbiaException(\"La página $page_number no existe en el paginador\");\n }\n $start = $per_page * ($page_number - 1);\n //Instancia del objeto contenedor de pagina\n $page = new stdClass();\n //Si es un array, se hace paginacion de array\n if (is_array($model)) {\n $items = $model;\n $n = count($items);\n //si el inicio es superior o igual al conteo de elementos,\n //entonces la página no existe, exceptuando cuando es la pagina 1\n if ($page_number > 1 && $start >= $n) {\n throw new KumbiaException(\"La página $page_number no existe en el paginador\");\n }\n $page->items = array_slice($items, $start, $per_page);\n } else {\n //Arreglo que contiene los argumentos para el find\n $find_args = array();\n $conditions = null;\n //Asignando parametros de busqueda\n if (isset($params['conditions'])) {\n $conditions = $params['conditions'];\n } elseif (isset($params[1])) {\n $conditions = $params[1];\n }\n if (isset($params['columns'])) {\n $find_args[] = \"columns: {$params['columns']}\";\n }\n if (isset($params['join'])) {\n $find_args[] = \"join: {$params['join']}\";\n }\n if (isset($params['group'])) {\n $find_args[] = \"group: {$params['group']}\";\n }\n if (isset($params['having'])) {\n $find_args[] = \"having: {$params['having']}\";\n }\n if (isset($params['order'])) {\n $find_args[] = \"order: {$params['order']}\";\n }\n if (isset($params['distinct'])) {\n $find_args[] = \"distinct: {$params['distinct']}\";\n }\n if (isset($conditions)) {\n $find_args[] = $conditions;\n }\n //contar los registros\n $n = $model->count($conditions);\n //si el inicio es superior o igual al conteo de elementos,\n //entonces la página no existe, exceptuando cuando es la pagina 1\n if ($page_number > 1 && $start >= $n) {\n throw new KumbiaException(\"La página $page_number no existe en el paginador\");\n }\n //Asignamos el offset y limit\n $find_args[] = \"offset: $start\";\n $find_args[] = \"limit: $per_page\";\n //Se efectua la busqueda\n $page->items = call_user_func_array(array($model , 'find'), $find_args);\n }\n //Se efectuan los calculos para las paginas\n $page->next = ($start + $per_page) < $n ? ($page_number + 1) : false;\n $page->prev = ($page_number > 1) ? ($page_number - 1) : false;\n $page->current = $page_number;\n $page->total = ceil($n / $per_page);\n $page->count = $n;\n $page->per_page = $per_page;\n return $page;\n }", "public function paginate();", "function findAllByPaginated(array $attributes, $perPage = 20);", "public function findAllPaginated($perPage = 20, array $orderBy = ['id', 'asc'], array $columns = ['*']);", "function findItems(\\IMozambiquePagination $pagination = NULL);", "public function findAllPaginated($perPage=10)\n\t{\n\t\treturn $this->model->orderBy('created_at', 'DESC')->paginate($perPage);\n\t}", "public function findAllPaginated($perPage = 200);", "public function paginate()\n {\n return $this->stepRepository->scopeQuery(function ($query) {\n return $query->orderBy('id', 'desc');\n })->paginate();\n }", "function get_paged_list($cari, $sort, $order, $limit = 10, $offset = 0)\n\t{\n\t $cari = str_replace('_', ' ', $cari);\n $cari = strtolower(trim($cari));\n\t if($cari != '') $this->db->like('lower(nama)', $cari);\n\t\t$this->db->order_by($sort, $order);\n\t\treturn $this->db->get($this->table, $limit, $offset);\n\t}", "public function default_sorting_based_on_model_fields(): void\n {\n $request = $this->makeRequestWithSort(\n [\n ['field' => 'title'],\n ]\n );\n\n $postA = factory(Post::class)->create(['title' => 'post A']);\n $postB = factory(Post::class)->create(['title' => 'post B']);\n $postC = factory(Post::class)->create(['title' => 'post C']);\n\n $query = Post::query();\n\n $queryBuilder = new QueryBuilder(\n Post::class,\n new ParamsValidator([], [], ['title']),\n new RelationsResolver([], []),\n new SearchBuilder([])\n );\n $queryBuilder->applySortingToQuery($query, $request);\n\n $posts = $query->get();\n\n $this->assertEquals($postA->id, $posts[0]->id);\n $this->assertEquals($postB->id, $posts[1]->id);\n $this->assertEquals($postC->id, $posts[2]->id);\n }", "public function findPaginated($query, array $options = []);", "public function fetchAllByPage($page, $itemsPerPage);", "public function getAll(){\n $query = $this->query()\n ->orderBy('id', 'desc')\n ->paginate(sysdef()->name('pagination_low'));\n return $query;\n }", "public function index()\n\t{\n\t\t$search = (null !== \\Input::get('search')) ? \\Input::get('search') : \"\";\n\t\t$structure = $this->structure;\n\t\t$searchableField = isset($structure['searchable_fields'])? $structure['searchable_fields'] : 'name';\n\t\t$required = array();\n\t\t$models = array();\n\t\t$rows = array();\n\t\t$paginate = (!empty($this->paginate)) ? $this->paginate : 20;\n\n\n\t\tif(strlen($search) >= 0) {\n\t\t\tif(isset($structure['index']['self'])) {\n\t\t\t\tif (is_array($structure['index']['self'])) {\n\t\t\t\t\tforeach ($structure['index']['self'] as $self => $title) {\n\t\t\t\t\t\t$required[$self]['title'] = $title;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($structure['index']['relations'])) {\n\t\t\t\tif (is_array($structure['index']['relations'])) {\n\t\t\t\t\tforeach ($structure['index']['relations'] as $relation => $array) {\n\t\t\t\t\t\tforeach ($array as $key => $value) {\n\t\t\t\t\t\t\t$required[$relation.'.'.$key]['title'] = $value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$relations[] = $relation;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$paginatedModels = new $structure['model'];\n\n\t\t\tif(isset($relations)) {\n\t\t\t\t$paginatedModels = $paginatedModels::with($relations);\n\t\t\t}\n\n\t\t\tif(is_array($searchableField)) {\n\t\t\t\t$paginatedModels = $paginatedModels->where($searchableField[0], 'LIKE', \"%$search%\");\n\t\t\t\tunset($searchableField[0]);\n\n\t\t\t\tforeach ($searchableField as $field) {\n\t\t\t\t\t$paginatedModels = $paginatedModels->orWhere($field, 'LIKE', \"%$search%\");\n\t\t\t\t}\t\t\t\n\t\t\t} else {\n\t\t\t\t$paginatedModels = $paginatedModels->where($searchableField, 'LIKE', \"%$search%\");\n\t\t\t}\n\n\t\t\t$paginatedModels = $paginatedModels->orderBy('id', 'desc')->paginate($paginate);\n\t\t\t$models = $paginatedModels->items();\n\n\t\t\tforeach ($models as $key => $model) {\n\t\t\t\t$models[$key]->revealHidden();\n\t\t\t}\n\n\t\t\tlist($required_keys) = array_divide($required);\n\n\t\t\tforeach ($models as $model_key => $model) {\n\t\t\t\tforeach ($required_keys as $required_key) {\n\t\t\t\t\t$title = $required[$required_key]['title'];\n\t\t\t\t\t$value = $model->$required_key;\n\n\t\t\t\t\tif (!isset($value)) {\n\t\t\t\t\t\t$address = explode('.', \"$required_key\");\n\n\t\t\t\t\t\tif(is_array($model[$address[0]])) {\n\t\t\t\t\t\t\tforeach ($model[$address[0]] as $sub) {\n\t\t\t\t\t\t\t\t$value .= array_get($sub, $address[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\t$rows[array_get($model, 'id')][$title] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn \\View::make($this->view['index'])->with(array('rows' => $rows, 'search' => $search, 'structure' => $structure, 'pagination' => $paginatedModels));\n\t}", "public function index(Request $request)\n {\n $objects = $this->model_instance;\n\n //Sorting\n $sortConditions = $this->sorting($request->input('sort', null));\n foreach ($sortConditions as $sortCondition => $direction) {\n $objects = $objects->orderBy($sortCondition,$direction);\n }\n //Field selection\n $objects = $objects->select(\n $this->fieldsSelection($request->input('fields', null)));\n\n //Get filtering conditions\n $inputs = $request->except(['sort','fields','page','limit','offset']);\n $res = $this->filtering($inputs,$this->model_instance->getColumns());\n $filter_columns = $res['filter_columns'];\n $operators = $res['operators'];\n $values = $res['values'];\n $filter_columns_count = count($filter_columns);\n\n // Filtering\n for ($i = 0; $i < $filter_columns_count; $i++) {\n if(is_array($values[$i])) {\n $objects = $objects\n ->whereIn($filter_columns[$i],$value);\n }\n else {\n $objects = $objects->where(\n $filter_columns[$i],\n $operators[$i],\n $values[$i]\n );\n }\n }\n // Paging\n $offset = intval($request->input('offset',0));\n $limit = intval($request->input('limit',20));\n $page = intval($request->input('page',1));\n // TODO:Check logic here minus $offset or not\n // $total = $objects->count() - $offset;\n $total = $objects->count();\n $skip = $offset + ($page - 1) * $limit;\n if($limit == 0) {\n //When $limit = 0, return all elements\n $limit = $total;\n }\n $last_page = ceil($total/$limit);\n\n $response['total'] = $total;\n $response['per_page'] = $limit;\n $response['current_page'] = $page;\n $response['last_page'] = $last_page;\n $response['next_page_url'] = $this->addPage($request,$page+1,$last_page);\n $response['prev_page_url'] = $this->addPage($request,$page-1,$last_page);;\n $response['from'] = $skip + 1;\n $response['to'] = min($skip + $limit, $total);\n $response['data'] = $objects->skip($skip)->take($limit)->get()->toArray();\n return response()->json($response,201);\n }", "function get_all_paginate() {\n\n $page = (isset($_REQUEST['page'])) ? $_REQUEST['page'] : '';\n $limit = (isset($_REQUEST['item_por_page'])) ? $_REQUEST['item_por_page'] : 50;\n $select_column = (isset($_REQUEST['select_column'])) ? $_REQUEST['select_column'] : '1';\n $order_column = (isset($_REQUEST['order_column'])) ? $_REQUEST['order_column'] : 'desc';\n $search = (isset($_REQUEST['search_column'])) ? $_REQUEST['search_column'] : '';\n $data = array(\n 'page' => $page,\n 'item_por_page' => $limit,\n 'select_column' => $select_column,\n 'order_column' => $order_column,\n 'search_column' => $search\n );\n\n $data = $this->app_roles_model->get_all_paginate($data);\n\n echo json_encode($data);\n }", "public function findByPage($page = 1, $limit = 10, $with = array(), $sortField = 'created_at', $sortDir = 'desc') {\n //create empty object\n $results = new StdClass();\n //push parameters into results object\n $results->page = $page;\n $results->limit = $limit;\n $results->totalItems = 0;\n $results->items = array();\n //eager load any desired relationships\n $query = $this->make($with);\n //query the data with the parameters\n $posts = $query->orderBy($sortField, $sortDir)->skip($limit * ($page - 1))->take($limit)->get();\n //add the total items to the results\n $results->totalItems = $this->model->count();\n //add the data to the results\n $results->items = $posts->all();\n return $results;\n }", "public function findSortedByDate()\n {\n $qb = $this->getBaseSelect()\n ->addSelect('main.id')\n ->orderBy('main.timestamp', 'DESC');\n\n return $this->paginate($qb, array('select', 'join', 'groupBy', 'orderBy'))\n ->execute()\n ->fetchAll(PDO::FETCH_ASSOC);\n }", "public function findAllPagesOrderBySlug()\n {\n $select = $this->getSelect()->order('slug');\n return $this->fetchObjects($select);\n }", "public function all($page = 1, $limit = 5, $orderBy = null);", "public function index()\n\t{\n\t\t$sorting_array = array();\n\n\t\t$orderby = Request()->orderby;\n\t\t$order = Request()->order;\n\n\t\tif(!$orderby && !$order)\n\t\t{\n\t\t\t$orderby = 'id';\n\t\t\t$order = 'desc';\n\t\t}\n\n\t\t$column_array = array('id' => 'Id', 'page_name' => 'Page Name');\n\t\t$search = Request()->search;\n\t\t$where = \"1 \";\n\n\t\tif($search)\n\t\t{\n\t\t\t$where .= \" and (\";\n\t\t\t$i=1;\n\t\t\tforeach($column_array as $key=>$val)\n\t\t\t{\n\t\t\t\tif($i>1)\n\t\t\t\t{\n\t\t\t\t\t$where .= \" or \";\n\t\t\t\t}\n\n\t\t\t\t$where .= $key.\" like '%\".$search.\"%'\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$where .= \")\";\n\t\t}\n\n\t\t$item_display_per_page = config('admin.pagination');\n\t\t$pages = Page::select('pages.*')\n\t\t->whereRaw($where)\n\t\t->orderBy($orderby, $order)\n\t\t->paginate($item_display_per_page);\n\n\n\t\tforeach($column_array as $key => $value)\n\t\t{\n\t\t\t$sorting_class = 'sorting';\n\t\t\t$sorting_url_orderby = $key;\n\t\t\t$sorting_url_order = 'asc';\n\n\t\t\tif($orderby==$key)\n\t\t\t{\n\t\t\t\t$sorting_class = ( $order=='asc' ? 'sorting_asc' : 'sorting_desc' );\n\n\t\t\t\t$sorting_url_order = ( $order=='asc' ? 'desc' : 'asc' );\n\t\t\t}\n\n\t\t\t$sorting_url = 'page?'.($search!=\"\" ? 'search='.$search.'&' : '').'orderby='.$sorting_url_orderby.'&order='.$sorting_url_order;\n\n\t\t\t$sorting_array[$key] = array('sorting_class' => $sorting_class, 'sorting_url' => $sorting_url);\n\t\t}\n\n\t\treturn view('admin.page.index', compact('pages','column_array','sorting_array','search'));\n\t}", "public function findAll($page = 1, array $filters = null, $limit = null, array $order = null)\n {\n }" ]
[ "0.72400486", "0.7067887", "0.6549783", "0.6260838", "0.6226282", "0.621591", "0.61130637", "0.60472655", "0.6021846", "0.58749825", "0.5856312", "0.5856004", "0.5819421", "0.58023435", "0.5683319", "0.56685466", "0.565092", "0.56201315", "0.55881894", "0.55875325", "0.55676305", "0.5549718", "0.554437", "0.5533187", "0.55265236", "0.5515956", "0.5515138", "0.54636955", "0.5452838", "0.5452608" ]
0.74966323
0
Find all models with attributes
function findAllBy(array $attributes);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_all_attributes() \n {\n return Attribute::select('id', 'name')->get();\n }", "public function getAllAttributes();", "public function findByAttributes(array $attributes);", "public function findByAttributes(array $attributes);", "public static function getSearchableAttributes(): array;", "abstract public function findAllByAttributes(array $attributes, $fields = false, $order = false);", "public function findAll()\n {\n return $this->model->with(['user'])->get();\n }", "public function getAllModel(){\n\t\t//prx($this->Modelo->find('all',array('contain' => array('ImagenModelo'))));\n\t\treturn $this->Modelo->find('all',array('contain' => array('ImagenModelo')));\n\n\t}", "public function attributes()\n {\n $this->prepare($this->adapter->attributes($this->table));\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }", "public function getall()\n {\n $model = $this->getModel();\n return $model;\n }", "public function findAll()\n {\n return $this->createModel()->newQuery()->get()->all();\n }", "public function getAllFinder()\n {\n return $this->model->finder()->with(['userDetail', 'company'])->get();\n }", "private function findModels()\n {\n $this->models = array();\n foreach ($this->methods as $func) {\n $matches = array();\n for ($i = $func['start']; $i <= $func['end']; $i++) {\n // A model is assigned and not ignored with tag @checkForgetMe\n if (preg_match_all('/\\$([a-zA-Z_]+)\\s*=\\s*ORM::factory\\([\\'\"]([a-zA-Z_]+)[\\'\"]/',\n $this->content[$i], $matches) > 0\n && strpos($this->content[$i], \"@checkForgetMe\") === FALSE) {\n for ($j = 0; $j < sizeof($matches[0]); $j++) {\n $orm = ORM::factory($matches[2][$j]);\n \n // Create data structure\n $this->models[] = array(\n \"var\" => $matches[1][$j],\n \"model\" => $matches[2][$j],\n \"start\" => $i,\n \"end\" => $func['end'],\n \"columns\" => array_keys($orm->table_columns()),\n \"relationships\" => array_merge(array_keys($orm->belongs_to()),\n array_keys($orm->has_many()),\n array_keys($orm->has_one())),\n \"update\" => false,\n \"insert\" => false\n );\n }\n }\n }\n }\n }", "public function getAll()\n {\n $model = $this->model;\n return $model::all();\n }", "public function all()\n {\n return $this->model->get();\n }", "public function all()\n {\n return $this->model->get();\n }", "public function all()\n {\n return $this->model->get();\n }", "public function getAll()\n {\n return $this->model->get();\n }", "protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$db_feilds as $field) {\n\t if(property_exists($this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n\t}", "protected function searchedAttributes()\n {\n return $this->_searchedAttrs;\n }", "public static function getAllModel() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->get('name','slug');\n }", "protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach(static::$db_fields as $field) {\n\t \tif(property_exists($this, $field)) {\n\t \t\t$attributes[$field] = $this->$field;\n\t \t}\n\t\t}\n\t\treturn $attributes;\n\t}", "public function get_all()\n\t{\n\t\treturn $this->model->get_all();\n\t}", "public function allAttributes()\n {\n $id = $this->id;\n if (empty($id)) {\n $id = 0;\n }\n $b = DB::raw('SELECT * FROM product_attributes LEFT JOIN ( SELECT product_product_attribute.`product_id`, product_product_attribute.`attr_value`, product_product_attribute.`product_attribute_id` FROM product_product_attribute LEFT JOIN products ON product_product_attribute.`product_id` = products.id WHERE `product_id` = ' . $id . ') as a ON a.`product_attribute_id` = product_attributes.id ORDER BY id');\n return DB::select($b);\n //TODO переделать в норм запрос\n }", "public function getAllAttributes()\n {\n $query = $this->pdo->prepare(\"SELECT id,name,created_at,updated_at from attribute\");\n $query->execute();\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n $attributes= [];\n foreach ($row as $r) {\n array_push($attributes, $this->mapArrayToAttributes($r));\n }\n return $attributes;\n }", "public function modelAttributes()\n {\n return Manager::modelAttributes(static::class);\n }", "protected function attributes() {\n $attributes = array();\n foreach(static::$table_fields as $field) {\n if(property_exists($this, $field)) {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }", "public function getAll()\n {\n return $this->model->get();\n }" ]
[ "0.70391333", "0.6855991", "0.67079365", "0.67079365", "0.6634937", "0.6551718", "0.6415295", "0.63881147", "0.63381773", "0.6296262", "0.6271872", "0.627175", "0.6263445", "0.6247571", "0.6233356", "0.6233356", "0.6233356", "0.621433", "0.6202822", "0.6201693", "0.61835015", "0.61720794", "0.6163013", "0.6162354", "0.6151194", "0.6140982", "0.61253303", "0.6113248", "0.61131155", "0.6110302" ]
0.7148144
0
Find all models with attributes and sorted by $sort with $dir
function findAllBySorted(array $attributes, $sort = 'id', $dir = 'asc');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAllByPaginatedSorted(array $attributes, $perPage = 20, $sort = 'id', $dir = 'asc');", "function findAllSorted($sort = 'id', $dir = 'asc');", "public function getAllSortedByName()\n {\n return $this->model->orderBy('name')->get();\n }", "public function getModelFiles() {\n $models = array();\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->__modelsDir), 2) as $path) {\n if (!$path->isDir() && $path && substr($path=(string)$path, -1) !== '.') {\n $path = (string)$path;\n $part = pathinfo($path);\n if (isset($part['extension']) && isset($part['filename']) && strtolower($part['extension']) === 'php') {\n $models[$model=$part['filename']] = $path;\n if (isset($this->__modify[$model])) {\n $this->__modify[$model][1] = filemtime($path);\n } else {\n $this->__modify[$model] = array(-2, filemtime($path));\n }\n }\n }\n }\n /* add models to autoload */\n Arta::$autoload[] = $this->__modelsDir;\n foreach ($models as $path) {\n Arta::$autoload[] = pathinfo($path, PATHINFO_DIRNAME);\n }\n Arta::$autoload = array_unique(Arta::$autoload);\n /* filter model classes */\n $realModels = array();\n foreach ($models as $name => $path) {\n if (!class_exists($name)) {\n continue;\n }\n\n $class = new ReflectionClass($name);\n if ($class->isAbstract()) {\n continue;\n }\n\n $mObj = new $name();\n if (!($mObj instanceof Model) || !isset($mObj->__instanceId__)) {\n continue;\n }\n\n $realModels[$name] = $path;\n }\n /* * */\n return $realModels;\n }", "private function findModels()\n {\n $this->models = array();\n foreach ($this->methods as $func) {\n $matches = array();\n for ($i = $func['start']; $i <= $func['end']; $i++) {\n // A model is assigned and not ignored with tag @checkForgetMe\n if (preg_match_all('/\\$([a-zA-Z_]+)\\s*=\\s*ORM::factory\\([\\'\"]([a-zA-Z_]+)[\\'\"]/',\n $this->content[$i], $matches) > 0\n && strpos($this->content[$i], \"@checkForgetMe\") === FALSE) {\n for ($j = 0; $j < sizeof($matches[0]); $j++) {\n $orm = ORM::factory($matches[2][$j]);\n \n // Create data structure\n $this->models[] = array(\n \"var\" => $matches[1][$j],\n \"model\" => $matches[2][$j],\n \"start\" => $i,\n \"end\" => $func['end'],\n \"columns\" => array_keys($orm->table_columns()),\n \"relationships\" => array_merge(array_keys($orm->belongs_to()),\n array_keys($orm->has_many()),\n array_keys($orm->has_one())),\n \"update\" => false,\n \"insert\" => false\n );\n }\n }\n }\n }\n }", "abstract public function findAllByAttributes(array $attributes, $fields = false, $order = false);", "public function default_sorting_based_on_model_fields(): void\n {\n $request = $this->makeRequestWithSort(\n [\n ['field' => 'title'],\n ]\n );\n\n $postA = factory(Post::class)->create(['title' => 'post A']);\n $postB = factory(Post::class)->create(['title' => 'post B']);\n $postC = factory(Post::class)->create(['title' => 'post C']);\n\n $query = Post::query();\n\n $queryBuilder = new QueryBuilder(\n Post::class,\n new ParamsValidator([], [], ['title']),\n new RelationsResolver([], []),\n new SearchBuilder([])\n );\n $queryBuilder->applySortingToQuery($query, $request);\n\n $posts = $query->get();\n\n $this->assertEquals($postA->id, $posts[0]->id);\n $this->assertEquals($postB->id, $posts[1]->id);\n $this->assertEquals($postC->id, $posts[2]->id);\n }", "function findAllBy(array $attributes);", "function findAllPaginatedSorted($perPage = 20, $sort = 'id', $dir = 'asc');", "public function getByAttributes(array $attributes, $orderBy = null, $sortOrder = 'asc');", "public function getByAttributes(array $attributes, $orderBy = null, $sortOrder = 'asc');", "function GetAllModels()\n\t{\n\t}", "public static function get_all($order_by_attr, $asc = \"1\", $limit = null)\n { }", "public static function listAllByAttributes($className,$attributes)\n\t{\n\t $lang = Yii::app()->language;\n $models = $className::model()->findAllByAttributes($attributes);\n $pk = $className::model()->tableSchema->primaryKey;\n // format models resulting using listData \n $list = CHtml::listData($models, $pk, 'name_'.$lang);\n return $list;\n\t}", "public function getSorts();", "public function getAll()\n {\n return $this->model->all()->sortByDesc(\"id\");\n }", "public function getAllModel(){\n\t\t//prx($this->Modelo->find('all',array('contain' => array('ImagenModelo'))));\n\t\treturn $this->Modelo->find('all',array('contain' => array('ImagenModelo')));\n\n\t}", "public function all($model)\n\t\t{\n\t\t\t$properties = implode(',', array_keys($model->getProperties()));\n\t\t\t$sql = \"\";\n\t\t\t$page = isset($_GET[\"page\"])&&is_numeric($_GET[\"page\"])&&$_GET[\"page\"]>0 ? ($_GET[\"page\"]-1) : 0;\n\t\t\tif($page >= 0 && $this->table==\"dat\" ){\n\t\t\t\t$page = $page * $this->data ;\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc limit $page, $this->data \";\n\t\t\t}\n\t\t\telse $sql = \"SELECT {$properties} FROM {$this->table}\";\n\t\t\tif($this->data==''){\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc\";\n\t\t\t}\n\t\t\t$req = Database::getBdd()->prepare($sql);\n\t\t\t$req->execute();\n\t\t\treturn $req->fetchAll(PDO::FETCH_OBJ);\n\t\t}", "public function sorts()\n\t{\n\t\treturn [$this->name, $this->fillableName];\n\t}", "public function admin_getAllModel(){\n\n\t}", "public static function getAllModel() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "public function findAll()\n {\n return $this->findBy(array(), array('name'=>'ASC'));\n }", "public function testFindSort() {\n\t\t$data = [\n\t\t\t'fk_id' => 1,\n\t\t\t'fk_model' => 'Muffins',\n\t\t\t'tag' => [\n\t\t\t\t'label' => 'Awesome',\n\t\t\t\t'slug' => 'awesome',\n\t\t\t],\n\t\t];\n\t\t$tagged = $this->Tagged->newEntity($data);\n\t\t$this->Tagged->save($tagged);\n\n\t\t$result = $this->Tagged->find()\n\t\t\t->contain('Tags')\n\t\t\t->where(['fk_id' => 1, 'fk_model' => 'Muffins'])\n\t\t\t->all()\n\t\t\t->toArray();\n\n\t\t$tags = Hash::extract($result, '{n}.tag.label');\n\t\t$ids = Hash::extract($result, '{n}.tag_id');\n\n\t\t$this->assertSame(['Awesome', 'Color', 'Dark Color'], $tags);\n\t\t$this->assertSame([3, 1, 2], $ids);\n\t}", "public function sortquery( $p_dir ) {}", "public static function setSortElements() {\n $sortable = ['brand', 'model', 'available', 'min_cost', 'max_cost'];\n $result = DB::select('alias')->from('specifications')->where('status', '=', 1)->order_by('alias')->find_all();\n foreach($result AS $obj) {\n $sortable[] = $obj->alias;\n }\n Config::set('sortable', $sortable);\n }", "function findAllByPaginated(array $attributes, $perPage = 20);", "public static function setSortElements() {\n $sortable = array('brand', 'model', 'available', 'min_cost', 'max_cost', 'size');\n $result = DB::select('alias')->from('specifications')->order_by('alias')->as_object()->execute();\n foreach($result AS $obj) {\n $sortable[] = $obj->alias;\n }\n conf::set('sortable', $sortable);\n }", "function includeModels() {\n $directory = opendir(MODELS);\n while($file = readdir($directory)) {\n if(!is_dir($file)) {\n require_once MODELS . $file;\n }\n }\n }", "public function getAllFinder()\n {\n return $this->model->finder()->with(['userDetail', 'company'])->get();\n }", "public function sort()\n {\n $this->repository->sort(Input::all());\n }" ]
[ "0.6592493", "0.65896547", "0.610396", "0.59381783", "0.5916944", "0.58145595", "0.57012683", "0.5691563", "0.5665651", "0.56565756", "0.56565756", "0.5527939", "0.5489473", "0.54893184", "0.54499257", "0.54193056", "0.5387152", "0.5375199", "0.5365871", "0.5332809", "0.5325684", "0.5301891", "0.5272924", "0.52684313", "0.52064496", "0.5189719", "0.517691", "0.51618886", "0.51368594", "0.51310444" ]
0.7381319
0
Find all models with attributes and paginated
function findAllByPaginated(array $attributes, $perPage = 20);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllPaginated()\n {\n }", "public function findAll() : LengthAwarePaginator;", "function findAllPaginated($perPage = 20);", "public function getAll($paginate, $orderBy);", "function findAllByPaginatedSorted(array $attributes, $perPage = 20, $sort = 'id', $dir = 'asc');", "public function getAll(){\n $query = $this->query()\n ->orderBy('id', 'desc')\n ->paginate(sysdef()->name('pagination_low'));\n return $query;\n }", "public function all($model)\n\t\t{\n\t\t\t$properties = implode(',', array_keys($model->getProperties()));\n\t\t\t$sql = \"\";\n\t\t\t$page = isset($_GET[\"page\"])&&is_numeric($_GET[\"page\"])&&$_GET[\"page\"]>0 ? ($_GET[\"page\"]-1) : 0;\n\t\t\tif($page >= 0 && $this->table==\"dat\" ){\n\t\t\t\t$page = $page * $this->data ;\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc limit $page, $this->data \";\n\t\t\t}\n\t\t\telse $sql = \"SELECT {$properties} FROM {$this->table}\";\n\t\t\tif($this->data==''){\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc\";\n\t\t\t}\n\t\t\t$req = Database::getBdd()->prepare($sql);\n\t\t\t$req->execute();\n\t\t\treturn $req->fetchAll(PDO::FETCH_OBJ);\n\t\t}", "public function showAll()\n {\n $model = $this->newModel();\n\n return $model->orderBy('created_at', 'desc')\n ->paginate(10, ['*']);\n }", "public function getPaginatedRecords()\n {\n return User::orderBy('id', 'desc')->paginate(10);\n }", "public function findAllPaginated($perPage = 200);", "public function findAll();", "public function findAll();", "public function findAll();", "public function findAll();", "public function findAll();", "public function findAll();", "public function findAll();", "public function findAll();", "public function findAll();", "public function paginate();", "public function findAllPaginated($perPage = 20, array $orderBy = ['id', 'asc'], array $columns = ['*']);", "public function getAllPaginate()\n {\n $organization = Organization::paginate(); // default 15 per page\n return response()->json(compact('organization'),200);\n }", "public function findAllPaginated($perPage=10)\n\t{\n\t\treturn $this->model->orderBy('created_at', 'DESC')->paginate($perPage);\n\t}", "function findItems(\\IMozambiquePagination $pagination = NULL);", "public static function findAll();", "public function findAll($limit, $offset);", "public function getAll (){\n extract( $this->kernel->params );\n\n $list = $this->kernel->db->getAll(\"SELECT * FROM {$this->table} WHERE {$this->filter[\"where\"]} $group_by $order_by LIMIT {$this->filter[\"start\"]}, {$this->filter[\"per_page\"]}\");\n\n return $list;\n\n }", "public function getAllWithPaginate($count = 10)\n {\n $columns = ['id', 'name', 'description'];\n\n $result = $this->startConditions()\n ->select($columns)\n //->with('roles:id,name')\n ->toBase()\n ->paginate($count);\n\n return $result;\n }", "public function findAll()\n {\n return $this->model->with(['user'])->get();\n }", "public function getData(){\n $result;\n\n // Get the query params\n $page = \\Input::get('page') ? \\Input::get('page') : 1;\n $per_page = \\Input::get('per_page') ? \\Input::get('per_page') : 100;\n $sort_by = \\Input::get('sort_by') == NULL ? NULL : \\Input::get('sort_by');\n $q = \\Input::get('q');\n $q_identifier = \\Input::get('q_identifier');\n $modelClass = \\Input::get('model');\n $modelClass = ucfirst($modelClass);\n $modelClass = 'App\\\\Models\\\\'.$modelClass;\n $with = \\Input::get('with');\n\n\n if(\\Input::get('model') == 'user'){\n $modelClass = 'App\\\\'.ucfirst(\\Input::get('model'));\n }\n\n $result = $modelClass::paginate($per_page);\n\n // Handle relation on Non Searching\n if($with){\n $result = $modelClass::with($with)->paginate($per_page);\n }\n\n\n // Handle searching based on keyword\n\n if($q){\n $result = $modelClass::where($q_identifier, 'like', '%'.$q.'%');\n\n // Handle relation on Searching\n if($with){\n $result = $modelClass::with($with)->where($q_identifier, 'like', '%'.$q.'%');\n }\n\n $result = $result->paginate($per_page);\n }\n\n\n return $result;\n }" ]
[ "0.7097155", "0.68947", "0.6869487", "0.6846561", "0.6829103", "0.672238", "0.66141623", "0.65499616", "0.6492293", "0.64896977", "0.6413132", "0.6413132", "0.6413132", "0.6413132", "0.6413132", "0.6413132", "0.6413132", "0.6413132", "0.6413132", "0.63997394", "0.63100207", "0.63002855", "0.62960815", "0.627349", "0.6251873", "0.62307227", "0.6229778", "0.6202775", "0.61727244", "0.6167943" ]
0.76075244
0
Find all models with attributes, paginated and sorted by $sort with $dir
function findAllByPaginatedSorted(array $attributes, $perPage = 20, $sort = 'id', $dir = 'asc');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAllBySorted(array $attributes, $sort = 'id', $dir = 'asc');", "function findAllPaginatedSorted($perPage = 20, $sort = 'id', $dir = 'asc');", "function findAllByPaginated(array $attributes, $perPage = 20);", "function findAllSorted($sort = 'id', $dir = 'asc');", "public static function get_all($order_by_attr, $asc = \"1\", $limit = null)\n { }", "public function all($model)\n\t\t{\n\t\t\t$properties = implode(',', array_keys($model->getProperties()));\n\t\t\t$sql = \"\";\n\t\t\t$page = isset($_GET[\"page\"])&&is_numeric($_GET[\"page\"])&&$_GET[\"page\"]>0 ? ($_GET[\"page\"]-1) : 0;\n\t\t\tif($page >= 0 && $this->table==\"dat\" ){\n\t\t\t\t$page = $page * $this->data ;\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc limit $page, $this->data \";\n\t\t\t}\n\t\t\telse $sql = \"SELECT {$properties} FROM {$this->table}\";\n\t\t\tif($this->data==''){\n\t\t\t\t$sql = \"SELECT {$properties} FROM {$this->table} order by id desc\";\n\t\t\t}\n\t\t\t$req = Database::getBdd()->prepare($sql);\n\t\t\t$req->execute();\n\t\t\treturn $req->fetchAll(PDO::FETCH_OBJ);\n\t\t}", "abstract public function findAllByAttributes(array $attributes, $fields = false, $order = false);", "public function getAll($paginate, $orderBy);", "public function getAllPaginated()\n {\n }", "function findAllPaginated($perPage = 20);", "function findAllBy(array $attributes);", "public function findAllPaginated($perPage = 20, array $orderBy = ['id', 'asc'], array $columns = ['*']);", "function findItems(\\IMozambiquePagination $pagination = NULL);", "public function getByAttributes(array $attributes, $orderBy = null, $sortOrder = 'asc');", "public function getByAttributes(array $attributes, $orderBy = null, $sortOrder = 'asc');", "public static function paginate ($model)\n {\n $params = Util::getParams(func_get_args());\n $page_number = isset($params['page']) ? (int) $params['page'] : 1;\n $per_page = isset($params['per_page']) ? (int) $params['per_page'] : 20;\n //Si la pagina o por pagina es menor de 1 (0 o negativo)\n if ($page_number < 1 && $per_page < 1) {\n throw new KumbiaException(\"La página $page_number no existe en el paginador\");\n }\n $start = $per_page * ($page_number - 1);\n //Instancia del objeto contenedor de pagina\n $page = new stdClass();\n //Si es un array, se hace paginacion de array\n if (is_array($model)) {\n $items = $model;\n $n = count($items);\n //si el inicio es superior o igual al conteo de elementos,\n //entonces la página no existe, exceptuando cuando es la pagina 1\n if ($page_number > 1 && $start >= $n) {\n throw new KumbiaException(\"La página $page_number no existe en el paginador\");\n }\n $page->items = array_slice($items, $start, $per_page);\n } else {\n //Arreglo que contiene los argumentos para el find\n $find_args = array();\n $conditions = null;\n //Asignando parametros de busqueda\n if (isset($params['conditions'])) {\n $conditions = $params['conditions'];\n } elseif (isset($params[1])) {\n $conditions = $params[1];\n }\n if (isset($params['columns'])) {\n $find_args[] = \"columns: {$params['columns']}\";\n }\n if (isset($params['join'])) {\n $find_args[] = \"join: {$params['join']}\";\n }\n if (isset($params['group'])) {\n $find_args[] = \"group: {$params['group']}\";\n }\n if (isset($params['having'])) {\n $find_args[] = \"having: {$params['having']}\";\n }\n if (isset($params['order'])) {\n $find_args[] = \"order: {$params['order']}\";\n }\n if (isset($params['distinct'])) {\n $find_args[] = \"distinct: {$params['distinct']}\";\n }\n if (isset($conditions)) {\n $find_args[] = $conditions;\n }\n //contar los registros\n $n = $model->count($conditions);\n //si el inicio es superior o igual al conteo de elementos,\n //entonces la página no existe, exceptuando cuando es la pagina 1\n if ($page_number > 1 && $start >= $n) {\n throw new KumbiaException(\"La página $page_number no existe en el paginador\");\n }\n //Asignamos el offset y limit\n $find_args[] = \"offset: $start\";\n $find_args[] = \"limit: $per_page\";\n //Se efectua la busqueda\n $page->items = call_user_func_array(array($model , 'find'), $find_args);\n }\n //Se efectuan los calculos para las paginas\n $page->next = ($start + $per_page) < $n ? ($page_number + 1) : false;\n $page->prev = ($page_number > 1) ? ($page_number - 1) : false;\n $page->current = $page_number;\n $page->total = ceil($n / $per_page);\n $page->count = $n;\n $page->per_page = $per_page;\n return $page;\n }", "public function default_sorting_based_on_model_fields(): void\n {\n $request = $this->makeRequestWithSort(\n [\n ['field' => 'title'],\n ]\n );\n\n $postA = factory(Post::class)->create(['title' => 'post A']);\n $postB = factory(Post::class)->create(['title' => 'post B']);\n $postC = factory(Post::class)->create(['title' => 'post C']);\n\n $query = Post::query();\n\n $queryBuilder = new QueryBuilder(\n Post::class,\n new ParamsValidator([], [], ['title']),\n new RelationsResolver([], []),\n new SearchBuilder([])\n );\n $queryBuilder->applySortingToQuery($query, $request);\n\n $posts = $query->get();\n\n $this->assertEquals($postA->id, $posts[0]->id);\n $this->assertEquals($postB->id, $posts[1]->id);\n $this->assertEquals($postC->id, $posts[2]->id);\n }", "public function findAllPaginated($perPage=10)\n\t{\n\t\treturn $this->model->orderBy('created_at', 'DESC')->paginate($perPage);\n\t}", "public function findByPage($page = 1, $limit = 10, $with = array(), $sortField = 'created_at', $sortDir = 'desc') {\n //create empty object\n $results = new StdClass();\n //push parameters into results object\n $results->page = $page;\n $results->limit = $limit;\n $results->totalItems = 0;\n $results->items = array();\n //eager load any desired relationships\n $query = $this->make($with);\n //query the data with the parameters\n $posts = $query->orderBy($sortField, $sortDir)->skip($limit * ($page - 1))->take($limit)->get();\n //add the total items to the results\n $results->totalItems = $this->model->count();\n //add the data to the results\n $results->items = $posts->all();\n return $results;\n }", "protected function fetchData()\n {\n $criteria=clone $this->getCriteria();\n if(($pagination=$this->getPagination())!==false)\n {\n $pagination->setItemCount($this->getTotalItemCount());\n $pagination->applyLimit($criteria);\n }\n if(($sort=$this->getSort())!==false)\n $sort->applyOrder($criteria);\n\n if ($this->together)\n {\n $class = $this->modelClass;\n $models = $class::model()\n ->cache($this->cachetime, $this->dependency)\n ->findAll($criteria);\n\n $list = array();\n foreach ($models as $model)\n $list[] = $model->primaryKey;\n\n foreach ($this->model->relations() as $name=>$relation) {\n // TODO пока берем все MANY_MANY\n if ($relation[0] == 'CHasManyRelation') {\n $class = new $relation[1];\n $criteria = new CDbCriteria();\n $criteria->addInCondition($relation[2], $list);\n $items = $class::model()->cache($this->cachetime, $this->dependency)->findAll($criteria);\n\n // распихиваем отношения по моделям\n foreach ($models as $model) {\n $relatedModels = array();\n // TODO: оптимизировать - найденное исключать\n foreach ($items as $item)\n if ($item->$relation[2] == $model->primaryKey)\n $relatedModels[] = $item;\n $model->$name = $relatedModels;\n }\n }\n }\n return $models;\n } else {\n return CActiveRecord::model($this->modelClass)->findAll($criteria);\n }\n }", "public function getAllSortedByName()\n {\n return $this->model->orderBy('name')->get();\n }", "public function getAll(){\n $query = $this->query()\n ->orderBy('id', 'desc')\n ->paginate(sysdef()->name('pagination_low'));\n return $query;\n }", "public function listing($dn, $filter, array $attributes, $onlyAttributes = false, $size = 0, $time = 0);", "public function index()\n\t{\n\t\t$search = (null !== \\Input::get('search')) ? \\Input::get('search') : \"\";\n\t\t$structure = $this->structure;\n\t\t$searchableField = isset($structure['searchable_fields'])? $structure['searchable_fields'] : 'name';\n\t\t$required = array();\n\t\t$models = array();\n\t\t$rows = array();\n\t\t$paginate = (!empty($this->paginate)) ? $this->paginate : 20;\n\n\n\t\tif(strlen($search) >= 0) {\n\t\t\tif(isset($structure['index']['self'])) {\n\t\t\t\tif (is_array($structure['index']['self'])) {\n\t\t\t\t\tforeach ($structure['index']['self'] as $self => $title) {\n\t\t\t\t\t\t$required[$self]['title'] = $title;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($structure['index']['relations'])) {\n\t\t\t\tif (is_array($structure['index']['relations'])) {\n\t\t\t\t\tforeach ($structure['index']['relations'] as $relation => $array) {\n\t\t\t\t\t\tforeach ($array as $key => $value) {\n\t\t\t\t\t\t\t$required[$relation.'.'.$key]['title'] = $value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$relations[] = $relation;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$paginatedModels = new $structure['model'];\n\n\t\t\tif(isset($relations)) {\n\t\t\t\t$paginatedModels = $paginatedModels::with($relations);\n\t\t\t}\n\n\t\t\tif(is_array($searchableField)) {\n\t\t\t\t$paginatedModels = $paginatedModels->where($searchableField[0], 'LIKE', \"%$search%\");\n\t\t\t\tunset($searchableField[0]);\n\n\t\t\t\tforeach ($searchableField as $field) {\n\t\t\t\t\t$paginatedModels = $paginatedModels->orWhere($field, 'LIKE', \"%$search%\");\n\t\t\t\t}\t\t\t\n\t\t\t} else {\n\t\t\t\t$paginatedModels = $paginatedModels->where($searchableField, 'LIKE', \"%$search%\");\n\t\t\t}\n\n\t\t\t$paginatedModels = $paginatedModels->orderBy('id', 'desc')->paginate($paginate);\n\t\t\t$models = $paginatedModels->items();\n\n\t\t\tforeach ($models as $key => $model) {\n\t\t\t\t$models[$key]->revealHidden();\n\t\t\t}\n\n\t\t\tlist($required_keys) = array_divide($required);\n\n\t\t\tforeach ($models as $model_key => $model) {\n\t\t\t\tforeach ($required_keys as $required_key) {\n\t\t\t\t\t$title = $required[$required_key]['title'];\n\t\t\t\t\t$value = $model->$required_key;\n\n\t\t\t\t\tif (!isset($value)) {\n\t\t\t\t\t\t$address = explode('.', \"$required_key\");\n\n\t\t\t\t\t\tif(is_array($model[$address[0]])) {\n\t\t\t\t\t\t\tforeach ($model[$address[0]] as $sub) {\n\t\t\t\t\t\t\t\t$value .= array_get($sub, $address[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\t$rows[array_get($model, 'id')][$title] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn \\View::make($this->view['index'])->with(array('rows' => $rows, 'search' => $search, 'structure' => $structure, 'pagination' => $paginatedModels));\n\t}", "public function findAllPaginated($perPage = 200);", "public function sortquery( $p_dir ) {}", "public function getAll()\n {\n return $this->model->all()->sortByDesc(\"id\");\n }", "public function findAll() : LengthAwarePaginator;", "public function listAndPaginate($columns = array('*'), $per_page = 10) {\n return $this->model->orderBy('id', 'desc')\n // ->paginate($per_page, $columns);\n ->get($columns);\n }", "function GetAllModels()\n\t{\n\t}" ]
[ "0.7427528", "0.6964934", "0.6859948", "0.67105377", "0.6231279", "0.6194625", "0.611626", "0.6069643", "0.5881684", "0.5824609", "0.5767459", "0.5732932", "0.57079035", "0.56863654", "0.56863654", "0.5613837", "0.5610837", "0.55867654", "0.5582756", "0.5571354", "0.55093515", "0.550653", "0.5502055", "0.5485969", "0.5426236", "0.54001224", "0.53868663", "0.53552926", "0.5349615", "0.53270525" ]
0.77712184
0
Batch deletes all models within $ids
function deleteInBatch(array $ids);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteMultiple(array $ids = []);", "public function deleteMultiple(array $ids = []);", "function del_all(){\n\t\t\t$ids = $this->input->post('ids');\n\t\t\tforeach($ids as $id){\n\t\t\t\t$this->_del($id, false);\n\t\t\t}\n\n\t\t}", "public function actionBatchDelete()\n {\n if (($ids = Yii::$app->request->post('ids')) !== null) {\n $models = $this->findModel($ids);\n foreach ($models as $model) {\n $model->deleteComment();\n }\n return $this->redirect(['index']);\n } else {\n throw new HttpException(400);\n }\n }", "public function actionBulkAction()\n {\n if (Yii::$app->request->post('action') == 'deleted') {\n foreach (Yii::$app->request->post('ids', []) as $id) {\n $this->findModel($id)->delete();\n }\n }\n }", "function delete_all(){\n $ids = $this->input->post('ids');\n foreach ($ids as $id_product){\n $this->_del($id_product);\n }\n\n }", "public function deletes(array $ids);", "public function deleteByIds(array $ids);", "public function deleteByIds(array $ids);", "protected function delete($items, $model)\n {\n foreach($items->chunk($this->batching_size) as $models) {\n $this->cloudSearcher->delete($models->pluck('entry_id'));\n }\n }", "public function destroyMulti($ids){\n $idsArr = explode(\",\", $ids );\n foreach($idsArr as $id){\n $tag = Tag::find($id);\n if($tag != null){\n $rs = $tag -> delete();\n }\n }\n return $rs;\n }", "function release_delete_multiple(array $ids) {\n entity_delete_multiple('release', $ids);\n}", "public function delete_many($ids)\n {\n return $this->db->where_in($this->_primary_key, $ids)\n ->delete($this->_table);\n }", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Bid::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "protected function batchDelete($ids) {\n\t\t$em = $this->container->get('doctrine')->getManager();\n\n\t\t/**\n\t\t * @var QueryBuilder $qb\n\t\t */\n\t\t$qb = $em->createQueryBuilder();\n\t\t$qb\n\t\t\t->delete($this->getEntityClass(), 'o')\n\t\t\t->where(\n\t\t\t\t$qb->expr()->in('o.'. $this->getIdentifierProperty(), ':ids')\n\t\t\t)\n\t\t\t->setParameter('ids', $ids)\n\t\t;\n\n\t\t// We could/should do some tests on ids array size and effective number of deletion\n\t\t$numDeletion = $qb->getQuery()->execute();\n\n\t\tif($numDeletion > 0) {\n $this->addFlash(\n 'success',\n $this->get('translator')->trans('sfs.admin.message.batch.delete_success', array())\n );\n }\n else {\n $this->addFlash(\n 'error',\n $this->get('translator')->trans('sfs.admin.message.batch.delete_error', array())\n );\n }\n\n\t\treturn $this->redirect($this->generateUrl($this->getRoute('list')));\n\t}", "function removeByIds(array $ids);", "public function ajax_batch_delete(Request $request, $id)\n {\n foreach ($request->id as $id) {\n \n $categories = Category::find($id);\n Category::destroy($id);\n }\n echo 1;\n }", "public function deleteByObjectIds(array $ids) {\n\n }", "public function destroyMulti($ids){\n $idsArr = explode(\",\", $ids );\n foreach($idsArr as $id){\n $post = Post::find($id);\n if($post != null){\n $rs = $post -> delete();\n $rs2 = $post -> tags() -> detach();\n }\n }\n return $rs;\n }", "function admin_delete_multiple($id = null){\r\n $ids = array();\r\n foreach($this->data[$this->modelClass] as $record) {\r\n\t\t\tif($record != 0)\r\n\t\t\t\t$this->{$this->modelClass}->delete($record);\r\n\t}\r\n\t$this->redirect($this->referer());\r\n }", "function project_delete_multiple(array $ids) {\n entity_delete_multiple('project', $ids);\n}", "public function deleteMultiple($ids) {\n\n $counter = 0;\n\n if (count($ids = Tools::filter_pdigit_csv($ids))) {\n\n try {\n\n foreach($ids as $id) {\n $this->find($id)->delete();\n $counter++;\n }\n\n } catch (\\Exception $e) {\n\n return 0;\n\n }\n\n }\n\n return $counter;\n\n }", "public static function destroy($ids)\n {\n $ids = is_array($ids) ? $ids : func_get_args();\n $instance = new static();\n // We will actually pull the models from the database table and call delete on\n // each of them individually so that their events get fired properly with a\n // correct set of attributes in case the developers wants to check these.\n $key = $instance->getKeyName();\n foreach ($instance->whereIn($key, $ids)->get() as $model) {\n $model->delete();\n }\n }", "public function delete(array $ids);", "public function deleteMultiple($ids)\n {\n return $this->email_template->whereIn('id', $ids)->delete();\n }", "public function destroyMulti (Request $request)\n {\n \t$ids = $request->ids;\n DB::beginTransaction();\n try {\n \t\n \tforeach ($ids as $id) {\n \t\t$slideModel = $this->slideModel::findOrFail($id);\n \t\t_updateSortBy($this->slideModel, 1000000, $slideModel->sort_by);\n \t\t$slideModel->delete();\n \t}\n \tDB::commit();\n \treturn response()->json(['status' => false], 200);\n } catch (Exception $e) {\n \tDB::rollback();\n \treturn response()->json(['status' => false], 422);\n }\n }", "public function massDestroy(Request $request)\n {\n \n if ($request->input('ids')) {\n $entries = Pagos::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function actionDelete()\n {\n $models = explode(',', $this->models);\n $models = array_filter($models);\n\n foreach ($models as $model) {\n $model = trim($model);\n $model::deleteAllFromSearch();\n\n $this->stdout('All [' . $model . '] records have been deleted.');\n }\n }", "public function massDestroy(Request $request)\n\n {\n\n if ($request->input('ids')) {\n\n $entries = Site::whereIn('id', $request->input('ids'))->get();\n\n\n\n foreach ($entries as $entry) {\n\n $entry->delete();\n\n }\n\n }\n\n }", "public function batchdelete($arr) {\r\n\t\tfor($i=0;$i<sizeof($arr);$i++) {\r\n\t\t\t$arr1[$i] = array('id'=>$arr[$i]);\r\n\t\t}\r\n\t\treturn $this->tbl->where('id=:id')->batchdelete($arr1);\r\n\t}" ]
[ "0.76807636", "0.76807636", "0.7604687", "0.7483424", "0.72544336", "0.7251044", "0.7245541", "0.72454387", "0.72454387", "0.72085714", "0.7184732", "0.71598446", "0.7145067", "0.71264964", "0.7119827", "0.70996416", "0.7070197", "0.7067144", "0.7048562", "0.7032344", "0.7024181", "0.69863874", "0.6980037", "0.69725823", "0.69113374", "0.6878159", "0.68614227", "0.6856021", "0.68179584", "0.68040025" ]
0.793969
0
Updates all $models with $id
function update($model, $id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($models)\n {\n $this->setDB($models->first());\n\n $index = $this->xs->index;\n $models->map(function ($model) use ($index) {\n $array = $model->toSearchableArray();\n\n if (empty($array)) {\n return;\n }\n $array['xs_id'] = $model->getKey();\n $doc = new \\XSDocument;\n $doc->setFields($array);\n $index->update($doc);\n });\n $index->flushIndex();\n }", "public function update($models): void\n {\n $this->indexer->index($models);\n }", "public function update($models)\n {\n if ($models->isEmpty()) {\n return;\n }\n\n $config = $models->first();\n $type = $config->searchableAs();\n $index = \"$this->indexPrefix-$type\";\n\n $params = [\n 'index' => $index\n ];\n\n if (!$this->client->indices()->exists($params)) {\n $additionalParams = [];\n\n if ($indexSettings = $config->indexSettings()) {\n $additionalParams['body']['settings'] = $indexSettings;\n }\n\n if ($indexProperties = $config->indexProperties()) {\n $additionalParams['body']['mappings'][$type]['properties'] = $indexProperties;\n }\n\n $this->client->indices()->create(array_merge($params, $additionalParams));\n }\n\n foreach ($models as $model) {\n\n if (empty($searchableData = $model->toSearchableArray())) {\n return;\n }\n\n $objects['body'][] = [\n 'index' => [\n '_index' => $index,\n '_id' => $model->getSearchKey(),\n '_type' => $type\n ]\n ];\n\n $objects['body'][] = array_merge(['model' => get_class($model)], $searchableData);\n }\n\n if (!empty($objects)) {\n $this->client->bulk((array)$objects);\n }\n }", "public function update($models)\n {\n $index = $this->xunsearch->initIndex($models->first()->searchableAs());\n\n $models->map(function ($model) use ($index) {\n $array = $model->toSearchableArray();\n\n if (empty($array)) {\n return;\n }\n\n $doc = new \\XSDocument();\n $doc->setFields(array_merge([$model->getKeyName() => $model->getKey()], $array));\n $index->update($doc);\n });\n\n $index->flushIndex();\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\t\t$invoice = $model->invoice_number;\n\t\t$models = EbrSales::model()->getSalesByInvoice($model->invoice_number);\n\t\t$updatedModels = array();\n\t\t$allShops = Utilities::getShopsListForGroup($models[0]->group_id);\n\t\t//$invoicenumber = $models[0]->invoice_number;\n\t\tforeach($models as $j=>$sale){\n\t\t\t$previousQuantity[$j] = $sale->quantity;\n\t\t\t$previoudProduct[$j] = $sale->product_id;\n\t\t\t$previousVendor[$j] = $sale->vendor_id;\n\t\t\t$previousShop[$j] = $sale->shop_id;\n\t\t\t$product = EbrProducts::model()->findByPk($sale->product_id)->product_name;\n\t\t\t$vendor = EbrVendor::model()->findByPk($sale->vendor_id)->vendor_name;\n\t\t\t$models[$j]->client_id = EbrClient::model()->findByPk($sale->client_id)->client_name;\n\t\t\t$models[$j]->product_id = $product.','.$vendor;\n\t\t}\n\t\t\n\t\tif(isset($_POST['EbrSales']))\n\t\t{\n\t\t\tif(isset($_POST['rows']) && !empty($_POST['rows']) && empty($_POST['formSubmit'])){\n\t\t\t\t$rowsAdd =$_POST['rows'];\n\t\t\t\t$i=count($_POST['EbrSales']);\n\t\t\t\t$total = $i+$rowsAdd;\n\t\t\t\twhile($i<$total){\n\t\t\t\t\t$models[$i+1]=new EbrSales;\n\t\t\t\t\t$models[$i+1]->invoice_number = $invoice;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\n\t\t\t}else if(isset($_POST['rows']) && !empty($_POST['formSubmit']) ){\n\t\t\t\t$valid=true;\n\t\t\t\t$valid2=true;\n\t\t\t\t$valid3 = true;\n\t\t\t\t$group = $_POST['EbrSales'][0]['group_id'];\n\t\t\t\t$shop = $_POST['EbrSales'][0]['shop_id'];\n\t\t\t\t$client = '';\n\t\t\t\tif($_POST['EbrSales'][0]['client_id'])\n\t\t\t\t\t$client=Utilities::getClient($_POST['EbrSales'][0]['client_id']);\n\t\t\t\t\n\t\t\t\t$date = $_POST['EbrSales'][0]['sales_date'];\n\t\t\t\t$i=0;\n\t\t\t\tforeach ($_POST['EbrSales'] as $j=>$sale) {\n\t\t\t\t\tif (isset($_POST['EbrSales'][$j])) {\n\t\t\t\t\t\t$updatedModels[$j]=$this->loadModel($_POST['EbrSales'][$j]['sale_id']);; // if you had static model only\n\t\t\t\t\t\t$updatedModels[$j]->attributes=$sale;\n\t\t\t\t\t\t$str = array();\n\t\t\t\t\t\t$productEntered[$j] = $updatedModels[$j]->product_id;\n\t\t\t\t\t\t$clientEntered[$j] = $updatedModels[$j]->client_id;\n\t\t\t\t\t\tif(isset($models[$j]->product_id)){\n\t\t\t\t\t\t\t$str = explode(',',$updatedModels[$j]->product_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($str[0]))\n\t\t\t\t\t\t\t$product = $str[0];\n\t\t\t\t\t\tif(isset($str[1]))\n\t\t\t\t\t\t\t$vendor = $str[1];\n\t\t\t\t\t\tif(isset($vendor))\n\t\t\t\t\t\t\t$updatedModels[$j]->vendor_id= Utilities::getVendorId($vendor);\n\t\t\t\t\t\tif(isset($product))\n\t\t\t\t\t\t\t$updatedModels[$j]->product_id=Utilities::getProductId($product);\n\t\t\t\t\t\t$updatedModels[$j]->invoice_number = $invoice;\n\t\t\t\t\t\t$updatedModels[$j]->group_id=$group;\n\t\t\t\t\t\t$updatedModels[$j]->shop_id=$shop;\n\t\t\t\t\t\t$updatedModels[$j]->client_id=$client;\n\t\t\t\t\t\t$updatedModels[$j]->sales_date=$date;\n\t\t\t\t\t\t$valid=$updatedModels[$j]->validate() && $valid;\n\t\t\t\t\t\tif($valid){\n\t\t\t\t\t\t\tif($previoudProduct[$j] == $updatedModels[$j]->product_id && $previousShop[$j] == $updatedModels[$j]->shop_id && $previousVendor[$j] == $updatedModels[$j]->vendor_id){\n\t\t\t\t\t\t\t\t$valid = EbrStock::model()->checkAndUpdateStock($updatedModels[$j]->product_id, $updatedModels[$j]->shop_id, $updatedModels[$j]->vendor_id, $updatedModels[$j]->quantity,$previousQuantity[$j]);\n\t\t\t\t\t\t\t\tif($valid == 'quantityFail'){\n\t\t\t\t\t\t\t\t\t//$model->addErrors('Invalid Quantity');\n\t\t\t\t\t\t\t\t\t$valid2 = false;\n\t\t\t\t\t\t\t\t\t$updatedModels[$j]->addError('quantity', 'Quantity not available');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$valid = EbrStock::model()->checkAndLessStock($updatedModels[$j]->product_id, $updatedModels[$j]->shop_id, $updatedModels[$j]->vendor_id, $updatedModels[$j]->quantity);\n\t\t\t\t\t\t\t\tif($valid == 'quantityFail'){\n\t\t\t\t\t\t\t\t\t//$model->addErrors('Invalid Quantity');\n\t\t\t\t\t\t\t\t\t$valid2 = false;\n\t\t\t\t\t\t\t\t\t$updatedModels[$j]->addError('quantity', 'Quantity not available');\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tEbrStock::model()->addStockandLessSale($previoudProduct[$j], $previousShop[$j], $previousVendor[$j], $previousQuantity[$j]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($valid && $valid2){\n\t\t\t\t\t\t\t$validModel[$i]=$updatedModels[$j];\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($valid && $valid2) {\n\t\t\t\t\t$i=0;\n\t\t\t\t\t$j=count($validModel);\n\t\t\t\t\twhile ($i<$j) {\n\t\t\t\t\t\t$validModel[$i]->save(false);// models have already been validated\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t// anything else that you want to do, for example a redirect to admin page\n\t\t\t\t\tYii::app()->user->setFlash('printInvoice','Sales created succesfully with Invoice Number'.$invoice);\n\t\t\t\t\t$this->redirect(array('invoice/invoiceNumber','invoiceNumber'=>$invoice));\n\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tforeach ($_POST['EbrSales'] as $j=>$sale) {\n\t\t\t\t\t\tif (isset($_POST['EbrSales'][$j])) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$updatedModels[$j]->product_id = $productEntered[$j];\n\t\t\t\t\t\t\t\t$updatedModels[$j]->client_id = $clientEntered[$j];\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\t\n\t\t\t\t$models = $updatedModels;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->render('multipleEdit',array('items'=>$models,\n\t\t\t\t'invoice'=>$invoice,\n\t\t\t\t'model'=>$model,\n\t\t\t\t'allShops'=>$allShops\n\t\t));\n\t\t\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $user_id = Yii::$app->user->identity->id;\n $returnCompanySeller = UserCompany::find()->where(['user_id'=>$user_id])->one();\n\n $companySeller = Company::find()->where(['_id'=>$returnCompanySeller->company])->one();\n\n $checkState = LookupState::find()->where(['id'=>$companySeller->state])->one();\n\n $model2 = ItemElastic::find()->where(['mongo_id'=>(string)$model->_id])->one();\n\n if ($model->load(Yii::$app->request->post())) {\n\n\n\n\n $model->date_update = date('Y-m-d H:i:s');\n $model->update_by = (int)Yii::$app->user->identity->id;\n $model->shippings = [[\n 'aTa' => $_POST['Item']['shippings']['aTa'],\n 'aTb' => $_POST['Item']['shippings']['aTb'],\n ]];\n $model->installations = [[\n 'installation' => $_POST['Item']['installations']['installation'],\n 'installation_price' => $_POST['Item']['installations']['installation_price'],\n ]];\n\n\n\n $model->save();\n\n $group = LookupGroup::find()->where(['id'=>$_POST['Item']['group_id']])->one();\n $brand = LookupBrand::find()->where(['id'=>$_POST['Item']['brand_id']])->one();\n $category = LookupCategory::find()->where(['id'=>$_POST['Item']['category_id']])->one();\n $sub_category = LookupSubCategory::find()->where(['id'=>$_POST['Item']['sub_category_id']])->one();\n $models = LookupModel::find()->where(['id'=>$_POST['Item']['model_id']])->one();\n $lead_time = LookupLeadTime::find()->where(['id'=>$_POST['Item']['lead_time_id']])->one();\n\n $model2->item_name = $_POST['Item']['item_name'];\n $model2->group = $group->group;\n $model2->brand = $brand->brand;\n $model2->category = $category->category;\n $model2->sub_category = $sub_category->sub_category;\n $model2->model = $models->model;\n $model2->description = $_POST['Item']['description'];\n $model2->specification = $_POST['Item']['specification'];\n $model2->lead_time = $lead_time->lead_time;\n $model2->cost = $_POST['Item']['cost'];\n $model2->stock = $_POST['Item']['stock'];\n $model2->quantity = $_POST['Item']['quantity'];\n $model2->publish = $_POST['Item']['publish'];\n $model2->date_update = date('Y-m-d H:i:s');\n $model2->update_by = (int)Yii::$app->user->identity->id;\n $model2->save();\n\n\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'checkState' => $checkState\n ]);\n }\n }", "abstract public function update($model);", "public function actionUpdate($id)\n {\n $model_img = new UploadImage();\n $model = $this->findModel($id);\n $modelsPhone = $model->phones;\n $model_img->img = $model->img;\n if ($model->load(Yii::$app->request->post())) {\n\n $oldIDs = ArrayHelper::map($modelsPhone, 'id', 'id');\n $modelsPhone = Model::createMultiple(Phone::classname(), $modelsPhone);\n Model::loadMultiple($modelsPhone, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelsPhone, 'id', 'id')));\n\n // validate all models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsPhone) && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n if (!empty($deletedIDs)) {\n Phone::deleteAll(['id' => $deletedIDs]);\n }\n foreach ($modelsPhone as $modelPhone) {\n $modelPhone->name_id = $model->id;\n if (! ($flag = $modelPhone->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n $url = Url::previous(Yii::$app->controller->id.'_update');\n return $this->redirect(isset($url) ? $url : ['index']);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n Url::remember(Yii::$app->request->referrer,Yii::$app->controller->id.'_update');\n return $this->render('update', [\n 'model' => $model,\n 'model_img' => $model_img,\n 'modelsPhone' => (empty($modelsPhone)) ? [new Phone()] : $modelsPhone\n ]);\n }", "public function updateById();", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $temp = explode(',',$model->rate);\n $i =0;\n $modelsRate = [];\n foreach ($temp as $key => $value) {\n $modelsRate[$i++] = $this->findModelRate($value);\n }\n if ($model->load(Yii::$app->request->post())) {\n $oldIDs = ArrayHelper::map($modelsRate, 'rate_id', 'rate_id');\n $modelsRate = Model::createMultiple(Rate::classname(),$modelsRate);\n Model::loadMultiple($modelsRate, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelsRate, 'rate_id', 'rate_id')));\n // var_dump($modelsRate);\n //die();\n // validate all models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsRate) && $valid;\n $rates = [];\n $i=0;\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if (! empty($deletedIDs)) {\n foreach ($deletedIDs as $key => $value) {\n $record = Rate::findOne(['rate_id'=>$value]);\n $record->delete();\n }\n }\n foreach ($modelsRate as $modelRate) {\n $w = Rate::find()->where(['rate_id' => $modelRate->rate_id ])->exists();\n if($w){\n // $record = $this->findModelRate($modelRate['rate_id']);\n //var_dump($modelRate);\n //var_dump('-------'.$modelRate->update().'--------');\n if($modelRate->update()||$modelRate->save()){\n $flag =1 ;\n }else{\n $transaction->rollBack();\n break;\n }\n \n $rates[$i++] = $modelRate->rate_id;\n }\n else{\n if (! ($flag = $modelRate->save(false))) {\n $transaction->rollBack();\n break;\n }\n $rates[$i++] = $modelRate->rate_id;\n }\n }\n $model->rate = implode(',', $rates);\n //var_dump($flag);\n //die();\n if ($flag) {\n $transaction->commit();\n $model->save();\n return $this->redirect(['view', 'id' => $model->c_id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n return $this->redirect(['view', 'id' => $model->c_id]);\n } else {\n \n return $this->render('update', [\n 'model' => $model,\n 'modelsRate' => (empty($modelsRate)) ? [new Rate] : $modelsRate\n ]);\n }\n }", "public function updateAll(mixed $model = null): void\n {\n if ($model) {\n $model::cache()->updateAll();\n }\n else {\n $list = self::list();\n\n /** @var mixed $model */\n foreach ($list as $model => $entities) {\n $model::cache()->updateAll();\n }\n }\n }", "public function update($id)\n\t{\n\t\t$this->model = $this->model->find($id);\n\t\treturn $this->updateStore();\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->getManyToManyRelation('facilities')->fill();\n $modelsRooms = $model->rooms;\n //$model->oldfotos = $model->houseFotos;\n //$model->services = explode(\",\", $model->services);\n //$model->facilities = explode(',', $model->facilities);\n //$model->houseAdresse = decode($model->houseAdresse);\n\n /*foreach ($modelsRooms as $modelRoom) {\n $modelRoom->roomfacilities = explode(\",\", $modelRoom->roomfacilities);\n }*/\n \n if ($model->load(Yii::$app->request->post())) {\n \n $oldIDs = ArrayHelper::map($modelsRooms, 'idroom', 'idroom');\n $modelsRooms = Model::createMultiple(Room::classname(), $modelsRooms);\n Model::loadMultiple($modelsRooms, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelsRooms, 'idroom', 'idroom')));\n \n // validate all models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsRooms) && $valid;\n \n if ($valid) {\n $images = $model->uploadMultiple($model,'fotos');\n if($images !== false){\n $model->houseFotos = $images;\n }\n //$model->services = implode(',', $model->services);\n //$model->facilities = implode(',', $model->facilities);\n //$model->houseAdresse = implode('', $model->houseAdresse);\n\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag=$model->save(false)) {\n if (! empty($deletedIDs)) {\n Room::deleteAll(['idroom' => $deletedIDs]);\n }\n foreach ($modelsRooms as $modelRoom) {\n $modelRoom->houseId = $model->id;\n $modelRoom->roomfacilities = implode(\",\", $modelRoom->roomfacilities);\n if (!($flag = $modelRoom->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }}\n return $this->render('update', [\n 'model' => $model,\n 'modelsRooms' => (empty($modelsRooms)) ? [new Room] : $modelsRooms,\n //'modelsRooms' => $modelsRooms,\n ]);\n }", "public function actionUpdate($id){\n\t\t\t$model = $this->findModel($id);\n\t\t\t\n if ($model->load(Yii::$app->request->post())){\n\t\t\t\n\t\t\t$year = $_POST['year'];\n\t\t\t$day = $_POST['day'];\n\t\t\t$month = $_POST['month'];\n\t\t\t$model->updated_at = date('Ydmh');\n\t\t\t$model->bod = $year.'-'.$month.'-'.$day;\n\t\t\t$model->save(false);\n\t\t\n\t\t\n\t\t\t\n\t\t\t$modelsContact = Model::createMultiple(UserContact::classname());\n\t\t\tModel::loadMultiple($modelsContact, Yii::$app->request->post());\n\t\t\t\n\t\t\tforeach ($modelsContact as $con => $modelContact):\n\t\t\t\t\n\t\t\t\tif($modelContact->contact_number != \"\"){\n\t\t\t\t\t\n\t\t\t\t\t$modelContact->iduser = $model->id;\t\t\t\t\n\t\t\t\t\t$modelContact->save(false);\n\t\t\t\t}\n\t\t\tendforeach;\n\t\t\n\t\t\treturn $this->redirect(['profile']);\t\t\t\n } else {\n return $this->render('update', [\n 'model' => $model,\n\t\t\t\t'modelsContact' => (empty($modelsContact)) ? [new UserContact] : $modelsContact,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelsDetail = $model->details;\n $modelsDetailElement = [];\n $oldElem = [];\n\n if (!empty($modelsDetail)) {\n foreach ($modelsDetail as $indexDetail => $detail) {\n $elements = $detail->elements;\n $modelsDetailElement[$indexDetail] = (empty($elements)) ? [new BatchDetailElement] : $elements;\n $oldElem = ArrayHelper::merge(ArrayHelper::index($elements, 'id'), $oldElem);\n }\n }\n\n if ($model->load(Yii::$app->request->post())) {\n // reset\n $modelsDetailElement = [];\n\n $oldDetailIDs = ArrayHelper::map($modelsDetail, 'id', 'id');\n $modelsDetail = Model::createMultiple(BatchDetail::classname(), $modelsDetail);\n Model::loadMultiple($modelsDetail, Yii::$app->request->post());\n $deletedDetailIDs = array_diff($oldDetailIDs, array_filter(ArrayHelper::map($modelsDetail, 'id', 'id')));\n\n // validate person and houses models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsDetail) && $valid;\n\n $totalPercent = 0;\n $elemIDs = [];\n if (isset($_POST['BatchDetailElement'])) {\n foreach ($_POST['BatchDetailElement'] as $indexDetail => $deteils) {\n $elemIDs = ArrayHelper::merge($elemIDs, array_filter(ArrayHelper::getColumn($deteils, 'id')));\n foreach ($deteils as $indexElem => $elem) {\n $data['BatchDetailElement'] = $elem;\n $modelElem = (isset($elem['id']) && isset($oldElem[$elem['id']])) ? $oldElem[$elem['id']] : new BatchDetailElement();\n $modelElem->load($data);\n $totalPercent += $modelElem->percent;\n $modelsDetailElement[$indexDetail][$indexElem] = $modelElem;\n $valid = $modelElem->validate() && $valid;\n }\n }\n }\n if($totalPercent > 100 || $totalPercent < 0){\n $model->addError('elements', 'Сумма процентного отношения сырья в формуле не должна быть больше 100%.');\n $valid = false;\n }\n\n $oldElemIDs = ArrayHelper::getColumn($oldElem, 'id');\n $deletedElemIDs = array_diff($oldElemIDs, $elemIDs);\n\n if ($valid) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n if($model->oldAttributes['id_mark'] !== $model->id_mark){\n $model->id_formula = null;\n }\n if ($flag = $model->save(false)) {\n\n if (! empty($deletedElemIDs)) {\n BatchDetailElement::deleteAll(['id' => $deletedElemIDs]);\n }\n\n if (! empty($deletedDetailIDs)) {\n BatchDetail::deleteAll(['id' => $deletedDetailIDs]);\n }\n\n foreach ($modelsDetail as $indexDetail => $detail) {\n\n if ($flag === false) {\n break;\n }\n\n $detail->batch = $model->batch;\n\n if (!($flag = $detail->save(false))) {\n break;\n }\n\n if (isset($modelsDetailElement[$indexDetail]) && is_array($modelsDetailElement[$indexDetail])) {\n foreach ($modelsDetailElement[$indexDetail] as $indexElem => $elem) {\n $elem->id_detail = $detail->id;\n if (!($flag = $elem->save(false))) {\n break;\n }\n }\n }\n }\n }\n\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['update', 'id' => $model->batch]);\n } else {\n $transaction->rollBack();\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n//exit();\n// if ($model->load(Yii::$app->request->post())) {\n//// print_r($model->oldAttributes);\n//// print_r($model->oldAttributes->id_mark);\n//// echo 111;\n//// print_r($model->id_mark);\n//\n// if($model->save()) {\n// return $this->redirect(['view', 'id' => $model->batch]);\n// }\n// }\n\n// print_r($modelsDetailElement);exit();\n return $this->render('update', [\n 'model' => $model,\n 'modelsDetail' => (empty($modelsDetail)) ? [new BatchDetail] : $modelsDetail,\n 'modelsDetailElement' => (empty($modelsDetailElement)) ? [[new BatchDetailElement]] : $modelsDetailElement,\n ]);\n }", "protected function update($items, $model)\n {\n // Get the model's primary key\n $instance = new $model;\n\n // Create a full column name\n $key = $instance->getTable() . '.' . $instance->getKeyName();\n\n // Process all models\n $model::whereIn($key, $items->pluck('entry_id'))->chunk($this->batching_size, function($models) {\n $this->cloudSearcher->update($models);\n });\n }", "public function update_models_record($data, $id){\n\t\t$this->db->where('salary_model_id', $id);\n\t\tif( $this->db->update('tat_salary_models',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function update($model, array $data);", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $uploads = UploadedFile::getInstances($model, 'file');\n foreach($uploads as $file){\n\n $name = 'upload/media/'.Yii::$app->security->generateRandomString().'.'.$file->extension;\n\n $dbFile = new File();\n $dbFile->fid = $model->id;\n $dbFile->type = $model->getFileType();\n $dbFile->path = $name;\n $dbFile->extension = $file->extension;\n if($dbFile->save()){\n $file->saveAs($name);\n }\n unset($dbFile);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "private function updateModelQuery($id){\n return $this->eloquentModel::find($id);\n }", "public function updateAll($id)\n\t{\n\t\t//$pib = Input::get('pib');\n\t\t$matbr = Input::get('mat_br');\n\t\t$email = Input::get('email');\n\t\t$address = Input::get('address');\n\t\t$web = Input::get('web');\n\t\t$name = Input::get('name');\n\t\t$phone = Input::get('phone');\n\t\t$provision = Input::get('provision');\n\t\t$licence = Input::get('licence');\n\t\t$bankAccount = Input::get('bankaccount');\n\t\tOrganizers::where('pib','=',$id)->\n\t\t\tupdate(array(\"mat_br\" => $matbr,\n\t\t\t\t\"email\" => $email, \"address\" => $address,\n\t\t\t\t\"web\" => $web, \"name\" => $name, \"phone\" => $phone,\n\t\t\t\t\"provision\" => $provision, \"licence\" => $licence,\n\t\t\t\t\"bankAccount\" => $bankAccount));\n\t\t\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelDetails = $model->aboutPhotos;\n\n $formDetails = Yii::$app->request->post('AboutPhoto', []);\n foreach ($formDetails as $i => $formDetail) {\n //loading the models if they are not new\n if (isset($formDetail['id']) && isset($formDetail['updateType']) && $formDetail['updateType'] != AboutPhoto::UPDATE_TYPE_CREATE) {\n //making sure that it is actually a child of the main model\n $modelDetail = AboutPhoto::findOne(['id' => $formDetail['id'], 'about_id' => $model->id]);\n $modelDetail->setScenario(AboutPhoto::SCENARIO_BATCH_UPDATE);\n $modelDetail->setAttributes($formDetail);\n $modelDetails[$i] = $modelDetail;\n //validate here if the modelDetail loaded is valid, and if it can be updated or deleted\n } else {\n $modelDetail = new AboutPhoto(['scenario' => AboutPhoto::SCENARIO_BATCH_UPDATE]);\n $modelDetail->setAttributes($formDetail);\n $modelDetails[] = $modelDetail;\n }\n\n }\n\n\n //handling if the addRow button has been pressed\n if (Yii::$app->request->post('addRowPhoto') == 'true') {\n $modelDetails[] = new AboutPhoto(['scenario' => AboutPhoto::SCENARIO_BATCH_UPDATE]);\n $modelDetails[] = new AboutPhoto(['scenario' => AboutPhoto::SCENARIO_BATCH_UPDATE]);\n\n return $this->render('update', [\n 'model' => $model,\n 'modelDetails' => $modelDetails,\n // 'modelDetails2' => $modelDetails2\n ]);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n\n\n if (Model::validateMultiple($modelDetails) && $model->validate()) {\n $file = UploadedFile::getInstance($model, 'main_photo_file');\n //print_r($file);\n if (isset($file->size) && $file->size !== 0) {\n // $model->main_photo = $file->baseName . '.' . $file->extension;\n // $file->saveAs('uploads/about/' . $file->baseName . '.' . $file->extension);\n $old_name = $model->main_photo;\n $unique_name = \"about_\" . date(\"Y-m-d_H-i-s\") . \"_\" . uniqid();\n $path = $unique_name . \".{$file->extension}\";\n $model->main_photo = $path;\n $file->saveAs('uploads/about/' . $path);\n if (isset($old_name)) {\n if($old_name==''){\n\n }else{\n unlink('uploads/about/' . $old_name);}\n } else {\n // Do nothing\n }\n }\n $model->save();\n foreach ($modelDetails as $c => $modelDetail) {\n //details that has been flagged for deletion will be deleted\n if ($modelDetail->updateType == AboutPhoto::UPDATE_TYPE_DELETE) {\n $modelDetail->delete();\n } else {\n //new or updated records go here\n ${'profile_file' . $c} = UploadedFile::getInstance($modelDetail, '[' . $c . ']' . 'about_photo');\n if (isset(${'profile_file' . $c}->size) && ${'profile_file' . $c}->size != 0) {\n // $modelDetail->photo_url = ${'profile_file' . $c}->baseName . '.' . ${'profile_file' . $c}->extension;\n // ${'profile_file' . $c}->saveAs('uploads/about/related_photo/' . ${'profile_file' . $c}->baseName . '.' . ${'profile_file' . $c}->extension);\n $old_name = $modelDetail->photo_url;\n $unique_name = \"about_\" . date(\"Y-m-d_H-i-s\") . \"_\" . uniqid();\n $path = $unique_name . \".{${'profile_file' . $c}->extension}\";\n $modelDetail->photo_url = $path;\n ${'profile_file' . $c}->saveAs('uploads/about/related_photo/' . $path);\n if (isset($old_name)) {\n unlink('uploads/about/related_photo/' . $old_name);\n } else {\n // Do nothing\n }\n $modelDetail->about_id = $model->id;\n $modelDetail->save();\n }\n\n }\n }\n Yii::$app->getSession()->setFlash('alert', [\n 'body' => '<i class=\"fa fa-check\"></i> Update Succesfully',\n 'options' => ['class' => 'alert-success']\n ]);\n return $this->redirect(['update', 'id' => $model->id]);\n }\n }\n\n\n return $this->render('update', [\n 'model' => $model,\n 'modelDetails' => $modelDetails,\n // 'modelDetails2' => $modelDetails2\n ]);\n\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelDetails = $model->moviePhotos;\n\n $formDetails = Yii::$app->request->post('MoviePhoto', []);\n foreach ($formDetails as $i => $formDetail) {\n //loading the models if they are not new\n if (isset($formDetail['id']) && isset($formDetail['updateType']) && $formDetail['updateType'] != MoviePhoto::UPDATE_TYPE_CREATE) {\n //making sure that it is actually a child of the main model\n $modelDetail = MoviePhoto::findOne(['id' => $formDetail['id'], 'movie_id' => $model->id]);\n $modelDetail->setScenario(MoviePhoto::SCENARIO_BATCH_UPDATE);\n $modelDetail->setAttributes($formDetail);\n $modelDetails[$i] = $modelDetail;\n //validate here if the modelDetail loaded is valid, and if it can be updated or deleted\n } else {\n $modelDetail = new MoviePhoto(['scenario' => MoviePhoto::SCENARIO_BATCH_UPDATE]);\n $modelDetail->setAttributes($formDetail);\n $modelDetails[] = $modelDetail;\n }\n\n }\n\n\n //handling if the addRow button has been pressed\n if (Yii::$app->request->post('addRowPhoto') == 'true') {\n $modelDetails[] = new MoviePhoto(['scenario' => MoviePhoto::SCENARIO_BATCH_UPDATE]);\n $modelDetails[] = new MoviePhoto(['scenario' => MoviePhoto::SCENARIO_BATCH_UPDATE]);\n\n return $this->render('update', [\n 'model' => $model,\n 'modelDetails' => $modelDetails,\n // 'modelDetails2' => $modelDetails2\n ]);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n\n\n if (Model::validateMultiple($modelDetails) && $model->validate()) {\n $file = UploadedFile::getInstance($model, 'main_photo_file');\n //print_r($file);\n if (isset($file->size) && $file->size !== 0) {\n // $model->main_photo = $file->baseName . '.' . $file->extension;\n // $file->saveAs('uploads/movie/' . $file->baseName . '.' . $file->extension);\n $old_name = $model->main_photo;\n $unique_name = \"movie_\" . date(\"Y-m-d_H-i-s\") . \"_\" . uniqid();\n $path = $unique_name . \".{$file->extension}\";\n $model->main_photo = $path;\n $file->saveAs('uploads/movie/' . $path);\n if (isset($old_name)) {if($old_name==''){\n\n }else{\n unlink('uploads/movie/' . $old_name);}\n } else {\n // Do nothing\n }\n }\n $model->save();\n foreach ($modelDetails as $c => $modelDetail) {\n //details that has been flagged for deletion will be deleted\n if ($modelDetail->updateType == MoviePhoto::UPDATE_TYPE_DELETE) {\n $modelDetail->delete();\n } else {\n //new or updated records go here\n ${'profile_file' . $c} = UploadedFile::getInstance($modelDetail, '[' . $c . ']' . 'movie_photo');\n if (isset(${'profile_file' . $c}->size) && ${'profile_file' . $c}->size != 0) {\n // $modelDetail->photo_url = ${'profile_file' . $c}->baseName . '.' . ${'profile_file' . $c}->extension;\n // ${'profile_file' . $c}->saveAs('uploads/movie/related_photo/' . ${'profile_file' . $c}->baseName . '.' . ${'profile_file' . $c}->extension);\n $old_name = $modelDetail->photo_url;\n $unique_name = \"movie_\" . date(\"Y-m-d_H-i-s\") . \"_\" . uniqid();\n $path = $unique_name . \".{${'profile_file' . $c}->extension}\";\n $modelDetail->photo_url = $path;\n ${'profile_file' . $c}->saveAs('uploads/movie/related_photo/' . $path);\n if (isset($old_name)) {\n unlink('uploads/movie/related_photo/' . $old_name);\n } else {\n // Do nothing\n }\n $modelDetail->movie_id = $model->id;\n $modelDetail->save();\n }\n\n }\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n\n return $this->render('update', [\n 'model' => $model,\n 'modelDetails' => $modelDetails,\n // 'modelDetails2' => $modelDetails2\n ]);\n\n }", "public function update(Request $request, $id)\n {\n //\n $orderModel = orderModel::find($id);\n\n if ($orderModel->approval == 1){\n return Redirect::back()->withErrors(['The model was already added to the assessment tool.']);\n }else if ($orderModel->approval == 2){\n return Redirect::back()->withErrors(['The model was already rejected.']);\n }\n\n $orderModel->remarks = 'Model Accepted';\n $orderModel->approval = 1;\n $orderModel->save();\n\n $role = new role;\n $role->name = $orderModel->roleName;\n $role->save();\n\n $orderModelCompetency = OrderModelCompetency::where('modelID','=',$orderModel->id)->get();\n\n \n $roleDetail = role::where('name','=',$orderModel->roleName)->first();\n \n foreach($orderModelCompetency as $row){\n $uploadedModel = new listOfCompetenciesPerRole;\n $uploadedModel->roleID = $roleDetail->id;\n $uploadedModel->groupID = $orderModel->groupID;\n $uploadedModel->competencyID = $row->competencyID;\n $uploadedModel->competencyTypeID = $row->competencyTypeID;\n $uploadedModel->targetLevelID = $row->targetProficiencyID;\n $uploadedModel->save();\n }\n\n\n return redirect('admin/model/submission')->with('success', 'Model successfully added.');\n }", "private function updateLinkModels() {\n foreach ($this->models as $model) {\n $this->registerLinkModels($model);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update($id, array $fields)\n { \n //caching the updated model\n $this->model = $this->findById($id);\n $this->fillData($fields);\n return $this->model->save($fields);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelsGeos = $model->nestingHasGeos;\n\n if ($model->load(Yii::$app->request->post())) {\n \n $oldIDs = ArrayHelper::map($modelsGeos, 'id', 'id');\n $modelsGeos = Model::createMultiple(NestingHasGeo::classname(), $modelsGeos);\n Model::loadMultiple($modelsGeos, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelsGeos, 'id', 'id')));\n \n // ajax validation\n if (Yii::$app->request->isAjax) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ArrayHelper::merge(\n ActiveForm::validateMultiple($modelsGeos),\n ActiveForm::validate($model)\n );\n }\n \n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsGeos) && $valid;\n \n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n if (!empty($deletedIDs)) {\n NestingHasGeo::deleteAll(['id' => $deletedIDs]);\n }\n foreach ($modelsGeos as $item) {\n $item->nesting_id = $model->id;\n if (! ($flag = $item->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n return $this->render('update', [\n 'model' => $model,\n 'modelsGeos' => (empty($modelsGeos)) ? [new NestingHasGeo()] : $modelsGeos,\n ]);\n }", "public function update($id);", "public function update(array $attributes, int $id);" ]
[ "0.6805591", "0.67808706", "0.67807484", "0.67145365", "0.65970683", "0.65224695", "0.6387048", "0.6291033", "0.6286831", "0.6275501", "0.6274865", "0.6274755", "0.62624526", "0.625307", "0.6237077", "0.62146264", "0.6194849", "0.61867636", "0.6141302", "0.61259246", "0.6091023", "0.6069379", "0.60681653", "0.606556", "0.6044056", "0.60269165", "0.6013112", "0.6003732", "0.59980774", "0.5982693" ]
0.7197093
0
Given an array of browsers/version pairs, checks against browsers to indicate if this should be supported. This can be used to determine if any of a related group of browsers is supported, so you can output the appropriate prefixed properties. If any of the browsers in $browsers matches a key in $this>browsers and the version in $browsers is >= $this>browsers version, this function return true.
public function includeSupport(array $browsers) { foreach ($browsers as $browser => $version) { if (isset($this->browsers[$browser]) && $version >= $this->browsers[$browser]) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkBrowsers() {\n return (\n $this->checkBrowserWebTv() ||\n $this->checkBrowserInternetExplorer() ||\n $this->checkBrowserOpera() ||\n $this->checkBrowserGaleon() ||\n $this->checkBrowserNetscapeNavigator9Plus() ||\n $this->checkBrowserFirefox() ||\n $this->checkBrowserChrome() ||\n $this->checkBrowserOmniWeb() ||\n\n // common mobile\n $this->checkBrowserAndroid() ||\n $this->checkBrowseriPad() ||\n $this->checkBrowseriPod() ||\n $this->checkBrowseriPhone() ||\n $this->checkBrowserBlackBerry() ||\n $this->checkBrowserNokia() ||\n\n // common bots\n $this->checkBrowserGoogleBot() ||\n $this->checkBrowserMSNBot() ||\n $this->checkBrowserSlurp() ||\n\n // WebKit base check (post mobile and others)\n $this->checkBrowserSafari() ||\n\n // everyone else\n $this->checkBrowserNetPositive() ||\n $this->checkBrowserFirebird() ||\n $this->checkBrowserKonqueror() ||\n $this->checkBrowserIcab() ||\n $this->checkBrowserPhoenix() ||\n $this->checkBrowserAmaya() ||\n $this->checkBrowserLynx() ||\n $this->checkBrowserShiretoko() ||\n $this->checkBrowserIceCat() ||\n $this->checkBrowserW3CValidator() ||\n $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */\n );\n }", "protected function checkBrowsers()\n {\n return (\n // well-known, well-used\n // Special Notes:\n // (1) Opera must be checked before FireFox due to the odd\n // user agents used in some older versions of Opera\n // (2) WebTV is strapped onto Internet Explorer so we must\n // check for WebTV before IE\n // (3) (deprecated) Galeon is based on Firefox and needs to be\n // tested before Firefox is tested\n // (4) OmniWeb is based on Safari so OmniWeb check must occur\n // before Safari\n // (5) Netscape 9+ is based on Firefox so Netscape checks\n // before FireFox are necessary\n // (6) Vivaldi is UA contains both Firefox and Chrome so Vivaldi checks\n // before Firefox and Chrome\n $this->checkBrowserWebTv() ||\n $this->checkBrowserBrave() ||\n $this->checkBrowserUCBrowser() ||\n $this->checkBrowserEdge() ||\n $this->checkBrowserInternetExplorer() ||\n $this->checkBrowserOpera() ||\n $this->checkBrowserGaleon() ||\n $this->checkBrowserNetscapeNavigator9Plus() ||\n $this->checkBrowserVivaldi() ||\n $this->checkBrowserYandex() ||\n $this->checkBrowserPalemoon() ||\n $this->checkBrowserFirefox() ||\n $this->checkBrowserChrome() ||\n $this->checkBrowserOmniWeb() ||\n\n // common mobile\n $this->checkBrowserAndroid() ||\n $this->checkBrowseriPad() ||\n $this->checkBrowseriPod() ||\n $this->checkBrowseriPhone() ||\n $this->checkBrowserBlackBerry() ||\n $this->checkBrowserNokia() ||\n\n // common bots\n $this->checkBrowserGoogleBot() ||\n $this->checkBrowserMSNBot() ||\n $this->checkBrowserBingBot() ||\n $this->checkBrowserSlurp() ||\n\n // Yandex bots\n $this->checkBrowserYandexBot() ||\n $this->checkBrowserYandexImageResizerBot() ||\n $this->checkBrowserYandexBlogsBot() ||\n $this->checkBrowserYandexCatalogBot() ||\n $this->checkBrowserYandexDirectBot() ||\n $this->checkBrowserYandexFaviconsBot() ||\n $this->checkBrowserYandexImagesBot() ||\n $this->checkBrowserYandexMediaBot() ||\n $this->checkBrowserYandexMetrikaBot() ||\n $this->checkBrowserYandexNewsBot() ||\n $this->checkBrowserYandexVideoBot() ||\n $this->checkBrowserYandexWebmasterBot() ||\n\n // check for facebook external hit when loading URL\n $this->checkFacebookExternalHit() ||\n\n // WebKit base check (post mobile and others)\n $this->checkBrowserSamsung() ||\n $this->checkBrowserSilk() ||\n $this->checkBrowserSafari() ||\n\n // everyone else\n $this->checkBrowserNetPositive() ||\n $this->checkBrowserFirebird() ||\n $this->checkBrowserKonqueror() ||\n $this->checkBrowserIcab() ||\n $this->checkBrowserPhoenix() ||\n $this->checkBrowserAmaya() ||\n $this->checkBrowserLynx() ||\n $this->checkBrowserShiretoko() ||\n $this->checkBrowserIceCat() ||\n $this->checkBrowserIceweasel() ||\n $this->checkBrowserW3CValidator() ||\n $this->checkBrowserCurl() ||\n $this->checkBrowserWget() ||\n $this->checkBrowserPlayStation() ||\n $this->checkBrowserIframely() ||\n $this->checkBrowserCocoa() ||\n $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */\n );\n }", "function browser_check($supportedBrowserVersion = 0){\n\t\t\n\t\tif ($this->browserVersion == 0){\n\t\t\t$browserCheck = 0;\n\t\t}elseif ($this->browserVersion <= $supportedBrowserVersion){\n\t\t\t$browserCheck = 1;\n\t\t}else{\n\t\t\t$browserCheck = 2;\n\t\t}\n\t\t\n\t\treturn $browserCheck;\n\t}", "public function supported_by_browser() {\n return true;\n }", "public function check_browser_pattern() {\n\n try {\n\n $headers = array_keys( $this->rHeaders );\n if( preg_match(\"/ Firefox/i\", $this->user_agent) != false &&\n ( $headers[0] != 'Host' ||\n $headers[1] != 'User-Agent' ||\n $headers[2] != 'Accept' ) ) {\n return FALSE;\n\n }elseif( preg_match(\"/ Chrome/i\", $this->user_agent) != false &&\n ( $headers[0] != 'Host' ||\n $headers[1] != 'Connection' ||\n ( $headers[2] != 'Cache-Control' && $headers[2] != 'Accept' ) ) ) {\n return FALSE;\n \n }elseif( preg_match(\"/ MSIE/\", $this->user_agent) != false && $headers[0] != 'Accept' ) {\n return FALSE;\n }\n\n return TRUE;\n\n } catch( Exception $e ) {\n die(__METHOD__);\n }\n }", "protected function checkBrowserInternetExplorer() {\n if( stripos($this->_agent,'microsoft internet explorer') !== false ) {\n $this->setBrowser(self::BROWSER_IE);\n $this->setVersion('1.0');\n $aresult = stristr($this->_agent, '/');\n if( preg_match('/308|425|426|474|0b1/i', $aresult) ) {\n $this->setVersion('1.5');\n }\n return true;\n }\n // Test for versions > 1.5\n else if( stripos($this->_agent,'msie') !== false && stripos($this->_agent,'opera') === false ) {\n // See if the browser is the odd MSN Explorer\n if( stripos($this->_agent,'msnb') !== false ) {\n $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'MSN'));\n $this->setBrowser( self::BROWSER_MSN );\n $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1]));\n return true;\n }\n $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'msie'));\n $this->setBrowser( self::BROWSER_IE );\n $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1]));\n return true;\n }\n // Test for Pocket IE\n else if( stripos($this->_agent,'mspie') !== false || stripos($this->_agent,'pocket') !== false ) {\n $aresult = explode(' ',stristr($this->_agent,'mspie'));\n $this->setPlatform( self::PLATFORM_WINDOWS_CE );\n $this->setBrowser( self::BROWSER_POCKET_IE );\n $this->setMobile(true);\n\n if( stripos($this->_agent,'mspie') !== false ) {\n $this->setVersion($aresult[1]);\n }\n else {\n $aversion = explode('/',$this->_agent);\n $this->setVersion($aversion[1]);\n }\n return true;\n }\n return false;\n }", "protected function checkBrowserInternetExplorer()\n {\n // Test for IE11\n if (stripos($this->_agent, 'Trident/7.0; rv:11.0') !== false) {\n $this->setBrowser(self::BROWSER_IE);\n $this->setVersion('11.0');\n return true;\n } // Test for v1 - v1.5 IE\n else if (stripos($this->_agent, 'microsoft internet explorer') !== false) {\n $this->setBrowser(self::BROWSER_IE);\n $this->setVersion('1.0');\n $aresult = stristr($this->_agent, '/');\n if (preg_match('/308|425|426|474|0b1/i', $aresult)) {\n $this->setVersion('1.5');\n }\n return true;\n } // Test for versions > 1.5\n else if (stripos($this->_agent, 'msie') !== false && stripos($this->_agent, 'opera') === false) {\n // See if the browser is the odd MSN Explorer\n if (stripos($this->_agent, 'msnb') !== false) {\n $aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'MSN'));\n if (isset($aresult[1])) {\n $this->setBrowser(self::BROWSER_MSN);\n $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));\n return true;\n }\n }\n $aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'msie'));\n if (isset($aresult[1])) {\n $this->setBrowser(self::BROWSER_IE);\n $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));\n if(stripos($this->_agent, 'IEMobile') !== false) {\n $this->setBrowser(self::BROWSER_POCKET_IE);\n $this->setMobile(true);\n }\n return true;\n }\n } // Test for versions > IE 10\n else if (stripos($this->_agent, 'trident') !== false) {\n $this->setBrowser(self::BROWSER_IE);\n $result = explode('rv:', $this->_agent);\n if (isset($result[1])) {\n $this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));\n $this->_agent = str_replace(array(\"Mozilla\", \"Gecko\"), \"MSIE\", $this->_agent);\n }\n } // Test for Pocket IE\n else if (stripos($this->_agent, 'mspie') !== false || stripos($this->_agent, 'pocket') !== false) {\n $aresult = explode(' ', stristr($this->_agent, 'mspie'));\n if (isset($aresult[1])) {\n $this->setPlatform(self::PLATFORM_WINDOWS_CE);\n $this->setBrowser(self::BROWSER_POCKET_IE);\n $this->setMobile(true);\n\n if (stripos($this->_agent, 'mspie') !== false) {\n $this->setVersion($aresult[1]);\n } else {\n $aversion = explode('/', $this->_agent);\n if (isset($aversion[1])) {\n $this->setVersion($aversion[1]);\n }\n }\n return true;\n }\n }\n return false;\n }", "public function getKnownBrowsers()\n {\n return array(\n 'firefox' => ['firefox', 'minefield', 'iceweasel', 'shiretoko', 'namoroka', 'shredder', 'granparadiso'],\n 'opera' => ['opr', 'opera'],\n 'edge' => ['edge'],\n 'yabrowser' => ['yabrowser'],\n 'maxthon' => ['maxthon'],\n 'msie' => ['msie'],\n 'chrome' => ['chrome'],\n 'safari' => ['safari'],\n 'konqueror' => ['konqueror'],\n 'netscape' => ['netscape'],\n 'lynx' => ['lynx']\n );\n }", "function test_check_browser_version()\n {\n global $CFG;\n \n $_SERVER['HTTP_USER_AGENT'] = $this->user_agents['Safari']['2.0']['Mac OS X']; \n $this->assertTrue(check_browser_version('Safari', '312'));\n $this->assertFalse(check_browser_version('Safari', '500'));\n \n $_SERVER['HTTP_USER_AGENT'] = $this->user_agents['Opera']['9.0']['Windows XP'];\n $this->assertTrue(check_browser_version('Opera', '8.0'));\n $this->assertFalse(check_browser_version('Opera', '10.0'));\n \n $_SERVER['HTTP_USER_AGENT'] = $this->user_agents['MSIE']['6.0']['Windows XP SP2'];\n $this->assertTrue(check_browser_version('MSIE', '5.0'));\n $this->assertFalse(check_browser_version('MSIE', '7.0'));\n \n $_SERVER['HTTP_USER_AGENT'] = $this->user_agents['Firefox']['2.0']['Windows XP'];\n $this->assertTrue(check_browser_version('Firefox', '1.5'));\n $this->assertFalse(check_browser_version('Firefox', '3.0')); \n }", "protected function checkBrowserMozilla()\n {\n if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {\n $aversion = explode(' ', stristr($this->_agent, 'rv:'));\n preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion);\n $this->setVersion(str_replace('rv:', '', $aversion[0]));\n $this->setBrowser(self::BROWSER_MOZILLA);\n return true;\n } else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9]\\.[0-9]/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {\n $aversion = explode('', stristr($this->_agent, 'rv:'));\n $this->setVersion(str_replace('rv:', '', $aversion[0]));\n $this->setBrowser(self::BROWSER_MOZILLA);\n return true;\n } else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/mozilla\\/([^ ]*)/i', $this->_agent, $matches) && stripos($this->_agent, 'netscape') === false) {\n $this->setVersion($matches[1]);\n $this->setBrowser(self::BROWSER_MOZILLA);\n return true;\n }\n return false;\n }", "protected function checkBrowser() {\n\t\t\tforeach ($this->browsers as $regex => $value) { \n\t\t\t\tif (preg_match($regex, $this->agent ) ) {\n\t\t\t\t\t$this->browserName = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function checkBrowserVersion(){\n\t\t\t$detected = $this->getBrowser();\n\t\t\t$detect = array_search($detected, $this->browsers);\n\t\t\t$browser = str_replace(array('/i','/'), '', $detect);\n\t\t\t$regex = \"/(?<browser>version|{$browser})[\\/]+(?<version>[0-9.|a-zA-Z.]*)/i\";\n\t\t\tif (preg_match_all($regex, $this->agent, $matches)) {\n\t\t\t\t$found = array_search($browser, $matches['browser']);\n\t\t\t\t$this->version = $matches['version'][$found];\n\t\t\t}\n\t\t}", "static public function detectBrowser() {\n\n // The following determines the user agent (browser) as best it can.\n $return = array(\n 'is_opera' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false,\n 'is_opera6' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 6') !== false,\n 'is_opera7' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 7') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/7') !== false,\n 'is_opera8' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 8') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/8') !== false,\n 'is_opera9' => preg_match('~Opera[ /]9(?!\\\\.[89])~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_opera10' => preg_match('~Opera[ /]10\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1 || (preg_match('~Opera[ /]9\\\\.[89]~', $_SERVER['HTTP_USER_AGENT']) === 1 && preg_match('~Version/1[0-9]\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1),\n 'is_ie4' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 4') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') === false,\n 'is_webkit' => strpos($_SERVER['HTTP_USER_AGENT'], 'AppleWebKit') !== false,\n 'is_mac_ie' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false,\n 'is_web_tv' => strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') !== false,\n 'is_konqueror' => strpos($_SERVER['HTTP_USER_AGENT'], 'Konqueror') !== false,\n 'is_firefox' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat)/~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_firefox1' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat)/1\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_firefox2' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat)/2\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_firefox3' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat|Shiretoko|Minefield)/3\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_iphone' => strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== false,\n 'is_ipad' => strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false,\n 'is_android' => strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false,\n 'is_midp' => strpos($_SERVER['HTTP_USER_AGENT'], 'MIDP') !== false,\n 'is_symbian' => strpos($_SERVER['HTTP_USER_AGENT'], 'Symbian') !== false,\n );\n\n $return['is_chrome'] = $return['is_webkit'] && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false;\n $return['is_safari'] = !$return['is_chrome'] && strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false;\n $return['is_gecko'] = strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false && !$return['is_webkit'] && !$return['is_konqueror'];\n\n // Internet Explorer 5 and 6 are often \"emulated\".\n $return['is_ie8'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8') !== false;\n $return['is_ie7'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false && !$return['is_ie8'];\n $return['is_ie6'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false && !$return['is_ie8'] && !$return['is_ie7'];\n $return['is_ie5.5'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5') !== false;\n $return['is_ie5'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.0') !== false;\n\n $return['is_ie'] = $return['is_ie4'] || $return['is_ie5'] || $return['is_ie5.5'] || $return['is_ie6'] || $return['is_ie7'] || $return['is_ie8'];\n // Before IE8 we need to fix IE... lots!\n $return['ie_standards_fix'] = !$return['is_ie8'];\n\n $return['needs_size_fix'] = ($return['is_ie5'] || $return['is_ie5.5'] || $return['is_ie4'] || $return['is_opera6']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') === false;\n\n // This isn't meant to be reliable, it's just meant to catch most bots to prevent PHPSESSID from showing up.\n $return['possibly_robot'] = !empty($user_info['possibly_robot']);\n\n // Robots shouldn't be logging in or registering. So, they aren't a bot. Better to be wrong than sorry (or people won't be able to log in!), anyway.\n if ((isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('login', 'login2', 'register'))) || !$user_info['is_guest'])\n $return['possibly_robot'] = false;\n\n\n if (strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Blackberry') !== false) {\n $return['is_blackberry'] = 1;\n if (strpos($_SERVER['HTTP_USER_AGENT'], '6.0') !== false) {\n $return['is_blackberry_os6'] = 1;\n } else if (strpos($_SERVER['HTTP_USER_AGENT'], '5.0') !== false) {\n $return['is_blackberry_os5'] = 1;\n } else {\n $return['is_blackberry_os4'] = 1;\n }\n }\n\n\n return $return;\n }", "public static function version_supported() {\n\n\t\tforeach (static::$version_supported as $space => $version) {\n\n\t\t\t$expression = '$verif = ' . static::verif(static::convert_version($version), 'static::version()').';';\n\n\t\t\teval($expression);\n\n\t\t\tif($verif === true){ return ['space' => $space, 'version' => $version]; }\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "protected function checkBrowserNetscapeNavigator9Plus()\n {\n if (stripos($this->_agent, 'Firefox') !== false && preg_match('/Navigator\\/([^ ]*)/i', $this->_agent, $matches)) {\n $this->setVersion($matches[1]);\n $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);\n return true;\n } else if (stripos($this->_agent, 'Firefox') === false && preg_match('/Netscape6?\\/([^ ]*)/i', $this->_agent, $matches)) {\n $this->setVersion($matches[1]);\n $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);\n return true;\n }\n return false;\n }", "public function hasAllCapabilities(array $capabilityNames);", "function isBrowser($browserName) { return( 0 == strcasecmp($this->_browser_name, trim($browserName))); }", "function is_browser($type) {\n\t$agents = array();\n\n\t$agents['unix'] = array(\n\t\t'sunos','sunos 4','sunos 5',\n\t\t'i86',\n\t\t'irix','irix 5','irix 6','irix6',\n\t\t'hp-ux','09.','10.',\n\t\t'aix','aix 1','aix 2','aix 3','aix 4',\n\t\t'inux',\n\t\t'sco',\n\t\t'unix_sv','unix_system_v','ncr','reliant','dec','osf1',\n\t\t'dec_alpha','alphaserver','ultrix','alphastation',\n\t\t'sinix',\n\t\t'freebsd','bsd',\n\t\t'x11','vax','openvms'\n\t);\n\n\t$agents['win'] = array(\n\t\t'win','win95','windows 95',\n\t\t'win16','windows 3.1','windows 16-bit','windows','win31','win16','winme',\n\t\t'win2k','winxp',\n\t\t'win98','windows 98','win9x',\n\t\t'winnt','windows nt','win32',\n\t\t'32bit'\n\t);\n\n\t$agents['mac'] = array(\n\t\t'mac','68000','ppc','powerpc'\n\t);\n\n\tif (isset($agents[$type]))\n\t\treturn in_array(get_user_agent_string(),$agents[$type]);\n\telse\n\t\treturn false;\n}", "function isBrowser($browserName)\n {\n return (0 == strcasecmp($this->_browser_name, trim($browserName)));\n }", "protected function checkBrowserKonqueror()\n {\n if (stripos($this->_agent, 'Konqueror') !== false) {\n $aresult = explode(' ', stristr($this->_agent, 'Konqueror'));\n $aversion = explode('/', $aresult[0]);\n if (isset($aversion[1])) {\n $this->setVersion($aversion[1]);\n $this->setBrowser(self::BROWSER_KONQUEROR);\n return true;\n }\n }\n return false;\n }", "public function isUserAgent(array $agent);", "protected function checkBrowserUCBrowser()\n {\n if (preg_match('/UC ?Browser\\/?([\\d\\.]+)/', $this->_agent, $matches )) {\n if(isset($matches[1])) {\n $this->setVersion($matches[1]);\n }\n if (stripos($this->_agent, 'Mobile') !== false) {\n $this->setMobile(true);\n } else {\n $this->setTablet(true);\n }\n $this->setBrowser(self::BROWSER_UCBROWSER);\n return true;\n }\n return false;\n }", "protected function checkBrowserFirefox()\n {\n if (stripos($this->_agent, 'safari') === false) {\n if (preg_match(\"/Firefox[\\/ \\(]([^ ;\\)]+)/i\", $this->_agent, $matches)) {\n $this->setVersion($matches[1]);\n $this->setBrowser(self::BROWSER_FIREFOX);\n //Firefox on Android\n if (stripos($this->_agent, 'Android') !== false || stripos($this->_agent, 'iPhone') !== false) {\n if (stripos($this->_agent, 'Mobile') !== false || stripos($this->_agent, 'Tablet') !== false) {\n $this->setMobile(true);\n } else {\n $this->setTablet(true);\n }\n }\n return true;\n } else if (preg_match(\"/Firefox([0-9a-zA-Z\\.]+)/i\", $this->_agent, $matches)) {\n $this->setVersion($matches[1]);\n $this->setBrowser(self::BROWSER_FIREFOX);\n return true;\n } else if (preg_match(\"/Firefox$/i\", $this->_agent, $matches)) {\n $this->setVersion('');\n $this->setBrowser(self::BROWSER_FIREFOX);\n return true;\n }\n } elseif ( preg_match(\"/FxiOS[\\/ \\(]([^ ;\\)]+)/i\", $this->_agent, $matches) ) {\n $this->setVersion($matches[1]);\n $this->setBrowser(self::BROWSER_FIREFOX);\n //Firefox on Android\n if (stripos($this->_agent, 'Android') !== false || stripos($this->_agent, 'iPhone') !== false) {\n if (stripos($this->_agent, 'Mobile') !== false || stripos($this->_agent, 'Tablet') !== false) {\n $this->setMobile(true);\n } else {\n $this->setTablet(true);\n }\n }\n return true;\n }\n return false;\n }", "static public function chromiumBased($userAgent)\n\t{\n\t\treturn preg_match('/Chrom(e|ium)/', $userAgent) > 0;\n\t}", "protected function checkBrowserW3CValidator()\n {\n if (stripos($this->_agent, 'W3C-checklink') !== false) {\n $aresult = explode('/', stristr($this->_agent, 'W3C-checklink'));\n if (isset($aresult[1])) {\n $aversion = explode(' ', $aresult[1]);\n $this->setVersion($aversion[0]);\n $this->_browser_name = self::BROWSER_W3CVALIDATOR;\n return true;\n }\n } else if (stripos($this->_agent, 'W3C_Validator') !== false) {\n // Some of the Validator versions do not delineate w/ a slash - add it back in\n $ua = str_replace(\"W3C_Validator \", \"W3C_Validator/\", $this->_agent);\n $aresult = explode('/', stristr($ua, 'W3C_Validator'));\n if (isset($aresult[1])) {\n $aversion = explode(' ', $aresult[1]);\n $this->setVersion($aversion[0]);\n $this->_browser_name = self::BROWSER_W3CVALIDATOR;\n return true;\n }\n } else if (stripos($this->_agent, 'W3C-mobileOK') !== false) {\n $this->_browser_name = self::BROWSER_W3CVALIDATOR;\n $this->setMobile(true);\n return true;\n }\n return false;\n }", "function browser_check( )\n{\n\tglobal $stylesheets;\n\t$platform_comps = array( );\n\t$msie_major = 0;\n\t$msie_minor = 0;\n\t$mac = 0;\n\t$platform_str = '';\n\t$b_id = $_SERVER['HTTP_USER_AGENT'];\n\n\t# look into php's get_browser()\n\n\t# not suitable for lynx\n\tif ( preg_match( '/Lynx/i', $b_id )) {\n\t\theader( \"Location: /scriptversion.php\" );\n\t}\n\n\t# Firefox, Mozilla, Netscape, and Camino \n\t# all need to be at least \"rv:1.7.2\" to pass\n\tif ( preg_match( '/Gecko/', $b_id ) &&\n\t\tpreg_match( '/ rv:1.7.([^)]*)\\)/', $b_id, $Rev )) {\n\t\tif ( strlen( $Rev[0] ) && \n\t\t\t( !strlen( $Rev[1] ) || ( $Rev[1] < 2 ))) {\n\t\t\t\theader( \"Location: /scriptversion.php\" );\n\t\t}\n\t}\n\n\t# Win Opera 7.5 is broken, but 8 works\n\tif ( preg_match( '/Opera\\/7/', $b_id )) {\n\t\theader( \"Location: /scriptversion.php\" );\n\t}\n\n\t# We currently don't support Omniweb 4.5, although 5.1.1 works\n\tif ( preg_match( '/OmniWeb\\/v496$/', $b_id )) {\n\t\theader( \"Location: /scriptversion.php\" );\n\t}\n\n\t# Check for Safari after Omniweb, since OW uses Safari's string\n\tif ( preg_match( '/Safari\\/(.*)$/', $b_id, $Rev ) &&\n\t\t( !strlen( $Rev[1] ) || ( $Rev[1] < 2 ))) {\n\t\theader( \"Location: /scriptversion.php\" );\n } \n\n\t$regex = \"/(.*) \\((.*)\\)/\";\n\tif( preg_match( $regex, $b_id, $matches )) {\n\t\t$browser_str = $matches[1];\n\t\t$platform_str = $matches[2];\n\t}\n\n\t$l=strlen( $platform_str );\n\n\t$token = \"\";\n\tfor( $i=0; $i<=$l; $i++ )\n\t{\n\t\tif(( $i == $l ) || (( $c=$platform_str[$i] ) == \";\" )) {\n\t\t\t$platform_comps[] = ltrim( rtrim( $token ));\n\t\t\t$token = \"\";\n\t\t} else {\n\t\t\t$token .= $c;\n\t\t}\n\t}\n\n\tforeach( $platform_comps as $comp ) {\n\t\t$regex = \"/MSIE (\\d+)\\.(\\d+)/\";\n\t\tif( preg_match( $regex, $comp, $matches )) {\n\t\t\t$msie_major = $matches[1];\n\t\t\t$msie_minor = $matches[2];\n\n\t\t}\n\n\t\tif ( preg_match( \"/^Mac/i\", $comp, $matches )) {\n\t\t\t$mac = 1;\n\t\t}\n\t}\n\n\t// We currently don't support MSIE on mac\n\t// This also catches Opera 7.5 and 8 for mac.\n\t// Mac Opera 7.5 is broken, Opera 8 works, but they both have the\n\t// same browser identification string. PUNT! Use a real browser!\n\tif ( $msie_major && $mac ) {\n\t\theader( \"Location: /scriptversion.php\" );\n\t}\n\n\t// MSIE requires additional stylesheets\n\tswitch ( $msie_major ) {\n\tcase \"5\":\n\t\t$stylesheets[] = \"/css/ie5specific.css\";\n\t\tbreak;\n\tcase \"6\":\n\t\t$stylesheets[] = \"/css/ie6specific.css\";\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n}", "function fserver__project_property_supported_majors_validate($value) {\n if (is_array($value)) {\n foreach ($value as $key => $v) {\n if (array_key_exists('api', $v) and array_key_exists('supported_majors', $v)) {\n if (is_array($v['supported_majors']) and is_string($v['api'])) {\n // Ensure all supported major values are integers\n foreach ($v['supported_majors'] as $major) {\n if (!is_int($major) or $major < 1) {\n return FALSE;\n }\n }\n return TRUE;\n }\n }\n }\n }\n\n return FALSE;\n}", "public function is_supported($driver)\n\t{\n\t\tif ( in_array($driver,$this->valid_drivers))\n\t\t{\n return TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "protected function plugins_compatible() {\n\n\t\treturn $this->is_wp_compatible() && $this->is_wc_compatible();\n\t}", "protected function checkBrowserOpera()\n {\n if (stripos($this->_agent, 'opera mini') !== false) {\n $resultant = stristr($this->_agent, 'opera mini');\n if (preg_match('/\\//', $resultant)) {\n $aresult = explode('/', $resultant);\n if (isset($aresult[1])) {\n $aversion = explode(' ', $aresult[1]);\n $this->setVersion($aversion[0]);\n }\n } else {\n $aversion = explode(' ', stristr($resultant, 'opera mini'));\n if (isset($aversion[1])) {\n $this->setVersion($aversion[1]);\n }\n }\n $this->_browser_name = self::BROWSER_OPERA_MINI;\n $this->setMobile(true);\n return true;\n } else if (stripos($this->_agent, 'opera') !== false) {\n $resultant = stristr($this->_agent, 'opera');\n if (preg_match('/Version\\/(1*.*)$/', $resultant, $matches)) {\n $this->setVersion($matches[1]);\n } else if (preg_match('/\\//', $resultant)) {\n $aresult = explode('/', str_replace(\"(\", \" \", $resultant));\n if (isset($aresult[1])) {\n $aversion = explode(' ', $aresult[1]);\n $this->setVersion($aversion[0]);\n }\n } else {\n $aversion = explode(' ', stristr($resultant, 'opera'));\n $this->setVersion(isset($aversion[1]) ? $aversion[1] : '');\n }\n if (stripos($this->_agent, 'Opera Mobi') !== false) {\n $this->setMobile(true);\n }\n $this->_browser_name = self::BROWSER_OPERA;\n return true;\n } else if (stripos($this->_agent, 'OPR') !== false) {\n $resultant = stristr($this->_agent, 'OPR');\n if (preg_match('/\\//', $resultant)) {\n $aresult = explode('/', str_replace(\"(\", \" \", $resultant));\n if (isset($aresult[1])) {\n $aversion = explode(' ', $aresult[1]);\n $this->setVersion($aversion[0]);\n }\n }\n if (stripos($this->_agent, 'Mobile') !== false) {\n $this->setMobile(true);\n }\n $this->_browser_name = self::BROWSER_OPERA;\n return true;\n }\n return false;\n }" ]
[ "0.6583523", "0.6384537", "0.6242122", "0.6174786", "0.5918474", "0.5899651", "0.5836029", "0.5790077", "0.57186526", "0.5697252", "0.55820763", "0.54485315", "0.5435018", "0.54278284", "0.53951347", "0.5390886", "0.535101", "0.53139144", "0.5253629", "0.5233783", "0.52317446", "0.52121806", "0.51763546", "0.51432467", "0.51349944", "0.51130176", "0.5095134", "0.50387144", "0.4955883", "0.49413162" ]
0.8217827
0
Returns children for enum_type
public function get_enum_children($link_id = NULL) { return $this->queryAll(' SELECT DISTINCT et.*, etl.id as link_id, etl.reg_exp FROM enum_type_links etl JOIN enum_types et ON et.id = etl.id_enum_type AND etl.id_parent_link = ? ORDER BY et.name ASC ', array($link_id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChildrenOfType($type)\n {\n return $this->children[$type] ?? [];\n }", "public function getChildren()\n {\n $children = [];\n foreach ($this->children as $type) {\n foreach ($type as $child) {\n $children[] = $child;\n }\n }\n\n return $children;\n }", "public function getAllowedChildTypes()\n {\n $res = new EnumSet(self::class);\n foreach (self::getEnumerators() as $nodeType) {\n if($this->allowChild($nodeType)) {\n $res->attach($nodeType);\n }\n }\n return $res;\n }", "public function get_categories($type)\n {\n if(!self::is_type_valid($type))\n {\n return [];\n }\n\n if(!function_exists('get_inner_categories'))\n {\n function get_inner_categories($link_id, $fixed = false)\n {\n $link = new Enum_type_links($link_id);\n $res = [];\n\n $items = $link->where(array\n (\n 'id_parent_link' => $link_id,\n 'et.type' => $link->enum_type->type\n ))\n ->join('enum_types et ON et.id = enum_type_links.id_enum_type')\n ->select_list('enum_type_links.id as id, et.id as id_enum_type, et.name as name, et.type as type')\n ->order_by('name')\n ->get_all();\n\n if($link->enum_type->type == Enum_types::TYPE_MEMBRANE_CATS)\n {\n $model = new Membranes();\n }\n elseif($link->enum_type->type == Enum_types::TYPE_METHOD_CATS)\n {\n $model = new Methods();\n }\n elseif($link->enum_type->type == Enum_types::TYPE_TRANSPORTER_CATS)\n {\n $model = new Transporter_targets();\n $t_model = new Transporters();\n }\n\n foreach($items as $i)\n {\n $ch = get_inner_categories($i->id);\n\n // Get membrane/methods.... \n $ms = [];\n $total = 1;\n\n if(isset($model))\n {\n $ms = $model->get_linked_data($i->id);\n }\n\n $d = array\n (\n 'name' => $i->name,\n 'id_element' => $i->id,\n 'id_enum_type' => $i->id_enum_type,\n 'fixed' => $fixed,\n 'children' => []\n );\n\n if(count($ch))\n {\n $ch = Arr::sort_by_key($ch, 'name');\n $d['children'] = $ch;\n }\n\n if(count($ms))\n {\n foreach($ms as $m)\n {\n if($i->type == Enum_types::TYPE_TRANSPORTER_CATS)\n {\n $total = $t_model->where('id_target', $m->id)->count_all();\n }\n\n $d['children'][] = array\n (\n 'name' => $m->name,\n 'id_element' => $m->id,\n 'id_enum_type' => $i->id_enum_type,\n 'value' => $total,\n 'last' => 1\n ); \n }\n }\n\n $d['children'] = Arr::sort_by_key($d['children'], 'name');\n $res[] = $d;\n }\n\n return $res;\n }\n }\n\n // Get init ids\n $e = $this->queryOne('\n SELECT DISTINCT etl.id, et.name, et.id as id_enum_type \n FROM enum_type_links etl\n JOIN enum_types et ON et.id = etl.id_enum_type \n WHERE id_enum_type = ? AND id_enum_type = id_enum_type_parent\n ', array($type));\n\n $result = get_inner_categories($e->id, True);\n\n $link = new Enum_type_links($e->id);\n\n // Add uncategorized data\n if($link->enum_type->type == Enum_types::TYPE_MEMBRANE_CATS)\n {\n $model = new Membranes();\n }\n elseif($link->enum_type->type == Enum_types::TYPE_METHOD_CATS)\n {\n $model = new Methods();\n }\n elseif($link->enum_type->type == Enum_types::TYPE_TRANSPORTER_CATS)\n {\n $model = new Transporter_targets();\n $t_model = new Transporters();\n }\n\n $unclass = $model->get_all_without_links();\n\n if(count($unclass))\n {\n \n $d = array \n (\n 'name' => 'Unclassified',\n 'id_element' => NULL,\n 'fixed' => True,\n 'children' => []\n );\n\n foreach($unclass as $u)\n {\n if($link->enum_type->type == Enum_types::TYPE_TRANSPORTER_CATS)\n {\n $total = $t_model->where('id_target', $u->id)->count_all();\n }\n else\n {\n $total = 1;\n }\n\n $d['children'][] = array\n (\n 'name' => $u->name,\n 'id_element' => $u->id,\n 'id_enum_type' => $u->id_enum_type,\n 'value' => $total,\n 'last' => true\n );\n }\n\n $result[] = $d;\n }\n\n return $result;\n }", "public function get_structure()\n {\n function get_item($item)\n {\n $et = new Enum_types();\n $etl = new Enum_type_links($item->link_id);\n $children = $et->get_enum_children($item->link_id);\n $items = $etl->get_items();\n\n $res = array\n (\n 'name' => $item->name,\n 'id_link' => $item->link_id,\n 'type' => $etl->enum_type->type,\n 'regexp' => $etl->reg_exp,\n 'children' => array()\n );\n\n foreach($children as $ch)\n {\n $res['children'][] = get_item($ch);\n }\n\n foreach($items as $i)\n {\n $res['children'][] = new Iterable_object(array\n (\n 'name' => $i->name,\n 'id' => $i->id,\n 'type' => $i->type,\n 'regexp' => $i->reg_exp,\n 'children' => NULL\n ));\n }\n\n $res['children'] = new Iterable_object($res['children']);\n\n // return $res;\n return new Iterable_object($res);\n }\n\n $top_sections = $this->queryAll('\n SELECT DISTINCT et.*, etl.id as link_id, etl.reg_exp\n FROM enum_type_links etl\n JOIN enum_types et ON et.id = etl.id_enum_type AND etl.id_parent_link IS NULL AND et.type IN (?,?,?)\n ORDER BY et.name ASC\n ', array(Enum_types::TYPE_MEMBRANE_CATS, Enum_types::TYPE_METHOD_CATS, Enum_types::TYPE_TRANSPORTER_CATS));\n\n $result = array();\n\n foreach($top_sections as $section)\n {\n $result[] = get_item($section);\n }\n\n return new Iterable_object($result);\n }", "function getTypeChildren($typeId = null, $options = array ()) {\n\t\t// TODO: Refactor Type Entries Caching\n\t\t$varmap = $options;\n\t\tif ($typeId) {\n\t\t\t$myURL = $this->getTypeLink($typeId, \"down\");\n\t\t $myURL.= $this->GenURLQueryString($options);\n\t\t} else {\n\t\t\t//TODO: Need right URL\n\t\t\t$myURL = $this->processTemplate($this->workspace->collections['types'], $varmap);\n\t\t}\n\t\t$ret = $this->doGet($myURL);\n\t\t$typs = $this->extractTypeFeed($ret->body);\n\t\t$this->cacheTypeFeedInfo($typs);\n\t\treturn $typs;\n\t}", "public function getChildren($field = null)\n\t{\n\t\t// If the request is in Live Preview mode, use the Neo-extended criteria model, which supports Live Preview mode\n\t\tif(craft()->neo->isPreviewMode() || $this->isUsingMemoized())\n\t\t{\n\t\t\tif(!isset($this->_liveCriteria['children']))\n\t\t\t{\n\t\t\t\t$this->_liveCriteria['children'] = $this->getDescendants(1);\n\t\t\t}\n\n\t\t\treturn $this->_liveCriteria['children'];\n\t\t}\n\n\t\treturn parent::getChildren($field);\n\t}", "public function getAllowedParentTypes()\n {\n $res = new EnumSet(self::class);\n foreach (self::getEnumerators() as $nodeType) {\n if($this->allowParent($nodeType)) {\n $res->attach($nodeType);\n }\n }\n return $res;\n }", "public function getChildCategoryByType($type) {\n $where = array();\n if ($type == 1){\n $sql = \"SELECT\n p.`name`,\n c.`name` AS child_name,\n c.id ,\n c.level \n FROM\n d_category c\n INNER JOIN d_category AS p ON c.parent = p.id\n where c.del_flg = 0 and p.del_flg = 0\n \";\n } else {\n $sql = \"SELECT\n c.`name`,\n c.id ,\n c.level\n FROM\n d_category c\n where c.type = ? and c.del_flg = 0 \n \";\n $where[] = $type;\n } \n \n if ( !empty($sql)){\n $query= $this->db->query($sql, $where);\n if ($query->num_rows() > 0){\n return $query->result_array();\n }\n }\n \n return FALSE;\n }", "protected function getChildren() {\n $children = \"\";\n foreach($this->children as $key=>$val) {\n $children .= $val->getXML();\n }\n return $children;\n\n }", "function child_list($parent, $post_type)\n {\n if ( is_integer( $parent ) ) {\n $parent = get_post( $parent );\n }\n $output = '';\n require_once dirname( __FILE__ ) . '/relationship/form-child.php';\n $this->child_form = new WPCF_Relationship_Child_Form(\n $parent,\n $post_type,\n $this->settings( $parent->post_type, $post_type )\n );\n foreach($this->child_form->children as $child) {\n $output .= sprintf(\n '<li>%s</li>',\n apply_filters('post_title', $child->post_title)\n );\n }\n if ( $output ) {\n $output = sprintf(\n '<ul>%s</ul>',\n $output\n );\n } else {\n $output = sprintf(\n '<p class=\"info\">%s</p>',\n $this->child_form->child_post_type_object->labels->not_found\n );\n }\n\n return $output;\n }", "public function find_in_children(Token\\Token $from, $type)\n\t{\n\t\t$result = array();\n\t\tforeach ($from->get_children() as $child)\n\t\t{\n\t\t\tif ($child->get_type() === $this->get_type($type))\n\t\t\t{\n\t\t\t\t$result[] = $child;\n\t\t\t}\n\t\t\telseif ($child instanceof Token\\Token)\n\t\t\t{\n\t\t\t\t$result = array_merge($result, $this->find_in_children($child, $type));\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "final public function getChildren() {\n\t\treturn array();\n\t}", "public function getChildren(): array;", "public function getChildren(): array;", "public function getChildren(): array;", "public function getChildren() {\n return $this->_item->getChildren()->toArray();\n }", "function bbp_get_all_child_ids($parent_id = 0, $post_type = 'post')\n{\n}", "public function getChildren(){\n\t\treturn $this->children;\n\t}", "public function getChildren() {\r\n return $this->getChildrenAL();\r\n }", "public function children()\n {\n return $this->hasMany(static::class, $this->getParentKeyName());\n }", "public function get_children() {\n\n\t\treturn $this->children;\n\n\t}", "public function children();", "public function children();", "public function children();", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }" ]
[ "0.67935055", "0.6602728", "0.618167", "0.59988564", "0.5959855", "0.58687127", "0.5632632", "0.55610126", "0.5531317", "0.5529553", "0.551362", "0.5491195", "0.5489428", "0.54428744", "0.54428744", "0.54428744", "0.54318774", "0.542488", "0.5424323", "0.5411914", "0.54020035", "0.5371034", "0.53656226", "0.53656226", "0.53656226", "0.5342939", "0.5342939", "0.5342939", "0.5342939", "0.5342939" ]
0.6727916
1
Checks, if given enum_type has link
public function has_link() { $exists = $this->queryAll(' SELECT * FROM enum_type_links WHERE id_enum_type = ? OR id_enum_type_parent = ? ', array($this->id, $this->id)); return count($exists); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLinkType();", "function quicklinks_can_link($type, $subtype = null) {\n\t\n\t$supported_types = quicklinks_get_supported_types();\n\tif (empty($supported_types) || !is_array($supported_types)) {\n\t\treturn false;\n\t}\n\t\n\t// is type registered\n\t$type = strtolower($type);\n\tif (!isset($supported_types[$type])) {\n\t\treturn false;\n\t}\n\t\n\t// check (optional) subtype\n\tif (!empty($subtype) && !in_array($subtype, $supported_types[$type])) {\n\t\treturn false;\n\t}\n\t\n\treturn true;\n}", "function on_page($link, $type = \"name\")\n {\n switch ($type) {\n case \"url\":\n $result = ($link == request()->fullUrl());\n break;\n\n default:\n $result = ($link == request()->route()->getName());\n }\n\n return $result;\n }", "public function defineLinkTypeRequirements();", "public function getLinkTypes();", "private function set_type_and_link() {\n $results = $this->DB->run('\n SELECT bat.title AS type\n FROM buyer_accounts ba\n JOIN buyer_account_types bat\n ON bat.id = ba.buyer_account_type_id\n WHERE ba.id = :id\n LIMIT 1\n ', [\n 'id' => $this->id\n ]);\n\n if (!isset($results[0])) {\n return false;\n } else {\n $this->type = $results[0]['type'];\n $this->link = ($this->type == 'individual' || $this->type == 'other' ? 'buyer' : $this->type) . '/' . $this->slug;\n }\n }", "function determineLinkType()\n\t{\n\t\t// determine link type and target\n\t\t$ltype = ($_SESSION[\"il_link_type\"] == \"\")\n\t\t\t? $this->default_type\n\t\t\t: $_SESSION[\"il_link_type\"];\n\t\t$ltype_arr = explode(\"_\", $ltype);\n\t\t\n\t\tif (!isset($this->ltypes[$ltype_arr[0]]) &&\n\t\t\t!isset($this->ltypes[$ltype]))\n\t\t{\n\t\t\t$this->link_type = $this->default_type;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->link_type = ($ltype_arr[0] == \"\")\n\t\t\t\t? $this->default_type\n\t\t\t\t: $ltype_arr[0];\n\t\t\t$this->link_target = $ltype_arr[1];\n\t\t}\n\t}", "public function hasTargetType(string $type): bool;", "static public function validType($menu) {\n $valid = ($menu->type == 'url' || $menu->type == 'separator') ? false : true;\n\n return $valid;\n }", "public function checkIfItIsCustomLink()\n {\n $check = Validator::make($this->node, [\n 'title' => 'required',\n 'link' => 'required',\n ]);\n\n if ($check->fails()) {\n throw new InvalidMenuStructureException($check->errors());\n }\n\n return true;\n }", "public function getIsEnum() : bool\n {\n return $this->IsSubclassOf(self::GetByName('System\\Enum'));\n }", "public function checkLink($link);", "public function getXsiTypeName() {\n return \"LinkType\";\n }", "public function isLink(): bool;", "public function buttonByType($type) {\n $types = array(\n 'default' => true,\n 'default_temp' => true\n );\n return !isset($types[$type]);\n }", "function isFieldLinkedToType() {\n\t\tglobal $default;\n\t\t$sql = $default->db;\n\t\t$sQuery = \"SELECT document_type_id FROM \" . $default->document_type_fields_table . \" WHERE field_id = ?\";/*ok*/\n $aParams = array($this->iId);\n\t\tif ($sql->query(array($sQuery, $aParams))) {\n\t\t\t$rows = $sql->num_rows($sql);\n\t \tif ($rows > 0) {\n\t \t\t// instantiate the document types and return\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function is_type_link($path) {\n\t\t//--\n\t\t$path = (string) $path;\n\t\t//--\n\t\tif((string)trim((string)$path) == '') {\n\t\t\tself::log_warning(__METHOD__.'() // Skip: Empty Path');\n\t\t\treturn false;\n\t\t} //end if\n\t\t//--\n\t\tclearstatcache(true, $path);\n\t\t//--\n\t\treturn (bool) is_link($path);\n\t\t//--\n\t}", "function hook_flag_link_type_info_alter(array &$link_types) {\n\n}", "static protected function isLink($val)\n {\n return preg_match('/#[0-9]+:[0-9]+/', $val) !== 0;\n }", "public function is(mixed $enumValue): bool;", "public function getLinkType()\n {\n return null;\n }", "function isTypeLeague() {\r\n\t\treturn $this->record['type'] == 1;\r\n\t}", "function getLink(array $links, $type) {\n foreach ($links as $link) {\n if ($link->getRel() == $type) {\n return $link->getHref();\n }\n }\n return \"\";\n}", "public function has($type);", "private function _check_access( $type ) {\n $tokens = Access_token::inst()->get_by_type( $type, $this->c_user->id, $this->profile->id );\n if(empty($tokens)) {\n return false;\n } else {\n return true;\n }\n }", "public function getIsSetExternalLinkAttribute()\n {\n $id = $this->attributes['id'];\n $ext_links = DB::table('admin_external_links')\n ->where('rel_id', $id)\n ->where('type', 'orden')\n ->get();\n\n if (count($ext_links) > 0)\n {\n return true;\n } else {\n return false;\n }\n }", "public static function isEnumable($class) {\n if(!class_exists($class)) {\n return FALSE;\n }\n return is_subclass_of($class, __CLASS__);\n }", "public function checkType($attribute, $params)\n\t{\n\t\tif ($this->type_id == self::TYPE_LINK) {\n\t\t\t$validator = \\CValidator::createValidator('required', $this, 'link');\n\t\t\t$this->validatorList->add($validator);\n\t\t\tforeach (Lang::getLanguageKeys() as $language) {\n\t\t\t\tif ($language == Lang::getDefault()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$validator = \\CValidator::createValidator('required', $this, 'link_' . $language);\n\t\t\t\t$this->validatorList->add($validator);\n\t\t\t}\n\t\t}\n\t}", "public function shouldCheckLink($url);", "protected function findLinkType(array $data, string $link): string\n {\n $dokType = $data['doktype'];\n \n if ($dokType === 199) {\n return AbstractMenuRenderer::TYPE_LINK_SPACER;\n }\n \n if ($dokType === 3) {\n if (! GeneralUtility::isOnCurrentHost($link)) {\n return AbstractMenuRenderer::TYPE_LINK_EXTERNAL;\n }\n \n return AbstractMenuRenderer::TYPE_LINK_INTERNAL;\n }\n \n return AbstractMenuRenderer::TYPE_LINK_PAGE;\n }" ]
[ "0.634569", "0.6342591", "0.5954446", "0.5932953", "0.5929981", "0.5900323", "0.58423024", "0.5726788", "0.5705214", "0.56720334", "0.5626846", "0.5622582", "0.5599302", "0.55533665", "0.5532579", "0.55281764", "0.55270225", "0.54441845", "0.53764045", "0.53753114", "0.5374937", "0.5360713", "0.5359649", "0.5318345", "0.5313259", "0.5298459", "0.52875334", "0.52870804", "0.5282267", "0.5279635" ]
0.7599824
0
Returns categories for given type
public function get_categories($type) { if(!self::is_type_valid($type)) { return []; } if(!function_exists('get_inner_categories')) { function get_inner_categories($link_id, $fixed = false) { $link = new Enum_type_links($link_id); $res = []; $items = $link->where(array ( 'id_parent_link' => $link_id, 'et.type' => $link->enum_type->type )) ->join('enum_types et ON et.id = enum_type_links.id_enum_type') ->select_list('enum_type_links.id as id, et.id as id_enum_type, et.name as name, et.type as type') ->order_by('name') ->get_all(); if($link->enum_type->type == Enum_types::TYPE_MEMBRANE_CATS) { $model = new Membranes(); } elseif($link->enum_type->type == Enum_types::TYPE_METHOD_CATS) { $model = new Methods(); } elseif($link->enum_type->type == Enum_types::TYPE_TRANSPORTER_CATS) { $model = new Transporter_targets(); $t_model = new Transporters(); } foreach($items as $i) { $ch = get_inner_categories($i->id); // Get membrane/methods.... $ms = []; $total = 1; if(isset($model)) { $ms = $model->get_linked_data($i->id); } $d = array ( 'name' => $i->name, 'id_element' => $i->id, 'id_enum_type' => $i->id_enum_type, 'fixed' => $fixed, 'children' => [] ); if(count($ch)) { $ch = Arr::sort_by_key($ch, 'name'); $d['children'] = $ch; } if(count($ms)) { foreach($ms as $m) { if($i->type == Enum_types::TYPE_TRANSPORTER_CATS) { $total = $t_model->where('id_target', $m->id)->count_all(); } $d['children'][] = array ( 'name' => $m->name, 'id_element' => $m->id, 'id_enum_type' => $i->id_enum_type, 'value' => $total, 'last' => 1 ); } } $d['children'] = Arr::sort_by_key($d['children'], 'name'); $res[] = $d; } return $res; } } // Get init ids $e = $this->queryOne(' SELECT DISTINCT etl.id, et.name, et.id as id_enum_type FROM enum_type_links etl JOIN enum_types et ON et.id = etl.id_enum_type WHERE id_enum_type = ? AND id_enum_type = id_enum_type_parent ', array($type)); $result = get_inner_categories($e->id, True); $link = new Enum_type_links($e->id); // Add uncategorized data if($link->enum_type->type == Enum_types::TYPE_MEMBRANE_CATS) { $model = new Membranes(); } elseif($link->enum_type->type == Enum_types::TYPE_METHOD_CATS) { $model = new Methods(); } elseif($link->enum_type->type == Enum_types::TYPE_TRANSPORTER_CATS) { $model = new Transporter_targets(); $t_model = new Transporters(); } $unclass = $model->get_all_without_links(); if(count($unclass)) { $d = array ( 'name' => 'Unclassified', 'id_element' => NULL, 'fixed' => True, 'children' => [] ); foreach($unclass as $u) { if($link->enum_type->type == Enum_types::TYPE_TRANSPORTER_CATS) { $total = $t_model->where('id_target', $u->id)->count_all(); } else { $total = 1; } $d['children'][] = array ( 'name' => $u->name, 'id_element' => $u->id, 'id_enum_type' => $u->id_enum_type, 'value' => $total, 'last' => true ); } $result[] = $d; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function categories($type = 'id')\n {\n if (empty($this->categories)) {\n $sql = 'SELECT * FROM ' . $this->db->prefix('mod_works_categories_rel') . ' as r LEFT JOIN ' . $this->db->prefix('mod_works_categories') . ' as c ON\n c.id_cat = r.category WHERE r.work = ' . $this->id();\n\n $result = $this->db->query($sql);\n while (false !== ($row = $this->db->fetchArray($result))) {\n $this->categories[$row['id_cat']] = $row;\n }\n }\n\n if ('id' === $type) {\n $ret = [];\n foreach ($this->categories as $cat) {\n $ret[] = $cat['id_cat'];\n }\n\n return $ret;\n }\n\n if ('name' === $type) {\n $ret = [];\n foreach ($this->categories as $id => $cat) {\n $ret[$id] = $cat['name'];\n }\n\n return $ret;\n }\n\n if ('objects' === $type) {\n $ret = [];\n foreach ($this->categories as $id => $cat) {\n $tmp = new Works_Category();\n $tmp->assignVars($cat);\n $ret[] = $tmp;\n }\n\n return $ret;\n }\n\n return $this->categories;\n }", "public function getCategorys()\n {\n $data = $this->getData();\n if(isset($data['menu_type'])){\n switch ($data['menu_type']) {\n case 'navigation':\n\n return $this->getCategorysTop();\n case 'vertical':\n\n return $this->getCategorysTop();\n case 'accordion':\n\n return $this->getCategorysAcc();\n }\n }\n }", "function fetchCategories($type = null, $id = null) {\n\t\tif ($id) {\n\t\t\treturn $this->dbProcessor(sprintf(\"SELECT id, title, value, info FROM categories WHERE `value` = '%s'\", $id), 1); \n\t\t} else {\n\t\t\t$event = $type == 1 ? ' WHERE (`value` != \\'event\\' AND `value` != \\'exhibition\\')' : '';\n\t\t\treturn $this->dbProcessor(sprintf(\"SELECT id, title, value, info FROM categories%s\", $event), 1); \n\t\t}\n\t}", "public function getCategories()\n {\n return $this->hasMany(Category::class, ['typeId' => 'id']);\n }", "public function getByTypeCat($type, $categorie){\n $this->db->select ('coupon.id, coupon.image, coupon.description, coupon.partnerId, coupon.cityId');\n $this->db->select ('partner.name as partnerName, city.name as cityName');\n $this->db->from('coupon');\n $this->db->join('xref_coupon_catalog', 'xref_coupon_catalog.couponId = coupon.id');\n $this->db->join('catalog', 'catalog.id = xref_coupon_catalog.catalogId ');\n $this->db->join('partner', 'coupon.partnerId = partner.id ');\n $this->db->join('city', 'coupon.cityId = city.id ');\n $this->db->where('coupon.status = 1');\n $this->db->where('catalog.status = 1');\n $this->db->where('catalog.type', $type);\n $this->db->where('catalog.id', $categorie);\n $this->db->where('coupon.iniDate <= curdate()');\n $this->db->where('coupon.endDate >= curdate()');\n $this->db->group_by('coupon.id'); \n return $this->db->get()->result();\n }", "function bi_posttype_cats($post_type) {\n\t\n\tif ( !post_type_exists( $post_type ) ) return;\n\t\n\t$post_type_cats = array();\n\t$post_type_cats_obj = get_terms( $post_type .'_cats' );\n\t$post_type_cats[''] = __('All','pixel-linear');\n\tforeach ( $post_type_cats_obj as $post_type_cat ) {\n\t\t$post_type_cats[$post_type_cat->term_id] = $post_type_cat->name;\n\t}\n\treturn $post_type_cats;\t\n}", "function categories($type){\n\t$values = array();\n\t$q = mysql_query(\"SELECT * FROM `category` WHERE `type`='$type' ORDER BY `precedence` ASC\");\n\twhile($qd = mysql_fetch_assoc($q)){\n\t\t$values[$qd['id']] = f($qd['title']);\n\t}\n\treturn $values;\n}", "public function categories($type)\n {\n $user = Auth::user();\n if($type === 'ods')\n {\n $filename = 'categories_' . date('Y-m-d_H-i-s') . '.ods';\n return (new UserCategoriesExport)->forUser($user->uuid)->download($filename, \\Maatwebsite\\Excel\\Excel::ODS);\n }\n elseif($type === 'csv')\n {\n $filename = 'categories_' . date('Y-m-d_H-i-s') . '.csv';\n return (new UserCategoriesExport)->forUser($user->uuid)->download($filename, \\Maatwebsite\\Excel\\Excel::CSV);\n }\n elseif($type === 'html')\n {\n $filename = 'categories_' . date('Y-m-d_H-i-s') . '.html';\n return (new UserCategoriesExport)->forUser($user->uuid)->download($filename, \\Maatwebsite\\Excel\\Excel::HTML);\n }\n else\n {\n $filename = 'categories_' . date('Y-m-d_H-i-s') . '.xlsx';\n return (new UserCategoriesExport)->forUser($user->uuid)->download($filename, \\Maatwebsite\\Excel\\Excel::XLSX);\n }\n }", "public function getCategories();", "public function getCategories();", "public function getCategories();", "public function getCategories();", "public function getChildCategoryByType($type) {\n $where = array();\n if ($type == 1){\n $sql = \"SELECT\n p.`name`,\n c.`name` AS child_name,\n c.id ,\n c.level \n FROM\n d_category c\n INNER JOIN d_category AS p ON c.parent = p.id\n where c.del_flg = 0 and p.del_flg = 0\n \";\n } else {\n $sql = \"SELECT\n c.`name`,\n c.id ,\n c.level\n FROM\n d_category c\n where c.type = ? and c.del_flg = 0 \n \";\n $where[] = $type;\n } \n \n if ( !empty($sql)){\n $query= $this->db->query($sql, $where);\n if ($query->num_rows() > 0){\n return $query->result_array();\n }\n }\n \n return FALSE;\n }", "function category_get($table,$type=''){\n\t\t// Prepare varibles\n\t\t$this->categories=array();\n\t\t$this->index=array();\n\t\t$this->str='';\n\n\t\t// Check statements type\n\t\tif($type=='project_id'){\n\t\t\t$sql=\"WHERE project_id=\".$this->data['project_id'].\"\";\n\t\t}else if($type=='user_id'){\n\t\t\t$sql=\"WHERE user_id=\".$this->data['user_id'].\"\";\n\t\t}else if($type=='all' || $type=='both'){\n\t\t\t$sql=\"WHERE project_id=\".$this->data['project_id'].\" AND user_id=\".$this->data['user_id'].\"\";\n\t\t}else{\n\t\t\t$sql='';\n\t\t}\n\n\t\t// Get selected data\n\t\t$stmt = $this->pdo->prepare(\"SELECT * FROM edit_\".$table.\"_categories \".$sql.\" ORDER by level, position\");\n\t\t$stmt->bindParam(':project_id', $this->data['project_id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\n\t\t// Check if item exist\n\t\t$once['count']=$stmt->rowCount();\n\t\tif($once['count']){\n\t\t\t// fetch count as table\n\t\t\tforeach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {\n\t\t\t\t$this->categories[$row['id']]=$row;\n\t\t\t\t$this->index[$row['parent_id']][]=$row['id'];\n\t\t\t\tif($row['parent_id']==0){\n\t\t\t\t\t$this->root_categories[]=$row;\n\t\t\t\t}\n\t\t\t\t$once['items'][]=$row;\n\t\t\t}\n\t\t\t$once['status']='ok';\n\t\t}else{\n\t\t\t$once['errors'][]=''.$table.' category - not exists';\n\t\t\t$once['error']++;\n\t\t}\n\t\treturn $once;\n\t}", "protected function retrieve_course_user_categories_for_course_type()\n {\n return DataManager::retrieve_course_user_categories_from_course_type(\n $this->get_selected_course_type_id(),\n $this->get_parent()->get_user_id()\n );\n }", "public static function getCategory();", "public function get_categories() {\n\t\treturn [ 'atl-category' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'atl-category' ];\n\t}", "function category($post_type) {\n $terms = get_the_terms( get_the_id(), get_taxonomy_name($post_type) );\n \n if ($terms) {\n foreach ( $terms as $term ) {\n $p = false;\n if ($term->parent) {\n $p = get_term($term->parent, $post_type === 'lwa_feature' ? 'featured_tax' : 'news_tax');\n }\n \n return array(\n 'id' => $term->term_id,\n 'name' => enc( $term->name ),\n 'permalink' => get_bloginfo('url') . \"/\" . ($post_type === 'lwa_feature' ? 'featured' : 'news') . \"/\". $term->slug,\n 'slug' => $term->slug,\n 'description' => $term->description,\n 'parent' => $p ? enc( $p->name ) : null,\n 'parentPermalink' => $p ? get_bloginfo('url') . \"/\" . ($post_type === 'lwa_feature' ? 'featured' : 'news') . \"/\". $p->slug : null\n );\n }\n }\n return null;\n}", "public function getCategorizationType();", "public function categories();", "public function categories();", "public function categories();", "public static function search_category($search = '' , $type_category = '', $shop_id = 0)\n\t{\n\t\t$data = [];\n\n\t\t$_category = Tbl_category::search($search, $type_category, $shop_id)->orderBy('type_name','asc')->get();;\n\t\t\n\t\t$data['html'] = '';\n\n\t\tforeach($_category as $key => $cat)\n {\n \t$data[$key] = $cat; \n $data['html'] .= '<a href=\"javascript:\" class=\"list-group-item category-list\" data-content=\"'.$cat->type_id.'\">'.$cat->type_name.'</a>';\n $count = Tbl_category::where('type_shop', $shop_id)->where('type_parent_id', $cat->type_parent_id)->where('archived',0)->count();\n \n if($count != 0)\n {\n \t$data[$key]['sub'] = Category::re_select_raw($shop_id, $cat->type_id);\n $data['html'] .= '<div class=\"list-group\">'.Category::re_select_html($shop_id, $cat->type_id).'</div>';\n }\n }\n\n return $data;\n\t}", "public function index($type = null)\n {\n if(permissions('categories_view') == 0){\n //set session message\n Session::flash('message', __('strings.do_not_have_permission'));\n return view('permissions');\n }\n if($type == null){\n $list = Category::join('categories_type', function ($join) use ($type) { $join->on('categories_type.id', '=', 'categories.category_type_id')->whereBetween('categories_type.type', [1,2])->where(['categories.org_id' => Auth::user()->org_id]); })->select('categories.*', 'categories_type.type')->paginate(20);\n }else{\n $list = Category::join('categories_type', function ($join) use ($type) { $join->on('categories_type.id', '=', 'categories.category_type_id')->where(['categories_type.type' => $type, 'categories.org_id' => Auth::user()->org_id]); })->select('categories.*')->paginate(20);\n }\n\n return view('categories.index', compact('list', 'type'));\n }", "public function getCategories() {\n\t\t$categories = array(\n\t\t\t'' => 'None/Unknown',\n\t\t\t'Feedb' => array(\n\t\t\t\t'' => 'None/Unknown',\n\t\t\t\t'Rep' => 'Reports',\n\t\t\t\t'Sugg' => 'Suggestions',\n\t\t\t\t'Compl' => 'Complaints',\n\t\t\t\t'Bug' => 'Bug/Error',\n\t\t\t),\n\t\t\t'Help' => array(\n\t\t\t\t'' => 'None/Unknown',\n\t\t\t\t'Acc' => 'Account',\n\t\t\t\t'Paym' => 'Payment',\n\t\t\t\t'Subsc' => 'Subscription/Membership',\n\t\t\t\t'Evnt' => 'Events',\n\t\t\t\t'eSprt' => 'E-Sports',\n\t\t\t\t'Grps' => 'Groups',\n\t\t\t\t'oUsr' => 'Other users',\n\t\t\t\t'Cntn' => 'Content',\n\t\t\t),\n\t\t\t'Cont' => array(\n\t\t\t\t'' => 'None/Unknown',\n\t\t\t\t'sCnt' => 'Staff contact',\n\t\t\t\t'jAppl' => 'Job application',\n\t\t\t),\n\t\t);\n\t\treturn $categories;\n\t}", "function getCategorias();", "public function getCategorie();", "static function categories(){\n $categories = [];\n \n foreach(App::get('database')->getAllWithFields('categories', ['id', 'name']) as $c){\n $categories[$c->id] = ucfirst(strtolower($c->name));\n }\n \n return $categories;\n }", "private function getCategories(): array\n {\n return [\n 'vacances',\n 'au quotidien',\n 'réduction immédiate',\n 'soldes',\n 'meilleure réduction',\n ];\n }" ]
[ "0.80996525", "0.7467645", "0.7392301", "0.7351182", "0.7250453", "0.71454287", "0.7056394", "0.69940376", "0.6929854", "0.6929854", "0.6929854", "0.6929854", "0.688578", "0.6874326", "0.67943937", "0.6750273", "0.6737159", "0.6737159", "0.6735083", "0.66965634", "0.669153", "0.669153", "0.669153", "0.66899675", "0.6614618", "0.6608569", "0.6586988", "0.6578729", "0.6535922", "0.652625" ]
0.77983814
1
Helper functions / Set a new picture
function set_new_picture($filename) { if (empty($filename)){ $filename= "./plugins/goto/images/default_icon.png"; $this->use_gotoMimeIcon= "*removed*"; }else{ $this->use_gotoMimeIcon= $filename; } if (file_exists($filename)){ $fd = fopen ($filename, "rb"); $this->iconData= fread ($fd, filesize ($filename)); session::set('binary',$this->iconData); session::set('binarytype',"image/jpeg"); fclose ($fd); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOverritePic($value)\n {\n $this->_overritePic = $value;\n }", "function setPicture($picture)\r\n {\r\n $this->_picture = $picture;\r\n }", "function setpicture($picture)\r\n\t{\r\n\t\t$this->picture = $picture;\r\n\t}", "function setPicture($picture = \"\")\n\t{\n\t\t$this->picture_or_definition = $picture;\n\t}", "public function setImageProperty ($name, $value) {}", "public function setImage($replace) {\n\t}", "function setImagePath( $value )\r\n {\r\n $this->ImagePath = $value;\r\n }", "public function setImage($value)\n {\n $this->image = $value;\n }", "public function setPicture($picture)\n {\n // if(empty($picture)){\n // $this->picture = \"skull.jpg\";\n // return $this;\n // }else{\n $this->picture = $picture;\n\n return $this;\n \n \n }", "public function setImage (Imagick $replace) {}", "public function changePicture(){\n\n // reset the opening to false\n $this->valid_openings[\"N\"] = false;\n $this->valid_openings[\"E\"] = false;\n $this->valid_openings[\"S\"] = false;\n $this->valid_openings[\"W\"] = false;\n\n // set the picture and opening\n switch ($this->id) {\n case \"cap-e.png\":\n $this->valid_openings[\"E\"] = true;\n break;\n case \"cap-n.png\":\n $this->valid_openings[\"N\"] = true;\n break;\n case \"cap-s.png\":\n $this->valid_openings[\"S\"] = true;\n break;\n case \"cap-w.png\":\n $this->valid_openings[\"W\"] = true;\n break;\n case \"gauge-0.png\":\n $this->valid_openings[\"W\"] = true;\n break;\n case \"gauge-190.png\":\n $this->valid_openings[\"W\"] = true;\n break;\n case \"ninety-es.png\":\n $this->valid_openings[\"E\"] = true;\n $this->valid_openings[\"S\"] = true;\n break;\n case \"ninety-ne.png\":\n $this->valid_openings[\"N\"] = true;\n $this->valid_openings[\"E\"] = true;\n break;\n case \"ninety-sw.png\":\n $this->valid_openings[\"S\"] = true;\n $this->valid_openings[\"W\"] = true;\n break;\n case \"ninety-wn.png\":\n $this->valid_openings[\"W\"] = true;\n $this->valid_openings[\"N\"] = true;\n break;\n case \"straight-h.png\":\n $this->valid_openings[\"E\"] = true;\n $this->valid_openings[\"W\"] = true;\n break;\n case \"straight-v.png\":\n $this->valid_openings[\"N\"] = true;\n $this->valid_openings[\"S\"] = true;\n break;\n case \"tee-esw.png\":\n $this->valid_openings[\"E\"] = true;\n $this->valid_openings[\"S\"] = true;\n $this->valid_openings[\"W\"] = true;\n break;\n case \"tee-nes.png\":\n $this->valid_openings[\"N\"] = true;\n $this->valid_openings[\"E\"] = true;\n $this->valid_openings[\"S\"] = true;\n break;\n case \"tee-swn.png\":\n $this->valid_openings[\"N\"] = true;\n $this->valid_openings[\"W\"] = true;\n $this->valid_openings[\"S\"] = true;\n break;\n case \"tee-wne.png\":\n $this->valid_openings[\"W\"] = true;\n $this->valid_openings[\"N\"] = true;\n $this->valid_openings[\"E\"] = true;\n break;\n case \"valve-open.png\":\n $this->valid_openings[\"E\"] = true;\n break;\n case \"valve-closed.png\":\n $this->valid_openings[\"E\"] = true;\n break;\n }\n }", "public function setImage($image);", "public function setImageProperty($name, $value) {\n\t}", "public function setPicture(?array $value): void {\n $this->getBackingStore()->set('picture', $value);\n }", "public function setPicture($picture)\n {\n $this->picture = $picture;\n }", "public function setPicture($picture)\n{\n$this->picture = $picture;\n\nreturn $this;\n}", "function setImageID( $value )\r\n {\r\n $this->ImageID = $value;\r\n }", "public function setPicture($picture) {\n $this->picture = $picture;\n }", "public function setImg($img)\n {\n $this->img = $img;\n }", "public function setImageMatte ($matte) {}", "function setImageFile($filePath);", "function add_image($image)\r\n {\r\n $this->image = $image;\r\n }", "function add_image($image)\r\n {\r\n $this->image = $image;\r\n }", "public function setImage(Image $imageObject) {\r\n \r\n }", "protected function setImage(){\n\t\tif($this->deviceID === false){\n\t\t\t$this->image = null;\n\t\t\treturn;\n\t\t}\n\t\tif(!file_exists($this->imagesDirectory)){\n\t\t\t$realpath = @realpath($this->imagesDirectory);\n\t\t\tif(!$realpath){\n\t\t\t\tif($this->imagesDirectory[0]=='.'){\n\t\t\t\t\tthrow new Exception(\"Error: the local images directory was specified as a relative path ($this->imagesDirectory), but could not be resolved. Current directory: \".getcwd());\n\t\t\t\t\texit(1);\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"Error: the local images directory specified does not exist: \".$this->imagesDirectory);\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!$this->imageExists($this->deviceID)){\n\t\t\tif($this->descend){\n\t\t\t\t// Check fall back tree for an alternate image, starting at the current device, working back to generic\n\t\t\t\tforeach(array_reverse(explode(',',$this->wurfl->capabilities['tera_wurfl']['fall_back_tree'])) as $parentID){\n\t\t\t\t\tif($this->imageExists($parentID)){\n\t\t\t\t\t\t$this->image = $this->baseURL . $parentID . $this->imageExt;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->image = null;\n\t\t\treturn;\n\t\t}\n\t\t$this->image = $this->baseURL . $this->deviceID . $this->imageExt;\n\t}", "function setImageBlob($blob);", "public function setImageFilename ($filename) {}", "function updateimage()\n\t{\n\t}", "function tx_bahag_photogallery_graphics() {\n $this->imPath = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];\n }", "public function setImageProfile ($name, $profile) {}" ]
[ "0.726978", "0.70932883", "0.708684", "0.7053691", "0.69494474", "0.69234407", "0.67796516", "0.6768342", "0.6762809", "0.6742329", "0.6683991", "0.6678066", "0.65935755", "0.6565508", "0.65337664", "0.6508348", "0.6482943", "0.6477237", "0.6476757", "0.6448472", "0.64444584", "0.6412837", "0.6412837", "0.64075136", "0.64046985", "0.6373154", "0.6348488", "0.6328483", "0.6322213", "0.6267243" ]
0.7486567
0
/ Return a dialog with all fields that must be changed, if we want to copy this entry
function getCopyDialog() { $str = ""; $smarty = get_smarty(); $smarty->assign("cn", set_post($this->cn)); $smarty->assign("description", set_post($this->description)); $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__))); $ret = array(); $ret['string'] = $str; $ret['status'] = ""; return($ret); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __clone()\n\t{\n\t\tforeach ($this->_fields as $name => $field)\n\t\t{\n\t\t\t$this->_fields[$name] = clone $field;\n\t\t}\n\n\t\t$this->_changed = array();\n\t}", "function editcopy()\n\t{\n\t\t$is_event_editor = JEVHelper::isEventCreator();\n\t\tif (!$is_event_editor)\n\t\t{\n\t\t\tthrow new Exception(Text::_('ALERTNOTAUTH'), 403);\n\n\t\t\treturn false;\n\t\t}\n\t\t$this->editCopy = true;\n\t\t$this->edit();\n\n\t}", "function partial_dialog()\n {\n return $this->renderAddDialog();\n }", "function _cloning()\n\t{\n\t\t$this->Mode = '';\n\t\t$this->_edit('Edit');\n\t\t$this->selected_id = $this->_none;\n\t}", "function wpml_get_copied_fields_for_post_edit() {\n\t\tif ( empty( $_GET['from_post'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification\n\t\t\treturn array();\n\t\t}\n\n\t\t$arr['original_post_id'] = (int) $_GET['from_post']; // phpcs:ignore WordPress.Security.NonceVerification\n\n\t\t// Don't know what WPML does but Polylang does copy all public meta keys by default\n\t\tforeach ( $keys = array_unique( array_keys( get_post_custom( $arr['original_post_id'] ) ) ) as $k => $meta_key ) {\n\t\t\tif ( is_protected_meta( $meta_key ) ) {\n\t\t\t\tunset( $keys[ $k ] );\n\t\t\t}\n\t\t}\n\n\t\t// Apply our filter and fill the expected output ( see /types/embedded/includes/fields-post.php )\n\t\t/** This filter is documented in modules/sync/admin-sync.php */\n\t\t$arr['fields'] = array_unique( apply_filters( 'pll_copy_post_metas', empty( $keys ) ? array() : $keys, false ) );\n\t\treturn $arr;\n\t}", "function paddata_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0){\n\t// and fill it with data of record whose ID is $selected_id. If $selected_id\n\t// is empty, an empty form is shown, with only an 'Add New'\n\t// button displayed.\n\n\tglobal $Translation;\n\n\t// mm: get table permissions\n\t$arrPerm=getTablePermissions('paddata');\n\tif(!$arrPerm[1] && $selected_id==''){ return ''; }\n\t$AllowInsert = ($arrPerm[1] ? true : false);\n\t// print preview?\n\t$dvprint = false;\n\tif($selected_id && $_REQUEST['dvprint_x'] != ''){\n\t\t$dvprint = true;\n\t}\n\n\n\t// populate filterers, starting from children to grand-parents\n\n\t// unique random identifier\n\t$rnd1 = ($dvprint ? rand(1000000, 9999999) : '');\n\t// combobox: pdate\n\t$combo_pdate = new DateCombo;\n\t$combo_pdate->DateFormat = \"mdy\";\n\t$combo_pdate->MinYear = 1900;\n\t$combo_pdate->MaxYear = 2100;\n\t$combo_pdate->DefaultDate = parseMySQLDate('', '');\n\t$combo_pdate->MonthNames = $Translation['month names'];\n\t$combo_pdate->NamePrefix = 'pdate';\n\t// combobox: status\n\t$combo_status = new Combo;\n\t$combo_status->ListType = 2;\n\t$combo_status->MultipleSeparator = ', ';\n\t$combo_status->ListBoxHeight = 10;\n\t$combo_status->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/paddata.status.csv')){\n\t\t$status_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/paddata.status.csv')));\n\t\t$combo_status->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($status_data)));\n\t\t$combo_status->ListData = $combo_status->ListItem;\n\t}else{\n\t\t$combo_status->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"0;1\")));\n\t\t$combo_status->ListData = $combo_status->ListItem;\n\t}\n\t$combo_status->SelectName = 'status';\n\t// combobox: affiliate\n\t$combo_affiliate = new Combo;\n\t$combo_affiliate->ListType = 0;\n\t$combo_affiliate->MultipleSeparator = ', ';\n\t$combo_affiliate->ListBoxHeight = 10;\n\t$combo_affiliate->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/paddata.affiliate.csv')){\n\t\t$affiliate_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/paddata.affiliate.csv')));\n\t\t$combo_affiliate->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($affiliate_data)));\n\t\t$combo_affiliate->ListData = $combo_affiliate->ListItem;\n\t}else{\n\t\t$combo_affiliate->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"RegNow;Share-It;eSellerate;Plimus;Avangate\")));\n\t\t$combo_affiliate->ListData = $combo_affiliate->ListItem;\n\t}\n\t$combo_affiliate->SelectName = 'affiliate';\n\t// combobox: clean\n\t$combo_clean = new Combo;\n\t$combo_clean->ListType = 2;\n\t$combo_clean->MultipleSeparator = ', ';\n\t$combo_clean->ListBoxHeight = 10;\n\t$combo_clean->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/paddata.clean.csv')){\n\t\t$clean_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/paddata.clean.csv')));\n\t\t$combo_clean->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($clean_data)));\n\t\t$combo_clean->ListData = $combo_clean->ListItem;\n\t}else{\n\t\t$combo_clean->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"0;1\")));\n\t\t$combo_clean->ListData = $combo_clean->ListItem;\n\t}\n\t$combo_clean->SelectName = 'clean';\n\n\tif($selected_id){\n\t\t// mm: check member permissions\n\t\tif(!$arrPerm[2]){\n\t\t\treturn \"\";\n\t\t}\n\t\t// mm: who is the owner?\n\t\t$ownerGroupID=sqlValue(\"select groupID from membership_userrecords where tableName='paddata' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\t$ownerMemberID=sqlValue(\"select lcase(memberID) from membership_userrecords where tableName='paddata' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\tif($arrPerm[2]==1 && getLoggedMemberID()!=$ownerMemberID){\n\t\t\treturn \"\";\n\t\t}\n\t\tif($arrPerm[2]==2 && getLoggedGroupID()!=$ownerGroupID){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// can edit?\n\t\tif(($arrPerm[3]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[3]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[3]==3){\n\t\t\t$AllowUpdate=1;\n\t\t}else{\n\t\t\t$AllowUpdate=0;\n\t\t}\n\n\t\t$res = sql(\"select * from `paddata` where `progid`='\".makeSafe($selected_id).\"'\", $eo);\n\t\tif(!($row = db_fetch_array($res))){\n\t\t\treturn error_message($Translation['No records found']);\n\t\t}\n\t\t$urow = $row; /* unsanitized data */\n\t\t$hc = new CI_Input();\n\t\t$row = $hc->xss_clean($row); /* sanitize data */\n\t\t$combo_pdate->DefaultDate = $row['pdate'];\n\t\t$combo_status->SelectedData = $row['status'];\n\t\t$combo_affiliate->SelectedData = $row['affiliate'];\n\t\t$combo_clean->SelectedData = $row['clean'];\n\t}else{\n\t\t$combo_status->SelectedText = ( $_REQUEST['FilterField'][1]=='12' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"0\");\n\t\t$combo_affiliate->SelectedText = ( $_REQUEST['FilterField'][1]=='31' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_clean->SelectedText = ( $_REQUEST['FilterField'][1]=='34' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"0\");\n\t}\n\t$combo_status->Render();\n\t$combo_affiliate->Render();\n\t$combo_clean->Render();\n\n\t// code for template based detail view forms\n\n\t// open the detail view template\n\tif($dvprint){\n\t\t$templateCode = @file_get_contents('./templates/paddata_templateDVP.html');\n\t}else{\n\t\t$templateCode = @file_get_contents('./templates/paddata_templateDV.html');\n\t}\n\n\t// process form title\n\t$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'PAD Data', $templateCode);\n\t$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);\n\t$templateCode = str_replace('<%%EMBEDDED%%>', ($_REQUEST['Embedded'] ? 'Embedded=1' : ''), $templateCode);\n\t// process buttons\n\tif($AllowInsert){\n\t\tif(!$selected_id) $templateCode=str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return paddata_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save New'] . '</button>', $templateCode);\n\t\t$templateCode=str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return paddata_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode=str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);\n\t}\n\n\t// 'Back' button action\n\tif($_REQUEST['Embedded']){\n\t\t$backAction = 'window.parent.jQuery(\\'.modal\\').modal(\\'hide\\'); return false;';\n\t}else{\n\t\t$backAction = '$$(\\'form\\')[0].writeAttribute(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;';\n\t}\n\n\tif($selected_id){\n\t\tif(!$_REQUEST['Embedded']) $templateCode=str_replace('<%%DVPRINT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"dvprint\" name=\"dvprint_x\" value=\"1\" onclick=\"$$(\\'form\\')[0].writeAttribute(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;\"><i class=\"glyphicon glyphicon-print\"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);\n\t\tif($AllowUpdate){\n\t\t\t$templateCode=str_replace('<%%UPDATE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success btn-lg\" id=\"update\" name=\"update_x\" value=\"1\" onclick=\"return paddata_validateData();\"><i class=\"glyphicon glyphicon-ok\"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode=str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\tif(($arrPerm[4]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[4]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[4]==3){ // allow delete?\n\t\t\t$templateCode=str_replace('<%%DELETE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-danger\" id=\"delete\" name=\"delete_x\" value=\"1\" onclick=\"return confirm(\\'' . $Translation['are you sure?'] . '\\');\"><i class=\"glyphicon glyphicon-trash\"></i> ' . $Translation['Delete'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode=str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\t$templateCode=str_replace('<%%DESELECT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode=str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%DESELECT_BUTTON%%>', ($ShowCancel ? '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>' : ''), $templateCode);\n\t}\n\n\t// set records to read only if user can't insert new records and can't edit current record\n\tif(($selected_id && !$AllowUpdate && !$AllowInsert) || (!$selected_id && !$AllowInsert)){\n\t\t$jsReadOnly .= \"\\tjQuery('#company').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"company\\\">' + (jQuery('#company').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#country').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"country\\\">' + (jQuery('#country').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#website').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"website\\\">' + (jQuery('#website').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contactname').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"contactname\\\">' + (jQuery('#contactname').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#email').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"email\\\">' + (jQuery('#email').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#title').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"title\\\">' + (jQuery('#title').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#version').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"version\\\">' + (jQuery('#version').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#pdate').prop('readonly', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#pdateDay, #pdateMonth, #pdateYear').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#cost').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"cost\\\">' + (jQuery('#cost').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#ptype').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"ptype\\\">' + (jQuery('#ptype').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('input[name=status]').parent().html('<div class=\\\"form-control-static\\\">' + jQuery('input[name=status]:checked').next().text() + '</div>')\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#install').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"install\\\">' + (jQuery('#install').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#os').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"os\\\">' + (jQuery('#os').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#languages').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"languages\\\">' + (jQuery('#languages').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#changeinfo').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"changeinfo\\\">' + (jQuery('#changeinfo').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#category').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"category\\\">' + (jQuery('#category').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#requirements').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"requirements\\\">' + (jQuery('#requirements').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#ksize').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"ksize\\\">' + (jQuery('#ksize').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#keywords').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"keywords\\\">' + (jQuery('#keywords').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#description').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"description\\\">' + (jQuery('#description').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#descrlarge').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"descrlarge\\\">' + (jQuery('#descrlarge').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#homepage').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"homepage\\\">' + (jQuery('#homepage').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#screenshot').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"screenshot\\\">' + (jQuery('#screenshot').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#icon').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"icon\\\">' + (jQuery('#icon').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#padfile').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"padfile\\\">' + (jQuery('#padfile').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#download').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"download\\\">' + (jQuery('#download').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dlcount').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"dlcount\\\">' + (jQuery('#dlcount').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dlipaddr').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"dlipaddr\\\">' + (jQuery('#dlipaddr').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#aspnumber').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"aspnumber\\\">' + (jQuery('#aspnumber').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#affiliate').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"affiliate\\\">' + (jQuery('#affiliate').val() || '') + '</div>'); jQuery('#affiliate-multi-selection-help').hide();\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#affiliateid').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"affiliateid\\\">' + (jQuery('#affiliateid').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#siterating').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"siterating\\\">' + (jQuery('#siterating').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('input[name=clean]').parent().html('<div class=\\\"form-control-static\\\">' + jQuery('input[name=clean]:checked').next().text() + '</div>')\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#paderrcount').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"paderrcount\\\">' + (jQuery('#paderrcount').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('.select2-container').hide();\\n\";\n\n\t\t$noUploads = true;\n\t}elseif($AllowInsert){\n\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', true);\"; // temporarily disable form change handler\n\t\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', false);\"; // re-enable form change handler\n\t}\n\n\t// process combos\n\t$templateCode=str_replace('<%%COMBO(pdate)%%>', ($selected_id && !$arrPerm[3] ? '<div class=\"form-control-static\">' . $combo_pdate->GetHTML(true) . '</div>' : $combo_pdate->GetHTML()), $templateCode);\n\t$templateCode=str_replace('<%%COMBOTEXT(pdate)%%>', $combo_pdate->GetHTML(true), $templateCode);\n\t$templateCode=str_replace('<%%COMBO(status)%%>', $combo_status->HTML, $templateCode);\n\t$templateCode=str_replace('<%%COMBOTEXT(status)%%>', $combo_status->SelectedData, $templateCode);\n\t$templateCode=str_replace('<%%COMBO(affiliate)%%>', $combo_affiliate->HTML, $templateCode);\n\t$templateCode=str_replace('<%%COMBOTEXT(affiliate)%%>', $combo_affiliate->SelectedData, $templateCode);\n\t$templateCode=str_replace('<%%COMBO(clean)%%>', $combo_clean->HTML, $templateCode);\n\t$templateCode=str_replace('<%%COMBOTEXT(clean)%%>', $combo_clean->SelectedData, $templateCode);\n\n\t/* lookup fields array: 'lookup field name' => array('parent table name', 'lookup field caption') */\n\t$lookup_fields = array();\n\tforeach($lookup_fields as $luf => $ptfc){\n\t\t$pt_perm = getTablePermissions($ptfc[0]);\n\n\t\t// process foreign key links\n\t\tif($pt_perm['view'] || $pt_perm['edit']){\n\t\t\t$templateCode = str_replace(\"<%%PLINK({$luf})%%>\", '<button type=\"button\" class=\"btn btn-default view_parent hspacer-lg\" id=\"' . $ptfc[0] . '_view_parent\" title=\"' . htmlspecialchars($Translation['View'] . ' ' . $ptfc[1], ENT_QUOTES, 'iso-8859-1') . '\"><i class=\"glyphicon glyphicon-eye-open\"></i></button>', $templateCode);\n\t\t}\n\n\t\t// if user has insert permission to parent table of a lookup field, put an add new button\n\t\tif($pt_perm['insert'] && !$_REQUEST['Embedded']){\n\t\t\t$templateCode = str_replace(\"<%%ADDNEW({$ptfc[0]})%%>\", '<button type=\"button\" class=\"btn btn-success add_new_parent\" id=\"' . $ptfc[0] . '_add_new\" title=\"' . htmlspecialchars($Translation['Add New'] . ' ' . $ptfc[1], ENT_QUOTES, 'iso-8859-1') . '\"><i class=\"glyphicon glyphicon-plus-sign\"></i></button>', $templateCode);\n\t\t}\n\t}\n\n\t// process images\n\t$templateCode=str_replace('<%%UPLOADFILE(progid)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(company)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(country)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(website)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(contactname)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(email)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(title)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(version)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(pdate)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(cost)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(ptype)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(status)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(install)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(os)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(languages)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(changeinfo)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(category)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(requirements)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(ksize)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(keywords)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(description)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(descrlarge)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(homepage)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(screenshot)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(icon)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(padfile)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(download)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(dlcount)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(dlipaddr)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(aspnumber)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(affiliate)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(affiliateid)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(siterating)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(clean)%%>', '', $templateCode);\n\t$templateCode=str_replace('<%%UPLOADFILE(paderrcount)%%>', '', $templateCode);\n\n\t// process values\n\tif($selected_id){\n\t\t$templateCode=str_replace('<%%VALUE(progid)%%>', htmlspecialchars($row['progid'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(progid)%%>', urlencode($urow['progid']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(company)%%>', htmlspecialchars($row['company'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(company)%%>', urlencode($urow['company']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(country)%%>', htmlspecialchars($row['country'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(country)%%>', urlencode($urow['country']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(website)%%>', htmlspecialchars($row['website'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(website)%%>', urlencode($urow['website']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(contactname)%%>', htmlspecialchars($row['contactname'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(contactname)%%>', urlencode($urow['contactname']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(email)%%>', htmlspecialchars($row['email'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(email)%%>', urlencode($urow['email']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(title)%%>', htmlspecialchars($row['title'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(title)%%>', urlencode($urow['title']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(version)%%>', htmlspecialchars($row['version'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(version)%%>', urlencode($urow['version']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(pdate)%%>', @date('m/d/Y', @strtotime(htmlspecialchars($row['pdate'], ENT_QUOTES, 'iso-8859-1'))), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(pdate)%%>', urlencode(@date('m/d/Y', @strtotime(htmlspecialchars($urow['pdate'], ENT_QUOTES, 'iso-8859-1')))), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(cost)%%>', htmlspecialchars($row['cost'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(cost)%%>', urlencode($urow['cost']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(ptype)%%>', htmlspecialchars($row['ptype'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(ptype)%%>', urlencode($urow['ptype']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(status)%%>', htmlspecialchars($row['status'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(status)%%>', urlencode($urow['status']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(install)%%>', htmlspecialchars($row['install'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(install)%%>', urlencode($urow['install']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(os)%%>', htmlspecialchars($row['os'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(os)%%>', urlencode($urow['os']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(languages)%%>', htmlspecialchars($row['languages'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(languages)%%>', urlencode($urow['languages']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(changeinfo)%%>', htmlspecialchars($row['changeinfo'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(changeinfo)%%>', urlencode($urow['changeinfo']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(category)%%>', htmlspecialchars($row['category'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(category)%%>', urlencode($urow['category']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(requirements)%%>', htmlspecialchars($row['requirements'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(requirements)%%>', urlencode($urow['requirements']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(ksize)%%>', htmlspecialchars($row['ksize'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(ksize)%%>', urlencode($urow['ksize']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(keywords)%%>', htmlspecialchars($row['keywords'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(keywords)%%>', urlencode($urow['keywords']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(description)%%>', htmlspecialchars($row['description'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(description)%%>', urlencode($urow['description']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(descrlarge)%%>', htmlspecialchars($row['descrlarge'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(descrlarge)%%>', urlencode($urow['descrlarge']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(homepage)%%>', htmlspecialchars($row['homepage'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(homepage)%%>', urlencode($urow['homepage']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(screenshot)%%>', htmlspecialchars($row['screenshot'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(screenshot)%%>', urlencode($urow['screenshot']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(icon)%%>', htmlspecialchars($row['icon'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(icon)%%>', urlencode($urow['icon']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(padfile)%%>', htmlspecialchars($row['padfile'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(padfile)%%>', urlencode($urow['padfile']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(download)%%>', htmlspecialchars($row['download'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(download)%%>', urlencode($urow['download']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(dlcount)%%>', htmlspecialchars($row['dlcount'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(dlcount)%%>', urlencode($urow['dlcount']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(dlipaddr)%%>', htmlspecialchars($row['dlipaddr'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(dlipaddr)%%>', urlencode($urow['dlipaddr']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(aspnumber)%%>', htmlspecialchars($row['aspnumber'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(aspnumber)%%>', urlencode($urow['aspnumber']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(affiliate)%%>', htmlspecialchars($row['affiliate'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(affiliate)%%>', urlencode($urow['affiliate']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(affiliateid)%%>', htmlspecialchars($row['affiliateid'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(affiliateid)%%>', urlencode($urow['affiliateid']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(siterating)%%>', htmlspecialchars($row['siterating'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(siterating)%%>', urlencode($urow['siterating']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(clean)%%>', htmlspecialchars($row['clean'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(clean)%%>', urlencode($urow['clean']), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(paderrcount)%%>', htmlspecialchars($row['paderrcount'], ENT_QUOTES, 'iso-8859-1'), $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(paderrcount)%%>', urlencode($urow['paderrcount']), $templateCode);\n\t}else{\n\t\t$templateCode=str_replace('<%%VALUE(progid)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(progid)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(company)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(company)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(country)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(country)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(website)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(website)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(contactname)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(contactname)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(email)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(email)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(title)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(title)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(version)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(version)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(pdate)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(pdate)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(cost)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(cost)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(ptype)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(ptype)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(status)%%>', '0', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(status)%%>', urlencode('0'), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(install)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(install)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(os)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(os)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(languages)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(languages)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(changeinfo)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(changeinfo)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(category)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(category)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(requirements)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(requirements)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(ksize)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(ksize)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(keywords)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(keywords)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(description)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(description)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(descrlarge)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(descrlarge)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(homepage)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(homepage)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(screenshot)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(screenshot)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(icon)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(icon)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(padfile)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(padfile)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(download)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(download)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(dlcount)%%>', '0', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(dlcount)%%>', urlencode('0'), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(dlipaddr)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(dlipaddr)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(aspnumber)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(aspnumber)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(affiliate)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(affiliate)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(affiliateid)%%>', '', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(affiliateid)%%>', urlencode(''), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(siterating)%%>', '0', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(siterating)%%>', urlencode('0'), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(clean)%%>', '0', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(clean)%%>', urlencode('0'), $templateCode);\n\t\t$templateCode=str_replace('<%%VALUE(paderrcount)%%>', '0', $templateCode);\n\t\t$templateCode=str_replace('<%%URLVALUE(paderrcount)%%>', urlencode('0'), $templateCode);\n\t}\n\n\t// process translations\n\tforeach($Translation as $symbol=>$trans){\n\t\t$templateCode=str_replace(\"<%%TRANSLATION($symbol)%%>\", $trans, $templateCode);\n\t}\n\n\t// clear scrap\n\t$templateCode=str_replace('<%%', '<!-- ', $templateCode);\n\t$templateCode=str_replace('%%>', ' -->', $templateCode);\n\n\t// hide links to inaccessible tables\n\tif($_REQUEST['dvprint_x'] == ''){\n\t\t$templateCode .= \"\\n\\n<script>\\$j(function(){\\n\";\n\t\t$arrTables = getTableList();\n\t\tforeach($arrTables as $name => $caption){\n\t\t\t$templateCode .= \"\\t\\$j('#{$name}_link').removeClass('hidden');\\n\";\n\t\t\t$templateCode .= \"\\t\\$j('#xs_{$name}_link').removeClass('hidden');\\n\";\n\t\t}\n\n\t\t$templateCode .= $jsReadOnly;\n\t\t$templateCode .= $jsEditable;\n\n\t\tif(!$selected_id){\n\t\t}\n\n\t\t$templateCode.=\"\\n});</script>\\n\";\n\t}\n\n\t// ajaxed auto-fill fields\n\t$templateCode .= '<script>';\n\t$templateCode .= '$j(function() {';\n\n\n\t$templateCode.=\"});\";\n\t$templateCode.=\"</script>\";\n\t$templateCode .= $lookups;\n\n\t// handle enforced parent values for read-only lookup fields\n\n\t// don't include blank images in lightbox gallery\n\t$templateCode = preg_replace('/blank.gif\" data-lightbox=\".*?\"/', 'blank.gif\"', $templateCode);\n\n\t// don't display empty email links\n\t$templateCode=preg_replace('/<a .*?href=\"mailto:\".*?<\\/a>/', '', $templateCode);\n\n\t// hook: paddata_dv\n\tif(function_exists('paddata_dv')){\n\t\t$args=array();\n\t\tpaddata_dv(($selected_id ? $selected_id : FALSE), getMemberInfo(), $templateCode, $args);\n\t}\n\n\treturn $templateCode;\n}", "public function retrieveEditableValues() {\n\n }", "public function __clone() {\r\n\t\t\t$this->__blnRestored = false;\r\n\t\t\t$this->strName = null;\r\n\t\t\t$this->strDescription = null;\r\n\t\t\t$this->intDeadline = null;\r\n\t\t\t$this->dttPublicationDate = new QDateTime();\r\n\t\t\t$this->intPrice = null;\r\n\t\t\t$this->strSex = null;\r\n\t\t\t$this->intId = 0;\r\n\t\t\tif ($this->strType == AdType::SIM)\r\n\t\t\t\t$this->strPermissionMode = PermissionMode::All;\r\n\t\t\telse\r\n\t\t\t\t$this->strPermissionMode = null;\r\n\t\t}", "function BeforeEdit(&$values, $where, &$oldvalues, &$keys, &$message, $inline, &$pageObject)\n{\n\n\t\t\n\n\nreturn true;\n\n;\t\t\n}", "public function getEdit();", "public function get_submitted_edit_form_data()\n {\n return true;\n }", "public function edit(Dialog $dialog)\n {\n //\n }", "function tb_acompanhamento_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0, $TemplateDV = '', $TemplateDVP = ''){\n\t// and fill it with data of record whose ID is $selected_id. If $selected_id\n\t// is empty, an empty form is shown, with only an 'Add New'\n\t// button displayed.\n\n\tglobal $Translation;\n\n\t// mm: get table permissions\n\t$arrPerm=getTablePermissions('tb_acompanhamento');\n\tif(!$arrPerm[1] && $selected_id==''){ return ''; }\n\t$AllowInsert = ($arrPerm[1] ? true : false);\n\t// print preview?\n\t$dvprint = false;\n\tif($selected_id && $_REQUEST['dvprint_x'] != ''){\n\t\t$dvprint = true;\n\t}\n\n\t$filterer_empresa_id = thisOr(undo_magic_quotes($_REQUEST['filterer_empresa_id']), '');\n\t$filterer_contato_id = thisOr(undo_magic_quotes($_REQUEST['filterer_contato_id']), '');\n\t$filterer_contrato_id = thisOr(undo_magic_quotes($_REQUEST['filterer_contrato_id']), '');\n\t$filterer_usuario_id = thisOr(undo_magic_quotes($_REQUEST['filterer_usuario_id']), '');\n\n\t// populate filterers, starting from children to grand-parents\n\tif($filterer_contato_id && !$filterer_empresa_id) $filterer_empresa_id = sqlValue(\"select empresa_id from tb_contato where id='\" . makeSafe($filterer_contato_id) . \"'\");\n\tif($filterer_contrato_id && !$filterer_empresa_id) $filterer_empresa_id = sqlValue(\"select empresa_id from tb_contrato where id='\" . makeSafe($filterer_contrato_id) . \"'\");\n\n\t// unique random identifier\n\t$rnd1 = ($dvprint ? rand(1000000, 9999999) : '');\n\t// combobox: empresa_id\n\t$combo_empresa_id = new DataCombo;\n\t// combobox: contato_id, filterable by: empresa_id\n\t$combo_contato_id = new DataCombo;\n\t// combobox: contrato_id, filterable by: empresa_id\n\t$combo_contrato_id = new DataCombo;\n\t// combobox: usuario_id\n\t$combo_usuario_id = new DataCombo;\n\t// combobox: dta\n\t$combo_dta = new DateCombo;\n\t$combo_dta->DateFormat = \"dmy\";\n\t$combo_dta->MinYear = 1900;\n\t$combo_dta->MaxYear = 2100;\n\t$combo_dta->DefaultDate = parseMySQLDate('', '');\n\t$combo_dta->MonthNames = $Translation['month names'];\n\t$combo_dta->NamePrefix = 'dta';\n\t// combobox: str_meio\n\t$combo_str_meio = new Combo;\n\t$combo_str_meio->ListType = 2;\n\t$combo_str_meio->MultipleSeparator = ', ';\n\t$combo_str_meio->ListBoxHeight = 10;\n\t$combo_str_meio->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_meio.csv')){\n\t\t$str_meio_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_meio.csv')));\n\t\t$combo_str_meio->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_meio_data)));\n\t\t$combo_str_meio->ListData = $combo_str_meio->ListItem;\n\t}else{\n\t\t$combo_str_meio->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"TELEFONEMA;;PRESENCIAL;;MENSAGEM\")));\n\t\t$combo_str_meio->ListData = $combo_str_meio->ListItem;\n\t}\n\t$combo_str_meio->SelectName = 'str_meio';\n\t$combo_str_meio->AllowNull = false;\n\t// combobox: str_statusgeral\n\t$combo_str_statusgeral = new Combo;\n\t$combo_str_statusgeral->ListType = 2;\n\t$combo_str_statusgeral->MultipleSeparator = ', ';\n\t$combo_str_statusgeral->ListBoxHeight = 10;\n\t$combo_str_statusgeral->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_statusgeral.csv')){\n\t\t$str_statusgeral_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_statusgeral.csv')));\n\t\t$combo_str_statusgeral->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_statusgeral_data)));\n\t\t$combo_str_statusgeral->ListData = $combo_str_statusgeral->ListItem;\n\t}else{\n\t\t$combo_str_statusgeral->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"NORMAL;;ATEN&#199;&#195;O;;CR&#205;TICO\")));\n\t\t$combo_str_statusgeral->ListData = $combo_str_statusgeral->ListItem;\n\t}\n\t$combo_str_statusgeral->SelectName = 'str_statusgeral';\n\t$combo_str_statusgeral->AllowNull = false;\n\t// combobox: str_clima_cliente\n\t$combo_str_clima_cliente = new Combo;\n\t$combo_str_clima_cliente->ListType = 0;\n\t$combo_str_clima_cliente->MultipleSeparator = ', ';\n\t$combo_str_clima_cliente->ListBoxHeight = 10;\n\t$combo_str_clima_cliente->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_cliente.csv')){\n\t\t$str_clima_cliente_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_cliente.csv')));\n\t\t$combo_str_clima_cliente->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_clima_cliente_data)));\n\t\t$combo_str_clima_cliente->ListData = $combo_str_clima_cliente->ListItem;\n\t}else{\n\t\t$combo_str_clima_cliente->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"P&#201;SSIMO;;RUIM;;BOM;;EXCELENTE\")));\n\t\t$combo_str_clima_cliente->ListData = $combo_str_clima_cliente->ListItem;\n\t}\n\t$combo_str_clima_cliente->SelectName = 'str_clima_cliente';\n\t$combo_str_clima_cliente->AllowNull = false;\n\t// combobox: str_clima_equipe\n\t$combo_str_clima_equipe = new Combo;\n\t$combo_str_clima_equipe->ListType = 0;\n\t$combo_str_clima_equipe->MultipleSeparator = ', ';\n\t$combo_str_clima_equipe->ListBoxHeight = 10;\n\t$combo_str_clima_equipe->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_equipe.csv')){\n\t\t$str_clima_equipe_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_equipe.csv')));\n\t\t$combo_str_clima_equipe->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_clima_equipe_data)));\n\t\t$combo_str_clima_equipe->ListData = $combo_str_clima_equipe->ListItem;\n\t}else{\n\t\t$combo_str_clima_equipe->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"P&#201;SSIMO;;RUIM;;BOM;;EXCELENTE\")));\n\t\t$combo_str_clima_equipe->ListData = $combo_str_clima_equipe->ListItem;\n\t}\n\t$combo_str_clima_equipe->SelectName = 'str_clima_equipe';\n\t$combo_str_clima_equipe->AllowNull = false;\n\n\tif($selected_id){\n\t\t// mm: check member permissions\n\t\tif(!$arrPerm[2]){\n\t\t\treturn \"\";\n\t\t}\n\t\t// mm: who is the owner?\n\t\t$ownerGroupID=sqlValue(\"select groupID from membership_userrecords where tableName='tb_acompanhamento' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\t$ownerMemberID=sqlValue(\"select lcase(memberID) from membership_userrecords where tableName='tb_acompanhamento' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\tif($arrPerm[2]==1 && getLoggedMemberID()!=$ownerMemberID){\n\t\t\treturn \"\";\n\t\t}\n\t\tif($arrPerm[2]==2 && getLoggedGroupID()!=$ownerGroupID){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// can edit?\n\t\tif(($arrPerm[3]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[3]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[3]==3){\n\t\t\t$AllowUpdate=1;\n\t\t}else{\n\t\t\t$AllowUpdate=0;\n\t\t}\n\n\t\t$res = sql(\"select * from `tb_acompanhamento` where `id`='\".makeSafe($selected_id).\"'\", $eo);\n\t\tif(!($row = db_fetch_array($res))){\n\t\t\treturn error_message($Translation['No records found'], 'tb_acompanhamento_view.php', false);\n\t\t}\n\t\t$urow = $row; /* unsanitized data */\n\t\t$hc = new CI_Input();\n\t\t$row = $hc->xss_clean($row); /* sanitize data */\n\t\t$combo_empresa_id->SelectedData = $row['empresa_id'];\n\t\t$combo_contato_id->SelectedData = $row['contato_id'];\n\t\t$combo_contrato_id->SelectedData = $row['contrato_id'];\n\t\t$combo_usuario_id->SelectedData = $row['usuario_id'];\n\t\t$combo_dta->DefaultDate = $row['dta'];\n\t\t$combo_str_meio->SelectedData = $row['str_meio'];\n\t\t$combo_str_statusgeral->SelectedData = $row['str_statusgeral'];\n\t\t$combo_str_clima_cliente->SelectedData = $row['str_clima_cliente'];\n\t\t$combo_str_clima_equipe->SelectedData = $row['str_clima_equipe'];\n\t}else{\n\t\t$combo_empresa_id->SelectedData = $filterer_empresa_id;\n\t\t$combo_contato_id->SelectedData = $filterer_contato_id;\n\t\t$combo_contrato_id->SelectedData = $filterer_contrato_id;\n\t\t$combo_usuario_id->SelectedData = $filterer_usuario_id;\n\t\t$combo_str_meio->SelectedText = ( $_REQUEST['FilterField'][1]=='7' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_str_statusgeral->SelectedText = ( $_REQUEST['FilterField'][1]=='8' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_str_clima_cliente->SelectedText = ( $_REQUEST['FilterField'][1]=='9' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_str_clima_equipe->SelectedText = ( $_REQUEST['FilterField'][1]=='10' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t}\n\t$combo_empresa_id->HTML = '<span id=\"empresa_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"empresa_id\" id=\"empresa_id' . $rnd1 . '\" value=\"' . html_attr($combo_empresa_id->SelectedData) . '\">';\n\t$combo_empresa_id->MatchText = '<span id=\"empresa_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"empresa_id\" id=\"empresa_id' . $rnd1 . '\" value=\"' . html_attr($combo_empresa_id->SelectedData) . '\">';\n\t$combo_contato_id->HTML = '<span id=\"contato_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contato_id\" id=\"contato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contato_id->SelectedData) . '\">';\n\t$combo_contato_id->MatchText = '<span id=\"contato_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contato_id\" id=\"contato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contato_id->SelectedData) . '\">';\n\t$combo_contrato_id->HTML = '<span id=\"contrato_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contrato_id\" id=\"contrato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contrato_id->SelectedData) . '\">';\n\t$combo_contrato_id->MatchText = '<span id=\"contrato_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contrato_id\" id=\"contrato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contrato_id->SelectedData) . '\">';\n\t$combo_usuario_id->HTML = '<span id=\"usuario_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"usuario_id\" id=\"usuario_id' . $rnd1 . '\" value=\"' . html_attr($combo_usuario_id->SelectedData) . '\">';\n\t$combo_usuario_id->MatchText = '<span id=\"usuario_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"usuario_id\" id=\"usuario_id' . $rnd1 . '\" value=\"' . html_attr($combo_usuario_id->SelectedData) . '\">';\n\t$combo_str_meio->Render();\n\t$combo_str_statusgeral->Render();\n\t$combo_str_clima_cliente->Render();\n\t$combo_str_clima_equipe->Render();\n\n\tob_start();\n\t?>\n\n\t<script>\n\t\t// initial lookup values\n\t\tAppGini.current_empresa_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['empresa_id'] : $filterer_empresa_id); ?>\"};\n\t\tAppGini.current_contato_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['contato_id'] : $filterer_contato_id); ?>\"};\n\t\tAppGini.current_contrato_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['contrato_id'] : $filterer_contrato_id); ?>\"};\n\t\tAppGini.current_usuario_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['usuario_id'] : $filterer_usuario_id); ?>\"};\n\n\t\tjQuery(function() {\n\t\t\tsetTimeout(function(){\n\t\t\t\tif(typeof(empresa_id_reload__RAND__) == 'function') empresa_id_reload__RAND__();\n\t\t\t\t<?php echo (!$AllowUpdate || $dvprint ? 'if(typeof(contato_id_reload__RAND__) == \\'function\\') contato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);' : ''); ?>\n\t\t\t\t<?php echo (!$AllowUpdate || $dvprint ? 'if(typeof(contrato_id_reload__RAND__) == \\'function\\') contrato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);' : ''); ?>\n\t\t\t\tif(typeof(usuario_id_reload__RAND__) == 'function') usuario_id_reload__RAND__();\n\t\t\t}, 10); /* we need to slightly delay client-side execution of the above code to allow AppGini.ajaxCache to work */\n\t\t});\n\t\tfunction empresa_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#empresa_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_empresa_id__RAND__.value, t: 'tb_acompanhamento', f: 'empresa_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"empresa_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=empresa_id-container-readonly__RAND__]').html('<span id=\"empresa_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contato_id_reload__RAND__) == 'function') contato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\t\t\t\t\t\tif(typeof(contrato_id_reload__RAND__) == 'function') contrato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\n\t\t\t\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_acompanhamento', f: 'empresa_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_empresa_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_empresa_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"empresa_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contato_id_reload__RAND__) == 'function') contato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\t\t\t\t\t\tif(typeof(contrato_id_reload__RAND__) == 'function') contrato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\n\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#empresa_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_empresa_id__RAND__.value, t: 'tb_acompanhamento', f: 'empresa_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"empresa_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=empresa_id-container-readonly__RAND__]').html('<span id=\"empresa_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_empresa_id__RAND__.value, t: 'tb_acompanhamento', f: 'empresa_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=empresa_id-container__RAND__], [id=empresa_id-container-readonly__RAND__]').html('<span id=\"empresa_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction contato_id_reload__RAND__(filterer_empresa_id){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#contato_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { filterer_empresa_id: filterer_empresa_id, id: AppGini.current_contato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contato_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"contato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=contato_id-container-readonly__RAND__]').html('<span id=\"contato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { filterer_empresa_id: filterer_empresa_id, s: term, p: page, t: 'tb_acompanhamento', f: 'contato_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_contato_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_contato_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"contato_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#contato_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_contato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contato_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"contato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=contato_id-container-readonly__RAND__]').html('<span id=\"contato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_contato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contato_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=contato_id-container__RAND__], [id=contato_id-container-readonly__RAND__]').html('<span id=\"contato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction contrato_id_reload__RAND__(filterer_empresa_id){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#contrato_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { filterer_empresa_id: filterer_empresa_id, id: AppGini.current_contrato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contrato_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"contrato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=contrato_id-container-readonly__RAND__]').html('<span id=\"contrato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { filterer_empresa_id: filterer_empresa_id, s: term, p: page, t: 'tb_acompanhamento', f: 'contrato_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_contrato_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_contrato_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"contrato_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#contrato_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_contrato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contrato_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"contrato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=contrato_id-container-readonly__RAND__]').html('<span id=\"contrato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_contrato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contrato_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=contrato_id-container__RAND__], [id=contrato_id-container-readonly__RAND__]').html('<span id=\"contrato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction usuario_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#usuario_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_usuario_id__RAND__.value, t: 'tb_acompanhamento', f: 'usuario_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"usuario_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=usuario_id-container-readonly__RAND__]').html('<span id=\"usuario_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_acompanhamento', f: 'usuario_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_usuario_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_usuario_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"usuario_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#usuario_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_usuario_id__RAND__.value, t: 'tb_acompanhamento', f: 'usuario_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"usuario_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=usuario_id-container-readonly__RAND__]').html('<span id=\"usuario_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_usuario_id__RAND__.value, t: 'tb_acompanhamento', f: 'usuario_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=usuario_id-container__RAND__], [id=usuario_id-container-readonly__RAND__]').html('<span id=\"usuario_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t</script>\n\t<?php\n\n\t$lookups = str_replace('__RAND__', $rnd1, ob_get_contents());\n\tob_end_clean();\n\n\n\t// code for template based detail view forms\n\n\t// open the detail view template\n\tif($dvprint){\n\t\t$template_file = is_file(\"./{$TemplateDVP}\") ? \"./{$TemplateDVP}\" : './templates/tb_acompanhamento_templateDVP.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}else{\n\t\t$template_file = is_file(\"./{$TemplateDV}\") ? \"./{$TemplateDV}\" : './templates/tb_acompanhamento_templateDV.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}\n\n\t// process form title\n\t$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Detalhes do acompanhamento', $templateCode);\n\t$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);\n\t$templateCode = str_replace('<%%EMBEDDED%%>', ($_REQUEST['Embedded'] ? 'Embedded=1' : ''), $templateCode);\n\t// process buttons\n\tif($AllowInsert){\n\t\tif(!$selected_id) $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_acompanhamento_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save New'] . '</button>', $templateCode);\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_acompanhamento_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);\n\t}\n\n\t// 'Back' button action\n\tif($_REQUEST['Embedded']){\n\t\t$backAction = 'AppGini.closeParentModal(); return false;';\n\t}else{\n\t\t$backAction = '$j(\\'form\\').eq(0).attr(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;';\n\t}\n\n\tif($selected_id){\n\t\tif(!$_REQUEST['Embedded']) $templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"dvprint\" name=\"dvprint_x\" value=\"1\" onclick=\"$$(\\'form\\')[0].writeAttribute(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;\" title=\"' . html_attr($Translation['Print Preview']) . '\"><i class=\"glyphicon glyphicon-print\"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);\n\t\tif($AllowUpdate){\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success btn-lg\" id=\"update\" name=\"update_x\" value=\"1\" onclick=\"return tb_acompanhamento_validateData();\" title=\"' . html_attr($Translation['Save Changes']) . '\"><i class=\"glyphicon glyphicon-ok\"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\tif(($arrPerm[4]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[4]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[4]==3){ // allow delete?\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-danger\" id=\"delete\" name=\"delete_x\" value=\"1\" onclick=\"return confirm(\\'' . $Translation['are you sure?'] . '\\');\" title=\"' . html_attr($Translation['Delete']) . '\"><i class=\"glyphicon glyphicon-trash\"></i> ' . $Translation['Delete'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', ($ShowCancel ? '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>' : ''), $templateCode);\n\t}\n\n\t// set records to read only if user can't insert new records and can't edit current record\n\tif(($selected_id && !$AllowUpdate && !$AllowInsert) || (!$selected_id && !$AllowInsert)){\n\t\t$jsReadOnly .= \"\\tjQuery('#empresa_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#empresa_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contato_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contato_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contrato_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contrato_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#usuario_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#usuario_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dta').prop('readonly', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dtaDay, #dtaMonth, #dtaYear').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('input[name=str_meio]').parent().html('<div class=\\\"form-control-static\\\">' + jQuery('input[name=str_meio]:checked').next().text() + '</div>')\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('input[name=str_statusgeral]').parent().html('<div class=\\\"form-control-static\\\">' + jQuery('input[name=str_statusgeral]:checked').next().text() + '</div>')\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_clima_cliente').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_clima_cliente\\\">' + (jQuery('#str_clima_cliente').val() || '') + '</div>'); jQuery('#str_clima_cliente-multi-selection-help').hide();\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_clima_equipe').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_clima_equipe\\\">' + (jQuery('#str_clima_equipe').val() || '') + '</div>'); jQuery('#str_clima_equipe-multi-selection-help').hide();\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_observacoes').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_observacoes\\\">' + (jQuery('#str_observacoes').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_acoes_corretivas').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_acoes_corretivas\\\">' + (jQuery('#str_acoes_corretivas').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('.select2-container').hide();\\n\";\n\n\t\t$noUploads = true;\n\t}elseif($AllowInsert){\n\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', true);\"; // temporarily disable form change handler\n\t\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', false);\"; // re-enable form change handler\n\t}\n\n\t// process combos\n\t$templateCode = str_replace('<%%COMBO(empresa_id)%%>', $combo_empresa_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(empresa_id)%%>', $combo_empresa_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(empresa_id)%%>', urlencode($combo_empresa_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(contato_id)%%>', $combo_contato_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(contato_id)%%>', $combo_contato_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(contato_id)%%>', urlencode($combo_contato_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(contrato_id)%%>', $combo_contrato_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(contrato_id)%%>', $combo_contrato_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(contrato_id)%%>', urlencode($combo_contrato_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(usuario_id)%%>', $combo_usuario_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(usuario_id)%%>', $combo_usuario_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(usuario_id)%%>', urlencode($combo_usuario_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(dta)%%>', ($selected_id && !$arrPerm[3] ? '<div class=\"form-control-static\">' . $combo_dta->GetHTML(true) . '</div>' : $combo_dta->GetHTML()), $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(dta)%%>', $combo_dta->GetHTML(true), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_meio)%%>', $combo_str_meio->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_meio)%%>', $combo_str_meio->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_statusgeral)%%>', $combo_str_statusgeral->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_statusgeral)%%>', $combo_str_statusgeral->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_clima_cliente)%%>', $combo_str_clima_cliente->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_clima_cliente)%%>', $combo_str_clima_cliente->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_clima_equipe)%%>', $combo_str_clima_equipe->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_clima_equipe)%%>', $combo_str_clima_equipe->SelectedData, $templateCode);\n\n\t/* lookup fields array: 'lookup field name' => array('parent table name', 'lookup field caption') */\n\t$lookup_fields = array( 'empresa_id' => array('tb_empresa', 'Conta'), 'contato_id' => array('tb_contato', 'Contato'), 'contrato_id' => array('tb_contrato', 'Contrato'), 'usuario_id' => array('tb_recrutador', 'Respons&#225;vel'));\n\tforeach($lookup_fields as $luf => $ptfc){\n\t\t$pt_perm = getTablePermissions($ptfc[0]);\n\n\t\t// process foreign key links\n\t\tif($pt_perm['view'] || $pt_perm['edit']){\n\t\t\t$templateCode = str_replace(\"<%%PLINK({$luf})%%>\", '<button type=\"button\" class=\"btn btn-default view_parent hspacer-md\" id=\"' . $ptfc[0] . '_view_parent\" title=\"' . html_attr($Translation['View'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-eye-open\"></i></button>', $templateCode);\n\t\t}\n\n\t\t// if user has insert permission to parent table of a lookup field, put an add new button\n\t\tif($pt_perm['insert'] && !$_REQUEST['Embedded']){\n\t\t\t$templateCode = str_replace(\"<%%ADDNEW({$ptfc[0]})%%>\", '<button type=\"button\" class=\"btn btn-success add_new_parent hspacer-md\" id=\"' . $ptfc[0] . '_add_new\" title=\"' . html_attr($Translation['Add New'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-plus-sign\"></i></button>', $templateCode);\n\t\t}\n\t}\n\n\t// process images\n\t$templateCode = str_replace('<%%UPLOADFILE(id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(empresa_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(contato_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(contrato_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(usuario_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(dta)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_meio)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_statusgeral)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_clima_cliente)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_clima_equipe)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_observacoes)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_acoes_corretivas)%%>', '', $templateCode);\n\n\t// process values\n\tif($selected_id){\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', safe_html($urow['id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', html_attr($row['id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode($urow['id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(empresa_id)%%>', safe_html($urow['empresa_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(empresa_id)%%>', html_attr($row['empresa_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(empresa_id)%%>', urlencode($urow['empresa_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(contato_id)%%>', safe_html($urow['contato_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(contato_id)%%>', html_attr($row['contato_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contato_id)%%>', urlencode($urow['contato_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(contrato_id)%%>', safe_html($urow['contrato_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(contrato_id)%%>', html_attr($row['contrato_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contrato_id)%%>', urlencode($urow['contrato_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(usuario_id)%%>', safe_html($urow['usuario_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(usuario_id)%%>', html_attr($row['usuario_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(usuario_id)%%>', urlencode($urow['usuario_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta)%%>', @date('d/m/Y', @strtotime(html_attr($row['dta']))), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta)%%>', urlencode(@date('d/m/Y', @strtotime(html_attr($urow['dta'])))), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_meio)%%>', safe_html($urow['str_meio']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_meio)%%>', html_attr($row['str_meio']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_meio)%%>', urlencode($urow['str_meio']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_statusgeral)%%>', safe_html($urow['str_statusgeral']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_statusgeral)%%>', html_attr($row['str_statusgeral']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_statusgeral)%%>', urlencode($urow['str_statusgeral']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_clima_cliente)%%>', safe_html($urow['str_clima_cliente']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_clima_cliente)%%>', html_attr($row['str_clima_cliente']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_cliente)%%>', urlencode($urow['str_clima_cliente']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_clima_equipe)%%>', safe_html($urow['str_clima_equipe']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_clima_equipe)%%>', html_attr($row['str_clima_equipe']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_equipe)%%>', urlencode($urow['str_clima_equipe']), $templateCode);\n\t\tif($dvprint || (!$AllowUpdate && !$AllowInsert)){\n\t\t\t$templateCode = str_replace('<%%VALUE(str_observacoes)%%>', safe_html($urow['str_observacoes']), $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%VALUE(str_observacoes)%%>', html_attr($row['str_observacoes']), $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%URLVALUE(str_observacoes)%%>', urlencode($urow['str_observacoes']), $templateCode);\n\t\tif($dvprint || (!$AllowUpdate && !$AllowInsert)){\n\t\t\t$templateCode = str_replace('<%%VALUE(str_acoes_corretivas)%%>', safe_html($urow['str_acoes_corretivas']), $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%VALUE(str_acoes_corretivas)%%>', html_attr($row['str_acoes_corretivas']), $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%URLVALUE(str_acoes_corretivas)%%>', urlencode($urow['str_acoes_corretivas']), $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%VALUE(id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(empresa_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(empresa_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(contato_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contato_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(contrato_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contrato_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(usuario_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(usuario_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_meio)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_meio)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_statusgeral)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_statusgeral)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_clima_cliente)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_cliente)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_clima_equipe)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_equipe)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_observacoes)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_observacoes)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_acoes_corretivas)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_acoes_corretivas)%%>', urlencode(''), $templateCode);\n\t}\n\n\t// process translations\n\tforeach($Translation as $symbol=>$trans){\n\t\t$templateCode = str_replace(\"<%%TRANSLATION($symbol)%%>\", $trans, $templateCode);\n\t}\n\n\t// clear scrap\n\t$templateCode = str_replace('<%%', '<!-- ', $templateCode);\n\t$templateCode = str_replace('%%>', ' -->', $templateCode);\n\n\t// hide links to inaccessible tables\n\tif($_REQUEST['dvprint_x'] == ''){\n\t\t$templateCode .= \"\\n\\n<script>\\$j(function(){\\n\";\n\t\t$arrTables = getTableList();\n\t\tforeach($arrTables as $name => $caption){\n\t\t\t$templateCode .= \"\\t\\$j('#{$name}_link').removeClass('hidden');\\n\";\n\t\t\t$templateCode .= \"\\t\\$j('#xs_{$name}_link').removeClass('hidden');\\n\";\n\t\t}\n\n\t\t$templateCode .= $jsReadOnly;\n\t\t$templateCode .= $jsEditable;\n\n\t\tif(!$selected_id){\n\t\t}\n\n\t\t$templateCode.=\"\\n});</script>\\n\";\n\t}\n\n\t// ajaxed auto-fill fields\n\t$templateCode .= '<script>';\n\t$templateCode .= '$j(function() {';\n\n\n\t$templateCode.=\"});\";\n\t$templateCode.=\"</script>\";\n\t$templateCode .= $lookups;\n\n\t// handle enforced parent values for read-only lookup fields\n\n\t// don't include blank images in lightbox gallery\n\t$templateCode = preg_replace('/blank.gif\" data-lightbox=\".*?\"/', 'blank.gif\"', $templateCode);\n\n\t// don't display empty email links\n\t$templateCode=preg_replace('/<a .*?href=\"mailto:\".*?<\\/a>/', '', $templateCode);\n\n\t/* default field values */\n\t$rdata = $jdata = get_defaults('tb_acompanhamento');\n\tif($selected_id){\n\t\t$jdata = get_joined_record('tb_acompanhamento', $selected_id);\n\t\tif($jdata === false) $jdata = get_defaults('tb_acompanhamento');\n\t\t$rdata = $row;\n\t}\n\t$templateCode .= loadView('tb_acompanhamento-ajax-cache', array('rdata' => $rdata, 'jdata' => $jdata));\n\n\t// hook: tb_acompanhamento_dv\n\tif(function_exists('tb_acompanhamento_dv')){\n\t\t$args=array();\n\t\ttb_acompanhamento_dv(($selected_id ? $selected_id : FALSE), getMemberInfo(), $templateCode, $args);\n\t}\n\n\treturn $templateCode;\n}", "function createEditFormFields()\n\t{\n\t $insertValues = \"\";\n\t $table = Doctrine_Core::getTable($this->tableName)->getColumns();\n\t \n\t $output = '';\n\t foreach ($table as $fielname => $info)\n\t {\n\t if (strtolower($fielname) != 'id' && strtolower($fielname) != 'created_at' && strtolower($fielname) != 'updated_at')\n\t {\n\t $output .= \"<tr>\n\t <td width=\\\"100px\\\"><label>\".ucwords(str_replace('_',' ', $fielname)).\":</label></td>\n\t <td>\";\n\t if (strtolower($info['type']) == 'enum') {\n\t \t$varr = array();\n\t \tforeach ($info['values'] as $iv) {\n\t \t\t$varr[] = \"'\".$iv.\"' => '\".$iv.\"'\";\n\t \t}\n\t $output .=\"<?php echo \\$this->formSelect(\\\"\".$this->moduleNameVar.\"[\".$fielname.\"]\\\", \\$this->\".$this->moduleNameVar.\"['\".$fielname.\"'], array(), array(''=>'', \".implode(',', $varr).\")); ?>\";\n\t }else{\n\t $output .=\"<?php echo \\$this->formText(\\\"\".$this->moduleNameVar.\"[\".$fielname.\"]\\\", \\$this->\".$this->moduleNameVar.\"['\".$fielname.\"']); ?>\";\t\n\t }\n\t $output .=\"</td>\n\t </tr>\\r\\n\";\n\t }\n\t }\n\t \n\t $this->edit_form_fields = $output;\n\t}", "protected function hideFieldsForAddEdit()\n {\n }", "function sogg_Terzi_Rapp_PA_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0, $TemplateDV = '', $TemplateDVP = ''){\r\n\t// and fill it with data of record whose ID is $selected_id. If $selected_id\r\n\t// is empty, an empty form is shown, with only an 'Add New'\r\n\t// button displayed.\r\n\r\n\tglobal $Translation;\r\n\r\n\t// mm: get table permissions\r\n\t$arrPerm=getTablePermissions('sogg_Terzi_Rapp_PA');\r\n\tif(!$arrPerm[1] && $selected_id==''){ return ''; }\r\n\t$AllowInsert = ($arrPerm[1] ? true : false);\r\n\t// print preview?\r\n\t$dvprint = false;\r\n\tif($selected_id && $_REQUEST['dvprint_x'] != ''){\r\n\t\t$dvprint = true;\r\n\t}\r\n\r\n\t$filterer_idPaese_RF_PA = thisOr(undo_magic_quotes($_REQUEST['filterer_idPaese_RF_PA']), '');\r\n\r\n\t// populate filterers, starting from children to grand-parents\r\n\r\n\t// unique random identifier\r\n\t$rnd1 = ($dvprint ? rand(1000000, 9999999) : '');\r\n\t// combobox: idPaese_RF_PA\r\n\t$combo_idPaese_RF_PA = new DataCombo;\r\n\t// combobox: sogg_Emittente_PA\r\n\t$combo_sogg_Emittente_PA = new Combo;\r\n\t$combo_sogg_Emittente_PA->ListType = 0;\r\n\t$combo_sogg_Emittente_PA->MultipleSeparator = ', ';\r\n\t$combo_sogg_Emittente_PA->ListBoxHeight = 10;\r\n\t$combo_sogg_Emittente_PA->RadiosPerLine = 1;\r\n\tif(is_file(dirname(__FILE__).'/hooks/sogg_Terzi_Rapp_PA.sogg_Emittente_PA.csv')){\r\n\t\t$sogg_Emittente_PA_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/sogg_Terzi_Rapp_PA.sogg_Emittente_PA.csv')));\r\n\t\t$combo_sogg_Emittente_PA->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($sogg_Emittente_PA_data)));\r\n\t\t$combo_sogg_Emittente_PA->ListData = $combo_sogg_Emittente_PA->ListItem;\r\n\t}else{\r\n\t\t$combo_sogg_Emittente_PA->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"CC;;TZ\")));\r\n\t\t$combo_sogg_Emittente_PA->ListData = $combo_sogg_Emittente_PA->ListItem;\r\n\t}\r\n\t$combo_sogg_Emittente_PA->SelectName = 'sogg_Emittente_PA';\r\n\t// combobox: data_orAcq_PA\r\n\t$combo_data_orAcq_PA = new DateCombo;\r\n\t$combo_data_orAcq_PA->DateFormat = \"ymd\";\r\n\t$combo_data_orAcq_PA->MinYear = 1900;\r\n\t$combo_data_orAcq_PA->MaxYear = 2100;\r\n\t$combo_data_orAcq_PA->DefaultDate = parseMySQLDate('', '');\r\n\t$combo_data_orAcq_PA->MonthNames = $Translation['month names'];\r\n\t$combo_data_orAcq_PA->NamePrefix = 'data_orAcq_PA';\r\n\r\n\tif($selected_id){\r\n\t\t// mm: check member permissions\r\n\t\tif(!$arrPerm[2]){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t// mm: who is the owner?\r\n\t\t$ownerGroupID=sqlValue(\"select groupID from membership_userrecords where tableName='sogg_Terzi_Rapp_PA' and pkValue='\".makeSafe($selected_id).\"'\");\r\n\t\t$ownerMemberID=sqlValue(\"select lcase(memberID) from membership_userrecords where tableName='sogg_Terzi_Rapp_PA' and pkValue='\".makeSafe($selected_id).\"'\");\r\n\t\tif($arrPerm[2]==1 && getLoggedMemberID()!=$ownerMemberID){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\tif($arrPerm[2]==2 && getLoggedGroupID()!=$ownerGroupID){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\t// can edit?\r\n\t\tif(($arrPerm[3]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[3]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[3]==3){\r\n\t\t\t$AllowUpdate=1;\r\n\t\t}else{\r\n\t\t\t$AllowUpdate=0;\r\n\t\t}\r\n\r\n\t\t$res = sql(\"select * from `sogg_Terzi_Rapp_PA` where `id`='\".makeSafe($selected_id).\"'\", $eo);\r\n\t\tif(!($row = db_fetch_array($res))){\r\n\t\t\treturn error_message($Translation['No records found'], 'sogg_Terzi_Rapp_PA_view.php', false);\r\n\t\t}\r\n\t\t$urow = $row; /* unsanitized data */\r\n\t\t$hc = new CI_Input();\r\n\t\t$row = $hc->xss_clean($row); /* sanitize data */\r\n\t\t$combo_idPaese_RF_PA->SelectedData = $row['idPaese_RF_PA'];\r\n\t\t$combo_sogg_Emittente_PA->SelectedData = $row['sogg_Emittente_PA'];\r\n\t\t$combo_data_orAcq_PA->DefaultDate = $row['data_orAcq_PA'];\r\n\t}else{\r\n\t\t$combo_idPaese_RF_PA->SelectedData = $filterer_idPaese_RF_PA;\r\n\t\t$combo_sogg_Emittente_PA->SelectedText = ( $_REQUEST['FilterField'][1]=='18' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\r\n\t}\r\n\t$combo_idPaese_RF_PA->HTML = '<span id=\"idPaese_RF_PA-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"idPaese_RF_PA\" id=\"idPaese_RF_PA' . $rnd1 . '\" value=\"' . html_attr($combo_idPaese_RF_PA->SelectedData) . '\">';\r\n\t$combo_idPaese_RF_PA->MatchText = '<span id=\"idPaese_RF_PA-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"idPaese_RF_PA\" id=\"idPaese_RF_PA' . $rnd1 . '\" value=\"' . html_attr($combo_idPaese_RF_PA->SelectedData) . '\">';\r\n\t$combo_sogg_Emittente_PA->Render();\r\n\r\n\tob_start();\r\n\t?>\r\n\r\n\t<script>\r\n\t\t// initial lookup values\r\n\t\tAppGini.current_idPaese_RF_PA__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['idPaese_RF_PA'] : $filterer_idPaese_RF_PA); ?>\"};\r\n\r\n\t\tjQuery(function() {\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(typeof(idPaese_RF_PA_reload__RAND__) == 'function') idPaese_RF_PA_reload__RAND__();\r\n\t\t\t}, 10); /* we need to slightly delay client-side execution of the above code to allow AppGini.ajaxCache to work */\r\n\t\t});\r\n\t\tfunction idPaese_RF_PA_reload__RAND__(){\r\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\r\n\r\n\t\t\t$j(\"#idPaese_RF_PA-container__RAND__\").select2({\r\n\t\t\t\t/* initial default value */\r\n\t\t\t\tinitSelection: function(e, c){\r\n\t\t\t\t\t$j.ajax({\r\n\t\t\t\t\t\turl: 'ajax_combo.php',\r\n\t\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\t\tdata: { id: AppGini.current_idPaese_RF_PA__RAND__.value, t: 'sogg_Terzi_Rapp_PA', f: 'idPaese_RF_PA' },\r\n\t\t\t\t\t\tsuccess: function(resp){\r\n\t\t\t\t\t\t\tc({\r\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\r\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t$j('[name=\"idPaese_RF_PA\"]').val(resp.results[0].id);\r\n\t\t\t\t\t\t\t$j('[id=idPaese_RF_PA-container-readonly__RAND__]').html('<span id=\"idPaese_RF_PA-match-text\">' + resp.results[0].text + '</span>');\r\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=countries_view_parent]').hide(); }else{ $j('.btn[id=countries_view_parent]').show(); }\r\n\r\n\r\n\t\t\t\t\t\t\tif(typeof(idPaese_RF_PA_update_autofills__RAND__) == 'function') idPaese_RF_PA_update_autofills__RAND__();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\t\t\t\twidth: '100%',\r\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\r\n\t\t\t\tminimumResultsForSearch: 5,\r\n\t\t\t\tloadMorePadding: 200,\r\n\t\t\t\tajax: {\r\n\t\t\t\t\turl: 'ajax_combo.php',\r\n\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\tcache: true,\r\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'sogg_Terzi_Rapp_PA', f: 'idPaese_RF_PA' }; },\r\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\r\n\t\t\t\t},\r\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\r\n\t\t\t}).on('change', function(e){\r\n\t\t\t\tAppGini.current_idPaese_RF_PA__RAND__.value = e.added.id;\r\n\t\t\t\tAppGini.current_idPaese_RF_PA__RAND__.text = e.added.text;\r\n\t\t\t\t$j('[name=\"idPaese_RF_PA\"]').val(e.added.id);\r\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=countries_view_parent]').hide(); }else{ $j('.btn[id=countries_view_parent]').show(); }\r\n\r\n\r\n\t\t\t\tif(typeof(idPaese_RF_PA_update_autofills__RAND__) == 'function') idPaese_RF_PA_update_autofills__RAND__();\r\n\t\t\t});\r\n\r\n\t\t\tif(!$j(\"#idPaese_RF_PA-container__RAND__\").length){\r\n\t\t\t\t$j.ajax({\r\n\t\t\t\t\turl: 'ajax_combo.php',\r\n\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\tdata: { id: AppGini.current_idPaese_RF_PA__RAND__.value, t: 'sogg_Terzi_Rapp_PA', f: 'idPaese_RF_PA' },\r\n\t\t\t\t\tsuccess: function(resp){\r\n\t\t\t\t\t\t$j('[name=\"idPaese_RF_PA\"]').val(resp.results[0].id);\r\n\t\t\t\t\t\t$j('[id=idPaese_RF_PA-container-readonly__RAND__]').html('<span id=\"idPaese_RF_PA-match-text\">' + resp.results[0].text + '</span>');\r\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=countries_view_parent]').hide(); }else{ $j('.btn[id=countries_view_parent]').show(); }\r\n\r\n\t\t\t\t\t\tif(typeof(idPaese_RF_PA_update_autofills__RAND__) == 'function') idPaese_RF_PA_update_autofills__RAND__();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t<?php }else{ ?>\r\n\r\n\t\t\t$j.ajax({\r\n\t\t\t\turl: 'ajax_combo.php',\r\n\t\t\t\tdataType: 'json',\r\n\t\t\t\tdata: { id: AppGini.current_idPaese_RF_PA__RAND__.value, t: 'sogg_Terzi_Rapp_PA', f: 'idPaese_RF_PA' },\r\n\t\t\t\tsuccess: function(resp){\r\n\t\t\t\t\t$j('[id=idPaese_RF_PA-container__RAND__], [id=idPaese_RF_PA-container-readonly__RAND__]').html('<span id=\"idPaese_RF_PA-match-text\">' + resp.results[0].text + '</span>');\r\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=countries_view_parent]').hide(); }else{ $j('.btn[id=countries_view_parent]').show(); }\r\n\r\n\t\t\t\t\tif(typeof(idPaese_RF_PA_update_autofills__RAND__) == 'function') idPaese_RF_PA_update_autofills__RAND__();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t<?php } ?>\r\n\r\n\t\t}\r\n\t</script>\r\n\t<?php\r\n\r\n\t$lookups = str_replace('__RAND__', $rnd1, ob_get_contents());\r\n\tob_end_clean();\r\n\r\n\r\n\t// code for template based detail view forms\r\n\r\n\t// open the detail view template\r\n\tif($dvprint){\r\n\t\t$template_file = is_file(\"./{$TemplateDVP}\") ? \"./{$TemplateDVP}\" : './templates/sogg_Terzi_Rapp_PA_templateDVP.html';\r\n\t\t$templateCode = @file_get_contents($template_file);\r\n\t}else{\r\n\t\t$template_file = is_file(\"./{$TemplateDV}\") ? \"./{$TemplateDV}\" : './templates/sogg_Terzi_Rapp_PA_templateDV.html';\r\n\t\t$templateCode = @file_get_contents($template_file);\r\n\t}\r\n\r\n\t// process form title\r\n\t$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Codice Destinatario details', $templateCode);\r\n\t$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);\r\n\t$templateCode = str_replace('<%%EMBEDDED%%>', ($_REQUEST['Embedded'] ? 'Embedded=1' : ''), $templateCode);\r\n\t// process buttons\r\n\tif($AllowInsert){\r\n\t\tif(!$selected_id) $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return sogg_Terzi_Rapp_PA_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save New'] . '</button>', $templateCode);\r\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return sogg_Terzi_Rapp_PA_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);\r\n\t}else{\r\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);\r\n\t}\r\n\r\n\t// 'Back' button action\r\n\tif($_REQUEST['Embedded']){\r\n\t\t$backAction = 'AppGini.closeParentModal(); return false;';\r\n\t}else{\r\n\t\t$backAction = '$j(\\'form\\').eq(0).attr(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;';\r\n\t}\r\n\r\n\tif($selected_id){\r\n\t\tif(!$_REQUEST['Embedded']) $templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"dvprint\" name=\"dvprint_x\" value=\"1\" onclick=\"$j(\\'form\\').eq(0).prop(\\'novalidate\\', true); document.myform.reset(); return true;\" title=\"' . html_attr($Translation['Print Preview']) . '\"><i class=\"glyphicon glyphicon-print\"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);\r\n\t\tif($AllowUpdate){\r\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success btn-lg\" id=\"update\" name=\"update_x\" value=\"1\" onclick=\"return sogg_Terzi_Rapp_PA_validateData();\" title=\"' . html_attr($Translation['Save Changes']) . '\"><i class=\"glyphicon glyphicon-ok\"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);\r\n\t\t}else{\r\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\r\n\t\t}\r\n\t\tif(($arrPerm[4]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[4]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[4]==3){ // allow delete?\r\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-danger\" id=\"delete\" name=\"delete_x\" value=\"1\" onclick=\"return confirm(\\'' . $Translation['are you sure?'] . '\\');\" title=\"' . html_attr($Translation['Delete']) . '\"><i class=\"glyphicon glyphicon-trash\"></i> ' . $Translation['Delete'] . '</button>', $templateCode);\r\n\t\t}else{\r\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\r\n\t\t}\r\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>', $templateCode);\r\n\t}else{\r\n\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', ($ShowCancel ? '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>' : ''), $templateCode);\r\n\t}\r\n\r\n\t// set records to read only if user can't insert new records and can't edit current record\r\n\tif(($selected_id && !$AllowUpdate && !$AllowInsert) || (!$selected_id && !$AllowInsert)){\r\n\t\t$jsReadOnly .= \"\\tjQuery('#idPaese_RF_PA').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#idPaese_RF_PA_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#idCodice_RF_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"idCodice_RF_PA\\\">' + (jQuery('#idCodice_RF_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#codiceFiscale_RF_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"codiceFiscale_RF_PA\\\">' + (jQuery('#codiceFiscale_RF_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#denominazione_RF_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"denominazione_RF_PA\\\">' + (jQuery('#denominazione_RF_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#nome_RF_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"nome_RF_PA\\\">' + (jQuery('#nome_RF_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#cognome_RF_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"cognome_RF_PA\\\">' + (jQuery('#cognome_RF_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#titolo_RF_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"titolo_RF_PA\\\">' + (jQuery('#titolo_RF_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#codEORI__RF_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"codEORI__RF_PA\\\">' + (jQuery('#codEORI__RF_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#idPaeseIVA_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"idPaeseIVA_3_Int_PA\\\">' + (jQuery('#idPaeseIVA_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#idCodice_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"idCodice_3_Int_PA\\\">' + (jQuery('#idCodice_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#codFiscale_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"codFiscale_3_Int_PA\\\">' + (jQuery('#codFiscale_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#denominazione_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"denominazione_3_Int_PA\\\">' + (jQuery('#denominazione_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#nome_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"nome_3_Int_PA\\\">' + (jQuery('#nome_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#cognome_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"cognome_3_Int_PA\\\">' + (jQuery('#cognome_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#titolo_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"titolo_3_Int_PA\\\">' + (jQuery('#titolo_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#codEORI_3_Int_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"codEORI_3_Int_PA\\\">' + (jQuery('#codEORI_3_Int_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#sogg_Emittente_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"sogg_Emittente_PA\\\">' + (jQuery('#sogg_Emittente_PA').val() || '') + '</div>'); jQuery('#sogg_Emittente_PA-multi-selection-help').hide();\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#rif_num_linea_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"rif_num_linea_PA\\\">' + (jQuery('#rif_num_linea_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#idDoc_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"idDoc_PA\\\">' + (jQuery('#idDoc_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#data_orAcq_PA').prop('readonly', true);\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#data_orAcq_PADay, #data_orAcq_PAMonth, #data_orAcq_PAYear').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#numItem_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"numItem_PA\\\">' + (jQuery('#numItem_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#codCom_Con_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"codCom_Con_PA\\\">' + (jQuery('#codCom_Con_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#codCUP_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"codCUP_PA\\\">' + (jQuery('#codCUP_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#codGIG_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"codGIG_PA\\\">' + (jQuery('#codGIG_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#datiCont_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"datiCont_PA\\\">' + (jQuery('#datiCont_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#datiConv_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"datiConv_PA\\\">' + (jQuery('#datiConv_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#datiRic_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"datiRic_PA\\\">' + (jQuery('#datiRic_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#datiFatCol_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"datiFatCol_PA\\\">' + (jQuery('#datiFatCol_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#datiSal_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"datiSal_PA\\\">' + (jQuery('#datiSal_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#riferFase_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"riferFase_PA\\\">' + (jQuery('#riferFase_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#normaRifer_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"normaRifer_PA\\\">' + (jQuery('#normaRifer_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#nrFatturaPrinc_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"nrFatturaPrinc_PA\\\">' + (jQuery('#nrFatturaPrinc_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('#dataFattPrinc_PA').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"dataFattPrinc_PA\\\">' + (jQuery('#dataFattPrinc_PA').val() || '') + '</div>');\\n\";\r\n\t\t$jsReadOnly .= \"\\tjQuery('.select2-container').hide();\\n\";\r\n\r\n\t\t$noUploads = true;\r\n\t}elseif($AllowInsert){\r\n\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', true);\"; // temporarily disable form change handler\r\n\t\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', false);\"; // re-enable form change handler\r\n\t}\r\n\r\n\t// process combos\r\n\t$templateCode = str_replace('<%%COMBO(idPaese_RF_PA)%%>', $combo_idPaese_RF_PA->HTML, $templateCode);\r\n\t$templateCode = str_replace('<%%COMBOTEXT(idPaese_RF_PA)%%>', $combo_idPaese_RF_PA->MatchText, $templateCode);\r\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(idPaese_RF_PA)%%>', urlencode($combo_idPaese_RF_PA->MatchText), $templateCode);\r\n\t$templateCode = str_replace('<%%COMBO(sogg_Emittente_PA)%%>', $combo_sogg_Emittente_PA->HTML, $templateCode);\r\n\t$templateCode = str_replace('<%%COMBOTEXT(sogg_Emittente_PA)%%>', $combo_sogg_Emittente_PA->SelectedData, $templateCode);\r\n\t$templateCode = str_replace('<%%COMBO(data_orAcq_PA)%%>', ($selected_id && !$arrPerm[3] ? '<div class=\"form-control-static\">' . $combo_data_orAcq_PA->GetHTML(true) . '</div>' : $combo_data_orAcq_PA->GetHTML()), $templateCode);\r\n\t$templateCode = str_replace('<%%COMBOTEXT(data_orAcq_PA)%%>', $combo_data_orAcq_PA->GetHTML(true), $templateCode);\r\n\r\n\t/* lookup fields array: 'lookup field name' => array('parent table name', 'lookup field caption') */\r\n\t$lookup_fields = array( 'idPaese_RF_PA' => array('countries', 'Id Paese PA'));\r\n\tforeach($lookup_fields as $luf => $ptfc){\r\n\t\t$pt_perm = getTablePermissions($ptfc[0]);\r\n\r\n\t\t// process foreign key links\r\n\t\tif($pt_perm['view'] || $pt_perm['edit']){\r\n\t\t\t$templateCode = str_replace(\"<%%PLINK({$luf})%%>\", '<button type=\"button\" class=\"btn btn-default view_parent hspacer-md\" id=\"' . $ptfc[0] . '_view_parent\" title=\"' . html_attr($Translation['View'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-eye-open\"></i></button>', $templateCode);\r\n\t\t}\r\n\r\n\t\t// if user has insert permission to parent table of a lookup field, put an add new button\r\n\t\tif($pt_perm['insert'] && !$_REQUEST['Embedded']){\r\n\t\t\t$templateCode = str_replace(\"<%%ADDNEW({$ptfc[0]})%%>\", '<button type=\"button\" class=\"btn btn-success add_new_parent hspacer-md\" id=\"' . $ptfc[0] . '_add_new\" title=\"' . html_attr($Translation['Add New'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-plus-sign\"></i></button>', $templateCode);\r\n\t\t}\r\n\t}\r\n\r\n\t// process images\r\n\t$templateCode = str_replace('<%%UPLOADFILE(id)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(idPaese_RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(idCodice_RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(codiceFiscale_RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(denominazione_RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(nome_RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(cognome_RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(titolo_RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(codEORI__RF_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(idPaeseIVA_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(idCodice_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(codFiscale_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(denominazione_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(nome_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(cognome_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(titolo_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(codEORI_3_Int_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(sogg_Emittente_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(rif_num_linea_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(idDoc_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(data_orAcq_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(numItem_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(codCom_Con_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(codCUP_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(codGIG_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(datiCont_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(datiConv_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(datiRic_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(datiFatCol_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(datiSal_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(riferFase_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(normaRifer_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(nrFatturaPrinc_PA)%%>', '', $templateCode);\r\n\t$templateCode = str_replace('<%%UPLOADFILE(dataFattPrinc_PA)%%>', '', $templateCode);\r\n\r\n\t// process values\r\n\tif($selected_id){\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', safe_html($urow['id']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', html_attr($row['id']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode($urow['id']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(idPaese_RF_PA)%%>', safe_html($urow['idPaese_RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(idPaese_RF_PA)%%>', html_attr($row['idPaese_RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idPaese_RF_PA)%%>', urlencode($urow['idPaese_RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(idCodice_RF_PA)%%>', safe_html($urow['idCodice_RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(idCodice_RF_PA)%%>', html_attr($row['idCodice_RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idCodice_RF_PA)%%>', urlencode($urow['idCodice_RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(codiceFiscale_RF_PA)%%>', safe_html($urow['codiceFiscale_RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(codiceFiscale_RF_PA)%%>', html_attr($row['codiceFiscale_RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codiceFiscale_RF_PA)%%>', urlencode($urow['codiceFiscale_RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(denominazione_RF_PA)%%>', safe_html($urow['denominazione_RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(denominazione_RF_PA)%%>', html_attr($row['denominazione_RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(denominazione_RF_PA)%%>', urlencode($urow['denominazione_RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(nome_RF_PA)%%>', safe_html($urow['nome_RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(nome_RF_PA)%%>', html_attr($row['nome_RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(nome_RF_PA)%%>', urlencode($urow['nome_RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(cognome_RF_PA)%%>', safe_html($urow['cognome_RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(cognome_RF_PA)%%>', html_attr($row['cognome_RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(cognome_RF_PA)%%>', urlencode($urow['cognome_RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(titolo_RF_PA)%%>', safe_html($urow['titolo_RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(titolo_RF_PA)%%>', html_attr($row['titolo_RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(titolo_RF_PA)%%>', urlencode($urow['titolo_RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(codEORI__RF_PA)%%>', safe_html($urow['codEORI__RF_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(codEORI__RF_PA)%%>', html_attr($row['codEORI__RF_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codEORI__RF_PA)%%>', urlencode($urow['codEORI__RF_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(idPaeseIVA_3_Int_PA)%%>', safe_html($urow['idPaeseIVA_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(idPaeseIVA_3_Int_PA)%%>', html_attr($row['idPaeseIVA_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idPaeseIVA_3_Int_PA)%%>', urlencode($urow['idPaeseIVA_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(idCodice_3_Int_PA)%%>', safe_html($urow['idCodice_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(idCodice_3_Int_PA)%%>', html_attr($row['idCodice_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idCodice_3_Int_PA)%%>', urlencode($urow['idCodice_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(codFiscale_3_Int_PA)%%>', safe_html($urow['codFiscale_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(codFiscale_3_Int_PA)%%>', html_attr($row['codFiscale_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codFiscale_3_Int_PA)%%>', urlencode($urow['codFiscale_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(denominazione_3_Int_PA)%%>', safe_html($urow['denominazione_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(denominazione_3_Int_PA)%%>', html_attr($row['denominazione_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(denominazione_3_Int_PA)%%>', urlencode($urow['denominazione_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(nome_3_Int_PA)%%>', safe_html($urow['nome_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(nome_3_Int_PA)%%>', html_attr($row['nome_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(nome_3_Int_PA)%%>', urlencode($urow['nome_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(cognome_3_Int_PA)%%>', safe_html($urow['cognome_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(cognome_3_Int_PA)%%>', html_attr($row['cognome_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(cognome_3_Int_PA)%%>', urlencode($urow['cognome_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(titolo_3_Int_PA)%%>', safe_html($urow['titolo_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(titolo_3_Int_PA)%%>', html_attr($row['titolo_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(titolo_3_Int_PA)%%>', urlencode($urow['titolo_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(codEORI_3_Int_PA)%%>', safe_html($urow['codEORI_3_Int_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(codEORI_3_Int_PA)%%>', html_attr($row['codEORI_3_Int_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codEORI_3_Int_PA)%%>', urlencode($urow['codEORI_3_Int_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(sogg_Emittente_PA)%%>', safe_html($urow['sogg_Emittente_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(sogg_Emittente_PA)%%>', html_attr($row['sogg_Emittente_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(sogg_Emittente_PA)%%>', urlencode($urow['sogg_Emittente_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(rif_num_linea_PA)%%>', safe_html($urow['rif_num_linea_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(rif_num_linea_PA)%%>', html_attr($row['rif_num_linea_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(rif_num_linea_PA)%%>', urlencode($urow['rif_num_linea_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(idDoc_PA)%%>', safe_html($urow['idDoc_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(idDoc_PA)%%>', html_attr($row['idDoc_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idDoc_PA)%%>', urlencode($urow['idDoc_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(data_orAcq_PA)%%>', @date('Y-m-d', @strtotime(html_attr($row['data_orAcq_PA']))), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(data_orAcq_PA)%%>', urlencode(@date('Y-m-d', @strtotime(html_attr($urow['data_orAcq_PA'])))), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(numItem_PA)%%>', safe_html($urow['numItem_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(numItem_PA)%%>', html_attr($row['numItem_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(numItem_PA)%%>', urlencode($urow['numItem_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(codCom_Con_PA)%%>', safe_html($urow['codCom_Con_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(codCom_Con_PA)%%>', html_attr($row['codCom_Con_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codCom_Con_PA)%%>', urlencode($urow['codCom_Con_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(codCUP_PA)%%>', safe_html($urow['codCUP_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(codCUP_PA)%%>', html_attr($row['codCUP_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codCUP_PA)%%>', urlencode($urow['codCUP_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(codGIG_PA)%%>', safe_html($urow['codGIG_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(codGIG_PA)%%>', html_attr($row['codGIG_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codGIG_PA)%%>', urlencode($urow['codGIG_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(datiCont_PA)%%>', safe_html($urow['datiCont_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(datiCont_PA)%%>', html_attr($row['datiCont_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiCont_PA)%%>', urlencode($urow['datiCont_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(datiConv_PA)%%>', safe_html($urow['datiConv_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(datiConv_PA)%%>', html_attr($row['datiConv_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiConv_PA)%%>', urlencode($urow['datiConv_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(datiRic_PA)%%>', safe_html($urow['datiRic_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(datiRic_PA)%%>', html_attr($row['datiRic_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiRic_PA)%%>', urlencode($urow['datiRic_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(datiFatCol_PA)%%>', safe_html($urow['datiFatCol_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(datiFatCol_PA)%%>', html_attr($row['datiFatCol_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiFatCol_PA)%%>', urlencode($urow['datiFatCol_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(datiSal_PA)%%>', safe_html($urow['datiSal_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(datiSal_PA)%%>', html_attr($row['datiSal_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiSal_PA)%%>', urlencode($urow['datiSal_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(riferFase_PA)%%>', safe_html($urow['riferFase_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(riferFase_PA)%%>', html_attr($row['riferFase_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(riferFase_PA)%%>', urlencode($urow['riferFase_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(normaRifer_PA)%%>', safe_html($urow['normaRifer_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(normaRifer_PA)%%>', html_attr($row['normaRifer_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(normaRifer_PA)%%>', urlencode($urow['normaRifer_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(nrFatturaPrinc_PA)%%>', safe_html($urow['nrFatturaPrinc_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(nrFatturaPrinc_PA)%%>', html_attr($row['nrFatturaPrinc_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(nrFatturaPrinc_PA)%%>', urlencode($urow['nrFatturaPrinc_PA']), $templateCode);\r\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(dataFattPrinc_PA)%%>', safe_html($urow['dataFattPrinc_PA']), $templateCode);\r\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(dataFattPrinc_PA)%%>', html_attr($row['dataFattPrinc_PA']), $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(dataFattPrinc_PA)%%>', urlencode($urow['dataFattPrinc_PA']), $templateCode);\r\n\t}else{\r\n\t\t$templateCode = str_replace('<%%VALUE(id)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(idPaese_RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idPaese_RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(idCodice_RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idCodice_RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(codiceFiscale_RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codiceFiscale_RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(denominazione_RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(denominazione_RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(nome_RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(nome_RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(cognome_RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(cognome_RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(titolo_RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(titolo_RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(codEORI__RF_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codEORI__RF_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(idPaeseIVA_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idPaeseIVA_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(idCodice_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idCodice_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(codFiscale_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codFiscale_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(denominazione_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(denominazione_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(nome_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(nome_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(cognome_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(cognome_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(titolo_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(titolo_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(codEORI_3_Int_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codEORI_3_Int_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(sogg_Emittente_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(sogg_Emittente_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(rif_num_linea_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(rif_num_linea_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(idDoc_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(idDoc_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(data_orAcq_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(data_orAcq_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(numItem_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(numItem_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(codCom_Con_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codCom_Con_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(codCUP_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codCUP_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(codGIG_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(codGIG_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(datiCont_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiCont_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(datiConv_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiConv_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(datiRic_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiRic_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(datiFatCol_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiFatCol_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(datiSal_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(datiSal_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(riferFase_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(riferFase_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(normaRifer_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(normaRifer_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(nrFatturaPrinc_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(nrFatturaPrinc_PA)%%>', urlencode(''), $templateCode);\r\n\t\t$templateCode = str_replace('<%%VALUE(dataFattPrinc_PA)%%>', '', $templateCode);\r\n\t\t$templateCode = str_replace('<%%URLVALUE(dataFattPrinc_PA)%%>', urlencode(''), $templateCode);\r\n\t}\r\n\r\n\t// process translations\r\n\tforeach($Translation as $symbol=>$trans){\r\n\t\t$templateCode = str_replace(\"<%%TRANSLATION($symbol)%%>\", $trans, $templateCode);\r\n\t}\r\n\r\n\t// clear scrap\r\n\t$templateCode = str_replace('<%%', '<!-- ', $templateCode);\r\n\t$templateCode = str_replace('%%>', ' -->', $templateCode);\r\n\r\n\t// hide links to inaccessible tables\r\n\tif($_REQUEST['dvprint_x'] == ''){\r\n\t\t$templateCode .= \"\\n\\n<script>\\$j(function(){\\n\";\r\n\t\t$arrTables = getTableList();\r\n\t\tforeach($arrTables as $name => $caption){\r\n\t\t\t$templateCode .= \"\\t\\$j('#{$name}_link').removeClass('hidden');\\n\";\r\n\t\t\t$templateCode .= \"\\t\\$j('#xs_{$name}_link').removeClass('hidden');\\n\";\r\n\t\t}\r\n\r\n\t\t$templateCode .= $jsReadOnly;\r\n\t\t$templateCode .= $jsEditable;\r\n\r\n\t\tif(!$selected_id){\r\n\t\t}\r\n\r\n\t\t$templateCode.=\"\\n});</script>\\n\";\r\n\t}\r\n\r\n\t// ajaxed auto-fill fields\r\n\t$templateCode .= '<script>';\r\n\t$templateCode .= '$j(function() {';\r\n\r\n\r\n\t$templateCode.=\"});\";\r\n\t$templateCode.=\"</script>\";\r\n\t$templateCode .= $lookups;\r\n\r\n\t// handle enforced parent values for read-only lookup fields\r\n\r\n\t// don't include blank images in lightbox gallery\r\n\t$templateCode = preg_replace('/blank.gif\" data-lightbox=\".*?\"/', 'blank.gif\"', $templateCode);\r\n\r\n\t// don't display empty email links\r\n\t$templateCode=preg_replace('/<a .*?href=\"mailto:\".*?<\\/a>/', '', $templateCode);\r\n\r\n\t/* default field values */\r\n\t$rdata = $jdata = get_defaults('sogg_Terzi_Rapp_PA');\r\n\tif($selected_id){\r\n\t\t$jdata = get_joined_record('sogg_Terzi_Rapp_PA', $selected_id);\r\n\t\tif($jdata === false) $jdata = get_defaults('sogg_Terzi_Rapp_PA');\r\n\t\t$rdata = $row;\r\n\t}\r\n\t$templateCode .= loadView('sogg_Terzi_Rapp_PA-ajax-cache', array('rdata' => $rdata, 'jdata' => $jdata));\r\n\r\n\t// hook: sogg_Terzi_Rapp_PA_dv\r\n\tif(function_exists('sogg_Terzi_Rapp_PA_dv')){\r\n\t\t$args=array();\r\n\t\tsogg_Terzi_Rapp_PA_dv(($selected_id ? $selected_id : FALSE), getMemberInfo(), $templateCode, $args);\r\n\t}\r\n\r\n\treturn $templateCode;\r\n}", "protected function hideFieldsForAddEdit()\n\t{\n\t}", "public function __clone(){\r\n trigger_error('La clonación no es permitida!.', E_USER_ERROR);\r\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 get_edit_form_fields()\n {\n return \"\";\n }", "function getOverwriteData($table, $uidFrom, $destPid) {\n\t\tglobal $TCA;\n\t\t\n\t\t$tce = t3lib_div::makeInstance('t3lib_TCEmain');\n\t\t$tce->stripslashes_values = 0;\n\t\t\n\t\t$TCAdefaultOverride = $GLOBALS['BE_USER']->getTSConfigProp('TCAdefaults');\n\t\tif (is_array($TCAdefaultOverride))\t{\n\t\t\t$tce->setDefaultsFromUserTS($TCAdefaultOverride);\n\t\t}\n\t\t\n\t\t$tce->start(array(), array());\n\t\t\n\t\t$first = 0;\n\t\t$language = 0;\n\t\t$uid = $origUid = intval($uidFrom);\n\t\t\t\n\t\t// Only copy if the table is defined in TCA, a uid is given\n\t\tif ($TCA[$table] && $uid)\t{\n\t\t\tt3lib_div::loadTCA($table);\n\n\t\t\tif (true)\t{\t\t// This checks if the record can be selected which is all that a copy action requires.\n\t\t\t\t$data = Array();\n\n\t\t\t\t$nonFields = array_unique(t3lib_div::trimExplode(',','uid,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,t3ver_oid,t3ver_wsid,t3ver_id,t3ver_label,t3ver_state,t3ver_swapmode,t3ver_count,t3ver_stage,t3ver_tstamp,'.$excludeFields,1));\n\n\t\t\t\t// $row = $this->recordInfo($table,$uid,'*');\n\t\t\t\t$row = t3lib_BEfunc::getRecordWSOL($table,$uid);\t// So it copies (and localized) content from workspace...\n\t\t\t\tif (is_array($row))\t{\n\n\t\t\t\t\t\t// Initializing:\n\t\t\t\t\t$theNewID = $destPid;\n\t\t\t\t\t$enableField = isset($TCA[$table]['ctrl']['enablecolumns']) ? $TCA[$table]['ctrl']['enablecolumns']['disabled'] : '';\n\t\t\t\t\t$headerField = $TCA[$table]['ctrl']['label'];\n\n\t\t\t\t\t\t// Getting default data:\n\t\t\t\t\t$defaultData = $tce->newFieldArray($table);\n\n\t\t\t\t\t\t// Getting \"copy-after\" fields if applicable:\n\t\t\t\t\t$copyAfterFields = array();\n\n\t\t\t\t\t\t// Page TSconfig related:\n\t\t\t\t\t$tscPID = t3lib_BEfunc::getTSconfig_pidValue($table, $uid, -$destPid);\t// NOT using t3lib_BEfunc::getTSCpid() because we need the real pid - not the ID of a page, if the input is a page...\n\t\t\t\t\t$TSConfig = $tce->getTCEMAIN_TSconfig($tscPID);\n\t\t\t\t\t$tE = $tce->getTableEntries($table,$TSConfig);\n\n\t\t\t\t\t\t// Traverse ALL fields of the selected record:\n\t\t\t\t\tforeach($row as $field => $value)\t{\n\t\t\t\t\t\tif (!in_array($field,$nonFields))\t{\n\n\t\t\t\t\t\t\t\t// Get TCA configuration for the field:\n\t\t\t\t\t\t\t$conf = $TCA[$table]['columns'][$field]['config'];\n\n\t\t\t\t\t\t\t\t// Preparation/Processing of the value:\n\t\t\t\t\t\t\tif ($field=='pid')\t{\t// \"pid\" is hardcoded of course:\n\t\t\t\t\t\t\t\t$value = $destPid;\n\t\t\t\t\t\t\t} elseif (isset($overrideValues[$field]))\t{\t// Override value...\n\t\t\t\t\t\t\t\t$value = $overrideValues[$field];\n\t\t\t\t\t\t\t} elseif (isset($copyAfterFields[$field]))\t{\t// Copy-after value if available:\n\t\t\t\t\t\t\t\t$value = $copyAfterFields[$field];\n\t\t\t\t\t\t\t} elseif ($TCA[$table]['ctrl']['setToDefaultOnCopy'] && t3lib_div::inList($TCA[$table]['ctrl']['setToDefaultOnCopy'],$field))\t{\t// Revert to default for some fields:\n\t\t\t\t\t\t\t\t$value = $defaultData[$field];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Hide at copy may override:\n\t\t\t\t\t\t\t\tif ($first && $field==$enableField && $TCA[$table]['ctrl']['hideAtCopy'] && !$tce->neverHideAtCopy && !$tE['disableHideAtCopy'])\t{\n\t\t\t\t\t\t\t\t\t$value=1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Prepend label on copy:\n\t\t\t\t\t\t\t\tif ($first && $field==$headerField && $TCA[$table]['ctrl']['prependAtCopy'] && !$tE['disablePrependAtCopy'])\t{\n\t\t\t\t\t\t\t\t\t$value = $tce->getCopyHeader($table,$this->resolvePid($table,$destPid),$field,$this->clearPrefixFromValue($table,$value),0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Processing based on the TCA config field type (files, references, flexforms...)\n\t\t\t\t\t\t\t\t$value = $tce->copyRecord_procBasedOnFieldType($table, $uid, $field, $value, $row, $conf, $tscPID, $language);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Add value to array.\n\t\t\t\t\t\t\t$data[$table][$theNewID][$field] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\t// Overriding values:\n\t\t\t\t\tif ($TCA[$table]['ctrl']['editlock'])\t{\n\t\t\t\t\t\t$data[$table][$theNewID][$TCA[$table]['ctrl']['editlock']] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t\t// Setting original UID:\n\t\t\t\t\tif ($TCA[$table]['ctrl']['origUid'])\t{\n\t\t\t\t\t\t$data[$table][$theNewID][$TCA[$table]['ctrl']['origUid']] = $uid;\n\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Getting the new UID:\n\t\t\t\t\t//$theNewSQLID = $copyTCE->substNEWwithIDs[$theNewID];\n\t\t\t\t\t//if ($theNewSQLID)\t{\n\t\t\t\t\t//\t$this->copyRecord_fixRTEmagicImages($table,t3lib_BEfunc::wsMapId($table,$theNewSQLID));\n\t\t\t\t\t//}\n\n\t\t\t\t\treturn $data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array();\n\t}", "function show_edit()\n\t{\n\t\tglobal $g_db, $new, $pid;\n\n\t\tif (!empty($new)) { $this->value = $pid; }\n\t\t\n\t\t$this->tpl->set_var('name', '_f_'.$this->name);\n\t\t$this->tpl->set_var('description', $this->description);\n\t\t$this->tpl->set_var('error', $this->error);\n\t\t\n\t\tif ($this->s_order) { $this->s_order = \" ORDER BY $this->s_order \"; }\n\t\t$options = $g_db->get_result(\"SELECT $this->c_value AS o_value, $this->c_name AS o_name FROM $this->s_table $this->s_order\");\n\n\t\tif ($this->empty != 'none')\n\t\t{\n\t\t\t// pastumiam masyva per viena\n\t\t\tfor ($i = count($options); $i != 0; $i--)\n\t\t\t{\n\t\t\t\t$options[$i] = $options[$i - 1];\n\t\t\t}\n\n\t\t\t$options[0]['o_value'] = $this->empty;\n\t\t\t$options[0]['o_name'] = '';\n\t\t}\n\n\t\tfor ($i = 0; isset($options[$i]); $i++)\n\t\t{\n\t\t\tif ($options[$i]['o_value'] == $this->value) \n\t\t\t{\n\t\t\t\t$options[$i]['selected'] = 'selected';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$options[$i]['selected'] = '';\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t$this->tpl->set_loop('options', $options);\n\n\t\t$out = $this->tpl->process('temp', 'avcDbSelect_edit', 2);\n\n\t\t$this->tpl->drop_var('name');\n\t\t$this->tpl->drop_var('description');\n\t\t$this->tpl->drop_var('error');\n\n\t\treturn $out;\n\t}", "public function actionCopy()\n\t{\n\n\n\t\t$id=$_GET['id'];\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['WmsReleaseorderdetail']))\n\t\t{\n\t\t\t$createmodel=new WmsReleaseorderdetail;\n\t\t\t$createmodel->attributes=$_POST['WmsReleaseorderdetail'];\n\t\t\tif($createmodel->save())\n\t\t\t\t$this->redirect(array('view','id'=>$createmodel->fReleaseOrderKey));\n\t\t}\n\n\t\t$this->render('copy',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function __clone(){\n\t\ttrigger_error('Clone is not allowed.', E_USER_ERROR);\n\t}", "function wha_dialog_passwordform(&$out, &$err, $text, $height, $width,\n $formheight, &$items, $common_options=array())\n{ \n $form_options = array('--passwordform', $text, $height, $width, $formheight);\n $form_items = array();\n foreach($items as $key => $tuple) {\n $form_items[] = $tuple[0]; // label\n $form_items[] = $tuple[1]; // x\n $form_items[] = $tuple[2]; // y\n $form_items[] = $tuple[3]; // item\n $form_items[] = $tuple[4]; // x \n $form_items[] = $tuple[5]; // y\n $form_items[] = $tuple[6]; // flen\n $form_items[] = $tuple[7]; // ilen\n }\n $args = array_merge($common_options, $form_options, $form_items);\n $result = wha_dialog($args, $out, $err);\n if($result == 0) {\n if(is_string($out)) {\n $lines = explode(\"\\n\", $out);\n $i = 0;\n foreach($items as $key => $tuple) {\n $items[$key][3] = $lines[$i];\n $i++;\n }\n }\n }\n return $result;\n}", "function wha_dialog_form(&$out, &$err, $text, $height, $width, $formheight, \n &$items, $common_options=array())\n{ \n $form_options = array('--form', $text, $height, $width, $formheight);\n $form_items = array();\n foreach($items as $key => $tuple) {\n $form_items[] = $tuple[0]; // label\n $form_items[] = $tuple[1]; // x\n $form_items[] = $tuple[2]; // y\n $form_items[] = $tuple[3]; // item\n $form_items[] = $tuple[4]; // x \n $form_items[] = $tuple[5]; // y\n $form_items[] = $tuple[6]; // flen\n $form_items[] = $tuple[7]; // ilen\n }\n $args = array_merge($common_options, $form_options, $form_items);\n $result = wha_dialog($args, $out, $err);\n if($result == 0) {\n if(is_string($out)) {\n $lines = explode(\"\\n\", $out);\n $i = 0;\n foreach($items as $key => $tuple) {\n $items[$key][3] = $lines[$i];\n $i++;\n }\n }\n }\n return $result;\n}", "function edit_item_copy($member_id,$name,$not_infinite,$cost,$new_x,$new_y,$new_realm,$x,$y,$realm)\n{\n\t$GLOBALS['SITE_DB']->query_update('w_items',array('not_infinite'=>$not_infinite,'cost'=>$cost,'location_x'=>$new_x,'location_y'=>$new_y,'location_realm'=>$new_realm),array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm,'copy_owner'=>$member_id,'name'=>$name));\n}", "public function overwriteForm($return,$returnfull){\n $return['nama_belakang'] = new Leap\\View\\InputText(\"hidden\", \"nama_belakang\", \"nama_belakang\", $this->nama_belakang); \n $return['account_id'] = new Leap\\View\\InputText(\"hidden\", \"account_id\", \"account_id\", $this->account_id); \n $return['supervisor_aktiv'] = new Leap\\View\\InputSelect(array('0'=>0,'1'=>1),\"supervisor_aktiv\", \"supervisor_aktiv\",$this->supervisor_aktiv);\n $return['foto'] = new \\Leap\\View\\InputFoto(\"foto\", \"foto\", $this->foto);\n // $return['guru_color'] = new Leap\\View\\InputText(\"color\", \"guru_color\", \"guru_color\", $this->guru_color); \n return $return;\n }", "public function __clone() {\n\t\t_doing_it_wrong( __FUNCTION__, esc_html( __( 'Cloning of Mild_Notify is forbidden' ) ), esc_attr( $this->_version ) );\n\n\t}", "function DataEntryForm() { \n // Create the DataEntry form\n\t\t$oMember = Member::CurrentMember();\n\t\t$iCurrentMemberID = $oMember->ID;\n\t\tif ($iCurrentMemberID && $oEvent = DataObject::get_one('CleanUpGroup', \"CreatorID = '$iCurrentMemberID'\")) {\n \t$oForm = new DataEntryForm($this, 'DataEntryForm');\n\t\t}else{\n\t\t\t$oForm = \"<p>Please create a Clean up Before Sharing data.</p>\";\n\t\t}\n // Return the form\n return $oForm;\n\t}" ]
[ "0.5743294", "0.5713472", "0.565357", "0.5601112", "0.5537034", "0.54817605", "0.54613894", "0.5378313", "0.5282312", "0.5270857", "0.52595687", "0.52525234", "0.52131903", "0.51895535", "0.51766616", "0.5171499", "0.51711106", "0.51217616", "0.5112076", "0.5106913", "0.50975835", "0.5076526", "0.5062749", "0.5061538", "0.50520456", "0.50490355", "0.5022394", "0.4987687", "0.49853227", "0.4983712" ]
0.6859174
0
Determine the substring of a string given a start and a length.
public static function substring($string, $length = 0, $start = 0) { // a substring with a start of 0 and length of 0 doesn't make sense // if we receive 0 as a length, lets leave out the length parameter if( 0 === $length ) { return substr($string, $start); } return substr($string, $start, $length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function substring($input, $start, $length = null);", "public function substr($string, $start, $length = null);", "public static function sub($string, $start = 0, $length = null)\n {\n if ($length == null) {\n $length = strlen($string);\n }\n\n return substr($string, $start, $length);\n }", "function substr ($string, $start, $length = null) {}", "public function subString($start, $length = null){\n if(is_string($start)){\n $start = stripos($this->string, $start);\n }\n if($length){\n return new Str(substr($this->string, $start, $length));\n }\n return new Str(substr($this->string, $start));\n }", "function utf8Substring($string, $start, $length)\n {\n return MyOOS_CoreApi::utf8Substring($string, $start, $length);\n }", "function substring($str, $start, $end) {\n return substr($str, $start, $end - $start);\n}", "function slice($string, $start, $end = null)\n{\n\treturn subString($string, $start, $end);\n}", "public static function safeSubstr($string, $start = 0, $length = null)\n {\n if (\\function_exists('mb_substr')) {\n return \\mb_substr($string, $start, $length, '8bit');\n } elseif ($length !== null) {\n return \\substr($string, $start, $length);\n }\n return \\substr($string, $start);\n }", "function OwnSubString($text, $start, $length) // text, 1, 2 => ex; beatka , 2 , 2 => at\n\t{\n\t\t//echo $text[$start];\n\t\t//echo $text[$start+1];\n\t\t//echo $text[$start+2];\n\t\t$result = \"\";\n\t\t\n\t\tfor($i = $start; $i < $start + $length; $i++)\n\t\t{\n\t\t\t//echo 'idzie' . \"\\n\";\n\t\t\tif ($i >= $start && $i < $start + $length)\n\t\t\t{\n\t\t\t\t//echo $text[$i] . ' ' .$start . ' i: ' . $i . \" s + l : \".($start + $length). \"\\n\";\n\t\t\t}\n\n\t\t\t$result .= $text[$i];\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function subString($string, $start, $end = null)\n{\n\tif(empty($end))\n\t{\n\t\treturn substr($string, $start);\n\t}\n\telse\n\t{\n\t\treturn substr($string, $start, ($end - $start));\n\t}\n}", "public static function substring(string $string, int $start, int $length, string $encoding = 'UTF-8'): string {\n\t\tif ($encoding === '') {\n\t\t\t$encoding = mb_internal_encoding();\n\t\t}\n\t\treturn mb_substr($string, $start, $length, $encoding);\n\t}", "public function getSubstringExpression(string $value, int $offset, ?int $length): string;", "public static function slice($string, $start, $length = null)\n {\n if (function_exists('mb_substr')) {\n return mb_substr($string, $start, $length, '8bit');\n }\n return substr($string, $start, $length);\n }", "function str_slice() {\n $args = func_get_args();\n switch (count($args)) {\n case 1:\n return $args[0];\n case 2:\n $str = $args[0];\n $str_length = strlen($str);\n $start = $args[1];\n if ($start < 0) {\n if ($start >= - $str_length) {\n $start = $str_length - abs($start);\n } else {\n $start = 0;\n }\n }\n else if ($start >= $str_length) {\n $start = $str_length;\n }\n $length = $str_length - $start;\n return substr($str, $start, $length);\n case 3:\n $str = $args[0];\n $str_length = strlen($str);\n $start = $args[1];\n $end = $args[2];\n if ($start >= $str_length) {\n return \"\";\n }\n if ($start < 0) {\n if ($start < - $str_length) {\n $start = 0;\n } else {\n $start = $str_length - abs($start);\n }\n }\n if ($end <= $start) {\n return \"\";\n }\n if ($end > $str_length) {\n $end = $str_length;\n }\n $length = $end - $start;\n return substr($str, $start, $length);\n }\n return null;\n}", "public static function sub(string $string, int $start, $length = null, $encoding = null) : string\n {\n $encoding = $encoding ?? static::getEncoding();\n return mb_substr($string, $start, $length, $encoding);\n }", "function substring($start, $end = NULL) {\n return $this->substr($start, ($end !== NULL) ? $end-$start : 0xFFFFFFF);\n }", "public function substring($string, $start, $end = NULL) {\n\t\tif ($end === NULL) {\n\t\t\t$end = mb_strlen($string, 'UTF-8');\n\t\t}\n\t\t$start = max(0, $start);\n\t\t$end = max(0, $end);\n\t\tif ($start > $end) {\n\t\t\t$temp = $start;\n\t\t\t$start = $end;\n\t\t\t$end = $temp;\n\t\t}\n\t\t$length = $end - $start;\n\t\treturn mb_substr($string, $start, $length, 'UTF-8');\n\t}", "function substr($start = 0, $length = 0xFFFFFFF) {\n return mb_substr($this->s, $start, $length);\n }", "public static function subStrTexto($string, $lenght, $start = 0) {\n\t\t$cadenaNueva = $string;\n\t\tif (strlen ( $string ) > $lenght) {\n\t\t\t$cadenaNueva = substr ( $string, $start, $lenght ) . '...';\n\t\t}\n\t\treturn $cadenaNueva;\n\t}", "public static function substr(string $subject, int $start, int $length = null): string\n {\n return substr($subject, $start, $length);\n }", "public function substring($start, $end = null) {\n $start = intval($start);\n if($start < 0 || $start > $this->length()) {\n throw new \\OutOfBoundsException(\"Start index is out of bounds.\");\n }\n if($end == null) {\n return implode(array_slice($this->bufferContainer, $start));\n } else {\n $end = intval($end);\n if($start > $end) {\n throw new \\OutOfBoundsException(\"Start index is out of bounds.\");\n }\n\n if($end > $this->length()) {\n $end = $this->length();\n }\n return implode(array_slice($this->bufferContainer, $start, $end-$start));\n }\n }", "public static function safeSubStr($str, $start, $length = false)\n {\n if (function_exists('mb_substr')\n && function_exists(\n 'mb_detect_encoding'\n )\n ) {\n $substr = mb_substr(\n $str, $start, $length, mb_detect_encoding($str)\n );\n }\n else {\n // iconv will return PHP notice if non-ascii characters are present in input string\n $str = iconv('ASCII', 'ASCII', $str);\n\n $substr = substr($str, $start, $length);\n }\n\n return $substr;\n }", "function find($start,$end,$string)\n\t{\n\t\t$startlength = strpos($string,$start)+strlen($start);\n\t\t$endlength = strpos($string,$end)-strlen($end);\n\t\t$finallength = $endlength - $startlength;\n\t\t$final = substr($string,$startlength,$finallength-3);\n\t\treturn $final;\n\t}", "function utf8_substr($str,$start)\r\n{\r\n preg_match_all(\"/./su\", $str, $ar);\r\n\r\n if(func_num_args() >= 3) {\r\n $end = func_get_arg(2);\r\n return join(\"\",array_slice($ar[0],$start,$end));\r\n } else {\r\n return join(\"\",array_slice($ar[0],$start));\r\n }\r\n}", "public static function substr(string $string, int $start, int $length) : string {\n\n\t\t\treturn (function_exists('mb_substr') ? 'mb_substr' : 'substr')($string, $start, $length);\n\t\t}", "function OwnSubString($string, $start, $end) {\n $string = (string) $string;\n $result = '';\n //$begin = $string[$start];\n for ($i = $start; $i < $start + $end; $i++) {\n $result .= $string[$i];\n }\n return $result;\n}", "public function substring(string $string, int $start, int $end = null): string\n {\n if ($end === null) {\n $end = mb_strlen($string, 'UTF-8');\n }\n $start = max(0, $start);\n $end = max(0, $end);\n if ($start > $end) {\n $temp = $start;\n $start = $end;\n $end = $temp;\n }\n $length = $end - $start;\n return mb_substr($string, $start, $length, 'UTF-8');\n }", "static function substr($str, $start, $length = -1) {\n\n if ($length == -1) {\n $length = self::strlen($str)-$start;\n }\n return mb_substr($str, $start, $length, \"UTF-8\");\n }", "public function substr($string, $start, $length = NULL) {\n\t\tif ($length === NULL) {\n\t\t\t$length = mb_strlen($string, 'UTF-8');\n\t\t}\n\t\t$length = max(0, $length);\n\t\treturn mb_substr($string, $start, $length, 'UTF-8');\n\t}" ]
[ "0.8737295", "0.8106399", "0.79072946", "0.78602594", "0.7782145", "0.7659592", "0.7482216", "0.73728126", "0.736235", "0.73519063", "0.7351447", "0.73397356", "0.72634065", "0.7257655", "0.72517025", "0.7238426", "0.7235828", "0.72348326", "0.71953636", "0.71732426", "0.71674", "0.7162027", "0.71528524", "0.71236616", "0.7095998", "0.70922333", "0.7061766", "0.70334285", "0.70171285", "0.7007995" ]
0.81123334
1
Gets query for [[DonorProfiles]].
public function getDonorProfiles() { return $this->hasMany(DonorProfile::className(), ['level_id' => 'level_id']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProfiles();", "public function getProfiles() {}", "public function getProfiles(){ }", "public function getProfiles()\n {\n $profiles = DB::table('perfiles')->get();\n return $profiles;\n }", "public function profiles()\n {\n return $this->profiles;\n }", "public function getProfile();", "public static function getProfiles(){\n\t\t$profiles = Config::inst()->get(__CLASS__,'profiles');\n\t\treturn is_array($profiles) ? $profiles : array();\n\t}", "public function getProfiles()\n {\n return $this->hasOne(Profiles::class, ['user_id' => 'id']);\n }", "public function getProfiles(): array;", "private function getUsersProfiles()\n {\n $query = 'SELECT users.id, users.name, profiles.title'.\n ' FROM #__users AS users' .\n ' LEFT JOIN #__jquarks_users_profiles AS users_profiles ON users_profiles.user_id = users.id' .\n ' LEFT JOIN #__jquarks_profiles AS profiles ON profiles.id = users_profiles.profile_id' ;\n \n $this->_db->setQuery($query) ;\n return $this->_db->loadAssocList() ; \n }", "function getProfile($params = array())\n\t{\n\t\t$query = $this->db->get_where('profiles', $params);\n\n\t\treturn $query->row();\n\t}", "function pardot_query_prospect_account($params = null, $config = null) {\n return pardot_query('prospectAccount', $params, $config);\n}", "public function profiles()\n {\n $related = 'Sofa\\Eloquence\\Tests\\JoinerProfileStub';\n $through = 'Sofa\\Eloquence\\Tests\\JoinerCompanyStub';\n return $this->hasManyThrough($related, $through, 'user_id', 'company_id');\n }", "public function getProfiles(PropelPDO $con = null)\n\t{\n\t\tif ($this->aProfiles === null && ($this->profiles_id !== null)) {\n\t\t\t$this->aProfiles = ProfilesPeer::retrieveByPk($this->profiles_id);\n\t\t\t/* The following can be used additionally to\n\t\t\t guarantee the related object contains a reference\n\t\t\t to this object. This level of coupling may, however, be\n\t\t\t undesirable since it could result in an only partially populated collection\n\t\t\t in the referenced object.\n\t\t\t $this->aProfiles->addTrackss($this);\n\t\t\t */\n\t\t}\n\t\treturn $this->aProfiles;\n\t}", "public function get_profile($params = array())\n\t{\n\t\t$query = $this->db->get_where('profiles', $params);\n\n\t\treturn $query->row();\n\t}", "public function getProfiles() {\n \n $qry = \"SELECT profID, profName, profContent, profImg, profEmail FROM profiles\";\n \n $rs = $this -> db -> query($qry);\n \n if($rs) {\n if($rs -> num_rows > 0) {\n $p = array();\n \n while($row = $rs -> fetch_assoc()) {\n $p[] = $row;\n }\n return $p;\n } else {\n //echo 'getProfiles returned no results';\n return false;\n }\n } else {\n //echo 'Error running \"getProfiles\" query';\n return false;\n }\n \n \n }", "function GetAllSearchProfiles()\n {\n return $this->GetResult(\"\",__FUNCTION__); \n }", "public function getProfiles()\n {\n return $this->em->getRepository('UserBundle:User')->getProfiles();\n }", "public function getProfiles()\n {\n return array_keys($this->params);\n }", "public function get_profile($p_id = null)\n {\n $l_sql = 'SELECT * FROM isys_visualization_profile WHERE TRUE';\n\n if ($p_id !== null)\n {\n if (!is_array($p_id))\n {\n $p_id = [$p_id];\n } // if\n\n $l_sql .= ' AND isys_visualization_profile__id ' . $this->prepare_in_condition($p_id);\n } // if\n\n return $this->retrieve($l_sql);\n }", "function get_profiles()\n\t{\n\t\t$response = $this->request( self::accounts_url, null, null, $this->auth_header() );\n\t\t$xml = simplexml_load_string( $response );\n\t\t\n\t\t$entries = $xml->entry;\n\t\t$profiles = array();\n\t\tforeach ( $entries as $entry ) {\n\t\t\t$tmp = array();\n\t\t\t$tmp['title'] = (string) $entry->title;\n\t\t\t$tmp['entryid'] = (string) $entry->id;\n\t\t\t\n\t\t\t$properties = $entry->children( self::dxp_ns );\n\t\t\t$tmp['tableid'] = (string) $properties->tableId;\n\t\t\t$tmp['accountId'] = (string) $properties->accountId;\n\t\t\t$tmp['accountName'] = (string) $properties->accountName;\n\t\t\t$tmp['profileId'] = (string) $properties->profileId;\n\t\t\t$tmp['webPropertyId'] = (string) $properties->webPropertyId;\n\t\t\t\n\t\t\t$profiles[] = $tmp;\n\t\t}\n\t\t\n\t\t// We only want to return the profile => display\n\t\t$ret = array();\n\t\tforeach ( $profiles as $profile ) {\n\t\t\t$ret[$profile['tableid']] = $profile['title'];\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "public function getRecurringPaymentProfiles()\n {\n return $this->_recurringPaymentProfiles;\n }", "public function getProfileDetails(){\n\t\t\n\t\t$allProfiles = Profile::all();\n\t\t$profileId = -1;\n\t\t\n\t\tforeach($allProfiles as $profile){\n\t\t\tif($profile->user_id == Auth::id()){\n\t\t\t\t$profileId = $profile->id;\n\t\t\t}\n\t\t}\n\t\t$profile = Profile::find($profileId);\n\t\treturn $profile;\n\t}", "public function profiles() {\n\n\t\treturn $this->hasMany('App\\Profile', 'category_id', 'category_id');\n\t}", "public function profiles()\n {\n return $this->hasMany(Profile::class);\n }", "public function getProfile()\n {\n if ($this->getProfileId())\n {\n if ($profileClass = $this->computeProfileClassName($this->getType()))\n {\n $this->profile = Doctrine::getTable($profileClass)\n ->find($this->getProfileId());\n } \n }\n \n return $this->profile;\n }", "public function getAllProfiles()\n {\n if (!empty($this->configuration)) {\n if (is_array($this->configuration)) {\n return $this->configuration;\n }\n try {\n $profiles = unserialize($this->configuration);\n return $profiles;\n } catch (Exception $e) {\n }\n }\n return $this->defaultProfiles();\n }", "public function getPprofiles()\n {\n return $this->hasMany(Pprofile::className(), ['specialty_id' => 'specialty_id']);\n }", "public function getProfile()\n\t{\n\t}", "public function getProfile()\n {\n }" ]
[ "0.6252933", "0.6205279", "0.5952952", "0.57557124", "0.56857795", "0.5581629", "0.5552503", "0.5526788", "0.5513747", "0.54880494", "0.54624045", "0.5453741", "0.5433384", "0.54075176", "0.5405242", "0.5402449", "0.536599", "0.53563255", "0.5310288", "0.5272435", "0.52429175", "0.52350986", "0.52147925", "0.5206787", "0.52055323", "0.52007526", "0.5199689", "0.51953816", "0.51878184", "0.5170761" ]
0.7135539
0
Adds an html string to the main content of the page
protected function addHtml($string) { $this->checkIfReady(); $this->html .= $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setContent($html);", "public function writeHtml($html)\r\n {\r\n $this->addPage($html);\r\n }", "public function setContent(string $html);", "public function htmlAppendContent()\r\n\t{\r\n\t\t$enable = $this->_v('html.content.append.enable', false);\r\n\t\tif(!empty($enable))\r\n\t\t{\r\n\t\t\t$viewFile = $this->_v('html.content.append.view', false);\r\n\t\t\tif(!empty($viewFile))\r\n\t\t\t{\r\n\t\t\t\treturn zbase_view_render(zbase_view_file_contents($viewFile), ['ui' => $this]);\r\n\t\t\t}\r\n\t\t\t$html = $this->_v('html.content.append.html', false);\r\n\t\t\tif(!empty($html))\r\n\t\t\t{\r\n\t\t\t\treturn $html;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn '';\r\n\t}", "public function append(string $html): void ;", "protected function renderPage($html)\n {\n return '\n <div class=\"wrap\">\n <h2>' . __($this->title) . '</h2>\n ' . $html . '\n </div>\n ';\n }", "function add_content($content)\n\t{\n\t\t$this->page .= \"$content\";\n\t}", "function append( $add )\n\t{\n\t\t$this->page_content .= $add;\t\n\t}", "abstract public function html();", "abstract public function html();", "public function html($html);", "protected function setContent( $html ) {\n\n $html = $this->maybeFormat( $html );\n $html = apply_filters( $this->filter_tag( 'content_html' ) , $html );\n\n $this->mPDF->WriteHTML( $html );\n }", "public function setHTML($html);", "protected static function addToPage($strNewContent){\n\t\tif(preg_match('#<body[^>]*>#is', static::$strContent, $arBodyMatch)){\n\t\t\tstatic::$strContent = str_replace($arBodyMatch[0], $arBodyMatch[0].\"\\n\".$strNewContent, static::$strContent);\n\t\t}\n\t}", "public function setHtml($content) {\n\t\t$this->theParts['html']['content'] = $content;\n\t}", "protected function createHTML($html = null) {\n\t\tif(!$this->xhr) {\n\t\t\t// in XHR mode, we will not add the main template\n\t\t\t$tpl_data = array(\n\t\t\t\t'title' => strtoupper(psm_get_lang('system', 'title')),\n\t\t\t\t'label_back_to_top' => psm_get_lang('system', 'back_to_top'),\n\t\t\t\t'add_footer' => $this->add_footer,\n\t\t\t\t'version' => 'v' . PSM_VERSION,\n\t\t\t\t'messages' => $this->getMessages(),\n\t\t\t\t'html_content' => $html,\n\t\t\t);\n\t\t\t// add menu to page?\n\t\t\tif($this->add_menu) {\n\t\t\t\t$tpl_data['html_menu'] = $this->createHTMLMenu();\n\t\t\t}\n\t\t\t// add header accessories to page ?\n\t\t\tif($this->header_accessories) {\n\t\t\t\t$tpl_data['header_accessories'] = $this->header_accessories;\n\t\t\t}\n\t\t\t// add modal dialog to page ?\n\t\t\tif(sizeof($this->modal)) {\n\t\t\t\t$html_modal = '';\n\t\t\t\tforeach($this->modal as $modal) {\n\t\t\t\t\t$html_modal .= $modal->createHTML();\n\t\t\t\t}\n\t\t\t\t$tpl_data['html_modal'] = $html_modal;\n\t\t\t}\n\t\t\t// add sidebar to page?\n\t\t\tif($this->sidebar !== null) {\n\t\t\t\t$tpl_data['html_sidebar'] = $this->sidebar->createHTML();\n\t\t\t}\n\t\t\tif(psm_update_available()) {\n\t\t\t\t$tpl_data['update_available'] = str_replace('{version}', 'v'.psm_get_conf('version_update_check'), psm_get_lang('system', 'update_available'));\n\t\t\t}\n\t\t\tif($this->black_background) {\n\t\t\t\t$tpl_data['body_class'] = 'black_background';\n\t\t\t}\n\t\t\t$html = $this->twig->render('main/body.tpl.html', $tpl_data);\n\t\t}\n\t\t$response = new Response($html);\n\t\treturn $response;\n\t}", "public function appendHtml($append) {}", "public function appendHtml($html){\n $this->htmlAfter = $html;\n }", "public function setContent($html)\n {\n $this->compiled = $html;\n }", "function addHTML($_code) \n\t{\n\t\t$this->html .= $_code;\t\t\n\t}", "public function addHTML($file) {\n\t\t$status = $this->fetchHTML($file);\n\t\tif (!$status) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->extractFramesInfo()) {\n\t\t\treturn 'Document was a frameset. Stopped';\n\t\t}\n\t\t$this->extractMediaLinks();\n\t\t$this->extractHyperLinks();\n\t\t$this->fetchHTMLMedia();\n\t\t$this->substMediaNamesInHTML(0);\t// 0 = relative\n\t\t$this->substHREFsInHTML();\n\t\t$this->setHtml($this->encodeMsg($this->theParts['html']['content']));\n\t}", "function addInicio ($html) {\n\n $this->innerHTML($html . $this->innerHTML);\n\n return $this;\n\n }", "public function htmlBody(string $content): self;", "function html()\n\t{\n\t\t$this->headers('html');\t\n\t\techo $this->render();\n\t}", "private function renderHTML() {\n $content = '';\n $content = $content.'<div style=\"'.$this->getStyle().'\"';\n $content = $content.$this->renderClass();\n $content = $content.$this->renderID();\n $content = $content.' >';\n $content = $content.\"<iframe id='iframe' src='\".$this->getFlickritURL().\"?height=\".$this->getHeight().\"&size=\".$this->getSize().\"&setId=\".$this->getAlbumID().\"&credit=0&thumbnails=0&transition=0&layoutType=responsive&sort=0' scrolling='no' frameborder='0'style='width:100%; height:100%; position: absolute; top:0; left:0;' ></iframe></div>\";\n\t\treturn $content;\n\t}", "private function body()\n\t{\n\t\tglobal $Mysql, $Memcached, $User;\n\t\t\n\t\tinclude(WEBROOT .'layouts/'. $this->layout .'1.php');\n\t\techo $this->content_html;\n\t\tinclude(WEBROOT .'layouts/'. $this->layout .'2.php');\n\t}", "public function addHtml($child)\n\t{\n\t\treturn $this->insert(null, $child);\n\t}", "protected function displayContent() {\n \n $html = '<h1 class=\"pageHeader\">'.$this -> pageInfo['pageHeading'].'</h1>'.\"\\n\";\n \n $html .= '<section>'.\"\\n\";\n \n $html .= '<aside>'.\"\\n\";\n $html .= '</aside>'.\"\\n\";\n\n $html .= '<div id=\"pageContent\">'.\"\\n\";\n\n if($this -> model -> userLoggedIn) {\n header('Location: index.php?page=home');\n } else {\n \t$html .= $this -> displayLoginForm();\n }\n \n $html .= '<p class=\"error\">'.$this -> model -> loginMsg.'</p>'.\"\\n\";\n \n $html .= '</div>'.\"\\n\";\n $html .= '</section>'.\"\\n\";\n\n return $html;\n \n \n }", "private function view_page($html) {\n echo $html;\n }", "private function renderHTML() {\n $content = '<div';\n $content = $content.$this->renderClass('jumbotron');\n $content = $content.$this->renderID();\n $content = $content.'> <h1>'.$this->getHeader().'</h1><p>'.$this->getText().'</p>';\n if( $this->getButtonURL() !== Null && $this->getButtonText() !== Null){\n $content = $content.'<p><a class=\"btn btn-primary btn-lg\" href=\"'.$this->getButtonURL().'\" role=\"button\">'.$this->getButtonText().'</a></p>';\n }\n $content = $content.'</div>';\n return $content;\n }" ]
[ "0.7135955", "0.7035583", "0.70173395", "0.688992", "0.6720758", "0.6686326", "0.6599001", "0.6570618", "0.65518767", "0.65518767", "0.64501524", "0.63997513", "0.63950914", "0.63601017", "0.63528454", "0.635222", "0.6324752", "0.6319519", "0.6313384", "0.62866765", "0.62720597", "0.626474", "0.62433046", "0.6241453", "0.6186799", "0.6169533", "0.61629814", "0.6161677", "0.6101331", "0.60891104" ]
0.73932683
0
Adds an text string to the main content of the page The string will be sanitised to avoid XSS
protected function addText($string) { $this->checkIfReady(); $this->html .= htmlspecialchars($string); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addContent($text) {\n\t\tif($this->stack[($ssize=count($this->stack))-1]['o']) {\n\t\t $this->buffer.='>';\n\t\t $this->stack[$ssize-1]['o']=false;\n\t\t}\n\t\t$this->stack[$ssize-1]['t']=true;\n\t\t$this->buffer.=str_replace(array('&','<','>'),array('&amp;','&lt;','&gt;'),$text);\n }", "public function appendContent($string)\r\n {\r\n $this->content .= $string;\r\n }", "public function addText($text)\n\t{\n\t\tif (!$text instanceof IHtmlString) {\n\t\t\t$text = htmlspecialchars((string) $text, ENT_NOQUOTES, 'UTF-8');\n\t\t}\n\t\treturn $this->insert(null, $text);\n\t}", "function add($text)\n\t{\n\t\t$this->xecho($text);\n\t}", "function add_content($content)\n\t{\n\t\t$this->page .= \"$content\";\n\t}", "public function addContent($content)\n {\n if (!strlen(trim($content)))\n return;\n \n $this->htmlInput .= $content;\n }", "public function prependContent($string)\r\n {\r\n $this->content = $string . $this->content;\r\n }", "protected function addHtml($string)\n\t{\n\t\t$this->checkIfReady();\n\t\t$this->html .= $string;\n\t}", "function addtext( $page, $text, $summary = '', $minor = false, $bot = true )\n {\n $data = $this->getpage( $page );\n $data.= \"\\n\" . $text;\n return $this->edit( $page, $data, $summary, $minor, $bot );\n }", "function append( $add )\n\t{\n\t\t$this->page_content .= $add;\t\n\t}", "public function addHeadContent($str)\n\t\t{\n\t\t\tParameter::check(array(\n\t\t\t\t\t\"string\" \t=> $str\n\t\t\t\t), __METHOD__);\n\t\t\t\t\n\t\t\t$this->headExtraContent .= $str;\n\t\t}", "function _text($str) {\n $md5 = md5($str);\n $option_name = get_text_translation_option_name( $md5 );\n $org = esc_html($str);\n\n if ( !isset($_COOKIE['site-edit']) || $_COOKIE['site-edit'] != 'Y' || ! user()->admin() ) {\n $str = _getText($str, true);\n echo $str;\n }\n else {\n $str = _getText($str);\n echo \"\n<div class='translate-text' md5='$md5' original-text='$org' code='$option_name'><span class='dashicons dashicons-welcome-write-blog'></span>\n<div class='html-content'>$str</div>\n</div>\n\";\n }\n\n}", "public function setContent($string)\r\n {\r\n $this->content = $string;\r\n }", "public function setText($str)\n {\n echo \"<script type=\\\"text/javascript\\\">_setText(\\\"$this->div\\\", \\\"$str\\\")</script>\";\n }", "public function setText($text)\n\t{\n\t\t$this->text = urlencode($text);\n\t}", "function text()\n\t{\n\t\t$this->headers('text');\t\n\t\techo $this->render();\n\t}", "protected static function addToPage($strNewContent){\n\t\tif(preg_match('#<body[^>]*>#is', static::$strContent, $arBodyMatch)){\n\t\t\tstatic::$strContent = str_replace($arBodyMatch[0], $arBodyMatch[0].\"\\n\".$strNewContent, static::$strContent);\n\t\t}\n\t}", "function addText($text, $tpt=NULL) {\n\n $this->rt++;\n $rtName = 'rawText_'.$this->rt;\n\n if (empty($tpt))\n $tpt = $this->formEntityTpt;\n\n $rt = $this->add($rtName,'','rawText',false,'',NULL,$tpt);\n $rt->addDirective('staticText', $text);\n\n }", "public function add_content( string $content ) {\n\t\t$this->content = $content;\n\t}", "function add_JS_text( $text )\n\t{\n\t\t$this->JS_list[] = '<script language=\"JavaScript\" type=\"text/javascript\">' . \"\\n\" . $text . \"\\n\" . '</script>';\n\t}", "private function addText($text)\n {\n if ($text) {\n $this->text[] = $text;\n }\n }", "function ModuleBlock_MicroText_AddText () {\n MicroBuilder_ModuleBlock_Base::MicroBuilder_ModuleBlock_Base();\n }", "function wpse_edit_text($content) {\n return $content;\n}", "function prepareJavascriptOutput($str)\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorGUI.php\");\n\t\tif (self::_doJSEditing())\n\t\t{\n\t\t\t$str = htmlspecialchars($str, ENT_QUOTES);\n\t\t}\n\t\treturn($str);\n\t}", "function MyMod_Handle_Add_Form_Text_Post()\n {\n if (!preg_match(\"(Coordinator|Admin)\",$this->Profile()))\n {\n return \"\";\n }\n \n return\n $this->BR().\n $this->FrameIt($this->InscriptionsObj()->DoAdd());\n }", "public function addPlain($content) {\n\t\t$content = $this->substHTTPurlsInPlainText($content);\n\t\t$this->setPlain($this->encodeMsg($content));\n\t}", "function subraya($text){\r\n return \"<u>$text</u>\";\r\n }", "protected function output($text) {\n $this->data .= $text;\n }", "function setText($sText)\r\n\t{\r\n\t\t$this->clearChildren();\r\n\t\t$this->addChild(new clsLiteral($sText));\r\n\t}", "public function addContent($content) \n {\n $this->appendPreScript($this->getProperty(\"content\", $content));\n }" ]
[ "0.73445714", "0.678558", "0.66634583", "0.66336024", "0.65637475", "0.6402451", "0.6390948", "0.6327511", "0.62900984", "0.6288637", "0.6276896", "0.62703645", "0.6158904", "0.6129182", "0.6106994", "0.60840434", "0.60675937", "0.6052135", "0.60365784", "0.5982661", "0.58899945", "0.58852553", "0.58536804", "0.5844369", "0.5841554", "0.58293694", "0.5810939", "0.5800265", "0.5790744", "0.5787231" ]
0.7588595
0
Triggers the event to remove image versions.
protected function _removeImage($record, $options): void { $Event = new Event('ImageVersion.removeVersion', $this->Table, [ 'entity' => $record, 'operations' => $options, ]); EventManager::instance()->dispatch($Event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function core_notify_image_remove($image_id)\n {\n //This is a notify type core event, so return value is not used or needed\n }", "public function preDelete(Doctrine_Event $event)\n {\n $event->getInvoker()->removeImages();\n }", "public function removeImage () {}", "public function removeImage() {\n\t}", "public function ImageDeletionEvent(Image $image) {\n\t\t$this->image = $image;\n\t}", "public function preUpdate($event)\n {\n // Remove the previous thumbnail\n @unlink($this->getThumbnailPath());\n }", "public function uninstall() {\n\t\tif (version_compare(VERSION, '2.0.1', '>=')) {\n\t\t\t$this->load->model('extension/event');\n\n\t\t\t$this->model_extension_event->deleteEvent('seogen');\n\t\t} else {\n\t\t\t$this->load->model('tool/event');\n\n\t\t\t$this->model_tool_event->deleteEvent('seogen');\n\t\t}\n\t}", "public function postRemove($image)\n {\n $this->deleteImageFile($image);\n }", "public function afterDelete()\n {\n parent::afterDelete();\n\n if ($this->image) {\n @unlink(Yii::getAlias('@webroot').$this->image);\n }\n }", "public function deleteAllImageVersions($image_id)\n {\n $dirPath = $this->getFileDir($this->getImageFilePath($image_id, self::VERSION_PREVIEW));\n\n foreach ($this->versions as $version => $fn) {\n $filePath = $this->getImageFilePath($image_id, $version);\n $this->removeFile($filePath);\n }\n\n @rmdir($dirPath);\n }", "public function preDelete($event)\n {\n // Remove the thumbnail\n @unlink($this->getThumbnailPath());\n }", "public function onRemove()\n {\n // Change the associated media to the unsorted album.\n Shopware()->Db()->query('UPDATE s_media SET albumID = ? WHERE albumID = ?', [-10, $this->id]);\n }", "public function postRemoveEntity(LifecycleEventArgs $eventArgs)\n {\n $file = $eventArgs->getDocument();\n if (!$file instanceof Attachment) {\n return;\n }\n\n $dm = $eventArgs->getDocumentManager();\n //$repo = $dm->getRepository('Applications\\Entity\\Application');\n\n $fileId = new \\MongoId($file->id);\n\n $dm->createQueryBuilder('Applications\\Entity\\Application')\n ->update()->multiple(true)\n ->field('attachments')->equals($fileId)->pull($fileId)\n ->getQuery()->execute();\n\n\n $dm->createQueryBuilder('Applications\\Entity\\Application')\n ->update()->multiple(true)\n ->field('contact.image')->equals($fileId)->set(null)\n ->getQuery()->execute();\n }", "public function variant_image_remove(Request $request){\n \n $remove=$request['variant_image_remove'];\n \n $variant=Product_Variant::find(array_keys($remove)[0]);\n\n $temp=unserialize($variant->image);\n \n foreach ($remove[$variant->id] as $key => $value) {\n\n //check in database array if file is available then unlink it. \n if(file_exists(public_path().'/Uploads/Variants_image/'.$temp[$value])) {\n unlink(public_path().'/Uploads/Variants_image/'.$temp[$value]);\n\n //as well as deleting from databse.\n unset($temp[$value]);\n }\n \n }\n \n $image=serialize($temp);\n $variant->image=$image;\n $variant->save();\n\n\n\n // redirecting back page from we click on remove.\n return redirect()->back();\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 }", "private function deleteOldImages($name): void\n {\n $id = $this->getId();\n $imageLocation = public_path() . '\\images\\\\' . $this->getModelFolderName() . '\\\\';\n\n $oldImage = glob($imageLocation . $id . '-' . $name . '.*');\n if(!empty($oldImage[0])) {\n unlink($oldImage[0]);\n }\n\n $oldOrigImage = glob($imageLocation . $id . '-' . $name . '-orig.*');\n if(!empty($oldOrigImage[0])) {\n unlink($oldOrigImage[0]);\n }\n }", "public function afterDelete() {\n\t\t//parent::afterDelete();\n\n\t\t$Event = new CakeEvent('ImageStorage.afterDelete', $this, array(\n\t\t\t'record' => $this->record,\n\t\t\t'storage' => StorageManager::adapter($this->record[$this->alias]['adapter'])));\n\t\tCakeEventManager::instance()->dispatch($Event);\n\t}", "public function afterDelete($event)\r\n {\r\n $staticPath = $this->getStaticPath();\r\n \r\n foreach($this->getDirectoriesToModify() as $directory)\r\n {\r\n \\yii\\helpers\\FileHelper::removeDirectory($staticPath.$directory);\r\n }\r\n }", "private function afterRemove(): void\n {\n $this->trigger(self::EVENT_AFTER_REMOVING);\n }", "public function deregisterImage($request);", "public function onDependencyRemoval(array $dependencies);", "public function onRemove();", "public function onAfterDelete() {\n if (\\Config::inst()->get('ElasticSearch', 'disabled')) {\n return;\n }\n \n $stage = \\Versioned::current_stage();\n\t\t$this->service->remove($this->owner, $stage);\n\t}", "public function destroy(EventImage $eventImage)\n {\n //\n }", "protected function removeHistory($version)\n\t{\n\t\t$this->db->table($this->table)\n\t\t\t\t->where('version', $version)\n\t\t\t\t->where('group', $this->group)\n\t\t\t\t->where('namespace', $this->namespace)\n\t\t\t\t->delete();\n\t\tif (is_cli())\n\t\t{\n\t\t\t$this->cliMessages[] = \"\\t\" . CLI::color(lang('Migrations.removed'), 'yellow') . \"($this->namespace) \" . $version . '_' . $this->name;\n\t\t}\n\t}", "public function preRemove(LifecycleEventArgs $args) : void\n {\n $entity = $args->getEntity();\n \n if ($entity instanceof Document)\n {\n $attachment = $entity->getAttachment();\n $this->removeFile($attachment);\n \n $images = $attachment->getImages();\n $this->removeImages($images);\n }\n }", "public static function uninstall() {\n\t\tif ( is_admin() && current_user_can( 'delete_plugins' ) ) {\n\t\t\tdo_action( self::ACTION_DELETE, static::instance(), self::VERSION, get_option( self::OPTION_VERSION ) );\n\t\t\tdelete_option( self::OPTION_VERSION );\n\t\t\t$message = __( '%s version %s has been removed', 'wp-guzzle' );\n\t\t\terror_log( sprintf( $message, self::NAME, self::VERSION ) );\n\t\t\tflush_rewrite_rules();\n\t\t}\n\t}", "public function callUninstallEvent();", "function delete_test_images_callback() {\r\n\r\n\t\tif ( !current_user_can( 'manage_options' ) ) die();\r\n\r\n\t\tglobal $wpdb;\r\n\t\t// Clear images from media library\r\n\t\t$media_library_items = get_posts( array(\r\n\t\t\t'showposts' => -1,\r\n\t\t\t'post_type' => 'attachment',\r\n\t\t\t'meta_key' => 'video_thumbnail_test_image',\r\n\t\t\t'meta_value' => '1',\r\n\t\t\t'fields' => 'ids'\r\n\t\t) );\r\n\t\tforeach ( $media_library_items as $item ) {\r\n\t\t\twp_delete_attachment( $item, true );\r\n\t\t}\r\n\t\techo '<p><span style=\"color:green\">&#10004;</span> ' . sprintf( _n( '1 attachment deleted', '%s attachments deleted', count( $media_library_items ), 'video-thumbnails' ), count( $media_library_items ) ) . '</p>';\r\n\r\n\t\tdie();\r\n\t}", "public static function boot()\n {\n parent::boot();\n\n static::deleting(function($image){\n $image->deleteThumbs();\n $image->deleteFiles();\n $image->languages()->delete();\n });\n }" ]
[ "0.6333408", "0.621806", "0.6069424", "0.6010833", "0.587621", "0.58548576", "0.58289087", "0.582832", "0.5711152", "0.5644718", "0.56442577", "0.5630286", "0.55441684", "0.5520029", "0.551647", "0.5480733", "0.54559803", "0.5453811", "0.5438437", "0.5437624", "0.5413234", "0.53808033", "0.5366511", "0.5355842", "0.5348294", "0.5323393", "0.5321132", "0.52800924", "0.527258", "0.5258181" ]
0.6229739
1
If exists Flat by FlatId and ClientId
public static function isExistsByFlatAndClientId($flat_id, $client_id) { return static::find()->where(['flat_id' => $flat_id, 'client_id' => $client_id ])->exists(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isFlat()\n {\n if (!$this->scheme) {\n return false;\n }\n return static::isFlatScheme($this->scheme);\n }", "public function findIsExists($akun_id);", "public function isFlatView()\n {\n return ($this->getGroupedByAttribute() === self::FLAT_VIEW_OPTION);\n }", "function _commerce_collector_line_item_exists($order) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n foreach ($order_wrapper->commerce_line_items->getIterator() as $line_item_wrapper) {\n // If this line item is a cod_fee line item...\n if (isset($line_item_wrapper->type) && $line_item_wrapper->type->value() == 'collector_fee') {\n return TRUE;\n }\n }\n return FALSE;\n}", "protected function validateFlat(int $flat)\n {\n if (!in_array($flat,$this->flats))\n throw new \\AssertionError(\"Unexisting flat in this building\");\n return true;\n }", "public function clients_by_salesman_get($user_id=null){\n\n if($user_id){\n $query = \"SELECT \n clients.*\n FROM clients\n WHERE `clients`.`is_deleted` = 0 \n AND (zip_code_id IN (\n SELECT\n `user_zip_codes`.`zip_code_id`\n FROM `users`\n LEFT JOIN `user_zip_codes` ON `user_zip_codes`.`user_id` = `users`.`id`\n WHERE `users`.`id` = {$user_id}\n )\n OR zip_code_id IN (\n SELECT\n `group_to_zip_code`.`zip_code_id`\n FROM `users`\n LEFT JOIN `user_zip_code_groups` ON `user_zip_code_groups`.`user_id` = `users`.`id`\n LEFT JOIN `group_to_zip_code` ON `group_to_zip_code`.`zip_code_group_id` = `user_zip_code_groups`.`zip_code_group_id`\n WHERE `users`.`id` = {$user_id}\n )\n OR `clients`.`created_by` = {$user_id}\n )\";\n\n $clients = $this->db->query($query)->result_array();\n\n if(!empty($clients)){\n $this->response(\n array(\n 'status' => TRUE,\n 'message' => \"Clients\",\n 'data' => $clients\n ),REST_Controller::HTTP_OK\n );\n }else{\n $this->response(\n array(\n 'status' => FALSE,\n 'message' => \"Clients not found.\",\n 'data' => []\n ),REST_Controller::HTTP_OK\n );\n }\n }else{\n $this->response(\n array(\n 'status' => FALSE,\n 'message' => \"UserId is required.\",\n 'data' => []\n ),REST_Controller::HTTP_BAD_REQUEST\n );\n }\n }", "function checkFlatTripnew($Source_point_Address, $Destination_point_Address,$iVehicleTypeId) {\n\tglobal $generalobj,$obj;\n\t$returnArr = array();\n\t/*$sql = \"SELECT ls.fFlatfare,lm1.vLocationName as vFromname,lm2.vLocationName as vToname, lm1.tLatitude as fromlat, lm1.tLongitude as fromlong, lm2.tLatitude as tolat, lm2.tLongitude as tolong FROM `location_wise_fare` ls left join location_master lm1 on ls.iToLocationId = lm1.iLocationId left join location_master lm2 on ls.iFromLocationId = lm2.iLocationId UNION ALL\n SELECT ls.fFlatfare,lm1.vLocationName as vToname,lm2.vLocationName as vFromname, lm1.tLatitude as tolat, lm1.tLongitude as tolong, lm2.tLatitude as fromlat, lm2.tLongitude as fromlong FROM `location_wise_fare` ls left join location_master lm1 on ls.iFromLocationId = lm1.iLocationId left join location_master lm2 on ls.iToLocationId = lm2.iLocationId\n WHERE lm1.eFor = 'FixFare' and lm1.eStatus = 'Active'\";*/\n $sql = \"SELECT ls.fFlatfare,lm1.vLocationName as vFromname,lm2.vLocationName as vToname, lm1.tLatitude as fromlat, lm1.tLongitude as fromlong, lm2.tLatitude as tolat, lm2.tLongitude as tolong FROM `location_wise_fare` ls left join location_master lm1 on ls.iFromLocationId = lm1.iLocationId left join location_master lm2 on ls.iToLocationId = lm2.iLocationId WHERE lm1.eFor = 'FixFare' AND lm1.eStatus = 'Active' AND ls.eStatus = 'Active' AND ls.iVehicleTypeId = '\".$iVehicleTypeId.\"'\"; \n\t$location_data = $obj->MySQLSelect($sql);\n\t//echo\"<pre>\";\n\t//print_r($location_data);die;\n\t$polygon = array();\n\tforeach ($location_data as $key => $value) {\n\t$fromlat = explode(\",\",$value['fromlat']);\n\t$fromlong = explode(\",\",$value['fromlong']);\n\t$tolat = explode(\",\",$value['tolat']);\n\t$tolong = explode(\",\",$value['tolong']);\n\t\tfor ($x = 0; $x < count($fromlat); $x++) {\n\t\t\tif(!empty($fromlat[$x]) || !empty($fromlong[$x])) {\n\t\t\t\t$from_polygon[$key][] = array($fromlat[$x],$fromlong[$x]);\n\t\t\t}\n\t\t}\t\n\t\tfor ($y = 0; $y < count($tolat); $y++) {\n\t\t\tif(!empty($tolat[$y]) || !empty($tolong[$y])) {\n\t\t\t\t$to_polygon[$key][] = array($tolat[$y],$tolong[$y]);\n\t\t\t}\n\t\t}\n\t\tif(!empty($Source_point_Address) && !empty($Destination_point_Address)) {\n\t\t\tif(!empty($from_polygon[$key]) && !empty($to_polygon[$key])) {\n/*\t\t\t\tprint_r($from_polygon[$key]);\n\t\t\t\techo\"<br/>\";*/\n\t\t\t\t$from_source_addresss = contains($Source_point_Address,$from_polygon[$key]) ? 'IN' : 'OUT';\n\t\t\t\t$to_source_addresss = contains($Destination_point_Address,$to_polygon[$key]) ? 'IN' : 'OUT';\n/*\t\t\t\techo\"<br/>\";\n\t\t\t\tprint_r($to_polygon[$key]);\n\t\t\t\techo\"<br/>\";*/\n\t\t\t\t$to_dest_addresss = contains($Destination_point_Address,$to_polygon[$key])? 'IN' : 'OUT';\n\t\t\t\t$from_dest_addresss = contains($Source_point_Address,$from_polygon[$key])? 'IN' : 'OUT';\n\t\t\t\tif(($from_source_addresss == \"IN\" && $to_source_addresss == \"IN\") || ($to_dest_addresss == \"IN\" && $from_dest_addresss == \"IN\")) {\n\t\t\t\t\t$returnArr['Flatfare']=$location_data[$key]['fFlatfare'];\n\t\t\t\t\t$returnArr['eFlatTrip'] = \"Yes\";\n\t\t\t\t\treturn $returnArr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} \n\tif(empty($returnArr)) {\n\t\t$returnArr['eFlatTrip']=\"No\";\n\t\t$returnArr['Flatfare']=0;\n\t}\t\n\t//print_r($returnArr);\n\t// die;\n\treturn $returnArr;\n}", "public static function getFlatListWithWing(): array\n {\n $flatModelObj = new FlatModel();\n $flatList = $flatModelObj->getFlatList();\n\n $result = [];\n foreach ($flatList as $flat) {\n $result[$flat->getFlatWing->name][$flat->id] = $flat->flat_no;\n }\n\n return $result;\n }", "public function isEnabledFlat()\n {\n if (Mage::app()->getStore()->isAdmin()) {\n return true;\n }\n if (!isset($this->_flatEnabled[$this->getStoreId()])) {\n $this->_flatEnabled[$this->getStoreId()] = $this->getFlatHelper()\n ->isEnabled($this->getStoreId());\n }\n return $this->_flatEnabled[$this->getStoreId()];\n }", "public function index($flat_id) {\n $tenement_id = Auth::user()->tenement_id;\n\n //Check period user\n if(Auth::user()->confirmed == 0 || $tenement_id == '') {\n return redirect(\"/home\");\n }\n\n\n $flat = DB::table(\"tenement_flats\")\n ->select('*')\n ->where('activation', '=', 1)\n ->where('tenement_id', '=', $tenement_id)\n ->where('id', '=', $flat_id)\n ->orderBy('flat_code')->get();\n\n $tenement = Tenement::where('id',$tenement_id)->where('activation',1)->orderBy('name', 'asc')->get();\n\n return View('monthlyfee.paymonthflat', [ \n 'flat_id'=>$flat_id,\n 'flat_info'=>$flat[0]\n ]);\n }", "public function joinFlat() {\n $userId = Session::getUserId();\n $flatCode = $_POST['flatCode'];\n\n $this->loadModel('flat');\n $res = $this->model->join($userId, $flatCode);\n\n //Falls keine Fehler aufgetreten sind\n if ($res === true) {\n $this->redirect('settings', 'flatSettings');\n } else { // Sonst Formular nochmals laden, mit Error Daten\n $this->view->assign('error_join', true);\n\n $this->view->render('settings/flatSettings', 'Flat Settings', $res);\n }\n }", "function getFlat() { return $this->_flat; }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'flat_number' => [\n 'required',Rule::unique('flats')->where(function($query) use ($request,$id) {\n $query->where('id', '!=', $id);\n $query->where('active', '=', 1);\n $query->where('block_id','=',$request->input('block'));\n $query->where('flat_number','=',$request->input('flat_number'));\n }),\n \n ],\n ['flat_number.unique' => __('messages.unique', ['Already Exists'])],\n \n ]);\n $flat = Flat::find($id);\n $flat->block_id = $request->input('block');\n $flat->flat_number = $request->input('flat_number');\n $flat->save();\n return redirect( route('flats'))->withSuccess('Flat updated successfully!');\n }", "public function anyData($flat_id) { \n ini_set('memory_limit','256M'); //\n ini_set('max_execution_time', 300); //300 seconds = 5 minutes\n\n $PaidflatList = DB::table('tf_paid_hd')\n ->select(['tf_paid_hd.*'])\n ->join(\"tenement_flats\", \"tenement_flats.id\", \"=\",\"tf_paid_hd.flat_id\")\n ->join(\"tenements\", \"tenement_flats.tenement_id\", \"=\",\"tenements.id\")\n ->where('tf_paid_hd.id', '<>' , 0)\n ->where('tf_paid_hd.flat_id', '=' , $flat_id)\n ->where('tenements.id', '=', Auth::user()->tenement_id)\n /////////////////\n ->where(function($query)\n {\n $user = Auth::user();\n if ($user->is('accountant_mem')){\n $query->where('tf_paid_hd.updated_by', '=',Auth::user()->id);\n }\n else if ($user->is('admin') || \n $user->is('manager') ||\n $user->is('moderator') ||\n $user->is('accountant')\n ) {\n $query->where(DB::RAW('1'), '=', DB::RAW('1'));\n }\n else {\n $query->where(DB::RAW('0'), '=', DB::RAW('1')); \n }\n })\n //////////////////\n ->orderBy('tf_paid_hd.id', 'desc');\n\n return Datatables::of($PaidflatList)\n ->addColumn('action', function ($PaidflatList) {\n return '<a href=\"../paiddetail/'. $PaidflatList->id .'\" class=\"btn btn-xs btn-primary\" target=\"_blank\">Chi Tiết</a>'; \n })\n ->addColumn('paidbill', function ($PaidflatList) {\n return '<a href=\"../../report/paidbill/'. $PaidflatList->id .'/2\" class=\"btn btn-xs btn-primary\" target=\"_blank\">Tải Phiếu Thu</a>'; \n })\n ->make(true); \n }", "public function createFlat() {\n $flatName = strip_tags($_POST['flatName']);\n $userId = Session::getUserId();\n $this->loadModel('flat');\n $res = $this->model->create($flatName, $userId);\n\n //Falls keine Fehler aufgetreten sind\n if ($res === true) {\n $this->redirect('settings', 'flatSettings');\n } else { // Sonst Formular nochmals laden, mit Error Daten\n $this->view->assign('error_create', true);\n $this->view->render('settings/flatSettings', 'Flat Settings', $res);\n }\n }", "private function _useFlatTable()\n {\n return $this->_configHelper->useFlatTable();\n\n }", "public function show($soldflat_id)\n {\n \n $clients=Client::orderBy('created_at', 'Desc')->get();\n $flats=Flat::orderBy('created_at', 'Desc')->get();\n $sold_flats = Flat::where('status', 'sold');\n $soldflat = Sold_flat::find($soldflat_id);\n return view('sold_flats.show', compact('clients', 'flats', 'sold_flats','sold_flat'));\n }", "public function filterEquality(): FlatFilter\n {\n return new FlatFilter($this, FilterInterface::EQUALITY);\n }", "public function requestsRelationships(): bool;", "public static function getFlatStatusList()\n {\n $flatStatusModel = new FlatStatusModel();\n return $flatStatusModel->getFlatStatusWithNameAndId();\n }", "function commerce_order_surcharge_line_item_exists($order, $service) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n // Loop over all the line items on the order.\n foreach ($order_wrapper->commerce_line_items as $delta => $line_item_wrapper) {\n // If the current line item is an order surcharge line item and the condition either\n if ($line_item_wrapper->type->value() == 'commerce_order_surcharge' ) {\n return TRUE;\n }\n }\n\n return FALSE;\n}", "public function testClientUsesWrongId(){\n foreach($this->modelResourceUriArray as $model => $endpoint){\n $response = $this->callAuthenticated('GET', '/full/'.$endpoint. '/-1');\n $response->assertStatus(404);\n }\n }", "public function getNewFlats($parsed_flats, string $table_name)\n {\n if (!$this->tableExists($table_name)) {\n $this->createTable($table_name);\n }\n\n $old_flats = $this->getOldFlats($table_name);\n $new_flats = array_diff($parsed_flats, $old_flats);\n $this->save($new_flats, $table_name);\n\n return $new_flats;\n }", "public function testFlatAfterCreate()\n {\n $this->createSubCategoriesInDefaultCategory();\n\n $category = $this->getLoadedDefaultCategory();\n $this->assertInstanceOf(\\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat::class, $category->getResource());\n\n $result = $category->getAllChildren(true);\n $this->assertNotEmpty($result);\n $this->assertCount(3, $result);\n $this->assertContains(self::$categoryOne, $result);\n\n $categoryOne = $this->getLoadedCategory(self::$categoryOne);\n $this->assertInstanceOf(\\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat::class, $categoryOne->getResource());\n\n $result = $categoryOne->getAllChildren(true);\n $this->assertNotEmpty($result);\n $this->assertCount(2, $result);\n $this->assertContains(self::$categoryTwo, $result);\n $this->checkCategoryData($categoryOne);\n\n $categoryTwo = $this->getLoadedCategory(self::$categoryTwo);\n $this->assertInstanceOf(\\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat::class, $categoryTwo->getResource());\n\n $this->assertEquals(self::$categoryOne, $categoryTwo->getParentId());\n $this->checkCategoryData($categoryTwo);\n\n $this->removeSubCategoriesInDefaultCategory();\n }", "function checkProductExist($product_sku,$StoreView)\n { \n $auth = AuthFunction();\n $token = $auth['token'];\n $check_url = $auth['url'];\n\n \n $product_url=$check_url. \"/rest/\".$StoreView.\"/V1/products/\".$product_sku;\n \n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => $product_url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"accept: application/json\",\n \"content-type: application/json\",\n \"authorization: Bearer \" . json_decode($token),\n ),\n ));\n $response = curl_exec($curl);\n $responce_data = json_decode($response);\n if (!empty($responce_data->sku)) {\n $replay_for_exist = array('exist' => 1,'StoreView' => $StoreView); \n return $replay_for_exist;\n } else {\n $replay_for_exist = array('exist' => 0,'StoreView' => $StoreView);\n return $replay_for_exist;\n }\n\n }", "public static function isFlat($array)\n {\n $n = 0;\n foreach ($array as $key => $val)\n {\n if ($key !== $n)\n {\n return false;\n }\n $n++;\n }\n return true;\n }", "public function isClientExists($client_id){\n $rep = $this->em->getRepository(Application::class);\n return $rep->findOneByToken($client_id);\n\t}", "public function obtenerPedidosTransferenciaJT($idAlmacen){\n $listaRecibidos = $this->model->where('idAlmacenD',$idAlmacen)->where('aceptoJTO',true)->where('aceptoJAD',true)->where('aceptoJTD',false)->whereDoesntHave('transferencia',function($q){\n $q->where('transferencia.deleted',false);\n })->where('deleted',false)->get(); \n $listaEmitidos = $this->model->where('idAlmacenO',$idAlmacen)->where('aceptoJTO',false)->where('aceptoJAD',false)->where('aceptoJTD',false)->whereDoesntHave('transferencia',function($q){\n $q->where('transferencia.deleted',false);\n })->where('deleted',false)->get();\n $lista = $listaRecibidos->merge($listaEmitidos);\n \n \n return $lista;\n }", "public function testCheckDataWithParentIdIsNotExist()\n {\n $_arrayValue = $this->getContentDirectory();\n\n $_arrayValue['parent_id'] = \"570a025b9a8920112613e070\";\n\n $_arrayValue['name'] = 'create new Block' . time();\n\n $user = User::find(10);\n $request = $this->actingAs($user);\n\n $respone = $request->call('POST', \"api/block-manager/edit-name-folder/\" . $this->_id, $_arrayValue);\n \n //$request->assertEquals(422, $respone->getStatusCode());\n \n $request->seeJson([\n 'status' => 0,\n ]);\n }", "function restaurantMerchantDetail($restaurant_id = 0){\n $current_merchant_id = $this->obj->nsession->userdata('merchant_id');\n if(!empty($restaurant_id)){\n $where = \" AND M.deleted = 0 AND M.parent_id = '{$current_merchant_id}' AND MRR.restaurant_id = '{$restaurant_id}'\";\n $sql = \" SELECT M.id,M.name FROM \".MERCHANT.\" M LEFT JOIN \".MERCHANT_RESTAURANT_REL.\" MRR ON M.id = MRR.merchant_id WHERE 1 $where\";\n $recordSet = $this->obj->db->query($sql);\n if ($recordSet->num_rows() > 0) {\n $row = $recordSet->row_array();\n return $row;\n } else {\n return \"\";\n }\n }\n }" ]
[ "0.4975791", "0.48908046", "0.48653775", "0.4815476", "0.46070063", "0.46045464", "0.45641038", "0.45497856", "0.45438835", "0.45226157", "0.45159513", "0.44946668", "0.44776243", "0.43905744", "0.43868393", "0.43661425", "0.4351279", "0.43261558", "0.42691845", "0.42445835", "0.4233911", "0.42005122", "0.41828972", "0.4169838", "0.41607925", "0.41203812", "0.41086656", "0.4108212", "0.4107436", "0.4105841" ]
0.6504767
0
Generate agreement file with content based on template
public function generateFile() { if ($this->agreementTemplate && $this->agreementFlat && $this->agreementClient) { $templateFilePathFull = Yii::getAlias('@frontend/web' . $this->agreementTemplate->file); if (file_exists($templateFilePathFull)) { $templateProcessor = new \common\override\PhpWord\TemplateProcessor($templateFilePathFull); // image if ($this->getPlanImage(true)) { $templateProcessor->setImageValueRaw('image1.jpeg', $this->getPlanImage(true)); } // plan $templateProcessor->cloneRow('ROW_N', $this->flat->getPayments()->count()); $cashboxUsd = Cashbox::getCashboxByCurrency(Cashbox::CURRENCY_USD); $paymentPricePlanTotal = 0; $paymentPricePlanUahTotal = 0; foreach ($this->flat->payments as $k => $payment) { $paymentPricePlan = round($payment->price_plan, 2); $paymentPricePlanUah = round($cashboxUsd->rate * $payment->price_plan, 2); $paymentPricePlanTotal += $paymentPricePlan; $paymentPricePlanUahTotal += $paymentPricePlanUah; $r = $k + 1; $templateProcessor->setValue('ROW_N#' . $r, $payment->pay_number); $templateProcessor->setValue('ROW_USD#' . $r, $paymentPricePlan); $templateProcessor->setValue('ROW_UAH#' . $r, $paymentPricePlanUah); $templateProcessor->setValue('ROW_DATE#' . $r, $payment->getPayDate()); } // text values $templateProcessor->setValue([ 'HOUSE_ADDRESS', 'HOUSE_NAME', 'FLAT_NUMBER_INDEX', 'CLIENT_FULLNAME_SHORT', 'CLIENT_FULLNAME', 'AGREEMENT_DATE', 'AGREEMENT_NUMBER', 'CLIENT_BIRTHDATE_TEXT', 'CLIENT_PASSPORT_SERIES', 'CLIENT_PASSPORT_NUMBER', 'CLIENT_PASSPORT_FROM', 'CLIENT_INN', 'CLIENT_PHONE', 'FLAT_SQUARE', 'FLAT_FLOOR', 'PRICE_UAH', 'PRICE_UAH_TEXT', 'PRICE_USD', 'PRICE_USD_TEXT', 'RATE_USD', 'RATE_USD_TEXT', 'HOUSE_SECTION', 'FLAT_BUILD_NUMBER', 'HOUSE_COMPANY_REG_INFO', 'PAYMENT_PRICE_TOTAL_USD', 'PAYMENT_PRICE_TOTAL_UAH', //'FLAT_FLOOR_PLAN_IMG', //'PAYMENT_PLAN', ], [ $this->tpl_house_address ?: $this->agreementFlat->address, $this->flat->house->name, $this->agreementFlat->number . ($this->agreementFlat->number_index ? ('/' . $this->agreementFlat->number_index) : ''), $this->tpl_client_fullname_short ?: ($this->agreementClient->lastname . ($this->agreementClient->firstname ? ' ' . mb_substr($this->agreementClient->firstname, 0, 1) . '.' : '') . ($this->agreementClient->middlename ? ' ' . mb_substr($this->agreementClient->middlename, 0, 1) . '.' : '')), $this->tpl_client_fullname ?: ($this->agreementClient->lastname . ($this->agreementClient->firstname ? ' ' . $this->agreementClient->firstname : '') . ($this->agreementClient->middlename ? ' ' . $this->agreementClient->middlename : '')), $this->getUidDate(), $this->uid, $this->tpl_client_birthdate_text ?: $this->agreementClient->birthdateText, $this->agreementClient->passport_series, $this->agreementClient->passport_number, $this->tpl_client_passport_from ?: $this->agreementClient->passport_from, $this->agreementClient->inn, $this->agreementClient->phone, $this->agreementFlat->square, $this->agreementFlat->floor, PriceHelper::format($this->agreementFlat->getPriceForCashbox(Cashbox::CURRENCY_UAH), false, false, '', '', ''), $this->agreementFlat->getPriceTextForCashbox(Cashbox::CURRENCY_UAH), PriceHelper::format($this->agreementFlat->getPriceForCashbox(Cashbox::CURRENCY_USD), false, false, '', '', ''), $this->agreementFlat->getPriceTextForCashbox(Cashbox::CURRENCY_USD), round($this->agreementFlat->rate, 2), $this->agreementFlat->getRateText(), $this->flat->house->section, $this->flat->getBuildNumber(), $this->flat->house->getCompanyRegInfo(), $paymentPricePlanTotal, $paymentPricePlanUahTotal //$this->flat->getFloorFlatImg(true, false), //'TMP', // $this->flat->getPaymentPlanForAgreement($this), ]); // save file $path = '/upload/Agreement/' . $this->id . '/agreement-'.$this->uid.'.docx'; $pathFull = Yii::getAlias('@frontend/web' . $path); $dir = dirname($pathFull); if (!is_dir($dir)) { mkdir($dir, 0777, true); } $templateProcessor->saveAs($pathFull); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function template_edit_agreement()\n{\n\tglobal $context, $settings, $options, $scripturl, $txt;\n\n\t// Just a big box to edit the text file ;).\n\techo '\n\t\t<div class=\"cat_bar\">\n\t\t\t<h3 class=\"catbg\">', $txt['registration_agreement'], '</h3>\n\t\t</div>';\n\n\t// Warning for if the file isn't writable.\n\tif (!empty($context['warning']))\n\t\techo '\n\t\t<p class=\"error\">', $context['warning'], '</p>';\n\n\techo '\n\t\t<div class=\"windowbg2\" id=\"registration_agreement\">\n\t\t\t<span class=\"topslice\"><span></span></span>\n\t\t\t<div class=\"content\">';\n\n\t// Is there more than one language to choose from?\n\tif (count($context['editable_agreements']) > 1)\n\t{\n\t\techo '\n\t\t\t\t<div class=\"information\">\n\t\t\t\t\t<form action=\"', $scripturl, '?action=admin;area=regcenter\" id=\"change_reg\" method=\"post\" accept-charset=\"UTF-8\" style=\"display: inline;\">\n\t\t\t\t\t\t<strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;\n\t\t\t\t\t\t<select name=\"agree_lang\" onchange=\"document.getElementById(\\'change_reg\\').submit();\" tabindex=\"', $context['tabindex']++, '\">';\n\n\t\tforeach ($context['editable_agreements'] as $file => $name)\n\t\t\techo '\n\t\t\t\t\t\t\t<option value=\"', $file, '\" ', $context['current_agreement'] == $file ? 'selected=\"selected\"' : '', '>', $name, '</option>';\n\n\t\techo '\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t<div class=\"righttext\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sa\" value=\"agreement\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"', $context['session_var'], '\" value=\"', $context['session_id'], '\" />\n\t\t\t\t\t\t\t<input type=\"submit\" name=\"change\" value=\"', $txt['admin_agreement_select_language_change'], '\" tabindex=\"', $context['tabindex']++, '\" class=\"button_submit\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t</div>';\n\t}\n\n\techo '\n\t\t\t\t<form action=\"', $scripturl, '?action=admin;area=regcenter\" method=\"post\" accept-charset=\"UTF-8\">';\n\n\t// Show the actual agreement in an oversized text box.\n\techo '\n\t\t\t\t\t<p class=\"agreement\">\n\t\t\t\t\t\t<textarea cols=\"70\" rows=\"20\" name=\"agreement\" id=\"agreement\">', $context['agreement'], '</textarea>\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<label for=\"requireAgreement\"><input type=\"checkbox\" name=\"requireAgreement\" id=\"requireAgreement\"', $context['require_agreement'] ? ' checked=\"checked\"' : '', ' tabindex=\"', $context['tabindex']++, '\" value=\"1\" class=\"input_check\" /> ', $txt['admin_agreement'], '.</label>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div class=\"righttext\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"', $txt['save'], '\" tabindex=\"', $context['tabindex']++, '\" class=\"button_submit\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"agree_lang\" value=\"', $context['current_agreement'], '\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"sa\" value=\"agreement\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"', $context['session_var'], '\" value=\"', $context['session_id'], '\" />\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t<span class=\"botslice\"><span></span></span>\n\t\t</div>\n\t\t<br class=\"clear\" />';\n}", "public function agreement() {\n $logged = checkLogin();\n // user info for logged in user\n $userInfo = $this->session->userdata('userInfo'); \n // create login mast text\n $this->_data['formMast'] = createHeader($logged, $userInfo);\n \n // right column\n $this->_data['rightCol'] = '\n <h4><span>Download User Agreement</span></h4>\n <ul>\n <li><a href=\"' . base_url() . 'files/user-agreement.txt\">plain text</a></li>\n <li><a href=\"' . base_url() . 'files/user-agreement.pdf\">pdf</a></li>\n </ul>\n ';\n \n $arr_load = array(\n 'pages' => array(\n 'headerFrontEnd' => true\n , 'formMast' => true\n , 'navigation' => true\n , 'agreement' => true\n , 'footerFrontEnd' => true\n )\n , 'data' => $this->_data\n );\n // load all parts for the view\n $this->doLoad($arr_load);\n }", "private function makeDoc() {\n $template_path = $this->file_folder . $this->template->file_guid;\n \n $templateProcessor = new \\PhpOffice\\PhpWord\\TemplateProcessor($template_path);\n \n $fld_arr = $templateProcessor->getVariables();\n\n foreach($fld_arr as $fld)\n {\n $templateProcessor->setValue($fld, $this->getFieldValue($fld));\n }\n \n $this->file_name = $this->getFileName() . \".\" . File::extension($this->template->file_name);\n $this->file_guid = Uuid::generate(4) . \".\" . File::extension($this->template->file_name);\n\n $this->file_path = $this->file_folder . $this->file_guid;\n\n $templateProcessor->saveAs($this->file_path);\n }", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$objTemplate = new BackendTemplate('be_wildcard');\n\n\t\t\t$objTemplate->wildcard = '### IAO MEMBER AGREEMENT LIST ###';\n\n\t\t\t$objTemplate->title = $this->headline;\n\t\t\t$objTemplate->id = $this->id;\n\t\t\t$objTemplate->link = $this->name;\n\t\t\t$objTemplate->href = 'contao/main.php?do=modules&amp;act=edit&amp;id=' . $this->id;\n\n\t\t\treturn $objTemplate->parse();\n\t\t}\n\n\t\t//wenn eine feste PDF zugewiesen wurde\n\t\tif(strlen(\\Input::get('file')) > 0 )\n\t\t{\n\n\t\t\t$objPdf = \t\\FilesModel::findByPath(\\Input::get('file'));\n\t\t\t// print_r($objPdf);\n\t\t\t// exit();\n\t\t\tif($objPdf !== null && file_exists(TL_ROOT . '/' . \\Input::get('file')))\n\t\t\t{\n\t\t\t\theader(\"Content-type: application/pdf\");\n\t\t\t\theader('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n\t\t\t\theader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');\n\t \t\t\t// header('Content-Length: '.strlen(TL_ROOT . '/' . $objPdf->path));\n\t\t\t\theader('Content-Disposition: inline; filename=\"'.$objPdf->name.'\";');\n\n\t\t\t\t// The PDF source is in original.pdf\n\t\t\t\treadfile(TL_ROOT . '/' . $objPdf->path);\n\t\t\t\texit();\n\t\t }\n\t\t}\n\n // Fallback template\n\t\tif (strlen($this->fe_iao_template)) $this->strTemplate = $this->fe_iao_template;\n\n\t\t// Set the item from the auto_item parameter\n\t\tif ($GLOBALS['TL_CONFIG']['useAutoItem'] && \\Input::get('auto_item'))\n\t\t{\n\t\t\t\\Input::setGet('pid', \\Input::get('auto_item'));\n\t\t}\n\n\t\treturn parent::generate();\n\t}", "public function createDocumentForEnvelope(array $args): string\n {\n return <<< heredoc\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"UTF-8\">\n </head>\n <body style=\"font-family:sans-serif;margin-left:2em;\">\n <h1 style=\"font-family: 'Trebuchet MS', Helvetica, sans-serif;\n color: #850456;margin-bottom: 0;\">Umeed</h1>\n <h2 style=\"font-family: 'Trebuchet MS', Helvetica, sans-serif;\n margin-top: 0px;margin-bottom: 3.5em;font-size: 1em;\n color: #850456;\">An empowered woman is one who not only has the freedom to choose but also the skills and mindset to sustain that choice.</h2>\n <br>\n <h2>Approval form</h2>\n <h4>Ordered by {$args['signer_name']}</h4>\n <p style=\"margin-top:0em; margin-bottom:0em;\">Manager email: {$args['signer_email']}</p>\n <p style=\"margin-top:0em; margin-bottom:0em;\">Sent by: {$args['cc_name']}, {$args['cc_email']}</p>\n <p style=\"margin-top:0em; margin-bottom:0em;\">Quantity: 10\n\n \n <!-- Note the anchor tag for the signature field is in white. -->\n <h3 style=\"margin-top:3em;\">Agreed: <span style=\"color:white;\">**signature_1**/</span></h3>\n </body>\n </html>\nheredoc;\n }", "function formatTemplateFile(Control $control);", "abstract protected function generateContents();", "public function create()\n {\n //\n return view ('admin.agreement.create');\n \n }", "function gettemplate($template) {\n\n//$file=file($template);\n//$template=implode('',$file);\n$template = file_get_contents($template);\n$template=str_replace('\"','\\\"',$template);\n\nreturn $template;\n}", "public function get_manual_authorisation_template() {\n\n\t\t$id = $this->get_id();\n\t\t$description = $this->get_description();\n\n\t\t$template = \"<div id='updraftplus_manual_authorisation_template_{$id}'>\";\n\t\t$template .= \"<strong>\".sprintf(__('%s authentication:', 'updraftplus'), $description).\"</strong>\";\n\t\t$template .= \"<p>\".sprintf(__('If you are having problems authenticating with %s you can manually authorize here.', 'updraftplus'), $description).\"</p>\";\n\t\t$template .= \"<p>\".__('To complete manual authentication, at the orange UpdraftPlus authentication screen select the \"Having problems authenticating?\" link, then copy and paste the code given here.', 'updraftplus').\"</p>\";\n\t\t$template .= \"<label for='updraftplus_manual_authentication_data_{$id}'>\".sprintf(__('%s authentication code:', 'updraftplus'), $description).\"</label> <input type='text' id='updraftplus_manual_authentication_data_{$id}' name='updraftplus_manual_authentication_data_{$id}'>\";\n\t\t$template .= \"<p id='updraftplus_manual_authentication_error_{$id}'></p>\";\n\t\t$template .= \"<button type='button' data-method='{$id}' class='button button-primary' id='updraftplus_manual_authorisation_submit_{$id}'>\".__('Complete manual authentication', 'updraftplus').\"</button>\";\n\t\t$template .= '<span class=\"updraftplus_spinner spinner\">' . __('Processing', 'updraftplus') . '...</span>';\n\t\t$template .= \"</div>\";\n\n\t\treturn $template;\n\t}", "public function create()\n {\n //\n return view('agreement.create');\n }", "public abstract function generateContent();", "protected function buildEmailFromTemplate($fields,$template,$subject)\r\n {\r\n \r\n $body =file_get_contents(\"http://vps112595.ovh.net\".$template);\r\n foreach ($fields as $name => $content) {\r\n $body = preg_replace(\"~{\".$name.\"}~i\", $content, $body);\r\n }\r\n \r\n /*foreach ($fields as $name => $content) {\r\n $lines[] = $name . ' : ' . $content;\r\n }*/\r\n return $body;\r\n }", "function make($mode, $services, $server)\n {\n $dir_path = __FILE__;\n // ----------------------------------------------------------\n // Change below me\n // ----------------------------------------------------------\n $dir_path = str_replace(\"template.php\", \"\", $dir_path); // Change template.php to the corrent file name of the new file\n // ----------------------------------------------------------\n // Change above me\n // ----------------------------------------------------------\n $files = glob($dir_path . \"../../*.txt\");\n\n $output = \"\";\n\n foreach($files as $file) \n {\n if (array_key_exists(scrape_between($file, \"../../\", \".txt\"), $services)) \n {\n $server = $services[scrape_between($file, \"../../\", \".txt\")];\n // ----------------------------------------------------------\n // Change below me\n // ----------------------------------------------------------\n // Change the # to match comments in youre services (default # starts comment if not changed)\n $output .= \"# File: \" . scrape_between($file, \"../../\", \".txt\") . PHP_EOL; \n // ----------------------------------------------------------\n // Change above me\n // ----------------------------------------------------------\n $output .= PHP_EOL;\n foreach (file($file) as $key => $line) \n {\n $line = trim($line, \" \\t\\n\\r\\0\\x0B\");\n if (substr($line, 0,1) == \"#\") \n {\n // Comment handling\n // ----------------------------------------------------------\n // Change below me\n // ----------------------------------------------------------\n $output .= $line; // Change this to match comments in youre services (default # starts comment if not changed)\n // ----------------------------------------------------------\n // Change above me\n // ----------------------------------------------------------\n }\n elseif (substr($line, 0,1) == \"*\") \n {\n // Wildcard handling change to match services\n // Output for wildcard\n\n // ----------------------------------------------------------\n // Change below me\n // ----------------------------------------------------------\n $line = ltrim($line, '*'); // Removing the * in the line\n $line = ltrim($line, '.'); // Removing the . in the line\n\n // Append to the output file \n // line is the corrent line in the file (domainname)\n $output .= \"# ------ Wildcard replaced with local-zone data ------ #\" . PHP_EOL;\n $output .= 'local-zone: \"' . $line . '\" redirect' . PHP_EOL;\n $output .= 'local-data: \"' . $line . ' A ' . $server . '\"' . PHP_EOL;\n $output .= \"# ---------------------------------------------------- #\";\n // ----------------------------------------------------------\n // Change above me\n // ----------------------------------------------------------\n }\n else\n {\n // Single domain handling\n // ----------------------------------------------------------\n // Change below me\n // ----------------------------------------------------------\n $output .= 'local-data: \"' . $line . ' A ' . $server . '\"';\n // ----------------------------------------------------------\n // Change above me\n // ----------------------------------------------------------\n }\n $output .= PHP_EOL;\n }\n $output .= PHP_EOL;\n $output .= PHP_EOL;\n }\n }\n if ($mode == \"cli\") \n {\n return $output;\n }\n else\n {\n echo $output;\n }\n }", "function createFile($dt) {\n\t// cleanup old prog files\n $oldPdfs = glob(\"files/prog_\".$dt['id'].\"*.html\");\n\tforeach ($oldPdfs as $target){\n\t\tunlink($target);\n\t}\n\n\t// load PhpWord & mpdf libraries via composer\n\trequire_once('vendor/autoload.php');\n\n\t// load, alter and save new docx based on template\n\t$templ = new \\PhpOffice\\PhpWord\\TemplateProcessor('files/tmpl.docx');\n\n\tforeach ($dt as $k => $v) {\n\t\t$templ->setValue(\"$k\", htmlspecialchars($v));\n }\n\t\n\t$docxFile = \"files/exp_\".$dt['id'].\".docx\";\n\t$templ->saveAs($docxFile);\n\t\n\t// prepare PDF renderer (unused because of high overhead for sch.gr servers - left as a paradigm)\n\t//\\PhpOffice\\PhpWord\\Settings::setPdfRendererPath(realpath(__DIR__ . '/vendor/mpdf/mpdf/'));\n\t//\\PhpOffice\\PhpWord\\Settings::setPdfRendererName('MPDF');\n\n\t// open the new docx\n\t$phpWord = \\PhpOffice\\PhpWord\\IOFactory::load($docxFile);\n\t$random = rand(1000,3000);\n\t\t\n\t// add a window.print() section @ end of HTML\n\t$section = $phpWord->addSection();\n\t$section->addText('<script>window.print();</script>');\n\t// save HTML with a random number on filename\n\t$fileLink = 'files/prog_'.$dt['id'].$random.'.html';\n\t$phpWord->save($fileLink, 'HTML');\n\t\n\t// save PDF (unused - see above)\n\t//$fileLink = 'files/prog_'.$dt['id'].$random.'.pdf';\n\t//$phpWord->save($fileLink, 'PDF');\n\t\n\t// delete docx\n\tunlink($docxFile);\n\t\n\treturn $fileLink;\n}", "public function create()\n {\n //\n $this->cssFiles = $this->getContent('assets.create.css');\n $this->jsFiles = $this->getContent('assets.create.js');\n\n $this->content = $this->getContent('inquiries.create');\n return $this->renderOutput();\n }", "public function actionGenerateAndDownloadDatasetCreationFile() {\n $fileColumns[] = DatasetController::AGRONOMICAL_OBJECT_URI;\n $fileColumns[] = DatasetController::DATE;\n $variables = Yii::$app->request->post('variables');\n foreach ($variables as $variableAlias) {\n $fileColumns[] = $variableAlias;\n }\n\n $csvPath = \"coma\";\n if (Yii::$app->params['csvSeparator'] == \";\") {\n $csvPath = \"semicolon\";\n }\n \n $file = fopen('./documents/DatasetFiles/' . $csvPath . '/datasetTemplate.csv', 'w');\n fputcsv($file, $fileColumns, $delimiter = Yii::$app->params['csvSeparator']);\n fclose($file);\n }", "public function generate($data){\n //DEFINITION DU CONTENU A ENVOYER\n $content = $this->generateFile($this->_file, $data);\n\n\n $view = $this->generateFile('views/template.php', array('t' => $this->_t, 'content' => $content));\n echo $view;\n }", "public function create()\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\tinclude_once './Services/ADN/Report/classes/class.adnReportFileUtils.php';\n\t\t\n\t\t// Write one task (fillPdfTemplate for every candidate) and finally merge them in one PDF.\n\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t$writer = new adnTaskScheduleWriter();\n\t\t$writer->xmlStartTag('tasks');\n\n\t\t\n\t\t$num_candidates = count($this->readCandidates());\n\t\t\n\t\t$offset = 0;\n\t\t$outfiles = array();\n\t\tdo\n\t\t{\n\t\t\t// Template by type\n\t\t\tswitch($this->getEvent()->getType())\n\t\t\t{\n\t\t\t\tcase 'gas':\n\t\t\t\t\t$map = $this->getBaseMap(array());\n\t\t\t\t\t$map = $this->addCandidates($map,true,$offset);\n\t\t\t\t\t$form = adnReportFileUtils::getTemplatePathByType(\n\t\t\t\t\t\tadnReportFileUtils::TPL_REPORT_ATTENDANCE_LIST_G);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'chem':\n\t\t\t\t\t$map = $this->getBaseMap(array());\n\t\t\t\t\t$map = $this->addCandidates($map,true,$offset);\n\t\t\t\t\t$form = adnReportFileUtils::getTemplatePathByType(\n\t\t\t\t\t\tadnReportFileUtils::TPL_REPORT_ATTENDANCE_LIST_C);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'dm':\n\t\t\t\tdefault:\n\t\t\t\t\t$map = $this->getBaseMap(array());\n\t\t\t\t\t$map = $this->addCandidates($map,false,$offset);\n\t\t\t\t\t$form = adnReportFileUtils::getTemplatePathByType(\n\t\t\t\t\t\tadnReportFileUtils::TPL_REPORT_ATTENDANCE_LIST);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Write one task (fillPdfTemplate for every candidate) and finally merge them in one PDF.\n\t\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t\t$writer->xmlStartTag('action',\n\t\t\t\tarray(\n\t\t\t\t\t'method'\t=> 'fillPdfTemplate'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t\n\t\t\t$this->initOutfile();\n\t\t\t$outfiles[] = $this->getOutfile();\n\t\t\t\n\t\t\t$writer->addParameter('string',$form);\n\t\t\t$writer->addParameter('string',$this->getOutfile());\n\t\t\t$writer->addParameter('map',$map);\n\t\t\t$writer->xmlEndTag('action');\n\t\t\t\n\t\t\t\n\t\t\t$offset += self::LIMIT_ENTRIES;\n\t\t\t$num_candidates -= self::LIMIT_ENTRIES;\n\t\t}\n\t\twhile ($num_candidates >= 0);\n\t\t\n\t\t$GLOBALS['ilLog']->write(__METHOD__.': outfiles '.print_r($outfiles,true));\n\t\t\n\t\t\n\t\t$writer->xmlStartTag('action',\n\t\t\t\tarray(\n\t\t\t\t\t'method' => 'mergePdf'\n\t\t\t\t)\n\t\t);\n\t\t$writer->addParameter('vector',(array) $outfiles);\n\t\t$outfile = $this->getDataDir().'/'.$this->getEvent()->getId().'.pdf';\n\t\t$writer->addParameter('string',$outfile);\n\t\t$writer->xmlEndTag('action');\n\t\t\n\t\t\n\t\t$writer->xmlEndTag('tasks');\n\n\t\t$GLOBALS['ilLog']->write($writer->xmlDumpMem(true));\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$adapter = new adnRpcAdapter();\n\t\t\t$adapter->transformationTaskScheduler(\n\t\t\t\t$writer->xmlDumpMem()\n\t\t\t);\n\t\t}\n\t\tcatch(adnReportException $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "protected function getTemplateFile()\n {\n return __DIR__ . '/stubs/FormRequest.txt';\n }", "protected function createConfirmationHTML($header, $text, $contact)\n {\n $html = \"<!doctype html>\n <html lang='en'>\n <head>\n <!-- Required meta tags -->\n <meta charset='utf-8'>\n <meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>\n \n <!-- Bootstrap CSS -->\n <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css' integrity='sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm' crossorigin='anonymous'>\n \n <title>GDPR removal request</title>\n <style>\n body {\n padding-top: 5rem;\n }\n .gdpr {\n padding: 3rem 1.5rem;\n text-align: center;\n }\n\n </style>\n </head>\n <body>\n <main role='main' class='container'>\n\n <div class='gdpr'>\n <h1>$header</h1>\n <p class='lead'>$text</p>\n <a href='mailto://$contact' class=''>$contact</a>\n \n </div>\n \n </main><!-- /.container -->\n\n </body>\n </html>\";\n return $html;\n\n }", "protected function buildTemplateFile($template, $blockOnly=false){\n $typesOfAccount = array('admin', 'user');\n return $template\n .'.'.$this->getHighUserGrant($typesOfAccount, $template)\n .($blockOnly ? '.block' : '')\n .'.html.twig'\n ;\n }", "function test_template()\n {\n $t = $this->template;\n $case = __DIR__ . '/templates/case1.php';\n $content = $t->render( $case, array( 'test' => 'case1' ) );\n $this->assertEquals( 'test:case1', $content );\n }", "function render($file_template){\n\n\n\n\n\t}", "public function getContent($params = array())\n {\n $template = gv($params, 'template');\n $user = gv($params, 'user');\n $password = gv($params, 'password');\n\n $body = $template->body;\n $subject = $template->subject;\n\n $company_logo = $this->config->getCompanyLogo();\n $company_address = $this->config->getCompanyAddress();\n\n $body = str_replace('[COMPANY_LOGO]', $company_logo, $body);\n \n $body = str_replace('[COMPANY_NAME]', config('config.company_name'), $body);\n $subject = str_replace('[COMPANY_NAME]', config('config.company_name'), $subject);\n \n $body = str_replace('[COMPANY_EMAIL]', config('config.email'), $body);\n $subject = str_replace('[COMPANY_EMAIL]', config('config.email'), $subject);\n \n $body = str_replace('[COMPANY_PHONE]', config('config.phone'), $body);\n $subject = str_replace('[COMPANY_PHONE]', config('config.phone'), $subject);\n \n $body = str_replace('[COMPANY_WEBSITE]', config('config.website'), $body);\n $subject = str_replace('[COMPANY_WEBSITE]', config('config.website'), $subject);\n \n $body = str_replace('[COMPANY_ADDRESS]', $company_address, $body);\n $subject = str_replace('[COMPANY_ADDRESS]', $company_address, $subject);\n \n $body = str_replace('[CURRENT_DATE]', showDate(date('Y-m-d')), $body);\n $subject = str_replace('[CURRENT_DATE]', showDate(date('Y-m-d')), $subject);\n \n $body = str_replace('[CURRENT_DATE_TIME]', showDateTime(date('Y-m-d H:i:s')), $body);\n $subject = str_replace('[CURRENT_DATE_TIME]', showDateTime(date('Y-m-d H:i:s')), $subject);\n\n if ($template->category === 'user' && $user) {\n $body = str_replace('[NAME]', ($user->name) ? : '-', $body);\n $subject = str_replace('[NAME]', ($user->name) ? : '-', $subject);\n\n $body = str_replace('[PASSWORD]', $password, $body);\n $subject = str_replace('[PASSWORD]', $password, $subject);\n\n $body = str_replace('[EMAIL]', $user->email, $body);\n $subject = str_replace('[EMAIL]', $user->email, $subject);\n }\n\n $mail_data['body'] = $body;\n $mail_data['subject'] = $subject;\n\n return $mail_data;\n }", "public function generateIntroductions()\n {\n\n\n $this->templateFile = '_templates/backend_coin_intro.html';\n $this->outputFolder = '../_introductions';\n $i = 1;\n foreach ($this->getCoinCMCList() as $key => $coin) {\n // var_dump($coin['symbol']);die;\n $sym = $coin['symbol'];\n $this->initCoin($sym);\n\n //test mode\n if ($this->isTestMode()) {\n if (!in_array($sym, $this->testCoinList())) continue;\n }\n if (empty($this->currentCoin)) continue;\n\n $coinSnapshotFullInfo = $this->getCoinSnapshotFull();\n $_coin = $this->currentCoin;\n $_coin['Description'] = isset($coinSnapshotFullInfo['Data']['General']['Description']) ? $coinSnapshotFullInfo['Data']['General']['Description'] : null;\n $_coin['Features'] = isset($coinSnapshotFullInfo['Data']['General']['Features']) ? $coinSnapshotFullInfo['Data']['General']['Features'] : null;\n $_coin['Technology'] = isset($coinSnapshotFullInfo['Data']['General']['Technology']) ? $coinSnapshotFullInfo['Data']['General']['Technology'] : null;\n $_coin['AffiliateUrl'] = isset($coinSnapshotFullInfo['Data']['General']['AffiliateUrl']) ? $coinSnapshotFullInfo['Data']['General']['AffiliateUrl'] : null;\n $_coin['Url'] = isset($coinSnapshotFullInfo['Data']['General']['Url']) ? $coinSnapshotFullInfo['Data']['General']['Url'] : null;\n $_coin['sitemap'] = \"false\";\n $_coin['sort_order'] = $i;\n\n $_coin['tag'] = $this->slug($this->currentCoin['Name']);\n $_coin['url'] = '/backend/' . $this->slug($this->getCurrentSym(true)) . '-' . $this->currentCoin['Id'] . '.html';\n $this->setVars($_coin);\n $this->tag = $_coin['tag'];\n $file = '2018-01-01-' . $this->slug($this->getCurrentSym(true)) . '-' . $this->currentCoin['Id'] . '.md';\n $this->generateFile($file);\n $i++;\n }\n }", "public function template() {}", "private function createTemplate(): string\n {\n $fileEnding = 'jpg';\n if ($this->response !== null) {\n $fileEnding = (str_contains($this->response->header('Content-Type'), 'jpeg') ? 'jpg' : 'png');\n }\n\n $properties = collect();\n $this->article->properties\n ->sortBy('name')\n ->each(function (ArticleProperty $property) use ($properties) {\n $counter = 0;\n\n if ($properties->has($property->name)) {\n do {\n $counter++;\n $key = sprintf('%s%d', $property->name, $counter);\n } while ($properties->has($key));\n $properties[$key] = $property->content;\n } else {\n $properties[$property->name] = $property->content;\n }\n });\n\n $properties = $properties->map(function ($item, $key) {\n try {\n $value = DeepLyFacade::translate($item, config('services.deepl.target_locale'), 'EN');\n } catch (Exception $e) {\n app('Log')::warning($e->getMessage());\n $value = $item;\n }\n\n return sprintf(\n \"|%s=%s\",\n $key,\n $value\n );\n })\n ->implode(\"\\n\");\n\n $relatedArticles = $this->article->related\n ->map(function (Article $article) {\n return sprintf('[[%s]]', $article->cleanTitle);\n })\n ->implode(\"<br>\\n\");\n\n $normalizedFileName = str_replace('/', '_', $this->article->cleanTitle);\n\n // The actual template content\n return <<<TEMPLATE\n{{Galactapedia\n|title={$normalizedFileName}\n|image=Galactapedia_{$this->article->cleanTitle}.{$fileEnding}\n{$properties}\n|related={$relatedArticles}\n}}\nTEMPLATE;\n }", "function merge($data, $outputPath, $download = false, $protect=false){\n\n if($this->workingDir == null)\n $this->workingDir = sys_get_temp_dir().\"/DocxTemplating\";\n \n if(!file_exists($this->workingDir)){\n mkdir($this->workingDir,0777,true);\n }\n $workingFile = tempnam($this->workingDir,'');\n if($workingFile === FALSE || !copy($this->template,$workingFile)){\n throw new \\Exception(\"Error in initializing working copy of the template\");\n }\n $this->workingDir = $workingFile.\"_\";\n $zip = new \\ZipArchive();\n if($zip->open($workingFile) === TRUE){\n $zip->extractTo($this->workingDir);\n $zip->close();\n }else{\n throw new \\Exception('Failed to extract Template');\n }\n\n if(!file_exists($this->workingDir)){\n throw new \\Exception('Failed to extract Template');\n }\n\n $filesToParse = array(\n array(\"name\"=>\"word/document.xml\",\"required\"=>true),\n array(\"name\"=>\"word/header1.xml\"),\n array(\"name\"=>\"word/header2.xml\"),\n array(\"name\"=>\"word/header3.xml\"),\n array(\"name\"=>\"word/footer1.xml\"),\n array(\"name\"=>\"word/footer2.xml\"),\n array(\"name\"=>\"word/footer3.xml\"),\n array(\"name\"=>\"word/footnotes.xml\"),\n array(\"name\"=>\"word/endnotes.xml\")\n );\n\n foreach($filesToParse as $fileToParse){\n if(isset($fileToParse[\"required\"]) && !file_exists($this->workingDir.'/'.$fileToParse[\"name\"])){\n throw new \\Exception(\"Can not merge, Template is corrupted\");\n }\n if(file_exists($this->workingDir.'/'.$fileToParse[\"name\"])){\n $this->mergeFile($this->workingDir.'/'.$fileToParse[\"name\"],$data);\n }\n }\n\n if($protect === true){\n $settingsFile = $this->workingDir.'/word/settings.xml';\n\n $settingsDocument = new \\DOMDocument();\n if($settingsDocument->load($settingsFile) === FALSE){\n throw new \\Exception(\"Error in protecting the document\");\n }\n\n $documentProtectionElement = $settingsDocument->createElement(\"w:documentProtection\");\n $documentProtectionElement->setAttribute(\"w:cryptAlgorithmClass\",\"hash\");\n $documentProtectionElement->setAttribute(\"w:cryptAlgorithmSid\",\"4\");\n $documentProtectionElement->setAttribute(\"w:cryptAlgorithmType\",\"typeAny\");\n $documentProtectionElement->setAttribute(\"w:cryptProviderType\",\"rsaFull\");\n $documentProtectionElement->setAttribute(\"w:cryptSpinCount\",\"100000\");\n $documentProtectionElement->setAttribute(\"w:edit\",\"readOnly\");\n $documentProtectionElement->setAttribute(\"w:enforcement\",\"1\");\n $documentProtectionElement->setAttribute(\"w:hash\",\"agIYzNUC1FNp4sJAazkA+rOu3Bw=\");\n $documentProtectionElement->setAttribute(\"w:salt\",\"ydP+pf0vmKAQkaM0gyb9TQ==\");\n\n $settingsDocument->documentElement->appendChild($documentProtectionElement);\n\n if($settingsDocument->save($settingsFile) === FALSE){\n throw new \\Exception(\"Error in creating output\");\n }\n }\n\n // once merge is happened , zip the working directory and rename\n $mergedFile = $this->workingDir.'/output.docx';\n if($zip->open($mergedFile,\\ZipArchive::CREATE) === FALSE){\n throw new \\Exception(\"Error in creating output\");\n }\n\n // Create recursive directory iterator\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->workingDir,\\FilesystemIterator::SKIP_DOTS),\n \\RecursiveIteratorIterator::LEAVES_ONLY\n );\n\n foreach($files as $name=>$file){\n $name = substr($name,strlen($this->workingDir.\"/\"));\n $zip->addFile($file->getRealPath(),$name);\n //echo \"\\n\".$name .\" : \".$file->getRealPath();\n }\n $zip->close();\n\n //once merged file is available copy it to $outputPath or write as downloadable file\n if($download == false){\n copy($mergedFile,$outputPath);\n }else{\n $fInfo = new \\finfo(FILEINFO_MIME);\n $mimeType = $fInfo->file($mergedFile);\n\n header('Content-Type:'.$mimeType,true);\n header('Content-Length:'.filesize($mergedFile),true);\n header('Content-Disposition: attachment; filename=\"'.$outputPath.'\"',true);\n if(readfile($mergedFile) === FALSE){\n throw new \\Exception(\"Error in reading the file\");\n }\n }\n\n // remove workingDir and workingFile\n unlink($workingFile);\n $this->deleteDir($this->workingDir);\n if($download === true){\n exit;\n }\n }", "function handler_email_template($handler, $email)\n\t\t{\n\t\t\treturn handler_templates_dir($handler).\"email/$email.txt\";\n\t\t}" ]
[ "0.6428664", "0.6408871", "0.61611074", "0.5631832", "0.5624935", "0.55963206", "0.5563017", "0.5555299", "0.54973805", "0.54182374", "0.534551", "0.5335251", "0.53028125", "0.5256848", "0.52555156", "0.52550197", "0.51829207", "0.5177408", "0.5177238", "0.51754487", "0.5147666", "0.5145878", "0.51322615", "0.51104385", "0.5092193", "0.5086361", "0.5083727", "0.50809413", "0.50793415", "0.50778663" ]
0.7549595
0
Write content to docx file
public function writeFileContent($content) { $pathFull = Yii::getAlias('@frontend/web' . $this->file); libxml_use_internal_errors(true); if ($this->file) { $phpWord = new \PhpOffice\PhpWord\PhpWord(); $section = $phpWord->addSection(); // $section->addText($content); \PhpOffice\PhpWord\Shared\Html::addHtml($section, $content); $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); $objWriter->save($pathFull); // Saving the document as HTML file... // $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML'); // $objWriter->save($pathFull . '.html'); // plain html save for reading in form file_put_contents("$pathFull.html", $content); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function read_docx(){\n\n\t\t$striped_content = '';\n\t\t$content = '';\n\n\t\t$zip = zip_open($this->filename); // open the file\n\n\t\tif (!$zip || is_numeric($zip)) return false;\n\n\t\t// loop to read the file\n\t\twhile ($zip_entry = zip_read($zip)) {\n\n\t\t\tif (zip_entry_open($zip, $zip_entry) == FALSE) continue;\n\n\t\t\tif (zip_entry_name($zip_entry) != \"word/document.xml\") continue;\n\n\t\t\t$content .= zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); // append the content to the $content variable\n\n\t\t\tzip_entry_close($zip_entry);\n\t\t} // end while\n\n\t\tzip_close($zip); // close the file\n\n\t\t// handling the text, replacing the relevant characters with a space or a new line\n\n\t\t$content = str_replace('</w:r></w:p></w:tc><w:tc>', \" \", $content);\n\t\t$content = str_replace('</w:r></w:p>', \"\\r\\n\", $content); \n\t\t$striped_content = strip_tags($content);\n\n\t\treturn $striped_content;\n\t}", "public function store(Request $request)\n {\n //\n\n // $chk_type = $request['text_text'];\n \n // header(\"Content-type: application/vnd.ms-word\");\n // header(\"Content-Disposition: attachment;Filename=\".rand().\".doc\");\n // header(\"Pragma: no-cache\");\n // header(\"Expires: 0\");\n\n // echo $request['text_text'];\n\n // Creating the new document...\n $phpWord = new \\PhpOffice\\PhpWord\\PhpWord();\n\n /* Note: any element you append to a document must reside inside of a Section. */\n\n // Adding an empty Section to the document...\n $section = $phpWord->addSection();\n $chk_type = $request['text_text'];\n\n // Adding Text element to the Section having font styled by default...\n $section->addText($request[\"text_text\"]);\n\n // Saving the document as HTML file...\n $objWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($phpWord, 'Word2007');\n $objWriter->save('helloWorld.docx');\n\n alert()->success('Yes, it got here')->autoclose(4000);\n return redirect()->back();\n }", "private function makeDoc() {\n $template_path = $this->file_folder . $this->template->file_guid;\n \n $templateProcessor = new \\PhpOffice\\PhpWord\\TemplateProcessor($template_path);\n \n $fld_arr = $templateProcessor->getVariables();\n\n foreach($fld_arr as $fld)\n {\n $templateProcessor->setValue($fld, $this->getFieldValue($fld));\n }\n \n $this->file_name = $this->getFileName() . \".\" . File::extension($this->template->file_name);\n $this->file_guid = Uuid::generate(4) . \".\" . File::extension($this->template->file_name);\n\n $this->file_path = $this->file_folder . $this->file_guid;\n\n $templateProcessor->saveAs($this->file_path);\n }", "public function createDoc(){\n\t\t$phpWord = new \\PhpOffice\\PhpWord\\PhpWord();\n\n\t\t/* Note: any element you append to a document must reside inside of a Section. */\n\n\t\t // Adding an empty Section to the document...\n\t\t$section = $phpWord->addSection();\n\n\t\t// Adding Text element to the Section having font styled by default...\n\t\t$section->addText(('ABCD'));\n\n\t\t$section = $phpWord->addSection();\n\t\t$section->addText(('<h2><abcd>HAHAHAHAHA</abcd></h2>'));\n\n\t\t// Saving the document as HTML file...\n\t\t$objWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($phpWord, 'HTML');\n\t\t$objWriter->save('abcd.html');\n }", "function docx2text()\n {\n return $this->readZippedXML($this->file, \"word/document.xml\");\n }", "public function writeContent($content);", "protected function exportToWord()\n {\n if ($this->type === self::EXPORT_TYPE_LIST) {\n $table = $this->tableLists(false);\n } else if ($this->type == self::EXPORT_TYPE_DETAIL) {\n $table = $this->tableDetail(false);\n } else {\n throw new InvalidConfigException('The \"type\" property failed.');\n }\n\n $document = '<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" xmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\" xmlns:css=\"http://macVmlSchemaUri\" xmlns=\"http://www.w3.org/TR/REC-html40\"><head><meta name=\"Title\" content=\"'. $this->fileName .'\"/><meta name=Keywords content=\"\"><meta http-equiv=Content-Type content=\"text/html; charset=unicode\"><meta name=ProgId content=Word.Document><meta name=Generator content=\"Microsoft Word 14\"><meta name=\"Originator\" content=\"Microsoft Word 14\"/><link rel=\"File-List\" href=\"Customer%20(5)_files/filelist.xml\"/><!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View></w:WordDocument></xml><![endif]--><style>'. \n (\n $this->orientation == 'potrait' \n ? '<!--@page WORDSECTION1 {mso-page-orientation:potrait;} -->' \n : '<!--@page WordSection1 {size:792.0pt 612.0pt; mso-page-orientation:landscape; margin:90.0pt 72.0pt 90.0pt 72.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;}div.WordSection1 {page:WordSection1;}table.MsoTableGrid{ width: 100%; margin-bottom: 6pt; margin-top: 6pt;}.label-detail{ font-weight: bold; text-align: right }-->'\n ) .\n '</style></head><body bgcolor=white lang=EN-US style=\\'tab-interval:36.0pt\\'><div class=WordSection1>'. $table .'<p class=MsoNormal style=\\'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto\\'><span style=\\'mso-fareast-font-family:\"Times New Roman\";mso-bidi-font-family:\"Times New Roman\"\\'><o:p>&nbsp;</o:p></span></p></div></body></html>';\n\n\n return $this->setContentHeader($document, true);\n }", "public function word2html()\n {\n //$word->Visible = 1;\n //$word->Documents->Open('D:\\Works\\php\\fengning\\public\\1.docx');\n //$word->Documents[1]->SaveAs('./1.html', 8);\n //$word->Quit();\n //$word = null;\n //unset($word);\n\n $word = new \\COM(\"word.application\") or die(\"Can't start Word!\");\n $word->Visible = 0;\n $word->Documents->Open('D:\\Works\\php\\fengning\\public\\1.docx', false, false, false, \"1\", \"1\", true);\n\n\n $word->ActiveDocument->final = false;\n $word->ActiveDocument->Saved = true;\n $word->ActiveDocument->ExportAsFixedFormat(\n 'D:\\Works\\php\\fengning\\public\\1.pdf',\n 17, // wdExportFormatPDF\n false, // open file after export\n 0, // wdExportOptimizeForPrint\n 3, // wdExportFromTo\n 1, // begin page\n 5000, // end page\n 7, // wdExportDocumentWithMarkup\n true, // IncludeDocProps\n true, // KeepIRM\n 1 // WdExportCreateBookmarks\n );\n $word->ActiveDocument->Close();\n $word->Quit();\n\n //$word=new \\COM(\"Word.Application\") or die(\"无法打开 MS Word\");\n //$word->visible = 1 ;\n //$word->Documents->Open('D:\\\\Works\\\\php\\\\fengning\\\\public\\\\1.docx')or die(\"无法打开这个文件\");\n //$htmlpath=substr('D:\\\\Works\\\\php\\\\fengning\\\\public\\\\1.docx',0,-4);\n //$word->ActiveDocument->SaveAs($htmlpath,8);\n //$word->quit(0);\n }", "public function save(\\Docx\\Document $document, $filename = null);", "public function write($content);", "function write() {\r\n $data = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\";\r\n \r\n if(count($this->css)) {\r\n foreach($this->css as $css)\r\n $data .= \"<?xml-stylesheet type=\\\"text/css\\\" href=\\\"\" . $css . \"\\\"?>\\n\";\r\n }\r\n \r\n if(count($this->xslt)) {\r\n foreach($this->xslt as $xslt)\r\n $data .= \"<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"\" . $xslt . \"\\\"?>\\n\";\r\n }\r\n \r\n $data .= $this->get_text_node();\r\n\r\n $file = @fopen($this->filename, \"w\");\r\n\r\n if($file) {\r\n fwrite($file, $data);\r\n fclose($file);\r\n return true;\r\n } else return false;\r\n }", "function read_docx($filename){\n \n // get docx data and store as $content\n $parsed_content = '';\n $content = '';\n\n if(!$filename || !file_exists($filename)) return false;\n $zip = zip_open($filename);\n if (!$zip || is_numeric($zip)) return false;\n while ($zip_entry = zip_read($zip)) {\n if (zip_entry_open($zip, $zip_entry) == FALSE) continue;\n if (zip_entry_name($zip_entry) != \"word/document.xml\") continue;\n $content .= zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));\n zip_entry_close($zip_entry);\n }\n zip_close($zip);\n \n // magic regex parsing\n $content = str_replace('</w:r></w:p></w:tc><w:tc>', \" \", $content);\n $content = str_replace('</w:r></w:p>', \"\\r\\n\", $content);\n $parsed_content = strip_tags($content);\n\n return $parsed_content;\n}", "function setConvertToDocx($contenido, $titulo){\n\t\t$rawname\t= $this->cleanNombreArchivo($titulo);\n\t\t$fmt_in\t\t= $rawname . \".html\";\n\t\t$fmt_out\t= $rawname . \".docx\";\n\t\t$nn\t\t\t= \"\";\n\t\t$nfile\t\t= $this->setCreateFile($contenido, $fmt_in);\n\t\t$res\t\t= false;\n\t\tif($nfile !== false){\n\t\t\t$ofile\t= PATH_TMP . $fmt_out;\n\t\t\t\n\t\t\t$xFU\t= new cSystemTask();\n\t\t\tif($xFU->getExistsUnoconv() == true){\n\t\t\t\t$res\t= $xFU->runcmd(\"export HOME=\" . PATH_TMP . \" && /usr/bin/unoconv --format=docx --output='$ofile' '$nfile'\");\n\t\t\t\tif($res !== false){\n\t\t\t\t\t$nn\t\t= $ofile;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn $nn;\n\t}", "public function write(): string\n {\n $objWriter = null;\n if ($this->getParentWriter()->getUseDiskCaching()) {\n $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());\n } else {\n $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);\n }\n\n // XML header\n $objWriter->startDocument('1.0', 'UTF-8');\n\n // Content\n $objWriter->startElement('office:document-content');\n $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');\n $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');\n $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');\n $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');\n $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');\n $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');\n $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');\n $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');\n $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');\n $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');\n $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');\n $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');\n $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');\n $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');\n $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');\n $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');\n $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');\n $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');\n $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');\n $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');\n $objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms');\n $objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');\n $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');\n $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');\n $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');\n $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');\n $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');\n $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');\n $objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0');\n $objWriter->writeAttribute('xmlns:formx', 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0');\n $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');\n $objWriter->writeAttribute('office:version', '1.2');\n\n $objWriter->writeElement('office:scripts');\n $objWriter->writeElement('office:font-face-decls');\n\n // Styles XF\n $objWriter->startElement('office:automatic-styles');\n $this->writeXfStyles($objWriter, $this->getParentWriter()->getSpreadsheet());\n $objWriter->endElement();\n\n $objWriter->startElement('office:body');\n $objWriter->startElement('office:spreadsheet');\n $objWriter->writeElement('table:calculation-settings');\n\n $this->writeSheets($objWriter);\n\n (new AutoFilters($objWriter, $this->getParentWriter()->getSpreadsheet()))->write();\n // Defined names (ranges and formulae)\n (new NamedExpressions($objWriter, $this->getParentWriter()->getSpreadsheet(), $this->formulaConvertor))->write();\n\n $objWriter->endElement();\n $objWriter->endElement();\n $objWriter->endElement();\n\n return $objWriter->getData();\n }", "function createFile($dt) {\n\t// cleanup old prog files\n $oldPdfs = glob(\"files/prog_\".$dt['id'].\"*.html\");\n\tforeach ($oldPdfs as $target){\n\t\tunlink($target);\n\t}\n\n\t// load PhpWord & mpdf libraries via composer\n\trequire_once('vendor/autoload.php');\n\n\t// load, alter and save new docx based on template\n\t$templ = new \\PhpOffice\\PhpWord\\TemplateProcessor('files/tmpl.docx');\n\n\tforeach ($dt as $k => $v) {\n\t\t$templ->setValue(\"$k\", htmlspecialchars($v));\n }\n\t\n\t$docxFile = \"files/exp_\".$dt['id'].\".docx\";\n\t$templ->saveAs($docxFile);\n\t\n\t// prepare PDF renderer (unused because of high overhead for sch.gr servers - left as a paradigm)\n\t//\\PhpOffice\\PhpWord\\Settings::setPdfRendererPath(realpath(__DIR__ . '/vendor/mpdf/mpdf/'));\n\t//\\PhpOffice\\PhpWord\\Settings::setPdfRendererName('MPDF');\n\n\t// open the new docx\n\t$phpWord = \\PhpOffice\\PhpWord\\IOFactory::load($docxFile);\n\t$random = rand(1000,3000);\n\t\t\n\t// add a window.print() section @ end of HTML\n\t$section = $phpWord->addSection();\n\t$section->addText('<script>window.print();</script>');\n\t// save HTML with a random number on filename\n\t$fileLink = 'files/prog_'.$dt['id'].$random.'.html';\n\t$phpWord->save($fileLink, 'HTML');\n\t\n\t// save PDF (unused - see above)\n\t//$fileLink = 'files/prog_'.$dt['id'].$random.'.pdf';\n\t//$phpWord->save($fileLink, 'PDF');\n\t\n\t// delete docx\n\tunlink($docxFile);\n\t\n\treturn $fileLink;\n}", "function writeToFile($file,$content) \n{\n\tglobal $txt;\n\n\t$file_open = fopen($file, 'w') or fatal_lang_error('fm_file_couldnotopen_write',0);\n\tfwrite($file_open, $content);\n\tfclose($file_open);\n}", "public function write( $path, $content );", "function make_word_doc( $doc, $dir ) {\n\t\n\t// make the a new instance of a phpword\n\t// you will add all the info to this\n\t\n\t$phpWord = new \\PhpOffice\\PhpWord\\PhpWord();\n\t$i = 0;\n\t$l = count( $doc ) - 1;\n\t\n\t// loop through each page in the doc\n\t// each page is a 'section'\n\t\n\tfor ( $i; $i < $l; $i = $i + 1 ) {\n\t\t$Paragraphs = $doc[ 'Page' . $i ];\n\t\t$ii = 0;\n\t\t$ll = count($Paragraphs) - 1;\n\t\t\n\t\t${\"page_\" . $i} = $phpWord->addSection();\n\t\t$Page = ${\"page_\" . $i};\n\t\t\n\t\t// in each page loop through each paragraph\n\t\t// style the the paragraph's alignment\n\t\t\n\t\tfor ( $ii; $ii < $ll; $ii = $ii + 1 ) {\n\t\t\t$Spans = $Paragraphs[ 'Paragraph' . $ii ];\n\t\t\t$iii = 0;\n\t\t\t$lll = count( $Spans ) - 1;\n\t\t\t\n\t\t\t${\"paragraph_\" . $i . '_' . $ii} = $Page->addTextRun( array( 'align'=>$Spans[ 'align' ] ) );\n\t\t\t$Paragraph = ${\"paragraph_\" . $i . '_' . $ii};\n\t\t\t\n\t\t\t// loop through each text span\n\t\t\t\n\t\t\tfor( $iii; $iii < $lll; $iii = $iii + 1 ) {\n\t\t\t\t$Span = $Spans[ 'Span' . $iii ];\n\t\t\t\t\n\t\t\t\t// create the style info for the text span\n\t\t\t\t\n\t\t\t\t$Style = array(\n\t\t\t\t\t'name' => $Span[ 'Styles' ][ 'name' ],\n\t\t\t\t\t'size' => intval( $Span[ 'Styles' ][ 'size' ] ),\n\t\t\t\t\t'bold' => filter_var( $Span[ 'Styles' ][ 'bold' ], FILTER_VALIDATE_BOOLEAN ),\n\t\t\t\t\t'italic' => filter_var( $Span[ 'Styles' ][ 'italic' ], FILTER_VALIDATE_BOOLEAN ),\n\t\t\t\t\t'color' => $Span[ 'Styles' ][ 'color' ],\n\t\t\t\t\t'fgColor' => $Span[ 'Styles' ][ 'fgColor' ]\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// add the text span with it's style to the paragraph\n\t\t\t\t\n\t\t\t\t$Paragraph->addText( $Span[ 'text' ], $Style );\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// assign it as a word doc\n\t\n\t$objWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter( $phpWord, 'Word2007' );\n\t\n\t// create an empty word doc file w. the new file name\n\t\n\t$pathAndFile = $dir . '/' . $doc[ 'title' ] . '.docx';\n\t\n\t// save the file with content included\n\t\n\t$objWriter->save( $pathAndFile );\n\t\n\t// return the .doc's title so it can be downloaded\n\t\n\techo( $doc[ 'title' ] . '.docx' );\n\t\n\tdie();\n}", "protected function writeContentToFile()\n {\n $content = '<?php' . PHP_EOL . PHP_EOL\n . 'return ' . $this->getCleanContent() . ';' . PHP_EOL;\n\n try {\n File::put($this->path, $content);\n\n } catch (Exception $e) {\n\n throw (new ModelInformationFileWriteFailureException(\n \"Failed to write '{$this->path}', make sure the directory exists and is writable\",\n $e->getCode(),\n $e\n ))->setModelClass($this->information->modelClass());\n }\n }", "public function show(Doc $doc)\n {\n $templateProcessor = new TemplateProcessor(resource_path('asset/template1.docx'));\n\n\n $receiver = User::find($doc->receiver)->name ?? \"\";\n\n $templateProcessor->setValue('speed', $doc->speed);\n //$templateProcessor->setValue('explanation', Html::addHtml($doc->explanation));\n $templateProcessor->setValue('confidentiality', $doc->confidentiality);\n $templateProcessor->setValue('date', $doc->date);\n $templateProcessor->setValue('subject', $doc->subject);\n $templateProcessor->setValue('sender', $receiver);\n $templateProcessor->setValue('receiver', $receiver);\n\n\n\n /*TODO:\n 把 parse html地方弄好\n https://github.com/PHPOffice/PHPWord/issues/902#issuecomment-564561115\n 注意細節\n */\n $section = (new PhpWord())->addSection();\n Html::addHtml($section, $doc->explanation, false, false);\n $containers = $section->getElements();\n $templateProcessor->cloneBlock('htmlblock', count($containers), true, true);\n for($i = 0; $i < count($containers); $i++) {\n $templateProcessor->setComplexBlock('html#' . ($i+1), $containers[$i]);\n }\n\n\n //$xmlWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($templateProcessor, 'Word2007');\n try {\n $templateProcessor->saveAs(storage_path($doc->id.'.docx'));\n } catch (Exception $e) {\n }\n\n return response()->download(storage_path($doc->id.'.docx'));\n }", "public static function doc() { return \"\\n\" . file_get_contents(__CLASS__ . '.doc.txt'); }", "public function transformContentToDocument(Content $content, ContentDocument $document)\n {\n $document->setId($content->getId());\n $document->setTitle($content->getTitle());\n $document->setContent($content->getContent());\n $document->setFolder($content->getFolder());\n $document->setSlug($content->getLoadId());\n $document->setSnippet($content->isSnippet());\n $document->setType($content->getType());\n $document->setActive($content->isActive());\n $document->setPosition($content->getPosition());\n }", "static public function saveToFile($name, $content)\n {\n $file = fopen(utf8_decode($name), 'w');\n \n if (is_string($content)) {\n fwrite($file, $content);\n } else {\n $dom = new DomDocument();\n $node = $dom->importNode($content[0], true);\n $dom->appendChild($node);\n \n fwrite($file, $dom->saveHTML());\n }\n fclose($file);\n }", "public function writeFile($cropDirPath, $content)\n {\n $includePathFilename = $cropDirPath .'/index.html';\n $path = $this->sqlUriConvertAbsolutUri($includePathFilename);\n \n $filesystem = new Filesystem();\n return $filesystem->dumpFile($path, $content);\n\n }", "public function write(): void\n {\n if (!is_writable($this->file)) {\n throw new FileException(\"File {$this->file} not allow to write\");\n }\n file_put_contents($this->file, $this->xml->asXML());\n }", "public function write($content) {\n\t\t\n\t\t// Ecriture du fichier\n\t\tif (fwrite ( $this->_handle, $content ) === false) {\n\t\t\tthrow new Sea_Exception ( 'Ecriture impossible dans le fichier : \"' . $this->_filename . '\"' );\n\t\t}\n\t\t\n\t}", "function merge($data, $outputPath, $download = false, $protect=false){\n\n if($this->workingDir == null)\n $this->workingDir = sys_get_temp_dir().\"/DocxTemplating\";\n \n if(!file_exists($this->workingDir)){\n mkdir($this->workingDir,0777,true);\n }\n $workingFile = tempnam($this->workingDir,'');\n if($workingFile === FALSE || !copy($this->template,$workingFile)){\n throw new \\Exception(\"Error in initializing working copy of the template\");\n }\n $this->workingDir = $workingFile.\"_\";\n $zip = new \\ZipArchive();\n if($zip->open($workingFile) === TRUE){\n $zip->extractTo($this->workingDir);\n $zip->close();\n }else{\n throw new \\Exception('Failed to extract Template');\n }\n\n if(!file_exists($this->workingDir)){\n throw new \\Exception('Failed to extract Template');\n }\n\n $filesToParse = array(\n array(\"name\"=>\"word/document.xml\",\"required\"=>true),\n array(\"name\"=>\"word/header1.xml\"),\n array(\"name\"=>\"word/header2.xml\"),\n array(\"name\"=>\"word/header3.xml\"),\n array(\"name\"=>\"word/footer1.xml\"),\n array(\"name\"=>\"word/footer2.xml\"),\n array(\"name\"=>\"word/footer3.xml\"),\n array(\"name\"=>\"word/footnotes.xml\"),\n array(\"name\"=>\"word/endnotes.xml\")\n );\n\n foreach($filesToParse as $fileToParse){\n if(isset($fileToParse[\"required\"]) && !file_exists($this->workingDir.'/'.$fileToParse[\"name\"])){\n throw new \\Exception(\"Can not merge, Template is corrupted\");\n }\n if(file_exists($this->workingDir.'/'.$fileToParse[\"name\"])){\n $this->mergeFile($this->workingDir.'/'.$fileToParse[\"name\"],$data);\n }\n }\n\n if($protect === true){\n $settingsFile = $this->workingDir.'/word/settings.xml';\n\n $settingsDocument = new \\DOMDocument();\n if($settingsDocument->load($settingsFile) === FALSE){\n throw new \\Exception(\"Error in protecting the document\");\n }\n\n $documentProtectionElement = $settingsDocument->createElement(\"w:documentProtection\");\n $documentProtectionElement->setAttribute(\"w:cryptAlgorithmClass\",\"hash\");\n $documentProtectionElement->setAttribute(\"w:cryptAlgorithmSid\",\"4\");\n $documentProtectionElement->setAttribute(\"w:cryptAlgorithmType\",\"typeAny\");\n $documentProtectionElement->setAttribute(\"w:cryptProviderType\",\"rsaFull\");\n $documentProtectionElement->setAttribute(\"w:cryptSpinCount\",\"100000\");\n $documentProtectionElement->setAttribute(\"w:edit\",\"readOnly\");\n $documentProtectionElement->setAttribute(\"w:enforcement\",\"1\");\n $documentProtectionElement->setAttribute(\"w:hash\",\"agIYzNUC1FNp4sJAazkA+rOu3Bw=\");\n $documentProtectionElement->setAttribute(\"w:salt\",\"ydP+pf0vmKAQkaM0gyb9TQ==\");\n\n $settingsDocument->documentElement->appendChild($documentProtectionElement);\n\n if($settingsDocument->save($settingsFile) === FALSE){\n throw new \\Exception(\"Error in creating output\");\n }\n }\n\n // once merge is happened , zip the working directory and rename\n $mergedFile = $this->workingDir.'/output.docx';\n if($zip->open($mergedFile,\\ZipArchive::CREATE) === FALSE){\n throw new \\Exception(\"Error in creating output\");\n }\n\n // Create recursive directory iterator\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->workingDir,\\FilesystemIterator::SKIP_DOTS),\n \\RecursiveIteratorIterator::LEAVES_ONLY\n );\n\n foreach($files as $name=>$file){\n $name = substr($name,strlen($this->workingDir.\"/\"));\n $zip->addFile($file->getRealPath(),$name);\n //echo \"\\n\".$name .\" : \".$file->getRealPath();\n }\n $zip->close();\n\n //once merged file is available copy it to $outputPath or write as downloadable file\n if($download == false){\n copy($mergedFile,$outputPath);\n }else{\n $fInfo = new \\finfo(FILEINFO_MIME);\n $mimeType = $fInfo->file($mergedFile);\n\n header('Content-Type:'.$mimeType,true);\n header('Content-Length:'.filesize($mergedFile),true);\n header('Content-Disposition: attachment; filename=\"'.$outputPath.'\"',true);\n if(readfile($mergedFile) === FALSE){\n throw new \\Exception(\"Error in reading the file\");\n }\n }\n\n // remove workingDir and workingFile\n unlink($workingFile);\n $this->deleteDir($this->workingDir);\n if($download === true){\n exit;\n }\n }", "public function writeXMLFile()\n\t{\n\t\t$podcasts = new JBSMPodcast;\n\t\t$result = $podcasts->makePodcasts();\n\t\t$this->setRedirect('index.php?option=com_biblestudy&view=podcasts', $result);\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'Qbank' => 'mimes:docx'\n ]);\n\n $filenameWithExt = $request->file('Qbank')->getClientOriginalName();\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n $extension = $request->file('Qbank')->getClientOriginalExtension();\n $filenameSave = $filename.'_'.time().'.'.$extension;\n $path = $request->file('Qbank')->storeAs('public/QbankFile', $filenameSave);\n\n if($path){\n\n $xmlString = '';\n try{\n\n $objReader = IOFactory::createReader('Word2007');\n\n $source = storage_path('app\\public\\QbankFile/'.$filenameSave);\n\n $phpRead = $objReader->load($source);\n $sections = $phpRead->getSections();\n\n foreach ($sections as $key => $value) {\n $sectionElement = $value->getElements();\n foreach ($sectionElement as $elementKey => $elementValue) {\n $element = $elementValue->getElements();\n foreach ($element as $keyelement => $value) {\n $wordLoadContent = $value->getText();\n\n // print_r(simplexml_load_string($wordLoadContent));\n\n $xmlString = $wordLoadContent;\n echo $xmlString;\n // print_r(str_word_count($xmlString));\n\n // $xml = simplexml_load_string($xmlString) or die (\"error: create object\");\n // print_r($xml);\n }\n }\n }\n\n\n \n // $myXMLData =\n // \"<Qbank><category>q</category><questiontype>sadasd</questiontype><paragraph>asdas</paragraph><question>asdas</question></Qbank>\";\n\n // $xml=simplexml_load_string($myXMLData) or die(\"Error: Cannot create object\");\n // echo \"<pre>\";\n // print_r($xml);\n // echo \"</pre>\";\n\n }catch(Exception $e){\n return back()\n ->with('message','File upload error '.$e);\n }\n\n // return back()\n // ->with('message','File '.$filename.'.'.$extension.' has been uploaded.');\n }\n }", "function po_intern_word(){\n $phpWord = new \\PhpOffice\\PhpWord\\PhpWord();\n\n /* Note: any element you append to a document must reside inside of a Section. */\n\n // Adding an empty Section to the document...\n $section = $phpWord->addSection();\n // Adding Text element to the Section having font styled by default...\n \n // Add text elements\n $section->addText('Hello World!');\n $section->addTextBreak(2);\n $section->addText('Mohammad Rifqi Sucahyo.', array('name'=>'Verdana', 'color'=>'006699'));\n $section->addTextBreak(2);\n $phpWord->addFontStyle('rStyle', array('bold'=>true, 'italic'=>true, 'size'=>16));\n $phpWord->addParagraphStyle('pStyle', array('align'=>'center', 'spaceAfter'=>100));\n // Save File / Download (Download dialog, prompt user to save or simply open it)\n $section->addText('Ini Adalah Demo PHPWord untuk CI', 'rStyle', 'pStyle');\n\n $styleTable = array('borderSize' => 6, 'borderColor' => '006699', 'cellMargin' => 80);\n $styleFirstRow = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF');\n $styleCell = array('valign' => 'center');\n $styleCellBTLR = array('valign' => 'center', 'textDirection' => \\PhpOffice\\PhpWord\\Style\\Cell::TEXT_DIR_BTLR);\n $fontStyle = array('bold' => true, 'align' => 'center');\n $phpWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow);\n $table = $section->addTable('Fancy Table');\n $table->addRow(900);\n $table->addCell(2000, $styleCell)->addText(htmlspecialchars('Row 1'), $fontStyle);\n $table->addCell(2000, $styleCell)->addText(htmlspecialchars('Row 2'), $fontStyle);\n $table->addCell(2000, $styleCell)->addText(htmlspecialchars('Row 3'), $fontStyle);\n $table->addCell(2000, $styleCell)->addText(htmlspecialchars('Row 4'), $fontStyle);\n $table->addCell(500, $styleCellBTLR)->addText(htmlspecialchars('Row 5'), $fontStyle);\n\n for ($i = 1; $i <= 8; $i++) {\n $table->addRow();\n $table->addCell(2000)->addText(htmlspecialchars(\"Cell {$i}\"));\n $table->addCell(2000)->addText(htmlspecialchars(\"Cell {$i}\"));\n $table->addCell(2000)->addText(htmlspecialchars(\"Cell {$i}\"));\n $table->addCell(2000)->addText(htmlspecialchars(\"Cell {$i}\"));\n $text = (0== $i % 2) ? 'X' : '';\n $table->addCell(500)->addText(htmlspecialchars($text));\n }\n \n $filename='just_some_random_name.docx'; //save our document as this file name\n header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document'); //mime type\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\n header('Cache-Control: max-age=0'); //no cache\n $objWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($phpWord, 'Word2007');\n $objWriter->save('php://output');\n exit;\n\n\n }" ]
[ "0.63456833", "0.62803394", "0.6235411", "0.61343235", "0.60186505", "0.59479827", "0.59453046", "0.5891917", "0.57407933", "0.56653005", "0.55873936", "0.55303454", "0.5475593", "0.54386085", "0.5409299", "0.5359945", "0.53595024", "0.53534037", "0.5289005", "0.5284682", "0.5244355", "0.5204043", "0.5169966", "0.5161282", "0.51473624", "0.5131108", "0.5116394", "0.50863147", "0.5075762", "0.5067103" ]
0.752532
0
Menampilkan data status kamar dari lookup_m
public function getStatusPeriksa() { return LookupM::model()->findAllByAttributes(array('lookup_type'=>'statusperiksa', 'lookup_aktif'=>true),array('order'=>'lookup_urutan')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function status_on($data) {\n $id = I(\"request.id/d\");\n if(!$id) {\n $this->ajaxResult(\"货品别名参数不存在\");\n }\n $search = M('goods_alias')->find($id);\n if(!$search)\n $this->ajaxResult(\"货品别名不存在\");\n if($search['status']=='7'){\n $this->ajaxResult(\"货品别名已取消\");\n }\n if($search['status']!='0'){\n $this->ajaxResult(\"货品别名状态已变化,请重新处理\");\n }\n $data[\"search\"] = $search;\n $data[\"id\"] = $data[\"search\"][\"id\"];\n foreach($data as $key=>$val) {\n $this->assign($key, $val);\n }\n $html = $this->fetch(\"GoodsAlias:status_on\");\n echo $html;\n }", "private function getDataMahasiswa_data($dataSearch, $status) {\n\n\t\tif (empty($dataSearch)) {\n\n\t\t\t$data['footerSection'] = \"<script type='text/javascript'>\n \t\t\t\tswal({\n\t\t\t\t\ttitle: 'Pemberitahuan',\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\thtml: true,\n\t\t\t\t\ttext: 'Silahkan mengisi terlebih dahulu NIM pada Text Input',\n\t\t\t\t\tconfirmButtonColor: '#f7cb3b',\n\t\t\t\t});\n\t\t </script>\";\n\n\t\t\t$this->load->view('dashbord',$data);\n\n\t\t} else {\n\n\t\t\t$GetField = $this->app->GetFields(\"kli_wisuda.st_kliring, m.NIM, m.Name, m.id_reg_pd, m.TotalSKS, m.TotalSKSLulus, m.IPK, j.Kode kdj, j.Nama_Indonesia as nmj, f.Kode kdf, f.Nama_Indonesia as nmf, jp.Nama as jenjang, st_mhsw.Nama as status, m.StatusAwal\", \"_v2_mhsw m left join _v2_jurusan j on m.KodeJurusan=j.Kode left join fakultas f on j.KodeFakultas=f.Kode left join _v2_jenjangps jp on j.Jenjang=jp.Kode left join _v2_statusmhsw st_mhsw on m.status=st_mhsw.Kode left join _v2_kliring_wisuda kli_wisuda on m.NIM=kli_wisuda.NIM\", \"m.NIM\", \"$dataSearch\")->result(); // untuk dosen pengampu dan asisten dosen\n\t\t\t$data['detailmhsw'] = $GetField;\n\n\t\t\t$tahun_khs = $this->app->GetField(\"NIM, Tahun\", \"_v2_khs\", \"NIM='$dataSearch'\", \"\")->result(); // untuk pengecekan tahun di tabel _v2_khs\n\t\t\t//$data['detail_tahun'] = $tahun_khs;\n\n\t\t\t$i = 0;\n\n\t\t\tforeach ($tahun_khs as $khs){\n\t\t\t\t$nim = $khs->NIM;\n\t\t\t\t$tahun = $khs->Tahun;\n\t\t\t\t$tahun_krs = $khs->Tahun;\n\n\t\t\t\t/*if ($tahun == \"20161\"){\n\t\t\t\t\t$tahun = \"\";\n\t\t\t\t}*/\n\n\t\t\t\t$tahun_khs_baru = $this->app->GetField(\"ID,IDJadwal ,KodeMK, NamaMK, SKS, GradeNilai, Bobot, Tahun, Sesi, NotActive, NotActive_KRS, '$tahun' as tahun_tabel\", \"_v2_krs$tahun\", \"NIM='$dataSearch'\", \"(Tahun='$tahun_krs' or Tahun='TR')\")->result(); // untuk pengecekan tahun di tabel _v2_khs\n\t\t\t\t$data['detail_tahun'][$i] = $tahun_khs_baru;\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t// atas nilai transfer mahasiswa\n\t\t\t$tahun_khs_baru = $this->app->GetField(\"ID,IDJadwal ,KodeMK, NamaMK, SKS, GradeNilai, Bobot, Tahun, Sesi, NotActive, NotActive_KRS, 'TR' as tahun_tabel\", \"_v2_krsTR\", \"NIM='$dataSearch'\", \"(Tahun='TR' or Tahun='TR')\")->result(); // untuk pengecekan tahun di tabel _v2_khs\n\t\t\t$data['detail_tahun'][$i] = $tahun_khs_baru;\n\t\t\t$i++;\n\t\t\t// bawah nilai transfer mahasiswa\n\n\t\t\t$data['jumlah_array'] = $i;\n\n\t\t\t$data['nim'] = $dataSearch;\n\n\t\t\tif (!empty($status)){\n\t\t\t\t$status = \"<script type='text/javascript'>\n\t \t\t\t\tswal({\n\t\t\t\t\t\ttitle: 'Pemberitahuan',\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\thtml: true,\n\t\t\t\t\t\ttext: 'Berhasil',\n\t\t\t\t\t\tconfirmButtonColor: '#f7cb3b',\n\t\t\t\t\t});\n\t\t\t </script>\";\n\t\t\t}\n\n\t\t\t$data['footerSection'] = \"<script type='text/javascript'>\n \t\t\t\t$('#matakuliah').DataTable();\n\t\t </script>$status\";\n\n\t\t\t$this->load->view('dashbord',$data);\n\n\t\t}\n\n\t}", "private function status_on($data) {\n $id = I(\"request.id/d\");\n if(!$id) {\n $this->ajaxResult(\"仓库信息参数不存在\");\n }\n $search = M('warehouse')->find($id);\n if(!$search)\n $this->ajaxResult(\"仓库信息不存在\");\n if($search['status']=='7'){\n $this->ajaxResult(\"仓库信息已取消\");\n }\n if($search['status']!='0'){\n $this->ajaxResult(\"仓库信息状态已变化,请重新处理\");\n }\n $data[\"search\"] = $search;\n $data[\"id\"] = $data[\"search\"][\"id\"];\n foreach($data as $key=>$val) {\n $this->assign($key, $val);\n }\n $html = $this->fetch(\"Warehouse:status_on\");\n echo $html;\n }", "function lookup(){\n\t\t $keyword = $this->input->post('term');\n $data['response'] = 'false'; //Set default response\n $query = $this->MAutocomplete->lookup($keyword); //Search DB\n if( ! empty($query) )\n {\n $data['response'] = 'true'; //Set response\n $data['message'] = array(); //Create array\n foreach( $query as $row )\n {\n $data['message'][] = array( \n 'id'=>$row->id,\n 'value' => $row->name,\n ''\n ); //Add a row to array\n }\n }\n if('IS_AJAX')\n {\n echo json_encode($data); //echo json string if ajax request\n \n }\n else\n {\n $this->load->view('admin/index',$data); //Load html view of search results\n }\n\t}", "function lookup(){\n\t\t $keyword = $this->input->post('term');\n $data['response'] = 'false'; //Set default response\n $query = $this->MAutocomplete->lookup($keyword); //Search DB\n if( ! empty($query) )\n {\n $data['response'] = 'true'; //Set response\n $data['message'] = array(); //Create array\n foreach( $query as $row )\n {\n $data['message'][] = array( \n 'id'=>$row->id,\n 'value' => $row->name,\n ''\n ); //Add a row to array\n }\n }\n if('IS_AJAX')\n {\n echo json_encode($data); //echo json string if ajax request\n \n }\n else\n {\n $this->load->view('admin/index',$data); //Load html view of search results\n }\n\t}", "public function batal_valwis() {\n\n\t\t$this->app->check_modul(); // untuk pengecekan modul\n\n\t\t$dataSearch = $this->uri->segment(4);\n\n\t\t$this->sinkron_db->Sinkron_wisuda_delete(\"nilai_akhir\", \"NIM='$dataSearch'\", \"\");\n\t\t$this->sinkron_db->Sinkron_wisuda_delete(\"mhs\", \"NIM='$dataSearch'\", \"\");\n\t\t$this->db->query(\"UPDATE _v2_kliring_wisuda set st_kliring=1 and NIM='$dataSearch'\");\n\n\t\t$this->getDataMahasiswa_data($dataSearch, \"\");\n\t}", "public function searchLookupUsulanSkpd(){\n\t\t$name \t\t= ($this->input->post('name', TRUE) ? $this->input->post('name', TRUE) : '');\n \t$result \t= $this->m_transaksirenja->searchLookupUsulanSkpd($name);\n\n \tforeach ($result->result() as $key => $value) {\n\t\t\t$data['data'][]=array(\n\t\t\t\t'id' \t\t\t\t=> $value->id,\n\t\t\t\t'kode_musrenbang'\t=> $value->kode_musrenbang,\n\t\t\t\t'kegiatan' \t\t\t=> $value->kegiatan\n\t\t\t);\n\t\t}\n\t\t$data['success']\t= true;\n\t\techo json_encode($data);\n\t}", "private function status_off($data) {\n $id = I(\"request.id/d\");\n if(!$id) {\n $this->ajaxResult(\"货品别名参数不存在\");\n }\n $search = M('goods_alias')->find($id);\n if(!$search)\n $this->ajaxResult(\"货品别名不存在\");\n if($search['status']=='7'){\n $this->ajaxResult(\"货品别名已取消\");\n }\n if($search['status']!='1'){\n $this->ajaxResult(\"货品别名状态已变化,请重新处理\");\n }\n $data[\"search\"] = $search;\n $data[\"id\"] = $data[\"search\"][\"id\"];\n foreach($data as $key=>$val) {\n $this->assign($key, $val);\n }\n $html = $this->fetch(\"GoodsAlias:status_off\");\n echo $html;\n }", "public function getLookupKegiatan(){\n\t\tif($this->session->userdata('kode_unitkerja')==\"\"){\n\t\t\t$resultCount \t= $this->m_transaksirenja->countGridLookupKegiatan();\n\t\t\t$count \t\t\t= $resultCount->num_rows();\n\n\t\t\tforeach ($resultCount->result() as $key => $value) {\n\t\t\t\t$data['data'][]=array(\n\t\t\t\t\t'id' \t\t\t\t=> $value->id,\n\t\t\t\t\t'kode_kegiatanrpjm'\t=> $value->kode_kegiatanrpjm,\n\t\t\t\t\t'kegiatan' \t\t\t=> $value->kegiatan,\n\t\t\t\t\t'no_urut'\t\t\t=> $value->no_urut\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$data['total'] \t\t= $count;\n\t\t\t$data['success']\t= true;\n\t\t\techo json_encode($data);\n\t\t} else {\n\t\t\t$resultCount \t= $this->m_transaksirenja->countGridLookupKegiatanFilter();\n\t\t\t$count \t\t\t= $resultCount->num_rows();\n\n\t\t\tforeach ($resultCount->result() as $key => $value) {\n\t\t\t\t$data['data'][]=array(\n\t\t\t\t\t'id' \t\t\t\t=> $value->id,\n\t\t\t\t\t'kode_kegiatanrpjm'\t=> $value->kode_kegiatanrpjm,\n\t\t\t\t\t'kegiatan' \t\t\t=> $value->kegiatan,\n\t\t\t\t\t'no_urut'\t\t\t=> $value->no_urut\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$data['total'] \t\t= $count;\n\t\t\t$data['success']\t= true;\n\t\t\techo json_encode($data);\n\t\t}\n\t}", "public function lookup(){\n \t\t\n // process posted form data \n \t\t$keyword = $this->input->post('term'); \n \t\t\t$data['response'] = 'false'; //Set default response \n \t\t$query = $this->m_showkat->lookup($keyword); //Search DB \n \t\tif( ! empty($query) ) \n \t\t{ \n \t\t$data['response'] = 'true'; //Set response \n \t\t$data['message'] = array(); //Create array \n \n \t\tforeach( $query as $row ) \n \t\t{ \n \t\t$data['message'][] = array( \n 'id'=>$row->pro_id, \n 'value' => $row->pro_name, \n ''); //Add a row to array \n \t\t} \n \t\t}\n\n\t\t if('IS_AJAX') \n\t\t { \n\t\t \techo json_encode($data); //echo json string if ajax request \n\t\t \n\t\t } \n\t\t else \n\t\t { \n\t\t $this->load->view('autocomplete/index',$data); //Load html view of search results \n\t\t } \n\t\t\n\t\t}", "function entry_status()\n\t{\n\t\t$get_all_requests = $this->Health->find('all',array('conditions'=>array('Health.entry_status'=>0),'limit'=>2000));\n\t\t//echo \"dasdasd<pre>\"; print_r($get_all_requests); exit;\n\t\tforeach($get_all_requests as $key => $val)\n\t\t{\n\t\t\t//echo \"<pre>\"; print_r($val); exit;\n\t\t\tif(!empty($val['Health']['test_id']))\n\t\t\t{\n\t\t\t\t$explode_test_ids_db = explode(',',$val['Health']['test_id']);\n\t\t\t\tforeach($explode_test_ids_db as $k_test_db => $v_test_db)\n\t\t\t\t{\n\t\t\t\t\t$check_test_duplicate = $this->RequestTest->find('first',array('conditions'=>array('RequestTest.type'=>'TE','RequestTest.health_id'=>$val['Health']['id'],'RequestTest.test_id'=>$v_test_db)));\n\t\t\t\t\tif(empty($check_test_duplicate))\n\t\t\t\t\t{\n\t\t\t\t\t\t$find_test_mrp = $this->Test->find('first',array('conditions'=>array('Test.id'=>$v_test_db)));\n\t\t\t\t\t\t$this->data['RequestTest']['type'] = 'TE';\n\t\t\t\t\t\t$this->data['RequestTest']['health_id'] = $val['Health']['id'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_id'] = $v_test_db; \n\t\t\t\t\t\t$this->data['RequestTest']['mrp'] =$find_test_mrp['Test']['mrp'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_book_date'] = $val['Health']['book_date'];\n\t\t\t\t\t\t$this->data['RequestTest']['status'] = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($this->RequestTest->create($this->data))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->RequestTest->save($this->data);\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\n\t\t\tif(!empty($val['Health']['profile_id']))\n\t\t\t{\n\t\t\t\t$explode_profile_ids_db = explode(',',$val['Health']['profile_id']);\n\t\t\t\tforeach($explode_profile_ids_db as $k_profile_db => $v_profile_db)\n\t\t\t\t{\n\t\t\t\t\t$check_profile_duplicate = $this->RequestTest->find('first',array('conditions'=>array('RequestTest.type'=>'PR','RequestTest.health_id'=>$val['Health']['id'],'RequestTest.test_id'=>$v_profile_db)));\n\t\t\t\t\tif(empty($check_profile_duplicate))\n\t\t\t\t\t{\n\t\t\t\t\t\t$find_profile_mrp = $this->Test->find('first',array('conditions'=>array('Test.id'=>$v_profile_db)));\n\t\t\t\t\t\t$this->data['RequestTest']['type'] = 'PR';\n\t\t\t\t\t\t$this->data['RequestTest']['health_id'] = $val['Health']['id'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_id'] = $v_profile_db; \n\t\t\t\t\t\t$this->data['RequestTest']['mrp'] =$find_profile_mrp['Test']['mrp'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_book_date'] =$val['Health']['book_date'];\n\t\t\t\t\t\t$this->data['RequestTest']['update_test_date'] = '0000-00-00 00:00:00';\n\t\t\t\t\t\t$this->data['RequestTest']['status'] = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($this->RequestTest->create($this->data))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->RequestTest->save($this->data);\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\n\t\t\tif(!empty($val['Health']['offer_id']))\n\t\t\t{\n\t\t\t\t$explode_offer_ids_db = explode(',',$val['Health']['offer_id']);\n\t\t\t\tforeach($explode_offer_ids_db as $k_offer_db => $v_offer_db)\n\t\t\t\t{\n\t\t\t\t\t$check_offer_duplicate = $this->RequestTest->find('first',array('conditions'=>array('RequestTest.type'=>'OF','RequestTest.health_id'=>$val['Health']['id'],'RequestTest.test_id'=>$v_offer_db)));\n\t\t\t\t\tif(empty($check_offer_duplicate))\n\t\t\t\t\t{\n\t\t\t\t\t\t$find_offer_mrp = $this->Banner->find('first',array('conditions'=>array('Banner.id'=>$v_offer_db)));\n\t\t\t\t\t\t$this->data['RequestTest']['type'] = 'OF';\n\t\t\t\t\t\t$this->data['RequestTest']['health_id'] = $val['Health']['id'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_id'] = $v_offer_db; \n\t\t\t\t\t\t$this->data['RequestTest']['mrp'] =$find_offer_mrp['Banner']['banner_mrp'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_book_date'] =$val['Health']['book_date'];\n\t\t\t\t\t\t$this->data['RequestTest']['status'] = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($this->RequestTest->create($this->data))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->RequestTest->save($this->data);\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\n\t\t\tif(!empty($val['Health']['package_id']))\n\t\t\t{\n\t\t\t\t$explode_package_ids_db = explode(',',$val['Health']['package_id']);\n\t\t\t\tforeach($explode_package_ids_db as $k_package_db => $v_package_db)\n\t\t\t\t{\n\t\t\t\t\t$check_package_duplicate = $this->RequestTest->find('first',array('conditions'=>array('RequestTest.type'=>'PA','RequestTest.health_id'=>$val['Health']['id'],'RequestTest.test_id'=>$v_package_db)));\n\t\t\t\t\tif(empty($check_package_duplicate))\n\t\t\t\t\t{\n\t\t\t\t\t\t$find_package_mrp = $this->Package->find('first',array('conditions'=>array('Package.id'=>$v_package_db)));\n\t\t\t\t\t\t$this->data['RequestTest']['type'] = 'PA';\n\t\t\t\t\t\t$this->data['RequestTest']['health_id'] = $val['Health']['id'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_id'] = $v_package_db; \n\t\t\t\t\t\t$this->data['RequestTest']['mrp'] =$find_package_mrp['Package']['package_mrp'];\n\t\t\t\t\t\t$this->data['RequestTest']['test_book_date'] =$val['Health']['book_date'];\n\t\t\t\t\t\t$this->data['RequestTest']['status'] = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($this->RequestTest->create($this->data))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->RequestTest->save($this->data);\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$update_entry_status = $this->Health->query(\"UPDATE healths SET entry_status='1' WHERE id='\".$val['Health']['id'].\"'\");\n\t\t}\n\t}", "function ciniki_wineproduction_statusMaps($ciniki) {\n \n $status_maps = array(\n '10'=>'Ordered',\n '20'=>'Started',\n '25'=>'SG Ready',\n '30'=>'Racked',\n '40'=>'Filtered',\n '50'=>'Shared',\n '60'=>'Bottled',\n '100'=>'Removed',\n );\n \n return array('stat'=>'ok', 'maps'=>$status_maps);\n}", "public function getDataTemuan($id){\n // dd('jalan');\n $find_spt_id = DetailSpt::find($id);\n $data_detail = DetailSpt::where('spt_id',$find_spt_id->spt_id);\n $status_anggota = DetailSpt::where('spt_id',$find_spt_id->spt_id)->where('peran','Anggota Tim')->get(); //parameter status dari data anggota tim per spt\n $array_total = count($data_detail->get());\n // dd($data_detail->where('peran','Pengendali Mutu')->get()[0]->status['PengendaliMutu'] == 'revisi');\n\n for ($i = 0;$i <= $array_total;$i++) // ada yang kurang dalam logika, tapi hapur 50% > bisa. (updated bisa 'date:21/07/2020')\n {\n // dd($status_anggota[0]->status['PengendaliMutu'] == null && $status_anggota[0]->status['KetuaTim'] == null && $status_anggota[0]->status['PengendaliTeknis'] == null && $status_anggota[0]->status['PenanggungJawab'] == null && $status_anggota[0]->status != null);\n // switch ($status_anggota[0]->status)\n // {\n // case $status_anggota[0]->status['PengendaliMutu'] == null && $status_anggota[0]->status['KetuaTim'] == null && $status_anggota[0]->status['PengendaliTeknis'] == null && $status_anggota[0]->status['PenanggungJawab'] == null && $status_anggota[0]->status != null :\n // $query = $data_detail->where('peran','Anggota Tim')->where('user_id',auth()->user()->id);\n // break;\n // case $status_anggota[0]->status['KetuaTim'] != null && $status_anggota[0]->status['PengendaliTeknis'] == null :\n // $query = $data_detail->where('peran','Ketua Tim');\n // break;\n // case $status_anggota[0]->status['PengendaliTeknis'] != null && $status_anggota[0]->status['PengendaliMutu'] == null :\n // $query = $data_detail->where('peran','Pengendali Teknis');\n // break;\n // case $status_anggota[0]->status['PengendaliMutu'] != null && $status_anggota[0]->status['PenanggungJawab'] == null :\n // $query = $data_detail->where('peran','Pengendali Mutu');\n // break;\n // case $status_anggota[0]->status['PenanggungJawab'] != null && $status_anggota[0]->status['KetuaTim'] != null && $status_anggota[0]->status['PengendaliTeknis'] != null && $status_anggota[0]->status['PengendaliMutu'] != null :\n // $query = $data_detail->where('peran','Penanggungjawab');\n // break;\n // }\n \n // if($i==$i && $status_anggota[0]->status['PengendaliMutu'] == null && $status_anggota[0]->status['KetuaTim'] == null && $status_anggota[0]->status['PengendaliTeknis'] == null && $status_anggota[0]->status['PenanggungJawab'] == null && $status_anggota[0]->status != null){\n // // $kondisi_peran = $data_detail->where('user_id',auth()->user()->id)->get();\n // // if($kondisi_peran[0]->peran == 'Ketua Tim'){\n // $query = $data_detail->where('peran','Anggota Tim');\n // // }else{\n // // $query = $data_detail->where('peran','Anggota Tim')->where('user_id',auth()->user()->id);\n // // }\n // break;\n // }\n // elseif ($i==$i && $status_anggota[0]->status['KetuaTim'] != null && $status_anggota[0]->status['PengendaliTeknis'] == null)\n // {\n // $query = $data_detail->where('peran','Ketua Tim');\n // break;\n // }\n // elseif($i==$i && $status_anggota[0]->status['PengendaliTeknis'] != null && $status_anggota[0]->status['PengendaliMutu'] == null){\n // $query = $data_detail->where('peran','Pengendali Teknis');\n // break;\n // }\n // elseif($i==$i && $status_anggota[0]->status['PengendaliMutu'] != null && $status_anggota[0]->status['PenanggungJawab'] == null){\n // $query = $data_detail->where('peran','Pengendali Mutu');\n // break;\n // }\n // elseif($i==$i && $status_anggota[0]->status['PenanggungJawab'] != null && $status_anggota[0]->status['KetuaTim'] != null && $status_anggota[0]->status['PengendaliTeknis'] != null && $status_anggota[0]->status['PengendaliMutu'] != null){\n // $query = $data_detail->where('peran','Penanggungjawab');\n // break;\n // }\n\n if($i==$i && $status_anggota[0]->status['KetuaTim'] != null && $status_anggota[0]->status != null){ /*di acc ketua*/\n $query = $data_detail->where('peran','Anggota Tim');\n break;\n }\n elseif($i==$i && $status_anggota[0]->status['PengendaliMutu'] == null && $status_anggota[0]->status['KetuaTim'] == null && $status_anggota[0]->status['PengendaliTeknis'] == null && $status_anggota[0]->status['PenanggungJawab'] == null && $status_anggota[0]->status != null){\n $query = $data_detail->where('peran','Anggota Tim');\n break;\n }\n elseif ($i==$i && $status_anggota[0]->status['KetuaTim'] != null && $status_anggota[0]->status['PengendaliTeknis'] == null)\n {\n $query = $data_detail->where('peran','Ketua Tim');\n break;\n }\n elseif($i==$i && $status_anggota[0]->status['PengendaliTeknis'] != null && $status_anggota[0]->status['PengendaliMutu'] == null){\n $query = $data_detail->where('peran','Pengendali Teknis');\n break;\n }\n elseif($i==$i && $status_anggota[0]->status['PengendaliMutu'] != null && $status_anggota[0]->status['PenanggungJawab'] == null){\n $query = $data_detail->where('peran','Pengendali Mutu');\n break;\n }\n elseif($i==$i && $status_anggota[0]->status['PenanggungJawab'] != null && $status_anggota[0]->status['KetuaTim'] != null && $status_anggota[0]->status['PengendaliTeknis'] != null && $status_anggota[0]->status['PengendaliMutu'] != null){\n $query = $data_detail->where('peran','Penanggungjawab');\n break;\n }\n }\n\n $data = $query->get();\n // dd($data[0]->status);\n $dt = Datatables::of($data)\n ->addIndexColumn()\n ->addColumn('kode_temuan_id',function($col){\n // dd($col);\n $kode = KodeTemuan::where('id',$col->pemeriksaan[0]->kode_temuan_id)->select('id','kode','deskripsi', 'atribut')->whereRaw('JSON_EXTRACT(atribut, \"$.kelompok\") <> CAST(\"null\" AS JSON) AND JSON_EXTRACT(atribut, \"$.subkelompok\") <> CAST(\"null\" AS JSON)')->orderBy('sort_id', 'ASC')->get();\n return $kode[0]['select_supersub_kode'];\n })\n ->addColumn('nama_anggota', function($col){\n $user = User::findOrFail($col->user_id);\n return $user->full_name;\n })\n ->addColumn('judultemuan', function($col){\n // dd($col);\n return $col->pemeriksaan[0]->judultemuan;\n })\n ->addColumn('action', function($col){\n $get_value_penanggung_jawab = DetailSpt::where('spt_id',$col->spt_id);\n // dd($get_value_penanggung_jawab->where('user_id',auth()->user()->id)->get()[0]->peran == 'Anggota Tim');\n if($get_value_penanggung_jawab->where('user_id',auth()->user()->id)->get()[0]->peran == 'Anggota Tim'){\n $control = '<a href=\"'.route('laporan-cetak',$col->id).'\" data-toggle=\"tooltip\" title=\"Cetak KKA\" class=\"btn btn-outline-info btn-sm\"><i class=\"ni ni-single-copy-04\"></i></a>';\n // $control .= '<a href=\"#\" data-toggle=\"tooltip\" title=\"Cetak LHP\" class=\"btn btn btn-outline-danger btn-sm disabled\"><i class=\"ni ni-collection\"></i></a>';\n // $control .= '<a href=\"#\" onclick=\"#\" data-toggle=\"tooltip\" title=\"Ubah KKA\" class=\"btn btn btn-outline-danger btn-sm disabled\"><i class=\"ni ni-ruler-pencil\"></i></a>';\n // if ($get_value_penanggung_jawab[0]->status['PenanggungJawab'] != null) {\n }else{\n $control = '<a href=\"'.route('laporan-cetak',$col->id).'\" data-toggle=\"tooltip\" title=\"Cetak KKA\" class=\"btn btn-outline-info btn-sm\"><i class=\"ni ni-single-copy-04\"></i></a>';\n // $control .= '<a href=\"'.route('laporan-lhp-cetak',$col->id).'\" data-toggle=\"tooltip\" title=\"Cetak LHP\" class=\"btn btn btn-outline-info btn-sm\"><i class=\"ni ni-collection\"></i></a>';\n // $control .= '<a href=\"#\" onclick=\"showModalEditKKA('.$col->id.')\" data-toggle=\"tooltip\" title=\"Ubah KKA\" class=\"btn btn btn-outline-warning btn-sm\"><i class=\"ni ni-ruler-pencil\"></i></a>';\n // if ($get_value_penanggung_jawab[0]->status['PenanggungJawab'] != null) {\n // }\n // $control .= '<a href=\"#\" data-toggle=\"tooltip\" title=\"Lihat KKA Sebelumnya\" class=\"btn btn btn-outline-warning btn-sm\"><i class=\"ni ni-book-bookmark\"></i></a>'; //buttom lihat kka\n // $control .= '<a href=\"#\" onclick=\"submitComment('.$col->id.')\" data-toggle=\"tooltip\" title=\"Revisi\" class=\"btn btn btn-outline-warning btn-sm\"><i class=\"ni ni-settings\"></i></a>';\n }\n return $control;\n })\n ->make(true);\n return $dt;\n }", "public static function get_map_data($type,$activities,$status){\n $states = array(\n 'Andhra Pradesh' => 0,\n 'Arunachal Pradesh' => 0,\n 'Assam' => 0,\n 'Bihar' => 0,\n 'Chhattisgarh' => 0,\n 'Goa' => 0,\n 'Gujarat' => 0,\n 'Haryana' => 0,\n 'Himachal Pradesh' => 0,\n 'Jammu and Kashmir' => 0,\n 'Jharkhand' => 0,\n 'Karnataka' => 0,\n 'Kerala' => 0,\n 'Madhya Pradesh' => 0,\n 'Maharashtra' => 0,\n 'Manipur' => 0,\n 'Meghalaya' => 0,\n 'Mizoram' => 0,\n 'Nagaland' => 0,\n 'Odisha(Orissa)' => 0,\n 'Punjab' => 0,\n 'Rajasthan' => 0,\n 'Sikkim' => 0,\n 'Tamil Nadu' => 0,\n 'Telangana' => 0,\n 'Tripura' => 0,\n 'Uttarakhand' => 0,\n 'Uttar Pradesh' => 0,\n 'West Bengal' => 0,\n 'Andaman and Nicobar Islands' => 0,\n 'Chandigarh' => 0,\n 'Dadra and Nagar Haveli' => 0,\n 'Daman and Diu' => 0,\n 'National Capital Territory of Delhi' => 0,\n 'Puducherry (Pondicherry)' => 0\n );\n /* For separation of state name from key of $states array */\n $key = array_keys($states);\n $connection = \\Drupal::database();\n\n /* Checking the foss type */\n if($type == \"\" || $type == NULL){\n $query = $connection->select('foss_type','u')\n ->fields('u', array(\n 'tbc',\n 'foss_name',\n 'lab_migration',\n 'workshop',\n 'conference',\n '$foss_selfworkshop_no'\n ))\n ->execute();\n /* For fetching data from all foss type */\n while($foss = $query->fetchObject()){\n $name = $foss->foss_name;\n // Workshop\n if($foss->workshop){\n $query1 = $connection->select('workshop', 'w')\n ->fields('w', array('state'))\n ->condition('type','workshop')\n ->condition('foss_name',$name)\n ->execute()\n ->fetchAll();\n // Assigning to each states\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n // Conference\n if($foss->conference){\n $query1 = $connection->select('workshop', 'w')\n ->fields('w',array('state'))\n ->condition('type','conference')\n ->condition('foss_name',$name)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n\n // Text Book companion\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($foss->tbc){\n if ($name != 'Python') {\n $pending_enddate = date('Y-m-d', strtotime(\"+5 months\", strtotime( date(\"Y-m-d\"))));\n if ($name != 'eSim' && $name != 'OpenModelica' && $name != 'OpenFOAM' && $name != 'OR-Tools') {\n if ($name != 'DWSIM') {\n foreach ($key as $k) {\n /* Completed Textbook Companion */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook Companion */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook Companion */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook Companion */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook Companion */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook Companion */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n }\n else {\n /*$query5 = $connection->select('tbc_book');\n $query5->addExpression('count(*)', 'count');\n $query5->condition('approved', 1);\n $result5 = $query5->execute();\n $completedbookcount += $result5->fetchObject()->count;\n $query6 = $connection->select('tbc_book');\n $query6->addExpression('count(*)', 'count');\n $query6->condition('approved', 1, '<>');\n $result6 = $query6->execute();\n $pendingbookcount += $result6->fetchObject()->count;*/\n }\n }\n\n // Lab Migration\n if($foss->lab_migration){\n /* Completed Lab Migration */\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 3)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n /* Lab in Progress of Lab Migration */\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 1)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n /*\n // Self Workshop space\n if($foss->foss_selfworkshop_no){\n db_set_active('selfworkshop');\n foreach ($key as $k) {\n $query2 = $connection->query(\"SELECT count(t.id) as count FROM {events_training} t, {events_academiccenter} ac, {events_city} c, {events_state} s WHERE t.academic_id=ac.id and ac.city_id=c.id and c.state_id=s.id and (t.status = 4 AND t.foss_id = :foss_id ) and s.name LIKE :state \", array(\n ':foss_id' => $foss->foss_selfworkshop_no,\n ':state'=>$k\n ));\n $states[$k] += $query2->fetchObject()->count;\n }\n\n }\n */\n /* DWSIM Flowsheet */\n if($name == 'DWSIM'){\n \\Drupal\\Core\\Database\\Database::setActiveConnection('DWSIM');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('DWSIM');\n foreach ($key as $k) {\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n /* eSim Circuit Simulation */\n }else if($name == 'eSim'){\n \\Drupal\\Core\\Database\\Database::setActiveConnection('eSim');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('eSim');\n foreach ($key as $k) {\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n\n }\n $connection = \\Drupal::database();\n\n }\n }else{\n $query = $connection->select('foss_type','u')\n ->fields('u', array(\n 'tbc',\n 'foss_name',\n 'lab_migration',\n 'workshop',\n 'conference',\n 'foss_selfworkshop_no',\n 'flow_sheet',\n 'circuit_simulation',\n 'case_study'\n ))\n ->condition('id',$type)\n ->execute()\n ->fetchObject();\n $name = $query->foss_name;\n /* Converting ID to name of Activities */\n $options = FossBase::get_activities_list($type);\n for ($i=0; $i <= max(array_keys($options)) ; $i++) {\n if ($i == $activities) {\n $act = $options[$i];\n }\n }\n /* When Activities are set */\n if ($activities != 0) {\n /* Converting ID to name of Activities */\n $options = FossBase::_ajax_example_get_third_dropdown_options($activities);\n for ($i=0; $i <= max(array_keys($options)) ; $i++) {\n if ($i == $status) {\n $stat = $options[$i];\n }\n }\n /* When Status are set */\n if ($status != 0) {\n /* Book in Progress for Textbook Companion */\n if ($act == 'Textbook Companion' && $stat == 'Books in Progress') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($query->tbc){\n if ($name != 'Python') {\n $pending_enddate = date('Y-m-d', strtotime(\"+5 months\", strtotime( date(\"Y-m-d\"))));\n\n if ($name != 'eSim' && $name != 'OpenModelica' && $name != 'OpenFOAM' && $name != 'OR-Tools') {\n if ($name != 'DWSIM') {\n foreach ($key as $k) {\n /* Pending Textbook Companion */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n else {\n foreach ($key as $k) {\n /* Pending Textbook Companion */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status != 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n }\n else {\n foreach ($key as $k) {\n /* Pending Textbook Companion */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n\n }\n else {\n /*$query5 = $connection->select('tbc_book');\n $query5->addExpression('count(*)', 'count');\n $query5->condition('approved', 1);\n $result5 = $query5->execute();\n $completedbookcount += $result5->fetchObject()->count;\n $query6 = $connection->select('tbc_book');\n $query6->addExpression('count(*)', 'count');\n $query6->condition('approved', 1, '<>');\n $result6 = $query6->execute();\n $pendingbookcount += $result6->fetchObject()->count;*/\n }\n }\n /* Completed Books for Textbook Companion */\n }elseif ($act == 'Textbook Companion' && $stat == 'Completed Books') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($query->tbc){\n if ($name != 'Python') {\n $pending_enddate = date('Y-m-d', strtotime(\"+5 months\", strtotime( date(\"Y-m-d\"))));\n\n if ($name != 'eSim' && $name != 'OpenModelica' && $name != 'OpenFOAM' && $name != 'OR-Tools') {\n if ($name != 'DWSIM') {\n foreach ($key as $k) {\n /* Completed Textbook Companion */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status = 3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook Companion */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status = 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n }\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook Companion */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status = 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n }\n }\n\n }\n else {\n /*$query5 = $connection->select('tbc_book');\n $query5->addExpression('count(*)', 'count');\n $query5->condition('approved', 1);\n $result5 = $query5->execute();\n $completedbookcount += $result5->fetchObject()->count;\n $query6 = $connection->select('tbc_book');\n $query6->addExpression('count(*)', 'count');\n $query6->condition('approved', 1, '<>');\n $result6 = $query6->execute();\n $pendingbookcount += $result6->fetchObject()->count;*/\n }\n }\n /* Labs in Progress for Lab Migration */\n }elseif ($act == 'Lab Migration' && $stat == 'Labs in Progress') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($query->lab_migration){\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 1)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n /* Completed Labs for Lab Migration */\n }elseif ($act == 'Lab Migration' && $stat == 'Completed Labs') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($query->lab_migration){\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 3)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n }elseif ($act == 'Flowsheet' && $stat == 'Flowsheets in Progress') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection('DWSIM');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('DWSIM');\n foreach ($key as $k) {\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n }elseif ($act == 'Flowsheet' && $stat == 'Completed Flowsheets') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection('DWSIM');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('DWSIM');\n foreach ($key as $k) {\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n }elseif ($act == 'Circuit Simulation' && $stat == 'Simulations in Progress') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection('eSim');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('eSim');\n foreach ($key as $k) {\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n }elseif ($act == 'Circuit Simulation' && $stat == 'Completed Simulations') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection('eSim');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('eSim');\n foreach ($key as $k) {\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n }\n /* When status not set */\n }else {\n // Workshop\n if ($act == 'Workshop') {\n if($query->workshop){\n $query1 = $connection->select('workshop', 'w')\n ->fields('w', array('state'))\n ->condition('type','workshop')\n ->condition('foss_name',$name)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n // Conference\n }elseif ($act == 'Conference') {\n if($query->conference){\n $query1 = $connection->select('workshop', 'w')\n ->fields('w',array('state'))\n ->condition('type','conference')\n ->condition('foss_name',$name)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n // Textbook Companion\n }elseif ($act == 'Textbook Companion') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($query->tbc){\n\n if ($name != 'Python') {\n $pending_enddate = date('Y-m-d', strtotime(\"+5 months\", strtotime( date(\"Y-m-d\"))));\n\n if ($name != 'eSim' && $name != 'OpenModelica' && $name != 'OpenFOAM' && $name != 'OR-Tools') {\n if ($name != 'DWSIM') {\n foreach ($key as $k) {\n /* Completed Textbook */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status != 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n\n }\n else {\n /*$query5 = $connection->select('tbc_book');\n $query5->addExpression('count(*)', 'count');\n $query5->condition('approved', 1);\n $result5 = $query5->execute();\n $completedbookcount += $result5->fetchObject()->count;\n $query6 = $connection->select('tbc_book');\n $query6->addExpression('count(*)', 'count');\n $query6->condition('approved', 1, '<>');\n $result6 = $query6->execute();\n $pendingbookcount += $result6->fetchObject()->count;*/\n }\n }\n // Lab Migration\n }elseif ($act == 'Lab Migration') {\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($query->lab_migration){\n /* Completed Lab Migration */\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 3)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n /* Lab in Progress of Lab Migration */\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 1)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n }elseif ($act == \"Flowsheet\") {\n \\Drupal\\Core\\Database\\Database::setActiveConnection('DWSIM');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('DWSIM');\n foreach ($key as $k) {\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n }elseif ($act == \"Circuit Simulation\") {\n \\Drupal\\Core\\Database\\Database::setActiveConnection('eSim');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('eSim');\n foreach ($key as $k) {\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n }\n }\n }else {\n // Workshop\n if($query->workshop){\n $query1 = $connection->select('workshop', 'w')\n ->fields('w', array('state'))\n ->condition('type','workshop')\n ->condition('foss_name',$name)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n // Conference\n if($query->conference){\n $query1 = $connection->select('workshop', 'w')\n ->fields('w',array('state'))\n ->condition('type','conference')\n ->condition('foss_name',$name)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n // Text Book companion\n \\Drupal\\Core\\Database\\Database::setActiveConnection($name);\n $connection = \\Drupal\\Core\\Database\\Database::getConnection($name);\n if($query->tbc){\n\n if ($name != 'Python') {\n $pending_enddate = date('Y-m-d', strtotime(\"+5 months\", strtotime( date(\"Y-m-d\"))));\n\n if ($name != 'eSim' && $name != 'OpenModelica' && $name != 'OpenFOAM' && $name != 'OR-Tools') {\n if ($name != 'DWSIM') {\n foreach ($key as $k) {\n /* Completed Textbook */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND pe.category>0 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status != 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n }\n else {\n foreach ($key as $k) {\n /* Completed Textbook */\n $query2 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND po.state LIKE :state\", array(\n ':state' => $k,\n ));\n /* Pending Textbook */\n $query3 = $connection->query(\"SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status <> 3 AND pe.approval_status =1 AND po.state LIKE :state AND FROM_UNIXTIME(po.completion_date) <= :enddate\", array(\n ':state' => $k,\n ':enddate' => $pending_enddate\n ));\n $states[$k] += $query2->fetchObject()->book_count;\n $states[$k] += $query3->fetchObject()->book_count;\n }\n }\n\n }\n else {\n /*$query5 = $connection->select('tbc_book');\n $query5->addExpression('count(*)', 'count');\n $query5->condition('approved', 1);\n $result5 = $query5->execute();\n $completedbookcount += $result5->fetchObject()->count;\n $query6 = $connection->select('tbc_book');\n $query6->addExpression('count(*)', 'count');\n $query6->condition('approved', 1, '<>');\n $result6 = $query6->execute();\n $pendingbookcount += $result6->fetchObject()->count;*/\n }\n }\n // Lab Migration\n if($query->lab_migration){\n /* completed Lab Migration */\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 3)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n /* Lab in Progress of Lab Migration */\n $query1 = $connection->select('lab_migration_proposal','u')\n ->fields('u', array('state'))\n ->condition('approval_status', 1)\n ->execute()\n ->fetchAll();\n foreach ($query1 as $s) {\n if($s->state){\n $states[$s->state]++;\n }\n }\n }\n /*\n // Self Workshop space\n if($query->foss_selfworkshop_no){\n db_set_active('selfworkshop');\n foreach ($key as $k) {\n $query2 = $connection->query(\"SELECT count(t.id) as count FROM {events_training} t, {events_academiccenter} ac, {events_city} c, {events_state} s WHERE t.academic_id=ac.id and ac.city_id=c.id and c.state_id=s.id and (t.status = 4 AND t.foss_id = :foss_id ) and s.name LIKE :state \", array(\n ':foss_id' => $query->foss_selfworkshop_no,\n ':state'=>$k\n ));\n $states[$k] += $query2->fetchObject()->count;\n }\n\n }\n */\n /* DWSIM Flowsheet */\n if($name == 'DWSIM'){\n \\Drupal\\Core\\Database\\Database::setActiveConnection('DWSIM');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('DWSIM');\n foreach ($key as $k) {\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n $query1 = $connection->select('dwsim_flowsheet_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n /* eSim Circuit Simulation */\n }else if($name == 'eSim'){\n \\Drupal\\Core\\Database\\Database::setActiveConnection('eSim');\n $connection = \\Drupal\\Core\\Database\\Database::getConnection('eSim');\n foreach ($key as $k) {\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 3)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n $query1 = $connection->select('esim_circuit_simulation_proposal')\n ->condition('approval_status', 1)\n ->condition('state',$k)\n ->countQuery()\n ->execute()\n ->fetchField();\n $states[$k] += $query1;\n }\n\n }\n\n $connection = \\Drupal::database();\n\n }\n\n }\n $i =0;\n // Findiing Maximum and Total Value from states\n $max = max($states);\n $total = array_sum($states);\n /* Dynamic representation of data and Assigning color to each state according to it's value */\n if ($max > 100) {\n $max = $max-($max%100);\n foreach ($states as $s) {\n if($s > $max){\n $states[$key[$i]]='#ea5507';\n }else if ($s<=$max && $s>$max*(3/4)) {\n $states[$key[$i]]='#e56b2b';\n }else if ($s<=$max*(3/4) && $s>$max*(2/4)) {\n $states[$key[$i]]='#e08859';\n }else if ($s<=$max*(2/4) && $s>$max*(1/4)) {\n $states[$key[$i]]='#e29d78';\n }else if ($s<=$max*(1/4) && $s>0) {\n $states[$key[$i]]='#e0ab8f';\n }else{\n $states[$key[$i]]='#ddc6ba';\n }\n $i++;\n }\n }elseif ($max > 10) {\n $max = $max-($max%10);\n foreach ($states as $s) {\n if($s > $max){\n $states[$key[$i]]='#ea5507';\n }else if ($s<=$max && $s>$max/2) {\n $states[$key[$i]]='#e08859';\n }else if ($s<=$max/2 && $s>0) {\n $states[$key[$i]]='#e0ab8f';\n }else{\n $states[$key[$i]]='#ddc6ba';\n }\n $i++;\n }\n }else{\n foreach ($states as $s) {\n if($s > $max/2){\n $states[$key[$i]]='#ea5507';\n }else if ($s<=$max/2 && $s>0) {\n $states[$key[$i]]='#e08859';\n }else{\n $states[$key[$i]]='#ddc6ba';\n }\n $i++;\n }\n }\n // Setting the data set to generate the map with corresponding colors\n require_once('fossee_stats_map.inc');\n $out = stats_map($states,$max,$total);\n return $out;\n\n }", "public function get_status(){\r\n\t\t$sql = array('bangsal.kd_bgs', 'bangsal.nm_bgs',\r\n\t\t\t'COUNT(IF(status_tt=\"kosong\", 1, NULL)) \"Kosong\"',\r\n\t\t\t'COUNT(IF(status_tt=\"Disiapkan\", 1, NULL)) \"Disiapkan\"',\r\n\t\t\t'COUNT(IF(status_tt=\"Direncanakan\", 1, NULL)) \"Direncanakan\"',\r\n\t\t\t'COUNT(IF(status_tt=\"Diminta\", 1, NULL)) \"Diminta\"',\r\n\t\t\t'COUNT(IF(status_tt=\"Dipesan\", 1, NULL)) \"Dipesan\"',\r\n\t\t\t'COUNT(IF(status_tt=\"Disiapkan (Pesan)\", 1, NULL)) \"Disisan\"',\r\n\t\t\t'COUNT(IF(status_tt=\"Dipakai\", 1, NULL)) \"Dipakai\"',\r\n\t\t\t'COUNT(IF(status_tt=\"Rusak\", 1, NULL)) \"Rusak\"\r\n\t\t\t');\r\n\t\t$this->db->select($sql);\r\n\t\t$this->db->from('bangsal');\r\n\t\t$this->db->join('tmp_tdr', 'tmp_tdr.kd_bgs = bangsal.kd_bgs');\r\n\t\t$this->db->group_by('bangsal.kd_bgs');\r\n\t\t$result = $this->db->get();\r\n\t\treturn $result->result_array();\r\n\t}", "public function status_diterima($id)\n {\n if ($id) {\n // get data dulu\n $get_status = $this->db->get_where('pmb_akunmaba', ['id_akun' => $id])->row();\n // cek data\n if ($get_status) {\n // cek status\n if ($get_status->status_diterima == '0') {\n // jika 0, berarti belum diterima\n // lakukan update ke 1\n $diterima = $this->db->update('pmb_akunmaba', ['status_diterima' => '1'], ['id_akun' => $id]);\n if ($diterima) {\n // $response = [\n // 'status' => true,\n // 'message' => 'Peserta berhasil diterima',\n // 'title' => 'Sukses!',\n // 'type' => 'success'\n // ];\n // lakukan pengiriman SMS\n $response = $this->kirim_sms($id);\n } else {\n $response = [\n 'status' => false,\n 'message' => 'Gagal merubah status peserta',\n 'title' => 'Gagal!',\n 'type' => 'danger'\n ];\n }\n } else {\n // jika 1, berarti sudah diterima\n // lakukan update ke 0\n $dibatalkan = $this->db->update('pmb_akunmaba', ['status_diterima' => '0'], ['id_akun' => $id]);\n if ($dibatalkan) {\n $response = [\n 'status' => true,\n 'message' => 'Status diterima berhasil dibatalkan',\n 'title' => 'Sukses!',\n 'type' => 'success'\n ];\n } else {\n $response = [\n 'status' => false,\n 'message' => 'Gagal membatalkan status diterima peserta',\n 'title' => 'Gagal!',\n 'type' => 'danger'\n ];\n }\n }\n } else {\n $response = [\n 'status' => false,\n 'message' => 'Tidak ada data akun yang diterima',\n 'title' => 'Gagal!',\n 'type' => 'danger'\n ];\n }\n } else {\n $response = [\n 'status' => false,\n 'message' => 'Tidak ada ID yang diterima',\n 'title' => 'Gagal!',\n 'type' => 'danger'\n ];\n }\n\n return $response;\n }", "public function getDokumenStatusEkspedisi($data){\n $this->openFunction('ZCFIFM_DISPLAY_APPROVE');\n $this->fce->P_BUKRS = $data['P_BUKRS'];\n $this->fce->P_GJAHR = $data['P_GJAHR'];\n $this->fce->X_GET_PARK_DOC = 'X';\n $this->fce->X_GET_CLEAR_DAT = 'X';\n\n $this->fce->R_BELNR->row['SIGN'] = 'I';\n $this->fce->R_BELNR->row['OPTION'] = 'EQ';\n $this->fce->R_BELNR->row['LOW'] = $data['FI_NUMBER'];\n $this->fce->R_BELNR->Append($this->fce->R_BELNR->row);\n\n $this->fce->call();\n $i = 0;\n $itTampung = array();\n if ($this->fce->GetStatus() == SAPRFC_OK) {\n $this->fce->T_OUT->Reset();\n while ($this->fce->T_OUT->Next()) {\n $itTampung[] = $this->fce->T_OUT->row;\n }\n }\n return $itTampung;\n }", "public function statusDetail($status = null, $id = null, $kd_surat = null){\r\n\t\t$searchKode = $this->db->get_where('esurat_surat',['kd_surat' => $this->encrypt->decode($kd_surat)]);\r\n\r\n\t\tif (count($this->uri->segment_array()) > 5) {\r\n\t\t\t$this->toastr->error('Url Yang Anda Masukkan Salah');\r\n\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t}\r\n\r\n\t\tif (!isset($status) || !isset($id) || !isset($kd_surat)) {\r\n\t\t\t$this->toastr->error('Data yang Anda Inginkan Tidak Mempunyai ID');\r\n\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t}\r\n\r\n\t\tif (is_numeric($status)||is_numeric($id) || is_numeric($kd_surat)) {\r\n\t\t\t$this->toastr->error('Url Hanya Bisa Diakses Setelah Dienkripsi');\r\n\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t}\r\n\r\n\t\tif($searchKode->num_rows() == NULL){\r\n\t\t\t$this->toastr->error('Kode Surat Not Found!');\r\n\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t}\r\n\r\n\t\tif(!is_numeric($this->encrypt->decode($id))){\r\n\t\t\t$this->toastr->error('Url Yang Anda Masukkan Tidak Memmpunyai ID');\r\n\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t}\r\n\r\n\t\tif ( !in_array($this->encrypt->decode($status), ['PENDING','CONFIRM'], true ) ) {\r\n\t\t\t$this->toastr->error('Status Surat Error');\r\n\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t}\r\n\r\n\r\n\t\t$data['user'] = $this->db->get_where('esurat_mhs',['nim' => $this->session->userdata('nim')])->row();\r\n\r\n\t\t$status = $this->encrypt->decode($status);\r\n\t\t$id = $this->encrypt->decode($id);\r\n\t\t$kd_surat = $this->encrypt->decode($kd_surat);\r\n\r\n\t\t$mhs = $this->db->get_where('esurat_mhs',['nim' => $this->session->userdata('nim')])->row();\r\n\r\n\r\n\t\tif($status == 'PENDING'){\r\n\t\t\t$query = \"SELECT *, JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.kepadaYth')) as kepadaYth, JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.kepadaAlamat')) as kepadaAlamat FROM esurat_permintaan WHERE id_permintaan = '$id'\";\r\n\r\n\t\t\t$data['onedosen'] = $this->admin_model->getOneDosen($this->db->query(\"SELECT JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.penanggungJawab')) as penanggungJawab FROM esurat_permintaan WHERE id_permintaan = '$id'\")->row()->penanggungJawab);\r\n\t\t\t$data['onepro'] = $this->admin_model->getOneProdi($this->db->query(\"SELECT JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.permintaan_prodi')) as permintaan_prodi FROM esurat_permintaan WHERE id_permintaan = '$id'\")->row()->permintaan_prodi);\r\n\t\t\t$data['onemhs'] = $this->admin_model->getOneMhs($this->admin_model->getOnePmr($id)->permintaan_by);;\r\n\r\n\r\n\t\t}elseif($status == 'CONFIRM'){\r\n\r\n\t\t\t$query = \"SELECT *, JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.kepadaYth')) as kepadaYth, JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.kepadaAlamat')) as kepadaAlamat FROM esurat_konfirmasi WHERE id_konfirmasi = '$id'\";\r\n\r\n\t\t\t$data['onedosen'] = $this->admin_model->getOneDosen($this->db->query(\"SELECT JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.penanggungJawab')) as penanggungJawab FROM esurat_konfirmasi WHERE id_konfirmasi = '$id'\")->row()->penanggungJawab);\r\n\t\t\t$data['onepro'] = $this->admin_model->getOneProdi($this->db->query(\"SELECT JSON_UNQUOTE(JSON_EXTRACT(data_permintaan, '$.permintaan_prodi')) as permintaan_prodi FROM esurat_konfirmasi WHERE id_konfirmasi = '$id'\")->row()->permintaan_prodi);\r\n\t\t\t$data['onemhs'] = $this->admin_model->getOneMhs($this->admin_model->getOneKfm($id)->permintaan_by);\r\n\r\n\t\t}\r\n\r\n\t\t$result = $this->db->query($query)->row();\r\n\r\n\t\t/*-- Load One Data Surat untuk View --*/\r\n\t\t$data['onestatus'] = $result;\r\n\r\n\r\n\t\tif($status == 'PENDING'){\r\n\r\n\t\t\tif($id == $result->id_permintaan && $kd_surat == $result->kd_surat){\r\n\r\n\t\t\t\tswitch ($searchKode->row()->kd_surat) {\r\n\t\t\t\t\tcase 'SP-I-KP':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-I-KP',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'SP-D-TA':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-D-TA',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'SP-KP':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-KP',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'SP-P-TA':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-P-TA',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t$this->toastr->error('Url Yang Anda Inginkan Tidak Ada');\r\n\t\t\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$this->toastr->error('Url Yang Anda Inginkan Tidak Ada');\r\n\t\t\t\tredirect('mahasiswa/statusSurat');\r\n\r\n\t\t\t}\r\n\r\n\t\t}elseif($status == 'CONFIRM'){\r\n\r\n\t\t\tif($id == $result->id_konfirmasi && $kd_surat == $result->kd_surat){\r\n\r\n\t\t\t\tswitch ($searchKode->row()->kd_surat) {\r\n\t\t\t\t\tcase 'SP-I-KP':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-I-KP',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'SP-D-TA':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-D-TA',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'SP-KP':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-KP',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'SP-P-TA':\r\n\r\n\t\t\t\t\t$data['status'] = $status;\r\n\t\t\t\t\t$data['title'] = \" mahasiswa | Status Surat\";\r\n\t\t\t\t\t$data['parent'] = \"Status Surat\";\r\n\t\t\t\t\t$data['page'] = $searchKode->row()->kd_surat;\r\n\t\t\t\t\t$this->template->load('mahasiswa/layout/mahasiswaTemplate','surat/status/status_SP-P-TA',$data);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t$this->toastr->error('Url Yang Anda Inginkan Tidak Ada');\r\n\t\t\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$this->toastr->error('Url Yang Anda Inginkan Tidak Ada aaa');\r\n\t\t\t\tredirect('mahasiswa/statusSurat');\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->toastr->error('Surat Yang Anda Inginkan Tidak Ada');\r\n\t\t\tredirect('mahasiswa/statusSurat');\r\n\t\t}\r\n\r\n\t}", "function InitializeStatuses() {\r\n $row['type_id'] = 0;\r\n $row['item_id'] = 0;\r\n $row['en'] = \"Wishlist\";\r\n AddTranslation($row);\r\n\r\n $row['type_id'] = 0;\r\n $row['item_id'] = 1;\r\n $row['en'] = \"Reading\";\r\n AddTranslation($row);\r\n\r\n $row['type_id'] = 0;\r\n $row['item_id'] = 2;\r\n $row['en'] = \"Completed\";\r\n AddTranslation($row);\r\n\r\n $row['type_id'] = 0;\r\n $row['item_id'] = 3;\r\n $row['en'] = \"On Hold\";\r\n AddTranslation($row);\r\n\r\n $row['type_id'] = 0;\r\n $row['item_id'] = 4;\r\n $row['en'] = \"Dropped\";\r\n AddTranslation($row);\r\n}", "public function performStatusesLookup()\n {\n return $this->performRequest(self::API_FETCH_URL . 'statuses/lookup.json');\n }", "private function status_off($data) {\n $id = I(\"request.id/d\");\n if(!$id) {\n $this->ajaxResult(\"仓库信息参数不存在\");\n }\n $search = M('warehouse')->find($id);\n if(!$search)\n $this->ajaxResult(\"仓库信息不存在\");\n if($search['status']=='7'){\n $this->ajaxResult(\"仓库信息已取消\");\n }\n if($search['status']!='1'){\n $this->ajaxResult(\"仓库信息状态已变化,请重新处理\");\n }\n $data[\"search\"] = $search;\n $data[\"id\"] = $data[\"search\"][\"id\"];\n foreach($data as $key=>$val) {\n $this->assign($key, $val);\n }\n $html = $this->fetch(\"Warehouse:status_off\");\n echo $html;\n }", "public function optional_franchises_status() {\n\t\t$id = $this->uri->segment(4);\n\t\t$status = $this->uri->segment(5);\n\n\t\tCheckAdminLoginSession();\t\t\n\t\t$data['status'] = $status;\n\t\t$data['modified_date'] = date('Y-m-d H:i:s');\t\t\t\t \t \t\t \n\n\t\t$this->admin_model->setUpdateData($this->optional_franchises,$data,$id);\n\t\t$this->session->set_flashdata('message','Your status has been update successfully');\n\t\tredirect('admin/vehicle/optional-franchise','refresh');\t\t\t\n\t}", "public function lookup_application_status() {\n\n return $this->get_lookup_table(\"APPLICATION_STATUS_LU\");\n\n }", "public function getLookupUsulanSkpd(){\n\t\t$resultCount \t= $this->m_transaksirenja->countGridLookupUsulanSkpd();\n\t\t$count \t\t\t= $resultCount->num_rows();\n\n\t\tforeach ($resultCount->result() as $key => $value) {\n\t\t\t$data['data'][]=array(\n\t\t\t\t'id' \t\t\t\t=> $value->id,\n\t\t\t\t'kode_musrenbang'\t=> $value->kode_musrenbang,\n\t\t\t\t'kegiatan' \t\t\t=> $value->kegiatan,\n\t\t\t\t'penerimaan_lain'\t=> $value->penerimaan_lain,\n\t\t\t\t'rsud'\t\t\t\t=> $value->rsud,\n\t\t\t\t'kapitasi'\t\t\t=> $value->kapitasi,\n\t\t\t\t'bangub'\t\t\t=> $value->bangub,\n\t\t\t\t'sektoral_apbd'\t\t=> $value->sektoral_apbd,\n\t\t\t\t'dak'\t\t\t\t=> $value->dak,\n\t\t\t\t'dbhcht'\t\t\t=> $value->dbhcht,\n\t\t\t\t'did'\t\t\t\t=> $value->did,\n\t\t\t\t'tp'\t\t\t\t=> $value->tp,\n\t\t\t\t'dekonsentrasi'\t\t=> $value->dekonsentrasi,\n\t\t\t\t'sektoral_apbn'\t\t=> $value->sektoral_apbn\n\t\t\t);\n\t\t}\n\n\t\t$data['total'] \t\t= $count;\n\t\t$data['success']\t= true;\n\t\techo json_encode($data);\n\t}", "public function batalkan_barang(){\n\n $id_detail = $this->input->get('id_detail');\n $status = $this->input->get('status');\n\n $this->user_pengajuan_model->batalkan_barang($id_detail,$status);\n if($status==0){\n echo $this->session->set_flashdata('message', '<div class=\"alert alert-info\"><b><a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a> \n Berhasil dikirimkan! \n </b></div>');\n }elseif($status==1){\n echo $this->session->set_flashdata('message', '<div class=\"alert alert-info\"><b><a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a> \n Berhasil dibatalkan! \n </b></div>');\n }\n redirect('daftar-permintaan-barang-non-dagang');\n }", "function fn_2lm_bm_transaction_status_info($key = '')\r\n{\r\n $statuses = [\r\n 'PENDING' => __('2lm_bm_transaction_status_pending'),\r\n 'SUCCESS' => __('2lm_bm_transaction_status_success'), // Serwis Partnera otrzyma środki za transakcje - można wydać towar/usługę\r\n 'FAILURE' => __('2lm_bm_transaction_status_failure'),\r\n ];\r\n\r\n return (!empty($key) && array_key_exists($key, $statuses)) ? $statuses[$key] : null;\r\n}", "public function bldstatus()\n\t\t\t\t{ \t\n\t\t\t\t\t$data = array();\n\t\t\t\t\t$data['refresh']\t=\t0;\t\n\t\t\t\t\t\n\t\t\t\t\t$statusid\t=\t$this->checkpostinput('statusid');\n\t\t\t\t\t$bldid\t\t=\t$this->checkpostinput('bldid');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data['status']\t\t=\t1;\n\t\t\t\t\t\n\t\t\t\t\t\tif($statusid == 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->db->where('bldid',$bldid);\n\t\t\t\t\t\t\t\t\t$id=$this->db->update('buildings', array('status'=>'0'));\n\t\t\t\t\t\t\t\t\t$data['message']\t=\t'Status update successfully';\n\t\t\t\t\t\t\t\t\t$data['refresh']\t=\t1;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->db->where('bldid',$bldid);\n\t\t\t\t\t\t\t\t\t$id=$this->db->update('buildings', array('status'=>'1'));\n\t\t\t\t\t\t\t\t\t$data['message']\t=\t'Status update successfully';\n\t\t\t\t\t\t\t\t\t$data['refresh']\t=\t1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\treturn json_encode($data);\n\t\t\t\t}", "abstract public function get_status();", "public function detail_anggaran_waktu($id_agr) {\n $get_akun = $this->login_model->get_user($this->session->userdata('username'), $this->session->userdata('lvl'));\n $kt = $this->login_model->get_pegawai($this->session->userdata('username'));\n\n $key = base64_decode($id_agr);\n\n //-> update notif penugasan\n $this->notifikasi_m->update_notif_ketua($key);\n\n $data_agr = $this->anggaran_waktu_m->get_row_anggaran_waktu($key);\n\n //--> tgl persiapan, pelaksanaan, dan penyelesaian\n $tgl1_persiapan = date('d', strtotime($data_agr->tgl1_persiapan)) . \" \" .\n get_nama_bulan(date('m', strtotime($data_agr->tgl1_persiapan))) . \" \" .\n date('Y', strtotime($data_agr->tgl1_persiapan));\n $tgl2_persiapan = date('d', strtotime($data_agr->tgl2_persiapan)) . \" \" .\n get_nama_bulan(date('m', strtotime($data_agr->tgl2_persiapan))) . \" \" .\n date('Y', strtotime($data_agr->tgl2_persiapan));\n\n $tgl1_pelaksanaan = date('d', strtotime($data_agr->tgl1_pelaksanaan)) . \" \" .\n get_nama_bulan(date('m', strtotime($data_agr->tgl1_pelaksanaan))) . \" \" .\n date('Y', strtotime($data_agr->tgl1_pelaksanaan));\n $tgl2_pelaksanaan = date('d', strtotime($data_agr->tgl2_pelaksanaan)) . \" \" .\n get_nama_bulan(date('m', strtotime($data_agr->tgl2_pelaksanaan))) . \" \" .\n date('Y', strtotime($data_agr->tgl2_pelaksanaan));\n\n $tgl1_penyelesaian = date('d', strtotime($data_agr->tgl1_penyelesaian)) . \" \" .\n get_nama_bulan(date('m', strtotime($data_agr->tgl1_penyelesaian))) . \" \" .\n date('Y', strtotime($data_agr->tgl1_penyelesaian));\n $tgl2_penyelesaian = date('d', strtotime($data_agr->tgl2_penyelesaian)) . \" \" .\n get_nama_bulan(date('m', strtotime($data_agr->tgl2_penyelesaian))) . \" \" .\n date('Y', strtotime($data_agr->tgl2_penyelesaian));\n\n $data = array(\n 'user' => $get_akun,\n 'level' => $get_akun,\n 'jml_notif' => $this->notifikasi_m->jml_notif_ketua($kt->id_pegawai),\n 'notif' => $this->notifikasi_m->notif_ketua($kt->id_pegawai),\n 'jml_notifAgr' => $this->notifikasi_m->jml_notif_ketuaAgr($kt->id_pegawai),\n 'notifAgr' => $this->notifikasi_m->notif_ketuaAgr($kt->id_pegawai),\n 'jml_notifPka' => $this->notifikasi_m->jml_notif_ketuaPka($kt->id_pegawai),\n 'notifPka' => $this->notifikasi_m->notif_ketuaPka($kt->id_pegawai),\n 'title' => 'Anggaran Waktu [KETUA TIM]',\n 'data' => $data_agr,\n 'anggaran' => $this->anggaran_waktu_m->get_sub_anggaran_waktu($key),\n 'tgl1_1' => $tgl1_persiapan,\n 'tgl2_1' => $tgl2_persiapan,\n 'tgl1_2' => $tgl1_pelaksanaan,\n 'tgl2_2' => $tgl2_pelaksanaan,\n 'tgl1_3' => $tgl1_penyelesaian,\n 'tgl2_3' => $tgl2_penyelesaian,\n 'cek_rev' => $this->anggaran_waktu_m->cek_reviu($key),\n 'data_rev' => $this->anggaran_waktu_m->get_rev_anggaran_waktu($key)\n );\n\n $this->load->view('ketua_tim/anggaran_waktu/detail_anggaran_waktu', $data);\n }", "function setSudah($data){\r\n\t\t$id = $data['id_status'];\r\n\t\t// query update data dari tb_to_do lalu set atribut status sebagai 'Sudah' dengan id yang telah ditentukan\r\n\t\t$query = \"UPDATE tb_to_do SET status='Sudah' WHERE id='$id'\";\r\n\r\n\t\t// Mengeksekusi query\r\n\t\treturn $this->execute($query);\r\n\t}" ]
[ "0.6074482", "0.5908872", "0.59016687", "0.58933735", "0.58933735", "0.5712025", "0.55697", "0.5567585", "0.55485207", "0.55472416", "0.5541031", "0.55260116", "0.5508548", "0.54852855", "0.5479879", "0.5475976", "0.54709816", "0.5469498", "0.5412298", "0.54121786", "0.5388767", "0.5384636", "0.5378612", "0.53661346", "0.5360974", "0.5335288", "0.53352386", "0.53332454", "0.532367", "0.5306482" ]
0.6543454
0
Delete sync_email_body_after_email_synchronize process definition
protected function deleteBodySyncProcess(Schema $schema, QueryBag $queries) { if ($schema->hasTable('oro_process_definition')) { $queries->addQuery( new ParametrizedSqlMigrationQuery( 'DELETE FROM oro_process_definition WHERE name = :processName', ['processName' => 'sync_email_body_after_email_synchronize'] ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wf_rtc_deactivate()\n{\n\tglobal $wpdb;\n\t\n\t// Deletes all hashes, so if option wf_commenthash_string get compromised, new hashes will be created.\n\t$wpdb->query(\"DELETE FROM \" . $wpdb->prefix . \"commentmeta WHERE meta_key='wf_commenthash'\");\n\t\n\t// Delete WP Cron Event\n\twp_clear_scheduled_hook('wf_rtc_checkmail');\n\t\n}", "public function beforeTokenEmail()\n { \n if($this->get('bEnabled'))\n {\n $body = $this->event->get(\"body\");\n $survey = $this->event->get(\"survey\");\n $token = $this->event->get('token');\n $secret = $this->get('sSecret');\n $linkText = $this->get('sConfirmButton');\n $hash = $this->createHash($token['firstname'], $token['lastname'], $token['email'], $token['token'],$survey, $secret );\n $removeUrl = $this->createUrl('confirm', $survey, $token['token'], $hash); \n $newBody = str_replace(\"@@@TOKENREMOVE@@@\", $removeUrl, $body);\n $newBody = str_replace(\"@@TOKENREMOVE@@\", '<a href=\"' . $removeUrl . '\">'.$linkText.'</a>', $newBody);\n $this->event->set(\"body\", $newBody);\n }\n }", "public function cleanUpSentEmails()\n {\n SproutEmail::$app->sentEmails->cleanUpSentEmails();\n }", "function email_delete(){\n \n imap_delete($this->link, $this->msgid); \n\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 syncDynamicEmails() {\n global $DB;\n\n $userUpdated = false;\n\n // input[\"_emails\"] not set when update from user.form or preference\n if (isset($this->fields[\"authtype\"])\n && isset($this->input[\"_emails\"])\n && (($this->fields[\"authtype\"] == Auth::LDAP)\n || Auth::isAlternateAuth($this->fields['authtype'])\n || ($this->fields[\"authtype\"] == Auth::MAIL))) {\n\n if (isset($this->fields[\"id\"]) && ($this->fields[\"id\"] > 0)) {\n $authtype = Auth::getMethodsByID($this->fields[\"authtype\"], $this->fields[\"auths_id\"]);\n\n if (count($authtype)\n || $this->fields[\"authtype\"] == Auth::EXTERNAL) {\n // Clean emails\n // Do a case insensitive comparison as it seems that some LDAP servers\n // may return same email with different case sensitivity.\n $unique_emails = [];\n foreach ($this->input[\"_emails\"] as $email) {\n if (!in_array(strtolower($email), array_map('strtolower', $unique_emails))) {\n $unique_emails[] = $email;\n }\n }\n $this->input[\"_emails\"] = $unique_emails;\n\n // Delete not available groups like to LDAP\n $iterator = $DB->request([\n 'SELECT' => [\n 'id',\n 'users_id',\n 'email',\n 'is_dynamic'\n ],\n 'FROM' => 'glpi_useremails',\n 'WHERE' => ['users_id' => $this->fields['id']]\n ]);\n\n $useremail = new UserEmail();\n while ($data = $iterator->next()) {\n // Do a case insensitive comparison as email may be stored with a different case\n $i = array_search(strtolower($data[\"email\"]), array_map('strtolower', $this->input[\"_emails\"]));\n if ($i !== false) {\n // Delete found item in order not to add it again\n unset($this->input[\"_emails\"][$i]);\n } else if ($data['is_dynamic']) {\n // Delete not found email\n $deleted = $useremail->delete(['id' => $data[\"id\"]]);\n $userUpdated = $userUpdated || $deleted;\n }\n }\n\n //If the email need to be added\n if (count($this->input[\"_emails\"]) > 0) {\n foreach ($this->input[\"_emails\"] as $email) {\n $added = $useremail->add(['users_id' => $this->fields[\"id\"],\n 'email' => $email,\n 'is_dynamic' => 1]);\n $userUpdated = $userUpdated || $added;\n }\n unset ($this->input[\"_emails\"]);\n }\n }\n }\n }\n\n if ($userUpdated) {\n // calling $this->update() here leads to loss in $this->input\n $user = new User();\n $user->update(['id' => $this->fields['id'], 'date_mod' => $_SESSION['glpi_currenttime']]);\n }\n }", "function DropScheduledMail($address, $body) {\n $list = null; // array for messages list\n $command = $this->GetText('SCHEDDROP',true);\n $retval = $body.\"\\r\\n\\r\\n\".$this->GetText('SCHEDULED DROP RESULT',true);\n\n if($this->debug) {\n return $retval.\" [\".$this->GetText('DONE',true).\"]\\r\\n\";\n }\n $bodytest = trim($body,\"\\n\\r ,.<>\");\n $bodytest = trim(substr($body,strlen($command)+1),\"\\n\\r ,.<>\");\n $query = \"delete from $this->messages where state = 'queued' and id = $bodytest\";\n mysql_query($query,$this->dbconn);\n if(mysql_affected_rows($this->dbconn) <= 0) {\n return $retval.\"\\r\\n\\r\\n\".$this->GetText('GENERIC ERROR',true);\n }\n $query = \"delete from $this->queue where messageid = $bodytest\";\n mysql_query($query,$this->dbconn);\n if(mysql_affected_rows($this->dbconn) <= 0) {\n return $retval.\"\\r\\n\\r\\n\".$this->GetText('GENERIC ERROR',true);\n }\n return $retval.\" [\".$this->GetText('DONE',true).\"]\\r\\n\";\n }", "public function process_slp_clear_schedule_messages() {\n\t $messages = SLP_Message_Manager::get_instance( array( 'slug' => 'schedule' ) );\n\t $messages->clear_messages();\n\t die( 'ok' );\n }", "protected function saveTaskContent()\n {\n\n // Validate Body\n if (empty($this->row['body'])) {\n throw new Exception_ValidationError('Email Message Required');\n }\n\n if (!empty($this->row['body']) || !empty($this->row['doc_id'])) {\n $query = $this->db->prepare(sprintf(\n \"INSERT INTO `%s` SET \"\n . \" `task_id` = :task_id, \"\n . \" `subject` = :subject, \"\n . \" `body` = :body, \"\n . \" `doc_id` = :doc_id \"\n . \" ON DUPLICATE KEY UPDATE \"\n . \" `subject` = :subject, \"\n . \" `body` = :body, \"\n . \" `doc_id` = :doc_id \"\n . \";\",\n $this->settings->TABLES['LM_TASK_EMAILS']\n ));\n $query->execute(array('task_id' => $this->id, 'subject' => $this->row['subject'], 'body' => $this->row['body'], 'doc_id' => $this->row['doc_id']));\n }\n }", "function finish()\r\n\t{\r\n\t\t$this->bodyText = null;\r\n\t}", "public function removeAcceptedDateFromForms() {\n foreach (CF7::getInstance()->getForms() as $formId) {\n $output = get_post_meta($formId, '_mail', true);\n $pattern = '/(\\n\\n\\[wpgdprc\\])/';\n preg_match($pattern, $output['body'], $matches);\n if (!empty($matches)) {\n $output['body'] = preg_replace($pattern, '', $output['body']);\n update_post_meta($formId, '_mail', $output);\n }\n }\n }", "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 reset_email()\n\t{\n\t}", "public function onAfterWrite()\n {\n parent::onAfterWrite();\n $config = $this->owner->config();\n $defaults = Defaults::config();\n\n if ($defaults->send_sales_orders_to_unleashed\n && $this->owner->Status == 'Paid'\n && !$this->owner->OrderSentToUnleashed) {\n // Definitions\n $order = $this->owner;\n $member = $order->Member();\n $date_paid = new DateTime($order->Paid);\n $date_placed = new DateTime($order->Placed);\n $body = [\n 'Addresses' => [],\n 'Currency' => [],\n 'Customer' => [],\n 'DiscountRate' => 0,\n 'Guid' => $order->Guid,\n 'OrderDate' => $date_placed->format('Y-m-d\\TH:i:s'),\n 'OrderNumber' => $order->Reference,\n 'OrderStatus' => $defaults->order_status,\n 'PaymentDueDate' => $date_paid->format('Y-m-d\\TH:i:s'),\n 'PaymentTerm' => $defaults->payment_term,\n 'PrintPackingSlipInsteadOfInvoice' => $defaults->print_packingslip_instead_of_invoice,\n 'ReceivedDate' => $date_placed->format('Y-m-d\\TH:i:s'),\n 'SalesOrderLines' => [],\n 'SellPriceTier' => ShopConfigExtension::current()->CustomerGroup()->Title,\n 'Taxable' => false,\n 'Tax' => [],\n 'Total' => round(floatval($order->Total()), $config->rounding_precision),\n ];\n\n $body = $this->setBodyAddress($body, $order, 'Postal');\n $body = $this->setBodyAddress($body, $order, 'Physical');\n $body = $this->setBodyCurrencyCode($body, $order);\n $body = $this->setBodyCustomerCodeAndName($body, $order);\n $body = $this->setBodyDeliveryMethodAndDeliveryName($body, $order, $defaults->shipping_modifier_class_name);\n $body = $this->setBodyTaxCode($body, $order, $defaults->tax_modifier_class_name);\n $body = $this->setBodySalesOrderLines($body, $order, $defaults->tax_modifier_class_name, $config->rounding_precision);\n $body = $this->setBodySubTotalAndTax($body, $order, $defaults->tax_modifier_class_name, $config->rounding_precision);\n\n // Add optional defaults\n if ($defaults->created_by) {\n $body['CreatedBy'] = $defaults->created_by;\n }\n\n if ($defaults->customer_type) {\n $body['CustomerType'] = $defaults->customer_type;\n }\n\n if ($defaults->sales_order_group) {\n $body['SalesOrderGroup'] = $defaults->sales_order_group;\n }\n\n if ($defaults->source_id) {\n $body['SourceId'] = $defaults->source_id;\n }\n\n // add phone number if available\n if ($order->BillingAddress()->Phone) {\n $body['PhoneNumber'] = $order->BillingAddress()->Phone;\n }\n\n // add required date\n $date_required = new DateTime($order->Paid);\n if ($defaults->expected_days_to_deliver) {\n $date_required->modify('+' . $defaults->expected_days_to_deliver . 'day');\n }\n $body['RequiredDate'] = $date_required->format('Y-m-d\\TH:i:s');\n\n if ($order->Notes) {\n $body['Comments'] = $order->Notes;\n }\n\n // Create Member for Guests\n if (!$member->exists()) {\n $member = Member::create();\n $member->FirstName = $order->FirstName;\n $member->Surname = $order->Surname;\n $member->Email = $order->getLatestEmail();\n }\n\n // See if New Customer/Guest has previously purchased\n if (!$member->Guid) {\n $response = UnleashedAPI::sendCall(\n 'GET',\n 'https://api.unleashedsoftware.com/Customers?contactEmail=' . $member->Email\n );\n\n if ($response->getStatusCode() == '200') {\n $contents = json_decode($response->getBody()->getContents(), true);\n $items = $contents['Items'];\n if ($items) {\n // Email address exists\n $member->Guid = $items[0]['Guid'];\n } else {\n // A Customer is not returned, we have a unique email address.\n // Check to see if the Customer Code exists (note that the Customer Code cannot be doubled up)\n $response = UnleashedAPI::sendCall(\n 'GET',\n 'https://api.unleashedsoftware.com/Customers?customerCode=' . $body['CustomerCode']\n );\n\n if ($response->getStatusCode() == '200') {\n $contents = json_decode($response->getBody()->getContents(), true);\n $items = $contents['Items'];\n if ($items) {\n // A Customer Code already exists (and the email address is unique).\n // If the address is the same then this is the Customer\n if ($this->matchCustomerAddress($items, $order->ShippingAddress())) {\n $member->Guid = $items[0]['Guid'];\n\n //Note the existing email address in the Comment\n //PUT Customer is not available in Unleashed\n if ($body['Comments']) {\n $body['Comments'] .= PHP_EOL;\n }\n $body['Comments'] .= _t(\n 'UnleashedAPI.addEmailToCustomerComment',\n 'Add email to Customer: {email_address}',\n '',\n ['email_address' => $member->Email]\n );\n } else {\n // The Customer Code already exists, we have a unique email address, but\n // the delivery address is new.\n // Therefore, we need to create a new Customer with a unique Customer Code.\n $body['CustomerCode'] .= rand(10000000, 99999999);\n }\n }\n }\n }\n }\n }\n\n if (!$member->Guid) {\n // The Customer Code does not exists in Unleashed and the email address is unique\n // therefore create in Unleashed\n $member->Guid = (string) Utils::createGuid();\n $body_member = [\n 'Addresses' => $body['Addresses'],\n 'ContactFirstName' => $member->FirstName,\n 'ContactLastName' => $member->Surname,\n 'CreatedBy' => $body['CreatedBy'],\n 'Currency' => $body['Currency'],\n 'CustomerCode' => $body['CustomerCode'],\n 'CustomerName' => $body['CustomerName'],\n 'CustomerType' => $body['CustomerType'],\n 'Email' => $member->Email,\n 'Guid' => $member->Guid,\n 'PaymentTerm' => $body['PaymentTerm'],\n 'PhoneNumber' => $body['PhoneNumber'],\n 'PrintPackingSlipInsteadOfInvoice' => $body['PrintPackingSlipInsteadOfInvoice'],\n 'SellPriceTier' => $body['SellPriceTier'],\n 'SourceId' => $body['SourceId'],\n 'Taxable' => $body['Taxable'],\n 'TaxCode' => $body['Tax']['TaxCode']\n ];\n\n foreach ($body_member['Addresses'] as $index => $value) {\n $body_member['Addresses'][$index]['IsDefault'] = true;\n }\n\n $response = UnleashedAPI::sendCall(\n 'POST',\n 'https://api.unleashedsoftware.com/Customers/' . $member->Guid,\n ['json' => $body_member ]\n );\n\n if ($response->getReasonPhrase() == 'Created' && $order->Member()->exists()) {\n $member->write();\n }\n }\n\n // Prepare Sales Order data\n // Skip if previous calls to Customer have failed and the Guid has not been set\n if ($member->Guid) {\n $body['Customer']['Guid'] = $member->Guid;\n\n $this->owner->extend('updateUnleashedSalesOrder', $body);\n\n $response = UnleashedAPI::sendCall(\n 'POST',\n 'https://api.unleashedsoftware.com/SalesOrders/' . $order->Guid,\n ['json' => $body]\n );\n if ($response->getReasonPhrase() == 'Created') {\n $this->owner->OrderSentToUnleashed = DBDatetime::now()->Rfc2822();\n $this->owner->write();\n }\n }\n }\n }", "public function DeleteEmailMessage() {\n\t\t\t$this->objEmailMessage->Delete();\n\t\t}", "private static function clearEmails(): void {\n self::$mailCatcher->delete('/messages');\n }", "function AfterEdit(&$values, $where, &$oldvalues, &$keys, $inline, &$pageObject)\n{\n\n\t\tif($values[\"attachment\"]){\n\n\t$parts = explode('\"', $values[\"attachment\"]);\n\n\t$length = count($parts);\n\n\tforeach ($parts as $part) {\n\t if (strpos($part, 'files\\/') !== false) {\n\t\t\t $attach = str_replace(\"\\/\",\"/\",$part);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nif($oldvalues['loop_type'] == '1' && $oldvalues['repeat'] != '0' && ($values['repeat'] != $oldvalues['repeat'] || $values['repeat_type'] != $oldvalues['repeat_type'] || $values['loop_value'] != $oldvalues['loop_value'])){\n\n\t$datax = array();\n\t$datax[\"member_agenda_id\"] = $values['member_agenda_id'];\n\tDB::Delete(\"outbox_line\", $datax );\n\tDB::Delete(\"outbox_mail_alibaba\", $datax );\n\tDB::Delete(\"outbox_mail_aws\", $datax );\n\tDB::Delete(\"outbox_mail_mailchimp\", $datax );\n\tDB::Delete(\"outbox_telegram\", $datax );\n\tDB::Delete(\"outbox_whatsapp\", $datax );\n\n\n\t$repeat = $values[\"repeat\"];\n\n\tif($repeat == 0 || $repeat == null)\n\t{\n\t\t$tgl = $values[\"loop_value\"];\n\t\t$data1[\"tgl\"] = $tgl;\n\t\t$rs1 = DB::Query(\"select chat_id from personal_channel\n\t\twhere member_id = '$values[member_id]' AND channel_id = 1\");\n\t\t$dataChannelTele=$rs1->fetchAssoc();\n\t\tif($dataChannelTele)\n\t\t{\n\t\t $data1[\"chat_id\"] = $dataChannelTele[\"chat_id\"];\n\t\t DB::Insert(\"outbox_telegram\", $data1 );\n\t\t}\n\n\t\t$rs2 = DB::Query(\"select chat_id from personal_channel\n\t\twhere member_id = '$values[member_id]' AND channel_id = 2\");\n\t\t$dataChannelAws=$rs2->fetchAssoc();\n\t\tif($dataChannelAws)\n\t\t{\n\t\t $data1[\"chat_id\"] = $dataChannelAws[\"chat_id\"];\n\t\t DB::Insert(\"outbox_mail_aws\", $data1 );\n\t\t DB::Insert(\"outbox_mail_alibaba\", $data1 );\n\t\t DB::Insert(\"outbox_mail_mailchimp\", $data1 );\n\t\t}\n\n\t\t$rs3 = DB::Query(\"select chat_id from personal_channel\n\t\twhere member_id = '$values[member_id]' AND channel_id = 3\");\n\t\t$dataChannelWa=$rs3->fetchAssoc();\n\t\tif($dataChannelWa)\n\t\t{\n\t\t $data1[\"chat_id\"] = $dataChannelWa[\"chat_id\"];\n\t\t DB::Insert(\"outbox_whatsapp\", $data1 );\n\t\t}\n\n\t\t$rs4 = DB::Query(\"select chat_id from personal_channel\n\t\twhere member_id = '$values[member_id]' AND channel_id = 4\");\n\t\t$dataChannelLine=$rs4->fetchAssoc();\n\t\tif($dataChannelLine)\n\t\t{\n\t\t $data1[\"chat_id\"] = $dataChannelLine[\"chat_id\"];\n\t\t DB::Insert(\"outbox_line\", $data1 );\n\t\t}\n\t}\n\telse\n\t{\n\t\t$i = 0;\n\t\t$data2 = array();\n\t\t//$data1[\"chat_id\"] = $dataChannelTele[\"chat_id\"];\n\t\t$id = $values[\"member_id\"];\n\t\t$data2[\"out_msg\"] = $values[\"message_content\"];\n\t\t$data2[\"type\"] = \"msg\";\n\t\t$data2[\"flag\"] = 1;\n\t\t$tgl = $values[\"loop_value\"];\n\t\t$data2[\"tgl\"] = $tgl;\n\t\t$data2[\"member_agenda_id\"] = $values['member_agenda_id'];\n\t\t$data2[\"member_id\"] = $values['member_id'];\n\n\t\t$data21[\"out_msg\"] = $attach;\n\t\t$data21[\"type\"] = \"file\";\n\t\t$data21[\"flag\"] = 1;\n\t\t$data21[\"tgl\"] = $tgl;\n\t\t$data21[\"member_agenda_id\"] = $values['member_agenda_id'];\n\t\t$data21[\"member_id\"] = $values['member_id'];\n\t\twhile($i <= $repeat)\n\t\t{\n\t\t\t$rep = $values[\"repeat_type\"];\n\t\t\tif($rep == \"bydate\")\n\t\t\t{\n\t\t\t\tif($i == 0)\n\t\t\t\t{\n\t\t\t\t\t$data2[\"tgl\"] = $tgl;\n\t\t\t\t\t$data21[\"tgl\"] = $tgl;\n\t\t\t\t\t$rs1 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\t\twhere member_id = '$values[member_id]' AND channel_id = 1\");\n\t\t\t\t\t$dataChannelTele=$rs1->fetchAssoc();\n\t\t\t\t\tif($dataChannelTele)\n\t\t\t\t\t{\n\t\t\t\t\t $data2[\"chat_id\"] = $dataChannelTele[\"chat_id\"];\n\t\t\t\t\t $data21[\"chat_id\"] = $dataChannelTele[\"chat_id\"];\n\t\t\t\t\t DB::Insert(\"outbox_telegram\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_telegram\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$rs2 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\t\twhere member_id = '$values[member_id]' AND channel_id = 2\");\n\t\t\t\t\t$dataChannelAws=$rs2->fetchAssoc();\n\t\t\t\t\tif($dataChannelAws)\n\t\t\t\t\t{\n\t\t\t\t\t $data2[\"chat_id\"] = $dataChannelAws[\"chat_id\"];\n\t\t\t\t\t $data21[\"chat_id\"] = $dataChannelAws[\"chat_id\"];\n\t\t\t\t\t DB::Insert(\"outbox_mail_aws\", $data2 );\n\t\t\t\t\t DB::Insert(\"outbox_mail_alibaba\", $data2 );\n\t\t\t\t\t DB::Insert(\"outbox_mail_mailchimp\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_mail_aws\", $data21 );\n\t\t\t\t\t\t\tDB::Insert(\"outbox_mail_alibaba\", $data21 );\n\t\t\t\t\t\t\tDB::Insert(\"outbox_mail_mailchimp\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$rs3 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\t\twhere member_id = '$values[member_id]' AND channel_id = 3\");\n\t\t\t\t\t$dataChannelWa=$rs3->fetchAssoc();\n\t\t\t\t\tif($dataChannelWa)\n\t\t\t\t\t{\n\t\t\t\t\t $data2[\"chat_id\"] = $dataChannelWa[\"chat_id\"];\n\t\t\t\t\t $data21[\"chat_id\"] = $dataChannelWa[\"chat_id\"];\n\t\t\t\t\t DB::Insert(\"outbox_whatsapp\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_whatsapp\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$rs4 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\t\twhere member_id = '$values[member_id]' AND channel_id = 4\");\n\t\t\t\t\t$dataChannelLine=$rs4->fetchAssoc();\n\t\t\t\t\tif($dataChannelLine)\n\t\t\t\t\t{\n\t\t\t\t\t $data2[\"chat_id\"] = $dataChannelLine[\"chat_id\"];\n\t\t\t\t\t $data21[\"chat_id\"] = $dataChannelLine[\"chat_id\"];\n\t\t\t\t\t DB::Insert(\"outbox_line\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_line\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$data2[\"member_agenda_id\"] = $idm;\n\t\t\t\t\t//$data2[\"dodate\"] = now();\n\t\t\t\t\t//DB::Insert(\"personal_agenda_repeat_date\", $data2 );\n\t\t\t\t}\n\t\t }\n\t\t else\n\t\t\t{\n\t\t\t\tif($i == 0)\n\t\t\t\t{\n\t\t\t\t\t$data2[\"tgl\"] = $tgl;\n\t\t\t\t\t$data21[\"tgl\"] = $tgl;\n\t\t\t\t}else if($i > 0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($values[\"repeat_type\"] == \"daily\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$tgl2 = $data2[\"tgl\"];\n\t\t\t\t\t\t$tgl3 = date('Y-m-d H:i:s', strtotime($tgl2 . ' +1 day' ));\n\t\t\t\t\t\t$data2[\"tgl\"] = $tgl3;\n\t\t\t\t\t\t$data21[\"tgl\"] = $tgl3;\n\t\t\t\t\t}else if($rep == \"weekly\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$tgl2 = $data2[\"tgl\"];\n\t\t\t\t\t\t$tgl3 = date('Y-m-d H:i:s', strtotime($tgl2 . ' +1 week' ));\n\t\t\t\t\t\t$data2[\"tgl\"] = $tgl3;\n\t\t\t\t\t\t$data21[\"tgl\"] = $tgl3;\n\t\t\t\t\t}else if($rep == \"monthly\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$tgl2 = $data2[\"tgl\"];\n\t\t\t\t\t\t$tgl3 = date('Y-m-d H:i:s', strtotime($tgl2 . ' +1 month' ));\n\t\t\t\t\t\t$data2[\"tgl\"] = $tgl3;\n\t\t\t\t\t\t$data21[\"tgl\"] = $tgl3;\n\t\t\t\t\t}else if($rep == \"yearly\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$tgl2 = $data2[\"tgl\"];\n\t\t\t\t\t\t$tgl3 = date('Y-m-d H:i:s', strtotime($tgl2 . ' +1 year' ));\n\t\t\t\t\t\t$data2[\"tgl\"] = $tgl3;\n\t\t\t\t\t\t$data21[\"tgl\"] = $tgl3;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$rs1 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\twhere member_id = '$id' AND channel_id = 1\");\n\t\t\t\t$dataChannelTele=$rs1->fetchAssoc();\n\t\t\t\tif($dataChannelTele)\n\t\t\t\t{\n\t\t\t\t $data2[\"chat_id\"] = $dataChannelTele[\"chat_id\"];\n\t\t\t\t $data21[\"chat_id\"] = $dataChannelTele[\"chat_id\"];\n\t\t\t\t DB::Insert(\"outbox_telegram\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_telegram\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$rs2 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\twhere member_id = '$id' AND channel_id = 2\");\n\t\t\t\t$dataChannelAws=$rs2->fetchAssoc();\n\t\t\t\tif($dataChannelAws)\n\t\t\t\t{\n\t\t\t\t $data2[\"chat_id\"] = $dataChannelAws[\"chat_id\"];\n\t\t\t\t $data21[\"chat_id\"] = $dataChannelAws[\"chat_id\"];\n\t\t\t\t DB::Insert(\"outbox_mail_aws\", $data2 );\n\t\t\t\t DB::Insert(\"outbox_mail_alibaba\", $data2 );\n\t\t\t\t DB::Insert(\"outbox_mail_mailchimp\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_mail_aws\", $data21 );\n\t\t\t\t\t\t\tDB::Insert(\"outbox_mail_alibaba\", $data21 );\n\t\t\t\t\t\t\tDB::Insert(\"outbox_mail_mailchimp\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$rs3 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\twhere member_id = '$id' AND channel_id = 3\");\n\t\t\t\t$dataChannelWa=$rs3->fetchAssoc();\n\t\t\t\tif($dataChannelWa)\n\t\t\t\t{\n\t\t\t\t $data2[\"chat_id\"] = $dataChannelWa[\"chat_id\"];\n\t\t\t\t $data21[\"chat_id\"] = $dataChannelWa[\"chat_id\"];\n\t\t\t\t DB::Insert(\"outbox_whatsapp\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_whatsapp\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$rs4 = DB::Query(\"select chat_id from personal_channel\n\t\t\t\twhere member_id = '$id' AND channel_id = 4\");\n\t\t\t\t$dataChannelLine=$rs4->fetchAssoc();\n\t\t\t\tif($dataChannelLine)\n\t\t\t\t{\n\t\t\t\t $data2[\"chat_id\"] = $dataChannelLine[\"chat_id\"];\n\t\t\t\t $data21[\"chat_id\"] = $dataChannelLine[\"chat_id\"];\n\t\t\t\t DB::Insert(\"outbox_line\", $data2 );\n\t\t\t\t\t\tif($values['attachment']){\n\t\t\t\t\t\t\tDB::Insert(\"outbox_line\", $data21 );\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t$i += 1;\n\t\t}\n\t}\n}else{\n\t$data31 = array();\n\t$data31[\"out_msg\"] = $values['message_content'];\n\tif($values['repeat'] == 0 || $values['repeat'] == null){\n\t\t$data31[\"tgl\"] = $values['loop_value'];\n\t}\n\n\t$keyvalues = array();\n\t$keyvalues[\"member_agenda_id\"] = $values['member_agenda_id'];\n\t$keyvalues[\"flag\"] = '1';\n\t$keyvalues[\"type\"] = 'msg';\n\n\tDB::Update(\"outbox_telegram\", $data31, $keyvalues );\n\tDB::Update(\"outbox_mail_alibaba\", $data31, $keyvalues );\n\tDB::Update(\"outbox_mail_aws\", $data31, $keyvalues );\n\tDB::Update(\"outbox_mail_mailchimp\", $data31, $keyvalues );\n\tDB::Update(\"outbox_whatsapp\", $data31, $keyvalues );\n\tDB::Update(\"outbox_line\", $data31, $keyvalues );\n\n\n\n\t$data311 = array();\n\t$data311[\"out_msg\"] = $attach;\n\tif($values['repeat'] == 0 || $values['repeat'] == null){\n\t\t$data311[\"tgl\"] = $values['loop_value'];\n\t}\n\n\tif(!$oldvalues['attachment'] && $values['attachment']){\n\t\t$data311[\"flag\"] = \"1\";\n\t\t$data311[\"type\"] = 'file';\n\t\t$data311[\"member_agenda_id\"] = $values['member_agenda_id'];\n\t\t$data311[\"member_id\"] = $values['member_id'];\n\n\t\t$data = array();\n\t\t$data[\"member_agenda_id\"] = $values['member_agenda_id'];\n\t\t$data[\"flag\"] = \"1\";\n\t\t$rs4 = DB::Select(\"outbox_mail_aws\", $data );\n\t\twhile( $record4 = $rs4->fetchAssoc() )\n\t\t{\n\t\t\t$data4 = array();\n\t\t\t$data4[\"out_msg\"] = $attach;\n\t\t\t$data4[\"type\"] = 'file';\n\t\t\t$data4[\"flag\"] = $record4[\"flag\"];\n\t\t\t$data4[\"tgl\"] = $record4[\"tgl\"];\n\t\t\t$data4[\"member_agenda_id\"] = $record4[\"member_agenda_id\"];\n\t\t\t$data4[\"member_id\"] = $record4[\"member_id\"];\t\t\t\n\t\t\t$data4[\"id_personal_repeat\"] = $record4[\"id_personal_repeat\"];\t\n\n\t\t $data2 = array();\n\t\t\t$data2[\"member_id\"] = $values['member_id'];\n\t\t\t$rs1 = DB::Select(\"personal_channel\", $data2 );\n\t\t\twhile( $record2 = $rs1->fetchAssoc() )\n\t\t\t{\n\t\t\t\t$data4[\"chat_id\"] = $record2[\"chat_id\"];\n\n\t\t\t\tif($record2[\"channel_id\"]==1){\n\t\t\t\t\tDB::Insert(\"outbox_telegram\", $data4 );\n\t\t\t\t}else if($record2[\"channel_id\"]==2){\n\t\t\t\t\tDB::Insert(\"outbox_mail_alibaba\", $data4 );\n\t\t\t\t\tDB::Insert(\"outbox_mail_aws\", $data4 );\n\t\t\t\t\tDB::Insert(\"outbox_mail_mailchimp\", $data4 );\n\t\t\t\t}else if($record2[\"channel_id\"]==3){\n\t\t\t\t\tDB::Insert(\"outbox_whatsapp\", $data4 );\n\t\t\t\t}else if($record2[\"channel_id\"]==4){\n\t\t\t\t\tDB::Insert(\"outbox_line\", $data4 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$keyvalues2 = array();\n\t$keyvalues2[\"member_agenda_id\"] = $values['member_agenda_id'];\n\t$keyvalues2[\"flag\"] = '1';\n\t$keyvalues2[\"type\"] = 'file';\n\n\tDB::Update(\"outbox_telegram\", $data311, $keyvalues2 );\n\tDB::Update(\"outbox_mail_alibaba\", $data311, $keyvalues2 );\n\tDB::Update(\"outbox_mail_aws\", $data311, $keyvalues2 );\n\tDB::Update(\"outbox_mail_mailchimp\", $data311, $keyvalues2 );\n\tDB::Update(\"outbox_whatsapp\", $data311, $keyvalues2 );\n\tDB::Update(\"outbox_line\", $data311, $keyvalues2 );\n\n\tif($oldvalues['attachment'] && !$values['attachment']){\n\t\tDB::Delete(\"outbox_telegram\", $keyvalues2 );\n\t\tDB::Delete(\"outbox_mail_alibaba\", $keyvalues2 );\n\t\tDB::Delete(\"outbox_mail_aws\", $keyvalues2 );\n\t\tDB::Delete(\"outbox_mail_mailchimp\", $keyvalues2 );\n\t\tDB::Delete(\"outbox_whatsapp\", $keyvalues2 );\n\t\tDB::Delete(\"outbox_line\", $keyvalues2 );\n\t}\n}\n\n \nif($values['repeat_type']!='bydate'){\n\theader(\"Location: personal_agenda_list.php\");\n\texit();\n}\n;\t\t\n}", "function jakes_remove_publish_mbox()\n{\n remove_meta_box( 'submitdiv', 'message', 'side' );\n}", "public function escalate ()\n\t{\n\t\t$this->oModelEmail->escalate();\n\t\texit();\t\t\n\t}", "public function deleteEloquaSubmittedData();", "function akismet_cron_shutdown() {\n watchdog('cron', 'Akismet cron started at %time.', array('%time' => format_date(time(), 'custom', 'H:i:s')));\n\n // Expired content spam that we have to remove from each content repository.\n $expired_content_spam = array('nids'=>array(), 'cids'=>array());\n // Spam marks that we have to remove from the 'spam marks' table.\n $obsolete_spam_marks = array('nids'=>array(), 'cids'=>array());\n\n // Retrieve the list of expired content spam, based on the age specified in the settings panel.\n $expire_spam_age = variable_get('akismet_remove_spam_age', 259200);\n if ($expire_spam_age > 0) {\n $result = db_result(db_query('SELECT content_type, content_id FROM {akismet_spam_marks} WHERE spam_created < %d', time() - $expire_spam_age));\n while ($s = db_fetch_object($result)) {\n $key = ($s->content_type == 'node' ? 'nids' : 'cids');\n $expired_content_spam[$key][] = $s->content_id;\n $obsolete_spam_marks[$key][] = $s->content_id;\n }\n }\n\n // Deal with possible spam marks for content that have already been removed from database.\n // Note: when Drupal deletes a node, all its comments are deleted, but no hook is invoked,\n // so that may lead to orphans in the 'spam marks' table.\n // This is why this cron task is being more complex that it could really be. Anyway, these\n // queries shouldn't be too heavy.\n $result = db_result(db_query('SELECT s.content_id FROM {akismet_spam_marks} s LEFT JOIN {node} n ON s.content_id = n.nid WHERE s.content_type = \\'node\\' AND n.nid IS NULL'));\n while ($s = db_fetch_object($result)) {\n if (!in_array($s->content_id, $obsolete_spam_marks['nids'])) {\n $obsolete_spam_marks['nids'][] = $s->content_id;\n }\n }\n $result = db_result(db_query('SELECT s.content_id FROM {akismet_spam_marks} s LEFT JOIN {comments} c ON s.content_id = c.cid WHERE s.content_type = \\'comment\\' AND c.cid IS NULL'));\n while ($s = db_fetch_object($result)) {\n if (!in_array($s->content_id, $obsolete_spam_marks['cids'])) {\n $obsolete_spam_marks['cids'][] = $s->content_id;\n }\n }\n\n // From this point on is where we really will delete stuff from database.\n // Drupal cache will need to be cleared so anonymous users get updated views.\n $clear_cache = FALSE;\n\n // Remove expired spam from each content repository.\n $expired_nids_removed = count($expired_content_spam['nids']);\n $expired_cids_removed = count($expired_content_spam['cids']);\n if ($expired_nids_removed > 0) {\n $deleted_items = array();\n $delete_count = 0;\n foreach ($expired_content_spam['nids'] as $nid) {\n if (akismet_content_delete('node', $nid)) {\n $deleted_items[] = $nid;\n $delete_count++;\n }\n }\n if ($delete_count > 0) {\n $message = t('Akismet housekeeping') .': '. format_plural($delete_count, '1 expired spam node removed from database', '%count expired spam nodes removed from database').\n '<br />'.t('Node ID List: %nids', array('%nids' => implode(',', $deleted_items)));\n watchdog('cron', $message);\n $clear_cache = TRUE;\n }\n }\n if ($expired_cids_removed > 0) {\n $deleted_items = array();\n $delete_count = 0;\n foreach ($expired_content_spam['cids'] as $cid) {\n if (akismet_content_delete('comment', $cid)) {\n $deleted_items[] = $cid;\n $delete_count++;\n }\n }\n if ($delete_count > 0) {\n $message = t('Akismet housekeeping') .': '. format_plural($delete_count, '1 expired spam comment removed from database', '%count expired spam comments removed from database').\n '<br />'.t('Comment ID List: %cids', array('%cids' => implode(',', $deleted_items)));\n watchdog('cron', $message);\n $clear_cache = TRUE;\n }\n }\n\n // Remove obsolete spam marks from database.\n $spam_nids_removed = count($obsolete_spam_marks['nids']);\n $spam_cids_removed = count($obsolete_spam_marks['cids']);\n $spam_marks_removed = $spam_nids_removed + $spam_cids_removed;\n if ($spam_nids_removed > 0) {\n $spam_nids_list = implode(',', $obsolete_spam_marks['nids']);\n db_query('DELETE FROM {akismet_spam_marks} WHERE content_type = \\'node\\' AND content_id IN (%s)', $spam_nids_list);\n }\n if ($spam_cids_removed > 0) {\n $spam_cids_list = implode(',', $obsolete_spam_marks['cids']);\n db_query('DELETE FROM {akismet_spam_marks} WHERE content_type = \\'comment\\' AND content_id IN (%s)', $spam_cids_list);\n }\n if ($spam_marks_removed > 0) {\n $message = t('Akismet housekeeping') .': '. format_plural($spam_marks_removed, '1 spam mark removed from database', '%count spam marks removed from database');\n if (isset($spam_nids_list)) {\n $message .= '<br />'. t('Node ID List: %nids', array('%nids' => $spam_nids_list));\n }\n if (isset($spam_cids_list)) {\n $message .= '<br />'. t('Comment ID List: %cids', array('%cids' => $spam_cids_list));\n }\n watchdog('cron', $message);\n $clear_cache = TRUE;\n }\n\n // If anything was removed, then clear Drupal cache.\n if ($clear_cache) {\n akismet_clear_cache();\n }\n watchdog('cron', 'Akismet cron completed at %time.', array('%time' => format_date(time(), 'custom', 'H:i:s')));\n}", "function BeforeDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t$data = array();\n$data[\"member_agenda_id\"] = $deleted_values['member_agenda_id'];\n$data[\"flag\"] = '1';\n\nDB::Delete(\"outbox_mail_alibaba\", $data );\nDB::Delete(\"outbox_mail_aws\", $data );\nDB::Delete(\"outbox_mail_mailchimp\", $data );\nDB::Delete(\"outbox_telegram\", $data );\nDB::Delete(\"outbox_whatsapp\", $data );\nDB::Delete(\"outbox_line\", $data );\nDB::Delete(\"personal_agenda_repeat_date\", $data );\n\n$data = array();\n$keyvalues = array();\n$data[\"member_agenda_id\"] = null;\n$keyvalues[\"member_agenda_id\"] = $deleted_values['member_agenda_id'];\n\nDB::Update(\"outbox_mail_alibaba\", $data, $keyvalues );\nDB::Update(\"outbox_mail_aws\", $data, $keyvalues );\nDB::Update(\"outbox_mail_mailchimp\", $data, $keyvalues );\nDB::Update(\"outbox_telegram\", $data, $keyvalues );\nDB::Update(\"outbox_whatsapp\", $data, $keyvalues );\nDB::Update(\"outbox_line\", $data, $keyvalues );\nDB::Update(\"personal_agenda_repeat_date\", $data, $keyvalues );\n\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\nreturn true;\n;\t\t\n}", "function onAfterProcess( $params, &$formModel )\r\n\t{\r\n\t\t$user\t\t\t\t\t\t= &JFactory::getUser();\r\n\t\t$config\t\t\t\t\t=& JFactory::getConfig();\r\n\t\t\r\n\t\t$this->formModel =& $formModel;\r\n\t\t$formParams\t\t\t= $formModel->getParams();\r\n\t\t$emailTemplate\t= JPath::clean( JPATH_SITE.DS.'components'.DS.'com_fabrik'.DS.'plugins'.DS.'form'.DS.'fabrikemail'.DS.'tmpl'.DS . $params->get( 'email_template', '' ) );\r\n\t\t\r\n\t\t//check if condition exists and is met\r\n\t\tif (!$this->shouldSend( $params )) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//$this->data = $this->getEmailData();\r\n\t\t//getEmailData returns correctly formatted {tablename___elementname} keyed results\r\n\t\t//_formData is there for legacy and may allow you to use {elementname} only placeholders for simple forms\r\n\t\t$this->data \t\t= array_merge( $this->getEmailData(), $formModel->_formData );\r\n\t\t$htmlEmail = true; //always send as html as even text email can contain html from wysiwg editors\r\n\t\tif (JFile::exists( $emailTemplate )) {\r\n\t\t\tif (JFile::getExt( $emailTemplate ) == 'php') {\r\n\t\t\t\t$message = $this->_getPHPTemplateEmail( $emailTemplate );\r\n\t\t\t} else {\r\n\t\t\t\t$message = $this->_getTemplateEmail( $emailTemplate );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$message = $this->_getTextEmail();\r\n\t\t}\r\n\t\t$this->addAttachments();\r\n\r\n\t\t$cc \t\t= null;\r\n\t\t$bcc \t\t= null;\r\n\t\t$w = new FabrikWorker();\r\n\t\t// $$$ hugh - test stripslashes(), should be safe enough.\r\n\t\t$message \t= stripslashes( $message );\r\n\t\t$message \t= $w->parseMessageForPlaceholder( $message, $this->data );\r\n\t\t$email_to \t= $w->parseMessageForPlaceholder( $params->get( 'email_to' ), $this->data );\r\n\t\t$email_from = $w->parseMessageForPlaceholder( $params->get( 'email_from' ), $this->data );\r\n\t\t$subject\t\t= $params->get('email_subject');\r\n\t\tif ($subject == \"\") {\r\n\t\t\t$subject = $config->getValue( 'sitename' ) . \" :: Email\";\r\n\t\t}\r\n\t\t$subject = $w->parseMessageForPlaceholder( $subject, $this->data );\r\n\t\t$subject = preg_replace_callback( '/&#([0-9a-fx]+);/mi', array( $this, 'replace_num_entity' ), $subject );\r\n\t\t/* Send email*/\r\n\t\t$emails = explode( ',', $email_to );\r\n\t\tforeach ($emails as $email) {\r\n\t\t\tif (!empty( $email )) {\r\n\t\t\t\t$res = JUtility::sendMail( $email_from, $email_from, $email, $subject, $message, $htmlEmail, $cc, $bcc, $this->_aAttachments );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function clearData() {\n $this->emailData = array();\n }", "function deactivate_mjmlmail() {\r\n\tInc\\Base\\Deactivate::deactivate();\r\n}", "function remove_from_parent()\n {\n if(!$this->initially_was_account){\n return;\n }\n\n /* If domain part was selectable, contruct mail address */\n if($this->mailMethod->domainSelectionEnabled() || $this->mailMethod->mailEqualsCN()){\n $this->mail = $this->mail.\"@\".$this->mailDomainPart;\n }\n\n /* Remove GOsa attributes */\n plugin::remove_from_parent();\n\n /* Zero arrays */\n $this->attrs['gosaMailAlternateAddress'] = array();\n $this->attrs['gosaMailForwardingAddress']= array();\n\n $this->mailMethod->fixAttributesOnRemove();\n $this->cleanup();\n $ldap = $this->config->get_ldap_link();\n $ldap->cd($this->dn);\n $ldap->modify ($this->attrs); \n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }\n\n new log(\"remove\",\"groups/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());\n\n\n /* Let the mailMethod remove this mailbox, e.g. from imap and\n update shared folder membership, ACL may need to be updated.\n */\n if (!$this->is_template && $this->remove_folder_from_imap){\n\n if(!$this->mailMethod->connect()){\n msg_dialog::display(_(\"Mail error\"), sprintf(_(\"Mail method cannot connect: %s\"),\n $this->mailMethod->get_error()), ERROR_DIALOG);\n }else{\n if(!$this->mailMethod->deleteMailbox()){\n msg_dialog::display(_(\"Mail error\"), sprintf(_(\"Cannot remove mailbox: %s\"),\n $this->mailMethod->get_error()), ERROR_DIALOG);\n }\n if(!$this->mailMethod->updateSharedFolder()){\n msg_dialog::display(_(\"Mail error\"), sprintf(_(\"Cannot update shared folder permissions: %s\"),\n $this->mailMethod->get_error()), ERROR_DIALOG);\n }\n }\n }\n $this->mailMethod->disconnect();\n\n\n /* Optionally execute a command after we're done */\n $this->handle_post_events(\"remove\");\n }", "public function postProcess() {\n $this->bounceIfSimpleMailLimitExceeded(count($this->_contactIds));\n $formValues = $this->controller->exportValues($this->getName());\n $this->submit($formValues);\n }", "function removing_customer_details_in_emails( $order, $sent_to_admin, $plain_text, $email ){\n$wmail = WC()->mailer();\nremove_action( 'woocommerce_email_customer_details', array( $wmail, 'email_addresses' ), 20, 3 );\n}", "function BeforeDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t$data = array();\n$data[\"id_personal_repeat\"] = $deleted_values['id_group_repeat'];\n$data[\"flag\"] = \"2\";\n$rs = DB::Select(\"outbox_line\", $data );\n$rs1 = DB::Select(\"outbox_mail_alibaba\", $data );\n$rs2 = DB::Select(\"outbox_mail_aws\", $data );\n$rs3 = DB::Select(\"outbox_mail_mailchimp\", $data );\n$rs4 = DB::Select(\"outbox_telegram\", $data );\n$rs5 = DB::Select(\"outbox_whatsapp\", $data );\n\nif($rs->fetchAssoc() || $rs1->fetchAssoc() || $rs2->fetchAssoc() || $rs3->fetchAssoc() || $rs4->fetchAssoc() || $rs5->fetchAssoc()){\n\t$message = \"Reminder sudah dikirim, tidak dapat diubah lagi\";\n\treturn false;\n}else{\n\t$data1 = array();\n\t$data1[\"id_personal_repeat\"] = $deleted_values['id_group_repeat'];\n\tDB::Delete(\"outbox_line\", $data1 );\n\tDB::Delete(\"outbox_mail_alibaba\", $data1 );\n\tDB::Delete(\"outbox_mail_aws\", $data1 );\n\tDB::Delete(\"outbox_mail_mailchimp\", $data1 );\n\tDB::Delete(\"outbox_telegram\", $data1 );\n\tDB::Delete(\"outbox_whatsapp\", $data1 );\n}\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\nreturn true;\n;\t\t\n}", "public function removeEmailConfirmToken()\n {\n $this->us_email_confirm_token = null;\n }" ]
[ "0.5599842", "0.5557413", "0.530866", "0.5281915", "0.5218396", "0.5191641", "0.5159801", "0.5148645", "0.5103733", "0.5097717", "0.5089086", "0.5085813", "0.5046168", "0.5028842", "0.5026894", "0.50206864", "0.5015249", "0.50099754", "0.49984896", "0.4989349", "0.49747512", "0.49730763", "0.49372125", "0.49170175", "0.49140865", "0.4900538", "0.489984", "0.48989624", "0.48871607", "0.48842832" ]
0.57402104
0
Instantiates a new ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetRequestConfiguration and sets the default values.
public function __construct(?array $headers = null, ?array $options = null, ?ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetQueryParameters $queryParameters = null) { parent::__construct($headers ?? [], $options ?? []); $this->queryParameters = $queryParameters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function createQueryParameters(?array $expand = null, ?array $select = null): ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetQueryParameters {\n return new ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetQueryParameters($expand, $select);\n }", "public function templateSettings(): TemplateSettingsRequestBuilder {\n return new TemplateSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function providerTenantSettings(): ProviderTenantSettingsRequestBuilder {\n return new ProviderTenantSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function configManagerCollections(): ConfigManagerCollectionsRequestBuilder {\n return new ConfigManagerCollectionsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function templateInsights(): TemplateInsightsRequestBuilder {\n return new TemplateInsightsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function deviceConfigurationConflictSummary(): DeviceConfigurationConflictSummaryRequestBuilder {\n return new DeviceConfigurationConflictSummaryRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function deviceConfigurationUserStateSummaries(): DeviceConfigurationUserStateSummariesRequestBuilder {\n return new DeviceConfigurationUserStateSummariesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function tasks(): TasksRequestBuilder {\n return new TasksRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function tiIndicators(): TiIndicatorsRequestBuilder {\n return new TiIndicatorsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function microsoftTunnelConfigurations(): MicrosoftTunnelConfigurationsRequestBuilder {\n return new MicrosoftTunnelConfigurationsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function reusableSettings(): ReusableSettingsRequestBuilder {\n return new ReusableSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function userExperienceAnalyticsOverview(): UserExperienceAnalyticsOverviewRequestBuilder {\n return new UserExperienceAnalyticsOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function hostSecurityProfiles(): HostSecurityProfilesRequestBuilder {\n return new HostSecurityProfilesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function alerts(): AlertsRequestBuilder {\n return new AlertsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function deviceConfigurationDeviceStateSummaries(): DeviceConfigurationDeviceStateSummariesRequestBuilder {\n return new DeviceConfigurationDeviceStateSummariesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function totalRowRange(): TotalRowRangeRequestBuilder {\n return new TotalRowRangeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function getComanagedDevicesSummary(): GetComanagedDevicesSummaryRequestBuilder {\n return new GetComanagedDevicesSummaryRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function complianceSettings(): ComplianceSettingsRequestBuilder {\n return new ComplianceSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function configurationSettings(): ConfigurationSettingsRequestBuilder {\n return new ConfigurationSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function userSecurityProfiles(): UserSecurityProfilesRequestBuilder {\n return new UserSecurityProfilesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function tenantAttachRBAC(): TenantAttachRBACRequestBuilder {\n return new TenantAttachRBACRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function managedDeviceOverview(): ManagedDeviceOverviewRequestBuilder {\n return new ManagedDeviceOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "protected function defaultCurlOptions()\n {\n return [\n CURLOPT_USERAGENT => Yii::app()->name . ' OAuth ' . $this->version . ' Client',\n CURLOPT_CONNECTTIMEOUT => 30,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_SSL_VERIFYPEER => false,\n ];\n }", "public function userExperienceAnalyticsAppHealthOverview(): UserExperienceAnalyticsAppHealthOverviewRequestBuilder {\n return new UserExperienceAnalyticsAppHealthOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function triggerTypes(): TriggerTypesRequestBuilder {\n return new TriggerTypesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }" ]
[ "0.5632635", "0.52563286", "0.51058483", "0.48259848", "0.47286835", "0.47193962", "0.47057268", "0.46805185", "0.4677679", "0.46498057", "0.45713472", "0.45601964", "0.45579466", "0.45187065", "0.44433123", "0.44196814", "0.44156304", "0.4380799", "0.43690088", "0.4358937", "0.4346496", "0.4346496", "0.4346496", "0.4346496", "0.4346496", "0.43436384", "0.4333979", "0.4332916", "0.43306583", "0.43167207" ]
0.55496114
1
Instantiates a new ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetQueryParameters.
public static function createQueryParameters(?array $expand = null, ?array $select = null): ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetQueryParameters { return new ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetQueryParameters($expand, $select); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(?array $headers = null, ?array $options = null, ?ManagementTemplateCollectionTenantSummaryItemRequestBuilderGetQueryParameters $queryParameters = null) {\n parent::__construct($headers ?? [], $options ?? []);\n $this->queryParameters = $queryParameters;\n }", "public function providerTenantSettings(): ProviderTenantSettingsRequestBuilder {\n return new ProviderTenantSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function templateSettings(): TemplateSettingsRequestBuilder {\n return new TemplateSettingsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function getComanagedDevicesSummary(): GetComanagedDevicesSummaryRequestBuilder {\n return new GetComanagedDevicesSummaryRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function hostSecurityProfiles(): HostSecurityProfilesRequestBuilder {\n return new HostSecurityProfilesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public static function createQueryParameters(?array $expand = null, ?array $select = null): EdiscoveryCaseItemRequestBuilderGetQueryParameters {\n return new EdiscoveryCaseItemRequestBuilderGetQueryParameters($expand, $select);\n }", "public function configManagerCollections(): ConfigManagerCollectionsRequestBuilder {\n return new ConfigManagerCollectionsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function templateInsights(): TemplateInsightsRequestBuilder {\n return new TemplateInsightsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function userExperienceAnalyticsOverview(): UserExperienceAnalyticsOverviewRequestBuilder {\n return new UserExperienceAnalyticsOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public static function createQueryParameters(?array $expand = null, ?array $select = null): ProgramControlItemRequestBuilderGetQueryParameters {\n return new ProgramControlItemRequestBuilderGetQueryParameters($expand, $select);\n }", "public function recentPlans(): RecentPlansRequestBuilder {\n return new RecentPlansRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function tasks(): TasksRequestBuilder {\n return new TasksRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public static function createQueryParameters(?array $expand = null, ?array $select = null): ConnectivityConfigurationLinkItemRequestBuilderGetQueryParameters {\n return new ConnectivityConfigurationLinkItemRequestBuilderGetQueryParameters($expand, $select);\n }", "public static function createQueryParameters(?array $expand = null, ?array $select = null): UserExperienceAnalyticsAnomalyDeviceItemRequestBuilderGetQueryParameters {\n return new UserExperienceAnalyticsAnomalyDeviceItemRequestBuilderGetQueryParameters($expand, $select);\n }", "public function getCloudPcLaunchInfo(): GetCloudPcLaunchInfoRequestBuilder {\n return new GetCloudPcLaunchInfoRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function userExperienceAnalyticsSummarizedDeviceScopes(): UserExperienceAnalyticsSummarizedDeviceScopesRequestBuilder {\n return new UserExperienceAnalyticsSummarizedDeviceScopesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function getComanagementEligibleDevicesSummary(): GetComanagementEligibleDevicesSummaryRequestBuilder {\n return new GetComanagementEligibleDevicesSummaryRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function accessPackageCatalog(): AccessPackageCatalogRequestBuilder {\n return new AccessPackageCatalogRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function tiIndicators(): TiIndicatorsRequestBuilder {\n return new TiIndicatorsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function userExperienceAnalyticsAppHealthOverview(): UserExperienceAnalyticsAppHealthOverviewRequestBuilder {\n return new UserExperienceAnalyticsAppHealthOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function getMemberObjects(): GetMemberObjectsRequestBuilder {\n return new GetMemberObjectsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function userExperienceAnalyticsSummarizeWorkFromAnywhereDevices(): UserExperienceAnalyticsSummarizeWorkFromAnywhereDevicesRequestBuilder {\n return new UserExperienceAnalyticsSummarizeWorkFromAnywhereDevicesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public static function createQueryParameters(?array $expand = null, ?array $select = null): ApprovalWorkflowProviderItemRequestBuilderGetQueryParameters {\n return new ApprovalWorkflowProviderItemRequestBuilderGetQueryParameters($expand, $select);\n }", "public function totalRowRange(): TotalRowRangeRequestBuilder {\n return new TotalRowRangeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function managedDeviceOverview(): ManagedDeviceOverviewRequestBuilder {\n return new ManagedDeviceOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }" ]
[ "0.5733106", "0.5052327", "0.4859652", "0.48243392", "0.48117453", "0.47337785", "0.46815002", "0.46191797", "0.4611279", "0.4594424", "0.4594424", "0.4594424", "0.4594424", "0.4594424", "0.45802888", "0.45394596", "0.45262513", "0.45240396", "0.45087078", "0.45048112", "0.45010877", "0.44683704", "0.44459862", "0.4435655", "0.44280335", "0.4417163", "0.44095868", "0.44064543", "0.440121", "0.43526778" ]
0.69246787
0
get: id => commaseparated SSids resp: '' 2 steps: 1) remove from sight, 2) remove from disk
private function admin_handleSSDelete() { if (!$this->get('id')) return ''; $path = 'static/uploads/screenshots/%s/%d.jpg'; $ids = array_map('intval', explode(',', $this->get('id'))); foreach ($ids as $id) { // irrevocably remove already deleted files if (DB::Aowow()->selectCell('SELECT 1 FROM ?_screenshots WHERE status & ?d AND id = ?d', CC_FLAG_DELETED, $id)) { DB::Aowow()->query('DELETE FROM ?_screenshots WHERE id = ?d', $id); if (file_exists(sprintf($path, 'pending', $id))) unlink(sprintf($path, 'pending', $id)); continue; } // move pending or normal to pending if (file_exists(sprintf($path, 'normal', $id))) rename(sprintf($path, 'normal', $id), sprintf($path, 'pending', $id)); // remove resized and thumb if (file_exists(sprintf($path, 'thumb', $id))) unlink(sprintf($path, 'thumb', $id)); if (file_exists(sprintf($path, 'resized', $id))) unlink(sprintf($path, 'resized', $id)); } // flag as deleted if not aready DB::Aowow()->query('UPDATE ?_screenshots SET status = ?d, userIdDelete = ?d WHERE id IN (?a)', CC_FLAG_DELETED, User::$id, $ids); return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function deleteStreaming($id){\n\t\t\t//$query1 ='SELECT a.id FROM Aula a';\n\t\t\t//$ej1 = getDatabase()->execute($query1);\n\n/*\n\t\t\t$query = 'DELETE FROM Aula_Curso WHERE Aula_Curso.id_aula = :idAula';\n\n\t\t\t$ej = getDatabase()->execute($query, array(':idAula' => $id));*/\n\n\t\t\t$query = 'DELETE sa.* FROM Streaming_Aula sa, Aula a WHERE sa.id_streaming = :id AND sa.id_aula= a.id';\n\t\t\t$ej = getDatabase()->execute($query, array(':id' => $id));\n\n\t\t\t$query = 'DELETE sc.* FROM Streaming_Curso sc, Aula a WHERE sc.id_streaming = :id AND sc.id_curso= a.id';\n\t\t\t$ej = getDatabase()->execute($query, array(':id' => $id));\n\n\n\t\t\t$query = 'DELETE FROM Streaming WHERE Streaming.id = :id';\n\n\t\t\t$ej = getDatabase()->execute($query, array(':id' => $id));\n\t\t\t$json = json_encode($ej);\n\n\t\t}", "public function sremove($sid)\n {\t\t\n\t\tDB::delete('update specilizations set status=0 where sid = ?',[$sid]);\n\t\treturn redirect(\"viewSpecialization\"); \n }", "function deleteTasks(){\n \n $tasks = listTasks();\n if (empty($_GET['id'])) {\n $_GET['id']= '';\n }\n $id = $_GET['id'];\n \n foreach ($tasks as $key => $task) {\n if ($id == $task['id']) {\n unset($tasks[$key]);\n break;\n }\n }\n \n writeTasks($tasks);\n \n redirectToDefaultPage();\n}", "function sessions_delete($req, $res, $id) {\r\n\t$query = 'DELETE FROM sessions WHERE `id` =' . $id;\r\n\t$result = runQuery ( $query );\r\n\treturn 'removed';\r\n}", "function delStockDetails($sid)\n\t{\n\t\t\n\t\t//delete from product\n\t\t$delete1 = \"DELETE FROM stock_details WHERE stock_dtl_id ='$sid'\";\n\t\t\n\t\t//execute quary\n\t\t$query1\t= mysql_query($delete1);\n\t\t\n\t}", "public function destroy($id)\n {\n \t$siem = Siem::findOrfail($id);\n \t$siem->delete();\n return URL::to('siem');\n }", "public function destroy($id)\n {\n try{\n if(is_numeric($id)){\n $imss = Imss::find($id);\n if($imss){\n $imss->delete();\n \n $imss_file = ImssFile::where('imss_id', $id)->get();\n if(count($imss_file) > 0){\n foreach ($imss_file as $knd => $vnd) {\n $nd = ImssFile::find($vnd->id);\n if($nd) $nd->delete(); \n }\n }\n\n $infonavit_files = ImssInfonavit::where('imss_id', $id)->get();\n if(count($infonavit_files) > 0){\n foreach ($infonavit_files as $knd => $vnd) {\n $nd = ImssInfonavit::find($vnd->id);\n if($nd) $nd->delete(); \n }\n }\n\n $impuesto_files = ImssImpuesto::where('imss_id', $id)->get();\n if(count($impuesto_files) > 0){\n foreach ($impuesto_files as $knd => $vnd) {\n $nd = ImssImpuesto::find($vnd->id);\n if($nd) $nd->delete(); \n }\n }\n\n $pago_impuesto_files = ImssPagoImpuesto::where('imss_id', $id)->get();\n if(count($pago_impuesto_files) > 0){\n foreach ($pago_impuesto_files as $knd => $vnd) {\n $nd = ImssPagoImpuesto::find($vnd->id);\n if($nd) $nd->delete(); \n }\n }\n\n $pago_imss_files = ImssPagoImss::where('imss_id', $id)->get();\n if(count($pago_imss_files) > 0){\n foreach ($pago_imss_files as $knd => $vnd) {\n $nd = ImssPagoImss::find($vnd->id);\n if($nd) $nd->delete(); \n }\n }\n\n $this->res['message'] = 'Emision eliminada correctamente.';\n $this->status_code = 200;\n } else {\n $this->res['message'] = 'El registro de emision no existe.';\n $this->status_code = 422;\n }\n } else {\n $this->res['message'] = 'ID incorrecto.';\n $this->status_code = 422;\n }\n } catch(\\Exception $e) {\n $this->res['message'] = 'Error en el sistema.'.$e;\n $this->status_code = 422;\n }\n return response()->json($this->res, $this->status_code);\n }", "public function destroy($id)\n {\n $return = array();\n $return['errore'] = false;\n $return['messaggio'] = \"ok\";\n try {\n $sede = $this->sede->where('c_sed','=',$id)->first();\n $sede->trash();\n } catch (Exception $err) {\n $return['errore'] = true;\n $return['messaggio'] = $err->getMessage();\n }\n\n return json_encode($return);\n }", "public function removeAction()\n {\n $this->_forward('index');\n\n if(!isset($_GET['id'])) {\n $this->view->ERROR = getTranslation('missing_values');\n return;\n }\n\n $bsd = new Bigace_SecureDownload();\n try {\n $links = $bsd->removeAllLinks($_GET['id']);\n } catch (Exception $e) {\n $this->view->ERROR = getTranslation('failed_removing_link');\n }\n\n try {\n if(!unlink($this->_folder . $_GET['id']))\n $this->view->ERROR = getTranslation('failed_removing_file');\n } catch (Exception $e) {\n $this->view->ERROR = getTranslation('failed_removing_file');\n }\n }", "public function restSolcomp()\n{\n\tif(isset($_SESSION['username'])&&$_SESSION['rol']<=1)\n\t{\n\t\t$this->Solicitud_model->restSolcomp($_GET['part']);\n\n\t\t\t$files = glob('./uploads/'.$_GET['id'].'/'.$_GET['name'].'/*'); // get all file names\n\t\t\tforeach($files as $file)\n\t\t\t\t{ // iterate files\n\t\t\t\t if(is_file($file))\n\t\t\t\t unlink($file); // delete file\n\t\t\t\t}\n\t\t\trmdir('./uploads/'.$_GET['id'].'/'.$_GET['name']);\n\n\t\tredirect('welcome/comprobarSol?id='.$_GET['id']);\n\t}\n\telse\n\t{\n\tredirect('welcome/');\n\t}\n}", "function PLRemove($id) {\r\n addLog(\"mpd->PLRemove()\");\r\n if ( ! is_numeric($id) ) {\r\n $this->errStr = \"PLRemove() : argument 1 must be a numeric value\";\r\n return NULL;\r\n }\r\n if ( ! is_null($resp = $this->SendCommand(MPD_CMD_PLREMOVE,$id))) $this->RefreshInfo();\r\n addLog(\"mpd->PLRemove() / return\");\r\n return $resp;\r\n }", "function delStock($sid)\n\t{\n\t\t\n\t\t//delete from product\n\t\t$delete1 = \"DELETE FROM stock WHERE design_no='$sid'\";\n\t\t\n\t\t//execute quary\n\t\t$query1\t= mysql_query($delete1);\n\t\t\n\t}", "public function destroy($id) {\n\n\t\t//delete student\n\t\t$result=$this -> studentBusiness -> deleteStudent($id);\n\n\t\t//return\n\t\treturn json_encode($result);\n\t\t\n\t}", "public function delete($id)\n {\n \t$iMedicalRecord = decrypt($id);\n\n \t$oMedRec = MR::findOrFail($iMedicalRecord);\n\n \tif (!Gate::allows('emr-delete', $oMedRec))\n return responseBuilder()->error(__('auth.not_authorized'), 403, false);\n\n \t$bFileRemove = Storage::disk('s3')->delete(decrypt($oMedRec->url)); \n\n \tif($bFileRemove){\n\n \t\tMR::where('id', $iMedicalRecord)->delete($iMedicalRecord);\n\n \t\t$oResponse = responseBuilder()->success(__('message.EMR.delete'), '', false);\n\t\t\t$this->urlRec(106, 5, $oResponse);\n\n\t\t\treturn $oResponse;\n\n \t}\n\n \treturn responseBuilder()->error(__('message.EMR.noaccess'), 401, false);\n\n }", "function remove_programmation_by_id($id)\n {\n global $app;\n \n $executed = $app['db']->delete('programmation_circuit', array(\n 'id' => $id\n ));\n }", "public function getDestroy(Request $request, $id)\n {\n $ids = $request->input('id');\n $a = Soucang::where('sid',$ids)->first();\n $k = Soucang::destroy($a->id); \n if ($k == 1) {\n echo 'success';\n } else {\n echo 'error';\n }\n }", "public function destroy($id)\n {\n $id = explode(',', $id);\n foreach($id as $id_v){\n $res = \\DB::table('goods_collection')->where('id',$id_v)->delete(); \n }\n if($res){\n echo 1;\n }else{\n echo 0;\n }\n }", "public function destroy($id)\n {\n //\n $getmaster = MasterUtility::where('utility_ID',$id)->first();\n //dd($getmaster);\n $getdetail = DetailUtility::where('utility_master_id',$id)->get();\n foreach ($getdetail as $key => $value) {\n # code...\n $value->delete();\n }\n $getmaster->delete();\n Session::flash('message', 'Successfully deleted the Key!');\n return Redirect::to('master');\n }", "function remove($id){\n\t}", "function remove(){\n shm_remove($this->id);\n }", "public static function remove($sid)\n\t{\n\t\tglobal $mysql;\n\t\t$sid = real_escape_string($sid);\n\t\treturn $mysql->query(\"DELETE FROM `students` WHERE `sid` = '\".$sid.\"'\");\n\t}", "function removeInfo($id){\n\t\t$db = new mysqli(SERVERNAME, USERNAME, PASSWORD, DBNAME);\n\t\t$sql = \"DELETE FROM `pagecontent` WHERE id = $id\";\n\t\t$result = $db->query($sql);\n\t\t$db->close();\n\t}", "public function destroy($id)\n {\n// try {\n $data['id']= $id;\n $this->directGRNRepository->deleteSelected('id',array_values(explode(\",\",substr($id, 1, -1))));\n return $this->respondWithMessage('Record Deleted Successfully!!!', $data );\n// } catch (\\Exception $e) {\n// return $this->respondInternalError();\n// }\n }", "public function destroy($id)\n {\n //\n Directorio::destroy( $id );\n return json_encode([\"msg\"=>\"removed\"], 200);\n }", "public function destroy($id)\r\n {\r\n $esp= Esp::find($id);\r\n $esp->delete();\r\n return \"data berhasi di hapus\";\r\n }", "public function deleteMultipleStudents($id)\n {\n if (Student::find($id)) {\n Student::destroy($id);\n // Student::destroy([$id, 1, 2, 3, 4]);\n return response()->json([\"success\" => \"Student deleted successfully!\"], 200);\n } else {\n return response()->json([\"error\" => \"Could not delete student!\"], 404);\n }\n }", "public function actionDeleteForIds()\n {\n Sources::deleteForIds($_POST['ids']);\n }", "public function destroy($id)\n {\n $result = [\"name\" => \"comp710, this is a destroy\"];\n\n\n return $result;\n }", "public function delRoute($sid){\n $sid = mysqli_real_escape_string($this->db->link,$sid);\n $query = \"DELETE FROM route WHERE routeid = '$sid'\";\n $deldata = $this->db->delete($query);\n if($deldata){\n $msg=' <div id=\"logalert\" class=\"alert alert-success\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>Remove Successfully !</div>';\n return $msg;\n \n }else{\n $msg=' <div id=\"logalert\" class=\"alert alert-danger\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>could not be Removed !</div>';\n return $msg;\n }\n \n }", "public function destroy($id)\n {\n if(Gate::allows('isSEM') || Gate::allows('isSE')){\n $task = Tasks::find($id);\n\n if(!empty($task)){\n $task->delete();\n return response()->json([\n 'status' => true,\n 'message' => 'Record deleted successfully'\n ], 200);\n }\n return response()->json([\n 'status' => false,\n 'message' => 'No record found'\n ], 200);\n }\n return response()->json([\n 'status' => false,\n 'message' => 'Permission denied !'\n ], 200);\n }" ]
[ "0.5998685", "0.5992045", "0.5901671", "0.5816272", "0.571491", "0.5669308", "0.56641", "0.5596782", "0.55948275", "0.55441815", "0.55349916", "0.550397", "0.5479779", "0.5474059", "0.54732364", "0.5473208", "0.54722685", "0.54701805", "0.5467454", "0.5463429", "0.54518974", "0.54397106", "0.54276276", "0.54240775", "0.5412512", "0.5411694", "0.5400637", "0.5380199", "0.5368735", "0.53632516" ]
0.6212114
0
Set the PJAXURL header to the current uri.
protected function setUriHeader(Response $response, Request $request) { $response->header( 'X-PJAX-URL', $request->getRequestUri() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setURI()\n {\n $this->uri = $this->protocol . $this->host . '/' . $this->prefix . $this->path;\n }", "function setCurrentUri($uri);", "protected function setUriHeader(Response $response, Request $request)\n {\n $response->header('X-PJAX-URL', $request->url(true));\n\n return $this;\n }", "private function setURL() {\n $uri = System::escape((isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''));\n\n if (_PATH_ != '') {\n $array_root = explode('/', $_SERVER['PHP_SELF']);\n $array_url_base = explode('/', $this->getUrlBase());\n\n $directory_root = (isset($array_root[1])) ? trim($array_root[1]) : '';\n $directory_base = trim(array_pop($array_url_base));\n\n if ($directory_root == $directory_base) {\n $uri = '/' . str_replace(array(str_replace('/', '', $directory_base), '//'), '', $uri);\n }\n\n $uri = str_replace(_PATH_ . '/', '', $uri);\n }\n $uri = str_replace(array(\"\\\\\", \"//\"), '/', $uri);\n $uri = @explode('?', $uri);\n\n $url = isset($uri[0]) ? $uri[0] : $uri;\n\n if ($url AND $url <> '/') {\n $this->_url = $url;\n } else {\n $this->_url = 'index/init';\n }\n }", "function setUri($requestUri);", "function setUri($uri);", "private function _changeUriForAgent()\n {\n if(Text::beginsWithCaseInsensitive(parse_url($this->getPageSetPath(), PHP_URL_SCHEME), 'http'))\n {\n $url = $this->getPageSetPath();\n Framework::setLocationHeader($url);\n exit;\n }\n $firstPageSegment = 2; // /page/render are the first two\n $router = $this->uri->router;\n $parameters = array_slice($router->segments, $firstPageSegment);\n $uri = array_slice($router->segments, 0, $firstPageSegment);\n foreach (explode('/', $this->getPageSetPath()) as $segment)\n $uri[] = $segment;\n\n $finalSegments = array_merge($uri, $parameters);\n // $router->segments is a 1 based array\n for ($i = count($finalSegments); $i >= 0; $i--)\n {\n $finalSegments[$i] = $finalSegments[$i - 1];\n }\n unset($finalSegments[0]);\n $router->segments = $router->rsegments = $finalSegments;\n $pageUri = '';\n for ($i = $firstPageSegment; $i < count($finalSegments); $i++)\n {\n $pageUri .= '/'. $finalSegments[$i];\n }\n\n $router->uri_string = \"page/render$pageUri\";\n }", "public function setProcessorUrl($URL)\n {\n $this->headers['X-FirePHP-ProcessorURL'] = $URL;\n }", "public static function set_uri(string $uri, bool $prepend_area = false, bool $lock_uri = false)\n{ \n\n // Return, if locked\n if (self::$uri_locked === true) { return; }\n\n // Prepend, if needed\n if ($prepend_area === true && self::$area != 'public') { \n $uri = self::$area . '/' . $uri;\n }\n\n // Validate\n $uri = trim(str_replace(\" \", \"+\", strtolower($uri)), '/');\n if (!filter_var('http://domain.com/' . trim($uri, '/'), FILTER_VALIDATE_URL)) { \n throw new ApexException('error', \"Invalid URI specified, {1}\", $uri);\n }\n self::$uri_segments = explode('/', $uri);\n\n // Check for http controller\n if (file_exists(SITE_PATH . '/src/core/controller/http_requests/' . self::$uri_segments[0] . '.php')) { \n self::$http_controller = array_shift(self::$uri_segments);\n if (count(self::$uri_segments) == 0) { \n self::$uri_segments[] = 'index';\n $uri .= '/index';\n }\n } else { \n self::$http_controller = 'http';\n }\n self::$uri = strtolower(filter_var(trim($uri, '/'), FILTER_SANITIZE_URL));\n self::$uri_locked = $lock_uri;\n\n}", "function setURL ($url = null);", "public function setRendererUrl($URL)\n {\n $this->headers['X-FirePHP-RendererURL'] = $URL;\n }", "public function setUri(UriInterface $uri, $preserveHost = false)\n {\n $this->uri = $uri;\n\n $uriHost = $uri->getHost();\n if (!$preserveHost && !empty($uriHost)) {\n $this->setHeader('Host', $uriHost);\n } elseif (empty($this->getHeader('Host')) && !empty($uriHost)) {\n $this->setHeader('Host', $uriHost);\n }\n }", "private function set_url()\n\t{\n\t\t$url\t\t= '';\n\t\t$ssl \t\t= (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');\n\t\t\n\t\t// Get the protocol\n\t\t$protocol\t= strtolower($_SERVER['SERVER_PROTOCOL']);\n\t\t$protocol\t= substr($protocol, 0, strpos($protocol, \"/\"));\n\t\tif($ssl) $protocol .= 's';\n\t\t\n\t\t// Get the request PORT\n\t\t$port\t\t= $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT'];\n\t\t\n\t\t// Set the current URL\n\t\t$this->url = $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];\n\t\t\n\t\treturn $this->url;\n\t}", "function setURL( $url )\r\n {\r\n $this->URL = $url;\r\n }", "public function setUri()\n {\n\n $RURI=$this->realURI();\n $this->uri = explode('/', $RURI);\n }", "function set_uri($uri) {\n $this->uri = $uri;\n }", "public function setURI($uri);", "function set_redirect_uri( $uri ) {\r\n\r\n\t\t\tif ( ! empty( $_REQUEST['s'] ) )\r\n\t\t\t\t$uri = add_query_arg( 's', $_REQUEST['s'], $uri );\r\n\r\n\t\t\tif ( ! empty( $_REQUEST['status'] ) )\r\n\t\t\t\t$uri = add_query_arg( 'status', $_REQUEST['status'], $uri );\r\n\r\n\t\t\treturn $uri;\r\n\r\n\t\t}", "public function setButtonURL($param)\n {\n $this->buttonURL = $this->adjustLink($param);\n }", "public function setUrl($url)\n {\n // Add API version to url\n $parts = @parse_url($url);\n if ($parts) {\n $url = (isset($parts[ 'scheme' ]) ? $parts[ 'scheme' ] : 'http') . '://';\n if (isset($parts[ 'host' ])) {\n $url .= $parts[ 'host' ];\n }\n if (isset($parts[ 'port' ])) {\n $url .= ':' . $parts[ 'port' ];\n }\n $url .= (isset($parts[ 'path' ]) ? $parts[ 'path' ] : '/');\n if (isset($parts[ 'query' ])) {\n parse_str($parts[ 'query' ], $query);\n }\n $query[ 'version' ] = $this->_version;\n $url .= '?' . http_build_query($query);\n }\n\n $this->_url = trim($url);\n }", "private function setPluginUri()\n {\n $this->plugin_uri = isset($this->config->plugin_uri) ? $this->config->plugin_uri : null;\n }", "public function set_url() {\n\t\t$this->url = $this->get_base_path( explode( '/' , plugins_url( '', __FILE__ ) ) );\n\t}", "public function setPath() {\n\t\t$uri = str_replace('api', '', $this->uri);\n\t\t$this->path = trim($uri, '/');\n\n\t\t// Get action that is coming from Query String\n\t\tlist($this->action) = explode('/', $this->path);\n\t}", "final protected static function setURL()\n {\n if(isset($_SERVER['REDIRECT_URL']))\n {\n self::$rURL = htmlentities(rawurldecode($_SERVER['REDIRECT_URL']));\n }\n else\n {\n preg_match('/^[^\\\\?\\\\#]+/i', $_SERVER['REQUEST_URI'], $match);\n self::$rURL = htmlentities(rawurldecode($match[0]));\n }\n }", "function setSuccessUrl($arg) {\n\t\t$this->parameters['success_url'] = $arg;\n\t\treturn $this;\n\t}", "public function setActiveSignInUri(?string $value): void {\n $this->getBackingStore()->set('activeSignInUri', $value);\n }", "function setHeader() {\r\n $this->aboutMe(10, 5);\r\n\t}", "abstract protected function set_external_page();", "public function setURI($uri) {\n $this->uri = $uri;\n }", "public function setBaseUri($value) {\n $app->view()->appendData(array( 'baseUri' => $value));\n }" ]
[ "0.62034005", "0.58287793", "0.5651552", "0.56498045", "0.5457712", "0.54410154", "0.5373064", "0.5358881", "0.53560156", "0.5353763", "0.53515434", "0.53137267", "0.53092325", "0.5260635", "0.52432215", "0.5220589", "0.52026075", "0.5164852", "0.5127172", "0.51149255", "0.5074865", "0.5058249", "0.5039064", "0.50084656", "0.49368608", "0.49110278", "0.49106294", "0.49029174", "0.48985392", "0.4898084" ]
0.64512664
0
Should display the value if preview_value is passed.
protected function previewValue() { if ($this->previewValueValue == $this->value) { $valStr = ($this->config->get($this->index)) ? 'true' : 'false'; return "Value of {$this->name} is: " . $valStr; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function previewValue();", "function DisplayValue()\n\t{\n\t\tif( is_null($this->value) ) {\n\t\t\treturn '---';\n\t\t} else {\n\t\t\treturn $this->VDisplayValue();\t// est redéfinie dans toutes les classes dérivées, c'est là que ça se passe\n\t\t}\n\t}", "public function setDisplayValue($display_value);", "public static function preview_image_display($field, $form, $value) {\n$input_name = \"input_\" . str_replace('.', '_', $field['id']);\n$file_info = RGFormsModel::get_temp_filename($form['id'], $input_name);\n \n$file_path = $value;\nif(!empty($file_path)){\n$file_path = esc_attr(str_replace(\" \", \"%20\", $file_path));\n$value = \"<a href='$file_path' target='_blank' title='\" . __(\"Click to view\", \"gravityforms\") . \"'>\" . $file_info['uploaded_filename'] . \"</a>\";\n}\nreturn $value;\n \n}", "public function displayValue();", "protected function RenderDisplayValue()\r\n\t{\t\tif (is_set($this->_value) && $this->_isValueReturned)\r\n\t\t{\r\n\t\t\t$returnValue = DIescape($this->_value);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//Do we have a default value?\r\n\t\t\tif (is_set($this->_defaultValue) && $this->_isValueReturned)\r\n\t\t\t{\r\n\t\t\t\t$returnValue = DIescape($this->_defaultValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$returnValue = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $returnValue;\r\n\r\n\t}", "protected function preview()\n {\n return $this->objectUrl(Admin::url()->image($this->value));\n }", "public function getDisplayValue();", "public function getDisplayValue()\n {\n return $this->displayValue;\n }", "public function getDisplayValue()\n {\n return $this->displayValue;\n }", "public function displayValue( $value )\n {\n return parent::displayValue( strip_tags( $value ) );\n }", "public function getDisplayValue() {\n return $this->displayValue;\n }", "function displayPreview($args = array()){\n global $DOPBSP;\n \n $field = $args['field'];\n $language = isset($args['language']) && $args['language'] != '' ? $args['language']:$DOPBSP->classes->backend_language->get();\n $select_options = isset($args['select_options']) ? $args['select_options']:'';\n?>\n <div class=\"dopbsp-preview-wrapper\">\n <div class=\"dopbsp-preview dopbsp-input-wrapper\">\n<?php\n if ($field->type != 'checkbox'){\n echo '<label id=\"DOPBSP-form-field-label-preview-'.$field->id.'\" for=\"DOPBSP-form-field-preview-'.$field->id.'\">'.$DOPBSP->classes->translation->decodeJSON($field->translation, $language).' <span class=\"dopbsp-required\">'.($field->required == 'true' ? '*':'').'</span></label>';\n }\n \n switch ($field->type){\n case 'checkbox':\n?> \n <input type=\"checkbox\" name=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" id=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" disabled=\"disabled\" />\n <label id=\"DOPBSP-form-field-label-preview-<?php echo $field->id; ?>\" for=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" class=\"dopbsp-left\"><?php echo $DOPBSP->classes->translation->decodeJSON($field->translation, $language); ?> <span class=\"dopbsp-required\"><?php echo $field->required == 'true' ? '*':''; ?></span></label>\n<?php\n break;\n case 'select':\n?> \n <select name=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" id=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" value=\"\" disabled=\"disabled\"<?php echo $field->multiple_select == 'true' ? ' multiple=\"multiple\"':''; ?>>\n<?php\n $i = 0;\n \n foreach ($select_options as $select_option){\n $i++;\n echo '<option value=\"'.$i.'\">'.$DOPBSP->classes->translation->decodeJSON($select_option->translation, $language).'</option>';\n }\n?>\n </select>\n <script type=\"text/JavaScript\">\n jQuery('#DOPBSP-form-field-preview-<?php echo $field->id; ?>').DOPSelect();\n </script>\n<?php \n break;\n case 'text':\n echo '<input type=\"text\" name=\"DOPBSP-form-field-preview-'.$field->id.'\" id=\"DOPBSP-form-field-preview-'.$field->id.'\" value=\"\" disabled=\"disabled\" />';\n break;\n case 'textarea':\n echo '<textarea name=\"DOPBSP-form-field-preview-'.$field->id.'\" id=\"DOPBSP-form-field-preview-'.$field->id.'\" value=\"\" disabled=\"disabled\"></textarea>';\n break;\n }\n?>\n </div>\n <div class=\"dopbsp-buttons-wrapper\">\n <a href=\"javascript:DOPBSPBackEndFormField.toggle(<?php echo $field->id; ?>)\" class=\"dopbsp-button dopbsp-toggle\"><span class=\"dopbsp-info\"><?php echo $DOPBSP->text('FORMS_FORM_FIELD_SHOW_SETTINGS'); ?></span></a>\n <a href=\"javascript:DOPBSPBackEnd.confirmation('FORMS_FORM_DELETE_FIELD_CONFIRMATION', 'DOPBSPBackEndFormField.delete(<?php echo $field->id; ?>)')\" class=\"dopbsp-button dopbsp-delete\"><span class=\"dopbsp-info\"><?php echo $DOPBSP->text('FORMS_FORM_DELETE_FIELD_SUBMIT'); ?></span></a>\n <a href=\"javascript:void(0)\" class=\"dopbsp-button dopbsp-handle\"><span class=\"dopbsp-info\"><?php echo $DOPBSP->text('FORMS_FORM_FIELD_SORT'); ?></span></a>\n </div>\n <br class=\"dopbsp-clear\" />\n </div>\n<?php \n }", "protected function preview()\n {\n return $this->objectUrl($this->value);\n }", "public function preview(ColumnBuilder $preview): void\n {\n $preview->col('<img src=\"{image.0.conversion_urls.thumb}\">');\n }", "public function get_display_value() {\n\t\treturn $this->widget_type->get_display_value_from_value( $this->value );\n\t}", "public function getDisplayOriginalValue() {\n return $this->displayOriginalValue;\n }", "function set_display($disp_value){\n\t\t$this->display = $disp_value;\n\t}", "function set_value_and_text() {\n\t\t\n\t\t$value = $this->fieldProp('value');\n\t\t\n\t\tif ( empty($value) ) {\n\t\t\n\t\t\t$this->setHtml('value', '');\n\t\t\t$this->setHtml('text', 'Edit');\t\n\t\t}\n\t\telseif ( isset($value) && is_array($value) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t// if we have an array of WP_User object arrays\n\t\t\tif ( is_array($value[0]) ) {\n\t\t\t\t\t\n\t\t\t\t$arrayValues = array();\n\t\t\t\t$arrayText = array();\n\n\t\t\t\tforeach($value as $val) :\t\t\t\t\t\t\n\t\t\t\t\t$arrayValues[] = $val['ID'];\n\t\t\t\t\t$arrayText[] = $val['display_name'];\n\t\t\t\tendforeach;\n\t\t\t\t\t\n\t\t\t\t$html_value = implode(',', $arrayValues);\n\t\t\t\t$html_text = implode(', ', $arrayText);\n\t\t\t\t\n\t\t\t}\n\t\t\t// we just have 1 array - the WP_User object\n\t\t\telse {\n\t\t\t\t$html_value = $value['ID'];\n\t\t\t\t$html_text = $value['display_name'];\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->setHtml('value', $html_value);\n\t\t\t$this->setHtml('text', $html_text);\n\t\t}\n\t\t\n\t}", "function print_input($value) {\r\n\t\tif(isset($value['std'])) {\r\n\t\t\t$default = $value['std'];\r\n\t\t} else {\r\n\t\t\t$default = false;\r\n\t\t}\r\n\t\tif(isset($value['protected'][0][\"id\"])) {\r\n\t\t\t$protectedValue = $value['protected'][0][\"id\"];\r\n\t\t} else {\r\n\t\t\t$protectedValue = false;\r\n\t\t}\r\n\t\t\r\n\t\t$protected_value = $this->get_field_value($protectedValue, $default);\r\n\t\t\r\n\t\t\r\n\t\tif(((isset($value['protected'][0][\"id\"]) && $value['protected'][0][\"id\"]!=\"\") && $protected_value==$value['protected'][0][\"value\"]) || (!isset($value['protected'][0][\"id\"]))) {\r\n\t\t\t$input_value = $this->get_field_value($value['id'], $default);\r\n\r\n\t\t?>\r\n\t\t<?php if( isset($value['home']) && $value['home'] == \"yes\" ) { ?><div class=\"input-item-full-width-inside clearfix\"><?php } else { ?>\r\n\t\t\t<div class=\"input-item-full-width clearfix\">\r\n\t\t<?php } ?>\r\n\t\t\t<label>\r\n\t\t\t\t<?php \r\n\t\t\t\t\techo $value['title'];\r\n\t\t\t\t?>\r\n\t\t\t</label>\r\n\t\t\t\t<?php\r\n\t\t\t\t\tif (isset($value['info'])) {\r\n\t\t\t\t\t\techo different_themes_info_message($value['info']);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t?>\r\n\t\t\t\r\n\t\t\t<span class=\"input-text\"><input type=\"text\" name=\"<?php echo $value['id'];?>\" value=\"<?php echo $input_value;?>\" <?php if(isset($value['number']) && $value['number'] == \"yes\") { ?>style=\"width: 46px;\"<?php } ?>/></span>\r\n\t\t</div>\r\n\t\t<?php\r\n\t\t}\r\n\t}", "function print_text($value){\r\n\t\tif ( isset ( $value['protected'][0][\"id\"] ) || isset ( $value['std'] ) ) {\r\n\t\t\t$protected_value = $this->get_field_value( $value['protected'][0][\"id\"], $value['std'] );\r\n\t\t}\r\n\t\t\r\n\t\tif ( isset ( $value['protected'][1][\"id\"] ) || isset ( $value['std'] ) ) {\r\n\t\t\t$protected_value_1 = $this->get_field_value( $value['protected'][1][\"id\"], $value['std'] );\r\n\t\t}\r\n\t\t\r\n\t\tif ( isset ( $value['id'] ) || isset ( $value['std'] ) ) {\r\n\t\t\t$input_value = $this->get_field_value( $value['id'], $value['std'] );\r\n\t\t}\r\n\t\t\r\n\t\tif(((isset($value['protected'][0][\"id\"]) && $value['protected'][0][\"id\"]!=\"\") && $protected_value==$value['protected'][0][\"value\"]) && $protected_value_1==$value['protected'][1][\"value\"] || (!isset($value['protected'][0][\"id\"]))) {\r\n\r\n\t\t\t\r\n\t\t\techo '<div id=\"theme_documentation\" style=\"min-height:300px;\">\r\n\t\t\t<div style=\"margin-left:33px; margin-right:25px;\">\r\n\t\t\t'.$value['text'].'\t\r\n\t\t\t</div>\t\t\t\t\t\t\t\t\r\n\t\t\t</div>';\r\n\t\t}\r\n\t}", "public function getDisplayValue()\n {\n if (array_key_exists(\"displayValue\", $this->_propDict)) {\n return $this->_propDict[\"displayValue\"];\n } else {\n return null;\n }\n }", "public function showPreview($postPreview, $title = null);", "public function preview(ColumnBuilder $preview): void\n {\n $preview->image('Image')->src('{image.url}');\n }", "public function is_preview(){\n\t\t\n\t\t// previews not available on admin pages\n\t\tif( is_admin() ){\n\t\t\treturn;\n\t\t}\n\t\t// check for preview variable\n\t\tif( !fa_is_preview() ){\n\t\t\t// user must be capabile of editing fa items\n\t\t\tif( !current_user_can('edit_fa_items') ){\n\t\t\t\twp_die( __('Not allowed.', 'fapro') );\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tcheck_admin_referer( 'fa-slider-theme-preview', 'fa-preview-nonce' );\n\t\t\n\t\tif( fa_is_theme_edit_preview() ){\n\t\t\t// add filter to prevent dynamic areas display on theme color scheme edit\n\t\t\tadd_filter('fa_display_dynamic_areas', array( $this, 'prevent_dynamic_areas' ), 999, 2);\n\t\t\t// prevent all other sliders from being displayed except the one set on $_GET\n\t\t\tadd_filter( 'fa_display_slider' , array( $this, 'prevent_sliders' ), 999, 3 );\t\n\t\t\t// hide the edit links displayed below sliders\n\t\t\tadd_filter( 'fa_show_slider_edit_link', array( $this, 'hide_edit_links' ), 999, 2 );\t\n\t\t\t// if a color scheme is set, output the styling in page\n\t\t\tif( !isset( $_GET['color'] ) || empty( $_GET['color'] ) ){\n\t\t\t\t// add the styling for creating new color scheme\n\t\t\t\tadd_filter('wp_print_styles', array( $this, 'color_scheme_styles' ));\n\t\t\t}\t\n\t\t\tshow_admin_bar( false );\n\t\t}\t\t\n\t}", "public function setDisplayOriginalValue($displayOriginalValue) {\n $this->displayOriginalValue = $displayOriginalValue;\n }", "function _behat_editor_check_for_render_field($value) {\n $field_name = key($value);\n\n $id_input = (isset($value[$field_name]['#id'])) ? \"id=\\\"{$value[$field_name]['#id']}\\\"\" : '';\n $name = (isset($value[$field_name]['#name'])) ? \"name=\\\"{$value[$field_name]['#name']}\\\"\" : '';\n $class = (isset($value[$field_name]['#class'])) ? \"class=\\\"{$value[$field_name]['#class']}\\\"\" : '';\n $value = $value[$field_name]['#value'];\n $data = \"<input type='hidden' value=\\\"{$value}\\\" $id_input $name $class>\";\n return $data;\n}", "function Value( $newvalue = null ) {\n if ( $newvalue != null ) {\n $this->content = $newvalue;\n if ( isset($this->rendered) ) unset($this->rendered);\n }\n return $this->content;\n }", "public function getPreview(): string\n {\n return $this->preview;\n }", "function print_upload($value) {\r\n\t\tif(isset($value['std'])) {\r\n\t\t\t$default = $value['std'];\r\n\t\t} else {\r\n\t\t\t$default = false;\r\n\t\t}\r\n\t\tif(isset($value['protected'][0][\"id\"])) {\r\n\t\t\t$protectedValue = $value['protected'][0][\"id\"];\r\n\t\t} else {\r\n\t\t\t$protectedValue = false;\r\n\t\t}\r\n\t\t\r\n\t\t$protected_value = $this->get_field_value($protectedValue, $default);\r\n\t\t\r\n\t\t\r\n\t\tif(((isset($value['protected'][0][\"id\"]) && $value['protected'][0][\"id\"]!=\"\") && $protected_value==$value['protected'][0][\"value\"]) || (!isset($value['protected'][0][\"id\"]))) {\r\n\t\t\t$input_value = $this->get_field_value($value['id'], $default);\r\n\t\t\r\n\r\n\t\t?>\r\n\t\t<?php if( isset($value['home']) && $value['home'] == \"yes\" ) { ?><div class=\"input-item-full-width-inside clearfix\"><?php } else { ?>\r\n\t\t\t<div class=\"input-item-full-width clearfix\">\r\n\t\t<?php } ?>\r\n\t\t\t\t<label><?php echo $value['title'];?></label>\r\n\t\t<?php\r\n\t\t\tif (isset($value['info'])) {\r\n\t\t\t\techo different_themes_info_message($value['info']);\r\n\t\t\t}\t\r\n\t\t?>\r\n\t\t\t\t<span>\r\n\t\t\t\t\t<div class=\"uploader\">\r\n\t\t\t\t\t\t<input type=\"text\" name=\"<?php echo $value['id'];?>\" value=\"<?php echo $input_value;?>\" class=\"upload df-upload-field\" style=\"width:199px; <?php if( $value['home'] == \"yes\" ) { ?>margin-left:483px;<?php } ?>\" id=\"<?php echo $value['id'];?>\" />\r\n\t\t\t\t\t\t<span id=\"<?php echo $value['id'];?>_button\" class=\"action btn-upload df-upload-button\" style=\"width:100px; float:right; z-index:500;\">Choose File</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</span>\r\n\t\t\t</div>\r\n\t\t<?php \r\n\t\r\n\t\t}\r\n\t}" ]
[ "0.8138318", "0.6797473", "0.66072226", "0.64849097", "0.62736356", "0.6272698", "0.62424695", "0.62362844", "0.6146664", "0.6146664", "0.6136556", "0.60416526", "0.6007261", "0.59414315", "0.5908322", "0.58824927", "0.58749837", "0.57842594", "0.5748702", "0.5741238", "0.568328", "0.5682278", "0.56608135", "0.5659037", "0.5624606", "0.56238985", "0.5605009", "0.55855244", "0.55537456", "0.55340993" ]
0.7541802
1
Returns back the filenames Can be used by the calling code: $names = $loader>getFilenames(); $names[0] is the first file $names[1] is the second, so on, and so forth.
public function getFilenames() { return $this->_filenames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilenames() {\n\treturn $this->_filenames;\n }", "private function getFilenames()\n\t{\n\t\t$filenames = array();\n\n\t\tforeach ($this->filesets as $fileset)\n\t\t{\n\t\t\t$ds = $fileset->getDirectoryScanner($this->project);\n\t\t\t$ds->scan();\n\n\t\t\t$files = $ds->getIncludedFiles();\n\n\t\t\tforeach ($files as $file)\n\t\t\t{\n\t\t\t\tif (strstr($file, \".php\"))\n\t\t\t\t{\n\t\t\t\t\t$filenames[] = $ds->getBaseDir() . \"/\" . $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $filenames;\n\t}", "protected function getFileNames()\n {\n return collect(iterator_to_array(\n Finder::create()->in($this->locations)->directories()\n ))->map(function (SplFileInfo $file) {\n return $file->getFilename();\n })->sort();\n }", "protected function getModuleFileNames() {\n $filenames = array();\n foreach ($this->moduleList as $module => $weight) {\n if ($data = $this->moduleData($module)) {\n $filenames[$module] = $data->getPathname();\n }\n }\n return $filenames;\n }", "public function getFilenames(): array\n {\n $ret = [];\n\n $finder = $this->files();\n\n $extensions = [\n Optimizer::EXTENSION_GIF,\n Optimizer::EXTENSION_JPEG,\n Optimizer::EXTENSION_JPG,\n Optimizer::EXTENSION_PNG,\n ];\n\n foreach ($extensions as $extension) {\n $format = '*.%s';\n $patternLc = sprintf($format, strtolower($extension));\n $patternUc = sprintf($format, strtoupper($extension));\n $finder->name($patternLc);\n $finder->name($patternUc);\n }\n\n foreach ($finder as $fileInfo) {\n $ret[] = $fileInfo->getPathname();\n }\n\n sort($ret, SORT_NATURAL);\n\n return $ret;\n }", "public function getFiles()\n {\n $retval = array();\n foreach ($this->_files as $file) {\n //If filename contains a \"?\", continue.\n if (strpos($file['filename'], \"?\") !== false) {\n continue;\n }\n $retval[] = array(\n 'name' => $file['filename'],\n 'fire' => $file['has_onload']\n );\n\n }\n return $retval;\n }", "private function loadFileNames() {\n \t$this->fileNamesInFolder = array();\n \t$dir = \"./Pages/\";\n \t$handle = opendir($dir);\n \twhile (false !== ($entry = readdir($handle))) {\n \tif (($entry != '.' && $entry != '..' && !is_dir($dir.\"/\".$entry))) \n \t$this->fileNamesInFolder[] = $entry;\n \t}\n \tsort($this->fileNamesInFolder);\n \tclosedir($handle);\n\t}", "public static function getImportFilesName(): array\n {\n $import_dir = \\ImportPalmira::_IMPORT_FILES_DIR_;\n $finder = new Finder();\n $finder->files()->in($import_dir);\n\n $files_names = [];\n\n if ($finder->hasResults()) {\n foreach ($finder as $file) {\n $file_ext = $file->getExtension();\n\n if ($file_ext === 'csv' || $file_ext === 'xml') {\n $files_names[] = $file->getFilename();\n }\n }\n }\n\n return $files_names;\n }", "public static function get_file_list() {\n return array_keys(Mudnames::getInstance()->_dictionnaries->get_dictionnaries_list());\n }", "public function getFileList()\n {\n $index = 0;\n $fileList = array();\n while ($index < $this->numFiles) {\n $fileList[] = $this->getNameIndex($index);\n ++$index;\n }\n\n return $fileList;\n }", "function get_files() {\n $brother_dir3 = \"Images/Brothers/\";\n $names = array_merge(array_diff(scandir($brother_dir3),\n array('..', '.', 'Sweethearts'),\n array_diff(scandir($brother_dir3 . \"Sweethearts/\"),\n array('..', '.'))));\n $file_names = \"\";\n foreach ($names as $name) {\n $file_names .= \"{$name} \";\n }\n return $file_names;\n }", "public static function dataFileNames()\n {\n return array(\n [ 'file_a.txt', 'file_a.txt' ],\n [ 'file_a.txt', 'file_b.txt' ],\n [ 'file_a.txt', 'file_ab.txt' ],\n [ 'file_10.txt', 'file_2.txt' ],\n );\n }", "protected function getFilenameArray()\n {\n $table = DataObject::singleton(File::class)->baseTable();\n // Convert original query, ensuring the legacy \"Filename\" is included in the result\n /** @skipUpgrade */\n return $this\n ->getFileQuery()\n ->dataQuery()\n ->selectFromTable($table, ['ID', 'Filename'])\n ->execute()\n ->map(); // map ID to Filename\n }", "public function getLoadedFiles()\n {\n return $this->_files;\n }", "public function getFile()\n {\n return [$this->filename];\n }", "protected function getFileList() {\n\t\t$files = scandir( $this->path );\n\n\t\tif ( false === $files ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn array_map( function ( $file ) { return $this->path . '/' . $file; }, array_diff( $files, ['..', '.'] ) );\n\t}", "public function fileNameProvider() {\n return array(\n array('drupal-123-node-123.xlf', 'drupal-123', array('type' => 'node', 'identifier' => 123)),\n array('drupal-123-taxonomy_term-999999.xlf', 'drupal-123', array('type' => 'taxonomy_term', 'identifier' => 999999)),\n array('Not-real-111.xlf', 'drupal-123', array()),\n array('drupal-123-12345-node.xlf', 'drupal-123', array()),\n array('Another file', 'drupal-123', array()),\n );\n }", "public function getFileNames()\n {\n if (array_key_exists(\"fileNames\", $this->_propDict)) {\n return $this->_propDict[\"fileNames\"];\n } else {\n return null;\n }\n }", "public static function getNames()\n\t{\n\t\t$file = static::_file_();\n\t\t$filename = basename($file);\n\t\t$path = dirname($file) . '/' . strtolower(substr($filename, 0, strlen($filename) - strlen(ICORE_CLASS_EXT)));\n\n\t\t$names = array();\n\t\tforeach(glob($path . '/*' . ICORE_CLASS_EXT) as $afile)\n\t\t{\n\t\t\t// class name\n\t\t\t$name = substr(basename($afile), 0, -1 * strlen(ICORE_CLASS_EXT));\n\t\t\t$names[] = $name;\n\t\t}\n\n\t\treturn $names;\n\t}", "private function files () {\r\n\r\n\t\t# File exists\r\n\t\tif(!file_exists($this->dirName))\r\n\t\t\tthrow new tLangException('id', $this->dirName);\r\n\r\n\r\n\t\t# Is it directroy?\r\n\t\tif(!is_dir($this->dirName))\r\n\t\t\tthrow new tLangException('nd', $this->dirName);\r\n\r\n\r\n\t\t# Order the files names in dir\r\n\t\t$dir = opendir($this->dirName);\r\n\r\n\t\t\t# Listing files\r\n\t\t\twhile($file = readdir($dir)) {\r\n\r\n\t\t\t\t# File extensinon\r\n\t\t\t\t$extension = pathinfo($this->dirName . $file, PATHINFO_EXTENSION);\r\n\t\t\t\t\r\n\t\t\t\t# Read only .php exte+nsions\r\n\t\t\t\tif($extension === 'php')\r\n\t\t\t\t\tarray_push($this->files, $file);\r\n\r\n\t\t\t}\r\n\r\n\t\treturn $this->files;\r\n\t\t\r\n\t}", "function get_filename() {\n\t\t\t$path = $this->path;\n\t\t\tforeach(new DirIterator( $path ) as $file ) {\n\t\t if( eregi('.jpg|JPEG|PNG|png',$file) ) {\n\t\t $filenames[] = $this->strip_out_filename( $file );\n\t\t } \n\n\t\t }\n\t\t\t\n\t\t\t$size = sizeof( $filenames );\n\t\t $id = ( @rand() % $size );\n\t\t\treturn $filenames[$id];\n\t\t}", "public function getFilesToParse()\n\t{\n\t\t$files = array();\n\t\t$this->_files = array_unique($this->_files);\n\t\tforeach($this->_files as $file)\n\t\t{\n\t\t\tif($this->_isFilenameToParse($file))\n\t\t\t\tarray_push($files, $file);\n\t\t}\n\t\t\n\t\t$this->_directories = array_unique($this->_directories);\n\t\tforeach($this->_directories as $dir)\n\t\t{\n\t\t\t$files = array_merge(\n\t\t\t\t$files,\n\t\t\t\t$this->_getFilesToParseInDir($dir)\n\t\t\t);\n\t\t}\n\t\treturn $files;\n\t}", "public function getProjectTranslationFileNames()\n {\n $projectFilesResponse = $this->getProjectTranslationFiles();\n\n return array_map(function($dataObject) {\n return $dataObject->file_name;\n }, $projectFilesResponse->data);\n }", "public function getFilename () {}", "public function getExtensions()\n\t{\n\t\t$list = [];\n\n\t\tforeach( $this->manifests as $path => $manifest )\n\t\t{\n\t\t\tif( isset( $manifest['name'] ) && $manifest['name'] != '' ) {\n\t\t\t\t$list[] = $manifest['name'];\n\t\t\t} else {\n\t\t\t\t$list[] = basename( $path );\n\t\t\t}\n\t\t}\n\n\t\treturn $list;\n\t}", "protected function getArticleFilenames(): array\n {\n $filenames = [];\n foreach (glob($this->pathArticles . '*.md') as $file) {\n $filenames[] = basename($file);\n }\n rsort($filenames);\n\n return $filenames;\n }", "public static function files()\n\t{\n\t\t$files = (array)get_included_files();\n\t\tsort($files);\n\t\treturn $files;\n\t\t\n\t}", "function getFilenames($input) {\n \n $res = array();\n \n if (is_file($input)) {\n array_push( $res, $input );\n return $res;\n \n } else if (is_dir($input)) {\n\n $path = realpath($input);\n\n if (!$path) {\n throw new InputFileException(\"Unable to reach path '$input'\");\n }\n\n // rekurzivne iteruj pres vsechny soubory adresarove struktury\n foreach ( new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($input)\n )\n as $filename ) {\n // echo $filename . \"\\n\";\n $suffix = pathinfo($filename, PATHINFO_EXTENSION);\n \n if ($suffix == \"h\"){ // akceptuj pouze hlavickove\n array_push($res, strval($filename));\n }\n \n }\n \n return $res;\n\n } else {\n throw new InputFileException(\"Unable to reach path '$input'\");\n }\n}", "public function files()\n {\n $files = array_keys($this->compressed_list);\n sort($files);\n\n return $files;\n }", "public function getFiles();" ]
[ "0.7467664", "0.7212965", "0.6935343", "0.68147945", "0.68004036", "0.6642289", "0.65379244", "0.6523804", "0.63813174", "0.6354559", "0.63430005", "0.6340153", "0.631797", "0.62333053", "0.6226596", "0.622175", "0.62150913", "0.6204492", "0.61664176", "0.6091887", "0.5998602", "0.5948602", "0.59440434", "0.59403557", "0.5937858", "0.59152", "0.5913988", "0.5911972", "0.59097856", "0.58879185" ]
0.731951
1
Gets the value of engOptions.
public function getEngOptions() { return $this->engOptions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOptions() {\n\t\treturn $this->settings['Options'];\n\t}", "protected function getOptions() {\n\t\treturn $this->arguments['options'];\n\t}", "public function get() {\n\t\treturn $this->user_options->get( self::OPTION );\n\t}", "public function getOptions()\n {\n $value = $this->getData('options');\n return json_decode($value, true);\n }", "public function getOptions()\n {\n return $this->get('options');\n }", "public function getOption()\n {\n return $this->option;\n }", "public function getOption()\n {\n return $this->option;\n }", "public function getOption() {\n return $this->get(self::OPTION);\n }", "public function getOptions()\r\n {\r\n return $this->options;\r\n }", "function get_options() {\r\n return get_option($this->dir, array());\r\n }", "private function _getOptions()\n\t{\n\t\treturn $this->_options;\n\t}", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions ()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n\t{\n\t\treturn $this->options;\n\t}", "public function getOptions() {\n return $this->options;\n }", "public function getOptions() {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }" ]
[ "0.69787186", "0.6869461", "0.67297363", "0.6703638", "0.66548806", "0.653111", "0.653111", "0.6481354", "0.6458925", "0.6443077", "0.6429565", "0.64205146", "0.64205146", "0.64205146", "0.64205146", "0.64205146", "0.64205146", "0.64205146", "0.64205146", "0.6412194", "0.6406564", "0.63815606", "0.6366657", "0.6366657", "0.6356321", "0.6356321", "0.6356321", "0.6356321", "0.6356321", "0.6356321" ]
0.8664075
0
Sets the value of engOptions.
protected function setEngOptions($engOptions) { $this->engOptions = $engOptions; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEngOptions()\n {\n return $this->engOptions;\n }", "public function setOptions($options = array()){\r\n\t\tforeach ($options as $k => $v)\r\n\t\t\t$this->_options[$k] = $v;\r\n\t}", "public function setOptions($options){ }", "public function setOptions($options){ }", "public function setOptions()\n {\n // TODO: Implement setOptions() method.\n }", "public function setOptions($options)\n {\n }", "public function setOptions($options = array()) {\n $this->options = array();\n foreach ($options as $key => $val) {\n $this->options[$key] = $val;\n }\n }", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setBeckendOptions($options)\r\n {\r\n $this->_backendOptions = $options;\r\n }", "public function setOptions($options)\n {\n foreach ($this->options as $optName => $v)\n {\n $this->options[$optName] = isset($options[$optName]) && array_key_exists($options[$optName], sfConfig::get('sf_extjs'.$this->getExtjsVersion().'_'.$optName.'s', array())) ? $options[$optName] : sfConfig::get('sf_extjs'.$this->getExtjsVersion().'_default_'.$optName);\n }\n }", "function setOptions($value) {\n $this->options = $value;\n }", "public function setOptions($options);", "public function setOptions($options);", "function setOptions ($options)\n\t{\n\t\t$this->options = $options;\n\t}", "public function setOptions(array $options)\r\n {\r\n $this->_options=$options;\r\n parent::setOptions($options); \r\n }", "public function setOptions($options)\n {\n $this->options = $options;\n }" ]
[ "0.64125645", "0.6234392", "0.62018526", "0.62018526", "0.61905485", "0.6113859", "0.61101913", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.61096483", "0.6084126", "0.60739917", "0.6054396", "0.6042503", "0.6042503", "0.6027776", "0.5997545", "0.59645814" ]
0.7024937
0
Gets the value of flapOptions.
public function getFlapOptions() { return $this->flapOptions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setFlapOptions($flapOptions)\n {\n $this->flapOptions = $flapOptions;\n\n return $this;\n }", "public function getOptions() {\n\t\treturn $this->settings['Options'];\n\t}", "protected function getOptions() {\n\t\treturn $this->arguments['options'];\n\t}", "public function get() {\n\t\treturn $this->user_options->get( self::OPTION );\n\t}", "public function getOptions() {\n return $this->options;\n }", "public function getOptions() {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function options() {\n return $this->options;\n }", "public function getOptions()\r\n {\r\n return $this->options;\r\n }", "public function getOption()\n {\n return $this->option;\n }", "public function getOption()\n {\n return $this->option;\n }", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions ()\n {\n return $this->options;\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();" ]
[ "0.650594", "0.6254862", "0.60962766", "0.59687835", "0.5965645", "0.5965645", "0.5940573", "0.5938914", "0.59378964", "0.59351134", "0.59351134", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.5920445", "0.59041214", "0.5887143", "0.5887143", "0.5887143" ]
0.8760093
0
Sets the value of flapOptions.
protected function setFlapOptions($flapOptions) { $this->flapOptions = $flapOptions; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFlapOptions()\n {\n return $this->flapOptions;\n }", "public function setOptions()\n {\n // TODO: Implement setOptions() method.\n }", "public function setOptions($options){ }", "public function setOptions($options){ }", "public function setOptions($options)\n {\n }", "public function setOptions($options);", "public function setOptions($options);", "function setOptions(array $options = array(), $force = false);", "function setOptions($value) {\n $this->options = $value;\n }", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions($var) {}", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions($options):void;", "public function setOptions(array $options = []);", "public function setOptions($value);", "function setOptions ($options)\n\t{\n\t\t$this->options = $options;\n\t}" ]
[ "0.6585958", "0.5715403", "0.566543", "0.566543", "0.5646773", "0.5614168", "0.5614168", "0.559193", "0.55621964", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5555316", "0.5527772", "0.5527772", "0.5511212", "0.550724", "0.548918", "0.5488648" ]
0.7737652
0
\fn static public function PlatformIDToName($platformID) \param int $platformID The platform identifier number. \see $platformID \brief Convert platformID to string Convert the platform identifier (int) to a human readable string. \return string The readable platform identifier
static public function PlatformIDToName($platformID) { switch($platformID) { case 0: return '80x86'; case 1: return 'Power PC'; case 2: return 'Mac'; } return 'ID inconnu: ' . $platformID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function useridToName(int $id): string {\n $connection = SqlConnection::get(\"e621\");\n $statement = $connection->prepare(\"SELECT user_name from users WHERE user_id = :userid\");\n $statement->bindValue(\"userid\", $id);\n $statement->execute();\n $result = $statement->fetchColumn(0);\n return $result !== false ? $result : \"\";\n }", "public static function toName(int $value) : string\n {\n if (array_key_exists($value, self::NAMES)) {\n return self::NAMES[$value];\n }\n return self::NAMES[self::UNKNOWN];\n }", "function platform_name()\n\t{\n\t\tglobal $db;\n\n\t\tif ($this->platformID && !strlen($this->platform_name))\n\t\t{\n\t\t\t$sql = \"SELECT pla_name FROM platforms WHERE pla_platformID=$this->platformID\";\n\t\t\t$result = mysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\n\t\t\tif (mysql_num_rows($result))\n\t\t\t{\n\t\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t\t$this->platform_name = $row['pla_name'];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->platform_name;\n\t}", "public static function logtypeid2name($id)\n {\n # Various OC sites use different English names, even for primary\n # log types. OKAPI needs to have them the same across *all* OKAPI\n # installations. That's why all known types are hardcoded here.\n # These names are officially documented and may never change!\n\n # Primary.\n if ($id == 1) return \"Found it\";\n if ($id == 2) return \"Didn't find it\";\n if ($id == 3) return \"Comment\";\n if ($id == 7) return \"Attended\";\n if ($id == 8) return \"Will attend\";\n\n # Other.\n if ($id == 4) return \"Moved\";\n if ($id == 5) return \"Needs maintenance\";\n if ($id == 6) return \"Maintenance performed\";\n if ($id == 9) return \"Archived\";\n if ($id == 10) return \"Ready to search\";\n if ($id == 11) return \"Temporarily unavailable\";\n if ($id == 12) return \"OC Team comment\";\n if ($id == 13 || $id == 14) return \"Locked\";\n\n # Important: This set is not closed. Other types may be introduced\n # in the future. This has to be documented in the public method\n # description.\n\n return \"Comment\";\n }", "private function convertCode() {\n switch ($this->platform_code) {\n case self::PLATFORM_CODE_XBOX:\n $this->platform_name = self::PLATFORM_NAME_XBOX;\n break;\n case self::PLATFORM_CODE_PLAYSTATION:\n $this->platform_name = self::PLATFORM_NAME_PLAYSTATION;\n break;\n case self::PLATFORM_CODE_PC:\n $this->platform_name = self::PLATFORM_NAME_PC;\n break;\n default:\n $this->platform_name = \"Unknown {$this->platform_code}\";\n }\n }", "function getProdNameFromID($prodID)\n\t{\n\t\t$_SESSION['debug_info'] .= \"<p>Getting product name from ID $prodID @ database.php</p>\\n\";\n\t\t$q = \"SELECT products.name AS productName FROM products WHERE products.id = $prodID\";\n\t\t$result = mysql_query($q);\n\t\t\n\t\t$_SESSION['debug_info'] .= \"<p><code>$q</code></p>\\n\";\n\t\tif(!$result)\n\t\t{\n\t\t\t$_SESSION['debug_info'] .= \"<p>Could not find product name</p>\\n\";\n\t\t\treturn \"product not found\";\n\t\t}\n\t\t$dbArray = mysql_fetch_assoc($result);\n\t\tif(empty($dbArray['productName']))\n\t\t{\n\t\t\treturn \"product #$prodID has no name\";\n\t\t}\n\t\t\n\t\treturn $dbArray['productName'];\n\t\t\n\t\t \n\t}", "public static function nameByID($roundID=0)\n {\n $roundName = \"\";\n if($roundID > 0)\n {\n try \n {\n $round = Round::find($roundID);\n $roundName = $round->name;\n } \n catch (ModelNotFoundException $e) \n {\n Log::error(\"The round ` $roundID ` does not exist: \". $e->getMessage());\n }\n }\n\n return $roundName;\n }", "public function classIndexToName(int $classID) : string\n {\n return $this->classes[$classID];\n }", "public static function asString(int $value) : string\n {\n if (array_key_exists($value, self::NAMES)) {\n return self::NAMES[$value];\n }\n return self::NAMES[self::UNKNOWN];\n }", "public function getPlatformName() {\n return $this->platformName;\n }", "public function idToName($id): string\n {\n return $this->cache->get(\n $this->getCacheKey($id),\n function (ItemInterface $item) use ($id) {\n $item->expiresAfter(new DateInterval('PT10M'));\n\n return $this->doIdToName($id);\n }\n );\n }", "public function toName();", "public function getNameByID(int $id): string\n {\n $this->createPDO('select');\n $this->PDOLink->setCommand('SELECT name FROM author where id = ?');\n $this->PDOLink->setValues($id);\n $this->PDOLink->setFetchType('fetch');\n $result = $this->PDOLink->execute();\n return $result['name'];\n }", "public static function getNameFromId( int $id ): ?string\n\t{\n\t\t$value = DatabaseManager::plainBuilder()\n\t\t\t->from( TemplatePackages_SchemeDesigner::getTableName() )\n\t\t\t->where( \"id\", $id )\n\t\t\t->value( \"name\" );\n\n\t\treturn is_string( $value ) ? $value : null;\n\t}", "public function getImageName(string $imageId): string {\n return substr($imageId, 14);\n }", "function _get_name($fedid)\n {\n $src = $this->_ldap_search('uid=' . $fedid);\n return array_key_exists($fedid, $src) ? $src[$fedid] : '';\n }", "public function getPlatformId() : string;", "public static function getName($int)\n {\n $names = self::getAllNames();\n\n return array_key_exists($int, $names) ? $names[$int] : null;\n }", "public static function ToName($value){\n\t\tswitch($value){\n\t\t\tcase self::Song: return 'Song';\n\t\t\tcase self::Source: return 'Source';\n\t\t \tcase self::Edit: return 'edit';\n\t\t\tcase self::Reindex: return 'Reindex';\n\t\t\tcase self::Login: return 'Login';\n\t\t\tcase self::Logout: return 'Logout';\n\t\t\tcase self::AjaxNewSong: return 'AjaxNewSong';\n\t\t\tcase self::AjaxUpdateSong: return 'AjaxUpdateSong';\n\t\t}\n\t\treturn 'Songbook';\n\t}", "protected function getCustomerName(int $id): string\n {\n try {\n\n /** @var Result $result */\n $result = $this->resultRepository->getById($id);\n return $result->getCustomerName();\n } catch (Exception $exception) {\n return '';\n }\n }", "public function GetBrandName( $BrandID ) {\n $whereCondition = array(\"ID\" => $BrandID,\"Status\"=>1);\n $this->db->select( 'Name' );\n $this->db->from( 'brands' );\n $this->db->where( $whereCondition );\n $query = $this->db->get();\n $query = $query->result();\n return $query[0]->Name;\n }", "private function getSeverityName(int $severity): string {\n $severityName = [\n 1 => $this->t('Error'),\n 2 => $this->t('Warning'),\n 3 => $this->t('Changed'),\n 4 => $this->t('Skipped'),\n ];\n\n return $severityName[$severity] ?? '';\n }", "public function getProjectName(string $projectId) {\n if (empty($projectId)) {\n return '';\n }\n\n $project = $this->client->projectGet($projectId);\n\n if (empty($project)) {\n return '';\n }\n\n return $project->name;\n }", "public static function getSocialName($snId = ''){\n\n $snId = explode('_', $snId);\n return (!empty($snId)) ? array_shift($snId) : '';\n }", "public function getChannelName($channelId) {\n if ($channelId != 0) {\n $channel = new channel(null, $channelId);\n \n return getConst($channel->title);\n } else\n return '~';\n }", "public function getNameById($id)\n\t{\n\t\t$name = 'root';\n\t\tif($id != 0)\n\t\t{\n\t\t\t$group = CatalogGroup::model()->findByPk($id);\n\t\t\t$name = $group->name;\n\t\t}\n\t\treturn $name;\n\t}", "public function getKeyPlatform(): string\n {\n return $this->platformKey ?: 'unknown';\n }", "public static function cache_type_id2name($id)\n {\n static $reversed = null;\n if ($reversed == null)\n {\n $reversed = array();\n foreach (self::$cache_types[Settings::get('OC_BRANCH')] as $key => $value)\n $reversed[$value] = $key;\n }\n if (isset($reversed[$id]))\n return $reversed[$id];\n return \"Other\";\n }", "public function get_formatted_name() : string {\n $context = $this->get_handler()->get_configuration_context();\n return format_string($this->get('name'), true, ['context' => $context]);\n }", "public function platform() : string\n {\n return $this->game->trophyTitlePlatfrom;\n }" ]
[ "0.6209496", "0.60345346", "0.5990458", "0.5859772", "0.56467605", "0.5571519", "0.5489775", "0.5486699", "0.54762566", "0.5450415", "0.53821", "0.5380893", "0.5366042", "0.5346589", "0.52949405", "0.5265909", "0.5207521", "0.51476514", "0.510391", "0.5093294", "0.5084366", "0.5084266", "0.50763476", "0.5036886", "0.5036796", "0.5002513", "0.5000413", "0.49901718", "0.49841362", "0.4983572" ]
0.91770905
0
\fn public function IsValid() \brief Check is this validation entry is 'valid' Check all the member's of the "validation entry" The \a $header, \a $key1 and \a $key2 param and also the \a $cheksum value \see $header \see $checksum \see $key1 \see $key2 \todo Implemente the checksum validation algo... \return boolean true OR false
public function IsValid() { if($this->header != 0x01 || $this->key1 != 0x55 || $this->key2 != 0xaa) { return false; } /* $word = 0; $len = strlen($this->manufacturerID); for($i = 0 ; $i < $len ; $i += 2) { $word += (int)hexdec(dechex(ord($this->manufacturerID[$i + 0])) . dechex(ord($this->manufacturerID[$i + 1]))); } */ return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valid()\n {\n\n if ($this->container['line1'] === null) {\n return false;\n }\n if (strlen($this->container['line1']) > 200) {\n return false;\n }\n if (strlen($this->container['line2']) > 200) {\n return false;\n }\n if ($this->container['city'] === null) {\n return false;\n }\n if (strlen($this->container['city']) > 50) {\n return false;\n }\n if ($this->container['state'] === null) {\n return false;\n }\n if (strlen($this->container['state']) > 50) {\n return false;\n }\n if ($this->container['postal_code'] === null) {\n return false;\n }\n if (strlen($this->container['postal_code']) > 15) {\n return false;\n }\n if ($this->container['country'] === null) {\n return false;\n }\n if (strlen($this->container['country']) > 2) {\n return false;\n }\n if (strlen($this->container['country']) < 2) {\n return false;\n }\n if (strlen($this->container['first_name']) > 200) {\n return false;\n }\n return true;\n }", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function entryIsValid(){\r\n \r\n $this->setEmail();\r\n $this->setTitle();\r\n $this->setAddress();\r\n $this->setContent();\r\n $this->setPhone();\r\n $this->setUser_id();\r\n \r\n \r\n \r\n \r\n return ( count($this->errors) ? false : true );\r\n }", "public function isValid()\n {\n return ($this->getDbFileHash() == $this->sourceHash);\n }", "private function isValid()\n {\n $data = $this->getFilteredData();\n $logger = $this->container['logger'];\n\n $requestDataSignature = array(\n \"customerName\" => array(\"required\" => 1, \"type\" => \"string\"),\n \"customerAddress\" => array(\"required\" => 1, \"type\" => \"string\"),\n \"customerZip\" => array(\"required\" => 1, \"type\" => \"string\"),\n \"customerCountry\" => array(\"required\" => 1, \"type\" => \"string\"),\n \"customerPhone\" => array(\"required\" => 1, \"type\" => \"string\"),\n \"paymentCardType\" => array(\"required\" => 1, \"type\" => \"string\"),\n \"paymentCardName\" => array(\"required\" => 1, \"type\" => \"string\"),\n \"paymentCardNumber\" => array(\"required\" => 1, \"type\" => \"int\"),\n \"paymentCardExpMonth\" => array(\"required\" => 1, \"type\" => \"int\"),\n \"paymentCardExpYear\" => array(\"required\" => 1, \"type\" => \"int\"),\n \"paymentCardCvv\" => array(\"required\" => 1, \"type\" => \"int\"),\n \"orderTotal\" => array(\"required\" => 0, \"type\" => \"float\" ),\n \"orderDiscount\" => array(\"required\" => 0, \"type\" => \"float\" ),\n \"orderCouponApplied\" => array(\"required\" => 0, \"type\" => \"string\")\n );\n \n try {\n $validatedData = $this->model->validateData($data, $requestDataSignature);\n } catch(\\Exception $e) {\n $this->errorCode = \"INVALID_INPUT\";\n return false;\n }\n\n if (!preg_match(\"/^[a-zA-Z ]{3,50}$/\", $data['customerName'])) {\n $logger::warning(\"Invalid shipment name for checkout action\");\n $this->errorCode = 'INVALID_INPUT_SHIP_NAME';\n return false;\n }\n\n if (!preg_match(\"/^[-a-zA-Z0-9(),\\\\. ]{10,500}$/\", $data['customerAddress'])) {\n $logger::warning(\"Invalid shipment address for checkout action\");\n $this->errorCode = 'INVALID_INPUT_SHIP_ADDR';\n return false;\n }\n\n if (!preg_match(\"/^[-a-zA-Z0-9() ]{5,10}$/\", $data['customerZip'])) {\n $logger::warning(\"Invalid shipment zip code for checkout action\");\n $this->errorCode = 'INVALID_INPUT_SHIP_ZIP';\n return false;\n }\n\n if (!preg_match(\"/^[A-Z]{2}$/\", $data['customerCountry'])) {\n $logger::warning(\"Invalid shipment country code for checkout action\");\n $this->errorCode = 'INVALID_INPUT_SHIP_CNTRY';\n return false;\n }\n\n if (!preg_match(\"/^[0-9-()]{6,15}$/\", $data['customerPhone'])) {\n $logger::warning(\"Invalid shipment phone number for checkout action\");\n $this->errorCode = 'INVALID_INPUT_SHIP_PHNO';\n return false;\n }\n\n if (!preg_match(\"/^[a-z]{3,12}$/\", $data['paymentCardType'])) {\n $logger::warning(\"Invalid card type for checkout action\");\n $this->errorCode = 'INVALID_INPUT_CARD_TYPE';\n return false;\n }\n \n if (!preg_match(\"/^[a-zA-Z ]{3,50}$/\", $data['paymentCardName'])) {\n $logger::warning(\"Invalid card name for checkout action\");\n $this->errorCode = 'INVALID_INPUT_CARD_NAME';\n return false;\n }\n \n if (!preg_match(\"/^\\d{13,20}$/\", $data['paymentCardNumber'])) {\n $logger::warning(\"Invalid card type for checkout action\");\n $this->errorCode = 'INVALID_INPUT_CARD_NO';\n return false;\n }\n \n if (!preg_match(\"/^[0-9]{1,2}$/\", $data['paymentCardExpMonth'])) {\n $logger::warning(\"Invalid card expiry month for checkout action\");\n $this->errorCode = 'INVALID_INPUT_CARD_EXP_MM';\n return false;\n }\n \n if (!preg_match(\"/^[0-9]{2}$/\", $data['paymentCardExpYear'])) {\n $logger::warning(\"Invalid card expiry year for checkout action\");\n $this->errorCode = 'INVALID_INPUT_CARD_EXP_YY';\n return false;\n }\n \n if (!preg_match(\"/^[0-9]{3,4}$/\", $data['paymentCardCvv'])) {\n $logger::warning(\"Invalid card CVV for checkout action\");\n $this->errorCode = 'INVALID_INPUT_CARD_EXP_CVV';\n return false;\n }\n \n if (isset($data['orderCouponApplied'])) {\n\n if (!preg_match(\"/^[A-Z0-9]{3,20}$/\", $data['orderCouponApplied'])) {\n $logger::warning(\"Invalid coupon code applied checkout action\");\n $this->errorCode = 'INVALID_INPUT_ORDER_COUPON_CODE';\n return false;\n }\n }\n return true;\n }", "public function valid()\n {\n if (strlen($this->container['country']) > 2) {\n return false;\n }\n if (strlen($this->container['country']) < 2) {\n return false;\n }\n if (strlen($this->container['zip']) > 20) {\n return false;\n }\n if (strlen($this->container['zip']) < 1) {\n return false;\n }\n if (strlen($this->container['street']) > 100) {\n return false;\n }\n if (strlen($this->container['street']) < 1) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if (strlen($this->container['acquirerMerchantId']) > 15) {\n return false;\n }\n if (strlen($this->container['acquirerBin']) > 11) {\n return false;\n }\n if (strlen($this->container['retrievalReferenceNumber']) > 12) {\n return false;\n }\n if (strlen($this->container['accountFundingReferenceId']) > 15) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n $key = key($this->data);\n return $key !== null && $key !== false;\n }", "public function valid()\n {\n\n if ($this->container['timestamp'] === null) {\n return false;\n }\n if ($this->container['productcode'] === null) {\n return false;\n }\n if ($this->container['dutchname'] === null) {\n return false;\n }\n if ($this->container['numberperorder'] === null) {\n return false;\n }\n if ($this->container['purchaseprice'] === null) {\n return false;\n }\n if ($this->container['description'] === null) {\n return false;\n }\n if ($this->container['images'] === null) {\n return false;\n }\n if ($this->container['category'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['carrier'] === null) {\n return false;\n }\n if ($this->container['account_no'] === null) {\n return false;\n }\n if ($this->container['account_name'] === null) {\n return false;\n }\n if ($this->container['billing_company'] === null) {\n return false;\n }\n if ($this->container['street1'] === null) {\n return false;\n }\n if ($this->container['city'] === null) {\n return false;\n }\n if ($this->container['country'] === null) {\n return false;\n }\n if ($this->container['zip_code'] === null) {\n return false;\n }\n if ($this->container['active'] === null) {\n return false;\n }\n return true;\n }", "public function valid( )\n {\n //Deault return value\n $valid = FALSE;\n \n //Check the current key\n $key = key( $this->line_segments );\n\n //Type check truth of key\n if( $key !== NULL && $key !== FALSE )\n {\n $valid = TRUE;\n }\n \n //Return whether the key is valid\n return( $valid );\n }", "public function areChecksumsValid(array $idList, $checksum);", "abstract public function isValid();", "public function hasValidData(){\n return ($this->hasEmergencyCase() && $this->hasDistraction() && $this->hasMaxim()); \n }", "public function isValid()\n\t{\n\t\t$this->parseLicenseFile();\n\n\t\tif (empty($this->data))\n\t\t{\n\t\t\tif ( ! isset($this->errors['missing_license']))\n\t\t\t{\n\t\t\t\t$this->errors['corrupt_license_file'] = \"The license is missing its data.\";\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$valid = $this->signatureIsValid();\n\n\t\tif ( ! $valid)\n\t\t{\n\t\t\t$this->errors['invalid_signature'] = \"The license file has been tampered with\";\n\t\t}\n\n\t\treturn $valid;\n\t}", "public function valid()\n {\n if ($this->container['delay'] === null) {\n return false;\n }\n if ($this->container['delivery_report_id'] === null) {\n return false;\n }\n if ($this->container['date_received'] === null) {\n return false;\n }\n if ($this->container['message_id'] === null) {\n return false;\n }\n if ($this->container['source_number'] === null) {\n return false;\n }\n if (strlen($this->container['source_number']) > 15) {\n return false;\n }\n if (strlen($this->container['source_number']) < 1) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['username'] === null) {\n return false;\n }\n return true;\n }", "public function isValid(){\n\n\t\t$rules = $this->getRules();\n\t\t$validacion = \\Validator::make($this->data, $rules);\n\t\t$isValid = $validacion->passes();\t\t\n\t\t$this->errors = $validacion->messages();\t\t\t\t\n\t\treturn $isValid;\n\t}", "public function valid()\n {\n\n if ($this->container['address_city'] === null) {\n return false;\n }\n if ($this->container['address_number'] === null) {\n return false;\n }\n if ($this->container['address_postal_code'] === null) {\n return false;\n }\n if ($this->container['address_state'] === null) {\n return false;\n }\n if ($this->container['address_street'] === null) {\n return false;\n }\n if ($this->container['brand'] === null) {\n return false;\n }\n if ($this->container['cpf'] === null) {\n return false;\n }\n if ($this->container['crt'] === null) {\n return false;\n }\n if ($this->container['email'] === null) {\n return false;\n }\n if ($this->container['ie'] === null) {\n return false;\n }\n if ($this->container['mobile_phone'] === null) {\n return false;\n }\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['password'] === null) {\n return false;\n }\n return true;\n }", "function validate($valid) {\n\t$ip = $_SERVER['SERVER_ADDR'];\n\t$key = md5( ip2long($ip));\n\t//echo $key;\n\tif ($key == $valid['key']) {\n\t\treturn true;\n\t}\n\treturn false;\n}" ]
[ "0.6212437", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.60072887", "0.5955242", "0.58500683", "0.58421344", "0.58404034", "0.58359283", "0.58187777", "0.5793179", "0.5788675", "0.5784928", "0.5769185", "0.57668406", "0.57645816", "0.5724474", "0.57174885", "0.57159364", "0.5709098", "0.5699012" ]
0.65650976
0
For the hosted platform, we restrict the feature settings. This method will trim the company settings object down to the free plan setting properties which are saveable
private function filterSaveableSettings($settings) { $account = $this->client->company->account; if (! $account->isFreeHostedClient()) { return $settings; } $saveable_casts = CompanySettings::$free_plan_casts; foreach ($settings as $key => $value) { if (! array_key_exists($key, $saveable_casts)) { unset($settings->{$key}); } } return $settings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function modifyCustomSettings($objSettings){\r\n\t\t\r\n\t\t$objSettings = HelperProviderUC::modifyGeneralSettings_memoryLimit($objSettings);\r\n\t\t\r\n\t\treturn($objSettings);\r\n\t}", "private function sanitize_settings()\n\t{\n\t\tforeach (array_keys($this->settings) as $k) { // iterator safe\n\t\t\t$v = $this->settings[$k];\n\t\t\tswitch ($k) {\n\t\t\t\tcase 'CommentAge':\n\t\t\t\tcase 'CommentAgePopular':\n\t\t\t\tcase 'PopularityThreshold':\n\t\t\t\t\t$this->settings[$k] = (int) $v;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'AllowOverride':\n\t\t\t\tcase 'DoPages':\n\t\t\t\t\t$this->settings[$k] = (bool) $v;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DoPings':\n\t\t\t\t\tif ('ignore' !== $v && 'independent' !== $v && 'together' !== $v) {\n\t\t\t\t\t\t$this->settings[$k] = 'together';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Mode':\n\t\t\t\t\t$v = (string) $v;\n\t\t\t\t\tif ($v != 'moderate') {\n\t\t\t\t\t\t$this->settings['Mode'] = 'close';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DisplayTimeout':\n\t\t\t\t\t$v = (string) $v;\n\t\t\t\t\tif ($v !== 'absolute' && $v !== 'relative' && $v !== 'off') {\n\t\t\t\t\t\t$this->settings['DisplayTimeout'] = 'absolute';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'GlobalClose':\n\t\t\t\tcase 'GlobalReopen':\n\t\t\t\t\t$this->settings[$k] = $this->parse_date($v);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunset ($this->settings[$k]);\n\t\t\t}\n\t\t}\n\t}", "function checkSettings()\n\t{\n\t\t// trim any spaces\n\t\t$this->merchant['account_id'] \t= \ttrim($this->merchant['account_id']);\n\t\t$this->merchant['site_id'] \t= \ttrim($this->merchant['site_id']);\n\t\t$this->merchant['site_code'] \t= \ttrim($this->merchant['site_code']);\n\t}", "function adminUpdatePricePlanSettings($vars)\n {\n $db = true;\n include(GEO_BASE_DIR . 'get_common_vars.php');\n\n $price_plan_id = $vars['price_plan_id'];\n $category = $vars['category'];\n\n if (!$db->get_site_setting('paypal_allow_sb')) {\n return true; //main setting turned off, nothing to save...\n }\n\n if (PHP5_DIR) {\n $menu_loader = geoAdmin::getInstance();\n } else {\n $menu_loader =& geoAdmin::getInstance();\n }\n\n $sb = geoSellerBuyer::getInstance();\n\n //BIDPAY - save settings\n if (isset($_POST['paypal_allow_sb']) && $_POST['paypal_allow_sb']) {\n $sb->setPlanSetting($price_plan_id, $category, 'paypal_allow_sb', true);\n\n return true;\n }\n //un-checked, turn off\n $sb->setPlanSetting($price_plan_id, $category, 'paypal_allow_sb', false);\n return true;\n }", "function cp_upgrade_settings_330() {\n\tglobal $wpdb, $cp_options;\n\n\t$new_options = array();\n\t$options_to_delete = array();\n\n\t// fields to convert from select 'yes/no' to checkbox\n\t$select_fields = array(\n\t\t'allow_registration_password',\n\t\t'use_logo',\n\t\t'search_ex_pages',\n\t\t'search_ex_blog',\n\t\t'search_custom_fields',\n\t\t'ad_edit',\n\t\t'allow_relist',\n\t\t'ad_inquiry_form',\n\t\t'allow_html',\n\t\t'ad_stats_all',\n\t\t'ad_gravatar_thumb',\n\t\t'post_prune',\n\t\t'ad_images',\n\t\t'ad_image_preview',\n\t\t'captcha_enable',\n\t\t'adcode_468x60_enable',\n\t\t'adcode_336x280_enable',\n\t\t'disable_stylesheet',\n\t\t'debug_mode',\n\t\t'google_jquery',\n\t\t'disable_wp_login',\n\t\t'remove_wp_generator',\n\t\t'remove_admin_bar',\n\t\t'display_website_time',\n\t\t'cufon_enable',\n\t\t'new_ad_email',\n\t\t'prune_ads_email',\n\t\t'new_ad_email_owner',\n\t\t'expired_ad_email_owner',\n\t\t'nu_admin_email',\n\t\t'membership_activated_email_owner',\n\t\t'membership_ending_reminder_email',\n\t\t'nu_custom_email',\n\t\t'charge_ads',\n\t\t'enable_featured',\n\t\t'clean_price_field',\n\t\t'force_zeroprice',\n\t\t'hide_decimals',\n\t\t'enable_membership_packs',\n\t);\n\n\t// fields to translate\n\t$fields_to_translate = array(\n\t\t'cp_curr_pay_type' => 'currency_code',\n\t\t'cp_curr_symbol_pos' => 'currency_position',\n\t);\n\n\t// legacy settings\n\t$legacy_options = $wpdb->get_results( \"SELECT * FROM $wpdb->options WHERE option_name LIKE 'cp_%'\" );\n\n\tif ( ! $legacy_options )\n\t\treturn;\n\n\tforeach ( $legacy_options as $option ) {\n\t\t$new_option_name = substr( $option->option_name, 3 );\n\n\t\t// grab price per category options into an array\n\t\t$is_cat_price = appthemes_str_starts_with( $new_option_name, 'cat_price_' );\n\t\tif ( $is_cat_price ) {\n\t\t\t$cat_id = substr( $new_option_name, 10 );\n\t\t\t$new_options['price_per_cat'][ $cat_id ] = $option->option_value;\n\t\t\t$options_to_delete[] = $option->option_name;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// translate old payment settings to new one\n\t\tif ( array_key_exists( $option->option_name, $fields_to_translate ) ) {\n\t\t\t$new_options[ $fields_to_translate[ $option->option_name ] ] = $option->option_value;\n\t\t\t$options_to_delete[] = $option->option_name;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// skip not used options and membership entries\n\t\tif ( is_null( $cp_options->$new_option_name ) || $new_option_name == 'options' )\n\t\t\tcontinue;\n\n\t\t// convert select 'yes/no' to checkbox\n\t\tif ( in_array( $new_option_name, $select_fields ) )\n\t\t\t$option->option_value = ( $option->option_value == 'yes' ) ? 1 : 0;\n\n\t\t$new_options[ $new_option_name ] = maybe_unserialize( $option->option_value );\n\t\t$options_to_delete[] = $option->option_name;\n\t}\n\n\t// migrate payment gateways settings\n\t$gateways = array(\n\t\t'enabled' => array(\n\t\t\t'paypal' => ( get_option('cp_enable_paypal') == 'yes' ) ? 1 : 0,\n\t\t\t'bank-transfer' => ( get_option('cp_enable_bank') == 'yes' ) ? 1 : 0,\n\t\t),\n\t\t'paypal' => array(\n\t\t\t'email_address' => get_option('cp_paypal_email'),\n\t\t\t'ipn_enabled' => ( get_option('cp_enable_paypal_ipn') == 'yes' ) ? 1 : 0,\n\t\t\t'sandbox_enabled' => ( get_option('cp_paypal_sandbox') ) ? 1 : 0,\n\t\t),\n\t\t'bank-transfer' => array(\n\t\t\t'message' => get_option('cp_bank_instructions'),\n\t\t),\n\t);\n\t$new_options['gateways'] = $gateways;\n\t$options_to_delete = array_merge( $options_to_delete, array( 'cp_enable_paypal', 'cp_enable_bank', 'cp_paypal_email', 'cp_enable_paypal_ipn', 'cp_paypal_sandbox', 'cp_bank_instructions' ) );\n\n\t// enable selectbox js for those, which updating\n\t$new_options['selectbox'] = 1;\n\t// save new options\n\t$new_options = array_merge( get_option( 'cp_options', array() ), $new_options );\n\tupdate_option( 'cp_options', $new_options );\n\n\t// delete old options\n\tforeach ( $options_to_delete as $option_name ) {\n\t\tdelete_option( $option_name );\n\t}\n}", "public function prepSettings($settings)\n\t{\n\t\tcraft()->courier_deliveries->enforceDeliveriesLimit($settings['deliveriesRecordLimit']);\n\n\t\treturn $settings;\n\t}", "public function actionPlatformSettings()\n {\n\n $mainApprovementSettings = ProposalApprovementSetting::findOne([\n 'id' => ProposalApprovementSetting::MAIN_SETTING]);\n $proposalApprovementSettingFormModel = new ProposalApprovementSettingForm();\n\n if ($proposalApprovementSettingFormModel->load(\\Yii::$app->request->post())\n && $proposalApprovementSettingFormModel->validate()) {\n $mainApprovementSettings->approvement_percent = $proposalApprovementSettingFormModel->approvement_percent;\n $mainApprovementSettings->required_review = $proposalApprovementSettingFormModel->required_review;\n\n if (!$mainApprovementSettings->save()) {\n throw new CannotSaveException($mainApprovementSettings);\n }\n }\n\n $proposalApprovementSettingFormModel->required_review = $mainApprovementSettings->required_review;\n $proposalApprovementSettingFormModel->approvement_percent = $mainApprovementSettings->approvement_percent;\n $socialMediasDataProvider = new ActiveDataProvider([\n 'query' => EnabledSocialMedia::find(),\n 'pagination' => [\n 'pageSize' => 10,\n ],\n ]);\n\n return $this->render('platform-settings', [\n 'socialMediasDataProvider' => $socialMediasDataProvider,\n 'proposalApprovementSettingFormModel' => $proposalApprovementSettingFormModel\n ]);\n }", "public function remove_uabb_global_setting() {\r\n\t\t\treturn false;\r\n\t\t}", "public function adminUpdateSettings()\n {\n $db = DataAccess::getInstance();\n $sb = geoSellerBuyer::getInstance();\n\n //paypal - save settings\n\n\n $go_ahead = (isset($_POST['paypal_allow_sb']) && $_POST['paypal_allow_sb']) ? 1 : false;\n\n\n //check inputs\n\n if ($go_ahead && !$db->get_site_setting('paypal_allow_sb')) {\n $sb->initTableStructure();//make sure table structure is initialized.\n //turn on paypal for all price plans\n $plans = $this->_getAuctionPricePlans();\n foreach ($plans as $plan_id) {\n //set main price plan default settings\n $sb->setDefaultPlanSettings($plan_id, 0, array('paypal_allow_sb' => true));\n\n //get any cat price plans for this price plan, and set default settings\n $cat_plans = $this->_getAuctionPricePlans($plan_id);\n foreach ($cat_plans as $cat_plan_id) {\n //set cat price plan default settings\n $sb->setDefaultPlanSettings(0, $cat_plan_id, array('paypal_allow_sb' => true));\n }\n }\n }\n $db->set_site_setting('paypal_allow_sb', $go_ahead);\n\n $db->set_site_setting('pp_chain_enable', $_POST['pp_chain_enable']);\n $db->set_site_setting('pp_chain_partner', $_POST['pp_chain_partner']);\n $db->set_site_setting('pp_chain_username', $_POST['pp_chain_username']);\n $db->set_site_setting('pp_chain_password', $_POST['pp_chain_password']);\n $db->set_site_setting('pp_chain_signature', $_POST['pp_chain_signature']);\n $db->set_site_setting('pp_chain_appid', $_POST['pp_chain_appid']);\n\n\n $sitePP = $_POST['pp_chain_site_recipient'];\n if ($sitePP && !$sb->getUserSetting($sitePP, 'paypal_id')) {\n geoAdmin::m('Selected user is not a valid user OR does NOT have a registered paypal email', geoAdmin::ERROR);\n }\n\n $db->set_site_setting('pp_chain_site_recipient', $_POST['pp_chain_site_recipient']);\n\n return true;\n }", "function monsterinsights_settings_save_support() {\n\n}", "public function sanitize_settings( $settings ) {\n\t\n\t\t$settings['prod_or_sandbox']\t= ( 'prod'==$settings['prod_or_sandbox']?'prod':'sandbox' );\n\t\t$settings['sand_client_id']\t\t= sanitize_text_field( $settings['sand_client_id'] );\n\t\t$settings['sand_passphrase']\t= sanitize_text_field( $settings['sand_passphrase'] );\n\t\treturn $settings;\n\t}", "private function get_setting() {\r\n $approve_flag = $this->clean_setting('approve_flag');\r\n $approve = $this->setting->get_element_value('pf_comment','approve');\r\n if (is_array($approve) && in_array(current_user('user-id'), $approve)) {\r\n $approve_flag = 0;\r\n }\r\n $this->settings = array(\r\n 'approve_flag' => $approve_flag,\r\n 'ordering' => $this->clean_setting('ordering'),\r\n 'maximum_characters' => $this->clean_setting('maximum_characters', 255),\r\n 'maximum_level' => $this->clean_setting('maximum_level', 5),\r\n 'approve' => $approve,\r\n 'site_name' => $this->setting->get_element_value('general', 'site_name'),\r\n 'email' => noreply_email(),\r\n );\r\n }", "function load_settings_extras(){\n\t\tif( has_filter( 'siteorigin_page_settings' ) ) {\n\t\t\tSiteOrigin_Settings_Page_Settings::single();\n\t\t}\n\n\t\tif( has_filter( 'siteorigin_settings_font_settings' ) ) {\n\t\t\tSiteOrigin_Settings_Webfont_Manager::single();\n\t\t}\n\n\t\tif( is_admin() && has_filter( 'siteorigin_about_page' ) && apply_filters( 'siteorigin_about_page_show', true ) ) {\n\t\t\tSiteOrigin_Settings_About_Page::single();\n\t\t}\n\t}", "function Deactivate() {\r\n\t\t\t# Cleanup data\r\n\t\t\tif (get_option(c_pwa_option_clean) == 'TRUE') {\r\n\t\t\t\tglobal $wpdb;\r\n\t\t\t\t# Delete options\r\n\t\t\t\t$rows = $wpdb->get_results(\"SELECT option_name FROM \" . $wpdb->options . \" WHERE option_name LIKE 'pwaplusphp_%'\");\r\n\t\t\t\tforeach ($rows as $row)\r\n\t\t\t\t\tdelete_option($row->option_name);\r\n\t\t\t}\r\n\r\n\t\t}", "function bbp_admin_settings()\n{\n}", "function wlms_settings_manage_page_content()\n{\n if( isset($_GET['post']) && $_GET['post'] === 'wlms_global_settings' && isset($_POST['wlms_setting_save']) )\n {\n $nonce = $_REQUEST['_wpnonce'];\n if ( ! wp_verify_nonce( $nonce, 'submit_settings_data' ) ) \n {\n exit; \n }\n \n $save_settings = array(\n 'institute_name' => $_POST['wlms_institute_name'],\n 'institute_address' => $_POST['wlms_institute_address'],\n 'phone_number' => $_POST['wlms_institute_phone'],\n 'email' => $_POST['wlms_institute_email'],\n 'currency' => $_POST['inputCurrency'],\n 'terms_and_conditions' => $_POST['terms_and_conditions'],\n 'member_roles' => $_POST['member_roles_lists'],\n 'logo_url' => $_POST['wlms_logo_url']\n\n );\n update_option( 'wlms_settings', $save_settings );\n wlms_settings_page_html();\n }\n else\n {\n wlms_settings_page_html();\n } \n}", "public function feed_settings_fields() {\n\t\t$default_settings = parent::feed_settings_fields();\n\n\t\t// Remove Subscription.\n\t\t$transaction_type = parent::get_field( 'transactionType', $default_settings );\n\t\t$choices = $transaction_type['choices'];\n\t\tforeach ( $choices as $key => $choice ) {\n\t\t\tif ( $choice['value'] === 'subscription' ) {\n\t\t\t\tunset( $choices[ $key ] );\n\t\t\t}\n\t\t}\n\t\t$transaction_type['choices'] = $choices;\n\t\t$default_settings = $this->replace_field( 'transactionType', $transaction_type, $default_settings );\n\n\t\treturn $default_settings;\n\t}", "public function settingsAction() {\n\n $this->view->assign('comp_nav_settings_top', 'current');\n $this->view->assign('comp_nav_settings', 'current');\n\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n $this->view->p = $request->getPost();\n $form = new Yourdelivery_Form_Company_Settings();\n if ($form->isValid($request->getPost())) {\n\n $city = null;\n try {\n $cityCheck = Yourdelivery_Model_City::getByPlz((integer) $form->getValue('ccontactplz'));\n $contactPlz = $form->getValue('ccontactplz');\n if (is_null($cityCheck['id']) && !empty($contactPlz)) {\n $this->error(__('Diese PLZ existiert nicht'));\n $this->_redirect('/company/contact');\n }\n\n $city = new Yourdelivery_Model_City($form->getValue('cityId'));\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n $this->error(__('Diese PLZ existiert nicht'));\n $this->_redirect('/company/contact');\n }\n\n $val = $form->getValues();\n\n $val['street'] = $val['cstreet'];\n $val['hausnr'] = $val['chausnr'];\n $val['plz'] = $city->getPlz();\n $val['website'] = $val['cwebsite'];\n $val['steuerNr'] = $val['csteuerNr'];\n $val['industry'] = $val['cindustry'];\n $val['ktoName'] = $val['cktoName'];\n $val['ktoNr'] = $val['cktoNr'];\n $val['ktoBlz'] = $val['cktoBlz'];\n\n\n $this->session->company->setData($val);\n $this->session->company->save();\n $this->success(__('Daten erfolgreich gesichert!'));\n $this->_redirect('/company/settings');\n } else {\n $this->error($form->getMessages());\n }\n }\n }", "public function setOffSiteValue(): void\n {\n cache([config(\"gateway.provider_callback\") => config(\"gateway.providers.{$this->identifier()}\")],\n now()->addMinutes(30));\n cache([$this->getPaymentId() => [\n 'order' => $this->order(),\n 'data' => $this->data(),\n ]], now()->addMinutes(30));\n }", "function check_wp_settings_data( $wpp_settings, $wp_properties ) {\n if( is_array( $wpp_settings ) && is_array( $wp_properties ) ) {\n foreach( $wp_properties as $key => $value ) {\n if( !isset( $wpp_settings[ $key ] ) ) {\n switch( $key ) {\n case 'hidden_attributes':\n case 'property_inheritance':\n $wpp_settings[ $key ] = array();\n break;\n }\n }\n }\n \n if(empty($wpp_settings['configuration']['google_maps_api_server']) && !empty($wpp_settings['configuration']['google_maps_api'])){\n $wpp_settings['configuration']['google_maps_api_server'] = $wpp_settings['configuration']['google_maps_api'];\n }\n }\n\n return $wpp_settings;\n }", "function invit0r_restrict_admin()\r\n{\r\n\tif ( !current_user_can('manage_options') ) {\r\n\t\twp_die( __('You are not allowed to access this part of the site.') );\r\n\t}\r\n}", "public function alm_cta_settings() {\n\t\t\tregister_setting(\n\t\t\t\t'alm_cta_license',\n\t\t\t\t'alm_cta_license_key',\n\t\t\t\t'alm_cta_sanitize_license'\n\t\t\t);\n\t\t}", "function wcap_agile_crm_general_settings_section_callback() {\n \n }", "function wcap_agile_crm_initialize_settings_options () {\n add_settings_section(\n 'wcap_agile_crm_general_settings_section', // ID used to identify this section and with which to register options\n __( 'Agile CRM Settings', 'woocommerce-ac' ), // Title to be displayed on the administration page\n array($this, 'wcap_agile_crm_general_settings_section_callback' ), // Callback used to render the description of the section\n 'wcap_agile_crm_section' // Page on which to add this section of options\n );\n \n add_settings_field(\n 'wcap_enable_agile_crm',\n __( 'Export abandoned cart data to Agile CRM', 'woocommerce-ac' ),\n array( $this, 'wcap_enable_agile_crm_callback' ),\n 'wcap_agile_crm_section',\n 'wcap_agile_crm_general_settings_section',\n array( __( 'Enable to export the abandoned carts data to the Agile CRM.', 'woocommerce-ac' ) )\n );\n\n add_settings_field(\n 'wcap_add_automatically_to_agile_crm',\n __( 'Automatically add abandoned cart data to Agile CRM', 'woocommerce-ac' ),\n array( $this, 'wcap_add_automatically_to_agile_crm_callback' ),\n 'wcap_agile_crm_section',\n 'wcap_agile_crm_general_settings_section',\n array( __( 'When any abandoned cart record is captured on the Abandoned Orders tab, it will be automatically exported to the Agile CRM after the set time.', 'woocommerce-ac' ) )\n );\n\n add_settings_field(\n '',\n __( 'Automatically add abandoned cart data to Agile CRM after set time', 'woocommerce-ac' ),\n array( $this, 'wcap_add_automatically_add_after_time_callback' ),\n 'wcap_agile_crm_section',\n 'wcap_agile_crm_general_settings_section',\n array( __( 'Set the time after which the abandoned records will be exported automatically to the Agile CRM.', 'woocommerce-ac' ) )\n );\n\n add_settings_field(\n 'wcap_agile_user_name',\n __( 'Agile CRM Username', 'woocommerce-ac' ),\n array( $this, 'wcap_agile_user_name_callback' ),\n 'wcap_agile_crm_section',\n 'wcap_agile_crm_general_settings_section',\n array( __( 'Please provide your Agile CRM username.', 'woocommerce-ac' ) )\n );\n \n add_settings_field(\n 'wcap_agile_domain',\n __( 'Agile CRM Domain', 'woocommerce-ac' ),\n array( $this, 'wcap_agile_domain_callback' ),\n 'wcap_agile_crm_section',\n 'wcap_agile_crm_general_settings_section',\n array( __( \".agilecrm.com. Please provide your Agile CRM domain name. <br/>The domain is which you have given while creating the agile CRM account.\", 'woocommerce-ac' ) )\n );\n\n add_settings_field(\n 'wcap_agile_security_token',\n __( 'Agile CRM REST API Key', 'woocommerce-ac' ),\n array( $this, 'wcap_agile_security_token_callback' ),\n 'wcap_agile_crm_section',\n 'wcap_agile_crm_general_settings_section',\n array( __( 'Please provide your Agile CRM REST API key. <br/>Kindly, login to your Agile CRM account. On the top right of your Agile CRM dashboard page, click on your profile, then click on Admin Settings. On this page, click on API. Within the API, you will see your REST API key.', 'woocommerce-ac' ) )\n );\n\n add_settings_field(\n 'wcap_agile_test_connection',\n '',\n array( $this, 'wcap_agile_test_connection_callback' ),\n 'wcap_agile_crm_section',\n 'wcap_agile_crm_general_settings_section'\n );\n \n /******************************************/\n \n //Setting section and field for license options\n add_settings_section(\n 'agile_general_license_key_section',\n __( 'Plugin License Options', 'woocommerce-ac' ),\n array( $this, 'wcap_agile_general_license_key_section_callback' ),\n 'wcap_agile_crm_section'\n );\n \n add_settings_field(\n 'edd_sample_license_key_agile_woo',\n __( 'License Key', 'woocommerce-ac' ),\n array( $this, 'wcap_edd_sample_license_key_agile_woo_callback' ),\n 'wcap_agile_crm_section',\n 'agile_general_license_key_section',\n array( __( 'Enter your license key.', 'woocommerce-ac' ) )\n );\n \n add_settings_field(\n 'activate_license_key_ac_woo',\n __( 'Activate License', 'woocommerce-ac' ),\n array( $this, 'wcap_activate_license_key_agile_woo_callback' ),\n 'wcap_agile_crm_section',\n 'agile_general_license_key_section',\n array( __( 'Enter your license key.', 'woocommerce-ac' ) )\n );\n\n // Finally, we register the fields with WordPress\n register_setting(\n 'wcap_agile_crm_setting',\n 'wcap_enable_agile_crm'\n );\n register_setting(\n 'wcap_agile_crm_setting',\n 'wcap_add_automatically_to_agile_crm'\n );\n register_setting(\n 'wcap_agile_crm_setting',\n 'wcap_add_automatically_add_after_email_frequency'\n );\n register_setting(\n 'wcap_agile_crm_setting',\n 'wcap_add_automatically_add_after_time_day_or_hour'\n );\n\n register_setting(\n 'wcap_agile_crm_setting',\n 'wcap_agile_user_name'\n );\n register_setting(\n 'wcap_agile_crm_setting',\n 'wcap_agile_domain'\n );\n register_setting(\n 'wcap_agile_crm_setting',\n 'wcap_agile_security_token'\n );\n \n register_setting(\n 'wcap_agile_crm_setting',\n 'edd_sample_license_key_agile_woo'\n );\n }", "public function testThirdPartySettingsSchema() {\n $config = FieldConfig::loadByName('entity_test', 'entity_test', 'field_test');\n $config->setThirdPartySetting('telephone_validation', 'format', 0);\n $config->setThirdPartySetting('telephone_validation', 'country', []);\n $config->save();\n }", "protected function prepareDisplaySetting()\n {\n if ($this->fixture->hasData('landing_page')) {\n $this->fields['general']['landing_page'] = $this->getBlockId($this->fixture->getLandingPage());\n }\n\n $this->prepareAvailableSortBy();\n\n $useConfig = array_diff($this->dataUseConfig, array_keys($this->fields['general']));\n if (!empty($useConfig)) {\n $this->fields['use_config'] = $useConfig;\n }\n unset($this->fields['general']['use_config']);\n }", "public static function core_settings() {\n\t\t$core_settings = get_option( 'woocommerce_wc_checkout_com_cards_settings' );\n\t\t$nas_docs = 'https://www.checkout.com/docs/four/resources/api-authentication/api-keys';\n\t\t$abc_docs = 'https://www.checkout.com/docs/the-hub/update-your-hub-settings#Manage_the_API_keys';\n\t\t$docs_link = $abc_docs;\n\n\t\tif ( isset( $core_settings['ckocom_account_type'] ) && 'NAS' === $core_settings['ckocom_account_type'] ) {\n\t\t\t$docs_link = $nas_docs;\n\t\t}\n\n\t\t$settings = [\n\t\t\t'core_setting' => [\n\t\t\t\t'title' => __( 'Core settings', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'type' => 'title',\n\t\t\t\t'description' => '',\n\t\t\t],\n\t\t\t'enabled' => [\n\t\t\t\t'id' => 'enable',\n\t\t\t\t'title' => __( 'Enable/Disable', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable Checkout.com cards payment', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'description' => __( 'This enables Checkout.com. cards payment', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'default' => 'yes',\n\t\t\t],\n\t\t\t'ckocom_environment' => [\n\t\t\t\t'title' => __( 'Environment', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'When going to production, make sure to set this to Live', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'options' => [\n\t\t\t\t\t'sandbox' => __( 'SandBox', 'checkout-com-unified-payments-api' ),\n\t\t\t\t\t'live' => __( 'Live', 'checkout-com-unified-payments-api' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'sandbox',\n\t\t\t],\n\t\t\t'title' => [\n\t\t\t\t'title' => __( 'Payment Option Title', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => __( 'Pay by Card with Checkout.com', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'description' => __( 'Title that will be displayed on the checkout page', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'default' => 'Pay by Card with Checkout.com',\n\t\t\t],\n\t\t\t'ckocom_account_type' => [\n\t\t\t\t'title' => __( 'Account type', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'Contact support team to know your account type.', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'options' => [\n\t\t\t\t\t'ABC' => __( 'ABC', 'checkout-com-unified-payments-api' ),\n\t\t\t\t\t'NAS' => __( 'NAS', 'checkout-com-unified-payments-api' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'ABC',\n\t\t\t],\n\t\t\t'ckocom_sk' => [\n\t\t\t\t'title' => __( 'Secret Key', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t/* translators: 1: HTML anchor opening tag, 2: HTML anchor closing tag. */\n\t\t\t\t'description' => sprintf( __( 'You can %1$s find your secret key %2$s in the Checkout.com Hub', 'checkout-com-unified-payments-api' ), '<a class=\"checkoutcom-key-docs\" target=\"_blank\" href=\"' . esc_url( $docs_link ) . '\">', '</a>' ),\n\t\t\t\t'placeholder' => 'sk_xxx',\n\t\t\t],\n\t\t\t'ckocom_pk' => [\n\t\t\t\t'title' => __( 'Public Key', 'checkout-com-unified-payments-api' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t/* translators: 1: HTML anchor opening tag, 2: HTML anchor closing tag. */\n\t\t\t\t'description' => sprintf( __( 'You can %1$s find your public key %2$s in the Checkout.com Hub', 'checkout-com-unified-payments-api' ), '<a class=\"checkoutcom-key-docs\" target=\"_blank\" href=\"' . esc_url( $docs_link ) . '\">', '</a>' ),\n\t\t\t\t'placeholder' => 'pk_xxx',\n\t\t\t],\n\t\t];\n\n\t\treturn apply_filters( 'wc_checkout_com_cards', $settings );\n\t}", "function _ws_site_options_fields() {\n // General\n register_setting('site', 'disable_comments');\n register_setting('site', 'google_maps');\n\n // SEO\n register_setting('site', 'seo_meta_title');\n\n // Contact\n register_setting('site', 'site_tel');\n register_setting('site', 'site_email');\n register_setting('site', 'site_location');\n register_setting('site', 'site_location_id');\n register_setting('site', 'site_location_street');\n register_setting('site', 'site_location_city');\n register_setting('site', 'site_location_state');\n register_setting('site', 'site_location_zip');\n register_setting('site', 'site_location_country');\n register_setting('site', 'site_hours');\n register_setting('site', 'site_hours_open_sun');\n register_setting('site', 'site_hours_close_sun');\n register_setting('site', 'site_hours_open_mon');\n register_setting('site', 'site_hours_close_mon');\n register_setting('site', 'site_hours_open_tue');\n register_setting('site', 'site_hours_close_tue');\n register_setting('site', 'site_hours_open_wed');\n register_setting('site', 'site_hours_close_wed');\n register_setting('site', 'site_hours_open_thu');\n register_setting('site', 'site_hours_close_thu');\n register_setting('site', 'site_hours_open_fri');\n register_setting('site', 'site_hours_close_fri');\n register_setting('site', 'site_hours_open_sat');\n register_setting('site', 'site_hours_close_sat');\n\n // Social\n register_setting('site', 'social_facebook');\n register_setting('site', 'social_twitter');\n register_setting('site', 'social_instagram');\n register_setting('site', 'social_youtube');\n register_setting('site', 'social_linkedin');\n}", "public function load_settings() {\n\t\t$this->general_settings = ( array ) get_option ( $this->general_settings_key );\n\t\t// $this->new_product_settings = ( array ) get_option ( $this->new_product_settings_key );\n\t\t// $this->sale_product_settings = ( array ) get_option ( $this->sale_product_settings_key );\n\t\t// $this->sold_product_settings = ( array ) get_option ( $this->sold_product_settings_key );\n\t\t// Merge with defaults\n\t\t$this->general_settings = array_merge ( array (\n\t\t\t\t'enable_crfi' => 'no',\n\t\t\t\t'image_crfi' => '',\n\t\t\t\t'thumbnail_crfi' => '',\n\t\t\t\t'quality_crfi' => 80,\n\t\t\t\t'opacity_crfi' => 40,\n\t\t\t\t'generate_crfi' => false,\n\t\t\t\t'poststatus_crfi' => 'publish',\n\t\t), $this->general_settings );\n\t\t\n\t\t\t\t\t\t\n\t}", "public function restrict_admin(){\n if ( ! current_user_can( 'manage_options' ) ) {\n wp_die( __('You are not allowed to access this part of the site') );\n }\n }" ]
[ "0.5614408", "0.5576374", "0.54217005", "0.53924716", "0.5353687", "0.53336173", "0.5311827", "0.5288344", "0.5259246", "0.52472305", "0.5210813", "0.519378", "0.5164174", "0.5162069", "0.5157482", "0.5130752", "0.5128792", "0.5117357", "0.5096623", "0.5060815", "0.5052444", "0.5041482", "0.50344247", "0.50332296", "0.5028499", "0.500033", "0.49880812", "0.49873474", "0.49778447", "0.4976398" ]
0.635092
0
mendapatkan list css default
public function init_list_css() { // ini default css $this->list_css = array( base_url('assets/css/bootstrap.css'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderList()\n {\n }", "public function wp_list_table_css() {\n\t\t?>\n <style>\n th#title {\n width: 290px;\n }\n </style>\n\t\t<?php\n\t}", "function s_list() {\r\n $data['list'] = $this->Crud_m->select('status_kerja');\r\n $this->load->view('crud/s_list', $data);\r\n }", "function bb_list() {\r\n $data['list'] = $this->Crud_m->select('bahan_baku');\r\n $this->load->view('crud/bb_list', $data);\r\n }", "protected function listDefaultAction() {\n\n\t\t// hide columns from configuration\n\t\tforeach(t3lib_div::trimExplode(',', $this->getCurrentListObject()->get_hideColumns(), 1) as $columnIdentifier) {\n\t\t\t$this->getCurrentListObject()->getAllColumnDescriptions()->getItemById($columnIdentifier)->set_hidden(true);\n\t\t}\n\n\t\t// hide columns from filters\n\t\tforeach($this->getCurrentListObject()->getAllFilters() as $filter) { /* @var $filter tx_ptlist_filter */\n\t\t\tif ($filter->get_isActive()) {\n\t\t\t\tforeach(t3lib_div::trimExplode(',', $filter->get_hideColumns(), 1) as $columnIdentifier) {\n\t\t\t\t\t$this->getCurrentListObject()->getAllColumnDescriptions()->getItemById($columnIdentifier)->set_hidden(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create view\n\t\t$view = $this->getView('list_itemList');\n\t\t$view->addItem($this->getCurrentListObject()->getListId(), 'listIdentifier');\n\t\t$view->addItem($this->getCurrentListObject()->getAllColumnDescriptions(true)->removeHiddenColumns()->getMarkerArray(), 'columns', false); // do not filter HTML here since the column headers could already contain HTML rendered by Typoscript\n\t\t$view->addItem($this->getColumnContents(), 'listItems', false); // do not filter HTML here since the column contents may already be rendered as HTML (e.g. from Typoscript wraps) and the database data is already HTML filtered (see getColumnContents())\n\n\t\t// inline filters\n\t\t$view->addItem($this->getCurrentListObject()->getAllFilters(true, 'renderInList', true)->getMarkerArray(), 'filterbox', false);\n\n\t\t// inline pager\n\t\tif ($this->conf['inlinePager']) {\n\t\t\t$view->addItem($this->doAction('pagerDefault'), 'pager', false);\n\t\t\t$view->addItem($this->pager->getMarkerArray(), 'pagerData');\n\t\t}\n\n\t\t// aggregates\n\t\t$view->addItem($this->getAggregateRows(), 'aggregateRows', false);\n\n\t\t// (added by rk 28.08.09) # TODO: Replace this by a translation mechanism\n\t\t$view->addItem($this->getCurrentListObject()->get_noElementsFoundText(), 'noElementsFoundText', false); // do not filter HTML here since the display text may already be formatted as HTML (e.g. from Typoscript configuration)\n\n\t\t$appendToSortingUrl = '';\n\t\tif ($this->conf['appendFilterValuesToUrls']) {\n\t\t\t$appendToSortingUrl = $this->getCurrentListObject()->getCompleteListStateAsUrlParameters(true);\n\t\t}\n\t\t$view->addItem($appendToSortingUrl, 'appendToSortingUrl', false);\n\n\n\t\t// render\n\t\treturn $view->render();\n\t}", "public function color_list() {\n\t\t$dataarr = array();\n\t\t$metadata = array();\n\t\t$metadata = $this->M_common->session_info();\n\t\t$metadata[\"title\"] \t\t= 'Color View :: Metro Lifestyle';\n\t\t$dataarr['metadata'] \t= $metadata;\n\t\t\n\t\t$dataarr['status_list'] = $this->M_status->status_list();\n\t\t$dataarr['colorlist'] \t= $this->M_product->color_list();\n\t\t$this->load->view( 'admin/products/setup/color/list', $dataarr );\n\t}", "public function tinyListAction()\n\t{\n\t\t\n\t}", "public static function get_default_listing_settings($list) {\n if( empty($list['edit_method']) ) $list['edit_method'] = 'modal';\n if( empty($list['display_based_on']) ) $list['display_based_on'] = 'this_form';\n if( empty($list['form_ids']) ) $list['form_ids'] = '';\n\n if( empty($list['date_range']) || (!is_array($list['date_range'])) ) $list['date_range'] = array();\n if( empty($list['date_range']['from']) ) $list['date_range']['from'] = '';\n if( empty($list['date_range']['till']) ) $list['date_range']['till'] = '';\n\t \n if( empty($list['show_title']) || (!is_array($list['show_title'])) ) $list['show_title'] = array();\n if( empty($list['show_title']['name']) ) $list['show_title']['name'] = __( 'Title', 'super-forms' );\n if( empty($list['show_title']['placeholder']) ) $list['show_title']['placeholder'] = __( 'Filter by title', 'super-forms' );\n if( empty($list['show_title']['position']) ) $list['show_title']['position'] = 1;\n if( empty($list['show_title']['width']) ) $list['show_title']['width'] = 150;\n\n if( empty($list['show_status']) || (!is_array($list['show_status'])) ) $list['show_status'] = array();\n if( empty($list['show_status']['name']) ) $list['show_status']['name'] = __( 'Status', 'super-forms' );\n if( empty($list['show_status']['placeholder']) ) $list['show_status']['placeholder'] = __( '- choose status -', 'super-forms' );\n if( empty($list['show_status']['position']) ) $list['show_status']['position'] = 2;\n if( empty($list['show_status']['width']) ) $list['show_status']['width'] = 150;\n\t \n if( empty($list['show_date']) || (!is_array($list['show_date'])) ) $list['show_date'] = array();\n if( empty($list['show_date']['name']) ) $list['show_date']['name'] = __( 'Date created', 'super-forms' );\n if( empty($list['show_date']['placeholder']) ) $list['show_date']['placeholder'] = __( 'Filter by date', 'super-forms' );\n if( empty($list['show_date']['position']) ) $list['show_date']['position'] = 3;\n if( empty($list['show_date']['width']) ) $list['show_date']['width'] = 150;\n\n if( empty($list['custom_columns']) ) $list['custom_columns'] = false;\n if( empty($list['columns']) || (!is_array($list['columns'])) ) $list['columns'] = array(\n array(\n 'name' => 'E-mail',\n 'field_name' => 'email',\n 'width' => 150\n )\n );\n\t \n if( empty($list['edit_any']) ) $list['edit_any'] = array();\n if( empty($list['edit_any']['method']) ) $list['edit_any']['method'] = 'modal';\n\n if( empty($list['pagination']) ) $list['pagination'] = 'page';\n if( empty($list['limit']) ) $list['limit'] = 25;\n return $list;\n }", "private function listItemsRender(){\n $attributes = array();\n $attributes['class'][] = 'theforce-list';\n $attributes['class'][] = $this->values['listStyle'];\n\n $output = array(\n '#theme' => 'item_list',\n '#title' => $this->listTitle,\n '#items' => $this->values['listItems'],\n '#attributes' => $attributes,\n );\n return $output;\n }", "function custom_list_func( $atts, $content = null ) {\n extract(shortcode_atts(array(\n\t 'style' => 'list-1',\n ), $atts));\n $content = str_replace('<ul>', '<ul class=\"'.$style.'\">', do_shortcode($content));\n return $content;\n}", "public function _admin_css() {\n\t\t$tax = $this->name;\n\t\t$len = strlen( $tax );\n\t\t$count = $len - round( ( sqrt( $len ) ) * 2.25 );\n\t\tif ( $count > 9 ) $count = 9;\n\n\t\t$css = \".tablenav select#{$tax} {min-width: 1{$count}em !important;}\";\n\n\t\techo \"<style>{$css}</style>\\n\";\n\t}", "protected function extjsListDefaultAction() {\n\n\t\t// id of the div, where ext js will render the grid into\n\t\t$element = 'tx-ptlist-grid-'.$this->getCurrentListObject()->get_listId();\n\n\t\t$view = $this->getView('list_extjsList_headerdata');\n\t\t$view->addItem($element, 'element');\n\t\t$view->addItem($this->conf['itemsPerPage'], 'itemsPerPage');\n\t\t$view->addItem($this->getCurrentListObject()->getAllColumnDescriptions()->getMarkerArray(), 'columns', false);\n\t\t$view->addItem($this->getCurrentListObject()->getListId(), 'listIdentifier');\n\t\t$view->addItem($this->cObj->data['uid'], 'tt_content_uid');\n\t\t$view->addItem($this->getCurrentListObject()->getAllFilters(true, 'defaultFilterbox')->getMarkerArray(), 'defaultFilterbox', false);\n\t\t$view->addItem($this->getCurrentListObject()->getAllFilters(true, 'topFilterbox')->getMarkerArray(), 'topFilterbox', false);\n\n\t\t// setup and include own headerData\n\t\t$GLOBALS['TSFE']->additionalHeaderData['tx_ptlist_grid_'.$this->getCurrentListObject()->get_listId()] = $view->render();\n\n\t\treturn '<div id=\"'.$element.'\" class=\"tx-ptlist-grid\"></div>';\n\t}", "function super_borderFooter_list() {\r\r\r\r\t\t##import project type model for processing\r\r\r\r\t\tApp::import(\"Model\", \"BorderFooter\");\r\r\r\r\t\t$this->BorderFooter = & new BorderFooter();\r\r\r\r\t\t\r\r\r\r\t\t$cont=\"BorderFooter.active_status = '1' and BorderFooter.delete_status=0\"; \r\r\r\r $footerdropdown=$this->BorderFooter->find('list',array('conditions'=>$cont,'fields'=>array('id','border_footer_name')));\r\r\r\r\t\t//pr($footerdropdown);\r\r\r\r\t\treturn $footerdropdown;\r\r\r\r\t}", "function publisher_listing_option_list( $default = false ) {\n\n\t\t$option = array();\n\n\t\tif ( $default ) {\n\t\t\t$option['default'] = array(\n\t\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-default.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t\t'label' => __( 'Default', 'publisher' ),\n\t\t\t\t'current_label' => __( 'Default Listing', 'publisher' ),\n\t\t\t);\n\t\t}\n\n\t\t$option['grid-1'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-grid-1.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Grid 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Grid Listing 1', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Grid Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['grid-1-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-grid-1-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Grid 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Grid Listing 1 (3 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Grid Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'3 Column',\n\t\t\t),\n\t\t);\n\t\t$option['grid-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-grid-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Grid 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Grid Listing 2', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Grid Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['grid-2-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-grid-2-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Grid 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Grid Listing 2 (3 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Grid Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'3 Column',\n\t\t\t),\n\t\t);\n\t\t$option['blog-1'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-blog-1.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Blog 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Blog Listing 1', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Blog Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['blog-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-blog-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Blog 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Blog Listing 2', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Blog Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['blog-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-blog-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Blog 3', 'publisher' ),\n\t\t\t'current_label' => __( 'Blog Listing 3', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Blog Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['blog-4'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-blog-4.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Blog 4', 'publisher' ),\n\t\t\t'current_label' => __( 'Blog Listing 4', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Blog Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['blog-5'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-blog-5.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Blog 5', 'publisher' ),\n\t\t\t'current_label' => __( 'Blog Listing 5', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Blog Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['classic-1'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-classic-1.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Classic 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Classic Listing 1', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Classic Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['classic-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-classic-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Classic 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Classic Listing 2', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Classic Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['classic-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-classic-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Classic 3', 'publisher' ),\n\t\t\t'current_label' => __( 'Classic Listing 3', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Classic Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['tall-1'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-tall-1.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Tall 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Tall Listing 1', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Tall Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['tall-1-4'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-tall-1-4.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Tall 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Tall Listing 1 (4 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Tall Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'4 Column',\n\t\t\t),\n\t\t);\n\t\t$option['tall-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-tall-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Tall 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Tall Listing 2', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Tall Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['tall-2-4'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-tall-2-4.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Tall 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Tall Listing 2 (4 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Tall Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'4 Column',\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-1'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-1.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 11', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 11', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Tall Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 12', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 12', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Mix Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 13', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 13', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Mix Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-4'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-4.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 14', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 14', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Mix Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-5'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-5.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 15', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 15', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Mix Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-6'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-6.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 16', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 16', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Mix Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-7'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-7.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 17', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 17', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Mix Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['mix-4-8'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-mix-4-8.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Mix 18', 'publisher' ),\n\t\t\t'current_label' => __( 'Mix Listing 18', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Mix Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$option['text-1-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-1-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 1 (2 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'2 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-1-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-1-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 1', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 1 (3 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'3 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-2-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-2-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 2 (2 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'2 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-2-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-2-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 2', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 2 (3 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'3 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 3', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 3 (1 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'1 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-3-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-3-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 3', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 3 (2 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'2 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-3-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-3-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 3', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 3 (3 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'3 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-4'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-4.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 4', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 4 (1 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'1 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-4-2'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-4-2.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 4', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 4 (2 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'2 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\t\t$option['text-4-3'] = array(\n\t\t\t'img' => PUBLISHER_THEME_URI . 'images/options/listing-text-4-3.png?v=' . PUBLISHER_THEME_VERSION,\n\t\t\t'label' => __( 'Text 4', 'publisher' ),\n\t\t\t'current_label' => __( 'Text Listing 4 (3 column)', 'publisher' ),\n\t\t\t'class' => 'bf-flip-img-rtl',\n\t\t\t'info' => array(\n\t\t\t\t'cat' => array(\n\t\t\t\t\t__( 'Text Listing', 'publisher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'badges' => array(\n\t\t\t\t'3 Column',\n\t\t\t\t'NEW',\n\t\t\t),\n\t\t);\n\n\t\treturn $option;\n\t}", "function custom_colors() {\n echo '<style type=\"text/css\">\n \n #map-location-options tr.ecf-field-container:nth-of-type(1),\n #map-location-options tr.ecf-field-container:nth-of-type(3), \n #map-location-options tr.ecf-field-container:nth-of-type(4), \n #map-location-options tr.ecf-field-container:nth-of-type(5), \n #map-location-options tr.ecf-field-container:nth-of-type(6) { \n \t display:none; \n }\n \n .custom-mapping-shell h3:nth-of-type(3), \n .custom-mapping-shell table.form-table:nth-of-type(3) { \n \t display:none; \n }\n \n \n </style>';\n}", "function __construct() { ?>\n <style>ol.comment-list {padding-left: 0;}</style>\n <ul class=\"media-list\">\n <?php }", "protected function setupListOperation()\n {\n $this->crud->setColumns([\n ['name'=>'title_tk', 'type'=>'text', 'label' => 'Title Turkmen'],\n ['name'=>'title_ru', 'type'=>'text', 'label' => 'Title Russian']\n ]);\n }", "public function renderList(){\r\n $this->addRowAction('edit');\r\n $this->addRowAction('delete');\r\n\r\n return parent::renderList();\r\n\r\n }", "protected function setupListOperation()\n {\n //CRUD::setFromDb(); // columns\n CRUD::column('judul')->label('Judul');\n CRUD::column('jangka_waktu')->label('Jangka Waktu');\n CRUD::column('format')->label('Format');\n CRUD::column('tempat')->label('Tempat');\n CRUD::column('file')->label('File');\n CRUD::column('id_skpd')->label('SKPD');\n CRUD::column('id_jenis_informasi')->label('Jenis Informasi');\n CRUD::column('kategori')->label('Kategori');\n CRUD::column('pj_terbit')->label('Penanggung Jawab Terbit');\n CRUD::column('pj_pejabat')->label('Pejabat Penanggung Jawab');\n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']);\n */\n }", "function renderList() {\n for ($i = 0; $i < count($this->contents); $i++) {\n $this->renderAttr($i);\n }\n }", "public function pers_list()\n {\n $this->templates->display('pers_list');\n }", "function mpcth_list_shortcode($atts, $content = null) {\r\n\t$GLOBALS['item_count'] = 0;\r\n\t$GLOBALS['items'] = '';\r\n\r\n\tdo_shortcode($content);\r\n\t\r\n\textract(shortcode_atts(array(), $atts,$content));\r\n\r\n\t$return = '<ul class=\"mpcth-sc-list\">';\r\n\r\n\tif(is_array($GLOBALS['items'])) {\r\n\t\tforeach($GLOBALS['items'] as $item) {\r\n\t\t\t$return .= '<li class=\"mpcth-sc-list-item\" style=\"color: ' . $item['color'] . '\"><span class=\"mpcth-sc-icon-' . $item['type'] . '\" style=\"color: ' . $item['icon_color'] . '\"></span>' . $item['content'] . '</li>';\r\n\t\t}\t\r\n\t}\r\n\t\r\n\t$return .= '</ul>';\r\n\r\n\t$return = parse_shortcode_content($return);\r\n\treturn $return;\r\n}", "public function unordered($list=true) {\r\n\t\t\tif($list):\r\n\t\t\t\t$this->content = 'div';\r\n\t\t\t\t$this->tabulate = 'ul';\r\n\t\t\t\t$this->item = 'li';\r\n\t\t\telse:\r\n\t\t\t\t$this->content = 'div';\r\n\t\t\t\t$this->tabulate = 'div';\r\n\t\t\t\t$this->item = 'p';\r\n\t\t\tendif;\r\n\t\t\treturn $this;\r\n\t\t}", "protected function setupListOperation()\n {\n $this->crud->addColumn([\n 'name' => 'id',\n 'type' => 'number',\n 'label' => 'ID'\n ]);\n $this->crud->addColumn([\n 'name' => 'name',\n 'type' => 'text',\n 'label' => 'Название'\n ]);\n $this->crud->addColumn([\n 'name' => 'rating',\n 'type' => 'number',\n 'label' => 'Рейтинг'\n ]);\n $this->crud->addColumn([\n 'name' => 'skin',\n 'type' => 'image',\n 'label' => 'Скин'\n ]);\n }", "function border_footer_list(){\n\n\n\n ##check admin session live or not\n\n $this->session_check_admin();\n\n \n\n\t\t\t##import project type model for processing\n\n App::import(\"Model\", \"BorderFooter\");\n\n $this->BorderFooter = & new BorderFooter();\n\n\t\t\t$condition = 'delete_status=0';\n\n\t\t\t$field='';\n\n if(isset($this->data['BorderFooter']['searchkey']) && $this->data['BorderFooter']['searchkey']){\n\n $searchkeyword = $this->data['BorderFooter']['searchkey'];\n\n $condition .= \" BorderFooter.border_footer_name LIKE '%\".$searchkeyword.\"%' OR BorderFooter.border_footer_name LIKE '%\".$searchkeyword.\"%' \";\n\n }\n\n\n\n $this->Pagination->sortByClass = 'BorderFooter'; ##initaite pagination \n\n\n\n $this->Pagination->total= count($this->BorderFooter->find('all',array(\"conditions\"=>$condition)));\n\n\n\n list($order,$limit,$page) = $this->Pagination->init($condition,$field);\n\n\n\n $border_footer_list = $this->BorderFooter->find('all',array(\"conditions\"=>$condition, 'order' =>$order, 'limit' => $limit, 'page' => $page));\n\n ##set project type data in variable\n\n \n\n $this->set(\"border_footer_list\",$border_footer_list); \t\n\n \n\n }", "public function color_list() {\t\n\t\t$this -> db -> select('\n\t\t\tc.id , c.colorname , s.statustitle , c.createdby , c.created_at , c.updatedby , c.updated_at , a.admincode, a.adminname\n\t\t');\n\t\t$this -> db -> from('item_color AS c');\n\t\t$this -> db -> join('admin_login AS a', 'c.createdby = a.id');\n\t\t$this -> db -> join('status_info AS s', 'c.status = s.id');\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n return $query->result();\n }else{\n\t\t\treturn false;\n\t\t}\n }", "static public function __hx__list () {\n\t\treturn [\n\t\t\t3 => 'Default',\n\t\t\t2 => 'Medium',\n\t\t\t1 => 'Small',\n\t\t\t0 => 'Tiny',\n\t\t];\n\t}", "public static function liste(){\n\t\t\t\n\t\t}", "private function initList()\n {\n /**\n * Those are needed if you want to add more data to select then table of object of this controller\n */\n $this->_select = ' pl.`name` as product_name, pl.`name` as product_button_name';\n $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'product_lang` `pl` ON pl.`id_product` = a.`id_training_article` AND pl.`id_lang` = ' . (int)$this->context->language->id;\n $this->fields_list = array(\n 'id_training_article' => array(\n 'title' => $this->module->l('Id'),\n 'width' => 100,\n 'class' => 'my-custom-class'\n ),\n 'name' => array(\n 'title' => $this->module->l('Name'),\n 'width' => 80,\n ),\n 'description' => array(\n 'title' => $this->module->l('Description'),\n 'width' => 80,\n 'filter_key' => 'b!description'\n ),\n 'type' => array(\n 'title' => $this->module->l('Type'),\n 'width' => 80,\n ),\n 'product_name' => array(\n 'title' => $this->module->l('Product Name'),\n 'width' => 80,\n 'filter_key' => 'pl!name'\n ),\n 'product_button_name' => array(\n 'title' => $this->module->l('Product Name'),\n 'width' => 80,\n 'callback' => 'getProductName',\n ),\n );\n\n }", "public function actionList()\n {\n $this->layout = 'index2';\n $type = Yii::$app->request->get('type');\n $tips = \"模块开发中...\";\n return $this->render('list',[\n 'tips' => $tips\n ]);\n }" ]
[ "0.6363539", "0.62520915", "0.62141615", "0.6203043", "0.61963004", "0.6026909", "0.5995629", "0.5985691", "0.5975473", "0.5898331", "0.5879525", "0.5868061", "0.5782775", "0.5764367", "0.5760577", "0.57357", "0.57167625", "0.571245", "0.56979764", "0.569543", "0.5651654", "0.5601436", "0.56008124", "0.5590723", "0.55903834", "0.55865246", "0.5577883", "0.5572514", "0.55699295", "0.5569793" ]
0.7413914
0
this function for use in theme_xxx_process_css() function in coordination with a [[customlabel|overrides]] tag placed into any stylesheet of the theme.
function theme_set_customlabelcss($css) { $tag = '[[customlabel:overrides]]'; $config = get_config('mod_customlabel'); $replacement = @$config->cssoverrides; $css = str_replace($tag, $replacement, $css); return $css; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function succulents_qodef_contact_form7_label_styles_2() {\n\t\t$item_styles = succulents_qodef_get_typography_styles( 'cf7_style_2_label' );\n\t\t\n\t\t$item_selector = array(\n\t\t\t'.cf7_custom_style_2 p'\n\t\t);\n\t\t\n\t\techo succulents_qodef_dynamic_css( $item_selector, $item_styles );\n\t}", "function succulents_qodef_contact_form7_label_styles_1() {\n\t\t$item_styles = succulents_qodef_get_typography_styles( 'cf7_style_1_label' );\n\t\t\n\t\t$item_selector = array(\n\t\t\t'.cf7_custom_style_1 p'\n\t\t);\n\t\t\n\t\techo succulents_qodef_dynamic_css( $item_selector, $item_styles );\n\t}", "public function render_custom_css(){\n /** Get uninstall settings. */\n $CustomCssSettings = get_option( 'mdp_scroller_custom_css_settings' );\n\n /** Set Default value 'plugin' . */\n $CustomCssSettings = [\n 'customcss' => isset( $CustomCssSettings[ 'customcss' ] ) ? $CustomCssSettings[ 'customcss' ] : '',\n ];\n\n UI::get_instance()->render_textarea(\n $CustomCssSettings['customcss'],\n esc_html__('Add custom CSS here. You probably have to use an expression !important for some rules.', 'scroller' ),\n [\n 'id' => 'mdp_custom_css_fld',\n 'class' => 'mdp_custom_css_fld',\n 'name' => 'mdp_scroller_custom_css_settings[customcss]'\n ]\n );\n }", "function mixtape_qodef_contact_form7_label_styles_2() {\n\t\t$selector = array('.cf7_custom_style_2 p');\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$line_height = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_line_height');\n\t\tif($line_height !== ''){\n\t\t\t$styles['line-height'] = mixtape_qodef_filter_px($line_height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_2_label_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}", "public static function style_custom() {\n\t\t$styles = get_theme_mod( 'setting_additional_css', '' );\n\n\t\tif ( $styles && ! empty( $styles ) ) :\n\t\t\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\t\t\t?>\n\t\t\t<style<?php echo $type_attr; // phpcs:ignore ?> id=\"gp-customizer-custom-css\">\n\t\t\t\t<?php echo strip_tags( $styles ); // phpcs:ignore ?>\n\t\t\t</style>\n\t\t\t<?php\n\t\tendif;\n\t}", "function mixtape_qodef_contact_form7_label_styles_1() {\n\t\t$selector = array('.cf7_custom_style_1 p');\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$line_height = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_line_height');\n\t\tif($line_height !== ''){\n\t\t\t$styles['line-height'] = mixtape_qodef_filter_px($line_height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_1_label_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}", "public function get_label_custom() {\n if(isset($this->options['label_custom'])) {\n\t\t\treturn $this->options['label_custom'];\n\t\t}\n\t\treturn '';\n\t}", "function bambule_custom_css_section_callback() {\n echo 'Customize Bambule with your own CSS';\n}", "function succulents_qodef_contact_form7_label_styles_3() {\n\t\t$item_styles = succulents_qodef_get_typography_styles( 'cf7_style_3_label' );\n\t\t\n\t\t$item_selector = array(\n\t\t\t'.cf7_custom_style_3 p'\n\t\t);\n\t\t\n\t\techo succulents_qodef_dynamic_css( $item_selector, $item_styles );\n\t}", "function theme_essential_set_customcss($css, $customcss)\r\n{\r\n $tag = '[[setting:customcss]]';\r\n $replacement = $customcss;\r\n $css = str_replace($tag, $replacement, $css);\r\n return $css;\r\n}", "function goa_theme_custom_css_section_callback() {\n\techo 'Customize Goa Theme with your own CSS';\n}", "function display_custom_css(){\n\t\t$settings = $this->get_all( );\n\t\t$css = apply_filters( 'siteorigin_settings_custom_css', '', $settings );\n\n\t\tif( !empty($css) ) {\n\n\t\t\t$css_key = md5( json_encode( array(\n\t\t\t\t'css' => $css,\n\t\t\t\t'settings' => $this->get_all(),\n\t\t\t) ) );\n\n\t\t\tif( $css_key !== get_theme_mod( 'custom_css_key' ) || ( defined('WP_DEBUG') && WP_DEBUG ) ) {\n\t\t\t\t$css_lines = array_map( \"trim\", preg_split(\"/[\\r\\n]+/\", $css ) );\n\t\t\t\tforeach( $css_lines as $i => & $line ) {\n\t\t\t\t\tpreg_match_all( '/\\$\\{([a-zA-Z0-9_]+)\\}/', $line, $matches );\n\t\t\t\t\tif( empty($matches[0]) ) continue;\n\n\t\t\t\t\t$replaced = 0;\n\n\t\t\t\t\tfor( $j = 0; $j < count($matches[0]); $j++ ) {\n\t\t\t\t\t\t$current = $this->get( $matches[1][$j] );\n\t\t\t\t\t\t$default = isset($this->defaults[$matches[1][$j]]) ? $this->defaults[$matches[1][$j]] : false;\n\n\t\t\t\t\t\tif( $current != $default && str_replace('%', '%%', $current) != $default ) {\n\t\t\t\t\t\t\t// Lets store that we've replaced something in this line\n\t\t\t\t\t\t\t$replaced++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$line = str_replace( $matches[0][$j], $current, $line );\n\t\t\t\t\t}\n\n\t\t\t\t\tif( $replaced == 0 ) {\n\t\t\t\t\t\t// Remove any lines where we haven't done anything\n\t\t\t\t\t\tunset($css_lines[$i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$css = implode(' ', $css_lines);\n\n\t\t\t\t// Now, lets handle the custom functions.\n\t\t\t\t$css = preg_replace_callback('/\\.([a-z\\-]+) *\\(([^\\)]*)\\) *;/', array($this, 'css_functions'), $css);\n\n\t\t\t\t// Finally, we'll combine all imports and put them at the top of the file\n\t\t\t\tpreg_match_all( '/@import url\\(([^\\)]+)\\);/', $css, $matches );\n\t\t\t\tif( !empty($matches[0]) ) {\n\t\t\t\t\t$webfont_imports = array();\n\n\t\t\t\t\tfor( $i = 0; $i < count($matches[0]); $i++ ) {\n\t\t\t\t\t\tif( strpos('//fonts.googleapis.com/css', $matches[1][$i]) !== -1 ) {\n\t\t\t\t\t\t\t$webfont_imports[] = $matches[1][$i];\n\t\t\t\t\t\t\t$css = str_replace( $matches[0][$i], '', $css );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif( !empty($webfont_imports) ) {\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'family' => array(),\n\t\t\t\t\t\t\t'subset' => array(),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Combine all webfont imports into a single argument\n\t\t\t\t\t\tforeach( $webfont_imports as $url ) {\n\t\t\t\t\t\t\t$url = parse_url($url);\n\t\t\t\t\t\t\tif( empty($url['query']) ) continue;\n\t\t\t\t\t\t\tparse_str( $url['query'], $query );\n\n\t\t\t\t\t\t\tif( !empty($query['family']) ) {\n\t\t\t\t\t\t\t\t$args['family'][] = $query['family'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$args['subset'][] = !empty($query['subset']) ? $query['subset'] : 'latin';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Clean up the arguments\n\t\t\t\t\t\t$args['subset'] = array_unique($args['subset']);\n\n\t\t\t\t\t\t$args['family'] = array_map( 'urlencode', $args['family'] );\n\t\t\t\t\t\t$args['subset'] = array_map( 'urlencode', $args['subset'] );\n\t\t\t\t\t\t$args['family'] = implode('|', $args['family']);\n\t\t\t\t\t\t$args['subset'] = implode(',', $args['subset']);\n\n\t\t\t\t\t\t$import = '@import url(' . add_query_arg( $args, '//fonts.googleapis.com/css' ) . ');';\n\t\t\t\t\t\t$css = $import . \"\\n\" . $css;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Now lets remove empty rules\n\t\t\t\tdo {\n\t\t\t\t\t$css = preg_replace('/[^\\{\\}]*?\\{ *\\}/', ' ', $css, -1, $count);\n\t\t\t\t} while( $count > 0 );\n\t\t\t\t$css = trim($css);\n\n\t\t\t\tset_theme_mod( 'custom_css', $css );\n\t\t\t\tset_theme_mod( 'custom_css_key', $css_key );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$css = get_theme_mod('custom_css');\n\t\t\t}\n\n\t\t\tif( !empty($css) ) {\n\t\t\t\t?>\n\t\t\t\t<style type=\"text/css\" id=\"<?php echo esc_attr($this->theme_name) ?>-settings-custom\" data-siteorigin-settings=\"true\">\n\t\t\t\t\t<?php echo strip_tags($css) ?>\n\t\t\t\t</style>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}", "function addCustom()\n{\n\t\t// wp_enqueue_style( 'ais-custom-bootstrap', trailingslashit( get_stylesheet_directory_uri() ) . 'ais-bootstrap-custom.css');\n\n\t\t// BMP Form css based on bootstrap 4\n\t\t// wp_enqueue_style( 'ais-bootstrap-form-style', trailingslashit( get_stylesheet_directory_uri() ) . 'css/ais-form-style.css');\n\t\tGenPressChildHelper::addChildStylesheet('ais-form-style');\n\t\t// Helper::addChildScript('ais-scripts', ['jquery']);\n\t\t// Helper::addChildScript('ais-typeahead');\n\n}", "private function _handleStyleBased()\n {\n $this->css = ArrayHelper::merge($this->styleBasedCss[Metronic::getComponent()->style], $this->css);\n }", "function optinforms_form3_add_custom_css() {\r\n\tglobal $optinforms_form3_css;\r\n\treturn \"<style type='text/css'>\" . optinforms_form3_hide_title_css() . optinforms_form3_hide_subtitle_css() . optinforms_form3_hide_title_subtitle_css() . optinforms_form3_hide_name_field_css() . $optinforms_form3_css . \"</style>\";\r\n}", "function vtsc_label( $atts, $content = null ) {\n extract(shortcode_atts(array(\t'color' => 'label-blue',\n\t\t\t\t\t\t\t\t\t'shape'\t=> 'label-rounded'\n\t\t\t\t\t\t\t\t\t), $atts));\n\n\treturn '<span class=\"label label-default ' . $color . ' ' . $shape . '\">' . do_shortcode($content) . '</span>'; \n}", "function mixtape_qodef_contact_form7_label_styles_4() {\n\t\t$selector = array('.cf7_custom_style_4 p');\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$line_height = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_line_height');\n\t\tif($line_height !== ''){\n\t\t\t$styles['line-height'] = mixtape_qodef_filter_px($line_height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_4_label_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}", "function mixtape_qodef_contact_form7_label_styles_6() {\n\t\t$selector = array('.cf7_custom_style_6 p');\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$line_height = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_line_height');\n\t\tif($line_height !== ''){\n\t\t\t$styles['line-height'] = mixtape_qodef_filter_px($line_height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_6_label_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}", "function sunset_custom_css_section_callback() {\r\n\techo 'Customize Sunset Theme with your own CSS';\r\n}", "function mixtape_qodef_contact_form7_label_styles_3() {\n\t\t$selector = array('.cf7_custom_style_3 p');\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$line_height = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_line_height');\n\t\tif($line_height !== ''){\n\t\t\t$styles['line-height'] = mixtape_qodef_filter_px($line_height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_3_label_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}", "function mixtape_qodef_contact_form7_label_styles_5() {\n\t\t$selector = array('.cf7_custom_style_5 p');\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$line_height = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_line_height');\n\t\tif($line_height !== ''){\n\t\t\t$styles['line-height'] = mixtape_qodef_filter_px($line_height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_5_label_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}", "function lsu_set_customcss($css, $customcss) {\n $tag = '[[setting:customcss]]';\n $replacement = $customcss;\n if (is_null($replacement)) {\n $replacement = '';\n }\n $css = str_replace($tag, $replacement, $css);\n return $css;\n}", "function bbm_label_button_html_override( $html ) {\n\t$new_html\t = '<a class=\"bbm-label-button\" title=\"Add/Create Label\" href=\"javascript:void(0)\">';\n\t$new_html\t .= '<span class=\"hida\"><i class=\"fa fa-tag\"></i></span>';\n\t$new_html\t .= '<p class=\"multiSel\"></p></a>';\n\n\treturn $new_html;\n}", "function gavernwp_html_attributes_hook() {\n\tglobal $tpl;\n\t// generate the <html> language attributes\n\tlanguage_attributes();\n\t// generate the prefix attribute\n\techo ' prefix=\"og: http://ogp.me/ns#\"';\n\t// generate the cache manifest attribute\n\tif(trim(get_option($tpl->name . '_cache_manifest', '')) != '') {\n\t\techo ' manifest=\"'.trim(get_option($tpl->name . '_cache_manifest', '')).'\"';\n\t}\n \t// YOUR HOOK CODE HERE\n}", "function moments_qodef_print_custom_css() {\n\t\t$custom_css = moments_qodef_options()->getOptionValue( 'custom_css' );\n\n\t\tif ( $custom_css !== '' ) {\n\t\t\twp_add_inline_style( 'moments-qodef-modules', $custom_css );\n\t\t}\n\t}", "public function loadCustomStyle()\n {\n $style = new OutputFormatterStyle('white', 'blue');\n $this->output->getFormatter()->setStyle('stageTitle', $style);\n }", "function alm_paging_disable_css_callback(){\n\t\t$options = get_option( 'alm_settings' );\n\t\tif(!isset($options['_alm_paging_disable_css']))\n\t\t $options['_alm_paging_disable_css'] = '0';\n\n\t\t$html = '<input type=\"hidden\" name=\"alm_settings[_alm_paging_disable_css]\" value=\"0\" />';\n\t\t$html .= '<input type=\"checkbox\" id=\"alm_paging_disable_css_input\" name=\"alm_settings[_alm_paging_disable_css]\" value=\"1\"'. (($options['_alm_paging_disable_css']) ? ' checked=\"checked\"' : '') .' />';\n\t\t$html .= '<label for=\"alm_paging_disable_css_input\">'.__('I want to use my own CSS styles.', 'ajax-load-more-paging').'<br/><span style=\"display:block;\"><i class=\"fa fa-file-text-o\"></i> &nbsp;<a href=\"'.ALM_PAGING_URL.'/core/css/ajax-load-more-paging.css\" target=\"blank\">'.__('View Paging CSS', 'ajax-load-more-paging').'</a></span></label>';\n\n\t\techo $html;\n\t}", "protected function getStyles() {\n return <<<CSSRULES\n/* Text Field Type */\n.admin-page-framework-field-text .admin-page-framework-field .admin-page-framework-input-label-container {\n vertical-align: top; \n}\nCSSRULES;\n\n }", "function cpotheme_icon_library_linearicons($value)\n{\n wp_enqueue_style('cpotheme-linearicons');\n return '<span style=\"font-family:\\'linearicons\\'\">'.$value.'</span>';\n}", "function register_custom_css( $fields ){\r\n return $fields;\r\n }" ]
[ "0.6272275", "0.6211237", "0.60341614", "0.5990763", "0.5942432", "0.59017044", "0.5880291", "0.5750175", "0.5715872", "0.56494147", "0.55978173", "0.55428445", "0.5537289", "0.5504972", "0.5503374", "0.5487099", "0.54545754", "0.5447577", "0.5439854", "0.5406505", "0.5395675", "0.53845525", "0.53602546", "0.53034407", "0.529139", "0.5284768", "0.5283852", "0.52723753", "0.5260381", "0.52505773" ]
0.8182949
0
Finds a customlabel, or all customlabels of some type in a course. Special behaviour : in page format, needs to be published
function customlabel_get_customlabel_in_course($course, $type, $wantfirst = false, $onlyvisible = true, $onlypublished = true) { global $DB; if ($course->format != 'page') { $params = ['course' => $course->id, 'customlabeltype' => $type]; $instances = $DB->get_records('customlabel', $params); } else { $visibleclause = ''; if (!empty($onlyvisible)) { $visibleclause = " AND fpi.visible = 1 "; } $select = " SELECT c.* FROM {customlabel} c, {course_module} cm, {module} m, {format_page} fp, {format_page_items} fpi WHERE c.id = cm.instance AND cm.moduleid = m.id AND m.name = 'customlabel' AND fpi.cmid = cm.id AND fpi.pageid = fp.id AND fp.courseid = c.id {$visibleclause} "; $instances = $DB->get_records_sql($sql); } if (!empty($instances) && $wantfirst) { return array_pop($instances); } return $instances; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function get_label();", "function learndash_get_content_label( $post_type = null, $args = null ) {\n\n\tif ( $args ) {\n\t\textract( $args );\n\t}\n\n\t$post_type = ( null === $post_type ? get_post_type() : $post_type );\n\t$label = '';\n\n\tswitch ( $post_type ) {\n\t\tcase ( 'sfwd-courses' ):\n\t\t\t$label = LearnDash_Custom_Label::get_label( 'course' );\n\t\t\tbreak;\n\t\tcase ( 'sfwd-lessons' ):\n\t\t\tif ( isset( $parent ) ) {\n\t\t\t\t$label = LearnDash_Custom_Label::get_label( 'course' );\n\t\t\t} else {\n\t\t\t\t$label = LearnDash_Custom_Label::get_label( 'lesson' );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ( 'sfwd-topic' ):\n\t\t\tif ( isset( $parent ) ) {\n\t\t\t\t$label = LearnDash_Custom_Label::get_label( 'lesson' );\n\t\t\t} else {\n\t\t\t\t$label = LearnDash_Custom_Label::get_label( 'topic' );\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\t/**\n\t * Filters label for the content type by post type. Used to override label settings set by the user.\n\t *\n\t * @param string $label Label for the content type\n\t * @param string $post_type Post type\n\t */\n\treturn apply_filters( 'learndash_get_content_label', $label, $post_type );\n\n}", "abstract protected function getLabels();", "public function findByLabel($label);", "public function getTranslationLabel($label, $context = '', $type = '');", "public function getCustomLabelsPath();", "function getLabels() {\r\n\t\t$labelMarkers = array(\r\n\t\t\t'CRDATE_LABEL',\r\n\t\t\t'REFERENCE_LABEL',\r\n\t\t\t'JOB_TITLE_LABEL',\r\n\t\t\t'EMPLOYER_LABEL',\r\n\t\t\t'EMPLOYER_DESCRIPTION_LABEL',\r\n\t\t\t'LOCATION_LABEL',\r\n\t\t\t'SHORT_JOB_DESCRIPTION_LABEL',\r\n\t\t\t'JOB_DESCRIPTION_LABEL',\r\n\t\t\t'EXPERIENCE_LABEL',\r\n\t\t\t'JOB_REQUIREMENTS_LABEL',\r\n\t\t\t'JOB_BENEFITS_LABEL',\r\n\t\t\t'APPLY_INFORMATION_LABEL',\r\n\t\t\t'SALARY_LABEL',\r\n\t\t\t'JOB_TYPE_LABEL',\r\n\t\t\t'CONTRACT_TYPE_LABEL',\r\n\t\t\t'REGION_LABEL',\r\n\t\t\t'SECTOR_LABEL',\r\n\t\t\t'CATEGORY_LABEL',\r\n\t\t\t'DISCIPLINE_LABEL',\r\n\t\t\t'EDUCATION_LABEL',\r\n\t\t\t'SEARCH_LABEL',\r\n\t\t\t'RESET_LABEL',\r\n\t\t\t'BACKTOLIST',\r\n\t\t\t'BACKTOJOB',\r\n\t\t\t'KEYWORD_LABEL',\r\n\t\t\t'APPLY_HEADER',\r\n\t\t\t'FULLNAME_LABEL',\r\n\t\t\t'EMAIL_LABEL',\r\n\t\t\t'APPLY_LABEL',\r\n\t\t\t'MOTIVATION_LABEL',\r\n\t\t\t'CV_LABEL',\r\n\t\t\t'LETTER_LABEL',\r\n\t\t\t'APPLY_LINK',\r\n\t\t\t'APPLY_THANKS',\r\n\t\t\t'CONTACT_NAME_LABEL',\r\n\t\t\t'CONTACT_ADDRESS_LABEL',\r\n\t\t\t'CONTACT_PHONE_LABEL',\r\n\t\t\t'CONTACT_EMAIL_LABEL'\r\n\t\t);\r\n\r\n\t\t// Extend $labelMarkers with user function?\r\n\t\tif (isset($this->conf['labelMarkersFunction']) && $this->conf['labelMarkersFunction']) {\r\n\t\t\t$funcConf = $this->conf['labelMarkersFunction.'];\r\n\t\t\t$funcConf['parent'] = & $this;\r\n\t\t\t$labelMarkers = $this->cObj->callUserFunction($this->conf['labelMarkersFunction'], $funcConf, $labelMarkers);\r\n\t\t}\r\n\r\n\t\t// Get the label from the locallang.xml file, and apply the stdWrap configuration\r\n\t\tforeach ($labelMarkers AS $labelMarker) {\r\n\t\t\t$markerArray['###'.$labelMarker.'###'] = $this->cObj->stdWrap($this->pi_getLL(strtolower($labelMarker)), $this->conf[strtolower($labelMarker).'_stdWrap.']);\r\n\t\t}\r\n\r\n\t\t// The labels for required apply form fields get one more stdWrap configuration\r\n\t\tif (!isset($this->piVars['apply_submit'])) {\r\n\t\t\tforeach ($this->requiredFields AS $requiredField) {\r\n\t\t\t\t$markerArray['###'.strtoupper($requiredField).'_LABEL###'] = $this->cObj->stdWrap($markerArray['###'.strtoupper($requiredField).'_LABEL###'], $this->conf['apply_required_stdWrap.']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Some extra markers that don't come from the locallang.xml file\r\n\t\t$markerArray['###RSS_TITLE###'] = $this->cObj->stdWrap($this->conf['rss.']['title'], $this->conf['rss_title_stdWrap.']);\r\n\t\t$markerArray['###RSS_DESCRIPTION###'] = $this->cObj->stdWrap($this->conf['rss.']['description'], $this->conf['rss_description_stdWrap.']);\r\n\t\t$markerArray['###RSS_IMAGE###'] = $GLOBALS['TSFE']->baseUrlWrap($this->cObj->IMG_RESOURCE(array('file' => $this->conf['rss.']['image'])));\r\n\t\t$markerArray['###LINKTOLIST###'] = $GLOBALS['TSFE']->baseUrlWrap($this->cObj->getTypoLink_URL($this->conf['pid.']['list']?$this->conf['pid.']['list']:$GLOBALS['TSFE']->id));\r\n\t\t$markerArray['###LANGUAGE###'] = $GLOBALS['TSFE']->config['config']['language'];\r\n\r\n\t\treturn $markerArray;\r\n\t}", "public function get_label($data) {\n print_error('mustbeoveride', 'debug', '', 'get_label');\n }", "function get_label($args, $ctx) { }", "function labelType($type) {\n\tswitch ($type) {\n\t\tcase 1 :\n\t\t\treturn 'Administrateur';\n\t\t\tbreak;\n\t\tcase 2 :\n\t\t\treturn 'Mod&eacute;rateur';\n\t\t\tbreak;\n\t\tcase 3 :\n\t\t\treturn 'Utilisateur';\n\t\t\tbreak;\n\t}\n}", "public function getLabels(){\n $JSON = $this->makeRequest('?list=1');\n \n return $JSON['label'];\n }", "function bbp_get_topic_post_type_labels()\n{\n}", "function brettwysocki_get_labels( $singular, $plural = false, $type = 'cpt' ) {\n\n\t$labels = array();\n\n\tif ( !$plural ) {\n\t\t$plural = $singular . 's';\n\t}\n\n\tif ( $type == 'cpt' ) {\n\n\t\t$labels = array(\n\t\t\t'name' => __( $plural ),\n\t\t\t'singular_name' => __( $singular ),\n\t\t\t'menu_name' => __( $plural ),\n\t\t\t'name_admin_bar' => __( $singular ),\n\t\t\t'add_new' => __( 'Add New' ),\n\t\t\t'add_new_item' => __( 'Add New ' . $singular ),\n\t\t\t'new_item' => __( 'New ' . $singular ),\n\t\t\t'edit_item' => __( 'Edit ' . $singular ),\n\t\t\t'view_item' => __( 'View ' . $singular ),\n\t\t\t'all_items' => __( 'All ' . $plural ),\n\t\t\t'search_items' => __( 'Search ' . $plural ),\n\t\t\t'parent_item_colon' => __( 'Parent ' . $plural . ':' ),\n\t\t\t'not_found' => __( 'No ' . strtolower( $plural ) . ' found.' ),\n\t\t\t'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash.' )\n\t\t);\n\n\t} else if ( $type == 'taxonomy' ) {\n\n\t\t$labels = array(\n\t\t\t'name' => _x( $plural, 'taxonomy general name' ),\n\t\t\t'singular_name' => _x( $singular, 'taxonomy singular name' ),\n\t\t\t'search_items' => __( 'Search ' . $plural ),\n\t\t\t'popular_items' => __( 'Popular ' . $plural ),\n\t\t\t'all_items' => __( 'All ' . $plural ),\n\t\t\t'parent_item' => null,\n\t\t\t'parent_item_colon' => null,\n\t\t\t'edit_item' => __( 'Edit ' . $singular ),\n\t\t\t'update_item' => __( 'Update ' . $singular ),\n\t\t\t'add_new_item' => __( 'Add New ' . $singular ),\n\t\t\t'new_item_name' => __( 'New ' . $singular . ' Name' ),\n\t\t\t'separate_items_with_commas' => __( 'Separate ' . $plural . ' with commas' ),\n\t\t\t'add_or_remove_items' => __( 'Add or remove ' . $plural ),\n\t\t\t'choose_from_most_used' => __( 'Choose from the most used ' . $plural ),\n\t\t\t'not_found' => __( 'No ' . $plural . ' found.' ),\n\t\t\t'menu_name' => __( $plural ),\n\t\t);\n\t\n\t}\n\n\treturn $labels;\n}", "public static function get_iterator() {\n global $DB;\n /*\n * trick to leave search indexer functionality intact, but allow\n * this document to only use the below function to return info\n * to be searched\n */\n $labels = $DB->get_records('customlabel');\n return $labels;\n }", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "function bbp_get_forum_post_type_labels()\n{\n}", "public function getLabel() {}", "function getCustomName($type,$name)\r\r\n\t{\r\r\n\t\t$categories_array = $this->_arrayDb->loadArrayv2($type, $this->_lang);\r\r\n\t\treturn $categories_array[$name];\r\r\n\t}", "function bbp_get_reply_post_type_labels()\n{\n}", "public function getSubLabel();" ]
[ "0.6390233", "0.63345706", "0.62894493", "0.5923854", "0.58054644", "0.5730747", "0.57209337", "0.5699146", "0.5697249", "0.5598534", "0.55916625", "0.55915815", "0.5587856", "0.55852777", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.55495626", "0.5475037", "0.54731435", "0.5447933", "0.54426056", "0.5439973" ]
0.8074996
0
Initializes $paths with the contents of include_path. Note that you should configure your include path before the first usage of autoloading. The constructor is protected because Jm_Autoloader is currently implemented as a singleton. This may change.
protected function __construct() { $includePath = get_include_path(); $this->paths = explode(PATH_SEPARATOR, $includePath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_include_path( $paths ){\n\t\tif( ! is_array($paths) ){\n\t\t\t$paths = explode( ':', $paths );\n\t\t}\n\t\t// should include current location.\n\t\tif( ! in_array('.',$paths,true) && ! in_array($this->cwd,$paths,true) ){\n\t\t\tarray_unshift( $paths, '.' );\n\t\t}\n\t\t// paths should all be on current filesystem\n\t\t$this->incpaths = array();\n\t\tforeach( $paths as $i => $path ){\n\t\t\tif( $path{0} === '.' ){\n\t\t\t\t// allow refs relative to self\n\t\t\t\t$path = cleanpath( $this->cwd.'/'.$path );\n\t\t\t}\n\t\t\telse if( $path{0} !== '/' ){\n\t\t\t\t// else assume relative to virtual root\n\t\t\t\t$path = cleanpath( PLUG_VIRTUAL_DIR.'/'.$path );\n\t\t\t}\n\t\t\t// ensure under virtual root\n\t\t\tif( strpos($path,PLUG_VIRTUAL_DIR) !== 0 ){\n\t\t\t\ttrigger_error( \"Bad include path `{$paths[$i]}', must be under local virtual root, or relative to it\", E_USER_WARNING );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->incpaths[] = $path;\n\t\t}\n\t\treturn $this->incpaths;\n\t}", "public static function init()\n\t{\n\t\t$xml = simplexml_load_file(Autoloader::PATH_PROPERTIES);\n\t\t\n\t\tforeach ($xml->location as $location)\n\t\t{\n\t\t\tset_include_path(get_include_path().PATH_SEPARATOR.'app/' . $location->path . '/');\n\t\t}\n\t\t\n\t\tspl_autoload_register('Autoloader::load');\n\t}", "protected function _include() {\n $includes = array_map( array( $this, '_parse_path' ), $this->_config->includePaths );\n set_include_path( get_include_path() . PATH_SEPARATOR . implode( PATH_SEPARATOR, $includes ) );\n\t\t}", "public function __construct($paths) {\n parent::__construct(new FileLocator($paths));\n }", "public static function setup(array $paths = []) {\n\t\t$folders = [\n\t\t\t'controllers',\n\t\t\t'models',\n\t\t\t'views',\n\t\t\t'includes',\n\t\t\t'system'\n\t\t];\n\n\t\tforeach($folders as $folder) {\n\t\t\t$var_name = $folder . '_path';\n\t\t\tself::$$var_name = self::remove_slashes( isset($paths[$folder]) ? $paths[$folder] : \"../$folder\" );\n\t\t}\n\n\t\t//classes folder a little different a resides in includes.\n\t\tself::$classes_path = self::remove_slashes($paths['classes'] ?: (self::$includes_path . '/classes'));\n\t}", "public function __construct($paths) {\n foreach ($paths as $path) {\n $path = Filesystem::resolvePath($path);\n if (is_dir($path)) {\n $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n $this->dirs[$path] = true;\n }\n $this->files[] = $path;\n }\n }", "public static function autoloader_init( $include_pathes = array(), $prefixes = array(), $extension = FALSE ){\n\n\t\t\tif( FALSE === self::$abspath )\n\t\t\t\tself::$abspath = dirname( __FILE__ );\n\n\t\t\tif( ! is_array( $include_pathes ) )\n\t\t\t\t$include_pathes = (array) $include_pathes;\n\t\t\t\t\n\t\t\tif( ! empty( $include_pathes ) )\n\t\t\t\tself::set_includepathes( $include_pathes );\n\t\t\t\t\n\t\t\tif( ! is_array( $prefixes ) )\n\t\t\t\t$prefixes = (array) $prefixes;\n\t\t\t\t\n\t\t\tif( ! empty( $prefixes ) )\n\t\t\t\tself::$prefixes = $prefixes;\n\n\t\t\tif( FALSE !== $extension )\n\t\t\t\tself::$extension = $extension;\n\n\t\t\t/*\n\t\t\t * From php.net/spl_autoload (http://de3.php.net/manual/de/function.spl-autoload.php)\n\t\t *\n\t\t * 1. Add your class dir to include path\n\t\t * 2. You can use this trick to make autoloader look for commonly used \"My-class.php\" type filenames\n\t\t * 3. Use default autoload implementation or self defined autoloader\n\t\t */\n\n\t\t\tforeach( self::$include_pathes as $includepath ){\n\n\t\t\t\t$path = self::$abspath . DIRECTORY_SEPARATOR . $includepath;\n\n\t\t\t\t// check if the path have already been added to include_path\n\t\t\t\t$pathes = explode( PATH_SEPARATOR, get_include_path() );\n\n\t\t\t\tif( ! in_array( $path, $pathes ) )\n\t\t\t\t\t// set our path at the first position. require, include, __autoload etc. start searching in the first path\n\t\t\t\t\t// with our custom path at the first, PHP does not have to search in all other pathes for our classes\n\t\t\t\t\tset_include_path( $path . PATH_SEPARATOR . get_include_path() );\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\tself::register_extensions( self::$extension );\n\n\t\t\tspl_autoload_register( array( __CLASS__, 'autoload' ) );\n\n\t\t}", "public function __construct(array $paths)\n {\n $this->paths = $paths;\n }", "function autoload(array $autoload_paths)\n{\n\tset_include_path(get_include_path() . PATH_SEPARATOR . implode(PATH_SEPARATOR, $autoload_paths));\n\n\tfunction __autoload($class)\n\t{\n\t\trequire_once str_replace('\\\\', DIRECTORY_SEPARATOR, $class) . '.php';\n\t}\n}", "protected function autoload() {\n\t\t# Now iterate the registered paths\n\t\tif ($this->paths) {\n\t\t\tforeach ($this->paths as $entry) {\n\t\t\t\t$path = $entry['path'] ?? '';\n\t\t\t\t$recursive = $entry['recursive'] ?? false;\n\t\t\t\t$this->scanDirectory($path, $recursive);\n\t\t\t}\n\t\t}\n\t\t$this->loaded = true;\n\t\treturn $this;\n\t}", "public function __construct(array $paths)\n {\n foreach ($paths as $key => $value) {\n $this->paths[$key] = $value;\n }\n }", "protected function set_up()\n {\n $this->_oldIncludePath = get_include_path();\n\n // add _files dir to include path\n $addToPath = dirname(__FILE__) . '/_files';\n set_include_path($addToPath . PATH_SEPARATOR . $this->_oldIncludePath);\n }", "static function setIncludePath($array)\r\n\t{\r\n\t\tself::$_includePath = $array;\r\n\t}", "public static function loadComposerIncludePaths()\n {\n $includePaths = self::getIncludeReturn(self::$composerPaths['include_paths']);\n array_push($includePaths, get_include_path());\n set_include_path(join(PATH_SEPARATOR, $includePaths));\n }", "public function addIncludePaths($paths)\n\t{\n\t\tif (!empty($paths))\n\t\t{\n\t\t\tif (is_array($paths))\n\t\t\t{\n\t\t\t\t$this->includePaths = array_unique(array_merge($paths, $this->includePaths));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_unshift($this->includePaths, $paths);\n\t\t\t}\n\t\t}\n\t}", "private static function setDefaultIncludePath()\r\n\t{\r\n\t\t$enginePath = realpath(dirname(__FILE__) . '/../');\r\n\t\r\n\t\tself::$_includePath = array(\r\n\t\t);\r\n\t}", "public static function includePaths()\n {\n return Core::$paths;\n }", "public function __construct()\n {\n $paths = Config::get('routing.assets.paths', array());\n\n $this->paths = $this->parsePaths($paths);\n }", "public function getIncludePaths();", "public function __construct(array $paths)\n {\n //Filter out the files, the Finder class can not handle files in the ->in() call.\n $files = array_filter($paths, 'is_file');\n\n //Filter out the directories to be used for searching using the Filter class.\n $dirs = array_filter($paths, 'is_dir');\n\n $finder = new Finder();\n\n //Add the given 'stand-alone-files'\n $finder->append($files);\n\n //Add the Directores recursively\n $finder = $finder->in($dirs);\n\n //Filter out non readable files\n $finder = $finder->filter(\n function (SplFileInfo $finder) {\n return $finder->isReadable();\n }\n );\n\n //Loop through all the files and save the latest modification time.\n foreach ($finder->files() as $file) {\n /**@var $file \\SplFileInfo */\n if ($this->modification_time < $file->getMTime()) {\n $this->modification_time = $file->getMTime();\n }\n }\n }", "protected function _initAutoLoad()\n {\n require_once 'Zend/Loader/Autoloader.php';\n $this->loadConstants();\n \n /**\n * Setup of Autoloader workspace\n */\n $loader = Zend_Loader_Autoloader::getInstance();\n $loader->setFallbackAutoloader(true);\n set_include_path(\n '.'\n . PATH_SEPARATOR . APPLICATION_PATH . '/../library'\n . PATH_SEPARATOR . TANGERINE_APPLICATION_PATH . '/../library'\n . PATH_SEPARATOR . APPLICATION_PATH . '/models'\n . PATH_SEPARATOR . TANGERINE_APPLICATION_PATH . '/models'\n . PATH_SEPARATOR . APPLICATION_PATH . '/forms'\n . PATH_SEPARATOR . TANGERINE_APPLICATION_PATH . '/forms'\n . PATH_SEPARATOR . get_include_path()\n );\n \n /**\n * This allows Inheritance in Zend Controllers using Zend AutoLoader\n */\n $loader = new Zend_Loader_Autoloader_Resource(\n array(\n 'namespace' => '',\n 'basePath' => TANGERINE_APPLICATION_PATH\n )\n );\n \n $loader->addResourceTypes(\n array(\n array(\n 'type' => 'controllers',\n 'path' => '/controllers',\n 'namespace' => ''\n ),\n array(\n 'type' => 'controllers',\n 'path' => '/modules/elements/controllers',\n 'namespace' => 'Elements_'\n ),\n array(\n 'type' => 'controllers',\n 'path' => '/modules/components/controllers',\n 'namespace' => 'Components_'\n )\n )\n );\n }", "private function init_paths()\n {\n\n\t\t$this->next_template =\t\t\t\t__DIR__ . DIRECTORY_SEPARATOR . 'Next.template';\n\t\t$this->next_disabled_template =\t\t__DIR__ . DIRECTORY_SEPARATOR . 'NextDisabled.template';\n\t\t$this->last_template =\t\t\t\t__DIR__ . DIRECTORY_SEPARATOR . 'Last.template';\n\t\t$this->last_disabled_template =\t\t__DIR__ . DIRECTORY_SEPARATOR . 'LastDisabled.template';\n\t\t$this->first_template =\t\t\t\t__DIR__ . DIRECTORY_SEPARATOR . 'First.template';\n\t\t$this->first_disabled_template =\t__DIR__ . DIRECTORY_SEPARATOR . 'FirstDisabled.template';\n\t\t$this->previous_template =\t\t\t__DIR__ . DIRECTORY_SEPARATOR . 'Previous.template';\n\t\t$this->previous_disabled_template =\t__DIR__ . DIRECTORY_SEPARATOR . 'PreviousDisabled.template';\n\t\t$this->main_template =\t\t\t\t__DIR__ . DIRECTORY_SEPARATOR . 'Main.template';\n\t}", "function includePaths() {\n\t\tRuntime::_requires('4.3.0', 'includePaths');\n\t\treturn array_map('trim', explode(PATH_SEPARATOR, get_include_path()));\t\t\t\t\n\t}", "public static function setPaths( array $paths = null )\n {\n self::$paths = $paths;\n }", "public function setPaths(array $paths)\n {\n $this->paths = array_map(function ($path)\n {\n $path = str_replace(['\\\\', '/'], DIRECTORY_SEPARATOR, $path);\n $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n\n return $path;\n }, $paths);\n\n return $this;\n }", "function __construct(){\n $this->config = parse_ini_file('config.ini');\n $this->root_path = $_SERVER['DOCUMENT_ROOT'].'/'.$this->config['site_dir'];\n spl_autoload_register(function ($class_name){include 'lib/'.$class_name . '.php';});\n }", "private function autoload(){\n\t\tspl_autoload_register( array( $this, 'includes' ) );\n\t\tspl_autoload_register( array( $this, 'services' ) );\n\t\tspl_autoload_register( array( $this, 'objects' ) );\n\t\tspl_autoload_register( array( $this, 'patterns' ) );\n\t}", "public static function set_includepathes( $pathes = array() ){\n\n\t\t\tif( empty( $pathes ) )\n\t\t\t\treturn FALSE;\n\n\t\t\t$sanitized_pathes = array();\n\n\t\t\tforeach( $pathes as $path ){\n\n\t\t\t\tif( is_string( $path ) ){\n\n\t\t\t\t\t// strip slashes and backslashes at the start and end of the string /classes/ -> classes; /lib/classes/ -> lib/classes\n\t\t\t\t\t$path = preg_replace( \"#^[/|\\\\\\]|[/|\\\\\\]$#\", '', $path );\n\n\t\t\t\t\t// replace slashes and backslashes with the OS specific directory seperator\n\t\t\t\t\t$path = preg_replace( \"#[/|\\\\\\]#\", DIRECTORY_SEPARATOR, $path );\n\n\t\t\t\t\tif( is_dir( $path ) || is_dir( self::$abspath . '/' . $path ) )\n\t\t\t\t\t\tarray_push( $sanitized_pathes, $path );\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself::$include_pathes = $sanitized_pathes;\n\n\t\t\tunset( $sanitized_pathes );\n\n\t\t}", "public function setImportPaths(array $paths): void\n {\n $this->importPaths = $paths;\n }", "public function __construct($paths)\n {\n $finder = new Finder();\n // Only accept css, sass, scss, less, and stylus files.\n $finder->files()->name('/\\.(css|sass|scss|less|styl(?:us)?)$/')->in($paths);\n\n foreach ($finder as $fileInfo) {\n $file = new \\splFileObject($fileInfo);\n $commentParser = new CommentParser($file);\n foreach ($commentParser->getBlocks() as $commentBlock) {\n if (self::isKssBlock($commentBlock)) {\n $this->addSection($commentBlock, $file);\n }\n }\n }\n }" ]
[ "0.7234152", "0.6967688", "0.6855004", "0.67412585", "0.6695676", "0.66122895", "0.6579338", "0.6545778", "0.6536644", "0.64839494", "0.64291793", "0.6413785", "0.6376915", "0.6369475", "0.6306061", "0.62440807", "0.6241042", "0.62032634", "0.6128655", "0.6124013", "0.61220217", "0.6051675", "0.604053", "0.603467", "0.60296637", "0.60188144", "0.59776855", "0.5943024", "0.5923857", "0.59140503" ]
0.80613005
0
Check if all parameters to the current function are integers
protected function checkAllIntegers() { $foundNonInt = false; $args = func_get_args(); foreach ($args as $arg) { if (!is_int($arg)) { $foundNonInt = true; break; } } return !$foundNonInt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function any(){\n $are_any = false;\n $values = func_get_args();\n\n foreach($values as $value){\n if(is_integer($value)){\n $are_any = true;\n break;\n }\n }\n\n return $are_any;\n }", "public static function all(){\n $are_all = true;\n $values = func_get_args();\n\n foreach($values as $value){\n if(!is_integer($value)){\n $are_all = false;\n break;\n }\n }\n\n return $are_all;\n }", "function checkIfInt($arg){\n return is_numeric($arg) && is_int(+$arg);\n }", "function is_integer ($var) {}", "function is_int ($var) {}", "function isint($x){ return (is_numeric($x) ? intval($x) == $x : false); }", "public function isInteger(): bool\n {\n return false;\n }", "public static function isInt($parameter) {\r\n\r\n\t\treturn is_int($parameter) && !self::isEmpty($parameter);\r\n\t}", "function isInteger($input){\n\tif (is_array($input)) {\n\t\treturn false;\n\t}\n return(ctype_digit(strval($input)));\n}", "function isInt(&$int){\n\t\tif(filter_var($int, FILTER_VALIDATE_INT) === false) {\n \t\treturn false;\n\t\t} else {\n\t\t\t$int = (int) $int;\n\t\t return true;\n\t\t}\n\t}", "function is_intValued($var) {\r\n\t// Determines if a variable's value is an integer regardless of type\r\n\t// meant to be an analogy to PHP's is_numeric()\r\n\tif (is_int($var))\r\n\t\treturn TRUE;\r\n\tif (is_string($var) and $var === (string) (int) $var)\r\n\t\treturn TRUE;\r\n\tif (is_float($var) and $var === (float) (int) $var)\r\n\t\treturn TRUE;\r\n\telse\r\n\t\treturn FALSE;\r\n}", "function is_num ($var1) {\n if (is_numeric($var1)) {\n\n }\n}", "static function validate_integer($value, $param) {\t\t\n\t\treturn ($param && ($value == '')) || (is_int($value) || ctype_digit($value));\n\t}", "public function isInt()\n {\n return is_int($this->storedValue);\n }", "public static function validIsInt($value){\n if($value === null){\n return true;\n }\n \n return parent::validIsInt($value);\n }", "protected function is_array_of_ints( $array )\n\t{\n\t\tif ( ! is_array( $array ) || count( $array ) < 1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$all_int = true;\n\n\t\tforeach ( $array as $el ) {\n\t\t\tif ( ! is_numeric( $el ) ) {\n\t\t\t\t$all_int = false;\n\t\t\t}\n\t\t}\n\n\t\treturn $all_int;\n\t}", "function CheckIntVars($array_to_check=array())\n\t{\n\t\tif (!is_array($array_to_check)) {\n\t\t\treturn array();\n\t\t}\n\t\tforeach ($array_to_check as $p => $var) {\n\t\t\tif (!is_numeric($var)) {\n\t\t\t\tunset($array_to_check[$p]);\n\t\t\t}\n\t\t}\n\t\treturn $array_to_check;\n\t}", "static public function canBeInterpretedAsInteger($var) {\n\t\tif ($var === '' || is_object($var) || is_array($var)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn (string)intval($var) === (string)$var;\n\t}", "function is_numeric ($var) {}", "public function isInteger(): bool\n {\n return '1' === $this->getDenominator();\n }", "public function isIntegral(): bool\n {\n $integralTypes = [\n self::Int64,\n self::Int32,\n self::Int16,\n self::Byte,\n self::SByte,\n ];\n return in_array($this->getValue(), $integralTypes);\n }", "function v_is_numeric($var) {\n return is_numeric($var);\n}", "function isInteger($input)\n{\n return preg_match('@^[-]?[0-9]+$@', $input) === 1;\n}", "function looksLikeInt($multi) {\n return strval($multi) === strval((int) $multi);\n}", "function is_integer_modified($value)\n{\n\treturn is_int($value);\n}", "function validateint($raw_int)\r\n{\r\n return (filter_var($raw_int,FILTER_VALIDATE_INT)); \r\n}", "function array_is_numeric($array){\r\n\t\t$results = array();\r\n\t\tif(is_array($array)){\r\n\t\t\tforeach($array as $key => $item){\r\n\t\t\t\t$results[] = (is_numeric($item)&&is_numeric($key));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ( !in_array(false, $results) && count($results) > 0 );\r\n\t}", "function validate_ints($input_ints, $input_names) {\n\n foreach ($input_ints as $i => $input_int) {\n\n $valid = validate_int($input_int, $input_names[$i]);\n\n if (!$valid[0]) {\n\n return $valid;\n\n }\n\n }\n\n return $valid;\n\n}", "function checkIfNumber($val){\n\treturn is_numeric($val);\n}", "function is_integer_value($value)\n{\n\treturn is_numeric($value) ? intval($value) == $value : false;\n}" ]
[ "0.73394287", "0.7156436", "0.71495825", "0.7021951", "0.6956321", "0.65426207", "0.6471084", "0.6406952", "0.6403755", "0.6394262", "0.6242365", "0.62301683", "0.6212006", "0.6200019", "0.61601037", "0.6141478", "0.6101194", "0.6068967", "0.6049977", "0.6037481", "0.60080993", "0.5991504", "0.5967472", "0.5961585", "0.59417987", "0.59335786", "0.5918385", "0.59144026", "0.59094054", "0.5846675" ]
0.78541034
0
get All Meta by post type
function get_all_meta( $postType ) { global $wpdb; $_unset = array( "_edit_last", "_edit_lock" ); $_meta = array(); $results = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT meta_key FROM $wpdb->posts, $wpdb->postmeta WHERE post_type = %s AND $wpdb->posts.ID = $wpdb->postmeta.post_id", $postType ), ARRAY_A ); $results = array_diff( array_column( $results, 'meta_key' ), $_unset ); foreach ( $results as $result ) { if ( substr( $result, 0, 1 ) !== "_" ) { $_meta[ 'meta_' . $result ] = ucwords( str_replace( '_', ' ', $result ) ); } } return $_meta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function metas() {\n if(!is_null($this->metas)) return $this->metas;\n return $this->filterBy('type', 'meta');\n }", "public static function get_all_metakeys($post_type = 'shop_order') {\n global $wpdb;\n $meta = $wpdb->get_col($wpdb->prepare(\n \"SELECT DISTINCT pm.meta_key\n FROM {$wpdb->postmeta} AS pm\n LEFT JOIN {$wpdb->posts} AS p ON p.ID = pm.post_id\n WHERE p.post_type = %s\n AND p.post_status IN ( 'wc-pending', 'wc-processing', 'wc-on-hold', 'wc-completed', 'wc-cancelled', 'wc-refunded', 'wc-failed' ) ORDER BY pm.meta_key\", $post_type\n ));\n //sort($meta);\n return $meta;\n }", "public static function get_all_metakeys($post_type = 'shop_coupon') {\n global $wpdb;\n\n $meta = $wpdb->get_col($wpdb->prepare(\n \"SELECT DISTINCT pm.meta_key\n FROM {$wpdb->postmeta} AS pm\n LEFT JOIN {$wpdb->posts} AS p ON p.ID = pm.post_id\n WHERE p.post_type = %s\n AND p.post_status IN ( 'publish', 'pending', 'private', 'draft' )\", $post_type\n ));\n\n sort($meta);\n\n return $meta;\n }", "private function get_post_metas() {\n\t\tif ( $this->post_id === null ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$metas = array();\n\t\tforeach ( $this->available_post_meta as $meta ) {\n\t\t\t$meta_value = get_post_meta( $this->post_id, $meta, true );\n\t\t\tif ( empty( $meta_value ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$metas[ $meta ] = $meta_value;\n\t\t}\n\n\t\treturn $metas;\n\t}", "protected function find_metas(){\n\t\t$wpdb = $this->get_wpdb();\n if ( $wpdb ) {\n $table = $wpdb->prefix . 'cf_form_entry_meta';\n $sql = $wpdb->prepare(\"SELECT * FROM $table WHERE `entry_id` = %d\", $this->entry_id);\n $results = $wpdb->get_results($sql);\n if (!empty($results)) {\n foreach ($results as $result) {\n $_meta = new Caldera_Forms_Entry_Meta();\n $_meta = $_meta->set_form_object($result);\n $this->meta[] = $_meta;\n }\n }\n }\n\t}", "function tsml_get_meta($type, $id=null) {\n\tglobal $wpdb;\n\t//don't show contact information if user is not logged in\n\t//contact info still available on an individual meeting basis via tsml_get_meeting()\n\t$keys = array(\n\t\t'tsml_group' => '\"website\", \"website_2\", \"email\", \"phone\", \"venmo\", \"last_contact\"' . (current_user_can('edit_posts') ? ', \"contact_1_name\", \"contact_1_email\", \"contact_1_phone\", \"contact_2_name\", \"contact_2_email\", \"contact_2_phone\", \"contact_3_name\", \"contact_3_email\", \"contact_3_phone\"' : ''),\n\t\t'tsml_location' => '\"formatted_address\", \"latitude\", \"longitude\"',\n\t\t'tsml_meeting' => '\"day\", \"time\", \"end_time\", \"types\", \"group_id\", \"website\", \"website_2\", \"email\", \"phone\", \"last_contact\", \"conference_url\", \"conference_phone\"' . (current_user_can('edit_posts') ? ', \"contact_1_name\", \"contact_1_email\", \"contact_1_phone\", \"contact_2_name\", \"contact_2_email\", \"contact_2_phone\", \"contact_3_name\", \"contact_3_email\", \"contact_3_phone\"' : ''),\n\t);\n\tif (!array_key_exists($type, $keys)) return trigger_error('tsml_get_meta for unexpected type ' . $type);\n\t$meta = array();\n\t$query = 'SELECT post_id, meta_key, meta_value FROM ' . $wpdb->postmeta . ' WHERE \n\t\tmeta_key IN (' . $keys[$type] . ') AND \n\t\tpost_id ' . ($id ? '= ' . $id : 'IN (SELECT id FROM ' . $wpdb->posts . ' WHERE post_type = \"' . $type . '\")');\n\t$values = $wpdb->get_results($query);\n\tforeach ($values as $value) {\n\t\t$meta[$value->post_id][$value->meta_key] = $value->meta_value;\n\t}\n\t\n\t//get taxonomy\n\tif ($type == 'tsml_location') {\n\t\t$regions = $wpdb->get_results('SELECT \n\t\t\t\tr.`object_id` location_id,\n\t\t\t\tt.`term_id` region_id,\n\t\t\t\tt.`name` region\n\t\t\tFROM ' . $wpdb->term_relationships . ' r\n\t\t\tJOIN ' . $wpdb->term_taxonomy . ' x ON r.term_taxonomy_id = x.term_taxonomy_id\n\t\t\tJOIN ' . $wpdb->terms . ' t ON x.term_id = t.term_id\n\t\t\tWHERE x.taxonomy = \"tsml_region\"');\n\t\tforeach ($regions as $region) {\n\t\t\t$meta[$region->location_id]['region'] = $region->region;\n\t\t\t$meta[$region->location_id]['region_id'] = $region->region_id;\n\t\t}\n\t} elseif ($type == 'tsml_group') {\n\t\t$districts = $wpdb->get_results('SELECT \n\t\t\t\tr.`object_id` group_id,\n\t\t\t\tt.`term_id` district_id,\n\t\t\t\tt.`name` district\n\t\t\tFROM ' . $wpdb->term_relationships . ' r\n\t\t\tJOIN ' . $wpdb->term_taxonomy . ' x ON r.term_taxonomy_id = x.term_taxonomy_id\n\t\t\tJOIN ' . $wpdb->terms . ' t ON x.term_id = t.term_id\n\t\t\tWHERE x.taxonomy = \"tsml_district\"');\n\t\tforeach ($districts as $district) {\n\t\t\t$meta[$district->group_id]['district'] = $district->district;\n\t\t\t$meta[$district->group_id]['district_id'] = $district->district_id;\n\t\t}\n\t}\n\t\n\tif ($id) return array_key_exists($id, $meta) ? $meta[$id] : array();\n\treturn $meta;\n}", "public function getMeta();", "public function getMeta();", "public function getMeta() {}", "public static function getMeta();", "public static function getBlogsByMeta($type, $meta_value) {\n\n $query = self::orderBy('id', 'desc')\n ->join('blog_metas','blog_metas.blog_id', '=', 'blogs.id')\n ->join('metas','metas.id', '=', 'blog_metas.meta_id')\n ->select('blogs.*')\n ->where('metas.slug',$meta_value)\n ->where('metas.meta_type',$type);\n $query = $query->paginate(12);\n return $query;\n }", "public function getMetas(): array\n {\n return $this->metas;\n }", "function get_all_posttype(){\n\t\tglobal $wp_post_types;\n\n\t $types = $wp_post_types;\n\t $postypes = array();\n\n\t foreach( $types as $typekey => $type )\n\t {\n\t \tarray_push($postypes, $typekey);\n\t }\n\n\t return $postypes;\n\n\t}", "public function get_all_items_meta() : iterable ;", "public function listMetas() {\n $this->view = 'list_metas';\n \n $this->paginate = $this->Meta->getMetasList(true);\n $metasList = $this->paginate('Meta');\n $metasList = $this->Meta->formatMetasList($metasList, false);\n \n $this->set('metasList', $metasList);\n $this->set('shortDescriptionLength', 40);\n\t}", "public function pmdt_get_metatags() {\r\n\t\t//Distinguishing if we are working on a post --- chapter level or on the main site level\r\n\t\t//The type_level variable is the string we used to create the metabox\r\n\r\n\t\t$is_site; // This bool var is used to identify if the level is site level or any other post level\r\n\t\tif ( $this->type_level == 'metadata' || $this->type_level == 'site-meta' ) { //loading the appropriate metadata depending on the type level\r\n\t\t\t$metadata = gen_func::get_metadata();\r\n\t\t\t$is_site = true;\r\n\t\t} else {\r\n\t\t\t$is_site = false;\r\n\t\t\t$metadata = get_post_meta( get_the_ID() );\r\n\t\t}\r\n\r\n\t\t// array of the items needed to become microtags\r\n\t\t$Product_data = array(\r\n\r\n\t\t\t'additionalProperty' => 'pb_additionalProperty',\r\n\t\t\t'aggregateRating' => 'pb_aggregateRating',\r\n\t\t\t'audience' => 'pb_audience',\r\n\t\t\t'award' => 'pb_award',\r\n\t\t\t'brand' => 'pb_brand',\r\n\t\t\t'category' => 'pb_category',\r\n\t\t\t'color' => 'pb_color',\r\n\t\t\t'depth' => 'pb_depth',\r\n\t\t\t'gtin12' => 'pb_gtin12',\r\n\t\t\t'gtin13' => 'pb_gtin13',\r\n\t\t\t'gtin14' => 'pb_gtin14',\r\n\t\t\t'gtin8' => 'pb_gtin8',\r\n\t\t\t'height' => 'pb_height',\r\n\t\t\t'isAccessoryOrSparePartFor' => 'pb_isAccessoryOrSparePartFor',\r\n\t\t\t'isConsumableFor' => 'pb_isConsumableFor',\r\n\t\t\t'isRelatedTo' => 'pb_isRelatedTo',\r\n\t\t\t'isSimilarTo' => 'pb_isSimilarTo',\r\n\t\t\t'itemCondition' => 'pb_itemCondition',\r\n\t\t\t'logo' => 'pb_logo',\r\n\t\t\t'manufacturer' => 'pb_manufacturer',\r\n\t\t\t'material' => 'pb_material',\r\n\t\t\t'model' => 'pb_model',\r\n\t\t\t'mpn' => 'pb_mpn',\r\n\t\t\t'offers' => 'pb_offers',\r\n\t\t\t'productID' => 'pb_productID',\r\n\t\t\t'productionDate' => 'pb_productionDate',\r\n\t\t\t'purchaseDate' => 'pb_purchaseDate',\r\n\t\t\t'releaseDate' => 'pb_releaseDate',\r\n\t\t\t'review' => 'pb_review',\r\n\t\t\t'sku' => 'pb_sku',\r\n\t\t\t'weight' => 'pb_weight',\r\n\t\t\t'width' => 'pb_width',\r\n\t\t);\r\n\r\n\t\t$html = \"<!-- Microtags --> \\n\";\r\n\r\n\t\t$html .= '<div itemscope itemtype=\"http://schema.org/Product\">';\r\n\r\n\t\tforeach ( $Product_data as $itemprop => $content ) {\r\n\t\t\tif ( isset( $metadata[ $content . '_' . $this->type_level ] ) ) {\r\n\r\n\t\t\t\tif ( !$is_site ) { //we are using the get_first function to get the value from the returned array\r\n\t\t\t\t\t$value = $this->pmdt_get_first( $metadata[ $content . '_' . $this->type_level ] );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif($this->type_level == 'site-meta'){\r\n\t\t\t\t\t\t$value = $this->pmdt_get_first($metadata[ $content . '_' . $this->type_level ]);\r\n\t\t\t\t\t}else{//We always use the get_first function except if our level is metadata coming from pressbooks\r\n\t\t\t\t\t\t$value = $metadata[ $content . '_' . $this->type_level ];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$html .= \"<meta itemprop = '\" . $itemprop . \"' content = '\" . $value . \"'>\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$html .= '</div>';\r\n\t\treturn $html;\r\n\t}", "public function get_all_podcast_meta(Request $request) {\n $all_data = PodcastMetaData::where(function ($query) use ($request) {\n if ($request->query('query') != '') {\n $query->where('meta_name', 'like', '%' . $request->query('query') . '%');\n $query->where('meta_type', 'like', '%' . $request->query('type') . '%');\n }\n })\n ->orderBy('id', 'desc')\n ->get();\n $data = [];\n foreach ($all_data as $key => $value) {\n if ($request->query('type') == 'podcast_category') {\n $data[] = ['text' => $value->meta_name, 'value' => $value->meta_name];\n } else {\n $data[] = ['text' => $value->meta_name, 'value' => $value->meta_name];\n }\n }\n return response()\n ->json($data);\n\n }", "function acfe_get_post_type_objects($args = array()){\n \n // vars\n $return = array();\n \n // Post Types\n $posts_types = acf_get_post_types($args);\n \n // Choices\n if(!empty($posts_types)){\n \n foreach($posts_types as $post_type){\n \n $post_type_object = get_post_type_object($post_type);\n \n $return[$post_type_object->name] = $post_type_object;\n \n }\n \n }\n \n return $return;\n \n}", "public function meta()\n {\n return $this->hasMany('WordpressDB\\PostMeta', 'post_id', 'ID');\n }", "abstract public function get_meta_type();", "public function initMeta() {\n\n foreach ($this->postTypes as $postType) {\n add_meta_box(\n $this->id,\n $this->title,\n array(\n &$this,\n 'render'\n ),\n $postType,\n $this->context,\n $this->priority\n );\n }\n\n }", "public function getManageMeta();", "public function fetch_post_types() {\n $args = array( \n 'public' => true,\n '_builtin' => true\n );\n \n $post_types = get_post_types( $args, 'objects', 'and' );\n return $post_types;\n }", "private function meta_tags() {\n\n /*\n Create an empty array\n */\n\n $frontend_meta = array();\n\n /*\n Get Current Route\n */\n\n $current_route = !empty( Route::getCurrentRoute()->getName() ) ? Route::getCurrentRoute()->getName() : '';\n \n if( isset( $current_route ) && !empty( $current_route) ) {\n\n /*\n Get Meta Fields using current route;\n */\n $metaTags = StaticPageSeo::where( 'route', $current_route )->first();\n\n if( isset( $metaTags ) && !empty( $metaTags) ) {\n $frontend_meta['name'] = $metaTags['name'];\n $frontend_meta['route'] = $metaTags['route'];\n $frontend_meta['meta_title'] = $metaTags['meta_title'];\n $frontend_meta['meta_description']= $metaTags['meta_description'];\n $frontend_meta['meta_keyword'] = $metaTags['meta_keyword'];\n }\n }\n\n return $frontend_meta;\n }", "public function meta(){\n return $this->hasMany(PostMeta::class, 'post_id', 'ID');\n }", "function ContentArchiverMetaBoxes(){\n add_meta_box(\n 'wlccca-meta-box',\n __( 'WishList Content Archiver', 'wl-contentcontrol-archiver' ),\n array(&$this,'ContentArchOptions'),\n 'post'\n );\n add_meta_box(\n 'wlccca-meta-box',\n __( 'WishList Content Archiver', 'wl-contentcontrol-archiver' ),\n array(&$this,'ContentArchOptions'),\n 'page'\n );\n //get custom post type\n $custom_types = get_post_types(array('public'=> true,\"_builtin\"=>false));\n foreach($custom_types as $i=>$ctype){\n add_meta_box(\n 'wlccca-meta-box',\n __( 'WishList Content Archiver', 'wl-contentcontrol-archiver' ),\n array(&$this,'ContentArchOptions'),\n $ctype\n );\n }\n }", "public function getMetas ()\n {\n return $this->seo->getMetas();\n }", "public function getMeta() {\n\t\tif (!($this->itsMeta instanceof Collection))\n\t\t\t$this->loadMeta();\n\n\t\treturn call_user_func_array(array($this->itsMeta, \"find\"), func_get_args());\n\t}", "public function getMetaValues( $post ){\t\t\n\t\t/* Get the current metabox existing value */\n\t\t$metas = $this->db->get_results( $this->db->prepare(\n\t\t\t'SELECT \n\t\t\t\tREPLACE(m.`meta_key`, %s, \"\") AS meta_key,\n\t\t\t\tm.`meta_value`\n\t\t\tFROM\n\t\t\t\t'. $this->db->postmeta .' m\n\t\t\t\tLEFT JOIN '. EFM_DB_METAS .' efm\n\t\t\t\t\tON efm.`meta_id` = m.`meta_id`\n\t\t\tWHERE m.`post_id` = %d\n\t\t\t\tAND efm.`field_id` IS NOT NULL\n\t\t\t\tAND efm.`panel_id` = %d',\n\t\t\t$this->panel['name'] .'_', $post->ID, $this->panel['id']\n\t\t));\n\t\t\n\t\tif( !empty( $metas) ){\n\t\t\tforeach( $metas as $value ){\n\t\t\t\t$data = @unserialize( $value->meta_value );\n\t\t\t\t$this->meta[$value->meta_key] = ( $options === 'b:0;' || $data !== false) ? $data : $value->meta_value;\n\t\t\t}\n\t\t}\t\n\t}", "function s4w_get_all_post_types() {\n global $wpdb;\n //remove the defualt attachment/revision and menu from the returned types.\n $query = $wpdb->get_results(\"SELECT DISTINCT(post_type) FROM $wpdb->posts WHERE post_type NOT IN('attachment', 'revision', 'nav_menu_item') ORDER BY post_type\");\n if ($query) {\n $types = array();\n foreach ( $query as $type ) {\n $types[] = $type->post_type;\n } \n return $types;\n }\n}" ]
[ "0.7692945", "0.70145285", "0.6746516", "0.66938543", "0.66476977", "0.6581696", "0.65648055", "0.65648055", "0.6472816", "0.6449771", "0.6444162", "0.64350533", "0.6410651", "0.6406831", "0.63670105", "0.6353182", "0.6351563", "0.63508046", "0.6326613", "0.6277084", "0.62523896", "0.6243778", "0.6169672", "0.6160532", "0.6151507", "0.6134982", "0.6118041", "0.6117912", "0.6063266", "0.60538596" ]
0.7329417
1
Merges an attribute array with default values. Merged when the attribute value is "" or doesn't exist.
function berg_attributes_default( $attributes, $defaults ) { $out = array(); foreach ( $attributes as $name => $value ) { $out[ $name ] = $value; } foreach ( $defaults as $name => $default ) { if ( array_key_exists( $name, $out ) ) { if ( $out[ $name ] === '' ) { $out[ $name ] = $default; } } else { $out[ $name ] = $default; } } return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAttributeDefaults();", "protected static function handleDefaultValues($atts, $attributes) {\n if(!is_array($atts)) {\n $atts = [];\n }\n foreach ($attributes as $field_name => $defaultValue) {\n $atts[$field_name] = (isset($atts[$field_name])) ? $atts[$field_name] : $defaultValue;\n }\n return $atts;\n }", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'someField' => array(AttributeType::String, 'default' => 'some value'),\n ));\n }", "protected function fillDefaultAttributes()\n {\n foreach ($this->defaultAttributes as $name)\n {\n if (! in_array($name, $this->getFillable())) {\n continue;\n }\n\n $this->setAttribute(\n $name, config(\"przelewy24.$name\")\n );\n }\n }", "public function getDefaultAttributes()\n {\n return array_unique(array_merge($this->_getDefaultAttributes(), [$this->getEntityIdField(), $this->getLinkField()]));\n }", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'notifications' => array(\n AttributeType::Mixed, \n 'default' => ''\n ),\n ));\n }", "public function get_default_attributes() {\n\n // Start with an empty array\n $defaults = array();\n\n // Make sure shortcode has attributes\n if ( ! $this->config['attributes'] ) {\n return;\n }\n\n // Fill defaults with each setting and its default\n foreach ( $this->config['attributes'] as $control ) {\n $defaults[$control->handle] = $control->config['default'];\n }\n\n // Return filled array\n return $defaults;\n\n }", "private function getDefaultAttributes(): array\n {\n return [\n 'name' => [\n 'type' => 'varchar',\n 'label' => 'Name',\n 'input' => 'text',\n 'sort_order' => 1,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'is_active' => [\n 'type' => 'int',\n 'label' => 'Is Active',\n 'input' => 'select',\n 'source' => Boolean::class,\n 'sort_order' => 2,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'url_key' => [\n 'type' => 'varchar',\n 'label' => 'URL Key',\n 'input' => 'text',\n 'required' => false,\n 'sort_order' => 3,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'description' => [\n 'type' => 'text',\n 'label' => 'Description',\n 'input' => 'textarea',\n 'required' => false,\n 'sort_order' => 4,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'wysiwyg_enabled' => true,\n 'is_html_allowed_on_front' => true,\n 'group' => 'General',\n ],\n 'image' => [\n 'type' => 'varchar',\n 'label' => 'Image',\n 'input' => 'image',\n 'backend' => Image::class,\n 'required' => false,\n 'sort_order' => 5,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n ];\n }", "public function getDefaultAttributes()\n {\n $attributes = array();\n $attributes[] = 'url_key';\n $attributes[] = 'url_path';\n $attributes[] = 'sku';\n $attributes[] = 'price';\n $attributes[] = 'final_price';\n $attributes[] = 'price_model';\n $attributes[] = 'price_type';\n $attributes[] = 'special_price';\n $attributes[] = 'special_from_date';\n $attributes[] = 'special_to_date';\n $attributes[] = 'type_id';\n $attributes[] = 'tax_class_id';\n $attributes[] = 'tax_percent';\n $attributes[] = 'weight';\n $attributes[] = 'visibility';\n $attributes[] = 'type_id';\n $attributes[] = 'image';\n $attributes[] = 'small_image';\n $attributes[] = 'thumbnail';\n $attributes[] = 'status';\n\n return $attributes;\n }", "public function getDefaultAttributes()\n {\n $default_attributes = [\n new TextAttribute('identifier', $this),\n new IntegerAttribute('revision', $this, [ 'default_value' => 0 ]),\n new UuidAttribute('uuid', $this, [ 'default_value' => 'auto_gen' ]),\n new TextAttribute('language', $this, [ 'default_value' => 'de_DE' ]),\n new IntegerAttribute('version', $this, [ 'default_value' => 1 ]),\n new TextAttribute('workflow_state', $this),\n new KeyValueListAttribute('workflow_parameters', $this)\n ];\n\n if ($this->isHierarchical()) {\n $default_attributes[] = new TextAttribute('parent_node_id', $this);\n }\n\n $default_attributes_map = new AttributeMap($default_attributes);\n return parent::getDefaultAttributes()->append($default_attributes_map);\n }", "protected function getDefaultsReplace()\n {\n if ( ! config('pxlcms.generator.models.include_defaults')) return '';\n\n $attributes = $this->data['defaults'] ?: [];\n\n if ( ! count($attributes)) return '';\n\n // align assignment signs by longest attribute\n $longestLength = 0;\n\n foreach ($attributes as $attribute => $default) {\n\n if (strlen($attribute) > $longestLength) {\n $longestLength = strlen($attribute);\n }\n }\n\n $replace = $this->tab() . \"protected \\$attributes = [\\n\";\n\n foreach ($attributes as $attribute => $default) {\n\n $replace .= $this->tab(2)\n . \"'\" . str_pad($attribute . \"'\", $longestLength + 1)\n . \" => \" . $default . \",\\n\";\n }\n\n $replace .= $this->tab() . \"];\\n\\n\";\n\n return $replace;\n }", "function _parse_form_attributes($attributes, $default)\n {\n if (is_array($attributes))\n {\n foreach ($default as $key => $val)\n {\n if (isset($attributes[$key]))\n {\n $default[$key] = $attributes[$key];\n unset($attributes[$key]);\n }\n }\n\n if (count($attributes) > 0)\n {\n $default = array_merge($default, $attributes);\n }\n }\n\n $att = '';\n\n foreach ($default as $key => $val)\n {\n if ($key === 'value')\n {\n $val = html_escape($val);\n }\n elseif ($key === 'name' && ! strlen($default['name']))\n {\n continue;\n }\n\n $att .= $key.'=\"'.$val.'\" ';\n }\n\n return $att;\n }", "protected function autoAssignAttributes()\n {\n $attributes = isset($this->defaultAttributes) ? $this->defaultAttributes : [];\n // Default attributes are not counted as \"from storage\"\n $this->fillAttributes($attributes, false);\n }", "function ldc_list_defaultize(&$warnings, &$atts, $att_name, $default) {\n\n //// Add a warning. \n $warnings[] = \"Attribute `$att_name` had invalid value '$atts[$att_name]'. Used default '$default' instead\";\n\n //// Ue the default value. \n $atts[$att_name] = $default;\n\n}", "public function fill(array $attributes);", "private function set_default_values(&$array)\n\t{\n\t\t$array['category_id'] = ($array['category_id'] == '') ? NULL : $array['category_id']; // to deprecate\n\t\t$array['postal_format_id'] = ($array['postal_format_id'] == '') ? NULL : $array['postal_format_id'];\n\t\t$array['display_price'] = ($array['display_price'] == '') ? 1 : $array['display_price'];\n\t\t$array['disable_purchase'] = ($array['disable_purchase'] == '') ? 0 : $array['disable_purchase'];\n\t\t$array['display_offer'] = ($array['display_offer'] == '') ? 0 : $array['display_offer'];\n\t\t$array['featured'] = ($array['featured'] == '') ? 0 : $array['featured'];\n\t\t$array['out_of_stock'] = ($array['out_of_stock'] == '') ? 0 : $array['out_of_stock'];\n\t\t$array['publish'] = ($array['publish'] == '') ? 1 : $array['publish'];\n\t\t$array['deleted'] = ($array['deleted'] == '') ? 0 : $array['deleted'];\n\t\t$array['weight'] = ($array['weight'] == '') ? 0 : $array['weight'];\n\t\t$array['min_width'] = ($array['min_width'] == '') ? 0 : $array['min_width'];\n\t\t$array['min_height'] = ($array['min_height'] == '') ? 0 : $array['min_height'];\n\t\t$array['order'] = ($array['order'] == '') ? 0 : $array['order'];\n\t}", "protected function mergeAttributeArrays(array &$inputData)\n {\n $inputData['attributes'] = AttributesHelper::mergeAttributes($inputData['attributes'] ?? []);\n }", "protected function _getDefaultAttributes()\n {\n\t\t$ret = parent::_getDefaultAttributes();\n\t\t$ret[] = 'is_active';\n\t\treturn $ret;\n }", "private function mergeAttributes()\n {\n $attribute = '';\n foreach ($this->attribute as $name => $value) {\n $attribute .= ' ' . $name . '=\"' . $value . '\"';\n }\n\n return $attribute;\n }", "public function mergeAttribute($attributeName, $additionalValue);", "protected function _getDefaultAttributes()\n {\n return ['entity_type_id', 'attribute_set_id', 'created_at', 'updated_at'];\n }", "protected function makeOptionalAttributes(array $attributes): array\n {\n $attr = [];\n foreach ($attributes as $key => $value) {\n if (array_key_exists($key, $this->attributes)) {\n $attr[$key] = $value;\n } elseif (is_int($key) && array_key_exists($value, $this->attributes)) {\n $attr[$value] = $this->attributes[$value];\n }\n }\n\n return $attr;\n }", "public function defaultValues(array $default);", "public function applyDefaultValues()\n\t{\n\t}", "public function getValidDefaultAttributes(): array\n {\n return [\n 'Empty string' => [\n 'element_default_0001.xsd', \n '', \n ], \n 'Only white spaces' => [\n 'element_default_0002.xsd', \n ' ', \n ], \n 'Alphanumeric' => [\n 'element_default_0003.xsd', \n 'foo3bar6baz9', \n ], \n 'Alphanumeric with white spaces' => [\n 'element_default_0004.xsd', \n ' foo2 bar9 baz8 qux1 ', \n ], \n ];\n }", "public function applyDefaultValues()\n {\n $this->arcucustid = '';\n $this->arstshipid = '';\n }", "public function getDefaultValues();", "public function assignDefaultValues() {\n\t\t$this->assignByArray(self::$DEFAULT_VALUES);\n\t}", "public function fill(array $attributes)\n {\n return parent::fill($this->convertAliasedAttributes($attributes));\n }", "abstract protected function defaults(): array;" ]
[ "0.67492664", "0.6684253", "0.65212464", "0.63610774", "0.6340822", "0.6242402", "0.6193038", "0.6157145", "0.6106403", "0.60136455", "0.6009733", "0.5980961", "0.5956476", "0.59147424", "0.5893293", "0.5882393", "0.58735603", "0.5810316", "0.580633", "0.57822925", "0.57747275", "0.5755199", "0.5736137", "0.5709132", "0.57053256", "0.57034177", "0.5699696", "0.5675641", "0.56694645", "0.5658208" ]
0.6840372
0
REST Callback. Gets all the terms registered for all post types (including category and tags).
function berg_rest_get_terms() { $args = array( 'public' => true, ); $taxonomies = get_taxonomies( $args, 'objects' ); $_defaultFields = default_display_fields(); $return = array(); $post_types = get_post_types( array( 'public' => true ), 'objects' ); foreach ( $post_types as $post_type => $data ) { // Don't include attachments. if ( $post_type === 'attachment' ) { continue; } $return[ $post_type ] = array( 'label' => $data->label, 'taxonomies' => array(), ); $return[ $post_type ]['display_orders'] = array_merge( $_defaultFields, get_all_meta( $post_type ) ); } foreach ( $taxonomies as $taxonomy_slug => $taxonomy ) { foreach ( $taxonomy->object_type as $post_type ) { // Don't include post formats. if ( $post_type === 'post' && $taxonomy_slug === 'post_format' ) { continue; } $return[ $post_type ]['display_orders'][ 'taxonomy_' . $taxonomy_slug ] = $taxonomy->label; $return[ $post_type ]['taxonomies'][ $taxonomy_slug ] = array( 'label' => $taxonomy->label, 'terms' => get_terms( $taxonomy->name ), ); } } return new WP_REST_Response( $return, 200 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function berg_get_terms_endpoint() {\n\t\tregister_rest_route( 'wp/v2', '/berg_terms', array(\n\t\t\t'methods' => 'GET',\n\t\t\t'callback' => 'berg_rest_get_terms',\n\t\t\t'permission_callback' => function () {\n\t\t\t\treturn current_user_can( 'edit_posts' );\n\t\t\t},\n\t\t) );\n\t}", "public function enterprise_plugin_terms_endpoint( $wp_rest_server ) {\n\t\t$posts = array(\n\t\t\t'posts' => array(),\n\t\t\t'max_pages' => '',\n\t\t);\n\n\t\t$tax_query = ( $wp_rest_server['term_types'] )\n\t\t\t? array(\n\t\t\t\t'taxonomy' => 'term_types',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => $wp_rest_server['term_types'],\n\t\t\t)\n\t\t\t: false;\n\n\t\t$search_query = ( $wp_rest_server['s'] ) ?: '';\n\n\t\t$page = ( $wp_rest_server['page'] ) ?: 1;\n\n\t\t$args = array(\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'title',\n\t\t\t'post_type' => 'terms',\n\t\t\t'posts_per_page' => 9,\n\t\t\t'paged' => $page,\n\t\t\t's' => $search_query,\n\t\t\t'tax_query' => array(\n\t\t\t\t$tax_query,\n\t\t\t),\n\t\t);\n\n\t\t$terms_query = new WP_Query( $args );\n\n\t\tif ( $terms_query->have_posts() ) {\n\t\t\twhile ( $terms_query->have_posts() ) {\n\t\t\t\t$terms_query->the_post();\n\n\t\t\t\t$posts['posts'][] = array(\n\t\t\t\t\t'id' => get_the_ID(),\n\t\t\t\t\t'title' => html_entity_decode( get_the_title() ),\n\t\t\t\t\t'content' => html_entity_decode( get_the_content() ),\n\t\t\t\t\t'acf' => ( function_exists( 'get_fields' ) ) ? get_fields( get_the_ID() ) : false,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\twp_reset_postdata();\n\n\t\t$posts['max_pages'] = $terms_query->max_num_pages;\n\t\treturn $posts;\n\t}", "public function getTerms(): array {\n return $this->predefinedTypes;\n }", "public function getTerms() {}", "public function ajaxGetTaxonomies() {\n\t\t$taxonomy = kalium()->post( 'taxonomy' );\n\n\t\t$resp = array(\n\t\t\t'success' => false\n\t\t);\n\n\t\tif ( $taxonomy ) {\n\t\t\t$entries = get_terms( array(\n\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t'hide_empty' => false\n\t\t\t) );\n\n\t\t\t$entries_select = array();\n\t\t\t$entries_select[] = $this->anyItem();\n\n\t\t\tforeach ( $entries as $entry ) {\n\n\t\t\t\t$entries_select[] = array(\n\t\t\t\t\t'value' => $entry->term_id,\n\t\t\t\t\t'text' => $entry->name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\twp_reset_postdata();\n\n\t\t\t$resp['entries'] = $entries_select;\n\t\t\t$resp['success'] = true;\n\t\t}\n\n\t\techo json_encode( $resp );\n\t\tdie();\n\t}", "function getResourceTerms( $post_id, $taxonomy ){\n // name,link\n $term_list = wp_get_post_terms( $post_id, $taxonomy );\n $final_terms = array();\n\n // Iterate through each terms\n foreach( $term_list as $term ){\n array_push( $final_terms, \"<a href='\".get_term_link( $term ).\"'>\" . $term->name . \"</a>\" );\n }\n\n return $final_terms;\n}", "public function ajax_get_taxonomies() {\n\t\t$post_names = json_decode( stripslashes( $_GET['post_names'] ), true );\n\n\t\techo json_encode( $this->get_taxonomies_for_posts( $post_names ) );\n\n\t\tdie();\n\t}", "function lae_get_all_taxonomy_options() {\n\n $taxonomies = lae_get_all_taxonomies();\n\n $results = array();\n foreach ($taxonomies as $taxonomy) {\n $terms = get_terms(array('taxonomy' => $taxonomy));\n foreach ($terms as $term)\n $results[$term->taxonomy . ':' . $term->slug] = $term->taxonomy . ':' . $term->name;\n }\n\n return apply_filters('lae_taxonomy_options', $results);\n}", "public function actionGetTerms();", "public function enterprise_plugin_register_terms_rest_route() {\n\t\tregister_rest_route(\n\t\t\t'terms/v1',\n\t\t\t'/post/',\n\t\t\tarray(\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'callback' => array( $this, 'enterprise_plugin_terms_endpoint' ),\n\t\t\t)\n\t\t);\n\t}", "function custom_taxonomies_term(){\n $post = get_post( $post->ID );\n // get post type by post\n $post_type = $post->post_type;\n // get post type taxonomies\n $taxonomies = get_object_taxonomies( $post_type, 'objects' );\n $out = array();\n foreach ( $taxonomies as $taxonomy_slug => $taxonomy ){\n // get the terms related to post\n $terms = get_the_terms( $post->ID, $taxonomy_slug );\n if ( !empty( $terms ) ) {\n $out[] = \"\";\n foreach ( $terms as $term ) {\n $out[] = $term->name;\n break;\n }\n }\n }\n return implode('', $out );\n}", "public static function getTerms($type = 'all', $taxonomies = array('ait-dir-item-category', 'ait-dir-item-location'), $filter = \"all\"){\n\t\t// $meta = array( 'status' => 'updated', 'date' => time() );\n\t\tglobal $wpdb;\n\t\t$result = array();\n\t\t$terms = array();\n\t\tif(!empty($taxonomies)){\n\t\t\tforeach($taxonomies as $index => $taxonomy){\n\t\t\t\t$terms = array_merge($terms, AitMigration::getTermsRecursivelly($taxonomy));\n\t\t\t}\n\t\t}\n\n\t\tswitch($type){\n\t\t\tcase 'migrated':\n\t\t\t\t/* MIGRATION LOGGER */\n\t\t\t\tAitMigration::log('info', 'getting migrated terms');\n\t\t\t\t/* MIGRATION LOGGER */\n\n\t\t\t\tforeach ($terms as $index => $term) {\n\t\t\t\t\t$taxonomy = str_replace(\"-\", \"_\", $term->taxonomy);\n\t\t\t\t\t$meta = AitMigration::getTermMeta($term->term_id, $taxonomy, 'migrated');\n\t\t\t\t\tif(is_array($meta)){\n\t\t\t\t\t\t// we have meta -> this user is migrated\n\t\t\t\t\t\tarray_push($result, $term);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 'notmigrated':\n\t\t\t\t/* MIGRATION LOGGER */\n\t\t\t\tAitMigration::log('info', 'getting non migrated terms');\n\t\t\t\t/* MIGRATION LOGGER */\n\n\t\t\t\tforeach ($terms as $index => $term) {\n\t\t\t\t\t$taxonomy = str_replace(\"-\", \"_\", $term->taxonomy);\n\t\t\t\t\t$meta = AitMigration::getTermMeta($term->term_id, $taxonomy, 'migrated');\n\t\t\t\t\tif(!is_array($meta)){\n\t\t\t\t\t\t// we dont have meta -> this user is not migrated\n\t\t\t\t\t\tarray_push($result, $term);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/* MIGRATION LOGGER */\n\t\t\t\tAitMigration::log('info', 'getting all terms');\n\t\t\t\t/* MIGRATION LOGGER */\n\n\t\t\t\t$result = $terms;\n\t\t\tbreak;\n\t\t}\n\t\t/* MIGRATION LOGGER */\n\t\tAitMigration::log('info', 'got '.count($result).' terms');\n\t\t/* MIGRATION LOGGER */\n\n\t\t$result = AitMigration::filterResultsData($result, $filter);\n\t\treturn $result;\n\t}", "public function getTerms($taxonomy, array $args = []): array;", "protected static function fetch_terms ( ) {\n\t\t$wp_terms = array();\n\t\t$terms = get_terms( array( 'location', 'department', 'status' ), array( 'hide_empty' => false ) );\n\t\t// Establish arrays. Not all terms have a jobvite_slug.\n\t\t$wp_terms['location']['jobvite_slug'] = array();\n\t\t$wp_terms['department']['jobvite_slug'] = array();\n\t\t$wp_terms['status']['jobvite_slug'] = array();\n\t\t//Same for wp_slug\n\t\t$wp_terms['location']['wp_slug'] = array();\n\t\t$wp_terms['department']['wp_slug'] = array();\n\t\t$wp_terms['status']['wp_slug'] = array();\n\t\tforeach ( $terms as $term ) {\n\t\t\t$term_custom = get_option( \"taxonomy_$term->term_id\" );\n\t\t\tif( isset( $term_custom['jobvite_slug'] ) ) {\n\t\t\t\t$wp_terms[ $term->taxonomy ]['jobvite_slug'][ $term->term_id ] = $term_custom['jobvite_slug'];\n\t\t\t}\n\t\t\t$wp_terms[ $term->taxonomy ]['wp_slug'][ $term->term_id ] = $term->slug;\n\t\t}\n\t\treturn $wp_terms;\n\t}", "function wporg_learn_get_taxonomy_terms( $post_id, $tax_slug, $context ) {\n\tswitch ( $context ) {\n\t\tcase 'archive':\n\t\t\treturn wporg_learn_get_taxonomy_terms_string( $post_id, $tax_slug );\n\t\t\tbreak;\n\t\tcase 'single':\n\t\t\treturn wporg_learn_get_taxonomy_terms_array( $post_id, $tax_slug );\n\t\t\tbreak;\n\t}\n}", "function get_filter_taxonomy_list() {\n \n\t$taxonomies = array();\n\n\t$options = vb_options( views()->id );\n\n\t$post_types = isset($options['post-type']) ? $options['post-type'] : 'post';\n\n\t$taxonomy_names = get_object_taxonomies( $post_types );\n\tforeach ( $taxonomy_names as $taxonomy ) {\n\t\t$taxonomies[$taxonomy] = ucwords(str_replace('_', ' ', $taxonomy ));\n\t}\n\n\treturn $taxonomies;\n \n}", "function get_taxonomies_by_taxonomy_list() {\n\t\n\t$term_options = array('None');\n\n\t$options = vb_options( views()->id );\n\n\t$taxonomy = isset($options['masonry-taxonomy']) ? $options['masonry-taxonomy'] : 'category';\n\t\n\t$taxonomies = array( $taxonomy );\n\n\t$args = array ('taxonomy' => $taxonomy);\n\n\t$terms = get_terms( $taxonomies, $args );\n\t\n\tforeach ($terms as $term)\n\t\t$term_options[$term->term_id] = $term->name;\n\n\treturn $term_options;\n\t\n}", "function listTerms($args = '') {\n\t\t$defaults = array(\n\t\t'show_option_all' => '', 'show_option_none' => __('No categories'),\n\t\t'orderby' => 'name', 'order' => 'ASC',\n\t\t'show_last_update' => 0, 'style' => 'list',\n\t\t'show_count' => 0, 'hide_empty' => 1,\n\t\t'use_desc_for_title' => 1, 'child_of' => 0,\n\t\t'feed' => '', 'feed_type' => '',\n\t\t'feed_image' => '', 'exclude' => '',\n\t\t'exclude_tree' => '', 'current_category' => 0,\n\t\t'hierarchical' => true, 'title_li' => __( 'Categories' ),\n\t\t'echo' => 1, 'depth' => 0,\n\t\t'taxonomy' => 'category'\n\t\t);\n\t\n\t\t$r = wp_parse_args( $args, $defaults );\n\t\n\t\tif ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] )\n\t\t\t$r['pad_counts'] = true;\n\t\n\t\tif ( isset( $r['show_date'] ) )\n\t\t\t$r['include_last_update_time'] = $r['show_date'];\n\t\n\t\tif ( true == $r['hierarchical'] ) {\n\t\t\t$r['exclude_tree'] = $r['exclude'];\n\t\t\t$r['exclude'] = '';\n\t\t}\n\t\n\t\tif ( !isset( $r['class'] ) )\n\t\t\t$r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];\n\t\n\t\textract( $r );\n\t\n\t\tif ( !taxonomy_exists($taxonomy) )\n\t\t\treturn false;\n\t\n\t\t$categories = get_categories( $r );\n\t\n\t\t$output = '';\n\t\tif ( $title_li && 'list' == $style )\n\t\t\t\t$output = '<li class=\"' . $class . '\">' . $title_li . '<ul>';\n\t\n\t\tif ( empty( $categories ) ) {\n\t\t\tif ( ! empty( $show_option_none ) ) {\n\t\t\t\tif ( 'list' == $style )\n\t\t\t\t\t$output .= '<li>' . $show_option_none . '</li>';\n\t\t\t\telse\n\t\t\t\t\t$output .= $show_option_none;\n\t\t\t}\n\t\t} else {\n\t\t\tglobal $wp_query;\n\t\t\n\t\t\tif( !empty( $show_option_all ) )\n\t\t\t\tif ( 'list' == $style )\n\t\t\t\t\t$output .= '<li class=\"menu-item-handle\"><a href=\"' . get_bloginfo( 'url' ) . '\">' . $show_option_all . '</a></li>';\n\t\t\t\telse\n\t\t\t\t\t$output .= '<a href=\"' . get_bloginfo( 'url' ) . '\">' . $show_option_all . '</a>';\n\t\t\n\t\t\tif ( empty( $r['current_category'] ) && ( is_category() || is_tax() ) )\n\t\t\t\t$r['current_category'] = $wp_query->get_queried_object_id();\n\t\t\n\t\t\tif ( $hierarchical )\n\t\t\t\t$depth = $r['depth'];\n\t\t\telse\n\t\t\t\t$depth = -1; // Flat.\n\t\t\n\t\t\t$output .= $this->walkTree( $categories, $depth, $r );\n\t\t}\n\t\n\t\tif ( $title_li && 'list' == $style )\n\t\t\t$output .= '</ul></li>';\n\t\n\t\t$output = apply_filters( 'wp_list_categories', $output, $args );\n\t\n\t\tif ( $echo )\n\t\t\techo $output;\n\t\telse\n\t\t\treturn $output;\n\t}", "function wpdocs_custom_taxonomies_terms_links() {\n\t $post = get_post( $post->ID );\n\n\t // Get post type by post.\n\t $post_type = $post->post_type;\n\n\t // Get post type taxonomies.\n\t $taxonomies = get_object_taxonomies( $post_type, 'objects' );\n\n\t $out = array();\n\n\t foreach ( $taxonomies as $taxonomy_slug => $taxonomy ){\n\n\t // Get the terms related to post.\n\t $terms = get_the_terms( $post->ID, $taxonomy_slug );\n\n\t if ( ! empty( $terms ) ) {\n\t $out[] = 'Category: ';\n\t foreach ( $terms as $term ) {\n\t $out[] = sprintf( '<a href=\"%1$s\">%2$s</a>',\n\t esc_url( get_term_link( $term->slug, $taxonomy_slug ) ),\n\t esc_html( $term->name )\n\t );\n\t }\n\t $out[] = \"\\n</ul>\\n\";\n\t }\n\t }\n\t return implode( '', $out );\n\t}", "public function terms()\n\t{\n\t\t# grab the data for the page\n\t\treturn $this->getContent(\"terms-conditions\", \"Terms and Conditions\");\n\t}", "public function all($type=FALSE)\n {\n if ($type)\n return $this->_all($type);\n\n\n return DB::table('wp_term_taxonomy')\n ->select(\n 'wp_terms.term_id AS id', \n 'wp_terms.name',\n 'wp_terms.slug', \n 'wp_term_taxonomy.taxonomy', \n 'wp_term_taxonomy.description',\n 'parent_terms.term_id AS parent_id', \n 'parent_terms.name AS parent_name', \n 'parent_terms.slug AS parent_slug'\n )\n ->where('wp_term_taxonomy.taxonomy','post_tag')\n ->orWhere('wp_term_taxonomy.taxonomy','category')\n ->join(\n 'wp_terms',\n 'wp_term_taxonomy.term_id', '=', 'wp_terms.term_id'\n )\n ->leftJoin(\n 'wp_terms AS parent_terms', \n 'wp_term_taxonomy.parent', '=', 'parent_terms.term_id'\n )\n ->orderBy('wp_terms.name','asc')\n ->get();\n }", "public static function get_types() {\n\t\t$terms = get_terms(self::$tax_type->get_id(), array(\n\t\t\t'hide_empty' => FALSE,\n\t\t));\n\t\t// TODO: sort\n\t\treturn $terms;\n\t}", "public function loadTerms() {\n\t\tif (!is_numeric($postId = $this->{self::PROPERTY_ID})) \n\t\t\tthrow new ErrorException(\"Failed to load tags for a Post without a numeric ID\", 0, E_NOTICE);\n\n\t\t$taxonomies = array_map(function($taxonomy) {\n\t\t\treturn $taxonomy->{Taxonomy::PROPERTY_NAME};\n\t\t}, $this->getTaxonomies()->getObjects());\n\n\t\t$taxonomies = array_values($taxonomies);\n\t\t\n\t\tif (is_wp_error($terms = wp_get_object_terms($postId, $taxonomies)))\n\t\t\t$terms = array();\n\n\t\t$this->setTerms($terms);\n\t\t\n\t\treturn $this;\n\t}", "public function getTerms()\n\t{\n\t\treturn $this->terms;\n\t}", "public function load_terms() {\n\t\t\n\t\t$tax = trim($_REQUEST['tax']);\n\t\t$object_id = $_REQUEST['object_id'];\n\t\t$as_ul = $_REQUEST['as_ul'];\n\t\t\n\t\t$terms = get_the_terms($object_id, $tax);\n\t\t\t\t\n\t\tif ( $terms && ! $as_ul ) {\n\t\t\t$term_names = array();\n\t\t\tforeach($terms as $term) :\n\t\t\t\t$term_names[] = $term->name;\n\t\t\tendforeach;\n\t\t\t$str = implode(', ', $term_names);\n\t\t}\n\t\telseif ( $terms ) {\n\t\t\t$str = '<ul class=\"x-editable ajax-terms\">';\n\t\t\tforeach($terms as $term) :\n\t\t\t\t$str .= '<li>' . $term->name . '</li>';\n\t\t\tendforeach;\n\t\t\t$str .= '</ul>';\n\t\t}\n\t\tdie($str);\t\n\t}", "public function terms() {\r\n\t\tglobal $data;\r\n\t\t$this->MY_setLanguage('Home');\r\n\t\t$this->MY_show_page('Home', 'terms_view', $data);\r\n\t}", "public function getTerms()\n {\n return $this->terms;\n }", "public function getAllTags($taxonomy_type = 'hashtag')\n {\n foreach ($this->taxonomy as $value) {\n if ($value == $taxonomy_type) {\n if (did_action('init')) {\n $taxCollection = new TaxCollection();\n $args = ['taxonomy' => $this->taxonomy, 'hide_empty' => 0,];\n $terms = get_terms($args);\n\n\n foreach ($terms as $term) {\n $taxCollection->addTerm($term);\n }\n return $taxCollection;\n } else {\n throw new InitHookNotFiredException('Error: Call to custom taxonomy function before init hook is fired.');\n }\n }\n }\n }", "function types_item_taxonomy_rest_support()\n{\n global $wp_taxonomies;\n $array = ['items-about-taxo-item', 'prestation-taxo-item', 'portfolio-taxo-item', 'faq-taxo-item'];\n $count = count($array);\n for ($i = 0; $i < $count; $i++) {\n $taxonomy_name = $array[$i];\n if (isset($wp_taxonomies[$taxonomy_name])) {\n $wp_taxonomies[$taxonomy_name]->show_in_rest = true;\n $wp_taxonomies[$taxonomy_name]->rest_base = $taxonomy_name;\n $wp_taxonomies[$taxonomy_name]->rest_controller_class = 'WP_REST_Terms_Controller';\n }\n }\n}", "function get_rocket_post_terms_urls( $post_ID )\n{\n\t$urls = array();\n\t$taxonomies = get_object_taxonomies( get_post_type( $post_ID ), 'objects' );\n\t\n\tforeach( $taxonomies as $taxonomy ) {\n\t\tif( ! $taxonomy->public ) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// Get the terms related to post\n\t\t$terms = get_the_terms( $post_ID, $taxonomy->name );\n\t\t\n\t\tif ( ! empty( $terms ) ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$term_url = get_term_link( $term->slug, $taxonomy->name );\n\t\t\t\t\n\t\t\t\tif ( ! is_wp_error( $term_url ) ) {\n\t\t\t\t\t$urls[] = $term_url;\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Filter the list of taxonomies URLs\n\t *\n\t * @since 1.1.0\n\t *\n\t * @param array $urls List of taxonomies URLs\n\t*/\n\t$urls = apply_filters( 'rocket_post_terms_urls', $urls );\n\n\treturn $urls;\n}" ]
[ "0.7092111", "0.7037184", "0.6784463", "0.6736423", "0.67271984", "0.6693679", "0.66896904", "0.6681396", "0.6640556", "0.6621236", "0.65499824", "0.64789456", "0.64371884", "0.6428292", "0.63682026", "0.636082", "0.63399196", "0.63212156", "0.6318886", "0.6318866", "0.63145846", "0.63110775", "0.6310671", "0.63042915", "0.6298268", "0.6286765", "0.62812763", "0.6277573", "0.6245238", "0.6245098" ]
0.7775769
0
Define our custom REST API endpoint for getting all the terms/taxonomies.
function berg_get_terms_endpoint() { register_rest_route( 'wp/v2', '/berg_terms', array( 'methods' => 'GET', 'callback' => 'berg_rest_get_terms', 'permission_callback' => function () { return current_user_can( 'edit_posts' ); }, ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function berg_rest_get_terms() {\n\t\t$args = array(\n\t\t\t'public' => true,\n\t\t);\n\t\t$taxonomies = get_taxonomies( $args, 'objects' );\n\n\n\t\t$_defaultFields = default_display_fields();\n\t\t$return = array();\n\n\t\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\t\tforeach ( $post_types as $post_type => $data ) {\n\t\t\t// Don't include attachments.\n\t\t\tif ( $post_type === 'attachment' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$return[ $post_type ] = array(\n\t\t\t\t'label' => $data->label,\n\t\t\t\t'taxonomies' => array(),\n\t\t\t);\n\n\t\t\t$return[ $post_type ]['display_orders'] = array_merge( $_defaultFields, get_all_meta( $post_type ) );\n\t\t}\n\n\t\tforeach ( $taxonomies as $taxonomy_slug => $taxonomy ) {\n\t\t\tforeach ( $taxonomy->object_type as $post_type ) {\n\t\t\t\t// Don't include post formats.\n\t\t\t\tif ( $post_type === 'post' && $taxonomy_slug === 'post_format' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$return[ $post_type ]['display_orders'][ 'taxonomy_' . $taxonomy_slug ] = $taxonomy->label;\n\n\t\t\t\t$return[ $post_type ]['taxonomies'][ $taxonomy_slug ] = array(\n\t\t\t\t\t'label' => $taxonomy->label,\n\t\t\t\t\t'terms' => get_terms( $taxonomy->name ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn new WP_REST_Response( $return, 200 );\n\t}", "public function enterprise_plugin_register_terms_rest_route() {\n\t\tregister_rest_route(\n\t\t\t'terms/v1',\n\t\t\t'/post/',\n\t\t\tarray(\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'callback' => array( $this, 'enterprise_plugin_terms_endpoint' ),\n\t\t\t)\n\t\t);\n\t}", "public function actionGetTerms();", "function types_item_taxonomy_rest_support()\n{\n global $wp_taxonomies;\n $array = ['items-about-taxo-item', 'prestation-taxo-item', 'portfolio-taxo-item', 'faq-taxo-item'];\n $count = count($array);\n for ($i = 0; $i < $count; $i++) {\n $taxonomy_name = $array[$i];\n if (isset($wp_taxonomies[$taxonomy_name])) {\n $wp_taxonomies[$taxonomy_name]->show_in_rest = true;\n $wp_taxonomies[$taxonomy_name]->rest_base = $taxonomy_name;\n $wp_taxonomies[$taxonomy_name]->rest_controller_class = 'WP_REST_Terms_Controller';\n }\n }\n}", "public function index()\n {\n // /terms\n }", "public function enterprise_plugin_terms_endpoint( $wp_rest_server ) {\n\t\t$posts = array(\n\t\t\t'posts' => array(),\n\t\t\t'max_pages' => '',\n\t\t);\n\n\t\t$tax_query = ( $wp_rest_server['term_types'] )\n\t\t\t? array(\n\t\t\t\t'taxonomy' => 'term_types',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => $wp_rest_server['term_types'],\n\t\t\t)\n\t\t\t: false;\n\n\t\t$search_query = ( $wp_rest_server['s'] ) ?: '';\n\n\t\t$page = ( $wp_rest_server['page'] ) ?: 1;\n\n\t\t$args = array(\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'title',\n\t\t\t'post_type' => 'terms',\n\t\t\t'posts_per_page' => 9,\n\t\t\t'paged' => $page,\n\t\t\t's' => $search_query,\n\t\t\t'tax_query' => array(\n\t\t\t\t$tax_query,\n\t\t\t),\n\t\t);\n\n\t\t$terms_query = new WP_Query( $args );\n\n\t\tif ( $terms_query->have_posts() ) {\n\t\t\twhile ( $terms_query->have_posts() ) {\n\t\t\t\t$terms_query->the_post();\n\n\t\t\t\t$posts['posts'][] = array(\n\t\t\t\t\t'id' => get_the_ID(),\n\t\t\t\t\t'title' => html_entity_decode( get_the_title() ),\n\t\t\t\t\t'content' => html_entity_decode( get_the_content() ),\n\t\t\t\t\t'acf' => ( function_exists( 'get_fields' ) ) ? get_fields( get_the_ID() ) : false,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\twp_reset_postdata();\n\n\t\t$posts['max_pages'] = $terms_query->max_num_pages;\n\t\treturn $posts;\n\t}", "public function register_taxonomies() {\n }", "public function register_taxonomies()\n {\n }", "public function getTerms() {}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies() {\n\n\t}", "public function register_taxonomies()\n\t{\n\t}", "public function register_taxonomies()\n\t{ }", "public function terms(Request $request)\n {\n $terms = General::where('locale', '=', 'en')->get();\n return response($terms);\n }", "function register_taxonomies(){\n\t\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "public function ajaxGetTaxonomies() {\n\t\t$taxonomy = kalium()->post( 'taxonomy' );\n\n\t\t$resp = array(\n\t\t\t'success' => false\n\t\t);\n\n\t\tif ( $taxonomy ) {\n\t\t\t$entries = get_terms( array(\n\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t'hide_empty' => false\n\t\t\t) );\n\n\t\t\t$entries_select = array();\n\t\t\t$entries_select[] = $this->anyItem();\n\n\t\t\tforeach ( $entries as $entry ) {\n\n\t\t\t\t$entries_select[] = array(\n\t\t\t\t\t'value' => $entry->term_id,\n\t\t\t\t\t'text' => $entry->name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\twp_reset_postdata();\n\n\t\t\t$resp['entries'] = $entries_select;\n\t\t\t$resp['success'] = true;\n\t\t}\n\n\t\techo json_encode( $resp );\n\t\tdie();\n\t}", "public function getTerms($taxonomy, array $args = []): array;", "public function enterprise_plugin_register_places_rests_route() {\n\t\tregister_rest_route(\n\t\t\t'places/v1',\n\t\t\t'/terms/',\n\t\t\tarray(\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'callback' => array( $this, 'enterprise_plugin_places_endpoint' ),\n\t\t\t)\n\t\t);\n\t}", "private function get_taxonomies() {\n\t\t// Only return taxonomies that are shown in the admin interface.\n\t\t// Otherwise, the list could be confusing to editors or provide invalid options.\n\t\treturn get_taxonomies(\n\t\t\tarray( \n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true\n\t\t\t),\n\t\t\t'objects'\n\t\t);\n\t}", "function register_taxonomies() {\n Content_Type_Tax::register();\n Series_Tax::register();\n }", "protected function fetchTaxonomies()\n {\n $response = $this->api->appData();\n\n $taxonomies = array_get($response, 'data.taxonomies', []);\n\n $this->taxonomies = new Collection($taxonomies);\n }", "public static function getTerms($type = 'all', $taxonomies = array('ait-dir-item-category', 'ait-dir-item-location'), $filter = \"all\"){\n\t\t// $meta = array( 'status' => 'updated', 'date' => time() );\n\t\tglobal $wpdb;\n\t\t$result = array();\n\t\t$terms = array();\n\t\tif(!empty($taxonomies)){\n\t\t\tforeach($taxonomies as $index => $taxonomy){\n\t\t\t\t$terms = array_merge($terms, AitMigration::getTermsRecursivelly($taxonomy));\n\t\t\t}\n\t\t}\n\n\t\tswitch($type){\n\t\t\tcase 'migrated':\n\t\t\t\t/* MIGRATION LOGGER */\n\t\t\t\tAitMigration::log('info', 'getting migrated terms');\n\t\t\t\t/* MIGRATION LOGGER */\n\n\t\t\t\tforeach ($terms as $index => $term) {\n\t\t\t\t\t$taxonomy = str_replace(\"-\", \"_\", $term->taxonomy);\n\t\t\t\t\t$meta = AitMigration::getTermMeta($term->term_id, $taxonomy, 'migrated');\n\t\t\t\t\tif(is_array($meta)){\n\t\t\t\t\t\t// we have meta -> this user is migrated\n\t\t\t\t\t\tarray_push($result, $term);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 'notmigrated':\n\t\t\t\t/* MIGRATION LOGGER */\n\t\t\t\tAitMigration::log('info', 'getting non migrated terms');\n\t\t\t\t/* MIGRATION LOGGER */\n\n\t\t\t\tforeach ($terms as $index => $term) {\n\t\t\t\t\t$taxonomy = str_replace(\"-\", \"_\", $term->taxonomy);\n\t\t\t\t\t$meta = AitMigration::getTermMeta($term->term_id, $taxonomy, 'migrated');\n\t\t\t\t\tif(!is_array($meta)){\n\t\t\t\t\t\t// we dont have meta -> this user is not migrated\n\t\t\t\t\t\tarray_push($result, $term);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/* MIGRATION LOGGER */\n\t\t\t\tAitMigration::log('info', 'getting all terms');\n\t\t\t\t/* MIGRATION LOGGER */\n\n\t\t\t\t$result = $terms;\n\t\t\tbreak;\n\t\t}\n\t\t/* MIGRATION LOGGER */\n\t\tAitMigration::log('info', 'got '.count($result).' terms');\n\t\t/* MIGRATION LOGGER */\n\n\t\t$result = AitMigration::filterResultsData($result, $filter);\n\t\treturn $result;\n\t}", "public function ajax_get_taxonomies() {\n\t\t$post_names = json_decode( stripslashes( $_GET['post_names'] ), true );\n\n\t\techo json_encode( $this->get_taxonomies_for_posts( $post_names ) );\n\n\t\tdie();\n\t}" ]
[ "0.77820086", "0.7546907", "0.6841938", "0.68086797", "0.67268157", "0.6619818", "0.65821964", "0.65430665", "0.6539347", "0.65233606", "0.65233606", "0.65233606", "0.65233606", "0.65233606", "0.6431911", "0.64040947", "0.6323925", "0.63222194", "0.63034177", "0.63034177", "0.63034177", "0.63034177", "0.62630403", "0.61964285", "0.6171021", "0.614133", "0.61393464", "0.61217546", "0.6114764", "0.6103658" ]
0.8082632
0
Start a complex shape
function swf_startshape($objid) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function circle ($ox, $oy, $px, $py) {}", "public function calculateShape(){\n echo \"calculating a square shape with size \". $this->size .\" color \" . $this->getColor() . \" and border Size \" . $this->getBorderSize() . \" .... \\n\";\n\n $this->data = array_fill(0,$this->size,[]);\n for ($x=0;$x<$this->size;$x++)\n {\n if ($x==0)\n $this->data[$x] = array_fill(0,$this->size,[]);\n for($y=0;$y<$this->size;$y++)\n {\n\t\t\t\t$this->data[$x][$y] = ' ';\n if ($x == 0 || $y==0 || $x == ($this->size-1) || $y==($this->size-1))\n $this->data[$x][$y] = '*';\n }\n }\n sleep(1); //simulating calculation\n }", "public function ellipse ($ox, $oy, $rx, $ry, $start, $end) {}", "function sin(Complex $c1) {\n $a = $c1->getReal();\n $b = $c1->getIm();\n $r = \\sin($a) * \\cosh($b);\n $i = \\cos($a) * \\sinh($b);\n return complex($r, $i);\n}", "public function arc ($sx, $sy, $ex, $ey, $sd, $ed) {}", "function swf_endshape()\n{\n}", "function cos(Complex $c1) {\n $a = $c1->getReal();\n $b = $c1->getIm();\n $r = \\cos($a) * \\cosh($b);\n $i = \\sin($a) * \\sinh($b);\n return complex($r, $i);\n}", "public function sketchImage ($radius, $sigma, $angle) {}", "private function _random_shape() {\n $rshapes = array();\n // Bounding points that constrain the maximal shape expansion\n $min = new Point(0, 0);\n $max = new Point($this->width, $this->height);\n // Get a start point\n $previous = $startp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n // Of how many random geometrical primitives should our random shape consist?\n $ngp = secure_rand(min($this->dsettings['shapeify']['r_num_gp']), max($this->dsettings['shapeify']['r_num_gp']));\n\n foreach (range(0, $ngp) as $j) {\n // Find a random endpoint for geometrical primitves\n // If there are only 4 remaining shapes to add, choose a random point that\n // is closer to the endpoint!\n $rp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n if (($ngp - 4) <= $j) {\n $rp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n // Make the component closer to the startpoint that is currently wider away\n // This ensures that the component switches over the iterations (most likely).\n $axis = abs($startp->x - $rp->x) > abs($startp->y - $rp->y) ? 'x' : 'y';\n if ($axis === 'x') {\n $rp->x += ($startp->x > $rp->x) ? abs($startp->x - $rp->x) / 4 : abs($startp->x - $rp->x) / -4;\n } else {\n $rp->y += ($startp->y > $rp->y) ? abs($startp->y - $rp->y) / 4 : abs($startp->y - $rp->y) / -4;\n }\n }\n\n if ($j == ($ngp - 1)) { // Close the shape. With a line\n $rshapes[] = array($previous, $startp);\n break;\n } elseif (rand(0, 1) == 1) { // Add a line\n $rshapes[] = array($previous, $rp);\n } else { // Add quadratic bezier curve\n $rshapes[] = array($previous, new Point($previous->x, $rp->y), $rp);\n }\n\n $previous = $rp;\n }\n return $rshapes;\n }", "function csc(Complex $c1) {\n return inverse(sin($c1));\n}", "public static function csc($complex): Complex\n {\n $complex = Complex::validateComplexArgument($complex);\n\n if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {\n return new Complex(INF);\n }\n\n return self::inverse(self::sin($complex));\n }", "public function __construct($type = Maths::CARTESIAN_2D)\n {\n parent::__construct($type);\n }", "private function _start_complex_value ($type) {\n // tagged with the type that they are so we know how to add new values.\n $current_item = array(\n 'type' => $type,\n 'value' => array()\n );\n $this->_stack[] = $current_item;\n }", "public function shape($value) {\n return $this->setProperty('shape', $value);\n }", "public function isComplex() {\n\t\treturn $this->model->isComplex();\n\t}", "public function build_figure()\n {\n\n }", "function sinh(Complex $c1) {\n $r = $c1->getReal();\n $i = $c1->getIm();\n return \\complex(\\sinh($r) * \\cos($i), \\cosh($r) * \\sin($i));\n}", "public function getShape()\n {\n return $this->shape;\n }", "private function switchShape()\n\t{\n\t\tif ($this->currentShape == Square::SHAPE_CIRCLE)\n\t\t{\n\t\t\t$this->currentShape = Square::SHAPE_CROSS;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->currentShape = Square::SHAPE_CIRCLE;\n\t\t}\n\t}", "function __construct($startArc, $endArc){\n parent::__construct(0, 1, 0, $startArc, $endArc);\n\n }", "function CreateObject($modelid, $X, $Y, $Z, $rX, $rY, $rZ, $DrawDistance = 0.0) {\n \n}", "function sqrt(Complex $c1) {\n $x = \\abs($c1->getReal());\n $y = \\abs($c1->getIm());\n if ($x == 0 && $y == 0) {\n $r = $i = 0.0;\n } else {\n if ($x >= $y) {\n $t = $y / $x;\n $w = \\sqrt($x) * \\sqrt(0.5 * (1.0 + \\sqrt(1.0 + $t * $t)));\n } else {\n $t = $x / $y;\n $w = \\sqrt($y) * \\sqrt(0.5 * ($t + \\sqrt(1.0 + $t * $t)));\n }\n\n if ($c1->getReal() >= 0.0) {\n $r = $w;\n $i = $c1->getIm() / (2.0 * $w);\n } else {\n $i = ($c1->getIm() >= 0) ? $w : - $w; // [1,-1][$c1->getIm() >= 0]\n $r = $c1->getIm() / (2.0 * $i);\n }\n }\n return complex($r, $i);\n}", "public function __construct($type = Maths::CARTESIAN_2D)\n {\n $this->setSpaceType($type);\n }", "function cosh(Complex $c1) {\n $r = $c1->getReal();\n $i = $c1->getIm();\n return \\complex(\\cosh($r) * \\cos($i), \\sinh($r) * \\sin($i));\n}", "public static function conjugate($complex): Complex\n {\n $complex = Complex::validateComplexArgument($complex);\n\n return new Complex(\n $complex->getReal(),\n -1 * $complex->getImaginary(),\n $complex->getSuffix()\n );\n }", "function Circle($x, $y, $r, $r2, $colinear)\n {\n $this->x = $x;\n $this->y = $y;\n // radius\n $this->r = $r;\n\n // radius squared\n $this->r2 = $r2;\n\n\n $this->colinear=$colinear;\n }", "public function createShape($color)\n {\n return new OFCShape($color);\n }", "function acosh(Complex $c1) {\n $z = acos($c1);\n return multIm($z, [-1, 1][($z->getIm() > 0)]);\n// return Math_ComplexOp::multIm($z, (($z->getIm() > 0) ? 1.0 : -1.0));\n}", "function addShape(Shape $shape){\n\t\t$this->shapes[] = $shape;\n\t}", "function dgtkcsh_shapes_shortcode( $atts, $content = null ) {\n\n extract( $atts );\n\n $color = ( $atts['color'] ) ? $atts['color'] : '';\n $out = '';\n\n $css_class = apply_filters( 'kc-el-class', $atts );\n $css_class = array_merge( $css_class, array( 'dgtkcsh_shapes' ) );\n\n if ( $atts['fullwidth'] == 'yes' ) $css_class = array_merge( $css_class, array( 'dgtkcsh_shape_fullwidth' ) );\n if ( $atts['position'] == 'top' ) $css_class = array_merge( $css_class, array( 'dgtkcsh_shape_top' ) );\n\n $out .= '<svg class=\"' . esc_attr( implode( ' ', $css_class ) ) . '\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">';\n $out .= '<polygon fill=\"' . $color . '\" points=\"';\n\n foreach( $atts['shape_points'] as $i => $point ){\n\n if ( $atts['position'] == 'top' ) {\n if ( $point->width == 0 || $point->height == 0 ) {\n $out .= $point->width . ',' . $point->height . ' ';\n } else if ( $point->width == 100 || $point->height == 100 ) {\n $out .= $point->width . ',' . $point->height . ' ';\n } else {\n $out .= (100 - $point->width) . ',' . (100 - $point->height) . ' ';\n }\n } else {\n $out .= $point->width . ',' . $point->height . ' ';\n }\n\n }\n\n $out .= '100,100 0,100\"/>';\n $out .= '</svg>';\n\n return $out;\n\n}" ]
[ "0.5390988", "0.52530646", "0.5187657", "0.5001103", "0.4926193", "0.49135354", "0.4912614", "0.47029045", "0.4687232", "0.46672466", "0.46314663", "0.46254382", "0.46098894", "0.4604686", "0.46005496", "0.46003526", "0.45954564", "0.45942563", "0.45792675", "0.45763063", "0.45676813", "0.45491368", "0.45207828", "0.4498214", "0.44970274", "0.4489893", "0.44676143", "0.44637606", "0.4450488", "0.44221306" ]
0.5952517
0
Is this a submenu?
public function isSubmenu() { return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSubmenu()\n {\n return ($this->parent !== null);\n }", "public function menu() {\r\n\r\n if( isset( $this->xml->menu ) && preg_match( '/^(1|true|yes)$/', $this->xml->menu ) ) {\r\n $scope = (string) $this->scope();\r\n if( empty( $scope ) || $this->scopes[$scope]['menu'] ) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n}", "public function getShowSubmenus() {\n\n\t\treturn !!$this->showSubmenus;\n\n\t}", "public function hasSidemenu()\n {\n $ident = $this->ident();\n $metadata = $this->adminSidemenu();\n\n if (isset($metadata[$ident])) {\n return $this->hasLinks() || $this->hasGroups() || $this->hasActions() || $this->showTitle();\n }\n\n return false;\n }", "public function CanDelete()\n\t{\treturn $this->id && count($this->submenu->menuitems) == 0;\n\t}", "public function hasChildren()\n {\n return (null !== $this->_submenu) && (bool)$this->_submenu->count();\n }", "public function hasSubmenuItem($slug)\n {\n return isset($this->submenu[$slug]);\n }", "private function check_subnavi_type() \r\n {\r\n \tglobal $unav_array, $akt_kap;\r\n \t$unavis = array(); $rc = false;\r\n \t$anz = count($unav_array);\r\n// \tif (SUBMENU_DIR == 'horizontal' && $anz > 0) { \r\n \tif ($anz > 0) { \r\n\t \t$unavis = $unav_array;\r\n \t\tforeach ($unavis as $subid => $value) \r\n \t\t{\r\n\t\t\t\tlist($kap, $ukap, $label, $type) = explode('|',$value);\r\n\t\t\t\tif ($kap == $akt_kap && $type == $GLOBALS['NAVI']['HORIZONTAL']) { $rc = true; } \r\n\t\t\t\telse { continue; } \r\n \t\t}\r\n \t\treturn $rc;\r\n \t} \t\r\n }", "function sub_menu()\n{\n /**\n * Submenu function used to used to display submenu links\n * after navbar\n */\n $funcs = get_functions('sub_menu');\n if (is_array($funcs) && count($funcs) > 0)\n {\n foreach ($funcs as $func)\n {\n if (function_exists($func))\n {\n return $func($u);\n }\n }\n }\n}", "private function _isMenuItem($data) {\n\t\tisset($data['label']) ? $label = $data['label'] : $label = '';\n\t\tif (is_array($data) && $label && (!isset($data['visible']) || $data['visible'])) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function RenderMenu() {\r\n\t\tforeach ($this->ItemData as $item) {\r\n\t\t\tif ($this->RenderItem($item))\r\n\t\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function getTag() {\n return 'submenu';\n }", "function gj_add_submenu( $name ) {\n $menu = wp_get_nav_menu_object( $name );\n\n //Get the subitems\n $sitems = wp_get_nav_menu_items( $menu->term_id );\n\n $url = curPageURL();\n\n echo '<ul class=\"submenu leftmenu\">';\n\n $subitem = false;\n foreach( $sitems as $item ) {\n //Is a subitem?\n if( $item->menu_item_parent > 0 && ! $subitem ) {\necho <<< SUBITEMS\n <li class=\"subitems\">\n <ul class=\"subitems\">\n <li><hr class=\"sidesep\"></li>\nSUBITEMS;\n\n $subitem = true;\n }\n\n //Subitem end?\n if( $subitem && $item->menu_item_parent == 0 ) {\necho <<< SUBITEMSEND\n <li><hr class=\"sidesep\"></li>\n </ul>\n </li>\nSUBITEMSEND;\n\n $subitem = false;\n }\n\n\t\t// if the link points to somewhere else, open in new tab\n\t\tif ( stristr( $item->url, home_url() ) ) {\n\t\t\t$target = '';\n\t\t} else {\n\t\t\t$target = 'target=\"_blank\"';\n\t\t}\n\n if( $item->url != \"#\" && $item->title[0] != \"<\" ) {\n $class = ( get_the_ID() == $item->object_id || trailingslashit( $item->url ) == $url ) ? \"active\" : \"\";\necho <<< EOT\n <li>\n <a href=\"$item->url\" class=\"$class\" data-title=\"$item->title\" $target>\n <span>$item->title<span>\n </a>\n </li>\nEOT;\n } else {\n if( $item->title[0] == \"#\" ) echo ( '<li>&nbsp;</li>' );\n\n continue;\n }\n }\n\n echo '</ul>';\n}", "protected static function isMenuExist()\n\t{\n\t\t$db\t\t= JFactory::getDBO();\n\n\t\t$query\t= 'SELECT COUNT(*) FROM ' . $db->quoteName( '#__menu' ) . ' '\n\t\t\t\t. 'WHERE ' . $db->quoteName( 'link' ) . ' LIKE ' . $db->Quote( '%option=com_payinvoice%') . ' '\n\t\t\t\t. 'AND ' . $db->quoteName('menutype') . ' = ' . $db->Quote(self::MENUTYPE);\n\n\t\t$db->setQuery( $query );\n\n\t\treturn ( $db->loadResult() >= 1 ) ? true : false;\n\t}", "function hasMenu( $x) {\n\t\t$getX = mysqli_query( $GLOBALS['conn'], \"SELECT h_menu FROM hextensions WHERE h_slug = '\".$x.\"'\" );\n\t\tif ( $getX -> num_rows > 0 ) {\n\t\t\twhile ( $menus = mysqli_fetch_assoc( $getX) ) {\n\t\t\t\t$menu[] = $menu;\n\t\t\t}\n\t\t}\n\n\t\tif ( !empty( $menu) && $menu[0]['h_menu'] == \"yes\" ) {\n\t\t\tif ( $menu[0]['h_menu'] == \"yes\" ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function is_adminmenuchild_active( $id ){\n $ci =& get_instance();\n $result = FALSE;\n\n $countchildmenu = $ci->Adminenv_model->rowAdminMenuChild($id);\n\n if($countchildmenu > 0){\n $datachild = $ci->Adminenv_model->AdminMenuChild($id);\n foreach ( $datachild as $dcm1) {\n\n $thechildaccess = '';\n if($dcm1['menuType']=='module' OR $dcm1['menuType']=='addons'){\n $thechildaccess = $dcm1['menuAccess'];\n }\n\n if( ( $ci->uri->segment(2) == $thechildaccess ) AND !empty( $ci->uri->segment(2) ) ){\n $result = TRUE; break;\n }\n } \n }\n\n return $result;\n}", "function RenderItem($item) {\r\n\t\tif (!is_null($item->SubMenu)) {\r\n\t\t\tforeach ($item->SubMenu->ItemData as $subitem) {\r\n\t\t\t\tif ($item->SubMenu->RenderItem($subitem))\r\n\t\t\t\t\treturn TRUE;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ($item->Allowed && $item->Url <> \"\");\r\n\t}", "function socialit_menu_link() {\r\n\tif (function_exists('bb_admin_add_submenu')) {\r\n\t\tbb_admin_add_submenu( __( 'Social It' ), 'administrate', 'socialit_settings_page', 'options-general.php' );\r\n\t}\r\n}", "function Menu_Rendering($menu) {\n\t//if ($menu->Id == \"menu\") { // Sidebar menu\n\n}", "function isChildMenuActive($childMenus = array()){\r\n $status = \"\";\r\n foreach ($childMenus as $menu){\r\n if(sizeof($menu['child_menu'])){\r\n $status = isMenuActive($menu['child_menu']);\r\n }\r\n else if(isLinkActive($menu['link']) === \"active\"){\r\n return \"active\";\r\n \r\n }\r\n }\r\n return $status;\r\n}", "public function hasMenu($key)\n\t{\n\t\tif (strpos($key, '.') !== false) {\n\t\t\treturn $this->getNested($key) !== null;\n\t\t}\n\n\t\treturn array_key_exists($key, $this->menus);\n\t}", "public function isSubAdmin()\n {\n return $this->userType->code == \"subadmin\";\n }", "public function positionen_submenu() \r\n {\r\n \tglobal $tpl, $frontend;\r\n \tglobal $unav_array;\r\n \tglobal $akt_kap;\r\n \tglobal $akt_navid;\r\n \tglobal $akt_subid;\r\n \tglobal $redirect, $general, $naviout;\r\n \tglobal $aktive_menupos, $css_classes;\r\n\r\n \t// damit der Bereich fuer die vertikale Subnavigation wirklich nur dann\r\n \t// angezeigt wird, wenn sie benoetigt wird, muss hier anhand von $akt_kap\r\n \t// gecheckt werden, ob diese vom Typ H oder V ist. Nur wenn $akt_kap vom Typ H ist\r\n \t// muss sie angezeigt werden.\r\n\r\n\t\t$rc = $this->check_subnavi_type();\r\n \tif ($rc === true) \r\n \t{ \r\n\t \t$tpl->setCurrentBlock('subnavi_'.SUBMENU_DIR);\r\n $frontend->set_css_class('subnav', $akt_navid, $css_classes);\r\n\t\t $tpl->setVariable('ul_subitem_start', '<ul>');\r\n\t\t\t// alle Unterpositionen pro Navigationspunkt (horizontal)\r\n\t\t\tforeach ($unav_array as $subid => $value) \r\n\t\t\t{\r\n\t\t\t $tpl->setCurrentBlock('subitem_'.SUBMENU_DIR);\r\n\t\t\t\tlist($kap, $ukap, $label, $type) = explode('|',$value);\r\n\t\t\t\tif ($kap != $akt_kap) { continue; }\r\n\t\t\t\tif ($type != $GLOBALS['NAVI']['HORIZONTAL']) { continue; } // hier sollen nur Nav-Typen = 'H' angezeigt werden\r\n\t\t $nav_url = $redirect->set_navlink($akt_navid, $subid);\r\n\t\t $link = '<a href=\"'.urldecode($nav_url).'\"';\r\n\t\t if ($subid == $akt_subid) { \r\n $style = $naviout->set_style(THEME_SELECTED);\r\n $class = $frontend->set_css_class('subnav', $aktive_menupos, $css_classes);\r\n $link .= ' class=\"'.$style.' '.$class.'\"';\r\n }\r\n\t\t $link \t.= '>'.$label.'</a>';\r\n\t\t\t\tif (SUBMENU_DIR == 'horizontal') { $tpl->setVariable('richtung_subnavi', HMENU_RICHTUNG); }\r\n\t\t\t\t$tpl->setVariable('subnavi_link',$link);\t\t\r\n\t\t if ($subid == $akt_subid) { $tpl->setVariable('subnavi_aktiv', ' class=\"active\"'); }\r\n\t\t\t\t$tpl->parseCurrentBlock();\r\n\t\t\t}\t\t\t\r\n\t\t $tpl->setVariable('ul_subitem_ende', \"</ul>\");\r\n\t\t //$tpl->setCurrentBlock('subnavi_'.SUBMENU_DIR);\t\t\r\n\t\t\t$tpl->parseCurrentBlock();\r\n \t}\t\r\n }", "function is_current_menu_item( $uri ) {\n if( NavigationManagement::requestUri()==$_SERVER['REQUEST_URI'] )\n $walks = array_diff( explode( '/', NavigationManagement::requestUri( $uri ) ), explode( '/', $_SERVER['REQUEST_URI'] ) );\n else\n $walks = array_diff( explode( '/', $_SERVER['REQUEST_URI'] ), explode( '/', NavigationManagement::requestUri( $uri ) ) );\n\n if( empty( $walks ) )\n return TRUE;\n\n return FALSE;\n}", "function getMenuSubTitle();", "public function checkMenuExists()\n\t{\n \t// Initialise variables.\n $app = JFactory::getApplication();\n $db = JFactory::getDbo();\n \n $query = $db->getQuery(true)\n ->select('id')\n ->from('#__menu_types')\n ->where('menutype = ' . $db->quote('hwdmediashare'));\n try\n {\n $db->setQuery($query);\n return $db->loadResult();\n }\n catch (RuntimeException $e)\n {\n\t\t\t$app->enqueueMessage($e->getMessage());\n\t\t\treturn false; \n }\n\t}", "public function existsMenu($key)\n\t{\n\t\t$menu = $this->_getMenu($key);\n\t\treturn is_null($menu) ? false : true;\n\t}", "function page_in_menu( $menu = null, $object_id = null ) {\r\n $menu_object = wp_get_nav_menu_items( esc_attr( $menu ) );\r\n if( ! $menu_object )\r\n return false;\r\n $menu_items = wp_list_pluck( $menu_object, 'object_id' );\r\n if( !$object_id ) {\r\n global $post;\r\n $object_id = get_queried_object_id();\r\n }\r\n return in_array( (int) $object_id, $menu_items );\r\n}", "public function handle_sub_menu( $is_visible, $menu_id ) {\n\t\tif ( $menu_id == 'account' ) {\n\t\t\t$is_visible = false;\n\t\t}\n\n\t\treturn $is_visible;\n\t}", "function analytics_submenu() {\n\t\t//\"add_options_page\" = pone la pagina dentro de la seccion AJUSTES, \"add_object_page\" = pone la pagina como una seccion independiente, \"add_submenu_page\" = se debe identificar de que seccion es el submenu de la pagina\n\t\tadd_submenu_page('mark-v', '[MARK-V] : Analytics', 'Analytics', 'manage_options', 'mark-v-analytics', 'markv_seccion_analytics' );\n\t}" ]
[ "0.83050555", "0.6939666", "0.68283004", "0.68122554", "0.6775738", "0.6717923", "0.67149276", "0.66478914", "0.66232485", "0.6591508", "0.65913033", "0.64401233", "0.6380542", "0.6373294", "0.6370299", "0.6360614", "0.63324016", "0.63242", "0.6284711", "0.6255883", "0.624509", "0.62315637", "0.62133926", "0.61810136", "0.6173108", "0.6170958", "0.6161819", "0.61510307", "0.6138844", "0.6130453" ]
0.85550517
0
Called if api.php is the main script invoked by HTTP or CLI, not as library.
function apiTakeOver(array $argv) { try { if (CLI) { define('ADMIN', true); $do = $argv[1] ?? ''; $request = json_decode($argv[2] ?? '[]', true); if (!is_array($request) and is_file($file = __DIR__.'/noXXXep/noXXXep.php')) { try { include_once $file; $request = json_decode(noXXXep::extractJSON($argv[2]), true); } catch (Throwable $e) {} } if (!is_array($request)) { throw new Exception("Cannot parse arguments $argv[2]: ".json_last_error_msg()); } } else { $request = $_REQUEST; $do = $request['do'] ?? null; unset($request['do']); define('ADMIN', isset($request['admin']) and hash_equals(keyValue('admin'), $request['admin'])); unset($request['admin']); header('Content-Type: text/plain; charset=utf-8'); // No reason to support preflighted requests. header('Access-Control-Allow-Origin: *'); } function_exists($func = "do_$do") or $func = 'do_help'; $json = $func($request); if ($json !== null) { header('Content-Type: application/json; charset=utf-8'); echo encodeJsonLine($json); } } catch (Throwable $e) { $public = $e instanceof PublicException; $code = $public ? $e->getCode() ?: 400 : 500; http_response_code($code); if ($admin = (defined('ADMIN') and ADMIN) or $public) { $admin or $e = $e->getMessage(); // We don't know which Content-Type was emitted so making it HTML-safe, // at the same time allowing better human readability in case it's plain/text. CLI ? fwrite(STDERR, $e.PHP_EOL) : print("<pre>\n".str_replace('<', '&lt;', $e)); } else { try { mailAdmin('apiex', get_class($e).' in api.php', $e); } catch (Throwable $e) {} } } $code = http_response_code(); if (CLI) { if ($code >= 200 and $code < 300) { $code > 200 and fwrite(STDERR, 'Exit code: '.$code.PHP_EOL); $code = 0; } exit($code); } elseif ((!$code or $code === 200) and !headers_sent() and !ob_get_length()) { http_response_code(204); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run_simple_api() {\n\n\t$plugin = new SimpleAPI();\n\t$plugin->run();\n\n}", "public function processApi() {\n\t\t\tif(isset($_REQUEST['x']) && $_REQUEST['x']!=\"\"){\n\t\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\", $_REQUEST['x'])));\n\t\t\t\tif((int)method_exists($this,$func) > 0) {\n\t\t\t\t\t$this->$func();\n\t\t\t\t} else {\n\t\t\t\t\techo 'processApi - method not exist';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo 'processApi - method not exist';\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "function main()\n {\n // We take parameter 1 to stablish the method to call when you execute: composer script hello/parameter-1/parameter-2/..\n // If the parameter 1 is empty we assign default by default :)\n $method = (isset($this->params[1])) ? $this->params[1] : 'default';\n // we convert - by _ because a method name does not allow '-' symbol\n $method = str_replace('-', '_', $method);\n\n //Call internal ENDPOINT_{$method}\n if (!$this->useFunction('METHOD_' . $method)) {\n return ($this->setErrorFromCodelib('params-error', \"/{$method} is not implemented\"));\n }\n }", "public function processApi() {\n\n if (count($_REQUEST) == 0) {\n $this->response('Error code 404, Method not found', 404);\n return false;\n }\n\n\n $func = $_REQUEST['action'];\n\n switch ($func) {\n\n /*\n case 'wb_get_review':\n array_shift($_REQUEST);\n $this->wb_get_review($_REQUEST);\n break;\n\n case 'wb_get_rating':\n array_shift($_REQUEST);\n $this->wb_get_rating($_REQUEST);\n break;\n */\n case 'wb_get_rating_by_url':\n array_shift($_REQUEST);\n $this->wb_get_rating_by_url($_REQUEST);\n break;\n\n default:\n $this->response(\"Error code 404, Method < $func > not found\", 404);\n break;\n }\n\n }", "Public Abstract Function getAPI();", "public function sniff_requests(){\n\t\tglobal $wp;\n\t\tif(isset($wp->query_vars['__api'])){\n\t\t\t$this->handle_request();\n\t\t\texit;\n\t\t}\n\t}", "function angularwp_isAPI(){\n if ( !class_exists( 'WP_REST_Response' ) ) {\n add_action( 'admin_notices', array( $this, 'errorAPI' ) );\n } \n }", "public function processApi()\r\n\t{\r\n\t\t// Array of methods that demands logged admin's permitions to be executed\r\n\t\t$_ADMIN_API = array(\"\");\t\t\t\r\n\r\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['func'])));\r\n\t\t$authorized = false;\r\n\t\t\r\n\t\t// Admin Functions\r\n\t\t//if (in_array($func, $_ADMIN_API) ) {\r\n\t\t\t$authorized = true;\r\n\t\t//}\r\n\t\t\r\n\t\t\r\n\t\tif($authorized)\r\n\t\t{ \r\n\t\t\tif((int)method_exists($this,$func) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->$func();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->response('',404);\r\n\t\t\t}\r\n\t\t}\r\n\t \telse {\r\n\t \t\t// If the method not exist with in this class, response would be \"Page not found\".\r\n\t \t\t$this->response($this->json($this->createResponseArrayMessageForUnauthorized()), API::HTTP_CODE_UNAUTHORIZED);\r\n \t\t}\r\n\t}", "final protected function main()\n {\n if (headers_sent()) {\n throw new ApiException('Headers have already been sent - this indicates a bug in the application!');\n }\n\n header(\"Content-Type: text/xml\");\n\n // javascript access control\n $httpOrigin = WebRequest::origin();\n\n if ($httpOrigin !== null) {\n $CORSallowed = $this->getSiteConfiguration()->getCrossOriginResourceSharingHosts();\n\n if (in_array($httpOrigin, $CORSallowed)) {\n header(\"Access-Control-Allow-Origin: \" . $httpOrigin);\n }\n }\n\n $responseData = $this->runApiPage();\n\n ob_end_clean();\n print($responseData);\n ob_start();\n }", "private function loadAPI(){\n\n $dir_path = __DIR__;\n $dir_path = str_replace(\"\\\\\",\"/\",$dir_path);\n\n //include the needed libraries\n //require_once self::getAPIRootPath().'libraries/Spreadsheet/vendor/autoload.php';\n\n //include all API classes\n require_once $dir_path.\"/APIHandler.php\";\n require_once $dir_path.\"/Authenticator.php\";\n require_once $dir_path.\"/Client.php\";\n require_once $dir_path.\"/Item.php\";\n\n require_once $dir_path.\"/Helper/Validator.php\";\n require_once $dir_path.\"/Helper/Cipher.php\";\n require_once $dir_path.\"/Helper/Database.php\";\n\n require_once $dir_path.\"/Exception/APIHandlerException.php\";\n require_once $dir_path.\"/Exception/DatabaseException.php\";\n\n }", "public static function init( $api = 0 ) {\n\t\t$controller = ucfirst(strtolower(isset($_REQUEST['c']) ? $_REQUEST['c'] : 'home')) . \"Controller\";\n\t\t$controller_name = \"Sentral\\\\Challenge\\\\$controller\";\n\t\t$method = isset($_REQUEST['m']) ? $_REQUEST['m'] : 'home';\n\n\t\t//if it is an API call\n\t\tif ( $api ) {\n\t\t\theader(\"Content-Type: application/json\");\n\n\t\t\ttry {\n\t\t\t\t$response = self::dispatch($controller_name, $method, $api);\n\t\t\t} catch(Exception $e) {\n\t\t\t\tdie(json_encode(['error' => $e->getMessage()]));\n\t\t\t}\n\n\t\t\tdie(json_encode($response));\n\n\t\t} else { // or just calling a page\n\t\t\ttry {\n\t\t\t\tself::dispatch($controller_name, $method, $api);\n\t\t\t} catch(Exception $e) {\n\t\t\t\tdie(\"Error starting the application: \" .$e->getMessage());\n\t\t\t}\n\t\t}\n\t}", "public function executeApiAction();", "public function processAPI()\n\t{\n\t\tif(method_exists($this, $this->requestEndpoint))\n\t\t{\n\t\t\t//Fetching the child function name and arguments\n\t\t\t$functionName = $this->requestEndpoint;\n\t\t\t$functionArgs = $this->requestArgs;\n\t\t\t\n\t\t\t//Variable Function\n\t\t\t$functionResponseData = $this->$functionName($functionArgs);\n\t\t\t\n\t\t\treturn $this->response($functionResponseData);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->response(\"No Endpoint found: {$this->requestEndpoint}\", 404);\n\t\t}\n\t}", "function run_accapi() {\n\n\t$plugin = new accapi();\n\t$plugin->run();\n\n}", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n {\n $this->$func();\n }\n else\n {\n //$this->response($this->json([\"msg\" => \"Bad Request\"]),400); // If the method not exist with in this class, response would be \"Page not found\".\n if(isset($_GET['namespace'])){\n $dir = $_SERVER['DOCUMENT_ROOT'].'/LearnAPI/api/apis/'.$_GET['namespace'];\n $file = $dir.'/'.$func.'.php';\n //die(print(file_exists($file)));\n if(file_exists($file)){\n include $file;\n $this->current_call = Closure::bind(${$func}, $this, get_class());\n $this->$func();\n } else {\n $this->response($this->json(['error'=>'method_not_found']),404);\n }\n } else {\n //we can even process functions without namespace here.\n $this->response($this->json(['error'=>'method_not_found']),404);\n }\n }\n }", "public function processApi() {\n $func = strtolower ( trim ( str_replace ( \"/\", \"\", $_REQUEST ['req'] ) ) );\n if (( int ) method_exists ( $this, $func ) > 0)\n $this->$func ();\n else\n $this->sendResponse ( 404, json_encode ( array (\n 'error' => true,\n 'message' => 'Not Found' \n ) ) );\n // If the method not exist with in this class, response would be \"Page not found\".\n }", "public function processAPI()\n {\n if (method_exists($this, $this->endpoint))\n {\n return $this->_response($this->{$this->endpoint}($this->args, $this->query));\n }\n return $this->_response(\"No Endpoint: $this->endpoint\", 404);\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',205); // If the method not exist with in this class \"Page not found\".\n\t\t}", "protected function includeCheck(){\n\n header('Content-Type: application/json');\n $headers = apache_request_headers();\n\n $err = $this->checkRequest($_SERVER,$headers);\n if(!empty($err)){\n http_response_code(400);\n echo json_encode($err);\n exit();\n }\n }", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404); // If the method not exist with in this class, response would be \"Page not found\".\n }", "public function sniff_client_requests() {\n global $wp;\n if (isset($wp->query_vars['__client_api'])) {\n $action = $wp->query_vars['__client_api'];\n $this->start_update($action, $wp->query_vars);\n exit;\n }\n }", "public function getApi();", "public function getApi();", "public function getApi();", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404); // If the method not exist with in this class \"Page not found\".\n }", "function isCli()\n{\n return php_sapi_name() == 'cli';\n}", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquestMethod'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n\t\t}", "public function processApi(){\n\t\t\t//$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\t\t\t$func = $_REQUEST['x'];\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n\t\t}", "public static function ensureCli()\n\t{\n\t\tif (php_sapi_name() != 'cli') {\n\t\t\techo \"This script must only be run from the CLI.\\n\";\n\t\t\techo \"Contact [email protected] if you require assistance.\\n\";\n\t\t\texit(1);\n\t\t}\n\t}" ]
[ "0.65723556", "0.6102277", "0.60708857", "0.6049118", "0.6041641", "0.6040418", "0.5984244", "0.5980581", "0.59764385", "0.59480894", "0.594655", "0.5943196", "0.5920012", "0.5886118", "0.58803296", "0.57725394", "0.57328117", "0.5722937", "0.5712515", "0.5699154", "0.5694018", "0.5677701", "0.5677701", "0.5677701", "0.5676901", "0.5672115", "0.5659628", "0.56531894", "0.56447285", "0.5642198" ]
0.6435302
1
Common CSS styles for HTML pages generated by api.php.
function apiStylesheet() { return <<<CSS body { background: #fafafa; font-family: sans-serif; } .hi, mark { background: orange; } .lo, th { background: #eee; } /* For td.hi color the border so adjacent td.lo's outline looks nicer. */ .hi { border-color: orange; } .lo { outline: 0.06em solid orange; outline-offset: -0.06em; } table { margin: 1em 0; background: white; border-collapse: collapse; } th, td { border: .06em solid #ddd; padding: .25em .5em; } CSS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderStylesheets();", "abstract public function getCss();", "function getStyleSheets() {\n\t?>\n\t<link rel=\"stylesheet\" href=\"jquery-ui.min.css\" type=\"text/css\"/>\n\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\"/>\n\t<?php\n\tgenerateBandCss();\n}", "function getPageCss(){\n return $this->CurrentStep()->getPageCss();\n }", "public static function print_styles() {\n\t\t?>\n\t\t<style type='text/css'>\n\t\t\t#site-consolidator-ui select[multiple] {\n\t\t\t\tdisplay: block;\n\t\t\t\tpadding: 6px;\n\t\t\t\tmargin: 8px 0;\n\t\t\t\theight: 340px;\n\t\t\t}\n\n\t\t\t#site-consolidator-ui div {\n\t\t\t\tfloat: left;\n\t\t\t}\n\n\t\t\t#site-consolidator-ui #one-site-to-rule-them-all {\t\t\n\t\t\t\tmargin-top: 23px;\n\t\t\t\tmargin-left: 10px;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "function getStyles(){\n global $DOPBSP;\n \n $HTML = array();\n \n /*\n * Register styles.\n */\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'libraries/css/jquery.dop.Select.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'libraries/css/pinpoint-businesses.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend.css\">');\n \n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-addons.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-coupons.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-dashboard.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-discounts.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-emails.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-extras.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-forms.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-locations.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-pro.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-reservations.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/jquery.dop.backend.BSPReservationsAdd.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/jquery.dop.backend.BSPReservationsCalendar.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-settings.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-themes.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-tools.css\">');\n array_push($HTML, '<link rel=\"stylesheet\" href=\"'.$DOPBSP->paths->url.'assets/gui/css/backend-translation.css\">');\n \n return $HTML;\n }", "public function getFrontendStyles() {\n }", "public function getCssAction()\n {\n $this->setJsonResponse();\n $service = new ThemingService();\n $result = $service->getCustomCss();\n return array('success' => true,\n 'css' => $result);\n }", "public function getCss();", "function printPageCSS(){\n\techo \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\" . plugins_url('styles/mixare-pages.css', __FILE__) . \"\\\" />\";\n}", "public function styles() {\n\t\t$styles = array(\n\t\t\tarray(\n\t\t\t\t'handle' => 'my_styles_css',\n\t\t\t\t'src' => $this->get_base_url() . '/css/my_styles.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray( 'field_types' => array( 'poll' ) )\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\treturn array_merge( parent::styles(), $styles );\n\t}", "public function getCss(){ }", "function conejo_css(){\n\tif($_GET['preview'] == 'true' || $_GET['conejo'] !== 'false'){\n\t\techo '<!-- Conejo Framework Main CSS -->\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"https://www.callutheran.edu/_resources/conejo/css/styles.css\" />';\n\t}\t\n}", "static public function getDefaultCSS() {\n\n $_sCSS = <<<CSSRULES\n/* Settings Notice */\n.wrap div.updated.admin-page-framework-settings-notice-container, \n.wrap div.error.admin-page-framework-settings-notice-container, \n.media-upload-form div.error.admin-page-framework-settings-notice-container\n{\n clear: both;\n margin-top: 16px;\n}\n.wrap div.error.confirmation.admin-page-framework-settings-notice-container {\n border-color: #368ADD;\n} \n/* Contextual Help Page */\n.contextual-help-description {\n clear: left; \n display: block;\n margin: 1em 0;\n}\n.contextual-help-tab-title {\n font-weight: bold;\n}\n\n/* Page Meta Boxes */\n.admin-page-framework-content {\n margin-bottom: 1.48em; \n display: inline-table; /* Fixes the bottom margin getting placed at the top. */\n width: 100%; /* This allows float:right elements to go to the very right end of the page. */\n}\n\n/* Regular Heading Titles - the meta box container element affects the styles of regular main content output. So it needs to be fixed. */\n.admin-page-framework-container #poststuff .admin-page-framework-content h3 {\n font-weight: bold;\n font-size: 1.3em;\n margin: 1em 0;\n padding: 0;\n font-family: 'Open Sans', sans-serif;\n} \n\n/* In-page tabs */ \n.admin-page-framework-in-page-tab .nav-tab.nav-tab-active {\n border-bottom-width: 2px;\n}\n\n/* Framework System Information */\n.admin-page-framework-info {\n font-size: 0.8em;\n font-weight: lighter;\n text-align: right;\n}\n\n/* Debug containers */\npre.dump-array {\n border: 1px solid #ededed;\n margin: 24px 2em;\n margin: 1.714285714rem 2em;\n padding: 24px;\n padding: 1.714285714rem;\t\t\t\t\n overflow-x: auto; \n white-space: pre-wrap;\n background-color: #FFF;\n margin-bottom: 2em;\n width: auto;\n}\nCSSRULES;\n\n return $_sCSS . PHP_EOL \n . self::_getFormSectionRules() . PHP_EOL\n . self::_getFormFieldRules() . PHP_EOL\n . self::_getCollapsibleSectionsRules() . PHP_EOL\n . self::_getFieldErrorRules() . PHP_EOL\n . self::_getMetaBoxFormRules() . PHP_EOL\n . self::_getWidgetFormRules() . PHP_EOL\n . self::_getPageLoadStatsRules() . PHP_EOL\n . self::_getVersionSpecificRules( $GLOBALS['wp_version'] );\n \n }", "public function fetchAllCSS()\n {\n foreach ($this->css_files as $item) {\n $file = ROOTPATH . \"public/\" . $item;\n if (!file_exists($file)) {\n continue;\n }\n echo \"<link rel='stylesheet' href='\".base_url($item).\"'>\\n\";\n }\n }", "function getStyles () {\r\n return array(\"css/forum.css\");\r\n }", "private function get_migration_page_styles() {\n\t\t?>\n\t\t.avada-setup {\n\t\t\tpadding: 2% 20%;\n\t\t\tbackground-color: #f2f2f2;\n\t\t\tfont-family: \"Noto Sans\", Roboto, \"Open Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Oxygen-Sans\", \"Ubuntu\", \"Cantarell\", \"Helvetica Neue\", sans-serif;\n\t\t\tfont-weight:300;\n\t\t\tfont-size: 1.1em;\n\t\t}\n\t\t.update-content {\n\t\t\tmax-width: 1150px;\n\t\t\tmargin: auto;\n\t\t}\n\t\t.avada-logo {\n\t\t\tmargin-bottom: 25px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.avada-logo img {\n\t\t\tmax-width: 226.5px;\n\t\t\theight: auto;\n\t\t\tvertical-align: bottom;\n\t\t}\n\t\t.avada-version {\n\t\t\tvertical-align: bottom;\n\t\t}\n\t\t.avada-version-inner {\n\t\t\tdisplay: inline-block;\n\t\t\tmargin-left: 20px;\n\t\t\tpadding: 5px 10px;\n\t\t\tbackground-color: #65bc7b;\n\t\t\t-webkit-border-radius: 3px;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.avada-content-wrapper {\n\t\t\t-webkit-border-radius: 3px;\n\t\t\tborder-radius: 3px;\n\t\t\t-webkit-box-shadow: 1px 1px 3px 1px rgba(0,0,0,.2);\n\t\t\tbox-shadow: 1px 1px 3px 1px rgba(0,0,0,.2);\n\t\t}\n\t\t.avada-welcome-msg {\n\t\t\tpadding: 25px 35px;\n\t\t\tline-height: 1.6em;\n\t\t\tbackground-color: #65bc7b;\n\t\t\tcolor: #fff;\n\t\t\tfont-style: italic;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.avada-migration-link {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.avada-setup-content {\n\t\t\tpadding: 30px 10%;\n\t\t\tbackground: #fff;\n\t\t}\n\n\t\t.fusion-builder-migration-progress-bar {\n\t\t\tdisplay: block;\n\t\t\theight: 20px;\n\t\t\twidth: 100%;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.fusion-builder-migration-progress-bar[value] {\n\t\t\t-webkit-appearance: none;\n\t\t\t-moz-appearance: none;\n\t\t\tappearance: none;\n\t\t\tborder: none;\n\t\t\tcolor: blue;\n\t\t}\n\t\t.fusion-builder-migration-progress-bar[value]::-webkit-progress-bar {\n\t\t\tbackground-color: #ccc;\n\t\t\tborder-radius: 2px;\n\t\t\tbox-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;\n\t\t}\n\t\t.fusion-builder-migration-progress-bar[value]::-webkit-progress-value {\n\t\t\tbackground-color: #65bc7b;\n\t\t\t-webkit-animation: animate-stripes 5s linear infinite;\n\t\t\tanimation: animate-stripes 5s linear infinite;\n\t\t}\n\t\tprogress[value]::-moz-progress-bar {\n\t\t\tbackground-color: #65bc7b;\n\t\t}\n\t\t.fusion-builder-migration-progress-bar::-webkit-progress-bar,\n\t\t.fusion-builder-migration-progress-bar,\n\t\t.fusion-builder-migration-progress-bar[value] {\n\t\t\t-webkit-animation: animate-stripes 5s linear infinite;\n\t\t\tanimation: animate-stripes 5s linear infinite;\n\t\t}\n\t\t@-webkit-keyframes animate-stripes {\n\t\t\t100% { background-position: -100px 0px; }\n\t\t}\n\t\t@keyframes animate-stripes {\n\t\t\t100% { background-position: -100px 0px; }\n\t\t}\n\n\t\t.tasks-list {\n\t\t\tpadding: 0;\n\t\t\tlist-style: none;\n\t\t}\n\t\t.tasks-list li .content {\n\t\t\tcolor: #333;\n\t\t}\n\t\t.tasks-list li {\n\t\t\tcolor: #f2f2f2;\n\t\t}\n\t\t.tasks-list li:before {\n\t\t\tvertical-align: middle;\n\t\t\tfont-family: dashicons;\n\t\t\tcontent: \"\\f147\";\n\t\t\tfont-size: 1.4em\n\t\t}\n\t\t.tasks-list li.done {\n\t\t\tcolor: #65bc7b;\n\t\t}\n\t\t.tasks-list li.doing {\n\t\t\tcolor: #000;\n\t\t}\n\t\t.avada-button {\n\t\t\tdisplay: inline-block;\n\t\t\tmargin: 1.3em 0 0 0;\n\t\t\tpadding: 1em 2em;\n\t\t\tbackground-color: #65bc7b;\n\t\t\tcolor: #fff;\n\t\t\ttext-decoration: none;\n\t\t\t-webkit-border-radius: 3px;\n\t\t\tborder-radius: 3px;\n\t\t\t-webkit-transition: all 0.3s;\n\t\t\t-moz-transition: all 0.3s;\n\t\t\t-ms-transition: all 0.3s;\n\t\t\ttransition: all 0.3s;\n\t\t}\n\t\t.avada-button.needs-update {\n\t\t\tbackground-color: #ef5350;\n\t\t}\n\t\t.avada-button:hover {\n\t\t\tbackground-color: #5aa86c;\n\t\t}\n\t\t.avada-button.needs-update:hover {\n\t\t\tbackground-color: #f44336;\n\t\t}\n\t\t.deny-conversion {\n\t\t\tbackground-color: #333333;\n\t\t}\n\t\t.deny-conversion:hover {\n\t\t\tbackground-color: #555555;\n\t\t}\n\t\t.avada-footer {\n\t\t\tpadding: 23px 35px;\n\t\t\tbackground: #f2f2f2;\n\t\t\tfont-size: 0.8em;\n\t\t\ttext-align: right;\n\t\t}\n\t\t.avada-themefusion-link {\n\t\t\tcolor: #000;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.avada-separator {\n\t\t\tpadding: 0 10px;\n\t\t}\n\t\t.avada-heart {\n\t\t\tpadding-left: 5px;\n\t\t\tvertical-align: middle;\n\t\t}\n\t\t.avada-heart:after {\n\t\t\tfont-family: dashicons;\n\t\t\tcontent: \"\\f487\";\n\t\t}\n\n\t\t.avada-overall-progress {\n\t\t\tdisplay: -ms-flexbox;\n\t\t\tdisplay: -webkit-flex;\n\t\t\tdisplay: flex;\n\t\t\t-weblit-justify-content: space-between;\n\t\t\tjustify-content: space-between;\n\t\t\tmargin-bottom: 30px;\n\t\t}\n\t\t.avada-progress-badge {\n\t\t\theight: 7px;\n\t\t\twidth: 33%;\n\t\t\tbackground-color: #F2F2F2;\n\t\t}\n\t\t.avada-progress-badge.avada-filled {\n\t\t\tbackground-color: #65bc7b;\n\t\t}\n\t\t<?php\n\t}", "function excStyles(){\n $styles = new converterMethod; \n echo nt_styles($styles->nt_Url_Style('netfree', false), false);\n echo nt_styles($styles->nt_Url_Style('movie-row', false), false);\n echo nt_styles($styles->nt_Url_Style('featuredmovie', false), false);\n echo nt_styles($styles->nt_Url_Style('header', false), false);\n echo nt_styles($styles->nt_Url_Style('footer', false), false);\n}", "public function config_page_styles() {\n\t\twp_enqueue_style( 'dashboard' );\n\t\twp_enqueue_style( 'thickbox' );\n\t\twp_enqueue_style( 'global' );\n\t\twp_enqueue_style( 'wp-admin' );\n\t\t$this->asset_manager->enqueue_style( 'select2' );\n\n\t\t$this->asset_manager->enqueue_style( 'admin-css' );\n\t}", "public function style()\n {\n // Put styles here\n }", "public function style()\n {\n // Put styles here\n }", "public function renderStylesheets()\n {\n // Add stylesheets\n $this->getService('response')\n ->addStylesheet($this->getAssetsBaseName() . '.base', 'first')\n ->addStylesheet($this->getAssetsBaseName() . '.media', 'last')\n ->addStylesheet($this->getAssetsBaseName() . '.handheld', 'last', array('media' => 'handheld'));\n\n // Render the `response` stylesheets\n return parent::renderStylesheets();\n }", "function header_output() {\n ?>\n <!--Customizer CSS--> \n <style type=\"text/css\">\n <?php generate_css('body', 'background-color', 'background_color', '#'); ?> \n <?php generate_css('.branch-color', 'background-color', 'branch_color', '', '!important'); ?>\n\t\t <?php generate_css('.secondary-color', 'background-color', 'secondary_color', '', '!important'); ?>\n\t\t <?php generate_css('.branch-color-text', 'color', 'branch_color', '', '!important'); ?>\n\t\t <?php generate_css('.page-header-wrapper', 'background-image', 'header_img_upload', 'url(', ')'); ?> \n </style> \n <!--/Customizer CSS-->\n <?php\n }", "function generateCSS() {\r\n\t\tif ($this->developmentMode) {\r\n\t\t\t$out = '';\r\n\t\t\tif(isset($this->buffer['css'])) {\r\n\t\t\t\tforeach($this->buffer['css'] as $css) {\r\n\t\t\t\t\t$out .= $this->Html->css($css);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $out;\r\n\t\t} else {\r\n\t\t\tif(isset($this->buffer['css'])) {\r\n\t\t\t\tforeach($this->buffer['css'] as $css) {\r\n\t\t\t\t\t$this->Html->css($css,null,null,false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $this->style_for_layout();\r\n\t\t}\r\n\t}", "function admin_css()\r\n{\r\n}", "function css() { ?>\n\t\t<link rel=\"stylesheet\" href=\"<?php echo WP_PLUGIN_URL . '/ajax-for-all/css/admin.css?v=0.2' ?>\" type=\"text/css\" media=\"all\" /> <?php\n\t}", "function funky_generate_dynamic_css() {\r\n\t\r\n\tglobal $funky_shortname, $post;\r\n\t\r\n\t$output = '';\r\n\t\r\n\t\r\n\t// Preloader\r\n\t$output .= '#percent-bar { background-color: '. of_get_option( 'color_preloader' ) .'; }';\r\n\t\r\n\t\r\n\t// Accent\r\n\t$output .= '.pagination,\r\n\t\t\t\t.menu-toggle,\r\n\t\t\t\t.sidebar-toggle,\r\n\t\t\t\t.cycle-overlay { background-color:'. of_get_option( 'color_accent' ) .'; }';\r\n\t\r\n\t$output .= 'blockquote,\r\n\t\t\t\tspan.required { color: '. of_get_option( 'color_accent' ) .'; }';\r\n\t\r\n\t\r\n\t// Accent Text\r\n\tif ( of_get_option( 'color_accent_text' ) == '1' ) {\r\n\t\r\n\t\t$output .= 'span.menu-toggle > span,\r\n\t\t\t\t\tspan.sidebar-toggle > span,\r\n\t\t\t\t\t.cycle-overlay { color: #000; }';\t\t\t\t\t\r\n\t\r\n\t}\r\n\r\n\t\r\n\t// Navigation\r\n\t$output .= '.header-wrapper,\r\n\t\t\t\t.footer,\r\n\t\t\t\t.pagination,\r\n\t\t\t\t.page-template-page-portfolio-php,\r\n\t\t\t\tbody.blog,\r\n\t\t\t\tbody.archive { background-color: '. of_get_option( 'color_header' ) .';}';\r\n\t\r\n\t\r\n\t// Navigation Text\r\n\tif ( of_get_option( 'color_header_text' ) == '0' ) {\r\n\t\t\r\n\t\t$output .= '.header-content h1 > a,\r\n\t\t\t\t\t.header-content h1 > .header-tagline,\r\n\t\t\t\t\t.header-content .title,\r\n\t\t\t\t\t.header-content nav ul a,\r\n\t\t\t\t\t.social-buttons a,\r\n\t\t\t\t\t.copyright,\r\n\t\t\t\t\t.pagination,\r\n\t\t\t\t\t.pagination a,\r\n\t\t\t\t\t.pagination a:hover,\r\n\t\t\t\t\t.page-template-page-portfolio-php,\r\n\t\t\t\t\tbody.blog,\r\n\t\t\t\t\tbody.archive{ color: #111; }\r\n\t\t\t\t\t\r\n\t\t\t\t\t.copyright a { \r\n\t\t\t\t\t\tcolor: #111;\r\n\t\t\t\t\t\tborder-bottom: 1px dotted #111;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t.copyright a:hover { \r\n\t\t\t\t\t\tcolor: #111;\r\n\t\t\t\t\t\tborder: none;\r\n\t\t\t\t\t}'; \r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\t// Feature Content\r\n\t$output .= '.feature-content { background-color: '. of_get_option( 'color_feature_content' ) .';}';\r\n\r\n\t\r\n\t// Links\r\n\t$output .= 'a { color: '. of_get_option( 'color_link' ) .'; }';\r\n\t\r\n\t$output .= 'a:hover,\r\n\t\t\t\t.post-meta a:hover,\t\r\n\t\t\t\t.comment-author a:hover, \t\r\n\t\t\t\t.comment-navigation a:hover,\t\r\n\t\t\t\t.comment-footer a:hover { color: '. of_get_option( 'color_link_hover' ) .'; }';\r\n\r\n\t\t\t\t\r\n\t// Buttons\r\n\t$output .= '.funky-button,\r\n\t\t\t\t.funky-button:visited,\r\n\t\t\t\tinput[type=\"button\"],\r\n\t\t\t\tinput[type=\"submit\"],\r\n\t\t\t\tbutton,\r\n\t\t\t\tbutton[type=\"submit\"],\r\n\t\t\t\tinput[type=\"reset\"],\r\n\t\t\t\tinput[type=\"file\"],\r\n\t\t\t\t.tagcloud a,\r\n\t\t\t\t.tagcloud a:hover {\r\n\t\t\t\t\tbackground: none;\r\n\t\t\t\t\tborder-color: '. of_get_option( 'color_button' ) .'; \r\n\t\t\t\t\tcolor: '. of_get_option( 'color_button' ) .';\r\n\t\t\t\t}';\r\n\t\t\t\t\r\n\t$output .= '.funky-button:hover,\r\n\t\t\t\t.funky-button:visited:hover,\r\n\t\t\t\tinput[type=\"button\"]:hover,\r\n\t\t\t\tinput[type=\"submit\"]:hover,\r\n\t\t\t\tbutton:hover,\r\n\t\t\t\tbutton[type=\"submit\"]:hover,\r\n\t\t\t\tinput[type=\"reset\"]:hover,\r\n\t\t\t\tinput[type=\"file\"]:hover,\r\n\t\t\t\t.tagcloud a:hover {\r\n\t\t\t\t\tcolor: '. of_get_option( 'color_button' ) .';\r\n\t\t\t\t}';\t\r\n\t\r\n\t\r\n\t// Compress the CSS\r\n\t$output = preg_replace( '!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $output );\r\n\t$output = str_replace( ': ', ':', $output );\r\n\t$output = str_replace( array( \"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", ' ', ' ', ' ' ), '', $output );\r\n\t\r\n\t\r\n\t// Output dynamic styles\r\n\twp_add_inline_style( 'soapbox-style', $output );\t\r\n\t\r\n}", "function OutputCSS() { ?>\n\t<link rel=\"stylesheet\" href=\"<?php echo $this->folder . '/style.css?ver=' . $this->version; ?>\" type=\"text/css\" />\n\t<!--[if lt IE 7]><style type=\"text/css\">#bsbar { position: absolute; } #bsbar .bsbar-menupop li a { width: 100%; }</style><![endif]-->\n<?php\n\t\tif ( is_admin() ) {\n\t\t\techo '\t<style type=\"text/css\">#bsbarlist ul { margin: 5px 0 0 25px; }</style>' . \"\\n\";\n\t\t}\n\t}", "function output_css()\n\t{\n\t\techo $this->css ? '<style>' . $this->css . '</style>' : '';\n\t}", "protected function addStyles() {\n $styles = '<style media=\"all\">';\n\n //WP Editor Styles \n $styles .= ' .aligncenter { display: block; margin-left: auto; margin-right: auto; } .alignright { float:right; margin: 5px 0 20px 20px;} .alignleft { float: left; margin: 5px 20px 20px 0; }';\n\n //Document Background Color\n if( !empty( $this->getSetting('bg_color') ) )\n $styles .= ' body { background-color: '. $this->getSetting('bg_color') .'; }';\n\n //Body Text Color\n if( !empty( $this->getSetting('body_color') ) )\n $styles .= ' body, p { color: '. $this->getSetting('body_color') .'; }';\n\n //Headings Color\n if( !empty( $this->getSetting('heading_color') ) )\n $styles .= ' h1, h2, h3, h4, h5, h6 { color: '. $this->getSetting('heading_color') .'; }';\n \n //Body Font\n if( !empty( $this->getSetting('body_font') ) )\n $styles .= ' body, p { font-family: '. $this->getSetting('body_font') .'; }';\n \n //Headings Font\n if( !empty( $this->getSetting('heading_font') ) )\n $styles .= ' h1, h2, h3, h4, h5, h6 { font-family: '. $this->getSetting('heading_font') .'; }'; \n \n\n $styles .= '</style>';\n \n $this->mPDF->WriteHTML( $styles );\n }" ]
[ "0.6619159", "0.65348107", "0.6381142", "0.63353837", "0.63048714", "0.6298618", "0.62687725", "0.6215643", "0.6185932", "0.6158643", "0.61401343", "0.6132321", "0.6107452", "0.6098041", "0.6097126", "0.6096888", "0.60838014", "0.60809815", "0.6044259", "0.6034733", "0.6034733", "0.6019359", "0.6006768", "0.6004333", "0.5974502", "0.5967532", "0.5966794", "0.5964844", "0.5955102", "0.5939773" ]
0.68275523
0
Returns array with info about a map uploaded using maps.php (in particular, statistics like last play time). $mapPath must be safe. Does not clear stat/realpath caches. Trivia: PHP has 3 types of caches relevant to our cause: stat() cache (perrequest; affects functions like include and filemtime()), "realpath" cache (perprocess; affects the same file functions; holds only 'is_dir' and 'realpath' values as seen in realpath_cache_get()) and opcache (perprocess; affects include). Do opcache_invalidate() before reading data .php files (upload.php). Do clearstatcache() before reading attributes of a file whose attributes were already read during this request. Ignore realpath cache for simplicity because we do not expect symlinks among our data files. Thankfully, opcache_invalidate() does not rely on stat cache so there's no need to clearstatcache() before calling it even if the file's time has changed.
function uploadInfo($mapPath) { $file = "$mapPath/upload.php"; // Doesn't want canonicalized path, unlike clearstatcache(). function_exists('opcache_invalidate') and opcache_invalidate($file); try { return include $file; } catch (Throwable $e) {} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getmaps($path){\n\n // percorso relativo alla root del webserver, con \"/\"\n $rootrelpath = str_replace($_SERVER['DOCUMENT_ROOT'], \"\", str_replace(DIRECTORY_SEPARATOR, \"/\", $path));\n\n // tutti i file del percorso $path, rimuove \".\" e \"..\"\n $files = array_diff(scandir($path), array('.', '..'));\n \n $maps = array();\n\n foreach ($files as $file){\n // per ogni file controlla se hanno mime type SVG\n if (mime_content_type($path . DIRECTORY_SEPARATOR . $file) === \"image/svg+xml\"){\n\n // percorso relativo del file\n $filerelpath = $rootrelpath . \"/\" . $file;\n\n // nome mappa\n $mapname = pathinfo($path . DIRECTORY_SEPARATOR . $file)['filename'];\n\n // aggiungi dettagli mappa nell'array delle mappe\n $maps[] = array(\"name\" => $mapname, \"path\" => $filerelpath);\n }\n }\n\n return $maps;\n }", "function scanMaps() {\n $ds = DIRECTORY_SEPARATOR;\n $files = [];\n $root = realpathOrFail(keyValue('maps')).$ds;\n\n // pa/\n // pa/th/\n // pa/th/map.json - not descending into pa/th/\n // pa/se/\n // pa/se/co/\n $scan = function (array $path) use (&$scan, $root, &$files, $ds) {\n $pathString = $path ? join($ds, $path).$ds : '';\n\n // opendir() is the only function within $scan that may fail. is_...()\n // functions never fail (thanks to IS_EXISTS_CHECK in php_stat(), see\n // ext\\standard\\filestat.c).\n try {\n // If the directory we're opening was removed after its name was read\n // by the parent $scan, this will error. Same if its parent was removed.\n //\n // If the directory is removed after opendir() when we call readdir(),\n // the latter will return false (and no warning) and closedir() will\n // succeed. If the directory is moved or any of its parents is moved or\n // removed, readdir() will continue reading it - this will make our\n // paths wrong but such situations will be detected once we try reading\n // map.json.\n //\n // Tested on ext4 and tmpfs.\n $dir = opendir($root.$pathString);\n } catch (Throwable $e) {\n return;\n }\n\n while (false !== $file = readdir($dir)) {\n if ($file !== '.' and $file !== '..') {\n $full = $root.$pathString.$file;\n clearstatcache(false, $full);\n\n if (is_dir($full)) {\n $mapFile = $full.$ds.'map.json';\n clearstatcache(false, $mapFile);\n\n $subPath = array_merge($path, [$file]);\n\n if (is_file($mapFile)) {\n $files[] = join('/', array_map('rawurlencode', $subPath));\n } else {\n $scan($subPath);\n }\n }\n }\n }\n\n closedir($dir);\n };\n\n $scan([]);\n $events = [];\n\n foreach ($this->maps + array_flip($files) as $key => $existing) {\n $mapFile = $root.str_replace('/', $ds, rawurldecode($key)).$ds.'map.json';\n\n try {\n $mtime = filemtime($mapFile);\n } catch (Throwable $e) {\n $mtime = null;\n }\n\n if (!$mtime) {\n if (is_object($existing)) {\n $events[] = ['remove', ['maps', $key]];\n unset($this->maps[$key]);\n }\n } elseif ($mtime !== ($existing->mtime ?? null)) {\n // New or changed.\n try {\n $data = json_decode(file_get_contents($mapFile));\n } catch (Throwable $e) {}\n if (($data->format ?? null) === FORMAT_VERSION) {\n $data->mtime = $mtime; // internal, for $mtime check above\n $info = ((array) uploadInfo(dirname($mapFile))) + ['changeTime' => $mtime];\n foreach (['changeTime', 'addTime', 'playTime', 'playCount'] as $k) {\n $data->$k = $info[$k] ?? null;\n }\n $events[] = ['add', ['maps', $key, $data]];\n $this->maps[$key] = $data;\n }\n }\n }\n\n $this->send($events);\n }", "private function _getMaps()\n {\n $dir = new DirectoryIterator(OAIPMH_HARVESTER_MAPS_DIRECTORY);\n $maps = array();\n foreach ($dir as $dirEntry) {\n if ($dirEntry->isFile() && !$dirEntry->isDot()) {\n $filename = $dirEntry->getFilename();\n $pathname = $dirEntry->getPathname();\n if (preg_match('/^(.+)\\.php$/', $filename, $match) \n && $match[1] != 'Abstract'\n ) {\n // Get and set only the name of the file minus the extension.\n require_once($pathname);\n $class = \"OaipmhHarvester_Harvest_${match[1]}\";\n $metadataSchema = constant(\"$class::METADATA_SCHEMA\");\n $metadataPrefix = constant(\"$class::METADATA_PREFIX\");\n $maps[$metadataPrefix] = $metadataSchema;\n }\n }\n }\n return $maps;\n }", "function getMapFile() {\r\n if (!empty($this->aObjects[0]->aFields)) {\r\n require $this->sRessourcesFile;\r\n $sWmsServiceId = $this->aObjects[0]->aFields['wmsservice_id'];\r\n // Supprime les accents et caractères spéciaux.\r\n $sWmsServiceId = htmlentities($sWmsServiceId, ENT_NOQUOTES, 'UTF-8');\r\n $sWmsServiceId = preg_replace('#&([A-za-z])(?:acute|cedil|caron|circ|grave|orn|ring|slash|th|tilde|uml);#', '\\1', $sWmsServiceId);\r\n $sWmsServiceId = preg_replace('#&([A-za-z]{2})(?:lig);#', '\\1', $sWmsServiceId); // pour les ligatures e.g. '&oelig;'\r\n $sWmsServiceId = preg_replace('#&[^;]+;#', '', $sWmsServiceId); // supprime les autres caractères\r\n // Nom du fichier \".map\".\r\n $sMapFileHash = hash('sha256', $this->aValues['token']);\r\n $this->aObjects[0]->aFields['map_file_hash'] = $sMapFileHash;\r\n if ($this->aValues['my_vitis_id'] == $this->aProperties['private_wms_service']) {\r\n $sProdDir = 'wms_private';\r\n $sMapFileName = $sMapFileHash . '.map';\r\n } else {\r\n $sProdDir = 'wms_public';\r\n $sMapFileName = $sMapFileHash . '_' . $sWmsServiceId . '.map';\r\n }\r\n // Chemin du fichier.\r\n if ($this->aValues['type'] == 'prod')\r\n $this->aObjects[0]->aFields['map_file'] = $this->aProperties[\"map_dir\"] . '/' . $sProdDir . '/' . $sMapFileName;\r\n else\r\n $this->aObjects[0]->aFields['map_file'] = $this->aProperties[\"map_dir\"] . '/wms_test/' . $sMapFileName;\r\n // Contenu du fichier \".map\".\r\n if (file_exists($this->aObjects[0]->aFields['map_file']))\r\n $this->aObjects[0]->aFields['map_file_content'] = file_get_contents($this->aObjects[0]->aFields['map_file']);\r\n // Source des couches du flux de test.\r\n $aParams['sSchemaVm4ms'] = array('value' => $this->aProperties['schema_vm4ms'], 'type' => 'schema_name');\r\n $aParams['wmsservice_id'] = array('value' => $sWmsServiceId, 'type' => 'string');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getWmsServiceLayersSource'], $aParams);\r\n if (!$this->oConnection->oBd->erreurRencontree) {\r\n $aLayersSource = array();\r\n while ($aLayer = $this->oConnection->oBd->ligneSuivante($oPDOresult))\r\n $aLayersSource[$aLayer['name']] = $aLayer['source'];\r\n $this->aObjects[0]->aFields['layers_sources'] = $aLayersSource;\r\n }\r\n }\r\n $aXmlRacineAttribute['status'] = 1;\r\n if (isset($this->aValues['sEncoding'])) {\r\n $sEncoding = $this->aValues['sEncoding'];\r\n } else {\r\n $sEncoding = null;\r\n }if (isset($this->aValues['sSourceEncoding'])) {\r\n $sSourceEncoding = $this->aValues['sSourceEncoding'];\r\n } else {\r\n $sSourceEncoding = null;\r\n }if (isset($this->aValues['output'])) {\r\n $output = $this->aValues['output'];\r\n } else {\r\n $output = null;\r\n }\r\n $sMessage = $this->asDocument('', 'vitis', $sEncoding, True, $aXmlRacineAttribute, $sSourceEncoding, $output);\r\n return $sMessage;\r\n }", "public function info()\n\t{\n\t\tclearstatcache();\n\t\treturn stat($this->_path);\n\t}", "public function getCacheInfo( $path )\n\t{\n\t\tif (!empty( $path )) {\n\t\t\t$len = strlen($path);\n\t\t\tif ($path[$len-1] != '/') {\n\t\t\t\t// Add ending slash\n\t\t\t\t$path = $path.'/';\n\t\t\t}\n\n\t\t\t// Test .cacheinfo exists\n\t\t\tif (trim( $this->sshConnection->exec('test -f '.$path.\".cacheinfo && echo 'true' || echo 'false'\") ) == 'false') {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$info = array( 'size' => '', 'status' => '', 'mtime' => '');\n\n\t\t\t// Get last message\n\t\t\t$cache = trim( $this->sshConnection->exec('tail -n 1 '.$path.'.cacheinfo') );\n\n\t\t\t$info['size'] = trim( $this->sshConnection->exec('du -sh '.$path.\" | awk '{print $1}'\") );\n\n\t\t\tif (strstr($cache, 'Status:') != FALSE) {\n\t\t\t\t$info['status'] = substr($cache, 8); // Remove \"Status: \" from string\n\t\t\t\t$info['mtime'] = time();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$info['status'] = 'Ready';\n\t\t\t\t$info['mtime'] = substr($cache, 7); // Remove \"mtime: \" from string\n\t\t\t}\n\n\t\t\treturn $info;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function readSmapsData($pid)\r\n {\r\n if (file_exists(\"/proc/$pid/smaps\")) {\r\n return file_get_contents(\"/proc/$pid/smaps\");\r\n }\r\n return false;\r\n }", "public function load($path)\n {\n $data = MapLoader::loadFile($path);\n\n return $this->data = array_merge($this->data, $data);\n }", "public function getStats() {\r\n\t\tglobal $SITE_DIR;\r\n\t\t$files = array();\r\n\t\t$directoryHandle = opendir($SITE_DIR . 'data/cache');\r\n\t\twhile (false !== ($filename = readdir($directoryHandle))) {\r\n\t\t\tif (substr($filename, 0, strlen($this->prefix)) == $this->prefix) {\r\n\t\t\t\t$files[] = $SITE_DIR . 'data/cache/' . $filename;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array('files' => count($files));\r\n\t}", "public function getMapData()\n {\n return $this->map;\n }", "function SaveImageMap()\r\n\t{\r\n\t\tif ( !$this->BuildMap ) { return(-1); }\r\n\r\n\t\tif ( $this->ImageMap == NULL )\r\n\t\t{\r\n\t\t\t$this->Errors[] = '[Warning] SaveImageMap - Image map is empty.';\r\n\t\t\treturn(-1);\r\n\t\t}\r\n\r\n\t\t$Handle = fopen($this->tmpFolder.$this->MapID, 'w');\r\n\t\tif ( !$Handle )\r\n\t\t{\r\n\t\t\t$this->Errors[] = '[Warning] SaveImageMap - Cannot save the image map.';\r\n\t\t\treturn(-1);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach($this->ImageMap as $Key => $Value)\r\n\t\t\tfwrite($Handle, htmlentities($Value).\"\\r\");\r\n\t\t}\r\n\t\tfclose ($Handle);\r\n\t}", "private static function loadClassMap()\r\n\t{\r\n\t\tif (!file_exists(self::$_classMapFileLocation) || self::$_noCache == true)\r\n\t\t{\r\n\t\t\t// cached map doesn't exists, rebuild the cache map\r\n\t\t\tforeach(self::$_classPath as $dir)\r\n\t\t\t{\r\n\t\t\t\tif (strpos($dir, DIRECTORY_SEPARATOR.\"*\") == strlen($dir) - 2)\r\n\t\t\t\t{\r\n\t\t\t\t\t$dir = substr($dir, 0, strlen($dir) - 2);\r\n\t\t\t\t\t$recursive = true;\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\t$recursive = false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\tself::scanDirectory($dir, $recursive);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (self::$_noCache === false)\r\n\t\t\t{\r\n\t\t\t\t// save the cached map\r\n\t\t\t\tfile_put_contents(self::$_classMapFileLocation, serialize(self::$_classMap));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (count(self::$_classMap) == 0) \r\n\t\t{\r\n\t\t\t// if cached map was not loaded but exists on the disk, load it\r\n\t\t\tself::$_classMap = unserialize(file_get_contents(self::$_classMapFileLocation));\r\n\t\t}\r\n\t}", "public function getStorageMap();", "public function getStats()\n {\n $directory = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->path),\n \\RecursiveIteratorIterator::SELF_FIRST\n );\n\n $cacheIterator = new \\RegexIterator($directory, '/^.+\\.cache/i', \\RecursiveRegexIterator::GET_MATCH);\n\n $stats[ 'path' ] = $this->path;\n $stats[ 'files' ] = 0;\n $stats[ 'size' ] = 0;\n\n foreach ($cacheIterator as $cacheFiles) {\n foreach ($cacheFiles as $cacheFile) {\n $stats[ 'files' ]++;\n $stats[ 'size' ] += filesize($cacheFile);\n }\n }\n\n return $stats;\n }", "private function get_map_data() {\n\t\t\n\t\t//Init vars\n\t\tglobal $prso_google_maps_main;\n\t\t$map_data = array();\n\t\t\n\t\t//Setup dummy test data\n\t\t$map_data = array(\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'40.756',\n\t\t\t\t'lng'\t\t=>\t'-73.986',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_1'\n\t\t\t\t\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'37.775',\n\t\t\t\t'lng'\t\t=>\t'-122.419',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_2'\n\t\t\t\t\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'47.620',\n\t\t\t\t'lng'\t\t=>\t'-122.347',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_3'\n\t\t\t\t\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'-22.933',\n\t\t\t\t'lng'\t\t=>\t'-43.184',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_4'\n\t\t\t\t\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t\n\t\t//Cache data in global var\n\t\t$this->map_data_cache = $map_data;\n\t\t\n\t\t//Cache data array for use within main viwe template\n\t\t$prso_google_maps_main = $map_data;\n\t\t\n\t}", "public function cache_info($type = NULL)\n\t{\n\t\treturn get_dir_file_info($this->_cache_path);\n\t}", "function read_stats() {\n include(\"stats.php\");\n return array($r, $f);\n }", "public function getMaps()\n {\n return $this->maps;\n }", "public function analyzeFile()\n\t{\n\t\t$file = $this->getNextFile();\n\t\tif ($file['status'] !== 'run')\n\t\t{\n\t\t\treturn array('status' => $file['status'], 'time' => 0, 'files' => 0);\n\t\t}\n\n\t\tif (Config::$development !== true)\n\t\t{\n\t\t\t$this->db->bind('ID', $file['id']);\n\t\t\t$this->db->update('UPDATE BOTSECTOR_LOGS SET BLG_STATUS = \\'PARSING\\', BLG_STARTED = NOW() WHERE BLG_ID = :ID');\n\t\t}\n\t\t/* Remove old stats */\n\t\t$this->db->bind('ID', $file['id']);\n\t\t$this->db->delete('DELETE FROM BOTSECTOR_STATISTICS WHERE BLG_ID = :ID');\n\n\t\t$startTime = time();\n\n\t\t$months = array('Jan' => 1, 'Feb' => 2, 'Mar' => 3, 'Apr' => 4, 'May' => 5, 'Jun' => 6, 'Jul' => 7, 'Aug' => 8, 'Sep' => 9, 'Oct' => 10, 'Nov' => 11, 'Dec' => 12);\n\n\t\t$statistics = array();\n\t\tif (substr($file['path'], -3) === '.gz')\n\t\t{\n\t\t\t$f = gzopen($file['path'], 'r');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$f = fopen($file['path'], 'r');\n\t\t}\n\t\t$totalLines = 0;\n\t\tif (Config::$development === true)\n\t\t{\n\t\t\t$microtime = -1 * microtime(true);\n\t\t}\n\t\t$error = false;\n\t\t$defaultStat = array();\n\t\tforeach ($this->types as $type)\n\t\t{\n\t\t\t$defaultStat[$type[0]] = array(0, 0);\n\t\t}\n\t\twhile (!feof($f))\n\t\t{\n\t\t\t$buffer = stream_get_line($f, 8192000); // 4096 * 2000\n\t\t\t$buffer .= stream_get_line($f, 4096, \"\\n\"); // Stop at the end of a line\n\t\t\tif (substr($buffer, -1) !== \"\\n\")\n\t\t\t{\n\t\t\t\t$buffer .= \"\\n\";\n\t\t\t}\n\t\t\t$lines = substr_count($buffer, \"\\n\");\n\t\t\t$totalLines += $lines;\n\t\t\t$max = preg_match_all('~^[0-9.:]+ - .*? \\[(\\d+)/([A-Za-z]+)/(\\d+):.+?\\] \"(?:HEAD|GET|POST) https?://([a-zA-Z0-9\\.\\-_]+?)(?::\\d+)?(/.*?) HTTP/1\\..\" (-|\\d+) (-|\\d+) \".*?\" \"(.*?)\"$~m', $buffer, $matches);\n\t\t\t/* if ($lines > 10 && $lines * 0.95 >= $max)\n\t\t\t {\n\t\t\t echo \"<pre>Not parsed lines:\\n\";\n\t\t\t for ($i = 0; $i < $max; $i++)\n\t\t\t {\n\t\t\t $buffer = str_replace($matches[0][$i].\"\\n\", '', $buffer);\n\t\t\t }\n\t\t\t print_r($buffer);\n\t\t\t throw new Exception('Wrong count: lines ('.$lines.') vs matches ('.$max.')');\n\t\t\t } */\n\t\t\t$allDates = array();\n\t\t\t$knownDates = array();\n\t\t\tfor ($i = 0; $i < $max; $i++)\n\t\t\t{\n\t\t\t\t$status = (int) $matches[6][$i];\n\t\t\t\t/* Ignore HTTP statuses below 200 (mostly «100 Continue») */\n\t\t\t\tif ($status < 200)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$path = $matches[5][$i];\n\t\t\t\tif ($path === '')\n\t\t\t\t{\n\t\t\t\t\t$path = '/';\n\t\t\t\t}\n\t\t\t\t/* Remove Query-string */\n\t\t\t\tif (($pos = strpos($path, '?')) !== false)\n\t\t\t\t{\n\t\t\t\t\t$path = substr($path, 0, $pos);\n\t\t\t\t}\n\t\t\t\t/* If it's an error, group by specific directories, so that it doesn't fill the database */\n\t\t\t\tif ($status >= 300 && $status !== 304)\n\t\t\t\t{\n\t\t\t\t\tif ($status < 400)\n\t\t\t\t\t{\n\t\t\t\t\t\t$prepend = '/botsector-redirects';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($status < 500)\n\t\t\t\t\t{\n\t\t\t\t\t\t$prepend = '/botsector-client-errors';\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$prepend = '/botsector-server-errors';\n\t\t\t\t\t}\n\t\t\t\t\t$path = $prepend.substr($path, strrpos($path, '/'));\n\t\t\t\t}\n\n\t\t\t\t$date = &$knownDates[$matches[3][$i]][$matches[2][$i]][$matches[1][$i]];\n\t\t\t\tif (!isset($date))\n\t\t\t\t{\n\t\t\t\t\t$date = sprintf('%04d-%02d-%02d', $matches[3][$i], $months[$matches[2][$i]], $matches[1][$i]);\n\t\t\t\t}\n\t\t\t\t$allDates[$date] = $date;\n\t\t\t\tif (($crawler = $this->getCrawler($matches[8][$i], $matches[0][$i])) === false)\n\t\t\t\t{\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t\tif (($domain = $this->getDomain($matches[4][$i], false)) === false)\n\t\t\t\t{\n\t\t\t\t\t/* Call with 200 status AND (standard browser OR bot reads robots.txt) => domain allowed */\n\t\t\t\t\tif (($status < 300 && ($crawler === self::browsers || $crawler !== self::browsers && $matches[5][$i] === '/robots.txt')) === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$domain = $this->getDomain($matches[4][$i], true);\n\t\t\t\t}\n\t\t\t\t$category = $this->getCategoryAndType($domain, $path);\n\t\t\t\t$stat = &$statistics[$date][$domain][$category['directory']][$crawler];\n\t\t\t\tif (!isset($stat))\n\t\t\t\t{\n\t\t\t\t\t$stat = $defaultStat;\n\t\t\t\t}\n\t\t\t\t$stat[$category['type']][0] ++;\n\t\t\t\t$stat[$category['type']][1] += (int) $matches[7][$i];\n\n\t\t\t\tunset($stat);\n\t\t\t\tunset($date);\n\t\t\t}\n\t\t}\n\t\tfclose($f);\n\t\tunset($knownDates);\n\n\t\tif (Config::$development === true)\n\t\t{\n\t\t\t$microtime += microtime(true);\n\t\t\techo '<br/>Lines: <strong>'.$totalLines.' - '.ceil($totalLines / $microtime).'/s</strong>';\n\t\t\tif ($error === true)\n\t\t\t{\n\t\t\t\tthrow new Exception('Found errors, no insertion');\n\t\t\t}\n\t\t}\n\n\t\t$inserts = 0;\n\t\tif (Config::$development === true)\n\t\t{\n\t\t\t$microtime = -1 * microtime(true);\n\t\t}\n\t\t/* Start a transaction (this should speed things up) */\n\t\t$this->db->begin();\n\t\tforeach ($statistics as $date => $dates)\n\t\t{\n\t\t\tforeach ($dates as $domain => $domains)\n\t\t\t{\n\t\t\t\tforeach ($domains as $directory => $directories)\n\t\t\t\t{\n\t\t\t\t\twhile (isset($this->removedDirectories[$directory]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$directory = $this->removedDirectories[$directory];\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($directories as $userAgent => $statistic)\n\t\t\t\t\t{\n\t\t\t\t\t\t$inserts++;\n\t\t\t\t\t\t$this->insertStatistic($date, $file['id'], $domain, $directory, $userAgent, $statistic);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Force last entries to be injected in database */\n\t\t$this->insertStatistic(0, 0, 0, 0, 0, 0);\n\t\t$this->db->commit();\n\n\t\t$this->removedDirectories = array();\n\t\tif (Config::$development === true)\n\t\t{\n\t\t\t$microtime += microtime(true);\n\t\t\techo '<br/>Inserts: <strong>'.$inserts.' - '.ceil($inserts / $microtime).'/s</strong>';\n\t\t}\n\t\t$this->db->bind('ID', $file['id']);\n\t\tif (count($allDates) === 0)\n\t\t{\n\t\t\t$this->db->bind('MIN', '0000-00-00');\n\t\t\t$this->db->bind('MAX', '0000-00-00');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->bind('MIN', min($allDates));\n\t\t\t$this->db->bind('MAX', max($allDates));\n\t\t}\n\t\t$this->db->update('UPDATE BOTSECTOR_LOGS SET BLG_MIN_DATE = :MIN, BLG_MAX_DATE = :MAX, BLG_STATUS = \\'PARSED\\', BLG_FINISHED = NOW() WHERE BLG_ID = :ID');\n\t\treturn array('status' => 'reload', 'time' => time() - $startTime, 'files' => $this->getFilesLeft());\n\t}", "public static function getMap() {\n self::loadMap();\n return self::$map;\n }", "public static function getInfo($file)\n {\n clearstatcache();\n if (!file_exists($file)) {\n return false;\n }\n $data = array(\n 'name' \t\t\t=> substr(strrchr($file, DIRECTORY_SEPARATOR), 1),\n 'path' \t\t\t=> $file,\n 'size' \t\t\t=> filesize($file),\n 'date' \t\t\t=> filemtime($file),\n 'readable' \t\t=> is_readable($file),\n 'writable' \t\t=> is_writable($file),\n 'executable' \t=> is_executable($file),\n 'fileperms' \t=> fileperms($file)\n ); \n return $data;\n }", "function getFileTimeStamps($ref) {\n\t\t// 8\tatime\ttime of last access (Unix timestamp)\n\t\t// 9\tmtime\ttime of last modification (Unix timestamp)\n\t\t$file_stat = stat(self::getFilePath($ref));\n\t\treturn(array('updated_at'=> $file_stat['mtime'], 'accessed_at'=> $file_stat['atime']));\n\t\t\n\t}", "public function getTimestamp($path)\n {\n $meta = $this->getMetadata($path);\n $timestamp = strtotime($meta['Last-Modified']);\n return array('timestamp' => $timestamp);\n }", "public function getRawPathInfo();", "public static function autoloadClassMapFile()\n\t{\n\t\treturn self::getValue( 'autoload_classmap' );\n\t}", "public function getMetadata($path)\n {\n return $this->stat($path);\n }", "static function getClassMapFilePath()\r\n\t{\r\n\t\treturn self::$_classMapFileLocation;\r\n\t}", "abstract protected function getMap(): array;", "function getImageMap($MapName,$Flush=TRUE)\r\n\t{\r\n\t\t/* Strip HTML query strings */\r\n\t\t$Values = $this->tmpFolder.$MapName;\r\n\t\t$Value = split(\"\\?\",$Values);\r\n\t\t$FileName = $Value[0];\r\n\r\n\t\tif ( file_exists($FileName) )\r\n\t\t{\r\n\t\t\t$Handle = fopen($FileName, 'r');\r\n\t\t\t$MapContent = fread($Handle, filesize($FileName));\r\n\t\t\tfclose($Handle);\r\n\t\t\techo $MapContent;\r\n\r\n\t\t\tif ( $Flush )\r\n\t\t\tunlink($FileName);\r\n\r\n\t\t\texit();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "protected function _stat($path)\n {\n if ($raw = $this->_od_getFileRaw($path)) {\n $stat = $this->_od_parseRaw($raw);\n if ($path === $this->root) {\n $stat['expires'] = $this->expires;\n }\n return $stat;\n }\n\n return false;\n }" ]
[ "0.59394336", "0.5666657", "0.56402206", "0.5627062", "0.55979437", "0.559355", "0.54870945", "0.536347", "0.527526", "0.52450585", "0.52433664", "0.52179885", "0.5201229", "0.5153977", "0.5146728", "0.51340675", "0.51264286", "0.5122026", "0.5108531", "0.510441", "0.5062836", "0.5059571", "0.5050791", "0.50451475", "0.5038092", "0.50359005", "0.50186706", "0.5000493", "0.5000463", "0.4996035" ]
0.7083335
0
Returns a new Phiws\Client instance connected to $server (row from servers table).
function connectTo(stdClass $server) { $addr = new Phiws\ServerAddress($server->host, $server->port); $addr->secure($server->secure); $addr->path(keyValue('path')); $client = new Phiws\Client; // Subject to minLevel(). CLI and $client->logger()->echoMode(true); $client->connect($addr); return $client; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getClient() {\n\n static $client = FALSE;\n\n if ($client instanceof Client) {\n return $client;\n }\n\n $client = Client::factory([\n 'url' => $this->getServer()->getUrl(),\n 'client_id' => 'example_id',\n 'client_secret' => 'example_secret',\n 'munchkin_id' => 'example_munchkin_id',\n ]);\n\n return $client;\n }", "public function setServer($server)\n {\n $this->server = $server;\n \n return $this;\n }", "public function getClientInstance()\n\t{\n\t\treturn Client::instance($this->db);\n\t}", "public static function setUpClient()\n {\n static::$client = static::createClient($options = [], $server = []);\n\n return static::$client;\n }", "protected function _getInstanceOfClient()\n\t{\n\t\treturn minimee()->makeClient();\n\t}", "public function setServer($server) {\n\t\t$this->server = $server;\n\t\treturn $this;\n\t}", "public function setServer($server)\n {\n $this->operation->setServer($server);\n\n return $this;\n }", "public function createClient(){\n\t\t$client = new Client(array(\n\t\t\t'servers' => array(\n\t\t\t\tarray('host' => HOST_ES_001, 'port' => PORT_ES_001),\n\t\t\t\tarray('host' => HOST_ES_002, 'port' => PORT_ES_002)\n\t\t\t)\n\t\t));\n\t\treturn $client;\n\t}", "public static function getServer($serverID){\n $query = sprintf(self::selectServerQuery, $serverID);\n $result = DBContext::getConnection()->query($query);\n if($result->num_rows == 0){\n ErrorOutAndExit('500', 'Server not found');\n } else {\n return new Server($result->fetch_assoc(), false);\n }\n }", "public static function createFromServer(array $server)\n {\n $scheme = static::fetchServerScheme($server);\n $host = static::fetchServerHost($server);\n $port = static::fetchServerPort($server);\n $request = static::fetchServerRequestUri($server);\n\n return static::createFromUrl($scheme.$host.$port.$request);\n }", "function getConnection( $server ) {\n\t\t// Servers are marked dead for a limited period of time, to\n\t\t// avoid excessive overhead from repeated connection timeouts.\n\t\tif ( isset( $this->downServers[$server] ) ) {\n\t\t\t$now = time();\n\t\t\tif ( $now > $this->downServers[$server] ) {\n\t\t\t\t// Dead time expired\n\t\t\t\tunset( $this->downServers[$server] );\n\t\t\t} else {\n\t\t\t\t// Server is dead\n\t\t\t\twfDebug( \"server $server is marked down for another \" .\n\t\t\t\t\t( $this->downServers[$server] - $now ) . \" seconds, can't get connection\\n\" );\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if a connection is already free for use\n\t\tif ( isset( $this->connections[$server] ) ) {\n\t\t\tforeach ( $this->connections[$server] as &$connection ) {\n\t\t\t\tif ( $connection['free'] ) {\n\t\t\t\t\t$connection['free'] = false;\n\t\t\t\t\t--$this->idlePoolSize;\n\n\t\t\t\t\treturn new RedisConnRef( $this, $server, $connection['conn'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( substr( $server, 0, 1 ) === '/' ) {\n\t\t\t// UNIX domain socket\n\t\t\t// These are required by the redis extension to start with a slash, but\n\t\t\t// we still need to set the port to a special value to make it work.\n\t\t\t$host = $server;\n\t\t\t$port = 0;\n\t\t} else {\n\t\t\t// TCP connection\n\t\t\t$hostPort = IP::splitHostAndPort( $server );\n\t\t\tif ( !$hostPort ) {\n\t\t\t\tthrow new MWException( __CLASS__ . \": invalid configured server \\\"$server\\\"\" );\n\t\t\t}\n\t\t\tlist( $host, $port ) = $hostPort;\n\t\t\tif ( $port === false ) {\n\t\t\t\t$port = 6379;\n\t\t\t}\n\t\t}\n\n\t\t$conn = new Redis();\n\t\ttry {\n\t\t\tif ( $this->persistent ) {\n\t\t\t\t$result = $conn->pconnect( $host, $port, $this->connectTimeout );\n\t\t\t} else {\n\t\t\t\t$result = $conn->connect( $host, $port, $this->connectTimeout );\n\t\t\t}\n\t\t\tif ( !$result ) {\n\t\t\t\twfDebugLog( 'redis', \"Could not connect to server $server\" );\n\t\t\t\t// Mark server down for some time to avoid further timeouts\n\t\t\t\t$this->downServers[$server] = time() + self::SERVER_DOWN_TTL;\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( $this->password !== null ) {\n\t\t\t\tif ( !$conn->auth( $this->password ) ) {\n\t\t\t\t\twfDebugLog( 'redis', \"Authentication error connecting to $server\" );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( RedisException $e ) {\n\t\t\t$this->downServers[$server] = time() + self::SERVER_DOWN_TTL;\n\t\t\twfDebugLog( 'redis', \"Redis exception connecting to $server: \" . $e->getMessage() );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $conn ) {\n\t\t\t$conn->setOption( Redis::OPT_READ_TIMEOUT, $this->readTimeout );\n\t\t\t$conn->setOption( Redis::OPT_SERIALIZER, $this->serializer );\n\t\t\t$this->connections[$server][] = array( 'conn' => $conn, 'free' => false );\n\n\t\t\treturn new RedisConnRef( $this, $server, $conn );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getServer()\n {\n $server = new \\League\\OAuth2\\Server\\Server($this->clientRepository, $this->tokenRepository,\n $this->scopeRepository, $this->keys['private'], $this->keys['public']);\n\n $time = ENV == 'development' ? new \\DateInterval('PT12H') : new \\DateInterval('PT1H');\n\n // Enable the password grant on the server with an access token TTL of 1 hour\n $server->enableGrantType(new \\League\\OAuth2\\Server\\Grant\\PasswordGrant($this->userRepository,\n $this->refreshRepository), $time);\n\n // Enable the client credentials grant on the server with a token TTL of 1 hour\n $server->enableGrantType(new \\League\\OAuth2\\Server\\Grant\\ClientCredentialsGrant(), $time);\n\n // Enable the refresh token grant on the server with a token TTL of 1 hour\n $server->enableGrantType(new \\League\\OAuth2\\Server\\Grant\\RefreshTokenGrant($this->refreshRepository), $time);\n\n return $server;\n }", "public function getClient(array $parameters = array())\n {\n $client = static::createClient();\n $client->setServerParameters($parameters);\n\n return $client;\n }", "protected function getServer() {\n\t\t$dsn\t\t= 'mysql:dbname=minexbank;host=localhost';\n\t\t$username = 'root';\n\t\t// $password = $_SERVER['HTTP_HOST'] == 'l.minexbank.com' ? 'mysql' : 'BPeWQfvEX1';\n\t\t$password = 'mysql';\n\t\t$storage = new Pdo(array('dsn' => $dsn, 'username' => $username, 'password' => $password));\n\n\t\t// Pass a storage object or array of storage objects to the OAuth2 server class\n\t\t$server = new Server($storage);\n\n\t\t// Add the \"Client Credentials\" grant type (it is the simplest of the grant types)\n\t\t$server->addGrantType(new ClientCredentials($storage));\n\n\t\t// Add the \"Authorization Code\" grant type (this is where the oauth magic happens)\n\t\t$server->addGrantType(new AuthorizationCode($storage));\n\t\t\n\t\t// add the grant type to your OAuth server\n\t\t$server->addGrantType(new RefreshToken($storage));\n\n\t\treturn $server;\n\t}", "public static function get($version)\n {\n if (!isset(self::$profiles[$version])) {\n throw new ClientException(\"Unknown server profile: '$version'.\");\n }\n\n $profile = self::$profiles[$version];\n\n return new $profile();\n }", "public function connectClient($clientID, $serverID);", "public function getServer() {\n return Server::getInstance();\n }", "private function getClient() : Client\n {\n if (! ($this->client instanceof Client)) {\n $this->client = new Client([\n 'redirect'=>10,\n 'ssl_verify_peer' => false,\n 'ssl_verify_peer_name' => false,\n 'ssl_verify_host' => false\n ]);\n } \n \n return $this->client;\n }", "protected function createClient()\n {\n $client = new Client($this['connection']);\n\n $this->applyInstance('client', $client);\n }", "public static function get() {\n\t\tif (self::$client == null)\n\t\t\tself::$client = new Client();\n\t\treturn self::$client;\n\t}", "public function client(): Client\n {\n return $this->client;\n }", "public function createClient() : ClientInterface;", "private function getClient()\n {\n if (!$this->client) {\n $this->client = new Client(['base_uri' => self::BASE_URI]);\n }\n\n return $this->client;\n }", "public function getClient()\n {\n if (!$this->_client instanceof GearmanClient) {\n $this->_client = new GearmanClient();\n $this->_client->addServer($this->host, $this->port);\n // additional servers\n if (!empty($this->servers)) {\n $this->_client->addServers(implode(',', $this->servers));\n }\n }\n\n return $this->_client;\n }", "public function connect($serverId) {\n\n $Soapclient = $this->getSoapclient();\n\n // Get parameters saved in the database\n $endpointlocation = CustomAttributes::getAttributeValue($serverId, \"endpointlocation\");\n $endpointuri = CustomAttributes::getAttributeValue($serverId, \"endpointuri\");\n $username = CustomAttributes::getAttributeValue($serverId, \"username\");\n $password = CustomAttributes::getAttributeValue($serverId, \"password\");\n\n if (! empty ( $endpointlocation ) && ! empty ( $endpointuri ) && ! empty ( $username ) && ! empty ( $password )) {\n try {\n\n\n $client = new SoapClient(null, array('location' => $endpointlocation, 'uri' => $endpointuri));\n\n $this->setSession ( $client->login ( $username, $password ) );\n\n $this->setSoapclient($client);\n\n return $client;\n }catch(Exception $e){\n die($e->getMessage());\n }\n }\n\n return false;\n }", "public static function client()\n {\n $client = new Client(['verify' => false]);\n return $client;\n }", "public function & get_server()\n {\n $server = new flxajax_server($this->func_list);\n return $server;\n }", "protected function getClient()\n {\n return new Client;\n }", "public function makeClient()\n {\n $client = new Client($this->getHost(), $this->getPort());\n $client->getTransport()->setAuth($this->getUsername(), $this->getPassword());\n return $client;\n }", "public function useLegacyConnection(): Client\n {\n return $this->legacyConnection;\n }" ]
[ "0.62360233", "0.607785", "0.60437363", "0.6003641", "0.5984519", "0.5977745", "0.5945224", "0.5931078", "0.59268576", "0.5910163", "0.578895", "0.56169087", "0.5541665", "0.553971", "0.55308497", "0.55236393", "0.5516381", "0.55041826", "0.5486524", "0.54666567", "0.546295", "0.5451098", "0.5408002", "0.5396064", "0.5386716", "0.53782904", "0.5377706", "0.5377046", "0.537539", "0.53478664" ]
0.7097534
0
Under Windows, attempt to write over 64 KiB of data at once in nonblocking mode to a nonlocalhost peer causes this PHP Notice ($buf length = 65536 + 1347):
protected function write($buf) { // // "fwrite(): send of 1347 bytes failed with errno=10035 A non-blocking socket operation could not be completed immediately." // // 10035 is WSAEWOULDBLOCK: // "It is a nonfatal error, and the operation should be retried later." // https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2#WSAEWOULDBLOCK // // See also https://bugs.php.net/bug.php?id=39068 if (!strncasecmp(PHP_OS, 'win', 3)) { $oldEH = set_error_handler(function ($errno, $errstr) use (&$oldEH) { if ($errno !== E_NOTICE or strpos($errstr, 'errno=10035') === false) { call_user_func_array($oldEH, func_get_args()); } }); try { return fwrite($this->handle, $buf); } finally { set_error_handler($oldEH); } } else { return fwrite($this->handle, $buf); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stream_set_write_buffer ($stream, $buffer) {}", "protected static function getDummyBufferLength()\n {\n return 4096;\n }", "function stream_set_read_buffer($stream, $buffer)\n{\n}", "function stream_set_read_buffer ($stream, $buffer) {}", "abstract protected function getExpectedBufferLength(): int;", "public function onBufferFull($server, $fd) {\n\n }", "protected function _fwriteStream(&$fp, $buffer) {\n\t\t$total_length = $buffer->getLength();\n\t\t$fwrite = 0;\n\t\t$retries = 0;\n\t\t$chunk_size = 1024 * 256; // 256kB\n\t\t$chunk = null;\n\t\tfor($bytes_written = 0; $bytes_written < $total_length; $bytes_written += $fwrite){\n\t\t\t$length = min($chunk_size,$total_length - $bytes_written);\n\t\t\tif(is_null($chunk)){\n\t\t\t\t$chunk = $buffer->substr($bytes_written,$length);\n\t\t\t}\n\n\t\t\t// $fwrite = @fwrite($fp, $chunk, $length);\n\t\t\t$max_retries = 5;\n\t\t\twhile($max_retries>0){\n\t\t\t\t$fwrite = @fwrite($fp, $chunk, $length);\n\t\t\t\tif($fwrite !== false){ break; }\n\t\t\t\t$max_retries--;\n\t\t\t\tusleep(10000); // 0.01s\n\t\t\t}\n\n\t\t\tif($fwrite === false){\n\t\t\t\treturn $bytes_written;\n\t\t\t}\n\n\t\t\tif(!$fwrite){ // 0 bytes bytes_written; error code 11: Resource temporarily unavailable\n\t\t\t\tif($retries>=100){ return $bytes_written; }\n\t\t\t\tusleep(10000 + $retries * 1000); // 0.01s + 0s .. 0.01s + 0.1s\n\t\t\t\t$retries++;\n\t\t\t\tcontinue;\n\t\t\t}else{\n\t\t\t\t$retries = 0; // something was bytes_written? -> reset $retries\n\t\t\t\t$chunk = null;\n\t\t\t}\n\t\t}\n\t\treturn $bytes_written;\n\t}", "public function stream_write($data) {\n $this->write = TRUE; //write when flushed\n $this->stream_data .= $data;\n\n $byteswritten = strlen($data);\n\n $this->stream_pointer += $byteswritten;\n\n return $byteswritten;\n }", "public function bufferFull(\\swoole_server $server, $fd)\n {\n }", "function socket_set_blocking ($socket, $mode) {}", "function set_socket_blocking ($socket, $mode) {}", "protected function writeInternal($data) {\n return socket_write($this->socket, $data, strlen($data));\n }", "public function getWriteBufferCount();", "protected function write($buffer)\n {\n $socket = $this->getResource();\n\n while (($length = strlen($buffer)) > 0) {\n $written = @fwrite($socket, $buffer);\n\n if ($length === $written) {\n return;\n }\n\n if ($written === false || $written === 0) {\n $this->onConnectionError('Error while writing bytes to the server.');\n }\n\n $buffer = substr($buffer, $written);\n }\n }", "function stream_set_blocking ($stream, $mode) {}", "function stream_set_chunk_size ($fp, $chunk_size) {}", "public function stream_flush()\n {\n try {\n $this->writeRemote();\n } catch (\\OpenStack\\Common\\Exception $e) {\n syslog(LOG_WARNING, $e);\n trigger_error('Error while flushing: ' . $e->getMessage(), E_USER_NOTICE);\n\n return false;\n }\n }", "private function curlWrite($ch, $data) {\r\n $l = strlen($data);\r\n if (strpos($data, $this->config['streaming_eol']) === false) {\r\n $this->buffer .= $data;\r\n return $l;\r\n }\r\n\r\n $buffered = explode($this->config['streaming_eol'], $data);\r\n $content = $this->buffer . $buffered[0];\r\n\r\n $this->metrics['tweets']++;\r\n $this->metrics['bytes'] += strlen($content);\r\n\r\n if ( ! function_exists($this->config['streaming_callback']))\r\n return 0;\r\n\r\n $metrics = $this->update_metrics();\r\n $stop = call_user_func(\r\n $this->config['streaming_callback'],\r\n $content,\r\n strlen($content),\r\n $metrics\r\n );\r\n $this->buffer = $buffered[1];\r\n if ($stop)\r\n return 0;\r\n\r\n return $l;\r\n }", "public\n function write($buf) {\n $this->buffer .= $buf;\n }", "public function writeBuffer($buffer);", "function ngx_nonblocking($s)\n{\n return socket_set_nonblock($s);\n}", "public function setNonBlocking()\r\n {\r\n stream_set_blocking($this->socket, 0);\r\n }", "public function getBufferLength();", "function tcp_send3($wait){\n$_SESSION['tcp3extra'] += 9; //8 seconds of sleep inside the function so maybe 9 total so one extra, haven't tested timing.\n\n//$delayfactor = 5;\n$delayfactor = $_SESSION['delayfactor'];\n\nif($_SESSION['starttcp'] != 1)\n{\n$_SESSION['socket'] = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n$mysocket = $_SESSION['socket'];\nsocket_connect($mysocket, \"caliper.cs.yale.edu\", 6667);\n$_SESSION['starttcp'] = 1;\n}\n\n$strwork = \"\\n\\n\\na\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\na\\n\\n\\n\\n\\n\\n\\n\\n\";\n\n$_SESSION['starttcp'] = 0;\nsocket_write($mysocket, $strwork, 28);\n\nsocket_close($mysocket);\n }", "public function getWriteBufferSize() {\n if (!$this->stdin) {\n return 0;\n }\n return $this->stdin->getByteLength();\n }", "public function writeBuffer()\n\t{\n\t\tStorage::disk(config('filesystems.default_disk'))->append($this->filename, $this->flush());\n\t}", "function send($data) {\n $data = (string) $data;\n strlen($data) and $this->buffer[] = $data;\n }", "function stream_socket_shutdown ($stream, $how) {}", "public function write(string $buffer): IStreamClient;", "public function HandleWrite() {\n\n if (!isset($this->OutputFifo[0]))\n throw new SocketException('XXX');\n\n try {\n\n while (sizeof($this->OutputFifo) > 0) {\n $cbuffer = substr($this->OutputFifo[0], $this->OutputOffset);\n $cbytes = $this->Socket->Send($cbuffer, strlen($cbuffer));\n $this->OutputBytesWritten += $cbytes;\n $this->OutputOffset += $cbytes;\n if ($this->OutputOffset == strlen($this->OutputFifo[0])) {\n array_shift($this->OutputFifo);\n $this->OutputOffset = 0;\n if (sizeof($this->OutputFifo) == 0) {\n $this->Writeable = false;\n if ($this->LingeringClose === true)\n $this->HandleClose();\n }\n } else {\n if ($this->LingeringClose === true)\n $this->HandleClose();\n }\n }\n } catch (SocketException $se) {\n// print \"Exception Caught in ClientHandler performing HandleWrite\\n\";\n return false;\n }\n\n return true;\n }" ]
[ "0.6309841", "0.5782979", "0.5643606", "0.56068724", "0.56010693", "0.5530264", "0.53350127", "0.5328116", "0.5289538", "0.52848953", "0.52394485", "0.517739", "0.5125049", "0.5101248", "0.5091633", "0.50544745", "0.50350267", "0.502436", "0.5014137", "0.4983709", "0.49822667", "0.49819595", "0.4941877", "0.4926951", "0.4906605", "0.48794317", "0.48772815", "0.48634717", "0.48482808", "0.4837055" ]
0.66904926
0
Create a contact request.
function createContactRequest(string $name, string $email, string $subject, string $message) { return insert('contact_requests', [ 'ContactRequestName' => $name, 'ContactRequestEmail' => $email, 'ContactRequestSubject' => $subject, 'ContactRequestMessage' => $message ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createContact()\n\t{\n\t\t$contactRequest = new ContactRequest();\n\t\t$contactRequest->setFirstName($this->post_data['first-name']);\n\t\t$contactRequest->setLastName($this->post_data['last-name']);\n\t\t$contactRequest->setEmail($this->post_data['email']);\n\t\t$contactRequest->setSubject($this->post_data['subject']);\n\t\t$contactRequest->setMessage($this->post_data['message']);\n\t\t$contactRequest->save();\n\t\treturn $contactRequest;\n\t}", "public function createContactsRequest($options)\n {\n // unbox the parameters from the associative array\n $customer_id = array_key_exists('customer_id', $options) ? $options['customer_id'] : null;\n $user_id = array_key_exists('user_id', $options) ? $options['user_id'] : null;\n $contact_type = array_key_exists('contact_type', $options) ? $options['contact_type'] : null;\n $name = array_key_exists('name', $options) ? $options['name'] : null;\n $email = array_key_exists('email', $options) ? $options['email'] : null;\n $phone = array_key_exists('phone', $options) ? $options['phone'] : null;\n $customer_id = array_key_exists('customer_id', $options) ? $options['customer_id'] : null;\n\n // verify the required parameter 'customer_id' is set\n if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_id when calling createContacts'\n );\n }\n\n $resourcePath = '/customer/{customer_id}/contacts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n '{' . 'customer_id' . '}',\n ObjectSerializer::toPathValue($customer_id),\n $resourcePath\n );\n }\n\n // form params\n if ($user_id !== null) {\n $formParams['user_id'] = ObjectSerializer::toFormValue($user_id);\n }\n // form params\n if ($contact_type !== null) {\n $formParams['contact_type'] = ObjectSerializer::toFormValue($contact_type);\n }\n // form params\n if ($name !== null) {\n $formParams['name'] = ObjectSerializer::toFormValue($name);\n }\n // form params\n if ($email !== null) {\n $formParams['email'] = ObjectSerializer::toFormValue($email);\n }\n // form params\n if ($phone !== null) {\n $formParams['phone'] = ObjectSerializer::toFormValue($phone);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['customer_id'] = ObjectSerializer::toFormValue($customer_id);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function __construct(ContactRequest $req) {\n\n }", "public function createContactRequest($contactFields)\n {\n // verify the required parameter 'contactFields' is set\n if ($contactFields === null || (is_array($contactFields) && count($contactFields) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $contactFields when calling createContact'\n );\n }\n\n $resourcePath = '/phonebook/contacts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($contactFields)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($contactFields));\n } else {\n $httpBody = $contactFields;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create(Request $request)\n {\n \n // Validate\n $this->validate($request, [\n 'name' => 'required',\n 'phone' => 'required|min:10|numeric',\n 'notes' => 'max:255'\n ]);\n $data=array_merge($request->all(),array(\"user_id\"=>\\Auth::user()->id));\n Contact::create($data); // Save\n return redirect(\"contacts\")->with('flash_message', 'Contact has been created successfully.');\n }", "public function postContact(Request $request) { // AUTHENTICATION REQUIRED\n\t\tif (is_null($this->user)) {\n\t\t\treturn $this->makeUnauthorized();\n\t\t}\n\n\t\t$input = array(); $rules = array();\n\t\t$input['contact'] = $request->input('contact');\n\t\t$rules['contact'] = 'required|ephone';\n\n\t\t$validator = Validator::make($input, $rules);\n\t\tif ($validator->fails()) {\n\t\t\t$messages = $validator->messages()->all();\n\t\t\treturn $this->makeError($messages[0]);\n\t\t}\n\n\t\t$contact = ContactModel::firstOrCreate([\n\t\t\t'contact' => $input['contact']\n\t\t]);\n\n\t\tif ($contact->confirmed) {\n\t\t\treturn $this->makeError(\"Contact already registered to an account\");\n\t\t}\n\n\t\t$contact->recordUserAttempt($this->user->_id);\n\n\t\treturn $this->makeSuccess(\"Contact registered for user with pending verification\", $this->user);\n\t}", "public function create(Request $request)\n {\n $model = new Contact;\n $model->name = $request->input('name');\n $model->cell_1 = $request->input('cell_1');\n $model->cell_2 = $request->input('cell_2');\n $model->email = $request->input('email');\n\n $model->save();\n\n return json_encode($model);\n }", "public function createContact($contactDetails){\n \n }", "public function create_contact( $data ) {\n\t\treturn $this->post( $this->get_url( 'contacts' ), $data );\n\t}", "public function createContact($data)\n\t{\n\t\t$accessToken = Redis::get('hubspot:accesstoken');\n\t\t$client = new Client();\n\t $response = $client->request('POST', $this->hubspotUrl.'/contacts/v1/contact', [\n\t \t'headers' => [\n\t \t'Authorization' => 'Bearer '.$accessToken,\n\t \t'Content-Type' => 'application/json'\n\t ],\n\t 'json' => $data\n\t ]);\n\t $response = json_decode($response->getBody());\n\t return $response;\n\t}", "public function create($request);", "public function createAction(Request $request)\n {\n $entity = new Contact();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $entity->setUpdatedAt(new DateTime());\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n $this->get('session')->getFlashBag()->add('success_contact_send', 'Message envoyé avec Succès !!');\n $this->sendMail($entity);\n\n return $this->redirect($this->generateUrl('contact_client'));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function store(Request $request)\n {\n //\n $this->validate(request(),\n [\n 'firstname' => 'required',\n 'lastname' => 'required',\n 'email' => 'required',\n 'designation' => 'required'\n ]);\n\n return $this->repo->createContact($request);\n }", "public function createAction(Request $request)\n {\n $contact = new Contact();\n //prepare the form with the function: createForm()\n $form = $this->createForm(ContactType::class, $contact);\n //extract the form answer from the received request\n $form = $form->handleRequest($request);\n //if this form is valid\n if($form->isValid())\n {\n //create an entity manager object\n $em = $this->getDoctrine()->getManager();\n //presist the object $contact in the ORM\n $em->persist($contact);\n //update the database with flush\n $em->flush();\n //redirect the route after the add\n return $this->redirectToRoute('createContact');\n }\n return $this->render('@Contact/Contact/create.html.twig',array(\n 'form' => $form->createView()\n ));\n }", "function createRequest()\n {\n if (!radius_create_request($this->res, RADIUS_ACCOUNTING_REQUEST)) {\n return false;\n }\n return true;\n }", "public function create()\n\t{\n $data = Input::get();\n\n $errors = $this->isValid($data);\n\n if(!empty($errors))\n return Response::json(array('status' => 'error', 'message' => implode('<br />', $errors)));\n\n $request = new Request();\n $request->name = $data['name'];\n $request->method = $data['method'];\n $request->url = $data['url'];\n $request->content_type = $data['content_type'];\n $request->content = $data['content'];\n $request->bundle_id = $data['bundle'];\n\n $request->save();\n\n\n return Response::json(array('status' => 'ok', 'message' => 'Request has been saved.'));\n\t}", "public function create($ContactJSON)\n {\n //\n }", "public function create()\n {\n //\n // return $req->\n }", "function createRequest()\n {\n if (!radius_create_request($this->res, RADIUS_ACCESS_REQUEST)) {\n return false;\n }\n return true;\n }", "public function contactUs(Request $request)\n {\n $validator = validator()->make($request->all(), [\n\n 'name' =>'required',\n 'email' =>'required',\n 'phone' =>'required',\n 'type_of_message' =>'required',\n 'message' =>'required',\n\n ]);\n\n if($validator->fails())\n {\n return responseJson(0, $validator->errors()->first(), $validator->errors());\n }\n\n $contact = Contact::create($request->all());\n return responseJson(1, 'success', $contact );\n\n }", "public function postContact(Request $request)\n {\n $this->validate($request, [\n 'email' => 'required|email',\n 'message' => 'min:0',\n 'phone' => 'min:10']);\n\n\n $contact = new EventCoordinator();\n $contact->name = $request->name;\n $contact->email = $request->email;\n $contact->phone = $request->phone;\n $contact->messbody = $request->mess;\n $contact->save();\n\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"contact\",\n \"action\" => \"index\"\n ));\n }\n\n $contact = new Contact();\n\n //$contact->id = $this->request->getPost(\"id\");\n $contact->name = $this->request->getPost(\"name\");\n $contact->email = $this->request->getPost(\"email\", \"email\");\n $contact->content = $this->request->getPost(\"content\");\n\n \n\n if (!$contact->save()) {\n foreach ($contact->getMessages() as $message) {\n $this->flash->error($message);\n }\n return $this->dispatcher->forward(array(\n \"controller\" => \"contact\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"contact was created successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"contact\",\n \"action\" => \"index\"\n ));\n\n }", "public function postAction(Request $request)\n {\n try {\n $this->checkArguments($request);\n $contact = $this->contactManager->save(\n $request->request->all()\n );\n $apiContact = $this->contactManager->getContact(\n $contact,\n $this->getLocale($request)\n );\n $view = $this->view($apiContact, 200);\n $context = new Context();\n $context->setGroups(static::$contactSerializationGroups);\n $view->setContext($context);\n } catch (EntityNotFoundException $enfe) {\n $view = $this->view($enfe->toArray(), 404);\n } catch (MissingArgumentException $maex) {\n $view = $this->view($maex->toArray(), 400);\n } catch (RestException $re) {\n $view = $this->view($re->toArray(), 400);\n }\n\n return $this->handleView($view);\n }", "public function createContact($grpname,$name,$number)\n {\n $url = $this->url.'/api/createcontact.json';\n $params = array('grpname'=>$grpname,'name'=>$name,'number'=>$this->formatNumber($number));\n $user_auth = $this->getAuthParams();\n\t\tif($this->get_errors()){\n\t\t\treturn $this->get_errors();\n\t\t}\n $params = array_merge($params,$user_auth,$this->getOptions());\n $client = new Client();\n $response = $client->request('POST', $url, ['json' => $params, 'http_errors' => false]);\n $body = json_decode($response->getBody(),TRUE); \n return $body;\n }", "public function createContact(array $contact) {\n\t\t//Checking for the required fields\n\t\tif(!isset($contact['email_addresses']) && !isset($contact['phone_numbers'])) {\n\t\t\tthrow new \\Exception('Either an email address or phone number is required to create a contact');\n\t\t}\n\t\tif(isset($contact['phone_numbers'])) {\n\t\t\tforeach ( $contact['phone_numbers'] AS $phone_number ) {\n\t\t\t\tif ( ! isset( $phone_number['field'] ) ) {\n\t\t\t\t\tthrow new \\Exception( 'The field is required for all phone numbers, ie PHONE1 to PHONE5, etc.' );\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $phone_number['number'] ) ) {\n\t\t\t\t\tthrow new \\Exception( 'The phone number is required for all phone numbers, it should be 10 digits long' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(isset($contact['email_addresses'])) {\n\t\t\tforeach ( $contact['email_addresses'] AS $email_address ) {\n\t\t\t\tif ( ! isset( $email_address['field'] ) ) {\n\t\t\t\t\tthrow new \\Exception( 'The field is required for all email addresses, ie EMAIL1 to EMAIL3, etc.' );\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $email_address['email'] ) ) {\n\t\t\t\t\tthrow new \\Exception( 'The email address is required for all email addresses, and it should be in a valid format' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Sending the request\n\t\t$request = $this->send(\"POST\", 'contacts', [\n\t\t\t'headers' => [\n\t\t\t\t'Accept' => 'application/json, */*'\n\t\t\t],\n\t\t\t'json' => $contact\n\t\t]);\n\t\treturn $request;\n\t}", "public function create() {\n $data['title'] = 'Create a Contact';\n $data['hno'] = array (\n 'd' => 'Down', \n 'u' => 'Unreachable', \n 'r' => 'Recovery', \n 'f' => 'Flapping', \n 's' => 'Scheduled Downtime', \n 'n' => 'None'\n );\n $data['sno'] = array (\n 'w' => 'Warning', \n 'u' => 'Unknown', \n 'c' => 'Critical', \n 'r' => 'Recovery', \n 'f' => 'Flapping', \n 'n' => 'None'\n );\n return View::make('contacts.form', $data);\n\t}", "public function createContact(stdClass $contact, bool $noUpdate = false)\n {\n $path = '/contacts';\n if ($noUpdate) {\n $contact->_noUpdate = true;\n }\n $url = $this->buildUrl($path);\n $response = $this->makeRequest('POST', $url, $contact);\n return $response;\n }", "public function getAddContact(Request $request)\n {\n \t$lookup_titles = (new TitleLookupRetriever())->execute();\n \t$lookup_marital_statuses = (new MaritalStatusLookupRetriever())->execute();\n \tif (Util::isValidRequestVariable($request->model_name))\n \t{\n \t\t$model_name = $request->model_name;\n \t}\n \telse \n \t{\n \t\t$model_name = \"none\";\n \t}\n \tif (Util::isValidRequestVariable($request->model_id))\n \t{\n \t\t$model_id = $request->model_id;\n \t}\n \telse\n \t{\n \t\t$model_id = \"none\";\n \t}\n \t$model_view_route = $this->getModelViewRoute($model_name, $model_id);\n \t$model_id_name = $this->getModelIdName($model_name);\n \t$link_description = $this->getLinkDescription($model_name);\n \treturn view('contact.add-contact', [\n \t\t\t'lookup_titles' => $lookup_titles, \n \t\t\t'lookup_marital_statuses' => $lookup_marital_statuses,\n \t\t\t'model_name' => $model_name,\n \t\t\t'model_id' => $model_id,\n\t \t\t'model_view_route' => $model_view_route,\n\t \t\t'model_id_name' => $model_id_name,\n\t \t\t'link_description' => $link_description\n \t\t]);\n }", "public function store(Request $request)\n {\n try {\n $validate = $request->validate([\n 'second_name' => 'required',\n 'phone' => 'required',\n 'email' => 'required|email'\n ]);\n } catch (ValidationException $e) {\n return response($e->errors(), 400);\n }\n\n $newContact = Contact::create($this->request->all());\n\n return response($newContact);\n }", "public function create(Request $request)\n {\n //save new contract\n $contract = Contract::create([\n 'client_id' => $request['contractInfo']['clientId'],\n 'user_id' => $request['contractInfo']['userId'],\n 'family_id' => $request['contractInfo']['familyId'],\n 'contract_url' => $request['contract_name'],\n 'date' => date('Y-m-d'),\n 'comments' => $request['contractInfo']['comments'],\n ]);\n\n return $contract;\n }" ]
[ "0.80256385", "0.6969524", "0.6529208", "0.64841676", "0.6479871", "0.6397974", "0.63951904", "0.63632137", "0.63044995", "0.63040906", "0.6301458", "0.6283649", "0.6213507", "0.6208536", "0.62084836", "0.6192292", "0.6154257", "0.6060859", "0.6046566", "0.604628", "0.6013655", "0.6004704", "0.60010517", "0.5989711", "0.5973917", "0.5965359", "0.59549594", "0.5953259", "0.5936955", "0.5929139" ]
0.7058477
1
Get all contact requests filed on a specific date.
function getContactRequestsByDate(string $date) { return select(' SELECT ContactRequestID, ContactRequestName, ContactRequestSubject, ContactRequestMessage, DATE(ContactRequestDate) ContactRequestDate, ContactRequestEmail FROM contact_requests WHERE DATE(ContactRequestDate) = :date ', ['date' => $date]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function allContact()\n {\n $sql = 'SELECT * FROM form_contacts ORDER BY date_submission DESC';\n return $this->db->request($sql, null, 'form_contacts', true);\n }", "public function get_all_contact_requests()\n\t{\n\t\t$query = $this->db->order_by('id','DESC')->get_where('contact_requests');\n\n\t\t$result = $query->result_array();\n\n\t\tif(!empty($result))\n\t\t{\n\t\t\treturn $result;\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function _getContactRequests($surferId) {\n if ($surferId == '') {\n $surferId = $this->surfer;\n }\n $sql = \"SELECT surfercontact_requestor,\n surfercontact_requested,\n surfercontact_status\n FROM %s\n WHERE (surfercontact_requestor = '%s'\n OR surfercontact_requested = '%s')\n AND surfercontact_status = %d\";\n $sqlParams = array($this->tableContacts, $surferId, $surferId,\n SURFERCONTACT_STATUS_PENDING\n );\n $contactRequests = array();\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n if ($row['surfercontact_requestor'] == $surferId) {\n $contactRequests[] = $row['surfercontact_requested'];\n } else {\n $contactRequests[] = $row['surfercontact_requestor'];\n }\n }\n }\n return $contactRequests;\n }", "private function getLogsByDateRequest(string $accountId)\n {\n $resourcePath = \"/{accountId}/CallLogs/Date\";\n\n $resourcePath = str_replace(\"{accountId}\", $accountId, $resourcePath);\n\n $requestUrl = $this->config->getHost() . $resourcePath;\n $request = new Request('POST', $requestUrl);\n\n return $request;\n }", "public function getCalls($fromDate = \"\", $toDate = \"\", $withRecordings = false)\n {\n return $this->_api_call(\n \t'/calls',\n\t\t\t'GET',\n\t\t\t\"fromDate=\" . $fromDate . \"&toDate=\" . $toDate . \"?withRecordings=\".$withRecordings\n\t\t);\n }", "public function get_contactRequest_Activity()\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM `contact_requests` WHERE `is_replied` = '1' AND DATE(created_at) >= DATE_SUB(CURRENT_DATE, INTERVAL 1 WEEK)\");\n\t\tif($query->num_rows()){\n\t\t\t$result = $query->result_array();\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t}", "public function fetchRequests()\n {\n $aData = array(\n ':userId' => $this->aParams['iUserId'],\n ':senderId' => $this->aParams['iSenderId'],\n ':isQuotationSent' => $this->aParams['iIsQuotationSent']\n );\n\n $aDetails = $this->oQuotationModel->fetchRequests($aData);\n\n foreach ($aDetails as $iKey => $aDetail) {\n $aDetails[$iKey]['isCompanySponsored'] = ($aDetail['isCompanySponsored'] === 1) ? 'Yes' : 'No';\n $aDetails[$iKey]['fullDate'] = date('F j, Y', strtotime($aDetail['dateRequested']));\n }\n\n echo json_encode($aDetails);\n }", "public function filterByRequestdate($date, $comparison = null) {\n\t\treturn $this->filterByOehhrqstdate($date, $comparison);\n\t}", "function getContactRequestsReceived($surferId = '', $withTimestamp = FALSE,\n $number = NULL, $offset = NULL, $sort = 'ASC') {\n if ($surferId == '') {\n $surferId = $this->surfer;\n }\n if ($sort != 'DESC') {\n $sort = 'ASC';\n }\n $addTimestamp = ($withTimestamp == TRUE) ? ', c.surfercontact_timestamp' : '';\n $orderBy = ($withTimestamp == TRUE) ? ' c.surfercontact_timestamp ' : ' s.surfer_handle ';\n if ($withTimestamp == TRUE) {\n $sort = 'DESC';\n }\n $sql = \"SELECT c.surfercontact_requestor,\n c.surfercontact_requested,\n c.surfercontact_status %s\n FROM %s c, %s s\n WHERE c.surfercontact_requestor = s.surfer_id\n AND c.surfercontact_requested = '%s'\n AND c.surfercontact_status = 1\n ORDER BY \".$orderBy.$sort;\n $sqlParams = array($addTimestamp, $this->tableContacts, $this->tableSurfer,\n $surferId);\n $contactRequests = array();\n if ($res = $this->databaseQueryFmt($sql, $sqlParams, $number, $offset)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n if ($withTimestamp) {\n $contactRequests[$row['surfercontact_requestor']] =\n $row['surfercontact_timestamp'];\n } else {\n $contactRequests[] = $row['surfercontact_requestor'];\n }\n }\n $this->absCount = $res->absCount();\n }\n return $contactRequests;\n }", "public function forDate($date) {\n\t\t$this->requestQuery->add('entry_date', $this->getProcessedDate($date));\n\n\t\treturn $this;\n\t}", "static function requests_list() {\n $user_requests = Request::get_current_user_requests();\n while($row = $user_requests->fetch_array()){ \n $date_from = new DateTime($row['date_from']);\n $date_to = new DateTime($row['date_to']);\n $days = date_diff($date_from,$date_to )->format('%a')+1;\n echo \"<tr><td>\" . $row['created_at'] . \"</td><td>\" . $row['date_from']. \" - \" . $row['date_to'] . \"</td><td>\" . $days . \"</td><td>\" . $row['status'] . \"</td><tr>\" ;\n }\n }", "function get_contact_list( $email ) {\n\t$headerdata = array(\n\t\t'X-Auth-Token: api-key ' . $GLOBALS['token'],\n\t\t'Content-Type: application/x-www-form-urlencoded',\n\t);\n\n\t $post_data = array(\n\t\t 'query' => array(\n\t\t\t 'email' => $email,\n\t\t\t 'name' => null,\n\t\t\t 'campaignId' => null,\n\t\t\t 'origin' => null,\n\t\t\t 'createdOn' => array(\n\t\t\t\t 'from' => null,\n\t\t\t\t 'to' => null,\n\t\t\t ),\n\t\t\t 'changedOn' => array(\n\t\t\t\t 'from' => null,\n\t\t\t\t 'to' => null,\n\t\t\t ),\n\t\t ),\n\t\t 'sort' => array(\n\t\t\t 'createdOn' => null,\n\t\t\t 'changedOn' => null,\n\t\t\t 'campaignId' => null,\n\t\t ),\n\t\t 'additionalFlags' => null,\n\t\t 'fields' => null,\n\t\t 'perPage' => null,\n\t\t 'page' => null,\n\t );\n\n\t $post_data = json_decode( json_encode( $post_data ) );\n\t $post_data = http_build_query( $post_data );\n\n\t $ch = curl_init();\n\t $url = $GLOBALS['api_url'] . '/contacts?' . $post_data;\n\t curl_setopt( $ch, CURLOPT_URL, $url );\n\t curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\t curl_setopt( $ch, CURLOPT_HEADER, false );\n\t curl_setopt( $ch, CURLOPT_HTTPHEADER, $headerdata );\n\t\tcurl_setopt( $ch, CURLPROTO_HTTPS, true );\n\n\t $response = curl_exec( $ch );\n\n\t if ( false === $response ) :\n\t\t\t$error_obj = array(\n\t\t\t\t'error' => curl_error( $ch ),\n\t\t\t\t'status' => 'failed',\n\t\t\t);\n\t\t\tcurl_close( $ch );\n\t\t\t$error_obj = json_decode( json_encode( $error_obj ) );\n\t\t\treturn $error_obj;\n\telse :\n\t\tcurl_close( $ch );\n\t\t$response = json_decode( $response );\n\n\t\treturn $response;\n\t\tendif;\n}", "function getContactRequestsSent($surferId = '', $withTimestamp = FALSE,\n $number = NULL, $offset = NULL, $sort = 'ASC') {\n if ($surferId == '') {\n $surferId = $this->surfer;\n }\n if ($sort != 'DESC') {\n $sort = 'ASC';\n }\n $addTimestamp = ($withTimestamp == TRUE) ? ', c.surfercontact_timestamp' : '';\n $orderBy = ($withTimestamp == TRUE) ? ' c.surfercontact_timestamp ' : ' s.surfer_handle ';\n if ($withTimestamp == TRUE) {\n $sort = 'DESC';\n }\n $sql = \"SELECT c.surfercontact_requestor,\n c.surfercontact_requested,\n c.surfercontact_status %s\n FROM %s c, %s s\n WHERE c.surfercontact_requested = s.surfer_id\n AND c.surfercontact_requestor = '%s'\n AND c.surfercontact_status=1\n ORDER BY \".$orderBy.$sort;\n $sqlParams = array($addTimestamp, $this->tableContacts,\n $this->tableSurfer, $surferId);\n $contactRequests = array();\n if ($res = $this->databaseQueryFmt($sql, $sqlParams, $number, $offset)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n if ($withTimestamp) {\n $contactRequests[$row['surfercontact_requested']] =\n $row['surfercontact_timestamp'];\n } else {\n $contactRequests[] = $row['surfercontact_requested'];\n }\n }\n $this->absCount = $res->absCount();\n }\n return $contactRequests;\n }", "public function get_all_contact() {\r\n\t\t\r\n\t}", "protected function expenseReceiptGetAllRequest($date = null, $date_condition = null, $inventory = null, $project = null, $claimed_by = null, $project_task = null, $invoiceable = null, $status = null, $customer = null)\n {\n\n $resourcePath = '/controller/api/v1/expenseReceipt';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($date !== null) {\n $queryParams['date'] = ObjectSerializer::toQueryValue($date);\n }\n // query params\n if ($date_condition !== null) {\n $queryParams['dateCondition'] = ObjectSerializer::toQueryValue($date_condition);\n }\n // query params\n if ($inventory !== null) {\n $queryParams['inventory'] = ObjectSerializer::toQueryValue($inventory);\n }\n // query params\n if ($project !== null) {\n $queryParams['project'] = ObjectSerializer::toQueryValue($project);\n }\n // query params\n if ($claimed_by !== null) {\n $queryParams['claimedBy'] = ObjectSerializer::toQueryValue($claimed_by);\n }\n // query params\n if ($project_task !== null) {\n $queryParams['projectTask'] = ObjectSerializer::toQueryValue($project_task);\n }\n // query params\n if ($invoiceable !== null) {\n $queryParams['invoiceable'] = ObjectSerializer::toQueryValue($invoiceable);\n }\n // query params\n if ($status !== null) {\n $queryParams['status'] = ObjectSerializer::toQueryValue($status);\n }\n // query params\n if ($customer !== null) {\n $queryParams['customer'] = ObjectSerializer::toQueryValue($customer);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('ipp-application-type');\n if ($apiKey !== null) {\n $headers['ipp-application-type'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('ipp-company-id');\n if ($apiKey !== null) {\n $headers['ipp-company-id'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function contacts($page=1) {\n return $this->query('/api/v2/contacts/all', array('page' => $page));\n }", "public function get_all_client_contacts( $client_id, $updated_since = '' ) {\n\n\t\t\t $request = $this->base_uri . '/clients/contacts?output=' . static::$output;\n\t\t\treturn $this->fetch( $request );\n\t\t}", "public function getAllContacts()\n {\n return $this->sendAPIRequest('GET','/contacts');\n }", "public function getEntriesForDate(DateTime $date)\n {\n $result = $this->api->getDailyActivity(\n intval($date->format('z')) + 1,\n $date->format('Y')\n );\n\n $harvestEntries = $result->get('data')->get('dayEntries');\n\n return array_map(function ($entry) {\n return $this->transformEntry($entry);\n }, $harvestEntries);\n }", "public function index(Request $request)\n {\n //\n $perPage = $request->input('per_page', 10);\n $search = $request->input('search');\n $all = $request->input('all', false);\n return ContactResource::collection(ContactService::all($perPage, $search));\n }", "public function getStatusByDate(string $date): array;", "public function birthdays(Request $request)\n {\n $items = $this->employeeRepository->getBirthdays($request->get('date'));\n return $items;\n }", "public function get_dates($date)\n {\n $citas = $this->Cita_model->get_dates($date);\n\n //Con esas citas, Get las horas disponibles para ese dia\n $citas_disponibles = $this->get_availables_dates($citas);\n\n echo json_encode($citas_disponibles);\n die();\n }", "public function Records_forRequest($id) {\n\treturn $this->SelectRecords('ID_Request='.$id,$this->SQLstr_Sorter_Date());\n }", "public function getUpdatedOrders($date)\n {\n return $this->sendRequest('order/updated_since/' . $date);\n }", "public function getEntriesForTheDay($date)\n {\n $entries = Entry::forCurrentUser()\n ->where('date', $date)\n ->get();\n\n return transform(createCollection($entries, new MenuEntryTransformer))['data'];\n }", "public function getAccordedUploads($date = null)\n {\n $sql = \"SELECT * FROM `mail` WHERE `verified` = '2'\";\n\n if ($date) {\n $sql .= \" AND `datum` > DATE_SUB(NOW(),INTERVAL 1 YEAR)\";\n } else {\n $sql .= \" AND `datum` < DATE_SUB(NOW(),INTERVAL 1 YEAR)\";\n }\n\n if ($result = $this->dbQuery($sql)) {\n $row = mysqli_fetch_all($result, MYSQLI_ASSOC);\n return $row;\n }\n }", "protected function getMonthlyCrimes(DateTime $date)\n {\n $baseUrl = 'https://data.police.uk/api/crimes-street/all-crime?';\n\n $requestParams = [\n 'lat' => $this->postcodeData['latitude'],\n 'lng' => $this->postcodeData['longitude'],\n 'date' => $date->format('Y-m'),\n ];\n\n $url = $baseUrl. http_build_query($requestParams);\n\n $response = $this->client->get($url);\n\n if ($response->getStatusCode() != \"200\") {\n syslog(LOG_WARNING, __FILE__ . ' '. __FUNCTION__ .'() '. __LINE__ . ' '. $response->getStatusCode() . ' '. $response->getBody()->getContents());\n throw new Exception('Invalid API call '. $response->getStatusCode());\n }\n return json_decode($response->getBody()->getContents(), true);\n }", "public function getContacts(): array\n {\n $nodes = $this->get('//epp:epp/epp:response/epp:resData/domain:infData/domain:contact');\n $contacts = array_map(static fn (\\DOMNode $node): array => ['type' => $node->getAttribute('type'), 'nichandle' => $node->nodeValue], iterator_to_array($nodes));\n\n return array_combine(array_column($contacts, 'type'), array_column($contacts, 'nichandle'));\n }", "function get_reservations_by_date ($date)\n\t{\n\t\t$query_stmt = $this->database_conn->prepare (\"SELECT reservations.id, users.fullname, rooms.number, reservations.hour FROM reservations JOIN users ON reservations.id_user=users.id JOIN rooms ON reservations.id_room=rooms.id WHERE reservations.date=:reservation_date\");\n\t\t$query_stmt->bindParam (':reservation_date', $date);\n\t\t$query_stmt->execute ();\n\t\t$result = array();\n\t\tforeach ($query_stmt->fetchAll () as $row)\n\t\t{\n\t\t\tif (!array_key_exists ($row['number'], $result))\n\t\t\t\t$result[ $row['number'] ] = array();\n\t\t\t$result[ $row['number'] ][ $row['hour'] ] = array( 'id'=>$row['id'], 'fullname'=>$row['fullname'] );\n\t\t}\n\t\treturn $result;\n\t}" ]
[ "0.61042184", "0.6033009", "0.5920551", "0.58643323", "0.5786101", "0.578399", "0.56510156", "0.5629401", "0.5483622", "0.5405815", "0.5380194", "0.5373927", "0.53624076", "0.53077984", "0.5258283", "0.52464086", "0.5245749", "0.5204347", "0.5184782", "0.51610804", "0.5144048", "0.5137076", "0.5133444", "0.51275826", "0.5124819", "0.5115918", "0.51117086", "0.5111286", "0.510289", "0.50582737" ]
0.759536
0
Remove contact request based on ID.
function removeContactRequest(int $id) { return delete('contact_requests', ['ContactRequestID' => $id]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeReferee(Request $request, $id)\n {\n return $this->remove($request,$id,\"referee\");\n }", "public function destroy($id)\n\t{\n\t\t$requester = Requester::findOrFail($id);\n\t\t$requester->delete();\n\t\treturn $id;\n\t}", "public function destroy(Request $request,$id)\n {\n $contact = Contact::find($id);\n $contact->delete();\n\n return redirect('/contacts')->with('success', 'Contact Removed');\n }", "private function _delete_request($id)\n\t{\n\t\treturn $this->EE->db->delete('rest_requests', array(\n\t\t\t'id' => $id,\n\t\t\t'site_id' => config_item('site_id')\n\t\t));\n\t}", "function delete_request()\r\n\t{\r\n\t\t// Retrieve the user id from the request URI\r\n\t\t$array = explode(\"/\", trim($_SERVER['REQUEST_URI'], \"/\"));\r\n\t\t$request_id = $array[1];\r\n\r\n\t\t$stmt = $this->db->prepare(\"DELETE FROM requests where id=?\");\r\n\t\t$stmt->bind_param(\"d\", $request_id);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->close();\r\n\r\n\t\t$json_response = \"{\\\"status\\\":\\\"successful\\\"}\";\r\n\r\n\t\t$this->sendResponse(200, $json_response);\r\n\t}", "public function destroy($id)\n {\n $contact = $this->contact->find($id);\n $contact->delete();\n return $contact;\n }", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function destroy($id, Request $request)\r\n {\r\n if(!empty($request->action)) {\r\n $ids = array_values($request->ids);\r\n $names = json_encode(array_values(SendingServer::whereIn('id', $ids)->pluck('name')->toArray()));\r\n $destroy = SendingServer::whereIn('id', $ids)->delete();\r\n } else {\r\n $names = SendingServer::whereId($id)->value('name');\r\n $destroy = SendingServer::destroy($id);\r\n }\r\n activity('delete')->withProperties(['app_id' => Auth::user()->app_id])->log(__('app.sending_server') . \" ({$names}) \". __('app.log_delete')); // log\r\n return $destroy;\r\n }", "public function destroy(Request $request, $id)\n {\n $contact = Contact::find($id);\n if (!$contact) {\n return $this->response->errorNotFound(\"Contact doesn't exist!\");\n } else {\n $contact->delete();\n return [\n 'message' => 'Successfully deleted!'\n ];\n }\n }", "public function destroy(Request $request, $id) {\n \t\n \t$recipient = recipient::find($id);\n \tif($recipient)\n \t\t$recipient->delete();\n\n \treturn \"recipient record successfully deleted #\" . $request->input('id');\n }", "public function removeAction(int $id);", "public function remove(Request $request, $id)\n {\n $m = self::MODEL;\n\n if ($request->user->cannot('delete', $m)) {\n abort(403);\n }\n\n if (is_null($m::find($id))) {\n return $this->respond(Response::HTTP_NOT_FOUND);\n }\n $m::destroy($id);\n return $this->respond(Response::HTTP_NO_CONTENT);\n }", "public function destroy(Request $request, $id)\n {\n $referer = request()->headers->get('referer');\n $force_delete = false;\n\n if (\"/edit\" == substr($referer, -5)) {\n $force_delete = true;\n }\n\n // Find catalogue\n $c = \\App\\Contacts::find($id);\n\n $c->alerts()->detach();\n\n // Delete the contact\n $c->delete();\n\n // messaging\n $request->session()->flash('status', 'Contact deleted!');\n // redirect\n return redirect()->route('contacts.index');\n }", "public function deleteRequest(Request $request, $id)\n {\n //Get Bearer Token\n $getToken = $request->bearerToken();\n\n if (!isset($getToken)) {\n return response([\n 'message' => 'Bearer token not found'\n ]);\n }\n\n //Decode\n $decoded = JWT::decode($getToken, new Key('ProgrammersForce', 'HS256'));\n //Get Id\n $userId = $decoded->data;\n\n $requestsReceived = ReceivedFriendRequest::all()->where('user_id', $userId)->where('sender_id', $id)->where('status', false)->first();\n\n $requestsSent = SentFriendRequest::all()->where('user_id', $userId)->where('receiver_id', $id)->where('status', false)->first();\n\n\n if (isset($requestsReceived)) {\n $requestsReceived->delete();\n\n //Delete its corresponding entry from sent friend request table\n $sentRequest = SentFriendRequest::all()->where('user_id', $id)->first();\n $sentRequest->delete();\n\n return response([\n 'message' => 'Request deleted'\n ]);\n }\n\n if (isset($requestsSent)) {\n $requestsSent->delete();\n\n\n //Delete its corresponding entry from received friend request table\n $receivedRequest = ReceivedFriendRequest::all()->where('user_id', $id)->first();\n $receivedRequest->delete();\n\n return response([\n 'message' => 'You have unsent the request'\n ]);\n }\n\n return response([\n 'message' => 'No such request exists'\n ]);\n }", "public function removeUmpire(Request $request, $id)\n {\n return $this->remove($request,$id,\"umpire\");\n }", "public function delContactoId($id){\n\t\t\t$this->db->query(\"DELETE FROM contactos WHERE id_contactos=:id\");\n\n\t\t\t$this->db->bind(':id', $id);\n\n\t\t\t$this->db->execute();\n\t\t}", "public function remove($id, $opt=0);", "public function destroy(Request $request, $id)\n {\n $contact = PhoneBook::findOrFail( $request->contact_id );\n\n if( $contact ) {\n $contact->delete();\n return redirect('phonebook')->with('success', 'Contact Deleted Successfully!');\n }\n\n return redirect('phonebook')->with('fail', 'Can not delete. Something wrong!');\n }", "public function destroy($id, Request $request)\n {\n Communication::deleteCommunication($id);\n return;\n\n }", "public function destroy($id)\n\t{\n Contact::destroy($id);\n\t}", "function delete(&$options,$id)\n\t{\n\t\tif (!is_array($contact = $this->_common_get_put_delete('DELETE',$options,$id)))\n\t\t{\n\t\t\treturn $contact;\n\t\t}\n\t\tif (isset($contact['list_id']))\n\t\t{\n\t\t\t$ok = $this->bo->delete_list($contact['list_id']) !== false;\n\t\t}\n\t\telseif (($ok = $this->bo->delete($contact['id'],self::etag2value($this->http_if_match))) === 0)\n\t\t{\n\t\t\treturn '412 Precondition Failed';\n\t\t}\n\t\treturn $ok;\n\t}", "public function destroy($id, Request $request)\n { \n $params[\"plugin_id\"] = $this->plugin_id;\n $params[\"organization_id\"] = $this->organization_id;\n $params[\"bulk_delete\"]= $request->filter ? true : false;\n $params[\"object_id\"]= $request->object_id ? $request->object_id : $id;\n $params[\"filter\"] = $request->filter ? $request->filter : json_decode(\"{}\");\n\n $room = $this->model->delete($params);\n return $room;\n }", "public function supprimerContact() {\n\t $idContact = $this->input->get('idContact');\n\t $instanceDao = $this->ContactFactory->getInstance();\n\t $supp = $instanceDao->getContactById($idContact);\n\t $instanceDao->deleteContact($supp);\n\t $this->redirection();\n\t}" ]
[ "0.6874496", "0.6615018", "0.65490556", "0.6541593", "0.644242", "0.63757306", "0.6364519", "0.6364519", "0.6364519", "0.6364519", "0.6364519", "0.6364519", "0.6364519", "0.6364519", "0.6300153", "0.6282116", "0.6271252", "0.62672734", "0.6266988", "0.6246944", "0.6238723", "0.62254286", "0.6214991", "0.621208", "0.6205456", "0.61764175", "0.6156871", "0.615559", "0.61447793", "0.6135895" ]
0.85726804
0
Check to see if this file has already been cached If it has get and store the file creation time
protected function wasCached() { $this->start = microtime(true); // Location to lookup or store cached file $this->cache_file_name = $this->cache_folder.md5(",a1b2c3d4e5f6g7h8i9ABB!"); return file_exists($this->cache_file_name) ? filemtime($this->cache_file_name) : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_cached($cacheFile) \n\t{\n \t$cacheFile_created = (file_exists($cacheFile)) ;\n \treturn $cacheFile_created;\n}", "protected function cache_exists() {\r\n if (@file_exists($this->cache_filename()) && time() - $this->cache_time < @filemtime($this->cache_filename())) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function isCached() \n {\n $modified = (file_exists($this->cache_file)) ? filemtime($this->cache_file) : 0;\n return ((time() - $this->cache_expires) < $modified);\n }", "private function cached_file_exists() {\n if ($this->is_remote) {\n $this->download_image();\n }\n if (file_exists($this->cached_filename))\n return true;\n return false;\n }", "public function checkForCachedFile() {\n $this->setCacheFilename();\n if (file_exists($this->cache_filename) && is_readable($this->cache_filename)) {\n return true;\n }\n return false;\n }", "public function cachedFileAvailable() {\n\t\t// Have we said we want to use the cache?\n\t\tif (! $this->_enableCache) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set the location of the cache file\n\t\t$this->setCacheLocation();\n\n\t\t// Does the file already exist?\n\t\tif (! file_exists(PATH_CACHE . $this->_cacheLocation)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The file exists, but is it too stale?\n\t\treturn $_SERVER['REQUEST_TIME'] - filemtime(PATH_CACHE . $this->_cacheLocation) <= $this->_cacheLife;\n\t}", "public function cacheValid()\n {\n // If files exists And is not expired\n if (file_exists($this->path.$this->name.'.xml') && $this->isExpired() !== true){\n return true;\n }else {\n return false;\n }\n }", "function _cache_recreate( $cachefile )\r\n\t{\r\n\t\tif( file_exists( $cachefile ) && !empty( $this -> cache_timeout ) && is_writable( $this -> cache_dir ) )\r\n\t\t\treturn ((filemtime( $cachefile ) < (time() - $this -> cache_timeout)) ? true : false);\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "function isCached($account, $username) {\n $filename = getCacheFilename($account, $username);\n if (file_exists($filename)) {\n // If over an hour old, don't trust it.\n if (time() - filemtime($filename) > 3600) {\n return false;\n } else {\n return true;\n } \n }\n\n return false;\n}", "public static function file_exists_cache($filename)\n {\n }", "private function isCached() {\n $name = \"body\" . md5(Router::getInstance()->getController() . Router::getInstance()->getAction()) . \".min.js\";\n clearstatcache(true, $this->getJsDir() . $name);\n // check if the file exists\n if (file_exists($this->getJsDir().$name)) {\n if ($this->config['cache']['ttl'] == 0) return true;\n $limit = (time() - $this->config['cache']['ttl']);\n // check if the file is recent\n if ($limit > filemtime($this->getJsDir() . $name)) {\n return true;\n }\n return false;\n } else\n return false;\n }", "function _checkCache ($tmplfile) {\r\n $this->_cachefile = $this->_getFilename($tmplfile);\r\n if ($this->_clearcache) {\r\n if (file_exists($this->_cachefile)) unlink($this->_cachefile);\r\n return false;\r\n }\r\n\r\n if (file_exists($this->_cachefile)) {\r\n $this->_cacheexists = 1;\r\n\r\n // if it's expired\r\n if ((filemtime($this->_cachefile) + $this->OPTIONS['CACHE_LIFETIME']) < date ('U')\r\n || filemtime($this->_cachefile) < filemtime($tmplfile)) {\r\n $this->_cacheexists = 0;\r\n return false; // so that we know to recache\r\n }\r\n else {\r\n return true;\r\n }\r\n\r\n } else {\r\n $this->_cacheexists = 0;\r\n return false;\r\n }\r\n }", "public function check() {\n if (array_key_exists($this->shortKey, self::$cache) || file_exists($this->fileLock)) {\n return true;\n }\n return (file_exists($this->file) && ($this->cacheTime == -1 || time() - filemtime($this->file) <= $this->cacheTime));\n }", "public function isFileCacheEnabled(): bool;", "function _check_cache($url)\n\t{\t\n\t\t// Check for cache directory\n\t\t\n\t\t$dir = APPPATH.'cache/'.$this->cache_name.'/';\n\t\t\n\t\tif ( ! @is_dir($dir))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t// Check for cache file\n\t\t\n $file = $dir.md5($url);\n\t\t\n\t\tif ( ! file_exists($file) OR ! ($fp = @fopen($file, 'rb')))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t \n\t\tflock($fp, LOCK_SH);\n \n\t\t$cache = @fread($fp, filesize($file));\n \n\t\tflock($fp, LOCK_UN);\n \n\t\tfclose($fp);\n\n // Grab the timestamp from the first line\n\n\t\t$eol = strpos($cache, \"\\n\");\n\t\t\n\t\t$timestamp = substr($cache, 0, $eol);\n\t\t$cache = trim((substr($cache, $eol)));\n\t\t\n\t\tif ( time() > ($timestamp + ($this->refresh * 60)) )\n\t\t{\n\t\t\t$this->cache_expired = TRUE;\n\t\t}\n\t\t\n return $cache;\n\t}", "protected function cacheIsFresh() {\n $cache = $this->getCache();\n return $cache->isFresh($this->cacheFilename());\n }", "function check_cache($file) {\n\t\tif(!$this->cache['cache_enable']) {\n\t\t\t$this->cache['cached'] = false;\n\t\t\treturn false;\n\t\t}\n\t\tif(!@file_exists($file)) {\n\t\t\t$this->cache['cached'] = false;\n\t\t\treturn false;\n\t\t}\n\t\t$this->cache['cached'] = true;\n\t\treturn true;\n\t}", "function Cached() {\n\t\t//echo \"at caching <br />\";\n\t\t$this->exists = FALSE;\n\t\n\t \t$this->db = mysql_connect($this->db_host,$this->db_user,$this->db_pass);\n\t\tmysql_select_db($this->db_name, $this->db);\t\t\n\t\n\t\t$query = \"select id,UNIX_TIMESTAMP(lastupdated),username,imagedata \nfrom images where username='\".$this->user.\"'\";\n\t\t$result = mysql_query($query,$this->db) or die(\"Error: \" . mysql_error($this->db));\n\t\t\n\t\t$num = mysql_num_rows($result);\n\n\t\tmysql_close($this->db);\t\t\n\n\t\tswitch ($num) {\n\t\t\t\n\t\t\tcase 0:\n\t\t\t\treturn FALSE;\n\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t// If current UNIXTIME minus LASTUPDATED UNIXTIME is greater than or equal to 21600 seconds\n\t\t\t\t// (6 hours), needs to be updated.\n\t\t\t\t$this->userdata = mysql_fetch_assoc($result); $this->exists = TRUE;\n\t\t\t\tif((time() - \n$this->userdata['lastupdated']) > 21600) {\n\t\t\t\t\t$this->imagedata = $this->userdata['imagedata'];\n\t\t\t\t\treturn FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t \t$this->imagedata = $this->userdata['imagedata'];\n\t\t\t\t\treturn TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn FALSE;\n\t\t\tbreak;\n\t\t}\n\t}", "protected function browserCached( $file ) {\r\n\r\n\t\t\r\n\t\t$info = new \\SplFileInfo($file);\r\n\t\t\r\n\t\t$filetime = $info->getMTime();\r\n\t\t\r\n\t\tunset($info);\r\n\t\t\r\n\t\t$last_modified = date('D, d M Y H:i:s', $filetime) . ' GMT';\r\n\t\t\r\n\t\t$PageWasUpdated = !(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) and\r\n\t\t\t\tstrtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $filetime);\r\n\t\t\t\r\n\t\t$DoIDsMatch = (isset($_SERVER['HTTP_IF_NONE_MATCH']) and\r\n\t\t\t\t@ereg(md5($last_modified), $_SERVER['HTTP_IF_NONE_MATCH']));\r\n\t\t\t\r\n\t\tif (!$PageWasUpdated || $DoIDsMatch)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public function checkCache()\n {\n $cacheDuration = Configuration::get('URBIT_INVENTORYFEED_CACHE_DURATION', null);\n\n $filePath = $this->getCacheFilePath();\n\n return file_exists($filePath) && (time() - filemtime($filePath)) < ($cacheDuration * 60);\n }", "private function checkCacheGet(){\n\t\t$cache_path = $this->cachePath();\n\t\t\n\t\t// Check we're not being run by PHP-CLI\n\t\tif(php_sapi_name() == 'cli'){\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Do we have a cached version?\n\t\tif(!file_exists($cache_path)){\n\t\t\tMagicLogger::log(\"No cache file exists at {$cache_path}.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Has the cached file expired?\n\t\tif(filemtime($cache_path) < strtotime('1 hour ago')){\n\t\t\tMagicLogger::log(\"File at {$cache_path} too old.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t// No caching if the user is logged in.\n\t\tif($this->checkCacheGetHasUser()){\n\t\t\tMagicLogger::log(\"User is logged in, not serving cached file {$cache_path}\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t// No caching if there is a POST operation going on\n\t\tif(count($_POST) > 0){\n\t\t\tMagicLogger::log(\"Request is a POST, not serving {$cache_path}\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t// None of the above true? We can served a cached file.\n\t\treturn TRUE;\n\t}", "function checkCache($fileName)\n {\n global $cachePath, $cacheExpirationPeriod;\n $qfilePath = $cachePath.$fileName;\n if (!is_file($qfilePath))\n {\n return null;\n }\n else\n {\n $ftimestamp = filemtime($qfilePath); //file timestamp\n $currenttime = time();\n if ($currenttime-$ftimestamp<$cacheExpirationPeriod)\n {\n return true; //Cache available\n }\n else {\n return null; //Cache expired.\n }\n }\n }", "private function _getCache()\n {\n $cache_path = Config::getInstance()->get('cache_path');\n $url = Config::getInstance()->get('currentUrl');\n $urlbase = Config::getInstance()->get('currentBaseUrl');\n $url = $urlbase . $url;\n $cache_path .= md5($url);\n \n if ( ! @file_exists($filepath)) {\n return FALSE;\n }\n\n if ( ! $fp = @fopen($filepath, FOPEN_READ)) {\n return FALSE;\n }\n\n flock($fp, LOCK_SH);\n\n $cache = '';\n if (filesize($filepath) > 0) {\n $cache = fread($fp, filesize($filepath));\n }\n\n flock($fp, LOCK_UN);\n fclose($fp);\n \n return $cache;\n }", "public function isHit()\n {\n $file = $this->filename($this->key);\n\n $now = new \\DateTime(\"now\", $this->timeZone);\n $hasExpired = ($now > $this->expiration) ? true : false;\n\n if (is_file($file) && $hasExpired === false) {\n return true;\n } else {\n return false;\n }\n }", "public function isCached(): bool;", "public function isCached(): bool;", "public function cache_exists() {\n return isset($this->static_cache[$this->cache_name]);\n }", "function check_cache ( $url )\n\t{\n\t\t$this->ERROR = \"\";\n\t\t$filename = $this->file_name( $url );\n\n\t\tif ( file_exists( $filename ) )\n\t\t{\n\t\t\t// find how long ago the file was added to the cache\n\t\t\t// and whether that is longer then MAX_AGE\n\t\t\t$mtime = filemtime( $filename );\n\t\t\t$age = time() - $mtime;\n\t\t\tif ( $this->MAX_AGE > $age )\n\t\t\t{\n\t\t\t\t// object exists and is current\n\t\t\t\treturn 'HIT';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// object exists but is old\n\t\t\t\treturn 'STALE';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// object does not exist\n\t\t\treturn 'MISS';\n\t\t}\n\t}", "public function isCached() {\n return $this->_is_cached ? $this->_createCacheKey($this->getId()) : false;\n }", "function checkCache()\n {\n global $rss_cache;\n \n // Does they exits? If not, return nothing\n if (file_exists($rss_cache) && strlen(file_get_contents($rss_cache)) > 0) {\n $date_diff = @(time() - filemtime($rss_cache));\n if ($date_diff < 1000) {\n $status = true;\n } else {\n $status = false;\n }\n } else {\n $status = false;\n }\n return $status;\n }" ]
[ "0.7694413", "0.7638543", "0.7637878", "0.7340852", "0.73072106", "0.7256447", "0.7198353", "0.7190389", "0.71614695", "0.7030728", "0.70212877", "0.6982058", "0.6890458", "0.6879695", "0.6824696", "0.67980963", "0.6762036", "0.6715134", "0.6703252", "0.6669369", "0.66668606", "0.6661442", "0.66456866", "0.6643272", "0.66353196", "0.66353196", "0.6629188", "0.6626438", "0.66164017", "0.6602199" ]
0.7754605
0
creates an input stream for given source
public function createInputStream(mixed $source, array $options = []): InputStream;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function sourceToStream($source): StreamInterface\n {\n if (is_string($source)) {\n $source = Psr7\\try_fopen($source, 'r+');\n }\n\n return Psr7\\stream_for($source);\n }", "public static function createInputStream(): self\n {\n return self::createFileStream(self::PHP_INPUT);\n }", "function createStream(Encoding $encoding, Input $input, string $inputPath, CodecConfiguration $codecConfiguration)\n{\n global $bitmovinApi;\n\n $streamInput = new StreamInput();\n $streamInput->inputId($input->id);\n $streamInput->inputPath($inputPath);\n $streamInput->selectionMode(StreamSelectionMode::AUTO());\n\n $stream = new Stream();\n $stream->inputStreams([$streamInput]);\n $stream->codecConfigId($codecConfiguration->id);\n\n return $bitmovinApi->encoding->encodings->streams->create($encoding->id, $stream);\n}", "public function createOutput(SourceInterface $source): OutputInterface;", "public static function create($resource = ''): StreamInterface\n {\n switch (gettype($resource)) {\n case 'string':\n $stream = fopen('php://temp', 'r+');\n if ($resource !== '') {\n fwrite($stream, $resource);\n fseek($stream, 0);\n }\n return new Stream($stream);\n case 'resource':\n return new Stream($resource);\n case 'object':\n if ($resource instanceof StreamInterface) {\n return $resource;\n } elseif ($resource instanceof \\Traversable) {\n return new IteratorStream($resource);\n } elseif (method_exists($resource, '__toString')) {\n return static::create((string)$resource);\n }\n break;\n case 'NULL':\n return new Stream('php://temp', 'r+');\n }\n\n throw new InvalidStreamException(\n 'Invalid resource type: ' . gettype($resource)\n );\n }", "public function readSource()\n\t{\n\t\t$S = new Source($this->_path);\n\t\treturn $S;\n\t}", "public function stream($input)\n {\n if (false === static::$isWrapperRegistered)\n {\n static::$isWrapperRegistered = true;\n stream_wrapper_register($this->options['stream'], 'Jade\\Stream\\Template');\n }\n\n return $this->options['stream'].'://data;'.$this->compile($input);\n }", "private function load_data_from_stream($source)\n {\n $csv_lines=explode(chr(10),$source);\n $header=explode(',',trim($csv_lines[0]));\n foreach ($header as $index=>$value)\n {\n switch(strtolower(trim($value)))\n {\n case 'train_line':\n $TRAINLINE=$index;\n break;\n case 'route_name':\n $ROUTENAME=$index;\n break;\n case 'run_number':\n $RUNNUMBER=$index;\n break;\n case 'operator_id':\n $OPERATORID=$index;\n break;\n } // end switch\n } // end foreach\n\n $csv_length=count($csv_lines);\n $commit=TRUE; // needed for the SQL transaction rollback action.\n $this->start_sql_transaction(); \n for ($i=1; $i<$csv_length; $i++)\n {\n $row=explode(',',$csv_lines[$i]);\n $commit=$this->add_line(trim($row[$TRAINLINE]), trim($row[$ROUTENAME]), trim($row[$RUNNUMBER]), trim($row[$OPERATORID]));\n } // end for each data line\n\n $this->end_sql_transaction($commit);\n }", "public static function createStream(\n string $content = ''\n ): StreamInterface;", "public function __construct(string $stream = 'php://stdin')\n {\n $this->stream = fopen($stream, 'r');\n }", "protected function getInputStream( $input )\n {\n $stream = fopen( 'php://memory', 'r+', false );\n fputs( $stream, $input );\n rewind( $stream );\n\n return $stream;\n }", "function stream_copy_to_stream ($source, $dest, $maxlength = -1, $offset = 0) {}", "public function setSource($source);", "public function setSource($source);", "public function setSource($source);", "public static function createStreamFromResource(\n object $resource\n ): StreamInterface;", "public static function make($source)\n {\n return new self($source);\n }", "public function createStreamFromResource($resource): StreamInterface\n {\n if (is_resource($resource)) {\n return new Stream($resource, ['mode' => \"w+\"]);\n }\n return $this->createStream(\"\");\n }", "public function __construct()\n {\n /** @var resource */\n $input = fopen('php://input', 'rb');\n\n /** @var resource */\n $handle = fopen('php://temp', 'r+b');\n\n stream_copy_to_stream($input, $handle);\n\n parent::__construct($handle);\n\n $this->rewind();\n }", "public function testGettingResourceFromStream()\n {\n $resource = fopen('php://input', 'r');\n $stream = new Stream();\n $stream->bind($resource);\n\n $this->assertEquals($resource, $stream->getResource());\n }", "public function stream_open();", "function stream_for($resource = '', array $options = [])\n{\n if (is_scalar($resource)) {\n $stream = fopen('php://temp', 'r+');\n if ($resource !== '') {\n fwrite($stream, $resource);\n fseek($stream, 0);\n }\n return new Stream($stream, $options);\n }\n\n switch (gettype($resource)) {\n case 'resource':\n return new Stream($resource, $options);\n case 'object':\n if ($resource instanceof StreamInterface) {\n return $resource;\n } elseif ($resource instanceof \\Iterator) {\n return new PumpStream(function () use ($resource) {\n if (!$resource->valid()) {\n return false;\n }\n $result = $resource->current();\n $resource->next();\n return $result;\n }, $options);\n } elseif (method_exists($resource, '__toString')) {\n return stream_for((string) $resource, $options);\n }\n break;\n case 'NULL':\n return new Stream(fopen('php://temp', 'r+'), $options);\n }\n\n if (is_callable($resource)) {\n return new PumpStream($resource, $options);\n }\n\n throw new \\InvalidArgumentException('Invalid resource type: ' . gettype($resource));\n}", "public function __construct($source) {\n\t\t$this->source = $source;\n\t}", "public function createStream(string $content = ''): StreamInterface\n {\n $file = @tempnam(\"/tmp\", \"tmpf\");\n $stream = new Stream(@fopen($file, 'w+', false));\n $stream->write($content);\n return $stream;\n }", "protected function __construct($source) {\n $this->source = $source;\n }", "public function testStreamReturnsReader()\n {\n $stream = new Stream('php://input', 'r');\n\n $this->assertInstanceOf('GravityMedia\\Stream\\StreamReaderInterface', $stream->getReader());\n }", "public function __construct(Source $source)\n {\n $this->source = $source;\n }", "protected function setSource($source)\n {\n $this->source = $source;\n\n if (!is_readable($source)) {\n throw new InvalidArgumentException(\n sprintf('The source file %s could not be found or is not readable.', $source)\n );\n } // if\n\n return $this;\n }", "protected function openStreamWith($stream)\n {\n return @fopen(StreamWrapper::NAME . '://stream', 'rb', false, stream_context_create([\n StreamWrapper::NAME => compact('stream'),\n ]));\n }", "public function readSource($src)\n\t{\n\t\treturn file_get_contents($src);\n\t}" ]
[ "0.717789", "0.63375914", "0.605315", "0.5962994", "0.59242785", "0.58235115", "0.5775653", "0.5735616", "0.57076466", "0.56958336", "0.5674693", "0.565201", "0.56165403", "0.56165403", "0.56165403", "0.56112164", "0.5577539", "0.554751", "0.5540255", "0.5483806", "0.5460935", "0.54532945", "0.54107296", "0.53836846", "0.53791296", "0.5371201", "0.53196424", "0.5297631", "0.52820104", "0.52667505" ]
0.7513285
0
creates an output stream for given target
public function createOutputStream(mixed $target, array $options = []): OutputStream;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createOutput(SourceInterface $source): OutputInterface;", "public function open($target)\n {\n $this->stream->open($target);\n }", "protected function openOutputStream()\n {\n $this->file = fopen('php://output', 'w');\n }", "public function open($target);", "public static function createOutputStream(): self\n {\n return self::createFileStream(self::PHP_OUTPUT, 'wb');\n }", "public function out() {\n return new MemoryOutputStream();\n }", "public function testStreamReturnsWriter()\n {\n $stream = new Stream('php://output', 'w');\n\n $this->assertInstanceOf('GravityMedia\\Stream\\StreamWriterInterface', $stream->getWriter());\n }", "protected function outputFactory(): Output\n\t{\n\t\treturn new Output(new Standard, new Error, new Formatter);\n\t}", "protected function initOutput($options = [])\n {\n $this->output = new StreamOutput(fopen('php://memory', 'w', false));\n if (isset($options['decorated'])) {\n $this->output->setDecorated($options['decorated']);\n }\n if (isset($options['verbosity'])) {\n $this->output->setVerbosity($options['verbosity']);\n }\n return $this->output;\n }", "public function getOutputStream();", "public function setOutputStream($stream)\r\n {\r\n $this->out_stream = $stream;\r\n return $this;\r\n }", "public function into($target)\n {\n return $this->command->into($target);\n }", "protected function createCollector(Target $target): Collector\n {\n return new Collector\\Sftp($target, $this->remotePath, $this->createClient());\n }", "public function streamOutputTo(stubOutputStream $out);", "public function createLogEntry($target)\n {\n return $this->logEntryFactory->create($target, $this);\n }", "public function getOutputStream() {\n return $this->out();\n }", "public function output($message='', $stream = null)\n {\n if ($stream === null) {\n $stream = STDOUT;\n }\n\n fwrite($stream, $message);\n\n return $this;\n }", "function output(){}", "protected function createExecutable(Target $target) : Executable\n {\n $executable = new Executable\\Pgdump($this->pathToPgdump);\n $executable->credentials($this->user, $this->password)\n ->useHost($this->host)\n ->usePort($this->port)\n ->sslMode($this->sslMode)\n ->dumpDatabase($this->database)\n ->dumpSchemas($this->schemas)\n ->excludeSchemas($this->excludeSchemas)\n ->dumpTables($this->tables)\n ->excludeTables($this->excludeTables)\n ->excludeTableData($this->excludeTableData)\n ->dumpSchemaOnly($this->schemaOnly)\n ->dumpDataOnly($this->dataOnly)\n ->dumpNoPrivileges($this->noPrivileges)\n ->dumpNoOwner($this->noOwner)\n ->dumpFormat($this->format)\n ->dumpJobs($this->jobs)\n ->dumpTo($target->getPathnamePlain());\n return $executable;\n }", "public function writeLog( $target, $message, $tag = NULL )\n {\n// Charcoal_ParamTrait::validateString( 1, $target );\n// Charcoal_ParamTrait::validateString( 2, $message );\n// Charcoal_ParamTrait::validateString( 3, $tag, TRUE );\n\n try{\n // get caller\n list( $file, $line ) = Charcoal_System::caller(2);\n\n // get log level and logger names\n list( $level, $logger_names ) = self::_getLevelAndTargetList( $target );\n\n // create log message object\n $msg = new Charcoal_LogMessage( $level, $message, $tag, $file, $line, $logger_names );\n\n // get LOG_NO_BUFFER flag\n if ( $this->init && $this->init_procedure && $this->log_no_buffer ){\n // flush immediately\n $this->buffer[] = $msg;\n self::flush();\n }\n else{\n // store log message to buffer\n $this->buffer[] = $msg;\n }\n }\n catch ( Exception $e )\n {\n echo '<textarea style=\"width:100%; height:300px\">';\n echo print_r($e,true);\n echo '</textarea>';\n exit;\n }\n }", "public function getOutputFactory(): OutputFactory;", "public function createStreamHandler($filename = 'var/log/TIG_Buckaroo.log')\n {\n $streamHandler = $this->objectManager->create(\n '\\Monolog\\Handler\\StreamHandler',\n [\n 'stream' => 'var/log/' . $filename,\n ]\n );\n return $streamHandler;\n }", "private function writeFile(string $target, string $code): void\n {\n $fileSystem = new Filesystem();\n if (!$fileSystem->exists(Path::compiled())) {\n $fileSystem->mkdir(Path::compiled());\n }\n\n $fileSystem->dumpFile(Path::compiled(\"{$target}.php\"), $code);\n }", "public function appendTo($target){}", "public function createStream(){\n return libvirt_stream_create($this->connection);\n }", "abstract public function output();", "abstract public function output();", "public function setOutputFactory(OutputFactory $outputFactory);", "public function output();", "public function output();" ]
[ "0.60753477", "0.60330576", "0.5817412", "0.5598284", "0.5547439", "0.5456573", "0.5438577", "0.53507686", "0.53006643", "0.52929175", "0.52477354", "0.5233282", "0.52163446", "0.5104847", "0.50282896", "0.50069654", "0.4998376", "0.49959618", "0.49829546", "0.49707964", "0.4953177", "0.49497664", "0.49382994", "0.4915887", "0.48849624", "0.48715323", "0.48715323", "0.48403555", "0.48401496", "0.48401496" ]
0.7360059
0
Add parent with no association.
public function addParentWithNoAssociation(MultiParentStub $parent): self { return $this->associateMultiple('parents', $parent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToParent()\n {\n $this->builder->addRelationshipsCollection(\n $this->factory->createRelationshipsCollection(\n $this->relationships\n )\n );\n }", "public function storeNewParent();", "public function addParent( $parentTemplate );", "public static function newFromParent($parent)\n {\n return static::noConstraints(function() use ($parent) {\n return new HasOne(\n $parent->getQuery(),\n $parent->getParent(),\n $parent->getQualifiedForeignKeyName(),\n static::getParentPropertyValue($parent, 'localKey')\n );\n });\n }", "function addParent(&$parent)\n {\n if (is_subclass_of($parent, 'XML_SVG_Element')) {\n $parent->addChild($this);\n }\n }", "public function AddParent($parent)\n {\n $parent = str_replace(\"::\", \"\\\\\", $parent);\n \n $this->parents[$parent] = $parent;\n $this->has_parent = true;\n \n return $this;\n }", "public function parent()\n {\n return $this->hasOne('Category', 'id', 'parent_id');\n }", "public function createFor(Model $parent): void\n {\n $parent->addRelatives($this->factory->state([\n $parent->getForeignKey($this->factory->newModel()) => $parent->getPrimaryKeyValue(),\n ])->create());\n }", "public function setParent($p) {\n $this->parent_id = $p;\n }", "public function getParent()\n {\n return $this->hasOne(Parents::className(), ['parent_id' => 'parent_id']);\n }", "public function parent(): HasOne\n {\n $instance = $this->newRelatedInstance(Version::class);\n $instance->setTable($this->getTable());\n\n $foreignKey = $this->getKeyName();\n\n $localKey = 'vc_parent';\n\n return $this->newHasOne($instance->newQuery(), $this, $instance->getTable().'.'.$foreignKey, $localKey);\n }", "public function getParent()\n {\n return $this->hasOne(Categories::className(), ['id' => 'parent_id']);\n }", "function setParent($parent) {\n $this->parent = $parent;\n }", "public function getParent()\n {\n return $this->hasOne(Comment::className(), ['id' => 'parent_id']);\n }", "public function setParent($parent) {\n $this->parent = $parent;\n }", "public function setParent($parent) {\n $this->parent = $parent;\n }", "public function moveToNewParent();", "public function parent()\n\t{\n\t\treturn $this->belongsToOne(__NAMESPACE__ . '\\\\Entry', 'parent_id', 'id');\n\t}", "public function parent();", "public function parent();", "public function setParent($parent)\n {\n $this->parent = $parent;\n }", "public function addParentWithWrongAssociation(MultiParentStub $parent): self\n {\n return $this->associateMultiple('parents', $parent, 'invalid');\n }", "public function parent()\n {\n return $this->hasOne('ArticleEn', 'id', 'pid');\n }", "function setParent(ItemInterface $parent = null);", "public function setParent( $parent ) {\n\t\t$this->parent = $parent;\n\t\treturn;\n\t}", "public function getParent() {}", "protected function changeChildrenParent()\n {\n if (config('multi-route.set_null_on_delete', false)) {\n foreach ($this->load('children')->children as $child) {\n $child->parent_id = null;\n $child->save();\n }\n }\n }", "public function setParentNode(Node $parent = null): void;", "public function setParent($parent)\n {\n if (null == $parent) {\n return;\n }\n\n if (null === $this->parent) {\n $this->getImportResolver()->add($parent);\n $this->parent = $parent;\n\n return;\n }\n\n throw new \\BadMethodCallException('Cannot set parent Parent. already set.');\n }", "public function getParent();" ]
[ "0.75413865", "0.6394245", "0.63854194", "0.6383476", "0.63046384", "0.6249555", "0.6155894", "0.61433053", "0.60928065", "0.6088029", "0.6077474", "0.6068312", "0.60436636", "0.5994155", "0.5991789", "0.59847385", "0.59673727", "0.59556687", "0.59407055", "0.59407055", "0.5920813", "0.5907777", "0.58893317", "0.58884937", "0.5884083", "0.58830523", "0.58745456", "0.58717054", "0.58656734", "0.5841373" ]
0.7149375
1
Add parent with wrong association for test purposes.
public function addParentWithWrongAssociation(MultiParentStub $parent): self { return $this->associateMultiple('parents', $parent, 'invalid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddCommentWithCorrectParentId()\n {\n $this->_init(['parent_id' => '1']);\n $result = $this->_add();\n $this->assertTrue($result);\n }", "public function testSetParentReferences()\n {\n\n $exhibit = $this->_exhibit();\n $item = $this->_item();\n $record = new NeatlineRecord($exhibit, $item);\n\n // Item and exhibit keys should be set.\n $this->assertEquals($exhibit->id, $record->exhibit_id);\n $this->assertEquals($item->id, $record->item_id);\n\n }", "public function testAddCommentWithIncorrectParentId()\n {\n $this->_init(['parent_id' => '999999']);\n $this->expectException(\\OutOfBoundsException::class);\n $this->expectExceptionMessage(\"You can't comment this record\");\n $this->_add();\n }", "public function addToParent()\n {\n $this->builder->addRelationshipsCollection(\n $this->factory->createRelationshipsCollection(\n $this->relationships\n )\n );\n }", "public function testAddCommentWithCorrectRefIdAndWithoutParentId()\n {\n $this->_init();\n $result = $this->_add();\n $this->assertTrue($result);\n }", "public function addParentWithNoAssociation(MultiParentStub $parent): self\n {\n return $this->associateMultiple('parents', $parent);\n }", "public function addParentWithWrongAttribute(MultiParentStub $parent): self\n {\n return $this->associateMultiple('invalid', $parent, 'children');\n }", "public function testSetParent()\n {\n $result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject);\n $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);\n }", "public function testSetParent()\n {\n $result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject);\n $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);\n }", "public function testGetSetParent(): void\n {\n $parent = new Page();\n\n $this->assertNull($this->object->getParent());\n $this->object->setParent($parent);\n $this->assertEquals(\n $parent,\n $this->object->getParent()\n );\n }", "public function setParent($parent)\n {\n if (null == $parent) {\n return;\n }\n\n if (null === $this->parent) {\n $this->getImportResolver()->add($parent);\n $this->parent = $parent;\n\n return;\n }\n\n throw new \\BadMethodCallException('Cannot set parent Parent. already set.');\n }", "public function storeNewParent();", "public function testSavesEmptyParentAsNull()\n {\n $category = Mage::getModel('things/category')->setParentId(0)->save();\n $this->assertNull($category->getParentId());\n }", "public function test_changeParentWithoutParentAndPresentExtras() {\n $parent_section = new tx_newspaper_Section($this->fixture->getParentSectionUid());\n $grandchild = array_pop($parent_section->getChildSections(true));\n $pageZone = $this->fixture->getRandomPageZoneForPlacement($grandchild);\n\n $pageZone->changeParent(-1);\n\n $this->assertTrue(\n is_null($pageZone->getParentForPlacement()),\n \"Parent is \" . $pageZone->getParentForPlacement()\n );\n\n $inherited_extras = array_filter(\n $pageZone->getExtras(),\n function(tx_newspaper_Extra $e) { return $e->getOriginUid() != $e->getExtraUid(); }\n );\n\n $this->assertEquals(\n 0, sizeof($inherited_extras),\n sizeof($inherited_extras) . \" extras left: \" . print_r($inherited_extras, 1)\n );\n }", "public function testParent() {\n $this->assertEquals('Titon\\Common\\Base', $this->object->parent);\n $this->assertEquals('Titon\\Common\\Base', $this->object->parent());\n }", "public function testReturnsParentCategory()\n {\n $parentId = 42;\n\n $category = $this->getModelMock('news/category', ['getParentId']);\n\n $category->expects($this->once())\n ->method('getParentId')\n ->will($this->returnValue($parentId));\n\n $parent = Mage::getModel('news/category', ['entity_id' => $parentId]);\n\n $model = $this->getModelMock('news/category', ['load']);\n\n $model->expects($this->once())\n ->method('load')\n ->with($this->equalTo($parentId))\n ->will($this->returnValue($parent));\n\n $this->replaceByMock('model', 'news/category', $model);\n\n $this->assertEquals($parent, $category->getParentCategory());\n }", "function setParent($parent) {\n $this->parent = $parent;\n }", "public function testSavesPathUsingParentPath()\n {\n $parent = Mage::getModel('things/category')->setName('foo')->save();\n $child = Mage::getModel('things/category')->setParentId($parent->getId())->save();\n\n $parent = Mage::getModel('things/category')->load($parent->getId());\n $child = Mage::getModel('things/category')->load($child->getId());\n $this->assertEquals($parent->getId(), $parent->getPath());\n $this->assertEquals(\"{$parent->getId()}/{$child->getId()}\", $child->getPath());\n }", "public function createFor(Model $parent): void\n {\n $parent->addRelatives($this->factory->state([\n $parent->getForeignKey($this->factory->newModel()) => $parent->getPrimaryKeyValue(),\n ])->create());\n }", "public function setParent($parent) {\n $this->parent = $parent;\n }", "function SetParent($item, $parent);", "function setParent(ItemInterface $parent = null);", "public function setParent($parent)\n {\n $this->parent = $parent;\n }", "public function setParent($p) {\n $this->parent_id = $p;\n }", "public function testThrowsExceptionIfIncludingNonexistentRelationship()\n\t{\n\t\t$this->parentSearch->withRelationship('whatever');\n\t}", "public function testParent()\n {\n $page = $this->createPage('Parent Page');\n $child1 = $this->createPage('Child 1', $page);\n $child2 = $this->createPage('Child 2', $page);\n\n $this->assertEquals('/Parent Page/Child 1', $child1->getPath());\n $this->assertEquals('/Parent Page/Child 2', $child2->getPath());\n\n $this->assertInstanceOf(\n Page::class,\n $child1->getParent(),\n 'Child has proxy parent'\n );\n $this->assertEquals(\n 'Parent Page',\n $child1->getParent()->getTitle(),\n 'Parent proxy has correct title'\n );\n }", "public function setParent($parent) {\n $this->parent = $parent;\n }", "public static function newFromParent($parent)\n {\n return static::noConstraints(function() use ($parent) {\n return new HasOne(\n $parent->getQuery(),\n $parent->getParent(),\n $parent->getQualifiedForeignKeyName(),\n static::getParentPropertyValue($parent, 'localKey')\n );\n });\n }", "public function testParentMustExist()\n {\n $this->storeCategory(['parent_id' => 100])\n ->assertRedirect()\n ->assertSessionHasErrors('parent_id');\n\n $this->assertCount(0, Category::all());\n }", "public function addParent( $parentTemplate );" ]
[ "0.7180094", "0.6799256", "0.66910356", "0.66452855", "0.6442601", "0.63606584", "0.6344713", "0.6324086", "0.6324086", "0.62871116", "0.6252244", "0.6220665", "0.6138942", "0.61386657", "0.6112775", "0.60888976", "0.6051592", "0.6016506", "0.5995449", "0.5905941", "0.5889421", "0.5888921", "0.5888312", "0.5885709", "0.5876293", "0.58683467", "0.58539397", "0.583961", "0.5815624", "0.5813123" ]
0.69644755
1
Add parent with wrong attribute for test purposes.
public function addParentWithWrongAttribute(MultiParentStub $parent): self { return $this->associateMultiple('invalid', $parent, 'children'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetParent($item, $parent);", "public function testAddCommentWithCorrectParentId()\n {\n $this->_init(['parent_id' => '1']);\n $result = $this->_add();\n $this->assertTrue($result);\n }", "function setParent($parent) {\n $this->parent = $parent;\n }", "public function testSetParent()\n {\n $result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject);\n $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);\n }", "public function testSetParent()\n {\n $result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject);\n $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);\n }", "public function storeNewParent();", "public function setParent( $parent ) {\n\t\t$this->parent = $parent;\n\t\treturn;\n\t}", "public function addParent( $parentTemplate );", "public function testGetSetParent(): void\n {\n $parent = new Page();\n\n $this->assertNull($this->object->getParent());\n $this->object->setParent($parent);\n $this->assertEquals(\n $parent,\n $this->object->getParent()\n );\n }", "function setParent(ItemInterface $parent = null);", "public function setParent($parent)\n {\n if (null == $parent) {\n return;\n }\n\n if (null === $this->parent) {\n $this->getImportResolver()->add($parent);\n $this->parent = $parent;\n\n return;\n }\n\n throw new \\BadMethodCallException('Cannot set parent Parent. already set.');\n }", "public function addParentWithWrongAssociation(MultiParentStub $parent): self\n {\n return $this->associateMultiple('parents', $parent, 'invalid');\n }", "public function testAddCommentWithIncorrectParentId()\n {\n $this->_init(['parent_id' => '999999']);\n $this->expectException(\\OutOfBoundsException::class);\n $this->expectExceptionMessage(\"You can't comment this record\");\n $this->_add();\n }", "public function setParent($parent) {\n $this->parent = $parent;\n }", "public function setParent($parent)\n {\n $this->parent = $parent;\n }", "public function testSetParentReferences()\n {\n\n $exhibit = $this->_exhibit();\n $item = $this->_item();\n $record = new NeatlineRecord($exhibit, $item);\n\n // Item and exhibit keys should be set.\n $this->assertEquals($exhibit->id, $record->exhibit_id);\n $this->assertEquals($item->id, $record->item_id);\n\n }", "function addParent(&$parent)\n {\n if (is_subclass_of($parent, 'XML_SVG_Element')) {\n $parent->addChild($this);\n }\n }", "public function setParent($parent) {\n $this->parent = $parent;\n }", "public function setParent($p) {\n $this->parent_id = $p;\n }", "public function setParent($name, $parent) {\n // value can be a number or an instance of Entity subclass\n }", "public function test_changeParentWithoutParentAndPresentExtras() {\n $parent_section = new tx_newspaper_Section($this->fixture->getParentSectionUid());\n $grandchild = array_pop($parent_section->getChildSections(true));\n $pageZone = $this->fixture->getRandomPageZoneForPlacement($grandchild);\n\n $pageZone->changeParent(-1);\n\n $this->assertTrue(\n is_null($pageZone->getParentForPlacement()),\n \"Parent is \" . $pageZone->getParentForPlacement()\n );\n\n $inherited_extras = array_filter(\n $pageZone->getExtras(),\n function(tx_newspaper_Extra $e) { return $e->getOriginUid() != $e->getExtraUid(); }\n );\n\n $this->assertEquals(\n 0, sizeof($inherited_extras),\n sizeof($inherited_extras) . \" extras left: \" . print_r($inherited_extras, 1)\n );\n }", "function set_parent_id($parent_id)\n {\n $this->set_default_property(self :: PROPERTY_PARENT_ID, $parent_id);\n }", "public function setParent($value) {\r\n $this->_parent = $value;\r\n }", "public function moveToNewParent();", "public function setParent($parent)\n {\n return $this->setParam('_parent', $parent);\n }", "public function setParent( $parentTemplate );", "public function testParent() {\n $this->assertEquals('Titon\\Common\\Base', $this->object->parent);\n $this->assertEquals('Titon\\Common\\Base', $this->object->parent());\n }", "public function setParent(Directory $parent);", "public function setParent($tree);", "function setParent($parent) {\n parent::setParent($parent);\n $this->path = $parent->getPath() . '/cat' . $this->id;\n $this->absolutePath = $parent->getAbsolutePath() . '/cat' . $this->id;\n if ($parent->getAbsoluteDepth() != 2) {\n $this->component = $parent->getComponent();\n }\n return $this;\n }" ]
[ "0.66424346", "0.65987605", "0.64797807", "0.6440601", "0.6440601", "0.64232296", "0.64128137", "0.63971287", "0.6353895", "0.6326748", "0.63111174", "0.62732476", "0.6256281", "0.6245322", "0.6237016", "0.6205738", "0.61945987", "0.6180929", "0.61796486", "0.61579454", "0.61513275", "0.6149277", "0.6144708", "0.606793", "0.6043959", "0.60253173", "0.5975213", "0.5969464", "0.5961289", "0.5952191" ]
0.6937905
0
Admin Panel Options Show info on Admin Backend
public function admin_options() { echo '<h3>' . __('Easebuzz', 'woo_payeasebuzz') . '</h3>'; echo '<p><small><strong>' . __('Confirm your Mode: Is it LIVE or TEST.') . '</strong></small></p>'; echo '<table class="form-table">'; // Generate the HTML For the settings form. $this->generate_settings_html(); echo '</table>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function admin_menu() {\r\n add_management_page('Security Ninja', 'Security Ninja', 'manage_options', 'wf-sn', array(__CLASS__, 'options_page'));\r\n }", "public function info()\n {\n // Values\n return array('module' => 'Admin',\n 'text_type' => $this->__('Administration panel manager'),\n 'text_type_long' => $this->__('Display administration categories and modules'),\n 'allow_multiple' => false,\n 'form_content' => false,\n 'form_refresh' => false,\n 'show_preview' => true);\n }", "public function admin_page() {\n \n echo $this->_view('admin', array('options' => get_option('WPInsertCode_options')));\n }", "public function display_plugin_admin_page() {\n\t\n\t\tinclude_once( 'views/setting_options.php' );\n\t\t\n\t}", "public function admin_options(){\n echo '<h3>'.__('eCommerce EMPS WooCommerce Plugin', 'emp').'</h3>';\n echo '<p>'.__('eCommerce EMP WooCommerce Plugin').'</p>';\n echo '<table class=\"form-table\">';\n $this -> generate_settings_html();\n echo '</table>';\n\n }", "public function admin_options(){\n echo '<h3>'.__('Zaakpay Payment Gateway').'</h3>';\n echo '<p>'.__('India online payment solutions for all your transactions by Zaakpay').'</p>';\n echo '<table class=\"form-table\">';\n $this -> generate_settings_html();\n echo '</table>';\n\n }", "public function adminPanelAction() {\n\t}", "function wedevs_admin_menu()\n {\n add_options_page('Settings API', 'Settings API', 'manage_options', 'settings_api_test', 'wedevs_plugin_page');\n }", "public function adminMenu() {\n add_options_page (__( \"Lyyti Settings\", 'lyyti' ), __( \"Lyyti Settings\", 'lyyti' ), 'manage_options', 'lyyti', [$this, 'settingsPage']);\n }", "function displayAdminPage()\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$Options = $this->getAdminOptions();\r\n\t\t\t\r\n\t\t\t//fetch given file and display\r\n\t\t\tinclude \"php/admin_view.php\";\r\n\t\t}", "public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e( $this->getSettingsDescription(), 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form. Built in WC function\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "public function _admin() {\n\t\techo \\Helper\\View::instance()->render(\"stats/admin.html\");\n\t}", "function displayAdminSettings() {\n\n $settings = $this->getSettings();\n\n if (!isset($settings['maxcontentsize']) || !is_numeric($settings['maxcontentsize']) || $settings['maxcontentsize'] < 1) {\n $settings['maxcontentsize'] = $this->maxcontentsize;\n }\n $locates = file_get_contents(plugin_dir_path(__FILE__). 'locates.json');\n $locates = json_decode($locates, true);\n $version = $this->version;\n include plugin_dir_path(__FILE__) . 'goldseo-settings.php';\n }", "function bbp_admin_settings_help()\n{\n}", "public function display_plugin_admin_page() {\n include_once( 'views/settings.php' );\n }", "function Administration() {\r\n\t\t\t# Security check\r\n\t\t\tif (!current_user_can(c_pwa_min_cap))\r\n\t\t\t\tdie('Unauthorized');\r\n\r\n\t\t\trequire_once('pwaplusphp-admin.php');\r\n\t\t\tpwa_render_admin($this);\r\n\r\n\t\t\tglobal $updates_pwa;\r\n\t\t\tif (isset($updates_pwa))\r\n\t\t\t\t$updates_pwa->checkForUpdates();\r\n\r\n\t\t}", "public function admin_menu() {\n\t\tadd_options_page( 'Salesforce API Connector','Salesforce API Connector','manage_options','options_salesforce-api-connector', array( $this, 'settings_page' ) );\n\t}", "public function admin_options() { ?>\n\n\t\t<h3><?php echo isset( $this->method_title ) ? $this->method_title : __( 'Settings', 'woocommerce' ) ; ?></h3>\n\n\t\t<?php echo isset( $this->method_description ) ? wpautop( $this->method_description ) : ''; ?>\n\n\t\t<table class=\"form-table\">\n\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t</table>\n\n\t\t<!-- Section -->\n\t\t<div><input type=\"hidden\" name=\"section\" value=\"<?php echo $this->id; ?>\" /></div>\n\n\t\t<?php\n\t}", "public function admin_menu() {\n\t\tif ( 'lp-setup' !== LP_Request::get_string( 'page' ) || ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tadd_dashboard_page( '', '', 'manage_options', 'lp-setup', '' );\n\t}", "public function admin() {\r\n $SuperAdmin = new SuperAdmin($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allSup = $SuperAdmin->getAll();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"SuperAdmin/admin\", array(\"allSup\" => $allSup));\r\n \r\n }", "public function plugin_admin_page() {\n\t\t\tinclude_once( 'views/admin.php' );\n\t\t}", "public function admin()\n {\n return $this->render('admin/admin.html.twig');\n }", "function ca_options_page_html(){\n\t\techo ca_admin_dependancy(admin_url('admin-ajax.php'));\t\n\t\techo ca_load_admin_body();\n\t}", "protected function display() {\r\n\r\n\t\t//a generic admin page\r\n\t\trequire_once(SWS_ABSPATH .\"/admin/admin_header.php\");\r\n\t\tsettings_fields(ShoppWholesale::OPTION_GROUP);\r\n\t\tdo_settings_sections($this->getSlug());\r\n\t\trequire_once(SWS_ABSPATH .\"/admin/admin_footer.php\");\r\n\r\n\t}", "public function display_admin() {\n\t\treturn $this->display();\n\t}", "public function display_admin() {\n\t\treturn $this->display();\n\t}", "public function administrationAction()\n {\n return $this->render(\n $this->getTemplatePath().'administration.html.twig',\n array(\n 'instance' => $this->getCurrentInstance(),\n )\n );\n }", "function _admin_settings() {\r\n $params = array( 'endpoint' => $this );\r\n $this->load_template( 'settings.php', $params );\r\n }", "public function display_plugin_admin_page() {\n\t\tinclude_once('views/admin.php');\n\t}", "public function admin_options() {\r\n\t\t?>\r\n\t\t<h3><?php _e('PAYLER', 'woocommerce'); ?></h3>\r\n\t\t<p><?php _e('Настройка приема электронных платежей через PAYLER.', 'woocommerce'); ?></p>\r\n\r\n\t <?php if ( $this->is_valid_for_use() ) : ?>\r\n\r\n\t\t<table class=\"form-table\">\r\n\r\n\t\t<?php \t\r\n \t\t\t// Generate the HTML For the settings form.\r\n \t\t\t$this->generate_settings_html();\r\n ?>\r\n </table><!--/.form-table-->\r\n \t\t\r\n <?php else : ?>\r\n\t\t<div class=\"inline error\"><p><strong><?php _e('Шлюз отключен', 'woocommerce'); ?></strong>: <?php _e('Payler не поддерживает валюты вашего магазина.', 'woocommerce' ); ?></p></div>\r\n\t\t<?php\r\n\t\t\tendif;\r\n\r\n }" ]
[ "0.736239", "0.7342184", "0.72687584", "0.72202206", "0.72043157", "0.719849", "0.71797687", "0.71756566", "0.71455485", "0.7107404", "0.7089723", "0.70583797", "0.70141584", "0.7012698", "0.6984755", "0.6982661", "0.697399", "0.6942937", "0.6942159", "0.69291", "0.6919402", "0.6910364", "0.69096637", "0.6906155", "0.69053847", "0.69053847", "0.6894245", "0.68728995", "0.68572956", "0.68524086" ]
0.7441526
0
end of [ATSPMVlazyval_eval] /
function ATSPMVllazyval($thunk){ return $thunk; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yy_r193()\n {\n $this->_retvalue = new _smarty_code($this, '(string)$_smarty_tpl->tpl_vars[\\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\\']->value');\n }", "function yy_r144(){if ($this->security) {\n $this->compiler->trigger_template_error (self::Err2);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n $this->_retvalue = '->{$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor .')->value'.$this->yystack[$this->yyidx + 0]->minor.'}'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor,\"'\"), null, true, false)->nocache;\n }", "public function getLazy() {}", "function yy_r119()\n {\n $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[$this->yyidx + - 2]->minor . ']->' . $this->yystack[$this->yyidx + 0]->minor;\n }", "function yy_r196(){ $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); }", "function yy_r192(){if (isset($this->compiler->local_var[\"'\".substr($this->yystack[$this->yyidx + 0]->minor,1).\"'\"])) {\n $this->_retvalue = new _smarty_code($this, '$_smarty_tpl->tpl_vars[\\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\\']->value');\n } else {\n $this->_retvalue = new _smarty_code($this, '$_smarty_tpl->getVariable(\\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\\')->value');\n }\n $this->compiler->tag_nocache = $this->compiler->tag_nocache | $this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,\"'\"), null, true, false)->nocache;\n }", "function yy_r128(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor.']'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,\"'\"), null, true, false)->nocache; }", "function yy_r194(){ $this->_retvalue = new _smarty_code($this, '('.$this->yystack[$this->yyidx + -1]->minor.')'); }", "public function setLazy($var) {}", "function yy_r148()\n {\n $this->_retvalue = '->' . $this->yystack[$this->yyidx + 0]->minor;\n }", "function yy_r190(){ $this->_retvalue = new _smarty_code($this, $this->yystack[$this->yyidx + -1]->minor); }", "function yy_r144()\n {\n if ($this->security && substr($this->yystack[$this->yyidx + - 1]->minor, 0, 1) == '_') {\n $this->compiler->trigger_template_error(self::Err1);\n }\n $this->_retvalue = '->' . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;\n }", "function yy_r147(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r197()\n {\n $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor);\n }", "function yy_r121()\n {\n $this->_retvalue = '$_smarty_tpl->getConfigVariable(\\'' . $this->yystack[$this->yyidx + - 1]->minor . '\\')';\n }", "function yy_r146(){if ($this->security) {\n $this->compiler->trigger_template_error (self::Err2);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n $this->_retvalue = '->{\\''.$this->yystack[$this->yyidx + -4]->minor.'\\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}';\n }", "function yy_r72(){ $this->_retvalue = array('op_expr' => @$this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "function yy_r105(){ $this->_retvalue = TRUE; }", "function yy_r104(){ $this->_retvalue = FALSE; }", "function yy_r123()\n {\n $this->_retvalue = '$_smarty_tpl->getConfigVariable(' . $this->yystack[$this->yyidx + - 1]->minor . ')';\n }", "function yy_r175()\n {\n $this->_retvalue = '!==';\n }", "function yy_r163(){ $this->_retvalue = array('source' => $this->yystack[$this->yyidx + -2]->minor, 'guard' => $this->yystack[$this->yyidx + 0]->minor, 'object' => TRUE); }", "function yy_r143(){if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') {\n $this->compiler->trigger_template_error (self::Err1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;\n }", "function yy_r51(){ $this->_retvalue = 'boundfunc'; }", "function yy_r127(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor .')->value]'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable('$this->yystack[$this->yyidx + 0]->minor', null, true, false)->nocache; }", "function yy_r77(){ $this->_retvalue = array('op_expr' => 'expr', array('op_expr' => @$this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor)); }", "function yy_r191()\n {\n $this->_retvalue = new _smarty_code($this, '(string)' . $this->yystack[$this->yyidx + - 1]->minor);\n }", "function yy_r153(){ $this->yystack[$this->yyidx + 0]->minor['own'] = TRUE; $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }", "function yy_r122()\n {\n $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable(\\'' . $this->yystack[$this->yyidx + - 2]->minor . '\\')) ? $tmp' . $this->yystack[$this->yyidx + 0]->minor . ' :null)';\n }", "function yy_r150(){ $this->_retvalue = array('source' => yy('Value', $this->yystack[$this->yyidx + 0]->minor)); }" ]
[ "0.5939638", "0.57499886", "0.56410056", "0.56375074", "0.557132", "0.5542382", "0.55312705", "0.5530076", "0.5518157", "0.55136925", "0.55116254", "0.5501444", "0.5496091", "0.54914063", "0.5482373", "0.54782265", "0.54645103", "0.54420274", "0.5439687", "0.5432378", "0.5431618", "0.54315704", "0.5422435", "0.53979886", "0.53924286", "0.53887856", "0.5388046", "0.53874433", "0.5364621", "0.53627443" ]
0.7710899
0
Constructor for single uploader block
public function __construct() { parent::__construct(); $this->getUploaderConfig()->setSingleFile(true); $this->getButtonConfig()->setSingleFile(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n\t{\n\t\t// Array of block params\n\t\t$block = array(\n\t\t\t\"classname\" => \"edit_blocks\", // Must match class name aboce\n\t\t\t\"name\" => \"Edit Blocks\",\n\t\t\t\"description\" => \"A proper edit block\"\n\t\t);\n\t\t// register block with core, this makes it available to users \n\t\tblocks::register($block);\n\t}", "public function __construct() {\n\t\t\t$this->parameters = array(\n\t\t\t\t'file_name' => null\n\t\t\t);\n\t\t\t$this->type = true;\n\t\t}", "public function __construct($items = NULL, $params = NULL, $parent = NULL) {\r\n\t\tif(isset($params['blockTag']) && in_array($params['blockTag'], self::$allowedTypes)) {\r\n\t\t\t$this->tag = $params['blockTag'];\r\n\t\t}\r\n\t\tif(isset($params['blockClass'])) {\r\n\t\t\t$this->blockClass = $params['blockClass'];\r\n\t\t}\r\n\t\tif(isset($params['blockId'])) {\r\n\t\t\t$this->blockId = $params['blockId'];\r\n\t\t}\r\n\t\tif(isset($params['itemClass'])) {\r\n\t\t\t$this->itemClass = $params['itemClass'];\r\n\t\t}\r\n\t\tif(isset($params['selectedClass'])) {\r\n\t\t\t$this->selectedClass = $params['selectedClass'];\r\n\t\t}\r\n\t\tif(is_string($items)) {\r\n\t\t\t$value = $items;\r\n\t\t} else {\r\n\t\t\t$value = NULL;\r\n\t\t}\r\n\t\tparent::__construct($value, $params, $parent);\t\t\r\n\t\t\r\n\t\tif($this->blockClass) {\r\n\t\t\t$this->addClassName($this->blockClass);\r\n\t\t}\r\n\t\tif($this->blockId) {\r\n\t\t\t$this->setId($this->blockId);\r\n\t\t}\r\n\t\t\r\n\t\tif(is_array($items)) {\r\n\t\t\t$this->setItems($items);\r\n\t\t}\r\n\t}", "public function __construct()\n\t{\n\t\tadd_action('init', [$this, 'register_block']);\n\t\tadd_filter('block_type_metadata', [$this, 'change_metadata']);\n\t\tadd_action('enqueue_block_assets', [$this, 'alter_enqueue_block_assets']);\n\t}", "public function __construct()\n {\n $this->allowedObjectTypes = array('file');\n $this->imageFileTypes = array('gif', 'jpeg', 'jpg', 'png', 'swf');\n $this->forbiddenFileTypes = array('cgi', 'pl', 'asp', 'phtml', 'php', 'php3', 'php4', 'php5', 'exe', 'com', 'bat', 'jsp', 'cfm', 'shtml');\n $this->allowedFileSizes = array('file' => array('uploadFile' => ModUtil::getVar('MUFiles', 'maxSize', 102400)));\n }", "public function __construct(Block $field, string $name)\n {\n $this->field = $field;\n $this->name = $name;\n }", "public function __construct()\n {\n $this->data['controllerName'] = 'upload';\n }", "public function __construct() {\n\t\t\t// Register custom param types\n\t\t\tvc_add_shortcode_param( 'upload_file', array( $this, 'upload_file' ) );\n\t\t}", "public function __construct ( $block )\n {\n $this->arguments = new CssCrush_ArgList( $block );\n\n // Re-assign with the parsed arguments string\n $this->template = $this->arguments->string;\n }", "public function __construct()\n {\n // get temp upload path\n $this->path = self::normalizePath(sys_get_temp_dir()) . $this->path;\n }", "function __construct() {\n\t\t$block_options = array(\n\t\t\t'name' => 'Blog',\n\t\t\t'size' => 'span-12',\n\t\t\t'resizable' => 0\n\t\t);\n\t\t\n\t\t//create the block\n\t\tparent::__construct('aq_blog_block', $block_options);\n\t}", "protected function _construct()\n {\n $this->_addButtonLabel = __('New Item');\n if($model = $this->_coreRegistry->registry('acm_item')){\n\t\t\tif($model->getContentType()==1){\n\t\t\t\tparent::_construct();\n\t\t\t}\n\t\t}\n\n $this->_blockGroup = 'MGS_Acm';\n $this->_controller = 'adminhtml';\n }", "function __construct()\t{\n\t\t$this->basicFileFunc = t3lib_div::makeInstance('t3lib_basicFileFunctions');\n\t\t$this->basicFileFunc->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);\n\t}", "function __construct() {\n\t\t\t$this->file = (object) $this->file;\n\t\t\t$this->config = (object) $this->config;\n\t\t\t$this->file->uri = plugins_url( '/', __FILE__ );\n\t\t\t$this->file->path = plugin_dir_path( __FILE__ );\n\t\t}", "public function __construct()\n {\n $this->path = Util::path(urldecode(strtok($_SERVER['REQUEST_URI'], '?')));\n $this->headers = array_change_key_case(getallheaders());\n foreach ($_FILES as $name => $file) {\n if (is_array($file['name'])) {\n // php makes file groups an inside-out table. unwrap it.\n for ($i = 0; $i < count($file['name']); $i++) {\n $this->fileGroups[$name][$i] = new Upload(\n $file['error_code'][$i],\n $file['name'][$i],\n $file['tmp_name'][$i]\n );\n }\n } else {\n $this->files[$name] = new Upload(\n $file['error_code'],\n $file['name'],\n $file['tmp_name']\n );\n }\n }\n }", "public function __construct() {\n\t\tadd_filter( 'block_categories', array( $this, 'setup_wtba_block_categ' ) );\n\n\t\t// register block template\n\t\tadd_action( 'acf/init', array( $this, 'setup_wtba_block_template' ) );\n\n\t}", "public function __construct($file_field = 'file')\n {\n $this->file_field = $file_field;\n }", "function __construct() {\n\t\t$block_options = array(\n\t\t\t'name' => 'Product categories',\n\t\t\t'size' => 'span12',\n\t\t);\n\t\t\n\t\t//create the block\n\t\tparent::__construct('as_product_categories', $block_options);\n\t}", "function __construct() {\n\n $config['upload_path'] = '';\n\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n $config['max_size'] = 2000;\n $config['max_width'] = 1024;\n $config['max_height'] = 768;\n $config['file_name'] = '' . '.jpg';\n $this->upload->initialize($config);\n }", "private function __construct()\n {\n $this->unibox = ub_unibox::get_instance();\n $this->unibox->config->load_config('media');\n }", "function __construct() {\n\t\t$block_options = array(\n\t\t\t'name' => 'Ajax products ',\n\t\t\t'size' => 'span12',\n\t\t);\n\t\t\n\t\t//create the block\n\t\tparent::__construct('as_ajax_product_categories', $block_options);\n\t}", "public function __construct() {\r\r\n\r\r\n if (isset($_FILES) && !empty($_FILES)) {\r\r\n $this->files = $_FILES;\r\r\n $this->guess_index_key();\r\r\n }\r\r\n }", "public function __construct(UploaderInterface $uploader)\n {\n $this->uploader = $uploader;\n }", "function __construct(BlockRepository $blockRepository)\n {\n $this->blockRepository = $blockRepository;\n }", "public function __construct()\n\t{\n\t\t$this->setMaxFileSize(10485760); // 10MB\n\n\t\t$this->setStoragePath(\\WWW_DIR.'/data');\n\n\t\t// initialize daos\n\t\t$this->fileDao = $this->inject('Om\\Multimedia\\IFileDao');\n\t}", "function init()\n {\n global $CFG;\n\n\n\n $this->title = get_string('block_title', self::BLOCK_NAME);\n $this->version = self::BLOCK_VERSION;\n\n $this->blockConfigs = get_config(self::BLOCK_NAME);\n\n\n $this->blockDir = \"{$CFG->dirroot}/\" . self::BLOCK_PATH . \"/\";\n $this->blockUrl = \"{$CFG->wwwroot}/\" . self::BLOCK_PATH . \"/\";\n\n $this->forgotUrl = empty($CFG->forgottenpasswordurl)\n ? ''\n : $CFG->forgottenpasswordurl;\n\n }", "public function __construct()\n {\n $fieldset = Mage::getConfig()->getFieldset('catalog_product_dataflow', 'admin');\n foreach ($fieldset as $code => $node) {\n /* @var $node Mage_Core_Model_Config_Element */\n if ($node->is('inventory')) {\n foreach ($node->product_type->children() as $productType) {\n $productType = $productType->getName();\n $this->_inventoryFieldsProductTypes[$productType][] = $code;\n if ($node->is('use_config')) {\n $this->_inventoryFieldsProductTypes[$productType][] = 'use_config_' . $code;\n }\n }\n\n $this->_inventoryFields[] = $code;\n if ($node->is('use_config')) {\n $this->_inventoryFields[] = 'use_config_'.$code;\n }\n }\n if ($node->is('required')) {\n $this->_requiredFields[] = $code;\n }\n if ($node->is('ignore')) {\n $this->_ignoreFields[] = $code;\n }\n if ($node->is('to_number')) {\n $this->_toNumber[] = $code;\n }\n }\n\n $this->setVar('entity_type', 'catalog/product');\n if (!Mage::registry('Object_Cache_Product')) {\n $this->setProduct(Mage::getModel('catalog/product'));\n }\n\n if (!Mage::registry('Object_Cache_StockItem')) {\n $this->setStockItem(Mage::getModel('cataloginventory/stock_item'));\n }\n\n $this->_galleryBackendModel = $this->getAttribute('media_gallery')->getBackend();\n }", "function __construct() {\n\t\t$block_options = array(\n\t\t\t'name' => 'Filtered content',\n\t\t\t'size' => 'span12',\n\t\t);\n\t\t\n\t\t//create the block\n\t\tparent::__construct('as_filter_categories', $block_options);\n\t}", "public function __construct($id)\r\n\t{\r\n\t\t$this->_id = $id;\r\n $this->_uploadFile();\r\n\t}", "protected function _construct()\n {\n parent::_construct();\n $this->setMassactionBlockName('manners_widgets/catalog_product_massaction');\n }" ]
[ "0.69838595", "0.6569326", "0.6253343", "0.62134737", "0.61978114", "0.61744493", "0.61040163", "0.606808", "0.60367143", "0.5995024", "0.59715635", "0.5941256", "0.59183717", "0.59088856", "0.5901617", "0.5876773", "0.58750266", "0.58570606", "0.58352655", "0.5832681", "0.58166814", "0.5810745", "0.57926494", "0.5786176", "0.5762646", "0.5719982", "0.57183665", "0.57141733", "0.57003903", "0.56912756" ]
0.6983949
0
Deliver hint for value correctness for this Field.
public function getProperValueHint() : string { return 'It has to be an string not longer than ' . $this->getMaxLength() . ' chars.'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function check()\n\t{\n\t\t// Set this value to 1\n\t\t$this->_field->set_var('value', TRUE);\n\t}", "public function validate(): void\n {\n if (null === $this->isValid) {\n if (null === $this->userValue && null !== $this->defaultValue) {\n // There is a preset value, and its not being changed\n $this->isValid = true;\n } elseif (null !== $this->validator && false !== $this->validator) {\n if ('' === $this->userValue && false === $this->required) {\n $this->isValid = true;\n return;\n } elseif ('' === $this->userValue && true === $this->required) {\n $this->isValid = false;\n return;\n }\n $validator = $this->validator;\n $result = $validator::quickValidate($this->userValue, $this->filters, $this->constraints, $this->error);\n if ($result != null) {\n $this->userValue = $result;\n $this->isValid = true;\n } else {\n $this->userValue = null;\n $this->isValid = false;\n }\n } else {\n // This field does not get validated\n $this->isValid = true;\n }\n }\n // Check if the input is different from the default value\n if ($this->isValid && null !== $this->userValue) {\n $this->isChanged = ($this->defaultValue != $this->userValue);\n }\n }", "public function getDescription()\n {\n return vsprintf(\n 'The value is expected to meet the type constraint: %s',\n [$this->toString()]\n );\n }", "abstract protected function getPostedValue();", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function needsToResolveValue(): bool\n {\n return $this->needsValue;\n }", "public function computeNewValue();", "public function getHintField()\n {\n return $this->hintFieldToString($this->generateHintField());\n }", "protected function autocompletefield()\n\t{\n\t\tif ( ! $this->autocompleted)\n\t\t{\n\t\t\t$fieldname = $this->get('name', null);\n\n\t\t\tif ($fieldname !== null && ($autovalue = $this->form->autovalue($fieldname)) !== null)\n\t\t\t{\n\t\t\t\tif ($this->get('value', false) === $autovalue)\n\t\t\t\t{\n\t\t\t\t\t$this->checked();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->autocompleted = true;\n\t\t}\n\t}", "protected function updateValue()\r\n {\r\n $name = $this->getName();\r\n /* @var $ds HTML_QuickForm2_DataSource_NullAware */\r\n foreach ($this->getDataSources() as $ds) {\r\n if (null !== ($value = $ds->getValue($name))\r\n || $ds instanceof HTML_QuickForm2_DataSource_NullAware && $ds->hasValue($name)\r\n ) {\r\n $this->setValue($value);\r\n return;\r\n }\r\n }\r\n }", "protected function passedValidation(): void\n {\n $this->validatedData = $this->validatedData();\n /** @var array<Castable> $casts */\n $casts = $this->casts();\n\n foreach ($this->validatedData as $key => $value) {\n $this->{$key} = $value;\n }\n\n foreach ($this->defaults() as $key => $value) {\n if (\n ! property_exists($this, $key) ||\n empty($this->{$key})\n ) {\n if (! array_key_exists($key, $casts)) {\n if ($this->requireCasting) {\n throw new MissingCastTypeException($key);\n }\n\n $this->{$key} = $value;\n $this->validatedData[$key] = $value;\n\n continue;\n }\n\n $formatted = $this->shouldReturnNull($key, $value)\n ? null\n : $this->castValue($casts[$key], $key, $value);\n $this->{$key} = $formatted;\n $this->validatedData[$key] = $formatted;\n }\n }\n }", "protected function passedValidation(): void\n {\n $this->validatedData = $this->validatedData();\n /** @var array<Castable> $casts */\n $casts = $this->casts();\n\n foreach ($this->validatedData as $key => $value) {\n $this->{$key} = $value;\n }\n\n foreach ($this->defaults() as $key => $value) {\n if (\n ! property_exists($this, $key)\n || empty($this->{$key})\n ) {\n if (! array_key_exists($key, $casts)) {\n if ($this->requireCasting) {\n throw new MissingCastTypeException($key);\n }\n\n $this->{$key} = $value;\n $this->validatedData[$key] = $value;\n\n continue;\n }\n\n $formatted = $this->shouldReturnNull($key, $value)\n ? null\n : $this->castValue($casts[$key], $key, $value);\n $this->{$key} = $formatted;\n $this->validatedData[$key] = $formatted;\n }\n }\n }", "public function setUnchecked() : void;", "protected function collectValue()\n {\n $conn = $this->service()->connection();\n /* @var $conn Apache_Solr_Service */\n\n if ($conn->system()->lucene) {\n $this->value = new Hostingcheck_Value_Version($conn->system()->lucene->{'solr-spec-version'});\n }\n else {\n $this->value = new Hostingcheck_Value_NotSupported();\n }\n\n }", "public function setSuggestionReason(?string $value): void {\n $this->getBackingStore()->set('suggestionReason', $value);\n }", "public function checkValue() {\n\t\t\t// If ip will match the devIpMask\n\t\tif(t3lib_div::cmpIP($this->options['ip'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {\n\t\t\t$this->setResult(TRUE, self::OK, 20, $this->options);\n\n\t\t\t// If there is no devIPmask configured\n\t\t} else if(!$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']) {\n\t\t\t$this->setResult(TRUE, self::WARNING, 40, $this->options);\n\n\t\t\t// If there is a devIPmask configured but not matched\n\t\t} else {\n\t\t\t$this->setResult(TRUE, self::WARNING, 60, $this->options);\n\t\t}\n\t}", "public function validateField();", "public function allowValueBinding()\n {\n return true;\n }", "public function validate()\r\n {\r\n if (empty($this->value)) {\r\n if ($this->isRequired()) {\r\n $this->addError(\"Please complete this field\");\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n if (is_string($this->value)) {\r\n $min = $this->getMetadata('@length', 'min');\r\n $max = $this->getMetadata('@length', 'max');\r\n\r\n if ($min !== null && strlen($this->value) < $min) {\r\n $this->addError(\"Minimum length is {$min} characters\");\r\n } else {\r\n if ($max !== null && strlen($this->value) > $max) {\r\n $this->addError(\"Maximum length is {$max} characters\");\r\n }\r\n }\r\n }\r\n\r\n if (is_int($this->value)) {\r\n $min = $this->getMetadata('@range', 'min');\r\n $max = $this->getMetadata('@range', 'max');\r\n\r\n if (($min !== null && $this->value < $min) || ($max !== null && $this->value > $max)) {\r\n $this->addError(\"Please enter a value in the range {$min} to {$max}\");\r\n }\r\n }\r\n }", "public function getBugTrackerFieldRestrictNotif();", "public function getFieldValue() : string;", "public function check() {\n if( ! in_array( $this->value, array_keys( $this->options ) ) ) {\n if( empty( $this->value ) ) {\n return \"Поле \\\"\".$this->caption.\"\\\"\n содержит недопустимое значение.\";\n }\n }\n return \"\";\n }", "public function process_value() {\r\n\r\n\t}", "function hint($hint)\n{\n \n}", "protected function validator_special_k( $self, $field, $val )\n\t{\n\t\tif ( $val != 'nothankyou' )\n\t\t\tthrow new Validation_error( 'Must be nothankyou!' );\n\t}", "protected function onUpdateFieldProtected($fieldname, $set_value)\n\t{\n\t\treturn false;\n\t}", "public function getFieldValue(): string;", "public function to_be_true() {\n $this->report($this->value === true, 'to be true');\n }", "protected function updateValue() {\n parent::updateValue();\n\n if($this->getObjSourceObject() != null && $this->getStrSourceProperty() != \"\") {\n $objReflection = new class_reflection($this->getObjSourceObject());\n\n //try to find the matching source property\n $arrProperties = $objReflection->getPropertiesWithAnnotation(self::STR_DDVALUES_ANNOTATION);\n $strSourceProperty = null;\n foreach($arrProperties as $strPropertyName => $strValue) {\n if(uniSubstr(uniStrtolower($strPropertyName), (uniStrlen($this->getStrSourceProperty()))*-1) == $this->getStrSourceProperty())\n $strSourceProperty = $strPropertyName;\n }\n\n if($strSourceProperty == null)\n return;\n\n $strDDValues = $objReflection->getAnnotationValueForProperty($strSourceProperty, self::STR_DDVALUES_ANNOTATION);\n if($strDDValues !== null && $strDDValues != \"\") {\n $arrDDValues = array();\n foreach(explode(\",\", $strDDValues) as $strOneKeyVal) {\n $strOneKeyVal = uniSubstr(trim($strOneKeyVal), 1, -1);\n $arrOneKeyValue = explode(\"=>\", $strOneKeyVal);\n\n $strKey = trim($arrOneKeyValue[0]) == \"\" ? \" \" : trim($arrOneKeyValue[0]);\n if(count($arrOneKeyValue) == 2) {\n $strValue = class_carrier::getInstance()->getObjLang()->getLang(trim($arrOneKeyValue[1]), $this->getObjSourceObject()->getArrModule(\"modul\"));\n if($strValue == \"!\".trim($arrOneKeyValue[1]).\"!\")\n $strValue = $arrOneKeyValue[1];\n $arrDDValues[$strKey] = $strValue;\n }\n }\n $this->setArrKeyValues($arrDDValues);\n }\n }\n }", "public function setWeaklyTyped(string $name, $value): self;" ]
[ "0.59062374", "0.5269106", "0.51247865", "0.5046263", "0.5016756", "0.4990866", "0.497644", "0.4961369", "0.4952107", "0.49135223", "0.48965743", "0.48951244", "0.48861712", "0.4883003", "0.4856171", "0.48522413", "0.4838856", "0.48295426", "0.47858715", "0.47822946", "0.47616243", "0.47578585", "0.47402743", "0.47383085", "0.47320384", "0.47232595", "0.4715342", "0.47145832", "0.46727765", "0.4654702" ]
0.5368828
1
$count_warehouseStock = $this>WarehouseStock>find('count',array('conditions'=>array('OR'=>array('DATE(WarehouseStock.created)=CURDATE()','DATE(WarehouseStock.created)=DATE_ADD(CURDATE(), INTERVAL 1 DAY)')),'recursive'=>1,'fields'=>array('id','product_id')));
public function count_new_product_notification(){ $count_warehouseStock_query = $this->WarehouseStock->find('all',array( 'conditions' => array( 'OR' => array( 'DATE(WarehouseStock.created)=CURDATE()', 'DATE(WarehouseStock.created)=DATE_ADD(CURDATE(), INTERVAL -3 DAY)' ) ), 'group' => 'product_id' )); if(!empty($count_warehouseStock_query)){ $count_warehouseStock = $count_warehouseStock_query->count(); }else{ $count_warehouseStock =''; } $count_products_query = $this->Products->find('all',array('conditions'=>array('DATE(Products.created) >= DATE_ADD(CURDATE(), INTERVAL -3 DAY)'),'fields' => array('id','product','image','selling_price', 'product_code'),'recursive' => -1)); if(!empty($count_products_query)){ $count_products = $count_products_query->count(); }else{ $count_products =''; } $total = $count_products;//$count_warehouseStock + removed warehouse as of now, since we are only showing the new products addition // pr( $total); $this->set(compact('total')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function countTotalOnBoard($agoDate){\n $query = $this->find();\n $query->select(['count' => $query->func()->count('id')]);\n $query->where(['ob_status' => 1, 'DATE(created)' => \"$agoDate\"]);\n// if(!empty($today && $lastSevenDays)){\n// $query->where(['created <=' => $today, 'created >=' => $lastSevenDays]);\n// }\n// echo $query;\n $total = $query->toArray();\n return $result = $total[0]->count;\n \n }", "function getTodayCountSales()\n{\n $CI =& get_instance();\n\n $CI->db->where('DATE(waktu_penjualan)', date('Y-m-d'));\n return $CI->db->get('penjualan')->num_rows();\n}", "public function countTotalConfirmation($agoDate=''){\n $query = $this->find();\n $query->select(['count' => $query->func()->count('id')]);\n $query->where(['ob_status' => 1,'status' => 2 ,'DATE(created)' => \"$agoDate\"]);\n// $query->$query->where(['status' => 1]);\n $total = $query->toArray();\n return $result = $total[0]->count;\n \n }", "public function countTotalActive($agoDate=''){\n $query = $this->find();\n $query->select(['count' => $query->func()->count('id')]);\n $query->where(['ob_status' => 1,'status' => 1 ,'DATE(created)' => \"$agoDate\"]);\n $total = $query->toArray();\n return $result = $total[0]->count;\n }", "private function _count_job_a_day($today) {\n if ($today) {\n $arrWhere = [\n 'status' => 1,\n 'created_at' => [\n '$gte' => $today,\n '$lt' => $today->copy()->addDay()\n ],\n ];\n // DB::connection('mongodb' )->enableQueryLog();\n $count = Job::where($arrWhere)->count();\n // dd(DB::connection('mongodb')->getQueryLog());\n return $count;\n }\n return 0;\n }", "public function out_of_date_count(){\n\n\t\t $date=date('Y-m-d');\n\t\t$this->db->select('a.*,b.*');\n\t\t$this->db->from('product_purchase_details a');\n\t\t$this->db->join('total_batch_stock b','b.batch_id=a.batch_id');\n\t\t$this->db->where('b.stock >',0);\n\t\t$this->db->where('a.expeire_date <=', $date);\n\t\t$this->db->group_by('b.batch_id');\n\t\t$query = $this->db->get();\n\n\t\treturn $query->num_rows();\n\t}", "public function countTotalInactive($agoDate=''){\n $query = $this->find();\n $query->select(['count' => $query->func()->count('id')]);\n $query->where(['ob_status' => 1,'status' => 0 ,'DATE(created)' => \"$agoDate\"]);\n $total = $query->toArray();\n return $result = $total[0]->count;\n \n }", "function get_top_viewed_product($data)\n{\n logger(\"19\",'',$data,5); \n $condition=array();\n $dt = $data['start']. \" 00:00\";\n $start = new MongoDate(strtotime($dt));\n $dt1 = $data['end']. \" 24:00\";\n $end = new MongoDate(strtotime($dt1));\n \n $condition['dateOn'] = array('$gte'=>$start,'$lt'=>$end);\n $condition['activity'] = 'view';\n\n \n\n $getdata = select_mongo(\"activityHistory\",$condition,array('itemId'));\n $fetdata = add_id($getdata,\"id\");\n\n $product_result = array();\n foreach($fetdata as $row)\n {\n $product_result[] = $row['itemId'];\n \n }\n $product_result = array_count_values($product_result);\n\n\n \n return array(\"success\"=>\"true\",\"data\"=>$product_result,\"error_code\"=>\"100\"); \n}", "public function today_sales_count(){\n $date = date(\"d/m/Y\");\n\n\t\t$this->db->select('SUM(qty) as todaysales');\n\t\t$this->db->where('date',$date);\n\t\t$q=$this->db->get('payments');\n\t\t$row=$q->row();\n\t\t$todaysales=$row->todaysales;\n\t\treturn $todaysales;\n\t}", "public function Get_Today_PI_Counts()\n {\n $today = date('Y-m-d');\n// $today ='2018-10-01';\n $query = $this->db->query(\"SELECT count(Proforma_Icode) as pi_count, SUM(GrossTotal_Value) as pi_amount FROM proforma_invoice WHERE date(Proforma_Generated_On)='$today'\"); //GROUP by A.Stock_Icode\n return $query->result_array();\n\n }", "private function _count_application_a_day($today) {\n if ($today) {\n $arrWhere = [\n 'deleted' => false,\n 'created_at' => [\n '$gte' => $today,\n '$lt' => $today->copy()->addDay()\n ],\n ];\n // DB::connection('mongodb' )->enableQueryLog();\n $count = Applications::where($arrWhere)->count();\n // dd(DB::connection('mongodb')->getQueryLog());\n return $count;\n }\n return 0;\n }", "public function countthisday()\n\t{\n\t\t$day = date(\"d\");\n\t\t$this->db->select('COUNT(*) AS total');\n\t\t$this->db->from('bukutamu');\n\t\t$this->db->where('day(date_created)', $day);\n\t\t$query = $this->db->get();\n\t\treturn $query->row();\n\t}", "public function GetProductCountBycategory($cat_id=\"\",$search=\"\",$type=\"\",$sort=\"\"){\n $this->Product_category = ClassRegistry::init('Product_category'); \n $this->Product = ClassRegistry::init('Product');\n //echo \"sdkfjhsdkjfh\";\n $chield=$this->Product_category->children($cat_id) ;\n //print_r($chield);\n $results = Hash::extract($chield, '{n}.Product_category.id');\n array_push($results,$cat_id);\n // print_r($results);\n if($type==\"brand\")\n {\n if(!empty($results))\n {\n $count=$this->Product->find('count',array('conditions'=>array('Product.category_id !='=>\"\",'Product.category_id'=>$results,'Product.brand'=>$search['slug'],'Product.brand !='=>'','Product.status'=>1)));\n // $count1=$this->Product->find('all',array('conditions'=>array('Product.category_id !='=>\"\",'Product.category_id'=>$results,'Product.slug like'=>'%'.str_replace(\"-\", \"%\", $search).'%','Product.brand !='=>'','Product.status'=>1)));\n }else\n {\n $count=$this->Product->find('count',array('conditions'=>array('Product.category_id !='=>\"\",'Product.category_id'=>$cat_id,'Product.brand'=>$search['slug'],'Product.brand !='=>'','Product.status'=>1)));\n // $count1=$this->Product->find('all',array('conditions'=>array('Product.category_id !='=>\"\",'Product.category_id'=>$results,'Product.slug like'=>'%'.str_replace(\"-\", \"%\", $search).'%','Product.brand !='=>'','Product.status'=>1)));\n\n }\n }\n else\n {\n $cond=array('Product.category_id !='=>\"\",'Product.category_id'=>$results,'Product.brand !='=>'','Product.status'=>1);\n // echo $sort;\n\n if(in_array($sort,array('hdiscount','ldiscount')))\n {\n $cond['Product.offer_id !=']=0;\n $cond['Offer.discount !='] = 0;\n //$cond['Offer.discount !='] = \"\";\n $cond['Offer.status'] = '1';\n $cond['Offer.end_date >= '] = date('Y-m-d');\n }\n if( isset($search['brand']))\n {\n $cond=array_merge($cond,array('Product_brand'=>$search['brand']));\n }\n if($search['slug']!=\"\")\n {\n \n $slug2=str_replace('-',' ',$search['slug']);\n $slug3=str_replace('-','* ',$search['slug']);\n $slug4=\"%\".str_replace('-','%',$search['slug']).\"%\";\n $data_cat=$this->getCatIdsBYSlug($slug2);\n $data_brand=$this->getBrandIdsBYSlug1($slug2);\n if(empty($data_brand) and empty($data_cat))\n {\n //$cond['or'][0]=array('Product.brand'=>$data_brand);\n //$cond['or'][1]=array('Product.category_id'=>$data_cat); \n // $cond['or'][2]=array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)');\n // $cond=array_merge($cond,array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)'));\n $cond['Product.slug like']=$slug4;\n }\n else\n {\n \n //echo count($countdata);\n /* function trimssss123($n)\n {\n return rtrim($n,'-');\n }\n*/ if(empty($data_brand) and empty($data_cat))\n {\n array_push($cond,array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)'));\n }\n else\n {\n if(!empty($data_brand))\n {\n $cond['and'][0]=array('Product.brand'=>array_keys($data_brand));\n }\n if(!empty($data_cat))\n {\n $cond['and'][1]=array('Product.category_id'=>$data_cat); \n }\n $countdata=explode(' ', $search['slug']);\n $slug1=str_replace(' ','-', strtolower(trim($search['slug'])));\n $brandas= array_map(\"trimssss123\", array_values($data_brand));\n if(count($countdata)>1 and !empty($data_brand) and !in_array($slug1,$brandas))\n {\n $cond['and'][2]=array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)');\n }\n if(count($countdata)>1 and !empty($data_cat))\n {\n $cond['and'][2]=array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)');\n }\n }\n }\n }\n \t\t/*$slug_split=explode(\"-\",$search['slug']);\n //print_r($slug_split); \n $sluges=array();\n if(isset($slug_split[0]) and $slug_split[0]!=\"\")\n {\n \n $cond=array_merge($cond,array('or'=>array(array('or'=>array()),array('or'=>array()),array('or'=>array()))));\n \n if(count($slug_split)==1)\n {\n foreach ($slug_split as $key => $value) {\n \n\t\t\t\t $sluges= ''; \n $sluges=array_merge((array)$sluges,(array)$value);\n $sluges=implode(\"%\", $sluges);\n array_push($cond['or'][0]['or'],array('Product.slug like'=>\"%\". $sluges.\"%\")); \n\t\t\t\t\t//array_push($cond['or'][1]['or'],array('Product_brand.slug like'=>\"%\". $sluges.\"%\")); \n\t\t\t\t\t//array_push($cond['or'][0]['or'],array('Product_category.slug like'=>\"%\". $sluges.\"%\")); \n \t\n \t\n\t\t\t\t\t$data_cat=$this->getCatIdsBYSlug($sluges);\n \tif(!empty($data_cat))\n\t\t\t\t\t\tarray_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n \t\n\t\t\t\t\t$data_brand=$this->getBrandIdsBYSlug($sluges);\n \tif(!empty($data_brand))\n\t\t\t\t\t\tarray_push($cond['or'][2]['or'],array('Product.brand'=>$data_brand));\n \n }\n }\n else\n {\n\n foreach ($slug_split as $key => $value) {\n if(strlen($value)>2)\n { \n $sluges=array_merge((array)$sluges,(array)$value);\n $sluges=implode(\"%\", $sluges);\n array_push($cond['or'][0]['or'],array('Product.slug like'=>\"%\". $sluges.\"%\"));\n // $data_cat=$this->getCatIdsBYSlug($slug);\n // array_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n\t\t\t\t\n \t\n\t\t\t\t\t$data_cat=$this->getCatIdsBYSlug($sluges);\n \tif(!empty($data_cat))\n\t\t\t\t\t\tarray_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n \t\n\t\t\t\t\t$data_brand=$this->getBrandIdsBYSlug($sluges);\n \tif(!empty($data_brand))\n\t\t\t\t\t\tarray_push($cond['or'][2]['or'],array('Product.brand'=>$data_brand));\n \n\t\t\t\t\n }\n }\n $slug_split=array_reverse($slug_split);\n $sluges=\"\";\n foreach ($slug_split as $key => $value) {\n if(strlen($value)>2)\n { \n $sluges=array_merge((array)$sluges,(array)$value);\n $sluges=implode(\"%\", $sluges);\n array_push($cond['or'][0]['or'],array('Product.slug like'=>\"%\". $sluges.\"%\"));\n //$data_cat=$this->getCatIdsBYSlug($slug);\n // array_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n\t\t\t\t \n \t\n\t\t\t\t\t$data_cat=$this->getCatIdsBYSlug($sluges);\n \tif(!empty($data_cat))\n\t\t\t\t\t\tarray_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n \t\n\t\t\t\t\t$data_brand=$this->getBrandIdsBYSlug($sluges);\n \tif(!empty($data_brand))\n\t\t\t\t\t\tarray_push($cond['or'][2]['or'],array('Product.brand'=>$data_brand));\n \n\t\t\t\t \n }\n }\n\n }\n }*/\n\n if(!empty($results))\n {\n $count=$this->Product->find('count',array('conditions'=>$cond));\n // echo \"<pre>\";print_r($cond); echo $count; echo\"</pre>\";\n // $count1=$this->Product->find('all',array('conditions'=>array('Product.category_id !='=>\"\",'Product.category_id'=>$results,'Product.slug like'=>'%'.str_replace(\"-\", \"%\", $search).'%','Product.brand !='=>'','Product.status'=>1)));\n }else\n {\n $cond=array('Product.category_id !='=>\"\",'Product.category_id'=>$cat_id,'Product.brand !='=>'','Product.status'=>1);\n \n $slug2=str_replace('-',' ',$search['slug']);\n $slug3=str_replace('-','* ',$search['slug']);\n $data_cat=$this->getCatIdsBYSlug($slug2);\n $data_brand=$this->getBrandIdsBYSlug1($slug2);\n if(empty($data_brand) and empty($data_cat))\n {\n $cond['or'][0]=array('Product.brand'=>$data_brand);\n $cond['or'][1]=array('Product.category_id'=>$data_cat); \n $cond['or'][2]=array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)');\n }\n else\n {\n if(!empty($data_brand))\n {\n $cond['and'][0]=array('Product.brand'=>array_keys($data_brand));\n }\n if(!empty($data_cat))\n {\n $cond['and'][1]=array('Product.category_id'=>$data_cat); \n }\n $countdata=explode(' ', $slug);\n $slug1=str_replace(' ','-', strtolower(trim($slug)));\n //echo count($countdata);\n function trimss1($n)\n {\n return ltrim(rtrim($n,'-'),'-');\n }\n\n\n$brandas= array_map(\"trimss1\", array_values($data_brand));\n if(count($countdata)>1 and !empty($data_brand) and !in_array($slug1,$brandas))\n {\n $cond['and'][2]=array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)');\n }\n\n if(count($countdata)>1 and !empty($data_cat))\n {\n $cond['and'][2]=array('MATCH (Product.slug) AGAINST (\"+'.$slug3.'*\" IN BOOLEAN MODE)');\n }\n }\n /* $slug_split=explode(\"-\",$search['slug']);\n \n $sluges=array();\n if(!empty($slug_split))\n {\n $cond=array_merge($cond,array('or'=>array(array('or'=>array()),array('or'=>array()),array('or'=>array()))));\n if(count($slug_split)==1)\n {\n foreach ($slug_split as $key => $value) {\n \n\t\t\t\t $sluges= ''; \n $sluges=array_merge((array)$sluges,(array)$value);\n $sluges=implode(\"%\", $sluges);\n array_push($cond['or'][0]['or'],array('Product.slug like'=>\"%\". $sluges.\"%\")); \n\t\t\t\t\t//array_push($cond['or'][1]['or'],array('Product_brand.slug like'=>\"%\". $sluges.\"%\")); \n\t\t\t\t\t//array_push($cond['or'][0]['or'],array('Product_category.slug like'=>\"%\". $sluges.\"%\")); \n \t\n \t\n\t\t\t\t\t$data_cat=$this->getCatIdsBYSlug($sluges);\n \tif(!empty($data_cat))\n\t\t\t\t\t\tarray_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n \t\n\t\t\t\t\t$data_brand=$this->getBrandIdsBYSlug($sluges);\n \tif(!empty($data_brand))\n\t\t\t\t\t\tarray_push($cond['or'][2]['or'],array('Product.brand'=>$data_brand));\n \n }\n }\n else if(count($slug_split)>1)\n {\n\n foreach ($slug_split as $key => $value) {\n if(strlen($value)>2)\n { \n $sluges=array_merge((array)$sluges,(array)$value);\n $sluges=implode(\"%\", $sluges);\n array_push($cond['or'][0]['or'],array('Product.slug like'=>\"%\". $sluges.\"%\"));\n // $data_cat=$this->getCatIdsBYSlug($slug);\n // array_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n\t\t\t\t\n \t\n\t\t\t\t\t$data_cat=$this->getCatIdsBYSlug($sluges);\n \tif(!empty($data_cat))\n\t\t\t\t\t\tarray_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n \t\n\t\t\t\t\t$data_brand=$this->getBrandIdsBYSlug($sluges);\n \tif(!empty($data_brand))\n\t\t\t\t\t\tarray_push($cond['or'][2]['or'],array('Product.brand'=>$data_brand));\n \n\t\t\t\t\n }\n }\n $slug_split=array_reverse($slug_split);\n $sluges=\"\";\n foreach ($slug_split as $key => $value) {\n if(strlen($value)>2)\n { \n $sluges=array_merge((array)$sluges,(array)$value);\n $sluges=implode(\"%\", $sluges);\n array_push($cond['or'][0]['or'],array('Product.slug like'=>\"%\". $sluges.\"%\"));\n //$data_cat=$this->getCatIdsBYSlug($slug);\n // array_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n\t\t\t\t \n \t\n\t\t\t\t\t$data_cat=$this->getCatIdsBYSlug($sluges);\n \tif(!empty($data_cat))\n\t\t\t\t\t\tarray_push($cond['or'][1]['or'],array('Product.category_id'=>$data_cat));\n \t\n\t\t\t\t\t$data_brand=$this->getBrandIdsBYSlug($sluges);\n \tif(!empty($data_brand))\n\t\t\t\t\t\tarray_push($cond['or'][2]['or'],array('Product.brand'=>$data_brand));\n \n\t\t\t\t \n }\n }\n\n }\n }*/\n\n if( isset($search['brand']))\n {\n $cond=array_merge($cond,array('Product_brand'=>$search['brand']));\n }\n $count=$this->Product->find('count',array('conditions'=>$cond));\n // $count1=$this->Product->find('all',array('conditions'=>array('Product.category_id !='=>\"\",'Product.category_id'=>$results,'Product.slug like'=>'%'.str_replace(\"-\", \"%\", $search).'%','Product.brand !='=>'','Product.status'=>1)));\n\n }\n }\n\n //print_r($count1);\n return $count;\n }", "private function _count_user_register_a_day($today) {\n if ($today) {\n $arrWhere = [\n 'created_at' => [\n '$gte' => $today,\n '$lt' => $today->copy()->addDay()\n ],\n ];\n // DB::connection('mongodb' )->enableQueryLog();\n $count = User::where($arrWhere)->count();\n // dd(DB::connection('mongodb')->getQueryLog());\n return $count;\n }\n return 0;\n }", "public function on_so($id_product=''){\n $sum = 0;\n $this->selectModel('Salesorder');\n $data = $this->Salesorder->select_all(array(\n 'arr_where' => array('products.products_id' => new MongoId($id_product), 'status' => array('$in'=>array('Submitted','In production')) )\n ));\n\n $data = iterator_to_array($data);\n $product = array();\n foreach($data as $key => $value){\n foreach($value['products'] as $vv){\n if(!$vv['deleted']){\n $product[] = $vv['products_id'];\n $product[] = $vv['quantity'];\n if(isset($vv['quantity']))\n $sum += $vv['quantity'];\n }\n }\n }\n\n //pr($sum);die;\n return $sum;\n\n }", "function vencidos($date){\r\n\t\t//$date_max = date(\"Y-m-d\",$date_max_str);\r\n\t\t\r\n\t\t$vencidos = $this->find('list',array(\r\n\t\t\t'conditions'=> array(\r\n\t\t\t\t'date(created)' => $date,\r\n\t\t\t\t'ticket_status_id' => 2,\r\n\t\t\t\t'payed' => 0\r\n\t\t\t), 'fields'=>'Ticket.id'\r\n\t\t));\r\n\t\t\r\n\t\t$this->updateAll(\r\n\t\t\tarray('ticket_status_id' => 7),\r\n\t\t\tarray('Ticket.id' => $vencidos)\r\n\t\t);\r\n\t\t\r\n\t\treturn count($vencidos);\r\n\t}", "public function stock_report_product_bydate_count($product_id,$supplier_id,$from_date,$to_date){\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.product_id,\n\t\t\t\t price,\n\t\t\t\ta.product_model,\n\t\t\t\tsum(b.sell) as 'totalSalesQnty',\n\t\t\t\tsum(b.Purchase) as 'totalPurchaseQnty',\n\t\t\t\tb.vdate as date\n\t\t\t\t\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('stock_history b','b.product_id = a.product_id');\n\t\n\t\t$this->db->order_by('b.vdate', 'ASC');\n\n\t\tif (empty($supplier_id)) {\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else{\n\t\t\t$this->db->where(\n\t\t\t\tarray(\n\t\t\t\t\t'a.status'=>1,\n\t\t\t\n\t\t\t\t\t'a.product_id'\t=>\t$product_id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t$this->db->where('b.vdate >=', $from_date);\n\t\t\t$this->db->where('b.vdate <=', $to_date);\n\t\t}\n\t\t$this->db->group_by('b.vdate');\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function record_count($params=array())\n {\n\n if(isset($_POST['is_low_quantity_products'])) {\n $params['product_quantity'] = $_POST['is_low_quantity_products'];\n }\n\n $this->db->select('COUNT(`product_detail`.`id`) as total');\n\n $this->db->from('`product_detail`');\n\n if(isset($params['product_id'])) {\n if(!empty($params['product_id'])) {\n $this->db->where('`product_id`', $params['product_id']);\n }\n }\n\n if(isset($params['product_company'])) {\n if(!empty($params['product_company'])) {\n $this->db->join('`product`', '`product_detail`.`product_id` = `product`.`id`', 'left');\n $this->db->join('`company`', '`company`.`id` = `product`.`company`', 'left');\n $this->db->where('`product`.`company`', $params['product_company']);\n }\n }\n\n if(isset($params['product_quantity'])) {\n if(!empty($params['product_quantity'])) {\n $this->db->where(array(\n '`product_detail`.`quantity` <= ' => $params['product_quantity'],\n// '`product_detail`.`purchase_price` != ' => 0,\n// '`product_detail`.`sale_price` != ' => 0\n ));\n }\n }/*\n else {\n $this->db->where(array(\n '`product_detail`.`quantity` != ' => 0,\n '`product_detail`.`purchase_price` != ' => 0,\n '`product_detail`.`sale_price` != ' => 0\n ));\n }*/\n\n $query = $this->db->get();\n $result = $query->result_array();\n return array_pop($result)['total'];\n }", "function out_of_stock()\r\n {\r\n $count = 0;\r\n $this->db->select('mp_productslist.min_stock,mp_productslist.quantity');\r\n $this->db->from('mp_productslist');\r\n $query = $this->db->get();\r\n\r\n if ($query->num_rows() > 0)\r\n {\r\n $result = $query->result();\r\n if($result != NULL)\r\n {\r\n foreach ($result as $single_item) \r\n {\r\n if($single_item->min_stock > $single_item->quantity )\r\n {\r\n $count++;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return $count;\r\n }", "public function getProductsCount()\r\n {\r\n return $this->hasMany(ProductAttributesEav::class, ['value' => 'id'])->count();\r\n\r\n\r\n //$dependencyQuery = $query;\r\n //$dependencyQuery->select('COUNT(*)');\r\n //$dependency = new DbDependency([\r\n // 'sql' => $dependencyQuery->createCommand()->rawSql,\r\n //]);\r\n\r\n\r\n //print_r($query->createCommand()->rawSql);die;\r\n //return $query; //->cache(3200, $dependency)\r\n }", "function get_category_count($id){\n return db('product')->where(['status'=>1,'cid'=>$id])->count();\n}", "public function getFilteredStockInReports($start_date,$end_date,$product_id){\n $product_stock_ins=DB::table('products_stock_in')\n ->where('product_id',$product_id)\n ->where('created_at','>=',$start_date.\" 00:00:00\")\n ->where('created_at','<=',$end_date.\" 23:59:59\")\n ->orderBy('created_at', 'desc')\n ->get();\n print_r(json_encode($product_stock_ins));\n }", "public function countItemsByDate();", "public function count_lists($date_today = null){\n $this->db->select('id');\n if(!empty($date_today)){\n $conditions = array('created LIKE' => $date_today . '%');\n $this->db->where($conditions);\n }\n $query = $this->db->get('lists');\n return $query->num_rows();\n }", "public function getCount()\n {\n// $query = $this->DbConn->select();\n// $query->from('calendar_event_reminders', array('CNT' => new Zend_Db_Table_Abstract('COUNT(*)')));\n// $query->where('reminder_event_id = ?', $this->getEvent()->getId());\n// $result = $this->DbConn->fetchOne($query);\n// return $result;\n }", "public function index() {\n\n /* Recupère le nombre de vote pour chaque liste au total */\n for($i = 1 ; $i <= 3 ; $i++) {\n $conditions = array('Vote.liste' => $i);\n $donnees = $this->Vote->find('count',array('conditions'=>$conditions));\n $this->set('liste_'.$i,$donnees);\n }\n\n /* On recupère maintenant le nombre de vote dans une même heure pour chaque liste */\n $liste_1 = $this->Vote->query('SELECT COUNT(*) as c,date FROM votes WHERE liste = 1 GROUP BY date ORDER BY date');\n $liste_2 = $this->Vote->query('SELECT COUNT(*) as c,date FROM votes WHERE liste = 2 GROUP BY date ORDER BY date');\n $liste_3 = $this->Vote->query('SELECT COUNT(*) as c,date FROM votes WHERE liste = 3 GROUP BY date ORDER BY date');\n\n $this->set(array('liste1' => $liste_1,'liste2' => $liste_2,'liste3' => $liste_3));\n\n}", "function get_count_all_pay_now_dashbord(){\n $this->db->from('pawn');\n $this->db->join('pawn_schedule','pawn.id = pawn_schedule.pawn_id');\n $this->db->join('people','pawn.person_id = people.person_id');\n $this->db->where('pawn_schedule.pay_date <=',date(\"Y-m-d\"));\n $this->db->where('pawn_schedule.status',0);\n $this->db->where('pawn_schedule.key >',0);\n $this->db->order_by('pawn_schedule.pay_date','DESC');\n return $this->db->get()->num_rows();\n }", "public function out_of_stock_count(){\n\n\t\t$this->db->select('a.*,(sum(b.Purchase) - sum(b.sell)) as stock_history');\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('stock_history b','a.product_id = b.product_id','left');\n\t\t$this->db->having('stock_history < 10');\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$query = $this->db->get();\n\n\t\treturn $query->num_rows();\n\t}", "public function countProductsTotal($data){\n\t\tif(isset($data['name']) && $data['name']!=''){\n\t\t\t$this->db->like('tittle', $data['name']);\n\t\t\t$this->db->or_like('description', $data['name']);\n\t\t}\n\t\t$this->db->select('*');\n\t\t$this->db->from('live_stream');\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function countListingsOnDate($date){\n return $this->find('count', array('conditions'=>array(\"FeaturedListing.date\"=>$date)));\n }" ]
[ "0.68956643", "0.6729842", "0.6575856", "0.6358733", "0.6299369", "0.6263687", "0.612403", "0.61110955", "0.6021055", "0.599121", "0.5899908", "0.5878534", "0.58529675", "0.5784909", "0.5745039", "0.5743612", "0.5696687", "0.5604057", "0.5589004", "0.557012", "0.55663246", "0.5526781", "0.54925245", "0.54773223", "0.54772633", "0.54631126", "0.5447072", "0.54194814", "0.54026854", "0.5396592" ]
0.7155075
0
Get specified bill by bill ID or by order number
public function getBill($bill_id, $shop_order_number = null) { foreach ($this->bills as $bill) { // get by bill id if (!empty($bill_id) && $bill->getBillId() == $bill_id) { return $bill; } // or get by bill order number if (!empty($shop_order_number) && $bill->getOrderNumber() == $shop_order_number) { return $bill; } } throw new PortmoneException('Bill not found', PortmoneException::NOT_FOUND); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBillByOrder(){\n\n $order = $this->request->data['id'];\n $bill = $this->Bills->find('all',\n ['contain'=>['BillDetails','Payments'],\n 'field'=>['id','bill_number'],\n 'conditions'=>\n ['Bills.canceled' => 0,\n 'Bills.id IN (select bills_id from orders_bills where orders_id ='.$order.')']\n ]);\n if($bill){\n $bills = $bill->toArray();\n $success = true;\n $this->set(compact('success','bills'));\n }\n else{\n $success = false;\n $error = $bills->errors();\n $this->set(compact('success','errors'));\n }\n }", "function fn_2lm_bm_get_payment_id_from_order($order_id)\r\n{\r\n return db_get_field('SELECT payment_id FROM ?:orders WHERE order_id = ?i', $order_id);\r\n}", "public function getOrdersDataByBill($bill = null)\n\t{\n\t\tif ($bill) {\n\t\t\t$sql = \"SELECT * FROM orders WHERE bill_no = ?\";\n\t\t\t$query = $this->db->query($sql, array($bill));\n\t\t\treturn $query->row_array();\n\t\t}\n\n\t\t$user_id = $this->session->userdata('id');\n\t\tif ($user_id == 1) {\n\t\t\t$sql = \"SELECT * FROM orders ORDER BY id DESC\";\n\t\t\t$query = $this->db->query($sql);\n\t\t\treturn $query->result_array();\n\t\t} else {\n\t\t\t$user_data = $this->model_users->getUserData($user_id);\n\t\t\t$sql = \"SELECT * FROM orders WHERE store_id = ? ORDER BY id DESC\";\n\t\t\t$query = $this->db->query($sql, array($user_data['store_id']));\n\t\t\treturn $query->result_array();\n\t\t}\n\t}", "public function getBillByID($idBill)\n {\n $sql = parent::$connection->prepare(\"SELECT * FROM bills WHERE id = ?\");\n $sql->bind_param(\"i\", $idBill);\n\n return parent::select($sql)[0];\n }", "function retrieve($paymecheckoutOrderId);", "public function findOrder($orderId);", "public function fetch_bill($bill_id = NULL){\n\t\t// If $user_id exists and is set,\n\t\tif(!isset($bill_id) || $bill_id === FALSE){\n\t\t\t$query = $this->db->get('bill_details');\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\telse {\n\t\t\t$query = $this->db->get_where('bill_details', array('id'=>$bill_id));\n\t\t\t\n\t\t\treturn $query->row_array();\n\t\t}\n\t}", "function fn_2lm_bm_get_order_payment_id($order_id)\r\n{\r\n if (empty($order_id)) {\r\n return 0;\r\n }\r\n\r\n return db_get_field('SELECT payment_id FROM ?:orders WHERE order_id = ?i', $order_id);\r\n}", "public function getBillInfo($id)\r\n {\r\n $rows = $this->table('order_line')->where(array('id'=>$id))->getOne();\r\n return $rows;\r\n }", "public function get_item_by_id($order_id, Request $request){\n\t\t\n\t\t$login_info = $request->session()->get('total_info');\n\t\t\n\t\t$user_id = $login_info['user_id'];\n\t\tApp\\Badge::removeBadge($user_id, $order_id, 'order');\n\t\t\n\t\t$order = Order::find($order_id);\n\t\tif(null !== $order){\n\t\t\t$this->get_item_by_code($order->code, $request);\n\t\t}else{\n\t\t\techo json_encode(array(\"status\" => false));\n\t\t}\n\t}", "public function getBillByID($id)\n {\n $result = $this->curlExec(\n Constants::GET_METHOD,\n $this->buildApiURI($this->username, $this->password, 'bill_component/get/' . $id, array(), $this->env),\n '');\n if (in_array($result[\"data\"][\"state\"], array(\"paid\", \"reconciled\", \"pending_disburse\", \"disburse_in_progress\", \"cleared\",))) {\n $result[\"data\"][\"state\"] = \"paid\";\n }\n\n return $result;\n }", "public function get($idorder){\n\n //criar a instancia sql\n $sql = new Sql();\n\n //jogar os dados em um $results, realiza uma consulta\n $results = $sql->select(\"SELECT * \n\t\t\tFROM tb_orders a \n\t\t\tINNER JOIN tb_ordersstatus b USING(idstatus) \n\t\t\tINNER JOIN tb_carts c USING(idcart)\n\t\t\tINNER JOIN tb_users d ON d.iduser = a.iduser\n\t\t\tINNER JOIN tb_addresses e USING(idaddress)\n\t\t\tINNER JOIN tb_persons f ON f.idperson = d.idperson\n\t\t\tWHERE a.idorder = :idorder\n\t\t\", [\n\t\t\t':idorder'=>$idorder\n\t\t]);\n\n //fazer a verificação para saber se trouxe algum resultado\n if(count($results)>0){\n $this->setData($results[0]);\n }\n\n }", "function findById($id){\n $dbService = new OrderDataService();\n $order = $dbService->findById($id);\n \n return $order;\n }", "function orders_get_Order( $id = 0 ) {\n global $wpdb;\n return $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->prefix . 'vehicle_booking WHERE id = %d', $id ) );\n}", "public function getUserByOrderId($id){\n\n }", "public function get_order_detail($order_id) {\n\t\t$query = $this->db->select ( \"loans.*,accounts.p_nome,accounts.p_cognome,accounts.o_ragione_sociale,accounts.p_cf,accounts.o_piva\" )->join ( \"accounts\", \"accounts.id = loans.customer_id\", \"left\" )->where ( \"loans.order_id\", $order_id )->get ( \"loans\" );\n\t\treturn $query->row_array ();\n\t}", "public function get($billId) {\n\n $billsHelper = new Bills();\n // todo check if bill belongs to current user\n\n return $billsHelper->getBill($billId);\n }", "public function showBillDetaill($id)\n {\n //\n }", "function shipment_get($order_id){\n\t$query = \"SELECT SHIPMENT_ID, SHIPMENT_TYPE_ID, PRIMARY_ORDER_ID, CURRENCY_UOM_ID, ORIGIN_CONTACT_MECH_ID, ORIGIN_TELECOM_NUMBER_ID, DESTINATION_CONTACT_MECH_ID, DESTINATION_TELECOM_NUMBER_ID, PARTY_ID_TO,\n\t\t\t\t PARTY_ID_FROM, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, HANDLING_INSTRUCTIONS\n\t\t\t FROM shipment\n\t\t\t WHERE PRIMARY_ORDER_ID = '\".esc($order_id).\"'\n\t\t\t LIMIT 1\";\n\treturn db_query_to_row($query);\n}", "function get_order_by_number($order_id) {\n\t\t$sql_check = sprintf(\"SELECT id,customer,open, processed_on FROM %s WHERE id = %d\", ORDERS, $order_id);\n\t\tif ($res_check = mysql_query($sql_check)) {\n\t\t\tif (mysql_num_rows($res_check) > 0) {\n\t\t\t\t$_SESSION['order_id'] = mysql_result($res_check, 0, \"id\");\n\t\t\t\t$_SESSION['cust_id'] = mysql_result($res_check, 0, \"customer\");\n\t\t\t\t$this->open = mysql_result($res_check, 0, \"open\");\n\t\t\t\t$this->processed_on = mysql_result($res_check, 0, \"processed_on\");\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tunset($_SESSION['cust_id']); \n\t\t\t\tunset($_SESSION['order_id']); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->error = $this->messages(1);\n\t\t\treturn false;\n\t\t}\n\t}", "public function get_order_by_id($order_id)\n {\n $sql = \"select t_order.*,t_park.*,img.img_thumb_src from t_order join t_park on t_park.park_id = t_order.park_id join (select * from t_park_img img where img.is_main=1) img \n on img.park_id = t_order.park_id where t_order.is_delete = 0 and t_order.order_id = $order_id\";\n return $this->db->query($sql)->row();\n }", "public function fetchBillStockTransaction($idOrUid, $billId)\n {\n if (is_numeric($idOrUid)) {\n\n return StockTransactionModel::where([\n '_id' => $idOrUid,\n 'bills__id' => $billId\n ])->first();\n }\n\n return StockTransactionModel::where([\n '_uid' => $idOrUid,\n 'bills__id' => $billId\n ])->first();\n }", "public function getitembyid($id)\n {\n // $salesorders = Salesorder::latest('created_at')->where('number', 'like', '%' . $key . '%')\n // ->orWhere('descrip', 'like', '%'.$key.'%')->paginate(20);\n $salesorder = Salesorder_hxold::findOrFail($id); \n return $salesorder;\n }", "function ol_get_order_by_id_db( $id ) {\n\tglobal $ol_dbh;\n\n\t$stmt = $ol_dbh->prepare( 'SELECT * FROM mstore_order WHERE id = :id' );\n\t$stmt->bindParam( ':id', $id );\n\t$stmt->execute();\n\n\treturn $stmt->fetch();\n}", "public function getPaymentDetailsByBillID($billid)\n {\n//WHEN ((paid_by = \"cash\")) THEN amount\n//WHEN ((paid_by = \"cash\") and amount_exchange!=0) THEN srampos_sale_currency.amount*srampos_sale_currency.currency_rate\n//ELSE 0 END) Cash,\n//\n//SUM(DISTINCT CASE\n//WHEN ((paid_by = \"CC\")) THEN amount\n//\n//ELSE 0 END) CC\n//from srampos_payments\n//join\n $query = \"select srampos_payments.*,bill_number, \" . $this->db->dbprefix('bils') . \".reference_no as sale_ref, \n\t\t SUM(DISTINCT CASE\n\t\t WHEN ((srampos_payments.paid_by = 'cash') AND (srampos_sale_currency.currency_id=2) AND (srampos_sale_currency.amount!='')) THEN srampos_payments.amount\n\t\n\t\t\tWHEN ((srampos_payments.paid_by = 'cash' AND srampos_sale_currency.currency_id=1 AND srampos_sale_currency.amount!='')) THEN (srampos_sale_currency.amount*srampos_sale_currency.currency_rate) ELSE 0 END) TotalCash,\n\t\t \n\t\t SUM(DISTINCT CASE\n\t\t\tWHEN \" . $this->db->dbprefix('payments') . \".paid_by = 'CC' THEN {$this->db->dbprefix('payments')}.amount ELSE 0 END) TotalCC,\n\t\t {$this->db->dbprefix('bils')}.paid as For_Ex,type, {$this->db->dbprefix('payments')}.id as id,{$this->db->dbprefix('payments')}.bill_id,\n\t\t SUM(DISTINCT CASE\n\t\t\tWHEN ((srampos_payments.paid_by = 'cash') AND (srampos_sale_currency.currency_id=2) AND (srampos_sale_currency.amount!='')) THEN srampos_payments.amount ELSE 0 END) as Cash,\n\t\t \n\t\t SUM(DISTINCT CASE\n\t\t\tWHEN ((srampos_payments.paid_by = 'cash') AND (srampos_sale_currency.currency_id=1) AND (srampos_sale_currency.amount!='')) THEN srampos_payments.amount_exchange ELSE 0 END) as amt_exchange,\n\t\t \n\t\t SUM(DISTINCT CASE\n\t\t\tWHEN ((srampos_payments.paid_by = 'cash') AND (srampos_sale_currency.currency_id=1) AND (srampos_sale_currency.amount!='')) THEN srampos_payments.amount_exchange ELSE 0 END) as amt_exchange,\n\t\t\t\n\t\t SUM(DISTINCT CASE\n\t\t WHEN \" . $this->db->dbprefix('payments') . \".paid_by = 'CC' THEN {$this->db->dbprefix('payments')}.amount ELSE 0 END) as CC,\n\t\t {$this->db->dbprefix('bils')}.paid as For_Ex,{$this->db->dbprefix('bils')}.total_pay,{$this->db->dbprefix('bils')}.balance\n\t\t \n\t\t \n \n\t\tfrom srampos_bils\n\t\tJOIN srampos_payments ON srampos_payments.bill_id = srampos_bils.id\n\t\tJOIN srampos_sale_currency ON srampos_sale_currency.bil_id = srampos_bils.id\n \n\t\twhere bill_id = \".$billid.\" group by srampos_bils.id\";//where bill_id = \".$billid.\" \n\t$q = $this->db->query($query);\n\t//print_r($q->result());exit;\n if ($q->num_rows() > 0) {\n return $q->row();\n }\n return FALSE;\n }", "function getCartByCustomerID($arg, $key) {\n $result = performApiRequest($key, 2, 'GET', '*;WHERE `kundennummer`=' . $arg);\n if (sizeof($result) > 0) {\n return $result[0];\n } else {\n return null;\n }\n}", "public function getOrder($order_id = '')\n {\n return $this->get($order_id);\n }", "function findBillByUnitId($unit_id)\n{\n return array(\n \"transaction_id\"=>20,\n \"unit_id\"=>$unit_id,\n \"template_id\"=>50,\n \"payments\"=>array(\n array(\n \"name\"=>\"payment1\",\n \"description\"=>\"desc1\",\n \"formulas\"=>array(\n \"\",\n \"\",\n \"{bankLoan}*2\"\n ),\n )\n ),\n \"variables\"=>array(\n array(\n array(\"name\"=>\"bankLoan\", \"value\"=>5000),\n array(\"name\"=>\"bankSide\", \"value\"=>10000)\n )\n )\n );\n}", "function allBill($id, $connection)\r\n{\r\n $sql = ('SELECT id, quantity, created,price\r\n FROM bill\r\n WHERE user_id = :user_id\r\n ORDER BY 1');\r\n\r\n $data_bill = array(\r\n 'user_id' => $id\r\n );\r\n\r\n $stmt = $connection->prepare($sql);\r\n $stmt->execute($data_bill);\r\n\r\n $list = $stmt->fetchALL();\r\n\r\n return $list;\r\n}", "public function getInvoices($orderNumber);" ]
[ "0.7116409", "0.6705355", "0.65325767", "0.65033567", "0.6438503", "0.6401737", "0.6298349", "0.6290003", "0.62855387", "0.62850654", "0.6002898", "0.59949803", "0.597733", "0.5960275", "0.59479284", "0.59034765", "0.58884764", "0.5876099", "0.5873581", "0.58627117", "0.5858213", "0.58441824", "0.58297825", "0.5828225", "0.579677", "0.5781569", "0.57689226", "0.57588476", "0.5756203", "0.5755803" ]
0.7317539
0
Return current setting value by setting id
public function getValue($setting_id) { $Setting = $this->get($setting_id); if (!$Setting) { return null; } return $Setting->getCurrentValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSetting()\n {\n return $this->setting;\n }", "function setting() {\r\n return $setting[''];\r\n }", "public function getSetting()\n\t{\n\t\treturn $this->setting;\n\t}", "final public function value( $setting_key = 'default' ) {\n\t\tif ( isset( $this->settings[ $setting_key ] ) ) {\n\t\t\treturn $this->settings[ $setting_key ]->value();\n\t\t}\n\t}", "function get_setting ($dbc, $setting) {\n \n $q = \"SELECT * FROM settings WHERE label = '$setting'\";\n $r = mysqli_query($dbc, $q); \n \n $data = mysqli_fetch_assoc($r);\n return $data['value']; \n \n }", "public function getsetting($key){\n return $this->settings[$key];\n}", "function setting($key) {\n $CI = get_instance();\n $resp = '';\n $res = $CI->db->select('value')->from(TAB_SETTINGS)->where('key', $key)->get()->row();\n if(isset($res->value)) {\n $resp = $res->value;\n }\n return $resp;\n}", "public function get(string $key): Setting;", "function get_control_value_by_id( $id ) {\n $db = Zend_Registry::get( 'db' );\n return $db->fetchOne( 'SELECT control_value FROM Controls WHERE id = ' . $id );\n}", "function ivan_get_option( $id ) {\r\n\tglobal $iv_local_opts;\r\n\r\n\tif(!isset($iv_local_opts[$id]))\r\n\t\treturn null;\r\n\r\n\t$value = $iv_local_opts[$id];\r\n\r\n\t// Used to overwrite a few properties defined in metabox\r\n\tif(is_singular()) {\r\n\t\t$_val = ivan_get_post_option( $id . '-local' );\r\n\r\n\t\tif('' != $_val && null != $_val) {\r\n\t\t\t$value = $_val;\r\n\t\t}\r\n\t}\r\n\r\n\t//return apply_filters('ivan_get_option_filter', $value, $id);\r\n\treturn apply_filters('ivan_get_option_filter_' . $id , $value);\r\n}", "function getSettingById($setting_id)\n {\n //$this->db->select('setting_id,setting_name,setting_value');\n $this->db->select('site_content_id,site_content_name,site_content_description');\n $this->db->where('site_content_id',$setting_id);\n return $this->db->get('site_content')->result_array();\n }", "function getSetting($settingName) {\n\n\trequire $_SERVER['DOCUMENT_ROOT'].\"/core/backend/db.php\";\n\n\t$query = \"SELECT setting, value FROM settings\";\n\n\t$value = \"null\";\n\n\tif ($stmt = $db->prepare($query)) {\n\n\t\t/* execute statement */\n\t\t$stmt->execute();\n\n\t\t/* bind result variables */\n\t\t$stmt->bind_result($settingNameDB, $valueDB);\n\n\t\t/* fetch values */\n\t\twhile ($stmt->fetch()) {\n\t\t\tif ($settingNameDB == $settingName) {\n\t\t\t\t$value = $valueDB;\n\t\t}\n\t}\n\n\t/* close statement */\n\t$stmt->close();\n\n\treturn $value;\n\t}\n}", "protected function _getSettingValue($key)\n\t{\n\t\t$setting_name = 'addons.triggmine.'.$key;\n\t\treturn Registry::get($setting_name);\n\t}", "public static function get_value($field)\n {\n return DB::table('settings')->where('userId', Auth::user()->id)->value($field);\n }", "function getConfig($id) {\n switch ($id) {\n case \"dummy\":\n return \"dummy\";\n default:\n $ret=self::$nettop_settings_page->getOption($id);;\n if (empty($ret)) {$ret=null;}\n return $ret;\n }\n }", "function getVal($section, $ref_id) {\n\t\tglobal $role_default_array;\n\t\tif (!$ref_id) {\n\t\t\t$ref_id=0;\n\t\t}\n\t\tif (USE_PFO_RBAC) {\n\t\t\treturn $this->getSetting($section, $ref_id) ;\n\t\t} else {\n\t\t\tif (array_key_exists($section, $this->setting_array)) {\n\t\t\t\treturn $this->setting_array[$section][$ref_id];\n\t\t\t} else {\n\t\t\t\treturn 0 ;\n\t\t\t}\n\t\t}\n\t}", "public static function get_settings_dataItem($id){\n return self::select('id','settings','created_at')\n ->where('id',$id)\n ->first();\n }", "function setting($key) {\n $setting = \\Ajifatur\\FaturHelper\\Models\\Setting::where('code','=',$key)->first();\n return $setting ? $setting->content : '';\n }", "public function get_setting($name) {\n return $this->settings[$name];\n }", "public static function get_setting($setting_name)\n\t{\n\t\t$setting = ee('Model')->get('hop_new_relic:Hnp_settings')->filter('name', $setting_name)->first();\n\t\tif ($setting)\n\t\t{\n\t\t\treturn $setting->value;\n\t\t}\n\t\treturn NULL;\n\t}", "public function getSettings()\n {\n global $wpdb;\n $table_name = $wpdb->prefix . \"wos_settings\";\n $settings = $wpdb->get_results(\"SELECT * FROM $table_name WHERE id=1 LIMIT 1\");\n return $settings[0];\n }", "public function get_setting_key(){\n\t\treturn $this->v_setting_key;\n\t}", "public function get_val( $control_id, $control_sub = null ) {\n\t\tif ( empty( $control_sub ) ) {\n\t\t\treturn $this->get_settings()[ $control_id ];\n\t\t} else {\n\t\t\treturn $this->get_settings()[ $control_id ][ $control_sub ];\n\t\t}\n\t}", "public function settings($settings = NULL) {\n if ($settings === NULL) {\n $s = $this->belongs_to('SetlistSettings', 'settings_id')->find_one();\n if ($s) {\n return $s->extract();\n } else {\n return SetlistSettings::$default;\n }\n } else {\n return $this->settings_id = SetlistSettings::getID($settings);\n // Don't forget to save\n }\n }", "public function find($settingId) \n {\n return $this->setting->find($settingId);\n }", "abstract public function get_value( $id );", "public function getSettingById()\n {\n return $this->db->get_where('profile', ['id_profil' => 1])->row_array();\n }", "public static function get($setting) {\n return self::$settings_list->get($setting);\n }", "public function getValue($name) {\n\t\t\tforeach($this->contents as $c){\n\t\t\t\tif(get_class($c) == 'at\\foundation\\core\\Settings\\SettingValue' && $c->getName() == $name) {\n\t\t\t\t\treturn $c;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} \n\t\t\treturn null;\n\t\t}", "public function getSetting($name)\n\t{\n\t\treturn $this->db->GetOne(\"SELECT value FROM account_user_settings WHERE user_id=? AND `name`=?\",\n\t\t\tarray($this->id, $name)\n\t\t);\n\t}" ]
[ "0.69776267", "0.6911843", "0.6858744", "0.6851218", "0.6804562", "0.65957", "0.6589914", "0.65761894", "0.65249395", "0.64031637", "0.63995373", "0.6372389", "0.6355126", "0.6354581", "0.63274854", "0.6318112", "0.6306743", "0.62612545", "0.6242009", "0.6240483", "0.6238914", "0.6226899", "0.62192965", "0.6210223", "0.620691", "0.62000096", "0.61870354", "0.61405724", "0.61276734", "0.6123912" ]
0.72327626
0
Get an account of player. Return the array like [player, balance].
public function getAccount($player) { $player = addslashes($player); $exec = $this->get("`player`, `balance`", "WHERE `player`='{$player}'"); if (!$exec) return null; return $exec->fetch_array(MYSQLI_ASSOC); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBalance($player) {\n return doubleval($this->getAccount($player)['balance']);\n }", "public function getAccount($wallet)\n {\n }", "public function getAccount() {\n\t\t\n\t}", "public function getAccount()\n {\n return $this->account;\n }", "public function getAccount()\n {\n return $this->account;\n }", "public function getAccount()\n {\n return $this->account;\n }", "public function getAccount()\n {\n return $this->account;\n }", "public function getAccount()\n {\n return $this->account;\n }", "public function getAccount()\n {\n return $this->account;\n }", "public function getAccount(){\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$query = $db->select()\n\t\t->from( array('a'=>'account'), array('id','name','number','orientation') )\n\t\t->join(array( 'at'=>'accountType' ), 'a.accountTypeid=at.id', array('accountTypeName'=>'at.name'))\t\t\n\t\t->where('a.id=?',$this->getId());\t\t\n\n\t\t$results = $db->fetchAll( $query );\n\t\t$container = array();\t\t\n\t\tif( isset( $results ) ){\n\t\t\t$container = array_shift($results);\n\t\t\treturn $container;\n\t\t}\n\t\telse{\n\t\t return null;\n\t\t}\t\n\t}", "public function getSavingAccountById() {\n $query = 'SELECT * FROM ' . $this->table . ' WHERE id = :id';\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':id', $this->id);\n $stmt->execute();\n $result = Utility::stmtToArray($stmt);\n $this->balance = $result[0]['balance'];\n $this->interest_rate = $result[0]['interest_rate'];\n $this->user_id = $result[0]['user_id'];\n return $result;\n }", "public function createAccount($player) {\n /**\n * Process input\n */\n $player = addslashes($player);\n $balance = \"0.0\";\n $playerAPI = new PlayerAPI($player);\n\n return $this->exec(\n sprintf(\n /** @lang text */ \"INSERT INTO `%s` (`player`, `balance`, `uuid`) VALUES ('%s', '%s', '%s')\",\n $this->getTable(),\n $player,\n $balance,\n $playerAPI->getUUID()\n )\n );\n }", "public function accountGetBalance()\n {\n return $this->sendAPIRequest('GET',\"/account/balance\");\n }", "public function getAccounts(): array;", "public function getAccount()\n\t\t{\n\t\t return $this->account;\n\t\t}", "public function getStatsAccount()\n {\n return $this->get('stats/account.json');\n }", "function getMoney($playerID) {\n $row = select('online_user', 'money', $playerID, 'playerID');\n return $row['money'];\n }", "public function account() {\n\t\t$accountInfo = $this->bitcasaClientApi->getBitcasaAccountDataApi()->requestAccountInfo();\n \treturn $accountInfo;\n }", "protected function getAccount() {\n return $this->accountProxy->getAccount();\n }", "public function getAccount()\n {\n\n \t\t\n $query=$this->db->get('account');\n\t\t return $query->result();\n }", "public function account()\n {\n return $this->account;\n }", "public function getAccountBalance($account)\n {\n }", "public function account() : Account\n {\n return $this->account;\n }", "public function getAccount() {\r\n\t\t$response = $this->_sendRequest ( null, self::$endpoints ['Account'], 'GET' );\r\n\t\treturn $response;\r\n\t}", "public function getAccount(): string\n {\n return $this->account;\n }", "private function _getAccount()\n {\n $box = $this->_getBox();\n\n return $box->getCurrentAccount();\n }", "public function getAccountBalance()\n\t{\n\t\t$nonce = $this->getNonce();\n\n\t\t$params = array(\n\t\t\t'key' => $this->apiKey,\n\t\t\t'nonce' => $nonce,\n\t\t\t'signature' => $this->getSignature($nonce)\n\t\t);\n\n\t\t$request = new Request(static::ACCOUNT_BALANCE_URL);\n\t\t$request->setTrustedCertificate(CertificateHelper::getCaInfoFile());\n\t\t$response = $request->post($params);\n\n\t\treturn json_decode($response->getResponse(), TRUE);\n\t}", "public function retrieveAccountInfo()\n {\n $sql = \"SELECT UserID, ver_code\n FROM users\n WHERE Username=:user\";\n try\n {\n $stmt = $this->_db->prepare($sql);\n $stmt->bindParam(':user', $_SESSION['Username'], PDO::PARAM_STR);\n $stmt->execute();\n $row = $stmt->fetch();\n $stmt->closeCursor();\n return array($row['UserID'], $row['ver_code']);\n }\n catch(PDOException $e)\n {\n return FALSE;\n }\n }", "public function get_account() {\n\t\t$response = $this->send_request( 'GET', '/account' );\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn $response;\n\t}", "public function getAccount()\n {\n return $this->readOneof(1);\n }" ]
[ "0.7027674", "0.641575", "0.6378845", "0.6356809", "0.6356809", "0.6356809", "0.6356809", "0.6356809", "0.6356809", "0.6345127", "0.6274371", "0.6241163", "0.62258816", "0.6219161", "0.62173593", "0.6171917", "0.6157676", "0.6149941", "0.6134774", "0.60661894", "0.6051563", "0.60382336", "0.6010135", "0.6010114", "0.60080373", "0.5986217", "0.5981093", "0.5952417", "0.59476787", "0.5930337" ]
0.83209985
0
Update the balance of player
public function updateBalance($player, $balance) { $player = addslashes($player); $balance = addslashes($balance); return $this->exec( sprintf(/** @lang text */ "UPDATE `%s` SET `balance`='%s' WHERE `player`='%s'", $this->getTable(), $balance, $player) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateWalletBalance()\n\t{\n\t # Load subscription model\n\t $this->load->model('user_subscription', 'subscription');\n\t \n\t $subscriptions = $this->subscription->get_subscriptions();\n\t \n\t # Loop through subscriptions\n\t \n\t if(!empty($subscriptions))\n\t {\n\t $queryArray = array();\n\t \n\t foreach ($subscriptions as $sub)\n\t {\n\t # Get user Id\n\t $userId = $sub->user_id;\n\t \n\t # Get Item Id\n\t $itemId = $sub->item_id;\n\t \n\t # Load membership model\n\t $this->load->model('membership_model', 'membership');\n\t \n\t # Get credit points based on item id\n\t $result = $this->membership->get_membership_by_id($itemId);\n\t \n\t # credit points \n\t $creditPoints = $result->{Membership_model::_CREDIT_POINT};\n\t \n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $userProfile = $this->user->getUserProfile($userId);\n\t \n\t # Get wallet balance\n\t \n\t $walletPoints = $userProfile->{User::_PCT_WALLET_AMOUNT};\n\t \t \n\t $amount = $walletPoints == 0 ? $creditPoints : ($creditPoints + $walletPoints);\n\t \n\t # Update wallet amount\n\t $this->user->update_pct_wallet_amount($userId, $amount);\n\t \n\t array_push($queryArray, $this->db->last_query());\n\t \n\t }\n\t \n\t pre($queryArray);\n\t \n\t }\n\t \n\t}", "protected function syncBalance(): void\n {\n $data = view('xml_templates.privat_bank.data')->render();\n $sign = sha1(md5($data.$this->merchantPassword));\n $xml = view('xml_templates.privat_bank.body', [\n 'merchantId' => $this->merchantId,\n 'sign' => $sign,\n 'data' => $data,\n ])->render();\n\n $response = $this->requestApi(static::PRIVAT_BANK_API_BALANCE_URI, $xml);\n\n /** @var SimpleXMLElement $object */\n $object = simplexml_load_string($response);\n $balanceObject = $object->data->info->cardbalance->av_balance;\n $balance = (double) ((array) $balanceObject)[0];\n\n $this->balance = $balance;\n }", "function takeBet(){\n $playerID = getPlayerID();\n $player = unserialize($_SESSION['sessionPlayer']);\n $row = select(\"online_user\", \"money\", $playerID, 'playerID');\n $conn = makeConnection();\n $newAmount = $row['money'] - 10;\n // if the player doesn't have enough money to bet, kick them from the game\n if ($newAmount < 0) {\n //leave_game($player->getName());\n }\n else {\n $player->setMoney($newAmount);\n $sql = \"UPDATE online_user SET money = $newAmount WHERE $playerID = playerID\";\n $conn->query($sql);\n $_SESSION['sessionPlayer'] = serialize($player);\n }\n }", "public function update_user_coins_final_balance($user_id,$final_gift_coins){\n\t\t\n\t\t $sql_123=\"update users set gift_coins=gift_coins+'$final_gift_coins' where id='$user_id'\";\n\t\t\t\t\tmysqli_query($this->_con, $sql_123);\n\t\t\t\t\t\n\t\t\n\t}", "public function update_gift_coins_final_balance($user_id,$final_gift_coins){\n\t\t\n\t\t $sql_123=\"update users set gift_coins='$final_gift_coins' where id='$user_id'\";\n\t\t\t\t\tmysqli_query($this->_con, $sql_123);\n\t\t\t\t\t\n\t\t\n\t}", "public function refreshBalance()\n {\n $new_total = $this->entries()->sum('amount_cents');\n $this->update(['total_cents' => $new_total]);\n }", "public function updateBalance()\n {\n $all = \\App\\Models\\DM3tree::all();\n foreach($all as $d)\n {\n echo $d;\n $keluarga = \\App\\Models\\DM3tree::descendantsOf($d)->count();\n echo \"<br>Keluarga : \".$keluarga;\n echo \"<br> \";\n \n \n if($keluarga <= 3125)\n $d['balance'] = $keluarga*8;\n else\n $d['balance'] = 3125*8;\n \n $d['logs'] = $keluarga*2;\n \n $d->save(); \n }\n }", "public function updateWallet($userId, $balance)\r\n\t{\r\n\t\t$this->find(array('id' => $userId))->update(array('wallet' => $balance));\r\n\t}", "function addMoney($player, $money) {\n $playerID = getPlayerID();\n $conn = makeConnection();\n $sql = \"SELECT money FROM online_user WHERE '$playerID' = playerID\";\n $result = $conn->query($sql);\n $row = mysqli_fetch_array($result);\n $newAmount = $row['money'] + $money;\n $player->setMoney($newAmount);\n $conn = makeConnection();\n $sql = \"UPDATE online_user SET money = '$newAmount' WHERE '$playerID' = playerID\";\n $conn->query($sql);\n $player->addWin();\n $_SESSION['sessionPlayer'] = serialize($player);\n }", "public function updateAccount() {\n $query = 'UPDATE ' . $this->table . '\n SET\n balance = :balance,\n interest_rate = :interest_rate\n WHERE\n id = :id';\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':balance', $this->balance);\n $stmt->bindParam(':interest_rate', $this->interest_rate);\n $stmt->bindParam(':id', $this->id);\n if($stmt->execute()) return true;\n printf(\"Error: %s.\\n\", $stmt->error);\n return false;\n }", "function updateMoney()\n{\n global $conn,$phoneNumber,$level,$balance;\n //checking the balance first\n $sql_balance = \"SELECT balance FROM customer WHERE phoneNumber='$phoneNumber'\";\n $query_balance = mysqli_query($conn, $sql_balance);\n $row_balance = mysqli_fetch_array($query_balance);\n\n $newBalance = $row_balance[0]-$level[4];\n\n //updating new balance\n $sql_update_balance = \"UPDATE customer SET balance='$newBalance' WHERE phoneNumber='$phoneNumber'\";\n $query_balance_update = mysqli_query($conn, $sql_update_balance);\n\n if ($query_balance_update) {\n //selecting recipient balance\n $sql_recipient = \"SELECT balance FROM customer WHERE phoneNumber='$level[3]'\";\n $query_recipient = mysqli_query($conn, $sql_recipient);\n $row_recipient = mysqli_fetch_array($query_recipient);\n\n //new balance to recipient\n $newRecipientBalance = $row_recipient[0]+$level[4];\n\n //updating balance\n $sql_recipient_update = \"UPDATE customer SET balance='$newRecipientBalance' WHERE phoneNumber='$level[3]'\";\n $query_recipient_update = mysqli_query($conn, $sql_recipient_update);\n if ($query_recipient_update) {\n echo \"Tsh.$level[4] has been successfully sent to mobile number: $level[3]\";\n } else {\n echo \"System out of service\";\n }\n }\n}", "public function getBalance($player) {\n return doubleval($this->getAccount($player)['balance']);\n }", "public function update() {\n\t\t\t$objectid = $this->InstanceID;\n\t\t\t$account = $this->ReadPropertyString(\"account\");\n\t $skodata = json_decode(file_get_contents(\"https://api.corrently.io/v2.0/stromkonto/balances?account=\".$account));\n\n\t // Check if we have all required Profiles\n\n\t if(!IPS_VariableProfileExists(\"WattHours\")) {\n\t IPS_CreateVariableProfile (\"WattHours\", 1);\n\t IPS_SetVariableProfileDigits (\"WattHours\", 0);\n\t IPS_SetVariableProfileText (\"WattHours\", \"\", \"Wh\");\n\t }\n\n\t if(!IPS_VariableProfileExists(\"Gramm\")) {\n\t IPS_CreateVariableProfile (\"Gramm\", 1);\n\t IPS_SetVariableProfileDigits (\"Gramm\", 0);\n\t IPS_SetVariableProfileText (\"Gramm\", \"\", \"g\");\n\t }\n\n\t if(!IPS_VariableProfileExists(\"WattHoursPerAnno\")) {\n\t IPS_CreateVariableProfile (\"WattHoursPerAnno\", 1);\n\t IPS_SetVariableProfileDigits (\"WattHoursPerAnno\", 0);\n\t IPS_SetVariableProfileText (\"WattHoursPerAnno\", \"\", \"wha\");\n\t }\n\n\t if(!IPS_VariableProfileExists(\"GreenPowerIndex\")) {\n\t IPS_CreateVariableProfile (\"GreenPowerIndex\", 1);\n\t IPS_SetVariableProfileDigits (\"GreenPowerIndex\", 0);\n\t IPS_SetVariableProfileText (\"GreenPowerIndex\", \"\", \"gsi\");\n\t }\n\t foreach($skodata as $subaccount) {\n\t $variation = $subaccount->variation;\n\n\t $id_variation = @IPS_GetObjectIDByName($variation, $objectid);\n\t $profile = \"\";\n\t if($variation == 'gsb') $profile = \"WattHours\";\n\t if($variation == 'eigenstrom') $profile = \"WattHours\";\n\t if($variation == 'co2') $profile = \"Gramm\";\n\t if($variation == 'erzeugung') $profile = \"WattHoursPerAnno\";\n\t if($variation == 'gsi') $profile = \"GreenPowerIndex\";\n\n\t if(!$id_variation) {\n\t $id_variation = IPS_CreateCategory();\n\t IPS_SetName($id_variation, $variation);\n\t IPS_SetParent($id_variation, $objectid);\n\t }\n\n\t if(isset($subaccount->saldo)) {\n\t $id_saldo = @IPS_GetObjectIDByName(\"saldo\", $id_variation);\n\t if(!$id_saldo) {\n\t $id_saldo = IPS_CreateVariable(1);\n\t IPS_SetName($id_saldo, \"saldo\");\n\t IPS_SetParent($id_saldo, $id_variation);\n\t IPS_SetVariableCustomProfile ($id_saldo, $profile);\n\t }\n\t SetValue($id_saldo,$subaccount->saldo);\n\t }\n\n\t if(isset($subaccount->soll)) {\n\t $id_soll = @IPS_GetObjectIDByName(\"soll\", $id_variation);\n\t if(!$id_soll) {\n\t $id_soll = IPS_CreateVariable(1);\n\t IPS_SetName($id_soll, \"soll\");\n\t IPS_SetParent($id_soll, $id_variation);\n\t IPS_SetVariableCustomProfile ($id_soll, $profile);\n\t }\n\t SetValue($id_soll,$subaccount->soll);\n\t }\n\n\t if(isset($subaccount->haben)) {\n\t $id_haben = @IPS_GetObjectIDByName(\"haben\", $id_variation);\n\t if(!$id_haben) {\n\t $id_haben = IPS_CreateVariable(1);\n\t IPS_SetName($id_haben, \"haben\");\n\t IPS_SetParent($id_haben, $id_variation);\n\t IPS_SetVariableCustomProfile ($id_haben, $profile);\n\t }\n\t SetValue($id_haben,$subaccount->haben);\n\t }\n\t }\n\t\t}", "private function updateclientbalance() {\n\n $response = $this->login(true);\n if ($response[RESPONSE] == \"1\") {\n $login = $this->_request['clientusername'];\n\n include_once $_SERVER[\"DOCUMENT_ROOT\"] . \"/classes/reseller_class.php\";\n $resClsObj = new reseller_class();\n\n $clientUserId = $resClsObj->getUserId($login);\n $param['toUserEditFund'] = $clientUserId;\n $param['fundAmount'] = trim($this->_request['receivingAmount']);\n $param['balance'] = trim($this->_request['balance']);\n $param['partialAmt'] = trim($this->_request['partialAmt']);\n\n $action = trim($this->_request['action']);\n if ($action == \"1\") {\n $param['changefunderEditFund'] = \"add\";\n } elseif ($action == \"0\") {\n $param['changefunderEditFund'] = \"reduce\";\n }\n\n\n $param['otherPaymentType'] = trim($this->_request['otherPaymentType']);\n\n $paymentType = trim($this->_request['paymentType']);\n\n if ($paymentType == \"0\") {\n $param['pType'] = \"prepaid\";\n } elseif ($paymentType == \"1\") {\n $param['pType'] = \"partial\";\n } elseif ($paymentType == \"2\")\n $param['pType'] = \"postpaid\";\n\n\n $paymentMode = trim($this->_request['paymentMode']);\n\n if ($paymentMode == \"0\") {\n $param['fundPaymentType'] = \"Cash\";\n } elseif ($paymentMode == \"1\") {\n $param['fundPaymentType'] = \"Memo\";\n } elseif ($paymentMode == \"2\") {\n $param['fundPaymentType'] = \"Bank\";\n } elseif ($paymentMode == \"3\")\n $param['fundPaymentType'] = \"Other\";\n else\n $param['fundPaymentType'] = \"Cash\";\n\n $param['fundDescription'] = trim($this->_request['description']);\n $param['fundCurrency'] = trim($this->_request['amountCurrency']);\n $param['partialCurrency'] = trim($this->_request['partialAmtCurrency']);\n\n $fundResponse = $resClsObj->editFund($param, $response[CONTENT]['id']);\n $fundResponse = json_decode($fundResponse);\n\n\n if ($fundResponse->status == \"success\") {\n $error[RESPONSE] = \"1\";\n } else {\n $error[RESPONSE] = \"0\";\n }\n $error[MESSAGE]['code'] = '101';\n $error[MESSAGE]['message'] = $fundResponse->msg;\n $this->response($this->json($error), 200);\n exit();\n\n// if (empty($login) || strlen($login) < 5) {\n// $error = array(RESPONSE => \"0\", MESSAGE => \"Incomplete Details Username Must be more than 5 Character\");\n//\t\t\t\t$this->response($this->json($error), 200);\n//\t\t\t\texit();\n//\t\t\t}\n//\n//\t\t\t$amount = $this->_request['amount'];\n//\t\t\tif (empty($amount) || !is_numeric($amount) || $amount < 0) {\n//\t\t\t\t$error = array(RESPONSE => \"0\", MESSAGE => \"Incomplete Details Amount Must be more than 0\");\n//\t\t\t\t$this->response($this->json($error), 200);\n//\t\t\t\texit();\n//\t\t\t}\n//\t\t\t$type = $this->_request['type'];\n//\t\t\tif (empty($type) || strlen($type) < 3) {\n//\t\t\t\t$error = array(RESPONSE => \"0\", MESSAGE => \"Incomplete Details Type Must be provide\");\n//\t\t\t\t$this->response($this->json($error), 200);\n//\t\t\t\texit();\n//\t\t\t}\n//\t\t\tif (($type != \"add\" && $type != \"reduce\")) {\n//\t\t\t\t$error = array(RESPONSE => \"0\", MESSAGE => \"Incomplete Details Transfer-type must be add or reduce\");\n//\t\t\t\t$this->response($this->json($error), 200);\n//\t\t\t\texit();\n//\t\t\t}\n//\n//\t\t\t\n// $login = $funobj->db->real_escape_string($login);\n//\t\t\t$funobj->db->select('id_client,account_state')->from('clientsshared')->where(\" id_reseller = '\" . $response[\"id\"] . \"' and login= '\" . $login . \"' \");\n//\t\t\t$result = $funobj->db->execute();\n//\t\t\tif ($result->num_rows > 0) {\n//\t\t\t\twhile ($row = $result->fetch_array(MYSQL_ASSOC)) {\n//\t\t\t\t\t$current_balance = $row[\"account_state\"];\n//\t\t\t\t\t$trans_tuserid = $row[\"id_client\"];\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\telse if ($result->num_rows == 0) {\n//\t\t\t\t$error = array(RESPONSE => \"0\", MESSAGE => \"Unable to fetch client details.\");\n//\t\t\t\t$this->response($this->json($error), 200);\n//\t\t\t\texit();\n//\t\t\t}\n//\t\t\t\n//\t\t\tif($type==\"add\")\n//\t\t\t\t$newBalance = $current_balance + $amount;\n//\t\t\telse if($type==\"reduce\")\n//\t\t\t\t$newBalance = $current_balance - $amount;\n//\t\t\t\n//\t\t\tif($newBalance <0)\n//\t\t\t{\n//\t\t\t\t$error = array(RESPONSE => \"0\", MESSAGE => \"User Do not have this much amount to reduce.\");\n//\t\t\t\t$this->response($this->json($error), 200);\n//\t\t\t\texit();\n//\t\t\t}\n//\t\t\t$data = array('account_state' => $newBalance);\n//\t\t\t$funobj->db->update('clientsshared', $data)->where(\"id_reseller = '\" . $response[\"id\"] . \"' and login= '\" . $login . \"' \");\n//\t\t\t$updateQry=$funobj->db->getQuery();\n//\t\t\t$result = $funobj->db->execute();\t\t\t\t\n//\t\t\t\n//\t\t\tif ($funobj->db->affected_rows == 1) {\n//\t\t\t\t$data=array(\"trans_fuserid\"=>$response[\"id\"] , \"trans_tuserid\"=>$trans_tuserid, \"trans_amt\"=>$amount, \"trans_crnt_amt\"=>$current_balance, \"trans_date\"=>date(\"Y-m-d H:i:s\"),\" trans_type\"=>$type);\n//\t\t\t\t$table = 'reseller_transaction';\n//\t\t\t\t$funobj->db->insert($table, $data);\n//\t\t\t\t$insertQry=($funobj->db->getQuery());\n//\t\t\t\t$logresult = $funobj->db->execute();\n//\t\t\t\t$batchId=\"\";\n//\t\t\t\tif($logresult && $funobj->db->affected_rows == 1)\n//\t\t\t\t{\n//\t\t\t\t\t$returnResult = array(RESPONSE => \"1\", MESSAGE => \"Update Successfully\");\n//\t\t\t\t\t$this->response($this->json($returnResult), 200);\n//\t\t\t\t}\n//\t\t\t\telse{\n//\t\t\t\t\tmail(\"[email protected]\",\"Phone91 transaction Log\",\"Error While inserting trans log in db\");\n//\t\t\t\t\t$returnResult = array(RESPONSE => \"1\", MESSAGE => \"Update Successfully but error occur duing inserting log. Update: \".$updateQry.\" Insert qry \".$insertQry);\n//\t\t\t\t\t$this->response($this->json($returnResult), 200);\n//\t\t\t\t}\n//\t\t\t\n//\t\t\t\n//\t\t\t\t\n//\t\t\t} else {\n//\t\t\t\t$error = array(RESPONSE => \"0\", MESSAGE => \"Unable to update at this time\");\n//\t\t\t\t$this->response($this->json($error), 200);\n//\t\t\t}\n }\n $error = array(RESPONSE => \"0\", MESSAGE => \"Incomplete Details\");\n $this->response($this->json($error), 200);\n }", "public function update_user_balance($return_credit,$user_id)\r\n\t{\r\n\t\t$this->db->select('balance');\r\n\t\t$query = $this->db->get_where('members', array('id'=>$user_id));\r\n\t\t$user_balance = $query->row();\r\n\t\t\r\n\t\t$user_total_balance = $user_balance->balance+$return_credit;\r\n\t\t\r\n\t\t//update user balance\r\n\t\t$data=array('balance'=>$user_total_balance);\r\n\t\t$this->db->where('id',$user_id);\r\n\t\t$this->db->update('members', $data);\r\n\t}", "public function updateRating()\n {\n $completed = User::battles()->completed()->get();\n $this->wins = 0;\n $this->defeats = 0;\n\n foreach($completed as $battle){\n if($battle->votes_rapper1 > $battle->votes_rapper2){\n if($battle->rapper1_id == $this->id){\n $this->wins += 1;\n } else {\n $this->defeats += 1;\n }\n } else if($battle->votes_rapper1 < $battle->votes_rapper2){\n if($battle->rapper1_id == $this->id){\n $this->defeats += 1;\n } else {\n $this->wins += 1;\n }\n }\n }\n\n $this->rating = $this->wins * 3 + $this->defeats;\n $this->save();\n }", "static function onPurschaseRoyalCoins(Account $account, Player $player){\n\t \n $royal = 1200;\n \n\t $query = \\Core\\Main::$DB->query(\"SELECT `value` FROM `player_storage` WHERE `key` = '\".\\Core\\Consts::PLAYER_STORAGE_ROYAL_COINS.\"' AND `player_id` = '{$player->getId()}'\");\n\t \n\t if($query->numRows() > 0){\n $result = $query->fetch();\n \n if($result->value > 0)\n $royal += $result->value;\n \n \\Core\\Main::$DB->query(\"UPDATE `player_storage` SET `value` = '{$royal}' WHERE `key` = '\".\\Core\\Consts::PLAYER_STORAGE_ROYAL_COINS.\"' AND `player_id` = '{$player->getId()}'\");\n\t }\n\t else\n\t \\Core\\Main::$DB->query(\"INSERT INTO `player_storage` VALUES ('{$player->getId()}', '\".\\Core\\Consts::PLAYER_STORAGE_ROYAL_COINS.\"', '{$royal}')\");\n \n return array(\"success\" => true);\n\t}", "function fn_update_partner_balance($partner_id, $amount, $action = '+')\n{\n $amount = floatval($amount);\n\n if ($amount < 0) {\n $amount = 0;\n }\n\n if (empty($partner_id) || empty($amount) || !in_array($action, array('+', '-'))) {\n return false;\n }\n\n $partner = fn_get_partner_data($partner_id);\n\n if (empty($partner)) {\n return false;\n }\n\n if ($action == '-' && $amount > $partner['balance']) {\n $text = '<hr />';\n $text .= __('payment') . \": $amount<br />\";\n $text .= __('affiliate') . \": $partner[firstname] $partner[lastname]<br />\";\n $text .= __('balance_account') . \": $partner[balance]\";\n fn_set_notification('E', __('error'), __('error_payout_gt_balance') . $text);\n\n return false;\n }\n\n return db_query(\"UPDATE ?:aff_partner_profiles SET balance = balance $action $amount WHERE user_id = ?i\", $partner_id);\n}", "public function \tUpdatePlayerStats($player) {\n\t\t\t\n\t\t\t$this->updatePlayerRankingPie($player);\n\t\t\t$this->updatePlayerFavoriteColorPie($player);\n\t\t\t$this->updatePlayerRankingEvolution($player);\n\t\t}", "function add_balance($userid, $amount) {\n $original_balance = $this->get_balance($userid);\n $balance_after_addition = $original_balance + $amount;\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare(\"UPDATE student SET edollar = :balance WHERE userid = :userid\");\n \n $stmt->bindParam(\":balance\", $balance_after_addition);\n $stmt->bindParam(\":userid\", $userid);\n \n $success = $stmt->execute();\n \n return $success;\n }", "function update_bani($username,$bani) {\n $query=\"UPDATE username SET money='$bani' WHERE username='$username';\";\n $results=conectare_DB($query);\n}", "public function updateBalance(Transaction $transaction)\n {\n $this->balance+=$transaction->ammount;\n\n $this->transactions()->create([\n \"transaction_id\"=>$transaction->id,\n \"before\"=>$this->fresh()->balance,\n \"after\"=>$this->balance,\n ]);\n\n $this->save();\n }", "function withdrawal($db, $ucid, $account, $amount)\n\n{\n\n\n $s = \"Select * from accounts where ucid='$ucid' and account='$account' and ((`balance`-'$amount')>=0.00)\";\n\n ($t = mysqli_query($db, $s)) or die(mysqli_error($db));\n\n $num = mysqli_num_rows($t);\n\n if ($num == 0)\n\n {\n\n \t //exit(\"<br>An error occurred.\");\n\n }\n\n \n\n //Insert the transaction\n\n $ins = \"insert into transactions values ('$ucid', '$amount', '$account', NOW())\";\n\n ($insert = mysqli_query($db, $ins)) or die(mysqli_error($db));\n\n //Update accounts\n\n $up = \"update accounts set balance = (balance - '$amount'), mostRecentTrans = NOW() where ucid = '$ucid' and account = '$account'\";\n\n ($update = mysqli_query($db, $up)) or die(mysqli_error($db));\n\n echo \"$amount withdrawn from $account\";\n\n}", "public function balance()\n {\n try {\n $conf = Config::load(__DIR__ . '/../config/providers.json')[$this->className];\n\n $query = array(\n 'api_key' => $conf['api_key'],\n 'api_secret' => $conf['api_secret']\n );\n\n $query = http_build_query($query);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $conf['url'] . '/account/get-balance?' . $query);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n\n $result = json_decode($result);\n\n if (is_float($result->value) || is_integer($result->value)) {\n return $this->response(200, $result, null, $this->className);\n } else {\n return $this->response(500, $result, null, $this->className);\n }\n } catch (Exception $e) {\n\n }\n }", "public function balance(): float\n {\n return (float) $this->isValid() ? $this->response->object()->data->balance / 100\n : 0;\n }", "public function handle()\n {\n DB::update(\"UPDATE users_vcs set amount = amount + 0.25\");\n }", "public function playerSaveScore()\n {\n $this->player->addScore($this->getRoundScore());\n $this->setRoundTurn(\"computer\");\n $this->resetRoundScore();\n }", "public function updateBalance(int $amount, bool $isCredit)\n {\n $this->balance += ($isCredit) ? $amount : -$amount;\n $this->save();\n }", "function deposit($db, $ucid, $account, $amount)\n\n{\n\n $s = \"Select * from accounts where ucid = '$ucid' and account = '$account' and balance + '$amount' >= 0.00\";\n\n ($t = mysqli_query($db, $s)) or die(mysqli_error($db));\n\n $num = mysqli_num_rows($t);\n\n if ($num == 0)\n\n {\n\n \t//exit(\"<br>An error occurred.\");\n\n }\n\n \n\n //Insert the transaction\n\n $inst = \"insert into transactions values ('$ucid', '$amount', '$account', NOW())\";\n\n ($insert = mysqli_query($db, $inst)) or die(mysqli_error($db));\n\n //Update accounts\n\n $up = \"update accounts set balance = balance + '$amount', mostRecentTrans = NOW() where ucid = '$ucid' and account = '$account'\";\n\n ($update = mysqli_query($db, $up)) or die(mysqli_error($db));\n\n echo \"$amount deposited into $account\";\n\n}", "public function saveAndUpdateBalance(VendLog $vendLog);" ]
[ "0.7100276", "0.6668214", "0.66575503", "0.6436735", "0.6408569", "0.63913965", "0.63005555", "0.622288", "0.61963415", "0.6160351", "0.6103781", "0.6075418", "0.6037293", "0.6026765", "0.6010141", "0.6004577", "0.5980913", "0.5966613", "0.58583164", "0.58377826", "0.58265674", "0.5815788", "0.5731949", "0.56759924", "0.5660396", "0.56290543", "0.5627283", "0.5569008", "0.55557376", "0.5554904" ]
0.7507297
0
Get balance of player, return as float value
public function getBalance($player) { return doubleval($this->getAccount($player)['balance']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBalance(): float\n {\n $value = Transaction::where('user_id', $this->user->getId())->sum('value');\n return number_format($value, 2);\n }", "public function balance(): float\n {\n return (float) $this->isValid() ? $this->response->object()->data->balance / 100\n : 0;\n }", "public function get_balance()\n {\n $k = 'balance';\n return ($this->_call('user', null, true) && isset($this->_response[$k]))\n ? (float)$this->_response[$k]\n : false;\n }", "public function getBalance()\n {\n // Build request object\n $request = new OpenSRS_Request(\"balance\", \"get_balance\");\n\n // Send request\n $response = $this->_openrsr->send($request);\n\n // Get response attributes\n $attr = $response->getAttributes();\n\n // Return balance as float\n return (float) $attr[\"balance\"];\n }", "public function getBalance()\n {\n return $this->balance;\n }", "public function getBalance()\n {\n return $this->balance;\n }", "public function getBalance()\n {\n return $this->balance;\n }", "public function getTrialBalance(): float\n {\n $trialBalance = 0;\n\n foreach ($this->records as $record) {\n if (true === $record->is_debit) {\n $trialBalance -= $record->amount;\n } else {\n $trialBalance += $record->amount;\n }\n }\n\n return (float)$trialBalance;\n }", "public function balance(): Money\n {\n return $this->transactions()->balance();\n }", "public function getWalletAmount(): float\n {\n return $this->walletAmount;\n }", "public function getBalance(){\n return $this->_balance;\n }", "public function getBalance()\n\t{\n\t\treturn $this->Balance;\n\t}", "public function getBalance()\n {\n }", "function get_balance() {\n\t\trequire '../config.php';\n\t\t$con = mysqli_connect($hostname, $dbusername, $dbpassword, $dbname);\n\t\tglobal $currentfbid;\n\t\t$query = \" SELECT balance FROM data WHERE fbid = '$currentfbid' \";\n\t\t$result = mysqli_query($con, $query);\n\t\t$row = mysqli_fetch_array($result);\n\t\tmysqli_close($con);\n\t\treturn $row[0];\n\t}", "public function getBalance()\n {\n $store = Mage::app()->getStore();\n if ($store->getCurrentCurrencyCode()===$this->getCert()->getCurrencyCode()) {\n return $store->formatPrice($this->getCert()->getBalance(), true, false);\n } else {\n return $store->convertPrice($this->getCert()->getBaseBalance(), true, false);\n }\n }", "public function balance()\n {\n try {\n $conf = Config::load(__DIR__ . '/../config/providers.json')[$this->className];\n\n $query = array(\n 'api_key' => $conf['api_key'],\n 'api_secret' => $conf['api_secret']\n );\n\n $query = http_build_query($query);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $conf['url'] . '/account/get-balance?' . $query);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n\n $result = json_decode($result);\n\n if (is_float($result->value) || is_integer($result->value)) {\n return $this->response(200, $result, null, $this->className);\n } else {\n return $this->response(500, $result, null, $this->className);\n }\n } catch (Exception $e) {\n\n }\n }", "public function getBalance()\n\t{\n\t\t$request\t= $this->makeRequest('get_balance');\n\t\t$request\t= explode(':', $request);\n\t\treturn $request[1];\n\t}", "public function getAmount(): float;", "function get_current_balance()\r\n\t{\r\n\t\t//Balu A\r\n\t\treturn $this->cache[$this->set_current_balance()];\r\n\t}", "public function getBalance()\n {\n $body = ['method' => 'getbalance'];\n $balance = $this->_request($body);\n return $balance;\n }", "public function getAmount(): float\n {\n return $this->amount;\n }", "public function getAmount(): float\n {\n return $this->amount;\n }", "public function getAmount(): float\n {\n return $this->amount;\n }", "public function accountGetBalance()\n {\n return $this->sendAPIRequest('GET',\"/account/balance\");\n }", "public function walletBalance()\n {\n return $this->get('/api/wallet-balance/');\n }", "public function getWalletBalance($wallet)\n {\n }", "public function getTransactionAmount() : float;", "public function getDepositTotal(): float\n {\n return $this->depositTotal;\n }", "public function getMoney(): int\n {\n return $this->getStat('money')->value;\n }", "public function balance()\n {\n $response = $this->get('balance/');\n return $this->parse($response);\n }" ]
[ "0.8039071", "0.80191344", "0.7460067", "0.74430734", "0.7140589", "0.7140589", "0.7140589", "0.7065213", "0.70282984", "0.7007614", "0.69236505", "0.68878716", "0.66594625", "0.665114", "0.66349643", "0.658804", "0.65724903", "0.6563006", "0.65411735", "0.65377676", "0.6485744", "0.6485744", "0.6485744", "0.64098626", "0.64012283", "0.63971835", "0.6374509", "0.63577646", "0.63312703", "0.6326603" ]
0.8196597
0
Return a list of the available campaign themes
public function campaign_themes() { $campaign_theme = [ 'antarctic' => __( 'Antarctic', 'planet4-master-theme-backend' ), 'arctic' => __( 'Arctic', 'planet4-master-theme-backend' ), 'climate' => __( 'Climate Emergency', 'planet4-master-theme-backend' ), 'forest' => __( 'Forest', 'planet4-master-theme-backend' ), 'oceans' => __( 'Oceans', 'planet4-master-theme-backend' ), 'oil' => __( 'Oil', 'planet4-master-theme-backend' ), 'plastic' => __( 'Plastics', 'planet4-master-theme-backend' ), ]; return $campaign_theme; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getThemes();", "public function getThemes();", "function cohort_get_list_of_themes() {\n $themes = array();\n $allthemes = get_list_of_themes();\n foreach ($allthemes as $key => $theme) {\n if (empty($theme->hidefromselector)) {\n $themes[$key] = get_string('pluginname', 'theme_'.$theme->name);\n }\n }\n return $themes;\n}", "public function availableThemes() {\n static $options;\n if (empty($options)) {\n $packages = PackageManager::getActivePackageConfigs();\n $options = [];\n foreach($packages ?? [] as $packageConfig) {\n if ($packageConfig->is_theme) {\n $options[] = $packageConfig->name;\n }\n }\n }\n\n return $options;\n }", "public static function getThemes() {\n \t$themes = Zibo::getInstance()->getConfigValue(self::CONFIG_THEMES, array());\n\n \t$list = array();\n \tforeach ($themes as $name => $parameters) {\n \t\tif (array_key_exists(self::CONFIG_NAME, $parameters)) {\n $list[$name] = $parameters[self::CONFIG_NAME];\n \t\t} else {\n $list[$name] = $name;\n \t\t}\n \t}\n\n \treturn $list;\n }", "function getThemes() {\n\t\treturn $this->themes;\n\t}", "public static function getAllThemes() {\n\t\t$themeNames = Mage::getSingleton('core/design_package')->getThemeList();\n\t\t$themes = array();\n\t\t$controller = new SPThemeController();\n\n\t\tforeach($themeNames as $packageName => $themeNames) {\n\t\t\tforeach($themeNames as $themeName) {\n\t\t\t\t$theme = $controller->generateTheme($themeName, $packageName);\n\t\t\t\tarray_push($themes, $theme);\n\t\t\t}\n\t\t}\n\n\t\treturn $themes;\n\t}", "public function getThemes()\n {\n return $this->themeRegistry->getThemes();\n }", "public function allThemes() {\n $self = $this;\n return array_map(function ($theme) use ($self) {\n return $self->getTheme($theme->name);\n }, $this->themes);\n }", "public function getAllThemeNames();", "function getActiveThemes()\r\n {\r\n $themelist = array();\r\n $dir = opendir(MIGUELBASE_THEME_DIR);\r\n\r\n while ($item = readdir ($dir)){\r\n if($item != '.' && $item != '..' && $item != 'CVS' && !is_file($item)){\r\n $themelist[\"$item\"] = $item;\r\n }\r\n }\r\n closedir($dir);\r\n\r\n return $themelist;\r\n }", "function getThemesFeatured(){\r\n\t\treturn apply_filters('wpupdate_themesFeatured',array('results'=>array(),'info'=>array()));\r\n\t}", "public function getThemesList()\n\t{\n\t\t$themes = array();\n\t\t@chmod( TIMBER_ROOT . TIMBER_THEMES_DIR , 0755);\n\t\t$dirs = @scandir( TIMBER_ROOT . TIMBER_THEMES_DIR );\n\n\t\tif( $dirs === false ){\n\t\t\treturn array();\n\t\t}\n\n\t\tforeach ( $dirs as $dir ) {\n\t\t\tif ( $dir === '.' || $dir === '..'){ continue; }\n\t\t\t$dir = strtolower($dir);\n\t\t\tif ( $dir != preg_replace('/[^a-z0-9]/i', '', $dir) ){ continue; }\n\t\t\tif ( (is_dir(TIMBER_ROOT . TIMBER_THEMES_DIR . '/' . $dir)) && (is_file(TIMBER_ROOT . TIMBER_THEMES_DIR . '/' . $dir . '/info.php')) ) {\n\t\t\t\t$themes[] = $dir;\n\t\t\t}\n\t\t}\n\t\treturn $themes;\n\t}", "public function getThemeConfigs() {\n\n }", "public function available()\n\t{\n\t\t$theme_path = public_path() . '/themes';\n\t\t$themes = array();\n\t\tif (is_dir($theme_path)) {\n\t\t\tforeach(scandir($theme_path) as $dir_content) {\n\t\t\t\tif (is_dir($theme_path . '/' . $dir_content) AND $dir_content != '.' AND $dir_content != '..') {\n\t\t\t\t\tif (file_exists($theme_path . '/' . $dir_content . '/theme.php')) {\n\t\t\t\t\t\t$themes[$dir_content] = require $theme_path . '/' . $dir_content . '/theme.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $themes;\n\t}", "function GetThemes() {\n return include GetSysResPath('themes.conf.php', 'themes');\n}", "public function listCssThemes()\n {\n $cssPath = $this->getThemeCssPath();\n $files = glob($cssPath . '/*-theme.css');\n $arr = [];\n foreach ($files as $file) {\n $name = basename($file);\n $arr[$name] = str_replace('-theme.css', '', $name);\n }\n return $arr;\n }", "function get_themes( $host, $path = '' ) {\n\t$cache = new vvv_dash_cache();\n\n\tif ( ( $themes = $cache->get( $host . '-themes', VVV_DASH_THEMES_TTL ) ) == false ) {\n\n\t\t$themes = shell_exec( 'wp theme list --path=' . VVV_WEB_ROOT . '/' . $host . $path . ' --format=csv' );\n\n\t\t// Don't save unless we have data\n\t\tif ( $themes ) {\n\t\t\t$status = $cache->set( $host . '-themes', $themes );\n\t\t}\n\t}\n\n\treturn $themes;\n}", "public function index()\n {\n return new ThemeResourceCollection(Theme::all());\n }", "public function getTheme();", "public function getTheme();", "public function getTheme();", "public function listThemes(){\n\t\tforeach ($this->themes_list as $key => $value) {\n\t\t\techo '<a href=\"index.php?theme='. $key .'\" class=\"list-group-item';\n\t\t\tif ($this->theme == $key){ echo ' active';}\n\t\t\techo '\">'.$value.'</a>'; \n }\n\t}", "public function getThemes($idCategory){\n $sql = \"SELECT t.id, t.title FROM theme t\n WHERE t.category=\".intval($idCategory).\";\";\n $res = mysqli_query($this->link, $sql);\n $themes = mysqli_fetch_all($res);\n return $themes;\n }", "public function getThemes()\n {\n $limit = (isset($this->requestParams['limit']) ? $this->requestParams['limit'] : 10);\n $page = (isset($this->requestParams['page']) ? $this->requestParams['page'] : 1);\n\n if ($limit <= 0) {\n throw new PushApiException(PushApiException::INVALID_RANGE, \"Invalid limit value\");\n }\n\n if ($page < 1) {\n throw new PushApiException(PushApiException::INVALID_RANGE, \"Invalid page value\");\n }\n\n if (!$theme = Theme::getThemes($limit, $page)) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n\n $this->send($theme);\n }", "public function getThemesData()\n\t{\n\t\treturn $this->themes_data;\n\t}", "public function all()\n {\n $list = [];\n\n /** @var UniformResourceLocator $locator */\n $locator = $this->grav['locator'];\n\n $iterator = $locator->getIterator('themes://');\n\n /** @var DirectoryIterator $directory */\n foreach ($iterator as $directory) {\n if (!$directory->isDir() || $directory->isDot()) {\n continue;\n }\n\n $theme = $directory->getFilename();\n\n try {\n $result = $this->get($theme);\n } catch (Exception $e) {\n $exception = new RuntimeException(sprintf('Theme %s: %s', $theme, $e->getMessage()), $e->getCode(), $e);\n\n /** @var Debugger $debugger */\n $debugger = $this->grav['debugger'];\n $debugger->addMessage(\"Theme {$theme} cannot be loaded, please check Exceptions tab\", 'error');\n $debugger->addException($exception);\n\n continue;\n }\n\n if ($result) {\n $list[$theme] = $result;\n }\n }\n ksort($list, SORT_NATURAL | SORT_FLAG_CASE);\n\n return $list;\n }", "public static function get_all()\n\t{\n\t\tif ( !isset( self::$all_themes ) ) {\n\t\t\t$dirs = array( FILMIO_PATH . '/system/themes/*' , FILMIO_PATH . '/3rdparty/themes/*', FILMIO_PATH . '/user/themes/*' );\n\t\t\tif ( Site::is( 'multi' ) ) {\n\t\t\t\t$dirs[] = Site::get_dir( 'config' ) . '/themes/*';\n\t\t\t}\n\t\t\t$themes = array();\n\t\t\tforeach ( $dirs as $dir ) {\n\t\t\t\t$themes = array_merge( $themes, Utils::glob( $dir, GLOB_ONLYDIR | GLOB_MARK ) );\n\t\t\t}\n\n\t\t\t$themes = array_filter( $themes, function($a) {return file_exists( $a . \"/theme.xml\" );} );\n\t\t\t$themefiles = array_map( 'basename', $themes );\n\t\t\tself::$all_themes = array_combine( $themefiles, $themes );\n\t\t}\n\t\treturn self::$all_themes;\n\t}", "function fetch_theme()\n {\n global $chosen;\n return $chosen;\n }", "function theme_colors()\n { \n return theme_facilities('colors');\n }" ]
[ "0.77761555", "0.77761555", "0.7497434", "0.7077458", "0.69871664", "0.6852809", "0.68254167", "0.67137337", "0.6641141", "0.6585037", "0.652823", "0.6525876", "0.6491703", "0.6485806", "0.6479418", "0.6466876", "0.6453334", "0.6442478", "0.64189893", "0.6411226", "0.6411226", "0.6411226", "0.6385027", "0.6370598", "0.63682103", "0.6333305", "0.6282906", "0.62599975", "0.62078315", "0.6201566" ]
0.7886939
0
Add metabox for campaign page template selection on campaigns cpt
public function campaign_page_templates_meta_box() { add_meta_box( 'campaigns-page-templates', __( 'Campaign Templates', 'planet4-master-theme-backend' ), array( $this, 'campaign_page_templates_meta_box_callback' ), 'campaign', 'side' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function campaign_page_templates_meta_box_callback( $post ) {\n\n\t\t\t// Add a nonce field so we can check for it later.\n\t\t\twp_nonce_field( 'campaign_page_template_nonce_' . $post->ID, 'campaign_page_template_nonce' );\n\n\t\t\t$value = get_post_meta( $post->ID, '_campaign_page_template', true );\n\n\t\t\t$campaign_templates = $this->campaign_themes();\n\t\t\t?>\n\t\t\t<select id=\"campaign_page_template\" name=\"campaign_page_template\">\n\t\t\t\t<option value=\"\"><?php _e( 'Default Template', 'planet4-master-theme-backend' ); ?>\n\t\t\t\t</option>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $campaign_templates as $campaign => $campaign_template ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<option value=\"<?php echo $campaign; ?>\" <?php selected( $value, $campaign ); ?>>\n\t\t\t\t\t<?php echo $campaign_template; ?>\n\t\t\t\t\t</option>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t\t<?php\n\t\t}", "function metabox() {\n\t\t$this->print_nonce();\n?>\t<p>\n<?php\t\t$this->print_menu_select( $this->field_name, genesis_get_custom_field( $this->field_name ), 'width: 99%;' ); ?>\n\t</p>\n<?php\t}", "function page_team_option_metabox() {\n\t$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];\n\t// Get the name of the Page Template file.\n\t$template_file = get_post_meta($post_id, '_wp_page_template', true);\n\tif($template_file == 'page-team.php'){\n\t\t$screens = array( 'page');\n\t\tforeach ( $screens as $screen ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'page_team',\n\t\t\t\t__( 'Team Options', 'sidebar_textdomain' ),\n\t\t\t\t'page_team_callback',\n\t\t\t\t$screen\n\t\t\t);\n\t\t}\n\t}\n}", "function wptShowMetabox($post, $args = array())\n {\n $params = array (\n 'label' => 'Customers',\n 'roles' => array (\n 'subscriber'\n ) );\n\n if (isset($args ['args'])) {\n $params = array_merge($params, $args ['args']);\n }\n ?>\n <p>\n <?php\n $post->post_author = intval($post->post_author);\n $model = PratsRoomtypes::getModel('users');\n foreach ($params ['roles'] as $role) {\n $model->setRole($role);\n }\n $model->setOrder('display_name', 'asc');\n $users = $model->debug(0)->getList();\n\n // Prepare the html\n ?>\n <select id=\"select2-authordiv\" name=\"post_author_override\" onchange=\"getCustomerDetails('<?php echo wp_create_nonce(\"user_address\"); ?>')\">\n <option value=\"\"><?php echo __('Select a '.$params['label']); ?></option>\n <?php\n foreach ($users as $user)\n {\n ?>\n <option value=\"<?php echo $user->ID; ?>\"\n <?php\n echo ($user->ID == $post->post_author ? ' selected' : '');\n ?>><?php echo $user->display_name; ?>\n </option><?php\n }\n ?>\n </select>\n </p>\n <p><input type=\"checkbox\" name=\"create_new_account\" value=\"1\" onChange=\"jQuery('#create_new_account_table').toggle();\" /><?php echo __('Create a new account'); ?></p>\n <table id=\"create_new_account_table\" style=\"display: none;\">\n <tr>\n <td>First name : </td>\n <td><input type=\"text\" name=\"first_name\" value=\"\" /></td>\n <td>Last name : </td>\n <td><input type=\"text\" name=\"last_name\" value=\"\" /></td>\n </tr>\n <tr>\n <td>Email : </td>\n <td><input type=\"text\" name=\"email\" value=\"\" /></td>\n <td>Password : </td>\n <td><input type=\"password\" name=\"password\" value=\"\" /></td>\n </tr>\n </table>\n\n <input type=\"hidden\" name=\"users_meta_noncename\"\n id=\"users_meta_noncename\"\n value=\"<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>\" />\n <?php\n }", "function royal_add_contact_page_options() {\n\t\tadd_meta_box(\n\t\t\t'royal_contact_page_options',\n\t\t\tesc_html__( 'Page Template: Contact', 'hyperx' ),\n\t\t\t'royal_display_contact_page_options',\n\t\t\t'page',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\t}", "function add_theme_template_meta_box() \n{\n add_meta_box(\n 'post_gallery',\n 'Template Uploader',\n 'post_theme_template_option',\n 'post',\n 'normal',\n 'core'\n );\n}", "function themetek_meta_box_portfolio_templates() {\n\t\t\tglobal $post;\n\t\t\t// Add an nonce field so we can check for it later\n\t\t\twp_nonce_field( 'themetek_meta_box_portfolio_templates', 'themetek_meta_box_portfolio_templates_nonce' );\n\t\t\t// Retrieve an existing value from the database and use the value for the form.\n\t\t\t$values = get_post_custom( $post->ID );\n\t\t\t$selected = isset( $values['page_portfolio_style'] ) ? esc_attr( $values['page_portfolio_style'][0] ) :'';\n\n\t\t\t// Display portfolio item template styles\n\t\t\techo '<div class=\"tek_meta_block meta_block_top\">';\n\t\t\t\techo '<select name=\"page_portfolio_style\" id=\"page_portfolio_style\">';\n\t\t\t\t\techo '<option value=\"single-full\" '.esc_attr(selected( $selected, 'single-full' )).'>Single image full width</option>';\n\t\t\t\t\techo '<option value=\"single-side\" '.esc_attr(selected( $selected, 'single-side' )).'>Single image side</option>';\n\t\t\t\t\techo '<option value=\"gallery-full\" '.esc_attr(selected( $selected, 'gallery-full' )).'>Gallery full width</option>';\n\t\t\t\t\techo '<option value=\"gallery-side\" '.esc_attr(selected( $selected, 'gallery-side' )).'>Gallery side</option>';\n\t\t\t\t\techo '<option value=\"gallery-list\" '.esc_attr(selected( $selected, 'gallery-list' )).'>Gallery list</option>';\n\t\t\t\techo '</select>';\n\t\t\techo '</div>';\n\t\t}", "public function setup(){\n $metad = array(\n array(\n 'name' => 'access',\n 'title' => __( 'Acces manager', 'pwp' ),\n //'callback'=> '',\n 'post_type' => array('post','page'),\n 'elements' => array(\n\n \n \n\n array(\n 'type' => 'select',\n 'name' => 'access',\n 'params'=> array(\n 'label' => __( 'Allow access to:', 'pwp' ),\n 'comment' => __('Content of this page are restricted to only this user group','pwp'),\n'class'\t => 'large-text block',\n\t\t'options' => $this->get_roles(),\n\t\t\t 'default' => 'logged_in'\n\t\t\n ),\n ),\n )\n )\n );\n foreach( $metad as $box ){\n new Metabox( $box );\n }\n}", "function metaboxes() {\n\t\t\n\t\tadd_meta_box('contact_information', 'Contact Information', array( $this, 'contact_information' ), $this->pagehook, 'main', 'high');\n\n\t\tadd_meta_box( 'website_options', 'Website Options', array( $this, 'website_options' ), $this->pagehook, 'main' );\n\n\t\tadd_meta_box( 'social_media_accounts', 'Social Media Accounts', array( $this, 'social_media_accounts' ), $this->pagehook, 'main' );\n\t\t\n\t}", "function construction_footer_metabox(){\n\n\t/**\n\t * Sample metabox to demonstrate each field type included\n\t */\n\t$cmb_demo = new_cmb2_box( array(\n\t\t'id' => construction_get_prefix('ft-metabox'),\n\t\t'title' => esc_html__( 'Footer Settings', 'construction' ),\n\t\t'object_types' => array( 'page' ), // Post type\n\t\t// 'show_on_cb' => 'construction_show_if_front_page', // function should return a bool value\n\t) );\n\n\t$cmb_demo->add_field( array(\n\t 'name' => esc_html__('Show Newsletter','construction'),\n\t 'desc' => esc_html__('show Newsletter (optional)','construction'),\n\t 'id' => construction_get_prefix('show-newsletter'),\n\t 'type' => 'select',\n 'options' => array(\n \t'no' => esc_html__('No, Please!', 'construction'),\n \t'1' => esc_html__('Yes, Please!', 'construction'),\n \t'global' => esc_html__('Inherit From Theme Options','construction')\n ),\n 'default' => '1'\n\n\t) );\n\t\n}", "function trtheme_contact_page_common_options() {\n global $theme_metas;\n $panel = $theme_metas->createMetaBox( array(\n 'name' => 'Contact Form Info',\n 'post_type' => ['page']\n ) );\n $today = date(\"Y-m-d\");\n\n $panel->createOption( array(\n 'name' => '',\n 'type' => 'note',\n 'desc' => 'Note that, This group of meta informations will be only used for Contact page template.',\n 'default' => ''\n ) );\n $panel->createOption( array(\n 'name' => 'Form Title',\n 'id' => 'contact_form_title',\n 'type' => 'text',\n 'desc' => 'Enter the title for contact form.'\n ) );\n $panel->createOption( array(\n 'name' => 'Form Summary',\n 'id' => 'contact_form_summary',\n 'type' => 'textarea',\n 'desc' => 'Enter the contact form summary content which is going to display right after the contact form title.'\n ) );\n $panel->createOption( array(\n 'name' => 'Sidebar Content',\n 'id' => 'contact_sidebar_content',\n 'type' => 'editor',\n 'desc' => 'Enter the contact form sidebar content which is going to display on right side of the contact. It allows any kinds of markup by the default editor.'\n ) );\n}", "public function dashboard_membership_metabox() {\r\n\t\t$this->view( 'dashboard/welcome/pro-membership-meta-box', array() );\r\n\t}", "function campaign_register_metabox() {\n $prefix = '_ppm_';\n\n /**\n * Sample metabox to demonstrate each field type included\n */\n \n $post_meta = new_cmb2_box( array(\n 'id' => $prefix . 'post_metabox',\n 'title' => __( 'Post Meta', 'cmb2' ),\n 'object_types' => array( 'page'), // Post type\n 'show_on' => array('key'=>'child_of','value'=>array(4)),\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n // 'cmb_styles' => false, // false to disable the CMB stylesheet\n // 'closed' => true, // true to keep the metabox closed by default\n ) );\n\n $menus = get_registered_nav_menus();\n\n foreach ( $menus as $location => $description ) {\n $options[$location] = $description;\n }\n\n $post_meta->add_field( array(\n 'name' => 'Menu Select',\n 'desc' => 'Select a menu to show',\n 'id' => $prefix.'menu_select',\n 'type' => 'select',\n 'show_option_none' => true,\n 'default' => 'custom',\n 'options' => $options,\n ) );\n\n $post_meta->add_field( array(\n 'name' => 'Section Class',\n 'desc' => 'Enter section class',\n 'id' => $prefix.'section_class',\n 'type' => 'text',\n 'default' => 'col-md-6',\n ) );\n\n $post_meta->add_field( array(\n 'name' => 'View More Link',\n 'desc' => 'Enter view more link',\n 'id' => $prefix.'section_link',\n 'type' => 'text',\n ) );\n\n $products_meta = new_cmb2_box( array(\n 'id' => $prefix . 'products_metabox',\n 'title' => __( 'Products Meta', 'cmb2' ),\n 'object_types' => array( 'isis-product'), // Post type\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n // 'cmb_styles' => false, // false to disable the CMB stylesheet\n // 'closed' => true, // true to keep the metabox closed by default\n ) );\n\n $products_meta->add_field( array(\n 'name' => 'Product Subtitle',\n 'desc' => 'Enter the product subtitle',\n 'id' => $prefix.'product_subtitle',\n 'type' => 'text'\n ) );\n\n $industries_meta = new_cmb2_box( array(\n 'id' => $prefix . 'industries_metabox',\n 'title' => __( 'Industries Meta', 'cmb2' ),\n 'object_types' => array( 'industry'), // Post type\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n // 'cmb_styles' => false, // false to disable the CMB stylesheet\n // 'closed' => true, // true to keep the metabox closed by default\n ) );\n\n $industries_meta->add_field( array(\n 'name' => 'Industry Subtitle',\n 'desc' => 'Enter the industry subtitle',\n 'id' => $prefix.'industry_subtitle',\n 'type' => 'text'\n ) );\n\n $support_meta = new_cmb2_box( array(\n 'id' => $prefix . 'support_metabox',\n 'title' => __( 'Support Meta', 'cmb2' ),\n 'object_types' => array( 'page'), // Post type\n 'show_on' => array('key'=>'child_of','value'=>array(54)),\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n // 'cmb_styles' => false, // false to disable the CMB stylesheet\n // 'closed' => true, // true to keep the metabox closed by default\n ) );\n\n\n $support_meta->add_field( array(\n 'name' => 'Support Resources Title',\n 'desc' => 'Enter section title',\n 'id' => $prefix.'resource_title',\n 'type' => 'text',\n ) );\n\n $support_meta->add_field( array(\n 'name' => 'Support Resources Intro',\n 'desc' => 'Enter section intro',\n 'id' => $prefix.'resource_intro',\n 'type' => 'textarea',\n ) );\n\n $support_meta->add_field( array(\n 'name' => 'Support Premium Resources Title',\n 'desc' => 'Enter section title',\n 'id' => $prefix.'resource_premium_title',\n 'type' => 'text',\n ) );\n\n $support_meta->add_field( array(\n 'name' => 'Support Premium Resources Intro',\n 'desc' => 'Enter section intro',\n 'id' => $prefix.'resource_premium_intro',\n 'type' => 'textarea',\n ) );\n\n $video_meta = new_cmb2_box( array(\n 'id' => $prefix . 'video_metabox',\n 'title' => __( 'Video Meta', 'cmb2' ),\n 'object_types' => array( 'videos'), // Post type\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n // 'cmb_styles' => false, // false to disable the CMB stylesheet\n // 'closed' => true, // true to keep the metabox closed by default\n ) );\n\n\n $video_meta->add_field( array(\n 'name' => 'Video Description',\n 'desc' => 'Enter text to introduce video',\n 'id' => $prefix.'video_description',\n 'type' => 'textarea',\n ) );\n\n $video_meta->add_field( array(\n 'name' => 'Video Duration',\n 'desc' => 'Enter enter video duration (2:01s)',\n 'id' => $prefix.'video_duration',\n 'type' => 'text',\n ) );\n\n $header_meta = new_cmb2_box( array(\n 'id' => $prefix . 'header_metabox',\n 'title' => __( 'Header Meta', 'cmb2' ),\n 'object_types' => array( 'page'), // Post type\n 'context' => 'side',\n 'priority' => 'low',\n 'show_names' => true, // Show field names on the left\n // 'cmb_styles' => false, // false to disable the CMB stylesheet\n // 'closed' => true, // true to keep the metabox closed by default\n ) );\n\n\n $header_meta->add_field( array(\n 'name' => 'Button Text',\n 'desc' => 'Enter section class',\n 'id' => $prefix.'header_text',\n 'type' => 'text',\n ) );\n\n $header_meta->add_field( array(\n 'name' => 'Button Link',\n 'desc' => 'Enter button link',\n 'id' => $prefix.'header_link',\n 'type' => 'text',\n ) );\n\n\n}", "function cromax_add_paypal_metabox() {\n\tglobal $post_type, $post;\t\n\n\tinclude ('templates/invoicescreen.php');\n}", "function cfcpt_meta_box() {\n\t\techo '\n\t\t\t<input type=\"hidden\" name=\"cfcpt\" value=\"1\" />\n\t\t\t';\n\t}", "function addMetaBoxe(){\n global $post;\n $template_file = get_post_meta($post->ID,'_wp_page_template',TRUE);\n if ($template_file == $this->templateName) {\n $id = \"metaPage\" . $this->name;\n $title = $this->title;\n add_meta_box($id, $title, array( $this, 'displayMetaBoxe' ), \"page\");\n } \n }", "function metaboxes() {\n\t\tadd_meta_box('uvasom-settings', 'UVA SOM Site Settings', array( $this, 'uvasom_settings_meta_box' ), $this->pagehook, 'main', 'high');\n\t}", "public function register_campaigns_metaboxes() {\n\t\t\t$prefix = 'sc_ch_';\n\t\t\t$themes = $this->campaign_themes();\n\t\t\t// Add default Greenpeace logo to array.\n\t\t\t$themes['greenpeace'] = __( 'Greenpeace', 'planet4-master-theme-backend' );\n\n\t\t\t$header_palette = [\n\t\t\t\t'#E5E5E5',\n\t\t\t\t'#32CA89',\n\t\t\t\t'#1BB6D6',\n\t\t\t\t'#22938D',\n\t\t\t\t'#186A70',\n\t\t\t\t'#043029',\n\t\t\t\t'#093944',\n\t\t\t\t'#042233',\n\t\t\t\t'#1A1A1A',\n\t\t\t];\n\n\t\t\t$nav_palette = [\n\t\t\t\t'#FFFFFF',\n\t\t\t\t'#E5E5E5',\n\t\t\t\t'#66CC00',\n\t\t\t\t'#32CA89',\n\t\t\t\t'#1BB6D6',\n\t\t\t\t'#22938D',\n\t\t\t\t'#186A70',\n\t\t\t\t'#043029',\n\t\t\t\t'#093944',\n\t\t\t\t'#042233',\n\t\t\t\t'#1A1A1A',\n\t\t\t\t'#1B4A1B',\n\t\t\t];\n\n\t\t\t$primary_palette = [\n\t\t\t\t'#ffd204',\n\t\t\t\t'#66cc00',\n\t\t\t\t'#6ed961',\n\t\t\t\t'#21cbca',\n\t\t\t\t'#ee562d',\n\t\t\t\t'#7a1805',\n\t\t\t\t'#2077bf',\n\t\t\t\t'#1B4A1B',\n\t\t\t];\n\n\t\t\t$secondary_palette = [\n\t\t\t\t'#042233',\n\t\t\t\t'#093944',\n\t\t\t\t'#074365',\n\t\t\t];\n\n\t\t\t$cmb = new_cmb2_box(\n\t\t\t\t[\n\t\t\t\t\t'id' => 'campaign_nav_settings_mb',\n\t\t\t\t\t'title' => __( 'Page Design', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'object_types' => [\n\t\t\t\t\t\t'campaign',\n\t\t\t\t\t],\n\t\t\t\t\t'context' => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t\t'show_names' => true, // Show field names on the left.\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'Logo',\n\t\t\t\t\t'desc' => 'Change the campaign logo',\n\t\t\t\t\t'id' => 'campaign_logo',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'default' => 'greenpeace',\n\t\t\t\t\t'options' => $themes,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'Logo Color',\n\t\t\t\t\t'desc' => 'Change the campaign logo color (if not default)',\n\t\t\t\t\t'id' => 'campaign_logo_color',\n\t\t\t\t\t'type' => 'radio_inline',\n\t\t\t\t\t'default' => 'light',\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'light' => __( 'Light', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'dark' => __( 'Dark', 'planet4-master-theme-backend' ),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Navigation', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_nav_type',\n\t\t\t\t\t'type' => 'radio_inline',\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'planet4' => __( 'Planet 4 Navigation', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'minimal' => __( 'Minimal Navigation', 'planet4-master-theme-backend' ),\n\t\t\t\t\t],\n\t\t\t\t\t'default' => 'planet4',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Navigation Background Color', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_nav_color',\n\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t'classes' => 'palette-only',\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'data-colorpicker' => wp_json_encode(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'palettes' => $nav_palette,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Navigation bottom border', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_nav_border',\n\t\t\t\t\t'type' => 'radio_inline',\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'none' => __( 'No border', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'border' => __( 'White bottom border', 'planet4-master-theme-backend' ),\n\t\t\t\t\t],\n\t\t\t\t\t'default' => 'none',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Header Text Color', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_header_color',\n\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t'classes' => 'palette-only',\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'data-colorpicker' => wp_json_encode(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'palettes' => $header_palette,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Primary Button Color', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_primary_color',\n\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t'classes' => 'palette-only',\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'data-colorpicker' => json_encode(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'palettes' => $primary_palette,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Secondary Button Color and Link Text Color', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_secondary_color',\n\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t'classes' => 'palette-only',\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'data-colorpicker' => json_encode(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'palettes' => $secondary_palette,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'Header Primary Font',\n\t\t\t\t\t'desc' => 'Select an option',\n\t\t\t\t\t'id' => 'campaign_header_primary',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'show_option_none' => '-----',\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'Anton' => __( 'Anton', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'Jost' => __( 'Jost', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'Montserrat' => __( 'Montserrat Bold', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'Montserrat_Light' => __( 'Montserrat Light', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'Sanctuary' => __( 'Sanctuary', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'Kanit' => __( 'Kanit Extra Bold', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'Save the Arctic' => __( 'Save the Arctic', 'planet4-master-theme-backend' ),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'Header Secondary Font',\n\t\t\t\t\t'desc' => 'Select an option',\n\t\t\t\t\t'id' => 'campaign_header_secondary',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'show_option_none' => '-----',\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'monsterrat_semi' => __( 'Montserrat Semi Bold', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'kanit_semi' => __( 'Kanit Semi Bold', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'open_sans' => __( 'Open Sans', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'open_sans_shadows' => __( 'Open Sans Shadows', 'planet4-master-theme-backend' ),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Body Font', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_body_font',\n\t\t\t\t\t'type' => 'radio_inline',\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'lora' => __( 'Serif', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'roboto' => __( 'Sans Serif', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'campaign' => __( 'Campaign default', 'planet4-master-theme-backend' ),\n\t\t\t\t\t],\n\t\t\t\t\t'default' => 'lora',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Footer Theme', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_footer_theme',\n\t\t\t\t\t'type' => 'radio_inline',\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'default' => __( 'Default', 'planet4-master-theme-backend' ),\n\t\t\t\t\t\t'white' => __( 'White', 'planet4-master-theme-backend' ),\n\t\t\t\t\t],\n\t\t\t\t\t'default' => 'default',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Footer links color', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'footer_links_color',\n\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t'classes' => 'palette-only',\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'data-colorpicker' => json_encode(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'palettes' => $primary_palette,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Footer item 1', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_footer_item1',\n\t\t\t\t\t'type' => 'footer_icon_link',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Footer item 2', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_footer_item2',\n\t\t\t\t\t'type' => 'footer_icon_link',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Footer item 3', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_footer_item3',\n\t\t\t\t\t'type' => 'footer_icon_link',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Footer item 4', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_footer_item4',\n\t\t\t\t\t'type' => 'footer_icon_link',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$cmb->add_field(\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Footer item 5', 'planet4-master-theme-backend' ),\n\t\t\t\t\t'id' => 'campaign_footer_item5',\n\t\t\t\t\t'type' => 'footer_icon_link',\n\t\t\t\t]\n\t\t\t);\n\t\t}", "function create_page_meta_box() {\r\nglobal $theme_name, $page_meta_boxes;\r\n\tif (function_exists('add_meta_box') ) {\r\n\tadd_meta_box( 'new-meta-boxes', __('Front Page Options', GETTEXT_DOMAIN), 'page_meta_boxes', 'page', 'normal', 'high' );\r\n\t}\r\n}", "function meta_boxes() {\n \tif ( current_user_can('unfiltered_html') ) {\n \t\t// settings page\n \t\tadd_options_page(\"WP EXCEL to PDF Converter Widget\", \"WP EXCEL to PDF Converter Widget\", 'manage_options', \"wp-xlstopdf-widget\", array('WpxlstopdfwAdmin', 'make_admin_page'));\n\t\t\t}\n }", "function resources_add_meta_box() {\r\n\r\n\t$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;\r\n\t$template_file = get_post_meta($post_id,'_wp_page_template',TRUE);\r\n\t// check for a template type\r\n\tif ($template_file == 'page-resources.php') {\r\n\r\n\t\t$screens = array( 'post', 'page' );\r\n\r\n\t\tforeach ( $screens as $screen ) {\r\n\r\n\t\t\tadd_meta_box(\r\n\t\t\t\t'resources_sectionid',\r\n\t\t\t\t__( 'Resources Page Display Options', 'resources_textdomain' ),\r\n\t\t\t\t'resources_meta_box_callback',\r\n\t\t\t\t$screen,\r\n\t\t\t\t'side'\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n}", "function simple_show_if_front_page( $cmb ) {\n // Don't show this metabox if it's not the front page template\n if ( $cmb->object_id !== get_option( 'page_on_front' ) ) {\n return false;\n }\n return true;\n}", "public function engagements_metabox()\n {\n }", "function guide_metabox() {\n \n \t// Start with an underscore to hide fields from custom fields list\n \t$prefix = '_onepage_';\n \n \t/**\n \t * Sample metabox to demonstrate each field type included\n \t */\n \t$cmb_demo = new_cmb2_box( array(\n \t\t'id' => 'guide_metabox',\n \t\t'title' => __( 'Guide Metabox', 'onepage' ),\n \t\t'object_types' => array( 'page', ), // Post type\n 'show_on' => array( 'key' => 'page-template', 'value' => 'inc/guide-page.php' ),\n //'context' =>'nomal',\n 'priority' => 'high',\n 'show_names' => true\n \t) );\n \n $cmb_demo->add_field(array(\n 'name' => __('Section ID','onepage'),\n 'id' => $prefix . 'guide_section_id',\n 'type' => 'text',\n ));\n \n $cmb_demo->add_field( array(\n 'name' => __( 'Height', 'onepage' ),\n 'desc' => __( 'Enter value in pixel if you need to set height for this section', 'onepage' ), \n 'id' => $prefix . 'guide_section_height',\n 'type' => 'text',\n ) ); \n\n\n $cmb_demo->add_field( array(\n 'name' => __( 'CTA link URL', 'onepage' ),\n 'desc' => __( 'Add link to Call to action button', 'onepage' ),\n 'id' => $prefix . 'guide_cta_url',\n 'type' => 'text',\n 'show_on_cb' => 'cmb2_hide_if_no_cats', \n ) );\n \n $cmb_demo->add_field( array(\n 'name' => __( 'CTA Text', 'onepage' ),\n 'desc' => __( 'Add text to Call to action button', 'onepage' ),\n 'id' => $prefix . 'guide_cta_text',\n 'type' => 'text',\n 'show_on_cb' => 'cmb2_hide_if_no_cats', \n ) );\n \n }", "function render_meta_tmps($post) {\r\n\r\n\t$flg = false;\r\n\t$meta_element_class = get_post_meta ( $post->ID, 'wp_template_twig', true ); // /true ensures you get just one value instead of an array\r\n\r\n\t$render_title = '<label>' . __ ( 'Choose the template:', 'wordpress-twig' ) . '</label>\r\n <select name=\"custom_element_grid_class\" id=\"custom_element_grid_class\">\r\n\t <option>default</option>';\r\n\t$dir = get_template_directory () . '/views';\r\n\t$noms = scandir ( $dir );\r\n\t$t = find_between ( $noms, $post );\r\n\t$render = '';\r\n\tforeach ( $t as $template ) {\r\n\t\t$render .= '<option value=\"' . $template [2] . '\" ' . selected ( $meta_element_class, $template [2] ) . ' >' . $template [1] . '</option>';\r\n\t}\r\n\t$render_title_fin = \"</select>\";\r\n\techo $render_title . $render . $render_title_fin;\r\n}", "function bbp_topic_subscriptions_metabox($post)\n{\n}", "function add_cpt_meta_box(){\r\n\r\n add_meta_box(\"cpt_meta_basic\", \"Custom Post Type Information\", \"cpt_basic_meta\", \"my_custom_post\", \"normal\", \"high\");\r\n\r\n}", "function cmb_page_metaboxes( array $meta_boxes ) {\n $prefix = '_cmb_';\n\n\n\n $meta_boxes['page_metabox'] = array(\n 'id' => 'page_metabox',\n 'title' => __( 'Additional Content', 'root' ),\n 'object_types' => array( 'page', 'post'), // Post type\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n //'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend\n 'fields' => array(\n array(\n 'name' => __( 'Alcím', 'root' ),\n 'desc' => __( 'Ez jelenik meg a főcím alatt a fejben', 'root' ),\n 'id' => $prefix . 'subtitle',\n 'type' => 'text',\n ),\n array(\n 'name' => 'Belső menü',\n 'desc' => 'Ez fog megjelenni a hero alatt',\n 'id' => $prefix . 'innermenu',\n 'type' => 'select',\n 'show_option_none' => false,\n 'default' => '0',\n 'options' => 'sc_show_navs'\n ),\n array(\n 'name' => __( 'Video url', 'root' ),\n 'desc' => __( 'Beágyazandó videó url-je', 'root' ),\n 'id' => $prefix . 'video',\n 'type' => 'text',\n ),\n array(\n 'name' => __( 'Kiegészítő tartalom', 'root' ),\n 'desc' => __( 'Pl. Galléria vagy Kérdő0v shortcode', 'root' ),\n 'id' => $prefix . 'addcont',\n 'type' => 'text',\n ),\n\n ),\n );\n\n\n\n\n\n $meta_boxes['home'] = array(\n 'id' => 'homemeta',\n 'title' => 'Slider & Adblock',\n 'object_types' => array( 'page'),\n 'show_on' => array( 'key' => 'page-template', 'value' => 'page-home.php' ),\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true,\n 'fields' => array (\n array (\n 'id' => 'slides',\n 'type' => 'group',\n 'description' => 'Slide show',\n 'options' => array (\n 'group_title' => 'Slide {#}',\n 'add_button' => 'Új Slide',\n 'remove_button' => 'Slide törlése',\n 'sortable' => true, // beta\n ),\n 'fields' => array(\n array (\n 'name' => 'Cím',\n 'id' => 'title',\n 'type' => 'text_medium',\n ),\n array (\n 'name' => 'Alcím',\n 'id' => 'subtitle',\n 'type' => 'text',\n ),\n array (\n 'name' => 'Gomb szöveg',\n 'id' => 'button',\n 'type' => 'text_small',\n ),\n array (\n 'name' => 'Gomb link',\n 'id' => 'url',\n 'type' => 'text_url',\n ),\n\n array (\n 'name' => 'Kép',\n 'description' => 'min: 1600×600',\n 'id' => 'photo',\n 'type' => 'file',\n ),\n ) // end of fields\n ),\n\n array (\n 'id' => 'ads',\n 'type' => 'group',\n 'description' => 'Kiemelt ajánlatok',\n 'options' => array (\n 'group_title' => 'Ad {#}',\n 'add_button' => 'Új Ad',\n 'remove_button' => 'Ad törlése',\n 'sortable' => true, // beta\n ),\n 'fields' => array(\n array (\n 'name' => 'Cím',\n 'id' => 'title',\n 'type' => 'text_medium',\n ),\n array (\n 'name' => 'Szöveg',\n 'id' => 'paragpraph',\n 'type' => 'text_medium',\n ),\n array (\n 'name' => 'Gomb szöveg',\n 'id' => 'button',\n 'type' => 'text_small',\n ),\n array (\n 'name' => 'Link',\n 'id' => 'url',\n 'type' => 'text_url',\n ),\n array (\n 'name' => 'Kép',\n 'description' => 'min: 800×400',\n 'id' => 'photo',\n 'type' => 'file',\n ),\n ) // end of fields\n )\n\n )\n );\n\n\n $meta_boxes['regdl'] = array(\n 'id' => 'regdl_meta',\n 'title' => __( 'Letöltéshez ...', 'root' ),\n 'object_types' => array( 'page'), // Post type\n 'show_on' => array( 'key' => 'page-template', 'value' => 'page-registereddl.php' ),\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n //'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend\n 'fields' => array(\n array(\n 'name' => __( 'Letölthető fájl megnevezése', 'root' ),\n 'desc' => __( 'Ez jelenik meg a kapott emailben', 'root' ),\n 'id' => $prefix . 'dlfilename',\n 'type' => 'text_medium',\n ),\n array(\n 'name' => __( 'Letölthető fájl', 'root' ),\n 'desc' => __( 'Letölthető fájl csatolása', 'root' ),\n 'id' => $prefix . 'dlfile',\n 'type' => 'file',\n ),\n\n ),\n );\n\n $meta_boxes['landing'] = array(\n 'id' => 'landingmeta',\n 'title' => 'Kísérő információk',\n 'object_types' => array( 'page'),\n 'show_on' => array( 'key' => 'page-template', 'value' => array('page-landing.php', 'page-kozpontok.php') ),\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true,\n 'fields' => array (\n array (\n 'id' => 'tabs',\n 'type' => 'group',\n 'description' => 'Fülek',\n 'options' => array (\n 'group_title' => 'Fül {#}',\n 'add_button' => 'Új Fül',\n 'remove_button' => 'Fül törlése',\n 'sortable' => true // beta\n ),\n 'fields' => array(\n array (\n 'name' => 'Fül címe',\n 'description' => 'Légyszi nagyon rövid',\n 'id' => 'tabtitle',\n 'type' => 'text_small'\n ),\n array (\n 'name' => 'Fül tartalma',\n 'id' => 'tabcontent',\n 'type' => 'wysiwyg',\n 'options' => array(\n 'wpautop' => true, // use wpautop?\n 'media_buttons' => false, // show insert/upload button(s)\n 'textarea_rows' => get_option('default_post_edit_rows', 10), // rows=\"...\"\n 'teeny' => true\n )\n )\n\n ) // end of group fields\n )\n\n )\n );\n\n\n /**\n * Metabox for the user profile screen\n */\n $meta_boxes['user_edit'] = array(\n 'id' => 'user_edit',\n 'title' => __( 'User Profile Metabox', 'root' ),\n 'object_types' => array( 'user' ), // Tells CMB to use user_meta vs post_meta\n 'show_names' => true,\n // 'cmb_styles' => true, // Show cmb bundled styles.. not needed on user profile page\n 'fields' => array(\n array(\n 'name' => __( 'Megjelenik az orvosok listában', 'root' ),\n 'id' => $prefix . 'orvose',\n 'type' => 'checkbox',\n ),\n array(\n 'name' => __( 'Portré fotó', 'root' ),\n 'desc' => __( 'Aspect ratio 3×4', 'root' ),\n 'id' => $prefix . 'portre',\n 'type' => 'file',\n 'save_id' => true,\n ),\n array(\n 'name' => __( 'Foglalkozás, titulus', 'root' ),\n 'id' => $prefix . 'titulus',\n 'type' => 'textarea_small',\n ),\n array(\n 'name' => __( 'Város', 'root' ),\n 'id' => $prefix . 'city',\n 'type' => 'text_small',\n ),\n array(\n 'name' => __( 'Arckép', 'root' ),\n 'id' => $prefix . 'arckep',\n 'type' => 'wysiwyg',\n ),\n array(\n 'name' => __( 'Önéletrajz', 'root' ),\n 'id' => $prefix . 'cv',\n 'type' => 'wysiwyg',\n ),\n array(\n 'name' => __( 'Bemutatkozás', 'root' ),\n 'id' => $prefix . 'introduce',\n 'type' => 'wysiwyg',\n ),\n )\n );\n // Add other metaboxes as needed\n\n return $meta_boxes;\n}", "function crbtest_attach_theme_options() {\n Container::make( 'theme_options', __( 'Carbon Metabox', 'crbtest' ) ) \n ->add_fields( array(\n // Text field\n Field::make( 'text', 'crbtest_author', __( 'Author Name', 'crbtest' ) ),\n // Image field\n Field::make( 'image', 'crbtest_image', __( 'Image' , 'crbtest' ) ),\n // Gallery field\n Field::make( 'media_gallery', 'crbtest_media_gallery', __( 'Media Gallery' ) ),\n // Multiselect\n Field::make( 'multiselect', 'crbtest_available_colors', __( 'Available Colors' ) )\n ->add_options( array(\n 'red' => 'Red',\n 'green' => 'Green',\n 'blue' => 'Blue',\n ) ), \n // Repeater Fields\n Field::make( 'complex', 'crbtest_repeater', __( 'Repeater Fields' ) )\n ->add_fields( array(\n Field::make( 'text', 'title', __( 'Slide Title' ) ),\n Field::make( 'image', 'photo', __( 'Slide Photo' ) ),\n ) ), \n \n // Checkbox \n Field::make( 'checkbox', 'crbtest_show_content', __( 'Show Content', 'crbtest' ) )\n ->set_option_value( 'yes' ),\n ) ) \n // Tabs\n ->add_tab( __( 'Profile' ), array(\n Field::make( 'text', 'crbtest_first_name', __( 'First Name' ) ),\n Field::make( 'text', 'crbtest_last_name', __( 'Last Name' ) ),\n Field::make( 'text', 'crbtest_position', __( 'Position' ) ),\n ) )\n ->add_tab( __( 'Notification' ), array(\n Field::make( 'text', 'crbtest_email', __( 'Notification Email' ) )->set_width('50'),\n Field::make( 'text', 'crbtest_phone', __( 'Phone Number' ) )->set_width('50'),\n ) );\n\n /* Conditional type */\n Container::make( 'post_meta', __( 'Homepage Settings' ) )\n ->where( 'post_type', '=', 'page' )\n ->where( 'post_template', '=', 'templates/homepage.php' )\n ->set_context('side')\n ->add_fields( array( \n Field::make( 'text', 'crbtest_homepage', __( 'Image Title', 'crbtest' ) ),\n ) );\n}", "function create_metabox_testimonial($meta_boxes_testimonial) {\n $meta_boxes_testimonial[] = array(\n 'title' => __('Depoimentos de Clientes'),\n 'post_types' => array('testimonial'),\n 'fields' => array(\n array(\n 'id' => 'testimonial-name',\n 'name' => __('Nome do cliente:'),\n 'type' => 'text',\n ),\n array(\n 'id' => 'testimonial-age',\n 'name' => __('Idade do cliente:'),\n 'type' => 'text',\n ),\n array(\n 'id' => 'testimonial-occupation',\n 'name' => __('Cargo do cliente:'),\n 'type' => 'text',\n ),\n array(\n 'id' => 'testimonial-text',\n 'name' => __('Depoimento do cliente:'),\n 'type' => 'wysiwyg',\n ),\n array(\n 'id' => 'testimonial-picture',\n 'name' => __('Foto do cliente:'),\n 'type' => 'image_upload',\n 'force_delete' => false,\n 'max_file_uploads' => 1,\n 'max_status' => 'false',\n 'image_size' => 'thumbnail',\n\n ),\n \n )\n );\n return $meta_boxes_testimonial;\n}" ]
[ "0.67458683", "0.65419805", "0.64457536", "0.6266428", "0.6189332", "0.6121805", "0.6088579", "0.6070968", "0.59952354", "0.5979985", "0.59747624", "0.59741414", "0.59649813", "0.5923872", "0.58932966", "0.58777136", "0.5875179", "0.5823966", "0.5822181", "0.5809585", "0.5800437", "0.5794261", "0.57843405", "0.57475615", "0.5733981", "0.5731646", "0.57315105", "0.5689522", "0.56891584", "0.56890076" ]
0.7489177
0
Callback function for campaign page template selection
public function campaign_page_templates_meta_box_callback( $post ) { // Add a nonce field so we can check for it later. wp_nonce_field( 'campaign_page_template_nonce_' . $post->ID, 'campaign_page_template_nonce' ); $value = get_post_meta( $post->ID, '_campaign_page_template', true ); $campaign_templates = $this->campaign_themes(); ?> <select id="campaign_page_template" name="campaign_page_template"> <option value=""><?php _e( 'Default Template', 'planet4-master-theme-backend' ); ?> </option> <?php foreach ( $campaign_templates as $campaign => $campaign_template ) { ?> <option value="<?php echo $campaign; ?>" <?php selected( $value, $campaign ); ?>> <?php echo $campaign_template; ?> </option> <?php } ?> </select> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function choose_template() {\n \t// Page data\n \t$page_title = \"OptinDev - Choose a Template\";\n \t$step_number = 2;\n\n \t// Return the view\n \treturn view('onboarding.pages.choose-template')->with('page_title', $page_title)->with('step_number', $step_number);\n }", "function choose_template( $template ) {\n\t\t\t//stores $template as array of strings separated by '/'\n\t\t\t$path_array = explode( '/', $template );\n\t\t\t//reverses the array\n\t\t\t$path_array = array_reverse( $path_array );\n\n\t\t\t//path to the plugin directory\n\t\t\t$path_to_template = \\rtCamp\\WP\\rtPeople\\RTPEOPLE_PATH;\n\n\t\t\tif ( !empty( $path_array ) ) {\n\n\t\t\t\tswitch ( $path_array[0] ) {\n\t\t\t\t\t//if the template requested is archive.php\n\t\t\t\t\tcase 'archive.php':\n\t\t\t\t\t\t//path to the cutom archive template\n\t\t\t\t\t\t$path_to_template .= 'templates/archive-people.php';\n\t\t\t\t\t\t$template = $path_to_template;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//if the template requested is single.php\n\t\t\t\t\tcase 'single.php':\n\t\t\t\t\t\t//path to the custom single template\n\t\t\t\t\t\t$path_to_template .= 'templates/single-people.php';\n\t\t\t\t\t\t$template = $path_to_template;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//before finalising the template\n\t\t\tdo_action( 'rt_before_template_chosen', $template );\n\n\t\t\treturn $template;\n\t\t}", "function da_single_templates( $template = '' ) {\n\tglobal $post;\n\t$meta = get_post_meta( $post->ID, 'campaigns', true );\n\tif ( 1 === $meta ) {\n\t\t$template = locate_template(\n\t\t\tarray( 'single-campaigns.php', $template ),\n\t\t\tfalse\n\t\t);\n\t}\n\treturn $template;\n}", "function ajax_action_callback() {\n global $wpdb;\n \n if ( empty($_POST) || !wp_verify_nonce('set_view_template', $_POST['wpnonce']) ) {\n\n $view_template_id = $_POST['view_template_id'];\n $type = $_POST['type'];\n \n\t\t\tlist($join, $cond) = $this->_get_wpml_sql($type, $_POST['lang']);\n\n $posts = $wpdb->get_col(\"SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} {$join} WHERE post_type='{$type}' {$cond}\");\n \n $count = sizeof($posts);\n $updated_count = 0;\n if ($count > 0) {\n foreach($posts as $post) {\n $template_selected = get_post_meta($post, '_views_template', true);\n if ($template_selected != $view_template_id) {\n update_post_meta($post, '_views_template', $view_template_id);\n $updated_count += 1;\n }\n }\n }\n \n echo $updated_count;\n } \n die(); // this is required to return a proper result\n }", "function handle_page($template) {\n\t\t\n\t\t// this is a direct copy and paste from WP.\n\t\t// becuase wordpress isn't verbose about what it\n\t\t// discovers it does this reuqest. We'll need\n\t\t// to duplicate it. \n\t\t$id = get_queried_object_id();\n\t\t$template = get_post_meta($id, '_wp_page_template', true);\n\t\t$pagename = get_query_var('pagename');\n\n\t\tif ( !$pagename && $id > 0 ) {\n\t\t\t// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object\n\t\t\t$post = get_queried_object();\n\t\t\t$pagename = $post->post_name;\n\t\t}\n\n\t\tif ( 'default' == $template )\n\t\t\t$template = '';\n\t\t\n\t\tPLS_Debug::add_msg(\"Of type Page, searching for:\");\n\t\tPLS_Debug::add_msg($template);\n\t\t\n\t\t$templates = array();\n\t\tif ( !empty($template) && !validate_file($template) )\n\t\t\t$templates[] = $template;\n\t\tif ( $pagename )\n\t\t\t$templates[] = \"page-$pagename.php\";\n\t\tif ( $id )\n\t\t\t$templates[] = \"page-$id.php\";\n\t\t$templates[] = 'page.php';\n\n\t\t// The possible templates are stored in the \n\t\t// request var so router can use them later\n\t\t// when the filter is called to decide\n\t\t// which pages to look for. \n\t\tself::$request = array_merge(self::$request, $templates);\n\t}", "protected function content_template() {}", "function sp_page_template_companies( $page_template ) {\n if ( is_page( 'empresas' ) ) {\n $page_template = SPOSTEOS . '/templates/products/companies.php';\n }\n\n return $page_template;\n}", "function template_handler() {\n if ( isset( $_POST['action'] ) && 'eboywp_autocomplete_load' == $_POST['action'] ) {\n $this->ajax_load();\n }\n }", "private function template() {\n\t\t\t$labels = array(\n\t\t\t\t'name' => 'Page Builder Templates',\n\t\t\t\t'singular_name' => 'Template',\n\t\t\t\t'menu_name' => 'Templates',\n\t\t\t\t'all_items' => 'Templates',\n\t\t\t\t'add_new' => 'Add New',\n\t\t\t\t'add_new_item' => 'Add New Template',\n\t\t\t\t'edit_item' => 'Edit Template',\n\t\t\t\t'new_item' => 'New Template',\n\t\t\t\t'view_item' => 'View Template',\n\t\t\t\t'view_items' => 'View Templates',\n\t\t\t\t'search_items' => 'Search Templates',\n\t\t\t\t'not_found' => 'No Templates Found',\n\t\t\t\t'not_found_in_trash' => 'No Templates Found in Trash',\n\t\t\t\t'parent_item_colon' => 'Parent Template',\n\t\t\t\t'featured_image' => 'Featured Image for this Template',\n\t\t\t\t'set_featured_image' => 'Set Featured Image for this Template',\n\t\t\t\t'remove_featured_image' => 'Remove Featured Image for this Template',\n\t\t\t\t'use_featured_image' => 'Use as Featured Image for this Template',\n\t\t\t\t'archives' => 'Template Archives',\n\t\t\t\t'insert_into_item' => 'Insert into Template',\n\t\t\t\t'uploaded_to_this_item' => 'Uploaded to this Template',\n\t\t\t\t'filter_items_list' => 'Filter Template List',\n\t\t\t\t'items_list_navigation' => 'Template List Navication',\n\t\t\t\t'items_list' => 'Template List',\n\t\t\t\t'attributes' => 'Template Attributes',\n\t\t\t\t'parent_item_colon' => 'Parent Template',\n\t\t\t);\n\t\t\t$args = array(\n\t\t\t\t'label' => 'Templates',\n\t\t\t\t'labels' => $labels,\n\t\t\t\t'description' => '',\n\t\t\t\t'public' => false,\n\t\t\t\t'publicly_queryable' => false,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_rest' => false,\n\t\t\t\t'rest_base' => '',\n\t\t\t\t'has_archive' => false,\n\t\t\t\t'show_in_menu' => apply_filters('acf-bs4-page-builder/admin-page', 'acf-bs4-page-builder'),\n\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'map_meta_cap' => true,\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'rewrite' => false,\n\t\t\t\t'query_var' => true,\n\t\t\t\t'supports' => array('title', 'custom-fields', 'revisions'),\n\t\t\t\t'taxonomies' => array($this->taxonomy),\n\t\t\t);\n\t\t\tregister_post_type($this->post_type, $args);\n\t\t}", "public function getTemplate(SiteTree $page);", "function geschichten_page_template( $page_template, $post_states ) {\n\n global $post;\n\n $post_states = [];\n $prefix = \"QP Plugin \";\n\n if ($post->post_title == \"Geschichten\") {\n $post_states[] = $prefix.'Geschichten';\n $page_template= dirname( __FILE__ ) . '/includes/templates/geschichten-page.php';\n }\n \n if (doing_filter( 'page_template') && !empty($page_template)) {\n return $page_template;\n }\n else if (doing_filter( 'display_post_states') && !empty($post_states)) {\n return $post_states;\n }\n }", "function getTemplateSelectionOnCreation()\n\t{\n\t\t$num = (int) $this->getEmptyPageTemplate();\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPageTemplate.php\");\n\t\t$wt = new ilWikiPageTemplate($this->getId());\n\t\t$ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);\n\t\t$num += count($ts);\n\t\tif ($num > 1)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function saasland_get_page_template_id( $template = 'page-job-apply-form.php' ) {\n $pages = get_pages(array(\n 'meta_key' => '_wp_page_template',\n 'meta_value' => $template\n ));\n foreach ( $pages as $page ) {\n $page_id = $page->ID;\n }\n return $page_id;\n}", "function theme_template()\n{\n\tglobal $wp_query;\n\tstatus_header( 200 );\n\t$wp_query->is_404 = false;\n\n\tglobal $template;\n\n\tif (get_query_var('q') != '' || get_query_var('qunicode') != '')\n\t{\n\t\t$template = get_query_template('tpl-search');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('yid') != '')\n\t{\n\t\t$template = get_query_template('tpl-select');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('did') != '')\n\t{\n\t\t$template = get_query_template('tpl-download');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('letter1') != '')\n\t{\n\t\t$template = get_query_template('tpl-artist');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\telse if (get_query_var('letter2') != '')\n\t{\n\t\t$template = get_query_template('tpl-album');\n\t\tinclude ($template);\n\t\texit();\n\t}\n\n}", "function ws_preselect_post_category_by_type() {\n ?>\n <script type=\"text/javascript\">\n jQuery(function() {\n\t var current_page = jQuery(location).attr('href');\n\t if (current_page.indexOf('post_type=assessment_review') > -1){\n jQuery('#in-category-48').click();\n\t\t}\n\t\tif (current_page.indexOf('post_type=tc_materials') > -1){\n\t\tvar catId = 331; jQuery('#in-category-331').click();\n\t\t}\n\t\tif (current_page.indexOf('post_type=webinar') > -1){\n jQuery('#in-category-341').click();\n\t\t}\n\t\tif (current_page.indexOf('post_type=tip') > -1){\n jQuery('#in-category-134').click();\n\t\t}\n });\n\t </script>\n <?php\n}", "function ajax_dependent_dropdown_callback($form, $form_state) {\r\n return $form;//['options']['template_section'];\r\n}", "public function hook_template_redirect() {\n\n\t\tif ( current_user_can( 'edit_posts' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$is_shop = function_exists( 'is_shop' ) && is_shop();\n\t\tif ( ! $is_shop && ( ! is_singular() || ! $this->should_display_campaign() ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$the_id = $is_shop ? get_option( 'woocommerce_shop_page_id' ) : get_the_ID();\n\t\tif ( empty( $the_id ) ) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * get all campaigns that have the current page set as a promotion (special offer) page\n\t\t */\n\n\t\tif ( ! ( $campaigns = tve_ult_get_campaigns_for_promotion_page( $the_id ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$campaigns_logic = array();\n\n\t\tforeach ( $campaigns as $campaign ) {\n\t\t\t/* @var TU_Schedule_Abstract $schedule */\n\t\t\t$schedule = $campaign->tu_schedule_instance;\n\n\t\t\t$campaigns_logic[ $campaign->ID ] = true;\n\n\t\t\tif ( $schedule->should_redirect_pre_access() ) {\n\t\t\t\t$permalink = isset( $campaign->lockdown_settings['preaccess']['id'] ) ? get_post_permalink( $campaign->lockdown_settings['preaccess']['id'] ) : $campaign->lockdown_settings['preaccess']['value'];\n\t\t\t\t$campaigns_logic[ $campaign->ID ] = $permalink;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/** if the campaign is evergreen save the email in the db if not exists */\n\t\t\tif ( $campaign->type == TVE_Ult_Const::CAMPAIGN_TYPE_EVERGREEN ) {\n\n\t\t\t\t/* @var $schedule TU_Schedule_Evergreen */\n\n\t\t\t\t//if we have the email in the url\n\t\t\t\tunset( $email_param );\n\t\t\t\tif ( isset( $_GET['tu_em'] ) && filter_var( $_GET['tu_em'], FILTER_VALIDATE_EMAIL ) && isset( $_GET['tu_id'] ) && $_GET['tu_id'] == $campaign->ID ) {\n\t\t\t\t\t$email_param = $params['lockdown']['email'] = $_GET['tu_em'];\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $_COOKIE[ $schedule->cookie_name() ] ) ) {\n\t\t\t\t\t$cookie = $schedule->get_cookie_data();\n\t\t\t\t\t$cookie = $cookie['cookie'];\n\t\t\t\t\t$params['start_date'] = $cookie['start_date'];\n\n\t\t\t\t\t$has_email = $schedule->verify_cookie();\n\n\t\t\t\t\tif ( ! empty( $has_email ) ) {\n\t\t\t\t\t\t$params['lockdown']['email'] = $cookie['lockdown']['email'];\n\t\t\t\t\t\t$params['lockdown']['cookie_id'] = $cookie['lockdown']['log_id'];\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * If a visitor changes the email from the link and tries to access the special offer page, also save that email address with the same start date as the first one\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $email_param ) && $email_param != $params['lockdown']['email'] ) {\n\t\t\t\t\t\t$params['lockdown']['email'] = $email_param; // make sure the new email address is timestampped with the same date\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $params['lockdown']['email'] ) ) {\n\t\t\t\t\t$schedule->set_cookie_and_save_log( $params );\n\t\t\t\t} elseif ( isset( $_GET['tu_id'] ) && $_GET['tu_id'] == $campaign->ID ) {\n\t\t\t\t\t$permalink = isset( $campaign->lockdown_settings['expired']['id'] ) ? get_post_permalink( $campaign->lockdown_settings['expired']['id'] ) : $campaign->lockdown_settings['expired']['value'];\n\t\t\t\t\t$campaigns_logic[ $campaign->ID ] = $permalink;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $schedule->should_redirect_expired() ) {\n\t\t\t\t$permalink = isset( $campaign->lockdown_settings['expired']['id'] ) ? get_post_permalink( $campaign->lockdown_settings['expired']['id'] ) : $campaign->lockdown_settings['expired']['value'];\n\t\t\t\t$campaigns_logic[ $campaign->ID ] = $permalink;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * we've found the 1st campaign applicable\n\t\t\t * in this case we should let the logic be\n\t\t\t */\n\t\t\tif ( isset( $campaigns_logic[ $campaign->ID ] ) && $campaigns_logic[ $campaign->ID ] === true ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * at this moment we should have at least 1 campaign with 1 redirect because:\n\t\t * - if there is no campaign there is another if above\n\t\t * - if there is an applicable campaign there is an if in loop\n\t\t */\n\t\twp_redirect( array_shift( $campaigns_logic ) );\n\t\texit;\n\t}", "protected function _content_template()\n {\n\n }", "function cp_template_include($template) {\n\t global $post; \n\n\t if($post->post_type == 'client_projects') { \n\t return dirname(__FILE__) . '/client_projects.php'; \n\t } else { return $template; } \n}", "function add_menu_backround_selection() {\n for( $i = 0; $i < 4; $i++ ) {\n switch ( $i ) {\n case 0:\n $section = 'About us';\n break;\n case 1:\n $section = 'Developments';\n break;\n case 2:\n $section = 'Our services';\n break;\n case 3:\n $section = 'Contact us';\n break;\n }\n $page = add_theme_page( \"gj-backgrounds-\" . $i, \"Backgrounds - $section\", \"administrator\", \"gj-backgrounds-\" . $i, 'add_background_selection' );\n\n add_action( 'load-' . $page, 'enqueue_background_scripts' );\n }\n}", "function template_view()\n{\n\tglobal $context, $txt, $settings, $ultimateportalSettings, $user_info;\n\n\t$content = \"\n\t <script type=\\\"text/javascript\\\">\n\t\t\tfunction makesurelink() {\n\t\t\t\tif (confirm('\".$txt['ultport_delete_confirmation'].\"')) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t </script>\";\n\n\tif (!empty($context['view_ipage']))\n\t{\n\t\tforeach ($context['ipage'] as $ipage)\n\t\t{\n\t\t\t$content .= '\n\t\t\t\t\t<div class=\"post-date\">\n\t\t\t\t\t\t<p class=\"day\">\n\t\t\t\t\t\t\t'. $ipage['day_created'] .'/'. $ipage['month_created'] .'/'. $ipage['year_created'] .'\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"post-info\">\n\t\t\t\t\t\t<p class=\"author alignleft\">\n\t\t\t\t\t\t\t'. $txt['up_ipage_member'] .' '. $ipage['profile'] .'\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class=\"moderate alignright\">\n\n\t\t\t\t\t\t\t'. (($user_info['is_admin'] || $user_info['up-modules-permissions']['ipage_moderate']) ? $ipage['edit'] .' | '. $ipage['delete'] : '') .'\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"ip-content\">\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<h2 class=\"titleipage\">\n\t\t\t\t\t\t\t\t'. $ipage['title'] .''. (!empty($ipage['sticky']) ? '&nbsp;&nbsp;<img alt=\"\" style=\"vertical-align:middle\" border=\"0\" src=\"'.$settings['default_images_url'].'/ultimate-portal/internal-page/sticky.gif\" />' : '') .'\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"ip-body\">\n\t\t\t\t\t\t\t'. $ipage['parse_content'] .'\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t'.($ipage['is_updated'] ? '\n\t\t\t\t\t\t\t<div class=\"ip-updateinfo\">\n\t\t\t\t\t\t\t\t<strong>'. $txt['up_ipage_date_updated'] .'</strong> '. $ipage['date_updated'] .'\n\t\t\t\t\t\t\t\t<strong>'. $txt['up_ipage_member_updated'] .'</strong> '. $ipage['profile_updated'] .'\n\t\t\t\t\t\t\t</div>' : '').'\n\t\t\t\t\t\t\t<div class=\"ip-share\">\n\t\t\t\t\t\t\t\t<strong>'. $txt['ultport_social_bookmarks_share'] .':</strong>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t'. (!empty($ultimateportalSettings['ipage_social_bookmarks']) ? $context['social_bookmarks'] : '') .'\n\n\t\t\t\t\t</div>\n\t\t\t\t\t';\n\t\t}\n\t}\n\n\t$copyright = '<div style=\"font-size: 0.8em;\"><a href=\"http://www.smfsimple.com\">Ultimate Portal - '. $txt['up_module_ipage_title'] .'</a>';\n\tup_print_page($context['column_left'], $context['column_right'], $content, $copyright, 'internal-page', $context['title']);\n}", "public function campaign_page_templates_meta_box() {\n\t\t\tadd_meta_box(\n\t\t\t\t'campaigns-page-templates',\n\t\t\t\t__( 'Campaign Templates', 'planet4-master-theme-backend' ),\n\t\t\t\tarray( $this, 'campaign_page_templates_meta_box_callback' ),\n\t\t\t\t'campaign',\n\t\t\t\t'side'\n\t\t\t);\n\t\t}", "function reach_out_recommendation_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Reach Out For A Recommendation Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('reach_out_recommendation');\n\t\t\t\t\t$reach_out_recommendation = get_option('reach_out_recommendation');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'reach_out_recommendation[reach_out_recommendation_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($reach_out_recommendation['reach_out_recommendation_template']) ? $reach_out_recommendation['reach_out_recommendation_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"reach_out_recommendation[reach_out_recommendation_subject]\" id=\"subject\"><?php echo $reach_out_recommendation['reach_out_recommendation_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'reach_out_recommendation_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "function enl_newsletter_campaigns_page(){\n $campaignsListTable = new Campaigns_List_Table();\n //Fetch, prepare, sort, and filter our data...\n $campaignsListTable->prepare_items();\n?>\n <div class=\"wrap\">\n \n <?php if ( function_exists( 'screen_icon' ) ) screen_icon(); ?>\n <h2><?php _e( 'Campaigns List', 'newsletter' ); ?></h2>\n <?php if ( isset( $_GET['success'] ) && 'true' == esc_attr( $_GET['success'] ) ) enl_newsletter_success_message(); ?>\n <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->\n <form id=\"movies-filter\" method=\"get\">\n <!-- For plugins, we also need to ensure that the form posts back to our current page -->\n <input type=\"hidden\" name=\"page\" value=\"<?php echo $_REQUEST['page'] ?>\" />\n <!-- Now we can render the completed list table -->\n <?php $campaignsListTable->display() ?>\n </form>\n \n </div>\n <?php \n \t\n}", "function audition_page_template($template = 'page.php') {\n\tif (! $action = audition_get_action()) {\n\t\treturn $template;\n\t}\n\n\t$slug = $action->get_name();\n\n\t$templates = array(\n\t\t\"$slug.php\",\n\t\t\"audition-$slug.php\",\n\t\t\"audition-$slug.php\",\n\t\t\"page-$slug.php\",\n\t\t'audition.php',\n\t\t'tml.php',\n\t\t'page.php',\n\t);\n\n\tif (audition_action_has_page()) {\n\t\t$template = get_page_template_slug();\n\t\tif ($template && 0 === validate_file($template)) {\n\t\t\tarray_unshift($templates, $template);\n\t\t}\n\t}\n\n\t/**\n\t * Filters the template hierarchy used for TML pages.\n\t *\n\t * @since 7.0\n\t *\n\t * @param array $templates The page template hierarchy.\n\t */\n\t$templates = apply_filters('audition_page_templates', $templates);\n\n\tif ($audition_template = locate_template($templates)) {\n\t\treturn $audition_template;\n\t}\n\n\treturn $template;\n}", "function bbp_get_single_view_template()\n{\n}", "protected function _content_template()\n { }", "protected function _content_template() {\n\t}", "protected function _content_template() {\n\t}", "function render_js_templates() {\n\tif ( CPT_ID === get_post_type() ) {\n\t\trequire_once FiveForTheFuture\\get_views_path() . 'modal-request-manage-link.php';\n\t}\n}" ]
[ "0.61892265", "0.6001998", "0.59552306", "0.58856887", "0.5881088", "0.57507885", "0.5673315", "0.56485915", "0.5634446", "0.5634365", "0.5631195", "0.56091917", "0.5596512", "0.55907327", "0.5586568", "0.55733943", "0.55658007", "0.55553025", "0.5547617", "0.55434954", "0.55181134", "0.5503618", "0.5501214", "0.5498383", "0.5497188", "0.5495523", "0.54714024", "0.54669625", "0.54669625", "0.54588044" ]
0.63018894
0
Save campaigns page template data
public function save_campaign_page_templates_meta_box_data( $post_id ) { // Check if our nonce is set. if ( ! isset( $_POST['campaign_page_template_nonce'] ) ) { return; } // Verify that the nonce is valid. if ( ! wp_verify_nonce( $_POST['campaign_page_template_nonce'], 'campaign_page_template_nonce_' . $post_id ) ) { return; } // If this is an autosave, our form has not been submitted, so we don't want to do anything. if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Check the user's permissions. if ( ! current_user_can( 'edit_post', $post_id ) ) { return; } /* OK, it's safe for us to save the data now. */ // Make sure that it is set. if ( ! isset( $_POST['campaign_page_template'] ) ) { return; } // Validate user input. if ( in_array( $_POST['campaign_page_template'], array_keys( $this->campaign_themes() ) ) ) { $campaign_page_template = $_POST['campaign_page_template']; } // Update the meta field in the database. update_post_meta( $post_id, '_campaign_page_template', $campaign_page_template ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_rcampaign_pagesAction()\n {\n $this->view->disable();\n $request = $this->request;\n if ($request->isPost()) {\n $id = $request->getPost('id');\n //$arr = array('conditions' => array('_id' => new MongoId($id)),'limit'=>1);\n $page_to_campaign = PagesToCampaign::findFirst(\"id = '$id'\");\n $page_to_campaign->achor_text = $request->getPost('achor_text');\n $page_to_campaign->image_url = $request->getPost('image_url');\n $page_to_campaign->video_url = $request->getPost('video_url');\n $page_to_campaign->html_embed = $request->getPost('html_embed');\n if ($page_to_campaign->save() == false) {\n echo \"Sorry, we can't edit the campaign right now\";\n } else {\n echo \"Campaign is updated successfully.\";\n }\n }\n }", "function saveMetaBoxe(){\n\n if(isset($_POST['post_type']) && $_POST['post_type'] == 'page' && isset($_POST[\"_safeWpMeta\"])){ \n\n $template_file = get_post_meta($_POST['post_ID'],'_wp_page_template',TRUE);\n if ($template_file == $this->templateName) {\n $id = $_POST['post_ID']; \n \n foreach($this->models as $modelName => $model){\n pn_select_save_method($id, \"page\", $modelName, $model); \n } \n \n } \n } \n \n }", "public function onSave()\n {\n $this->validateRequestTheme();\n $type = Request::input('templateType');\n $templatePath = trim(Request::input('templatePath'));\n $template = $templatePath ? $this->loadTemplate($type, $templatePath) : $this->createTemplate($type);\n $formWidget = $this->makeTemplateFormWidget($type, $template);\n \n $saveData = $formWidget->getSaveData();\n $postData = post();\n $templateData = [];\n\n $settings = array_get($saveData, 'settings', []) + Request::input('settings', []);\n\n // Check if should be used custom behaviour on viewBag\n if($type == 'layout' || $type == 'partial' || $type == 'content' || $type == 'asset'){\n // skip\n }else{\n if ($viewBag = array_get($saveData, 'viewBag')) {\n $objectData['settings'] = ['viewBag' => $viewBag];\n }\n }\n \n $settings = $this->upgradeSettings($settings, $template->settings);\n\n if ($settings) {\n $templateData['settings'] = $settings;\n }\n\n $fields = ['markup', 'code', 'fileName', 'content'];\n\n foreach ($fields as $field) {\n if (array_key_exists($field, $saveData)) {\n $templateData[$field] = $saveData[$field];\n }\n elseif (array_key_exists($field, $postData)) {\n $templateData[$field] = $postData[$field];\n }\n }\n\n if (!empty($templateData['markup']) && Config::get('cms.convertLineEndings', false) === true) {\n $templateData['markup'] = $this->convertLineEndings($templateData['markup']);\n }\n\n if (!empty($templateData['code']) && Config::get('cms.convertLineEndings', false) === true) {\n $templateData['code'] = $this->convertLineEndings($templateData['code']);\n }\n\n if (\n !Request::input('templateForceSave') && $template->mtime\n && Request::input('templateMtime') != $template->mtime\n ) {\n throw new ApplicationException('mtime-mismatch');\n }\n\n $template->attributes = [];\n $template->fill($templateData);\n\n // Check if should use DB (dbSave()) or native save method (in case of layout, partial, content and asset)\n if($type == 'layout' || $type == 'partial' || $type == 'content' || $type == 'asset'){\n $template->save();\n }else{\n $template->setTheme($this->theme);\n $template->dbSave();\n }\n\n $this->fireSystemEvent('cms.template.save', [$template, $type]);\n Flash::success(Lang::get('cms::lang.template.saved'));\n\n $result = [\n 'templatePath' => $template->fileName,\n 'templateMtime' => $template->mtime,\n 'tabTitle' => $this->getTabTitle($type, $template)\n ];\n\n if ($type === 'page') {\n $result['pageUrl'] = Url::to($template->url);\n $router = new Router($this->theme);\n $router->clearCache();\n CmsCompoundObject::clearCache($this->theme);\n }\n\n return $result;\n }", "private function _saveTplIndexPage()\n {\n $html = $this->pageContent;\n\n $html = str_replace('{{ root }}', $this->nameVariableRoot, $html);\n\n $html = str_replace('{% tpl %}', '', $html);\n\n preg_match('/{% else %}(.*?){% end %}/s', $html, $matches);\n\n $html = str_replace($matches, '', $html);\n\n file_put_contents(dirname(__DIR__) . \"/../../../../app/game.tpl\", $html);\n }", "private static function doSaveBlogTemplates() {\n\t\t$save = array();\n\t\t$save['name'] = wgPost::getValue('name');\n\t\t$save['identifier'] = valid::safeText(wgPost::getValue('identifier'));\n\t\t$save['temptype'] = wgPost::getValue('temptype');\n\t\t$save['datasource'] = wgPost::getValue('datasource');\n\t\t$save['limit'] = wgPost::getValue('limit');\n\t\t$save['pager'] = wgPost::getValue('pager');\n\t\t$save['search'] = wgPost::getValue('search');\n\t\t$save['variable'] = wgPost::getValue('variable');\n\t\t$save['someid'] = wgPost::getValue('someid');\n\t\t$save['useedit'] = wgPost::getValue('useedit');\n\t\t$save['tbegin'] = wgPost::getValue('tbegin');\n\t\t$save['titem'] = wgPost::getValue('titem');\n\t\t$save['tend'] = wgPost::getValue('tend');\n\t\t$save['tnoitem'] = wgPost::getValue('tnoitem');\n\t\t$save['tnoperm'] = wgPost::getValue('tnoperm');\n\t\t$save['blog_cats_id'] = wgPost::getValue('blog_cats_id');\n\t\t$save['blog_id'] = wgPost::getValue('myblog');\n\t\t$save['system_websites_id'] = wgPost::getValue('system_websites_id');\n\t\t$save['error1'] = wgPost::getValue('error1');\n\t\t$save['error2'] = wgPost::getValue('error2');\n\t\t$save['error3'] = wgPost::getValue('error3');\n\t\t$save['error4'] = wgPost::getValue('error4');\n\t\t$save['error5'] = wgPost::getValue('error5');\n\t\t$save['error6'] = wgPost::getValue('error6');\n\t\t$save['redirect1'] = wgPost::getValue('redirect1');\n\t\t$save['redirect2'] = wgPost::getValue('redirect2');\n\t\t\n\t\tif ((bool) wgPost::getValue('edit')) {\n\t\t\t$save['where'] = wgPost::getValue('edit');\n\t\t\t$id = (int) $save['where'];\n\t\t\tself::$_par['edit'] = $id;\n\t\t\treturn (bool) BlogTemplatesModel::doUpdate($save);\n\t\t}\n\t\telse {\n\t\t\t$id = (int) BlogTemplatesModel::doInsert($save);\n\t\t\tself::$_par['edit'] = $id;\n\t\t\treturn (bool) $id;\n\t\t}\n\t}", "public function savetemplatesAction()\n {\n $templatename = $this->getRequest()->getPost('templatename');\n $templatebody = $this->getRequest()->getPost('templatebody');\n $this->_getService()->savetemplatesAction($templatename, $templatebody);\n\n $this->_redirect('smsservice/adminhtml/template');\n }", "public function sael_template_data_loads() {\n $template_id = $_POST['template_id'];\n $with_page = $_POST['with_page'];\n\n $template = SAEL_Temp_Remote::sael_get_instance()->get_template_content($template_id);\n\n if (is_wp_error($template)) {\n return $template;\n }\n\n // Finally create the page.\n $page_id = $this->create_page($template, $with_page);\n echo ((int) $page_id ? $page_id : 'problem');\n exit;\n }", "private static function doSaveSystemTemplates() {\n\t\t$save = array();\n\t\t$save['name'] = wgPost::getValue('name');\n\t\t$save['identifier'] = valid::safeText(wgPost::getValue('identifier'));\n\t\t$save['module'] = 'youtube';\n\t\t$save['pager'] = wgPost::getValue('pager');\n\t\t$save['limit'] = wgPost::getValue('limit');\n\t\t$save['temptype'] = wgPost::getValue('temptype');\n\t\t$save['datasource'] = wgPost::getValue('datasource');\n\t\t$save['group1'] = wgPost::getValue('group1');\n\t\t$save['group2'] = wgPost::getValue('group2');\n\t\t$save['group3'] = wgPost::getValue('group3');\n\t\t$save['var1'] = wgPost::getValue('var1');\n\t\t$save['var2'] = wgPost::getValue('var2');\n\t\t$save['var3'] = wgPost::getValue('var3');\n\t\t$save['begin1'] = wgPost::getValue('begin1');\n\t\t$save['item1'] = wgPost::getValue('item1');\n\t\t$save['end1'] = wgPost::getValue('end1');\n\t\t$save['notemp1'] = wgPost::getValue('notemp1');\n\t\t$save['begin2'] = wgPost::getValue('begin2');\n\t\t$save['item2'] = wgPost::getValue('item2');\n\t\t$save['end2'] = wgPost::getValue('end2');\n\t\t$save['notemp2'] = wgPost::getValue('notemp2');\n\t\t$save['int1'] = wgPost::getValue('int1');\n\t\t$save['int2'] = wgPost::getValue('int2');\n\t\t$save['int3'] = wgPost::getValue('int3');\n\t\t$save['tint1'] = wgPost::getValue('tint1');\n\t\t$save['tint2'] = wgPost::getValue('tint2');\n\t\t$save['tint3'] = wgPost::getValue('tint3');\n\t\t$save['changed'] = 'NOW()';\n\t\tif ((bool) wgPost::getValue('edit')) {\n\t\t\t$save['where'] = wgPost::getValue('edit');\n\t\t\t$id = (int) $save['where'];\n\t\t\tself::$_par['edit'] = $id;\n\t\t\treturn (bool) SystemTemplatesModel::doUpdate($save);\n\t\t}\n\t\telse {\n\t\t\t$save['added'] = 'NOW()';\n\t\t\t$id = (int) SystemTemplatesModel::doInsert($save);\n\t\t\tself::$_par['edit'] = $id;\n\t\t\treturn (bool) $id;\n\t\t}\n\t}", "public function SaveTemplate()\n {\n $template = Template::where('id', Input::get('id'))->first();\n if(count($template) != 1) {\n $template = new Template;\n }\n\n $templateheader = \"@extends('OS.Templates.templatemaster') @section('template') \";\n $templatedata = str_replace(\"&gt;\" , \">\" , Input::get('content'));\n $templatedata = str_replace(\"&#39;\" , \"'\" , $templatedata);\n $templatefooter = \" @stop\";\n\n $template->name = Input::get('name');\n $template->content = \"\";\n $template->type = Input::get('type');\n $template->subgroup = Input::get('subgroup');\n $template->user_id = Auth::user()->id;\n $template->save();\n\n $backup = new TemplateContent;\n $backup->content = $templateheader.$templatedata.$templatefooter;\n $backup->template_id = $template->id;\n $backup->save();\n\n $this->CheckSubgroup($template->type, $template->subgroup);\n\n return ['status' => 'OK', 'id' => $template->id];\n\n }", "function Page_heading_save_postdata( $post_id ) {\n// verify if this is an auto save routine. \n// If it is our form has not been submitted, so we dont want to do anything\nif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \nreturn;\n// verify this came from the our screen and with proper authorization,\n// because save_post can be triggered at other times\nif ( ( isset ( $_POST['Page_heading_noncename'] ) ) && ( ! wp_verify_nonce( $_POST['Page_heading_noncename'], plugin_basename( __FILE__ ) ) ) )\nreturn;\n// Check permissions\nif ( ( isset ( $_POST['post_type'] ) ) && ( 'page' == $_POST['post_type'] ) ) {\nif ( ! current_user_can( 'edit_page', $post_id ) ) {\nreturn;\n} \n}\nelse {\nif ( ! current_user_can( 'edit_post', $post_id ) ) {\nreturn;\n}\n}\n// OK, we're authenticated: we need to find and save the data\n//About Page\n$templateName = get_post_meta( $post_id, '_wp_page_template', true ); \nif($templateName=='tpl-about.php'){\nupdate_post_meta( $post_id, 'about_banner_title', $_POST['about_banner_title'] );\nupdate_post_meta( $post_id, 'about_banner_content', $_POST['about_banner_content'] );\nupdate_post_meta( $post_id, 'about_banner_learn_more_button_link', $_POST['about_banner_learn_more_button_link'] );\nupdate_post_meta( $post_id, 'page_heading', $_POST['page_heading'] );\nupdate_post_meta( $post_id, 'page_sub_heading', $_POST['page_sub_heading'] );\nupdate_post_meta( $post_id, 'page_video', $_POST['page_video'] );\nupdate_post_meta( $post_id, 'money_train_mission_heading', $_POST['money_train_mission_heading'] );\nupdate_post_meta( $post_id, 'money_train_mission_sub_heading', $_POST['money_train_mission_sub_heading'] );\nupdate_post_meta( $post_id, 'money_train_content', $_POST['money_train_content'] );\nupdate_post_meta( $post_id, 'money_train_notified_title', $_POST['money_train_notified_title'] );\nupdate_post_meta( $post_id, 'money_train_notified_content', $_POST['money_train_notified_content'] );\n} \n//Event Page\nif($templateName=='tpl-events.php'){\nupdate_post_meta( $post_id, 'event_photo_gallary_title', $_POST['event_photo_gallary_title'] );\nupdate_post_meta( $post_id, 'event_photo_gallary_content', $_POST['event_photo_gallary_content'] );\nupdate_post_meta( $post_id, 'event_video_gallary_title', $_POST['event_video_gallary_title'] );\nupdate_post_meta( $post_id, 'event_video_gallary_content', $_POST['event_video_gallary_content'] );\nupdate_post_meta( $post_id, 'event_quick_links_title', $_POST['event_quick_links_title'] );\nupdate_post_meta( $post_id, 'event_quick_links_sub_title', $_POST['event_quick_links_sub_title'] );\nupdate_post_meta( $post_id, 'event_design_animation_title', $_POST['event_design_animation_title'] );\nupdate_post_meta( $post_id, 'event_design_animation_sub_title', $_POST['event_design_animation_sub_title'] );\nupdate_post_meta( $post_id, 'event_design_animation_content', $_POST['event_design_animation_content'] );\nupdate_post_meta( $post_id, 'event_request_button', $_POST['event_request_button'] );\nupdate_post_meta( $post_id, 'event_video_embed_code', $_POST['event_video_embed_code'] );\nupdate_post_meta( $post_id, 'event_loadmore_album_url', $_POST['event_loadmore_album_url'] );\nupdate_post_meta( $post_id, 'event_loadmore_video_url', $_POST['event_loadmore_video_url'] );\nupdate_post_meta( $post_id, 'eventtiming', $_POST['eventtiming'] );\nupdate_post_meta( $post_id, 'Things_to_Rememeber', $_POST['Things_to_Rememeber'] );\nupdate_post_meta( $post_id, 'Things_to_Rememeber_content', $_POST['Things_to_Rememeber_content'] );\nupdate_post_meta( $post_id, 'sign_up_guest_list', $_POST['sign_up_guest_list'] );\nupdate_post_meta( $post_id, 'Celebrate_Birthday', $_POST['Celebrate_Birthday'] );\nupdate_post_meta( $post_id, 'sign_up_email_list', $_POST['sign_up_email_list'] );\nupdate_post_meta( $post_id, 'Table_Reservation', $_POST['Table_Reservation'] );\n}\n//services Page.\nif($templateName=='tpl-services.php'){\nupdate_post_meta( $post_id, 'services_page_title', $_POST['services_page_title'] );\nupdate_post_meta( $post_id, 'event_banner_conent', $_POST['event_banner_conent'] );\nupdate_post_meta( $post_id, 'services_page_testimonial_title', $_POST['services_page_testimonial_title'] );\nupdate_post_meta( $post_id, 'services_page_testimonial_sub_title', $_POST['services_page_testimonial_sub_title'] );\nupdate_post_meta( $post_id, 'services_man_brand_title', $_POST['services_man_brand_title'] );\nupdate_post_meta( $post_id, 'services_man_brand_sub_title', $_POST['services_man_brand_sub_title'] );\nupdate_post_meta( $post_id, 'services_man_brand_content', $_POST['services_man_brand_content'] );\n} \n//moneytraintv Page\nif($templateName=='tpl-moneytraintv.php'){\nupdate_post_meta( $post_id, 'moneytraintv_post_title', $_POST['moneytraintv_post_title'] );\nupdate_post_meta( $post_id, 'moneytraintv_post_sub_title', $_POST['moneytraintv_post_sub_title'] );\nupdate_post_meta( $post_id, 'moneytraintv_featured_post_title', $_POST['moneytraintv_featured_post_title'] );\nupdate_post_meta( $post_id, 'moneytraintv_featured_post_sub_title', $_POST['moneytraintv_featured_post_sub_title'] );\nupdate_post_meta( $post_id, 'moneytraintv_sec_title', $_POST['moneytraintv_sec_title'] );\nupdate_post_meta( $post_id, 'moneytraintv_music_title', $_POST['moneytraintv_music_title'] );\nupdate_post_meta( $post_id, 'moneytraintv_music_sub_title', $_POST['moneytraintv_music_sub_title'] );\n}\n//contact Page.\nif($templateName=='tpl-contact.php'){\nupdate_post_meta( $post_id, 'contact_page_banner_map', $_POST['contact_page_banner_map'] );\nupdate_post_meta( $post_id, 'contact_page_title', $_POST['contact_page_title'] );\nupdate_post_meta( $post_id, 'contact_page_heading', $_POST['contact_page_heading'] );\nupdate_post_meta( $post_id, 'contact_page_sub_heading', $_POST['contact_page_sub_heading'] );\nupdate_post_meta( $post_id, 'contact_page_call_button', $_POST['contact_page_call_button'] );\nupdate_post_meta( $post_id, 'contact_page_quick_contact_title', $_POST['contact_page_quick_contact_title'] );\nupdate_post_meta( $post_id, 'contact_page_quick_contact_sub_title', $_POST['contact_page_quick_contact_sub_title'] );\nupdate_post_meta( $post_id, 'contact_page_address_title', $_POST['contact_page_address_title'] );\nupdate_post_meta( $post_id, 'contact_page_address_sub_title', $_POST['contact_page_address_sub_title'] );\nupdate_post_meta( $post_id, 'contact_page_callus_title', $_POST['contact_page_callus_title'] );\nupdate_post_meta( $post_id, 'contact_page_call_phone', $_POST['contact_page_call_phone'] );\nupdate_post_meta( $post_id, 'contact_page_getin_touch_title', $_POST['contact_page_getin_touch_title'] );\nupdate_post_meta( $post_id, 'contact_page_getin_touch_content', $_POST['contact_page_getin_touch_content'] );\n}\n}", "function kalins_pdf_tool_save(){\n check_ajax_referer( \"kalins_pdf_tool_save\" );\n \n $request_body = json_decode(trim(file_get_contents('php://input')));\n $newTemplateSettings = $request_body->oOptions;\n\n $newTemplateSettings->date = date(\"Y-m-d H:i:s\", time());//add save date\n \n //get the array of templates\n $templates = kalins_pdf_get_options( KALINS_PDF_TOOL_TEMPLATE_OPTIONS_NAME );\n \n //remember this name so that it's kept as the current template so it's automatically loaded next time the page loads\n $templates->sCurTemplate = $newTemplateSettings->templateName;\n \n $bFound = false;\n $l = count($templates->aTemplates);\n for($i = 0; $i < $l; $i++){\n if($templates->aTemplates[$i]->templateName === $newTemplateSettings->templateName){\n $templates->aTemplates[$i] = $newTemplateSettings;\n $bFound = true;\n break;\n }\n }\n \n if(!$bFound){\n array_push($templates->aTemplates, $newTemplateSettings);\n }\n \n //save the result back to the database\n update_option(KALINS_PDF_TOOL_TEMPLATE_OPTIONS_NAME, $templates);\n \n $outputVar = new stdClass();\n $outputVar->status = \"success\";\n $outputVar->newTemplate = $newTemplateSettings;\n \n //send our new object back to the client so we can add it to our list\n die(json_encode($outputVar));\n}", "function saveItem ()\n{\n\n\tglobal $id, $message, $do;\n\n\t$parentId = validateInput('page_parentid', FILTER_VALIDATE_INT);\n\t$metaDataId = validateInput('meta_data_id', FILTER_VALIDATE_INT);\n\t$menuLabel = validateInput('menu_label');\n\t\n\t$photoPath = validateInput('photo_path');\n\t$thumbPhotoPath = validateInput('thumb_photo_path');\n\t$motifPath = validateInput('motif_path');\n\t\n\t$newHeroThumbPath = Helper::createImageThumb(\n\t\t\t\t\t\t\t\t\t\t\t\t$photoPath, \n\t\t\t\t\t\t\t\t\t\t\t\tTHUMB_WIDTH, \n\t\t\t\t\t\t\t\t\t\t\t\tTHUMB_HEIGHT, \n\t\t\t\t\t\t\t\t\t\t\t\t$thumbPhotoPath);\n\t\n\t$templateId = sanitizeInput('template_id', FILTER_VALIDATE_INT);\n\t$templateId = (($id == 1) ? HOME_TEMPLATE_ID: ((!empty($templateId)) ? $templateId: DEFAULT_TEMPLATE_ID)) ;\n\n\t$url = (requestVar('url')) ? validateInput('url') : validateInput('name');\n\t$url = Helper::url($url);\n\n\t$pageSlideshowId = validateInput('slideshow_id', FILTER_VALIDATE_INT);\n\t$pageGallertId = validateInput('gallery_id', FILTER_VALIDATE_INT);\n\t$pageMetaIndexId = validateInput('page_mrobots', FILTER_VALIDATE_INT);\n\t\n\t/** SAVE PAGE META DATA */\n\t$arrMetaData = array();\n\n\t$arrMetaData['name'] = validateInput('name');\n\t$arrMetaData['menu_label'] = $menuLabel;\n\t$arrMetaData['footer_menu'] = validateInput('footer_menu');\n\t\n\t$arrMetaData['heading'] = validateInput('heading');\n\t$arrMetaData['sub_heading'] = validateInput('sub_heading');\n\t$arrMetaData['url'] \t\t\t\t\t\t\t= ($id != 1) ? \"{$url}\" : 'home';\n\t$arrMetaData['full_url'] \t\t\t\t\t\t\t= ($id != 1) ? \"/{$url}\": \"/\";\n\t$arrMetaData['introduction'] = validateInput('introduction');\n\t$arrMetaData['short_description'] = validateInput('short_description');\n\t\n\t$arrMetaData['photo_caption_heading'] = validateInput('photo_heading');\n\t$arrMetaData['photo_caption'] = validateInput('photo_caption');\n\t$arrMetaData['photo_path'] = $photoPath;\n\t$arrMetaData['thumb_photo_path'] = $newHeroThumbPath;\n\t$arrMetaData['motif_photo_path'] = $motifPath;\n\n\t$arrMetaData['video_id'] = validateInput('video_id');\n\t$arrMetaData['quicklink_heading'] = validateInput('ql_heading');\n\t$arrMetaData['quicklink_photo_path'] = validateInput('ql_photo_path');\n\t$arrMetaData['quicklink_button_text'] = validateInput('ql_button_text');\n\t$arrMetaData['quicklink_description'] = validateInput('ql_description');\n\t\n\t$arrMetaData['title'] = validateInput('title');\n\t$arrMetaData['meta_description'] = validateInput('meta_description');\n\t$arrMetaData['og_title'] = validateInput('og_title');\n\t$arrMetaData['og_meta_description'] = validateInput('og_meta_description');\n\t$arrMetaData['og_image'] = (!empty(requestVar('og_image'))) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? validateInput('og_image')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $photoPath;\n\t\n\t$arrMetaData['page_code_head_close'] \t= requestVar('page_code_head_close');\n\t$arrMetaData['page_code_body_open'] \t= requestVar('page_code_body_open');\n\t$arrMetaData['page_code_body_close'] \t= requestVar('page_code_body_close');\n\t\n\t$arrMetaData['date_updated'] \t\t\t\t\t= Helper::getCurrentDateTimeStr();\n\t$arrMetaData['updated_by'] = USER_ID;\n\t$arrMetaData['gallery_id'] = $pageGallertId;\n\t$arrMetaData['slideshow_id'] = $pageSlideshowId;\n\t$arrMetaData['template_id'] = $templateId;\n\t$arrMetaData['page_meta_index_id'] = $pageMetaIndexId;\n\n\tupdateRow($arrMetaData, 'page_meta_data', \"WHERE id = '{$metaDataId}'\");\n\t\n\t/** SAVE PAGE DETAILS */\n\n\t$arrPageData = array();\n\n\t$arrPageData['parent_id'] \t\t= $parentId;\n\n\tupdateRow($arrPageData, 'general_pages', \"WHERE id='{$id}' LIMIT 1\");\n\n\tif ($id != 1){\n\t \n\t\t$pgFullUrl \t\t= Helper::buildPageUrl($id);\n\t\t\n\t\tif ($pgFullUrl){\n\t\t\t\n\t\t\t$arrPageData = array('full_url' => \"/{$pgFullUrl}\");\n\n\t\t\tupdateRow($arrPageData, 'page_meta_data', \"WHERE `id` = '{$metaDataId}'\");\n\n\t\t}\n\t}\n\t\n\n\t/** save quicklinks */\n\n\trunQuery(\"DELETE FROM `page_has_quicklink` WHERE `page_id` = '{$id}'\");\n\n\t$primaryQuicklinks = requestVar('quicklink_id');\n\t$primaryQuicklinksRank = requestVar('quicklink_rank');\n\n\tif (!empty($primaryQuicklinks)) { \n\n\t\tfor ($i=0; $i < count($primaryQuicklinks); $i++) { \n\n\t\t\t$arrPrimaryQuicklinkData = array();\n\t\t\n\t\t\t$primaryQuicklinkId = $primaryQuicklinks[$i];\n\t\t\t$primary_quicklink_rank = $primaryQuicklinksRank[$primaryQuicklinkId];\n\t\t\t$primary_quicklink_rank = (!empty($primary_quicklink_rank)) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? $primary_quicklink_rank \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 0;\n\n\t\t\t$arrPrimaryQuicklinkData['page_id'] = $id;\n\t\t\t$arrPrimaryQuicklinkData['quicklink_page_id'] = $primaryQuicklinkId;\n\t\t\t$arrPrimaryQuicklinkData['type'] = 'P';\n\t\t\t$arrPrimaryQuicklinkData['rank'] = $primary_quicklink_rank;\n\n\t\t\tinsertRow($arrPrimaryQuicklinkData, 'page_has_quicklink');\n\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Save page responsive content\n\t * Check if content record exist for this page\n\t * get all exisitng row belong to this page's content\n\t */\n\n\t$existingRows = fetchValue(\"SELECT GROUP_CONCAT(`id`) \n\t\tFROM `content_row` \n\t\tWHERE `page_meta_data_id` = '{$metaDataId}'\");\n\n\tif ($existingRows) { \n\n\t\t/** delete all columns */\n\t\trunQuery(\"DELETE FROM `content_column` \n\t\t\tWHERE `content_row_id` IN({$existingRows})\");\n\n\t\t/** delete all rows */\n\t\trunQuery(\"DELETE FROM `content_row` \n\t\t\tWHERE `id` IN($existingRows)\");\n\t}\n\n\n\tif (!empty(requestVar('row-index')) && $metaDataId) {\n\n\t\t/** save new content rows and columns */\n\t\t$rows = requestVar('row-index');\n\t\t$rowsRanks = requestVar('row-rank');\n\t\t$totalRows = count($rows);\n\n\t\tif ($totalRows > 0) { \n\n\t\t\tfor ($i=0; $i < $totalRows; $i++) { \n\n\t\t\t\t$rowData = array();\n\n\t\t\t\t$rowData['rank'] = ($rowsRanks[$i]);\n\t\t\t\t$rowData['page_meta_data_id'] = $metaDataId;\n\n\t\t\t\t$rowId = insertRow($rowData, 'content_row');\n\n\t\t\t\tif ($rowId) { \n\t\t\t\t\t\n\t\t\t\t\t$columnsRank = requestVar(\"content-{$rows[$i]}-rank\");\n\t\t\t\t\t$columnsContent = requestVar(\"content-{$rows[$i]}-text\");\n\t\t\t\t\t$columnsClass = requestVar(\"content-{$rows[$i]}-class\");\n\n\t\t\t\t\t$totalROwColumns = count($columnsContent);\n\n\t\t\t\t\tif ($totalROwColumns > 0) {\n\n\t\t\t\t\t\tfor ($k=0; $k < $totalROwColumns; $k++) { \n\n\t\t\t\t\t\t\t$columnData = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$columnData['content'] = $columnsContent[$k];\n\t\t\t\t\t\t\t$columnData['css_class'] = $columnsClass[$k];\n\t\t\t\t\t\t\t$columnData['rank'] = $columnsRank[$k];\n\t\t\t\t\t\t\t$columnData['content_row_id'] = $rowId;\n\n\t\t\t\t\t\t\tinsertRow($columnData, 'content_column');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** save page modules */\n\t\n\t$moduleRank = requestVar('mp_rank');\n\t$moduleIds = requestVar('mod_id');\n\n\t$sql = \"DELETE mp.* \n\t\tFROM `module_pages` mp\n\t\tLEFT JOIN `modules` m \n\t\t \tON (m.`mod_id` = mp.`mod_id`)\n WHERE mp.`page_id` = '{$id}'\n\t\t\tAND m.`mod_showincms`='\".FLAG_YES.\"'\";\n\t\t\t\n\trunQuery($sql);\n\n\tfor ($i=0; $i <= count($moduleIds); $i++) {\n\n\t\t$arrModuleData = array();\n\n\t\tif ($moduleRank[$i] > 0) {\n\n\t\t\t$arrModuleData['page_id'] = $id;\n\t\t\t$arrModuleData['modpages_rank'] = $moduleRank[$i];\n\t\t\t$arrModuleData['mod_id'] = $moduleIds[$i];\n\n\t\t\tinsertRow($arrModuleData, 'module_pages');\n\t\t}\n\t}\n\t\n\t$message = \"Page has been saved\";\n}", "private function _handle_save_template() {\n\t\t$template_id = (int) $_REQUEST['template_id'];\n\n\t\t// delete.\n\t\tif ( isset( $_REQUEST['butt_del'] ) && self::can_i( 'delete', 'Templates' ) ) {\n\t\t\t$template_data = self::get_template( $template_id );\n\t\t\tif ( module_form::confirm_delete(\n\t\t\t\t'template_id',\n\t\t\t\t_l( \"Really delete template: %s\", $template_data['template_key'] ),\n\t\t\t\tself::link_open( $template_id )\n\t\t\t) ) {\n\t\t\t\t$this->delete( $template_id );\n\t\t\t\t// todo: delete company template as well if exists.\n\t\t\t\tset_message( \"Template deleted successfully\" );\n\t\t\t\tredirect_browser( self::link_open( false ) );\n\t\t\t}\n\t\t}\n\n\t\t$data = $_POST;\n\t\t$already_saved = false;\n\t\tif ( (int) $template_id > 0 && class_exists( 'module_company', false ) ) {\n\t\t\tmodule_company::template_handle_save( $template_id, $data );\n\t\t\t// we have to redirect to a company specific version of this template\n\t\t\t// each company template must have a matching parent template id/key. cannot change keys in company unique config.\n\t\t}\n\t\t// write header/footer html based on uploaded images.\n\t\t// pass uploaded images to the file manager plugin.\n\t\t$template_id = update_insert( 'template_id', $template_id, 'template', $data );\n\t\t// redirect upon save.\n\t\tset_message( 'Template saved successfully!' );\n\t\tif ( isset( $_REQUEST['return'] ) && $_REQUEST['return'] ) {\n\t\t\tredirect_browser( $_REQUEST['return'] );\n\t\t}\n\t\tredirect_browser( $this->link_open( $template_id ) );\n\t\texit;\n\t}", "public function save()\n {\n $k = $this->getPages()->search(function ($item) {\n return $item->name == Request::get('page');\n });\n if ($k === false) {\n throw new \\Exception(\"Request invalid\", 1);\n }\n\n $page = $this->getPage(Request::get('page'));\n\n foreach ($page->fields as $field) {\n switch ($field->type) {\n case Input::GALLERY:\n if (Request::get($field->name) != '') {\n $items = json_decode(stripslashes(Request::get($field->name)), true);\n $field->setItems(new Collection($items));\n $field->save();\n }\n break;\n case Input::FILE:\n if (!empty($_FILES[$field->name])) {\n $uploadedfile = $_FILES[$field->name];\n $upload_overrides = array('test_form' => false);\n $movefile = wp_handle_upload($uploadedfile, $upload_overrides);\n\n if ($movefile && !isset($movefile['error'])) {\n $field->value = $movefile['url'];\n $field->save();\n } else {\n Log::info($movefile['error']);\n }\n }\n break;\n default:\n $field->value = Request::get($field->name);\n $field->save();\n break;\n }\n }\n update_option(Manager::NTO_SAVED_SUCCESSED, 'should_flash', false);\n $redirect_url = $this->getTabUrl(Request::get('page'));\n wp_redirect($redirect_url);\n }", "public function ajax_savepage(){\n\t\t$this->autoRender = false;\n\t\t$this->loadModel('Sheet');\n\t\t$c_user = $this->Session->read('useradmin');\n\t\t$sheetPageData = $this->Session->read('SheetPage');\n\t\t$template = $this->Session->read('Sheet.template');\n\t\tif ($this->Session->check('Sheet.id')){\n\t\t\t$sheetData['Sheet']['id'] = $this->Session->read('Sheet.id');\n\t\t\t$this->Sheet->SheetPage->deleteAll(array('SheetPage.sheet_id' => $sheetData['Sheet']['id']));\n\t\t}\n\t\tforeach ($sheetPageData as $key => $value) {\n\t\t\t$sheetData['SheetPage'][$key]['params'] = $value;\n\t\t}\n\t\t$sheetData['Sheet']['name'] = $this->Session->read('Sheet.name');\n\t\t$sheetData['Sheet']['user_id'] = $c_user['User']['id'];\n\t\t$sheetData['Sheet']['type'] = 'admin';\n\t\t$sheetData['Sheet']['template'] = $template;\n\t\t$this->Sheet->saveAll($sheetData);\n\t\t$this->Session->write('Sheet.id', $this->Sheet->id);\n\t\t$this->Session->write('Sheet.template', $template);\n\t}", "public function addPagesToTemplate($template,$array){\n foreach ($array as $page){\n $page2 = new Page();\n $template->pages()->save($page2);\n foreach ($page['elements'] as $element){\n $page2->elements()->save(new TextElement($element));\n }\n }\n }", "function mtv_save_postdata( $post_id ) {\n\n // verify if this is an auto save routine. \n // If it is our form has not been submitted, so we dont want to do anything\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n return;\n\n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n if ( ( isset ( $_POST['mtv_contact_noncename'] ) ) && ( ! wp_verify_nonce( $_POST['mtv_contact_noncename'], plugin_basename( __FILE__ ) ) ) )\n return;\n\n // Check permissions\n if ( ( isset ( $_POST['post_type'] ) ) && ( 'page' == $_POST['post_type'] ) ) {\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n } \n }\n else {\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n \n update_post_meta( $post_id, 'contact_page_getin_touch_content', $_POST['contact_page_getin_touch_content'] );\n update_post_meta( $post_id, 'post_sub_title', $_POST['post_sub_title'] );\n update_post_meta( $post_id, 'post_sub_description', $_POST['post_sub_description'] );\n}", "public function post_save(){\n\t\t\t\n\t\t$income_data \t\t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\t\t$page \t\t\t\t= \tPages::prepare_results_to_model($income_data);\n\t\t$required_fields \t= \tUtilites::prepare_validation('pages');\n\n\t\tif(isset($income_data[\"link\"])){\n\t\t\t\n\t\t\t$income_data[\"link\"] = $page->link = preg_replace('/[\\s~@#$^*()+=[\\]{}\"\\'|\\\\\\\\,.?:;<>\\/ ]/', '', str_replace(' ', '_', $income_data[\"link\"]));\n\t\t}\n\n\t\tif(Input::get('new')){\n\n\t\t\tif(!isset($page->lang)){\n\t\t\t\t\n\t\t\t\t$page->lang = (isset($income_data[\"lang\"])) ? $income_data[\"lang\"] : Config::get('application.language');\n\t\t\t}\n\n\t\t\t$required_fields['title'] = Utilites::add_to_validation($required_fields['title'], 'unique:Pages');\n\t\t}\n\n\t\tif(isset($page->id)){\n\n\t\t\t$required_fields['title'] = Utilites::add_to_validation($required_fields['title'], 'unique:Pages,title,'.$page->id);\n\t\t}\n\n\t\t$validation = Validator::make($income_data, $required_fields);\n\n\t\tif($validation->fails()){\n\n\t\t\treturn Utilites::compose_error($validation);\n\t\t}\n\n\t\t$page->save();\n\n\t\tif($page->id !== 0){\n\n\t\t\t$success_message = Utilites::alert(__('forms.saved_notification', array('item' => $page->title)), 'success');\n\n\t\t\tif(Input::get('new')){\n\n\t\t\t\t$data \t\t\t\t= \tarray();\n\t\t\t\t$data[\"text\"] \t\t= \t$success_message;\n\t\t\t\t$data[\"data_out\"] \t= \t'work_area';\n\t\t\t\t$data[\"data_link\"] \t= \taction('admin.pages.home@edit', array($page->id));\n\t\t\t\t$data[\"data_title\"] = \tUtilites::build_title(array('content.application_name', 'content.pages_word', $page->title));\n\n\t\t\t\treturn View::make('assets.message_redirect', $data); \n\n\t\t\t}else{\n\n\t\t\t\treturn $success_message;\n\t\t\t}\n\n\t\t}else{\n\n\t\t\treturn Utilites::alert(__('forms_errors.undefined'), 'error');\n\t\t}\n\t}", "public function save() {\n\t\tif ($result = $this->_db->command(\"INSERT INTO page (pag_id, pag_name, pag_title, pag_order) VALUES(:id, :name, :title, :order) ON DUPLICATE KEY UPDATE pag_name = :name, pag_title = :title, pag_order = :order\", array(\":id\" => $this->_id,\":name\" => $this->_name,\":title\" => $this->_title,\":order\" => $this->_order ), true)){\n\t\t\tif ($result[\"lastInsertId\"] != false) {\n\t\t\t\t$this->_id = $result[\"lastInsertId\"];\n\t\t\t}\n\n\t\t\tforeach($_layouts as $layout){\n\t\t\t\t$layout->save();\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new \\Exception(\"Failed to save page\", 02);\n\t\t}\n\t}", "public function saveTemplateAction()\n\t{\n\t\t$name = $this->in->getString('name');\n\n\t\t$block = null;\n\t\tif ($name == 'UserBundle:Portal:new-sidebar-block.html.twig') {\n\t\t\t$name = 'DeskPRO:CustomBlocks:Sidebar_' . mt_rand(1000,9999) . '_' . time() . '.html.twig';\n\t\t\t$block = new \\Application\\DeskPRO\\Entity\\PortalPageDisplay();\n\t\t\t$block->type = 'template';\n\t\t\t$block->data = array('tpl' => $name);\n\t\t\t$block->is_enabled = true;\n\t\t\t$block->section = 'sidebar';\n\t\t} elseif ($pid = \\Orb\\Util\\Strings::extractRegexMatch('#^EDIT_SIDEBAR_BLOCK:(.*?)$#', $name)) {\n\t\t\t$page_display = $this->em->find('DeskPRO:PortalPageDisplay', $pid);\n\t\t\tif (!$page_display || $page_display->type != 'template') {\n\t\t\t\tthrow new \\Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException;\n\t\t\t}\n\n\t\t\t$name = $page_display->data['tpl'];\n\t\t}\n\n\t\t$old_template_variant = App::getDb()->fetchColumn(\"\n\t\t\tSELECT variant_of\n\t\t\tFROM templates\n\t\t\tWHERE name = ?\n\t\t\tLIMIT 1\n\t\t\", array($name));\n\t\t$this->db->delete('templates', array('name' => $name));\n\n\t\t$code = $this->in->getRaw('code');\n\n\t\tif ($name == 'UserBundle:Portal:welcome-block.html.twig') {\n\t\t\t// Fix common mistake of removing </article>\n\t\t\tif (stripos($code, '<article') !== false && stripos($code, '</article>') === false) {\n\t\t\t\t$code .= \"\\n</article>\";\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t/** @var $twig \\Application\\DeskPRO\\Twig\\Environment */\n\t\t\t$twig = $this->container->get('twig');\n\n\t\t\t$compile_code = $code;\n\n\t\t\tif (strpos($name, 'DeskPRO:emails_') !== false || strpos($name, 'DeskPRO:custom_emails_') !== false) {\n\t\t\t\tif (strpos($code, '{% extends') !== false) {\n\t\t\t\t\t$code = trim(preg_replace('#<dp:subject>\\s*</dp:subject>#is', '', $code));\n\t\t\t\t}\n\t\t\t\t$proc = new \\Application\\DeskPRO\\Twig\\PreProcessor\\EmailPreProcessor();\n\t\t\t\t$compile_code = $proc->process($compile_code, $name);\n\t\t\t}\n\n\t\t\t$compile_code = $this->_preProcessCustomTemplate($compile_code);\n\n\t\t\t$compiled = $twig->compileSource($compile_code, $name);\n\t\t} catch (\\Twig_Error_Syntax $e) {\n\t\t\treturn $this->createJsonResponse(array(\n\t\t\t\t'error' => true,\n\t\t\t\t'error_syntax' => true,\n\t\t\t\t'error_code' => $e->getCode(),\n\t\t\t\t'error_message' => $e->getMessage(),\n\t\t\t\t'error_line' => $e->getTemplateLine(),\n\t\t\t\t'source' => $code\n\t\t\t));\n\t\t} catch (\\Twig_Error $e) {\n\t\t\treturn $this->createJsonResponse(array(\n\t\t\t\t'error' => true,\n\t\t\t\t'error_code' => $e->getCode(),\n\t\t\t\t'error_message' => $e->getMessage(),\n\t\t\t\t'source' => $code\n\t\t\t));\n\t\t}\n\n\t\tif ($name == 'UserBundle::layout.html.twig' && !\\DeskPRO\\Kernel\\License::getLicense()->isCopyfree()) {\n\t\t\t$code_test = strip_tags($code);\n\t\t\tif (!preg_match('#\\{\\{\\s*dp_copyright\\(\\)\\s*\\}\\}#', $code_test)) {\n\t\t\t\treturn $this->createJsonResponse(array(\n\t\t\t\t\t'error' => true,\n\t\t\t\t\t'error_code' => 'missing_copyright',\n\t\t\t\t\t'error_message' => 'You cannot remove the DeskPRO copyright without purchasing copyright removal.',\n\t\t\t\t\t'error_line' => 'N/A',\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\t$template = new Template();\n\t\t$template->style = $this->container->getSystemService('style');\n\t\t$template->name = $name;\n\t\t$template->setTemplate($code, $compiled);\n\t\tif ($old_template_variant) {\n\t\t\t$template->variant_of = $old_template_variant;\n\t\t}\n\n\t\t$ret_data = array(\n\t\t\t'success' => true,\n\t\t\t'name' => $name,\n\t\t);\n\n\t\t$this->db->beginTransaction();\n\t\ttry {\n\t\t\t$this->em->persist($template);\n\t\t\tif ($block) {\n\t\t\t\t$this->em->persist($block);\n\t\t\t}\n\n\t\t\t$this->em->flush();\n\t\t\t$this->db->commit();\n\n\t\t\tif ($block) {\n\t\t\t\t$ret_data['pid'] = $block->getId();\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->db->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t\tif ($name == 'UserBundle:Css:main.css.twig' || $name == 'UserBundle:Css:custom.css.twig') {\n\t\t\t\\Application\\DeskPRO\\Style\\RefreshStylesheets::refresh($this->container);\n\t\t}\n\n\t\t$cache = new \\Application\\DeskPRO\\CacheInvalidator\\UserPageCache();\n\t\t$cache->invalidateAll();\n\n\t\treturn $this->createJsonResponse($ret_data);\n\t}", "private function save()\n\t\t{\n\t\t\t$id = (int)$_REQUEST['id'];\n\t\t\t$template = (int)$_REQUEST['template'];\n\t\t\t$name = FN::sanitise($_REQUEST['name']);\n\t\t\t$note = $_REQUEST['note'];\n\t\t\t$language = isset($_REQUEST['language']) ? (int)$_REQUEST['language'] : NULL;\n\t\t\t$value = $_REQUEST['value'];\n\t\t\tif (!$language) $language = FN::getSessionValue(\"language\");\n\t\t\tDB::update(\"content\", array(\n\t\t\t\t\"template\"=>$template,\n\t\t\t\t\"name\"=>$name,\n\t\t\t\t\"note\"=>$note,\n\t\t\t\t\"language\"=>$language,\n\t\t\t\t\"value\"=>$value,\n\t\t\t\t\"user\"=>0,\n\t\t\t\t\"timestamp\"=>time(),\n\t\t\t\t\"attributes\"=>NULL\n\t\t\t\t), \"WHERE id=$id\");\n\t\t}", "function setup_sample_pages()\n\t{\n\t\t$time = time();\n\t\t\n\t\t$insert_batch = array\n\t\t(\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'title'\t\t\t\t=> 'Оферта',\n\t\t\t\t'permalink'\t\t\t=> 'agreement',\n\t\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t\t'last_update'\t\t=> $time,\n\t\t\t\t'allow_delete'\t\t=> 0,\n\t\t\t\t'meta'\t\t\t\t=> 1,\n\t\t\t\t'menu_order'\t\t=> 10,\n\t\t\t\t'thumbnail'\t\t\t=> null,\n\t\t\t\t'text'\t\t\t\t=> $this->sample_pagedata('agreement'),\n\t\t\t),\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'title'\t\t\t\t=> 'Контакты',\n\t\t\t\t'permalink'\t\t\t=> 'kontakty',\n\t\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t\t'last_update'\t\t=> $time,\n\t\t\t\t'allow_delete'\t\t=> 0,\n\t\t\t\t'meta'\t\t\t\t=> 1,\n\t\t\t\t'menu_order'\t\t=> 20,\n\t\t\t\t'thumbnail'\t\t\t=> null,\n\t\t\t\t'text'\t\t\t\t=> null,\n\t\t\t),\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'title'\t\t\t\t=> '[Системная] Текст на главной странице',\n\t\t\t\t'permalink'\t\t\t=> 'homepage',\n\t\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t\t'last_update'\t\t=> $time,\n\t\t\t\t'allow_delete'\t\t=> 0,\n\t\t\t\t'meta'\t\t\t\t=> 0,\n\t\t\t\t'menu_order'\t\t=> 0,\n\t\t\t\t'thumbnail'\t\t\t=> null,\n\t\t\t\t'text'\t\t\t\t=> null,\n\t\t\t),\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'title'\t\t\t\t=> '[Системная] Способы оплаты',\n\t\t\t\t'permalink'\t\t\t=> 'payment',\n\t\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t\t'last_update'\t\t=> $time,\n\t\t\t\t'allow_delete'\t\t=> 0,\n\t\t\t\t'meta'\t\t\t\t=> 0,\n\t\t\t\t'menu_order'\t\t=> 0,\n\t\t\t\t'thumbnail'\t\t\t=> null,\n\t\t\t\t'text'\t\t\t\t=> $this->sample_pagedata('payment'),\n\t\t\t),\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'title'\t\t\t\t=> 'Слайд 1',\n\t\t\t\t'permalink'\t\t\t=> 'sample-slide-1',\n\t\t\t\t'post_type'\t\t\t=> 'slide',\n\t\t\t\t'last_update'\t\t=> $time,\n\t\t\t\t'allow_delete'\t\t=> 1,\n\t\t\t\t'meta'\t\t\t\t=> null,\n\t\t\t\t'menu_order'\t\t=> 10,\n\t\t\t\t'thumbnail'\t\t\t=> 'sample-slide-1.jpg',\n\t\t\t\t'text'\t\t\t\t=> null,\n\t\t\t),\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'title'\t\t\t\t=> 'Слайд 2',\n\t\t\t\t'permalink'\t\t\t=> 'sample-slide-2',\n\t\t\t\t'post_type'\t\t\t=> 'slide',\n\t\t\t\t'last_update'\t\t=> $time,\n\t\t\t\t'allow_delete'\t\t=> 1,\n\t\t\t\t'meta'\t\t\t\t=> null,\n\t\t\t\t'menu_order'\t\t=> 20,\n\t\t\t\t'thumbnail'\t\t\t=> 'sample-slide-2.jpg',\n\t\t\t\t'text'\t\t\t\t=> null,\n\t\t\t),\n\t\t);\t\n\t\t\n\t\t$this->db->insert_batch('posts', $insert_batch);\n\t}", "function save_page_item_data( $post_id ) {\n\n\n\t// Secondly we need to check if the user intended to change this value.\n\tif ( ! isset( $_POST['page_noncename'] ) || ! wp_verify_nonce( $_POST['page_noncename'], plugin_basename( __FILE__ ) ) )\n\t\treturn;\n\n\t// Thirdly we can save the value to the database\n\n\t//if saving in a custom table, get post_ID\n\t$post_ID = $_POST['post_ID'];\n\n\n\t// Save, either creating or overwriting\n\t// header text\n\t$header_text_1 = sanitize_text_field( $_POST['header_text_1'] );\n\tadd_post_meta( $post_ID, 'header_text_1', $header_text_1, true ) or\n\t\tupdate_post_meta( $post_id, 'header_text_1', $header_text_1 );\n\t$header_text_2 = sanitize_text_field( $_POST['header_text_2'] );\n\tadd_post_meta( $post_ID, 'header_text_2', $header_text_2, true ) or\n\t\tupdate_post_meta( $post_id, 'header_text_2', $header_text_2 );\n\t$header_text_3 = sanitize_text_field( $_POST['header_text_3'] );\n\tadd_post_meta( $post_ID, 'header_text_3', $header_text_3, true ) or\n\t\tupdate_post_meta( $post_id, 'header_text_3', $header_text_3 );\n}", "function sinan_before_content_import( $selected_import ) {\n\n $homepage = array(\n 'post_title' => 'Homepage',\n 'post_type' => 'page', \n 'post_content' => '',\n 'post_status' => 'publish',\n );\n \n wp_insert_post( $homepage );\n $front_page = get_page_by_title( 'Homepage' );\n update_post_meta( $front_page -> ID, '_wp_page_template', 'page-templates/page_widgetized.php' );\n}", "function update_page_content() {\n\t $awp_testimonials_settings = get_option('awp_testimonials_settings');\n\t $page_details = get_page($awp_testimonials_settings['page_ID']);\n\t $page_content = str_replace('[apptivo_testimonials_fullview]', '', $page_details->post_content) . \"[apptivo_testimonials_fullview]\";\n\t //Update page\n\t $my_post = array();\n\t $my_post[ID] = $awp_testimonials_settings['page_ID'];\n\t $my_post['post_content'] = $page_content;\n\t //Update the post into the database\n\t wp_update_post($my_post);\n\t}", "private function setPageData() {\n $this->page_data = $this->SiteModel->getPageByID($this->getPage());\n }", "function kibble_create_pages(){\n\n\t$pages = array('channels', 'archives');\n\n\tforeach($pages as $page){\n\t\t$newpage_template = 'page-' . $page . '.php';\n\n\t\t$newpage_check = get_page_by_title($page);\n\n\t\t$newpage_page = array(\n\t\t\t'post_type' => 'page',\n\t\t\t'post_title' => $page,\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_author' => 1,\n\t\t);\n\n\t\tif(!isset($newpage_check->ID)){\n\t\t\t$newpage_id = wp_insert_post($newpage_page);\n\t\t\tupdate_post_meta($newpage_id, '_wp_page_template', $newpage_template);\n\t\t}\n\t}\n}", "public function save_page($page = false) {\n global $CFG;\n $mform = new pages_edit_product_form($page);\n if ($mform->is_cancelled()) {\n redirect(new moodle_url($CFG->wwwroot . '/local/pages/pages.php'));\n } else if ($data = $mform->get_data()) {\n require_once($CFG->libdir . '/formslib.php');\n\n $context = context_system::instance();\n $data->pagecontent['text'] = file_save_draft_area_files($data->pagecontent['itemid'], $context->id,\n 'local_pages', 'pagecontent',\n 0, array('subdirs' => true), $data->pagecontent['text']);\n\n $data->pagedata = '';\n if (strtolower($data->pagetype) == \"form\") {\n $pagedata = array();\n $fieldnames = required_param_array('fieldname', PARAM_RAW);\n $fieldtype = required_param_array('fieldtype', PARAM_RAW);\n $fieldrequired = required_param_array('fieldrequired', PARAM_RAW);\n $fielddefault = required_param_array('defaultvalue', PARAM_RAW);\n $fieldreadsfrom = required_param_array('readsfrom', PARAM_RAW);\n\n foreach ($fieldnames as $key => $value) {\n // Get all data sent from the form.\n // Stop empty fields being created.\n if (trim($value) != '') {\n $pagedata[] = array(\"name\" => $value,\n \"type\" => $fieldtype[$key],\n \"required\" => $fieldrequired[$key],\n \"defaultvalue\" => $fielddefault[$key],\n \"readsfrom\" => $fieldreadsfrom[$key]);\n }\n }\n $data->pagedata = json_encode($pagedata);\n }\n $recordpage = new stdClass();\n $recordpage->id = $data->id;\n $recordpage->pagedate = $data->pagedate;\n $recordpage->pagename = $data->pagename;\n $recordpage->pageorder = intval($data->pageorder);\n $recordpage->menuname = strtolower(str_replace(array(\" \", \"/\", \"\\\\\", \"'\", '\"', \";\", \"~\",\n \"?\", \"&\", \"@\", \"#\", \"$\", \"%\", \"^\", \"*\", \"(\", \")\", \"+\", \"=\"), \"\", trim($data->menuname)));\n $recordpage->onmenu = $data->onmenu;\n $recordpage->loginrequired = $data->loginrequired;\n $recordpage->accesslevel = $data->accesslevel;\n $recordpage->pagedata = $data->pagedata;\n $recordpage->pagetype = $data->pagetype;\n $recordpage->emailto = $data->emailto;\n $recordpage->pagelayout = $data->pagelayout;\n $recordpage->pageparent = intval($data->pageparent);\n $recordpage->pagecontent = $data->pagecontent['text'];\n $result = $page->update($recordpage);\n if ($result && $result > 0) {\n redirect(new moodle_url($CFG->wwwroot . '/local/pages/edit.php', array('id' => $result)));\n }\n }\n }", "public function save()\n {\n if ($this->state === 'unset') {\n // Insert the new Campaign to Database\n $this->insert_new();\n // Build Empty Ad Units\n $this->buildAdUnits();\n } else {\n $this->update_db();\n // Remove Old Ad Units\n $this->destroyAdUnits();\n // Rebuild the Ad Units\n $this->buildAdUnits();\n }\n }", "public function create_mtii_user_page_once() {\n $page = get_page_by_path('user-dashboard');\n $new_page_template = '../public/templates/mtii_user-template.php';\n\n if (!isset($page)) :\n $new_page_id = wp_insert_post(\n array (\n 'post_type' => 'page',\n 'post_title' => 'User Profile Page',\n 'post_content' => \"[mtii_user_dahsboard]\",\n 'post_status' => 'publish',\n 'guid' => 'mtii_user_dashboard',\n 'post_name' => 'user-dashboard'\n )\n );\n if (!empty($new_page_template)) {\n update_post_meta($new_page_id, '_wp_page_template', $new_page_template);\n }\n endif;\n\n $page_cbs = get_page_by_path('cbscburl');\n $new_page_template_cbs = '../public/templates/mtii_user-cbscburl.php';\n if (!isset($page_cbs)) :\n $new_page_id_cbs = wp_insert_post(\n array (\n 'post_type' => 'page',\n 'post_title' => 'cbscburl',\n 'post_content' => \"\",\n 'post_status' => 'publish',\n 'guid' => 'cbscburl',\n 'post_name' => 'cbscburl'\n )\n );\n if (!empty($new_page_template_cbs)) {\n update_post_meta($new_page_id_cbs, '_wp_page_template', $new_page_template_cbs);\n }\n endif;\n\n $page_upload_dummy_cert = get_page_by_path('download-dummy-certificate');\n $new_page_cert_download = '../public/templates/create-dummy-certificates/create-certificate-dummy.php';\n if (!isset($page_upload_dummy_cert)) :\n $page_upload_dummy_cert = wp_insert_post(\n array (\n 'post_type' => 'page',\n 'post_title' => 'Download Dummy Certificate',\n 'post_content' => '',\n 'post_status' => 'publish',\n 'guid' => 'download-dummy-certificate',\n 'post_name' => 'download-dummy-certificate'\n )\n );\n if (!empty($new_page_cert_download)) {\n update_post_meta($page_upload_dummy_cert, '_wp_page_template', $new_page_cert_download);\n }\n endif;\n\n $page_upload_ajax = get_page_by_path('mtii-ajax-for-sub');\n $sub_ajax_template = '../public/templates/mtii-sub-ajax.php';\n if (!isset($page_upload_ajax)) :\n $page_upload_ajax = wp_insert_post(\n array (\n 'post_type' => 'page',\n 'post_title' => 'Mtii Ajax For subs',\n 'post_content' => '',\n 'post_status' => 'publish',\n 'guid' => 'mtii-ajax-for-sub',\n 'post_name' => 'mtii-ajax-for-sub'\n )\n );\n if (!empty($sub_ajax_template)) {\n update_post_meta($page_upload_ajax, '_wp_page_template', $sub_ajax_template);\n }\n endif;\n }" ]
[ "0.6061411", "0.6052884", "0.60486776", "0.5994086", "0.59661883", "0.59206605", "0.5815967", "0.5737937", "0.57171005", "0.5704079", "0.5689961", "0.5635151", "0.5631515", "0.5599669", "0.55981886", "0.554121", "0.5540282", "0.5523955", "0.55180186", "0.5504562", "0.5484363", "0.544882", "0.54478544", "0.5429599", "0.5377199", "0.5357937", "0.5352104", "0.53506166", "0.529588", "0.529166" ]
0.6708724
0
CMB2 custom field(footer_icon_link) callback function.
public function cmb2_render_footer_icon_link_field_callback( $field, $value, $object_id, $object_type, $field_type ) { $value = wp_parse_args( $value, [ 'url' => '', 'icon' => '', ] ); ?> <div class="alignleft"> <?php echo wp_kses( $field_type->input( array( 'class' => 'cmb-type-text-medium', 'name' => esc_attr( $field_type->_name( '[url]' ) ), 'id' => esc_attr( $field_type->_id( '_url' ) ), 'type' => 'text', 'value' => esc_url( $value['url'] ), 'placeholder' => __( 'Footer item link', 'planet4-master-theme-backend' ), ) ), [ 'input' => [ 'class' => [], 'placeholder' => [], 'name' => [], 'id' => [], 'type' => [], 'value' => [], 'data-hash' => [], ], ] ); ?> </div> <div class="alignleft"> <?php echo wp_kses( $field_type->input( array( 'class' => 'cmb-type-text-medium', 'name' => esc_attr( $field_type->_name( '[icon]' ) ), 'id' => esc_attr( $field_type->_id( '_icon' ) ), 'type' => 'text', 'value' => $value['icon'], 'placeholder' => __( 'Footer icon name', 'planet4-master-theme-backend' ), ) ), [ 'input' => [ 'class' => [], 'placeholder' => [], 'name' => [], 'id' => [], 'type' => [], 'value' => [], 'data-hash' => [], ], ] ); ?> </div> <div class="alignleft"> <?php esc_html_e( 'In the “Footer icon name” field add the name of the icon you want from the', 'planet4-master-theme-backend' ); ?> <a target="_blank" href="https://github.com/greenpeace/planet4-styleguide/tree/master/src/icons"><?php esc_html_e( 'list of icons in the CSS styleguide', 'planet4-master-theme-backend' ); ?></a>. e.g. twitter-square</div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function custom_admin_footer() {}", "function bones_custom_admin_footer() {\n\t_e( '<span id=\"footer-thankyou\">Developed by <a href=\"http://33degreesds.com\" target=\"_blank\">33 Degrees Design Studio</a></span>.', 'bonestheme' );\n}", "function output_content_footer() {\n if (get_field('next_page_link') != ''):\n echo '<div class=\"divider\"></div>';\n echo '<div class=\"nextPage\"><span>Next:</span> <em><a href=\"'.get_field('next_page_link').'\">'.get_field('next_page_link_text').'</a></em></div>';\n endif;\n}", "function add_footer_links() {\n\t\t$plugin_data = get_plugin_data(__FILE__);\n\t\tprintf('%1$s Plugin | Version %2$s | By %3$s<br>', $plugin_data['Title'], $plugin_data['Version'], $plugin_data['Author']);\n\t}", "function rain_the_custom_footer(){\n\t\techo rain\\Rain_Customizer::get_instance()->get_footer_markup();\n\t}", "function ecovila_custom_footer_admin()\n{\n echo 'Criado por <a href=\"https://jtpsolution.com.br/\">JTP Solution</a>';\n}", "function zombie_footer_links_meta() {\n\t// display the wp3 menu if available\n\twp_nav_menu(array(\n\t\t'container' => '', // remove nav container\n\t\t'container_class' => 'footer-links footer-links-meta-container clearfix', // class of container (should you choose to use it)\n\t\t'menu' => 'Footer Links: Meta', // nav name\n\t\t'menu_class' => 'nav footer-nav footer-nav-meta clearfix', // adding custom nav class\n\t\t'theme_location' => 'footer-links-center-bottom', // where it's located in the theme\n\t\t'before' => '', // before the menu\n\t\t'after' => '', // after the menu\n\t\t'link_before' => '', // before each link\n\t\t'link_after' => '', // after each link\n\t\t'depth' => 0, // limit the depth of the nav\n\t\t'fallback_cb' => 'zombie_footer_links_meta_fallback' // fallback function\n\t));\n}", "function gavernwp_footer_hook() {\n\t// YOUR HOOK CODE HERE\n}", "function digitalriver_custom_admin_footer() {\n _e( '<span id=\"footer-thankyou\">Developed by <a href=\"http://www.olson.com/\" target=\"_blank\">Olson</a></span>.', 'digitalriver' );\n}", "function bbp_footer()\n{\n}", "function rec_epl_address_bar_map_icon_callback() { ?>\n\t<span class=\"epl-map-button-wrapper map-view\">\n\t\t<?php if ( is_single() ) { ?>\n\t\t\t<a class=\"epl-button epl-map-button\" href=\"#epl-advanced-map-single\">Map</a>\n\t\t<?php } else { ?>\n\t\t\t<a class=\"epl-button epl-map-button\" href=\"<?php the_permalink() ?>#epl-advanced-map-single\">Map</a>\n\t\t<?php } ?>\n\t</span>\n<?php\n}", "function custom_admin_footer() {\n\techo '<a href=\"http://monzilla.biz/\">Website Design by Monzilla Media</a>';\n}", "function bf_footer() {\r\n\tdo_action('bf_footer');\r\n}", "function mjf_footer_paths_setup() {\r\n\t// add_action( 'get_footer', 'mjf_dir_path' );\r\n}", "function setFooterIcon($url) {\n $this->footer_icon = $url;\n return $this;\n }", "function contentBoxFooter($contents, $right_link='') {\n $this->table_width = TEMPLATE_TABLE_WIDTH;\n $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;\n $this->table_cellpadding = '0';\n \n $this->footer_left_corner = TEMPLATE_BOX_IMAGE_FOOTER_LEFT;\n $this->footer_right_corner = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT;\n $this->footer_right_arrow = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT_ARROW;\n\n\n if (TEMPLATE_BOX_IMAGE_FOOTER_LEFT == 'true') {\n //$left_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFT);\n } else {\n //$left_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT);\n }\n\n if (TEMPLATE_BOX_IMAGE_FOOTER_LEFTRIGHT == 'true') {\n if (tep_not_null($right_link)) {\n //$right_arrow = '<a href=\"' . $right_link . '\">' . tep_image(TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW, ICON_ARROW_RIGHT) . '</a>';\n } else {\n //$right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);\n }\n } else {\n //$right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);\n }\n \n if (TEMPLATE_BOX_IMAGE_FOOTER_RIGHT == 'true') {\n // $right_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_RIGHT);\n } else {\n // $right_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT);\n }\n \n if (tep_not_null($right_link) ){\n $left_corner = $left_corner;\n $right_corner = $right_arrow;\n }else{\n $left_corner = $left_corner;\n $right_corner = $right_corner;\n }\n if (TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND != '') {\n //$foot_style = 'style=\"background-image: url(' . TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND .'); background-repeat: repeat-x;\"';\n } else {\n $foot_style = 'class=\"infoBoxFooter\"';\n }\n $info_box_contents = array();\n $info_box_contents[] = array(array('params' => 'class=\"infoBoxContentsfooter\"',\n 'text' => $left_corner),\n array('params' => 'width=\"100%\" ' . $foot_style,\n 'text' => $contents[0]['text']),\n array('params' => 'class=\"infoBoxContentsfooter\"',\n 'text' => $right_corner));\n $this->tableBox($info_box_contents, true);\n }", "function my_footer_admin_scripts() {\n}", "function yb_custom_admin_footer() {\n\techo '<span id=\"footer-thankyou\">'.__('Developed by ', 'yb').'<a href=\"http://yellowberri.com\" target=\"_blank\">Yellowberri</a></span>.&nbsp;';\n}", "function mk_lf_footer_credits_setup(){\n\tadd_action( 'wp_footer', 'mk_lf_footer_credits', 100 );\n\n}", "function rec_epl_address_bar_inspection_icon_callback() {\n\tglobal $property;\n\t$property_inspection_times = $property->get_property_inspection_times();\n\tif(trim($property_inspection_times) != '') { ?>\n\t\t<span class=\"epl-inspection-button-wrapper\">\n\t\t\t<?php if ( is_single() ) { ?>\n\t\t\t\t<a class=\"epl-button epl-inspection-button\" href=\"#epl_custom_inspection_times-2-background-wrapper\">Inspection</a>\n\t\t\t<?php } else { ?>\n\t\t\t\t<a class=\"epl-button epl-inspection-button\" href=\"<?php the_permalink() ?>#epl_custom_inspection_times-2-background-wrapper\">Inspection</a>\n\t\t\t<?php } ?>\n\t\t</span>\n\t<?php }\n}", "function wpdynabox_footer() {\n\n global $wpdynabox_options;\n global $thePostID;\n\n switch ($wpdynabox_options['footer_line']) {\n case \"br_before\":\n $br_before = \"<br />\";\n break;\n case \"br_after\":\n $br_after = \"<br />\";\n break;\n case \"p\":\n $p_before = \"<p>\";\n $p_after = \"</p>\";\n break;\n case \"inline\":\n break;\n }\n\n $corpadrao = $wpdynabox_options['colour'];\n\n $corpersonalizada = get_post_meta($thePostID, 'wp-dynabox_custom_color', true);\n\n if (is_single()) {\n if ($corpersonalizada != '') {\n $Dynaboxcor = $corpersonalizada;\n } else {\n $Dynaboxcor = $corpadrao;\n }\n } else {\n $Dynaboxcor = $corpadrao;\n }\n\n $Dynaboxcor = str_replace('#', '', $corpadrao);\n if ($Dynaboxcor != \"\")\n $Dynaboxcolour = \"&amp;cor=\" . $Dynaboxcor;\n else\n $Dynaboxcolour = '';\n\n switch ($wpdynabox_options['DynaboxS']) {\n\n case \"Dynaboxbr\":\n echo '<!-- WP-Dynabox for WordPress | http://oquetananet.com/wordpress/plugins/wp-dynabox/ --><br/>';\n echo '<script type=\"text/javascript\" src=\"http://boxes.lomadee.com/bs/config.html?divname=dynabox&amp;c=BR&amp;mdsrc=' . $wpdynabox_options['id'] . $Dynaboxcolour . '\"></script><br/>';\n if ($wpdynabox_options['show_footer'] == 'checked') {\n echo $br_before . $p_before . '<div class=\"wpdynabox_footer\">Este blog está utilizando o plugin <a href=\"http://oquetananet.com/wordpress/plugins/wp-dynabox/\">WP-Dynabox ';\n echo $wpdynabox_options['version'] . '</a></div>' . $p_after . $br_after;\n }\n echo '<br/><!-- End of WP-Dynabox code -->';\n\n break;\n }\n}", "function rew_register_menu_footer(){\n\n\t register_nav_menu( 'rew-footer-menu','3karatcom footer' );\n}", "function plugin_geticon_links2()\n{\n global $_CONF;\n\n return $_CONF['site_url'] . '/links/images/links.png';\n}", "public function testSettingFooterIcon()\n {\n $attachmentObject = new Attachment();\n $returnedObject = $attachmentObject->setFooterIcon($this->testUrl);\n $refAttachmentObject = new \\ReflectionObject($attachmentObject);\n $footerIconProperty = $refAttachmentObject->getProperty('footerIcon');\n $footerIconProperty->setAccessible(true);\n \n $this->assertInstanceOf(Attachment::class, $returnedObject);\n $this->assertEquals($this->testUrl, $footerIconProperty->getValue($attachmentObject));\n }", "function psc_filter_admin_footer () {\r\n echo '<span id=\"dashFooter\">Website developed by <a style = \"color: #f05a28; text-decoration: none;\" href=\"https://www.pixelstrikecreative.com\" target=\"_blank\">PixelStrike Creative</a></span>';\r\n}", "function lm_modify_footer_admin () {\n echo '<style type=\"text/css\">\n #footer-upgrade{color:transparent;}\n #footer-upgrade:after {\n content: \"Created For CCI Media\";\n color: #777;\n }\n a[target=\"_donate\"],\n a[target=\"_cf7todb\"],\n #bwp-info-place,\n .plugin-menu-page-upsells,\n .plugin-menu-page-heading img {display:none;}\n .plugin-menu-page-heading {height:50px;}\n </style>\n <span id=\"footer-meta\"><a href=\"http://lowermedia.net\" target=\"_blank\">A LowerMedia Site</a></span>';\n}", "public function dashboard_gravatar_caching_module_metabox_footer() {\r\n\t\t$url = wphb_get_admin_menu_url( 'caching' ) . '&view=gravatar';\r\n\t\t$this->view( 'dashboard/caching/gravatar-module-meta-box-footer', compact( 'url' ) );\r\n\t}", "function info_footer(){\n do_action('info_footer'); //Lance le hook\n}", "function vodi_header_icon_end() {\n ?></div><!-- /.site-header__header-icon --><?php\n }", "function jupiterx_child_modify_subfooter_credit() { ?>\n\n\t<a href=\"https//jupiterx.com\" target=\"_blank\">Jupiter X Child</a> theme for <a href=\"http://wordpress.org\" target=\"_blank\">WordPress</a>\n\n<?php }" ]
[ "0.6676027", "0.6367843", "0.62967825", "0.6244731", "0.62282145", "0.6182971", "0.61755526", "0.615915", "0.61156315", "0.60807", "0.6075509", "0.60725546", "0.60608774", "0.5984607", "0.5973799", "0.5956596", "0.59510756", "0.59502095", "0.5936385", "0.5927426", "0.59267616", "0.58945465", "0.58937335", "0.5890143", "0.5884406", "0.5883898", "0.587061", "0.5843066", "0.5837249", "0.58362246" ]
0.7580265
0
Handles an exception thrown during finalizing the response.
public function handleFinalizeException(\Throwable $exception): Response;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finishResponse()\r\n\t{\r\n\t\t/*\r\n\t\tif (!$this->committed &&\r\n\t\t\t!$this->bufferActive &&\r\n\t\t\t$this->status >= c('HttpServletResponse::SC_BAD_REQUEST') &&\r\n\t\t\tis_null($this->contentType))\r\n\t\t{\r\n\t\t\t$this->setContentType('text/html');\t\r\n\t\t\techo '<html><head><title>Error Report</title></head><body><h1>HTTP Status ' . $this->status . ' - ' . $this->message . '</h1></body></html>';\r\n\t\t\texit;\r\n\t\t}*/\r\n\r\n\t\t$this->flushBuffer();\r\n\t}", "public function outputError() {\n\t\ttry {\n\t\t\t$this->response->sendError();\n\t\t} catch (\\Exception $exception) {\n\t\t\terror_log('Uncaught exception during error shutdown: ' . $exception->getMessage());\n\t\t\texit;\n\t\t}\n\t}", "public function shutdown_handler() {\n if ($error = error_get_last()) {\n $this->exception_handler(new \\ErrorException($error['message'],\n $error['type'], 0, $error['file'], $error['line']));\n }\n }", "protected function _handleException(){ }", "public abstract function handleException();", "public function finalize()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif (isset($this->bufferAdd))\n\t\t\t{\n\t\t\t\t$this->bufferAdd->flush($this->overwrite, $this->commitWithin);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\tcatch (\\Solarium\\Exception\\HttpException $e)\n\t\t{\n\t\t\t$body = json_decode($e->getBody());\n\t\t\t$message = isset($body->error->msg) ? $body->error->msg : $e->getStatusMessage();\n\t\t\treturn $message;\n\t\t}\n\t}", "public function handlePrepareException(\\Throwable $exception): Response;", "protected function onControllerExceptionResponse(Response $response)\n {\n\n }", "public function handleResponseException(\\Throwable $exception): Response;", "public function __destruct() {\n\t\tif(!$this->complete) {\n\n\t\t\t$response = new Response();\n\t\t\t$response->setContentType('text/html');\n\t\t\techo $response->notfound('\n\t\t\t\t<!DOCTYPE html>\n\t\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t\t<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n\t\t\t\t\t<title>Albus RESTful Framework</title>\n\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css\">\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-lg-12\">\n\t\t\t\t\t\t\t\t<h1>404 Not Found</h1>\n\t\t\t\t\t\t\t\t<p class=\"lead\">The requested URL was not found.</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</body>\n\t\t\t\t</html>\n\t\t\t');\n\t\t}\n\t}", "private function handleException($exception)\n {\n $responseBody = $exception->getResponse()->getBody()->getContents();\n\n if (!empty($responseBody)) {\n $responseBody = json_decode($responseBody);\n\n $validationErrorResponse = [\n \"CODE\" => config('httpCodes.required'),\n \"MESSAGE\" => $responseBody->message,\n \"LINE\" => $exception->getLine(),\n \"FILE\" => $exception->getFile(),\n ];\n\n (new Response($validationErrorResponse, config('httpCodes.success')))->header('Content-Type', 'application/json')->send();\n exit;\n }\n }", "function after()\n\t{\n\t\tif( ! $this->data || $this->response->body())\n\t\t{\n\t\t\tparent::after();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($this->format == \"json\")\n\t\t\t{\n\t\t\t\t$this->response->headers('content-type', File::mime_by_ext('json'));\n\t\t\t\t$this->response->body(json_encode($this->data));\n\t\t\t}\n\t\t\telseif($this->format == \"xml\")\n\t\t\t{\n\t\t\t\t$this->response->headers('content-type', File::mime_by_ext('xml'));\n\t\t\t\t$this->response->body(Tools::array2xml($this->data));\n\t\t\t}\n\t\t}\n\t}", "public function onKernelException(ExceptionEvent $event): void\n {\n $exception = $event->getThrowable();\n\n // Customize your response object to display the exception details\n $response = new JsonResponse();\n $response->setContent($exception->getMessage());\n $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);\n\n // HttpExceptionInterface is a special type of exception that\n // holds status code and header details\n if ($exception instanceof BadRequestHttpException) {\n $response->setStatusCode(Response::HTTP_BAD_REQUEST);\n// $response->headers->replace($exception->getHeaders());\n }\n\n // sends the modified response object to the event\n $event->setResponse($response);\n }", "public function _handleResponse( )\n {\n if ($this->getLastHttpReturn()['http_code'] == 403)\n {\n throw new Xenmobile_RESTWS_Exception( $this->getLastRequestResult() );\n }\n else\n {\n if ( $this->getLastRequestResult() && is_object($this->getLastRequestResult()) )\n {\n if ( isset( $this->getLastRequestResult()->status ) )\n {\n return ( $this->getLastRequestResult() );\n }\n }\n }\n\n if ($this->getLastRequestResult()->status != 0)\n {\n $this->log( $this->getLastRequestResult(), __METHOD__ );\n }\n\n throw new Xenmobile_RESTWS_Exception( $this->getLastRequestResult()->message, $this->getLastRequestResult()->status );\n }", "public function finalize()\n {\n $view_class = \"MCPI\\\\\" . ucwords(strtolower($this->format)) . \"_View\";\n if (class_exists($view_class))\n {\n $view = new $view_class(array(\n 'title' => $this->title,\n 'menu' => $this->menu,\n 'main_data' => $this->main_data,\n 'body' => $this->body,\n 'body_template' => $this->body_template,\n 'body_data' => $this->body_data,\n ));\n header(\"HTTP/1.0 \" . $this->status);\n echo $view->render();\n }\n else\n {\n throw New \\Exception('Invalid Format - ' . $this->format);\n }\n exit;\n }", "public function onStreamError(Exception $exception)\n {\n $this->controller->onTransportClosed($exception);\n $this->controller = null;\n }", "public static function handle_shutdown()\n {\n $error = error_get_last();\n\n # We don't know whether this error has been already handled. The error_get_last\n # function will return E_NOTICE or E_STRICT errors if the stript has shut down\n # correctly. The only error which cannot be recovered from is E_ERROR, we have\n # to check the type then.\n\n if (($error !== null) && ($error['type'] == E_ERROR))\n {\n $e = new FatalError($error['message'], 0, $error['type'], $error['file'], $error['line']);\n OkapiExceptionHandler::handle($e);\n }\n }", "public function postDispatch()\n {\n if ($this->_unAuthorizedFlag) {\n $this->getResponse()->setHttpResponseCode(self::HTTP_UNAUTHORIZED);\n }\n elseif ($this->_badRequest) {\n $this->getResponse()->setHttpResponseCode(self::HTTP_BAD_REQUEST);\n }\n else {\n parent::postDispatch();\n }\n }", "public function handleConstructException(\\Throwable $exception): Response;", "public function handleShutdown() {\n $error = error_get_last();\n if ($error) {\n $exception = new ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line']);\n $this->handleException($exception);\n }\n }", "protected function handlePluginResponse(\n PluginReturnedResponseException $exception\n ) {\n $this->response = $exception->getResponse();\n }", "public function dispatchLoopShutdown()\n {\n $response = $this->getResponse();\n\n $monitor = Registry::get('monitor'); /** @var $monitor ZendSentry */\n\n if ($response->isException())\n {\n $monitor->writeLog($response);\n }\n }", "public function shutdown()\n {\n $err = error_get_last();\n if ($err !== null && $err !== $this->last_error) {\n $e = new \\ErrorException($err['message'], 0, $err['type'], $err['file'], $err['line']);\n $this->exceptionHandler($e);\n }\n }", "protected function handleException(\\Exception $e) {die($e->getMessage().PHP_EOL);}", "static function exception_out($e)\n {\n HttpResp::json_out($e->getCode(),[\"errors\"=>[[\"message\"=>$e->getMessage()]]]);\n }", "public function handleShutdown()\n {\n $error = error_get_last();\n // If an error has occurred that has not been displayed, we will create a fatal\n // error exception instance and pass it into the regular exception handling\n // code so it can be displayed back out to the developer for information.\n if (!is_null($error)) {\n extract($error);\n if (!$this->isFatal($type)) {\n return;\n }\n $this->handleException(new FatalError($message, $type, 0, $file, $line));\n }\n }", "public function generateErrorResponse() : void\n {\n @ob_clean();\n http_response_code($this->getHTTPStatusCode());\n header('Content-Type: text/plain');\n foreach ($this->getResponseHeaders() AS $header) {\n header($header);\n }\n echo $this->getMessage();\n exit;\n }", "private function handleJsonResponse() {\n $this->data = '';\n $response_body = $this->getBody()->getContents();\n if (empty($response_body)) {\n return;\n }\n\n // Allow any exceptions here to bubble up:\n try {\n $data = Json::decode($response_body);\n }\n catch (UnexpectedValueException $e) {\n throw new RestException($this, $e->getMessage(), $e->getCode(), $e);\n }\n\n if (empty($data)) {\n throw new RestException($this, t('Invalid response'));\n }\n\n if (!empty($data['error'])) {\n throw new RestException($this, $data['error']);\n }\n\n if (!empty($data[0]) && count($data) == 1) {\n $data = $data[0];\n }\n\n if (!empty($data['error'])) {\n throw new RestException($this, $data['error']);\n }\n\n if (!empty($data['errorCode'])) {\n throw new RestException($this, $data['errorCode']);\n }\n $this->data = $data;\n return $this;\n }", "public function after()\n\t{\n\t\t$this->response->body($this->content);\n\n\t\tparent::after();\n\t}", "public function http404Handle($e) {\n\n $this->\n Response()->\n SetHTTPCode($e->\n GetHttpCode(), $e->\n getMessage());\n\n $this->\n Set('excpMsg', $e->\n getMessage());\n\n $this->\n Set('excpTrc', $e->\n getTrace());\n }" ]
[ "0.6287269", "0.6185001", "0.6131986", "0.61291367", "0.6096722", "0.6071092", "0.6027938", "0.6024996", "0.5986771", "0.5961977", "0.5836861", "0.5825966", "0.57489055", "0.5729295", "0.56681895", "0.56606543", "0.5636114", "0.56244767", "0.5615838", "0.56102884", "0.5598688", "0.5596533", "0.5594363", "0.5583639", "0.5580171", "0.55791795", "0.55668956", "0.5562111", "0.55440813", "0.5541542" ]
0.75975305
0
Constructor. Available options: jq_picker_options: An array of keyvalues used as options by the JQueryUI datepicker
public function __construct($options = array(), $attributes = array()) { $this->addOption('jq_picker_options', array()); parent::__construct($options, $attributes); $default_picker_options = array( 'dateFormat' => 'yy-mm-dd', // Add other datepicker default options here // http://jqueryui.com/demos/datepicker/#options ); $this->setOption('jq_picker_options', array_merge($default_picker_options, $this->getOption('jq_picker_options'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _initDatePicker() {\r\n\t\t$this->Html->css('/CORE/jq/calendarPicker/jquery.calendarPicker.css', null, array('block' => 'script')) .\r\n\t\t$this->Html->script('/CORE/jq/calendarPicker/jquery.calendarPicker.js', array('block' => 'script')) .\r\n\t\t$this->Html->scriptBlock('\r\n\t\t\r\n\t\t\t//---- Calendar picker setup (in CmsFormHelper.php) -----\r\n\t\t\t// This calendar picker plugin has a nice UI, but unfortunately works only on a DIV, \r\n\t\t\t// and does not automatically tie to a text/hidden field, so we will do some of that \r\n\t\t\t// functionality below.\r\n\t\t\t\r\n\t\t\t\tcalendarPickerDefaults = {\r\n\t\t\t\t\tdays: 9,\r\n\t\t\t\t\tmonths: 3,\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Function for when a new date is clicked\r\n\t\t\t\t\t// Create a date string in the format MySQL prefers, then set the field value to this\r\n\t\t\t\t\tcallback: function(value) {\r\n\t\t\t\t\t\tvar d = value.currentDate,\r\n\t\t\t\t\t\t\tmonths = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],\r\n\t\t\t\t\t\t\tformattedDate = d.getFullYear() + \"-\" + pad(d.getMonth()+1) + \"-\" + pad(d.getDate());\r\n\t\t\t\t\t\tjQuery(\"#\" + this.fieldId).val(formattedDate);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcallbackDelay: 10\t// for some strange reason the plugin runs this callback on a delay... wtf?\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t// Called when text field is clicked on\r\n\t\t\t\tfunction showDatePicker(textfield) {\r\n\t\t\t\t\tvar $ = jQuery,\r\n\t\t\t\t\t\tid = textfield.id\r\n\t\t\t\t\t\tpickerDiv = $(\"#\" + id + \"Picker\")\t// the pickerDiv bases its ID on the ID of the textfield\r\n\t\t\t\t\t\t$textfield = $(textfield);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (pickerDiv.is(\":visible\")) return;\r\n\t\t\t\t\t\r\n\t\t\t\t\tpickerDiv\t// apply some CSS tweaks for our form\r\n\t\t\t\t\t\t// .css(\"margin-left\", $(textfield).width() + 20)\r\n\t\t\t\t\t\t// .css(\"margin-top\", \"-30px\")\r\n\t\t\t\t\t\t.slideDown(180);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Close picker when user clicks somewhere else on the screen\r\n\t\t\t\t\t$(document).on(\"mousedown.datePicker\", function(event) {\r\n\t\t\t\t\t\t// if field or picker was clicked, do nothing\r\n\t\t\t\t\t\tif (event.target == textfield\t\t\t\t\t\t\t\t// clicked on date field\r\n\t\t\t\t\t\t\t|| $(event.target).closest(\".datepicker\").length) {\t\t// clicked somewhere on date picker\r\n\t\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// otherwise, hide datepicker and cancel event\r\n\t\t\t\t\t\t$(\".datepicker\").slideUp(300);\r\n\t\t\t\t\t\t$(document).off(\"mousedown.datePicker\");\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfunction pad(string) {\t// pad string with leading zeros\r\n\t\t\t\t\tstring = string.toString();\r\n\t\t\t\t\tif (string.length == 1) return \"0\" + string;\r\n\t\t\t\t\treturn string;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t', array('block' => 'script'));\r\n\r\n\t}", "public function __construct()\n {\n $tmpl = implode(DIRECTORY_SEPARATOR,\n array(ARCH_PATH,'theme','datepicker.php'));\n parent::__construct($tmpl);\n \n $this->setName('date1');\n $this->setValue(date('Y-m-d'));\n }", "protected function makeJqOptions()\n {\n $jqOptions = null;\n if (!is_null($val = $this->TapToDismiss)) {$jqOptions['tapToDismiss'] = $val;}\n if (!is_null($val = $this->ToastClass)) {$jqOptions['toastClass'] = $val;}\n if (!is_null($val = $this->ContainerId)) {$jqOptions['containerId'] = $val;}\n if (!is_null($val = $this->Debug)) {$jqOptions['debug'] = $val;}\n if (!is_null($val = $this->ShowMethod)) {$jqOptions['showMethod'] = $val;}\n if (!is_null($val = $this->HideMethod)) {$jqOptions['hideMethod'] = $val;}\n if (!is_null($val = $this->ShowDuration)) {$jqOptions['showDuration'] = $val;}\n if (!is_null($val = $this->HideDuration)) {$jqOptions['hideDuration'] = $val;}\n if (!is_null($val = $this->TimeOut)) {$jqOptions['timeOut'] = $val;}\n if (!is_null($val = $this->ExtendedTimeOut)) {$jqOptions['extendedTimeOut'] = $val;}\n if (!is_null($val = $this->ShowEasing)) {$jqOptions['showEasing'] = $val;}\n if (!is_null($val = $this->HideEasing)) {$jqOptions['hideEasing'] = $val;}\n if (!is_null($val = $this->CloseEasing)) {$jqOptions['closeEasing'] = $val;}\n if (!is_null($val = $this->CloseOnHover)) {$jqOptions['closeOnHover'] = $val;}\n if (!is_null($val = $this->IconClasses)) {$jqOptions['iconClasses'] = $val;}\n if (!is_null($val = $this->IconClass)) {$jqOptions['iconClass'] = $val;}\n if (!is_null($val = $this->PositionClass)) {$jqOptions['positionClass'] = $val;}\n if (!is_null($val = $this->EscapeHtml)) {$jqOptions['escapeHtml'] = $val;}\n if (!is_null($val = $this->Target)) {$jqOptions['target'] = $val;}\n if (!is_null($val = $this->CloseHtml)) {$jqOptions['closeHtml'] = $val;}\n if (!is_null($val = $this->CloseClass)) {$jqOptions['closeClass '] = $val;}\n if (!is_null($val = $this->CloseButton)) {$jqOptions['closeButton'] = $val;}\n if (!is_null($val = $this->NewestOnTop)) {$jqOptions['newestOnTop'] = $val;}\n if (!is_null($val = $this->PreventDuplicates)) {$jqOptions['preventDuplicates'] = $val;}\n if (!is_null($val = $this->ProgressBar)) {$jqOptions['progressBar'] = $val;}\n if (!is_null($val = $this->ProgressClass)) {$jqOptions['progressClass'] = $val;}\n if (!is_null($val = $this->RTL)) {$jqOptions['rtl'] = $val;}\n return $jqOptions;\n }", "public function date_picker( $args=[] )\n {\n $a = wp_parse_args( $args, array(\n 'name' => '',\n 'id' => uniqid( 'date-' ),\n 'class' => 'regular-text',\n 'value' => '',\n 'placeholder' => 'yyyy-mm-dd',\n 'min-date' => date( 'Y-m-d', strtotime( 'today' ) ),\n 'max-date' => date( 'Y-m-d', strtotime( '+100 years' ) ),\n 'format' => 'yy-mm-dd'\n ) );\n\n wp_enqueue_script( 'jquery-ui-datepicker' );\n wp_enqueue_style( 'jquery-ui' );\n\n $html = $this->input( [\n 'type' => 'text',\n 'id' => $a[ 'id' ],\n 'name' => $a[ 'name' ],\n 'class' => $a[ 'class' ],\n 'placeholder' => $a[ 'placeholder' ],\n 'autocomplete' => $a[ 'autocomplete' ],\n ] );\n\n $html .= sprintf(\n \"<script>jQuery(function($){ $('#%s').datepicker({changeMonth: true,changeYear: true,minDate: '%s', maxDate: '%s',dateFormat:'%s'})});</script>\",\n esc_attr( $a[ 'id' ] ),\n esc_attr( $a[ 'min-date' ] ),\n esc_attr( $a[ 'max-date' ] ),\n esc_attr( $a[ 'format' ] )\n );\n\n return $html;\n }", "public function datepicker($fieldname, $options = array())\n {\n $defaults = array(\n 'required' => false,\n );\n\n $options = $options + $defaults;\n\n $datepicker_fieldname = $fieldname.'-datepicker';\n\n if ($options['required']) {\n $required_class = ' required';\n } else {\n $required_class = '';\n }\n\n //wrapping div\n $o = '<div class=\"input text'.$required_class.'\">';\n\n //input options common for both fields\n $inv_field_opts['type'] = $dp_field_opts['type'] = 'text';\n $inv_field_opts['div'] = $dp_field_opts['div'] = false;\n\n //visible field - ignored by cake\n if (isset($options['label']) && !empty($options['label'])) {\n $dp_field_opts['label'] = $options['label'];\n } else {\n $dp_field_opts['label'] = Inflector::humanize($fieldname);\n }\n $o .= $this->Form->input($datepicker_fieldname, $dp_field_opts);\n\n //invisible field (not type=\"hidden\")\n $inv_field_opts['label'] = false;\n $inv_field_opts['style'] = 'display: none';\n $o .= $this->Form->input($fieldname, $inv_field_opts);\n\n //retrieving the id of the last input generated by the Form helper\n $field_id = $this->Form->domId();\n\n //showing the eraser to clear the field when needed\n if (!$options['required']) {\n $o .= $this->Html->image('/img/eraser.png', array(\n 'id' => $field_id.'-clear',\n 'class' => 'clear-date',\n ));\n }\n\n //end of the wrapping div\n $o .= '</div>';\n\n //JavaScript\n\n //defaults\n if ($this->picker_count == 0) {\n $this->Js->buffer('\n $.datepicker.setDefaults( $.datepicker.regional[ \"nl\" ] );\n $.datepicker.setDefaults( {\n changeMonth: true,\n changeYear: true,\n showOtherMonths: true,\n selectOtherMonths: true,\n altFormat: \"yy-mm-dd\",\n buttonImage: \"'.Router::url('/img/calendar_1.png').'\",\n buttonImageOnly: true,\n buttonText: \"kalender\",\n showOn: \"both\"\n } );\n ');\n }\n\n //attaching the datepicker and the listeners\n $this->Js->buffer('\n var field_id = \"#'.$field_id.'\";\n\n var datepicker_field = $(field_id+\"-datepicker\");\n datepicker_field.datepicker({\n altField: field_id,\n onClose: function(dateText, inst){\n inst.input.removeAttr(\"disabled\");\n }\n }).focus(function(e){\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n //for preset dates (ex. when editing)\n var preset_val = $(field_id).val();\n if(preset_val){\n datepicker_field.datepicker(\"setDate\", new Date(preset_val));\n }\n\n $(field_id+\"-clear\").click(function(e){\n $(field_id).val(\"\");\n $(field_id+\"-datepicker\").val(\"\");\n });\n\n ');\n\n ++$this->picker_count;\n\n return $this->output($o);\n }", "public function init() {\n\t$this->_helper->_acl->allow('flos',NULL);\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t$this->view->jQuery()->addJavascriptFile($this->view->baseUrl()\n\t. '/js/JQuery/ui.datepicker.js', $type='text/javascript');\n\t$this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/css/ui.datepicker.css');\n\t$this->_config = Zend_Registry::get('config');\n\t$this->_gmapskey = $this->_config->webservice->googlemaps->apikey;\n\t$this->_geocoder = new Pas_Service_Geo_Coder($this->_gmapskey);\n }", "function _datepicker($m) {\n $tsid = $this->qnum.$this->count;\n $field = <<<HTML\n<input type=\"text\" class=\"datepicker {$this->qnum} $tsid\" value=\"\"\n\tonfocus=\"set_parent('{$this->parentid}'); return false;\"\n\tonchange=\"{$this->_set_setter()}\" size=\"10\" >\n<a href=\"javascript:void(0);\" onclick=\"$(this).prev().trigger('focus');\">select date</a>\nHTML;\n $this->_ins_field($m[1],$field);\n }", "public function datePicker()\n {\n \t$this->getManager( 'izojs')->datePicker();\n }", "public function generate()\n {\n\n // callback can change all options\n if (isset($GLOBALS['TL_HOOKS']['formDatepickerField']) && is_array($GLOBALS['TL_HOOKS']['formDatepickerField'])) {\n foreach ($GLOBALS['TL_HOOKS']['formDatepickerField'] as $callback) {\n $objCallback = (method_exists($callback[0], 'getInstance') ? call_user_func(array($callback[0], 'getInstance')) : new $callback[0]());\n $arrConfig = $objCallback->$callback[1]($this);\n }\n }\n\n // collect all options\n $this->options = [\n 'format' => $this->dateFormat,\n 'startDate' => $this->dateStartDate,\n 'endDate' => $this->dateEnddate,\n 'excludeCSS' => $this->dateExcludeCSS,\n 'excludeJS' => $this->dateExcludeJS,\n 'autoclose' => $this->dateAutoclose,\n 'beforeShowDay' => $this->dateBeforeShowDay,\n 'beforeShowMonth' => $this->dateBeforeShowMonth,\n 'beforeShowYear' => $this->dateBeforeShowYear,\n 'beforeShowDecade' => $this->dateBeforeShowDecade,\n 'beforeShowCentury' => $this->dateBeforeShowCentury,\n 'calendarWeeks' => $this->dateCalendarWeeks,\n 'clearBtn' => $this->dateClearBtn,\n 'container' => $this->dateContainer,\n 'datesDisabled' => $this->dateDatesDisabled,\n 'daysOfWeekDisabled' => $this->dateDaysOfWeekDisabled,\n 'daysOfWeekHighlighted' => $this->dateDaysOfWeekHighlighted,\n 'defaultViewDate' => $this->dateDefaultViewDate,\n 'disableTouchKeyboard' => $this->dateDisableTouchKeyboard,\n 'enableOnReadonly' => $this->dateEnableOnReadonly,\n 'forceParse' => $this->dateForceParse,\n 'assumeNearbyYear' => $this->dateAssumeNearbyYear,\n 'assumeNearbyYear_number' => $this->dateAssumeNearbyYear_number,\n 'immediateUpdates' => $this->dateImmediateUpdates,\n 'inputs' => $this->dateInputs,\n 'keyboardNavigation' => $this->dateKeyboardNavigation,\n 'language' => $this->dateLanguage,\n 'maxViewMode' => $this->dateMaxViewMode == 'centuries' ? '' : $this->dateMaxViewMode,\n 'minViewMode' => $this->dateMinViewMode == 'days' ? '' : $this->dateMinViewMode,\n 'multidate' => $this->dateMultidate,\n 'multidate_count' => $this->dateMultidate_count,\n 'multidateSeparator' => $this->dateMultidate && $this->dateMultidateSeperator != ',' ? $this->dateMultidateSeperator : '',\n 'orientation' => $this->dateOrientation,\n 'showOnFocus' => $this->dateShowOnFocus,\n 'startView' => $this->dateStartView,\n 'templates' => $this->dateTemplates,\n 'title' => $this->dateTitle,\n 'todayBtn' => $this->dateTodayBtn ? 'linked' : '',\n 'todayHighlight' => $this->dateTodayHighlight,\n 'toggleActive' => $this->dateToggleActive,\n 'weekStart' => $this->dateWeekStart == 'Sunday' ? '' : $this->dateWeekStart,\n 'zIndexOffset' => $this->dateZIndexOffset,\n ];\n\n $attributes = '';\n\n foreach($this->options as $key => $option){\n if($option != ''){\n $attributes .= 'data-date-'.ltrim(strtolower(preg_replace('/[A-Z]/', '-$0', $key)), '-').'=\"'.$option.'\"';\n }\n }\n\n\t\treturn '\n <div class=\"input-group date\" data-provide=\"datepicker\" '.$attributes.'>\n <input type=\"text\" name=\"'.$this->strName.'\" id=\"ctrl_'.$this->strId.'\" class=\"text '.$this->class.'\"'.$this->getAttributes().'> \n <span class=\"input-group-addon\">\n <span class=\"glyphicon glyphicon-th\"></span>\n </span>\n </div>';\n\n }", "public function __construct($name)\n {\n parent::__construct($name);\n $this->view->headScript()->prependFile('/resource/cmsAdmin/js/jquery/jquery.js');\n $this->view->headScript()->appendFile('/resource/cmsAdmin/js/datetimepicker/jquery.datetimepicker.full.min.js');\n $this->view->headLink()->appendStylesheet('/resource/cmsAdmin/js/datetimepicker/jquery.datetimepicker.min.css');\n $this->addFilter(new \\Mmi\\Filter\\EmptyToNull())\n ->addClass('form-control')\n ->setStep(15)\n ->setDatepicker(true)\n ->setTimepicker(true)\n ->setFormat('Y-m-d H:i');\n }", "public function __construct( TeamPick $team_pick ) {\n\t\t//\n\t\t$this->team_pick = $team_pick;\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TJuiControlAdapter($this));\n\t}", "public static function ui()\n\t{\n\t\t// Only load once\n\t\tif (!empty(static::$loaded[__METHOD__]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tself::framework();\n\n\t\tRHelperAsset::load('lib/jquery-ui/jquery-ui.min.js', self::EXTENSION);\n\n\t\t// Include datepicker translations\n\t\t$langTag = JFactory::getLanguage()->getTag();\n\t\t$langTagParts = explode('-', $langTag);\n\t\t$mainLang = reset($langTagParts);\n\t\tRHelperAsset::load('lib/jquery-ui/i18n/jquery.ui.datepicker-' . $langTag . '.js', self::EXTENSION);\n\t\tRHelperAsset::load('lib/jquery-ui/i18n/jquery.ui.datepicker-' . $mainLang . '.js', self::EXTENSION);\n\n\t\t// CSS\n\t\tRHelperAsset::load('lib/jquery-ui/jquery-ui.custom.min.css', self::EXTENSION);\n\n\t\tstatic::$loaded[__METHOD__] = true;\n\n\t\treturn;\n\t}", "public function __construct(Helper &$helper, $js_object, $model = '', $fields = array(), $values = array()) {\n $this->helper = $helper;\n $this->Form = $this->helper->Form;\n $this->js_object = $js_object;\n $this->model = ($model > '') ? $model : $this->Form->defaultModel;\n $CountryID = $this->toID($fields, 'country');\n $StateID = $this->toID($fields, 'state');\n $CityID = $this->toID($fields, 'city');\n $ZipID = $this->toID($fields, 'zip');\n \n $initialValues = '';\n if (isset($values['country']) == true) $initialValues .= '\"country\": \"' . $values['country'] . '\"';\n if (isset($values['state']) == true) {\n if ($initialValues > '') $initialValues .= ',';\n $initialValues .= '\"state\": \"' . $values['state'] . '\"';\n }\n if (isset($values['city']) == true) {\n if ($initialValues > '') $initialValues .= ',';\n $initialValues .= '\"city\": \"' . $values['city'] . '\"';\n }\n if (isset($values['zip']) == true) {\n if ($initialValues > '') $initialValues .= ',';\n $initialValues .= '\"zip\": \"' . $values['zip'] . '\"';\n }\n $initialValues = '{' . $initialValues . '}';\n $this->addInitComboCode($this->js_object . ' = new Ace.Locations(\"' . $CountryID . '\",\"' . $StateID . '\",\"' . $CityID . '\",\"' . $ZipID . '\", ' . $initialValues . ');');\n }", "public function __construct()\n {\n \t\t// when the plugin is activated\n\t\t//add_action( 'init', array( $this, 'add_hours') );\n add_action('wp_head', array( $this, 'skip_js'));\n add_action(\"wp_ajax_add_hours\", array($this, 'add_hours'));\n add_action(\"wp_ajax_nopriv_add_hours\", array($this, 'add_hours'));\n\t\tadd_action('admin_menu', array($this,'skip_volunteer_menu'));\n\t\tadd_shortcode( 'skip_form', array( $this, 'form_shortcode' ) );\n wp_enqueue_script('jquery-ui-datepicker');\n wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');\n\n }", "public static function dialog($date , $onSelect = null, $settings = null,\n $pos = null){\n $jquery = new YsJQueryCore();\n $jquery->setEvent(self::$uiEvent);\n $jquery->addArgument(new YsArgument(YsUIConstant::DIALOG_WIDGET));\n if($date !== null){\n $jquery->value($date);\n }\n if($onSelect !== null){\n $jquery->value($onSelect);\n }\n if($settings !== null){\n $jquery->value($settings);\n }\n if($pos !== null){\n $jquery->value($pos);\n }\n return $jquery;\n }", "function __construct( $options, $json ){\n\t\tif( is_array( $options ) && count( $options ) > 0 )\n\t\t\t$this->options = $options;\n\t\t$this->data_json = $json;\n\t}", "protected function getDatepickerOptions()\n {\n $options = array(\n 'format' => $this->config('dateFormatJs'),\n 'min' => $this->config('dateMin'),\n 'max' => $this->config('dateMax'),\n 'start' => $this->config('dateViewStart'),\n 'depth' => $this->config('dateViewDepth'),\n 'showFooter' => $this->config('dateShowFooter'),\n 'locale' => $this->config('dateLocale'),\n 'placeholder' => $this->config('placeholder'),\n 'autoOpen' => $this->config('dateAutoOpen'),\n 'identifier' => $this->getIdentifier()\n );\n\n if ($this->getValue() == '{today}') {\n $options['today'] = true;\n }\n\n return $options;\n }", "public function build() {\n\n\t $this->fieldset()->append($this->js_init());\n\n\t\t$this->set_attribute('data-datepicker-options', htmlspecialchars(\\Format::forge()->to_json($this->options)));\n return (string) parent::build();\n }", "function addDatePicker($name, $label = '', $options = [])\n {\n $this->fields[$name] = [\n 'key' => 'field_' . $name,\n 'label' => $label,\n 'name' => $name,\n 'type' => 'date_picker',\n 'instructions' => isset($options['instructions']) ? $options['instructions'] : '',\n 'required' => isset($options['required']) ? $options['required'] : 0,\n 'conditional_logic' => isset($options['conditional_logic']) ? $options['conditional_logic'] : 0,\n 'wrapper' => array(\n 'width' => isset($options['width']) ? $options['width'] : 100,\n 'class' => isset($options['class']) ? $options['class'] : '',\n 'id' => isset($options['id']) ? $options['id'] : '',\n ),\n 'display_format' => isset($options['display_format']) ? $options['display_format'] : 'd/m/Y',\n 'return_format' => isset($options['return_format']) ? $options['return_format'] : 'd/m/Y',\n 'first_day' => 1,\n ];\n }", "function __construct(){\n\t\t//get all of the options\n\t\t$this->getOptions();\n\t\t\n\t}", "public function __construct(array $options = array()) {\n\t\t$this->set_options($options);\n\t}", "public function __construct($options = array());", "function __construct() {\n\t\tparent::__construct(\n\t\t\t'season_select', // Base ID\n\t\t\t'Season Select', // Name\n\t\t\tarray( 'description' => __( 'A widget to select the current season', 'riichi' ), ) // Args\n\t\t\t);\n\t}", "function cv_enqueue_datepicker() {\n\t wp_enqueue_script( 'jquery-ui-datepicker' );\n\t // You need styling for the datepicker. For simplicity I've linked to the jQuery UI CSS on a CDN.\n\t wp_register_style( 'cv-jquery-ui', 'https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css' );\n\t wp_enqueue_style( 'cv-jquery-ui' ); \n\n\t if ( ! did_action( 'wp_enqueue_media' ) ) {\n\t wp_enqueue_media();\n\t }\n\t}", "public function __construct()\n {\n $this->option['format'] = self::FORMAT;\n }", "public function __construct(array $options = array());", "public function __construct() {\n \n $this->php_lib_path = $this->lib_path . 'php/';\n \n $this->php_lib_url = $this->lib_url . 'php/';\n \n $this->jquery_lib_path = $this->lib_path . 'jquery/';\n \n $this->jquery_lib_url = $this->lib_url . 'jquery/';\n\t}", "public function date2($field, $opts = array()) {\r\n\t\t// Setup JQ plugin options\r\n\t\t// Other options that can be passed can be found on:\r\n\t\t// http://jqueryui.com/demos/datepicker/\r\n\t\t$opts = Set::normalize(Set::merge(array(\r\n\t\t\t'dateFormat' => 'yy-mm-dd',\r\n\t\t\t// 'minDate' => -2,\t\t// 2 days in past\r\n\t\t\t// 'maxDate' => 30,\t\t// 30 days in future\r\n\t\t\t'firstDay' => 1,\t\t// Monday\r\n\t\t\t'showAnim' => 'fade',\r\n\t\t), $opts));\r\n\t\t// debug($opts);\r\n\t\t\r\n\t\t// Get current date\r\n\t\t$date = strtotime($this->getFieldVal($field));\r\n\t\tif ($date) {\r\n\t\t\t$date = date('Y-m-d', $date);\r\n\t\t} elseif (isset($opts['default'])) {\r\n\t\t\t$date = date('Y-m-d', strtotime($opts['default']));\r\n\t\t}\r\n\t\tunset($opts['default']);\r\n\t\t\r\n\t\t$this->Html->script('/CORE/jq/jquery.ui.datepicker.1.8.20.min.js', array('block' => 'script'));\r\n\t\t$this->Html->css($this->Minify->path('/CORE/jq/ui-themes/flick/jquery-ui-1.8.20.custom.css'), null, array('block' => 'script'));\r\n\t\t\r\n\t\t// Support for adding required=\"required\"\r\n\t\t$textboxOptions = array('value' => $date);\r\n\t\tif (array_key_exists('required', $opts)) {\r\n\t\t\t$textboxOptions['required'] = 'required';\r\n\t\t\tunset($opts['required']);\r\n\t\t}\r\n\t\t$opts = json_encode($opts);\r\n\t\t\r\n\t\treturn $this->text($field, $textboxOptions) . '\r\n\t\t\t<span>(yyyy-mm-dd)</span>\r\n\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\tjQuery(function($){\r\n\t\t\t\t\t$(\"#' . $this->domId($field) . '\").datepicker(' . $opts . ');\r\n\t\t\t\t});\r\n\t\t\t</script>\r\n\t\t';\r\n\t}", "public function __construct()\r\n {\r\n //set validations on field\r\n $this->validations = [\r\n '',\r\n ];\r\n\r\n //set live validations on field\r\n $this->liveValidations = [\r\n ];\r\n\r\n //set field info\r\n $this->fieldInfo = [\r\n 'help' => '',\r\n ];\r\n\r\n //set presentation view\r\n $this->setPresentation('select_default');\r\n }" ]
[ "0.6108694", "0.60876846", "0.59608805", "0.5681045", "0.56580466", "0.54183465", "0.5396663", "0.53695786", "0.52848715", "0.52629477", "0.521519", "0.5206894", "0.51810503", "0.517934", "0.51445925", "0.51434517", "0.5142528", "0.5139121", "0.5131027", "0.5116862", "0.49835786", "0.4982102", "0.49719262", "0.49696332", "0.4966482", "0.49460292", "0.49401438", "0.49383372", "0.49368483", "0.49201286" ]
0.76886314
0
Convert a widget name to a JQuery selector
private function widgetNameToJQuerySelector($name) { return 'input[name=\'' . strtr($name, array('[' => '\\\[', ']' => '\\\]')) . '\']'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWidgetName();", "public function getWidgetClassName();", "function EscapeJQuerySelector ($str) {\r\n $str = str_replace('[', '\\\\\\\\[', $str);\r\n $str = str_replace(']', '\\\\\\\\]', $str);\r\n\r\n return $str;\r\n}", "public function getWidget(string $name) : \\Dms\\Core\\Widget\\IWidget;", "protected function getWidgetName()\n {\n if (empty($this->widgetName)) {\n $names = explode('\\\\', get_class($this));\n $class = array_pop($names);\n $this->widgetName = substr($class, 0, -4);\n }\n\n return $this->widgetName;\n }", "protected function getJsSelector()\n {\n return $this->getOption('multiple') ? 'uo_widget_form_select_many' : 'uo_widget_form_select';\n }", "public function _selectorThis()\n\t{\n\t\treturn $this->_library(\"{$this->jQueryVar}(this)\");\n\t}", "function getWidget($widget_name = Null, $widget_type = Null, $data = NULL)\n {\n $widget = Modules::load('widgets/'.$widget_name, $data);\n \n $final_widget = $widget->$widget_type($data);\n \n return $final_widget;\n \n }", "abstract protected function get_widget();", "public function getSelector2Name();", "function widget($name) \r\n{\r\n\treturn Modules::run('wi_'.$name);\r\n}", "public static function widget($jquerySelector = null)\n {\n $staticMethod = YsUIConstant::WIDGET_METHOD;\n parent::$uiEvent = self::$uiEvent;\n return parent::$staticMethod($jquerySelector);\n }", "public static function widget($jquerySelector = null)\n {\n $staticMethod = YsUIConstant::WIDGET_METHOD;\n parent::$uiEvent = self::$uiEvent;\n return parent::$staticMethod($jquerySelector);\n }", "public function resolveWidget() {\n if (in_array($this->type, ['file', 'select'])) {\n return 'form/' . $this->type;\n }\n return 'form/input';\n }", "abstract protected function _builtWidget($element);", "function WPBC_get_widget_fx($atts){\n\textract(shortcode_atts(array(\n 'name' => FALSE,\n\t\t'id' => FALSE,\n\t\t'instance' => '',\n\t\t'args'=> ''\n ), $atts));\n\t\n\t$default_instance = array(\n\t\t'title' => '',\n\t);\n\t$instance = wp_parse_args( $instance, $default_instance );\n\t\n\t$default_args = array(\n\t\t'before_widget' => '<div class=\"widget-box\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"section-title\">',\n\t\t'after_title' => '</h4>',\n\t);\n\t$args = wp_parse_args( $args, $default_args );\n\t\n\tif($id){\n\t\t$widget_id = $id;\n\t\tglobal $wp_registered_widgets;\n\t\t$original_callback_params = func_get_args(); \n\t\t$widget_obj = $wp_registered_widgets[$widget_id];\n\t\t$widget_opt = get_option($widget_obj['callback'][0]->option_name);\n\t\t$widget_num = $widget_obj['params'][0]['number']; \n\t\t$original_callback = $widget_obj['original_callback'];\n\t\t//$widget_obj['callback'] = $original_callback; \n\t\t$widget_id_base = $widget_obj['callback'][0]->id_base; \n\t\t$widget_class_name = get_class($widget_obj['callback'][0]);\n\t\t$output = ''; \n\t\t$last_index = count($widget_opt); \n\t\t\n\t\tif($widget_num){ \n\t\t\t/*\n\t\t\t\n\t\t\t'widget_id'=>'arbitrary-instance-'.$id,\n\t\t\t'before_widget' => '<div class=\"widget-box\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"section-title\">',\n\t\t\t'after_title' => '</h4>',\n\t\t\t\n\t\t\t*/\n\t\t\t$this_options = $widget_opt[$widget_num]; \n\t\t\t \n\t\t\t$instance = array(\n\t\t\t\t'title' => $this_options['title'],\n\t\t\t\t'dropdown' => $this_options['dropdown'],\n\t\t\t\t'count' => $this_options['count'],\n\t\t\t); \n\t\t\t\n\t\t\t$fields = WPBC_widget_custom_fields();\n\t\t\t$fields_names = array(); \n\t\t\t\n\t\t\tif(!empty($fields)){\n\t\t\t\tforeach($fields as $field){\n\t\t\t\t\t$fields_names[$field['name']] = ''; \n\t\t\t\t\t$this_params = $field['callback']['params']; \n\t\t\t\t\tforeach($this_params as $p=>$v){ \n\t\t\t\t\t\t$custom = $this_options[$field['name']];\n\t\t\t\t\t\t$v = str_replace('[VAL]', $custom, $v); \n\t\t\t\t\t\t$args[$p] = $v;\n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t} \n\t\t\t \n\t\t\tob_start();\t\n\t\t\tthe_widget( $widget_class_name, $instance, $args );\n\t\t\t$output = ob_get_contents();\n\t\t\tob_end_clean(); \n\t\t\treturn apply_filters('widget_output', $output); \n\t\t}\n\t}\n\tif($name){\n\t\tob_start();\n\t\t//echo do_shortcode('[WPBC_widget widget_name=\"'. $name .'\"]');\n\t\tthe_widget( $name, $instance, $args );\n\t\t$output = ob_get_contents();\n\t\tob_end_clean(); \n\t\treturn apply_filters('widget_output', $output);\n\t}\n\t\n}", "function register_foo_widget() {\n register_widget( 'Foo_Widget' );\n}", "function control_widgets( $instance , $whichfield = 'widget' )\n\t{\n\t\t$sidebars_widgets = wp_get_sidebars_widgets();\n\t\t$list = '';\n\t\tforeach( (array) $sidebars_widgets['wijax-area'] as $item )\n\t\t{\n\t\t\tif( $number == $this->number )\n\t\t\t\tcontinue;\n\n\t\t\t$list .= '<option value=\"'. $item .'\" '. selected( $instance[ $whichfield ] , $item , FALSE ) .'>'. $item .'</option>';\n\t\t}\n\t\t$list .= '<option value=\"custom\" '. selected( $instance[ $whichfield ] , 'custom' , FALSE ) .'>Custom</option>';\n\n\t\treturn '<p><label for=\"'. $this->get_field_id( $whichfield ) .'\">Widget</label><select name=\"'. $this->get_field_name( $whichfield ) .'\" id=\"'. $this->get_field_id( $whichfield ) .'\" class=\"widefat\">'. $list . '</select></p><p><label for=\"'. $this->get_field_id( $whichfield .'-custom' ) .'\">Custom Widget Path</label><input name=\"'. $this->get_field_name( $whichfield .'-custom' ) .'\" id=\"'. $this->get_field_id( $whichfield .'-custom' ) .'\" class=\"widefat\" type=\"text\" value=\"'. esc_url( $instance[ $whichfield .'-custom' ] ).'\"></p>';\n\t}", "public function getSelector(): string\n {\n return $this->selector;\n }", "function fusion_get_new_widget_name( $widget_name, $widget_index ) {\n\t$current_sidebars = get_option( 'sidebars_widgets' );\n\t$all_widget_array = array();\n\tforeach ( $current_sidebars as $sidebar => $widgets ) {\n\t\tif ( ! empty( $widgets ) && is_array( $widgets ) && 'wp_inactive_widgets' != $sidebar ) {\n\t\t\tforeach ( $widgets as $widget ) {\n\t\t\t\t$all_widget_array[] = $widget;\n\t\t\t}\n\t\t}\n\t}\n\twhile ( in_array( $widget_name . '-' . $widget_index, $all_widget_array ) ) {\n\t\t$widget_index++;\n\t}\n\t$new_widget_name = $widget_name . '-' . $widget_index;\n\treturn $new_widget_name;\n}", "public function getWidgetName()\n {\n return lcfirst(str_replace('Ulrika_View_Helper_Vk_Vk', '', get_class($this)));\n }", "public function getSelector1Name();", "public function getWidgetDefinitionName()\n {\n return $this->widgetDefinitionName;\n }", "public function get_widget()\n {\n return new SelectWidget($this->choices);\n }", "function get_new_widget_name( $widget_name, $widget_index ) {\r\n\t\t$current_sidebars = get_option( 'sidebars_widgets' );\r\n\t\t$all_widget_array = array();\r\n\t\tforeach ( $current_sidebars as $sidebar => $widgets ) {\r\n\t\t\tif ( ! empty( $widgets ) && is_array( $widgets ) && $sidebar != 'wp_inactive_widgets' ) {\r\n\t\t\t\tforeach ( $widgets as $widget ) {\r\n\t\t\t\t\t$all_widget_array[] = $widget;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile ( in_array( $widget_name . '-' . $widget_index, $all_widget_array ) ) {\r\n\t\t\t$widget_index ++;\r\n\t\t}\r\n\t\t$new_widget_name = $widget_name . '-' . $widget_index;\r\n\r\n\t\treturn $new_widget_name;\r\n\t}", "function list_widgets() {\n\t global $wp_registered_widgets, $wp_registered_widget_controls;\n\n\t $sort = $wp_registered_widgets;\n\t usort( $sort, create_function( '$a, $b', 'return strnatcasecmp( $a[\"name\"], $b[\"name\"] );' ) );\n\t $done = array();\n\n\t $selectBox = \"<option value='' >\".__('Select').\"</option>\";\n\t $addControls = '';\n\n\t foreach ($sort as $widget) {\n\t if (in_array($widget['callback'], $done, true)) // We already showed this multi-widget\n\t continue;\n\n if ($this->onlyEletro && ( !isset($widget['eletroWidget'] ) ) ) // Check for only eletro widgets option\n continue;\n\n\t $sidebar = is_active_widget($widget['callback'], $widget['id'], false, false);\n\t $done[] = $widget['callback'];\n\n\t if (!isset($widget['params'][0]))\n\t $widget['params'][0] = array();\n\n\t $args = array('widget_name' => $widget['name'], '_display' => 'template');\n\n\t if (is_object($widget['callback'][0])) {\n\t $id_base = $wp_registered_widget_controls[$widget['id']]['id_base'];\n\t $args['_multi_num'] = $this->next_widget_id_number($id_base);\n $args['_add'] = 'multi';\n\t $args['_id_base'] = $id_base;\n\t\t if (!is_object($widget['callback'][0])) print_r($widget);\n\t\t $args['widget_id'] = get_class($widget['callback'][0]);\n\t $args['_multi_num'] = $this->next_widget_id_number($args['widget_id']);\n\t } else {\n\t $args['_add'] = 'single';\n\t if ($sidebar)\n\t $args['_hide'] = '1';\n\t $args['_id_base'] = $widget['id'];\n\t $args['widget_id'] = $widget['id'];\n\t }\n\n\t $selectBox .= \"<option value='{$args['_id_base']}' >{$widget['name']}</option>\";\n\n $addControls .= $this->get_widget_on_list($args);\n\t }\n echo '<div class=\"eletro_widgets_add_select\">';\n\t echo __('Add new Widget: ', 'eletroWidgets');\n\t echo \"<select id='eletro_widgets_add' name='eletro_widgets_add'>$selectBox</select>\";\n\t echo '</div>';\n\t echo $addControls;\n\t}", "public static function build($jquerySelector = null){\n $jquery = self::getInstance();\n $jquery->setEvent(self::$uiEvent);\n if($jquerySelector !== null) { $jquery->setSelector($jquerySelector); }\n return $jquery;\n }", "public function getWidget($widgetName)\n\t{\n\t\tif(strstr($widgetName,'.')!==false)\n\t\t{\n\t\t\t$widgetName = str_replace(\".\",\"\\\\\",$widgetName);\n\t\t}\n\t\t\n\t\tif(class_exists($widgetName))\n\t\t{\n\t\t\t$config = func_get_args();\n\t\t\tunset($config[0]);\n\t\t\t$class=new \\ReflectionClass($widgetName);\n\t\t\t$widget=call_user_func_array(array($class,'newInstance'),$config);\n\t\t\treturn $widget;\n\t\t}else{\n\t\t\tthrow new \\RuntimeException(\"Cannot found the widget:\".$id);\n\t\t}\n\t}", "function wpn_widget($widget_name, $args = array())\n {\n $CI =& get_instance();\n return $CI->widget->runit($widget_name, $args);\n }", "public function get_widget_form($widget)\n {\n $widget['html'] = $widget['html'] . PeepSoTemplate::exec_template('widgets', 'admin_form', $widget, true);\n return $widget;\n }" ]
[ "0.61657137", "0.6027984", "0.569513", "0.56886595", "0.56835604", "0.5621315", "0.5591639", "0.55789554", "0.5476694", "0.54544324", "0.5431375", "0.54049265", "0.54049265", "0.53442395", "0.53208876", "0.53191394", "0.5276421", "0.5240632", "0.5225986", "0.52058107", "0.52037024", "0.5194408", "0.5162637", "0.51415867", "0.5137903", "0.51185703", "0.5100889", "0.50725055", "0.50589997", "0.5054728" ]
0.8172354
0
This throws an error because I'm not authorized to retrieve submissions in behalf of other students
private function testGettingMultipleSubmissionsMultipleStudents() { $studentIds = array(10733259,10733259); $assignmentIds = array(1660419, 1660406, 1660412); $multipleStudents = true; $multipleAssignments = true; $allStudents = false; $allAssignments = false; //can have the student Id param null if multipleUsers is set to false (we'll only get the current user's submissions) $req = new SubmissionsRequest(ActionType::GET, $studentIds, $allStudents, $assignmentIds, $allAssignments, $multipleStudents, $multipleAssignments); $roots = new Roots(); $res = $roots->submissions($req); echo json_encode($res); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSubmission($submission_id)\r\n\t{\r\n\t\t// admin only\r\n\t}", "public function ReadSubmission()\n {\n if (RoleAuthor() == 1){\n if(@Auth::user()->auth_info->id_user == NULL){\n return redirect(route('authorid.verifikasi'));\n }elseif(Auth::user()->auth_info->status_verifikasi == NULL){\n return redirect(route('dashboard'));\n }\n $data_topics = Topics::get();\n $data_publication = PublicationSubmissions::get();\n return view('layouts/submission/submission', compact('data_topics', 'data_publication'));\n }\n else{\n return redirect(route('unauthorized.read'));\n }\n }", "function verify_student_access($progress_id) {\n $current_user = wp_get_current_user();\n $user_id = $current_user->ID;\n return CNMI_Progress::get_progress_by_id_and_user_id($progress_id, $user_id);\n}", "function getStudentSubmission($sid, $asid){\n global $pdo;\n $stmt = $pdo->prepare('SELECT * FROM assignment_students WHERE asaid = :aid AND asuid = :sid');\n $criteria = ['aid'=>$asid, 'sid'=>$sid];\n $stmt->execute($criteria);\n return $stmt->fetch();\n }", "public function placeRequestToReviewer()\n {\n }", "function submission($args, $request) {\n\t\t$submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);\n\t\t$templateMgr = TemplateManager::getManager($request);\n\t\t$reviewRoundDao = DAORegistry::getDAO('ReviewRoundDAO');\n\t\t$internalReviewRounds = $reviewRoundDao->getBySubmissionId($submission->getId(), WORKFLOW_STAGE_ID_INTERNAL_REVIEW);\n\t\t$templateMgr->assign('internalReviewRounds', $internalReviewRounds);\n\t\treturn parent::submission($args, $request);\n\t}", "public function retrieve_student_award()\n {\n //probably wants to be overwritten on the \n }", "function find_submissions_by_assigment($id) {\n\treturn Database::get()->queryArray(\"SELECT assignment_submit.grade, assignment_submit.submission_date, assignment_submit.grade_comments, user.username FROM assignment_submit Inner Join user on (user.id=assignment_submit.uid) WHERE assignment_id = ?d ORDER BY grade DESC, submission_date\", $id);\n \n}", "private function getStudentID($submission_id){\n $quoted_submission_id = $this->database->quote($submission_id);\n $query = \"SELECT student_id FROM submissions\n WHERE id = $quoted_submission_id\";\n return $this->database->query($query)->fetchAll(PDO::FETCH_ASSOC)[0]['student_id'];\n }", "function _crf_webform_submission_access(User $user, $bundle, $webform_submission, $op) {\n // Whether the webform in question is a Funding Test\n $is_funding_test = in_array($webform_submission->webform_id->target_id, crf_webform_get_test_webform_ids());\n $source_entity = $webform_submission->getSourceEntity(); // This is the \"Requesting Entity\" node for RFFs, and the RFF node for funding tests.\n\n if ($is_funding_test) {\n $allowed_roles = [\n 'administrator',\n 'funding_coordinator',\n 'funding_analyst',\n 'funding_manager',\n ];\n\n $can_view_funding_tests = (count(array_intersect($allowed_roles, $user->getRoles())) > 0);\n if ($op === 'view' && $can_view_funding_tests) {\n return AccessResult::allowed()->cachePerUser();\n }\n\n $wrapper_entity = $source_entity;\n $moderation_state = $wrapper_entity->get('moderation_state')->value;\n if ($user->hasRole('funding_manager')) {\n $can_add_tests = crf_access_user_can_add_tests_to_rff($user, $wrapper_entity);\n $is_attached = false;\n foreach ($wrapper_entity->field_rff_test_submissions as $value) {\n if ($value->target_id === $webform_submission->id()) {\n $is_attached = true;\n }\n }\n switch ($op) {\n case 'create':\n case 'update':\n // Managers when assigned to RFF and RFF is in “Manager Review” state, and Test Webform Submission is referenced in Manager Tests field of RFF.\n if ($is_funding_test && $can_add_tests && $is_attached ) {\n return AccessResult::allowed()->cachePerUser();\n }\n else {\n return AccessResult::forbidden()->cachePerUser();\n }\n break;\n case 'duplicate':\n return AccessResult::forbidden()->cachePerUser();\n break;\n }\n }\n\n if ($user->hasRole('funding_analyst')) {\n $can_add_tests = crf_access_user_can_add_tests_to_rff($user, $wrapper_entity);\n $is_attached = false;\n foreach ($wrapper_entity->field_rff_test_submissions as $value) {\n if ($value->target_id === $webform_submission->id()) {\n $is_attached = true;\n }\n }\n switch ($op) {\n case 'create':\n case 'update':\n // Analyst when assigned to RFF, RFF is in “Analyst Review” state, and Test Webform Submission is referenced in Analyst Tests field of RFF.\n if ($is_funding_test && $is_attached && $can_add_tests) {\n\n return AccessResult::allowed()->cachePerUser();\n }\n else {\n return AccessResult::forbidden()->cachePerUser();\n }\n break;\n\n\n case 'duplicate':\n return AccessResult::forbidden()->cachePerUser();\n break;\n\n }\n }\n\n if ($user->hasRole('funding_coordinator')) {\n $is_assigned = $wrapper_entity->hasField('field_funding_coordinator_user') && $wrapper_entity->field_funding_coordinator_user->target_id === $user->id();\n\n switch ($op) {\n case 'update':\n case 'create':\n case 'duplicate':\n return AccessResult::forbidden()->cachePerUser();\n break;\n }\n }\n } // Non-funding tests - RFF\n else {\n $query = \\Drupal::entityTypeManager()\n ->getStorage('node')\n ->loadByProperties([\n 'type' => 'request_for_reimbursement',\n 'field_requesting_entity' => $source_entity->id(),\n 'field_request_details' => $webform_submission->id()\n ]);\n $wrapper_entity = reset($query); // This is the wrapper node for the webform request.\n // If there is no wrapper entity, this is likely not a webform submission we are interested in.\n if (!$wrapper_entity) {\n return AccessResult::neutral()->cachePerUser();\n }\n $moderation_state = $wrapper_entity->get('moderation_state')->value;\n\n // Reimbursement Request users.\n if ($user->hasRole('reimbursement_requester')) {\n // Account's requesting entity.\n $account_requesting_entity_id = $user->get('field_u_requesting_entity')->target_id;\n // Webform's requesting entity.\n $webform_requesting_entity_id = $source_entity->id();\n\n\n // Always deny access if the requesting entities do not match.\n if (empty($webform_requesting_entity_id) || $account_requesting_entity_id !== $webform_requesting_entity_id) {\n return AccessResult::forbidden()->cachePerUser();\n }\n\n switch ($op) {\n case 'view':\n // Role of reimbursement_requester can view self-owned submissions.\n return AccessResult::allowed()->cachePerUser();\n break;\n\n case 'update':\n // Can update when in “Needs Additional Documentation” state.\n if ($moderation_state === 'requires_additional_documentation') {\n return AccessResult::allowed()->cachePerUser();\n } else {\n return AccessResult::forbidden()->cachePerUser();\n }\n break;\n\n case 'create':\n case 'delete':\n case 'duplicate':\n return AccessResult::forbidden()->cachePerUser();\n break;\n }\n }\n }\n\n return AccessResult::neutral();\n}", "function authorizeRequestToken()\n {\n $scopes = array(\n 'https://docs.google.com/feeds/',\n );\n\n $consumer = new GdataOauthClient();\n \n $_SESSION['GOOGLEDOCS_REQUEST_TOKEN'] = serialize($consumer->fetchRequestToken(\n implode(' ', $scopes), common_local_url('googledocsauthorization').'?do=access_token'));\n $auth_link = $consumer->getRedirectUrl();\n \n common_redirect($auth_link);\n \n // @fixme handle for exception\n }", "public function authorize(User $user, Submission $submission)\n {\n if ($user->role !== 'head-of-program-study') {\n return false;\n }\n\n return $user->study_id === $submission->lecturer->study_id;\n }", "public function isPermitted()\n {\n return true;\n }", "public function authorize()\n\t{\n $semesterId = $this->route('semester')->id;\n\t\treturn Semester::find($semesterId)->user->id == Auth::id();\n\t}", "public function getSubmissionData();", "public function testUserCannotViewSingleUnpublishedPostIfNotAuthor()\n {\n $data = [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => '$argon2id$v=19$m=65536,t=4,p=1$eTBDS3FZaURtcFJhbDNKbA$k60/BHW65f2Xg8x8yPFyEUXcnwnSkZc8A4UXv39KZU4'\n ];\n\n $postAuthor = $this->authorize($data);\n\n $post = $this->postWithImageAndTagsApproved($postAuthor);\n\n $repo = $this->entityManager->getRepository(Post::class);\n\n $postRepo = $repo->findOneBy(['id' => $post['data']['id']]);\n\n $this->entityManager->persist($postRepo);\n $this->entityManager->flush();\n\n $authUser = $this->authorize();\n\n $this->client->request('GET', \"post/{$postRepo->getSlug()}\",\n [],\n [],\n $authUser);\n\n $this->assertResponseStatusCodeSame(403);\n\n }", "function run()\r\n {\r\n \r\n $publications = Request :: get(self :: PARAM_PUBLICATION_ID);\r\n \r\n $this->set_parameter(self :: PARAM_PUBLICATION_ID, $publications);\r\n \r\n if ($publications && ! is_array($publications))\r\n {\r\n $publications = array($publications);\r\n }\r\n \r\n $locations = array();\r\n \r\n foreach ($publications as $publication_id)\r\n {\r\n \r\n $publication = InternshipOrganizerDataManager :: get_instance()->retrieve_publication($publication_id);\r\n if ($this->get_user()->is_platform_admin() || $publication->get_publisher_id() == $this->get_user_id())\r\n {\r\n $locations[] = InternshipOrganizerRights :: get_location_by_identifier_from_internship_organizers_subtree($publication_id, InternshipOrganizerRights :: TYPE_PUBLICATION);\r\n }\r\n }\r\n \r\n $publication_place = $publication->get_publication_place();\r\n \r\n $user_ids = array();\r\n \r\n switch ($publication_place)\r\n {\r\n case InternshipOrganizerPublicationPlace :: MOMENT :\r\n $moment = InternshipOrganizerDataManager :: get_instance()->retrieve_moment($publication->get_place_id());\r\n $location = $moment->get_location();\r\n $user_ids = $location->get_user_ids(InternshipOrganizerUserType :: get_user_types());\r\n break;\r\n case InternshipOrganizerPublicationPlace :: AGREEMENT :\r\n $agreement = InternshipOrganizerDataManager :: get_instance()->retrieve_agreement($publication->get_place_id());\r\n $user_ids = $agreement->get_user_ids(InternshipOrganizerUserType :: get_user_types());\r\n break;\r\n case InternshipOrganizerPublicationPlace :: PERIOD :\r\n $period = InternshipOrganizerDataManager :: get_instance()->retrieve_period($publication->get_place_id());\r\n $user_ids = $period->get_user_ids(InternshipOrganizerUserType :: get_user_types());\r\n break;\r\n case InternshipOrganizerPublicationPlace :: LOCATION :\r\n $location = InternshipOrganizerDataManager :: get_instance()->retrieve_location($publication->get_place_id());\r\n $organisation = $location->get_organisation();\r\n $user_ids = $organisation->get_user_ids();\r\n break; \r\n default :\r\n ;\r\n break;\r\n }\r\n \r\n $manager = new RightsEditorManager($this, $locations);\r\n if (count($user_ids) > 0)\r\n {\r\n $manager->limit_users($user_ids);\r\n }\r\n else\r\n {\r\n $manager->limit_users(array(0));\r\n }\r\n \r\n $manager->set_modus(RightsEditorManager :: MODUS_USERS);\r\n $manager->run();\r\n }", "public function get_submittal_review_single(Request $request, $sr_id)\n {\n try\n {\n // $user = array(\n // 'userid' => Auth::user()->id,\n // 'role' => Auth::user()->role\n // );\n // $user = (object) $user;\n // $post = new Resource_Post(); // You create a new resource Post instance\n // if (Gate::forUser($user)->denies('allow_admin', [$post,false])) { \n // $result = array('code'=>403, \"description\"=>\"Access denies\");\n // return response()->json($result, 403);\n // } \n // else {\n $query = DB::table('project_submittal_review')\n->leftJoin('project_submittals as submittal', 'project_submittal_review.sr_submittal_id', '=', 'submittal.sub_id')\n->leftJoin('documents as submittal_path', 'submittal.sub_additional_path', '=', 'submittal_path.doc_id')\n// ->leftJoin('currency', 'project_submittal_review.sr_additional_cost_currency', '=', 'currency.cur_id')\n->leftJoin('projects', 'project_submittal_review.sr_project_id', '=', 'projects.p_id')\n->leftJoin('users', 'project_submittal_review.sr_user_id', '=', 'users.id')\n ->select('submittal_path.doc_path as submittal_path', 'submittal.*', 'project_submittal_review.*', 'projects.*', \n 'users.username as user_name', 'users.email as user_email', 'users.first_name as user_firstname', 'users.last_name as user_lastname', 'users.company_name as user_company', 'users.phone_number as user_phonenumber', 'users.status as user_status', 'users.role as user_role')\n ->where('sr_id', '=', $sr_id)\n ->first();\n if(count($query) < 1)\n {\n $result = array('code'=>404, \"description\"=>\"No Records Found\");\n return response()->json($result, 404);\n }\n else\n {\n $result = array('data'=>$query,'code'=>200);\n return response()->json($result, 200);\n }\n // }\n }\n catch(Exception $e)\n {\n return response()->json(['error' => 'Something is wrong'], 500);\n }\n }", "public function SubmissionsAssess(){\n\t\treturn $this->Submissions()->filter(array(\n\t\t\t\t'Status' => 'Paid',\n\t\t\t\t'Stage' => 'Assess',\n\t\t))->sort('Created','Desc');\n\t}", "public function authorize()\n {\n if ($this->idea->isAssignedToUser() && $this->idea->isApprovalAction()) {\n return true;\n } \n else {\n return false;\n }\n }", "public function actionPridatNemovitost()\n {\n if (!$this->user->isAllowed('nemovitost','pridat'))\n throw new Nette\\Application\\ForbiddenRequestException(); \n }", "function checkStudentSubmission($sid, $asid){\n global $pdo;\n $stmt = $pdo->prepare('SELECT * FROM assignment_students WHERE asaid = :aid AND asuid = :sid');\n $criteria = ['aid'=>$asid, 'sid'=>$sid];\n $stmt->execute($criteria);\n\n if($stmt->rowCount()>0) return true;\n else return false;\n }", "public function testUserCannotViewSinglePublishedPostIfNotFollowingAuthor()\n {\n $data = [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => '$argon2id$v=19$m=65536,t=4,p=1$eTBDS3FZaURtcFJhbDNKbA$k60/BHW65f2Xg8x8yPFyEUXcnwnSkZc8A4UXv39KZU4'\n ];\n\n $postAuthor = $this->authorize($data);\n\n $post = $this->postWithImageAndTagsApproved($postAuthor);\n\n $repo = $this->entityManager->getRepository(Post::class);\n\n $postRepo = $repo->findOneBy(['id' => $post['data']['id']]);\n\n $postRepo->setApproved(1);\n\n $this->entityManager->persist($postRepo);\n $this->entityManager->flush();\n\n $authUser = $this->authorize();\n\n $this->client->request('GET', \"post/{$postRepo->getSlug()}\",\n [],\n [],\n $authUser);\n\n $this->assertResponseStatusCodeSame(403);\n\n }", "function getSubmissionsByAssignmentId($aid){\n $assignmentstudentsClass = new DatabaseTable('assignment_students');\n $submissions = $assignmentstudentsClass->find('asaid', $aid);\n return $submissions;\n }", "public function test_get_memberships_forbidden() {\n\t\twp_set_current_user( $this->user_forbidden );\n\n\t\t// Setup membership.\n\t\t$this->factory->membership->create();\n\n\t\t$response = $this->perform_mock_request(\n\t\t\t'GET',\n\t\t\t$this->route,\n\t\t\tarray(),\n\t\t\tarray( 'context' => 'edit' ) // Role needs 'edit_post' capability.\n\t\t);\n\n\t\t// Check we're not allowed to get results.\n\t\t$this->assertEquals( 403, $response->get_status() );\n\t}", "private function getAuthorizationFirst()\n {\n return $this->socialite->driver('github')->scopes(['user', 'gist'])->redirect();\n }", "public function test_get_membership_forbidden() {\n\t\twp_set_current_user( $this->user_forbidden );\n\n\t\t// Setup membership.\n\t\t$membership_id = $this->factory->membership->create();\n\t\t$response = $this->perform_mock_request(\n\t\t\t'GET',\n\t\t\t$this->route . '/' . $membership_id,\n\t\t\tarray(),\n\t\t\tarray( 'context' => 'edit' ) // Role needs 'edit_post' capability.\n\t\t);\n\n\t\t// Check we're not allowed to get results.\n\t\t$this->assertEquals( 403, $response->get_status() );\n\t}", "public function getPrivateProfile(Request $req){\n if(Auth::user()->role_id == 1){\n $st_information = $req->user();\n if(!empty($st_information) || count($st_information) > 0) {\n return view('student.profile-private')->with(['user' => $st_information]);\n }\n }else{\n return \\Redirect::back()->withErrors(['You are not allowed to perform this action!']);\n }\n }", "public function get_submittal_review_project(Request $request, $submittal_id)\n {\n try\n {\n // $user = array(\n // 'userid' => Auth::user()->id,\n // 'role' => Auth::user()->role\n // );\n // $user = (object) $user;\n // $post = new Resource_Post(); // You create a new resource Post instance\n // if (Gate::forUser($user)->denies('allow_admin', [$post,false])) { \n // $result = array('code'=>403, \"description\"=>\"Access denies\");\n // return response()->json($result, 403);\n // } \n // else {\n // Check User Permission Parameter \n $user_id = Auth::user()->id;\n $permission_key = 'submittal_review_view_all';\n $check_single_user_permission = app('App\\Http\\Controllers\\Projects\\PermissionController')->check_single_user_permission($submittal_id, $user_id, $permission_key);\n if(count($check_single_user_permission) < 1){\n $result = array('code'=>403, \"description\"=>\"Access Denies\");\n return response()->json($result, 403);\n }\n else {\n $query = DB::table('project_submittal_review')\n ->leftJoin('project_submittals as submittal', 'project_submittal_review.sr_submittal_id', '=', 'submittal.sub_id')\n ->leftJoin('documents as submittal_path', 'submittal.sub_additional_path', '=', 'submittal_path.doc_id')\n ->leftJoin('documents as submittal_reviewed', 'project_submittal_review.sr_review_document', '=', 'submittal_reviewed.doc_id') \n// ->leftJoin('currency', 'project_submittal_review.sr_additional_cost_currency', '=', 'currency.cur_id')\n->leftJoin('projects', 'project_submittal_review.sr_project_id', '=', 'projects.p_id')\n->leftJoin('users', 'project_submittal_review.sr_user_id', '=', 'users.id')\n ->select('submittal_reviewed.doc_path as submittal_reviewed','submittal_path.doc_path as submittal_path','submittal.*', 'project_submittal_review.*', 'projects.*', \n 'users.username as user_name', 'users.email as user_email', 'users.first_name as user_firstname', 'users.last_name as user_lastname', 'users.company_name as user_company', 'users.phone_number as user_phonenumber', 'users.status as user_status', 'users.role as user_role')\n ->where('sr_project_id', '=', $submittal_id)\n ->orderBy('submittal.sub_id', 'asc')\n ->get();\n if(count($query) < 1)\n {\n $result = array('code'=>404, \"description\"=>\"No Records Found\");\n return response()->json($result, 404);\n }\n else\n {\n $result = array('data'=>$query,'code'=>200);\n return response()->json($result, 200);\n }\n }\n }\n catch(Exception $e)\n {\n return response()->json(['error' => 'Something is wrong'], 500);\n }\n }", "public function get_submittal_project(Request $request, $project_id)\n {\n try\n {\n // $user = array(\n // 'userid' => Auth::user()->id,\n // 'role' => Auth::user()->role\n // );\n // $user = (object) $user;\n // $post = new Resource_Post(); // You create a new resource Post instance\n // if (Gate::forUser($user)->denies('allow_admin', [$post,false])) { \n // $result = array('code'=>403, \"description\"=>\"Access denies\");\n // return response()->json($result, 403);\n // } \n // else {\n // Check User Permission Parameter \n $user_id = Auth::user()->id;\n $permission_key = 'submittal_view_all';\n $check_single_user_permission = app('App\\Http\\Controllers\\Projects\\PermissionController')->check_single_user_permission($project_id, $user_id, $permission_key);\n if(count($check_single_user_permission) < 1){\n $result = array('code'=>403, \"description\"=>\"Access Denies\");\n return response()->json($result, 403);\n }\n else {\n $query = DB::table('project_submittals')\n->leftJoin('project_standards as specification', 'project_submittals.sub_specification', '=', 'specification.ps_id')\n->leftJoin('documents as submittal_path', 'project_submittals.sub_additional_path', '=', 'submittal_path.doc_id')\n->leftJoin('projects', 'project_submittals.sub_project_id', '=', 'projects.p_id')\n->leftJoin('project_submittal_review', 'project_submittals.sub_id', '=', 'project_submittal_review.sr_submittal_id')\n->leftJoin('users', 'project_submittals.sub_user_id', '=', 'users.id')\n ->select('specification.ps_name as specification_name',\n 'submittal_path.doc_path as submittal_path', \n 'project_submittals.*', 'projects.*','project_submittal_review.*', \n 'users.username as user_name', 'users.email as user_email', 'users.first_name as user_firstname', 'users.last_name as user_lastname', 'users.company_name as user_company', 'users.phone_number as user_phonenumber', 'users.status as user_status', 'users.role as user_role')\n ->where('sub_project_id', '=', $project_id)\n ->orderBy('project_submittals.sub_id', 'asc')\n //->orderBy('sub_number', 'desc')\n ->get();\n if(count($query) < 1)\n {\n $result = array('code'=>404, \"description\"=>\"No Records Found\");\n return response()->json($result, 404);\n }\n else\n {\n $result = array('data'=>$query,'code'=>200);\n return response()->json($result, 200);\n }\n }\n }\n catch(Exception $e)\n {\n return response()->json(['error' => 'Something is wrong'], 500);\n }\n }" ]
[ "0.60470754", "0.5582071", "0.55163866", "0.5513113", "0.5295048", "0.5271056", "0.521138", "0.5173616", "0.51696193", "0.51450366", "0.5112433", "0.5110382", "0.50920534", "0.50659925", "0.50601804", "0.5054683", "0.5015397", "0.5013234", "0.50027853", "0.500033", "0.49922144", "0.4990988", "0.4990888", "0.4983964", "0.49621147", "0.4952619", "0.49436197", "0.49436104", "0.4935739", "0.4931104" ]
0.57436883
1
Provides a list of centres which have not sent their questionnaire till the nearest reminder date (passed, not upcoming) The types of delinquent centres are as under:
public static function getDelinquency() { //get required values.. $compliance= self::getComplianceData(); $reminder = ReminderMaster::getActiveReminder(); $remDate = $reminder->getLastRemDate(); $startDate = self::getYearStartDate(); $endDate = self::getYearEndDate(); //get all months for the current year till this month end (including this month) $dayArray = CommonHelpers::getInbetweenMonthend($startDate,$remDate); //check if end date for active year is before the rem date... $res = array_search($endDate,$dayArray); if (!$res): //if no then remove the two elements at the end where //to give two months time before the reminder date. array_pop($dayArray); array_pop($dayArray); else: //if yes, truncate the array only to the year end date. $position = $res-sizeof($dayArray) + 1; array_splice($dayArray,$position); endif; //reindex array $recomp = ArrayHelper::index($compliance,null,'centreID'); //now find which centres are fully compliant $fullCompCentres=array(); foreach ($recomp as $key=>$value): if(sizeof($value) >= sizeof($dayArray)) $fullCompCentres[]=$key; endforeach; //get centre code of all centres $query = new Query(); $centres= $query->select(['name','wpLocCode','code','_id'=>false]) ->from ('centres') ->where(['status'=>Centres::STATUS_ACTIVE]) ->all(); foreach($centres as $centre): $centresCode[] = (int)Arrayhelper::getValue($centre,'wpLocCode'); endforeach; //get partially compliant centres $compCentresAll = array_unique(Arrayhelper::getColumn($compliance, function($element){ return (int)$element['centreID']; })); $partCompCentres = array_diff($compCentresAll,$fullCompCentres); //get totally non compliant centres $res1 = array_diff($compCentresAll,$centresCode); $res2 = array_diff($centresCode, $compCentresAll); $zeroCompCentres = array_merge($res1,$res2); //check all months array & create array of noncompliance month $comptemp = array(); $comp = array(); for ($i=0; $i<sizeof($compliance); $i++): $comptemp[$compliance[$i]['centreID']][] = [ 'forDate'=>$compliance[$i]['forDate'], 'centreID'=>(int)$compliance[$i]['centreID'] ]; endfor; foreach ($comptemp as $key=>$value): $comp[$key]=ArrayHelper::getColumn($value,'forDate'); endforeach; foreach ($comp as $key=>$value): $diff= array_values(array_diff($dayArray,$value)); foreach ($diff as &$val): $val = \Yii::$app->formatter->asDate($val, 'php:m-Y'); endforeach; $nonCompliance[$key][]=$diff; endforeach; $complianceDetails = [ 'fullCompliance'=>$fullCompCentres, 'partCompliance'=>$partCompCentres, 'zeroCompliance'=>$zeroCompCentres, 'noncomplianceMonths'=>$nonCompliance, 'complianceConsolidated'=>$compliance, ]; return $complianceDetails; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getDelinqCentreDetails()\n\t\t{\n\t\t\t$noncompliancemonths= self::getNonComplianceMonths();\n\t\t\t$noncompliance=$noncompliancemonths['noncompliance'];\n\t\t\t$startDate = $noncompliancemonths['startDate'];\n\t\t\t$endDate = $noncompliancemonths['endDate'];\n\t //get the centre ids of all non compliant centres\n\t $keys = array_keys($noncompliance);\n \t$query = new Query;\n \t$rows = $query\n\t ->select(['name','wpLocCode','_id'=>false])\n\t ->from('centres')\n\t ->where(['in','wpLocCode',$keys])\n\t ->all();\n\n\t // get the names of the non compliant centres\n \t$ncNames= ArrayHelper::map($rows,'wpLocCode','name');\n\n\t\t\t//get additional details for all non compliant centres \n \t$q = new Query;\n \t$rows = $q\n \t\t\t->select(['centreId','reminderArray','lastReminderDate','remUserArray', '_id'=>false])\n \t\t\t->from ('centreReminderLinker')\n \t\t\t->where(['in','centreId',$keys])\n \t\t\t->all();\n\n \t//if no reminder has ever been sent\n \tfor ($i=0; $i<sizeof($rows); $i++):\n \t\tif (!array_key_exists('lastReminderDate', $rows[$i])):\n \t\t\t$rows[$i]['reminderArray'] = 'no reminder sent before';\n \t\t\t$rows[$i]['lastReminderDate'] = 'no last Date';\n \t\tendif;\n \tendfor;\n\n \t//create reminder details by re-indexing\n \t$remDetails = ArrayHelper::index($rows,'centreId');\n\n\n \t//get all reminder emails for all centres \n \t$remEmails = self::getReminderUsers()['remEmails'];\n \t$remKeys = array_keys($remEmails);\n \t$currRemDetails=array();\n \t$ncconsolidated = array();\n\t foreach($keys as $key):\n\t \n\t $nc = $noncompliance[$key];\n\n \t//if there are more than one \n \tif (is_array($noncompliance[$key])):\n\t \t\t$nc = $noncompliance[$key][0];\n \tendif;\n\n \t\tif (!in_array($key,$remKeys,false)):\n \t\t\t$remUsers[$key]='no registered user';\n \t\t\t$remEmails[$key]='--';\t\n \t\t\tendif;\n\n\t if(isset($remDetails[$key]['centreId']\n\t )):\n\t \t$reminderArray = $remDetails[$key]['reminderArray'];\n\t \tif(is_array($reminderArray) && (sizeof($reminderArray)!== 0)):\n\t \t\t$remDates = Arrayhelper::getColumn($reminderArray,'remDate');\n\t \t\t$currRem = array();\n\t \t\tforeach ($remDates as $remDate):\n\t \t\t\t$res = CommonHelpers::dateCompare($remDate,$startDate);\n\t \t\t\tif ($res)\n\t \t\t\t$k = array_search($remDate,$remDates);\n\t \t\t\t$currentRem[$k]=$reminderArray[$k];\n\t \t\t\t\n\t \t\tendforeach;\n\t \t\t$currRemDetails[$key]=$currentRem;\n\t \t\t$currRemDateArr[$key]= ArrayHelper::getColumn($currentRem,'remDate');\n\t \t\t$currRemIdArr[$key]= ArrayHelper::getColumn($currentRem,'remId');\n\t \telse:\n\t \t\t$currRemDetails[$key] = ['remDate'=> '','remId'=> ''];\n\t \t\t$currRemDateArr[$key] = [ ''];\n\t \t\t$currRemIdArr[$key] = [''];\n\t \tendif;\n\n\t $ncconsolidated[$key]=\n\t [\n\t\t \t'centreId'=>$key,\n\t\t \t'name'=>$ncNames[$key],\n\t\t \t'emails'=>$remEmails[$key],\n\t\t \t'months'=>$nc,\n\t\t \t'reminderArray'=>$currRemDetails[$key],\n\t\t \t'reminderDate' =>$currRemDateArr[$key],\n\t\t \t'reminderId' =>$currRemIdArr[$key],\n\t\t \t'lastReminderDate'=>$remDetails[$key]['lastReminderDate']\n\t \t];\n\t else:\n\t \t$ncconsolidated[$key]=\n\t \t[\n\t\t \t'centreId'=>$key,\n\t\t \t'name'=>$ncNames[$key],\n\t\t \t'emails'=>$remEmails[$key],\n\t\t \t'months'=>$nc,\n\t\t \t'reminderArray'=>'no reminder Details',\n\t\t \t'reminderDate' =>'--',\n\t\t \t'reminderId' =>'--',\n\t\t \t'lastReminderDate'=> 'no last Date Details',\n\t \t];\n\t endif;\t\n\t endforeach;\n\t return $ncconsolidated;\n\t\t}", "public static function getNonComplianceMonths()\n\t\t{\n\t\t\t$rem = self::getDelinquency();\n \t$fCentres = $rem['fullCompliance'];\n \t$pCentres = $rem['partCompliance'];\n \t$zCentres = $rem['zeroCompliance'];\n \t$pCentreNC = $rem['noncomplianceMonths'];\n\n \t$query = new Query();\n \t$centres = $query\n ->select(['wpLocCode','_id'=>false])\n ->from('centres')\n ->where(['status'=>Centres::STATUS_ACTIVE])\n ->all();\n\n \tforeach($centres as $centre):\n $centresCode[] = (int)Arrayhelper::getValue($centre,'wpLocCode');\n endforeach;\n \t\n \t//first get the past nearest reminder date\n \t$actRem=ReminderMaster::getActiveReminder();\n \t$remDate = date_create($actRem->getLastRemDate());\n \tdate_sub($remDate,date_interval_create_from_date_string(\"1 months\"));\n \t$endDate = self::getYearEndDate();\n \t$res = CommonHelpers::dateCompare($endDate,date_format($remDate,'d-m-Y'));\n \t\n \t//if the year is ending before the reminder date, reminder last date should be only the current year end date.\n \tif(!$res)\n \t\t$remDate = date_create($endDate);\n\n \t$remMonth = date_format($remDate,\"m-Y\");\n \t$currYear = CurrentYear::getCurrentYear();\n \t$startDate = $currYear->yearStartDate;\n \t$startMonth = date_format(date_create($startDate),\"m-Y\");\n \n \t\t$statusArray = array();\n\n \t\t//for zero compliant centres all the months of the current year\n \t\t//have to be added without calculation..\n \tforeach ($centresCode as $centre):\n\t if (in_array($centre, $zCentres))\n\t {\n\t $months=$startMonth.' to '.$remMonth;\n\t $statusArray[] =['centres'=>$centre, 'months'=>$months];\n\t }\n\t endforeach; \n \t$zCentreArray = ArrayHelper::map($statusArray,'centres','months');\n\n \t// now find out months for partially compliant centres.\n \tforeach ($pCentreNC as $key=>&$value):\n\t array_walk($value, function(&$value,$key)\n\t {\n\t foreach ($value as $val):\n\t $val=\"01-\".$val;\n\t $val=date_format(date_create($val,timezone_open('Asia/Kolkata')),'M-Y');\n\t endforeach;\n\t $value = implode(', ',$value);\n\t return $value;\n\t });\n \t\tendforeach;\n\n \t\t//merge the non compliant month arrays for zero compliant and partial compliant centres for total non compliant centres & their months.\n \t$noncompliance = ArrayHelper::merge($zCentreArray, $pCentreNC);\n \treturn \n \t\t[\n \t\t\t'noncompliance'=>$noncompliance,\n \t\t\t'zerocompliance'=>$zCentreArray,\n \t\t\t'partcompliance'=>$pCentreNC,\n \t\t\t'startDate'=>$startDate,\n \t\t\t'endDate'=>$endDate,\n \t\t];\n\t\t}", "public static function getDelinquentCentreUsers()\n\t\t{\n\t\t\t// get the users from the getReminderUsers method\n\t\t\t// search for matches of centres for delinquency \n\t\t\t// where there is no username but delinquency mark it no user\n\t\t\t$delinquency = self::getDelinquency();\n\t\t\t\n\t\t\t$delinqArray = array_unique(\n\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t$delinquency['partCompliance'],\n\t\t\t\t\t\t\t$delinquency['zeroCompliance']\n\t\t\t\t\t\t));\n\n\t\t\t$remList = self::getReminderUsers();\n\t\t\t$remUsers = $remList['remUsers'];\n\t\t\t$remEmails = $remList['remEmails'];\n\t\t\t$delinqWithEmails = array();\n\t\t\t$delinqNoEmails = array();\n\t\t\t for ($i=0; $i<sizeof($delinqArray); $i++)\n\t\t\t {\n\t\t\t \tif(array_key_exists($delinqArray[$i],$remUsers)):\n\t\t\t \t\t$delinqWithEmails[$delinqArray[$i]]['user'] = $remUsers[$delinqArray[$i]];\n\t\t\t \t\t$delinqWithEmails[$delinqArray[$i]]['email'] = $remEmails[$delinqArray[$i]];\n\t\t\t \telse:\n\t\t\t \t\t$delinqNoEmails[] = $delinqArray[$i];\n\t\t\t \tendif;\n\t\t\t }\n\n\t\t\t $delinqUsers= ['withEmails'=>$delinqWithEmails, 'withoutEmails'=>$delinqNoEmails];\n\t\t\t\n\t\t\treturn $delinqUsers;\n\t\t}", "private static function getComplianceData()\n\t\t{\n\t\t\t$query = new Query();\n\t\t\t$centres=\t$query->select(['name','wpLocCode','code','_id'=>false])\n\t\t\t\t\t\t->from ('centres')\n\t\t\t\t\t\t->where(['status'=>Centres::STATUS_ACTIVE])\n\t\t\t\t\t\t->all();\n\n\t\t \tforeach($centres as $centre):\n\t\t\t\t\t$centresCode[] = (int)Arrayhelper::getValue($centre,'wpLocCode');\n\t\t\tendforeach;\n\t\t\t\t\n\t\t\t\n\t\t\t//get all questionnaires for a centre whose For-month date is \n\t\t\t\t//less than the reminder date \n\t\t\t\t//& status is submitted, rework,closed or approved\n\t\t\t\n\t\t\t$startDate = self::getYearStartDate();\n\t\t\t$stDateTS = strtotime($startDate);\n\t\t\t$que = new Query();\n\t\t\t$compliance = $que->select([\n\t\t\t\t\t\t\t\t\t'queId',\n\t\t\t\t\t\t\t\t\t'forDate',\n\t\t\t\t\t\t\t\t\t'forYear',\n\t\t\t\t\t\t\t\t\t'forDateTS',\n\t\t\t\t\t\t\t\t\t'centreID',\n\t\t\t\t\t\t\t\t\t'created_uname'\n\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t\t->from('questionnaire')\n\t\t\t\t\t\t\t\t->where([\n\t\t\t\t\t\t\t\t\t'in','status',\n\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_APPROVED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_CLOSED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_SUBMITTED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_REWORK,\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->andFilterCompare('forDateTS', $stDateTS, '>=')\n\t\t\t\t\t\t\t\t->all();\n\t\t\treturn $compliance; \n\t\t}", "public function getConfrimAppoinmentsByDay(){\n\n // $this->autoRender = false;\n\n // $date = '2016-09-22';\n // $idCenter = 1;\n // $idSpeciality = 0; \n\n $data = $this->request->data;\n $date = $data['date'];\n \n $dateEnd = $data['dateEnd'];\n\n $idCenter = $data['center'];\n $idSpeciality = $data['speciality'];\n\n $this->loadModel('Specializations');\n\n if($idSpeciality != 0){\n $specializations = $this->Specializations->find('all',\n ['conditions'=>['Specializations.cost_centers_id' => $idSpeciality]]\n )->select(['Specializations.id']);\n\n }else{\n\n $specializations = $this->Specializations->find('all')->select(['Specializations.id']);\n }\n\n\n\n $this->loadModel('Attentions');\n $this->loadModel('Orders'); \n\n $query = $this->Appointments->find('all')->notMatching('Attentions', function ($q) {\n return $q->where([\n 'Appointments.id not in ' => 'Attentions.appointments_id'\n ]);\n });\n\n //para que se busque en todos los centros el id del centro debe ser igual a all ·\n if($idCenter != \"all\"){\n $query = $query->matching('Orders', function ($q) use ($idCenter) {\n return $q->where(['Orders.centers_id' =>$idCenter ]);\n }); \n }else{\n $query = $query->matching('Orders', function ($q) use ($idCenter) {\n return $q->where(['Orders.centers_id >' =>0 ]);\n }); \n }\n //fin de busqueda\n \n \n $query = $query->find('all',\n ['contain' => [\n 'Studies',\n 'Orders.Patients.People',\n 'MedicalOffices'],\n 'conditions'=> ['Studies.specializations_id IN' => $specializations\n\n ]\n\n ]); \n\n // obtiene las citas que se encuetren confirmadas.\n $query = $query->matching('AppointmentDates', function ($q) use ( $date, $dateEnd) {\n\n return $q->where([\n\n 'DATE(AppointmentDates.date_time_ini) >=' => $date,\n\n 'DATE(AppointmentDates.date_time_ini) <=' => $dateEnd,\n\n\n 'AppointmentDates.appointment_states_id ' => 3,\n\n 'AppointmentDates.id = (SELECT MAX(ad.id) FROM appointment_dates ad WHERE ad.appointments_id = Appointments.id)'\n\n ]);\n });\n\n\n $query = $query->toArray();\n\n if($query){\n \n \n $this->set(compact('query','success'));\n\n } else {\n\n $success = false;\n\n $this->set(compact('success','errors'));\n\n }\n}", "private function get_availables_dates($citas)\n {\n $horas_ocupadas = [];\n foreach ($citas as $cita) {\n array_push($horas_ocupadas, $cita->hora_solicitada);\n }\n\n $horario = [\n '09:30:00', '10:00:00', '10:30:00',\n '11:00:00', '11:30:00', '12:00:00',\n '12:30:00', '13:00:00', '13:30:00',\n '14:00:00', '14:30:00', '15:00:00',\n '15:30:00', '16:00:00'\n ];\n\n //Obtengo un arreglo con las horas disponibles\n $horas_disponibles = array_diff($horario, $horas_ocupadas);\n\n return $horas_disponibles;\n }", "function getCalleMasEstacionamientos(){\n\t\t//Primero se buscan todas las sub-calles\n\t\t$this->resultado = pg_query($this->con,\"SELECT id FROM calle\");\n\t\t$subcalles = array();\n\t\twhile($linea = $this->getLinea()){\n\t\t\tarray_push($subcalles,$linea['id']);\n\t\t}\n\t\t//Variables que guardan la calle con más estacionamientos\n\t\t$arreglocallemayor = array();\n\t\t//Por cada sub-calle se busca los estacionamientos asociados\n\t\tfor($i = 0;$i < sizeof($subcalles);$i++){\n\t\t\t$this->resultado = pg_query($this->con,\"SELECT ST_AsText(estacionamientos.geom) AS pos FROM estacionamientos WHERE estacionamientos.calle = \".$subcalles[$i]);\n\t\t\t$arregloauxiliar = array();\n\t\t\twhile($linea = $this->getLinea()){\n\t\t\t\t$pos = str_replace(\")\",\"\",str_replace(\"MULTIPOINT(\",\"\",$linea['pos']));\n\t\t\t\t$lon = explode(\" \",$pos)[0];\n\t\t\t\t$lat = explode(\" \",$pos)[1];\n\t\t\t\tarray_push($arregloauxiliar,$subcalles[$i].\"=_=\".$lon.\"=_=\".$lat.\"<br>\");\n\t\t\t}\n\t\t\t//Se verifica si la sub-calle analizada resulta ser la con mayor estacionamientos\n\t\t\tif(sizeof($arregloauxiliar)>sizeof($arreglocallemayor)){\n\t\t\t\t$arreglocallemayor = $arregloauxiliar;\n\t\t\t}\n\t\t}\n\t\treturn $arreglocallemayor;\n\t}", "public function getUnconfAppointmentsDay(){\n\n // $this->autoRender = false;\n // $date = '2016-10-06';\n // $idCenter = 2;\n // $idSpeciality = 0;\n\n $data = $this->request->data;\n $date = $data['date'];\n $dateEnd = $data['dateEnd'];\n $idCenter = $data['center'];\n $idSpeciality = $data['speciality'];\n\n $this->loadModel('Specializations');\n \n if($idSpeciality != 0){\n \n $specializations = $this->Specializations->find('all',\n ['conditions'=>['Specializations.cost_centers_id' => $idSpeciality]]\n )->select(['Specializations.id']);\n\n }else{\n $specializations = $this->Specializations->find('all')->select(['Specializations.id']);\n }\n \n $this->loadModel('Orders');\n\n\n $query = $this->Appointments->find('all',\n ['contain' => [\n 'Studies',\n 'Orders.Patients.People',\n 'MedicalOffices']\n ,'conditions'=> [\n 'Studies.specializations_id IN' => $specializations]\n ]);\n\n\n // obtiene el utlimo cambio registrado en la cita y la filtra por asignada o reasignada.\n $query = $query->matching('AppointmentDates', function ($q) use ( $date, $dateEnd) {\n\n return $q->where([\n\n 'DATE(AppointmentDates.date_time_ini) >=' => $date,\n 'DATE(AppointmentDates.date_time_ini) <=' => $dateEnd, \n\n 'AppointmentDates.appointment_states_id IN ' => [1,2], // agendado y reagendado.\n\n 'AppointmentDates.id = (SELECT MAX(ad.id) FROM appointment_dates ad WHERE ad.appointments_id = Appointments.id)' \n ]);\n\n });\n\n\n //para que se busque en todos los centros el id del centro debe ser igual a all ·\n if($idCenter != \"all\"){\n $query = $query->matching('Orders', function ($q) use ($idCenter) {\n return $q->where(['Orders.centers_id' =>$idCenter ]);\n }); \n }else{\n $query = $query->matching('Orders', function ($q) use ($idCenter) {\n return $q->where(['Orders.centers_id >' =>0 ]);\n }); \n }\n //fin de busqueda\n\n\n\n if($query){\n $query = $query->toArray();\n \n $this->set(compact('query','success'));\n\n } else {\n\n $success = false;\n\n $this->set(compact('success','errors'));\n\n }\n //debug($query);\n}", "public static function getAllConfirmedOfTheDay() {\n $now = new DateTime();\n $now = $now->format(\"Y-m-d\");\n $query = \"SELECT * FROM commande WHERE horaire > '$now' AND status <= '5' ORDER BY horaire ASC\";\n return self::getList($query);\n }", "public function findForwardersFallDue();", "public function findSuppliersFallDue();", "public function getRemainingEffort()\n {\n $remaining_effort = array();\n\n if ($this->time_period->isTodayBeforeTimePeriod()) {\n $remaining_effort[] = null;\n\n return $remaining_effort;\n }\n\n $number_of_days = $this->time_period->getCountDayUntilDate($_SERVER['REQUEST_TIME']);\n for ($day_offset = 0; $day_offset < $number_of_days; $day_offset++) {\n if (isset($this->remaining_effort[$day_offset])) {\n $remaining_effort[] = $this->remaining_effort[$day_offset];\n } else {\n $remaining_effort[] = null;\n }\n }\n\n if ($number_of_days === 0) {\n $remaining_effort[] = null;\n }\n\n return $remaining_effort;\n }", "public function findSuppliersExpiredDue();", "public function generate_comp_days($no_days, $type){\n\t\t$day = date('Y-m-d');\n\t\tfor($i = 1; $i <= $no_days; $i++){\t\t\t\n\t\t\t$prev_day = date('Y-m-d',strtotime($day . \" -1 day\"));\n\t\t\t$day = $prev_day;\n\t\t\tif($type == 'list'){\n\t\t\t\t$last_days[$prev_day] = $this->format_date($prev_day);\n\t\t\t}else{\n\t\t\t\t$last_days[] = $prev_day;\n\t\t\t}\n\t\t}\t\n\t\tasort($last_days);\n\t\treturn $last_days;\n\t}", "public function diffInPartialBusinessDaysDefaultProvider(): array\n {\n return [\n // Going forward in time midnight to midnight.\n ['Monday', 'Monday', 0.0],\n ['Monday 2018-05-14', 'Tuesday 2018-05-15', 1.0],\n ['Monday 2018-05-14', 'Wednesday 2018-05-16', 2.0],\n ['Monday 2018-05-14', 'Thursday 17th May 2018', 3.0],\n ['Monday 2018-05-14', 'Friday 2018-05-18', 4.0],\n ['Monday 2018-05-14', 'Saturday 2018-05-19', 5.0],\n ['Monday 2018-05-14', 'Sunday 20th May 2018', 5.0],\n ['Friday 2018-05-18', 'Saturday 2018-05-19', 1.0],\n // Going forward in time with specific hours.\n ['Friday 2018-05-18 17:00', 'Saturday 2018-05-19 17:00', 0.0],\n ['Friday 2018-05-18 15:00', 'Saturday 2018-05-19 17:00', 0.25],\n ['Monday 2018-05-14 00:00', 'Monday 2018-05-14 13:00', 0.5],\n ['Monday 2018-05-14 08:00', 'Monday 2018-05-14 13:00', 0.5],\n ['Monday 2018-05-14 09:00', 'Monday 2018-05-14 13:00', 0.5],\n ['Monday 2018-05-14 13:00', 'Monday 2018-05-14 17:00', 0.5],\n ['Monday 2018-05-14 09:00', 'Tuesday 2018-05-15 13:00', 1.5],\n ['Monday 2018-05-14 09:00', 'Friday 2018-05-18 13:00', 4.5],\n ['Monday 2018-05-14 09:00', 'Friday 2018-05-18 17:00', 5.0],\n ['Monday 2018-05-14 09:00', 'Friday 2018-05-18 18:00', 5.0],\n ['Monday 2018-05-14 09:00', 'Saturday 2018-05-19 13:00', 5.0],\n ['Monday 2018-05-14 09:00', 'Sunday 20th May 2018 13:00', 5.0],\n ['Monday 2018-05-14 09:00', 'Monday 30th May 2018 17:00', 16.0],\n // Going back in time midnight to midnight.\n ['Monday 2018-05-14', 'Monday 7th May 2018', 5.0],\n ['Monday 2018-05-14', 'Tuesday 8th May 2018', 4.0],\n ['Monday 2018-05-14', 'Wednesday 9th May 2018', 3.0],\n ['Monday 2018-05-14', 'Thursday 10th May 2018', 2.0],\n ['Monday 2018-05-14', 'Friday 2018-05-11', 1.0],\n ['Monday 2018-05-14', 'Saturday 12th May 2018', 0.0],\n ['Monday 2018-05-14', 'Sunday 13th May 2018', 0.0],\n // Going back in time with specific hours.\n ['Monday 2018-05-14 09:00', 'Monday 7th May 2018 09:00', 5.0],\n ['Monday 2018-05-14 17:00', 'Monday 7th May 2018 09:00', 6.0],\n ['Monday 2018-05-14 17:00', 'Monday 7th May 2018 13:00', 5.5],\n ['Monday 2018-05-14 10:00', 'Tuesday 8th May 2018 12:00', 3.75],\n ['Monday 2018-05-14 11:00', 'Wednesday 9th May 2018 13:00', 2.75],\n ['Monday 2018-05-14 17:00', 'Thursday 10th May 2018 13:00', 2.5],\n ['Monday 2018-05-14 15:00', 'Friday 2018-05-11 09:00', 1.75],\n ['Monday 2018-05-14 13:00', 'Saturday 12th May 2018 13:00', 0.5],\n ['Monday 2018-05-14 18:00', 'Sunday 13th May 2018 01:00', 1.0],\n ];\n }", "public function getTableauConferences($orateursExterieurs) {\r\n\t\t\t\r\n\t\t\t// Filtre des conférences à prendre en compte\r\n\t\t\t$tableauRetour = array();\r\n\t\t\tforeach ($this->tableauConferences as $conf) {\r\n//\t\t\t\techo $conf->->getDateDebut();\r\n\t\t\t\tif ($conf->getAttribut(\"invite\") == $orateursExterieurs) {\r\n\t\t\t\t\tarray_push($tableauRetour, $conf);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// tri du tableau des conférences avant de le retourner\r\n\t\t\tusort($tableauRetour, array($this, 'compare'));\t\t\t\r\n\t\t\treturn $tableauRetour;\r\n\t\t}", "function getNonRepEntraides(){\r\n\t\r\n\t\t$BDD = new BDD();\r\n\t\r\n\t\t$entraides = $BDD->select(\r\n\t\t\t\"entraide_id, entraide_question, entraide_auteur, entraide_details, entraide_resolu, DATE_FORMAT(entraide_date, '%d/%b/%Y') as entraide_date\",\r\n\t\t\t\"TB_ENTRAIDES\",\r\n\t\t\t\"WHERE entraide_resolu = 0 ORDER BY entraide_date DESC, entraide_id DESC\"\r\n\t\t);\r\n\t\r\n\t\treturn $entraides;\r\n\t\r\n\t}", "public function listRendezVous()\n {\n \t$rendezvous = RendezVous::where('medecin_id',Auth::user()->medecins[0]->id)->get();\n \t$list = [];\n \t$rv = [];\n $days = [\n 'Lundi' => 1,\n 'Mardi' => 2,\n 'Mercredi' => 3,\n 'Jeudi' => 4,\n 'Vendredi' => 5,\n 'Samedi' => 6,\n 'Dimanche' => 0\n ];\n \tforeach ($rendezvous as $r ) {\n $e = Expertie::where(['libelle' => $r->motif,'medecin_id'=>Auth::user()->medecins[0]->id])->first();\n $r_color;\n if(!empty($e))\n $r_color = $e->couleur;\n else\n $r_color = '#000';\n \t\t$rv['id'] = $r->id;\n \t\t$rv['title'] = 'Rendez-vous avec '.$r->patient->nom .' '.$r->patient->prenom;\n \t\t$rv['start'] = $r->date;\n \t\t$end_time = new DateTime($r->date);\n \t\t$end_time->modify('+'.Auth::user()->medecins[0]->duree_rendezvous.' minutes');\n \t\t$rv['end'] = date_format($end_time,'Y-m-d H:i');\n $rv['borderColor'] = $r_color;\n \t\t$list[]=$rv;\n \t}\n $empechements = RendezVousEmpechement::where('medecin_id', Auth::user()->medecins[0]->id)->get();\n $planning = Planning::where('medecin_id',Auth::user()->medecins[0]->id)->get();\n $businessDays = [];\n foreach ($planning as $p) {\n array_push($businessDays, $days[$p->jour]);\n }\n\n foreach ($empechements as $e) {\n array_push($list,\n [\n 'start' => date('Y-m-d',strtotime($e->date_de)),\n 'end' => date('Y-m-d',strtotime($e->date_a)),\n 'overlap' => false,\n 'rendering' => 'background',\n 'color' => '#ff9f89'\n ]\n );\n }\n return Response::json(['listRV'=>$list,'businessDays'=>$businessDays]);\n }", "public static function getLasts(){\n\t\t$criteria=new CDbCriteria;\n\t\t$dataLimite = date(\"d/m/Y\", mktime(0, 0, 0, date(\"m\") + 6, date(\"d\"), date(\"Y\")));\n\t\t$dataAtual = date(\"d/m/Y\");\n\t\t$criteria->addCondition(\"t.data_fim <= '$dataLimite'\", 'AND');\n\t\t$criteria->addCondition(\"t.data_fim >= '$dataAtual'\", 'AND');\n\t\t$criteria->order = 't.data_fim DESC';\n\t\treturn PessoaFinanceiro::model()->findALL($criteria);\n\t}", "public function findForwardersExpiredDue();", "protected function consultarCalificaciones()\n\t {\n\t\t $modelosCalificacion = array();\n\n\t\t foreach ($this->categorias as $categoria) {\n\n\t\t\t foreach ($categoria->variablesMedicion as $variable){\n\n\t\t\t\t if ($variable->calificaUnidadNegocio === 1) {\n\n\t\t\t\t\t foreach ($this->unidadesNegocio as $unidad) {\n\n\t\t\t\t\t\t $modelo = CalificacionVariable::find()->where(['idAsignacion' => $this->asignacion->idAsignacion, 'idVariable' => $variable->idVariable, 'IdAgrupacion' => $unidad['IdAgrupacion']])->one();\n\n\t\t\t\t\t\t if ($modelo !== null) {\n\t\t\t\t\t\t\t array_push($modelosCalificacion, $modelo);\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t array_push($modelosCalificacion, new CalificacionVariable());\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\n\t\t\t\t }else{\n\n\t\t\t\t\t $modelo = CalificacionVariable::find()->where(['idAsignacion' => $this->asignacion->idAsignacion, 'idVariable' => $variable->idVariable])->one();\n\n\t\t\t\t\t if ($modelo !== null) {\n\t\t\t\t\t\t array_push($modelosCalificacion, $modelo);\n\t\t\t\t\t }else{\n\t\t\t\t\t\t array_push($modelosCalificacion, new CalificacionVariable());\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t return $modelosCalificacion;\n\t }", "public function getEscalationTickets($days, $type) {\n\n $data = array();\n $query = new Query();\n $query->select([\n 'tbl_gp_tickets.ticket_name as ticket_id',\n 'tbl_gp_tickets.hotel_id',\n 'tbl_gp_tickets.department_id',\n 'tbl_gp_tickets.subject as question',\n 'tbl_gp_tickets.due_date as due_date',\n 'tbl_gp_user.email as toEmail',\n 'tbl_gp_user.user_id as userId',\n 'tbl_gp_user.first_name',\n 'tbl_gp_user.last_name',\n 'tbl_gp_user.phone as mobileNumber',\n 'tbl_gp_user.device_token as deviceToken',\n 'tbl_gp_tickets.priority_type_id as priority',\n 'tbl_gp_hotels.hotel_name',\n 'tbl_gp_departments.department_name',\n ])\n ->from('tbl_gp_tickets')\n ->join('INNER JOIN', 'tbl_gp_user', 'tbl_gp_user.user_id = tbl_gp_tickets.assigned_user_id')\n ->join('INNER JOIN', 'tbl_gp_hotels', 'tbl_gp_hotels.hotel_id = tbl_gp_tickets.hotel_id')\n ->join('INNER JOIN', 'tbl_gp_departments', 'tbl_gp_departments.department_id = tbl_gp_tickets.department_id')\n ->join('LEFT JOIN', 'tbl_gp_ticket_process_critical', 'tbl_gp_ticket_process_critical.ticket_id =tbl_gp_tickets.ticket_id')\n ->join('LEFT JOIN', 'tbl_gp_process_critical_preferences', 'tbl_gp_ticket_process_critical.improve_plan_module_id =tbl_gp_process_critical_preferences.critical_preference_id');\n\n\n $due_date = date('Y-m-d ', strtotime(' - ' . $days . ' day'));\n $query->andFilterWhere(['<', 'tbl_gp_tickets.due_date', $due_date]);\n $query->andFilterWhere(['tbl_gp_tickets.priority_type_id' => $type]);\n $query->andFilterWhere(['IN', 'tbl_gp_tickets.status', [0, 1, 4]]);\n $query->andWhere('tbl_gp_process_critical_preferences.stop_escalations=0 OR tbl_gp_process_critical_preferences.stop_escalations is NULL OR (tbl_gp_process_critical_preferences.stop_escalations=1 AND tbl_gp_ticket_process_critical.stop_notifications_until_date IS NOT NULL AND tbl_gp_ticket_process_critical.stop_notifications_until_date < :today_date ) ', [':today_date' => date(\"Y-m-d\")]);\n $command = $query->createCommand();\n $data[] = $command->queryAll();\n\n return $data;\n }", "private function getDueCourses() {\t\n\n\t\t$this->relevantCourses = array();\n\n\t\t$courses = array();\n\t\t//get available courses by sections\n\t\tforeach ($this->jCustomer->checkAvailableCourses as $section => $ref_id) {\n\t\t\t$courses = $courses + $this->noUICM->getAvailableCourses($ref_id);\n\t\t}\n\n\t\t//only programs relevant on this level:\n\t\tforeach ($courses as $obj_id => $crs_data) {\n\t\t\t$crs_type = $crs_data['type'];\n\t\t\tif($crs_type === 'prg') {\n\t\t\t\t$prg_ref_id = $crs_data['refId'];\n\t\t\t\t$this->getCoursesBelowPrg($prg_ref_id); //fills this->relevantCourses\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t$ret = array();\n\t\tforeach ($this->relevantCourses as $crs) {\n\t\t\n\t\t\t$crs_start_date = $crs['courseStart']; //dd.mm.YYYY\n\t\t\t$crs_start_time = $crs['courseStartTime']; //hh:MM\n\t\t\t$start_date_str = $crs_start_date .' ' .$crs_start_time;\n\n\n\t\t\t//webinars: 1 hour;\n\t\t\t//f2f: 3 days\n\t\t\t$ctype = str_replace('prg_amd_type_', '', $crs['in_subtype']);\n\t\t\tif( in_array($ctype, array(\n\t\t\t\t\t'od01','od02','od03','od04'\n\t\t\t\t\t,'fk01','fk02','fk03','fk04','fk05'\n\t\t\t\t))) {\n\t\t\t\t$ctype = 'webinar';\n\t\t\t}\n\t\t\tif( in_array($ctype, array(\n\t\t\t\t\t'odfinal'\n\t\t\t\t\t,'fkfinal'\n\t\t\t\t))) {\n\t\t\t\t$ctype = 'f2f';\n\t\t\t}\n\n\t\t\t$start_date = DateTime::createFromFormat('d.m.Y H:i', $start_date_str);\n\t\t\t$today = new DateTime('NOW');\n\n\t\t\tif ($start_date > $today) { //only future dates\n\t\t\t\t\n\t\t\t\t$diff = $today->diff($start_date);\n\n\t\t\t\t$hours = $diff->h;\n\t\t\t\t$hours = $diff->h + ($diff->d * 24);\n\n\t\t\t\tif($diff->m == 0 && $diff->y == 0) {\n\t\t\t\t\tif($ctype == 'webinar' && $hours == 1) {\n\t\t\t\t\t\tarray_push($ret, $crs);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($ctype == 'f2f' && $hours == 72) {\n\t\t\t\t\t\tarray_push($ret, $crs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function getCentrosPoblados($criterio = \"0\") {\r\n $centrosPoblados = null;\r\n $sql = \"SELECT idCentroPoblado, codigoDane, nombre \"\r\n . \"FROM centropoblado \"\r\n . \"WHERE mun_id = \" . $criterio . \" \"\r\n . \"ORDER BY nombre ASC \";\r\n if ($criterio == \"0\") {\r\n $sql = \"SELECT idCentroPoblado, codigoDane, nombre \"\r\n . \"FROM centropoblado \"\r\n . \"ORDER BY nombre ASC \";\r\n }\r\n $r = $this->db->ejecutarConsulta($sql);\r\n if ($r) {\r\n $cont = 0;\r\n while ($w = mysql_fetch_array($r)) {\r\n $centroPoblado = new CCentroPoblado($w['idCentroPoblado'], $w['codigoDane'], $w['nombre'], null);\r\n $centrosPoblados[$cont] = $centroPoblado;\r\n $cont++;\r\n }\r\n }\r\n return $centrosPoblados;\r\n }", "function getCategories($appointments, $pattern){\n\t$regular = array();\n\t$events = array();\n\t$now = date(\"Y-m-d H:i:s\");\n\tforeach($appointments->getItems() as $appointment)\n\t{\n\t\tif($appointment->summary == $pattern)\n\t\t{\n\t\t\tif(strtotime($appointment->start->dateTime) < strtotime(date('Y-m-d', strtotime($now. ' + 70 days'))))\n\t\t\t{\n\t\t\t\tarray_push($regular, $appointment);\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\tarray_push($events, $appointment);\n\t\t}\n\t}\n\t$temp = array($regular, $events);\n\treturn $temp;\n}", "public function get_comp_days($last_days, $first_day,$first_date,$id,$emp_type,$work,$branch){ \n\t\t// find the sat, sun and holidays\n\t\t$first_sat = $this->get_first_sat($first_day);\n\t\t$second = $first_sat + 7;\n\t\t$second_sat = date('Y-m-d', strtotime($first_date[0].'-'.$first_date[1].'-'.$second)); \t\t\t\n\t\t$third_sat = $second + 7; \t\t\t\n\t\t$forth_sat = $first_date[0].'-'.$first_date[1].'-'.($third_sat + 7); \n\t\t\n\t\t// find happy leaves\n\t\t$happy = $this->get_happy_leave($id);\n\t\t$exp_happy_dob = explode('-', $happy[0]);\n\t\t$exp_happy_wedding = explode('-', $happy[1]);\n\t\t\t\t\n\t\t// iterate to find the comp off eligible days\n\t\tforeach($last_days as $comp_date){\n\t\t\t$exp_comp = explode('-', $comp_date);\n\n\t\t\t// find second and forth sat.\n\t\t\tif(($comp_date == $second_sat || $comp_date == $forth_sat)){ \n\t\t\t\t$comp_days[] = $comp_date;\n\t\t\t\t//print_r($comp_days);\n\t\t\t}\t\n\t\t\t\n\t\t\t// find sunday\n\t\t\t$day = date('N', strtotime($comp_date));\n\t\t\tif($day == '7'){\n\t\t\t\t$comp_days[] = $comp_date;\n\t\t\t}\n\t\t\t$holidays = $this->get_user_holidays($branch);\n\t\t\t// find holidays\n\t\t\tif(in_array($comp_date, $holidays)){\n\t\t\t\t$comp_days[] = $comp_date;\n\t\t\t\t$leave_days[] = $comp_date;\n\t\t\t}\n\t\t\t// find holidays in previous year (only for january)\n\t\t\tif($exp_comp[1] == '12'){\n\t\t\t\tif(in_array($comp_date, $this->get_user_holidays_previous($branch))){\n\t\t\t\t\t$comp_days[] = $comp_date;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($exp_happy_dob[1].$exp_happy_dob[2] == $exp_comp[1].$exp_comp[2]){\n\t\t\t\t$comp_days[] = $comp_date;\n\t\t\t}\n\t\t\tif($exp_happy_wedding[1].$exp_happy_wedding[2] == $exp_comp[1].$exp_comp[2]){\n\t\t\t\t$comp_days[] = $comp_date;\n\t\t\t}\n\t\t\t\n\t\t\t// get onduty on holidays and week ends\n\t\t\t\n\t\t\tforeach($leave_days as $leave){\n\t\t\t\t$holiday_cond[] = array('leave_from like' => $leave);\n\t\t\t}\n\t\t\t$leave_cond = array('or' => array( array('leave_from like' => $second_sat), array('leave_from like' => $forth_sat), $holiday_cond));\n\t\t\t$this->HrLeave->unBindModel(array('hasOne' => array('HrLeaveStatus')));\n\t\t\t$od_data = $this->HrLeave->find('all', array('fields' => array('leave_from', 'leave_to'), 'conditions' => array($leave_cond, 'HrLeave.hr_leave_type_id' => '6', 'is_approve' => 'Y', 'HrLeave.is_deleted' => 'N', 'HrLeave.app_users_id' => $id)));\n\t\t\tforeach($od_data as $data){\n\t\t\t\tif($comp_date == $data['HrLeave']['leave_from']){\n\t\t\t\t\t$comp_days[] = $comp_date;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $comp_days;\n\t}", "public function ClinicTimeUnfilledNotificationsAdmin(){\n\t\t$all_admins = DB::table('users')->where('role_id',1)->get();\n\t\tforeach($all_admins as $admin){\n\t\t\t$admin_id = $admin->id;\n\t\t\t$sqlQuery \t = \t\"SELECT * FROM clinics WHERE `personnel` > (SELECT COUNT(id) as total from clinic_status WHERE status = 1 AND clinic_id = clinics.id) \";\n\t\t\t$clinic_data = DB::select(DB::raw($sqlQuery));\n\t\t\tif(!empty($clinic_data)){\n\t\t\t\tforeach ($clinic_data as $clinic) {\n\t\t\t\t\t$notification_type = $this->GetAdminNotificationTypeSettings($admin->id);\n\t\t\t\t\tif($notification_type == 'email'){\n\t\t\t\t\t// email sending process for confirm clinic starts\n\t\t\t\t\t$clinic_date_time\t\t= \tnew DateTime($clinic->date.' '.$clinic->time, new DateTimeZone('GMT'));\n\t\t\t\t\t$clinic_date_time->setTimezone(new DateTimeZone($admin->timezone));\n\t\t\t\t\t$date_time \t\t\t\t= \t$clinic_date_time->format('Y-m-d H:i');\n\t\t\t\t\t$date \t\t\t= \t$clinic_date_time->format('Y-m-d');\n\t\t\t\t\t$time \t\t\t= \t$clinic_date_time->format('H:i');\n\t\t\t\t\t$subject_replace\t\t= array($clinic->name,$admin->x_time_unfilled_notify);\n\t\t\t\t\t$replace_array \t\t\t= array($admin->first_name.' '.$admin->last_name,$date,$time,$clinic->location_name);\n\t\t\t\t\t$type \t\t\t\t\t=\t'clinic_time_unfilled';\n\t\t\t\t\t$check_status\t\t\t=\t$this->CheckMailSentStatus($clinic->id,$admin->id,$type);\n\t\t\t\t\t\n\t\t\t\t\tif($check_status == 0){\n\t\t\t\t\t\t$email_send \t\t\t= $this->mail_send('clinic_time_unfilled',$admin->email,$admin->first_name.' '.$admin->last_name,$subject_replace,$replace_array,null,$clinic->id,$admin->id,$type);\n\t\t\t\t\t}\t\n\t\t\t\t\t// email sending process for confirm clinic ends\n\t\t\t\t\t}elseif($notification_type == 'push'){\n\t\t\t\t\t\tif(($admin->x_time_unfilled_notify != '' || $admin->x_time_unfilled_notify != null) && $admin->x_time_unfilled_notify != 'off'){\n\t\t\t\t\t\t$estimated_time \t= \t'+'.($admin->x_time_unfilled_notify*60).' minutes';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$start_time \t\t\t= \tdate('Y-m-d H:i:s',strtotime($estimated_time,strtotime($clinic->created_at)));\n\t\t\t\t\t\t$current_time\t \t\t= \tstrtotime(date('Y-m-d H:i:s'));\n\n\t\t\t\t\t\tif($current_time > $start_time){\n\t\t\t\t\t\t\t$message = $clinic->name.' is unfilled in '.$estimated_time/60 .' hours';\n\t\t\t\t\t\t\t$admin_notifications \t= \tAdminNotifications::where('required_id',$clinic->id)->where('user_id',$admin_id)->where('type','clinic')->where('notification_type','clinic_time_unfilled')->get()->count();\n\t\t\t\t\t\t\tif($admin_notifications == 0){\n\t\t\t\t\t\t\t\t$this->save_admin_notification($clinic->id,'clinic','clinic_time_unfilled',$message,$admin_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($notification_type == 'both'){\n\t\t\t\t\t\t// email sending process for confirm clinic starts\n\t\t\t\t\t\t$clinic_date_time\t\t= \tnew DateTime($clinic->date.' '.$clinic->time, new DateTimeZone('GMT'));\n\t\t\t\t\t\t$clinic_date_time->setTimezone(new DateTimeZone($admin->timezone));\n\t\t\t\t\t\t$date_time \t\t\t\t= \t$clinic_date_time->format('Y-m-d H:i');\n\t\t\t\t\t\t$date \t\t\t= \t$clinic_date_time->format('Y-m-d');\n\t\t\t\t\t\t$time \t\t\t= \t$clinic_date_time->format('H:i');\n\t\t\t\t\t\t$subject_replace\t\t= array($clinic->name,$admin->x_time_unfilled_notify);\n\t\t\t\t\t\t$replace_array \t\t\t= array($admin->first_name.' '.$admin->last_name,$date,$time,$clinic->location_name);\n\t\t\t\t\t\t$type \t\t\t\t\t=\t'clinic_time_unfilled';\n\t\t\t\t\t\t$check_status\t\t\t=\t$this->CheckMailSentStatus($clinic->id,$admin->id,$type);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($check_status == 0){\n\t\t\t\t\t\t\t$email_send \t\t\t= $this->mail_send('clinic_time_unfilled',$admin->email,$admin->first_name.' '.$admin->last_name,$subject_replace,$replace_array,null,$clinic->id,$admin->id,$type);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t// email sending process for confirm clinic ends\n\t\t\t\t\t\t\n\t\t\t\t\t\t// process to send web push notification starts here //\n\t\t\t\t\t\tif(($admin->x_time_unfilled_notify != '' || $admin->x_time_unfilled_notify != null) && $admin->x_time_unfilled_notify != 'off'){\n\t\t\t\t\t\t$estimated_time \t= \t'+'.($admin->x_time_unfilled_notify*60).' minutes';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$start_time \t\t\t= \tdate('Y-m-d H:i:s',strtotime($estimated_time,strtotime($clinic->created_at)));\n\t\t\t\t\t\t$current_time\t \t\t= \tstrtotime(date('Y-m-d H:i:s'));\n\n\t\t\t\t\t\tif($current_time > $start_time){\n\t\t\t\t\t\t\t$message = $clinic->name.' is unfilled in '.$estimated_time/60 .' hours';\n\t\t\t\t\t\t\t$admin_notifications \t= \tAdminNotifications::where('required_id',$clinic->id)->where('user_id',$admin_id)->where('type','clinic')->where('notification_type','clinic_time_unfilled')->get()->count();\n\t\t\t\t\t\t\tif($admin_notifications == 0){\n\t\t\t\t\t\t\t\t$this->save_admin_notification($clinic->id,'clinic','clinic_time_unfilled',$message,$admin_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// process to send web push notification ends here //\n\t\t\t\t\t\t\n\t\t\t\t\t}elseif($notification_type == 'none'){\n\t\t\t\t\t\t// no notifications goes nothing\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\techo \"success\";\n\t\t\t}else{\n\t\t\t\techo \"no records available\";\n\t\t\t}\n\t\t }\n\t}", "public function getAttentionAppoinmentsByDay(){\n\n // $this->autoRender = false;\n \n // $date = '2016-08-30';\n // $idCenter = 1;\n // $idSpeciality = 1; \n \n\n $data = $this->request->data;\n $date = $data['date'];\n $dateEnd = $data['dateEnd'];\n $idCenter = $data['center'];\n $idSpeciality = $data['speciality']; \n\n $this->loadModel('Attentions');\n $this->loadModel('Orders');\n $this->loadModel('Specializations');\n\n if($idSpeciality == 0){\n\n \n $query = $this->Appointments->find('all',\n ['contain' => [\n 'Studies',\n 'Orders.Patients.People',\n 'MedicalOffices'],\n 'conditions'=> [\n // 'Studies.specializations_id IN' => $specializations,\n // 'Studies.specializations_id IN (SELECT sp.id FROM specializations sp WHERE sp.cost_centers_id ='.$idSpeciality.')',\n 'Appointments.id = (SELECT at.appointments_id FROM attentions at WHERE at.appointments_id = Appointments.id GROUP BY at.appointments_id )'\n \n ]]);\n\n }else{\n \n \n $query = $this->Appointments->find('all',\n ['contain' => [\n 'Studies',\n 'Orders.Patients.People',\n 'MedicalOffices'],\n 'conditions'=> [\n // 'Studies.specializations_id IN' => $specializations,\n 'Studies.specializations_id IN (SELECT sp.id FROM specializations sp WHERE sp.cost_centers_id ='.$idSpeciality.')',\n 'Appointments.id = (SELECT at.appointments_id FROM attentions at WHERE at.appointments_id = Appointments.id GROUP BY at.appointments_id ) '\n ]]);\n }\n\n\n \n //para que se busque en todos los centros el id del centro debe ser igual a all ·\n if($idCenter != \"all\"){\n $query = $query->matching('Orders', function ($q) use ($idCenter) {\n return $q->where(['Orders.centers_id' =>$idCenter ]);\n }); \n }else{\n $query = $query->matching('Orders', function ($q) use ($idCenter) {\n return $q->where(['Orders.centers_id >' =>0 ]);\n }); \n }\n //fin de busqueda\n \n\n \n $query = $query->matching('AppointmentDates', function ($q) use ( $date, $dateEnd ) {\n\n return $q->where([\n\n 'DATE(AppointmentDates.date_time_ini) >=' => $date,\n\n 'DATE(AppointmentDates.date_time_ini) <=' => $dateEnd, \n\n 'AppointmentDates.appointment_states_id ' => 3,\n\n 'AppointmentDates.id = (SELECT MAX(ad.id) FROM appointment_dates ad WHERE ad.appointments_id = Appointments.id )',\n\n ]);\n });\n \n\n\n\n if($query){\n $query = $query->toArray();\n \n $this->set(compact('query','success'));\n\n } else {\n\n $success = false;\n\n $this->set(compact('success','errors'));\n\n }\n }", "private function findLimitations(array $dates): array\n {\n $setting = $this->settingsRepo->findOne(['key' => 'calendar_max_booking_range']);\n $deltaMonth = $setting === null ? 1 : (int) $setting->value;\n\n $minutes = date('i');\n $nextHourDate = (new DateTimeImmutable())\n ->modify('+1 hour')\n ->modify('-' . $minutes . 'minutes');\n $currentDate = (new DateTimeImmutable())\n ->setTime(0, 0, 0, 0);\n $futureDate = new DateTimeImmutable(\"last day of +{$deltaMonth} month\");\n\n // Calculate limitations.\n $limitations = array_map(function (string $dateStr) use ($currentDate, $futureDate, $nextHourDate) {\n $date = new DateTimeImmutable($dateStr);\n if ($date == $currentDate) {\n $diff = $nextHourDate->diff($date);\n $length = $diff->days * 24 * 60 + $diff->h * 60 + $diff->i;\n return [\n 'start_at' => $date->getTimestamp(),\n 'length' => $length\n ];\n } elseif ($date < $currentDate || $date >= $futureDate) {\n return [\n 'start_at' => $date->getTimestamp(),\n 'length' => 24 * 60 // 24 hours\n ];\n }\n return [];\n }, $dates);\n\n return array_values(array_filter($limitations, function (array $limitation) {\n return count($limitation) > 0;\n }));\n }", "function get_ponderaciones_notas($parametros)\n\t{\n\t\t$sql = \"SELECT calidad, porc_parciales, porc_integrador, porc_trabajos\n\t\t\t\t\tFROM ufce_ponderacion_notas\n\t\t\t\t\tWHERE \tanio_academico = {$parametros['anio_academico']}\n\t\t\t \t\t\t\tAND periodo_lectivo = {$parametros['periodo']}\n\t\t\t\t\t\t\tAND materia = {$parametros['materia']} \n\t\t\t\t\t\t\tAND calidad = {$parametros['calidad']} \";\n\t\treturn kernel::db()->consultar_fila($sql, db::FETCH_ASSOC);\n\t}" ]
[ "0.65832955", "0.60815525", "0.59971064", "0.5963073", "0.52695614", "0.51633483", "0.5152075", "0.5138532", "0.50855523", "0.5028637", "0.49679378", "0.49406815", "0.49344075", "0.48848647", "0.48741308", "0.48680362", "0.4861028", "0.48550025", "0.48493317", "0.4830252", "0.48294693", "0.48273537", "0.48143023", "0.47814074", "0.4754621", "0.47524238", "0.4743308", "0.474301", "0.47276938", "0.47147426" ]
0.6318502
1
Provides a list of months for each centre which have not sent their questionnaire till the nearest reminder date (passed, not upcoming) For zero compliant centres only the start month & end month of the year are given of the questionnaires sent by the users for the months till the reminder date.
public static function getNonComplianceMonths() { $rem = self::getDelinquency(); $fCentres = $rem['fullCompliance']; $pCentres = $rem['partCompliance']; $zCentres = $rem['zeroCompliance']; $pCentreNC = $rem['noncomplianceMonths']; $query = new Query(); $centres = $query ->select(['wpLocCode','_id'=>false]) ->from('centres') ->where(['status'=>Centres::STATUS_ACTIVE]) ->all(); foreach($centres as $centre): $centresCode[] = (int)Arrayhelper::getValue($centre,'wpLocCode'); endforeach; //first get the past nearest reminder date $actRem=ReminderMaster::getActiveReminder(); $remDate = date_create($actRem->getLastRemDate()); date_sub($remDate,date_interval_create_from_date_string("1 months")); $endDate = self::getYearEndDate(); $res = CommonHelpers::dateCompare($endDate,date_format($remDate,'d-m-Y')); //if the year is ending before the reminder date, reminder last date should be only the current year end date. if(!$res) $remDate = date_create($endDate); $remMonth = date_format($remDate,"m-Y"); $currYear = CurrentYear::getCurrentYear(); $startDate = $currYear->yearStartDate; $startMonth = date_format(date_create($startDate),"m-Y"); $statusArray = array(); //for zero compliant centres all the months of the current year //have to be added without calculation.. foreach ($centresCode as $centre): if (in_array($centre, $zCentres)) { $months=$startMonth.' to '.$remMonth; $statusArray[] =['centres'=>$centre, 'months'=>$months]; } endforeach; $zCentreArray = ArrayHelper::map($statusArray,'centres','months'); // now find out months for partially compliant centres. foreach ($pCentreNC as $key=>&$value): array_walk($value, function(&$value,$key) { foreach ($value as $val): $val="01-".$val; $val=date_format(date_create($val,timezone_open('Asia/Kolkata')),'M-Y'); endforeach; $value = implode(', ',$value); return $value; }); endforeach; //merge the non compliant month arrays for zero compliant and partial compliant centres for total non compliant centres & their months. $noncompliance = ArrayHelper::merge($zCentreArray, $pCentreNC); return [ 'noncompliance'=>$noncompliance, 'zerocompliance'=>$zCentreArray, 'partcompliance'=>$pCentreNC, 'startDate'=>$startDate, 'endDate'=>$endDate, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _calcMonths()\r\n\t{\r\n\t\tif ($this->_spandir==1) // start is before stop (positive span)\r\n\t\t{\r\n\t\t\t$dtStart = new DateClass($this->StartDate);\r\n\t\t\t$dtStart = $dtStart->BOM();\r\n\t\t\t$dtStop = $this->StopDate;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$dtStart = new DateClass($this->StopDate);\r\n\t\t\t$dtStart = $dtStart->BOM();\r\n\t\t\t$dtStop = $this->StartDate;\r\n\t\t}\r\n\t\t\r\n\t\t//--------------------------------------------------\r\n\t\t// count times crossing period boundries\r\n\t\t//--------------------------------------------------\r\n\t\t$counter =0;\r\n\t\twhile ($dtStart->TimeStamp() < $dtStop->TimeStamp())\r\n\t\t{\r\n\t\t\t$counter++;\t\t\t\r\n\t\t\t$dtStart->Add(\"month\",1);\r\n\t\t}\r\n\t\t$this->_months = ($counter-1)*$this->_spandir;\r\n\t\t\r\n\t\treturn $this->_months;\r\n\t\t\r\n\t}", "protected function getMonths()\n\t{\n\n\t\tif ($this->arParams['PARENT_SECTION'] > 0) {\n\t\t $this->filter['=SECTION_ID'] = $this->arParams['PARENT_SECTION'];\n\t\t if ($this->arParams['INCLUDE_SUBSECTIONS']) {\n\t\t $this->filter['=INCLUDE_SUBSECTIONS'] = 'Y';\n\t\t }\n\t\t}\n\t \n\t $arSelect = array(\n\t 'COUNT',\n\t 'MONTH',\n\t 'YEAR',\n\t );\n\t \n\t $arFilter = array(\n\t\t\t'ACTIVE' => 'Y',\n\t\t\t'IBLOCK_ID' => $this->arParams['IBLOCK_ID']\n\t\t);\n\t \n\n\t $arGroup = array(\n\t\t 'YEAR',\n\t\t 'MONTH',\n\t\t);\n\t \n\t $arOrder = array(\n\t 'YEAR' => 'DESC',\n\t 'MONTH' => 'DESC',\n\t );\n\n\t $arRuntimeFields = array(\n new \\Bitrix\\Main\\Entity\\ExpressionField('COUNT', 'COUNT(*)'),\n new \\Bitrix\\Main\\Entity\\ExpressionField('MONTH', 'MONTH(ACTIVE_FROM)'),\n new \\Bitrix\\Main\\Entity\\ExpressionField('YEAR', 'YEAR(ACTIVE_FROM)'),\n\t );\n\t\t\n\t\t\n\t\t$monthsIterator = \\Bitrix\\Iblock\\ElementTable::getlist(array(\n\t\t 'select' => $arSelect,\n\t\t 'filter' => $arFilter,\n\t\t 'group' => $arGroup,\n\t\t 'order' => $arOrder,\n\t\t 'runtime' => $arRuntimeFields,\n\t\t));\n\t\t\n\t\t$months = array();\n\t\t\n\t\twhile ($month = $monthsIterator->fetch()) {\n\t\t $months[] = $month;\n\t\t unset ($month);\n\t\t}\n\t\t\n\t\treturn $months;\n\t}", "public static function getDelinqCentreDetails()\n\t\t{\n\t\t\t$noncompliancemonths= self::getNonComplianceMonths();\n\t\t\t$noncompliance=$noncompliancemonths['noncompliance'];\n\t\t\t$startDate = $noncompliancemonths['startDate'];\n\t\t\t$endDate = $noncompliancemonths['endDate'];\n\t //get the centre ids of all non compliant centres\n\t $keys = array_keys($noncompliance);\n \t$query = new Query;\n \t$rows = $query\n\t ->select(['name','wpLocCode','_id'=>false])\n\t ->from('centres')\n\t ->where(['in','wpLocCode',$keys])\n\t ->all();\n\n\t // get the names of the non compliant centres\n \t$ncNames= ArrayHelper::map($rows,'wpLocCode','name');\n\n\t\t\t//get additional details for all non compliant centres \n \t$q = new Query;\n \t$rows = $q\n \t\t\t->select(['centreId','reminderArray','lastReminderDate','remUserArray', '_id'=>false])\n \t\t\t->from ('centreReminderLinker')\n \t\t\t->where(['in','centreId',$keys])\n \t\t\t->all();\n\n \t//if no reminder has ever been sent\n \tfor ($i=0; $i<sizeof($rows); $i++):\n \t\tif (!array_key_exists('lastReminderDate', $rows[$i])):\n \t\t\t$rows[$i]['reminderArray'] = 'no reminder sent before';\n \t\t\t$rows[$i]['lastReminderDate'] = 'no last Date';\n \t\tendif;\n \tendfor;\n\n \t//create reminder details by re-indexing\n \t$remDetails = ArrayHelper::index($rows,'centreId');\n\n\n \t//get all reminder emails for all centres \n \t$remEmails = self::getReminderUsers()['remEmails'];\n \t$remKeys = array_keys($remEmails);\n \t$currRemDetails=array();\n \t$ncconsolidated = array();\n\t foreach($keys as $key):\n\t \n\t $nc = $noncompliance[$key];\n\n \t//if there are more than one \n \tif (is_array($noncompliance[$key])):\n\t \t\t$nc = $noncompliance[$key][0];\n \tendif;\n\n \t\tif (!in_array($key,$remKeys,false)):\n \t\t\t$remUsers[$key]='no registered user';\n \t\t\t$remEmails[$key]='--';\t\n \t\t\tendif;\n\n\t if(isset($remDetails[$key]['centreId']\n\t )):\n\t \t$reminderArray = $remDetails[$key]['reminderArray'];\n\t \tif(is_array($reminderArray) && (sizeof($reminderArray)!== 0)):\n\t \t\t$remDates = Arrayhelper::getColumn($reminderArray,'remDate');\n\t \t\t$currRem = array();\n\t \t\tforeach ($remDates as $remDate):\n\t \t\t\t$res = CommonHelpers::dateCompare($remDate,$startDate);\n\t \t\t\tif ($res)\n\t \t\t\t$k = array_search($remDate,$remDates);\n\t \t\t\t$currentRem[$k]=$reminderArray[$k];\n\t \t\t\t\n\t \t\tendforeach;\n\t \t\t$currRemDetails[$key]=$currentRem;\n\t \t\t$currRemDateArr[$key]= ArrayHelper::getColumn($currentRem,'remDate');\n\t \t\t$currRemIdArr[$key]= ArrayHelper::getColumn($currentRem,'remId');\n\t \telse:\n\t \t\t$currRemDetails[$key] = ['remDate'=> '','remId'=> ''];\n\t \t\t$currRemDateArr[$key] = [ ''];\n\t \t\t$currRemIdArr[$key] = [''];\n\t \tendif;\n\n\t $ncconsolidated[$key]=\n\t [\n\t\t \t'centreId'=>$key,\n\t\t \t'name'=>$ncNames[$key],\n\t\t \t'emails'=>$remEmails[$key],\n\t\t \t'months'=>$nc,\n\t\t \t'reminderArray'=>$currRemDetails[$key],\n\t\t \t'reminderDate' =>$currRemDateArr[$key],\n\t\t \t'reminderId' =>$currRemIdArr[$key],\n\t\t \t'lastReminderDate'=>$remDetails[$key]['lastReminderDate']\n\t \t];\n\t else:\n\t \t$ncconsolidated[$key]=\n\t \t[\n\t\t \t'centreId'=>$key,\n\t\t \t'name'=>$ncNames[$key],\n\t\t \t'emails'=>$remEmails[$key],\n\t\t \t'months'=>$nc,\n\t\t \t'reminderArray'=>'no reminder Details',\n\t\t \t'reminderDate' =>'--',\n\t\t \t'reminderId' =>'--',\n\t\t \t'lastReminderDate'=> 'no last Date Details',\n\t \t];\n\t endif;\t\n\t endforeach;\n\t return $ncconsolidated;\n\t\t}", "private function getNetLoggerOperationalMonths(){\n $start = new Carbon('2018-08');\n $end = Carbon::now();\n $interval = DateInterval::createFromDateString('1 month');\n $period = new DatePeriod($start, $interval, $end);\n $months = [];\n\n foreach ($period as $dt) {\n $months[] = $dt->format(\"Y-m\");\n }\n return $months;\n }", "function getMonths();", "public static function getMonthRanges($array) {\n\t\n\t\t// Establish easy access to beginning and ending date\n\t\t$date1_sql = $array['date1_sql'];\n\t\t$date2_sql = $array['date2_sql'];\n\t\t\n\t\t/* Now use DateTime diff function to return number of months between two posted dates (result in format 'm')\n\t\t * The original formula ($months = $date1->diff($date2)->m did not work across multiple years.\n\t\t *\n\t\t**/\n\t\t$date1 = new DateTime($date1_sql);\n\t\t$date2 = new DateTime($date2_sql);\n\t\t$months = ($date1->diff($date2)->m) + ($date1->diff($date2)->y*12);\n\t\t//$months = $date1->diff($date2)->m;\n\t\t//echo 'month diff result: '.$months.'<br>';\n\t\t\n\t\t// Now run loop to construct succession of beginning and ending dates. Add 1 to $months, as diff function above always returns one less\n\t\t$date = $date1_sql;\n\t\tfor($m=0; $m<$months+1; $m++) {\n\t\t\tif($m == 0) {\n\t\t\t\t$date1 = $date1_sql;\n\t\t\t} else {\n\t\t\t\t$date1 = $date; // This was est at the end of the loop\n\t\t\t}\n\t\t\t//echo '$date1: '.$date1.'<br>';\n\t\t\t// Add $date1 to array\n\t\t\t$date_array[] = $date1;\n\t\t\t\n\t\t\t// Now figure out second date. Check to make sure that result is less than 2nd POST date. If not, set = 2nd POST date\n\t\t\t$date_obj = new DateTime($date1);\n\t\t\t$date2 = $date_obj->format(\"Y-m-t\");\n\t\t\tif($date2 > $date2_sql) {\n\t\t\t\t$date2 = $date2_sql;\n\t\t\t} \n\t\t\t\n\t\t\t// Add $date2 to array\n\t\t\t$date_array[] = $date2;\n\t\t\t\n\t\t\t// Now get the first of the next month\n\t\t\t$date = strtotime(date(\"Y-m-d\", strtotime($date2)) . \" +1 day\");\n\t\t\t$date = date(\"Y-m-d\", $date);\n\t\t}\n\t\treturn $date_array;\n\t}", "public function findAllInCurrentMonth() {\n $starting = array();\n $finishing = array();\n $now = new \\DateTime;\n $currentMonth = $now->format('m');\n $em = $this->getEntityManager();\n\n $query = $em->createQueryBuilder();\n\n $query->add('select', 'o')\n ->add('from', 'ClassCentralSiteBundle:Offering o')\n ->add('orderBy', 'o.startDate ASC')\n ->add('where', 'o.status != :status')\n ->setParameter('status', Offering::COURSE_NA);\n\n $allOfferings = $query->getQuery()->getResult();\n\n foreach ($allOfferings as $offering) {\n if ($offering->getStartDate()->format('m') == $currentMonth) {\n $starting[] = $offering;\n }\n\n if ($offering->getEndDate() != null && $offering->getEndDate()->format('m') == $currentMonth) {\n $ending[] = $offering;\n }\n }\n\n return compact('starting', 'ending');\n }", "public function getEachMonth(){\n $m = I('post.month','','htmlspecialchars');//\n //$m = \"02\";\n $res = [];\n $res0 = [];\n //echo C(DATEORIYEAR);\n $DATEYEAR = date(\"Y\",time());\n //echo $DATEYEAR;\n for($i=C(DATEORIYEAR);$i<=$DATEYEAR;$i++){\n //echo $i;\n $fromdate = $i.\"-\".$m.\"-01\";\n $todate = $i.\"-\".$m.\"-31\";\n $res0 = getDayToDayYears($fromdate,$todate);\n if(empty($res0)){\n $res0 = [];\n }\n $res = array_merge($res,$res0);\n //print_r($res0);\n\n }\n $i = 0;\n for($i = 0; $i<count($res);$i++){\n //echo ($k[\"name\"]);\n //echo (count($k[\"values\"]));\n //print_r($res[$i][\"values\"]);\n if(count($res[$i][\"values\"]) == 0){\n unset($res[$i]);\n }\n //echo \"<br>\";\n }\n //print_r($res);\n $this->ajaxReturn($res);\n }", "public static function getDelinquency()\n\t\t{\n\t\t\t//get required values..\n\t\t\t\n\t\t\t$compliance= self::getComplianceData();\n\t\t\t$reminder = ReminderMaster::getActiveReminder();\n\t\t\t$remDate = $reminder->getLastRemDate();\n\t\t\t$startDate = self::getYearStartDate();\n\t\t\t$endDate = self::getYearEndDate();\n\n\t\t\t\n\t\t\t//get all months for the current year till this month end (including this month)\n\t\t\t$dayArray = CommonHelpers::getInbetweenMonthend($startDate,$remDate);\n\n\t\t\t//check if end date for active year is before the rem date...\n\t\t\t$res = array_search($endDate,$dayArray);\n\t\t\tif (!$res):\n\t\t\t\t//if no then remove the two elements at the end where\n\t\t\t\t//to give two months time before the reminder date.\n\t\t\t\tarray_pop($dayArray);\n\t\t\t\tarray_pop($dayArray);\n\t\t\telse:\n\t\t\t\t//if yes, truncate the array only to the year end date.\n\t\t\t\t$position = $res-sizeof($dayArray) + 1;\n\t\t\t\tarray_splice($dayArray,$position); \t\n\t\t\tendif;\n\n\t\t\t//reindex array\t\n\t\t\t$recomp = ArrayHelper::index($compliance,null,'centreID'); \n\t\t\t\n\t\t\t//now find which centres are fully compliant\n\t\t\t$fullCompCentres=array();\n\t\t\tforeach ($recomp as $key=>$value):\n\t\t\t\tif(sizeof($value) >= sizeof($dayArray))\n\t\t\t\t$fullCompCentres[]=$key;\n\t\t\tendforeach;\n\n\t\t\t//get centre code of all centres\n\t\t\t$query = new Query();\n\t\t\t$centres=\t$query->select(['name','wpLocCode','code','_id'=>false])\n\t\t\t\t\t\t->from ('centres')\n\t\t\t\t\t\t->where(['status'=>Centres::STATUS_ACTIVE])\n\t\t\t\t\t\t->all();\n\t\t\t\n\t\t\tforeach($centres as $centre):\n\t\t\t\t\t$centresCode[] = (int)Arrayhelper::getValue($centre,'wpLocCode');\n\t\t\tendforeach;\n\n\t\t\t//get partially compliant centres \n\t\t\t$compCentresAll = array_unique(Arrayhelper::getColumn($compliance, function($element){\n\t\t\t\treturn (int)$element['centreID'];\n\t\t\t}));\n\n\t\t\t$partCompCentres = array_diff($compCentresAll,$fullCompCentres);\n\n\t\t\t//get totally non compliant centres\n\t\t\t$res1 = array_diff($compCentresAll,$centresCode);\n\t\t\t$res2 = array_diff($centresCode, $compCentresAll);\n\t\t\t$zeroCompCentres = array_merge($res1,$res2);\n\t\t\t\n\t\t\t//check all months array & create array of noncompliance month\n\t\t\t$comptemp = array();\n\t\t\t$comp = array();\n\n\t\t\tfor ($i=0; $i<sizeof($compliance); $i++):\n\t\t\t\t$comptemp[$compliance[$i]['centreID']][] =\t\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'forDate'=>$compliance[$i]['forDate'],\n\t\t\t\t\t\t\t'centreID'=>(int)$compliance[$i]['centreID']\n\t\t\t\t\t\t];\n\t\t\tendfor;\n\n\t\t\tforeach ($comptemp as $key=>$value):\n\t\t\t\t$comp[$key]=ArrayHelper::getColumn($value,'forDate');\n\t\t\tendforeach;\n\n\t\t\tforeach ($comp as $key=>$value):\n\t\t\t\t$diff= array_values(array_diff($dayArray,$value));\n\t\t\t\tforeach ($diff as &$val):\n\t\t\t\t\t$val = \\Yii::$app->formatter->asDate($val, 'php:m-Y');\n\t\t\t\tendforeach;\n\t\t\t\t$nonCompliance[$key][]=$diff;\n\t\t\tendforeach;\n\n\t\t\t$complianceDetails = \n\t\t\t\t[\n\t\t\t\t\t'fullCompliance'=>$fullCompCentres, \n\t\t\t\t\t'partCompliance'=>$partCompCentres,\n\t\t\t\t\t'zeroCompliance'=>$zeroCompCentres,\n\t\t\t\t\t'noncomplianceMonths'=>$nonCompliance,\n\t\t\t\t\t'complianceConsolidated'=>$compliance, \n\t\t\t\t];\n\t\t\treturn $complianceDetails;\n\t\t}", "function getAllMonths(){\n\t\t$monthArray = array();\n\t\t$reservationDates = Reservation::orderBy('checkin', 'ASC')->get();\n\t\t // dd($reservationDates);\n\t\t$reservationDates = json_decode($reservationDates);\n\t\t// dd($reservationDates);\n\t\tif(! empty($reservationDates)){\n\t\t\tforeach($reservationDates as $reservationDate){\n\t\t\t\t// dd($reservationDate);\n\t\t\t\t$date = new \\DateTime($reservationDate->checkin);\n\t\t\t\t// dd($date);\n\t\t\t\t$monthNum = $date->format('m');\n\t\t\t\t$monthName = $date->format('M');\n\t\t\t\t// dd($monthNum);\n\t\t\t\t$monthArray[$monthNum]=$monthName;\n\t\t\t\t// dd($monthArray);\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $monthArray;\n\t\t// dd($monthArray);\n\t}", "public function getCcMonths() {\n $months = $this->getData('cc_months');\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $this->_getConfig()->getMonths());\n $this->setData('cc_months', $months);\n }\n return $months;\n }", "public function getMonths()\n {\n $months = array();\n $currentMonth = 1;\n for ($x = $currentMonth; $x < $currentMonth + 12; $x++) {\n $months[] = date('F', mktime(0, 0, 0, $x, 1));\n }\n return $months;\n }", "function diasMeses(){\r\n $retorno = array();\r\n\r\n for($i = 1; $i<=12;$i++){\r\n //cal = calendario, days in month = dias do ano.\r\n $retorno[$i] = cal_days_in_month(CAL_GREGORIAN, $i, date('Y'));\r\n }\r\n\r\n return $retorno;\r\n\r\n }", "public function getCalendarMonths()\n {\n return [\n 1 => ['Jan','January'],\n 2 => ['Feb','February'],\n 3 => ['Mar','March'],\n 4 => ['Apr','April'],\n 5 => ['May','May'],\n 6 => ['June','June'],\n 7 => ['July','July'],\n 8 => ['Aug','August'],\n 9 => ['Sept','September'],\n 10 => ['Oct','October'],\n 11 => ['Nov','November'],\n 12 => ['Dec','December']\n ];\n }", "public function getComparisonInMonths()\n {\n return $this->comparisonArray['m'] + ($this->getComparisonInYears() * 12);\n }", "public function getCcMonths()\n {\n return array_merge(array($this->__('Month')), $this->_getConfig()->getMonths());\n }", "public function get_non_project_dates(array $project_days, $datepicker_month_range)\n{\n // create an array of dates for a number of months specified by the user. 0 is used for this month\n for ($month = 0; $month <= $datepicker_month_range; $month++) {\n $dt_dates = new DateTime();\n $month_beginning = $dt_dates->format('Y-m-01');\n $dt_dates = new DateTime($month_beginning); // rollback the date to the first so we can increment months safely\n $dt_dates->add(new DateInterval(\"P{$month}M\")); // P1M == plus 1 month\n $days_in_month = cal_days_in_month(CAL_GREGORIAN, $dt_dates->format('m'), $dt_dates->format('Y'));\n //echo $days_in_month.\" days in \".$dt_dates->format('m').\", \";\n for ($day = 1; $day <= $days_in_month; $day++) {\n $date = $dt_dates->format('Y').\"-\".$dt_dates->format('m').\"-\".sprintf('%02d', $day); // leading zeros 05-..\n $month_days[] = $date; // holds dates for datepicker month ranges\n }\n }\n\n\t// get all the days in the calendar time span, which correspond to the project's days\n foreach ($project_days as $project_day) {\n // for each day in the project day array (mon, tue, etc...)\n for ($month = 0; $month <= $datepicker_month_range; $month++) {\n $dt_project_dates = new DateTime();\n $month_beginning = $dt_project_dates->format('Y-m-01');\n $dt_project_dates = new DateTime($month_beginning); // rollback the date to the first so we can increment months safely\n $dt_project_dates->add(new DateInterval(\"P{$month}M\")); // P1M == plus 1 month\n $days_in_month = cal_days_in_month(CAL_GREGORIAN, $dt_project_dates->format('m'), $dt_project_dates->format('Y'));\n\n for ($day = 1; $day <= $days_in_month; $day++) {\n // for every day in the month\n $date = $dt_project_dates->format('Y').\"-\".$dt_project_dates->format('m').\"-\".sprintf('%02d', $day);\n $week_day = date('w', strtotime($date));\n if($week_day == $project_day){\n $project_days_this_month[] = $date; // holds project dates for a specific month\n }\n }\n }\n\n }\n\n\t// get all cancelled dates (set by admin - like public holidays)\n\t$cancelled_dates_obj = $this->get_cancelled_dates();\n\tif(!empty($cancelled_dates_obj)) {\n foreach ($cancelled_dates_obj as $value) {\n $cancelled_dates[] = $value->date; // prepare array\n \t}\n }\n else {\n $cancelled_dates = []; // no cancelled dates have been submitted\n }\n\n // prepare the single level array to be passed to js array for js based datepicker\n\t// array_diff - subtract project dates from all dates\n\t// array_merge - add cancelled days to the result of non project dates\n\t// return all the *non project dates*. This is for the datapicker\n\treturn '[\"' . implode('\", \"', array_merge( array_diff($month_days, $project_days_this_month), $cancelled_dates) ) . '\"]';\n}", "function getMonth() {\n $first = $this->start->format(\"D\");\n $offset = $this->week[$first];\n\n if( $offset > 0 ) {\n $days = array_fill(0, $offset, \"\");\n }\n\n $temp = clone $this->start;\n\n # fill in days of the month\n for( $i = 0; $i < $this->days; $i++ ) {\n $day = $temp->format(\"Y-m-d\");\n $days[] = $day;\n\n $temp->add(new DateInterval(\"P1D\"));\n }\n\n # reorganize by week\n $days = array_chunk($days, 7);\n\n # fill in missing days to fill grid\n $week = count($days) - 1;\n $last_week = $days[$week];\n $missing = 7 - count($last_week);\n\n if( $missing > 0 ) {\n $last_week_fill = array_fill(0, $missing, \"\");\n $days[$week] = array_merge($last_week, $last_week_fill);\n }\n\n return( $days );\n }", "function appsInMonth(){\n $appointments = array();\n \n}", "public static function getMonthList() {\r\n\t\t\t/*\r\n\t\t\t$list = array();\r\n\t\t\t$dte = new DateTime();\r\n\t\t\t$dte->setDate((int)$dte->format('Y'),1,1);\r\n\t\t\tfor($m = 1; $m <= 12; $m++ ) {\r\n\t\t\t\t$list' $m ' = (string)$dte->format('F');\r\n\t\t\t\t$dte->modify('+1 month');\r\n\t\t\t}\r\n\t\t\treturn $list;\r\n\t\t\t*/\r\n\t\t\treturn array(\r\n\t\t\t\t\t\t\t1 => 'January',\r\n\t\t\t\t\t\t\t2 => 'February',\r\n\t\t\t\t\t\t\t3 => 'March',\r\n\t\t\t\t\t\t\t4 => 'April',\r\n\t\t\t\t\t\t\t5 => 'May',\r\n\t\t\t\t\t\t\t6 => 'June',\r\n\t\t\t\t\t\t\t7 => 'July',\r\n\t\t\t\t\t\t\t8 => 'August',\r\n\t\t\t\t\t\t\t9 => 'September',\r\n\t\t\t\t\t\t\t10 => 'October',\r\n\t\t\t\t\t\t\t11 => 'November',\r\n\t\t\t\t\t\t\t12 => 'December'\r\n\t\t\t\t\t);\r\n\t\t\t \r\n\t\t}", "public function dataMonths()\n {\n return array(\n array('2015-01-15 00:00:00', '2015-01-01 00:00:00', '15 January at 12:00 am'),\n array('2015-02-15 00:00:00', '2015-01-01 00:00:00', '15 February at 12:00 am'),\n array('2015-03-15 00:00:00', '2015-01-01 00:00:00', '15 March at 12:00 am'),\n array('2015-04-15 00:00:00', '2015-01-01 00:00:00', '15 April at 12:00 am'),\n array('2015-05-15 00:00:00', '2015-01-01 00:00:00', '15 May at 12:00 am'),\n array('2015-06-15 00:00:00', '2015-01-01 00:00:00', '15 June at 12:00 am'),\n array('2015-07-15 00:00:00', '2015-01-01 00:00:00', '15 July at 12:00 am'),\n array('2015-08-15 00:00:00', '2015-01-01 00:00:00', '15 August at 12:00 am'),\n array('2015-09-15 00:00:00', '2015-01-01 00:00:00', '15 September at 12:00 am'),\n array('2015-10-15 00:00:00', '2015-01-01 00:00:00', '15 October at 12:00 am'),\n array('2015-11-15 00:00:00', '2015-01-01 00:00:00', '15 November at 12:00 am'),\n array('2015-12-15 00:00:00', '2015-01-01 00:00:00', '15 December at 12:00 am'),\n );\n }", "function get_months($date1, $date2) {\n\t\t\n\t\t\n\t $time1 = strtotime($date1);\n\t $time2 = strtotime($date2);\n\t $my = date('mY', $time2);\n\t \n\t\tif(date('Y-m',$time1) == date('Y-m',$time2)){\n\t\t return array(date('Y-m', $time1));\n\t\t}\n\t \n\t $months = array(date('Y-m', $time1));\n\n\n\t while($time1 < $time2) {\n\t\t $time1 = strtotime(date('Y-m-d', $time1).' +1 month');\n\t\t if(date('mY', $time1) != $my && ($time1 < $time2))\n\t\t\t $months[] = date('Y-m', $time1);\n\t }\n\t\t\n\t\tif($date1< $date2){\n\t\t\t$months[] = date('Y-m', $time2);\n\t\t}\n\t\t\n\t return $months;\n\t}", "public static function getMonths($from, $to){\n\t\t$today = \"'\".date(\"Y-m-d\").\"'\";\n\t\t$year = date('Y');\n\t\t$tests = Test::select('time_created')->distinct();\n\n\t\tif(strtotime($from)===strtotime($today)){\n\t\t\t$tests = $tests->where('time_created', 'LIKE', $year.'%');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$toPlusOne = date_add(new DateTime($to), date_interval_create_from_date_string('1 day'));\n\t\t\t$tests = $tests->whereBetween('time_created', array($from, $toPlusOne));\n\t\t}\n\n\t\t$allDates = $tests->lists('time_created');\n\t\tasort($allDates);\n\t\t$yearMonth = function($value){return strtotime(substr($value, 0, 7));};\n\t\t$allDates = array_map($yearMonth, $allDates);\n\t\t$allMonths = array_unique($allDates);\n\t\t$dates = array();\n\n\t\tforeach ($allMonths as $date) {\n\t\t\t$dateInfo = getdate($date);\n\t\t\t$dates[] = array('months' => $dateInfo['mon'], 'label' => substr($dateInfo['month'], 0, 3),\n\t\t\t\t'annum' => $dateInfo['year']);\n\t\t}\n\n\t\treturn json_encode($dates);\n\t}", "function getMonthlyAllData()\n {\n\n $monthly_user_count_array = array();\n $usuario_meses_array = $this->getAllUserMonths();\n $meses_nome__usuario_array = array();\n if (!empty($usuario_meses_array)) {\n foreach ($usuario_meses_array as $mes_numero => $mes_nome) {\n $monthly_user_count = $this->getMonthlyUserCount($mes_numero);\n array_push($monthly_user_count_array, $monthly_user_count);\n array_push($meses_nome__usuario_array, $mes_nome);\n }\n }\n\n //PEGANDO DADOS DAS PUBLICAÇÕES\n\n $monthly_publicacao_count_array = array();\n $publicacao_meses_array = $this->getAllPublicacaoMonths();\n $meses_publicacao_array = array();\n if (!empty($publicacao_meses_array)) {\n foreach ($publicacao_meses_array as $mes_numero => $mes_nome) {\n $monthly_publicacao_count = $this->getMonthlyPublicacaoCount($mes_numero);\n array_push($monthly_publicacao_count_array, $monthly_publicacao_count);\n array_push($meses_publicacao_array, $mes_nome);\n }\n }\n\n //PEGANDO DADOS DOS ANIMAIS\n\n $monthly_animal_count_array = array();\n $animal_meses_array = $this->getAllAnimalMonths();\n $meses_nome_animal_array = array();\n if (!empty($animal_meses_array)) {\n foreach ($animal_meses_array as $mes_numero => $mes_nome) {\n $monthly_animal_count = $this->getMonthlyAnimalCount($mes_numero);\n array_push($monthly_animal_count_array, $monthly_animal_count);\n array_push($meses_nome_animal_array, $mes_nome);\n }\n }\n $racas=Racas::all();\n $usuario = session()->get(\"Usuario\");\n $monthly_data_array = array(\n 'animais_vacinados' => Animal::where('vacinacao','=','sim')->get()->count(),\n 'animais_nao_vacinados' => Animal::where('vacinacao','=','nao')->get()->count(),\n 'animais_nao_sei' => Animal::where('vacinacao','=','nao_sei')->get()->count(),\n 'animais_castrados' => Animal::where('catracao','=','nao')->get()->count(),\n 'animais_nao_castrados' => Animal::where('catracao','=','sim')->get()->count(),\n 'animais_nao_sei_castrados' => Animal::where('catracao','=','nao_sei')->get()->count(),\n 'animais_machos' => Animal::where('sexo','=','macho')->get()->count(),\n 'animais_femeas' => Animal::where('sexo','=','femea')->get()->count(),\n 'animais_pretos' => Animal::where('cor','=','preto')->get()->count(),\n 'animais_brancos' => Animal::where('cor','=','branco')->get()->count(),\n 'animais_dourados' => Animal::where('cor','=','dourado')->get()->count(),\n 'animais_creme' => Animal::where('cor','=','creme')->get()->count(),\n 'animais_amarelo' => Animal::where('cor','=','amarelo')->get()->count(),\n 'animais_chocolate' => Animal::where('cor','=','chocolate')->get()->count(),\n 'animais_mestico' => Animal::where('cor','=','mestico')->get()->count(),\n /*----------------------*/\n 'animais_pelo_curto' => Animal::where('pelagem','=','curto')->get()->count(),\n 'animais_pelo_medio' => Animal::where('pelagem','=','medio')->get()->count(),\n 'animais_pelo_longo' => Animal::where('pelagem','=','longo')->get()->count(),\n 'animais_pequenos' => Animal::where('porte','=','pequeno')->get()->count(),\n 'animais_medios' => Animal::where('porte','=','medio')->get()->count(),\n 'animais_grandes' => Animal::where('porte','=','grande')->get()->count(),\n 'animais_cachorro' =>DB::table('animals')->join('raca','animals.id_raca','=','raca.id')->join('especies','raca.id_especie','=','especies.id')->where('especies.id','=',1)->get()->count(),\n 'animais_gato'=>DB::table('animals')->join('raca','animals.id_raca','=','raca.id')->join('especies','raca.id_especie','=','especies.id')->where('especies.id','=',2)->get()->count(),\n 'total_publicacao' => Publicacao::count(),\n 'meses_publicacao' => $meses_publicacao_array,\n /*----------------------*/\n 'meses_usuarios' => $meses_nome__usuario_array,\n 'meses_animal' => $meses_nome_animal_array,\n 'usuarios' => $monthly_user_count_array,\n 'publicacao' => $monthly_publicacao_count_array,\n 'animais' => $monthly_animal_count_array,\n 'total_usuarios' => Usuario::count(),\n 'total_animais' => Animal::count(),\n\n\n\n\n );\n return view('/dashboard')->with(['dados' => $monthly_data_array,\"racas\"=>$racas,\"usuario\"=>$usuario]);\n }", "public function get_months() {\n\t\t\treturn array(\n\t\t\t\t'January' => __( 'January', 'jet-engine' ),\n\t\t\t\t'February' => __( 'February', 'jet-engine' ),\n\t\t\t\t'March' => __( 'March', 'jet-engine' ),\n\t\t\t\t'April' => __( 'April', 'jet-engine' ),\n\t\t\t\t'May' => __( 'May', 'jet-engine' ),\n\t\t\t\t'June' => __( 'June', 'jet-engine' ),\n\t\t\t\t'July' => __( 'July', 'jet-engine' ),\n\t\t\t\t'August' => __( 'August', 'jet-engine' ),\n\t\t\t\t'September' => __( 'September', 'jet-engine' ),\n\t\t\t\t'October' => __( 'October', 'jet-engine' ),\n\t\t\t\t'November' => __( 'November', 'jet-engine' ),\n\t\t\t\t'December' => __( 'December', 'jet-engine' ),\n\t\t\t);\n\t\t}", "private function getMandates() {\n // Look for mandates with entity_id of this contribution.\n $query = array_intersect_key(\n $this->values,\n array('entity_id' => '', 'entity_table' => '')\n );\n\n return civicrm_api3('SepaMandate', 'get', $query);\n }", "public function getDeferredMonths()\n {\n return $this->deferredMonths;\n }", "static function getMonths() {\n\t\t$months = array();\n\t\t$months[ 1 ] = \"January\";\n\t\t$months[ 2 ] = \"February\";\n\t\t$months[ 3 ] = \"March\";\n\t\t$months[ 4 ] = \"April\";\n\t\t$months[ 5 ] = \"May\";\n\t\t$months[ 6 ] = \"June\";\n\t\t$months[ 7 ] = \"July\";\n\t\t$months[ 8 ] = \"August\";\n\t\t$months[ 9 ] = \"September\";\n\t\t$months[ 10 ] = \"October\";\n\t\t$months[ 11 ] = \"November\";\n\t\t$months[ 12 ] = \"December\";\n\n\t\treturn $months;\n\t}", "private static function getComplianceData()\n\t\t{\n\t\t\t$query = new Query();\n\t\t\t$centres=\t$query->select(['name','wpLocCode','code','_id'=>false])\n\t\t\t\t\t\t->from ('centres')\n\t\t\t\t\t\t->where(['status'=>Centres::STATUS_ACTIVE])\n\t\t\t\t\t\t->all();\n\n\t\t \tforeach($centres as $centre):\n\t\t\t\t\t$centresCode[] = (int)Arrayhelper::getValue($centre,'wpLocCode');\n\t\t\tendforeach;\n\t\t\t\t\n\t\t\t\n\t\t\t//get all questionnaires for a centre whose For-month date is \n\t\t\t\t//less than the reminder date \n\t\t\t\t//& status is submitted, rework,closed or approved\n\t\t\t\n\t\t\t$startDate = self::getYearStartDate();\n\t\t\t$stDateTS = strtotime($startDate);\n\t\t\t$que = new Query();\n\t\t\t$compliance = $que->select([\n\t\t\t\t\t\t\t\t\t'queId',\n\t\t\t\t\t\t\t\t\t'forDate',\n\t\t\t\t\t\t\t\t\t'forYear',\n\t\t\t\t\t\t\t\t\t'forDateTS',\n\t\t\t\t\t\t\t\t\t'centreID',\n\t\t\t\t\t\t\t\t\t'created_uname'\n\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t\t->from('questionnaire')\n\t\t\t\t\t\t\t\t->where([\n\t\t\t\t\t\t\t\t\t'in','status',\n\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_APPROVED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_CLOSED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_SUBMITTED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_REWORK,\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->andFilterCompare('forDateTS', $stDateTS, '>=')\n\t\t\t\t\t\t\t\t->all();\n\t\t\treturn $compliance; \n\t\t}", "public function getByMonth()\n {\n $query = new Query('SELECT MONTH(invoice_date) AS m, COUNT(invoice_id) AS c FROM invoices WHERE invoice_delete = 0 AND YEAR(invoice_date) = :y GROUP BY MONTH(invoice_date)', [':y' => date('Y')]);\n $query = $this->getMysql()->executeQuery($query);\n if (!$query->isSuccess()) {\n $result = [];\n for ($i = 1; $i <= 12; $i++) {\n $result[$i] = 0;\n }\n return $result;\n }\n $result = [];\n foreach ($query->getResultSet() as $row) {\n $result[$row['m']] = $row['c'];\n }\n for ($i = 1; $i <= 12; $i++) {\n if (!isset($result[$i]))\n $result[$i] = 0;\n }\n return $result;\n }" ]
[ "0.63045156", "0.62748295", "0.6256609", "0.6092509", "0.6069981", "0.6021608", "0.6002906", "0.5955178", "0.58806473", "0.5780079", "0.57438743", "0.5734405", "0.57281965", "0.57212746", "0.56553465", "0.5621084", "0.5612867", "0.5611795", "0.5596974", "0.55751055", "0.5558457", "0.5557391", "0.55549693", "0.5526248", "0.55220145", "0.5513384", "0.5509279", "0.55053645", "0.5495849", "0.54957396" ]
0.7841484
0
/ This function creates the text and returns the fields for reminder mail
public static function getReminderText($model) { $centreDetails = self::getDelinqCentreDetails(); $noncompliance = self::getNonComplianceMonths(); $zeroCompliance = $noncompliance['zerocompliance']; $partCompliance = $noncompliance['partcompliance']; $startDate = date_format(date_create($noncompliance['startDate'],timezone_open('Asia/Kolkata')),'M-Y'); $endDate = date_format(date_create($noncompliance['endDate'],timezone_open('Asia/Kolkata')),'M-Y'); foreach ($centreDetails as $key=>$value) { $centre = \common\models\Centres::findOne(['wpLocCode'=>$key]); $centrename= $centre->name; $textArray[$key]['emails'] = $value['emails']; $months = $value['months']; $res = in_array($months,$zeroCompliance); $montharr = []; if ($res==false): $montharr = explode(', ',$months); foreach($montharr as &$month) { $month= date_format( date_create( '01-'.$month, timezone_open('Asia/Kolkata')), 'M-Y' ); } $months=implode(', ',$montharr); else: $months = $startDate.' to '.$endDate; endif; $textArray[$key]['months']=$months; $message = '<div style="margin: 10px; width:90%;">'; $message = $message. '<div align="center"><h3><strong>Sub:&nbsp;&nbsp;<u>'; $message = $message.$model->subjectField ; $message = $message. " for <p>".ucwords(strtolower($centrename)); $message = $message. "</p></u></h3></strong>"; $message = $message. "</div>"; $message = $message. "<br/><br/>"; $message = $message. '<div align="left">'.$model->salutation."</div><br/>"; $message = $message. '<div align="left">'.$model->topText."</div><br/>"; $message = $message. '<br/><div align="centre">'; $message = $message. $textArray[$key]['months']."</div><br/>"; $message = $message. '<div align="left">'.$model->bottomText."</div><br/><br/>"; $message = $message.'<div align="left">'.$model->closingNote."</div>"; $message = $message."</div>"; $textArray[$key]['message']=$message; } return $textArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sendemailtext()\n {\n $arr_day_of_week = Configure::read('DAYOFWEEK');\n $NurseryReservesTable = TableRegistry::get('NurseryReserves');\n $queryName = $NurseryReservesTable->find()->select(['email' => 'Users.email', 'user_name' => 'CONCAT(name_last, name_first)',\n 'reserve_date', 'reserve_time_start', 'reserve_time_end', 'remarks' => 'NurseryReserves.remarks'])\n ->join(['Users' => ['table' => 'users', 'type' => 'INNER',\n 'conditions' => 'NurseryReserves.user_id = Users.id']])\n ->where(['NurseryReserves.ID' => 119])->first();\n $reserve_date = ($queryName->reserve_date ? date(\"Y年m月d日\", strtotime($queryName->reserve_date)) : '' ) . '(' . $arr_day_of_week[date(\"D\", strtotime($queryName->reserve_date))] . ')';\n\n $mailinfos['user_name'] = $queryName->user_name;\n $mailinfos['email'] = $queryName->email;\n $mailinfos['childs'] = 'childs test';\n $mailinfos['remark'] = nl2br($queryName->remarks);\n $mailinfos['mail_contact'] = 'SEND MAIL TEXT';\n $mailinfos['reserve_date'] = $reserve_date;\n $mailinfos['reserve_time_start'] = substr_replace($queryName->reserve_time_start, ':', 2, 0);\n $mailinfos['reserve_time_end'] = substr_replace($queryName->reserve_time_end, ':', 2, 0);\n if ($mailinfos['email']) {\n $this->sendEmail(\n Configure::read('from_mailaddress'),\n '[email protected]',\n '【Startup Hub Tokyo】一時保育サービス 仮予約についてのご連絡',\n $mailinfos,\n 'email_nursery_reserves_unapproval',\n null,\n '[email protected]'\n );\n }\n }", "function get_email_body_text($firstname, $lastname, $obs_id, $obs_confirm_check) {\n\t// Each line should be separated with a LF (\\n). Lines should not be larger than 70 characters.\n\t$msg = \"Hi \" . $firstname . \" \" . $lastname . \",\\n\\n\"\n\t\t . \"Thanks for submitting your fireball observation to the VFO!\\n\\n\"\n\t\t . \"Your observation with code '\". $obs_id . \"' will be submitted \"\n\t\t . \"to our database once you confirm by clicking this link:\\n\"\n\t\t . \"http://umdb.urania.be/smena/confirm.php?obs_id=\" \n\t\t . $obs_id . \"&obs_check=\" . $obs_confirm_check . \"\\n\"\n\t\t . \"When the above link isn't clickable, you can manually \"\n\t\t . \"enter your observation code (together with you \"\n\t\t . \"confirmation code '\" . $obs_confirm_check . \"') in the form on \"\n\t\t . \"the confirmation page at our website.\\n\\n\"\n\t\t . \"Greetings and have a nice day,\\nThe VFO mailing pigeon\";\n\treturn $msg;\n}", "function reminderMail(){\r\n global $from_email_address,$templatePath,$templatePath_plpto,$imagePath,$txxchange_config,$templatePath_wx;\r\n\t\t\t$query = \" SELECT user_id,username,name_first,username,AES_DECRYPT(UNHEX(password),'{$txxchange_config['private_key']}') as password FROM user WHERE usertype_id =1 AND STATUS !=3 AND agreement = 0 AND DATEDIFF( current_date, DATE( creation_date ) ) = 3 \";\r\n\t\t\t\t\t\t\r\n\t\t\t$result = @mysql_query($query) ; \r\n\t\t\t// taking every user's date data line by line\r\n\t\t\tif(@mysql_num_rows($result)){\r\n\t\t\t\twhile ($row = @mysql_fetch_array($result)) {\r\n\t\t\t\t\t\t//fill in data for mail content.\r\n\t\t\t\t\t\t$data = array() ;\r\n $data['images_url'] = $imagePath;\r\n $data['password'] = $row['password'];\r\n\t\t\t\t\t\t//code section for sending of mail.\r\n\t\t\t\t\t\t$user_id = $row['user_id'];\r\n\t $clinicName\t=\tget_clinic_info($user_id,\"clinic_name\");\r\n\t\t\t\t\t\t$data['clinicName'] = $clinicName;\r\n\t\t\t\t\t\t$data['username'] = $row['username'];\r\n\t\t\t\t\t\t$clinic_type = getUserClinicType($user_id);\r\n\t\t\t\t\t\t$clinic_channel=getchannel(get_clinic_info($user_id,'clinic_id'));\r\n\t\t\t\t if($clinic_channel==1){\r\n $business_url=$txxchange_config['business_tx']; \r\n $support_email=$txxchange_config['email_tx'];\r\n }else{\r\n $business_url=$txxchange_config['business_wx']; \r\n $support_email=$txxchange_config['email_wx']; \r\n }\r\n $data['business_url'] = $business_url;\r\n $data['support_email'] = $support_email;\r\n\t if( $clinic_channel == 1){\r\n\t \t$message = build_template($templatePath_plpto,$data);\r\n\t }\r\n\t else{\r\n\t \t$message = build_template($templatePath_wx,$data);\r\n\t }\r\n\t\t\t\t\t\t//$message = build_template($templatePath,$data);\r\n \r\n\r\n\t\t\t\t\t\t$to = $row['username'];\t\r\n\t\t\t\t\t\t$subject = html_entity_decode($clinicName, ENT_QUOTES, \"UTF-8\").\" Follow-up\";\r\n\t\t\t\t\t\t// To send HTML mail, the Content-type header must be set\r\n\t\t\t\t\t\t$headers = 'MIME-Version: 1.0' . \"\\n\";\r\n\t\t\t\t\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//$headers .= \"From: \" .html_entity_decode($clinicName). \"<[email protected]>\" . \"\\n\";\r\n\t\t\t\t\t\t//$returnpath = '[email protected]';\r\n\t\t\t\t\r\n\t\t\t\t\t\tif( $clinic_channel == 1){\r\n\t\t\t\t\t\t $headers .= \"From: \".setmailheader($clinicName). \" <\".$txxchange_config['email_tx'].\">\" . \"\\n\";\r\n\t\t\t\t\t\t $returnpath = \"-f\".$txxchange_config['email_tx'];\r\n\t\t\t\t\t\t }else{\r\n\t\t\t\t\t\t $headers .= \"From: \".setmailheader($clinicName). \" <\".$txxchange_config['email_wx'].\">\" . \"\\n\";\r\n\t\t\t\t\t\t $returnpath = '-f'.$txxchange_config['email_wx']; \r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$headers .= 'Bcc: ' . $from_email_address . \"\\n\"; // will be deleted later.\r\n\t\t\t\t\t\t// Mail it\r\n\t\t\t\t\t\techo $to;\r\n\t\t\t\t\t\t@mail($to, $subject, $message, $headers, $returnpath); \r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "protected function buildMessage()\n {\n // Get recurrence string\n $recurrence = $this->reminder->isRecurring() ?\n \"\\n\\n(Recurs {$this->reminder->frequency})\" :\n \"\\n\\nThis reminder won't recur\";\n\n // Concat body and recurrence info\n return \"{$this->reminder->body}{$recurrence}\";\n }", "private function prepareMail() {\n\t\t// adjust subject & body\n\t\tif(isset($_POST[\"rehearsal\"])) {\n\t\t\t// adjust subject\n\t\t\t$reh = $this->getData()->getRehearsal($_POST[\"rehearsal\"]);\n\t\t\t$text = \"Probe am \" . Data::getWeekdayFromDbDate($reh[\"begin\"]);\n\t\t\t$text .= \", \" . Data::convertDateFromDb($reh[\"begin\"]) . \" Uhr\";\n\t\t\t$_POST[\"subject\"] = $text;\n\t\t\t\n\t\t\t// adjust body: append songs to practise\n\t\t\t$songs = $this->getData()->getSongsForRehearsal($_POST[\"rehearsal\"]);\n\t\t\tif(count($songs) > 1) {\n\t\t\t\t$ext = \"<p>Bitte probt folgende St&uuml;cke:</p><ul>\\n\";\n\t\t\t\tfor($i = 1; $i < count($songs); $i++) {\n\t\t\t\t\t$ext .= \"<li>\" . $songs[$i][\"title\"] . \" (\" . $songs[$i][\"notes\"] . \")</li>\\n\";\n\t\t\t\t}\n\t\t\t\t$ext .= \"</ul>\\n\";\n\t\t\t\t$_POST[\"message\"] .= \"\\n$ext\";\n\t\t\t}\n\t\t}\n\t\telse if($_POST[\"subject\"] == \"\") {\n\t\t\tglobal $system_data;\n\t\t\t$_POST[\"subject\"] = $system_data->getCompany(); // band name\n\t\t}\n\t}", "protected function getEmailBody($config, $variables, $type)\n {\n if ($type == \"reminder1\") {\n $template = SSViewer::fromString($config->ReviewBodyFirstReminder);\n }\n if ($type == \"reminder2\") {\n $template = SSViewer::fromString($config->ReviewBodySecondReminder);\n }\n if ($type == \"due\") {\n $template = SSViewer::fromString($config->ReviewBody);\n }\n \n $value = $template->process(new ArrayData($variables));\n\n // Cast to HTML\n return DBField::create_field('HTMLText', (string) $value);\n }", "private function textEmailPart(){\n\n $message = 'Content-type: text/plain; charset=utf-8'.\"\\n\";\n\n return $message;\n }", "public function plain_text(){\r\n\t\t$out = '';\r\n\t\tif ( is_array( $this->data ) && count( $this->data ) > 0 ) {\r\n\t\t\tforeach ( $this->data as $item ) {\r\n\t\t\t\t$out .= $this->place_break( '.', 60 );\r\n\r\n\t\t\t\tif ( isset( $item['attendees'] ) && is_array( $item['attendees'] ) ) {\r\n\t\t\t\t\t$out .= $this->place_break( '.', 50 );\r\n\t\t\t\t\t$out .= \"Attendees\" . \"\\n\" . $this->place_break( '.', 50 );\r\n\t\t\t\t\tforeach ( $item['attendees'] as $attendee ) {\r\n\t\t\t\t\t\t$fullname = $attendee['first_name'] . \" \" . $attendee['last_name'];\r\n\t\t\t\t\t\t$out .= \"- \" . implode( ', ', array( $fullname, $attendee['email'] ) ) . \"\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Other meta\r\n\t\t\t\t$out .= $this->place_break( '.', 50 );\r\n\t\t\t\tforeach(\r\n [\r\n $item['title'],\r\n $item['ticket_name'],\r\n $item['start_date'],\r\n $item['end_date'],\r\n $item['start_time'],\r\n $item['ends_time'],\r\n $item['event_addr'],\r\n $item['quantity'],\r\n ] as $key => $val ) {\r\n\t\t\t\t\t$out .= sprintf( '%s: %s', $val['label'], $val['value'] ) . \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .= $this->place_break( '.', 50 );\r\n\t\t\t}\r\n\t\t\t$out .= $this->place_break( '.', 60 );\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "function iwacontact_submission_email_body() {\n\t\n\tglobal $ajaxcontact;\n\n\t$fields = get_post_custom();\n\n\techo nl2br( $fields['_email_body'][0] );\n\n}", "function certrt_email_teachers_text($info) {\n $posttext = get_string('emailteachermail', 'certrt', $info) . \"\\n\";\n\n return $posttext;\n}", "function generate_mail(){\n\t\t\n\t\t$email = new e_mail;\n\t\t$email->empfaenger = $_POST['email_input_id'];\n\t\t$email->betreff = 'TOOLPORT - Deine Bestellung';\n\t\t$email->from = 'no reply: TOOLPORT';\n\t\t$email->mail_text = \n\t\t\t'\n\t\t\tHallo '. $_POST['first_name_input_id'] .'!\n\t\t\tWir haben Deine Bestellung erhalten.\n\t\t\tDer 3x6 m Faltpavillon PROFESSIONAL Alu 40mm, Seitenteile mit Panoramafenstern in '. strtolower($_POST['color_id']) .'er Farbe wird in den nächsten ein bis zwei Werktagen geliefert.\n\t\t\t\n\t\t\tViele Grüße,\n\t\t\t Dein TOOLPORT-Team.\n\t\t\t';\n\t\t$email->send();\n\t}", "function invite_by_mail_to_new_wk1 ($crea_vn, $crea_nn, $crea_datti_ger, $wkbez1, $wkbez2, $start_datti_ger, $ende_datti_ger, $this_recip_vn, $this_recip_nn, $this_recip_e, $this_recip_link)\n{\n\t \n\t \n\t\t$sender = \"[email protected]\";\n\t\t\n\t\t// $to = \"[email protected]\";\n\t\t$recipient = \"[email protected]\";\t\t\n\t\t\n\t\t\n\t \n\t \n\t\t\n\t\t\n\t\t$text = 'This is a text message.'; \t// falls html nicht möglich: \n\t\t\t\t\t\t\t\t\t\t\t\t// Diese Variable muss als \"Fallback\" den gleichen Inhalt aufweisen\n\t\t\t\t\t\t\t\t\t\t\t\t// wie $html \n\t\t\t\t\t\t\t\t\t\t\t\t\n\t \n\t\t// $html = '<html><body><p>This is a html message</p></body></html>';\t\t// Vorlage Tutorial-1361762 \t \n\t \n\t\t\n\t\t// merke: \t<b> für Fettschrift funzt \n\t\t//\t\t\t<bold> funzt nicht (Email wird aber zugestellt)\n\t\t//\t\t\t<strong> funzt nicht (Email wird nicht zugestellt)\t\t\n\t\t//\t\t\t<p style=\"color:#FF6699;font-size:30px\">This is styled text !!! </p> ==> funzt, wenn \"px\" als Einheit angegeben. \n\t\t\n\t\t//\t\t\t<font color=\"#FF0000\"> innerhalb <p> funzt.\n\t\t//\t\t\t<img src=\"sbspics/cy01.JPG\" width=\"207\" height=\"123\" alt=\"\" />'\n\t\t//\t\t\t\tfunzt dann, wenn auch gemacht wird (!): \n\t\t//\t\t\t\t$mime->addHTMLImage('sbspics/cy01.JPG', 'image/jpeg');\n\t\t//\t\t\t\n\n\n\t\t\n\t $html = '<html><body><h1>Jabbadabba</h1><h2>DUUUUUUuuuuuuuuuuuuuuuuu</h2><br />';\n\t $html = $html . '<p>This is a trial message</p>';\n\t\t\n\t\t\n\t\t$html = $html . '<p>This is a <b>ABCDEFG </b>message</p>';\t\t\t // Email funzt mit b, der Text is dann auch wirklich fett !\n\t\t$html = $html . '<p>This is a <font color=\"#FF0000\">ABCDEFG </font>message</p>';\t\t\n\t\t$html = $html . '<img src=\"sbspics/cy01.JPG\" width=\"207\" height=\"123\" alt=\"\" />';\t// dafür notwendig: $mime->addHTMLImage('sbspics/cy01.JPG', 'image/jpeg'); \t\t\n\t\t$html = $html . '<p>This is a <i><font color=\"#FF0000\">ABCDEFG und kursiv </font></i>message</p>';\n\t\t\n\t\t\n\t\t\n\t\t// Playing around with this 140112\n\t\t$html = $html . '<p style=\"color:#FF6699;font-size:30px\">This is styled text !!! </p>';\t \n\t\t$html = $html . '<p style=\"color:#006699;font-weight:bold;font-size:30px\">This is styled text !!! </p>';\t // dann wird keine Mail verschickt \n\t\t\n\t\t\n\t\t$html = $html . '<p>This is a trial message</p>';\n\t\t\n\t\t// $html = $html . '<p style=\"color:#4C4C4C;font-weight:bold;font-family:Calibri;font-size:20\">This is a tral message</p>';\n\t \n\t $html = $html . '</body></html>';\n\t \n\t \n\t $html = '<html><body><br />';\n\t $html = $html . '<img src=\"sbspics/sbs_002c.jpg\" width=\"499\" height=\"149\" alt=\"\" />';\t// dafür notwendig: $mime->addHTMLImage('sbspics/cy01.JPG', 'image/jpeg'); \t\t\n\t\t// Groeesse ori = 997 x 297, halbiere ich auf 499 x 149 \n\t\t$html = $html . \"<h1>\" . $wkbez1 . \"\";\n\t\tif(!empty($wkbez2))\n\t\t{\n\t\t\t$html = $html . \"<br />\" . $wkbez2 . \"</h1>\";\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$html = $html . \"</h1>\";\t\t\n\t\t}\n\t $html = $html . \"Hallo \" . $this_recip_vn . \" \" . $this_recip_nn . \",\";\n\t $html = $html . \"<p>Sie wurden f&uuml;r den o.g. Online-Wettkampf nominiert.\"; \n\t $html = $html . \" Dieser Wettkampf wurde von \" . $crea_vn . \" \" . $crea_nn . \" am \" . $crea_datti_ger . \" geplant.</p>\"; \n\t \n\t // Verbesserungsvorschlag: Hier könnte die Disziplin gut stehen !!!! \n\t \n\t $html = $html . \"<p><h3>Start: \" . $start_datti_ger . \"<br />\";\n\t $html = $html . \"Ende: \" . $ende_datti_ger . \"</h3></p>\";\n\t \n\t $html = $html . \"<p>Bitte best&auml;tigen Sie Ihre Teilnahme, indem Sie diesen Link ~~~\" . $this_recip_link . \"~~~ benutzen.\";\n\t $html = $html . \" Dort finden Sie auch die Kontaktdaten beider Mannschaftsf&uuml;hrer.</p>\";\n\t $html = $html . '<p style=\"color:#006699;font-weight:lighter\">Dies ist eine automatisch generierte E-Mail. Bitte schicken Sie keine Antwort E-Mail an diese Absender E-Mail Adresse.</p>';\t \n\t $html = $html . \"<p>Mit Sch&uuml;tzengruss<br />\";\n\t $html = $html . \"Online Portal f&uuml;r Sportschiessen<br />\";\n\t $html = $html . \"http://www.shooting-competition.de</p>\";\n\n\t \n\t \n\t \n\t \n\t $html = $html . '</body></html>';\n\t \n\t\t//$recipient = $this_recip_e\n\t \n\t\t$subject = \"Einladung zum Online-Wettkampf\";\n\t \n\t\t$body = \"Hallo \" . $this_recip_vn . \" \" . $this_recip_nn . \",\\n\\n\";\n\t\t$body = $body . \"Dies ist eine Einladung zum Online-Wettkampf, \\n\\n\" . $wkbez1 . \"\\n\\n\" ;\n\t\t$body = $body . $wkbez2 . \"\\n\\n\" ;\n\t\t$body = $body . \"Dieser Wk wurde von \" . $crea_vn . \" \" . $crea_nn . \" am \" . $crea_datti_ger . \" geplant. \\n\\n\";\n\t\t$body = $body . \"Der Wk findet wie folgt statt: \\n\\n\";\n\t\t$body = $body . \"Start: \" . \"\\n\\n\";\n\t\t$body = $body . \"Start: \" . $start_datti_ger . \" Ende: \" . $ende_datti_ger . \"\\n\\n\";\n\t\t \n\t \n\t \n\t\t$body = $body . \"\\n\\n Bitte bestaetigen Ihre Teilnahme indem Sie diesen Link ~~~\" . $this_recip_link . \"~~~ benutzen \\n\\n\";\n\t\t$body = $body . \"Dort finden Sie auch die Kontaktdaten beider Mannschaftsführer. \\n\\n\";\n\t \n\t \t \n\t\n\t\t$crlf = \"\\n\";\n\t \n\t\t$headers = array(\n\t\t\t'From' => $sender,\n 'Return-Path' => $sender,\n 'Subject' => $subject\n );\n\t\t\n\t\t$mime = new Mail_mime($crlf);\t\t\n\t\t\n\t\t// Setting the body of the email\n $mime->setTXTBody($text);\t\t\t\t\n $mime->setHTMLBody($html);\t\t\t\t\n\t\t\n\t\t$mime->addHTMLImage('sbspics/sbs_002c.jpg', 'image/jpeg');\t\t// für (s.o. '<img src=\"sbspics/cy01.JPG\" ..... \n \n\t\t$body = $mime->get();\t\t\t\t\t\t\n\t\t$headers = $mime->headers($headers);\t\t\n \n \n\t\t$host = \"smtp.1und1.de\";\n\t\t$port = \"587\";\t\t//Angabe von 1und1 Ansonsten: 465 \n\t\t$username = \"[email protected]\";\n\t\t$password = \"walkman1\";\n \n \n\t\t$smtp = Mail::factory(\"smtp\",array(\"host\" => $host,\n \"port\" => $port,\n \"auth\" => true,\n \"username\" => $username,\n \"password\" => $password));\n\n\t\t$mail = $smtp->send($recipient, $headers, $body);\n\n \n\t\tif (PEAR::isError($mail)) \n\t\t{\n\t\t\techo(\"<p>\" . $mail->getMessage() . \"</p>\");\n\t\t} else {\n\t\t\techo(\"<p>Message successfully sent!</p>\");\n\t\t}\n \n\necho \"\\n\"; \n\n}", "public function build()\n {\n $auto_function_name = \"\";\n $pre = \"自動\";\n $suff = \"が完了しました。\";\n switch ($this->auto_function_name) {\n case 'follow':\n $auto_function_name = 'フォロー';\n break;\n case 'unfollow':\n $auto_function_name = 'アンフォロー';\n break;\n case 'favorite':\n $auto_function_name = 'いいね';\n break;\n case 'tweet':\n $auto_function_name = 'ツイート';\n $pre = \"ご予約のツイート\";\n $suff = \"を投稿しました。\";\n break; \n }\n \n $text = $pre.$auto_function_name.$suff;\n \n return $this\n ->markdown('function_mails.finish')\n ->subject(\"オートついったー:\".$text)\n ->with([\n 'auto_function_name' => $auto_function_name,\n 'name' => $this->user->name,\n 'account_name' => $this->tw_account->name.\"@\".$this->tw_account->screen_name,\n 'text' => $text,\n ]\n );\n }", "public static function get_agent_notify_email_template() {\n if (get_option('inbound_admin_notification_inboundnow_link',true)) {\n $credit = '<tr>\n <td valign=\"middle\" width=\"30\" style=\"color:#272727\">&nbsp;</td>\n <td width=\"50\" height=\"40\" valign=\"middle\" align=\"left\" style=\"color:#272727\">\n <a href=\"http://www.inboundnow.com\" target=\"_blank\"><img src=\"{{leads-urlpath}}assets/images/inbound-email.png\" height=\"40\" width=\"40\" alt=\" \" style=\"outline:none;text-decoration:none;max-width:100%;display:block;width:40px;min-height:40px;border-radius:20px\"></a>\n </td>\n <td style=\"color:#272727\">\n <a style=\"color:#272727;text-decoration:none;\" href=\"http://www.inboundnow.com\" target=\"_blank\">\n ' . __('<b>Leads</b> from Inbound Now', 'inbound-pro') . '\n </a>\n </td>\n <td valign=\"middle\" align=\"left\" style=\"color:#545454;text-align:right\">{{date-time}}</td>\n <td valign=\"middle\" width=\"30\" style=\"color:#272727\">&nbsp;</td>\n </tr>';\n } else {\n $credit = '';\n }\n $html = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html>\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html;\" charset=\"UTF-8\" />\n <style type=\"text/css\">\n html {\n background: #EEEDED;\n }\n </style>\n </head>\n <body style=\"margin: 0px; background-color: #FFFFFF; font-family: Helvetica, Arial, sans-serif; font-size:12px;\" text=\"#444444\" bgcolor=\"#FFFFFF\" link=\"#21759B\" alink=\"#21759B\" vlink=\"#21759B\" marginheight=\"0\" topmargin=\"0\" marginwidth=\"0\" leftmargin=\"0\">\n <table cellpadding=\"0\" width=\"600\" bgcolor=\"#FFFFFF\" cellspacing=\"0\" border=\"0\" align=\"center\" style=\"width:100%!important;line-height:100%!important;border-collapse:collapse;margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\">\n <tbody><tr>\n <td valign=\"top\" height=\"20\">&nbsp;</td>\n </tr>\n <tr>\n <td valign=\"top\">\n <table cellpadding=\"0\" bgcolor=\"#ffffff\" cellspacing=\"0\" border=\"0\" align=\"center\" style=\"border-collapse:collapse;width:600px;font-size:13px;line-height:20px;color:#545454;font-family:Arial,sans-serif;border-radius:3px;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\">\n <tbody><tr>\n <td valign=\"top\">\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:separate;width:100%;border-radius:3px 3px 0 0;font-size:1px;line-height:3px;height:3px;border-top-color:#0298e3;border-right-color:#0298e3;border-bottom-color:#0298e3;border-left-color:#0298e3;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px\">\n <tbody><tr>\n <td valign=\"top\" style=\"font-family:Arial,sans-serif;background-color:#5ab8e7;border-top-width:1px;border-top-color:#8ccae9;border-top-style:solid\" bgcolor=\"#5ab8e7\">&nbsp;</td>\n </tr>\n </tbody></table>\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:separate;width:600px;border-radius:0 0 3px 3px;border-top-color:#8c8c8c;border-right-color:#8c8c8c;border-bottom-color:#8c8c8c;border-left-color:#8c8c8c;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:0;border-right-width:1px;border-bottom-width:1px;border-left-width:1px\">\n <tbody><tr>\n <td valign=\"top\" style=\"font-size:13px;line-height:20px;color:#545454;font-family:Arial,sans-serif;border-radius:0 0 3px 3px;padding-top:3px;padding-right:30px;padding-bottom:15px;padding-left:30px\">\n <h1 style=\"margin-top:20px;margin-right:0;margin-bottom:20px;margin-left:0; font-size:28px; line-height: 28px; color:#000;\"> ' . __('A New Lead on {{form-name}} has been assigned to you.', 'inbound-pro') . '</h1>\n <p style=\"margin-top:20px;margin-right:0;margin-bottom:20px;margin-left:0\">' . __('There is a new lead that just converted on <strong>{{date-time}}</strong> from page: <a href=\"{{source}}\">{{source}}</a> {{redirect-message}}', 'inbound-pro') . '</p>\n <!-- NEW TABLE -->\n <table class=\"heavyTable\" style=\"width: 100%;\n max-width: 600px;\n border-collapse: collapse;\n border: 1px solid #cccccc;\n background: white;\n margin-bottom: 20px;\">\n <tbody>\n <tr style=\"background: #3A9FD1; height: 54px; font-weight: lighter; color: #fff;border: 1px solid #3A9FD1;text-align: left; padding-left: 10px;\">\n <td align=\"left\" width=\"600\" style=\"-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #fff; font-weight: bold; text-decoration: none; font-family: Helvetica, Arial, sans-serif; display: block;\">\n <h1 style=\"font-size: 30px; display: inline-block;margin-top: 15px;margin-left: 10px; margin-bottom: 0px; letter-spacing: 0px; word-spacing: 0px; font-weight: 300;\">' . __('Lead Information', 'inbound-pro') . '</h1>\n <div style=\"float:right; margin-top: 5px; margin-right: 15px;\"><!--[if mso]>\n <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}\" style=\"height:40px;v-text-anchor:middle;width:130px;font-size:18px;\" arcsize=\"10%\" stroke=\"f\" fillcolor=\"#ffffff\">\n <w:anchorlock/>\n <center>\n <![endif]-->\n <a href=\"{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}\"\n style=\"background-color:#ffffff;border-radius:4px;color:#3A9FD1;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:130px;-webkit-text-size-adjust:none;\">' . __('View Lead', 'inbound-pro') . '</a>\n <!--[if mso]>\n </center>\n </v:roundrect>\n <![endif]-->\n </div>\n </td>\n </tr>\n <!-- LOOP THROUGH POST PARAMS -->\n [inbound-email-post-params]\n <!-- END LOOP -->\n <!-- IF CHAR COUNT OVER 50 make label display block -->\n </tbody>\n </table>\n <!-- END NEW TABLE -->\n <!-- Start 3 col -->\n <table style=\"margin-bottom: 20px; border: 1px solid #cccccc; border-collapse: collapse;\" width=\"100%\" border=\"1\" BORDERWIDTH=\"1\" BORDERCOLOR=\"CCCCCC\" cellspacing=\"0\" cellpadding=\"5\" align=\"left\" valign=\"top\" borderspacing=\"0\" >\n <tbody valign=\"top\">\n <tr valign=\"top\" border=\"0\">\n <td width=\"160\" height=\"50\" align=\"center\" valign=\"top\" border=\"0\">\n <h3 style=\"color:#2e2e2e;font-size:15px;\"><a style=\"text-decoration: none;\" href=\"{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}&tab=tabs-wpleads_lead_tab_conversions\">' . __('View Lead Activity', 'inbound-pro') . '</a></h3>\n </td>\n <td width=\"160\" height=\"50\" align=\"center\" valign=\"top\" border=\"0\">\n <h3 style=\"color:#2e2e2e;font-size:15px;\"><a style=\"text-decoration: none;\" href=\"{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}&scroll-to=wplead_metabox_conversion\">' . __('Pages Viewed', 'inbound-pro') . '</a></h3>\n </td>\n <td width=\"160\" height=\"50\" align=\"center\" valign=\"top\" border=\"0\">\n <h3 style=\"color:#2e2e2e;font-size:15px;\"><a style=\"text-decoration: none;\" href=\"{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}&tab=tabs-wpleads_lead_tab_raw_form_data\">' . __('View Form Data', 'inbound-pro') . '</a></h3>\n </td>\n </tr>\n </tbody></table>\n <!-- end 3 col -->\n <!-- Start half/half -->\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:10px;\">\n <tbody><tr>\n <td align=\"center\" width=\"250\" height=\"30\" cellpadding=\"5\">\n <div><!--[if mso]>\n <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}\" style=\"height:40px;v-text-anchor:middle;width:250px;\" arcsize=\"10%\" strokecolor=\"#7490af\" fillcolor=\"#3A9FD1\">\n <w:anchorlock/>\n <center style=\"color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;\">' . __('View Lead', 'inbound-pro') . '</center>\n </v:roundrect>\n <![endif]--><a href=\"{{admin-url}}edit.php?post_type=wp-lead&s={{lead-email-address}}\"\n style=\"background-color:#3A9FD1;border:1px solid #7490af;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;\" title=\"' . __('View the full Lead details in WordPress', 'inbound-pro') . '\">' . __('View Full Lead Details', 'inbound-pro') . '</a>\n </div>\n </td>\n <td align=\"center\" width=\"250\" height=\"30\" cellpadding=\"5\">\n <div><!--[if mso]>\n <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"mailto:{{lead-email-address}}?subject=RE:{{form-name}}&body=' . __('Thanks for filling out our form.', 'inbound-pro') . '\" style=\"height:40px;v-text-anchor:middle;width:250px;\" arcsize=\"10%\" strokecolor=\"#558939\" fillcolor=\"#59b329\">\n <w:anchorlock/>\n <center style=\"color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;\">' . __('Reply to Lead Now', 'inbound-pro') . '</center>\n </v:roundrect>\n <![endif]--><a href=\"mailto:{{lead-email-address}}?subject=RE:{{form-name}}&body=' . __('Thanks for filling out our form on {{current-page-url}}', 'inbound-pro') . '\"\n style=\"background-color:#59b329;border:1px solid #558939;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;\" title=\"' . __('Email This Lead now', 'inbound-pro') . '\">' . __('Reply to Lead Now', 'inbound-pro') . '</a></div>\n </td>\n </tr>\n </tbody>\n </table>\n <!-- End half/half -->\n </td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n </tbody></table>\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" style=\"border-collapse:collapse;width:600px;font-size:13px;line-height:20px;color:#545454;font-family:Arial,sans-serif;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\">\n <tbody><tr>\n <td valign=\"top\" width=\"30\" style=\"color:#272727\">&nbsp;</td>\n <td valign=\"top\" height=\"18\" style=\"height:18px;color:#272727\"></td>\n <td style=\"color:#272727\">&nbsp;</td>\n <td style=\"color:#545454;text-align:right\" align=\"right\">&nbsp;</td>\n <td valign=\"middle\" width=\"30\" style=\"color:#272727\">&nbsp;</td>\n </tr>\n '.$credit.'\n <tr>\n <td valign=\"top\" height=\"6\" style=\"color:#272727;line-height:1px\">&nbsp;</td>\n <td style=\"color:#272727;line-height:1px\">&nbsp;</td>\n <td style=\"color:#272727;line-height:1px\">&nbsp;</td>\n <td style=\"color:#545454;text-align:right;line-height:1px\" align=\"right\">&nbsp;</td>\n <td valign=\"middle\" width=\"30\" style=\"color:#272727;line-height:1px\">&nbsp;</td>\n </tr>\n </tbody></table>\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" style=\"border-collapse:collapse;width:600px\">\n <tbody><tr>\n <td valign=\"top\" style=\"color:#b1b1b1;font-size:11px;line-height:16px;font-family:Arial,sans-serif;text-align:center\" align=\"center\">\n <p style=\"margin-top:1em;margin-right:0;margin-bottom:1em;margin-left:0\"></p>\n </td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n <tr>\n <td valign=\"top\" height=\"20\">&nbsp;</td>\n </tr>\n </tbody></table>\n </body>';\n $email_template['subject'] = apply_filters('inbound_new_lead_notification/subject', '');\n $email_template['body'] = apply_filters('inbound_new_lead_notification/body', $html);\n return $email_template;\n }", "function make_notification_text($notification_row)\n {\n // Take action depending on the type\n switch ($notification_row->type)\n {\n // Event invite\n case 'event_invite':\n $query_string = \"SELECT places.name, events.date, events.title, events.id\n FROM plans\n LEFT JOIN events ON events.id = plans.event_id\n LEFT JOIN places ON events.place_id = places.id\n WHERE events.id = ?\";\n $query = $this->db->query($query_string, array($notification_row->subject_id));\n $row = $query->row();\n\n $date = new DateTime($row->date);\n\n $event_text = '';\n if ($row->title != '')\n {\n $event_text = '<b>' . $row->title . '</b> at ';\n }\n\n // Figure out whether to use you or the group name\n if ($notification_row->group_name == NULL)\n {\n $you = 'you';\n } else\n {\n $you = $notification_row->group_name;\n }\n\n return '<b><a href=\"\" class=\"user_notif_link\" user_id=\"' . $notification_row->user_id . '\">' .\n $notification_row->first_name . ' ' . $notification_row->last_name . '</a>' .\n \"</b> has invited $you to \" . $event_text . '<b>' . $row->name . '</b> ' .\n 'for ' . $date->format('l') . ' the ' . $date->format('jS');\n\n // Group invite\n case 'group_invite':\n $query_string = \"SELECT name FROM groups WHERE id = ?\";\n $query = $this->db->query($query_string, array($notification_row->subject_id));\n $row = $query->row();\n\n return '<b><a href=\"\" class=\"user_notif_link\" user_id=\"' . $notification_row->user_id . '\">' .\n $notification_row->first_name . ' ' . $notification_row->last_name . '</a>' .\n '</b> has invited you to join the group <b>' . $row->name . '</b>';\n\n // Follow notification\n case 'follow_notif':\n return '<b><a href=\"\" class=\"user_notif_link\" user_id=\"' . $notification_row->subject_id . '\">' .\n $notification_row->first_name . ' ' . $notification_row->last_name . '</a>' .\n '</b> has followed you';\n\n case 'join_group_request':\n $query_string = \"SELECT name FROM groups WHERE id = ?\";\n $query = $this->db->query($query_string, array($notification_row->subject_id));\n $row = $query->row();\n\n return '<b><a href=\"\" class=\"user_notif_link\" user_id=\"' . $notification_row->user_id . '\">' .\n $notification_row->first_name . ' ' . $notification_row->last_name . '</a>' .\n '</b> has requested to join <b>' . $row->name . '</b> ';\n }\n }", "function GetCustomFields()\n\t{\n\t\t$fields = array();\n\t\t$html_body = $this->body['h'];\n\t\tif ($html_body) {\n\t\t\tpreg_match_all('/%field:(.*?)%/is', $html_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t\tpreg_match_all('/%%(.*?)%%/is', $html_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t}\n\n\t\t$text_body = $this->body['t'];\n\t\tif ($text_body) {\n\t\t\tpreg_match_all('/%field:(.*?)%/is', $text_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t\tpreg_match_all('/%%(.*?)%%/is', $text_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/%field:(.*?)%/i', $this->Subject, $matches);\n\n\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\tforeach ($matches[1] as $p => $f_s) {\n\t\t\t\t$fields[] = $f_s;\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/%%(.*?)%%/i', $this->Subject, $matches);\n\n\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\tforeach ($matches[1] as $p => $f_s) {\n\t\t\t\t$fields[] = $f_s;\n\t\t\t}\n\t\t}\n\n\t\t// in case the field went over multiple lines, strip them out.\n\t\tforeach ($fields as $p => $field) {\n\t\t\t$fields[$p] = str_replace(array(\"\\r\", \"\\n\"), \"\", $field);\n\t\t}\n\n\t\t$fields = array_unique($fields);\n\n\t\t$built_in_fields = array('emailaddress', 'unsubscribelink', 'confirmlink', 'openimage', 'mailinglistarchive', 'webversion', 'companyname', 'companyphone', 'companyaddress', 'link_subscriber_info');\n\t\tforeach ($built_in_fields as $p => $built_in_field) {\n\t\t\t$key = array_search($built_in_field, $fields);\n\t\t\tif ($key !== false) {\n\t\t\t\tunset($fields[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// Sometimes UTF-8 characters inside a custom field name were replaced with\n\t\t// an htmlentities (translated by TinyMCE), so we will need to make sure we include both\n\t\t// decoded and unencoded field name that needed to be searched.\n\t\t$temp = $fields;\n\t\tforeach ($temp as $each) {\n\t\t\t$fields[] = html_entity_decode($each, ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t}\n\n\t\treturn $fields;\n\t}", "protected function mail_body()\n\t{\n\t\t$msg_data = array (\n\t\t\t'Time' => date(\n\t\t\t\tget_option( 'date_format') . ' ' . get_option( 'time_format' )\n\t\t\t)\n\t\t);\n\n\t\t$msg_data = array_merge(\n\t\t\t$msg_data,\n\t\t\t$this->get_ip_data(),\n\t\t\t$this->get_server_data()\n\t\t);\n\n\t\t$msg = $_SERVER['REQUEST_METHOD'] . ' <' . $this->get_request_uri()\n\t\t\t. \">\\r\\n\\r\\n\";\n\n\t\tforeach ( $msg_data as $key => $data )\n\t\t{\n\t\t\t// Some vertical alignment. :)\n\t\t\t$msg .= str_pad( \"$key:\", 23, ' ' ) . \"$data\\r\\n\";\n\t\t}\n\n\t\t$msg = apply_filters( 't5_404_mail_body', trim( $msg ) );\n\t\treturn $msg;\n\t}", "public function plagStuckToPersonalEmail($errortype, $details)\n { // echo $errortype; print_r($details); exit;\n $object = \"File stuck in the Plagiarism stage\";\n $ccmailid ='[email protected]';\n if($errortype == 'php'){\n $mailid = '[email protected]';\n $touser = 'Chandu';\n }\n if($errortype == 'ruby'){\n $mailid = '[email protected]';\n $touser = 'Manohar';\n }\n if($errortype == 'writer'){\n $mailid = $details['aocreateduseremail'];\n $touser = $details['aocreateduser'];\n }\n if($errortype == 'php&ruby'){\n $mailid = '[email protected]';\n $bccmailid = '[email protected]';\n $touser = 'Chandu';\n }\n $text_mail=\"<p>Hi \".$touser.\",<br><br>\n The details for the file stuck in the plagiarism stage !<br><br>\n link to palgiarism stage : <a href=\\\"http://admin-test.edit-place.co.uk/proofread/stage-articles?submenuId=ML3-SL11&aoId=\".$details['aoId'].\"\\\">Stage Plagiarism</a><br><br>\n link to palgiarism stage : <a href=\\\"http://admin-test.edit-place.co.uk/proofread/plag-stuck-arts?submenuId=ML3-SL13\\\">List of stuck up files</a><br><br>\n Comments : \".$details['comments'].\"<br><br>\n Ao title : \".$details['aotitle'].\"<br>\n Article title : \".$details['arttitle'].\"<br><br>\n Cordialement,<br>\n <br>\n Toute l'&eacute;quipe d&rsquo;Edit-place<br><br> </p>\";\n if($this->getConfiguration('mail_from') == '')\n $mail_from = \"[email protected]\";\n else\n $mail_from = $this->getConfiguration('mail_from');\n if($this->getConfiguration('critsend') == 'yes')\n {\n critsendMail($mail_from, $mailid, $object, $text_mail);\n return true;\n }\n else\n {\n $mail = new Zend_Mail();\n $mail->addHeader('Reply-To',$mail_from);\n $mail->setBodyHtml($text_mail)\n ->setFrom($mail_from)\n ->addTo($mailid)\n ->addCc($ccmailid)\n //->addCc('[email protected]')\n ->addCc('[email protected]')\n ->addBcc($ccmailid)\n ->setSubject($object);\n if($mail->send())\n return true;\n }\n }", "function _getTextEmail()\r\n\t{\r\n\t\t$config =& JFactory::getConfig();\r\n\t\t$ignore = $this->getDontEmailKeys();\r\n\t\t$message = \"\";\r\n\t\t$pluginManager =& JModel::getInstance( 'Pluginmanager', 'FabrikModel' );\r\n\t\t$groupModels =& $this->formModel->getGroupsHiarachy();\r\n\r\n\t\tforeach ($groupModels as &$groupModel) {\r\n\t\t\t$elementModels = $groupModel->getPublishedElements();\r\n\t\t\tforeach ($elementModels as &$elementModel) {\r\n\t\t\t\t$element = $elementModel->getElement();\r\n\t\t\t\t$key = (!array_key_exists( $element->name, $this->data )) ? $elementModel->getFullName( true, true, false ) : $element->name;\r\n\t\t\t\tif (!in_array( $key, $ignore )) {\r\n\t\t\t\t\t$val = '';\r\n\t\t\t\t\tif (is_array( $this->data[$key] )) {\r\n\t\t\t\t\t\t//repeat group data\r\n\t\t\t\t\t\tforeach ($this->data[$key] as $k=>$v) {\r\n\t\t\t\t\t\t\t$val .= $k++ .\": $v\\r\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$val = $this->data[$key];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$val = FabrikString::rtrimword($val, \"<br />\");\r\n\t\t\t\t\t$val = stripslashes( $val );\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t// set $val to default value if empty\r\n\t\t\t\t\tif($val == '')\r\n\t\t\t\t\t$val = \" - \";\r\n\r\n\t\t\t\t\t// don't add a second \":\"\r\n\t\t\t\t\t$label = trim( strip_tags( $element->label ) );\r\n\t\t\t\t\t$message .= $label;\r\n\t\t\t\t\tif (strlen( $label ) != 0 && strpos( $label, ':', strlen( $label )-1 ) === false) {\r\n\t\t\t\t\t\t$message .=\":\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$message .= \"\\r\\n\" . $val . \"\\r\\n\\r\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$message = JText::_('Email from') . ' ' . $config->getValue( 'sitename' ) . \"\\r\\n\".JText::_('Message').\":\"\r\n\t\t.\"\\r\\n===================================\\r\\n\".\r\n\t\t\"\\r\\n\" . stripslashes($message);\r\n\t\treturn $message;\r\n\t}", "public function generate_text_for_edit()\n\t{\n\t\t// Add the object type and object id\n\t\t$for_edit = array(\n\t\t\t// Object types can be setup to grab the value of another field (such as $this->post_type) by setting $this->object_type to the field name (post_type)\n\t\t'object_type'\t=> (is_string($this->object_type) && isset($this->{$this->object_type})) ? $this->{$this->object_type} : $this->object_type,\n\t\t'object_id'\t\t=> $this->{$this->sql_id_field},\n\t\t);\n\n\t\t$message = $message_uid = $message_bitfield = $message_options = false;\n\t\t$this->get_message_fields($message, $message_uid, $message_bitfield, $message_options);\n\n\t\tmessage::decode($message, $message_uid);\n\n\t\t$for_edit = array_merge($for_edit, array(\n\t\t'allow_bbcode'\t=> ($message_options & OPTION_FLAG_BBCODE) ? 1 : 0,\n\t\t'allow_smilies'\t=> ($message_options & OPTION_FLAG_SMILIES) ? 1 : 0,\n\t\t'allow_urls'\t=> ($message_options & OPTION_FLAG_LINKS) ? 1 : 0,\n\t\t'text'\t\t\t=> $message, // text is expected by some (it's the default for generate_text_for_edit)\n\t\t'message'\t\t=> $message,\n\t\t));\n\n\t\t// Add any of the marked fields to the array\n\t\tforeach ($this->object_config as $field => $options)\n\t\t{\n\t\t\tif (isset($options['message_field']))\n\t\t\t{\n\t\t\t\t$for_edit[$options['message_field']] = $this->$field;\n\t\t\t}\n\t\t}\n\n\t\treturn $for_edit;\n\t}", "protected function buildEmailFromTemplate($fields,$template,$subject)\r\n {\r\n \r\n $body =file_get_contents(\"http://vps112595.ovh.net\".$template);\r\n foreach ($fields as $name => $content) {\r\n $body = preg_replace(\"~{\".$name.\"}~i\", $content, $body);\r\n }\r\n \r\n /*foreach ($fields as $name => $content) {\r\n $lines[] = $name . ' : ' . $content;\r\n }*/\r\n return $body;\r\n }", "function schedule_notification(){\n\n\n\n $trainer = $_POST['trainer_id'];\n\n $post_id = $_POST['post_id'];\n\n $trainer_name = get_the_title($trainer);\n\n $schedule_name = get_the_title($post_id);\n\n $fname = $_POST['fname'];\n\n $lname = $_POST['lname'];\n\n $email = $_POST['email'];\n\n $blog_title = get_bloginfo( 'name' );\n\n $admin_email = get_option( 'admin_email' );\n\n $schedule_date = get_post_meta($post_id,'schedule_date_meta',true);\n\n // echo '<pre>';\n\n // print_r($schedule_date);\n\n // echo '</pre>';\n\n\n\n // exit;\n\n \n\n //$html_content = 'Hello , Bingooo' ;\n\n $html = '<table bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tableContent\" align=\"center\" style=\"font-family:Helvetica, Arial,serif;\">\n\n <tbody>\n\n <tr>\n\n <td><table width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" bgcolor=\"#ffffff\" class=\"MainContainer\">\n\n <tbody>\n\n <tr>\n\n <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\n <tbody>\n\n <tr>\n\n <td valign=\"top\" width=\"40\">&nbsp;</td>\n\n <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\n <tbody>\n\n <!-- =============================== Header ====================================== --> \n\n <tr>\n\n <td height=\"75\" class=\"spechide\"></td>\n\n\n\n <!-- =============================== Body ====================================== -->\n\n </tr>\n\n <tr>\n\n <td class=\"movableContentContainer \" valign=\"top\">\n\n <div class=\"movableContent\" style=\"border: 0px; padding-top: 0px; position: relative;\">\n\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n\n\n\n <tr>\n\n <td align=\"left\">\n\n <div class=\"contentEditableContainer contentTextEditable\">\n\n <div class=\"contentEditable\">\n\n <h2 >Schedule Notification</h2>\n\n </div>\n\n </div>\n\n </td>\n\n </tr>\n\n\n\n <tr><td height=\"15\"> </td></tr>\n\n\n\n <tr>\n\n <td align=\"left\">\n\n <div class=\"contentEditableContainer contentTextEditable\">\n\n <div class=\"contentEditable\">\n\n <table style=\"width:100%\">\n\n <tr >\n\n <td align=\"left\"><b>Schedule Name</b></td>\n\n <td align=\"left\">'.$schedule_name.'</td>\n\n </tr>\n\n <tr >\n\n <td align=\"left\"><b>User Name</b></td>\n\n <td align=\"left\">'.$fname.'&nbsp;'.$lname.'</td>\n\n </tr>\n\n <tr >\n\n <td align=\"left\"><b>User Email</b></td>\n\n <td align=\"left\">'.$email.'</td>\n\n </tr>\n\n <tr >\n\n <td align=\"left\"><b>Schedule Date</b></td>\n\n <td align=\"left\">'.$schedule_date.'</td>\n\n </tr>\n\n <tr >\n\n <td align=\"left\"><b>Trainer Name</b></td>\n\n <td align=\"left\">'.$trainer_name.'</td>\n\n </tr>\n\n </table>\n\n </div>\n\n </div>\n\n </td>\n\n </tr>\n\n\n\n </table>\n\n </div>\n\n <div class=\"movableContent\" style=\"border: 0px; padding-top: 0px; position: relative;\">\n\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\n <tbody>\n\n <tr>\n\n <td height=\"65\">\n\n </tr>\n\n <tr>\n\n <td style=\"border-bottom:1px solid #DDDDDD;\"></td>\n\n </tr>\n\n <tr><td height=\"25\"></td></tr>\n\n <tr>\n\n <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\n <tbody>\n\n <tr>\n\n <td valign=\"top\" class=\"specbundle\"><div class=\"contentEditableContainer contentTextEditable\">\n\n <div class=\"contentEditable\" align=\"center\">\n\n <p style=\"text-align:left;color:#CCCCCC;font-size:12px;font-weight:normal;line-height:20px;\">\n\n <span style=\"font-weight:bold;\">'.$blog_title.'</span>\n\n <br>\n\n '.$admin_email.'\n\n <br>\n\n </p>\n\n </div>\n\n </div></td>\n\n <td valign=\"top\" width=\"30\" class=\"specbundle\">&nbsp;</td>\n\n <td valign=\"top\" class=\"specbundle\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\n <tbody>\n\n </tbody>\n\n </table>\n\n </td>\n\n </tr>\n\n </tbody>\n\n </table>\n\n </td>\n\n </tr>\n\n <tr><td height=\"88\"></td></tr>\n\n </tbody>\n\n </table>\n\n\n\n </div>\n\n <!-- =============================== footer ====================================== -->\n\n\n\n </td>\n\n </tr>\n\n </tbody>\n\n </table>\n\n </td>\n\n <td valign=\"top\" width=\"40\">&nbsp;</td>\n\n </tr>\n\n </tbody>\n\n </table>\n\n </td>\n\n </tr>\n\n </tbody>\n\n </table>\n\n </td>\n\n </tr>\n\n </tbody>\n\n </table>\n\n ';\n\n /* sent notification to admin */\n\n\n\n\n\n $mail_subject = 'Schedule Notification'; \n\n $message = $html;\n\n $subject= $mail_subject;\n\n $sender = $admin_email;\n\n $user_email = $email;\n\n $admin_mail = $admin_email;\n\n $headers[] = 'MIME-Version: 1.0' . \"\\r\\n\";\n\n $headers[] = 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\n $headers[] = \"X-Mailer: PHP \\r\\n\";\n\n $headers[] = 'From: '.$sender.' < '.$admin_email.'>' . \"\\r\\n\";\n\n add_filter( 'wp_mail_content_type', 'schedule_quiz_set_content_type' );\n\n\n\n //echo $mail_subject;\n\n $u_mail = wp_mail( $user_email, $subject, $message, $headers );\n\n $a_mail = wp_mail( $admin_mail, $subject, $message, $headers );\n\n if($a_mail)\n\n {\n\n $json['msg'] = \"Mail Send Successfully\";\n\n $json['error'] = false;\n\n echo json_encode($json);\n\n } \n\n else \n\n {\n\n $json['msg'] = \"Failed\";\n\n $json['error'] = false;\n\n echo json_encode($json);\n\n}\n\n\n\ndie();\n\n}", "public function build_email_body_sections() {\n\n\t\t// Set an array of the sections.\n\t\t$body_args = array(\n\t\t\t'introduction' => $this->get_content_body_introduction( $this->customer ),\n\t\t\t'product_list' => $this->products,\n\t\t\t'closing' => $this->get_content_body_closing( $this->customer ),\n\t\t);\n\n\t\t// Filter all the known strings.\n\t\t$body_args = array_map( array( $this, 'format_string' ), $body_args );\n\n\t\t// Return the filtered array.\n\t\treturn apply_filters( Core\\HOOK_PREFIX . 'reminder_email_html_content_body_args', $body_args, $this->order_id );\n\t}", "function bodytext($htmli, $norep, $title) {\n $rep = \"\";\n if($norep == true) {\n $rep = '<br><br><center><span style=\"font-size:12px;\">Ce mail a été envoyé automatiquement, veuillez ne pas y répondre.</span></center>';\n }\n $htmli = preg_replace(\"/\\<a /i\", '<a style=\"color: #218cb9;\" ', $htmli);\n $html = '<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>'.$title.'</title><style type=\"text/css\"> a { color: #218cb9; } </style></head>\n<body style=\"width:100% !important; background-color:#FFFFFF; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; height:100%;\">';\n $html .= '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"font-family: Arial, Helvetica, sans-serif;\" align=\"center\"><tr><td align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" align=\"center\"><tr style=\"background-color:#df755c;\"><td align=\"left\" width=\"126\"><img src=\"'.$this->url_site.$this->folderb.'img/mail/logo.jpg\" height=\"60\" width=\"126\"></td><td align=\"right\" width=\"264\"><img src=\"'.$this->url_site.$this->folderb.'img/mail/header.jpg\" height=\"60\" width=\"264\"></td></tr>';\n $html .= '<tr style=\"background-color:#FFFFFF;\"><td colspan=\"2\" style=\"word-break:break-all; word-wrap:break-word; padding:25px 20px 0px 20px; text-align:left;\" align=\"left\">'.$htmli.'<br><br>L\\'équipe Swappy.'.$rep.'</td></tr>';\n $html .= '<tr style=\"background-color:#FFFFFF;\"><td style=\" padding:5px 0px 0px 0px;\" colspan=\"2\" align=\"center\"><hr><img src=\"'.$this->url_site.$this->folderb.'img/mail/follow.jpg\" height=\"26\" width=\"248\"></td></tr><tr style=\"background-color:#FFFFFF; padding:10px 0px 0px 0px;\"><td align=\"center\" colspan=\"2\"><a href=\"https://www.facebook.com/SwappyLaPlateforme\" style=\"color: #218cb9; \"><img border=\"0\" src=\"'.$this->url_site.$this->folderb.'img/mail/fb.jpg\" height=\"40\" width=\"55\"></a><a href=\"https://twitter.com/_Swappy\" style=\"color: #218cb9;\"><img src=\"'.$this->url_site.$this->folderb.'img/mail/tw.jpg\" border=\"0\" height=\"40\" width=\"55\"></a></td></tr>';\n $html .= '</table></td></tr></table></body></html>';\n return $html;\n }", "protected function plainTextEmail() {\n $formatService = Gdn::formatService();\n\n $email = [\n 'banner' => val('alt', $this->image).' '.val('link', $this->image),\n 'title' => $this->getTitle(),\n 'lead' => $this->getLead(),\n 'message' => $this->getMessage(),\n 'button' => sprintf(t('%s: %s'), val('text', $this->button), val('url', $this->button)),\n 'footer' => $this->getFooter()\n ];\n\n foreach ($email as $key => $val) {\n if (!$val) {\n unset($email[$key]);\n } else {\n // Add some additional padding, where necessary, to improve the appearance of plain-text messages.\n if ($key == 'message') {\n $email[$key] = \"<br>$val<br>\";\n } elseif ($key == \"banner\") {\n $email[\"banner\"] = \"{$val}<br>\";\n }\n }\n }\n\n $body = implode(\"<br>\", $email);\n // Treat the HTML as WYSIWYG for the format's preferred handling of breaks/newlines.\n $result = $formatService->renderPlainText($body, WysiwygFormat::FORMAT_KEY);\n return $result;\n }", "private function recuperarDatosAccesoMailBody($nombre, $email, $password){\n $html = '<html><body>';\n // $html .= '<table style=\"width:600px;\" >'; \n // $html .= \"<tbody>\";\n // $html .= \"<tr>\"; \n // $html .= '<td style=\"padding: 10px;\">Estimado '.$nombre.' recibimos su solicitud de recuperacion de contraseña.</td>'; \n // $html .= \"</tr>\"; \n // $html .= \"<tbody>\";\n // $html .= \"<tr>\"; \n // $html .= '<td style=\"padding: 10px;\">Sus datos de acceso son:.</td>';\n // $html .= '<td>E-mail: '.$email.'<br> Contraseña: '.$password.'</td>';\n // $html .= \"</tr>\"; \n // $html .= \"</tbody>\";\n // $html .= \"<tfoot>\";\n // $html .= \"<tr>\";\n // $html .= '<td style=\"font-size: 12px; margin-top: 30px;\"><br/>Este mensaje es enviado de forma automática favor de no responder.</td>';\n // $html .= \"</tr>\"; \n // $html .= \"</tfoot>\";\n // $html .= '</table>';\n\n $html .= '<table style=\"width:600px;\" >'; \n $html .= '<tbody>';\n $html .= '<tr>';\n $html .= '<td colspan=\"2\" style=\"padding: 10px;\">Estimado <b>'.$nombre.'</b>, recibimos su solicitud de recuperación de contraseña. tus datos de acceso a la aplicación son:</td>';\n $html .= '</tr>';\n $html .= '</tbody>';\n $html .= '<tbody>';\n $html .= '<tr>';\n $html .= '<td width=\"115\"><b>E-mail:</b></td>';\n $html .= '<td width=\"475\">'.$email.'</td>';\n $html .= '</tr>';\n $html .= '<tr>';\n $html .= '<td><b>Contraseña</b></td>';\n $html .= '<td>'.$password.'</td>';\n $html .= '</tr>';\n $html .= '<tr>';\n $html .= '<td colspan=\"2\">&nbsp;</td>';\n $html .= '</tr>';\n $html .= '<tr>';\n $html .= '<td colspan=\"2\"><p>Una vez iniciado sesión podrás cambiar tu contraseña <br/> en la sección de perfil.</p></td>';\n $html .= '</tr>';\n $html .= '<tr>';\n $html .= '<td colspan=\"2\">&nbsp;</td>';\n $html .= '</tr>';\n $html .= '</tbody>';\n $html .= '<tfoot>';\n $html .= '<tr>';\n $html .= '<td colspan=\"2\" style=\"font-size: 12px; margin-top: 30px;\">Este mensaje es enviado de forma automática favor de no responder.</td>';\n $html .= '</tr>';\n $html .= '</tfoot>';\n $html .= '</table>';\n\n\n $html .= '</body></html>';\n return $html;\n }", "public function actionMy_email_body(){\n\t\tif ($this->isGuest){ header('HTTP/1.0 403 Forbidden'); exit(); }\n\t\t$box = !isset($_GET['ref']) ? null : $_GET['ref'];\n\t\t$email_id = !isset($_GET['email_id']) ? null : $_GET['email_id'];\n\t\t$model = new Email($this->adapter);\n if (!isset($box) || $box < 0){ $this->goHome(); }\n\t\t$model->getById($email_id);\n\t\t$date = new DateText($model->date);\n\t\t$message = ($model->message);\n\t\tif(SiteController::isHTML($message) == true){\n\t\t\theader(\"text/html; charset=UTF-8\");\n\t\t\techo \"<style>\"\n\t\t\t\t.\"html { zoom: 0.85 !important;overflow: auto; }\\n\"\n\t\t\t.\"</style>\";\n\t\t} else {\n\t\t\t// header(\"Content-Type: text/plain; charset=UTF-8\");\n\t\t\theader(\"text/plain; charset=UTF-8\");\n\t\t\t$message = str_replace([\"\\n\"], ['<br />'], $message);\n\t\t}\n\t\t// $message = preg_replace(\"/^http:/i\", \"https:\", $message);\n\t\t#$arr1 = [\"/href=\\\"http:/\", \"/target=(.*)/\"];\n\t\t#$arr2 = [\"href=\\\"https:\", \"target=\\\"_blancko\\\"\"];\n\t\t\n\t\t$arr1 = [\"/href=\\\"http:/\"];\n\t\t$arr2 = [\"href=\\\"https:\"];\n\t\t$message = preg_replace($arr1, $arr2, $message);\n\t\t$arr1 = [\"/href=\\\"http:/\"];\n\t\t$arr2 = [\"href=\\\"https:\"];\n\t\t$message = preg_replace($arr1, $arr2, $message);\n\t\t\n\t\t$message = mb_convert_encoding(utf8_encode($message), 'Windows-1252', 'UTF-8');\n\t\t\n\t\t// $message = mb_convert_encoding(utf8_decode($message), 'UTF-8', 'Windows-1252');\n\t\t\n\t\t//$message = (mb_convert_encoding($message, 'Windows-1252','UTF-8') !== $message) ? \"\" : $message;\n\t\techo ($message);\n\t\treturn $message;\n\t}", "function qb_build_email_html( $user_email, $page_url, $user_agent, $feedback ) {\r\n\t$email_header = \"New Beta Feedback\";\r\n\t$email_body = '\r\n\t<p>Someone just left some beta feedback. His information is below.</p>\r\n\t<p><b>Email: </b> ' . $user_email . '</p>\r\n\t<p><b>Page: </b> ' . $page_url . '</p>\r\n\t<p><b>Browser: </b> ' . $user_agent . '</p>\r\n\t<p><b>Feedback: </b></p>' . $feedback;\r\n\r\n\t$template = @file_get_contents( get_template_directory_uri() . '/includes/mandrill/templates/master-html.html' );\r\n\t\r\n\tif ( $template ) {\r\n\t\t$template = str_replace( '{{HEADER}}', $email_header, $template );\r\n\t\t$template = str_replace( '{{BODY}}', $email_body, $template );\r\n\t\t$template = str_replace( '{{NOTIFICATION}}', '', $template );\r\n\t}\r\n\r\n\treturn $template;\r\n}", "public function create()\n\t{\n\t \n\t\treturn view('admin.reminder.create');\n\t}", "public function get_content_plain() {\n\n\t\t// Set up the base args for the plain text email.\n\t\t$base_args = array(\n\t\t\t'order' => $this->object,\n\t\t\t'email_heading' => $this->get_heading(),\n\t\t\t'recipient' => $this->recipient,\n\t\t\t'sections' => $this->build_email_body_sections(),\n\t\t\t'sent_to_admin' => false,\n\t\t\t'plain_text' => true,\n\t\t\t'email' => $this,\n\t\t);\n\n\t\t// Filter the args.\n\t\t$plain_args = apply_filters( Core\\HOOK_PREFIX . 'reminder_email_plain_args', $base_args );\n\n\t\t// Return the template plain text using our args.\n\t\treturn wc_get_template_html( $this->template_plain, $plain_args );\n\t}" ]
[ "0.6631557", "0.6420379", "0.63299495", "0.6158953", "0.6147146", "0.61135554", "0.6090344", "0.5960014", "0.59552383", "0.5941967", "0.5932516", "0.59140533", "0.5911628", "0.5886758", "0.58838487", "0.58635163", "0.585791", "0.58491534", "0.58477116", "0.58282536", "0.5828042", "0.5825732", "0.5790741", "0.57591563", "0.57009345", "0.56985515", "0.56918776", "0.56794715", "0.5659073", "0.56512964" ]
0.6843044
0
Asserts a certain item at a certain index of the typed list.
private function assertIndexValidAndHoldsExpectedItem($index, Item $item) { $this->assertAttributeSame($index, 'position', $this->typedList); $this->assertSame($index, $this->typedList->key()); $this->assertTrue($this->typedList->valid()); $this->assertSame($item, $this->typedList->current()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function itemAt($index) {}", "public function test_item(array $provided, array $expected) {\n\t\t\t$p0 = ITuple\\Type::make($provided[0]);\n\t\t\t$e0 = $expected[0];\n\n\t\t\tforeach ($e0 as $i => $e) {\n\t\t\t\t$this->assertSame($e, $p0->item(IInt32\\Type::box($i))->unbox());\n\t\t\t}\n\t\t}", "public function testAtSuccessful(): void\n {\n $source = UntypedVector::create([1 => 'Foo', 2 => 666]);\n\n $this->assertSame(666, $source->at(2));\n $this->assertSame('Foo', $source->at(1));\n $this->assertEquals('666', $source->at(2));\n $this->assertNotSame('666', $source->at(2));\n }", "public function testGetWithNthParameterReturnsNthItem()\n {\n $this->assertEquals(self::FIRST_VALUE, $this->store->get(self::KEY, 0));\n }", "private function assertValidIndex($index) {\n if ($index >= $this->length || $index < 0) {\n throw new FrameEx('Invalid index: '.$index.' (length: '.$this->length.')');\n }\n }", "public function testInList(): void\n {\n $validator = new Validator();\n $this->assertProxyMethod($validator, 'inList', ['a', 'b'], [['a', 'b']]);\n $this->assertNotEmpty($validator->validate(['username' => 'c']));\n\n $fieldName = 'field_name';\n $rule = 'inList';\n $expectedMessage = 'The provided value must be one of: `a, b`';\n $list = ['a', 'b'];\n $this->assertValidationMessage($fieldName, $rule, $expectedMessage, $list);\n\n // This should lead to a RangeException or an UnexpectedValueException, instead.\n // As it could never successfully validate the data.\n $expectedMessage = 'The provided value must be one of: ``';\n $list = [];\n $this->assertValidationMessage($fieldName, $rule, $expectedMessage, $list);\n }", "public function testListOrdering()\n {\n $obj = new RecentlyUsedList();\n $obj->add('First');\n $obj->add('Last');\n $this->assertEquals('Last', $obj->indexAt(0), 'Error: first item in list should be last added!');\n $this->assertEquals('First', $obj->indexAt($obj->length() - 1), 'Error: last-in should be first-out!');\n }", "public function testArrayIndex()\n {\n $token = $this->getTargetToken('/* testArrayIndex */', T_FN);\n $this->backfillHelper($token);\n $this->scopePositionTestHelper($token, 8, 17, 'comma');\n\n }", "public function testListsAreItemLists() {\n $lists = $this->lists->lists();\n $this->assertInstanceOf('NYPL\\Bibliophpile\\ItemList', $lists[0]);\n }", "public function checkItem($item);", "public function testAtUnsuccessful(): void\n {\n $source = UntypedVector::create([1 => 'Foo', 2 => 666]);\n\n $this->expectException(InvalidOffsetException::class);\n\n $source->at(3);\n }", "public function testHasLists() {\n $this->assertInternalType('array', $this->lists->lists());\n }", "function assertCrudList($view)\n {\n $this->response->assertStatus(200)\n ->assertViewIs($view);\n }", "public function getItemByIndex($index) {\n if ($items = $this->items($index,1)) {\n return current($items); \n } else {\n return false;\n }\n }", "protected abstract function getExpectedItems();", "public function testElementListValidationCorrectValues(ElementListInterface $template)\n\t{\n\t\t$input = [\n\t\t\t\"symfony\" => \"abcd\",\n\t\t\t\"zend\" => \"abcd\",\n\t\t\t\"callback\" => \"abcd\",\n\t\t];\n\t\t\n\t\t$this->assertTrue($template->validate($input));\n\t\t\n\t\t$output = [\n\t\t\t\"symfony\" => \"abcd\",\n\t\t\t\"zend\" => \"abcd\",\n\t\t\t\"callback\" => \"abcd\",\n\t\t];\n\t\t\n\t\t$this->assertEquals($output, $template->getValues());\n\t}", "private function isElementIndex($index) {\n\t\treturn (($index >= 0) && ($index <= $this->size));\n\t}", "abstract protected function matchesList(array $item);", "public static function assertListContains($list, $key, $value) {\n $valid = false;\n foreach($list as $object) {\n if($object->$key == $value) {\n $valid = true;\n break;\n }\n }\n self::assertTrue($valid, 'Provided list did not have any objects with ' . $key . ' equal to ' . $value);\n }", "#[@test]\n public function isInjectedByIndex() {\n $this->assertTrue($this->args->isInjected(0));\n }", "public function insert($index, $item);", "public function testGetWithNthKeyReturnsNthItem()\n {\n $this->assertEquals(self::FIRST_VALUE, $this->store->get('1st ' . self::KEY));\n }", "function testAt($index)\r\n\t{\r\n\t\tif (!isset($this->tests[$index]))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn $this->tests[$index];\r\n\t}", "public function testNavData()\n {\n $test = Proto\\Data\\NavData::getItems();\n $this->assertTrue(is_array($test));\n }", "public function testAdd () : void {\n $count = count($this->list);\n\n $this->list->add(\"ANOTHER\");\n\n $this->assertEquals($count + 1, count($this->list));\n }", "public function testReferenceNumber($item, $assert)\n {\n $this->assertSame($assert, FiValidation::referenceNumber($item));\n }", "function &getItem($idx) \n {\n if ($idx >= count($this->_items)) {\n $err = VWP::raiseWarning(\"No more items!\",get_class($this).\"::getItem\",ERROR_NO_MORE_ITEMS,false);\n return $err;\n }\n return $this->_items[$idx]; \n }", "public function getItemByIndex($idx) {\n\n // check parameters\n $idx = intval($idx);\n if (($idx < 0) ||($idx >= $this->count())) {\n throw new tx_pttools_exception('invalid index', 3);\n }\n $itemArr = array_values($this->itemsArr);\n return $itemArr[$idx];\n \n }", "public function offsetExists()\n {\n $collection = new EntityCollection();\n $collection[] = new SimpleEntity(['stringField' => 'abc']);\n\n $this->assertFalse(isset($collection['foo']));\n $this->assertTrue(isset($collection['0']));\n $this->assertFalse(isset($collection[1]));\n }", "public function processAssert(\n CustomerIndexNew $customerIndexNew,\n Customer $customer,\n $expectedList\n ) {\n $customerIndexNew->getCustomerForm()\n ->openTab('account_information');\n $customerIndexNew->getCustomerForm()->fillCustomer($customer);\n $customerIndexNew->getCustomerForm()\n ->openTab('addresses');\n $tab = $customerIndexNew->getCustomerForm()\n ->getTab('addresses');\n $countriesList = $tab->getCountriesList(1);\n sort($countriesList);\n sort($expectedList);\n \\PHPUnit\\Framework\\Assert::assertEquals(\n $countriesList,\n $expectedList,\n 'Wrong country list is displayed.'\n );\n }" ]
[ "0.6055898", "0.57713795", "0.568856", "0.5433869", "0.53608954", "0.5346645", "0.52428454", "0.52348197", "0.5205533", "0.51966745", "0.51491344", "0.50462437", "0.5039251", "0.5033594", "0.50243175", "0.50210714", "0.50183946", "0.5018298", "0.50015163", "0.49893853", "0.4986596", "0.49803087", "0.49705422", "0.49383584", "0.49372172", "0.49371484", "0.4922353", "0.48747042", "0.48718226", "0.48700768" ]
0.7147714
0
Print the layout XML for block "right" in Magento's layout config.
public function showMageRight() { $controller = Mage::app()->getFrontController(); $controller->setNoRender(true); $action = $controller->getAction(); if (!empty($action)) { $right = $action->getLayout()->getBlock('right'); echo $right->getChildHtml(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function right() {\n\t\tif($this->Templates->exists(\"right\")) {\n\t\t\tif(count($this->views) > 0) {\n\t\t\t\tfor($i = 0; $i <= count($this->views) - 1; $i++) {\n\t\t\t\t\tif($this->views[$i][\"vars\"] !== FALSE) {\n\t\t\t\t\t\t$this->Templates->vars($this->views[$i][\"vars\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->Templates->load(\"right\");\n\t\t}\n\t}", "function right_block() \r\n {\r\n $ret_val = container();\r\n\t\t\r\n $hr = html_hr();\r\n $hr->set_tag_attribute(\"noshade\");\r\n $hr->set_tag_attribute(\"size\", 2);\r\n\t $ret_val->add($hr);\r\n\t\t\r\n\t $div = html_div();\r\n \t $div->add( Theme::getThemeImage('edcenters.png') );\r\n \r\n $infoCourse = $this->getViewVariable('infoCourse');\r\n $path_arr = $infoCourse['path']; \r\n $strPath = $path_arr['institution'];\r\n if ( $path_arr['faculty'] != '' ) {\r\n $strPath .= '&nbsp;>&nbsp;';\r\n }\r\n $strPath .= $path_arr['faculty']; \r\n if ( $path_arr['department'] != '' ) {\r\n $strPath .= '&nbsp;>&nbsp;';\r\n }\r\n $strPath .= $path_arr['department'];\r\n if ( $path_arr['area'] != '' ) {\r\n $strPath .= '&nbsp;>&nbsp;';\r\n }\r\n $strPath .= $path_arr['area'];\r\n $div->add( $strPath );\r\n\t\t\r\n $div->add(html_br());\r\n\r\n \r\n $div->add(Theme::getThemeImage('info.png', $infoCourse['name']) );\r\n $div->add(html_b(html_a(Util::format_URLPath(\"course/index.php\", 'course=' . $infoCourse['course_id']), $infoCourse['name'])));\r\n\t\t$div->add(html_br());\r\n \r\n $mailLink = Theme::getMailURL($infoCourse['email'], Session::getValue('migueloo_userinfo_user_id') ); \r\n $div->add(html_b( agt('miguel_responsable') . ' '), html_a( $mailLink, $infoCourse['user_responsable']));\r\n $div->add(html_br(2));\r\n\t\t\r\n $table = html_table(\"100%\",0,8,0);\r\n $table->set_class(\"simple\");\r\n $table->set_id(\"modules\");\r\n $table->set_tag_attribute(\"valign\", \"top\"); \r\n\t\t\r\n /*$arr_elem = $this->_getModuleElements();\r\n $int_elem = count($arr_elem);\r\n\r\n for($i=0; $i<$int_elem; $i = $i+2){\r\n $row = html_tr();\r\n\t\t\t$col = html_td(\"\",\"left\"); \r\n $col->add( $this->imag_ref( Util::format_URLPath( $arr_elem[$i][0]), Theme::getThemeImagePath( $arr_elem[$i][1] ), agt('miguel_Module' . $arr_elem[$i][2]) ) );\r\n $row->add($col);\r\n\r\n $col = html_td(\"\",\"left\");\r\n if ( $arr_elem[$i+1][0] != '' ){\r\n\t\t\t $col->add( $this->imag_ref(Util::format_URLPath( $arr_elem[$i+1][0]), Theme::getThemeImagePath( $arr_elem[$i+1][1] ), agt( 'miguel_Module' . $arr_elem[$i+1][2]) ));\r\n\t\t\t $row->add($col);\r\n \t}\r\n \t $table->add_row($row); \r\n \t}\r\n\t\t*/\r\n\t\t$is_admin = $this->getViewVariable('isCourseAdmin');\r\n\t\t$arr_elem = $this->getViewVariable('visual_array');\r\n\t\t//Debug::oneVar($arr_elem, __FILE__,__LINE__);\r\n\t\t$int_elem = count($arr_elem);\r\n\t\t\r\n\t\t$bol_row = true;\r\n\t\t \r\n\t\tfor($i=0; $i<$int_elem; $i++){\r\n\t\t\t$item = $i+1;\r\n\t\t\tif($bol_row){\r\n\t\t\t\t$row = html_tr();\r\n\t\t\t\t$bol_row_add = false;\r\n\t\t\t}\r\n \t\t\t\r\n $row->add( $this->_formatRowElement($arr_elem[$i], $item, $is_admin));\r\n \r\n\t\t\t$bol_row = ($bol_row)?false:true; \r\n\t\t\tif($bol_row){\r\n\t\t\t\t$table->add($row);\r\n\t\t\t\t$bol_row_add = true;\r\n\t\t\t}\r\n\r\n \t}\r\n\t\tif(!$bol_row_add){\r\n\t\t\t$table->add($row);\r\n\t\t}\r\n \t\r\n $div->add( $table );\r\n $ret_val->add($div);\r\n \t\r\n return $ret_val;\r\n }", "public function view_right_sidebar(){\n $this->data[\"result\"] = $this->ArticleModel->get(Router::get('data_id'));\n $this->View->render('blog/view_right_sidebar',$this->data);\n }", "function wetkit_menu_menu_link_menu_block_sidebar_right($variables) {\n $element = $variables['element'];\n $sub_menu = '';\n if (isset($element['#below']) && is_array($element['#below'])) {\n $sub_menu = drupal_render($element['#below']);\n }\n $output = '';\n\n $output .= '<li' . drupal_attributes($element['#attributes']) . '>' . l($element['#title'], $element['#href'], $element['#localized_options']) . $sub_menu . \"</li>\\n\";\n\n return $output;\n}", "public function layout();", "public function actionFieldLayout()\n {\n $this->provideTemplate('field_layout');\n }", "public function layout() {}", "public function RightSidebar()\n {\n return view('ps-store/right-sidebar');\n }", "public function isRightPlacement()\n {\n return $this->getPlacement() === $this->getWidgetSettings()->getProductWidgetPlacement();\n }", "public function setLayout()\n\t{\n \t$this->_helper->layout->setLayout('admin');\t\n\t}", "function meta_layout(){\n\n\tglobal $cs_xmlObject;\n\n\tif ( empty($cs_xmlObject->sidebar_layout->cs_layout) ) $cs_layout = \"\"; else $cs_layout = $cs_xmlObject->sidebar_layout->cs_layout;\n\n\tif ( empty($cs_xmlObject->sidebar_layout->cs_sidebar_left) ) $cs_sidebar_left = \"\"; else $cs_sidebar_left = $cs_xmlObject->sidebar_layout->cs_sidebar_left;\n\n\tif ( empty($cs_xmlObject->sidebar_layout->cs_sidebar_right) ) $cs_sidebar_right = \"\"; else $cs_sidebar_right = $cs_xmlObject->sidebar_layout->cs_sidebar_right;\n\n ?>\n\n\t<div class=\"elementhidden\">\n\n <div class=\"clear\"></div>\n\n \t<div class=\"opt-head\">\n\n <h4>Layout Options</h4>\n\n <div class=\"clear\"></div>\n\n </div>\n\n <ul class=\"form-elements\">\n\n <li class=\"to-label\">\n\n <label>Select Layout</label>\n\n </li>\n\n <li class=\"to-field\">\n\n <div class=\"meta-input\">\n\n <div class='radio-image-wrapper'>\n\n <input <?php if($cs_layout==\"none\")echo \"checked\"?> onclick=\"show_sidebar('none')\" type=\"radio\" name=\"cs_layout\" class=\"radio\" value=\"none\" id=\"radio_1\" />\n\n <label for=\"radio_1\">\n\n <span class=\"ss\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/1.gif\" alt=\"\" /></span>\n\n <span <?php if($cs_layout==\"none\")echo \"class='check-list'\"?> id=\"check-list\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/1-hover.gif\" alt=\"\" /></span>\n\n </label>\n\n </div>\n\n <div class='radio-image-wrapper'>\n\n <input <?php if($cs_layout==\"right\")echo \"checked\"?> onclick=\"show_sidebar('right')\" type=\"radio\" name=\"cs_layout\" class=\"radio\" value=\"right\" id=\"radio_2\" />\n\n <label for=\"radio_2\">\n\n <span class=\"ss\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/2.gif\" alt=\"\" /></span>\n\n <span <?php if($cs_layout==\"right\")echo \"class='check-list'\"?> id=\"check-list\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/2-hover.gif\" alt=\"\" /></span>\n\n </label>\n\n </div>\n\n <div class='radio-image-wrapper'>\n\n <input <?php if($cs_layout==\"left\")echo \"checked\"?> onclick=\"show_sidebar('left')\" type=\"radio\" name=\"cs_layout\" class=\"radio\" value=\"left\" id=\"radio_3\" />\n\n <label for=\"radio_3\">\n\n <span class=\"ss\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/3.gif\" alt=\"\" /></span>\n\n <span <?php if($cs_layout==\"left\")echo \"class='check-list'\"?> id=\"check-list\"><img src=\"<?php echo get_template_directory_uri()?>/images/admin/3-hover.gif\" alt=\"\" /></span>\n\n </label>\n\n </div>\n\n </div>\n\n </li>\n\n </ul>\n\n <ul class=\"form-elements meta-body\" style=\" <?php if($cs_sidebar_left == \"\"){echo \"display:none\";}else echo \"display:block\";?>\" id=\"sidebar_left\" >\n\n <li class=\"to-label\">\n\n <label>Select Left Sidebar</label>\n\n </li>\n\n <li class=\"to-field\">\n\n <select name=\"cs_sidebar_left\" class=\"select_dropdown\" id=\"page-option-choose-left-sidebar\">\n\n <?php\n\n $cs_theme_option = get_option('cs_theme_option');\n\n if ( isset($cs_theme_option['sidebar']) and count($cs_theme_option['sidebar']) > 0 ) {\n\n foreach ( $cs_theme_option['sidebar'] as $sidebar ){\n\n ?>\n\n <option <?php if ($cs_sidebar_left==$sidebar)echo \"selected\";?> ><?php echo $sidebar;?></option>\n\n <?php\n\n }\n\n }\n\n ?>\n\n </select>\n\n </li>\n\n </ul>\n\n <ul class=\"form-elements meta-body\" style=\" <?php if($cs_sidebar_right == \"\"){echo \"display:none\";}else echo \"display:block\";?>\" id=\"sidebar_right\" >\n\n <li class=\"to-label\">\n\n <label>Select Right Sidebar</label>\n\n </li>\n\n <li class=\"to-field\">\n\n <select name=\"cs_sidebar_right\" class=\"select_dropdown\" id=\"page-option-choose-right-sidebar\">\n\n <?php\n\n if ( isset($cs_theme_option['sidebar']) and count($cs_theme_option['sidebar']) > 0 ) {\n\n foreach ( $cs_theme_option['sidebar'] as $sidebar ){\n\n ?>\n\n <option <?php if ($cs_sidebar_right==$sidebar)echo \"selected\";?> ><?php echo $sidebar;?></option>\n\n <?php\n\n }\n\n }\n\n ?>\n\n </select>\n\n <input type=\"hidden\" name=\"cs_orderby[]\" value=\"meta_layout\" />\n\n </li>\n\n </ul>\n\n\t</div>\n\n\t<div class=\"clear\"></div>\n\n<?php\t\n\n}", "protected function registerLayoutAfter() {}", "public function renderLayout()\r\n\t{\r\n\t\t$this->view->renderLayout();\r\n\t}", "protected function _preparelayout()\r\n {\r\n $this->addButton(\r\n 'save_and_edit',\r\n [\r\n 'label' => __('Save and Continue Edit'),\r\n 'class' => 'save',\r\n 'data_attribute' => [\r\n 'mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']],\r\n ]\r\n ],\r\n 10\r\n );\r\n\r\n return parent::_prepareLayout();\r\n }", "public function actions() {\n $this->layout = 'person-menu-left';\n }", "public function renderLayout(): void;", "public function getLayout();", "public function getLayout();", "abstract public function getLayout();", "protected function setLayout () {\n\t\tif ($this->_getParam('catalog')) {\n\t\t\t$config = Zend_Registry::getInstance()->config;\n\t\t\tif (count($config->catalog->layouts)) {\n\t\t\t\t$catalogId = $this->_helper->osidId->fromString($this->_getParam('catalog'));\n\t\t\t\tforeach ($config->catalog->layouts as $layoutConfig) {\n\t\t\t\t\tif ($catalogId->isEqual(new phpkit_id_URNInetId($layoutConfig->catalog_id))) {\n\t\t\t\t\t\t$this->_helper->layout()->setLayout($layoutConfig->layout);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getRightnode()\n {\n return $this->getSection()->getRightnode();\n }", "public static function exportLayout();", "protected function layoutStop() {\r\n echo '</html>';\r\n }", "function vodi_header_right_start() {\n ?><div class=\"site-header__right\"><?php\n }", "public function setLayout() {\r\n\t\t$fname = \"setLayout()\";\r\n\t\t\r\n\t\t$this->layout_string = \"\";\r\n\t\t$this->layout_string .= \"<!-- <RADIOBUTTON> -->\\n\";\r\n//\t\t$this->layout_string .= \" <input type=\\\"radio\\\" name=\\\"\".$this->getName().\"\\\" class=\\\"styled\\\"\".$this->getDisabled().\" value=\\\"\".$this->getContent().\"\\\"\".$this->getChecked().\"/>\".$this->getLabel().\"</input>\\n\";\r\n\t\t$this->layout_string .= \" <input type=\\\"radio\\\" name=\\\"\".$this->getName().\"\\\"\".$this->getDisabled().\" value=\\\"\".$this->getContent().\"\\\"\".$this->getChecked().\">\".$this->getLabel().\"</input>\\n\";\r\n\t\t$this->layout_string .= \"<!-- </RADIOBUTTON> -->\\n\";\r\n\t}", "public function getLayoutTemplate($store = null)\n\t{\n\t\treturn 'Mageplaza_Osc/' . $this->getDesignConfig('page_layout', $store);\n\t}", "public static function default_layout( $layout ) {\n\t\t\t$layout = is_rtl() ? 'right' : 'left';\n\t\t\treturn $layout;\n\t\t}", "function save_layout_xml($sxe) {\n\n\t\n\n\tif (empty($_POST['page_title']))\n\n $_POST['page_title'] = \"\";\n\n if (empty($_POST['cs_layout']))\n\n $_POST['cs_layout'] = \"\";\n\n if (empty($_POST['cs_sidebar_left']))\n\n $_POST['cs_sidebar_left'] = \"\";\n\n if (empty($_POST['cs_sidebar_right']))\n\n $_POST['cs_sidebar_right'] = \"\";\n\n\t\t$sxe->addChild('page_title', $_POST['page_title']);\n\t\n\t\t$sidebar_layout = $sxe->addChild('sidebar_layout');\n\n\t\t$sidebar_layout->addChild('cs_layout', $_POST[\"cs_layout\"]);\n\n\t\tif ($_POST[\"cs_layout\"] == \"left\") {\n\n\t\t\t$sidebar_layout->addChild('cs_sidebar_left', $_POST['cs_sidebar_left']);\n\n\t\t} else if ($_POST[\"cs_layout\"] == \"right\") {\n\n\t\t\t$sidebar_layout->addChild('cs_sidebar_right', $_POST['cs_sidebar_right']);\n\n\t\t}else if ($_POST[\"cs_layout\"] == \"both_right\" or $_POST[\"cs_layout\"] == \"both_left\" or $_POST[\"cs_layout\"] == \"both\") {\n\n\t\t\t$sidebar_layout->addChild('cs_sidebar_left', $_POST['cs_sidebar_left']);\n\n\t\t\t$sidebar_layout->addChild('cs_sidebar_right', $_POST['cs_sidebar_right']);\n\n\t\t}\n\n return $sxe;\n\n}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\n\t\t\t$menus = DB::table('main_menu')\t\t\t\t\t\n\t\t\t\t\t->where('is_visible', true)\n ->orderBy('index') \n ->get();\n \n\t\t\t$this->layout = View::make($this->layout)->nest('menu', 'menus.view', array(\n\t\t\t\t'menus' => $menus\n\t\t\t));\n\t\t\t\n\t\t}\n\t}", "public function layouts() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/layouts.php';\n\t}" ]
[ "0.56800765", "0.5631501", "0.5595872", "0.5550594", "0.5443256", "0.5430554", "0.5394051", "0.5313887", "0.53043264", "0.5301611", "0.5261068", "0.5246118", "0.5201114", "0.5188946", "0.51558656", "0.5132507", "0.5109364", "0.5109364", "0.509457", "0.50916743", "0.5083255", "0.5075265", "0.5055476", "0.5044922", "0.5040297", "0.50268644", "0.5022514", "0.49885595", "0.498071", "0.49657398" ]
0.6573303
0